@esri/solutions-components 1.2.0-next.185 → 1.2.0-next.187
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/dist/cdn/2NEAR6UO.js +2 -0
- package/dist/cdn/2PXV5VV3.js +2 -0
- package/dist/cdn/2R7WWRUU.js +2 -0
- package/dist/cdn/2YQZQLV7.js +2 -0
- package/dist/cdn/{OXZUPDUR.js → 2Z4TOYVC.js} +1 -1
- package/dist/cdn/{5X4M5KVC.js → 3A7PC2RZ.js} +1 -1
- package/dist/cdn/3HWKU2CT.js +2 -0
- package/dist/cdn/3P2BL2Z3.js +2 -0
- package/dist/cdn/4CPDEFIT.js +2 -0
- package/dist/cdn/{YWHFGZYE.js → 4N5LEYZP.js} +1 -1
- package/dist/cdn/4VPYQV6U.js +2 -0
- package/dist/cdn/5FFWRFTB.js +2 -0
- package/dist/cdn/6D3THEX6.js +2 -0
- package/dist/cdn/6NLJSGQJ.js +2 -0
- package/dist/cdn/7BDPZCCN.js +2 -0
- package/dist/cdn/7KLXOSZR.js +9 -0
- package/dist/cdn/{IKG4EH3F.js → 7M3GJY6J.js} +1 -70
- package/dist/cdn/7YWKXUNB.js +2 -0
- package/dist/cdn/ARE6CCRL.js +2 -0
- package/dist/cdn/AS6FGEVT.js +2 -0
- package/dist/cdn/BEC6A65P.js +2 -0
- package/dist/cdn/BHSNNVIL.js +2 -0
- package/dist/cdn/BT66JT22.js +2 -0
- package/dist/cdn/{EMDXYQD2.js → C7DWPTJL.js} +1 -1
- package/dist/cdn/{V7WLDWD6.js → CN4TSLTZ.js} +1 -1
- package/dist/cdn/COXCHYSH.js +2 -0
- package/dist/cdn/CQPE3DP5.js +2 -0
- package/dist/cdn/CUCLCYAD.js +2 -0
- package/dist/cdn/CVN6AFUS.js +2 -0
- package/dist/cdn/{EMU7RU4E.js → DOFNBU4Q.js} +1 -1
- package/dist/cdn/DSH7QIEF.js +2 -0
- package/dist/cdn/F26S6XWG.js +2 -0
- package/dist/cdn/FOGXHSRF.js +2 -0
- package/dist/cdn/FP5UBHCW.js +2 -0
- package/dist/cdn/FPW3BDJT.js +2 -0
- package/dist/cdn/FWFL23CM.js +2 -0
- package/dist/cdn/GSQCX3MZ.js +2 -0
- package/dist/cdn/HEW273HR.js +21 -0
- package/dist/cdn/HNGAUICR.js +2 -0
- package/dist/cdn/I3ERNQTX.js +2 -0
- package/dist/cdn/I76VCVNE.js +2 -0
- package/dist/cdn/I7L5AZJF.js +2 -0
- package/dist/cdn/JO3Y54EO.js +2 -0
- package/dist/cdn/{QHPWHMGO.js → KEWRBJOT.js} +3 -215
- package/dist/cdn/LN36O3EB.js +2 -0
- package/dist/cdn/LPPOTZKI.js +2 -0
- package/dist/cdn/MB4AEU7F.js +2 -0
- package/dist/cdn/MGS4TCQO.js +2 -0
- package/dist/cdn/MVNKOMSZ.js +2 -0
- package/dist/cdn/N7S3S2JR.js +2 -0
- package/dist/cdn/NBVFAVYG.js +2 -0
- package/dist/cdn/NPARH7TR.js +2 -0
- package/dist/cdn/O4OJKTDX.js +2 -0
- package/dist/cdn/{BP7SZSWK.js → O55UHOD3.js} +4 -63
- package/dist/cdn/{KYDDWA2X.js → OCJHQZGW.js} +1 -19
- package/dist/cdn/OQVULF2Q.js +2 -0
- package/dist/cdn/{QYRLQLM5.js → OUH4HVG4.js} +26 -348
- package/dist/cdn/OWZH3MGL.js +2 -0
- package/dist/cdn/{YIYEKZTS.js → PFQDRDKQ.js} +1 -1
- package/dist/cdn/{VYH3PV4R.js → PJ2IZ77K.js} +1 -1
- package/dist/cdn/QPEQNTE2.js +2 -0
- package/dist/cdn/R47PFN27.js +2 -0
- package/dist/cdn/R6QJKOAM.js +2 -0
- package/dist/cdn/{ABSRNM72.js → RFGSSUZF.js} +1 -1
- package/dist/cdn/RG6FVRCW.js +2 -0
- package/dist/cdn/RWSMIF44.js +2 -0
- package/dist/cdn/RZKHWRGX.js +2 -0
- package/dist/cdn/SE62MNUF.js +2 -0
- package/dist/cdn/{YOC7BCPQ.js → TA7XOCI6.js} +1 -1
- package/dist/cdn/{ADWFVM7J.js → TWVENJ3Z.js} +1 -1
- package/dist/cdn/U3MPHGGT.js +2 -0
- package/dist/cdn/UNLJYJJZ.js +2 -0
- package/dist/cdn/V25NUVVQ.js +2 -0
- package/dist/cdn/V4JECR5W.js +2 -0
- package/dist/cdn/VFROSB3U.js +2 -0
- package/dist/cdn/VHA56S7W.js +2 -0
- package/dist/cdn/{VYQEF3JJ.js → VTCGJW3Y.js} +42 -42
- package/dist/cdn/{W4YXXJAS.js → W4773WDH.js} +1 -1
- package/dist/cdn/{UMA3V2BH.js → W4DGTEPL.js} +1 -1
- package/dist/cdn/WB6EAOJX.js +2 -0
- package/dist/cdn/{YOH3QK7R.js → WFEXGIFH.js} +1 -1
- package/dist/cdn/WI7VFPQ3.js +2 -0
- package/dist/cdn/X7ATJSHR.js +2 -0
- package/dist/cdn/XGHAWRFI.js +2 -0
- package/dist/cdn/XU4DBG4C.js +2 -0
- package/dist/cdn/Y2S3AB43.js +2 -0
- package/dist/cdn/Y4QWAYNX.js +2 -0
- package/dist/cdn/{HQIGBD6B.js → ZVLL5DZC.js} +1 -1
- package/dist/cdn/assets/arcgis-pdf-creator/labelFormats.json +1 -191
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ar.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bg.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bs.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ca.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.cs.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.da.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.de.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.el.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.en.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.es.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.et.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fi.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fr.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.he.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hr.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hu.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.id.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.it.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ja.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ko.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lt.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lv.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.nl.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.no.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pl.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-BR.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-PT.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ro.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ru.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sk.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sl.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sr.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sv.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.th.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.tr.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.uk.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.vi.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-CN.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-HK.json +1 -29
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-TW.json +1 -29
- package/dist/cdn/assets/buffer-tools/t9n/messages.ar.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.bg.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.bs.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.ca.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.cs.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.da.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.de.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.el.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.en.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.es.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.et.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.fi.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.fr.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.he.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.hr.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.hu.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.id.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.it.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.ja.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.ko.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.lt.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.lv.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.nb.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.nl.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.no.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.pl.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.pt-BR.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.pt-PT.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.ro.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.ru.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.sk.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.sl.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.sr.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.sv.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.th.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.tr.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.uk.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.vi.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.zh-CN.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.zh-HK.json +1 -6
- package/dist/cdn/assets/buffer-tools/t9n/messages.zh-TW.json +1 -6
- package/dist/cdn/assets/card-manager/t9n/messages.ar.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.bg.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.bs.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.ca.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.cs.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.da.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.de.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.el.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.en.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.es.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.et.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.fi.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.fr.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.he.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.hr.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.hu.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.id.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.it.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.ja.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.ko.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.lt.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.lv.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.nb.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.nl.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.no.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.pl.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.pt-BR.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.pt-PT.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.ro.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.ru.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.sk.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.sl.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.sr.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.sv.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.th.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.tr.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.uk.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.vi.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.zh-CN.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.zh-HK.json +1 -7
- package/dist/cdn/assets/card-manager/t9n/messages.zh-TW.json +1 -7
- package/dist/cdn/assets/consent-manager/t9n/messages.ar.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.bg.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.bs.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.ca.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.cs.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.da.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.de.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.el.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.en.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.es.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.et.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.fi.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.fr.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.he.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.hr.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.hu.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.id.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.it.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.ja.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.ko.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.lt.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.lv.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.nb.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.nl.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.no.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.pl.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.pt-BR.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.pt-PT.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.ro.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.ru.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.sk.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.sl.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.sr.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.sv.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.th.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.tr.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.uk.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.vi.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.zh-CN.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.zh-HK.json +1 -5
- package/dist/cdn/assets/consent-manager/t9n/messages.zh-TW.json +1 -5
- package/dist/cdn/assets/create-feature/t9n/messages.ar.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.bg.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.bs.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.ca.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.cs.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.da.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.de.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.el.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.en.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.es.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.et.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.fi.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.fr.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.he.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.hr.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.hu.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.id.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.it.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.ja.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.ko.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.lt.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.lv.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.nb.json +1 -5
- package/dist/cdn/assets/create-feature/t9n/messages.nl.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.no.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.pl.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.pt-BR.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.pt-PT.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.ro.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.ru.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.sk.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.sl.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.sr.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.sv.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.th.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.tr.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.uk.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.vi.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.zh-CN.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.zh-HK.json +1 -24
- package/dist/cdn/assets/create-feature/t9n/messages.zh-TW.json +1 -24
- package/dist/cdn/assets/create-related-feature/t9n/messages.ar.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.bg.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.bs.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.ca.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.cs.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.da.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.de.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.el.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.en.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.es.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.et.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.fi.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.fr.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.he.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.hr.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.hu.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.id.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.it.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.ja.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.ko.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.lt.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.lv.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.nb.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.nl.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.no.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.pl.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.pt-BR.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.pt-PT.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.ro.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.ru.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.sk.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.sl.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.sr.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.sv.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.th.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.tr.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.uk.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.vi.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.zh-CN.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.zh-HK.json +1 -3
- package/dist/cdn/assets/create-related-feature/t9n/messages.zh-TW.json +1 -3
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.ar.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.bg.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.bs.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.ca.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.cs.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.da.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.de.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.el.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.en.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.es.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.et.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.fi.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.fr.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.he.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.hr.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.hu.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.id.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.it.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.ja.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.ko.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.lt.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.lv.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.nb.json +1 -15
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.nl.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.no.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.pl.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.pt-BR.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.pt-PT.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.ro.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.ru.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.sk.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.sl.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.sr.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.sv.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.th.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.tr.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.uk.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.vi.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.zh-CN.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.zh-HK.json +1 -16
- package/dist/cdn/assets/crowdsource-manager/t9n/messages.zh-TW.json +1 -16
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ar.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.bg.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.bs.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ca.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.cs.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.da.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.de.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.el.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.en.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.es.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.et.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.fi.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.fr.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.he.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.hr.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.hu.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.id.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.it.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ja.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ko.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.lt.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.lv.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.nb.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.nl.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.no.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.pl.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.pt-BR.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.pt-PT.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ro.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ru.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.sk.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.sl.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.sr.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.sv.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.th.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.tr.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.uk.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.vi.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.zh-CN.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.zh-HK.json +1 -32
- package/dist/cdn/assets/crowdsource-reporter/t9n/messages.zh-TW.json +1 -32
- package/dist/cdn/assets/delete-button/t9n/messages.ar.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.bg.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.bs.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.ca.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.cs.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.da.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.de.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.el.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.en.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.es.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.et.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.fi.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.fr.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.he.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.hr.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.hu.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.id.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.it.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.ja.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.ko.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.lt.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.lv.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.nb.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.nl.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.no.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.pl.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.pt-BR.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.pt-PT.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.ro.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.ru.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.sk.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.sl.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.sr.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.sv.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.th.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.tr.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.uk.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.vi.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.zh-CN.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.zh-HK.json +1 -8
- package/dist/cdn/assets/delete-button/t9n/messages.zh-TW.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.ar.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.bg.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.bs.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.ca.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.cs.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.da.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.de.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.el.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.en.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.es.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.et.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.fi.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.fr.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.he.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.hr.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.hu.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.id.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.it.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.ja.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.ko.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.lt.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.lv.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.nb.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.nl.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.no.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.pl.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.pt-BR.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.pt-PT.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.ro.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.ru.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.sk.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.sl.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.sr.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.sv.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.th.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.tr.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.uk.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.vi.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.zh-CN.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.zh-HK.json +1 -8
- package/dist/cdn/assets/delete-dialog/t9n/messages.zh-TW.json +1 -8
- package/dist/cdn/assets/edit-card/t9n/messages.ar.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.bg.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.bs.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.ca.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.cs.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.da.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.de.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.el.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.en.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.es.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.et.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.fi.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.fr.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.he.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.hr.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.hu.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.id.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.it.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.ja.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.ko.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.lt.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.lv.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.nb.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.nl.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.no.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.pl.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.pt-BR.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.pt-PT.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.ro.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.ru.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.sk.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.sl.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.sr.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.sv.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.th.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.tr.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.uk.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.vi.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.zh-CN.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.zh-HK.json +1 -3
- package/dist/cdn/assets/edit-card/t9n/messages.zh-TW.json +1 -3
- package/dist/cdn/assets/feature-list/t9n/messages.ar.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.bg.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.bs.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.ca.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.cs.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.da.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.de.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.el.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.en.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.es.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.et.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.fi.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.fr.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.he.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.hr.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.hu.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.id.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.it.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.ja.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.ko.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.lt.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.lv.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.nb.json +1 -8
- package/dist/cdn/assets/feature-list/t9n/messages.nl.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.no.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.pl.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.pt-BR.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.pt-PT.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.ro.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.ru.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.sk.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.sl.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.sr.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.sv.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.th.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.tr.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.uk.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.vi.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.zh-CN.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.zh-HK.json +1 -9
- package/dist/cdn/assets/feature-list/t9n/messages.zh-TW.json +1 -9
- package/dist/cdn/assets/field-selection/t9n/messages.ar.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.bg.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.bs.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.ca.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.cs.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.da.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.de.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.el.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.en.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.es.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.et.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.fi.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.fr.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.he.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.hr.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.hu.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.id.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.it.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.ja.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.ko.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.lt.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.lv.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.nl.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.no.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.pl.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.pt-BR.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.pt-PT.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.ro.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.ru.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.sk.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.sl.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.sr.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.sv.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.th.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.tr.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.uk.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.vi.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.zh-CN.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.zh-HK.json +1 -18
- package/dist/cdn/assets/field-selection/t9n/messages.zh-TW.json +1 -18
- package/dist/cdn/assets/info-card/t9n/messages.ar.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.bg.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.bs.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.ca.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.cs.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.da.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.de.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.el.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.en.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.es.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.et.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.fi.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.fr.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.he.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.hr.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.hu.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.id.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.it.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.ja.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.ko.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.lt.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.lv.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.nb.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.nl.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.no.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.pl.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.pt-BR.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.pt-PT.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.ro.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.ru.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.sk.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.sl.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.sr.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.sv.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.th.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.tr.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.uk.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.vi.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.zh-CN.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.zh-HK.json +1 -10
- package/dist/cdn/assets/info-card/t9n/messages.zh-TW.json +1 -10
- package/dist/cdn/assets/layer-list/t9n/messages.ar.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.bg.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.bs.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.ca.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.cs.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.da.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.de.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.el.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.en.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.es.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.et.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.fi.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.fr.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.he.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.hr.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.hu.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.id.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.it.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.ja.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.ko.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.lt.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.lv.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.nb.json +1 -4
- package/dist/cdn/assets/layer-list/t9n/messages.nl.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.no.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.pl.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.pt-BR.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.pt-PT.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.ro.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.ru.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.sk.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.sl.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.sr.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.sv.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.th.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.tr.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.uk.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.vi.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.zh-CN.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.zh-HK.json +1 -5
- package/dist/cdn/assets/layer-list/t9n/messages.zh-TW.json +1 -5
- package/dist/cdn/assets/layer-table/t9n/messages.ar.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.bg.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.bs.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.ca.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.cs.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.da.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.de.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.el.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.en.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.es.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.et.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.fi.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.fr.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.he.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.hr.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.hu.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.id.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.it.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.ja.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.ko.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.lt.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.lv.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.nb.json +1 -25
- package/dist/cdn/assets/layer-table/t9n/messages.nl.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.no.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.pl.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.pt-BR.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.pt-PT.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.ro.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.ru.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.sk.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.sl.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.sr.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.sv.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.th.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.tr.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.uk.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.vi.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.zh-CN.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.zh-HK.json +1 -27
- package/dist/cdn/assets/layer-table/t9n/messages.zh-TW.json +1 -27
- package/dist/cdn/assets/map-card/t9n/messages.ar.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.bg.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.bs.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.ca.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.cs.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.da.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.de.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.el.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.en.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.es.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.et.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.fi.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.fr.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.he.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.hr.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.hu.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.id.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.it.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.ja.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.ko.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.lt.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.lv.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.nb.json +1 -10
- package/dist/cdn/assets/map-card/t9n/messages.nl.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.no.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.pl.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.pt-BR.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.pt-PT.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.ro.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.ru.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.sk.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.sl.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.sr.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.sv.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.th.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.tr.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.uk.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.vi.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.zh-CN.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.zh-HK.json +1 -11
- package/dist/cdn/assets/map-card/t9n/messages.zh-TW.json +1 -11
- package/dist/cdn/assets/map-draw-tools/t9n/messages.ar.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.bg.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.bs.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.ca.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.cs.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.da.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.de.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.el.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.en.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.es.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.et.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.fi.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.fr.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.he.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.hr.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.hu.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.id.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.it.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.ja.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.ko.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.lt.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.lv.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.nb.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.nl.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.no.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.pl.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.pt-BR.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.pt-PT.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.ro.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.ru.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.sk.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.sl.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.sr.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.sv.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.th.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.tr.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.uk.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.vi.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.zh-CN.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.zh-HK.json +1 -5
- package/dist/cdn/assets/map-draw-tools/t9n/messages.zh-TW.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.ar.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.bg.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.bs.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.ca.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.cs.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.da.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.de.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.el.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.en.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.es.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.et.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.fi.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.fr.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.he.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.hr.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.hu.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.id.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.it.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.ja.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.ko.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.lt.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.lv.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.nb.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.nl.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.no.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.pl.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.pt-BR.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.pt-PT.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.ro.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.ru.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.sk.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.sl.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.sr.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.sv.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.th.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.tr.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.uk.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.vi.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.zh-CN.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.zh-HK.json +1 -5
- package/dist/cdn/assets/map-layer-picker/t9n/messages.zh-TW.json +1 -5
- package/dist/cdn/assets/map-picker/t9n/messages.ar.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.bg.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.bs.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.ca.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.cs.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.da.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.de.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.el.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.en.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.es.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.et.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.fi.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.fr.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.he.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.hr.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.hu.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.id.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.it.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.ja.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.ko.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.lt.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.lv.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.nb.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.nl.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.no.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.pl.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.pt-BR.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.pt-PT.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.ro.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.ru.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.sk.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.sl.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.sr.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.sv.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.th.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.tr.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.uk.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.vi.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.zh-CN.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.zh-HK.json +1 -3
- package/dist/cdn/assets/map-picker/t9n/messages.zh-TW.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.ar.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.bg.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.bs.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.ca.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.cs.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.da.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.de.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.el.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.en.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.es.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.et.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.fi.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.fr.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.he.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.hr.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.hu.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.id.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.it.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.ja.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.ko.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.lt.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.lv.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.nl.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.no.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.pl.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.pt-BR.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.pt-PT.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.ro.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.ru.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.sk.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.sl.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.sr.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.sv.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.th.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.tr.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.uk.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.vi.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.zh-CN.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.zh-HK.json +1 -3
- package/dist/cdn/assets/map-search/t9n/messages.zh-TW.json +1 -3
- package/dist/cdn/assets/map-select-tools/t9n/messages.ar.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.bg.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.bs.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.ca.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.cs.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.da.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.de.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.el.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.en.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.es.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.et.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.fi.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.fr.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.he.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.hr.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.hu.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.id.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.it.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.ja.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.ko.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.lt.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.lv.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.nb.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.nl.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.no.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.pl.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.pt-BR.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.pt-PT.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.ro.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.ru.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.sk.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.sl.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.sr.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.sv.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.th.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.tr.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.uk.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.vi.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.zh-CN.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.zh-HK.json +1 -16
- package/dist/cdn/assets/map-select-tools/t9n/messages.zh-TW.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.ar.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.bg.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.bs.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.ca.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.cs.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.da.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.de.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.el.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.en.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.es.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.et.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.fi.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.fr.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.he.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.hr.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.hu.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.id.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.it.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.ja.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.ko.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.lt.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.lv.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.nb.json +1 -10
- package/dist/cdn/assets/map-tools/t9n/messages.nl.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.no.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.pl.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.pt-BR.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.pt-PT.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.ro.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.ru.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.sk.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.sl.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.sr.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.sv.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.th.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.tr.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.uk.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.vi.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.zh-CN.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.zh-HK.json +1 -16
- package/dist/cdn/assets/map-tools/t9n/messages.zh-TW.json +1 -16
- package/dist/cdn/assets/pdf-download/data/labelFormats.json +1 -191
- package/dist/cdn/assets/pdf-download/t9n/messages.ar.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.bg.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.bs.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.ca.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.cs.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.da.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.de.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.el.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.en.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.es.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.et.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.fi.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.fr.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.he.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.hr.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.hu.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.id.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.it.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.ja.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.ko.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.lt.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.lv.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.nb.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.nl.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.no.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.pl.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.pt-BR.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.pt-PT.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.ro.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.ru.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.sk.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.sl.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.sr.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.sv.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.th.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.tr.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.uk.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.vi.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.zh-CN.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.zh-HK.json +1 -3
- package/dist/cdn/assets/pdf-download/t9n/messages.zh-TW.json +1 -3
- package/dist/cdn/assets/public-notification/t9n/messages.ar.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.bg.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.bs.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.ca.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.cs.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.da.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.de.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.el.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.en.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.es.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.et.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.fi.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.fr.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.he.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.hr.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.hu.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.id.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.it.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.ja.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.ko.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.lt.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.lv.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.nb.json +1 -44
- package/dist/cdn/assets/public-notification/t9n/messages.nl.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.no.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.pl.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.pt-BR.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.pt-PT.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.ro.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.ru.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.sk.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.sl.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.sr.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.sv.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.th.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.tr.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.uk.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.vi.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.zh-CN.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.zh-HK.json +1 -54
- package/dist/cdn/assets/public-notification/t9n/messages.zh-TW.json +1 -54
- package/dist/cdn/assets/refine-selection/t9n/messages.ar.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.bg.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.bs.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.ca.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.cs.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.da.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.de.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.el.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.en.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.es.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.et.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.fi.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.fr.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.he.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.hr.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.hu.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.id.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.it.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.ja.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.ko.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.lt.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.lv.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.nb.json +1 -9
- package/dist/cdn/assets/refine-selection/t9n/messages.nl.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.no.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.pl.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.pt-BR.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.pt-PT.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.ro.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.ru.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.sk.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.sl.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.sr.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.sv.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.th.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.tr.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.uk.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.vi.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.zh-CN.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.zh-HK.json +1 -13
- package/dist/cdn/assets/refine-selection/t9n/messages.zh-TW.json +1 -13
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.ar.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.bg.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.bs.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.ca.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.cs.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.da.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.de.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.el.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.en.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.es.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.et.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.fi.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.fr.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.he.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.hr.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.hu.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.id.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.it.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.ja.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.ko.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.lt.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.lv.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.nl.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.no.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.pl.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.pt-BR.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.pt-PT.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.ro.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.ru.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.sk.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.sl.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.sr.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.sv.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.th.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.tr.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.uk.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.vi.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.zh-CN.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.zh-HK.json +1 -14
- package/dist/cdn/assets/solution-configure-titles/t9n/messages.zh-TW.json +1 -14
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ar.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.bg.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.bs.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ca.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.cs.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.da.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.de.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.el.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.en.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.es.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.et.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.fi.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.fr.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.he.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.hr.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.hu.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.id.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.it.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ja.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ko.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.lt.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.lv.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.nl.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.no.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.pl.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.pt-BR.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.pt-PT.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ro.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ru.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.sk.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.sl.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.sr.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.sv.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.th.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.tr.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.uk.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.vi.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.zh-CN.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.zh-HK.json +1 -12
- package/dist/cdn/assets/solution-delete-dialog/t9n/messages.zh-TW.json +1 -12
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ar.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.bg.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.bs.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ca.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.cs.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.da.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.de.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.el.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.en.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.es.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.et.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.fi.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.fr.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.he.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.hr.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.hu.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.id.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.it.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ja.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ko.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.lt.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.lv.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.nl.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.no.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.pl.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.pt-BR.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.pt-PT.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ro.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ru.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.sk.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.sl.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.sr.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.sv.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.th.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.tr.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.uk.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.vi.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.zh-CN.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.zh-HK.json +1 -21
- package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.zh-TW.json +1 -21
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ar.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.bg.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.bs.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ca.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.cs.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.da.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.de.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.el.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.en.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.es.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.et.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.fi.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.fr.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.he.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.hr.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.hu.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.id.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.it.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ja.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ko.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.lt.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.lv.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.nl.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.no.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.pl.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.pt-BR.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.pt-PT.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ro.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ru.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sk.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sl.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sr.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sv.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.th.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.tr.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.uk.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.vi.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-CN.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-HK.json +1 -14
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-TW.json +1 -14
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ar.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.bg.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.bs.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ca.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.cs.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.da.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.de.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.el.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.en.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.es.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.et.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.fi.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.fr.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.he.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.hr.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.hu.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.id.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.it.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ja.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ko.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.lt.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.lv.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.nl.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.no.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.pl.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.pt-BR.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.pt-PT.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ro.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ru.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sk.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sl.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sr.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sv.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.th.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.tr.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.uk.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.vi.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.zh-CN.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.zh-HK.json +1 -21
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.zh-TW.json +1 -21
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ar.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.bg.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.bs.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ca.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.cs.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.da.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.de.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.el.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.en.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.es.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.et.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.fi.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.fr.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.he.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.hr.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.hu.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.id.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.it.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ja.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ko.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.lt.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.lv.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.nl.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.no.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.pl.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.pt-BR.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.pt-PT.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ro.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ru.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.sk.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.sl.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.sr.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.sv.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.th.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.tr.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.uk.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.vi.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.zh-CN.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.zh-HK.json +1 -19
- package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.zh-TW.json +1 -19
- package/dist/cdn/assets/solution-details-card/t9n/messages.ar.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.bg.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.bs.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.ca.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.cs.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.da.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.de.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.el.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.en.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.es.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.et.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.fi.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.fr.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.he.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.hr.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.hu.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.id.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.it.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.ja.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.ko.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.lt.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.lv.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.nl.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.no.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.pl.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.pt-BR.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.pt-PT.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.ro.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.ru.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.sk.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.sl.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.sr.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.sv.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.th.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.tr.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.uk.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.vi.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.zh-CN.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.zh-HK.json +1 -7
- package/dist/cdn/assets/solution-details-card/t9n/messages.zh-TW.json +1 -7
- package/dist/cdn/assets/solution-details-panel/t9n/messages.ar.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.bg.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.bs.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.ca.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.cs.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.da.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.de.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.el.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.en.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.es.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.et.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.fi.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.fr.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.he.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.hr.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.hu.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.id.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.it.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.ja.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.ko.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.lt.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.lv.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.nl.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.no.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.pl.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.pt-BR.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.pt-PT.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.ro.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.ru.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.sk.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.sl.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.sr.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.sv.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.th.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.tr.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.uk.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.vi.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.zh-CN.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.zh-HK.json +1 -65
- package/dist/cdn/assets/solution-details-panel/t9n/messages.zh-TW.json +1 -65
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ar.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.bg.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.bs.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ca.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.cs.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.da.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.de.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.el.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.en.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.es.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.et.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.fi.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.fr.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.he.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.hr.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.hu.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.id.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.it.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ja.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ko.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.lt.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.lv.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.nb.json +1 -3
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.nl.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.no.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.pl.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.pt-BR.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.pt-PT.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ro.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.ru.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.sk.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.sl.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.sr.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.sv.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.th.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.tr.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.uk.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.vi.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-CN.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-HK.json +1 -4
- package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-TW.json +1 -4
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.ar.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.bg.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.bs.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.ca.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.cs.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.da.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.de.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.el.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.en.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.es.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.et.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.fi.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.fr.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.he.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.hr.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.hu.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.id.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.it.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.ja.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.ko.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.lt.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.lv.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.nl.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.no.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.pl.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.pt-BR.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.pt-PT.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.ro.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.ru.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.sk.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.sl.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.sr.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.sv.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.th.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.tr.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.uk.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.vi.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.zh-CN.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.zh-HK.json +1 -9
- package/dist/cdn/assets/solution-item-diagram/t9n/messages.zh-TW.json +1 -9
- package/dist/cdn/assets/solution-resource-card/t9n/messages.ar.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.bg.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.bs.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.ca.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.cs.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.da.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.de.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.el.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.en.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.es.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.et.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.fi.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.fr.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.he.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.hr.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.hu.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.id.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.it.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.ja.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.ko.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.lt.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.lv.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.nl.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.no.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.pl.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.pt-BR.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.pt-PT.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.ro.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.ru.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.sk.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.sl.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.sr.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.sv.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.th.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.tr.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.uk.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.vi.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.zh-CN.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.zh-HK.json +1 -5
- package/dist/cdn/assets/solution-resource-card/t9n/messages.zh-TW.json +1 -5
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ar.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.bg.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.bs.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ca.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.cs.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.da.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.de.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.el.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.en.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.es.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.et.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.fi.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.fr.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.he.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.hr.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.hu.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.id.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.it.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ja.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ko.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.lt.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.lv.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.nl.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.no.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.pl.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.pt-BR.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.pt-PT.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ro.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ru.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.sk.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.sl.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.sr.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.sv.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.th.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.tr.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.uk.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.vi.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.zh-CN.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.zh-HK.json +1 -4
- package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.zh-TW.json +1 -4
- package/dist/cdn/assets/solution-social-share/t9n/messages.ar.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.bg.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.bs.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.ca.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.cs.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.da.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.de.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.el.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.en.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.es.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.et.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.fi.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.fr.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.he.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.hr.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.hu.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.id.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.it.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.ja.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.ko.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.lt.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.lv.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.nl.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.no.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.pl.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.pt-BR.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.pt-PT.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.ro.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.ru.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.sk.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.sl.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.sr.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.sv.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.th.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.tr.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.uk.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.vi.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.zh-CN.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.zh-HK.json +1 -31
- package/dist/cdn/assets/solution-social-share/t9n/messages.zh-TW.json +1 -31
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.ar.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.bg.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.bs.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.ca.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.cs.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.da.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.de.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.el.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.en.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.es.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.et.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.fi.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.fr.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.he.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.hr.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.hu.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.id.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.it.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.ja.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.ko.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.lt.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.lv.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.nl.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.no.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.pl.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.pt-BR.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.pt-PT.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.ro.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.ru.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.sk.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.sl.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.sr.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.sv.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.th.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.tr.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.uk.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.vi.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.zh-CN.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.zh-HK.json +1 -10
- package/dist/cdn/assets/solutions-all-panel/t9n/messages.zh-TW.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.ar.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.bg.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.bs.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.ca.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.cs.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.da.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.de.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.el.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.en.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.es.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.et.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.fi.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.fr.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.he.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.hr.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.hu.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.id.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.it.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.ja.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.ko.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.lt.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.lv.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.nl.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.no.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.pl.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.pt-BR.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.pt-PT.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.ro.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.ru.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.sk.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.sl.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.sr.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.sv.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.th.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.tr.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.uk.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.vi.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.zh-CN.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.zh-HK.json +1 -10
- package/dist/cdn/assets/solutions-all-shell/t9n/messages.zh-TW.json +1 -10
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ar.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.bg.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.bs.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ca.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.cs.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.da.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.de.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.el.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.en.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.es.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.et.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.fi.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.fr.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.he.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.hr.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.hu.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.id.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.it.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ja.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ko.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.lt.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.lv.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.nl.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.no.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.pl.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.pt-BR.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.pt-PT.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ro.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ru.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sk.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sl.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sr.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sv.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.th.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.tr.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.uk.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.vi.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.zh-CN.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.zh-HK.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app/t9n/messages.zh-TW.json +1 -17
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ar.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.bg.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.bs.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ca.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.cs.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.da.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.de.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.el.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.en.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.es.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.et.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.fi.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.fr.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.he.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.hr.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.hu.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.id.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.it.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ja.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ko.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.lt.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.lv.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.nl.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.no.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.pl.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.pt-BR.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.pt-PT.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ro.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ru.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.sk.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.sl.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.sr.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.sv.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.th.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.tr.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.uk.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.vi.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.zh-CN.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.zh-HK.json +1 -12
- package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.zh-TW.json +1 -12
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ar.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.bg.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.bs.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ca.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.cs.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.da.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.de.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.el.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.en.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.es.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.et.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.fi.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.fr.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.he.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.hr.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.hu.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.id.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.it.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ja.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ko.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.lt.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.lv.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.nl.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.no.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.pl.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.pt-BR.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.pt-PT.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ro.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ru.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.sk.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.sl.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.sr.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.sv.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.th.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.tr.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.uk.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.vi.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.zh-CN.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.zh-HK.json +1 -8
- package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.zh-TW.json +1 -8
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ar.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.bg.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.bs.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ca.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.cs.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.da.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.de.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.el.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.en.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.es.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.et.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.fi.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.fr.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.he.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.hr.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.hu.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.id.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.it.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ja.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ko.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.lt.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.lv.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.nl.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.no.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.pl.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.pt-BR.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.pt-PT.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ro.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ru.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.sk.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.sl.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.sr.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.sv.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.th.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.tr.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.uk.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.vi.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.zh-CN.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.zh-HK.json +1 -9
- package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.zh-TW.json +1 -9
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ar.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.bg.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.bs.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ca.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.cs.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.da.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.de.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.el.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.en.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.es.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.et.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.fi.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.fr.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.he.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.hr.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.hu.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.id.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.it.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ja.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ko.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.lt.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.lv.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.nl.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.no.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.pl.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.pt-BR.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.pt-PT.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ro.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ru.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.sk.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.sl.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.sr.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.sv.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.th.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.tr.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.uk.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.vi.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.zh-CN.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.zh-HK.json +1 -52
- package/dist/cdn/assets/solutions-filter-panel/t9n/messages.zh-TW.json +1 -52
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ar.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.bg.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.bs.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ca.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.cs.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.da.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.de.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.el.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.en.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.es.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.et.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.fi.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.fr.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.he.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.hr.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.hu.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.id.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.it.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ja.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ko.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.lt.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.lv.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.nl.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.no.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.pl.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.pt-BR.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.pt-PT.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ro.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ru.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.sk.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.sl.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.sr.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.sv.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.th.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.tr.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.uk.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.vi.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.zh-CN.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.zh-HK.json +1 -66
- package/dist/cdn/assets/solutions-resources-shell/t9n/messages.zh-TW.json +1 -66
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ar.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.bg.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.bs.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ca.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.cs.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.da.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.de.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.el.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.en.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.es.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.et.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.fi.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.fr.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.he.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.hr.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.hu.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.id.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.it.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ja.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ko.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.lt.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.lv.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.nl.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.no.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.pl.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.pt-BR.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.pt-PT.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ro.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ru.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.sk.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.sl.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.sr.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.sv.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.th.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.tr.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.uk.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.vi.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.zh-CN.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.zh-HK.json +1 -17
- package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.zh-TW.json +1 -17
- package/dist/cdn/index.js +1 -3
- package/dist/cdn/main.css +1 -5
- package/dist/chunks/Auth.js +77 -162
- package/dist/chunks/cardFetchingUtils.js +200 -283
- package/dist/chunks/cardsHelpers.js +69 -98
- package/dist/chunks/deployAppContexts.js +6 -6
- package/dist/chunks/downloadUtils.js +513 -820
- package/dist/chunks/getItemIcon.js +26 -108
- package/dist/chunks/getRelatedInfos.js +37 -52
- package/dist/chunks/interfaces.js +366 -833
- package/dist/chunks/mapViewUtils.js +88 -135
- package/dist/chunks/pciUtils.js +184 -372
- package/dist/chunks/popupUtils.js +25 -42
- package/dist/chunks/publicNotificationContext.js +3 -3
- package/dist/chunks/queryUtils.js +55 -105
- package/dist/chunks/runtime.js +11 -12
- package/dist/chunks/solution-deploy-dialog.js +179 -406
- package/dist/chunks/solutions-deploy-app-nav.js +160 -476
- package/dist/chunks/useT9n.js +4 -4
- package/dist/components/arcgis-solutions-assistant/customElement.js +980 -1475
- package/dist/components/buffer-tools/customElement.d.ts +1 -1
- package/dist/components/buffer-tools/customElement.js +43 -134
- package/dist/components/card-manager/customElement.d.ts +2 -2
- package/dist/components/card-manager/customElement.js +42 -141
- package/dist/components/consent-manager/customElement.d.ts +1 -1
- package/dist/components/consent-manager/customElement.js +3615 -5398
- package/dist/components/create-feature/customElement.d.ts +1 -1
- package/dist/components/create-feature/customElement.js +285 -815
- package/dist/components/create-related-feature/customElement.d.ts +3 -3
- package/dist/components/create-related-feature/customElement.js +76 -197
- package/dist/components/crowdsource-manager/customElement.js +145 -622
- package/dist/components/crowdsource-reporter/customElement.d.ts +1 -1
- package/dist/components/crowdsource-reporter/customElement.js +340 -868
- package/dist/components/deduct-calculator/customElement.js +23 -56
- package/dist/components/delete-button/customElement.d.ts +1 -1
- package/dist/components/delete-button/customElement.js +17 -52
- package/dist/components/delete-dialog/customElement.d.ts +1 -1
- package/dist/components/delete-dialog/customElement.js +20 -49
- package/dist/components/edit-card/customElement.d.ts +2 -2
- package/dist/components/edit-card/customElement.js +52 -205
- package/dist/components/feature-details/customElement.d.ts +2 -2
- package/dist/components/feature-details/customElement.js +106 -264
- package/dist/components/feature-list/customElement.d.ts +1 -1
- package/dist/components/feature-list/customElement.js +166 -405
- package/dist/components/field-selection/customElement.d.ts +3 -3
- package/dist/components/field-selection/customElement.js +131 -291
- package/dist/components/info-card/customElement.d.ts +2 -2
- package/dist/components/info-card/customElement.js +82 -309
- package/dist/components/layer-list/customElement.d.ts +1 -1
- package/dist/components/layer-list/customElement.js +71 -155
- package/dist/components/layer-list-widget/customElement.d.ts +2 -2
- package/dist/components/layer-list-widget/customElement.js +20 -51
- package/dist/components/layer-table/customElement.d.ts +1 -1
- package/dist/components/layer-table/customElement.js +579 -1512
- package/dist/components/map-basemap-gallery/customElement.d.ts +2 -2
- package/dist/components/map-basemap-gallery/customElement.js +31 -68
- package/dist/components/map-card/customElement.d.ts +3 -3
- package/dist/components/map-card/customElement.js +130 -418
- package/dist/components/map-draw-tools/customElement.d.ts +5 -5
- package/dist/components/map-draw-tools/customElement.js +89 -239
- package/dist/components/map-floor-filter/customElement.d.ts +2 -2
- package/dist/components/map-floor-filter/customElement.js +34 -92
- package/dist/components/map-fullscreen/customElement.d.ts +2 -2
- package/dist/components/map-fullscreen/customElement.js +22 -54
- package/dist/components/map-layer-picker/customElement.d.ts +1 -1
- package/dist/components/map-layer-picker/customElement.js +113 -329
- package/dist/components/map-legend/customElement.d.ts +2 -2
- package/dist/components/map-legend/customElement.js +22 -53
- package/dist/components/map-picker/customElement.js +64 -233
- package/dist/components/map-search/customElement.d.ts +2 -2
- package/dist/components/map-search/customElement.js +41 -103
- package/dist/components/map-select-tools/customElement.d.ts +9 -9
- package/dist/components/map-select-tools/customElement.js +220 -583
- package/dist/components/map-tools/customElement.d.ts +2 -2
- package/dist/components/map-tools/customElement.js +134 -428
- package/dist/components/pci-calculator/customElement.js +21 -88
- package/dist/components/pdf-download/customElement.js +37 -66
- package/dist/components/public-notification/customElement.d.ts +10 -10
- package/dist/components/public-notification/customElement.js +326 -904
- package/dist/components/refine-selection/customElement.d.ts +8 -8
- package/dist/components/refine-selection/customElement.js +164 -422
- package/dist/components/selection-tool/customElement.d.ts +1 -1
- package/dist/components/selection-tool/customElement.js +36 -82
- package/dist/components/solution-configure-titles/customElement.js +76 -278
- package/dist/components/solution-delete-dialog/customElement.js +76 -189
- package/dist/components/solution-deploy-dialog/customElement.js +2 -2
- package/dist/components/solution-deployed-card/customElement.js +2 -2
- package/dist/components/solution-deployed-card-panel/customElement.js +101 -481
- package/dist/components/solution-deploying-dialog/customElement.js +44 -127
- package/dist/components/solution-details-card/customElement.js +34 -192
- package/dist/components/solution-details-panel/customElement.js +279 -1083
- package/dist/components/solution-item-accordion/customElement.js +71 -228
- package/dist/components/solution-item-diagram/customElement.js +341 -661
- package/dist/components/solution-item-icon/customElement.js +12 -42
- package/dist/components/solution-resource-card/customElement.js +28 -88
- package/dist/components/solution-snapshot-gallery/customElement.js +34 -194
- package/dist/components/solution-social-share/customElement.js +86 -432
- package/dist/components/solution-user-avatar/customElement.js +32 -93
- package/dist/components/solutions-all-panel/customElement.js +132 -400
- package/dist/components/solutions-all-shell/customElement.js +87 -286
- package/dist/components/solutions-deploy-app/customElement.js +139 -466
- package/dist/components/solutions-deploy-app-nav/customElement.js +2 -2
- package/dist/components/solutions-deployed-panel/customElement.d.ts +2 -2
- package/dist/components/solutions-deployed-panel/customElement.js +109 -318
- package/dist/components/solutions-deployed-shell/customElement.js +41 -218
- package/dist/components/solutions-filter-panel/customElement.js +98 -207
- package/dist/components/solutions-resources-section/customElement.js +11 -64
- package/dist/components/solutions-resources-shell/customElement.js +41 -132
- package/dist/components/solutions-searchsort-toolbar/customElement.js +120 -270
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +34 -34
- package/dist/loader.js +4 -4
- package/dist/solutions-components_commit.txt +7 -7
- package/package.json +1 -1
- package/dist/cdn/2GS6BQB3.js +0 -2
- package/dist/cdn/2JWJRETB.js +0 -27
- package/dist/cdn/2NKBQR2S.js +0 -2
- package/dist/cdn/2UY5AG4I.js +0 -20
- package/dist/cdn/4GFHM3CD.js +0 -107
- package/dist/cdn/4WFY5MUM.js +0 -102
- package/dist/cdn/5BVRREHL.js +0 -42
- package/dist/cdn/65LO5FJ5.js +0 -71
- package/dist/cdn/6ANZSQIC.js +0 -161
- package/dist/cdn/6GJIDRJ7.js +0 -52
- package/dist/cdn/6S75SIVV.js +0 -2
- package/dist/cdn/7MTM6CCV.js +0 -76
- package/dist/cdn/7SGXC6B2.js +0 -33
- package/dist/cdn/C2LXNVZ5.js +0 -2
- package/dist/cdn/C723WJAL.js +0 -2
- package/dist/cdn/CNCHPFKY.js +0 -54
- package/dist/cdn/DEVMQRIV.js +0 -33
- package/dist/cdn/DI25OTTX.js +0 -83
- package/dist/cdn/EVLSZPEV.js +0 -265
- package/dist/cdn/FCS5ID7D.js +0 -20
- package/dist/cdn/FY5RK2IY.js +0 -2
- package/dist/cdn/H2FDKJHX.js +0 -87
- package/dist/cdn/HUJXES5O.js +0 -2
- package/dist/cdn/HZZDUGC7.js +0 -143
- package/dist/cdn/IVESIH47.js +0 -54
- package/dist/cdn/IWXIVFNT.js +0 -55
- package/dist/cdn/IXOQGQ3G.js +0 -24
- package/dist/cdn/J6BRXQUD.js +0 -20
- package/dist/cdn/J6ELCUNM.js +0 -508
- package/dist/cdn/JDFTGGSH.js +0 -82
- package/dist/cdn/JLQGZPWA.js +0 -20
- package/dist/cdn/JOILOP5T.js +0 -107
- package/dist/cdn/JUM3OJQD.js +0 -218
- package/dist/cdn/K7RXCITJ.js +0 -42
- package/dist/cdn/ME46DTCW.js +0 -107
- package/dist/cdn/N6IQW2WT.js +0 -2
- package/dist/cdn/NDEILGBJ.js +0 -20
- package/dist/cdn/NRCA2TEL.js +0 -2
- package/dist/cdn/NRO2HV5R.js +0 -93
- package/dist/cdn/O7F5EUMA.js +0 -188
- package/dist/cdn/OBTBMVJY.js +0 -136
- package/dist/cdn/P5LFHCSW.js +0 -43
- package/dist/cdn/PMKGWCXK.js +0 -197
- package/dist/cdn/PXSQUQNJ.js +0 -29
- package/dist/cdn/Q7I73NYQ.js +0 -146
- package/dist/cdn/QGR5TZUX.js +0 -82
- package/dist/cdn/R6TK53NR.js +0 -36
- package/dist/cdn/RJRWRCQS.js +0 -71
- package/dist/cdn/RJRWVBMG.js +0 -251
- package/dist/cdn/SFSI46XY.js +0 -2
- package/dist/cdn/SXKFLQ6J.js +0 -36
- package/dist/cdn/TVHVKDXC.js +0 -22
- package/dist/cdn/U7ECRTWC.js +0 -310
- package/dist/cdn/UBZXPTKV.js +0 -2
- package/dist/cdn/V6OI2YYO.js +0 -84
- package/dist/cdn/V7SJ57VS.js +0 -42
- package/dist/cdn/VKY6CRVQ.js +0 -2
- package/dist/cdn/VL2MYWM4.js +0 -23
- package/dist/cdn/VOQPIDRD.js +0 -155
- package/dist/cdn/VSJ75MUT.js +0 -60
- package/dist/cdn/VXSAHUEP.js +0 -102
- package/dist/cdn/W6JGGPX7.js +0 -73
- package/dist/cdn/WOIJDANZ.js +0 -67
- package/dist/cdn/WSUCAHSV.js +0 -26
- package/dist/cdn/XMMILGG2.js +0 -25
- package/dist/cdn/XQAYHHCB.js +0 -78
- package/dist/cdn/YP3NCJZY.js +0 -20
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
|
|
2
|
-
import{a as un}from"./FY5RK2IY.js";import"./RJRWRCQS.js";import{a as ln}from"./6S75SIVV.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import{b as hn}from"./ABSRNM72.js";import{F as ms,G as ps,H as an,h as on,i as rn}from"./5CQPQ7AE.js";import"./3QPJ2JCA.js";(function(){let X=typeof globalThis=="object"&&globalThis||typeof global=="object"&&global.global===global&&global||typeof self=="object"&&self.self===self&&self||{};X.requestAnimationFrame===void 0&&(X.setImmediate===void 0?X.requestAnimationFrame=x=>X.setTimeout(x,0):X.requestAnimationFrame=X.setImmediate);class m{static fr=X.navigator!==void 0&&X.navigator.platform!==void 0&&X.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null;static CP(t,e,i){let s=-1;return function(){let n=this,o=arguments;s!==-1&&m.yc(s),s=m.un(()=>{s=-1,i||t.apply(n,o)},e),i&&!s&&t.apply(n,o)}}static un(t,e){return X.setTimeout(t,e)}static yc(t){X.clearTimeout(t)}static Ni(t){return X.document.createElement(t)}static o(t){throw new Error(t)}static L(t,e){let i="The object is frozen, so its properties cannot be set: "+t.toString();e!==void 0&&(i+=" to value: "+e),m.o(i)}static se(t,e,i,s){}static s(t,e,i,s){}static CU(t,e,i){}static wc(t,e,i){if(t===null||typeof t!="object"){let s=m.TL(e);i!==void 0&&(s+="."+i),m.si(t,"object",s)}}static S(t,e,i){m.s(t,"function",e,i)}static LU(t,e,i){}static si(t,e,i,s){}static J(t,e,i,s){let n=m.TL(i);s!==void 0&&(n+="."+s),m.o(n+" is not in the range "+e+": "+t)}static Xi(t){}static ur(t,e){}static ne(t){X.console&&X.console.log(t)}static $(t){return t!==null&&typeof t=="object"}static st(t){return typeof t=="function"}static LP=[];static nt(){let t=m.LP.pop();return t===void 0?[]:t}static Z(t){t.length=0,m.LP.push(t)}static AU=Object.freeze([]);static TL(t){return t===null?"*":typeof t=="string"?t:m.st(t)?t.name:""}static Kn(t){return m.st(t)?t.className?t.className:t.name:m.$(t)&&t.constructor?m.Kn(t.constructor):typeof t}static $a(t,e){return e==null||e===""?null:m.$(t)&&e in t||t[e]?t[e]:null}static toString(t){let e=t;return m.$(t)&&(t.text?e=t.text:t.name?e=t.name:t.key!==void 0?e=t.key:t.id!==void 0?e=t.id:t.constructor===Object&&(t.Text?e=t.Text:t.Name?e=t.Name:t.Key!==void 0?e=t.Key:t.Id!==void 0?e=t.Id:t.ID!==void 0&&(e=t.ID))),e===void 0?"undefined":e===null?"null":e.toString()}static qw(t,e){if(t.hasOwnProperty(e))return!0;let i=Object.getPrototypeOf(t);for(;i&&i!==Function;){if(i.hasOwnProperty(e))return!0;let s=i.TU;if(s&&s[e])return!0;i=Object.getPrototypeOf(i)}return!1}static XF(t){let e=[],i=0;for(i=0;i<256;i++)e[i]=i;let s=0,n=0;for(i=0;i<256;i++)s=(s+e[i]+119)%256,n=e[i],e[i]=e[s],e[s]=n;i=0,s=0;let o="";for(let r=0;r<t.length;r++)i=(i+1)%256,s=(s+e[i])%256,n=e[i],e[i]=e[s],e[s]=n,o+=String.fromCharCode(t.charCodeAt(r)^e[(e[i]+e[s])%256]);return o}static GF(t){let e="0123456789abcdef",i=[];for(let r=0;r<256;r++)i[e.charAt(r>>4)+e.charAt(r&15)]=String.fromCharCode(r);t.length%2&&(t="0"+t);let s=[],n=0;for(let r=0;r<t.length;r+=2)s[n++]=i[t.substring(r,r+2)];let o=s.join("");return o===""?"0":o}static We(t){return m.XF(m.GF(t))}static color1="@COLOR1";static color2="@COLOR2";static jw="32ab5ff3b26f42dc0ed90f21422913b5"}m.vfo="29e647fdb6";class rt{AP;constructor(){this.AP=[]}toString(){return this.AP.join("")}add(t){t!==""&&this.AP.push(t)}}class yt{}class kt{g;constructor(){this.g=[]}[Symbol.iterator](){return this.g.values()}key;value;get iterator(){return this}reset(){}next(){return!1}hasNext(){return!1}first(){return null}any(){return!1}all(){return!0}each(){return this}map(t){return this}filter(){return this}get count(){return 0}Ml(){}toString(){return"EmptyIterator"}static instance=new kt}class dt{constructor(t){this.key=-1,this.value=t}[Symbol.iterator](){return[this.value].values()}key;value;get iterator(){return this}reset(){this.key=-1}next(){return this.key===-1?(this.key=0,!0):!1}hasNext(){return this.next()}first(){return this.key=0,this.value}any(t){return this.key=-1,t(this.value)}all(t){return this.key=-1,t(this.value)}each(t){return this.key=-1,t(this.value),this}map(t){return new dt(t(this.value))}filter(t){return t(this.value)?new dt(this.value):kt.instance}get count(){return 1}Ml(){this.value=null}toString(){return"SingletonIterator("+this.value+")"}}class gt{qt;zs;Gt;Tt;constructor(t){this.qt=t,this.zs=null,t.dr=null,this.Gt=t.rt,this.Tt=-1}[Symbol.iterator](){return this.zs===null?this.qt.r.values():this.qt.r.filter(this.zs).values()}key;value;get iterator(){return this}get predicate(){return this.zs}set predicate(t){this.zs=t}reset(){let t=this.qt;t.dr=null,this.Gt=t.rt,this.Tt=-1}next(){let t=this.qt;if(t.rt!==this.Gt){if(this.key<0)return!1;m.Xi(t)}let e=t.r,i=e.length,s=++this.Tt,n=this.zs;if(n!==null)for(;s<i;){let o=e[s];if(n(o))return this.Tt=s,this.key=s,this.value=o,!0;s++}else{if(s<i)return this.key=s,this.value=e[s],!0;this.Ml()}return!1}hasNext(){return this.next()}first(){let t=this.qt;this.Gt=t.rt,this.Tt=0;let e=t.r,i=e.length,s=this.zs;if(s!==null){let n=0;for(;n<i;){let o=e[n];if(s(o))return this.Tt=n,this.key=n,this.value=o,o;n++}return null}else if(i>0){let n=e[0];return this.key=0,this.value=n,n}else return null}any(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=e.r,n=s.length,o=this.zs;for(let r=0;r<n;r++){let a=s[r];if(!(o!==null&&!o(a))){if(t(a))return!0;e.rt!==i&&m.Xi(e)}}return!1}all(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=e.r,n=s.length,o=this.zs;for(let r=0;r<n;r++){let a=s[r];if(!(o!==null&&!o(a))){if(!t(a))return!1;e.rt!==i&&m.Xi(e)}}return!0}each(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=e.r,n=s.length,o=this.zs;for(let r=0;r<n;r++){let a=s[r];o!==null&&!o(a)||(t(a),e.rt!==i&&m.Xi(e))}return this}map(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=[],n=e.r,o=n.length,r=this.zs;for(let h=0;h<o;h++){let l=n[h];r!==null&&!r(l)||(s.push(t(l)),e.rt!==i&&m.Xi(e))}let a=new q;return a.r=s,a.Gi(),a.iterator}filter(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=[],n=e.r,o=n.length,r=this.zs;for(let h=0;h<o;h++){let l=n[h];r!==null&&!r(l)||(t(l)&&s.push(l),e.rt!==i&&m.Xi(e))}let a=new q;return a.r=s,a.Gi(),a.iterator}get count(){let t=this.zs;if(t!==null){let e=0,i=this.qt.r,s=i.length;for(let n=0;n<s;n++)t(i[n])&&e++;return e}else return this.qt.r.length}Ml(){this.key=-1,this.value=null,this.Gt=-1,this.zs=null,this.qt.dr=this}toString(){return"ListIterator@"+this.Tt+"/"+this.qt.count}}class St{qt;Gt;Tt;constructor(t){this.qt=t,t.gr=null,this.Gt=t.rt,this.Tt=t.r.length}[Symbol.iterator](){return this.qt.r.reverse().values()}key;value;get iterator(){return this}reset(){let t=this.qt;t.gr=null,this.Gt=t.rt,this.Tt=t.r.length}next(){let t=this.qt;if(t.rt!==this.Gt){if(this.key<0)return!1;m.Xi(t)}let e=--this.Tt;return e>=0?(this.key=e,this.value=t.r[e],!0):(this.Ml(),!1)}hasNext(){return this.next()}first(){let t=this.qt;this.Gt=t.rt;let e=t.r,i=e.length-1;if(this.Tt=i,i>=0){let s=e[i];return this.key=i,this.value=s,s}else return null}any(t){let e=this.qt;e.gr=null;let i=e.rt,s=e.r,n=s.length;this.Tt=n;for(let o=n-1;o>=0;o--){let r=s[o];if(t(r))return!0;e.rt!==i&&m.Xi(e)}return!1}all(t){let e=this.qt;e.gr=null;let i=e.rt,s=e.r,n=s.length;this.Tt=n;for(let o=n-1;o>=0;o--){let r=s[o];if(!t(r))return!1;e.rt!==i&&m.Xi(e)}return!0}each(t){let e=this.qt;e.gr=null;let i=e.rt,s=e.r,n=s.length;this.Tt=n;for(let o=n-1;o>=0;o--){let r=s[o];t(r),e.rt!==i&&m.Xi(e)}return this}map(t){let e=this.qt;e.gr=null;let i=e.rt,s=[],n=e.r,o=n.length;this.Tt=o;for(let a=o-1;a>=0;a--){let h=n[a];s.push(t(h)),e.rt!==i&&m.Xi(e)}let r=new q;return r.r=s,r.Gi(),r.iterator}filter(t){let e=this.qt;e.gr=null;let i=e.rt,s=[],n=e.r,o=n.length;this.Tt=o;for(let a=o-1;a>=0;a--){let h=n[a];t(h)&&s.push(h),e.rt!==i&&m.Xi(e)}let r=new q;return r.r=s,r.Gi(),r.iterator}get count(){return this.qt.r.length}Ml(){this.key=-1,this.value=null,this.Gt=-1,this.qt.gr=this}toString(){return"ListIteratorBackwards("+this.Tt+"/"+this.qt.count+")"}}class q{u;r;rt;dr;gr;constructor(t){V.Je(this),this.u=!1,this.r=[],this.rt=0,this.dr=null,this.gr=null,t!==void 0&&this.addAll(t)}[Symbol.iterator](){return this.r.values()}Gi(){let t=this.rt;t++,t>999999999&&(t=0),this.rt=t}k(){return this.u=!0,this}ce(){return this.u=!1,this}toString(){return"List()#"+V.xs(this)}add(t){return this.u&&m.L(this,t),this.r.push(t),this.Gi(),this}push(t){this.add(t)}addAll(t){if(t===null)return this;this.u&&m.L(this);let e=this.r;if(t.first){let i=t.iterator;for(;i.next();)e.push(i.value)}else for(let i of t)e.push(i);return this.Gi(),this}clear(){this.u&&m.L(this),this.r.length=0,this.Gi()}contains(t){return this.has(t)}has(t){return t===null?!1:this.r.indexOf(t)!==-1}indexOf(t){return t===null?-1:this.r.indexOf(t)}elt(t){let e=this.r;return(t<0||t>=e.length)&&m.J(t,"0 <= i < length",q,"elt:i"),e[t]}get(t){return this.elt(t)}setElt(t,e){let i=this.r;(t<0||t>=i.length)&&m.J(t,"0 <= i < length",q,"setElt:i"),this.u&&m.L(this,t),i[t]=e}set(t,e){this.setElt(t,e)}first(){let t=this.r;return t.length===0?null:t[0]}last(){let t=this.r,e=t.length;return e>0?t[e-1]:null}pop(){this.u&&m.L(this);let t=this.r;if(t.length>0){let e=t.pop();return e===void 0?null:e}return null}any(t){let e=this.r,i=this.rt,s=e.length;for(let n=0;n<s;n++){if(t(e[n]))return!0;this.rt!==i&&m.Xi(this)}return!1}all(t){let e=this.r,i=this.rt,s=e.length;for(let n=0;n<s;n++){if(!t(e[n]))return!1;this.rt!==i&&m.Xi(this)}return!0}each(t){let e=this.r,i=this.rt,s=e.length;for(let n=0;n<s;n++)t(e[n]),this.rt!==i&&m.Xi(this);return this}map(t){let e=new q,i=[],s=this.r,n=this.rt,o=s.length;for(let r=0;r<o;r++)i.push(t(s[r])),this.rt!==n&&m.Xi(this);return e.r=i,e.Gi(),e}filter(t){let e=new q,i=[],s=this.r,n=this.rt,o=s.length;for(let r=0;r<o;r++){let a=s[r];t(a)&&i.push(a),this.rt!==n&&m.Xi(this)}return e.r=i,e.Gi(),e}insertAt(t,e){t<0&&m.J(t,">= 0",q,"insertAt:i"),this.u&&m.L(this,t);let i=this.r;t>=i.length?i.push(e):i.splice(t,0,e),this.Gi()}remove(t){return this.delete(t)}delete(t){if(t===null)return!1;this.u&&m.L(this,t);let e=this.r,i=e.indexOf(t);return i===-1?!1:(i===e.length-1?e.pop():e.splice(i,1),this.Gi(),!0)}removeAt(t){let e=this.r;(t<0||t>=e.length)&&m.J(t,"0 <= i < length",q,"removeAt:i"),this.u&&m.L(this,t),t===e.length-1?e.pop():e.splice(t,1),this.Gi()}removeRange(t,e){let i=this.r,s=i.length;if(t<0)t=0;else if(t>=s)return this;if(e<0)return this;if(e>=s&&(e=s-1),t>e)return this;this.u&&m.L(this);let n=t,o=e+1;for(;o<s;)i[n++]=i[o++];return i.length=s-(e-t+1),this.Gi(),this}copy(){let t=new q,e=this.r;return e.length>0&&(t.r=Array.prototype.slice.call(e)),t}toArray(){let t=this.r,e=this.count,i=new Array(e);for(let s=0;s<e;s++)i[s]=t[s];return i}get DL(){return this.r}toSet(){let t=new V,e=this.r,i=this.count;for(let s=0;s<i;s++)t.add(e[s]);return t}sort(t){return this.u&&m.L(this),this.r.sort(t),this.Gi(),this}sortRange(t,e,i){let s=this.r,n=s.length;e===void 0&&(e=0),i===void 0&&(i=n),this.u&&m.L(this);let o=i-e;if(o<=1)return this;if((e<0||e>=n-1)&&m.J(e,"0 <= from < length",q,"sortRange:from"),o===2){let r=s[e],a=s[e+1];return t(r,a)>0&&(s[e]=a,s[e+1]=r,this.Gi()),this}if(e===0)if(i>=n)s.sort(t);else{let r=s.slice(0,i);r.sort(t);for(let a=0;a<i;a++)s[a]=r[a]}else if(i>=n){let r=s.slice(e);r.sort(t);for(let a=e;a<n;a++)s[a]=r[a-e]}else{let r=s.slice(e,i);r.sort(t);for(let a=e;a<i;a++)s[a]=r[a-e]}return this.Gi(),this}reverse(){return this.u&&m.L(this),this.r.reverse(),this.Gi(),this}get count(){return this.r.length}get size(){return this.r.length}get length(){return this.r.length}get iterator(){if(this.r.length<=0)return kt.instance;let t=this.dr;return t!==null?(t.reset(),t):new gt(this)}get iteratorBackwards(){if(this.r.length<=0)return kt.instance;let t=this.gr;return t!==null?(t.reset(),t):new St(this)}}class Jt{To;oe;constructor(t){this.To=t,this.oe=t.g.values()}[Symbol.iterator](){return this.To.g.values()}key;value;get iterator(){return this}reset(){let t=this.To;this.oe=t.g.values()}next(){let t=this.oe.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return this.To.g.size===0?null:(this.oe=this.To.g.values(),this.oe.next().value)}any(t){return this.To.any(t)}all(t){return this.To.all(t)}each(t){return this.To.each(t),this}map(t){let e=new q;return this.To.g.forEach(i=>e.add(t(i))),e.iterator}filter(t){let e=new q;return this.To.g.forEach(i=>{t(i)&&e.add(i)}),e.iterator}get count(){return this.To.count}Ml(){this.key=null,this.value=null,this.oe=null}toString(){return"SetIterator"}}class V{u;g;constructor(t){this.u=!1,this.g=new Set,t!==void 0&&this.addAll(t)}[Symbol.iterator](){return this.g.values()}values(){return this.g.values()}k(){return this.u=!0,this}ce(){return this.u=!1,this}toString(){return"Set()#"+V.xs(this)}add(t){return t===null?this:(this.g.add(t),this)}addAll(t){if(t===null)return this;if(this.u&&m.L(this),t.first){let e=t.iterator;for(;e.next();)this.g.add(e.value)}else for(let e of t)this.g.add(e);return this}has(t){return this.g.has(t)}contains(t){return this.has(t)}containsAll(t){if(t===null)return!0;if(t.first){let e=t.iterator;for(;e.next();)if(!this.has(e.value))return!1}else for(let e of t)if(!this.has(e))return!1;return!0}containsAny(t){if(t===null)return!0;if(t.first){let e=t.iterator;for(;e.next();)if(this.has(e.value))return!0}else for(let e of t)if(this.has(e))return!0;return!1}first(){return this.g.size===0?null:this.g.values().next().value}any(t){for(let e of this.g)if(t(e))return!0;return!1}all(t){for(let e of this.g)if(!t(e))return!1;return!0}each(t){for(let e of this.g)t(e);return this}map(t){let e=new V;for(let i of this.g)e.add(t(i));return e}filter(t){let e=new V;for(let i of this.g)t(i)&&e.add(i);return e}delete(t){return this.u&&m.L(this),this.g.delete(t)}remove(t){return this.delete(t)}removeAll(t){if(t===null)return this;if(this.u&&m.L(this),t.first){let e=t.iterator;for(;e.next();)this.delete(e.value)}else for(let e of t)this.delete(e);return this}retainAll(t){if(t===null)return this;if(this.count===0)return this;this.u&&m.L(this);let e=new V;e.addAll(t);let i=[];if(t.first){let s=t.iterator;for(;s.next();){let n=s.value;e.has(n)||i.push(n)}}else for(let s of t)e.has(s)||i.push(s);return this.removeAll(i),this}clear(){this.u&&m.L(this),this.g.clear()}copy(){let t=new V;return this.g.forEach(e=>t.add(e)),t}toArray(){return Array.from(this.g)}toList(){let t=new q;return this.g.forEach(e=>t.add(e)),t}get count(){return this.g.size}get size(){return this.g.size}get iterator(){return this.g.size<=0?kt.instance:new Jt(this)}entries(){return this.g.entries()}keys(){return this.g.keys()}forEach(t,e){return this.g.forEach(t,e)}static Ww=1;static Je(t){t.__gohashid=V.Ww++}static xs(t){return t.__gohashid}}class We{j;oe;constructor(t){this.j=t,this.oe=t.g.keys()}[Symbol.iterator](){return this.j.g.keys()}key;value;get iterator(){return this}reset(){let t=this.j;this.oe=t.g.keys()}next(){let t=this.oe.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return this.j.g.size===0?null:(this.oe=this.j.g.keys(),this.oe.next().value)}any(t){for(let e of this.j.g)if(t(e[0]))return!0;return!1}all(t){for(let e of this.j.g)if(!t(e[0]))return!1;return!0}each(t){for(let e of this.j.g)t(e[0]);return this}map(t){let e=this.j,i=new q;for(let s of e.g)i.add(t(s[0]));return i.iterator}filter(t){let e=this.j,i=new q;for(let s of e.g){let n=s[0];t(n)&&i.add(n)}return i.iterator}get count(){return this.j.size}Ml(){this.key=null,this.value=null,this.oe=null}toString(){return"MapKeySetIterator"}}class Oi extends V{j;constructor(t){super(),V.Je(this),this.u=!0,this.j=t}[Symbol.iterator](){return this.g.keys()}values(){return this.g.keys()}k(){return this}ce(){return this}toString(){return"MapKeySet("+this.j.toString()+")"}add(t){m.o("This Set is read-only: "+this.toString())}has(t){return this.j.has(t)}contains(t){return this.has(t)}delete(t){m.o("This Set is read-only: "+this.toString())}remove(t){return this.delete(t)}clear(){m.o("This Set is read-only: "+this.toString())}first(){return this.j.g.size===0?null:this.j.g.keys().next().value}any(t){for(let e of this.j.g)if(t(e[0]))return!0;return!1}all(t){for(let e of this.j.g)if(!t(e[0]))return!1;return!0}each(t){for(let e of this.j.g)t(e[0]);return this}map(t){let e=new V;for(let i of this.j.g)e.add(t(i[0]));return e}filter(t){let e=new V;for(let i of this.j.g){let s=i[0];t(s)&&e.add(s)}return e}copy(){return new Oi(this.j)}toSet(){let t=new V,e=this.j.g;for(let i of e)t.add(i[0]);return t}toArray(){let t=this.j.g,e=new Array(t.size),i=0;for(let s of t)e[i]=s[0],i++;return e}toList(){let t=new q,e=this.j.g;for(let i of e)t.add(i[0]);return t}get count(){return this.j.size}get size(){return this.j.size}get iterator(){return this.j.size<=0?kt.instance:new We(this.j)}}class Tn{j;oe;constructor(t){this.j=t,this.oe=t.g.values()}[Symbol.iterator](){return this.j.g.values()}key;value;get iterator(){return this}reset(){let t=this.j;this.oe=t.g.values()}next(){let t=this.oe.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return this.j.g.size===0?null:(this.oe=this.j.g.values(),this.oe.next().value)}any(t){for(let e of this.j.g)if(t(e[1]))return!0;return!1}all(t){for(let e of this.j.g)if(!t(e[1]))return!1;return!0}each(t){for(let e of this.j.g)t(e[1]);return this}map(t){let e=this.j,i=new q;for(let s of e.g)i.add(t(s[1]));return i.iterator}filter(t){let e=this.j,i=new q;for(let s of e.g){let n=s[1];t(n)&&i.add(n)}return i.iterator}get count(){return this.j.size}Ml(){this.key=null,this.value=null,this.oe=null}toString(){return"MapValueSetIterator"}}class pe{constructor(t,e){this.key=t,this.value=e}toString(){return"{"+this.key+":"+this.value+"}"}key;value}class Ln{j;oe;constructor(t){this.j=t,this.oe=t.g.entries()}[Symbol.iterator](){return this.j.g.entries()}key;value;get iterator(){return this}reset(){let t=this.j;this.oe=t.g.entries()}next(){let t=this.oe.next();return t.done?(this.key=null,this.value=null,!1):(this.key=t.value[0],this.value=t.value[1],!0)}hasNext(){return this.next()}first(){if(this.j.g.size===0)return null;this.oe=this.j.g.entries();let t=this.oe.next().value;return this.key=t[0],this.value=t[1],new pe(t[0],t[1])}any(t){return this.j.any(t)}all(t){return this.j.all(t)}each(t){return this.j.each(t),this}map(t){let e=new q,i=null;return this.j.g.forEach((s,n)=>{i===null?i=new pe(n,s):(i.key=n,i.value=s),e.add(t(i))}),e.iterator}filter(t){let e=new q,i=null;return this.j.g.forEach((s,n)=>{i===null?i=new pe(n,s):(i.key=n,i.value=s),t(i)&&(e.add(i),i=null)}),e.iterator}get count(){return this.j.size}Ml(){this.key=null,this.value=null,this.oe=null}toString(){return"MapIterator"}}class Mt{u;g;constructor(t){V.Je(this),this.u=!1,this.g=new Map,t!==void 0&&this.addAll(t)}[Symbol.iterator](){return this.g.entries()}entries(){return this.g.entries()}k(){return this.u=!0,this}ce(){return this.u=!1,this}toString(){return"Map()#"+V.xs(this)}set(t,e){return this.u&&m.L(this,t),this.g.set(t,e),this}add(t,e){return this.set(t,e)}addAll(t){if(t===null)return this;if(this.u&&m.L(this),t instanceof Mt){let e=t.iterator;for(;e.next();)this.g.set(e.key,e.value)}else if(t.first){let e=t.iterator;for(;e.next();){let i=e.value;this.g.set(i.key,i.value)}}else for(let e of t){let i=e;Array.isArray(i)?this.g.set(i[0],i[1]):this.g.set(i.key,i.value)}return this}first(){if(this.g.size===0)return null;let t=this.g.entries().next().value;return t?new pe(t[0],t[1]):null}any(t){let e=null;for(let[i,s]of this.g)if(e===null?e=new pe(i,s):(e.key=i,e.value=s),t(e))return!0;return!1}all(t){let e=null;for(let[i,s]of this.g)if(e===null?e=new pe(i,s):(e.key=i,e.value=s),!t(e))return!1;return!0}each(t){let e=null;for(let[i,s]of this.g)e===null?e=new pe(i,s):(e.key=i,e.value=s),t(e);return this}map(t){let e=new Mt,i=null;for(let[s,n]of this.g)i===null?i=new pe(s,n):(i.key=s,i.value=n),e.set(s,t(i));return e}filter(t){let e=new Mt,i=null;for(let[s,n]of this.g)i===null?i=new pe(s,n):(i.key=s,i.value=n),t(i)&&e.set(s,n);return e}has(t){return this.g.has(t)}contains(t){return this.has(t)}get(t){let e=this.g.get(t);return e===void 0?null:e}getValue(t){return this.get(t)}delete(t){return t===null?!1:(this.u&&m.L(this,t),this.g.delete(t))}remove(t){return this.delete(t)}clear(){this.u&&m.L(this),this.g.clear()}copy(){let t=new Mt;return t.g=new Map(this.g),t}toArray(){let t=this.g,e=new Array(t.size),i=0;for(let s of t)e[i]=new pe(s[0],s[1]),i++;return e}toKeySet(){return new Oi(this)}get count(){return this.g.size}get size(){return this.g.size}get iterator(){return this.g.size<=0?kt.instance:new Ln(this)}get iteratorKeys(){return this.count<=0?kt.instance:new We(this)}keys(){return this.g.keys()}get iteratorValues(){return this.count<=0?kt.instance:new Tn(this)}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}}class P{px;py;u;constructor(t,e){t===void 0?(this.px=0,this.py=0):typeof t=="number"&&typeof e=="number"?(this.px=t,this.py=e):m.o("Invalid arguments to Point constructor: "+t+", "+e),this.u=!1}h(t){return this.px=t.px,this.py=t.py,this}e(t,e){return this.px=t,this.py=e,this}setTo(t,e){return this.px=t,this.py=e,this}set(t){return this.px=t.px,this.py=t.py,this}copy(){let t=new P;return t.px=this.px,t.py=this.py,t}kt(){return this.u=!0,Object.freeze(this),this}N(){return this.u||Object.isFrozen(this)?this:this.copy().k()}k(){return this.u||(this.u=!0),this}Jw(t){}static parse(t){if(typeof t=="string"){let e=t.split(" "),i=0,s=0;for(;e[i]==="";)i++;let n=e[i++];n&&(s=parseFloat(n));let o=0;for(;e[i]==="";)i++;return n=e[i++],n&&(o=parseFloat(n)),new P(s,o)}else return new P}static stringify(t){return t.x.toString()+" "+t.y.toString()}static stringifyFixed(t){return m.s(t,"number",P,"stringifyFixed:digits"),e=>e.x.toFixed(t)+" "+e.y.toFixed(t)}toString(){return"Point("+this.x+","+this.y+")"}equals(t){return t instanceof P?this.px===t.x&&this.py===t.y:!1}equalTo(t,e){return this.px===t&&this.py===e}equalsApprox(t){return C.c(this.px,t.x)&&C.c(this.py,t.y)}add(t){return this.px+=t.x,this.py+=t.y,this}subtract(t){return this.px-=t.x,this.py-=t.y,this}offset(t,e){return this.px+=t,this.py+=e,this}rotate(t){if(t===0)return this;let e=this.px,i=this.py;if(e===0&&i===0)return this;let s=0,n=0;if(t=C.Ee(t),t===90)s=0,n=1;else if(t===180)s=-1,n=0;else if(t===270)s=0,n=-1;else{let o=t*Math.PI/180;s=Math.cos(o),n=Math.sin(o)}return this.px=s*e-n*i,this.py=n*e+s*i,this}scale(t,e){return this.px*=t,this.py*=e,this}distanceSquaredPoint(t){let e=t.x-this.px,i=t.y-this.py;return e*e+i*i}distanceSquared(t,e){let i=t-this.px,s=e-this.py;return i*i+s*s}normalize(){let t=this.px,e=this.py,i=Math.sqrt(t*t+e*e);return i>0&&(this.px=t/i,this.py=e/i),this}directionPoint(t){return this.vL(t.x-this.px,t.y-this.py)}direction(t,e){return this.vL(t-this.px,e-this.py)}vL(t,e){if(t===0)return e>0?90:e<0?270:0;if(e===0)return t>0?0:180;{if(isNaN(t)||isNaN(e))return 0;let i=Math.atan(Math.abs(e/t))*180/Math.PI;return t<0?e<0?i+=180:i=180-i:e<0&&(i=360-i),i}}static compareWithLineSegment(t,e,i,s,n,o){return C.bu(t,e,i,s,n,o)}compareWithLineSegmentPoint(t,e){return C.bu(t.x,t.y,e.x,e.y,this.x,this.y)}static intersectingLineSegments(t,e,i,s,n,o,r,a){return C.ku(t,e,i,s,n,o,r,a)}projectOntoLineSegment(t,e,i,s){return C.Nl(t,e,i,s,this.px,this.py,this),this}projectOntoLineSegmentPoint(t,e){return C.Nl(t.x,t.y,e.x,e.y,this.px,this.py,this),this}snapToGrid(t,e,i,s){return C.tm(this.px,this.py,t,e,i,s,this),this}snapToGridPoint(t,e){return C.tm(this.px,this.py,t.x,t.y,e.width,e.height,this),this}setRectSpot(t,e){return this.px=t.x+e.x*t.width+e.offsetX,this.py=t.y+e.y*t.height+e.offsetY,this}setSpot(t,e,i,s,n){return this.px=t+n.x*i+n.offsetX,this.py=e+n.y*s+n.offsetY,this}v(t){return t.gt(this),this}Yi(t){return t.Ci(this),this}static distanceLineSegmentSquared(t,e,i,s,n,o){let r=n-i,a=o-s,h=r*r+a*a,l=i-t,u=s-e,c=-l*r-u*a;if(c<=0||c>=h)return r=n-t,a=o-e,Math.min(l*l+u*u,r*r+a*a);{let d=r*u-a*l;return d*d/h}}static distanceSquared(t,e,i,s){let n=i-t,o=s-e;return n*n+o*o}static direction(t,e,i,s){let n=i-t,o=s-e;if(n===0)return o>0?90:o<0?270:0;if(o===0)return n>0?0:180;{if(isNaN(n)||isNaN(o))return 0;let r=Math.atan(Math.abs(o/n))*180/Math.PI;return n<0?o<0?r+=180:r=180-r:o<0&&(r=360-r),r}}get x(){return this.px}set x(t){this.px=t}get y(){return this.py}set y(t){this.py=t}isReal(){return isFinite(this.x)&&isFinite(this.y)}static dn=new P(0,0).kt();static FL=new P(-1/0,-1/0).kt();static RL=new P(1/0,1/0).kt();static OL=new P(6,6).kt();static gn=new P(NaN,NaN).kt();static $w=[];static l(){let t=P.$w.pop();return t===void 0?new P:t}static bs(t){let e=P.$w.pop();return e===void 0?t.copy():e.h(t)}static z(t,e){let i=P.$w.pop();return i===void 0?new P(t,e):(i.x=t,i.y=e,i)}static i(t){P.$w.push(t)}}class st{sw;sh;u;constructor(t,e){t===void 0?(this.sw=0,this.sh=0):typeof t=="number"&&(t>=0||isNaN(t))&&typeof e=="number"&&(e>=0||isNaN(e))?(this.sw=t,this.sh=e):m.o("Invalid arguments to Size constructor: "+t+", "+e),this.u=!1}h(t){return this.sw=t.sw,this.sh=t.sh,this}e(t,e){return this.sw=t,this.sh=e,this}setTo(t,e){return this.sw=t,this.sh=e,this}set(t){return this.sw=t.sw,this.sh=t.sh,this}copy(){let t=new st;return t.sw=this.sw,t.sh=this.sh,t}kt(){return this.u=!0,Object.freeze(this),this}N(){return this.u||Object.isFrozen(this)?this:this.copy().k()}k(){return this.u||(this.u=!0),this}Jw(t){}static parse(t){if(typeof t=="string"){let e=t.split(" "),i=0,s=0;for(;e[i]==="";)i++;let n=e[i++];n&&(s=parseFloat(n));let o=0;for(;e[i]==="";)i++;return n=e[i++],n&&(o=parseFloat(n)),new st(s,o)}else return new st}static stringify(t){return t.width.toString()+" "+t.height.toString()}static stringifyFixed(t){return m.s(t,"number",st,"stringifyFixed:digits"),e=>e.width.toFixed(t)+" "+e.height.toFixed(t)}toString(){return"Size("+this.width+","+this.height+")"}equals(t){return t instanceof st?this.sw===t.width&&this.sh===t.height:!1}equalTo(t,e){return this.sw===t&&this.sh===e}equalsApprox(t){return C.c(this.sw,t.width)&&C.c(this.sh,t.height)}inflate(t,e){let i=this.width+t;this.sw=i>=0?i:0;let s=this.height+e;return this.sh=s>=0?s:0,this}get width(){return this.sw}set width(t){t<0&&m.J(t,">= 0",st,"width"),this.sw=t}get height(){return this.sh}set height(t){t<0&&m.J(t,">= 0",st,"height"),this.sh=t}isReal(){return isFinite(this.width)&&isFinite(this.height)}static xc=new st(0,0).kt();static TP=new st(1,1).kt();static IL=new st(6,6).kt();static Pu=new st(8,8).kt();static EL=new st(10,10).kt();static DP=new st(1/0,1/0).kt();static Zw=new st(NaN,NaN).kt();static UL=[];static l(){let t=st.UL.pop();return t===void 0?new st:t}static i(t){st.UL.push(t)}}class I{rx;ry;rw;rh;u;constructor(t,e,i,s){if(t===void 0)this.rx=0,this.ry=0,this.rw=0,this.rh=0;else if(typeof t=="number"&&typeof e=="number"&&typeof i=="number"&&(i>=0||isNaN(i))&&typeof s=="number"&&(s>=0||isNaN(s)))this.rx=t,this.ry=e,this.rw=i,this.rh=s;else if(t instanceof P){let n=t.x,o=t.y;if(e instanceof P){let r=e.x,a=e.y;this.rx=Math.min(n,r),this.ry=Math.min(o,a),this.rw=Math.abs(n-r),this.rh=Math.abs(o-a)}else e instanceof st?(this.rx=n,this.ry=o,this.rw=e.width,this.rh=e.height):m.o("Incorrect second argument supplied to Rect constructor "+e)}else m.o("Invalid arguments to Rect constructor: "+t+", "+e+", "+i+", "+s);this.u=!1}h(t){return this.rx=t.rx,this.ry=t.ry,this.rw=t.rw,this.rh=t.rh,this}e(t,e,i,s){return this.rx=t,this.ry=e,this.rw=i,this.rh=s,this}Hn(t,e){return this.rw=t,this.rh=e,this}setTo(t,e,i,s){return this.rx=t,this.ry=e,this.rw=i,this.rh=s,this}set(t){return this.rx=t.rx,this.ry=t.ry,this.rw=t.rw,this.rh=t.rh,this}setPoint(t){return this.rx=t.x,this.ry=t.y,this}setSize(t){return this.rw=t.width,this.rh=t.height,this}copy(){let t=new I;return t.rx=this.rx,t.ry=this.ry,t.rw=this.rw,t.rh=this.rh,t}kt(){return this.u=!0,Object.freeze(this),this}N(){return this.u||Object.isFrozen(this)?this:this.copy().k()}k(){return this.u||(this.u=!0),this}ce(){return this.u&&(Object.isFrozen(this)&&m.o("cannot thaw constant: "+this),this.u=!1),this}Jw(t){}static parse(t){if(typeof t=="string"){let e=t.split(" "),i=0,s=0;for(;e[i]==="";)i++;let n=e[i++];n&&(s=parseFloat(n));let o=0;for(;e[i]==="";)i++;n=e[i++],n&&(o=parseFloat(n));let r=0;for(;e[i]==="";)i++;n=e[i++],n&&(r=parseFloat(n));let a=0;for(;e[i]==="";)i++;return n=e[i++],n&&(a=parseFloat(n)),new I(s,o,r,a)}else return new I}static stringify(t){return t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}static stringifyFixed(t){return m.s(t,"number",I,"stringifyFixed:digits"),e=>e.x.toFixed(t)+" "+e.y.toFixed(t)+" "+e.width.toFixed(t)+" "+e.height.toFixed(t)}toString(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"}equals(t){return t instanceof I?this.rx===t.x&&this.ry===t.y&&this.rw===t.width&&this.rh===t.height:!1}equalTo(t,e,i,s){return this.rx===t&&this.ry===e&&this.rw===i&&this.rh===s}equalsApprox(t){return C.c(this.rx,t.x)&&C.c(this.ry,t.y)&&C.c(this.rw,t.width)&&C.c(this.rh,t.height)}equalsApproxTo(t,e,i,s){return C.c(this.rx,t)&&C.c(this.ry,e)&&C.c(this.rw,i)&&C.c(this.rh,s)}equalsApproxClose(t){return C.X(this.rx,t.x)&&C.X(this.ry,t.y)&&C.X(this.rw,t.width)&&C.X(this.rh,t.height)}containsPoint(t){return this.rx<=t.x&&this.rx+this.rw>=t.x&&this.ry<=t.y&&this.ry+this.rh>=t.y}containsRect(t){return this.rx<=t.x&&t.x+t.width<=this.rx+this.rw&&this.ry<=t.y&&t.y+t.height<=this.ry+this.rh}contains(t,e,i,s){return i===void 0&&(i=0),s===void 0&&(s=0),this.rx<=t&&t+i<=this.rx+this.rw&&this.ry<=e&&e+s<=this.ry+this.rh}offset(t,e){return this.rx+=t,this.ry+=e,this}inflate(t,e){return this.Qw(e,t,e,t)}addMargin(t){return this.Qw(t.top,t.right,t.bottom,t.left)}subtractMargin(t){return this.Qw(-t.top,-t.right,-t.bottom,-t.left)}grow(t,e,i,s){return this.Qw(t,e,i,s)}Qw(t,e,i,s){let n=this.rw;e+s<=-n?(this.rx+=n/2,this.rw=0):(this.rx-=s,this.rw+=e+s);let o=this.rh;return t+i<=-o?(this.ry+=o/2,this.rh=0):(this.ry-=t,this.rh+=t+i),this}intersectRect(t){return this.VL(t.x,t.y,t.width,t.height)}intersect(t,e,i,s){return this.VL(t,e,i,s)}VL(t,e,i,s){let n=Math.max(this.rx,t),o=Math.max(this.ry,e),r=Math.min(this.rx+this.rw,t+i),a=Math.min(this.ry+this.rh,e+s);return this.rx=n,this.ry=o,this.rw=Math.max(0,r-n),this.rh=Math.max(0,a-o),this}intersectsRect(t){return this.intersects(t.x,t.y,t.width,t.height)}intersects(t,e,i,s){let n=this.rw,o=this.rx;if(n!==1/0&&i!==1/0&&(n+=o,i+=t,isNaN(i)||isNaN(n)||o>i||t>n))return!1;let r=this.rh,a=this.ry;return!(r!==1/0&&s!==1/0&&(r+=a,s+=e,isNaN(s)||isNaN(r)||a>s||e>r))}BL(t,e){let i=this.rw,s=t.width+e+e,n=this.rx,o=t.x-e;if(i+=n,s+=o,n>s||o>i)return!1;let r=this.rh,a=t.height+e+e,h=this.ry,l=t.y-e;return r+=h,a+=l,!(h>a||l>r)}unionPoint(t){return this.re(t.x,t.y,0,0)}unionRect(t){return this.re(t.rx,t.ry,t.rw,t.rh)}union(t,e,i,s){return i===void 0&&(i=0),s===void 0&&(s=0),this.re(t,e,i,s)}re(t,e,i,s){let n=Math.min(this.rx,t),o=Math.min(this.ry,e),r=Math.max(this.rx+this.rw,t+i),a=Math.max(this.ry+this.rh,e+s);return this.rx=n,this.ry=o,this.rw=r-n,this.rh=a-o,this}setSpot(t,e,i){return this.rx=t-i.offsetX-i.x*this.rw,this.ry=e-i.offsetY-i.y*this.rh,this}nearestSideDirection(t,e){return C._w(this,t,e,!0)}nearestSideDirectionPoint(t){return C._w(this,t.x,t.y,!0)}static contains(t,e,i,s,n,o,r,a){return r===void 0&&(r=0),a===void 0&&(a=0),t<=n&&n+r<=t+i&&e<=o&&o+a<=e+s}static intersects(t,e,i,s,n,o,r,a){let h=i,l=r,u=t,c=n;if(h+=u,l+=c,u>l||c>h)return!1;let d=s,f=a,p=e,g=o;return d+=p,f+=g,!(p>f||g>d)}static intersectsLineSegment(t,e,i,s,n,o,r,a){return C.zL(t,e,i,s,n,o,r,a)}get x(){return this.rx}set x(t){this.rx=t}get y(){return this.ry}set y(t){this.ry=t}get width(){return this.rw}set width(t){t<0&&m.J(t,">= 0",I,"width"),this.rw=t}get height(){return this.rh}set height(t){t<0&&m.J(t,">= 0",I,"height"),this.rh=t}get left(){return this.rx}set left(t){this.rx=t}get top(){return this.ry}set top(t){this.ry=t}get right(){return this.rx+this.rw}set right(t){this.rx+=t-(this.rx+this.rw)}get bottom(){return this.ry+this.rh}set bottom(t){this.ry+=t-(this.ry+this.rh)}get position(){return new P(this.rx,this.ry)}set position(t){this.rx=t.x,this.ry=t.y}get size(){return new st(this.rw,this.rh)}set size(t){this.rw=t.width,this.rh=t.height}get center(){return new P(this.rx+this.rw/2,this.ry+this.rh/2)}set center(t){this.rx=t.x-this.rw/2,this.ry=t.y-this.rh/2}get centerX(){return this.rx+this.rw/2}set centerX(t){this.rx=t-this.rw/2}get centerY(){return this.ry+this.rh/2}set centerY(t){this.ry=t-this.rh/2}isReal(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)}isEmpty(){return this.width===0&&this.height===0}static em=new I(0,0,0,0).kt();static YF=new I(NaN,NaN,NaN,NaN).kt();static tx=[];static l(){let t=I.tx.pop();return t===void 0?new I:t}static bs(t){let e=I.tx.pop();return e===void 0?t.copy():e.h(t)}static z(t,e,i,s){let n=I.tx.pop();return n===void 0?new I(t,e,i,s):n.e(t,e,i,s)}static i(t){I.tx.push(t)}}class Dt{mt;mr;mb;ml;constructor(t,e,i,s){t===void 0?(this.mt=0,this.mr=0,this.mb=0,this.ml=0):e===void 0?(e=t,i=t,s=t,this.mt=t,this.mr=e,this.mb=i,this.ml=s):i===void 0?(i=t,s=e,this.mt=t,this.mr=e,this.mb=i,this.ml=s):s!==void 0?(this.mt=t,this.mr=e,this.mb=i,this.ml=s):m.o("Invalid arguments to Margin constructor: "+t+", "+e+", "+i+", "+s)}setTo(t,e,i,s){return this.mt=t,this.mr=e,this.mb=i,this.ml=s,this}set(t){return this.mt=t.mt,this.mr=t.mr,this.mb=t.mb,this.ml=t.ml,this}copy(){let t=new Dt;return t.mt=this.mt,t.mr=this.mr,t.mb=this.mb,t.ml=this.ml,t}kt(){return Object.freeze(this),this}N(){return Object.isFrozen(this)?this:this.copy().kt()}Jw(t){}static parse(t){if(typeof t=="string"){let e=t.split(" "),i=0,s=NaN;for(;e[i]==="";)i++;let n=e[i++];if(n&&(s=parseFloat(n)),isNaN(s))return new Dt;let o=NaN;for(;e[i]==="";)i++;if(n=e[i++],n&&(o=parseFloat(n)),isNaN(o))return new Dt(s);let r=NaN;for(;e[i]==="";)i++;if(n=e[i++],n&&(r=parseFloat(n)),isNaN(r))return new Dt(s,o);let a=NaN;for(;e[i]==="";)i++;return n=e[i++],n&&(a=parseFloat(n)),isNaN(a)?new Dt(s,o):new Dt(s,o,r,a)}else return new Dt}static stringify(t){return t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}static stringifyFixed(t){return m.s(t,"number",Dt,"stringifyFixed:digits"),e=>e.top.toFixed(t)+" "+e.right.toFixed(t)+" "+e.bottom.toFixed(t)+" "+e.left.toFixed(t)}toString(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"}equals(t){return t instanceof Dt?this.mt===t.top&&this.mr===t.right&&this.mb===t.bottom&&this.ml===t.left:!1}equalTo(t,e,i,s){return this.mt===t&&this.mr===e&&this.mb===i&&this.ml===s}equalsApprox(t){return C.c(this.mt,t.top)&&C.c(this.mr,t.right)&&C.c(this.mb,t.bottom)&&C.c(this.ml,t.left)}get top(){return this.mt}set top(t){this.mt=t}get right(){return this.mr}set right(t){this.mr=t}get bottom(){return this.mb}set bottom(t){this.mb=t}get left(){return this.ml}set left(t){this.ml=t}isReal(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)}static im=new Dt(0,0,0,0).kt();static XL=new Dt(2,2,2,2).kt()}class T{sx;sy;ox;oy;constructor(t,e,i,s){t===void 0?(this.sx=0,this.sy=0,this.ox=0,this.oy=0):(e===void 0&&(e=0),i===void 0&&(i=0),s===void 0&&(s=0),this.sx=t,this.sy=e,this.ox=i,this.oy=s)}setTo(t,e,i,s){return this.sx=t,this.sy=e,this.ox=i,this.oy=s,this}set(t){return this.sx=t.sx,this.sy=t.sy,this.ox=t.ox,this.oy=t.oy,this}copy(){let t=new T;return t.sx=this.sx,t.sy=this.sy,t.ox=this.ox,t.oy=this.oy,t}kt(){return Object.freeze(this),this}N(){return Object.isFrozen(this)?this:this.copy().kt()}Jw(t){}Ki(t){return this.sx=NaN,this.sy=NaN,this.ox=t,this.kt()}DU(t,e){(isNaN(t)||t>1||t<0)&&m.J(t,"0 <= "+e+" <= 1",T,e)}vU(t,e){(isNaN(t)||t===1/0||t===-1/0)&&m.J(t,"real number, not NaN or Infinity",T,e)}static parse(t){if(typeof t=="string"){if(t=t.trim(),t==="None")return T.None;if(t==="TopLeft")return T.TopLeft;if(t==="Top"||t==="TopCenter"||t==="MiddleTop")return T.TopCenter;if(t==="TopRight")return T.TopRight;if(t==="Left"||t==="LeftCenter"||t==="MiddleLeft")return T.LeftCenter;if(t==="Center")return T.Center;if(t==="Right"||t==="RightCenter"||t==="MiddleRight")return T.RightCenter;if(t==="BottomLeft")return T.BottomLeft;if(t==="Bottom"||t==="BottomCenter"||t==="MiddleBottom")return T.BottomCenter;if(t==="BottomRight")return T.BottomRight;if(t==="TopSide")return T.TopSide;if(t==="LeftSide")return T.LeftSide;if(t==="RightSide")return T.RightSide;if(t==="BottomSide")return T.BottomSide;if(t==="TopBottomSides")return T.TopBottomSides;if(t==="LeftRightSides")return T.LeftRightSides;if(t==="TopLeftSides")return T.TopLeftSides;if(t==="TopRightSides")return T.TopRightSides;if(t==="BottomLeftSides")return T.BottomLeftSides;if(t==="BottomRightSides")return T.BottomRightSides;if(t==="NotTopSide")return T.NotTopSide;if(t==="NotLeftSide")return T.NotLeftSide;if(t==="NotRightSide")return T.NotRightSide;if(t==="NotBottomSide")return T.NotBottomSide;if(t==="AllSides")return T.AllSides;if(t==="Default")return T.Default;let e=t.split(" "),i=0,s=0;for(;e[i]==="";)i++;let n=e[i++];n!==void 0&&n.length>0&&(s=parseFloat(n));let o=0;for(;e[i]==="";)i++;n=e[i++],n!==void 0&&n.length>0&&(o=parseFloat(n));let r=0;for(;e[i]==="";)i++;n=e[i++],n!==void 0&&n.length>0&&(r=parseFloat(n));let a=0;for(;e[i]==="";)i++;return n=e[i++],n!==void 0&&n.length>0&&(a=parseFloat(n)),new T(s,o,r,a)}else return new T}static stringify(t){return t.isSpot()?t.x.toString()+" "+t.y.toString()+" "+t.offsetX.toString()+" "+t.offsetY.toString():t.toString()}static stringifyFixed(t){return m.s(t,"number",T,"stringifyFixed:digits"),e=>e.x.toFixed(t)+" "+e.y.toFixed(t)+" "+e.offsetX.toFixed(t)+" "+e.offsetY.toFixed(t)}toString(){return this.isSpot()?this.ox===0&&this.oy===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.equals(T.None)?"None":this.equals(T.TopLeft)?"TopLeft":this.equals(T.TopCenter)?"Top":this.equals(T.TopRight)?"TopRight":this.equals(T.LeftCenter)?"Left":this.equals(T.Center)?"Center":this.equals(T.RightCenter)?"Right":this.equals(T.BottomLeft)?"BottomLeft":this.equals(T.BottomCenter)?"Bottom":this.equals(T.BottomRight)?"BottomRight":this.equals(T.TopSide)?"TopSide":this.equals(T.LeftSide)?"LeftSide":this.equals(T.RightSide)?"RightSide":this.equals(T.BottomSide)?"BottomSide":this.equals(T.TopBottomSides)?"TopBottomSides":this.equals(T.LeftRightSides)?"LeftRightSides":this.equals(T.TopLeftSides)?"TopLeftSides":this.equals(T.TopRightSides)?"TopRightSides":this.equals(T.BottomLeftSides)?"BottomLeftSides":this.equals(T.BottomRightSides)?"BottomRightSides":this.equals(T.NotTopSide)?"NotTopSide":this.equals(T.NotLeftSide)?"NotLeftSide":this.equals(T.NotRightSide)?"NotRightSide":this.equals(T.NotBottomSide)?"NotBottomSide":this.equals(T.AllSides)?"AllSides":this.equals(T.Default)?"Default":"None"}equals(t){return t instanceof T?(this.sx===t.x||isNaN(this.sx)&&isNaN(t.x))&&(this.sy===t.y||isNaN(this.sy)&&isNaN(t.y))&&this.ox===t.offsetX&&this.oy===t.offsetY:!1}opposite(){return new T(.5-(this.sx-.5),.5-(this.sy-.5),-this.ox,-this.oy)}includesSide(t){if(!this.isSide())return!1;if(!t.isSide())if(t.equals(T.Left))t=T.LeftSide;else if(t.equals(T.Right))t=T.RightSide;else if(t.equals(T.Top))t=T.TopSide;else if(t.equals(T.Bottom))t=T.BottomSide;else return!1;let e=this.oy,i=t.offsetY;return(e&i)===i}get x(){return this.sx}set x(t){this.sx=t}get y(){return this.sy}set y(t){this.sy=t}get offsetX(){return this.ox}set offsetX(t){this.ox=t}get offsetY(){return this.oy}set offsetY(t){this.oy=t}isSpot(){return!isNaN(this.x)&&!isNaN(this.y)}isNoSpot(){return isNaN(this.x)||isNaN(this.y)}isSide(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0}isNone(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0}isDefault(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0}static None=new T(0,0,0,0).Ki(0);static Default=new T(0,0,-1,0).Ki(-1);static TopLeft=new T(0,0,0,0).kt();static TopCenter=new T(.5,0,0,0).kt();static TopRight=new T(1,0,0,0).kt();static LeftCenter=new T(0,.5,0,0).kt();static Center=new T(.5,.5,0,0).kt();static RightCenter=new T(1,.5,0,0).kt();static BottomLeft=new T(0,1,0,0).kt();static BottomCenter=new T(.5,1,0,0).kt();static BottomRight=new T(1,1,0,0).kt();static MiddleTop=T.TopCenter;static MiddleLeft=T.LeftCenter;static MiddleRight=T.RightCenter;static MiddleBottom=T.BottomCenter;static Top=T.TopCenter;static Left=T.LeftCenter;static Right=T.RightCenter;static Bottom=T.BottomCenter;static TopSide=new T(0,0,1,1).Ki(1);static LeftSide=new T(0,0,1,2).Ki(1);static RightSide=new T(0,0,1,4).Ki(1);static BottomSide=new T(0,0,1,8).Ki(1);static TopBottomSides=new T(0,0,1,9).Ki(1);static LeftRightSides=new T(0,0,1,6).Ki(1);static TopLeftSides=new T(0,0,1,3).Ki(1);static TopRightSides=new T(0,0,1,5).Ki(1);static BottomLeftSides=new T(0,0,1,10).Ki(1);static BottomRightSides=new T(0,0,1,12).Ki(1);static NotTopSide=new T(0,0,1,14).Ki(1);static NotLeftSide=new T(0,0,1,13).Ki(1);static NotRightSide=new T(0,0,1,11).Ki(1);static NotBottomSide=new T(0,0,1,7).Ki(1);static AllSides=new T(0,0,1,15).Ki(1);static vP=new T(.156,.156).kt();static FP=new T(.844,.844).kt()}class Nt{m11;m12;m21;m22;dx;dy;constructor(){this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0}set(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this.dx=t.dx,this.dy=t.dy,this}setTo(t,e,i,s,n,o){return this.m11=t,this.m12=e,this.m21=i,this.m22=s,this.dx=n,this.dy=o,this}copy(){let t=new Nt;return t.m11=this.m11,t.m12=this.m12,t.m21=this.m21,t.m22=this.m22,t.dx=this.dx,t.dy=this.dy,t}toString(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}equals(t){return this.m11===t.m11&&this.m12===t.m12&&this.m21===t.m21&&this.m22===t.m22&&this.dx===t.dx&&this.dy===t.dy}RP(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1}Ue(){return this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0,this}bc(t){let e=this.m11*t.m11+this.m21*t.m12,i=this.m12*t.m11+this.m22*t.m12,s=this.m11*t.m21+this.m21*t.m22,n=this.m12*t.m21+this.m22*t.m22;return this.dx=this.m11*t.dx+this.m21*t.dy+this.dx,this.dy=this.m12*t.dx+this.m22*t.dy+this.dy,this.m11=e,this.m12=i,this.m21=s,this.m22=n,this}GL(t){let e=1/(t.m11*t.m22-t.m12*t.m21),i=t.m22*e,s=-t.m12*e,n=-t.m21*e,o=t.m11*e,r=e*(t.m21*t.dy-t.m22*t.dx),a=e*(t.m12*t.dx-t.m11*t.dy),h=this.m11*i+this.m21*s,l=this.m12*i+this.m22*s,u=this.m11*n+this.m21*o,c=this.m12*n+this.m22*o;return this.dx=this.m11*r+this.m21*a+this.dx,this.dy=this.m12*r+this.m22*a+this.dy,this.m11=h,this.m12=l,this.m21=u,this.m22=c,this}ex(){let t=1/(this.m11*this.m22-this.m12*this.m21),e=this.m22*t,i=-this.m12*t,s=-this.m21*t,n=this.m11*t,o=t*(this.m21*this.dy-this.m22*this.dx),r=t*(this.m12*this.dx-this.m11*this.dy);return this.m11=e,this.m12=i,this.m21=s,this.m22=n,this.dx=o,this.dy=r,this}ks(t,e,i){if(t=C.Ee(t),t===0)return this;this.Xs(e,i);let s=0,n=0;if(t===90)s=0,n=1;else if(t===180)s=-1,n=0;else if(t===270)s=0,n=-1;else{let l=t*Math.PI/180;s=Math.cos(l),n=Math.sin(l)}let o=this.m11*s+this.m21*n,r=this.m12*s+this.m22*n,a=this.m11*-n+this.m21*s,h=this.m12*-n+this.m22*s;return this.m11=o,this.m12=r,this.m21=a,this.m22=h,this.Xs(-e,-i),this}Xs(t,e){return this.dx+=this.m11*t+this.m21*e,this.dy+=this.m12*t+this.m22*e,this}it(t,e){return e===void 0&&(e=t),this.m11*=t,this.m12*=t,this.m21*=e,this.m22*=e,this}KF(){if(this.m11===1&&this.m12===0)return 0;let t=Math.atan2(this.m12,this.m11)*180/Math.PI;return t<0&&(t+=360),t}gt(t){let e=t.x,i=t.y;return t.e(e*this.m11+i*this.m21+this.dx,e*this.m12+i*this.m22+this.dy)}Ci(t){let e=1/(this.m11*this.m22-this.m12*this.m21),i=this.m22*e,s=-this.m12*e,n=-this.m21*e,o=this.m11*e,r=t.x-this.dx,a=t.y-this.dy;return t.e(r*i+a*n,r*s+a*o)}Su(t){let e=1/(this.m11*this.m22-this.m12*this.m21),i=this.m22*e,s=-this.m12*e,n=-this.m21*e,o=this.m11*e,r=e*(this.m21*this.dy-this.m22*this.dx),a=e*(this.m12*this.dx-this.m11*this.dy),h=t.x*1.25,l=t.y*1.2;return t.e(h*i+l*n+r,h*s+l*o+a)}sm(t){let e=t.x,i=t.y,s=e+t.width,n=i+t.height,o=this.m11,r=this.m12,a=this.m21,h=this.m22,l=this.dx,u=this.dy,c=e*o+i*a+l,d=e*r+i*h+u,f=s*o+i*a+l,p=s*r+i*h+u,g=e*o+n*a+l,y=e*r+n*h+u,b=s*o+n*a+l,v=s*r+n*h+u,w=c,k=c,S=d,N=d;return w=Math.min(w,f),k=Math.max(k,f),S=Math.min(S,p),N=Math.max(N,p),w=Math.min(w,g),k=Math.max(k,g),S=Math.min(S,y),N=Math.max(N,y),w=Math.min(w,b),k=Math.max(k,b),S=Math.min(S,v),N=Math.max(N,v),t.e(w,S,k-w,N-S),t}static YL=[];static l(){let t=Nt.YL.pop();return t===void 0?new Nt:t}static i(t){Nt.YL.push(t)}static OP="54a702f3e53909c447824c6706603faf4c"}let C={HF:"7da71ca0ad381e90",qn:4*((Math.sqrt(2)-1)/3),KL:[],ix:x=>{if(x<=0)return 0;let t=C.KL;if(t===null){t=[];for(let e=0;e<=2e3;e++)t[e]=Math.sqrt(e);C.KL=t}if(x<1){let e=1/x;return e<=2e3?1/t[e|0]:Math.sqrt(x)}else return x<=2e3?t[x|0]:Math.sqrt(x)},c:(x,t)=>{let e=x-t;return e<.5&&e>-.5},X:(x,t)=>{let e=x-t;return e<5e-8&&e>-5e-8},Ve:(x,t,e,i,s,n,o)=>{s<=0&&(s=1e-6);let r=0,a=0,h=0,l=0;if(x<e?(a=x,r=e):(a=e,r=x),t<i?(l=t,h=i):(l=i,h=t),x===e)return l<=o&&o<=h&&x-s<=n&&n<=x+s;if(t===i)return a<=n&&n<=r&&t-s<=o&&o<=t+s;let u=r+s,c=a-s;if(c<=n&&n<=u){let d=h+s,f=l-s;if(f<=o&&o<=d)if(u-c>d-f)if(x-e>s||e-x>s){let p=(i-t)/(e-x)*(n-x)+t;if(p-s<=o&&o<=p+s)return!0}else return!0;else if(t-i>s||i-t>s){let p=(e-x)/(i-t)*(o-t)+x;if(p-s<=n&&n<=p+s)return!0}else return!0}return!1},nx:(x,t,e,i,s,n,o,r,a,h,l,u)=>{if(!C.Ve(x,t,o,r,u,e,i)||!C.Ve(x,t,o,r,u,s,n)){let c=(x+e)/2,d=(t+i)/2,f=(e+s)/2,p=(i+n)/2,g=(s+o)/2,y=(n+r)/2,b=(c+f)/2,v=(d+p)/2,w=(f+g)/2,k=(p+y)/2,S=(b+w)/2,N=(v+k)/2;return C.nx(x,t,c,d,b,v,S,N,a,h,l,u)||C.nx(S,N,w,k,g,y,o,r,a,h,l,u)}else return C.Ve(x,t,o,r,u,h,l)},HL:(x,t,e,i,s,n,o,r,a)=>{let h=(x+e)/2,l=(t+i)/2,u=(e+s)/2,c=(i+n)/2,d=(s+o)/2,f=(n+r)/2,p=(h+u)/2,g=(l+c)/2,y=(u+d)/2,b=(c+f)/2;return a.e((p+y)/2,(g+b)/2),a},qF:(x,t,e,i,s,n,o,r)=>{let a=(x+e)/2,h=(t+i)/2,l=(e+s)/2,u=(i+n)/2,c=(s+o)/2,d=(n+r)/2,f=(a+l)/2,p=(h+u)/2,g=(l+c)/2,y=(u+d)/2;return P.direction(f,p,g,y)},Mu:(x,t,e,i,s,n,o,r,a,h)=>{if(!C.Ve(x,t,o,r,a,e,i)||!C.Ve(x,t,o,r,a,s,n)){let l=(x+e)/2,u=(t+i)/2,c=(e+s)/2,d=(i+n)/2,f=(s+o)/2,p=(n+r)/2,g=(l+c)/2,y=(u+d)/2,b=(c+f)/2,v=(d+p)/2,w=(g+b)/2,k=(y+v)/2;C.Mu(x,t,l,u,g,y,w,k,a,h),C.Mu(w,k,b,v,f,p,o,r,a,h)}else h.re(x,t,0,0),h.re(o,r,0,0);return h},jn:(x,t,e,i,s,n,o,r,a,h)=>{if(!C.Ve(x,t,o,r,a,e,i)||!C.Ve(x,t,o,r,a,s,n)){let l=(x+e)/2,u=(t+i)/2,c=(e+s)/2,d=(i+n)/2,f=(s+o)/2,p=(n+r)/2,g=(l+c)/2,y=(u+d)/2,b=(c+f)/2,v=(d+p)/2,w=(g+b)/2,k=(y+v)/2;C.jn(x,t,l,u,g,y,w,k,a,h),C.jn(w,k,b,v,f,p,o,r,a,h)}else h.length===0&&(h.push(x),h.push(t)),h.push(o),h.push(r);return h},IP:(x,t,e,i,s,n,o,r,a,h)=>{if(C.Ve(x,t,s,n,h,e,i))return C.Ve(x,t,s,n,h,r,a);{let l=(x+e)/2,u=(t+i)/2,c=(e+s)/2,d=(i+n)/2,f=(l+c)/2,p=(u+d)/2;return C.IP(x,t,l,u,f,p,o,r,a,h)||C.IP(f,p,c,d,s,n,o,r,a,h)}},EP:(x,t,e,i,s,n,o,r)=>{if(C.Ve(x,t,s,n,o,e,i))r.re(x,t,0,0),r.re(s,n,0,0);else{let a=(x+e)/2,h=(t+i)/2,l=(e+s)/2,u=(i+n)/2,c=(a+l)/2,d=(h+u)/2;C.EP(x,t,a,h,c,d,o,r),C.EP(c,d,l,u,s,n,o,r)}return r},nm:(x,t,e,i,s,n,o,r)=>{if(C.Ve(x,t,s,n,o,e,i))r.length===0&&(r.push(x),r.push(t)),r.push(s),r.push(n);else{let a=(x+e)/2,h=(t+i)/2,l=(e+s)/2,u=(i+n)/2,c=(a+l)/2,d=(h+u)/2;C.nm(x,t,a,h,c,d,o,r),C.nm(c,d,l,u,s,n,o,r)}return r},om:(x,t,e,i,s,n,o,r,a,h,l,u,c,d)=>{if(!C.Ve(x,t,o,r,c,e,i)||!C.Ve(x,t,o,r,c,s,n)){let f=(x+e)/2,p=(t+i)/2,g=(e+s)/2,y=(i+n)/2,b=(s+o)/2,v=(n+r)/2,w=(f+g)/2,k=(p+y)/2,S=(g+b)/2,N=(y+v)/2,D=(w+S)/2,L=(k+N)/2,M=1/0,A=!1,F=0,O=0;if(C.om(x,t,f,p,w,k,D,L,a,h,l,u,c,d)){let E=(d.x-a)**2+(d.y-h)**2;E<M&&(M=E,A=!0,F=d.x,O=d.y)}if(C.om(D,L,S,N,b,v,o,r,a,h,l,u,c,d)){let E=(d.x-a)**2+(d.y-h)**2;E<M&&(M=E,A=!0,F=d.x,O=d.y)}return A&&(d.x=F,d.y=O),A}else{if(!C.ku(x,t,o,r,a,h,l,u))return!1;let f=(x-o)*(h-u)-(t-r)*(a-l);if(f===0)return!1;let p=((x*r-t*o)*(a-l)-(x-o)*(a*u-h*l))/f,g=((x*r-t*o)*(h-u)-(t-r)*(a*u-h*l))/f;return d.e(p,g),!0}},rm:(x,t,e,i,s,n,o,r,a,h,l,u,c)=>{let d=0;if(!C.Ve(x,t,o,r,c,e,i)||!C.Ve(x,t,o,r,c,s,n)){let f=(x+e)/2,p=(t+i)/2,g=(e+s)/2,y=(i+n)/2,b=(s+o)/2,v=(n+r)/2,w=(f+g)/2,k=(p+y)/2,S=(g+b)/2,N=(y+v)/2,D=(w+S)/2,L=(k+N)/2;d+=C.rm(x,t,f,p,w,k,D,L,a,h,l,u,c),d+=C.rm(D,L,S,N,b,v,o,r,a,h,l,u,c)}else{let f=(x-o)*(h-u)-(t-r)*(a-l);if(f===0)return d;let p=((x*r-t*o)*(a-l)-(x-o)*(a*u-h*l))/f,g=((x*r-t*o)*(h-u)-(t-r)*(a*u-h*l))/f;if(p>=l)return d;let y=0,b=0;if((a>l?a-l:l-a)<(h>u?h-u:u-h)){if(t<r?(y=t,b=r):(y=r,b=t),g<y||g>b)return d}else if(x<o?(y=x,b=o):(y=o,b=x),p<y||p>b)return d;f>0?d++:f<0&&d--}return d},Nl:(x,t,e,i,s,n,o)=>{if(C.X(x,e)){let r=0,a=0;t<i?(r=t,a=i):(r=i,a=t);let h=n;return h<r?(o.e(x,r),!1):h>a?(o.e(x,a),!1):(o.e(x,h),!0)}else if(C.X(t,i)){let r=0,a=0;x<e?(r=x,a=e):(r=e,a=x);let h=s;return h<r?(o.e(r,t),!1):h>a?(o.e(a,t),!1):(o.e(h,t),!0)}else{let r=(e-x)**2+(i-t)**2,a=((x-s)*(x-e)+(t-n)*(t-i))/r;if(a<-5e-6)return o.e(x,t),!1;if(a>1.000005)return o.e(e,i),!1;{let h=x+a*(e-x),l=t+a*(i-t);return o.e(h,l),!0}}},Do:(x,t,e,i,s,n,o,r,a)=>{if(C.c(x,e)&&C.c(t,i))return a.e(x,t),!1;if(C.X(s,o)){if(C.X(x,e))return C.Nl(x,t,e,i,s,n,a),!1;{let h=(i-t)/(e-x)*(s-x)+t;return C.Nl(x,t,e,i,s,h,a)}}else{let h=(r-n)/(o-s);if(C.X(x,e)){let l=h*(x-s)+n,u=0,c=0;return t<i?(u=t,c=i):(u=i,c=t),l<u?(a.e(x,u),!1):l>c?(a.e(x,c),!1):(a.e(x,l),!0)}else{let l=(i-t)/(e-x);if(C.X(h,l))return C.Nl(x,t,e,i,s,n,a),!1;{let u=(l*x-h*s+n-t)/(l-h);if(C.X(l,0)){let c=0,d=0;return x<e?(c=x,d=e):(c=e,d=x),u<c?(a.e(c,t),!1):u>d?(a.e(d,t),!1):(a.e(u,t),!0)}else{let c=l*(u-x)+t;return C.Nl(x,t,e,i,u,c,a)}}}}},Cl:(x,t,e,i,s,n,o,r,a)=>{let h=1e21,l=x,u=t;if(C.Do(x,t,x,i,s,n,o,r,a)){let c=(a.x-s)**2+(a.y-n)**2;c<h&&(h=c,l=a.x,u=a.y)}if(C.Do(e,t,e,i,s,n,o,r,a)){let c=(a.x-s)**2+(a.y-n)**2;c<h&&(h=c,l=a.x,u=a.y)}if(C.Do(x,t,e,t,s,n,o,r,a)){let c=(a.x-s)**2+(a.y-n)**2;c<h&&(h=c,l=a.x,u=a.y)}if(C.Do(x,i,e,i,s,n,o,r,a)){let c=(a.x-s)**2+(a.y-n)**2;c<h&&(h=c,l=a.x,u=a.y)}return a.e(l,u),h<1e21},lx:(x,t,e)=>C.zL(x.x,x.y,x.width,x.height,t.x,t.y,e.x,e.y),zL:(x,t,e,i,s,n,o,r)=>{let a=x,h=x+e,l=t,u=t+i;if(s===o){let c=0,d=0;return n<r?(c=n,d=r):(c=r,d=n),a<=s&&s<=h&&c<=u&&d>=l}if(n===r){let c=0,d=0;return s<o?(c=s,d=o):(c=o,d=s),l<=n&&n<=u&&c<=h&&d>=a}return!!(I.contains(x,t,e,i,s,n)||I.contains(x,t,e,i,o,r)||C.ku(a,l,h,l,s,n,o,r)||C.ku(h,l,h,u,s,n,o,r)||C.ku(h,u,a,u,s,n,o,r)||C.ku(a,u,a,l,s,n,o,r))},ku:(x,t,e,i,s,n,o,r)=>x===e&&t===i&&s===o&&n===r?x===s&&t===n:C.bu(x,t,e,i,s,n)*C.bu(x,t,e,i,o,r)<=0&&C.bu(s,n,o,r,x,t)*C.bu(s,n,o,r,e,i)<=0,bu:(x,t,e,i,s,n)=>{let o=e-x,r=i-t,a=s-x,h=n-t,l=a*r-h*o;return l===0&&(l=a*o+h*r,l>0&&(a-=o,h-=r,l=a*o+h*r,l<0&&(l=0))),l},_w(x,t,e,i){i===void 0&&(i=!1);let s=0,n=x===null?t:(t-x.x)/(x.width>0?x.width:1),o=x===null?e:(e-x.y)/(x.height>0?x.height:1);return n>o?n>1-o||(i||n<1-o?s=270:s=315):i||n<o?n>1-o?s=90:i||n<1-o?s=180:s=135:n<.5?s=225:n>.5&&(s=45),s},Ee:x=>(x>=360?x-=360:x<0&&(x+=360),x),jF:(x,t)=>x>t?Math.min(x-t,Math.abs(x-360-t)):t>x?Math.min(t-x,Math.abs(x-(t-360))):0,qL:(x,t,e,i,s,n)=>{let o=Math.PI;n||(i=i*(o/180),s=s*(o/180));let r=i>s?-1:1,a=1e-5,h=o*2,l=[],u=o/2,c=i,d=Math.min(h,Math.abs(s-i));if(d<a){let f=c+r*Math.min(d,u),p=x+e*Math.cos(c),g=t+e*Math.sin(c),y=x+e*Math.cos(f),b=t+e*Math.sin(f),v=(p+y)/2,w=(g+b)/2;return l.push([p,g,v,w,v,w,y,b]),l}for(;d>a;){let f=c+r*Math.min(d,u);l.push(C.WF(e,c,f,x,t)),d-=Math.abs(f-c),c=f}return l},WF:(x,t,e,i,s)=>{let n=(e-t)/2,o=x*Math.cos(n),r=x*Math.sin(n),a=o,h=-r,l=a*a+h*h,u=l+a*o+h*r,c=4/3*(Math.sqrt(2*l*u)-u)/(a*r-h*o),d=a-c*h,f=h+c*a,p=d,g=-f,y=n+t,b=Math.cos(y),v=Math.sin(y);return[i+x*Math.cos(t),s+x*Math.sin(t),i+d*b-f*v,s+d*v+f*b,i+p*b-g*v,s+p*v+g*b,i+x*Math.cos(e),s+x*Math.sin(e)]},tm:(x,t,e,i,s,n,o)=>{let r=s,a=n,h=Math.floor((x-e)/r)*r+e,l=Math.floor((t-i)/a)*a+i,u=h;h+r-x<r/2&&(u=h+r);let c=l;return l+a-t<a/2&&(c=l+a),o.e(u,c),o},jL:(x,t)=>{let e=Math.max(x,t),i=Math.min(x,t),s=1,n=1;do s=e%i,n=i,e=i,i=s;while(s>0);return n},JF:(x,t,e,i)=>{let s=e<0,n=i<0,o=0,r=0,a=0;x<t?(r=1,a=0):(r=0,a=1);let h=0,l=0,u=0,c=0;return o=r,h=o===0?x:t,u=o===0?e:i,(o===0?s:n)&&(u=-u),o=a,l=o===0?x:t,c=o===0?e:i,(o===0?s:n)&&(c=-c),C.$F(h,l,u,c,0,0)},$F:(x,t,e,i,s,n)=>{let o=0;if(i>0)if(e>0){let r=x*x,a=t*t,h=x*e,l=t*i,u=-a+l,c=-a+Math.sqrt(h*h+l*l),d=u,f=9999999999;for(let y=0;y<f&&(d=.5*(u+c),!(d===u||d===c));++y){let b=h/(d+r),v=l/(d+a),w=b*b+v*v-1;if(w>0)u=d;else if(w<0)c=d;else break}s=r*e/(d+r),n=a*i/(d+a);let p=s-e,g=n-i;o=Math.sqrt(p*p+g*g)}else s=0,n=t,o=Math.abs(i-t);else{let r=x*x-t*t,a=x*e;if(a<r){let h=a/r,l=h*h;s=x*h,n=t*Math.sqrt(Math.abs(1-l));let u=s-e;o=Math.sqrt(u*u+n*n)}else s=x,n=0,o=Math.abs(e-x)}return o},Wn:{},lm:new yt,pr:new yt,yr:0,am:100};C.za=C.HF;var Ke=(x=>(x[x.Line=1]="Line",x[x.Rectangle=2]="Rectangle",x[x.Ellipse=3]="Ellipse",x[x.Path=4]="Path",x))(Ke||{}),Ri=(x=>(x[x.None=0]="None",x[x.Default=1]="Default",x[x.Fill=2]="Fill",x[x.Uniform=6]="Uniform",x))(Ri||{});class wt{n;hm;cm;kc;Nu;Cu;Jn;$n;Zn;W;Li;Ai;ni;oi;Gs;Pc;Sc;constructor(t,e){V.Je(this),this.n=2,t===void 0&&(t=4),this.W=t,this.Li=0,this.Ai=0,this.ni=0,this.oi=0,t===4?this.Gs=new q:this.Gs=wt.hx,this.hm=this.Gs.rt,this.cm=new I,this.kc=null,this.Nu=null,this.Cu=NaN,this.Jn=T.TopLeft,this.$n=T.BottomRight,this.Pc=NaN,this.Sc=NaN,this.Zn=2,e&&Object.assign(this,e)}copy(){let t=new wt;if(t.n=this.n&-2,t.W=this.W,t.Li=this.Li,t.Ai=this.Ai,t.ni=this.ni,t.oi=this.oi,this.W===4){let e=this.Gs.r,i=t.Gs;for(let s=0;s<e.length;s++){let n=e[s];i.add(n.copy())}t.Gs=i}else t.Gs=this.Gs;return t.hm=this.hm,t.cm.h(this.cm),t.kc=this.kc,t.Nu=this.Nu,t.Cu=this.Cu,t.Jn=this.Jn.N(),t.$n=this.$n.N(),t.Pc=this.Pc,t.Sc=this.Sc,t.Zn=this.Zn,t}static Line=1;static Rectangle=2;static Ellipse=3;static Path=4;static hx=new q().k();get u(){return(this.n&1)!==0}set u(t){t?this.n|=1:this.n&=-2}get yt(){return(this.n&2)!==0}set yt(t){t?this.n|=2:this.n&=-3}k(){if(this.u=!0,this.type!==4)return this;let t=this.figures;t.k();for(let e of t)e.k();return this}equalsApprox(t){if(!(t instanceof wt))return!1;if(this.type!==t.type)return this.type===1&&t.type===4?this.WL(t):t.type===1&&this.type===4?t.WL(this):!1;if(this.type===4){let e=this.figures.r,i=t.figures.r,s=e.length;if(s!==i.length)return!1;for(let n=0;n<s;n++){let o=e[n],r=i[n];if(!o.equalsApprox(r))return!1}return!0}else return C.c(this.startX,t.startX)&&C.c(this.startY,t.startY)&&C.c(this.endX,t.endX)&&C.c(this.endY,t.endY)}WL(t){if(this.type!==1||t.type!==4)return!1;if(t.figures.count===1){let e=t.figures.elt(0);if(e.segments.count===1&&C.c(this.startX,e.startX)&&C.c(this.startY,e.startY)){let i=e.segments.elt(0);if(i.type===2&&C.c(this.endX,i.endX)&&C.c(this.endY,i.endY))return!0}}return!1}static stringify(t){return t.toString()}static stringifyFixed(t){return m.s(t,"number",wt,"stringifyFixed:digits"),e=>e.toString(t)}fe(t){t in Ke?this.type=t:m.ur(this,t)}toString(t){t===void 0&&(t=-1);let e=s=>s===0?"0":s.toFixed(t),i;switch(this.type){case 1:return t<0?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+e(this.startX)+" "+e(this.startY)+"L"+e(this.endX)+" "+e(this.endY);case 2:return i=new I(this.startX,this.startY,0,0),i.union(this.endX,this.endY,0,0),t<0?"M"+i.x.toString()+" "+i.y.toString()+"H"+i.right.toString()+"V"+i.bottom.toString()+"H"+i.left.toString()+"z":"M"+e(i.x)+" "+e(i.y)+"H"+e(i.right)+"V"+e(i.bottom)+"H"+e(i.left)+"z";case 3:if(i=new I(this.startX,this.startY,0,0),i.union(this.endX,this.endY,0,0),t<0){let r=i.left.toString()+" "+(i.y+i.height/2).toString(),a=i.right.toString()+" "+(i.y+i.height/2).toString();return"M"+r+"A"+(i.width/2).toString()+" "+(i.height/2).toString()+" 0 0 1 "+a+"A"+(i.width/2).toString()+" "+(i.height/2).toString()+" 0 0 1 "+r}else{let r=e(i.left)+" "+e(i.y+i.height/2),a=e(i.right)+" "+e(i.y+i.height/2);return"M"+r+"A"+e(i.width/2)+" "+e(i.height/2)+" 0 0 1 "+a+"A"+e(i.width/2)+" "+e(i.height/2)+" 0 0 1 "+r}case 4:let s="",n=this.figures.r,o=n.length;for(let r=0;r<o;r++){let a=n[r];r>0&&(s+=" x "),a.isFilled&&(s+="F "),s+=a.toString(t)}return s;default:return Ke[this.type]}}static fillPath(t){typeof t!="string"&&m.si(t,"string",wt,"fillPath:str");let e=t.split(/[Xx]/),i=e.length,s="";for(let n=0;n<i;n++){let o=e[n];if(o.match(/[Ff]/)!==null){n===0?s+=o:s+="X"+(o[0]===" "?"":" ")+o;continue}s+=(n===0?"":"X ")+"F"+(o[0]===" "?"":" ")+o}return s}static fm="UuBbMmZzLlHhVvCcSsQqTtAaFfXx";static parse(t,e){e===void 0&&(e=!1),typeof t!="string"&&m.si(t,"string",wt,"parse:str");let i=new RegExp("(["+wt.fm+"])(["+wt.fm+"])","gm"),s=new RegExp("(["+wt.fm+"])([^s])","gm"),n=new RegExp("([^s])(["+wt.fm+"])","gm");t=t.replace(/,/gm," "),t=t.replace(i,"$1 $2"),t=t.replace(i,"$1 $2"),t=t.replace(s,"$1 $2"),t=t.replace(n,"$1 $2"),t=t.replace(/([0-9])([+\-])/gm,"$1 $2"),t=t.replace(/[\s\r\t\n]+/gm," "),t=t.replace(/^\s+|\s+$/g,"");let o=t.split(" ");for(let F=0;F<o.length;F++){let O=o[F];if(O.match(/(\.[0-9]*)(\.)/gm)!==null){let E=m.nt(),B="",K=!1;for(let z=0;z<O.length;z++){let U=O[z];U==="."&&!K?(K=!0,B+=U):U==="."?(E.push(B),B="."):B+=U}E.push(B),o.splice(F,1);for(let z=0;z<E.length;z++)o.splice(F+z,0,E[z]);F+=E.length-1,m.Z(E)}}let r=-1,a="",h="",l=new P(0,0),u=new P(0,0),c=new P(0,0),d=!0;function f(){return r>=w-1||o[r+1].match(M)!==null?!0:(d=!1,!1)}function p(){return r++,o[r]}function g(F){let O=parseFloat(p()),E=parseFloat(p());a===a.toLowerCase()&&(O=c.x+O,E=c.y+E),F.e(O,E)}function y(){return g(c),c}function b(){return g(u),u}function v(){let F=h.toLowerCase();return F==="c"||F==="s"||F==="q"||F==="t"?new P(2*c.x-u.x,2*c.y-u.y):new P(c.x,c.y)}let w=o.length,k=Ce.JL(null),S=!1,N=!1,D=!1,L=!0,M=new RegExp("["+wt.fm+"]");for(;!(r>=w-1);){if(h=a,a=p(),a==="")continue;d=!0;let F=!1;switch(a.toUpperCase()){case"X":L=!0,S=!1,N=!1;break;case"M":let O=y();for(k.Ne===null||L===!0?(k.Lu(O.x,O.y,S,!1,!N,D),L=!1):k.ZF(O.x,O.y),l.h(c);!f();){let E=y();k.Ys(E.x,E.y)}break;case"L":for(;!f();){let E=y();k.Ys(E.x,E.y)}d&&(F=!0);break;case"H":for(;!f();)c.e((a===a.toLowerCase()?c.x:0)+parseFloat(p()),c.y),k.Ys(c.x,c.y);break;case"V":for(;!f();)c.e(c.x,(a===a.toLowerCase()?c.y:0)+parseFloat(p())),k.Ys(c.x,c.y);d&&(F=!0);break;case"C":for(;!f();){let E=new P;g(E);let B=b(),K=y();k.wr(E.x,E.y,B.x,B.y,K.x,K.y)}d&&(F=!0);break;case"S":for(;!f();){let E=v(),B=b(),K=y();k.wr(E.x,E.y,B.x,B.y,K.x,K.y)}d&&(F=!0);break;case"Q":for(;!f();){let E=b(),B=y();k.Au(E.x,E.y,B.x,B.y)}d&&(F=!0);break;case"T":for(;!f();){let E=v();u.h(E);let B=y();k.Au(E.x,E.y,B.x,B.y),u.h(B)}d&&(F=!0);break;case"B":for(;!f();){let E=parseFloat(p()),B=parseFloat(p()),K=parseFloat(p()),z=parseFloat(p()),U=parseFloat(p()),tt=U,nt=!1;f()||(tt=parseFloat(p()),f()||(nt=parseFloat(p())!==0)),a===a.toLowerCase()&&(K+=c.x,z+=c.y),k.QF(E,B,K,z,U,tt,nt)}d&&(F=!0);break;case"A":for(;!f();){let E=Math.abs(parseFloat(p())),B=Math.abs(parseFloat(p())),K=parseFloat(p()),z=!1,U=!1,tt=0,nt=0,Z=p();Z.length===1?(z=!!parseFloat(Z),U=!!parseFloat(p()),tt=parseFloat(p()),nt=parseFloat(p())):Z.length===2?(z=!!parseFloat(Z[0]),U=!!parseFloat(Z[1]),tt=parseFloat(p()),nt=parseFloat(p())):(z=!!parseFloat(Z[0]),U=!!parseFloat(Z[1]),tt=parseFloat(Z.slice(2)),nt=parseFloat(p())),a===a.toLowerCase()&&(tt=c.x+tt,nt=c.y+nt),c.e(tt,nt),k._F(E,B,K,z,U,tt,nt)}d&&(F=!0);break;case"Z":k.tR(),c.h(l);break;case"F":{let E="",B=1;for(;o[r+B];){if(o[r+B]==="0"){D=!0,B++;continue}if(o[r+B].match(/[Uu]/)!==null){B++;continue}if(o[r+B].match(M)===null){B++;continue}E=o[r+B];break}E.match(/[Mm]/)?S=!0:k.eR();break}case"U":{let E="",B=1;for(;o[r+B];){if(o[r+B].match(/[Ff]/)!==null){B++;continue}if(o[r+B].match(M)===null){B++;continue}E=o[r+B];break}E.match(/[Mm]/)?N=!0:k.iR(!1);break}default:if(a==="0"||a==="1")break;m.ne("Unknown geometry command: "+a);break}if(F){m.ne(`Bad geometry command: ${a}, next token: ${p()},
|
|
2
|
+
import{a as un}from"./2R7WWRUU.js";import"./N7S3S2JR.js";import{a as ln}from"./6D3THEX6.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import{b as hn}from"./RFGSSUZF.js";import{F as ms,G as ps,H as an,h as on,i as rn}from"./5CQPQ7AE.js";import"./3QPJ2JCA.js";(function(){let X=typeof globalThis=="object"&&globalThis||typeof global=="object"&&global.global===global&&global||typeof self=="object"&&self.self===self&&self||{};X.requestAnimationFrame===void 0&&(X.setImmediate===void 0?X.requestAnimationFrame=x=>X.setTimeout(x,0):X.requestAnimationFrame=X.setImmediate);class m{static fr=X.navigator!==void 0&&X.navigator.platform!==void 0&&X.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null;static CP(t,e,i){let s=-1;return function(){let n=this,o=arguments;s!==-1&&m.yc(s),s=m.un(()=>{s=-1,i||t.apply(n,o)},e),i&&!s&&t.apply(n,o)}}static un(t,e){return X.setTimeout(t,e)}static yc(t){X.clearTimeout(t)}static Ni(t){return X.document.createElement(t)}static o(t){throw new Error(t)}static L(t,e){let i="The object is frozen, so its properties cannot be set: "+t.toString();e!==void 0&&(i+=" to value: "+e),m.o(i)}static se(t,e,i,s){}static s(t,e,i,s){}static CU(t,e,i){}static wc(t,e,i){if(t===null||typeof t!="object"){let s=m.TL(e);i!==void 0&&(s+="."+i),m.si(t,"object",s)}}static S(t,e,i){m.s(t,"function",e,i)}static LU(t,e,i){}static si(t,e,i,s){}static J(t,e,i,s){let n=m.TL(i);s!==void 0&&(n+="."+s),m.o(n+" is not in the range "+e+": "+t)}static Xi(t){}static ur(t,e){}static ne(t){X.console&&X.console.log(t)}static $(t){return t!==null&&typeof t=="object"}static st(t){return typeof t=="function"}static LP=[];static nt(){let t=m.LP.pop();return t===void 0?[]:t}static Z(t){t.length=0,m.LP.push(t)}static AU=Object.freeze([]);static TL(t){return t===null?"*":typeof t=="string"?t:m.st(t)?t.name:""}static Kn(t){return m.st(t)?t.className?t.className:t.name:m.$(t)&&t.constructor?m.Kn(t.constructor):typeof t}static $a(t,e){return e==null||e===""?null:m.$(t)&&e in t||t[e]?t[e]:null}static toString(t){let e=t;return m.$(t)&&(t.text?e=t.text:t.name?e=t.name:t.key!==void 0?e=t.key:t.id!==void 0?e=t.id:t.constructor===Object&&(t.Text?e=t.Text:t.Name?e=t.Name:t.Key!==void 0?e=t.Key:t.Id!==void 0?e=t.Id:t.ID!==void 0&&(e=t.ID))),e===void 0?"undefined":e===null?"null":e.toString()}static qw(t,e){if(t.hasOwnProperty(e))return!0;let i=Object.getPrototypeOf(t);for(;i&&i!==Function;){if(i.hasOwnProperty(e))return!0;let s=i.TU;if(s&&s[e])return!0;i=Object.getPrototypeOf(i)}return!1}static XF(t){let e=[],i=0;for(i=0;i<256;i++)e[i]=i;let s=0,n=0;for(i=0;i<256;i++)s=(s+e[i]+119)%256,n=e[i],e[i]=e[s],e[s]=n;i=0,s=0;let o="";for(let r=0;r<t.length;r++)i=(i+1)%256,s=(s+e[i])%256,n=e[i],e[i]=e[s],e[s]=n,o+=String.fromCharCode(t.charCodeAt(r)^e[(e[i]+e[s])%256]);return o}static GF(t){let e="0123456789abcdef",i=[];for(let r=0;r<256;r++)i[e.charAt(r>>4)+e.charAt(r&15)]=String.fromCharCode(r);t.length%2&&(t="0"+t);let s=[],n=0;for(let r=0;r<t.length;r+=2)s[n++]=i[t.substring(r,r+2)];let o=s.join("");return o===""?"0":o}static We(t){return m.XF(m.GF(t))}static color1="@COLOR1";static color2="@COLOR2";static jw="32ab5ff3b26f42dc0ed90f21422913b5"}m.vfo="29e647fdb6";class rt{AP;constructor(){this.AP=[]}toString(){return this.AP.join("")}add(t){t!==""&&this.AP.push(t)}}class bt{}class Pt{g;constructor(){this.g=[]}[Symbol.iterator](){return this.g.values()}key;value;get iterator(){return this}reset(){}next(){return!1}hasNext(){return!1}first(){return null}any(){return!1}all(){return!0}each(){return this}map(t){return this}filter(){return this}get count(){return 0}Ml(){}toString(){return"EmptyIterator"}static instance=new Pt}class dt{constructor(t){this.key=-1,this.value=t}[Symbol.iterator](){return[this.value].values()}key;value;get iterator(){return this}reset(){this.key=-1}next(){return this.key===-1?(this.key=0,!0):!1}hasNext(){return this.next()}first(){return this.key=0,this.value}any(t){return this.key=-1,t(this.value)}all(t){return this.key=-1,t(this.value)}each(t){return this.key=-1,t(this.value),this}map(t){return new dt(t(this.value))}filter(t){return t(this.value)?new dt(this.value):Pt.instance}get count(){return 1}Ml(){this.value=null}toString(){return"SingletonIterator("+this.value+")"}}class gt{qt;zs;Gt;Tt;constructor(t){this.qt=t,this.zs=null,t.dr=null,this.Gt=t.rt,this.Tt=-1}[Symbol.iterator](){return this.zs===null?this.qt.r.values():this.qt.r.filter(this.zs).values()}key;value;get iterator(){return this}get predicate(){return this.zs}set predicate(t){this.zs=t}reset(){let t=this.qt;t.dr=null,this.Gt=t.rt,this.Tt=-1}next(){let t=this.qt;if(t.rt!==this.Gt){if(this.key<0)return!1;m.Xi(t)}let e=t.r,i=e.length,s=++this.Tt,n=this.zs;if(n!==null)for(;s<i;){let o=e[s];if(n(o))return this.Tt=s,this.key=s,this.value=o,!0;s++}else{if(s<i)return this.key=s,this.value=e[s],!0;this.Ml()}return!1}hasNext(){return this.next()}first(){let t=this.qt;this.Gt=t.rt,this.Tt=0;let e=t.r,i=e.length,s=this.zs;if(s!==null){let n=0;for(;n<i;){let o=e[n];if(s(o))return this.Tt=n,this.key=n,this.value=o,o;n++}return null}else if(i>0){let n=e[0];return this.key=0,this.value=n,n}else return null}any(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=e.r,n=s.length,o=this.zs;for(let r=0;r<n;r++){let a=s[r];if(!(o!==null&&!o(a))){if(t(a))return!0;e.rt!==i&&m.Xi(e)}}return!1}all(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=e.r,n=s.length,o=this.zs;for(let r=0;r<n;r++){let a=s[r];if(!(o!==null&&!o(a))){if(!t(a))return!1;e.rt!==i&&m.Xi(e)}}return!0}each(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=e.r,n=s.length,o=this.zs;for(let r=0;r<n;r++){let a=s[r];o!==null&&!o(a)||(t(a),e.rt!==i&&m.Xi(e))}return this}map(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=[],n=e.r,o=n.length,r=this.zs;for(let h=0;h<o;h++){let l=n[h];r!==null&&!r(l)||(s.push(t(l)),e.rt!==i&&m.Xi(e))}let a=new q;return a.r=s,a.Gi(),a.iterator}filter(t){let e=this.qt;e.dr=null;let i=e.rt;this.Tt=-1;let s=[],n=e.r,o=n.length,r=this.zs;for(let h=0;h<o;h++){let l=n[h];r!==null&&!r(l)||(t(l)&&s.push(l),e.rt!==i&&m.Xi(e))}let a=new q;return a.r=s,a.Gi(),a.iterator}get count(){let t=this.zs;if(t!==null){let e=0,i=this.qt.r,s=i.length;for(let n=0;n<s;n++)t(i[n])&&e++;return e}else return this.qt.r.length}Ml(){this.key=-1,this.value=null,this.Gt=-1,this.zs=null,this.qt.dr=this}toString(){return"ListIterator@"+this.Tt+"/"+this.qt.count}}class kt{qt;Gt;Tt;constructor(t){this.qt=t,t.gr=null,this.Gt=t.rt,this.Tt=t.r.length}[Symbol.iterator](){return this.qt.r.reverse().values()}key;value;get iterator(){return this}reset(){let t=this.qt;t.gr=null,this.Gt=t.rt,this.Tt=t.r.length}next(){let t=this.qt;if(t.rt!==this.Gt){if(this.key<0)return!1;m.Xi(t)}let e=--this.Tt;return e>=0?(this.key=e,this.value=t.r[e],!0):(this.Ml(),!1)}hasNext(){return this.next()}first(){let t=this.qt;this.Gt=t.rt;let e=t.r,i=e.length-1;if(this.Tt=i,i>=0){let s=e[i];return this.key=i,this.value=s,s}else return null}any(t){let e=this.qt;e.gr=null;let i=e.rt,s=e.r,n=s.length;this.Tt=n;for(let o=n-1;o>=0;o--){let r=s[o];if(t(r))return!0;e.rt!==i&&m.Xi(e)}return!1}all(t){let e=this.qt;e.gr=null;let i=e.rt,s=e.r,n=s.length;this.Tt=n;for(let o=n-1;o>=0;o--){let r=s[o];if(!t(r))return!1;e.rt!==i&&m.Xi(e)}return!0}each(t){let e=this.qt;e.gr=null;let i=e.rt,s=e.r,n=s.length;this.Tt=n;for(let o=n-1;o>=0;o--){let r=s[o];t(r),e.rt!==i&&m.Xi(e)}return this}map(t){let e=this.qt;e.gr=null;let i=e.rt,s=[],n=e.r,o=n.length;this.Tt=o;for(let a=o-1;a>=0;a--){let h=n[a];s.push(t(h)),e.rt!==i&&m.Xi(e)}let r=new q;return r.r=s,r.Gi(),r.iterator}filter(t){let e=this.qt;e.gr=null;let i=e.rt,s=[],n=e.r,o=n.length;this.Tt=o;for(let a=o-1;a>=0;a--){let h=n[a];t(h)&&s.push(h),e.rt!==i&&m.Xi(e)}let r=new q;return r.r=s,r.Gi(),r.iterator}get count(){return this.qt.r.length}Ml(){this.key=-1,this.value=null,this.Gt=-1,this.qt.gr=this}toString(){return"ListIteratorBackwards("+this.Tt+"/"+this.qt.count+")"}}class q{u;r;rt;dr;gr;constructor(t){V.Je(this),this.u=!1,this.r=[],this.rt=0,this.dr=null,this.gr=null,t!==void 0&&this.addAll(t)}[Symbol.iterator](){return this.r.values()}Gi(){let t=this.rt;t++,t>999999999&&(t=0),this.rt=t}k(){return this.u=!0,this}ce(){return this.u=!1,this}toString(){return"List()#"+V.xs(this)}add(t){return this.u&&m.L(this,t),this.r.push(t),this.Gi(),this}push(t){this.add(t)}addAll(t){if(t===null)return this;this.u&&m.L(this);let e=this.r;if(t.first){let i=t.iterator;for(;i.next();)e.push(i.value)}else for(let i of t)e.push(i);return this.Gi(),this}clear(){this.u&&m.L(this),this.r.length=0,this.Gi()}contains(t){return this.has(t)}has(t){return t===null?!1:this.r.indexOf(t)!==-1}indexOf(t){return t===null?-1:this.r.indexOf(t)}elt(t){let e=this.r;return(t<0||t>=e.length)&&m.J(t,"0 <= i < length",q,"elt:i"),e[t]}get(t){return this.elt(t)}setElt(t,e){let i=this.r;(t<0||t>=i.length)&&m.J(t,"0 <= i < length",q,"setElt:i"),this.u&&m.L(this,t),i[t]=e}set(t,e){this.setElt(t,e)}first(){let t=this.r;return t.length===0?null:t[0]}last(){let t=this.r,e=t.length;return e>0?t[e-1]:null}pop(){this.u&&m.L(this);let t=this.r;if(t.length>0){let e=t.pop();return e===void 0?null:e}return null}any(t){let e=this.r,i=this.rt,s=e.length;for(let n=0;n<s;n++){if(t(e[n]))return!0;this.rt!==i&&m.Xi(this)}return!1}all(t){let e=this.r,i=this.rt,s=e.length;for(let n=0;n<s;n++){if(!t(e[n]))return!1;this.rt!==i&&m.Xi(this)}return!0}each(t){let e=this.r,i=this.rt,s=e.length;for(let n=0;n<s;n++)t(e[n]),this.rt!==i&&m.Xi(this);return this}map(t){let e=new q,i=[],s=this.r,n=this.rt,o=s.length;for(let r=0;r<o;r++)i.push(t(s[r])),this.rt!==n&&m.Xi(this);return e.r=i,e.Gi(),e}filter(t){let e=new q,i=[],s=this.r,n=this.rt,o=s.length;for(let r=0;r<o;r++){let a=s[r];t(a)&&i.push(a),this.rt!==n&&m.Xi(this)}return e.r=i,e.Gi(),e}insertAt(t,e){t<0&&m.J(t,">= 0",q,"insertAt:i"),this.u&&m.L(this,t);let i=this.r;t>=i.length?i.push(e):i.splice(t,0,e),this.Gi()}remove(t){return this.delete(t)}delete(t){if(t===null)return!1;this.u&&m.L(this,t);let e=this.r,i=e.indexOf(t);return i===-1?!1:(i===e.length-1?e.pop():e.splice(i,1),this.Gi(),!0)}removeAt(t){let e=this.r;(t<0||t>=e.length)&&m.J(t,"0 <= i < length",q,"removeAt:i"),this.u&&m.L(this,t),t===e.length-1?e.pop():e.splice(t,1),this.Gi()}removeRange(t,e){let i=this.r,s=i.length;if(t<0)t=0;else if(t>=s)return this;if(e<0)return this;if(e>=s&&(e=s-1),t>e)return this;this.u&&m.L(this);let n=t,o=e+1;for(;o<s;)i[n++]=i[o++];return i.length=s-(e-t+1),this.Gi(),this}copy(){let t=new q,e=this.r;return e.length>0&&(t.r=Array.prototype.slice.call(e)),t}toArray(){let t=this.r,e=this.count,i=new Array(e);for(let s=0;s<e;s++)i[s]=t[s];return i}get DL(){return this.r}toSet(){let t=new V,e=this.r,i=this.count;for(let s=0;s<i;s++)t.add(e[s]);return t}sort(t){return this.u&&m.L(this),this.r.sort(t),this.Gi(),this}sortRange(t,e,i){let s=this.r,n=s.length;e===void 0&&(e=0),i===void 0&&(i=n),this.u&&m.L(this);let o=i-e;if(o<=1)return this;if((e<0||e>=n-1)&&m.J(e,"0 <= from < length",q,"sortRange:from"),o===2){let r=s[e],a=s[e+1];return t(r,a)>0&&(s[e]=a,s[e+1]=r,this.Gi()),this}if(e===0)if(i>=n)s.sort(t);else{let r=s.slice(0,i);r.sort(t);for(let a=0;a<i;a++)s[a]=r[a]}else if(i>=n){let r=s.slice(e);r.sort(t);for(let a=e;a<n;a++)s[a]=r[a-e]}else{let r=s.slice(e,i);r.sort(t);for(let a=e;a<i;a++)s[a]=r[a-e]}return this.Gi(),this}reverse(){return this.u&&m.L(this),this.r.reverse(),this.Gi(),this}get count(){return this.r.length}get size(){return this.r.length}get length(){return this.r.length}get iterator(){if(this.r.length<=0)return Pt.instance;let t=this.dr;return t!==null?(t.reset(),t):new gt(this)}get iteratorBackwards(){if(this.r.length<=0)return Pt.instance;let t=this.gr;return t!==null?(t.reset(),t):new kt(this)}}class Zt{To;oe;constructor(t){this.To=t,this.oe=t.g.values()}[Symbol.iterator](){return this.To.g.values()}key;value;get iterator(){return this}reset(){let t=this.To;this.oe=t.g.values()}next(){let t=this.oe.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return this.To.g.size===0?null:(this.oe=this.To.g.values(),this.oe.next().value)}any(t){return this.To.any(t)}all(t){return this.To.all(t)}each(t){return this.To.each(t),this}map(t){let e=new q;return this.To.g.forEach(i=>e.add(t(i))),e.iterator}filter(t){let e=new q;return this.To.g.forEach(i=>{t(i)&&e.add(i)}),e.iterator}get count(){return this.To.count}Ml(){this.key=null,this.value=null,this.oe=null}toString(){return"SetIterator"}}class V{u;g;constructor(t){this.u=!1,this.g=new Set,t!==void 0&&this.addAll(t)}[Symbol.iterator](){return this.g.values()}values(){return this.g.values()}k(){return this.u=!0,this}ce(){return this.u=!1,this}toString(){return"Set()#"+V.xs(this)}add(t){return t===null?this:(this.g.add(t),this)}addAll(t){if(t===null)return this;if(this.u&&m.L(this),t.first){let e=t.iterator;for(;e.next();)this.g.add(e.value)}else for(let e of t)this.g.add(e);return this}has(t){return this.g.has(t)}contains(t){return this.has(t)}containsAll(t){if(t===null)return!0;if(t.first){let e=t.iterator;for(;e.next();)if(!this.has(e.value))return!1}else for(let e of t)if(!this.has(e))return!1;return!0}containsAny(t){if(t===null)return!0;if(t.first){let e=t.iterator;for(;e.next();)if(this.has(e.value))return!0}else for(let e of t)if(this.has(e))return!0;return!1}first(){return this.g.size===0?null:this.g.values().next().value}any(t){for(let e of this.g)if(t(e))return!0;return!1}all(t){for(let e of this.g)if(!t(e))return!1;return!0}each(t){for(let e of this.g)t(e);return this}map(t){let e=new V;for(let i of this.g)e.add(t(i));return e}filter(t){let e=new V;for(let i of this.g)t(i)&&e.add(i);return e}delete(t){return this.u&&m.L(this),this.g.delete(t)}remove(t){return this.delete(t)}removeAll(t){if(t===null)return this;if(this.u&&m.L(this),t.first){let e=t.iterator;for(;e.next();)this.delete(e.value)}else for(let e of t)this.delete(e);return this}retainAll(t){if(t===null)return this;if(this.count===0)return this;this.u&&m.L(this);let e=new V;e.addAll(t);let i=[];if(t.first){let s=t.iterator;for(;s.next();){let n=s.value;e.has(n)||i.push(n)}}else for(let s of t)e.has(s)||i.push(s);return this.removeAll(i),this}clear(){this.u&&m.L(this),this.g.clear()}copy(){let t=new V;return this.g.forEach(e=>t.add(e)),t}toArray(){return Array.from(this.g)}toList(){let t=new q;return this.g.forEach(e=>t.add(e)),t}get count(){return this.g.size}get size(){return this.g.size}get iterator(){return this.g.size<=0?Pt.instance:new Zt(this)}entries(){return this.g.entries()}keys(){return this.g.keys()}forEach(t,e){return this.g.forEach(t,e)}static Ww=1;static Je(t){t.__gohashid=V.Ww++}static xs(t){return t.__gohashid}}class We{j;oe;constructor(t){this.j=t,this.oe=t.g.keys()}[Symbol.iterator](){return this.j.g.keys()}key;value;get iterator(){return this}reset(){let t=this.j;this.oe=t.g.keys()}next(){let t=this.oe.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return this.j.g.size===0?null:(this.oe=this.j.g.keys(),this.oe.next().value)}any(t){for(let e of this.j.g)if(t(e[0]))return!0;return!1}all(t){for(let e of this.j.g)if(!t(e[0]))return!1;return!0}each(t){for(let e of this.j.g)t(e[0]);return this}map(t){let e=this.j,i=new q;for(let s of e.g)i.add(t(s[0]));return i.iterator}filter(t){let e=this.j,i=new q;for(let s of e.g){let n=s[0];t(n)&&i.add(n)}return i.iterator}get count(){return this.j.size}Ml(){this.key=null,this.value=null,this.oe=null}toString(){return"MapKeySetIterator"}}class Oi extends V{j;constructor(t){super(),V.Je(this),this.u=!0,this.j=t}[Symbol.iterator](){return this.g.keys()}values(){return this.g.keys()}k(){return this}ce(){return this}toString(){return"MapKeySet("+this.j.toString()+")"}add(t){m.o("This Set is read-only: "+this.toString())}has(t){return this.j.has(t)}contains(t){return this.has(t)}delete(t){m.o("This Set is read-only: "+this.toString())}remove(t){return this.delete(t)}clear(){m.o("This Set is read-only: "+this.toString())}first(){return this.j.g.size===0?null:this.j.g.keys().next().value}any(t){for(let e of this.j.g)if(t(e[0]))return!0;return!1}all(t){for(let e of this.j.g)if(!t(e[0]))return!1;return!0}each(t){for(let e of this.j.g)t(e[0]);return this}map(t){let e=new V;for(let i of this.j.g)e.add(t(i[0]));return e}filter(t){let e=new V;for(let i of this.j.g){let s=i[0];t(s)&&e.add(s)}return e}copy(){return new Oi(this.j)}toSet(){let t=new V,e=this.j.g;for(let i of e)t.add(i[0]);return t}toArray(){let t=this.j.g,e=new Array(t.size),i=0;for(let s of t)e[i]=s[0],i++;return e}toList(){let t=new q,e=this.j.g;for(let i of e)t.add(i[0]);return t}get count(){return this.j.size}get size(){return this.j.size}get iterator(){return this.j.size<=0?Pt.instance:new We(this.j)}}class Tn{j;oe;constructor(t){this.j=t,this.oe=t.g.values()}[Symbol.iterator](){return this.j.g.values()}key;value;get iterator(){return this}reset(){let t=this.j;this.oe=t.g.values()}next(){let t=this.oe.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return this.j.g.size===0?null:(this.oe=this.j.g.values(),this.oe.next().value)}any(t){for(let e of this.j.g)if(t(e[1]))return!0;return!1}all(t){for(let e of this.j.g)if(!t(e[1]))return!1;return!0}each(t){for(let e of this.j.g)t(e[1]);return this}map(t){let e=this.j,i=new q;for(let s of e.g)i.add(t(s[1]));return i.iterator}filter(t){let e=this.j,i=new q;for(let s of e.g){let n=s[1];t(n)&&i.add(n)}return i.iterator}get count(){return this.j.size}Ml(){this.key=null,this.value=null,this.oe=null}toString(){return"MapValueSetIterator"}}class pe{constructor(t,e){this.key=t,this.value=e}toString(){return"{"+this.key+":"+this.value+"}"}key;value}class Ln{j;oe;constructor(t){this.j=t,this.oe=t.g.entries()}[Symbol.iterator](){return this.j.g.entries()}key;value;get iterator(){return this}reset(){let t=this.j;this.oe=t.g.entries()}next(){let t=this.oe.next();return t.done?(this.key=null,this.value=null,!1):(this.key=t.value[0],this.value=t.value[1],!0)}hasNext(){return this.next()}first(){if(this.j.g.size===0)return null;this.oe=this.j.g.entries();let t=this.oe.next().value;return this.key=t[0],this.value=t[1],new pe(t[0],t[1])}any(t){return this.j.any(t)}all(t){return this.j.all(t)}each(t){return this.j.each(t),this}map(t){let e=new q,i=null;return this.j.g.forEach((s,n)=>{i===null?i=new pe(n,s):(i.key=n,i.value=s),e.add(t(i))}),e.iterator}filter(t){let e=new q,i=null;return this.j.g.forEach((s,n)=>{i===null?i=new pe(n,s):(i.key=n,i.value=s),t(i)&&(e.add(i),i=null)}),e.iterator}get count(){return this.j.size}Ml(){this.key=null,this.value=null,this.oe=null}toString(){return"MapIterator"}}class Mt{u;g;constructor(t){V.Je(this),this.u=!1,this.g=new Map,t!==void 0&&this.addAll(t)}[Symbol.iterator](){return this.g.entries()}entries(){return this.g.entries()}k(){return this.u=!0,this}ce(){return this.u=!1,this}toString(){return"Map()#"+V.xs(this)}set(t,e){return this.u&&m.L(this,t),this.g.set(t,e),this}add(t,e){return this.set(t,e)}addAll(t){if(t===null)return this;if(this.u&&m.L(this),t instanceof Mt){let e=t.iterator;for(;e.next();)this.g.set(e.key,e.value)}else if(t.first){let e=t.iterator;for(;e.next();){let i=e.value;this.g.set(i.key,i.value)}}else for(let e of t){let i=e;Array.isArray(i)?this.g.set(i[0],i[1]):this.g.set(i.key,i.value)}return this}first(){if(this.g.size===0)return null;let t=this.g.entries().next().value;return t?new pe(t[0],t[1]):null}any(t){let e=null;for(let[i,s]of this.g)if(e===null?e=new pe(i,s):(e.key=i,e.value=s),t(e))return!0;return!1}all(t){let e=null;for(let[i,s]of this.g)if(e===null?e=new pe(i,s):(e.key=i,e.value=s),!t(e))return!1;return!0}each(t){let e=null;for(let[i,s]of this.g)e===null?e=new pe(i,s):(e.key=i,e.value=s),t(e);return this}map(t){let e=new Mt,i=null;for(let[s,n]of this.g)i===null?i=new pe(s,n):(i.key=s,i.value=n),e.set(s,t(i));return e}filter(t){let e=new Mt,i=null;for(let[s,n]of this.g)i===null?i=new pe(s,n):(i.key=s,i.value=n),t(i)&&e.set(s,n);return e}has(t){return this.g.has(t)}contains(t){return this.has(t)}get(t){let e=this.g.get(t);return e===void 0?null:e}getValue(t){return this.get(t)}delete(t){return t===null?!1:(this.u&&m.L(this,t),this.g.delete(t))}remove(t){return this.delete(t)}clear(){this.u&&m.L(this),this.g.clear()}copy(){let t=new Mt;return t.g=new Map(this.g),t}toArray(){let t=this.g,e=new Array(t.size),i=0;for(let s of t)e[i]=new pe(s[0],s[1]),i++;return e}toKeySet(){return new Oi(this)}get count(){return this.g.size}get size(){return this.g.size}get iterator(){return this.g.size<=0?Pt.instance:new Ln(this)}get iteratorKeys(){return this.count<=0?Pt.instance:new We(this)}keys(){return this.g.keys()}get iteratorValues(){return this.count<=0?Pt.instance:new Tn(this)}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}}class P{px;py;u;constructor(t,e){t===void 0?(this.px=0,this.py=0):typeof t=="number"&&typeof e=="number"?(this.px=t,this.py=e):m.o("Invalid arguments to Point constructor: "+t+", "+e),this.u=!1}h(t){return this.px=t.px,this.py=t.py,this}e(t,e){return this.px=t,this.py=e,this}setTo(t,e){return this.px=t,this.py=e,this}set(t){return this.px=t.px,this.py=t.py,this}copy(){let t=new P;return t.px=this.px,t.py=this.py,t}kt(){return this.u=!0,Object.freeze(this),this}N(){return this.u||Object.isFrozen(this)?this:this.copy().k()}k(){return this.u||(this.u=!0),this}Jw(t){}static parse(t){if(typeof t=="string"){let e=t.split(" "),i=0,s=0;for(;e[i]==="";)i++;let n=e[i++];n&&(s=parseFloat(n));let o=0;for(;e[i]==="";)i++;return n=e[i++],n&&(o=parseFloat(n)),new P(s,o)}else return new P}static stringify(t){return t.x.toString()+" "+t.y.toString()}static stringifyFixed(t){return m.s(t,"number",P,"stringifyFixed:digits"),e=>e.x.toFixed(t)+" "+e.y.toFixed(t)}toString(){return"Point("+this.x+","+this.y+")"}equals(t){return t instanceof P?this.px===t.x&&this.py===t.y:!1}equalTo(t,e){return this.px===t&&this.py===e}equalsApprox(t){return C.c(this.px,t.x)&&C.c(this.py,t.y)}add(t){return this.px+=t.x,this.py+=t.y,this}subtract(t){return this.px-=t.x,this.py-=t.y,this}offset(t,e){return this.px+=t,this.py+=e,this}rotate(t){if(t===0)return this;let e=this.px,i=this.py;if(e===0&&i===0)return this;let s=0,n=0;if(t=C.Ee(t),t===90)s=0,n=1;else if(t===180)s=-1,n=0;else if(t===270)s=0,n=-1;else{let o=t*Math.PI/180;s=Math.cos(o),n=Math.sin(o)}return this.px=s*e-n*i,this.py=n*e+s*i,this}scale(t,e){return this.px*=t,this.py*=e,this}distanceSquaredPoint(t){let e=t.x-this.px,i=t.y-this.py;return e*e+i*i}distanceSquared(t,e){let i=t-this.px,s=e-this.py;return i*i+s*s}normalize(){let t=this.px,e=this.py,i=Math.sqrt(t*t+e*e);return i>0&&(this.px=t/i,this.py=e/i),this}directionPoint(t){return this.vL(t.x-this.px,t.y-this.py)}direction(t,e){return this.vL(t-this.px,e-this.py)}vL(t,e){if(t===0)return e>0?90:e<0?270:0;if(e===0)return t>0?0:180;{if(isNaN(t)||isNaN(e))return 0;let i=Math.atan(Math.abs(e/t))*180/Math.PI;return t<0?e<0?i+=180:i=180-i:e<0&&(i=360-i),i}}static compareWithLineSegment(t,e,i,s,n,o){return C.bu(t,e,i,s,n,o)}compareWithLineSegmentPoint(t,e){return C.bu(t.x,t.y,e.x,e.y,this.x,this.y)}static intersectingLineSegments(t,e,i,s,n,o,r,a){return C.ku(t,e,i,s,n,o,r,a)}projectOntoLineSegment(t,e,i,s){return C.Nl(t,e,i,s,this.px,this.py,this),this}projectOntoLineSegmentPoint(t,e){return C.Nl(t.x,t.y,e.x,e.y,this.px,this.py,this),this}snapToGrid(t,e,i,s){return C.tm(this.px,this.py,t,e,i,s,this),this}snapToGridPoint(t,e){return C.tm(this.px,this.py,t.x,t.y,e.width,e.height,this),this}setRectSpot(t,e){return this.px=t.x+e.x*t.width+e.offsetX,this.py=t.y+e.y*t.height+e.offsetY,this}setSpot(t,e,i,s,n){return this.px=t+n.x*i+n.offsetX,this.py=e+n.y*s+n.offsetY,this}v(t){return t.gt(this),this}Yi(t){return t.Ci(this),this}static distanceLineSegmentSquared(t,e,i,s,n,o){let r=n-i,a=o-s,h=r*r+a*a,l=i-t,u=s-e,c=-l*r-u*a;if(c<=0||c>=h)return r=n-t,a=o-e,Math.min(l*l+u*u,r*r+a*a);{let d=r*u-a*l;return d*d/h}}static distanceSquared(t,e,i,s){let n=i-t,o=s-e;return n*n+o*o}static direction(t,e,i,s){let n=i-t,o=s-e;if(n===0)return o>0?90:o<0?270:0;if(o===0)return n>0?0:180;{if(isNaN(n)||isNaN(o))return 0;let r=Math.atan(Math.abs(o/n))*180/Math.PI;return n<0?o<0?r+=180:r=180-r:o<0&&(r=360-r),r}}get x(){return this.px}set x(t){this.px=t}get y(){return this.py}set y(t){this.py=t}isReal(){return isFinite(this.x)&&isFinite(this.y)}static dn=new P(0,0).kt();static FL=new P(-1/0,-1/0).kt();static RL=new P(1/0,1/0).kt();static OL=new P(6,6).kt();static gn=new P(NaN,NaN).kt();static $w=[];static l(){let t=P.$w.pop();return t===void 0?new P:t}static bs(t){let e=P.$w.pop();return e===void 0?t.copy():e.h(t)}static z(t,e){let i=P.$w.pop();return i===void 0?new P(t,e):(i.x=t,i.y=e,i)}static i(t){P.$w.push(t)}}class st{sw;sh;u;constructor(t,e){t===void 0?(this.sw=0,this.sh=0):typeof t=="number"&&(t>=0||isNaN(t))&&typeof e=="number"&&(e>=0||isNaN(e))?(this.sw=t,this.sh=e):m.o("Invalid arguments to Size constructor: "+t+", "+e),this.u=!1}h(t){return this.sw=t.sw,this.sh=t.sh,this}e(t,e){return this.sw=t,this.sh=e,this}setTo(t,e){return this.sw=t,this.sh=e,this}set(t){return this.sw=t.sw,this.sh=t.sh,this}copy(){let t=new st;return t.sw=this.sw,t.sh=this.sh,t}kt(){return this.u=!0,Object.freeze(this),this}N(){return this.u||Object.isFrozen(this)?this:this.copy().k()}k(){return this.u||(this.u=!0),this}Jw(t){}static parse(t){if(typeof t=="string"){let e=t.split(" "),i=0,s=0;for(;e[i]==="";)i++;let n=e[i++];n&&(s=parseFloat(n));let o=0;for(;e[i]==="";)i++;return n=e[i++],n&&(o=parseFloat(n)),new st(s,o)}else return new st}static stringify(t){return t.width.toString()+" "+t.height.toString()}static stringifyFixed(t){return m.s(t,"number",st,"stringifyFixed:digits"),e=>e.width.toFixed(t)+" "+e.height.toFixed(t)}toString(){return"Size("+this.width+","+this.height+")"}equals(t){return t instanceof st?this.sw===t.width&&this.sh===t.height:!1}equalTo(t,e){return this.sw===t&&this.sh===e}equalsApprox(t){return C.c(this.sw,t.width)&&C.c(this.sh,t.height)}inflate(t,e){let i=this.width+t;this.sw=i>=0?i:0;let s=this.height+e;return this.sh=s>=0?s:0,this}get width(){return this.sw}set width(t){t<0&&m.J(t,">= 0",st,"width"),this.sw=t}get height(){return this.sh}set height(t){t<0&&m.J(t,">= 0",st,"height"),this.sh=t}isReal(){return isFinite(this.width)&&isFinite(this.height)}static xc=new st(0,0).kt();static TP=new st(1,1).kt();static IL=new st(6,6).kt();static Pu=new st(8,8).kt();static EL=new st(10,10).kt();static DP=new st(1/0,1/0).kt();static Zw=new st(NaN,NaN).kt();static UL=[];static l(){let t=st.UL.pop();return t===void 0?new st:t}static i(t){st.UL.push(t)}}class I{rx;ry;rw;rh;u;constructor(t,e,i,s){if(t===void 0)this.rx=0,this.ry=0,this.rw=0,this.rh=0;else if(typeof t=="number"&&typeof e=="number"&&typeof i=="number"&&(i>=0||isNaN(i))&&typeof s=="number"&&(s>=0||isNaN(s)))this.rx=t,this.ry=e,this.rw=i,this.rh=s;else if(t instanceof P){let n=t.x,o=t.y;if(e instanceof P){let r=e.x,a=e.y;this.rx=Math.min(n,r),this.ry=Math.min(o,a),this.rw=Math.abs(n-r),this.rh=Math.abs(o-a)}else e instanceof st?(this.rx=n,this.ry=o,this.rw=e.width,this.rh=e.height):m.o("Incorrect second argument supplied to Rect constructor "+e)}else m.o("Invalid arguments to Rect constructor: "+t+", "+e+", "+i+", "+s);this.u=!1}h(t){return this.rx=t.rx,this.ry=t.ry,this.rw=t.rw,this.rh=t.rh,this}e(t,e,i,s){return this.rx=t,this.ry=e,this.rw=i,this.rh=s,this}Hn(t,e){return this.rw=t,this.rh=e,this}setTo(t,e,i,s){return this.rx=t,this.ry=e,this.rw=i,this.rh=s,this}set(t){return this.rx=t.rx,this.ry=t.ry,this.rw=t.rw,this.rh=t.rh,this}setPoint(t){return this.rx=t.x,this.ry=t.y,this}setSize(t){return this.rw=t.width,this.rh=t.height,this}copy(){let t=new I;return t.rx=this.rx,t.ry=this.ry,t.rw=this.rw,t.rh=this.rh,t}kt(){return this.u=!0,Object.freeze(this),this}N(){return this.u||Object.isFrozen(this)?this:this.copy().k()}k(){return this.u||(this.u=!0),this}ce(){return this.u&&(Object.isFrozen(this)&&m.o("cannot thaw constant: "+this),this.u=!1),this}Jw(t){}static parse(t){if(typeof t=="string"){let e=t.split(" "),i=0,s=0;for(;e[i]==="";)i++;let n=e[i++];n&&(s=parseFloat(n));let o=0;for(;e[i]==="";)i++;n=e[i++],n&&(o=parseFloat(n));let r=0;for(;e[i]==="";)i++;n=e[i++],n&&(r=parseFloat(n));let a=0;for(;e[i]==="";)i++;return n=e[i++],n&&(a=parseFloat(n)),new I(s,o,r,a)}else return new I}static stringify(t){return t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}static stringifyFixed(t){return m.s(t,"number",I,"stringifyFixed:digits"),e=>e.x.toFixed(t)+" "+e.y.toFixed(t)+" "+e.width.toFixed(t)+" "+e.height.toFixed(t)}toString(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"}equals(t){return t instanceof I?this.rx===t.x&&this.ry===t.y&&this.rw===t.width&&this.rh===t.height:!1}equalTo(t,e,i,s){return this.rx===t&&this.ry===e&&this.rw===i&&this.rh===s}equalsApprox(t){return C.c(this.rx,t.x)&&C.c(this.ry,t.y)&&C.c(this.rw,t.width)&&C.c(this.rh,t.height)}equalsApproxTo(t,e,i,s){return C.c(this.rx,t)&&C.c(this.ry,e)&&C.c(this.rw,i)&&C.c(this.rh,s)}equalsApproxClose(t){return C.X(this.rx,t.x)&&C.X(this.ry,t.y)&&C.X(this.rw,t.width)&&C.X(this.rh,t.height)}containsPoint(t){return this.rx<=t.x&&this.rx+this.rw>=t.x&&this.ry<=t.y&&this.ry+this.rh>=t.y}containsRect(t){return this.rx<=t.x&&t.x+t.width<=this.rx+this.rw&&this.ry<=t.y&&t.y+t.height<=this.ry+this.rh}contains(t,e,i,s){return i===void 0&&(i=0),s===void 0&&(s=0),this.rx<=t&&t+i<=this.rx+this.rw&&this.ry<=e&&e+s<=this.ry+this.rh}offset(t,e){return this.rx+=t,this.ry+=e,this}inflate(t,e){return this.Qw(e,t,e,t)}addMargin(t){return this.Qw(t.top,t.right,t.bottom,t.left)}subtractMargin(t){return this.Qw(-t.top,-t.right,-t.bottom,-t.left)}grow(t,e,i,s){return this.Qw(t,e,i,s)}Qw(t,e,i,s){let n=this.rw;e+s<=-n?(this.rx+=n/2,this.rw=0):(this.rx-=s,this.rw+=e+s);let o=this.rh;return t+i<=-o?(this.ry+=o/2,this.rh=0):(this.ry-=t,this.rh+=t+i),this}intersectRect(t){return this.VL(t.x,t.y,t.width,t.height)}intersect(t,e,i,s){return this.VL(t,e,i,s)}VL(t,e,i,s){let n=Math.max(this.rx,t),o=Math.max(this.ry,e),r=Math.min(this.rx+this.rw,t+i),a=Math.min(this.ry+this.rh,e+s);return this.rx=n,this.ry=o,this.rw=Math.max(0,r-n),this.rh=Math.max(0,a-o),this}intersectsRect(t){return this.intersects(t.x,t.y,t.width,t.height)}intersects(t,e,i,s){let n=this.rw,o=this.rx;if(n!==1/0&&i!==1/0&&(n+=o,i+=t,isNaN(i)||isNaN(n)||o>i||t>n))return!1;let r=this.rh,a=this.ry;return!(r!==1/0&&s!==1/0&&(r+=a,s+=e,isNaN(s)||isNaN(r)||a>s||e>r))}BL(t,e){let i=this.rw,s=t.width+e+e,n=this.rx,o=t.x-e;if(i+=n,s+=o,n>s||o>i)return!1;let r=this.rh,a=t.height+e+e,h=this.ry,l=t.y-e;return r+=h,a+=l,!(h>a||l>r)}unionPoint(t){return this.re(t.x,t.y,0,0)}unionRect(t){return this.re(t.rx,t.ry,t.rw,t.rh)}union(t,e,i,s){return i===void 0&&(i=0),s===void 0&&(s=0),this.re(t,e,i,s)}re(t,e,i,s){let n=Math.min(this.rx,t),o=Math.min(this.ry,e),r=Math.max(this.rx+this.rw,t+i),a=Math.max(this.ry+this.rh,e+s);return this.rx=n,this.ry=o,this.rw=r-n,this.rh=a-o,this}setSpot(t,e,i){return this.rx=t-i.offsetX-i.x*this.rw,this.ry=e-i.offsetY-i.y*this.rh,this}nearestSideDirection(t,e){return C._w(this,t,e,!0)}nearestSideDirectionPoint(t){return C._w(this,t.x,t.y,!0)}static contains(t,e,i,s,n,o,r,a){return r===void 0&&(r=0),a===void 0&&(a=0),t<=n&&n+r<=t+i&&e<=o&&o+a<=e+s}static intersects(t,e,i,s,n,o,r,a){let h=i,l=r,u=t,c=n;if(h+=u,l+=c,u>l||c>h)return!1;let d=s,f=a,p=e,g=o;return d+=p,f+=g,!(p>f||g>d)}static intersectsLineSegment(t,e,i,s,n,o,r,a){return C.zL(t,e,i,s,n,o,r,a)}get x(){return this.rx}set x(t){this.rx=t}get y(){return this.ry}set y(t){this.ry=t}get width(){return this.rw}set width(t){t<0&&m.J(t,">= 0",I,"width"),this.rw=t}get height(){return this.rh}set height(t){t<0&&m.J(t,">= 0",I,"height"),this.rh=t}get left(){return this.rx}set left(t){this.rx=t}get top(){return this.ry}set top(t){this.ry=t}get right(){return this.rx+this.rw}set right(t){this.rx+=t-(this.rx+this.rw)}get bottom(){return this.ry+this.rh}set bottom(t){this.ry+=t-(this.ry+this.rh)}get position(){return new P(this.rx,this.ry)}set position(t){this.rx=t.x,this.ry=t.y}get size(){return new st(this.rw,this.rh)}set size(t){this.rw=t.width,this.rh=t.height}get center(){return new P(this.rx+this.rw/2,this.ry+this.rh/2)}set center(t){this.rx=t.x-this.rw/2,this.ry=t.y-this.rh/2}get centerX(){return this.rx+this.rw/2}set centerX(t){this.rx=t-this.rw/2}get centerY(){return this.ry+this.rh/2}set centerY(t){this.ry=t-this.rh/2}isReal(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)}isEmpty(){return this.width===0&&this.height===0}static em=new I(0,0,0,0).kt();static YF=new I(NaN,NaN,NaN,NaN).kt();static tx=[];static l(){let t=I.tx.pop();return t===void 0?new I:t}static bs(t){let e=I.tx.pop();return e===void 0?t.copy():e.h(t)}static z(t,e,i,s){let n=I.tx.pop();return n===void 0?new I(t,e,i,s):n.e(t,e,i,s)}static i(t){I.tx.push(t)}}class Dt{mt;mr;mb;ml;constructor(t,e,i,s){t===void 0?(this.mt=0,this.mr=0,this.mb=0,this.ml=0):e===void 0?(e=t,i=t,s=t,this.mt=t,this.mr=e,this.mb=i,this.ml=s):i===void 0?(i=t,s=e,this.mt=t,this.mr=e,this.mb=i,this.ml=s):s!==void 0?(this.mt=t,this.mr=e,this.mb=i,this.ml=s):m.o("Invalid arguments to Margin constructor: "+t+", "+e+", "+i+", "+s)}setTo(t,e,i,s){return this.mt=t,this.mr=e,this.mb=i,this.ml=s,this}set(t){return this.mt=t.mt,this.mr=t.mr,this.mb=t.mb,this.ml=t.ml,this}copy(){let t=new Dt;return t.mt=this.mt,t.mr=this.mr,t.mb=this.mb,t.ml=this.ml,t}kt(){return Object.freeze(this),this}N(){return Object.isFrozen(this)?this:this.copy().kt()}Jw(t){}static parse(t){if(typeof t=="string"){let e=t.split(" "),i=0,s=NaN;for(;e[i]==="";)i++;let n=e[i++];if(n&&(s=parseFloat(n)),isNaN(s))return new Dt;let o=NaN;for(;e[i]==="";)i++;if(n=e[i++],n&&(o=parseFloat(n)),isNaN(o))return new Dt(s);let r=NaN;for(;e[i]==="";)i++;if(n=e[i++],n&&(r=parseFloat(n)),isNaN(r))return new Dt(s,o);let a=NaN;for(;e[i]==="";)i++;return n=e[i++],n&&(a=parseFloat(n)),isNaN(a)?new Dt(s,o):new Dt(s,o,r,a)}else return new Dt}static stringify(t){return t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}static stringifyFixed(t){return m.s(t,"number",Dt,"stringifyFixed:digits"),e=>e.top.toFixed(t)+" "+e.right.toFixed(t)+" "+e.bottom.toFixed(t)+" "+e.left.toFixed(t)}toString(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"}equals(t){return t instanceof Dt?this.mt===t.top&&this.mr===t.right&&this.mb===t.bottom&&this.ml===t.left:!1}equalTo(t,e,i,s){return this.mt===t&&this.mr===e&&this.mb===i&&this.ml===s}equalsApprox(t){return C.c(this.mt,t.top)&&C.c(this.mr,t.right)&&C.c(this.mb,t.bottom)&&C.c(this.ml,t.left)}get top(){return this.mt}set top(t){this.mt=t}get right(){return this.mr}set right(t){this.mr=t}get bottom(){return this.mb}set bottom(t){this.mb=t}get left(){return this.ml}set left(t){this.ml=t}isReal(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)}static im=new Dt(0,0,0,0).kt();static XL=new Dt(2,2,2,2).kt()}class T{sx;sy;ox;oy;constructor(t,e,i,s){t===void 0?(this.sx=0,this.sy=0,this.ox=0,this.oy=0):(e===void 0&&(e=0),i===void 0&&(i=0),s===void 0&&(s=0),this.sx=t,this.sy=e,this.ox=i,this.oy=s)}setTo(t,e,i,s){return this.sx=t,this.sy=e,this.ox=i,this.oy=s,this}set(t){return this.sx=t.sx,this.sy=t.sy,this.ox=t.ox,this.oy=t.oy,this}copy(){let t=new T;return t.sx=this.sx,t.sy=this.sy,t.ox=this.ox,t.oy=this.oy,t}kt(){return Object.freeze(this),this}N(){return Object.isFrozen(this)?this:this.copy().kt()}Jw(t){}Ki(t){return this.sx=NaN,this.sy=NaN,this.ox=t,this.kt()}DU(t,e){(isNaN(t)||t>1||t<0)&&m.J(t,"0 <= "+e+" <= 1",T,e)}vU(t,e){(isNaN(t)||t===1/0||t===-1/0)&&m.J(t,"real number, not NaN or Infinity",T,e)}static parse(t){if(typeof t=="string"){if(t=t.trim(),t==="None")return T.None;if(t==="TopLeft")return T.TopLeft;if(t==="Top"||t==="TopCenter"||t==="MiddleTop")return T.TopCenter;if(t==="TopRight")return T.TopRight;if(t==="Left"||t==="LeftCenter"||t==="MiddleLeft")return T.LeftCenter;if(t==="Center")return T.Center;if(t==="Right"||t==="RightCenter"||t==="MiddleRight")return T.RightCenter;if(t==="BottomLeft")return T.BottomLeft;if(t==="Bottom"||t==="BottomCenter"||t==="MiddleBottom")return T.BottomCenter;if(t==="BottomRight")return T.BottomRight;if(t==="TopSide")return T.TopSide;if(t==="LeftSide")return T.LeftSide;if(t==="RightSide")return T.RightSide;if(t==="BottomSide")return T.BottomSide;if(t==="TopBottomSides")return T.TopBottomSides;if(t==="LeftRightSides")return T.LeftRightSides;if(t==="TopLeftSides")return T.TopLeftSides;if(t==="TopRightSides")return T.TopRightSides;if(t==="BottomLeftSides")return T.BottomLeftSides;if(t==="BottomRightSides")return T.BottomRightSides;if(t==="NotTopSide")return T.NotTopSide;if(t==="NotLeftSide")return T.NotLeftSide;if(t==="NotRightSide")return T.NotRightSide;if(t==="NotBottomSide")return T.NotBottomSide;if(t==="AllSides")return T.AllSides;if(t==="Default")return T.Default;let e=t.split(" "),i=0,s=0;for(;e[i]==="";)i++;let n=e[i++];n!==void 0&&n.length>0&&(s=parseFloat(n));let o=0;for(;e[i]==="";)i++;n=e[i++],n!==void 0&&n.length>0&&(o=parseFloat(n));let r=0;for(;e[i]==="";)i++;n=e[i++],n!==void 0&&n.length>0&&(r=parseFloat(n));let a=0;for(;e[i]==="";)i++;return n=e[i++],n!==void 0&&n.length>0&&(a=parseFloat(n)),new T(s,o,r,a)}else return new T}static stringify(t){return t.isSpot()?t.x.toString()+" "+t.y.toString()+" "+t.offsetX.toString()+" "+t.offsetY.toString():t.toString()}static stringifyFixed(t){return m.s(t,"number",T,"stringifyFixed:digits"),e=>e.x.toFixed(t)+" "+e.y.toFixed(t)+" "+e.offsetX.toFixed(t)+" "+e.offsetY.toFixed(t)}toString(){return this.isSpot()?this.ox===0&&this.oy===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.equals(T.None)?"None":this.equals(T.TopLeft)?"TopLeft":this.equals(T.TopCenter)?"Top":this.equals(T.TopRight)?"TopRight":this.equals(T.LeftCenter)?"Left":this.equals(T.Center)?"Center":this.equals(T.RightCenter)?"Right":this.equals(T.BottomLeft)?"BottomLeft":this.equals(T.BottomCenter)?"Bottom":this.equals(T.BottomRight)?"BottomRight":this.equals(T.TopSide)?"TopSide":this.equals(T.LeftSide)?"LeftSide":this.equals(T.RightSide)?"RightSide":this.equals(T.BottomSide)?"BottomSide":this.equals(T.TopBottomSides)?"TopBottomSides":this.equals(T.LeftRightSides)?"LeftRightSides":this.equals(T.TopLeftSides)?"TopLeftSides":this.equals(T.TopRightSides)?"TopRightSides":this.equals(T.BottomLeftSides)?"BottomLeftSides":this.equals(T.BottomRightSides)?"BottomRightSides":this.equals(T.NotTopSide)?"NotTopSide":this.equals(T.NotLeftSide)?"NotLeftSide":this.equals(T.NotRightSide)?"NotRightSide":this.equals(T.NotBottomSide)?"NotBottomSide":this.equals(T.AllSides)?"AllSides":this.equals(T.Default)?"Default":"None"}equals(t){return t instanceof T?(this.sx===t.x||isNaN(this.sx)&&isNaN(t.x))&&(this.sy===t.y||isNaN(this.sy)&&isNaN(t.y))&&this.ox===t.offsetX&&this.oy===t.offsetY:!1}opposite(){return new T(.5-(this.sx-.5),.5-(this.sy-.5),-this.ox,-this.oy)}includesSide(t){if(!this.isSide())return!1;if(!t.isSide())if(t.equals(T.Left))t=T.LeftSide;else if(t.equals(T.Right))t=T.RightSide;else if(t.equals(T.Top))t=T.TopSide;else if(t.equals(T.Bottom))t=T.BottomSide;else return!1;let e=this.oy,i=t.offsetY;return(e&i)===i}get x(){return this.sx}set x(t){this.sx=t}get y(){return this.sy}set y(t){this.sy=t}get offsetX(){return this.ox}set offsetX(t){this.ox=t}get offsetY(){return this.oy}set offsetY(t){this.oy=t}isSpot(){return!isNaN(this.x)&&!isNaN(this.y)}isNoSpot(){return isNaN(this.x)||isNaN(this.y)}isSide(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0}isNone(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0}isDefault(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0}static None=new T(0,0,0,0).Ki(0);static Default=new T(0,0,-1,0).Ki(-1);static TopLeft=new T(0,0,0,0).kt();static TopCenter=new T(.5,0,0,0).kt();static TopRight=new T(1,0,0,0).kt();static LeftCenter=new T(0,.5,0,0).kt();static Center=new T(.5,.5,0,0).kt();static RightCenter=new T(1,.5,0,0).kt();static BottomLeft=new T(0,1,0,0).kt();static BottomCenter=new T(.5,1,0,0).kt();static BottomRight=new T(1,1,0,0).kt();static MiddleTop=T.TopCenter;static MiddleLeft=T.LeftCenter;static MiddleRight=T.RightCenter;static MiddleBottom=T.BottomCenter;static Top=T.TopCenter;static Left=T.LeftCenter;static Right=T.RightCenter;static Bottom=T.BottomCenter;static TopSide=new T(0,0,1,1).Ki(1);static LeftSide=new T(0,0,1,2).Ki(1);static RightSide=new T(0,0,1,4).Ki(1);static BottomSide=new T(0,0,1,8).Ki(1);static TopBottomSides=new T(0,0,1,9).Ki(1);static LeftRightSides=new T(0,0,1,6).Ki(1);static TopLeftSides=new T(0,0,1,3).Ki(1);static TopRightSides=new T(0,0,1,5).Ki(1);static BottomLeftSides=new T(0,0,1,10).Ki(1);static BottomRightSides=new T(0,0,1,12).Ki(1);static NotTopSide=new T(0,0,1,14).Ki(1);static NotLeftSide=new T(0,0,1,13).Ki(1);static NotRightSide=new T(0,0,1,11).Ki(1);static NotBottomSide=new T(0,0,1,7).Ki(1);static AllSides=new T(0,0,1,15).Ki(1);static vP=new T(.156,.156).kt();static FP=new T(.844,.844).kt()}class Nt{m11;m12;m21;m22;dx;dy;constructor(){this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0}set(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this.dx=t.dx,this.dy=t.dy,this}setTo(t,e,i,s,n,o){return this.m11=t,this.m12=e,this.m21=i,this.m22=s,this.dx=n,this.dy=o,this}copy(){let t=new Nt;return t.m11=this.m11,t.m12=this.m12,t.m21=this.m21,t.m22=this.m22,t.dx=this.dx,t.dy=this.dy,t}toString(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}equals(t){return this.m11===t.m11&&this.m12===t.m12&&this.m21===t.m21&&this.m22===t.m22&&this.dx===t.dx&&this.dy===t.dy}RP(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1}Ue(){return this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0,this}bc(t){let e=this.m11*t.m11+this.m21*t.m12,i=this.m12*t.m11+this.m22*t.m12,s=this.m11*t.m21+this.m21*t.m22,n=this.m12*t.m21+this.m22*t.m22;return this.dx=this.m11*t.dx+this.m21*t.dy+this.dx,this.dy=this.m12*t.dx+this.m22*t.dy+this.dy,this.m11=e,this.m12=i,this.m21=s,this.m22=n,this}GL(t){let e=1/(t.m11*t.m22-t.m12*t.m21),i=t.m22*e,s=-t.m12*e,n=-t.m21*e,o=t.m11*e,r=e*(t.m21*t.dy-t.m22*t.dx),a=e*(t.m12*t.dx-t.m11*t.dy),h=this.m11*i+this.m21*s,l=this.m12*i+this.m22*s,u=this.m11*n+this.m21*o,c=this.m12*n+this.m22*o;return this.dx=this.m11*r+this.m21*a+this.dx,this.dy=this.m12*r+this.m22*a+this.dy,this.m11=h,this.m12=l,this.m21=u,this.m22=c,this}ex(){let t=1/(this.m11*this.m22-this.m12*this.m21),e=this.m22*t,i=-this.m12*t,s=-this.m21*t,n=this.m11*t,o=t*(this.m21*this.dy-this.m22*this.dx),r=t*(this.m12*this.dx-this.m11*this.dy);return this.m11=e,this.m12=i,this.m21=s,this.m22=n,this.dx=o,this.dy=r,this}ks(t,e,i){if(t=C.Ee(t),t===0)return this;this.Xs(e,i);let s=0,n=0;if(t===90)s=0,n=1;else if(t===180)s=-1,n=0;else if(t===270)s=0,n=-1;else{let l=t*Math.PI/180;s=Math.cos(l),n=Math.sin(l)}let o=this.m11*s+this.m21*n,r=this.m12*s+this.m22*n,a=this.m11*-n+this.m21*s,h=this.m12*-n+this.m22*s;return this.m11=o,this.m12=r,this.m21=a,this.m22=h,this.Xs(-e,-i),this}Xs(t,e){return this.dx+=this.m11*t+this.m21*e,this.dy+=this.m12*t+this.m22*e,this}it(t,e){return e===void 0&&(e=t),this.m11*=t,this.m12*=t,this.m21*=e,this.m22*=e,this}KF(){if(this.m11===1&&this.m12===0)return 0;let t=Math.atan2(this.m12,this.m11)*180/Math.PI;return t<0&&(t+=360),t}gt(t){let e=t.x,i=t.y;return t.e(e*this.m11+i*this.m21+this.dx,e*this.m12+i*this.m22+this.dy)}Ci(t){let e=1/(this.m11*this.m22-this.m12*this.m21),i=this.m22*e,s=-this.m12*e,n=-this.m21*e,o=this.m11*e,r=t.x-this.dx,a=t.y-this.dy;return t.e(r*i+a*n,r*s+a*o)}Su(t){let e=1/(this.m11*this.m22-this.m12*this.m21),i=this.m22*e,s=-this.m12*e,n=-this.m21*e,o=this.m11*e,r=e*(this.m21*this.dy-this.m22*this.dx),a=e*(this.m12*this.dx-this.m11*this.dy),h=t.x*1.25,l=t.y*1.2;return t.e(h*i+l*n+r,h*s+l*o+a)}sm(t){let e=t.x,i=t.y,s=e+t.width,n=i+t.height,o=this.m11,r=this.m12,a=this.m21,h=this.m22,l=this.dx,u=this.dy,c=e*o+i*a+l,d=e*r+i*h+u,f=s*o+i*a+l,p=s*r+i*h+u,g=e*o+n*a+l,y=e*r+n*h+u,b=s*o+n*a+l,v=s*r+n*h+u,w=c,k=c,S=d,N=d;return w=Math.min(w,f),k=Math.max(k,f),S=Math.min(S,p),N=Math.max(N,p),w=Math.min(w,g),k=Math.max(k,g),S=Math.min(S,y),N=Math.max(N,y),w=Math.min(w,b),k=Math.max(k,b),S=Math.min(S,v),N=Math.max(N,v),t.e(w,S,k-w,N-S),t}static YL=[];static l(){let t=Nt.YL.pop();return t===void 0?new Nt:t}static i(t){Nt.YL.push(t)}static OP="54a702f3e53909c447824c6706603faf4c"}let C={HF:"7da71ca0ad381e90",qn:4*((Math.sqrt(2)-1)/3),KL:[],ix:x=>{if(x<=0)return 0;let t=C.KL;if(t===null){t=[];for(let e=0;e<=2e3;e++)t[e]=Math.sqrt(e);C.KL=t}if(x<1){let e=1/x;return e<=2e3?1/t[e|0]:Math.sqrt(x)}else return x<=2e3?t[x|0]:Math.sqrt(x)},c:(x,t)=>{let e=x-t;return e<.5&&e>-.5},X:(x,t)=>{let e=x-t;return e<5e-8&&e>-5e-8},Ve:(x,t,e,i,s,n,o)=>{s<=0&&(s=1e-6);let r=0,a=0,h=0,l=0;if(x<e?(a=x,r=e):(a=e,r=x),t<i?(l=t,h=i):(l=i,h=t),x===e)return l<=o&&o<=h&&x-s<=n&&n<=x+s;if(t===i)return a<=n&&n<=r&&t-s<=o&&o<=t+s;let u=r+s,c=a-s;if(c<=n&&n<=u){let d=h+s,f=l-s;if(f<=o&&o<=d)if(u-c>d-f)if(x-e>s||e-x>s){let p=(i-t)/(e-x)*(n-x)+t;if(p-s<=o&&o<=p+s)return!0}else return!0;else if(t-i>s||i-t>s){let p=(e-x)/(i-t)*(o-t)+x;if(p-s<=n&&n<=p+s)return!0}else return!0}return!1},nx:(x,t,e,i,s,n,o,r,a,h,l,u)=>{if(!C.Ve(x,t,o,r,u,e,i)||!C.Ve(x,t,o,r,u,s,n)){let c=(x+e)/2,d=(t+i)/2,f=(e+s)/2,p=(i+n)/2,g=(s+o)/2,y=(n+r)/2,b=(c+f)/2,v=(d+p)/2,w=(f+g)/2,k=(p+y)/2,S=(b+w)/2,N=(v+k)/2;return C.nx(x,t,c,d,b,v,S,N,a,h,l,u)||C.nx(S,N,w,k,g,y,o,r,a,h,l,u)}else return C.Ve(x,t,o,r,u,h,l)},HL:(x,t,e,i,s,n,o,r,a)=>{let h=(x+e)/2,l=(t+i)/2,u=(e+s)/2,c=(i+n)/2,d=(s+o)/2,f=(n+r)/2,p=(h+u)/2,g=(l+c)/2,y=(u+d)/2,b=(c+f)/2;return a.e((p+y)/2,(g+b)/2),a},qF:(x,t,e,i,s,n,o,r)=>{let a=(x+e)/2,h=(t+i)/2,l=(e+s)/2,u=(i+n)/2,c=(s+o)/2,d=(n+r)/2,f=(a+l)/2,p=(h+u)/2,g=(l+c)/2,y=(u+d)/2;return P.direction(f,p,g,y)},Mu:(x,t,e,i,s,n,o,r,a,h)=>{if(!C.Ve(x,t,o,r,a,e,i)||!C.Ve(x,t,o,r,a,s,n)){let l=(x+e)/2,u=(t+i)/2,c=(e+s)/2,d=(i+n)/2,f=(s+o)/2,p=(n+r)/2,g=(l+c)/2,y=(u+d)/2,b=(c+f)/2,v=(d+p)/2,w=(g+b)/2,k=(y+v)/2;C.Mu(x,t,l,u,g,y,w,k,a,h),C.Mu(w,k,b,v,f,p,o,r,a,h)}else h.re(x,t,0,0),h.re(o,r,0,0);return h},jn:(x,t,e,i,s,n,o,r,a,h)=>{if(!C.Ve(x,t,o,r,a,e,i)||!C.Ve(x,t,o,r,a,s,n)){let l=(x+e)/2,u=(t+i)/2,c=(e+s)/2,d=(i+n)/2,f=(s+o)/2,p=(n+r)/2,g=(l+c)/2,y=(u+d)/2,b=(c+f)/2,v=(d+p)/2,w=(g+b)/2,k=(y+v)/2;C.jn(x,t,l,u,g,y,w,k,a,h),C.jn(w,k,b,v,f,p,o,r,a,h)}else h.length===0&&(h.push(x),h.push(t)),h.push(o),h.push(r);return h},IP:(x,t,e,i,s,n,o,r,a,h)=>{if(C.Ve(x,t,s,n,h,e,i))return C.Ve(x,t,s,n,h,r,a);{let l=(x+e)/2,u=(t+i)/2,c=(e+s)/2,d=(i+n)/2,f=(l+c)/2,p=(u+d)/2;return C.IP(x,t,l,u,f,p,o,r,a,h)||C.IP(f,p,c,d,s,n,o,r,a,h)}},EP:(x,t,e,i,s,n,o,r)=>{if(C.Ve(x,t,s,n,o,e,i))r.re(x,t,0,0),r.re(s,n,0,0);else{let a=(x+e)/2,h=(t+i)/2,l=(e+s)/2,u=(i+n)/2,c=(a+l)/2,d=(h+u)/2;C.EP(x,t,a,h,c,d,o,r),C.EP(c,d,l,u,s,n,o,r)}return r},nm:(x,t,e,i,s,n,o,r)=>{if(C.Ve(x,t,s,n,o,e,i))r.length===0&&(r.push(x),r.push(t)),r.push(s),r.push(n);else{let a=(x+e)/2,h=(t+i)/2,l=(e+s)/2,u=(i+n)/2,c=(a+l)/2,d=(h+u)/2;C.nm(x,t,a,h,c,d,o,r),C.nm(c,d,l,u,s,n,o,r)}return r},om:(x,t,e,i,s,n,o,r,a,h,l,u,c,d)=>{if(!C.Ve(x,t,o,r,c,e,i)||!C.Ve(x,t,o,r,c,s,n)){let f=(x+e)/2,p=(t+i)/2,g=(e+s)/2,y=(i+n)/2,b=(s+o)/2,v=(n+r)/2,w=(f+g)/2,k=(p+y)/2,S=(g+b)/2,N=(y+v)/2,D=(w+S)/2,L=(k+N)/2,M=1/0,A=!1,F=0,O=0;if(C.om(x,t,f,p,w,k,D,L,a,h,l,u,c,d)){let E=(d.x-a)**2+(d.y-h)**2;E<M&&(M=E,A=!0,F=d.x,O=d.y)}if(C.om(D,L,S,N,b,v,o,r,a,h,l,u,c,d)){let E=(d.x-a)**2+(d.y-h)**2;E<M&&(M=E,A=!0,F=d.x,O=d.y)}return A&&(d.x=F,d.y=O),A}else{if(!C.ku(x,t,o,r,a,h,l,u))return!1;let f=(x-o)*(h-u)-(t-r)*(a-l);if(f===0)return!1;let p=((x*r-t*o)*(a-l)-(x-o)*(a*u-h*l))/f,g=((x*r-t*o)*(h-u)-(t-r)*(a*u-h*l))/f;return d.e(p,g),!0}},rm:(x,t,e,i,s,n,o,r,a,h,l,u,c)=>{let d=0;if(!C.Ve(x,t,o,r,c,e,i)||!C.Ve(x,t,o,r,c,s,n)){let f=(x+e)/2,p=(t+i)/2,g=(e+s)/2,y=(i+n)/2,b=(s+o)/2,v=(n+r)/2,w=(f+g)/2,k=(p+y)/2,S=(g+b)/2,N=(y+v)/2,D=(w+S)/2,L=(k+N)/2;d+=C.rm(x,t,f,p,w,k,D,L,a,h,l,u,c),d+=C.rm(D,L,S,N,b,v,o,r,a,h,l,u,c)}else{let f=(x-o)*(h-u)-(t-r)*(a-l);if(f===0)return d;let p=((x*r-t*o)*(a-l)-(x-o)*(a*u-h*l))/f,g=((x*r-t*o)*(h-u)-(t-r)*(a*u-h*l))/f;if(p>=l)return d;let y=0,b=0;if((a>l?a-l:l-a)<(h>u?h-u:u-h)){if(t<r?(y=t,b=r):(y=r,b=t),g<y||g>b)return d}else if(x<o?(y=x,b=o):(y=o,b=x),p<y||p>b)return d;f>0?d++:f<0&&d--}return d},Nl:(x,t,e,i,s,n,o)=>{if(C.X(x,e)){let r=0,a=0;t<i?(r=t,a=i):(r=i,a=t);let h=n;return h<r?(o.e(x,r),!1):h>a?(o.e(x,a),!1):(o.e(x,h),!0)}else if(C.X(t,i)){let r=0,a=0;x<e?(r=x,a=e):(r=e,a=x);let h=s;return h<r?(o.e(r,t),!1):h>a?(o.e(a,t),!1):(o.e(h,t),!0)}else{let r=(e-x)**2+(i-t)**2,a=((x-s)*(x-e)+(t-n)*(t-i))/r;if(a<-5e-6)return o.e(x,t),!1;if(a>1.000005)return o.e(e,i),!1;{let h=x+a*(e-x),l=t+a*(i-t);return o.e(h,l),!0}}},Do:(x,t,e,i,s,n,o,r,a)=>{if(C.c(x,e)&&C.c(t,i))return a.e(x,t),!1;if(C.X(s,o)){if(C.X(x,e))return C.Nl(x,t,e,i,s,n,a),!1;{let h=(i-t)/(e-x)*(s-x)+t;return C.Nl(x,t,e,i,s,h,a)}}else{let h=(r-n)/(o-s);if(C.X(x,e)){let l=h*(x-s)+n,u=0,c=0;return t<i?(u=t,c=i):(u=i,c=t),l<u?(a.e(x,u),!1):l>c?(a.e(x,c),!1):(a.e(x,l),!0)}else{let l=(i-t)/(e-x);if(C.X(h,l))return C.Nl(x,t,e,i,s,n,a),!1;{let u=(l*x-h*s+n-t)/(l-h);if(C.X(l,0)){let c=0,d=0;return x<e?(c=x,d=e):(c=e,d=x),u<c?(a.e(c,t),!1):u>d?(a.e(d,t),!1):(a.e(u,t),!0)}else{let c=l*(u-x)+t;return C.Nl(x,t,e,i,u,c,a)}}}}},Cl:(x,t,e,i,s,n,o,r,a)=>{let h=1e21,l=x,u=t;if(C.Do(x,t,x,i,s,n,o,r,a)){let c=(a.x-s)**2+(a.y-n)**2;c<h&&(h=c,l=a.x,u=a.y)}if(C.Do(e,t,e,i,s,n,o,r,a)){let c=(a.x-s)**2+(a.y-n)**2;c<h&&(h=c,l=a.x,u=a.y)}if(C.Do(x,t,e,t,s,n,o,r,a)){let c=(a.x-s)**2+(a.y-n)**2;c<h&&(h=c,l=a.x,u=a.y)}if(C.Do(x,i,e,i,s,n,o,r,a)){let c=(a.x-s)**2+(a.y-n)**2;c<h&&(h=c,l=a.x,u=a.y)}return a.e(l,u),h<1e21},lx:(x,t,e)=>C.zL(x.x,x.y,x.width,x.height,t.x,t.y,e.x,e.y),zL:(x,t,e,i,s,n,o,r)=>{let a=x,h=x+e,l=t,u=t+i;if(s===o){let c=0,d=0;return n<r?(c=n,d=r):(c=r,d=n),a<=s&&s<=h&&c<=u&&d>=l}if(n===r){let c=0,d=0;return s<o?(c=s,d=o):(c=o,d=s),l<=n&&n<=u&&c<=h&&d>=a}return!!(I.contains(x,t,e,i,s,n)||I.contains(x,t,e,i,o,r)||C.ku(a,l,h,l,s,n,o,r)||C.ku(h,l,h,u,s,n,o,r)||C.ku(h,u,a,u,s,n,o,r)||C.ku(a,u,a,l,s,n,o,r))},ku:(x,t,e,i,s,n,o,r)=>x===e&&t===i&&s===o&&n===r?x===s&&t===n:C.bu(x,t,e,i,s,n)*C.bu(x,t,e,i,o,r)<=0&&C.bu(s,n,o,r,x,t)*C.bu(s,n,o,r,e,i)<=0,bu:(x,t,e,i,s,n)=>{let o=e-x,r=i-t,a=s-x,h=n-t,l=a*r-h*o;return l===0&&(l=a*o+h*r,l>0&&(a-=o,h-=r,l=a*o+h*r,l<0&&(l=0))),l},_w(x,t,e,i){i===void 0&&(i=!1);let s=0,n=x===null?t:(t-x.x)/(x.width>0?x.width:1),o=x===null?e:(e-x.y)/(x.height>0?x.height:1);return n>o?n>1-o||(i||n<1-o?s=270:s=315):i||n<o?n>1-o?s=90:i||n<1-o?s=180:s=135:n<.5?s=225:n>.5&&(s=45),s},Ee:x=>(x>=360?x-=360:x<0&&(x+=360),x),jF:(x,t)=>x>t?Math.min(x-t,Math.abs(x-360-t)):t>x?Math.min(t-x,Math.abs(x-(t-360))):0,qL:(x,t,e,i,s,n)=>{let o=Math.PI;n||(i=i*(o/180),s=s*(o/180));let r=i>s?-1:1,a=1e-5,h=o*2,l=[],u=o/2,c=i,d=Math.min(h,Math.abs(s-i));if(d<a){let f=c+r*Math.min(d,u),p=x+e*Math.cos(c),g=t+e*Math.sin(c),y=x+e*Math.cos(f),b=t+e*Math.sin(f),v=(p+y)/2,w=(g+b)/2;return l.push([p,g,v,w,v,w,y,b]),l}for(;d>a;){let f=c+r*Math.min(d,u);l.push(C.WF(e,c,f,x,t)),d-=Math.abs(f-c),c=f}return l},WF:(x,t,e,i,s)=>{let n=(e-t)/2,o=x*Math.cos(n),r=x*Math.sin(n),a=o,h=-r,l=a*a+h*h,u=l+a*o+h*r,c=4/3*(Math.sqrt(2*l*u)-u)/(a*r-h*o),d=a-c*h,f=h+c*a,p=d,g=-f,y=n+t,b=Math.cos(y),v=Math.sin(y);return[i+x*Math.cos(t),s+x*Math.sin(t),i+d*b-f*v,s+d*v+f*b,i+p*b-g*v,s+p*v+g*b,i+x*Math.cos(e),s+x*Math.sin(e)]},tm:(x,t,e,i,s,n,o)=>{let r=s,a=n,h=Math.floor((x-e)/r)*r+e,l=Math.floor((t-i)/a)*a+i,u=h;h+r-x<r/2&&(u=h+r);let c=l;return l+a-t<a/2&&(c=l+a),o.e(u,c),o},jL:(x,t)=>{let e=Math.max(x,t),i=Math.min(x,t),s=1,n=1;do s=e%i,n=i,e=i,i=s;while(s>0);return n},JF:(x,t,e,i)=>{let s=e<0,n=i<0,o=0,r=0,a=0;x<t?(r=1,a=0):(r=0,a=1);let h=0,l=0,u=0,c=0;return o=r,h=o===0?x:t,u=o===0?e:i,(o===0?s:n)&&(u=-u),o=a,l=o===0?x:t,c=o===0?e:i,(o===0?s:n)&&(c=-c),C.$F(h,l,u,c,0,0)},$F:(x,t,e,i,s,n)=>{let o=0;if(i>0)if(e>0){let r=x*x,a=t*t,h=x*e,l=t*i,u=-a+l,c=-a+Math.sqrt(h*h+l*l),d=u,f=9999999999;for(let y=0;y<f&&(d=.5*(u+c),!(d===u||d===c));++y){let b=h/(d+r),v=l/(d+a),w=b*b+v*v-1;if(w>0)u=d;else if(w<0)c=d;else break}s=r*e/(d+r),n=a*i/(d+a);let p=s-e,g=n-i;o=Math.sqrt(p*p+g*g)}else s=0,n=t,o=Math.abs(i-t);else{let r=x*x-t*t,a=x*e;if(a<r){let h=a/r,l=h*h;s=x*h,n=t*Math.sqrt(Math.abs(1-l));let u=s-e;o=Math.sqrt(u*u+n*n)}else s=x,n=0,o=Math.abs(e-x)}return o},Wn:{},lm:new bt,pr:new bt,yr:0,am:100};C.za=C.HF;var Ke=(x=>(x[x.Line=1]="Line",x[x.Rectangle=2]="Rectangle",x[x.Ellipse=3]="Ellipse",x[x.Path=4]="Path",x))(Ke||{}),Ri=(x=>(x[x.None=0]="None",x[x.Default=1]="Default",x[x.Fill=2]="Fill",x[x.Uniform=6]="Uniform",x))(Ri||{});class wt{n;hm;cm;kc;Nu;Cu;Jn;$n;Zn;W;Li;Ai;ni;oi;Gs;Pc;Sc;constructor(t,e){V.Je(this),this.n=2,t===void 0&&(t=4),this.W=t,this.Li=0,this.Ai=0,this.ni=0,this.oi=0,t===4?this.Gs=new q:this.Gs=wt.hx,this.hm=this.Gs.rt,this.cm=new I,this.kc=null,this.Nu=null,this.Cu=NaN,this.Jn=T.TopLeft,this.$n=T.BottomRight,this.Pc=NaN,this.Sc=NaN,this.Zn=2,e&&Object.assign(this,e)}copy(){let t=new wt;if(t.n=this.n&-2,t.W=this.W,t.Li=this.Li,t.Ai=this.Ai,t.ni=this.ni,t.oi=this.oi,this.W===4){let e=this.Gs.r,i=t.Gs;for(let s=0;s<e.length;s++){let n=e[s];i.add(n.copy())}t.Gs=i}else t.Gs=this.Gs;return t.hm=this.hm,t.cm.h(this.cm),t.kc=this.kc,t.Nu=this.Nu,t.Cu=this.Cu,t.Jn=this.Jn.N(),t.$n=this.$n.N(),t.Pc=this.Pc,t.Sc=this.Sc,t.Zn=this.Zn,t}static Line=1;static Rectangle=2;static Ellipse=3;static Path=4;static hx=new q().k();get u(){return(this.n&1)!==0}set u(t){t?this.n|=1:this.n&=-2}get yt(){return(this.n&2)!==0}set yt(t){t?this.n|=2:this.n&=-3}k(){if(this.u=!0,this.type!==4)return this;let t=this.figures;t.k();for(let e of t)e.k();return this}equalsApprox(t){if(!(t instanceof wt))return!1;if(this.type!==t.type)return this.type===1&&t.type===4?this.WL(t):t.type===1&&this.type===4?t.WL(this):!1;if(this.type===4){let e=this.figures.r,i=t.figures.r,s=e.length;if(s!==i.length)return!1;for(let n=0;n<s;n++){let o=e[n],r=i[n];if(!o.equalsApprox(r))return!1}return!0}else return C.c(this.startX,t.startX)&&C.c(this.startY,t.startY)&&C.c(this.endX,t.endX)&&C.c(this.endY,t.endY)}WL(t){if(this.type!==1||t.type!==4)return!1;if(t.figures.count===1){let e=t.figures.elt(0);if(e.segments.count===1&&C.c(this.startX,e.startX)&&C.c(this.startY,e.startY)){let i=e.segments.elt(0);if(i.type===2&&C.c(this.endX,i.endX)&&C.c(this.endY,i.endY))return!0}}return!1}static stringify(t){return t.toString()}static stringifyFixed(t){return m.s(t,"number",wt,"stringifyFixed:digits"),e=>e.toString(t)}fe(t){t in Ke?this.type=t:m.ur(this,t)}toString(t){t===void 0&&(t=-1);let e=s=>s===0?"0":s.toFixed(t),i;switch(this.type){case 1:return t<0?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+e(this.startX)+" "+e(this.startY)+"L"+e(this.endX)+" "+e(this.endY);case 2:return i=new I(this.startX,this.startY,0,0),i.union(this.endX,this.endY,0,0),t<0?"M"+i.x.toString()+" "+i.y.toString()+"H"+i.right.toString()+"V"+i.bottom.toString()+"H"+i.left.toString()+"z":"M"+e(i.x)+" "+e(i.y)+"H"+e(i.right)+"V"+e(i.bottom)+"H"+e(i.left)+"z";case 3:if(i=new I(this.startX,this.startY,0,0),i.union(this.endX,this.endY,0,0),t<0){let r=i.left.toString()+" "+(i.y+i.height/2).toString(),a=i.right.toString()+" "+(i.y+i.height/2).toString();return"M"+r+"A"+(i.width/2).toString()+" "+(i.height/2).toString()+" 0 0 1 "+a+"A"+(i.width/2).toString()+" "+(i.height/2).toString()+" 0 0 1 "+r}else{let r=e(i.left)+" "+e(i.y+i.height/2),a=e(i.right)+" "+e(i.y+i.height/2);return"M"+r+"A"+e(i.width/2)+" "+e(i.height/2)+" 0 0 1 "+a+"A"+e(i.width/2)+" "+e(i.height/2)+" 0 0 1 "+r}case 4:let s="",n=this.figures.r,o=n.length;for(let r=0;r<o;r++){let a=n[r];r>0&&(s+=" x "),a.isFilled&&(s+="F "),s+=a.toString(t)}return s;default:return Ke[this.type]}}static fillPath(t){typeof t!="string"&&m.si(t,"string",wt,"fillPath:str");let e=t.split(/[Xx]/),i=e.length,s="";for(let n=0;n<i;n++){let o=e[n];if(o.match(/[Ff]/)!==null){n===0?s+=o:s+="X"+(o[0]===" "?"":" ")+o;continue}s+=(n===0?"":"X ")+"F"+(o[0]===" "?"":" ")+o}return s}static fm="UuBbMmZzLlHhVvCcSsQqTtAaFfXx";static parse(t,e){e===void 0&&(e=!1),typeof t!="string"&&m.si(t,"string",wt,"parse:str");let i=new RegExp("(["+wt.fm+"])(["+wt.fm+"])","gm"),s=new RegExp("(["+wt.fm+"])([^s])","gm"),n=new RegExp("([^s])(["+wt.fm+"])","gm");t=t.replace(/,/gm," "),t=t.replace(i,"$1 $2"),t=t.replace(i,"$1 $2"),t=t.replace(s,"$1 $2"),t=t.replace(n,"$1 $2"),t=t.replace(/([0-9])([+\-])/gm,"$1 $2"),t=t.replace(/[\s\r\t\n]+/gm," "),t=t.replace(/^\s+|\s+$/g,"");let o=t.split(" ");for(let F=0;F<o.length;F++){let O=o[F];if(O.match(/(\.[0-9]*)(\.)/gm)!==null){let E=m.nt(),B="",K=!1;for(let z=0;z<O.length;z++){let U=O[z];U==="."&&!K?(K=!0,B+=U):U==="."?(E.push(B),B="."):B+=U}E.push(B),o.splice(F,1);for(let z=0;z<E.length;z++)o.splice(F+z,0,E[z]);F+=E.length-1,m.Z(E)}}let r=-1,a="",h="",l=new P(0,0),u=new P(0,0),c=new P(0,0),d=!0;function f(){return r>=w-1||o[r+1].match(M)!==null?!0:(d=!1,!1)}function p(){return r++,o[r]}function g(F){let O=parseFloat(p()),E=parseFloat(p());a===a.toLowerCase()&&(O=c.x+O,E=c.y+E),F.e(O,E)}function y(){return g(c),c}function b(){return g(u),u}function v(){let F=h.toLowerCase();return F==="c"||F==="s"||F==="q"||F==="t"?new P(2*c.x-u.x,2*c.y-u.y):new P(c.x,c.y)}let w=o.length,k=Ce.JL(null),S=!1,N=!1,D=!1,L=!0,M=new RegExp("["+wt.fm+"]");for(;!(r>=w-1);){if(h=a,a=p(),a==="")continue;d=!0;let F=!1;switch(a.toUpperCase()){case"X":L=!0,S=!1,N=!1;break;case"M":let O=y();for(k.Ne===null||L===!0?(k.Lu(O.x,O.y,S,!1,!N,D),L=!1):k.ZF(O.x,O.y),l.h(c);!f();){let E=y();k.Ys(E.x,E.y)}break;case"L":for(;!f();){let E=y();k.Ys(E.x,E.y)}d&&(F=!0);break;case"H":for(;!f();)c.e((a===a.toLowerCase()?c.x:0)+parseFloat(p()),c.y),k.Ys(c.x,c.y);break;case"V":for(;!f();)c.e(c.x,(a===a.toLowerCase()?c.y:0)+parseFloat(p())),k.Ys(c.x,c.y);d&&(F=!0);break;case"C":for(;!f();){let E=new P;g(E);let B=b(),K=y();k.wr(E.x,E.y,B.x,B.y,K.x,K.y)}d&&(F=!0);break;case"S":for(;!f();){let E=v(),B=b(),K=y();k.wr(E.x,E.y,B.x,B.y,K.x,K.y)}d&&(F=!0);break;case"Q":for(;!f();){let E=b(),B=y();k.Au(E.x,E.y,B.x,B.y)}d&&(F=!0);break;case"T":for(;!f();){let E=v();u.h(E);let B=y();k.Au(E.x,E.y,B.x,B.y),u.h(B)}d&&(F=!0);break;case"B":for(;!f();){let E=parseFloat(p()),B=parseFloat(p()),K=parseFloat(p()),z=parseFloat(p()),U=parseFloat(p()),tt=U,nt=!1;f()||(tt=parseFloat(p()),f()||(nt=parseFloat(p())!==0)),a===a.toLowerCase()&&(K+=c.x,z+=c.y),k.QF(E,B,K,z,U,tt,nt)}d&&(F=!0);break;case"A":for(;!f();){let E=Math.abs(parseFloat(p())),B=Math.abs(parseFloat(p())),K=parseFloat(p()),z=!1,U=!1,tt=0,nt=0,Z=p();Z.length===1?(z=!!parseFloat(Z),U=!!parseFloat(p()),tt=parseFloat(p()),nt=parseFloat(p())):Z.length===2?(z=!!parseFloat(Z[0]),U=!!parseFloat(Z[1]),tt=parseFloat(p()),nt=parseFloat(p())):(z=!!parseFloat(Z[0]),U=!!parseFloat(Z[1]),tt=parseFloat(Z.slice(2)),nt=parseFloat(p())),a===a.toLowerCase()&&(tt=c.x+tt,nt=c.y+nt),c.e(tt,nt),k._F(E,B,K,z,U,tt,nt)}d&&(F=!0);break;case"Z":k.tR(),c.h(l);break;case"F":{let E="",B=1;for(;o[r+B];){if(o[r+B]==="0"){D=!0,B++;continue}if(o[r+B].match(/[Uu]/)!==null){B++;continue}if(o[r+B].match(M)===null){B++;continue}E=o[r+B];break}E.match(/[Mm]/)?S=!0:k.eR();break}case"U":{let E="",B=1;for(;o[r+B];){if(o[r+B].match(/[Ff]/)!==null){B++;continue}if(o[r+B].match(M)===null){B++;continue}E=o[r+B];break}E.match(/[Mm]/)?N=!0:k.iR(!1);break}default:if(a==="0"||a==="1")break;m.ne("Unknown geometry command: "+a);break}if(F){m.ne(`Bad geometry command: ${a}, next token: ${p()},
|
|
3
3
|
string: ${t}`);break}}let A=k.um;if(Ce.$L(k),e){let F=A.figures.iterator;for(;F.next();){let O=F.value;O.isFilled=!0}}return A}static ZL(t,e){let i=t.length,s=P.l();for(let n=0;n<i;n++){let o=t[n];s.x=o[0],s.y=o[1],e.gt(s),o[0]=s.x,o[1]=s.y,s.x=o[2],s.y=o[3],e.gt(s),o[2]=s.x,o[3]=s.y,s.x=o[4],s.y=o[5],e.gt(s),o[4]=s.x,o[5]=s.y,s.x=o[6],s.y=o[7],e.gt(s),o[6]=s.x,o[7]=s.y}P.i(s)}UP(){if(this.yt)return!0;if(this.type===4){let t=this.figures;if(this.hm!==t.rt)return!0;let e=this.figures.r,i=e.length;for(let s=0;s<i;s++)if(e[s].UP())return!0}return!1}cx(){if(this.yt=!1,this.kc=null,this.Nu=null,this.Cu=NaN,this.type===4){let e=this.figures;this.hm=e.rt;let i=this.figures.r,s=i.length;for(let n=0;n<s;n++)i[n].sR()}let t=this.cm;isNaN(this.Pc)||isNaN(this.Sc)?t.e(0,0,0,0):t.e(0,0,this.Pc,this.Sc),this.QL(t,!1),t.re(0,0,0,0)}computeBoundsWithoutOrigin(){let t=new I;return this.QL(t,!0),t}QL(t,e){switch(this.type){case 1:case 2:case 3:e?t.e(this.Li,this.Ai,0,0):t.re(this.Li,this.Ai,0,0),t.re(this.ni,this.oi,0,0);break;case 4:let i=this.figures,s=i.r,n=i.length;for(let o=0;o<n;o++){let r=s[o];e&&o===0?t.e(r.startX,r.startY,0,0):t.re(r.startX,r.startY,0,0);let a=r.segments.r,h=a.length,l=r.startX,u=r.startY;for(let c=0;c<h;c++){let d=a[c];switch(d.type){case 2:case 1:l=d.endX,u=d.endY,t.re(l,u,0,0);break;case 3:C.Mu(l,u,d.point1X,d.point1Y,d.point2X,d.point2Y,d.endX,d.endY,.5,t),l=d.endX,u=d.endY;break;case 4:C.EP(l,u,d.point1X,d.point1Y,d.endX,d.endY,.5,t),l=d.endX,u=d.endY;break;case 5:case 6:let f=d.type===5?d.vo(r):d.Za(r,l,u),p=f.length;if(p===0){l=d.type===5?d.centerX:d.endX,u=d.type===5?d.centerY:d.endY,t.re(l,u,0,0);break}let g=null;for(let y=0;y<p;y++)g=f[y],C.Mu(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],.5,t);g!==null&&(l=g[6],u=g[7]);break;default:m.o("Unknown Segment type: "+d.type)}}}break;default:m.o("Unknown Geometry type: "+this.type)}}nR(t,e){let i=this.bounds,s=t/i.width,n=e/i.height;return isFinite(s)||(s=1),isFinite(n)||(n=1),s===1&&n===1?this:this.copy().scale(s,n)}normalize(){this.u&&m.L(this);let t=this.computeBoundsWithoutOrigin();return this.offset(-t.x,-t.y),new P(-t.x,-t.y)}offset(t,e){return this.u&&m.L(this),this.v(1,0,0,1,t,e),this}scale(t,e){return this.u&&m.L(this),this.v(t,0,0,e,0,0),this}rotate(t,e,i){this.u&&m.L(this),e===void 0&&(e=0),i===void 0&&(i=0);let s=Nt.l();return s.Ue(),s.ks(t,e,i),this.v(s.m11,s.m12,s.m21,s.m22,s.dx,s.dy),Nt.i(s),this}v(t,e,i,s,n,o){let r=0,a=0;switch(this.type){case 1:case 2:case 3:r=this.Li,a=this.Ai,this.Li=r*t+a*i+n,this.Ai=r*e+a*s+o,r=this.ni,a=this.oi,this.ni=r*t+a*i+n,this.oi=r*e+a*s+o;break;case 4:let h=this.figures.r,l=h.length;for(let u=0;u<l;u++){let c=h[u];r=c.startX,a=c.startY,c.startX=r*t+a*i+n,c.startY=r*e+a*s+o;let d=c.segments.r,f=d.length;for(let p=0;p<f;p++){let g=d[p];switch(g.type){case 2:case 1:r=g.endX,a=g.endY,g.endX=r*t+a*i+n,g.endY=r*e+a*s+o;break;case 3:r=g.point1X,a=g.point1Y,g.point1X=r*t+a*i+n,g.point1Y=r*e+a*s+o,r=g.point2X,a=g.point2Y,g.point2X=r*t+a*i+n,g.point2Y=r*e+a*s+o,r=g.endX,a=g.endY,g.endX=r*t+a*i+n,g.endY=r*e+a*s+o;break;case 4:r=g.point1X,a=g.point1Y,g.point1X=r*t+a*i+n,g.point1Y=r*e+a*s+o,r=g.endX,a=g.endY,g.endX=r*t+a*i+n,g.endY=r*e+a*s+o;break;case 5:if(r=g.centerX,a=g.centerY,g.centerX=r*t+a*i+n,g.centerY=r*e+a*s+o,e!==0){let y=Math.atan2(e,t)*180/Math.PI;y<0&&(y+=360),g.startAngle+=y}t<0&&(g.startAngle=180-g.startAngle,g.sweepAngle=-g.sweepAngle),s<0&&(g.startAngle=-g.startAngle,g.sweepAngle=-g.sweepAngle),g.radiusX*=Math.sqrt(t*t+i*i),g.radiusY!==void 0&&(g.radiusY*=Math.sqrt(e*e+s*s));break;case 6:if(r=g.endX,a=g.endY,g.endX=r*t+a*i+n,g.endY=r*e+a*s+o,g.radiusX===0||g.radiusY===0)break;if(e!==0){let y=Math.atan2(e,t)*180/Math.PI;y<0&&(y+=360),g.xAxisRotation+=y}t<0&&(g.xAxisRotation=180-g.xAxisRotation,g.isClockwiseArc=!g.isClockwiseArc),s<0&&(g.xAxisRotation=-g.xAxisRotation,g.isClockwiseArc=!g.isClockwiseArc),g.radiusX*=Math.sqrt(t*t+i*i),g.radiusY*=Math.sqrt(e*e+s*s);break;default:m.o("Unknown Segment type: "+g.type)}}}break}return this.yt=!0,this}containsPoint(t,e){e===void 0&&(e=0);let i=this.Li,s=this.Ai,n=this.ni,o=this.oi;switch(this.type){case 1:return C.Ve(i,s,n,o,e,t.x,t.y);case 2:{let r=Math.min(i,n)-e,a=Math.min(s,o)-e,h=Math.abs(n-i)+e*2,l=Math.abs(o-s)+e*2,u=I.z(r,a,h,l),c=u.containsPoint(t);return I.i(u),c}case 3:{let r=Math.min(i,n)-e,a=Math.min(s,o)-e,h=Math.abs(n-i)+e*2,l=Math.abs(o-s)+e*2,u=h/2,c=l/2;return u<=0||c<=0?!1:(r=t.x-(r+u),a=t.y-(a+c),r*r/(u*u)+a*a/(c*c)<=1)}case 4:return this.VP(t,e,!0,!1);default:return!1}}VP(t,e,i,s){let n=t.x,o=t.y,r=this.bounds.x-20,a=o,h=0,l=0,u=0,c=0,d=0,f=0,p=this.figures.r,g=p.length;for(let y=0;y<g;y++){let b=p[y],v=!b.isEvenOdd;if(b.isFilled){if(i&&b.BP(n,o,e))return!0}else{if(b.BP(n,o,s?e:e+2))return!0;continue}let w=b.segments;l=b.startX,u=b.startY;let k=l,S=u,N=w.r,D=N[0];for(let L=0;L<=w.length;L++){let M;switch(L!==w.length?(D=N[L],M=D.type,d=D.endX,f=D.endY):(M=2,d=k,f=S),M){case 1:{let A=this.fx(n,o,r,a,l,u,k,S);if(isNaN(A))return!0;h+=A,k=d,S=f;break}case 2:{let A=this.fx(n,o,r,a,l,u,d,f);if(isNaN(A))return!0;h+=A;break}case 3:c=C.rm(l,u,D.point1X,D.point1Y,D.point2X,D.point2Y,d,f,r,a,n,o,.5),h+=c;break;case 4:{let A=(l+2*D.point1X)/3,F=(u+2*D.point1Y)/3,O=(D.point1X*2+d)/3,E=(D.point1Y*2+f)/3;c=C.rm(l,u,A,F,O,E,d,f,r,a,n,o,.5),h+=c;break}case 5:case 6:{let A=D.type===5?D.vo(b):D.Za(b,l,u),F=A.length;if(F===0){let E=this.fx(n,o,r,a,l,u,D.type===5?D.centerX:D.endX,D.type===5?D.centerY:D.endY);if(isNaN(E))return!0;h+=E;break}let O=null;for(let E=0;E<F;E++){if(O=A[E],E===0){let B=this.fx(n,o,r,a,l,u,O[0],O[1]);if(isNaN(B))return!0;h+=B}c=C.rm(O[0],O[1],O[2],O[3],O[4],O[5],O[6],O[7],r,a,n,o,.5),h+=c}O!==null&&(d=O[6],f=O[7]);break}default:m.o("Unknown Segment type: "+D.type)}l=d,u=f}if(v){if(h!==0)return!0}else if(h%2!==0)return!0;h=0}return!1}fx(t,e,i,s,n,o,r,a){if(C.Ve(n,o,r,a,.05,t,e))return NaN;let h=(t-i)*(o-a);if(h===0)return 0;let l=((t*s-e*i)*(n-r)-(t-i)*(n*a-o*r))/h,u=(t*s-e*i)*(o-a)/h;if(l>=t)return 0;if((n>r?n-r:r-n)<(o>a?o-a:a-o)){if(o<a){if(u<o||u>a)return 0}else if(u<a||u>o)return 0}else if(n<r){if(l<n||l>r)return 0}else if(l<r||l>n)return 0;return h>0?1:-1}_L(t,e,i){let s=this.figures.r,n=s.length;for(let o=0;o<n;o++)if(s[o].BP(t,e,i))return!0;return!1}getPointAlongPath(t,e){if(t<0?t=0:t>1&&(t=1),e===void 0&&(e=new P),this.type===1)return e.e(this.startX+t*(this.endX-this.startX),this.startY+t*(this.endY-this.startY)),e;let i=this.flattenedSegments,s=this.flattenedLengths,n=this.flattenedTotalLength,o=i.length,r=n*t,a=0;for(let h=0;h<o;h++){let l=s[h],u=l.length;for(let c=0;c<u;c++){let d=l[c];if(a+d>=r){let f=r-a,p=d===0?0:f/d,g=i[h],y=g[c*2],b=g[c*2+1],v=g[c*2+2],w=g[c*2+3];return e.e(y+(v-y)*p,b+(w-b)*p),e}a+=d}}return e}getAngleAlongPath(t){if(t<0?t=0:t>1&&(t=1),this.type===1)return Math.atan2(this.endY-this.startY,this.endX-this.startX)*180/Math.PI;let e=this.flattenedSegments,i=this.flattenedLengths,s=this.flattenedTotalLength,n=e.length,o=s*t,r=0;for(let a=0;a<n;a++){let h=i[a],l=h.length;for(let u=0;u<l;u++){let c=h[u];if(r+c>=o){let d=e[a],f=d[u*2],p=d[u*2+1],g=d[u*2+2],y=d[u*2+3];return Math.abs(g-f)<1&&Math.abs(y-p)<1?0:Math.abs(g-f)<1?y-p>=0?90:270:Math.abs(y-p)<1?g-f>=0?0:180:Math.atan2(y-p,g-f)*180/Math.PI}r+=c}}return NaN}getPointAndAngleAlongPath(t,e){if(t<0?t=0:t>1&&(t=1),e===void 0&&(e=[]),e.length=3,this.type===1)return e[0]=this.startX+t*(this.endX-this.startX),e[1]=this.startY+t*(this.endY-this.startY),e[2]=Math.atan2(this.endY-this.startY,this.endX-this.startX)*180/Math.PI,e;let i=this.flattenedSegments,s=this.flattenedLengths,n=this.flattenedTotalLength,o=i.length,r=n*t,a=0;for(let h=0;h<o;h++){let l=s[h],u=l.length;for(let c=0;c<u;c++){let d=l[c];if(a+d>=r){let f=r-a,p=d===0?0:f/d,g=i[h],y=g[c*2],b=g[c*2+1],v=g[c*2+2],w=g[c*2+3];e[0]=y+(v-y)*p,e[1]=b+(w-b)*p;let k;return Math.abs(v-y)<1&&Math.abs(w-b)<1?k=0:Math.abs(v-y)<1?k=w-b>=0?90:270:Math.abs(w-b)<1?k=v-y>=0?0:180:k=Math.atan2(w-b,v-y)*180/Math.PI,e[2]=k,e}a+=d}}return e}getFractionForPoint(t){if(this.type===1){let e=this.startX,i=this.startY,s=this.endX,n=this.endY;if(e===s&&i===n)return 0;{let o=t.x,r=t.y,a=0,h=0;if(e===s)return i<n?(a=i,h=n):(a=n,h=i),r<=a?a===i?0:1:r>=h?h===i?0:1:Math.abs(r-i)/(h-a);if(i===n)return e<s?(a=e,h=s):(a=s,h=e),o<=a?a===e?0:1:o>=h?h===e?0:1:Math.abs(o-e)/(h-a);{let l=(s-e)**2+(n-i)**2,u=P.l();C.Nl(e,i,s,n,o,r,u);let c=u.x,d=u.y;return P.i(u),Math.sqrt(((c-e)**2+(d-i)**2)/l)}}}else if(this.type===2){let e=this.startX,i=this.startY,s=this.endX,n=this.endY;if(e===s&&i===n)return 0;{let o=s-e,r=n-i,a=o*2+r*2,h=t.x,l=t.y;h=Math.min(Math.max(h,e),s),l=Math.min(Math.max(l,i),n);let u=Math.abs(h-e),c=Math.abs(h-s),d=Math.abs(l-i),f=Math.abs(l-n),p=Math.min(u,c,d,f);if(p===d)return h/a;if(p===c)return(o+l)/a;if(p===f)return(o*2+r-h)/a;if(p===u)return(o*2+r*2-l)/a}}else{let e=this.flattenedSegments,i=this.flattenedLengths,s=this.flattenedTotalLength,n=P.l(),o=1/0,r=0,a=0,h=e.length,l=0,u=0;for(let d=0;d<h;d++){let f=e[d],p=i[d],g=f.length;for(let y=0;y<g;y+=2){let b=f[y],v=f[y+1];if(y===0){l=b,u=v;continue}C.Nl(l,u,b,v,t.x,t.y,n);let w=(n.x-t.x)**2+(n.y-t.y)**2;w<o&&(o=w,r=a,r+=Math.sqrt((n.x-l)**2+(n.y-u)**2)),a+=p[(y-2)/2],l=b,u=v}}P.i(n);let c=r/s;return c<0?0:c>1?1:c}return 0}get flattenedSegments(){return this.tA(),this.kc}tA(){if(this.kc===null){let t=this.kc=[],e=this.Nu=[];this.oR(t,e)}}get flattenedLengths(){return this.tA(),this.Nu}get flattenedTotalLength(){let t=this.Cu;if(isNaN(t)){if(this.type===1){let e=Math.abs(this.endX-this.startX),i=Math.abs(this.endY-this.startY);t=Math.sqrt(e*e+i*i)}else if(this.type===2){let e=Math.abs(this.endX-this.startX),i=Math.abs(this.endY-this.startY);t=e*2+i*2}else{let e=this.flattenedLengths,i=e.length;t=0;for(let s=0;s<i;s++){let n=e[s],o=n.length;for(let r=0;r<o;r++)t+=n[r]}}this.Cu=t}return t}zP(t){let e=[],i=0,s=0,n=t.length;for(let o=0;o<n;o+=2){let r=t[o],a=t[o+1];if(o===0){i=r,s=a;continue}let h=Math.sqrt(P.distanceSquared(i,s,r,a));e.push(h),i=r,s=a}return e}oR(t,e){let i=[],s=[];if(this.type===1)i.push(this.startX),i.push(this.startY),i.push(this.endX),i.push(this.endY),t.push(i),s.push(Math.sqrt((this.startX-this.endX)**2+(this.startY-this.endY)**2)),e.push(s);else if(this.type===2)i.push(this.startX),i.push(this.startY),i.push(this.endX),i.push(this.startY),i.push(this.endX),i.push(this.endY),i.push(this.startX),i.push(this.endY),i.push(this.startX),i.push(this.startY),t.push(i),s.push(Math.abs(this.startX-this.endX)),s.push(Math.abs(this.startY-this.endY)),s.push(Math.abs(this.startX-this.endX)),s.push(Math.abs(this.startY-this.endY)),e.push(s);else if(this.type===3){let n=new Kt;n.startX=this.endX,n.startY=(this.startY+this.endY)/2;let o=new mt(5);o.startAngle=0,o.sweepAngle=360,o.centerX=(this.startX+this.endX)/2,o.centerY=(this.startY+this.endY)/2,o.radiusX=Math.abs(this.startX-this.endX)/2,o.radiusY=Math.abs(this.startY-this.endY)/2,n.add(o);let r=o.vo(n),a=r.length;if(a===0)i.push(o.centerX),i.push(o.centerY);else{let h=n.startX,l=n.startY;for(let u=0;u<a;u++){let c=r[u];C.jn(h,l,c[2],c[3],c[4],c[5],c[6],c[7],.5,i),h=c[6],l=c[7]}}t.push(i),e.push(this.zP(i))}else{let n=this.figures.iterator;for(;n.next();){let o=n.value;i=[],i.push(o.startX),i.push(o.startY);let r=o.startX,a=o.startY,h=r,l=a,u=o.segments.r,c=u.length;for(let d=0;d<c;d++){let f=u[d];switch(f.type){case 1:i.length>=4&&(t.push(i),e.push(this.zP(i))),i=[],i.push(f.endX),i.push(f.endY),r=f.endX,a=f.endY,h=r,l=a;break;case 2:i.push(f.endX),i.push(f.endY),r=f.endX,a=f.endY;break;case 3:C.jn(r,a,f.point1X,f.point1Y,f.point2X,f.point2Y,f.endX,f.endY,.5,i),r=f.endX,a=f.endY;break;case 4:C.nm(r,a,f.point1X,f.point1Y,f.endX,f.endY,.5,i),r=f.endX,a=f.endY;break;case 5:{let p=f.vo(o),g=p.length;if(g===0){i.push(f.centerX),i.push(f.centerY),r=f.centerX,a=f.centerY;break}for(let y=0;y<g;y++){let b=p[y];C.jn(r,a,b[2],b[3],b[4],b[5],b[6],b[7],.5,i),r=b[6],a=b[7]}break}case 6:{let p=f.Za(o,r,a),g=p.length,y=f.endX,b=f.endY;if(g===0){i.push(y),i.push(b),r=y,a=b;break}for(let v=0;v<g;v++){let w=p[v];C.jn(r,a,w[2],w[3],w[4],w[5],w[6],w[7],.5,i),r=w[6],a=w[7]}break}default:m.o("Segment not of valid type: "+f.type)}f.isClosed&&(i.push(h),i.push(l))}i.length>=4&&(t.push(i),e.push(this.zP(i)))}}}get type(){return this.W}set type(t){this.W!==t&&(this.u&&m.L(this,t),this.W=t,t===4?this.Gs=new q:(wt.hx===null&&(wt.hx=new q().k()),this.Gs=wt.hx),this.yt=!0)}get startX(){return this.Li}set startX(t){this.Li!==t&&(this.u&&m.L(this,t),this.Li=t,this.yt=!0)}get startY(){return this.Ai}set startY(t){this.Ai!==t&&(this.u&&m.L(this,t),this.Ai=t,this.yt=!0)}get endX(){return this.ni}set endX(t){this.ni!==t&&(this.u&&m.L(this,t),this.ni=t,this.yt=!0)}get endY(){return this.oi}set endY(t){this.oi!==t&&(this.u&&m.L(this,t),this.oi=t,this.yt=!0)}get figures(){return this.Gs}set figures(t){this.Gs!==t&&(this.u&&m.L(this,t),this.Gs=t,this.yt=!0)}add(t){return this.Gs.add(t),this}setSpots(t,e,i,s,n,o,r,a){return this.u&&m.L(this),this.Jn=new T(t,e,n,o),this.$n=new T(i,s,r,a),this}get spot1(){return this.Jn}set spot1(t){this.u&&m.L(this,t),this.Jn=t.N()}get spot2(){return this.$n}set spot2(t){this.u&&m.L(this,t),this.$n=t.N()}get defaultStretch(){return this.Zn}set defaultStretch(t){this.Zn=t}get bounds(){return this.UP()&&this.cx(),this.cm}polygonClosestSegment(t,e){if(e===void 0&&(e=10),this.type!==4)return null;let i=t.x,s=t.y,n=1/0,o=0,r=0,a=0,h=0,l=0,u=0,c=0,d=0;return this.figures.each(f=>{let p=f.startX,g=f.startY;f.segments.each(y=>{let b=y.endX,v=y.endY,w=0;if(y.type===2)w=P.distanceLineSegmentSquared(i,s,p,g,b,v);else{p=y.endX,g=y.endY;return}w<n&&(n=w,o=a,r=h,l=p,u=g,c=b,d=v),p=b,g=v,h++,y.isClosed&&(b=f.startX,v=f.startY,w=P.distanceLineSegmentSquared(i,s,p,g,b,v),w<n&&(n=w,o=a,r=h,l=p,u=g,c=b,d=v),h++)}),a++,h=0}),n<e*e?{figi:o,segi:r,ax:l,ay:u,bx:c,by:d}:null}get polygonArea(){if(this.type===4){let t=this.figures.iterator,e=0,i=0,s=0,n=0,o=0;for(;t.next();){let r=t.value;if(!r.isFilled)continue;e=r.startX,i=r.startY;let a=r.segments.iterator;for(;a.next();){let h=a.value;s=h.endX,n=h.endY,h.type===1||h.type!==5&&(o+=e*n-i*s),e=s,i=n}o+=e*r.startY-i*r.startX}return Math.abs(o)/2}else if(this.type===2){let t=Math.abs(this.startX-this.endX),e=Math.abs(this.startY-this.endY);return t*e}else if(this.type===3){let t=Math.abs(this.startX-this.endX),e=Math.abs(this.startY-this.endY);return Math.PI*t/2*e/2}else return 0}get polygonLength(){if(this.type===4){let t=this.figures.iterator,e=0,i=0,s=0,n=0,o=0;for(;t.next();){let r=t.value;e=r.startX,i=r.startY;let a=r.segments.iterator;for(;a.next();){let l=a.value;s=l.endX,n=l.endY,l.type===1||l.type!==5&&(o+=Math.sqrt((s-e)*(s-e)+(n-i)*(n-i))),e=s,i=n}let h=r.segments.last();h&&h.isClosed&&(s=r.startX,n=r.startY,o+=Math.sqrt((s-e)*(s-e)+(n-i)*(n-i)))}return o}else if(this.type===2){let t=Math.abs(this.startX-this.endX),e=Math.abs(this.startY-this.endY);return t*2+e*2}else if(this.type===3){let t=Math.abs(this.startX-this.endX)/2,e=Math.abs(this.startY-this.endY)/2;if(t+e===0)return 0;let i=(t-e)*(t-e)/((t+e)*(t+e)),s=i,n=1+s/4;return s*=i,n+=s/64,s*=i,n+=s/256,s*=i,n+=s*25/16384,s*=i,n+=s*49/65536,s*=i,n+=s*441/1048576,Math.PI*(t+e)*n}else{let t=this.startX,e=this.startY,i=this.endX,s=this.endY;return Math.sqrt((i-t)*(i-t)+(s-e)*(s-e))}}static computeConvexHull(t){t.sort((s,n)=>s.x===n.x?n.y-s.y:n.x-s.x);let e=[];for(let s=0;s<t.length;s++){for(;e.length>=2&&t[s].compareWithLineSegmentPoint(e[e.length-2],e[e.length-1])>=0;)e.pop();e.push(t[s])}e.pop();let i=[];for(let s=t.length-1;s>=0;s--){for(;i.length>=2&&t[s].compareWithLineSegmentPoint(i[i.length-2],i[i.length-1])>=0;)i.pop();i.push(t[s])}return i.pop(),e.concat(i)}static generatePolygon(t,e,i){e===void 0&&(e=0),i===void 0&&(i=!0);let s=new wt;if(t.length>1)if(e>0)if(i){t.push(t[0]),t.push(t[1]);let n=!0,o=new Kt(0,0,i,!1);for(let a=1;a<t.length;a++){let h=(t[a-1].x+t[a].x)/2,l=(t[a-1].y+t[a].y)/2,u=t[a-1].distanceSquaredPoint(t[a]),c=.5*e/Math.sqrt(u);if(c<.5){let d=t[a-1].x+(t[a].x-t[a-1].x)*c,f=t[a-1].y+(t[a].y-t[a-1].y)*c;if(n?(n=!1,o.startX=d,o.startY=f):o.add(new mt(3,d,f,t[a-1].x,t[a-1].y,t[a-1].x,t[a-1].y)),a<t.length-1){let p=t[a].x+(t[a-1].x-t[a].x)*c,g=t[a].y+(t[a-1].y-t[a].y)*c;o.add(new mt(2,p,g))}}else n?(n=!1,o.startX=h,o.startY=l):o.add(new mt(3,h,l,t[a-1].x,t[a-1].y,t[a-1].x,t[a-1].y))}let r=o.segments.last();r&&r.close(),s.add(o)}else{let n=new Kt(t[0].x,t[0].y,!1,!1);for(let o=1;o<t.length;o++){let r=(t[o-1].x+t[o].x)/2,a=(t[o-1].y+t[o].y)/2,h=t[o-1].distanceSquaredPoint(t[o]),l=.5*e/Math.sqrt(h);if(l<.5){if(o>1){let d=t[o-1].x+(t[o].x-t[o-1].x)*l,f=t[o-1].y+(t[o].y-t[o-1].y)*l;n.add(new mt(3,d,f,t[o-1].x,t[o-1].y,t[o-1].x,t[o-1].y))}let u=t[o].x+(t[o-1].x-t[o].x)*l,c=t[o].y+(t[o-1].y-t[o].y)*l;n.add(new mt(2,u,c))}else o>1&&n.add(new mt(3,r,a,t[o-1].x,t[o-1].y,t[o-1].x,t[o-1].y));o===t.length-1&&n.add(new mt(2,t[o].x,t[o].y))}s.add(n)}else{let n=new Kt(t[0].x,t[0].y,i,!1);for(let o=1;o<t.length;o++)n.add(new mt(2,t[o].x,t[o].y));if(i){let o=n.segments.last();o&&o.close()}s.add(n)}return s}}wt.stringify=wt.stringify,wt.stringifyFixed=wt.stringifyFixed,wt.fillPath=wt.fillPath,wt.parse=wt.parse;class Kt{n;Li;Ai;Mc;dm;Hi;constructor(t,e,i,s,n){i===void 0&&(i=!0),s===void 0&&(s=!0),n===void 0&&(n=!1),this.n=2|(i?4:0)|(s?8:0)|(n?16:0),t!==void 0?this.Li=t:this.Li=0,e!==void 0?this.Ai=e:this.Ai=0,this.Mc=new q,this.dm=this.Mc.rt,this.Hi=null}copy(){let t=new Kt;t.n=this.n&-2,t.Li=this.Li,t.Ai=this.Ai;let e=this.Mc.r,i=e.length,s=t.Mc;for(let n=0;n<i;n++){let o=e[n].copy();s.add(o)}return t.dm=this.dm,t.Hi=this.Hi,t}equalsApprox(t){if(!(t instanceof Kt)||!C.c(this.startX,t.startX)||!C.c(this.startY,t.startY))return!1;let e=this.segments.r,i=t.segments.r,s=e.length;if(s!==i.length)return!1;for(let n=0;n<s;n++){let o=e[n],r=i[n];if(!o.equalsApprox(r))return!1}return!0}toString(t){t===void 0&&(t=-1);let e="";if(t<0)e="M"+this.startX.toString()+" "+this.startY.toString();else{let n=o=>o===0?"0":o.toFixed(t);e="M"+n(this.startX)+" "+n(this.startY)}let i=this.segments.r,s=i.length;for(let n=0;n<s;n++){let o=i[n];e+=" "+o.toString(t)}return e}get u(){return(this.n&1)!==0}set u(t){t?this.n|=1:this.n&=-2}get yt(){return(this.n&2)!==0}set yt(t){t?this.n|=2:this.n&=-3}k(){this.u=!0;let t=this.segments;t.k();let e=t.r,i=t.length;for(let s=0;s<i;s++)e[s].k();return this}UP(){if(this.yt)return!0;let t=this.segments;if(this.dm!==t.rt)return!0;for(let e of t)if(e.yt)return!0;return!1}sR(){this.yt=!1,this.Hi=null;let t=this.segments;this.dm=t.rt;for(let e of t)e.yt=!1,e.Ks=null}get isFilled(){return(this.n&4)!==0}set isFilled(t){this.u&&m.L(this,t),t?this.n|=4:this.n&=-5}get isShadowed(){return(this.n&8)!==0}set isShadowed(t){this.u&&m.L(this,t),t?this.n|=8:this.n&=-9}get isEvenOdd(){return(this.n&16)!==0}set isEvenOdd(t){this.u&&m.L(this,t),t?this.n|=16:this.n&=-17}get startX(){return this.Li}set startX(t){this.u&&m.L(this,t),this.Li=t,this.Hi=null,this.yt=!0}get startY(){return this.Ai}set startY(t){this.u&&m.L(this,t),this.Ai=t,this.Hi=null,this.yt=!0}get segments(){return this.Mc}set segments(t){this.u&&m.L(this,t),this.Mc=t,this.Hi=null,this.yt=!0}add(t){return this.Mc.add(t),this.Hi=null,this}BP(t,e,i){let s=this,n=s.startX,o=s.startY,r=n,a=o,h=s.segments.r,l=h.length;for(let u=0;u<l;u++){let c=h[u];switch(c.type){case 1:r=c.endX,a=c.endY,n=c.endX,o=c.endY;break;case 2:if(C.Ve(n,o,c.endX,c.endY,i,t,e))return!0;n=c.endX,o=c.endY;break;case 3:if(C.nx(n,o,c.point1X,c.point1Y,c.point2X,c.point2Y,c.endX,c.endY,.5,t,e,i))return!0;n=c.endX,o=c.endY;break;case 4:if(C.IP(n,o,c.point1X,c.point1Y,c.endX,c.endY,.5,t,e,i))return!0;n=c.endX,o=c.endY;break;case 5:case 6:let d=c.type===5?c.vo(s):c.Za(s,n,o),f=d.length,p=c.type===5?c.centerX:c.endX,g=c.type===5?c.centerY:c.endY;if(f===0){if(C.Ve(n,o,p,g,i,t,e))return!0;n=p,o=g;break}let y=null;for(let b=0;b<f;b++)if(y=d[b],b===0&&C.Ve(n,o,y[0],y[1],i,t,e)||C.nx(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],.5,t,e,i))return!0;y!==null&&(n=y[6],o=y[7]);break;default:m.o("Unknown Segment type: "+c.type)}if(c.isClosed&&(n!==r||o!==a)&&C.Ve(n,o,r,a,i,t,e))return!0}return!1}}var ni=(x=>(x[x.Move=1]="Move",x[x.Line=2]="Line",x[x.Bezier=3]="Bezier",x[x.QuadraticBezier=4]="QuadraticBezier",x[x.Arc=5]="Arc",x[x.SvgArc=6]="SvgArc",x))(ni||{});class mt{W;n;ni;oi;mn;Ll;Al;xr;Ks;constructor(t,e,i,s,n,o,r,a){if(V.Je(this),t===void 0&&(t=2),this.W=t,this.n=2,e!==void 0?this.ni=e:this.ni=0,i!==void 0?this.oi=i:this.oi=0,s===void 0&&(s=0),n===void 0&&(n=0),o===void 0&&(o=0),r===void 0&&(r=0),t===6){let h=o;h=h%360,h<0&&(h+=360),this.mn=h,this.Ll=0,this.Al=Math.max(s,0),this.xr=Math.max(n,0),typeof r=="boolean"?r&&(this.isLargeArc=!0):typeof r=="number"&&r&&(this.isLargeArc=!0),a&&(this.isClockwiseArc=!0)}else this.mn=s,this.Ll=n,t===5&&(o=Math.max(o,0)),this.Al=o,typeof r=="number"?(t===5&&(r=Math.max(r,0)),this.xr=r):this.xr=0;this.Ks=null}copy(){let t=new mt;return t.W=this.W,t.n=this.n&-2,t.ni=this.ni,t.oi=this.oi,t.mn=this.mn,t.Ll=this.Ll,t.Al=this.Al,t.xr=this.xr,t}equalsApprox(t){if(!(t instanceof mt)||this.type!==t.type||this.isClosed!==t.isClosed)return!1;switch(this.type){case 1:case 2:return C.c(this.endX,t.endX)&&C.c(this.endY,t.endY);case 3:return C.c(this.endX,t.endX)&&C.c(this.endY,t.endY)&&C.c(this.point1X,t.point1X)&&C.c(this.point1Y,t.point1Y)&&C.c(this.point2X,t.point2X)&&C.c(this.point2Y,t.point2Y);case 4:return C.c(this.endX,t.endX)&&C.c(this.endY,t.endY)&&C.c(this.point1X,t.point1X)&&C.c(this.point1Y,t.point1Y);case 5:return C.c(this.startAngle,t.startAngle)&&C.c(this.sweepAngle,t.sweepAngle)&&C.c(this.centerX,t.centerX)&&C.c(this.centerY,t.centerY)&&C.c(this.radiusX,t.radiusX)&&C.c(this.radiusY,t.radiusY);case 6:return this.isClockwiseArc===t.isClockwiseArc&&this.isLargeArc===t.isLargeArc&&C.c(this.xAxisRotation,t.xAxisRotation)&&C.c(this.endX,t.endX)&&C.c(this.endY,t.endY)&&C.c(this.radiusX,t.radiusX)&&C.c(this.radiusY,t.radiusY);default:return!1}}fe(t){t in ni?this.type=t:m.ur(this,t)}toString(t){t===void 0&&(t=-1);let e=s=>s===0?"0":s.toFixed(t),i="";switch(this.type){case 1:t<0?i="M"+this.endX.toString()+" "+this.endY.toString():i="M"+e(this.endX)+" "+e(this.endY);break;case 2:t<0?i="L"+this.endX.toString()+" "+this.endY.toString():i="L"+e(this.endX)+" "+e(this.endY);break;case 3:t<0?i="C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():i="C"+e(this.point1X)+" "+e(this.point1Y)+" "+e(this.point2X)+" "+e(this.point2Y)+" "+e(this.endX)+" "+e(this.endY);break;case 4:t<0?i="Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():i="Q"+e(this.point1X)+" "+e(this.point1Y)+" "+e(this.endX)+" "+e(this.endY);break;case 5:t<0?i="B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():i="B"+e(this.startAngle)+" "+e(this.sweepAngle)+" "+e(this.centerX)+" "+e(this.centerY)+" "+e(this.radiusX)+" "+e(this.radiusY);break;case 6:t<0?i="A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():i="A"+e(this.radiusX)+" "+e(this.radiusY)+" "+e(this.xAxisRotation)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+e(this.endX)+" "+e(this.endY);break;default:i=ni[this.type]}return i+(this.isClosed?"z":"")}static Move=1;static Line=2;static Bezier=3;static QuadraticBezier=4;static Arc=5;static SvgArc=6;get u(){return(this.n&1)!==0}set u(t){t?this.n|=1:this.n&=-2}get yt(){return(this.n&2)!==0}set yt(t){t?this.n|=2:this.n&=-3}k(){return this.u=!0,this}close(){return this.isClosed=!0,this}vo(t){if(this.Ks!==null&&t.yt===!1)return this.Ks;let e=this.radiusX,i=this.radiusY;if(i===void 0&&(i=e),e===0||i===0)return this.Ks=[],this.Ks;let s=this.mn,n=this.Ll,o=C.qL(0,0,e<i?e:i,this.startAngle,this.startAngle+this.sweepAngle,!1);if(e!==i){let a=Nt.l();a.Ue(),e<i?a.it(1,i/e):a.it(e/i,1),wt.ZL(o,a),Nt.i(a)}let r=o.length;for(let a=0;a<r;a++){let h=o[a];h[0]+=s,h[1]+=n,h[2]+=s,h[3]+=n,h[4]+=s,h[5]+=n,h[6]+=s,h[7]+=n}return this.Ks=o,this.Ks}Za(t,e,i){if(this.Ks!==null&&t.yt===!1)return this.Ks;if(this.radiusX===0||this.radiusY===0)return this.Ks=[],this.Ks;let s=e,n=i,o=this.Al,r=this.xr;o===0&&(o=1e-4),r===0&&(r=1e-4);let a=this.mn*(Math.PI/180),h=this.isLargeArc,l=this.isClockwiseArc,u=this.ni,c=this.oi,d=Math.cos(a),f=Math.sin(a),p=d*(s-u)/2+f*(n-c)/2,g=-f*(s-u)/2+d*(n-c)/2,y=p*p/(o*o)+g*g/(r*r);y>1&&(o*=Math.sqrt(y),r*=Math.sqrt(y));let b=(h===l?-1:1)*Math.sqrt((o*o*r*r-o*o*g*g-r*r*p*p)/(o*o*g*g+r*r*p*p));isNaN(b)&&(b=0);let v=b*o*g/r,w=b*-r*p/o;isNaN(v)&&(v=0),isNaN(w)&&(w=0);let k=(s+u)/2+d*v-f*w,S=(n+c)/2+f*v+d*w,N=(it,_)=>Math.sqrt(it*it+_*_),D=(it,_,at,ct)=>(it*at+_*ct)/(N(it,_)*N(at,ct)),L=(it,_,at,ct)=>(it*ct<_*at?-1:1)*Math.acos(D(it,_,at,ct)),M=L(1,0,(p-v)/o,(g-w)/r),A=(p-v)/o,F=(g-w)/r,O=(-p-v)/o,E=(-g-w)/r,B=L(A,F,O,E),K=D(A,F,O,E);K<=-1?B=Math.PI:K>=1&&(B=0),!l&&B>0&&(B=B-2*Math.PI),l&&B<0&&(B=B+2*Math.PI);let z=o>r?o:r,U=o>r?1:o/r,tt=o>r?r/o:1,nt=C.qL(0,0,z,M,M+B,!0),Z=Nt.l();return Z.Ue(),Z.Xs(k,S),Z.ks(this.mn,0,0),Z.it(U,tt),wt.ZL(nt,Z),Nt.i(Z),this.Ks=nt,this.Ks}get isClosed(){return(this.n&8)!==0}set isClosed(t){this.isClosed!==t&&(t?this.n|=8:this.n&=-9,this.yt=!0)}get type(){return this.W}set type(t){this.u&&m.L(this,t),this.W=t,this.yt=!0}get endX(){return this.ni}set endX(t){this.u&&m.L(this,t),this.ni=t,this.yt=!0}get endY(){return this.oi}set endY(t){this.u&&m.L(this,t),this.oi=t,this.yt=!0}get point1X(){return this.mn}set point1X(t){this.u&&m.L(this,t),this.mn=t,this.yt=!0}get point1Y(){return this.Ll}set point1Y(t){this.u&&m.L(this,t),this.Ll=t,this.yt=!0}get point2X(){return this.Al}set point2X(t){this.u&&m.L(this,t),this.Al=t,this.yt=!0}get point2Y(){return this.xr}set point2Y(t){this.u&&m.L(this,t),this.xr=t,this.yt=!0}get centerX(){return this.mn}set centerX(t){this.u&&m.L(this,t),this.mn=t,this.yt=!0}get centerY(){return this.Ll}set centerY(t){this.u&&m.L(this,t),this.Ll=t,this.yt=!0}get radiusX(){return this.Al}set radiusX(t){t<0&&m.J(t,">= zero",mt,"radiusX"),this.u&&m.L(this,t),this.Al=t,this.yt=!0}get radiusY(){return this.xr}set radiusY(t){t<0&&m.J(t,">= zero",mt,"radiusY"),this.u&&m.L(this,t),this.xr=t,this.yt=!0}get startAngle(){return this.ni}set startAngle(t){this.u&&m.L(this,t),t=t%360,t<0&&(t+=360),this.ni=t,this.yt=!0}get sweepAngle(){return this.oi}set sweepAngle(t){this.u&&m.L(this,t),t>360&&(t=360),t<-360&&(t=-360),this.oi=t,this.yt=!0}get isClockwiseArc(){return(this.n&4)!==0}set isClockwiseArc(t){this.u&&m.L(this,t),t?this.n|=4:this.n&=-5,this.yt=!0}get isLargeArc(){return(this.n&16)!==0}set isLargeArc(t){this.u&&m.L(this,t),t?this.n|=16:this.n&=-17,this.yt=!0}get xAxisRotation(){return this.mn}set xAxisRotation(t){this.u&&m.L(this,t),t=t%360,t<0&&(t+=360),this.mn=t,this.yt=!0}}class Qt{a;ux;gx;gm;mm;pm;ym;wm;xm;bm;km;Pm;Sm;Mm;Fo;Nm;Cm;Ps;Ti;constructor(){this.a=null,this.ux=new P(0,0).k(),this.gx=new P(0,0).k(),this.gm=0,this.mm=0,this.pm=1,this.ym="",this.wm="",this.xm=!1,this.bm=!1,this.km=0,this.Pm=0,this.Sm=!1,this.Mm=!1,this.Fo=!1,this.Nm=null,this.Cm=0,this.Ps=null,this.Ti=null}copy(){let t=new Qt;return this.clone(t)}clone(t){return t.a=this.a,t.ux.h(this.viewPoint),t.gx.h(this.documentPoint),t.gm=this.gm,t.mm=this.mm,t.pm=this.pm,t.ym=this.ym,t.wm=this.wm,t.xm=this.xm,t.bm=this.bm,t.km=this.km,t.Pm=this.Pm,t.Sm=this.Sm,t.Mm=this.Mm,t.Fo=this.Fo,t.Nm=this.Nm,t.Cm=this.Cm,t.Ps=this.Ps,t.Ti=this.Ti,t}toString(){let t="^";return this.modifiers!==0&&(t+="M:"+this.modifiers),this.button!==0&&(t+="B:"+this.button),this.key!==""&&(t+="K:"+this.key),this.clickCount!==0&&(t+="C:"+this.clickCount),this.delta!==0&&(t+="D:"+this.delta),this.handled&&(t+="h"),this.bubbles&&(t+="b"),this.documentPoint!==null&&(t+="@"+this.documentPoint.toString()),t}get diagram(){return this.a}set diagram(t){this.a=t}get viewPoint(){return this.ux}set viewPoint(t){this.ux.h(t)}get documentPoint(){return this.gx}set documentPoint(t){this.gx.h(t)}getMultiTouchViewPoint(t,e){let i=this.diagram;return i===null||i.eA(this.event,t,e),e}getMultiTouchDocumentPoint(t,e){let i=this.diagram;return i===null||(i.eA(this.event,t,e),e.h(i.transformViewToDoc(e))),e}get modifiers(){return this.gm}set modifiers(t){this.gm=t}get button(){return this.mm}set button(t){if(this.mm=t,this.event===null)switch(t){case 0:this.buttons=1;return;case 1:this.buttons=4;return;case 2:this.buttons=2;return}}get buttons(){return this.pm}set buttons(t){this.pm=t}get key(){return this.ym}set key(t){this.ym=t}get code(){return this.wm}set code(t){this.wm=t}get down(){return this.xm}set down(t){this.xm=t}get up(){return this.bm}set up(t){this.bm=t}get clickCount(){return this.km}set clickCount(t){this.km=t}get delta(){return this.Pm}set delta(t){this.Pm=t}get isMultiTouch(){return this.Sm}set isMultiTouch(t){this.Sm=t}get handled(){return this.Mm}set handled(t){this.Mm=t}get bubbles(){return this.Fo}set bubbles(t){this.Fo=t}get event(){return this.Nm}set event(t){this.Nm=t}get isTouchEvent(){let t=this.event;return t===null?!1:t.pointerType==="touch"||t.pointerType==="pen"}get timestamp(){return this.Cm}set timestamp(t){this.Cm=t}get targetDiagram(){return this.Ps}set targetDiagram(t){this.Ps=t}get targetObject(){return this.Ti}set targetObject(t){this.Ti=t}get control(){return(this.modifiers&1)!==0}set control(t){this.modifiers=t?this.modifiers|1:this.modifiers&-2}get shift(){return(this.modifiers&4)!==0}set shift(t){this.modifiers=t?this.modifiers|4:this.modifiers&-5}get alt(){return(this.modifiers&2)!==0}set alt(t){this.modifiers=t?this.modifiers|2:this.modifiers&-3}get meta(){return(this.modifiers&8)!==0}set meta(t){this.modifiers=t?this.modifiers|8:this.modifiers&-9}get left(){let t=this.event;return t!==null&&(t.type==="mousedown"||t.type==="mouseup"||t.type==="pointerdown"||t.type==="pointerup")?this.button===0:(this.buttons&1)!==0}set left(t){t?this.buttons|=1:this.buttons&=-2}get right(){let t=this.event;return t!==null&&(t.type==="mousedown"||t.type==="mouseup"||t.type==="pointerdown"||t.type==="pointerup")?this.button===2:(this.buttons&2)!==0}set right(t){t?this.buttons|=2:this.buttons&=-3}get middle(){let t=this.event;return t!==null&&(t.type==="mousedown"||t.type==="mouseup"||t.type==="pointerdown"||t.type==="pointerup")?this.button===1:(this.buttons&4)!==0}set middle(t){t?this.buttons|=4:this.buttons&=-5}get commandKey(){let t=this.code,e=this.key;return"cxvyzagCXVYZAG".includes(e)?e.toLowerCase():t==="KeyC"?"c":t==="KeyX"?"x":t==="KeyV"?"v":t==="KeyY"?"y":t==="KeyZ"?"z":t==="KeyA"?"a":t==="KeyG"?"g":t!==""?t:e}}class wi{a;Pt;Lm;Am;constructor(){this.a=null,this.Pt="",this.Lm=null,this.Am=null}copy(){let t=new wi;return t.a=this.a,t.Pt=this.Pt,t.Lm=this.Lm,t.Am=this.Am,t}toString(){let t="*"+this.name;return this.subject!==null&&(t+=":"+this.subject.toString()),this.parameter!==null&&(t+="("+this.parameter.toString()+")"),t}get diagram(){return this.a}set diagram(t){this.a=t}get name(){return this.Pt}set name(t){this.Pt=t}get subject(){return this.Lm}set subject(t){this.Lm=t}get parameter(){return this.Am}set parameter(t){this.Am=t}}var Ei=(x=>(x[x.Transaction=1]="Transaction",x[x.Property=2]="Property",x[x.Insert=3]="Insert",x[x.Remove=4]="Remove",x))(Ei||{});class Xe{Tu;Tm;pn;Ce;a;Du;Nc;Cc;Lc;Ac;constructor(){this.Tu=2,this.Tm="",this.pn="",this.Ce=null,this.a=null,this.Du=null,this.Nc=null,this.Cc=null,this.Lc=null,this.Ac=null}static Transaction=1;static Property=2;static Insert=3;static Remove=4;clear(){this.Ce=null,this.a=null,this.Du=null,this.Nc=null,this.Cc=null,this.Lc=null,this.Ac=null}copy(){let t=new Xe;t.Tu=this.Tu,t.Tm=this.Tm,t.pn=this.pn,t.Ce=this.Ce,t.a=this.a,t.Du=this.Du;let e=this.Nc;return m.$(e)&&m.st(e.copyFrozen)?t.Nc=e.copyFrozen():t.Nc=e,e=this.Cc,m.$(e)&&m.st(e.copyFrozen)?t.Cc=e.copyFrozen():t.Cc=e,e=this.Lc,m.$(e)&&m.st(e.copyFrozen)?t.Lc=e.copyFrozen():t.Lc=e,e=this.Ac,m.$(e)&&m.st(e.copyFrozen)?t.Ac=e.copyFrozen():t.Ac=e,t}fe(t){t in Ei?this.change=t:m.ur(this,t)}toString(){let t="";return this.change===1?t+="* ":this.change===2?t+=this.model!==null?"!m":"!d":t+=(this.model!==null?"!m":"!d")+this.change,this.propertyName&&typeof this.propertyName=="string"&&(t+=" "+this.propertyName),this.modelChange&&this.modelChange!==this.propertyName&&(t+=" "+this.modelChange),t+=": ",this.change===1?this.oldValue!==null&&(t+=" "+this.oldValue):(this.object!==null&&(t+=m.toString(this.object)),this.oldValue!==null&&(t+=" old: "+m.toString(this.oldValue)),this.oldParam!==null&&(t+=" "+this.oldParam),this.newValue!==null&&(t+=" new: "+m.toString(this.newValue)),this.newParam!==null&&(t+=" "+this.newParam)),t}getValue(t){return t?this.oldValue:this.newValue}getParam(t){return t?this.oldParam:this.newParam}canUndo(){return this.model!==null||this.diagram!==null}undo(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.iA(this,!0))}canRedo(){return this.model!==null||this.diagram!==null}redo(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.iA(this,!1))}get model(){return this.Ce}set model(t){this.Ce=t}get diagram(){return this.a}set diagram(t){this.a=t}get change(){return this.Tu}set change(t){this.Tu=t}get modelChange(){return this.Tm}set modelChange(t){this.Tm=t}get propertyName(){return this.pn}set propertyName(t){this.pn=t}get isTransactionFinished(){return this.Tu===1&&(this.pn==="CommittedTransaction"||this.pn==="FinishedUndo"||this.pn==="FinishedRedo")}get object(){return this.Du}set object(t){this.Du=t}get oldValue(){return this.Nc}set oldValue(t){this.Nc=t}get oldParam(){return this.Cc}set oldParam(t){this.Cc=t}get newValue(){return this.Lc}set newValue(t){this.Lc=t}get newParam(){return this.Ac}set newParam(t){this.Ac=t}}class oi{sA;Pt;XP;constructor(){this.sA=new q().k(),this.Pt="",this.XP=!1}toString(t){let e="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(t!==void 0&&t>0){let i=this.changes.count;for(let s=0;s<i;s++){let n=this.changes.elt(s);n!==null&&(e+=`
|
|
4
4
|
`+n.toString())}}return e}clear(){let t=this.changes;t.ce();for(let e=t.count-1;e>=0;e--){let i=t.elt(e);i!==null&&i.clear()}t.clear(),t.k()}canUndo(){return this.isComplete}undo(){if(this.canUndo())for(let t=this.changes.count-1;t>=0;t--){let e=this.changes.elt(t);e!==null&&e.undo()}}canRedo(){return this.isComplete}redo(){if(!this.canRedo())return;let t=this.changes.count;for(let e=0;e<t;e++){let i=this.changes.elt(e);i!==null&&i.redo()}}rR(t){let e=this.changes;for(let i=e.count-1;i>=t;i--){let s=e.elt(i);s!==null&&s.undo(),e.ce(),e.removeAt(i)}e.k()}thaw(){this.changes.ce()}optimize(){if(!this.isComplete)return;let t=this.changes;t.ce();let e=new Map;for(let s=0;s<t.count;s++){let n=t.elt(s);if(n===null||n.change!==2||!n.object)continue;let o=e.get(n.object);o||(o=new Map,e.set(n.object,o));let r=o.get(n.propertyName);r===void 0?o.set(n.propertyName,-1):(r>0&&t.setElt(r,null),o.set(n.propertyName,s))}let i=0;for(let s=0;s<t.count;s++){let n=t.elt(s);n!==null&&(s>i&&t.setElt(i,n),i++)}for(;t.length>i;)t.pop();t.k()}get changes(){return this.sA}get name(){return this.Pt}set name(t){this.Pt=t}get isComplete(){return this.XP}set isComplete(t){this.XP=t}}class vi{mx;Be;nA;Hs;GP;Dm;Tl;YP;KP;yn;Tc;yx;qs;wx;xx;vm;kx;constructor(t){this.mx=new V,this.Be=!1,this.nA=new q().k(),this.Hs=-1,this.GP=999,this.qs=!1,this.Dm=null,this.Tl=0,this.YP=!1,this.KP=23,this.yn=new q().k(),this.Tc=new q,this.yx=!0,this.wx=!1,this.xx=!1,this.vm=!1,this.kx=!1,t&&Object.assign(this,t)}toString(t){let e="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;e+="[";let i=this.nestedTransactionNames.count;for(let s=0;s<i;s++)s>0&&(e+=" "),e+=this.nestedTransactionNames.elt(s);if(e+="]",t!==void 0&&t>0){i=this.history.count;for(let s=0;s<i;s++)e+=`
|
|
5
5
|
`+this.history.elt(s).toString(t-1)}return e}clear(){let t=this.history;t.ce();for(let e=t.count-1;e>=0;e--){let i=t.elt(e);i!==null&&i.clear()}t.clear(),this.Hs=-1,t.k(),this.qs=!1,this.Dm=null,this.Tl=0,this.yn.ce(),this.yn.clear(),this.yn.k(),this.Tc.clear(),this.wx=!1,this.xx=!1,this.vm=!1,this.kx=!1}copyProperties(t){this.isEnabled=t.isEnabled,this.maxHistoryLength=t.maxHistoryLength,this.Fm=t.Fm}addModel(t){this.mx.add(t)}removeModel(t){this.mx.delete(t)}startTransaction(t){if(t===void 0&&(t=""),t===null&&(t=""),this.isUndoingRedoing)return!1;this.yx===!0&&(this.yx=!1,this.Tl++,this.Dl||this.vl("StartingFirstTransaction",t,this.currentTransaction),this.Tl>0&&this.Tl--),this.isEnabled&&(this.yn.ce(),this.yn.add(t),this.yn.k(),this.currentTransaction===null?this.Tc.add(0):this.Tc.add(this.currentTransaction.changes.count)),this.Tl++;let e=this.transactionLevel===1;return e&&(this.Dl||this.vl("StartedTransaction",t,this.currentTransaction)),e}commitTransaction(t){return t===void 0&&(t=""),this.oA(!0,t)}rollbackTransaction(){return this.oA(!1,"")}oA(t,e){if(this.isUndoingRedoing)return!1;this.Fm&&this.transactionLevel<1&&m.ne("Ending transaction without having started a transaction: "+e);let i=this.transactionLevel===1,s=this.currentTransaction;i&&t&&(this.Dl||this.vl("CommittingTransaction",e,s));let n=0;if(this.transactionLevel>0&&(this.Tl--,this.isEnabled)){let o=this.yn.count;o>0&&(e===""&&(e=this.yn.elt(0)),this.yn.ce(),this.yn.removeAt(o-1),this.yn.k());let r=this.Tc.count;r>0&&(n=this.Tc.elt(r-1),this.Tc.removeAt(r-1))}if(i){if(t){if(this.vm=!1,s===null&&e!==""&&(s=this.currentTransaction),this.isEnabled&&s!==null){let o=s;o.isComplete||(o.isComplete=!0,o.name=e),this.discardHistoryAfterIndex();let r=this.history;r.ce();let a=this.maxHistoryLength;if(a>=0){if(a===0)r.clear();else if(r.count>=a){let h=r.elt(0);h!==null&&h.clear(),r.removeAt(0),this.Hs--}}a!==0&&(r.count===0||r.get(r.count-1)!==o)&&(r.add(o),this.Hs++),r.k(),s=o}this.Dl||this.vl("CommittedTransaction",e,s)}else{this.qs=!0;try{this.isEnabled&&s!==null&&(s.isComplete=!0,s.undo())}finally{this.Dl||this.vl("RolledBackTransaction",e,s),this.qs=!1}s!==null&&s.clear()}return this.Dm=null,this.Px&&this.clear(),this.Px=!1,this.Sx=!1,!0}else return this.isEnabled&&!t&&s!==null&&s.rR(n),!1}discardHistoryAfterIndex(){if(this.isUndoingRedoing||!this.canRedo())return;let t=this.history;t.ce();for(let e=t.count-1;e>this.historyIndex;e--){let i=t.elt(e);i!==null&&i.clear(),t.removeAt(e),this.vm=!0}t.k()}thaw(){this.history.ce()}canUndo(){if(!this.isEnabled||this.transactionLevel>0)return!1;let t=this.transactionToUndo;return!!(t!==null&&t.canUndo())}undo(){if(!this.canUndo())return;let t=this.transactionToUndo;if(t!==null)try{this.qs=!0,this.vl("StartingUndo","Undo",t),this.Hs--,t.undo()}catch(e){m.ne("undo error: "+e.toString())}finally{this.vl("FinishedUndo","Undo",t),this.qs=!1}}canRedo(){if(!this.isEnabled||this.transactionLevel>0)return!1;let t=this.transactionToRedo;return!!(t!==null&&t.canRedo())}redo(){if(!this.canRedo())return;let t=this.transactionToRedo;if(t!==null)try{this.qs=!0,this.vl("StartingRedo","Redo",t),this.Hs++,t.redo()}catch(e){m.ne("redo error: "+e.toString())}finally{this.vl("FinishedRedo","Redo",t),this.qs=!1}}vl(t,e,i){let s=new Xe;s.change=1,s.propertyName=t,s.object=i,s.oldValue=e;let n=this.models;for(;n.next();){let o=n.value;s.model=o,o.lR(s)}}handleChanged(t){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(t)){let e=this.currentTransaction;e===null&&(e=new oi,this.Dm=e);let i=t.copy(),s=e.changes;if(s.ce(),s.add(i),s.k(),this.Fm&&this.KP>0&&this.transactionLevel<=0&&!this.yx){let n=t.diagram;if(n!==null&&n.Qa===!1)return;m.ne("Change not within a transaction: "+i.toString()),this.KP--}}}skipsEvent(t){if(t===null||t.change===1)return!0;let e=t.object;if(e===null)return!1;if(e.layer!==void 0){let i=e.layer;if(i!==null&&i.isTemporary)return!0}else if(e.isTemporary)return!0;return!1}get models(){return this.mx.iterator}get isEnabled(){return this.Be}set isEnabled(t){this.Be=t}get transactionToUndo(){return this.historyIndex>=0&&this.historyIndex<=this.history.count-1?this.history.elt(this.historyIndex):null}get transactionToRedo(){return this.historyIndex<this.history.count-1?this.history.elt(this.historyIndex+1):null}get isUndoingRedoing(){return this.qs}get history(){return this.nA}get maxHistoryLength(){return this.GP}set maxHistoryLength(t){this.GP=t}get historyIndex(){return this.Hs}get currentTransaction(){return this.Dm}get transactionLevel(){return this.Tl}get isInTransaction(){return this.Tl>0}get Fm(){return this.YP}set Fm(t){this.YP=t}get nestedTransactionNames(){return this.yn}get Px(){return this.wx}set Px(t){this.wx=t}get Sx(){return this.xx}set Sx(t){this.xx=t}get Dl(){return this.kx}set Dl(t){this.kx=t}get isJustDiscarded(){return this.vm}}class $t{a;Pt;Be;HP;qP;Rm;rA;constructor(){V.Je(this),this.a=Y.Om(),this.Pt="",this.Be=!0,this.HP=!1,this.qP=null,this.rA=new Qt,this.Rm=-1}get diagram(){return this.a}set diagram(t){t instanceof Y&&(this.a=t)}toString(){return this.name!==""?this.name+" Tool":m.Kn(this.constructor)}updateAdornments(t){}canStart(){return this.isEnabled}doStart(){}doActivate(){this.isActive=!0}doDeactivate(){this.isActive=!1}doStop(){}doCancel(){this.transactionResult=null,this.stopTool()}stopTool(){let t=this.diagram;t.currentTool===this&&(t.currentTool=null,t.currentCursor="")}doMouseDown(){!this.isActive&&this.canStart()&&this.doActivate()}doMouseMove(){}doMouseUp(){this.stopTool()}doMouseWheel(){}canStartMultiTouch(){return!0}standardPinchZoomStart(){let t=this.diagram,e=t.lastInput,i=e.getMultiTouchViewPoint(0,P.z(NaN,NaN)),s=e.getMultiTouchViewPoint(1,P.z(NaN,NaN));if(!i.isReal()||!s.isReal()){P.i(i),P.i(s);return}if(this.doCancel(),t.getInputOption("hasGestureZoom")){t.jP=t.scale;let n=s.x-i.x,o=s.y-i.y,r=Math.sqrt(n*n+o*o);t.WP=r,e.bubbles=!1}P.i(i),P.i(s)}standardPinchZoomMove(){let t=this.diagram,e=t.lastInput,i=e.getMultiTouchViewPoint(0,P.z(NaN,NaN)),s=e.getMultiTouchViewPoint(1,P.z(NaN,NaN));if(!i.isReal()||!s.isReal()){P.i(i),P.i(s);return}if(this.doCancel(),t.getInputOption("hasGestureZoom")){let n=s.x-i.x,o=s.y-i.y,r=Math.sqrt(n*n+o*o)/t.WP,a=new P((Math.min(s.x,i.x)+Math.max(s.x,i.x))/2,(Math.min(s.y,i.y)+Math.max(s.y,i.y))/2),h=t.jP*r,l=t.commandHandler;if(h!==t.scale&&l.canResetZoom(h)){let u=t.zoomPoint;t.zoomPoint=a,l.resetZoom(h),t.zoomPoint=u}e.bubbles=!1}P.i(i),P.i(s)}doKeyDown(){this.diagram.lastInput.code==="Escape"&&this.doCancel()}doKeyUp(){}startTransaction(t){return t===void 0&&(t=this.name),this.transactionResult=null,this.diagram.startTransaction(t)}stopTransaction(){let t=this.diagram;return this.transactionResult===null?t.rollbackTransaction():t.commitTransaction(this.transactionResult)}standardMouseSelect(){let t=this.diagram;if(!t.allowSelect)return;let e=t.lastInput,i=t.findPartAt(e.documentPoint,!1);if(i!==null){if(m.fr?e.meta:e.control){t.T("ChangingSelection",t.selection);let s=i;for(;s!==null&&!s.canSelect();)s=s.containingGroup;s!==null&&(s.isSelected=!s.isSelected),t.T("ChangedSelection",t.selection)}else if(e.shift){if(!i.isSelected){t.T("ChangingSelection",t.selection);let s=i;for(;s!==null&&!s.canSelect();)s=s.containingGroup;s!==null&&(s.isSelected=!0),t.T("ChangedSelection",t.selection)}}else if(!i.isSelected){let s=i;for(;s!==null&&!s.canSelect();)s=s.containingGroup;s!==null&&t.select(s)}}else e.left&&!(m.fr?e.meta:e.control)&&!e.shift&&t.clearSelection()}standardMouseClick(t,e){t===void 0&&(t=null),e===void 0&&(e=o=>!o.layer?.isTemporary);let i=this.diagram,s=i.lastInput,n=i.findObjectAt(s.documentPoint,t,e);return s.targetObject=n,this.lA(n,s,i)}lA(t,e,i){if(e.handled=!1,t!==null&&!t.isEnabledObject())return!1;let s=0;e.left?e.clickCount===1?s=1:e.clickCount===2?s=2:s=1:e.right&&e.clickCount===1&&(s=3);let n="ObjectSingleClicked";if(t!==null){switch(s){case 1:n="ObjectSingleClicked";break;case 2:n="ObjectDoubleClicked";break;case 3:n="ObjectContextClicked";break}s!==0&&i.T(n,t)}else{switch(s){case 1:n="BackgroundSingleClicked";break;case 2:n="BackgroundDoubleClicked";break;case 3:n="BackgroundContextClicked";break}s!==0&&i.T(n)}if(t!==null)for(;t!==null;){let o=null;switch(s){case 1:o=t.click;break;case 2:o=t.doubleClick?t.doubleClick:t.click;break;case 3:o=t.contextClick;break}if(o!==null&&(o(e,t),e.handled))break;t=t.panel}else{let o=null;switch(s){case 1:o=i.click;break;case 2:o=i.doubleClick?i.doubleClick:i.click;break;case 3:o=i.contextClick;break}o!==null&&o(e)}return e.handled}standardMouseOver(){let t=this.diagram,e=t.lastInput;if(t.animationManager.ke===!0)return;let i=t.skipsUndoManager;t.skipsUndoManager=!0;let s=t.viewportBounds.containsPoint(e.documentPoint)?t.findObjectAt(e.documentPoint,null,null):null;e.event&&(e.event.type==="pointercancel"||e.event.type==="pointerout")&&(s=null),e.targetObject=s;let n=!1;if(s!==t.Dc){let o=t.Dc,r=o;for(t.Dc=s,this.aA(o,s),e.handled=!1;o!==null;){let a=o.mouseLeave;if(a!==null&&(s===o||s!==null&&s.isContainedBy(o)||(a(e,o,s),n=!0,e.handled)))break;o=o.panel}for(o=r,e.handled=!1;s!==null;){let a=s.mouseEnter;if(a!==null&&(o===s||o!==null&&o.isContainedBy(s)||(a(e,s,o),n=!0,e.handled)))break;s=s.panel}s=t.Dc}if(s!==null){let o=s,r="";for(;o!==null&&(r=o.cursor,r==="");)o=o.panel;for(t.currentCursor=r,e.handled=!1,o=s;o!==null;){let a=o.mouseOver;if(a!==null&&(a(e,o),n=!0,e.handled))break;o=o.panel}}else{this.doUpdateCursor(null);let o=t.mouseOver;o!==null&&(o(e),n=!0)}n&&t.requestUpdate(),t.skipsUndoManager=i}doUpdateCursor(t){let e=this.diagram;e&&(e.currentCursor="")}aA(t,e){}standardMouseWheel(){let t=this.diagram,e=t.lastInput,i=e.delta;if(i===0||!t.documentBounds.isReal())return;let s=t.commandHandler,n=t.toolManager.mouseWheelBehavior;if(s!==null&&(n===2&&!e.shift||n===1&&e.control)){if(i>0?s.canIncreaseZoom():s.canDecreaseZoom()){let o=t.zoomPoint;t.zoomPoint=e.viewPoint,i>0?s.increaseZoom():s.decreaseZoom(),t.zoomPoint=o}e.bubbles=!1}else if(n===2&&e.shift||n===1&&!e.control){let o=t.position.copy(),r=e.event,a=r.deltaMode,h=r.deltaX,l=r.deltaY,u="pixel";if((h!==0||l!==0)&&!e.shift){switch(a){case 0:u="pixel";break;case 1:u="line";break;case 2:u="page";break}if(h!==0&&t.allowHorizontalScroll){let c=t.scrollHorizontalLineChange;h=h*(c/16),t.scroll(u,h>0?"right":"left",Math.abs(h))}if(l!==0&&t.allowVerticalScroll){let c=t.scrollVerticalLineChange;l=l*(c/16),t.scroll(u,l>0?"down":"up",Math.abs(l))}}else!e.shift&&t.allowVerticalScroll?(i=i*3*t.scrollVerticalLineChange,t.scroll(u,i>0?"up":"down",Math.abs(i))):e.shift&&t.allowHorizontalScroll&&(i=i*3*t.scrollHorizontalLineChange,t.scroll(u,i>0?"left":"right",Math.abs(i)));this.doWheelChange(t,o,e)}}doWheelChange(t,e,i){(!t.position.equals(e)||i.event.wheelDeltaX!==0)&&(i.bubbles=!1)}standardWaitAfter(t,e){e===void 0&&(e=this.diagram.lastInput),this.cancelWaitAfter();let i=this,s=e.clone(this.rA);this.Rm=m.un(()=>i.doWaitAfter(s),t)}cancelWaitAfter(){this.Rm!==-1&&m.yc(this.Rm),this.Rm=-1}doWaitAfter(t){}findToolHandleAt(t,e){let i=this.diagram.findObjectAt(t,s=>{for(;s!==null&&!(s.panel instanceof vt);)s=s.panel;return s});return i===null?null:i.part.category===e?i:null}isBeyondDragSize(t,e){let i=this.diagram;t===void 0&&(t=i.firstInput.viewPoint),e===void 0&&(e=i.lastInput.viewPoint);let s=i.toolManager.dragSize,n=s.width,o=s.height;return i.firstInput.isTouchEvent&&(n+=6,o+=6),Math.abs(e.x-t.x)>n||Math.abs(e.y-t.y)>o}get name(){return this.Pt}set name(t){m.s(t,"string",$t,"name"),this.Pt=t}get isEnabled(){return this.Be}set isEnabled(t){m.s(t,"boolean",$t,"isEnabled"),this.Be=t}get isActive(){return this.HP}set isActive(t){m.s(t,"boolean",$t,"isActive"),this.HP=t}get transactionResult(){return this.qP}set transactionResult(t){t!==null&&m.s(t,"string",$t,"transactionResult"),this.qP=t}}var Cs=(x=>(x[x.Scroll=1]="Scroll",x[x.Zoom=2]="Zoom",x[x.None=3]="None",x))(Cs||{}),As=(x=>(x[x.Zoom=1]="Zoom",x[x.Cancel=2]="Cancel",x[x.None=3]="None",x))(As||{});class ne extends $t{hA;cA;fA;JP;$P;ZP;QP;_P;tS;eS;Im;_a;constructor(t){super(),this.name="ToolManager",this.hA=new q,this.cA=new q,this.fA=new q,this.JP=850,this.$P=850,this.ZP=new st(2,2).kt(),this.QP=5e3,this._P=1,this.tS=1,this.eS=null,this.Im=null,this._a=-1,t&&Object.assign(this,t)}static WheelScroll=1;static WheelZoom=2;static WheelNone=3;static GestureZoom=1;static GestureCancel=2;static GestureNone=3;get mouseWheelBehavior(){return this._P}set mouseWheelBehavior(t){this._P=t}get gestureBehavior(){return this.tS}set gestureBehavior(t){this.tS=t}initializeStandardTools(){return this}updateAdornments(t){let e=this.currentToolTip;if(e instanceof vt&&this.Im===t){let i=e.adornedObject;(t!==null?i!==null&&i.part===t:i===null)?this.showToolTip(e,i):this.hideToolTip()}}doMouseDown(){let t=this.diagram,e=t.lastInput;if(e.isTouchEvent&&this.gestureBehavior===2&&(e.bubbles=!1),e.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===3){e.bubbles=!0;return}if(this.gestureBehavior===2)return;if(t.currentTool.canStartMultiTouch()){t.currentTool.standardPinchZoomStart();return}}let i=t.undoManager,s=this.mouseDownTools.length;for(let n=0;n<s;n++){let o=this.mouseDownTools.elt(n);if(o.diagram=this.diagram,o.canStart()){t.doFocus(),t.currentTool=o,t.currentTool===o&&(o.isActive||o.doActivate(),o.doMouseDown());return}}t.lastInput.button===1&&(this.mouseWheelBehavior===1?this.mouseWheelBehavior=2:this.mouseWheelBehavior===2&&(this.mouseWheelBehavior=1)),this.doActivate(),this.standardWaitAfter(this.holdDelay,e)}doMouseMove(){let t=this.diagram,e=t.lastInput;if(e.isMultiTouch){if(this.gestureBehavior===3){e.bubbles=!0;return}if(this.gestureBehavior===2)return;if(t.currentTool.canStartMultiTouch()){t.currentTool.standardPinchZoomMove();return}}if(this.isActive){let s=this.mouseMoveTools.length;for(let n=0;n<s;n++){let o=this.mouseMoveTools.elt(n);if(o.diagram=this.diagram,o.canStart()){t.doFocus(),t.currentTool=o,t.currentTool===o&&(o.isActive||o.doActivate(),o.doMouseMove());return}}}this.uA(t);let i=e.event;i!==null&&(i.type==="pointermove"||!i.cancelable)&&(e.bubbles=!0)}uA(t){this.standardMouseOver(),this.isBeyondDragSize()&&this.standardWaitAfter(this.isActive?this.holdDelay:this.hoverDelay,t.lastInput)}aA(t,e){let i=this.currentToolTip;i!==null&&(e!==null&&i instanceof vt&&(e===i||e.isContainedBy(i))||this.hideToolTip())}doWaitAfter(t){let e=this.diagram;if(!e.aR())return;let i=e.lastInput;if(e.lastInput=t,this.doMouseHover(),this.isActive||this.doToolTip(),t.isTouchEvent&&!e.lastInput.handled){let s=t.copy();s.button=2,e.lastInput=s,e.Mx=!0,e.doMouseUp()}e.lastInput=i}doMouseHover(){let t=this.diagram,e=t.lastInput;e.targetObject===null&&(e.targetObject=t.findObjectAt(e.documentPoint,null,null));let i=e.targetObject;if(i!==null)for(e.handled=!1;i!==null;){let s=this.isActive?i.mouseHold:i.mouseHover;if(s!==null&&(s(e,i),e.handled))break;i=i.panel}else{let s=this.isActive?t.mouseHold:t.mouseHover;s!==null&&s(e)}}doToolTip(){let t=this.diagram,e=t.lastInput;e.targetObject===null&&(e.targetObject=t.findObjectAt(e.documentPoint,null,null));let i=e.targetObject;if(i!==null){let s=this.currentToolTip;if(s instanceof vt&&(i===s||i.isContainedBy(s)))return;for(;i!==null;){let n=i.toolTip;if(n!==null){this.showToolTip(n,i);return}i=i.panel}this.hideToolTip()}else{let s=t.toolTip;s!==null?this.showToolTip(s,null):this.hideToolTip()}}showToolTip(t,e){e!==null&&m.se(e,$,ne,"showToolTip:obj");let i=this.diagram;if(t!==this.currentToolTip&&this.hideToolTip(),t instanceof vt){t.layerName="Tool",t.selectable=!1,t.scale=1/i.scale,t.category="ToolTip",t.hasPlaceholder()&&(t.placeholder.scale=i.scale);let s=t.diagram;s!==null&&s!==i&&s.remove(t),i.add(t),e!==null?t.adornedObject=e:t.data=i.model,t.ensureBounds(),this.positionToolTip(t,e)}else t instanceof fe&&t!==this.currentToolTip&&t.show!==null&&t.show(e,i,this);this.currentToolTip=t,this.extendToolTip(this.toolTipDuration)}positionToolTip(t,e){if(t.hasPlaceholder())return;let i=t,s=this.diagram,n=s.lastInput.documentPoint.copy(),o=i.measuredBounds,r=s.viewportBounds;s.lastInput.isTouchEvent&&(n.x-=o.width),n.x+o.width>r.right&&(n.x-=o.width+5/s.scale),n.x<r.x&&(n.x=r.x),n.y+20/s.scale+o.height>r.bottom?n.y-=o.height+5/s.scale:n.y+=20/s.scale,n.y<r.y&&(n.y=r.y),i.position=n}extendToolTip(t){t===void 0&&(t=3e3),this.currentToolTip!==null&&(this._a!==-1&&(m.yc(this._a),this._a=-1),t>0&&t!==1/0&&(this._a=m.un(()=>this.hideToolTip(),t)))}hideToolTip(){this._a!==-1&&(m.yc(this._a),this._a=-1);let t=this.diagram,e=this.currentToolTip;e!==null&&(e instanceof vt?(t.remove(e),this.Im!==null&&this.Im.removeAdornment(e.category),e.data=null,e.adornedObject=null):e instanceof fe&&e.hide!==null&&e.hide(t,this),this.currentToolTip=null)}get currentToolTip(){return this.eS}set currentToolTip(t){this.eS=t,this.Im=t!==null&&t instanceof vt?t.adornedPart:null}doMouseUp(){this.cancelWaitAfter();let t=this.diagram;if(this.isActive){let e=this.mouseUpTools.length;for(let i=0;i<e;i++){let s=this.mouseUpTools.elt(i);if(s.diagram=this.diagram,s.canStart()){t.doFocus(),t.currentTool=s,t.currentTool===s&&(s.isActive||s.doActivate(),s.doMouseUp());return}}}t.doFocus(),this.doDeactivate()}doMouseWheel(){this.standardMouseWheel()}doKeyDown(){let t=this.diagram;t.commandHandler!==null&&t.commandHandler.doKeyDown()}doKeyUp(){let t=this.diagram;t.commandHandler!==null&&t.commandHandler.doKeyUp()}findTool(t){m.s(t,"string",ne,"findTool:name");let e=this.mouseDownTools.length;for(let i=0;i<e;i++){let s=this.mouseDownTools.elt(i);if(s.name===t)return s}e=this.mouseMoveTools.length;for(let i=0;i<e;i++){let s=this.mouseMoveTools.elt(i);if(s.name===t)return s}e=this.mouseUpTools.length;for(let i=0;i<e;i++){let s=this.mouseUpTools.elt(i);if(s.name===t)return s}return null}replaceTool(t,e){m.s(t,"string",ne,"replaceTool:name"),e!==null&&(e.diagram=this.diagram);let i=this.mouseDownTools.length;for(let s=0;s<i;s++){let n=this.mouseDownTools.elt(s);if(n.name===t)return e!==null?this.mouseDownTools.setElt(s,e):this.mouseDownTools.removeAt(s),n}i=this.mouseMoveTools.length;for(let s=0;s<i;s++){let n=this.mouseMoveTools.elt(s);if(n.name===t)return e!==null?this.mouseMoveTools.setElt(s,e):this.mouseMoveTools.removeAt(s),n}i=this.mouseUpTools.length;for(let s=0;s<i;s++){let n=this.mouseUpTools.elt(s);if(n.name===t)return e!==null?this.mouseUpTools.setElt(s,e):this.mouseUpTools.removeAt(s),n}return null}replaceStandardTool(t,e,i){this.Jt(t,e,i)}Jt(t,e,i){m.s(t,"string",ne,"replaceStandardTool:name"),e!==null&&(e.name=t,e.diagram=this.diagram),this.findTool(t)?this.replaceTool(t,e):e!==null&&i.add(e)}get mouseDownTools(){return this.hA}get mouseMoveTools(){return this.cA}get mouseUpTools(){return this.fA}get hoverDelay(){return this.JP}set hoverDelay(t){m.s(t,"number",ne,"hoverDelay"),this.JP=t}get holdDelay(){return this.$P}set holdDelay(t){m.s(t,"number",ne,"holdDelay"),this.$P=t}get dragSize(){return this.ZP}set dragSize(t){this.ZP=t.N()}get toolTipDuration(){return this.QP}set toolTipDuration(t){m.s(t,"number",ne,"toolTipDuration"),this.QP=t}get actionTool(){return this.findTool("Action")}set actionTool(t){this.Jt("Action",t,this.mouseDownTools)}get relinkingTool(){return this.findTool("Relinking")}set relinkingTool(t){this.Jt("Relinking",t,this.mouseDownTools)}get linkReshapingTool(){return this.findTool("LinkReshaping")}set linkReshapingTool(t){this.Jt("LinkReshaping",t,this.mouseDownTools)}get resizingTool(){return this.findTool("Resizing")}set resizingTool(t){this.Jt("Resizing",t,this.mouseDownTools)}get rotatingTool(){return this.findTool("Rotating")}set rotatingTool(t){this.Jt("Rotating",t,this.mouseDownTools)}get linkingTool(){return this.findTool("Linking")}set linkingTool(t){this.Jt("Linking",t,this.mouseMoveTools)}get draggingTool(){return this.findTool("Dragging")}set draggingTool(t){this.Jt("Dragging",t,this.mouseMoveTools)}get dragSelectingTool(){return this.findTool("DragSelecting")}set dragSelectingTool(t){this.Jt("DragSelecting",t,this.mouseMoveTools)}get panningTool(){return this.findTool("Panning")}set panningTool(t){this.Jt("Panning",t,this.mouseMoveTools)}get contextMenuTool(){return this.findTool("ContextMenu")}set contextMenuTool(t){this.Jt("ContextMenu",t,this.mouseUpTools)}get textEditingTool(){return this.findTool("TextEditing")}set textEditingTool(t){this.Jt("TextEditing",t,this.mouseUpTools)}get clickCreatingTool(){return this.findTool("ClickCreating")}set clickCreatingTool(t){this.Jt("ClickCreating",t,this.mouseUpTools)}get clickSelectingTool(){return this.findTool("ClickSelecting")}set clickSelectingTool(t){this.Jt("ClickSelecting",t,this.mouseUpTools)}}class Tt extends $t{iS;sS;wn;nS;oS;rS;lS;vc;Em;aS;th;br;dA;hS;vu;Fu;cS;fS;uS;dS;static Nx=new q;static le=null;static eh=null;constructor(t){super(),this.name="Dragging",this.iS=!0,this.dS=!0,this.sS=!0,this.wn=null,this.nS=null,this.oS=null,this.rS=null,this.lS=!1,this.vu=!1,this.vc=new P(NaN,NaN),this.Em=new P,this.aS=!0,this.th=100,this.br=[],this.dA=new V().k(),this.hS=new Pi,this.Fu=null,this.cS="copy",this.fS="",this.uS="no-drop",t&&Object.assign(this,t)}get isCopyEnabled(){return this.iS}set isCopyEnabled(t){m.s(t,"boolean",Tt,"isCopyEnabled"),this.iS=t}get copiesEffectiveCollection(){return this.sS}set copiesEffectiveCollection(t){m.s(t,"boolean",Tt,"copiesEffectiveCollection"),this.sS=t}get dragOptions(){return this.hS}set dragOptions(t){this.hS=t}get isGridSnapEnabled(){return this.dragOptions.isGridSnapEnabled}set isGridSnapEnabled(t){m.s(t,"boolean",Tt,"isGridSnapEnabled"),this.dragOptions.isGridSnapEnabled=t}get isComplexRoutingRealtime(){return this.aS}set isComplexRoutingRealtime(t){this.aS=t;let e=this.diagram.findRouter("AvoidsLinks");e!==null&&(e.isRealtime=t)}get isGridSnapRealtime(){return this.dragOptions.isGridSnapRealtime}set isGridSnapRealtime(t){m.s(t,"boolean",Tt,"isGridSnapRealtime"),this.dragOptions.isGridSnapRealtime=t}get gridSnapCellSize(){return this.dragOptions.gridSnapCellSize}set gridSnapCellSize(t){this.dragOptions.gridSnapCellSize.equals(t)||(t=t.N(),this.dragOptions.gridSnapCellSize=t)}get gridSnapCellSpot(){return this.dragOptions.gridSnapCellSpot}set gridSnapCellSpot(t){this.dragOptions.gridSnapCellSpot.equals(t)||(t=t.N(),this.dragOptions.gridSnapCellSpot=t)}get gridSnapOrigin(){return this.dragOptions.gridSnapOrigin}set gridSnapOrigin(t){this.dragOptions.gridSnapOrigin.equals(t)||(t=t.N(),this.dragOptions.gridSnapOrigin=t)}get dragsLink(){return this.dragOptions.dragsLink}set dragsLink(t){m.s(t,"boolean",Tt,"dragsLink"),this.dragOptions.dragsLink=t}get dragsTree(){return this.dragOptions.dragsTree}set dragsTree(t){m.s(t,"boolean",Tt,"dragsTree"),this.dragOptions.dragsTree=t}get copyCursor(){return this.cS}set copyCursor(t){this.cS=t}get moveCursor(){return this.fS}set moveCursor(t){this.fS=t}get nodropCursor(){return this.uS}set nodropCursor(t){this.uS=t}get currentPart(){return this.nS}set currentPart(t){t!==null&&m.se(t,pt,Tt,"currentPart"),this.nS=t}get copiedParts(){return this.rS}set copiedParts(t){this.rS=t}get draggedParts(){return this.oS}set draggedParts(t){this.oS=t}get draggingParts(){return this.copiedParts!==null?this.copiedParts.toKeySet():this.draggedParts!==null?this.draggedParts.toKeySet():this.dA}get draggedLink(){return this.diagram.draggedLink}set draggedLink(t){t!==null&&m.se(t,j,Tt,"draggedLink"),this.diagram.draggedLink=t}get isDragOutStarted(){return this.lS}set isDragOutStarted(t){this.lS=t}get startPoint(){return this.Em}set startPoint(t){this.Em.equals(t)||this.Em.h(t)}get delay(){return this.th}set delay(t){m.s(t,"number",Tt,"delay"),this.th=t}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;if(t===null||t.isReadOnly&&!t.allowDragOut||!t.allowMove&&!t.allowCopy&&!t.allowDragOut||!t.allowSelect)return!1;let e=t.lastInput;return!e.left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.isTouchEvent&&e.timestamp-t.firstInput.timestamp<this.th)?!1:this.findDraggablePart()!==null}findDraggablePart(){let t=this.diagram,e=t.findPartAt(t.firstInput.documentPoint,!1);if(e===null)return null;for(;e!==null&&!e.canSelect();)e=e.containingGroup;return e!==null&&(e.canMove()||e.canCopy())?e:null}standardMouseSelect(){let t=this.diagram;if(!t.allowSelect)return;let e=t.findPartAt(t.firstInput.documentPoint,!1);if(e!==null){for(;e!==null&&!e.canSelect();)e=e.containingGroup;if(this.currentPart=e,this.currentPart!==null&&!this.currentPart.isSelected){t.T("ChangingSelection",t.selection);let i=t.lastInput;!(m.fr?i.meta:i.control)&&!i.shift&&t.clearSelection(!0),this.currentPart.isSelected=!0,t.T("ChangedSelection",t.selection)}}}doActivate(){let t=this.diagram;this.Fu=null,this.currentPart===null&&this.standardMouseSelect();let e=this.currentPart;if(e===null||!e.canMove()&&!e.canCopy())return;t.cacheGroupExternalLinks(!0),Tt.le=null,this.isActive=!0,this.vc.set(t.position),this.gS(t.selection),this.br.length=0,t.animationManager.stopAnimation();let i=this.computeEffectiveCollection(t.selection,this.dragOptions);this.draggedParts=i,this.dS=!!this.diagram.layout.isRealtime,this.diagram.layout.isRealtime=!1,t.Ru=!0,t.getRenderingHint("temporaryPixelRatio")===!0&&t.avgSpf>30&&t.Cx(),t.gA(this.draggedParts),t.Ou=!0,this.startTransaction("Drag"),this.startPoint=t.firstInput.documentPoint,t.isMouseCaptured=!0,t.allowDragOut&&this.hR()}gS(t){if(!this.dragsLink)return;let e=this.diagram,i=e.model.Um(),s=t.first();i&&t.count===1&&s instanceof j&&this.mayDragLink(s)?(this.draggedLink=s,this.draggedLink.canRelinkFrom()&&this.draggedLink.canRelinkTo()&&this.draggedLink.clearAdornments(),this.wn=e.toolManager.findTool("Relinking"),this.wn===null&&(this.wn=new $e,this.wn.diagram=e),this.wn.originalLink=this.draggedLink):(this.draggedLink=null,this.wn=null)}mayDragLink(t){let e=this.diagram;return e!==null&&e.allowRelink}computeEffectiveCollection(t,e){return this.diagram.commandHandler.computeEffectiveCollection(t,e)}js(t){return t===void 0?new Ye(P.dn):this.isGridSnapEnabled?new Ye(new P(Math.round(t.x*1e3)/1e3,Math.round(t.y*1e3)/1e3)):new Ye(t.copy())}doDeactivate(){this.isActive=!1;let t=this.diagram;this.diagram.layout.isRealtime=this.dS,t.Ou=!1,t.Fl=!0,t.cacheGroupExternalLinks(!1),t.stopAutoScroll(),this.mS(),t.pS(this.draggedParts),this.Fu=null,this.currentPart=null,this.draggedParts=null,this.isDragOutStarted=!1,this.vu=!1,Tt.cR(),this.mA(),this.vc.e(NaN,NaN),Tt.eh!==null&&(Tt.eh.currentCursor=""),Tt.eh=null,Tt.le=null,this.Rl(),t.isMouseCaptured=!1,t.currentCursor="",t.Ru=!1,this.stopTransaction(),t.yS(!0)}stopTransaction(){let t=this.diagram,e=super.stopTransaction();return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.optimize(),e}mS(){let t=this.diagram,e=t.skipsUndoManager;t.skipsUndoManager=!0;let i=t.lastInput;this.pA(i,null),t.skipsUndoManager=e,this.br.length=0}yA(){this.Rl(),this.wS();let t=this.diagram;this.vc.isReal()&&(t.position=this.vc),t.stopAutoScroll()}doCancel(){this.Rl(),this.wS();let t=this.diagram;this.vc.isReal()&&(t.position=this.vc),this.stopTool()}doKeyDown(){let t=this.diagram;if(!this.isActive)return;let e=t.lastInput,i=t.previousInput;e.code==="Escape"?this.doCancel():(e.code!==i.code||e.modifiers!==i.modifiers)&&this.doMouseMove()}doKeyUp(){this.isActive&&this.doMouseMove()}fR(t,e){let i=1/0,s=1/0,n=-1/0,o=-1/0,r=t.iterator;for(;r.next();){let a=r.value;if(!a.isVisible())continue;let h=a.location,l=h.x,u=h.y;isNaN(l)||isNaN(u)||(l<i&&(i=l),u<s&&(s=u),l>n&&(n=l),u>o&&(o=u))}return i===1/0?e.e(0,0,0,0):e.e(i,s,n-i,o-s),e}xS(t){if(this.copiedParts!==null)return;let e=this.diagram;if(t&&(e.isReadOnly||e.isModelReadOnly)||this.draggedParts===null)return;let i=e.undoManager;i.isEnabled&&i.isInTransaction?i.currentTransaction!==null&&i.currentTransaction.changes.count>0&&(e.undoManager.rollbackTransaction(),e.startTransaction("Drag")):this.wS(),e.skipsUndoManager=!t,e.partManager.addsToTemporaryLayer=!t,this.startPoint=e.firstInput.documentPoint;let s=this.copiesEffectiveCollection?this.draggedParts.toKeySet():e.selection,n=e.copyParts(s,e,!0),o=new Mt,r=this.draggedParts.iterator;for(;r.next();){let h=r.key;if(h.Di()&&h.canCopy()){let l=n.get(h);if(l===null)continue;l.location=h.location,l.ensureBounds(),o.set(l,this.js(l.location))}}let a=n.iterator;for(;a.next();){let h=a.value;h instanceof j&&h.canCopy()&&o.set(h,this.js())}if(this.copiedParts=o,this.gS(o.toKeySet()),this.draggedLink!==null){let h=this.draggedLink,l=h.routeBounds;h.kr(this.startPoint.x-(l.x+l.width/2),this.startPoint.y-(l.y+l.height/2))}this.doUpdateCursor(null)}Rl(){let t=this.diagram;if(this.copiedParts!==null){if(t.removeParts(this.copiedParts.toKeySet(),!1),this.copiedParts=null,this.draggedParts!==null){let e=this.draggedParts.iterator;for(;e.next();)if(e.key instanceof j){let i=e.value;i.point=new P(0,0)}}this.doUpdateCursor(null)}t.skipsUndoManager=!1,t.partManager.addsToTemporaryLayer=!1,this.startPoint=t.firstInput.documentPoint}mA(){this.draggedLink!==null&&(this.dragsLink&&this.wn!==null&&(this.wn.stopDraggingMouseMove(),this.wn.originalLink=null),this.draggedLink=null,this.wn=null)}Fc(t,e){if(t===null)return;let i=this.diagram,s=this.startPoint,n=P.l();n.h(i.lastInput.documentPoint),this.moveParts(t,n.subtract(s),e),P.i(n),i.getRenderingHint("temporaryPixelRatio")===!0&&i.Ol===null&&i.avgSpf>30&&(i.Cx(),i.Iu())}moveParts(t,e,i){i===void 0&&(i=!1);let s=this.diagram;s!==null&&s.Lx(t,e,this.dragOptions,i)}wS(){if(this.draggedParts===null)return;let t=this.diagram,e=this.draggedParts.iterator;for(;e.next();){let i=e.key;i.Di()&&(i.location=e.value.point)}for(e=this.draggedParts.iterator;e.next();){let i=e.key;if(i instanceof j&&i.suspendsRouting){let s=e.value.point;this.draggedParts.set(i,this.js()),i.kr(-s.x,-s.y)}}t.maybeUpdate()}uR(t){if(t===null)return!0;let e=t.part;return!!(e===null||e instanceof vt||e.layer?.isTemporary||this.draggedParts&&this.draggedParts.has(e)||this.copiedParts&&this.copiedParts.has(e))}bS(t){let e=this.diagram;this.dragsLink&&(this.draggedLink!==null&&(this.draggedLink.fromNode=null,this.draggedLink.toNode=null),this.wA(!1));let i=this.findDragOverObject(t),s=e.lastInput;s.targetObject=i,this.doUpdateCursor(i);let n=e.skipsUndoManager,o=!1;try{if(e.skipsUndoManager=!0,o=this.pA(s,i),!this.isActive&&Tt.le===null)return;let r=i!==null?i.part:null;if(r===null||e.handlesDragDropForTopLevelParts&&r.isTopLevel&&!(r instanceof ht)){let a=e.mouseDragOver;a!==null&&(a(s),o=!0)}if(!this.isActive&&Tt.le===null||(this.doDragOver(t,i),!this.isActive&&Tt.le===null))return}finally{e.skipsUndoManager=n,o&&e.maybeUpdate()}this.Fu=i,!e.isReadOnly&&(e.allowMove||e.allowCopy)&&(e.allowHorizontalScroll||e.allowVerticalScroll)&&e.doAutoScroll(s.viewPoint)}findDragOverObject(t){return this.diagram.kS(t,null,e=>!this.uR(e))}doUpdateCursor(t){let e=this.diagram;(t===null||this.Fu!==t)&&(!this.diagram.currentTool.isActive||this.mayCopy()?e.currentCursor=this.copyCursor:this.mayMove()?e.currentCursor=this.moveCursor:this.mayDragOut()&&(e.currentCursor=this.nodropCursor))}pA(t,e){let i=!1,s=this.br.length,n=s>0?this.br[0]:null;if(e===n)return!1;t.handled=!1;for(let r=0;r<s;r++){let a=this.br[r],h=a.mouseDragLeave;if(h!==null&&(h(t,a,e),i=!0,t.handled))break}if(this.br.length=0,!this.isActive&&Tt.le===null||e===null)return i;t.handled=!1;let o=e;for(;o!==null;)this.br.push(o),o=this.xA(o);s=this.br.length;for(let r=0;r<s;r++){let a=this.br[r],h=a.mouseDragEnter;if(h!==null&&(h(t,a,n),i=!0,t.handled))break}return i}FU(t,e){return t===null?!1:!!(t===e||t.isContainedBy(e)||e instanceof ht&&!(t instanceof ht)&&e.handlesDragDropForMembers&&t.part?.isMemberOf(e))}xA(t){let e=t.panel;if(e!==null)return e;if(t instanceof pt&&!(t instanceof ht)){let i=t.containingGroup;if(i!==null&&i.handlesDragDropForMembers)return i}return null}bA(t,e){let i=this.diagram,s=this.wn;if(s===null)return null;let n=s.portGravity,o=i.findObjectsNear(t,n,l=>s.findValidLinkablePort(l,e)),r=P.l(),a=1/0,h=null;for(let l=o.iterator;l.next();){let u=l.value;if(u.part===null)continue;let c=u.getDocumentPoint(T.Center,r),d=t.distanceSquaredPoint(c);d<a&&(h=u,a=d)}return P.i(r),h}wA(t){let e=this.draggedLink;if(e!==null){if(e.pointsCount<2)return;let i=this.diagram;if(i.isReadOnly)return;let s=this.wn;if(s===null)return;let n=null,o=null;e.fromNode===null&&(n=this.bA(e.getPoint(0),!1),n!==null&&(o=n.part));let r=null,a=null;e.toNode===null&&(r=this.bA(e.getPoint(e.pointsCount-1),!0),r!==null&&(a=r.part)),s.isValidLink(o,n,a,r)?t?(e.defaultFromPoint=e.getPoint(0),e.defaultToPoint=e.getPoint(e.pointsCount-1),e.suspendsRouting=!1,e.fromNode=o,n!==null&&(e.fromPortId=n.portId),e.toNode=a,r!==null&&(e.toPortId=r.portId),e.fromPort!==i.PS&&i.T("LinkRelinked",e,i.PS),e.toPort!==i.SS&&i.T("LinkRelinked",e,i.SS)):s.doDraggingMouseMove(o,n,a,r):s.doDraggingMouseMove(null,null,null,null)}}doDragOver(t,e){}kA(t){let e=this.diagram;this.dragsLink&&this.wA(!0),this.mS();let i=this.findDragOverObject(t),s=e.lastInput;if(s.targetObject=i,i!==null){s.handled=!1;let a=i;for(;a!==null;){let h=a.mouseDrop;if(h!==null&&(h(s,a),s.handled))break;this.dR(s,a),a=this.xA(a)}}else{let a=e.mouseDrop;a!==null&&a(s)}if(!this.isActive&&Tt.le===null)return;let n=this.copiedParts||this.draggedParts;if(n!==null){let a=n.iterator;for(;a.next();){let h=a.key;h instanceof J&&h.linksConnected.each(l=>l.suspendsRouting=!1)}}if(this.doDropOnto(t,i),!this.isActive&&Tt.le===null)return;let o=I.l(),r=e.selection.iterator;for(;r.next();){let a=r.value;a instanceof J&&this.gR(e,a,o)}I.i(o)}dR(t,e){let i=this.diagram,s=e.part;if(i.handlesDragDropForTopLevelParts&&s!==null&&s.isTopLevel&&!(s instanceof ht)){let n=i.mouseDrop;n!==null&&n(t)}}gR(t,e,i){if(!e.canAvoid())return;let s=!1;i=e.getAvoidableRect(i),t.viewportBounds.containsRect(i)&&(s=!0);let n=this.copiedParts||this.draggedParts;if(n===null)return;let o=t.MS(i,a=>a.part,a=>a instanceof j,!0,a=>a instanceof j,s);if(o.count===0)return;let r=o.iterator;for(;r.next();){let a=r.value;n.has(a)&&n.has(e)||!a.isMemberOf(e)&&a.isAvoiding&&a.$t()}}doDropOnto(t,e){}doMouseMove(){if(!this.isActive)return;let t=this.diagram,e=t.lastInput;this.simulatedMouseMove(e.event,e.documentPoint,e.targetDiagram)||this.currentPart!==null&&this.draggedParts!==null&&(this.mayCopy()?(this.xS(!1),this.Fc(this.copiedParts,!1)):this.mayMove()?(this.Rl(),this.Fc(this.draggedParts,!0)):this.mayDragOut()?(this.xS(!1),this.Fc(this.copiedParts,!1)):this.Rl(),this.bS(t.lastInput.documentPoint))}doMouseUp(){if(!this.isActive)return;let t=this.diagram,e=t.lastInput;if(this.simulatedMouseUp(e.event,e.documentPoint,e.targetDiagram))return;let i=!1,s=this.mayCopy();if(s&&this.copiedParts!==null?(this.Rl(),this.xS(!0),this.Fc(this.copiedParts,!1),this.copiedParts!==null&&(t.T("ChangingSelection",t.selection),t.clearSelection(!0),this.copiedParts.iteratorKeys.each(n=>{n.isSelected=!0}))):(i=!0,this.Rl(),this.mayMove()&&(this.Fc(this.draggedParts,!0),this.bS(t.lastInput.documentPoint))),this.vu=!0,this.kA(t.lastInput.documentPoint),this.isActive){let n=s&&this.copiedParts,o=n?this.copiedParts?.toKeySet():this.draggedParts?this.draggedParts.toKeySet():null;this.copiedParts=null,i&&this.mR(),t.invalidateDocumentBounds(),t.pS(this.draggedParts),this.transactionResult=n?"Copy":"Move",t.T(n?"SelectionCopied":"SelectionMoved",o)}this.stopTool(),s&&t.T("ChangedSelection",t.selection)}simulatedMouseMove(t,e,i){if(Tt.le===null)return!1;let s=Tt.le.diagram;i instanceof Y||(i=null);let n=Tt.eh;if(i!==n){if(n!==null&&n!==s){n.stopAutoScroll(),Tt.le.isDragOutStarted=!1;let r=n.toolManager.findTool("Dragging");r!==null&&r.doSimulatedDragLeave()}if(Tt.eh=i,i!==null&&i!==s){Tt.le.yA();let r=i.toolManager.findTool("Dragging");r!==null&&(r.PA(),r.doSimulatedDragEnter())}this.doUpdateCursor(null)}if(i===null||i===s||!i.allowDrop||i.isReadOnly||!i.allowInsert)return!1;let o=i.toolManager.findTool("Dragging");if(o!==null){let r=e;t!==null&&(t.targetTouches!==void 0&&(t.targetTouches.length>0?t=t.targetTouches[0]:t.changedTouches.length>0&&(t=t.changedTouches[0])),r=i.getMouse(t)),i.lastInput.documentPoint=r,i.lastInput.viewPoint=i.transformDocToView(r),i.lastInput.down=!1,i.lastInput.up=!1,o.doSimulatedDragOver()}return!0}simulatedMouseUp(t,e,i){if(Tt.le===null)return!1;let s=Tt.eh,n=Tt.le.diagram;if(i===null)return Tt.le.doCancel(),!0;if(i!==s){if(s!==null){let r=s.toolManager.findTool("Dragging");if(s!==null&&s!==n&&r!==null)return s.stopAutoScroll(),Tt.le.isDragOutStarted=!1,r.doSimulatedDragLeave(),!1}Tt.eh=i;let o=i.toolManager.findTool("Dragging");o!==null&&(Tt.le.yA(),o.PA(),o.doSimulatedDragEnter())}if(i!==this.diagram){let o=e;t!==null?(t.targetTouches!==void 0&&(t.targetTouches.length>0?t=t.targetTouches[0]:t.changedTouches.length>0&&(t=t.changedTouches[0])),o=i.getMouse(t)):o===null&&(o=new P),i.lastInput.documentPoint=o,i.lastInput.viewPoint=i.transformDocToView(o),i.lastInput.down=!1,i.lastInput.up=!0;let r=i.toolManager.findTool("Dragging");r!==null&&r.doSimulatedDrop();let a=Tt.le;if(a!==null){let h=a.mayCopy();a.transactionResult=h?"Copy":"Move",a.stopTool()}return!0}return!1}mR(){if(this.draggedParts===null)return;let t=this.draggedParts.iterator;for(;t.next();){let e=t.key;if(e instanceof J){let i=e.containingGroup;i!==null&&i.hasPlaceholder()&&!this.draggedParts.has(i)&&i.placeholder.f()}}}mayCopy(){if(!this.isCopyEnabled)return!1;let t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowCopy||!(m.fr?t.lastInput.alt:t.lastInput.control))return!1;let e=t.selection.iterator;for(;e.next();)if(e.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())}mayDragOut(){if(!this.isCopyEnabled)return!1;let t=this.diagram;if(!t.allowDragOut||!t.allowCopy||t.allowMove)return!1;let e=t.selection.iterator;for(;e.next();)if(e.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())}mayMove(){let t=this.diagram;if(t.isReadOnly||!t.allowMove)return!1;let e=t.selection.iterator;for(;e.next();)if(e.value.canMove())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canMove())}PA(){Tt.Nx.has(this)||Tt.Nx.add(this)}static cR(){if(Tt.Nx.count>0){let t=Tt.Nx,e=t.length;for(let i=0;i<e;i++){let s=t.elt(i);s.mA(),s.Rl(),s.mS(),s.diagram.stopAutoScroll()}t.clear()}}pR(t,e,i){return!this.vu&&this.draggedParts!==null&&!this.draggedParts.has(t)?(i.h(e),!0):!1}get draggingSource(){return Tt.le}mayDragIn(){let t=this.diagram;if(!t.allowDrop||t.isReadOnly||t.isModelReadOnly||!t.allowInsert)return!1;let e=Tt.le;return!(e===null||e.diagram.model.dataFormat!==t.model.dataFormat)}doSimulatedDragEnter(){if(!this.mayDragIn())return;let t=this.diagram;t.animationManager.stopAnimation(),t.Pr(),t.animationManager.stopAnimation();let e=Tt.le;e!==null&&(this.diagram.Ru=!0,t.lastInput.event===null&&(t.lastInput.event=e.diagram.lastInput.event)),this.doUpdateCursor(null)}doSimulatedDragLeave(){let t=Tt.le;t!==null&&t.doSimulatedDragOut(),this.diagram.Ru=!1,this.doCancel()}doSimulatedDragOver(){let t=this.diagram;t.animationManager.Eu=!0;let e=Tt.le;if(e!==null&&e.draggedParts!==null){if(!this.mayDragIn())return;this.SA(e.draggedParts.toKeySet(),!1,t.firstInput),this.Fc(this.copiedParts,!1),this.bS(t.lastInput.documentPoint)}t.animationManager.Eu=!1}doSimulatedDrop(){let t=this.diagram,e=Tt.le;if(e!==null){let i=e.diagram;if(e.vu=!0,this.Rl(),e.draggedParts===null||!this.mayDragIn())return;t.animationManager.Eu=!0,t.T("ChangingSelection",t.selection),this.startTransaction("Drop"),this.SA(e.draggedParts.toKeySet(),!0,t.lastInput),this.Fc(this.copiedParts,!1);let s=new V;this.copiedParts!==null&&(t.clearSelection(!0),this.copiedParts.iteratorKeys.each(n=>{n.isSelected=!0,s.add(n)})),this.kA(t.lastInput.documentPoint),t.invalidateDocumentBounds(),this.copiedParts!==null&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,t.doFocus(),t.Ru=!1,t.T("ExternalObjectsDropped",s,i),this.stopTransaction(),t.T("ChangedSelection",t.selection)}t.animationManager.Eu=!1}SA(t,e,i){if(this.copiedParts!==null)return;let s=this.diagram;if(s.isReadOnly||s.isModelReadOnly)return;s.skipsUndoManager=!e,s.partManager.addsToTemporaryLayer=!e,this.startPoint=i.documentPoint;let n=s.copyParts(t,s,!0),o=I.l();this.fR(t,o);let r=o.x+o.width/2,a=o.y+o.height/2;I.i(o);let h=this.Em,l=new Mt,u=P.l(),c=t.iterator;for(;c.next();){let f=c.value;if(f instanceof j&&f.canCopy()){let p=n.get(f);if(p===null)continue;p.points=f.points,p.kr(h.x-r,h.y-a),p.suspendsRouting=!0,l.set(p,this.js())}}let d=t.iterator;for(;d.next();){let f=d.value;if(f.Di()&&f.canCopy()){let p=n.get(f);if(p===null)continue;let g=f.location;u.e(h.x-(r-g.x),h.y-(a-g.y)),p.location=u,p.ensureBounds(),l.set(p,this.js(u))}}if(P.i(u),this.copiedParts=l,this.gS(l.toKeySet()),this.draggedLink!==null){let f=this.draggedLink,p=f.routeBounds;f.kr(this.startPoint.x-(p.x+p.width/2),this.startPoint.y-(p.y+p.height/2))}this.doUpdateCursor(null)}hR(){this.isDragOutStarted=!0,this.vu=!1,Tt.le=this,Tt.eh=this.diagram,this.doSimulatedDragOut()}doSimulatedDragOut(){let t=this.diagram;!this.mayCopy()&&!this.mayMove()?t.currentCursor=this.nodropCursor:t.currentCursor="",this.Fu=null}computeMove(t,e,i,s){let n=this.diagram;return n!==null?n.computeMove(t,e,this.dragOptions,s):new P}}ne.prototype.doCancel=function(){Tt.le!==null&&Tt.le.doCancel(),$t.prototype.doCancel.call(this)};class ae extends $t{NS;CS;Il;LS;AS;ih;TS;nh;DS;vS;FS;RS;OS;IS;MA;ES;El;US;constructor(){super(),this.NS=100,this.CS=!1,this.Il="pointer",this.LS=new j({layerName:"Tool"}).add(new et({isPanelMain:!0,stroke:"blue"}).theme("stroke","tempLink"),new et({toArrow:"Standard",fill:"blue",stroke:"blue"}).theme("fill","tempLink").theme("stroke","tempLink")).It(),this.ih=new et("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:st.TP}).theme("stroke","tempPort"),this.AS=new J({selectable:!1,layerName:"Tool"}).add(this.ih).It(),this.nh=new et("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:st.TP}).theme("stroke","tempPort"),this.TS=new J({selectable:!1,layerName:"Tool"}).add(this.nh).It(),this.DS=null,this.vS=null,this.FS=null,this.RS=null,this.OS=null,this.IS=!0,this.MA=new Mt,this.ES=null,this.El=null,this.US=null}doStop(){this.diagram.stopAutoScroll(),this.originalLink=null,this.originalFromNode=null,this.originalFromPort=null,this.originalToNode=null,this.originalToPort=null,this.validPortsCache.clear(),this.targetPort=null}get portGravity(){return this.NS}set portGravity(t){m.s(t,"number",ae,"portGravity"),t>=0&&(this.NS=t)}get isUnconnectedLinkValid(){return this.CS}set isUnconnectedLinkValid(t){m.s(t,"boolean",ae,"isUnconnectedLinkValid"),this.CS=t}get linkingCursor(){return this.Il}set linkingCursor(t){this.Il=t}get temporaryLink(){return this.LS}set temporaryLink(t){t.It(),this.LS=t}get temporaryFromNode(){return this.AS}set temporaryFromNode(t){t.It(),this.AS=t,t&&(this.ih=t.port)}get temporaryFromPort(){return this.ih}set temporaryFromPort(t){if(this.ih!==null){let e=this.ih.panel;if(e!==null){let i=e.D.indexOf(this.ih);e.removeAt(i),e.insertAt(i,t)}}this.ih=t}get temporaryToNode(){return this.TS}set temporaryToNode(t){t.It(),this.TS=t,t&&(this.nh=t.port)}get temporaryToPort(){return this.nh}set temporaryToPort(t){if(this.nh!==null){let e=this.nh.panel;if(e!==null){let i=e.D.indexOf(this.nh);e.removeAt(i),e.insertAt(i,t)}}this.nh=t}get originalLink(){return this.DS}set originalLink(t){t!==null&&m.se(t,j,ae,"originalLink"),this.DS=t}get originalFromNode(){return this.vS}set originalFromNode(t){t!==null&&m.se(t,J,ae,"originalFromNode"),this.vS=t}get originalFromPort(){return this.FS}set originalFromPort(t){t!==null&&m.se(t,$,ae,"originalFromPort"),this.FS=t}get originalToNode(){return this.RS}set originalToNode(t){t!==null&&m.se(t,J,ae,"originalToNode"),this.RS=t}get originalToPort(){return this.OS}set originalToPort(t){t!==null&&m.se(t,$,ae,"originalToPort"),this.OS=t}get isForwards(){return this.IS}set isForwards(t){this.IS=t}get validPortsCache(){return this.MA}get targetPort(){return this.ES}set targetPort(t){t!==null&&m.se(t,$,ae,"targetPort"),this.ES=t}copyPortProperties(t,e,i,s,n){if(t===null||e===null||i===null||s===null)return;let o=e.getDocumentScale(),r=st.l();r.width=e.naturalBounds.width*o,r.height=e.naturalBounds.height*o,s.desiredSize=r,st.i(r),n?(s.toSpot=e.toSpot,s.toEndSegmentLength=e.toEndSegmentLength):(s.fromSpot=e.fromSpot,s.fromEndSegmentLength=e.fromEndSegmentLength),i.locationSpot=T.Center;let a=P.l();i.location=e.getDocumentPoint(T.Center,a),P.i(a),s.angle=e.getDocumentAngle(),this.portTargeted!==null&&this.portTargeted(t,e,i,s,n)}setNoTargetPortProperties(t,e,i){e!==null&&(e.desiredSize=st.TP,e.fromSpot=T.None,e.toSpot=T.None),t!==null&&(t.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,t,e,i)}doMouseDown(){this.isActive&&this.doMouseMove()}doMouseMove(){if(this.isActive){let t=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof J){let e=this.targetPort.part;this.isForwards?this.copyPortProperties(e,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(e,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(t.allowHorizontalScroll||t.allowVerticalScroll)&&t.doAutoScroll(t.lastInput.viewPoint)}}findValidLinkablePort(t,e){if(t===null)return null;let i=t.part;if(!(i instanceof J))return null;for(;t!==null;){let s=e?t.toLinkable:t.fromLinkable;if(s===!0&&(t.portId!==null||t instanceof J)&&(e?this.isValidTo(i,t):this.isValidFrom(i,t)))return t;if(s===!1)return null;t=t.panel}return null}findTargetPort(t){let e=this.diagram,i=e.lastInput.documentPoint,s=this.portGravity,n=e.findObjectsNear(i,s,h=>this.findValidLinkablePort(h,t),null,!0),o=1/0,r=null,a=n.iterator;for(;a.next();){let h=a.value,l=h.part;if(!(l instanceof J))continue;let u=h.getDocumentPoint(T.Center,P.l()),c=i.x-u.x,d=i.y-u.y;P.i(u);let f=c*c+d*d;if(f<o){let p=this.validPortsCache.get(h);p!==null?p&&(r=h,o=f):t&&this.isValidLink(this.originalFromNode,this.originalFromPort,l,h)||!t&&this.isValidLink(l,h,this.originalToNode,this.originalToPort)?(this.validPortsCache.set(h,!0),r=h,o=f):this.validPortsCache.set(h,!1)}}if(r!==null){let h=r.part;if(h instanceof J&&(h.layer===null||h.layer.allowLink))return r}return null}isValidFrom(t,e){if(t===null||e===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(t.layer!==null&&!t.layer.allowLink||e.fromLinkable!==!0))return!1;let i=e.fromMaxLinks;if(i<1/0){if(this.originalLink!==null&&t===this.originalFromNode&&e===this.originalFromPort)return!0;let s=e.portId;if(s===null&&(s=""),t.findLinksOutOf(s).count>=i)return!1}return!0}isValidTo(t,e){if(t===null||e===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(t.layer!==null&&!t.layer.allowLink||e.toLinkable!==!0))return!1;let i=e.toMaxLinks;if(i<1/0){if(this.originalLink!==null&&t===this.originalToNode&&e===this.originalToPort)return!0;let s=e.portId;if(s===null&&(s=""),t.findLinksInto(s).count>=i)return!1}return!0}isInSameNode(t,e){if(t===null||e===null)return!1;if(t===e)return!0;let i=t.part,s=e.part;return i!==null&&i===s}isLinked(t,e){if(t===null||e===null)return!1;let i=t.part;if(!(i instanceof J))return!1;let s=t.portId;s===null&&(s="");let n=e.part;if(!(n instanceof J))return!1;let o=e.portId;o===null&&(o="");let r=n.findLinksInto(o);for(;r.next();){let a=r.value;if(a.fromNode===i&&a.fromPortId===s)return!0}return!1}isValidLink(t,e,i,s){if(!this.isValidFrom(t,e)||!this.isValidTo(i,s)||e!==null&&s!==null&&(!(e.fromLinkableSelfNode&&s.toLinkableSelfNode)&&this.isInSameNode(e,s)||!(e.fromLinkableDuplicates&&s.toLinkableDuplicates)&&this.isLinked(e,s))||this.originalLink!==null&&(t!==null&&this.isLabelDependentOnLink(t,this.originalLink)||i!==null&&this.isLabelDependentOnLink(i,this.originalLink))||t!==null&&i!==null&&(t.data===null&&i.data!==null||t.data!==null&&i.data===null)||!this.isValidCycle(t,i,this.originalLink))return!1;let n;return t!==null&&e!==null&&(n=t.linkValidation,n!==null&&!n(t,e,i,s,this.originalLink))||i!==null&&s!==null&&(n=i.linkValidation,n!==null&&!n(t,e,i,s,this.originalLink))?!1:(n=this.linkValidation,n!==null?n(t,e,i,s,this.originalLink):!0)}isLabelDependentOnLink(t,e){if(t===null)return!1;let i=t.labeledLink;if(i===null)return!1;if(i===e)return!0;let s=new V;return s.add(t),this.VS(i,e,s)}VS(t,e,i){if(t===e)return!0;let s=t.fromNode;if(s!==null&&s.labeledLink&&(i.add(s),this.VS(s.labeledLink,e,i)))return!0;let n=t.toNode;return!!(n!==null&&n.labeledLink&&(i.add(n),this.VS(n.labeledLink,e,i)))}isValidCycle(t,e,i){if(i===void 0&&(i=null),t===null||e===null)return this.isUnconnectedLinkValid;let s=this.diagram,n=1;if(s&&(s.model.Vm()?n=s.isTreePathToChildren?5:6:n=s.validCycle),n===1)return!0;if(n===5){let o=i||this.temporaryLink;if(o!==null&&!o.isTreeLink)return!0;let r=e.linksConnected;for(;r.next();){let a=r.value;if(a!==i&&a.isTreeLink&&a.toNode===e)return!1}return!this.Uu(t,e,i,!0)}else if(n===6){let o=i||this.temporaryLink;if(o!==null&&!o.isTreeLink)return!0;let r=t.linksConnected;for(;r.next();){let a=r.value;if(a!==i&&a.isTreeLink&&a.fromNode===t)return!1}return!this.Uu(t,e,i,!0)}else{if(n===2)return!this.yR(t,e,i);if(n===3)return!this.Uu(t,e,i,!1);if(n===4)return!this.wR(t,e,i)}return!0}Uu(t,e,i,s){if(t===e)return!0;if(t===null||e===null)return!1;let n=t.linksConnected;for(;n.next();){let o=n.value;if(o===i||s&&!o.isTreeLink||o.toNode!==t)continue;let r=o.fromNode;if(!(r===t||r===null)&&this.Uu(r,e,i,s))return!0}return!1}yR(t,e,i){if(t===e)return!0;let s=new Set;return s.add(e),this.NA(s,t,e,i)}NA(t,e,i,s){if(e===i)return!0;if(e===null||i===null||t.has(e))return!1;t.add(e);let n=e.linksConnected;for(;n.next();){let o=n.value;if(o===s||o.toNode!==e)continue;let r=o.fromNode;if(!(r===e||r===null)&&this.NA(t,r,i,s))return!0}return!1}wR(t,e,i){if(t===e)return!0;let s=new Set;return s.add(e),this.CA(s,t,e,i)}CA(t,e,i,s){if(e===i)return!0;if(e===null||i===null||t.has(e))return!1;t.add(e);let n=e.linksConnected;for(;n.next();){let o=n.value;if(o===s)continue;let r=o.fromNode,a=o.toNode,h=r===e?a:r;if(!(h===e||h===null)&&this.CA(t,h,i,s))return!0}return!1}get linkValidation(){return this.El}set linkValidation(t){t!==null&&m.S(t,ae,"linkValidation"),this.El=t}get portTargeted(){return this.US}set portTargeted(t){t!==null&&m.S(t,ae,"portTargeted"),this.US=t}}var Ts=(x=>(x[x.Either=1]="Either",x[x.ForwardsOnly=2]="ForwardsOnly",x[x.BackwardsOnly=3]="BackwardsOnly",x))(Ts||{});class Le extends ae{BS;zS;P;XS;constructor(t){super(),this.name="Linking",this.BS={},this.zS=null,this.P=1,this.XS=null,t&&Object.assign(this,t)}static Either=1;static ForwardsOnly=2;static BackwardsOnly=3;get archetypeLinkData(){return this.BS}set archetypeLinkData(t){t!==null&&m.wc(t,Le,"archetypeLinkData"),t instanceof $&&m.se(t,j,Le,"archetypeLinkData"),this.BS=t}get archetypeLabelNodeData(){return this.zS}set archetypeLabelNodeData(t){t!==null&&m.wc(t,Le,"archetypeLabelNodeData"),t instanceof $&&m.se(t,J,Le,"archetypeLabelNodeData"),this.zS=t}get direction(){return this.P}set direction(t){this.P=t}get startObject(){return this.XS}set startObject(t){t!==null&&m.se(t,$,Le,"startObject"),this.XS=t}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;return t.isReadOnly||t.isModelReadOnly||!t.allowLink||!t.model.Ax()||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize()?!1:this.findLinkablePort()!==null}findLinkablePort(){let t=this.diagram,e=this.startObject;if(e===null&&(e=t.findObjectAt(t.firstInput.documentPoint,null,null)),e===null)return null;let i=e.part;if(!(i instanceof J))return null;let s=this.direction;if(s===1||s===2){let n=this.findValidLinkablePort(e,!1);if(n!==null)return this.isForwards=!0,n;if(this.startObject===i){let o=i.port;if(this.findValidLinkablePort(o,!1))return this.isForwards=!0,o}}if(s===1||s===3){let n=this.findValidLinkablePort(e,!0);if(n!==null)return this.isForwards=!1,n;if(this.startObject===i){let o=i.port;if(this.findValidLinkablePort(o,!0))return this.isForwards=!1,o}}return null}doActivate(){let t=this.diagram,e=this.findLinkablePort();if(e===null){this.stopTool();return}if(this.startTransaction(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.isForwards){this.temporaryToNode!==null&&(this.temporaryToNode.location=t.lastInput.documentPoint),this.originalFromPort=e;let i=this.originalFromPort.part;i instanceof J&&(this.originalFromNode=i),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else{this.temporaryFromNode!==null&&(this.temporaryFromNode.location=t.lastInput.documentPoint),this.originalToPort=e;let i=this.originalToPort.part;i instanceof J&&(this.originalToNode=i),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)}t.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.ensureBounds(),t.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.ensureBounds(),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.$t(),t.add(this.temporaryLink)),this.isActive=!0}doDeactivate(){this.isActive=!1;let t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()}doStop(){super.doStop(),this.startObject=null}doMouseUp(){if(this.isActive){let t=this.diagram;this.transactionResult=null;let e=null,i=null,s=null,n=null,o=null;try{this.targetPort=this.findTargetPort(this.isForwards);let r=this.targetPort;if(r!==null){let a=r.part;a instanceof J&&(this.isForwards?(this.originalFromNode!==null&&(e=this.originalFromNode,i=this.originalFromPort),s=a,n=r):(e=a,i=r,this.originalToNode!==null&&(s=this.originalToNode,n=this.originalToPort)))}else this.isForwards?this.originalFromNode!==null&&this.isUnconnectedLinkValid&&(e=this.originalFromNode,i=this.originalFromPort):this.originalToNode!==null&&this.isUnconnectedLinkValid&&(s=this.originalToNode,n=this.originalToPort);e!==null||s!==null?(o=this.insertLink(e,i,s,n),o!==null?(r===null&&(this.isForwards?o.defaultToPoint=t.lastInput.documentPoint:o.defaultFromPoint=t.lastInput.documentPoint),t.allowSelect&&(t.T("ChangingSelection",t.selection),t.clearSelection(!0),o.isSelected=!0),this.transactionResult=this.name,t.T("LinkDrawn",o)):this.doNoLink(e,i,s,n)):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),o&&t.allowSelect&&t.T("ChangedSelection",t.selection)}}}isNewTreeLink(){let t=this.archetypeLinkData;if(t===null)return!0;if(t instanceof j)return t.isTreeLink;let e=this.diagram;if(e===null)return!0;let i=e.partManager.getLinkCategoryForData(t),s=e.partManager.findLinkTemplateForCategory(i);return s!==null?s.isTreeLink:!0}insertLink(t,e,i,s){return this.diagram.partManager.insertLink(t,e,i,s)}doNoLink(t,e,i,s){}}class $e extends ae{LA=null;AA=null;GS=null;YS=null;Ss;KS;constructor(t){super(),this.name="Relinking",this.fromHandleArchetype=new et("Diamond",{desiredSize:st.Pu,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:0}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.toHandleArchetype=new et("Diamond",{desiredSize:st.Pu,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:-1}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.Ss=null,this.KS=new I,t&&Object.assign(this,t)}updateAdornments(t){if(t===null||!(t instanceof j))return;let e="RelinkFrom",i=null;if(t.isSelected&&!this.diagram.isReadOnly){let s=t.selectionObject;s!==null&&t.canRelinkFrom()&&t.actualBounds.isReal()&&t.isVisible()&&s.actualBounds.isReal()&&s.isVisibleObject()&&(i=t.findAdornment(e),i===null&&(i=this.makeAdornment(s,!1),t.addAdornment(e,i)))}if(i===null&&t.removeAdornment(e),e="RelinkTo",i=null,t.isSelected&&!this.diagram.isReadOnly){let s=t.selectionObject;s!==null&&t.canRelinkTo()&&t.actualBounds.isReal()&&t.isVisible()&&s.actualBounds.isReal()&&s.isVisibleObject()&&(i=t.findAdornment(e),i===null?(i=this.makeAdornment(s,!0),t.addAdornment(e,i)):i.f())}i===null&&t.removeAdornment(e)}makeAdornment(t,e){let i=e?this.YS:this.GS;return i&&(i=i.copy(),i.adornedObject=t),i}get fromHandleArchetype(){return this.LA}set fromHandleArchetype(t){t!==null&&m.se(t,$,$e,"fromHandleArchetype"),this.LA=t,t!==null?this.GS=new vt(G.Link).add(t).It():this.GS=null}get toHandleArchetype(){return this.AA}set toHandleArchetype(t){t!==null&&m.se(t,$,$e,"toHandleArchetype"),this.AA=t,t!==null?this.YS=new vt(G.Link).add(t).It():this.YS=null}get handle(){return this.Ss}set handle(t){t!==null&&(t.part instanceof vt||m.o("new handle is not in an Adornment: "+t)),this.Ss=t}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowRelink||!t.model.Ax()||!t.lastInput.left)return!1;let e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom");return e===null&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo")),e!==null}doActivate(){let t=this.diagram;if(this.originalLink===null){let i=this.handle;if(i===null&&(i=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom"),i===null&&(i=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo"))),i===null)return;let s=i.part;if(!(s instanceof vt)||!(s.adornedPart instanceof j))return;this.handle=i,this.isForwards=s===null||s.category==="RelinkTo",this.originalLink=s.adornedPart}let e=this.originalLink;e!==null&&(this.startTransaction(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.originalFromPort=e.fromPort,this.originalFromNode=e.fromNode,this.originalToPort=e.toPort,this.originalToNode=e.toNode,this.KS.set(e.actualBounds),e.pointsCount>0&&(e.fromNode===null&&(this.temporaryFromPort!==null&&(this.temporaryFromPort.desiredSize=st.xc),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=e.getPoint(0))),e.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=st.xc),this.temporaryToNode!==null&&(this.temporaryToNode.location=e.getPoint(e.pointsCount-1)))),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0),t.add(this.temporaryFromNode),t.add(this.temporaryToNode),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(e,this.temporaryLink),this.temporaryLink.$t(),t.add(this.temporaryLink)),this.isActive=!0)}copyLinkProperties(t,e){if(t===null||e===null)return;e.adjusting=t.adjusting,e.corner=t.corner;let i=t.curve;(i===11||i===10)&&(i=0),e.curve=i,e.curviness=t.curviness,e.isTreeLink=t.isTreeLink,e.points=t.points,e.routing=t.routing,e.smoothness=t.smoothness,e.fromSpot=t.fromSpot,e.fromEndSegmentLength=t.fromEndSegmentLength,e.fromShortLength=t.fromShortLength,e.toSpot=t.toSpot,e.toEndSegmentLength=t.toEndSegmentLength,e.toShortLength=t.toShortLength}doDeactivate(){this.isActive=!1;let t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()}doStop(){super.doStop(),this.handle=null}doMouseUp(){if(this.isActive){let t=this.diagram;this.transactionResult=null;let e=this.originalFromNode,i=this.originalFromPort,s=this.originalToNode,n=this.originalToPort,o=this.originalLink;try{if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null){let r=this.targetPort.part;r instanceof J&&(this.isForwards?(s=r,n=this.targetPort):(e=r,i=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?(s=null,n=null):(e=null,i=null):o=null;o!==null?(this.reconnectLink(o,this.isForwards?s:e,this.isForwards?n:i,this.isForwards),this.targetPort===null&&(this.isForwards?o.defaultToPoint=t.lastInput.documentPoint:o.defaultFromPoint=t.lastInput.documentPoint,o.$t()),this.transactionResult=this.name,t.T("LinkRelinked",o,this.isForwards?this.originalToPort:this.originalFromPort)):this.originalLink!==null&&this.doNoRelink(this.originalLink,this.isForwards),this.originalLink!==null&&this.originalLink.invalidateOtherJumpOvers(this.KS)}finally{this.stopTool()}}}reconnectLink(t,e,i,s){let n=i!==null&&i.portId!==null?i.portId:"";return s?(t.toNode=e,t.toPortId=n):(t.fromNode=e,t.fromPortId=n),!0}doNoRelink(t,e){}doDraggingMouseMove(t,e,i,s){t!==null?(this.copyPortProperties(t,e,this.temporaryFromNode,this.temporaryFromPort,!1),this.diagram.add(this.temporaryFromNode)):this.diagram.remove(this.temporaryFromNode),i!==null?(this.copyPortProperties(i,s,this.temporaryToNode,this.temporaryToPort,!0),this.diagram.add(this.temporaryToNode)):this.diagram.remove(this.temporaryToNode)}stopDraggingMouseMove(){this.diagram.remove(this.temporaryFromNode),this.diagram.remove(this.temporaryToNode)}}var Ls=(x=>(x[x.None=0]="None",x[x.Horizontal=1]="Horizontal",x[x.Vertical=2]="Vertical",x[x.All=3]="All",x))(Ls||{});class Je extends $t{Sr;HS;qS;Ss;Tx;jS;Bm;constructor(t){super(),this.name="LinkReshaping",this.Sr=new et("Rectangle",{desiredSize:st.IL,fill:"lightblue",stroke:"dodgerblue"}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.HS=new et("Diamond",{desiredSize:st.Pu,fill:"lightblue",stroke:"dodgerblue",cursor:"move"}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.qS=3,this.Ss=null,this.Tx=null,this.jS=new P,this.Bm=new q,t&&Object.assign(this,t)}static None=0;static Horizontal=1;static Vertical=2;static All=3;getReshapingBehavior(t){return t?t.Mr:0}setReshapingBehavior(t,e){t.Mr=e}updateAdornments(t){if(t===null||!(t instanceof j))return;let e=null;if(t.isSelected&&!this.diagram.isReadOnly){let i=t.path;i!==null&&t.canReshape()&&t.actualBounds.isReal()&&t.isVisible()&&i.actualBounds.isReal()&&i.isVisibleObject()&&(e=t.findAdornment(this.name),(e===null||e.WS!==t.pointsCount||e.JS!==t.resegmentable)&&(e=this.makeAdornment(i),e!==null&&(e.WS=t.pointsCount,e.JS=t.resegmentable,t.addAdornment(this.name,e))))}e===null&&t.removeAdornment(this.name)}makeAdornment(t){let e=t.part,i=e.points,s=e.pointsCount,n=e.isOrthogonal,o=null;if(i!==null&&s>1){o=new vt,o.type=G.Link;let r=e.firstPickIndex,a=e.lastPickIndex,h=n?1:0;if(e.resegmentable&&(e.computeCurve()!==9||e.isOrthogonal))for(let c=r+h;c<a-h;c++){let d=this.makeResegmentHandle(t,c);d!==null&&(d.segmentIndex=c,d.segmentFraction=.5,d.fromMaxLinks=999,o.add(d))}let l=r+1,u=a-1;for(;l<=u;)if(l<u)this.$S(t,o,r,a,l),this.$S(t,o,r,a,u),l++,u--;else if(l===u){this.$S(t,o,r,a,l);break}o.adornedObject=t}return o}$S(t,e,i,s,n){let o=t.part,r=o.isOrthogonal,a=this.makeHandle(t,n);if(a!==null){if(a.segmentIndex=n,n!==i)if(n===i+1&&r){let h=o.getPoint(i),l=o.getPoint(i+1);C.c(h.x,l.x)&&C.c(h.y,l.y)?(l=o.getPoint(i-1),C.c(h.x,l.x)?(this.setReshapingBehavior(a,2),a.cursor="n-resize"):C.c(h.y,l.y)&&(this.setReshapingBehavior(a,1),a.cursor="w-resize")):C.c(h.x,l.x)?(this.setReshapingBehavior(a,2),a.cursor="n-resize"):C.c(h.y,l.y)&&(this.setReshapingBehavior(a,1),a.cursor="w-resize")}else if(n===s-1&&r){let h=o.getPoint(s-1),l=o.getPoint(s);C.c(h.x,l.x)&&C.c(h.y,l.y)?(h=o.getPoint(s+1),C.c(h.x,l.x)?(this.setReshapingBehavior(a,2),a.cursor="n-resize"):C.c(h.y,l.y)&&(this.setReshapingBehavior(a,1),a.cursor="w-resize")):C.c(h.x,l.x)?(this.setReshapingBehavior(a,2),a.cursor="n-resize"):C.c(h.y,l.y)&&(this.setReshapingBehavior(a,1),a.cursor="w-resize")}else n===s||(this.setReshapingBehavior(a,3),a.cursor="move");e.add(a)}}makeHandle(t,e){let i=this.handleArchetype;return i===null?null:i.copy().ZS()}get handleArchetype(){return this.Sr}set handleArchetype(t){t!==null&&m.se(t,$,Je,"handleArchetype"),this.Sr=t}makeResegmentHandle(t,e){let i=this.midHandleArchetype;return i===null?null:i.copy().ZS()}get midHandleArchetype(){return this.HS}set midHandleArchetype(t){t!==null&&m.se(t,$,Je,"midHandleArchetype"),this.HS=t}get handle(){return this.Ss}set handle(t){t!==null&&(t.part instanceof vt||m.o("new handle is not in an Adornment: "+t)),this.Ss=t}get adornedLink(){return this.Tx}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;return t.isReadOnly||!t.allowReshape||!t.lastInput.left?!1:this.findToolHandleAt(t.firstInput.documentPoint,this.name)!==null}doActivate(){let t=this.diagram;if(this.handle===null&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),this.handle===null)return;let e=this.handle.part.adornedPart;if(e instanceof j){if(this.Tx=e,t.isMouseCaptured=!0,this.startTransaction(this.name),e.resegmentable&&this.handle.fromMaxLinks===999){let i=e.points.copy(),s=this.getResegmentingPoint();if(i.insertAt(this.handle.segmentIndex+1,s),e.isOrthogonal&&i.insertAt(this.handle.segmentIndex+1,s),e.points=i,e.invalidateAdornments(),e.updateAdornments(),this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name),this.handle===null){this.doDeactivate();return}}this.jS=e.getPoint(this.handle.segmentIndex),this.Bm=e.points.copy(),this.isActive=!0}}doDeactivate(){this.stopTransaction(),this.handle=null,this.Tx=null;let t=this.diagram;t.isMouseCaptured=!1,this.isActive=!1}stopTransaction(){let t=this.diagram,e=super.stopTransaction();return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.optimize(),e}doCancel(){let t=this.adornedLink;t!==null&&(t.points=this.Bm),this.stopTool()}getResegmentingPoint(){return this.handle===null?this.diagram.lastInput.documentPoint:this.handle.getDocumentPoint(T.Center)}doMouseMove(){let t=this.diagram;if(this.isActive){let e=this.computeReshape(t.lastInput.documentPoint);this.reshape(e)}}doMouseUp(){let t=this.diagram;if(this.isActive){let e=this.computeReshape(t.lastInput.documentPoint);this.reshape(e);let i=this.adornedLink;if(i!==null&&i.resegmentable&&this.handle!==null&&(i.computeCurve()!==9||i.isOrthogonal)){let s=this.handle.segmentIndex,n=i.getPoint(s-1),o=i.getPoint(s),r=i.getPoint(s+1);if(i.isOrthogonal){if(s>i.firstPickIndex+1&&s<i.lastPickIndex-1){let a=i.getPoint(s-2);if(this.isWithinResegmentingDistance(n,o)&&(this.isInLineOrtho(a,n,o,r,!0)||this.isInLineOrtho(a,n,o,r,!1))){let h=i.points.copy();this.isInLineOrtho(a,n,o,r,!0)?(h.setElt(s-2,new P(a.x,(r.y+a.y)/2)),h.setElt(s+1,new P(r.x,(r.y+a.y)/2))):(h.setElt(s-2,new P((r.x+a.x)/2,a.y)),h.setElt(s+1,new P((r.x+a.x)/2,r.y))),h.removeAt(s),h.removeAt(s-1),i.points=h,i.invalidateAdornments()}else if(a=i.getPoint(s+2),this.isWithinResegmentingDistance(o,r)&&(this.isInLineOrtho(n,o,r,a,!0)||this.isInLineOrtho(n,o,r,a,!1))){let h=i.points.copy();this.isInLineOrtho(n,o,r,a,!0)?(h.setElt(s-1,new P(n.x,(n.y+a.y)/2)),h.setElt(s+2,new P(a.x,(n.y+a.y)/2))):(h.setElt(s-1,new P((n.x+a.x)/2,n.y)),h.setElt(s+2,new P((n.x+a.x)/2,a.y))),h.removeAt(s+1),h.removeAt(s),i.points=h,i.invalidateAdornments()}}}else{let a=P.l();if(C.Nl(n.x,n.y,r.x,r.y,o.x,o.y,a)&&a.distanceSquaredPoint(o)<this.resegmentingDistance*this.resegmentingDistance){let h=i.points.copy();h.removeAt(s),i.points=h,i.invalidateAdornments()}P.i(a)}}t.invalidateDocumentBounds(),this.transactionResult=this.name,t.T("LinkReshaped",this.adornedLink,this.Bm)}this.stopTool()}isWithinResegmentingDistance(t,e){return Math.abs(t.x-e.x)<this.resegmentingDistance&&Math.abs(t.y-e.y)<this.resegmentingDistance}isInLineOrtho(t,e,i,s,n){return n?Math.abs(t.y-e.y)<this.resegmentingDistance&&Math.abs(e.y-i.y)<this.resegmentingDistance&&Math.abs(i.y-s.y)<this.resegmentingDistance:Math.abs(t.x-e.x)<this.resegmentingDistance&&Math.abs(e.x-i.x)<this.resegmentingDistance&&Math.abs(i.x-s.x)<this.resegmentingDistance}get resegmentingDistance(){return this.qS}set resegmentingDistance(t){m.s(t,"number",Je,"resegmentingDistance"),this.qS=t}reshape(t){let e=this.adornedLink;if(e===null)return;let i=this.handle;if(i===null)return;e.startRoute();let s=i.segmentIndex,n=this.getReshapingBehavior(i);if(e.isOrthogonal)if(s===e.firstPickIndex+1){let o=e.firstPickIndex+1;n===2?(e.setPointAt(o,e.getPoint(o-1).x,t.y),e.setPointAt(o+1,e.getPoint(o+2).x,t.y)):n===1&&(e.setPointAt(o,t.x,e.getPoint(o-1).y),e.setPointAt(o+1,t.x,e.getPoint(o+2).y))}else if(s===e.lastPickIndex-1){let o=e.lastPickIndex-1;n===2?(e.setPointAt(o-1,e.getPoint(o-2).x,t.y),e.setPointAt(o,e.getPoint(o+1).x,t.y)):n===1&&(e.setPointAt(o-1,t.x,e.getPoint(o-2).y),e.setPointAt(o,t.x,e.getPoint(o+1).y))}else{let o=s,r=e.getPoint(o);if(!t.equalsApprox(r)){let a=e.getPoint(o-2),h=e.getPoint(o-1),l=e.getPoint(o+1),u=e.getPoint(o+2);C.c(h.x,r.x)&&C.c(r.y,l.y)?(C.c(h.x,a.x)&&!C.c(h.y,a.y)&&!C.c(t.x,r.x)?(e.insertPointAt(o,t.x,h.y),s++,o++):e.setPointAt(o-1,t.x,h.y),C.c(l.y,u.y)&&!C.c(l.x,u.x)&&!C.c(t.y,r.y)?e.insertPointAt(o+1,l.x,t.y):e.setPointAt(o+1,l.x,t.y)):C.c(h.y,r.y)&&C.c(r.x,l.x)?(C.c(h.y,a.y)&&!C.c(h.x,a.x)&&!C.c(t.y,r.y)?(e.insertPointAt(o,h.x,t.y),s++,o++):e.setPointAt(o-1,h.x,t.y),C.c(l.x,u.x)&&!C.c(l.y,u.y)&&!C.c(t.x,r.x)?e.insertPointAt(o+1,t.x,l.y):e.setPointAt(o+1,t.x,l.y)):C.c(h.x,r.x)&&C.c(r.x,l.x)?(C.c(h.x,a.x)&&!C.c(h.y,a.y)&&!C.c(t.x,r.x)?(e.insertPointAt(o,t.x,h.y),s++,o++):e.setPointAt(o-1,t.x,h.y),C.c(l.x,u.x)&&!C.c(l.y,u.y)&&!C.c(t.x,r.x)?e.insertPointAt(o+1,t.x,l.y):e.setPointAt(o+1,t.x,l.y)):C.c(h.y,r.y)&&C.c(r.y,l.y)&&(C.c(h.y,a.y)&&!C.c(h.x,a.x)&&!C.c(t.y,r.y)?(e.insertPointAt(o,h.x,t.y),s++,o++):e.setPointAt(o-1,h.x,t.y),C.c(l.y,u.y)&&!C.c(l.x,u.x)&&!C.c(t.y,r.y)?e.insertPointAt(o+1,l.x,t.y):e.setPointAt(o+1,l.x,t.y)),e.setPointAt(s,t.x,t.y)}}else{e.setPointAt(s,t.x,t.y);let o=e.fromNode,r=e.fromPort;if(o!==null){let l=o.findVisibleNode();l!==null&&l!==o&&(o=l,r=o.port)}if(s===1&&r!==null&&e.computeSpot(!0,r).isNoSpot()){let l=r.getDocumentPoint(T.Center,P.l()),u=e.getLinkPointFromPoint(o,r,l,t,!0,P.l());e.setPointAt(0,u.x,u.y),P.i(l),P.i(u)}let a=e.toNode,h=e.toPort;if(a!==null){let l=a.findVisibleNode();l!==null&&l!==a&&(a=l,h=a.port)}if(s===e.pointsCount-2&&h!==null&&e.computeSpot(!1,h).isNoSpot()){let l=h.getDocumentPoint(T.Center,P.l()),u=e.getLinkPointFromPoint(a,h,l,t,!1,P.l());e.setPointAt(e.pointsCount-1,u.x,u.y),P.i(l),P.i(u)}}e.commitRoute()}computeReshape(t){let e=this.adornedLink;if(e===null)return t;let i=this.handle;if(i===null)return t;let s=i.segmentIndex;switch(this.getReshapingBehavior(i)){case 3:return t;case 2:{let n=e.getPoint(s);return new P(n.x,t.y)}case 1:{let n=e.getPoint(s);return new P(t.x,n.y)}default:case 0:return e.getPoint(s)}}get originalPoint(){return this.jS}get originalPoints(){return this.Bm}}class Ze extends $t{Nr;Cr;Ro;Rc;QS;Ms;Sr;Ss;zm;_S;Oc;Dx;vx;Fx;constructor(t){super(),this.name="Resizing",this.Nr=new st(1,1).k(),this.Cr=new st(9999,9999).k(),this.Ro=new st(NaN,NaN).k(),this.Rc=!1,this.QS=!0,this.Ms=null,this.Sr=new et("Rectangle",{alignmentFocus:T.Center,desiredSize:st.IL,fill:"lightblue",stroke:"dodgerblue",strokeWidth:1,cursor:"pointer"}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.Ss=null,this.zm=new P,this._S=new st,this.Oc=new P,this.Dx=new st(0,0),this.vx=new st(1/0,1/0),this.Fx=new st(1,1),t&&Object.assign(this,t)}updateAdornments(t){if(t!==null){if(t.Lr()){let e=t.rotateObject;if(e===t||e===t.path||e.isPanelMain)return}if(t.isSelected&&!this.diagram.isReadOnly){let e=t.resizeObject,i=t.findAdornment(this.name);if(e!==null&&t.canResize()&&t.actualBounds.isReal()&&t.isVisible()&&e.actualBounds.isReal()&&e.isVisibleObject()&&((i===null||i.adornedObject!==e)&&(i=this.makeAdornment(e)),i!==null)){let s=e.getDocumentAngle();t.Ul()&&this.updateResizeHandles(i,s),t.addAdornment(this.name,i);return}}t.removeAdornment(this.name)}}makeAdornment(t){let e=null,i=t.part?.resizeAdornmentTemplate;if(i){if(e=i.copy(),e===null)return null}else{e=new vt,e.type=G.Spot,e.locationSpot=T.Center;let s=new le;s.isPanelMain=!0,e.add(s);let n=this.makeHandle(t,T.TopLeft);n!==null&&e.add(n),n=this.makeHandle(t,T.TopRight),n!==null&&e.add(n),n=this.makeHandle(t,T.BottomRight),n!==null&&e.add(n),n=this.makeHandle(t,T.BottomLeft),n!==null&&e.add(n),n=this.makeHandle(t,T.MiddleTop),n!==null&&e.add(n),n=this.makeHandle(t,T.MiddleRight),n!==null&&e.add(n),n=this.makeHandle(t,T.MiddleBottom),n!==null&&e.add(n),n=this.makeHandle(t,T.MiddleLeft),n!==null&&e.add(n)}return e.adornedObject=t,e}makeHandle(t,e){let i=this.handleArchetype;if(i===null)return null;let s=i.copy().ZS();return s.alignment=e,s}updateResizeHandles(t,e){if(t!==null){if(!t.alignment.isDefault()&&(t.cursor==="pointer"||t.cursor.indexOf("resize")>0))this.xR(t,e);else if(t instanceof G){let i=t.elements;for(;i.next();){let s=i.value;this.updateResizeHandles(s,e)}}}}xR(t,e){let i=t.alignment;i.isNoSpot()&&(i=T.Center);let s=e;if(i.x<=0)i.y<=0?s+=225:i.y>=1?s+=135:s+=180;else if(i.x>=1)i.y<=0?s+=315:i.y>=1&&(s+=45);else if(i.y<=0)s+=270;else if(i.y>=1)s+=90;else return;s=C.Ee(s),s<22.5?t.cursor="e-resize":s<67.5?t.cursor="se-resize":s<112.5?t.cursor="s-resize":s<157.5?t.cursor="sw-resize":s<202.5?t.cursor="w-resize":s<247.5?t.cursor="nw-resize":s<292.5?t.cursor="n-resize":s<337.5?t.cursor="ne-resize":t.cursor="e-resize"}get handleArchetype(){return this.Sr}set handleArchetype(t){t!==null&&m.se(t,$,Ze,"handleArchetype"),this.Sr=t}get handle(){return this.Ss}set handle(t){t!==null&&(t.part instanceof vt||m.o("new handle is not in an Adornment: "+t)),this.Ss=t}get adornedObject(){return this.Ms}set adornedObject(t){t!==null&&t.part instanceof vt&&m.o("new handle must not be in an Adornment: "+t),this.Ms=t}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;return t.isReadOnly||!t.allowResize||!t.lastInput.left?!1:this.findToolHandleAt(t.firstInput.documentPoint,this.name)!==null}doActivate(){let t=this.diagram;this.handle===null&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),this.handle!==null&&(this.adornedObject=this.handle.part.adornedObject,this.adornedObject!==null&&this.adornedObject.part!==null&&(t.isMouseCaptured=!0,t.animationManager.stopAnimation(),t.Ou=!0,this.startTransaction(this.name),this.zm.set(this.adornedObject.getDocumentPoint(this.handle.alignment.opposite())),this.Oc.set(this.adornedObject.part.location),this._S.set(this.adornedObject.desiredSize),this.Fx=this.computeCellSize(),this.Dx=this.computeMinSize(),this.vx=this.computeMaxSize(),this.isActive=!0))}doDeactivate(){let t=this.diagram;t.Ou=!1,t.Fl=!0,this.stopTransaction(),this.handle=null,this.Ms=null,t.isMouseCaptured=!1,this.isActive=!1}stopTransaction(){let t=this.diagram,e=super.stopTransaction();return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.optimize(),e}doCancel(){this.adornedObject!==null&&this.adornedObject.part!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()}doMouseMove(){let t=this.diagram;if(!this.isActive||this.adornedObject===null||this.handle===null)return;let e=this.Dx,i=this.vx,s=this.Fx,n=t.lastInput.documentPoint,o=this.adornedObject.getLocalPoint(n,P.l()),r=this.computeReshape(),a=this.computeResize(o,this.handle.alignment,e,i,s,r);this.resize(a),t.maybeUpdate(),P.i(o)}doMouseUp(){let t=this.diagram;if(this.isActive&&this.adornedObject!==null&&this.handle!==null){let e=this.Dx,i=this.vx,s=this.Fx,n=this.adornedObject.getLocalPoint(t.lastInput.documentPoint,P.l()),o=this.computeReshape(),r=this.computeResize(n,this.handle.alignment,e,i,s,o);this.resize(r),P.i(n),t.invalidateDocumentBounds(),this.transactionResult=this.name,t.T("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}resize(t){let e=this.diagram,i=this.adornedObject;if(i===null)return;i.desiredSize=t.size;let s=i.part;if(s===null||this.handle===null)return;s.ensureBounds();let n=i.getDocumentPoint(this.handle.alignment.opposite());if(s instanceof ht){let o=new q;o.add(s);let r;!this.dragsMembers&&!s.hasPlaceholder()&&(r=new Pi,r.dragsMembers=!1),e.moveParts(o,this.oppositePoint.copy().subtract(n),!0,r)}else s.location=s.location.copy().subtract(n).add(this.oppositePoint);e.maybeUpdate()}computeResize(t,e,i,s,n,o){if(this.adornedObject===null)return I.em;e.isNoSpot()&&(e=T.Center);let r=this.adornedObject.naturalBounds,a=r.x,h=r.y,l=r.x+r.width,u=r.y+r.height,c=1;if(!o){let p=r.width,g=r.height;p<=0&&(p=1),g<=0&&(g=1),c=g/p}let d=P.l();C.tm(t.x,t.y,a,h,n.width,n.height,d);let f=r.copy();return e.x<=0?e.y<=0?(f.x=Math.max(d.x,l-s.width),f.x=Math.min(f.x,l-i.width),f.width=Math.max(l-f.x,i.width),f.y=Math.max(d.y,u-s.height),f.y=Math.min(f.y,u-i.height),f.height=Math.max(u-f.y,i.height),o||(f.height/f.width>=1?(f.height=Math.max(Math.min(c*f.width,s.height),i.height),f.width=f.height/c):(f.width=Math.max(Math.min(f.height/c,s.width),i.width),f.height=c*f.width),f.x=l-f.width,f.y=u-f.height)):e.y>=1?(f.x=Math.max(d.x,l-s.width),f.x=Math.min(f.x,l-i.width),f.width=Math.max(l-f.x,i.width),f.height=Math.max(Math.min(d.y-h,s.height),i.height),o||(f.height/f.width>=1?(f.height=Math.max(Math.min(c*f.width,s.height),i.height),f.width=f.height/c):(f.width=Math.max(Math.min(f.height/c,s.width),i.width),f.height=c*f.width),f.x=l-f.width)):(f.x=Math.max(d.x,l-s.width),f.x=Math.min(f.x,l-i.width),f.width=l-f.x,o||(f.height=Math.max(Math.min(c*f.width,s.height),i.height),f.width=f.height/c,f.y=h+.5*(u-h-f.height))):e.x>=1?e.y<=0?(f.width=Math.max(Math.min(d.x-a,s.width),i.width),f.y=Math.max(d.y,u-s.height),f.y=Math.min(f.y,u-i.height),f.height=Math.max(u-f.y,i.height),o||(f.height/f.width>=1?(f.height=Math.max(Math.min(c*f.width,s.height),i.height),f.width=f.height/c):(f.width=Math.max(Math.min(f.height/c,s.width),i.width),f.height=c*f.width),f.y=u-f.height)):e.y>=1?(f.width=Math.max(Math.min(d.x-a,s.width),i.width),f.height=Math.max(Math.min(d.y-h,s.height),i.height),o||(f.height/f.width>=1?(f.height=Math.max(Math.min(c*f.width,s.height),i.height),f.width=f.height/c):(f.width=Math.max(Math.min(f.height/c,s.width),i.width),f.height=c*f.width))):(f.width=Math.max(Math.min(d.x-a,s.width),i.width),o||(f.height=Math.max(Math.min(c*f.width,s.height),i.height),f.width=f.height/c,f.y=h+.5*(u-h-f.height))):e.y<=0?(f.y=Math.max(d.y,u-s.height),f.y=Math.min(f.y,u-i.height),f.height=u-f.y,o||(f.width=Math.max(Math.min(f.height/c,s.width),i.width),f.height=c*f.width,f.x=a+.5*(l-a-f.width))):e.y>=1&&(f.height=Math.max(Math.min(d.y-h,s.height),i.height),o||(f.width=Math.max(Math.min(f.height/c,s.width),i.width),f.height=c*f.width,f.x=a+.5*(l-a-f.width))),P.i(d),f}computeReshape(){let t=0;return this.adornedObject instanceof et&&(t=this.adornedObject.tM()),!(t===6||this.diagram.lastInput.shift)}computeMinSize(){if(this.adornedObject===null)return st.xc;let t=this.adornedObject.minSize.copy(),e=this.minSize;return!isNaN(e.width)&&e.width>t.width&&(t.width=e.width),!isNaN(e.height)&&e.height>t.height&&(t.height=e.height),t}computeMaxSize(){if(this.adornedObject===null)return st.DP;let t=this.adornedObject.maxSize.copy(),e=this.maxSize;return!isNaN(e.width)&&e.width<t.width&&(t.width=e.width),!isNaN(e.height)&&e.height<t.height&&(t.height=e.height),t}computeCellSize(){let t=new st(NaN,NaN),e=this.adornedObject?.part;if(e){let n=e.resizeCellSize;!isNaN(n.width)&&n.width>0&&(t.width=n.width),!isNaN(n.height)&&n.height>0&&(t.height=n.height)}let i=this.cellSize;isNaN(t.width)&&!isNaN(i.width)&&i.width>0&&(t.width=i.width),isNaN(t.height)&&!isNaN(i.height)&&i.height>0&&(t.height=i.height);let s=this.diagram;if((isNaN(t.width)||isNaN(t.height))&&s){let n=s.grid;n!==null&&n.visible&&this.isGridSnapEnabled&&(i=n.gridCellSize,isNaN(t.width)&&!isNaN(i.width)&&i.width>0&&(t.width=i.width),isNaN(t.height)&&!isNaN(i.height)&&i.height>0&&(t.height=i.height))}return(isNaN(t.width)||t.width===0||t.width===1/0)&&(t.width=1),(isNaN(t.height)||t.height===0||t.height===1/0)&&(t.height=1),t}get minSize(){return this.Nr}set minSize(t){if(!this.Nr.equals(t)){let e=t.width;isNaN(e)&&(e=0);let i=t.height;isNaN(i)&&(i=0),this.Nr.e(e,i)}}get maxSize(){return this.Cr}set maxSize(t){if(!this.Cr.equals(t)){let e=t.width;isNaN(e)&&(e=1/0);let i=t.height;isNaN(i)&&(i=1/0),this.Cr.e(e,i)}}get cellSize(){return this.Ro}set cellSize(t){this.Ro.equals(t)||this.Ro.h(t)}get isGridSnapEnabled(){return this.Rc}set isGridSnapEnabled(t){m.s(t,"boolean",Ze,"isGridSnapEnabled"),this.Rc=t}get dragsMembers(){return this.QS}set dragsMembers(t){m.s(t,"boolean",Ze,"dragsMembers"),this.QS=t}get oppositePoint(){return this.zm}set oppositePoint(t){this.zm.equals(t)||this.zm.h(t)}get originalDesiredSize(){return this._S}get originalLocation(){return this.Oc}}class De extends $t{eM;iM;Ms=null;Sr=null;Rx=null;Ss=null;sM;Xm;Oc;nM;oM;constructor(t){super(),this.name="Rotating",this.eM=45,this.iM=2,this.Oc=new P,this.Ms=null,this.handleArchetype=new et("Ellipse",{desiredSize:st.Pu,fill:"lightblue",stroke:"dodgerblue",strokeWidth:1,cursor:"pointer"}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.Ss=null,this.sM=0,this.Xm=new P(NaN,NaN),this.nM=0,this.oM=50,t&&Object.assign(this,t)}updateAdornments(t){if(t!==null){if(t.Lr()){let e=t.rotateObject;if(e===t||e===t.path||e.isPanelMain)return}if(t.isSelected&&!this.diagram.isReadOnly){let e=t.rotateObject;if(e!==null&&t.canRotate()&&t.actualBounds.isReal()&&t.isVisible()&&e.actualBounds.isReal()&&e.isVisibleObject()){let i=t.findAdornment(this.name);if((i===null||i.adornedObject!==e)&&(i=this.makeAdornment(e)),i!==null){i.angle=e.getDocumentAngle(),i.hasPlaceholder()||(i.location=this.computeAdornmentLocation(e)),t.addAdornment(this.name,i);return}}}t.removeAdornment(this.name)}}makeAdornment(t){let e=null,i=t.part?.rotateAdornmentTemplate;return i?e=i.copy():this.Rx!==null&&(e=this.Rx.copy()),e===null?null:(e.adornedObject=t,e)}get handleArchetype(){return this.Sr}set handleArchetype(t){t!==null&&m.se(t,$,De,"handleArchetype"),this.Sr=t,t!==null?this.Rx=new vt(G.Position,{locationSpot:T.Center}).add(t).It():this.Rx=null}get handle(){return this.Ss}set handle(t){t!==null&&(t.part instanceof vt||m.o("new handle is not in an Adornment: "+t)),this.Ss=t}get adornedObject(){return this.Ms}set adornedObject(t){t!==null&&t.part instanceof vt&&m.o("new handle must not be in an Adornment: "+t),this.Ms=t}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;return t.isReadOnly||!t.allowRotate||!t.lastInput.left?!1:this.findToolHandleAt(t.firstInput.documentPoint,this.name)!==null}doActivate(){let t=this.diagram;if(this.adornedObject===null){if(this.handle===null&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),this.handle===null)return;this.adornedObject=this.handle.part.adornedObject}this.adornedObject===null||this.adornedObject.part===null||(t.isMouseCaptured=!0,t.delaysLayout=!0,this.startTransaction(this.name),this.sM=this.adornedObject.angle,this.Xm=this.computeRotationPoint(this.adornedObject),this.Oc=this.adornedObject.part.location.copy(),this.isActive=!0)}computeRotationPoint(t){let e=t.part;if(e!==null){let i=e.locationObject;if(e.rotationSpot.isSpot())return t.getDocumentPoint(e.rotationSpot);if(t===e||t===i)return i.getDocumentPoint(e.locationSpot)}return t.getDocumentPoint(T.Center)}computeAdornmentLocation(t){let e=this.rotationPoint;e.isReal()||(e=this.computeRotationPoint(t));let i=t.getLocalPoint(e),s=this.handleAngle;s=C.Ee(s),s=Math.round(Math.round(s/45)*45);let n=this.handleDistance;return s===0?i.x=t.naturalBounds.width+n:s===45?(i.x=t.naturalBounds.width+n,i.y=t.naturalBounds.height+n):s===90?i.y=t.naturalBounds.height+n:s===135?(i.x=-n,i.y=t.naturalBounds.height+n):s===180?i.x=-n:s===225?(i.x=-n,i.y=-n):s===270?i.y=-n:s===315&&(i.x=t.naturalBounds.width+n,i.y=-n),t.getDocumentPoint(i)}doDeactivate(){let t=this.diagram;this.stopTransaction(),this.handle=null,this.Ms=null,this.Xm=new P(NaN,NaN),t.isMouseCaptured=!1,this.isActive=!1}stopTransaction(){let t=this.diagram,e=super.stopTransaction();return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.optimize(),e}doCancel(){let t=this.diagram;t.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()}doMouseMove(){let t=this.diagram;if(this.isActive){let e=this.computeRotate(t.lastInput.documentPoint);this.rotate(e)}}doMouseUp(){let t=this.diagram;if(this.isActive){t.delaysLayout=!1;let e=this.computeRotate(t.lastInput.documentPoint);this.rotate(e),t.invalidateDocumentBounds(),this.transactionResult=this.name,t.T("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}rotate(t){let e=this.adornedObject;if(e===null||e.part===null)return;e.angle=t;let i=e.part;i.ensureBounds();let s=i.locationObject,n=i.rotateObject;if(s===n||s.isContainedBy(n)){let o=this.Oc.copy();i.location=o.subtract(this.rotationPoint).rotate(t-this.originalAngle).add(this.rotationPoint)}this.diagram.maybeUpdate()}computeRotate(t){let e=this.rotationPoint.directionPoint(t)-this.handleAngle,i=this.adornedObject?.panel;i&&(e-=i.getDocumentAngle()),e=C.Ee(e);let s=Math.min(Math.abs(this.snapAngleMultiple),180),n=Math.min(Math.abs(this.snapAngleEpsilon),s/2);return!this.diagram.lastInput.shift&&s>0&&n>0&&(e%s<n?e=Math.floor(e/s)*s:e%s>s-n&&(e=(Math.floor(e/s)+1)*s)),C.Ee(e)}get snapAngleMultiple(){return this.eM}set snapAngleMultiple(t){m.s(t,"number",De,"snapAngleMultiple"),this.eM=t}get snapAngleEpsilon(){return this.iM}set snapAngleEpsilon(t){m.s(t,"number",De,"snapAngleEpsilon"),this.iM=t}get originalAngle(){return this.sM}get rotationPoint(){return this.Xm}set rotationPoint(t){this.Xm=t.copy()}get handleAngle(){return this.nM}set handleAngle(t){m.s(t,"number",De,"handleAngle"),this.nM=t}get handleDistance(){return this.oM}set handleDistance(t){m.s(t,"number",De,"handleDistance"),this.oM=t}}class Ds extends $t{constructor(t){super(),this.name="ClickSelecting",t&&Object.assign(this,t)}canStart(){return!(!this.isEnabled||this.isBeyondDragSize())}doMouseUp(){this.isActive&&(this.standardMouseSelect(),this.standardMouseClick()||this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()}}class Fs extends $t{Ic;constructor(t){super(),this.name="Action",this.Ic=null,t&&Object.assign(this,t)}canStart(){if(!this.isEnabled)return!1;let t=this.diagram,e=t.lastInput,i=t.findObjectAt(e.documentPoint,s=>{for(;s.panel!==null;){if(s.isActionable)return s;s=s.panel}return s});return i!==null&&i.isActionable?(this.Ic=i,t.Dc=t.findObjectAt(e.documentPoint,null,null),!0):!1}doMouseDown(){if(!this.isActive)this.canStart()&&this.doActivate();else{let t=this.diagram.lastInput,e=this.Ic;if(e===null)return;t.targetObject=e,e.actionDown!==null&&e.actionDown(t,e)}}doMouseMove(){if(this.isActive){let t=this.diagram.lastInput,e=this.Ic;if(e===null)return;t.targetObject=e,e.actionMove!==null&&e.actionMove(t,e)}}doMouseUp(){if(this.isActive){let t=this.diagram.lastInput,e=this.Ic;if(e===null)return;t.targetObject=e,e.actionUp!==null&&e.actionUp(t,e),this.standardMouseClick(i=>{for(;i.panel!==null;){if(i.isActionable&&i===e)return i;i=i.panel}return i},i=>i===e)}this.stopTool()}doCancel(){let t=this.diagram.lastInput,e=this.Ic;e!==null&&(t.targetObject=e,e.actionCancel!==null&&e.actionCancel(t,e),this.stopTool())}doStop(){this.Ic=null}}class Qe extends $t{Vl;rM;Rc;lM;constructor(t){super(),this.name="ClickCreating",this.Vl=null,this.rM=!0,this.Rc=!1,this.lM=new P(0,0),t&&Object.assign(this,t)}canStart(){if(!this.isEnabled||this.archetypeNodeData===null)return!1;let t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(t.lastInput.clickCount===1&&(this.lM=t.lastInput.viewPoint.copy()),t.lastInput.clickCount!==2||this.isBeyondDragSize(this.lM))return!1}else if(t.lastInput.clickCount!==1)return!1;return!(t.currentTool!==this&&t.findPartAt(t.lastInput.documentPoint,!0)!==null)}doMouseUp(){let t=this.diagram;this.isActive&&this.insertPart(t.lastInput.documentPoint),this.stopTool()}insertPart(t){let e=this.diagram,i=this.archetypeNodeData;if(i===null)return null;let s=null;try{if(e.T("ChangingSelection",e.selection),this.startTransaction(this.name),i instanceof pt)i.Di()&&(i.It(),s=i.copy(),s!==null&&e.add(s));else if(i!==null){let n=e.model.copyNodeData(i);e.model.addNodeData(n),s=e.findPartForData(n)}if(s!==null){let n=P.z(t.x,t.y);this.isGridSnapEnabled&&this.diagram.aM(s,t,n),s.location=n,e.allowSelect&&(e.clearSelection(!0),s.isSelected=!0),P.i(n)}e.invalidateDocumentBounds(),this.transactionResult=this.name,e.T("PartCreated",s)}finally{this.stopTransaction(),e.T("ChangedSelection",e.selection)}return s}get archetypeNodeData(){return this.Vl}set archetypeNodeData(t){t!==null&&m.wc(t,Qe,"archetypeNodeData"),this.Vl=t}get isDoubleClick(){return this.rM}set isDoubleClick(t){m.s(t,"boolean",Qe,"isDoubleClick"),this.rM=t}get isGridSnapEnabled(){return this.Rc}set isGridSnapEnabled(t){m.s(t,"boolean",Qe,"isGridSnapEnabled"),this.Rc=t}}class ri extends $t{th;hM;Bl;constructor(t){super(),this.name="DragSelecting",this.th=175,this.hM=!1,this.Bl=new pt({layerName:"Tool",selectable:!1}).add(new et("Rectangle",{name:"SHAPE",fill:null,stroke:"magenta"}).theme("stroke","dragSelect")).It(),t&&Object.assign(this,t)}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;if(!t.allowSelect)return!1;let e=t.lastInput;return!(!e.left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.timestamp-t.firstInput.timestamp<this.delay||t.findPartAt(e.documentPoint,!0)!==null))}doActivate(){let t=this.diagram;this.isActive=!0,t.isMouseCaptured=!0,t.skipsUndoManager=!0,this.box&&t.add(this.box),this.doMouseMove()}doDeactivate(){let t=this.diagram;t.stopAutoScroll(),this.box&&t.remove(this.box),t.skipsUndoManager=!1,t.isMouseCaptured=!1,this.isActive=!1}doMouseMove(){let t=this.diagram;if(this.isActive&&this.box!==null){let e=this.computeBoxBounds(),i=this.box.findObject("SHAPE");i===null&&(i=this.box.findMainElement());let s=st.l().e(e.width,e.height);i!==null&&(i.desiredSize=s),this.box.Ec(e.x,e.y,!1),st.i(s),(t.allowHorizontalScroll||t.allowVerticalScroll)&&t.doAutoScroll(t.lastInput.viewPoint)}}doMouseUp(){if(this.isActive){let t=this.diagram;this.box&&t.remove(this.box);try{t.currentCursor="wait",t.T("ChangingSelection",t.selection),this.selectInRect(this.computeBoxBounds()),t.T("ChangedSelection",t.selection)}finally{t.currentCursor=""}}this.stopTool()}computeBoxBounds(){let t=this.diagram;return new I(t.firstInput.documentPoint,t.lastInput.documentPoint)}selectInRect(t){let e=this.diagram,i=e.lastInput,s=e.findPartsIn(t,this.isPartialInclusion);if(m.fr?i.meta:i.control)if(i.shift){let n=s.iterator;for(;n.next();){let o=n.value;o.isSelected&&(o.isSelected=!1)}}else{let n=s.iterator;for(;n.next();){let o=n.value;o.isSelected=!o.isSelected}}else if(i.shift){let n=s.iterator;for(;n.next();){let o=n.value;o.isSelected||(o.isSelected=!0)}}else{let n=new q,o=e.selection.iterator;for(;o.next();){let h=o.value;s.has(h)||n.add(h)}let r=n.iterator;for(;r.next();){let h=r.value;h.isSelected=!1}let a=s.iterator;for(;a.next();){let h=a.value;h.isSelected||(h.isSelected=!0)}}}get delay(){return this.th}set delay(t){m.s(t,"number",ri,"delay"),this.th=t}get isPartialInclusion(){return this.hM}set isPartialInclusion(t){m.s(t,"boolean",ri,"isPartialInclusion"),this.hM=t}get box(){return this.Bl}set box(t){t!==null&&t.It(),this.Bl=t}}class ki extends $t{Ox;TA;Fo;cM;constructor(t){super(),this.name="Panning",this.Ox=new P,this.TA=new P,this.Fo=!1;let e=this;this.cM=()=>{let i=e.diagram;i!==null&&i.Le(X.document,"scroll",e.cM,!1),e.stopTool()},t&&Object.assign(this,t)}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;return!(!t.allowHorizontalScroll&&!t.allowVerticalScroll||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize())}doActivate(){let t=this.diagram;this.Fo?(t.lastInput.bubbles=!0,t.Et(X.document,"scroll",this.cM,!1)):(t.currentCursor="move",t.isMouseCaptured=!0,this.Ox.h(t.position)),this.isActive=!0}doDeactivate(){let t=this.diagram;t.currentCursor="",t.isMouseCaptured=!1,this.isActive=!1}doCancel(){let t=this.diagram;t.position=this.Ox,t.isMouseCaptured=!1,this.stopTool()}doMouseMove(){this.DA()}doMouseUp(){this.DA(),this.stopTool()}DA(){let t=this.diagram;if(this.isActive&&t){if(this.Fo){t.lastInput.bubbles=!0;return}let e=t.position,i=t.firstInput.documentPoint,s=t.lastInput.documentPoint,n=e.x+i.x-s.x,o=e.y+i.y-s.y;t.allowHorizontalScroll||(n=e.x),t.allowVerticalScroll||(o=e.y),t.position=this.TA.e(n,o)}}get bubbles(){return this.Fo}set bubbles(t){m.s(t,"boolean",ki,"bubbles"),this.Fo=t}get originalPosition(){return this.Ox}}class fe{Ix;Ex;fM;uM;constructor(t){this.Ix=null,this.Ex=null,this.fM=null,this.uM=null,t&&Object.assign(this,t)}get mainElement(){return this.fM}set mainElement(t){t!==null&&m.se(t,HTMLElement,fe,"mainElement"),this.fM=t}get show(){return this.Ix}set show(t){this.Ix!==t&&(t!==null&&m.S(t,fe,"show"),this.Ix=t)}get hide(){return this.Ex}set hide(t){this.Ex!==t&&(t!==null&&m.S(t,fe,"hide"),this.Ex=t)}get valueFunction(){return this.uM}set valueFunction(t){this.uM=t}}class ce{ue;Ux;Uc;constructor(t,e,i){this.ue=t,this.Ux=e,this.Uc=i}}class It extends $t{dM;Vx;gM;mM;Bx;zx;Gm;constructor(t){super(),this.name="ContextMenu",this.dM=null,this.Vx=null,this.gM=null,this.mM=new P,this.Bx=null,this.Gm=!1;let e=this;this.zx=()=>e.stopTool(),t&&Object.assign(this,t)}bR(){let t=new fe;t.show=(r,a,h)=>h.showDefaultContextMenu(),t.hide=(r,a)=>a.hideDefaultContextMenu(),It.Vu=t;let e=this;this.zx=()=>e.stopTool();let i=m.Ni("div"),s=m.Ni("div");i.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px",s.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";let n=m.Ni("style");X.document.getElementsByTagName("head")[0].appendChild(n),n.sheet.insertRule(".goCXul { list-style: none; }",0),n.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),n.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0);let o=this.diagram;o!==null&&(o.Et(i,"contextmenu",It.oh,!1),o.Et(i,"selectstart",It.oh,!1),o.Et(s,"contextmenu",It.oh,!1)),i.className="goCXforeground",s.className="goCXbackground",X.document.body&&(X.document.body.appendChild(i),X.document.body.appendChild(s)),It.Ym=i,It.Km=s,It.pM=!0}static Vu=null;static pM=!1;static Km;static Ym;static oh(t){return t.preventDefault(),!1}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;return this.isBeyondDragSize()||!t.lastInput.right||t.lastInput.clickCount>1?!1:!!(t.lastInput.isTouchEvent&&this.defaultTouchContextMenu!==null||this.findObjectWithContextMenu()!==null)}doStart(){let t=this.diagram;this.mM.set(t.firstInput.documentPoint)}doStop(){this.hideContextMenu(),this.currentObject=null,this.Gm=!1}findObjectWithContextMenu(t){t===void 0&&(t=null);let e=this.diagram,i=e.lastInput,s=null;if(t instanceof Y||(t instanceof $?s=t:s=e.findObjectAt(i.documentPoint,null,n=>!n.layer?.isTemporary)),s!==null){let n=s;for(;n!==null;){if(n.contextMenu!==null)return n;n=n.panel}if(e.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return s.part}else if(e.contextMenu!==null)return e;return null}doActivate(){}doMouseDown(){if(super.doMouseDown(),this.isActive&&this.currentContextMenu instanceof vt){let t=this.diagram.toolManager.findTool("Action");t!==null&&t.canStart()&&(t.doActivate(),t.doMouseDown(),t.doDeactivate())}this.diagram.toolManager.mouseDownTools.has(this)&&this.doContextClick()}doMouseUp(){if(this.isActive&&this.currentContextMenu instanceof vt){let t=this.diagram.toolManager.findTool("Action");t!==null&&t.canStart()&&(t.doActivate(),t.doCancel(),t.doDeactivate())}this.doContextClick()}doContextClick(){let t=this.diagram;if(!this.isActive)this.canStart()&&(this.openMenu(!0),this.isActive||this.stopTool());else{let e=this.currentContextMenu;if(e===null)return;let i=null;e instanceof fe||(i=t.findObjectAt(t.lastInput.documentPoint,null,null),i!==null&&i.isContainedBy(e)&&this.standardMouseClick(null,null)),this.maybeStopTool(i)}}maybeStopTool(t){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())}openMenu(t,e){if(e===void 0&&(e=null),this.Gm)return;this.Gm=!0;let i=!1;if(e instanceof Y){let s=this.diagram.lastInput;s.targetObject=null,i=this.lA(null,s,this.diagram)}else t&&this.standardMouseSelect(),i=this.standardMouseClick();if(this.Gm=!1,!i){this.isActive=!0;let s=It.Vu;if(e===null&&(e=this.findObjectWithContextMenu()),e!==null){let n=e.contextMenu;n!==null?(this.currentObject=e instanceof $?e:null,this.showContextMenu(n,this.currentObject)):s!==null&&this.showContextMenu(s,this.currentObject)}else s!==null&&this.showContextMenu(s,null);this.currentContextMenu instanceof vt&&!this.currentContextMenu.visible&&this.stopTool()}}doMouseMove(){let t=this.diagram.toolManager.findTool("Action");t!==null&&t.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()}showContextMenu(t,e){e!==null&&m.se(e,$,It,"showContextMenu:obj");let i=this.diagram;if(t!==this.currentContextMenu&&this.hideContextMenu(),t instanceof vt){let s=t;s.layerName="Tool",s.selectable=!1,s.scale=1/i.scale,s.category=this.name,s.hasPlaceholder()&&(s.placeholder.scale=i.scale);let n=s.diagram;n!==null&&n!==i&&n.remove(s),i.add(s),e!==null?s.adornedObject=e:s.data=i.model,s.ensureBounds(),this.positionContextMenu(s,e)}else t instanceof fe&&t.show!==null&&t.show(e,i,this);this.currentContextMenu=t}positionContextMenu(t,e){if(t.hasPlaceholder())return;let i=t,s=this.diagram,n=s.lastInput.documentPoint.copy(),o=i.measuredBounds,r=s.viewportBounds;s.lastInput.isTouchEvent&&(n.x-=o.width),n.x+o.width>r.right&&(n.x-=o.width+5/s.scale),n.x<r.x&&(n.x=r.x),n.y+o.height>r.bottom&&(n.y-=o.height+5/s.scale),n.y<r.y&&(n.y=r.y),i.position=n}hideContextMenu(){let t=this.diagram,e=this.currentContextMenu;e!==null&&(e instanceof vt?(t.remove(e),this.Vx!==null&&this.Vx.removeAdornment(e.category),e.data=null,e.adornedObject=null):e instanceof fe&&(e.hide!==null?e.hide(t,this):e.mainElement!==null&&(e.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())}kR(){let t=this,e=new q;return e.add(new ce("Copy",i=>i.commandHandler.copySelection(),i=>i.commandHandler.canCopySelection())),e.add(new ce("Cut",i=>i.commandHandler.cutSelection(),i=>i.commandHandler.canCutSelection())),e.add(new ce("Delete",i=>i.commandHandler.deleteSelection(),i=>i.commandHandler.canDeleteSelection())),e.add(new ce("Paste",i=>i.commandHandler.pasteSelection(t.mouseDownPoint),i=>i.commandHandler.canPasteSelection(t.mouseDownPoint))),e.add(new ce("Select All",i=>i.commandHandler.selectAll(),i=>i.commandHandler.canSelectAll())),e.add(new ce("Undo",i=>i.commandHandler.undo(),i=>i.commandHandler.canUndo())),e.add(new ce("Redo",i=>i.commandHandler.redo(),i=>i.commandHandler.canRedo())),e.add(new ce("Scroll To Part",i=>i.commandHandler.scrollToPart(),i=>i.commandHandler.canScrollToPart())),e.add(new ce("Zoom To Fit",i=>i.commandHandler.zoomToFit(),i=>i.commandHandler.canZoomToFit())),e.add(new ce("Reset Zoom",i=>i.commandHandler.resetZoom(),i=>i.commandHandler.canResetZoom())),e.add(new ce("Group Selection",i=>i.commandHandler.groupSelection(),i=>i.commandHandler.canGroupSelection())),e.add(new ce("Ungroup Selection",i=>i.commandHandler.ungroupSelection(),i=>i.commandHandler.canUngroupSelection())),e.add(new ce("Edit Text",i=>i.commandHandler.editTextBlock(),i=>i.commandHandler.canEditTextBlock())),e}showDefaultContextMenu(){let t=this.diagram;this.Bx===null&&(this.Bx=this.kR()),It.Ym.innerHTML="",It.Km.addEventListener("pointerdown",this.zx,!1);let e=this,i=m.Ni("ul");i.className="goCXul",It.Ym.appendChild(i),i.innerHTML="";let s=this.Bx.iterator;for(;s.next();){let n=s.value,o=n.Ux,r=n.Uc;if(!m.st(o)||m.st(r)&&!r(t))continue;let a=m.Ni("li");a.className="goCXli";let h=m.Ni("a");h.className="goCXa",h.href="#",h.Ux=o,h.addEventListener("pointerdown",function(l){return this.Ux(t),e.stopTool(),l.preventDefault(),!1},!1),h.textContent=n.ue,a.appendChild(h),i.appendChild(a)}It.Ym.style.display="block",It.Km.style.display="block"}hideDefaultContextMenu(){if(this.currentContextMenu===null||this.currentContextMenu!==It.Vu)return;It.Ym.style.display="none",It.Km.style.display="none";let t=this.diagram;t!==null&&t.Le(It.Km,"pointerdown",this.zx,!1),this.currentContextMenu=null}doMouseWheel(){this.standardMouseWheel()}get currentContextMenu(){return this.dM}set currentContextMenu(t){this.dM=t,this.Vx=t instanceof vt?t.adornedPart:null}get defaultTouchContextMenu(){return It.pM===!1&&It.Vu===null&&Y.isUsingDOM()&&this.bR(),It.Vu}set defaultTouchContextMenu(t){t===null&&(It.pM=!0),It.Vu=t}get currentObject(){return this.gM}set currentObject(t){t!==null&&m.se(t,$,It,"currentObject"),this.gM=t}get mouseDownPoint(){return this.mM}}var Os=(x=>(x[x.LostFocus=1]="LostFocus",x[x.MouseDown=2]="MouseDown",x[x.Tab=3]="Tab",x[x.Enter=4]="Enter",x))(Os||{}),Rs=(x=>(x[x.SingleClick=1]="SingleClick",x[x.SingleClickSelected=2]="SingleClickSelected",x[x.DoubleClick=3]="DoubleClick",x))(Rs||{}),Es=(x=>(x[x.None=1]="None",x[x.Active=2]="Active",x[x.Editing=3]="Editing",x[x.Validating=4]="Validating",x[x.Invalid=5]="Invalid",x[x.Validated=6]="Validated",x))(Es||{});class oe extends $t{vi;yM;wM;zl;Gt;xM;bM;kM;Xx;Gx;constructor(t){super(),this.name="TextEditing",this.vi=new lt,this.yM=null,this.wM=2,this.zl=null,this.Gt=1,this.xM=1,this.bM=!0,this.kM=null,this.Xx=new fe,this.Gx=null,this.PR(this.Xx),t&&Object.assign(this,t)}static LostFocus=1;static MouseDown=2;static Tab=3;static Enter=4;static SingleClick=1;static SingleClickSelected=2;static DoubleClick=3;static StateNone=1;static StateActive=2;static StateEditing=3;static StateValidating=4;static StateInvalid=5;static StateValidated=6;PR(t){if(!Y.isUsingDOM())return;let e=m.Ni("textarea");this.Gx=e;let i=this;e.addEventListener("input",function(s){if(i.textBlock===null)return;let n=i.measureTemporaryTextBlock(this.value),o=this.textScale;this.style.width=20+Math.max(i.textBlock.measuredBounds.width,n.measuredBounds.width)*o+"px",this.rows=Math.max(i.textBlock.lineCount,n.lineCount)},!1),e.addEventListener("keydown",function(s){if(s.isComposing||i.textBlock===null)return;let n=s.key;if(n==="Enter"){i.textBlock.isMultiline===!1&&s.preventDefault(),i.acceptText(4);return}else if(n==="Tab"){i.acceptText(3),s.preventDefault();return}else n==="Escape"&&(i.doCancel(),i.diagram!==null&&i.diagram.doFocus())},!1),e.addEventListener("focus",function(s){i.SR(s)},!1),e.addEventListener("blur",function(s){i.MR(s)},!1),t.valueFunction=()=>e.value,t.mainElement=e,t.show=(s,n,o)=>{if(!(s instanceof lt)||!n||!n.div||!(o instanceof oe))return;if(o.state===5){e.style.border="3px solid red",e.focus();return}let r=s.getDocumentPoint(T.Center),a=n.position,h=n.scale,l=s.getDocumentScale()*h;l<o.minimumEditorScale&&(l=o.minimumEditorScale);let u=s.naturalBounds.width*l+6,c=s.naturalBounds.height*l+2,d=(r.x-a.x)*h,f=(r.y-a.y)*h,p=s.verticalAlignment,g=(s.lineHeight+s.spacingAbove+s.spacingBelow)*s.lineCount*l,y=.5*c-.5*g,b=p.y*c-p.y*g+p.offsetY-y-g/2;e.value=s.text,n.div.style.font=s.font;let v=1;e.style.position="absolute",e.style.zIndex="100",e.style.font="inherit",e.style.fontSize=l*100+"%",e.style.lineHeight="normal",e.style.width=u+"px",e.style.left=(d-u/2|0)-v+"px",e.style.top=(f+b|0)-v+"px",e.style.textAlign=s.textAlign,e.style.margin="0",e.style.padding=v+"px",e.style.border="0",e.style.outline="none",e.style.whiteSpace="pre-wrap",e.style.overflow="hidden",e.rows=s.lineCount,e.textScale=l,e.className="goTXarea",n.div.appendChild(e),e.focus(),o.selectsTextOnActivate&&(e.select(),e.setSelectionRange(0,9999))},t.hide=(s,n)=>{s.div&&s.div.removeChild(e)}}get textBlock(){return this.yM}set textBlock(t){t!==null&&m.se(t,lt,oe,"textBlock"),this.yM=t}get currentTextEditor(){return this.kM}set currentTextEditor(t){this.kM=t}get defaultTextEditor(){return this.Xx}set defaultTextEditor(t){this.Xx=t}get starting(){return this.wM}set starting(t){this.wM=t}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;if(t===null||t.isReadOnly||oe.Vc&&oe.Vc!==this&&(oe.Vc.acceptText(2),oe.Vc&&oe.Vc!==this)||!t.lastInput.left||this.isBeyondDragSize())return!1;let e=t.lastInput.documentPoint,i=t.findObjectAt(e);if(i===null||!(i instanceof lt)||!i.editable||i.part===null||!i.part.canEdit())return!1;let s=i.part;return!(s===null||this.starting===2&&!s.isSelected||this.starting===3&&t.lastInput.clickCount<2)}doStart(){oe.Vc=this,this.textBlock!==null&&this.doActivate()}doActivate(){if(this.isActive)return;let t=this.diagram;if(t===null)return;let e=this.textBlock;if(e===null&&(e=t.findObjectAt(t.lastInput.documentPoint)),e===null||!(e instanceof lt)||(this.textBlock=e,e.part===null))return;t.animationManager.stopAnimation(),this.isActive=!0,this.Gt=2;let i=this.defaultTextEditor;e.textEditor!==null&&(i=e.textEditor),this.vi=this.textBlock.copy();let s=new I(this.textBlock.getDocumentPoint(T.TopLeft),this.textBlock.getDocumentPoint(T.BottomRight));t.scrollToRect(s),i!==null&&i.show!==null&&i.show(e,t,this),this.currentTextEditor=i}doCancel(){this.stopTool()}doMouseUp(){this.canStart()&&this.doActivate()}doMouseDown(){this.isActive&&this.acceptText(2)}acceptText(t){switch(t){case 2:this.Gt===6?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.Gt===2||this.Gt===5||this.Gt===3)&&(this.Gt=4,this.vA());break;case 1:case 4:case 3:if(t===4&&this.textBlock!==null&&this.textBlock.isMultiline===!0)return;(this.Gt===2||this.Gt===5||this.Gt===3)&&(this.Gt=4,this.vA());break}}vA(){let t=this.textBlock,e=this.diagram,i=this.currentTextEditor;if(t!==null&&i!==null){let s=t.text,n="";if(i.valueFunction!==null&&(n=i.valueFunction()),!this.isValidText(t,s,n)){this.Gt=5,this.doError(s,n);return}this.startTransaction(this.name),this.Gt=6,this.transactionResult=this.name,t.text=n,this.doSuccess(s,n),e!==null&&e.T("TextEdited",t,s),this.stopTransaction(),this.stopTool(),e!==null&&e.doFocus()}}doError(t,e){let i=this.textBlock;if(i===null)return;i.errorFunction!==null&&i.errorFunction(this,t,e);let s=this.currentTextEditor;s!==null&&s.show!==null&&s.show(i,this.diagram,this)}doSuccess(t,e){let i=this.textBlock;i!==null&&i.textEdited!==null&&i.textEdited(i,t,e)}doDeactivate(){let t=this.diagram;if(t!==null){if(this.Gt=1,this.currentTextEditor!==null){let e=this.currentTextEditor;e!==null&&e.hide!==null&&e.hide(t,this)}this.textBlock=null,this.isActive=!1}}doStop(){oe.Vc=null}SR(t){if(this.currentTextEditor===null||this.state===1)return;let e=this.Gx;this.Gt===2&&(this.Gt=3),m.st(e.select)&&this.selectsTextOnActivate&&(e.select(),e.setSelectionRange(0,9999))}MR(t){if(this.currentTextEditor===null||this.state===1)return;let e=this.Gx;m.st(e.focus)&&e.focus(),m.st(e.select)&&this.selectsTextOnActivate&&(e.select(),e.setSelectionRange(0,9999))}isValidText(t,e,i){let s=this.textValidation;if(s!==null&&!s(t,e,i))return!1;let n=t.textValidation;return!(n!==null&&!n(t,e,i))}get textValidation(){return this.zl}set textValidation(t){t!==null&&m.S(t,oe,"textValidation"),this.zl=t}get minimumEditorScale(){return this.xM}set minimumEditorScale(t){t!==null&&m.s(t,"number",oe,"minimumEditorScale"),this.xM=t}get selectsTextOnActivate(){return this.bM}set selectsTextOnActivate(t){t!==null&&m.s(t,"boolean",oe,"selectsTextOnActivate"),this.bM=t}get state(){return this.Gt}set state(t){this.Gt!==t&&(this.Gt=t)}measureTemporaryTextBlock(t){let e=this.vi;return e.text=t,this.textBlock!==null&&e.ht(this.textBlock.Xl,1/0),e}static Vc=null}var Is=(x=>(x[x.Default=1]="Default",x[x.AnimateLocations=2]="AnimateLocations",x[x.None=3]="None",x))(Is||{});class he{a;Ae;Be;Ar;Qn;Oo;PM;SM;Hm;Yx;ke;Bc;xn;qm;lh;Kx;jm;Hx;zc;Eu;Wm;constructor(t){this.a=Y.Om(),this.Ae=!1,this.Hm=!1,this.Yx=!1,this.ke=!1,this.Bc=!1,this.Hx=!0,this.zc=1,this.Eu=!1,this.Be=!0,this.Ar=!0,this.Oo=600,this.PM=!1,this.SM=!1,this.Qn=new V,this.xn=new ye,this.qm=new ye,this.xn.Ns=this,this.lh=new V,this.Kx=new V,this.jm=new V,this.Wm=new V,t&&Object.assign(this,t)}Io(t){this.a=t}RU(){return this.a}canStart(t){return!0}Gl(t){return!this.Be||!this.canStart(t)?!1:(this.Qn.add(t),this.defaultAnimation.isAnimating&&this.stopAnimation(),this.a.Te(),this.ke=!0,!0)}getBundleAnimation(){return this.qm}MM(){if(!this.Be||(this.qm.yi.count>0&&this.qm.start(),!this.ke))return;let t=this.xn,e=this.a,i=this.Qn.has("Model");if(i&&(this.Bc=!0,this.zc===1?(t.isViewportUnconstrained=!0,t.yi.clear(),t.add(e,"position",e.position.copy().offset(0,-200),e.position),t.add(e,"opacity",0,1)):this.zc===3&&t.yi.clear(),this.zc===2&&e.qx.equals(e.ct)?this.Hx=!0:this.Hx=!1,e.T("InitialAnimationStarting",this)),i&&!this.Ar||t.yi.count===0){this.Qn.clear(),this.ke=!1,t.yi.clear(),t.jx(e),this.Bc=!1,e.C();return}this.Qn.clear(),e.Tr=!1;let s=t.yi.get(e);e.autoScale!==1&&s!==null&&(delete s.ae.scale,delete s.Cs.scale);let n=this;X.requestAnimationFrame(()=>{n.ke===!1||t.Ae||(e.getRenderingHint("temporaryPixelRatio")&&e.Cx(),e.NM(),n.ke=!1,t.start(),t.Ae&&(n.Bu(),e.invalidateDocumentBounds(),t.FA(0),e.Pr(!0),n.zu(),e.T("AnimationStarting",n)))})}CM(){return this.Qn.has("Trigger")&&this.Qn.count===1}RA(t,e,i,s){this.isTicking||this.CM()||t instanceof j&&(t.fromNode!==null||t.toNode!==null)||this.xn.add(t,"position",e,i,s)}Wx(t){return this.xn.Wx(t)}LM(t){return this.xn.LM(t)}NR(t){let e=this.lh,i=this;function s(){if(i.jm.count>0&&(e.addAll(i.jm),i.jm.clear(),i.Ae=!0),i.Ae===!1||e.count===0){i.Yx=!1;return}i.Kx.addAll(e);let n=i.Kx.iterator;for(;n.next();){let o=n.value;o.Ae!==!1&&(o.CR()?o.OA(!1):o.Xc=!0)}if(i.Kx.clear(),i.Ae===!1){X.requestAnimationFrame(s);return}i.Bu(),i.a.Pr(),i.zu(),X.requestAnimationFrame(s)}this.Ae?this.IA(t):(this.Ae=!0,this.Yx?this.IA(t):(this.Yx=!0,e.add(t),X.requestAnimationFrame(()=>s())))}IA(t){this.jm.add(t)}LR(){let t=this.lh.iterator;for(;t.next();)t.value.Xc=!1}Bu(){if(this.Hm)return;let t=this.a;this.PM=t.skipsUndoManager,this.SM=t.wi,t.skipsUndoManager=!0,t.wi=!0,this.Hm=!0}zu(){let t=this.a;t.skipsUndoManager=this.PM,t.wi=this.SM,this.Hm=!1}stopAnimation(t){let e=this.xn;if(this.ke===!0&&(this.ke=!1,this.Bc=!1,this.Qn.clear(),e.AR()&&this.a.requestUpdate()),!this.Ae){e.yi.clear(),e.jx(this.a);return}if(e.Xu(!0),e.jx(null),t===!0){let i=this.lh.toArray();for(let s=0;s<i.length;s++)i[s].Xu(!0)}}Xu(t){this.lh.delete(t),this.lh.count===0&&(this.Ae=!1,this.a.requestUpdate()),t===this.defaultAnimation&&this.a.T("AnimationFinished",this)}Gc(t,e){this.ke&&(!this.Qn.has("Expand Tree")&&!this.Qn.has("Expand SubGraph")||(this.xn.Gc(t,e),this.EA(t)))}Yc(t,e){this.ke&&(!this.Qn.has("Collapse Tree")&&!this.Qn.has("Collapse SubGraph")||(this.xn.Yc(t,e),this.xn.AM(e,"position",e.position,e.position),this.EA(t)))}UA(t,e){!this.ke||t.equals(e)||this.CM()||(this.a.Qa||(t=e.copy()),this.xn.AM(this.a,"position",t,e))}VA(t,e){this.ke&&(this.CM()||this.xn.add(this.a,"scale",t,e))}TM(t,e){t.Fi&&(t.Dr=e,this.Wm.add(t))}EA(t){let e=t.findLinksConnected();for(;e.next();){let i=e.value;i.Fi&&(i.Dr=i.points.copy(),this.Wm.add(i))}}get isEnabled(){return this.Be}set isEnabled(t){m.s(t,"boolean",he,"isEnabled"),this.Be=t,t&&this.lh.each(e=>{!e.isAnimating&&e.runCount===1/0&&e.start()})}get duration(){return this.Oo}set duration(t){m.s(t,"number",he,"duration"),t<1&&m.J(t,">= 1",he,"duration"),this.Oo=t}get isAnimating(){return this.Ae}get isTicking(){return this.Hm}get isInitial(){return this.Ar}set isInitial(t){m.s(t,"boolean",he,"isInitial"),this.Ar=t}get defaultAnimation(){return this.xn}get activeAnimations(){return this.lh}get initialAnimationStyle(){return this.zc}set initialAnimationStyle(t){this.zc=t}static Jx=new Mt;static defineAnimationEffect(t,e){he.Jx.set(t,e)}static DM(t,e,i,s,n){t===null&&(t=[0,0,0,0]),e===null&&(e=[0,0,0,0]);let o=t[0],r=t[1],a=t[2],h=t[3],l=e[0],u=e[1],c=e[2],d=e[3];a===0||a===100?(o=l,r=u):(c===0||c===100)&&(l=o,u=r),Math.abs(l-o)>180&&(l>o?o+=360:l+=360);let f=n(i,o,l-o,s)%360,p=n(i,r,u-r,s),g=n(i,a,c-a,s),y=n(i,h,d-h,s);return"hsla("+f+", "+p+"%, "+g+"%, "+y+")"}static Default=1;static AnimateLocations=2;static None=3}{let x=he.Jx,t=(e,i,s,n,o,r)=>{e.position=new P(n(o,i.x,s.x-i.x,r),n(o,i.y,s.y-i.y,r))};x.set("position:diagram",t),x.set("position",t),x.set("position:part",(e,i,s,n,o,r)=>{o<r?e.Ec(n(o,i.x,s.x-i.x,r),n(o,i.y,s.y-i.y,r),!1):e.position=new P(n(o,i.x,s.x-i.x,r),n(o,i.y,s.y-i.y,r))}),x.set("location",(e,i,s,n,o,r)=>{o<r?e.Ec(n(o,i.x,s.x-i.x,r),n(o,i.y,s.y-i.y,r),!0):e.location=new P(n(o,i.x,s.x-i.x,r),n(o,i.y,s.y-i.y,r))}),x.set("position:placeholder",(e,i,s,n,o,r)=>{o<r?e.Ec(n(o,i.x,s.x-i.x,r),n(o,i.y,s.y-i.y,r),!1):e.position=new P(n(o,i.x,s.x-i.x,r),n(o,i.y,s.y-i.y,r))}),x.set("position:nodeCollapse",(e,i,s,n,o,r)=>{let a=e.actualBounds,h=s.actualBounds,l=h.x+h.width/2-a.width/2,u=h.y+h.height/2-a.height/2;o<r?e.Ec(n(o,i.x,l-i.x,r),n(o,i.y,u-i.y,r),!1):e.position=new P(n(o,i.x,l-i.x,r),n(o,i.y,u-i.y,r))}),x.set("desiredSize",(e,i,s,n,o,r)=>{e.desiredSize=new st(n(o,i.width,s.width-i.width,r),n(o,i.height,s.height-i.height,r))}),x.set("width",(e,i,s,n,o,r)=>{e.width=n(o,i,s-i,r)}),x.set("height",(e,i,s,n,o,r)=>{e.height=n(o,i,s-i,r)}),x.set("fill",(e,i,s,n,o,r)=>{e.fill=he.DM(i,s,o,r,n)}),x.set("stroke",(e,i,s,n,o,r)=>{e.stroke=he.DM(i,s,o,r,n)}),x.set("strokeWidth",(e,i,s,n,o,r)=>{e.strokeWidth=n(o,i,s-i,r)}),x.set("strokeDashOffset",(e,i,s,n,o,r)=>{e.strokeDashOffset=n(o,i,s-i,r)}),x.set("background",(e,i,s,n,o,r)=>{e.background=he.DM(i,s,o,r,n)}),x.set("opacity",(e,i,s,n,o,r)=>{e.opacity=n(o,i,s-i,r)}),x.set("scale",(e,i,s,n,o,r)=>{e.scale=n(o,i,s-i,r)}),x.set("angle",(e,i,s,n,o,r)=>{e.angle=n(o,i,s-i,r)})}class ye{$x;Jm;Ae;Gu;Oo;Ls;BA;Kc;yi;Zx;ae;_n;Yu;Hc;Qx;_x;Xc;vM;tb;Ns;a;FM;RM;OM;constructor(t){this.a=null,this.Ns=null,this.vM=null,this.tb=null,this.FM=!1,this.Ae=!1,this.Xc=!1,this.ae=0,this._n=0,this.$x=ye.EaseInOutQuad,this.Jm=ye.EaseInOutQuad,this.Yu=!1,this.Hc=!1,this.Qx=1,this._x=0,this.Oo=NaN,this.Ls=NaN,this.RM=0,this.Gu=null,this.BA=P.dn,this.yi=new Mt,this.Zx=new Mt,this.Kc=new V,this.OM=1,t&&Object.assign(this,t)}suspend(){this.Xc=!0}advanceTo(t,e){e&&(this.Xc=!1),this.Yu&&t>=this.Ls&&(this.Hc=!0,t=t-this.Ls),this.RM=t,this.OA(!0),this.Ns.Bu(),this.a.Pr(),this.Ns.zu(),this.a.redraw()}jx(t){if(this.Zx.clear(),this.Hc=!1,this._x=0,this.Ls=NaN,this.Kc.count>0&&this.Kc.clear(),t!==null){let e=t.links;for(;e.next();)e.value.Dr=null}}AR(){return this.yi.count>0}start(){if(this.yi.count===0)return this;if(this.Ae)return this;let t=this.a,e=this.yi.iterator;for(;e.next();){let s=e.key;t===null&&(s instanceof Y?t=s:s instanceof $&&(t=s.diagram))}if(t!==null)this.a=t,this.Ns=t.animationManager;else return this;let i=this.Ns;return i.isEnabled===!1?this:(this.Ls=isNaN(this.Oo)?i.duration:this.Oo,this.Jm=this.$x,i.Bc&&i.zc===1&&this===i.defaultAnimation&&(this.Jm=ye.EaseOutExpo,this.Ls=isNaN(this.Oo)?i.duration===600?900:i.duration:this.Oo),this.OM=t.scrollMode,this.isViewportUnconstrained&&(t.ah=2),i.Bu(),this.Kc.each(s=>{s.data=null,t.add(s)}),i.zu(),this.Ae=!0,this.ae=+new Date,this._n=this.ae+this.Ls,i.NR(this),this)}addTemporaryPart(t,e){return t.Di()?(this.Kc.add(t),this.a=e,this):this}add(t,e,i,s,n){if(this.a===null&&(t instanceof Y?this.a=t:t instanceof $&&t.diagram!==null&&(this.a=t.diagram)),t instanceof pt){if(!t.isAnimated)return this;e==="position"&&(e="position:part")}return this.AM(t,e,i,s,n),this}AM(t,e,i,s,n){let o=this.yi,r,a,h;if(t instanceof Y&&e==="position"&&(e="position:diagram"),(e==="fill"||e==="stroke"||e==="background")&&(R.Eo(i),R.IM(),i=[R.ze.n0,R.ze.n1,R.ze.n2,R.ze.n3],R.Eo(s),R.IM(),s=[R.ze.n0,R.ze.n1,R.ze.n2,R.ze.n3]),o.has(t))r=o.get(t),a=r.ae,h=r.Cs,a[e]===void 0&&(a[e]=this.Ku(i)),h[e]=this.Ku(s);else{if(e==="position"&&i.equalsApprox(s))return;a={},h={},a[e]=this.Ku(i),h[e]=this.Ku(s),r=new Dn(a,h,n),o.set(t,r)}let l=a[e];l instanceof P&&!l.isReal()&&l.h(this.BA),n&&e.indexOf("position:")===0&&t instanceof pt?r.eb.location=this.Ku(t.location):n&&(r.eb[e]=this.Ku(i))}Ku(t){return t instanceof P||t instanceof st?t.copy():t}TR(t){let e=this.yi;if(e.has(t)){let i=e.get(t);i.ib=!0}}Wx(t){if(!this.Ae)return!1;let e=this.yi.get(t);return e!==null&&e.ib}LM(t){if(!this.Ae)return!1;let e=this.yi.get(t);return e!==null&&!!(e.ae.position||e.ae["position:part"]||e.ae.location)}CR(){if(this.Kc.count>0)return!0;let t=this.yi.iterator;for(;t.next();){let e=t.key;if(e instanceof $&&e.diagram!==null||e instanceof Y)return!0}return!1}OA(t){if(this.Xc&&!t)return;let e=this.Ns;if(this.Ae===!1)return;let i=+new Date,s=i>this._n?this.Ls:i-this.ae;t&&(s=this.RM,s<this.Ls?(this.ae=+new Date-s,this._n=this.ae+this.Ls):s=this.Ls),e.Bu(),this.FA(s),this.a.Pr(!0),e.zu(),i>this._n&&(this.Yu&&!this.Hc?(this.ae=+new Date,this._n=this.ae+this.Ls,this.Hc=!0):this.Xu(!1))}FA(t){let e=this.Ls,i=this.yi.iterator,s=this.Hc;for(;i.next();){let n=i.key;if(n instanceof $&&n.diagram===null)continue;let o=i.value,r=s?o.Cs:o.ae,a=s?o.ae:o.Cs,h=he.Jx;for(let l in a)l==="position"&&(a["position:placeholder"]||a["position:nodeCollapse"])||h.get(l)!==null&&h.get(l)(n,r[l],a[l],this.Jm,t,e,this)}}stop(){return this.Ae?(this.Xu(!0),this):this}Xu(t){if(this.tb!==null&&this.tb.DR(this.vM),!this.Ae)return;let e=this.a,i=this.Ns;i.Bc=!1,this.Ae=!1,this.Xc=!1,i.Bu();let s=this.yi,n=this.Kc.iterator;for(;n.next();)e.remove(n.value);let o=this.Yu,r=s.iterator,a=he.Jx;for(;r.next();){let l=r.key,u=r.value,c=o?u.Cs:u.ae,d=o?u.ae:u.Cs,f=u.eb;for(let p in d)if(a.get(p)!==null){let g=p;u.sb&&(g==="position:nodeCollapse"||g==="position:placeholder")&&(g="position"),a.get(g)(l,c[p],f[p]!==void 0?f[p]:u.sb?c[p]:d[p],this.Jm,this.Ls,this.Ls,this)}u.sb&&f.location!==void 0&&l instanceof pt&&(l.location=f.location),u.ib&&l instanceof pt&&l.Xe(!1)}this._x++;let h=!t&&this.Qx>this._x;if(!h&&(this===i.qm||this===i.defaultAnimation)&&this.yi.clear(),e.nb.clear(),e.yS(!1),e.invalidateDocumentBounds(),e.C(),e.Pr(!0),i.defaultAnimation===this){let l=i.Wm.iterator;for(;l.next();)l.value.vR();i.Wm.clear()}if(e.Pr(!0),this.isViewportUnconstrained&&(e.scrollMode=this.OM),i.zu(),h){this.Hc=!1,this.start();return}this.jx(null),e.zA(),i.Xu(this),this.Gu&&this.Gu(this),e.requestUpdate()}Gc(t,e){let i=e.actualBounds,s=null;if(e instanceof ht&&(s=e.placeholder),s!==null&&s.visible){let n=s.getDocumentPoint(T.TopLeft),o=s.padding;n.x+=o.left,n.y+=o.top,this.add(t,"position",n,t.position,!1)}else this.add(t,"position",new P(i.x+i.width/2,i.y+i.height/2),t.position,!1);this.add(t,"scale",.01,t.scale,!1),t instanceof ht&&this.FR(t,e)}FR(t,e){let i=t.memberParts;for(;i.next();){let s=i.value;s instanceof J&&this.Gc(s,e)}}Yc(t,e){if(!t.isVisible())return;let i=null;if(e instanceof ht&&(i=e.placeholder),i!==null&&i.visible){let s=i.getDocumentPoint(T.TopLeft),n=i.padding;s.x+=n.left,s.y+=n.top,this.add(t,"position:placeholder",t.position,s,!0)}else this.add(t,"position:nodeCollapse",t.position,e,!0);this.add(t,"scale",t.scale,.01,!0),this.TR(t),t instanceof ht&&this.RR(t,e)}RR(t,e){let i=t.memberParts;for(;i.next();){let s=i.value;s instanceof J&&this.Yc(s,e)}}get duration(){return this.Oo}set duration(t){m.s(t,"number",ye,"duration"),t<1&&m.J(t,">= 1",ye,"duration"),this.Oo=t}get reversible(){return this.Yu}set reversible(t){this.Yu=t}get runCount(){return this.Qx}set runCount(t){t>0?this.Qx=t:m.o("Animation.runCount value must be a positive integer.")}get finished(){return this.Gu}set finished(t){this.Gu!==t&&(t!==null&&m.S(t,ye,"finished"),this.Gu=t)}get easing(){return this.$x}set easing(t){this.$x=t}get isViewportUnconstrained(){return this.FM}set isViewportUnconstrained(t){this.FM=t}get isAnimating(){return this.Ae}getTemporaryState(t){let e=this.Zx.get(t);return e===null&&(e={},this.Zx.set(t,e)),e}static EaseLinear=(t,e,i,s)=>i*t/s+e;static EaseInOutQuad=(t,e,i,s)=>(t/=s/2,t<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e);static EaseInQuad=(t,e,i,s)=>i*(t/=s)*t+e;static EaseOutQuad=(t,e,i,s)=>-i*(t/=s)*(t-2)+e;static EaseInExpo=(t,e,i,s)=>t===0?e:i*Math.pow(2,10*(t/s-1))+e;static EaseOutExpo=(t,e,i,s)=>t===s?e+i:i*(-Math.pow(2,-10*t/s)+1)+e}class Dn{ae;Cs;eb;sb;ib;constructor(t,e,i){this.ae=t,this.Cs=e,this.eb={},this.sb=i,this.ib=!1}}var Bs=(x=>(x[x.Default=1]="Default",x[x.Immediate=2]="Immediate",x[x.Bundled=3]="Bundled",x))(Bs||{});class ai{Ti;pn;Hu;qc;constructor(t,e,i){this.Ti=null,this.pn=t,this.Hu=i||1,this.qc=null,e!==void 0&&(this.qc=e,i===void 0&&(this.Hu=2))}copy(){let t=new ai(this.pn);t.Hu=this.Hu;let e=this.qc;if(e!==null){let i={};e.duration!==void 0&&(i.duration=e.duration),e.finished!==void 0&&(i.finished=e.finished),e.easing!==void 0&&(i.easing=e.easing),t.qc=i}return t}get propertyName(){return this.pn}set propertyName(t){this.pn=t}get animationSettings(){return this.qc}set animationSettings(t){this.qc=t}OR(t){let e=this.qc;e!==null&&(e.duration&&(t.duration=e.duration),e.finished&&(t.finished=e.finished),e.easing&&(t.easing=e.easing))}get startCondition(){return this.Hu}set startCondition(t){this.Hu=t}static Default=1;static Immediate=2;static Bundled=3}class Et{a;Pt;Zt;vr;Yl;Kl;Hl;ql;jl;Wl;Jl;$l;Zl;Ql;_l;ta;Uc;ea;ob;$m;qu;Ct;constructor(t){V.Je(this),this.a=null,this.Ct=new q,this.Pt="",this.Zt=1,this.vr=!1,this.Yl=!0,this.Kl=!0,this.Hl=!0,this.ql=!0,this.jl=!0,this.Wl=!0,this.Jl=!0,this.$l=!0,this.Zl=!0,this.Ql=!0,this._l=!0,this.ta=!0,this.Uc=!0,this.ea=!0,this.ob=!0,this.$m=!1,this.qu=[],t&&Object.assign(this,t)}IR(){let t=this.Ct;for(let e=0;e<t.length;e++)t.r[e].EM(null);t.clear(),this.qu.length=0}Io(t){this.a=t}toString(t){t===void 0&&(t=0);let e='Layer "'+this.name+'"';if(t<=0)return e;let i=0,s=0,n=0,o=0,r=0,a=this.Ct.iterator;for(;a.next();){let l=a.value;l instanceof ht?n++:l instanceof J?s++:l instanceof j?o++:l instanceof vt?r++:i++}let h="";if(i>0&&(h+=i+" Parts "),s>0&&(h+=s+" Nodes "),n>0&&(h+=n+" Groups "),o>0&&(h+=o+" Links "),r>0&&(h+=r+" Adornments "),t>1){let l=this.Ct.iterator;for(;l.next();){let u=l.value;h+=`
|
|
6
6
|
`+u.toString();let c=u.data;c!==null&&V.xs(c)&&(h+=" #"+V.xs(c)),u instanceof J?h+=" "+m.toString(c):u instanceof j&&(h+=" "+m.toString(u.fromNode)+" "+m.toString(u.toNode))}}return e+" "+this.Ct.count+": "+h}findObjectAt(t,e,i){if(e===void 0&&(e=null),i===void 0&&(i=null),this.ea===!1)return null;let s=!1;this.diagram!==null&&this.diagram.viewportBounds.containsPoint(t)&&(s=!0);let n=P.l(),o=this.Ct.r,r=o.length;for(let a=r;a--;){let h=o[a];if(s===!0&&h.Ul()===!1||!h.isVisible())continue;n.h(t),n.Yi(h.Ws);let l=h.XA(n,e,i);if(l!==null&&(e!==null&&(l=e(l)),l!==null&&(i===null||i(l))))return P.i(n),l}return P.i(n),null}findObjectsAt(t,e,i,s){if(e===void 0&&(e=null),i===void 0&&(i=null),!(s instanceof q)&&!(s instanceof V)&&(s=new V),this.ea===!1)return s;let n=!1;this.diagram!==null&&this.diagram.viewportBounds.containsPoint(t)&&(n=!0);let o=P.l(),r=this.Ct.r,a=r.length;for(let h=a;h--;){let l=r[h];if(n===!0&&l.Ul()===!1||!l.isVisible())continue;o.h(t),o.Yi(l.Ws);let u=l;l.GA(o,e,i,s)&&(e!==null&&(u=e(u)),u!==null&&(i===null||i(u))&&s.add(u))}return P.i(o),s}findObjectsIn(t,e,i,s,n){if(e===void 0&&(e=null),i===void 0&&(i=null),s===void 0&&(s=!1),!(n instanceof q)&&!(n instanceof V)&&(n=new V),this.ea===!1)return n;let o=!1;this.diagram!==null&&this.diagram.viewportBounds.containsRect(t)&&(o=!0);let r=this.Ct.r,a=r.length;for(let h=a;h--;){let l=r[h];if(o===!0&&l.Ul()===!1||!l.isVisible())continue;let u=l;l.Zm(t,e,i,s,n)&&(e!==null&&(u=e(u)),u!==null&&(i===null||i(u))&&n.add(u))}return n}MS(t,e,i,s,n,o,r){if(this.ea===!1)return n;let a=this.Ct.r,h=a.length;for(let l=h;l--;){let u=a[l];if(r===!0&&u.Ul()===!1||!o(u)||!u.isVisible())continue;let c=u;u.Zm(t,e,i,s,n)&&(e!==null&&(c=e(c)),c!==null&&(i===null||i(c))&&n.add(c))}return n}findObjectsNear(t,e,i,s,n,o){if(i===void 0&&(i=null),s===void 0&&(s=null),n===void 0&&(n=!0),n!==!1&&n!==!0&&((n instanceof q||n instanceof V)&&(o=n),n=!0),!(o instanceof q)&&!(o instanceof V)&&(o=new V),this.ea===!1)return o;let r=!1;this.diagram!==null&&this.diagram.viewportBounds.containsPoint(t)&&(r=!0);let a=P.l(),h=P.l(),l=this.Ct.r,u=l.length;for(let c=u;c--;){let d=l[c];if(r===!0&&d.Ul()===!1||!d.isVisible())continue;a.h(t),a.Yi(d.Ws),h.e(t.x+e,t.y),h.Yi(d.Ws);let f=d;d.YA(a,h,i,s,n,o)&&(i!==null&&(f=i(f)),f!==null&&(s===null||s(f))&&o.add(f))}return P.i(a),P.i(h),o}UM(){return this.Ct.r}rs(t,e){if(!this.visible)return;let i=this.Ct.r,s=i.length;if(s===0)return;let n=m.nt(),o=m.nt();for(let r=0;r<s;r++){let a=i[r];if(a.VM=r,a instanceof j){if(a.Fi===!1)continue}else if(a instanceof vt&&a.adornedPart!==null)continue;let h=a.actualBounds;a.isVisible()&&h.BL(e,10)?(a.rs(!0),n.push(a)):(a.rs(!1),a.adornments!==null&&a.adornments.count>0&&o.push(a))}for(let r=0;r<n.length;r++){let a=n[r];a.BM();let h=a.adornments;for(;h.next();){let l=h.value;l.ht(1/0,1/0),l.Ut(),l.rs(!0)}}for(let r=0;r<o.length;r++)o[r].BM();m.Z(n),m.Z(o)}ju(t){let e=1;return this.Zt!==1&&(e=t.globalAlpha,t.globalAlpha=e*this.Zt),e}KA(t,e){for(let i=0;i<e;i++)t[i].jc()}Ge(t,e,i){if(!this.visible||this.Zt===0||(i===void 0&&(i=!0),!i&&this.isTemporary))return;let s=this.Ct.r,n=s.length;if(n===0)return;t.vr&&this.KA(s,n);let o=this.ju(t),r=this.qu;r.length=0;let a=e.scale,h=I.l();for(let l=0;l<n;l++){let u=s[l];this.Qm(t,u,e,r,a,h,!0)}I.i(h),t.vr&&this.KA(s,n),t.globalAlpha=o}OU(t,e,i){if(!this.visible||this.Zt===0)return;let s=this.Ct.r,n=s.length;if(n===0)return;let o=this.ju(t),r=this.qu;r.length=0;let a=e.scale,h=I.l();for(let l=0;l<n;l++){let u=s[l];i.has(u)||this.Qm(t,u,e,r,a,h,!0)}I.i(h),t.globalAlpha=o}ER(t,e,i,s){if(!this.visible||this.Zt===0||!s&&this.isTemporary)return;let n=this.Ct.r,o=n.length;if(o===0)return;let r=this.ju(t),a=this.qu;a.length=0;let h=e.scale,l=I.l();for(let u=0;u<o;u++){let c=n[u];i.has(c)&&this.Qm(t,c,e,a,h,l,!1)}I.i(l),t.globalAlpha=r}UR(t,e,i,s,n){if(!this.visible||this.opacity===0)return;let o=this.diagram.grid.part;if(!s&&this.isTemporary){if(n&&o.layer===this){let r=this.ju(t);o.Ge(t,i),t.globalAlpha=r}}else{let r=this.ju(t),a=i.scale,h=I.l(),l=this.Ct.r,u=l.length;for(let c=0;c<u;c++){let d=l[c];!n&&d===o||this.Qm(t,d,i,null,a,h,!1)}I.i(h),t.globalAlpha=r}}IU(t,e,i){if(!this.visible||this.Zt===0)return;let s=this.ju(t),n=this.qu;n.length=0;let o=e.scale,r=I.l(),a=this.Ct.r,h=a.length,l=i.length;for(let u=0;u<h;u++){let c=a[u],d=c.hh(c.actualBounds);this.VR(d,i,l,o)&&this.Qm(t,c,e,n,o,r,!0)}I.i(r),t.globalAlpha=s}Qm(t,e,i,s,n,o,r){if(r&&!e.Ul()){t.removePartFromView(e);return}if(s!==null&&e instanceof j&&(e.isOrthogonal&&s.push(e),e.Fi===!1)){t.removePartFromView(e);return}let a=!1,h=e.containingGroup;for(;h!==null;)a?h.he!==null&&o.intersectRect(h.he):h.he!==null&&(a=!0,o.h(h.he)),h=h.containingGroup;let l=e.actualBounds,u=!1;if(a&&e.isVisible()){if(!o.intersectsRect(l)){t.removePartFromView(e);return}u=!o.containsRect(l)}u&&(t.save(),t instanceof re?t.partClipRect=o.copy():(t.beginPath(),t.rect(o.x,o.y,o.width,o.height),t.clip())),l.width*n>i._m||l.height*n>i._m?e.Ge(t,i):this.BR(t,e,i),u&&(t.restore(),t.clearContextCache(!0))}BR(t,e,i){if(t instanceof re){e.Ge(t,i);return}let s=e.actualBounds,n=e.naturalBounds;if(s.width===0||s.height===0||isNaN(s.x)||isNaN(s.y)||!e.isVisible())return;let o=e.v;if(e.background===null){e.bn(t,"rgba(0,0,0,0.3)",!0,!1,n,s),t.fillRect(s.x,s.y,s.width,s.height);return}if(t.transform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),e.bn(t,e.background,!0,!1,n,s),t.fillRect(0,0,n.width/2,n.height/2),!o.RP()){let r=1/(o.m11*o.m22-o.m12*o.m21);t.transform(o.m22*r,-o.m12*r,-o.m21*r,o.m11*r,r*(o.m21*o.dy-o.m22*o.dx),r*(o.m12*o.dx-o.m11*o.dy))}}VR(t,e,i,s){let n=2/s,o=4/s;for(let r=0;r<i;r++){let a=e[r];if(!(a.width===0||a.height===0)&&t.intersects(a.x-n,a.y-n,a.width+o,a.height+o))return!0}return!1}t(t,e,i,s,n){let o=this.diagram;o!==null&&o.raiseChangedEvent(2,t,this,e,i,s,n)}ch(t,e,i){let s=this.Ct;if(e.EM(this),t>=s.count)t=s.count;else if(s.elt(t)===e)return-1;s.insertAt(t,e),e.tp(i);let n=this.diagram;return n!==null&&(i?n.C():n.ch(e)),this.rb(t,e),t}ri(t,e,i){if(!i&&e.layer!==this&&e.layer!==null)return e.layer.ri(t,e,i);let s=this.Ct;if(t<0||t>=s.length){if(t=s.indexOf(e),t<0)return-1}else if(s.elt(t)!==e&&(t=s.indexOf(e),t<0))return-1;e.ep(i),s.removeAt(t);let n=this.diagram;return n!==null&&(i?n.C():n.ri(e)),e.EM(null),t}rb(t,e){t=this.zR(t,e),e instanceof ht&&this.XR(t,e),e.svg!==null&&e.svg.remove()}zR(t,e){let i=e.zOrder;if(isNaN(i))return t;let s=this.Ct,n=s.count;if(n<=1)return t;if(t<0&&(t=s.indexOf(e)),t<0)return-1;let o=t-1,r=NaN;for(;o>=0&&(r=s.elt(o).zOrder,!!isNaN(r));)o--;let a=t+1,h=NaN;for(;a<n&&(h=s.elt(a).zOrder,!!isNaN(h));)a++;if(!isNaN(r)&&r>i)for(;;){if(o===-1||r<=i)return o++,o===t?t:(s.removeAt(t),s.insertAt(o,e),o);for(r=NaN;--o>=0&&(r=s.elt(o).zOrder,!!isNaN(r)););}else if(!isNaN(h)&&h<i)for(;;){if(a===n||h>=i)return a--,a===t?t:(s.removeAt(t),s.insertAt(a,e),a);for(h=NaN;++a<n&&(h=s.elt(a).zOrder,!!isNaN(h)););}return t}XR(t,e){if(e===null||!isNaN(e.zOrder))return;this.GR(t,e);let i=e.containingGroup;i!==null&&this.rb(-1,i)}GR(t,e){if(e.memberParts.count===0)return;let i=-1,s=this.Ct.r,n=s.length;for(let o=0;o<n;o++){let r=s[o];if(r===e&&(t=o,i>=0)||i<0&&r.containingGroup===e&&(i=o,t>=0))break}if(!(i<0)&&i<t){let o=this.Ct;o.removeAt(t),o.insertAt(i,e)}}get parts(){return this.Ct.iterator}get partsBackwards(){return this.Ct.iteratorBackwards}get diagram(){return this.a}get name(){return this.Pt}set name(t){m.s(t,"string",Et,"name");let e=this.Pt;if(e!==t){let i=this.diagram;if(i!==null){e===""&&m.o("Cannot rename default Layer to: "+t);let n=i.layers;for(;n.next();)n.value.name===t&&m.o("Layer.name is already present in this diagram: "+t)}this.Pt=t,this.t("name",e,t);let s=this.Ct.iterator;for(;s.next();){let n=s.value;n.layerName=this.Pt}}}get opacity(){return this.Zt}set opacity(t){let e=this.Zt;if(e!==t){m.s(t,"number",Et,"opacity"),(t<0||t>1)&&m.J(t,"0 <= value <= 1",Et,"opacity"),this.Zt=t;let i=this.diagram;i!==null&&i.C(),this.t("opacity",e,t)}}get isViewportAligned(){return this.$m}set isViewportAligned(t){let e=this.$m;e!==t&&(this.$m=t,this.diagram&&(this.HA(),this.diagram.C()),this.t("isViewportAligned",e,t),t&&(this.isInDocumentBounds=!1))}HA(){if(!this.$m)return;let t=this.diagram;if(t===null)return;let e=this.Ct.r,i=e.length,s=t.wt,n=t.xt;for(let o=0;o<i;o++){let r=e[o],a=r.naturalBounds.width,h=r.naturalBounds.height,l=r.alignment;(l.isDefault()||!l.isSpot())&&(l=T.BottomRight);let u=r.alignmentFocus;u.isDefault()&&(u=new T(l.x,l.y));let c=l.x*s+l.offsetX-(u.x*a+u.offsetX),d=l.y*n+l.offsetY-(u.y*h+u.offsetY),f=P.z(c,d);t.YR(f),r.Ec(f.x,f.y,!0),P.i(f),r.it=1/t.scale}}get isTemporary(){return this.vr}set isTemporary(t){let e=this.vr;e!==t&&(m.s(t,"boolean",Et,"isTemporary"),this.vr=t,this.t("isTemporary",e,t))}get visible(){return this.Uc}set visible(t){let e=this.Uc;if(e!==t){m.s(t,"boolean",Et,"visible"),this.Uc=t;let i=this.Ct.iterator;for(;i.next();)i.value.Xe(t);let s=this.diagram;s!==null&&s.C(),this.t("visible",e,t)}}get pickable(){return this.ea}set pickable(t){let e=this.ea;e!==t&&(m.s(t,"boolean",Et,"pickable"),this.ea=t,this.t("pickable",e,t))}get isInDocumentBounds(){return this.ob}set isInDocumentBounds(t){let e=this.ob;e!==t&&(this.ob=t,this.diagram!==null&&this.diagram.invalidateDocumentBounds(),this.t("isInDocumentBounds",e,t))}get allowCopy(){return this.Yl}set allowCopy(t){let e=this.Yl;e!==t&&(m.s(t,"boolean",Et,"allowCopy"),this.Yl=t,this.t("allowCopy",e,t))}get allowDelete(){return this.Kl}set allowDelete(t){let e=this.Kl;e!==t&&(m.s(t,"boolean",Et,"allowDelete"),this.Kl=t,this.t("allowDelete",e,t))}get allowTextEdit(){return this.Hl}set allowTextEdit(t){let e=this.Hl;e!==t&&(m.s(t,"boolean",Et,"allowTextEdit"),this.Hl=t,this.t("allowTextEdit",e,t))}get allowGroup(){return this.ql}set allowGroup(t){let e=this.ql;e!==t&&(m.s(t,"boolean",Et,"allowGroup"),this.ql=t,this.t("allowGroup",e,t))}get allowUngroup(){return this.jl}set allowUngroup(t){let e=this.jl;e!==t&&(m.s(t,"boolean",Et,"allowUngroup"),this.jl=t,this.t("allowUngroup",e,t))}get allowLink(){return this.Wl}set allowLink(t){let e=this.Wl;e!==t&&(m.s(t,"boolean",Et,"allowLink"),this.Wl=t,this.t("allowLink",e,t))}get allowRelink(){return this.Jl}set allowRelink(t){let e=this.Jl;e!==t&&(m.s(t,"boolean",Et,"allowRelink"),this.Jl=t,this.t("allowRelink",e,t))}get allowMove(){return this.$l}set allowMove(t){let e=this.$l;e!==t&&(m.s(t,"boolean",Et,"allowMove"),this.$l=t,this.t("allowMove",e,t))}get allowReshape(){return this.Zl}set allowReshape(t){let e=this.Zl;e!==t&&(m.s(t,"boolean",Et,"allowReshape"),this.Zl=t,this.t("allowReshape",e,t))}get allowResize(){return this.Ql}set allowResize(t){let e=this.Ql;e!==t&&(m.s(t,"boolean",Et,"allowResize"),this.Ql=t,this.t("allowResize",e,t))}get allowRotate(){return this._l}set allowRotate(t){let e=this._l;e!==t&&(m.s(t,"boolean",Et,"allowRotate"),this._l=t,this.t("allowRotate",e,t))}get allowSelect(){return this.ta}set allowSelect(t){let e=this.ta;e!==t&&(m.s(t,"boolean",Et,"allowSelect"),this.ta=t,this.t("allowSelect",e,t))}}var Ii=(x=>(x[x.None=1]="None",x[x.Uniform=2]="Uniform",x[x.UniformToFill=3]="UniformToFill",x))(Ii||{}),Vs=(x=>(x[x.All=1]="All",x[x.NotDirected=2]="NotDirected",x[x.NotDirectedFast=3]="NotDirectedFast",x[x.NotUndirected=4]="NotUndirected",x[x.DestinationTree=5]="DestinationTree",x[x.SourceTree=6]="SourceTree",x))(Vs||{}),zs=(x=>(x[x.Document=1]="Document",x[x.Infinite=2]="Infinite",x))(zs||{}),Ks=(x=>(x[x.TreeParent=1]="TreeParent",x[x.AllParents=2]="AllParents",x[x.AnyParents=3]="AnyParents",x))(Ks||{});class Y{Ns;jt;zM;lb;Fr;Wu;ab;hb;cb;fb;ub;db;fh;ah;gb;pb;yb;ia;Wc;Rr;ip;wb;xb;Ju;to;Or;uh;Uo;sp;Jc;np;$c;$u;Ir;eo;XM;GM;bb;kb;YM;Pb;KM;HM;qM;Sb;op;Er;Ur;Vr;Br;zr;Xr;Mb;Gr;Nb;Yr;Kr;Hr;qr;Cb;jM;Vo;WM;Lb;Ab;JM;Ce;$M;Zc;ZM;Hs;Bo;Be;Tb;Yl;Kl;Db;vb;Hl;ql;jl;Fb;Wl;Jl;$l;Zl;Ql;_l;ta;Rb;Ob;QM;Zu;Qu;Ib;Eb;Ub;Vb;rp;Bb;zb;Xb;Qt;qA;Gb;jA;_u;kn;io;li;so;WA;sa;_M;t2;lp;Yb;td;ap;Kb;jr;na;dh;e2;i2;hp;Hb;qb;ls;ed;cp;sd;zo;Qc;fp;Wr;gh;s2;dp;Ht;v;qi;Tr;Ye;As;o2;oa;Jr;Fl;$r;mh;_c;l2;nd;ph;od;Vt;ra;ct;it;rd;wt;xt;lt;tf;Mx;jb;yh;ef;Wb;Jb;gp;KR;HR;$e;Ol;_m;mp;a2;h2;JA;pp;qR;jR;WR;$b;JR;$R;ZR;wh;$A;la;xh;bh;kh;Ph;Iu;oh;Wt;Nt;sf;jP;WP;Dc;Zt;static Zb=null;static ZA=new Mt;static c2;static f2=null;Ou;Qb;_b;ld;t1;e1;yp;u2;wp;xp;bp;qx;d2;g2;nf;kp;Pp;constructor(t,e){if(Y.jw||(Y.OP(),Y.jw=!0),V.Je(this),Y.QA(this),this.Ht=!0,this.Nt=null,this.wt=0,this.xt=0,this.lt=null,Y.isUsingDOM()){let s=this,n=()=>{s.Le(X.document,"DOMContentLoaded",n,!1),s.setRTL()};X.document.body!==null?this.setRTL():s.Et(X.document,"DOMContentLoaded",n,!1)}this.tf=null,Y.m2("Model",ge);let i=this;return this.$M=s=>i.partManager.doModelDataChanged(s),this.Zc=s=>i.partManager.doModelChanged(s),this.Wb=null,this.Jb=null,this._A(),this.model=ut.p2(),this.themeManager=new Ge,this.Vo=!0,this.tT(),this.layout=new _t,this.Vo=!1,this.qR=null,this.jR=null,this.WR=null,this.$b=null,this.JR=null,this.$R=null,this.ZR=null,this.wh=null,this.$A=null,this.la=null,this.xh=null,this.bh=null,this.kh=null,this.Ph=null,this.Iu=()=>{},this.oh=null,this.sd=!1,this.sf=new Fn(this),t!==void 0&&(typeof t=="string"||X.Element&&t instanceof Element?this.w2(t):e=t),e&&this.setProperties(e),this.Ht=!1,this.requestUpdate(),this}aR(){return this.lt!==null}get renderer(){return this.Qc}set renderer(t){if(this instanceof hi)return;t===""&&(t="default");let e=t.toLowerCase(),i=this.Qc;if(e===i)return;this.Qc=e;let s=null;e==="default"||e==="canvas"?(s=this.zo.get("svg"),s!==null&&s.bt.remove(),this.lt&&(this.Wt=this.lt._t,this.Wt.clearContextCache(!0))):e==="svg"?(this.zo.has("svg")?s=this.zo.get("svg"):(s=new ui(this,X.document),this.addRenderer("svg",s)),this.div!==null&&(s.bt.role="img",this.div.appendChild(s.bt)),this.lt&&(this.Wt=s._t,this.lt._t.setTransform(this.$e,0,0,this.$e,0,0),this.lt._t.clearRect(0,0,this.wt,this.xt))):e==="debug"&&(this.zo.has("SVG")||(s=new ui(this,X.document),this.addRenderer("SVG",s),s.bt.style.backgroundColor="whitesmoke",this.div!==null&&this.div.after(s.bt))),this.Ht||this.redraw()}_A(){if(this.nf=new q,this.setupRouters(),this.Ns=new he,this.Ns.Io(this),this.jt=17,this.zM=!1,this.rd=!1,this.lb="default",this.Vt=new q,this.zo){let t=this.zo.get("svg");t!==null&&t.bt.remove(),this.lt&&(this.Wt=this.lt._t,this.Wt.clearContextCache(!0))}this.zo=new Mt,this.Qc="default",this.resetRenderingHints(),this.QR(),this.Zt=1,this.ct=new P(NaN,NaN).k(),this.qx=new P(NaN,NaN),this.it=1,this.dp=1,this.ab=new P(NaN,NaN).k(),this.hb=NaN,this.cb=1e-4,this.fb=100,this.v=new Nt,this.ub=new P(NaN,NaN).k(),this.db=new I(NaN,NaN,NaN,NaN).k(),this.fh=new Dt(0,0,0,0).kt(),this.ah=1,this.gb=!1,this.pb=null,this.yb=null,this.ia=1,this.Wc=T.Default,this.Rr=1,this.ip=T.Default,this.wb=T.None,this.xb=T.None,this.qi=!0,this.Ju=!1,this.to=new Set,this.Or=new V,this.uh=new V,this.Uo=!1,this.ra=new Mt,this.nd=!0,this.sp=250,this.Jc=-1,this.np=new Dt(16,16,16,16).kt(),this.Tr=!1,this.$c=!1,this.$u=!0,this.fp=new Qt,this.fp.diagram=this,this.Wr=new Qt,this.Wr.diagram=this,this.gh=new Qt,this.gh.diagram=this,this.Ir=null,this.eo=null,this.Mx=!1,this._R(),this.$r=new V,this.bb=!0,this.kb=1,this.YM=!1,this.Pb=1,this.Sb="auto",this.op="auto",this.Er=null,this.Ur=null,this.Vr=null,this.Br=null,this.zr=null,this.Xr=null,this.Mb=null,this.Gr=null,this.Nb=!1,this.Yr=null,this.Kr=null,this.Hr=null,this.qr=null,this.Cb=!1,this.jb={},this.yh=[null,null],this.Vo=!1,this.WM=!1,this.Lb=!1,this.Ab=!1,this.JM=!0,this.As=!1,this.ph=!1,this.ZM=!0,this.Hs=-2,this.oa=new Mt,this.od=new q,this.Bo=!1,this.Be=!0,this.Tb=!0,this.Yl=!0,this.Kl=!0,this.Db=!1,this.vb=!0,this.Hl=!0,this.ql=!0,this.jl=!0,this.Fb=!0,this.Wl=!0,this.Jl=!0,this.$l=!0,this.Zl=!0,this.Ql=!0,this._l=!0,this.ta=!0,this.Rb=!0,this.Ob=!0,this.QM=!1,this.ef=!1,this.Zu=!0,this.Qu=!0,this.Ib=!0,this.Eb=!0,this.Ub=16,this.Vb=16,this.rp=!1,this.Bb=!1,this.zb=0,this.Xb=0,this.Qt=new Dt(5).kt(),this.qA=new V().k(),this.Gb=999999999,this.jA=new V().k(),this.mh=!0,this._u=!0,this._c=!0,this.kn=!1,this.io=!1,this.Jr=!0,this.Fl=!1,this.so=!1,this.WA=new V,this.l2=new V,this.sa=null,this._M=new st(j.eT,j.iT),this.t2=999,this.lp=!1,this.jP=1,this.WP=0,this.Ye={scale:1,position:new P,bounds:new I,canvasSize:new st,newCanvasSize:new st,isScroll:!1},this.Ye.canvasSize=this.Ye.canvasSize,this.Ye.newCanvasSize=this.Ye.newCanvasSize,this.Ye.isScroll=!1,this.Yb=new I(NaN,NaN,NaN,NaN).k(),this.td=new st(NaN,NaN).k(),this.ap=new I(NaN,NaN,NaN,NaN).k(),this.Kb=!1,this.kp=null,this.Pp=null,this.tO(),this.ls=null,this.ed=!1,this.Dc=null,this.partManager=new ge,this.toolManager=new ne,this.toolManager.initializeStandardTools(),this.defaultTool=this.toolManager,this.currentTool=this.defaultTool,this._b=null,this.ld=new Pi,this.t1=null,this.e1=null,this.Qb=!1,this.Ou=!1,this.commandHandler=new jt,this.xp=null,this.bp=P.gn,this.d2=!1,this.$e=1,this.Ol=null,this._m=1,this.yp=0,this.u2=[0,0,0,0,0],this.wp=0,this.mp=1,this.a2=0,this.h2=new P,this.JA=500,this.cp=new P,this.pp=!1}static sT=X.document!==void 0;static isUsingDOM(){return Y.sT}static setDocument(t){X.document=t}static useDOM(t){Y.sT=t?X.document!==void 0:!1}static ji=new WeakMap;clear(){this.animationManager.stopAnimation(),this.model.clear(),Y.nT(),this.oT(!1),this.od.clear(),this.rT(),this.sa=null,this.invalidateDocumentBounds(),this.ensureBounds(),this.C()}oT(t){this.animationManager.stopAnimation(!0),this.clearSelection(),this.clearHighlighteds();let e=this.skipsUndoManager,i=this.Ce!==null&&this.Ce!==void 0;i&&(this.skipsUndoManager=!0);let s=null;this.ls!==null&&(s=this.ls.part,s!==null&&this.remove(s));let n=[],o=this.Vt.length;if(t){for(let r=0;r<o;r++){let a=this.Vt.r[r].parts;for(;a.next();){let h=a.value;h!==s&&h.data===null&&n.push(h)}}for(let r=0;r<n.length;r++){let a=n[r];this.remove(a)}}for(let r=0;r<o;r++)this.Vt.r[r].IR();return this.partManager.clear(),this.to.clear(),this.Or.clear(),this.uh.clear(),this.ra.clear(),this.$r.clear(),this.Dc=null,this.od.clear(),this.rT(),m.LP=[],s!==null&&(this.add(s),this.partManager.parts.delete(s)),i&&(this.skipsUndoManager=e),n}static Sp=null;static i1="";static nT(){Y.Sp=null,Y.i1=""}static EU(){return null}reset(){this.clear(),this.Ht=!0,this._A(),this.themeManager=new Ge,this.aa(),this.Vo=!0,this.tT(),this.layout=new _t,this.Vo=!1,this.model=ut.p2(),this.model.undoManager=new vi,this.sd=!1,this.Ht=!1,this.C()}tO(){this.jr=new Mt,this.e2=new J().add(new lt({stroke:"black",font:"10pt sans-serif"}).bind("text","",m.toString).theme("stroke","text").theme("font","normal")),this.jr.set("",this.e2),this.jr.set("Comment",new J().add(new lt({stroke:"brown",font:"10pt sans-serif"}).bind("text","",m.toString).theme("stroke","comment").theme("font","normal"))),this.jr.set("LinkLabel",new J({selectable:!1,avoidable:!1}).add(new et("Ellipse",{fill:"black",stroke:null,desiredSize:new st(3,3).kt()}).theme("fill","link"))),this.dh=new Mt,this.o2=new ht(G.Vertical,{selectionObjectName:"GROUPPANEL"}).add(new lt({stroke:"black",font:"bold 12pt sans-serif"}).bind("text","",m.toString).theme("stroke","text").theme("font","bold"),new G(G.Auto,{name:"GROUPPPANEL"}).add(new et({fill:"rgba(128,128,128,0.2)",stroke:"black",strokeWidth:1}).theme("fill","group").theme("stroke","outline").theme("strokeWidth","group"),new le({padding:5}).theme("padding","group"))),this.dh.set("",this.o2),this.na=new Mt,this.i2=new j().add(new et({isPanelMain:!0,stroke:"black"}).theme("stroke","link"),new et({toArrow:"Standard",fill:"black",stroke:null,strokeWidth:0}).theme("toArrow").theme("fill","link")),this.na.set("",this.i2),this.na.set("Comment",new j().add(new et({isPanelMain:!0,stroke:"brown"}).theme("stroke","comment"))),this.hp=new vt(G.Auto).add(new et({fill:null,stroke:"dodgerblue",strokeWidth:3}).theme("stroke","selection").theme("strokeWidth","selection"),new le({margin:1.5}).theme("margin","selection","numbers",null,t=>t?new Dt(t/2):1.5)).freezeBindings(),this.Hb=this.hp,this.qb=new vt(G.Link).add(new et({isPanelMain:!0,fill:null,stroke:"dodgerblue",strokeWidth:3}).theme("stroke","selection").theme("strokeWidth","selection")).freezeBindings()}setRTL(t){let e=t===void 0?this.div:t;e===null&&(e=X.document.body);let i=m.Ni("div");i.dir="rtl",i.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",i.textContent="A",e.appendChild(i);let s="reverse";i.scrollLeft>0?s="default":(i.scrollLeft=1,i.scrollLeft===0&&(s="negative")),e.removeChild(i),this.lb=s}setScrollWidth(t){let e=t===void 0?this.div:t;e===null&&(e=X.document.body);let i=0;if(Y.isUsingDOM()){let s=Y.f2,n=Y.c2;s===null&&(Y.f2=m.Ni("p"),s=Y.f2,s.style.width="100%",s.style.height="200px",s.style.boxSizing="content-box",Y.c2=m.Ni("div"),n=Y.c2,n.style.position="absolute",n.style.visibility="hidden",n.style.width="200px",n.style.height="150px",n.style.boxSizing="content-box",n.appendChild(s)),n.style.overflow="hidden",e.appendChild(n);let o=s.offsetWidth;n.style.overflow="scroll";let r=s.offsetWidth;o===r&&(r=n.clientWidth),e.removeChild(n),i=o-r,i===0&&!m.fr&&(i=11)}this.jt=i,this.zM=!0}fe(t){t in Ii?this.autoScale=t:m.ur(this,t)}toString(t){t===void 0&&(t=0);let e="";this.div&&this.div.id&&(e=this.div.id);let i='Diagram "'+e+'"';if(t<=0)return i;let s=this.Vt.iterator;for(;s.next();){let n=s.value;i+=`
|
|
7
|
-
`+n.toString(t-1)}return i}static QA(t){Y.Zb=t}static Om(){return Y.Zb}static fromDiv(t){let e=t;if(typeof t=="string"&&(e=X.document.getElementById(t)),e instanceof HTMLDivElement){let i=Y.ji.get(e);if(i)return i}return null}get div(){return this.Nt}set div(t){if(t!==null&&m.se(t,HTMLDivElement,Y,"div"),this.Nt!==t){let e=this.Nt;if(e!==null){if(Y.ji.delete(e),e.goDiagram=void 0,e.go=void 0,e.innerHTML="",this.lt!==null){let s=this.lt.bt;this.Le(s,"pointermove",this.xh,!1),this.Le(s,"pointerdown",this.la,!1),this.Le(s,"pointerup",this.bh,!1),this.Le(s,"pointerout",this.kh,!1),this.Le(s,"pointercancel",this.Ph,!1),this.lt.dispose()}this.tf&&(this.tf.disconnect(),this.tf=null);let i=this.toolManager;i!==null&&(i.mouseDownTools.each(s=>s.cancelWaitAfter()),i.mouseMoveTools.each(s=>s.cancelWaitAfter()),i.mouseUpTools.each(s=>s.cancelWaitAfter())),i.cancelWaitAfter(),this.currentTool.doCancel(),this.lt=null,this.Le(X,"resize",this.$b,!1),this.Le(X,"wheel",this.wh,!0),Y.Om()===this&&Y.QA(null)}else this.la===null&&(this.so=!1);if(this.Nt=null,t!==null){let i=Y.ji.get(t);i&&(i.div=null),this.w2(t),this.Iu(),this.themeManager&&this.themeManager.eO()}else this.themeManager&&this.themeManager.iO()}}setupRouters(){this.nf.push(new _n)}w2(t){let e=this;if(!Y.isUsingDOM())return;t==null&&m.o("Diagram setup requires an argument DIV."),e.Nt!==null&&m.o("Diagram has already completed setup."),typeof t=="string"?e.Nt=X.document.getElementById(t):t instanceof HTMLDivElement?e.Nt=t:m.o("No DIV or DIV id supplied: "+t),e.Nt===null&&m.o("Invalid DIV id; could not get element with id: "+t);let i=Y.ji.get(e.Nt);if(i&&i!==this&&m.o("Invalid div id; div already has a Diagram associated with it."),!e.tf&&X.ResizeObserver){let u=X.ResizeObserver,c=m.CP(()=>e.requestUpdate(),250,!1);e.tf=new u(()=>c()),e.tf.observe(e.Nt)}X.getComputedStyle(e.Nt,null).position==="static"&&(e.Nt.style.position="relative");let s=5,n="rgba(2"+s+"5, 255, 255, 0)";s--,e.Nt.style["-webkit-tap-highlight-color"]=n,e.Nt.innerHTML="",Y.ji.set(e.Nt,e),e.Nt.goDiagram=e,e.Nt.go=X.go;let o=new Fe(e);o.style!==void 0&&(o.style.position="absolute",o.style.top="0px",o.style.left="0px",X.getComputedStyle(e.Nt,null).getPropertyValue("direction")==="rtl"&&(e.rd=!0),o.style.zIndex="2",o.style.userSelect="none",o.style.MozUserSelect="none",o.style.touchAction="none",o.style.letterSpacing="normal !important",o.style.wordSpacing="normal !important",o.style.lang="unknown"),o.bt.setAttribute("role","application"),e.lt=o,e.Wt=o._t;let r=e.Wt;e.$e=e.computePixelRatio(),e.viewSize.isReal()||(e.wt=e.Nt.clientWidth||1,e.xt=e.Nt.clientHeight||1),e.lT(e.wt,e.xt);let a=e;e.Nt.insertBefore(o.bt,e.Nt.firstChild);let h=new Fe(null);if(h.width=1,h.height=1,e.KR=h,e.HR=h._t,Y.isUsingDOM()){let u=m.Ni("div"),c=m.Ni("div");u.style.position="absolute",u.style.overflow="auto",u.style.width=e.wt+"px",u.style.height=e.xt+"px",u.style.zIndex="1",c.style.position="absolute",c.style.width="1px",c.style.height="1px",e.Nt.appendChild(u),u.appendChild(c),u.onscroll=Y.sO,u.addEventListener("pointerdown",Y.nO),u.a=e,u.oO=!0,u.rO=!0,e.Wb=u,e.Jb=c}e.Iu=m.CP(()=>{e.Ol=null,e.C()},300,!1),e.$b=m.CP(()=>{e.NM()},250,!1),e.oh=u=>(u.preventDefault(),!1),e.wh=u=>{if(!a.isEnabled)return;let c=a.of(u,!0);c.bubbles=!0;let d=0,f=0;c.delta=0,u.deltaX!==void 0?(u.deltaX!==0&&(d=u.deltaX>0?1:-1),u.deltaY!==0&&(f=u.deltaY>0?1:-1),c.delta=Math.abs(u.deltaX)>Math.abs(u.deltaY)?-d:-f):u.wheelDeltaX!==void 0?(u.wheelDeltaX!==0&&(d=u.wheelDeltaX>0?-1:1),u.wheelDeltaY!==0&&(f=u.wheelDeltaY>0?-1:1),c.delta=Math.abs(u.wheelDeltaX)>Math.abs(u.wheelDeltaY)?-d:-f):u.wheelDelta!==void 0&&u.wheelDelta!==0&&(c.delta=u.wheelDelta>0?1:-1),a.doMouseWheel(),a.Sh(c,u)},e.$A=u=>{if(!a.isEnabled)return;e.ef=!1,a.of(u,!0);let c=a.currentTool;c.cancelWaitAfter(),c.standardMouseOver()},e.la=u=>{if(!a.isEnabled)return;e.ef=!0;let c=a.jb;c[u.pointerId]===void 0&&(c[u.pointerId]=u);let d=a.yh,f=!1;if(d[0]!==null&&(d[0].pointerId===u.pointerId||d[0].pointerType!==u.pointerType))d[0]=u;else if(d[1]!==null&&d[1].pointerId===u.pointerId)d[1]=u,f=!0;else if(d[0]===null)d[0]=u;else if(d[1]===null)d[1]=u,f=!0;else{u.preventDefault();return}let p=u.pointerType==="touch"||u.pointerType==="pen";p&&(a.Mx=!1,a.pp=!0);let g=a.lO(u,u,f),y=a.h2,b=p?25:10;if(u.timeStamp-a.a2<a.JA&&!(Math.abs(y.x-u.screenX)>b||Math.abs(y.y-u.screenY)>b)?a.mp++:a.mp=1,g.clickCount=a.mp,a.a2=u.timeStamp,a.h2.setTo(u.screenX,u.screenY),a.doMouseDown(),u.button===1){u.preventDefault();return}a.Sh(g,u)},e.xh=u=>{if(!a.isEnabled)return;e.ef=!0;let c=a.yh;if(c[0]!==null&&(c[0].pointerId===u.pointerId||c[0].pointerType!==u.pointerType))c[0]=u;else if(c[1]!==null&&c[1].pointerId===u.pointerId){c[1]=u;return}else if(c[0]===null)c[0]=u;else return;if(c[0].pointerId!==u.pointerId)return;let d=a.aO(u,u,c[1]!==null);a.doMouseMove(),a.Sh(d,u)},e.bh=u=>{if(!a.isEnabled)return;e.ef=!0;let c=u.pointerType==="touch"||u.pointerType==="pen",d=a.jb;if(c&&a.Mx){delete d[u.pointerId],u.preventDefault();return}let f=a.yh;if(f[0]!==null&&(f[0].pointerId===u.pointerId||f[0].pointerType!==u.pointerType))f[0]=null;else if(f[1]!==null&&f[1].pointerId===u.pointerId){f[1]=null;return}else return;let p=a.b2(u,!1,!0,!1,!0,!1),g=X.document.elementFromPoint(u.clientX,u.clientY)||null;g!==null&&g.shadowRoot&&(g=g.shadowRoot.elementFromPoint(u.clientX,u.clientY)||null),g!==null&&g.a instanceof Y&&g.a!==a&&g.a.Mp(u,p),g===null&&(g=u.target),a.Mp(u,p),p.clickCount=a.mp,p.targetDiagram=a.s1(u,g),p.targetObject=null,a.doMouseUp(),a.Sh(p,u),c&&(a.pp=!1)},e.kh=u=>{if(!a.isEnabled)return;e.ef=!1;let c=a.jb;c[u.pointerId]&&delete c[u.pointerId];let d=a.yh;if(d[0]!==null&&d[0].pointerId===u.pointerId&&(d[0]=null),d[1]!==null&&d[1].pointerId===u.pointerId&&(d[1]=null),u.pointerType==="touch"||u.pointerType==="pen")return;let f=a.currentTool;f.cancelWaitAfter(),f.standardMouseOver()},e.Ph=u=>{let c=a.yh;c[0]!==null&&c[0].pointerId===u.pointerId?(c[0]=null,a.pp=!1):c[1]!==null&&c[1].pointerId===u.pointerId&&(c[1]=null)};let l=r;if(e.gp=l.F[m.We("7eba17a4ca3b1a8346")][m.We("78a118b7")](l.F,Y.Mh,s,s),r.clearContextCache(!0),e.hO(),this.Qc==="svg"){let u=this.zo.get("svg");this.Nt&&this.Nt.appendChild(u.bt),this.Wt=u._t}}addEventListener(t,e,i,s){t.addEventListener(e,i,{capture:s,passive:!1})}Et(t,e,i,s){t.addEventListener(e,i,{capture:s,passive:!1})}removeEventListener(t,e,i,s){t.removeEventListener(e,i,{capture:s})}Le(t,e,i,s){t.removeEventListener(e,i,{capture:s})}hO(){let t=this,e=this.lt.bt;e instanceof HTMLCanvasElement||(e=t.div),this.Et(e,"pointerdown",t.la,!1),this.Et(e,"pointermove",t.xh,!1),this.Et(e,"pointerup",t.bh,!1),this.Et(e,"pointerout",t.kh,!1),this.Et(e,"pointercancel",t.Ph,!1),this.Et(e,"pointerenter",t.cO,!1),this.Et(e,"pointerleave",t.fO,!1),this.Et(e,"wheel",t.wh,!1),this.Et(e,"keydown",t.uO,!1),this.Et(e,"keyup",t.dO,!1),this.Et(e,"blur",t.gO,!1),this.Et(e,"focus",t.mO,!1),this.Et(e,"selectstart",i=>(i.preventDefault(),!1),!1),this.Et(e,"contextmenu",i=>(i.preventDefault(),!1),!1),this.Et(X,"resize",t.$b,!1)}Cx(){this.yp>30&&(this.Ol=1)}yS(t){this.Ol!==null&&(this.Ol=null,t&&this.Iu(),this.yp=0,this.u2=[0,0,0,0,0],this.wp=0)}computePixelRatio(){return this.Ol!==null?this.Ol:X.devicePixelRatio||1}get avgSpf(){return this.yp}doMouseDown(){this.currentTool.doMouseDown()}doMouseMove(){this.currentTool.doMouseMove()}doMouseUp(){this.currentTool.doMouseUp()}doMouseWheel(){this.currentTool.doMouseWheel()}doKeyDown(){let t=this.commandHandler;if(!this.toggleKeyboardControl()){if((t.isFocusEnabled||t.isVirtualPointerEnabled)&&t.doVirtualFocusKeyDown()){let e=this.lastInput;e.bubbles=!1;let i=e.event;i&&(i.stopPropagation&&i.stopPropagation(),i.cancelable!==!1&&i.preventDefault());return}this.currentTool.doKeyDown()}}toggleKeyboardControl(){let t=this.lastInput,e=t.commandKey;if((t.control||t.meta)&&t.alt&&(e==="Enter"||e==="NumpadEnter")){let i=this.commandHandler,s=i.isFocusEnabled||i.isVirtualPointerEnabled;return i.isFocusEnabled=!s,i.isVirtualPointerEnabled=!s,i.focus=i.findFirstFocus(),this.T("FocusOrVirtualPointerEnabledChanged"),!0}return!1}doKeyUp(){let t=this.commandHandler;if((t.isFocusEnabled||t.isVirtualPointerEnabled)&&t.doVirtualFocusKeyUp()){let e=this.lastInput;e.bubbles=!1;let i=e.event;i&&(i.stopPropagation&&i.stopPropagation(),i.cancelable!==!1&&i.preventDefault());return}this.currentTool.doKeyUp()}ad(t,e){if(e)for(let i in e)i!=="sourceDiagram"&&(t[i]=e[i])}emitMouseDown(t,e,i,s){if(typeof t!="number"||typeof e!="number")throw new Error("Robot.mouseDown first two args must be X,Y numbers");i===void 0&&(i=0);let n=this;if(s&&s.sourceDiagram&&(n=s.sourceDiagram),!n.isEnabled)return this;let o=new Qt;return o.diagram=n,o.documentPoint=new P(t,e),o.viewPoint=n.transformDocToView(o.documentPoint),o.timestamp=i,o.down=!0,this.ad(o,s),n.lastInput=o,n.firstInput=o.copy(),n.doMouseDown(),this}emitMouseMove(t,e,i,s){if(typeof t!="number"||typeof e!="number")throw new Error("Robot.mouseMove first two args must be X,Y numbers");i===void 0&&(i=0);let n=this;if(s&&s.sourceDiagram&&(n=s.sourceDiagram),!n.isEnabled)return this;let o=new Qt;return o.diagram=n,o.documentPoint=new P(t,e),o.viewPoint=n.transformDocToView(o.documentPoint),o.timestamp=i,this.ad(o,s),n.lastInput=o,n.doMouseMove(),this}emitMouseUp(t,e,i,s){if(typeof t!="number"||typeof e!="number")throw new Error("Robot.mouseUp first two args must be X,Y numbers");i===void 0&&(i=0);let n=this;if(s&&s.sourceDiagram&&(n=s.sourceDiagram),!n.isEnabled)return this;let o=new Qt;return o.diagram=n,o.documentPoint=new P(t,e),o.viewPoint=n.transformDocToView(o.documentPoint),o.timestamp=i,o.up=!0,n.firstInput.documentPoint.equals(o.documentPoint)&&(o.clickCount=1),this.ad(o,s),n.lastInput=o,n.doMouseUp(),this}emitMouseWheel(t,e,i){if(typeof t!="number")throw new Error("Robot.mouseWheel first arg must be DELTA number");e===void 0&&(e=0);let s=this;if(!s.isEnabled)return this;let n=new Qt;return n.diagram=s,n.documentPoint=s.lastInput.documentPoint,n.viewPoint=s.lastInput.viewPoint,n.delta=t,n.timestamp=e,this.ad(n,i),s.lastInput=n,s.doMouseWheel(),this}emitKeyDown(t,e,i){if(typeof t!="string"&&typeof t!="number")throw new Error("Robot.keyDown first arg must be a string or a number");e===void 0&&(e=0);let s=this;if(!s.isEnabled)return this;let n=new Qt;return n.diagram=s,n.documentPoint=s.lastInput.documentPoint,n.viewPoint=s.lastInput.viewPoint,typeof t=="string"?n.key=t:typeof t=="number"&&(n.key=String.fromCharCode(t)),n.timestamp=e,n.down=!0,this.ad(n,i),s.lastInput=n,s.doKeyDown(),this}emitKeyUp(t,e,i){if(typeof t!="string"&&typeof t!="number")throw new Error("Robot.keyUp first arg must be a string or a number");e===void 0&&(e=0);let s=this;if(!s.isEnabled)return this;let n=new Qt;return n.diagram=s,n.documentPoint=s.lastInput.documentPoint,n.viewPoint=s.lastInput.viewPoint,typeof t=="string"?n.key=t:typeof t=="number"&&(n.key=String.fromCharCode(t)),n.timestamp=e,n.up=!0,this.ad(n,i),s.lastInput=n,s.doKeyUp(),this}doFocus(){this.focus()}focus(){if(this.lt)if(this.scrollsPageOnFocus)this.lt.focus();else{let t=X.scrollX,e=X.scrollY;this.lt.focus(),X.scrollTo(t,e)}}mO(t){let e=Y.ji.get(this);e&&e.T("GainedFocus")}gO(t){let e=Y.ji.get(this);e&&e.T("LostFocus")}NM(){if(this.lt===null)return;let t=this.Nt;if(t===null||t.clientWidth===0||t.clientHeight===0)return;this.zM||this.setScrollWidth();let e=this.io?this.jt:0,i=this.kn?this.jt:0,s=this.$e;if(this.$e=this.computePixelRatio(),this.$e!==s&&(this.Ju=!0,this.requestUpdate()),t.clientWidth!==this.wt+e||t.clientHeight!==this.xt+i){this.Nh(),this.qi=!0;let n=this.layout;n!==null&&n.isViewportSized&&this.autoScale===1&&(this.$c=!0,n.p()),this.As||this.requestUpdate()}}tT(){let t=0,e=new Et;e.name="Grid",e.allowSelect=!1,e.pickable=!1,e.isTemporary=!0,e.isInDocumentBounds=!1,this.Zr(e,t++),e=new Et,e.name="ViewportBackground",e.isViewportAligned=!0,e.isTemporary=!0,e.isInDocumentBounds=!1,this.Zr(e,t++),e=new Et,e.name="Background",this.Zr(e,t++),e=new Et,e.name="",this.Zr(e,t++),e=new Et,e.name="Foreground",this.Zr(e,t++),e=new Et,e.name="ViewportForeground",e.isViewportAligned=!0,e.isTemporary=!0,e.isInDocumentBounds=!1,this.Zr(e,t++),e=new Et,e.name="Adornment",e.isTemporary=!0,e.isInDocumentBounds=!1,this.Zr(e,t++),e=new Et,e.name="Tool",e.isTemporary=!0,e.isInDocumentBounds=!0,this.Zr(e,t++)}aT(){let t=new G(G.Grid,{name:"GRID"}).add(new et("LineH",{stroke:"lightgray",strokeWidth:.5,interval:1}).theme("stroke","gridMinor"),new et("LineV",{stroke:"lightgray",strokeWidth:.5,interval:1}).theme("stroke","gridMinor"),new et("LineH",{stroke:"gray",strokeWidth:.5,interval:5}).theme("stroke","gridMajor"),new et("LineV",{stroke:"gray",strokeWidth:.5,interval:5}).theme("stroke","gridMajor"),new et("LineH",{stroke:"gray",strokeWidth:1,interval:10}).theme("stroke","gridMajor"),new et("LineV",{stroke:"gray",strokeWidth:1,interval:10}).theme("stroke","gridMajor")),e=new pt({layerName:"Grid",zOrder:0,isInDocumentBounds:!1,isAnimated:!1,pickable:!1,locationObjectName:"GRID"}).add(t);return this.add(e),this.partManager.parts.delete(e),t.visible=!1,t}static sO(){let t=Y.ji.get(this.parentElement||this);if(t){if(t.Bb){t.Bb=!1;return}if(!t.isEnabled){t.hT();return}t.diagramScroll(this)}}static nO(t){if(!this.a.isEnabled){this.a.updateScroll();return}this.a.zb=t.target.scrollTop,this.a.Xb=t.target.scrollLeft}diagramScroll(t){if(this.lt===null)return;let e=this.Wb,i=this.Jb;this.rp=!0;let s=this.documentBounds,n=this.viewportBounds,o=this.fh,r=s.x-o.left,a=s.y-o.top,h=s.width+o.left+o.right,l=s.height+o.top+o.bottom,u=s.right+o.right,c=s.bottom+o.bottom,d=n.x,f=n.y,p=n.width,g=n.height,y=n.right,b=n.bottom,v=this.scale,w,k=t.scrollLeft;if(this.rd)switch(this.lb){case"negative":k=k+t.scrollWidth-t.clientWidth;break;case"reverse":k=t.scrollWidth-k-t.clientWidth;break}let S=k;if(p<h||g<l){w=P.z(this.position.x,this.position.y),this.allowHorizontalScroll&&this.Xb!==S&&(w.x=S/v+r,this.Xb=S),this.allowVerticalScroll&&this.zb!==t.scrollTop&&(w.y=t.scrollTop/v+a,this.zb=t.scrollTop),this.position=w,P.i(w),this.rp=!1,this._u=!1;return}if(w=P.l(),t.oO&&this.allowHorizontalScroll&&(r<d&&(this.position=w.e(S+r,this.position.y)),u>y)){let N=e.scrollWidth-this.wt;this.position=w.e(-N+S-this.wt/v+u,this.position.y)}if(t.rO&&this.allowVerticalScroll&&(a<f&&(this.position=w.e(this.position.x,t.scrollTop+a)),c>b)){let N=e.scrollHeight-this.xt;this.position=w.e(this.position.x,-N+t.scrollTop-this.xt/v+c)}P.i(w),this.ha(),this.rp=!1,this._u=!1,s=this.documentBounds,n=this.viewportBounds,u=s.right,y=n.right,c=s.bottom,b=n.bottom,r=s.x,d=n.x,a=s.y,f=n.y,p>=h&&r>=d&&u<=y&&(i.style.width="1px"),g>=l&&a>=f&&c<=b&&(i.style.height="1px")}computeBounds(t){return t===void 0&&(t=new I),this.Te(),this.cT(t)}cT(t){if(this.fixedBounds.isReal())return t.h(this.fixedBounds),t.addMargin(this.Qt),t;let e=!0,i=this.Vt.r,s=i.length;for(let n=0;n<s;n++){let o=i[n];if(!o.visible||!o.isInDocumentBounds)continue;let r=o.Ct.r,a=r.length;for(let h=0;h<a;h++){let l=r[h];if(!l.isInDocumentBounds||!l.isVisible())continue;let u=l.actualBounds;u.isReal()&&(e?(e=!1,t.h(u)):t.unionRect(u))}}return e&&t.e(0,0,0,0),t.addMargin(this.Qt),t}computePartsBounds(t,e){e===void 0&&(e=!1);let i;if(Array.isArray(t))for(let s=0;s<t.length;s++){let n=t[s];!e&&n instanceof j||(n.ensureBounds(),i===void 0?i=n.actualBounds.copy():i.unionRect(n.actualBounds))}else{let s=t.iterator;for(;s.next();){let n=s.value;!e&&n instanceof j||(n.ensureBounds(),i===void 0?i=n.actualBounds.copy():i.unionRect(n.actualBounds))}}return i===void 0?new I(NaN,NaN,0,0):i}Js(t){if(!t&&!this.so||this.Ht||this.lt===null||!this.documentBounds.isReal())return;if(this.Ht=!0,t){let c=this.initialPosition;if(c.isReal()){this.Ht=!1,this.position=c;return}let d=this.initialDocumentSpot,f=this.initialViewportSpot;d.isNoSpot()&&(d=T.TopLeft),f.isNoSpot()&&(f=T.TopLeft);let p=P.l();p.setRectSpot(this.documentBounds,d);let g=this.viewportBounds,y=I.z(0,0,g.width,g.height),b=P.l();b.setRectSpot(y,f),b.e(p.x-b.x,p.y-b.y),this.Ht=!1,this.position=b,I.i(y),P.i(b)}let e=this.ia;t&&this.Rr!==1&&(e=this.Rr);let i=e!==1?this.hd(e):this.scale,s=this.ct.x,n=this.ct.y,o=this.wt/i,r=this.xt/i,a=this.Wc,h=this.ip;if(t&&!a.isSpot()&&(h.isSpot()||h.isDefault())){let c=this.initialDocumentSpot.isSpot()&&this.initialViewportSpot.isSpot();a=h.isDefault()&&!c?T.Center:h}this.k2(this.documentBounds,o,r,a,t);let l=this.scale;this.scale=i,this.Ht=!1;let u=this.viewportBounds;u.equalsApproxTo(s,n,o,r)||this.onViewportBoundsChanged(new I(s,n,o,r),u,l,!1)}hd(t){let e=this.dp;if(this.lt===null)return e;if(t===1)return this.scale;this.ensureBounds();let i=this.documentBounds;if(!i.isReal())return e;let s=i.width,n=i.height,o=this.wt+(this.io?this.jt:0),r=this.xt+(this.kn?this.jt:0),a=o/s,h=r/n,l=this.fh,u=l.left+l.right!==0,c=l.top+l.bottom!==0;(u||c)&&(h===a?(h=(r-this.jt)/n,a=(o-this.jt)/s):h>a?h=(r-this.jt)/n:a=(o-this.jt)/s);let d=0;return t===2?d=Math.min(h,a):t===3&&(h>a?d=(r-this.jt)/n:d=(o-this.jt)/s),d>e&&(d=e),d<this.minScale&&(d=this.minScale),d>this.maxScale&&(d=this.maxScale),d}zoomToFit(){let t=this.ah;this.ah=1,this.scale=this.hd(2),this.alignDocument(T.Center,T.Center),t!==1&&(this.Js(!1),this.k2(this.documentBounds,this.wt/this.it,this.xt/this.it,this.Wc,!1)),this.ah=t}zoomToRect(t,e){e===void 0&&(e=2);let i=t.width,s=t.height;if(i===0||s===0||isNaN(i)&&isNaN(s))return;let n=1;if(e===2||e===3)if(isNaN(i))n=this.viewportBounds.height*this.scale/s;else if(isNaN(s))n=this.viewportBounds.width*this.scale/i;else{let o=this.wt,r=this.xt;e===3?r/s>o/i?n=(r-(this.kn?this.jt:0))/s:n=(o-(this.io?this.jt:0))/i:n=Math.min(r/s,o/i)}this.scale=n,this.position=new P(t.x,t.y)}get pO(){return this.Ht}set pO(t){this.Ht=t}alignDocument(t,e){this.ensureBounds();let i=this.documentBounds,s=this.viewportBounds;this.position=new P(i.x+(t.x*i.width+t.offsetX)-(e.x*s.width-e.offsetX),i.y+(t.y*i.height+t.offsetY)-(e.y*s.height-e.offsetY))}focusObject(t){if(t instanceof $){this.xp=t;let e=P.l();this.bp=this.transformDocToView(t.getDocumentPoint(T.TopLeft,e)),P.i(e)}else this.xp=null,this.bp=P.gn}k2(t,e,i,s,n){let o=P.z(this.ct.x,this.ct.y),r=o.x,a=o.y;if(this.xp!==null){let h=P.l();h=this.xp.getDocumentPoint(T.TopLeft,h),r=h.x-this.bp.x/this.scale,a=h.y-this.bp.y/this.scale,s=T.None,P.i(h)}if(n||this.scrollMode===1){s.isSpot()&&(e>t.width&&(r=t.x+(s.x*t.width+s.offsetX)-(s.x*e-s.offsetX)),i>t.height&&(a=t.y+(s.y*t.height+s.offsetY)-(s.y*i-s.offsetY)));let h=this.fh,l=e-t.width;if(e<t.width+h.left+h.right){let c=r+e/2;c=Math.min(c,t.right+Math.max(l,h.right)-e/2),c=Math.max(c,t.left-Math.max(l,h.left)+e/2),r=c-e/2}else r>t.left?r=t.left:r<t.right-e&&(r=t.right-e);let u=i-t.height;if(i<t.height+h.top+h.bottom){let c=a+i/2;c=Math.min(c,t.bottom+Math.max(u,h.bottom)-i/2),c=Math.max(c,t.top-Math.max(u,h.top)+i/2),a=c-i/2}else a>t.top?a=t.top:a<t.bottom-i&&(a=t.bottom-i)}if(o.x=isFinite(r)?r:-this.Qt.left,o.y=isFinite(a)?a:-this.Qt.top,this.positionComputation!==null){let h=this.positionComputation(this,o);o.x=h.x,o.y=h.y}this.Ns.UA(this.ct,o),this.ct.e(o.x,o.y),this.Np(),this.aa(),this.yO(),P.i(o)}findPartAt(t,e){if(e===void 0&&(e=!0),e){let i=this.kS(t,s=>s.part,s=>s.canSelect());if(i instanceof pt)return i}else{let i=this.kS(t,s=>s.part);if(i instanceof pt)return i}return null}findObjectAt(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null),this.Te();let s=this.Vt.iteratorBackwards;for(;s.next();){let n=s.value;if(!n.visible)continue;let o=n.findObjectAt(t,e,i);if(o!==null)return o}return null}kS(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null),this.Te();let s=this.Vt.iteratorBackwards;for(;s.next();){let n=s.value;if(!n.visible||n.isTemporary)continue;let o=n.findObjectAt(t,e,i);if(o!==null)return o}return null}findPartsAt(t,e,i){return e===void 0&&(e=!0),this.wO(t,s=>s.part,e?s=>s instanceof pt&&s.canSelect():null,i)}wO(t,e,i,s){e===void 0&&(e=null),i===void 0&&(i=null),!(s instanceof q)&&!(s instanceof V)&&(s=new V),this.Te();let n=this.Vt.iteratorBackwards;for(;n.next();){let o=n.value;!o.visible||o.isTemporary||o.findObjectsAt(t,e,i,s)}return s}findObjectsAt(t,e,i,s){e===void 0&&(e=null),i===void 0&&(i=null),!(s instanceof q)&&!(s instanceof V)&&(s=new V),this.Te();let n=this.Vt.iteratorBackwards;for(;n.next();){let o=n.value;o.visible&&o.findObjectsAt(t,e,i,s)}return s}findPartsIn(t,e,i,s){return e===void 0&&(e=!1),i===void 0&&(i=!0),this.xO(t,null,n=>n instanceof pt&&(!i||n.canSelect()),e,s)}findObjectsIn(t,e,i,s,n){e===void 0&&(e=null),i===void 0&&(i=null),s===void 0&&(s=!1),!(n instanceof q)&&!(n instanceof V)&&(n=new V),this.Te();let o=this.Vt.iteratorBackwards;for(;o.next();){let r=o.value;r.visible&&r.findObjectsIn(t,e,i,s,n)}return n}MS(t,e,i,s,n,o){let r=new V;this.Te();let a=this.Vt.iteratorBackwards;for(;a.next();){let h=a.value;h.visible&&h.MS(t,e,i,s,r,n,o)}return r}xO(t,e,i,s,n){e===void 0&&(e=null),i===void 0&&(i=null),s===void 0&&(s=!1),!(n instanceof q)&&!(n instanceof V)&&(n=new V),this.Te();let o=this.Vt.iteratorBackwards;for(;o.next();){let r=o.value;!r.visible||r.isTemporary||r.findObjectsIn(t,e,i,s,n)}return n}findPartsNear(t,e,i,s,n){return i===void 0&&(i=!0),s===void 0&&(s=!0),this.bO(t,e,null,o=>o instanceof pt&&(!s||o.canSelect()),i,n)}findObjectsNear(t,e,i,s,n,o){i===void 0&&(i=null),s===void 0&&(s=null),n===void 0&&(n=!0),n!==!1&&n!==!0&&((n instanceof q||n instanceof V)&&(o=n),n=!0),!(o instanceof q)&&!(o instanceof V)&&(o=new V),this.Te();let r=this.Vt.iteratorBackwards;for(;r.next();){let a=r.value;a.visible&&a.findObjectsNear(t,e,i,s,n,o)}return o}bO(t,e,i,s,n,o){i===void 0&&(i=null),s===void 0&&(s=null),n===void 0&&(n=!0),n!==!1&&n!==!0&&((n instanceof q||n instanceof V)&&(o=n),n=!0),!(o instanceof q)&&!(o instanceof V)&&(o=new V),this.Te();let r=this.Vt.iteratorBackwards;for(;r.next();){let a=r.value;!a.visible||a.isTemporary||a.findObjectsNear(t,e,i,s,n,o)}return o}acceptEvent(t){return this.of(t,t instanceof MouseEvent)}of(t,e){let i=this.Wr;this.Wr=this.gh,this.gh=i,i.diagram=this,i.event=t,e?this.Mp(t,i):(i.viewPoint=this.Wr.viewPoint,i.documentPoint=this.Wr.documentPoint);let s=0,n=t;return n.ctrlKey&&(s+=1),n.altKey&&(s+=2),n.shiftKey&&(s+=4),n.metaKey&&(s+=8),i.modifiers=s,i.button=n.button,n.buttons!==void 0&&(i.buttons=n.buttons),m.fr&&n.button===0&&n.ctrlKey&&(i.button=2),i.down=!1,i.up=!1,i.clickCount=1,i.delta=0,i.handled=!1,i.bubbles=!1,i.timestamp=t.timeStamp,i.isMultiTouch=!1,i.targetDiagram=this.s1(t,t.target),i.targetObject=null,i}s1(t,e){if(e===null)return null;let i=Y.ji.get(e);if(i)return i;let s=t.path;if(!s&&m.st(t.composedPath)&&(s=t.composedPath()),s&&s[0]){let n=Y.ji.get(s[0]);if(n)return n}return null}lO(t,e,i){let s=this.b2(t,!0,!1,!1,!0,i);return this.Mp(e,s),s.targetDiagram=this.s1(t,t.target),s.targetObject=null,i||s.clone(this.fp),s}aO(t,e,i){let s=this.b2(t,!1,!1,!1,!1,i),n=X.document.elementFromPoint(e.clientX,e.clientY)||null;n!==null&&n.shadowRoot&&(n=n.shadowRoot.elementFromPoint(e.clientX,e.clientY)||null);let o=this,r=t;if(n){let a=this.s1(t,n);a&&(r=e,o=a)}return s.targetDiagram=o,this.Mp(r,s),s.targetObject=null,s}b2(t,e,i,s,n,o){let r=this.Wr;this.Wr=this.gh,this.gh=r,r.diagram=this,r.clickCount=1,r.delta=0;let a=0;return t.ctrlKey&&(a+=1),t.altKey&&(a+=2),t.shiftKey&&(a+=4),t.metaKey&&(a+=8),r.modifiers=a,r.event=t,r.timestamp=t.timeStamp,r.button=i?this.firstInput.button:t.button,r.buttons=t.buttons,m.fr&&t.button===0&&t.ctrlKey&&(r.button=2),r.down=e,r.up=i,r.handled=s,r.bubbles=n,r.isMultiTouch=o,r}Sh(t,e){return t.bubbles?!0:(e.stopPropagation!==void 0&&e.stopPropagation(),e.cancelable!==!1&&e.preventDefault(),e.cancelBubble=!0,!1)}uO(t){let e=Y.ji.get(this);if(!e||!e.isEnabled)return!1;let i=e.of(t,!1);return i.key=t.key,i.code=t.code,i.down=!0,e.doKeyDown(),e.Sh(i,t)}dO(t){let e=Y.ji.get(this);if(!e||!e.isEnabled)return!1;let i=e.of(t,!1);return i.key=t.key,i.code=t.code,i.up=!0,e.doKeyUp(),e.Sh(i,t)}cO(t){let e=Y.ji.get(this);if(!e||!e.isEnabled)return!1;let i=e.of(t,!0);return e.mouseEnter!==null&&e.mouseEnter(i),e.currentTool.standardMouseOver(),e.Sh(i,t)}fO(t){let e=Y.ji.get(this);if(!e||!e.isEnabled)return!1;let i=e.of(t,!0);return e.mouseLeave!==null&&e.mouseLeave(i),e.Sh(i,t)}getMouse(t){let e=this.lt;if(e===null)return new P(0,0);let i=e.getBoundingClientRect(),s=(t.clientX-i.left)*(this.wt/i.width),n=(t.clientY-i.top)*(this.xt/i.height);return new P(s,n).Yi(this.v)}Mp(t,e){let i=this.lt,s=0,n=0;if(i!==null){let r=i.getBoundingClientRect();s=(t.clientX-r.left)*(this.wt/r.width),n=(t.clientY-r.top)*(this.xt/r.height)}e.viewPoint.e(s,n);let o=P.z(s,n);this.v.Ci(o),e.documentPoint.h(o),P.i(o)}eA(t,e,i){let s;if(this.yh[0]!==null)s=this.yh[e];else return;let n=this.lt;if(n!==null){let o=n.getBoundingClientRect();i.e((s.clientX-o.left)*(this.wt/o.width),(s.clientY-o.top)*(this.xt/o.height))}}invalidateDocumentBounds(){this.mh||(this.mh=!0,this.requestUpdate(!1))}kO(){this.As||this.Te(),this.ensureBounds()}redraw(){this.Ht||this.As||(this.C(),this.maybeUpdate())}isUpdateRequested(){return this.Tr}delayInitialization(t){t===void 0&&(t=null);let e=this.animationManager,i=e.isEnabled;e.stopAnimation(),e.isEnabled=!1,this.Pr(),this.so=!1,this.qx=new P(NaN,NaN),e.isEnabled=i,this.As=!0;let s=this;t!==null&&m.un(()=>{s.As=!1,e.Gl("Model"),t(s)},1)}requestUpdate(t){if(t===void 0&&(t=!1),this.Tr===!0||this.Ht||t===!1&&this.As)return;this.Tr=!0;let e=this;X.requestAnimationFrame(()=>{e.Tr&&e.maybeUpdate()})}maybeUpdate(){this.$u&&!this.Tr||(this.$u&&(this.$u=!1),this.Pr())}P2(t,e){!this._u||this.Ht||this.animationManager.defaultAnimation.isAnimating||this.hT()||(t&&this.Te(),e&&this.Js(!1))}Pr(t){if(this.As||(this.Tr=!1,this.Nt===null&&!this.td.isReal()))return;this.As=!0;let e=this.animationManager,i=this.od;if(!e.isAnimating&&i.length!==0){let u=i.r,c=u.length;for(let d=0;d<c;d++){let f=u[d];f.xi(!1),f.f()}i.clear()}let s=this.l2;s.count>0&&(s.each(u=>u.S2()),s.clear());let n=!1,o=!1;e.defaultAnimation.isAnimating&&(o=!0,n=this.skipsUndoManager,this.skipsUndoManager=!0),e.ke||this.NM(),t||this.P2(!1,!0);let r=!this.undoManager.isUndoingRedoing&&(this.Fl||this.nf.count!==0&&this.Or.size!==0),a=!this.so||this.Jr;this.Te(!0);let h=!1;(a||r)&&(this.so?this.M2(!this.$c,r):(this.startTransaction("Initial Layout"),e.isEnabled===!1&&e.stopAnimation(),this.M2(!1,r)),h=a),this.$c=!1,this.Fl=!1,this.Te(),this.ls!==null&&(this.ls.visible&&!this.ed&&(this.ca(),this.ed=!0),!this.ls.visible&&this.ed&&(this.ed=!1)),this.Lb||this.kO(),t||this.P2(!0,!1);let l=!1;if(h){let u=I.l();u.h(this.viewportBounds),this.so||(this.so=!0,l=!0,this.skipsUndoManager||(this.undoManager.Px=!0),this.undoManager.Sx=!0,this.PO()),this.SO(),this.Te(!1),t||this.P2(!0,!0),I.i(u)}else if(e.Bc&&e.Hx){if(this.Rr!==1)this.scale=this.hd(this.Rr);else if(this.ia!==1)this.scale=this.hd(this.ia);else{let u=this.initialScale;isFinite(u)&&u>0&&(this.scale=u)}this.Js(!0)}h&&l&&this.commitTransaction("Initial Layout"),t||this.Ge(this.Wt),o&&(this.skipsUndoManager=n),this.As=!1}get Qa(){return this.so}PO(){if(this.Rr!==1)this.scale=this.hd(this.Rr);else if(this.ia!==1)this.scale=this.hd(this.ia);else{let e=this.initialScale;isFinite(e)&&e>0&&(this.scale=e)}this.Js(!0);let t=this.Vt.r;this.rs(t,t.length,this,this.viewportBounds),this.T("InitialLayoutCompleted"),this.qx.h(this.ct),this.ca()}SO(){this.T("LayoutCompleted")}Cp(t){this.to.add(t)}addInvalidRoute(t){this.Uo?this.uh.add(t):this.Or.add(t)}Te(t){if(this.to.size!==0&&!(!this.As&&this.animationManager.isTicking)){if(this.As||(this.Fl=!0),t){this.fT(this.to);return}for(let e=0;e<23&&this.to.size!==0;e++){let i=new Set(this.to);this.to.clear(),this.S2(i,this.to)}this.nodes.each(e=>{e instanceof ht&&e.uT(!1)})}}fT(t,e){for(let i of t)!i.Di()||i instanceof ht||(i.Qr()?(i.ht(1/0,1/0),i.Ut()):e&&e.add(i));for(let i of t)if(i instanceof ht){if(!i.isVisible())continue;this.o1(i)}}S2(t,e){this.fT(t,e);for(let i of t){if(!(i instanceof j))continue;let s=i;s.isVisible()&&(s.Qr()?(s.ht(1/0,1/0),s.Ut()):e.add(s))}for(let i of t)i instanceof vt&&i.isVisible()&&(i.Qr()?(i.ht(1/0,1/0),i.Ut()):e.add(i))}cd(t){let e=t instanceof Y,i=e?t.links:t.memberParts,s=this.to;if(e)this.Te(!0);else{for(;i.next();){let n=i.value;s.has(n)&&(!n.Di()||n instanceof ht||n.Qr()&&(n.ht(1/0,1/0),n.Ut()))}for(i.reset();i.next();){let n=i.value;if(s.has(n)&&n instanceof ht){if(!n.isVisible())continue;this.o1(n)}}i.reset()}for(;i.next();){let n=i.value;n instanceof j&&s.has(n)&&n.isVisible()&&n.Qr()&&(n.ht(1/0,1/0),n.Ut())}}o1(t){let e=m.nt(),i=m.nt(),s=t.memberParts;for(;s.next();){let o=s.value;o.isVisible()&&(o instanceof ht?(o.Xo()||o.as()||o.fa())&&this.o1(o):o instanceof j?o.fromNode===t||o.toNode===t?i.push(o):e.push(o):(o.ht(1/0,1/0),o.Ut()))}let n=e.length;for(let o=0;o<n;o++){let r=e[o];r.ht(1/0,1/0),r.Ut()}m.Z(e),t.ht(1/0,1/0),t.Ut(),n=i.length;for(let o=0;o<n;o++){let r=i[o];r.ht(1/0,1/0),r.Ut()}m.Z(i)}rs(t,e,i,s){if(!(!this._c&&!this.animationManager.isAnimating)){for(let n=0;n<e;n++)t[n].rs(i,s);this.Te()}}Ge(t){this.Nt!==null&&(this.lt===null&&m.o("No canvas specified"),this.Qc==="svg"?this.MO(t):this.NO(t))}NO(t){let e=this.animationManager;if(e.ke||e.isAnimating&&!e.isTicking)return;let i=new Date;if(this.Lp(),this.Nt&&this.Nt.style.opacity==="0")return;let s=t!==this.Wt,n=this.Vt.r,o=n.length,r=this;if(this.rs(n,o,r,r.viewportBounds),s)t.clearContextCache(!0),this.ha();else if(!this.qi&&!e.isAnimating)return;let a=this.v,h=this.$e;t.setTransform(h,0,0,h,0,0),t.clearRect(0,0,this.wt,this.xt),this.Zt!==1&&(t.globalAlpha=this.Zt),this.N2(t);for(let f=0;f<o;f++)t.setTransform(h,0,0,h,0,0),t.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),t.commitTransform(),n[f].Ge(t,r);let l=!1;this.sf?this.sf.Mh(this,t)&&(l=this.gp()):l=!0,l&&(Nt.prototype.Ci=Nt.prototype.Su),s?(this.Wt.clearContextCache(!0),this.ha()):(this._c=!1,this.qi=!1);let u=+new Date-+i,c=!1,d=this.u2;if(c||this.Ol===null){d[this.wp]=u,this.wp=(this.wp+1)%d.length;let f=0;for(let p=0;p<d.length;p++)f+=d[p];this.yp=f/d.length}if(this.Zt!==1&&(t.globalAlpha=1),c){t.setTransform(1,0,0,1,0,0);for(let f=0;f<d.length;f++)t.fillText(d[f].toString(),20,150+ +(f*20))}}MO(t){if(this.Nt===null)return;let e=this.animationManager;if(e.ke||e.isAnimating&&!e.isTicking)return;this.Lp();let i=this.wt,s=this.xt;t.surface.resize(i,s,i,s);let n=this.Vt.r,o=n.length,r=this;if(this.rs(n,o,r,r.viewportBounds),!this.qi&&!e.isAnimating)return;let a=this.v;t.lastDrawnPart=null,t.setDiagramPosScale(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),this.Zt!==1&&(t.globalAlpha=this.Zt),this.N2(t);let h=this.$e,l=this.lt._t;l.setTransform(h,0,0,h,0,0),l.clearRect(0,0,this.wt,this.xt);for(let c=0;c<o;c++)n[c].Ge(t,r);let u=!1;this.sf?this.sf.Mh(this,l)&&(u=this.gp()):u=!0,u&&(Nt.prototype.Ci=Nt.prototype.Su),this._c=!1,this.qi=!1}l1(t,e,i,s,n,o,r,a,h){o===void 0&&(o=null),r===void 0&&(r=null),a===void 0&&(a=!1),h===void 0&&(h=!1),this.Lp(),t.clearContextCache(!0),this.ha(),this.ph=!0;let l=this.it;this.it=s;let u=this,c=this.Vt.r,d=c.length;try{let f=new I(n.x,n.y,i.width/s,i.height/s),p=f.copy();p.addMargin(e),this.ca(p),this.Te(),this.rs(c,d,u,f),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,i.width,i.height),r!==null&&r!==""&&(t.fillStyle=r,t.fillBackground(0,0,i.width,i.height));let g=Nt.l();g.Ue(),g.Xs(e.left,e.top),g.it(s),(n.x!==0||n.y!==0)&&g.Xs(-n.x,-n.y),t.setTransform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy),t.commitTransform(),t instanceof re&&t.setDiagramPosScale(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy),Nt.i(g),this.N2(t),t.globalAlpha=this.Zt;let y=this.findLayer("Grid");if(o){let b=new V,v=o.iterator;for(v.reset();v.next();){let w=v.value;w instanceof pt&&(!h&&w.layer===y||(w.jc(),b.add(w)))}for(let w=0;w<d;w++)c[w].ER(t,u,b,a);b.each(w=>w.jc())}else for(let b=0;b<d;b++){let v=c[b];v===y?h&&v.Ge(t,u,!0):v.Ge(t,u,a)}this.ph=!1,this.sf&&this.Wt&&this.sf.Mh(this,this.Wt)&&this.gp()}finally{this.it=l,t.clearContextCache(!0),this.ha(),this.rs(c,d,u,u.viewportBounds),this.ca(),this.Wt instanceof re&&(this.Wt.diagramGroup.replaceChildren(),this.redraw())}}getRenderingHint(t){return this.Fr[t]}setRenderingHint(t,e){t==="minDrawingLength"&&(this._m=e),this.Fr[t]=e,this.redraw()}resetRenderingHints(){this.Fr=new yt,this.Fr.drawShadows=!0,this.Fr.textGreeking=!0,this.Fr.viewportOptimizations=!m.fr,this.Fr.temporaryPixelRatio=!0,this.Fr.pictureRatioOptimization=!0,this.Fr.minDrawingLength=1,this._m=1}N2(t){let e=this.Fr;if(e===null)return;if(e.imageSmoothingEnabled!==void 0){let s=!!e.imageSmoothingEnabled;t.setImageSmoothingEnabled(s)}let i=e.defaultFont;i!=null&&(t.font=i)}getInputOption(t){return this.Wu[t]}setInputOption(t,e){this.Wu[t]=e}QR(){this.Wu=new yt,this.Wu.extraTouchArea=10,this.Wu.extraTouchThreshold=10,this.Wu.hasGestureZoom=!0}set(t){return t?(Object.assign(this,t),this):this}attach(t){return this.setProperties(t)}setProperties(t){return Y.Ap(this,t),this}static Ap(t,e){if(!e)return;let i=t instanceof G,s=t instanceof Y;for(let n in e){n===""&&m.o("Setting properties requires non-empty property names");let o=t,r=n;if(i||s){let h=n.indexOf(".");if(h>0){let l=n.substring(0,h);i?o=t.findObject(l):(o=t[l],o==null&&(o=t.toolManager[l])),m.$(o)?r=n.substring(h+1):m.o("Unable to find object named: "+l+" in "+t.toString()+" when trying to set property: "+n)}}if(r[0]!=="_"&&!m.qw(o,r))if(s&&r==="ModelChanged"){t.addModelChangedListener(e[r]);continue}else if(s&&r==="Changed"){t.addChangedListener(e[r]);continue}else if(s&&m.qw(t.toolManager,r))o=t.toolManager;else if(s&&t.dT(r)){t.addDiagramListener(r,e[r]);continue}else if(t instanceof ut&&r==="Changed"){t.addChangedListener(e[r]);continue}else m.o('Trying to set undefined property "'+r+'" on object: '+o.toString());let a=e[n];o[r]=a,r[0]==="_"&&o instanceof $&&o.addCopyProperty(r)}}zA(){if(this.ra.count!==0&&!(this.undoManager.transactionLevel>1)){for(;this.ra.count>0;){let t=this.ra;this.ra=new Mt;let e=t.iterator;for(;e.next();){let i=e.key;i.invalidateOtherJumpOvers(e.value),i.ai()}}this.C()}}C(t){if(t===void 0)this.qi=!0,this.requestUpdate();else{let e=this.viewportBounds;t.isReal()&&e.intersectsRect(t)&&(this.qi=!0,this.requestUpdate())}this.T("InvalidateDraw")}invalidateViewport(t,e){if(this.qi!==!0){if(this.qi=!0,this.Qc==="svg"){this.maybeUpdate();return}this.getRenderingHint("temporaryPixelRatio")===!0?(this.Cx(),this.maybeUpdate(),this.yS(!0)):this.maybeUpdate()}}Nh(){this._u=!0}ha(){this._c=!0}Lp(){this.Ju!==!1&&(this.Ju=!1,this.lT(this.wt,this.xt))}lT(t,e){this.aa();let i=this.$e,s=t*i,n=e*i;this.lt.resize(s,n,t,e)&&(this.qi=!0,this.Wt.clearContextCache(!0))}hT(){let t=this.lt;if(t===null||this.td.isReal())return!0;let e=this.wt,i=this.xt,s=this.Nt,n=!1,o=this.io?this.jt:0,r=this.kn?this.jt:0,a=s.clientWidth||e+o,h=s.clientHeight||i+r,l=this.viewportBounds,u=l.x,c=l.y,d=l.width,f=l.height;if((a!==e+o||h!==i+r)&&(this.io=!1,this.kn=!1,o=0,r=0,this.wt=a,this.xt=h,this.Ju=!0,n=!0,this.aa()),!this.so||!this.viewportBounds.isReal())return!0;let p=this.Wb,g=this.Jb;if(this._u=!1,!n&&!this.io&&!this.kn&&!this.Zu&&!this.Qu)return!0;let y=this.documentBounds,b=0,v=0,w=0,k=0,S=l.width,N=l.height,D=this.fh;this.contentAlignment.isSpot()?(y.width>S&&(b=D.left,v=D.right),y.height>N&&(w=D.top,k=D.bottom)):(b=D.left,v=D.right,w=D.top,k=D.bottom);let L=y.width+b+v,M=y.height+w+k,A=this.scale,F=A,O=L>a/A,E=M>h/A;if(!n&&!this.io&&!this.kn&&!O&&!E)return!0;let B=y.x-b,K=l.x,z=y.right+v,U=l.right+o,tt=y.y-w,nt=l.y,Z=y.bottom+k,it=l.bottom+r,_="1px",at="1px";if(this.scrollMode===1&&(O||E)){if(O&&this.hasHorizontalScrollbar&&this.allowHorizontalScroll){let Q=1;B+1<K&&(Q=Math.max((K-B)*A+this.wt,Q)),z>U+1&&(Q=Math.max((z-U)*A+this.wt,Q)),S+o+1<L&&(Q=Math.max((L-S)*A+this.wt,Q)),_=Q.toString()+"px"}if(E&&this.hasVerticalScrollbar&&this.allowVerticalScroll){let Q=1;tt+1<nt&&(Q=Math.max((nt-tt)*A+this.xt,Q)),Z>it+1&&(Q=Math.max((Z-it)*A+this.xt,Q)),N+r+1<M&&(Q=Math.max((M-N)*A+this.xt,Q)),at=Q.toString()+"px"}}let ct=_!=="1px",xt=at!=="1px";if(!(ct&&xt)&&(ct||xt)){if(O=!(L<S+o),E=!(M<N+r),xt&&(U-=this.jt),ct&&(it-=this.jt),O&&this.hasHorizontalScrollbar&&this.allowHorizontalScroll){let Pt=1;B+1<K&&(Pt=Math.max((K-B)*A+this.wt,Pt)),z>U+1&&(Pt=Math.max((z-U)*A+this.wt,Pt)),S+1<L&&(Pt=Math.max((L-S)*A+this.wt,Pt)),_=Pt.toString()+"px"}ct=_!=="1px";let Q=this.xt;if(ct!==this.kn&&(Q=ct?this.xt-this.jt:this.xt+this.jt),E&&this.hasVerticalScrollbar&&this.allowVerticalScroll){let Pt=1;tt+1<nt&&(Pt=Math.max((nt-tt)*A+Q,Pt)),Z>it+1&&(Pt=Math.max((Z-it)*A+Q,Pt)),N+1<M&&(Pt=Math.max((M-N)*A+Q,Pt)),at=Pt.toString()+"px"}xt=at!=="1px"}if(this.rp&&!(ct!==this.kn||xt!==this.io))return(e!==this.wt||i!==this.xt)&&this.maybeUpdate(),!1;if(ct!==this.kn&&(_==="1px"?this.xt=this.xt+this.jt:this.xt=Math.max(this.xt-this.jt,1),n=!0),this.kn=ct,g.style.width=_,xt!==this.io&&(at==="1px"?this.wt=this.wt+this.jt:this.wt=Math.max(this.wt-this.jt,1),n=!0,this.rd)){let Q=P.l();xt?(t.style.left=this.jt+"px",this.position=Q.e(this.ct.x+this.jt/this.scale,this.ct.y)):(t.style.left="0px",this.position=Q.e(this.ct.x-this.jt/this.scale,this.ct.y)),P.i(Q)}n&&this.aa(),this.io=xt,g.style.height=at,this.Bb=!0,n&&(this.Ju=!0);let Ct=p.scrollLeft;if(this.hasHorizontalScrollbar&&this.allowHorizontalScroll&&(S+1<L?Ct=(this.position.x-B)*A:B+1<K?Ct=p.scrollWidth-p.clientWidth:z>U+1&&(Ct=this.position.x*A)),this.rd)switch(this.lb){case"negative":Ct=-(p.scrollWidth-Ct-p.clientWidth);break;case"reverse":Ct=p.scrollWidth-Ct-p.clientWidth;break}if(p.scrollLeft=Ct,this.hasVerticalScrollbar&&this.allowVerticalScroll&&(N+1<M?p.scrollTop=(this.position.y-tt)*A:tt+1<nt?p.scrollTop=p.scrollHeight-p.clientHeight:Z>it+1&&(p.scrollTop=this.position.y*A)),a=this.wt,h=this.xt,p.style.width=a+(this.io?this.jt:0)+"px",p.style.height=h+(this.kn?this.jt:0)+"px",e!==a||i!==h||this.animationManager.ke){let Q=I.z(u,c,d,f);return this.onViewportBoundsChanged(Q,this.viewportBounds,F,n),I.i(Q),!1}return!0}add(t){let e=t.diagram;if(e===this)return;e!==null&&m.o("Cannot add part "+t.toString()+" to "+this.toString()+". It is already a part of "+e.toString());let i=this.findLayer(t.layerName);if(i===null&&(i=this.findLayer("")),i===null&&m.o('Cannot add a Part when unable find a Layer named "'+t.layerName+'" and there is no default Layer'),t.layer===i)return;let s=i.ch(99999999,t,t.diagram===this);s>=0&&this.raiseChangedEvent(3,"parts",i,null,t,null,s),i.isTemporary||this.invalidateDocumentBounds(),t.invalidateLayout(1);let n=t.layerChanged;n!==null&&n(t,null,i)}ch(t){this.partManager.ch(t);let e=this;Y.isUsingDOM()&&t.Pn(i=>e.gT(i)),t.data||t.Go(),t.hasPlaceholder()&&t.f(),t.data!==null&&t.Pn(i=>e.partManager.C2(i,null)),(t.as()===!0||t.fa()===!0)&&this.Cp(t),t.mT(!0,this),t instanceof J&&t.canAvoid()&&this.fd(t),t.pT()?(t.actualBounds.isReal()&&this.C(t.hh(t.actualBounds)),this.invalidateDocumentBounds()):t.isVisible()&&t.actualBounds.isReal()&&this.C(t.hh(t.actualBounds)),this.kp!==null&&this.kp(this,t),this.requestUpdate()}ri(t){t.clearAdornments(),this.partManager.ri(t);let e=this;t.data!==null&&t.Pn(i=>e.partManager.L2(i,e)),this.to.delete(t),t instanceof j?this.Or.delete(t):t instanceof J&&t.canAvoid()&&this.fd(t),t.pT()?(t.actualBounds.isReal()&&this.C(t.hh(t.actualBounds)),this.invalidateDocumentBounds()):t.isVisible()&&t.actualBounds.isReal()&&this.C(t.hh(t.actualBounds)),this.Pp!==null&&this.Pp(this,t),this.requestUpdate()}remove(t){this.A2(t,!0)}A2(t,e){let i=t.layer;if(i===null||i.diagram!==this)return;t.isSelected=!1,t.isHighlighted=!1,t.invalidateLayout(2),e&&t.rf();let s=i.ri(-1,t,!1);s>=0&&this.raiseChangedEvent(4,"parts",i,t,null,s,null);let n=t.layerChanged;n!==null&&n(t,i,null)}removeParts(t,e){if(e===void 0&&(e=!1),Array.isArray(t)){let i=t.length;for(let s=0;s<i;s++){let n=t[s];e&&!n.canDelete()||this.remove(n)}}else{let i=new V;i.addAll(t);let s=i.iterator;for(;s.next();){let n=s.value;e&&!n.canDelete()||this.remove(n)}}}copyParts(t,e,i){i===void 0&&(i=!1);let s=null,n=e||this,o=n.model,r=!1,a=!1;try{o.Vm()&&(r=o.copiesParentKeyOfNodeData,o.copiesParentKeyOfNodeData=n.commandHandler.copiesParentKey),(o.Um()||o.a1())&&(a=o.copiesGroupKeyOfNodeData,o.copiesGroupKeyOfNodeData=n.commandHandler.copiesGroupKey),s=this.partManager.copyParts(t,e,i)}finally{o.Vm()&&(o.copiesParentKeyOfNodeData=r),(o.Um()||o.a1())&&(o.copiesGroupKeyOfNodeData=a)}return s}moveParts(t,e,i,s){if(i===void 0&&(i=!1),s===void 0&&(s=this.Tp()),this.toolManager===null)return;let n=new Mt;if(t!==null)if(Array.isArray(t))for(let o=0;o<t.length;o++)this._r(n,t[o],i,s);else{let o=t.iterator;for(;o.next();)this._r(n,o.value,i,s)}else{let o=this.parts;for(;o.next();){let r=o.value;this._r(n,r,i,s)}for(o=this.nodes;o.next();){let r=o.value;this._r(n,r,i,s)}for(o=this.links;o.next();){let r=o.value;this._r(n,r,i,s)}}this.Lx(n,e,s,i)}_r(t,e,i,s,n){if(!t.has(e)&&(n===void 0&&(n=!1),!(i&&!n&&!e.canMove()&&!e.canCopy())))if(s===void 0&&(s=this.Tp()),e instanceof J){if(t.set(e,this.js(s,e,e.location)),e instanceof ht&&(e.hasPlaceholder()||s.dragsMembers)){let r=e.memberParts;for(;r.next();){let a=r.value;this._r(t,a,i,s,s.groupsAlwaysMove)}}let o=e.linksConnected;for(;o.next();){let r=o.value;if(t.has(r))continue;let a=r.fromNode,h=r.toNode;a!==null&&t.has(a)&&h!==null&&t.has(h)&&this._r(t,r,i,s)}if(s.dragsTree){let r=e.findTreeChildrenNodes();for(;r.next();){let a=r.value;this._r(t,a,i,s)}}}else if(e instanceof j){t.set(e,this.js(s,e));let o=e.labelNodes;for(;o.next();){let r=o.value;this._r(t,r,i,s)}}else e instanceof vt||t.set(e,this.js(s,e,e.location))}Lx(t,e,i,s){if(t===null||t.count===0)return;let n=P.l(),o=P.l();o.h(e),isNaN(o.x)&&(o.x=0),isNaN(o.y)&&(o.y=0);let r=this.Qb;r||this.gA(t);let a=m.nt(),h=m.nt(),l=t.iterator,u=P.l();for(;l.next();){let g=l.key,y=l.value;if(g.Di()){let b=this.yT(g,t);if(b!==null)a.push(new On(g,y,b));else if(!s||g.canMove()){let v=y.point;n.h(v),this.computeMove(g,n.add(o),i,u),g.location=u,y.shifted===void 0&&(y.shifted=new P),y.shifted.h(u.subtract(v))}}else l.key instanceof j&&h.push(new pe(l.key,l.value))}P.i(u);let c=a.length;for(let g=0;g<c;g++){let y=a[g],b=y.wT.point;n.h(b),y.h1.shifted===void 0&&(y.h1.shifted=new P),y.Ri.location=n.add(y.h1.shifted)}let d=P.l(),f=P.l(),p=h.length;for(let g=0;g<p;g++){let y=h[g],b=y.key;if(b instanceof j){if(b.suspendsRouting){b.Dr=null;let v=b.fromNode,w=b.toNode;if(this.draggedLink!==null&&i.dragsLink){let k=y.value.point;if(b.dragComputation===null){t.set(b,this.js(i,b,o));let S=o.x-k.x,N=o.y-k.y;b.kr(S,N)}else{let S=P.z(0,0),N=b.getPoint(0);N&&N.isReal()&&S.h(N),u=P.l().h(S).add(o);let D=u;i.isGridSnapEnabled&&(i.isGridSnapRealtime||this.lastInput.up)&&(D=P.l(),this.aM(b,u,D,i)),u.h(b.dragComputation(b,u,D)).subtract(S),t.set(b,this.js(i,b,u));let L=u.x-k.x,M=u.y-k.y;b.kr(L,M),P.i(S),P.i(u),D!==u&&P.i(D)}}else{if(v!==null){d.h(v.location);let k=t.get(v);k!==null&&d.subtract(k.point)}if(w!==null){f.h(w.location);let k=t.get(w);k!==null&&f.subtract(k.point)}if(v!==null&&w!==null){let k=y.value.point;if(d.equalsApprox(f)||b.computeAdjusting()!==0){let S=n;S.h(d),S.subtract(k),t.set(b,this.js(i,b,d)),b.kr(S.x,S.y)}else b.suspendsRouting=!1,b.$t()}else{let k=y.value.point,S;v!==null?S=d:w!==null?S=f:S=o,t.set(b,this.js(i,b,S));let N=S.x-k.x,D=S.y-k.y;b.kr(N,D)}}}else if(b.fromNode===null||b.toNode===null){let v=y.value.point;t.set(b,this.js(i,b,o));let w=o.x-v.x,k=o.y-v.y;b.kr(w,k)}}}P.i(n),P.i(o),P.i(d),P.i(f),m.Z(a),m.Z(h),r||(this.Te(),this.pS(t))}computeMove(t,e,i,s){if(s===void 0&&(s=new P),s.h(e),t===null)return s;let n=e,o=i.isGridSnapEnabled;o&&(i.isGridSnapRealtime||this.lastInput.up)&&(n=P.l(),this.aM(t,e,n,i));let r=t.dragComputation!==null?t.dragComputation(t,e,n):n,a=t.minLocation,h=a.x;isNaN(h)&&(h=o?Math.round(t.location.x*1e3)/1e3:t.location.x);let l=a.y;isNaN(l)&&(l=o?Math.round(t.location.y*1e3)/1e3:t.location.y);let u=t.maxLocation,c=u.x;isNaN(c)&&(c=o?Math.round(t.location.x*1e3)/1e3:t.location.x);let d=u.y;return isNaN(d)&&(d=o?Math.round(t.location.y*1e3)/1e3:t.location.y),s.e(Math.max(h,Math.min(r.x,c)),Math.max(l,Math.min(r.y,d))),n!==e&&P.i(n),s}Tp(){let t=this.toolManager.findTool("Dragging");return t instanceof Tt?t.dragOptions:this.ld}aM(t,e,i,s){if(s===void 0&&(s=this.Tp()),i.h(e),t===null)return i;let n=this.grid,o=s.gridSnapCellSize,r=o.width,a=o.height,h=s.gridSnapOrigin,l=h.x,u=h.y,c=s.gridSnapCellSpot;if(n!==null){let f=n.gridCellSize;isNaN(r)&&(r=f.width),isNaN(a)&&(a=f.height);let p=n.gridOrigin;isNaN(l)&&(l=p.x),isNaN(u)&&(u=p.y)}let d=P.z(0,0);return d.setSpot(0,0,r,a,c),C.tm(e.x,e.y,l+d.x,u+d.y,r,a,i),P.i(d),i}gA(t){if(t===null)return;this.Qb=!0;let e=t.iterator;for(;e.next();){let i=e.key;i instanceof j&&(i.suspendsRouting=!0)}}pS(t){if(t===null)return;let e=t.iterator;for(;e.next();){let i=e.key;i instanceof j&&(i.suspendsRouting=!1,i.xT()&&i.$t())}this.Qb=!1}get draggedLink(){return this._b}set draggedLink(t){this._b!==t&&(this._b=t,t!==null&&(this.t1=t.fromPort,this.e1=t.toPort))}get PS(){return this.t1}set PS(t){this.t1=t}get SS(){return this.e1}set SS(t){this.e1=t}yT(t,e){let i=t.containingGroup;if(i!==null){let s=this.yT(i,e);if(s!==null||(s=e.get(i),s!==null))return s}return null}js(t,e,i){if(i===void 0)return new Ye(P.dn);let s=t.isGridSnapEnabled;return!t.groupsSnapMembers&&e.containingGroup!==null&&(s=!1),s?new Ye(new P(Math.round(i.x*1e3)/1e3,Math.round(i.y*1e3)/1e3)):new Ye(i.copy())}T2(t,e){if(t.diagram!==null&&t.diagram!==this&&m.o("Cannot share a Layer with another Diagram: "+t+" of "+t.diagram),e===null?t.diagram!==null&&m.o("Cannot add an existing Layer to this Diagram again: "+t):(e.diagram!==this&&m.o("Existing Layer must be in this Diagram: "+e+" not in "+e.diagram),t===e&&m.o("Cannot move a Layer before or after itself: "+t)),t.diagram===this)return;let i=t.name,s=this.Vt,n=s.count;for(let o=0;o<n;o++)s.elt(o).name===i&&m.o("Cannot add Layer with the name '"+i+"'; a Layer with the same name is already present in this Diagram.")}addLayer(t){this.T2(t,null),t.Io(this);let e=this.Vt,i=e.count-1;if(!t.isTemporary)for(;i>=0&&e.elt(i).isTemporary;)i--;return e.insertAt(i+1,t),this.Ce!==null&&this.raiseChangedEvent(3,"layers",this,null,t,null,i+1),this.C(),this.invalidateDocumentBounds(),this}addLayerBefore(t,e){this.T2(t,e),t.Io(this);let i=this.Vt,s=i.indexOf(t);s>=0&&(i.delete(t),this.Ce!==null&&this.raiseChangedEvent(4,"layers",this,t,null,s,null));let n=i.count,o;for(o=0;o<n;o++)if(i.elt(o)===e){i.insertAt(o,t);break}return this.Ce!==null&&this.raiseChangedEvent(3,"layers",this,null,t,null,o),this.C(),s<0&&this.invalidateDocumentBounds(),this}addLayerAfter(t,e){this.T2(t,e),t.Io(this);let i=this.Vt,s=i.indexOf(t);s>=0&&(i.delete(t),this.Ce!==null&&this.raiseChangedEvent(4,"layers",this,t,null,s,null));let n=i.count,o;for(o=0;o<n;o++)if(i.elt(o)===e){i.insertAt(o+1,t);break}return this.Ce!==null&&this.raiseChangedEvent(3,"layers",this,null,t,null,o+1),this.C(),s<0&&this.invalidateDocumentBounds(),this}Zr(t,e){t.Io(this),this.Vt.insertAt(e,t)}bT(t){this.Vt.removeAt(t)}removeLayer(t){if(t.diagram!==this&&m.o("Cannot remove a Layer from another Diagram: "+t+" of "+t.diagram),t.name==="")return;let e=this.Vt,i=e.indexOf(t);if(e.delete(t)){let s=t.Ct.copy().iterator;for(;s.next();){let n=s.value,o=n.layerName;o!==t.name?n.layerName=o:n.layerName=""}this.Ce!==null&&this.raiseChangedEvent(4,"layers",this,t,null,i,null),this.C(),this.invalidateDocumentBounds()}}findLayer(t){let e=this.layers;for(;e.next();){let i=e.value;if(i.name===t)return i}return null}findRouter(t){for(let e of this.nf)if(e.name===t)return e;return null}addModelChangedListener(t){return m.S(t,Y,"addModelChangedListener:listener"),this.eo===null&&(this.eo=new q),this.eo.add(t),this.model&&this.model.addChangedListener(t),this}removeModelChangedListener(t){m.S(t,Y,"removeModelChangedListener:listener"),this.eo!==null&&(this.eo.delete(t),this.eo.count===0&&(this.eo=null)),this.model.removeChangedListener(t)}addChangedListener(t){return m.S(t,Y,"addChangedListener:listener"),this.Ir===null&&(this.Ir=new q),this.Ir.add(t),this}removeChangedListener(t){m.S(t,Y,"removeChangedListener:listener"),this.Ir!==null&&(this.Ir.delete(t),this.Ir.count===0&&(this.Ir=null))}D2(t){if(!this.skipsUndoManager&&!this.model.skipsUndoManager&&this.model.undoManager.handleChanged(t),t.change!==1&&(this.isModified=!0),this.Ir!==null){let e=this.Ir,i=e.length;for(let s=0;s<i;s++)e.elt(s)(t)}}raiseChangedEvent(t,e,i,s,n,o,r){o===void 0&&(o=null),r===void 0&&(r=null);let a=new Xe;a.diagram=this,a.change=t,a.propertyName=e,a.object=i,a.oldValue=s,a.oldParam=o,a.newValue=n,a.newParam=r,this.D2(a)}raiseChanged(t,e,i,s,n){this.raiseChangedEvent(2,t,this,e,i,s,n)}t(t,e,i,s,n){this.raiseChangedEvent(2,t,this,e,i,s,n)}get partAdded(){return this.kp}set partAdded(t){this.partAdded!==t&&(this.kp=t)}get partRemoved(){return this.Pp}set partRemoved(t){this.partRemoved!==t&&(this.Pp=t)}get animationManager(){return this.Ns}get undoManager(){return this.Ce.undoManager}get skipsUndoManager(){return this.Vo}set skipsUndoManager(t){m.s(t,"boolean",Y,"skipsUndoManager"),this.Vo=t,this.Ce.skipsUndoManager=t}get delaysLayout(){return this.Ab}set delaysLayout(t){this.Ab=t}iA(t,e){if(t===null||t.diagram!==this)return;let i=this.wi;try{this.wi=!0;let s=t.change;if(s===2){let n=t.object,o=t.propertyName,r=t.getValue(e);if(t.diagram.model.et(n,o,r),n instanceof $){let a=n.part;a!==null&&(a.invalidateAdornments(),a instanceof j&&(a.fromNode?.Ze(a.fromPort),a.toNode?.Ze(a.toPort)))}this.isModified=!0}else if(s===3){let n=t.object,o=t.newParam,r=t.newValue;if(n instanceof G)if(typeof o=="number"&&r instanceof $){e?n.ri(o):n.insertAt(o,r);let a=n.part;a!==null&&a.invalidateAdornments()}else typeof o=="number"&&r instanceof Xt&&(r.isRow?n.kT(o,e?void 0:r):n.PT(o,e?void 0:r));else if(n instanceof Et){let a=t.oldParam===!0;typeof o=="number"&&r instanceof pt&&(e?(a||(r.isSelected=!1,r.isHighlighted=!1,r.invalidateAdornments()),n.ri(a?o:-1,r,a)):n.ch(o,r,a))}else n instanceof Y?typeof o=="number"&&r instanceof Et&&(e?this.bT(o):this.Zr(r,o)):m.o("unknown ChangeType.Insert object: "+t.toString());this.isModified=!0}else if(s===4){let n=t.object,o=t.oldParam,r=t.oldValue;if(n instanceof G)typeof o=="number"&&r instanceof $?e?n.insertAt(o,r):n.ri(o):typeof o=="number"&&r instanceof Xt&&(r.isRow?n.kT(o,e?r:void 0):n.PT(o,e?r:void 0));else if(n instanceof Et){let a=t.newParam===!0;typeof o=="number"&&r instanceof pt&&(e?n.Ct.indexOf(r)<0&&n.ch(o,r,a):(a||(r.isSelected=!1,r.isHighlighted=!1,r.invalidateAdornments()),n.ri(a?o:-1,r,a)))}else n instanceof Y?typeof o=="number"&&r instanceof Et&&(e?this.Zr(r,o):this.bT(o)):m.o("unknown ChangeType.Remove object: "+t.toString());this.isModified=!0}else s===1||m.o("unknown ChangedEvent: "+t.toString())}finally{this.wi=i}}startTransaction(t){return this.undoManager.startTransaction(t)}commitTransaction(t){return this.undoManager.commitTransaction(t)}rollbackTransaction(){return this.undoManager.rollbackTransaction()}commit(t,e){let i=e;i===void 0&&(i="");let s=this.skipsUndoManager;i===null&&(this.skipsUndoManager=!0,i=""),this.undoManager.startTransaction(i);let n=!1;try{t(this),n=!0}finally{n?this.undoManager.commitTransaction(i):this.undoManager.rollbackTransaction(),this.skipsUndoManager=s}}updateAllTargetBindings(t){this.partManager.updateAllTargetBindings(t)}updateAllThemeBindings(){if(this.partManager.updateAllThemeBindings(),this.ls!==null){let t=this.ls.part;t!==null&&t.Go()}}setDivBackground(t){this.div&&(this.div.style.backgroundColor=t)}updateAllRelationshipsFromData(){this.partManager.updateAllRelationshipsFromData()}Np(){let t=this.v,e=this.it,i=this.ct;t.Ue(),e!==1&&t.it(e),(i.x!==0||i.y!==0)&&t.Xs(-i.x,-i.y)}ST(t,e){let i=this.animationManager;if(this.Ht||this.As){this.it=e,this.aa(),this.C(),this.Nh(),i.VA(t,this.it),this.Np();return}if(this.lt===null){this.it=e,this.Np();return}this.Ht=!0;let s=this.viewportBounds.copy(),n=this.wt,o=this.xt,r=this.zoomPoint.x,a=this.zoomPoint.y,h=this.contentAlignment;isNaN(r)&&(h.isSide()?h.includesSide(T.LeftSide)?r=0:h.includesSide(T.RightSide)&&(r=n-1):h.isSpot()?r=h.x*(n-1):r=n/2),isNaN(a)&&(h.isSide()?h.includesSide(T.TopSide)?a=0:h.includesSide(T.BottomSide)&&(a=o-1):h.isSpot()?a=h.y*(o-1):a=o/2),this.scaleComputation!==null&&!this.animationManager.defaultAnimation.isAnimating&&(e=this.scaleComputation(this,e)),e<this.minScale&&(e=this.minScale),e>this.maxScale&&(e=this.maxScale);let l=P.z(this.ct.x+r/t-r/e,this.ct.y+a/t-a/e);this.position=l,P.i(l),this.it=e,this.Np(),this.aa(),this.Ht=!1,this.onViewportBoundsChanged(s,this.viewportBounds,t,!1),this.Js(!1),i.VA(t,this.it),this.C()}yO(){let t=this.Vt.r;for(let e=0;e<t.length;e++)t[e].HA()}onViewportBoundsChanged(t,e,i,s){if(t.equals(e))return;s===void 0&&(s=!1),s||this.Nh(),this.ha();let n=this.layout;n!==null&&n.isViewportSized&&this.autoScale===1&&(t.width!==e.width||t.height!==e.height)&&n.p();let o=this.currentTool;this.ef===!0&&o instanceof ne&&!this.animationManager.isTicking&&(this.lastInput.documentPoint=this.transformViewToDoc(this.lastInput.viewPoint),o.uA(this)),this.Ht||this.invalidateViewport(t,e),this.ca();let r=this.Vt.r;this.rs(r,r.length,this,this.viewportBounds),this.Ye.scale=i,this.Ye.position.x=t.x,this.Ye.position.y=t.y,this.Ye.bounds.h(t),this.Ye.canvasSize.width=Math.round(t.width*i),this.Ye.canvasSize.height=Math.round(t.height*i),this.Ye.newCanvasSize.width=this.wt,this.Ye.newCanvasSize.height=this.xt,this.Ye.isScroll=s,this.T("ViewportBoundsChanged",this.Ye,t),this.isVirtualized&&this.links.each(a=>{a.isAvoiding&&a.actualBounds.intersectsRect(e)&&a.$t()})}ca(t){let e=this.ls;if(e===null||!e.visible||e.part===null||e.layer===null)return;let i=t!==void 0?t:this.Yb;if(!i.isReal())return;let s=i.width,n=i.height;if(e.scale=1,e.angle=0,e.layer.isViewportAligned)e.width=s*this.scale,e.height=n*this.scale,e.part.alignment=T.TopLeft;else{e.Pe===null&&(e.Pe=new ti);let o=e.Pe.lf;if(!o.isReal())return;e.width=s+o.width*2,e.height=n+o.height*2;let r=P.l();C.tm(i.x,i.y,0,0,o.width,o.height,r),r.offset(-o.width,-o.height),e.part.location=r,P.i(r)}}clearSelection(t){t===void 0&&(t=!1);let e=this.selection;if(e.count===0)return;t||this.T("ChangingSelection",e);let i=e.toArray(),s=i.length;for(let n=0;n<s;n++){let o=i[n];o.isSelected=!1}e.ce(),e.clear(),e.k(),t||this.T("ChangedSelection",e)}select(t){t!==null&&t.diagram===this&&(!t.isSelected||this.selection.count>1)&&(this.T("ChangingSelection",this.selection),this.clearSelection(!0),t.isSelected=!0,this.T("ChangedSelection",this.selection))}selectCollection(t){if(this.T("ChangingSelection",this.selection),this.clearSelection(!0),Array.isArray(t)){let e=t.length;for(let i=0;i<e;i++){let s=t[i];s instanceof pt||m.o("Diagram.selectCollection given something that is not a Part: "+s),s.isSelected=!0}}else{let e=t.iterator;for(;e.next();){let i=e.value;i instanceof pt||m.o("Diagram.selectCollection given something that is not a Part: "+i),i.isSelected=!0}}this.T("ChangedSelection",this.selection)}clearHighlighteds(){let t=this.highlighteds;if(t.count>0){let e=t.toArray(),i=e.length;for(let s=0;s<i;s++){let n=e[s];n.isHighlighted=!1}t.ce(),t.clear(),t.k()}}highlight(t){t!==null&&t.diagram===this&&(!t.isHighlighted||this.highlighteds.count>1)&&(this.clearHighlighteds(),t.isHighlighted=!0)}highlightCollection(t){let e=new V().addAll(t),i=this.highlighteds.copy().removeAll(e).iterator;for(;i.next();){let n=i.value;n.isHighlighted=!1}let s=e.iterator;for(;s.next();){let n=s.value;n instanceof pt||m.o("Diagram.highlightCollection given something that is not a Part: "+n),n.isHighlighted=!0}}scroll(t,e,i){i===void 0&&(i=1);let s=e==="up"||e==="down",n=0,o=P.l();if(t==="pixel")n=i;else if(t==="line")n=i*(s?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(t==="page"){let a=s?this.viewportBounds.height:this.viewportBounds.width;if(a*=this.scale,a!==0){let h=Math.max(a-(s?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0);n=i*h}}else if(t==="document"){let a=this.documentBounds,h=this.viewportBounds;e==="up"?this.position=o.e(h.x,a.y):e==="left"?this.position=o.e(a.x,h.y):e==="down"?this.position=o.e(h.x,a.bottom-h.height):e==="right"&&(this.position=o.e(a.right-h.width,h.y)),P.i(o);return}else m.o("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+t);n/=this.scale;let r=this.position;e==="up"?this.position=o.e(r.x,r.y-n):e==="down"?this.position=o.e(r.x,r.y+n):e==="left"?this.position=o.e(r.x-n,r.y):e==="right"?this.position=o.e(r.x+n,r.y):m.o("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+e),P.i(o)}scrollToRect(t){let e=this.viewportBounds;if(e.containsRect(t))return;let i=t.center;i.x-=e.width/2,i.y-=e.height/2,this.position=i}centerRect(t){let e=this.viewportBounds,i=t.center;i.x-=e.width/2,i.y-=e.height/2,this.position=i}transformDocToView(t){return t.copy().v(this.v)}transformViewToDoc(t){return t.copy().Yi(this.v)}YR(t){return t.Yi(this.v)}static None=1;static Uniform=2;static UniformToFill=3;static CycleAll=1;static CycleNotDirected=2;static CycleNotDirectedFast=3;static CycleNotUndirected=4;static CycleDestinationTree=5;static CycleSourceTree=6;static DocumentScroll=1;static InfiniteScroll=2;static TreeParentCollapsed=1;static AllParentsCollapsed=2;static AnyParentsCollapsed=3;get opacity(){return this.Zt}set opacity(t){let e=this.Zt;e!==t&&(m.s(t,"number",Y,"opacity"),(t<0||t>1)&&m.J(t,"0 <= value <= 1",Y,"opacity"),this.Zt=t,this.t("opacity",e,t),this.C())}get validCycle(){return this.Pb}set validCycle(t){let e=this.Pb;e!==t&&(this.Pb=t,this.t("validCycle",e,t))}get layers(){return this.Vt.iterator}get isModelReadOnly(){let t=this.Ce;return t===null?!1:t.isReadOnly}set isModelReadOnly(t){let e=this.Ce;e!==null&&(e.isReadOnly=t)}get isReadOnly(){return this.Bo}set isReadOnly(t){let e=this.Bo;e!==t&&(m.s(t,"boolean",Y,"isReadOnly"),this.Bo=t,this.t("isReadOnly",e,t))}get isEnabled(){return this.Be}set isEnabled(t){let e=this.Be;e!==t&&(m.s(t,"boolean",Y,"isEnabled"),this.Be=t,this.t("isEnabled",e,t))}get allowClipboard(){return this.Tb}set allowClipboard(t){let e=this.Tb;e!==t&&(m.s(t,"boolean",Y,"allowClipboard"),this.Tb=t,this.t("allowClipboard",e,t))}get allowCopy(){return this.Yl}set allowCopy(t){let e=this.Yl;e!==t&&(m.s(t,"boolean",Y,"allowCopy"),this.Yl=t,this.t("allowCopy",e,t))}get allowDelete(){return this.Kl}set allowDelete(t){let e=this.Kl;e!==t&&(m.s(t,"boolean",Y,"allowDelete"),this.Kl=t,this.t("allowDelete",e,t))}get allowDragOut(){return this.Db}set allowDragOut(t){let e=this.Db;e!==t&&(m.s(t,"boolean",Y,"allowDragOut"),this.Db=t,this.t("allowDragOut",e,t))}get allowDrop(){return this.vb}set allowDrop(t){let e=this.vb;e!==t&&(m.s(t,"boolean",Y,"allowDrop"),this.vb=t,this.t("allowDrop",e,t))}get allowTextEdit(){return this.Hl}set allowTextEdit(t){let e=this.Hl;e!==t&&(m.s(t,"boolean",Y,"allowTextEdit"),this.Hl=t,this.t("allowTextEdit",e,t))}get allowGroup(){return this.ql}set allowGroup(t){let e=this.ql;e!==t&&(m.s(t,"boolean",Y,"allowGroup"),this.ql=t,this.t("allowGroup",e,t))}get allowUngroup(){return this.jl}set allowUngroup(t){let e=this.jl;e!==t&&(m.s(t,"boolean",Y,"allowUngroup"),this.jl=t,this.t("allowUngroup",e,t))}get allowInsert(){return this.Fb}set allowInsert(t){let e=this.Fb;e!==t&&(m.s(t,"boolean",Y,"allowInsert"),this.Fb=t,this.t("allowInsert",e,t))}get allowLink(){return this.Wl}set allowLink(t){let e=this.Wl;e!==t&&(m.s(t,"boolean",Y,"allowLink"),this.Wl=t,this.t("allowLink",e,t))}get allowRelink(){return this.Jl}set allowRelink(t){let e=this.Jl;e!==t&&(m.s(t,"boolean",Y,"allowRelink"),this.Jl=t,this.t("allowRelink",e,t))}get allowMove(){return this.$l}set allowMove(t){let e=this.$l;e!==t&&(m.s(t,"boolean",Y,"allowMove"),this.$l=t,this.t("allowMove",e,t))}get allowReshape(){return this.Zl}set allowReshape(t){let e=this.Zl;e!==t&&(m.s(t,"boolean",Y,"allowReshape"),this.Zl=t,this.t("allowReshape",e,t))}get allowResize(){return this.Ql}set allowResize(t){let e=this.Ql;e!==t&&(m.s(t,"boolean",Y,"allowResize"),this.Ql=t,this.t("allowResize",e,t))}get allowRotate(){return this._l}set allowRotate(t){let e=this._l;e!==t&&(m.s(t,"boolean",Y,"allowRotate"),this._l=t,this.t("allowRotate",e,t))}get allowSelect(){return this.ta}set allowSelect(t){let e=this.ta;e!==t&&(m.s(t,"boolean",Y,"allowSelect"),this.ta=t,this.t("allowSelect",e,t))}get allowUndo(){return this.Rb}set allowUndo(t){let e=this.Rb;e!==t&&(m.s(t,"boolean",Y,"allowUndo"),this.Rb=t,this.t("allowUndo",e,t))}get allowZoom(){return this.Ob}set allowZoom(t){let e=this.Ob;e!==t&&(m.s(t,"boolean",Y,"allowZoom"),this.Ob=t,this.t("allowZoom",e,t))}get hasVerticalScrollbar(){return this.Qu}set hasVerticalScrollbar(t){let e=this.Qu;e!==t&&(m.s(t,"boolean",Y,"hasVerticalScrollbar"),this.Qu=t,this.Nh(),this.C(),this.t("hasVerticalScrollbar",e,t),this.Js(!1))}get hasHorizontalScrollbar(){return this.Zu}set hasHorizontalScrollbar(t){let e=this.Zu;e!==t&&(m.s(t,"boolean",Y,"hasHorizontalScrollbar"),this.Zu=t,this.Nh(),this.C(),this.t("hasHorizontalScrollbar",e,t),this.Js(!1))}get allowHorizontalScroll(){return this.Ib}set allowHorizontalScroll(t){let e=this.Ib;e!==t&&(m.s(t,"boolean",Y,"allowHorizontalScroll"),this.Ib=t,this.t("allowHorizontalScroll",e,t),this.Js(!1))}get allowVerticalScroll(){return this.Eb}set allowVerticalScroll(t){let e=this.Eb;e!==t&&(m.s(t,"boolean",Y,"allowVerticalScroll"),this.Eb=t,this.t("allowVerticalScroll",e,t),this.Js(!1))}get scrollHorizontalLineChange(){return this.Ub}set scrollHorizontalLineChange(t){let e=this.Ub;e!==t&&(m.s(t,"number",Y,"scrollHorizontalLineChange"),t<0&&m.J(t,">= 0",Y,"scrollHorizontalLineChange"),this.Ub=t,this.t("scrollHorizontalLineChange",e,t))}get scrollVerticalLineChange(){return this.Vb}set scrollVerticalLineChange(t){let e=this.Vb;e!==t&&(m.s(t,"number",Y,"scrollVerticalLineChange"),t<0&&m.J(t,">= 0",Y,"scrollVerticalLineChange"),this.Vb=t,this.t("scrollVerticalLineChange",e,t))}get lastInput(){return this.gh}set lastInput(t){this.gh=t}get previousInput(){return this.Wr}set previousInput(t){this.Wr=t}get firstInput(){return this.fp}set firstInput(t){this.fp=t}get currentCursor(){return this.Sb}set currentCursor(t){if(t===""&&(t=this.op),this.Sb!==t){m.s(t,"string",Y,"currentCursor");let e=this.lt,i=this.Nt;if(e===null||i===null)return;this.Sb=t;let s=e.style.cursor;e.style.cursor=t,i.style.cursor=t,e.style.cursor===s&&(e.style.cursor="-webkit-"+t,i.style.cursor="-webkit-"+t,e.style.cursor===s&&(e.style.cursor="-moz-"+t,i.style.cursor="-moz-"+t,e.style.cursor===s&&(e.style.cursor=t,i.style.cursor=t)))}}get defaultCursor(){return this.op}set defaultCursor(t){t===""&&(t="auto");let e=this.op;e!==t&&(m.s(t,"string",Y,"defaultCursor"),this.op=t,this.t("defaultCursor",e,t))}get click(){return this.Er}set click(t){let e=this.Er;e!==t&&(t!==null&&m.S(t,Y,"click"),this.Er=t,this.t("click",e,t))}get doubleClick(){return this.Ur}set doubleClick(t){let e=this.Ur;e!==t&&(t!==null&&m.S(t,Y,"doubleClick"),this.Ur=t,this.t("doubleClick",e,t))}get contextClick(){return this.Vr}set contextClick(t){let e=this.Vr;e!==t&&(t!==null&&m.S(t,Y,"contextClick"),this.Vr=t,this.t("contextClick",e,t))}get mouseOver(){return this.Br}set mouseOver(t){let e=this.Br;e!==t&&(t!==null&&m.S(t,Y,"mouseOver"),this.Br=t,this.t("mouseOver",e,t))}get mouseHover(){return this.zr}set mouseHover(t){let e=this.zr;e!==t&&(t!==null&&m.S(t,Y,"mouseHover"),this.zr=t,this.t("mouseHover",e,t))}get mouseHold(){return this.Xr}set mouseHold(t){let e=this.Xr;e!==t&&(t!==null&&m.S(t,Y,"mouseHold"),this.Xr=t,this.t("mouseHold",e,t))}get mouseDragOver(){return this.Mb}set mouseDragOver(t){let e=this.Mb;e!==t&&(t!==null&&m.S(t,Y,"mouseDragOver"),this.Mb=t,this.t("mouseDragOver",e,t))}get mouseDrop(){return this.Gr}set mouseDrop(t){let e=this.Gr;e!==t&&(this.Gr=t,this.t("mouseDrop",e,t))}get handlesDragDropForTopLevelParts(){return this.Nb}set handlesDragDropForTopLevelParts(t){let e=this.Nb;e!==t&&(m.s(t,"boolean",Y,"handlesDragDropForTopLevelParts"),this.Nb=t,this.t("handlesDragDropForTopLevelParts",e,t))}get mouseEnter(){return this.Yr}set mouseEnter(t){let e=this.Yr;e!==t&&(t!==null&&m.S(t,Y,"mouseEnter"),this.Yr=t,this.t("mouseEnter",e,t))}get mouseLeave(){return this.Kr}set mouseLeave(t){let e=this.Kr;e!==t&&(t!==null&&m.S(t,Y,"mouseLeave"),this.Kr=t,this.t("mouseLeave",e,t))}get toolTip(){return this.Hr}set toolTip(t){let e=this.Hr;e!==t&&(this.Hr=t,this.t("toolTip",e,t))}get contextMenu(){return this.qr}set contextMenu(t){let e=this.qr;e!==t&&(this.qr=t,this.t("contextMenu",e,t))}get commandHandler(){return this.jM}set commandHandler(t){let e=this.jM;e!==t&&(e&&e.doStop(),this.jM=t,t.Io(this),t.doStart())}get toolManager(){return this.KM}set toolManager(t){this.KM!==t&&(this.KM=t,t.diagram=this)}get defaultTool(){return this.HM}set defaultTool(t){let e=this.HM;e!==t&&(this.HM=t,t.diagram=this,this.currentTool===e&&(this.currentTool=t))}get currentTool(){return this.qM}set currentTool(t){let e=this.qM;e&&(e.isActive&&e.doDeactivate(),e.cancelWaitAfter(),e.doStop()),t===null&&(t=this.defaultTool),t!==null&&(this.qM=t,t.diagram=this,t.doStart())}get selection(){return this.qA}get maxSelectionCount(){return this.Gb}set maxSelectionCount(t){let e=this.Gb;if(e!==t)if(m.s(t,"number",Y,"maxSelectionCount"),t>=0&&!isNaN(t)){if(this.Gb=t,this.t("maxSelectionCount",e,t),!this.undoManager.isUndoingRedoing){let i=this.selection.count-t;if(i>0){this.T("ChangingSelection",this.selection);let s=this.selection.toArray();for(let n=0;n<i;n++)s[n].isSelected=!1;this.T("ChangedSelection",this.selection)}}}else m.J(t,">= 0",Y,"maxSelectionCount")}get nodeSelectionAdornmentTemplate(){return this.hp}set nodeSelectionAdornmentTemplate(t){let e=this.hp;e!==t&&(this.hp=t.It(),this.t("nodeSelectionAdornmentTemplate",e,t))}get groupSelectionAdornmentTemplate(){return this.Hb}set groupSelectionAdornmentTemplate(t){let e=this.Hb;e!==t&&(this.Hb=t.It(),this.t("groupSelectionAdornmentTemplate",e,t))}get linkSelectionAdornmentTemplate(){return this.qb}set linkSelectionAdornmentTemplate(t){let e=this.qb;e!==t&&(this.qb=t.It(),this.t("linkSelectionAdornmentTemplate",e,t))}get highlighteds(){return this.jA}get isModified(){let t=this.undoManager;return t.isEnabled?t.currentTransaction!==null?!0:this.sd&&this.Hs!==t.historyIndex:this.sd}set isModified(t){if(this.sd!==t){m.s(t,"boolean",Y,"isModified"),this.sd=t;let e=this.undoManager;!t&&e.isEnabled&&(this.Hs=e.historyIndex),t||this.MT()}}MT(){let t=this.isModified;this.ZM!==t&&(this.ZM=t,this.T("Modified"))}get model(){return this.Ce}set model(t){let e=this.Ce;if(e!==t){this.currentTool.doCancel(),e&&e.undoManager!==t.undoManager&&e.undoManager.isInTransaction&&m.o("Do not replace a Diagram.model while a transaction is in progress.");let i=this.oT(!0);this.so=!1,this.$u=!0,this.Hs=-2,this.Tr=!1;let s=this.Ht;this.Ht=!0,this.animationManager.Gl("Model"),e&&(this.eo!==null&&this.eo.each(n=>e.removeChangedListener(n)),e.removeChangedListener(this.Zc)),this.Ce=t,this.partManager=this.CO(this.Ce.type),this.initializePartManager(this.partManager);for(let n=0;n<i.length;n++)this.add(i[n]);t.addChangedListener(this.$M),this.partManager.v2(),t.removeChangedListener(this.$M),t.addChangedListener(this.Zc),this.eo!==null&&this.eo.each(n=>t.addChangedListener(n)),this.Ht=s,this.invalidateDocumentBounds(),this.Ht||this.C(),e&&t.undoManager.copyProperties(e.undoManager)}}get themeManager(){return this.g2}set themeManager(t){let e=this.g2;e!==t&&(e&&e.removeDiagram(this),this.g2=t,t!==null&&t.addDiagram(this))}initializePartManager(t){}static m2(t,e){Y.ZA.set(t,e)}static get licenseKey(){return Y.F2.last()}static set licenseKey(t){Y.F2.add(t.replace(/\s/g,""))}static get version(){return Y.LO}static F2=new q;static LO="3.1.5";CO(t){let e=Y.ZA.get(t);return e!==null?new e:new ge}get G(){return this.JM}set G(t){this.JM=t}get nb(){return this.WA}AO(t){if(t.model!==this.model)return;let e=t.change,i=t.propertyName;if(e===1&&i[0]==="S"){if(i==="StartingFirstTransaction"){let s=this,n=this.toolManager;n.mouseDownTools.each(o=>o.diagram=s),n.mouseMoveTools.each(o=>o.diagram=s),n.mouseUpTools.each(o=>o.diagram=s),this.routers.each(o=>o.diagram=s),!this.As&&!this.so&&(this.$c=!0,this.$u&&(this.Tr=!0))}else if(i==="StartingUndo"||i==="StartingRedo"){let s=this.animationManager;this.skipsUndoManager||(s.defaultAnimation.isAnimating&&s.stopAnimation(),s.getBundleAnimation().isAnimating&&s.getBundleAnimation().stop()),this.T("ChangingSelection",this.selection)}else if(i==="StartedTransaction"){let s=this.animationManager;s.defaultAnimation.isAnimating&&!this.skipsUndoManager&&s.stopAnimation()}return}if(this.G){this.G=!1;try{if(t.modelChange===""&&e===1){(i==="FinishedUndo"||i==="FinishedRedo")&&(this.T("ChangedSelection",this.selection),this.Te());let s=this.animationManager;i==="RolledBackTransaction"&&s.stopAnimation(),this.zA(),this.$c=!0,this.maybeUpdate(),(this.undoManager.transactionLevel===0||this.undoManager.transactionLevel===1)&&s.MM(),i==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Hs=Math.min(this.Hs,this.undoManager.historyIndex-1)),(i==="CommittedTransaction"||i==="RolledBackTransaction")&&this.undoManager.Sx&&m.un(()=>{this.isModified=!1},1);let n=t.isTransactionFinished;if(n&&(this.MT(),this.nb.clear(),this.animationManager.LR()),!this.Cb&&n&&this.lastInput.targetDiagram){this.Cb=!0;let o=this;m.un(()=>{o.currentTool.standardMouseOver(),o.Cb=!1},10)}}}finally{this.G=!0}}}get wi(){return this.WM}set wi(t){this.WM=t}get Ru(){return this.Lb}set Ru(t){this.Lb=t}gT(t){let e=t.D.r;for(let i of e)i instanceof Bt&&this.R2(i)}R2(t){let e=t.element;if(e===null||!X.HTMLImageElement||!(e instanceof HTMLImageElement)||(e.hs instanceof V&&e.hs.add(this),t.TO(),!e.Dp))return;let i=e.getAttribute("src")||"",s=this.oa.get(i);if(s===null){Bt.NT(t,e);let n=[];n.push(t),this.oa.set(i,n)}else{for(let n=0;n<s.length;n++)if(s[n]===t)return;s.push(t)}}DO(t){let e=t.D.r,i=e.length;for(let s=0;s<i;s++)this.O2(e[s])}O2(t){if(!(t instanceof Bt))return;let e=t.element;if(e===null||!X.HTMLImageElement||!(e instanceof HTMLImageElement)||!e.Dp)return;let i=e.getAttribute("src")||"",s=this.oa.get(i);if(s!==null){for(let n=0;n<s.length;n++)if(s[n]===t){s.splice(n,1),s.length===0&&(this.oa.delete(i),Bt.vO(e),e.hs instanceof V&&e.hs.delete(this));return}}}rT(){Bt.clearCache(),this.oa.clear()}rebuildParts(){this.partManager.rebuildParts()}Yc(t,e){this.Ns.Yc(t,e)}Gc(t,e){this.Ns.Gc(t,e)}findPartForKey(t){return this.partManager.findPartForKey(t)}findNodeForKey(t){return this.partManager.findNodeForKey(t)}findLinkForKey(t){return this.partManager.findLinkForKey(t)}findPartForData(t){return this.partManager.findPartForData(t)}findNodeForData(t){return this.partManager.findNodeForData(t)}findLinkForData(t){return this.partManager.findLinkForData(t)}findNodesByExample(...t){return this.partManager.findNodesByExample(...t)}findLinksByExample(...t){return this.partManager.findLinksByExample(...t)}get nodeTemplate(){return this.jr.get("")}set nodeTemplate(t){let e=this.jr.get("");e!==t&&(this.jr.set("",t),this.t("nodeTemplate",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get nodeTemplateMap(){return this.jr}set nodeTemplateMap(t){let e=this.jr;e!==t&&(this.jr=t,this.t("nodeTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get groupTemplate(){return this.dh.get("")}set groupTemplate(t){let e=this.dh.get("");e!==t&&(this.dh.set("",t),this.t("groupTemplate",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get groupTemplateMap(){return this.dh}set groupTemplateMap(t){let e=this.dh;e!==t&&(this.dh=t,this.t("groupTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get linkTemplate(){return this.na.get("")}set linkTemplate(t){let e=this.na.get("");e!==t&&(this.na.set("",t),this.t("linkTemplate",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get linkTemplateMap(){return this.na}set linkTemplateMap(t){let e=this.na;e!==t&&(this.na=t,this.t("linkTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get isMouseCaptured(){return this.QM}set isMouseCaptured(t){let e=this.lt;if(e===null)return;let i=e.bt;i instanceof SVGElement||(t?(this.lastInput.bubbles=!1,this.Le(i,"pointermove",this.xh,!1),this.Le(i,"pointerdown",this.la,!1),this.Le(i,"pointerup",this.bh,!1),this.Le(i,"pointerout",this.kh,!1),this.Le(i,"pointercancel",this.Ph,!1),this.Et(X,"pointermove",this.xh,!0),this.Et(X,"pointerdown",this.la,!0),this.Et(X,"pointerup",this.bh,!0),this.Et(X,"pointerout",this.kh,!0),this.Et(X,"pointercancel",this.Ph,!0),this.Le(i,"wheel",this.wh,!1),this.Et(X,"wheel",this.wh,!0),this.Et(X,"selectstart",this.oh,!1)):(this.Le(X,"pointermove",this.xh,!0),this.Le(X,"pointerdown",this.la,!0),this.Le(X,"pointerup",this.bh,!0),this.Le(X,"pointerout",this.kh,!0),this.Le(X,"pointercancel",this.Ph,!0),this.Et(i,"pointermove",this.xh,!1),this.Et(i,"pointerdown",this.la,!1),this.Et(i,"pointerup",this.bh,!1),this.Et(i,"pointerout",this.kh,!1),this.Et(i,"pointercancel",this.Ph,!1),this.Le(X,"wheel",this.wh,!0),this.Le(X,"selectstart",this.oh,!1),this.Et(i,"wheel",this.wh,!1)),this.QM=t)}get position(){return this.ct}set position(t){if(this.ct.equals(t))return;let e=P.l().h(this.ct),i=this.viewportBounds.copy();if(this.ct.h(t),this.animationManager.UA(e,this.ct),!this.Ht&&!(this.lt===null&&!this.td.isReal())){this.Ht=!0;let s=this.scale,n=this.wt/s,o=this.xt/s;this.k2(this.ap,n,o,this.Wc,!1),this.Ht=!1}else this.aa(),this.Np();if(!this.Ht){let s=this.viewportBounds;this.onViewportBoundsChanged(i,s,this.it,!1)}P.i(e)}get initialPosition(){return this.ab}set initialPosition(t){this.ab.equals(t)||(this.ab=t.N())}get initialScale(){return this.hb}set initialScale(t){this.hb!==t&&(m.s(t,"number",Y,"initialScale"),this.hb=t)}get grid(){return this.ls===null&&(this.ls=this.aT()),this.ls}set grid(t){let e=this.ls;if(e!==t){e===null&&(this.ls=this.aT(),e=this.ls),t.type!==G.Grid&&m.o("Diagram.grid must be a Panel of type Panel.Grid");let i=e.panel;i!==null&&i.remove(e),this.ls=t,t.name="GRID",i!==null&&i.add(t),this.ed=!1,this.C(),this.t("grid",e,t)}}get viewportBounds(){return this.Yb}aa(){let t=this.Yb,e=this.ct,i=this.it;t.e(e.x,e.y,Math.max(this.wt,0)/i,Math.max(this.xt,0)/i),this.ha()}get viewSize(){return this.td}set viewSize(t){let e=this.viewSize;if(!e.equals(t)){t=t.N(),this.td=t;let i=0,s=0;t.isReal()?(i=t.width,s=t.height):this.Nt!==null&&(i=this.Nt.clientWidth||1,s=this.Nt.clientHeight||1),this.wt=i,this.xt=s,this.aa(),this.invalidateDocumentBounds(),this.t("viewSize",e,t),this.C()}}get fixedBounds(){return this.db}set fixedBounds(t){let e=this.db;e.equals(t)||((t.width===-1/0||t.height===1/0||t.height===-1/0)&&m.o("fixedBounds width/height must not be Infinity"),t=t.N(),this.db=t,this.invalidateDocumentBounds(),this.t("fixedBounds",e,t))}get scrollMargin(){return this.fh}set scrollMargin(t){typeof t=="number"&&(t=new Dt(t));let e=this.fh;e.equals(t)||(t=t.N(),this.fh=t,this.t("scrollMargin",e,t),this.Iu())}get scrollMode(){return this.ah}set scrollMode(t){let e=this.ah;e!==t&&(this.ah=t,t===1&&this.Js(!1),this.t("scrollMode",e,t),this.Nh(),this.C())}get scrollsPageOnFocus(){return this.gb}set scrollsPageOnFocus(t){let e=this.gb;e!==t&&(m.s(t,"boolean",Y,"scrollsPageOnFocus"),this.gb=t,this.t("scrollsPageOnFocus",e,t))}get positionComputation(){return this.pb}set positionComputation(t){let e=this.pb;e!==t&&(t!==null&&m.S(t,Y,"positionComputation"),this.pb=t,this.Js(!1),this.t("positionComputation",e,t))}get scaleComputation(){return this.yb}set scaleComputation(t){let e=this.yb;e!==t&&(t!==null&&m.S(t,Y,"scaleComputation"),this.yb=t,this.ST(this.scale,this.scale),this.t("scaleComputation",e,t))}get documentBounds(){return this.ap}CT(t){this.mh=!1;let e=this.ap;e.equals(t)||(e=e.copy(),this.ap.h(t),this.Js(!1),this.T("DocumentBoundsChanged",void 0,e),this.Nh(),this.C())}ensureBounds(){if(this.mh){let t=I.l();this.CT(this.computeBounds(t)),I.i(t)}}get isVirtualized(){return this.Kb}set isVirtualized(t){let e=this.Kb;e!==t&&(m.s(t,"boolean",Y,"isVirtualized"),this.Kb=t,this.t("isVirtualized",e,t))}get scale(){return this.it}set scale(t){let e=this.it;e!==t&&this.ST(e,t)}get defaultScale(){return this.dp}set defaultScale(t){this.dp=t}get autoScale(){return this.ia}set autoScale(t){let e=this.ia;e!==t&&(this.ia=t,this.t("autoScale",e,t),t!==1&&this.Js(!1))}get initialAutoScale(){return this.Rr}set initialAutoScale(t){let e=this.Rr;e!==t&&(this.Rr=t,this.t("initialAutoScale",e,t))}get initialViewportSpot(){return this.xb}set initialViewportSpot(t){let e=this.xb;e!==t&&(t.isSpot()||m.o("initialViewportSpot must be a specific Spot: "+t),this.xb=t,this.t("initialViewportSpot",e,t))}get initialDocumentSpot(){return this.wb}set initialDocumentSpot(t){let e=this.wb;e!==t&&(t.isSpot()||m.o("initialViewportSpot must be a specific Spot: "+t),this.wb=t,this.t("initialDocumentSpot",e,t))}get minScale(){return this.cb}set minScale(t){let e=this.cb;e!==t&&(t>0?(this.cb=t,this.t("minScale",e,t),t>this.scale&&(this.scale=t)):m.J(t,"> 0",Y,"minScale"))}get maxScale(){return this.fb}set maxScale(t){let e=this.fb;e!==t&&(t>0?(this.fb=t,this.t("maxScale",e,t),t<this.scale&&(this.scale=t)):m.J(t,"> 0",Y,"maxScale"))}get zoomPoint(){return this.ub}set zoomPoint(t){this.ub.equals(t)||(t=t.N(),this.ub=t)}get contentAlignment(){return this.Wc}set contentAlignment(t){let e=this.Wc;e.equals(t)||(t=t.N(),this.Wc=t,this.t("contentAlignment",e,t),this.Js(!1))}get initialContentAlignment(){return this.ip}set initialContentAlignment(t){let e=this.ip;e.equals(t)||(t=t.N(),this.ip=t,this.t("initialContentAlignment",e,t))}get padding(){return this.Qt}set padding(t){typeof t=="number"&&(t=new Dt(t));let e=this.Qt;e.equals(t)||(t=t.N(),this.Qt=t,this.invalidateDocumentBounds(),this.t("padding",e,t))}get partManager(){return this.s2}set partManager(t){let e=this.s2;e!==t&&(t.diagram!==null&&m.o("Cannot share PartManagers between Diagrams: "+t.toString()),e&&e.Io(null),this.s2=t,t.Io(this))}get nodes(){return this.partManager.nodes.iterator}get links(){return this.partManager.links.iterator}get parts(){return this.partManager.parts.iterator}findTopLevelNodesAndLinks(){let t=new V,e=this.nodes;for(;e.next();){let s=e.value;s.isTopLevel&&t.add(s)}let i=this.links;for(;i.next();){let s=i.value;s.isTopLevel&&t.add(s)}return t.iterator}findTopLevelGroups(){return this.$r.iterator}get routers(){return this.nf}doLinkRouting(t){this.Uo=!0;let e=this.nf.r;for(let i=0;i<e.length;i++)e[i].canRoute(t)&&e[i].routeLinks(this.Or,t);this.Uo=!1}get layout(){return this.li}set layout(t){let e=this.li;e!==t&&(this.li=t,t.diagram=this,t.group=null,this.Jr=!0,this.t("layout",e,t),this.requestUpdate())}layoutDiagram(t){this.Te(),t&&this.c1(!0),this.As?this.M2(!1,this.Fl||this.nf.count!==0&&this.to.size!==0):(this.$c=!0,this.Pr())}c1(t){let e=this.$r.iterator;for(;e.next();)this.LT(e.value,t);this.layout&&(t?this.layout.isValidLayout=!1:this.layout.p())}LT(t,e){if(t===null)return;let i=t.Ch.iterator;for(;i.next();){let s=i.value;this.LT(s,e)}t.layout!==null&&(e?t.layout.isValidLayout=!1:t.layout.p())}M2(t,e){if(this.Ab)return;let i=this.G;this.G=!0;let s="Layout",n=this.undoManager.transactionLevel,o=this.layout,r=this.animationManager;try{n===0&&(this.undoManager.Dl=!0,this.startTransaction(s)),n<=1&&!r.defaultAnimation.isAnimating&&!r.ke&&(t||r.Gl(s)),this.Jr=!1;let a=this.$r.iterator;for(;a.next();)this.cd(a.value),this.AT(a.value,t,n,e);let h=!1;if(o.isValidLayout||(!t||o.isRealtime||o.isRealtime===null||n===0?(o.doLayout(this),this.cd(this),h=!0,o.isValidLayout=!0):this.Jr=!0),h||this.cd(this),this.doLinkRouting(this),this.Or.clear(),this.uh.size!==0){for(let l=0;l<23&&this.uh.size!==0;l++){for(a=this.$r.iterator;a.next();)this.TT(a.value);let u=this.Or;this.Or=this.uh,this.uh=u,this.cd(this),this.doLinkRouting(this)}this.Or.clear(),this.uh.clear()}}finally{let a=this.undoManager.Dl;n===0&&(this.commitTransaction(s),this.undoManager.Dl=!1),a&&(n===0||n===1)&&r.MM(),this.Jr&&(this.Jr=!o.isValidLayout),this.G=i}}AT(t,e,i,s){let n=t.Ch.iterator;for(;n.next();)this.AT(n.value,e,i,s);let o=t.layout;o!==null&&!o.isValidLayout?!e||o.isRealtime||i===0?(t.Lh=!t.location.isReal(),o.doLayout(t),t.invalidateLayout(32),this.o1(t),this.cd(t),this.doLinkRouting(t),o.isValidLayout=!0):(this.doLinkRouting(t),this.Jr=!0):s&&this.doLinkRouting(t)}TT(t){let e=t.Ch.iterator;for(;e.next();)this.TT(e.value);this.cd(t),this.doLinkRouting(t)}get isTreePathToChildren(){return this.bb}set isTreePathToChildren(t){let e=this.bb;if(e!==t&&(m.s(t,"boolean",Y,"isTreePathToChildren"),this.bb=t,this.t("isTreePathToChildren",e,t),!this.undoManager.isUndoingRedoing)){let i=this.nodes;for(;i.next();)i.value.vp()}}findTreeRoots(){let t=new q,e=this.nodes;for(;e.next();){let i=e.value;i.isTopLevel&&i.findTreeParentLink()===null&&t.add(i)}return t.iterator}get treeCollapsePolicy(){return this.kb}set treeCollapsePolicy(t){let e=this.kb;e!==t&&(t!==1&&t!==2&&t!==3&&m.o("Unknown Diagram.treeCollapsePolicy: "+t),this.kb=t,this.t("treeCollapsePolicy",e,t))}get isCollapsingExpanding(){return this.YM}set isCollapsingExpanding(t){this.YM=t}_R(){let t=new Mt,e=new Mt;function i(s){let n=s.toLowerCase(),o=new q;t.set(s,o),t.set(n,o),e.set(s,s),e.set(n,s)}i("InitialAnimationStarting"),i("AnimationStarting"),i("AnimationFinished"),i("BackgroundSingleClicked"),i("BackgroundDoubleClicked"),i("BackgroundContextClicked"),i("ClipboardChanged"),i("ClipboardPasted"),i("DocumentBoundsChanged"),i("ExternalObjectsDropped"),i("FocusOrVirtualPointerEnabledChanged"),i("GainedFocus"),i("InitialLayoutCompleted"),i("LayoutCompleted"),i("LinkDrawn"),i("LinkRelinked"),i("LinkReshaped"),i("LostFocus"),i("Modified"),i("ObjectSingleClicked"),i("ObjectDoubleClicked"),i("ObjectContextClicked"),i("PartCreated"),i("PartResized"),i("PartRotated"),i("SelectionMoved"),i("SelectionCopied"),i("SelectionDeleting"),i("SelectionDeleted"),i("SelectionGrouped"),i("SelectionUngrouped"),i("ChangingSelection"),i("ChangedSelection"),i("SubGraphCollapsed"),i("SubGraphExpanded"),i("TextEdited"),i("ThemeChanged"),i("TreeCollapsed"),i("TreeExpanded"),i("ViewportBoundsChanged"),i("InvalidateDraw"),this.XM=t,this.GM=e}dT(t){let e=this.GM.get(t);return e!==null?e:this.GM.get(t.toLowerCase())}I2(t){let e=this.XM.get(t);if(e!==null)return e;let i=t.toLowerCase();if(e=this.XM.get(i),e!==null)return e;m.o("Unknown DiagramEvent name: "+t)}addDiagramListener(t,e){m.s(t,"string",Y,"addDiagramListener:name"),m.S(e,Y,"addDiagramListener:listener");let i=this.I2(t);return i!==null&&i.add(e),this}removeDiagramListener(t,e){m.s(t,"string",Y,"removeDiagramListener:name"),m.S(e,Y,"addDiagramListener:listener");let i=this.I2(t);i!==null&&i.delete(e)}raiseDiagramEvent(t,e,i){this.T(t,e,i)}T(t,e,i){let s=this.I2(t),n=new wi;n.diagram=this;let o=this.dT(t);o!==null&&(n.name=o),e!==void 0&&(n.subject=e),i!==void 0&&(n.parameter=i);let r=s.length;if(r===1)s.elt(0)(n);else if(r!==0){let a=s.toArray();for(let h=0;h<r;h++){let l=a[h];l(n)}}}isUnoccupied(t,e){return this.getPositions(!1,null,e||null).isUnoccupied(t.x,t.y,t.width,t.height)}computeOccupiedArea(t){return this.isVirtualized?this.viewportBounds.copy():this.mh?this.cT(t):t.h(this.documentBounds)}getPositions(t,e,i){let s=this.sa;s===null&&(this.sa=s=new Ot(this.avoidanceCellSize));let n=e;if(s.Yo||s.Ah!==n||s.E2!==i){if(s.U2=Math.max(s.af+1,Math.floor(this.avoidanceLimit/this.avoidanceCellSize.width)),s.V2=Math.max(s.af+1,Math.floor(this.avoidanceLimit/this.avoidanceCellSize.height)),n!==null&&(n=this.DT(n)),n===null){let o=I.l();this.computeOccupiedArea(o),o.inflate(100,100),s.f1(o);let r=this.nodes;for(;r.next();){let a=r.value,h=a.layer;h===null||!h.visible||h.isTemporary||this.B2(a,i,o)}I.i(o)}else{if(n.memberParts.count>0){let a=this.computePartsBounds(n.memberParts,!1);a.inflate(20,20),s.f1(a)}let o=I.l(),r=n.memberParts;for(;r.next();){let a=r.value;a instanceof J&&this.B2(a,i,o)}I.i(o)}s.Ah=n,s.E2=i,s.Yo=!1}else t&&s.vT();return s}get avoidanceCellSize(){return this._M}set avoidanceCellSize(t){this.sa=null,this._M=new st(Math.max(1,t.width),Math.max(1,t.height))}get avoidanceLimit(){return this.t2}set avoidanceLimit(t){this.t2=Math.max(1,t)}DT(t){return t.canAvoid()?t:t.containingGroup!==null?this.DT(t.containingGroup):null}B2(t,e,i){if(t===e||!t.isVisible())return;let s=t.canAvoid();if(s){let n=t.getAvoidableRect(i);this.sa.FO(n.x,n.y,n.width,n.height)}if(t instanceof ht&&(!s||t.avoidableMembers)){let n=t.memberParts;for(;n.next();){let o=n.value;o instanceof J&&this.B2(o,e,i)}}}fd(t){this.sa!==null&&!this.sa.Yo&&(t===void 0||t.canAvoid())&&(this.sa.Yo=!0)}get autoScrollInterval(){return this.sp}set autoScrollInterval(t){let e=this.sp;e!==t&&(this.sp=t,this.t("autoScrollInterval",e,t))}get autoScrollRegion(){return this.np}set autoScrollRegion(t){typeof t=="number"&&(t=new Dt(t));let e=this.np;e.equals(t)||(t=t.N(),this.np=t,this.invalidateDocumentBounds(),this.t("autoScrollRegion",e,t))}doAutoScroll(t){this.cp.h(t);let e=P.l();this.computeAutoScrollPosition(this.cp,e).equalsApprox(this.position)?this.stopAutoScroll():this.FT(),P.i(e)}FT(){if(this.Jc!==-1)return;let t=this.sp,e=this;this.Jc=m.un(()=>{if(e.Jc===-1||(e.stopAutoScroll(),e.lastInput.event===null))return;let i=P.l(),s=e.computeAutoScrollPosition(e.cp,i);if(!s.equalsApprox(e.position)){e.position=s,e.lastInput.documentPoint=e.transformViewToDoc(e.cp),e.doMouseMove(),e.mh=!0;let n=I.l();e.computeBounds(n),n.unionRect(e.documentBounds),e.CT(n),I.i(n),e.qi=!0,e.maybeUpdate(),e.FT()}P.i(i)},t)}stopAutoScroll(){this.Jc!==-1&&(m.yc(this.Jc),this.Jc=-1)}computeAutoScrollPosition(t,e){let i=this.position;e===void 0&&(e=new P),e.h(i);let s=this.np;if(s.top<=0&&s.left<=0&&s.right<=0&&s.bottom<=0)return e;let n=this.viewportBounds,o=this.scale,r=I.z(0,0,n.width*o,n.height*o),a=P.z(0,0);if(t.x>=r.x&&t.x<r.x+s.left&&this.allowHorizontalScroll){let h=Math.max(this.scrollHorizontalLineChange,1);h=h|0,a.x-=h,t.x<r.x+s.left/2&&(a.x-=h),t.x<r.x+s.left/4&&(a.x-=4*h)}else if(t.x<=r.x+r.width&&t.x>r.x+r.width-s.right&&this.allowHorizontalScroll){let h=Math.max(this.scrollHorizontalLineChange,1);h=h|0,a.x+=h,t.x>r.x+r.width-s.right/2&&(a.x+=h),t.x>r.x+r.width-s.right/4&&(a.x+=4*h)}if(t.y>=r.y&&t.y<r.y+s.top&&this.allowVerticalScroll){let h=Math.max(this.scrollVerticalLineChange,1);h=h|0,a.y-=h,t.y<r.y+s.top/2&&(a.y-=h),t.y<r.y+s.top/4&&(a.y-=4*h)}else if(t.y<=r.y+r.height&&t.y>r.y+r.height-s.bottom&&this.allowVerticalScroll){let h=Math.max(this.scrollVerticalLineChange,1);h=h|0,a.y+=h,t.y>r.y+r.height-s.bottom/2&&(a.y+=h),t.y>r.y+r.height-s.bottom/4&&(a.y+=4*h)}return a.equalsApprox(P.dn)||(e.x=i.x+a.x/o,e.y=i.y+a.y/o),I.i(r),P.i(a),e}makeSvg(t){this.zo.has("SVG")||this.addRenderer("SVG",new ui(this,X.document));let e=new ui(this,X.document,!0);t===void 0&&(t={});let i=this;function s(n,o){let r=i.RT(n,"SVG",e),a=r!==null?r.svg:null,h=n.svgFinished;return a&&h&&h(a),m.st(o)?(o(a),null):a}return this.OT(s,t)}makeSVG(t){return this.makeSvg(t)}addRenderer(t,e){this.zo.set(t,e)}removeRenderer(t){this.zo.delete(t)}cacheGroupExternalLinks(t){this.d2=t,t||this.nodes.each(e=>{e instanceof ht&&(e.Fp=null)})}OT(t,e){let i=e.callback,s=!0,n=this.oa.iterator;for(;n.next();)if(!n.value[0].Sn){s=!1;break}if(!m.st(i)||s)return t(e,i,this);let o=this;function r(){let l=+new Date;for(s=!0,n.reset();n.next();)if(!n.value[0].Sn){s=!1;break}if(s||l-h>a){t(e,i,o);return}X.requestAnimationFrame(r)}let a=e.callbackTimeout||300,h=+new Date;return X.requestAnimationFrame(()=>r()),null}makeImage(t){return Y.isUsingDOM()?(t===void 0&&(t={}),t.returnType="Image",this.makeImageData(t)):null}makeImageData(t){return t===void 0&&(t={}),this.OT(this.RO,t)}static img="image";RO(t,e,i){let s=i.RT(t,"canvas",null);if(s===null)return null;let n=s.F.canvas,o=null;if(n!==null){let r=t.returnType;switch(r===void 0?r="string":r=r.toLowerCase(),r){case Y.img+"data":o=s.getImageData(0,0,n.width,n.height);break;case Y.img:let a=(t.document||document).createElement("img");a.src=n.toDataURL(t.type,t.details),o=a;break;case"blob":{let h=n;return m.st(e)||(o="",m.o('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.')),m.st(h.toBlob)?(h.toBlob(e,t.type,t.details),"toBlob"):(e(null),null)}case"string":default:o=n.toDataURL(t.type,t.details)}}return m.st(e)?(e(o),null):o}static OO=!1;RT(t,e,i){this.animationManager.stopAnimation(),this.maybeUpdate(),m.$(t)||m.o("properties argument must be an Object.");let s=!1,n=t.size||null,o=t.scale||null;t.scale!==void 0&&isNaN(t.scale)&&(o="NaN");let r=t.maxSize;t.maxSize===void 0&&(s=!0,e==="SVG"?r=new st(1/0,1/0):r=new st(2e3,2e3));let a=t.position||null,h=t.parts||null;Array.isArray(h)&&(h=new q(h));let l=t.padding===void 0?1:t.padding,u=t.background||null,c=t.omitTemporary;c===void 0&&(c=!0);let d=t.document||X.document,f=t.elementFinished||null,p=t.showTemporary;p===void 0&&(p=!c);let g=t.showGrid;g===void 0&&(g=p),n!==null&&isNaN(n.width)&&isNaN(n.height)&&(n=null),typeof l=="number"?l=new Dt(l):l instanceof Dt||m.o("MakeImage padding must be a Margin or a number."),l.left=Math.max(l.left,0),l.right=Math.max(l.right,0),l.top=Math.max(l.top,0),l.bottom=Math.max(l.bottom,0),this.Wt&&this.Wt.clearContextCache(!0);let y=new Fe(null,d,void 0,!0),b=y._t;if(!(n||o||h||a))return y.width=this.wt+Math.ceil(l.left+l.right),y.height=this.xt+Math.ceil(l.top+l.bottom),e==="SVG"?i===null?null:(i.resize(y.width,y.height,y.width,y.height),i.tl=d,i.ud=f,this.l1(i._t,l,new st(y.width,y.height),this.it,this.ct,h,u,p,g),i._t):(this.nd=!1,this.l1(b,l,new st(y.width,y.height),this.it,this.ct,h,u,p,g),this.nd=!0,y._t);let v=this.dp,w=this.documentBounds.copy();if(w.subtractMargin(this.Qt),p){let F=this.Vt.r,O=F.length;for(let E=0;E<O;E++){let B=F[E];if(!B.visible||!B.isTemporary)continue;let K=B.Ct.r,z=K.length;for(let U=0;U<z;U++){let tt=K[U];if(!tt.isInDocumentBounds||!tt.isVisible())continue;let nt=tt.actualBounds;nt.isReal()&&w.unionRect(nt)}}}let k=new P(w.x,w.y);if(h!==null){let F=new I(0,0,0,0),O=!0,E=h.iterator;for(E.reset();E.next();){let B=E.value;if(!(B instanceof pt))continue;let K=B.layer;if(K!==null&&!K.visible||K!==null&&!p&&K.isTemporary||!B.isVisible())continue;let z=B.actualBounds;z.isReal()&&(O?(O=!1,F.h(z)):F.unionRect(z))}w.width=F.width,w.height=F.height,k.x=F.x,k.y=F.y}a!==null&&a.isReal()&&(k=a,o||(o=v));let S=0,N=0;l!==null&&(S=l.left+l.right,N=l.top+l.bottom);let D=0,L=0;n!==null&&(D=n.width,L=n.height,isFinite(D)&&(D=Math.max(0,D-S)),isFinite(L)&&(L=Math.max(0,L-N)));let M=0,A=0;if(n!==null&&o!==null?(o==="NaN"&&(o=v),n.isReal()?(M=D,A=L):isNaN(L)?(M=D,A=w.height*o):(M=w.width*o,A=L)):n!==null?n.isReal()?(o=Math.min(D/w.width,L/w.height),M=D,A=L):isNaN(L)?(o=D/w.width,M=D,A=w.height*o):(o=L/w.height,M=w.width*o,A=L):o!==null?o==="NaN"&&r.isReal()?(o=Math.min((r.width-S)/w.width,(r.height-N)/w.height),o>v?(o=v,M=w.width,A=w.height):(M=r.width,A=r.height)):(M=w.width*o,A=w.height*o):(o=v,M=w.width,A=w.height),l!==null?(M+=S,A+=N):l=new Dt(0),r!==null){let F=r.width,O=r.height;e!=="SVG"&&s&&Y.OO,isNaN(F)&&(F=2e3),isNaN(O)&&(O=2e3),isFinite(F)&&(M=Math.min(M,F)),isFinite(O)&&(A=Math.min(A,O))}return y.width=Math.ceil(M),y.height=Math.ceil(A),e==="SVG"?i===null?null:(i.resize(y.width,y.height,y.width,y.height),i.tl=d,i.ud=f,this.l1(i._t,l,new st(Math.ceil(M),Math.ceil(A)),o,k,h,u,p,g),i._t):(this.nd=!1,this.l1(b,l,new st(Math.ceil(M),Math.ceil(A)),o,k,h,u,p,g),this.nd=!0,y._t)}static Mh=null;static z2="5da73c80a36555d5038e4972187c3cae51fd22";static IO="5da73c80a36555d503aa5c72106c30b35bb2006b9cd041b259";static jw=!1;static OP=()=>{if(Y.z2[5]===void 0&&(Nt.prototype.Ci=Nt.prototype.Su),!Y.isUsingDOM())return;let t=m.Ni("canvas");t.width=350;let e=t.getContext("2d"),i=m.We("7ca11abfd022028846"),s="7ca11abfd7330390",n=[Y.z2,m.jw+"4ae6247590da4bb21c324ba3a84e385776",Nt.OP+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",C.za];e.scale(2,2);let o=8;for(let r=1;r<5;r++)e[m.We(s)](m.We(n[r-1]),o,r*15);e[i]=m.We("39f046ebb36e4b");for(let r=1;r<5;r++)e[m.We(s)](m.We(n[r-1]),o,r*15);(n.length!==4||n[0][0]!=="5"||n[3][0]!=="7")&&(Nt.prototype.Ci=Nt.prototype.Su),Y.Mh=t};static EO=()=>{if(Y.z2[5]===void 0&&(Nt.prototype.Ci=Nt.prototype.Su),!Y.isUsingDOM())return;let t=m.Ni("canvas"),e=t.getContext("2d"),i=m.We("7ca11abfd022028846"),s="7ca11abfd7330390",n=[Y.IO,C.za],o=5;e.scale(2,2);for(let r=1;r<3;r++)e[m.We(s)](m.We(n[r-1]),o,r*11);e[i]=m.We("39f046ebb36e4b");for(let r=1;r<3;r++)e[m.We(s)](m.We(n[r-1]),o,r*11);(n.length!==2||n[0][0]!=="5")&&(Nt.prototype.Ci=Nt.prototype.Su),Y.Mh=t}}class Fn{IT;ET;X2;bi;constructor(t){if(this.IT=null,this.ET="63ad05bbe23a1786468a4c741b6d2",this.X2="@onz",this.ET===this._tk){this.X2=!0,this.bi=this.X2;return}this.bi=null}UO(t,e){let i="f",s=X[m.We("76a715b2f73f148a")][m.We("72ba13b5")]||"",n=m.We;if(this.bi=!0,!Y.isUsingDOM())return;let o=Y[n("76a115b6ed251eaf4692")];if(!o){let a=s[n("76ad18b4f73e")];for(let l=s[n("73a612b6fb191d")](n("35e7"))+2;l<a;l++)i+=s[l];let h=i[n("73a612b6fb191d")](n("7da71ca0ad381e90"));this.bi=!(h>=0&&h<i[n("73a612b6fb191d")](n("35")));return}let r=Y.F2.iterator;for(;r.next();){o=r.value;let a=n(o).split(n("39e9")),h=a.length===7?1:0;if(a.length===1&&o.includes(n("5b8b3797c61b32a7"))){if(Y.EO(),!t.lt)return;t.gp=t.lt._t.F[m.We("7eba17a4ca3b1a8346")][m.We("78a118b7")](t.lt._t.F,Y.Mh,4,4)}if(a.length<6)return;let l=n(a[1+h]).split(".");if(a[4+h]!=="7da71ca0")return;let u=n(m[n("6cae19")]).split(".");if(!(l[0]>u[0]||l[0]===u[0]&&l[1]>=u[1]))continue;let c="73a612b6fb191d",d=X[n("74a900bae4370f8b51")][n("6fbb13a1c2311e8a57")].toLowerCase(),f=d[n(c)](n("3aad1ab6e022098b4dc4")),p=n(a[2+h]);if(f>-1){let M=d[n(c)](p.toLowerCase()+"/");if(this.bi=!(M>-1&&M<f),!this.bi)return}let g=s[n("76ad18b4f73e")];for(let M=s[n(c)](n("35e7"))+2;M<g;M++)i+=s[M];let y=i[n(c)](p);if(y<0&&p!==n("7da71ca0ad381e90")&&(y=i[n(c)](n("76a715b2ef3e149757"))),y<0&&(y=i[n(c)](n("76a715b2ef3e149757"))),y<0&&(y=i[n(c)](n("2bfa41fdb3784bca12"))),y<0&&(y=s[n(c)](n("7baa19a6f76c1988428554"))),y<0&&(y=s[n(c)](n("7ea902b2b9221e9c57c45767196566"))),this.bi=!(y>=0&&y<i[n(c)](n("35"))||i[n(c)](n("35"))===-1),!this.bi||s[n(c)](n("7fb002b6ed25128b4da25b2e"))&&(this.bi=!(s[n(c)](p)>-1),!this.bi))return;let b=X[m.We("76a715b2f73f148a")][m.We("69ad17a1e03e")],v=b[n(c)](n("7fb002b6ed25128b4da25b2e"));if(v>-1&&(this.bi=!(b[n(c)](p)>v),!this.bi))return;let w=p;if(w[0]!=="#")continue;let k=m.Ni("div"),S=a[0+h].replace(/[A-Za-z]/g,"");for(;S.length<4;)S+="9";let N=S;S=S.substring(S.length-4);let D=parseInt(u[0]),L=parseInt(u[1]);if(D>3||D===3&&L>=1){let M=parseInt(N)%40+30,A=parseInt(w.substring(1,5),16);if(j.UT===M+A){this.bi=!1;return}}else{let M="",A=["gsh","gsf"],F=["Header","Background","Display","Feedback"];if(M+=A[parseInt(S.substring(0,1),10)%2],M+=F[parseInt(S.substring(0,1),10)%4],k[n("79a417a0f0181a8946")]=M,X.document[n("78a712aa")]){X.document[n("78a712aa")][n("7bb806b6ed32388c4a875b")](k);let O=X.getComputedStyle(k).getPropertyValue(n("78a704b7e62456904c9b12701b6532a8")),E=X.getComputedStyle(k).getPropertyValue(n("75b817b0ea2202"));if(X.document[n("78a712aa")][n("68ad1bbcf533388c4a875b")](k),!O)continue;let B=X[n("77a902b0eb1b1e804a8a")],K="0."+parseInt(N,10)%100;if(E===K||O.indexOf(parseInt(w[1]+w[2],16).toString())!==-1&&O.indexOf(parseInt(w[3]+w[4],16).toString())!==-1){this.bi=!1;return}else if(B&&B(n("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches){M="."+M;for(let z=0;z<X.document.styleSheets.length;z++){let U=X.document.styleSheets[z].rules||X.document.styleSheets[z].cssRules;for(let tt in U)if(M===U[tt].selectorText){this.bi=!1;return}}}}else this.bi=null,e&&(this.bi=!1)}}}Mh(t,e){return e.setTransform(t.$e/2,0,0,t.$e/2,0,0),e.commitTransform(),this.bi===null&&this.UO(t,!0),0<this.bi&&this!==this.IT}}class Ye{G2;Y2;constructor(t){this.G2=t===void 0?new P:t,this.Y2=new P}get point(){return this.G2}set point(t){this.G2=t}get shifted(){return this.Y2}set shifted(t){this.Y2=t}}class On{Ri;wT;h1;constructor(t,e,i){this.Ri=t,this.wT=e,this.h1=i}}class Pi{isGridSnapEnabled;isGridSnapRealtime;gridSnapCellSize;gridSnapCellSpot;gridSnapOrigin;dragsLink;dragsTree;groupsSnapMembers;groupsAlwaysMove;dragsMembers;constructor(t){this.Ue(),t&&Object.assign(this,t)}Ue(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new st(NaN,NaN).k(),this.gridSnapCellSpot=T.TopLeft,this.gridSnapOrigin=new P(NaN,NaN).k(),this.dragsLink=!1,this.dragsTree=!1,this.groupsSnapMembers=!1,this.groupsAlwaysMove=!0,this.dragsMembers=!0}}class Rn extends Y{constructor(t,e){let i;return t===void 0||typeof t=="string"||X.Element&&t instanceof Element?i=t:m.$(t)&&(e=t),super(i),this.VT(),e&&this.setProperties(e),this}VT(){this.allowDragOut=!0,this.allowMove=!1,this.isReadOnly=!0,this.contentAlignment=T.TopCenter,this.layout=new je}setupRouters(){}reset(){super.reset(),this.VT()}}class hi extends Y{u1;d1;g1;m1;Rp;hf;Bl;K2;H2;p1;q2;constructor(t,e){let i;return t===void 0||typeof t=="string"||X.Element&&t instanceof Element?i=t:m.$(t)&&(e=t),super(i),this.animationManager.isEnabled=!1,this.Ht=!0,this.u1=null,this.Zu=!1,this.Qu=!1,this.d1=!0,this.g1=!0,this.m1=0,this.Rp=!1,this.hf=null,this.setRenderingHint("drawShadows",!1),this.Bl=new pt({selectable:!0,selectionAdorned:!1,selectionObjectName:"BOXSHAPE",locationObjectName:"BOXSHAPE",resizeObjectName:"BOXSHAPE",cursor:"move"}).add(new et({name:"BOXSHAPE",fill:"transparent",stroke:"magenta",strokeWidth:2}).theme("stroke","overviewBox")).It(),this.allowCopy=!1,this.allowDelete=!1,this.allowDrop=!1,this.allowSelect=!0,this.autoScrollRegion=new Dt(0,0,0,0),this.ct.e(0,0),this.toolManager.Jt("Dragging",new En,this.toolManager.mouseMoveTools),this.click=()=>{let s=this.observed;if(s===null)return;let n=s.viewportBounds,o=this.lastInput.documentPoint;s.position=new P(o.x-n.width/2,o.y-n.height/2)},this.K2=s=>{this.invalidateDocumentBounds(),this.Op()},this.H2=s=>{this.observed!==null&&(this.invalidateDocumentBounds(),this.C())},this.p1=s=>{this.updateDelay<1?this.C():this.Rp||(this.Rp=!0,m.un(()=>this.redraw(),this.updateDelay))},this.q2=s=>{this.observed!==null&&this.Op()},this.autoScale=2,this.Ht=!1,e&&this.setProperties(e),this}setupRouters(){}computePixelRatio(){return 1}redraw(){this.Rp&&this.updateDelay>=1&&(this.Rp=!1,this.VO()),super.redraw()}Ge(){if(this.Nt===null&&m.o("No div specified"),this.lt===null&&m.o("No canvas specified"),this.lt instanceof ui||(this.box.BM(),!this.qi))return;let t=this.observed;if(t===null||t.animationManager.defaultAnimation.isAnimating||!t.Qa)return;this.Lp();let e=this.lt,i=this.Wt;if(i.clearContextCache(!0),i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,e.width,e.height),this.updateDelay<1)this.BT();else if(this.hf!==null){i.drawImage(this.hf.bt,0,0);let o=this.v;i.scale(this.$e,this.$e),i.transform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),i.commitTransform()}let s=this.Vt.r,n=s.length;for(let o=0;o<n;o++)s[o].Ge(i,this);this._c=!1,this.qi=!1}VO(){let t=this.lt,e=this.Wt;if(!(t===null||e===null)){if(this.Lp(),this.hf===null){let i=new Fe(null);i.width=t.width,i.height=t.height,this.hf=i}try{this.lt=this.hf,this.Wt=this.lt._t,this.Wt.clearContextCache(!0),this.Wt.setTransform(1,0,0,1,0,0),this.Wt.clearRect(0,0,this.lt.width,this.lt.height),this.BT()}finally{this.lt=t,this.Wt=e}}}BT(){let t=this.observed;if(t===null)return;let e=this.drawsTemporaryLayers,i=this.drawsGrid&&e,s=t.grid;if(i&&s!==null&&s.visible&&!(isNaN(s.width)||isNaN(s.height))){let u=I.l().h(this.viewportBounds).unionRect(t.viewportBounds);t.ca(u),I.i(u),t.Te()}let n=this.v,o=this.Wt;o.scale(this.$e,this.$e),o.transform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),o.commitTransform();let r=this.viewportBounds,a=t.Vt.r,h=a.length,l=this.Vt.r;this.rs(l,l.length,this,this.viewportBounds);for(let u=0;u<h;u++)a[u].UR(o,r,this,e,i)}get observed(){return this.u1}set observed(t){let e=this.u1;if(t!==null&&m.se(t,Y,hi,"observed"),t instanceof hi&&m.o("Overview.observed Diagram may not be an Overview itself: "+t),e!==t){if(e!==null&&this.BO(e),this.u1=t,t!==null&&this.zO(t),this.invalidateDocumentBounds(),t===null){this.hf=null;let i=this.lt,s=this.Wt;i&&s&&(s.setTransform(1,0,0,1,0,0),s.clearRect(0,0,i.width,i.height))}else this.p1(null),this.Op(),this.C();this.t("observed",e,t)}}get box(){return this.Bl}set box(t){let e=this.Bl;e!==t&&(t.It(),this.Bl=t,this.remove(e),this.add(this.Bl),this.Op(),this.t("box",e,t))}get drawsTemporaryLayers(){return this.d1}set drawsTemporaryLayers(t){this.d1!==t&&(this.d1=t,this.redraw())}get drawsGrid(){return this.g1}set drawsGrid(t){this.g1!==t&&(this.g1=t,this.redraw())}get updateDelay(){return this.m1}set updateDelay(t){t<0&&(t=0),this.m1!==t&&(this.m1=t)}zO(t){t!==null&&(t.addDiagramListener("ViewportBoundsChanged",this.K2),t.addDiagramListener("DocumentBoundsChanged",this.H2),t.addDiagramListener("InvalidateDraw",this.p1),t.addDiagramListener("AnimationFinished",this.q2),this.add(this.box))}BO(t){t!==null&&(this.remove(this.box),t.removeDiagramListener("ViewportBoundsChanged",this.K2),t.removeDiagramListener("DocumentBoundsChanged",this.H2),t.removeDiagramListener("InvalidateDraw",this.p1),t.removeDiagramListener("AnimationFinished",this.q2))}Op(){let t=this.box,e=this.observed;if(e===null)return;this.qi=!0;let i=e.viewportBounds,s=t.selectionObject,n=st.l();n.e(i.width,i.height),s.desiredSize=n,st.i(n);let o=2/this.scale;s instanceof et&&(s.strokeWidth=o),t.location=new P(i.x-o/2,i.y-o/2),t.isSelected=!0}computeBounds(){let t=this.observed;if(t===null)return I.em;let e=t.documentBounds.copy();return e.unionRect(t.viewportBounds),e}invalidateViewport(t,e){this.qi!==!0&&(this.qi=!0,this.requestUpdate())}onViewportBoundsChanged(t,e,i,s){this.Ht||(this.ha(),this.C(),this.Nh(),this.invalidateDocumentBounds(),this.Op(),this.Ye.scale=i,this.Ye.position.x=t.x,this.Ye.position.y=t.y,this.Ye.bounds.h(t),this.Ye.isScroll=s,this.T("ViewportBoundsChanged",this.Ye,t))}}class En extends Tt{ua;constructor(){super(),this.ua=P.gn}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;if(t===null||!t.allowMove||!t.allowSelect)return!1;let e=t.observed;if(e===null)return!1;let i=t.lastInput;if(!i.left||t.currentTool!==this&&(!this.isBeyondDragSize()||i.isTouchEvent&&i.timestamp-t.firstInput.timestamp<this.delay))return!1;if(this.findDraggablePart()===null){let s=e.viewportBounds;this.ua=new P(s.width/2,s.height/2);let n=t.firstInput.documentPoint;e.position=new P(n.x-this.ua.x,n.y-this.ua.y)}return!0}doActivate(){this.ua=P.gn,super.doActivate()}doUpdateCursor(t){let e=this.diagram,i=e.box;i!==null&&i.cursor&&(e.currentCursor=i.cursor)}moveParts(t,e,i){i===void 0&&(i=!1);let s=this.diagram,n=s.observed;if(n===null)return;let o=s.box;if(o===null)return;if(!this.ua.isReal()){let a=s.firstInput.documentPoint,h=o.location;this.ua=new P(a.x-h.x,a.y-h.y)}let r=s.lastInput.documentPoint;n.position=new P(r.x-this.ua.x,r.y-this.ua.y)}}class jt{a;w1="go._clipboard";b1="go._clipboardFormat";j2;W2;J2;$2;Z2;Q2;_2;tN;eN;da;iN;k1;P1;S1;M1;sN;Ko;nN;oN;Ip;rN;N1;lN;C1;aN;hN;dd;Ep;Up;cN;Zc;fN;uN;dN;gN;mN;gd;pN;Oi;Ps;L1;Vp;static md=["Ctrl","Shft","Alt","Meta"];static zT=jt.yN(230,40,15);static XO=jt.yN(270,40,15);static GO=jt.yN(310,40,15);constructor(t){V.Je(this),this.a=Y.Om(),this.j2=!0,this.W2=!0,this.J2=!0,this.$2=!1,this.Z2=!1,this.Q2=!1,this._2=!1,this.tN="memory",this.eN=null,this.da=null,this.iN=1.05,this.k1=NaN,this.P1=P.gn,this.S1=NaN,this.M1=I.em,this.sN=!1,this.Ko=null,this.nN=200,this.oN=!1,this.Ip=new vt("Auto",{layerName:"Tool",pickable:!1,selectable:!1}).add(new G("Spot").add(new et({name:"SHAPE",fill:null,stroke:"lime",strokeWidth:4}).bindObject("stroke","adornedPart",e=>e.isSelected?"darkcyan":"lime"),new et({name:"SHAPE2",stretch:2,fill:null,stroke:"magenta",strokeWidth:4,strokeDashArray:[4,4]})),new le({padding:4})),this.rN=null,this.N1="",this.lN="",this.C1=m.fr,this.aN=!1,this.hN=!1,this.dd=new pt({layerName:"Tool",isInDocumentBounds:!1,locationObjectName:"CIRCLE",locationSpot:T.Center,pickable:!1,selectable:!1}).add(new et("Circle",{isGeometryPositioned:!0,width:30,height:30,fill:null,stroke:"darkcyan",strokeWidth:6,visible:!1}).bind("visible","down"),new et({isGeometryPositioned:!0,geometryString:"M15 0L15 30",stroke:"magenta"}),new et({isGeometryPositioned:!0,geometryString:"M0 15L30 15",stroke:"magenta"}),new et("Circle",{name:"CIRCLE",isGeometryPositioned:!0,width:20,height:20,fill:null,stroke:"magenta",position:new P(5,5)}),new et({isGeometryPositioned:!0,geometry:jt.zT,fill:null,stroke:"cyan",strokeWidth:4}).bind("geometry","button",jt.YO),new lt({position:new P(12,0),font:"bold 10pt sans-serif"}).bind("text","clickCount",e=>e>1?e.toString():""),new lt({position:new P(0,16)}).bind("text","modifiers",jt.KO)).freezeBindings(),this.Ep=10,this.Up=1,this.cN=null,this.Zc=e=>this.HO(e),this.fN=e=>this.qO(e),this.uN=e=>this.jO(e),this.dN=e=>this.WO(e),this.gN=null,this.mN="distance",this.gd=null,this.pN=0,this.Oi={},this.Ps=null,this.L1=!1,this.Vp=null,this.wN(),this.dd.data=this.Oi,t&&Object.assign(this,t)}toString(){return"CommandHandler"}get diagram(){return this.a}Io(t){this.a=t}doStart(){let t=this.a;t&&(t.addModelChangedListener(this.Zc),t.addDiagramListener("ViewportBoundsChanged",this.fN),t.addDiagramListener("GainedFocus",this.uN),t.addDiagramListener("LostFocus",this.dN))}doStop(){let t=this.a;t&&(t.removeDiagramListener("ViewportBoundsChanged",this.fN),t.removeDiagramListener("GainedFocus",this.uN),t.removeDiagramListener("LostFocus",this.dN),t.removeModelChangedListener(this.Zc))}doKeyDown(){let t=this.a,e=t.lastInput,i=e.control||e.meta,s=e.shift,n=e.alt,o=e.commandKey;i&&(o==="Insert"||o==="c")?this.canCopySelection()&&this.copySelection():i&&o==="x"||s&&o==="Delete"?this.canCutSelection()&&this.cutSelection():i&&o==="v"||s&&o==="Insert"?this.canPasteSelection()&&this.pasteSelection():i&&o==="y"||i&&s&&o==="z"||n&&s&&o==="Backspace"?this.canRedo()&&this.redo():i&&o==="z"||n&&o==="Backspace"?this.canUndo()&&this.undo():o==="Delete"||o==="Backspace"?this.canDeleteSelection()&&this.deleteSelection():i&&o==="a"?this.canSelectAll()&&this.selectAll():o==="Escape"?this.canStopCommand()&&this.stopCommand():this.XT.indexOf(o)>=0?this.JO(o,i,s):o==="PageUp"?s&&t.allowHorizontalScroll?t.scroll("page","left"):t.allowVerticalScroll&&t.scroll("page","up"):o==="PageDown"?s&&t.allowHorizontalScroll?t.scroll("page","right"):t.allowVerticalScroll&&t.scroll("page","down"):o==="Home"?i&&t.allowVerticalScroll?t.scroll("document","up"):!i&&t.allowHorizontalScroll&&t.scroll("document","left"):o==="End"?i&&t.allowVerticalScroll?t.scroll("document","down"):!i&&t.allowHorizontalScroll&&t.scroll("document","right"):o==="Space"?this.canScrollToPart()&&this.scrollToPart():o==="Minus"||o==="NumpadSubtract"?this.canDecreaseZoom()&&this.decreaseZoom():o==="Equal"||o==="NumpadAdd"?this.canIncreaseZoom()&&this.increaseZoom():i&&o==="Digit0"?this.canResetZoom()&&this.resetZoom():s&&o==="z"?this.canZoomToFit()&&this.zoomToFit():i&&!s&&o==="g"?this.canGroupSelection()&&this.groupSelection():i&&s&&o==="g"?this.canUngroupSelection()&&this.ungroupSelection():o==="F2"?this.canEditTextBlock()&&this.editTextBlock():o==="ContextMenu"||s&&o==="F10"||i&&s&&o==="Backslash"?this.canShowContextMenu()&&this.showContextMenu():e.bubbles=!0}doKeyUp(){let t=this.a.lastInput;t.bubbles=!0}stopCommand(){let t=this.a,e=t.currentTool;if(e instanceof ne){if(e.currentToolTip!==null){e.hideToolTip();return}t.allowSelect&&t.clearSelection()}e!==null&&e.doCancel()}canStopCommand(){return!0}selectAll(){let t=this.a;t.C();try{t.currentCursor="wait",t.T("ChangingSelection",t.selection);let e=t.parts;for(;e.next();){let n=e.value;n.canSelect()&&!n.layer.isTemporary&&(n.isSelected=!0)}let i=t.nodes;for(;i.next();){let n=i.value;n.canSelect()&&!n.layer.isTemporary&&(n.isSelected=!0)}let s=t.links;for(;s.next();){let n=s.value;n.canSelect()&&!n.layer.isTemporary&&(n.isSelected=!0)}}finally{t.T("ChangedSelection",t.selection),t.currentCursor=""}}canSelectAll(){return this.a.allowSelect}deleteSelection(){let t=this.a;try{t.currentCursor="wait",t.T("ChangingSelection",t.selection),t.startTransaction("Delete"),t.T("SelectionDeleting",t.selection);let e=new V,i=t.selection.iterator;for(;i.next();){let s=i.value;pt.ga(e,s,!0,this.deletesTree?1/0:0,this.deletesConnectedLinks?null:!1,n=>n.canDelete())}t.removeParts(e,!0),t.T("SelectionDeleted",e)}finally{t.commitTransaction("Delete"),t.T("ChangedSelection",t.selection),t.currentCursor=""}}canDeleteSelection(){let t=this.a;return!(t.isReadOnly||t.isModelReadOnly||!t.allowDelete||t.selection.count===0)}copySelection(){let t=this.a;try{let e=new V,i=t.selection.iterator;for(;i.next();){let s=i.value;pt.ga(e,s,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,n=>n.canCopy())}this.copyToClipboard(e)}finally{}}canCopySelection(){let t=this.a;return!(!t.allowCopy||!t.allowClipboard||t.selection.count===0)}cutSelection(){this.copySelection(),this.deleteSelection()}canCutSelection(){let t=this.a;return!(t.isReadOnly||t.isModelReadOnly||!t.allowCopy||!t.allowDelete||!t.allowClipboard||t.selection.count===0)}copyToClipboard(t){let e=this.a,i=this.storageLocation==="systemClipboard";if(i||this.storageLocation!=="memory")try{if(t===null)if(i&&X.navigator.clipboard)X.navigator.clipboard.writeText("");else{let n=X[this.storageLocation];if(!n)return;n.setItem(this.w1,""),n.setItem(this.b1,"")}else{let n=new Y;if(n.isTreePathToChildren=e.isTreePathToChildren,n.toolManager.draggingTool.dragsLink=e.toolManager.draggingTool.dragsLink,n.model=e.model.copy(),e.copyParts(t,n,!1),i&&X.navigator.clipboard)X.navigator.clipboard.writeText(n.model.toJson());else{let o=X[this.storageLocation];if(!o)return;o.setItem(this.w1,n.model.toJson()),o.setItem(this.b1,n.model.dataFormat)}}e.T("ClipboardChanged",t);return}catch{return}let s=null;if(t===null)Y.nT();else{let n=null;try{n=e.copyParts(t,null,!0)}finally{s=new q,n!==null&&s.addAll(n.iteratorValues),Y.Sp=s,Y.i1=e.model.dataFormat}}e.T("ClipboardChanged",s)}pasteFromClipboard(){let t=this.a;if(this.storageLocation!=="memory"){let n=new V;try{let o=X[this.storageLocation];if(!o)return n;let r=o.getItem(this.w1),a=o.getItem(this.b1);if(r===null||r===""||a!==t.model.dataFormat)return n;{let h=new Y;h.model=ut.fromJson(r);let l=new V;l.addAll(h.parts).addAll(h.nodes).addAll(h.links);let u=t.copyParts(l,t,!1);return new V().addAll(u.iteratorValues)}}catch{return n}}let e=new V,i=Y.Sp;if(i===null||Y.i1!==t.model.dataFormat)return e;let s=null;try{s=t.copyParts(i,t,!1)}finally{if(s!==null){let n=s.iterator;for(;n.next();){let o=n.value,r=n.key;o.location.isReal()||(r.location.isReal()?o.location=r.location:!o.position.isReal()&&r.position.isReal()&&(o.position=r.position)),e.add(o)}}}return e}async pasteSelectionAsync(t){let e=this.a;if(X.navigator.clipboard===void 0){m.ne('Cannot paste with storageLocation "clipboard", window.isSecureContext may be false.');return}try{e.currentCursor="wait",e.T("ChangingSelection",e.selection),e.startTransaction("Paste");let i=null,s=await X.navigator.clipboard.readText();try{let o=s;if(!(o===null||o==="")){let r=new Y;r.model=ut.fromJson(o);let a=new V;a.addAll(r.parts).addAll(r.nodes).addAll(r.links);let h=e.copyParts(a,e,!1);i=new V().addAll(h.iteratorValues)}}catch{}if(i===null)return;i.count>0&&e.clearSelection(!0);let n=i.iterator;for(;n.next();){let o=n.value;o.isSelected=!0}if(t){let o=e.computePartsBounds(e.selection);if(o.isReal()){let r=this.computeEffectiveCollection(e.selection,e.ld);e.Lx(r,new P(t.x-o.centerX,t.y-o.centerY),e.ld,!1)}}e.T("ClipboardPasted",i)}finally{e.commitTransaction("Paste"),e.T("ChangedSelection",e.selection),e.currentCursor=""}}pasteSelection(t){if(this.storageLocation==="systemClipboard"){this.pasteSelectionAsync(t);return}let e=this.a;try{e.currentCursor="wait",e.T("ChangingSelection",e.selection),e.startTransaction("Paste");let i=this.pasteFromClipboard();i.count>0&&e.clearSelection(!0);let s=i.iterator;for(;s.next();){let n=s.value;n.isSelected=!0}if(t){let n=e.computePartsBounds(e.selection);if(n.isReal()){let o=this.computeEffectiveCollection(e.selection,e.ld);e.Lx(o,new P(t.x-n.centerX,t.y-n.centerY),e.ld,!1)}}e.T("ClipboardPasted",i)}finally{e.commitTransaction("Paste"),e.T("ChangedSelection",e.selection),e.currentCursor=""}}canPasteSelection(t){let e=this.a;if(e.isReadOnly||e.isModelReadOnly||!e.allowInsert||!e.allowClipboard)return!1;if(this.storageLocation==="systemClipboard")return!0;if(this.storageLocation!=="memory")try{let i=X[this.storageLocation];if(!i)return!1;let s=i.getItem(this.w1),n=i.getItem(this.b1);return!(s===null||s===""||n!==e.model.dataFormat)}catch{return!1}return!(Y.Sp===null||Y.Sp.count===0||Y.i1!==e.model.dataFormat)}undo(){this.a.undoManager.undo()}canUndo(){let t=this.a;return t.isReadOnly||t.isModelReadOnly?!1:t.allowUndo&&t.undoManager.canUndo()}redo(){this.a.undoManager.redo()}canRedo(){let t=this.a;return t.isReadOnly||t.isModelReadOnly?!1:t.allowUndo&&t.undoManager.canRedo()}decreaseZoom(t){t===void 0&&(t=1/this.zoomFactor);let e=this.a;if(e.autoScale!==1)return;let i=e.scale*t;i<e.minScale||i>e.maxScale||(e.scale=i)}canDecreaseZoom(t){t===void 0&&(t=1/this.zoomFactor);let e=this.a;if(e.autoScale!==1)return!1;let i=e.scale*t;return i<e.minScale||i>e.maxScale?!1:e.allowZoom}increaseZoom(t){t===void 0&&(t=this.zoomFactor);let e=this.a;if(e.autoScale!==1)return;let i=e.scale*t;i<e.minScale||i>e.maxScale||(e.scale=i)}canIncreaseZoom(t){t===void 0&&(t=this.zoomFactor);let e=this.a;if(e.autoScale!==1)return!1;let i=e.scale*t;return i<e.minScale||i>e.maxScale?!1:e.allowZoom}resetZoom(t){t===void 0&&(t=this.defaultScale);let e=this.a;t<e.minScale||t>e.maxScale||(e.scale=t)}canResetZoom(t){t===void 0&&(t=this.defaultScale);let e=this.a;return t<e.minScale||t>e.maxScale?!1:e.allowZoom}zoomToFit(t){let e=this.a,i=e.animationManager;i.stopAnimation(),e.redraw();let s=e.position.copy(),n=e.scale;if(i.Gl("Zoom To Fit"),!t&&this.isZoomToFitRestoreEnabled&&n===this.S1&&!isNaN(this.k1)&&this.P1.isReal()&&e.documentBounds.equals(this.M1))e.scale=this.k1,e.position=this.P1,this.S1=NaN,this.M1=I.em;else{if(this.k1=n,this.P1=s,t){let o=t.copy();if(o.width>0&&o.height>0){let r=e.viewportBounds,a=r.width*n,h=r.height*n,l=Math.min(a/o.width,h/o.height),u=a/l,c=h/l;o.width<u&&(o.x-=(u-o.width)/2),o.height<c&&(o.y-=(c-o.height)/2)}e.zoomToRect(o,2)}else e.zoomToFit();this.S1=e.scale,this.M1=e.documentBounds.copy()}i.MM()}canZoomToFit(t){return this.a.allowZoom}JO(t,e,i){let s=this.a;t==="ArrowUp"?s.allowVerticalScroll&&(e?s.scroll("pixel","up"):s.scroll("line","up")):t==="ArrowDown"?s.allowVerticalScroll&&(e?s.scroll("pixel","down"):s.scroll("line","down")):t==="ArrowLeft"?s.allowHorizontalScroll&&(e?s.scroll("pixel","left"):s.scroll("line","left")):t==="ArrowRight"&&s.allowHorizontalScroll&&(e?s.scroll("pixel","right"):s.scroll("line","right"))}scrollToPart(t){t===void 0&&(t=null),t!==null&&m.se(t,pt,jt,"part");let e=this.a;if(e.ensureBounds(),t===null){try{this.Ko!==null&&(this.Ko.next()?t=this.Ko.value:this.Ko=null)}catch{this.Ko=null}t===null&&(e.highlighteds.count>0?this.Ko=e.highlighteds.iterator:e.selection.count>0&&(this.Ko=e.selection.iterator),this.Ko!==null&&this.Ko.next()&&(t=this.Ko.value))}if(t!==null){let i=e.animationManager;i.Gl("Scroll To Part");let s=this.scrollToPartPause;if(s>0){let n=this.cf(t,[t]);if(n.length===1)e.startTransaction(),e.centerRect(t.actualBounds),e.commitTransaction("Scroll To Part");else{let o=()=>{e.startTransaction();let a=n.pop();for(;n.length>0&&a instanceof J&&a.isTreeExpanded&&(!(a instanceof ht)||a.isSubGraphExpanded);)a=n.pop();n.length>0?(a instanceof pt&&e.scrollToRect(a.actualBounds),a instanceof J&&!a.isTreeExpanded&&(a.isTreeExpanded=!0),a instanceof ht&&!a.isSubGraphExpanded&&(a.isSubGraphExpanded=!0)):(a instanceof pt&&e.centerRect(a.actualBounds),e.removeDiagramListener("LayoutCompleted",r)),e.commitTransaction("Scroll To Part")},r=()=>{m.un(o,(i.isEnabled?i.duration:0)+s)};e.addDiagramListener("LayoutCompleted",r),o()}}else{let n=e.position.copy();e.centerRect(t.actualBounds),n.equalsApprox(e.position)&&i.stopAnimation()}}}cf(t,e){if(t.isVisible())return e;if(t instanceof vt){let i=t.adornedPart;i!==null&&this.cf(i,e)}else if(t instanceof j){let i=t.fromNode;i!==null&&this.cf(i,e);let s=t.toNode;s!==null&&this.cf(s,e)}else{if(t instanceof J){let s=t.labeledLink;s!==null&&this.cf(s,e);let n=t.findTreeParentNode();n!==null&&(!n.isTreeExpanded&&!n.wasTreeExpanded&&e.push(n),this.cf(n,e))}let i=t.containingGroup;i!==null&&(!i.isSubGraphExpanded&&!i.wasSubGraphExpanded&&e.push(i),this.cf(i,e))}return e}canScrollToPart(t){if(t===void 0&&(t=null),t!==null&&!(t instanceof pt))return!1;let e=this.a;return e.selection.count===0&&e.highlighteds.count===0?!1:e.allowHorizontalScroll&&e.allowVerticalScroll}collapseTree(t){t===void 0&&(t=null);let e=this.a,i="Collapse Tree";try{e.startTransaction(i),e.animationManager.Gl(i);let s=new q;if(t!==null&&t.isTreeExpanded)t.collapseTree(),s.add(t);else if(t===null){let n=e.selection.iterator;for(;n.next();){let o=n.value;o instanceof J&&o.isTreeExpanded&&(o.collapseTree(),s.add(o))}}e.T("TreeCollapsed",s)}finally{e.commitTransaction(i)}}canCollapseTree(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly)return!1;if(t!==null){if(!(t instanceof J)||!t.isTreeExpanded)return!1;if(t.findTreeChildrenLinks().count>0)return!0}else{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof J){if(!s.isTreeExpanded)continue;if(s.findTreeChildrenLinks().count>0)return!0}}}return!1}expandTree(t){t===void 0&&(t=null);let e=this.a,i="Expand Tree";try{e.startTransaction(i),e.animationManager.Gl(i);let s=new q;if(t!==null&&!t.isTreeExpanded)t.expandTree(),s.add(t);else if(t===null){let n=e.selection.iterator;for(;n.next();){let o=n.value;o instanceof J&&(o.isTreeExpanded||(o.expandTree(),s.add(o)))}}e.T("TreeExpanded",s)}finally{e.commitTransaction(i)}}canExpandTree(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly)return!1;if(t!==null){if(!(t instanceof J)||t.isTreeExpanded)return!1;if(t.findTreeChildrenLinks().count>0)return!0}else{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof J){if(s.isTreeExpanded)continue;if(s.findTreeChildrenLinks().count>0)return!0}}}return!1}groupSelection(){let t=this.a,e=t.model;if(!e.ff())return;let i=this.archetypeGroupData;if(i===null)return;let s=null;try{t.currentCursor="wait",t.T("ChangingSelection",t.selection),t.startTransaction("Group");let n=new q,o=t.selection.iterator;for(;o.next();){let l=o.value;l.Di()&&l.canGroup()&&n.add(l)}let r=new q,a=n.iterator;for(;a.next();){let l=a.value,u=!1,c=n.iterator;for(;c.next();){let d=c.value;if(l.isMemberOf(d)){u=!0;break}}u||r.add(l)}let h=r.first();if(h!==null){let l=h.containingGroup;if(l!==null)for(;l!==null;){let u=!1,c=r.iterator;for(;c.next();)if(!c.value.isMemberOf(l)){u=!0;break}if(u)l=l.containingGroup;else break}if(i instanceof ht)i.It(),s=i.copy(),s!==null&&t.add(s);else if(e.isGroupForData(i)){let u=e.copyNodeData(i);e.addNodeData(u),s=t.findNodeForData(u)}if(s!==null){l!==null&&this.isValidMember(l,s)&&(s.containingGroup=l);let u=r.iterator;for(;u.next();){let c=u.value;this.isValidMember(s,c)&&(c.containingGroup=s)}t.clearSelection(!0),s.isSelected=!0}}t.T("SelectionGrouped",s)}finally{t.commitTransaction("Group"),t.T("ChangedSelection",t.selection),t.currentCursor=""}}canGroupSelection(){let t=this.a;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowGroup||!t.model.ff()||this.archetypeGroupData===null)return!1;let e=t.selection.iterator;for(;e.next();){let i=e.value;if(i.Di()&&i.canGroup())return!0}return!1}xN(t){let e=m.nt();if(Array.isArray(t))t.forEach(n=>{n instanceof j||n instanceof pt&&e.push(n)});else{let n=t.iterator;for(;n.next();){let o=n.value;o instanceof j||o instanceof pt&&e.push(o)}}let i=new V,s=e.length;for(let n=0;n<s;n++){let o=e[n],r=!0;for(let a=0;a<s;a++)if(o.isMemberOf(e[a])){r=!1;break}r&&i.add(o)}return m.Z(e),i}isValidMember(t,e){if(e===null||t===e||e instanceof j)return!1;let i;return t!==null&&(t===e||t.isMemberOf(e)||(i=t.memberValidation,i!==null&&!i(t,e))||t.data===null&&e.data!==null||t.data!==null&&e.data===null)?!1:(i=this.memberValidation,i!==null?i(t,e):!0)}ungroupSelection(t){t===void 0&&(t=null);let e=this.a,i=e.model;if(i.ff())try{e.currentCursor="wait",e.T("ChangingSelection",e.selection),e.startTransaction("Ungroup");let s=new q;if(t!==null)s.add(t);else{let o=e.selection.iterator;for(;o.next();){let r=o.value;r instanceof ht&&r.canUngroup()&&s.add(r)}}let n=new q;if(s.count>0){e.clearSelection(!0);let o=s.iterator;for(;o.next();){let r=o.value;r.expandSubGraph();let a=r.containingGroup,h=a!==null&&a.data!==null?i.getKeyForNodeData(a.data):void 0;n.addAll(r.memberParts);let l=n.iterator;for(;l.next();){let u=l.value;if(u.isSelected=!0,u instanceof j)continue;let c=u.data;c!==null?i.setGroupForData(c,h):u.containingGroup=a}e.remove(r)}}e.T("SelectionUngrouped",s,n)}finally{e.commitTransaction("Ungroup"),e.T("ChangedSelection",e.selection),e.currentCursor=""}}canUngroupSelection(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly||e.isModelReadOnly||!e.allowDelete||!e.allowUngroup||!e.model.ff())return!1;if(t!==null){if(!(t instanceof ht))return!1;if(t.canUngroup())return!0}else{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof ht&&s.canUngroup())return!0}}return!1}addTopLevelParts(t,e){let i=this.xN(t),s=!0,n=i.iterator;for(;n.next();){let o=n.value;o.containingGroup!==null&&(!e||this.isValidMember(null,o)?o.containingGroup=null:s=!1)}return s}collapseSubGraph(t){t===void 0&&(t=null);let e=this.a,i="Collapse SubGraph";try{e.startTransaction(i),e.animationManager.Gl(i);let s=new q;if(t!==null&&t.isSubGraphExpanded)t.collapseSubGraph(),s.add(t);else if(t===null){let n=e.selection.iterator;for(;n.next();){let o=n.value;o instanceof ht&&o.isSubGraphExpanded&&(o.collapseSubGraph(),s.add(o))}}e.T("SubGraphCollapsed",s)}finally{e.commitTransaction(i)}}canCollapseSubGraph(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly)return!1;if(t!==null)return!(!(t instanceof ht)||!t.isSubGraphExpanded);{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof ht&&s.isSubGraphExpanded)return!0}}return!1}expandSubGraph(t){t===void 0&&(t=null);let e=this.a,i="Expand SubGraph",s=new q;try{if(e.startTransaction(i),e.animationManager.Gl(i),t!==null&&!t.isSubGraphExpanded)t.expandSubGraph(),s.add(t);else if(t===null){let n=e.selection.iterator;for(;n.next();){let o=n.value;o instanceof ht&&(o.isSubGraphExpanded||(o.expandSubGraph(),s.add(o)))}}e.T("SubGraphExpanded",s)}finally{for(let n of s)this.GT(e,n);t&&this.GT(e,t),e.commitTransaction(i)}}GT(t,e){for(let i of e.memberParts)i instanceof J&&t.Gc(i,e)}canExpandSubGraph(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly)return!1;if(t!==null)return!(!(t instanceof ht)||t.isSubGraphExpanded);{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof ht&&!s.isSubGraphExpanded)return!0}}return!1}editTextBlock(t){t===void 0&&(t=null),t!==null&&m.se(t,lt,jt,"editTextBlock");let e=this.a,i=e.toolManager.findTool("TextEditing");if(i!==null){if(t===null){let s=null,n=e.selection.iterator;for(;n.next();){let o=n.value;if(o.canEdit()){s=o;break}}if(s===null)return;t=s.findInVisualTree(o=>o instanceof lt&&o.editable)}t!==null&&(e.currentTool=null,i.textBlock=t,e.currentTool=i)}}canEditTextBlock(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly||e.isModelReadOnly||!e.allowTextEdit||e.toolManager.findTool("TextEditing")===null)return!1;if(t!==null){if(!(t instanceof lt))return!1;let i=t.part;if(i!==null&&i.canEdit())return!0}else{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s.canEdit()&&(t=s.findInVisualTree(n=>n instanceof lt&&n.editable),t!==null))return!0}}return!1}showContextMenu(t){let e=this.a,i=e.toolManager.findTool("ContextMenu");if(i===null)return;t===void 0&&(t=null),t===null&&(e.selection.count>0?t=e.selection.first():t=e);let s=i.findObjectWithContextMenu(t);if(s!==null){let n=e.lastInput,o;if(s instanceof $?o=s.getDocumentPoint(T.Center):e.viewportBounds.containsPoint(n.documentPoint)?o=P.gn:o=e.viewportBounds.center,o.isReal()){let r=new Qt;r.diagram=e,r.viewPoint=e.transformDocToView(o),r.documentPoint=o,r.button=2,r.up=!0,e.lastInput=r}e.currentTool=i,i.openMenu(!1,s)}}canShowContextMenu(t){let e=this.a,i=e.toolManager.findTool("ContextMenu");return!(i===null||(t===void 0&&(t=null),t===null&&(e.selection.count>0?t=e.selection.first():t=e),i.findObjectWithContextMenu(t)===null))}downloadSvg(t){let e=this.a,i={scale:1,background:e.div?e.div.style.backgroundColor:"white",name:this.$O("svg")};t&&Object.assign(i,t);let s=e.makeSvg(i);if(s!==null){let n=new XMLSerializer().serializeToString(s);this.ZO(i.name,"image/svg+xml",n)}}downloadSVG(t){this.downloadSvg(t)}canDownloadSvg(t){return this.a!==null}ZO(t,e,i){let s=null,n=null;try{let o=new Blob([i],{type:e});s=X.URL.createObjectURL(o),n=m.Ni("a"),n.style.display="none",n.href=s,n.download=t,X.document.body.appendChild(n),requestAnimationFrame(()=>{try{n!==null&&n.click()}finally{s!==null&&X.URL.revokeObjectURL(s),n!==null&&X.document.body.removeChild(n)}})}catch{s!==null&&X.URL.revokeObjectURL(s),n!==null&&X.document.body.removeChild(n)}}$O(t){let e="."+t,i=this.diagram.model.name;return i?i.endsWith(e)&&(i=i.substring(0,i.length-e.length)):i="diagram",i+=e,i}get copiesClipboardData(){return this.j2}set copiesClipboardData(t){this.j2=!!t}get copiesConnectedLinks(){return this.W2}set copiesConnectedLinks(t){this.W2=!!t}get deletesConnectedLinks(){return this.J2}set deletesConnectedLinks(t){this.J2=!!t}get copiesTree(){return this.$2}set copiesTree(t){this.$2=!!t}get deletesTree(){return this.Z2}set deletesTree(t){this.Z2=!!t}get copiesParentKey(){return this.Q2}set copiesParentKey(t){this.Q2=!!t}get copiesGroupKey(){return this._2}set copiesGroupKey(t){this._2=!!t}get storageLocation(){return this.tN}set storageLocation(t){t||(t="memory"),t!=="memory"&&t!=="sessionStorage"&&t!=="localStorage"&&t!=="systemClipboard"&&m.o("Invalid new value for CommandHandler.storageLocation: "+t),this.tN=t}get archetypeGroupData(){return this.eN}set archetypeGroupData(t){t!==null&&m.wc(t,jt,"archetypeGroupData");let e=this.a;this.eN=t}get memberValidation(){return this.da}set memberValidation(t){t!==null&&m.S(t,jt,"memberValidation"),this.da=t}get defaultScale(){return this.diagram.defaultScale}set defaultScale(t){this.diagram.defaultScale=t}get zoomFactor(){return this.iN}set zoomFactor(t){t>1||m.o("zoomFactor must be larger than 1.0, not: "+t),this.iN=t}get isZoomToFitRestoreEnabled(){return this.sN}set isZoomToFitRestoreEnabled(t){this.sN=!!t}get scrollToPartPause(){return this.nN}set scrollToPartPause(t){this.nN=t}computeEffectiveCollection(t,e){let i=this.a,s=i.toolManager.findTool("Dragging"),n=i.currentTool===s;e===void 0&&(e=i.Tp());let o=new Mt;if(t===null)return o;let r=t.iterator;for(;r.next();){let a=r.value;i._r(o,a,n,e)}if(i.draggedLink!==null&&e.dragsLink)return o;for(r=t.iterator;r.next();){let a=r.value;if(a instanceof j){let h=a.fromNode;if(h!==null&&!o.has(h))o.delete(a);else{let l=a.toNode;l!==null&&!o.has(l)&&o.delete(a)}}}return o}static getModifierNames(){return jt.md}static setModifierNames(t){jt.md=t}static KO(t){let e="";return t&1&&(e+=jt.md[0]||""),t&4&&(e+=jt.md[1]||""),t&2&&(e+=jt.md[2]||""),t&8&&(e+=jt.md[3]||""),e}static YO(t){return t===1?jt.XO:t===2?jt.GO:jt.zT}static yN(t,e,i){var s=new P(i,0).rotate(t-e/2),n=new wt().add(new Kt(-i,-i)).add(new Kt(i,i)).add(new Kt(s.x,s.y).add(new mt(5,t-e/2,e,0,0,i,i)));return n.offset(i,i),n}HO(t){t.isTransactionFinished&&this.updateFocusBox()}qO(t){if(t.subject.scale===this.diagram.scale)return;let e=4/this.diagram.scale,i=this.focusBox.findObject("SHAPE");i!==null&&(i.strokeWidth=e);let s=this.focusBox.findObject("SHAPE2");s!==null&&(s.strokeWidth=e,s.strokeDashArray=[e,e]);let n=this.focusBox.placeholder;n!==null&&(n.padding=e)}jO(t){this.focus===null?m.un(()=>{this.focus=this.findFirstFocus()},500):this.onFocusChanged(this.focus,this.focus)}WO(t){this.isVirtualPointerShown=!1}get isFocusEnabled(){return this.oN}set isFocusEnabled(t){t=!!t;let e=this.isFocusEnabled;t!==e&&(t||(this.isVirtualPointerShown=!1,this.gN=this.focus,this.focus=null),this.oN=t,t&&(this.focus=this.gN,this.updateFocusBox()))}get focusBox(){return this.Ip}set focusBox(t){if(!(t instanceof vt))return;let e=this.Ip;if(t!==e&&(this.Ip=t,e.adornedObject!==null)){let i=e.adornedPart;i!==null&&i.removeAdornment("Focus"),t.adornedObject=e.adornedObject,i!==null&&i.addAdornment("Focus",t)}}get focus(){return this.Ip.adornedObject}set focus(t){let e=this.focus;if(t!==e){let i=this.a;if(!i||!this.isFocusEnabled||t!==null&&t.diagram!==i)return;i.currentTool instanceof It||this.cancelVirtualPointer();let s=this.focusBox.adornedPart;s&&s.removeAdornment("Focus"),t===null?(this.gd=null,this.virtualPointerLocation=i.viewportBounds.center,this.focusBox.adornedObject=null):(this.virtualPointerLocation=t.getDocumentPoint(T.Center),this.focusBox.adornedObject=t,this.updateFocusBox()),this.onFocusChanged(e,t)}}onFocusChanged(t,e){let i=this.a;if(i&&(this.focusChanged!==null?this.focusChanged(t,e,this):this.QO(this.describe(t,e)),e!==null&&e.part!==null)){let s=e.getDocumentBounds();i.viewportBounds.containsRect(s)||(e instanceof pt?i.commandHandler.scrollToPart(e):i.scrollToRect(s))}}get focusChanged(){return this.rN}set focusChanged(t){t!==null&&m.S(t,jt,"focusChanged"),this.rN=t}get liveElementId(){return this.N1||this.lN}set liveElementId(t){let e=this.N1;t!==e&&(this.N1=t,this.bN())}bN(){let t=this.diagram;if(!t||!Y.isUsingDOM())return;let e=t.lt?.bt;if(!e)return;let i=this.liveElementId,s=X.document.getElementById(i);this.isUsingAriaLive?(e.removeAttribute("aria-labelledby"),s&&s.setAttribute("aria-live","polite")):(i&&e.setAttribute("aria-labelledby",i),s&&s.removeAttribute("aria-live"))}get isUsingAriaLive(){return this.C1}set isUsingAriaLive(t){let e=this.C1;t!==e&&(this.C1=t,this.bN())}QO(t){let e=this.diagram;if(!e||!Y.isUsingDOM()||!e.div)return;let i=this.liveElementId;if(!i){let n=m.Ni("span"),o=n.style;for(o.opacity="0",o.position="absolute",o.right="-9999px",o.bottom="-9999px",o.width="0px",o.height="0px",o.overflow="hidden",o.border="0",i=(e.div.id||"diagram")+"_aria";X.document.getElementById(i);)i+=Math.floor(Math.random()*10);n.id=i,this.lN=i,e.div.appendChild(n),this.bN()}let s=X.document.getElementById(i);s&&(s.textContent=t)}describe(t,e){let i="";e instanceof J?e instanceof ht?i="Group":i="Node":e instanceof j?i="Link":e instanceof pt?i="Part":e&&(e.click?i="button":e instanceof lt&&e.editable&&(i="editable"),e.portId!==null&&(i&&(i+=" "),i+="port",e.portId&&(i+=" "+e.portId)));let s=this.kN(e);s&&(i+=" "+s);let n=e;if(t&&n instanceof j&&n.fromNode&&n.toNode){if(t instanceof J&&t.part===n.fromNode||t instanceof j&&t.fromNode===n.fromNode){i+=" to "+this.kN(n.toNode,!0);let o=n.toPort?.portId;o&&(i+=" port "+o)}else if(t instanceof J&&t.part===n.toNode||t instanceof j&&t.toNode===n.toNode){i+=" from "+this.kN(n.fromNode,!0);let o=n.fromPort?.portId;o&&(i+=" port "+o)}}return i}kN(t,e){if(e===void 0&&(e=!1),!t)return"";if(t instanceof lt&&t.text)return t.text;if(t instanceof G){let i="";return t instanceof pt&&t.text&&(i=t.text),e&&i||t.walkVisualTreeFrom(t,(s,n)=>{n.isVisibleObject()&&n instanceof lt&&n.text&&(!e||!i)&&i!==n.text&&(i+=" "+n.text)}),i}return""}updateFocusBox(){let t=this.focus;if(t!==null)if(t.diagram!==null&&(t instanceof pt?t.isVisible():t.isVisibleObject()&&t.part?.isVisible()))this.focusBox.adornedObject=t,t.part?.addAdornment("Focus",this.focusBox);else{let e=null;if(t instanceof pt||(e=t.part),e instanceof pt&&e.isVisible())this.focus=e;else{if(e instanceof J&&!e.isVisible()){let i=e.findTreeParentNode();if(i!==null)e=i;else{let s=e.labeledLink;s!==null&&(e=s)}}for(;e instanceof pt&&!e.isVisible();)e=e.containingGroup;e instanceof pt&&e.isVisible()?this.focus=e:this.focus=null}}}findFirstFocus(){let t=this.a;if(t===null||!t.isEnabled)return null;if(this.focus!==null)return this.focus;if(this.isFocusEnabled)if(t.selection.count>0)this.focus=t.selection.first();else{let e=this.YT(t.isTreePathToChildren).first();if(e!==null)return e}return null}get isVirtualPointerEnabled(){return this.aN}set isVirtualPointerEnabled(t){t=!!t;let e=this.isVirtualPointerEnabled;if(t!==e&&(this.aN=t,t)){let i=this.Vp;i&&(this.Vp=null,i.commandHandler.Ps=null,i.commandHandler.cancelVirtualPointer())}}get isVirtualPointerShown(){return this.hN}set isVirtualPointerShown(t){t=!!t;let e=this.isVirtualPointerShown;if(t!==e){let i=this.a;if(!i||!this.isVirtualPointerEnabled)return;this.hN=t;let s=this.focus;t?this.virtualPointerBox.diagram===null&&(this.virtualPointerLocation.isReal()||(s!==null?this.virtualPointerLocation=s.getDocumentPoint(T.Center):this.virtualPointerLocation=i.viewportBounds.center),i.add(this.virtualPointerBox),this.ma()):this.virtualPointerBox.diagram!==null&&(i.remove(this.virtualPointerBox),this.ma())}}cancelVirtualPointer(){let t=this.a;t&&(this.wN(),this.isVirtualPointerShown=!1,t.currentTool.doCancel(),this.isVirtualPointerDown=!1,this.PN())}PN(){let t=this.Ps;if(t!==null){this.Ps=null;let e=t.commandHandler;e.Ps=null,e.Vp=null,e.isVirtualPointerShown=!1,e.isVirtualPointerDown=!1,e.wN(),this.L1&&(e.isVirtualPointerEnabled=!1),this.L1=!1}}wN(){this.Oi.button=0,this.Oi.modifiers=0,this.Oi.clickCount=1,this.Oi.down=!1,this.ma()}ma(){this.virtualPointerChanged!==null&&this.virtualPointerChanged(this.virtualPointerBox,this),this.updateVirtualPointer()}updateVirtualPointer(){let t=this.virtualPointerBox.diagram;t&&(this.virtualPointerBox.scale=1/t.scale),this.virtualPointerBox.updateTargetBindings()}get virtualPointerBox(){return this.dd}set virtualPointerBox(t){if(!(t instanceof pt))return;let e=this.dd;t!==e&&(e!==null&&(t.location=e.location,e.diagram!==null&&e.diagram.remove(e)),this.dd=t,this.isVirtualPointerShown&&this.diagram&&(this.diagram.add(t),t.data=e.data),this.ma())}get virtualPointerChanged(){return this.cN}set virtualPointerChanged(t){t!==null&&m.S(t,jt,"virtualPointerChanged"),this.cN=t}get virtualPointerLocation(){return this.virtualPointerBox.location}set virtualPointerLocation(t){this.virtualPointerLocation.equals(t)||this.KT(t.x,t.y)}get isVirtualPointerDown(){return this.virtualPointerBox.data?this.virtualPointerBox.data.down:!1}set isVirtualPointerDown(t){t=!!t;let e=this.isVirtualPointerDown;if(t!==e){let i=this.a;if(!i||!this.isVirtualPointerEnabled||(this.virtualPointerBox.data===null&&(this.dd.data=this.Oi),this.virtualPointerBox.data.down=t,this.ma(),!this.isVirtualPointerShown))return;let s=i.lastInput,n=new Qt;n.diagram=i,this.HT(n,t),t?n.down=!0:n.up=!0,n.clickCount=1,n.button=this.Oi.button,n.modifiers=this.Oi.modifiers,t&&(i.firstInput=n.copy()),this.pd(n,!0),t||this.Oi.clickCount===2&&(n.clickCount=2,n.down=!0,n.up=!1,this.pd(n,!0),n.down=!1,n.up=!0,this.pd(n,!0),this.qT(1)),i.lastInput=s}}get virtualPointerShiftMove(){return this.Ep}set virtualPointerShiftMove(t){this.Ep=t}get virtualPointerControlMove(){return this.Up}set virtualPointerControlMove(t){this.Up=t}Bp(t,e){this.KT(this.virtualPointerLocation.x+t,this.virtualPointerLocation.y+e)}KT(t,e){this.virtualPointerBox.moveTo(t,e,!0);let i=this.a;if(!i||!this.isVirtualPointerEnabled||!this.isVirtualPointerShown)return;i.ensureBounds();let s=i.lastInput,n=new Qt;n.diagram=i,this.HT(n,this.isVirtualPointerDown),n.button=this.Oi.button,n.modifiers=this.Oi.modifiers,this.pd(n,!0),i.lastInput=s,this.isVirtualPointerDown&&(i.remove(this.virtualPointerBox),i.add(this.virtualPointerBox)),this.ma()}HT(t,e){let i=this.a;if(i){if(t.targetDiagram=i,t.documentPoint=this.virtualPointerLocation,i.allowDragOut){let s=i.div.getBoundingClientRect(),n=i.transformDocToView(this.virtualPointerLocation),o=s.x+n.x,r=s.y+n.y,a=X.document.elementFromPoint(o,r)||null;a instanceof HTMLCanvasElement&&(a=a.parentElement),a!==null&&a.shadowRoot&&(a=a.shadowRoot.elementFromPoint(o,r)||null,a instanceof HTMLCanvasElement&&(a=a.parentElement));let h=null;if(a instanceof HTMLElement&&(h=Y.ji.get(a))&&h!==i&&h.div){let l=h.div.getBoundingClientRect(),u=new P(n.x-(l.x-s.x),n.y-(l.y-s.y));this.Ps!==null&&this.Ps!==h&&this.PN(),t.targetDiagram=h,t.viewPoint=u,t.documentPoint=h.transformViewToDoc(u),t.viewPoint=h.transformDocToView(t.documentPoint),this.Ps=h;let c=h.commandHandler;this.L1=!c.isVirtualPointerEnabled,c.isVirtualPointerEnabled=!0,c.isVirtualPointerDown=e,c.virtualPointerLocation=t.documentPoint,c.isVirtualPointerShown=!0,c.Vp=i;return}}this.Ps!==null&&this.PN(),t.viewPoint=i.transformDocToView(t.documentPoint)}}pd(t,e){this.doVirtualPointerEvent(t,e)}doVirtualPointerEvent(t,e){let i=this.a;i&&(t.timestamp=Date.now(),i.lastInput=t,e&&(t.up?i.doMouseUp():t.down?i.doMouseDown():i.doMouseMove()),this.onVirtualPointerEvent(t,e))}onVirtualPointerEvent(t,e){let i=this.a;i&&(t.up?this.isVirtualPointerDown&&!i.viewportBounds.containsPoint(this.virtualPointerLocation)&&(this.virtualPointerLocation=this.focus instanceof $?this.focus.getDocumentPoint(T.Center):i.viewportBounds.center):t.down)}doVirtualFocusKeyDown(){let t=this.a;if(!t)return!1;let e=t.lastInput,i=e.commandKey;if(this.isVirtualPointerEnabled&&(i==="ShiftLeft"||i==="ShiftRight"))return this.isVirtualPointerShown=!0,!0;if(this.XT.indexOf(i)>=0)if(e.shift&&this.isVirtualPointerShown){let s=this.A1(i),n=e.control||e.meta?this.Up:this.Ep;s===270?this.Bp(0,-n):s===90?this.Bp(0,n):s===180?this.Bp(-n,0):this.Bp(n,0)}else this._O();else if(e.shift&&this.isVirtualPointerShown&&(i==="Numpad1"||i==="Numpad2"||i==="Numpad3"||i==="Numpad4"||i==="Numpad6"||i==="Numpad7"||i==="Numpad8"||i==="Numpad9")){let s=e.control||e.meta?this.Up:this.Ep,n=0;i==="Numpad1"||i==="Numpad4"||i==="Numpad7"?n=-s:(i==="Numpad3"||i==="Numpad6"||i==="Numpad9")&&(n=s);let o=0;i==="Numpad7"||i==="Numpad8"||i==="Numpad9"?o=-s:(i==="Numpad1"||i==="Numpad2"||i==="Numpad3")&&(o=s),this.Bp(n,o)}else if(i==="Enter"||i==="NumpadEnter"||i==="Numpad5")e.shift&&this.isVirtualPointerShown?this.isVirtualPointerDown=!this.isVirtualPointerDown:this.tI();else if(i==="Escape")this.eI();else if(i==="Space")this.iI();else if(i==="ContextMenu"||e.shift&&i==="F10"||(e.control||e.meta)&&e.shift&&i==="Backslash")this.sI();else if(e.shift&&i==="c")this.T1(1);else if(e.shift&&i==="a")this.T1(2);else if(e.shift&&i==="KeyS")this.T1(4);else if(e.shift&&i==="KeyM")this.T1(8);else if(e.shift&&i==="Digit1")this.D1(0);else if(e.shift&&i==="Digit2")this.D1(1);else if(e.shift&&i==="Digit3")this.D1(2);else if(e.shift&&i==="Numpad0"){let s=this.Oi.button;this.D1(s===2?0:2)}else if(e.shift&&(i==="KeyD"||i==="NumpadDecimal")){let s=this.Oi.clickCount;this.qT(s===2?1:2)}else if(e.shift&&i==="KeyF"){let s=this.nextFocusFormula;this.nextFocusFormula=s==="distance"?"linear":"distance"}else if(e.shift&&i==="y")this.isUsingAriaLive=!this.isUsingAriaLive;else return!1;return!0}doVirtualFocusKeyUp(){let t=this.a;if(!t)return!1;let e=t.lastInput.commandKey;return this.isVirtualPointerEnabled&&(e==="ShiftLeft"||e==="ShiftRight")&&(this.isVirtualPointerShown=!1),!0}A1(t){switch(t){case"ArrowDown":return 90;case"ArrowLeft":return 180;case"ArrowUp":return 270;default:return 0}}XT=["ArrowRight","ArrowDown","ArrowLeft","ArrowUp"];T1(t){let e=this.Oi.modifiers;this.Oi.modifiers=e&t?e&~t:e|t,this.ma()}qT(t){this.Oi.clickCount=t,this.ma()}D1(t){this.Oi.button=t,this.ma()}_O(){let t=this.a;if(!t)return;let e=t.lastInput,i=this.focus;if(i===null){let s=this.YT(t.isTreePathToChildren).first();s!==null&&(this.focus=s)}else if(i instanceof j)this.nI(i);else if(i instanceof J)this.oI(i);else{i instanceof pt&&(this.gd=null);let s=this.A1(e.commandKey);s===270?this.focus=this.findNextFocus(270):s===90?this.focus=this.findNextFocus(90):s===180?this.focus=this.findNextFocus(180):this.focus=this.findNextFocus(0)}}nI(t){let e=this.a;if(!e)return;let i=e.lastInput,s=this.A1(i.commandKey),n=null,o=this.gd;if(o!==null){let r=this.pN;if(s===r)n=t.getOtherNode(o);else if(s===C.Ee(r+180))n=o;else{let a=r===0||r===180?90:0,h=r===0||r===180?270:180;if(s===a){let l=this.SN(o,r,!0),u=l.indexOf(t);u>=0&&u<l.count-1&&(this.focus=l.elt(u+1))}else if(s===h){let l=this.SN(o,r,!0),u=l.indexOf(t);u>0&&(this.focus=l.elt(u-1))}}}else{let r=t.fromNode,a=t.toNode;if(!r||!a)return;s===270?n=r.location.y<a.location.y?r:a:s==90?n=r.location.y>a.location.y?r:a:s===180?n=r.location.x<a.location.x?r:a:n=r.location.x>a.location.x?r:a}for(;n!==null&&!n.isVisible();)n=n.containingGroup;n!==null&&(this.focus=n)}oI(t){let e=this.a;if(!e)return;let i=e.lastInput,s=this.A1(i.commandKey);if(i.control||i.meta){let n=this.SN(t,s,!0).first();n&&(this.gd=t,this.pN=s,this.focus=n)}else this.gd=null,this.focus=this.findNextFocus(s)}SN(t,e,i){if(t===null)return new q;let s=t.actualBounds;if(!s.isReal())return new q;let n=new Set;(t instanceof ht?t.findExternalLinksConnected():t.findLinksConnected()).each(r=>{if(!r.isVisible())return;let a=null;if(r.fromNode===t?a=r.toNode:r.toNode===t?a=r.fromNode:t instanceof ht&&(r.fromNode?.isMemberOf(t)?a=r.toNode:r.toNode?.isMemberOf(t)&&(a=r.fromNode)),a===null||a.isMemberOf(t))return;for(;a!==null&&!a.isVisible();)a=a.containingGroup;if(a===null)return;let h=a.location;if(h.isReal()&&!(e===270&&(a!==t?h.y>=s.top:r.midPoint.y>=s.top))){if(e===90&&(a!==t?h.y<=s.bottom:r.midPoint.y<=s.bottom)||e===180&&(a!==t?h.x>=s.left:r.midPoint.x>=s.left)||e===0&&(a!==t?h.x<=s.right:r.midPoint.x<=s.right))return;i&&r.actualBounds.isReal()?n.add(r):n.add(a)}});let o=new q(n);return e===90||e===270?o.sort((r,a)=>r.actualBounds.centerX-a.actualBounds.centerX):o.sort((r,a)=>r.actualBounds.centerY-a.actualBounds.centerY),o}findNextFocus(t){t=C.Ee(t);let e=this.focus,i=e instanceof J?e.location:e.getDocumentPoint(T.Center),s=1/0,n=e,o=(r,a,h,l)=>{if(this.nextFocusFormula==="linear"){let u=1/0;t===0&&h>i.x||t===180&&h<i.x?u=Math.abs(h-i.x):(t===90&&l>i.y||t===270&&l<i.y)&&(u=Math.abs(l-i.y)),u<s&&(s=u,n=r)}else{if(t===0&&(a.right<i.x||(a.centerX-i.x)**2>s)||t===90&&(a.bottom<i.y||(a.centerY-i.y)**2>s)||t===180&&(a.x>i.x||(i.x-a.centerX)**2>s)||t===270&&(a.y>i.y||(i.y-a.centerY)**2>s))return;let u=i.direction(h,l),c=C.jF(t,u);if(t===90||t===270?c<=45:c<45){let d=i.distanceSquared(h,l);d<s&&(s=d,n=r)}}};if(e instanceof pt&&e.diagram!==null){let r=e.containingGroup;r!==null?r.memberParts.each(a=>{a===e||a instanceof j||!a.isVisible()||o(a,a.actualBounds,a.location.x,a.location.y)}):(e.diagram.nodes.each(a=>{a===e||!a.isTopLevel||!a.isVisible()||o(a,a.actualBounds,a.location.x,a.location.y)}),e.diagram.parts.each(a=>{a===e||!a.isTopLevel||!a.isVisible()||o(a,a.actualBounds,a.location.x,a.location.y)}))}else if(e.part!==null){let r=new I;this.MN(e.part).each(a=>{a!==e&&(a.getDocumentBounds(r),o(a,r,r.centerX,r.centerY))})}return n}get nextFocusFormula(){return this.mN}set nextFocusFormula(t){this.mN=t}tI(){let t=this.a;if(!t)return;let e=t.currentTool;if(e instanceof It){let n=e.currentObject;this.v1(this.focus),e.maybeStopTool(this.focus),t.currentTool instanceof It||(this.focus=n);return}let i=this.focus,s=t.lastInput;if(i===null)s.control||s.meta?this.v1(null):this.focus=this.findFirstFocus();else if(i instanceof pt)if(s.control||s.meta)this.v1(i);else{let n=this.MN(i);if(n.count>0)this.focus=n.first();else if(i instanceof j&&i.isLabeledLink){let o=i.labelNodes.first();o!==null&&o.isVisible()&&(this.focus=o)}else if(i instanceof ht&&i.isSubGraphExpanded){let o=i.memberParts.first();o!==null&&o.isVisible()&&(this.focus=o)}}else this.v1(i)}YT(t){let e=new q,i=this.a;if(!i)return e;let s=0;for(;e.count===0&&s<i.nodes.count;){let n=i.nodes;for(;n.next();){let o=n.value;o.isTopLevel&&o.isVisible()&&(t?o.findNodesInto():o.findNodesOutOf()).count===s&&e.add(o)}s++}return e}MN(t){return t instanceof pt?this.Pn(t,new q):new q}Pn(t,e){return!(t instanceof pt)&&t.isVisibleObject()&&t.isEnabledObject()&&(t.contextMenu||t.click||t instanceof lt&&t.editable||t.part instanceof J&&t.portId!==null&&(t.portId!==""||t.part.ports.count>1)||t.toolTip)&&e.add(t),t instanceof G&&t.elements.each(i=>this.Pn(i,e)),e}v1(t){let e=this.a;if(!e)return;let i=e.lastInput,s=t instanceof $?t:e;if(s.click){let n=new Qt;n.diagram=e,n.documentPoint=t instanceof $?t.getDocumentPoint(T.Center):e.viewportBounds.center,n.viewPoint=e.transformDocToView(n.documentPoint),n.button=0,n.clickCount=1,n.targetObject=t,this.pd(n,!1),s instanceof $?s.click(n,s):s.click(n),e.lastInput=i}else s instanceof lt&&s.editable?this.editTextBlock(s):this.jT(t)}eI(){let t=this.a;if(!t)return;let e=t.currentTool;if(e instanceof ne&&e.currentToolTip!==null){e.hideToolTip();return}else if(e instanceof It){let i=e.currentObject;e.doKeyDown(),this.focus=i;return}if(this.focus instanceof pt){let i=this.focus;i instanceof J&&i.labeledLink!==null?this.focus=i.labeledLink:i.containingGroup!==null?this.focus=i.containingGroup:this.focus=null}else if(this.focus instanceof $){let i=this.focus.part;if(i instanceof j&&i.isLabeledLink){let s=i.labelNodes.first();if(s!==null&&s.isVisible()){this.focus=s;return}}else if(i instanceof ht&&i.isSubGraphExpanded){let s=i.memberParts.first();if(s!==null&&s.isVisible()){this.focus=s;return}}this.focus=i}else this.cancelVirtualPointer(),this.stopCommand()}iI(){let t=this.a;if(t)if(t.lastInput.shift&&this.isVirtualPointerShown){let e=t.findPartAt(this.virtualPointerLocation);e!==null&&(e===this.focus?this.WT():this.focus=e)}else this.WT()}WT(){let t=this.a;if(!t)return;let e=t.lastInput,i=this.focus;if(i instanceof pt){let s=i.part;if(e.control||e.meta){for(t.raiseDiagramEvent("ChangingSelection",t.selection);s!==null&&!s.canSelect();)s=s.containingGroup;s!==null&&(s.isSelected=!s.isSelected),t.raiseDiagramEvent("ChangedSelection",t.selection)}else if(e.shift){if(s!==null&&!s.isSelected){for(t.raiseDiagramEvent("ChangingSelection",t.selection);s!==null&&!s.canSelect();)s=s.containingGroup;s!==null&&(s.isSelected=!0),t.raiseDiagramEvent("ChangedSelection",t.selection)}}else if(s!==null&&!s.isSelected){for(;s!==null&&!s.canSelect();)s=s.containingGroup;s!==null&&t.select(s)}}this.jT(i),this.onFocusChanged(i,i)}jT(t){let e=this.a;if(!e)return;e.toolManager.hideToolTip();let i=e.lastInput,s=t instanceof $?t:e;for(;s instanceof $&&!s.toolTip;)s=s.panel;if(s&&s.toolTip){let n=new Qt;n.diagram=e,n.documentPoint=t!==null?t.getDocumentPoint(T.Center):e.viewportBounds.center,n.viewPoint=e.transformDocToView(n.documentPoint),n.targetObject=t,this.pd(n,!1),e.toolManager.showToolTip(s.toolTip,t),e.lastInput=i}}sI(){let t=this.a;if(!t)return;let e=this.focus;if(this.canShowContextMenu(e)){this.showContextMenu(e);let i=t.toolManager.contextMenuTool.currentContextMenu;if(i instanceof vt){let s=this.MN(i);s.count>0&&(this.focus=s.first())}}}}var Bi=(x=>(x[x.None=0]="None",x[x.Default=1]="Default",x[x.Vertical=4]="Vertical",x[x.Horizontal=5]="Horizontal",x[x.Fill=2]="Fill",x))(Bi||{}),Vi=(x=>(x[x.None=0]="None",x[x.Along=21]="Along",x[x.Plus90=22]="Plus90",x[x.Minus90=23]="Minus90",x[x.Opposite=24]="Opposite",x[x.Upright=25]="Upright",x[x.Plus90Upright=26]="Plus90Upright",x[x.Minus90Upright=27]="Minus90Upright",x[x.Upright45=28]="Upright45",x))(Vi||{}),Xs=(x=>(x[x.None=0]="None",x[x.Vertical=1]="Vertical",x[x.Horizontal=2]="Horizontal",x[x.Both=3]="Both",x))(Xs||{});class ${n;zp;Xp;pa;w;ya;ft;ct;hi;Zt;Gp;$s;Lt;cs;el;wa;Se;Th;it;Xt;il;De;Ke;yd;de;wd;Ot;he;sl;F1;xa;uf;constructor(){V.Je(this),this.n=30723,this.Zt=1,this.Gp="",this.$s=null,this.Lt=null,this.ct=new P(NaN,NaN).k(),this.cs=st.Zw,this.el=new Nt,this.wa=new Nt,this.Se=null,this.Th=1,this.it=1,this.Xt=0,this.il=Dt.im,this.hi=new I(NaN,NaN,NaN,NaN).k(),this.De=new I(NaN,NaN,NaN,NaN).k(),this.Ke=new I(0,0,NaN,NaN).k(),this.yd=null,this.zp=null,this.ft=null,this.de=T.Default,this.wd=T.Default,this.Xp=0,this.pa=0,this.Ot=null,this.w=null,this.ya=null,this.he=null,this.F1=null,this.xa=null,this.sl=null,this.uf=null}cloneProtected(t){t.n=(this.n|2048|4096)&-32769,t.Zt=this.Zt,t.Gp=this.Gp,t.Lt=this.Lt,t.ct.h(this.ct),t.cs=this.cs.N(),this.Se!==null?t.Se=this.Se.copy():t.Se=null,t.it=this.it,t.Xt=this.Xt,t.il=this.il.N(),t.hi.h(this.hi),t.De.h(this.De),t.Ke.h(this.Ke),t.zp=this.zp,this.ft!==null&&(t.ft=this.ft.copy()),t.de=this.de.N(),t.wd=this.wd.N(),t.Xp=this.Xp,t.pa=this.pa,this.Ot!==null&&(t.Ot=this.Ot.copy()),this.w!==null&&(this.w.me?t.w=this.w:t.w=this.w.copy()),this.ya!==null&&(t.ya=this.ya.slice()),this.he!==null&&(t.he=this.he.copy())}addCopyProperty(t){let e=this.ya;if(!Array.isArray(e))e=[],this.ya=e;else for(let i=0;i<e.length;i++)if(e[i]===t)return;e.push(t)}Ho(t){t.yd=null,t.sl=null,t.f()}clone(){let t=new this.constructor;if(this.cloneProtected(t),this.ya!==null)for(let e=0;e<this.ya.length;e++){let i=this.ya[e];t[i]=this[i]}return t}copy(){return this.clone()}ZS(){let t=this.ve;if(t!==null){this.ve=null;for(let e of t)e.xd()&&(e.isToData?this.themeData(e.targetProperty,e.sourceProperty,e.themeSource,e.converter,e.themeConverter):e.isToObject?this.themeObject(e.targetProperty,e.sourceProperty,e.themeSource,e.converter,e.themeConverter,e.sourceName):e.isToModel?this.themeModel(e.targetProperty,e.sourceProperty,e.themeSource,e.converter,e.themeConverter):this.theme(e.targetProperty,e.sourceProperty,e.themeSource,e.converter,e.themeConverter))}return this}fe(t){t in Vi?this.segmentOrientation=t:t in Bi?this.stretch=t:m.ur(this,t)}toString(){return m.Kn(this.constructor)+"#"+V.xs(this)}static None=0;static Default=1;static Fill=2;static Vertical;static Horizontal;static Uniform=6;static UniformToFill=7;static FlipVertical=1;static FlipHorizontal=2;static FlipBoth=3;ba(){this.w!==null&&(this.w.me=!0)}Yt(){return this.w===null?this.w=new Ue:this.w.me&&(this.w=this.w.copy()),this.w}Wi(){if(this.ft===null){let t=new Ni;t.Dh=T.None,t.vh=T.None,t.Fh=10,t.Rh=10,t.Oh=0,t.Ih=0,this.ft=t}return this.ft}raiseChangedEvent(t,e,i,s,n,o,r){let a=this.part;if(a!==null){a.df(t,e,i,s,n,o,r),i===this&&t===2&&this.gf()&&this.Eh(a,e);let h=this.diagram;if(this.Ts!==null&&h!==null&&h.Qa&&!h.undoManager.isUndoingRedoing&&!h.animationManager.Eu){let l=this.Ts.get(e);if(l!==null&&h.animationManager.isEnabled&&!h.animationManager.isTicking){this.uf===null&&(this.uf=new Mt);let u=h.undoManager.transactionLevel===0;if(l.startCondition===2?u=!0:l.startCondition===3&&(u=!1),u){let c=new ye;l.OR(c);let d=this.uf.get(l);d!==null&&d.stop(),this.uf.set(l,c),c.tb=this,c.vM=l,c.add(this,e,s,n),c.start()}else h.animationManager.getBundleAnimation().add(this,e,s,n)}}if(this instanceof G&&i===a&&a.NN()&&a.data!==null){let l=this.D.r,u=l.length;for(let c=0;c<u;c++){let d=l[c];d instanceof G&&d.Pn(f=>{f.data!==null&&f.NN()&&f.updateTargetBindings(e)})}}}}DR(t){this.uf&&this.uf.delete(t)}Go(){if(this.diagram!==null&&this.findBindingPanel()===null&&this.ve!==null){let t=this.diagram.model,e=this.ve.iterator;for(;e.next();){let i=e.value;if(!i.isToTheme)continue;let s=null,n=i.sourceName;i.isToObject&&(s=this.JT(n));let o=this,r=i.targetId;r!==-1&&(o=this.Yp(r),o===null)||(n==="/"?s=o.part:n==="."?s=o:n===".."&&(s=o.panel),i.updateTarget(o,s,void 0,t))}}}Eh(t,e){let i=this.findBindingPanel();if(i!==null){let s=t.diagram,n=this.ve.iterator;for(;n.next();){let o=n.value,r=null;if(o.isToObject){if(r=o.$T(i,this),r===null)continue;o.updateSource(this,r,e,null)}else if(o.isToModel)s!==null&&!s.wi&&o.updateSource(this,s.model.modelData,e,i);else if(!o.isToTheme){let a=i.data;if(a===null)continue;s!==null&&!s.wi&&o.updateSource(this,a,e,i)}if(r===this){let a=o.targetId,h=i.Yp(a);h!==null&&o.updateTarget(h,r,e,s?.model)}}}}Yp(t){return this.no===t?this:null}JT(t){let e;return t===""?e=this:t==="/"?e=this:t==="."?e=this:t===".."?e=this:e=this.part.findObject(t),e}get no(){return this.w!==null?this.w.no:-1}set no(t){this.no!==t&&(this.w===null&&(this.w=new Ue),this.w.no=t)}get ve(){return this.w!==null?this.w.ve:null}set ve(t){this.ve!==t&&(this.w===null&&(this.w=new Ue),this.w.ve=t)}get oo(){return this.w!==null?this.w.oo:null}set oo(t){this.oo!==t&&(this.w===null&&(this.w=new Ue),this.w.oo=t)}raiseChanged(t,e,i){this.raiseChangedEvent(2,t,this,e,i)}t(t,e,i){this.raiseChangedEvent(2,t,this,e,i)}ro(t,e,i,s){let n=this.hi;if(n.e(t,e,i,s),this.it!==1||this.Xt!==0){this.Se===null&&(this.Se=new Nt);let o=this.Se;o.Ue(),this.Kp(o,t,e,i,s),o.sm(n)}}ZT(t,e,i){return this.pickable===!1?!1:(i.bc(this.v),e?this.intersectsRect(t,i):this.containedInRect(t,i))}QT(t,e,i){if(this.pickable===!1)return!1;let s=this.naturalBounds,n=t.distanceSquaredPoint(e);return i?P.distanceLineSegmentSquared(t.x,t.y,0,0,0,s.height)<=n||P.distanceLineSegmentSquared(t.x,t.y,0,s.height,s.width,s.height)<=n||P.distanceLineSegmentSquared(t.x,t.y,s.width,s.height,s.width,0)<=n||P.distanceLineSegmentSquared(t.x,t.y,s.width,0,0,0)<=n:t.distanceSquared(0,0)<=n&&t.distanceSquared(0,s.height)<=n&&t.distanceSquared(s.width,0)<=n&&t.distanceSquared(s.width,s.height)<=n}Mn(){return!0}containsPoint(t){let e=P.l();e.h(t),this.v.gt(e);let i=this.actualBounds;if(!i.isReal())return P.i(e),!1;let s=this.diagram;if(s!==null&&s.pp){let o=s.getInputOption("extraTouchThreshold"),r=s.getInputOption("extraTouchArea"),a=r/2,h=this.naturalBounds,l=this.getDocumentScale()*s.scale,u=1/l;if(h.width*l<o&&h.height*l<o){let c=I.contains(i.x-a*u,i.y-a*u,i.width+r*u,i.height+r*u,e.x,e.y);return P.i(e),c}}let n=!1;return(this instanceof vt||this instanceof et?I.contains(i.x-5,i.y-5,i.width+10,i.height+10,e.x,e.y):i.containsPoint(e))&&(this.he&&!this.he.containsPoint(e)?n=!1:this.Lt!==null&&this.Ke.containsPoint(t)?n=!0:n=this.ka(t)),P.i(e),n}ka(t){let e=this.naturalBounds;return I.contains(0,0,e.width,e.height,t.x,t.y)}containsRect(t){if(this.angle===0)return this.actualBounds.containsRect(t);let e=this.naturalBounds,i=I.z(0,0,e.width,e.height),s=this.v,n=!1,o=P.z(t.x,t.y);return i.containsPoint(s.Ci(o))&&(o.e(t.x,t.bottom),i.containsPoint(s.Ci(o))&&(o.e(t.right,t.bottom),i.containsPoint(s.Ci(o))&&(o.e(t.right,t.y),i.containsPoint(s.Ci(o))&&(n=!0)))),P.i(o),I.i(i),n}containedInRect(t,e){if(e===void 0)return t.containsRect(this.actualBounds);let i=this.naturalBounds,s=e,n=!1,o=P.z(0,0);return t.containsPoint(s.gt(o))&&(o.e(0,i.height),t.containsPoint(s.gt(o))&&(o.e(i.width,i.height),t.containsPoint(s.gt(o))&&(o.e(i.width,0),t.containsPoint(s.gt(o))&&(n=!0)))),P.i(o),n}intersectsRect(t,e){if(e===void 0&&(e=this.v,this.angle===0))return t.intersectsRect(this.actualBounds);let i=this.naturalBounds,s=e,n=P.z(0,0),o=P.z(0,i.height),r=P.z(i.width,i.height),a=P.z(i.width,0),h=!1;if(t.containsPoint(s.gt(n))||t.containsPoint(s.gt(o))||t.containsPoint(s.gt(r))||t.containsPoint(s.gt(a)))h=!0;else{let l=I.z(0,0,i.width,i.height),u=P.z(t.x,t.y);l.containsPoint(s.Ci(u))?h=!0:(u.e(t.x,t.bottom),l.containsPoint(s.Ci(u))?h=!0:(u.e(t.right,t.bottom),l.containsPoint(s.Ci(u))?h=!0:(u.e(t.right,t.y),l.containsPoint(s.Ci(u))&&(h=!0)))),P.i(u),I.i(l),h||(C.lx(t,n,o)||C.lx(t,o,r)||C.lx(t,r,a)||C.lx(t,a,n))&&(h=!0)}return P.i(n),P.i(o),P.i(r),P.i(a),h}getDocumentPoint(t,e){if(e===void 0&&(e=new P),t instanceof T){let i=t,s=this.naturalBounds;return e.e(i.x*s.width+i.offsetX,i.y*s.height+i.offsetY),this.Ws.gt(e),e}else return e.set(t),this.Ws.gt(e),e}getDocumentBounds(t){t===void 0&&(t=new I);let e=this.naturalBounds,i=this.Ws,s=P.z(0,0).v(i);return t.e(s.x,s.y,0,0),s.e(e.width,0).v(i),t.re(s.x,s.y,0,0),s.e(e.width,e.height).v(i),t.re(s.x,s.y,0,0),s.e(0,e.height).v(i),t.re(s.x,s.y,0,0),P.i(s),t}getDocumentAngle(){return this.Ws.KF()}getDocumentScale(){if(this.Hp()===!1)return this.Th;let t=this.it;return this.panel!==null?t*this.panel.getDocumentScale():t}getLocalPoint(t,e){return e===void 0&&(e=new P),e.h(t),this.Ws.Ci(e),e}getNearestIntersectionPoint(t,e,i){return this.mf(t.x,t.y,e.x,e.y,i)}mf(t,e,i,s,n){let o=this.v,r=1/(o.m11*o.m22-o.m12*o.m21),a=o.m22*r,h=-o.m12*r,l=-o.m21*r,u=o.m11*r,c=r*(o.m21*o.dy-o.m22*o.dx),d=r*(o.m12*o.dx-o.m11*o.dy),f=t*a+e*l+c,p=t*h+e*u+d,g=i*a+s*l+c,y=i*h+s*u+d;n.e(0,0);let b=this.naturalBounds,v=C.Cl(0,0,b.width,b.height,f,p,g,y,n);return n.v(o),v}ht(t,e,i,s){if(this.Xo()===!1)return;let n=this.il,o=n.right+n.left,r=n.top+n.bottom;t=Math.max(t-o,0),e=Math.max(e-r,0),i=i||0,s=s||0,i=Math.max(i-o,0),s=Math.max(s-r,0);let a=this.angle,h=0,l=this.desiredSize,u=this.qp();a===90||a===270?(t=isFinite(l.height)?l.height+u:t,e=isFinite(l.width)?l.width+u:e):(t=isFinite(l.width)?l.width+u:t,e=isFinite(l.height)?l.height+u:e);let c=i||0,d=s||0,f=this instanceof G;switch(this.Zs(!0)){case 0:c=0,d=0,f&&(t=1/0,e=1/0);break;case 2:isFinite(t)&&t>i&&(c=t),isFinite(e)&&e>s&&(d=e);break;case 5:isFinite(t)&&t>i&&(c=t),d=0,f&&(e=1/0);break;case 4:isFinite(e)&&e>s&&(d=e),c=0,f&&(t=1/0);break}let p=this.maxSize,g=this.minSize;c>p.width&&g.width<p.width&&(c=p.width),d>p.height&&g.height<p.height&&(d=p.height),i=Math.max(c,g.width),s=Math.max(d,g.height),p.width<i&&(i=Math.min(g.width,i)),p.height<s&&(s=Math.min(g.height,s)),t=Math.min(p.width,t),e=Math.min(p.height,e),t=Math.max(i,t),e=Math.max(s,e),(a===90||a===270)&&(h=t,t=e,e=h,h=i,i=s,s=h),this.hi.ce(),this.bd(t,e,i,s),this.hi.k(),this.hi.isReal()||m.o("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.hi.toString()),this.xi(!1)}bd(t,e,i,s){}Qs(){return!1}Ut(t,e,i,s,n){this.pf();let o=I.l();o.h(this.De),this.De.ce(),this.as()===!1?this.De.e(t,e,i,s):this.Pa(t,e,i,s),this.De.k(),n===void 0?this.he=null:this.he=n;let r=!1;if(n!==void 0)r=!0;else{let a=this.panel;if(a!==null&&a.nl()&&(a=a.panel),a!==null){let h=a.Ke,l=this.measuredBounds,u=e+l.height,c=t+l.width;if(r=!(0<=t+.05&&c<=h.width+.05&&0<=e+.05&&u<=h.height+.05),this instanceof lt){let d=this.naturalBounds;(this.jp>d.height||this.pe>d.width)&&(r=!0)}}}r?this.n|=256:this.n&=-257,this.De.isReal()||m.o("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.De.toString()),this.kd(o,this.De),this.lo(!1),I.i(o)}Pa(t,e,i,s){}commonArrange(t,e,i,s){if(this.De.e(t,e,i,s),this.desiredSize.isReal())return;let n=this.hi,o=this.il,r=o.right+o.left,a=o.top+o.bottom,h=n.width+r,l=n.height+a;i+=r,s+=a;let u=this.Zs(!0);switch(h===i&&l===s&&(u=0),u){case 0:(h>i||l>s)&&(this.xi(!0),this.ht(h>i?i:h,l>s?s:l,0,0));break;case 2:this.xi(!0),this.ht(i,s,0,0);break;case 5:this.xi(!0),this.ht(i,l,0,0);break;case 4:this.xi(!0),this.ht(h,s,0,0);break}}kd(t,e){let i=this.part;i!==null&&i.diagram!==null&&((i.selectionObject===this||i.resizeObject===this||i.rotateObject===this)&&i.CN(!0),this.C(),!t.equalsApproxClose(e)&&(i.Sa(),this.Wp(i)))}Wp(t){this.portId!==null&&(t.CN(!0),t instanceof J&&t.invalidateConnectedLinks(void 0,this))}get shadowVisible(){return this.w!==null?this.w.Jp:null}set shadowVisible(t){let e=this.shadowVisible;e!==t&&(this.Yt().Jp=t,this.Ji(!0),this.C(),this.t("shadowVisible",e,t))}rI(t,e){let i=this.naturalBounds,s=this.wa,n=s.m11,o=s.m21,r=s.dx,a=s.m12,h=s.m22,l=s.dy,u=0,c=0,d=u,f=c;u=d*n+f*o+r,c=d*a+f*h+l;let p=u,g=c,y=0,b=0;d=i.width+e,f=0,u=d*n+f*o+r,c=d*a+f*h+l;let v=Math.min(p,u),w=Math.min(g,c);y=Math.max(p+y,u)-v,b=Math.max(g+b,c)-w,p=v,g=w,d=i.width+e,f=i.height+e,u=d*n+f*o+r,c=d*a+f*h+l,v=Math.min(p,u),w=Math.min(g,c),y=Math.max(p+y,u)-v,b=Math.max(g+b,c)-w,p=v,g=w,d=0,f=i.height+e,u=d*n+f*o+r,c=d*a+f*h+l,v=Math.min(p,u),w=Math.min(g,c),y=Math.max(p+y,u)-v,b=Math.max(g+b,c)-w,p=v,g=w;let k=t.viewportBounds,S=k.x,N=k.y,D=k.width,L=k.height;return p>D+S||S>y+p||g>L+N||N>b+g}Ge(t,e){if(this.lI(t,e)||!this.visible)return;let i=this.opacity;if(i===0)return;let s=1;i!==1&&(s=t.globalAlpha,t.globalAlpha=s*i);let n="";this.filter!==""&&(n=t.filter,t.filter=this.filter);let o=this.v,r=this.panel;this.Hp()===!0&&this.R1();let a=this.part,h=!1,l=0;if(a&&e.getRenderingHint("drawShadows")&&(h=a.isShadowed,h)){let g=a.shadowOffset;l=Math.max(g.y,g.x)*e.scale*e.$e}let u=this instanceof G&&this.nl(),c=this.De;if(u&&(this._T(h,t,!1,r),this.aI(t,e),this.tD(h,t,!1,r),this.eD(h,t,!1)),u||!u&&(c.width===0||c.height===0||isNaN(c.x)||isNaN(c.y))){i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n);return}let d=this.Qs();if(!e.ph&&d&&this.rI(e,l)){i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n);return}let f=(this.n&256)!==0;if(t.clipInsteadOfFill&&(f=!1),this instanceof lt&&(t.font=this.font),f){let g=r.Mn()?r.naturalBounds:r.actualBounds,y=Math.max(c.x,g.x),b=Math.max(c.y,g.y),v=Math.min(c.right,g.right)-y,w=Math.min(c.bottom,g.bottom)-b,k=this.he;if(k!==null&&(y=k.x,b=k.y,v=k.width,w=k.height),y>c.width+c.x||c.x>g.width+g.x){i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n);return}t.save(),t.beginPath(),t.rect(y,b,v,w),t.clip()}if(d){if(!a.isVisible()){i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n);return}if(h){let g=a.shadowOffset;t.shadowsSet(g.x*e.scale*this.scale*e.$e,g.y*e.scale*this.scale*e.$e,a.shadowBlur),t.shadowsOn(),t.shadowColor=a.shadowColor}}let p=this.naturalBounds;if(t.transform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this._T(h,t,d,r),this.Lt!==null&&(t.commitTransform(),this.O1(t,p,c)),this.tD(h,t,d,r),this.Ma(t,e),this.eD(h,t,d),f&&(t.restore(),t.clearContextCache(this instanceof G)),!o.RP()){let g=1/(o.m11*o.m22-o.m12*o.m21);t.transform(o.m22*g,-o.m12*g,-o.m21*g,o.m11*g,g*(o.m21*o.dy-o.m22*o.dx),g*(o.m12*o.dx-o.m11*o.dy))}i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n)}_T(t,e,i,s){t&&this.shadowVisible===!0?e.shadowsOn():t&&this.shadowVisible===!1&&e.shadowsOff(),t&&this.I1(s)&&this.shadowVisible===null&&e.shadowsOff()}tD(t,e,i,s){t&&(this.Lt!==null||this.I1(s))?(this.E1(!0),this.shadowVisible===null&&e.shadowsOff()):this.E1(!1)}eD(t,e,i){t&&this.LN()===!0&&e.shadowsOn(),i&&t&&e.shadowsOff()}hI(t,e,i){let s=this.part,n=!1;s&&t.getRenderingHint("drawShadows")&&(n=s.isShadowed),e.clipInsteadOfFill&&(n=!1),this.Qs()&&n&&e.shadowsOn(),n&&this.shadowVisible===!0?e.shadowsOn():n&&this.shadowVisible===!1&&e.shadowsOff();let o=this.panel;if(n&&this.I1(o)&&this.shadowVisible===null&&e.shadowsOff(),e.ol){let r=t.computePixelRatio(),a=`drop-shadow(${e.shadowOffsetX/r}px ${e.shadowOffsetY/r}px ${e.shadowBlur/r/2}px ${e.shadowColor})`;this.background!==null&&i.Lt.setAttributeNS(null,"filter",a)}return n&&(this.Lt!==null||this.I1(o))?(this.E1(!0),this.shadowVisible===null&&e.shadowsOff()):this.E1(!1),n}cI(t,e,i,s){if(i.ol){let n=e.computePixelRatio(),o=`drop-shadow(${i.shadowOffsetX/n}px ${i.shadowOffsetY/n}px ${i.shadowBlur/n/2}px ${i.shadowColor})`;this.AN(t,o)}s&&this.LN()===!0&&i.shadowsOn(),this.Qs()&&i.shadowsOff()}I1(t){return t===null?!1:(t.nl()&&(t=t.panel),t.LN()||(t.type===G.Auto||t.type===G.Spot)&&t.findMainElement()!==this)}AN(t,e){}O1(t,e,i){let s=this.qp(),n=e.x,o=e.y,r=e.width+s,a=e.height+s;this.bn(t,this.Lt,!0,!1,e,i),this.Lt instanceof R&&this.Lt.type===3?(t.beginPath(),t.rect(n-s/2,o-s/2,r,a),t.fillContext(this.Lt,!1,null)):t.fillRect(n-s/2,o-s/2,r,a)}iD(t,e){let i=t.fI(this),s=t.xa!==null?t.xa:t.svg;if(s!==null&&i!==-1){for(;i!==0&&!t.elt(i-1).isVisibleObject();)i--;if(i===0)this.uI(t,e,s);else{let n=t.elt(i-1).svg;n!==null?n.after(e):s.appendChild(e)}}}uI(t,e,i){if(t.type===G.Table){let s=i.getElementsByClassName("gojs-ts"),n=s.length!==0?s[0]:null;n!==null&&n.after(e)}else i.Lt?i.Lt.after(e):i.prepend(e)}lI(t,e){if(!(t instanceof re))return!1;if(!this.visible||this.opacity===0)return this.svg!==null&&this.svg.parentNode!==null&&this.svg.remove(),!0;let i=this.De;if(this.Qs()&&(!this.isVisible()||i.width===0||i.height===0||isNaN(i.x)||isNaN(i.y)))return this.svg!==null&&this.svg.parentNode!==null&&this.svg.remove(),!0;t.setCurrentTransform(1,0,0,1,0,0);let s=this.panel,n=this.Pd(t);if(this.yf(t,e,n))return this.sD(this.svg),this.svg.parentElement!==null?(this.Qs()&&(t.lastDrawnPart=this.svg),!0):(this.Qs()?(t.lastDrawnPart!==null?t.lastDrawnPart.after(this.svg):t.diagramGroup.prepend(this.svg),t.lastDrawnPart=this.svg):s&&this.iD(s,this.svg),!0);if(this.Ji(!1),this.Qs()&&this.isShadowed){let p=this.shadowOffset;t.shadowsSet(p.x*e.scale*this.scale*e.$e,p.y*e.scale*this.scale*e.$e,this.shadowBlur),t.shadowsOn(),t.shadowColor=this.shadowColor}this instanceof lt&&(t.font=this.font),t.currentElement=null;let o=this.v,r=this instanceof G,a=this instanceof G?this.nl():!1,h=this.svg;if(this.Hp()===!0&&this.R1(),t.outerGroup=!1,n)if(t.outerGroup=!0,r&&a)t.newGroup(1,0,0,1,0,0),this.svg=t.lastCreatedElement;else if(r&&this.isClipping){let p=this.findMainElement(),g=0,y=0;p!==null&&(g=p.actualBounds.x,y=p.actualBounds.y),t.newGroup(o.m11,o.m12,o.m21,o.m22,o.dx+g,o.dy+y),this.svg=t.lastCreatedElement,p!==null&&t.createOrUpdateClipGroup(this,p.actualBounds),t.currentElement=t.lastCreatedElement}else r?(t.newGroup(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this.svg=t.lastCreatedElement):t.newGroup(1,0,0,1,0,0);let l=this.naturalBounds;r||t.setCurrentTransform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this.background!==null&&(r?(a&&t.setCurrentTransform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this.O1(t,l,i),a&&t.setCurrentTransform(1,0,0,1,0,0)):(t.setCurrentTransform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this.O1(t,l,i)),t.currentElement.Lt=t.lastCreatedElement,t.currentElement.prepend(t.lastCreatedElement));let u=this.hI(e,t,t.currentElement);this.Ma(t,e),r&&t.endGroup(),t.outerGroup&&t.endGroup();let c=t.surface.ud,d=r?this.svg:t.currentElement;if(h!==null&&h.parentNode!==null&&d!==h&&(this.panel===null||h.parentNode===this.panel.svg)){let p=this.svg.getAttribute("filter");return p!==null&&d.setAttribute("filter",p),this.filter!==""&&d.setAttributeNS(null,"filter",this.filter),h.replaceWith(d),this.svg=d,d!==null&&this.$p(t,s,i,d),!0}if(this.svg=d,c!==null&&d===null&&t.dummyGroup(),d===null)return!0;this.$p(t,s,i,d),this.cI(d,e,t,u);let f=this.Qs()?this.opacity*t.globalAlpha:this.opacity;if(f!==1&&d.setAttributeNS(null,"opacity",f.toString()),this.filter!==""&&d.setAttributeNS(null,"filter",this.filter),this.Qs()){if(h!==null&&d!==h&&h.parentNode===t.diagramGroup){let p=h.getAttribute("filter");p!==null&&d.setAttribute("filter",p),h.replaceWith(d)}else t.lastDrawnPart?t.lastDrawnPart.after(d):t.diagramGroup.prepend(d);t.lastDrawnPart=d}else s!==null&&this.iD(s,d);return c!==null&&c(this,d),this.sD(d),!0}sD(t){let e=this,i=t.dataset;e instanceof $&&(e.portId!==null&&(i.portId=e.portId),e instanceof G&&(isNaN(e.itemIndex)||(i.itemIndex=e.itemIndex.toString()),e instanceof pt&&(i.className=m.Kn(e),e.key!==void 0&&(i.key=e.key.toString()),e.containingGroup!==null&&(i.group=e.containingGroup.key.toString()),e instanceof j&&(e.fromNode!==null&&e.fromNode.key!==void 0&&(i.fromKey=e.fromNode.key.toString()),e.fromPortId!==""&&(i.fromPortId=e.fromPortId),e.toNode!==null&&e.toNode.key!==void 0&&(i.toKey=e.toNode.key.toString()),e.toPortId!==""&&(i.toPortId=e.toPortId)))))}$p(t,e,i,s){let n=(this.n&256)!==0;if(t.clipInsteadOfFill&&(n=!1),!n){s.removeAttributeNS(null,"clip-path");return}let o=e.Mn()?e.naturalBounds:e.actualBounds,r=Math.max(i.x,o.x),a=Math.max(i.y,o.y),h=Math.min(i.right,o.right)-r,l=Math.min(i.bottom,o.bottom)-a,u=this.he;u!==null&&(r=u.x,a=u.y,h=u.width,l=u.height);let c=I.z(r,a,Math.max(h,0),Math.max(l,0));if(this instanceof G){let d=Nt.l();d.set(this.v),d.ex(),d.sm(c),Nt.i(d)}s.setAttributeNS(null,"clip-path",`path(' M ${c.x},${c.y} L ${c.width+c.x} ${c.y} L ${c.width+c.x} ${c.height+c.y} L ${c.x} ${c.height+c.y} z') view-box`),I.i(c)}dI(){if(this.svg===null)return;let t=this.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),e=this.svg.ownerDocument;if(t!==null)for(let i of t){let s=e.getElementById(i.split("#")[1].slice(0,-1));s!==null&&s.remove()}this.svg.remove()}aI(t,e){let i=this.De,s=this.Ke,n=this.Lt;n!==null&&t.commitTransform(),n!==null&&(this.bn(t,n,!0,!1,s,i),n instanceof R&&n.type===3?(t.beginPath(),t.rect(i.x,i.y,i.width,i.height),t.fillContext(n,!1,null)):t.fillRect(i.x,i.y,i.width,i.height)),this.Ma(t,e)}Ma(t,e){}wf(){this.Ji(!0)}yf(t,e,i){let s=this.svg;if(this.gI()){if(this.wf(),this.Ji(!1),s===null)return!1;let u=s.getAttribute("clip-path");if(u!==null&&u.includes("url")){let c=t.svg.getElementById(u.split("#")[1].slice(0,-1));c!==null&&c.remove()}return s.getAttribute("filter")&&s.removeAttribute("filter"),!1}if(s===null)return!1;if(!this.visible)return s.remove(),!1;if(s.nodeName!=="g"&&i||s.nodeName==="g"&&!i)return!1;let n=this.v,o="matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")",r=this instanceof G,a=r?this.nl():!1;if(!(r&&a))if(this instanceof Bt){let u=this.U1;t.setCurrentTransform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),u!==null&&t.amendImageTransform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7]),i?s.lastElementChild.setAttributeNS(null,"transform",t.getCurrentTransform()):s.setAttributeNS(null,"transform",t.getCurrentTransform())}else if(i&&!r)if(this instanceof et){let u=s.getElementsByTagName("path");for(let c=0;c<u.length;c++)u[c].setAttributeNS(null,"transform",o)}else if(this instanceof lt){let u=s.getElementsByTagName("text"),c=typeof this.stroke=="string"?this.stroke:null;for(let d=0;d<u.length;d++)u[d].setAttributeNS(null,"transform",o),c&&u[d].setAttributeNS(null,"fill",c)}else(s.lastElementChild||s).setAttributeNS(null,"transform",o);else if(r&&this.isClipping&&this.xa){let u=this.findMainElement(),c=u!==null?u.actualBounds.x:0,d=u!==null?u.actualBounds.y:0;this.xa.setAttributeNS(null,"transform","matrix(1,0,0,1,"+-c+", "+-d+")"),s.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+(n.dx+c)+", "+(n.dy+d)+")")}else s.setAttributeNS(null,"transform",o);let h=this.Qs()?this.opacity*t.globalAlpha:this.opacity;h===1?s.removeAttribute("opacity"):s.setAttributeNS(null,"opacity",h.toString()),t.setCurrentTransform(1,0,0,1,0,0);let l=this.xa?this.xa:this.F1;if(this.background!==null||l.Lt!==void 0){let u=l.Lt;if(this.background===null)t.removeOldGradient(this,l.Lt,"fill"),l.Lt.remove(),l.Lt=void 0;else{if((a||i&&!(this instanceof G))&&t.setCurrentTransform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),this.O1(t,this.naturalBounds,this.actualBounds),l.Lt){t.removeOldGradient(this,l.Lt,"fill");let c=l.Lt.getAttribute("filter");c!==null&&t.lastCreatedElement.setAttribute("filter",c),l.Lt.replaceWith(t.lastCreatedElement)}else l.prepend(t.lastCreatedElement);l.Lt=t.lastCreatedElement}u&&t.removeOldGradient(this,u,"fill")}return this.$p(t,this.panel,this.actualBounds,s),!0}Pd(t){if(this.background!==null)return!0;let e=(this.n&256)!==0;return t.clipInsteadOfFill&&(e=!1),!!e}static UU(t,e,i,s,n,o,r){let a=.001,h=o.length;t.moveTo(e,i);let l=s-e,u=n-i;l===0&&(l=.001);let c=u/l,d=Math.sqrt(l*l+u*u),f=0,p=!0;a=o[f%h];let g=r!==0;for(;d>=.1;){if(g){for(a=o[f++%h],a-=r;a<0;)a+=o[f++%h],p=!p;g=!1}else a=o[f++%h];a>d&&(a=d);let y=Math.sqrt(a*a/(1+c*c));l<0&&(y=-y),e+=y,i+=c*y,p?t.lineTo(e,i):t.moveTo(e,i),d-=a,p=!p}}bn(t,e,i,s,n,o){let r=1,a=1;if(typeof e=="string"){i?t.fillStyle=e:t.strokeStyle=e;return}else if(e.type===1){i?t.fillStyle=e.color:t.strokeStyle=e.color;return}let h,l=this.qp();r=n.width,a=n.height,s?(r=o.width,a=o.height):i||(r+=l,a+=l);let u=t instanceof ci;if(u&&e.Nn&&(e.type===4||e.xf===r&&e.V1===a))h=e.Nn;else{let c=0,d=0,f=0,p=0,g=0,y=0,b=0,v=0;if(s?(b=o.x,v=o.y):i||(b-=l/2,v-=l/2),c=e.start.x*r+e.start.offsetX+b,d=e.start.y*a+e.start.offsetY+v,f=e.end.x*r+e.end.offsetX+b,p=e.end.y*a+e.end.offsetY+v,e.type===2)h=t.createLinearGradient(c,d,f,p);else if(e.type===3)y=isNaN(e.endRadius)?Math.max(r,a)/2:e.endRadius,isNaN(e.startRadius)?(g=0,y=Math.max(r,a)/2):g=e.startRadius,h=t.createRadialGradient(c,d,g,f,p,y);else if(e.type===4)try{h=t.createPattern(e.pattern,"repeat")}catch{h=null}else m.si(e.type,"Brush type");if(e.type!==4){let w=e.colorStops;if(w!==null){let k=w.iterator;for(;k.next();)h.addColorStop(k.key,k.value)}}if(u&&(e.Nn=h,h!==null&&(e.xf=r,e.V1=a),h===null&&e.type===4&&e.xf!==-1)){e.xf=-1;let w=this.diagram;w!==null&&e.xf===-1&&m.un(()=>{w.redraw()},600)}}i?t.fillStyle=h:t.strokeStyle=h}isContainedBy(t){return t instanceof G?this.mI(this,t):!1}mI(t,e){if(t===e||e===null)return!1;let i=t.panel;for(;i!==null;){if(i===e)return!0;i=i.panel}return!1}isVisibleObject(){if(!this.visible)return!1;let t=this.panel;return t!==null?t.isVisibleObject():!0}isEnabledObject(){let t=this instanceof G?this:this.panel;for(;t!==null&&t.isEnabled;)t=t.panel;return t===null}get enabledChanged(){return this.w!==null?this.w.Zp:null}set enabledChanged(t){let e=this.enabledChanged;e!==t&&(t!==null&&m.S(t,$,"enabledChanged"),this.Yt().Zp=t,this.t("enabledChanged",e,t))}R1(){if(this.B1()===!0){let t=this.el;if(t.Ue(),!this.De.isReal()||!this.hi.isReal()){this.Sd(!1),this.Na(!1);return}if(t.Xs(this.De.x-this.hi.x,this.De.y-this.hi.y),this.scale!==1||this.angle!==0){let e=this.naturalBounds;this.Kp(t,e.x,e.y,e.width,e.height)}this.Sd(!1),this.Na(!0)}if(this.Hp()===!0){let t=this.panel;if(t===null)this.wa.set(this.el),this.Th=this.scale;else if(t.Ws!==null){let e=this.wa;e.Ue(),t.Mn()?e.bc(t.wa):t.panel!==null&&e.bc(t.panel.wa),e.bc(this.el),this.Th=this.scale*t.Th}this.Na(!1)}}Kp(t,e,i,s,n){if(this.it!==1&&t.it(this.it),this.Xt===0)return;let o=P.l();o.setSpot(e,i,s,n,T.Center),t.ks(this.Xt,o.x,o.y),P.i(o)}f(t){if(this.Xo())return;t===void 0&&(t=!1),this.xi(!0),this.lo(!0);let e=this.panel;e!==null&&!t&&e.f()}bf(){this.Xo()||(this.xi(!0),this.lo(!0))}kf(t){if(this.as())return;let e=this.panel;!t&&e!==null&&e.f(),this.lo(!0)}pf(){this.B1()===!1&&(this.Sd(!0),this.Na(!0))}TN(){this.Na(!0)}C(){let t=this.part;t!==null&&t.C()}Zs(t){let e=this.stretch,i=this.panel;if(i===null)return this.qo(e===1?0:e,t);if(i.type===G.Table)return this.Qp(i.getRowDefinition(this.row),i.getColumnDefinition(this.column),t);if(i.type===G.Auto&&i.findMainElement()===this)return this.qo(2,t);if(e===1){if(i.type===G.Spot&&i.findMainElement()===this)return this.qo(2,t);let s=i.defaultStretch;return s===1?this.qo(0,t):this.qo(s,t)}return this.qo(e,t)}Qp(t,e,i){let s=this.stretch;if(s!==1)return this.qo(s,i);let n=null,o=null;switch(t.stretch){case 1:case 5:break;case 4:o=!0;break;case 2:o=!0;break}switch(e.stretch){case 1:case 4:break;case 5:n=!0;break;case 2:n=!0;break}let r=this.panel.defaultStretch;return n===null&&(n=r===5||r===2),o===null&&(o=r===4||r===2),n===!0&&o===!0?this.qo(2,i):n===!0?this.qo(5,i):o===!0?this.qo(4,i):this.qo(0,i)}qo(t,e){if(e)return t;if(t===0)return 0;let i=this.desiredSize;if(i.isReal())return 0;let s=!isNaN(i.width),n=!isNaN(i.height),o=this.angle;if(s)if(o!==90&&o!==270){if(t===5)return 0;if(t===2)return 4}else{if(t===4)return 0;if(t===2)return 5}if(n)if(o!==90&&o!==270){if(t===4)return 0;if(t===2)return 5}else{if(t===5)return 0;if(t===2)return 4}return t}get segmentOrientation(){return this.Ot!==null?this.Ot._p:0}set segmentOrientation(t){let e=this.segmentOrientation;e!==t&&(this.Ot===null&&(this.Ot=new Re),this.Ot._p=t,this.f(),this.t("segmentOrientation",e,t),t===0&&(this.angle=0))}pI(){this.segmentOrientation=21}get segmentIndex(){return this.Ot!==null?this.Ot.t0:-1/0}set segmentIndex(t){t=Math.round(t);let e=this.segmentIndex;e!==t&&(this.Ot===null&&(this.Ot=new Re),this.Ot.t0=t,this.f(),this.t("segmentIndex",e,t))}get segmentFraction(){return this.Ot!==null?this.Ot.e0:0}set segmentFraction(t){t<0?t=0:t>1&&(t=1);let e=this.segmentFraction;e!==t&&(this.Ot===null&&(this.Ot=new Re),this.Ot.e0=t,this.f(),this.t("segmentFraction",e,t))}get segmentOffset(){return this.Ot!==null?this.Ot.i0:P.dn}set segmentOffset(t){let e=this.segmentOffset;e.equals(t)||(t=t.N(),this.Ot===null&&(this.Ot=new Re),this.Ot.i0=t,this.f(),this.t("segmentOffset",e,t))}get stretch(){return this.w!==null?this.w.ao:1}set stretch(t){let e=this.stretch;e!==t&&(this.Yt().ao=t,this.f(),this.t("stretch",e,t))}get name(){return this.w!==null?this.w.Pt:""}set name(t){let e=this.name;e!==t&&(this.Yt().Pt=t,this.part!==null&&this.part.s0(),this.t("name",e,t))}get opacity(){return this.Zt}set opacity(t){t<0?t=0:t>1&&(t=1);let e=this.opacity;if(e!==t){this.Zt=t,this.t("opacity",e,t);let i=this.diagram,s=this.part;i!==null&&s!==null&&i.C(s.hh(s.actualBounds))}}get filter(){return this.Gp}set filter(t){let e=this.filter;if(e!==t){this.Gp=t,this.Ji(!0),this.t("filter",e,t);let i=this.diagram,s=this.part;i!==null&&s!==null&&i.C(s.hh(s.actualBounds))}}get visible(){return(this.n&1)!==0}set visible(t){let e=(this.n&1)!==0;if(e!==t){this.n=this.n^1,this.wf(),this.t("visible",e,t);let i=this.panel;i!==null?i.f():this.Qs()&&this.Xe(t),this.C(),this.nD()}}get pickable(){return(this.n&2)!==0}set pickable(t){let e=(this.n&2)!==0;e!==t&&(this.n=this.n^2,this.t("pickable",e,t))}get fromLinkableDuplicates(){return(this.n&4)!==0}set fromLinkableDuplicates(t){let e=(this.n&4)!==0;e!==t&&(this.n=this.n^4,this.t("fromLinkableDuplicates",e,t))}get fromLinkableSelfNode(){return(this.n&8)!==0}set fromLinkableSelfNode(t){let e=(this.n&8)!==0;e!==t&&(this.n=this.n^8,this.t("fromLinkableSelfNode",e,t))}get toLinkableDuplicates(){return(this.n&16)!==0}set toLinkableDuplicates(t){let e=(this.n&16)!==0;e!==t&&(this.n=this.n^16,this.t("toLinkableDuplicates",e,t))}get toLinkableSelfNode(){return(this.n&32)!==0}set toLinkableSelfNode(t){let e=(this.n&32)!==0;e!==t&&(this.n=this.n^32,this.t("toLinkableSelfNode",e,t))}get isPanelMain(){return(this.n&64)!==0}set isPanelMain(t){let e=(this.n&64)!==0;e!==t&&(this.n=this.n^64,this.f(),this.t("isPanelMain",e,t))}get isActionable(){return(this.n&128)!==0}set isActionable(t){let e=(this.n&128)!==0;e!==t&&(this.n=this.n^128,this.t("isActionable",e,t))}get background(){return this.Lt}set background(t){let e=this.background;e!==t&&(t!==null&&R.Md(t,"GraphObject.background"),t instanceof R&&t.k(),this.Lt=t,this.C(),this.t("background",e,t))}LN(){return(this.n&512)!==0}E1(t){t?this.n|=512:this.n&=-513}gf(){return(this.n&1024)!==0}DN(t){t?this.n|=1024:this.n&=-1025}B1(){return(this.n&2048)!==0}Sd(t){t?this.n|=2048:this.n&=-2049}Hp(){return(this.n&4096)!==0}Na(t){t?this.n|=4096:this.n&=-4097}Xo(){return(this.n&8192)!==0}xi(t){t?this.n|=8192:this.n&=-8193}as(){return(this.n&16384)!==0}lo(t){t?this.n|=16384:this.n&=-16385}gI(){return(this.n&32768)!==0}Ji(t){t?this.n|=32768:this.n&=-32769}get part(){if(this.Qs())return this;if(this.sl!==null)return this.sl;let t=this;for(t=t.panel;t;){if(t instanceof pt)return this.sl=t,t;t=t.panel}return null}get svg(){return this.F1}set svg(t){this.F1=t}jc(){this.svg=null}get panel(){return this.$s}Uh(t){this.$s=t,this.svg!==null&&this.svg.remove()}get layer(){let t=this.part;return t!==null?t.layer:null}get diagram(){let t=this.part;return t!==null?t.diagram:null}get position(){return this.ct}set position(t){let e=t.x,i=t.y,s=this.position,n=s.x,o=s.y;n!==e&&(!isNaN(n)||!isNaN(e))||o!==i&&(!isNaN(o)||!isNaN(i))?(t=t.copy(),this.vN(t,n,o)&&this.t("position",new P(n,o),t.copy())):this.FN()}FN(){}vN(t,e,i){return this.ct=t,this.kf(),!0}Ec(t,e,i){this.ct.x===t&&this.ct.y===e||(this.ct.e(t,e),this.pf())}get actualBounds(){return this.De}get scale(){return this.it}set scale(t){let e=this.scale;e!==t&&(t<=0&&m.o("GraphObject.scale for "+this+" must be greater than zero, not: "+t),this.it=t,this.f(),this.t("scale",e,t))}get angle(){return this.Xt}set angle(t){let e=this.angle;if(e!==t){if(t=t%360,t<0&&(t+=360),e===t)return;this.Xt=t,this.nD(),this.f(),this.t("angle",e,t)}}get desiredSize(){return this.cs}set desiredSize(t){let e=t.width,i=t.height,s=this.desiredSize,n=s.width,o=s.height;if((n!==e&&(!isNaN(n)||!isNaN(e))||o!==i&&(!isNaN(o)||!isNaN(i)))&&(t=t.N(),this.cs=t,this.f(),this instanceof et&&this.ai(),this.t("desiredSize",s,t),this.gf())){let r=this.part;r!==null&&(this.Eh(r,"width"),this.Eh(r,"height"))}}get width(){return this.cs.width}set width(t){let e=this.cs.width;if(e!==t&&(!isNaN(e)||!isNaN(t))){let i=this.cs,s=new st(t,this.cs.height).k();if(this.cs=s,this.f(),this instanceof et&&this.ai(),this.t("desiredSize",i,s),this.gf()){let n=this.part;n!==null&&this.Eh(n,"width")}}}get height(){return this.cs.height}set height(t){let e=this.cs.height;if(e!==t&&(!isNaN(e)||!isNaN(t))){let i=this.cs,s=new st(this.cs.width,t).k();if(this.cs=s,this.f(),this instanceof et&&this.ai(),this.t("desiredSize",i,s),this.gf()){let n=this.part;n!==null&&this.Eh(n,"height")}}}get minSize(){return this.w!==null?this.w.Nr:st.xc}set minSize(t){let e=this.minSize;e.equals(t)||(t=t.copy(),isNaN(t.width)&&(t.width=0),isNaN(t.height)&&(t.height=0),t.k(),this.Yt().Nr=t,this.f(),this.t("minSize",e,t))}get maxSize(){return this.w!==null?this.w.Cr:st.DP}set maxSize(t){let e=this.maxSize;e.equals(t)||(t=t.copy(),isNaN(t.width)&&(t.width=1/0),isNaN(t.height)&&(t.height=1/0),t.k(),this.Yt().Cr=t,this.f(),this.t("maxSize",e,t))}get measuredBounds(){return this.hi}get naturalBounds(){return this.Ke}qp(){return 0}get margin(){return this.il}set margin(t){typeof t=="number"&&(t=new Dt(t));let e=this.il;e.equals(t)||(t=t.N(),this.il=t,this.f(),this.t("margin",e,t))}get v(){return this.B1()===!0&&this.R1(),this.el}get Ws(){return this.Hp()===!0&&this.R1(),this.wa}trigger(t,e,i){let s=null;return typeof t=="string"?s=new ai(t,e,i):s=t,s.Ti=this,this.Ts===null&&(this.Ts=new Mt),this.Ts.set(s.propertyName,s),this}get Ts(){return this.w!==null?this.w.Ts:null}set Ts(t){this.Ts!==t&&(this.Yt().Ts=t)}get Mr(){return this.w!==null?this.w.Mr:0}set Mr(t){this.Mr!==t&&(this.Yt().Mr=t)}get alignment(){return this.de}set alignment(t){let e=this.alignment;e.equals(t)||(t.isNoSpot()&&!t.isDefault()&&m.o("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+t),t=t.N(),this.de=t,this.kf(),this.t("alignment",e,t))}get column(){return this.pa}set column(t){t=Math.round(t);let e=this.column;e!==t&&(t<0&&m.J(t,">= 0",$,"column"),this.pa=t,this.f(),this.t("column",e,t),this.svg!==null&&this.svg.remove())}get columnSpan(){return this.w!==null?this.w.o0:1}set columnSpan(t){t=Math.round(t);let e=this.columnSpan;e!==t&&(t<1&&m.J(t,">= 1",$,"columnSpan"),this.Yt().o0=t,this.f(),this.t("columnSpan",e,t))}get row(){return this.Xp}set row(t){t=Math.round(t);let e=this.row;e!==t&&(t<0&&m.J(t,">= 0",$,"row"),this.Xp=t,this.f(),this.t("row",e,t),this.svg!==null&&this.svg.remove())}get rowSpan(){return this.w!==null?this.w.r0:1}set rowSpan(t){t=Math.round(t);let e=this.rowSpan;e!==t&&(t<1&&m.J(t,">= 1",$,"rowSpan"),this.Yt().r0=t,this.f(),this.t("rowSpan",e,t))}get spanAllocation(){return this.w!==null?this.w.l0:null}set spanAllocation(t){let e=this.spanAllocation;e!==t&&(t!==null&&m.S(t,$,"spanAllocation"),this.Yt().l0=t,this.f(),this.t("spanAllocation",e,t))}get alignmentFocus(){return this.wd}set alignmentFocus(t){let e=this.alignmentFocus;e.equals(t)||(t=t.N(),this.wd=t,this.f(),this.t("alignmentFocus",e,t))}get portId(){return this.zp}set portId(t){let e=this.portId;if(e!==t){let i=this.part;i!==null&&!(i instanceof J)&&m.o("Cannot set portID on a Link: "+t);let s=i;e!==null&&s!==null&&s.RN(this),this.zp=t,t!==null&&s!==null&&(s.Cn=!0,s.oD(this)),this.t("portId",e,t)}}Vh(){let t=this.part;if(t instanceof J&&(this.portId!==null||this===t.port)){let e=t.diagram;e!==null&&!e.undoManager.isUndoingRedoing&&t.invalidateConnectedLinks(void 0,this)}}nD(){let t=this.diagram;t===null||t.undoManager.isUndoingRedoing||(this instanceof G?this instanceof J?this.invalidateConnectedLinks():this.walkVisualTreeFrom(this,e=>{e.Vh()}):this.Vh())}get toSpot(){return this.ft!==null?this.ft.vh:T.None}set toSpot(t){let e=this.toSpot;e.equals(t)||(t=t.N(),this.Wi().vh=t,this.t("toSpot",e,t),this.Vh())}get toEndSegmentLength(){return this.ft!==null?this.ft.Rh:10}set toEndSegmentLength(t){let e=this.toEndSegmentLength;e!==t&&(t<0&&m.J(t,">= 0",$,"toEndSegmentLength"),this.Wi().Rh=t,this.t("toEndSegmentLength",e,t),this.Vh())}get toShortLength(){return this.ft!==null?this.ft.Ih:0}set toShortLength(t){let e=this.toShortLength;e!==t&&(this.Wi().Ih=t,this.t("toShortLength",e,t),this.Vh())}get toLinkable(){return this.ft!==null?this.ft.a0:null}set toLinkable(t){let e=this.toLinkable;e!==t&&(this.Wi().a0=t,this.t("toLinkable",e,t))}get toMaxLinks(){return this.ft!==null?this.ft.h0:1/0}set toMaxLinks(t){let e=this.toMaxLinks;e!==t&&(t<0&&m.J(t,">= 0",$,"toMaxLinks"),this.Wi().h0=t,this.t("toMaxLinks",e,t))}get fromSpot(){return this.ft!==null?this.ft.Dh:T.None}set fromSpot(t){let e=this.fromSpot;e.equals(t)||(t=t.N(),this.Wi().Dh=t,this.t("fromSpot",e,t),this.Vh())}get fromEndSegmentLength(){return this.ft!==null?this.ft.Fh:10}set fromEndSegmentLength(t){let e=this.fromEndSegmentLength;e!==t&&(t<0&&m.J(t,">= 0",$,"fromEndSegmentLength"),this.Wi().Fh=t,this.t("fromEndSegmentLength",e,t),this.Vh())}get fromShortLength(){return this.ft!==null?this.ft.Oh:0}set fromShortLength(t){let e=this.fromShortLength;e!==t&&(this.Wi().Oh=t,this.t("fromShortLength",e,t),this.Vh())}get fromLinkable(){return this.ft!==null?this.ft.c0:null}set fromLinkable(t){let e=this.fromLinkable;e!==t&&(this.Wi().c0=t,this.t("fromLinkable",e,t))}get fromMaxLinks(){return this.ft!==null?this.ft.f0:1/0}set fromMaxLinks(t){let e=this.fromMaxLinks;e!==t&&(t<0&&m.J(t,">= 0",$,"fromMaxLinks"),this.Wi().f0=t,this.t("fromMaxLinks",e,t))}get cursor(){return this.w!==null?this.w.Il:""}set cursor(t){let e=this.cursor;e!==t&&(m.s(t,"string",$,"cursor"),this.Yt().Il=t,this.t("cursor",e,t))}get click(){return this.w!==null?this.w.Er:null}set click(t){let e=this.click;e!==t&&(t!==null&&m.S(t,$,"click"),this.Yt().Er=t,this.t("click",e,t))}get doubleClick(){return this.w!==null?this.w.Ur:null}set doubleClick(t){let e=this.doubleClick;e!==t&&(t!==null&&m.S(t,$,"doubleClick"),this.Yt().Ur=t,this.t("doubleClick",e,t))}get contextClick(){return this.w!==null?this.w.Vr:null}set contextClick(t){let e=this.contextClick;e!==t&&(t!==null&&m.S(t,$,"contextClick"),this.Yt().Vr=t,this.t("contextClick",e,t))}get mouseEnter(){return this.w!==null?this.w.Yr:null}set mouseEnter(t){let e=this.mouseEnter;e!==t&&(t!==null&&m.S(t,$,"mouseEnter"),this.Yt().Yr=t,this.t("mouseEnter",e,t))}get mouseLeave(){return this.w!==null?this.w.Kr:null}set mouseLeave(t){let e=this.mouseLeave;e!==t&&(t!==null&&m.S(t,$,"mouseLeave"),this.Yt().Kr=t,this.t("mouseLeave",e,t))}get mouseOver(){return this.w!==null?this.w.Br:null}set mouseOver(t){let e=this.mouseOver;e!==t&&(t!==null&&m.S(t,$,"mouseOver"),this.Yt().Br=t,this.t("mouseOver",e,t))}get mouseHover(){return this.w!==null?this.w.zr:null}set mouseHover(t){let e=this.mouseHover;e!==t&&(t!==null&&m.S(t,$,"mouseHover"),this.Yt().zr=t,this.t("mouseHover",e,t))}get mouseHold(){return this.w!==null?this.w.Xr:null}set mouseHold(t){let e=this.mouseHold;e!==t&&(t!==null&&m.S(t,$,"mouseHold"),this.Yt().Xr=t,this.t("mouseHold",e,t))}get mouseDragEnter(){return this.w!==null?this.w.u0:null}set mouseDragEnter(t){let e=this.mouseDragEnter;e!==t&&(t!==null&&m.S(t,$,"mouseDragEnter"),this.Yt().u0=t,this.t("mouseDragEnter",e,t))}get mouseDragLeave(){return this.w!==null?this.w.d0:null}set mouseDragLeave(t){let e=this.mouseDragLeave;e!==t&&(t!==null&&m.S(t,$,"mouseDragLeave"),this.Yt().d0=t,this.t("mouseDragLeave",e,t))}get mouseDrop(){return this.w!==null?this.w.Gr:null}set mouseDrop(t){let e=this.mouseDrop;e!==t&&(t!==null&&m.S(t,$,"mouseDrop"),this.Yt().Gr=t,this.t("mouseDrop",e,t))}get actionDown(){return this.w!==null?this.w.g0:null}set actionDown(t){let e=this.actionDown;e!==t&&(t!==null&&m.S(t,$,"actionDown"),this.Yt().g0=t,this.t("actionDown",e,t))}get actionMove(){return this.w!==null?this.w.m0:null}set actionMove(t){let e=this.actionMove;e!==t&&(t!==null&&m.S(t,$,"actionMove"),this.Yt().m0=t,this.t("actionMove",e,t))}get actionUp(){return this.w!==null?this.w.p0:null}set actionUp(t){let e=this.actionUp;e!==t&&(t!==null&&m.S(t,$,"actionUp"),this.Yt().p0=t,this.t("actionUp",e,t))}get actionCancel(){return this.w!==null?this.w.y0:null}set actionCancel(t){let e=this.actionCancel;e!==t&&(t!==null&&m.S(t,$,"actionCancel"),this.Yt().y0=t,this.t("actionCancel",e,t))}get toolTip(){return this.w!==null?this.w.Hr:null}set toolTip(t){let e=this.toolTip;e!==t&&(this.Yt().Hr=t,this.t("toolTip",e,t))}get contextMenu(){return this.w!==null?this.w.qr:null}set contextMenu(t){let e=this.contextMenu;e!==t&&(this.Yt().qr=t,this.t("contextMenu",e,t))}findBindingPanel(){let t=this instanceof G?this:this.panel;for(;t!==null;){if(t.ON())return t;t=t.panel}return null}bind(t,e,i,s){return this.Pf(t,e,i,s),this}bindTwoWay(t,e,i,s){return this.Pf(t,e,i,s).makeTwoWay(),this}bindModel(t,e,i,s){return this.Pf(t,e,i,s).ofModel(),this}bindObject(t,e,i,s,n){return this.Pf(t,e,i,s).ofObject(n),this}theme(t,e,i,s,n){return this.Ca(t,e,i,s,n),this}themeData(t,e,i,s,n){return this.Ca(t,e,i,s,n).ofData(),this}themeObject(t,e,i,s,n,o){return this.Ca(t,e,i,s,n).ofObject(o),this}themeModel(t,e,i,s,n){return this.Ca(t,e,i,s,n).ofModel(),this}Pf(t,e,i,s){let n=null;return typeof t=="string"?n=new te(t,e,i,s):n=t,this.w0(n),n}Ca(t,e,i,s,n){let o=null;return typeof t=="string"?o=new ii(t,e,i,s,n):o=t,this.w0(o),o}w0(t){t.Ti=this;let e=this.findBindingPanel();e!==null&&e.rD()&&m.o("Cannot add a Binding to a template that has already been copied: "+t),this.ve===null&&(this.ve=new q),this.ve.add(t)}set(t){return t?(Object.assign(this,t),this):this}attach(t){return $.IN(this,t),this}apply(t,...e){return t.apply(this,[this,...e]),this}setProperties(t){return Y.Ap(this,t),this}static make(t,...e){let i=arguments,s=null,n=null;if(m.st(t))n=t;else if(typeof t=="string"){let r=$.z1.get(t);m.st(r)?(i=Array.prototype.slice.call(i),s=r(i),m.$(s)||m.o('GraphObject.make invoked object builder "'+t+'", but it did not return an Object')):n=X.go[t]}s===null&&((n==null||!n.constructor)&&m.o("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+t),s=new n);let o=1;if(s instanceof Y&&i.length>1){let r=s,a=i[1];(typeof a=="string"||a instanceof HTMLDivElement)&&(r.w2(a),o++)}for(let r=o;r<i.length;r++){let a=i[r];a===void 0?m.o("Undefined value at argument "+r+" for object being constructed by GraphObject.make: "+s):s&&$.IN(s,a)}return s}static IN(t,e){if(typeof e=="number")$.yI(t,e);else if(typeof e=="string")$.wI(t,e);else if(e instanceof $)t instanceof G||m.o("A GraphObject can only be added to a Panel, not to: "+t),t.add(e);else if(e instanceof Xt){let i=null;e.isRow&&m.st(t.getRowDefinition)?i=t.getRowDefinition(e.index):!e.isRow&&m.st(t.getColumnDefinition)&&(i=t.getColumnDefinition(e.index)),i instanceof Xt?i.X1(e):m.o("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+t)}else if(e instanceof Lt){let i=t;i.type=e}else if(e instanceof te)t instanceof $||t instanceof Xt?t.bind(e):m.o("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+t);else if(e instanceof ai)t instanceof $?t.trigger(e):m.o("An AnimationTrigger can only be applied to a GraphObject, not to: "+t);else if(e instanceof Kt)t instanceof wt&&t.type===4?t.figures.add(e):m.o("A PathFigure can only be added to a Path Geometry, not to: "+t);else if(e instanceof mt)t instanceof Kt?t.segments.add(e):m.o("A PathSegment can only be added to a PathFigure, not to: "+t);else if(e instanceof _t)t instanceof Y||t instanceof ht?t.layout=e:m.o("A Layout can only be assigned to a Diagram or a Group, not to: "+t);else if(Array.isArray(e))for(let i=0;i<e.length;i++){let s=e[i];$.IN(t,s)}else m.$(e)?$.xI(t,e):m.o('Unknown initializer "'+e+'" for object being constructed by GraphObject.make: '+t)}static wI(t,e){if(t instanceof lt)t.text=e;else if(t instanceof et)t.figure=e;else if(t instanceof Bt)t.source=e;else if(t instanceof G){let i=Lt.fs.get(e);i!==null&&(t.type=i)}else if(t instanceof R){let i=m.$a(Oe,e);i!==null?t.type=i:m.o("Unknown Brush type as an argument to GraphObject.make: "+e)}else if(t instanceof wt){let i=m.$a(Ke,e);i!==null&&(t.type=i)}else if(t instanceof mt){let i=m.$a(ni,e);i!==null&&(t.type=i)}}static yI(t,e){m.st(t.fe)?t.fe(e):m.ur(t,e)}static xI(t,e){if(t instanceof R){let i=new yt;for(let s in e){let n=parseFloat(s);isNaN(n)?i[s]=e[s]:t.addColorStop(n,e[s])}Y.Ap(t,i)}else if(t instanceof Xt){if(e.row!==void 0){let s=e.row;(s==null||s===1/0||isNaN(s)||s<0)&&m.o("Must specify non-negative integer row for RowColumnDefinition "+e+", not: "+s),t.isRow=!0,t.index=s}else if(e.column!==void 0){let s=e.column;(s==null||s===1/0||isNaN(s)||s<0)&&m.o("Must specify non-negative integer column for RowColumnDefinition "+e+", not: "+s),t.isRow=!1,t.index=s}let i=new yt;for(let s in e)s==="row"||s==="column"||(i[s]=e[s]);Y.Ap(t,i)}else Y.Ap(t,e)}static build(t,e,...i){let s=$.z1.get(t);if(m.st(s)){let n=s([t].concat(i));if(n instanceof $)return e&&n.setProperties(e),n}m.o('GraphObject.build invoked object builder "'+t+'", but it did not return an Object')}static defineBuilder(t,e){m.s(t,"string",$,"defineBuilder:name"),m.S(e,$,"defineBuilder:func");let i=t.toLowerCase();$.z1.set(t,e)}static isBuilderDefined(t){return $.z1.has(t)}static takeBuilderArgument(t,e,i){i===void 0&&(i=null);let s=t[1];return(m.st(i)?i(s):typeof s=="string")?(t.splice(1,1),s):(e===void 0&&m.o("no "+(m.st(i)?"satisfactory":"string")+" argument for GraphObject builder "+t[0]),e)}static z1=new Mt}$.Vertical=4,$.Horizontal=5,$.defineBuilder("Button",x=>{let t="#f5f5f5",e="#737373",i="#d4d4d4",s="#737373",n="#a3a3a3",o=2.76142374915397,r=2.761423749153969,a=new G(G.Auto,{isActionable:!0,enabledChanged:(h,l)=>{if(h instanceof G){let u=h.findObject("ButtonBorder");if(u!==null)if(h._buttonFillNormal===void 0&&(h._buttonFillNormal=u.fill),l){let c=null;h.layer!==null&&h.diagram!==null&&h.isVisibleObject()&&(c=h.layer.findObjectAt(h.diagram.lastInput.documentPoint)),c===h||c!==null&&c.isContainedBy(h)?u.fill=h._buttonFillOver:u.fill=h._buttonFillNormal}else u.fill=h._buttonFillDisabled}},cursor:"pointer"}).attach({_buttonFillNormal:void 0,_buttonStrokeNormal:void 0,_buttonFillOver:i,_buttonStrokeOver:s,_buttonFillDisabled:n}).add(new et("RoundedRectangle",{name:"ButtonBorder",spot1:new T(0,0,o,r),spot2:new T(1,1,-o,-r),parameter1:2,fill:t,stroke:e}));return a.mouseEnter=(h,l,u)=>{if(!l.isEnabledObject()||!(l instanceof G))return;let c=l.findObject("ButtonBorder");c instanceof et&&(l._buttonFillNormal===void 0&&(l._buttonFillNormal=c.fill),c.fill=l._buttonFillOver,l._buttonStrokeNormal===void 0&&(l._buttonStrokeNormal=c.stroke),c.stroke=l._buttonStrokeOver)},a.mouseLeave=(h,l,u)=>{if(!l.isEnabledObject()||!(l instanceof G))return;let c=l.findObject("ButtonBorder");c instanceof et&&(l._buttonFillNormal!==void 0&&(c.fill=l._buttonFillNormal),l._buttonStrokeNormal!==void 0&&(c.stroke=l._buttonStrokeNormal))},a}),$.defineBuilder("TreeExpanderButton",x=>{let t=$.build("Button");return t.attach({_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine",visible:!1}),t.add(new et("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:st.Pu}).bindObject("figure","isTreeExpanded",(e,i)=>{let s=i.panel;return e?s._treeExpandedFigure:s._treeCollapsedFigure})),t.bindObject("visible","isTreeLeaf",e=>!e),t.click=(e,i)=>{let s=i.part;if(s instanceof vt&&(s=s.adornedPart),!(s instanceof J))return;let n=s.diagram;if(n===null)return;let o=n.commandHandler;if(s.isTreeExpanded){if(!o.canCollapseTree(s))return}else if(!o.canExpandTree(s))return;e.handled=!0,s.isTreeExpanded?o.collapseTree(s):o.expandTree(s)},t}),$.defineBuilder("SubGraphExpanderButton",x=>{let t=$.build("Button");return t.attach({_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"}),t.add(new et("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:st.Pu}).bindObject("figure","isSubGraphExpanded",(e,i)=>{let s=i.panel;return e?s._subGraphExpandedFigure:s._subGraphCollapsedFigure})),t.click=(e,i)=>{let s=i.part;if(s instanceof vt&&(s=s.adornedPart),!(s instanceof ht))return;let n=s.diagram;if(n===null)return;let o=n.commandHandler;if(s.isSubGraphExpanded){if(!o.canCollapseSubGraph(s))return}else if(!o.canExpandSubGraph(s))return;e.handled=!0,s.isSubGraphExpanded?o.collapseSubGraph(s):o.expandSubGraph(s)},t}),$.defineBuilder("ToolTip",x=>new vt(G.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new P(0,2),mouseOver:(t,e)=>{let i=t.diagram.toolManager;i.extendToolTip(i.toolTipDuration)}}).add(new et("RoundedRectangle",{name:"Border",parameter1:1,fill:"#f5f5f5",strokeWidth:0,spot1:new T(0,0,4,6),spot2:new T(1,1,-4,-4)}))),$.defineBuilder("ContextMenu",x=>new vt(G.Vertical,{background:"#f5f5f5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new P(0,2)}).bindObject("background","",t=>t.adornedPart!==null&&t.hasPlaceholder()?null:"#f5f5f5")),$.defineBuilder("ContextMenuButton",x=>{let t=$.build("Button");t.stretch=5;let e=t.findObject("ButtonBorder");return e instanceof et&&(e.figure="Rectangle",e.strokeWidth=0,e.spot1=new T(0,0,4,6),e.spot2=new T(1,1,-4,-4)),t}),$.defineBuilder("PanelExpanderButton",x=>{let t=$.takeBuilderArgument(x,"COLLAPSIBLE"),e=$.build("Button");e.attach({_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8","ButtonBorder.fill":"rgba(0, 0, 0, 0)",_buttonFillNormal:"rgba(0, 0, 0, 0)","ButtonBorder.stroke":null,_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null}),e.add(new et({name:"ButtonIcon",strokeWidth:2}).bindObject("geometryString","visible",s=>s?e._buttonExpandedFigure:e._buttonCollapsedFigure,void 0,t));let i=e.findObject("ButtonBorder");return i instanceof et&&(i.stroke=null,i.fill="rgba(0, 0, 0, 0)"),e.click=(s,n)=>{if(!(n instanceof G))return;let o=n.diagram;if(o===null||o.isReadOnly)return;let r=n.findBindingPanel();if(r===null&&(r=n.part),r!==null){let a=r.findObject(t);a!==null&&(s.handled=!0,o.startTransaction("Collapse/Expand Panel"),a.visible=!a.visible,o.commitTransaction("Collapse/Expand Panel"))}},e}),$.defineBuilder("CheckBoxButton",x=>{let t=$.takeBuilderArgument(x),e=$.build("Button",{desiredSize:new st(14,14)});e.attach({"ButtonBorder.spot1":new T(0,0,1,1),"ButtonBorder.spot2":new T(1,1,-1,-1)});let i=new et({name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:2,geometryStretch:6,visible:!1});return t!==""&&i.bindTwoWay("visible",t),e.add(i),e.click=(s,n)=>{if(!(n instanceof G))return;let o=s.diagram;if(o===null||o.isReadOnly||t!==""&&o.model.isReadOnly)return;s.handled=!0;let r=n.findObject("ButtonIcon");o.startTransaction("checkbox"),r!==null&&(r.visible=!r.visible),m.st(n._doClick)&&n._doClick(s,n),o.commitTransaction("checkbox")},e}),$.defineBuilder("CheckBox",x=>{let t=$.takeBuilderArgument(x),e=$.build("CheckBoxButton",{name:"Button",isActionable:!1,margin:new Dt(0,1,0,0)},t),i=new G("Horizontal",{isActionable:!0,cursor:e.cursor,margin:new Dt(1),mouseEnter:e.mouseEnter,mouseLeave:e.mouseLeave,click:e.click}).attach({_buttonFillNormal:e._buttonFillNormal,_buttonStrokeNormal:e._buttonStrokeNormal,_buttonFillOver:e._buttonFillOver,_buttonStrokeOver:e._buttonStrokeOver,_buttonFillDisabled:e._buttonFillDisabled,_buttonClick:e.click});return i.add(e),e.mouseEnter=null,e.mouseLeave=null,e.click=null,i}),$.defineBuilder("AutoRepeatButton",x=>{let t=$.takeBuilderArgument(x,50,r=>typeof r=="number"),e=$.takeBuilderArgument(x,500,r=>typeof r=="number");function i(r,a){n(r,a),a.click&&(a.Nd=m.un(()=>s(r,a),e))}function s(r,a){a.Nd&&m.yc(a.Nd),a.click&&(a.Nd=m.un(()=>{a.click&&(a.click(r,a),s(r,a))},t))}function n(r,a){a.Nd&&(m.yc(a.Nd),a.Nd=void 0)}let o=$.build("Button");return o.actionDown=(r,a)=>i(r,a),o.actionUp=(r,a)=>n(r,a),o.actionCancel=(r,a)=>n(r,a),o}),$.defineBuilder("ToggleSwitch",function(x){let t=$.takeBuilderArgument(x);t||m.o("ToggleSwitch must be data-bound to a property name, not: "+t);let e=$.takeBuilderArgument(x,!1,r=>typeof r=="boolean"),i="gray",s="transparent",n="white",o=new G("Auto",{width:e?15:28,height:e?28:15}).attach({_buttonFillOff:i,_buttonBorderOff:s,_buttonIconFillOff:n,_buttonFillOn:"green",_buttonBorderOn:"transparent",_buttonIconFillOn:"white"}).add(new et("Capsule",{name:"ButtonBorder",fill:i,stroke:s,strokeWidth:1}).bind("fill",t,(r,a)=>r?a.panel._buttonFillOn:a.panel._buttonFillOff).bind("stroke",t,(r,a)=>r?a.panel._buttonBorderOn:a.panel._buttonBorderOff)).add(new et("Circle",{name:"ButtonIcon",width:11,height:11,fill:n,stroke:null,alignment:e?T.Bottom:T.Left}).bind("fill",t,(r,a)=>r?a.panel._buttonIconFillOn:a.panel._buttonIconFillOff).bind("alignment",t,r=>r?e?T.Top:T.Right:e?T.Bottom:T.Left));return o.click=function(r,a){if(!a.isEnabledObject())return;let h=r.diagram;if(h===null||h.isReadOnly||t!==""&&h.model.isReadOnly)return;r.handled=!0;let l=a.findBindingPanel();l!==null&&(h.startTransaction("toggle switch"),h.model.set(l.data,t,!l.data[t]),typeof a._doClick=="function"&&a._doClick(r,a),h.commitTransaction("toggle switch"))},o}),$.defineBuilder("Toggle",function(x){let t=$.takeBuilderArgument(x),e=$.build("ToggleSwitch",{name:"Button"},t),i=new G("Horizontal",{cursor:e.cursor,margin:1,mouseEnter:e.mouseEnter,mouseLeave:e.mouseLeave,click:e.click}).attach({_buttonClick:e.click}).add(e);return e.mouseEnter=null,e.mouseLeave=null,e.click=null,i});class Ue{me;Pt;no;ve;oo;Ds;Il;Er;Ur;Vr;Yr;Kr;Br;zr;Xr;u0;d0;Gr;g0;m0;p0;y0;Hr;qr;Zp;l0;Ts;Nr;Cr;ao;r0;o0;Mr;Jp;x0;b0;constructor(){this.me=!1,this.Pt="",this.no=-1,this.ve=null,this.oo=null,this.Ds=null,this.Il="",this.Er=null,this.Ur=null,this.Vr=null,this.Yr=null,this.Kr=null,this.Br=null,this.zr=null,this.Xr=null,this.u0=null,this.d0=null,this.Gr=null,this.g0=null,this.m0=null,this.p0=null,this.y0=null,this.Hr=null,this.qr=null,this.Zp=null,this.l0=null,this.Ts=null,this.Nr=st.xc,this.Cr=st.DP,this.ao=1,this.r0=1,this.o0=1,this.Mr=0,this.Jp=null,this.x0=null,this.b0="category"}copy(){let t=new Ue;return t.Pt=this.Pt,t.no=this.no,t.ve=this.ve,t.Ds=this.Ds,t.Il=this.Il,t.Er=this.Er,t.Ur=this.Ur,t.Vr=this.Vr,t.Yr=this.Yr,t.Kr=this.Kr,t.Br=this.Br,t.zr=this.zr,t.Xr=this.Xr,t.u0=this.u0,t.d0=this.d0,t.Gr=this.Gr,t.g0=this.g0,t.m0=this.m0,t.p0=this.p0,t.y0=this.y0,t.Hr=this.Hr,t.qr=this.qr,t.Zp=this.Zp,t.l0=this.l0,t.Ts=this.Ts,t.Nr=this.Nr.N(),t.Cr=this.Cr.N(),t.ao=this.ao,t.r0=this.r0,t.o0=this.o0,t.Mr=this.Mr,t.Jp=this.Jp,t.x0=this.x0,t.b0=this.b0,t}}class Si{m;constructor(){this.m=[1,0,0,1,0,0]}copy(){let t=new Si;return t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5],t}translate(t,e){this.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e}scale(t,e){this.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e}rotate(t,e,i){if(t=C.Ee(t),t===0)return;this.translate(e,i);let s=0,n=0;if(t===90)s=0,n=1;else if(t===180)s=-1,n=0;else if(t===270)s=0,n=-1;else{let l=t*Math.PI/180;s=Math.cos(l),n=Math.sin(l)}let o=this.m[0]*s+this.m[2]*n,r=this.m[1]*s+this.m[3]*n,a=this.m[0]*-n+this.m[2]*s,h=this.m[1]*-n+this.m[3]*s;this.m[0]=o,this.m[1]=r,this.m[2]=a,this.m[3]=h,this.translate(-e,-i)}}class li{type;x1;y1;r1;x2;y2;r2;colors;pattern;constructor(t){this.type=t,this.x1=0,this.y1=0,this.r1=0,this.x2=0,this.y2=0,this.r2=0,this.colors=[],this.pattern=null}addColorStop(t,e){this.colors.push({offset:t,color:e})}}class ui{bt;_t;tl;ud;EN;constructor(t,e,i){let s=e===void 0?X.document:e;this.tl=s,this.EN="http://www.w3.org/2000/svg";let n="http://www.w3.org/2000/xmlns/";s!==void 0&&(this.bt=this.makeElement("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",i||(this.style.position="absolute"),this.bt.setAttributeNS(n,"xmlns",this.EN),this.bt.setAttributeNS(n,"xmlns:xlink","http://www.w3.org/1999/xlink")),this.ud=null,this._t=new re(this,i)}resize(t,e,i,s){return this.width!==t||this.height!==e?(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=s+"px",this.bt.setAttributeNS(null,"width",i+"px"),this.bt.setAttributeNS(null,"height",s+"px"),this.bt.setAttributeNS(null,"viewBox","0 0 "+i+" "+s),this._t.UN.firstElementChild.setAttributeNS(null,"width",i+"px"),this._t.UN.firstElementChild.setAttributeNS(null,"height",s+"px"),!0):!1}makeElement(t,e,i){let s=this.tl.createElementNS(this.EN,t);if(m.$(e))for(let n in e)s.setAttributeNS(n==="href"?"http://www.w3.org/1999/xlink":"",n,e[n]);return i!==void 0&&(s.textContent=i),s}getBoundingClientRect(){return this.bt.getBoundingClientRect()}focus(){this.bt.focus()}get width(){return parseInt(this.bt.getAttribute("width")||"1")}set width(t){this.bt.setAttribute("width",t+"px")}get height(){return parseInt(this.bt.getAttribute("height")||"1")}set height(t){this.bt.setAttribute("height",t+"px")}dispose(){this.tl=null}get style(){return this.bt.style}}class re{Sf;Mf;Ln;Fe;$i;fillStyle;font;globalAlpha;lineCap;lineDashOffset;lineJoin;lineWidth;miterLimit;shadowBlur;shadowColor;shadowOffsetX;shadowOffsetY;strokeStyle;textAlign;imageSmoothingEnabled;clipInsteadOfFill;lastCreatedElement;Nf;Cf;surface;svg;UN;lD;G1;jo;La;Bh;currentElement;clipPathGroup;diagramGroup;lastDrawnPart;currentPath;outerGroup;pathAttributes;ol;vr;filter;letterSpacing;wordSpacing;partClipRect;constructor(t,e){if(this.surface=t,this.svg=t.bt,this.Nf=[],this.Cf=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetX=0,this.shadowOffsetY=0,this.ol=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Sf=0,this.Mf=0,this.Ln=0,this.lastCreatedElement=null,this.currentElement=null,this.Fe=[],this.pathAttributes={},this.G1=!1,this.jo=null,this.La=0,this.lD={},this.vr=!!e,this.filter="",this.partClipRect=null,this.$i=new Si,this.letterSpacing="0px",this.wordSpacing="0px",t.tl===null||t.tl===void 0)return;this.clipPathGroup=this.newGroup2(),this.diagramGroup=this.newGroup2("gojs-diagram"),this.lastDrawnPart=null,this.currentPath=null;let i=V.Ww++,s=this.makeElement("clipPath",{id:"mainClip"+i}),n={x:0,y:0,width:t.width,height:t.height};s.appendChild(this.makeElement("rect",n)),this.UN=s,this.svg.appendChild(this.clipPathGroup),this.clipPathGroup.appendChild(this.diagramGroup),this.svg.appendChild(s),this.clipPathGroup.setAttributeNS(null,"clip-path","url(#mainClip"+i+")")}setDiagramPosScale(t,e,i,s,n,o){this.diagramGroup===void 0?this.newGroup(t,e,i,s,n,o):this.diagramGroup.setAttribute("transform","matrix("+t+", "+e+", "+i+", "+s+", "+n+", "+o+")")}resetInnerSVG(){this.diagramGroup!==null&&(this.diagramGroup.innerHTML="")}arc(t,e,i,s,n,o,r,a){let h=2*Math.PI,l=1e-6,u=h-l,c=i*Math.cos(s),d=i*Math.sin(s),f=t+c,p=e+d,g=o?0:1,y=o?s-n:n-s;(Math.abs(r-f)>l||Math.abs(a-p)>l)&&this.Fe.push(["L",f,+p]),y<0&&(y=y%h+h),y>u?(this.Fe.push(["A",i,i,0,1,g,t-c,e-d]),this.Fe.push(["A",i,i,0,1,g,f,p])):y>l&&this.Fe.push(["A",i,i,0,+(y>=Math.PI),g,t+i*Math.cos(n),e+i*Math.sin(n)])}beginPath(){this.Fe=[],this.pathAttributes={stroke:"none",fill:"none"}}endPath(t){this.bI(this.Fe,this.$i,t||0)}bezierCurveTo(t,e,i,s,n,o){this.Fe.push(["C",t,e,i,s,n,o])}clearRect(t,e,i,s){}clip(){this.pathAttributes.clipPath=!0}closePath(){this.Fe.push(["z"])}createLinearGradient(t,e,i,s){let n=new li("linear");return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}createPattern(t,e){let i="";t instanceof HTMLCanvasElement&&(i=t.toDataURL()),t instanceof HTMLImageElement&&(i=t.getAttribute("src"));let s=this.lD;if(s[i])return"url(#"+s[i]+")";let n="PATTERN"+V.Ww++,o={width:t.width,height:t.height,id:n,patternUnits:"userSpaceOnUse"},r={x:0,y:0,width:t.width,height:t.height,href:i},a=this.makeElement("pattern",o);return a.appendChild(this.makeElement(Y.img,r)),this.svg.appendChild(a),s[i]=n,"url(#"+n+")"}createRadialGradient(t,e,i,s,n,o){let r=new li("radial");return r.x1=t,r.y1=e,r.r1=i,r.x2=s,r.y2=n,r.r2=o,r}amendImageTransform(t,e,i,s,n,o,r,a){let h=r/i,l=a/s;(n!==0||o!==0)&&this.$i.translate(n,o),(h!==1||l!==1)&&this.$i.scale(h,l),(t!==0||e!==0)&&this.$i.translate(-t,-e)}drawImage(t,e,i,s,n,o,r,a,h){let l="",u=t.width,c=t.height;typeof t.toDataURL=="function"?t.toDataURL():(l=t.getAttribute("src"),u=t.naturalWidth,c=t.naturalHeight),s===void 0&&(o=e,r=i,a=s=u,h=n=c),s=s||0,n=n||0,o=o||0,r=r||0,a=a||0,h=h||0,this.amendImageTransform(e,i,s,n,o,r,a,h);let d={x:0,y:0,width:u||s,height:c||n,href:l};!C.X(s,a)||!C.X(n,h)?d.preserveAspectRatio="none":l.toLowerCase().indexOf(".svg")===-1&&l.toLowerCase().indexOf("data:image/svg")===-1&&(d.preserveAspectRatio="xMidYMid slice"),(e!==0||i!==0||s!==u||n!==c)&&(s+=e,n+=i,d["clip-path"]=`path('M ${e},${i} L ${s} ${i} L ${s} ${n} L ${e} ${n} z')`),this.processCommon(Y.img,d,this.$i),this.Cd(Y.img,d)}fill(t,e){t&&(this.pathAttributes["fill-rule"]="evenodd"),this.setFill(this.pathAttributes)}fillContext(t,e,i){this.clipInsteadOfFill?this.clip():this.fill(e,i)}createOrUpdateClipGroup(t,e){let i=this.newGroup(1,0,0,1,-e.x,-e.y);i.setAttributeNS(null,"class","spotClip"),t.xa=i}fillRect(t,e,i,s){this.addRect("fill",[t,e,i,s],this.$i)}fillBackground(t,e,i,s){let n={x:t,y:e,width:i,height:s};this.processCommon("fill",n,this.$i),this.setFill(n),this.svg.prepend(this.makeElement("rect",n))}fillText(t,e,i){this.addText("fill",[t,e,i],this.$i)}lineTo(t,e){this.Fe.push(["L",t,e])}moveTo(t,e){this.Fe.push(["M",t,e])}quadraticCurveTo(t,e,i,s){this.Fe.push(["Q",t,e,i,s])}rect(t,e,i,s){this.Fe.push(["M",t,e],["L",t+i,e],["L",t+i,e+s],["L",t,e+s],["z"])}restore(){this.$i=this.Nf.pop(),this.Fe=this.Nf.pop();let t=this.Nf.pop();this.fillStyle=t.fillStyle,this.font=t.font,this.globalAlpha=t.globalAlpha,this.lineCap=t.lineCap,this.lineDashOffset=t.lineDashOffset,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this.shadowBlur=t.shadowBlur,this.shadowColor=t.shadowColor,this.shadowOffsetX=t.shadowOffsetX,this.shadowOffsetY=t.shadowOffsetY,this.strokeStyle=t.strokeStyle,this.textAlign=t.textAlign,this.partClipRect=t.partClipRect,this.letterSpacing=t.letterSpacing,this.wordSpacing=t.wordSpacing}save(){let t={fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,partClipRect:this.partClipRect};this.Nf.push(t);let e=[];for(let i=0;i<this.Fe.length;i++)e.push(this.Fe[i]);this.Nf.push(e),this.Nf.push(this.$i.copy())}setTransform(t,e,i,s,n,o){t===1&&e===0&&i===0&&s===1&&n===0&&o===0||this.newGroup(t,e,i,s,n,o)}setCurrentTransform(t,e,i,s,n,o){this.$i.m=[t,e,i,s,n,o]}getCurrentTransform(){let t=this.$i.m;return"matrix("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}scale(t,e){this.$i.scale(t,e)}translate(t,e){this.$i.translate(t,e)}transform(t,e,i,s,n,o){}commitTransform(){}stroke(){this.setStroke(this.pathAttributes)}strokeContext(){this.clipInsteadOfFill||this.stroke()}strokeRect(t,e,i,s){this.addRect("stroke",[t,e,i,s],this.$i)}makeElement(t,e,i){return this.surface.makeElement(t,e,i)}Cd(t,e,i){let s=this.makeElement(t,e,i);return this.currentElement!==null?this.currentElement.appendChild(s):this.currentElement=s,this.lastCreatedElement=s,s}processCommon(t,e,i){if(t==="fill"?this.setFill(e):t==="stroke"&&this.setStroke(e),i!==null){let s=i.m;e.transform="matrix("+s[0]+", "+s[1]+", "+s[2]+", "+s[3]+", "+s[4]+", "+s[5]+")"}}setFill(t){if(this.fillStyle instanceof li){t.fill=this.addGradient(this.fillStyle,"fill");return}if(/^rgba\(/.test(this.fillStyle)){let e=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(this.fillStyle);t.fill="rgb("+e[1]+","+e[2]+","+e[3]+")",t["fill-opacity"]=e[4]}else t.fill=this.fillStyle}setFillOrStrokeInPlace(t,e){let i=e?"fill":"stroke";if(this.fillStyle instanceof li){t.setAttributeNS(null,"fill",this.addGradient(this.fillStyle,i));return}if(/^rgba\(/.test(this.fillStyle)){let s=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(this.fillStyle);t.setAttributeNS(null,i,"rgb("+s[1]+","+s[2]+","+s[3]+")"),t.setAttributeNS(null,i+"-opacity",s[4])}else t.setAttributeNS(null,i,this.fillStyle)}setStroke(t){if(this.strokeStyle instanceof li)t.stroke=this.addGradient(this.strokeStyle,"stroke");else if(/^rgba\(/.test(this.strokeStyle)){let e=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(this.strokeStyle);t.stroke="rgb("+e[1]+","+e[2]+","+e[3]+")",t["stroke-opacity"]=e[4]}else t.stroke=this.strokeStyle;t["stroke-width"]=this.lineWidth,t["stroke-linecap"]=this.lineCap,t["stroke-linejoin"]=this.lineJoin,t["stroke-miterlimit"]=this.miterLimit,this.G1&&(t["stroke-dasharray"]=this.jo.toString(),t["stroke-dashoffset"]=this.La)}addGradient(t,e){let i="",s=this.currentPath!==null?this.currentPath.getAttribute(e):null;if(s!==null&&s.indexOf("GRAD")!==-1){i=s.split("#")[1].slice(0,-1);let a=this.svg.getElementById(i);a!==null&&a.remove()}else i="GRAD"+V.Ww++;let n;if(t.type==="linear"){let a={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2,id:i,gradientUnits:"userSpaceOnUse"};n=this.makeElement("linearGradient",a)}else if(t.type==="radial"){let a={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2,r1:t.r1,r2:t.r2,id:i};n=this.makeElement("radialGradient",a)}else m.o("invalid gradient");let o=t.colors.sort((a,h)=>a.offset>h.offset?1:-1),r=o.length;for(let a=0;a<r;a++){let h=o[a],l=h.color;n.appendChild(this.makeElement("stop",{offset:h.offset,"stop-color":l}))}return this.svg.appendChild(n),"url(#"+i+")"}addRect(t,e,i){let s={x:e[0],y:e[1],width:e[2],height:e[3]};this.processCommon(t,s,i),this.Cd("rect",s)}addText(t,e,i){let s=this.textAlign;s==="left"?s="start":s==="right"?s="end":s==="center"&&(s="middle");let n={x:e[1],y:e[2],style:"font: "+this.font,"text-anchor":s};n["letter-spacing"]=this.letterSpacing,n["word-spacing"]=this.wordSpacing,this.processCommon(t,n,i),this.Cd("text",n,e[0])}bI(t,e,i){let s=this.kI(t),n=this.pathAttributes;if(n.clipPath){this.Cf.length>1&&this.Cf[this.Cf.length-2].setAttributeNS(null,"clip-path",'path("'+s+'") view-box');return}if(n.d=s,this.processCommon("",n,e),this.currentPath!==null){let o=this.currentPath;if(o.nodeName!=="g")for(let r in n)r!=="transform"&&o.setAttributeNS(null,r,n[r]);else{let r=o.getElementsByTagName("path");for(let a in n)a!=="transform"&&r[i].setAttributeNS(null,a,n[a])}}else this.Cd("path",n)}kI(t){let e=[];for(let i=0;i<t.length;i++){let s=t[i].slice(),n=[s.shift()];if(n[0]==="A")n.push(s.shift()+","+s.shift(),s.shift(),s.shift()+","+s.shift(),s.shift()+","+s.shift());else for(;s.length;)n.push(s.shift()+","+s.shift());e.push(n.join(" "))}return e.join(" ")}newGroup(t,e,i,s,n,o){let r=new Si;r.m=[t,e,i,s,n,o];let a={};this.processCommon("g",a,r);let h=this.Cd("g",a);return this.Cf.push(h),h}newGroup2(t){let e={};t&&(e.class=t);let i=this.Cd("g",e);return this.Cf.push(i),i}endGroup(){return this.Cf.pop()}dummyGroup(){return this.newGroup2(),this.endGroup()}shadowsSet(t,e,i){this.Sf=t,this.Mf=e,this.Ln=i}shadowsOff(){this.ol=!1,this.shadowOffsetX=0,this.shadowOffsetY=0,this.shadowBlur=0}shadowsOn(){this.ol=!0,this.shadowOffsetX=this.Sf,this.shadowOffsetY=this.Mf,this.shadowBlur=this.Ln}enableDash(t,e){this.G1=!0,this.jo=t,this.La=e}disableDash(){this.G1=!1}clearContextCache(t){}setImageSmoothingEnabled(t){}rotate(t){this.$i.rotate(t*57.2958,0,0)}getImageData(t,e,i,s){return null}measureText(t){return null}removeOldGradient(t,e,i){let s=e.getAttribute(i);if(s===null)return;let n=s.split("#");if(n.length===1)return;let o=this.svg.getElementById(n[1].slice(0,-1));if(o!==null){let r=new RegExp(o.id,"g");this.svg.innerHTML.match(r).length===1&&o.remove()}}removePartFromView(t){t.svg!==null&&t.svg.parentNode===this.diagramGroup&&t.svg.remove()}}class Fe{bt;_t;tl;ud;constructor(t,e,i,s){let n=e===void 0?X.document:e;this.tl=n,this.ud=null;let o=n.createElement("canvas");o.tabIndex=0,this.bt=o,this._t=new ci(o,i,s),t&&Y.ji.set(o,t)}resize(t,e,i,s){return this.width!==t||this.height!==e?(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=s+"px",!0):!1}toDataURL(t,e){return this.bt.toDataURL(t,e)}getBoundingClientRect(){return this.bt.getBoundingClientRect()}focus(){this.bt.focus()}get width(){return this.bt.width}set width(t){this.bt.width=t}get height(){return this.bt.height}set height(t){this.bt.height=t}dispose(){Y.ji.delete(this.bt),this.tl=null}get style(){return this.bt.style}}class ci{F;Y1;K1;H1;clipInsteadOfFill;Sf;Mf;Ln;Bh;ol;vr;constructor(t,e,i){t.getContext||m.o("Browser does not support HTML Canvas Element"),this.F=t.getContext("2d",e),this.Y1="",this.K1="",this.H1="",this.clipInsteadOfFill=!1,this.Sf=0,this.Mf=0,this.Ln=0,this.ol=!1,this.Bh=new Nt,this.vr=!!i}createOrUpdateClipGroup(t,e){}setImageSmoothingEnabled(t){this.F.imageSmoothingEnabled=t}get fillStyle(){return this.F.fillStyle}set fillStyle(t){this.H1!==t&&(this.F.fillStyle=t,this.H1=t)}get font(){return this.F.font}set font(t){this.Y1!==t&&(this.F.font=t,this.Y1=t)}get globalAlpha(){return this.F.globalAlpha}set globalAlpha(t){this.F.globalAlpha=t}get lineCap(){return this.F.lineCap}set lineCap(t){this.F.lineCap=t}get lineDashOffset(){return this.F.lineDashOffset}set lineDashOffset(t){this.F.lineDashOffset=t}get lineJoin(){return this.F.lineJoin}set lineJoin(t){this.F.lineJoin=t}get lineWidth(){return this.F.lineWidth}set lineWidth(t){this.F.lineWidth=t}get miterLimit(){return this.F.miterLimit}set miterLimit(t){this.F.miterLimit=t}get shadowBlur(){return this.F.shadowBlur}set shadowBlur(t){this.F.shadowBlur=t}get shadowColor(){return this.F.shadowColor}set shadowColor(t){this.F.shadowColor=t}get shadowOffsetX(){return this.F.shadowOffsetX}set shadowOffsetX(t){this.F.shadowOffsetX=t}get shadowOffsetY(){return this.F.shadowOffsetY}set shadowOffsetY(t){this.F.shadowOffsetY=t}get strokeStyle(){return this.F.strokeStyle}set strokeStyle(t){this.K1!==t&&(this.F.strokeStyle=t,this.K1=t)}get textAlign(){return this.F.textAlign}set textAlign(t){this.F.textAlign=t}get imageSmoothingEnabled(){return this.F.imageSmoothingEnabled}set imageSmoothingEnabled(t){this.F.imageSmoothingEnabled=t}get filter(){return this.F.filter}set filter(t){t===""?this.F.filter="none":this.F.filter=t}get letterSpacing(){return this.F.letterSpacing}set letterSpacing(t){this.F.letterSpacing=t}get wordSpacing(){return this.F.wordSpacing}set wordSpacing(t){this.F.wordSpacing=t}arc(t,e,i,s,n,o,r,a){this.F.arc(t,e,i,s,n,o)}beginPath(){this.F.beginPath()}endPath(){}bezierCurveTo(t,e,i,s,n,o){this.F.bezierCurveTo(t,e,i,s,n,o)}clearRect(t,e,i,s){this.commitTransform(),this.F.clearRect(t,e,i,s)}clip(t){t?this.F.clip(t):this.F.clip()}closePath(){this.F.closePath()}createLinearGradient(t,e,i,s){return this.F.createLinearGradient(t,e,i,s)}createPattern(t,e){return this.F.createPattern(t,e)}createRadialGradient(t,e,i,s,n,o){return this.F.createRadialGradient(t,e,i,s,n,o)}drawImage(t,e,i,s,n,o,r,a,h){s===void 0?this.F.drawImage(t,e,i):this.F.drawImage(t,e,i,s,n,o,r,a,h)}fill(t,e){e?this.F.fill(e,t?"evenodd":"nonzero"):this.F.fill(t?"evenodd":"nonzero")}fillRect(t,e,i,s){this.F.fillRect(t,e,i,s)}fillBackground(t,e,i,s){this.F.fillRect(t,e,i,s)}fillText(t,e,i){this.F.fillText(t,e,i)}getImageData(t,e,i,s){return this.F.getImageData(t,e,i,s)}lineTo(t,e){this.F.lineTo(t,e)}measureText(t){return this.F.measureText(t)}moveTo(t,e){this.F.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this.F.quadraticCurveTo(t,e,i,s)}rect(t,e,i,s){this.F.rect(t,e,i,s)}restore(){this.F.restore()}save(){this.commitTransform(),this.F.save()}rotate(t){this.Bh.ks(t*57.2958,0,0)}setTransform(t,e,i,s,n,o){this.Bh.setTo(t,e,i,s,n,o)}scale(t,e){this.Bh.it(t,e)}translate(t,e){this.Bh.Xs(t,e)}stroke(t){t?this.F.stroke(t):this.F.stroke()}transform(t,e,i,s,n,o){if(t===1&&e===0&&i===0&&s===1&&n===0&&o===0)return;let r=this.Bh,a=r.m11*t+r.m21*e,h=r.m12*t+r.m22*e,l=r.m11*i+r.m21*s,u=r.m12*i+r.m22*s;r.dx=r.m11*n+r.m21*o+r.dx,r.dy=r.m12*n+r.m22*o+r.dy,r.m11=a,r.m12=h,r.m21=l,r.m22=u}commitTransform(){let t=this.Bh;this.F.setTransform(t.m11,t.m12,t.m21,t.m22,t.dx,t.dy)}fillContext(t,e,i){this.radialFill(t,e,i)||this.fillOrClip(e,i)}radialFill(t,e,i){if(!(t instanceof R)||t.type!==3)return!1;let s=t.xf,n=t.V1;return n>s?(this.scale(s/n,1),this.translate((n-s)/2,0)):s>n&&(this.scale(1,n/s),this.translate(0,(s-n)/2)),this.fillOrClip(e,i),n>s?(this.translate(-(n-s)/2,0),this.scale(1/(s/n),1)):s>n&&(this.translate(0,-(s-n)/2),this.scale(1,1/(n/s))),!0}strokeContext(){this.clipInsteadOfFill||this.stroke()}fillOrClip(t,e){this.clipInsteadOfFill?this.clip(e):this.fill(t,e)}shadowsSet(t,e,i){this.Sf=t,this.Mf=e,this.Ln=i}shadowsOff(){this.ol=!1,this.shadowOffsetX=0,this.shadowOffsetY=0,this.shadowBlur=0}shadowsOn(){this.ol=!0,this.shadowOffsetX=this.Sf,this.shadowOffsetY=this.Mf,this.shadowBlur=this.Ln}enableDash(t,e){let i=this.F;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=e)}disableDash(){let t=this.F;t.setLineDash!==void 0&&(t.setLineDash(ci.EmptyArray),t.lineDashOffset=0)}clearContextCache(t){t&&(this.Y1=""),this.K1="",this.H1=""}removePartFromView(t){}static EmptyArray=Object.freeze([])}var Oe=(x=>(x[x.Solid=1]="Solid",x[x.Linear=2]="Linear",x[x.Radial=3]="Radial",x[x.Pattern=4]="Pattern",x))(Oe||{}),Ys=(x=>(x[x.Lab=1]="Lab",x[x.HSL=2]="HSL",x[x.Oklch=3]="Oklch",x))(Ys||{});class _e{n0;n1;n2;n3;constructor(){this.n0=0,this.n1=0,this.n2=0,this.n3=0}}class R{u;W;zh;ae;Cs;k0;P0;Wo;S0;Nn;xf;V1;constructor(t,e){if(V.Je(this),this.u=!1,t===void 0)this.W=1,this.zh="black";else if(typeof t=="string"){let s=m.$a(Oe,t);s!==null?(this.W=s,this.zh="black"):(this.W=1,this.zh=t)}else Object.keys(Oe).hasOwnProperty(t)?(this.W=t,this.zh="black"):typeof t=="object"&&(this.W=1,e=t);let i=this.W;if(i===2?(this.ae=T.TopCenter,this.Cs=T.BottomCenter):i===3?(this.ae=T.Center,this.Cs=T.Center):(this.ae=T.None,this.Cs=T.None),this.k0=0,this.P0=NaN,this.Wo=null,this.S0=null,this.Nn=null,this.xf=0,this.V1=0,e){let s={};for(let n in e)isFinite(parseFloat(n))?this.addColorStop(parseFloat(n),e[n]):s[n]=e[n];Object.assign(this,s)}}copy(){let t=new R;return t.W=this.W,t.zh=this.zh,t.ae=this.ae.N(),t.Cs=this.Cs.N(),t.k0=this.k0,t.P0=this.P0,this.Wo!==null&&(t.Wo=this.Wo.copy()),t.S0=this.S0,t}k(){return this.u=!0,this.Wo!==null&&this.Wo.k(),this}fe(t){t in Oe?this.type=t:m.ur(this,t)}toString(){let t="Brush(";if(this.type===1)t+=this.color;else if(this.type===2?t+="Linear ":this.type===3?t+="Radial ":this.type===4?t+="Pattern ":t+="(unknown) ",t+=this.start+" "+this.end,this.colorStops!==null){let e=this.colorStops.iterator;for(;e.next();){let i=e.key,s=e.value;t+=" "+i+":"+s}}return t+=")",t}addColorStop(t,e){return this.u&&m.L(this),(typeof t!="number"||!isFinite(t)||t>1||t<0)&&m.J(t,"0 <= loc <= 1",R,"addColorStop:loc"),m.s(e,"string",R,"addColorStop:color"),this.Wo===null&&(this.Wo=new Mt),this.Wo.set(t,e),this.W===1&&(this.type=2),this.Nn=null,this}get type(){return this.W}set type(t){this.u&&m.L(this,t),this.W=t,this.start.isNoSpot()&&(t===2?this.start=T.TopCenter:t===3&&(this.start=T.Center)),this.end.isNoSpot()&&(t===2?this.end=T.BottomCenter:t===3&&(this.end=T.Center)),this.Nn=null}get color(){return this.zh}set color(t){this.u&&m.L(this,t),this.zh=t,this.Nn=null}get start(){return this.ae}set start(t){this.u&&m.L(this,t),this.ae=t.N(),this.Nn=null}get end(){return this.Cs}set end(t){this.u&&m.L(this,t),this.Cs=t.N(),this.Nn=null}get startRadius(){return this.k0}set startRadius(t){this.u&&m.L(this,t),t<0&&m.J(t,">= zero",R,"startRadius"),this.k0=t,this.Nn=null}get endRadius(){return this.P0}set endRadius(t){this.u&&m.L(this,t),t<0&&m.J(t,">= zero",R,"endRadius"),this.P0=t,this.Nn=null}get colorStops(){return this.Wo}set colorStops(t){this.u&&m.L(this,t),this.Wo=t,this.Nn=null}get pattern(){return this.S0}set pattern(t){this.u&&m.L(this,t),this.S0=t,this.Nn=null}static randomColor(t,e){t===void 0&&(t=128),e===void 0&&(e=Math.max(t,255));let i=Math.abs(e-t),s=Math.floor(t+Math.random()*i).toString(16),n=Math.floor(t+Math.random()*i).toString(16),o=Math.floor(t+Math.random()*i).toString(16);return s.length<2&&(s="0"+s),n.length<2&&(n="0"+n),o.length<2&&(o="0"+o),"#"+s+n+o}static isValidColor(t){return X.CSS?X.CSS.supports("color",t):!0}static lighten(t){return R.lightenBy(t)}lightenBy(t,e){this.u&&m.L(this);let i=t===void 0||typeof t!="number"?.2:t,s=e===void 0?3:e;if(this.type===1)R.Eo(this.color),this.color=R.Ld(i,s);else if((this.type===2||this.type===3)&&this.colorStops!==null){let n=this.colorStops.iterator;for(;n.next();)R.Eo(n.value),this.addColorStop(n.key,R.Ld(i,s))}return this}static lightenBy(t,e,i){let s=e===void 0||typeof e!="number"?.2:e,n=i===void 0?3:i;return R.Eo(t),R.Ld(s,n)}static darken(t){return R.darkenBy(t)}darkenBy(t,e){this.u&&m.L(this);let i=t===void 0||typeof t!="number"?.2:t,s=e===void 0?3:e;if(this.type===1)R.Eo(this.color),this.color=R.Ld(-i,s);else if((this.type===2||this.type===3)&&this.colorStops!==null){let n=this.colorStops.iterator;for(;n.next();)R.Eo(n.value),this.addColorStop(n.key,R.Ld(-i,s))}return this}static darkenBy(t,e,i){let s=e===void 0||typeof e!="number"?.2:e,n=i===void 0?3:i;return R.Eo(t),R.Ld(-s,n)}static mix(t,e,i){R.Eo(t);let s=R.Y.n0,n=R.Y.n1,o=R.Y.n2,r=R.Y.n3;R.Eo(e),i===void 0&&(i=.5);let a=Math.round((R.Y.n0-s)*i+s),h=Math.round((R.Y.n1-n)*i+n),l=Math.round((R.Y.n2-o)*i+o),u=Math.round((R.Y.n3-r)*i+r);return`rgba(${a}, ${h}, ${l}, ${u})`}isDark(){if(this.type===1)return R.isDark(this.color);if((this.type===2||this.type===3)&&this.colorStops!==null){let t=this.colorStops;if(this.type===3){let a=t.first();return a?R.isDark(a.value):!1}if(t.get(.5)!==null)return R.isDark(t.get(.5));if(t.count===2){let a=t.toArray();return R.isDark(R.mix(a[0].value,a[1].value))}let e=t.iterator,i=-1,s=-1,n=1,o=1;for(;e.next();){let a=e.key,h=Math.abs(.5-e.key);n>o&&h<n?(i=a,n=h):o>=n&&h<o&&(s=a,o=h)}if(i>s){let a=i;i=s,s=a,a=n,n=o,o=a}let r=s-i;return R.isDark(R.mix(t.get(i),t.get(s),1-o/r))}return!1}static isDark(t){return t?t instanceof R?t.isDark():(R.Eo(t),(299*R.Y.n0+587*R.Y.n1+114*R.Y.n2)/1e3<128):!1}static Ld(t,e){switch(e){case 1:return R.SI(),R.ho.n0=Math.min(100,Math.max(0,R.ho.n0+100*t)),R.MI(),"rgba("+R.Y.n0+", "+R.Y.n1+", "+R.Y.n2+", "+R.Y.n3+")";case 2:return R.IM(),R.ze.n2=Math.min(100,Math.max(0,R.ze.n2+100*t)),"hsla("+R.ze.n0+", "+R.ze.n1+"%, "+R.ze.n2+"%, "+R.ze.n3+")";case 3:return R.NI(),R.co.n0=Math.min(100,Math.max(0,R.co.n0+100*t)),R.CI(),"rgba("+R.Y.n0+", "+R.Y.n1+", "+R.Y.n2+", "+R.Y.n3+")";default:m.o("Unknown color space: "+e)}}static Eo(t){R.M0===!1&&(R.M0=!0,R.us=Y.isUsingDOM()?new Fe(null,void 0,{willReadFrequently:!0})._t:null);let e=R.us;if(e===null)return;e.clearRect(0,0,1,1),e.fillStyle="#000000";let i=e.fillStyle;if(e.fillStyle=t,e.fillStyle!==i){e.fillRect(0,0,1,1);let s=e.getImageData(0,0,1,1).data;R.Y.n0=s[0],R.Y.n1=s[1],R.Y.n2=s[2],R.Y.n3=s[3]/255}else{e.fillStyle="#FFFFFF";let s=e.fillStyle;e.fillStyle=t,e.fillStyle,R.Y.n0=0,R.Y.n1=0,R.Y.n2=0,R.Y.n3=1}}static IM(){let t=R.Y.n0/255,e=R.Y.n1/255,i=R.Y.n2/255,s=Math.max(t,e,i),n=Math.min(t,e,i),o=s-n,r,a,h=(s+n)/2;if(o===0)r=a=0;else{switch(s){case t:r=(e-i)/o%6;break;case e:r=(i-t)/o+2;break;case i:r=(t-e)/o+4;break;default:r=0;break}r*=60,r<0&&(r+=360),a=o/(1-Math.abs(2*h-1))}R.ze.n0=Math.round(r),R.ze.n1=Math.round(a*100),R.ze.n2=Math.round(h*100),R.ze.n3=R.Y.n3}static VU(){let t=R.ze.n0,e=R.ze.n1/100,i=R.ze.n2/100,s,n,o,r=(1-Math.abs(2*i-1))*e,a=t/60,h=r*(1-Math.abs(a%2-1));a>=0&&a<1?(s=r,n=h,o=0):a>=1&&a<2?(s=h,n=r,o=0):a>=2&&a<3?(s=0,n=r,o=h):a>=3&&a<4?(s=0,n=h,o=r):a>=4&&a<5?(s=h,n=0,o=r):(s=r,n=0,o=h);let l=i-.5*r;s+=l,n+=l,o+=l,R.Y.n0=Math.round(s*255),R.Y.n1=Math.round(n*255),R.Y.n2=Math.round(o*255),R.Y.n3=R.ze.n3}static SI(){R.aD(),R.LI()}static MI(){R.AI(),R.hD()}static VN(t){return t/=255,t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}static BN(t){return t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055}static aD(){let t=R.VN(R.Y.n0),e=R.VN(R.Y.n1),i=R.VN(R.Y.n2);R.At.n0=.4124564*t+.3575761*e+.1804375*i,R.At.n1=.2126729*t+.7151522*e+.072175*i,R.At.n2=.0193339*t+.119192*e+.9503041*i,R.At.n3=R.Y.n3}static hD(){let t=3.2404542*R.At.n0+-1.5371385*R.At.n1+-.4985314*R.At.n2,e=-.969266*R.At.n0+1.8760108*R.At.n1+.041556*R.At.n2,i=.0556434*R.At.n0+-.2040259*R.At.n1+1.0572252*R.At.n2;R.Y.n0=R.BN(t)*255,R.Y.n1=R.BN(e)*255,R.Y.n2=R.BN(i)*255,R.Y.n3=R.At.n3,R.Y.n0=Math.round(R.Y.n0),R.Y.n0>255?R.Y.n0=255:R.Y.n0<0&&(R.Y.n0=0),R.Y.n1=Math.round(R.Y.n1),R.Y.n1>255?R.Y.n1=255:R.Y.n1<0&&(R.Y.n1=0),R.Y.n2=Math.round(R.Y.n2),R.Y.n2>255?R.Y.n2=255:R.Y.n2<0&&(R.Y.n2=0)}static zN=216/24389;static q1=24389/27;static Ad=[95.047,100,108.883];static XN(t){return t>R.zN?Math.pow(t,1/3):(R.q1*t+16)/116}static LI(){let t=R.XN(R.At.n0*100/R.Ad[0]),e=R.XN(R.At.n1*100/R.Ad[1]),i=R.XN(R.At.n2*100/R.Ad[2]);R.ho.n0=116*e-16,R.ho.n1=500*(t-e),R.ho.n2=200*(e-i),R.ho.n3=R.At.n3}static cD(t){let e=t*t*t;return e>R.zN?e:(116*t-16)/R.q1}static AI(){let t=(R.ho.n0+16)/116,e=R.ho.n1/500+t,i=t-R.ho.n2/200;R.At.n0=R.Ad[0]/100*R.cD(e),R.At.n1=R.Ad[1]/100*(R.ho.n0>R.q1*R.zN?Math.pow(t,3):R.ho.n0/R.q1),R.At.n2=R.Ad[2]/100*R.cD(i),R.At.n3=R.ho.n3}static TI(){let t=.8190224*R.At.n0+.3619062*R.At.n1+-.1288737*R.At.n2,e=.03298366*R.At.n0+.9292868*R.At.n1+.03614466*R.At.n2,i=.04817719*R.At.n0+.2642395*R.At.n1+.6335478*R.At.n2;t=Math.cbrt(t),e=Math.cbrt(e),i=Math.cbrt(i),R.ge.n0=.2104542*t+.7936177*e+-.004072046*i,R.ge.n1=1.977998*t+-2.428592*e+.4505937*i,R.ge.n2=.02590403*t+.7827717*e+-.8086757*i,R.ge.n3=R.At.n3,R.ge.n0*=100}static DI(){R.ge.n0/=100;let t=.9999999*R.ge.n0+.3963377*R.ge.n1+.2158037*R.ge.n2,e=1.000000009*R.ge.n0+-.1055613*R.ge.n1+-.06385417*R.ge.n2,i=1.00000005*R.ge.n0+-.08948418*R.ge.n1+-1.291485*R.ge.n2;t=t**3,e=e**3,i=i**3,R.At.n0=1.2268798*t+-.5578149*e+.281391*i,R.At.n1=-.04057576*t+1.112286*e+-.07171106*i,R.At.n2=-.07637294*t+-.4214933*e+1.586924*i,R.At.n3=R.ge.n3}static vI(){let t=Math.atan2(R.ge.n2,R.ge.n1)*180/Math.PI;R.co.n0=R.ge.n0,R.co.n1=Math.sqrt(R.ge.n1**2+R.ge.n2**2),R.co.n2=t>=0?t:t+360,R.co.n3=R.ge.n3}static FI(){R.ge.n0=R.co.n0,R.ge.n1=R.co.n1*Math.cos(R.co.n2*Math.PI/180),R.ge.n2=R.co.n1*Math.sin(R.co.n2*Math.PI/180),R.ge.n3=R.co.n3}static NI(){R.aD(),R.TI(),R.vI()}static CI(){R.FI(),R.DI(),R.hD()}static Md(t,e){typeof t=="string"||t instanceof R||m.o("Value for "+e+" must be a color string or a Brush, not "+t)}static Solid=1;static Linear=2;static Radial=3;static Pattern=4;static Lab=1;static HSL=2;static us=null;static M0=!1;static Y=new _e;static ze=new _e;static At=new _e;static ho=new _e;static ge=new _e;static co=new _e}class Lt{Pt="Base";static fs=new Mt;static An(t,e){e.name=t,Lt.fs.set(t,e)}get name(){return this.Pt}set name(t){this.Pt=t}constructor(){}get classType(){return G}measure(t,e,i,s,n,o,r){}measureElement(t,e,i,s,n){t.ht(e,i,s,n)}arrange(t,e,i){}arrangeElement(t,e,i,s,n,o){t.Ut(e,i,s,n,o)}remeasureObject(t){t.bf()}Ge(t,e,i){}}class In extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length,h=t.Jo();for(let l=0;l<a;l++){let u=s[l];if(!u.visible&&u!==h)continue;let c=u.margin,d=c.right+c.left,f=c.top+c.bottom;u.ht(e,i,o,r);let p=u.measuredBounds,g=Math.max(p.width+d,0),y=Math.max(p.height+f,0),b=u.position.x,v=u.position.y;if(isFinite(b)||(b=0),isFinite(v)||(v=0),u instanceof et&&u.isGeometryPositioned){let w=u.strokeWidth/2;b-=w,v-=w}n.re(b,v,g,y)}}arrange(t,e,i){let s=e.length,n=t.padding,o=i.x-n.left,r=i.y-n.top;for(let a=0;a<s;a++){let h=e[a],l=h.measuredBounds,u=h.margin,c=h.position.x,d=h.position.y,f=isNaN(c)?-o:c-o,p=isNaN(d)?-r:d-r;if(h instanceof et&&h.isGeometryPositioned){let g=h.strokeWidth/2;f-=g,p-=g}h.visible&&h.Ut(f+u.left,p+u.top,l.width,l.height)}}}Lt.An("Position",new In);class Bn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length,h=m.nt(),l=t.Jo();for(let c=0;c<a;c++){let d=s[c];if(!d.visible&&d!==l)continue;let f=d.Zs(!1);if(f!==0&&f!==5){h.push(d);continue}d.ht(1/0,i,0,r);let p=d.margin,g=d.measuredBounds,y=Math.max(g.width+p.right+p.left,0),b=Math.max(g.height+p.top+p.bottom,0);n.Hn(n.width+y,Math.max(n.height,b))}let u=h.length;t.desiredSize.height?i=Math.min(t.desiredSize.height,t.maxSize.height):n.height!==0&&(i=Math.min(n.height,t.maxSize.height));for(let c=0;c<u;c++){let d=h[c];if(!d.visible&&d!==l)continue;let f=d.margin,p=f.right+f.left,g=f.top+f.bottom;d.ht(1/0,i,0,r);let y=d.measuredBounds,b=Math.max(y.width+p,0),v=Math.max(y.height+g,0);n.width+=b,n.height=Math.max(n.height,v)}m.Z(h)}arrange(t,e,i){let s=e.length,n=t.padding,o=n.top,r=t.isOpposite,a=r?i.width:n.left;for(let h=0;h<s;h++){let l=o,u=e[h];if(!u.visible)continue;let c=u.measuredBounds,d=u.margin,f=d.top+d.bottom,p=o+n.bottom,g=c.height,y=u.Zs(!1);(isNaN(u.desiredSize.height)&&y===2||y===4)&&(g=Math.max(i.height-f-p,0));let b=g+f+p,v=u.alignment;v.isDefault()&&(v=t.defaultAlignment),v.isSpot()||(v=T.Center),r&&(a-=c.width+d.left+d.right),u.Ut(a+v.offsetX+d.left,l+v.offsetY+d.top+(i.height*v.y-b*v.y),c.width,g),r||(a+=c.width+d.left+d.right)}}}Lt.An("Horizontal",new Bn);class Vn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length,h=m.nt(),l=t.Jo();for(let c=0;c<a;c++){let d=s[c];if(!d.visible&&d!==l)continue;let f=d.Zs(!1);if(f!==0&&f!==4){h.push(d);continue}d.ht(e,1/0,o,0);let p=d.margin,g=d.measuredBounds,y=Math.max(g.width+p.right+p.left,0),b=Math.max(g.height+p.top+p.bottom,0);n.Hn(Math.max(n.width,y),n.height+b)}let u=h.length;t.desiredSize.width?e=Math.min(t.desiredSize.width,t.maxSize.width):n.width!==0&&(e=Math.min(n.width,t.maxSize.width));for(let c=0;c<u;c++){let d=h[c];if(!d.visible&&d!==l)continue;let f=d.margin,p=f.right+f.left,g=f.top+f.bottom;d.ht(e,1/0,o,0);let y=d.measuredBounds,b=Math.max(y.width+p,0),v=Math.max(y.height+g,0);n.width=Math.max(n.width,b),n.height+=v}m.Z(h)}arrange(t,e,i){let s=e.length,n=t.padding,o=n.left,r=t.isOpposite,a=r?i.height:n.top;for(let h=0;h<s;h++){let l=o,u=e[h];if(!u.visible)continue;let c=u.measuredBounds,d=u.margin,f=d.left+d.right,p=o+n.right,g=c.width,y=u.Zs(!1);(isNaN(u.desiredSize.width)&&y===2||y===5)&&(g=Math.max(i.width-f-p,0));let b=g+f+p,v=u.alignment;v.isDefault()&&(v=t.defaultAlignment),v.isSpot()||(v=T.Center),r&&(a-=c.height+d.bottom+d.top),u.Ut(l+v.offsetX+d.left+(i.width*v.x-b*v.x),a+v.offsetY+d.top,g,c.height),r||(a+=c.height+d.bottom+d.top)}}}Lt.An("Vertical",new Vn);class Mi extends Lt{constructor(){super()}static fD=!1;measure(t,e,i,s,n,o,r){let a=s.length;if(a===0)return;let h=t.findMainElement(),l=h.margin,u=0,c=0,d=l.right+l.left,f=l.top+l.bottom;h.ht(e,i,o,r);let p=h.measuredBounds,g=p.width,y=p.height,b=Math.max(g+d,0),v=Math.max(y+f,0),w=t.isClipping;w&&h.qp()!==0&&!Mi.fD&&(Mi.fD=!0,m.ne("Main Shape for Spot Panel with isClipping = true must have a zero strokeWidth: "+t.toString()));let k=I.z(-l.left,-l.top,b,v),S=I.z(0,0,g,y);this.GN(h,S,!0),g=S.width,y=S.height;let N=!0,D=t.Jo(),L;for(let M=0;M<a;M++){let A=s[M],F=e,O=i;if(A===h||!A.visible&&A!==D)continue;l=A.margin;let E=l.left,B=l.top;switch(u=l.right+l.left,c=l.top+l.bottom,L=A.Zs(!1),L){case 2:F=g,O=y,u=0,c=0,E=0,B=0;break;case 5:F=g,u=0,E=0;break;case 4:O=y,c=0,B=0;break}A.ht(F,O,0,0),p=A.measuredBounds,b=Math.max(p.width+u,0),v=Math.max(p.height+c,0);let K=A.alignment;K.isDefault()&&(K=t.defaultAlignment),K.isSpot()||(K=T.Center);let z=A.alignmentFocus;z.isDefault()&&(z=T.Center);let U=null;A instanceof G&&A.fo!==""&&(U=A.findObject(A.fo),U===A&&(U=null));let tt=S.x-E,nt=S.y-B;if(U!==null){A.Ut(0,0,p.width,p.height);let Z=U.actualBounds,it=P.z(Z.x+(z.x*Z.width-z.offsetX),Z.y+(z.y*Z.height-z.offsetY));for(U=U.panel;U!==null&&U!==A;)U.v.gt(it),U=U.panel;tt+=K.x*g+K.offsetX-it.x,nt+=K.y*y+K.offsetY-it.y,P.i(it)}else tt+=K.x*g+K.offsetX-(z.x*p.width+z.offsetX),nt+=K.y*y+K.offsetY-(z.y*p.height+z.offsetY);N?(N=!1,n.e(tt,nt,b,v)):n.re(tt,nt,b,v)}switch(N?n.h(k):w?n.intersect(S.x,S.y,S.width,S.height):n.re(k.x,k.y,k.width,k.height),I.i(k),I.i(S),L=h.stretch,L===1&&(L=h.Zs(!1)),L){case 0:return;case 2:if(!isFinite(e)&&!isFinite(i))return;break;case 5:if(!isFinite(e))return;break;case 4:if(!isFinite(i))return;break}p=h.measuredBounds,g=p.width,y=p.height,b=Math.max(g+d,0),v=Math.max(y+f,0),l=h.margin,S=I.z(-l.left,-l.top,b,v),this.GN(h,S,!0),g=S.width,y=S.height;for(let M=0;M<a;M++){let A=s[M];if(A===h||!A.visible&&A!==D)continue;l=A.margin,u=l.right+l.left,c=l.top+l.bottom,p=A.measuredBounds,b=Math.max(p.width+u,0),v=Math.max(p.height+c,0);let F=A.alignment;F.isDefault()&&(F=t.defaultAlignment),F.isSpot()||(F=T.Center);let O=A.alignmentFocus;O.isDefault()&&(O=T.Center),N?(N=!1,n.e(F.x*g+F.offsetX-(O.x*p.width+O.offsetX)-l.left,F.y*y+F.offsetY-(O.y*p.height+O.offsetY)-l.top,b,v)):n.re(F.x*g+F.offsetX-(O.x*p.width+O.offsetX)-l.left,F.y*y+F.offsetY-(O.y*p.height+O.offsetY)-l.top,b,v)}N?n.h(k):w?n.intersect(S.x,S.y,S.width,S.height):n.re(k.x,k.y,k.width,k.height),I.i(S)}arrange(t,e,i){let s=e.length;if(s===0)return;let n=t.findMainElement(),o=n.measuredBounds,r=o.width,a=o.height,h=t.padding,l=h.left,u=h.top,c=l-i.x,d=u-i.y;n.Ut(c,d,r,a);let f=I.z(0,0,r,a);this.GN(n,f,!1);for(let p=0;p<s;p++){let g=e[p];if(g===n)continue;let y=g.measuredBounds,b=y.width,v=y.height,w=g.alignment;w.isDefault()&&(w=t.defaultAlignment),w.isSpot()||(w=T.Center);let k=g.alignmentFocus;k.isDefault()&&(k=T.Center);let S=null;if(g instanceof G&&g.fo!==""&&(S=g.findObject(g.fo),S===g&&(S=null)),S!==null){let N=S.actualBounds,D=P.z(N.x+(k.x*N.width-k.offsetX),N.y+(k.y*N.height-k.offsetY));for(S=S.panel;S!==null&&S!==g;)S.v.gt(D),S=S.panel;c=w.x*f.width+w.offsetX-D.x,d=w.y*f.height+w.offsetY-D.y,P.i(D)}else c=w.x*f.width+w.offsetX-(k.x*b+k.offsetX),d=w.y*f.height+w.offsetY-(k.y*v+k.offsetY);c+=f.x-i.x,d+=f.y-i.y,g.visible&&g.Ut(l+c,u+d,b,v)}I.i(f)}GN(t,e,i){let s=null;if(t instanceof G&&t.fo!==""&&(s=t.findObject(t.fo),s===t&&(s=null)),s!==null)for(i&&t.Ut(0,0,e.width,e.height),e.h(s.actualBounds),s=s.panel;s!==null&&s!==t;)s.v.sm(e),s=s.panel}}Lt.An("Spot",new Mi);class zn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length;if(a===0)return;let h=t.findMainElement(),l=h.margin,u=e,c=i,d=l.right+l.left,f=l.top+l.bottom;h.ht(e,i,o,r);let p=h.measuredBounds,g=0,y=null;h instanceof et&&(y=h,g=y.strokeWidth*y.scale);let b=Math.max(p.width+d,0),v=Math.max(p.height+f,0),w=t.YN(h),k=w.x*b+w.offsetX,S=w.y*v+w.offsetY,N=t.KN(h),D=N.x*b+N.offsetX,L=N.y*v+N.offsetY;isFinite(e)&&(u=Math.max(Math.abs(k-D)-g,0)),isFinite(i)&&(c=Math.max(Math.abs(S-L)-g,0));let M=0,A=0;o>0&&(M=Math.max(Math.abs(w.x*o+w.offsetX-(N.x*o+N.offsetX))-g,0)),r>0&&(A=Math.max(Math.abs(w.y*r+w.offsetY-(N.y*r+N.offsetY))-g,0));let F=st.l();F.e(0,0);let O=t.Jo();for(let z=0;z<a;z++){let U=s[z];if(U===h||!U.visible&&U!==O)continue;l=U.margin;let tt=l.right+l.left,nt=l.top+l.bottom;U.ht(u,c,M,A),p=U.measuredBounds,b=Math.max(p.width+tt,0),v=Math.max(p.height+nt,0),F.e(Math.max(b,F.width),Math.max(v,F.height))}if(a===1){p=h.measuredBounds,n.width=b,n.height=v,st.i(F);return}w=t.YN(h),N=t.KN(h);let E=0,B=0;N.x!==w.x&&N.y!==w.y&&(E=F.width/Math.abs(N.x-w.x),B=F.height/Math.abs(N.y-w.y)),st.i(F),g=0,y!==null&&(g=y.strokeWidth*y.scale,y.tM()===6&&(E=B=Math.max(E,B))),E+=Math.abs(w.offsetX)+Math.abs(N.offsetX)+g,B+=Math.abs(w.offsetY)+Math.abs(N.offsetY)+g;let K=h.stretch;switch(K===1&&(K=h.Zs(!1)),K){case 0:o=0,r=0;break;case 2:isFinite(e)&&(E=e),isFinite(i)&&(B=i);break;case 5:isFinite(e)&&(E=e),r=0;break;case 4:o=0,isFinite(i)&&(B=i);break}h.bf(),h.ht(E,B,o,r),n.width=h.measuredBounds.width+d,n.height=h.measuredBounds.height+f}arrange(t,e,i){let s=e.length;if(s===0)return;let n=t.findMainElement(),o=n.measuredBounds,r=I.l();r.e(0,0,1,1);let a=n.margin,h=a.left,l=a.top,u=t.padding,c=u.left,d=u.top,f=h,p=l,g=o.width,y=o.height;n.Ut(c+f,d+p,g,y);let b=t.YN(n),v=t.KN(n),w=0+b.x*o.width+b.offsetX,k=0+b.y*o.height+b.offsetY,S=0+v.x*o.width+v.offsetX,N=0+v.y*o.height+v.offsetY;r.x=w,r.y=k,r.re(S,N,0,0),r.x+=h+c,r.y+=l+d;for(let D=0;D<s;D++){let L=e[D];if(L===n)continue;let M=L.measuredBounds;a=L.margin;let A=Math.max(M.width+a.right+a.left,0),F=Math.max(M.height+a.top+a.bottom,0),O=L.alignment;O.isDefault()&&(O=t.defaultAlignment),O.isSpot()||(O=T.Center),f=r.width*O.x+O.offsetX-A*O.x+a.left+r.x,p=r.height*O.y+O.offsetY-F*O.y+a.top+r.y,g=r.width,y=r.height,L.visible&&(I.contains(r.x,r.y,r.width,r.height,f,p,M.width,M.height)?L.Ut(f,p,M.width,M.height):L.Ut(f,p,M.width,M.height,new I(r.x,r.y,r.width,r.height)))}I.i(r)}}Lt.An("Auto",new zn);class Kn extends Lt{constructor(){super(),this.name="Table"}measure(t,e,i,s,n,o,r){let a=s.length,h=m.nt(),l=m.nt();for(let ot=0;ot<a;ot++){let W=s[ot],ft=W instanceof G?W:null;if(ft!==null&&ft.nl()&&W.visible){l.push(ft);let At=ft.D.r,Ht=At.length;for(let Ut=0;Ut<Ht;Ut++){let Gt=At[Ut];ft.type===G.TableRow?Gt.row=W.row:ft.type===G.TableColumn&&(Gt.column=W.column),h.push(Gt)}}else h.push(W)}a=h.length,a===0&&(t.getRowDefinition(0),t.getColumnDefinition(0));let u=[];for(let ot=0;ot<a;ot++){let W=h[ot];W.visible&&(W.xi(!0),W.lo(!0),u[W.row]||(u[W.row]=[]),u[W.row][W.column]||(u[W.row][W.column]=[]),u[W.row][W.column].push(W))}m.Z(h);let c=m.nt(),d=m.nt(),f=m.nt(),p={count:0},g={count:0},y=e,b=i,v=t.Zi,w=t.Qi,k;a=v.length;for(let ot=0;ot<a;ot++)k=v[ot],k!==void 0&&(k.actual=0,k.Re=0);a=w.length;for(let ot=0;ot<a;ot++)k=w[ot],k!==void 0&&(k.actual=0,k.Re=0);let S=u.length,N=0;for(let ot=0;ot<S;ot++)u[ot]&&(N=Math.max(N,u[ot].length));let D=Math.min(t.topIndex,S-1),L=Math.min(t.leftIndex,N-1),M=0,A;S=u.length;let F=t.Jo();for(let ot=0;ot<S;ot++){if(!u[ot])continue;N=u[ot].length;let W=t.getRowDefinition(ot);W.actual=0,W.Re=0;for(let ft=0;ft<N;ft++){if(!u[ot][ft])continue;let At=t.getColumnDefinition(ft);c[ft]===void 0&&(At.actual=0,At.Re=0,c[ft]=!0);let Ht=u[ot][ft],Ut=Ht.length;for(let Gt=0;Gt<Ut;Gt++){let qt=Ht[Gt];if(!qt.visible&&qt!==F)continue;let we=qt.rowSpan>1,ue=qt.columnSpan>1;(we||ue)&&!(ot<D)&&!(ft<L)&&d.push(qt);let de=qt.margin,Wt=de.right+de.left,Zt=de.top+de.bottom;A=qt.Qp(W,At,!1);let me=qt.desiredSize,Ft=!isNaN(me.width),Me=!isNaN(me.height);if(A!==0&&!(Ft&&Me)&&!(ot<D)&&!(ft<L)&&(!ue&&p[ft]===void 0&&(A===2||A===5)&&(p[ft]=-1,p.count++),!we&&g[ot]===void 0&&(A===2||A===4)&&(g[ot]=-1,g.count++),!we&&!ue&&f.push(qt)),qt.ht(1/0,1/0,0,0),ot<D||ft<L)continue;let se=qt.measuredBounds,ve=Math.max(se.width+Wt,0),Te=Math.max(se.height+Zt,0);if(qt.rowSpan===1&&(A===0||A===5)){k=t.getRowDefinition(ot);let ke=k.computeEffectiveSpacing(),mi=k.q===0;M=Math.max(Te-k.actual,0),M+(mi?ke:0)>b&&(M=Math.max(b-ke,0)),k.Re=k.Re+M,k.actual=k.q+M,b=Math.max(b-(M+(mi?ke:0)),0)}if(qt.columnSpan===1&&(A===0||A===4)){k=t.getColumnDefinition(ft);let ke=k.computeEffectiveSpacing(),mi=k.q===0;M=Math.max(ve-k.actual,0),M+(mi?ke:0)>y&&(M=Math.max(y-ke,0)),k.Re=k.Re+M,k.actual=k.q+M,y=Math.max(y-(M+(mi?ke:0)),0)}(we||ue)&&qt.bf()}}}m.Z(c);let O=0,E=0;a=t.columnCount;for(let ot=0;ot<a;ot++){let W=w[ot];W!==void 0&&(O+=isNaN(W.ki)?W.Re:W.ki,W.Re!==0&&(O+=W.computeEffectiveSpacing()))}a=t.rowCount;for(let ot=0;ot<a;ot++){let W=v[ot];W!==void 0&&(E+=isNaN(W.ki)?W.Re:W.ki,W.Re!==0&&(E+=W.computeEffectiveSpacing()))}y=Math.max(e-O,0),b=Math.max(i-E,0);let B=b,K=y;a=f.length;for(let ot=0;ot<a;ot++){let W=f[ot],ft=t.getRowDefinition(W.row),At=t.getColumnDefinition(W.column),Ht=W.measuredBounds,Ut=W.margin,Gt=Ut.right+Ut.left,qt=Ut.top+Ut.bottom;At.Re===0&&p[W.column]!==void 0?p[W.column]=Math.max(Ht.width+Gt,p[W.column]):p[W.column]=null,ft.Re===0&&g[W.row]!==void 0?g[W.row]=Math.max(Ht.height+qt,g[W.row]):g[W.row]=null}let z=0,U=0,tt;for(tt in g)tt!=="count"&&(z+=g[tt]);for(tt in p)tt!=="count"&&(U+=p[tt]);let nt=st.l();for(let ot=0;ot<a;ot++){let W=f[ot];if(!W.visible&&W!==F)continue;let ft=t.getRowDefinition(W.row),At=t.getColumnDefinition(W.column),Ht=0;isFinite(At.width)?Ht=At.width:(isFinite(y)&&p[W.column]!==null?U===0?Ht=At.actual+y:Ht=p[W.column]/U*K:p[W.column]!==null?Ht=y:Ht=At.actual||y,Ht=Math.max(0,Ht-At.computeEffectiveSpacing()));let Ut=0;switch(isFinite(ft.height)?Ut=ft.height:(isFinite(b)&&g[W.row]!==null?z===0?Ut=ft.actual+b:Ut=g[W.row]/z*B:g[W.row]!==null?Ut=b:Ut=ft.actual||b,Ut=Math.max(0,Ut-ft.computeEffectiveSpacing())),nt.e(Math.max(At.minimum,Math.min(Ht,At.maximum)),Math.max(ft.minimum,Math.min(Ut,ft.maximum))),A=W.Qp(ft,At,!1),A){case 5:nt.height=Math.max(nt.height,ft.actual+b);break;case 4:nt.width=Math.max(nt.width,At.actual+y);break}let Gt=W.margin,qt=Gt.right+Gt.left,we=Gt.top+Gt.bottom;W.bf();let ue=At.minimum,de=ft.minimum,Wt=W.measuredBounds;Wt.width===0&&p[W.column]!==null&&(ue=Math.max(ue,p[W.column])),Wt.height===0&&g[W.row]!==null&&(de=Math.max(ue,g[W.row])),W.ht(nt.width,nt.height,ue,de);let Zt=W.measuredBounds,me=Math.max(Zt.width+qt,0),Ft=Math.max(Zt.height+we,0);isFinite(y)&&(me=Math.min(me,nt.width)),isFinite(b)&&(Ft=Math.min(Ft,nt.height));let Me=0;Me=ft.actual,ft.actual=Math.max(ft.actual,Ft),ft.Re=Math.max(ft.Re,Ft),M=ft.actual-Me,b=Math.max(b-M,0),g[W.row]===null&&(B=Math.max(B-M,0)),Me=At.actual,At.actual=Math.max(At.actual,me),At.Re=Math.max(At.Re,me),M=At.actual-Me,y=Math.max(y-M,0),p[W.column]===null&&(K=Math.max(K-M,0))}m.Z(f);let Z=st.l(),it=m.nt(),_=m.nt();if(a=d.length,a!==0)for(let ot=0;ot<S;ot++){if(!u[ot])continue;N=u[ot].length;let W=t.getRowDefinition(ot);it[ot]=W.actual;for(let ft=0;ft<N;ft++){if(!u[ot][ft])continue;let At=t.getColumnDefinition(ft);_[ft]=At.actual}}for(let ot=0;ot<a;ot++){let W=d[ot];if(!W.visible&&W!==F)continue;let ft=t.getRowDefinition(W.row),At=t.getColumnDefinition(W.column);switch(nt.e(Math.max(At.minimum,Math.min(e,At.maximum)),Math.max(ft.minimum,Math.min(i,ft.maximum))),A=W.Qp(ft,At,!1),A){case 2:_[At.index]!==0&&(nt.width=Math.min(nt.width,_[At.index])),it[ft.index]!==0&&(nt.height=Math.min(nt.height,it[ft.index]));break;case 5:_[At.index]!==0&&(nt.width=Math.min(nt.width,_[At.index]));break;case 4:it[ft.index]!==0&&(nt.height=Math.min(nt.height,it[ft.index]));break}isFinite(At.width)&&(nt.width=At.width),isFinite(ft.height)&&(nt.height=ft.height),Z.e(0,0);let Ht=At.minimum,Ut=ft.minimum;for(let Ft=1;Ft<W.rowSpan&&!(W.row+Ft>=t.rowCount);Ft++){if(k=t.getRowDefinition(W.row+Ft),M=0,A===2||A===4){if(k.q===0)continue;M=Math.max(k.minimum,k.q===0?k.maximum:Math.min(k.q,k.maximum))}else M=Math.max(k.minimum,isNaN(k.ki)?k.maximum:Math.min(k.ki,k.maximum));Z.height+=M,Ut+=k.minimum}for(let Ft=1;Ft<W.columnSpan&&!(W.column+Ft>=t.columnCount);Ft++){if(k=t.getColumnDefinition(W.column+Ft),M=0,A===2||A===5){if(k.q===0)continue;M=Math.max(k.minimum,k.q===0?k.maximum:Math.min(k.q,k.maximum))}else M=Math.max(k.minimum,isNaN(k.ki)?k.maximum:Math.min(k.ki,k.maximum));Z.width+=M,Ht+=k.minimum}nt.width+=Z.width,nt.height+=Z.height;let Gt=W.margin,qt=Gt.right+Gt.left,we=Gt.top+Gt.bottom;W.ht(nt.width,nt.height,Ht,Ut);let ue=W.measuredBounds,de=Math.max(ue.width+qt,0),Wt=Math.max(ue.height+we,0),Zt=0;for(let Ft=0;Ft<W.rowSpan&&!(W.row+Ft>=t.rowCount);Ft++)k=t.getRowDefinition(W.row+Ft),Zt+=k.total||0;if(Zt<Wt){let Ft=Wt-Zt,Me=Wt-Zt;if(W.spanAllocation!==null){let se=W.spanAllocation;for(let ve=0;ve<W.rowSpan&&!(Ft<=0||W.row+ve>=t.rowCount);ve++){k=t.getRowDefinition(W.row+ve);let Te=k.q||0,ke=se(W,k,Me);k.actual=Math.min(k.maximum,Te+ke),k.q!==Te&&(Ft-=k.q-Te)}}for(;Ft>0&&k!==void 0;){let se=k.q||0;if(isNaN(k.height)&&k.maximum>se&&(k.actual=Math.min(k.maximum,se+Ft),k.q!==se&&(Ft-=k.q-se)),k.index===0)break;k=t.getRowDefinition(k.index-1)}}let me=0;for(let Ft=0;Ft<W.columnSpan&&!(W.column+Ft>=t.columnCount);Ft++)k=t.getColumnDefinition(W.column+Ft),me+=k.total||0;if(me<de){let Ft=de-me,Me=de-me;if(W.spanAllocation!==null){let se=W.spanAllocation;for(let ve=0;ve<W.columnSpan&&!(Ft<=0||W.column+ve>=t.columnCount);ve++){k=t.getColumnDefinition(W.column+ve);let Te=k.q||0,ke=se(W,k,Me);k.actual=Math.min(k.maximum,Te+ke),k.q!==Te&&(Ft-=k.q-Te)}}for(;Ft>0&&k!==void 0;){let se=k.q||0;if(isNaN(k.width)&&k.maximum>se&&(k.actual=Math.min(k.maximum,se+Ft),k.q!==se&&(Ft-=k.q-se)),k.index===0)break;k=t.getColumnDefinition(k.index-1)}}}m.Z(d),st.i(Z),st.i(nt),it!==void 0&&m.Z(it),_!==void 0&&m.Z(_);let at=0,ct=0,xt=t.desiredSize,Ct=t.maxSize;A=t.Zs(!0),O=0,E=0;let Q=0,Pt=0;a=t.columnCount;for(let ot=0;ot<a;ot++)if(w[ot]!==void 0){if(k=t.getColumnDefinition(ot),isFinite(k.width)){Q+=k.width,Q+=k.computeEffectiveSpacing();continue}else if(k.j1()===2){Q+=k.q,Q+=k.computeEffectiveSpacing();continue}k.q!==0&&(O+=k.q,O+=k.computeEffectiveSpacing())}isFinite(xt.width)?at=Math.min(xt.width,Ct.width):A!==0&&isFinite(e)?at=e:at=O,at=Math.max(at,isFinite(e)?Math.min(o,e):o),at=Math.max(at-Q,0);let bt=O===0?1:Math.max(at/O,1);for(let ot=0;ot<a;ot++)w[ot]!==void 0&&(k=t.getColumnDefinition(ot),!isFinite(k.width)&&k.j1()!==2&&(k.actual=k.q*bt),k.position=n.width,k.q!==0&&(n.width+=k.q,n.width+=k.computeEffectiveSpacing()));a=t.rowCount;for(let ot=0;ot<a;ot++)if(v[ot]!==void 0){if(k=t.getRowDefinition(ot),isFinite(k.height)){Pt+=k.height,Pt+=k.computeEffectiveSpacing();continue}else if(k.j1()===2){Pt+=k.q,Pt+=k.computeEffectiveSpacing();continue}k.q!==0&&(E+=k.q,E+=k.computeEffectiveSpacing())}isFinite(xt.height)?ct=Math.min(xt.height,Ct.height):A!==0&&isFinite(i)?ct=i:ct=E,ct=Math.max(ct,isFinite(i)?Math.min(r,i):r),ct=Math.max(ct-Pt,0);let Yt=E===0?1:Math.max(ct/E,1);for(let ot=0;ot<a;ot++)v[ot]!==void 0&&(k=t.getRowDefinition(ot),!isFinite(k.height)&&k.j1()!==2&&(k.actual=k.q*Yt),k.position=n.height,k.q!==0&&(n.height+=k.q,n.height+=k.computeEffectiveSpacing()));a=l.length;for(let ot=0;ot<a;ot++){let W=l[ot],ft=0,At=0;W.type===G.TableRow?(ft=n.width,k=t.getRowDefinition(W.row),At=k.actual):(k=t.getColumnDefinition(W.column),ft=k.actual,At=n.height),W.measuredBounds.e(0,0,ft,At),W.xi(!1)}m.Z(l),t.Aa=u}arrange(t,e,i){let s=e.length,n=t.padding,o=n.left,r=n.top,a=t.Aa;if(a===null)return;let h=0,l=0,u=a.length,c=0;for(let L=0;L<u;L++)a[L]&&(c=Math.max(c,a[L].length));let d=t.Zi,f=t.Qi,p=0,g=0,y=Math.min(t.topIndex,u-1);if(d.length>0){for(;y!==u&&(d[y]===void 0||d[y].q===0);)y++;y=Math.max(Math.min(y,u-1),0),p=-d[y].position}let b=Math.min(t.leftIndex,c-1);if(f.length>0){for(;b!==c&&(f[b]===void 0||f[b].q===0);)b++;b=Math.max(Math.min(b,c-1),0),g=-f[b].position}let v=0,w=0;for(;v!==u&&d[v]===void 0;)v++;for(;w!==u&&f[w]===void 0;)w++;let k=t.part,S=t.getRowDefinition(v),N=t.getColumnDefinition(w);for(let L=0;L<e.length;L++){let M=e[L];if(!(M instanceof G&&M.visible&&M.nl()))continue;M.type===G.TableRow?(S=t.getRowDefinition(M.row),N=t.getColumnDefinition(w)):(S=t.getRowDefinition(v),N=t.getColumnDefinition(M.column)),l=S.position+p+r,S.q!==0&&(l+=S.computeEffectiveSpacingTop(Math.max(v,y))),h=N.position+g+o,N.q!==0&&(h+=N.computeEffectiveSpacingTop(Math.max(w,b)));let A=M.measuredBounds;M.pf(),M.actualBounds.ce();let F=M.actualBounds,O=I.z(F.x,F.y,F.width,F.height);if(F.x=M.type===G.TableRow?o:h,F.y=M.type===G.TableColumn?r:l,F.width=A.width,F.height=A.height,M.actualBounds.k(),M.lo(!1),O.equalsApproxClose(F)){I.i(O);continue}k!==null&&(k.Sa(),M.Wp(k)),I.i(O)}let D=st.l();for(let L=0;L<u;L++){if(!a[L])continue;c=a[L].length;let M=t.getRowDefinition(L);l=M.position+p+r,M.q!==0&&(l+=M.computeEffectiveSpacingTop(Math.max(v,y)));for(let A=0;A<c;A++){if(!a[L][A])continue;let F=t.getColumnDefinition(A);h=F.position+g+o,F.q!==0&&(h+=F.computeEffectiveSpacingTop(Math.max(w,b)));let O=a[L][A],E=O.length;for(let B=0;B<E;B++){let K=O[B],z=K.measuredBounds;D.e(0,0);for(let Wt=1;Wt<K.rowSpan&&!(L+Wt>=t.rowCount);Wt++){let Zt=t.getRowDefinition(L+Wt);Zt.q!==0&&(D.height+=Zt.total)}for(let Wt=1;Wt<K.columnSpan&&!(A+Wt>=t.columnCount);Wt++){let Zt=t.getColumnDefinition(A+Wt);Zt.q!==0&&(D.width+=Zt.total)}let U=F.q+D.width,tt=M.q+D.height,nt=h,Z=l,it=U,_=tt,at=h,ct=l,xt=U,Ct=tt;h+U>i.width&&(xt=Math.max(i.width-h,0)),l+tt>i.height&&(Ct=Math.max(i.height-l,0));let Q=K.alignment,Pt=0,bt=0,Yt=0,ot=0;if(Q.isDefault()){Q=t.defaultAlignment,Q.isSpot()||(Q=T.Center),Pt=Q.x,bt=Q.y,Yt=Q.offsetX,ot=Q.offsetY;let Wt=F.alignment,Zt=M.alignment;Wt.isSpot()&&(Pt=Wt.x,Yt=Wt.offsetX),Zt.isSpot()&&(bt=Zt.y,ot=Zt.offsetY)}else Pt=Q.x,bt=Q.y,Yt=Q.offsetX,ot=Q.offsetY;(isNaN(Pt)||isNaN(bt))&&(Pt=.5,bt=.5,Yt=0,ot=0);let W=z.width,ft=z.height,At=K.margin,Ht=At.left+At.right,Ut=At.top+At.bottom,Gt=K.Qp(M,F,!1);isNaN(K.desiredSize.width)&&(Gt===2||Gt===5)&&(W=Math.max(U-Ht,0)),isNaN(K.desiredSize.height)&&(Gt===2||Gt===4)&&(ft=Math.max(tt-Ut,0));let qt=K.maxSize,we=K.minSize;W=Math.min(qt.width,W),ft=Math.min(qt.height,ft),W=Math.max(we.width,W),ft=Math.max(we.height,ft);let ue=W+Ht,de=ft+Ut;nt+=it*Pt-ue*Pt+Yt+At.left,Z+=_*bt-de*bt+ot+At.top,K.visible&&(I.contains(at,ct,xt,Ct,nt,Z,z.width,z.height)?K.Ut(nt,Z,W,ft):K.Ut(nt,Z,W,ft,new I(at,ct,xt,Ct)))}}}st.i(D);for(let L=0;L<s;L++){let M=e[L],A=M instanceof G?M:null;if(A!==null&&A.nl()){let F=M.actualBounds;M.naturalBounds.ce(),M.naturalBounds.e(0,0,F.width,F.height),M.naturalBounds.k()}}}}Lt.An("Table",new Kn);class Xn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){}arrange(t,e,i){}}Lt.An("TableRow",new Xn);class Yn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){}arrange(t,e,i){}}Lt.An("TableColumn",new Yn);class Un extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){s.length!==1&&m.o("Viewbox Panel must contain exactly one GraphObject.");let a=s[0];a.it=1,a.bf(),a.ht(1/0,1/0,o,r);let h=a.measuredBounds,l=a.margin,u=l.right+l.left,c=l.top+l.bottom;if(isFinite(e)||isFinite(i)){let d=a.scale,f=h.width,p=h.height,g=Math.max(e-u,0),y=Math.max(i-c,0),b=1;t.viewboxStretch===6?(f!==0&&p!==0&&(b=Math.min(g/f,y/p)),b===0&&(b=1e-4),a.it*=b):(f!==0&&p!==0&&(b=Math.max(g/f,y/p)),b===0&&(b=1e-4),a.it*=b),d!==a.scale&&(a.xi(!0),a.ht(1/0,1/0,o,r))}h=a.measuredBounds,n.width=isFinite(e)?e:Math.max(h.width+u,0),n.height=isFinite(i)?i:Math.max(h.height+c,0)}arrange(t,e,i){let s=e[0],n=s.measuredBounds,o=s.margin,r=o.right+o.left,a=o.top+o.bottom,h=Math.max(n.width+r,0),l=Math.max(n.height+a,0),u=s.alignment;u.isDefault()&&(u=t.defaultAlignment),u.isSpot()||(u=T.Center),s.Ut(i.width*u.x-h*u.x+u.offsetX,i.height*u.y-l*u.y+u.offsetY,n.width,n.height)}}Lt.An("Viewbox",new Un);class jn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){t.Pe===null&&(t.Pe=new ti),this.RI(t),this.OI(t)}arrange(t,e,i){}Ge(t,e,i){let s=t.naturalBounds;e.save(),e.beginPath(),e.rect(0,0,s.width,s.height),e.clip(),e.endPath(),this.II(t,e,i),e.restore(),e.clearContextCache(!1)}II(t,e,i){let s=t.getDocumentScale()*i.scale;s<=0&&(s=1);let n=t.gridCellSize,o=n.width,r=n.height,a=t.naturalBounds,h=t.actualBounds,l=a.width,u=a.height,c=Math.ceil(l/o),d=Math.ceil(u/r),f=t.gridOrigin,p=f.x,g=f.y,y=t.Pe.N0,b=t.D.r,v=b.length;for(let w=0;w<v;w++){let k=b[w];if(!k.visible)continue;let S=k.interval||1,N=Math.abs(S);if(o*N*s<2)continue;let D=k.segmentIndex;(!isFinite(D)||isNaN(D))&&(D=0),D<0&&(D=N-Math.min(-D,N)),D=Math.round(D%N);let L=k.opacity,M=1;if(L!==1){if(L===0)continue;M=e.globalAlpha,e.globalAlpha=M*L}let A=y[w],F=!1,O=k.strokeDashArray;if(O!==null&&(F=!0,e.enableDash(O,k.strokeDashOffset)),k.stroke!==null&&k.strokeWidth>0&&(k.figure==="LineV"||k.figure==="LineH")){if(e.lineWidth=k.strokeWidth,t.bn(e,k.stroke,!1,!1,a,h),e.beginPath(),k.figure==="LineV"){let E=Math.floor((p-o)/o);for(let B=E;B<=E+c;B++){let K=B*o+p;0<=K&&K<=l&&this.W1(B,S,D,A)&&(e.moveTo(K,0),e.lineTo(K,u))}}else if(k.figure==="LineH"){let E=Math.floor((g-r)/r);for(let B=E;B<=E+d;B++){let K=B*r+g;0<=K&&K<=u&&this.W1(B,S,D,A)&&(e.moveTo(0,K),e.lineTo(l,K))}}e.stroke(),e.endPath()}else if(k.fill!==null){if(t.bn(e,k.fill,!0,!1,a,h),k.figure==="BarV"){let E=k.width;isNaN(E)&&(E=o);let B=Math.floor((p-o)/o);for(let K=B;K<=B+c;K++){let z=K*o+p;0<=z+E&&z<=l&&this.W1(K,S,D,A)&&e.fillRect(z,0,E,u)}}else if(k.figure==="BarH"){let E=k.height;isNaN(E)&&(E=r);let B=Math.floor((g-r)/r);for(let K=B;K<=B+d;K++){let z=K*r+g;0<=z+E&&z<=u&&this.W1(K,S,D,A)&&e.fillRect(0,z,l,E)}}}F&&e.disableDash(),L!==1&&(e.globalAlpha=M)}}W1(t,e,i,s){if(e<0)return t%e===i;if(t%e!==i)return!1;let n=s.length;for(let o=0;o<n;o++){let r=s[o];if(t%r===i)return!1}return!0}OI(t){let e=[],i=t.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n],r=[];if(e.push(r),!o.visible)continue;let a=o.interval;if(a<0)continue;let h=o.figure,l=this.HN(h);for(let u=0;u<s;u++){if(u===n)continue;let c=i[u];if(!c.visible)continue;let d=c.figure;if(this.HN(d)!==l)continue;let f=c.interval;f>a&&r.push(f)}}t.Pe.N0=e}HN(t){return t==="LineV"||t==="BarV"}RI(t){let e=1,i=1,s=t.D.r,n=s.length;for(let a=0;a<n;a++){let h=s[a],l=Math.abs(h.interval);l<2||(this.HN(h.figure)?i=i*l/C.jL(i,l):e=e*l/C.jL(e,l))}let o=t.gridCellSize,r=t.Pe;r.lf.isReal()?r.lf.e(i*o.width,e*o.height):r.lf=new st(i*o.width,e*o.height)}}Lt.An("Grid",new jn);class Gn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length;if(!(t instanceof vt||t instanceof j))return;let h=null,l=null;if(t instanceof j&&(h=t),t instanceof vt&&(l=t,h=l.adornedPart,t.Lf===null&&(t.Lf=[])),!(h instanceof j))return;let u=h;if(a===0){t.naturalBounds.Hn(0,0),t.measuredBounds.e(0,0,0,0);return}let c=t instanceof vt?null:h.path,d=h.routeBounds,f=t.$o;f.e(0,0,d.width,d.height);let p=u.points,g=h.pointsCount;l!==null?l.Td(!1):h!==null&&h.Td(!1);let y=d.width,b=d.height,v=t.Lf;if(v.length=0,c!==null){this.measureLinkPath(t,y,b,c);let N=c.measuredBounds;f.unionRect(N),v.push(N)}let w=Nt.l(),k=P.l(),S=P.l();for(let N=0;N<a;N++){let D=s[N];if(D===c)continue;let L=D.measuredBounds;if(D.isPanelMain&&D instanceof et){this.measureLinkPath(t,y,b,D),L=D.measuredBounds,f.unionRect(L),v.push(L);continue}if(g<2){D.ht(1/0,1/0,0,0),L=D.measuredBounds,f.unionRect(L),v.push(L);continue}let M=D.segmentIndex,A=D.segmentFraction,F=D.alignmentFocus;F.isNoSpot()&&(F=T.Center);let O=D.segmentOrientation,E=D.segmentOffset,B=0,K=0,z=0,U=0;if(isNaN(M)){let Q=u.ut,Pt=m.nt();Q.getPointAndAngleAlongPath(A,Pt);let bt=P.z(Pt[0],Pt[1]);U=Pt[2],O!==0&&(z=u.computeAngle(D,O,U),D.Xt=z,D.xi(!0),D.lo(!0)),B=bt.x,K=bt.y,P.i(bt),m.Z(Pt)}else if(M<-g||M>=g){let Q=P.l();u.qN(Q),U=u.midAngle,O!==0&&(z=u.computeAngle(D,O,U),D.Xt=z,D.xi(!0),D.lo(!0)),B=Q.x-d.x,K=Q.y-d.y,P.i(Q)}else{let Q,Pt,bt=0;if(M>=0?(Q=p.elt(M),Pt=M<g-1?p.elt(M+1):Q):(bt=g+M,Q=p.elt(bt),Pt=bt>0?p.elt(bt-1):Q),Q.equalsApprox(Pt)){let Yt,ot;M>=0?(Yt=M>0?p.elt(M-1):Q,ot=M<g-2?p.elt(M+2):Pt):(Yt=bt<g-1?p.elt(bt+1):Q,ot=bt>1?p.elt(bt-2):Pt);let W=Yt.distanceSquaredPoint(Q),ft=Pt.distanceSquaredPoint(ot);W>ft+10?U=M>=0?Yt.directionPoint(Q):Q.directionPoint(Yt):ft>W+10?U=M>=0?Pt.directionPoint(ot):ot.directionPoint(Pt):U=M>=0?Yt.directionPoint(ot):ot.directionPoint(Yt)}else U=M>=0?Q.directionPoint(Pt):Pt.directionPoint(Q);O!==0&&(z=u.computeAngle(D,O,U),D.Xt=z,D.xi(!0),D.lo(!0)),B=Q.x+(Pt.x-Q.x)*A-d.x,K=Q.y+(Pt.y-Q.y)*A-d.y}D.ht(1/0,1/0,0,0),L=D.measuredBounds;let tt=D.naturalBounds,nt=0;D instanceof et&&(nt=D.strokeWidth);let Z=tt.width+nt,it=tt.height+nt;w.Ue(),w.Xs(-L.x,-L.y),w.it(D.scale,D.scale),w.ks(O===0?D.angle:U,Z/2,it/2),(O===22||O===26)&&w.ks(90,Z/2,it/2),(O===23||O===27)&&w.ks(-90,Z/2,it/2),O===28&&(U>45&&U<135||U>225&&U<315)&&w.ks(-U,Z/2,it/2);let _=new I(0,0,Z,it);k.setRectSpot(_,F),w.gt(k);let at=-k.x+nt/2*D.scale,ct=-k.y+nt/2*D.scale;S.h(E);let xt=isNaN(E.x),Ct=isNaN(E.y);if(xt||Ct){let Q=Z/2+j.J1,Pt=it/2+j.J1,bt=U>=45&&U<=135,Yt=U>=225&&U<=315;O===0&&(bt||Yt)?(S.x=Ct?Q:E.y,S.y=xt?Pt:E.x,bt?M>=0||isNaN(M)&&A<.5||xt&&(S.y=-Pt):Yt&&((M>=0||isNaN(M)&&A<.5)&&xt&&(S.y=-Pt),Ct&&(S.x=-Q))):(xt&&(M>=0||isNaN(M)&&A<.5?S.x=Q:S.x=-Q),Ct&&(S.y=-Pt),S.rotate(U))}else S.rotate(U);B+=S.x,K+=S.y,_.e(B+at,K+ct,L.width,L.height),v.push(_),f.unionRect(_)}if(h!==null){let N=h.labelNodes;for(;N.next();)N.value.ht(1/0,1/0)}t.$o=f,t.position.e(d.x+f.x,d.y+f.y),n.Hn(f.width||0,f.height||0),Nt.i(w),P.i(k),P.i(S)}arrange(t,e,i){let s=e.length;if(!(t instanceof vt||t instanceof j))return;let n=t,o=null;t instanceof vt&&(o=t,n=o.adornedPart);let r=t,a=t instanceof vt?null:n.path,h=t.Lf;if(h.length!==0){let d=0;if(a!==null&&d<h.length){let f=h[d];d++,a.Ut(f.x-r.$o.x,f.y-r.$o.y,f.width,f.height)}for(let f=0;f<s;f++){let p=e[f];if(p!==a&&d<h.length){let g=h[d];d++,p.Ut(g.x-r.$o.x,g.y-r.$o.y,g.width,g.height)}}}let l=n.points,u=l.count;if(u>=2&&r instanceof j){let d=r.labelNodes;for(;d.next();){let f=d.value;r.EI(f,u,l)}}o!==null?o.Td(!1):n.Td(!1);let c=t.uD(P.l());t.location.e(t.position.x+c.x,t.position.y+c.y),P.i(c)}measureLinkPath(t,e,i,s){if(s.Xo()===!1)return;let n=s.strokeWidth;if(n===0&&t instanceof vt&&t.type===G.Link&&t.adornedObject instanceof et&&(n=t.adornedObject.strokeWidth),n=n*s.it,t instanceof j&&t.ut!==null){let o=t.geometry.bounds;s.ro(o.x-n/2,o.y-n/2,o.width+n,o.height+n)}else if(t instanceof vt&&t.adornedPart.ut!==null){let o=t.adornedPart.ut.bounds;s.ro(o.x-n/2,o.y-n/2,o.width+n,o.height+n)}else s.ro(-(n/2),-(n/2),e+n,i+n);s.UI(),s.xi(!1)}}Lt.An("Link",new Gn);class qn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=t.findMainElement();if(!(a instanceof et))return;t._i=[];let h=a.margin,l=h.right+h.left,u=h.top+h.bottom;a.ht(e,i,o,r);let c=a.measuredBounds,d=c.width,f=c.height,p=Math.max(d+l,0),g=Math.max(f+u,0),y=new I(-h.left,-h.top,p,g);t._i.push(y),n.h(y),this.determineGraduatedMarks(t,a);let b=t.vs;if(b===null)return;let v=s.length;for(let w=0;w<v;w++){let k=s[w],S=b[w];!k.visible||k===a||S.length===0||(k instanceof et?this.measureGraduatedTicks(t,k,S,n):k instanceof lt&&this.measureGraduatedLabels(t,k,S,n),k.xi(!1))}}arrange(t,e,i){if(t._i===null)return;let s=t.findMainElement(),n=t.vs;if(n===null)return;let o=t._i,r=0,a=o[r];r++,s!==null&&s.Ut(a.x-i.x,a.y-i.y,a.width,a.height);let h=e.length;for(let l=0;l<h;l++){let u=e[l],c=n[l];!u.visible||u===s||c.length===0||(a=o[r],r++,u.Ut(a.x-i.x,a.y-i.y,a.width,a.height))}t._i=null}measureGraduatedTicks(t,e,i,s){let n=e.alignmentFocus;n.isNoSpot()&&(n=T.TopCenter);let o=e.angle;e.Xt=0,e.ht(1/0,1/0,0,0),e.Xt=o;let r=e.measuredBounds,a=r.width,h=r.height,l=I.z(0,0,a,h),u=P.l();u.setRectSpot(l,n),I.i(l);let c=-u.x,d=-u.y,f=new I,p=i.length;for(let g=0;g<p;g++){let y=i[g],b=y.pt.x,v=y.pt.y,w=y.angle;for(let k=0;k<4;k++){switch(k){case 0:u.e(c,d);break;case 1:u.e(c+a,d);break;case 2:u.e(c,d+h);break;case 3:u.e(c+a,d+h);break}u.rotate(w+e.angle),u.offset(b,v),g===0&&k===0?f.e(u.x,u.y,0,0):f.unionPoint(u),u.offset(-b,-v),u.rotate(-w-e.angle)}}P.i(u),t._i!==null&&t._i.push(f),s.re(f.x,f.y,f.width,f.height)}measureGraduatedLabels(t,e,i,s){t.vi===null&&(t.vi=new lt);let n=t.vi;this.dD(e,n);let o=e.alignmentFocus;o.isNoSpot()&&(o=T.TopCenter);let r=e.segmentOrientation,a=e.segmentOffset,h=new I,l=0,u=0,c=0,d=0,f=0,p=i.length;for(let g=0;g<p;g++){let y=i[g];l=y.pt.x,u=y.pt.y,c=y.angle,d=e.angle,f=e.angle,r!==0&&(r===21||r===25?f=c+e.angle:f=c,d=j.computeAngle(r,f)),n.Xt=d,n.text=y.text||"",n.ht(1/0,1/0,0,0);let b=n.measuredBounds,v=n.naturalBounds,w=v.width,k=v.height,S=Nt.l();S.Ue(),S.Xs(-b.x,-b.y),S.it(n.scale,n.scale),S.ks(f,w/2,k/2),(r===22||r===26)&&S.ks(90,w/2,k/2),(r===23||r===27)&&S.ks(-90,w/2,k/2),r===28&&(c>45&&c<135||c>225&&c<315)&&S.ks(-c,w/2,k/2);let N=I.z(0,0,w,k),D=P.l();D.setRectSpot(N,o),S.gt(D);let L=-D.x,M=-D.y,A=P.l();A.h(a),isNaN(A.x)&&(A.x=w/2+3),isNaN(A.y)&&(A.y=-(k/2+3)),A.rotate(c),l+=A.x+L,u+=A.y+M;let F=new I(l,u,b.width,b.height),O=new I(b.x,b.y,b.width,b.height),E=new I(v.x,v.y,v.width,v.height);y.labelAngle=d,y.lineCount=n.lineCount,y.lines=n.getMetrics(),y.actualBounds=F,y.measuredBounds=O,y.naturalBounds=E,g===0?h.h(F):h.unionRect(F),P.i(A),P.i(D),I.i(N),Nt.i(S)}t._i!==null&&t._i.push(h),s.re(h.x,h.y,h.width,h.height)}determineGraduatedMarks(t,e){let i=e.geometry,s=e.strokeWidth,n=i.flattenedSegments,o=i.flattenedLengths,r=i.flattenedTotalLength,a=n.length,h=0,l=0,u=m.nt();for(let v=0;v<a;v++){let w=n[v],k=[];h=0,l=0;let S=w.length;for(let N=0;N<S;N+=2){let D=w[N],L=w[N+1];if(N===0){h=D,l=L;continue}let M=Math.atan2(L-l,D-h)*180/Math.PI;M<0&&(M+=360),k.push(M),h=D,l=L}u.push(k)}let c=this.VI(t),d=t.D.r,f=d.length,p=0,g=0,y=r;t.vs=[];let b;for(let v=0;v<f;v++){let w=d[v];if(b=[],!w.visible||w===e){t.vs.push(b);continue}let k=Math.abs(w.interval),S=t.graduatedTickUnit;if(S*k*r/t.graduatedRange<2&&w.graduatedSkip===null){t.vs.push(b);continue}let N=o[0][0],D=0,L=0;g=r*w.graduatedStart-1e-4,y=r*w.graduatedEnd+1e-4;let M=S*k,A=t.graduatedTickBase;if(A<t.graduatedMin){let B=(t.graduatedMin-A)/M;B=B%1===0?B:Math.floor(B+1),A+=B*M}else if(A>t.graduatedMin+M){let B=Math.floor((A-t.graduatedMin)/M);A-=B*M}let F=c[v],O=A,E=t.graduatedMax*1e-6;for(let B=1;A<=t.graduatedMax+E;B++){if(this.BI(t,A-t.graduatedTickBase,F)&&(A>t.graduatedMax&&(A=t.graduatedMax),(w.graduatedSkip===null||w instanceof lt&&!w.graduatedSkip(A,w)||w instanceof et&&!w.graduatedSkip(A,w))&&(p=(A-t.graduatedMin)*r/t.graduatedRange,p>r&&(p=r),g<=p&&p<=y))){let K=u[D][L],z=o[D][L];for(;D<o.length;){for(;p>N&&L<o[D].length-1;)L++,K=u[D][L],z=o[D][L],N+=z;if(p<=N)break;D++,L=0,K=u[D][L],z=o[D][L],N+=z}let U=n[D],tt=U[L*2],nt=U[L*2+1],Z=U[L*2+2],it=U[L*2+3],_=(p-(N-z))/z,at=new P(tt+(Z-tt)*_+s/2-i.bounds.x,nt+(it-nt)*_+s/2-i.bounds.y);if(at.scale(e.scale,e.scale),K=this.zI(K,_,U,u[D],L),w instanceof lt){let ct="";w.graduatedFunction!==null?(ct=w.graduatedFunction(A,w),ct=ct!=null?ct.toString():""):ct=(+A.toFixed(2)).toString(),ct!==""&&b.push({pt:at,angle:K,text:ct})}else b.push({pt:at,angle:K})}A=O+B*M}t.vs.push(b)}m.Z(u)}zI(t,e,i,s,n){if(e<.5005&&e>.4995)return t;let o=t;if(e<.5?n>0?o=s[n-1]:C.X(i[0],i[i.length-2])&&C.X(i[1],i[i.length-1])&&(o=s[s.length-1]):e>.5&&(n+1<s.length?o=s[n+1]:C.X(i[0],i[i.length-2])&&C.X(i[1],i[i.length-1])&&(o=s[0])),t!==o){let r=Math.abs(t-o);if(r>180&&(t<o?t+=360:o+=360,r=Math.abs(t-o)),e<5e-4||e>.9995)return(t+o)/2%360;if(r<10){let a=1-Math.abs(.5-e);return(t*a+o*(1-a))%360}}return t}VI(t){if(t.ds===null){let e=[],i=t.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n],r=[];if(e.push(r),!o.visible)continue;let a=o.interval;if(!(a<0))for(let h=0;h<s;h++){if(h===n)continue;let l=i[h];if(!l.visible||o.constructor!==l.constructor)continue;let u=l.interval;u>a&&r.push(u)}}t.ds=e}return t.ds}BI(t,e,i){let s=i.length;for(let n=0;n<s;n++){let o=i[n]*t.graduatedTickUnit,r=e%o,a=t.graduatedTickUnit*1e-6;if(r<a&&r>-a)return!1}return!0}Ge(t,e,i){let s=i.ph;i.ph=!0;let n=t.naturalBounds,o=n.width,r=n.height,a=e instanceof re;e.save(),e.beginPath(),e.rect(-1,-1,o+1,r+1),e.clip(),e.endPath();let h=t.findMainElement();h.Ge(e,i);let l=t.getDocumentScale()*i.scale;l<=0&&(l=1);let u=h.actualBounds,c=t.D.r,d=t.vs,f=c.length;for(let p=0;p<f;p++){let g=c[p],y=d[p],b=y.length;if(!(!g.visible||g===h||y.length===0)){if(g instanceof et){if(t.graduatedTickUnit*g.interval*h.geometry.flattenedTotalLength/t.graduatedRange*l<2&&g.graduatedSkip===null)continue;let v=g.measuredBounds,w=g.strokeWidth*g.scale,k=g.alignmentFocus;k.isNoSpot()&&(k=T.TopCenter);for(let S=0;S<b;S++){let N=y[S].pt,D=y[S].angle;this.XI(g,N,u,D,v,w,k),g.Ge(e,i),a&&(t.svg.appendChild(g.svg),g.svg=null),g.el.Ue()}}else if(g instanceof lt){t.vi===null&&(t.vi=new lt);let v=t.vi;this.dD(g,v),v.jN=!0;for(let w=0;w<b;w++){let k=y[w];if(k.actualBounds&&k.measuredBounds&&k.naturalBounds){v.GI(k);let S=k.actualBounds;v.Ut(S.x,S.y,S.width,S.height),this.YI(v,u,S,k.measuredBounds,k.naturalBounds),v.sl=g.part,v.$s=g.panel,v.Ge(e,i),v.$s=null,v.sl=null,a&&(t.svg.appendChild(v.svg),v.svg=null)}}}}}i.ph=s,e.restore(),e.clearContextCache(!0)}XI(t,e,i,s,n,o,r){let a=t.el;a.Ue(),a.Xs(e.x+i.x,e.y+i.y),a.ks(s+t.angle,0,0),a.Xs(-n.width*r.x+r.offsetX+o/2,-n.height*r.y+r.offsetY+o/2),a.it(t.scale,t.scale),t.Sd(!1),t.wa.set(t.el),t.Th=t.scale,t.Na(!1)}YI(t,e,i,s,n){let o=t.el;o.Ue(),o.Xs(i.x+e.x,i.y+e.y),o.Xs(-s.x,-s.y),t.Kp(o,n.x,n.y,n.width,n.height),t.Sd(!1),t.wa.set(t.el),t.Th=t.scale,t.Na(!1)}dD(t,e){e.KI(t)}}Lt.An("Graduated",new qn);var Us=(x=>(x[x.Uniform=6]="Uniform",x[x.UniformToFill=7]="UniformToFill",x))(Us||{});class G extends ${W;D;Qt;Dd;Zn;rl;fo;$o;WN;O;vd;ot;Pe;te;Fd;Ta;_s;constructor(t,e){if(super(),t===void 0)this.W=G.Position;else if(typeof t=="string"){let i=Lt.fs.get(t);i!==null?this.W=i:m.o("PanelLayout not loaded: "+t)}else t instanceof Lt?this.W=t:(this.W=G.Position,t&&(e=t));this.n|=4194304|(this.W===G.Grid?1048576:0),this.D=new q,this.Qt=Dt.im,this.Dd=T.Default,this.Zn=1,this.rl=null,this.fo="",this.$o=new I(NaN,NaN,NaN,NaN),this.WN=null,this.O=null,this.vd=6,this.Pe=null,this.ot=null,this.te=null,this.Fd=NaN,this.Ta=null,this._s=null,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.W=this.W,t.Qt=this.Qt.N(),t.Dd=this.Dd.N(),t.Zn=this.Zn,t.fo=this.fo,t.$o.h(this.$o),this.O!==null&&(t.O=this.O.copy(t)),t.vd=this.vd,this.ot!==null&&(t.ot=this.ot.copy()),this.Pe!==null&&(t.Pe=this.Pe.copy()),t.te=this.te,t.Fd=this.Fd,t.Ta=this.Ta}Ho(t){super.Ho(t),t.D=this.D;let e=t.D.r,i=e.length;for(let s=0;s<i;s++){let n=e[s];n.$s=t}t.rl=null}copy(){let t=super.copy(),e=this.D.r,i=e.length;for(let s=0;s<i;s++){let n=e[s].copy();t.HI(n)}return t}toString(){return"Panel("+this.type.name+")#"+V.xs(this)}get type(){return this.W}set type(t){let e=this.W;e!==t&&(this.W=t,this.Af=this.W===G.Grid,this.f(),this.t("type",e,t))}get elements(){return this.D.iterator}get naturalBounds(){return this.Ke}get padding(){return this.Qt}set padding(t){typeof t=="number"?(t<0&&m.J(t,">= 0",G,"padding"),t=new Dt(t)):(t.left<0&&m.J(t.left,">= 0",G,"padding:value.left"),t.right<0&&m.J(t.right,">= 0",G,"padding:value.right"),t.top<0&&m.J(t.top,">= 0",G,"padding:value.top"),t.bottom<0&&m.J(t.bottom,">= 0",G,"padding:value.bottom"));let e=this.Qt;e.equals(t)||(t=t.N(),this.Qt=t,this.f(),this.t("padding",e,t))}get defaultAlignment(){return this.Dd}set defaultAlignment(t){let e=this.Dd;e.equals(t)||(t=t.N(),this.Dd=t,this.f(),this.t("defaultAlignment",e,t))}get defaultStretch(){return this.Zn}set defaultStretch(t){let e=this.Zn;e!==t&&(this.Zn=t,this.f(),this.t("defaultStretch",e,t))}get defaultSeparatorPadding(){return this.O!==null?this.O.C0:Dt.im}set defaultSeparatorPadding(t){typeof t=="number"&&(t=new Dt(t));let e=this.defaultSeparatorPadding;e.equals(t)||(t=t.N(),this.O===null&&(this.O=new ie),this.O.C0=t,this.f(),this.t("defaultSeparatorPadding",e,t))}get defaultRowSeparatorStroke(){return this.O!==null?this.O.L0:null}set defaultRowSeparatorStroke(t){let e=this.defaultRowSeparatorStroke;e!==t&&(t===null||typeof t=="string"||t instanceof R)&&(t instanceof R&&t.k(),this.O===null&&(this.O=new ie),this.O.L0=t,this.C(),this.t("defaultRowSeparatorStroke",e,t))}get defaultRowSeparatorStrokeWidth(){return this.O!==null?this.O.A0:1}set defaultRowSeparatorStrokeWidth(t){let e=this.defaultRowSeparatorStrokeWidth;e!==t&&isFinite(t)&&t>=0&&(this.O===null&&(this.O=new ie),this.O.A0=t,this.f(),this.t("defaultRowSeparatorStrokeWidth",e,t))}get defaultRowSeparatorDashArray(){return this.O!==null?this.O.T0:null}set defaultRowSeparatorDashArray(t){let e=this.defaultRowSeparatorDashArray;if(e!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",G,"defaultRowSeparatorDashArray:value"),t!==null){let i=t.length,s=0;for(let n=0;n<i;n++){let o=t[n];(typeof o!="number"||!(o>=0)||!isFinite(o))&&m.o("defaultRowSeparatorDashArray value "+o+" at index "+n+" must be a positive number or zero."),s+=o}if(s===0){if(e===null)return;t=null}}this.O===null&&(this.O=new ie),this.O.T0=t,this.C(),this.t("defaultRowSeparatorDashArray",e,t)}}get defaultColumnSeparatorStroke(){return this.O!==null?this.O.D0:null}set defaultColumnSeparatorStroke(t){let e=this.defaultColumnSeparatorStroke;e!==t&&(t===null||typeof t=="string"||t instanceof R)&&(t instanceof R&&t.k(),this.O===null&&(this.O=new ie),this.O.D0=t,this.C(),this.t("defaultColumnSeparatorStroke",e,t))}get defaultColumnSeparatorStrokeWidth(){return this.O!==null?this.O.v0:1}set defaultColumnSeparatorStrokeWidth(t){let e=this.defaultColumnSeparatorStrokeWidth;e!==t&&isFinite(t)&&t>=0&&(this.O===null&&(this.O=new ie),this.O.v0=t,this.f(),this.t("defaultColumnSeparatorStrokeWidth",e,t))}get defaultColumnSeparatorDashArray(){return this.O!==null?this.O.F0:null}set defaultColumnSeparatorDashArray(t){let e=this.defaultColumnSeparatorDashArray;if(e!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",G,"defaultColumnSeparatorDashArray:value"),t!==null){let i=t.length,s=0;for(let n=0;n<i;n++){let o=t[n];(typeof o!="number"||!(o>=0)||!isFinite(o))&&m.o("defaultColumnSeparatorDashArray value "+o+" at index "+n+" must be a positive number or zero."),s+=o}if(s===0){if(e===null)return;t=null}}this.O===null&&(this.O=new ie),this.O.F0=t,this.C(),this.t("defaultColumnSeparatorDashArray",e,t)}}get Aa(){return this.O!==null?this.O.Aa:null}set Aa(t){this.O===null&&(this.O=new ie),this.O.Aa=t}get viewboxStretch(){return this.vd}set viewboxStretch(t){let e=this.vd;e!==t&&(this.vd=t,this.f(),this.t("viewboxStretch",e,t))}get gridCellSize(){return this.Pe!==null?this.Pe.Rd:st.EL}set gridCellSize(t){this.Pe===null&&(this.Pe=new ti);let e=this.Pe.Rd;if(!e.equals(t)){(!t.isReal()||t.width===0||t.height===0)&&m.o("Invalid Panel.gridCellSize: "+t),this.Pe.Rd=t.N();let i=this.diagram;i!==null&&this===i.grid&&i.ca(),this.C(),this.t("gridCellSize",e,t)}}get gridOrigin(){return this.Pe!==null?this.Pe.Od:P.dn}set gridOrigin(t){this.Pe===null&&(this.Pe=new ti);let e=this.Pe.Od;if(!e.equals(t)){t.isReal()||m.o("Invalid Panel.gridOrigin: "+t),this.Pe.Od=t.N();let i=this.diagram;i!==null&&this===i.grid&&i.ca(),this.C(),this.t("gridOrigin",e,t)}}get graduatedMin(){return this.ot!==null?this.ot.R0:0}set graduatedMin(t){let e=this.graduatedMin;if(e!==t&&(this.ot===null&&(this.ot=new Pe),this.ot.R0=t,this.f(),this.t("graduatedMin",e,t),this.gf())){let i=this.part;i!==null&&this.Eh(i,"graduatedRange")}}get graduatedMax(){return this.ot!==null?this.ot.O0:100}set graduatedMax(t){let e=this.graduatedMax;if(e!==t&&(this.ot===null&&(this.ot=new Pe),this.ot.O0=t,this.f(),this.t("graduatedMax",e,t),this.gf())){let i=this.part;i!==null&&this.Eh(i,"graduatedRange")}}get graduatedRange(){return this.graduatedMax-this.graduatedMin}get graduatedTickUnit(){return this.ot!==null?this.ot.I0:10}set graduatedTickUnit(t){let e=this.graduatedTickUnit;e!==t&&t>0&&(this.ot===null&&(this.ot=new Pe),this.ot.I0=t,this.f(),this.t("graduatedTickUnit",e,t))}get graduatedTickBase(){return this.ot!==null?this.ot.E0:0}set graduatedTickBase(t){let e=this.graduatedTickBase;e!==t&&(this.ot===null&&(this.ot=new Pe),this.ot.E0=t,this.f(),this.t("graduatedTickBase",e,t))}get vs(){return this.ot!==null?this.ot.vs:null}set vs(t){this.ot!==null?this.ot.vs=t:t!==null&&(this.ot=new Pe,this.ot.vs=t)}get _i(){return this.ot!==null?this.ot._i:null}set _i(t){this.ot!==null?this.ot._i=t:t!==null&&(this.ot=new Pe,this.ot._i=t)}get ds(){return this.ot!==null?this.ot.ds:null}set ds(t){this.ot!==null?this.ot.ds=t:t!==null&&(this.ot=new Pe,this.ot.ds=t)}get vi(){return this.ot!==null?this.ot.vi:null}set vi(t){this.ot!==null?this.ot.vi=t:t!==null&&(this.ot=new Pe,this.ot.vi=t)}Wp(t){super.Wp(t);let e=this.D.r,i=e.length;for(let s=0;s<i;s++)e[s].Wp(t)}Ma(t,e){if(this.W===G.Grid){t.commitTransform(),this.W.Ge(this,t,e);return}if(this.W===G.Graduated){t.commitTransform(),this.W.Ge(this,t,e);return}if(this.W===G.Table)if(t.commitTransform(),t instanceof re){let r=t.currentElement;t.currentElement=t.newGroup2("gojs-ts"),this.JN(t,e),t.endGroup(),t.currentElement=r}else this.JN(t,e);let i=this.isClipping&&this.W===G.Spot;i&&t.save();let s=this.findMainElement(),n=this.D.r,o=n.length;for(let r=0;r<o;r++){let a=n[r];i&&a===s&&(t.clipInsteadOfFill=!0),a.Ge(t,e),i&&a===s&&(t.clipInsteadOfFill=!1)}i&&(t.restore(),t.clearContextCache(!0))}JN(t,e){t.lineCap="butt";let i=this.rowCount>0?this.Zi:null,s=this.columnCount>0?this.Qi:null;i!==null&&this.$1(t,e,!0,i,!0),s!==null&&this.$1(t,e,!1,s,!0),i!==null&&this.gD(t,!0,i),s!==null&&this.gD(t,!1,s),i!==null&&this.$1(t,e,!0,i,!1),s!==null&&this.$1(t,e,!1,s,!1)}gD(t,e,i){let s=i.length,n=this.actualBounds,o=this.naturalBounds,r=!0;for(let a=0;a<s;a++){let h=i[a];if(h===void 0||h.actual===0)continue;if(r){r=!1;continue}if(e){if(h.position>o.height)continue}else if(h.position>o.width)continue;let l=h.separatorStrokeWidth;isNaN(l)&&(l=e?this.defaultRowSeparatorStrokeWidth:this.defaultColumnSeparatorStrokeWidth);let u=h.separatorStroke;if(u===null&&(u=e?this.defaultRowSeparatorStroke:this.defaultColumnSeparatorStroke),l===0||u===null)continue;this.bn(t,u,!1,!1,o,n);let c=!1,d=h.separatorDashArray;d===null&&(d=e?this.defaultRowSeparatorDashArray:this.defaultColumnSeparatorDashArray),d!==null&&(c=!0,t.enableDash(d,0)),t.beginPath();let f=h.position+l;e?f>o.height&&(l-=f-o.height):f>o.width&&(l-=f-o.width);let p=h.position+l/2;t.lineWidth=l;let g=this.Qt;if(e){p+=g.top;let y=g.left,b=o.width-g.right;t.moveTo(y,p),t.lineTo(b,p)}else{p+=g.left;let y=g.top,b=o.height-g.bottom;t.moveTo(p,y),t.lineTo(p,b)}t.stroke(),t.endPath(),c&&t.disableDash()}}$1(t,e,i,s,n){let o=s.length,r=this.actualBounds,a=this.naturalBounds,h=this.mD(!0),l=this.mD(!1);for(let u=0;u<o;u++){let c=s[u];if(c===void 0||c.background===null||c.coversSeparators===n||c.actual===0)continue;let d=i?r.height:r.width;if(c.position>d)continue;let f=c.computeEffectiveSpacing(),p=c.separatorStrokeWidth;isNaN(p)&&(p=i?this.defaultRowSeparatorStrokeWidth:this.defaultColumnSeparatorStrokeWidth);let g=c.separatorStroke;g===null&&(g=i?this.defaultRowSeparatorStroke:this.defaultColumnSeparatorStroke),(g===null||c.index===(i?h:l))&&(p=0),f-=p;let y=c.position+p,b=f+c.actual;if(y+b>d&&(b=d-y),b<=0)continue;let v=this.Qt;this.bn(t,c.background,!0,!1,a,r),i?t.fillRect(v.left,y+v.top,r.width-(v.left+v.right),b):t.fillRect(y+v.left,v.top,b,r.height-(v.top+v.bottom))}}mD(t){let e=t?this.rowCount:this.columnCount;for(let i=0;i<e;i++){let s=t?this.Zi[i]:this.Qi[i];if(s!==void 0)return s.index}return 0}wf(){let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].wf();this.Ji(!0)}yf(t,e,i){let s=this.svg;if(s===null)return!1;if(this.type===G.Table){let r=s.getElementsByClassName("gojs-ts"),a=r.length!==0?r[0]:null;a!==null&&(a.innerHTML=""),t.currentElement=a,this.JN(t,e),t.currentElement=null}else{if(this.W===G.Grid||this.W===G.Graduated)return s.innerHTML="",s.remove(),!1;if(this.W===G.Spot&&this.isClipping)return s.innerHTML="",s.remove(),this.xa=null,this.wf(),!1}if(!super.yf(t,e,i))return!1;let n=this.D.r,o=n.length;for(let r=0;r<o;r++)n[r].Ge(t,e);return!0}Pd(t){return!0}$p(t,e,i,s){if(!this.isClipping){if(this.Qs()&&t.partClipRect!==null){let n=t.partClipRect,o=this.D.r,r=0,a=0;for(let h=0;h<o.length;h++){if(!o[h].isVisibleObject())continue;let l=o[h].actualBounds;r=h===0?l.x:Math.min(l.x,r),a=h===0?l.y:Math.min(l.y,a)}s.setAttributeNS(null,"clip-path",`path('M ${n.x-i.x-r},${n.y-i.y-a} l ${n.width} 0 l 0 ${n.height} l -${n.width} 0 z')`);return}super.$p(t,e,i,s)}}mf(t,e,i,s,n){let o=this.Mn(),r=this.v,a=1/(r.m11*r.m22-r.m12*r.m21),h=r.m22*a,l=-r.m12*a,u=-r.m21*a,c=r.m11*a,d=a*(r.m21*r.dy-r.m22*r.dx),f=a*(r.m12*r.dx-r.m11*r.dy);if(this.background!==null){let p=t*h+e*u+d,g=t*l+e*c+f,y=i*h+s*u+d,b=i*l+s*c+f;n.e(0,0);let v=this.naturalBounds,w=C.Cl(0,0,v.width,v.height,p,g,y,b,n);return n.v(r),w}else{o||(h=1,l=0,u=0,c=1,d=0,f=0);let p=t*h+e*u+d,g=t*l+e*c+f,y=i*h+s*u+d,b=i*l+s*c+f;n.e(y,b);let v=(y-p)**2+(b-g)**2,w=!1,k=this.D.r,S=k.length,N=P.l(),D=null,L=1/0,M=null,A=this.isClipping&&this.W===G.Spot;A&&(M=P.l(),D=this.findMainElement(),w=D.mf(p,g,y,b,M),w&&(L=(p-M.x)**2+(g-M.y)**2));for(let F=0;F<S;F++){let O=k[F];if(!O.visible||O===D||!O.mf(p,g,y,b,N))continue;w=!0;let E=(p-N.x)**2+(g-N.y)**2;E<v&&(v=E,n.set(N))}return A&&(L>v&&n.set(M),P.i(M)),P.i(N),o&&n.v(r),w}}jc(){let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].jc();super.jc()}f(t){if(this.Xo())return;super.f(t);let e=null;(this.W===G.Auto||this.W===G.Link)&&(e=this.findMainElement());let i=this.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n];if((o===e||o.isPanelMain)&&o.f(!0),o.desiredSize.isReal()||!o.visible)continue;let r=o.Zs(!1);!(o instanceof le)&&!(o instanceof G)&&!(o instanceof lt)&&r===0||o.f(!0)}}bf(){if(this.Xo())return;this.xi(!0),this.lo(!0);let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].bf()}pf(){if(this.B1()===!1){this.Sd(!0),this.Na(!0);let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].TN()}}TN(){this.Na(!0);let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].TN()}bd(t,e,i,s){let n=this.$o;n.e(0,0,0,0);let o=this.desiredSize,r=this.minSize;i===void 0&&(i=r.width,s=r.height),i=Math.max(i,r.width),s=Math.max(s,r.height);let a=this.maxSize;isNaN(o.width)||(t=Math.min(o.width,a.width)),isNaN(o.height)||(e=Math.min(o.height,a.height)),t=Math.max(i,t),e=Math.max(s,e);let h=this.Qt;t=Math.max(t-h.left-h.right,0),e=Math.max(e-h.top-h.bottom,0);let l=this.D.r;this.W.measure(this,t,e,l,n,i,s);let u=n.width+h.left+h.right,c=n.height+h.top+h.bottom;isFinite(o.width)&&(u=o.width),isFinite(o.height)&&(c=o.height),u=Math.min(a.width,u),c=Math.min(a.height,c),u=Math.max(r.width,u),c=Math.max(r.height,c),u=Math.max(i,u),c=Math.max(s,c),n.Hn(u,c),this.naturalBounds.Hn(u,c),this.ro(0,0,u,c)}findMainElement(){if(this.rl===null){let t=this.D.r,e=t.length;if(e===0)return null;for(let i=0;i<e;i++){let s=t[i];if(s.isPanelMain===!0)return this.rl=s,s}this.rl=t[0]}return this.rl}Jo(){return this.part!==null?this.part.locationObject:null}get panelLayoutState(){return this.WN}set panelLayoutState(t){this.WN=t}Pa(t,e,i,s){let n=this.D.r;if(this.actualBounds.e(t,e,i,s),!this.desiredSize.isReal()){let o=this.Zs(!0),r=this.measuredBounds,a=r.width,h=r.height,l=this.il,u=l.left+l.right,c=l.top+l.bottom;switch(a===i&&h===s&&(o=0),o){case 0:(a>i||h>s)&&(this.f(),this.ht(a>i?i:a,h>s?s:h,0,0));break;case 2:this.f(!0),this.ht(i+u,s+c,0,0);break;case 5:this.f(!0),this.ht(i+u,h+c,0,0);break;case 4:this.f(!0),this.ht(a+u,s+c,0,0);break}}this.W.arrange(this,n,this.$o)}ka(t){let e=this.naturalBounds,i=this.Jo();if(I.contains(0,0,e.width,e.height,t.x,t.y)){let s=this.D.r,n=s.length,o=P.z(0,0);for(let r=n;r--;){let a=s[r];if(!(!a.visible&&a!==i)&&(o.set(t).Yi(a.v),a.containsPoint(o)))return P.i(o),!0}return P.i(o),this.Lt!==null}return!1}Yp(t){if(this.no===t)return this;let e=this.D.r,i=e.length;for(let s=0;s<i;s++){let n=e[s].Yp(t);if(n!==null)return n}return null}walkVisualTreeFrom(t,e){if(e(this,t),t instanceof G){let i=t.D.r,s=i.length;for(let n=0;n<s;n++)this.walkVisualTreeFrom(i[n],e)}}Pn(t){this.pD(this,t)}pD(t,e){e(t);let i=t.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n];o instanceof G&&this.pD(o,e)}}qI(t){this.yD(this,t)}yD(t,e){if(e(t),t instanceof G){let i=t.D.r,s=i.length;for(let n=0;n<s;n++)this.yD(i[n],e)}}findInVisualTree(t){return this.wD(this,t)}wD(t,e){if(e(t))return t;if(t instanceof G){let i=t.D.r,s=i.length;for(let n=0;n<s;n++){let o=this.wD(i[n],e);if(o!==null)return o}}return null}findObject(t){if(this.name===t)return this;let e=this.D.r,i=e.length;this.Ta!==null&&(i=this.U0());for(let s=0;s<i;s++){let n=e[s];if(n instanceof G){let o=n.findObject(t);if(o!==null)return o}if(n.name===t)return n}return null}xD(){let t=this.D.r,e=t.length,i=0;for(let s=0;s<e;s++){let n=t[s];n instanceof G?i=Math.max(i,n.xD()):n instanceof et&&(i=Math.max(i,n.jI()))}return i}Mn(){return!(this.type===G.TableRow||this.type===G.TableColumn)}nl(){return this.type===G.TableRow||this.type===G.TableColumn}XA(t,e,i){if(this.pickable===!1||(e===void 0&&(e=null),i===void 0&&(i=null),this.as()))return null;let s=this.naturalBounds,n=1/this.getDocumentScale(),o=this.Mn(),r=o?t:P.z(t.x,t.y).Yi(this.v),a=this.diagram,h=10,l=5;if(a!==null&&(h=a.getInputOption("extraTouchArea"),l=h/2),I.contains(-(l*n),-(l*n),s.width+h*n,s.height+h*n,r.x,r.y)){if(!this.Af){let c=this.D.r,d=c.length,f=P.l(),p=this.isClipping&&this.W===G.Spot,g=p?this.findMainElement():null;if(p&&g&&(g.Mn()?f.set(t).Yi(g.v):f.set(t),!g.containsPoint(f)))return P.i(f),o||P.i(r),null;let y=this.Jo();for(let b=d;b--;){let v=c[b];if(!v.visible&&v!==y||(v.Mn()?f.set(t).Yi(v.v):f.set(t),p&&v===g))continue;let w=null;if(v instanceof G?w=v.XA(f,e,i):v.pickable===!0&&v.containsPoint(f)&&(w=v),w!==null&&(e!==null&&(w=e(w)),w!==null&&(i===null||i(w))))return P.i(f),o||P.i(r),w}P.i(f)}if(this.background===null)return o||P.i(r),null;let u=I.contains(0,0,s.width,s.height,r.x,r.y)?this:null;return o||P.i(r),u}return o||P.i(r),null}GA(t,e,i,s){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);let n=this.naturalBounds,o=this.Mn(),r=o?t:P.z(t.x,t.y).Yi(this.v),a=this.nl(),h=I.contains(0,0,n.width,n.height,r.x,r.y);if(a||h){if(!this.Af){let l=this.D.r,u=l.length,c=P.l(),d=this.Jo();for(let f=u;f--;){let p=l[f];if(!p.visible&&p!==d)continue;p.Mn()?c.set(t).Yi(p.v):c.set(t);let g=p,y=p instanceof G?p:null;if(y!==null?y.GA(c,e,i,s):g.containsPoint(c)){if(g.pickable===!1)continue;e!==null&&(g=e(g)),g!==null&&(i===null||i(g))&&s.add(g)}}P.i(c)}return o||P.i(r),h&&this.background!==null}return o||P.i(r),!1}Zm(t,e,i,s,n,o){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);let r=o;if(r===void 0&&(r=Nt.l(),r.Ue()),r.bc(this.v),this.containedInRect(t,r))return this.$N(e,i,n),o===void 0&&Nt.i(r),!0;if(this.intersectsRect(t,r)){if(!this.Af){let a=this.Jo(),h=this.D.r,l=h.length;for(let u=l;u--;){let c=h[u];if(!c.visible&&c!==a)continue;let d=c.actualBounds,f=this.naturalBounds;if(d.x>f.width||d.y>f.height||d.x+d.width<0||d.y+d.height<0)continue;let p=c,g=c instanceof G?c:null,y=Nt.l();y.set(r),(g!==null?g.Zm(t,e,i,s,n,y):p.ZT(t,s,y))&&(e!==null&&(p=e(p)),p!==null&&(i===null||i(p))&&n.add(p)),Nt.i(y)}}return o===void 0&&Nt.i(r),s}return o===void 0&&Nt.i(r),!1}$N(t,e,i){let s=this.D.r,n=s.length;for(let o=n;o--;){let r=s[o];if(!r.visible)continue;let a=r.actualBounds,h=this.naturalBounds;if(a.x>h.width||a.y>h.height||a.x+a.width<0||a.y+a.height<0)continue;r instanceof G&&r.$N(t,e,i);let l=r;t!==null&&(l=t(l)),l!==null&&(e===null||e(l))&&i.add(l)}}YA(t,e,i,s,n,o){if(this.pickable===!1)return!1;i===void 0&&(i=null),s===void 0&&(s=null);let r=this.naturalBounds,a=this.Mn(),h=a?t:P.z(t.x,t.y).Yi(this.v),l=a?e:P.z(e.x,e.y).Yi(this.v),u=h.distanceSquaredPoint(l),c=h.x>0&&h.x<r.width&&h.y>0&&h.y<r.height||P.distanceLineSegmentSquared(h.x,h.y,0,0,0,r.height)<=u||P.distanceLineSegmentSquared(h.x,h.y,0,r.height,r.width,r.height)<=u||P.distanceLineSegmentSquared(h.x,h.y,r.width,r.height,r.width,0)<=u||P.distanceLineSegmentSquared(h.x,h.y,r.width,0,0,0)<=u,d=h.distanceSquared(0,0)<=u&&h.distanceSquared(0,r.height)<=u&&h.distanceSquared(r.width,0)<=u&&h.distanceSquared(r.width,r.height)<=u;if(a||(P.i(h),P.i(l)),c){if(!this.Af){let f=P.l(),p=P.l(),g=this.Jo(),y=this.D.r,b=y.length;for(let v=b;v--;){let w=y[v];if(!w.visible&&w!==g)continue;let k=w.actualBounds,S=this.naturalBounds;if(a&&(k.x>S.width||k.y>S.height||k.x+k.width<0||k.y+k.height<0))continue;if(w.Mn()){let L=w.v;f.set(t).Yi(L),p.set(e).Yi(L)}else f.set(t),p.set(e);let N=w,D=w instanceof G?w:null;(D!==null?D.YA(f,p,i,s,n,o):N.QT(f,p,n))&&(i!==null&&(N=i(N)),N!==null&&(s===null||s(N))&&o.add(N))}P.i(f),P.i(p)}return n?c:d}return!1}YN(t){let e=null;if(t instanceof et){e=t.spot1,e===T.Default&&(e=null);let i=t.geometry;i!==null&&e===null&&(e=i.spot1)}return e===null&&(e=T.TopLeft),e}KN(t){let e=null;if(t instanceof et){e=t.spot2,e===T.Default&&(e=null);let i=t.geometry;i!==null&&e===null&&(e=i.spot2)}return e===null&&(e=T.BottomRight),e}add(...t){for(let e=0;e<t.length;e++)this.insertAt(this.D.count,t[e]);return this}elt(t){return this.D.elt(t)}insertAt(t,e){e instanceof pt&&m.o("Cannot add a Part to a Panel: "+e+"; use a Panel instead"),(this===e||this.isContainedBy(e))&&(this===e&&m.o("Cannot make a Panel contain itself: "+this.toString()),m.o("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+e.toString()));let i=e.panel;if(i!==null&&i!==this&&m.o("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+e.toString()+", already contained by "+i.toString()+", cannot be shared by this Panel: "+this.toString()),this.W===G.Grid&&!(e instanceof et)&&m.o("Can only add Shapes to a Grid Panel, not: "+e),this.W===G.Graduated&&!(e instanceof et||e instanceof lt)&&m.o("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+e),e.Uh(this),e.sl=null,this.itemArray!==null){let r=e.data;m.$(r)&&(this._s===null&&(this._s=new Mt),this._s.set(r,e))}let s=this.D,n=-1;if(i===this){let r=-1,a=this.D.r,h=a.length;for(let l=0;l<h;l++)if(a[l]===e){r=l;break}if(r!==-1){if(r===t||r+1>=s.count&&t>=s.count)return;s.removeAt(r),n=r}else m.o("element "+e.toString()+" has panel "+i.toString()+" but is not contained by it.")}(t<0||t>s.count)&&(t=s.count),s.insertAt(t,e),(t===0||e.isPanelMain)&&(this.rl=null),this.Xo()||this.f(),e.f(!1),e.portId!==null?this.Cn=!0:e instanceof G&&e.Cn===!0&&(this.Cn=!0),this.ds=null,this.isEnabledObject()||this.Z1(e,!1);let o=this.part;if(o!==null){o.s0(),o.Tf(),this.Cn&&o instanceof J&&(o.Cn=!0),o.Cn&&o instanceof J&&(o.ci=null);let r=this.diagram;if(r!==null&&r.undoManager.isUndoingRedoing)return;n!==-1&&o.raiseChangedEvent(4,"elements",this,e,null,n,null),o.raiseChangedEvent(3,"elements",this,null,e,null,t)}}get Cn(){return(this.n&8388608)!==0}set Cn(t){(this.n&8388608)!==0!==t&&(this.n=this.n^8388608)}NN(){return(this.n&16777216)!==0}ZN(t){t?this.n|=16777216:this.n&=-16777217}HI(t){t.Uh(this),t.sl=null;let e=this.D,i=e.count;e.insertAt(i,t);let s=this.part;if(s!==null){s.s0(),t.portId!==null&&s instanceof J&&(s.Cn=!0);let n=this.diagram;if(n!==null&&n.undoManager.isUndoingRedoing)return;s.raiseChangedEvent(3,"elements",this,null,t,null,i)}}fI(t){let e=this.D.r,i=e.length,s=-1;for(let n=0;n<i;n++)if(e[n]===t){s=n;break}return s}remove(t){let e=this.D.r,i=e.length,s=-1;for(let n=0;n<i;n++)if(e[n]===t){s=n;break}s!==-1&&this.ri(s,!0)}removeAt(t){t>=0&&this.ri(t,!0)}ri(t,e){let i=this.D,s=i.elt(t);if(s.sl=null,s.Uh(null),this._s!==null){let o=s.data;m.$(o)&&this._s.delete(o)}i.removeAt(t),this.xi(!1),this.f(),this.rl===s&&(this.rl=null),this.ds=null;let n=this.part;if(n!==null){n.s0(),n.Tf(),n.invalidateAdornments(),n instanceof J&&(s instanceof G?s.walkVisualTreeFrom(s,(r,a)=>n.RN(a,e)):n.RN(s,e));let o=this.diagram;if(o!==null&&o.undoManager.isUndoingRedoing)return;n.raiseChangedEvent(4,"elements",this,s,null,t,null)}}get Zi(){return this.O===null&&(this.O=new ie),this.O.Zi}get rowCount(){return this.O===null?0:this.Zi.length}getRowDefinition(t){t<0&&m.J(t,">= 0",G,"getRowDefinition:idx"),t=Math.round(t);let e=this.Zi;if(e[t]===void 0){let i=new Xt;i.Uh(this),i.isRow=!0,i.index=t,e[t]=i,this.raiseChangedEvent(3,"rowdefs",this,null,i,null,t)}return e[t]}removeRowDefinition(t){if(t<0&&m.J(t,">= 0",G,"removeRowDefinition:idx"),this.rowCount===0)return;t=Math.round(t);let e=this.Zi,i=e[t];if(i){e[t]=void 0;let s=e.length-1;for(;s>=0&&e[s--]===void 0;)e.length--;this.raiseChangedEvent(4,"rowdefs",this,i,null,t,null),this.f()}}kT(t,e){let i=this.Zi;if(!(t<0)){if(i[t]=e instanceof Xt?e:void 0,!e){let s=i.length-1;for(;s>=0&&i[s--]===void 0;)i.length--}this.f()}}get Qi(){return this.O===null&&(this.O=new ie),this.O.Qi}get columnCount(){return this.O===null?0:this.Qi.length}getColumnDefinition(t){t<0&&m.J(t,">= 0",G,"getColumnDefinition:idx"),t=Math.round(t);let e=this.Qi;if(e[t]===void 0){let i=new Xt;i.Uh(this),i.isRow=!1,i.index=t,e[t]=i,this.raiseChangedEvent(3,"coldefs",this,null,i,null,t)}return e[t]}removeColumnDefinition(t){if(t<0&&m.J(t,">= 0",G,"removeColumnDefinition:idx"),this.columnCount===0)return;t=Math.round(t);let e=this.Qi,i=e[t];if(i){e[t]=void 0;let s=e.length-1;for(;s>=0&&e[s--]===void 0;)e.length--;this.raiseChangedEvent(4,"coldefs",this,i,null,t,null),this.f()}}PT(t,e){let i=this.Qi;if(!(t<0)){if(i[t]=e instanceof Xt?e:void 0,!e){let s=i.length-1;for(;s>=0&&i[s--]===void 0;)i.length--}this.f()}}addRowColumnDefinition(t){let e=null;return t.isRow?e=this.getRowDefinition(t.index):t.isRow||(e=this.getColumnDefinition(t.index)),e&&e.X1(t),this}addRowDefinition(t,e){let i=this.getRowDefinition(t);return i&&i.X1(new Xt(e)),this}addColumnDefinition(t,e){let i=this.getColumnDefinition(t);return i&&i.X1(new Xt(e)),this}get rowSizing(){return this.O!==null?this.O.V0:3}set rowSizing(t){let e=this.rowSizing;e!==t&&(this.O===null&&(this.O=new ie),this.O.V0=t,this.f(),this.t("rowSizing",e,t))}get columnSizing(){return this.O!==null?this.O.B0:3}set columnSizing(t){let e=this.columnSizing;e!==t&&(this.O===null&&(this.O=new ie),this.O.B0=t,this.f(),this.t("columnSizing",e,t))}get topIndex(){return this.O!==null?this.O.z0:0}set topIndex(t){let e=this.topIndex;e!==t&&((!isFinite(t)||t<0)&&m.o("Panel.topIndex must be greater than zero and a real number, not: "+t),this.O===null&&(this.O=new ie),this.O.z0=t,this.f(),this.t("topIndex",e,t))}get leftIndex(){return this.O!==null?this.O.X0:0}set leftIndex(t){let e=this.leftIndex;e!==t&&((!isFinite(t)||t<0)&&m.o("Panel.leftIndex must be greater than zero and a real number, not: "+t),this.O===null&&(this.O=new ie),this.O.X0=t,this.f(),this.t("leftIndex",e,t))}findRowForLocalY(t){if(t<0||this.type!==G.Table||this.rowCount===0)return-1;let e=0,i=this.Zi,s=i.length,n=this.topIndex;for(;n<s;n++){let o=i[n];if(o!==void 0&&(e+=o.total,t<e))return n}return n}findColumnForLocalX(t){if(t<0||this.type!==G.Table||this.columnCount===0)return-1;let e=0,i=this.Qi,s=i.length,n=this.leftIndex;for(;n<s;n++){let o=i[n];if(o!==void 0&&(e+=o.total,t<e))return n}return n}graduatedPointForValue(t,e){if(e===void 0&&(e=new P(NaN,NaN)),this.type!==G.Graduated)return e.e(NaN,NaN),e;t=Math.min(Math.max(t,this.graduatedMin),this.graduatedMax);let i=this.findMainElement();return i.geometry.getPointAlongPath((t-this.graduatedMin)/this.graduatedRange,e),i.v.gt(e)}graduatedValueForPoint(t){if(this.type!==G.Graduated)return NaN;let e=this.findMainElement();return e.v.Ci(t),e.geometry.getFractionForPoint(t)*this.graduatedRange+this.graduatedMin}get data(){return this.te}set data(t){let e=this.te;if(e!==t){let i=this instanceof pt&&!(this instanceof vt);i&&m.s(t,"object",G,"data"),this.It(),this.te=t;let s=this.diagram;if(s!==null)if(i){s.partManager.WI(this,e,t);let n=this.adornments;for(;n.next();){let o=n.value,r=o.adornedObject;if(r!==null){let a=r.findBindingPanel();a!==null&&(o.data=a.data)}}}else{let n=this.panel;n!==null&&n._s!==null&&(e!==null&&n._s.delete(e),t!==null&&n._s.set(t,this))}if(this.t("data",e,t),s!==null&&s.undoManager.isUndoingRedoing)return;t!==null&&this.updateTargetBindings()}}get itemIndex(){return this.Fd}set itemIndex(t){let e=this.Fd;e!==t&&(this.Fd=t,this.t("itemIndex",e,t))}get Ds(){return this.w!==null?this.w.Ds:null}set Ds(t){this.ve!==t&&(this.w===null&&(this.w=new Ue),this.w.Ds=t)}ON(){return this.Ds!==null}rD(){let t=this.Ds;return t!==null&&t.u}freezeBindings(){return this.It()}It(){let t=this.Ds;if(t===null)this.data!==null&&m.o("Template cannot have .data be non-null: "+this),this.Ds=t=new q;else if(t.u)return this;let e=new q;this.ZN(!1),this.walkVisualTreeFrom(this,(n,o)=>{o.ba();let r=o.ve;if(r!==null){o.DN(!1);let a=r.iterator;for(;a.next();){let h=a.value;h.mode===2&&o.DN(!0);let l=h.sourceName;if(h.isToObject){l==="/"&&n.ZN(!0);let u=h.$T(n,o);u!==null&&(e.add(u),u.oo===null&&(u.oo=new q),u.oo.add(h))}t.add(h)}}if(o instanceof G&&o.type===G.Table){if(o.rowCount>0){let a=o.Zi,h=a.length;for(let l=0;l<h;l++){let u=a[l];if(u!==void 0&&u.Fs!==null){let c=u.Fs.iterator;for(;c.next();){let d=c.value;d.Ti=u,d.Id=2,d.Df=u.index,t.add(d)}}}}if(o.columnCount>0){let a=o.Qi,h=a.length;for(let l=0;l<h;l++){let u=a[l];if(u!==void 0&&u.Fs!==null){let c=u.Fs.iterator;for(;c.next();){let d=c.value;d.Ti=u,d.Id=1,d.Df=u.index,t.add(d)}}}}}});let i=e.iterator;for(;i.next();){let n=i.value;if(n.oo!==null){n.DN(!0);let o=n.oo.iterator;for(;o.next();){let r=o.value;n.ve===null&&(n.ve=new q),n.ve.add(r)}}n.oo=null}let s=t.iterator;for(;s.next();){let n=s.value,o=n.Ti;if(o!==null){n.Ti=null;let r=n.targetProperty,a=r.indexOf(".");if(a>0&&o instanceof G){let h=r.substring(0,a),l=r.substring(a+1),u=o.findObject(h);u!==null?(o=u,n.targetProperty=l):(m.ne('Warning: unable to find GraphObject named "'+h+'" for Binding: '+n.toString()),o=null)}if(o instanceof Xt){let h=V.xs(o.panel);n.targetId=h===void 0?-1:h,o.panel.no=n.targetId}else if(o instanceof $){let h=V.xs(o);n.targetId=h===void 0?-1:h,o.no=n.targetId}else m.o("Unknown type of binding target: "+o);n.check(o)}}return t.k(),this instanceof pt&&this.Di()&&this.ensureBounds(),this}static BU=!1;copyTemplate(t){t===void 0&&(t=!1);let e=this.copy();return e.qI(i=>{i instanceof G&&(i.Ds=null,i.te=null);let s=i.ve;s!==null&&(i.ve=null,s.each(o=>i.bind(o.copy())));let n=i.Ts;n!==null&&(i.Ts=null,n.each(o=>i.trigger(o.value.copy())))}),t&&e.It(),e}updateTargetBindings(t){let e=this.Ds;if(e===null)return;t===void 0&&(t="");let i=this.diagram?.model,s=e.iterator;for(;s.next();){let n=s.value,o=this.QN(n,t);if(o===null)continue;let{data:r,elt:a}=o;n.isToTheme&&this.diagram===null||a!==void 0&&n.updateTarget(a,r,void 0,i)}}JI(t){if(t===""){this.updateTargetBindings(t);return}let e=this.Ds;if(e===null)return;let i=this.diagram?.model,s=e.iterator;for(;s.next();){let n=s.value;if(n.isToData&&n.sourceProperty!=="")continue;let o=this.QN(n,"");if(o===null)continue;let{data:r,elt:a}=o;a!==void 0&&n.updateTarget(a,r,void 0,i)}}Go(){if(this.diagram!==null)if(this.ON()){let t=this.diagram.model,e=this.Ds.iterator;for(;e.next();){let i=e.value;if(!i.isToTheme)continue;let s=this.QN(i);if(s===null)continue;let{data:n,elt:o}=s;o!==void 0&&i.updateTarget(o,n,void 0,t)}}else{let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].Go()}}QN(t,e=""){let i=t.sourceProperty;if(e!==""&&i!==""&&i!==e)return null;let s=t.targetProperty;if(t.converter===null&&s==="")return null;let n=this.data,o=t.sourceName;if(t.isToObject){if(n=this.JT(o),n===null)return null}else if(t.isToModel){let l=this.diagram;if(l===null)return null;n=l.model.modelData}let r=this,a=t.targetId;if(a!==-1){if(r=this.Yp(a),r===null)return null}else t.Ti!==null&&(r=t.Ti);o==="/"?n=r.part:o==="."?n=r:o===".."&&(n=r.panel);let h=t.Id;if(h!==0){if(!(r instanceof G))return null;h===1?r=r.getColumnDefinition(t.Df):h===2&&(r=r.getRowDefinition(t.Df))}return{data:n,elt:r}}get itemArray(){return this.Ta}set itemArray(t){let e=this.Ta;if(e!==t||t!==null&&this.$I(t)){let i=this.diagram;if(e!==t&&(i!==null&&e!==null&&i.partManager.L2(this,i),this.Ta=t,i!==null&&t!==null&&i.partManager.C2(this,i)),this.t("itemArray",e,t),i!==null&&i.undoManager.isUndoingRedoing)return;this.bD(e,t)}}findItemPanelForData(t){return t==null||this._s===null?null:(m.wc(t,G,"findItemPanelForData"),this._s.get(t))}$I(t){let e=this.D.r,i=e.length,s=t.length,n=0,o=null;for(;n<i&&(o=e[n],!(o instanceof G)||o.data===null);)n++,o=e[n];if(i-n!==s)return!0;if(o===null)return s>0;let r=0;for(;n<i&&r<s;){if(o=e[n],!(o instanceof G)||o.data!==t[r])return!0;n++,r++}return!1}U0(){if(this.type===G.Spot||this.type===G.Auto)return Math.min(this.D.length,1);if(this.type===G.Link){let t=this.D,e=t.length,i=0;for(;i<e;i++){let s=t.elt(i);if(!(s instanceof et)||!s.isPanelMain)return i}return i}if(this.type===G.Table&&this.D.length>0){let t=this.D.elt(0);if(t.isPanelMain&&t instanceof G&&t.nl())return 1}return 0}rebuildItemElements(){let t=this.U0();for(;this.D.length>t;)this.ri(this.D.length-1,!1);this.bD(null,this.itemArray)}bD(t,e){let i=this.U0(),s=e;if(s===null||s.length===0){for(;this.D.length>i;)this.ri(this.D.length-1,!1);return}if(this.D.length<=i){let n=s.length;for(let o=0;o<n;o++)this.Q1(s[o],o,!0)}else{let n=i;for(let r=0;r<s.length;r++,n++){let a=s[r],h=n<this.D.length?this.D.elt(n):null;if(h instanceof G){if(h.data!==a){let l=this._N(h.data,r),u=this._N(a,r),c=u!==l;if(!c){let d=this.tC(h.data,r,l);c=this.tC(a,r,u)!==d}c?(this.ri(n,!1),this.Q1(a,r,!1)):h.data=a}}else this.Q1(a,r,!1)}for(;n<this.D.length;)this.ri(n,!1);this.rl=null,this.eC(i,0),this.Xo()||this.f(),this.ds=null,this.isEnabledObject()||this.Z1(this,!1);let o=this.part;o!==null&&(o.s0(),o.Tf(),this.Cn&&o instanceof J&&(o.Cn=!0),o.Cn&&o instanceof J&&(o.ci=null))}}Q1(t,e,i){if(t==null||e<0)return;let s=this._N(t,e),n=this.tC(t,e,s);if(n!==null){n.It();let o=n.copy();if(o.NN()){let a=this.findBindingPanel();a!==null&&a.ZN(!0)}m.$(t)&&(this._s===null&&(this._s=new Mt),this._s.set(t,o));let r=e+this.U0();this.insertAt(r,o),i&&(o.te=t,this.eC(r,e),o.te=null),o.data=t}}ZI(t){if(t<0)return;let e=t+this.U0();this.ri(e,!0),this.eC(e,t)}eC(t,e){let i=this.D,s=t,n=e;for(;s<i.length;){let o=i.elt(s);o instanceof G&&o.QI(s,n),s++,n++}}QI(t,e){this.type===G.TableRow?this.row=t:this.type===G.TableColumn&&(this.column=t),this.itemIndex=e}get itemTemplate(){let t=this.itemTemplateMap;if(t!==null){let e=t.get("");if(e)return e}return G.kD()}set itemTemplate(t){let e=this.itemTemplate;if(e!==t){(t instanceof pt||t.isPanelMain)&&m.o("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+t),this.itemTemplateMap===null&&(this.itemTemplateMap=new Mt),this.itemTemplateMap.set("",t),this.t("itemTemplate",e,t);let i=this.diagram;if(i!==null&&i.undoManager.isUndoingRedoing)return;this.rebuildItemElements()}}get itemTemplateMap(){return this.w!==null?this.w.x0:null}set itemTemplateMap(t){let e=this.itemTemplateMap;if(e!==t){let i=t.iterator;for(;i.next();){let n=i.value}this.Yt().x0=t,this.t("itemTemplateMap",e,t);let s=this.diagram;if(s!==null&&s.undoManager.isUndoingRedoing)return;this.rebuildItemElements()}}get itemCategoryProperty(){return this.w!==null?this.w.b0:"category"}set itemCategoryProperty(t){let e=this.itemCategoryProperty;e!==t&&(typeof t!="string"&&!m.st(t)&&m.si(t,"string or function",G,"itemCategoryProperty"),this.Yt().b0=t,this.t("itemCategoryProperty",e,t))}_N(t,e){if(t===null)return"";let i=this.itemCategoryProperty,s="";if(m.st(i))s=i(t);else if(typeof i=="string"&&m.$(t)){if(i==="")return"";let n=this.diagram,o=n!==null?n.model:null;o?s=o.St(t,i):s=ut.St(t,i)}else return"";if(s===void 0)return"";if(typeof s=="string")return s;m.o("Panel.getCategoryForItemData found a non-string category for "+t+": "+s)}static PD=!1;static iC;static kD(){return G.iC||(G.iC=new G().add(new lt().bind("text","",m.toString).theme("stroke","text"))),G.iC}tC(t,e,i){let s=null,n=this.itemTemplateMap;return n!==null&&(s=n.get(i),s===null&&(s=n.get(""))),s===null&&(G.PD||(G.PD=!0,m.ne('No item template Panel found for category "'+i+'" on '+this),m.ne(" Using default item template.")),s=G.kD()),s}get Af(){return(this.n&1048576)!==0}set Af(t){let e=(this.n&1048576)!==0;e!==t&&(m.s(t,"boolean",G,"isAtomic"),this.n=this.n^1048576,this.t("isAtomic",e,t))}get isClipping(){return(this.n&2097152)!==0}set isClipping(t){let e=(this.n&2097152)!==0;e!==t&&(this.wf(),this.n=this.n^2097152,this instanceof ht&&(this.he=null),this.f(),this.t("isClipping",e,t))}get isOpposite(){return(this.n&33554432)!==0}set isOpposite(t){let e=(this.n&33554432)!==0;e!==t&&(this.n=this.n^33554432,this.f(),this.t("isOpposite",e,t))}get isEnabled(){return(this.n&4194304)!==0}set isEnabled(t){let e=(this.n&4194304)!==0;if(e!==t){let i=this.panel===null||this.panel.isEnabledObject();this.n=this.n^4194304,this.t("isEnabled",e,t);let s=this.diagram;if(s!==null&&s.undoManager.isUndoingRedoing)return;i&&this.Z1(this,t)}}Z1(t,e){let i=t.enabledChanged;if(i!==null&&i(t,e),t instanceof G){let s=t.D.r,n=s.length;for(let o=0;o<n;o++){let r=s[o];e&&r instanceof G&&!r.isEnabled||this.Z1(r,e)}}}get alignmentFocusName(){return this.fo}set alignmentFocusName(t){let e=this.fo;e!==t&&(this.fo=t,this.f(),this.t("alignmentFocusName",e,t))}static definePanelLayout(t,e){Lt.An(t,e)}static isLayoutDefined(t){return Lt.fs.has(t)}static Position=Lt.fs.get("Position");static Horizontal=Lt.fs.get("Horizontal");static Vertical=Lt.fs.get("Vertical");static Spot=Lt.fs.get("Spot");static Auto=Lt.fs.get("Auto");static Table=Lt.fs.get("Table");static Viewbox=Lt.fs.get("Viewbox");static TableRow=Lt.fs.get("TableRow");static TableColumn=Lt.fs.get("TableColumn");static Link=Lt.fs.get("Link");static Grid=Lt.fs.get("Grid");static Graduated=Lt.fs.get("Graduated")}G.definePanelLayout=G.definePanelLayout;class Pe{R0;O0;I0;E0;vs;_i;ds;vi;constructor(){this.R0=0,this.O0=100,this.I0=10,this.E0=0,this.vs=null,this._i=null,this.ds=null,this.vi=null}copy(){let t=new Pe;return t.R0=this.R0,t.O0=this.O0,t.I0=this.I0,t.E0=this.E0,t.vs=this.vs,t._i=this._i,t.ds=this.ds,t.vi=this.vi,t}}class ti{Rd;Od;lf;N0;constructor(){this.Rd=st.EL,this.Od=P.dn,this.lf=st.Zw,this.N0=[]}copy(){let t=new ti;return t.Rd=this.Rd.copy(),t.Od=this.Od.copy(),t.lf=this.lf.copy(),t.N0=this.N0,t}}class ie{Zi;Qi;V0;B0;z0;X0;C0;A0;L0;T0;v0;D0;F0;Aa;constructor(){this.Zi=[],this.Qi=[],this.V0=3,this.B0=3,this.z0=0,this.X0=0,this.C0=Dt.im,this.A0=1,this.L0=null,this.T0=null,this.v0=1,this.D0=null,this.F0=null,this.Aa=null}copy(t){let e=new ie,i=this.Zi,s=i.length,n=e.Zi;for(let h=0;h<s;h++){let l=i[h];if(l===void 0)continue;let u=l.copy();u.Uh(t),n[h]=u}let o=this.Qi,r=o.length,a=e.Qi;for(let h=0;h<r;h++){let l=o[h];if(l===void 0)continue;let u=l.copy();u.Uh(t),a[h]=u}return e.V0=this.V0,e.B0=this.B0,e.z0=this.z0,e.X0=this.X0,e.C0=this.C0.N(),e.A0=this.A0,e.L0=this.L0,e.T0=this.T0,e.v0=this.v0,e.D0=this.D0,e.F0=this.F0,e.Aa=this.Aa,e}}var zi=(x=>(x[x.Default=1]="Default",x[x.None=2]="None",x[x.ProportionalExtra=3]="ProportionalExtra",x))(zi||{});class Xt{$s;G0;Tt;Xh;Gh;de;ct;Ed;ao;ll;Ud;Vd;Yh;Lt;Bd;Fs;q;Re;ki;constructor(t){V.Je(this),this.$s=null,this.G0=!0,this.Tt=0,this.ki=NaN,this.Xh=0,this.Gh=1/0,this.de=T.Default,this.q=0,this.Re=0,this.ct=0,this.Fs=null,this.Ed=1,this.ao=1,this.ll=null,this.Ud=null,this.Vd=NaN,this.Yh=null,this.Lt=null,this.Bd=!1,t&&(Object.assign(this,t),t.column!==void 0?(this.isRow=!1,this.index=t.column):t.row!==void 0&&(this.isRow=!0,this.index=t.row))}copy(){let t=new Xt;return t.G0=this.G0,t.Tt=this.Tt,t.ki=this.ki,t.Xh=this.Xh,t.Gh=this.Gh,t.de=this.de,t.q=this.q,t.Re=this.Re,t.ct=this.ct,t.ao=this.ao,t.Ed=this.Ed,this.ll===null?t.ll=null:t.ll=this.ll.N(),t.Ud=this.Ud,t.Vd=this.Vd,t.Yh=null,this.Yh!==null&&(t.separatorDashArray=this.Yh.slice()),t.Lt=this.Lt,t.Bd=this.Bd,t.Fs=this.Fs,t}X1(t){t.isRow?t.height!==void 0&&(this.height=t.height):t.width!==void 0&&(this.width=t.width),t.minimum!==void 0&&(this.minimum=t.minimum),t.maximum!==void 0&&(this.maximum=t.maximum),t.alignment!==void 0&&(this.alignment=t.alignment),t.stretch!==void 0&&(this.stretch=t.stretch),t.sizing!==void 0&&(this.sizing=t.sizing),t.separatorPadding!==void 0&&(this.separatorPadding=t.separatorPadding),t.separatorStroke!==void 0&&(this.separatorStroke=t.separatorStroke),t.separatorStrokeWidth!==void 0&&(this.separatorStrokeWidth=t.separatorStrokeWidth),t.separatorDashArray!==void 0&&(this.Yh=t.separatorDashArray),t.background!==void 0&&(this.background=t.background),t.coversSeparators!==void 0&&(this.coversSeparators=t.coversSeparators),t.Fs!==void 0&&(this.Fs=t.Fs)}fe(t){t in zi?this.sizing=t:m.ur(this,t)}toString(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+V.xs(this)}static Default=1;static None=2;static ProportionalExtra=3;Uh(t){this.$s=t}computeEffectiveSpacingTop(t){let e=0,i=this.$s;if(this.index!==t){let n=this.separatorStroke;n===null&&i!==null&&(n=this.isRow?i.defaultRowSeparatorStroke:i.defaultColumnSeparatorStroke),n!==null&&(e=this.separatorStrokeWidth,isNaN(e)&&(i!==null?e=this.isRow?i.defaultRowSeparatorStrokeWidth:i.defaultColumnSeparatorStrokeWidth:e=0))}let s=this.ll;if(s===null)if(i!==null)s=i.defaultSeparatorPadding;else return e;return e+(this.isRow?s.top:s.left)}computeEffectiveSpacing(){let t=0,e=this.$s,i=0,s=this.isRow;if(e!==null&&e.type===G.Table){let o=s?e.Zi.length:e.Qi.length;for(let r=0;r<o;r++){let a=s?e.Zi[r]:e.Qi[r];if(a!==void 0&&a.q!==0){i=a.index;break}}}if(this.index!==i){let o=this.separatorStroke;o===null&&e!==null&&(o=s?e.defaultRowSeparatorStroke:e.defaultColumnSeparatorStroke),o!==null&&(t=this.separatorStrokeWidth,isNaN(t)&&(e!==null?t=s?e.defaultRowSeparatorStrokeWidth:e.defaultColumnSeparatorStrokeWidth:t=0))}let n=this.ll;if(n===null)if(e!==null)n=e.defaultSeparatorPadding;else return t;return t+(this.isRow?n.top+n.bottom:n.left+n.right)}t(t,e,i,s,n){let o=this.$s;if(o!==null&&(o.raiseChangedEvent(2,t,this,e,i,s,n),this.Fs!==null)){let r=o.diagram;if(r!==null&&!r.wi){let a=o.findBindingPanel();if(a!==null){let h=a.data;if(h!==null){let l=this.Fs.iterator;for(;l.next();)l.value.updateSource(this,h,t,a)}}}}}get panel(){return this.$s}get isRow(){return this.G0}set isRow(t){this.G0=t}get index(){return this.Tt}set index(t){this.Tt=t}get height(){return this.ki}set height(t){let e=this.ki;e!==t&&(t<0&&m.J(t,">= 0",Xt,"height"),this.ki=t,this.actual=this.q,this.panel!==null&&this.panel.f(),this.t("height",e,t))}get width(){return this.ki}set width(t){let e=this.ki;e!==t&&(t<0&&m.J(t,">= 0",Xt,"width"),this.ki=t,this.actual=this.q,this.panel!==null&&this.panel.f(),this.t("width",e,t))}get minimum(){return this.Xh}set minimum(t){let e=this.Xh;e!==t&&((t<0||!isFinite(t))&&m.J(t,">= 0",Xt,"minimum"),this.Xh=t,this.actual=this.q,this.panel!==null&&this.panel.f(),this.t("minimum",e,t))}get maximum(){return this.Gh}set maximum(t){let e=this.Gh;e!==t&&(t<0&&m.J(t,">= 0",Xt,"maximum"),this.Gh=t,this.actual=this.q,this.panel!==null&&this.panel.f(),this.t("maximum",e,t))}get alignment(){return this.de}set alignment(t){let e=this.de;e.equals(t)||(this.de=t.N(),this.panel!==null&&this.panel.f(),this.t("alignment",e,t))}get stretch(){return this.ao}set stretch(t){let e=this.ao;e!==t&&(this.ao=t,this.panel!==null&&this.panel.f(),this.t("stretch",e,t))}get separatorPadding(){return this.ll}set separatorPadding(t){typeof t=="number"&&(t=new Dt(t));let e=this.ll;(t===null||e===null||!e.equals(t))&&(t!==null&&(t=t.N()),this.ll=t,this.panel!==null&&this.panel.f(),this.t("separatorPadding",e,t))}get separatorStroke(){return this.Ud}set separatorStroke(t){let e=this.Ud;e!==t&&(t!==null&&R.Md(t,"RowColumnDefinition.separatorStroke"),t instanceof R&&t.k(),this.Ud=t,this.panel!==null&&this.panel.f(),this.t("separatorStroke",e,t))}get separatorStrokeWidth(){return this.Vd}set separatorStrokeWidth(t){let e=this.Vd;e!==t&&(this.Vd=t,this.panel!==null&&this.panel.f(),this.t("separatorStrokeWidth",e,t))}get separatorDashArray(){return this.Yh}set separatorDashArray(t){let e=this.Yh;if(e!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",Xt,"separatorDashArray:value"),t!==null){let i=t.length,s=0;for(let n=0;n<i;n++){let o=t[n];(typeof o!="number"||!(o>=0)||!isFinite(o))&&m.o("separatorDashArray value "+o+" at index "+n+" must be a positive number or zero."),s+=o}if(s===0){if(e===null)return;t=null}}this.Yh=t,this.panel!==null&&this.panel.C(),this.t("separatorDashArray",e,t)}}get background(){return this.Lt}set background(t){let e=this.Lt;e!==t&&(t!==null&&R.Md(t,"RowColumnDefinition.background"),t instanceof R&&t.k(),this.Lt=t,this.panel!==null&&this.panel.C(),this.t("background",e,t))}get coversSeparators(){return this.Bd}set coversSeparators(t){let e=this.Bd;e!==t&&(m.s(t,"boolean",Xt,"coversSeparators"),this.Bd=t,this.panel!==null&&this.panel.C(),this.t("coversSeparators",e,t))}get sizing(){return this.Ed}set sizing(t){let e=this.Ed;e!==t&&(this.Ed=t,this.panel!==null&&this.panel.f(),this.t("sizing",e,t))}j1(){if(this.sizing===1){let t=this.$s;return t===null?2:this.isRow?t.rowSizing:t.columnSizing}return this.sizing}get actual(){return this.q}set actual(t){isNaN(this.ki)?this.q=Math.max(Math.min(this.Gh,t),this.Xh):this.q=Math.max(Math.min(this.Gh,this.ki),this.Xh)}get measured(){return this.Re}set measured(t){this.Re=t}get total(){return this.q+this.computeEffectiveSpacing()}get position(){return this.ct}set position(t){this.ct=t}bind(t,e,i,s){return this.Pf(t,e,i,s),this}bindTwoWay(t,e,i,s){let n=this.Pf(t,e,i,s);return s===void 0&&n.makeTwoWay(),this}theme(t,e,i,s,n){return this.Ca(t,e,i,s,n),this}themeData(t,e,i,s,n){return this.Ca(t,e,i,s,n).ofData(),this}themeObject(t,e,i,s,n,o){return this.Ca(t,e,i,s,n).ofObject(o),this}themeModel(t,e,i,s,n){return this.Ca(t,e,i,s,n).ofModel(),this}Pf(t,e,i,s){let n;return typeof t=="string"?n=new te(t,e,i,s):n=t,this.w0(n),n}Ca(t,e,i,s,n){let o;return typeof t=="string"?o=new ii(t,e,i,s,n):o=t,this.w0(o),o}w0(t){t.Ti=this;let e=this.panel;if(e!==null){let i=e.findBindingPanel();i!==null&&i.rD()&&m.o("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+t+" on "+e)}this.Fs===null&&(this.Fs=new q),this.Fs.add(t)}}class et extends ${ut;tn;zd;Kh;Qe;Zo;jo;Kt;Xd;Gd;K;constructor(t,e){super(),this.ut=null,this.tn=null,this.zd="None",this.Kh="black",this.Qe="black",this.Zo=1,this.jo=null,this.Kt=null,this.Xd=NaN,this.Gd=NaN,this.K=null,typeof t=="string"?this.figure=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.ut=this.ut,t.tn=this.tn,t.zd=this.zd,t.Kh=this.Kh,t.Qe=this.Qe,t.Zo=this.Zo,this.jo!==null&&(t.jo=this.jo.slice()),this.Kt!==null&&(this.Kt.me?t.Kt=this.Kt:t.Kt=this.Kt.copy()),t.Xd=this.Xd,t.Gd=this.Gd,this.K!==null&&(t.K=this.K.copy())}Hh(){return this.Kt===null?this.Kt=new Ki:this.Kt.me&&(this.Kt=this.Kt.copy()),this.Kt}ba(){super.ba(),this.Kt!==null&&(this.Kt.me=!0)}fe(t){t in Ri?this.geometryStretch=t:super.fe(t)}toString(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+V.xs(this)}_I(t,e){let i=this.pathPattern;if(i===null)return;i.ht(1/0,1/0);let s=i.measuredBounds;i.Ut(0,0,s.width,s.height);let n=this.geometry;if(n===null)return;t.save(),t.beginPath();let o=m.nt();if(n.type===1)o.push(n.startX),o.push(n.startY),o.push(n.endX),o.push(n.endY),this.Yd(t,e,o,i);else if(n.type===4){let r=n.figures.iterator;for(;r.next();){let a=r.value;o.length=0,o.push(a.startX),o.push(a.startY);let h=a.startX,l=a.startY,u=h,c=l,d=a.segments.r,f=d.length;for(let p=0;p<f;p++){let g=d[p];switch(g.type){case 1:this.Yd(t,e,o,i),o.length=0,o.push(g.endX),o.push(g.endY),h=g.endX,l=g.endY,u=h,c=l;break;case 2:o.push(g.endX),o.push(g.endY),h=g.endX,l=g.endY;break;case 3:C.jn(h,l,g.point1X,g.point1Y,g.point2X,g.point2Y,g.endX,g.endY,.5,o),h=g.endX,l=g.endY;break;case 4:C.nm(h,l,g.point1X,g.point1Y,g.endX,g.endY,.5,o),h=g.endX,l=g.endY;break;case 5:{let y=g.vo(a),b=y.length;if(b===0){o.push(g.centerX),o.push(g.centerY),h=g.centerX,l=g.centerY;break}for(let v=0;v<b;v++){let w=y[v];C.jn(h,l,w[2],w[3],w[4],w[5],w[6],w[7],.5,o),h=w[6],l=w[7]}break}case 6:{let y=g.Za(a,h,l),b=y.length;if(b===0){o.push(g.endX),o.push(g.endY),h=g.endX,l=g.endY;break}for(let v=0;v<b;v++){let w=y[v];C.jn(h,l,w[2],w[3],w[4],w[5],w[6],w[7],.5,o),h=w[6],l=w[7]}break}default:m.o("Segment not of valid type: "+g.type)}g.isClosed&&(o.push(u),o.push(c),this.Yd(t,e,o,i))}this.Yd(t,e,o,i)}}else if(n.type===2)o.push(n.startX),o.push(n.startY),o.push(n.endX),o.push(n.startY),o.push(n.endX),o.push(n.endY),o.push(n.startX),o.push(n.endY),o.push(n.startX),o.push(n.startY),this.Yd(t,e,o,i);else if(n.type===3){let r=new Kt;r.startX=n.endX,r.startY=(n.startY+n.endY)/2;let a=new mt(5);a.startAngle=0,a.sweepAngle=360,a.centerX=(n.startX+n.endX)/2,a.centerY=(n.startY+n.endY)/2,a.radiusX=Math.abs(n.startX-n.endX)/2,a.radiusY=Math.abs(n.startY-n.endY)/2,r.add(a);let h=a.vo(r),l=h.length;if(l===0)o.push(a.centerX),o.push(a.centerY);else{let u=r.startX,c=r.startY;for(let d=0;d<l;d++){let f=h[d];C.jn(u,c,f[2],f[3],f[4],f[5],f[6],f[7],.5,o),u=f[6],c=f[7]}}this.Yd(t,e,o,i)}m.Z(o),t.restore(),t.clearContextCache(!1)}tE(t){let e=t.measuredBounds.width;return t instanceof et&&(e-=t.strokeWidth),e<1&&(e=1),e}Yd(t,e,i,s){let n=i.length;if(n<4)return;let o=s.measuredBounds,r=Math.max(1,o.width),a=o.height,h=i[0],l=i[1],u=0,c=0,d=0,f=0,p=0,g=0,y=0,b=0,v=m.nt();for(let A=2;A<n;A+=2)u=i[A],c=i[A+1],d=u-h,f=c-l,d===0&&(d=.001),p=f/d,g=Math.atan2(f,d),y=Math.sqrt(d*d+f*f),v.push([d,g,p,y]),b+=y,h=u,l=c;h=i[0],l=i[1];let w=this.tE(s),k=w,S=r/2,N=S!==0,D=0,L=v[D];d=L[0],g=L[1],p=L[2],y=L[3];let M=0;for(;b>=.1;){if(M===0&&(N?(k=w,k-=S,b-=S,N=!1):k=w,k===0&&(k=1)),k>b){k=b,m.Z(v);return}k>y?(M=k-y,k=y):M=0;let A=Math.sqrt(k*k/(1+p*p));if(d<0&&(A=-A),h+=A,l+=p*A,t.translate(h,l),t.rotate(g),t.translate(-(r/2),-(a/2)),M===0&&s.Ma(t,e),t.translate(r/2,a/2),t.rotate(-g),t.translate(-h,-l),b-=k,y-=k,M!==0){if(D++,D===v.length){m.Z(v);return}L=v[D],d=L[0],g=L[1],p=L[2],y=L[3],k=M}}m.Z(v)}Ma(t,e){let i=t instanceof re,s=this.Qe,n=this.Kh;if(s===null&&n===null)return;let o=this.ut;if(o===null)return;t.commitTransform();let r=this.actualBounds,a=this.naturalBounds;n!==null&&this.bn(t,n,!0,!1,a,r);let h=this.part,l=this.Zo;s!==null&&l===0&&h!==null&&(this.isPanelMain||h.findMainElement()===this)&&(l=h.eE()),l===0&&(s=null),s!==null&&l!==0&&(this.bn(t,s,!1,!1,a,r),t.lineWidth=l,t.lineJoin=this.strokeJoin,t.lineCap=this.strokeCap,t.miterLimit=this.strokeMiterLimit);let u=!1;h&&e.getRenderingHint("drawShadows")&&(u=h.isShadowed),t.ol===!1&&(u=!1);let c=!0;s!==null&&(n===null||n==="transparent")&&(c=!1);let d=!1,f=this.strokeDashArray;if(f!==null&&(d=!0,t.enableDash(f,this.strokeDashOffset)),o.type===1)t.beginPath(),t.moveTo(o.startX,o.startY),t.lineTo(o.endX,o.endY),s!==null&&t.strokeContext(),t.endPath();else if(o.type===2){let p=o.startX,g=o.startY,y=o.endX,b=o.endY,v=Math.min(p,y),w=Math.min(g,b),k=Math.abs(y-p),S=Math.abs(b-g);t.beginPath(),t.rect(v,w,k,S),n!==null&&t.fillContext(n,!1,null),s!==null&&(c&&u&&t.shadowsOff(),t.strokeContext(),c&&u&&t.shadowsOn()),t.endPath()}else if(o.type===3){let p=o.startX,g=o.startY,y=o.endX,b=o.endY,v=Math.abs(y-p)/2,w=Math.abs(b-g)/2,k=Math.min(p,y)+v,S=Math.min(g,b)+w;t.beginPath(),t.moveTo(k,S-w),t.bezierCurveTo(k+C.qn*v,S-w,k+v,S-C.qn*w,k+v,S),t.bezierCurveTo(k+v,S+C.qn*w,k+C.qn*v,S+w,k,S+w),t.bezierCurveTo(k-C.qn*v,S+w,k-v,S+C.qn*w,k-v,S),t.bezierCurveTo(k-v,S-C.qn*w,k-C.qn*v,S-w,k,S-w),t.closePath(),n!==null&&t.fillContext(n,!1,null),s!==null&&(c&&u&&t.shadowsOff(),t.strokeContext(),c&&u&&t.shadowsOn()),t.endPath()}else if(o.type===4){let p=o.figures,g=p.length;for(let y=0;y<g;y++){let b=p.r[y];i?(t.beginPath(),this.SD(t,b)):b.Hi===null&&(b.Hi=new Path2D,this.SD(b.Hi,b));let v=b.isFilled;u?b.isShadowed?(v===!0&&n!=="transparent"&&n!==null&&t.fillContext(n,b.isEvenOdd,b.Hi),s!==null&&(v&&c&&t.shadowsOff(),t.stroke(b.Hi),v&&c&&t.shadowsOn())):(t.shadowsOff(),v&&n!=="transparent"&&n!==null&&t.fillContext(n,b.isEvenOdd,b.Hi),s!==null&&t.stroke(b.Hi),t.shadowsOn()):(v&&n!==null&&t.fillContext(n,b.isEvenOdd,b.Hi),s!==null&&t.stroke(b.Hi)),t.endPath(y)}}d&&t.disableDash(),this._I(t,e)}SD(t,e){t.moveTo(e.startX,e.startY);let i=e.segments.r,s=i.length,n=null;for(let o=0;o<s;o++){let r=i[o];switch(r.type){case 1:t.moveTo(r.endX,r.endY);break;case 2:t.lineTo(r.endX,r.endY);break;case 3:t.bezierCurveTo(r.point1X,r.point1Y,r.point2X,r.point2Y,r.endX,r.endY);break;case 4:t.quadraticCurveTo(r.point1X,r.point1Y,r.endX,r.endY);break;case 5:if(r.radiusX===r.radiusY){let a=n!==null?n.endX:e.startX,h=n!==null?n.endY:e.startY,l=Math.PI/180;t.arc(r.point1X,r.point1Y,r.radiusX,r.startAngle*l,(r.startAngle+r.sweepAngle)*l,r.sweepAngle<0,a,h)}else{let a=r.vo(e),h=a.length;if(h===0){t.lineTo(r.centerX,r.centerY);break}for(let l=0;l<h;l++){let u=a[l];l===0&&t.lineTo(u[0],u[1]),t.bezierCurveTo(u[2],u[3],u[4],u[5],u[6],u[7])}}break;case 6:{let a=0,h=0,l;if(n!==null&&n.type===5){l=n.vo(e);let c=l.length;if(c===0){t.lineTo(r.endX,r.endY);break}let d=l[c-1]||null;d!==null&&(a=d[6],h=d[7])}else a=n!==null?n.endX:e.startX,h=n!==null?n.endY:e.startY;l=r.Za(e,a,h);let u=l.length;if(u===0){t.lineTo(r.endX,r.endY);break}for(let c=0;c<u;c++){let d=l[c];t.bezierCurveTo(d[2],d[3],d[4],d[5],d[6],d[7])}break}}r.isClosed&&t.closePath(),n=r}}yf(t,e,i){if(!super.yf(t,e,i)||this.Qe===null&&this.Kh===null||this.ut===null||this.pathPattern!==null)return!1;let s=this.svg.getElementsByTagName("path");return this.geometry.figures.length!==s.length?!1:(t.currentPath=this.svg,this.Ma(t,e),t.currentPath=null,!0)}Pd(t){return this.geometry!==null&&this.geometry.figures.length>1||this.pathPattern!==null?!0:super.Pd(t)}AN(t,e){if(t.nodeName!=="g")t.setAttributeNS(null,"filter",e);else{let i=t.getElementsByTagName("path");for(let s=0;s<i.length;s++)i[s].setAttributeNS(null,"filter",e)}}getDocumentPoint(t,e){if(e===void 0&&(e=new P),t instanceof T){let i=t;i.isNoSpot()&&m.o("getDocumentPoint Spot must be a real, specific Spot, not: "+i.toString());let s=this.naturalBounds,n=this.strokeWidth;return e.e(i.x*(s.width+n)-n/2+s.x+i.offsetX,i.y*(s.height+n)-n/2+s.y+i.offsetY),this.Ws.gt(e),e}else return e.set(t),this.Ws.gt(e),e}getDocumentBounds(t){t===void 0&&(t=new I);let e=this.naturalBounds,i=this.Ws,s=I.z(e.x,e.y,e.width,e.height),n=this.strokeWidth;s.inflate(n/2,n/2);let o=P.z(s.x,s.y).v(i);return t.e(o.x,o.y,0,0),o.e(s.right,s.y).v(i),t.re(o.x,o.y,0,0),o.e(s.right,s.bottom).v(i),t.re(o.x,o.y,0,0),o.e(s.x,s.bottom).v(i),t.re(o.x,o.y,0,0),I.i(s),P.i(o),t}ka(t,e){let i=this.geometry;if(i===null||this.fill===null&&this.stroke===null)return!1;let s=i.bounds,n=this.strokeWidth/2;i.type===1&&!e&&(n+=2);let o=I.l();if(o.h(s),o.inflate(n+2,n+2),!o.containsPoint(t))return I.i(o),!1;let r=n+1e-4;if(i.type===1){if(this.stroke===null)return!1;let a=(i.startX-i.endX)*(t.x-i.endX)+(i.startY-i.endY)*(t.y-i.endY),h=(i.endX-i.startX)*(t.x-i.startX)+(i.endY-i.startY)*(t.y-i.startY);return a<0||h<0?!1:(I.i(o),C.Ve(i.startX,i.startY,i.endX,i.endY,n,t.x,t.y))}else if(i.type===2){let a=i.startX,h=i.startY,l=i.endX,u=i.endY;if(o.x=Math.min(a,l),o.y=Math.min(h,u),o.width=Math.abs(l-a),o.height=Math.abs(u-h),this.fill===null){if(o.inflate(-r,-r),o.containsPoint(t))return I.i(o),!1;o.inflate(r,r)}this.stroke!==null&&o.inflate(n,n);let c=o.containsPoint(t);return I.i(o),c}else if(i.type===3){let a=i.startX,h=i.startY,l=i.endX,u=i.endY,c=Math.min(a,l),d=Math.min(h,u),f=Math.abs(l-a),p=Math.abs(u-h),g=f/2,y=p/2;if(c=t.x-(c+g),d=t.y-(d+y),this.fill===null){if(g-=r,y-=r,g<=0||y<=0||c*c/(g*g)+d*d/(y*y)<=1)return I.i(o),!1;g+=r,y+=r}return this.stroke!==null&&(g+=r,y+=r),I.i(o),g<=0||y<=0?!1:c*c/(g*g)+d*d/(y*y)<=1}else{if(i.type===4)return I.i(o),this.fill===null?i._L(t.x,t.y,n):i.VP(t,n,this.strokeWidth>1,e);m.o("Unknown Geometry type: "+i.type)}}bd(t,e,i,s){let n=this.desiredSize,o=this.Zo;t=Math.max(t,0),e=Math.max(e,0);let r;if(this.tn!==null)r=this.geometry.bounds;else{let p=this.figure,g=et.sC[p];if(g===void 0){let y=C.Wn[p];typeof y=="string"&&(y=C.Wn[y]),m.st(y)?(g=y(null,100,100),et.sC[p]=g):m.o("Unsupported Figure: "+p)}r=g.bounds}let a=r.width,h=r.height,l=r.width,u=r.height;switch(this.Zs(!0)){case 0:i=0,s=0;break;case 2:l=Math.max(t-o,0),u=Math.max(e-o,0);break;case 5:l=Math.max(t-o,0),s=0;break;case 4:i=0,u=Math.max(e-o,0);break}isFinite(n.width)&&(l=n.width),isFinite(n.height)&&(u=n.height);let c=this.maxSize,d=this.minSize;i=Math.max(i-o,d.width),s=Math.max(s-o,d.height),l=Math.min(c.width,l),u=Math.min(c.height,u),l=isFinite(l)?Math.max(i,l):Math.max(a,i),u=isFinite(u)?Math.max(s,u):Math.max(h,s);let f=this.tM();switch(f){case 0:break;case 2:a=l,h=u;break;case 6:{let p=Math.min(l/a,u/h);isFinite(p)||(p=1),a=a*p,h=h*p;break}default:m.o(f+" is not a valid geometryStretch.")}if(this.tn!==null){a===0&&(a=.001),h===0&&(h=.001);let p=this.tn.nR(a,h);this.ut=p}else(this.ut===null||!C.X(this.ut.Pc,t-o)||!C.X(this.ut.Sc,e-o))&&(this.ut=et.iE(this,a,h));r=this.ut.bounds,t===1/0||e===1/0?this.ro(r.x-o/2,r.y-o/2,t===0&&a===0?0:r.width+o,e===0&&h===0?0:r.height+o):this.ro(-(o/2),-(o/2),l+o,u+o),n.isReal()?(l=n.width,u=n.height,l=Math.min(c.width,l),u=Math.min(c.height,u),l=Math.max(d.width,l),u=Math.max(d.height,u),this.Ke.e(0,0,l,u)):this.Ke.h(r)}tM(){let t=this.geometryStretch;return this.tn!==null?t===1?2:t:t===1?et.sC[this.figure].defaultStretch:t}Pa(t,e,i,s){this.commonArrange(t,e,i,s)}getNearestIntersectionPoint(t,e,i){return this.mf(t.x,t.y,e.x,e.y,i)}mf(t,e,i,s,n){let o=this.v,r=1/(o.m11*o.m22-o.m12*o.m21),a=o.m22*r,h=-o.m12*r,l=-o.m21*r,u=o.m11*r,c=r*(o.m21*o.dy-o.m22*o.dx),d=r*(o.m12*o.dx-o.m11*o.dy),f=t*a+e*l+c,p=t*h+e*u+d,g=i*a+s*l+c,y=i*h+s*u+d,b=this.Zo/2,v=this.ut;v===null&&(this.ht(1/0,1/0),v=this.ut);let w=v.bounds,k=!1;if(v.type===1)if(this.strokeWidth<=1.5)k=C.Do(v.startX,v.startY,v.endX,v.endY,f,p,g,y,n);else{let S=0,N=0;if(v.startX===v.endX)S=b,N=0;else{let F=(v.endY-v.startY)/(v.endX-v.startX);N=b/Math.sqrt(1+F*F),S=N*F}let D=m.nt(),L=new P;C.Do(v.startX+S,v.startY+N,v.endX+S,v.endY+N,f,p,g,y,L)&&D.push(L),L=new P,C.Do(v.startX-S,v.startY-N,v.endX-S,v.endY-N,f,p,g,y,L)&&D.push(L),L=new P,C.Do(v.startX+S,v.startY+N,v.startX-S,v.startY-N,f,p,g,y,L)&&D.push(L),L=new P,C.Do(v.endX+S,v.endY+N,v.endX-S,v.endY-N,f,p,g,y,L)&&D.push(L);let M=D.length;if(M===0)return m.Z(D),!1;k=!0;let A=1/0;for(let F=0;F<M;F++){let O=D[F],E=(O.x-f)**2+(O.y-p)**2;E<A&&(A=E,n.x=O.x,n.y=O.y)}m.Z(D)}else if(v.type===2)k=C.Cl(w.x-b,w.y-b,w.x+w.width+b,w.y+w.height+b,f,p,g,y,n);else if(v.type===3){let S=I.z(w.x,w.y,w.width,w.height).inflate(b,b);k=this.sE(S,f,p,g,y,n),I.i(S)}else if(v.type===4){let S=0,N=0,D=0,L=0,M=P.l(),A=g-f,F=y-p,O=A*A+F*F,E=f,B=p;if(O>0&&w.contains(E,B)&&(M.x=E,M.y=B,this.containsPoint(M)))for(A!==0&&Math.abs(A)<.5?(F*=.5/A,A=.5):F!==0&&Math.abs(F)<.5&&(A*=.5/F,F=.5),E-=A,B-=F;w.contains(E,B);)E-=A,B-=F;let K=.6;n.x=g,n.y=y;for(let nt=0;nt<v.figures.count;nt++){let Z=v.figures.r[nt],it=Z.isFilled?E:f,_=Z.isFilled?B:p,at=Z.segments;S=Z.startX,N=Z.startY;let ct=S,xt=N;for(let Ct=0;Ct<at.count;Ct++){let Q=at.r[Ct],Pt=Q.type;D=Q.endX,L=Q.endY;let bt=!1;switch(Pt){case 1:ct=D,xt=L;break;case 2:bt=this._1(S,N,D,L,it,_,g,y,M);break;case 3:{bt=C.om(S,N,Q.point1X,Q.point1Y,Q.point2X,Q.point2Y,D,L,it,_,g,y,K,M);break}case 4:{bt=C.om(S,N,S+2/3*(Q.point1X-S),N+2/3*(Q.point1Y-N),D+2/3*(Q.point1X-D),L+2/3*(Q.point1Y-L),D,L,it,_,g,y,K,M);break}case 5:case 6:{let Yt=Q.type===5?Q.vo(Z):Q.Za(Z,S,N),ot=Yt.length;if(ot===0){bt=this._1(S,N,Q.type===5?Q.centerX:Q.endX,Q.type===5?Q.centerY:Q.endY,it,_,g,y,M);break}let W=null;for(let ft=0;ft<ot;ft++){if(W=Yt[ft],ft===0&&this._1(S,N,W[0],W[1],it,_,g,y,M)){let At=this.tk(it,_,M,O,n);At<O&&(O=At,k=!0)}if(C.om(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],it,_,g,y,K,M)){let At=this.tk(it,_,M,O,n);At<O&&(O=At,k=!0)}}D=W[6],L=W[7];break}default:m.o("Unknown Segment type: "+Pt)}if(S=D,N=L,bt){let Yt=this.tk(it,_,M,O,n);Yt<O&&(O=Yt,k=!0)}if(Q.isClosed&&(D=ct,L=xt,this._1(S,N,D,L,it,_,g,y,M))){let Yt=this.tk(it,_,M,O,n);Yt<O&&(O=Yt,k=!0)}}}let z=i-t,U=s-e,tt=Math.sqrt(z*z+U*U);tt!==0&&(z/=tt,U/=tt),n.x-=z*b,n.y-=U*b,P.i(M)}else m.o("Unknown Geometry type: "+v.type);return k?(this.v.gt(n),!0):!1}tk(t,e,i,s,n){let o=i.x-t,r=i.y-e,a=o*o+r*r;return a<s?(n.x=i.x,n.y=i.y,a):s}_1(t,e,i,s,n,o,r,a,h){if(C.X(t,i)&&C.X(e,s)||C.X(n,r)&&C.X(o,a))return!1;let l=!1,u=(n-r)*(e-s)-(o-a)*(t-i);if(u===0)return!1;if(h.x=((n*a-o*r)*(t-i)-(n-r)*(t*s-e*i))/u,h.y=((n*a-o*r)*(e-s)-(o-a)*(t*s-e*i))/u,(t>i?t-i:i-t)<(e>s?e-s:s-e)){let c=e<s?e:s,d=e<s?s:e;(h.y>c||C.X(h.y,c))&&(h.y<d||C.X(h.y,d))&&(l=!0)}else{let c=t<i?t:i,d=t<i?i:t;(h.x>c||C.X(h.x,c))&&(h.x<d||C.X(h.x,d))&&(l=!0)}return l}nE(t,e,i){return this.pickable===!1?!1:(i.bc(this.v),e?this.oE(t,i):this.containedInRect(t,i))}containedInRect(t,e){if(e===void 0)return t.containsRect(this.actualBounds);let i=this.ut;i===null&&(this.ht(1/0,1/0),i=this.ut);let s=i.bounds,n=this.strokeWidth/2,o=!1,r=P.l();return r.e(s.x-n,s.y-n),t.containsPoint(e.gt(r))&&(r.e(s.x-n,s.bottom+n),t.containsPoint(e.gt(r))&&(r.e(s.right+n,s.bottom+n),t.containsPoint(e.gt(r))&&(r.e(s.right+n,s.y-n),t.containsPoint(e.gt(r))&&(o=!0)))),P.i(r),o}intersectsRect(t,e){if(this.containedInRect(t,e)||e===void 0&&(e=this.v,t.containsRect(this.actualBounds)))return!0;let i=Nt.l();i.set(e),i.ex();let s=t.left,n=t.right,o=t.top,r=t.bottom,a=P.l();if(a.e(s,o),i.gt(a),this.ka(a,!0)||(a.e(n,o),i.gt(a),this.ka(a,!0))||(a.e(s,r),i.gt(a),this.ka(a,!0))||(a.e(n,r),i.gt(a),this.ka(a,!0)))return P.i(a),!0;let h=P.l(),l=P.l();i.set(e),i.GL(this.v),i.ex(),h.x=n,h.y=o,h.v(i),a.x=s,a.y=o,a.v(i);let u=!1;return this.qh(a,h,l)?u=!0:(a.x=n,a.y=r,a.v(i),this.qh(a,h,l)?u=!0:(h.x=s,h.y=r,h.v(i),this.qh(a,h,l)?u=!0:(a.x=s,a.y=o,a.v(i),this.qh(a,h,l)&&(u=!0)))),P.i(a),Nt.i(i),P.i(h),P.i(l),u}qh(t,e,i){if(!this.getNearestIntersectionPoint(t,e,i))return!1;let s=t.x,n=t.y,o=e.x,r=e.y,a=i.x,h=i.y;if(s===o){let l=0,u=0;return n<r?(l=n,u=r):(l=r,u=n),h>=l&&h<=u}else{let l=0,u=0;return s<o?(l=s,u=o):(l=o,u=s),a>=l&&a<=u}}oE(t,e){if(this.containedInRect(t,e)||e===void 0&&(e=this.v,t.containsRect(this.actualBounds)))return!0;let i=t.left,s=t.right,n=t.top,o=t.bottom,r=P.l(),a=P.l(),h=P.l(),l=Nt.l();l.set(e),l.GL(this.v),l.ex(),a.x=s,a.y=n,a.v(l),r.x=i,r.y=n,r.v(l);let u=!1;return this.qh(r,a,h)?u=!0:(r.x=s,r.y=o,r.v(l),this.qh(r,a,h)?u=!0:(a.x=i,a.y=o,a.v(l),this.qh(r,a,h)?u=!0:(r.x=i,r.y=n,r.v(l),this.qh(r,a,h)&&(u=!0)))),Nt.i(l),P.i(r),P.i(a),P.i(h),u}QT(t,e,i){if(i&&this.fill!==null&&this.ka(t,!0))return!0;let s=t.distanceSquaredPoint(e),n=s;this.strokeWidth>1.5&&(s=this.strokeWidth/2+Math.sqrt(s),s*=s);let o=this.ut;if(o===null&&(this.ht(1/0,1/0),o=this.ut,o===null))return!1;if(!i){let c=o.bounds,d=c.x,f=c.y,p=c.x+c.width,g=c.y+c.height;if(P.distanceSquared(t.x,t.y,d,f)<=s&&P.distanceSquared(t.x,t.y,p,f)<=s&&P.distanceSquared(t.x,t.y,d,g)<=s&&P.distanceSquared(t.x,t.y,p,g)<=s)return!0}function r(c,d){let f=c.length;for(let p=0;p<f;p+=2)if(d.distanceSquared(c[p],c[p+1])>s)return!0;return!1}let a=o.startX,h=o.startY,l=o.endX,u=o.endY;if(o.type===1){let c=P.distanceLineSegmentSquared(t.x,t.y,a,h,l,u),d=(l-a)*(t.x-a)+(u-h)*(t.y-h),f=(a-l)*(t.x-l)+(h-u)*(t.y-u),p=d>=0&&f>=0?s:n;return c<=p}else if(o.type===2){let c=!1;return i&&(c=P.distanceLineSegmentSquared(t.x,t.y,a,h,a,u)<=s||P.distanceLineSegmentSquared(t.x,t.y,a,h,l,h)<=s||P.distanceLineSegmentSquared(t.x,t.y,l,h,l,u)<=s||P.distanceLineSegmentSquared(t.x,t.y,a,u,l,u)<=s),c}else if(o.type===3){let c=(a+l)/2,d=(h+u)/2,f=t.x-c,p=t.y-d,g=Math.abs(l-a)/2,y=Math.abs(u-h)/2;if(g===0||y===0)return P.distanceLineSegmentSquared(t.x,t.y,a,h,l,u)<=s;if(i){let b=C.JF(g,y,f,p);return b*b<=s}else return!(P.distanceSquared(f,p,-g,0)>=s||P.distanceSquared(f,p,0,-y)>=s||P.distanceSquared(f,p,0,y)>=s||P.distanceSquared(f,p,g,0)>=s)}else if(o.type===4){let c=o.bounds,d=c.x,f=c.y,p=c.x+c.width,g=c.y+c.height;if(t.x>p&&t.x<d&&t.y>g&&t.y<f&&P.distanceLineSegmentSquared(t.x,t.y,d,f,d,g)>s&&P.distanceLineSegmentSquared(t.x,t.y,d,f,p,f)>s&&P.distanceLineSegmentSquared(t.x,t.y,p,g,d,g)>s&&P.distanceLineSegmentSquared(t.x,t.y,p,g,p,f)>s)return!1;let y=Math.sqrt(s);if(i){if(this.fill===null?o._L(t.x,t.y,y):o.VP(t,y,!0,!1))return!0}else{let b=o.figures;for(let v=0;v<b.count;v++){let w=b.r[v],k=w.startX,S=w.startY;if(t.distanceSquared(k,S)>s)return!1;let N=w.segments.r,D=N.length;for(let L=0;L<D;L++){let M=N[L];switch(M.type){case 1:case 2:if(k=M.endX,S=M.endY,t.distanceSquared(k,S)>s)return!1;break;case 3:{let A=m.nt();C.jn(k,S,M.point1X,M.point1Y,M.point2X,M.point2Y,M.endX,M.endY,.8,A);let F=r(A,t);if(m.Z(A),F||(k=M.endX,S=M.endY,t.distanceSquared(k,S)>s))return!1;break}case 4:{let A=m.nt();C.nm(k,S,M.point1X,M.point1Y,M.endX,M.endY,.8,A);let F=r(A,t);if(m.Z(A),F||(k=M.endX,S=M.endY,t.distanceSquared(k,S)>s))return!1;break}case 5:case 6:{let A=M.type===5?M.vo(w):M.Za(w,k,S),F=A.length;if(F===0){if(k=M.type===5?M.centerX:M.endX,S=M.type===5?M.centerY:M.endY,t.distanceSquared(k,S)>s)return!1;break}let O=null,E=m.nt();for(let B=0;B<F;B++)if(O=A[B],E.length=0,C.jn(O[0],O[1],O[2],O[3],O[4],O[5],O[6],O[7],.8,E),r(E,t))return m.Z(E),!1;m.Z(E),O!==null&&(k=O[6],S=O[7]);break}default:m.o("Unknown Segment type: "+M.type)}}}return!0}}return!1}sE(t,e,i,s,n,o){if(t.width===0)return C.Do(t.x,t.y,t.x,t.y+t.height,e,i,s,n,o);if(t.height===0)return C.Do(t.x,t.y,t.x+t.width,t.y,e,i,s,n,o);{let r=t.width/2,a=t.height/2,h=t.x+r,l=t.y+a,u=9999;if(e!==s&&(u=(i-n)/(e-s)),Math.abs(u)<9999){let c=i-l-u*(e-h);if(r*r*(u*u)+a*a-c*c<0)return o.x=NaN,o.y=NaN,!1;let d=Math.sqrt(r*r*(u*u)+a*a-c*c),f=(-(r*r*u*c)+r*a*d)/(a*a+r*r*(u*u))+h,p=(-(r*r*u*c)-r*a*d)/(a*a+r*r*(u*u))+h,g=u*(f-h)+c+l,y=u*(p-h)+c+l,b=Math.abs((e-f)**2)+Math.abs((i-g)**2),v=Math.abs((e-p)**2)+Math.abs((i-y)**2);b<v?(o.x=f,o.y=g):(o.x=p,o.y=y)}else{let c=a*a,d=r*r,f=e-h,p=c-c/d*(f*f);if(p<0)return o.x=NaN,o.y=NaN,!1;let g=Math.sqrt(p),y=l+g,b=l-g,v=Math.abs(y-i),w=Math.abs(b-i);v<w?(o.x=e,o.y=y):(o.x=e,o.y=b)}return!0}}jI(){return this.Zo/2*this.strokeMiterLimit*this.getDocumentScale()}get geometry(){return this.ut!==null?this.ut:this.tn}set geometry(t){let e=this.ut,i=this.tn;if(e===t)return;t!==null?(this.ut=t.k(),this.tn=this.ut):(this.ut=null,this.tn=null);let s=this.part;if(s!==null&&s.Tf(),this.f(),this.t("geometry",e||i,t),this.gf()){let n=this.part;n!==null&&this.Eh(n,"geometryString")}}get geometryString(){return this.geometry===null?"":this.geometry.toString()}set geometryString(t){let e=wt.parse(t),i=e.normalize();this.geometry=e;let s=P.z(-i.x,-i.y);this.position=s,P.i(s)}get isGeometryPositioned(){return(this.n&1048576)!==0}set isGeometryPositioned(t){let e=(this.n&1048576)!==0;e!==t&&(this.n=this.n^1048576,this.f(),this.t("isGeometryPositioned",e,t))}ai(){this.ut=null}get fill(){return this.Kh}set fill(t){let e=this.Kh;e!==t&&(t!==null&&R.Md(t,"Shape.fill"),t instanceof R&&t.k(),this.Kh=t,this.C(),this.t("fill",e,t))}get stroke(){return this.Qe}set stroke(t){let e=this.Qe;e!==t&&(t!==null&&R.Md(t,"Shape.stroke"),t instanceof R&&t.k(),this.Qe=t,this.C(),this.t("stroke",e,t))}get strokeWidth(){return this.Zo}set strokeWidth(t){let e=this.Zo;if(e!==t)if(t>=0){this.Zo=t,this.f();let i=this.part;i!==null&&i.Tf(),this.t("strokeWidth",e,t)}else m.J(t,"value >= 0",et,"strokeWidth:value")}qp(){return this.Zo}get strokeCap(){return this.Kt!==null?this.Kt.Y0:"butt"}set strokeCap(t){let e=this.strokeCap;e!==t&&(typeof t=="string"&&(t==="butt"||t==="round"||t==="square")?(this.Hh().Y0=t,this.C(),this.t("strokeCap",e,t)):m.J(t,'"butt", "round", or "square"',et,"strokeCap"))}get strokeJoin(){return this.Kt!==null?this.Kt.K0:"miter"}set strokeJoin(t){let e=this.strokeJoin;e!==t&&(typeof t=="string"&&(t==="miter"||t==="bevel"||t==="round")?(this.Hh().K0=t,this.C(),this.t("strokeJoin",e,t)):m.J(t,'"miter", "bevel", or "round"',et,"strokeJoin"))}get strokeMiterLimit(){return this.Kt!==null?this.Kt.H0:10}set strokeMiterLimit(t){let e=this.strokeMiterLimit;if(e!==t&&t>=1){this.Hh().H0=t,this.C();let i=this.part;i!==null&&i.Tf(),this.t("strokeMiterLimit",e,t)}}get strokeDashArray(){return this.jo}set strokeDashArray(t){let e=this.jo;if(e!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",et,"strokeDashArray:value"),t!==null){let i=t.length,s=0;for(let n=0;n<i;n++){let o=t[n];(!(o>=0)||!isFinite(o))&&m.o("strokeDashArray:value "+o+" at index "+n+" must be a positive number or zero."),s+=o}if(s===0){if(e===null)return;t=null}}this.jo=t,this.C(),this.t("strokeDashArray",e,t)}}get strokeDashOffset(){return this.Kt!==null?this.Kt.La:0}set strokeDashOffset(t){let e=this.strokeDashOffset;e!==t&&t>=0&&(this.Hh().La=t,this.C(),this.t("strokeDashOffset",e,t))}get figure(){return this.zd}set figure(t){let e=this.zd;if(e!==t){let i=C.Wn[t];if(m.st(i)?i=t:(i=C.Wn[t.toLowerCase()],(!i||typeof i=="function")&&m.o("Unknown Shape.figure: "+t)),e!==i){let s=this.part;s!==null&&s.Tf(),this.zd=i,this.tn=null,this.ai(),this.f(),this.t("figure",e,i)}}}get toArrow(){return this.Ot!==null?this.Ot.q0:"None"}set toArrow(t){let e=this.toArrow;if(t===!0?t="Standard":t===!1&&(t=""),e!==t){let i=et.MD(t);i===null?m.o("Unknown Shape.toArrow: "+t):e!==i&&(this.Ot===null&&(this.Ot=new Re),this.Ot.q0=i,this.tn=null,this.ai(),this.f(),this.ND(i),this.t("toArrow",e,i))}}get fromArrow(){return this.Ot!==null?this.Ot.j0:"None"}set fromArrow(t){let e=this.fromArrow;if(t===!0?t="Standard":t===!1&&(t=""),e!==t){let i=et.MD(t);i===null?m.o("Unknown Shape.fromArrow: "+t):e!==i&&(this.Ot===null&&(this.Ot=new Re),this.Ot.j0=i,this.tn=null,this.ai(),this.f(),this.ND(i),this.t("fromArrow",e,i))}}ND(t){let e=this.diagram;e!==null&&e.undoManager.isUndoingRedoing||(this.pI(),this.toArrow!=="None"?(this.segmentIndex=-1,this.alignmentFocus=T.Right):this.fromArrow!=="None"&&(this.segmentIndex=0,this.alignmentFocus=T.Left))}get spot1(){return this.Kt!==null?this.Kt.Jn:T.Default}set spot1(t){let e=this.spot1;e.equals(t)||(t=t.N(),this.Hh().Jn=t,this.f(),this.t("spot1",e,t))}get spot2(){return this.Kt!==null?this.Kt.$n:T.Default}set spot2(t){let e=this.spot2;e.equals(t)||(t=t.N(),this.Hh().$n=t,this.f(),this.t("spot2",e,t))}get parameter1(){return this.Xd}set parameter1(t){let e=this.Xd;e!==t&&(this.Xd=t,this.ai(),this.f(),this.t("parameter1",e,t))}get parameter2(){return this.Gd}set parameter2(t){let e=this.Gd;e!==t&&(this.Gd=t,this.ai(),this.f(),this.t("parameter2",e,t))}get naturalBounds(){return this.Ke}UI(){let t=this.desiredSize;if(!t.isReal()&&this.ut!==null){let e=this.ut.bounds;this.Ke.h(e)}else this.Ke.e(0,0,t.width,t.height)}get pathPattern(){return this.Kt!==null?this.Kt.W0:null}set pathPattern(t){let e=this.pathPattern;e!==t&&(this.Hh().W0=t,this.C(),this.t("pathPattern",e,t))}get geometryStretch(){return this.Kt!==null?this.Kt.J0:1}set geometryStretch(t){let e=this.geometryStretch;e!==t&&(this.Hh().J0=t,this.f(),this.t("geometryStretch",e,t))}get interval(){return this.K!==null?this.K.vf:1}set interval(t){let e=this.interval;if(t=Math.round(t),e!==t&&t!==0&&isFinite(t)){this.K===null&&(this.K=new xe),this.K.vf=t;let i=this.diagram;i!==null&&this.panel===i.grid&&i.ca(),this.f();let s=this.panel;s!==null&&(s.ds=null),this.t("interval",e,t)}}get graduatedStart(){return this.K!==null?this.K.Ff:0}set graduatedStart(t){let e=this.graduatedStart;e!==t&&(t<0?t=0:t>1&&(t=1),this.K===null&&(this.K=new xe),this.K.Ff=t,this.f(),this.t("graduatedStart",e,t))}get graduatedEnd(){return this.K!==null?this.K.Rf:1}set graduatedEnd(t){let e=this.graduatedEnd;e!==t&&(t<0?t=0:t>1&&(t=1),this.K===null&&(this.K=new xe),this.K.Rf=t,this.f(),this.t("graduatedEnd",e,t))}get graduatedSkip(){return this.K!==null?this.K.Of:null}set graduatedSkip(t){let e=this.graduatedSkip;e!==t&&(t!==null&&m.S(t,et,"graduatedSkip"),this.K===null&&(this.K=new xe),this.K.Of=t,this.f(),this.t("graduatedSkip",e,t))}polygonContainsRect(t){let e=this;if(!e.part||!e.part.actualBounds.containsRect(t))return!1;let i=e.geometry;if(!i)return!1;let s=t.x,n=t.y,o=t.width,r=t.height,a=P.l();if(a.x=s,a.y=n,e.getLocalPoint(a,a),!i.containsPoint(a)||o>0&&r>0&&(a.x=s+o,a.y=n+r,e.getLocalPoint(a,a),!i.containsPoint(a))||o>0&&(a.x=s+o,a.y=n,e.getLocalPoint(a,a),!i.containsPoint(a))||r>0&&(a.x=s,a.y=n+r,e.getLocalPoint(a,a),!i.containsPoint(a))||i.type===1)return!1;if(i.type===4){let h=i.figures.iterator;for(;h.next();){let l=h.value;if(!l.isFilled)continue;a.x=l.startX,a.y=l.startY,e.getDocumentPoint(a,a);let u=a.x,c=a.y,d=u,f=c,p=u,g=c,y=l.segments.iterator;for(;y.next();){let b=y.value;if(a.x=b.endX,a.y=b.endY,e.getDocumentPoint(a,a),p=a.x,g=a.y,b.type===1)u=p,c=g;else if(b.type!==5&&(I.intersectsLineSegment(s,n,o,r,d,f,p,g)||b.isClosed&&I.intersectsLineSegment(s,n,o,r,p,g,u,c)))return!1;d=p,f=g}}}return P.i(a),!0}static iE(t,e,i){let s=null;if(t.toArrow!=="None")s=et.Tn[t.toArrow];else if(t.fromArrow!=="None")s=et.Tn[t.fromArrow];else{let n=C.Wn[t.figure];typeof n=="string"&&(n=C.Wn[n]),n===void 0&&m.o("Unknown Shape.figure: "+t.figure),s=n(t,e,i),s.Pc=e,s.Sc=i}if(s===null){let n=C.Wn.Rectangle;m.st(n)&&(s=n(t,e,i))}return s}static getFigureGenerators(){let t=new Mt;for(let e in C.Wn){if(e===e.toLowerCase())continue;let i=C.Wn[e];t.set(e,i)}return t.k(),t}static defineFigureGenerator(t,e){m.s(t,"string",et,"defineFigureGenerator:name"),typeof e=="string"||m.S(e,et,"defineFigureGenerator:func");let i=t.toLowerCase(),s=C.Wn;s[t]=e,s[i]=t}static isFigureDefined(t){return t in C.Wn}static getArrowheadGeometries(){let t=new Mt;for(let e in C.lm)if(et.Tn[e]===void 0){let i=wt.parse(C.lm[e],!1);et.Tn[e]=i;let s=e.toLowerCase();s!==e&&(et.Tn[s]=e)}for(let e in et.Tn){if(e===e.toLowerCase())continue;let i=et.Tn[e];i instanceof wt&&t.set(e,i)}return t.k(),t}static defineArrowheadGeometry(t,e){m.s(t,"string",et,"defineArrowheadGeometry:name");let i=null;typeof e=="string"?(m.s(e,"string",et,"defineArrowheadGeometry:pathstr"),i=wt.parse(e,!1)):i=e;let s=t.toLowerCase();(s==="none"||t===s)&&m.o("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t);let n=et.Tn;n[t]=i,n[s]=t}static isArrowheadDefined(t){return et.Tn.has(t)}static Tn=new yt;static sC=new yt;static MD(t){let e=et.Tn[t];if(e===void 0){let i=t.toLowerCase();if(i==="none")return"None";if(e=et.Tn[i],e===void 0){let s=null;for(let n in C.lm)if(n.toLowerCase()===i){s=n;break}if(s!==null){let n=wt.parse(C.lm[s],!1);return et.Tn[s]=n,i!==s&&(et.Tn[i]=s),s}}}return typeof e=="string"?e:e instanceof wt?t:null}}class Ki{me;Y0;K0;H0;La;W0;J0;Jn;$n;constructor(){this.me=!1,this.Y0="butt",this.K0="miter",this.H0=10,this.La=0,this.W0=null,this.J0=1,this.Jn=T.Default,this.$n=T.Default}copy(){let t=new Ki;return t.Y0=this.Y0,t.K0=this.K0,t.H0=this.H0,t.La=this.La,t.W0=this.W0,t.J0=this.J0,t.Jn=this.Jn.N(),t.$n=this.$n.N(),t}}var Xi=(x=>(x[x.None=0]="None",x[x.Fit=1]="Fit",x[x.DesiredSize=2]="DesiredSize",x[x.BreakAll=3]="BreakAll",x))(Xi||{}),js=(x=>(x[x.Clip=0]="Clip",x[x.Ellipsis=1]="Ellipsis",x))(js||{}),Yi=(x=>(x[x.Trim=0]="Trim",x[x.None=1]="None",x))(Yi||{});class lt extends ${ue;Qe;Dn;Pi;pe;jp;Kd;K;tt;Xl;uo;vn;Ii;ye;Fn;constructor(t,e){return super(),lt.M0===!1&&(lt.M0=!0,lt.us=Y.isUsingDOM()?new Fe(null)._t:null),this.n|=2097152,this.ue="",this.Qe="black",this.Dn="13px sans-serif",this.Pi=0,this.pe=0,this.jp=0,this.Kd=null,this.K=null,this.tt=null,this.Xl=0,this.uo=null,this.vn=0,this.Ii=null,this.ye=null,this.Fn=null,typeof t=="string"?this.text=t:t&&Object.assign(this,t),e&&Object.assign(this,e),this}cloneProtected(t){super.cloneProtected(t),t.ue=this.ue,t.Qe=this.Qe,t.Dn=this.Dn,t.Pi=this.Pi,t.pe=this.pe,t.jp=this.jp,t.Kd=this.Kd,this.K!==null&&(t.K=this.K.copy()),this.tt!==null&&(this.tt.me?t.tt=this.tt:t.tt=this.tt.copy()),t.Xl=this.Xl,t.uo=this.uo,t.vn=this.vn,t.Ii=this.Ii,t.ye=this.ye,t.Fn=this.Fn}Rs(){return this.tt===null?this.tt=new Ui:this.tt.me&&(this.tt=this.tt.copy()),this.tt}ba(){super.ba(),this.tt!==null&&(this.tt.me=!0)}KI(t){this.n=t.n|2048|4096,this.Zt=t.opacity,this.Lt=t.background,this.cs=t.desiredSize.N(),this.minSize=t.minSize.N(),this.maxSize=t.maxSize.N(),t.Se!==null?this.Se=t.Se.copy():this.Se=null,this.it=t.scale,this.Xt=t.angle,this.stretch=t.stretch,this.il=t.margin.N(),this.de=t.alignment.N(),this.wd=t.alignmentFocus.N(),this.segmentFraction=t.segmentFraction,this.segmentOffset=t.segmentOffset.N(),this.segmentOrientation=t.segmentOrientation,t.he!==null&&(this.he=t.he.copy()),this.shadowVisible=t.shadowVisible,this.ue=t.ue,this.Qe=t.Qe,this.Dn=t.Dn,this.K!==null&&(this.K=t.K.copy()),t.tt!==null&&(t.tt.me?this.tt=t.tt:this.tt=t.tt.copy()),this.Xl=t.Xl}GI(t){if(this.ue=t.text||"",this.Xt=t.labelAngle||0,this.Pi=t.lineCount||0,this.rE(t.lines),t.naturalBounds&&(this.Ke=t.naturalBounds),t.actualBounds){let e=t.actualBounds;this.Ut(e.x,e.y,e.width,e.height)}}fe(t){t in Xi?this.wrap=t:super.fe(t)}toString(){return this.ue.length>22?'TextBlock("'+this.ue.substring(0,20)+'"...)':'TextBlock("'+this.ue+'")'}static getEllipsis(){return lt.$0}static setEllipsis(t){lt.$0=t,lt.ek=new yt,lt.nC=0}static getBaseline(){return lt.ik}static setBaseline(t){lt.ik=t}static ik=null;static getUnderline(){return lt.sk}static setUnderline(t){lt.sk=t}static sk=null;static None=0;static WrapFit=1;static WrapDesiredSize=2;static WrapBreakAll=3;static OverflowClip=0;static OverflowEllipsis=1;static FormatTrim=0;static FormatNone=1;f(){super.f(),this.Ji(!0)}get font(){return this.Dn}set font(t){let e=this.Dn;e!==t&&(this.Dn=t,this.uo=null,this.f(),this.t("font",e,t))}static isValidFont(t){return X.CSS?X.CSS.supports("font",t):!0}get text(){return this.ue}set text(t){let e=this.ue;t!=null?t=t.toString():t="",e!==t&&(this.ue=t,this.f(),this.t("text",e,t))}get textAlign(){return this.tt!==null?this.tt.Z0:"start"}set textAlign(t){let e=this.textAlign;e!==t&&(t==="start"||t==="end"||t==="left"||t==="right"||t==="center")&&(this.Rs().Z0=t,this.C(),this.t("textAlign",e,t))}get flip(){return this.tt!==null?this.tt.go:0}set flip(t){let e=this.flip;e!==t&&(this.Rs().go=t,this.C(),this.t("flip",e,t))}get verticalAlignment(){return this.tt!==null?this.tt.al:T.Top}set verticalAlignment(t){let e=this.verticalAlignment;e.equals(t)||(t=t.N(),this.Rs().al=t,this.kf(),this.t("verticalAlignment",e,t))}get naturalBounds(){if(!this.Ke.isReal()){let t=st.l();this.oC(this.ue,999999,t);let e=t.width;st.i(t);let i=this.CD(e),s=this.desiredSize;isNaN(s.width)||(e=s.width),isNaN(s.height)||(i=s.height),this.Ke.Hn(e,i)}return this.Ke}get isMultiline(){return(this.n&2097152)!==0}set isMultiline(t){let e=(this.n&2097152)!==0;e!==t&&(this.n=this.n^2097152,this.f(),this.t("isMultiline",e,t))}get isUnderline(){return(this.n&4194304)!==0}set isUnderline(t){let e=(this.n&4194304)!==0;e!==t&&(this.n=this.n^4194304,this.Ji(!0),this.C(),this.t("isUnderline",e,t))}get isStrikethrough(){return(this.n&8388608)!==0}set isStrikethrough(t){let e=(this.n&8388608)!==0;e!==t&&(this.n=this.n^8388608,this.Ji(!0),this.C(),this.t("isStrikethrough",e,t))}get wrap(){return this.tt!==null?this.tt.Q0:2}set wrap(t){let e=this.wrap;e!==t&&(this.Rs().Q0=t,this.f(),this.t("wrap",e,t))}get overflow(){return this.tt!==null?this.tt._0:0}set overflow(t){let e=this.overflow;e!==t&&(this.Rs()._0=t,this.f(),this.t("overflow",e,t))}get isOverflowed(){return(this.n&16777216)!==0}rC(t){t?this.n|=16777216:this.n&=-16777217}get stroke(){return this.Qe}set stroke(t){let e=this.Qe;e!==t&&(t!==null&&R.Md(t,"TextBlock.stroke"),t instanceof R&&t.k(),this.Qe=t,typeof t!="string"&&this.wf(),this.C(),this.t("stroke",e,t))}get lineCount(){return this.Pi}get lineHeight(){return this.ty()}get editable(){return(this.n&1048576)!==0}set editable(t){let e=(this.n&1048576)!==0;e!==t&&(this.n=this.n^1048576,this.t("editable",e,t))}get jN(){return(this.n&33554432)!==0}set jN(t){this.n=this.n^33554432}get textEditor(){return this.tt!==null?this.tt.ey:null}set textEditor(t){let e=this.textEditor;e!==t&&(this.Rs().ey=t,this.t("textEditor",e,t))}get errorFunction(){return this.tt!==null?this.tt.gs:null}set errorFunction(t){let e=this.errorFunction;e!==t&&(t!==null&&m.S(t,lt,"errorFunction"),this.Rs().gs=t,this.t("errorFunction",e,t))}get interval(){return this.K!==null?this.K.vf:1}set interval(t){let e=this.interval;if(t=Math.round(t),e!==t&&t!==0&&isFinite(t)){this.K===null&&(this.K=new xe),this.K.vf=t,this.f();let i=this.panel;i!==null&&(i.ds=null),this.t("interval",e,t)}}get graduatedStart(){return this.K!==null?this.K.Ff:0}set graduatedStart(t){let e=this.graduatedStart;e!==t&&(t<0?t=0:t>1&&(t=1),this.K===null&&(this.K=new xe),this.K.Ff=t,this.f(),this.t("graduatedStart",e,t))}get graduatedEnd(){return this.K!==null?this.K.Rf:1}set graduatedEnd(t){let e=this.graduatedEnd;e!==t&&(t<0?t=0:t>1&&(t=1),this.K===null&&(this.K=new xe),this.K.Rf=t,this.f(),this.t("graduatedEnd",e,t))}get graduatedFunction(){return this.K!==null?this.K.iy:null}set graduatedFunction(t){let e=this.graduatedFunction;e!==t&&(t!==null&&m.S(t,lt,"graduatedFunction"),this.K===null&&(this.K=new xe),this.K.iy=t,this.f(),this.t("graduatedFunction",e,t))}get graduatedSkip(){return this.K!==null?this.K.Of:null}set graduatedSkip(t){let e=this.graduatedSkip;e!==t&&(t!==null&&m.S(t,lt,"graduatedSkip"),this.K===null&&(this.K=new xe),this.K.Of=t,this.f(),this.t("graduatedSkip",e,t))}Ma(t,e){if(this.Qe===null||this.ue.length===0||this.Dn===null)return;let i=this.naturalBounds,s=this.actualBounds,n=i.width,o=i.height,r=this.ty(),a=t.textAlign=this.textAlign,h=e.rd;a==="start"?a=h?"right":"left":a==="end"&&(a=h?"left":"right");let l=this.isUnderline,u=this.isStrikethrough;this.bn(t,this.Qe,!0,!1,i,s),(l||u)&&this.bn(t,this.Qe,!1,!1,i,s);let c=0,d=0,f=n,p=!1;e.Wt===t&&!(e.Wt instanceof re)&&!this.jN&&e.getRenderingHint("textGreeking")===!0&&r*this.Th*e.scale<3&&(p=!0);let g=this.spacingAbove,y=this.spacingBelow;switch(this.flip){case 0:break;case 2:t.translate(n,0),t.scale(-1,1);break;case 1:t.translate(0,o),t.scale(1,-1);break;case 3:t.translate(n,o),t.scale(-1,-1);break}t.commitTransform();let b=this.Pi,v=(g+r+y)*b;if(o>v){let w=this.verticalAlignment;d=w.y*o-w.y*v+w.offsetY}if(lt.nk&&(t.letterSpacing=this.letterSpacing,t.wordSpacing=this.wordSpacing),b===1&&this.Fn!==null){let w=this.pe;w>f&&(w=f),d+=g,this.LD(this.Fn,t,c,d,f,r,w,p,a,l,u)}else if(this.Ii!==null&&this.ye!==null)for(let w=0;w<b;w++){let k=this.Ii[w];k>f&&(k=f),d+=g,this.LD(this.ye[w],t,c,d,f,r,k,p,a,l,u),d+=r+y}switch(this.flip){case 0:break;case 2:t.scale(-1,1),t.translate(-n,0);break;case 1:t.scale(1,-1),t.translate(0,-o);break;case 3:t.scale(-1,-1),t.translate(-n,-o);break}}LD(t,e,i,s,n,o,r,a,h,l,u){let c=0;if(a){h==="left"?c=0:h==="right"?c=n-r:h==="center"&&(c=(n-r)/2);let p=e.globalAlpha;e.globalAlpha=p/2,e.fillRect(i+c,s+o/4,r,o/2),e.globalAlpha=p;return}h==="left"?c=0:h==="right"?c=n:h==="center"&&(c=n/2);let d=lt.ik!==null?lt.ik(this,o):o*.75;e.fillText(t,i+c,s+d);let f=o/20|0;if(f===0&&(f=1),h==="right"?c-=r:h==="center"&&(c-=r/2),l){let p=lt.sk!==null?lt.sk(this,o):o*.8;this.AD(i+c,s+p,i+c+r,s+p,f,e),e instanceof re&&e.lastCreatedElement.classList.add("gojs-td")}if(u){let p=s+o-o/2.2|0;f%2!==0&&(p+=.5),this.AD(i+c,p,i+c+r,p,f,e),e instanceof re&&e.lastCreatedElement.classList.add("gojs-td")}}AD(t,e,i,s,n,o){o.beginPath(),o.lineWidth=n,o.moveTo(t,e),o.lineTo(i,s),o.stroke(),o.endPath()}yf(t,e,i){if(!super.yf(t,e,i))return!1;if(this.bn(t,this.Qe,!0,!1,this.naturalBounds,this.actualBounds),i){if(this.svg.getElementsByTagName("text").length===0)return!0;let s=this.svg.getElementsByClassName("gojs-td");for(let n=0;n<s.length;n++)t.setFillOrStrokeInPlace(s[n],!1)}else this.lE(this.svg,this.ye?this.ye[0]:this.text,t);return!0}lE(t,e,i){t.innerHTML=e,i.setFillOrStrokeInPlace(t,!0)}Pd(t){return this.lineCount>1||this.isUnderline||this.isStrikethrough?!0:super.Pd(t)}AN(t,e){if(t.nodeName!=="g")t.setAttributeNS(null,"filter",e);else{let i=t.getElementsByTagName("text");for(let s=0;s<i.length;s++)i[s].setAttributeNS(null,"filter",e)}}aE(){this.vn=0,this.pe=0,this.uo=null,this.Ii=null,this.ye=null,this.Fn=null}bd(t,e,i,s){let n=this.Pi;this.Xl=t,this.rC(!1);let o=this.Dn;lt.us!==null&&(lt.TD!==o&&(lt.us.font=o,lt.TD=o),lt.nk&&(lt.us.letterSpacing=this.letterSpacing,lt.us.wordSpacing=this.wordSpacing)),this.aE();let r=0,a=0;isNaN(this.desiredSize.width)?(r=this.hE(),r=Math.min(r,t/this.scale)):r=this.desiredSize.width,this.panel!==null&&(r=Math.min(r,this.panel.maxSize.width)),a=this.CD(r),isNaN(this.desiredSize.height)?a=Math.min(a,e/this.scale):a=this.desiredSize.height,this.cE(t,a),(this.wrap===1||isNaN(this.desiredSize.width))&&(r=isNaN(t)?this.pe:Math.min(t,this.pe)),r=Math.max(i,r),a=Math.max(s,a),this.Ke.Hn(r,a),this.ro(0,0,r,a),this.svg!==null&&n!==this.Pi&&this.Ji(!0)}Pa(t,e,i,s){this.commonArrange(t,e,i,s)}Rn(t,e){this.Fn===null?(this.Fn=t,this.pe=e):((this.ye===null||this.Ii===null)&&(this.ye=[],this.Ii=[],this.ye.push(this.Fn),this.Ii.push(this.pe)),this.ye.push(t),this.Ii.push(e),this.ye.length>this.maxLines&&(this.n|=16777216))}oC(t,e,i){let s=this.formatting===0;s&&(t=t.trim());let n=0,o=0,r=0,a=this.Dn,h=this.spacingAbove+this.spacingBelow,l=Math.max(0,this.ty()+h),u=this.overflow===1?this.DD(a):0;if(this.Pi>=this.maxLines){i!==void 0&&i.e(0,l);return}let c=t;if(this.wrap===0){if(this.vn=1,o=this.getStringWidth(t),u===0||o<=e){this.pe=Math.max(this.pe,o),this.Rn(t,this.pe),i!==void 0&&i.e(o,l);return}let f=this.Hd(c);c=c.substring(f.length);let p=this.Hd(c);for(o=this.getStringWidth(f+p),r=0;p.length>0&&o<=e;){f+=p,c=c.substring(p.length),p=this.Hd(c),r=o;let g=f+p;s&&(g=g.trim()),o=this.getStringWidth(g)}for(s&&(p=p.trim()),f+=p,e=Math.max(1,e-u);this.getStringWidth(f)>e&&f.length>1;)f=f.substring(0,f.length-1);this.rC(!0),f+=lt.$0,r=this.getStringWidth(f),this.pe=r,this.Rn(f,r),i!==void 0&&i.e(r,l);return}let d=0;for(c.length===0&&(d=1,this.Rn(c,0));c.length>0;){let f=this.Hd(c);for(c=c.substring(f.length);this.getStringWidth(f)>e;){let y=1;for(o=this.getStringWidth(f.substring(0,y)),r=0;o<=e;)y++,r=o,o=this.getStringWidth(f.substring(0,y));let b=0;y===1?(b=o,n=Math.max(n,o)):(b=r,n=Math.max(n,r)),y--,y<1&&(y=1);let v=f.substring(0,y);if(this.Rn(v,b),d++,f=f.substring(y),this.Pi+d>this.maxLines)break}let p=this.Hd(c);for(o=this.getStringWidth(f+p),r=0;p.length>0&&o<=e;){f+=p,c=c.substring(p.length),p=this.Hd(c),r=o;let y=f+p;s&&(y=y.trim()),o=this.getStringWidth(y)}if(s&&(f=f.trim()),f==="")continue;f[f.length-1]==="\xAD"&&(f=f.substring(0,f.length-1)+"\u2010");let g=0;if(p.length===0?(g=o,n=Math.max(n,o)):(r=this.getStringWidth(f),g=r,n=Math.max(n,r)),this.Rn(f,g),d++,this.Pi+d>this.maxLines)break}this.vn=Math.min(this.maxLines-this.Pi,d),this.pe=Math.max(this.pe,n),i!==void 0&&i.e(this.pe,l*this.vn)}cE(t,e){if(this.pe===0||this.Ii===null||this.ye===null||this.overflow!==1)return;let i=this.Dn,s=this.overflow===1?this.DD(i):0,n=this.spacingAbove+this.spacingBelow,o=Math.max(0,this.ty()+n),r=Math.min(this.maxLines-1,Math.max(Math.floor(e/o+.01)-1,0));if(r+1>=this.ye.length)return;this.rC(!0);let a=this.ye[r],h=Math.max(1,t-s);for(;this.getStringWidth(a)>h&&a.length>1;)a=a.substring(0,a.length-1);a+=lt.$0;let l=this.getStringWidth(a);this.ye[r]=a,this.ye=this.ye.slice(0,r+1),this.Ii[r]=l,this.Ii=this.Ii.slice(0,r+1),this.vn=this.ye.length,this.pe=Math.max(this.pe,l),this.Pi=this.vn,this.Pi===1&&(this.Fn=this.ye[0])}Hd(t){if(this.wrap===3)return t.substring(0,1);let e=t.length,i=0,s=lt.fE;for(;i<e&&!s.test(t.charAt(i));)i++;for(this.formatting===1&&(e=Math.min(e,i+1));i<e&&s.test(t.charAt(i));)i++;return i>=t.length?t:t.substring(0,i)}getStringWidth(t){return lt.us===null?t.length*8:lt.us.measureText(t).width}ty(){if(this.uo!==null)return this.uo;let t=this.Dn,e=0;if(lt.us===null)return e=16,this.uo=e,e;if(lt.lC[t]!==void 0&<.vD<5e3)e=lt.lC[t];else{lt.us.letterSpacing="0px";let i=lt.us.measureText("M");lt.us.letterSpacing=this.letterSpacing,e=i.width*1.3,lt.lC[t]=e,lt.vD++}return this.uo=e,e}DD(t){if(lt.us===null)return 6;let e=0;return lt.ek[t]!==void 0&<.nC<5e3?e=lt.ek[t]:(e=lt.us.measureText(lt.$0).width,lt.ek[t]=e,lt.nC++),e}ok(t,e){return t.indexOf(`
|
|
7
|
+
`+n.toString(t-1)}return i}static QA(t){Y.Zb=t}static Om(){return Y.Zb}static fromDiv(t){let e=t;if(typeof t=="string"&&(e=X.document.getElementById(t)),e instanceof HTMLDivElement){let i=Y.ji.get(e);if(i)return i}return null}get div(){return this.Nt}set div(t){if(t!==null&&m.se(t,HTMLDivElement,Y,"div"),this.Nt!==t){let e=this.Nt;if(e!==null){if(Y.ji.delete(e),e.goDiagram=void 0,e.go=void 0,e.innerHTML="",this.lt!==null){let s=this.lt.bt;this.Le(s,"pointermove",this.xh,!1),this.Le(s,"pointerdown",this.la,!1),this.Le(s,"pointerup",this.bh,!1),this.Le(s,"pointerout",this.kh,!1),this.Le(s,"pointercancel",this.Ph,!1),this.lt.dispose()}this.tf&&(this.tf.disconnect(),this.tf=null);let i=this.toolManager;i!==null&&(i.mouseDownTools.each(s=>s.cancelWaitAfter()),i.mouseMoveTools.each(s=>s.cancelWaitAfter()),i.mouseUpTools.each(s=>s.cancelWaitAfter())),i.cancelWaitAfter(),this.currentTool.doCancel(),this.lt=null,this.Le(X,"resize",this.$b,!1),this.Le(X,"wheel",this.wh,!0),Y.Om()===this&&Y.QA(null)}else this.la===null&&(this.so=!1);if(this.Nt=null,t!==null){let i=Y.ji.get(t);i&&(i.div=null),this.w2(t),this.Iu(),this.themeManager&&this.themeManager.eO()}else this.themeManager&&this.themeManager.iO()}}setupRouters(){this.nf.push(new _n)}w2(t){let e=this;if(!Y.isUsingDOM())return;t==null&&m.o("Diagram setup requires an argument DIV."),e.Nt!==null&&m.o("Diagram has already completed setup."),typeof t=="string"?e.Nt=X.document.getElementById(t):t instanceof HTMLDivElement?e.Nt=t:m.o("No DIV or DIV id supplied: "+t),e.Nt===null&&m.o("Invalid DIV id; could not get element with id: "+t);let i=Y.ji.get(e.Nt);if(i&&i!==this&&m.o("Invalid div id; div already has a Diagram associated with it."),!e.tf&&X.ResizeObserver){let u=X.ResizeObserver,c=m.CP(()=>e.requestUpdate(),250,!1);e.tf=new u(()=>c()),e.tf.observe(e.Nt)}X.getComputedStyle(e.Nt,null).position==="static"&&(e.Nt.style.position="relative");let s=5,n="rgba(2"+s+"5, 255, 255, 0)";s--,e.Nt.style["-webkit-tap-highlight-color"]=n,e.Nt.innerHTML="",Y.ji.set(e.Nt,e),e.Nt.goDiagram=e,e.Nt.go=X.go;let o=new Fe(e);o.style!==void 0&&(o.style.position="absolute",o.style.top="0px",o.style.left="0px",X.getComputedStyle(e.Nt,null).getPropertyValue("direction")==="rtl"&&(e.rd=!0),o.style.zIndex="2",o.style.userSelect="none",o.style.MozUserSelect="none",o.style.touchAction="none",o.style.letterSpacing="normal !important",o.style.wordSpacing="normal !important",o.style.lang="unknown"),o.bt.setAttribute("role","application"),e.lt=o,e.Wt=o._t;let r=e.Wt;e.$e=e.computePixelRatio(),e.viewSize.isReal()||(e.wt=e.Nt.clientWidth||1,e.xt=e.Nt.clientHeight||1),e.lT(e.wt,e.xt);let a=e;e.Nt.insertBefore(o.bt,e.Nt.firstChild);let h=new Fe(null);if(h.width=1,h.height=1,e.KR=h,e.HR=h._t,Y.isUsingDOM()){let u=m.Ni("div"),c=m.Ni("div");u.style.position="absolute",u.style.overflow="auto",u.style.width=e.wt+"px",u.style.height=e.xt+"px",u.style.zIndex="1",c.style.position="absolute",c.style.width="1px",c.style.height="1px",e.Nt.appendChild(u),u.appendChild(c),u.onscroll=Y.sO,u.addEventListener("pointerdown",Y.nO),u.a=e,u.oO=!0,u.rO=!0,e.Wb=u,e.Jb=c}e.Iu=m.CP(()=>{e.Ol=null,e.C()},300,!1),e.$b=m.CP(()=>{e.NM()},250,!1),e.oh=u=>(u.preventDefault(),!1),e.wh=u=>{if(!a.isEnabled)return;let c=a.of(u,!0);c.bubbles=!0;let d=0,f=0;c.delta=0,u.deltaX!==void 0?(u.deltaX!==0&&(d=u.deltaX>0?1:-1),u.deltaY!==0&&(f=u.deltaY>0?1:-1),c.delta=Math.abs(u.deltaX)>Math.abs(u.deltaY)?-d:-f):u.wheelDeltaX!==void 0?(u.wheelDeltaX!==0&&(d=u.wheelDeltaX>0?-1:1),u.wheelDeltaY!==0&&(f=u.wheelDeltaY>0?-1:1),c.delta=Math.abs(u.wheelDeltaX)>Math.abs(u.wheelDeltaY)?-d:-f):u.wheelDelta!==void 0&&u.wheelDelta!==0&&(c.delta=u.wheelDelta>0?1:-1),a.doMouseWheel(),a.Sh(c,u)},e.$A=u=>{if(!a.isEnabled)return;e.ef=!1,a.of(u,!0);let c=a.currentTool;c.cancelWaitAfter(),c.standardMouseOver()},e.la=u=>{if(!a.isEnabled)return;e.ef=!0;let c=a.jb;c[u.pointerId]===void 0&&(c[u.pointerId]=u);let d=a.yh,f=!1;if(d[0]!==null&&(d[0].pointerId===u.pointerId||d[0].pointerType!==u.pointerType))d[0]=u;else if(d[1]!==null&&d[1].pointerId===u.pointerId)d[1]=u,f=!0;else if(d[0]===null)d[0]=u;else if(d[1]===null)d[1]=u,f=!0;else{u.preventDefault();return}let p=u.pointerType==="touch"||u.pointerType==="pen";p&&(a.Mx=!1,a.pp=!0);let g=a.lO(u,u,f),y=a.h2,b=p?25:10;if(u.timeStamp-a.a2<a.JA&&!(Math.abs(y.x-u.screenX)>b||Math.abs(y.y-u.screenY)>b)?a.mp++:a.mp=1,g.clickCount=a.mp,a.a2=u.timeStamp,a.h2.setTo(u.screenX,u.screenY),a.doMouseDown(),u.button===1){u.preventDefault();return}a.Sh(g,u)},e.xh=u=>{if(!a.isEnabled)return;e.ef=!0;let c=a.yh;if(c[0]!==null&&(c[0].pointerId===u.pointerId||c[0].pointerType!==u.pointerType))c[0]=u;else if(c[1]!==null&&c[1].pointerId===u.pointerId){c[1]=u;return}else if(c[0]===null)c[0]=u;else return;if(c[0].pointerId!==u.pointerId)return;let d=a.aO(u,u,c[1]!==null);a.doMouseMove(),a.Sh(d,u)},e.bh=u=>{if(!a.isEnabled)return;e.ef=!0;let c=u.pointerType==="touch"||u.pointerType==="pen",d=a.jb;if(c&&a.Mx){delete d[u.pointerId],u.preventDefault();return}let f=a.yh;if(f[0]!==null&&(f[0].pointerId===u.pointerId||f[0].pointerType!==u.pointerType))f[0]=null;else if(f[1]!==null&&f[1].pointerId===u.pointerId){f[1]=null;return}else return;let p=a.b2(u,!1,!0,!1,!0,!1),g=X.document.elementFromPoint(u.clientX,u.clientY)||null;g!==null&&g.shadowRoot&&(g=g.shadowRoot.elementFromPoint(u.clientX,u.clientY)||null),g!==null&&g.a instanceof Y&&g.a!==a&&g.a.Mp(u,p),g===null&&(g=u.target),a.Mp(u,p),p.clickCount=a.mp,p.targetDiagram=a.s1(u,g),p.targetObject=null,a.doMouseUp(),a.Sh(p,u),c&&(a.pp=!1)},e.kh=u=>{if(!a.isEnabled)return;e.ef=!1;let c=a.jb;c[u.pointerId]&&delete c[u.pointerId];let d=a.yh;if(d[0]!==null&&d[0].pointerId===u.pointerId&&(d[0]=null),d[1]!==null&&d[1].pointerId===u.pointerId&&(d[1]=null),u.pointerType==="touch"||u.pointerType==="pen")return;let f=a.currentTool;f.cancelWaitAfter(),f.standardMouseOver()},e.Ph=u=>{let c=a.yh;c[0]!==null&&c[0].pointerId===u.pointerId?(c[0]=null,a.pp=!1):c[1]!==null&&c[1].pointerId===u.pointerId&&(c[1]=null)};let l=r;if(e.gp=l.F[m.We("7eba17a4ca3b1a8346")][m.We("78a118b7")](l.F,Y.Mh,s,s),r.clearContextCache(!0),e.hO(),this.Qc==="svg"){let u=this.zo.get("svg");this.Nt&&this.Nt.appendChild(u.bt),this.Wt=u._t}}addEventListener(t,e,i,s){t.addEventListener(e,i,{capture:s,passive:!1})}Et(t,e,i,s){t.addEventListener(e,i,{capture:s,passive:!1})}removeEventListener(t,e,i,s){t.removeEventListener(e,i,{capture:s})}Le(t,e,i,s){t.removeEventListener(e,i,{capture:s})}hO(){let t=this,e=this.lt.bt;e instanceof HTMLCanvasElement||(e=t.div),this.Et(e,"pointerdown",t.la,!1),this.Et(e,"pointermove",t.xh,!1),this.Et(e,"pointerup",t.bh,!1),this.Et(e,"pointerout",t.kh,!1),this.Et(e,"pointercancel",t.Ph,!1),this.Et(e,"pointerenter",t.cO,!1),this.Et(e,"pointerleave",t.fO,!1),this.Et(e,"wheel",t.wh,!1),this.Et(e,"keydown",t.uO,!1),this.Et(e,"keyup",t.dO,!1),this.Et(e,"blur",t.gO,!1),this.Et(e,"focus",t.mO,!1),this.Et(e,"selectstart",i=>(i.preventDefault(),!1),!1),this.Et(e,"contextmenu",i=>(i.preventDefault(),!1),!1),this.Et(X,"resize",t.$b,!1)}Cx(){this.yp>30&&(this.Ol=1)}yS(t){this.Ol!==null&&(this.Ol=null,t&&this.Iu(),this.yp=0,this.u2=[0,0,0,0,0],this.wp=0)}computePixelRatio(){return this.Ol!==null?this.Ol:X.devicePixelRatio||1}get avgSpf(){return this.yp}doMouseDown(){this.currentTool.doMouseDown()}doMouseMove(){this.currentTool.doMouseMove()}doMouseUp(){this.currentTool.doMouseUp()}doMouseWheel(){this.currentTool.doMouseWheel()}doKeyDown(){let t=this.commandHandler;if(!this.toggleKeyboardControl()){if((t.isFocusEnabled||t.isVirtualPointerEnabled)&&t.doVirtualFocusKeyDown()){let e=this.lastInput;e.bubbles=!1;let i=e.event;i&&(i.stopPropagation&&i.stopPropagation(),i.cancelable!==!1&&i.preventDefault());return}this.currentTool.doKeyDown()}}toggleKeyboardControl(){let t=this.lastInput,e=t.commandKey;if((t.control||t.meta)&&t.alt&&(e==="Enter"||e==="NumpadEnter")){let i=this.commandHandler,s=i.isFocusEnabled||i.isVirtualPointerEnabled;return i.isFocusEnabled=!s,i.isVirtualPointerEnabled=!s,i.focus=i.findFirstFocus(),this.T("FocusOrVirtualPointerEnabledChanged"),!0}return!1}doKeyUp(){let t=this.commandHandler;if((t.isFocusEnabled||t.isVirtualPointerEnabled)&&t.doVirtualFocusKeyUp()){let e=this.lastInput;e.bubbles=!1;let i=e.event;i&&(i.stopPropagation&&i.stopPropagation(),i.cancelable!==!1&&i.preventDefault());return}this.currentTool.doKeyUp()}ad(t,e){if(e)for(let i in e)i!=="sourceDiagram"&&(t[i]=e[i])}emitMouseDown(t,e,i,s){if(typeof t!="number"||typeof e!="number")throw new Error("Robot.mouseDown first two args must be X,Y numbers");i===void 0&&(i=0);let n=this;if(s&&s.sourceDiagram&&(n=s.sourceDiagram),!n.isEnabled)return this;let o=new Qt;return o.diagram=n,o.documentPoint=new P(t,e),o.viewPoint=n.transformDocToView(o.documentPoint),o.timestamp=i,o.down=!0,this.ad(o,s),n.lastInput=o,n.firstInput=o.copy(),n.doMouseDown(),this}emitMouseMove(t,e,i,s){if(typeof t!="number"||typeof e!="number")throw new Error("Robot.mouseMove first two args must be X,Y numbers");i===void 0&&(i=0);let n=this;if(s&&s.sourceDiagram&&(n=s.sourceDiagram),!n.isEnabled)return this;let o=new Qt;return o.diagram=n,o.documentPoint=new P(t,e),o.viewPoint=n.transformDocToView(o.documentPoint),o.timestamp=i,this.ad(o,s),n.lastInput=o,n.doMouseMove(),this}emitMouseUp(t,e,i,s){if(typeof t!="number"||typeof e!="number")throw new Error("Robot.mouseUp first two args must be X,Y numbers");i===void 0&&(i=0);let n=this;if(s&&s.sourceDiagram&&(n=s.sourceDiagram),!n.isEnabled)return this;let o=new Qt;return o.diagram=n,o.documentPoint=new P(t,e),o.viewPoint=n.transformDocToView(o.documentPoint),o.timestamp=i,o.up=!0,n.firstInput.documentPoint.equals(o.documentPoint)&&(o.clickCount=1),this.ad(o,s),n.lastInput=o,n.doMouseUp(),this}emitMouseWheel(t,e,i){if(typeof t!="number")throw new Error("Robot.mouseWheel first arg must be DELTA number");e===void 0&&(e=0);let s=this;if(!s.isEnabled)return this;let n=new Qt;return n.diagram=s,n.documentPoint=s.lastInput.documentPoint,n.viewPoint=s.lastInput.viewPoint,n.delta=t,n.timestamp=e,this.ad(n,i),s.lastInput=n,s.doMouseWheel(),this}emitKeyDown(t,e,i){if(typeof t!="string"&&typeof t!="number")throw new Error("Robot.keyDown first arg must be a string or a number");e===void 0&&(e=0);let s=this;if(!s.isEnabled)return this;let n=new Qt;return n.diagram=s,n.documentPoint=s.lastInput.documentPoint,n.viewPoint=s.lastInput.viewPoint,typeof t=="string"?n.key=t:typeof t=="number"&&(n.key=String.fromCharCode(t)),n.timestamp=e,n.down=!0,this.ad(n,i),s.lastInput=n,s.doKeyDown(),this}emitKeyUp(t,e,i){if(typeof t!="string"&&typeof t!="number")throw new Error("Robot.keyUp first arg must be a string or a number");e===void 0&&(e=0);let s=this;if(!s.isEnabled)return this;let n=new Qt;return n.diagram=s,n.documentPoint=s.lastInput.documentPoint,n.viewPoint=s.lastInput.viewPoint,typeof t=="string"?n.key=t:typeof t=="number"&&(n.key=String.fromCharCode(t)),n.timestamp=e,n.up=!0,this.ad(n,i),s.lastInput=n,s.doKeyUp(),this}doFocus(){this.focus()}focus(){if(this.lt)if(this.scrollsPageOnFocus)this.lt.focus();else{let t=X.scrollX,e=X.scrollY;this.lt.focus(),X.scrollTo(t,e)}}mO(t){let e=Y.ji.get(this);e&&e.T("GainedFocus")}gO(t){let e=Y.ji.get(this);e&&e.T("LostFocus")}NM(){if(this.lt===null)return;let t=this.Nt;if(t===null||t.clientWidth===0||t.clientHeight===0)return;this.zM||this.setScrollWidth();let e=this.io?this.jt:0,i=this.kn?this.jt:0,s=this.$e;if(this.$e=this.computePixelRatio(),this.$e!==s&&(this.Ju=!0,this.requestUpdate()),t.clientWidth!==this.wt+e||t.clientHeight!==this.xt+i){this.Nh(),this.qi=!0;let n=this.layout;n!==null&&n.isViewportSized&&this.autoScale===1&&(this.$c=!0,n.p()),this.As||this.requestUpdate()}}tT(){let t=0,e=new Et;e.name="Grid",e.allowSelect=!1,e.pickable=!1,e.isTemporary=!0,e.isInDocumentBounds=!1,this.Zr(e,t++),e=new Et,e.name="ViewportBackground",e.isViewportAligned=!0,e.isTemporary=!0,e.isInDocumentBounds=!1,this.Zr(e,t++),e=new Et,e.name="Background",this.Zr(e,t++),e=new Et,e.name="",this.Zr(e,t++),e=new Et,e.name="Foreground",this.Zr(e,t++),e=new Et,e.name="ViewportForeground",e.isViewportAligned=!0,e.isTemporary=!0,e.isInDocumentBounds=!1,this.Zr(e,t++),e=new Et,e.name="Adornment",e.isTemporary=!0,e.isInDocumentBounds=!1,this.Zr(e,t++),e=new Et,e.name="Tool",e.isTemporary=!0,e.isInDocumentBounds=!0,this.Zr(e,t++)}aT(){let t=new G(G.Grid,{name:"GRID"}).add(new et("LineH",{stroke:"lightgray",strokeWidth:.5,interval:1}).theme("stroke","gridMinor"),new et("LineV",{stroke:"lightgray",strokeWidth:.5,interval:1}).theme("stroke","gridMinor"),new et("LineH",{stroke:"gray",strokeWidth:.5,interval:5}).theme("stroke","gridMajor"),new et("LineV",{stroke:"gray",strokeWidth:.5,interval:5}).theme("stroke","gridMajor"),new et("LineH",{stroke:"gray",strokeWidth:1,interval:10}).theme("stroke","gridMajor"),new et("LineV",{stroke:"gray",strokeWidth:1,interval:10}).theme("stroke","gridMajor")),e=new pt({layerName:"Grid",zOrder:0,isInDocumentBounds:!1,isAnimated:!1,pickable:!1,locationObjectName:"GRID"}).add(t);return this.add(e),this.partManager.parts.delete(e),t.visible=!1,t}static sO(){let t=Y.ji.get(this.parentElement||this);if(t){if(t.Bb){t.Bb=!1;return}if(!t.isEnabled){t.hT();return}t.diagramScroll(this)}}static nO(t){if(!this.a.isEnabled){this.a.updateScroll();return}this.a.zb=t.target.scrollTop,this.a.Xb=t.target.scrollLeft}diagramScroll(t){if(this.lt===null)return;let e=this.Wb,i=this.Jb;this.rp=!0;let s=this.documentBounds,n=this.viewportBounds,o=this.fh,r=s.x-o.left,a=s.y-o.top,h=s.width+o.left+o.right,l=s.height+o.top+o.bottom,u=s.right+o.right,c=s.bottom+o.bottom,d=n.x,f=n.y,p=n.width,g=n.height,y=n.right,b=n.bottom,v=this.scale,w,k=t.scrollLeft;if(this.rd)switch(this.lb){case"negative":k=k+t.scrollWidth-t.clientWidth;break;case"reverse":k=t.scrollWidth-k-t.clientWidth;break}let S=k;if(p<h||g<l){w=P.z(this.position.x,this.position.y),this.allowHorizontalScroll&&this.Xb!==S&&(w.x=S/v+r,this.Xb=S),this.allowVerticalScroll&&this.zb!==t.scrollTop&&(w.y=t.scrollTop/v+a,this.zb=t.scrollTop),this.position=w,P.i(w),this.rp=!1,this._u=!1;return}if(w=P.l(),t.oO&&this.allowHorizontalScroll&&(r<d&&(this.position=w.e(S+r,this.position.y)),u>y)){let N=e.scrollWidth-this.wt;this.position=w.e(-N+S-this.wt/v+u,this.position.y)}if(t.rO&&this.allowVerticalScroll&&(a<f&&(this.position=w.e(this.position.x,t.scrollTop+a)),c>b)){let N=e.scrollHeight-this.xt;this.position=w.e(this.position.x,-N+t.scrollTop-this.xt/v+c)}P.i(w),this.ha(),this.rp=!1,this._u=!1,s=this.documentBounds,n=this.viewportBounds,u=s.right,y=n.right,c=s.bottom,b=n.bottom,r=s.x,d=n.x,a=s.y,f=n.y,p>=h&&r>=d&&u<=y&&(i.style.width="1px"),g>=l&&a>=f&&c<=b&&(i.style.height="1px")}computeBounds(t){return t===void 0&&(t=new I),this.Te(),this.cT(t)}cT(t){if(this.fixedBounds.isReal())return t.h(this.fixedBounds),t.addMargin(this.Qt),t;let e=!0,i=this.Vt.r,s=i.length;for(let n=0;n<s;n++){let o=i[n];if(!o.visible||!o.isInDocumentBounds)continue;let r=o.Ct.r,a=r.length;for(let h=0;h<a;h++){let l=r[h];if(!l.isInDocumentBounds||!l.isVisible())continue;let u=l.actualBounds;u.isReal()&&(e?(e=!1,t.h(u)):t.unionRect(u))}}return e&&t.e(0,0,0,0),t.addMargin(this.Qt),t}computePartsBounds(t,e){e===void 0&&(e=!1);let i;if(Array.isArray(t))for(let s=0;s<t.length;s++){let n=t[s];!e&&n instanceof j||(n.ensureBounds(),i===void 0?i=n.actualBounds.copy():i.unionRect(n.actualBounds))}else{let s=t.iterator;for(;s.next();){let n=s.value;!e&&n instanceof j||(n.ensureBounds(),i===void 0?i=n.actualBounds.copy():i.unionRect(n.actualBounds))}}return i===void 0?new I(NaN,NaN,0,0):i}Js(t){if(!t&&!this.so||this.Ht||this.lt===null||!this.documentBounds.isReal())return;if(this.Ht=!0,t){let c=this.initialPosition;if(c.isReal()){this.Ht=!1,this.position=c;return}let d=this.initialDocumentSpot,f=this.initialViewportSpot;d.isNoSpot()&&(d=T.TopLeft),f.isNoSpot()&&(f=T.TopLeft);let p=P.l();p.setRectSpot(this.documentBounds,d);let g=this.viewportBounds,y=I.z(0,0,g.width,g.height),b=P.l();b.setRectSpot(y,f),b.e(p.x-b.x,p.y-b.y),this.Ht=!1,this.position=b,I.i(y),P.i(b)}let e=this.ia;t&&this.Rr!==1&&(e=this.Rr);let i=e!==1?this.hd(e):this.scale,s=this.ct.x,n=this.ct.y,o=this.wt/i,r=this.xt/i,a=this.Wc,h=this.ip;if(t&&!a.isSpot()&&(h.isSpot()||h.isDefault())){let c=this.initialDocumentSpot.isSpot()&&this.initialViewportSpot.isSpot();a=h.isDefault()&&!c?T.Center:h}this.k2(this.documentBounds,o,r,a,t);let l=this.scale;this.scale=i,this.Ht=!1;let u=this.viewportBounds;u.equalsApproxTo(s,n,o,r)||this.onViewportBoundsChanged(new I(s,n,o,r),u,l,!1)}hd(t){let e=this.dp;if(this.lt===null)return e;if(t===1)return this.scale;this.ensureBounds();let i=this.documentBounds;if(!i.isReal())return e;let s=i.width,n=i.height,o=this.wt+(this.io?this.jt:0),r=this.xt+(this.kn?this.jt:0),a=o/s,h=r/n,l=this.fh,u=l.left+l.right!==0,c=l.top+l.bottom!==0;(u||c)&&(h===a?(h=(r-this.jt)/n,a=(o-this.jt)/s):h>a?h=(r-this.jt)/n:a=(o-this.jt)/s);let d=0;return t===2?d=Math.min(h,a):t===3&&(h>a?d=(r-this.jt)/n:d=(o-this.jt)/s),d>e&&(d=e),d<this.minScale&&(d=this.minScale),d>this.maxScale&&(d=this.maxScale),d}zoomToFit(){let t=this.ah;this.ah=1,this.scale=this.hd(2),this.alignDocument(T.Center,T.Center),t!==1&&(this.Js(!1),this.k2(this.documentBounds,this.wt/this.it,this.xt/this.it,this.Wc,!1)),this.ah=t}zoomToRect(t,e){e===void 0&&(e=2);let i=t.width,s=t.height;if(i===0||s===0||isNaN(i)&&isNaN(s))return;let n=1;if(e===2||e===3)if(isNaN(i))n=this.viewportBounds.height*this.scale/s;else if(isNaN(s))n=this.viewportBounds.width*this.scale/i;else{let o=this.wt,r=this.xt;e===3?r/s>o/i?n=(r-(this.kn?this.jt:0))/s:n=(o-(this.io?this.jt:0))/i:n=Math.min(r/s,o/i)}this.scale=n,this.position=new P(t.x,t.y)}get pO(){return this.Ht}set pO(t){this.Ht=t}alignDocument(t,e){this.ensureBounds();let i=this.documentBounds,s=this.viewportBounds;this.position=new P(i.x+(t.x*i.width+t.offsetX)-(e.x*s.width-e.offsetX),i.y+(t.y*i.height+t.offsetY)-(e.y*s.height-e.offsetY))}focusObject(t){if(t instanceof $){this.xp=t;let e=P.l();this.bp=this.transformDocToView(t.getDocumentPoint(T.TopLeft,e)),P.i(e)}else this.xp=null,this.bp=P.gn}k2(t,e,i,s,n){let o=P.z(this.ct.x,this.ct.y),r=o.x,a=o.y;if(this.xp!==null){let h=P.l();h=this.xp.getDocumentPoint(T.TopLeft,h),r=h.x-this.bp.x/this.scale,a=h.y-this.bp.y/this.scale,s=T.None,P.i(h)}if(n||this.scrollMode===1){s.isSpot()&&(e>t.width&&(r=t.x+(s.x*t.width+s.offsetX)-(s.x*e-s.offsetX)),i>t.height&&(a=t.y+(s.y*t.height+s.offsetY)-(s.y*i-s.offsetY)));let h=this.fh,l=e-t.width;if(e<t.width+h.left+h.right){let c=r+e/2;c=Math.min(c,t.right+Math.max(l,h.right)-e/2),c=Math.max(c,t.left-Math.max(l,h.left)+e/2),r=c-e/2}else r>t.left?r=t.left:r<t.right-e&&(r=t.right-e);let u=i-t.height;if(i<t.height+h.top+h.bottom){let c=a+i/2;c=Math.min(c,t.bottom+Math.max(u,h.bottom)-i/2),c=Math.max(c,t.top-Math.max(u,h.top)+i/2),a=c-i/2}else a>t.top?a=t.top:a<t.bottom-i&&(a=t.bottom-i)}if(o.x=isFinite(r)?r:-this.Qt.left,o.y=isFinite(a)?a:-this.Qt.top,this.positionComputation!==null){let h=this.positionComputation(this,o);o.x=h.x,o.y=h.y}this.Ns.UA(this.ct,o),this.ct.e(o.x,o.y),this.Np(),this.aa(),this.yO(),P.i(o)}findPartAt(t,e){if(e===void 0&&(e=!0),e){let i=this.kS(t,s=>s.part,s=>s.canSelect());if(i instanceof pt)return i}else{let i=this.kS(t,s=>s.part);if(i instanceof pt)return i}return null}findObjectAt(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null),this.Te();let s=this.Vt.iteratorBackwards;for(;s.next();){let n=s.value;if(!n.visible)continue;let o=n.findObjectAt(t,e,i);if(o!==null)return o}return null}kS(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null),this.Te();let s=this.Vt.iteratorBackwards;for(;s.next();){let n=s.value;if(!n.visible||n.isTemporary)continue;let o=n.findObjectAt(t,e,i);if(o!==null)return o}return null}findPartsAt(t,e,i){return e===void 0&&(e=!0),this.wO(t,s=>s.part,e?s=>s instanceof pt&&s.canSelect():null,i)}wO(t,e,i,s){e===void 0&&(e=null),i===void 0&&(i=null),!(s instanceof q)&&!(s instanceof V)&&(s=new V),this.Te();let n=this.Vt.iteratorBackwards;for(;n.next();){let o=n.value;!o.visible||o.isTemporary||o.findObjectsAt(t,e,i,s)}return s}findObjectsAt(t,e,i,s){e===void 0&&(e=null),i===void 0&&(i=null),!(s instanceof q)&&!(s instanceof V)&&(s=new V),this.Te();let n=this.Vt.iteratorBackwards;for(;n.next();){let o=n.value;o.visible&&o.findObjectsAt(t,e,i,s)}return s}findPartsIn(t,e,i,s){return e===void 0&&(e=!1),i===void 0&&(i=!0),this.xO(t,null,n=>n instanceof pt&&(!i||n.canSelect()),e,s)}findObjectsIn(t,e,i,s,n){e===void 0&&(e=null),i===void 0&&(i=null),s===void 0&&(s=!1),!(n instanceof q)&&!(n instanceof V)&&(n=new V),this.Te();let o=this.Vt.iteratorBackwards;for(;o.next();){let r=o.value;r.visible&&r.findObjectsIn(t,e,i,s,n)}return n}MS(t,e,i,s,n,o){let r=new V;this.Te();let a=this.Vt.iteratorBackwards;for(;a.next();){let h=a.value;h.visible&&h.MS(t,e,i,s,r,n,o)}return r}xO(t,e,i,s,n){e===void 0&&(e=null),i===void 0&&(i=null),s===void 0&&(s=!1),!(n instanceof q)&&!(n instanceof V)&&(n=new V),this.Te();let o=this.Vt.iteratorBackwards;for(;o.next();){let r=o.value;!r.visible||r.isTemporary||r.findObjectsIn(t,e,i,s,n)}return n}findPartsNear(t,e,i,s,n){return i===void 0&&(i=!0),s===void 0&&(s=!0),this.bO(t,e,null,o=>o instanceof pt&&(!s||o.canSelect()),i,n)}findObjectsNear(t,e,i,s,n,o){i===void 0&&(i=null),s===void 0&&(s=null),n===void 0&&(n=!0),n!==!1&&n!==!0&&((n instanceof q||n instanceof V)&&(o=n),n=!0),!(o instanceof q)&&!(o instanceof V)&&(o=new V),this.Te();let r=this.Vt.iteratorBackwards;for(;r.next();){let a=r.value;a.visible&&a.findObjectsNear(t,e,i,s,n,o)}return o}bO(t,e,i,s,n,o){i===void 0&&(i=null),s===void 0&&(s=null),n===void 0&&(n=!0),n!==!1&&n!==!0&&((n instanceof q||n instanceof V)&&(o=n),n=!0),!(o instanceof q)&&!(o instanceof V)&&(o=new V),this.Te();let r=this.Vt.iteratorBackwards;for(;r.next();){let a=r.value;!a.visible||a.isTemporary||a.findObjectsNear(t,e,i,s,n,o)}return o}acceptEvent(t){return this.of(t,t instanceof MouseEvent)}of(t,e){let i=this.Wr;this.Wr=this.gh,this.gh=i,i.diagram=this,i.event=t,e?this.Mp(t,i):(i.viewPoint=this.Wr.viewPoint,i.documentPoint=this.Wr.documentPoint);let s=0,n=t;return n.ctrlKey&&(s+=1),n.altKey&&(s+=2),n.shiftKey&&(s+=4),n.metaKey&&(s+=8),i.modifiers=s,i.button=n.button,n.buttons!==void 0&&(i.buttons=n.buttons),m.fr&&n.button===0&&n.ctrlKey&&(i.button=2),i.down=!1,i.up=!1,i.clickCount=1,i.delta=0,i.handled=!1,i.bubbles=!1,i.timestamp=t.timeStamp,i.isMultiTouch=!1,i.targetDiagram=this.s1(t,t.target),i.targetObject=null,i}s1(t,e){if(e===null)return null;let i=Y.ji.get(e);if(i)return i;let s=t.path;if(!s&&m.st(t.composedPath)&&(s=t.composedPath()),s&&s[0]){let n=Y.ji.get(s[0]);if(n)return n}return null}lO(t,e,i){let s=this.b2(t,!0,!1,!1,!0,i);return this.Mp(e,s),s.targetDiagram=this.s1(t,t.target),s.targetObject=null,i||s.clone(this.fp),s}aO(t,e,i){let s=this.b2(t,!1,!1,!1,!1,i),n=X.document.elementFromPoint(e.clientX,e.clientY)||null;n!==null&&n.shadowRoot&&(n=n.shadowRoot.elementFromPoint(e.clientX,e.clientY)||null);let o=this,r=t;if(n){let a=this.s1(t,n);a&&(r=e,o=a)}return s.targetDiagram=o,this.Mp(r,s),s.targetObject=null,s}b2(t,e,i,s,n,o){let r=this.Wr;this.Wr=this.gh,this.gh=r,r.diagram=this,r.clickCount=1,r.delta=0;let a=0;return t.ctrlKey&&(a+=1),t.altKey&&(a+=2),t.shiftKey&&(a+=4),t.metaKey&&(a+=8),r.modifiers=a,r.event=t,r.timestamp=t.timeStamp,r.button=i?this.firstInput.button:t.button,r.buttons=t.buttons,m.fr&&t.button===0&&t.ctrlKey&&(r.button=2),r.down=e,r.up=i,r.handled=s,r.bubbles=n,r.isMultiTouch=o,r}Sh(t,e){return t.bubbles?!0:(e.stopPropagation!==void 0&&e.stopPropagation(),e.cancelable!==!1&&e.preventDefault(),e.cancelBubble=!0,!1)}uO(t){let e=Y.ji.get(this);if(!e||!e.isEnabled)return!1;let i=e.of(t,!1);return i.key=t.key,i.code=t.code,i.down=!0,e.doKeyDown(),e.Sh(i,t)}dO(t){let e=Y.ji.get(this);if(!e||!e.isEnabled)return!1;let i=e.of(t,!1);return i.key=t.key,i.code=t.code,i.up=!0,e.doKeyUp(),e.Sh(i,t)}cO(t){let e=Y.ji.get(this);if(!e||!e.isEnabled)return!1;let i=e.of(t,!0);return e.mouseEnter!==null&&e.mouseEnter(i),e.currentTool.standardMouseOver(),e.Sh(i,t)}fO(t){let e=Y.ji.get(this);if(!e||!e.isEnabled)return!1;let i=e.of(t,!0);return e.mouseLeave!==null&&e.mouseLeave(i),e.Sh(i,t)}getMouse(t){let e=this.lt;if(e===null)return new P(0,0);let i=e.getBoundingClientRect(),s=(t.clientX-i.left)*(this.wt/i.width),n=(t.clientY-i.top)*(this.xt/i.height);return new P(s,n).Yi(this.v)}Mp(t,e){let i=this.lt,s=0,n=0;if(i!==null){let r=i.getBoundingClientRect();s=(t.clientX-r.left)*(this.wt/r.width),n=(t.clientY-r.top)*(this.xt/r.height)}e.viewPoint.e(s,n);let o=P.z(s,n);this.v.Ci(o),e.documentPoint.h(o),P.i(o)}eA(t,e,i){let s;if(this.yh[0]!==null)s=this.yh[e];else return;let n=this.lt;if(n!==null){let o=n.getBoundingClientRect();i.e((s.clientX-o.left)*(this.wt/o.width),(s.clientY-o.top)*(this.xt/o.height))}}invalidateDocumentBounds(){this.mh||(this.mh=!0,this.requestUpdate(!1))}kO(){this.As||this.Te(),this.ensureBounds()}redraw(){this.Ht||this.As||(this.C(),this.maybeUpdate())}isUpdateRequested(){return this.Tr}delayInitialization(t){t===void 0&&(t=null);let e=this.animationManager,i=e.isEnabled;e.stopAnimation(),e.isEnabled=!1,this.Pr(),this.so=!1,this.qx=new P(NaN,NaN),e.isEnabled=i,this.As=!0;let s=this;t!==null&&m.un(()=>{s.As=!1,e.Gl("Model"),t(s)},1)}requestUpdate(t){if(t===void 0&&(t=!1),this.Tr===!0||this.Ht||t===!1&&this.As)return;this.Tr=!0;let e=this;X.requestAnimationFrame(()=>{e.Tr&&e.maybeUpdate()})}maybeUpdate(){this.$u&&!this.Tr||(this.$u&&(this.$u=!1),this.Pr())}P2(t,e){!this._u||this.Ht||this.animationManager.defaultAnimation.isAnimating||this.hT()||(t&&this.Te(),e&&this.Js(!1))}Pr(t){if(this.As||(this.Tr=!1,this.Nt===null&&!this.td.isReal()))return;this.As=!0;let e=this.animationManager,i=this.od;if(!e.isAnimating&&i.length!==0){let u=i.r,c=u.length;for(let d=0;d<c;d++){let f=u[d];f.xi(!1),f.f()}i.clear()}let s=this.l2;s.count>0&&(s.each(u=>u.S2()),s.clear());let n=!1,o=!1;e.defaultAnimation.isAnimating&&(o=!0,n=this.skipsUndoManager,this.skipsUndoManager=!0),e.ke||this.NM(),t||this.P2(!1,!0);let r=!this.undoManager.isUndoingRedoing&&(this.Fl||this.nf.count!==0&&this.Or.size!==0),a=!this.so||this.Jr;this.Te(!0);let h=!1;(a||r)&&(this.so?this.M2(!this.$c,r):(this.startTransaction("Initial Layout"),e.isEnabled===!1&&e.stopAnimation(),this.M2(!1,r)),h=a),this.$c=!1,this.Fl=!1,this.Te(),this.ls!==null&&(this.ls.visible&&!this.ed&&(this.ca(),this.ed=!0),!this.ls.visible&&this.ed&&(this.ed=!1)),this.Lb||this.kO(),t||this.P2(!0,!1);let l=!1;if(h){let u=I.l();u.h(this.viewportBounds),this.so||(this.so=!0,l=!0,this.skipsUndoManager||(this.undoManager.Px=!0),this.undoManager.Sx=!0,this.PO()),this.SO(),this.Te(!1),t||this.P2(!0,!0),I.i(u)}else if(e.Bc&&e.Hx){if(this.Rr!==1)this.scale=this.hd(this.Rr);else if(this.ia!==1)this.scale=this.hd(this.ia);else{let u=this.initialScale;isFinite(u)&&u>0&&(this.scale=u)}this.Js(!0)}h&&l&&this.commitTransaction("Initial Layout"),t||this.Ge(this.Wt),o&&(this.skipsUndoManager=n),this.As=!1}get Qa(){return this.so}PO(){if(this.Rr!==1)this.scale=this.hd(this.Rr);else if(this.ia!==1)this.scale=this.hd(this.ia);else{let e=this.initialScale;isFinite(e)&&e>0&&(this.scale=e)}this.Js(!0);let t=this.Vt.r;this.rs(t,t.length,this,this.viewportBounds),this.T("InitialLayoutCompleted"),this.qx.h(this.ct),this.ca()}SO(){this.T("LayoutCompleted")}Cp(t){this.to.add(t)}addInvalidRoute(t){this.Uo?this.uh.add(t):this.Or.add(t)}Te(t){if(this.to.size!==0&&!(!this.As&&this.animationManager.isTicking)){if(this.As||(this.Fl=!0),t){this.fT(this.to);return}for(let e=0;e<23&&this.to.size!==0;e++){let i=new Set(this.to);this.to.clear(),this.S2(i,this.to)}this.nodes.each(e=>{e instanceof ht&&e.uT(!1)})}}fT(t,e){for(let i of t)!i.Di()||i instanceof ht||(i.Qr()?(i.ht(1/0,1/0),i.Ut()):e&&e.add(i));for(let i of t)if(i instanceof ht){if(!i.isVisible())continue;this.o1(i)}}S2(t,e){this.fT(t,e);for(let i of t){if(!(i instanceof j))continue;let s=i;s.isVisible()&&(s.Qr()?(s.ht(1/0,1/0),s.Ut()):e.add(s))}for(let i of t)i instanceof vt&&i.isVisible()&&(i.Qr()?(i.ht(1/0,1/0),i.Ut()):e.add(i))}cd(t){let e=t instanceof Y,i=e?t.links:t.memberParts,s=this.to;if(e)this.Te(!0);else{for(;i.next();){let n=i.value;s.has(n)&&(!n.Di()||n instanceof ht||n.Qr()&&(n.ht(1/0,1/0),n.Ut()))}for(i.reset();i.next();){let n=i.value;if(s.has(n)&&n instanceof ht){if(!n.isVisible())continue;this.o1(n)}}i.reset()}for(;i.next();){let n=i.value;n instanceof j&&s.has(n)&&n.isVisible()&&n.Qr()&&(n.ht(1/0,1/0),n.Ut())}}o1(t){let e=m.nt(),i=m.nt(),s=t.memberParts;for(;s.next();){let o=s.value;o.isVisible()&&(o instanceof ht?(o.Xo()||o.as()||o.fa())&&this.o1(o):o instanceof j?o.fromNode===t||o.toNode===t?i.push(o):e.push(o):(o.ht(1/0,1/0),o.Ut()))}let n=e.length;for(let o=0;o<n;o++){let r=e[o];r.ht(1/0,1/0),r.Ut()}m.Z(e),t.ht(1/0,1/0),t.Ut(),n=i.length;for(let o=0;o<n;o++){let r=i[o];r.ht(1/0,1/0),r.Ut()}m.Z(i)}rs(t,e,i,s){if(!(!this._c&&!this.animationManager.isAnimating)){for(let n=0;n<e;n++)t[n].rs(i,s);this.Te()}}Ge(t){this.Nt!==null&&(this.lt===null&&m.o("No canvas specified"),this.Qc==="svg"?this.MO(t):this.NO(t))}NO(t){let e=this.animationManager;if(e.ke||e.isAnimating&&!e.isTicking)return;let i=new Date;if(this.Lp(),this.Nt&&this.Nt.style.opacity==="0")return;let s=t!==this.Wt,n=this.Vt.r,o=n.length,r=this;if(this.rs(n,o,r,r.viewportBounds),s)t.clearContextCache(!0),this.ha();else if(!this.qi&&!e.isAnimating)return;let a=this.v,h=this.$e;t.setTransform(h,0,0,h,0,0),t.clearRect(0,0,this.wt,this.xt),this.Zt!==1&&(t.globalAlpha=this.Zt),this.N2(t);for(let f=0;f<o;f++)t.setTransform(h,0,0,h,0,0),t.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),t.commitTransform(),n[f].Ge(t,r);let l=!1;this.sf?this.sf.Mh(this,t)&&(l=this.gp()):l=!0,l&&(Nt.prototype.Ci=Nt.prototype.Su),s?(this.Wt.clearContextCache(!0),this.ha()):(this._c=!1,this.qi=!1);let u=+new Date-+i,c=!1,d=this.u2;if(c||this.Ol===null){d[this.wp]=u,this.wp=(this.wp+1)%d.length;let f=0;for(let p=0;p<d.length;p++)f+=d[p];this.yp=f/d.length}if(this.Zt!==1&&(t.globalAlpha=1),c){t.setTransform(1,0,0,1,0,0);for(let f=0;f<d.length;f++)t.fillText(d[f].toString(),20,150+ +(f*20))}}MO(t){if(this.Nt===null)return;let e=this.animationManager;if(e.ke||e.isAnimating&&!e.isTicking)return;this.Lp();let i=this.wt,s=this.xt;t.surface.resize(i,s,i,s);let n=this.Vt.r,o=n.length,r=this;if(this.rs(n,o,r,r.viewportBounds),!this.qi&&!e.isAnimating)return;let a=this.v;t.lastDrawnPart=null,t.setDiagramPosScale(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),this.Zt!==1&&(t.globalAlpha=this.Zt),this.N2(t);let h=this.$e,l=this.lt._t;l.setTransform(h,0,0,h,0,0),l.clearRect(0,0,this.wt,this.xt);for(let c=0;c<o;c++)n[c].Ge(t,r);let u=!1;this.sf?this.sf.Mh(this,l)&&(u=this.gp()):u=!0,u&&(Nt.prototype.Ci=Nt.prototype.Su),this._c=!1,this.qi=!1}l1(t,e,i,s,n,o,r,a,h){o===void 0&&(o=null),r===void 0&&(r=null),a===void 0&&(a=!1),h===void 0&&(h=!1),this.Lp(),t.clearContextCache(!0),this.ha(),this.ph=!0;let l=this.it;this.it=s;let u=this,c=this.Vt.r,d=c.length;try{let f=new I(n.x,n.y,i.width/s,i.height/s),p=f.copy();p.addMargin(e),this.ca(p),this.Te(),this.rs(c,d,u,f),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,i.width,i.height),r!==null&&r!==""&&(t.fillStyle=r,t.fillBackground(0,0,i.width,i.height));let g=Nt.l();g.Ue(),g.Xs(e.left,e.top),g.it(s),(n.x!==0||n.y!==0)&&g.Xs(-n.x,-n.y),t.setTransform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy),t.commitTransform(),t instanceof re&&t.setDiagramPosScale(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy),Nt.i(g),this.N2(t),t.globalAlpha=this.Zt;let y=this.findLayer("Grid");if(o){let b=new V,v=o.iterator;for(v.reset();v.next();){let w=v.value;w instanceof pt&&(!h&&w.layer===y||(w.jc(),b.add(w)))}for(let w=0;w<d;w++)c[w].ER(t,u,b,a);b.each(w=>w.jc())}else for(let b=0;b<d;b++){let v=c[b];v===y?h&&v.Ge(t,u,!0):v.Ge(t,u,a)}this.ph=!1,this.sf&&this.Wt&&this.sf.Mh(this,this.Wt)&&this.gp()}finally{this.it=l,t.clearContextCache(!0),this.ha(),this.rs(c,d,u,u.viewportBounds),this.ca(),this.Wt instanceof re&&(this.Wt.diagramGroup.replaceChildren(),this.redraw())}}getRenderingHint(t){return this.Fr[t]}setRenderingHint(t,e){t==="minDrawingLength"&&(this._m=e),this.Fr[t]=e,this.redraw()}resetRenderingHints(){this.Fr=new bt,this.Fr.drawShadows=!0,this.Fr.textGreeking=!0,this.Fr.viewportOptimizations=!m.fr,this.Fr.temporaryPixelRatio=!0,this.Fr.pictureRatioOptimization=!0,this.Fr.minDrawingLength=1,this._m=1}N2(t){let e=this.Fr;if(e===null)return;if(e.imageSmoothingEnabled!==void 0){let s=!!e.imageSmoothingEnabled;t.setImageSmoothingEnabled(s)}let i=e.defaultFont;i!=null&&(t.font=i)}getInputOption(t){return this.Wu[t]}setInputOption(t,e){this.Wu[t]=e}QR(){this.Wu=new bt,this.Wu.extraTouchArea=10,this.Wu.extraTouchThreshold=10,this.Wu.hasGestureZoom=!0}set(t){return t?(Object.assign(this,t),this):this}attach(t){return this.setProperties(t)}setProperties(t){return Y.Ap(this,t),this}static Ap(t,e){if(!e)return;let i=t instanceof G,s=t instanceof Y;for(let n in e){n===""&&m.o("Setting properties requires non-empty property names");let o=t,r=n;if(i||s){let h=n.indexOf(".");if(h>0){let l=n.substring(0,h);i?o=t.findObject(l):(o=t[l],o==null&&(o=t.toolManager[l])),m.$(o)?r=n.substring(h+1):m.o("Unable to find object named: "+l+" in "+t.toString()+" when trying to set property: "+n)}}if(r[0]!=="_"&&!m.qw(o,r))if(s&&r==="ModelChanged"){t.addModelChangedListener(e[r]);continue}else if(s&&r==="Changed"){t.addChangedListener(e[r]);continue}else if(s&&m.qw(t.toolManager,r))o=t.toolManager;else if(s&&t.dT(r)){t.addDiagramListener(r,e[r]);continue}else if(t instanceof ut&&r==="Changed"){t.addChangedListener(e[r]);continue}else m.o('Trying to set undefined property "'+r+'" on object: '+o.toString());let a=e[n];o[r]=a,r[0]==="_"&&o instanceof $&&o.addCopyProperty(r)}}zA(){if(this.ra.count!==0&&!(this.undoManager.transactionLevel>1)){for(;this.ra.count>0;){let t=this.ra;this.ra=new Mt;let e=t.iterator;for(;e.next();){let i=e.key;i.invalidateOtherJumpOvers(e.value),i.ai()}}this.C()}}C(t){if(t===void 0)this.qi=!0,this.requestUpdate();else{let e=this.viewportBounds;t.isReal()&&e.intersectsRect(t)&&(this.qi=!0,this.requestUpdate())}this.T("InvalidateDraw")}invalidateViewport(t,e){if(this.qi!==!0){if(this.qi=!0,this.Qc==="svg"){this.maybeUpdate();return}this.getRenderingHint("temporaryPixelRatio")===!0?(this.Cx(),this.maybeUpdate(),this.yS(!0)):this.maybeUpdate()}}Nh(){this._u=!0}ha(){this._c=!0}Lp(){this.Ju!==!1&&(this.Ju=!1,this.lT(this.wt,this.xt))}lT(t,e){this.aa();let i=this.$e,s=t*i,n=e*i;this.lt.resize(s,n,t,e)&&(this.qi=!0,this.Wt.clearContextCache(!0))}hT(){let t=this.lt;if(t===null||this.td.isReal())return!0;let e=this.wt,i=this.xt,s=this.Nt,n=!1,o=this.io?this.jt:0,r=this.kn?this.jt:0,a=s.clientWidth||e+o,h=s.clientHeight||i+r,l=this.viewportBounds,u=l.x,c=l.y,d=l.width,f=l.height;if((a!==e+o||h!==i+r)&&(this.io=!1,this.kn=!1,o=0,r=0,this.wt=a,this.xt=h,this.Ju=!0,n=!0,this.aa()),!this.so||!this.viewportBounds.isReal())return!0;let p=this.Wb,g=this.Jb;if(this._u=!1,!n&&!this.io&&!this.kn&&!this.Zu&&!this.Qu)return!0;let y=this.documentBounds,b=0,v=0,w=0,k=0,S=l.width,N=l.height,D=this.fh;this.contentAlignment.isSpot()?(y.width>S&&(b=D.left,v=D.right),y.height>N&&(w=D.top,k=D.bottom)):(b=D.left,v=D.right,w=D.top,k=D.bottom);let L=y.width+b+v,M=y.height+w+k,A=this.scale,F=A,O=L>a/A,E=M>h/A;if(!n&&!this.io&&!this.kn&&!O&&!E)return!0;let B=y.x-b,K=l.x,z=y.right+v,U=l.right+o,tt=y.y-w,nt=l.y,Z=y.bottom+k,it=l.bottom+r,_="1px",at="1px";if(this.scrollMode===1&&(O||E)){if(O&&this.hasHorizontalScrollbar&&this.allowHorizontalScroll){let Q=1;B+1<K&&(Q=Math.max((K-B)*A+this.wt,Q)),z>U+1&&(Q=Math.max((z-U)*A+this.wt,Q)),S+o+1<L&&(Q=Math.max((L-S)*A+this.wt,Q)),_=Q.toString()+"px"}if(E&&this.hasVerticalScrollbar&&this.allowVerticalScroll){let Q=1;tt+1<nt&&(Q=Math.max((nt-tt)*A+this.xt,Q)),Z>it+1&&(Q=Math.max((Z-it)*A+this.xt,Q)),N+r+1<M&&(Q=Math.max((M-N)*A+this.xt,Q)),at=Q.toString()+"px"}}let ct=_!=="1px",yt=at!=="1px";if(!(ct&&yt)&&(ct||yt)){if(O=!(L<S+o),E=!(M<N+r),yt&&(U-=this.jt),ct&&(it-=this.jt),O&&this.hasHorizontalScrollbar&&this.allowHorizontalScroll){let St=1;B+1<K&&(St=Math.max((K-B)*A+this.wt,St)),z>U+1&&(St=Math.max((z-U)*A+this.wt,St)),S+1<L&&(St=Math.max((L-S)*A+this.wt,St)),_=St.toString()+"px"}ct=_!=="1px";let Q=this.xt;if(ct!==this.kn&&(Q=ct?this.xt-this.jt:this.xt+this.jt),E&&this.hasVerticalScrollbar&&this.allowVerticalScroll){let St=1;tt+1<nt&&(St=Math.max((nt-tt)*A+Q,St)),Z>it+1&&(St=Math.max((Z-it)*A+Q,St)),N+1<M&&(St=Math.max((M-N)*A+Q,St)),at=St.toString()+"px"}yt=at!=="1px"}if(this.rp&&!(ct!==this.kn||yt!==this.io))return(e!==this.wt||i!==this.xt)&&this.maybeUpdate(),!1;if(ct!==this.kn&&(_==="1px"?this.xt=this.xt+this.jt:this.xt=Math.max(this.xt-this.jt,1),n=!0),this.kn=ct,g.style.width=_,yt!==this.io&&(at==="1px"?this.wt=this.wt+this.jt:this.wt=Math.max(this.wt-this.jt,1),n=!0,this.rd)){let Q=P.l();yt?(t.style.left=this.jt+"px",this.position=Q.e(this.ct.x+this.jt/this.scale,this.ct.y)):(t.style.left="0px",this.position=Q.e(this.ct.x-this.jt/this.scale,this.ct.y)),P.i(Q)}n&&this.aa(),this.io=yt,g.style.height=at,this.Bb=!0,n&&(this.Ju=!0);let Ct=p.scrollLeft;if(this.hasHorizontalScrollbar&&this.allowHorizontalScroll&&(S+1<L?Ct=(this.position.x-B)*A:B+1<K?Ct=p.scrollWidth-p.clientWidth:z>U+1&&(Ct=this.position.x*A)),this.rd)switch(this.lb){case"negative":Ct=-(p.scrollWidth-Ct-p.clientWidth);break;case"reverse":Ct=p.scrollWidth-Ct-p.clientWidth;break}if(p.scrollLeft=Ct,this.hasVerticalScrollbar&&this.allowVerticalScroll&&(N+1<M?p.scrollTop=(this.position.y-tt)*A:tt+1<nt?p.scrollTop=p.scrollHeight-p.clientHeight:Z>it+1&&(p.scrollTop=this.position.y*A)),a=this.wt,h=this.xt,p.style.width=a+(this.io?this.jt:0)+"px",p.style.height=h+(this.kn?this.jt:0)+"px",e!==a||i!==h||this.animationManager.ke){let Q=I.z(u,c,d,f);return this.onViewportBoundsChanged(Q,this.viewportBounds,F,n),I.i(Q),!1}return!0}add(t){let e=t.diagram;if(e===this)return;e!==null&&m.o("Cannot add part "+t.toString()+" to "+this.toString()+". It is already a part of "+e.toString());let i=this.findLayer(t.layerName);if(i===null&&(i=this.findLayer("")),i===null&&m.o('Cannot add a Part when unable find a Layer named "'+t.layerName+'" and there is no default Layer'),t.layer===i)return;let s=i.ch(99999999,t,t.diagram===this);s>=0&&this.raiseChangedEvent(3,"parts",i,null,t,null,s),i.isTemporary||this.invalidateDocumentBounds(),t.invalidateLayout(1);let n=t.layerChanged;n!==null&&n(t,null,i)}ch(t){this.partManager.ch(t);let e=this;Y.isUsingDOM()&&t.Pn(i=>e.gT(i)),t.data||t.Go(),t.hasPlaceholder()&&t.f(),t.data!==null&&t.Pn(i=>e.partManager.C2(i,null)),(t.as()===!0||t.fa()===!0)&&this.Cp(t),t.mT(!0,this),t instanceof J&&t.canAvoid()&&this.fd(t),t.pT()?(t.actualBounds.isReal()&&this.C(t.hh(t.actualBounds)),this.invalidateDocumentBounds()):t.isVisible()&&t.actualBounds.isReal()&&this.C(t.hh(t.actualBounds)),this.kp!==null&&this.kp(this,t),this.requestUpdate()}ri(t){t.clearAdornments(),this.partManager.ri(t);let e=this;t.data!==null&&t.Pn(i=>e.partManager.L2(i,e)),this.to.delete(t),t instanceof j?this.Or.delete(t):t instanceof J&&t.canAvoid()&&this.fd(t),t.pT()?(t.actualBounds.isReal()&&this.C(t.hh(t.actualBounds)),this.invalidateDocumentBounds()):t.isVisible()&&t.actualBounds.isReal()&&this.C(t.hh(t.actualBounds)),this.Pp!==null&&this.Pp(this,t),this.requestUpdate()}remove(t){this.A2(t,!0)}A2(t,e){let i=t.layer;if(i===null||i.diagram!==this)return;t.isSelected=!1,t.isHighlighted=!1,t.invalidateLayout(2),e&&t.rf();let s=i.ri(-1,t,!1);s>=0&&this.raiseChangedEvent(4,"parts",i,t,null,s,null);let n=t.layerChanged;n!==null&&n(t,i,null)}removeParts(t,e){if(e===void 0&&(e=!1),Array.isArray(t)){let i=t.length;for(let s=0;s<i;s++){let n=t[s];e&&!n.canDelete()||this.remove(n)}}else{let i=new V;i.addAll(t);let s=i.iterator;for(;s.next();){let n=s.value;e&&!n.canDelete()||this.remove(n)}}}copyParts(t,e,i){i===void 0&&(i=!1);let s=null,n=e||this,o=n.model,r=!1,a=!1;try{o.Vm()&&(r=o.copiesParentKeyOfNodeData,o.copiesParentKeyOfNodeData=n.commandHandler.copiesParentKey),(o.Um()||o.a1())&&(a=o.copiesGroupKeyOfNodeData,o.copiesGroupKeyOfNodeData=n.commandHandler.copiesGroupKey),s=this.partManager.copyParts(t,e,i)}finally{o.Vm()&&(o.copiesParentKeyOfNodeData=r),(o.Um()||o.a1())&&(o.copiesGroupKeyOfNodeData=a)}return s}moveParts(t,e,i,s){if(i===void 0&&(i=!1),s===void 0&&(s=this.Tp()),this.toolManager===null)return;let n=new Mt;if(t!==null)if(Array.isArray(t))for(let o=0;o<t.length;o++)this._r(n,t[o],i,s);else{let o=t.iterator;for(;o.next();)this._r(n,o.value,i,s)}else{let o=this.parts;for(;o.next();){let r=o.value;this._r(n,r,i,s)}for(o=this.nodes;o.next();){let r=o.value;this._r(n,r,i,s)}for(o=this.links;o.next();){let r=o.value;this._r(n,r,i,s)}}this.Lx(n,e,s,i)}_r(t,e,i,s,n){if(!t.has(e)&&(n===void 0&&(n=!1),!(i&&!n&&!e.canMove()&&!e.canCopy())))if(s===void 0&&(s=this.Tp()),e instanceof J){if(t.set(e,this.js(s,e,e.location)),e instanceof ht&&(e.hasPlaceholder()||s.dragsMembers)){let r=e.memberParts;for(;r.next();){let a=r.value;this._r(t,a,i,s,s.groupsAlwaysMove)}}let o=e.linksConnected;for(;o.next();){let r=o.value;if(t.has(r))continue;let a=r.fromNode,h=r.toNode;a!==null&&t.has(a)&&h!==null&&t.has(h)&&this._r(t,r,i,s)}if(s.dragsTree){let r=e.findTreeChildrenNodes();for(;r.next();){let a=r.value;this._r(t,a,i,s)}}}else if(e instanceof j){t.set(e,this.js(s,e));let o=e.labelNodes;for(;o.next();){let r=o.value;this._r(t,r,i,s)}}else e instanceof vt||t.set(e,this.js(s,e,e.location))}Lx(t,e,i,s){if(t===null||t.count===0)return;let n=P.l(),o=P.l();o.h(e),isNaN(o.x)&&(o.x=0),isNaN(o.y)&&(o.y=0);let r=this.Qb;r||this.gA(t);let a=m.nt(),h=m.nt(),l=t.iterator,u=P.l();for(;l.next();){let g=l.key,y=l.value;if(g.Di()){let b=this.yT(g,t);if(b!==null)a.push(new On(g,y,b));else if(!s||g.canMove()){let v=y.point;n.h(v),this.computeMove(g,n.add(o),i,u),g.location=u,y.shifted===void 0&&(y.shifted=new P),y.shifted.h(u.subtract(v))}}else l.key instanceof j&&h.push(new pe(l.key,l.value))}P.i(u);let c=a.length;for(let g=0;g<c;g++){let y=a[g],b=y.wT.point;n.h(b),y.h1.shifted===void 0&&(y.h1.shifted=new P),y.Ri.location=n.add(y.h1.shifted)}let d=P.l(),f=P.l(),p=h.length;for(let g=0;g<p;g++){let y=h[g],b=y.key;if(b instanceof j){if(b.suspendsRouting){b.Dr=null;let v=b.fromNode,w=b.toNode;if(this.draggedLink!==null&&i.dragsLink){let k=y.value.point;if(b.dragComputation===null){t.set(b,this.js(i,b,o));let S=o.x-k.x,N=o.y-k.y;b.kr(S,N)}else{let S=P.z(0,0),N=b.getPoint(0);N&&N.isReal()&&S.h(N),u=P.l().h(S).add(o);let D=u;i.isGridSnapEnabled&&(i.isGridSnapRealtime||this.lastInput.up)&&(D=P.l(),this.aM(b,u,D,i)),u.h(b.dragComputation(b,u,D)).subtract(S),t.set(b,this.js(i,b,u));let L=u.x-k.x,M=u.y-k.y;b.kr(L,M),P.i(S),P.i(u),D!==u&&P.i(D)}}else{if(v!==null){d.h(v.location);let k=t.get(v);k!==null&&d.subtract(k.point)}if(w!==null){f.h(w.location);let k=t.get(w);k!==null&&f.subtract(k.point)}if(v!==null&&w!==null){let k=y.value.point;if(d.equalsApprox(f)||b.computeAdjusting()!==0){let S=n;S.h(d),S.subtract(k),t.set(b,this.js(i,b,d)),b.kr(S.x,S.y)}else b.suspendsRouting=!1,b.$t()}else{let k=y.value.point,S;v!==null?S=d:w!==null?S=f:S=o,t.set(b,this.js(i,b,S));let N=S.x-k.x,D=S.y-k.y;b.kr(N,D)}}}else if(b.fromNode===null||b.toNode===null){let v=y.value.point;t.set(b,this.js(i,b,o));let w=o.x-v.x,k=o.y-v.y;b.kr(w,k)}}}P.i(n),P.i(o),P.i(d),P.i(f),m.Z(a),m.Z(h),r||(this.Te(),this.pS(t))}computeMove(t,e,i,s){if(s===void 0&&(s=new P),s.h(e),t===null)return s;let n=e,o=i.isGridSnapEnabled;o&&(i.isGridSnapRealtime||this.lastInput.up)&&(n=P.l(),this.aM(t,e,n,i));let r=t.dragComputation!==null?t.dragComputation(t,e,n):n,a=t.minLocation,h=a.x;isNaN(h)&&(h=o?Math.round(t.location.x*1e3)/1e3:t.location.x);let l=a.y;isNaN(l)&&(l=o?Math.round(t.location.y*1e3)/1e3:t.location.y);let u=t.maxLocation,c=u.x;isNaN(c)&&(c=o?Math.round(t.location.x*1e3)/1e3:t.location.x);let d=u.y;return isNaN(d)&&(d=o?Math.round(t.location.y*1e3)/1e3:t.location.y),s.e(Math.max(h,Math.min(r.x,c)),Math.max(l,Math.min(r.y,d))),n!==e&&P.i(n),s}Tp(){let t=this.toolManager.findTool("Dragging");return t instanceof Tt?t.dragOptions:this.ld}aM(t,e,i,s){if(s===void 0&&(s=this.Tp()),i.h(e),t===null)return i;let n=this.grid,o=s.gridSnapCellSize,r=o.width,a=o.height,h=s.gridSnapOrigin,l=h.x,u=h.y,c=s.gridSnapCellSpot;if(n!==null){let f=n.gridCellSize;isNaN(r)&&(r=f.width),isNaN(a)&&(a=f.height);let p=n.gridOrigin;isNaN(l)&&(l=p.x),isNaN(u)&&(u=p.y)}let d=P.z(0,0);return d.setSpot(0,0,r,a,c),C.tm(e.x,e.y,l+d.x,u+d.y,r,a,i),P.i(d),i}gA(t){if(t===null)return;this.Qb=!0;let e=t.iterator;for(;e.next();){let i=e.key;i instanceof j&&(i.suspendsRouting=!0)}}pS(t){if(t===null)return;let e=t.iterator;for(;e.next();){let i=e.key;i instanceof j&&(i.suspendsRouting=!1,i.xT()&&i.$t())}this.Qb=!1}get draggedLink(){return this._b}set draggedLink(t){this._b!==t&&(this._b=t,t!==null&&(this.t1=t.fromPort,this.e1=t.toPort))}get PS(){return this.t1}set PS(t){this.t1=t}get SS(){return this.e1}set SS(t){this.e1=t}yT(t,e){let i=t.containingGroup;if(i!==null){let s=this.yT(i,e);if(s!==null||(s=e.get(i),s!==null))return s}return null}js(t,e,i){if(i===void 0)return new Ye(P.dn);let s=t.isGridSnapEnabled;return!t.groupsSnapMembers&&e.containingGroup!==null&&(s=!1),s?new Ye(new P(Math.round(i.x*1e3)/1e3,Math.round(i.y*1e3)/1e3)):new Ye(i.copy())}T2(t,e){if(t.diagram!==null&&t.diagram!==this&&m.o("Cannot share a Layer with another Diagram: "+t+" of "+t.diagram),e===null?t.diagram!==null&&m.o("Cannot add an existing Layer to this Diagram again: "+t):(e.diagram!==this&&m.o("Existing Layer must be in this Diagram: "+e+" not in "+e.diagram),t===e&&m.o("Cannot move a Layer before or after itself: "+t)),t.diagram===this)return;let i=t.name,s=this.Vt,n=s.count;for(let o=0;o<n;o++)s.elt(o).name===i&&m.o("Cannot add Layer with the name '"+i+"'; a Layer with the same name is already present in this Diagram.")}addLayer(t){this.T2(t,null),t.Io(this);let e=this.Vt,i=e.count-1;if(!t.isTemporary)for(;i>=0&&e.elt(i).isTemporary;)i--;return e.insertAt(i+1,t),this.Ce!==null&&this.raiseChangedEvent(3,"layers",this,null,t,null,i+1),this.C(),this.invalidateDocumentBounds(),this}addLayerBefore(t,e){this.T2(t,e),t.Io(this);let i=this.Vt,s=i.indexOf(t);s>=0&&(i.delete(t),this.Ce!==null&&this.raiseChangedEvent(4,"layers",this,t,null,s,null));let n=i.count,o;for(o=0;o<n;o++)if(i.elt(o)===e){i.insertAt(o,t);break}return this.Ce!==null&&this.raiseChangedEvent(3,"layers",this,null,t,null,o),this.C(),s<0&&this.invalidateDocumentBounds(),this}addLayerAfter(t,e){this.T2(t,e),t.Io(this);let i=this.Vt,s=i.indexOf(t);s>=0&&(i.delete(t),this.Ce!==null&&this.raiseChangedEvent(4,"layers",this,t,null,s,null));let n=i.count,o;for(o=0;o<n;o++)if(i.elt(o)===e){i.insertAt(o+1,t);break}return this.Ce!==null&&this.raiseChangedEvent(3,"layers",this,null,t,null,o+1),this.C(),s<0&&this.invalidateDocumentBounds(),this}Zr(t,e){t.Io(this),this.Vt.insertAt(e,t)}bT(t){this.Vt.removeAt(t)}removeLayer(t){if(t.diagram!==this&&m.o("Cannot remove a Layer from another Diagram: "+t+" of "+t.diagram),t.name==="")return;let e=this.Vt,i=e.indexOf(t);if(e.delete(t)){let s=t.Ct.copy().iterator;for(;s.next();){let n=s.value,o=n.layerName;o!==t.name?n.layerName=o:n.layerName=""}this.Ce!==null&&this.raiseChangedEvent(4,"layers",this,t,null,i,null),this.C(),this.invalidateDocumentBounds()}}findLayer(t){let e=this.layers;for(;e.next();){let i=e.value;if(i.name===t)return i}return null}findRouter(t){for(let e of this.nf)if(e.name===t)return e;return null}addModelChangedListener(t){return m.S(t,Y,"addModelChangedListener:listener"),this.eo===null&&(this.eo=new q),this.eo.add(t),this.model&&this.model.addChangedListener(t),this}removeModelChangedListener(t){m.S(t,Y,"removeModelChangedListener:listener"),this.eo!==null&&(this.eo.delete(t),this.eo.count===0&&(this.eo=null)),this.model.removeChangedListener(t)}addChangedListener(t){return m.S(t,Y,"addChangedListener:listener"),this.Ir===null&&(this.Ir=new q),this.Ir.add(t),this}removeChangedListener(t){m.S(t,Y,"removeChangedListener:listener"),this.Ir!==null&&(this.Ir.delete(t),this.Ir.count===0&&(this.Ir=null))}D2(t){if(!this.skipsUndoManager&&!this.model.skipsUndoManager&&this.model.undoManager.handleChanged(t),t.change!==1&&(this.isModified=!0),this.Ir!==null){let e=this.Ir,i=e.length;for(let s=0;s<i;s++)e.elt(s)(t)}}raiseChangedEvent(t,e,i,s,n,o,r){o===void 0&&(o=null),r===void 0&&(r=null);let a=new Xe;a.diagram=this,a.change=t,a.propertyName=e,a.object=i,a.oldValue=s,a.oldParam=o,a.newValue=n,a.newParam=r,this.D2(a)}raiseChanged(t,e,i,s,n){this.raiseChangedEvent(2,t,this,e,i,s,n)}t(t,e,i,s,n){this.raiseChangedEvent(2,t,this,e,i,s,n)}get partAdded(){return this.kp}set partAdded(t){this.partAdded!==t&&(this.kp=t)}get partRemoved(){return this.Pp}set partRemoved(t){this.partRemoved!==t&&(this.Pp=t)}get animationManager(){return this.Ns}get undoManager(){return this.Ce.undoManager}get skipsUndoManager(){return this.Vo}set skipsUndoManager(t){m.s(t,"boolean",Y,"skipsUndoManager"),this.Vo=t,this.Ce.skipsUndoManager=t}get delaysLayout(){return this.Ab}set delaysLayout(t){this.Ab=t}iA(t,e){if(t===null||t.diagram!==this)return;let i=this.wi;try{this.wi=!0;let s=t.change;if(s===2){let n=t.object,o=t.propertyName,r=t.getValue(e);if(t.diagram.model.et(n,o,r),n instanceof $){let a=n.part;a!==null&&(a.invalidateAdornments(),a instanceof j&&(a.fromNode?.Ze(a.fromPort),a.toNode?.Ze(a.toPort)))}this.isModified=!0}else if(s===3){let n=t.object,o=t.newParam,r=t.newValue;if(n instanceof G)if(typeof o=="number"&&r instanceof $){e?n.ri(o):n.insertAt(o,r);let a=n.part;a!==null&&a.invalidateAdornments()}else typeof o=="number"&&r instanceof Xt&&(r.isRow?n.kT(o,e?void 0:r):n.PT(o,e?void 0:r));else if(n instanceof Et){let a=t.oldParam===!0;typeof o=="number"&&r instanceof pt&&(e?(a||(r.isSelected=!1,r.isHighlighted=!1,r.invalidateAdornments()),n.ri(a?o:-1,r,a)):n.ch(o,r,a))}else n instanceof Y?typeof o=="number"&&r instanceof Et&&(e?this.bT(o):this.Zr(r,o)):m.o("unknown ChangeType.Insert object: "+t.toString());this.isModified=!0}else if(s===4){let n=t.object,o=t.oldParam,r=t.oldValue;if(n instanceof G)typeof o=="number"&&r instanceof $?e?n.insertAt(o,r):n.ri(o):typeof o=="number"&&r instanceof Xt&&(r.isRow?n.kT(o,e?r:void 0):n.PT(o,e?r:void 0));else if(n instanceof Et){let a=t.newParam===!0;typeof o=="number"&&r instanceof pt&&(e?n.Ct.indexOf(r)<0&&n.ch(o,r,a):(a||(r.isSelected=!1,r.isHighlighted=!1,r.invalidateAdornments()),n.ri(a?o:-1,r,a)))}else n instanceof Y?typeof o=="number"&&r instanceof Et&&(e?this.Zr(r,o):this.bT(o)):m.o("unknown ChangeType.Remove object: "+t.toString());this.isModified=!0}else s===1||m.o("unknown ChangedEvent: "+t.toString())}finally{this.wi=i}}startTransaction(t){return this.undoManager.startTransaction(t)}commitTransaction(t){return this.undoManager.commitTransaction(t)}rollbackTransaction(){return this.undoManager.rollbackTransaction()}commit(t,e){let i=e;i===void 0&&(i="");let s=this.skipsUndoManager;i===null&&(this.skipsUndoManager=!0,i=""),this.undoManager.startTransaction(i);let n=!1;try{t(this),n=!0}finally{n?this.undoManager.commitTransaction(i):this.undoManager.rollbackTransaction(),this.skipsUndoManager=s}}updateAllTargetBindings(t){this.partManager.updateAllTargetBindings(t)}updateAllThemeBindings(){if(this.partManager.updateAllThemeBindings(),this.ls!==null){let t=this.ls.part;t!==null&&t.Go()}}setDivBackground(t){this.div&&(this.div.style.backgroundColor=t)}updateAllRelationshipsFromData(){this.partManager.updateAllRelationshipsFromData()}Np(){let t=this.v,e=this.it,i=this.ct;t.Ue(),e!==1&&t.it(e),(i.x!==0||i.y!==0)&&t.Xs(-i.x,-i.y)}ST(t,e){let i=this.animationManager;if(this.Ht||this.As){this.it=e,this.aa(),this.C(),this.Nh(),i.VA(t,this.it),this.Np();return}if(this.lt===null){this.it=e,this.Np();return}this.Ht=!0;let s=this.viewportBounds.copy(),n=this.wt,o=this.xt,r=this.zoomPoint.x,a=this.zoomPoint.y,h=this.contentAlignment;isNaN(r)&&(h.isSide()?h.includesSide(T.LeftSide)?r=0:h.includesSide(T.RightSide)&&(r=n-1):h.isSpot()?r=h.x*(n-1):r=n/2),isNaN(a)&&(h.isSide()?h.includesSide(T.TopSide)?a=0:h.includesSide(T.BottomSide)&&(a=o-1):h.isSpot()?a=h.y*(o-1):a=o/2),this.scaleComputation!==null&&!this.animationManager.defaultAnimation.isAnimating&&(e=this.scaleComputation(this,e)),e<this.minScale&&(e=this.minScale),e>this.maxScale&&(e=this.maxScale);let l=P.z(this.ct.x+r/t-r/e,this.ct.y+a/t-a/e);this.position=l,P.i(l),this.it=e,this.Np(),this.aa(),this.Ht=!1,this.onViewportBoundsChanged(s,this.viewportBounds,t,!1),this.Js(!1),i.VA(t,this.it),this.C()}yO(){let t=this.Vt.r;for(let e=0;e<t.length;e++)t[e].HA()}onViewportBoundsChanged(t,e,i,s){if(t.equals(e))return;s===void 0&&(s=!1),s||this.Nh(),this.ha();let n=this.layout;n!==null&&n.isViewportSized&&this.autoScale===1&&(t.width!==e.width||t.height!==e.height)&&n.p();let o=this.currentTool;this.ef===!0&&o instanceof ne&&!this.animationManager.isTicking&&(this.lastInput.documentPoint=this.transformViewToDoc(this.lastInput.viewPoint),o.uA(this)),this.Ht||this.invalidateViewport(t,e),this.ca();let r=this.Vt.r;this.rs(r,r.length,this,this.viewportBounds),this.Ye.scale=i,this.Ye.position.x=t.x,this.Ye.position.y=t.y,this.Ye.bounds.h(t),this.Ye.canvasSize.width=Math.round(t.width*i),this.Ye.canvasSize.height=Math.round(t.height*i),this.Ye.newCanvasSize.width=this.wt,this.Ye.newCanvasSize.height=this.xt,this.Ye.isScroll=s,this.T("ViewportBoundsChanged",this.Ye,t),this.isVirtualized&&this.links.each(a=>{a.isAvoiding&&a.actualBounds.intersectsRect(e)&&a.$t()})}ca(t){let e=this.ls;if(e===null||!e.visible||e.part===null||e.layer===null)return;let i=t!==void 0?t:this.Yb;if(!i.isReal())return;let s=i.width,n=i.height;if(e.scale=1,e.angle=0,e.layer.isViewportAligned)e.width=s*this.scale,e.height=n*this.scale,e.part.alignment=T.TopLeft;else{e.Pe===null&&(e.Pe=new ti);let o=e.Pe.lf;if(!o.isReal())return;e.width=s+o.width*2,e.height=n+o.height*2;let r=P.l();C.tm(i.x,i.y,0,0,o.width,o.height,r),r.offset(-o.width,-o.height),e.part.location=r,P.i(r)}}clearSelection(t){t===void 0&&(t=!1);let e=this.selection;if(e.count===0)return;t||this.T("ChangingSelection",e);let i=e.toArray(),s=i.length;for(let n=0;n<s;n++){let o=i[n];o.isSelected=!1}e.ce(),e.clear(),e.k(),t||this.T("ChangedSelection",e)}select(t){t!==null&&t.diagram===this&&(!t.isSelected||this.selection.count>1)&&(this.T("ChangingSelection",this.selection),this.clearSelection(!0),t.isSelected=!0,this.T("ChangedSelection",this.selection))}selectCollection(t){if(this.T("ChangingSelection",this.selection),this.clearSelection(!0),Array.isArray(t)){let e=t.length;for(let i=0;i<e;i++){let s=t[i];s instanceof pt||m.o("Diagram.selectCollection given something that is not a Part: "+s),s.isSelected=!0}}else{let e=t.iterator;for(;e.next();){let i=e.value;i instanceof pt||m.o("Diagram.selectCollection given something that is not a Part: "+i),i.isSelected=!0}}this.T("ChangedSelection",this.selection)}clearHighlighteds(){let t=this.highlighteds;if(t.count>0){let e=t.toArray(),i=e.length;for(let s=0;s<i;s++){let n=e[s];n.isHighlighted=!1}t.ce(),t.clear(),t.k()}}highlight(t){t!==null&&t.diagram===this&&(!t.isHighlighted||this.highlighteds.count>1)&&(this.clearHighlighteds(),t.isHighlighted=!0)}highlightCollection(t){let e=new V().addAll(t),i=this.highlighteds.copy().removeAll(e).iterator;for(;i.next();){let n=i.value;n.isHighlighted=!1}let s=e.iterator;for(;s.next();){let n=s.value;n instanceof pt||m.o("Diagram.highlightCollection given something that is not a Part: "+n),n.isHighlighted=!0}}scroll(t,e,i){i===void 0&&(i=1);let s=e==="up"||e==="down",n=0,o=P.l();if(t==="pixel")n=i;else if(t==="line")n=i*(s?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(t==="page"){let a=s?this.viewportBounds.height:this.viewportBounds.width;if(a*=this.scale,a!==0){let h=Math.max(a-(s?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0);n=i*h}}else if(t==="document"){let a=this.documentBounds,h=this.viewportBounds;e==="up"?this.position=o.e(h.x,a.y):e==="left"?this.position=o.e(a.x,h.y):e==="down"?this.position=o.e(h.x,a.bottom-h.height):e==="right"&&(this.position=o.e(a.right-h.width,h.y)),P.i(o);return}else m.o("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+t);n/=this.scale;let r=this.position;e==="up"?this.position=o.e(r.x,r.y-n):e==="down"?this.position=o.e(r.x,r.y+n):e==="left"?this.position=o.e(r.x-n,r.y):e==="right"?this.position=o.e(r.x+n,r.y):m.o("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+e),P.i(o)}scrollToRect(t){let e=this.viewportBounds;if(e.containsRect(t))return;let i=t.center;i.x-=e.width/2,i.y-=e.height/2,this.position=i}centerRect(t){let e=this.viewportBounds,i=t.center;i.x-=e.width/2,i.y-=e.height/2,this.position=i}transformDocToView(t){return t.copy().v(this.v)}transformViewToDoc(t){return t.copy().Yi(this.v)}YR(t){return t.Yi(this.v)}static None=1;static Uniform=2;static UniformToFill=3;static CycleAll=1;static CycleNotDirected=2;static CycleNotDirectedFast=3;static CycleNotUndirected=4;static CycleDestinationTree=5;static CycleSourceTree=6;static DocumentScroll=1;static InfiniteScroll=2;static TreeParentCollapsed=1;static AllParentsCollapsed=2;static AnyParentsCollapsed=3;get opacity(){return this.Zt}set opacity(t){let e=this.Zt;e!==t&&(m.s(t,"number",Y,"opacity"),(t<0||t>1)&&m.J(t,"0 <= value <= 1",Y,"opacity"),this.Zt=t,this.t("opacity",e,t),this.C())}get validCycle(){return this.Pb}set validCycle(t){let e=this.Pb;e!==t&&(this.Pb=t,this.t("validCycle",e,t))}get layers(){return this.Vt.iterator}get isModelReadOnly(){let t=this.Ce;return t===null?!1:t.isReadOnly}set isModelReadOnly(t){let e=this.Ce;e!==null&&(e.isReadOnly=t)}get isReadOnly(){return this.Bo}set isReadOnly(t){let e=this.Bo;e!==t&&(m.s(t,"boolean",Y,"isReadOnly"),this.Bo=t,this.t("isReadOnly",e,t))}get isEnabled(){return this.Be}set isEnabled(t){let e=this.Be;e!==t&&(m.s(t,"boolean",Y,"isEnabled"),this.Be=t,this.t("isEnabled",e,t))}get allowClipboard(){return this.Tb}set allowClipboard(t){let e=this.Tb;e!==t&&(m.s(t,"boolean",Y,"allowClipboard"),this.Tb=t,this.t("allowClipboard",e,t))}get allowCopy(){return this.Yl}set allowCopy(t){let e=this.Yl;e!==t&&(m.s(t,"boolean",Y,"allowCopy"),this.Yl=t,this.t("allowCopy",e,t))}get allowDelete(){return this.Kl}set allowDelete(t){let e=this.Kl;e!==t&&(m.s(t,"boolean",Y,"allowDelete"),this.Kl=t,this.t("allowDelete",e,t))}get allowDragOut(){return this.Db}set allowDragOut(t){let e=this.Db;e!==t&&(m.s(t,"boolean",Y,"allowDragOut"),this.Db=t,this.t("allowDragOut",e,t))}get allowDrop(){return this.vb}set allowDrop(t){let e=this.vb;e!==t&&(m.s(t,"boolean",Y,"allowDrop"),this.vb=t,this.t("allowDrop",e,t))}get allowTextEdit(){return this.Hl}set allowTextEdit(t){let e=this.Hl;e!==t&&(m.s(t,"boolean",Y,"allowTextEdit"),this.Hl=t,this.t("allowTextEdit",e,t))}get allowGroup(){return this.ql}set allowGroup(t){let e=this.ql;e!==t&&(m.s(t,"boolean",Y,"allowGroup"),this.ql=t,this.t("allowGroup",e,t))}get allowUngroup(){return this.jl}set allowUngroup(t){let e=this.jl;e!==t&&(m.s(t,"boolean",Y,"allowUngroup"),this.jl=t,this.t("allowUngroup",e,t))}get allowInsert(){return this.Fb}set allowInsert(t){let e=this.Fb;e!==t&&(m.s(t,"boolean",Y,"allowInsert"),this.Fb=t,this.t("allowInsert",e,t))}get allowLink(){return this.Wl}set allowLink(t){let e=this.Wl;e!==t&&(m.s(t,"boolean",Y,"allowLink"),this.Wl=t,this.t("allowLink",e,t))}get allowRelink(){return this.Jl}set allowRelink(t){let e=this.Jl;e!==t&&(m.s(t,"boolean",Y,"allowRelink"),this.Jl=t,this.t("allowRelink",e,t))}get allowMove(){return this.$l}set allowMove(t){let e=this.$l;e!==t&&(m.s(t,"boolean",Y,"allowMove"),this.$l=t,this.t("allowMove",e,t))}get allowReshape(){return this.Zl}set allowReshape(t){let e=this.Zl;e!==t&&(m.s(t,"boolean",Y,"allowReshape"),this.Zl=t,this.t("allowReshape",e,t))}get allowResize(){return this.Ql}set allowResize(t){let e=this.Ql;e!==t&&(m.s(t,"boolean",Y,"allowResize"),this.Ql=t,this.t("allowResize",e,t))}get allowRotate(){return this._l}set allowRotate(t){let e=this._l;e!==t&&(m.s(t,"boolean",Y,"allowRotate"),this._l=t,this.t("allowRotate",e,t))}get allowSelect(){return this.ta}set allowSelect(t){let e=this.ta;e!==t&&(m.s(t,"boolean",Y,"allowSelect"),this.ta=t,this.t("allowSelect",e,t))}get allowUndo(){return this.Rb}set allowUndo(t){let e=this.Rb;e!==t&&(m.s(t,"boolean",Y,"allowUndo"),this.Rb=t,this.t("allowUndo",e,t))}get allowZoom(){return this.Ob}set allowZoom(t){let e=this.Ob;e!==t&&(m.s(t,"boolean",Y,"allowZoom"),this.Ob=t,this.t("allowZoom",e,t))}get hasVerticalScrollbar(){return this.Qu}set hasVerticalScrollbar(t){let e=this.Qu;e!==t&&(m.s(t,"boolean",Y,"hasVerticalScrollbar"),this.Qu=t,this.Nh(),this.C(),this.t("hasVerticalScrollbar",e,t),this.Js(!1))}get hasHorizontalScrollbar(){return this.Zu}set hasHorizontalScrollbar(t){let e=this.Zu;e!==t&&(m.s(t,"boolean",Y,"hasHorizontalScrollbar"),this.Zu=t,this.Nh(),this.C(),this.t("hasHorizontalScrollbar",e,t),this.Js(!1))}get allowHorizontalScroll(){return this.Ib}set allowHorizontalScroll(t){let e=this.Ib;e!==t&&(m.s(t,"boolean",Y,"allowHorizontalScroll"),this.Ib=t,this.t("allowHorizontalScroll",e,t),this.Js(!1))}get allowVerticalScroll(){return this.Eb}set allowVerticalScroll(t){let e=this.Eb;e!==t&&(m.s(t,"boolean",Y,"allowVerticalScroll"),this.Eb=t,this.t("allowVerticalScroll",e,t),this.Js(!1))}get scrollHorizontalLineChange(){return this.Ub}set scrollHorizontalLineChange(t){let e=this.Ub;e!==t&&(m.s(t,"number",Y,"scrollHorizontalLineChange"),t<0&&m.J(t,">= 0",Y,"scrollHorizontalLineChange"),this.Ub=t,this.t("scrollHorizontalLineChange",e,t))}get scrollVerticalLineChange(){return this.Vb}set scrollVerticalLineChange(t){let e=this.Vb;e!==t&&(m.s(t,"number",Y,"scrollVerticalLineChange"),t<0&&m.J(t,">= 0",Y,"scrollVerticalLineChange"),this.Vb=t,this.t("scrollVerticalLineChange",e,t))}get lastInput(){return this.gh}set lastInput(t){this.gh=t}get previousInput(){return this.Wr}set previousInput(t){this.Wr=t}get firstInput(){return this.fp}set firstInput(t){this.fp=t}get currentCursor(){return this.Sb}set currentCursor(t){if(t===""&&(t=this.op),this.Sb!==t){m.s(t,"string",Y,"currentCursor");let e=this.lt,i=this.Nt;if(e===null||i===null)return;this.Sb=t;let s=e.style.cursor;e.style.cursor=t,i.style.cursor=t,e.style.cursor===s&&(e.style.cursor="-webkit-"+t,i.style.cursor="-webkit-"+t,e.style.cursor===s&&(e.style.cursor="-moz-"+t,i.style.cursor="-moz-"+t,e.style.cursor===s&&(e.style.cursor=t,i.style.cursor=t)))}}get defaultCursor(){return this.op}set defaultCursor(t){t===""&&(t="auto");let e=this.op;e!==t&&(m.s(t,"string",Y,"defaultCursor"),this.op=t,this.t("defaultCursor",e,t))}get click(){return this.Er}set click(t){let e=this.Er;e!==t&&(t!==null&&m.S(t,Y,"click"),this.Er=t,this.t("click",e,t))}get doubleClick(){return this.Ur}set doubleClick(t){let e=this.Ur;e!==t&&(t!==null&&m.S(t,Y,"doubleClick"),this.Ur=t,this.t("doubleClick",e,t))}get contextClick(){return this.Vr}set contextClick(t){let e=this.Vr;e!==t&&(t!==null&&m.S(t,Y,"contextClick"),this.Vr=t,this.t("contextClick",e,t))}get mouseOver(){return this.Br}set mouseOver(t){let e=this.Br;e!==t&&(t!==null&&m.S(t,Y,"mouseOver"),this.Br=t,this.t("mouseOver",e,t))}get mouseHover(){return this.zr}set mouseHover(t){let e=this.zr;e!==t&&(t!==null&&m.S(t,Y,"mouseHover"),this.zr=t,this.t("mouseHover",e,t))}get mouseHold(){return this.Xr}set mouseHold(t){let e=this.Xr;e!==t&&(t!==null&&m.S(t,Y,"mouseHold"),this.Xr=t,this.t("mouseHold",e,t))}get mouseDragOver(){return this.Mb}set mouseDragOver(t){let e=this.Mb;e!==t&&(t!==null&&m.S(t,Y,"mouseDragOver"),this.Mb=t,this.t("mouseDragOver",e,t))}get mouseDrop(){return this.Gr}set mouseDrop(t){let e=this.Gr;e!==t&&(this.Gr=t,this.t("mouseDrop",e,t))}get handlesDragDropForTopLevelParts(){return this.Nb}set handlesDragDropForTopLevelParts(t){let e=this.Nb;e!==t&&(m.s(t,"boolean",Y,"handlesDragDropForTopLevelParts"),this.Nb=t,this.t("handlesDragDropForTopLevelParts",e,t))}get mouseEnter(){return this.Yr}set mouseEnter(t){let e=this.Yr;e!==t&&(t!==null&&m.S(t,Y,"mouseEnter"),this.Yr=t,this.t("mouseEnter",e,t))}get mouseLeave(){return this.Kr}set mouseLeave(t){let e=this.Kr;e!==t&&(t!==null&&m.S(t,Y,"mouseLeave"),this.Kr=t,this.t("mouseLeave",e,t))}get toolTip(){return this.Hr}set toolTip(t){let e=this.Hr;e!==t&&(this.Hr=t,this.t("toolTip",e,t))}get contextMenu(){return this.qr}set contextMenu(t){let e=this.qr;e!==t&&(this.qr=t,this.t("contextMenu",e,t))}get commandHandler(){return this.jM}set commandHandler(t){let e=this.jM;e!==t&&(e&&e.doStop(),this.jM=t,t.Io(this),t.doStart())}get toolManager(){return this.KM}set toolManager(t){this.KM!==t&&(this.KM=t,t.diagram=this)}get defaultTool(){return this.HM}set defaultTool(t){let e=this.HM;e!==t&&(this.HM=t,t.diagram=this,this.currentTool===e&&(this.currentTool=t))}get currentTool(){return this.qM}set currentTool(t){let e=this.qM;e&&(e.isActive&&e.doDeactivate(),e.cancelWaitAfter(),e.doStop()),t===null&&(t=this.defaultTool),t!==null&&(this.qM=t,t.diagram=this,t.doStart())}get selection(){return this.qA}get maxSelectionCount(){return this.Gb}set maxSelectionCount(t){let e=this.Gb;if(e!==t)if(m.s(t,"number",Y,"maxSelectionCount"),t>=0&&!isNaN(t)){if(this.Gb=t,this.t("maxSelectionCount",e,t),!this.undoManager.isUndoingRedoing){let i=this.selection.count-t;if(i>0){this.T("ChangingSelection",this.selection);let s=this.selection.toArray();for(let n=0;n<i;n++)s[n].isSelected=!1;this.T("ChangedSelection",this.selection)}}}else m.J(t,">= 0",Y,"maxSelectionCount")}get nodeSelectionAdornmentTemplate(){return this.hp}set nodeSelectionAdornmentTemplate(t){let e=this.hp;e!==t&&(this.hp=t.It(),this.t("nodeSelectionAdornmentTemplate",e,t))}get groupSelectionAdornmentTemplate(){return this.Hb}set groupSelectionAdornmentTemplate(t){let e=this.Hb;e!==t&&(this.Hb=t.It(),this.t("groupSelectionAdornmentTemplate",e,t))}get linkSelectionAdornmentTemplate(){return this.qb}set linkSelectionAdornmentTemplate(t){let e=this.qb;e!==t&&(this.qb=t.It(),this.t("linkSelectionAdornmentTemplate",e,t))}get highlighteds(){return this.jA}get isModified(){let t=this.undoManager;return t.isEnabled?t.currentTransaction!==null?!0:this.sd&&this.Hs!==t.historyIndex:this.sd}set isModified(t){if(this.sd!==t){m.s(t,"boolean",Y,"isModified"),this.sd=t;let e=this.undoManager;!t&&e.isEnabled&&(this.Hs=e.historyIndex),t||this.MT()}}MT(){let t=this.isModified;this.ZM!==t&&(this.ZM=t,this.T("Modified"))}get model(){return this.Ce}set model(t){let e=this.Ce;if(e!==t){this.currentTool.doCancel(),e&&e.undoManager!==t.undoManager&&e.undoManager.isInTransaction&&m.o("Do not replace a Diagram.model while a transaction is in progress.");let i=this.oT(!0);this.so=!1,this.$u=!0,this.Hs=-2,this.Tr=!1;let s=this.Ht;this.Ht=!0,this.animationManager.Gl("Model"),e&&(this.eo!==null&&this.eo.each(n=>e.removeChangedListener(n)),e.removeChangedListener(this.Zc)),this.Ce=t,this.partManager=this.CO(this.Ce.type),this.initializePartManager(this.partManager);for(let n=0;n<i.length;n++)this.add(i[n]);t.addChangedListener(this.$M),this.partManager.v2(),t.removeChangedListener(this.$M),t.addChangedListener(this.Zc),this.eo!==null&&this.eo.each(n=>t.addChangedListener(n)),this.Ht=s,this.invalidateDocumentBounds(),this.Ht||this.C(),e&&t.undoManager.copyProperties(e.undoManager)}}get themeManager(){return this.g2}set themeManager(t){let e=this.g2;e!==t&&(e&&e.removeDiagram(this),this.g2=t,t!==null&&t.addDiagram(this))}initializePartManager(t){}static m2(t,e){Y.ZA.set(t,e)}static get licenseKey(){return Y.F2.last()}static set licenseKey(t){Y.F2.add(t.replace(/\s/g,""))}static get version(){return Y.LO}static F2=new q;static LO="3.1.5";CO(t){let e=Y.ZA.get(t);return e!==null?new e:new ge}get G(){return this.JM}set G(t){this.JM=t}get nb(){return this.WA}AO(t){if(t.model!==this.model)return;let e=t.change,i=t.propertyName;if(e===1&&i[0]==="S"){if(i==="StartingFirstTransaction"){let s=this,n=this.toolManager;n.mouseDownTools.each(o=>o.diagram=s),n.mouseMoveTools.each(o=>o.diagram=s),n.mouseUpTools.each(o=>o.diagram=s),this.routers.each(o=>o.diagram=s),!this.As&&!this.so&&(this.$c=!0,this.$u&&(this.Tr=!0))}else if(i==="StartingUndo"||i==="StartingRedo"){let s=this.animationManager;this.skipsUndoManager||(s.defaultAnimation.isAnimating&&s.stopAnimation(),s.getBundleAnimation().isAnimating&&s.getBundleAnimation().stop()),this.T("ChangingSelection",this.selection)}else if(i==="StartedTransaction"){let s=this.animationManager;s.defaultAnimation.isAnimating&&!this.skipsUndoManager&&s.stopAnimation()}return}if(this.G){this.G=!1;try{if(t.modelChange===""&&e===1){(i==="FinishedUndo"||i==="FinishedRedo")&&(this.T("ChangedSelection",this.selection),this.Te());let s=this.animationManager;i==="RolledBackTransaction"&&s.stopAnimation(),this.zA(),this.$c=!0,this.maybeUpdate(),(this.undoManager.transactionLevel===0||this.undoManager.transactionLevel===1)&&s.MM(),i==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Hs=Math.min(this.Hs,this.undoManager.historyIndex-1)),(i==="CommittedTransaction"||i==="RolledBackTransaction")&&this.undoManager.Sx&&m.un(()=>{this.isModified=!1},1);let n=t.isTransactionFinished;if(n&&(this.MT(),this.nb.clear(),this.animationManager.LR()),!this.Cb&&n&&this.lastInput.targetDiagram){this.Cb=!0;let o=this;m.un(()=>{o.currentTool.standardMouseOver(),o.Cb=!1},10)}}}finally{this.G=!0}}}get wi(){return this.WM}set wi(t){this.WM=t}get Ru(){return this.Lb}set Ru(t){this.Lb=t}gT(t){let e=t.D.r;for(let i of e)i instanceof Bt&&this.R2(i)}R2(t){let e=t.element;if(e===null||!X.HTMLImageElement||!(e instanceof HTMLImageElement)||(e.hs instanceof V&&e.hs.add(this),t.TO(),!e.Dp))return;let i=e.getAttribute("src")||"",s=this.oa.get(i);if(s===null){Bt.NT(t,e);let n=[];n.push(t),this.oa.set(i,n)}else{for(let n=0;n<s.length;n++)if(s[n]===t)return;s.push(t)}}DO(t){let e=t.D.r,i=e.length;for(let s=0;s<i;s++)this.O2(e[s])}O2(t){if(!(t instanceof Bt))return;let e=t.element;if(e===null||!X.HTMLImageElement||!(e instanceof HTMLImageElement)||!e.Dp)return;let i=e.getAttribute("src")||"",s=this.oa.get(i);if(s!==null){for(let n=0;n<s.length;n++)if(s[n]===t){s.splice(n,1),s.length===0&&(this.oa.delete(i),Bt.vO(e),e.hs instanceof V&&e.hs.delete(this));return}}}rT(){Bt.clearCache(),this.oa.clear()}rebuildParts(){this.partManager.rebuildParts()}Yc(t,e){this.Ns.Yc(t,e)}Gc(t,e){this.Ns.Gc(t,e)}findPartForKey(t){return this.partManager.findPartForKey(t)}findNodeForKey(t){return this.partManager.findNodeForKey(t)}findLinkForKey(t){return this.partManager.findLinkForKey(t)}findPartForData(t){return this.partManager.findPartForData(t)}findNodeForData(t){return this.partManager.findNodeForData(t)}findLinkForData(t){return this.partManager.findLinkForData(t)}findNodesByExample(...t){return this.partManager.findNodesByExample(...t)}findLinksByExample(...t){return this.partManager.findLinksByExample(...t)}get nodeTemplate(){return this.jr.get("")}set nodeTemplate(t){let e=this.jr.get("");e!==t&&(this.jr.set("",t),this.t("nodeTemplate",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get nodeTemplateMap(){return this.jr}set nodeTemplateMap(t){let e=this.jr;e!==t&&(this.jr=t,this.t("nodeTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get groupTemplate(){return this.dh.get("")}set groupTemplate(t){let e=this.dh.get("");e!==t&&(this.dh.set("",t),this.t("groupTemplate",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get groupTemplateMap(){return this.dh}set groupTemplateMap(t){let e=this.dh;e!==t&&(this.dh=t,this.t("groupTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get linkTemplate(){return this.na.get("")}set linkTemplate(t){let e=this.na.get("");e!==t&&(this.na.set("",t),this.t("linkTemplate",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get linkTemplateMap(){return this.na}set linkTemplateMap(t){let e=this.na;e!==t&&(this.na=t,this.t("linkTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.rebuildParts())}get isMouseCaptured(){return this.QM}set isMouseCaptured(t){let e=this.lt;if(e===null)return;let i=e.bt;i instanceof SVGElement||(t?(this.lastInput.bubbles=!1,this.Le(i,"pointermove",this.xh,!1),this.Le(i,"pointerdown",this.la,!1),this.Le(i,"pointerup",this.bh,!1),this.Le(i,"pointerout",this.kh,!1),this.Le(i,"pointercancel",this.Ph,!1),this.Et(X,"pointermove",this.xh,!0),this.Et(X,"pointerdown",this.la,!0),this.Et(X,"pointerup",this.bh,!0),this.Et(X,"pointerout",this.kh,!0),this.Et(X,"pointercancel",this.Ph,!0),this.Le(i,"wheel",this.wh,!1),this.Et(X,"wheel",this.wh,!0),this.Et(X,"selectstart",this.oh,!1)):(this.Le(X,"pointermove",this.xh,!0),this.Le(X,"pointerdown",this.la,!0),this.Le(X,"pointerup",this.bh,!0),this.Le(X,"pointerout",this.kh,!0),this.Le(X,"pointercancel",this.Ph,!0),this.Et(i,"pointermove",this.xh,!1),this.Et(i,"pointerdown",this.la,!1),this.Et(i,"pointerup",this.bh,!1),this.Et(i,"pointerout",this.kh,!1),this.Et(i,"pointercancel",this.Ph,!1),this.Le(X,"wheel",this.wh,!0),this.Le(X,"selectstart",this.oh,!1),this.Et(i,"wheel",this.wh,!1)),this.QM=t)}get position(){return this.ct}set position(t){if(this.ct.equals(t))return;let e=P.l().h(this.ct),i=this.viewportBounds.copy();if(this.ct.h(t),this.animationManager.UA(e,this.ct),!this.Ht&&!(this.lt===null&&!this.td.isReal())){this.Ht=!0;let s=this.scale,n=this.wt/s,o=this.xt/s;this.k2(this.ap,n,o,this.Wc,!1),this.Ht=!1}else this.aa(),this.Np();if(!this.Ht){let s=this.viewportBounds;this.onViewportBoundsChanged(i,s,this.it,!1)}P.i(e)}get initialPosition(){return this.ab}set initialPosition(t){this.ab.equals(t)||(this.ab=t.N())}get initialScale(){return this.hb}set initialScale(t){this.hb!==t&&(m.s(t,"number",Y,"initialScale"),this.hb=t)}get grid(){return this.ls===null&&(this.ls=this.aT()),this.ls}set grid(t){let e=this.ls;if(e!==t){e===null&&(this.ls=this.aT(),e=this.ls),t.type!==G.Grid&&m.o("Diagram.grid must be a Panel of type Panel.Grid");let i=e.panel;i!==null&&i.remove(e),this.ls=t,t.name="GRID",i!==null&&i.add(t),this.ed=!1,this.C(),this.t("grid",e,t)}}get viewportBounds(){return this.Yb}aa(){let t=this.Yb,e=this.ct,i=this.it;t.e(e.x,e.y,Math.max(this.wt,0)/i,Math.max(this.xt,0)/i),this.ha()}get viewSize(){return this.td}set viewSize(t){let e=this.viewSize;if(!e.equals(t)){t=t.N(),this.td=t;let i=0,s=0;t.isReal()?(i=t.width,s=t.height):this.Nt!==null&&(i=this.Nt.clientWidth||1,s=this.Nt.clientHeight||1),this.wt=i,this.xt=s,this.aa(),this.invalidateDocumentBounds(),this.t("viewSize",e,t),this.C()}}get fixedBounds(){return this.db}set fixedBounds(t){let e=this.db;e.equals(t)||((t.width===-1/0||t.height===1/0||t.height===-1/0)&&m.o("fixedBounds width/height must not be Infinity"),t=t.N(),this.db=t,this.invalidateDocumentBounds(),this.t("fixedBounds",e,t))}get scrollMargin(){return this.fh}set scrollMargin(t){typeof t=="number"&&(t=new Dt(t));let e=this.fh;e.equals(t)||(t=t.N(),this.fh=t,this.t("scrollMargin",e,t),this.Iu())}get scrollMode(){return this.ah}set scrollMode(t){let e=this.ah;e!==t&&(this.ah=t,t===1&&this.Js(!1),this.t("scrollMode",e,t),this.Nh(),this.C())}get scrollsPageOnFocus(){return this.gb}set scrollsPageOnFocus(t){let e=this.gb;e!==t&&(m.s(t,"boolean",Y,"scrollsPageOnFocus"),this.gb=t,this.t("scrollsPageOnFocus",e,t))}get positionComputation(){return this.pb}set positionComputation(t){let e=this.pb;e!==t&&(t!==null&&m.S(t,Y,"positionComputation"),this.pb=t,this.Js(!1),this.t("positionComputation",e,t))}get scaleComputation(){return this.yb}set scaleComputation(t){let e=this.yb;e!==t&&(t!==null&&m.S(t,Y,"scaleComputation"),this.yb=t,this.ST(this.scale,this.scale),this.t("scaleComputation",e,t))}get documentBounds(){return this.ap}CT(t){this.mh=!1;let e=this.ap;e.equals(t)||(e=e.copy(),this.ap.h(t),this.Js(!1),this.T("DocumentBoundsChanged",void 0,e),this.Nh(),this.C())}ensureBounds(){if(this.mh){let t=I.l();this.CT(this.computeBounds(t)),I.i(t)}}get isVirtualized(){return this.Kb}set isVirtualized(t){let e=this.Kb;e!==t&&(m.s(t,"boolean",Y,"isVirtualized"),this.Kb=t,this.t("isVirtualized",e,t))}get scale(){return this.it}set scale(t){let e=this.it;e!==t&&this.ST(e,t)}get defaultScale(){return this.dp}set defaultScale(t){this.dp=t}get autoScale(){return this.ia}set autoScale(t){let e=this.ia;e!==t&&(this.ia=t,this.t("autoScale",e,t),t!==1&&this.Js(!1))}get initialAutoScale(){return this.Rr}set initialAutoScale(t){let e=this.Rr;e!==t&&(this.Rr=t,this.t("initialAutoScale",e,t))}get initialViewportSpot(){return this.xb}set initialViewportSpot(t){let e=this.xb;e!==t&&(t.isSpot()||m.o("initialViewportSpot must be a specific Spot: "+t),this.xb=t,this.t("initialViewportSpot",e,t))}get initialDocumentSpot(){return this.wb}set initialDocumentSpot(t){let e=this.wb;e!==t&&(t.isSpot()||m.o("initialViewportSpot must be a specific Spot: "+t),this.wb=t,this.t("initialDocumentSpot",e,t))}get minScale(){return this.cb}set minScale(t){let e=this.cb;e!==t&&(t>0?(this.cb=t,this.t("minScale",e,t),t>this.scale&&(this.scale=t)):m.J(t,"> 0",Y,"minScale"))}get maxScale(){return this.fb}set maxScale(t){let e=this.fb;e!==t&&(t>0?(this.fb=t,this.t("maxScale",e,t),t<this.scale&&(this.scale=t)):m.J(t,"> 0",Y,"maxScale"))}get zoomPoint(){return this.ub}set zoomPoint(t){this.ub.equals(t)||(t=t.N(),this.ub=t)}get contentAlignment(){return this.Wc}set contentAlignment(t){let e=this.Wc;e.equals(t)||(t=t.N(),this.Wc=t,this.t("contentAlignment",e,t),this.Js(!1))}get initialContentAlignment(){return this.ip}set initialContentAlignment(t){let e=this.ip;e.equals(t)||(t=t.N(),this.ip=t,this.t("initialContentAlignment",e,t))}get padding(){return this.Qt}set padding(t){typeof t=="number"&&(t=new Dt(t));let e=this.Qt;e.equals(t)||(t=t.N(),this.Qt=t,this.invalidateDocumentBounds(),this.t("padding",e,t))}get partManager(){return this.s2}set partManager(t){let e=this.s2;e!==t&&(t.diagram!==null&&m.o("Cannot share PartManagers between Diagrams: "+t.toString()),e&&e.Io(null),this.s2=t,t.Io(this))}get nodes(){return this.partManager.nodes.iterator}get links(){return this.partManager.links.iterator}get parts(){return this.partManager.parts.iterator}findTopLevelNodesAndLinks(){let t=new V,e=this.nodes;for(;e.next();){let s=e.value;s.isTopLevel&&t.add(s)}let i=this.links;for(;i.next();){let s=i.value;s.isTopLevel&&t.add(s)}return t.iterator}findTopLevelGroups(){return this.$r.iterator}get routers(){return this.nf}doLinkRouting(t){this.Uo=!0;let e=this.nf.r;for(let i=0;i<e.length;i++)e[i].canRoute(t)&&e[i].routeLinks(this.Or,t);this.Uo=!1}get layout(){return this.li}set layout(t){let e=this.li;e!==t&&(this.li=t,t.diagram=this,t.group=null,this.Jr=!0,this.t("layout",e,t),this.requestUpdate())}layoutDiagram(t){this.Te(),t&&this.c1(!0),this.As?this.M2(!1,this.Fl||this.nf.count!==0&&this.to.size!==0):(this.$c=!0,this.Pr())}c1(t){let e=this.$r.iterator;for(;e.next();)this.LT(e.value,t);this.layout&&(t?this.layout.isValidLayout=!1:this.layout.p())}LT(t,e){if(t===null)return;let i=t.Ch.iterator;for(;i.next();){let s=i.value;this.LT(s,e)}t.layout!==null&&(e?t.layout.isValidLayout=!1:t.layout.p())}M2(t,e){if(this.Ab)return;let i=this.G;this.G=!0;let s="Layout",n=this.undoManager.transactionLevel,o=this.layout,r=this.animationManager;try{n===0&&(this.undoManager.Dl=!0,this.startTransaction(s)),n<=1&&!r.defaultAnimation.isAnimating&&!r.ke&&(t||r.Gl(s)),this.Jr=!1;let a=this.$r.iterator;for(;a.next();)this.cd(a.value),this.AT(a.value,t,n,e);let h=!1;if(o.isValidLayout||(!t||o.isRealtime||o.isRealtime===null||n===0?(o.doLayout(this),this.cd(this),h=!0,o.isValidLayout=!0):this.Jr=!0),h||this.cd(this),this.doLinkRouting(this),this.Or.clear(),this.uh.size!==0){for(let l=0;l<23&&this.uh.size!==0;l++){for(a=this.$r.iterator;a.next();)this.TT(a.value);let u=this.Or;this.Or=this.uh,this.uh=u,this.cd(this),this.doLinkRouting(this)}this.Or.clear(),this.uh.clear()}}finally{let a=this.undoManager.Dl;n===0&&(this.commitTransaction(s),this.undoManager.Dl=!1),a&&(n===0||n===1)&&r.MM(),this.Jr&&(this.Jr=!o.isValidLayout),this.G=i}}AT(t,e,i,s){let n=t.Ch.iterator;for(;n.next();)this.AT(n.value,e,i,s);let o=t.layout;o!==null&&!o.isValidLayout?!e||o.isRealtime||i===0?(t.Lh=!t.location.isReal(),o.doLayout(t),t.invalidateLayout(32),this.o1(t),this.cd(t),this.doLinkRouting(t),o.isValidLayout=!0):(this.doLinkRouting(t),this.Jr=!0):s&&this.doLinkRouting(t)}TT(t){let e=t.Ch.iterator;for(;e.next();)this.TT(e.value);this.cd(t),this.doLinkRouting(t)}get isTreePathToChildren(){return this.bb}set isTreePathToChildren(t){let e=this.bb;if(e!==t&&(m.s(t,"boolean",Y,"isTreePathToChildren"),this.bb=t,this.t("isTreePathToChildren",e,t),!this.undoManager.isUndoingRedoing)){let i=this.nodes;for(;i.next();)i.value.vp()}}findTreeRoots(){let t=new q,e=this.nodes;for(;e.next();){let i=e.value;i.isTopLevel&&i.findTreeParentLink()===null&&t.add(i)}return t.iterator}get treeCollapsePolicy(){return this.kb}set treeCollapsePolicy(t){let e=this.kb;e!==t&&(t!==1&&t!==2&&t!==3&&m.o("Unknown Diagram.treeCollapsePolicy: "+t),this.kb=t,this.t("treeCollapsePolicy",e,t))}get isCollapsingExpanding(){return this.YM}set isCollapsingExpanding(t){this.YM=t}_R(){let t=new Mt,e=new Mt;function i(s){let n=s.toLowerCase(),o=new q;t.set(s,o),t.set(n,o),e.set(s,s),e.set(n,s)}i("InitialAnimationStarting"),i("AnimationStarting"),i("AnimationFinished"),i("BackgroundSingleClicked"),i("BackgroundDoubleClicked"),i("BackgroundContextClicked"),i("ClipboardChanged"),i("ClipboardPasted"),i("DocumentBoundsChanged"),i("ExternalObjectsDropped"),i("FocusOrVirtualPointerEnabledChanged"),i("GainedFocus"),i("InitialLayoutCompleted"),i("LayoutCompleted"),i("LinkDrawn"),i("LinkRelinked"),i("LinkReshaped"),i("LostFocus"),i("Modified"),i("ObjectSingleClicked"),i("ObjectDoubleClicked"),i("ObjectContextClicked"),i("PartCreated"),i("PartResized"),i("PartRotated"),i("SelectionMoved"),i("SelectionCopied"),i("SelectionDeleting"),i("SelectionDeleted"),i("SelectionGrouped"),i("SelectionUngrouped"),i("ChangingSelection"),i("ChangedSelection"),i("SubGraphCollapsed"),i("SubGraphExpanded"),i("TextEdited"),i("ThemeChanged"),i("TreeCollapsed"),i("TreeExpanded"),i("ViewportBoundsChanged"),i("InvalidateDraw"),this.XM=t,this.GM=e}dT(t){let e=this.GM.get(t);return e!==null?e:this.GM.get(t.toLowerCase())}I2(t){let e=this.XM.get(t);if(e!==null)return e;let i=t.toLowerCase();if(e=this.XM.get(i),e!==null)return e;m.o("Unknown DiagramEvent name: "+t)}addDiagramListener(t,e){m.s(t,"string",Y,"addDiagramListener:name"),m.S(e,Y,"addDiagramListener:listener");let i=this.I2(t);return i!==null&&i.add(e),this}removeDiagramListener(t,e){m.s(t,"string",Y,"removeDiagramListener:name"),m.S(e,Y,"addDiagramListener:listener");let i=this.I2(t);i!==null&&i.delete(e)}raiseDiagramEvent(t,e,i){this.T(t,e,i)}T(t,e,i){let s=this.I2(t),n=new wi;n.diagram=this;let o=this.dT(t);o!==null&&(n.name=o),e!==void 0&&(n.subject=e),i!==void 0&&(n.parameter=i);let r=s.length;if(r===1)s.elt(0)(n);else if(r!==0){let a=s.toArray();for(let h=0;h<r;h++){let l=a[h];l(n)}}}isUnoccupied(t,e){return this.getPositions(!1,null,e||null).isUnoccupied(t.x,t.y,t.width,t.height)}computeOccupiedArea(t){return this.isVirtualized?this.viewportBounds.copy():this.mh?this.cT(t):t.h(this.documentBounds)}getPositions(t,e,i){let s=this.sa;s===null&&(this.sa=s=new Ot(this.avoidanceCellSize));let n=e;if(s.Yo||s.Ah!==n||s.E2!==i){if(s.U2=Math.max(s.af+1,Math.floor(this.avoidanceLimit/this.avoidanceCellSize.width)),s.V2=Math.max(s.af+1,Math.floor(this.avoidanceLimit/this.avoidanceCellSize.height)),n!==null&&(n=this.DT(n)),n===null){let o=I.l();this.computeOccupiedArea(o),o.inflate(100,100),s.f1(o);let r=this.nodes;for(;r.next();){let a=r.value,h=a.layer;h===null||!h.visible||h.isTemporary||this.B2(a,i,o)}I.i(o)}else{if(n.memberParts.count>0){let a=this.computePartsBounds(n.memberParts,!1);a.inflate(20,20),s.f1(a)}let o=I.l(),r=n.memberParts;for(;r.next();){let a=r.value;a instanceof J&&this.B2(a,i,o)}I.i(o)}s.Ah=n,s.E2=i,s.Yo=!1}else t&&s.vT();return s}get avoidanceCellSize(){return this._M}set avoidanceCellSize(t){this.sa=null,this._M=new st(Math.max(1,t.width),Math.max(1,t.height))}get avoidanceLimit(){return this.t2}set avoidanceLimit(t){this.t2=Math.max(1,t)}DT(t){return t.canAvoid()?t:t.containingGroup!==null?this.DT(t.containingGroup):null}B2(t,e,i){if(t===e||!t.isVisible())return;let s=t.canAvoid();if(s){let n=t.getAvoidableRect(i);this.sa.FO(n.x,n.y,n.width,n.height)}if(t instanceof ht&&(!s||t.avoidableMembers)){let n=t.memberParts;for(;n.next();){let o=n.value;o instanceof J&&this.B2(o,e,i)}}}fd(t){this.sa!==null&&!this.sa.Yo&&(t===void 0||t.canAvoid())&&(this.sa.Yo=!0)}get autoScrollInterval(){return this.sp}set autoScrollInterval(t){let e=this.sp;e!==t&&(this.sp=t,this.t("autoScrollInterval",e,t))}get autoScrollRegion(){return this.np}set autoScrollRegion(t){typeof t=="number"&&(t=new Dt(t));let e=this.np;e.equals(t)||(t=t.N(),this.np=t,this.invalidateDocumentBounds(),this.t("autoScrollRegion",e,t))}doAutoScroll(t){this.cp.h(t);let e=P.l();this.computeAutoScrollPosition(this.cp,e).equalsApprox(this.position)?this.stopAutoScroll():this.FT(),P.i(e)}FT(){if(this.Jc!==-1)return;let t=this.sp,e=this;this.Jc=m.un(()=>{if(e.Jc===-1||(e.stopAutoScroll(),e.lastInput.event===null))return;let i=P.l(),s=e.computeAutoScrollPosition(e.cp,i);if(!s.equalsApprox(e.position)){e.position=s,e.lastInput.documentPoint=e.transformViewToDoc(e.cp),e.doMouseMove(),e.mh=!0;let n=I.l();e.computeBounds(n),n.unionRect(e.documentBounds),e.CT(n),I.i(n),e.qi=!0,e.maybeUpdate(),e.FT()}P.i(i)},t)}stopAutoScroll(){this.Jc!==-1&&(m.yc(this.Jc),this.Jc=-1)}computeAutoScrollPosition(t,e){let i=this.position;e===void 0&&(e=new P),e.h(i);let s=this.np;if(s.top<=0&&s.left<=0&&s.right<=0&&s.bottom<=0)return e;let n=this.viewportBounds,o=this.scale,r=I.z(0,0,n.width*o,n.height*o),a=P.z(0,0);if(t.x>=r.x&&t.x<r.x+s.left&&this.allowHorizontalScroll){let h=Math.max(this.scrollHorizontalLineChange,1);h=h|0,a.x-=h,t.x<r.x+s.left/2&&(a.x-=h),t.x<r.x+s.left/4&&(a.x-=4*h)}else if(t.x<=r.x+r.width&&t.x>r.x+r.width-s.right&&this.allowHorizontalScroll){let h=Math.max(this.scrollHorizontalLineChange,1);h=h|0,a.x+=h,t.x>r.x+r.width-s.right/2&&(a.x+=h),t.x>r.x+r.width-s.right/4&&(a.x+=4*h)}if(t.y>=r.y&&t.y<r.y+s.top&&this.allowVerticalScroll){let h=Math.max(this.scrollVerticalLineChange,1);h=h|0,a.y-=h,t.y<r.y+s.top/2&&(a.y-=h),t.y<r.y+s.top/4&&(a.y-=4*h)}else if(t.y<=r.y+r.height&&t.y>r.y+r.height-s.bottom&&this.allowVerticalScroll){let h=Math.max(this.scrollVerticalLineChange,1);h=h|0,a.y+=h,t.y>r.y+r.height-s.bottom/2&&(a.y+=h),t.y>r.y+r.height-s.bottom/4&&(a.y+=4*h)}return a.equalsApprox(P.dn)||(e.x=i.x+a.x/o,e.y=i.y+a.y/o),I.i(r),P.i(a),e}makeSvg(t){this.zo.has("SVG")||this.addRenderer("SVG",new ui(this,X.document));let e=new ui(this,X.document,!0);t===void 0&&(t={});let i=this;function s(n,o){let r=i.RT(n,"SVG",e),a=r!==null?r.svg:null,h=n.svgFinished;return a&&h&&h(a),m.st(o)?(o(a),null):a}return this.OT(s,t)}makeSVG(t){return this.makeSvg(t)}addRenderer(t,e){this.zo.set(t,e)}removeRenderer(t){this.zo.delete(t)}cacheGroupExternalLinks(t){this.d2=t,t||this.nodes.each(e=>{e instanceof ht&&(e.Fp=null)})}OT(t,e){let i=e.callback,s=!0,n=this.oa.iterator;for(;n.next();)if(!n.value[0].Sn){s=!1;break}if(!m.st(i)||s)return t(e,i,this);let o=this;function r(){let l=+new Date;for(s=!0,n.reset();n.next();)if(!n.value[0].Sn){s=!1;break}if(s||l-h>a){t(e,i,o);return}X.requestAnimationFrame(r)}let a=e.callbackTimeout||300,h=+new Date;return X.requestAnimationFrame(()=>r()),null}makeImage(t){return Y.isUsingDOM()?(t===void 0&&(t={}),t.returnType="Image",this.makeImageData(t)):null}makeImageData(t){return t===void 0&&(t={}),this.OT(this.RO,t)}static img="image";RO(t,e,i){let s=i.RT(t,"canvas",null);if(s===null)return null;let n=s.F.canvas,o=null;if(n!==null){let r=t.returnType;switch(r===void 0?r="string":r=r.toLowerCase(),r){case Y.img+"data":o=s.getImageData(0,0,n.width,n.height);break;case Y.img:let a=(t.document||document).createElement("img");a.src=n.toDataURL(t.type,t.details),o=a;break;case"blob":{let h=n;return m.st(e)||(o="",m.o('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.')),m.st(h.toBlob)?(h.toBlob(e,t.type,t.details),"toBlob"):(e(null),null)}case"string":default:o=n.toDataURL(t.type,t.details)}}return m.st(e)?(e(o),null):o}static OO=!1;RT(t,e,i){this.animationManager.stopAnimation(),this.maybeUpdate(),m.$(t)||m.o("properties argument must be an Object.");let s=!1,n=t.size||null,o=t.scale||null;t.scale!==void 0&&isNaN(t.scale)&&(o="NaN");let r=t.maxSize;t.maxSize===void 0&&(s=!0,e==="SVG"?r=new st(1/0,1/0):r=new st(2e3,2e3));let a=t.position||null,h=t.parts||null;Array.isArray(h)&&(h=new q(h));let l=t.padding===void 0?1:t.padding,u=t.background||null,c=t.omitTemporary;c===void 0&&(c=!0);let d=t.document||X.document,f=t.elementFinished||null,p=t.showTemporary;p===void 0&&(p=!c);let g=t.showGrid;g===void 0&&(g=p),n!==null&&isNaN(n.width)&&isNaN(n.height)&&(n=null),typeof l=="number"?l=new Dt(l):l instanceof Dt||m.o("MakeImage padding must be a Margin or a number."),l.left=Math.max(l.left,0),l.right=Math.max(l.right,0),l.top=Math.max(l.top,0),l.bottom=Math.max(l.bottom,0),this.Wt&&this.Wt.clearContextCache(!0);let y=new Fe(null,d,void 0,!0),b=y._t;if(!(n||o||h||a))return y.width=this.wt+Math.ceil(l.left+l.right),y.height=this.xt+Math.ceil(l.top+l.bottom),e==="SVG"?i===null?null:(i.resize(y.width,y.height,y.width,y.height),i.tl=d,i.ud=f,this.l1(i._t,l,new st(y.width,y.height),this.it,this.ct,h,u,p,g),i._t):(this.nd=!1,this.l1(b,l,new st(y.width,y.height),this.it,this.ct,h,u,p,g),this.nd=!0,y._t);let v=this.dp,w=this.documentBounds.copy();if(w.subtractMargin(this.Qt),p){let F=this.Vt.r,O=F.length;for(let E=0;E<O;E++){let B=F[E];if(!B.visible||!B.isTemporary)continue;let K=B.Ct.r,z=K.length;for(let U=0;U<z;U++){let tt=K[U];if(!tt.isInDocumentBounds||!tt.isVisible())continue;let nt=tt.actualBounds;nt.isReal()&&w.unionRect(nt)}}}let k=new P(w.x,w.y);if(h!==null){let F=new I(0,0,0,0),O=!0,E=h.iterator;for(E.reset();E.next();){let B=E.value;if(!(B instanceof pt))continue;let K=B.layer;if(K!==null&&!K.visible||K!==null&&!p&&K.isTemporary||!B.isVisible())continue;let z=B.actualBounds;z.isReal()&&(O?(O=!1,F.h(z)):F.unionRect(z))}w.width=F.width,w.height=F.height,k.x=F.x,k.y=F.y}a!==null&&a.isReal()&&(k=a,o||(o=v));let S=0,N=0;l!==null&&(S=l.left+l.right,N=l.top+l.bottom);let D=0,L=0;n!==null&&(D=n.width,L=n.height,isFinite(D)&&(D=Math.max(0,D-S)),isFinite(L)&&(L=Math.max(0,L-N)));let M=0,A=0;if(n!==null&&o!==null?(o==="NaN"&&(o=v),n.isReal()?(M=D,A=L):isNaN(L)?(M=D,A=w.height*o):(M=w.width*o,A=L)):n!==null?n.isReal()?(o=Math.min(D/w.width,L/w.height),M=D,A=L):isNaN(L)?(o=D/w.width,M=D,A=w.height*o):(o=L/w.height,M=w.width*o,A=L):o!==null?o==="NaN"&&r.isReal()?(o=Math.min((r.width-S)/w.width,(r.height-N)/w.height),o>v?(o=v,M=w.width,A=w.height):(M=r.width,A=r.height)):(M=w.width*o,A=w.height*o):(o=v,M=w.width,A=w.height),l!==null?(M+=S,A+=N):l=new Dt(0),r!==null){let F=r.width,O=r.height;e!=="SVG"&&s&&Y.OO,isNaN(F)&&(F=2e3),isNaN(O)&&(O=2e3),isFinite(F)&&(M=Math.min(M,F)),isFinite(O)&&(A=Math.min(A,O))}return y.width=Math.ceil(M),y.height=Math.ceil(A),e==="SVG"?i===null?null:(i.resize(y.width,y.height,y.width,y.height),i.tl=d,i.ud=f,this.l1(i._t,l,new st(Math.ceil(M),Math.ceil(A)),o,k,h,u,p,g),i._t):(this.nd=!1,this.l1(b,l,new st(Math.ceil(M),Math.ceil(A)),o,k,h,u,p,g),this.nd=!0,y._t)}static Mh=null;static z2="5da73c80a36555d5038e4972187c3cae51fd22";static IO="5da73c80a36555d503aa5c72106c30b35bb2006b9cd041b259";static jw=!1;static OP=()=>{if(Y.z2[5]===void 0&&(Nt.prototype.Ci=Nt.prototype.Su),!Y.isUsingDOM())return;let t=m.Ni("canvas");t.width=350;let e=t.getContext("2d"),i=m.We("7ca11abfd022028846"),s="7ca11abfd7330390",n=[Y.z2,m.jw+"4ae6247590da4bb21c324ba3a84e385776",Nt.OP+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",C.za];e.scale(2,2);let o=8;for(let r=1;r<5;r++)e[m.We(s)](m.We(n[r-1]),o,r*15);e[i]=m.We("39f046ebb36e4b");for(let r=1;r<5;r++)e[m.We(s)](m.We(n[r-1]),o,r*15);(n.length!==4||n[0][0]!=="5"||n[3][0]!=="7")&&(Nt.prototype.Ci=Nt.prototype.Su),Y.Mh=t};static EO=()=>{if(Y.z2[5]===void 0&&(Nt.prototype.Ci=Nt.prototype.Su),!Y.isUsingDOM())return;let t=m.Ni("canvas"),e=t.getContext("2d"),i=m.We("7ca11abfd022028846"),s="7ca11abfd7330390",n=[Y.IO,C.za],o=5;e.scale(2,2);for(let r=1;r<3;r++)e[m.We(s)](m.We(n[r-1]),o,r*11);e[i]=m.We("39f046ebb36e4b");for(let r=1;r<3;r++)e[m.We(s)](m.We(n[r-1]),o,r*11);(n.length!==2||n[0][0]!=="5")&&(Nt.prototype.Ci=Nt.prototype.Su),Y.Mh=t}}class Fn{IT;ET;X2;bi;constructor(t){if(this.IT=null,this.ET="63ad05bbe23a1786468a4c741b6d2",this.X2="@onz",this.ET===this._tk){this.X2=!0,this.bi=this.X2;return}this.bi=null}UO(t,e){let i="f",s=X[m.We("76a715b2f73f148a")][m.We("72ba13b5")]||"",n=m.We;if(this.bi=!0,!Y.isUsingDOM())return;let o=Y[n("76a115b6ed251eaf4692")];if(!o){let a=s[n("76ad18b4f73e")];for(let l=s[n("73a612b6fb191d")](n("35e7"))+2;l<a;l++)i+=s[l];let h=i[n("73a612b6fb191d")](n("7da71ca0ad381e90"));this.bi=!(h>=0&&h<i[n("73a612b6fb191d")](n("35")));return}let r=Y.F2.iterator;for(;r.next();){o=r.value;let a=n(o).split(n("39e9")),h=a.length===7?1:0;if(a.length===1&&o.includes(n("5b8b3797c61b32a7"))){if(Y.EO(),!t.lt)return;t.gp=t.lt._t.F[m.We("7eba17a4ca3b1a8346")][m.We("78a118b7")](t.lt._t.F,Y.Mh,4,4)}if(a.length<6)return;let l=n(a[1+h]).split(".");if(a[4+h]!=="7da71ca0")return;let u=n(m[n("6cae19")]).split(".");if(!(l[0]>u[0]||l[0]===u[0]&&l[1]>=u[1]))continue;let c="73a612b6fb191d",d=X[n("74a900bae4370f8b51")][n("6fbb13a1c2311e8a57")].toLowerCase(),f=d[n(c)](n("3aad1ab6e022098b4dc4")),p=n(a[2+h]);if(f>-1){let M=d[n(c)](p.toLowerCase()+"/");if(this.bi=!(M>-1&&M<f),!this.bi)return}let g=s[n("76ad18b4f73e")];for(let M=s[n(c)](n("35e7"))+2;M<g;M++)i+=s[M];let y=i[n(c)](p);if(y<0&&p!==n("7da71ca0ad381e90")&&(y=i[n(c)](n("76a715b2ef3e149757"))),y<0&&(y=i[n(c)](n("76a715b2ef3e149757"))),y<0&&(y=i[n(c)](n("2bfa41fdb3784bca12"))),y<0&&(y=s[n(c)](n("7baa19a6f76c1988428554"))),y<0&&(y=s[n(c)](n("7ea902b2b9221e9c57c45767196566"))),this.bi=!(y>=0&&y<i[n(c)](n("35"))||i[n(c)](n("35"))===-1),!this.bi||s[n(c)](n("7fb002b6ed25128b4da25b2e"))&&(this.bi=!(s[n(c)](p)>-1),!this.bi))return;let b=X[m.We("76a715b2f73f148a")][m.We("69ad17a1e03e")],v=b[n(c)](n("7fb002b6ed25128b4da25b2e"));if(v>-1&&(this.bi=!(b[n(c)](p)>v),!this.bi))return;let w=p;if(w[0]!=="#")continue;let k=m.Ni("div"),S=a[0+h].replace(/[A-Za-z]/g,"");for(;S.length<4;)S+="9";let N=S;S=S.substring(S.length-4);let D=parseInt(u[0]),L=parseInt(u[1]);if(D>3||D===3&&L>=1){let M=parseInt(N)%40+30,A=parseInt(w.substring(1,5),16);if(j.UT===M+A){this.bi=!1;return}}else{let M="",A=["gsh","gsf"],F=["Header","Background","Display","Feedback"];if(M+=A[parseInt(S.substring(0,1),10)%2],M+=F[parseInt(S.substring(0,1),10)%4],k[n("79a417a0f0181a8946")]=M,X.document[n("78a712aa")]){X.document[n("78a712aa")][n("7bb806b6ed32388c4a875b")](k);let O=X.getComputedStyle(k).getPropertyValue(n("78a704b7e62456904c9b12701b6532a8")),E=X.getComputedStyle(k).getPropertyValue(n("75b817b0ea2202"));if(X.document[n("78a712aa")][n("68ad1bbcf533388c4a875b")](k),!O)continue;let B=X[n("77a902b0eb1b1e804a8a")],K="0."+parseInt(N,10)%100;if(E===K||O.indexOf(parseInt(w[1]+w[2],16).toString())!==-1&&O.indexOf(parseInt(w[3]+w[4],16).toString())!==-1){this.bi=!1;return}else if(B&&B(n("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches){M="."+M;for(let z=0;z<X.document.styleSheets.length;z++){let U=X.document.styleSheets[z].rules||X.document.styleSheets[z].cssRules;for(let tt in U)if(M===U[tt].selectorText){this.bi=!1;return}}}}else this.bi=null,e&&(this.bi=!1)}}}Mh(t,e){return e.setTransform(t.$e/2,0,0,t.$e/2,0,0),e.commitTransform(),this.bi===null&&this.UO(t,!0),0<this.bi&&this!==this.IT}}class Ye{G2;Y2;constructor(t){this.G2=t===void 0?new P:t,this.Y2=new P}get point(){return this.G2}set point(t){this.G2=t}get shifted(){return this.Y2}set shifted(t){this.Y2=t}}class On{Ri;wT;h1;constructor(t,e,i){this.Ri=t,this.wT=e,this.h1=i}}class Pi{isGridSnapEnabled;isGridSnapRealtime;gridSnapCellSize;gridSnapCellSpot;gridSnapOrigin;dragsLink;dragsTree;groupsSnapMembers;groupsAlwaysMove;dragsMembers;constructor(t){this.Ue(),t&&Object.assign(this,t)}Ue(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new st(NaN,NaN).k(),this.gridSnapCellSpot=T.TopLeft,this.gridSnapOrigin=new P(NaN,NaN).k(),this.dragsLink=!1,this.dragsTree=!1,this.groupsSnapMembers=!1,this.groupsAlwaysMove=!0,this.dragsMembers=!0}}class Rn extends Y{constructor(t,e){let i;return t===void 0||typeof t=="string"||X.Element&&t instanceof Element?i=t:m.$(t)&&(e=t),super(i),this.VT(),e&&this.setProperties(e),this}VT(){this.allowDragOut=!0,this.allowMove=!1,this.isReadOnly=!0,this.contentAlignment=T.TopCenter,this.layout=new je}setupRouters(){}reset(){super.reset(),this.VT()}}class hi extends Y{u1;d1;g1;m1;Rp;hf;Bl;K2;H2;p1;q2;constructor(t,e){let i;return t===void 0||typeof t=="string"||X.Element&&t instanceof Element?i=t:m.$(t)&&(e=t),super(i),this.animationManager.isEnabled=!1,this.Ht=!0,this.u1=null,this.Zu=!1,this.Qu=!1,this.d1=!0,this.g1=!0,this.m1=0,this.Rp=!1,this.hf=null,this.setRenderingHint("drawShadows",!1),this.Bl=new pt({selectable:!0,selectionAdorned:!1,selectionObjectName:"BOXSHAPE",locationObjectName:"BOXSHAPE",resizeObjectName:"BOXSHAPE",cursor:"move"}).add(new et({name:"BOXSHAPE",fill:"transparent",stroke:"magenta",strokeWidth:2}).theme("stroke","overviewBox")).It(),this.allowCopy=!1,this.allowDelete=!1,this.allowDrop=!1,this.allowSelect=!0,this.autoScrollRegion=new Dt(0,0,0,0),this.ct.e(0,0),this.toolManager.Jt("Dragging",new En,this.toolManager.mouseMoveTools),this.click=()=>{let s=this.observed;if(s===null)return;let n=s.viewportBounds,o=this.lastInput.documentPoint;s.position=new P(o.x-n.width/2,o.y-n.height/2)},this.K2=s=>{this.invalidateDocumentBounds(),this.Op()},this.H2=s=>{this.observed!==null&&(this.invalidateDocumentBounds(),this.C())},this.p1=s=>{this.updateDelay<1?this.C():this.Rp||(this.Rp=!0,m.un(()=>this.redraw(),this.updateDelay))},this.q2=s=>{this.observed!==null&&this.Op()},this.autoScale=2,this.Ht=!1,e&&this.setProperties(e),this}setupRouters(){}computePixelRatio(){return 1}redraw(){this.Rp&&this.updateDelay>=1&&(this.Rp=!1,this.VO()),super.redraw()}Ge(){if(this.Nt===null&&m.o("No div specified"),this.lt===null&&m.o("No canvas specified"),this.lt instanceof ui||(this.box.BM(),!this.qi))return;let t=this.observed;if(t===null||t.animationManager.defaultAnimation.isAnimating||!t.Qa)return;this.Lp();let e=this.lt,i=this.Wt;if(i.clearContextCache(!0),i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,e.width,e.height),this.updateDelay<1)this.BT();else if(this.hf!==null){i.drawImage(this.hf.bt,0,0);let o=this.v;i.scale(this.$e,this.$e),i.transform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),i.commitTransform()}let s=this.Vt.r,n=s.length;for(let o=0;o<n;o++)s[o].Ge(i,this);this._c=!1,this.qi=!1}VO(){let t=this.lt,e=this.Wt;if(!(t===null||e===null)){if(this.Lp(),this.hf===null){let i=new Fe(null);i.width=t.width,i.height=t.height,this.hf=i}try{this.lt=this.hf,this.Wt=this.lt._t,this.Wt.clearContextCache(!0),this.Wt.setTransform(1,0,0,1,0,0),this.Wt.clearRect(0,0,this.lt.width,this.lt.height),this.BT()}finally{this.lt=t,this.Wt=e}}}BT(){let t=this.observed;if(t===null)return;let e=this.drawsTemporaryLayers,i=this.drawsGrid&&e,s=t.grid;if(i&&s!==null&&s.visible&&!(isNaN(s.width)||isNaN(s.height))){let u=I.l().h(this.viewportBounds).unionRect(t.viewportBounds);t.ca(u),I.i(u),t.Te()}let n=this.v,o=this.Wt;o.scale(this.$e,this.$e),o.transform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),o.commitTransform();let r=this.viewportBounds,a=t.Vt.r,h=a.length,l=this.Vt.r;this.rs(l,l.length,this,this.viewportBounds);for(let u=0;u<h;u++)a[u].UR(o,r,this,e,i)}get observed(){return this.u1}set observed(t){let e=this.u1;if(t!==null&&m.se(t,Y,hi,"observed"),t instanceof hi&&m.o("Overview.observed Diagram may not be an Overview itself: "+t),e!==t){if(e!==null&&this.BO(e),this.u1=t,t!==null&&this.zO(t),this.invalidateDocumentBounds(),t===null){this.hf=null;let i=this.lt,s=this.Wt;i&&s&&(s.setTransform(1,0,0,1,0,0),s.clearRect(0,0,i.width,i.height))}else this.p1(null),this.Op(),this.C();this.t("observed",e,t)}}get box(){return this.Bl}set box(t){let e=this.Bl;e!==t&&(t.It(),this.Bl=t,this.remove(e),this.add(this.Bl),this.Op(),this.t("box",e,t))}get drawsTemporaryLayers(){return this.d1}set drawsTemporaryLayers(t){this.d1!==t&&(this.d1=t,this.redraw())}get drawsGrid(){return this.g1}set drawsGrid(t){this.g1!==t&&(this.g1=t,this.redraw())}get updateDelay(){return this.m1}set updateDelay(t){t<0&&(t=0),this.m1!==t&&(this.m1=t)}zO(t){t!==null&&(t.addDiagramListener("ViewportBoundsChanged",this.K2),t.addDiagramListener("DocumentBoundsChanged",this.H2),t.addDiagramListener("InvalidateDraw",this.p1),t.addDiagramListener("AnimationFinished",this.q2),this.add(this.box))}BO(t){t!==null&&(this.remove(this.box),t.removeDiagramListener("ViewportBoundsChanged",this.K2),t.removeDiagramListener("DocumentBoundsChanged",this.H2),t.removeDiagramListener("InvalidateDraw",this.p1),t.removeDiagramListener("AnimationFinished",this.q2))}Op(){let t=this.box,e=this.observed;if(e===null)return;this.qi=!0;let i=e.viewportBounds,s=t.selectionObject,n=st.l();n.e(i.width,i.height),s.desiredSize=n,st.i(n);let o=2/this.scale;s instanceof et&&(s.strokeWidth=o),t.location=new P(i.x-o/2,i.y-o/2),t.isSelected=!0}computeBounds(){let t=this.observed;if(t===null)return I.em;let e=t.documentBounds.copy();return e.unionRect(t.viewportBounds),e}invalidateViewport(t,e){this.qi!==!0&&(this.qi=!0,this.requestUpdate())}onViewportBoundsChanged(t,e,i,s){this.Ht||(this.ha(),this.C(),this.Nh(),this.invalidateDocumentBounds(),this.Op(),this.Ye.scale=i,this.Ye.position.x=t.x,this.Ye.position.y=t.y,this.Ye.bounds.h(t),this.Ye.isScroll=s,this.T("ViewportBoundsChanged",this.Ye,t))}}class En extends Tt{ua;constructor(){super(),this.ua=P.gn}canStart(){if(!this.isEnabled)return!1;let t=this.diagram;if(t===null||!t.allowMove||!t.allowSelect)return!1;let e=t.observed;if(e===null)return!1;let i=t.lastInput;if(!i.left||t.currentTool!==this&&(!this.isBeyondDragSize()||i.isTouchEvent&&i.timestamp-t.firstInput.timestamp<this.delay))return!1;if(this.findDraggablePart()===null){let s=e.viewportBounds;this.ua=new P(s.width/2,s.height/2);let n=t.firstInput.documentPoint;e.position=new P(n.x-this.ua.x,n.y-this.ua.y)}return!0}doActivate(){this.ua=P.gn,super.doActivate()}doUpdateCursor(t){let e=this.diagram,i=e.box;i!==null&&i.cursor&&(e.currentCursor=i.cursor)}moveParts(t,e,i){i===void 0&&(i=!1);let s=this.diagram,n=s.observed;if(n===null)return;let o=s.box;if(o===null)return;if(!this.ua.isReal()){let a=s.firstInput.documentPoint,h=o.location;this.ua=new P(a.x-h.x,a.y-h.y)}let r=s.lastInput.documentPoint;n.position=new P(r.x-this.ua.x,r.y-this.ua.y)}}class jt{a;w1="go._clipboard";b1="go._clipboardFormat";j2;W2;J2;$2;Z2;Q2;_2;tN;eN;da;iN;k1;P1;S1;M1;sN;Ko;nN;oN;Ip;rN;N1;lN;C1;aN;hN;dd;Ep;Up;cN;Zc;fN;uN;dN;gN;mN;gd;pN;Oi;Ps;L1;Vp;static md=["Ctrl","Shft","Alt","Meta"];static zT=jt.yN(230,40,15);static XO=jt.yN(270,40,15);static GO=jt.yN(310,40,15);constructor(t){V.Je(this),this.a=Y.Om(),this.j2=!0,this.W2=!0,this.J2=!0,this.$2=!1,this.Z2=!1,this.Q2=!1,this._2=!1,this.tN="memory",this.eN=null,this.da=null,this.iN=1.05,this.k1=NaN,this.P1=P.gn,this.S1=NaN,this.M1=I.em,this.sN=!1,this.Ko=null,this.nN=200,this.oN=!1,this.Ip=new vt("Auto",{layerName:"Tool",pickable:!1,selectable:!1}).add(new G("Spot").add(new et({name:"SHAPE",fill:null,stroke:"lime",strokeWidth:4}).bindObject("stroke","adornedPart",e=>e.isSelected?"darkcyan":"lime"),new et({name:"SHAPE2",stretch:2,fill:null,stroke:"magenta",strokeWidth:4,strokeDashArray:[4,4]})),new le({padding:4})),this.rN=null,this.N1="",this.lN="",this.C1=m.fr,this.aN=!1,this.hN=!1,this.dd=new pt({layerName:"Tool",isInDocumentBounds:!1,locationObjectName:"CIRCLE",locationSpot:T.Center,pickable:!1,selectable:!1}).add(new et("Circle",{isGeometryPositioned:!0,width:30,height:30,fill:null,stroke:"darkcyan",strokeWidth:6,visible:!1}).bind("visible","down"),new et({isGeometryPositioned:!0,geometryString:"M15 0L15 30",stroke:"magenta"}),new et({isGeometryPositioned:!0,geometryString:"M0 15L30 15",stroke:"magenta"}),new et("Circle",{name:"CIRCLE",isGeometryPositioned:!0,width:20,height:20,fill:null,stroke:"magenta",position:new P(5,5)}),new et({isGeometryPositioned:!0,geometry:jt.zT,fill:null,stroke:"cyan",strokeWidth:4}).bind("geometry","button",jt.YO),new lt({position:new P(12,0),font:"bold 10pt sans-serif"}).bind("text","clickCount",e=>e>1?e.toString():""),new lt({position:new P(0,16)}).bind("text","modifiers",jt.KO)).freezeBindings(),this.Ep=10,this.Up=1,this.cN=null,this.Zc=e=>this.HO(e),this.fN=e=>this.qO(e),this.uN=e=>this.jO(e),this.dN=e=>this.WO(e),this.gN=null,this.mN="distance",this.gd=null,this.pN=0,this.Oi={},this.Ps=null,this.L1=!1,this.Vp=null,this.wN(),this.dd.data=this.Oi,t&&Object.assign(this,t)}toString(){return"CommandHandler"}get diagram(){return this.a}Io(t){this.a=t}doStart(){let t=this.a;t&&(t.addModelChangedListener(this.Zc),t.addDiagramListener("ViewportBoundsChanged",this.fN),t.addDiagramListener("GainedFocus",this.uN),t.addDiagramListener("LostFocus",this.dN))}doStop(){let t=this.a;t&&(t.removeDiagramListener("ViewportBoundsChanged",this.fN),t.removeDiagramListener("GainedFocus",this.uN),t.removeDiagramListener("LostFocus",this.dN),t.removeModelChangedListener(this.Zc))}doKeyDown(){let t=this.a,e=t.lastInput,i=e.control||e.meta,s=e.shift,n=e.alt,o=e.commandKey;i&&(o==="Insert"||o==="c")?this.canCopySelection()&&this.copySelection():i&&o==="x"||s&&o==="Delete"?this.canCutSelection()&&this.cutSelection():i&&o==="v"||s&&o==="Insert"?this.canPasteSelection()&&this.pasteSelection():i&&o==="y"||i&&s&&o==="z"||n&&s&&o==="Backspace"?this.canRedo()&&this.redo():i&&o==="z"||n&&o==="Backspace"?this.canUndo()&&this.undo():o==="Delete"||o==="Backspace"?this.canDeleteSelection()&&this.deleteSelection():i&&o==="a"?this.canSelectAll()&&this.selectAll():o==="Escape"?this.canStopCommand()&&this.stopCommand():this.XT.indexOf(o)>=0?this.JO(o,i,s):o==="PageUp"?s&&t.allowHorizontalScroll?t.scroll("page","left"):t.allowVerticalScroll&&t.scroll("page","up"):o==="PageDown"?s&&t.allowHorizontalScroll?t.scroll("page","right"):t.allowVerticalScroll&&t.scroll("page","down"):o==="Home"?i&&t.allowVerticalScroll?t.scroll("document","up"):!i&&t.allowHorizontalScroll&&t.scroll("document","left"):o==="End"?i&&t.allowVerticalScroll?t.scroll("document","down"):!i&&t.allowHorizontalScroll&&t.scroll("document","right"):o==="Space"?this.canScrollToPart()&&this.scrollToPart():o==="Minus"||o==="NumpadSubtract"?this.canDecreaseZoom()&&this.decreaseZoom():o==="Equal"||o==="NumpadAdd"?this.canIncreaseZoom()&&this.increaseZoom():i&&o==="Digit0"?this.canResetZoom()&&this.resetZoom():s&&o==="z"?this.canZoomToFit()&&this.zoomToFit():i&&!s&&o==="g"?this.canGroupSelection()&&this.groupSelection():i&&s&&o==="g"?this.canUngroupSelection()&&this.ungroupSelection():o==="F2"?this.canEditTextBlock()&&this.editTextBlock():o==="ContextMenu"||s&&o==="F10"||i&&s&&o==="Backslash"?this.canShowContextMenu()&&this.showContextMenu():e.bubbles=!0}doKeyUp(){let t=this.a.lastInput;t.bubbles=!0}stopCommand(){let t=this.a,e=t.currentTool;if(e instanceof ne){if(e.currentToolTip!==null){e.hideToolTip();return}t.allowSelect&&t.clearSelection()}e!==null&&e.doCancel()}canStopCommand(){return!0}selectAll(){let t=this.a;t.C();try{t.currentCursor="wait",t.T("ChangingSelection",t.selection);let e=t.parts;for(;e.next();){let n=e.value;n.canSelect()&&!n.layer.isTemporary&&(n.isSelected=!0)}let i=t.nodes;for(;i.next();){let n=i.value;n.canSelect()&&!n.layer.isTemporary&&(n.isSelected=!0)}let s=t.links;for(;s.next();){let n=s.value;n.canSelect()&&!n.layer.isTemporary&&(n.isSelected=!0)}}finally{t.T("ChangedSelection",t.selection),t.currentCursor=""}}canSelectAll(){return this.a.allowSelect}deleteSelection(){let t=this.a;try{t.currentCursor="wait",t.T("ChangingSelection",t.selection),t.startTransaction("Delete"),t.T("SelectionDeleting",t.selection);let e=new V,i=t.selection.iterator;for(;i.next();){let s=i.value;pt.ga(e,s,!0,this.deletesTree?1/0:0,this.deletesConnectedLinks?null:!1,n=>n.canDelete())}t.removeParts(e,!0),t.T("SelectionDeleted",e)}finally{t.commitTransaction("Delete"),t.T("ChangedSelection",t.selection),t.currentCursor=""}}canDeleteSelection(){let t=this.a;return!(t.isReadOnly||t.isModelReadOnly||!t.allowDelete||t.selection.count===0)}copySelection(){let t=this.a;try{let e=new V,i=t.selection.iterator;for(;i.next();){let s=i.value;pt.ga(e,s,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,n=>n.canCopy())}this.copyToClipboard(e)}finally{}}canCopySelection(){let t=this.a;return!(!t.allowCopy||!t.allowClipboard||t.selection.count===0)}cutSelection(){this.copySelection(),this.deleteSelection()}canCutSelection(){let t=this.a;return!(t.isReadOnly||t.isModelReadOnly||!t.allowCopy||!t.allowDelete||!t.allowClipboard||t.selection.count===0)}copyToClipboard(t){let e=this.a,i=this.storageLocation==="systemClipboard";if(i||this.storageLocation!=="memory")try{if(t===null)if(i&&X.navigator.clipboard)X.navigator.clipboard.writeText("");else{let n=X[this.storageLocation];if(!n)return;n.setItem(this.w1,""),n.setItem(this.b1,"")}else{let n=new Y;if(n.isTreePathToChildren=e.isTreePathToChildren,n.toolManager.draggingTool.dragsLink=e.toolManager.draggingTool.dragsLink,n.model=e.model.copy(),e.copyParts(t,n,!1),i&&X.navigator.clipboard)X.navigator.clipboard.writeText(n.model.toJson());else{let o=X[this.storageLocation];if(!o)return;o.setItem(this.w1,n.model.toJson()),o.setItem(this.b1,n.model.dataFormat)}}e.T("ClipboardChanged",t);return}catch{return}let s=null;if(t===null)Y.nT();else{let n=null;try{n=e.copyParts(t,null,!0)}finally{s=new q,n!==null&&s.addAll(n.iteratorValues),Y.Sp=s,Y.i1=e.model.dataFormat}}e.T("ClipboardChanged",s)}pasteFromClipboard(){let t=this.a;if(this.storageLocation!=="memory"){let n=new V;try{let o=X[this.storageLocation];if(!o)return n;let r=o.getItem(this.w1),a=o.getItem(this.b1);if(r===null||r===""||a!==t.model.dataFormat)return n;{let h=new Y;h.model=ut.fromJson(r);let l=new V;l.addAll(h.parts).addAll(h.nodes).addAll(h.links);let u=t.copyParts(l,t,!1);return new V().addAll(u.iteratorValues)}}catch{return n}}let e=new V,i=Y.Sp;if(i===null||Y.i1!==t.model.dataFormat)return e;let s=null;try{s=t.copyParts(i,t,!1)}finally{if(s!==null){let n=s.iterator;for(;n.next();){let o=n.value,r=n.key;o.location.isReal()||(r.location.isReal()?o.location=r.location:!o.position.isReal()&&r.position.isReal()&&(o.position=r.position)),e.add(o)}}}return e}async pasteSelectionAsync(t){let e=this.a;if(X.navigator.clipboard===void 0){m.ne('Cannot paste with storageLocation "clipboard", window.isSecureContext may be false.');return}try{e.currentCursor="wait",e.T("ChangingSelection",e.selection),e.startTransaction("Paste");let i=null,s=await X.navigator.clipboard.readText();try{let o=s;if(!(o===null||o==="")){let r=new Y;r.model=ut.fromJson(o);let a=new V;a.addAll(r.parts).addAll(r.nodes).addAll(r.links);let h=e.copyParts(a,e,!1);i=new V().addAll(h.iteratorValues)}}catch{}if(i===null)return;i.count>0&&e.clearSelection(!0);let n=i.iterator;for(;n.next();){let o=n.value;o.isSelected=!0}if(t){let o=e.computePartsBounds(e.selection);if(o.isReal()){let r=this.computeEffectiveCollection(e.selection,e.ld);e.Lx(r,new P(t.x-o.centerX,t.y-o.centerY),e.ld,!1)}}e.T("ClipboardPasted",i)}finally{e.commitTransaction("Paste"),e.T("ChangedSelection",e.selection),e.currentCursor=""}}pasteSelection(t){if(this.storageLocation==="systemClipboard"){this.pasteSelectionAsync(t);return}let e=this.a;try{e.currentCursor="wait",e.T("ChangingSelection",e.selection),e.startTransaction("Paste");let i=this.pasteFromClipboard();i.count>0&&e.clearSelection(!0);let s=i.iterator;for(;s.next();){let n=s.value;n.isSelected=!0}if(t){let n=e.computePartsBounds(e.selection);if(n.isReal()){let o=this.computeEffectiveCollection(e.selection,e.ld);e.Lx(o,new P(t.x-n.centerX,t.y-n.centerY),e.ld,!1)}}e.T("ClipboardPasted",i)}finally{e.commitTransaction("Paste"),e.T("ChangedSelection",e.selection),e.currentCursor=""}}canPasteSelection(t){let e=this.a;if(e.isReadOnly||e.isModelReadOnly||!e.allowInsert||!e.allowClipboard)return!1;if(this.storageLocation==="systemClipboard")return!0;if(this.storageLocation!=="memory")try{let i=X[this.storageLocation];if(!i)return!1;let s=i.getItem(this.w1),n=i.getItem(this.b1);return!(s===null||s===""||n!==e.model.dataFormat)}catch{return!1}return!(Y.Sp===null||Y.Sp.count===0||Y.i1!==e.model.dataFormat)}undo(){this.a.undoManager.undo()}canUndo(){let t=this.a;return t.isReadOnly||t.isModelReadOnly?!1:t.allowUndo&&t.undoManager.canUndo()}redo(){this.a.undoManager.redo()}canRedo(){let t=this.a;return t.isReadOnly||t.isModelReadOnly?!1:t.allowUndo&&t.undoManager.canRedo()}decreaseZoom(t){t===void 0&&(t=1/this.zoomFactor);let e=this.a;if(e.autoScale!==1)return;let i=e.scale*t;i<e.minScale||i>e.maxScale||(e.scale=i)}canDecreaseZoom(t){t===void 0&&(t=1/this.zoomFactor);let e=this.a;if(e.autoScale!==1)return!1;let i=e.scale*t;return i<e.minScale||i>e.maxScale?!1:e.allowZoom}increaseZoom(t){t===void 0&&(t=this.zoomFactor);let e=this.a;if(e.autoScale!==1)return;let i=e.scale*t;i<e.minScale||i>e.maxScale||(e.scale=i)}canIncreaseZoom(t){t===void 0&&(t=this.zoomFactor);let e=this.a;if(e.autoScale!==1)return!1;let i=e.scale*t;return i<e.minScale||i>e.maxScale?!1:e.allowZoom}resetZoom(t){t===void 0&&(t=this.defaultScale);let e=this.a;t<e.minScale||t>e.maxScale||(e.scale=t)}canResetZoom(t){t===void 0&&(t=this.defaultScale);let e=this.a;return t<e.minScale||t>e.maxScale?!1:e.allowZoom}zoomToFit(t){let e=this.a,i=e.animationManager;i.stopAnimation(),e.redraw();let s=e.position.copy(),n=e.scale;if(i.Gl("Zoom To Fit"),!t&&this.isZoomToFitRestoreEnabled&&n===this.S1&&!isNaN(this.k1)&&this.P1.isReal()&&e.documentBounds.equals(this.M1))e.scale=this.k1,e.position=this.P1,this.S1=NaN,this.M1=I.em;else{if(this.k1=n,this.P1=s,t){let o=t.copy();if(o.width>0&&o.height>0){let r=e.viewportBounds,a=r.width*n,h=r.height*n,l=Math.min(a/o.width,h/o.height),u=a/l,c=h/l;o.width<u&&(o.x-=(u-o.width)/2),o.height<c&&(o.y-=(c-o.height)/2)}e.zoomToRect(o,2)}else e.zoomToFit();this.S1=e.scale,this.M1=e.documentBounds.copy()}i.MM()}canZoomToFit(t){return this.a.allowZoom}JO(t,e,i){let s=this.a;t==="ArrowUp"?s.allowVerticalScroll&&(e?s.scroll("pixel","up"):s.scroll("line","up")):t==="ArrowDown"?s.allowVerticalScroll&&(e?s.scroll("pixel","down"):s.scroll("line","down")):t==="ArrowLeft"?s.allowHorizontalScroll&&(e?s.scroll("pixel","left"):s.scroll("line","left")):t==="ArrowRight"&&s.allowHorizontalScroll&&(e?s.scroll("pixel","right"):s.scroll("line","right"))}scrollToPart(t){t===void 0&&(t=null),t!==null&&m.se(t,pt,jt,"part");let e=this.a;if(e.ensureBounds(),t===null){try{this.Ko!==null&&(this.Ko.next()?t=this.Ko.value:this.Ko=null)}catch{this.Ko=null}t===null&&(e.highlighteds.count>0?this.Ko=e.highlighteds.iterator:e.selection.count>0&&(this.Ko=e.selection.iterator),this.Ko!==null&&this.Ko.next()&&(t=this.Ko.value))}if(t!==null){let i=e.animationManager;i.Gl("Scroll To Part");let s=this.scrollToPartPause;if(s>0){let n=this.cf(t,[t]);if(n.length===1)e.startTransaction(),e.centerRect(t.actualBounds),e.commitTransaction("Scroll To Part");else{let o=()=>{e.startTransaction();let a=n.pop();for(;n.length>0&&a instanceof J&&a.isTreeExpanded&&(!(a instanceof ht)||a.isSubGraphExpanded);)a=n.pop();n.length>0?(a instanceof pt&&e.scrollToRect(a.actualBounds),a instanceof J&&!a.isTreeExpanded&&(a.isTreeExpanded=!0),a instanceof ht&&!a.isSubGraphExpanded&&(a.isSubGraphExpanded=!0)):(a instanceof pt&&e.centerRect(a.actualBounds),e.removeDiagramListener("LayoutCompleted",r)),e.commitTransaction("Scroll To Part")},r=()=>{m.un(o,(i.isEnabled?i.duration:0)+s)};e.addDiagramListener("LayoutCompleted",r),o()}}else{let n=e.position.copy();e.centerRect(t.actualBounds),n.equalsApprox(e.position)&&i.stopAnimation()}}}cf(t,e){if(t.isVisible())return e;if(t instanceof vt){let i=t.adornedPart;i!==null&&this.cf(i,e)}else if(t instanceof j){let i=t.fromNode;i!==null&&this.cf(i,e);let s=t.toNode;s!==null&&this.cf(s,e)}else{if(t instanceof J){let s=t.labeledLink;s!==null&&this.cf(s,e);let n=t.findTreeParentNode();n!==null&&(!n.isTreeExpanded&&!n.wasTreeExpanded&&e.push(n),this.cf(n,e))}let i=t.containingGroup;i!==null&&(!i.isSubGraphExpanded&&!i.wasSubGraphExpanded&&e.push(i),this.cf(i,e))}return e}canScrollToPart(t){if(t===void 0&&(t=null),t!==null&&!(t instanceof pt))return!1;let e=this.a;return e.selection.count===0&&e.highlighteds.count===0?!1:e.allowHorizontalScroll&&e.allowVerticalScroll}collapseTree(t){t===void 0&&(t=null);let e=this.a,i="Collapse Tree";try{e.startTransaction(i),e.animationManager.Gl(i);let s=new q;if(t!==null&&t.isTreeExpanded)t.collapseTree(),s.add(t);else if(t===null){let n=e.selection.iterator;for(;n.next();){let o=n.value;o instanceof J&&o.isTreeExpanded&&(o.collapseTree(),s.add(o))}}e.T("TreeCollapsed",s)}finally{e.commitTransaction(i)}}canCollapseTree(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly)return!1;if(t!==null){if(!(t instanceof J)||!t.isTreeExpanded)return!1;if(t.findTreeChildrenLinks().count>0)return!0}else{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof J){if(!s.isTreeExpanded)continue;if(s.findTreeChildrenLinks().count>0)return!0}}}return!1}expandTree(t){t===void 0&&(t=null);let e=this.a,i="Expand Tree";try{e.startTransaction(i),e.animationManager.Gl(i);let s=new q;if(t!==null&&!t.isTreeExpanded)t.expandTree(),s.add(t);else if(t===null){let n=e.selection.iterator;for(;n.next();){let o=n.value;o instanceof J&&(o.isTreeExpanded||(o.expandTree(),s.add(o)))}}e.T("TreeExpanded",s)}finally{e.commitTransaction(i)}}canExpandTree(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly)return!1;if(t!==null){if(!(t instanceof J)||t.isTreeExpanded)return!1;if(t.findTreeChildrenLinks().count>0)return!0}else{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof J){if(s.isTreeExpanded)continue;if(s.findTreeChildrenLinks().count>0)return!0}}}return!1}groupSelection(){let t=this.a,e=t.model;if(!e.ff())return;let i=this.archetypeGroupData;if(i===null)return;let s=null;try{t.currentCursor="wait",t.T("ChangingSelection",t.selection),t.startTransaction("Group");let n=new q,o=t.selection.iterator;for(;o.next();){let l=o.value;l.Di()&&l.canGroup()&&n.add(l)}let r=new q,a=n.iterator;for(;a.next();){let l=a.value,u=!1,c=n.iterator;for(;c.next();){let d=c.value;if(l.isMemberOf(d)){u=!0;break}}u||r.add(l)}let h=r.first();if(h!==null){let l=h.containingGroup;if(l!==null)for(;l!==null;){let u=!1,c=r.iterator;for(;c.next();)if(!c.value.isMemberOf(l)){u=!0;break}if(u)l=l.containingGroup;else break}if(i instanceof ht)i.It(),s=i.copy(),s!==null&&t.add(s);else if(e.isGroupForData(i)){let u=e.copyNodeData(i);e.addNodeData(u),s=t.findNodeForData(u)}if(s!==null){l!==null&&this.isValidMember(l,s)&&(s.containingGroup=l);let u=r.iterator;for(;u.next();){let c=u.value;this.isValidMember(s,c)&&(c.containingGroup=s)}t.clearSelection(!0),s.isSelected=!0}}t.T("SelectionGrouped",s)}finally{t.commitTransaction("Group"),t.T("ChangedSelection",t.selection),t.currentCursor=""}}canGroupSelection(){let t=this.a;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowGroup||!t.model.ff()||this.archetypeGroupData===null)return!1;let e=t.selection.iterator;for(;e.next();){let i=e.value;if(i.Di()&&i.canGroup())return!0}return!1}xN(t){let e=m.nt();if(Array.isArray(t))t.forEach(n=>{n instanceof j||n instanceof pt&&e.push(n)});else{let n=t.iterator;for(;n.next();){let o=n.value;o instanceof j||o instanceof pt&&e.push(o)}}let i=new V,s=e.length;for(let n=0;n<s;n++){let o=e[n],r=!0;for(let a=0;a<s;a++)if(o.isMemberOf(e[a])){r=!1;break}r&&i.add(o)}return m.Z(e),i}isValidMember(t,e){if(e===null||t===e||e instanceof j)return!1;let i;return t!==null&&(t===e||t.isMemberOf(e)||(i=t.memberValidation,i!==null&&!i(t,e))||t.data===null&&e.data!==null||t.data!==null&&e.data===null)?!1:(i=this.memberValidation,i!==null?i(t,e):!0)}ungroupSelection(t){t===void 0&&(t=null);let e=this.a,i=e.model;if(i.ff())try{e.currentCursor="wait",e.T("ChangingSelection",e.selection),e.startTransaction("Ungroup");let s=new q;if(t!==null)s.add(t);else{let o=e.selection.iterator;for(;o.next();){let r=o.value;r instanceof ht&&r.canUngroup()&&s.add(r)}}let n=new q;if(s.count>0){e.clearSelection(!0);let o=s.iterator;for(;o.next();){let r=o.value;r.expandSubGraph();let a=r.containingGroup,h=a!==null&&a.data!==null?i.getKeyForNodeData(a.data):void 0;n.addAll(r.memberParts);let l=n.iterator;for(;l.next();){let u=l.value;if(u.isSelected=!0,u instanceof j)continue;let c=u.data;c!==null?i.setGroupForData(c,h):u.containingGroup=a}e.remove(r)}}e.T("SelectionUngrouped",s,n)}finally{e.commitTransaction("Ungroup"),e.T("ChangedSelection",e.selection),e.currentCursor=""}}canUngroupSelection(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly||e.isModelReadOnly||!e.allowDelete||!e.allowUngroup||!e.model.ff())return!1;if(t!==null){if(!(t instanceof ht))return!1;if(t.canUngroup())return!0}else{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof ht&&s.canUngroup())return!0}}return!1}addTopLevelParts(t,e){let i=this.xN(t),s=!0,n=i.iterator;for(;n.next();){let o=n.value;o.containingGroup!==null&&(!e||this.isValidMember(null,o)?o.containingGroup=null:s=!1)}return s}collapseSubGraph(t){t===void 0&&(t=null);let e=this.a,i="Collapse SubGraph";try{e.startTransaction(i),e.animationManager.Gl(i);let s=new q;if(t!==null&&t.isSubGraphExpanded)t.collapseSubGraph(),s.add(t);else if(t===null){let n=e.selection.iterator;for(;n.next();){let o=n.value;o instanceof ht&&o.isSubGraphExpanded&&(o.collapseSubGraph(),s.add(o))}}e.T("SubGraphCollapsed",s)}finally{e.commitTransaction(i)}}canCollapseSubGraph(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly)return!1;if(t!==null)return!(!(t instanceof ht)||!t.isSubGraphExpanded);{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof ht&&s.isSubGraphExpanded)return!0}}return!1}expandSubGraph(t){t===void 0&&(t=null);let e=this.a,i="Expand SubGraph",s=new q;try{if(e.startTransaction(i),e.animationManager.Gl(i),t!==null&&!t.isSubGraphExpanded)t.expandSubGraph(),s.add(t);else if(t===null){let n=e.selection.iterator;for(;n.next();){let o=n.value;o instanceof ht&&(o.isSubGraphExpanded||(o.expandSubGraph(),s.add(o)))}}e.T("SubGraphExpanded",s)}finally{for(let n of s)this.GT(e,n);t&&this.GT(e,t),e.commitTransaction(i)}}GT(t,e){for(let i of e.memberParts)i instanceof J&&t.Gc(i,e)}canExpandSubGraph(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly)return!1;if(t!==null)return!(!(t instanceof ht)||t.isSubGraphExpanded);{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s instanceof ht&&!s.isSubGraphExpanded)return!0}}return!1}editTextBlock(t){t===void 0&&(t=null),t!==null&&m.se(t,lt,jt,"editTextBlock");let e=this.a,i=e.toolManager.findTool("TextEditing");if(i!==null){if(t===null){let s=null,n=e.selection.iterator;for(;n.next();){let o=n.value;if(o.canEdit()){s=o;break}}if(s===null)return;t=s.findInVisualTree(o=>o instanceof lt&&o.editable)}t!==null&&(e.currentTool=null,i.textBlock=t,e.currentTool=i)}}canEditTextBlock(t){t===void 0&&(t=null);let e=this.a;if(e.isReadOnly||e.isModelReadOnly||!e.allowTextEdit||e.toolManager.findTool("TextEditing")===null)return!1;if(t!==null){if(!(t instanceof lt))return!1;let i=t.part;if(i!==null&&i.canEdit())return!0}else{let i=e.selection.iterator;for(;i.next();){let s=i.value;if(s.canEdit()&&(t=s.findInVisualTree(n=>n instanceof lt&&n.editable),t!==null))return!0}}return!1}showContextMenu(t){let e=this.a,i=e.toolManager.findTool("ContextMenu");if(i===null)return;t===void 0&&(t=null),t===null&&(e.selection.count>0?t=e.selection.first():t=e);let s=i.findObjectWithContextMenu(t);if(s!==null){let n=e.lastInput,o;if(s instanceof $?o=s.getDocumentPoint(T.Center):e.viewportBounds.containsPoint(n.documentPoint)?o=P.gn:o=e.viewportBounds.center,o.isReal()){let r=new Qt;r.diagram=e,r.viewPoint=e.transformDocToView(o),r.documentPoint=o,r.button=2,r.up=!0,e.lastInput=r}e.currentTool=i,i.openMenu(!1,s)}}canShowContextMenu(t){let e=this.a,i=e.toolManager.findTool("ContextMenu");return!(i===null||(t===void 0&&(t=null),t===null&&(e.selection.count>0?t=e.selection.first():t=e),i.findObjectWithContextMenu(t)===null))}downloadSvg(t){let e=this.a,i={scale:1,background:e.div?e.div.style.backgroundColor:"white",name:this.$O("svg")};t&&Object.assign(i,t);let s=e.makeSvg(i);if(s!==null){let n=new XMLSerializer().serializeToString(s);this.ZO(i.name,"image/svg+xml",n)}}downloadSVG(t){this.downloadSvg(t)}canDownloadSvg(t){return this.a!==null}ZO(t,e,i){let s=null,n=null;try{let o=new Blob([i],{type:e});s=X.URL.createObjectURL(o),n=m.Ni("a"),n.style.display="none",n.href=s,n.download=t,X.document.body.appendChild(n),requestAnimationFrame(()=>{try{n!==null&&n.click()}finally{s!==null&&X.URL.revokeObjectURL(s),n!==null&&X.document.body.removeChild(n)}})}catch{s!==null&&X.URL.revokeObjectURL(s),n!==null&&X.document.body.removeChild(n)}}$O(t){let e="."+t,i=this.diagram.model.name;return i?i.endsWith(e)&&(i=i.substring(0,i.length-e.length)):i="diagram",i+=e,i}get copiesClipboardData(){return this.j2}set copiesClipboardData(t){this.j2=!!t}get copiesConnectedLinks(){return this.W2}set copiesConnectedLinks(t){this.W2=!!t}get deletesConnectedLinks(){return this.J2}set deletesConnectedLinks(t){this.J2=!!t}get copiesTree(){return this.$2}set copiesTree(t){this.$2=!!t}get deletesTree(){return this.Z2}set deletesTree(t){this.Z2=!!t}get copiesParentKey(){return this.Q2}set copiesParentKey(t){this.Q2=!!t}get copiesGroupKey(){return this._2}set copiesGroupKey(t){this._2=!!t}get storageLocation(){return this.tN}set storageLocation(t){t||(t="memory"),t!=="memory"&&t!=="sessionStorage"&&t!=="localStorage"&&t!=="systemClipboard"&&m.o("Invalid new value for CommandHandler.storageLocation: "+t),this.tN=t}get archetypeGroupData(){return this.eN}set archetypeGroupData(t){t!==null&&m.wc(t,jt,"archetypeGroupData");let e=this.a;this.eN=t}get memberValidation(){return this.da}set memberValidation(t){t!==null&&m.S(t,jt,"memberValidation"),this.da=t}get defaultScale(){return this.diagram.defaultScale}set defaultScale(t){this.diagram.defaultScale=t}get zoomFactor(){return this.iN}set zoomFactor(t){t>1||m.o("zoomFactor must be larger than 1.0, not: "+t),this.iN=t}get isZoomToFitRestoreEnabled(){return this.sN}set isZoomToFitRestoreEnabled(t){this.sN=!!t}get scrollToPartPause(){return this.nN}set scrollToPartPause(t){this.nN=t}computeEffectiveCollection(t,e){let i=this.a,s=i.toolManager.findTool("Dragging"),n=i.currentTool===s;e===void 0&&(e=i.Tp());let o=new Mt;if(t===null)return o;let r=t.iterator;for(;r.next();){let a=r.value;i._r(o,a,n,e)}if(i.draggedLink!==null&&e.dragsLink)return o;for(r=t.iterator;r.next();){let a=r.value;if(a instanceof j){let h=a.fromNode;if(h!==null&&!o.has(h))o.delete(a);else{let l=a.toNode;l!==null&&!o.has(l)&&o.delete(a)}}}return o}static getModifierNames(){return jt.md}static setModifierNames(t){jt.md=t}static KO(t){let e="";return t&1&&(e+=jt.md[0]||""),t&4&&(e+=jt.md[1]||""),t&2&&(e+=jt.md[2]||""),t&8&&(e+=jt.md[3]||""),e}static YO(t){return t===1?jt.XO:t===2?jt.GO:jt.zT}static yN(t,e,i){var s=new P(i,0).rotate(t-e/2),n=new wt().add(new Kt(-i,-i)).add(new Kt(i,i)).add(new Kt(s.x,s.y).add(new mt(5,t-e/2,e,0,0,i,i)));return n.offset(i,i),n}HO(t){t.isTransactionFinished&&this.updateFocusBox()}qO(t){if(t.subject.scale===this.diagram.scale)return;let e=4/this.diagram.scale,i=this.focusBox.findObject("SHAPE");i!==null&&(i.strokeWidth=e);let s=this.focusBox.findObject("SHAPE2");s!==null&&(s.strokeWidth=e,s.strokeDashArray=[e,e]);let n=this.focusBox.placeholder;n!==null&&(n.padding=e)}jO(t){this.focus===null?m.un(()=>{this.focus=this.findFirstFocus()},500):this.onFocusChanged(this.focus,this.focus)}WO(t){this.isVirtualPointerShown=!1}get isFocusEnabled(){return this.oN}set isFocusEnabled(t){t=!!t;let e=this.isFocusEnabled;t!==e&&(t||(this.isVirtualPointerShown=!1,this.gN=this.focus,this.focus=null),this.oN=t,t&&(this.focus=this.gN,this.updateFocusBox()))}get focusBox(){return this.Ip}set focusBox(t){if(!(t instanceof vt))return;let e=this.Ip;if(t!==e&&(this.Ip=t,e.adornedObject!==null)){let i=e.adornedPart;i!==null&&i.removeAdornment("Focus"),t.adornedObject=e.adornedObject,i!==null&&i.addAdornment("Focus",t)}}get focus(){return this.Ip.adornedObject}set focus(t){let e=this.focus;if(t!==e){let i=this.a;if(!i||!this.isFocusEnabled||t!==null&&t.diagram!==i)return;i.currentTool instanceof It||this.cancelVirtualPointer();let s=this.focusBox.adornedPart;s&&s.removeAdornment("Focus"),t===null?(this.gd=null,this.virtualPointerLocation=i.viewportBounds.center,this.focusBox.adornedObject=null):(this.virtualPointerLocation=t.getDocumentPoint(T.Center),this.focusBox.adornedObject=t,this.updateFocusBox()),this.onFocusChanged(e,t)}}onFocusChanged(t,e){let i=this.a;if(i&&(this.focusChanged!==null?this.focusChanged(t,e,this):this.QO(this.describe(t,e)),e!==null&&e.part!==null)){let s=e.getDocumentBounds();i.viewportBounds.containsRect(s)||(e instanceof pt?i.commandHandler.scrollToPart(e):i.scrollToRect(s))}}get focusChanged(){return this.rN}set focusChanged(t){t!==null&&m.S(t,jt,"focusChanged"),this.rN=t}get liveElementId(){return this.N1||this.lN}set liveElementId(t){let e=this.N1;t!==e&&(this.N1=t,this.bN())}bN(){let t=this.diagram;if(!t||!Y.isUsingDOM())return;let e=t.lt?.bt;if(!e)return;let i=this.liveElementId,s=X.document.getElementById(i);this.isUsingAriaLive?(e.removeAttribute("aria-labelledby"),s&&s.setAttribute("aria-live","polite")):(i&&e.setAttribute("aria-labelledby",i),s&&s.removeAttribute("aria-live"))}get isUsingAriaLive(){return this.C1}set isUsingAriaLive(t){let e=this.C1;t!==e&&(this.C1=t,this.bN())}QO(t){let e=this.diagram;if(!e||!Y.isUsingDOM()||!e.div)return;let i=this.liveElementId;if(!i){let n=m.Ni("span"),o=n.style;for(o.opacity="0",o.position="absolute",o.right="-9999px",o.bottom="-9999px",o.width="0px",o.height="0px",o.overflow="hidden",o.border="0",i=(e.div.id||"diagram")+"_aria";X.document.getElementById(i);)i+=Math.floor(Math.random()*10);n.id=i,this.lN=i,e.div.appendChild(n),this.bN()}let s=X.document.getElementById(i);s&&(s.textContent=t)}describe(t,e){let i="";e instanceof J?e instanceof ht?i="Group":i="Node":e instanceof j?i="Link":e instanceof pt?i="Part":e&&(e.click?i="button":e instanceof lt&&e.editable&&(i="editable"),e.portId!==null&&(i&&(i+=" "),i+="port",e.portId&&(i+=" "+e.portId)));let s=this.kN(e);s&&(i+=" "+s);let n=e;if(t&&n instanceof j&&n.fromNode&&n.toNode){if(t instanceof J&&t.part===n.fromNode||t instanceof j&&t.fromNode===n.fromNode){i+=" to "+this.kN(n.toNode,!0);let o=n.toPort?.portId;o&&(i+=" port "+o)}else if(t instanceof J&&t.part===n.toNode||t instanceof j&&t.toNode===n.toNode){i+=" from "+this.kN(n.fromNode,!0);let o=n.fromPort?.portId;o&&(i+=" port "+o)}}return i}kN(t,e){if(e===void 0&&(e=!1),!t)return"";if(t instanceof lt&&t.text)return t.text;if(t instanceof G){let i="";return t instanceof pt&&t.text&&(i=t.text),e&&i||t.walkVisualTreeFrom(t,(s,n)=>{n.isVisibleObject()&&n instanceof lt&&n.text&&(!e||!i)&&i!==n.text&&(i+=" "+n.text)}),i}return""}updateFocusBox(){let t=this.focus;if(t!==null)if(t.diagram!==null&&(t instanceof pt?t.isVisible():t.isVisibleObject()&&t.part?.isVisible()))this.focusBox.adornedObject=t,t.part?.addAdornment("Focus",this.focusBox);else{let e=null;if(t instanceof pt||(e=t.part),e instanceof pt&&e.isVisible())this.focus=e;else{if(e instanceof J&&!e.isVisible()){let i=e.findTreeParentNode();if(i!==null)e=i;else{let s=e.labeledLink;s!==null&&(e=s)}}for(;e instanceof pt&&!e.isVisible();)e=e.containingGroup;e instanceof pt&&e.isVisible()?this.focus=e:this.focus=null}}}findFirstFocus(){let t=this.a;if(t===null||!t.isEnabled)return null;if(this.focus!==null)return this.focus;if(this.isFocusEnabled)if(t.selection.count>0)this.focus=t.selection.first();else{let e=this.YT(t.isTreePathToChildren).first();if(e!==null)return e}return null}get isVirtualPointerEnabled(){return this.aN}set isVirtualPointerEnabled(t){t=!!t;let e=this.isVirtualPointerEnabled;if(t!==e&&(this.aN=t,t)){let i=this.Vp;i&&(this.Vp=null,i.commandHandler.Ps=null,i.commandHandler.cancelVirtualPointer())}}get isVirtualPointerShown(){return this.hN}set isVirtualPointerShown(t){t=!!t;let e=this.isVirtualPointerShown;if(t!==e){let i=this.a;if(!i||!this.isVirtualPointerEnabled)return;this.hN=t;let s=this.focus;t?this.virtualPointerBox.diagram===null&&(this.virtualPointerLocation.isReal()||(s!==null?this.virtualPointerLocation=s.getDocumentPoint(T.Center):this.virtualPointerLocation=i.viewportBounds.center),i.add(this.virtualPointerBox),this.ma()):this.virtualPointerBox.diagram!==null&&(i.remove(this.virtualPointerBox),this.ma())}}cancelVirtualPointer(){let t=this.a;t&&(this.wN(),this.isVirtualPointerShown=!1,t.currentTool.doCancel(),this.isVirtualPointerDown=!1,this.PN())}PN(){let t=this.Ps;if(t!==null){this.Ps=null;let e=t.commandHandler;e.Ps=null,e.Vp=null,e.isVirtualPointerShown=!1,e.isVirtualPointerDown=!1,e.wN(),this.L1&&(e.isVirtualPointerEnabled=!1),this.L1=!1}}wN(){this.Oi.button=0,this.Oi.modifiers=0,this.Oi.clickCount=1,this.Oi.down=!1,this.ma()}ma(){this.virtualPointerChanged!==null&&this.virtualPointerChanged(this.virtualPointerBox,this),this.updateVirtualPointer()}updateVirtualPointer(){let t=this.virtualPointerBox.diagram;t&&(this.virtualPointerBox.scale=1/t.scale),this.virtualPointerBox.updateTargetBindings()}get virtualPointerBox(){return this.dd}set virtualPointerBox(t){if(!(t instanceof pt))return;let e=this.dd;t!==e&&(e!==null&&(t.location=e.location,e.diagram!==null&&e.diagram.remove(e)),this.dd=t,this.isVirtualPointerShown&&this.diagram&&(this.diagram.add(t),t.data=e.data),this.ma())}get virtualPointerChanged(){return this.cN}set virtualPointerChanged(t){t!==null&&m.S(t,jt,"virtualPointerChanged"),this.cN=t}get virtualPointerLocation(){return this.virtualPointerBox.location}set virtualPointerLocation(t){this.virtualPointerLocation.equals(t)||this.KT(t.x,t.y)}get isVirtualPointerDown(){return this.virtualPointerBox.data?this.virtualPointerBox.data.down:!1}set isVirtualPointerDown(t){t=!!t;let e=this.isVirtualPointerDown;if(t!==e){let i=this.a;if(!i||!this.isVirtualPointerEnabled||(this.virtualPointerBox.data===null&&(this.dd.data=this.Oi),this.virtualPointerBox.data.down=t,this.ma(),!this.isVirtualPointerShown))return;let s=i.lastInput,n=new Qt;n.diagram=i,this.HT(n,t),t?n.down=!0:n.up=!0,n.clickCount=1,n.button=this.Oi.button,n.modifiers=this.Oi.modifiers,t&&(i.firstInput=n.copy()),this.pd(n,!0),t||this.Oi.clickCount===2&&(n.clickCount=2,n.down=!0,n.up=!1,this.pd(n,!0),n.down=!1,n.up=!0,this.pd(n,!0),this.qT(1)),i.lastInput=s}}get virtualPointerShiftMove(){return this.Ep}set virtualPointerShiftMove(t){this.Ep=t}get virtualPointerControlMove(){return this.Up}set virtualPointerControlMove(t){this.Up=t}Bp(t,e){this.KT(this.virtualPointerLocation.x+t,this.virtualPointerLocation.y+e)}KT(t,e){this.virtualPointerBox.moveTo(t,e,!0);let i=this.a;if(!i||!this.isVirtualPointerEnabled||!this.isVirtualPointerShown)return;i.ensureBounds();let s=i.lastInput,n=new Qt;n.diagram=i,this.HT(n,this.isVirtualPointerDown),n.button=this.Oi.button,n.modifiers=this.Oi.modifiers,this.pd(n,!0),i.lastInput=s,this.isVirtualPointerDown&&(i.remove(this.virtualPointerBox),i.add(this.virtualPointerBox)),this.ma()}HT(t,e){let i=this.a;if(i){if(t.targetDiagram=i,t.documentPoint=this.virtualPointerLocation,i.allowDragOut){let s=i.div.getBoundingClientRect(),n=i.transformDocToView(this.virtualPointerLocation),o=s.x+n.x,r=s.y+n.y,a=X.document.elementFromPoint(o,r)||null;a instanceof HTMLCanvasElement&&(a=a.parentElement),a!==null&&a.shadowRoot&&(a=a.shadowRoot.elementFromPoint(o,r)||null,a instanceof HTMLCanvasElement&&(a=a.parentElement));let h=null;if(a instanceof HTMLElement&&(h=Y.ji.get(a))&&h!==i&&h.div){let l=h.div.getBoundingClientRect(),u=new P(n.x-(l.x-s.x),n.y-(l.y-s.y));this.Ps!==null&&this.Ps!==h&&this.PN(),t.targetDiagram=h,t.viewPoint=u,t.documentPoint=h.transformViewToDoc(u),t.viewPoint=h.transformDocToView(t.documentPoint),this.Ps=h;let c=h.commandHandler;this.L1=!c.isVirtualPointerEnabled,c.isVirtualPointerEnabled=!0,c.isVirtualPointerDown=e,c.virtualPointerLocation=t.documentPoint,c.isVirtualPointerShown=!0,c.Vp=i;return}}this.Ps!==null&&this.PN(),t.viewPoint=i.transformDocToView(t.documentPoint)}}pd(t,e){this.doVirtualPointerEvent(t,e)}doVirtualPointerEvent(t,e){let i=this.a;i&&(t.timestamp=Date.now(),i.lastInput=t,e&&(t.up?i.doMouseUp():t.down?i.doMouseDown():i.doMouseMove()),this.onVirtualPointerEvent(t,e))}onVirtualPointerEvent(t,e){let i=this.a;i&&(t.up?this.isVirtualPointerDown&&!i.viewportBounds.containsPoint(this.virtualPointerLocation)&&(this.virtualPointerLocation=this.focus instanceof $?this.focus.getDocumentPoint(T.Center):i.viewportBounds.center):t.down)}doVirtualFocusKeyDown(){let t=this.a;if(!t)return!1;let e=t.lastInput,i=e.commandKey;if(this.isVirtualPointerEnabled&&(i==="ShiftLeft"||i==="ShiftRight"))return this.isVirtualPointerShown=!0,!0;if(this.XT.indexOf(i)>=0)if(e.shift&&this.isVirtualPointerShown){let s=this.A1(i),n=e.control||e.meta?this.Up:this.Ep;s===270?this.Bp(0,-n):s===90?this.Bp(0,n):s===180?this.Bp(-n,0):this.Bp(n,0)}else this._O();else if(e.shift&&this.isVirtualPointerShown&&(i==="Numpad1"||i==="Numpad2"||i==="Numpad3"||i==="Numpad4"||i==="Numpad6"||i==="Numpad7"||i==="Numpad8"||i==="Numpad9")){let s=e.control||e.meta?this.Up:this.Ep,n=0;i==="Numpad1"||i==="Numpad4"||i==="Numpad7"?n=-s:(i==="Numpad3"||i==="Numpad6"||i==="Numpad9")&&(n=s);let o=0;i==="Numpad7"||i==="Numpad8"||i==="Numpad9"?o=-s:(i==="Numpad1"||i==="Numpad2"||i==="Numpad3")&&(o=s),this.Bp(n,o)}else if(i==="Enter"||i==="NumpadEnter"||i==="Numpad5")e.shift&&this.isVirtualPointerShown?this.isVirtualPointerDown=!this.isVirtualPointerDown:this.tI();else if(i==="Escape")this.eI();else if(i==="Space")this.iI();else if(i==="ContextMenu"||e.shift&&i==="F10"||(e.control||e.meta)&&e.shift&&i==="Backslash")this.sI();else if(e.shift&&i==="c")this.T1(1);else if(e.shift&&i==="a")this.T1(2);else if(e.shift&&i==="KeyS")this.T1(4);else if(e.shift&&i==="KeyM")this.T1(8);else if(e.shift&&i==="Digit1")this.D1(0);else if(e.shift&&i==="Digit2")this.D1(1);else if(e.shift&&i==="Digit3")this.D1(2);else if(e.shift&&i==="Numpad0"){let s=this.Oi.button;this.D1(s===2?0:2)}else if(e.shift&&(i==="KeyD"||i==="NumpadDecimal")){let s=this.Oi.clickCount;this.qT(s===2?1:2)}else if(e.shift&&i==="KeyF"){let s=this.nextFocusFormula;this.nextFocusFormula=s==="distance"?"linear":"distance"}else if(e.shift&&i==="y")this.isUsingAriaLive=!this.isUsingAriaLive;else return!1;return!0}doVirtualFocusKeyUp(){let t=this.a;if(!t)return!1;let e=t.lastInput.commandKey;return this.isVirtualPointerEnabled&&(e==="ShiftLeft"||e==="ShiftRight")&&(this.isVirtualPointerShown=!1),!0}A1(t){switch(t){case"ArrowDown":return 90;case"ArrowLeft":return 180;case"ArrowUp":return 270;default:return 0}}XT=["ArrowRight","ArrowDown","ArrowLeft","ArrowUp"];T1(t){let e=this.Oi.modifiers;this.Oi.modifiers=e&t?e&~t:e|t,this.ma()}qT(t){this.Oi.clickCount=t,this.ma()}D1(t){this.Oi.button=t,this.ma()}_O(){let t=this.a;if(!t)return;let e=t.lastInput,i=this.focus;if(i===null){let s=this.YT(t.isTreePathToChildren).first();s!==null&&(this.focus=s)}else if(i instanceof j)this.nI(i);else if(i instanceof J)this.oI(i);else{i instanceof pt&&(this.gd=null);let s=this.A1(e.commandKey);s===270?this.focus=this.findNextFocus(270):s===90?this.focus=this.findNextFocus(90):s===180?this.focus=this.findNextFocus(180):this.focus=this.findNextFocus(0)}}nI(t){let e=this.a;if(!e)return;let i=e.lastInput,s=this.A1(i.commandKey),n=null,o=this.gd;if(o!==null){let r=this.pN;if(s===r)n=t.getOtherNode(o);else if(s===C.Ee(r+180))n=o;else{let a=r===0||r===180?90:0,h=r===0||r===180?270:180;if(s===a){let l=this.SN(o,r,!0),u=l.indexOf(t);u>=0&&u<l.count-1&&(this.focus=l.elt(u+1))}else if(s===h){let l=this.SN(o,r,!0),u=l.indexOf(t);u>0&&(this.focus=l.elt(u-1))}}}else{let r=t.fromNode,a=t.toNode;if(!r||!a)return;s===270?n=r.location.y<a.location.y?r:a:s==90?n=r.location.y>a.location.y?r:a:s===180?n=r.location.x<a.location.x?r:a:n=r.location.x>a.location.x?r:a}for(;n!==null&&!n.isVisible();)n=n.containingGroup;n!==null&&(this.focus=n)}oI(t){let e=this.a;if(!e)return;let i=e.lastInput,s=this.A1(i.commandKey);if(i.control||i.meta){let n=this.SN(t,s,!0).first();n&&(this.gd=t,this.pN=s,this.focus=n)}else this.gd=null,this.focus=this.findNextFocus(s)}SN(t,e,i){if(t===null)return new q;let s=t.actualBounds;if(!s.isReal())return new q;let n=new Set;(t instanceof ht?t.findExternalLinksConnected():t.findLinksConnected()).each(r=>{if(!r.isVisible())return;let a=null;if(r.fromNode===t?a=r.toNode:r.toNode===t?a=r.fromNode:t instanceof ht&&(r.fromNode?.isMemberOf(t)?a=r.toNode:r.toNode?.isMemberOf(t)&&(a=r.fromNode)),a===null||a.isMemberOf(t))return;for(;a!==null&&!a.isVisible();)a=a.containingGroup;if(a===null)return;let h=a.location;if(h.isReal()&&!(e===270&&(a!==t?h.y>=s.top:r.midPoint.y>=s.top))){if(e===90&&(a!==t?h.y<=s.bottom:r.midPoint.y<=s.bottom)||e===180&&(a!==t?h.x>=s.left:r.midPoint.x>=s.left)||e===0&&(a!==t?h.x<=s.right:r.midPoint.x<=s.right))return;i&&r.actualBounds.isReal()?n.add(r):n.add(a)}});let o=new q(n);return e===90||e===270?o.sort((r,a)=>r.actualBounds.centerX-a.actualBounds.centerX):o.sort((r,a)=>r.actualBounds.centerY-a.actualBounds.centerY),o}findNextFocus(t){t=C.Ee(t);let e=this.focus,i=e instanceof J?e.location:e.getDocumentPoint(T.Center),s=1/0,n=e,o=(r,a,h,l)=>{if(this.nextFocusFormula==="linear"){let u=1/0;t===0&&h>i.x||t===180&&h<i.x?u=Math.abs(h-i.x):(t===90&&l>i.y||t===270&&l<i.y)&&(u=Math.abs(l-i.y)),u<s&&(s=u,n=r)}else{if(t===0&&(a.right<i.x||(a.centerX-i.x)**2>s)||t===90&&(a.bottom<i.y||(a.centerY-i.y)**2>s)||t===180&&(a.x>i.x||(i.x-a.centerX)**2>s)||t===270&&(a.y>i.y||(i.y-a.centerY)**2>s))return;let u=i.direction(h,l),c=C.jF(t,u);if(t===90||t===270?c<=45:c<45){let d=i.distanceSquared(h,l);d<s&&(s=d,n=r)}}};if(e instanceof pt&&e.diagram!==null){let r=e.containingGroup;r!==null?r.memberParts.each(a=>{a===e||a instanceof j||!a.isVisible()||o(a,a.actualBounds,a.location.x,a.location.y)}):(e.diagram.nodes.each(a=>{a===e||!a.isTopLevel||!a.isVisible()||o(a,a.actualBounds,a.location.x,a.location.y)}),e.diagram.parts.each(a=>{a===e||!a.isTopLevel||!a.isVisible()||o(a,a.actualBounds,a.location.x,a.location.y)}))}else if(e.part!==null){let r=new I;this.MN(e.part).each(a=>{a!==e&&(a.getDocumentBounds(r),o(a,r,r.centerX,r.centerY))})}return n}get nextFocusFormula(){return this.mN}set nextFocusFormula(t){this.mN=t}tI(){let t=this.a;if(!t)return;let e=t.currentTool;if(e instanceof It){let n=e.currentObject;this.v1(this.focus),e.maybeStopTool(this.focus),t.currentTool instanceof It||(this.focus=n);return}let i=this.focus,s=t.lastInput;if(i===null)s.control||s.meta?this.v1(null):this.focus=this.findFirstFocus();else if(i instanceof pt)if(s.control||s.meta)this.v1(i);else{let n=this.MN(i);if(n.count>0)this.focus=n.first();else if(i instanceof j&&i.isLabeledLink){let o=i.labelNodes.first();o!==null&&o.isVisible()&&(this.focus=o)}else if(i instanceof ht&&i.isSubGraphExpanded){let o=i.memberParts.first();o!==null&&o.isVisible()&&(this.focus=o)}}else this.v1(i)}YT(t){let e=new q,i=this.a;if(!i)return e;let s=0;for(;e.count===0&&s<i.nodes.count;){let n=i.nodes;for(;n.next();){let o=n.value;o.isTopLevel&&o.isVisible()&&(t?o.findNodesInto():o.findNodesOutOf()).count===s&&e.add(o)}s++}return e}MN(t){return t instanceof pt?this.Pn(t,new q):new q}Pn(t,e){return!(t instanceof pt)&&t.isVisibleObject()&&t.isEnabledObject()&&(t.contextMenu||t.click||t instanceof lt&&t.editable||t.part instanceof J&&t.portId!==null&&(t.portId!==""||t.part.ports.count>1)||t.toolTip)&&e.add(t),t instanceof G&&t.elements.each(i=>this.Pn(i,e)),e}v1(t){let e=this.a;if(!e)return;let i=e.lastInput,s=t instanceof $?t:e;if(s.click){let n=new Qt;n.diagram=e,n.documentPoint=t instanceof $?t.getDocumentPoint(T.Center):e.viewportBounds.center,n.viewPoint=e.transformDocToView(n.documentPoint),n.button=0,n.clickCount=1,n.targetObject=t,this.pd(n,!1),s instanceof $?s.click(n,s):s.click(n),e.lastInput=i}else s instanceof lt&&s.editable?this.editTextBlock(s):this.jT(t)}eI(){let t=this.a;if(!t)return;let e=t.currentTool;if(e instanceof ne&&e.currentToolTip!==null){e.hideToolTip();return}else if(e instanceof It){let i=e.currentObject;e.doKeyDown(),this.focus=i;return}if(this.focus instanceof pt){let i=this.focus;i instanceof J&&i.labeledLink!==null?this.focus=i.labeledLink:i.containingGroup!==null?this.focus=i.containingGroup:this.focus=null}else if(this.focus instanceof $){let i=this.focus.part;if(i instanceof j&&i.isLabeledLink){let s=i.labelNodes.first();if(s!==null&&s.isVisible()){this.focus=s;return}}else if(i instanceof ht&&i.isSubGraphExpanded){let s=i.memberParts.first();if(s!==null&&s.isVisible()){this.focus=s;return}}this.focus=i}else this.cancelVirtualPointer(),this.stopCommand()}iI(){let t=this.a;if(t)if(t.lastInput.shift&&this.isVirtualPointerShown){let e=t.findPartAt(this.virtualPointerLocation);e!==null&&(e===this.focus?this.WT():this.focus=e)}else this.WT()}WT(){let t=this.a;if(!t)return;let e=t.lastInput,i=this.focus;if(i instanceof pt){let s=i.part;if(e.control||e.meta){for(t.raiseDiagramEvent("ChangingSelection",t.selection);s!==null&&!s.canSelect();)s=s.containingGroup;s!==null&&(s.isSelected=!s.isSelected),t.raiseDiagramEvent("ChangedSelection",t.selection)}else if(e.shift){if(s!==null&&!s.isSelected){for(t.raiseDiagramEvent("ChangingSelection",t.selection);s!==null&&!s.canSelect();)s=s.containingGroup;s!==null&&(s.isSelected=!0),t.raiseDiagramEvent("ChangedSelection",t.selection)}}else if(s!==null&&!s.isSelected){for(;s!==null&&!s.canSelect();)s=s.containingGroup;s!==null&&t.select(s)}}this.jT(i),this.onFocusChanged(i,i)}jT(t){let e=this.a;if(!e)return;e.toolManager.hideToolTip();let i=e.lastInput,s=t instanceof $?t:e;for(;s instanceof $&&!s.toolTip;)s=s.panel;if(s&&s.toolTip){let n=new Qt;n.diagram=e,n.documentPoint=t!==null?t.getDocumentPoint(T.Center):e.viewportBounds.center,n.viewPoint=e.transformDocToView(n.documentPoint),n.targetObject=t,this.pd(n,!1),e.toolManager.showToolTip(s.toolTip,t),e.lastInput=i}}sI(){let t=this.a;if(!t)return;let e=this.focus;if(this.canShowContextMenu(e)){this.showContextMenu(e);let i=t.toolManager.contextMenuTool.currentContextMenu;if(i instanceof vt){let s=this.MN(i);s.count>0&&(this.focus=s.first())}}}}var Bi=(x=>(x[x.None=0]="None",x[x.Default=1]="Default",x[x.Vertical=4]="Vertical",x[x.Horizontal=5]="Horizontal",x[x.Fill=2]="Fill",x))(Bi||{}),Vi=(x=>(x[x.None=0]="None",x[x.Along=21]="Along",x[x.Plus90=22]="Plus90",x[x.Minus90=23]="Minus90",x[x.Opposite=24]="Opposite",x[x.Upright=25]="Upright",x[x.Plus90Upright=26]="Plus90Upright",x[x.Minus90Upright=27]="Minus90Upright",x[x.Upright45=28]="Upright45",x))(Vi||{}),Xs=(x=>(x[x.None=0]="None",x[x.Vertical=1]="Vertical",x[x.Horizontal=2]="Horizontal",x[x.Both=3]="Both",x))(Xs||{});class ${n;zp;Xp;pa;w;ya;ft;ct;hi;Zt;Gp;$s;Lt;cs;el;wa;Se;Th;it;Xt;il;De;Ke;yd;de;wd;Ot;he;sl;F1;xa;uf;constructor(){V.Je(this),this.n=30723,this.Zt=1,this.Gp="",this.$s=null,this.Lt=null,this.ct=new P(NaN,NaN).k(),this.cs=st.Zw,this.el=new Nt,this.wa=new Nt,this.Se=null,this.Th=1,this.it=1,this.Xt=0,this.il=Dt.im,this.hi=new I(NaN,NaN,NaN,NaN).k(),this.De=new I(NaN,NaN,NaN,NaN).k(),this.Ke=new I(0,0,NaN,NaN).k(),this.yd=null,this.zp=null,this.ft=null,this.de=T.Default,this.wd=T.Default,this.Xp=0,this.pa=0,this.Ot=null,this.w=null,this.ya=null,this.he=null,this.F1=null,this.xa=null,this.sl=null,this.uf=null}cloneProtected(t){t.n=(this.n|2048|4096)&-32769,t.Zt=this.Zt,t.Gp=this.Gp,t.Lt=this.Lt,t.ct.h(this.ct),t.cs=this.cs.N(),this.Se!==null?t.Se=this.Se.copy():t.Se=null,t.it=this.it,t.Xt=this.Xt,t.il=this.il.N(),t.hi.h(this.hi),t.De.h(this.De),t.Ke.h(this.Ke),t.zp=this.zp,this.ft!==null&&(t.ft=this.ft.copy()),t.de=this.de.N(),t.wd=this.wd.N(),t.Xp=this.Xp,t.pa=this.pa,this.Ot!==null&&(t.Ot=this.Ot.copy()),this.w!==null&&(this.w.me?t.w=this.w:t.w=this.w.copy()),this.ya!==null&&(t.ya=this.ya.slice()),this.he!==null&&(t.he=this.he.copy())}addCopyProperty(t){let e=this.ya;if(!Array.isArray(e))e=[],this.ya=e;else for(let i=0;i<e.length;i++)if(e[i]===t)return;e.push(t)}Ho(t){t.yd=null,t.sl=null,t.f()}clone(){let t=new this.constructor;if(this.cloneProtected(t),this.ya!==null)for(let e=0;e<this.ya.length;e++){let i=this.ya[e];t[i]=this[i]}return t}copy(){return this.clone()}ZS(){let t=this.ve;if(t!==null){this.ve=null;for(let e of t)e.xd()&&(e.isToData?this.themeData(e.targetProperty,e.sourceProperty,e.themeSource,e.converter,e.themeConverter):e.isToObject?this.themeObject(e.targetProperty,e.sourceProperty,e.themeSource,e.converter,e.themeConverter,e.sourceName):e.isToModel?this.themeModel(e.targetProperty,e.sourceProperty,e.themeSource,e.converter,e.themeConverter):this.theme(e.targetProperty,e.sourceProperty,e.themeSource,e.converter,e.themeConverter))}return this}fe(t){t in Vi?this.segmentOrientation=t:t in Bi?this.stretch=t:m.ur(this,t)}toString(){return m.Kn(this.constructor)+"#"+V.xs(this)}static None=0;static Default=1;static Fill=2;static Vertical;static Horizontal;static Uniform=6;static UniformToFill=7;static FlipVertical=1;static FlipHorizontal=2;static FlipBoth=3;ba(){this.w!==null&&(this.w.me=!0)}Yt(){return this.w===null?this.w=new Ue:this.w.me&&(this.w=this.w.copy()),this.w}Wi(){if(this.ft===null){let t=new Ni;t.Dh=T.None,t.vh=T.None,t.Fh=10,t.Rh=10,t.Oh=0,t.Ih=0,this.ft=t}return this.ft}raiseChangedEvent(t,e,i,s,n,o,r){let a=this.part;if(a!==null){a.df(t,e,i,s,n,o,r),i===this&&t===2&&this.gf()&&this.Eh(a,e);let h=this.diagram;if(this.Ts!==null&&h!==null&&h.Qa&&!h.undoManager.isUndoingRedoing&&!h.animationManager.Eu){let l=this.Ts.get(e);if(l!==null&&h.animationManager.isEnabled&&!h.animationManager.isTicking){this.uf===null&&(this.uf=new Mt);let u=h.undoManager.transactionLevel===0;if(l.startCondition===2?u=!0:l.startCondition===3&&(u=!1),u){let c=new ye;l.OR(c);let d=this.uf.get(l);d!==null&&d.stop(),this.uf.set(l,c),c.tb=this,c.vM=l,c.add(this,e,s,n),c.start()}else h.animationManager.getBundleAnimation().add(this,e,s,n)}}if(this instanceof G&&i===a&&a.NN()&&a.data!==null){let l=this.D.r,u=l.length;for(let c=0;c<u;c++){let d=l[c];d instanceof G&&d.Pn(f=>{f.data!==null&&f.NN()&&f.updateTargetBindings(e)})}}}}DR(t){this.uf&&this.uf.delete(t)}Go(){if(this.diagram!==null&&this.findBindingPanel()===null&&this.ve!==null){let t=this.diagram.model,e=this.ve.iterator;for(;e.next();){let i=e.value;if(!i.isToTheme)continue;let s=null,n=i.sourceName;i.isToObject&&(s=this.JT(n));let o=this,r=i.targetId;r!==-1&&(o=this.Yp(r),o===null)||(n==="/"?s=o.part:n==="."?s=o:n===".."&&(s=o.panel),i.updateTarget(o,s,void 0,t))}}}Eh(t,e){let i=this.findBindingPanel();if(i!==null){let s=t.diagram,n=this.ve.iterator;for(;n.next();){let o=n.value,r=null;if(o.isToObject){if(r=o.$T(i,this),r===null)continue;o.updateSource(this,r,e,null)}else if(o.isToModel)s!==null&&!s.wi&&o.updateSource(this,s.model.modelData,e,i);else if(!o.isToTheme){let a=i.data;if(a===null)continue;s!==null&&!s.wi&&o.updateSource(this,a,e,i)}if(r===this){let a=o.targetId,h=i.Yp(a);h!==null&&o.updateTarget(h,r,e,s?.model)}}}}Yp(t){return this.no===t?this:null}JT(t){let e;return t===""?e=this:t==="/"?e=this:t==="."?e=this:t===".."?e=this:e=this.part.findObject(t),e}get no(){return this.w!==null?this.w.no:-1}set no(t){this.no!==t&&(this.w===null&&(this.w=new Ue),this.w.no=t)}get ve(){return this.w!==null?this.w.ve:null}set ve(t){this.ve!==t&&(this.w===null&&(this.w=new Ue),this.w.ve=t)}get oo(){return this.w!==null?this.w.oo:null}set oo(t){this.oo!==t&&(this.w===null&&(this.w=new Ue),this.w.oo=t)}raiseChanged(t,e,i){this.raiseChangedEvent(2,t,this,e,i)}t(t,e,i){this.raiseChangedEvent(2,t,this,e,i)}ro(t,e,i,s){let n=this.hi;if(n.e(t,e,i,s),this.it!==1||this.Xt!==0){this.Se===null&&(this.Se=new Nt);let o=this.Se;o.Ue(),this.Kp(o,t,e,i,s),o.sm(n)}}ZT(t,e,i){return this.pickable===!1?!1:(i.bc(this.v),e?this.intersectsRect(t,i):this.containedInRect(t,i))}QT(t,e,i){if(this.pickable===!1)return!1;let s=this.naturalBounds,n=t.distanceSquaredPoint(e);return i?P.distanceLineSegmentSquared(t.x,t.y,0,0,0,s.height)<=n||P.distanceLineSegmentSquared(t.x,t.y,0,s.height,s.width,s.height)<=n||P.distanceLineSegmentSquared(t.x,t.y,s.width,s.height,s.width,0)<=n||P.distanceLineSegmentSquared(t.x,t.y,s.width,0,0,0)<=n:t.distanceSquared(0,0)<=n&&t.distanceSquared(0,s.height)<=n&&t.distanceSquared(s.width,0)<=n&&t.distanceSquared(s.width,s.height)<=n}Mn(){return!0}containsPoint(t){let e=P.l();e.h(t),this.v.gt(e);let i=this.actualBounds;if(!i.isReal())return P.i(e),!1;let s=this.diagram;if(s!==null&&s.pp){let o=s.getInputOption("extraTouchThreshold"),r=s.getInputOption("extraTouchArea"),a=r/2,h=this.naturalBounds,l=this.getDocumentScale()*s.scale,u=1/l;if(h.width*l<o&&h.height*l<o){let c=I.contains(i.x-a*u,i.y-a*u,i.width+r*u,i.height+r*u,e.x,e.y);return P.i(e),c}}let n=!1;return(this instanceof vt||this instanceof et?I.contains(i.x-5,i.y-5,i.width+10,i.height+10,e.x,e.y):i.containsPoint(e))&&(this.he&&!this.he.containsPoint(e)?n=!1:this.Lt!==null&&this.Ke.containsPoint(t)?n=!0:n=this.ka(t)),P.i(e),n}ka(t){let e=this.naturalBounds;return I.contains(0,0,e.width,e.height,t.x,t.y)}containsRect(t){if(this.angle===0)return this.actualBounds.containsRect(t);let e=this.naturalBounds,i=I.z(0,0,e.width,e.height),s=this.v,n=!1,o=P.z(t.x,t.y);return i.containsPoint(s.Ci(o))&&(o.e(t.x,t.bottom),i.containsPoint(s.Ci(o))&&(o.e(t.right,t.bottom),i.containsPoint(s.Ci(o))&&(o.e(t.right,t.y),i.containsPoint(s.Ci(o))&&(n=!0)))),P.i(o),I.i(i),n}containedInRect(t,e){if(e===void 0)return t.containsRect(this.actualBounds);let i=this.naturalBounds,s=e,n=!1,o=P.z(0,0);return t.containsPoint(s.gt(o))&&(o.e(0,i.height),t.containsPoint(s.gt(o))&&(o.e(i.width,i.height),t.containsPoint(s.gt(o))&&(o.e(i.width,0),t.containsPoint(s.gt(o))&&(n=!0)))),P.i(o),n}intersectsRect(t,e){if(e===void 0&&(e=this.v,this.angle===0))return t.intersectsRect(this.actualBounds);let i=this.naturalBounds,s=e,n=P.z(0,0),o=P.z(0,i.height),r=P.z(i.width,i.height),a=P.z(i.width,0),h=!1;if(t.containsPoint(s.gt(n))||t.containsPoint(s.gt(o))||t.containsPoint(s.gt(r))||t.containsPoint(s.gt(a)))h=!0;else{let l=I.z(0,0,i.width,i.height),u=P.z(t.x,t.y);l.containsPoint(s.Ci(u))?h=!0:(u.e(t.x,t.bottom),l.containsPoint(s.Ci(u))?h=!0:(u.e(t.right,t.bottom),l.containsPoint(s.Ci(u))?h=!0:(u.e(t.right,t.y),l.containsPoint(s.Ci(u))&&(h=!0)))),P.i(u),I.i(l),h||(C.lx(t,n,o)||C.lx(t,o,r)||C.lx(t,r,a)||C.lx(t,a,n))&&(h=!0)}return P.i(n),P.i(o),P.i(r),P.i(a),h}getDocumentPoint(t,e){if(e===void 0&&(e=new P),t instanceof T){let i=t,s=this.naturalBounds;return e.e(i.x*s.width+i.offsetX,i.y*s.height+i.offsetY),this.Ws.gt(e),e}else return e.set(t),this.Ws.gt(e),e}getDocumentBounds(t){t===void 0&&(t=new I);let e=this.naturalBounds,i=this.Ws,s=P.z(0,0).v(i);return t.e(s.x,s.y,0,0),s.e(e.width,0).v(i),t.re(s.x,s.y,0,0),s.e(e.width,e.height).v(i),t.re(s.x,s.y,0,0),s.e(0,e.height).v(i),t.re(s.x,s.y,0,0),P.i(s),t}getDocumentAngle(){return this.Ws.KF()}getDocumentScale(){if(this.Hp()===!1)return this.Th;let t=this.it;return this.panel!==null?t*this.panel.getDocumentScale():t}getLocalPoint(t,e){return e===void 0&&(e=new P),e.h(t),this.Ws.Ci(e),e}getNearestIntersectionPoint(t,e,i){return this.mf(t.x,t.y,e.x,e.y,i)}mf(t,e,i,s,n){let o=this.v,r=1/(o.m11*o.m22-o.m12*o.m21),a=o.m22*r,h=-o.m12*r,l=-o.m21*r,u=o.m11*r,c=r*(o.m21*o.dy-o.m22*o.dx),d=r*(o.m12*o.dx-o.m11*o.dy),f=t*a+e*l+c,p=t*h+e*u+d,g=i*a+s*l+c,y=i*h+s*u+d;n.e(0,0);let b=this.naturalBounds,v=C.Cl(0,0,b.width,b.height,f,p,g,y,n);return n.v(o),v}ht(t,e,i,s){if(this.Xo()===!1)return;let n=this.il,o=n.right+n.left,r=n.top+n.bottom;t=Math.max(t-o,0),e=Math.max(e-r,0),i=i||0,s=s||0,i=Math.max(i-o,0),s=Math.max(s-r,0);let a=this.angle,h=0,l=this.desiredSize,u=this.qp();a===90||a===270?(t=isFinite(l.height)?l.height+u:t,e=isFinite(l.width)?l.width+u:e):(t=isFinite(l.width)?l.width+u:t,e=isFinite(l.height)?l.height+u:e);let c=i||0,d=s||0,f=this instanceof G;switch(this.Zs(!0)){case 0:c=0,d=0,f&&(t=1/0,e=1/0);break;case 2:isFinite(t)&&t>i&&(c=t),isFinite(e)&&e>s&&(d=e);break;case 5:isFinite(t)&&t>i&&(c=t),d=0,f&&(e=1/0);break;case 4:isFinite(e)&&e>s&&(d=e),c=0,f&&(t=1/0);break}let p=this.maxSize,g=this.minSize;c>p.width&&g.width<p.width&&(c=p.width),d>p.height&&g.height<p.height&&(d=p.height),i=Math.max(c,g.width),s=Math.max(d,g.height),p.width<i&&(i=Math.min(g.width,i)),p.height<s&&(s=Math.min(g.height,s)),t=Math.min(p.width,t),e=Math.min(p.height,e),t=Math.max(i,t),e=Math.max(s,e),(a===90||a===270)&&(h=t,t=e,e=h,h=i,i=s,s=h),this.hi.ce(),this.bd(t,e,i,s),this.hi.k(),this.hi.isReal()||m.o("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.hi.toString()),this.xi(!1)}bd(t,e,i,s){}Qs(){return!1}Ut(t,e,i,s,n){this.pf();let o=I.l();o.h(this.De),this.De.ce(),this.as()===!1?this.De.e(t,e,i,s):this.Pa(t,e,i,s),this.De.k(),n===void 0?this.he=null:this.he=n;let r=!1;if(n!==void 0)r=!0;else{let a=this.panel;if(a!==null&&a.nl()&&(a=a.panel),a!==null){let h=a.Ke,l=this.measuredBounds,u=e+l.height,c=t+l.width;if(r=!(0<=t+.05&&c<=h.width+.05&&0<=e+.05&&u<=h.height+.05),this instanceof lt){let d=this.naturalBounds;(this.jp>d.height||this.pe>d.width)&&(r=!0)}}}r?this.n|=256:this.n&=-257,this.De.isReal()||m.o("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.De.toString()),this.kd(o,this.De),this.lo(!1),I.i(o)}Pa(t,e,i,s){}commonArrange(t,e,i,s){if(this.De.e(t,e,i,s),this.desiredSize.isReal())return;let n=this.hi,o=this.il,r=o.right+o.left,a=o.top+o.bottom,h=n.width+r,l=n.height+a;i+=r,s+=a;let u=this.Zs(!0);switch(h===i&&l===s&&(u=0),u){case 0:(h>i||l>s)&&(this.xi(!0),this.ht(h>i?i:h,l>s?s:l,0,0));break;case 2:this.xi(!0),this.ht(i,s,0,0);break;case 5:this.xi(!0),this.ht(i,l,0,0);break;case 4:this.xi(!0),this.ht(h,s,0,0);break}}kd(t,e){let i=this.part;i!==null&&i.diagram!==null&&((i.selectionObject===this||i.resizeObject===this||i.rotateObject===this)&&i.CN(!0),this.C(),!t.equalsApproxClose(e)&&(i.Sa(),this.Wp(i)))}Wp(t){this.portId!==null&&(t.CN(!0),t instanceof J&&t.invalidateConnectedLinks(void 0,this))}get shadowVisible(){return this.w!==null?this.w.Jp:null}set shadowVisible(t){let e=this.shadowVisible;e!==t&&(this.Yt().Jp=t,this.Ji(!0),this.C(),this.t("shadowVisible",e,t))}rI(t,e){let i=this.naturalBounds,s=this.wa,n=s.m11,o=s.m21,r=s.dx,a=s.m12,h=s.m22,l=s.dy,u=0,c=0,d=u,f=c;u=d*n+f*o+r,c=d*a+f*h+l;let p=u,g=c,y=0,b=0;d=i.width+e,f=0,u=d*n+f*o+r,c=d*a+f*h+l;let v=Math.min(p,u),w=Math.min(g,c);y=Math.max(p+y,u)-v,b=Math.max(g+b,c)-w,p=v,g=w,d=i.width+e,f=i.height+e,u=d*n+f*o+r,c=d*a+f*h+l,v=Math.min(p,u),w=Math.min(g,c),y=Math.max(p+y,u)-v,b=Math.max(g+b,c)-w,p=v,g=w,d=0,f=i.height+e,u=d*n+f*o+r,c=d*a+f*h+l,v=Math.min(p,u),w=Math.min(g,c),y=Math.max(p+y,u)-v,b=Math.max(g+b,c)-w,p=v,g=w;let k=t.viewportBounds,S=k.x,N=k.y,D=k.width,L=k.height;return p>D+S||S>y+p||g>L+N||N>b+g}Ge(t,e){if(this.lI(t,e)||!this.visible)return;let i=this.opacity;if(i===0)return;let s=1;i!==1&&(s=t.globalAlpha,t.globalAlpha=s*i);let n="";this.filter!==""&&(n=t.filter,t.filter=this.filter);let o=this.v,r=this.panel;this.Hp()===!0&&this.R1();let a=this.part,h=!1,l=0;if(a&&e.getRenderingHint("drawShadows")&&(h=a.isShadowed,h)){let g=a.shadowOffset;l=Math.max(g.y,g.x)*e.scale*e.$e}let u=this instanceof G&&this.nl(),c=this.De;if(u&&(this._T(h,t,!1,r),this.aI(t,e),this.tD(h,t,!1,r),this.eD(h,t,!1)),u||!u&&(c.width===0||c.height===0||isNaN(c.x)||isNaN(c.y))){i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n);return}let d=this.Qs();if(!e.ph&&d&&this.rI(e,l)){i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n);return}let f=(this.n&256)!==0;if(t.clipInsteadOfFill&&(f=!1),this instanceof lt&&(t.font=this.font),f){let g=r.Mn()?r.naturalBounds:r.actualBounds,y=Math.max(c.x,g.x),b=Math.max(c.y,g.y),v=Math.min(c.right,g.right)-y,w=Math.min(c.bottom,g.bottom)-b,k=this.he;if(k!==null&&(y=k.x,b=k.y,v=k.width,w=k.height),y>c.width+c.x||c.x>g.width+g.x){i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n);return}t.save(),t.beginPath(),t.rect(y,b,v,w),t.clip()}if(d){if(!a.isVisible()){i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n);return}if(h){let g=a.shadowOffset;t.shadowsSet(g.x*e.scale*this.scale*e.$e,g.y*e.scale*this.scale*e.$e,a.shadowBlur),t.shadowsOn(),t.shadowColor=a.shadowColor}}let p=this.naturalBounds;if(t.transform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this._T(h,t,d,r),this.Lt!==null&&(t.commitTransform(),this.O1(t,p,c)),this.tD(h,t,d,r),this.Ma(t,e),this.eD(h,t,d),f&&(t.restore(),t.clearContextCache(this instanceof G)),!o.RP()){let g=1/(o.m11*o.m22-o.m12*o.m21);t.transform(o.m22*g,-o.m12*g,-o.m21*g,o.m11*g,g*(o.m21*o.dy-o.m22*o.dx),g*(o.m12*o.dx-o.m11*o.dy))}i!==1&&(t.globalAlpha=s),this.filter!==""&&(t.filter=n)}_T(t,e,i,s){t&&this.shadowVisible===!0?e.shadowsOn():t&&this.shadowVisible===!1&&e.shadowsOff(),t&&this.I1(s)&&this.shadowVisible===null&&e.shadowsOff()}tD(t,e,i,s){t&&(this.Lt!==null||this.I1(s))?(this.E1(!0),this.shadowVisible===null&&e.shadowsOff()):this.E1(!1)}eD(t,e,i){t&&this.LN()===!0&&e.shadowsOn(),i&&t&&e.shadowsOff()}hI(t,e,i){let s=this.part,n=!1;s&&t.getRenderingHint("drawShadows")&&(n=s.isShadowed),e.clipInsteadOfFill&&(n=!1),this.Qs()&&n&&e.shadowsOn(),n&&this.shadowVisible===!0?e.shadowsOn():n&&this.shadowVisible===!1&&e.shadowsOff();let o=this.panel;if(n&&this.I1(o)&&this.shadowVisible===null&&e.shadowsOff(),e.ol){let r=t.computePixelRatio(),a=`drop-shadow(${e.shadowOffsetX/r}px ${e.shadowOffsetY/r}px ${e.shadowBlur/r/2}px ${e.shadowColor})`;this.background!==null&&i.Lt.setAttributeNS(null,"filter",a)}return n&&(this.Lt!==null||this.I1(o))?(this.E1(!0),this.shadowVisible===null&&e.shadowsOff()):this.E1(!1),n}cI(t,e,i,s){if(i.ol){let n=e.computePixelRatio(),o=`drop-shadow(${i.shadowOffsetX/n}px ${i.shadowOffsetY/n}px ${i.shadowBlur/n/2}px ${i.shadowColor})`;this.AN(t,o)}s&&this.LN()===!0&&i.shadowsOn(),this.Qs()&&i.shadowsOff()}I1(t){return t===null?!1:(t.nl()&&(t=t.panel),t.LN()||(t.type===G.Auto||t.type===G.Spot)&&t.findMainElement()!==this)}AN(t,e){}O1(t,e,i){let s=this.qp(),n=e.x,o=e.y,r=e.width+s,a=e.height+s;this.bn(t,this.Lt,!0,!1,e,i),this.Lt instanceof R&&this.Lt.type===3?(t.beginPath(),t.rect(n-s/2,o-s/2,r,a),t.fillContext(this.Lt,!1,null)):t.fillRect(n-s/2,o-s/2,r,a)}iD(t,e){let i=t.fI(this),s=t.xa!==null?t.xa:t.svg;if(s!==null&&i!==-1){for(;i!==0&&!t.elt(i-1).isVisibleObject();)i--;if(i===0)this.uI(t,e,s);else{let n=t.elt(i-1).svg;n!==null?n.after(e):s.appendChild(e)}}}uI(t,e,i){if(t.type===G.Table){let s=i.getElementsByClassName("gojs-ts"),n=s.length!==0?s[0]:null;n!==null&&n.after(e)}else i.Lt?i.Lt.after(e):i.prepend(e)}lI(t,e){if(!(t instanceof re))return!1;if(!this.visible||this.opacity===0)return this.svg!==null&&this.svg.parentNode!==null&&this.svg.remove(),!0;let i=this.De;if(this.Qs()&&(!this.isVisible()||i.width===0||i.height===0||isNaN(i.x)||isNaN(i.y)))return this.svg!==null&&this.svg.parentNode!==null&&this.svg.remove(),!0;t.setCurrentTransform(1,0,0,1,0,0);let s=this.panel,n=this.Pd(t);if(this.yf(t,e,n))return this.sD(this.svg),this.svg.parentElement!==null?(this.Qs()&&(t.lastDrawnPart=this.svg),!0):(this.Qs()?(t.lastDrawnPart!==null?t.lastDrawnPart.after(this.svg):t.diagramGroup.prepend(this.svg),t.lastDrawnPart=this.svg):s&&this.iD(s,this.svg),!0);if(this.Ji(!1),this.Qs()&&this.isShadowed){let p=this.shadowOffset;t.shadowsSet(p.x*e.scale*this.scale*e.$e,p.y*e.scale*this.scale*e.$e,this.shadowBlur),t.shadowsOn(),t.shadowColor=this.shadowColor}this instanceof lt&&(t.font=this.font),t.currentElement=null;let o=this.v,r=this instanceof G,a=this instanceof G?this.nl():!1,h=this.svg;if(this.Hp()===!0&&this.R1(),t.outerGroup=!1,n)if(t.outerGroup=!0,r&&a)t.newGroup(1,0,0,1,0,0),this.svg=t.lastCreatedElement;else if(r&&this.isClipping){let p=this.findMainElement(),g=0,y=0;p!==null&&(g=p.actualBounds.x,y=p.actualBounds.y),t.newGroup(o.m11,o.m12,o.m21,o.m22,o.dx+g,o.dy+y),this.svg=t.lastCreatedElement,p!==null&&t.createOrUpdateClipGroup(this,p.actualBounds),t.currentElement=t.lastCreatedElement}else r?(t.newGroup(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this.svg=t.lastCreatedElement):t.newGroup(1,0,0,1,0,0);let l=this.naturalBounds;r||t.setCurrentTransform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this.background!==null&&(r?(a&&t.setCurrentTransform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this.O1(t,l,i),a&&t.setCurrentTransform(1,0,0,1,0,0)):(t.setCurrentTransform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),this.O1(t,l,i)),t.currentElement.Lt=t.lastCreatedElement,t.currentElement.prepend(t.lastCreatedElement));let u=this.hI(e,t,t.currentElement);this.Ma(t,e),r&&t.endGroup(),t.outerGroup&&t.endGroup();let c=t.surface.ud,d=r?this.svg:t.currentElement;if(h!==null&&h.parentNode!==null&&d!==h&&(this.panel===null||h.parentNode===this.panel.svg)){let p=this.svg.getAttribute("filter");return p!==null&&d.setAttribute("filter",p),this.filter!==""&&d.setAttributeNS(null,"filter",this.filter),h.replaceWith(d),this.svg=d,d!==null&&this.$p(t,s,i,d),!0}if(this.svg=d,c!==null&&d===null&&t.dummyGroup(),d===null)return!0;this.$p(t,s,i,d),this.cI(d,e,t,u);let f=this.Qs()?this.opacity*t.globalAlpha:this.opacity;if(f!==1&&d.setAttributeNS(null,"opacity",f.toString()),this.filter!==""&&d.setAttributeNS(null,"filter",this.filter),this.Qs()){if(h!==null&&d!==h&&h.parentNode===t.diagramGroup){let p=h.getAttribute("filter");p!==null&&d.setAttribute("filter",p),h.replaceWith(d)}else t.lastDrawnPart?t.lastDrawnPart.after(d):t.diagramGroup.prepend(d);t.lastDrawnPart=d}else s!==null&&this.iD(s,d);return c!==null&&c(this,d),this.sD(d),!0}sD(t){let e=this,i=t.dataset;e instanceof $&&(e.portId!==null&&(i.portId=e.portId),e instanceof G&&(isNaN(e.itemIndex)||(i.itemIndex=e.itemIndex.toString()),e instanceof pt&&(i.className=m.Kn(e),e.key!==void 0&&(i.key=e.key.toString()),e.containingGroup!==null&&(i.group=e.containingGroup.key.toString()),e instanceof j&&(e.fromNode!==null&&e.fromNode.key!==void 0&&(i.fromKey=e.fromNode.key.toString()),e.fromPortId!==""&&(i.fromPortId=e.fromPortId),e.toNode!==null&&e.toNode.key!==void 0&&(i.toKey=e.toNode.key.toString()),e.toPortId!==""&&(i.toPortId=e.toPortId)))))}$p(t,e,i,s){let n=(this.n&256)!==0;if(t.clipInsteadOfFill&&(n=!1),!n){s.removeAttributeNS(null,"clip-path");return}let o=e.Mn()?e.naturalBounds:e.actualBounds,r=Math.max(i.x,o.x),a=Math.max(i.y,o.y),h=Math.min(i.right,o.right)-r,l=Math.min(i.bottom,o.bottom)-a,u=this.he;u!==null&&(r=u.x,a=u.y,h=u.width,l=u.height);let c=I.z(r,a,Math.max(h,0),Math.max(l,0));if(this instanceof G){let d=Nt.l();d.set(this.v),d.ex(),d.sm(c),Nt.i(d)}s.setAttributeNS(null,"clip-path",`path(' M ${c.x},${c.y} L ${c.width+c.x} ${c.y} L ${c.width+c.x} ${c.height+c.y} L ${c.x} ${c.height+c.y} z') view-box`),I.i(c)}dI(){if(this.svg===null)return;let t=this.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),e=this.svg.ownerDocument;if(t!==null)for(let i of t){let s=e.getElementById(i.split("#")[1].slice(0,-1));s!==null&&s.remove()}this.svg.remove()}aI(t,e){let i=this.De,s=this.Ke,n=this.Lt;n!==null&&t.commitTransform(),n!==null&&(this.bn(t,n,!0,!1,s,i),n instanceof R&&n.type===3?(t.beginPath(),t.rect(i.x,i.y,i.width,i.height),t.fillContext(n,!1,null)):t.fillRect(i.x,i.y,i.width,i.height)),this.Ma(t,e)}Ma(t,e){}wf(){this.Ji(!0)}yf(t,e,i){let s=this.svg;if(this.gI()){if(this.wf(),this.Ji(!1),s===null)return!1;let u=s.getAttribute("clip-path");if(u!==null&&u.includes("url")){let c=t.svg.getElementById(u.split("#")[1].slice(0,-1));c!==null&&c.remove()}return s.getAttribute("filter")&&s.removeAttribute("filter"),!1}if(s===null)return!1;if(!this.visible)return s.remove(),!1;if(s.nodeName!=="g"&&i||s.nodeName==="g"&&!i)return!1;let n=this.v,o="matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")",r=this instanceof G,a=r?this.nl():!1;if(!(r&&a))if(this instanceof Bt){let u=this.U1;t.setCurrentTransform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),u!==null&&t.amendImageTransform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7]),i?s.lastElementChild.setAttributeNS(null,"transform",t.getCurrentTransform()):s.setAttributeNS(null,"transform",t.getCurrentTransform())}else if(i&&!r)if(this instanceof et){let u=s.getElementsByTagName("path");for(let c=0;c<u.length;c++)u[c].setAttributeNS(null,"transform",o)}else if(this instanceof lt){let u=s.getElementsByTagName("text"),c=typeof this.stroke=="string"?this.stroke:null;for(let d=0;d<u.length;d++)u[d].setAttributeNS(null,"transform",o),c&&u[d].setAttributeNS(null,"fill",c)}else(s.lastElementChild||s).setAttributeNS(null,"transform",o);else if(r&&this.isClipping&&this.xa){let u=this.findMainElement(),c=u!==null?u.actualBounds.x:0,d=u!==null?u.actualBounds.y:0;this.xa.setAttributeNS(null,"transform","matrix(1,0,0,1,"+-c+", "+-d+")"),s.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+(n.dx+c)+", "+(n.dy+d)+")")}else s.setAttributeNS(null,"transform",o);let h=this.Qs()?this.opacity*t.globalAlpha:this.opacity;h===1?s.removeAttribute("opacity"):s.setAttributeNS(null,"opacity",h.toString()),t.setCurrentTransform(1,0,0,1,0,0);let l=this.xa?this.xa:this.F1;if(this.background!==null||l.Lt!==void 0){let u=l.Lt;if(this.background===null)t.removeOldGradient(this,l.Lt,"fill"),l.Lt.remove(),l.Lt=void 0;else{if((a||i&&!(this instanceof G))&&t.setCurrentTransform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),this.O1(t,this.naturalBounds,this.actualBounds),l.Lt){t.removeOldGradient(this,l.Lt,"fill");let c=l.Lt.getAttribute("filter");c!==null&&t.lastCreatedElement.setAttribute("filter",c),l.Lt.replaceWith(t.lastCreatedElement)}else l.prepend(t.lastCreatedElement);l.Lt=t.lastCreatedElement}u&&t.removeOldGradient(this,u,"fill")}return this.$p(t,this.panel,this.actualBounds,s),!0}Pd(t){if(this.background!==null)return!0;let e=(this.n&256)!==0;return t.clipInsteadOfFill&&(e=!1),!!e}static UU(t,e,i,s,n,o,r){let a=.001,h=o.length;t.moveTo(e,i);let l=s-e,u=n-i;l===0&&(l=.001);let c=u/l,d=Math.sqrt(l*l+u*u),f=0,p=!0;a=o[f%h];let g=r!==0;for(;d>=.1;){if(g){for(a=o[f++%h],a-=r;a<0;)a+=o[f++%h],p=!p;g=!1}else a=o[f++%h];a>d&&(a=d);let y=Math.sqrt(a*a/(1+c*c));l<0&&(y=-y),e+=y,i+=c*y,p?t.lineTo(e,i):t.moveTo(e,i),d-=a,p=!p}}bn(t,e,i,s,n,o){let r=1,a=1;if(typeof e=="string"){i?t.fillStyle=e:t.strokeStyle=e;return}else if(e.type===1){i?t.fillStyle=e.color:t.strokeStyle=e.color;return}let h,l=this.qp();r=n.width,a=n.height,s?(r=o.width,a=o.height):i||(r+=l,a+=l);let u=t instanceof ci;if(u&&e.Nn&&(e.type===4||e.xf===r&&e.V1===a))h=e.Nn;else{let c=0,d=0,f=0,p=0,g=0,y=0,b=0,v=0;if(s?(b=o.x,v=o.y):i||(b-=l/2,v-=l/2),c=e.start.x*r+e.start.offsetX+b,d=e.start.y*a+e.start.offsetY+v,f=e.end.x*r+e.end.offsetX+b,p=e.end.y*a+e.end.offsetY+v,e.type===2)h=t.createLinearGradient(c,d,f,p);else if(e.type===3)y=isNaN(e.endRadius)?Math.max(r,a)/2:e.endRadius,isNaN(e.startRadius)?(g=0,y=Math.max(r,a)/2):g=e.startRadius,h=t.createRadialGradient(c,d,g,f,p,y);else if(e.type===4)try{h=t.createPattern(e.pattern,"repeat")}catch{h=null}else m.si(e.type,"Brush type");if(e.type!==4){let w=e.colorStops;if(w!==null){let k=w.iterator;for(;k.next();)h.addColorStop(k.key,k.value)}}if(u&&(e.Nn=h,h!==null&&(e.xf=r,e.V1=a),h===null&&e.type===4&&e.xf!==-1)){e.xf=-1;let w=this.diagram;w!==null&&e.xf===-1&&m.un(()=>{w.redraw()},600)}}i?t.fillStyle=h:t.strokeStyle=h}isContainedBy(t){return t instanceof G?this.mI(this,t):!1}mI(t,e){if(t===e||e===null)return!1;let i=t.panel;for(;i!==null;){if(i===e)return!0;i=i.panel}return!1}isVisibleObject(){if(!this.visible)return!1;let t=this.panel;return t!==null?t.isVisibleObject():!0}isEnabledObject(){let t=this instanceof G?this:this.panel;for(;t!==null&&t.isEnabled;)t=t.panel;return t===null}get enabledChanged(){return this.w!==null?this.w.Zp:null}set enabledChanged(t){let e=this.enabledChanged;e!==t&&(t!==null&&m.S(t,$,"enabledChanged"),this.Yt().Zp=t,this.t("enabledChanged",e,t))}R1(){if(this.B1()===!0){let t=this.el;if(t.Ue(),!this.De.isReal()||!this.hi.isReal()){this.Sd(!1),this.Na(!1);return}if(t.Xs(this.De.x-this.hi.x,this.De.y-this.hi.y),this.scale!==1||this.angle!==0){let e=this.naturalBounds;this.Kp(t,e.x,e.y,e.width,e.height)}this.Sd(!1),this.Na(!0)}if(this.Hp()===!0){let t=this.panel;if(t===null)this.wa.set(this.el),this.Th=this.scale;else if(t.Ws!==null){let e=this.wa;e.Ue(),t.Mn()?e.bc(t.wa):t.panel!==null&&e.bc(t.panel.wa),e.bc(this.el),this.Th=this.scale*t.Th}this.Na(!1)}}Kp(t,e,i,s,n){if(this.it!==1&&t.it(this.it),this.Xt===0)return;let o=P.l();o.setSpot(e,i,s,n,T.Center),t.ks(this.Xt,o.x,o.y),P.i(o)}f(t){if(this.Xo())return;t===void 0&&(t=!1),this.xi(!0),this.lo(!0);let e=this.panel;e!==null&&!t&&e.f()}bf(){this.Xo()||(this.xi(!0),this.lo(!0))}kf(t){if(this.as())return;let e=this.panel;!t&&e!==null&&e.f(),this.lo(!0)}pf(){this.B1()===!1&&(this.Sd(!0),this.Na(!0))}TN(){this.Na(!0)}C(){let t=this.part;t!==null&&t.C()}Zs(t){let e=this.stretch,i=this.panel;if(i===null)return this.qo(e===1?0:e,t);if(i.type===G.Table)return this.Qp(i.getRowDefinition(this.row),i.getColumnDefinition(this.column),t);if(i.type===G.Auto&&i.findMainElement()===this)return this.qo(2,t);if(e===1){if(i.type===G.Spot&&i.findMainElement()===this)return this.qo(2,t);let s=i.defaultStretch;return s===1?this.qo(0,t):this.qo(s,t)}return this.qo(e,t)}Qp(t,e,i){let s=this.stretch;if(s!==1)return this.qo(s,i);let n=null,o=null;switch(t.stretch){case 1:case 5:break;case 4:o=!0;break;case 2:o=!0;break}switch(e.stretch){case 1:case 4:break;case 5:n=!0;break;case 2:n=!0;break}let r=this.panel.defaultStretch;return n===null&&(n=r===5||r===2),o===null&&(o=r===4||r===2),n===!0&&o===!0?this.qo(2,i):n===!0?this.qo(5,i):o===!0?this.qo(4,i):this.qo(0,i)}qo(t,e){if(e)return t;if(t===0)return 0;let i=this.desiredSize;if(i.isReal())return 0;let s=!isNaN(i.width),n=!isNaN(i.height),o=this.angle;if(s)if(o!==90&&o!==270){if(t===5)return 0;if(t===2)return 4}else{if(t===4)return 0;if(t===2)return 5}if(n)if(o!==90&&o!==270){if(t===4)return 0;if(t===2)return 5}else{if(t===5)return 0;if(t===2)return 4}return t}get segmentOrientation(){return this.Ot!==null?this.Ot._p:0}set segmentOrientation(t){let e=this.segmentOrientation;e!==t&&(this.Ot===null&&(this.Ot=new Re),this.Ot._p=t,this.f(),this.t("segmentOrientation",e,t),t===0&&(this.angle=0))}pI(){this.segmentOrientation=21}get segmentIndex(){return this.Ot!==null?this.Ot.t0:-1/0}set segmentIndex(t){t=Math.round(t);let e=this.segmentIndex;e!==t&&(this.Ot===null&&(this.Ot=new Re),this.Ot.t0=t,this.f(),this.t("segmentIndex",e,t))}get segmentFraction(){return this.Ot!==null?this.Ot.e0:0}set segmentFraction(t){t<0?t=0:t>1&&(t=1);let e=this.segmentFraction;e!==t&&(this.Ot===null&&(this.Ot=new Re),this.Ot.e0=t,this.f(),this.t("segmentFraction",e,t))}get segmentOffset(){return this.Ot!==null?this.Ot.i0:P.dn}set segmentOffset(t){let e=this.segmentOffset;e.equals(t)||(t=t.N(),this.Ot===null&&(this.Ot=new Re),this.Ot.i0=t,this.f(),this.t("segmentOffset",e,t))}get stretch(){return this.w!==null?this.w.ao:1}set stretch(t){let e=this.stretch;e!==t&&(this.Yt().ao=t,this.f(),this.t("stretch",e,t))}get name(){return this.w!==null?this.w.Pt:""}set name(t){let e=this.name;e!==t&&(this.Yt().Pt=t,this.part!==null&&this.part.s0(),this.t("name",e,t))}get opacity(){return this.Zt}set opacity(t){t<0?t=0:t>1&&(t=1);let e=this.opacity;if(e!==t){this.Zt=t,this.t("opacity",e,t);let i=this.diagram,s=this.part;i!==null&&s!==null&&i.C(s.hh(s.actualBounds))}}get filter(){return this.Gp}set filter(t){let e=this.filter;if(e!==t){this.Gp=t,this.Ji(!0),this.t("filter",e,t);let i=this.diagram,s=this.part;i!==null&&s!==null&&i.C(s.hh(s.actualBounds))}}get visible(){return(this.n&1)!==0}set visible(t){let e=(this.n&1)!==0;if(e!==t){this.n=this.n^1,this.wf(),this.t("visible",e,t);let i=this.panel;i!==null?i.f():this.Qs()&&this.Xe(t),this.C(),this.nD()}}get pickable(){return(this.n&2)!==0}set pickable(t){let e=(this.n&2)!==0;e!==t&&(this.n=this.n^2,this.t("pickable",e,t))}get fromLinkableDuplicates(){return(this.n&4)!==0}set fromLinkableDuplicates(t){let e=(this.n&4)!==0;e!==t&&(this.n=this.n^4,this.t("fromLinkableDuplicates",e,t))}get fromLinkableSelfNode(){return(this.n&8)!==0}set fromLinkableSelfNode(t){let e=(this.n&8)!==0;e!==t&&(this.n=this.n^8,this.t("fromLinkableSelfNode",e,t))}get toLinkableDuplicates(){return(this.n&16)!==0}set toLinkableDuplicates(t){let e=(this.n&16)!==0;e!==t&&(this.n=this.n^16,this.t("toLinkableDuplicates",e,t))}get toLinkableSelfNode(){return(this.n&32)!==0}set toLinkableSelfNode(t){let e=(this.n&32)!==0;e!==t&&(this.n=this.n^32,this.t("toLinkableSelfNode",e,t))}get isPanelMain(){return(this.n&64)!==0}set isPanelMain(t){let e=(this.n&64)!==0;e!==t&&(this.n=this.n^64,this.f(),this.t("isPanelMain",e,t))}get isActionable(){return(this.n&128)!==0}set isActionable(t){let e=(this.n&128)!==0;e!==t&&(this.n=this.n^128,this.t("isActionable",e,t))}get background(){return this.Lt}set background(t){let e=this.background;e!==t&&(t!==null&&R.Md(t,"GraphObject.background"),t instanceof R&&t.k(),this.Lt=t,this.C(),this.t("background",e,t))}LN(){return(this.n&512)!==0}E1(t){t?this.n|=512:this.n&=-513}gf(){return(this.n&1024)!==0}DN(t){t?this.n|=1024:this.n&=-1025}B1(){return(this.n&2048)!==0}Sd(t){t?this.n|=2048:this.n&=-2049}Hp(){return(this.n&4096)!==0}Na(t){t?this.n|=4096:this.n&=-4097}Xo(){return(this.n&8192)!==0}xi(t){t?this.n|=8192:this.n&=-8193}as(){return(this.n&16384)!==0}lo(t){t?this.n|=16384:this.n&=-16385}gI(){return(this.n&32768)!==0}Ji(t){t?this.n|=32768:this.n&=-32769}get part(){if(this.Qs())return this;if(this.sl!==null)return this.sl;let t=this;for(t=t.panel;t;){if(t instanceof pt)return this.sl=t,t;t=t.panel}return null}get svg(){return this.F1}set svg(t){this.F1=t}jc(){this.svg=null}get panel(){return this.$s}Uh(t){this.$s=t,this.svg!==null&&this.svg.remove()}get layer(){let t=this.part;return t!==null?t.layer:null}get diagram(){let t=this.part;return t!==null?t.diagram:null}get position(){return this.ct}set position(t){let e=t.x,i=t.y,s=this.position,n=s.x,o=s.y;n!==e&&(!isNaN(n)||!isNaN(e))||o!==i&&(!isNaN(o)||!isNaN(i))?(t=t.copy(),this.vN(t,n,o)&&this.t("position",new P(n,o),t.copy())):this.FN()}FN(){}vN(t,e,i){return this.ct=t,this.kf(),!0}Ec(t,e,i){this.ct.x===t&&this.ct.y===e||(this.ct.e(t,e),this.pf())}get actualBounds(){return this.De}get scale(){return this.it}set scale(t){let e=this.scale;e!==t&&(t<=0&&m.o("GraphObject.scale for "+this+" must be greater than zero, not: "+t),this.it=t,this.f(),this.t("scale",e,t))}get angle(){return this.Xt}set angle(t){let e=this.angle;if(e!==t){if(t=t%360,t<0&&(t+=360),e===t)return;this.Xt=t,this.nD(),this.f(),this.t("angle",e,t)}}get desiredSize(){return this.cs}set desiredSize(t){let e=t.width,i=t.height,s=this.desiredSize,n=s.width,o=s.height;if((n!==e&&(!isNaN(n)||!isNaN(e))||o!==i&&(!isNaN(o)||!isNaN(i)))&&(t=t.N(),this.cs=t,this.f(),this instanceof et&&this.ai(),this.t("desiredSize",s,t),this.gf())){let r=this.part;r!==null&&(this.Eh(r,"width"),this.Eh(r,"height"))}}get width(){return this.cs.width}set width(t){let e=this.cs.width;if(e!==t&&(!isNaN(e)||!isNaN(t))){let i=this.cs,s=new st(t,this.cs.height).k();if(this.cs=s,this.f(),this instanceof et&&this.ai(),this.t("desiredSize",i,s),this.gf()){let n=this.part;n!==null&&this.Eh(n,"width")}}}get height(){return this.cs.height}set height(t){let e=this.cs.height;if(e!==t&&(!isNaN(e)||!isNaN(t))){let i=this.cs,s=new st(this.cs.width,t).k();if(this.cs=s,this.f(),this instanceof et&&this.ai(),this.t("desiredSize",i,s),this.gf()){let n=this.part;n!==null&&this.Eh(n,"height")}}}get minSize(){return this.w!==null?this.w.Nr:st.xc}set minSize(t){let e=this.minSize;e.equals(t)||(t=t.copy(),isNaN(t.width)&&(t.width=0),isNaN(t.height)&&(t.height=0),t.k(),this.Yt().Nr=t,this.f(),this.t("minSize",e,t))}get maxSize(){return this.w!==null?this.w.Cr:st.DP}set maxSize(t){let e=this.maxSize;e.equals(t)||(t=t.copy(),isNaN(t.width)&&(t.width=1/0),isNaN(t.height)&&(t.height=1/0),t.k(),this.Yt().Cr=t,this.f(),this.t("maxSize",e,t))}get measuredBounds(){return this.hi}get naturalBounds(){return this.Ke}qp(){return 0}get margin(){return this.il}set margin(t){typeof t=="number"&&(t=new Dt(t));let e=this.il;e.equals(t)||(t=t.N(),this.il=t,this.f(),this.t("margin",e,t))}get v(){return this.B1()===!0&&this.R1(),this.el}get Ws(){return this.Hp()===!0&&this.R1(),this.wa}trigger(t,e,i){let s=null;return typeof t=="string"?s=new ai(t,e,i):s=t,s.Ti=this,this.Ts===null&&(this.Ts=new Mt),this.Ts.set(s.propertyName,s),this}get Ts(){return this.w!==null?this.w.Ts:null}set Ts(t){this.Ts!==t&&(this.Yt().Ts=t)}get Mr(){return this.w!==null?this.w.Mr:0}set Mr(t){this.Mr!==t&&(this.Yt().Mr=t)}get alignment(){return this.de}set alignment(t){let e=this.alignment;e.equals(t)||(t.isNoSpot()&&!t.isDefault()&&m.o("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+t),t=t.N(),this.de=t,this.kf(),this.t("alignment",e,t))}get column(){return this.pa}set column(t){t=Math.round(t);let e=this.column;e!==t&&(t<0&&m.J(t,">= 0",$,"column"),this.pa=t,this.f(),this.t("column",e,t),this.svg!==null&&this.svg.remove())}get columnSpan(){return this.w!==null?this.w.o0:1}set columnSpan(t){t=Math.round(t);let e=this.columnSpan;e!==t&&(t<1&&m.J(t,">= 1",$,"columnSpan"),this.Yt().o0=t,this.f(),this.t("columnSpan",e,t))}get row(){return this.Xp}set row(t){t=Math.round(t);let e=this.row;e!==t&&(t<0&&m.J(t,">= 0",$,"row"),this.Xp=t,this.f(),this.t("row",e,t),this.svg!==null&&this.svg.remove())}get rowSpan(){return this.w!==null?this.w.r0:1}set rowSpan(t){t=Math.round(t);let e=this.rowSpan;e!==t&&(t<1&&m.J(t,">= 1",$,"rowSpan"),this.Yt().r0=t,this.f(),this.t("rowSpan",e,t))}get spanAllocation(){return this.w!==null?this.w.l0:null}set spanAllocation(t){let e=this.spanAllocation;e!==t&&(t!==null&&m.S(t,$,"spanAllocation"),this.Yt().l0=t,this.f(),this.t("spanAllocation",e,t))}get alignmentFocus(){return this.wd}set alignmentFocus(t){let e=this.alignmentFocus;e.equals(t)||(t=t.N(),this.wd=t,this.f(),this.t("alignmentFocus",e,t))}get portId(){return this.zp}set portId(t){let e=this.portId;if(e!==t){let i=this.part;i!==null&&!(i instanceof J)&&m.o("Cannot set portID on a Link: "+t);let s=i;e!==null&&s!==null&&s.RN(this),this.zp=t,t!==null&&s!==null&&(s.Cn=!0,s.oD(this)),this.t("portId",e,t)}}Vh(){let t=this.part;if(t instanceof J&&(this.portId!==null||this===t.port)){let e=t.diagram;e!==null&&!e.undoManager.isUndoingRedoing&&t.invalidateConnectedLinks(void 0,this)}}nD(){let t=this.diagram;t===null||t.undoManager.isUndoingRedoing||(this instanceof G?this instanceof J?this.invalidateConnectedLinks():this.walkVisualTreeFrom(this,e=>{e.Vh()}):this.Vh())}get toSpot(){return this.ft!==null?this.ft.vh:T.None}set toSpot(t){let e=this.toSpot;e.equals(t)||(t=t.N(),this.Wi().vh=t,this.t("toSpot",e,t),this.Vh())}get toEndSegmentLength(){return this.ft!==null?this.ft.Rh:10}set toEndSegmentLength(t){let e=this.toEndSegmentLength;e!==t&&(t<0&&m.J(t,">= 0",$,"toEndSegmentLength"),this.Wi().Rh=t,this.t("toEndSegmentLength",e,t),this.Vh())}get toShortLength(){return this.ft!==null?this.ft.Ih:0}set toShortLength(t){let e=this.toShortLength;e!==t&&(this.Wi().Ih=t,this.t("toShortLength",e,t),this.Vh())}get toLinkable(){return this.ft!==null?this.ft.a0:null}set toLinkable(t){let e=this.toLinkable;e!==t&&(this.Wi().a0=t,this.t("toLinkable",e,t))}get toMaxLinks(){return this.ft!==null?this.ft.h0:1/0}set toMaxLinks(t){let e=this.toMaxLinks;e!==t&&(t<0&&m.J(t,">= 0",$,"toMaxLinks"),this.Wi().h0=t,this.t("toMaxLinks",e,t))}get fromSpot(){return this.ft!==null?this.ft.Dh:T.None}set fromSpot(t){let e=this.fromSpot;e.equals(t)||(t=t.N(),this.Wi().Dh=t,this.t("fromSpot",e,t),this.Vh())}get fromEndSegmentLength(){return this.ft!==null?this.ft.Fh:10}set fromEndSegmentLength(t){let e=this.fromEndSegmentLength;e!==t&&(t<0&&m.J(t,">= 0",$,"fromEndSegmentLength"),this.Wi().Fh=t,this.t("fromEndSegmentLength",e,t),this.Vh())}get fromShortLength(){return this.ft!==null?this.ft.Oh:0}set fromShortLength(t){let e=this.fromShortLength;e!==t&&(this.Wi().Oh=t,this.t("fromShortLength",e,t),this.Vh())}get fromLinkable(){return this.ft!==null?this.ft.c0:null}set fromLinkable(t){let e=this.fromLinkable;e!==t&&(this.Wi().c0=t,this.t("fromLinkable",e,t))}get fromMaxLinks(){return this.ft!==null?this.ft.f0:1/0}set fromMaxLinks(t){let e=this.fromMaxLinks;e!==t&&(t<0&&m.J(t,">= 0",$,"fromMaxLinks"),this.Wi().f0=t,this.t("fromMaxLinks",e,t))}get cursor(){return this.w!==null?this.w.Il:""}set cursor(t){let e=this.cursor;e!==t&&(m.s(t,"string",$,"cursor"),this.Yt().Il=t,this.t("cursor",e,t))}get click(){return this.w!==null?this.w.Er:null}set click(t){let e=this.click;e!==t&&(t!==null&&m.S(t,$,"click"),this.Yt().Er=t,this.t("click",e,t))}get doubleClick(){return this.w!==null?this.w.Ur:null}set doubleClick(t){let e=this.doubleClick;e!==t&&(t!==null&&m.S(t,$,"doubleClick"),this.Yt().Ur=t,this.t("doubleClick",e,t))}get contextClick(){return this.w!==null?this.w.Vr:null}set contextClick(t){let e=this.contextClick;e!==t&&(t!==null&&m.S(t,$,"contextClick"),this.Yt().Vr=t,this.t("contextClick",e,t))}get mouseEnter(){return this.w!==null?this.w.Yr:null}set mouseEnter(t){let e=this.mouseEnter;e!==t&&(t!==null&&m.S(t,$,"mouseEnter"),this.Yt().Yr=t,this.t("mouseEnter",e,t))}get mouseLeave(){return this.w!==null?this.w.Kr:null}set mouseLeave(t){let e=this.mouseLeave;e!==t&&(t!==null&&m.S(t,$,"mouseLeave"),this.Yt().Kr=t,this.t("mouseLeave",e,t))}get mouseOver(){return this.w!==null?this.w.Br:null}set mouseOver(t){let e=this.mouseOver;e!==t&&(t!==null&&m.S(t,$,"mouseOver"),this.Yt().Br=t,this.t("mouseOver",e,t))}get mouseHover(){return this.w!==null?this.w.zr:null}set mouseHover(t){let e=this.mouseHover;e!==t&&(t!==null&&m.S(t,$,"mouseHover"),this.Yt().zr=t,this.t("mouseHover",e,t))}get mouseHold(){return this.w!==null?this.w.Xr:null}set mouseHold(t){let e=this.mouseHold;e!==t&&(t!==null&&m.S(t,$,"mouseHold"),this.Yt().Xr=t,this.t("mouseHold",e,t))}get mouseDragEnter(){return this.w!==null?this.w.u0:null}set mouseDragEnter(t){let e=this.mouseDragEnter;e!==t&&(t!==null&&m.S(t,$,"mouseDragEnter"),this.Yt().u0=t,this.t("mouseDragEnter",e,t))}get mouseDragLeave(){return this.w!==null?this.w.d0:null}set mouseDragLeave(t){let e=this.mouseDragLeave;e!==t&&(t!==null&&m.S(t,$,"mouseDragLeave"),this.Yt().d0=t,this.t("mouseDragLeave",e,t))}get mouseDrop(){return this.w!==null?this.w.Gr:null}set mouseDrop(t){let e=this.mouseDrop;e!==t&&(t!==null&&m.S(t,$,"mouseDrop"),this.Yt().Gr=t,this.t("mouseDrop",e,t))}get actionDown(){return this.w!==null?this.w.g0:null}set actionDown(t){let e=this.actionDown;e!==t&&(t!==null&&m.S(t,$,"actionDown"),this.Yt().g0=t,this.t("actionDown",e,t))}get actionMove(){return this.w!==null?this.w.m0:null}set actionMove(t){let e=this.actionMove;e!==t&&(t!==null&&m.S(t,$,"actionMove"),this.Yt().m0=t,this.t("actionMove",e,t))}get actionUp(){return this.w!==null?this.w.p0:null}set actionUp(t){let e=this.actionUp;e!==t&&(t!==null&&m.S(t,$,"actionUp"),this.Yt().p0=t,this.t("actionUp",e,t))}get actionCancel(){return this.w!==null?this.w.y0:null}set actionCancel(t){let e=this.actionCancel;e!==t&&(t!==null&&m.S(t,$,"actionCancel"),this.Yt().y0=t,this.t("actionCancel",e,t))}get toolTip(){return this.w!==null?this.w.Hr:null}set toolTip(t){let e=this.toolTip;e!==t&&(this.Yt().Hr=t,this.t("toolTip",e,t))}get contextMenu(){return this.w!==null?this.w.qr:null}set contextMenu(t){let e=this.contextMenu;e!==t&&(this.Yt().qr=t,this.t("contextMenu",e,t))}findBindingPanel(){let t=this instanceof G?this:this.panel;for(;t!==null;){if(t.ON())return t;t=t.panel}return null}bind(t,e,i,s){return this.Pf(t,e,i,s),this}bindTwoWay(t,e,i,s){return this.Pf(t,e,i,s).makeTwoWay(),this}bindModel(t,e,i,s){return this.Pf(t,e,i,s).ofModel(),this}bindObject(t,e,i,s,n){return this.Pf(t,e,i,s).ofObject(n),this}theme(t,e,i,s,n){return this.Ca(t,e,i,s,n),this}themeData(t,e,i,s,n){return this.Ca(t,e,i,s,n).ofData(),this}themeObject(t,e,i,s,n,o){return this.Ca(t,e,i,s,n).ofObject(o),this}themeModel(t,e,i,s,n){return this.Ca(t,e,i,s,n).ofModel(),this}Pf(t,e,i,s){let n=null;return typeof t=="string"?n=new te(t,e,i,s):n=t,this.w0(n),n}Ca(t,e,i,s,n){let o=null;return typeof t=="string"?o=new ii(t,e,i,s,n):o=t,this.w0(o),o}w0(t){t.Ti=this;let e=this.findBindingPanel();e!==null&&e.rD()&&m.o("Cannot add a Binding to a template that has already been copied: "+t),this.ve===null&&(this.ve=new q),this.ve.add(t)}set(t){return t?(Object.assign(this,t),this):this}attach(t){return $.IN(this,t),this}apply(t,...e){return t.apply(this,[this,...e]),this}setProperties(t){return Y.Ap(this,t),this}static make(t,...e){let i=arguments,s=null,n=null;if(m.st(t))n=t;else if(typeof t=="string"){let r=$.z1.get(t);m.st(r)?(i=Array.prototype.slice.call(i),s=r(i),m.$(s)||m.o('GraphObject.make invoked object builder "'+t+'", but it did not return an Object')):n=X.go[t]}s===null&&((n==null||!n.constructor)&&m.o("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+t),s=new n);let o=1;if(s instanceof Y&&i.length>1){let r=s,a=i[1];(typeof a=="string"||a instanceof HTMLDivElement)&&(r.w2(a),o++)}for(let r=o;r<i.length;r++){let a=i[r];a===void 0?m.o("Undefined value at argument "+r+" for object being constructed by GraphObject.make: "+s):s&&$.IN(s,a)}return s}static IN(t,e){if(typeof e=="number")$.yI(t,e);else if(typeof e=="string")$.wI(t,e);else if(e instanceof $)t instanceof G||m.o("A GraphObject can only be added to a Panel, not to: "+t),t.add(e);else if(e instanceof Xt){let i=null;e.isRow&&m.st(t.getRowDefinition)?i=t.getRowDefinition(e.index):!e.isRow&&m.st(t.getColumnDefinition)&&(i=t.getColumnDefinition(e.index)),i instanceof Xt?i.X1(e):m.o("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+t)}else if(e instanceof Lt){let i=t;i.type=e}else if(e instanceof te)t instanceof $||t instanceof Xt?t.bind(e):m.o("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+t);else if(e instanceof ai)t instanceof $?t.trigger(e):m.o("An AnimationTrigger can only be applied to a GraphObject, not to: "+t);else if(e instanceof Kt)t instanceof wt&&t.type===4?t.figures.add(e):m.o("A PathFigure can only be added to a Path Geometry, not to: "+t);else if(e instanceof mt)t instanceof Kt?t.segments.add(e):m.o("A PathSegment can only be added to a PathFigure, not to: "+t);else if(e instanceof _t)t instanceof Y||t instanceof ht?t.layout=e:m.o("A Layout can only be assigned to a Diagram or a Group, not to: "+t);else if(Array.isArray(e))for(let i=0;i<e.length;i++){let s=e[i];$.IN(t,s)}else m.$(e)?$.xI(t,e):m.o('Unknown initializer "'+e+'" for object being constructed by GraphObject.make: '+t)}static wI(t,e){if(t instanceof lt)t.text=e;else if(t instanceof et)t.figure=e;else if(t instanceof Bt)t.source=e;else if(t instanceof G){let i=Lt.fs.get(e);i!==null&&(t.type=i)}else if(t instanceof R){let i=m.$a(Oe,e);i!==null?t.type=i:m.o("Unknown Brush type as an argument to GraphObject.make: "+e)}else if(t instanceof wt){let i=m.$a(Ke,e);i!==null&&(t.type=i)}else if(t instanceof mt){let i=m.$a(ni,e);i!==null&&(t.type=i)}}static yI(t,e){m.st(t.fe)?t.fe(e):m.ur(t,e)}static xI(t,e){if(t instanceof R){let i=new bt;for(let s in e){let n=parseFloat(s);isNaN(n)?i[s]=e[s]:t.addColorStop(n,e[s])}Y.Ap(t,i)}else if(t instanceof Xt){if(e.row!==void 0){let s=e.row;(s==null||s===1/0||isNaN(s)||s<0)&&m.o("Must specify non-negative integer row for RowColumnDefinition "+e+", not: "+s),t.isRow=!0,t.index=s}else if(e.column!==void 0){let s=e.column;(s==null||s===1/0||isNaN(s)||s<0)&&m.o("Must specify non-negative integer column for RowColumnDefinition "+e+", not: "+s),t.isRow=!1,t.index=s}let i=new bt;for(let s in e)s==="row"||s==="column"||(i[s]=e[s]);Y.Ap(t,i)}else Y.Ap(t,e)}static build(t,e,...i){let s=$.z1.get(t);if(m.st(s)){let n=s([t].concat(i));if(n instanceof $)return e&&n.setProperties(e),n}m.o('GraphObject.build invoked object builder "'+t+'", but it did not return an Object')}static defineBuilder(t,e){m.s(t,"string",$,"defineBuilder:name"),m.S(e,$,"defineBuilder:func");let i=t.toLowerCase();$.z1.set(t,e)}static isBuilderDefined(t){return $.z1.has(t)}static takeBuilderArgument(t,e,i){i===void 0&&(i=null);let s=t[1];return(m.st(i)?i(s):typeof s=="string")?(t.splice(1,1),s):(e===void 0&&m.o("no "+(m.st(i)?"satisfactory":"string")+" argument for GraphObject builder "+t[0]),e)}static z1=new Mt}$.Vertical=4,$.Horizontal=5,$.defineBuilder("Button",x=>{let t="#f5f5f5",e="#737373",i="#d4d4d4",s="#737373",n="#a3a3a3",o=2.76142374915397,r=2.761423749153969,a=new G(G.Auto,{isActionable:!0,enabledChanged:(h,l)=>{if(h instanceof G){let u=h.findObject("ButtonBorder");if(u!==null)if(h._buttonFillNormal===void 0&&(h._buttonFillNormal=u.fill),l){let c=null;h.layer!==null&&h.diagram!==null&&h.isVisibleObject()&&(c=h.layer.findObjectAt(h.diagram.lastInput.documentPoint)),c===h||c!==null&&c.isContainedBy(h)?u.fill=h._buttonFillOver:u.fill=h._buttonFillNormal}else u.fill=h._buttonFillDisabled}},cursor:"pointer"}).attach({_buttonFillNormal:void 0,_buttonStrokeNormal:void 0,_buttonFillOver:i,_buttonStrokeOver:s,_buttonFillDisabled:n}).add(new et("RoundedRectangle",{name:"ButtonBorder",spot1:new T(0,0,o,r),spot2:new T(1,1,-o,-r),parameter1:2,fill:t,stroke:e}));return a.mouseEnter=(h,l,u)=>{if(!l.isEnabledObject()||!(l instanceof G))return;let c=l.findObject("ButtonBorder");c instanceof et&&(l._buttonFillNormal===void 0&&(l._buttonFillNormal=c.fill),c.fill=l._buttonFillOver,l._buttonStrokeNormal===void 0&&(l._buttonStrokeNormal=c.stroke),c.stroke=l._buttonStrokeOver)},a.mouseLeave=(h,l,u)=>{if(!l.isEnabledObject()||!(l instanceof G))return;let c=l.findObject("ButtonBorder");c instanceof et&&(l._buttonFillNormal!==void 0&&(c.fill=l._buttonFillNormal),l._buttonStrokeNormal!==void 0&&(c.stroke=l._buttonStrokeNormal))},a}),$.defineBuilder("TreeExpanderButton",x=>{let t=$.build("Button");return t.attach({_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine",visible:!1}),t.add(new et("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:st.Pu}).bindObject("figure","isTreeExpanded",(e,i)=>{let s=i.panel;return e?s._treeExpandedFigure:s._treeCollapsedFigure})),t.bindObject("visible","isTreeLeaf",e=>!e),t.click=(e,i)=>{let s=i.part;if(s instanceof vt&&(s=s.adornedPart),!(s instanceof J))return;let n=s.diagram;if(n===null)return;let o=n.commandHandler;if(s.isTreeExpanded){if(!o.canCollapseTree(s))return}else if(!o.canExpandTree(s))return;e.handled=!0,s.isTreeExpanded?o.collapseTree(s):o.expandTree(s)},t}),$.defineBuilder("SubGraphExpanderButton",x=>{let t=$.build("Button");return t.attach({_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"}),t.add(new et("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:st.Pu}).bindObject("figure","isSubGraphExpanded",(e,i)=>{let s=i.panel;return e?s._subGraphExpandedFigure:s._subGraphCollapsedFigure})),t.click=(e,i)=>{let s=i.part;if(s instanceof vt&&(s=s.adornedPart),!(s instanceof ht))return;let n=s.diagram;if(n===null)return;let o=n.commandHandler;if(s.isSubGraphExpanded){if(!o.canCollapseSubGraph(s))return}else if(!o.canExpandSubGraph(s))return;e.handled=!0,s.isSubGraphExpanded?o.collapseSubGraph(s):o.expandSubGraph(s)},t}),$.defineBuilder("ToolTip",x=>new vt(G.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new P(0,2),mouseOver:(t,e)=>{let i=t.diagram.toolManager;i.extendToolTip(i.toolTipDuration)}}).add(new et("RoundedRectangle",{name:"Border",parameter1:1,fill:"#f5f5f5",strokeWidth:0,spot1:new T(0,0,4,6),spot2:new T(1,1,-4,-4)}))),$.defineBuilder("ContextMenu",x=>new vt(G.Vertical,{background:"#f5f5f5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new P(0,2)}).bindObject("background","",t=>t.adornedPart!==null&&t.hasPlaceholder()?null:"#f5f5f5")),$.defineBuilder("ContextMenuButton",x=>{let t=$.build("Button");t.stretch=5;let e=t.findObject("ButtonBorder");return e instanceof et&&(e.figure="Rectangle",e.strokeWidth=0,e.spot1=new T(0,0,4,6),e.spot2=new T(1,1,-4,-4)),t}),$.defineBuilder("PanelExpanderButton",x=>{let t=$.takeBuilderArgument(x,"COLLAPSIBLE"),e=$.build("Button");e.attach({_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8","ButtonBorder.fill":"rgba(0, 0, 0, 0)",_buttonFillNormal:"rgba(0, 0, 0, 0)","ButtonBorder.stroke":null,_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null}),e.add(new et({name:"ButtonIcon",strokeWidth:2}).bindObject("geometryString","visible",s=>s?e._buttonExpandedFigure:e._buttonCollapsedFigure,void 0,t));let i=e.findObject("ButtonBorder");return i instanceof et&&(i.stroke=null,i.fill="rgba(0, 0, 0, 0)"),e.click=(s,n)=>{if(!(n instanceof G))return;let o=n.diagram;if(o===null||o.isReadOnly)return;let r=n.findBindingPanel();if(r===null&&(r=n.part),r!==null){let a=r.findObject(t);a!==null&&(s.handled=!0,o.startTransaction("Collapse/Expand Panel"),a.visible=!a.visible,o.commitTransaction("Collapse/Expand Panel"))}},e}),$.defineBuilder("CheckBoxButton",x=>{let t=$.takeBuilderArgument(x),e=$.build("Button",{desiredSize:new st(14,14)});e.attach({"ButtonBorder.spot1":new T(0,0,1,1),"ButtonBorder.spot2":new T(1,1,-1,-1)});let i=new et({name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:2,geometryStretch:6,visible:!1});return t!==""&&i.bindTwoWay("visible",t),e.add(i),e.click=(s,n)=>{if(!(n instanceof G))return;let o=s.diagram;if(o===null||o.isReadOnly||t!==""&&o.model.isReadOnly)return;s.handled=!0;let r=n.findObject("ButtonIcon");o.startTransaction("checkbox"),r!==null&&(r.visible=!r.visible),m.st(n._doClick)&&n._doClick(s,n),o.commitTransaction("checkbox")},e}),$.defineBuilder("CheckBox",x=>{let t=$.takeBuilderArgument(x),e=$.build("CheckBoxButton",{name:"Button",isActionable:!1,margin:new Dt(0,1,0,0)},t),i=new G("Horizontal",{isActionable:!0,cursor:e.cursor,margin:new Dt(1),mouseEnter:e.mouseEnter,mouseLeave:e.mouseLeave,click:e.click}).attach({_buttonFillNormal:e._buttonFillNormal,_buttonStrokeNormal:e._buttonStrokeNormal,_buttonFillOver:e._buttonFillOver,_buttonStrokeOver:e._buttonStrokeOver,_buttonFillDisabled:e._buttonFillDisabled,_buttonClick:e.click});return i.add(e),e.mouseEnter=null,e.mouseLeave=null,e.click=null,i}),$.defineBuilder("AutoRepeatButton",x=>{let t=$.takeBuilderArgument(x,50,r=>typeof r=="number"),e=$.takeBuilderArgument(x,500,r=>typeof r=="number");function i(r,a){n(r,a),a.click&&(a.Nd=m.un(()=>s(r,a),e))}function s(r,a){a.Nd&&m.yc(a.Nd),a.click&&(a.Nd=m.un(()=>{a.click&&(a.click(r,a),s(r,a))},t))}function n(r,a){a.Nd&&(m.yc(a.Nd),a.Nd=void 0)}let o=$.build("Button");return o.actionDown=(r,a)=>i(r,a),o.actionUp=(r,a)=>n(r,a),o.actionCancel=(r,a)=>n(r,a),o}),$.defineBuilder("ToggleSwitch",function(x){let t=$.takeBuilderArgument(x);t||m.o("ToggleSwitch must be data-bound to a property name, not: "+t);let e=$.takeBuilderArgument(x,!1,r=>typeof r=="boolean"),i="gray",s="transparent",n="white",o=new G("Auto",{width:e?15:28,height:e?28:15}).attach({_buttonFillOff:i,_buttonBorderOff:s,_buttonIconFillOff:n,_buttonFillOn:"green",_buttonBorderOn:"transparent",_buttonIconFillOn:"white"}).add(new et("Capsule",{name:"ButtonBorder",fill:i,stroke:s,strokeWidth:1}).bind("fill",t,(r,a)=>r?a.panel._buttonFillOn:a.panel._buttonFillOff).bind("stroke",t,(r,a)=>r?a.panel._buttonBorderOn:a.panel._buttonBorderOff)).add(new et("Circle",{name:"ButtonIcon",width:11,height:11,fill:n,stroke:null,alignment:e?T.Bottom:T.Left}).bind("fill",t,(r,a)=>r?a.panel._buttonIconFillOn:a.panel._buttonIconFillOff).bind("alignment",t,r=>r?e?T.Top:T.Right:e?T.Bottom:T.Left));return o.click=function(r,a){if(!a.isEnabledObject())return;let h=r.diagram;if(h===null||h.isReadOnly||t!==""&&h.model.isReadOnly)return;r.handled=!0;let l=a.findBindingPanel();l!==null&&(h.startTransaction("toggle switch"),h.model.set(l.data,t,!l.data[t]),typeof a._doClick=="function"&&a._doClick(r,a),h.commitTransaction("toggle switch"))},o}),$.defineBuilder("Toggle",function(x){let t=$.takeBuilderArgument(x),e=$.build("ToggleSwitch",{name:"Button"},t),i=new G("Horizontal",{cursor:e.cursor,margin:1,mouseEnter:e.mouseEnter,mouseLeave:e.mouseLeave,click:e.click}).attach({_buttonClick:e.click}).add(e);return e.mouseEnter=null,e.mouseLeave=null,e.click=null,i});class Ue{me;Pt;no;ve;oo;Ds;Il;Er;Ur;Vr;Yr;Kr;Br;zr;Xr;u0;d0;Gr;g0;m0;p0;y0;Hr;qr;Zp;l0;Ts;Nr;Cr;ao;r0;o0;Mr;Jp;x0;b0;constructor(){this.me=!1,this.Pt="",this.no=-1,this.ve=null,this.oo=null,this.Ds=null,this.Il="",this.Er=null,this.Ur=null,this.Vr=null,this.Yr=null,this.Kr=null,this.Br=null,this.zr=null,this.Xr=null,this.u0=null,this.d0=null,this.Gr=null,this.g0=null,this.m0=null,this.p0=null,this.y0=null,this.Hr=null,this.qr=null,this.Zp=null,this.l0=null,this.Ts=null,this.Nr=st.xc,this.Cr=st.DP,this.ao=1,this.r0=1,this.o0=1,this.Mr=0,this.Jp=null,this.x0=null,this.b0="category"}copy(){let t=new Ue;return t.Pt=this.Pt,t.no=this.no,t.ve=this.ve,t.Ds=this.Ds,t.Il=this.Il,t.Er=this.Er,t.Ur=this.Ur,t.Vr=this.Vr,t.Yr=this.Yr,t.Kr=this.Kr,t.Br=this.Br,t.zr=this.zr,t.Xr=this.Xr,t.u0=this.u0,t.d0=this.d0,t.Gr=this.Gr,t.g0=this.g0,t.m0=this.m0,t.p0=this.p0,t.y0=this.y0,t.Hr=this.Hr,t.qr=this.qr,t.Zp=this.Zp,t.l0=this.l0,t.Ts=this.Ts,t.Nr=this.Nr.N(),t.Cr=this.Cr.N(),t.ao=this.ao,t.r0=this.r0,t.o0=this.o0,t.Mr=this.Mr,t.Jp=this.Jp,t.x0=this.x0,t.b0=this.b0,t}}class Si{m;constructor(){this.m=[1,0,0,1,0,0]}copy(){let t=new Si;return t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5],t}translate(t,e){this.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e}scale(t,e){this.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e}rotate(t,e,i){if(t=C.Ee(t),t===0)return;this.translate(e,i);let s=0,n=0;if(t===90)s=0,n=1;else if(t===180)s=-1,n=0;else if(t===270)s=0,n=-1;else{let l=t*Math.PI/180;s=Math.cos(l),n=Math.sin(l)}let o=this.m[0]*s+this.m[2]*n,r=this.m[1]*s+this.m[3]*n,a=this.m[0]*-n+this.m[2]*s,h=this.m[1]*-n+this.m[3]*s;this.m[0]=o,this.m[1]=r,this.m[2]=a,this.m[3]=h,this.translate(-e,-i)}}class li{type;x1;y1;r1;x2;y2;r2;colors;pattern;constructor(t){this.type=t,this.x1=0,this.y1=0,this.r1=0,this.x2=0,this.y2=0,this.r2=0,this.colors=[],this.pattern=null}addColorStop(t,e){this.colors.push({offset:t,color:e})}}class ui{bt;_t;tl;ud;EN;constructor(t,e,i){let s=e===void 0?X.document:e;this.tl=s,this.EN="http://www.w3.org/2000/svg";let n="http://www.w3.org/2000/xmlns/";s!==void 0&&(this.bt=this.makeElement("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",i||(this.style.position="absolute"),this.bt.setAttributeNS(n,"xmlns",this.EN),this.bt.setAttributeNS(n,"xmlns:xlink","http://www.w3.org/1999/xlink")),this.ud=null,this._t=new re(this,i)}resize(t,e,i,s){return this.width!==t||this.height!==e?(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=s+"px",this.bt.setAttributeNS(null,"width",i+"px"),this.bt.setAttributeNS(null,"height",s+"px"),this.bt.setAttributeNS(null,"viewBox","0 0 "+i+" "+s),this._t.UN.firstElementChild.setAttributeNS(null,"width",i+"px"),this._t.UN.firstElementChild.setAttributeNS(null,"height",s+"px"),!0):!1}makeElement(t,e,i){let s=this.tl.createElementNS(this.EN,t);if(m.$(e))for(let n in e)s.setAttributeNS(n==="href"?"http://www.w3.org/1999/xlink":"",n,e[n]);return i!==void 0&&(s.textContent=i),s}getBoundingClientRect(){return this.bt.getBoundingClientRect()}focus(){this.bt.focus()}get width(){return parseInt(this.bt.getAttribute("width")||"1")}set width(t){this.bt.setAttribute("width",t+"px")}get height(){return parseInt(this.bt.getAttribute("height")||"1")}set height(t){this.bt.setAttribute("height",t+"px")}dispose(){this.tl=null}get style(){return this.bt.style}}class re{Sf;Mf;Ln;Fe;$i;fillStyle;font;globalAlpha;lineCap;lineDashOffset;lineJoin;lineWidth;miterLimit;shadowBlur;shadowColor;shadowOffsetX;shadowOffsetY;strokeStyle;textAlign;imageSmoothingEnabled;clipInsteadOfFill;lastCreatedElement;Nf;Cf;surface;svg;UN;lD;G1;jo;La;Bh;currentElement;clipPathGroup;diagramGroup;lastDrawnPart;currentPath;outerGroup;pathAttributes;ol;vr;filter;letterSpacing;wordSpacing;partClipRect;constructor(t,e){if(this.surface=t,this.svg=t.bt,this.Nf=[],this.Cf=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetX=0,this.shadowOffsetY=0,this.ol=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Sf=0,this.Mf=0,this.Ln=0,this.lastCreatedElement=null,this.currentElement=null,this.Fe=[],this.pathAttributes={},this.G1=!1,this.jo=null,this.La=0,this.lD={},this.vr=!!e,this.filter="",this.partClipRect=null,this.$i=new Si,this.letterSpacing="0px",this.wordSpacing="0px",t.tl===null||t.tl===void 0)return;this.clipPathGroup=this.newGroup2(),this.diagramGroup=this.newGroup2("gojs-diagram"),this.lastDrawnPart=null,this.currentPath=null;let i=V.Ww++,s=this.makeElement("clipPath",{id:"mainClip"+i}),n={x:0,y:0,width:t.width,height:t.height};s.appendChild(this.makeElement("rect",n)),this.UN=s,this.svg.appendChild(this.clipPathGroup),this.clipPathGroup.appendChild(this.diagramGroup),this.svg.appendChild(s),this.clipPathGroup.setAttributeNS(null,"clip-path","url(#mainClip"+i+")")}setDiagramPosScale(t,e,i,s,n,o){this.diagramGroup===void 0?this.newGroup(t,e,i,s,n,o):this.diagramGroup.setAttribute("transform","matrix("+t+", "+e+", "+i+", "+s+", "+n+", "+o+")")}resetInnerSVG(){this.diagramGroup!==null&&(this.diagramGroup.innerHTML="")}arc(t,e,i,s,n,o,r,a){let h=2*Math.PI,l=1e-6,u=h-l,c=i*Math.cos(s),d=i*Math.sin(s),f=t+c,p=e+d,g=o?0:1,y=o?s-n:n-s;(Math.abs(r-f)>l||Math.abs(a-p)>l)&&this.Fe.push(["L",f,+p]),y<0&&(y=y%h+h),y>u?(this.Fe.push(["A",i,i,0,1,g,t-c,e-d]),this.Fe.push(["A",i,i,0,1,g,f,p])):y>l&&this.Fe.push(["A",i,i,0,+(y>=Math.PI),g,t+i*Math.cos(n),e+i*Math.sin(n)])}beginPath(){this.Fe=[],this.pathAttributes={stroke:"none",fill:"none"}}endPath(t){this.bI(this.Fe,this.$i,t||0)}bezierCurveTo(t,e,i,s,n,o){this.Fe.push(["C",t,e,i,s,n,o])}clearRect(t,e,i,s){}clip(){this.pathAttributes.clipPath=!0}closePath(){this.Fe.push(["z"])}createLinearGradient(t,e,i,s){let n=new li("linear");return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}createPattern(t,e){let i="";t instanceof HTMLCanvasElement&&(i=t.toDataURL()),t instanceof HTMLImageElement&&(i=t.getAttribute("src"));let s=this.lD;if(s[i])return"url(#"+s[i]+")";let n="PATTERN"+V.Ww++,o={width:t.width,height:t.height,id:n,patternUnits:"userSpaceOnUse"},r={x:0,y:0,width:t.width,height:t.height,href:i},a=this.makeElement("pattern",o);return a.appendChild(this.makeElement(Y.img,r)),this.svg.appendChild(a),s[i]=n,"url(#"+n+")"}createRadialGradient(t,e,i,s,n,o){let r=new li("radial");return r.x1=t,r.y1=e,r.r1=i,r.x2=s,r.y2=n,r.r2=o,r}amendImageTransform(t,e,i,s,n,o,r,a){let h=r/i,l=a/s;(n!==0||o!==0)&&this.$i.translate(n,o),(h!==1||l!==1)&&this.$i.scale(h,l),(t!==0||e!==0)&&this.$i.translate(-t,-e)}drawImage(t,e,i,s,n,o,r,a,h){let l="",u=t.width,c=t.height;typeof t.toDataURL=="function"?t.toDataURL():(l=t.getAttribute("src"),u=t.naturalWidth,c=t.naturalHeight),s===void 0&&(o=e,r=i,a=s=u,h=n=c),s=s||0,n=n||0,o=o||0,r=r||0,a=a||0,h=h||0,this.amendImageTransform(e,i,s,n,o,r,a,h);let d={x:0,y:0,width:u||s,height:c||n,href:l};!C.X(s,a)||!C.X(n,h)?d.preserveAspectRatio="none":l.toLowerCase().indexOf(".svg")===-1&&l.toLowerCase().indexOf("data:image/svg")===-1&&(d.preserveAspectRatio="xMidYMid slice"),(e!==0||i!==0||s!==u||n!==c)&&(s+=e,n+=i,d["clip-path"]=`path('M ${e},${i} L ${s} ${i} L ${s} ${n} L ${e} ${n} z')`),this.processCommon(Y.img,d,this.$i),this.Cd(Y.img,d)}fill(t,e){t&&(this.pathAttributes["fill-rule"]="evenodd"),this.setFill(this.pathAttributes)}fillContext(t,e,i){this.clipInsteadOfFill?this.clip():this.fill(e,i)}createOrUpdateClipGroup(t,e){let i=this.newGroup(1,0,0,1,-e.x,-e.y);i.setAttributeNS(null,"class","spotClip"),t.xa=i}fillRect(t,e,i,s){this.addRect("fill",[t,e,i,s],this.$i)}fillBackground(t,e,i,s){let n={x:t,y:e,width:i,height:s};this.processCommon("fill",n,this.$i),this.setFill(n),this.svg.prepend(this.makeElement("rect",n))}fillText(t,e,i){this.addText("fill",[t,e,i],this.$i)}lineTo(t,e){this.Fe.push(["L",t,e])}moveTo(t,e){this.Fe.push(["M",t,e])}quadraticCurveTo(t,e,i,s){this.Fe.push(["Q",t,e,i,s])}rect(t,e,i,s){this.Fe.push(["M",t,e],["L",t+i,e],["L",t+i,e+s],["L",t,e+s],["z"])}restore(){this.$i=this.Nf.pop(),this.Fe=this.Nf.pop();let t=this.Nf.pop();this.fillStyle=t.fillStyle,this.font=t.font,this.globalAlpha=t.globalAlpha,this.lineCap=t.lineCap,this.lineDashOffset=t.lineDashOffset,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this.shadowBlur=t.shadowBlur,this.shadowColor=t.shadowColor,this.shadowOffsetX=t.shadowOffsetX,this.shadowOffsetY=t.shadowOffsetY,this.strokeStyle=t.strokeStyle,this.textAlign=t.textAlign,this.partClipRect=t.partClipRect,this.letterSpacing=t.letterSpacing,this.wordSpacing=t.wordSpacing}save(){let t={fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,partClipRect:this.partClipRect};this.Nf.push(t);let e=[];for(let i=0;i<this.Fe.length;i++)e.push(this.Fe[i]);this.Nf.push(e),this.Nf.push(this.$i.copy())}setTransform(t,e,i,s,n,o){t===1&&e===0&&i===0&&s===1&&n===0&&o===0||this.newGroup(t,e,i,s,n,o)}setCurrentTransform(t,e,i,s,n,o){this.$i.m=[t,e,i,s,n,o]}getCurrentTransform(){let t=this.$i.m;return"matrix("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}scale(t,e){this.$i.scale(t,e)}translate(t,e){this.$i.translate(t,e)}transform(t,e,i,s,n,o){}commitTransform(){}stroke(){this.setStroke(this.pathAttributes)}strokeContext(){this.clipInsteadOfFill||this.stroke()}strokeRect(t,e,i,s){this.addRect("stroke",[t,e,i,s],this.$i)}makeElement(t,e,i){return this.surface.makeElement(t,e,i)}Cd(t,e,i){let s=this.makeElement(t,e,i);return this.currentElement!==null?this.currentElement.appendChild(s):this.currentElement=s,this.lastCreatedElement=s,s}processCommon(t,e,i){if(t==="fill"?this.setFill(e):t==="stroke"&&this.setStroke(e),i!==null){let s=i.m;e.transform="matrix("+s[0]+", "+s[1]+", "+s[2]+", "+s[3]+", "+s[4]+", "+s[5]+")"}}setFill(t){if(this.fillStyle instanceof li){t.fill=this.addGradient(this.fillStyle,"fill");return}if(/^rgba\(/.test(this.fillStyle)){let e=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(this.fillStyle);t.fill="rgb("+e[1]+","+e[2]+","+e[3]+")",t["fill-opacity"]=e[4]}else t.fill=this.fillStyle}setFillOrStrokeInPlace(t,e){let i=e?"fill":"stroke";if(this.fillStyle instanceof li){t.setAttributeNS(null,"fill",this.addGradient(this.fillStyle,i));return}if(/^rgba\(/.test(this.fillStyle)){let s=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(this.fillStyle);t.setAttributeNS(null,i,"rgb("+s[1]+","+s[2]+","+s[3]+")"),t.setAttributeNS(null,i+"-opacity",s[4])}else t.setAttributeNS(null,i,this.fillStyle)}setStroke(t){if(this.strokeStyle instanceof li)t.stroke=this.addGradient(this.strokeStyle,"stroke");else if(/^rgba\(/.test(this.strokeStyle)){let e=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(this.strokeStyle);t.stroke="rgb("+e[1]+","+e[2]+","+e[3]+")",t["stroke-opacity"]=e[4]}else t.stroke=this.strokeStyle;t["stroke-width"]=this.lineWidth,t["stroke-linecap"]=this.lineCap,t["stroke-linejoin"]=this.lineJoin,t["stroke-miterlimit"]=this.miterLimit,this.G1&&(t["stroke-dasharray"]=this.jo.toString(),t["stroke-dashoffset"]=this.La)}addGradient(t,e){let i="",s=this.currentPath!==null?this.currentPath.getAttribute(e):null;if(s!==null&&s.indexOf("GRAD")!==-1){i=s.split("#")[1].slice(0,-1);let a=this.svg.getElementById(i);a!==null&&a.remove()}else i="GRAD"+V.Ww++;let n;if(t.type==="linear"){let a={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2,id:i,gradientUnits:"userSpaceOnUse"};n=this.makeElement("linearGradient",a)}else if(t.type==="radial"){let a={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2,r1:t.r1,r2:t.r2,id:i};n=this.makeElement("radialGradient",a)}else m.o("invalid gradient");let o=t.colors.sort((a,h)=>a.offset>h.offset?1:-1),r=o.length;for(let a=0;a<r;a++){let h=o[a],l=h.color;n.appendChild(this.makeElement("stop",{offset:h.offset,"stop-color":l}))}return this.svg.appendChild(n),"url(#"+i+")"}addRect(t,e,i){let s={x:e[0],y:e[1],width:e[2],height:e[3]};this.processCommon(t,s,i),this.Cd("rect",s)}addText(t,e,i){let s=this.textAlign;s==="left"?s="start":s==="right"?s="end":s==="center"&&(s="middle");let n={x:e[1],y:e[2],style:"font: "+this.font,"text-anchor":s};n["letter-spacing"]=this.letterSpacing,n["word-spacing"]=this.wordSpacing,this.processCommon(t,n,i),this.Cd("text",n,e[0])}bI(t,e,i){let s=this.kI(t),n=this.pathAttributes;if(n.clipPath){this.Cf.length>1&&this.Cf[this.Cf.length-2].setAttributeNS(null,"clip-path",'path("'+s+'") view-box');return}if(n.d=s,this.processCommon("",n,e),this.currentPath!==null){let o=this.currentPath;if(o.nodeName!=="g")for(let r in n)r!=="transform"&&o.setAttributeNS(null,r,n[r]);else{let r=o.getElementsByTagName("path");for(let a in n)a!=="transform"&&r[i].setAttributeNS(null,a,n[a])}}else this.Cd("path",n)}kI(t){let e=[];for(let i=0;i<t.length;i++){let s=t[i].slice(),n=[s.shift()];if(n[0]==="A")n.push(s.shift()+","+s.shift(),s.shift(),s.shift()+","+s.shift(),s.shift()+","+s.shift());else for(;s.length;)n.push(s.shift()+","+s.shift());e.push(n.join(" "))}return e.join(" ")}newGroup(t,e,i,s,n,o){let r=new Si;r.m=[t,e,i,s,n,o];let a={};this.processCommon("g",a,r);let h=this.Cd("g",a);return this.Cf.push(h),h}newGroup2(t){let e={};t&&(e.class=t);let i=this.Cd("g",e);return this.Cf.push(i),i}endGroup(){return this.Cf.pop()}dummyGroup(){return this.newGroup2(),this.endGroup()}shadowsSet(t,e,i){this.Sf=t,this.Mf=e,this.Ln=i}shadowsOff(){this.ol=!1,this.shadowOffsetX=0,this.shadowOffsetY=0,this.shadowBlur=0}shadowsOn(){this.ol=!0,this.shadowOffsetX=this.Sf,this.shadowOffsetY=this.Mf,this.shadowBlur=this.Ln}enableDash(t,e){this.G1=!0,this.jo=t,this.La=e}disableDash(){this.G1=!1}clearContextCache(t){}setImageSmoothingEnabled(t){}rotate(t){this.$i.rotate(t*57.2958,0,0)}getImageData(t,e,i,s){return null}measureText(t){return null}removeOldGradient(t,e,i){let s=e.getAttribute(i);if(s===null)return;let n=s.split("#");if(n.length===1)return;let o=this.svg.getElementById(n[1].slice(0,-1));if(o!==null){let r=new RegExp(o.id,"g");this.svg.innerHTML.match(r).length===1&&o.remove()}}removePartFromView(t){t.svg!==null&&t.svg.parentNode===this.diagramGroup&&t.svg.remove()}}class Fe{bt;_t;tl;ud;constructor(t,e,i,s){let n=e===void 0?X.document:e;this.tl=n,this.ud=null;let o=n.createElement("canvas");o.tabIndex=0,this.bt=o,this._t=new ci(o,i,s),t&&Y.ji.set(o,t)}resize(t,e,i,s){return this.width!==t||this.height!==e?(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=s+"px",!0):!1}toDataURL(t,e){return this.bt.toDataURL(t,e)}getBoundingClientRect(){return this.bt.getBoundingClientRect()}focus(){this.bt.focus()}get width(){return this.bt.width}set width(t){this.bt.width=t}get height(){return this.bt.height}set height(t){this.bt.height=t}dispose(){Y.ji.delete(this.bt),this.tl=null}get style(){return this.bt.style}}class ci{F;Y1;K1;H1;clipInsteadOfFill;Sf;Mf;Ln;Bh;ol;vr;constructor(t,e,i){t.getContext||m.o("Browser does not support HTML Canvas Element"),this.F=t.getContext("2d",e),this.Y1="",this.K1="",this.H1="",this.clipInsteadOfFill=!1,this.Sf=0,this.Mf=0,this.Ln=0,this.ol=!1,this.Bh=new Nt,this.vr=!!i}createOrUpdateClipGroup(t,e){}setImageSmoothingEnabled(t){this.F.imageSmoothingEnabled=t}get fillStyle(){return this.F.fillStyle}set fillStyle(t){this.H1!==t&&(this.F.fillStyle=t,this.H1=t)}get font(){return this.F.font}set font(t){this.Y1!==t&&(this.F.font=t,this.Y1=t)}get globalAlpha(){return this.F.globalAlpha}set globalAlpha(t){this.F.globalAlpha=t}get lineCap(){return this.F.lineCap}set lineCap(t){this.F.lineCap=t}get lineDashOffset(){return this.F.lineDashOffset}set lineDashOffset(t){this.F.lineDashOffset=t}get lineJoin(){return this.F.lineJoin}set lineJoin(t){this.F.lineJoin=t}get lineWidth(){return this.F.lineWidth}set lineWidth(t){this.F.lineWidth=t}get miterLimit(){return this.F.miterLimit}set miterLimit(t){this.F.miterLimit=t}get shadowBlur(){return this.F.shadowBlur}set shadowBlur(t){this.F.shadowBlur=t}get shadowColor(){return this.F.shadowColor}set shadowColor(t){this.F.shadowColor=t}get shadowOffsetX(){return this.F.shadowOffsetX}set shadowOffsetX(t){this.F.shadowOffsetX=t}get shadowOffsetY(){return this.F.shadowOffsetY}set shadowOffsetY(t){this.F.shadowOffsetY=t}get strokeStyle(){return this.F.strokeStyle}set strokeStyle(t){this.K1!==t&&(this.F.strokeStyle=t,this.K1=t)}get textAlign(){return this.F.textAlign}set textAlign(t){this.F.textAlign=t}get imageSmoothingEnabled(){return this.F.imageSmoothingEnabled}set imageSmoothingEnabled(t){this.F.imageSmoothingEnabled=t}get filter(){return this.F.filter}set filter(t){t===""?this.F.filter="none":this.F.filter=t}get letterSpacing(){return this.F.letterSpacing}set letterSpacing(t){this.F.letterSpacing=t}get wordSpacing(){return this.F.wordSpacing}set wordSpacing(t){this.F.wordSpacing=t}arc(t,e,i,s,n,o,r,a){this.F.arc(t,e,i,s,n,o)}beginPath(){this.F.beginPath()}endPath(){}bezierCurveTo(t,e,i,s,n,o){this.F.bezierCurveTo(t,e,i,s,n,o)}clearRect(t,e,i,s){this.commitTransform(),this.F.clearRect(t,e,i,s)}clip(t){t?this.F.clip(t):this.F.clip()}closePath(){this.F.closePath()}createLinearGradient(t,e,i,s){return this.F.createLinearGradient(t,e,i,s)}createPattern(t,e){return this.F.createPattern(t,e)}createRadialGradient(t,e,i,s,n,o){return this.F.createRadialGradient(t,e,i,s,n,o)}drawImage(t,e,i,s,n,o,r,a,h){s===void 0?this.F.drawImage(t,e,i):this.F.drawImage(t,e,i,s,n,o,r,a,h)}fill(t,e){e?this.F.fill(e,t?"evenodd":"nonzero"):this.F.fill(t?"evenodd":"nonzero")}fillRect(t,e,i,s){this.F.fillRect(t,e,i,s)}fillBackground(t,e,i,s){this.F.fillRect(t,e,i,s)}fillText(t,e,i){this.F.fillText(t,e,i)}getImageData(t,e,i,s){return this.F.getImageData(t,e,i,s)}lineTo(t,e){this.F.lineTo(t,e)}measureText(t){return this.F.measureText(t)}moveTo(t,e){this.F.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this.F.quadraticCurveTo(t,e,i,s)}rect(t,e,i,s){this.F.rect(t,e,i,s)}restore(){this.F.restore()}save(){this.commitTransform(),this.F.save()}rotate(t){this.Bh.ks(t*57.2958,0,0)}setTransform(t,e,i,s,n,o){this.Bh.setTo(t,e,i,s,n,o)}scale(t,e){this.Bh.it(t,e)}translate(t,e){this.Bh.Xs(t,e)}stroke(t){t?this.F.stroke(t):this.F.stroke()}transform(t,e,i,s,n,o){if(t===1&&e===0&&i===0&&s===1&&n===0&&o===0)return;let r=this.Bh,a=r.m11*t+r.m21*e,h=r.m12*t+r.m22*e,l=r.m11*i+r.m21*s,u=r.m12*i+r.m22*s;r.dx=r.m11*n+r.m21*o+r.dx,r.dy=r.m12*n+r.m22*o+r.dy,r.m11=a,r.m12=h,r.m21=l,r.m22=u}commitTransform(){let t=this.Bh;this.F.setTransform(t.m11,t.m12,t.m21,t.m22,t.dx,t.dy)}fillContext(t,e,i){this.radialFill(t,e,i)||this.fillOrClip(e,i)}radialFill(t,e,i){if(!(t instanceof R)||t.type!==3)return!1;let s=t.xf,n=t.V1;return n>s?(this.scale(s/n,1),this.translate((n-s)/2,0)):s>n&&(this.scale(1,n/s),this.translate(0,(s-n)/2)),this.fillOrClip(e,i),n>s?(this.translate(-(n-s)/2,0),this.scale(1/(s/n),1)):s>n&&(this.translate(0,-(s-n)/2),this.scale(1,1/(n/s))),!0}strokeContext(){this.clipInsteadOfFill||this.stroke()}fillOrClip(t,e){this.clipInsteadOfFill?this.clip(e):this.fill(t,e)}shadowsSet(t,e,i){this.Sf=t,this.Mf=e,this.Ln=i}shadowsOff(){this.ol=!1,this.shadowOffsetX=0,this.shadowOffsetY=0,this.shadowBlur=0}shadowsOn(){this.ol=!0,this.shadowOffsetX=this.Sf,this.shadowOffsetY=this.Mf,this.shadowBlur=this.Ln}enableDash(t,e){let i=this.F;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=e)}disableDash(){let t=this.F;t.setLineDash!==void 0&&(t.setLineDash(ci.EmptyArray),t.lineDashOffset=0)}clearContextCache(t){t&&(this.Y1=""),this.K1="",this.H1=""}removePartFromView(t){}static EmptyArray=Object.freeze([])}var Oe=(x=>(x[x.Solid=1]="Solid",x[x.Linear=2]="Linear",x[x.Radial=3]="Radial",x[x.Pattern=4]="Pattern",x))(Oe||{}),Ys=(x=>(x[x.Lab=1]="Lab",x[x.HSL=2]="HSL",x[x.Oklch=3]="Oklch",x))(Ys||{});class _e{n0;n1;n2;n3;constructor(){this.n0=0,this.n1=0,this.n2=0,this.n3=0}}class R{u;W;zh;ae;Cs;k0;P0;Wo;S0;Nn;xf;V1;constructor(t,e){if(V.Je(this),this.u=!1,t===void 0)this.W=1,this.zh="black";else if(typeof t=="string"){let s=m.$a(Oe,t);s!==null?(this.W=s,this.zh="black"):(this.W=1,this.zh=t)}else Object.keys(Oe).hasOwnProperty(t)?(this.W=t,this.zh="black"):typeof t=="object"&&(this.W=1,e=t);let i=this.W;if(i===2?(this.ae=T.TopCenter,this.Cs=T.BottomCenter):i===3?(this.ae=T.Center,this.Cs=T.Center):(this.ae=T.None,this.Cs=T.None),this.k0=0,this.P0=NaN,this.Wo=null,this.S0=null,this.Nn=null,this.xf=0,this.V1=0,e){let s={};for(let n in e)isFinite(parseFloat(n))?this.addColorStop(parseFloat(n),e[n]):s[n]=e[n];Object.assign(this,s)}}copy(){let t=new R;return t.W=this.W,t.zh=this.zh,t.ae=this.ae.N(),t.Cs=this.Cs.N(),t.k0=this.k0,t.P0=this.P0,this.Wo!==null&&(t.Wo=this.Wo.copy()),t.S0=this.S0,t}k(){return this.u=!0,this.Wo!==null&&this.Wo.k(),this}fe(t){t in Oe?this.type=t:m.ur(this,t)}toString(){let t="Brush(";if(this.type===1)t+=this.color;else if(this.type===2?t+="Linear ":this.type===3?t+="Radial ":this.type===4?t+="Pattern ":t+="(unknown) ",t+=this.start+" "+this.end,this.colorStops!==null){let e=this.colorStops.iterator;for(;e.next();){let i=e.key,s=e.value;t+=" "+i+":"+s}}return t+=")",t}addColorStop(t,e){return this.u&&m.L(this),(typeof t!="number"||!isFinite(t)||t>1||t<0)&&m.J(t,"0 <= loc <= 1",R,"addColorStop:loc"),m.s(e,"string",R,"addColorStop:color"),this.Wo===null&&(this.Wo=new Mt),this.Wo.set(t,e),this.W===1&&(this.type=2),this.Nn=null,this}get type(){return this.W}set type(t){this.u&&m.L(this,t),this.W=t,this.start.isNoSpot()&&(t===2?this.start=T.TopCenter:t===3&&(this.start=T.Center)),this.end.isNoSpot()&&(t===2?this.end=T.BottomCenter:t===3&&(this.end=T.Center)),this.Nn=null}get color(){return this.zh}set color(t){this.u&&m.L(this,t),this.zh=t,this.Nn=null}get start(){return this.ae}set start(t){this.u&&m.L(this,t),this.ae=t.N(),this.Nn=null}get end(){return this.Cs}set end(t){this.u&&m.L(this,t),this.Cs=t.N(),this.Nn=null}get startRadius(){return this.k0}set startRadius(t){this.u&&m.L(this,t),t<0&&m.J(t,">= zero",R,"startRadius"),this.k0=t,this.Nn=null}get endRadius(){return this.P0}set endRadius(t){this.u&&m.L(this,t),t<0&&m.J(t,">= zero",R,"endRadius"),this.P0=t,this.Nn=null}get colorStops(){return this.Wo}set colorStops(t){this.u&&m.L(this,t),this.Wo=t,this.Nn=null}get pattern(){return this.S0}set pattern(t){this.u&&m.L(this,t),this.S0=t,this.Nn=null}static randomColor(t,e){t===void 0&&(t=128),e===void 0&&(e=Math.max(t,255));let i=Math.abs(e-t),s=Math.floor(t+Math.random()*i).toString(16),n=Math.floor(t+Math.random()*i).toString(16),o=Math.floor(t+Math.random()*i).toString(16);return s.length<2&&(s="0"+s),n.length<2&&(n="0"+n),o.length<2&&(o="0"+o),"#"+s+n+o}static isValidColor(t){return X.CSS?X.CSS.supports("color",t):!0}static lighten(t){return R.lightenBy(t)}lightenBy(t,e){this.u&&m.L(this);let i=t===void 0||typeof t!="number"?.2:t,s=e===void 0?3:e;if(this.type===1)R.Eo(this.color),this.color=R.Ld(i,s);else if((this.type===2||this.type===3)&&this.colorStops!==null){let n=this.colorStops.iterator;for(;n.next();)R.Eo(n.value),this.addColorStop(n.key,R.Ld(i,s))}return this}static lightenBy(t,e,i){let s=e===void 0||typeof e!="number"?.2:e,n=i===void 0?3:i;return R.Eo(t),R.Ld(s,n)}static darken(t){return R.darkenBy(t)}darkenBy(t,e){this.u&&m.L(this);let i=t===void 0||typeof t!="number"?.2:t,s=e===void 0?3:e;if(this.type===1)R.Eo(this.color),this.color=R.Ld(-i,s);else if((this.type===2||this.type===3)&&this.colorStops!==null){let n=this.colorStops.iterator;for(;n.next();)R.Eo(n.value),this.addColorStop(n.key,R.Ld(-i,s))}return this}static darkenBy(t,e,i){let s=e===void 0||typeof e!="number"?.2:e,n=i===void 0?3:i;return R.Eo(t),R.Ld(-s,n)}static mix(t,e,i){R.Eo(t);let s=R.Y.n0,n=R.Y.n1,o=R.Y.n2,r=R.Y.n3;R.Eo(e),i===void 0&&(i=.5);let a=Math.round((R.Y.n0-s)*i+s),h=Math.round((R.Y.n1-n)*i+n),l=Math.round((R.Y.n2-o)*i+o),u=Math.round((R.Y.n3-r)*i+r);return`rgba(${a}, ${h}, ${l}, ${u})`}isDark(){if(this.type===1)return R.isDark(this.color);if((this.type===2||this.type===3)&&this.colorStops!==null){let t=this.colorStops;if(this.type===3){let a=t.first();return a?R.isDark(a.value):!1}if(t.get(.5)!==null)return R.isDark(t.get(.5));if(t.count===2){let a=t.toArray();return R.isDark(R.mix(a[0].value,a[1].value))}let e=t.iterator,i=-1,s=-1,n=1,o=1;for(;e.next();){let a=e.key,h=Math.abs(.5-e.key);n>o&&h<n?(i=a,n=h):o>=n&&h<o&&(s=a,o=h)}if(i>s){let a=i;i=s,s=a,a=n,n=o,o=a}let r=s-i;return R.isDark(R.mix(t.get(i),t.get(s),1-o/r))}return!1}static isDark(t){return t?t instanceof R?t.isDark():(R.Eo(t),(299*R.Y.n0+587*R.Y.n1+114*R.Y.n2)/1e3<128):!1}static Ld(t,e){switch(e){case 1:return R.SI(),R.ho.n0=Math.min(100,Math.max(0,R.ho.n0+100*t)),R.MI(),"rgba("+R.Y.n0+", "+R.Y.n1+", "+R.Y.n2+", "+R.Y.n3+")";case 2:return R.IM(),R.ze.n2=Math.min(100,Math.max(0,R.ze.n2+100*t)),"hsla("+R.ze.n0+", "+R.ze.n1+"%, "+R.ze.n2+"%, "+R.ze.n3+")";case 3:return R.NI(),R.co.n0=Math.min(100,Math.max(0,R.co.n0+100*t)),R.CI(),"rgba("+R.Y.n0+", "+R.Y.n1+", "+R.Y.n2+", "+R.Y.n3+")";default:m.o("Unknown color space: "+e)}}static Eo(t){R.M0===!1&&(R.M0=!0,R.us=Y.isUsingDOM()?new Fe(null,void 0,{willReadFrequently:!0})._t:null);let e=R.us;if(e===null)return;e.clearRect(0,0,1,1),e.fillStyle="#000000";let i=e.fillStyle;if(e.fillStyle=t,e.fillStyle!==i){e.fillRect(0,0,1,1);let s=e.getImageData(0,0,1,1).data;R.Y.n0=s[0],R.Y.n1=s[1],R.Y.n2=s[2],R.Y.n3=s[3]/255}else{e.fillStyle="#FFFFFF";let s=e.fillStyle;e.fillStyle=t,e.fillStyle,R.Y.n0=0,R.Y.n1=0,R.Y.n2=0,R.Y.n3=1}}static IM(){let t=R.Y.n0/255,e=R.Y.n1/255,i=R.Y.n2/255,s=Math.max(t,e,i),n=Math.min(t,e,i),o=s-n,r,a,h=(s+n)/2;if(o===0)r=a=0;else{switch(s){case t:r=(e-i)/o%6;break;case e:r=(i-t)/o+2;break;case i:r=(t-e)/o+4;break;default:r=0;break}r*=60,r<0&&(r+=360),a=o/(1-Math.abs(2*h-1))}R.ze.n0=Math.round(r),R.ze.n1=Math.round(a*100),R.ze.n2=Math.round(h*100),R.ze.n3=R.Y.n3}static VU(){let t=R.ze.n0,e=R.ze.n1/100,i=R.ze.n2/100,s,n,o,r=(1-Math.abs(2*i-1))*e,a=t/60,h=r*(1-Math.abs(a%2-1));a>=0&&a<1?(s=r,n=h,o=0):a>=1&&a<2?(s=h,n=r,o=0):a>=2&&a<3?(s=0,n=r,o=h):a>=3&&a<4?(s=0,n=h,o=r):a>=4&&a<5?(s=h,n=0,o=r):(s=r,n=0,o=h);let l=i-.5*r;s+=l,n+=l,o+=l,R.Y.n0=Math.round(s*255),R.Y.n1=Math.round(n*255),R.Y.n2=Math.round(o*255),R.Y.n3=R.ze.n3}static SI(){R.aD(),R.LI()}static MI(){R.AI(),R.hD()}static VN(t){return t/=255,t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}static BN(t){return t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055}static aD(){let t=R.VN(R.Y.n0),e=R.VN(R.Y.n1),i=R.VN(R.Y.n2);R.At.n0=.4124564*t+.3575761*e+.1804375*i,R.At.n1=.2126729*t+.7151522*e+.072175*i,R.At.n2=.0193339*t+.119192*e+.9503041*i,R.At.n3=R.Y.n3}static hD(){let t=3.2404542*R.At.n0+-1.5371385*R.At.n1+-.4985314*R.At.n2,e=-.969266*R.At.n0+1.8760108*R.At.n1+.041556*R.At.n2,i=.0556434*R.At.n0+-.2040259*R.At.n1+1.0572252*R.At.n2;R.Y.n0=R.BN(t)*255,R.Y.n1=R.BN(e)*255,R.Y.n2=R.BN(i)*255,R.Y.n3=R.At.n3,R.Y.n0=Math.round(R.Y.n0),R.Y.n0>255?R.Y.n0=255:R.Y.n0<0&&(R.Y.n0=0),R.Y.n1=Math.round(R.Y.n1),R.Y.n1>255?R.Y.n1=255:R.Y.n1<0&&(R.Y.n1=0),R.Y.n2=Math.round(R.Y.n2),R.Y.n2>255?R.Y.n2=255:R.Y.n2<0&&(R.Y.n2=0)}static zN=216/24389;static q1=24389/27;static Ad=[95.047,100,108.883];static XN(t){return t>R.zN?Math.pow(t,1/3):(R.q1*t+16)/116}static LI(){let t=R.XN(R.At.n0*100/R.Ad[0]),e=R.XN(R.At.n1*100/R.Ad[1]),i=R.XN(R.At.n2*100/R.Ad[2]);R.ho.n0=116*e-16,R.ho.n1=500*(t-e),R.ho.n2=200*(e-i),R.ho.n3=R.At.n3}static cD(t){let e=t*t*t;return e>R.zN?e:(116*t-16)/R.q1}static AI(){let t=(R.ho.n0+16)/116,e=R.ho.n1/500+t,i=t-R.ho.n2/200;R.At.n0=R.Ad[0]/100*R.cD(e),R.At.n1=R.Ad[1]/100*(R.ho.n0>R.q1*R.zN?Math.pow(t,3):R.ho.n0/R.q1),R.At.n2=R.Ad[2]/100*R.cD(i),R.At.n3=R.ho.n3}static TI(){let t=.8190224*R.At.n0+.3619062*R.At.n1+-.1288737*R.At.n2,e=.03298366*R.At.n0+.9292868*R.At.n1+.03614466*R.At.n2,i=.04817719*R.At.n0+.2642395*R.At.n1+.6335478*R.At.n2;t=Math.cbrt(t),e=Math.cbrt(e),i=Math.cbrt(i),R.ge.n0=.2104542*t+.7936177*e+-.004072046*i,R.ge.n1=1.977998*t+-2.428592*e+.4505937*i,R.ge.n2=.02590403*t+.7827717*e+-.8086757*i,R.ge.n3=R.At.n3,R.ge.n0*=100}static DI(){R.ge.n0/=100;let t=.9999999*R.ge.n0+.3963377*R.ge.n1+.2158037*R.ge.n2,e=1.000000009*R.ge.n0+-.1055613*R.ge.n1+-.06385417*R.ge.n2,i=1.00000005*R.ge.n0+-.08948418*R.ge.n1+-1.291485*R.ge.n2;t=t**3,e=e**3,i=i**3,R.At.n0=1.2268798*t+-.5578149*e+.281391*i,R.At.n1=-.04057576*t+1.112286*e+-.07171106*i,R.At.n2=-.07637294*t+-.4214933*e+1.586924*i,R.At.n3=R.ge.n3}static vI(){let t=Math.atan2(R.ge.n2,R.ge.n1)*180/Math.PI;R.co.n0=R.ge.n0,R.co.n1=Math.sqrt(R.ge.n1**2+R.ge.n2**2),R.co.n2=t>=0?t:t+360,R.co.n3=R.ge.n3}static FI(){R.ge.n0=R.co.n0,R.ge.n1=R.co.n1*Math.cos(R.co.n2*Math.PI/180),R.ge.n2=R.co.n1*Math.sin(R.co.n2*Math.PI/180),R.ge.n3=R.co.n3}static NI(){R.aD(),R.TI(),R.vI()}static CI(){R.FI(),R.DI(),R.hD()}static Md(t,e){typeof t=="string"||t instanceof R||m.o("Value for "+e+" must be a color string or a Brush, not "+t)}static Solid=1;static Linear=2;static Radial=3;static Pattern=4;static Lab=1;static HSL=2;static us=null;static M0=!1;static Y=new _e;static ze=new _e;static At=new _e;static ho=new _e;static ge=new _e;static co=new _e}class Lt{Pt="Base";static fs=new Mt;static An(t,e){e.name=t,Lt.fs.set(t,e)}get name(){return this.Pt}set name(t){this.Pt=t}constructor(){}get classType(){return G}measure(t,e,i,s,n,o,r){}measureElement(t,e,i,s,n){t.ht(e,i,s,n)}arrange(t,e,i){}arrangeElement(t,e,i,s,n,o){t.Ut(e,i,s,n,o)}remeasureObject(t){t.bf()}Ge(t,e,i){}}class In extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length,h=t.Jo();for(let l=0;l<a;l++){let u=s[l];if(!u.visible&&u!==h)continue;let c=u.margin,d=c.right+c.left,f=c.top+c.bottom;u.ht(e,i,o,r);let p=u.measuredBounds,g=Math.max(p.width+d,0),y=Math.max(p.height+f,0),b=u.position.x,v=u.position.y;if(isFinite(b)||(b=0),isFinite(v)||(v=0),u instanceof et&&u.isGeometryPositioned){let w=u.strokeWidth/2;b-=w,v-=w}n.re(b,v,g,y)}}arrange(t,e,i){let s=e.length,n=t.padding,o=i.x-n.left,r=i.y-n.top;for(let a=0;a<s;a++){let h=e[a],l=h.measuredBounds,u=h.margin,c=h.position.x,d=h.position.y,f=isNaN(c)?-o:c-o,p=isNaN(d)?-r:d-r;if(h instanceof et&&h.isGeometryPositioned){let g=h.strokeWidth/2;f-=g,p-=g}h.visible&&h.Ut(f+u.left,p+u.top,l.width,l.height)}}}Lt.An("Position",new In);class Bn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length,h=m.nt(),l=t.Jo();for(let c=0;c<a;c++){let d=s[c];if(!d.visible&&d!==l)continue;let f=d.Zs(!1);if(f!==0&&f!==5){h.push(d);continue}d.ht(1/0,i,0,r);let p=d.margin,g=d.measuredBounds,y=Math.max(g.width+p.right+p.left,0),b=Math.max(g.height+p.top+p.bottom,0);n.Hn(n.width+y,Math.max(n.height,b))}let u=h.length;t.desiredSize.height?i=Math.min(t.desiredSize.height,t.maxSize.height):n.height!==0&&(i=Math.min(n.height,t.maxSize.height));for(let c=0;c<u;c++){let d=h[c];if(!d.visible&&d!==l)continue;let f=d.margin,p=f.right+f.left,g=f.top+f.bottom;d.ht(1/0,i,0,r);let y=d.measuredBounds,b=Math.max(y.width+p,0),v=Math.max(y.height+g,0);n.width+=b,n.height=Math.max(n.height,v)}m.Z(h)}arrange(t,e,i){let s=e.length,n=t.padding,o=n.top,r=t.isOpposite,a=r?i.width:n.left;for(let h=0;h<s;h++){let l=o,u=e[h];if(!u.visible)continue;let c=u.measuredBounds,d=u.margin,f=d.top+d.bottom,p=o+n.bottom,g=c.height,y=u.Zs(!1);(isNaN(u.desiredSize.height)&&y===2||y===4)&&(g=Math.max(i.height-f-p,0));let b=g+f+p,v=u.alignment;v.isDefault()&&(v=t.defaultAlignment),v.isSpot()||(v=T.Center),r&&(a-=c.width+d.left+d.right),u.Ut(a+v.offsetX+d.left,l+v.offsetY+d.top+(i.height*v.y-b*v.y),c.width,g),r||(a+=c.width+d.left+d.right)}}}Lt.An("Horizontal",new Bn);class Vn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length,h=m.nt(),l=t.Jo();for(let c=0;c<a;c++){let d=s[c];if(!d.visible&&d!==l)continue;let f=d.Zs(!1);if(f!==0&&f!==4){h.push(d);continue}d.ht(e,1/0,o,0);let p=d.margin,g=d.measuredBounds,y=Math.max(g.width+p.right+p.left,0),b=Math.max(g.height+p.top+p.bottom,0);n.Hn(Math.max(n.width,y),n.height+b)}let u=h.length;t.desiredSize.width?e=Math.min(t.desiredSize.width,t.maxSize.width):n.width!==0&&(e=Math.min(n.width,t.maxSize.width));for(let c=0;c<u;c++){let d=h[c];if(!d.visible&&d!==l)continue;let f=d.margin,p=f.right+f.left,g=f.top+f.bottom;d.ht(e,1/0,o,0);let y=d.measuredBounds,b=Math.max(y.width+p,0),v=Math.max(y.height+g,0);n.width=Math.max(n.width,b),n.height+=v}m.Z(h)}arrange(t,e,i){let s=e.length,n=t.padding,o=n.left,r=t.isOpposite,a=r?i.height:n.top;for(let h=0;h<s;h++){let l=o,u=e[h];if(!u.visible)continue;let c=u.measuredBounds,d=u.margin,f=d.left+d.right,p=o+n.right,g=c.width,y=u.Zs(!1);(isNaN(u.desiredSize.width)&&y===2||y===5)&&(g=Math.max(i.width-f-p,0));let b=g+f+p,v=u.alignment;v.isDefault()&&(v=t.defaultAlignment),v.isSpot()||(v=T.Center),r&&(a-=c.height+d.bottom+d.top),u.Ut(l+v.offsetX+d.left+(i.width*v.x-b*v.x),a+v.offsetY+d.top,g,c.height),r||(a+=c.height+d.bottom+d.top)}}}Lt.An("Vertical",new Vn);class Mi extends Lt{constructor(){super()}static fD=!1;measure(t,e,i,s,n,o,r){let a=s.length;if(a===0)return;let h=t.findMainElement(),l=h.margin,u=0,c=0,d=l.right+l.left,f=l.top+l.bottom;h.ht(e,i,o,r);let p=h.measuredBounds,g=p.width,y=p.height,b=Math.max(g+d,0),v=Math.max(y+f,0),w=t.isClipping;w&&h.qp()!==0&&!Mi.fD&&(Mi.fD=!0,m.ne("Main Shape for Spot Panel with isClipping = true must have a zero strokeWidth: "+t.toString()));let k=I.z(-l.left,-l.top,b,v),S=I.z(0,0,g,y);this.GN(h,S,!0),g=S.width,y=S.height;let N=!0,D=t.Jo(),L;for(let M=0;M<a;M++){let A=s[M],F=e,O=i;if(A===h||!A.visible&&A!==D)continue;l=A.margin;let E=l.left,B=l.top;switch(u=l.right+l.left,c=l.top+l.bottom,L=A.Zs(!1),L){case 2:F=g,O=y,u=0,c=0,E=0,B=0;break;case 5:F=g,u=0,E=0;break;case 4:O=y,c=0,B=0;break}A.ht(F,O,0,0),p=A.measuredBounds,b=Math.max(p.width+u,0),v=Math.max(p.height+c,0);let K=A.alignment;K.isDefault()&&(K=t.defaultAlignment),K.isSpot()||(K=T.Center);let z=A.alignmentFocus;z.isDefault()&&(z=T.Center);let U=null;A instanceof G&&A.fo!==""&&(U=A.findObject(A.fo),U===A&&(U=null));let tt=S.x-E,nt=S.y-B;if(U!==null){A.Ut(0,0,p.width,p.height);let Z=U.actualBounds,it=P.z(Z.x+(z.x*Z.width-z.offsetX),Z.y+(z.y*Z.height-z.offsetY));for(U=U.panel;U!==null&&U!==A;)U.v.gt(it),U=U.panel;tt+=K.x*g+K.offsetX-it.x,nt+=K.y*y+K.offsetY-it.y,P.i(it)}else tt+=K.x*g+K.offsetX-(z.x*p.width+z.offsetX),nt+=K.y*y+K.offsetY-(z.y*p.height+z.offsetY);N?(N=!1,n.e(tt,nt,b,v)):n.re(tt,nt,b,v)}switch(N?n.h(k):w?n.intersect(S.x,S.y,S.width,S.height):n.re(k.x,k.y,k.width,k.height),I.i(k),I.i(S),L=h.stretch,L===1&&(L=h.Zs(!1)),L){case 0:return;case 2:if(!isFinite(e)&&!isFinite(i))return;break;case 5:if(!isFinite(e))return;break;case 4:if(!isFinite(i))return;break}p=h.measuredBounds,g=p.width,y=p.height,b=Math.max(g+d,0),v=Math.max(y+f,0),l=h.margin,S=I.z(-l.left,-l.top,b,v),this.GN(h,S,!0),g=S.width,y=S.height;for(let M=0;M<a;M++){let A=s[M];if(A===h||!A.visible&&A!==D)continue;l=A.margin,u=l.right+l.left,c=l.top+l.bottom,p=A.measuredBounds,b=Math.max(p.width+u,0),v=Math.max(p.height+c,0);let F=A.alignment;F.isDefault()&&(F=t.defaultAlignment),F.isSpot()||(F=T.Center);let O=A.alignmentFocus;O.isDefault()&&(O=T.Center),N?(N=!1,n.e(F.x*g+F.offsetX-(O.x*p.width+O.offsetX)-l.left,F.y*y+F.offsetY-(O.y*p.height+O.offsetY)-l.top,b,v)):n.re(F.x*g+F.offsetX-(O.x*p.width+O.offsetX)-l.left,F.y*y+F.offsetY-(O.y*p.height+O.offsetY)-l.top,b,v)}N?n.h(k):w?n.intersect(S.x,S.y,S.width,S.height):n.re(k.x,k.y,k.width,k.height),I.i(S)}arrange(t,e,i){let s=e.length;if(s===0)return;let n=t.findMainElement(),o=n.measuredBounds,r=o.width,a=o.height,h=t.padding,l=h.left,u=h.top,c=l-i.x,d=u-i.y;n.Ut(c,d,r,a);let f=I.z(0,0,r,a);this.GN(n,f,!1);for(let p=0;p<s;p++){let g=e[p];if(g===n)continue;let y=g.measuredBounds,b=y.width,v=y.height,w=g.alignment;w.isDefault()&&(w=t.defaultAlignment),w.isSpot()||(w=T.Center);let k=g.alignmentFocus;k.isDefault()&&(k=T.Center);let S=null;if(g instanceof G&&g.fo!==""&&(S=g.findObject(g.fo),S===g&&(S=null)),S!==null){let N=S.actualBounds,D=P.z(N.x+(k.x*N.width-k.offsetX),N.y+(k.y*N.height-k.offsetY));for(S=S.panel;S!==null&&S!==g;)S.v.gt(D),S=S.panel;c=w.x*f.width+w.offsetX-D.x,d=w.y*f.height+w.offsetY-D.y,P.i(D)}else c=w.x*f.width+w.offsetX-(k.x*b+k.offsetX),d=w.y*f.height+w.offsetY-(k.y*v+k.offsetY);c+=f.x-i.x,d+=f.y-i.y,g.visible&&g.Ut(l+c,u+d,b,v)}I.i(f)}GN(t,e,i){let s=null;if(t instanceof G&&t.fo!==""&&(s=t.findObject(t.fo),s===t&&(s=null)),s!==null)for(i&&t.Ut(0,0,e.width,e.height),e.h(s.actualBounds),s=s.panel;s!==null&&s!==t;)s.v.sm(e),s=s.panel}}Lt.An("Spot",new Mi);class zn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length;if(a===0)return;let h=t.findMainElement(),l=h.margin,u=e,c=i,d=l.right+l.left,f=l.top+l.bottom;h.ht(e,i,o,r);let p=h.measuredBounds,g=0,y=null;h instanceof et&&(y=h,g=y.strokeWidth*y.scale);let b=Math.max(p.width+d,0),v=Math.max(p.height+f,0),w=t.YN(h),k=w.x*b+w.offsetX,S=w.y*v+w.offsetY,N=t.KN(h),D=N.x*b+N.offsetX,L=N.y*v+N.offsetY;isFinite(e)&&(u=Math.max(Math.abs(k-D)-g,0)),isFinite(i)&&(c=Math.max(Math.abs(S-L)-g,0));let M=0,A=0;o>0&&(M=Math.max(Math.abs(w.x*o+w.offsetX-(N.x*o+N.offsetX))-g,0)),r>0&&(A=Math.max(Math.abs(w.y*r+w.offsetY-(N.y*r+N.offsetY))-g,0));let F=st.l();F.e(0,0);let O=t.Jo();for(let z=0;z<a;z++){let U=s[z];if(U===h||!U.visible&&U!==O)continue;l=U.margin;let tt=l.right+l.left,nt=l.top+l.bottom;U.ht(u,c,M,A),p=U.measuredBounds,b=Math.max(p.width+tt,0),v=Math.max(p.height+nt,0),F.e(Math.max(b,F.width),Math.max(v,F.height))}if(a===1){p=h.measuredBounds,n.width=b,n.height=v,st.i(F);return}w=t.YN(h),N=t.KN(h);let E=0,B=0;N.x!==w.x&&N.y!==w.y&&(E=F.width/Math.abs(N.x-w.x),B=F.height/Math.abs(N.y-w.y)),st.i(F),g=0,y!==null&&(g=y.strokeWidth*y.scale,y.tM()===6&&(E=B=Math.max(E,B))),E+=Math.abs(w.offsetX)+Math.abs(N.offsetX)+g,B+=Math.abs(w.offsetY)+Math.abs(N.offsetY)+g;let K=h.stretch;switch(K===1&&(K=h.Zs(!1)),K){case 0:o=0,r=0;break;case 2:isFinite(e)&&(E=e),isFinite(i)&&(B=i);break;case 5:isFinite(e)&&(E=e),r=0;break;case 4:o=0,isFinite(i)&&(B=i);break}h.bf(),h.ht(E,B,o,r),n.width=h.measuredBounds.width+d,n.height=h.measuredBounds.height+f}arrange(t,e,i){let s=e.length;if(s===0)return;let n=t.findMainElement(),o=n.measuredBounds,r=I.l();r.e(0,0,1,1);let a=n.margin,h=a.left,l=a.top,u=t.padding,c=u.left,d=u.top,f=h,p=l,g=o.width,y=o.height;n.Ut(c+f,d+p,g,y);let b=t.YN(n),v=t.KN(n),w=0+b.x*o.width+b.offsetX,k=0+b.y*o.height+b.offsetY,S=0+v.x*o.width+v.offsetX,N=0+v.y*o.height+v.offsetY;r.x=w,r.y=k,r.re(S,N,0,0),r.x+=h+c,r.y+=l+d;for(let D=0;D<s;D++){let L=e[D];if(L===n)continue;let M=L.measuredBounds;a=L.margin;let A=Math.max(M.width+a.right+a.left,0),F=Math.max(M.height+a.top+a.bottom,0),O=L.alignment;O.isDefault()&&(O=t.defaultAlignment),O.isSpot()||(O=T.Center),f=r.width*O.x+O.offsetX-A*O.x+a.left+r.x,p=r.height*O.y+O.offsetY-F*O.y+a.top+r.y,g=r.width,y=r.height,L.visible&&(I.contains(r.x,r.y,r.width,r.height,f,p,M.width,M.height)?L.Ut(f,p,M.width,M.height):L.Ut(f,p,M.width,M.height,new I(r.x,r.y,r.width,r.height)))}I.i(r)}}Lt.An("Auto",new zn);class Kn extends Lt{constructor(){super(),this.name="Table"}measure(t,e,i,s,n,o,r){let a=s.length,h=m.nt(),l=m.nt();for(let ot=0;ot<a;ot++){let W=s[ot],ft=W instanceof G?W:null;if(ft!==null&&ft.nl()&&W.visible){l.push(ft);let At=ft.D.r,Ht=At.length;for(let Ut=0;Ut<Ht;Ut++){let Gt=At[Ut];ft.type===G.TableRow?Gt.row=W.row:ft.type===G.TableColumn&&(Gt.column=W.column),h.push(Gt)}}else h.push(W)}a=h.length,a===0&&(t.getRowDefinition(0),t.getColumnDefinition(0));let u=[];for(let ot=0;ot<a;ot++){let W=h[ot];W.visible&&(W.xi(!0),W.lo(!0),u[W.row]||(u[W.row]=[]),u[W.row][W.column]||(u[W.row][W.column]=[]),u[W.row][W.column].push(W))}m.Z(h);let c=m.nt(),d=m.nt(),f=m.nt(),p={count:0},g={count:0},y=e,b=i,v=t.Zi,w=t.Qi,k;a=v.length;for(let ot=0;ot<a;ot++)k=v[ot],k!==void 0&&(k.actual=0,k.Re=0);a=w.length;for(let ot=0;ot<a;ot++)k=w[ot],k!==void 0&&(k.actual=0,k.Re=0);let S=u.length,N=0;for(let ot=0;ot<S;ot++)u[ot]&&(N=Math.max(N,u[ot].length));let D=Math.min(t.topIndex,S-1),L=Math.min(t.leftIndex,N-1),M=0,A;S=u.length;let F=t.Jo();for(let ot=0;ot<S;ot++){if(!u[ot])continue;N=u[ot].length;let W=t.getRowDefinition(ot);W.actual=0,W.Re=0;for(let ft=0;ft<N;ft++){if(!u[ot][ft])continue;let At=t.getColumnDefinition(ft);c[ft]===void 0&&(At.actual=0,At.Re=0,c[ft]=!0);let Ht=u[ot][ft],Ut=Ht.length;for(let Gt=0;Gt<Ut;Gt++){let qt=Ht[Gt];if(!qt.visible&&qt!==F)continue;let we=qt.rowSpan>1,ue=qt.columnSpan>1;(we||ue)&&!(ot<D)&&!(ft<L)&&d.push(qt);let de=qt.margin,Wt=de.right+de.left,Jt=de.top+de.bottom;A=qt.Qp(W,At,!1);let me=qt.desiredSize,Ft=!isNaN(me.width),Me=!isNaN(me.height);if(A!==0&&!(Ft&&Me)&&!(ot<D)&&!(ft<L)&&(!ue&&p[ft]===void 0&&(A===2||A===5)&&(p[ft]=-1,p.count++),!we&&g[ot]===void 0&&(A===2||A===4)&&(g[ot]=-1,g.count++),!we&&!ue&&f.push(qt)),qt.ht(1/0,1/0,0,0),ot<D||ft<L)continue;let se=qt.measuredBounds,ve=Math.max(se.width+Wt,0),Te=Math.max(se.height+Jt,0);if(qt.rowSpan===1&&(A===0||A===5)){k=t.getRowDefinition(ot);let ke=k.computeEffectiveSpacing(),mi=k.q===0;M=Math.max(Te-k.actual,0),M+(mi?ke:0)>b&&(M=Math.max(b-ke,0)),k.Re=k.Re+M,k.actual=k.q+M,b=Math.max(b-(M+(mi?ke:0)),0)}if(qt.columnSpan===1&&(A===0||A===4)){k=t.getColumnDefinition(ft);let ke=k.computeEffectiveSpacing(),mi=k.q===0;M=Math.max(ve-k.actual,0),M+(mi?ke:0)>y&&(M=Math.max(y-ke,0)),k.Re=k.Re+M,k.actual=k.q+M,y=Math.max(y-(M+(mi?ke:0)),0)}(we||ue)&&qt.bf()}}}m.Z(c);let O=0,E=0;a=t.columnCount;for(let ot=0;ot<a;ot++){let W=w[ot];W!==void 0&&(O+=isNaN(W.ki)?W.Re:W.ki,W.Re!==0&&(O+=W.computeEffectiveSpacing()))}a=t.rowCount;for(let ot=0;ot<a;ot++){let W=v[ot];W!==void 0&&(E+=isNaN(W.ki)?W.Re:W.ki,W.Re!==0&&(E+=W.computeEffectiveSpacing()))}y=Math.max(e-O,0),b=Math.max(i-E,0);let B=b,K=y;a=f.length;for(let ot=0;ot<a;ot++){let W=f[ot],ft=t.getRowDefinition(W.row),At=t.getColumnDefinition(W.column),Ht=W.measuredBounds,Ut=W.margin,Gt=Ut.right+Ut.left,qt=Ut.top+Ut.bottom;At.Re===0&&p[W.column]!==void 0?p[W.column]=Math.max(Ht.width+Gt,p[W.column]):p[W.column]=null,ft.Re===0&&g[W.row]!==void 0?g[W.row]=Math.max(Ht.height+qt,g[W.row]):g[W.row]=null}let z=0,U=0,tt;for(tt in g)tt!=="count"&&(z+=g[tt]);for(tt in p)tt!=="count"&&(U+=p[tt]);let nt=st.l();for(let ot=0;ot<a;ot++){let W=f[ot];if(!W.visible&&W!==F)continue;let ft=t.getRowDefinition(W.row),At=t.getColumnDefinition(W.column),Ht=0;isFinite(At.width)?Ht=At.width:(isFinite(y)&&p[W.column]!==null?U===0?Ht=At.actual+y:Ht=p[W.column]/U*K:p[W.column]!==null?Ht=y:Ht=At.actual||y,Ht=Math.max(0,Ht-At.computeEffectiveSpacing()));let Ut=0;switch(isFinite(ft.height)?Ut=ft.height:(isFinite(b)&&g[W.row]!==null?z===0?Ut=ft.actual+b:Ut=g[W.row]/z*B:g[W.row]!==null?Ut=b:Ut=ft.actual||b,Ut=Math.max(0,Ut-ft.computeEffectiveSpacing())),nt.e(Math.max(At.minimum,Math.min(Ht,At.maximum)),Math.max(ft.minimum,Math.min(Ut,ft.maximum))),A=W.Qp(ft,At,!1),A){case 5:nt.height=Math.max(nt.height,ft.actual+b);break;case 4:nt.width=Math.max(nt.width,At.actual+y);break}let Gt=W.margin,qt=Gt.right+Gt.left,we=Gt.top+Gt.bottom;W.bf();let ue=At.minimum,de=ft.minimum,Wt=W.measuredBounds;Wt.width===0&&p[W.column]!==null&&(ue=Math.max(ue,p[W.column])),Wt.height===0&&g[W.row]!==null&&(de=Math.max(ue,g[W.row])),W.ht(nt.width,nt.height,ue,de);let Jt=W.measuredBounds,me=Math.max(Jt.width+qt,0),Ft=Math.max(Jt.height+we,0);isFinite(y)&&(me=Math.min(me,nt.width)),isFinite(b)&&(Ft=Math.min(Ft,nt.height));let Me=0;Me=ft.actual,ft.actual=Math.max(ft.actual,Ft),ft.Re=Math.max(ft.Re,Ft),M=ft.actual-Me,b=Math.max(b-M,0),g[W.row]===null&&(B=Math.max(B-M,0)),Me=At.actual,At.actual=Math.max(At.actual,me),At.Re=Math.max(At.Re,me),M=At.actual-Me,y=Math.max(y-M,0),p[W.column]===null&&(K=Math.max(K-M,0))}m.Z(f);let Z=st.l(),it=m.nt(),_=m.nt();if(a=d.length,a!==0)for(let ot=0;ot<S;ot++){if(!u[ot])continue;N=u[ot].length;let W=t.getRowDefinition(ot);it[ot]=W.actual;for(let ft=0;ft<N;ft++){if(!u[ot][ft])continue;let At=t.getColumnDefinition(ft);_[ft]=At.actual}}for(let ot=0;ot<a;ot++){let W=d[ot];if(!W.visible&&W!==F)continue;let ft=t.getRowDefinition(W.row),At=t.getColumnDefinition(W.column);switch(nt.e(Math.max(At.minimum,Math.min(e,At.maximum)),Math.max(ft.minimum,Math.min(i,ft.maximum))),A=W.Qp(ft,At,!1),A){case 2:_[At.index]!==0&&(nt.width=Math.min(nt.width,_[At.index])),it[ft.index]!==0&&(nt.height=Math.min(nt.height,it[ft.index]));break;case 5:_[At.index]!==0&&(nt.width=Math.min(nt.width,_[At.index]));break;case 4:it[ft.index]!==0&&(nt.height=Math.min(nt.height,it[ft.index]));break}isFinite(At.width)&&(nt.width=At.width),isFinite(ft.height)&&(nt.height=ft.height),Z.e(0,0);let Ht=At.minimum,Ut=ft.minimum;for(let Ft=1;Ft<W.rowSpan&&!(W.row+Ft>=t.rowCount);Ft++){if(k=t.getRowDefinition(W.row+Ft),M=0,A===2||A===4){if(k.q===0)continue;M=Math.max(k.minimum,k.q===0?k.maximum:Math.min(k.q,k.maximum))}else M=Math.max(k.minimum,isNaN(k.ki)?k.maximum:Math.min(k.ki,k.maximum));Z.height+=M,Ut+=k.minimum}for(let Ft=1;Ft<W.columnSpan&&!(W.column+Ft>=t.columnCount);Ft++){if(k=t.getColumnDefinition(W.column+Ft),M=0,A===2||A===5){if(k.q===0)continue;M=Math.max(k.minimum,k.q===0?k.maximum:Math.min(k.q,k.maximum))}else M=Math.max(k.minimum,isNaN(k.ki)?k.maximum:Math.min(k.ki,k.maximum));Z.width+=M,Ht+=k.minimum}nt.width+=Z.width,nt.height+=Z.height;let Gt=W.margin,qt=Gt.right+Gt.left,we=Gt.top+Gt.bottom;W.ht(nt.width,nt.height,Ht,Ut);let ue=W.measuredBounds,de=Math.max(ue.width+qt,0),Wt=Math.max(ue.height+we,0),Jt=0;for(let Ft=0;Ft<W.rowSpan&&!(W.row+Ft>=t.rowCount);Ft++)k=t.getRowDefinition(W.row+Ft),Jt+=k.total||0;if(Jt<Wt){let Ft=Wt-Jt,Me=Wt-Jt;if(W.spanAllocation!==null){let se=W.spanAllocation;for(let ve=0;ve<W.rowSpan&&!(Ft<=0||W.row+ve>=t.rowCount);ve++){k=t.getRowDefinition(W.row+ve);let Te=k.q||0,ke=se(W,k,Me);k.actual=Math.min(k.maximum,Te+ke),k.q!==Te&&(Ft-=k.q-Te)}}for(;Ft>0&&k!==void 0;){let se=k.q||0;if(isNaN(k.height)&&k.maximum>se&&(k.actual=Math.min(k.maximum,se+Ft),k.q!==se&&(Ft-=k.q-se)),k.index===0)break;k=t.getRowDefinition(k.index-1)}}let me=0;for(let Ft=0;Ft<W.columnSpan&&!(W.column+Ft>=t.columnCount);Ft++)k=t.getColumnDefinition(W.column+Ft),me+=k.total||0;if(me<de){let Ft=de-me,Me=de-me;if(W.spanAllocation!==null){let se=W.spanAllocation;for(let ve=0;ve<W.columnSpan&&!(Ft<=0||W.column+ve>=t.columnCount);ve++){k=t.getColumnDefinition(W.column+ve);let Te=k.q||0,ke=se(W,k,Me);k.actual=Math.min(k.maximum,Te+ke),k.q!==Te&&(Ft-=k.q-Te)}}for(;Ft>0&&k!==void 0;){let se=k.q||0;if(isNaN(k.width)&&k.maximum>se&&(k.actual=Math.min(k.maximum,se+Ft),k.q!==se&&(Ft-=k.q-se)),k.index===0)break;k=t.getColumnDefinition(k.index-1)}}}m.Z(d),st.i(Z),st.i(nt),it!==void 0&&m.Z(it),_!==void 0&&m.Z(_);let at=0,ct=0,yt=t.desiredSize,Ct=t.maxSize;A=t.Zs(!0),O=0,E=0;let Q=0,St=0;a=t.columnCount;for(let ot=0;ot<a;ot++)if(w[ot]!==void 0){if(k=t.getColumnDefinition(ot),isFinite(k.width)){Q+=k.width,Q+=k.computeEffectiveSpacing();continue}else if(k.j1()===2){Q+=k.q,Q+=k.computeEffectiveSpacing();continue}k.q!==0&&(O+=k.q,O+=k.computeEffectiveSpacing())}isFinite(yt.width)?at=Math.min(yt.width,Ct.width):A!==0&&isFinite(e)?at=e:at=O,at=Math.max(at,isFinite(e)?Math.min(o,e):o),at=Math.max(at-Q,0);let xt=O===0?1:Math.max(at/O,1);for(let ot=0;ot<a;ot++)w[ot]!==void 0&&(k=t.getColumnDefinition(ot),!isFinite(k.width)&&k.j1()!==2&&(k.actual=k.q*xt),k.position=n.width,k.q!==0&&(n.width+=k.q,n.width+=k.computeEffectiveSpacing()));a=t.rowCount;for(let ot=0;ot<a;ot++)if(v[ot]!==void 0){if(k=t.getRowDefinition(ot),isFinite(k.height)){St+=k.height,St+=k.computeEffectiveSpacing();continue}else if(k.j1()===2){St+=k.q,St+=k.computeEffectiveSpacing();continue}k.q!==0&&(E+=k.q,E+=k.computeEffectiveSpacing())}isFinite(yt.height)?ct=Math.min(yt.height,Ct.height):A!==0&&isFinite(i)?ct=i:ct=E,ct=Math.max(ct,isFinite(i)?Math.min(r,i):r),ct=Math.max(ct-St,0);let Yt=E===0?1:Math.max(ct/E,1);for(let ot=0;ot<a;ot++)v[ot]!==void 0&&(k=t.getRowDefinition(ot),!isFinite(k.height)&&k.j1()!==2&&(k.actual=k.q*Yt),k.position=n.height,k.q!==0&&(n.height+=k.q,n.height+=k.computeEffectiveSpacing()));a=l.length;for(let ot=0;ot<a;ot++){let W=l[ot],ft=0,At=0;W.type===G.TableRow?(ft=n.width,k=t.getRowDefinition(W.row),At=k.actual):(k=t.getColumnDefinition(W.column),ft=k.actual,At=n.height),W.measuredBounds.e(0,0,ft,At),W.xi(!1)}m.Z(l),t.Aa=u}arrange(t,e,i){let s=e.length,n=t.padding,o=n.left,r=n.top,a=t.Aa;if(a===null)return;let h=0,l=0,u=a.length,c=0;for(let L=0;L<u;L++)a[L]&&(c=Math.max(c,a[L].length));let d=t.Zi,f=t.Qi,p=0,g=0,y=Math.min(t.topIndex,u-1);if(d.length>0){for(;y!==u&&(d[y]===void 0||d[y].q===0);)y++;y=Math.max(Math.min(y,u-1),0),p=-d[y].position}let b=Math.min(t.leftIndex,c-1);if(f.length>0){for(;b!==c&&(f[b]===void 0||f[b].q===0);)b++;b=Math.max(Math.min(b,c-1),0),g=-f[b].position}let v=0,w=0;for(;v!==u&&d[v]===void 0;)v++;for(;w!==u&&f[w]===void 0;)w++;let k=t.part,S=t.getRowDefinition(v),N=t.getColumnDefinition(w);for(let L=0;L<e.length;L++){let M=e[L];if(!(M instanceof G&&M.visible&&M.nl()))continue;M.type===G.TableRow?(S=t.getRowDefinition(M.row),N=t.getColumnDefinition(w)):(S=t.getRowDefinition(v),N=t.getColumnDefinition(M.column)),l=S.position+p+r,S.q!==0&&(l+=S.computeEffectiveSpacingTop(Math.max(v,y))),h=N.position+g+o,N.q!==0&&(h+=N.computeEffectiveSpacingTop(Math.max(w,b)));let A=M.measuredBounds;M.pf(),M.actualBounds.ce();let F=M.actualBounds,O=I.z(F.x,F.y,F.width,F.height);if(F.x=M.type===G.TableRow?o:h,F.y=M.type===G.TableColumn?r:l,F.width=A.width,F.height=A.height,M.actualBounds.k(),M.lo(!1),O.equalsApproxClose(F)){I.i(O);continue}k!==null&&(k.Sa(),M.Wp(k)),I.i(O)}let D=st.l();for(let L=0;L<u;L++){if(!a[L])continue;c=a[L].length;let M=t.getRowDefinition(L);l=M.position+p+r,M.q!==0&&(l+=M.computeEffectiveSpacingTop(Math.max(v,y)));for(let A=0;A<c;A++){if(!a[L][A])continue;let F=t.getColumnDefinition(A);h=F.position+g+o,F.q!==0&&(h+=F.computeEffectiveSpacingTop(Math.max(w,b)));let O=a[L][A],E=O.length;for(let B=0;B<E;B++){let K=O[B],z=K.measuredBounds;D.e(0,0);for(let Wt=1;Wt<K.rowSpan&&!(L+Wt>=t.rowCount);Wt++){let Jt=t.getRowDefinition(L+Wt);Jt.q!==0&&(D.height+=Jt.total)}for(let Wt=1;Wt<K.columnSpan&&!(A+Wt>=t.columnCount);Wt++){let Jt=t.getColumnDefinition(A+Wt);Jt.q!==0&&(D.width+=Jt.total)}let U=F.q+D.width,tt=M.q+D.height,nt=h,Z=l,it=U,_=tt,at=h,ct=l,yt=U,Ct=tt;h+U>i.width&&(yt=Math.max(i.width-h,0)),l+tt>i.height&&(Ct=Math.max(i.height-l,0));let Q=K.alignment,St=0,xt=0,Yt=0,ot=0;if(Q.isDefault()){Q=t.defaultAlignment,Q.isSpot()||(Q=T.Center),St=Q.x,xt=Q.y,Yt=Q.offsetX,ot=Q.offsetY;let Wt=F.alignment,Jt=M.alignment;Wt.isSpot()&&(St=Wt.x,Yt=Wt.offsetX),Jt.isSpot()&&(xt=Jt.y,ot=Jt.offsetY)}else St=Q.x,xt=Q.y,Yt=Q.offsetX,ot=Q.offsetY;(isNaN(St)||isNaN(xt))&&(St=.5,xt=.5,Yt=0,ot=0);let W=z.width,ft=z.height,At=K.margin,Ht=At.left+At.right,Ut=At.top+At.bottom,Gt=K.Qp(M,F,!1);isNaN(K.desiredSize.width)&&(Gt===2||Gt===5)&&(W=Math.max(U-Ht,0)),isNaN(K.desiredSize.height)&&(Gt===2||Gt===4)&&(ft=Math.max(tt-Ut,0));let qt=K.maxSize,we=K.minSize;W=Math.min(qt.width,W),ft=Math.min(qt.height,ft),W=Math.max(we.width,W),ft=Math.max(we.height,ft);let ue=W+Ht,de=ft+Ut;nt+=it*St-ue*St+Yt+At.left,Z+=_*xt-de*xt+ot+At.top,K.visible&&(I.contains(at,ct,yt,Ct,nt,Z,z.width,z.height)?K.Ut(nt,Z,W,ft):K.Ut(nt,Z,W,ft,new I(at,ct,yt,Ct)))}}}st.i(D);for(let L=0;L<s;L++){let M=e[L],A=M instanceof G?M:null;if(A!==null&&A.nl()){let F=M.actualBounds;M.naturalBounds.ce(),M.naturalBounds.e(0,0,F.width,F.height),M.naturalBounds.k()}}}}Lt.An("Table",new Kn);class Xn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){}arrange(t,e,i){}}Lt.An("TableRow",new Xn);class Yn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){}arrange(t,e,i){}}Lt.An("TableColumn",new Yn);class Un extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){s.length!==1&&m.o("Viewbox Panel must contain exactly one GraphObject.");let a=s[0];a.it=1,a.bf(),a.ht(1/0,1/0,o,r);let h=a.measuredBounds,l=a.margin,u=l.right+l.left,c=l.top+l.bottom;if(isFinite(e)||isFinite(i)){let d=a.scale,f=h.width,p=h.height,g=Math.max(e-u,0),y=Math.max(i-c,0),b=1;t.viewboxStretch===6?(f!==0&&p!==0&&(b=Math.min(g/f,y/p)),b===0&&(b=1e-4),a.it*=b):(f!==0&&p!==0&&(b=Math.max(g/f,y/p)),b===0&&(b=1e-4),a.it*=b),d!==a.scale&&(a.xi(!0),a.ht(1/0,1/0,o,r))}h=a.measuredBounds,n.width=isFinite(e)?e:Math.max(h.width+u,0),n.height=isFinite(i)?i:Math.max(h.height+c,0)}arrange(t,e,i){let s=e[0],n=s.measuredBounds,o=s.margin,r=o.right+o.left,a=o.top+o.bottom,h=Math.max(n.width+r,0),l=Math.max(n.height+a,0),u=s.alignment;u.isDefault()&&(u=t.defaultAlignment),u.isSpot()||(u=T.Center),s.Ut(i.width*u.x-h*u.x+u.offsetX,i.height*u.y-l*u.y+u.offsetY,n.width,n.height)}}Lt.An("Viewbox",new Un);class jn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){t.Pe===null&&(t.Pe=new ti),this.RI(t),this.OI(t)}arrange(t,e,i){}Ge(t,e,i){let s=t.naturalBounds;e.save(),e.beginPath(),e.rect(0,0,s.width,s.height),e.clip(),e.endPath(),this.II(t,e,i),e.restore(),e.clearContextCache(!1)}II(t,e,i){let s=t.getDocumentScale()*i.scale;s<=0&&(s=1);let n=t.gridCellSize,o=n.width,r=n.height,a=t.naturalBounds,h=t.actualBounds,l=a.width,u=a.height,c=Math.ceil(l/o),d=Math.ceil(u/r),f=t.gridOrigin,p=f.x,g=f.y,y=t.Pe.N0,b=t.D.r,v=b.length;for(let w=0;w<v;w++){let k=b[w];if(!k.visible)continue;let S=k.interval||1,N=Math.abs(S);if(o*N*s<2)continue;let D=k.segmentIndex;(!isFinite(D)||isNaN(D))&&(D=0),D<0&&(D=N-Math.min(-D,N)),D=Math.round(D%N);let L=k.opacity,M=1;if(L!==1){if(L===0)continue;M=e.globalAlpha,e.globalAlpha=M*L}let A=y[w],F=!1,O=k.strokeDashArray;if(O!==null&&(F=!0,e.enableDash(O,k.strokeDashOffset)),k.stroke!==null&&k.strokeWidth>0&&(k.figure==="LineV"||k.figure==="LineH")){if(e.lineWidth=k.strokeWidth,t.bn(e,k.stroke,!1,!1,a,h),e.beginPath(),k.figure==="LineV"){let E=Math.floor((p-o)/o);for(let B=E;B<=E+c;B++){let K=B*o+p;0<=K&&K<=l&&this.W1(B,S,D,A)&&(e.moveTo(K,0),e.lineTo(K,u))}}else if(k.figure==="LineH"){let E=Math.floor((g-r)/r);for(let B=E;B<=E+d;B++){let K=B*r+g;0<=K&&K<=u&&this.W1(B,S,D,A)&&(e.moveTo(0,K),e.lineTo(l,K))}}e.stroke(),e.endPath()}else if(k.fill!==null){if(t.bn(e,k.fill,!0,!1,a,h),k.figure==="BarV"){let E=k.width;isNaN(E)&&(E=o);let B=Math.floor((p-o)/o);for(let K=B;K<=B+c;K++){let z=K*o+p;0<=z+E&&z<=l&&this.W1(K,S,D,A)&&e.fillRect(z,0,E,u)}}else if(k.figure==="BarH"){let E=k.height;isNaN(E)&&(E=r);let B=Math.floor((g-r)/r);for(let K=B;K<=B+d;K++){let z=K*r+g;0<=z+E&&z<=u&&this.W1(K,S,D,A)&&e.fillRect(0,z,l,E)}}}F&&e.disableDash(),L!==1&&(e.globalAlpha=M)}}W1(t,e,i,s){if(e<0)return t%e===i;if(t%e!==i)return!1;let n=s.length;for(let o=0;o<n;o++){let r=s[o];if(t%r===i)return!1}return!0}OI(t){let e=[],i=t.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n],r=[];if(e.push(r),!o.visible)continue;let a=o.interval;if(a<0)continue;let h=o.figure,l=this.HN(h);for(let u=0;u<s;u++){if(u===n)continue;let c=i[u];if(!c.visible)continue;let d=c.figure;if(this.HN(d)!==l)continue;let f=c.interval;f>a&&r.push(f)}}t.Pe.N0=e}HN(t){return t==="LineV"||t==="BarV"}RI(t){let e=1,i=1,s=t.D.r,n=s.length;for(let a=0;a<n;a++){let h=s[a],l=Math.abs(h.interval);l<2||(this.HN(h.figure)?i=i*l/C.jL(i,l):e=e*l/C.jL(e,l))}let o=t.gridCellSize,r=t.Pe;r.lf.isReal()?r.lf.e(i*o.width,e*o.height):r.lf=new st(i*o.width,e*o.height)}}Lt.An("Grid",new jn);class Gn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=s.length;if(!(t instanceof vt||t instanceof j))return;let h=null,l=null;if(t instanceof j&&(h=t),t instanceof vt&&(l=t,h=l.adornedPart,t.Lf===null&&(t.Lf=[])),!(h instanceof j))return;let u=h;if(a===0){t.naturalBounds.Hn(0,0),t.measuredBounds.e(0,0,0,0);return}let c=t instanceof vt?null:h.path,d=h.routeBounds,f=t.$o;f.e(0,0,d.width,d.height);let p=u.points,g=h.pointsCount;l!==null?l.Td(!1):h!==null&&h.Td(!1);let y=d.width,b=d.height,v=t.Lf;if(v.length=0,c!==null){this.measureLinkPath(t,y,b,c);let N=c.measuredBounds;f.unionRect(N),v.push(N)}let w=Nt.l(),k=P.l(),S=P.l();for(let N=0;N<a;N++){let D=s[N];if(D===c)continue;let L=D.measuredBounds;if(D.isPanelMain&&D instanceof et){this.measureLinkPath(t,y,b,D),L=D.measuredBounds,f.unionRect(L),v.push(L);continue}if(g<2){D.ht(1/0,1/0,0,0),L=D.measuredBounds,f.unionRect(L),v.push(L);continue}let M=D.segmentIndex,A=D.segmentFraction,F=D.alignmentFocus;F.isNoSpot()&&(F=T.Center);let O=D.segmentOrientation,E=D.segmentOffset,B=0,K=0,z=0,U=0;if(isNaN(M)){let Q=u.ut,St=m.nt();Q.getPointAndAngleAlongPath(A,St);let xt=P.z(St[0],St[1]);U=St[2],O!==0&&(z=u.computeAngle(D,O,U),D.Xt=z,D.xi(!0),D.lo(!0)),B=xt.x,K=xt.y,P.i(xt),m.Z(St)}else if(M<-g||M>=g){let Q=P.l();u.qN(Q),U=u.midAngle,O!==0&&(z=u.computeAngle(D,O,U),D.Xt=z,D.xi(!0),D.lo(!0)),B=Q.x-d.x,K=Q.y-d.y,P.i(Q)}else{let Q,St,xt=0;if(M>=0?(Q=p.elt(M),St=M<g-1?p.elt(M+1):Q):(xt=g+M,Q=p.elt(xt),St=xt>0?p.elt(xt-1):Q),Q.equalsApprox(St)){let Yt,ot;M>=0?(Yt=M>0?p.elt(M-1):Q,ot=M<g-2?p.elt(M+2):St):(Yt=xt<g-1?p.elt(xt+1):Q,ot=xt>1?p.elt(xt-2):St);let W=Yt.distanceSquaredPoint(Q),ft=St.distanceSquaredPoint(ot);W>ft+10?U=M>=0?Yt.directionPoint(Q):Q.directionPoint(Yt):ft>W+10?U=M>=0?St.directionPoint(ot):ot.directionPoint(St):U=M>=0?Yt.directionPoint(ot):ot.directionPoint(Yt)}else U=M>=0?Q.directionPoint(St):St.directionPoint(Q);O!==0&&(z=u.computeAngle(D,O,U),D.Xt=z,D.xi(!0),D.lo(!0)),B=Q.x+(St.x-Q.x)*A-d.x,K=Q.y+(St.y-Q.y)*A-d.y}D.ht(1/0,1/0,0,0),L=D.measuredBounds;let tt=D.naturalBounds,nt=0;D instanceof et&&(nt=D.strokeWidth);let Z=tt.width+nt,it=tt.height+nt;w.Ue(),w.Xs(-L.x,-L.y),w.it(D.scale,D.scale),w.ks(O===0?D.angle:U,Z/2,it/2),(O===22||O===26)&&w.ks(90,Z/2,it/2),(O===23||O===27)&&w.ks(-90,Z/2,it/2),O===28&&(U>45&&U<135||U>225&&U<315)&&w.ks(-U,Z/2,it/2);let _=new I(0,0,Z,it);k.setRectSpot(_,F),w.gt(k);let at=-k.x+nt/2*D.scale,ct=-k.y+nt/2*D.scale;S.h(E);let yt=isNaN(E.x),Ct=isNaN(E.y);if(yt||Ct){let Q=Z/2+j.J1,St=it/2+j.J1,xt=U>=45&&U<=135,Yt=U>=225&&U<=315;O===0&&(xt||Yt)?(S.x=Ct?Q:E.y,S.y=yt?St:E.x,xt?M>=0||isNaN(M)&&A<.5||yt&&(S.y=-St):Yt&&((M>=0||isNaN(M)&&A<.5)&&yt&&(S.y=-St),Ct&&(S.x=-Q))):(yt&&(M>=0||isNaN(M)&&A<.5?S.x=Q:S.x=-Q),Ct&&(S.y=-St),S.rotate(U))}else S.rotate(U);B+=S.x,K+=S.y,_.e(B+at,K+ct,L.width,L.height),v.push(_),f.unionRect(_)}if(h!==null){let N=h.labelNodes;for(;N.next();)N.value.ht(1/0,1/0)}t.$o=f,t.position.e(d.x+f.x,d.y+f.y),n.Hn(f.width||0,f.height||0),Nt.i(w),P.i(k),P.i(S)}arrange(t,e,i){let s=e.length;if(!(t instanceof vt||t instanceof j))return;let n=t,o=null;t instanceof vt&&(o=t,n=o.adornedPart);let r=t,a=t instanceof vt?null:n.path,h=t.Lf;if(h.length!==0){let d=0;if(a!==null&&d<h.length){let f=h[d];d++,a.Ut(f.x-r.$o.x,f.y-r.$o.y,f.width,f.height)}for(let f=0;f<s;f++){let p=e[f];if(p!==a&&d<h.length){let g=h[d];d++,p.Ut(g.x-r.$o.x,g.y-r.$o.y,g.width,g.height)}}}let l=n.points,u=l.count;if(u>=2&&r instanceof j){let d=r.labelNodes;for(;d.next();){let f=d.value;r.EI(f,u,l)}}o!==null?o.Td(!1):n.Td(!1);let c=t.uD(P.l());t.location.e(t.position.x+c.x,t.position.y+c.y),P.i(c)}measureLinkPath(t,e,i,s){if(s.Xo()===!1)return;let n=s.strokeWidth;if(n===0&&t instanceof vt&&t.type===G.Link&&t.adornedObject instanceof et&&(n=t.adornedObject.strokeWidth),n=n*s.it,t instanceof j&&t.ut!==null){let o=t.geometry.bounds;s.ro(o.x-n/2,o.y-n/2,o.width+n,o.height+n)}else if(t instanceof vt&&t.adornedPart.ut!==null){let o=t.adornedPart.ut.bounds;s.ro(o.x-n/2,o.y-n/2,o.width+n,o.height+n)}else s.ro(-(n/2),-(n/2),e+n,i+n);s.UI(),s.xi(!1)}}Lt.An("Link",new Gn);class qn extends Lt{constructor(){super()}measure(t,e,i,s,n,o,r){let a=t.findMainElement();if(!(a instanceof et))return;t._i=[];let h=a.margin,l=h.right+h.left,u=h.top+h.bottom;a.ht(e,i,o,r);let c=a.measuredBounds,d=c.width,f=c.height,p=Math.max(d+l,0),g=Math.max(f+u,0),y=new I(-h.left,-h.top,p,g);t._i.push(y),n.h(y),this.determineGraduatedMarks(t,a);let b=t.vs;if(b===null)return;let v=s.length;for(let w=0;w<v;w++){let k=s[w],S=b[w];!k.visible||k===a||S.length===0||(k instanceof et?this.measureGraduatedTicks(t,k,S,n):k instanceof lt&&this.measureGraduatedLabels(t,k,S,n),k.xi(!1))}}arrange(t,e,i){if(t._i===null)return;let s=t.findMainElement(),n=t.vs;if(n===null)return;let o=t._i,r=0,a=o[r];r++,s!==null&&s.Ut(a.x-i.x,a.y-i.y,a.width,a.height);let h=e.length;for(let l=0;l<h;l++){let u=e[l],c=n[l];!u.visible||u===s||c.length===0||(a=o[r],r++,u.Ut(a.x-i.x,a.y-i.y,a.width,a.height))}t._i=null}measureGraduatedTicks(t,e,i,s){let n=e.alignmentFocus;n.isNoSpot()&&(n=T.TopCenter);let o=e.angle;e.Xt=0,e.ht(1/0,1/0,0,0),e.Xt=o;let r=e.measuredBounds,a=r.width,h=r.height,l=I.z(0,0,a,h),u=P.l();u.setRectSpot(l,n),I.i(l);let c=-u.x,d=-u.y,f=new I,p=i.length;for(let g=0;g<p;g++){let y=i[g],b=y.pt.x,v=y.pt.y,w=y.angle;for(let k=0;k<4;k++){switch(k){case 0:u.e(c,d);break;case 1:u.e(c+a,d);break;case 2:u.e(c,d+h);break;case 3:u.e(c+a,d+h);break}u.rotate(w+e.angle),u.offset(b,v),g===0&&k===0?f.e(u.x,u.y,0,0):f.unionPoint(u),u.offset(-b,-v),u.rotate(-w-e.angle)}}P.i(u),t._i!==null&&t._i.push(f),s.re(f.x,f.y,f.width,f.height)}measureGraduatedLabels(t,e,i,s){t.vi===null&&(t.vi=new lt);let n=t.vi;this.dD(e,n);let o=e.alignmentFocus;o.isNoSpot()&&(o=T.TopCenter);let r=e.segmentOrientation,a=e.segmentOffset,h=new I,l=0,u=0,c=0,d=0,f=0,p=i.length;for(let g=0;g<p;g++){let y=i[g];l=y.pt.x,u=y.pt.y,c=y.angle,d=e.angle,f=e.angle,r!==0&&(r===21||r===25?f=c+e.angle:f=c,d=j.computeAngle(r,f)),n.Xt=d,n.text=y.text||"",n.ht(1/0,1/0,0,0);let b=n.measuredBounds,v=n.naturalBounds,w=v.width,k=v.height,S=Nt.l();S.Ue(),S.Xs(-b.x,-b.y),S.it(n.scale,n.scale),S.ks(f,w/2,k/2),(r===22||r===26)&&S.ks(90,w/2,k/2),(r===23||r===27)&&S.ks(-90,w/2,k/2),r===28&&(c>45&&c<135||c>225&&c<315)&&S.ks(-c,w/2,k/2);let N=I.z(0,0,w,k),D=P.l();D.setRectSpot(N,o),S.gt(D);let L=-D.x,M=-D.y,A=P.l();A.h(a),isNaN(A.x)&&(A.x=w/2+3),isNaN(A.y)&&(A.y=-(k/2+3)),A.rotate(c),l+=A.x+L,u+=A.y+M;let F=new I(l,u,b.width,b.height),O=new I(b.x,b.y,b.width,b.height),E=new I(v.x,v.y,v.width,v.height);y.labelAngle=d,y.lineCount=n.lineCount,y.lines=n.getMetrics(),y.actualBounds=F,y.measuredBounds=O,y.naturalBounds=E,g===0?h.h(F):h.unionRect(F),P.i(A),P.i(D),I.i(N),Nt.i(S)}t._i!==null&&t._i.push(h),s.re(h.x,h.y,h.width,h.height)}determineGraduatedMarks(t,e){let i=e.geometry,s=e.strokeWidth,n=i.flattenedSegments,o=i.flattenedLengths,r=i.flattenedTotalLength,a=n.length,h=0,l=0,u=m.nt();for(let v=0;v<a;v++){let w=n[v],k=[];h=0,l=0;let S=w.length;for(let N=0;N<S;N+=2){let D=w[N],L=w[N+1];if(N===0){h=D,l=L;continue}let M=Math.atan2(L-l,D-h)*180/Math.PI;M<0&&(M+=360),k.push(M),h=D,l=L}u.push(k)}let c=this.VI(t),d=t.D.r,f=d.length,p=0,g=0,y=r;t.vs=[];let b;for(let v=0;v<f;v++){let w=d[v];if(b=[],!w.visible||w===e){t.vs.push(b);continue}let k=Math.abs(w.interval),S=t.graduatedTickUnit;if(S*k*r/t.graduatedRange<2&&w.graduatedSkip===null){t.vs.push(b);continue}let N=o[0][0],D=0,L=0;g=r*w.graduatedStart-1e-4,y=r*w.graduatedEnd+1e-4;let M=S*k,A=t.graduatedTickBase;if(A<t.graduatedMin){let B=(t.graduatedMin-A)/M;B=B%1===0?B:Math.floor(B+1),A+=B*M}else if(A>t.graduatedMin+M){let B=Math.floor((A-t.graduatedMin)/M);A-=B*M}let F=c[v],O=A,E=t.graduatedMax*1e-6;for(let B=1;A<=t.graduatedMax+E;B++){if(this.BI(t,A-t.graduatedTickBase,F)&&(A>t.graduatedMax&&(A=t.graduatedMax),(w.graduatedSkip===null||w instanceof lt&&!w.graduatedSkip(A,w)||w instanceof et&&!w.graduatedSkip(A,w))&&(p=(A-t.graduatedMin)*r/t.graduatedRange,p>r&&(p=r),g<=p&&p<=y))){let K=u[D][L],z=o[D][L];for(;D<o.length;){for(;p>N&&L<o[D].length-1;)L++,K=u[D][L],z=o[D][L],N+=z;if(p<=N)break;D++,L=0,K=u[D][L],z=o[D][L],N+=z}let U=n[D],tt=U[L*2],nt=U[L*2+1],Z=U[L*2+2],it=U[L*2+3],_=(p-(N-z))/z,at=new P(tt+(Z-tt)*_+s/2-i.bounds.x,nt+(it-nt)*_+s/2-i.bounds.y);if(at.scale(e.scale,e.scale),K=this.zI(K,_,U,u[D],L),w instanceof lt){let ct="";w.graduatedFunction!==null?(ct=w.graduatedFunction(A,w),ct=ct!=null?ct.toString():""):ct=(+A.toFixed(2)).toString(),ct!==""&&b.push({pt:at,angle:K,text:ct})}else b.push({pt:at,angle:K})}A=O+B*M}t.vs.push(b)}m.Z(u)}zI(t,e,i,s,n){if(e<.5005&&e>.4995)return t;let o=t;if(e<.5?n>0?o=s[n-1]:C.X(i[0],i[i.length-2])&&C.X(i[1],i[i.length-1])&&(o=s[s.length-1]):e>.5&&(n+1<s.length?o=s[n+1]:C.X(i[0],i[i.length-2])&&C.X(i[1],i[i.length-1])&&(o=s[0])),t!==o){let r=Math.abs(t-o);if(r>180&&(t<o?t+=360:o+=360,r=Math.abs(t-o)),e<5e-4||e>.9995)return(t+o)/2%360;if(r<10){let a=1-Math.abs(.5-e);return(t*a+o*(1-a))%360}}return t}VI(t){if(t.ds===null){let e=[],i=t.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n],r=[];if(e.push(r),!o.visible)continue;let a=o.interval;if(!(a<0))for(let h=0;h<s;h++){if(h===n)continue;let l=i[h];if(!l.visible||o.constructor!==l.constructor)continue;let u=l.interval;u>a&&r.push(u)}}t.ds=e}return t.ds}BI(t,e,i){let s=i.length;for(let n=0;n<s;n++){let o=i[n]*t.graduatedTickUnit,r=e%o,a=t.graduatedTickUnit*1e-6;if(r<a&&r>-a)return!1}return!0}Ge(t,e,i){let s=i.ph;i.ph=!0;let n=t.naturalBounds,o=n.width,r=n.height,a=e instanceof re;e.save(),e.beginPath(),e.rect(-1,-1,o+1,r+1),e.clip(),e.endPath();let h=t.findMainElement();h.Ge(e,i);let l=t.getDocumentScale()*i.scale;l<=0&&(l=1);let u=h.actualBounds,c=t.D.r,d=t.vs,f=c.length;for(let p=0;p<f;p++){let g=c[p],y=d[p],b=y.length;if(!(!g.visible||g===h||y.length===0)){if(g instanceof et){if(t.graduatedTickUnit*g.interval*h.geometry.flattenedTotalLength/t.graduatedRange*l<2&&g.graduatedSkip===null)continue;let v=g.measuredBounds,w=g.strokeWidth*g.scale,k=g.alignmentFocus;k.isNoSpot()&&(k=T.TopCenter);for(let S=0;S<b;S++){let N=y[S].pt,D=y[S].angle;this.XI(g,N,u,D,v,w,k),g.Ge(e,i),a&&(t.svg.appendChild(g.svg),g.svg=null),g.el.Ue()}}else if(g instanceof lt){t.vi===null&&(t.vi=new lt);let v=t.vi;this.dD(g,v),v.jN=!0;for(let w=0;w<b;w++){let k=y[w];if(k.actualBounds&&k.measuredBounds&&k.naturalBounds){v.GI(k);let S=k.actualBounds;v.Ut(S.x,S.y,S.width,S.height),this.YI(v,u,S,k.measuredBounds,k.naturalBounds),v.sl=g.part,v.$s=g.panel,v.Ge(e,i),v.$s=null,v.sl=null,a&&(t.svg.appendChild(v.svg),v.svg=null)}}}}}i.ph=s,e.restore(),e.clearContextCache(!0)}XI(t,e,i,s,n,o,r){let a=t.el;a.Ue(),a.Xs(e.x+i.x,e.y+i.y),a.ks(s+t.angle,0,0),a.Xs(-n.width*r.x+r.offsetX+o/2,-n.height*r.y+r.offsetY+o/2),a.it(t.scale,t.scale),t.Sd(!1),t.wa.set(t.el),t.Th=t.scale,t.Na(!1)}YI(t,e,i,s,n){let o=t.el;o.Ue(),o.Xs(i.x+e.x,i.y+e.y),o.Xs(-s.x,-s.y),t.Kp(o,n.x,n.y,n.width,n.height),t.Sd(!1),t.wa.set(t.el),t.Th=t.scale,t.Na(!1)}dD(t,e){e.KI(t)}}Lt.An("Graduated",new qn);var Us=(x=>(x[x.Uniform=6]="Uniform",x[x.UniformToFill=7]="UniformToFill",x))(Us||{});class G extends ${W;D;Qt;Dd;Zn;rl;fo;$o;WN;O;vd;ot;Pe;te;Fd;Ta;_s;constructor(t,e){if(super(),t===void 0)this.W=G.Position;else if(typeof t=="string"){let i=Lt.fs.get(t);i!==null?this.W=i:m.o("PanelLayout not loaded: "+t)}else t instanceof Lt?this.W=t:(this.W=G.Position,t&&(e=t));this.n|=4194304|(this.W===G.Grid?1048576:0),this.D=new q,this.Qt=Dt.im,this.Dd=T.Default,this.Zn=1,this.rl=null,this.fo="",this.$o=new I(NaN,NaN,NaN,NaN),this.WN=null,this.O=null,this.vd=6,this.Pe=null,this.ot=null,this.te=null,this.Fd=NaN,this.Ta=null,this._s=null,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.W=this.W,t.Qt=this.Qt.N(),t.Dd=this.Dd.N(),t.Zn=this.Zn,t.fo=this.fo,t.$o.h(this.$o),this.O!==null&&(t.O=this.O.copy(t)),t.vd=this.vd,this.ot!==null&&(t.ot=this.ot.copy()),this.Pe!==null&&(t.Pe=this.Pe.copy()),t.te=this.te,t.Fd=this.Fd,t.Ta=this.Ta}Ho(t){super.Ho(t),t.D=this.D;let e=t.D.r,i=e.length;for(let s=0;s<i;s++){let n=e[s];n.$s=t}t.rl=null}copy(){let t=super.copy(),e=this.D.r,i=e.length;for(let s=0;s<i;s++){let n=e[s].copy();t.HI(n)}return t}toString(){return"Panel("+this.type.name+")#"+V.xs(this)}get type(){return this.W}set type(t){let e=this.W;e!==t&&(this.W=t,this.Af=this.W===G.Grid,this.f(),this.t("type",e,t))}get elements(){return this.D.iterator}get naturalBounds(){return this.Ke}get padding(){return this.Qt}set padding(t){typeof t=="number"?(t<0&&m.J(t,">= 0",G,"padding"),t=new Dt(t)):(t.left<0&&m.J(t.left,">= 0",G,"padding:value.left"),t.right<0&&m.J(t.right,">= 0",G,"padding:value.right"),t.top<0&&m.J(t.top,">= 0",G,"padding:value.top"),t.bottom<0&&m.J(t.bottom,">= 0",G,"padding:value.bottom"));let e=this.Qt;e.equals(t)||(t=t.N(),this.Qt=t,this.f(),this.t("padding",e,t))}get defaultAlignment(){return this.Dd}set defaultAlignment(t){let e=this.Dd;e.equals(t)||(t=t.N(),this.Dd=t,this.f(),this.t("defaultAlignment",e,t))}get defaultStretch(){return this.Zn}set defaultStretch(t){let e=this.Zn;e!==t&&(this.Zn=t,this.f(),this.t("defaultStretch",e,t))}get defaultSeparatorPadding(){return this.O!==null?this.O.C0:Dt.im}set defaultSeparatorPadding(t){typeof t=="number"&&(t=new Dt(t));let e=this.defaultSeparatorPadding;e.equals(t)||(t=t.N(),this.O===null&&(this.O=new ie),this.O.C0=t,this.f(),this.t("defaultSeparatorPadding",e,t))}get defaultRowSeparatorStroke(){return this.O!==null?this.O.L0:null}set defaultRowSeparatorStroke(t){let e=this.defaultRowSeparatorStroke;e!==t&&(t===null||typeof t=="string"||t instanceof R)&&(t instanceof R&&t.k(),this.O===null&&(this.O=new ie),this.O.L0=t,this.C(),this.t("defaultRowSeparatorStroke",e,t))}get defaultRowSeparatorStrokeWidth(){return this.O!==null?this.O.A0:1}set defaultRowSeparatorStrokeWidth(t){let e=this.defaultRowSeparatorStrokeWidth;e!==t&&isFinite(t)&&t>=0&&(this.O===null&&(this.O=new ie),this.O.A0=t,this.f(),this.t("defaultRowSeparatorStrokeWidth",e,t))}get defaultRowSeparatorDashArray(){return this.O!==null?this.O.T0:null}set defaultRowSeparatorDashArray(t){let e=this.defaultRowSeparatorDashArray;if(e!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",G,"defaultRowSeparatorDashArray:value"),t!==null){let i=t.length,s=0;for(let n=0;n<i;n++){let o=t[n];(typeof o!="number"||!(o>=0)||!isFinite(o))&&m.o("defaultRowSeparatorDashArray value "+o+" at index "+n+" must be a positive number or zero."),s+=o}if(s===0){if(e===null)return;t=null}}this.O===null&&(this.O=new ie),this.O.T0=t,this.C(),this.t("defaultRowSeparatorDashArray",e,t)}}get defaultColumnSeparatorStroke(){return this.O!==null?this.O.D0:null}set defaultColumnSeparatorStroke(t){let e=this.defaultColumnSeparatorStroke;e!==t&&(t===null||typeof t=="string"||t instanceof R)&&(t instanceof R&&t.k(),this.O===null&&(this.O=new ie),this.O.D0=t,this.C(),this.t("defaultColumnSeparatorStroke",e,t))}get defaultColumnSeparatorStrokeWidth(){return this.O!==null?this.O.v0:1}set defaultColumnSeparatorStrokeWidth(t){let e=this.defaultColumnSeparatorStrokeWidth;e!==t&&isFinite(t)&&t>=0&&(this.O===null&&(this.O=new ie),this.O.v0=t,this.f(),this.t("defaultColumnSeparatorStrokeWidth",e,t))}get defaultColumnSeparatorDashArray(){return this.O!==null?this.O.F0:null}set defaultColumnSeparatorDashArray(t){let e=this.defaultColumnSeparatorDashArray;if(e!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",G,"defaultColumnSeparatorDashArray:value"),t!==null){let i=t.length,s=0;for(let n=0;n<i;n++){let o=t[n];(typeof o!="number"||!(o>=0)||!isFinite(o))&&m.o("defaultColumnSeparatorDashArray value "+o+" at index "+n+" must be a positive number or zero."),s+=o}if(s===0){if(e===null)return;t=null}}this.O===null&&(this.O=new ie),this.O.F0=t,this.C(),this.t("defaultColumnSeparatorDashArray",e,t)}}get Aa(){return this.O!==null?this.O.Aa:null}set Aa(t){this.O===null&&(this.O=new ie),this.O.Aa=t}get viewboxStretch(){return this.vd}set viewboxStretch(t){let e=this.vd;e!==t&&(this.vd=t,this.f(),this.t("viewboxStretch",e,t))}get gridCellSize(){return this.Pe!==null?this.Pe.Rd:st.EL}set gridCellSize(t){this.Pe===null&&(this.Pe=new ti);let e=this.Pe.Rd;if(!e.equals(t)){(!t.isReal()||t.width===0||t.height===0)&&m.o("Invalid Panel.gridCellSize: "+t),this.Pe.Rd=t.N();let i=this.diagram;i!==null&&this===i.grid&&i.ca(),this.C(),this.t("gridCellSize",e,t)}}get gridOrigin(){return this.Pe!==null?this.Pe.Od:P.dn}set gridOrigin(t){this.Pe===null&&(this.Pe=new ti);let e=this.Pe.Od;if(!e.equals(t)){t.isReal()||m.o("Invalid Panel.gridOrigin: "+t),this.Pe.Od=t.N();let i=this.diagram;i!==null&&this===i.grid&&i.ca(),this.C(),this.t("gridOrigin",e,t)}}get graduatedMin(){return this.ot!==null?this.ot.R0:0}set graduatedMin(t){let e=this.graduatedMin;if(e!==t&&(this.ot===null&&(this.ot=new Pe),this.ot.R0=t,this.f(),this.t("graduatedMin",e,t),this.gf())){let i=this.part;i!==null&&this.Eh(i,"graduatedRange")}}get graduatedMax(){return this.ot!==null?this.ot.O0:100}set graduatedMax(t){let e=this.graduatedMax;if(e!==t&&(this.ot===null&&(this.ot=new Pe),this.ot.O0=t,this.f(),this.t("graduatedMax",e,t),this.gf())){let i=this.part;i!==null&&this.Eh(i,"graduatedRange")}}get graduatedRange(){return this.graduatedMax-this.graduatedMin}get graduatedTickUnit(){return this.ot!==null?this.ot.I0:10}set graduatedTickUnit(t){let e=this.graduatedTickUnit;e!==t&&t>0&&(this.ot===null&&(this.ot=new Pe),this.ot.I0=t,this.f(),this.t("graduatedTickUnit",e,t))}get graduatedTickBase(){return this.ot!==null?this.ot.E0:0}set graduatedTickBase(t){let e=this.graduatedTickBase;e!==t&&(this.ot===null&&(this.ot=new Pe),this.ot.E0=t,this.f(),this.t("graduatedTickBase",e,t))}get vs(){return this.ot!==null?this.ot.vs:null}set vs(t){this.ot!==null?this.ot.vs=t:t!==null&&(this.ot=new Pe,this.ot.vs=t)}get _i(){return this.ot!==null?this.ot._i:null}set _i(t){this.ot!==null?this.ot._i=t:t!==null&&(this.ot=new Pe,this.ot._i=t)}get ds(){return this.ot!==null?this.ot.ds:null}set ds(t){this.ot!==null?this.ot.ds=t:t!==null&&(this.ot=new Pe,this.ot.ds=t)}get vi(){return this.ot!==null?this.ot.vi:null}set vi(t){this.ot!==null?this.ot.vi=t:t!==null&&(this.ot=new Pe,this.ot.vi=t)}Wp(t){super.Wp(t);let e=this.D.r,i=e.length;for(let s=0;s<i;s++)e[s].Wp(t)}Ma(t,e){if(this.W===G.Grid){t.commitTransform(),this.W.Ge(this,t,e);return}if(this.W===G.Graduated){t.commitTransform(),this.W.Ge(this,t,e);return}if(this.W===G.Table)if(t.commitTransform(),t instanceof re){let r=t.currentElement;t.currentElement=t.newGroup2("gojs-ts"),this.JN(t,e),t.endGroup(),t.currentElement=r}else this.JN(t,e);let i=this.isClipping&&this.W===G.Spot;i&&t.save();let s=this.findMainElement(),n=this.D.r,o=n.length;for(let r=0;r<o;r++){let a=n[r];i&&a===s&&(t.clipInsteadOfFill=!0),a.Ge(t,e),i&&a===s&&(t.clipInsteadOfFill=!1)}i&&(t.restore(),t.clearContextCache(!0))}JN(t,e){t.lineCap="butt";let i=this.rowCount>0?this.Zi:null,s=this.columnCount>0?this.Qi:null;i!==null&&this.$1(t,e,!0,i,!0),s!==null&&this.$1(t,e,!1,s,!0),i!==null&&this.gD(t,!0,i),s!==null&&this.gD(t,!1,s),i!==null&&this.$1(t,e,!0,i,!1),s!==null&&this.$1(t,e,!1,s,!1)}gD(t,e,i){let s=i.length,n=this.actualBounds,o=this.naturalBounds,r=!0;for(let a=0;a<s;a++){let h=i[a];if(h===void 0||h.actual===0)continue;if(r){r=!1;continue}if(e){if(h.position>o.height)continue}else if(h.position>o.width)continue;let l=h.separatorStrokeWidth;isNaN(l)&&(l=e?this.defaultRowSeparatorStrokeWidth:this.defaultColumnSeparatorStrokeWidth);let u=h.separatorStroke;if(u===null&&(u=e?this.defaultRowSeparatorStroke:this.defaultColumnSeparatorStroke),l===0||u===null)continue;this.bn(t,u,!1,!1,o,n);let c=!1,d=h.separatorDashArray;d===null&&(d=e?this.defaultRowSeparatorDashArray:this.defaultColumnSeparatorDashArray),d!==null&&(c=!0,t.enableDash(d,0)),t.beginPath();let f=h.position+l;e?f>o.height&&(l-=f-o.height):f>o.width&&(l-=f-o.width);let p=h.position+l/2;t.lineWidth=l;let g=this.Qt;if(e){p+=g.top;let y=g.left,b=o.width-g.right;t.moveTo(y,p),t.lineTo(b,p)}else{p+=g.left;let y=g.top,b=o.height-g.bottom;t.moveTo(p,y),t.lineTo(p,b)}t.stroke(),t.endPath(),c&&t.disableDash()}}$1(t,e,i,s,n){let o=s.length,r=this.actualBounds,a=this.naturalBounds,h=this.mD(!0),l=this.mD(!1);for(let u=0;u<o;u++){let c=s[u];if(c===void 0||c.background===null||c.coversSeparators===n||c.actual===0)continue;let d=i?r.height:r.width;if(c.position>d)continue;let f=c.computeEffectiveSpacing(),p=c.separatorStrokeWidth;isNaN(p)&&(p=i?this.defaultRowSeparatorStrokeWidth:this.defaultColumnSeparatorStrokeWidth);let g=c.separatorStroke;g===null&&(g=i?this.defaultRowSeparatorStroke:this.defaultColumnSeparatorStroke),(g===null||c.index===(i?h:l))&&(p=0),f-=p;let y=c.position+p,b=f+c.actual;if(y+b>d&&(b=d-y),b<=0)continue;let v=this.Qt;this.bn(t,c.background,!0,!1,a,r),i?t.fillRect(v.left,y+v.top,r.width-(v.left+v.right),b):t.fillRect(y+v.left,v.top,b,r.height-(v.top+v.bottom))}}mD(t){let e=t?this.rowCount:this.columnCount;for(let i=0;i<e;i++){let s=t?this.Zi[i]:this.Qi[i];if(s!==void 0)return s.index}return 0}wf(){let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].wf();this.Ji(!0)}yf(t,e,i){let s=this.svg;if(s===null)return!1;if(this.type===G.Table){let r=s.getElementsByClassName("gojs-ts"),a=r.length!==0?r[0]:null;a!==null&&(a.innerHTML=""),t.currentElement=a,this.JN(t,e),t.currentElement=null}else{if(this.W===G.Grid||this.W===G.Graduated)return s.innerHTML="",s.remove(),!1;if(this.W===G.Spot&&this.isClipping)return s.innerHTML="",s.remove(),this.xa=null,this.wf(),!1}if(!super.yf(t,e,i))return!1;let n=this.D.r,o=n.length;for(let r=0;r<o;r++)n[r].Ge(t,e);return!0}Pd(t){return!0}$p(t,e,i,s){if(!this.isClipping){if(this.Qs()&&t.partClipRect!==null){let n=t.partClipRect,o=this.D.r,r=0,a=0;for(let h=0;h<o.length;h++){if(!o[h].isVisibleObject())continue;let l=o[h].actualBounds;r=h===0?l.x:Math.min(l.x,r),a=h===0?l.y:Math.min(l.y,a)}s.setAttributeNS(null,"clip-path",`path('M ${n.x-i.x-r},${n.y-i.y-a} l ${n.width} 0 l 0 ${n.height} l -${n.width} 0 z')`);return}super.$p(t,e,i,s)}}mf(t,e,i,s,n){let o=this.Mn(),r=this.v,a=1/(r.m11*r.m22-r.m12*r.m21),h=r.m22*a,l=-r.m12*a,u=-r.m21*a,c=r.m11*a,d=a*(r.m21*r.dy-r.m22*r.dx),f=a*(r.m12*r.dx-r.m11*r.dy);if(this.background!==null){let p=t*h+e*u+d,g=t*l+e*c+f,y=i*h+s*u+d,b=i*l+s*c+f;n.e(0,0);let v=this.naturalBounds,w=C.Cl(0,0,v.width,v.height,p,g,y,b,n);return n.v(r),w}else{o||(h=1,l=0,u=0,c=1,d=0,f=0);let p=t*h+e*u+d,g=t*l+e*c+f,y=i*h+s*u+d,b=i*l+s*c+f;n.e(y,b);let v=(y-p)**2+(b-g)**2,w=!1,k=this.D.r,S=k.length,N=P.l(),D=null,L=1/0,M=null,A=this.isClipping&&this.W===G.Spot;A&&(M=P.l(),D=this.findMainElement(),w=D.mf(p,g,y,b,M),w&&(L=(p-M.x)**2+(g-M.y)**2));for(let F=0;F<S;F++){let O=k[F];if(!O.visible||O===D||!O.mf(p,g,y,b,N))continue;w=!0;let E=(p-N.x)**2+(g-N.y)**2;E<v&&(v=E,n.set(N))}return A&&(L>v&&n.set(M),P.i(M)),P.i(N),o&&n.v(r),w}}jc(){let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].jc();super.jc()}f(t){if(this.Xo())return;super.f(t);let e=null;(this.W===G.Auto||this.W===G.Link)&&(e=this.findMainElement());let i=this.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n];if((o===e||o.isPanelMain)&&o.f(!0),o.desiredSize.isReal()||!o.visible)continue;let r=o.Zs(!1);!(o instanceof le)&&!(o instanceof G)&&!(o instanceof lt)&&r===0||o.f(!0)}}bf(){if(this.Xo())return;this.xi(!0),this.lo(!0);let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].bf()}pf(){if(this.B1()===!1){this.Sd(!0),this.Na(!0);let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].TN()}}TN(){this.Na(!0);let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].TN()}bd(t,e,i,s){let n=this.$o;n.e(0,0,0,0);let o=this.desiredSize,r=this.minSize;i===void 0&&(i=r.width,s=r.height),i=Math.max(i,r.width),s=Math.max(s,r.height);let a=this.maxSize;isNaN(o.width)||(t=Math.min(o.width,a.width)),isNaN(o.height)||(e=Math.min(o.height,a.height)),t=Math.max(i,t),e=Math.max(s,e);let h=this.Qt;t=Math.max(t-h.left-h.right,0),e=Math.max(e-h.top-h.bottom,0);let l=this.D.r;this.W.measure(this,t,e,l,n,i,s);let u=n.width+h.left+h.right,c=n.height+h.top+h.bottom;isFinite(o.width)&&(u=o.width),isFinite(o.height)&&(c=o.height),u=Math.min(a.width,u),c=Math.min(a.height,c),u=Math.max(r.width,u),c=Math.max(r.height,c),u=Math.max(i,u),c=Math.max(s,c),n.Hn(u,c),this.naturalBounds.Hn(u,c),this.ro(0,0,u,c)}findMainElement(){if(this.rl===null){let t=this.D.r,e=t.length;if(e===0)return null;for(let i=0;i<e;i++){let s=t[i];if(s.isPanelMain===!0)return this.rl=s,s}this.rl=t[0]}return this.rl}Jo(){return this.part!==null?this.part.locationObject:null}get panelLayoutState(){return this.WN}set panelLayoutState(t){this.WN=t}Pa(t,e,i,s){let n=this.D.r;if(this.actualBounds.e(t,e,i,s),!this.desiredSize.isReal()){let o=this.Zs(!0),r=this.measuredBounds,a=r.width,h=r.height,l=this.il,u=l.left+l.right,c=l.top+l.bottom;switch(a===i&&h===s&&(o=0),o){case 0:(a>i||h>s)&&(this.f(),this.ht(a>i?i:a,h>s?s:h,0,0));break;case 2:this.f(!0),this.ht(i+u,s+c,0,0);break;case 5:this.f(!0),this.ht(i+u,h+c,0,0);break;case 4:this.f(!0),this.ht(a+u,s+c,0,0);break}}this.W.arrange(this,n,this.$o)}ka(t){let e=this.naturalBounds,i=this.Jo();if(I.contains(0,0,e.width,e.height,t.x,t.y)){let s=this.D.r,n=s.length,o=P.z(0,0);for(let r=n;r--;){let a=s[r];if(!(!a.visible&&a!==i)&&(o.set(t).Yi(a.v),a.containsPoint(o)))return P.i(o),!0}return P.i(o),this.Lt!==null}return!1}Yp(t){if(this.no===t)return this;let e=this.D.r,i=e.length;for(let s=0;s<i;s++){let n=e[s].Yp(t);if(n!==null)return n}return null}walkVisualTreeFrom(t,e){if(e(this,t),t instanceof G){let i=t.D.r,s=i.length;for(let n=0;n<s;n++)this.walkVisualTreeFrom(i[n],e)}}Pn(t){this.pD(this,t)}pD(t,e){e(t);let i=t.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n];o instanceof G&&this.pD(o,e)}}qI(t){this.yD(this,t)}yD(t,e){if(e(t),t instanceof G){let i=t.D.r,s=i.length;for(let n=0;n<s;n++)this.yD(i[n],e)}}findInVisualTree(t){return this.wD(this,t)}wD(t,e){if(e(t))return t;if(t instanceof G){let i=t.D.r,s=i.length;for(let n=0;n<s;n++){let o=this.wD(i[n],e);if(o!==null)return o}}return null}findObject(t){if(this.name===t)return this;let e=this.D.r,i=e.length;this.Ta!==null&&(i=this.U0());for(let s=0;s<i;s++){let n=e[s];if(n instanceof G){let o=n.findObject(t);if(o!==null)return o}if(n.name===t)return n}return null}xD(){let t=this.D.r,e=t.length,i=0;for(let s=0;s<e;s++){let n=t[s];n instanceof G?i=Math.max(i,n.xD()):n instanceof et&&(i=Math.max(i,n.jI()))}return i}Mn(){return!(this.type===G.TableRow||this.type===G.TableColumn)}nl(){return this.type===G.TableRow||this.type===G.TableColumn}XA(t,e,i){if(this.pickable===!1||(e===void 0&&(e=null),i===void 0&&(i=null),this.as()))return null;let s=this.naturalBounds,n=1/this.getDocumentScale(),o=this.Mn(),r=o?t:P.z(t.x,t.y).Yi(this.v),a=this.diagram,h=10,l=5;if(a!==null&&(h=a.getInputOption("extraTouchArea"),l=h/2),I.contains(-(l*n),-(l*n),s.width+h*n,s.height+h*n,r.x,r.y)){if(!this.Af){let c=this.D.r,d=c.length,f=P.l(),p=this.isClipping&&this.W===G.Spot,g=p?this.findMainElement():null;if(p&&g&&(g.Mn()?f.set(t).Yi(g.v):f.set(t),!g.containsPoint(f)))return P.i(f),o||P.i(r),null;let y=this.Jo();for(let b=d;b--;){let v=c[b];if(!v.visible&&v!==y||(v.Mn()?f.set(t).Yi(v.v):f.set(t),p&&v===g))continue;let w=null;if(v instanceof G?w=v.XA(f,e,i):v.pickable===!0&&v.containsPoint(f)&&(w=v),w!==null&&(e!==null&&(w=e(w)),w!==null&&(i===null||i(w))))return P.i(f),o||P.i(r),w}P.i(f)}if(this.background===null)return o||P.i(r),null;let u=I.contains(0,0,s.width,s.height,r.x,r.y)?this:null;return o||P.i(r),u}return o||P.i(r),null}GA(t,e,i,s){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);let n=this.naturalBounds,o=this.Mn(),r=o?t:P.z(t.x,t.y).Yi(this.v),a=this.nl(),h=I.contains(0,0,n.width,n.height,r.x,r.y);if(a||h){if(!this.Af){let l=this.D.r,u=l.length,c=P.l(),d=this.Jo();for(let f=u;f--;){let p=l[f];if(!p.visible&&p!==d)continue;p.Mn()?c.set(t).Yi(p.v):c.set(t);let g=p,y=p instanceof G?p:null;if(y!==null?y.GA(c,e,i,s):g.containsPoint(c)){if(g.pickable===!1)continue;e!==null&&(g=e(g)),g!==null&&(i===null||i(g))&&s.add(g)}}P.i(c)}return o||P.i(r),h&&this.background!==null}return o||P.i(r),!1}Zm(t,e,i,s,n,o){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);let r=o;if(r===void 0&&(r=Nt.l(),r.Ue()),r.bc(this.v),this.containedInRect(t,r))return this.$N(e,i,n),o===void 0&&Nt.i(r),!0;if(this.intersectsRect(t,r)){if(!this.Af){let a=this.Jo(),h=this.D.r,l=h.length;for(let u=l;u--;){let c=h[u];if(!c.visible&&c!==a)continue;let d=c.actualBounds,f=this.naturalBounds;if(d.x>f.width||d.y>f.height||d.x+d.width<0||d.y+d.height<0)continue;let p=c,g=c instanceof G?c:null,y=Nt.l();y.set(r),(g!==null?g.Zm(t,e,i,s,n,y):p.ZT(t,s,y))&&(e!==null&&(p=e(p)),p!==null&&(i===null||i(p))&&n.add(p)),Nt.i(y)}}return o===void 0&&Nt.i(r),s}return o===void 0&&Nt.i(r),!1}$N(t,e,i){let s=this.D.r,n=s.length;for(let o=n;o--;){let r=s[o];if(!r.visible)continue;let a=r.actualBounds,h=this.naturalBounds;if(a.x>h.width||a.y>h.height||a.x+a.width<0||a.y+a.height<0)continue;r instanceof G&&r.$N(t,e,i);let l=r;t!==null&&(l=t(l)),l!==null&&(e===null||e(l))&&i.add(l)}}YA(t,e,i,s,n,o){if(this.pickable===!1)return!1;i===void 0&&(i=null),s===void 0&&(s=null);let r=this.naturalBounds,a=this.Mn(),h=a?t:P.z(t.x,t.y).Yi(this.v),l=a?e:P.z(e.x,e.y).Yi(this.v),u=h.distanceSquaredPoint(l),c=h.x>0&&h.x<r.width&&h.y>0&&h.y<r.height||P.distanceLineSegmentSquared(h.x,h.y,0,0,0,r.height)<=u||P.distanceLineSegmentSquared(h.x,h.y,0,r.height,r.width,r.height)<=u||P.distanceLineSegmentSquared(h.x,h.y,r.width,r.height,r.width,0)<=u||P.distanceLineSegmentSquared(h.x,h.y,r.width,0,0,0)<=u,d=h.distanceSquared(0,0)<=u&&h.distanceSquared(0,r.height)<=u&&h.distanceSquared(r.width,0)<=u&&h.distanceSquared(r.width,r.height)<=u;if(a||(P.i(h),P.i(l)),c){if(!this.Af){let f=P.l(),p=P.l(),g=this.Jo(),y=this.D.r,b=y.length;for(let v=b;v--;){let w=y[v];if(!w.visible&&w!==g)continue;let k=w.actualBounds,S=this.naturalBounds;if(a&&(k.x>S.width||k.y>S.height||k.x+k.width<0||k.y+k.height<0))continue;if(w.Mn()){let L=w.v;f.set(t).Yi(L),p.set(e).Yi(L)}else f.set(t),p.set(e);let N=w,D=w instanceof G?w:null;(D!==null?D.YA(f,p,i,s,n,o):N.QT(f,p,n))&&(i!==null&&(N=i(N)),N!==null&&(s===null||s(N))&&o.add(N))}P.i(f),P.i(p)}return n?c:d}return!1}YN(t){let e=null;if(t instanceof et){e=t.spot1,e===T.Default&&(e=null);let i=t.geometry;i!==null&&e===null&&(e=i.spot1)}return e===null&&(e=T.TopLeft),e}KN(t){let e=null;if(t instanceof et){e=t.spot2,e===T.Default&&(e=null);let i=t.geometry;i!==null&&e===null&&(e=i.spot2)}return e===null&&(e=T.BottomRight),e}add(...t){for(let e=0;e<t.length;e++)this.insertAt(this.D.count,t[e]);return this}elt(t){return this.D.elt(t)}insertAt(t,e){e instanceof pt&&m.o("Cannot add a Part to a Panel: "+e+"; use a Panel instead"),(this===e||this.isContainedBy(e))&&(this===e&&m.o("Cannot make a Panel contain itself: "+this.toString()),m.o("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+e.toString()));let i=e.panel;if(i!==null&&i!==this&&m.o("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+e.toString()+", already contained by "+i.toString()+", cannot be shared by this Panel: "+this.toString()),this.W===G.Grid&&!(e instanceof et)&&m.o("Can only add Shapes to a Grid Panel, not: "+e),this.W===G.Graduated&&!(e instanceof et||e instanceof lt)&&m.o("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+e),e.Uh(this),e.sl=null,this.itemArray!==null){let r=e.data;m.$(r)&&(this._s===null&&(this._s=new Mt),this._s.set(r,e))}let s=this.D,n=-1;if(i===this){let r=-1,a=this.D.r,h=a.length;for(let l=0;l<h;l++)if(a[l]===e){r=l;break}if(r!==-1){if(r===t||r+1>=s.count&&t>=s.count)return;s.removeAt(r),n=r}else m.o("element "+e.toString()+" has panel "+i.toString()+" but is not contained by it.")}(t<0||t>s.count)&&(t=s.count),s.insertAt(t,e),(t===0||e.isPanelMain)&&(this.rl=null),this.Xo()||this.f(),e.f(!1),e.portId!==null?this.Cn=!0:e instanceof G&&e.Cn===!0&&(this.Cn=!0),this.ds=null,this.isEnabledObject()||this.Z1(e,!1);let o=this.part;if(o!==null){o.s0(),o.Tf(),this.Cn&&o instanceof J&&(o.Cn=!0),o.Cn&&o instanceof J&&(o.ci=null);let r=this.diagram;if(r!==null&&r.undoManager.isUndoingRedoing)return;n!==-1&&o.raiseChangedEvent(4,"elements",this,e,null,n,null),o.raiseChangedEvent(3,"elements",this,null,e,null,t)}}get Cn(){return(this.n&8388608)!==0}set Cn(t){(this.n&8388608)!==0!==t&&(this.n=this.n^8388608)}NN(){return(this.n&16777216)!==0}ZN(t){t?this.n|=16777216:this.n&=-16777217}HI(t){t.Uh(this),t.sl=null;let e=this.D,i=e.count;e.insertAt(i,t);let s=this.part;if(s!==null){s.s0(),t.portId!==null&&s instanceof J&&(s.Cn=!0);let n=this.diagram;if(n!==null&&n.undoManager.isUndoingRedoing)return;s.raiseChangedEvent(3,"elements",this,null,t,null,i)}}fI(t){let e=this.D.r,i=e.length,s=-1;for(let n=0;n<i;n++)if(e[n]===t){s=n;break}return s}remove(t){let e=this.D.r,i=e.length,s=-1;for(let n=0;n<i;n++)if(e[n]===t){s=n;break}s!==-1&&this.ri(s,!0)}removeAt(t){t>=0&&this.ri(t,!0)}ri(t,e){let i=this.D,s=i.elt(t);if(s.sl=null,s.Uh(null),this._s!==null){let o=s.data;m.$(o)&&this._s.delete(o)}i.removeAt(t),this.xi(!1),this.f(),this.rl===s&&(this.rl=null),this.ds=null;let n=this.part;if(n!==null){n.s0(),n.Tf(),n.invalidateAdornments(),n instanceof J&&(s instanceof G?s.walkVisualTreeFrom(s,(r,a)=>n.RN(a,e)):n.RN(s,e));let o=this.diagram;if(o!==null&&o.undoManager.isUndoingRedoing)return;n.raiseChangedEvent(4,"elements",this,s,null,t,null)}}get Zi(){return this.O===null&&(this.O=new ie),this.O.Zi}get rowCount(){return this.O===null?0:this.Zi.length}getRowDefinition(t){t<0&&m.J(t,">= 0",G,"getRowDefinition:idx"),t=Math.round(t);let e=this.Zi;if(e[t]===void 0){let i=new Xt;i.Uh(this),i.isRow=!0,i.index=t,e[t]=i,this.raiseChangedEvent(3,"rowdefs",this,null,i,null,t)}return e[t]}removeRowDefinition(t){if(t<0&&m.J(t,">= 0",G,"removeRowDefinition:idx"),this.rowCount===0)return;t=Math.round(t);let e=this.Zi,i=e[t];if(i){e[t]=void 0;let s=e.length-1;for(;s>=0&&e[s--]===void 0;)e.length--;this.raiseChangedEvent(4,"rowdefs",this,i,null,t,null),this.f()}}kT(t,e){let i=this.Zi;if(!(t<0)){if(i[t]=e instanceof Xt?e:void 0,!e){let s=i.length-1;for(;s>=0&&i[s--]===void 0;)i.length--}this.f()}}get Qi(){return this.O===null&&(this.O=new ie),this.O.Qi}get columnCount(){return this.O===null?0:this.Qi.length}getColumnDefinition(t){t<0&&m.J(t,">= 0",G,"getColumnDefinition:idx"),t=Math.round(t);let e=this.Qi;if(e[t]===void 0){let i=new Xt;i.Uh(this),i.isRow=!1,i.index=t,e[t]=i,this.raiseChangedEvent(3,"coldefs",this,null,i,null,t)}return e[t]}removeColumnDefinition(t){if(t<0&&m.J(t,">= 0",G,"removeColumnDefinition:idx"),this.columnCount===0)return;t=Math.round(t);let e=this.Qi,i=e[t];if(i){e[t]=void 0;let s=e.length-1;for(;s>=0&&e[s--]===void 0;)e.length--;this.raiseChangedEvent(4,"coldefs",this,i,null,t,null),this.f()}}PT(t,e){let i=this.Qi;if(!(t<0)){if(i[t]=e instanceof Xt?e:void 0,!e){let s=i.length-1;for(;s>=0&&i[s--]===void 0;)i.length--}this.f()}}addRowColumnDefinition(t){let e=null;return t.isRow?e=this.getRowDefinition(t.index):t.isRow||(e=this.getColumnDefinition(t.index)),e&&e.X1(t),this}addRowDefinition(t,e){let i=this.getRowDefinition(t);return i&&i.X1(new Xt(e)),this}addColumnDefinition(t,e){let i=this.getColumnDefinition(t);return i&&i.X1(new Xt(e)),this}get rowSizing(){return this.O!==null?this.O.V0:3}set rowSizing(t){let e=this.rowSizing;e!==t&&(this.O===null&&(this.O=new ie),this.O.V0=t,this.f(),this.t("rowSizing",e,t))}get columnSizing(){return this.O!==null?this.O.B0:3}set columnSizing(t){let e=this.columnSizing;e!==t&&(this.O===null&&(this.O=new ie),this.O.B0=t,this.f(),this.t("columnSizing",e,t))}get topIndex(){return this.O!==null?this.O.z0:0}set topIndex(t){let e=this.topIndex;e!==t&&((!isFinite(t)||t<0)&&m.o("Panel.topIndex must be greater than zero and a real number, not: "+t),this.O===null&&(this.O=new ie),this.O.z0=t,this.f(),this.t("topIndex",e,t))}get leftIndex(){return this.O!==null?this.O.X0:0}set leftIndex(t){let e=this.leftIndex;e!==t&&((!isFinite(t)||t<0)&&m.o("Panel.leftIndex must be greater than zero and a real number, not: "+t),this.O===null&&(this.O=new ie),this.O.X0=t,this.f(),this.t("leftIndex",e,t))}findRowForLocalY(t){if(t<0||this.type!==G.Table||this.rowCount===0)return-1;let e=0,i=this.Zi,s=i.length,n=this.topIndex;for(;n<s;n++){let o=i[n];if(o!==void 0&&(e+=o.total,t<e))return n}return n}findColumnForLocalX(t){if(t<0||this.type!==G.Table||this.columnCount===0)return-1;let e=0,i=this.Qi,s=i.length,n=this.leftIndex;for(;n<s;n++){let o=i[n];if(o!==void 0&&(e+=o.total,t<e))return n}return n}graduatedPointForValue(t,e){if(e===void 0&&(e=new P(NaN,NaN)),this.type!==G.Graduated)return e.e(NaN,NaN),e;t=Math.min(Math.max(t,this.graduatedMin),this.graduatedMax);let i=this.findMainElement();return i.geometry.getPointAlongPath((t-this.graduatedMin)/this.graduatedRange,e),i.v.gt(e)}graduatedValueForPoint(t){if(this.type!==G.Graduated)return NaN;let e=this.findMainElement();return e.v.Ci(t),e.geometry.getFractionForPoint(t)*this.graduatedRange+this.graduatedMin}get data(){return this.te}set data(t){let e=this.te;if(e!==t){let i=this instanceof pt&&!(this instanceof vt);i&&m.s(t,"object",G,"data"),this.It(),this.te=t;let s=this.diagram;if(s!==null)if(i){s.partManager.WI(this,e,t);let n=this.adornments;for(;n.next();){let o=n.value,r=o.adornedObject;if(r!==null){let a=r.findBindingPanel();a!==null&&(o.data=a.data)}}}else{let n=this.panel;n!==null&&n._s!==null&&(e!==null&&n._s.delete(e),t!==null&&n._s.set(t,this))}if(this.t("data",e,t),s!==null&&s.undoManager.isUndoingRedoing)return;t!==null&&this.updateTargetBindings()}}get itemIndex(){return this.Fd}set itemIndex(t){let e=this.Fd;e!==t&&(this.Fd=t,this.t("itemIndex",e,t))}get Ds(){return this.w!==null?this.w.Ds:null}set Ds(t){this.ve!==t&&(this.w===null&&(this.w=new Ue),this.w.Ds=t)}ON(){return this.Ds!==null}rD(){let t=this.Ds;return t!==null&&t.u}freezeBindings(){return this.It()}It(){let t=this.Ds;if(t===null)this.data!==null&&m.o("Template cannot have .data be non-null: "+this),this.Ds=t=new q;else if(t.u)return this;let e=new q;this.ZN(!1),this.walkVisualTreeFrom(this,(n,o)=>{o.ba();let r=o.ve;if(r!==null){o.DN(!1);let a=r.iterator;for(;a.next();){let h=a.value;h.mode===2&&o.DN(!0);let l=h.sourceName;if(h.isToObject){l==="/"&&n.ZN(!0);let u=h.$T(n,o);u!==null&&(e.add(u),u.oo===null&&(u.oo=new q),u.oo.add(h))}t.add(h)}}if(o instanceof G&&o.type===G.Table){if(o.rowCount>0){let a=o.Zi,h=a.length;for(let l=0;l<h;l++){let u=a[l];if(u!==void 0&&u.Fs!==null){let c=u.Fs.iterator;for(;c.next();){let d=c.value;d.Ti=u,d.Id=2,d.Df=u.index,t.add(d)}}}}if(o.columnCount>0){let a=o.Qi,h=a.length;for(let l=0;l<h;l++){let u=a[l];if(u!==void 0&&u.Fs!==null){let c=u.Fs.iterator;for(;c.next();){let d=c.value;d.Ti=u,d.Id=1,d.Df=u.index,t.add(d)}}}}}});let i=e.iterator;for(;i.next();){let n=i.value;if(n.oo!==null){n.DN(!0);let o=n.oo.iterator;for(;o.next();){let r=o.value;n.ve===null&&(n.ve=new q),n.ve.add(r)}}n.oo=null}let s=t.iterator;for(;s.next();){let n=s.value,o=n.Ti;if(o!==null){n.Ti=null;let r=n.targetProperty,a=r.indexOf(".");if(a>0&&o instanceof G){let h=r.substring(0,a),l=r.substring(a+1),u=o.findObject(h);u!==null?(o=u,n.targetProperty=l):(m.ne('Warning: unable to find GraphObject named "'+h+'" for Binding: '+n.toString()),o=null)}if(o instanceof Xt){let h=V.xs(o.panel);n.targetId=h===void 0?-1:h,o.panel.no=n.targetId}else if(o instanceof $){let h=V.xs(o);n.targetId=h===void 0?-1:h,o.no=n.targetId}else m.o("Unknown type of binding target: "+o);n.check(o)}}return t.k(),this instanceof pt&&this.Di()&&this.ensureBounds(),this}static BU=!1;copyTemplate(t){t===void 0&&(t=!1);let e=this.copy();return e.qI(i=>{i instanceof G&&(i.Ds=null,i.te=null);let s=i.ve;s!==null&&(i.ve=null,s.each(o=>i.bind(o.copy())));let n=i.Ts;n!==null&&(i.Ts=null,n.each(o=>i.trigger(o.value.copy())))}),t&&e.It(),e}updateTargetBindings(t){let e=this.Ds;if(e===null)return;t===void 0&&(t="");let i=this.diagram?.model,s=e.iterator;for(;s.next();){let n=s.value,o=this.QN(n,t);if(o===null)continue;let{data:r,elt:a}=o;n.isToTheme&&this.diagram===null||a!==void 0&&n.updateTarget(a,r,void 0,i)}}JI(t){if(t===""){this.updateTargetBindings(t);return}let e=this.Ds;if(e===null)return;let i=this.diagram?.model,s=e.iterator;for(;s.next();){let n=s.value;if(n.isToData&&n.sourceProperty!=="")continue;let o=this.QN(n,"");if(o===null)continue;let{data:r,elt:a}=o;a!==void 0&&n.updateTarget(a,r,void 0,i)}}Go(){if(this.diagram!==null)if(this.ON()){let t=this.diagram.model,e=this.Ds.iterator;for(;e.next();){let i=e.value;if(!i.isToTheme)continue;let s=this.QN(i);if(s===null)continue;let{data:n,elt:o}=s;o!==void 0&&i.updateTarget(o,n,void 0,t)}}else{let t=this.D.r,e=t.length;for(let i=0;i<e;i++)t[i].Go()}}QN(t,e=""){let i=t.sourceProperty;if(e!==""&&i!==""&&i!==e)return null;let s=t.targetProperty;if(t.converter===null&&s==="")return null;let n=this.data,o=t.sourceName;if(t.isToObject){if(n=this.JT(o),n===null)return null}else if(t.isToModel){let l=this.diagram;if(l===null)return null;n=l.model.modelData}let r=this,a=t.targetId;if(a!==-1){if(r=this.Yp(a),r===null)return null}else t.Ti!==null&&(r=t.Ti);o==="/"?n=r.part:o==="."?n=r:o===".."&&(n=r.panel);let h=t.Id;if(h!==0){if(!(r instanceof G))return null;h===1?r=r.getColumnDefinition(t.Df):h===2&&(r=r.getRowDefinition(t.Df))}return{data:n,elt:r}}get itemArray(){return this.Ta}set itemArray(t){let e=this.Ta;if(e!==t||t!==null&&this.$I(t)){let i=this.diagram;if(e!==t&&(i!==null&&e!==null&&i.partManager.L2(this,i),this.Ta=t,i!==null&&t!==null&&i.partManager.C2(this,i)),this.t("itemArray",e,t),i!==null&&i.undoManager.isUndoingRedoing)return;this.bD(e,t)}}findItemPanelForData(t){return t==null||this._s===null?null:(m.wc(t,G,"findItemPanelForData"),this._s.get(t))}$I(t){let e=this.D.r,i=e.length,s=t.length,n=0,o=null;for(;n<i&&(o=e[n],!(o instanceof G)||o.data===null);)n++,o=e[n];if(i-n!==s)return!0;if(o===null)return s>0;let r=0;for(;n<i&&r<s;){if(o=e[n],!(o instanceof G)||o.data!==t[r])return!0;n++,r++}return!1}U0(){if(this.type===G.Spot||this.type===G.Auto)return Math.min(this.D.length,1);if(this.type===G.Link){let t=this.D,e=t.length,i=0;for(;i<e;i++){let s=t.elt(i);if(!(s instanceof et)||!s.isPanelMain)return i}return i}if(this.type===G.Table&&this.D.length>0){let t=this.D.elt(0);if(t.isPanelMain&&t instanceof G&&t.nl())return 1}return 0}rebuildItemElements(){let t=this.U0();for(;this.D.length>t;)this.ri(this.D.length-1,!1);this.bD(null,this.itemArray)}bD(t,e){let i=this.U0(),s=e;if(s===null||s.length===0){for(;this.D.length>i;)this.ri(this.D.length-1,!1);return}if(this.D.length<=i){let n=s.length;for(let o=0;o<n;o++)this.Q1(s[o],o,!0)}else{let n=i;for(let r=0;r<s.length;r++,n++){let a=s[r],h=n<this.D.length?this.D.elt(n):null;if(h instanceof G){if(h.data!==a){let l=this._N(h.data,r),u=this._N(a,r),c=u!==l;if(!c){let d=this.tC(h.data,r,l);c=this.tC(a,r,u)!==d}c?(this.ri(n,!1),this.Q1(a,r,!1)):h.data=a}}else this.Q1(a,r,!1)}for(;n<this.D.length;)this.ri(n,!1);this.rl=null,this.eC(i,0),this.Xo()||this.f(),this.ds=null,this.isEnabledObject()||this.Z1(this,!1);let o=this.part;o!==null&&(o.s0(),o.Tf(),this.Cn&&o instanceof J&&(o.Cn=!0),o.Cn&&o instanceof J&&(o.ci=null))}}Q1(t,e,i){if(t==null||e<0)return;let s=this._N(t,e),n=this.tC(t,e,s);if(n!==null){n.It();let o=n.copy();if(o.NN()){let a=this.findBindingPanel();a!==null&&a.ZN(!0)}m.$(t)&&(this._s===null&&(this._s=new Mt),this._s.set(t,o));let r=e+this.U0();this.insertAt(r,o),i&&(o.te=t,this.eC(r,e),o.te=null),o.data=t}}ZI(t){if(t<0)return;let e=t+this.U0();this.ri(e,!0),this.eC(e,t)}eC(t,e){let i=this.D,s=t,n=e;for(;s<i.length;){let o=i.elt(s);o instanceof G&&o.QI(s,n),s++,n++}}QI(t,e){this.type===G.TableRow?this.row=t:this.type===G.TableColumn&&(this.column=t),this.itemIndex=e}get itemTemplate(){let t=this.itemTemplateMap;if(t!==null){let e=t.get("");if(e)return e}return G.kD()}set itemTemplate(t){let e=this.itemTemplate;if(e!==t){(t instanceof pt||t.isPanelMain)&&m.o("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+t),this.itemTemplateMap===null&&(this.itemTemplateMap=new Mt),this.itemTemplateMap.set("",t),this.t("itemTemplate",e,t);let i=this.diagram;if(i!==null&&i.undoManager.isUndoingRedoing)return;this.rebuildItemElements()}}get itemTemplateMap(){return this.w!==null?this.w.x0:null}set itemTemplateMap(t){let e=this.itemTemplateMap;if(e!==t){let i=t.iterator;for(;i.next();){let n=i.value}this.Yt().x0=t,this.t("itemTemplateMap",e,t);let s=this.diagram;if(s!==null&&s.undoManager.isUndoingRedoing)return;this.rebuildItemElements()}}get itemCategoryProperty(){return this.w!==null?this.w.b0:"category"}set itemCategoryProperty(t){let e=this.itemCategoryProperty;e!==t&&(typeof t!="string"&&!m.st(t)&&m.si(t,"string or function",G,"itemCategoryProperty"),this.Yt().b0=t,this.t("itemCategoryProperty",e,t))}_N(t,e){if(t===null)return"";let i=this.itemCategoryProperty,s="";if(m.st(i))s=i(t);else if(typeof i=="string"&&m.$(t)){if(i==="")return"";let n=this.diagram,o=n!==null?n.model:null;o?s=o.St(t,i):s=ut.St(t,i)}else return"";if(s===void 0)return"";if(typeof s=="string")return s;m.o("Panel.getCategoryForItemData found a non-string category for "+t+": "+s)}static PD=!1;static iC;static kD(){return G.iC||(G.iC=new G().add(new lt().bind("text","",m.toString).theme("stroke","text"))),G.iC}tC(t,e,i){let s=null,n=this.itemTemplateMap;return n!==null&&(s=n.get(i),s===null&&(s=n.get(""))),s===null&&(G.PD||(G.PD=!0,m.ne('No item template Panel found for category "'+i+'" on '+this),m.ne(" Using default item template.")),s=G.kD()),s}get Af(){return(this.n&1048576)!==0}set Af(t){let e=(this.n&1048576)!==0;e!==t&&(m.s(t,"boolean",G,"isAtomic"),this.n=this.n^1048576,this.t("isAtomic",e,t))}get isClipping(){return(this.n&2097152)!==0}set isClipping(t){let e=(this.n&2097152)!==0;e!==t&&(this.wf(),this.n=this.n^2097152,this instanceof ht&&(this.he=null),this.f(),this.t("isClipping",e,t))}get isOpposite(){return(this.n&33554432)!==0}set isOpposite(t){let e=(this.n&33554432)!==0;e!==t&&(this.n=this.n^33554432,this.f(),this.t("isOpposite",e,t))}get isEnabled(){return(this.n&4194304)!==0}set isEnabled(t){let e=(this.n&4194304)!==0;if(e!==t){let i=this.panel===null||this.panel.isEnabledObject();this.n=this.n^4194304,this.t("isEnabled",e,t);let s=this.diagram;if(s!==null&&s.undoManager.isUndoingRedoing)return;i&&this.Z1(this,t)}}Z1(t,e){let i=t.enabledChanged;if(i!==null&&i(t,e),t instanceof G){let s=t.D.r,n=s.length;for(let o=0;o<n;o++){let r=s[o];e&&r instanceof G&&!r.isEnabled||this.Z1(r,e)}}}get alignmentFocusName(){return this.fo}set alignmentFocusName(t){let e=this.fo;e!==t&&(this.fo=t,this.f(),this.t("alignmentFocusName",e,t))}static definePanelLayout(t,e){Lt.An(t,e)}static isLayoutDefined(t){return Lt.fs.has(t)}static Position=Lt.fs.get("Position");static Horizontal=Lt.fs.get("Horizontal");static Vertical=Lt.fs.get("Vertical");static Spot=Lt.fs.get("Spot");static Auto=Lt.fs.get("Auto");static Table=Lt.fs.get("Table");static Viewbox=Lt.fs.get("Viewbox");static TableRow=Lt.fs.get("TableRow");static TableColumn=Lt.fs.get("TableColumn");static Link=Lt.fs.get("Link");static Grid=Lt.fs.get("Grid");static Graduated=Lt.fs.get("Graduated")}G.definePanelLayout=G.definePanelLayout;class Pe{R0;O0;I0;E0;vs;_i;ds;vi;constructor(){this.R0=0,this.O0=100,this.I0=10,this.E0=0,this.vs=null,this._i=null,this.ds=null,this.vi=null}copy(){let t=new Pe;return t.R0=this.R0,t.O0=this.O0,t.I0=this.I0,t.E0=this.E0,t.vs=this.vs,t._i=this._i,t.ds=this.ds,t.vi=this.vi,t}}class ti{Rd;Od;lf;N0;constructor(){this.Rd=st.EL,this.Od=P.dn,this.lf=st.Zw,this.N0=[]}copy(){let t=new ti;return t.Rd=this.Rd.copy(),t.Od=this.Od.copy(),t.lf=this.lf.copy(),t.N0=this.N0,t}}class ie{Zi;Qi;V0;B0;z0;X0;C0;A0;L0;T0;v0;D0;F0;Aa;constructor(){this.Zi=[],this.Qi=[],this.V0=3,this.B0=3,this.z0=0,this.X0=0,this.C0=Dt.im,this.A0=1,this.L0=null,this.T0=null,this.v0=1,this.D0=null,this.F0=null,this.Aa=null}copy(t){let e=new ie,i=this.Zi,s=i.length,n=e.Zi;for(let h=0;h<s;h++){let l=i[h];if(l===void 0)continue;let u=l.copy();u.Uh(t),n[h]=u}let o=this.Qi,r=o.length,a=e.Qi;for(let h=0;h<r;h++){let l=o[h];if(l===void 0)continue;let u=l.copy();u.Uh(t),a[h]=u}return e.V0=this.V0,e.B0=this.B0,e.z0=this.z0,e.X0=this.X0,e.C0=this.C0.N(),e.A0=this.A0,e.L0=this.L0,e.T0=this.T0,e.v0=this.v0,e.D0=this.D0,e.F0=this.F0,e.Aa=this.Aa,e}}var zi=(x=>(x[x.Default=1]="Default",x[x.None=2]="None",x[x.ProportionalExtra=3]="ProportionalExtra",x))(zi||{});class Xt{$s;G0;Tt;Xh;Gh;de;ct;Ed;ao;ll;Ud;Vd;Yh;Lt;Bd;Fs;q;Re;ki;constructor(t){V.Je(this),this.$s=null,this.G0=!0,this.Tt=0,this.ki=NaN,this.Xh=0,this.Gh=1/0,this.de=T.Default,this.q=0,this.Re=0,this.ct=0,this.Fs=null,this.Ed=1,this.ao=1,this.ll=null,this.Ud=null,this.Vd=NaN,this.Yh=null,this.Lt=null,this.Bd=!1,t&&(Object.assign(this,t),t.column!==void 0?(this.isRow=!1,this.index=t.column):t.row!==void 0&&(this.isRow=!0,this.index=t.row))}copy(){let t=new Xt;return t.G0=this.G0,t.Tt=this.Tt,t.ki=this.ki,t.Xh=this.Xh,t.Gh=this.Gh,t.de=this.de,t.q=this.q,t.Re=this.Re,t.ct=this.ct,t.ao=this.ao,t.Ed=this.Ed,this.ll===null?t.ll=null:t.ll=this.ll.N(),t.Ud=this.Ud,t.Vd=this.Vd,t.Yh=null,this.Yh!==null&&(t.separatorDashArray=this.Yh.slice()),t.Lt=this.Lt,t.Bd=this.Bd,t.Fs=this.Fs,t}X1(t){t.isRow?t.height!==void 0&&(this.height=t.height):t.width!==void 0&&(this.width=t.width),t.minimum!==void 0&&(this.minimum=t.minimum),t.maximum!==void 0&&(this.maximum=t.maximum),t.alignment!==void 0&&(this.alignment=t.alignment),t.stretch!==void 0&&(this.stretch=t.stretch),t.sizing!==void 0&&(this.sizing=t.sizing),t.separatorPadding!==void 0&&(this.separatorPadding=t.separatorPadding),t.separatorStroke!==void 0&&(this.separatorStroke=t.separatorStroke),t.separatorStrokeWidth!==void 0&&(this.separatorStrokeWidth=t.separatorStrokeWidth),t.separatorDashArray!==void 0&&(this.Yh=t.separatorDashArray),t.background!==void 0&&(this.background=t.background),t.coversSeparators!==void 0&&(this.coversSeparators=t.coversSeparators),t.Fs!==void 0&&(this.Fs=t.Fs)}fe(t){t in zi?this.sizing=t:m.ur(this,t)}toString(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+V.xs(this)}static Default=1;static None=2;static ProportionalExtra=3;Uh(t){this.$s=t}computeEffectiveSpacingTop(t){let e=0,i=this.$s;if(this.index!==t){let n=this.separatorStroke;n===null&&i!==null&&(n=this.isRow?i.defaultRowSeparatorStroke:i.defaultColumnSeparatorStroke),n!==null&&(e=this.separatorStrokeWidth,isNaN(e)&&(i!==null?e=this.isRow?i.defaultRowSeparatorStrokeWidth:i.defaultColumnSeparatorStrokeWidth:e=0))}let s=this.ll;if(s===null)if(i!==null)s=i.defaultSeparatorPadding;else return e;return e+(this.isRow?s.top:s.left)}computeEffectiveSpacing(){let t=0,e=this.$s,i=0,s=this.isRow;if(e!==null&&e.type===G.Table){let o=s?e.Zi.length:e.Qi.length;for(let r=0;r<o;r++){let a=s?e.Zi[r]:e.Qi[r];if(a!==void 0&&a.q!==0){i=a.index;break}}}if(this.index!==i){let o=this.separatorStroke;o===null&&e!==null&&(o=s?e.defaultRowSeparatorStroke:e.defaultColumnSeparatorStroke),o!==null&&(t=this.separatorStrokeWidth,isNaN(t)&&(e!==null?t=s?e.defaultRowSeparatorStrokeWidth:e.defaultColumnSeparatorStrokeWidth:t=0))}let n=this.ll;if(n===null)if(e!==null)n=e.defaultSeparatorPadding;else return t;return t+(this.isRow?n.top+n.bottom:n.left+n.right)}t(t,e,i,s,n){let o=this.$s;if(o!==null&&(o.raiseChangedEvent(2,t,this,e,i,s,n),this.Fs!==null)){let r=o.diagram;if(r!==null&&!r.wi){let a=o.findBindingPanel();if(a!==null){let h=a.data;if(h!==null){let l=this.Fs.iterator;for(;l.next();)l.value.updateSource(this,h,t,a)}}}}}get panel(){return this.$s}get isRow(){return this.G0}set isRow(t){this.G0=t}get index(){return this.Tt}set index(t){this.Tt=t}get height(){return this.ki}set height(t){let e=this.ki;e!==t&&(t<0&&m.J(t,">= 0",Xt,"height"),this.ki=t,this.actual=this.q,this.panel!==null&&this.panel.f(),this.t("height",e,t))}get width(){return this.ki}set width(t){let e=this.ki;e!==t&&(t<0&&m.J(t,">= 0",Xt,"width"),this.ki=t,this.actual=this.q,this.panel!==null&&this.panel.f(),this.t("width",e,t))}get minimum(){return this.Xh}set minimum(t){let e=this.Xh;e!==t&&((t<0||!isFinite(t))&&m.J(t,">= 0",Xt,"minimum"),this.Xh=t,this.actual=this.q,this.panel!==null&&this.panel.f(),this.t("minimum",e,t))}get maximum(){return this.Gh}set maximum(t){let e=this.Gh;e!==t&&(t<0&&m.J(t,">= 0",Xt,"maximum"),this.Gh=t,this.actual=this.q,this.panel!==null&&this.panel.f(),this.t("maximum",e,t))}get alignment(){return this.de}set alignment(t){let e=this.de;e.equals(t)||(this.de=t.N(),this.panel!==null&&this.panel.f(),this.t("alignment",e,t))}get stretch(){return this.ao}set stretch(t){let e=this.ao;e!==t&&(this.ao=t,this.panel!==null&&this.panel.f(),this.t("stretch",e,t))}get separatorPadding(){return this.ll}set separatorPadding(t){typeof t=="number"&&(t=new Dt(t));let e=this.ll;(t===null||e===null||!e.equals(t))&&(t!==null&&(t=t.N()),this.ll=t,this.panel!==null&&this.panel.f(),this.t("separatorPadding",e,t))}get separatorStroke(){return this.Ud}set separatorStroke(t){let e=this.Ud;e!==t&&(t!==null&&R.Md(t,"RowColumnDefinition.separatorStroke"),t instanceof R&&t.k(),this.Ud=t,this.panel!==null&&this.panel.f(),this.t("separatorStroke",e,t))}get separatorStrokeWidth(){return this.Vd}set separatorStrokeWidth(t){let e=this.Vd;e!==t&&(this.Vd=t,this.panel!==null&&this.panel.f(),this.t("separatorStrokeWidth",e,t))}get separatorDashArray(){return this.Yh}set separatorDashArray(t){let e=this.Yh;if(e!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",Xt,"separatorDashArray:value"),t!==null){let i=t.length,s=0;for(let n=0;n<i;n++){let o=t[n];(typeof o!="number"||!(o>=0)||!isFinite(o))&&m.o("separatorDashArray value "+o+" at index "+n+" must be a positive number or zero."),s+=o}if(s===0){if(e===null)return;t=null}}this.Yh=t,this.panel!==null&&this.panel.C(),this.t("separatorDashArray",e,t)}}get background(){return this.Lt}set background(t){let e=this.Lt;e!==t&&(t!==null&&R.Md(t,"RowColumnDefinition.background"),t instanceof R&&t.k(),this.Lt=t,this.panel!==null&&this.panel.C(),this.t("background",e,t))}get coversSeparators(){return this.Bd}set coversSeparators(t){let e=this.Bd;e!==t&&(m.s(t,"boolean",Xt,"coversSeparators"),this.Bd=t,this.panel!==null&&this.panel.C(),this.t("coversSeparators",e,t))}get sizing(){return this.Ed}set sizing(t){let e=this.Ed;e!==t&&(this.Ed=t,this.panel!==null&&this.panel.f(),this.t("sizing",e,t))}j1(){if(this.sizing===1){let t=this.$s;return t===null?2:this.isRow?t.rowSizing:t.columnSizing}return this.sizing}get actual(){return this.q}set actual(t){isNaN(this.ki)?this.q=Math.max(Math.min(this.Gh,t),this.Xh):this.q=Math.max(Math.min(this.Gh,this.ki),this.Xh)}get measured(){return this.Re}set measured(t){this.Re=t}get total(){return this.q+this.computeEffectiveSpacing()}get position(){return this.ct}set position(t){this.ct=t}bind(t,e,i,s){return this.Pf(t,e,i,s),this}bindTwoWay(t,e,i,s){let n=this.Pf(t,e,i,s);return s===void 0&&n.makeTwoWay(),this}theme(t,e,i,s,n){return this.Ca(t,e,i,s,n),this}themeData(t,e,i,s,n){return this.Ca(t,e,i,s,n).ofData(),this}themeObject(t,e,i,s,n,o){return this.Ca(t,e,i,s,n).ofObject(o),this}themeModel(t,e,i,s,n){return this.Ca(t,e,i,s,n).ofModel(),this}Pf(t,e,i,s){let n;return typeof t=="string"?n=new te(t,e,i,s):n=t,this.w0(n),n}Ca(t,e,i,s,n){let o;return typeof t=="string"?o=new ii(t,e,i,s,n):o=t,this.w0(o),o}w0(t){t.Ti=this;let e=this.panel;if(e!==null){let i=e.findBindingPanel();i!==null&&i.rD()&&m.o("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+t+" on "+e)}this.Fs===null&&(this.Fs=new q),this.Fs.add(t)}}class et extends ${ut;tn;zd;Kh;Qe;Zo;jo;Kt;Xd;Gd;K;constructor(t,e){super(),this.ut=null,this.tn=null,this.zd="None",this.Kh="black",this.Qe="black",this.Zo=1,this.jo=null,this.Kt=null,this.Xd=NaN,this.Gd=NaN,this.K=null,typeof t=="string"?this.figure=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.ut=this.ut,t.tn=this.tn,t.zd=this.zd,t.Kh=this.Kh,t.Qe=this.Qe,t.Zo=this.Zo,this.jo!==null&&(t.jo=this.jo.slice()),this.Kt!==null&&(this.Kt.me?t.Kt=this.Kt:t.Kt=this.Kt.copy()),t.Xd=this.Xd,t.Gd=this.Gd,this.K!==null&&(t.K=this.K.copy())}Hh(){return this.Kt===null?this.Kt=new Ki:this.Kt.me&&(this.Kt=this.Kt.copy()),this.Kt}ba(){super.ba(),this.Kt!==null&&(this.Kt.me=!0)}fe(t){t in Ri?this.geometryStretch=t:super.fe(t)}toString(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+V.xs(this)}_I(t,e){let i=this.pathPattern;if(i===null)return;i.ht(1/0,1/0);let s=i.measuredBounds;i.Ut(0,0,s.width,s.height);let n=this.geometry;if(n===null)return;t.save(),t.beginPath();let o=m.nt();if(n.type===1)o.push(n.startX),o.push(n.startY),o.push(n.endX),o.push(n.endY),this.Yd(t,e,o,i);else if(n.type===4){let r=n.figures.iterator;for(;r.next();){let a=r.value;o.length=0,o.push(a.startX),o.push(a.startY);let h=a.startX,l=a.startY,u=h,c=l,d=a.segments.r,f=d.length;for(let p=0;p<f;p++){let g=d[p];switch(g.type){case 1:this.Yd(t,e,o,i),o.length=0,o.push(g.endX),o.push(g.endY),h=g.endX,l=g.endY,u=h,c=l;break;case 2:o.push(g.endX),o.push(g.endY),h=g.endX,l=g.endY;break;case 3:C.jn(h,l,g.point1X,g.point1Y,g.point2X,g.point2Y,g.endX,g.endY,.5,o),h=g.endX,l=g.endY;break;case 4:C.nm(h,l,g.point1X,g.point1Y,g.endX,g.endY,.5,o),h=g.endX,l=g.endY;break;case 5:{let y=g.vo(a),b=y.length;if(b===0){o.push(g.centerX),o.push(g.centerY),h=g.centerX,l=g.centerY;break}for(let v=0;v<b;v++){let w=y[v];C.jn(h,l,w[2],w[3],w[4],w[5],w[6],w[7],.5,o),h=w[6],l=w[7]}break}case 6:{let y=g.Za(a,h,l),b=y.length;if(b===0){o.push(g.endX),o.push(g.endY),h=g.endX,l=g.endY;break}for(let v=0;v<b;v++){let w=y[v];C.jn(h,l,w[2],w[3],w[4],w[5],w[6],w[7],.5,o),h=w[6],l=w[7]}break}default:m.o("Segment not of valid type: "+g.type)}g.isClosed&&(o.push(u),o.push(c),this.Yd(t,e,o,i))}this.Yd(t,e,o,i)}}else if(n.type===2)o.push(n.startX),o.push(n.startY),o.push(n.endX),o.push(n.startY),o.push(n.endX),o.push(n.endY),o.push(n.startX),o.push(n.endY),o.push(n.startX),o.push(n.startY),this.Yd(t,e,o,i);else if(n.type===3){let r=new Kt;r.startX=n.endX,r.startY=(n.startY+n.endY)/2;let a=new mt(5);a.startAngle=0,a.sweepAngle=360,a.centerX=(n.startX+n.endX)/2,a.centerY=(n.startY+n.endY)/2,a.radiusX=Math.abs(n.startX-n.endX)/2,a.radiusY=Math.abs(n.startY-n.endY)/2,r.add(a);let h=a.vo(r),l=h.length;if(l===0)o.push(a.centerX),o.push(a.centerY);else{let u=r.startX,c=r.startY;for(let d=0;d<l;d++){let f=h[d];C.jn(u,c,f[2],f[3],f[4],f[5],f[6],f[7],.5,o),u=f[6],c=f[7]}}this.Yd(t,e,o,i)}m.Z(o),t.restore(),t.clearContextCache(!1)}tE(t){let e=t.measuredBounds.width;return t instanceof et&&(e-=t.strokeWidth),e<1&&(e=1),e}Yd(t,e,i,s){let n=i.length;if(n<4)return;let o=s.measuredBounds,r=Math.max(1,o.width),a=o.height,h=i[0],l=i[1],u=0,c=0,d=0,f=0,p=0,g=0,y=0,b=0,v=m.nt();for(let A=2;A<n;A+=2)u=i[A],c=i[A+1],d=u-h,f=c-l,d===0&&(d=.001),p=f/d,g=Math.atan2(f,d),y=Math.sqrt(d*d+f*f),v.push([d,g,p,y]),b+=y,h=u,l=c;h=i[0],l=i[1];let w=this.tE(s),k=w,S=r/2,N=S!==0,D=0,L=v[D];d=L[0],g=L[1],p=L[2],y=L[3];let M=0;for(;b>=.1;){if(M===0&&(N?(k=w,k-=S,b-=S,N=!1):k=w,k===0&&(k=1)),k>b){k=b,m.Z(v);return}k>y?(M=k-y,k=y):M=0;let A=Math.sqrt(k*k/(1+p*p));if(d<0&&(A=-A),h+=A,l+=p*A,t.translate(h,l),t.rotate(g),t.translate(-(r/2),-(a/2)),M===0&&s.Ma(t,e),t.translate(r/2,a/2),t.rotate(-g),t.translate(-h,-l),b-=k,y-=k,M!==0){if(D++,D===v.length){m.Z(v);return}L=v[D],d=L[0],g=L[1],p=L[2],y=L[3],k=M}}m.Z(v)}Ma(t,e){let i=t instanceof re,s=this.Qe,n=this.Kh;if(s===null&&n===null)return;let o=this.ut;if(o===null)return;t.commitTransform();let r=this.actualBounds,a=this.naturalBounds;n!==null&&this.bn(t,n,!0,!1,a,r);let h=this.part,l=this.Zo;s!==null&&l===0&&h!==null&&(this.isPanelMain||h.findMainElement()===this)&&(l=h.eE()),l===0&&(s=null),s!==null&&l!==0&&(this.bn(t,s,!1,!1,a,r),t.lineWidth=l,t.lineJoin=this.strokeJoin,t.lineCap=this.strokeCap,t.miterLimit=this.strokeMiterLimit);let u=!1;h&&e.getRenderingHint("drawShadows")&&(u=h.isShadowed),t.ol===!1&&(u=!1);let c=!0;s!==null&&(n===null||n==="transparent")&&(c=!1);let d=!1,f=this.strokeDashArray;if(f!==null&&(d=!0,t.enableDash(f,this.strokeDashOffset)),o.type===1)t.beginPath(),t.moveTo(o.startX,o.startY),t.lineTo(o.endX,o.endY),s!==null&&t.strokeContext(),t.endPath();else if(o.type===2){let p=o.startX,g=o.startY,y=o.endX,b=o.endY,v=Math.min(p,y),w=Math.min(g,b),k=Math.abs(y-p),S=Math.abs(b-g);t.beginPath(),t.rect(v,w,k,S),n!==null&&t.fillContext(n,!1,null),s!==null&&(c&&u&&t.shadowsOff(),t.strokeContext(),c&&u&&t.shadowsOn()),t.endPath()}else if(o.type===3){let p=o.startX,g=o.startY,y=o.endX,b=o.endY,v=Math.abs(y-p)/2,w=Math.abs(b-g)/2,k=Math.min(p,y)+v,S=Math.min(g,b)+w;t.beginPath(),t.moveTo(k,S-w),t.bezierCurveTo(k+C.qn*v,S-w,k+v,S-C.qn*w,k+v,S),t.bezierCurveTo(k+v,S+C.qn*w,k+C.qn*v,S+w,k,S+w),t.bezierCurveTo(k-C.qn*v,S+w,k-v,S+C.qn*w,k-v,S),t.bezierCurveTo(k-v,S-C.qn*w,k-C.qn*v,S-w,k,S-w),t.closePath(),n!==null&&t.fillContext(n,!1,null),s!==null&&(c&&u&&t.shadowsOff(),t.strokeContext(),c&&u&&t.shadowsOn()),t.endPath()}else if(o.type===4){let p=o.figures,g=p.length;for(let y=0;y<g;y++){let b=p.r[y];i?(t.beginPath(),this.SD(t,b)):b.Hi===null&&(b.Hi=new Path2D,this.SD(b.Hi,b));let v=b.isFilled;u?b.isShadowed?(v===!0&&n!=="transparent"&&n!==null&&t.fillContext(n,b.isEvenOdd,b.Hi),s!==null&&(v&&c&&t.shadowsOff(),t.stroke(b.Hi),v&&c&&t.shadowsOn())):(t.shadowsOff(),v&&n!=="transparent"&&n!==null&&t.fillContext(n,b.isEvenOdd,b.Hi),s!==null&&t.stroke(b.Hi),t.shadowsOn()):(v&&n!==null&&t.fillContext(n,b.isEvenOdd,b.Hi),s!==null&&t.stroke(b.Hi)),t.endPath(y)}}d&&t.disableDash(),this._I(t,e)}SD(t,e){t.moveTo(e.startX,e.startY);let i=e.segments.r,s=i.length,n=null;for(let o=0;o<s;o++){let r=i[o];switch(r.type){case 1:t.moveTo(r.endX,r.endY);break;case 2:t.lineTo(r.endX,r.endY);break;case 3:t.bezierCurveTo(r.point1X,r.point1Y,r.point2X,r.point2Y,r.endX,r.endY);break;case 4:t.quadraticCurveTo(r.point1X,r.point1Y,r.endX,r.endY);break;case 5:if(r.radiusX===r.radiusY){let a=n!==null?n.endX:e.startX,h=n!==null?n.endY:e.startY,l=Math.PI/180;t.arc(r.point1X,r.point1Y,r.radiusX,r.startAngle*l,(r.startAngle+r.sweepAngle)*l,r.sweepAngle<0,a,h)}else{let a=r.vo(e),h=a.length;if(h===0){t.lineTo(r.centerX,r.centerY);break}for(let l=0;l<h;l++){let u=a[l];l===0&&t.lineTo(u[0],u[1]),t.bezierCurveTo(u[2],u[3],u[4],u[5],u[6],u[7])}}break;case 6:{let a=0,h=0,l;if(n!==null&&n.type===5){l=n.vo(e);let c=l.length;if(c===0){t.lineTo(r.endX,r.endY);break}let d=l[c-1]||null;d!==null&&(a=d[6],h=d[7])}else a=n!==null?n.endX:e.startX,h=n!==null?n.endY:e.startY;l=r.Za(e,a,h);let u=l.length;if(u===0){t.lineTo(r.endX,r.endY);break}for(let c=0;c<u;c++){let d=l[c];t.bezierCurveTo(d[2],d[3],d[4],d[5],d[6],d[7])}break}}r.isClosed&&t.closePath(),n=r}}yf(t,e,i){if(!super.yf(t,e,i)||this.Qe===null&&this.Kh===null||this.ut===null||this.pathPattern!==null)return!1;let s=this.svg.getElementsByTagName("path");return this.geometry.figures.length!==s.length?!1:(t.currentPath=this.svg,this.Ma(t,e),t.currentPath=null,!0)}Pd(t){return this.geometry!==null&&this.geometry.figures.length>1||this.pathPattern!==null?!0:super.Pd(t)}AN(t,e){if(t.nodeName!=="g")t.setAttributeNS(null,"filter",e);else{let i=t.getElementsByTagName("path");for(let s=0;s<i.length;s++)i[s].setAttributeNS(null,"filter",e)}}getDocumentPoint(t,e){if(e===void 0&&(e=new P),t instanceof T){let i=t;i.isNoSpot()&&m.o("getDocumentPoint Spot must be a real, specific Spot, not: "+i.toString());let s=this.naturalBounds,n=this.strokeWidth;return e.e(i.x*(s.width+n)-n/2+s.x+i.offsetX,i.y*(s.height+n)-n/2+s.y+i.offsetY),this.Ws.gt(e),e}else return e.set(t),this.Ws.gt(e),e}getDocumentBounds(t){t===void 0&&(t=new I);let e=this.naturalBounds,i=this.Ws,s=I.z(e.x,e.y,e.width,e.height),n=this.strokeWidth;s.inflate(n/2,n/2);let o=P.z(s.x,s.y).v(i);return t.e(o.x,o.y,0,0),o.e(s.right,s.y).v(i),t.re(o.x,o.y,0,0),o.e(s.right,s.bottom).v(i),t.re(o.x,o.y,0,0),o.e(s.x,s.bottom).v(i),t.re(o.x,o.y,0,0),I.i(s),P.i(o),t}ka(t,e){let i=this.geometry;if(i===null||this.fill===null&&this.stroke===null)return!1;let s=i.bounds,n=this.strokeWidth/2;i.type===1&&!e&&(n+=2);let o=I.l();if(o.h(s),o.inflate(n+2,n+2),!o.containsPoint(t))return I.i(o),!1;let r=n+1e-4;if(i.type===1){if(this.stroke===null)return!1;let a=(i.startX-i.endX)*(t.x-i.endX)+(i.startY-i.endY)*(t.y-i.endY),h=(i.endX-i.startX)*(t.x-i.startX)+(i.endY-i.startY)*(t.y-i.startY);return a<0||h<0?!1:(I.i(o),C.Ve(i.startX,i.startY,i.endX,i.endY,n,t.x,t.y))}else if(i.type===2){let a=i.startX,h=i.startY,l=i.endX,u=i.endY;if(o.x=Math.min(a,l),o.y=Math.min(h,u),o.width=Math.abs(l-a),o.height=Math.abs(u-h),this.fill===null){if(o.inflate(-r,-r),o.containsPoint(t))return I.i(o),!1;o.inflate(r,r)}this.stroke!==null&&o.inflate(n,n);let c=o.containsPoint(t);return I.i(o),c}else if(i.type===3){let a=i.startX,h=i.startY,l=i.endX,u=i.endY,c=Math.min(a,l),d=Math.min(h,u),f=Math.abs(l-a),p=Math.abs(u-h),g=f/2,y=p/2;if(c=t.x-(c+g),d=t.y-(d+y),this.fill===null){if(g-=r,y-=r,g<=0||y<=0||c*c/(g*g)+d*d/(y*y)<=1)return I.i(o),!1;g+=r,y+=r}return this.stroke!==null&&(g+=r,y+=r),I.i(o),g<=0||y<=0?!1:c*c/(g*g)+d*d/(y*y)<=1}else{if(i.type===4)return I.i(o),this.fill===null?i._L(t.x,t.y,n):i.VP(t,n,this.strokeWidth>1,e);m.o("Unknown Geometry type: "+i.type)}}bd(t,e,i,s){let n=this.desiredSize,o=this.Zo;t=Math.max(t,0),e=Math.max(e,0);let r;if(this.tn!==null)r=this.geometry.bounds;else{let p=this.figure,g=et.sC[p];if(g===void 0){let y=C.Wn[p];typeof y=="string"&&(y=C.Wn[y]),m.st(y)?(g=y(null,100,100),et.sC[p]=g):m.o("Unsupported Figure: "+p)}r=g.bounds}let a=r.width,h=r.height,l=r.width,u=r.height;switch(this.Zs(!0)){case 0:i=0,s=0;break;case 2:l=Math.max(t-o,0),u=Math.max(e-o,0);break;case 5:l=Math.max(t-o,0),s=0;break;case 4:i=0,u=Math.max(e-o,0);break}isFinite(n.width)&&(l=n.width),isFinite(n.height)&&(u=n.height);let c=this.maxSize,d=this.minSize;i=Math.max(i-o,d.width),s=Math.max(s-o,d.height),l=Math.min(c.width,l),u=Math.min(c.height,u),l=isFinite(l)?Math.max(i,l):Math.max(a,i),u=isFinite(u)?Math.max(s,u):Math.max(h,s);let f=this.tM();switch(f){case 0:break;case 2:a=l,h=u;break;case 6:{let p=Math.min(l/a,u/h);isFinite(p)||(p=1),a=a*p,h=h*p;break}default:m.o(f+" is not a valid geometryStretch.")}if(this.tn!==null){a===0&&(a=.001),h===0&&(h=.001);let p=this.tn.nR(a,h);this.ut=p}else(this.ut===null||!C.X(this.ut.Pc,t-o)||!C.X(this.ut.Sc,e-o))&&(this.ut=et.iE(this,a,h));r=this.ut.bounds,t===1/0||e===1/0?this.ro(r.x-o/2,r.y-o/2,t===0&&a===0?0:r.width+o,e===0&&h===0?0:r.height+o):this.ro(-(o/2),-(o/2),l+o,u+o),n.isReal()?(l=n.width,u=n.height,l=Math.min(c.width,l),u=Math.min(c.height,u),l=Math.max(d.width,l),u=Math.max(d.height,u),this.Ke.e(0,0,l,u)):this.Ke.h(r)}tM(){let t=this.geometryStretch;return this.tn!==null?t===1?2:t:t===1?et.sC[this.figure].defaultStretch:t}Pa(t,e,i,s){this.commonArrange(t,e,i,s)}getNearestIntersectionPoint(t,e,i){return this.mf(t.x,t.y,e.x,e.y,i)}mf(t,e,i,s,n){let o=this.v,r=1/(o.m11*o.m22-o.m12*o.m21),a=o.m22*r,h=-o.m12*r,l=-o.m21*r,u=o.m11*r,c=r*(o.m21*o.dy-o.m22*o.dx),d=r*(o.m12*o.dx-o.m11*o.dy),f=t*a+e*l+c,p=t*h+e*u+d,g=i*a+s*l+c,y=i*h+s*u+d,b=this.Zo/2,v=this.ut;v===null&&(this.ht(1/0,1/0),v=this.ut);let w=v.bounds,k=!1;if(v.type===1)if(this.strokeWidth<=1.5)k=C.Do(v.startX,v.startY,v.endX,v.endY,f,p,g,y,n);else{let S=0,N=0;if(v.startX===v.endX)S=b,N=0;else{let F=(v.endY-v.startY)/(v.endX-v.startX);N=b/Math.sqrt(1+F*F),S=N*F}let D=m.nt(),L=new P;C.Do(v.startX+S,v.startY+N,v.endX+S,v.endY+N,f,p,g,y,L)&&D.push(L),L=new P,C.Do(v.startX-S,v.startY-N,v.endX-S,v.endY-N,f,p,g,y,L)&&D.push(L),L=new P,C.Do(v.startX+S,v.startY+N,v.startX-S,v.startY-N,f,p,g,y,L)&&D.push(L),L=new P,C.Do(v.endX+S,v.endY+N,v.endX-S,v.endY-N,f,p,g,y,L)&&D.push(L);let M=D.length;if(M===0)return m.Z(D),!1;k=!0;let A=1/0;for(let F=0;F<M;F++){let O=D[F],E=(O.x-f)**2+(O.y-p)**2;E<A&&(A=E,n.x=O.x,n.y=O.y)}m.Z(D)}else if(v.type===2)k=C.Cl(w.x-b,w.y-b,w.x+w.width+b,w.y+w.height+b,f,p,g,y,n);else if(v.type===3){let S=I.z(w.x,w.y,w.width,w.height).inflate(b,b);k=this.sE(S,f,p,g,y,n),I.i(S)}else if(v.type===4){let S=0,N=0,D=0,L=0,M=P.l(),A=g-f,F=y-p,O=A*A+F*F,E=f,B=p;if(O>0&&w.contains(E,B)&&(M.x=E,M.y=B,this.containsPoint(M)))for(A!==0&&Math.abs(A)<.5?(F*=.5/A,A=.5):F!==0&&Math.abs(F)<.5&&(A*=.5/F,F=.5),E-=A,B-=F;w.contains(E,B);)E-=A,B-=F;let K=.6;n.x=g,n.y=y;for(let nt=0;nt<v.figures.count;nt++){let Z=v.figures.r[nt],it=Z.isFilled?E:f,_=Z.isFilled?B:p,at=Z.segments;S=Z.startX,N=Z.startY;let ct=S,yt=N;for(let Ct=0;Ct<at.count;Ct++){let Q=at.r[Ct],St=Q.type;D=Q.endX,L=Q.endY;let xt=!1;switch(St){case 1:ct=D,yt=L;break;case 2:xt=this._1(S,N,D,L,it,_,g,y,M);break;case 3:{xt=C.om(S,N,Q.point1X,Q.point1Y,Q.point2X,Q.point2Y,D,L,it,_,g,y,K,M);break}case 4:{xt=C.om(S,N,S+2/3*(Q.point1X-S),N+2/3*(Q.point1Y-N),D+2/3*(Q.point1X-D),L+2/3*(Q.point1Y-L),D,L,it,_,g,y,K,M);break}case 5:case 6:{let Yt=Q.type===5?Q.vo(Z):Q.Za(Z,S,N),ot=Yt.length;if(ot===0){xt=this._1(S,N,Q.type===5?Q.centerX:Q.endX,Q.type===5?Q.centerY:Q.endY,it,_,g,y,M);break}let W=null;for(let ft=0;ft<ot;ft++){if(W=Yt[ft],ft===0&&this._1(S,N,W[0],W[1],it,_,g,y,M)){let At=this.tk(it,_,M,O,n);At<O&&(O=At,k=!0)}if(C.om(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],it,_,g,y,K,M)){let At=this.tk(it,_,M,O,n);At<O&&(O=At,k=!0)}}D=W[6],L=W[7];break}default:m.o("Unknown Segment type: "+St)}if(S=D,N=L,xt){let Yt=this.tk(it,_,M,O,n);Yt<O&&(O=Yt,k=!0)}if(Q.isClosed&&(D=ct,L=yt,this._1(S,N,D,L,it,_,g,y,M))){let Yt=this.tk(it,_,M,O,n);Yt<O&&(O=Yt,k=!0)}}}let z=i-t,U=s-e,tt=Math.sqrt(z*z+U*U);tt!==0&&(z/=tt,U/=tt),n.x-=z*b,n.y-=U*b,P.i(M)}else m.o("Unknown Geometry type: "+v.type);return k?(this.v.gt(n),!0):!1}tk(t,e,i,s,n){let o=i.x-t,r=i.y-e,a=o*o+r*r;return a<s?(n.x=i.x,n.y=i.y,a):s}_1(t,e,i,s,n,o,r,a,h){if(C.X(t,i)&&C.X(e,s)||C.X(n,r)&&C.X(o,a))return!1;let l=!1,u=(n-r)*(e-s)-(o-a)*(t-i);if(u===0)return!1;if(h.x=((n*a-o*r)*(t-i)-(n-r)*(t*s-e*i))/u,h.y=((n*a-o*r)*(e-s)-(o-a)*(t*s-e*i))/u,(t>i?t-i:i-t)<(e>s?e-s:s-e)){let c=e<s?e:s,d=e<s?s:e;(h.y>c||C.X(h.y,c))&&(h.y<d||C.X(h.y,d))&&(l=!0)}else{let c=t<i?t:i,d=t<i?i:t;(h.x>c||C.X(h.x,c))&&(h.x<d||C.X(h.x,d))&&(l=!0)}return l}nE(t,e,i){return this.pickable===!1?!1:(i.bc(this.v),e?this.oE(t,i):this.containedInRect(t,i))}containedInRect(t,e){if(e===void 0)return t.containsRect(this.actualBounds);let i=this.ut;i===null&&(this.ht(1/0,1/0),i=this.ut);let s=i.bounds,n=this.strokeWidth/2,o=!1,r=P.l();return r.e(s.x-n,s.y-n),t.containsPoint(e.gt(r))&&(r.e(s.x-n,s.bottom+n),t.containsPoint(e.gt(r))&&(r.e(s.right+n,s.bottom+n),t.containsPoint(e.gt(r))&&(r.e(s.right+n,s.y-n),t.containsPoint(e.gt(r))&&(o=!0)))),P.i(r),o}intersectsRect(t,e){if(this.containedInRect(t,e)||e===void 0&&(e=this.v,t.containsRect(this.actualBounds)))return!0;let i=Nt.l();i.set(e),i.ex();let s=t.left,n=t.right,o=t.top,r=t.bottom,a=P.l();if(a.e(s,o),i.gt(a),this.ka(a,!0)||(a.e(n,o),i.gt(a),this.ka(a,!0))||(a.e(s,r),i.gt(a),this.ka(a,!0))||(a.e(n,r),i.gt(a),this.ka(a,!0)))return P.i(a),!0;let h=P.l(),l=P.l();i.set(e),i.GL(this.v),i.ex(),h.x=n,h.y=o,h.v(i),a.x=s,a.y=o,a.v(i);let u=!1;return this.qh(a,h,l)?u=!0:(a.x=n,a.y=r,a.v(i),this.qh(a,h,l)?u=!0:(h.x=s,h.y=r,h.v(i),this.qh(a,h,l)?u=!0:(a.x=s,a.y=o,a.v(i),this.qh(a,h,l)&&(u=!0)))),P.i(a),Nt.i(i),P.i(h),P.i(l),u}qh(t,e,i){if(!this.getNearestIntersectionPoint(t,e,i))return!1;let s=t.x,n=t.y,o=e.x,r=e.y,a=i.x,h=i.y;if(s===o){let l=0,u=0;return n<r?(l=n,u=r):(l=r,u=n),h>=l&&h<=u}else{let l=0,u=0;return s<o?(l=s,u=o):(l=o,u=s),a>=l&&a<=u}}oE(t,e){if(this.containedInRect(t,e)||e===void 0&&(e=this.v,t.containsRect(this.actualBounds)))return!0;let i=t.left,s=t.right,n=t.top,o=t.bottom,r=P.l(),a=P.l(),h=P.l(),l=Nt.l();l.set(e),l.GL(this.v),l.ex(),a.x=s,a.y=n,a.v(l),r.x=i,r.y=n,r.v(l);let u=!1;return this.qh(r,a,h)?u=!0:(r.x=s,r.y=o,r.v(l),this.qh(r,a,h)?u=!0:(a.x=i,a.y=o,a.v(l),this.qh(r,a,h)?u=!0:(r.x=i,r.y=n,r.v(l),this.qh(r,a,h)&&(u=!0)))),Nt.i(l),P.i(r),P.i(a),P.i(h),u}QT(t,e,i){if(i&&this.fill!==null&&this.ka(t,!0))return!0;let s=t.distanceSquaredPoint(e),n=s;this.strokeWidth>1.5&&(s=this.strokeWidth/2+Math.sqrt(s),s*=s);let o=this.ut;if(o===null&&(this.ht(1/0,1/0),o=this.ut,o===null))return!1;if(!i){let c=o.bounds,d=c.x,f=c.y,p=c.x+c.width,g=c.y+c.height;if(P.distanceSquared(t.x,t.y,d,f)<=s&&P.distanceSquared(t.x,t.y,p,f)<=s&&P.distanceSquared(t.x,t.y,d,g)<=s&&P.distanceSquared(t.x,t.y,p,g)<=s)return!0}function r(c,d){let f=c.length;for(let p=0;p<f;p+=2)if(d.distanceSquared(c[p],c[p+1])>s)return!0;return!1}let a=o.startX,h=o.startY,l=o.endX,u=o.endY;if(o.type===1){let c=P.distanceLineSegmentSquared(t.x,t.y,a,h,l,u),d=(l-a)*(t.x-a)+(u-h)*(t.y-h),f=(a-l)*(t.x-l)+(h-u)*(t.y-u),p=d>=0&&f>=0?s:n;return c<=p}else if(o.type===2){let c=!1;return i&&(c=P.distanceLineSegmentSquared(t.x,t.y,a,h,a,u)<=s||P.distanceLineSegmentSquared(t.x,t.y,a,h,l,h)<=s||P.distanceLineSegmentSquared(t.x,t.y,l,h,l,u)<=s||P.distanceLineSegmentSquared(t.x,t.y,a,u,l,u)<=s),c}else if(o.type===3){let c=(a+l)/2,d=(h+u)/2,f=t.x-c,p=t.y-d,g=Math.abs(l-a)/2,y=Math.abs(u-h)/2;if(g===0||y===0)return P.distanceLineSegmentSquared(t.x,t.y,a,h,l,u)<=s;if(i){let b=C.JF(g,y,f,p);return b*b<=s}else return!(P.distanceSquared(f,p,-g,0)>=s||P.distanceSquared(f,p,0,-y)>=s||P.distanceSquared(f,p,0,y)>=s||P.distanceSquared(f,p,g,0)>=s)}else if(o.type===4){let c=o.bounds,d=c.x,f=c.y,p=c.x+c.width,g=c.y+c.height;if(t.x>p&&t.x<d&&t.y>g&&t.y<f&&P.distanceLineSegmentSquared(t.x,t.y,d,f,d,g)>s&&P.distanceLineSegmentSquared(t.x,t.y,d,f,p,f)>s&&P.distanceLineSegmentSquared(t.x,t.y,p,g,d,g)>s&&P.distanceLineSegmentSquared(t.x,t.y,p,g,p,f)>s)return!1;let y=Math.sqrt(s);if(i){if(this.fill===null?o._L(t.x,t.y,y):o.VP(t,y,!0,!1))return!0}else{let b=o.figures;for(let v=0;v<b.count;v++){let w=b.r[v],k=w.startX,S=w.startY;if(t.distanceSquared(k,S)>s)return!1;let N=w.segments.r,D=N.length;for(let L=0;L<D;L++){let M=N[L];switch(M.type){case 1:case 2:if(k=M.endX,S=M.endY,t.distanceSquared(k,S)>s)return!1;break;case 3:{let A=m.nt();C.jn(k,S,M.point1X,M.point1Y,M.point2X,M.point2Y,M.endX,M.endY,.8,A);let F=r(A,t);if(m.Z(A),F||(k=M.endX,S=M.endY,t.distanceSquared(k,S)>s))return!1;break}case 4:{let A=m.nt();C.nm(k,S,M.point1X,M.point1Y,M.endX,M.endY,.8,A);let F=r(A,t);if(m.Z(A),F||(k=M.endX,S=M.endY,t.distanceSquared(k,S)>s))return!1;break}case 5:case 6:{let A=M.type===5?M.vo(w):M.Za(w,k,S),F=A.length;if(F===0){if(k=M.type===5?M.centerX:M.endX,S=M.type===5?M.centerY:M.endY,t.distanceSquared(k,S)>s)return!1;break}let O=null,E=m.nt();for(let B=0;B<F;B++)if(O=A[B],E.length=0,C.jn(O[0],O[1],O[2],O[3],O[4],O[5],O[6],O[7],.8,E),r(E,t))return m.Z(E),!1;m.Z(E),O!==null&&(k=O[6],S=O[7]);break}default:m.o("Unknown Segment type: "+M.type)}}}return!0}}return!1}sE(t,e,i,s,n,o){if(t.width===0)return C.Do(t.x,t.y,t.x,t.y+t.height,e,i,s,n,o);if(t.height===0)return C.Do(t.x,t.y,t.x+t.width,t.y,e,i,s,n,o);{let r=t.width/2,a=t.height/2,h=t.x+r,l=t.y+a,u=9999;if(e!==s&&(u=(i-n)/(e-s)),Math.abs(u)<9999){let c=i-l-u*(e-h);if(r*r*(u*u)+a*a-c*c<0)return o.x=NaN,o.y=NaN,!1;let d=Math.sqrt(r*r*(u*u)+a*a-c*c),f=(-(r*r*u*c)+r*a*d)/(a*a+r*r*(u*u))+h,p=(-(r*r*u*c)-r*a*d)/(a*a+r*r*(u*u))+h,g=u*(f-h)+c+l,y=u*(p-h)+c+l,b=Math.abs((e-f)**2)+Math.abs((i-g)**2),v=Math.abs((e-p)**2)+Math.abs((i-y)**2);b<v?(o.x=f,o.y=g):(o.x=p,o.y=y)}else{let c=a*a,d=r*r,f=e-h,p=c-c/d*(f*f);if(p<0)return o.x=NaN,o.y=NaN,!1;let g=Math.sqrt(p),y=l+g,b=l-g,v=Math.abs(y-i),w=Math.abs(b-i);v<w?(o.x=e,o.y=y):(o.x=e,o.y=b)}return!0}}jI(){return this.Zo/2*this.strokeMiterLimit*this.getDocumentScale()}get geometry(){return this.ut!==null?this.ut:this.tn}set geometry(t){let e=this.ut,i=this.tn;if(e===t)return;t!==null?(this.ut=t.k(),this.tn=this.ut):(this.ut=null,this.tn=null);let s=this.part;if(s!==null&&s.Tf(),this.f(),this.t("geometry",e||i,t),this.gf()){let n=this.part;n!==null&&this.Eh(n,"geometryString")}}get geometryString(){return this.geometry===null?"":this.geometry.toString()}set geometryString(t){let e=wt.parse(t),i=e.normalize();this.geometry=e;let s=P.z(-i.x,-i.y);this.position=s,P.i(s)}get isGeometryPositioned(){return(this.n&1048576)!==0}set isGeometryPositioned(t){let e=(this.n&1048576)!==0;e!==t&&(this.n=this.n^1048576,this.f(),this.t("isGeometryPositioned",e,t))}ai(){this.ut=null}get fill(){return this.Kh}set fill(t){let e=this.Kh;e!==t&&(t!==null&&R.Md(t,"Shape.fill"),t instanceof R&&t.k(),this.Kh=t,this.C(),this.t("fill",e,t))}get stroke(){return this.Qe}set stroke(t){let e=this.Qe;e!==t&&(t!==null&&R.Md(t,"Shape.stroke"),t instanceof R&&t.k(),this.Qe=t,this.C(),this.t("stroke",e,t))}get strokeWidth(){return this.Zo}set strokeWidth(t){let e=this.Zo;if(e!==t)if(t>=0){this.Zo=t,this.f();let i=this.part;i!==null&&i.Tf(),this.t("strokeWidth",e,t)}else m.J(t,"value >= 0",et,"strokeWidth:value")}qp(){return this.Zo}get strokeCap(){return this.Kt!==null?this.Kt.Y0:"butt"}set strokeCap(t){let e=this.strokeCap;e!==t&&(typeof t=="string"&&(t==="butt"||t==="round"||t==="square")?(this.Hh().Y0=t,this.C(),this.t("strokeCap",e,t)):m.J(t,'"butt", "round", or "square"',et,"strokeCap"))}get strokeJoin(){return this.Kt!==null?this.Kt.K0:"miter"}set strokeJoin(t){let e=this.strokeJoin;e!==t&&(typeof t=="string"&&(t==="miter"||t==="bevel"||t==="round")?(this.Hh().K0=t,this.C(),this.t("strokeJoin",e,t)):m.J(t,'"miter", "bevel", or "round"',et,"strokeJoin"))}get strokeMiterLimit(){return this.Kt!==null?this.Kt.H0:10}set strokeMiterLimit(t){let e=this.strokeMiterLimit;if(e!==t&&t>=1){this.Hh().H0=t,this.C();let i=this.part;i!==null&&i.Tf(),this.t("strokeMiterLimit",e,t)}}get strokeDashArray(){return this.jo}set strokeDashArray(t){let e=this.jo;if(e!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",et,"strokeDashArray:value"),t!==null){let i=t.length,s=0;for(let n=0;n<i;n++){let o=t[n];(!(o>=0)||!isFinite(o))&&m.o("strokeDashArray:value "+o+" at index "+n+" must be a positive number or zero."),s+=o}if(s===0){if(e===null)return;t=null}}this.jo=t,this.C(),this.t("strokeDashArray",e,t)}}get strokeDashOffset(){return this.Kt!==null?this.Kt.La:0}set strokeDashOffset(t){let e=this.strokeDashOffset;e!==t&&t>=0&&(this.Hh().La=t,this.C(),this.t("strokeDashOffset",e,t))}get figure(){return this.zd}set figure(t){let e=this.zd;if(e!==t){let i=C.Wn[t];if(m.st(i)?i=t:(i=C.Wn[t.toLowerCase()],(!i||typeof i=="function")&&m.o("Unknown Shape.figure: "+t)),e!==i){let s=this.part;s!==null&&s.Tf(),this.zd=i,this.tn=null,this.ai(),this.f(),this.t("figure",e,i)}}}get toArrow(){return this.Ot!==null?this.Ot.q0:"None"}set toArrow(t){let e=this.toArrow;if(t===!0?t="Standard":t===!1&&(t=""),e!==t){let i=et.MD(t);i===null?m.o("Unknown Shape.toArrow: "+t):e!==i&&(this.Ot===null&&(this.Ot=new Re),this.Ot.q0=i,this.tn=null,this.ai(),this.f(),this.ND(i),this.t("toArrow",e,i))}}get fromArrow(){return this.Ot!==null?this.Ot.j0:"None"}set fromArrow(t){let e=this.fromArrow;if(t===!0?t="Standard":t===!1&&(t=""),e!==t){let i=et.MD(t);i===null?m.o("Unknown Shape.fromArrow: "+t):e!==i&&(this.Ot===null&&(this.Ot=new Re),this.Ot.j0=i,this.tn=null,this.ai(),this.f(),this.ND(i),this.t("fromArrow",e,i))}}ND(t){let e=this.diagram;e!==null&&e.undoManager.isUndoingRedoing||(this.pI(),this.toArrow!=="None"?(this.segmentIndex=-1,this.alignmentFocus=T.Right):this.fromArrow!=="None"&&(this.segmentIndex=0,this.alignmentFocus=T.Left))}get spot1(){return this.Kt!==null?this.Kt.Jn:T.Default}set spot1(t){let e=this.spot1;e.equals(t)||(t=t.N(),this.Hh().Jn=t,this.f(),this.t("spot1",e,t))}get spot2(){return this.Kt!==null?this.Kt.$n:T.Default}set spot2(t){let e=this.spot2;e.equals(t)||(t=t.N(),this.Hh().$n=t,this.f(),this.t("spot2",e,t))}get parameter1(){return this.Xd}set parameter1(t){let e=this.Xd;e!==t&&(this.Xd=t,this.ai(),this.f(),this.t("parameter1",e,t))}get parameter2(){return this.Gd}set parameter2(t){let e=this.Gd;e!==t&&(this.Gd=t,this.ai(),this.f(),this.t("parameter2",e,t))}get naturalBounds(){return this.Ke}UI(){let t=this.desiredSize;if(!t.isReal()&&this.ut!==null){let e=this.ut.bounds;this.Ke.h(e)}else this.Ke.e(0,0,t.width,t.height)}get pathPattern(){return this.Kt!==null?this.Kt.W0:null}set pathPattern(t){let e=this.pathPattern;e!==t&&(this.Hh().W0=t,this.C(),this.t("pathPattern",e,t))}get geometryStretch(){return this.Kt!==null?this.Kt.J0:1}set geometryStretch(t){let e=this.geometryStretch;e!==t&&(this.Hh().J0=t,this.f(),this.t("geometryStretch",e,t))}get interval(){return this.K!==null?this.K.vf:1}set interval(t){let e=this.interval;if(t=Math.round(t),e!==t&&t!==0&&isFinite(t)){this.K===null&&(this.K=new xe),this.K.vf=t;let i=this.diagram;i!==null&&this.panel===i.grid&&i.ca(),this.f();let s=this.panel;s!==null&&(s.ds=null),this.t("interval",e,t)}}get graduatedStart(){return this.K!==null?this.K.Ff:0}set graduatedStart(t){let e=this.graduatedStart;e!==t&&(t<0?t=0:t>1&&(t=1),this.K===null&&(this.K=new xe),this.K.Ff=t,this.f(),this.t("graduatedStart",e,t))}get graduatedEnd(){return this.K!==null?this.K.Rf:1}set graduatedEnd(t){let e=this.graduatedEnd;e!==t&&(t<0?t=0:t>1&&(t=1),this.K===null&&(this.K=new xe),this.K.Rf=t,this.f(),this.t("graduatedEnd",e,t))}get graduatedSkip(){return this.K!==null?this.K.Of:null}set graduatedSkip(t){let e=this.graduatedSkip;e!==t&&(t!==null&&m.S(t,et,"graduatedSkip"),this.K===null&&(this.K=new xe),this.K.Of=t,this.f(),this.t("graduatedSkip",e,t))}polygonContainsRect(t){let e=this;if(!e.part||!e.part.actualBounds.containsRect(t))return!1;let i=e.geometry;if(!i)return!1;let s=t.x,n=t.y,o=t.width,r=t.height,a=P.l();if(a.x=s,a.y=n,e.getLocalPoint(a,a),!i.containsPoint(a)||o>0&&r>0&&(a.x=s+o,a.y=n+r,e.getLocalPoint(a,a),!i.containsPoint(a))||o>0&&(a.x=s+o,a.y=n,e.getLocalPoint(a,a),!i.containsPoint(a))||r>0&&(a.x=s,a.y=n+r,e.getLocalPoint(a,a),!i.containsPoint(a))||i.type===1)return!1;if(i.type===4){let h=i.figures.iterator;for(;h.next();){let l=h.value;if(!l.isFilled)continue;a.x=l.startX,a.y=l.startY,e.getDocumentPoint(a,a);let u=a.x,c=a.y,d=u,f=c,p=u,g=c,y=l.segments.iterator;for(;y.next();){let b=y.value;if(a.x=b.endX,a.y=b.endY,e.getDocumentPoint(a,a),p=a.x,g=a.y,b.type===1)u=p,c=g;else if(b.type!==5&&(I.intersectsLineSegment(s,n,o,r,d,f,p,g)||b.isClosed&&I.intersectsLineSegment(s,n,o,r,p,g,u,c)))return!1;d=p,f=g}}}return P.i(a),!0}static iE(t,e,i){let s=null;if(t.toArrow!=="None")s=et.Tn[t.toArrow];else if(t.fromArrow!=="None")s=et.Tn[t.fromArrow];else{let n=C.Wn[t.figure];typeof n=="string"&&(n=C.Wn[n]),n===void 0&&m.o("Unknown Shape.figure: "+t.figure),s=n(t,e,i),s.Pc=e,s.Sc=i}if(s===null){let n=C.Wn.Rectangle;m.st(n)&&(s=n(t,e,i))}return s}static getFigureGenerators(){let t=new Mt;for(let e in C.Wn){if(e===e.toLowerCase())continue;let i=C.Wn[e];t.set(e,i)}return t.k(),t}static defineFigureGenerator(t,e){m.s(t,"string",et,"defineFigureGenerator:name"),typeof e=="string"||m.S(e,et,"defineFigureGenerator:func");let i=t.toLowerCase(),s=C.Wn;s[t]=e,s[i]=t}static isFigureDefined(t){return t in C.Wn}static getArrowheadGeometries(){let t=new Mt;for(let e in C.lm)if(et.Tn[e]===void 0){let i=wt.parse(C.lm[e],!1);et.Tn[e]=i;let s=e.toLowerCase();s!==e&&(et.Tn[s]=e)}for(let e in et.Tn){if(e===e.toLowerCase())continue;let i=et.Tn[e];i instanceof wt&&t.set(e,i)}return t.k(),t}static defineArrowheadGeometry(t,e){m.s(t,"string",et,"defineArrowheadGeometry:name");let i=null;typeof e=="string"?(m.s(e,"string",et,"defineArrowheadGeometry:pathstr"),i=wt.parse(e,!1)):i=e;let s=t.toLowerCase();(s==="none"||t===s)&&m.o("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t);let n=et.Tn;n[t]=i,n[s]=t}static isArrowheadDefined(t){return et.Tn.has(t)}static Tn=new bt;static sC=new bt;static MD(t){let e=et.Tn[t];if(e===void 0){let i=t.toLowerCase();if(i==="none")return"None";if(e=et.Tn[i],e===void 0){let s=null;for(let n in C.lm)if(n.toLowerCase()===i){s=n;break}if(s!==null){let n=wt.parse(C.lm[s],!1);return et.Tn[s]=n,i!==s&&(et.Tn[i]=s),s}}}return typeof e=="string"?e:e instanceof wt?t:null}}class Ki{me;Y0;K0;H0;La;W0;J0;Jn;$n;constructor(){this.me=!1,this.Y0="butt",this.K0="miter",this.H0=10,this.La=0,this.W0=null,this.J0=1,this.Jn=T.Default,this.$n=T.Default}copy(){let t=new Ki;return t.Y0=this.Y0,t.K0=this.K0,t.H0=this.H0,t.La=this.La,t.W0=this.W0,t.J0=this.J0,t.Jn=this.Jn.N(),t.$n=this.$n.N(),t}}var Xi=(x=>(x[x.None=0]="None",x[x.Fit=1]="Fit",x[x.DesiredSize=2]="DesiredSize",x[x.BreakAll=3]="BreakAll",x))(Xi||{}),js=(x=>(x[x.Clip=0]="Clip",x[x.Ellipsis=1]="Ellipsis",x))(js||{}),Yi=(x=>(x[x.Trim=0]="Trim",x[x.None=1]="None",x))(Yi||{});class lt extends ${ue;Qe;Dn;Pi;pe;jp;Kd;K;tt;Xl;uo;vn;Ii;ye;Fn;constructor(t,e){return super(),lt.M0===!1&&(lt.M0=!0,lt.us=Y.isUsingDOM()?new Fe(null)._t:null),this.n|=2097152,this.ue="",this.Qe="black",this.Dn="13px sans-serif",this.Pi=0,this.pe=0,this.jp=0,this.Kd=null,this.K=null,this.tt=null,this.Xl=0,this.uo=null,this.vn=0,this.Ii=null,this.ye=null,this.Fn=null,typeof t=="string"?this.text=t:t&&Object.assign(this,t),e&&Object.assign(this,e),this}cloneProtected(t){super.cloneProtected(t),t.ue=this.ue,t.Qe=this.Qe,t.Dn=this.Dn,t.Pi=this.Pi,t.pe=this.pe,t.jp=this.jp,t.Kd=this.Kd,this.K!==null&&(t.K=this.K.copy()),this.tt!==null&&(this.tt.me?t.tt=this.tt:t.tt=this.tt.copy()),t.Xl=this.Xl,t.uo=this.uo,t.vn=this.vn,t.Ii=this.Ii,t.ye=this.ye,t.Fn=this.Fn}Rs(){return this.tt===null?this.tt=new Ui:this.tt.me&&(this.tt=this.tt.copy()),this.tt}ba(){super.ba(),this.tt!==null&&(this.tt.me=!0)}KI(t){this.n=t.n|2048|4096,this.Zt=t.opacity,this.Lt=t.background,this.cs=t.desiredSize.N(),this.minSize=t.minSize.N(),this.maxSize=t.maxSize.N(),t.Se!==null?this.Se=t.Se.copy():this.Se=null,this.it=t.scale,this.Xt=t.angle,this.stretch=t.stretch,this.il=t.margin.N(),this.de=t.alignment.N(),this.wd=t.alignmentFocus.N(),this.segmentFraction=t.segmentFraction,this.segmentOffset=t.segmentOffset.N(),this.segmentOrientation=t.segmentOrientation,t.he!==null&&(this.he=t.he.copy()),this.shadowVisible=t.shadowVisible,this.ue=t.ue,this.Qe=t.Qe,this.Dn=t.Dn,this.K!==null&&(this.K=t.K.copy()),t.tt!==null&&(t.tt.me?this.tt=t.tt:this.tt=t.tt.copy()),this.Xl=t.Xl}GI(t){if(this.ue=t.text||"",this.Xt=t.labelAngle||0,this.Pi=t.lineCount||0,this.rE(t.lines),t.naturalBounds&&(this.Ke=t.naturalBounds),t.actualBounds){let e=t.actualBounds;this.Ut(e.x,e.y,e.width,e.height)}}fe(t){t in Xi?this.wrap=t:super.fe(t)}toString(){return this.ue.length>22?'TextBlock("'+this.ue.substring(0,20)+'"...)':'TextBlock("'+this.ue+'")'}static getEllipsis(){return lt.$0}static setEllipsis(t){lt.$0=t,lt.ek=new bt,lt.nC=0}static getBaseline(){return lt.ik}static setBaseline(t){lt.ik=t}static ik=null;static getUnderline(){return lt.sk}static setUnderline(t){lt.sk=t}static sk=null;static None=0;static WrapFit=1;static WrapDesiredSize=2;static WrapBreakAll=3;static OverflowClip=0;static OverflowEllipsis=1;static FormatTrim=0;static FormatNone=1;f(){super.f(),this.Ji(!0)}get font(){return this.Dn}set font(t){let e=this.Dn;e!==t&&(this.Dn=t,this.uo=null,this.f(),this.t("font",e,t))}static isValidFont(t){return X.CSS?X.CSS.supports("font",t):!0}get text(){return this.ue}set text(t){let e=this.ue;t!=null?t=t.toString():t="",e!==t&&(this.ue=t,this.f(),this.t("text",e,t))}get textAlign(){return this.tt!==null?this.tt.Z0:"start"}set textAlign(t){let e=this.textAlign;e!==t&&(t==="start"||t==="end"||t==="left"||t==="right"||t==="center")&&(this.Rs().Z0=t,this.C(),this.t("textAlign",e,t))}get flip(){return this.tt!==null?this.tt.go:0}set flip(t){let e=this.flip;e!==t&&(this.Rs().go=t,this.C(),this.t("flip",e,t))}get verticalAlignment(){return this.tt!==null?this.tt.al:T.Top}set verticalAlignment(t){let e=this.verticalAlignment;e.equals(t)||(t=t.N(),this.Rs().al=t,this.kf(),this.t("verticalAlignment",e,t))}get naturalBounds(){if(!this.Ke.isReal()){let t=st.l();this.oC(this.ue,999999,t);let e=t.width;st.i(t);let i=this.CD(e),s=this.desiredSize;isNaN(s.width)||(e=s.width),isNaN(s.height)||(i=s.height),this.Ke.Hn(e,i)}return this.Ke}get isMultiline(){return(this.n&2097152)!==0}set isMultiline(t){let e=(this.n&2097152)!==0;e!==t&&(this.n=this.n^2097152,this.f(),this.t("isMultiline",e,t))}get isUnderline(){return(this.n&4194304)!==0}set isUnderline(t){let e=(this.n&4194304)!==0;e!==t&&(this.n=this.n^4194304,this.Ji(!0),this.C(),this.t("isUnderline",e,t))}get isStrikethrough(){return(this.n&8388608)!==0}set isStrikethrough(t){let e=(this.n&8388608)!==0;e!==t&&(this.n=this.n^8388608,this.Ji(!0),this.C(),this.t("isStrikethrough",e,t))}get wrap(){return this.tt!==null?this.tt.Q0:2}set wrap(t){let e=this.wrap;e!==t&&(this.Rs().Q0=t,this.f(),this.t("wrap",e,t))}get overflow(){return this.tt!==null?this.tt._0:0}set overflow(t){let e=this.overflow;e!==t&&(this.Rs()._0=t,this.f(),this.t("overflow",e,t))}get isOverflowed(){return(this.n&16777216)!==0}rC(t){t?this.n|=16777216:this.n&=-16777217}get stroke(){return this.Qe}set stroke(t){let e=this.Qe;e!==t&&(t!==null&&R.Md(t,"TextBlock.stroke"),t instanceof R&&t.k(),this.Qe=t,typeof t!="string"&&this.wf(),this.C(),this.t("stroke",e,t))}get lineCount(){return this.Pi}get lineHeight(){return this.ty()}get editable(){return(this.n&1048576)!==0}set editable(t){let e=(this.n&1048576)!==0;e!==t&&(this.n=this.n^1048576,this.t("editable",e,t))}get jN(){return(this.n&33554432)!==0}set jN(t){this.n=this.n^33554432}get textEditor(){return this.tt!==null?this.tt.ey:null}set textEditor(t){let e=this.textEditor;e!==t&&(this.Rs().ey=t,this.t("textEditor",e,t))}get errorFunction(){return this.tt!==null?this.tt.gs:null}set errorFunction(t){let e=this.errorFunction;e!==t&&(t!==null&&m.S(t,lt,"errorFunction"),this.Rs().gs=t,this.t("errorFunction",e,t))}get interval(){return this.K!==null?this.K.vf:1}set interval(t){let e=this.interval;if(t=Math.round(t),e!==t&&t!==0&&isFinite(t)){this.K===null&&(this.K=new xe),this.K.vf=t,this.f();let i=this.panel;i!==null&&(i.ds=null),this.t("interval",e,t)}}get graduatedStart(){return this.K!==null?this.K.Ff:0}set graduatedStart(t){let e=this.graduatedStart;e!==t&&(t<0?t=0:t>1&&(t=1),this.K===null&&(this.K=new xe),this.K.Ff=t,this.f(),this.t("graduatedStart",e,t))}get graduatedEnd(){return this.K!==null?this.K.Rf:1}set graduatedEnd(t){let e=this.graduatedEnd;e!==t&&(t<0?t=0:t>1&&(t=1),this.K===null&&(this.K=new xe),this.K.Rf=t,this.f(),this.t("graduatedEnd",e,t))}get graduatedFunction(){return this.K!==null?this.K.iy:null}set graduatedFunction(t){let e=this.graduatedFunction;e!==t&&(t!==null&&m.S(t,lt,"graduatedFunction"),this.K===null&&(this.K=new xe),this.K.iy=t,this.f(),this.t("graduatedFunction",e,t))}get graduatedSkip(){return this.K!==null?this.K.Of:null}set graduatedSkip(t){let e=this.graduatedSkip;e!==t&&(t!==null&&m.S(t,lt,"graduatedSkip"),this.K===null&&(this.K=new xe),this.K.Of=t,this.f(),this.t("graduatedSkip",e,t))}Ma(t,e){if(this.Qe===null||this.ue.length===0||this.Dn===null)return;let i=this.naturalBounds,s=this.actualBounds,n=i.width,o=i.height,r=this.ty(),a=t.textAlign=this.textAlign,h=e.rd;a==="start"?a=h?"right":"left":a==="end"&&(a=h?"left":"right");let l=this.isUnderline,u=this.isStrikethrough;this.bn(t,this.Qe,!0,!1,i,s),(l||u)&&this.bn(t,this.Qe,!1,!1,i,s);let c=0,d=0,f=n,p=!1;e.Wt===t&&!(e.Wt instanceof re)&&!this.jN&&e.getRenderingHint("textGreeking")===!0&&r*this.Th*e.scale<3&&(p=!0);let g=this.spacingAbove,y=this.spacingBelow;switch(this.flip){case 0:break;case 2:t.translate(n,0),t.scale(-1,1);break;case 1:t.translate(0,o),t.scale(1,-1);break;case 3:t.translate(n,o),t.scale(-1,-1);break}t.commitTransform();let b=this.Pi,v=(g+r+y)*b;if(o>v){let w=this.verticalAlignment;d=w.y*o-w.y*v+w.offsetY}if(lt.nk&&(t.letterSpacing=this.letterSpacing,t.wordSpacing=this.wordSpacing),b===1&&this.Fn!==null){let w=this.pe;w>f&&(w=f),d+=g,this.LD(this.Fn,t,c,d,f,r,w,p,a,l,u)}else if(this.Ii!==null&&this.ye!==null)for(let w=0;w<b;w++){let k=this.Ii[w];k>f&&(k=f),d+=g,this.LD(this.ye[w],t,c,d,f,r,k,p,a,l,u),d+=r+y}switch(this.flip){case 0:break;case 2:t.scale(-1,1),t.translate(-n,0);break;case 1:t.scale(1,-1),t.translate(0,-o);break;case 3:t.scale(-1,-1),t.translate(-n,-o);break}}LD(t,e,i,s,n,o,r,a,h,l,u){let c=0;if(a){h==="left"?c=0:h==="right"?c=n-r:h==="center"&&(c=(n-r)/2);let p=e.globalAlpha;e.globalAlpha=p/2,e.fillRect(i+c,s+o/4,r,o/2),e.globalAlpha=p;return}h==="left"?c=0:h==="right"?c=n:h==="center"&&(c=n/2);let d=lt.ik!==null?lt.ik(this,o):o*.75;e.fillText(t,i+c,s+d);let f=o/20|0;if(f===0&&(f=1),h==="right"?c-=r:h==="center"&&(c-=r/2),l){let p=lt.sk!==null?lt.sk(this,o):o*.8;this.AD(i+c,s+p,i+c+r,s+p,f,e),e instanceof re&&e.lastCreatedElement.classList.add("gojs-td")}if(u){let p=s+o-o/2.2|0;f%2!==0&&(p+=.5),this.AD(i+c,p,i+c+r,p,f,e),e instanceof re&&e.lastCreatedElement.classList.add("gojs-td")}}AD(t,e,i,s,n,o){o.beginPath(),o.lineWidth=n,o.moveTo(t,e),o.lineTo(i,s),o.stroke(),o.endPath()}yf(t,e,i){if(!super.yf(t,e,i))return!1;if(this.bn(t,this.Qe,!0,!1,this.naturalBounds,this.actualBounds),i){if(this.svg.getElementsByTagName("text").length===0)return!0;let s=this.svg.getElementsByClassName("gojs-td");for(let n=0;n<s.length;n++)t.setFillOrStrokeInPlace(s[n],!1)}else this.lE(this.svg,this.ye?this.ye[0]:this.text,t);return!0}lE(t,e,i){t.innerHTML=e,i.setFillOrStrokeInPlace(t,!0)}Pd(t){return this.lineCount>1||this.isUnderline||this.isStrikethrough?!0:super.Pd(t)}AN(t,e){if(t.nodeName!=="g")t.setAttributeNS(null,"filter",e);else{let i=t.getElementsByTagName("text");for(let s=0;s<i.length;s++)i[s].setAttributeNS(null,"filter",e)}}aE(){this.vn=0,this.pe=0,this.uo=null,this.Ii=null,this.ye=null,this.Fn=null}bd(t,e,i,s){let n=this.Pi;this.Xl=t,this.rC(!1);let o=this.Dn;lt.us!==null&&(lt.TD!==o&&(lt.us.font=o,lt.TD=o),lt.nk&&(lt.us.letterSpacing=this.letterSpacing,lt.us.wordSpacing=this.wordSpacing)),this.aE();let r=0,a=0;isNaN(this.desiredSize.width)?(r=this.hE(),r=Math.min(r,t/this.scale)):r=this.desiredSize.width,this.panel!==null&&(r=Math.min(r,this.panel.maxSize.width)),a=this.CD(r),isNaN(this.desiredSize.height)?a=Math.min(a,e/this.scale):a=this.desiredSize.height,this.cE(t,a),(this.wrap===1||isNaN(this.desiredSize.width))&&(r=isNaN(t)?this.pe:Math.min(t,this.pe)),r=Math.max(i,r),a=Math.max(s,a),this.Ke.Hn(r,a),this.ro(0,0,r,a),this.svg!==null&&n!==this.Pi&&this.Ji(!0)}Pa(t,e,i,s){this.commonArrange(t,e,i,s)}Rn(t,e){this.Fn===null?(this.Fn=t,this.pe=e):((this.ye===null||this.Ii===null)&&(this.ye=[],this.Ii=[],this.ye.push(this.Fn),this.Ii.push(this.pe)),this.ye.push(t),this.Ii.push(e),this.ye.length>this.maxLines&&(this.n|=16777216))}oC(t,e,i){let s=this.formatting===0;s&&(t=t.trim());let n=0,o=0,r=0,a=this.Dn,h=this.spacingAbove+this.spacingBelow,l=Math.max(0,this.ty()+h),u=this.overflow===1?this.DD(a):0;if(this.Pi>=this.maxLines){i!==void 0&&i.e(0,l);return}let c=t;if(this.wrap===0){if(this.vn=1,o=this.getStringWidth(t),u===0||o<=e){this.pe=Math.max(this.pe,o),this.Rn(t,this.pe),i!==void 0&&i.e(o,l);return}let f=this.Hd(c);c=c.substring(f.length);let p=this.Hd(c);for(o=this.getStringWidth(f+p),r=0;p.length>0&&o<=e;){f+=p,c=c.substring(p.length),p=this.Hd(c),r=o;let g=f+p;s&&(g=g.trim()),o=this.getStringWidth(g)}for(s&&(p=p.trim()),f+=p,e=Math.max(1,e-u);this.getStringWidth(f)>e&&f.length>1;)f=f.substring(0,f.length-1);this.rC(!0),f+=lt.$0,r=this.getStringWidth(f),this.pe=r,this.Rn(f,r),i!==void 0&&i.e(r,l);return}let d=0;for(c.length===0&&(d=1,this.Rn(c,0));c.length>0;){let f=this.Hd(c);for(c=c.substring(f.length);this.getStringWidth(f)>e;){let y=1;for(o=this.getStringWidth(f.substring(0,y)),r=0;o<=e;)y++,r=o,o=this.getStringWidth(f.substring(0,y));let b=0;y===1?(b=o,n=Math.max(n,o)):(b=r,n=Math.max(n,r)),y--,y<1&&(y=1);let v=f.substring(0,y);if(this.Rn(v,b),d++,f=f.substring(y),this.Pi+d>this.maxLines)break}let p=this.Hd(c);for(o=this.getStringWidth(f+p),r=0;p.length>0&&o<=e;){f+=p,c=c.substring(p.length),p=this.Hd(c),r=o;let y=f+p;s&&(y=y.trim()),o=this.getStringWidth(y)}if(s&&(f=f.trim()),f==="")continue;f[f.length-1]==="\xAD"&&(f=f.substring(0,f.length-1)+"\u2010");let g=0;if(p.length===0?(g=o,n=Math.max(n,o)):(r=this.getStringWidth(f),g=r,n=Math.max(n,r)),this.Rn(f,g),d++,this.Pi+d>this.maxLines)break}this.vn=Math.min(this.maxLines-this.Pi,d),this.pe=Math.max(this.pe,n),i!==void 0&&i.e(this.pe,l*this.vn)}cE(t,e){if(this.pe===0||this.Ii===null||this.ye===null||this.overflow!==1)return;let i=this.Dn,s=this.overflow===1?this.DD(i):0,n=this.spacingAbove+this.spacingBelow,o=Math.max(0,this.ty()+n),r=Math.min(this.maxLines-1,Math.max(Math.floor(e/o+.01)-1,0));if(r+1>=this.ye.length)return;this.rC(!0);let a=this.ye[r],h=Math.max(1,t-s);for(;this.getStringWidth(a)>h&&a.length>1;)a=a.substring(0,a.length-1);a+=lt.$0;let l=this.getStringWidth(a);this.ye[r]=a,this.ye=this.ye.slice(0,r+1),this.Ii[r]=l,this.Ii=this.Ii.slice(0,r+1),this.vn=this.ye.length,this.pe=Math.max(this.pe,l),this.Pi=this.vn,this.Pi===1&&(this.Fn=this.ye[0])}Hd(t){if(this.wrap===3)return t.substring(0,1);let e=t.length,i=0,s=lt.fE;for(;i<e&&!s.test(t.charAt(i));)i++;for(this.formatting===1&&(e=Math.min(e,i+1));i<e&&s.test(t.charAt(i));)i++;return i>=t.length?t:t.substring(0,i)}getStringWidth(t){return lt.us===null?t.length*8:lt.us.measureText(t).width}ty(){if(this.uo!==null)return this.uo;let t=this.Dn,e=0;if(lt.us===null)return e=16,this.uo=e,e;if(lt.lC[t]!==void 0&<.vD<5e3)e=lt.lC[t];else{lt.us.letterSpacing="0px";let i=lt.us.measureText("M");lt.us.letterSpacing=this.letterSpacing,e=i.width*1.3,lt.lC[t]=e,lt.vD++}return this.uo=e,e}DD(t){if(lt.us===null)return 6;let e=0;return lt.ek[t]!==void 0&<.nC<5e3?e=lt.ek[t]:(e=lt.us.measureText(lt.$0).width,lt.ek[t]=e,lt.nC++),e}ok(t,e){return t.indexOf(`
|
|
8
8
|
`,e)}CD(t){let e=this.ue.replace(/\r\n/g,`
|
|
9
9
|
`).replace(/\r/g,`
|
|
10
10
|
`),i=this.spacingAbove+this.spacingBelow,s=Math.max(0,this.ty()+i);if(e.length===0)return this.pe=0,this.Pi=1,s;if(!this.isMultiline){let h=this.ok(e,0);h>=0&&(e=e.substring(0,h))}let n=0;this.Pi=0;let o=0,r=-1,a=!1;for(;!a;){if(r=this.ok(e,o),r===-1&&(r=e.length,a=!0),o<=r){let h=e.substring(o,r);if(this.wrap!==0){this.vn=0;let l=st.l();this.oC(h,t,l),n+=l.height,st.i(l),this.Pi+=this.vn}else this.oC(h,t),n+=s,this.Pi++;this.Pi===this.maxLines&&(a=!0)}o=r+1}return this.jp=n,n}hE(){let t=this.ue.replace(/\r\n/g,`
|
|
11
11
|
`).replace(/\r/g,`
|
|
12
|
-
`);if(t.length===0)return 8;if(this.isMultiline){let e=0,i=0,s=!1;for(;!s;){let n=this.ok(t,i);n===-1&&(n=t.length,s=!0);let o=t.substring(i,n);this.formatting===0&&(o=o.trim()),e=Math.max(e,this.getStringWidth(o)),i=n+1}return e}else{let e=this.ok(t,0);return e>=0&&(t=t.substring(0,e)),this.getStringWidth(t)}}get textValidation(){return this.tt!==null?this.tt.zl:null}set textValidation(t){let e=this.textValidation;e!==t&&(t!==null&&m.S(t,lt,"textValidation"),this.Rs().zl=t,this.t("textValidation",e,t))}get textEdited(){return this.tt!==null?this.tt.ny:null}set textEdited(t){let e=this.textEdited;e!==t&&(t!==null&&m.S(t,lt,"textEdited"),this.Rs().ny=t,this.t("textEdited",e,t))}get spacingAbove(){return this.tt!==null?this.tt.ly:0}set spacingAbove(t){let e=this.spacingAbove;e!==t&&(this.Rs().ly=t,this.f(),this.t("spacingAbove",e,t))}get spacingBelow(){return this.tt!==null?this.tt.hy:0}set spacingBelow(t){let e=this.spacingBelow;e!==t&&(this.Rs().hy=t,this.f(),this.t("spacingBelow",e,t))}get letterSpacing(){return this.tt!==null?this.tt.cy:"0px"}set letterSpacing(t){let e=this.letterSpacing;e!==t&&(lt.nk=!0,this.Rs().cy=t,this.f(),this.t("letterSpacing",e,t))}get wordSpacing(){return this.tt!==null?this.tt.fy:"0px"}set wordSpacing(t){let e=this.wordSpacing;e!==t&&(lt.nk=!0,this.Rs().fy=t,this.f(),this.t("wordSpacing",e,t))}get formatting(){return this.tt!==null?this.tt.uy:0}set formatting(t){let e=this.formatting;e!==t&&(this.Rs().uy=t,this.f(),this.t("formatting",e,t))}get maxLines(){return this.tt!==null?this.tt.gy:1/0}set maxLines(t){let e=this.maxLines;e!==t&&(t=Math.floor(t),t<=0&&m.J(t,"> 0",lt,"maxLines"),this.Rs().gy=t,this.f(),this.t("maxLines",e,t))}getMetrics(){return[this.pe,this.Xl,this.uo,this.vn,this.Ii,this.ye,this.Fn||""]}rE(t){t!==void 0&&(this.pe=t[0],this.Xl=t[1],this.uo=t[2],this.vn=t[3],this.Ii=t[4],this.ye=t[5],this.Fn=t[6])}get metrics(){return{arrSize:this.Ii!==null?this.Ii:[this.pe],arrText:this.ye!==null?this.ye:[this.Fn],maxLineWidth:this.pe,fontHeight:this.uo}}get choices(){return this.Kd}set choices(t){let e=this.Kd;e!==t&&(this.Kd=t,this.t("choices",e,t))}static fE=new RegExp("[ \u200B\xAD]");static lC=new yt;static vD=0;static ek=new yt;static nC=0;static $0="...";static TD="";static us=null;static M0=!1;static nk=!1}class Ui{me;gs;go;uy;gy;_0;ly;hy;Z0;ny;ey;zl;al;Q0;cy;fy;constructor(){this.me=!1,this.gs=null,this.go=0,this.uy=0,this.gy=1/0,this._0=0,this.ly=0,this.hy=0,this.Z0="start",this.ny=null,this.ey=null,this.zl=null,this.al=T.Top,this.Q0=2,this.cy="0px",this.fy="0px"}copy(){let t=new Ui;return t.gs=this.gs,t.go=this.go,t.uy=this.uy,t.gy=this.gy,t._0=this._0,t.ly=this.ly,t.hy=this.hy,t.Z0=this.Z0,t.ny=this.ny,t.ey=this.ey,t.zl=this.zl,t.al=this.al,t.Q0=this.Q0,t.cy=this.cy,t.fy=this.fy,t}}class xe{vf;Ff;Rf;iy;Of;constructor(){this.vf=1,this.Ff=0,this.Rf=1,this.iy=null,this.Of=null}copy(){let t=new xe;return t.vf=this.vf,t.Ff=this.Ff,t.Rf=this.Rf,t.iy=this.iy,t.Of=this.Of,t}}var ji=(x=>(x[x.None=0]="None",x[x.Fill=2]="Fill",x[x.Uniform=6]="Uniform",x[x.UniformToFill=7]="UniformToFill",x))(ji||{});class Bt extends ${hl;en;cl;If;gs;fl;Ef;go;Uf;Vf;U1;constructor(t,e){super(),this.n|=2097152,this.hl=null,this.en="",this.cl=I.YF,this.If=2,this.gs=null,this.fl=null,this.Ef=T.Center,this.go=0,this.Uf=null,this.Vf=null,this.U1=null,typeof t=="string"?this.source=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.en=this.en,t.element=this.hl,t.cl=this.cl.N(),t.If=this.If,t.go=this.go,t.gs=this.gs,t.fl=this.fl,t.Ef=this.Ef.N(),t.Vf=this.Vf}fe(t){t in ji?this.imageStretch=t:super.fe(t)}toString(){return"Picture("+this.source+")#"+V.xs(this)}get Bf(){return(this.n&1048576)!==0}set Bf(t){this.Bf!==t&&(this.n=this.n^1048576)}get my(){return(this.n&2097152)!==0}set my(t){this.my!==t&&(this.n=this.n^2097152)}get Sn(){return(this.n&4194304)!==0}set Sn(t){this.Sn!==t&&(this.n=this.n^4194304)}static clearCache(t){t===void 0&&(t=""),m.s(t,"string",Bt,"clearCache:url"),t!==""?Bt.yy[t]&&(delete Bt.yy[t],Bt.rk--):(Bt.yy=new yt,Bt.rk=0)}static NT(t,e){e.FD||(e.lk=i=>{Bt.uE(e,i),t.desiredSize.isReal()||(t.xi(!1),t.f())},e.ak=i=>Bt.dE(e,i),e.addEventListener("load",e.lk),e.addEventListener("error",e.ak),e.FD=!0)}static vO(t){t.lk&&t.removeEventListener("load",t.lk),t.ak&&t.removeEventListener("error",t.ak),delete t.lk,delete t.ak,t.FD=!1}get element(){return this.hl}set element(t){let e=this.hl;if(this.Ji(!0),e!==t){let i=Y.isUsingDOM(),s=!1;i&&(this.Bf=t instanceof HTMLCanvasElement,s=t instanceof HTMLImageElement,t!==null&&!(s||t instanceof HTMLVideoElement||this.Bf)&&m.o("Picture.element must be an instance of Image, Canvas, or Video, not: "+t));let n=this.diagram;n!==null&&n.O2(this),this.hl=t,t!==null&&s&&t.hs===void 0&&(t.hs=new V),n!==null&&s&&n.R2(this),this.t("element",e,t),this.C()}}TO(){let t=this.hl;if(t===null)return;let e=this.desiredSize.isReal();(this.Bf||t.complete===!0)&&(t.Dp&&(t.wy instanceof Event&&this.gs!==null?this.gs(this,t.wy):t.Sn===!0&&!t.wy&&this.fl!==null&&t.aC&&this.fl(this,t.aC)),t.Sn=!0),t.Sn&&e&&this.diagram!==null&&this.diagram.od.add(this)}gE(){if(this.hl===null){this.Uf=!1;return}let t=new Fe(null)._t;try{t.drawImage(this.hl,0,0)}catch{this.my=!1}try{t.getImageData(0,0,1,1).data[3]&&(this.Uf=!1),this.Uf=!1}catch{this.Uf=!0}}get source(){return this.en}set source(t){let e=this.en;if(e!==t){this.Ji(!0),m.s(t,"string",Bt,"source"),this.en=t;let i=Bt.yy,s=null;if(i[t]!==void 0)s=i[t];else if(t!==""){Bt.rk>30&&(Bt.clearCache(),i=Bt.yy),s=m.Ni("img"),s.Dp=!0,Bt.NT(this,s);let n=this.Vf;n!==null&&(s.crossOrigin=n(this)),s.src=t,i[t]=s,Bt.rk++}this.element=s,s!==null&&s.__goCache===void 0&&(s.__goCache=new Hn),this.f(),this.C(),this.t("source",e,t)}}static uE(t,e){t.Sn=!0,t.wy=!1;let i,s=t.hs.copy();if(s==null)return;let n=s.iterator;for(;n.next();){let o=n.value;o.C();let r=t.getAttribute("src")||"",a=o.oa.get(r);if(a===null)continue;let h=a.length;for(let l=0;l<h;l++)i=a[l],i.desiredSize.isReal()||o.od.add(i),i.Ji(!0),o.requestUpdate(),t.Dp&&(t.aC===void 0&&(t.aC=e),i.fl!==null&&i.fl(i,e))}t.hs.clear()}static dE(t,e){t.wy=e;let i,s=t.hs.copy();if(s==null)return;let n=s.iterator;for(;n.next();){let o=n.value,r=t.getAttribute("src")||"",a=o.oa.get(r);if(a===null)continue;let h=a.length,l=m.nt();for(let u=0;u<h;u++)l.push(a[u]);if(t.Dp)for(let u=0;u<h;u++)i=l[u],i.gs!==null&&i.gs(i,e);m.Z(l)}t.hs.clear()}reloadSource(){if(this.source==="")return;Bt.clearCache(this.source);let t=this.source;this.source="",this.source=t}redraw(){this.C(),this.Ji(!0)}get sourceCrossOrigin(){return this.Vf}set sourceCrossOrigin(t){if(this.Vf!==t){t!==null&&m.S(t,Bt,"sourceCrossOrigin"),this.Vf=t;let e=this.element;if(e!==null){let i=e.getAttribute("src");e.crossOrigin!==void 0&&(t===null&&typeof i=="string"?e.crossOrigin=null:t!==null&&(e.crossOrigin=t(this)),i&&(e.src=i))}}}get sourceRect(){return this.cl}set sourceRect(t){let e=this.cl;e.equals(t)||(t=t.N(),this.cl=t,this.f(),this.t("sourceRect",e,t))}get imageStretch(){return this.If}set imageStretch(t){let e=this.If;e!==t&&(this.If=t,this.C(),this.t("imageStretch",e,t))}get flip(){return this.go}set flip(t){let e=this.go;e!==t&&(this.go=t,this.C(),this.t("flip",e,t))}get imageAlignment(){return this.Ef}set imageAlignment(t){let e=this.Ef;e.equals(t)||(t=t.N(),this.Ef=t,this.C(),this.t("imageAlignment",e,t))}get errorFunction(){return this.gs}set errorFunction(t){let e=this.gs;e!==t&&(t!==null&&m.S(t,Bt,"errorFunction"),this.gs=t,this.t("errorFunction",e,t))}get successFunction(){return this.fl}set successFunction(t){let e=this.fl;e!==t&&(t!==null&&m.S(t,Bt,"successFunction"),this.fl=t,this.t("successFunction",e,t))}Ma(t,e){let i=this.hl;if(i===null)return;let s=i.getAttribute("src"),n=Y.isUsingDOM();if(n&&i instanceof HTMLImageElement&&(s===null||s==="")||i.wy instanceof Event&&t instanceof ci)return;let o=t instanceof re,r=this.naturalBounds,a=0,h=0,l=this.Bf,u=l?+i.width:i.naturalWidth,c=l?+i.height:i.naturalHeight;if(u===void 0&&i.videoWidth&&(u=i.videoWidth),c===void 0&&i.videoHeight&&(c=i.videoHeight),n){if(u===0||c===0)return}else u=this.width,c=this.height;let d=u,f=c;this.sourceRect.isReal()&&(a=this.cl.x,h=this.cl.y,u=this.cl.width,c=this.cl.height);let p=u,g=c,y=this.If,b=this.Ef;switch(y){case 0:if(this.sourceRect.isReal())break;p>=r.width&&(a=a+b.offsetX+(p*b.x-r.width*b.x)),g>=r.height&&(h=h+b.offsetY+(g*b.y-r.height*b.y)),u=Math.min(r.width,p),c=Math.min(r.height,g);break;case 2:p=r.width,g=r.height;break;case 6:case 7:let E=0;y===6?(E=Math.min(r.height/g,r.width/p),p*=E,g*=E):y===7&&(E=Math.max(r.height/g,r.width/p),p*=E,g*=E,p>=r.width&&(a=(a+b.offsetX+(p*b.x-r.width*b.x)/p)*u),g>=r.height&&(h=(h+b.offsetY+(g*b.y-r.height*b.y)/g)*c),u*=1/(p/r.width),c*=1/(g/r.height),p=r.width,g=r.height);break}let v=u*c,w=this.getDocumentScale()*e.scale,k=p*w,S=g*w,N=k*S,D=v/N,L=i.__goCache,M=null,A=Bt.mE;if(!o){if(i.Sn&&L!==void 0&&d<8e3&&f<8e3&&N>4&&D>A*A){L.Bt===null&&(L.RD(4,d,f,i),L.RD(16,d,f,i));let E=L.Bt,B=E.length;for(let K=0;K<B&&E[K].qd*E[K].qd<D;K++)M=E[K]}if(!e.nd&&(this.Uf===null&&this.gE(),this.Uf))return}let F=p<r.width?b.offsetX+(r.width*b.x-p*b.x):0,O=g<r.height?b.offsetY+(r.height*b.y-g*b.y):0;switch(this.flip){case 0:break;case 2:t.translate(Math.min(r.width,p),0),t.scale(-1,1);break;case 1:t.translate(0,Math.min(r.height,g)),t.scale(1,-1);break;case 3:t.translate(Math.min(r.width,p),Math.min(r.height,g)),t.scale(-1,-1);break}if(t.commitTransform(),e.getRenderingHint("pictureRatioOptimization")&&!e.ph&&L!==void 0&&M!==null&&M.qd!==1){t.save();let E=M.qd;try{t.drawImage(M.en,a/E,h/E,Math.min(M.en.width,u/E),Math.min(M.en.height,c/E),F,O,Math.min(r.width,p),Math.min(r.height,g)),t instanceof re&&(this.U1=[a/E,h/E,Math.min(M.en.width,u/E),Math.min(M.en.height,c/E),F,O,Math.min(r.width,p),Math.min(r.height,g)])}catch{this.my=!1}t.restore()}else try{t.drawImage(i,a,h,u,c,F,O,Math.min(r.width,p),Math.min(r.height,g)),t instanceof re&&(this.U1=[a,h,u,c,F,O,Math.min(r.width,p),Math.min(r.height,g)])}catch{this.my=!1}switch(this.flip){case 0:break;case 2:t.scale(-1,1),t.translate(-Math.min(r.width,p),0);break;case 1:t.scale(1,-1),t.translate(0,-Math.min(r.height,g));break;case 3:t.scale(-1,-1),t.translate(-Math.min(r.width,p),-Math.min(r.height,g));break}}get naturalBounds(){return this.Ke}bd(t,e,i,s){let n=this.desiredSize,o=this.Zs(!0),r=this.hl,a=this.Bf,h=0,l=0;(a||!this.Sn&&r&&r.complete)&&(this.Sn=!0),r===null?(isFinite(n.width)||(t=i),isFinite(n.height)||(e=s)):(h=a?+r.width:r.naturalWidth,l=a?+r.height:r.naturalHeight),!isFinite(n.width)&&o!==2&&o!==5?r!==null&&this.Sn!==!1&&(this.sourceRect.isReal()?t=this.sourceRect.width:t=h):(isFinite(t)||(this.sourceRect.isReal()?t=this.sourceRect.width:r!==null&&(t=h)),i=0),!isFinite(n.height)&&o!==2&&o!==4?r!==null&&this.Sn!==!1&&(this.sourceRect.isReal()?e=this.sourceRect.height:e=l):(isFinite(e)||(this.sourceRect.isReal()?e=this.sourceRect.height:r!==null&&(e=l)),s=0),isFinite(n.width)&&(t=n.width),isFinite(n.height)&&(e=n.height);let u=this.maxSize,c=this.minSize;i=Math.max(i||0,c.width),s=Math.max(s||0,c.height),t=Math.min(u.width,t),e=Math.min(u.height,e),t=Math.max(i,t),e=Math.max(s,e),r!==null&&!r.complete&&(isFinite(t)||(t=0),isFinite(e)||(e=0)),this.Ke.Hn(t,e),this.ro(0,0,t,e)}Pa(t,e,i,s){this.commonArrange(t,e,i,s)}static yy=new yt;static rk=0;static mE=4}class Hn{Bt;constructor(){this.Bt=null}RD(t,e,i,s){this.Bt===null&&(this.Bt=[]);let n=new Fe(null),o=n._t,r=1/t;if(n.width=e/t,n.height=i/t,n.width===0||n.height===0)return;let a=new Wn(n.bt,t),h=s,l=1;if(this.Bt.length>0){let u=this.Bt[this.Bt.length-1];h=u.en,l=u.qd}o.setTransform(r*l,0,0,r*l,0,0),o.commitTransform(),o.drawImage(h,0,0),this.Bt.push(a)}}class Wn{en;qd;constructor(t,e){this.en=t,this.qd=e}}class Ce{Ne;um;constructor(){this.um=new wt,this.Ne=null}Ue(t){t!==null?(this.um=t,t.figures.clear()):this.um=new wt,this.Ne=null}Lu(t,e,i,s,n,o){if(s!==void 0&&s===!0){let r=new mt(1);r.endX=t,r.endY=e,this.Ne.segments.add(r)}else this.Ne=new Kt,this.Ne.startX=t,this.Ne.startY=e,this.Ne.isFilled=i,this.Ne.isEvenOdd=o||!1,this.um.figures.add(this.Ne);n!==void 0&&(this.Ne.isShadowed=n)}tR(){let t=this.Ne.segments.length;t>0&&this.Ne.segments.elt(t-1).close()}eR(){this.Ne.segments.length>0&&(this.Ne.isFilled=!0)}iR(t){this.Ne.isShadowed=t}zU(t){this.Ne.isEvenOdd=t}ZF(t,e,i){i===void 0&&(i=!1);let s=new mt(1);s.endX=t,s.endY=e,i&&s.close(),this.Ne.segments.add(s)}Ys(t,e,i){i===void 0&&(i=!1);let s=new mt(2);s.endX=t,s.endY=e,i&&s.close(),this.Ne.segments.add(s)}wr(t,e,i,s,n,o,r){r===void 0&&(r=!1);let a=new mt(3);a.point1X=t,a.point1Y=e,a.point2X=i,a.point2Y=s,a.endX=n,a.endY=o,r&&a.close(),this.Ne.segments.add(a)}Au(t,e,i,s,n){n===void 0&&(n=!1);let o=new mt(4);o.point1X=t,o.point1Y=e,o.endX=i,o.endY=s,n&&o.close(),this.Ne.segments.add(o)}QF(t,e,i,s,n,o,r){o===void 0&&(o=0),r===void 0&&(r=!1);let a=new mt(5);a.startAngle=t,a.sweepAngle=e,a.centerX=i,a.centerY=s,a.radiusX=n,o!==0?a.radiusY=o:a.radiusY=n,r&&a.close(),this.Ne.segments.add(a)}_F(t,e,i,s,n,o,r,a){a===void 0&&(a=!1);let h=new mt(6,o,r,t,e,i,s,n);a&&h.close(),this.Ne.segments.add(h)}static hC=null;static JL(t){let e=Ce.hC;if(e!==null)return Ce.hC=null,e.Ue(t),e;{let i=new Ce;return i.Ue(t),i}}static $L(t){Ce.hC=t}}{let x=function(n,o){let r=n.toLowerCase(),a=C.Wn;a[n]=o,a[r]=n};x("Rectangle",(n,o,r)=>{let a="r"+o+","+r,h=C.pr[a];return h!==void 0||(h=new wt(2),h.endX=o,h.endY=r,C.yr<C.am&&(C.pr[a]=h,C.yr++)),h}),x("Square",(n,o,r)=>{let a="s"+o+","+r,h=C.pr[a];return h!==void 0||(h=new wt(2),h.endX=o,h.endY=r,h.defaultStretch=6,C.yr<C.am&&(C.pr[a]=h,C.yr++)),h});let t=(n,o,r,a,h)=>{(isNaN(a)||a<0)&&(a=5),isNaN(h)&&(h=15);let l="rr"+o+","+r+","+a+","+h,u=C.pr[l];if(u!==void 0)return u;let c=a;(h&1)===1?(c=Math.min(c,(h&2)===2?o/3:o),c=Math.min(c,(h&8)===8?r/3:r)):c=0;let d=new Kt(c,0,!0);u=new wt().add(d);let f=T.TopLeft.copy(),p=T.BottomRight.copy();if((h&2)===2){let g=a;g=Math.min(g,(h&1)===1?o/3:o),g=Math.min(g,(h&4)===4?r/3:r);let y=g*C.qn;d.add(new mt(2,o-g,0)).add(new mt(3,o,g,o-y,0,o,y)),f.offsetY=y,p.offsetX=-y}else d.add(new mt(2,o,0));if((h&4)===4){let g=a;g=Math.min(g,(h&8)===8?o/3:o),g=Math.min(g,(h&2)===2?r/3:r);let y=g*C.qn;d.add(new mt(2,o,r-g)).add(new mt(3,o-g,r,o,r-y,o-y,r)),p.offsetX=-y,p.offsetY=-y}else d.add(new mt(2,o,r));if((h&8)===8){let g=a;g=Math.min(g,(h&4)===4?o/3:o),g=Math.min(g,(h&1)===1?r/3:r);let y=g*C.qn;d.add(new mt(2,g,r)).add(new mt(3,0,r-g,y,r,0,r-y)),f.offsetX=y,p.offsetY=-y}else d.add(new mt(2,0,r));if((h&1)===1){let g=c*C.qn;d.add(new mt(2,0,c)).add(new mt(3,c,0,0,g,g,0).close()),f.offsetX=g,f.offsetY=g}else d.add(new mt(2,0,0).close());return u.spot1=f,u.spot2=p,C.yr<C.am&&(C.pr[l]=u,C.yr++),u};x("RoundedRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN,h=n?n.parameter2:NaN;return t(n,o,r,a,h)}),x("Border","RoundedRectangle"),x("RoundedTopRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN;return t(n,o,r,a,3)}),x("RoundedBottomRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN;return t(n,o,r,a,12)}),x("RoundedLeftRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN;return t(n,o,r,a,9)}),x("RoundedRightRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN;return t(n,o,r,a,6)}),x("Ellipse",(n,o,r)=>{let a="e"+o+","+r,h=C.pr[a];return h!==void 0||(h=new wt(3),h.endX=o,h.endY=r,h.spot1=T.vP,h.spot2=T.FP,C.yr<C.am&&(C.pr[a]=h,C.yr++)),h}),x("Circle",(n,o,r)=>{let a="c"+o+","+r,h=C.pr[a];return h!==void 0||(h=new wt(3),h.endX=o,h.endY=r,h.spot1=T.vP,h.spot2=T.FP,h.defaultStretch=6,C.yr<C.am&&(C.pr[a]=h,C.yr++)),h}),x("TriangleRight",(n,o,r)=>new wt().add(new Kt(0,0).add(new mt(2,o,.5*r)).add(new mt(2,0,r).close())).setSpots(0,.25,.5,.75)),x("TriangleDown",(n,o,r)=>new wt().add(new Kt(0,0).add(new mt(2,o,0)).add(new mt(2,.5*o,r).close())).setSpots(.25,0,.75,.5)),x("TriangleLeft",(n,o,r)=>new wt().add(new Kt(o,r).add(new mt(2,0,.5*r)).add(new mt(2,o,0).close())).setSpots(.5,.25,1,.75)),x("TriangleUp",(n,o,r)=>new wt().add(new Kt(o,r).add(new mt(2,0,r)).add(new mt(2,.5*o,0).close())).setSpots(.25,.5,.75,1)),x("Triangle","TriangleUp"),x("Diamond",(n,o,r)=>new wt().add(new Kt(.5*o,0).add(new mt(2,0,.5*r)).add(new mt(2,.5*o,r)).add(new mt(2,o,.5*r).close())).setSpots(.25,.25,.75,.75)),x("LineH",(n,o,r)=>{let a=new wt(1);return a.startX=0,a.startY=r/2,a.endX=o,a.endY=r/2,a}),x("LineV",(n,o,r)=>{let a=new wt(1);return a.startX=o/2,a.startY=0,a.endX=o/2,a.endY=r,a}),x("None","Rectangle"),x("BarH","Rectangle"),x("BarV","Rectangle"),x("MinusLine","LineH"),x("PlusLine",(n,o,r)=>new wt().add(new Kt(0,r/2,!1).add(new mt(2,o,r/2)).add(new mt(1,o/2,0)).add(new mt(2,o/2,r)))),x("XLine",(n,o,r)=>new wt().add(new Kt(0,r,!1).add(new mt(2,o,0)).add(new mt(1,0,0)).add(new mt(2,o,r)))),x("LineRight",(n,o,r)=>new wt().add(new Kt(.25*o,0,!1).add(new mt(2,.75*o,.5*r)).add(new mt(2,.25*o,r)))),x("LineDown",(n,o,r)=>new wt().add(new Kt(0,.25*r,!1).add(new mt(2,.5*o,.75*r)).add(new mt(2,o,.25*r)))),x("LineLeft",(n,o,r)=>new wt().add(new Kt(.75*o,0,!1).add(new mt(2,.25*o,.5*r)).add(new mt(2,.75*o,r)))),x("LineUp",(n,o,r)=>new wt().add(new Kt(0,.75*r,!1).add(new mt(2,.5*o,.25*r)).add(new mt(2,o,.75*r)))),x("Capsule",(n,o,r)=>{let a=new wt;if(o<r){let h=o/2,l=new Kt(0,h,!0);a.add(l),l.add(new mt(5,180,180,h,h,h,h)),l.add(new mt(2,o,r-h)),l.add(new mt(5,0,180,h,r-h,h,h)),l.add(new mt(2,0,h));let u=isFinite(n.parameter1)?n.parameter1:o*.156;return a.setSpots(0,0,1,1,0,u,0,-u),a}else if(o>r){let h=r/2,l=new Kt(h,0,!0);a.add(l),l.add(new mt(2,o-h,0)),l.add(new mt(5,270,180,o-h,h,h,h)),l.add(new mt(2,h,r)),l.add(new mt(5,90,180,h,h,h,h));let u=isFinite(n.parameter1)?n.parameter1:r*.156;return a.setSpots(0,0,1,1,u,0,-u,0),a}else return a.type=3,a.endX=o,a.endY=r,a.spot1=T.vP,a.spot2=T.FP,a});let e=(n,o)=>new Kt(n,o,!1,!1),i=(n,o,r)=>n.add(new mt(2,o,r)),s=(n,o,r)=>n.add(new mt(1,o,r));x("Borders",(n,o,r)=>{let a=n?n.parameter1:NaN;isNaN(a)?a=10:a=a&15;let h=new wt,l;return a===10?(l=e(o,0),i(l,o,r),s(l,0,r),i(l,0,0)):a===5?(l=e(0,0),i(l,o,0),s(l,o,r),i(l,0,r)):a===1?(l=e(0,0),i(l,o,0),s(l,o,r)):a===2?(l=e(o,0),i(l,o,r)):a===4?(l=e(o,r),i(l,0,r)):a===8?(l=e(0,r),i(l,0,0),s(l,o,r)):a===3?(l=e(0,0),i(l,o,0),i(l,o,r)):a===6?(l=e(o,0),i(l,o,r),i(l,0,r)):a===12?(l=e(o,r),i(l,0,r),i(l,0,0)):a===9?(l=e(0,r),i(l,0,0),i(l,o,0)):a===7?(l=e(0,0),i(l,o,0),i(l,o,r),i(l,0,r)):a===14?(l=e(o,0),i(l,o,r),i(l,0,r),i(l,0,0)):a===13?(l=e(o,r),i(l,0,r),i(l,0,0),i(l,o,0)):a===11?(l=e(0,r),i(l,0,0),i(l,o,0),i(l,o,r)):a===15?(l=e(0,0),i(l,o,0),i(l,o,r),i(l,0,r),l.add(new mt(2,0,0).close())):(l=e(0,0),s(l,o,r)),h.add(l),h})}C.lm={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};var Gs=(x=>(x[x.None=0]="None",x[x.Added=1]="Added",x[x.Removed=2]="Removed",x[x.Shown=4]="Shown",x[x.Hidden=8]="Hidden",x[x.NodeSized=16]="NodeSized",x[x.GroupLayout=32]="GroupLayout",x[x.NodeReplaced=64]="NodeReplaced",x[x.Standard=127]="Standard",x[x.All=16777215]="All",x))(Gs||{});class pt extends G{b;Qo;H;ul;dl;_o;ue;gl;Da;sn;tr;jd;VM;OD;xy;ky;constructor(t,e){let i;t===void 0||t instanceof Lt||typeof t=="string"?i=t:t&&(e=t),super(i),this.b=2408959,this.Qo="",this.H=null,this.ul="",this.dl=null,this._o=null,this.ue="",this.gl=null,this.Da=null,this.sn=new P(NaN,NaN).k(),this.tr=null,this.jd=NaN,this.VM=-1,this.OD=new I,this.xy=null,this.ky=NaN,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.b=this.b&-4097|16384|32768,t.Qo=this.Qo,this.H!==null&&(this.H.me?t.H=this.H:t.H=this.H.copy()),t.ul=this.ul,t._o=null,t.ue=this.ue,t.sn.h(this.sn),t.jd=this.jd}Ho(t){super.Ho(t),t.Sa(),t.dl=null,t.tr=null,t.xy=null}toString(){let t=m.Kn(this.constructor)+"#"+V.xs(this);return this.data!==null&&(t+="("+m.toString(this.data)+")"),t}static LayoutNone=0;static LayoutAdded=1;static LayoutRemoved=2;static LayoutShown=4;static LayoutHidden=8;static LayoutNodeSized=16;static LayoutGroupLayout=32;static LayoutNodeReplaced=64;static LayoutStandard=127;static LayoutAll=16777215;_e(){return this.H===null?this.H=new Gi:this.H.me&&(this.H=this.H.copy()),this.H}ba(){super.ba(),this.H!==null&&(this.H.me=!0)}df(t,e,i,s,n,o,r){let a=this.diagram;a!==null&&(t===3&&e==="elements"?n instanceof G?n.Pn(h=>{a.partManager.C2(h,a)}):n instanceof Bt&&a.R2(n):t===4&&e==="elements"&&(n instanceof G?n.Pn(h=>a.partManager.L2(h,a)):n instanceof Bt&&a.O2(n)),a.raiseChangedEvent(t,e,i,s,n,o,r))}updateTargetBindings(t){if(super.updateTargetBindings(t),this.data===null)return;let e=this.D.r,i=e.length;for(let n=0;n<i;n++){let o=e[n];o instanceof G&&o.Pn(r=>{r.data!==null&&r.JI(t)})}let s=this.adornments;for(;s.next();)s.value.updateTargetBindings(t)}Go(){if(super.Go(),this.ON()){let e=this.D.r,i=e.length;for(let s=0;s<i;s++){let n=e[s];n instanceof G&&n.Pn(o=>o.Go())}}let t=this.adornments;for(;t.next();)t.value.Go()}updateRelationshipsFromData(){this.data!==null&&this.diagram?.partManager.updateRelationshipsFromData(this)}get key(){let t=this.diagram;if(t!==null)return t.model.getKeyForNodeData(this.data)}get adornments(){return this._o===null?kt.instance:this._o.iteratorValues}findAdornment(t){let e=this._o;return e===null?null:e.get(t)}addAdornment(t,e){if(e===null)return;let i=null,s=this._o;if(s!==null&&(i=s.get(t)),i!==e){if(i!==null){let o=i.diagram;o!==null&&o.remove(i)}s===null&&(s=new Mt,this._o=s),e.Qo!==t&&(e.category=t),s.set(t,e);let n=this.diagram;if(n!==null){n.add(e);let o=e.adornedObject;if(o!==null){let r=o.findBindingPanel();r!==null&&(e.data=r.data)}}}}removeAdornment(t){let e=this._o;if(e===null)return;let i=e.get(t);if(i!==null){let s=i.diagram;s!==null&&(s.remove(i),i.data=null)}e.delete(t),e.count===0&&(this._o=null)}clearAdornments(){let t=this._o;if(t===null)return;let e=m.nt(),i=t.iterator;for(;i.next();){let n=i.key;e.push(n)}let s=e.length;for(let n=0;n<s;n++)this.removeAdornment(e[n]);m.Z(e)}updateAdornments(){let t=this.diagram;if(t===null)return;this.pE(t),this.yE(t);let e=this.adornments;for(;e.next();){let i=e.value;i.f(),i.hasPlaceholder()&&i.placeholder.f()}for(e=this.adornments;e.next();)e.value.updateTargetBindings()}invalidateAdornments(){let t=this.diagram;t!==null&&(t.ha(),this.ID()!==!0&&this.ED(!0))}BM(){this.ID()!==!1&&(this.updateAdornments(),this.ED(!1))}pE(t){let e="Selection";if(this.isSelected&&this.selectionAdorned){let i=this.selectionObject;if(i!==null&&this.actualBounds.isReal()&&this.isVisible()&&i.isVisibleObject()&&i.actualBounds.isReal()){let s=this.findAdornment(e);if(s===null){let n=this.selectionAdornmentTemplate;n===null&&(this.Lr()?n=t.linkSelectionAdornmentTemplate:this instanceof ht?n=t.groupSelectionAdornmentTemplate:n=t.nodeSelectionAdornmentTemplate),s=n.copy(),s!==null&&(this.Lr()&&this.selectionObject===this.path&&(s.type=G.Link),s.adornedObject=i)}if(s!==null){s.type===G.Link&&s.f(),this.addAdornment(e,s);return}}}this.removeAdornment(e)}yE(t){let e=this;t.toolManager.mouseDownTools.each(i=>{i.isEnabled&&i.updateAdornments(e)}),t.toolManager.updateAdornments(e)}EM(t){this.gl=t,t===null&&this.dI()}get layer(){return this.gl}get diagram(){let t=this.gl;return t==null?null:t.diagram}get layerName(){return this.ul}set layerName(t){let e=this.ul;if(e===t)return;let i=this.diagram;if(i!==null&&(i.findLayer(t)===null||i.partManager.addsToTemporaryLayer))return;this.ul=t,i!==null&&i.invalidateDocumentBounds(),this.t("layerName",e,t);let s=this.layer;if(s===null||s.name===t||(i=s.diagram,i===null))return;let n=i.findLayer(t);if(n===null||n===s)return;let o=s.ri(-1,this,!0);o>=0&&i.raiseChangedEvent(4,"parts",s,this,null,o,!0),o=n.ch(99999999,this,!0),s.visible!==n.visible&&this.Xe(n.visible),o>=0&&i.raiseChangedEvent(3,"parts",n,null,this,!0,o);let r=this.layerChanged;if(r===null)return;let a=i.G;i.G=!0,r(this,s,n),i.G=a}get layerChanged(){return this.H!==null?this.H.Py:null}set layerChanged(t){let e=this.layerChanged;e!==t&&(t!==null&&m.S(t,pt,"layerChanged"),this._e().Py=t,this.t("layerChanged",e,t))}get zOrder(){return this.jd}set zOrder(t){let e=this.jd;if(e===t)return;this.jd=t;let i=this.layer;i!==null&&i.rb(-1,this),this.t("zOrder",e,t);let s=this.diagram;s!==null&&s.C()}wE(){let t=this.layer;t!==null&&t.rb(-1,this)}hk(){if(this.fa()!==!1)return;this.cC(!0),this.pf();let t=this.diagram;t!==null&&(t.Cp(this),t.requestUpdate())}UD(){if(this.b|=2097152,this.fa()===!1)return;let t=this.position,e=this.location;(!e.isReal()||!t.isReal())&&this.VD(t,e);let i=this.De,s=I.l().h(i);i.ce(),i.x=t.x,i.y=t.y,i.k(),this.kd(s,i),I.i(s),this.cC(!1),this.pf()}ro(t,e,i,s){let n=this.hi;n.e(t,e,i,s),this.Se===null&&(this.Se=new Nt);let o=this.Se;o.Ue(),this.Kp(o,t,e,i,s),this.Se=o,o.RP()||o.sm(n)}Kp(t,e,i,s,n){if(this.it!==1&&t.it(this.it),this.Xt===0)return;let o=T.Center;this.locationSpot.isSpot()&&(o=this.locationSpot);let r=P.l();if(this.locationObject!==this){let a=this.locationObject,h=a.naturalBounds;r.setSpot(h.x,h.y,h.width,h.height,o),a.Se!==null&&a.Se.gt(r),r.offset(-a.measuredBounds.x,-a.measuredBounds.y);let l=a.panel;for(;l!==null&&l!==this;)l.Se!==null&&l.Se.gt(r),r.offset(-l.measuredBounds.x,-l.measuredBounds.y),l=l.panel}else r.setSpot(e,i,s,n,o);t.ks(this.Xt,r.x,r.y),P.i(r)}get locationObject(){if(this.tr===null)if(this instanceof vt&&this.type!==G.Link&&this.hasPlaceholder())this.tr=this.placeholder;else{let t=this.locationObjectName;if(t!==""){let e=this.findObject(t);e!==null?this.tr=e:this.tr=this}else this.tr=this}return this.tr?.visible?this.tr:this}get minLocation(){return this.H!==null?this.H.Sy:P.FL}set minLocation(t){let e=this.minLocation;e.equals(t)||(t=t.N(),this._e().Sy=t,this.t("minLocation",e,t))}get maxLocation(){return this.H!==null?this.H.My:P.RL}set maxLocation(t){let e=this.maxLocation;e.equals(t)||(t=t.N(),this._e().My=t,this.t("maxLocation",e,t))}get locationObjectName(){return this.H!==null?this.H.Ny:""}set locationObjectName(t){let e=this.locationObjectName;e!==t&&(this._e().Ny=t,this.tr=null,this.f(),this.t("locationObjectName",e,t))}get locationSpot(){return this.H!==null?this.H.Cy:T.TopLeft}set locationSpot(t){let e=this.locationSpot;e.equals(t)||(t=t.N(),this._e().Cy=t,this.f(),this.t("locationSpot",e,t))}move(t,e){e===!0?this.location=t:this.position=t}moveTo(t,e,i){let s=P.z(t,e);this.move(s,i),P.i(s)}isVisible(){if(!this.visible)return!1;let t=this.layer;if(t!==null){if(!t.visible)return!1;let i=t.diagram;if(i!==null&&i.animationManager.Wx(this))return!0}let e=this.containingGroup;return!(e!==null&&(!e.isSubGraphExpanded||!e.isVisible()))}Xe(t){let e=this.diagram;t?(this.invalidateLayout(4),this.invalidateAdornments(),e!==null&&e.Cp(this)):(this.invalidateLayout(8),this.clearAdornments()),this.Sa(),e!==null&&(e.invalidateDocumentBounds(),this instanceof J&&this.canAvoid()&&e.fd(this),e.C())}findObject(t){if(this.name===t)return this;let e=this.xy;if(e===null&&(this.xy=e=new Mt),e.get(t)!==null)return e.get(t);let i=super.findObject(t);return i!==null?(e.set(t,i),i):(e.set(t,null),null)}s0(){this.xy=null}getRelativePoint(t,e,i){i===void 0&&(i=new P);let s=e.isNoSpot()?T.Center:e,n=t.naturalBounds;if(i.e(n.width*s.x+s.offsetX,n.height*s.y+s.offsetY),t===null||t===this)return i;t.v.gt(i);let o=t.panel;for(;o!==null&&o!==this;)o.v.gt(i),o=o.panel;return this.Se!==null&&this.Se.gt(i),i.offset(-this.hi.x,-this.hi.y),i}getDocumentBounds(t){return t===void 0&&(t=new I),t.h(this.actualBounds)}ensureBounds(){this.ht(1/0,1/0),this.Ut()}uD(t){let e=this.locationSpot,i=this.locationObject,s=i.naturalBounds;s.isReal()||(s=I.em);let n=i instanceof et?i.strokeWidth:0;if(t.setSpot(0,0,s.width+n,s.height+n,e),i!==this){t.offset(-n/2,-n/2),i.v.gt(t);let o=i.panel;for(;o!==null&&o!==this;)o.v.gt(t),o=o.panel}return this.Se!==null&&this.Se.gt(t),t.offset(-this.hi.x,-this.hi.y),t}hh(t,e){let i=e===void 0?this.OD:e,s=this.xE(),n=s*2;if(!this.isShadowed)return i.e(t.x-1-s,t.y-1-s,t.width+2+n,t.height+2+n),i;let o=t.x,r=t.y,a=t.width,h=t.height,l=this.shadowBlur,u=this.shadowOffset;return a+=l,h+=l,o-=l/2,r-=l/2,u.x>0?a+=u.x:(o+=u.x,a-=u.x),u.y>0?h+=u.y:(r+=u.y,h-=u.y),i.e(o-1,r-1,a+2,h+2),i}eE(){return this.type===G.Link&&this instanceof vt&&this.category==="Selection"&&this.adornedObject instanceof et&&this.adornedPart.findMainElement()===this.adornedObject?this.adornedObject.strokeWidth:0}xE(){return isNaN(this.ky)&&(this.ky=this.xD()),this.ky}Tf(){this.ky=NaN}Ut(){if(this.as()===!1){this.UD();return}this.lo(!1);let t=this.De,e=I.l();e.h(t);let i=this.Ul();this.Pa(0,0,this.hi.width,this.hi.height);let s=this.position;this.VD(s,this.location),t.ce(),t.x=s.x,t.y=s.y,t.k(),this.kd(e,t),e.equals(t)?this.rs(i):this.Di()&&(!C.c(e.width,t.width)||!C.c(e.height,t.height))&&this.VM>=0&&this.invalidateLayout(16),I.i(e),this.cC(!1)}kd(t,e){let i=this.diagram;if(i===null)return;let s=!1;if(i.mh===!1&&t.isReal()){let n=I.l();n.h(i.documentBounds),n.subtractMargin(i.padding),t.x>n.x&&t.y>n.y&&t.right<n.right&&t.bottom<n.bottom&&e.x>n.x&&e.y>n.y&&e.right<n.right&&e.bottom<n.bottom&&(s=!0),I.i(n)}(this.bE()===!0||!t.equals(e))&&this.mT(s,i),i.C(),!(!t.isReal()&&!e.isReal()||t.equalsApproxClose(e))&&(this instanceof J&&!i.undoManager.isUndoingRedoing&&this.invalidateConnectedLinks(),this.Sa())}get location(){return this.sn}set location(t){let e=t.x,i=t.y,s=this.sn;(s.x!==e&&(!isNaN(s.x)||!isNaN(e))||s.y!==i&&(!isNaN(s.y)||!isNaN(i)))&&(t=t.copy(),this.kE(t,s)&&this.t("location",s,t.copy()))}kE(t,e){if(this.Lr())return!1;if(this.sn=t,this.b|=2097152,this.as()===!1){this.hk();let i=this.ct;if(i.isReal()){let s=this.diagram;if(s===null||s.animationManager.isTicking||!s.undoManager.isUndoingRedoing){let n=i.copy();i.e(i.x+(t.x-e.x),i.y+(t.y-e.y)),this.BD(s,i,n.x,n.y),this.t("position",n,i.copy())}}}return!0}vN(t,e,i){if(this.Lr()||!t.isReal())return!1;let s=this.diagram;if(s!==null&&this.BD(s,t,e,i),this.ct=t,this.b&=-2097153,this.sn.isReal()&&(s===null||s.animationManager.isTicking||!s.undoManager.isUndoingRedoing)){let n=this.sn;this.sn=new P(n.x+(t.x-e),n.y+(t.y-i)).k(),this.t("location",n,this.sn.copy())}return this.fa()===!1&&this.as()===!1&&(this.hk(),this.UD()),!0}BD(t,e,i,s){if(t===null||this instanceof vt)return;let n=t.animationManager;n.ke&&n.RA(this,new P(i,s),e,!1)}Ec(t,e,i){let s=this.sn,n=this.ct;if(i){if(s.x===t&&s.y===e)return;this.fa()||this.as()?n.e(NaN,NaN):n.e(n.x+t-s.x,n.y+e-s.y),s.e(t,e)}else{if(n.x===t&&n.y===e)return;s.e(s.x+t-n.x,s.y+e-n.y),n.e(t,e)}this.hk()}FN(){this.b&=-2097153,this.hk()}VD(t,e){let i=this.uD(P.l()),s=this.diagram,n=e.isReal(),o=t.isReal();n&&o?(this.b&2097152)!==0?this.zD(t,e,s,i):this.XD(t,e,s,i):n?this.zD(t,e,s,i):o&&this.XD(t,e,s,i),this.b|=2097152,P.i(i),this.pf()}zD(t,e,i,s){let n=t.x,o=t.y;if(t.e(e.x-s.x,e.y-s.y),i!==null){let r=i.animationManager,a=r.defaultAnimation.isAnimating;!a&&r.ke&&!(this instanceof vt)&&r.RA(this,new P(n,o),t,!1),!a&&!(t.x===n&&t.y===o)&&this.t("position",new P(n,o),t.copy())}}XD(t,e,i,s){let n=e.copy();e.e(t.x+s.x,t.y+s.y),!e.equals(n)&&i!==null&&this.t("location",n,e.copy())}mT(t,e){this.CN(!1),this instanceof J&&e.fd(this),!this.layer.isTemporary&&!t&&e.invalidateDocumentBounds();let i=this.De,s=e.viewportBounds;s.isReal()?this.Ul()?(i.BL(s,10)||this.rs(!1),this.updateAdornments()):this.isVisible()&&i.intersectsRect(s)?(this.rs(!0),this.updateAdornments()):this.invalidateAdornments():e._c=!0}Qr(){return!0}Di(){return!0}Lr(){return!1}Qs(){return!0}hasPlaceholder(){return!1}get category(){return this.Qo}set category(t){let e=this.Qo;if(e===t)return;this.svg!==null&&(this.svg.remove(),this.Ji(!0));let i=this.diagram,s=this.data,n=null;if(i!==null&&s!==null&&!(this instanceof vt)){let o=i.model.undoManager;o.isEnabled&&!o.isUndoingRedoing&&(n=this.clone(),n.D.addAll(this.D))}if(this.Qo=t,this.t("category",e,t),i!==null&&s!==null&&!(this instanceof vt)){let o=i.model;if(o.undoManager.isUndoingRedoing)return;if(this.Lr()){i.partManager.setLinkCategoryForData(s,t);let r=i.partManager.findLinkTemplateForCategory(t);if(r!==null){r.It();let a=r.copy();a!==null&&this.fC(a,e,t)}}else{o!==null&&o.setCategoryForNodeData(s,t);let r=i.partManager.findTemplateForNodeData(s,t);if(r!==null){r.It();let a=r.copy();if(a!==null&&!(a instanceof j)){let h=this.location.copy();this.fC(a,e,t),this.location.isReal()||(this.location=h)}}}if(n!==null){let r=this.clone();r.D.addAll(this.D),this.t("self",n,r)}}else if(this instanceof vt){let o=this.adornedPart;if(o!==null){let r=o._o;r!==null&&r.delete(e),o.addAdornment(this.category,this)}}}get self(){return this}set self(t){this.fC(t,this.category,t.category)}static GD=!1;fC(t,e,i){t.constructor!==this.constructor&&(pt.GD||(pt.GD=!0,m.ne('Should not change the class of the Part when changing category from "'+e+'" to "'+i+'"'),m.ne(" Old class: "+m.Kn(this.constructor)+", new class: "+m.Kn(t.constructor)+", part: "+this.toString()))),this.clearAdornments();let s=this.data,n=this.layerName,o=this.isSelected,r=this.isHighlighted,a=!0,h=!0,l=!1;this instanceof J&&(a=this.isTreeLeaf,h=this.isTreeExpanded,l=this.wasTreeExpanded),t.Ho(this),t.cloneProtected(this),this.Qo=i,this.svg!==null&&(this.svg.remove(),this.jc(),this.Ji(!0)),this.f(),this.C();let u=this.diagram,c=!0;u!==null&&(c=u.skipsUndoManager,u.skipsUndoManager=!0),this.te=s,this.b=o?this.b|4096:this.b&-4097,this.b=r?this.b|524288:this.b&-524289,this instanceof J&&(this.E=a?this.E|4:this.E&-5,this.E=h?this.E|1:this.E&-2,this.E=l?this.E|2:this.E&-3),s!==null&&this.updateTargetBindings();let d=this.layerName;d!==n&&(this.ul=n,this.layerName=d),u!==null&&(u.skipsUndoManager=c),this.Di()&&this.invalidateLayout(64)}canCopy(){if(!this.copyable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowCopy)return!1;let e=t.diagram;return e===null?!0:!!e.allowCopy}canDelete(){if(!this.deletable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowDelete)return!1;let e=t.diagram;return e===null?!0:!!e.allowDelete}canEdit(){if(!this.textEditable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowTextEdit)return!1;let e=t.diagram;return e===null?!0:!!e.allowTextEdit}canGroup(){if(!this.groupable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowGroup)return!1;let e=t.diagram;return e===null?!0:!!e.allowGroup}canMove(){if(!this.movable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowMove)return!1;let e=t.diagram;return e===null?!0:!!e.allowMove}canReshape(){if(!this.reshapable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowReshape)return!1;let e=t.diagram;return e===null?!0:!!e.allowReshape}canResize(){if(!this.resizable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowResize)return!1;let e=t.diagram;return e===null?!0:!!e.allowResize}canRotate(){if(!this.rotatable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowRotate)return!1;let e=t.diagram;return e===null?!0:!!e.allowRotate}canSelect(){if(!this.selectable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowSelect)return!1;let e=t.diagram;return e===null?!0:!!e.allowSelect}get copyable(){return(this.b&1)!==0}set copyable(t){let e=(this.b&1)!==0;e!==t&&(this.b=this.b^1,this.t("copyable",e,t))}get deletable(){return(this.b&2)!==0}set deletable(t){let e=(this.b&2)!==0;e!==t&&(this.b=this.b^2,this.t("deletable",e,t))}get textEditable(){return(this.b&4)!==0}set textEditable(t){let e=(this.b&4)!==0;e!==t&&(this.b=this.b^4,this.t("textEditable",e,t),this.invalidateAdornments())}get groupable(){return(this.b&8)!==0}set groupable(t){let e=(this.b&8)!==0;e!==t&&(this.b=this.b^8,this.t("groupable",e,t))}get movable(){return(this.b&16)!==0}set movable(t){let e=(this.b&16)!==0;e!==t&&(this.b=this.b^16,this.t("movable",e,t))}get selectionAdorned(){return(this.b&32)!==0}set selectionAdorned(t){let e=(this.b&32)!==0;e!==t&&(this.b=this.b^32,this.t("selectionAdorned",e,t),this.invalidateAdornments())}get isInDocumentBounds(){return(this.b&64)!==0}set isInDocumentBounds(t){let e=(this.b&64)!==0;if(e!==t){this.b=this.b^64;let i=this.diagram;i!==null&&i.invalidateDocumentBounds(),this.t("isInDocumentBounds",e,t)}}get isLayoutPositioned(){return(this.b&128)!==0}set isLayoutPositioned(t){let e=(this.b&128)!==0;e!==t&&(this.b=this.b^128,this.t("isLayoutPositioned",e,t),this.invalidateLayout(t?4:8))}get selectable(){return(this.b&256)!==0}set selectable(t){let e=(this.b&256)!==0;e!==t&&(this.b=this.b^256,this.t("selectable",e,t),this.invalidateAdornments())}get reshapable(){return(this.b&512)!==0}set reshapable(t){let e=(this.b&512)!==0;e!==t&&(this.b=this.b^512,this.t("reshapable",e,t),this.invalidateAdornments())}get resizable(){return(this.b&1024)!==0}set resizable(t){let e=(this.b&1024)!==0;e!==t&&(this.b=this.b^1024,this.t("resizable",e,t),this.invalidateAdornments())}get rotatable(){return(this.b&2048)!==0}set rotatable(t){let e=(this.b&2048)!==0;e!==t&&(this.b=this.b^2048,this.t("rotatable",e,t),this.invalidateAdornments())}get isSelected(){return(this.b&4096)!==0}set isSelected(t){let e=(this.b&4096)!==0;if(e!==t){let i=this.diagram;if(t){if(!this.canSelect())return;if(i!==null){let o=i.maxSelectionCount;if(i.selection.count>=o)return}}this.b=this.b^4096;let s=!1;if(i!==null){s=i.skipsUndoManager,i.skipsUndoManager=!0;let o=i.selection;o.ce(),t?o.add(this):o.delete(this),o.k()}this.t("isSelected",e,t),this.invalidateAdornments();let n=this.selectionChanged;n!==null&&n(this),i!==null&&(i.requestUpdate(),i.skipsUndoManager=s)}}get isHighlighted(){return(this.b&524288)!==0}set isHighlighted(t){let e=(this.b&524288)!==0;if(e!==t){this.b=this.b^524288;let i=this.diagram;if(i!==null){let n=i.highlighteds;n.ce(),t?n.add(this):n.delete(this),n.k()}this.t("isHighlighted",e,t),this.C();let s=this.highlightedChanged;s!==null&&s(this)}}get isShadowed(){return(this.b&8192)!==0}set isShadowed(t){let e=(this.b&8192)!==0;e!==t&&(this.b=this.b^8192,this.Ji(!0),this.t("isShadowed",e,t),this.C())}ID(){return(this.b&16384)!==0}ED(t){t?this.b|=16384:this.b&=-16385}fa(){return(this.b&32768)!==0}cC(t){t?this.b|=32768:this.b&=-32769}bE(){return(this.b&65536)!==0}CN(t){t?this.b|=65536:this.b&=-65537}Ul(){return(this.b&131072)!==0}rs(t){t?this.b|=131072:this.b&=-131073}YD(){return(this.b&1048576)!==0}ck(t){t?this.b|=1048576:this.b&=-1048577}get isAnimated(){return(this.b&262144)!==0}set isAnimated(t){let e=(this.b&262144)!==0;e!==t&&(this.b=this.b^262144,this.t("isAnimated",e,t))}get highlightedChanged(){return this.H!==null?this.H.Ly:null}set highlightedChanged(t){let e=this.highlightedChanged;e!==t&&(t!==null&&m.S(t,pt,"highlightedChanged"),this._e().Ly=t,this.t("highlightedChanged",e,t))}get selectionObjectName(){return this.H!==null?this.H.Ay:""}set selectionObjectName(t){let e=this.selectionObjectName;e!==t&&(this._e().Ay=t,this.dl=null,this.t("selectionObjectName",e,t))}get selectionAdornmentTemplate(){return this.H!==null?this.H.Ty:null}set selectionAdornmentTemplate(t){let e=this.selectionAdornmentTemplate;e!==t&&(t!==null&&t.It(),this._e().Ty=t,this.t("selectionAdornmentTemplate",e,t))}get selectionObject(){if(this.dl===null){let t=this.selectionObjectName;if(t!==null&&t!==""){let e=this.findObject(t);e!==null?this.dl=e:this.dl=this}else if(this instanceof j){let e=this.path;e!==null?this.dl=e:this.dl=this}else this.dl=this}return this.dl}get selectionChanged(){return this.H!==null?this.H.Dy:null}set selectionChanged(t){let e=this.selectionChanged;e!==t&&(t!==null&&m.S(t,pt,"selectionChanged"),this._e().Dy=t,this.t("selectionChanged",e,t))}get resizeAdornmentTemplate(){return this.H!==null?this.H.vy:null}set resizeAdornmentTemplate(t){let e=this.resizeAdornmentTemplate;e!==t&&(this._e().vy=t!==null?t.It():null,this.t("resizeAdornmentTemplate",e,t))}get resizeObjectName(){return this.H!==null?this.H.Fy:""}set resizeObjectName(t){let e=this.resizeObjectName;e!==t&&(this._e().Fy=t,this.t("resizeObjectName",e,t))}get resizeObject(){let t=this.resizeObjectName;if(t!==""){let e=this.findObject(t);if(e!==null)return e}return this}get resizeCellSize(){return this.H!==null?this.H.Ry:st.Zw}set resizeCellSize(t){let e=this.resizeCellSize;e.equals(t)||(t=t.N(),this._e().Ry=t,this.t("resizeCellSize",e,t))}get rotateAdornmentTemplate(){return this.H!==null?this.H.Oy:null}set rotateAdornmentTemplate(t){let e=this.rotateAdornmentTemplate;e!==t&&(this._e().Oy=t!==null?t.It():null,this.t("rotateAdornmentTemplate",e,t))}get rotateObjectName(){return this.H!==null?this.H.Iy:""}set rotateObjectName(t){let e=this.rotateObjectName;e!==t&&(this._e().Iy=t,this.t("rotateObjectName",e,t))}get rotateObject(){let t=this.rotateObjectName;if(t!==""){let e=this.findObject(t);if(e!==null)return e}return this}get rotationSpot(){return this.H!==null?this.H.Ey:T.Default}set rotationSpot(t){let e=this.rotationSpot;e.equals(t)||(t=t.N(),this._e().Ey=t,this.t("rotationSpot",e,t))}get text(){return this.ue}set text(t){let e=this.ue;e!==t&&(this.ue=t,this.t("text",e,t))}get containingGroup(){return this.Da}set containingGroup(t){if(this.Di()){let e=this.Da;if(e!==t){t!==null&&(this===t||t.isMemberOf(this))&&(this===t&&m.o("Cannot make a Group a member of itself: "+this.toString()),m.o("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+t.toString())),this.invalidateLayout(2);let i=this.diagram;if(e!==null?e.uC(this):this instanceof ht&&i!==null&&i.$r.delete(this),this.Da=t,t!==null?t.dC(this):this instanceof ht&&i!==null&&i.$r.add(this),this.invalidateLayout(1),i!==null&&i.G){let n=this.data,o=i.model;if(n!==null&&o.ff()){let r=t!==null?t.data:null;o.setGroupForData(n,o.getKeyForNodeData(r))}}let s=this.containingGroupChanged;if(s!==null){let n=!0;i!==null&&(n=i.G,i.G=!0),s(this,e,t),i!==null&&(i.G=n)}if(this instanceof ht){let n=new V;pt.ga(n,this,!0,0,!0);let o=n.iterator;for(;o.next();){let r=o.value;if(r instanceof J){let a=r.linksConnected;for(;a.next();)a.value.Wd()}}}if(this instanceof J){let n=this.linksConnected;for(;n.next();)n.value.Wd();let o=this.labeledLink;o!==null&&o.Wd()}this.t("containingGroup",e,t),t!==null&&t.wE()}}else m.o("cannot set the Part.containingGroup of a Link or Adornment")}Sa(){let t=this.containingGroup;t!==null&&(t.hasPlaceholder()&&t.placeholder.f(),t.f(),t.invalidateConnectedLinks())}C(){let t=this.diagram;t!==null&&!this.as()&&!this.fa()&&this.isVisible()&&this.De.isReal()&&t.C(this.hh(this.De))}f(){if(this.Xo())return;super.f();let t=this.diagram;t!==null&&(t.Cp(this),this instanceof J&&this.labeledLink!==null&&this.labeledLink.kf(),t.requestUpdate(!0))}kf(t){if(this.as())return;let e=this.diagram;e!==null&&(e.Cp(this),this instanceof J&&this.invalidateConnectedLinks(),e.requestUpdate()),this.lo(!0)}tp(t){if(!t){let e=this.Da;e!==null&&e.dC(this)}}ep(t){if(!t){let e=this.Da;e!==null&&e.uC(this)}}rf(){let t=this.data;if(t!==null){let e=this.diagram;if(e!==null){let i=e.model;i!==null&&i.removeNodeData(t)}}}get containingGroupChanged(){return this.H!==null?this.H.Uy:null}set containingGroupChanged(t){let e=this.containingGroupChanged;e!==t&&(t!==null&&m.S(t,pt,"containingGroupChanged"),this._e().Uy=t,this.t("containingGroupChanged",e,t))}findSubGraphLevel(){return this.gC(this)}gC(t){let e=t.containingGroup;if(e!==null)return 1+this.gC(e);if(t instanceof J){let i=t.labeledLink;if(i!==null)return this.gC(i)}return 0}findTopLevelPart(){return this.mC(this)}mC(t){let e=t.containingGroup;if(e!==null)return this.mC(e);if(t instanceof J){let i=t.labeledLink;if(i!==null)return this.mC(i)}return t}get isTopLevel(){return!(this.containingGroup!==null||this instanceof J&&this.labeledLink!==null)}isMemberOf(t){return t instanceof ht?this.pC(this,t):!1}pC(t,e){if(t===e||e===null)return!1;let i=t.containingGroup;if(i!==null&&(i===e||this.pC(i,e)))return!0;if(t instanceof J){let s=t.labeledLink;if(s!==null)return this.pC(s,e)}return!1}findCommonContainingGroup(t){if(t===null)return null;if(this===t)return this.containingGroup;let e=this;for(;e!==null;){if(e instanceof ht&&e.ck(!0),e instanceof J){let s=e.labeledLink;s!==null&&(e=s)}e=e.containingGroup}let i=null;for(e=t;e!==null;){if(e.YD()){i=e;break}if(e instanceof J){let s=e.labeledLink;s!==null&&(e=s)}e=e.containingGroup}for(e=this;e!==null;){if(e instanceof ht&&e.ck(!1),e instanceof J){let s=e.labeledLink;s!==null&&(e=s)}e=e.containingGroup}return i}get layoutConditions(){return this.H!==null?this.H.Vy:127}set layoutConditions(t){let e=this.layoutConditions;e!==t&&(this._e().Vy=t,this.t("layoutConditions",e,t))}canLayout(){if(!this.isLayoutPositioned||!this.isVisible())return!1;let t=this.layer;return!(t!==null&&t.isTemporary||this instanceof J&&this.isLinkLabel)}PE(t){if(!this.isLayoutPositioned||(t&this.layoutConditions)===0)return!1;let e=this.layer;if(e!==null&&e.isTemporary||this instanceof J&&this.isLinkLabel)return!1;let i=this.diagram;return!(i!==null&&i.undoManager.isUndoingRedoing)}invalidateLayout(t){if(t===void 0&&(t=16777215),!this.PE(t))return;let e=this.Da;if(e!==null){let i=e.layout;i!==null?i.p():e.invalidateLayout(t)}else{let i=this.diagram;if(i!==null){let s=i.layout;s!==null&&s.p()}}}pT(){if(!this.isVisible())return!1;let t=this.layer;return!(t!==null&&t.isTemporary)}static ga(t,e,i,s,n,o){if(o===void 0&&(o=null),!t.has(e)&&!(o!==null&&!o(e))&&!(e instanceof vt)){if(t.add(e),e instanceof J){if(i&&e instanceof ht){let r=e.memberParts;for(;r.next();){let a=r.value;pt.ga(t,a,i,s,n,o)}}if(n!==!1){let r=e.linksConnected;for(;r.next();){let a=r.value;if(t.has(a))continue;let h=a.fromNode,l=a.toNode,u=h===null||t.has(h),c=l===null||t.has(l);(n?u&&c:u||c)&&pt.ga(t,a,i,s,n,o)}}if(s>1){let r=e.findTreeChildrenNodes();for(;r.next();){let a=r.value;pt.ga(t,a,i,s-1,n,o)}}}else if(e instanceof j){let r=e.labelNodes;for(;r.next();){let a=r.value;pt.ga(t,a,i,s,n,o)}}}}get dragComputation(){return this.H!==null?this.H.By:null}set dragComputation(t){let e=this.dragComputation;e!==t&&(t!==null&&m.S(t,pt,"dragComputation"),this._e().By=t,this.t("dragComputation",e,t))}get shadowOffset(){return this.H!==null?this.H.zy:P.OL}set shadowOffset(t){let e=this.shadowOffset;e.equals(t)||(t=t.N(),this._e().zy=t,this.C(),this.t("shadowOffset",e,t))}get shadowColor(){return this.H!==null?this.H.Xy:"gray"}set shadowColor(t){let e=this.shadowColor;e!==t&&(this._e().Xy=t,this.C(),this.t("shadowColor",e,t))}get shadowBlur(){return this.H!==null?this.H.Ln:4}set shadowBlur(t){let e=this.shadowBlur;e!==t&&(this._e().Ln=t,this.C(),this.t("shadowBlur",e,t))}}class Gi{me;Py;Uy;Ty;Ay;Dy;Ly;vy;Fy;Ry;Oy;Iy;Ey;Ny;Cy;Sy;My;By;Vy;zy;Xy;Ln;constructor(){this.me=!1,this.Py=null,this.Uy=null,this.Ty=null,this.Ay="",this.Dy=null,this.Ly=null,this.vy=null,this.Fy="",this.Ry=st.Zw,this.Oy=null,this.Iy="",this.Ey=T.Default,this.Ny="",this.Cy=T.TopLeft,this.Sy=P.FL,this.My=P.RL,this.By=null,this.Vy=127,this.zy=P.OL,this.Xy="gray",this.Ln=4}copy(){let t=new Gi;return t.Py=this.Py,t.Uy=this.Uy,t.Ty=this.Ty,t.Ay=this.Ay,t.Dy=this.Dy,t.Ly=this.Ly,t.vy=this.vy,t.Fy=this.Fy,t.Ry=this.Ry.N(),t.Oy=this.Oy,t.Iy=this.Iy,t.Ey=this.Ey.N(),t.Ny=this.Ny,t.Cy=this.Cy.N(),t.Sy=this.Sy.N(),t.My=this.My.N(),t.By=this.By,t.Vy=this.Vy,t.zy=this.zy.N(),t.Xy=this.Xy,t.Ln=this.Ln,t}}class vt extends pt{Ms;Dt;WS;JS;Lf;constructor(t,e){let i;t===void 0||t instanceof Lt||typeof t=="string"?i=t:t&&(e=t),super(i),this.b&=-257,this.ul="Adornment",this.Ms=null,this.WS=0,this.JS=!1,this.Dt=null,this.Lf=null,e&&Object.assign(this,e)}toString(){let t=this.adornedPart;return"Adornment("+this.category+")"+(t!==null?t.toString():"")}updateRelationshipsFromData(){}Td(t){let e=this.adornedObject;if(!(e instanceof et))return;let i=e.part;if(!(i instanceof j))return;let s=i.path,n=s.geometry;i.Td(t),n=s.geometry;let o=this.D.r,r=o.length;for(let a=0;a<r;a++){let h=o[a];h.isPanelMain&&h instanceof et&&(h.ut=n)}}hasPlaceholder(){return this.Dt!==null&&this.Dt.isVisibleObject()}get placeholder(){return this.Dt}get adornedObject(){return this.Ms}set adornedObject(t){let e=this.adornedPart,i=null;t!==null&&(i=t.part),e!==null&&(t===null||e!==i)&&e.removeAdornment(this.category),this.Ms=t,i!==null&&i.addAdornment(this.category,this)}get adornedPart(){let t=this.Ms;return t!==null?t.part:null}Qr(){let t=this.Ms;if(t===null)return!0;let e=t.part;return e===null||!e.as()}Di(){return!1}get containingGroup(){return null}df(t,e,i,s,n,o,r){if(t===3&&e==="elements"){if(n instanceof le)this.Dt===null&&(this.Dt=n);else if(n instanceof G){let a=n.findInVisualTree(h=>h instanceof le);a instanceof le&&this.Dt===null&&(this.Dt=a)}}else t===4&&e==="elements"&&this.Dt!==null&&(s===this.Dt?this.Dt=null:s instanceof G&&this.Dt.isContainedBy(s)&&(this.Dt=null));super.df(t,e,i,s,n,o,r)}updateAdornments(){}rf(){}}var qs=(x=>(x[x.None=0]="None",x[x.Evenly=1]="Evenly",x[x.Packed=2]="Packed",x))(qs||{});class J extends pt{E;vt;zf;pl;va;ci;ee;constructor(t,e){let i;t===void 0||t instanceof Lt||typeof t=="string"?i=t:t&&(e=t),super(i),this.E=13,this.vt=null,this.ee=new q,this.zf=null,this.pl=null,this.ci=null,this.va=!1,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.E=this.E,this.vt!==null&&(this.vt.me?t.vt=this.vt:t.vt=this.vt.copy())}Ho(t){super.Ho(t),t.invalidateConnectedLinks(),t.pl=this.pl,t.ci=null}static SpreadingNone=0;static SpreadingEvenly=1;static SpreadingPacked=2;yl(){return this.vt===null?this.vt=new qi:this.vt.me&&(this.vt=this.vt.copy()),this.vt}ba(){super.ba(),this.vt!==null&&(this.vt.me=!0)}KD(t){t!==null&&(this.pl===null&&(this.pl=new V),this.pl.add(t))}HD(t){t!==null&&this.pl!==null&&this.pl.delete(t)}qD(t,e,i){if(t===null||this.pl===null)return null;let s=this.pl.iterator;for(;s.next();){let n=s.value;if(n.Gy===this&&n.fk===t&&n.yC===e&&n.wC===i||n.Gy===t&&n.fk===this&&n.yC===i&&n.wC===e)return n}return null}invalidateLinkBundle(t,e,i){e==null&&(e=""),i==null&&(i="");let s=this.qD(t,e,i);s!==null&&s.Jd()}df(t,e,i,s,n,o,r){t===3&&e==="elements"?this.ci=null:t===4&&e==="elements"&&(this.ci=null),super.df(t,e,i,s,n,o,r)}invalidateConnectedLinks(t,e){let i=this.linksConnected;for(;i.next();){let s=i.value;t&&t.has(s)||e&&s.fromPort!==e&&s.toPort!==e||(this.Ze(s.fromPort),this.Ze(s.toPort),s.$t())}}Ze(t){if(t===null)return;let e=t.yd;e!==null&&e.Jd();let i=t.part,s=i.containingGroup;s!==null&&!i.isVisible()&&s.Ze(s.port)}Qr(){return!0}get portSpreading(){return this.vt!==null?this.vt.Yy:1}set portSpreading(t){let e=this.portSpreading;if(e!==t){this.yl().Yy=t,this.t("portSpreading",e,t);let i=this.diagram;if(i!==null&&i.undoManager.isUndoingRedoing)return;this.invalidateConnectedLinks()}}get avoidable(){return(this.E&8)!==0}set avoidable(t){let e=(this.E&8)!==0;if(e!==t){this.E=this.E^8;let i=this.diagram;i!==null&&i.fd(this),this.t("avoidable",e,t)}}get avoidableMargin(){return this.vt!==null?this.vt.Ky:Dt.XL}set avoidableMargin(t){typeof t=="number"&&(t=new Dt(t));let e=this.avoidableMargin;if(!e.equals(t)){t=t.N(),this.yl().Ky=t;let i=this.diagram;i!==null&&i.fd(this),this.t("avoidableMargin",e,t)}}canAvoid(){return this.avoidable&&!this.isLinkLabel}getAvoidableRect(t){return t.set(this.actualBounds),t.addMargin(this.avoidableMargin),t}findVisibleNode(){let t=this;for(;t!==null&&!t.isVisible();)t=t.containingGroup;return t}isVisible(){if(!super.isVisible())return!1;let t=!0,e=1,i=this.diagram;if(i!==null){if(i.animationManager.Wx(this))return!0;t=i.isTreePathToChildren,e=i.treeCollapsePolicy}if(e===1){let n=this.findTreeParentNode();if(n!==null&&!n.isTreeExpanded)return!1}else if(e===2){let n=t?this.findLinksInto():this.findLinksOutOf(),o=!1,r=!1;for(;n.next();){let a=n.value;if(a.isTreeLink){o=!0;let h=t?a.fromNode:a.toNode;if(h&&h.isTreeExpanded){r=!0;break}}}if(o&&!r)return!1}else if(e===3){let n=t?this.findLinksInto():this.findLinksOutOf(),o=!1,r=!1;for(;n.next();){let a=n.value;if(a.isTreeLink){o=!0;let h=t?a.fromNode:a.toNode;if(h&&!h.isTreeExpanded){r=!0;break}}}if(o&&r)return!1}let s=this.labeledLink;return s!==null?s.isVisible():!0}Xe(t){super.Xe(t);let e=this.linksConnected;for(;e.next();){let i=e.value;if(t&&this.containingGroup!==null){let s=i.getOtherNode(this);s!==null&&!s.isMemberOf(this.containingGroup)&&i.$t()}i.Xe(t)}}get linksConnected(){return this.ee.iterator}findExternalTreeLinksConnected(){let t=new V,e=new V;return this.jD(this,t,e),e.iterator}jD(t,e,i){if(t===null||e.has(t))return;e.add(t);let s=!0,n=this.diagram;n!==null&&(s=n.isTreePathToChildren),t.linksConnected.each(o=>{o.isTreeLink?(s?o.fromNode===t:o.toNode===t)&&this.jD(s?o.toNode:o.fromNode,e,i):i.add(o)})}findLinksConnected(t){if(t===void 0&&(t=null),t===null)return this.ee.iterator;let e=new gt(this.ee),i=this;return e.predicate=s=>s.fromNode===i&&s.fromPortId===t||s.toNode===i&&s.toPortId===t,e}findLinksOutOf(t){t===void 0&&(t=null);let e=new gt(this.ee),i=this;return e.predicate=s=>s.fromNode!==i?!1:t===null?!0:s.fromPortId===t,e}findLinksInto(t){t===void 0&&(t=null);let e=new gt(this.ee),i=this;return e.predicate=s=>s.toNode!==i?!1:t===null?!0:s.toPortId===t,e}findNodesConnected(t){t===void 0&&(t=null);let e=null,i=null,s=this.ee.iterator;for(;s.next();){let n=s.value;if(n.fromNode===this){if(t===null||n.fromPortId===t){let o=n.toNode;e!==null?e.add(o):i!==null&&i!==o?(e=new V,e.add(i),e.add(o)):i=o}}else if(n.toNode===this&&(t===null||n.toPortId===t)){let o=n.fromNode;e!==null?e.add(o):i!==null&&i!==o?(e=new V,e.add(i),e.add(o)):i=o}}return e!==null?e.iterator:i!==null?new dt(i):kt.instance}findNodesOutOf(t){t===void 0&&(t=null);let e=null,i=null,s=this.ee.iterator;for(;s.next();){let n=s.value;if(n.fromNode===this&&(t===null||n.fromPortId===t)){let o=n.toNode;e!==null?e.add(o):i!==null&&i!==o?(e=new V,e.add(i),e.add(o)):i=o}}return e!==null?e.iterator:i!==null?new dt(i):kt.instance}findNodesInto(t){t===void 0&&(t=null);let e=null,i=null,s=this.ee.iterator;for(;s.next();){let n=s.value;if(n.toNode===this&&(t===null||n.toPortId===t)){let o=n.fromNode;e!==null?e.add(o):i!==null&&i!==o?(e=new V,e.add(i),e.add(o)):i=o}}return e!==null?e.iterator:i!==null?new dt(i):kt.instance}findLinksBetween(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null);let s=new gt(this.ee),n=this;return s.predicate=o=>o.fromNode===n&&o.toNode===t&&(e===null||o.fromPortId===e)&&(i===null||o.toPortId===i)||o.fromNode===t&&o.toNode===n&&(i===null||o.fromPortId===i)&&(e===null||o.toPortId===e),s}findLinksTo(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null);let s=new gt(this.ee),n=this;return s.predicate=o=>!(o.fromNode!==n||o.toNode!==t||e!==null&&o.fromPortId!==e||i!==null&&o.toPortId!==i),s}findSuccessorParts(t){return t===void 0&&(t=new V),this.WD(this,t),t.remove(this),t}WD(t,e){t!==null&&(e.has(t)||(e.add(t),t.findLinksOutOf().each(i=>{if(e.has(i))return;e.add(i);let s=i.toNode;s!==null&&this.WD(s,e)})))}findPredecessorParts(t){return t===void 0&&(t=new V),this.JD(this,t),t.remove(this),t}JD(t,e){t!==null&&(e.has(t)||(e.add(t),t.findLinksInto().each(i=>{if(e.has(i))return;e.add(i);let s=i.fromNode;s!==null&&this.JD(s,e)})))}get linkConnected(){return this.vt!==null?this.vt.Hy:null}set linkConnected(t){let e=this.linkConnected;e!==t&&(t!==null&&m.S(t,J,"linkConnected"),this.yl().Hy=t,this.t("linkConnected",e,t))}get linkDisconnected(){return this.vt!==null?this.vt.qy:null}set linkDisconnected(t){let e=this.linkDisconnected;e!==t&&(t!==null&&m.S(t,J,"linkDisconnected"),this.yl().qy=t,this.t("linkDisconnected",e,t))}get linkValidation(){return this.vt!==null?this.vt.El:null}set linkValidation(t){let e=this.linkValidation;e!==t&&(t!==null&&m.S(t,J,"linkValidation"),this.yl().El=t,this.t("linkValidation",e,t))}uk(t,e){this.Ze(e);let i=this.ee.has(t);if(i||this.ee.add(t),!i||t.fromNode===t.toNode){let s=this.linkConnected;if(s!==null){let n=!0,o=this.diagram;o!==null&&(n=o.G,o.G=!0),s(this,t,e),o!==null&&(o.G=n)}}if(!i){if(!t.isTreeLink)return;let s=t.fromNode,n=t.toNode;if(s!==null&&n!==null&&s!==n){let o=!0,r=this.diagram;r!==null&&(o=r.isTreePathToChildren);let a=o?n:s,h=o?s:n;if(a.va||(a.va=h),h.isTreeLeaf){if(r!==null&&r.undoManager.isUndoingRedoing)return;o?s===h&&(h.isTreeLeaf=!1):n===h&&(h.isTreeLeaf=!1)}}}}dk(t,e){this.Ze(e);let i=this.ee.delete(t),s=null;if(i||t.toNode===t.fromNode){let n=this.linkDisconnected;if(s=this.diagram,n!==null){let o=!0;s!==null&&(o=s.G,s.G=!0),n(this,t,e),s!==null&&(s.G=o)}}if(i){if(!t.isTreeLink)return;let n=!0;s!==null&&(n=s.isTreePathToChildren);let o=n?t.toNode:t.fromNode,r=n?t.fromNode:t.toNode;if(o!==null&&(o.va=!1),r!==null&&!r.isTreeLeaf)if(r.ee.count===0){if(r.va=null,s!==null&&s.undoManager.isUndoingRedoing)return;r.isTreeLeaf=!0}else r.vp()}}vp(){if(this.va=!1,this.ee.count===0)return;let t=!0,e=this.diagram;if(e!==null&&e.undoManager.isUndoingRedoing)return;e!==null&&(t=e.isTreePathToChildren);let i=this.ee.iterator;for(;i.next();){let s=i.value;if(s.isTreeLink){if(t){if(s.fromNode===this){this.isTreeLeaf=!1;return}}else if(s.toNode===this){this.isTreeLeaf=!1;return}}}this.isTreeLeaf=!0}updateRelationshipsFromData(){let t=this.diagram;t!==null&&t.partManager.updateRelationshipsFromData(this)}tp(t){if(super.tp(t),!t){this.vp();let e=this.zf;e!==null&&e.$D(this)}}ep(t){if(super.ep(t),!t){let e=this.zf;e!==null&&e.ZD(this)}}rf(){if(this.ee.count>0){let t=this.diagram;if(t!==null){let e=t.commandHandler!==null?t.commandHandler.deletesConnectedLinks:!0,i=this.ee.copy().iterator;for(;i.next();){let s=i.value;e?t.remove(s):(s.fromNode===this&&(s.fromNode=null),s.toNode===this&&(s.toNode=null))}}}this.labeledLink=null,super.rf()}get isLinkLabel(){return this.zf!==null}get labeledLink(){return this.zf}set labeledLink(t){let e=this.zf;if(e!==t){let i=this.diagram,s=this.data;if(e!==null){if(e.ZD(this),i!==null&&s!==null&&!i.undoManager.isUndoingRedoing){let n=e.data,o=i.model;if(n!==null&&o.jh()){let r=o.getKeyForNodeData(s);r!==void 0&&o.removeLabelKeyForLinkData(n,r)}}this.containingGroup=null}if(this.zf=t,t!==null){if(t.$D(this),i!==null&&s!==null&&!i.undoManager.isUndoingRedoing){let n=t.data,o=i.model;if(n!==null&&o.jh()){let r=o.getKeyForNodeData(s);r!==void 0&&o.addLabelKeyForLinkData(n,r)}}this.containingGroup=t.containingGroup}this.kf(),this.t("labeledLink",e,t)}}findVisiblePort(t){let e=t;for(;e!==null&&(!e.actualBounds.isReal()||!e.isVisibleObject());)e=e.panel;return e===null?this.port:e}findPort(t){if(this.ci===null){if(t===""&&this.Cn===!1)return this;this.QD()}let e=this.ci.get(t);return e!==null||t!==""&&(e=this.ci.get(""),e!==null)?e:this}get port(){return this.findPort("")}get ports(){return this.ci===null&&this.QD(),this.ci.iteratorValues}QD(){this.ci===null?this.ci=new Mt:this.ci.clear(),this.walkVisualTreeFrom(this,(t,e)=>t.oD(e)),this.ci.count===0&&this.ci.set("",this)}oD(t){let e=t.portId;e!==null&&this.ci!==null&&this.ci.set(e,t)}RN(t,e){let i=t.portId;if(i!==null){this.ci!==null&&this.ci.delete(i);let s=this.diagram;if(s!==null&&e){let n=null,o=this.findLinksConnected(i);for(;o.next();){let r=o.value;n===null&&(n=m.nt()),n.push(r)}if(n!==null){for(let r=0;r<n.length;r++){let a=n[r];s.remove(a)}m.Z(n)}}}}isInTreeOf(t){if(t===null||t===this)return!1;let e=!0,i=this.diagram;i!==null&&(e=i.isTreePathToChildren);let s=this,n=t,o;if(e)for(;s!==n;){o=null;let r=s.ee.iterator;for(;r.next();){let a=r.value;if(a.isTreeLink&&(o=a.fromNode,o!==s&&o!==this))break}if(o===this||o===null||o===s)return!1;s=o}else for(;s!==n;){o=null;let r=s.ee.iterator;for(;r.next();){let a=r.value;if(a.isTreeLink&&(o=a.toNode,o!==s&&o!==this))break}if(o===this||o===null||o===s)return!1;s=o}return!0}findTreeRoot(){let t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);let i=this,s;if(t)for(;;){s=null;let n=i.ee.iterator;for(;n.next();){let o=n.value;if(o.isTreeLink&&(s=o.fromNode,s!==i&&s!==this))break}if(s===this)return this;if(s===null||s===i)return i;i=s}else for(;;){s=null;let n=i.ee.iterator;for(;n.next();){let o=n.value;if(o.isTreeLink&&(s=o.toNode,s!==i&&s!==this))break}if(s===this)return this;if(s===null||s===i)return i;i=s}}findCommonTreeParent(t){if(t===null)return null;if(this===t)return this;let e=this;for(;e!==null;)e.ck(!0),e=e.findTreeParentNode();let i=null;for(e=t;e!==null;){if(e.YD()){i=e;break}e=e.findTreeParentNode()}for(e=this;e!==null;)e.ck(!1),e=e.findTreeParentNode();return i}findTreeParentLink(){let t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);let i=this.ee.iterator;if(t)for(;i.next();){let s=i.value;if(s.isTreeLink&&s.fromNode!==this)return s}else for(;i.next();){let s=i.value;if(s.isTreeLink&&s.toNode!==this)return s}return null}findTreeParentNode(){let t=this.va;if(t===null)return null;if(t instanceof J)return t;let e=this.diagram,i=e!==null?e.isTreePathToChildren:!0,s=this.ee.iterator;for(;s.next();){let n=s.value;if(!n.isTreeLink)continue;let o=i?n.fromNode:n.toNode;if(o!==this)return this.va=o,o}return this.va=null,null}findTreeParentChain(t){function e(i,s){s.add(i);let n=i.findTreeParentLink();if(n!==null){s.add(n);let o=i.findTreeParentNode();if(o===null)return;e(o,s)}}return t===void 0&&(t=new V),e(this,t),t}findTreeLevel(){return this.SE(this)}SE(t){let e=0,i=t.findTreeParentNode();for(;i!==null&&i!==t;)i=i.findTreeParentNode(),e++;return e}findTreeChildrenLinks(){let t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);let i=new gt(this.ee),s=this;return t?i.predicate=n=>!(!n.isTreeLink||n.fromNode!==s):i.predicate=n=>!(!n.isTreeLink||n.toNode!==s),i}findTreeChildrenNodes(){let t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);let i=null,s=null,n=this.ee.iterator;if(t)for(;n.next();){let o=n.value;if(o.isTreeLink&&o.fromNode===this){let r=o.toNode;i!==null?i.add(r):s!==null&&s!==r?(i=new q,i.add(s),i.add(r)):s=r}}else for(;n.next();){let o=n.value;if(o.isTreeLink&&o.toNode===this){let r=o.fromNode;i!==null?i.add(r):s!==null&&s!==r?(i=new q,i.add(s),i.add(r)):s=r}}return i!==null?i.iterator:s!==null?new dt(s):kt.instance}findTreeParts(t,e){return t===void 0&&(t=1/0),m.s(t,"number",J,"findTreeParts:level"),e===void 0&&(e=new V),pt.ga(e,this,!1,t,!0),e}collapseTree(t){t===void 0&&(t=1),t<1&&(t=1);let e=this.diagram;if(e===null||e.isCollapsingExpanding)return;e.isCollapsingExpanding=!0;let i=new V;i.add(this),this._D(i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===1),e.isCollapsingExpanding=!1}_D(t,e,i,s,n,o){if(i>1){let r=e?this.findLinksOutOf():this.findLinksInto();for(;r.next();){let a=r.value;if(!a.isTreeLink)continue;let h=a.getOtherNode(this);h!==null&&h!==this&&!t.has(h)&&(t.add(h),h._D(t,e,i-1,s,n,o))}}else this.tv(t,e,s,n,o)}tv(t,e,i,s,n){let o=s===this?!0:this.isTreeExpanded,r=e?this.findLinksOutOf():this.findLinksInto();for(;r.next();){let a=r.value;if(!a.isTreeLink)continue;let h=a.getOtherNode(this);if(h!==null&&h!==this){let l=t.has(h);if(l||t.add(h),o){let u=e?h.findNodesInto():h.findNodesOutOf(),c=this;u.all(d=>d===c||!d.isTreeExpanded)&&i.Yc(h,s),h.Sa(),h.Xe(!1)}h.isTreeExpanded&&(h.wasTreeExpanded=h.isTreeExpanded,l||h.tv(t,e,i,s,n))}}this.isTreeExpanded=!1}expandTree(t){t===void 0&&(t=2),t<2&&(t=2);let e=this.diagram;if(e===null||e.isCollapsingExpanding)return;e.isCollapsingExpanding=!0;let i=new V;i.add(this),this.ev(i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===1),e.isCollapsingExpanding=!1}ev(t,e,i,s,n,o){let r=n===this?!1:this.isTreeExpanded,a=e?this.findLinksOutOf():this.findLinksInto();for(;a.next();){let h=a.value;if(!h.isTreeLink)continue;r||h.Fi||h.$t();let l=h.getOtherNode(this);if(l!==null&&l!==this&&!t.has(l)){if(t.add(l),!r){l.Xe(!0),l.Sa();let u=e?l.findNodesInto():l.findNodesOutOf(),c=this;u.all(d=>d===c||!d.isTreeExpanded)&&s.Gc(l,n)}(i>2||l.wasTreeExpanded)&&(l.wasTreeExpanded=!1,l.ev(t,e,i-1,s,n,o))}}this.isTreeExpanded=!0}get isTreeExpanded(){return(this.E&1)!==0}set isTreeExpanded(t){let e=(this.E&1)!==0;if(e!==t){this.E=this.E^1;let i=this.diagram;this.t("isTreeExpanded",e,t);let s=this.treeExpandedChanged;if(s!==null){let n=!0;i!==null&&(n=i.G,i.G=!0),s(this),i!==null&&(i.G=n)}if(i!==null&&i.undoManager.isUndoingRedoing){this.Xe(t);return}t?this.expandTree():this.collapseTree()}}get wasTreeExpanded(){return(this.E&2)!==0}set wasTreeExpanded(t){let e=(this.E&2)!==0;e!==t&&(this.E=this.E^2,this.t("wasTreeExpanded",e,t))}get treeExpandedChanged(){return this.vt!==null?this.vt.jy:null}set treeExpandedChanged(t){let e=this.treeExpandedChanged;e!==t&&(t!==null&&m.S(t,J,"treeExpandedChanged"),this.yl().jy=t,this.t("treeExpandedChanged",e,t))}get isTreeLeaf(){return(this.E&4)!==0}set isTreeLeaf(t){let e=(this.E&4)!==0;e!==t&&(this.E=this.E^4,this.t("isTreeLeaf",e,t))}get isTreeRoot(){return this.findTreeParentLink()===null}}class qi{me;Hy;qy;El;jy;Ky;Yy;Wy;Jy;da;$y;constructor(){this.me=!1,this.Hy=null,this.qy=null,this.El=null,this.jy=null,this.Ky=Dt.XL,this.Yy=1,this.Wy=null,this.Jy=null,this.da=null,this.$y=null}copy(){let t=new qi;return t.Hy=this.Hy,t.qy=this.qy,t.El=this.El,t.jy=this.jy,t.Ky=this.Ky.N(),t.Yy=this.Yy,t.Wy=this.Wy,t.Jy=this.Jy,t.da=this.da,t.$y=this.$y,t}}var Hi=(x=>(x[x.None=0]="None",x[x.End=17]="End",x[x.Scale=18]="Scale",x[x.Stretch=19]="Stretch",x))(Hi||{}),Wi=(x=>(x[x.Normal=1]="Normal",x[x.Orthogonal=2]="Orthogonal",x[x.AvoidsNodes=6]="AvoidsNodes",x[x.AvoidsNodesStraight=7]="AvoidsNodesStraight",x))(Wi||{}),$i=(x=>(x[x.None=0]="None",x[x.Bezier=9]="Bezier",x[x.JumpGap=10]="JumpGap",x[x.JumpOver=11]="JumpOver",x))($i||{});class j extends pt{Mt;mo;po;$d;yo;wo;Zd;Xf;Qd;_d;tg;Wh;eg;nn;Me;wl;Dr;xl;er;xC;bC;gk;kC;PC;Jh;mk;ut;ir;static $h=null;static Zh=null;Lf;SC;MC;constructor(t){super(G.Link),this.Mt=8,this.mo=null,this.po="",this.$d=null,this.yo=null,this.wo="",this.Zd=null,this.Xf=0,this.Qd=0,this._d=0,this.tg=NaN,this.Wh=1,this.eg=.5,this.nn=null,this.Me=new q().k(),this.wl=null,this.Dr=null,this.xl=new I,this.ut=new wt,this.er=null,this.ir=null,this.xC=P.gn,this.bC=P.gn,this.SC=0,this.MC=0,this.gk=new P,this.kC=null,this.PC=null,this.Jh=null,this.mk=NaN,this.ft=null,this.Lf=[],t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Mt=this.Mt&-113,t.po=this.po,t.$d=this.$d,t.wo=this.wo,t.Zd=this.Zd,t.Xf=this.Xf,t.Qd=this.Qd,t._d=this._d,t.tg=this.tg,t.Wh=this.Wh,t.eg=this.eg,this.ft!==null&&(t.ft=this.ft.copy())}Ho(t){super.Ho(t),this.po=t.po,this.wo=t.wo,t.wl=null,t.$t(),t.ir=this.ir;let e=t.fromPort;e!==null&&t.fromNode.Ze(e);let i=t.toPort;i!==null&&t.toNode.Ze(i)}fe(t){t in Wi||t in $i||t in Hi?j.NC(t)?this.routing=t:t===9||t===10||t===11?this.curve=t:t===17||t===18||t===19?this.adjusting=t:t===1||t===0||m.o("Unknown Link enum value for a Link property: "+t):super.fe(t)}static Normal=1;static Orthogonal=2;static AvoidsNodes=6;static AvoidsNodesStraight=7;static None=0;static Bezier=9;static JumpGap=10;static JumpOver=11;static End=17;static Scale=18;static Stretch=19;static OrientAlong=21;static OrientPlus90=22;static OrientMinus90=23;static OrientOpposite=24;static OrientUpright=25;static OrientPlus90Upright=26;static OrientMinus90Upright=27;static OrientUpright45=28;static iv=8;static sv=16;static Fa=8;static J1=3;static nv=3;static ov=1.333;static CC=1;static LC=0;static rv=10;static Gf=9999;static lv=30;static av=30;static AC=10;static hv=10;static cv=14;static fv=30;static uv=14;static eT=8;static iT=8;static dv=11;static setRoutingParameter(t,e){switch(t){case 1:j.iv=e;break;case 2:j.sv=e;break;case 3:j.Fa=e;break;case 4:j.J1=e;break;case 5:j.nv=e;break;case 6:j.ov=e;break;case 7:j.CC=e;break;case 8:j.LC=e;break;case 9:j.rv=e;break;case 10:j.Gf=e;break;case 11:j.lv=e;break;case 12:j.av=e;break;case 13:j.AC=e;break;case 14:j.hv=e;break;case 15:j.cv=e;break;case 16:j.fv=e;break;case 17:j.uv=e;break;case 18:j.eT=e;break;case 19:j.iT=e;break;case 20:j.dv=e;break}t>29&&t<71&&(j.UT=t+parseInt(e.toString().slice(0,-1)))}static UT;Wi(){return this.ft===null&&(this.ft=new Ni),this.ft}EI(t,e,i){let s=t.segmentIndex,n=t.segmentFraction,o=t.alignmentFocus,r=t.segmentOrientation,a=t.segmentOffset,h=0,l=0,u=0,c=0;if(isNaN(s)){let L=this.ut,M=m.nt();L.getPointAndAngleAlongPath(n,M);let A=P.z(M[0],M[1]);if(c=M[2],A.add(this.getPoint(0)),L.type===1)A.offset(-L.startX,-L.startY);else{let F=L.figures.first();A.offset(-F.startX,-F.startY)}r!==0&&(u=this.computeAngle(t,r,c),t.angle=u),h=A.x,l=A.y,P.i(A),m.Z(M)}else if(s<-e||s>=e){let L=P.l();this.qN(L),c=this.midAngle,r!==0&&(u=this.computeAngle(t,r,c),t.angle=u),h=L.x,l=L.y,P.i(L)}else{let L,M,A=0;if(s>=0?(L=i.r[s],M=s<e-1?i.r[s+1]:L):(A=e+s,L=i.r[A],M=A>0?i.r[A-1]:L),L.equalsApprox(M)){let F,O;s>=0?(F=s>0?i.r[s-1]:L,O=s<e-2?i.r[s+2]:M):(F=A<e-1?i.r[A+1]:L,O=A>1?i.r[A-2]:M);let E=F.distanceSquaredPoint(L),B=M.distanceSquaredPoint(O);E>B+10?c=s>=0?F.directionPoint(L):L.directionPoint(F):B>E+10?c=s>=0?M.directionPoint(O):O.directionPoint(M):c=s>=0?F.directionPoint(O):O.directionPoint(F)}else c=s>=0?L.directionPoint(M):M.directionPoint(L);r!==0&&(u=this.computeAngle(t,r,c),t.angle=u),h=L.x+(M.x-L.x)*n,l=L.y+(M.y-L.y)*n}if(o.isNone()){t.moveTo(h,l,!0);return}else o.isNoSpot()&&(o=T.Center);let d=Nt.l();d.Ue(),d.it(t.scale,t.scale),d.ks(t.angle,0,0);let f=t.naturalBounds,p=I.z(0,0,f.width,f.height),g=P.l();g.setRectSpot(p,o),d.gt(g);let y=-g.x,b=-g.y,v=f.width,w=f.height,k=P.bs(a),S=isNaN(a.x),N=isNaN(a.y);if(S||N){let L=v/2+j.J1,M=w/2+j.nv,A=c>=45&&c<=135,F=c>=225&&c<=315;r===0&&(A||F)?(k.x=N?L:a.y,k.y=S?M:a.x,A?s>=0||isNaN(s)&&n<.5||S&&(k.y=-M):F&&((s>=0||isNaN(s)&&n<.5)&&S&&(k.y=-M),N&&(k.x=-L))):(S&&(s>=0||isNaN(s)&&n<.5?k.x=L:k.x=-L),N&&(k.y=-M),k.rotate(c))}else k.rotate(c);h+=k.x,l+=k.y,d.sm(p),y+=p.x,b+=p.y;let D=P.z(h+y,l+b);t.move(D),P.i(D),P.i(k),P.i(g),I.i(p),Nt.i(d)}Qr(){let t=this.fromNode;if(t!==null){let i=t.findVisibleNode();if(i!==null&&(t=i),t.as()||t.fa())return!1}let e=this.toNode;if(e!==null){let i=e.findVisibleNode();if(i!==null&&(e=i),e.as()||e.fa())return!1}return!0}vN(t,e,i){return!1}FN(){}Di(){return!1}computeAngle(t,e,i){return j.computeAngle(e,i)}static computeAngle(t,e){let i=0;switch(t){default:case 0:i=0;break;case 21:i=e;break;case 22:i=e+90;break;case 23:i=e-90;break;case 24:i=e+180;break;case 25:i=C.Ee(e),i>90&&i<270&&(i-=180);break;case 26:i=C.Ee(e+90),i>90&&i<270&&(i-=180);break;case 27:i=C.Ee(e-90),i>90&&i<270&&(i-=180);break;case 28:if(i=C.Ee(e),i>45&&i<135||i>225&&i<315)return 0;i>90&&i<270&&(i-=180);break}return C.Ee(i)}get fromNode(){return this.mo}set fromNode(t){let e=this.mo;if(e!==t){let i=this.fromPort;e!==null&&(this.yo!==e&&e.dk(this,i),this.Zy(),this.invalidateLayout(2)),this.mo=t,t!==null&&this.Xe(t.isVisible()),this.er=null,this.$t();let s=this.diagram;s!==null&&s.G&&s.partManager.setFromNodeForLink(this,t,e);let n=this.fromPort,o=this.fromPortChanged;if(o!==null){let r=!0;s!==null&&(r=s.G,s.G=!0),o(this,i,n),s!==null&&(s.G=r)}t!==null&&(this.yo!==t&&t.uk(this,n),this.Qy(),this.invalidateLayout(1)),this.t("fromNode",e,t),this.Wd()}}get fromPortId(){return this.po}set fromPortId(t){let e=this.po;if(e!==t){let i=this.fromPort;i!==null&&this.fromNode?.Ze(i),this.Zy(),this.po=t;let s=this.fromPort;s!==null&&this.fromNode?.Ze(s);let n=this.diagram;if(n!==null){let o=this.data,r=n.model;o!==null&&r.jh()&&r.setFromPortIdForLinkData(o,t)}if(i!==s){this.er=null,this.$t();let o=this.fromPortChanged;if(o!==null){let r=!0;n!==null&&(r=n.G,n.G=!0),o(this,i,s),n!==null&&(n.G=r)}}this.Qy(),this.t("fromPortId",e,t)}}get fromPort(){let t=this.mo;if(t===null)return null;let e=this.po;return t.findPort(e)}get fromPortChanged(){return this.$d}set fromPortChanged(t){let e=this.$d;e!==t&&(t!==null&&m.S(t,j,"fromPortChanged"),this.$d=t,this.t("fromPortChanged",e,t))}get toNode(){return this.yo}set toNode(t){let e=this.yo;if(e!==t){let i=this.toPort;e!==null&&(this.mo!==e&&e.dk(this,i),this.Zy(),this.invalidateLayout(2)),this.yo=t,t!==null&&this.Xe(t.isVisible()),this.er=null,this.$t();let s=this.diagram;s!==null&&s.G&&s.partManager.setToNodeForLink(this,t,e);let n=this.toPort,o=this.toPortChanged;if(o!==null){let r=!0;s!==null&&(r=s.G,s.G=!0),o(this,i,n),s!==null&&(s.G=r)}t!==null&&(this.mo!==t&&t.uk(this,n),this.Qy(),this.invalidateLayout(1)),this.t("toNode",e,t),this.Wd()}}get toPortId(){return this.wo}set toPortId(t){let e=this.wo;if(e!==t){let i=this.toPort;i!==null&&this.toNode?.Ze(i),this.Zy(),this.wo=t;let s=this.toPort;s!==null&&this.toNode?.Ze(s);let n=this.diagram;if(n!==null){let o=this.data,r=n.model;o!==null&&r.jh()&&r.setToPortIdForLinkData(o,t)}if(i!==s){this.er=null,this.$t();let o=this.toPortChanged;if(o!==null){let r=!0;n!==null&&(r=n.G,n.G=!0),o(this,i,s),n!==null&&(n.G=r)}}this.Qy(),this.t("toPortId",e,t)}}get toPort(){let t=this.yo;if(t===null)return null;let e=this.wo;return t.findPort(e)}get toPortChanged(){return this.Zd}set toPortChanged(t){let e=this.Zd;e!==t&&(t!==null&&m.S(t,j,"toPortChanged"),this.Zd=t,this.t("toPortChanged",e,t))}get fromSpot(){return this.ft!==null?this.ft.Dh:T.Default}set fromSpot(t){let e=this.fromSpot;if(!e.equals(t)){if(t=t.N(),this.Wi().Dh=t,this.t("fromSpot",e,t),e.isSide()||t.isSide()){let i=this.fromNode;i!==null&&i.Ze(this.fromPort)}this.$t()}}get fromEndSegmentLength(){return this.ft!==null?this.ft.Fh:NaN}set fromEndSegmentLength(t){let e=this.fromEndSegmentLength;if(e!==t){if(t<0&&m.J(t,">= 0",j,"fromEndSegmentLength"),this.Wi().Fh=t,this.t("fromEndSegmentLength",e,t),this.computeSpot(!0,this.fromPort).isSide()){let i=this.fromNode;i!==null&&i.Ze(this.fromPort)}this.$t()}}get fromShortLength(){return this.ft!==null?this.ft.Oh:NaN}set fromShortLength(t){let e=this.fromShortLength;e!==t&&(this.Wi().Oh=t,this.ai(),this.t("fromShortLength",e,t))}get toSpot(){return this.ft!==null?this.ft.vh:T.Default}set toSpot(t){let e=this.toSpot;if(!e.equals(t)){if(t=t.N(),this.Wi().vh=t,this.t("toSpot",e,t),e.isSide()||t.isSide()){let i=this.toNode;i!==null&&i.Ze(this.toPort)}this.$t()}}get toEndSegmentLength(){return this.ft!==null?this.ft.Rh:NaN}set toEndSegmentLength(t){let e=this.toEndSegmentLength;if(e!==t){if(t<0&&m.J(t,">= 0",j,"toEndSegmentLength"),this.Wi().Rh=t,this.t("toEndSegmentLength",e,t),this.computeSpot(!1,this.toPort).isSide()){let i=this.toNode;i!==null&&i.Ze(this.toPort)}this.$t()}}get toShortLength(){return this.ft!==null?this.ft.Ih:NaN}set toShortLength(t){let e=this.toShortLength;e!==t&&(this.Wi().Ih=t,this.ai(),this.t("toShortLength",e,t))}Wd(){let t=this.fromNode,e=this.toNode,i=null;if(t!==null?e!==null?i=t.findCommonContainingGroup(e):i=t.containingGroup:e!==null?i=e.containingGroup:i=null,this.ME(i),this.isLabeledLink){let s=this.labelNodes;for(;s.next();){let n=s.value;n.containingGroup=i}}}ME(t){let e=this.Da;if(e!==t){e!==null&&e.uC(this),this.Da=t,t!==null&&t.dC(this);let i=this.containingGroupChanged;if(i!==null){let s=!0,n=this.diagram;n!==null&&(s=n.G,n.G=!0),i(this,e,t),n!==null&&(n.G=s)}this.Fi&&(this.kC===e||this.PC===e)&&this.$t()}}Sa(){let t=this.containingGroup;t!==null&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&super.Sa()}getOtherNode(t){let e=this.fromNode;return t===e?this.toNode:e}getOtherPort(t){let e=this.fromPort;return t===e?this.toPort:e}get isLabeledLink(){return this.nn===null?!1:this.nn.count>0}get labelNodes(){return this.nn===null?kt.instance:this.nn.iterator}$D(t){this.nn===null&&(this.nn=new V),this.nn.add(t),this.f()}ZD(t){this.nn!==null&&(this.nn.delete(t),this.f())}tp(t){if(super.tp(t),this.Qh()&&this.invalidateOtherJumpOvers(this.actualBounds),!t){let e=this.mo,i=null;e!==null&&(i=this.fromPort,e.uk(this,i));let s=this.yo,n=null;s!==null&&(n=this.toPort,(s!==e||n!==i)&&s.uk(this,n)),this.Qy()}}ep(t){if(super.ep(t),this.Qh()&&this.invalidateOtherJumpOvers(this.actualBounds),!t){let e=this.mo,i=null;e!==null&&(i=this.fromPort,e.dk(this,i));let s=this.yo,n=null;s!==null&&(n=this.toPort,(s!==e||n!==i)&&s.dk(this,n)),this.Zy()}}rf(){if(this.Fi=!0,this.nn!==null){let t=this.diagram;if(t!==null){let e=this.nn.copy().iterator;for(;e.next();){let i=e.value;t.remove(i)}}}if(this.data!==null){let t=this.diagram;t!==null&&t.partManager.TC(this)}}updateRelationshipsFromData(){if(this.data===null)return;let t=this.diagram;t!==null&&t.partManager.updateRelationshipsFromData(this)}move(t,e){let i=e?this.location:this.position,s=i.x;isNaN(s)&&(s=0);let n=i.y;isNaN(n)&&(n=0);let o=t.x-s,r=t.y-n;if(e===!0)super.move(t,!1);else{let h=P.z(i.x+o,i.y+r);super.move(h,!1),P.i(h)}this.kr(o,r);let a=this.labelNodes;for(;a.next();){let h=a.value,l=h.position;h.moveTo(l.x+o,l.y+r)}}get relinkableFrom(){return(this.Mt&1)!==0}set relinkableFrom(t){let e=(this.Mt&1)!==0;e!==t&&(this.Mt=this.Mt^1,this.t("relinkableFrom",e,t),this.invalidateAdornments())}get relinkableTo(){return(this.Mt&2)!==0}set relinkableTo(t){let e=(this.Mt&2)!==0;e!==t&&(this.Mt=this.Mt^2,this.t("relinkableTo",e,t),this.invalidateAdornments())}canRelinkFrom(){if(!this.relinkableFrom)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowRelink)return!1;let e=t.diagram;return!(e!==null&&!e.allowRelink)}canRelinkTo(){if(!this.relinkableTo)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowRelink)return!1;let e=t.diagram;return!(e!==null&&!e.allowRelink)}get resegmentable(){return(this.Mt&4)!==0}set resegmentable(t){let e=(this.Mt&4)!==0;e!==t&&(this.Mt=this.Mt^4,this.t("resegmentable",e,t),this.invalidateAdornments())}get isTreeLink(){return(this.Mt&8)!==0}set isTreeLink(t){let e=(this.Mt&8)!==0;e!==t&&(this.Mt=this.Mt^8,this.t("isTreeLink",e,t),this.fromNode!==null&&this.fromNode.vp(),this.toNode!==null&&this.toNode.vp())}get path(){let t=this.findMainElement();return t instanceof et?t:null}get routeBounds(){return this.updateRoute(),this.xl}DC(t){let e=1/0,i=1/0,s=this.pointsCount;if(s===0)return t.e(NaN,NaN,0,0),t;if(s===1){let n=this.getPoint(0);e=Math.min(n.x,e),i=Math.min(n.y,i),t.e(n.x,n.y,0,0)}else if(s===2){let n=this.getPoint(0),o=this.getPoint(1);e=Math.min(n.x,o.x),i=Math.min(n.y,o.y),t.e(n.x,n.y,0,0),t.unionPoint(o)}else if(this.computeCurve()===9&&s>=3&&!this.isOrthogonal){let n=this.getPoint(0);if(e=n.x,i=n.y,t.e(e,i,0,0),s===3){let o=this.getPoint(1);e=Math.min(o.x,e),i=Math.min(o.y,i);let r=this.getPoint(2);e=Math.min(r.x,e),i=Math.min(r.y,i),C.Mu(n.x,n.y,o.x,o.y,o.x,o.y,r.x,r.y,.5,t)}else for(let o=3;o<s;o+=3){let r=this.getPoint(o-2);o+3>=s&&(o=s-1);let a=this.getPoint(o-1),h=this.getPoint(o);C.Mu(n.x,n.y,r.x,r.y,a.x,a.y,h.x,h.y,.5,t),e=Math.min(h.x,e),i=Math.min(h.y,i),n=h}}else{let n=this.getPoint(0),o=this.getPoint(1);e=Math.min(n.x,o.x),i=Math.min(n.y,o.y),t.e(n.x,n.y,0,0),t.unionPoint(o);for(let r=2;r<s;r++){let a=this.getPoint(r);e=Math.min(a.x,e),i=Math.min(a.y,i),t.unionPoint(a)}}return this.gk.e(e-t.x,i-t.y),t}get midPoint(){return this.qN(new P)}qN(t){return this.updateRoute(),this.computeMidPoint(t)}computeMidPoint(t){let e=this.pointsCount;if(e===0)return t.h(P.gn),t;if(e===1)return t.h(this.getPoint(0)),t;if(e===2){let l=this.getPoint(0),u=this.getPoint(1);return t.e((l.x+u.x)/2,(l.y+u.y)/2),t}if(this.isOrthogonal&&(this.computeCorner()>=15||this.computeCurve()===9)){this.ut.getPointAlongPath(.5,t),t.add(this.getPoint(0));let l=this.ut.figures.first();return t.offset(-l.startX,-l.startY),t}if(this.computeCurve()===9){if(e===3){let c=this.getPoint(0),d=this.getPoint(1),f=this.getPoint(2);return C.HL(c.x,c.y,d.x,d.y,d.x,d.y,f.x,f.y,t),t}let l=(e-1)/3|0,u=(l/2|0)*3;if(l%2===1){let c=this.getPoint(u),d=this.getPoint(u+1),f=this.getPoint(u+2),p=this.getPoint(u+3);return C.HL(c.x,c.y,d.x,d.y,f.x,f.y,p.x,p.y,t),t}else return t.h(this.getPoint(u)),t}let i=this.flattenedLengths,s=this.flattenedTotalLength,n=0,o=0,r=0;for(;n<s/2&&o<e&&(r=i[o],!(n+r>s/2));)n+=r,o++;let a=this.getPoint(o),h=this.getPoint(o+1);if(Math.abs(a.x-h.x)<1)a.y>h.y?t.e(a.x,a.y-(s/2-n)):t.e(a.x,a.y+(s/2-n));else if(Math.abs(a.y-h.y)<1)a.x>h.x?t.e(a.x-(s/2-n),a.y):t.e(a.x+(s/2-n),a.y);else{let l=(s/2-n)/r,u=l*(h.x-a.x),c=l*(h.y-a.y);t.e(a.x+u,a.y+c)}return t}get midAngle(){return this.updateRoute(),this.computeMidAngle()}computeMidAngle(){let t=this.pointsCount;if(t<2)return NaN;if(t===2){let h=this.getPoint(0),l=this.getPoint(1);return h.directionPoint(l)}if(this.isOrthogonal&&(this.computeCorner()>=15||this.computeCurve()===9))return this.ut.getAngleAlongPath(.5);if(this.computeCurve()===9&&t>=4){let h=(t-1)/3|0,l=(h/2|0)*3;if(h%2===1){l=Math.floor(l);let u=this.getPoint(l),c=this.getPoint(l+1),d=this.getPoint(l+2),f=this.getPoint(l+3);return C.qF(u.x,u.y,c.x,c.y,d.x,d.y,f.x,f.y)}else if(l>0&&l+1<t){let u=this.getPoint(l-1),c=this.getPoint(l+1);return u.directionPoint(c)}}let e=this.flattenedLengths,i=this.flattenedTotalLength,s=0,n=0,o=0;for(;s<i/2&&n<t&&(o=e[n],!(s+o>i/2));)s+=o,n++;let r=this.getPoint(n),a=this.getPoint(n+1);if(Math.abs(r.x-a.x)<.5&&Math.abs(r.y-a.y)<j.CC){if(n>0&&n<t-2){let h=this.getPoint(n-1),l=this.getPoint(n+2);return h.x<l.x?0:h.x>l.x?180:h.y<l.y?90:270}}else if(Math.abs(r.y-a.y)<.5&&Math.abs(r.x-a.x)<j.CC&&n>0&&n<t-2){let h=this.getPoint(n-1),l=this.getPoint(n+2);return h.y<l.y?90:h.y>l.y?270:h.x<l.x?0:180}return r.directionPoint(a)}get flattenedLengths(){return this.Jh!==null?this.Jh:(this.Fi||this.pk(),this.NE())}get flattenedTotalLength(){let t=this.mk;if(isNaN(t)){let e=this.flattenedLengths,i=e.length;t=0;for(let s=0;s<i;s++)t+=e[s];this.mk=t}return t}NE(){this.Jh===null?this.Jh=[]:this.Jh.length=0;let t=this.Jh,e=this.pointsCount;for(let i=0;i<e-1;i++){let s=0,n=this.getPoint(i),o=this.getPoint(i+1);C.X(n.x,o.x)?(s=o.y-n.y,s<0&&(s=-s),t.push(s)):C.X(n.y,o.y)?(s=o.x-n.x,s<0&&(s=-s),t.push(s)):(s=Math.sqrt(n.distanceSquaredPoint(o)),t.push(s))}return t}get points(){return this.Me}set points(t){let e=this.Me;if(e===t)return;let i=null;if(Array.isArray(t))i=this.convertPointsArrayToList(t);else if(t instanceof q){i=t.copy();let n=i.iterator;for(;n.next();)n.value.k()}else m.o("Link.points value is not an instance of List or Array: "+t);if(i===null)return;i.k(),this.Me=i,this.ai(),this.pk();let s=this.diagram;s!==null&&(!s.Qa&&!s.undoManager.isUndoingRedoing&&s.nb.add(this),s.animationManager.ke&&s.animationManager.TM(this,i)),this.t("points",e,i)}convertPointsArrayToList(t){let e=null,i=t.length%2===0;if(i){for(let s=0;s<t.length;s++)if(typeof t[s]!="number"||isNaN(t[s])){i=!1;break}}if(i){e=new q;for(let s=0;s<t.length/2;s++)e.add(new P(t[s*2],t[s*2+1]).k())}else{let s=!0;for(let n=0;n<t.length;n++){let o=t[n];if(!m.$(o)||typeof o.x!="number"||isNaN(o.x)||typeof o.y!="number"||isNaN(o.y)){s=!1;break}}if(s){e=new q;for(let n=0;n<t.length;n++){let o=t[n];e.add(new P(o.x,o.y).k())}}}return e}get pointsCount(){return this.Me.count}getPoint(t){return this.Me.r[t]}setPoint(t,e){this.Me.setElt(t,e)}setPointAt(t,e,i){this.Me.setElt(t,new P(e,i))}insertPoint(t,e){this.Me.insertAt(t,e)}insertPointAt(t,e,i){this.Me.insertAt(t,new P(e,i))}addPoint(t){this.Me.add(t)}addPointAt(t,e){this.Me.add(new P(t,e))}removePoint(t){this.Me.removeAt(t)}clearPoints(){this.Me.clear()}kr(t,e){if(t===0&&e===0)return;if(this.pointsCount===0){this.defaultFromPoint.isReal()&&this.defaultFromPoint.offset(t,e),this.defaultToPoint.isReal()&&this.defaultToPoint.offset(t,e);return}let i=this.Fi,s=new q,n=this.Me.iterator;for(;n.next();){let a=n.value;s.add(new P(a.x+t,a.y+e).k())}s.k();let o=this.Me;this.Me=s;let r=this.diagram;isNaN(t)||isNaN(e)||r!==null&&r.animationManager.ke?this.f():(this.sn.e(this.sn.x+t,this.sn.y+e),this.ct.e(this.ct.x+t,this.ct.y+e),this.kf()),i?this.pk():(this.defaultFromPoint.isReal()&&(this.defaultFromPoint=this.getPoint(0)),this.defaultToPoint.isReal()&&(this.defaultToPoint=this.getPoint(this.pointsCount-1))),r!==null&&r.animationManager.ke&&r.animationManager.TM(this,s),this.t("points",o,s)}startRoute(){this.wl===null&&(this.wl=this.Me,this.Me=this.Me.copy())}commitRoute(){if(this.wl===null)return;let t=this.wl,e=this.Me;this.wl=null;let i=this.diagram;i!==null&&i.animationManager.ke&&i.animationManager.TM(this,e),this.ai(),this.pk(),this.t("points",t,e)}rollbackRoute(){this.wl!==null&&(this.Me=this.wl,this.wl=null,this.DC(this.xl))}vR(){this.Dr!==null&&(this.points=this.Dr,this.Dr=null)}pk(){if(this.Me.count===0){this.Fi=!1;return}this.Fi=!0,this.DC(this.xl),this.Jh=null,this.mk=NaN,this.defaultFromPoint=this.getPoint(0),this.defaultToPoint=this.getPoint(this.pointsCount-1),this.yk(!1)}invalidateRoute(){this.$t()}$t(){if(this.suspendsRouting)return;let t=this.path;if(t===null)return;let e=this.diagram;if(e){if(e.nb.has(this)||e.undoManager.isUndoingRedoing)return;let i=e.animationManager;if(i.isTicking&&!i.isAnimating)return;this.Dr!==null&&!i.isTicking&&(this.Dr=null)}this.Fi=!1,this.f(),t.f()}get Fi(){return(this.Mt&16)!==0}set Fi(t){(this.Mt&16)!==0!==t&&(this.Mt=this.Mt^16)}get suspendsRouting(){return(this.Mt&32)!==0}set suspendsRouting(t){(this.Mt&32)!==0!==t&&(this.Mt=this.Mt^32)}get _y(){return(this.Mt&64)!==0}set _y(t){(this.Mt&64)!==0!==t&&(this.Mt=this.Mt^64)}get vC(){return(this.Mt&512)!==0}set vC(t){(this.Mt&512)!==0!==t&&(this.Mt=this.Mt^512)}get defaultFromPoint(){return this.xC}set defaultFromPoint(t){this.xC=t&&t.isReal()?t.copy():P.gn}get defaultToPoint(){return this.bC}set defaultToPoint(t){this.bC=t&&t.isReal()?t.copy():P.gn}updateRoute(){if(this.Fi||this._y)return;let t=!0;try{this._y=!0,this.startRoute(),t=this.computePoints()}catch{this._y=!1,this.rollbackRoute()}finally{this._y=!1,t?this.commitRoute():this.rollbackRoute()}}computePoints(){let t=this.diagram;if(t===null)return!1;let e=this.fromNode,i=null;if(e===null?(j.$h||(j.$h=new J,j.$h.desiredSize=st.xc,j.$h.ensureBounds()),this.defaultFromPoint.isReal()&&(j.$h.location=this.defaultFromPoint,j.$h.ensureBounds(),e=j.$h,i=j.$h)):i=this.fromPort,i!==null&&!e.isVisible()){let p=e.findVisibleNode();p!==null&&p!==e?(e=p,i=p.port):e=p}if(this.kC=e,e===null||!e.location.isReal()||i===null||(i=e.findVisiblePort(i),i===null))return!1;let s=this.toNode,n=null;if(s===null?(j.Zh||(j.Zh=new J,j.Zh.desiredSize=st.xc,j.Zh.ensureBounds()),this.defaultToPoint.isReal()&&(j.Zh.location=this.defaultToPoint,j.Zh.ensureBounds(),s=j.Zh,n=j.Zh)):n=this.toPort,n!==null&&!s.isVisible()){let p=s.findVisibleNode();p!==null&&p!==s?(s=p,n=p.port):s=p}if(this.PC=s,s===null||!s.location.isReal()||n===null||(n=s.findVisiblePort(n),n===null))return!1;let o=this.pointsCount,r=this.computeSpot(!0,i),a=this.computeSpot(!1,n),h=this.bl(r),l=this.bl(a),u=i===n&&i!==null,c=this.isOrthogonal,d=this.curve===9;u&&!c?(d=!0,this.er=!0):this.er=!1;let f=this.computeAdjusting()===0||u;if(!c&&!u&&h&&l){let p=!1;if(!f&&o>=3){let g=this.getLinkPoint(e,i,r,!0,!1,s,n),y=this.getLinkPoint(s,n,a,!1,!1,e,i);p=this.adjustPoints(0,g,o-1,y),p&&(g=this.getLinkPoint(e,i,r,!0,!1,s,n),y=this.getLinkPoint(s,n,a,!1,!1,e,i),this.adjustPoints(0,g,o-1,y))}p||(this.clearPoints(),d?this.CE(e,i,r,s,n,a):this.LE(e,i,r,s,n,a))}else{let p=u?this.computeCurviness():0;f&&(c&&this.isAvoiding||u)&&this.clearPoints();let g=this.getLinkPoint(e,i,r,!0,c,s,n),y=this.getLinkPoint(s,n,a,!1,c,e,i),b=0,v=0,w=0;if(c||!h||u){w=this.getLinkDirection(e,i,g,r,!0,c,s,n);let M=this.wk(e,i,r,!0,w);if(u&&(h||r.equals(a)||!c&&r.x+a.x===1&&r.y+a.y===1)&&(w-=c?90:j.lv,p<0&&(w-=180)),w=C.Ee(w),u&&(M+=Math.abs(p)*(c?1:2)),w===0?b=M:w===90?v=M:w===180?b=-M:w===270?v=-M:(b=M*Math.cos(w*Math.PI/180),v=M*Math.sin(w*Math.PI/180)),r.isNoSpot()&&u){let A=i.getDocumentPoint(T.Center,P.l()),F=P.z(A.x+b*j.Gf,A.y+v*j.Gf);this.getLinkPointFromPoint(e,i,A,F,!0,g),P.i(A),P.i(F)}}let k=0,S=0,N=0;if(c||!l||u){N=this.getLinkDirection(s,n,y,a,!1,c,e,i);let M=this.wk(s,n,a,!1,N);if(u&&(l||r.equals(a)||!c&&r.x+a.x===1&&r.y+a.y===1)&&(N+=c?0:j.av,p<0&&(N+=180)),N=C.Ee(N),u&&(M+=Math.abs(p)*(c?1:2)),N===0?k=M:N===90?S=M:N===180?k=-M:N===270?S=-M:(k=M*Math.cos(N*Math.PI/180),S=M*Math.sin(N*Math.PI/180)),a.isNoSpot()&&u){let A=n.getDocumentPoint(T.Center,P.l()),F=P.z(A.x+k*j.Gf,A.y+S*j.Gf);this.getLinkPointFromPoint(s,n,A,F,!1,y),P.i(A),P.i(F)}}let D=g;(c||!h||u)&&(D=new P(g.x+b,g.y+v));let L=y;(c||!l||u)&&(L=new P(y.x+k,y.y+S)),!f&&!c&&h&&o>3&&this.adjustPoints(0,g,o-2,L)?this.setPoint(o-1,y):!f&&!c&&l&&o>3&&this.adjustPoints(1,D,o-1,y)?this.setPoint(0,g):!f&&(c?o>=6:o>4)&&this.adjustPoints(1,D,o-2,L)?(this.setPoint(0,g),this.setPoint(o-1,y)):(this.clearPoints(),this.addPoint(g),(c||!h||u)&&this.addPoint(D),c&&this.addOrthoPoints(D,w,L,N,e,s),(c||!l||u)&&this.addPoint(L),this.addPoint(y))}return t.addInvalidRoute(this),!0}FC(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?(e.x>=t.x?e.x=t.x+9e9:e.x=t.x-9e9,e.y=t.y):(e.y>=t.y?e.y=t.y+9e9:e.y=t.y-9e9,e.x=t.x),e}getLinkPointFromPoint(t,e,i,s,n,o){if(o===void 0&&(o=new P),t===null||e===null)return o.h(i),o;if(!t.isVisible()){let d=t.findVisibleNode();d!==null&&d!==t&&(t=d,e=t.port)}let r=0,a=0,h=0,l=0,u=null,c=e.panel;if(c!==null&&!c.Mn()&&(c=c.panel),c===null)r=s.x,a=s.y,h=i.x,l=i.y;else{u=c.Ws;let d=1/(u.m11*u.m22-u.m12*u.m21),f=u.m22*d,p=-u.m12*d,g=-u.m21*d,y=u.m11*d,b=d*(u.m21*u.dy-u.m22*u.dx),v=d*(u.m12*u.dx-u.m11*u.dy);r=s.x*f+s.y*g+b,a=s.x*p+s.y*y+v,h=i.x*f+i.y*g+b,l=i.x*p+i.y*y+v}return e.mf(r,a,h,l,o),u!==null&&o.v(u),o}AE(t,e){let i=t.yd;return i!==null?i.gv(e):null}xk(t){if(t===null)return null;let e=t.yd;return e===null&&(e=new Ji(t.part,t),t.yd=e),e.gv(this)}getLinkPoint(t,e,i,s,n,o,r,a){if(a===void 0&&(a=new P),i.isSpot()&&!this.bl(i))return e.getDocumentPoint(i,a),a;if(i.isSide()){let u=this.xk(e);if(u!==null){let c=u._h;if(a.h(c),n&&this.routing===7){let d=this.xk(r);if(d!==null&&u.Yf<d.Yf){let f=P.l(),p=P.l(),g=I.l();e.getDocumentPoint(T.TopLeft,f),e.getDocumentPoint(T.BottomRight,p);let y=f.x,b=f.y,v=p.x,w=p.y;g.x=Math.min(y,v),g.y=Math.min(b,w),g.width=Math.abs(y-v),g.height=Math.abs(b-w);let k=this.computeSpot(!s,r),S=this.getLinkPoint(o,r,k,!s,n,t,e,p);(i.includesSide(T.LeftSide)||i.includesSide(T.RightSide))&&S.y>=g.y&&S.y<=g.y+g.height?a.y=S.y:(i.includesSide(T.TopSide)||i.includesSide(T.BottomSide))&&S.x>=g.x&&S.x<=g.x+g.width&&(a.x=S.x),I.i(g),P.i(f),P.i(p)}}return a}}let h=e.getDocumentPoint(this.ig(i,s),P.l()),l=P.l();if(this.pointsCount>(n?6:2))l.h(s?this.getPoint(1):this.getPoint(this.pointsCount-2)),n&&this.FC(h,l);else if(t?.isMemberOf(o)||o?.isMemberOf(t)){let u=e.getDocumentBounds(I.l()),c=r.getDocumentBounds(I.l());u.isReal()&&c.isReal()?c.containsRect(u)?(l.h(h),this.RC(c,h.x,h.y,0,this.computeSpot(r===this.toPort,r),l)):u.containsRect(c)?(r.getDocumentPoint(T.Center,l),this.RC(u,l.x,l.y,0,this.computeSpot(e===this.toPort,e),l)):this.OC(r,h,s,n,l):this.OC(r,h,s,n,l),I.i(u),I.i(c)}else this.OC(r,h,s,n,l);return this.getLinkPointFromPoint(t,e,h,l,s,a),P.i(l),P.i(h),a}OC(t,e,i,s,n){let o=this.computeSpot(!i,t);t.getDocumentPoint(this.ig(o,!i),n),s&&this.FC(e,n)}getLinkDirection(t,e,i,s,n,o,r,a){let h=this.TE(t,e,i,s,n,o,r,a);if(t&&r){let u=I.l(),c=I.l();if(s.isNone()&&t.isMemberOf(r)&&e&&a){if(e.getDocumentBounds(u),a.getDocumentBounds(c),u.isReal()&&c.isReal()&&c.containsRect(u)){let d=this.computeSpot(a===this.toPort,a);d.equals(T.Left)||d.equals(T.LeftSide)?h=180:d.equals(T.Right)||d.equals(T.RightSide)?h=0:d.equals(T.Top)||d.equals(T.TopSide)?h=270:d.equals(T.Bottom)||d.equals(T.BottomSide)?h=90:h=C.Ee(h+180)}}else r?.isMemberOf(t)&&e&&a&&(e.getDocumentBounds(u),a.getDocumentBounds(c),u.isReal()&&c.isReal()&&u.containsRect(c)&&(h=C.Ee(h+180)));I.i(u),I.i(c)}if(this.bl(s)||e===null)return h;let l=e.getDocumentAngle();return l===0?h:(45<=l&&l<135?h+=90:135<=l&&l<225?h+=180:225<=l&&l<315&&(h+=270),C.Ee(h))}TE(t,e,i,s,n,o,r,a){if(s.isSpot())return C._w(null,s.x,s.y);if(s.isSide()){let c=this.xk(e);if(c!==null)switch(c.fi){case 1:return 270;case 8:return 90;case 2:return 180;default:return 0}else return s.includesSide(T.TopSide)?270:s.includesSide(T.BottomSide)?90:s.includesSide(T.LeftSide)?180:0}if(e===null||a===null)return 0;let h=e.getDocumentPoint(T.Center,P.l()),l=P.l();this.pointsCount>(o?6:2)?o?(l.h(n?this.getPoint(1):this.getPoint(this.pointsCount-2)),this.FC(h,l)):l.h(i):a.getDocumentPoint(T.Center,l);let u=0;return Math.abs(l.x-h.x)>Math.abs(l.y-h.y)?l.x>=h.x?u=0:u=180:l.y>=h.y?u=90:u=270,P.i(l),P.i(h),u}computeEndSegmentLength(t,e,i,s){return this.wk(t,e,i,s,NaN)}wk(t,e,i,s,n){if(e!==null&&i.isSide()){let r=this.xk(e);if(r!==null)return r.bk}let o=NaN;if(s?o=this.fromEndSegmentLength:o=this.toEndSegmentLength,e!==null&&isNaN(o))if(n===void 0&&(n=NaN),j.LC>0&&this.computeCurve()===9&&!isNaN(n)&&i.isSpot()){let r=this.getOtherPort(e);if(r){let a=P.l(),h=P.l(),l=e.getDocumentPoint(i,a),u=r.getDocumentPoint(i.opposite(),h),c=n>=315||n<=45||n>=135&&n<=225,d=Math.abs(c?l.x-u.x:l.y-u.y)/j.LC;return d=Math.max(d,j.AC),P.i(a),P.i(h),d}}else s?o=e.fromEndSegmentLength:o=e.toEndSegmentLength;return isNaN(o)&&(o=j.AC),o}computeSpot(t,e){return e===void 0&&(e=null),t?this.DE(e||this.fromPort):this.vE(e||this.toPort)}DE(t){if(t===null)return T.Center;let e=this.fromSpot;return e.isDefault()&&(e=t.fromSpot),e===T.Default?T.None:e}vE(t){if(t===null)return T.Center;let e=this.toSpot;return e.isDefault()&&(e=t.toSpot),e===T.Default?T.None:e}bl(t){return t===T.None||t.x===.5&&t.y===.5}ig(t,e){return t.x===.5&&t.y===.5?t:T.Center}computeOtherPoint(t,e){if(this.computeAdjusting()!==0&&this.pointsCount>4)return this.computeMidPoint(new P);{let i=this.AE(e,this);if(i!==null)return i._h;if(t instanceof ht){let s=this.fromNode,n=this.fromPort;n===e&&(s=this.toNode,n=this.toPort);let o=I.l(),r=I.l();if(n&&s?.isMemberOf(t)){let a=this.computeSpot(n===e,e);if(e.getDocumentBounds(o),n.getDocumentBounds(r),o.isReal()&&r.isReal()&&o.containsRect(r)){let h=n.getDocumentPoint(T.Center);return this.RC(o,h.x,h.y,0,a,h),I.i(o),I.i(r),h}}I.i(o),I.i(r)}return e.getDocumentPoint(T.Center)}}computeShortLength(t){if(t){let e=this.fromShortLength;if(isNaN(e)){let i=this.fromPort;i!==null&&(e=i.fromShortLength)}return isNaN(e)?0:e}else{let e=this.toShortLength;if(isNaN(e)){let i=this.toPort;i!==null&&(e=i.toShortLength)}return isNaN(e)?0:e}}Zm(t,e,i,s,n,o){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);let r;if(o===void 0?(r=Nt.l(),r.Ue()):r=o,r.bc(this.v),this.containedInRect(t,r))return this.$N(e,i,n),o===void 0&&Nt.i(r),!0;if(this.intersectsRect(t,r)){let a=!1;if(!this.Af){let h=this.D.r,l=h.length;for(let u=l;u--;){let c=h[u];if(!c.visible&&c!==this.locationObject)continue;let d=c.actualBounds,f=this.naturalBounds;if(d.x>f.width||d.y>f.height||d.x+d.width<0||d.y+d.height<0)continue;let p=c,g=Nt.l();if(g.set(r),p instanceof G?a=p.Zm(t,e,i,s,n,g):this.path===p?p instanceof et&&(a=p.nE(t,s,g)):a=p.ZT(t,s,g),a){let y=p;e!==null&&(y=e(p)),y&&(i===null||i(y))&&n.add(y)}Nt.i(g)}}return o===void 0&&Nt.i(r),a||this.background!==null}return o===void 0&&Nt.i(r),!1}get isOrthogonal(){return(this.Wh&2)===2}static NC(t){return(t&2)===2}get isAvoiding(){return(this.Wh&4)===4}computeCurve(){if(this.er===null){let t=this.fromPort,e=t!==null&&t===this.toPort,i=this.isOrthogonal;this.er=e&&!i}return this.er?9:this.curve}computeCorner(){if(this.curve===9)return 0;let t=this.corner;return(isNaN(t)||t<0)&&(t=j.hv),t}findMidLabel(){let t=this.path,e=this.D.r,i=e.length;for(let n=0;n<i;n++){let o=e[n];if(!(o===t||o.isPanelMain)&&(o.segmentIndex===-1/0||isNaN(o.segmentIndex)))return o}let s=this.labelNodes;for(;s.next();){let n=s.value;if(n.segmentIndex===-1/0||isNaN(n.segmentIndex))return n}return null}computeSpacing(){if(!this.isVisible())return 0;let t=j.cv;t=Math.max(t,this.computeThickness());let e=this.fromPort,i=this.toPort;if(e!==null&&i!==null){let s=this.findMidLabel();if(s!==null){let n=s.naturalBounds,o=s.margin,r=isNaN(n.width)?j.fv:n.width*s.scale+o.left+o.right,a=isNaN(n.height)?j.uv:n.height*s.scale+o.top+o.bottom,h=s.segmentOrientation;if(h===21||h===25||h===24)t=Math.max(t,a);else if(h===23||h===27||h===22||h===26)t=Math.max(t,r);else{let l=e.getDocumentPoint(T.Center).directionPoint(i.getDocumentPoint(T.Center))/180*Math.PI;t=Math.max(t,Math.abs(Math.sin(l)*r)+Math.abs(Math.cos(l)*a)+1)}this.curve===9&&(t*=j.ov)}}return t}arrangeBundledLinks(t,e){if(e)for(let i=0;i<t.length;i++){let s=t[i];s.computeAdjusting()===0&&s.$t()}}computeCurviness(){let t=this.curviness;if(isNaN(t)){t=j.sv;let e=this.ir;if(e!==null){let i=m.nt(),s=0,n=e.on;for(let r=0;r<n.length;r++){let a=n[r].computeSpacing();i.push(a),s+=a}let o=-s/2;for(let r=0;r<n.length;r++){if(n[r]===this){t=o+i[r]/2;break}o+=i[r]}e.Gy===this.fromNode&&(t=-t),m.Z(i)}}return t}computeThickness(){if(!this.isVisible())return 0;let t=this.path;return t!==null?Math.max(t.strokeWidth,1):1}hasCurviness(){return!isNaN(this.curviness)||this.ir!==null}LE(t,e,i,s,n,o){let r=this.getLinkPoint(t,e,i,!0,!1,s,n),a=this.getLinkPoint(s,n,o,!1,!1,t,e);if(this.mv(t,e,i,r,s,n,o,a),this.addPoint(r),this.addPoint(a),this.hasCurviness()){let h=a.x-r.x,l=a.y-r.y,u=this.computeCurviness(),c=u,d=r.x+h/2,f=r.y+l/2,p=d,g=f;if(C.c(l,0))h>0?g-=c:g+=c;else{let y=-h/l,b=Math.sqrt(c*c/(y*y+1));u<0&&(b=-b),p=(l<0?-1:1)*b+d,g=y*(p-d)+f}this.insertPointAt(1,p,g)}}mv(t,e,i,s,n,o,r,a){let h=o.getDocumentBounds(I.l()),l=e.getDocumentBounds(I.l());if(h.intersectsRect(l)&&!h.containsRect(l)&&!l.containsRect(h)){let u=P.l();e.getDocumentPoint(this.ig(i,!0),u);let c=P.l();o.getDocumentPoint(this.ig(r,!1),c);let d=l.width*l.height,f=h.width*h.height;d>f?(s.h(u),this.getLinkPointFromPoint(n,o,c,u,!1,c),a.h(c)):d<f?(this.getLinkPointFromPoint(t,e,u,c,!0,u),s.h(u),a.h(c)):(s.h(u),a.h(c)),P.i(u),P.i(c)}else if(h.containsPoint(s)){let u=P.l();e.getDocumentPoint(this.ig(i,!0),u),a.h(u),this.IC(h,u.x,u.y,j.Gf,a),this.getLinkPointFromPoint(n,o,h.containsPoint(u)?u:s,a,!1,a),this.getLinkPointFromPoint(t,e,u,a,!0,s),P.i(u)}else if(l.containsPoint(a)){let u=P.l();o.getDocumentPoint(this.ig(r,!1),u),s.h(u),this.IC(l,u.x,u.y,j.Gf,s),this.getLinkPointFromPoint(t,e,l.containsPoint(u)?u:a,s,!0,s),this.getLinkPointFromPoint(n,o,u,s,!1,a),P.i(u)}I.i(l),I.i(h)}RC(t,e,i,s,n,o){let r=-1;return n.equals(T.Left)||n.equals(T.LeftSide)?r=180:n.equals(T.Right)||n.equals(T.RightSide)?r=0:n.equals(T.Top)||n.equals(T.TopSide)?r=270:(n.equals(T.Bottom)||n.equals(T.BottomSide))&&(r=90),r===-1?this.IC(t,e,i,0,o):this.pv(t,e,i,0,r,o)}IC(t,e,i,s,n){let o=C._w(t,e,i);return this.pv(t,e,i,s,o,n)}pv(t,e,i,s,n,o){return n===0?o.x=t.right+s:n===90?o.y=t.bottom+s:n===180?o.x=t.x-s:n===270?o.y=t.y-s:n===45?(o.x=t.right+s,o.y=t.bottom+s):n===135?(o.x=t.x-s,o.y=t.bottom+s):n===225?(o.x=t.x-s,o.y=t.y-s):n===315&&(o.x=t.right+s,o.y=t.y-s),o}CE(t,e,i,s,n,o){let r=this.getLinkPoint(t,e,i,!0,!1,s,n),a=this.getLinkPoint(s,n,o,!1,!1,t,e);this.mv(t,e,i,r,s,n,o,a),this.addPoint(r),this.addPoint(a);let h=a.x-r.x,l=a.y-r.y,u=this.computeCurviness(),c=0,d=0,f=r.x+h/3,p=r.y+l/3,g=f,y=p;C.c(l,0)?h>0?y-=u:y+=u:(c=-h/l,d=Math.sqrt(u*u/(c*c+1)),u<0&&(d=-d),g=(l<0?-1:1)*d+f,y=c*(g-f)+p),f=r.x+2*h/3,p=r.y+2*l/3;let b=f,v=p;C.c(l,0)?h>0?v-=u:v+=u:(b=(l<0?-1:1)*d+f,v=c*(b-f)+p),this.insertPointAt(1,g,y),this.insertPointAt(2,b,v),this.setPoint(0,this.getLinkPoint(t,e,i,!0,!1,s,n)),this.setPoint(3,this.getLinkPoint(s,n,o,!1,!1,t,e))}adjustPoints(t,e,i,s){let n=this.computeAdjusting();if(this.isOrthogonal){if(n===18)return!1;n===19&&(n=17)}switch(n){case 18:return this.FE(t,e,i,s);case 19:return this.RE(t,e,i,s);case 17:return this.OE(t,e,i,s);default:return!1}}FE(t,e,i,s){let n=this.getPoint(t),o=this.getPoint(i);if(n.equalsApprox(e)&&o.equalsApprox(s))return!0;let r=n.x,a=n.y,h=o.x,l=o.y,u=h-r,c=l-a,d=Math.sqrt(u*u+c*c);if(C.X(d,0))return!0;let f=0;C.X(u,0)?c<0?f=-Math.PI/2:f=Math.PI/2:(f=Math.atan(c/Math.abs(u)),u<0&&(f=Math.PI-f));let p=e.x,g=e.y,y=s.x,b=s.y,v=y-p,w=b-g,k=Math.sqrt(v*v+w*w),S=0;C.X(v,0)?w<0?S=-Math.PI/2:S=Math.PI/2:(S=Math.atan(w/Math.abs(v)),v<0&&(S=Math.PI-S));let N=k/d,D=S-f;this.setPoint(t,e);for(let L=t+1;L<i;L++){let M=this.getPoint(L);u=M.x-r,c=M.y-a;let A=Math.sqrt(u*u+c*c);if(C.X(A,0))continue;let F=0;C.X(u,0)?c<0?F=-Math.PI/2:F=Math.PI/2:(F=Math.atan(c/Math.abs(u)),u<0&&(F=Math.PI-F));let O=F+D,E=A*N,B=p+E*Math.cos(O),K=g+E*Math.sin(O);this.setPointAt(L,B,K)}return this.setPoint(i,s),!0}RE(t,e,i,s){let n=this.getPoint(t),o=this.getPoint(i);if(n.equalsApprox(e)&&o.equalsApprox(s))return!0;let r=n.x,a=n.y,h=o.x,l=o.y,u=(h-r)**2+(l-a)**2,c=e.x,d=e.y,f=s.x,p=s.y,g=0,y=1;f-c!==0?(g=(p-d)/(f-c),y=Math.sqrt(1+1/(g*g))):g=9e9,this.setPoint(t,e);for(let b=t+1;b<i;b++){let v=this.getPoint(b),w=v.x,k=v.y,S=.5;u!==0&&(S=((r-w)*(r-h)+(a-k)*(a-l))/u);let N=r+S*(h-r),D=a+S*(l-a),L=Math.sqrt((w-N)**2+(k-D)**2);k<g*(w-N)+D&&(L=-L),g>0&&(L=-L);let M=c+S*(f-c),A=d+S*(p-d);if(g!==0){let F=M+L/y,O=A-(F-M)/g;this.setPointAt(b,F,O)}else this.setPointAt(b,M,A+L)}return this.setPoint(i,s),!0}OE(t,e,i,s){if(this.isOrthogonal){let n=this.getPoint(t),o=this.getPoint(t+1),r=this.getPoint(t+2),a=o.x,h=o.y,l=a,u=h;C.c(n.y,o.y)?C.c(o.x,r.x)?h=e.y:C.c(o.y,r.y)&&(a=e.x):C.c(n.x,o.x)&&(C.c(o.y,r.y)?a=e.x:C.c(o.x,r.x)&&(h=e.y)),this.setPointAt(t+1,a,h),n=this.getPoint(i),o=this.getPoint(i-1),r=this.getPoint(i-2);let c=o.x,d=o.y,f=c,p=d;if(C.c(n.y,o.y)?C.c(o.x,r.x)?d=s.y:C.c(o.y,r.y)&&(c=s.x):C.c(n.x,o.x)&&(C.c(o.y,r.y)?c=s.x:C.c(o.x,r.x)&&(d=s.y)),this.setPointAt(i-1,c,d),this.xT())return this.setPointAt(t+1,l,u),this.setPointAt(i-1,f,p),!1}return this.setPoint(t,e),this.setPoint(i,s),!0}addOrthoPoints(t,e,i,s,n,o){e=C.Ee(e),s=C.Ee(s);let r=s;e>=315||e<45?e=0:45<=e&&e<135?e=90:135<=e&&e<225?e=180:e=270,s>=315||s<45?s=0:45<=s&&s<135?s=90:135<=s&&s<225?s=180:s=270;let a=t,h=i,l=I.bs(n.actualBounds),u=I.bs(o.actualBounds);l.inflate(j.Fa,j.Fa),u.inflate(j.Fa,j.Fa),l.unionPoint(t),u.unionPoint(i);let c=P.l(),d=P.l();e===0?h.x>a.x||s===270&&h.y<a.y&&u.right>a.x||s===90&&h.y>a.y&&u.right>a.x?(c.e(h.x,a.y),d.e(h.x,(a.y+h.y)/2),s===180?(c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1),d.x=c.x,d.y=h.y):s===270&&h.y<a.y||s===90&&h.y>a.y?(a.x<u.left?c.x=this.computeMidOrthoPosition(a.x,a.y,u.left,h.y,!1):a.x<u.right&&(s===270&&a.y<u.top||s===90&&a.y>u.bottom)?c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1):c.x=u.right,d.x=c.x,d.y=h.y):s===0&&a.x<u.left&&a.y>u.top&&a.y<u.bottom&&(c.x=a.x,a.y<h.y?c.y=Math.min(h.y,u.top):c.y=Math.max(h.y,u.bottom),d.y=c.y)):(c.e(a.x,h.y),d.e((a.x+h.x)/2,h.y),(s===180||s===90&&h.y<l.top||s===270&&h.y>l.bottom)&&(s===180&&(u.containsPoint(a)||l.containsPoint(h))?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0):h.y<a.y&&(s===180||s===90)?c.y=this.computeMidOrthoPosition(a.x,l.top,h.x,Math.min(h.y,u.bottom),!0):h.y>a.y&&(s===180||s===270)&&(c.y=this.computeMidOrthoPosition(a.x,l.bottom,h.x,Math.max(h.y,u.top),!0)),d.x=h.x,d.y=c.y),c.y>l.top&&c.y<l.bottom&&(h.x>=l.left&&h.x<=a.x||a.x<=u.right&&a.x>=h.x?(s===90||s===270)&&(c.e(Math.max((a.x+h.x)/2,a.x),a.y),d.e(c.x,h.y)):(s===270||(s===0||s===180)&&h.y<a.y?c.y=Math.min(h.y,s===0?l.top:Math.min(l.top,u.top)):c.y=Math.max(h.y,s===0?l.bottom:Math.max(l.bottom,u.bottom)),d.x=h.x,d.y=c.y))):e===180?h.x<a.x||s===270&&h.y<a.y&&u.left<a.x||s===90&&h.y>a.y&&u.left<a.x?(c.e(h.x,a.y),d.e(h.x,(a.y+h.y)/2),s===0?(c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1),d.x=c.x,d.y=h.y):s===270&&h.y<a.y||s===90&&h.y>a.y?(a.x>u.right?c.x=this.computeMidOrthoPosition(a.x,a.y,u.right,h.y,!1):a.x>u.left&&(s===270&&a.y<u.top||s===90&&a.y>u.bottom)?c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1):c.x=u.left,d.x=c.x,d.y=h.y):s===180&&a.x>u.right&&a.y>u.top&&a.y<u.bottom&&(c.x=a.x,a.y<h.y?c.y=Math.min(h.y,u.top):c.y=Math.max(h.y,u.bottom),d.y=c.y)):(c.e(a.x,h.y),d.e((a.x+h.x)/2,h.y),(s===0||s===90&&h.y<l.top||s===270&&h.y>l.bottom)&&(s===0&&(u.containsPoint(a)||l.containsPoint(h))?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0):h.y<a.y&&(s===0||s===90)?c.y=this.computeMidOrthoPosition(a.x,l.top,h.x,Math.min(h.y,u.bottom),!0):h.y>a.y&&(s===0||s===270)&&(c.y=this.computeMidOrthoPosition(a.x,l.bottom,h.x,Math.max(h.y,u.top),!0)),d.x=h.x,d.y=c.y),c.y>l.top&&c.y<l.bottom&&(h.x<=l.right&&h.x>=a.x||a.x>=u.left&&a.x<=h.x?(s===90||s===270)&&(c.e(Math.min((a.x+h.x)/2,a.x),a.y),d.e(c.x,h.y)):(s===270||(s===0||s===180)&&h.y<a.y?c.y=Math.min(h.y,s===180?l.top:Math.min(l.top,u.top)):c.y=Math.max(h.y,s===180?l.bottom:Math.max(l.bottom,u.bottom)),d.x=h.x,d.y=c.y))):e===90?h.y>a.y||s===180&&h.x<a.x&&u.bottom>a.y||s===0&&h.x>a.x&&u.bottom>a.y?(c.e(a.x,h.y),d.e((a.x+h.x)/2,h.y),s===270?(c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0),d.x=h.x,d.y=c.y):s===180&&h.x<a.x||s===0&&h.x>a.x?(a.y<u.top?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,u.top,!0):a.y<u.bottom&&(s===180&&a.x<u.left||s===0&&a.x>u.right)?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0):c.y=u.bottom,d.x=h.x,d.y=c.y):s===90&&a.y<u.top&&a.x>u.left&&a.x<u.right&&(a.x<h.x?c.x=Math.min(h.x,u.left):c.x=Math.max(h.x,u.right),c.y=a.y,d.x=c.x)):(c.e(h.x,a.y),d.e(h.x,(a.y+h.y)/2),(s===270||s===0&&h.x<l.left||s===180&&h.x>l.right)&&(s===270&&(u.containsPoint(a)||l.containsPoint(h))?c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1):h.x<a.x&&(s===270||s===0)?c.x=this.computeMidOrthoPosition(l.left,a.y,Math.min(h.x,u.right),h.y,!1):h.x>a.x&&(s===270||s===180)&&(c.x=this.computeMidOrthoPosition(l.right,a.y,Math.max(h.x,u.left),h.y,!1)),d.x=c.x,d.y=h.y),c.x>l.left&&c.x<l.right&&(h.y>=l.top&&h.y<=a.y||a.y<=u.bottom&&a.y>=h.y?(s===0||s===180)&&(c.e(a.x,Math.max((a.y+h.y)/2,a.y)),d.e(h.x,c.y)):(s===180||(s===90||s===270)&&h.x<a.x?c.x=Math.min(h.x,s===90?l.left:Math.min(l.left,u.left)):c.x=Math.max(h.x,s===90?l.right:Math.max(l.right,u.right)),d.x=c.x,d.y=h.y))):h.y<a.y||s===180&&h.x<a.x&&u.top<a.y||s===0&&h.x>a.x&&u.top<a.y?(c.e(a.x,h.y),d.e((a.x+h.x)/2,h.y),s===90?(c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0),d.x=h.x,d.y=c.y):s===180&&h.x<a.x||s===0&&h.x>=a.x?(a.y>u.bottom?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,u.bottom,!0):a.y>u.top&&(s===180&&a.x<u.left||s===0&&a.x>u.right)?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0):c.y=u.top,d.x=h.x,d.y=c.y):s===270&&a.y>u.bottom&&a.x>u.left&&a.x<u.right&&(a.x<h.x?c.x=Math.min(h.x,u.left):c.x=Math.max(h.x,u.right),c.y=a.y,d.x=c.x)):(c.e(h.x,a.y),d.e(h.x,(a.y+h.y)/2),(s===90||s===0&&h.x<l.left||s===180&&h.x>l.right)&&(s===90&&(u.containsPoint(a)||l.containsPoint(h))?c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1):h.x<a.x&&(s===90||s===0)?c.x=this.computeMidOrthoPosition(l.left,a.y,Math.min(h.x,u.right),h.y,!1):h.x>a.x&&(s===90||s===180)&&(c.x=this.computeMidOrthoPosition(l.right,a.y,Math.max(h.x,u.left),h.y,!1)),d.x=c.x,d.y=h.y),c.x>l.left&&c.x<l.right&&(h.y<=l.bottom&&h.y>=a.y||a.y>=u.top&&a.y<=h.y?(s===0||s===180)&&(c.e(a.x,Math.min((a.y+h.y)/2,a.y)),d.e(h.x,c.y)):(s===180||(s===90||s===270)&&h.x<a.x?c.x=Math.min(h.x,s===270?l.left:Math.min(l.left,u.left)):c.x=Math.max(h.x,s===270?l.right:Math.max(l.right,u.right)),d.x=c.x,d.y=h.y))),this.vC=s!==r,this.SC=e,this.MC=s,this.addPoint(c.copy()),this.addPoint(d.copy()),P.i(c),P.i(d),I.i(l),I.i(u)}computeMidOrthoPosition(t,e,i,s,n){let o=0;return this.hasCurviness()&&!this.computeSpot(!0,this.fromPort).isSide()&&!this.computeSpot(!1,this.toPort).isSide()&&(o=this.computeCurviness()),n?(e+s)/2+o:(t+i)/2+o}xT(){if(this.diagram===null||!this.isAvoiding||this.diagram.animationManager.isTicking)return!1;let t=this.points.r,e=t.length;if(e<4)return!1;let i=this.diagram.getPositions(!1,this.containingGroup,null);for(let s=1;s<e-2;s++){let n=t[s],o=t[s+1];if(!i.isUnoccupied(Math.min(n.x,o.x),Math.min(n.y,o.y),Math.abs(n.x-o.x),Math.abs(n.y-o.y)))return!0}return!1}findClosestSegment(t){let e=t.x,i=t.y,s=this.getPoint(0),n=this.getPoint(1),o=P.distanceLineSegmentSquared(e,i,s.x,s.y,n.x,n.y),r=0;for(let a=1;a<this.pointsCount-1;a++){s=this.getPoint(a+1);let h=P.distanceLineSegmentSquared(e,i,n.x,n.y,s.x,s.y);n=s,h<o&&(r=a,o=h)}return r}invalidateGeometry(){this.ai()}ai(){this.Ra&&(this.Ra=!1,this.f())}get Ra(){return(this.Mt&128)!==0}set Ra(t){(this.Mt&128)!==0!==t&&(this.Mt=this.Mt^128)}get geometry(){if(!this.Ra){if(this.updateRoute(),this.pointsCount<2)return this.Ra=!0,this.ut;this.ut=this.makeGeometry(),this.Ra=!0}return this.ut}Td(t){if(!t){if(this.Fi===!1)return;let n=this.findMainElement();if(this.Ra&&(n===null||n.geometry!==null))return}this.pointsCount>=2&&(this.ut=this.makeGeometry()),this.Ra=!0;let e=this.path;if(e===null)return;e.ut=this.ut;let i=this.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n];o!==e&&o.isPanelMain&&o instanceof et&&(o.ut=this.ut)}}IE(t){return this.Qh()&&t.ra.has(this)&&(this.xl.width!==0||this.xl.height!==0)&&(t.animationManager.isAnimating||t.currentTool!==t.toolManager)}makeGeometry(){let t=this.ut,e=this.pointsCount,i=!1,s=this.diagram;s!==null&&this.IE(s)&&(i=!0);let n=0,o=0,r=P.bs(this.getPoint(0)),a=P.bs(r),h=this.Me.r,l=this.computeCurve();if(l===9&&e>=3&&!C.X(this.smoothness,0))if(e===3){let u=this.getPoint(1);n=Math.min(r.x,u.x),o=Math.min(r.y,u.y),u=this.getPoint(2),n=Math.min(n,u.x),o=Math.min(o,u.y)}else if(this.isOrthogonal){for(let u=0;u<e;u++){let c=h[u];a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y)}n=a.x,o=a.y}else{for(let u=3;u<e;u+=3){u+3>=e&&(u=e-1);let c=this.getPoint(u);a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y)}n=a.x,o=a.y}else{for(let u=0;u<e;u++){let c=h[u];a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y)}n=a.x,o=a.y}if(n-=this.gk.x,o-=this.gk.y,r.x-=n,r.y-=o,this.computeShortLength(!0)!==0&&(r=this.tc(r,!0,a)),e===2&&!this.Qh()){let u=P.bs(this.getPoint(1));return u.x-=n,u.y-=o,this.computeShortLength(!1)!==0&&(u=this.tc(u,!1,a)),t.type=1,t.startX=r.x,t.startY=r.y,t.endX=u.x,t.endY=u.y,P.i(u),P.i(r),P.i(a),t}else{t.type=4;let u=Ce.JL(t);if(u.Lu(r.x,r.y,!1,!1),l===9&&e>=3&&!C.X(this.smoothness,0))if(e===3){let c=this.getPoint(1),d=c.x-n,f=c.y-o,p=P.bs(this.getPoint(2));p.x-=n,p.y-=o,this.computeShortLength(!1)!==0&&this.tc(p,!1,a),u.wr(d,f,d,f,p.x,p.y),P.i(p)}else if(this.isOrthogonal){let c=P.z(n,o),d=P.bs(this.getPoint(1)),f=P.z(n,o),p=P.z(n,o),g=this.getPoint(0),y,b=this.smoothness/3;for(let S=1;S<this.pointsCount-1;S++){y=this.getPoint(S);let N=g,D=y,L=this.getPoint(this.EC(y,S,!1));C.X(N.x,D.x)&&C.X(D.x,L.x)||C.X(N.y,D.y)&&C.X(D.y,L.y)||(this.EE(N,D,L,b,f,p),(S===1||S===2&&C.X(g.x,this.getPoint(0).x)&&C.X(g.y,this.getPoint(0).y))&&(d.x=(g.x+y.x)*.5,d.y=(g.y+y.y)*.5),u.wr(d.x-n,d.y-o,f.x-n,f.y-o,y.x-n,y.y-o),c.h(f),d.h(p),g=y)}let v=g.x,w=g.y,k=P.bs(this.getPoint(this.pointsCount-1));this.computeShortLength(!1)!==0&&this.tc(k,!1,P.dn),v=.5*(v+k.x),w=.5*(w+k.y),u.wr(p.x-n,p.y-o,v-n,w-o,k.x-n,k.y-o),P.i(k),P.i(c),P.i(d),P.i(f),P.i(p)}else for(let c=3;c<e;c+=3){let d=this.getPoint(c-2);c+3>=e&&(c=e-1);let f=this.getPoint(c-1),p=P.bs(this.getPoint(c));c===e-1&&this.computeShortLength(!1)!==0&&this.tc(p,!1,P.dn),u.wr(d.x-n,d.y-o,f.x-n,f.y-o,p.x-n,p.y-o),P.i(p)}else if(this.isOrthogonal||e===2){let c=P.bs(this.getPoint(0)),d=P.l(),f=P.bs(c),p=this.computeCorner(),g=1,y=0;for(;g<e;){if(g=this.EC(c,g,g>1),d.h(this.getPoint(g)),g>=e-1){if(!c.equals(d))this.computeShortLength(!1)!==0&&this.tc(d,!1,P.dn),this.Rn(u,-n,-o,c,d,i);else if(y===0)for(g=1;g<e;)f.h(c),d.h(this.getPoint(g++)),this.Rn(u,-n,-o,c,d,i),c.h(d);break}y=this.EC(d,g+1,g<e-3);let b=this.getPoint(y);this.UE(u,-n,-o,c,d,b,c,f,p,i),f.h(d),g=y}P.i(c),P.i(d),P.i(f)}else{let c=this.computeCorner();if(e>2&&c>=.5){let d=P.bs(h[e-1]);this.computeShortLength(!1)!==0&&this.tc(d,!1,P.dn),r.x+=n,r.y+=o;for(let f=1;f<e;f++){let p=f===1?r:h[f-1],g=f===e-1?d:h[f],y=Math.sqrt(p.distanceSquaredPoint(g)),b=c/y;if(b<.5){if(f>1){let v=p.x+(g.x-p.x)*b,w=p.y+(g.y-p.y)*b;u.Au(p.x-n,p.y-o,v-n,w-o)}u.Ys(g.x+(p.x-g.x)*b-n,g.y+(p.y-g.y)*b-o)}else f>1&&u.Au(p.x-n,p.y-o,(p.x+g.x)/2-n,(p.y+g.y)/2-o);f===e-1&&u.Ys(d.x-n,d.y-o)}P.i(d)}else if(e>=2){let d=P.bs(h[e-1]);this.computeShortLength(!1)!==0&&this.tc(d,!1,P.dn);for(let f=1;f<e-1;f++)u.Ys(h[f].x-n,h[f].y-o);u.Ys(d.x-n,d.y-o),P.i(d)}}return Ce.$L(u),P.i(r),P.i(a),t}}kk(t,e,i,s){let n=i-t;if(isNaN(n)||n===1/0||n===-1/0)return NaN;n<0&&(n=-n);let o=s-e;return isNaN(o)||o===1/0||o===-1/0?NaN:(o<0&&(o=-o),C.X(n,0)?o:C.X(o,0)?n:Math.sqrt(n*n+o*o))}EE(t,e,i,s,n,o){isNaN(s)&&(s=this.smoothness/3);let r=t.x,a=t.y,h=e.x,l=e.y,u=i.x,c=i.y,d=s*this.kk(r,a,h,l),f=s*this.kk(h,l,u,c);if(C.X(a,l)&&C.X(h,u)&&(h>r?c>l?(n.x=h-d,n.y=l-d,o.x=h+f,o.y=l+f):(n.x=h-d,n.y=l+d,o.x=h+f,o.y=l-f):c>l?(n.x=h+d,n.y=l-d,o.x=h-f,o.y=l+f):(n.x=h+d,n.y=l+d,o.x=h-f,o.y=l-f)),C.X(r,h)&&C.X(l,c)&&(l>a?u>h?(n.x=h-d,n.y=l-d,o.x=h+f,o.y=l+f):(n.x=h+d,n.y=l-d,o.x=h-f,o.y=l+f):u>h?(n.x=h-d,n.y=l+d,o.x=h+f,o.y=l-f):(n.x=h+d,n.y=l+d,o.x=h-f,o.y=l-f)),C.X(r,h)&&C.X(h,u)||C.X(a,l)&&C.X(l,c)){let p=.5*(r+u),g=.5*(a+c);n.x=p,n.y=g,o.x=p,o.y=g}}tc(t,e,i){let s=this.pointsCount;if(s<2)return t;if(e){let n=this.getPoint(1),o=n.x-i.x,r=n.y-i.y,a=this.kk(t.x,t.y,o,r);if(a===0)return t;let h=s===2?a*.5:a,l=this.computeShortLength(!0);l>h&&(l=h);let u=l*(o-t.x)/a,c=l*(r-t.y)/a;t.x+=u,t.y+=c}else{let n=this.getPoint(s-2),o=n.x-i.x,r=n.y-i.y,a=this.kk(t.x,t.y,o,r);if(a===0)return t;let h=s===2?a*.5:a,l=this.computeShortLength(!1);l>h&&(l=h);let u=l*(t.x-o)/a,c=l*(t.y-r)/a;t.x-=u,t.y-=c}return t}EC(t,e,i){let s=this.pointsCount,n=t;for(;C.X(t.x,n.x)&&C.X(t.y,n.y);){if(e>=s)return s-1;n=this.getPoint(e++)}if(!C.X(t.x,n.x)&&!C.X(t.y,n.y))return e-1;let o=n;for(;C.X(t.x,n.x)&&C.X(n.x,o.x)&&(!i||(t.y>=n.y?n.y>=o.y:n.y<=o.y))||C.X(t.y,n.y)&&C.X(n.y,o.y)&&(!i||(t.x>=n.x?n.x>=o.x:n.x<=o.x));){if(e>=s)return s-1;o=this.getPoint(e++)}return e-2}UE(t,e,i,s,n,o,r,a,h,l){if(C.c(s.y,n.y)&&C.c(n.x,o.x)){let u=Math.min(h,Math.abs(n.x-a.x)/2),c=Math.min(u,Math.abs(o.y-n.y)/2);if(u=c,C.c(u,0)){this.Rn(t,e,i,s,n,l),r.h(n);return}let d=n.x,f=n.y,p=d,g=f;n.x>s.x?(d=n.x-u,o.y>n.y?g=n.y+c:g=n.y-c):(d=n.x+u,o.y>n.y?g=n.y+c:g=n.y-c);let y=P.z(d,f);this.Rn(t,e,i,s,y,l),P.i(y),t.Au(n.x+e,n.y+i,p+e,g+i),r.e(p,g)}else if(C.c(s.x,n.x)&&C.c(n.y,o.y)){let u=Math.min(h,Math.abs(n.y-a.y)/2),c=Math.min(u,Math.abs(o.x-n.x)/2);if(u=c,C.c(c,0)){this.Rn(t,e,i,s,n,l),r.h(n);return}let d=n.x,f=n.y,p=d,g=f;n.y>s.y?(f=n.y-u,o.x>n.x?p=n.x+c:p=n.x-c):(f=n.y+u,o.x>n.x?p=n.x+c:p=n.x-c);let y=P.z(d,f);this.Rn(t,e,i,s,y,l),P.i(y),t.Au(n.x+e,n.y+i,p+e,g+i),r.e(p,g)}else this.Rn(t,e,i,s,n,l),r.h(n)}Rn(t,e,i,s,n,o){if(o||!this.Qh())t.Ys(n.x+e,n.y+i);else{let r=j.rv,a=r/2,h=[],l=0;this.isVisible()&&(l=this.VE(s,n,h));let u=s.x,c=s.y;if(l>0){if(C.c(s.y,n.y))if(s.x<n.x){let d=0;for(;d<l;){let f=Math.max(s.x,Math.min(h[d++]-a,n.x-r));t.Ys(f+e,n.y+i),u=f+e,c=n.y+i;let p=Math.min(f+r,n.x);for(;d<l;){let v=h[d];if(v<p+r)d++,p=Math.min(v+a,n.x);else break}let g=n.y-r+i,y=p+e,b=n.y+i;this.curve===10?t.Lu(y,b,!1,!1):t.wr(u,g,y,g,y,b),u=y,c=b}}else{let d=l-1;for(;d>=0;){let f=Math.min(s.x,Math.max(h[d--]+a,n.x+r));t.Ys(f+e,n.y+i),u=f+e,c=n.y+i;let p=Math.max(f-r,n.x);for(;d>=0;){let v=h[d];if(v>p-r)d--,p=Math.max(v-a,n.x);else break}let g=n.y-r+i,y=p+e,b=n.y+i;this.curve===10?t.Lu(y,b,!1,!1):t.wr(u,g,y,g,y,b),u=y,c=b}}else if(C.c(s.x,n.x))if(s.y<n.y){let d=0;for(;d<l;){let f=Math.max(s.y,Math.min(h[d++]-a,n.y-r));t.Ys(n.x+e,f+i),u=n.x+e,c=f+i;let p=Math.min(f+r,n.y);for(;d<l;){let v=h[d];if(v<p+r)d++,p=Math.min(v+a,n.y);else break}let g=n.x-r+e,y=n.x+e,b=p+i;this.curve===10?t.Lu(y,b,!1,!1):t.wr(g,c,g,b,y,b),u=y,c=b}}else{let d=l-1;for(;d>=0;){let f=Math.min(s.y,Math.max(h[d--]+a,n.y+r));t.Ys(n.x+e,f+i),u=n.x+e,c=f+i;let p=Math.max(f-r,n.y);for(;d>=0;){let v=h[d];if(v>p-r)d--,p=Math.max(v-a,n.y);else break}let g=n.x-r+e,y=n.x+e,b=p+i;this.curve===10?t.Lu(y,b,!1,!1):t.wr(g,c,g,b,y,b),u=y,c=b}}}t.Ys(n.x+e,n.y+i)}}VE(t,e,i){let s=this.diagram;if(s===null||t.equals(e))return 0;let n=s.layers;for(;n.next();){let o=n.value;if(o!==null&&o.visible){let r=o.UM(),a=r.length;for(let h=0;h<a;h++){let l=r[h];if(!(l instanceof j))continue;if(l===this)return i.length>0&&i.sort((d,f)=>d-f),i.length;if(!l.isVisible()||!l.Qh())continue;let u=l.routeBounds;if(!u.isReal()||!this.routeBounds.intersectsRect(u)||this.usesSamePort(l))continue;let c=l.path;c!==null&&c.isVisibleObject()&&this.BE(t,e,i,l)}}}return i.length>0&&i.sort((o,r)=>o-r),i.length}BE(t,e,i,s){let n=C.c(t.y,e.y),o=s.pointsCount,r=s.getPoint(0),a=P.l();for(let h=1;h<o;h++){let l=s.getPoint(h);if(h<o-1){let u=s.getPoint(h+1);if(r.y===l.y&&l.y===u.y){if(l.x>r.x&&u.x>=l.x||l.x<r.x&&u.x<=l.x)continue}else if(r.x===l.x&&l.x===u.x&&(l.y>r.y&&u.y>=l.y||l.y<r.y&&u.y<=l.y))continue}this.zE(t,e,r,l,a)&&(n?i.push(a.x):i.push(a.y)),r=l}P.i(a)}zE(t,e,i,s,n){let o=t.x,r=t.y,a=e.x,h=e.y,l=i.x,u=i.y,c=s.x,d=s.y;if(C.c(o,a)){if(!C.c(r,h)&&C.c(u,d)&&Math.min(r,h)<u&&Math.max(r,h)>u&&Math.min(l,c)<o&&Math.max(l,c)>o&&!C.c(l,c))return n.x=o,n.y=u,!0}else if(C.c(r,h)&&C.c(l,c)&&Math.min(o,a)<l&&Math.max(o,a)>l&&Math.min(u,d)<r&&Math.max(u,d)>r&&!C.c(u,d))return n.x=l,n.y=r,!0;return n.x=0,n.y=0,!1}get firstPickIndex(){return this.pointsCount<=2?0:this.isOrthogonal||!this.bl(this.computeSpot(!0))?1:0}get lastPickIndex(){let t=this.pointsCount;return t===0?0:t<=2?t-1:this.isOrthogonal||!this.bl(this.computeSpot(!1))?t-2:t-1}Qh(){let t=this.curve;return t===11||t===10}yk(t){if(t||this.Qh()){let e=this.diagram;e!==null&&!e.animationManager.isTicking&&!e.ra.has(this)&&(this.xl.width!==0||this.xl.height!==0)&&e.ra.set(this,this.xl.copy())}}invalidateOtherJumpOvers(t){let e=this.layer;if(e===null||!e.visible||e.isTemporary)return;let i=e.diagram;if(i===null||i.animationManager.isTicking)return;let s=!1,n=i.layers;for(;n.next();){let o=n.value;if(o.visible){if(o===e){s=!0;let r=!1,a=o.UM(),h=a.length;for(let l=0;l<h;l++){let u=a[l];u instanceof j&&(u===this?r=!0:r&&this.yv(u,t))}}else if(s){let r=o.UM(),a=r.length;for(let h=0;h<a;h++){let l=r[h];l instanceof j&&this.yv(l,t)}}}}}yv(t,e){if(t===null||!t.Ra||!t.Fi||!t.Qh())return;let i=t.routeBounds;i.isReal()&&(!this.routeBounds.intersectsRect(i)&&!e.intersectsRect(i)||this.usesSamePort(t)||t.ai())}usesSamePort(t){let e=this.pointsCount,i=t.pointsCount;if(e>0&&i>0){let s=this.getPoint(0),n=t.getPoint(0);if(s.equalsApprox(n))return!0;let o=this.getPoint(e-1),r=t.getPoint(i-1);if(o.equalsApprox(r)||s.equalsApprox(r)||o.equalsApprox(n))return!0}else if(this.fromNode===t.fromNode||this.toNode===t.toNode||this.fromNode===t.toNode||this.toNode===t.fromNode)return!0;return!1}isVisible(){if(!super.isVisible())return!1;let t=this.containingGroup,e=!0,i=this.diagram;i!==null&&(e=i.isTreePathToChildren);let s=this.fromNode;if(s!==null){if(this.isTreeLink&&e&&!s.isTreeExpanded)return!1;if(s===t)return!0;let o=s;for(;o!==null;){if(o.labeledLink===this)return!0;o=o.containingGroup}let r=s.findVisibleNode();if(r===null||r===t)return!1}let n=this.toNode;if(n!==null){if(this.isTreeLink&&!e&&!n.isTreeExpanded)return!1;if(n===t)return!0;let o=n;for(;o!==null;){if(o.labeledLink===this)return!0;o=o.containingGroup}let r=n.findVisibleNode();if(r===null||r===t)return!1}return!0}Xe(t){if(super.Xe(t),t&&this.yk(!1),this.ir!==null&&this.ir.Jd(),this.nn!==null){let e=this.nn.iterator;for(;e.next();)e.value.Xe(t)}}get adjusting(){return this.Xf}set adjusting(t){let e=this.Xf;e!==t&&(this.Xf=t,this.t("adjusting",e,t))}computeAdjusting(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?17:this.Xf}get corner(){return this.Qd}set corner(t){let e=this.Qd;e!==t&&(this.Qd=t,this.ai(),this.t("corner",e,t))}get curve(){return this._d}set curve(t){let e=this._d;e!==t&&(this._d=t,(e===9||t===9)&&this.DC(this.xl),this.$t(),this.ai(),this.yk(e===10||e===11||t===10||t===11),this.t("curve",e,t))}get curviness(){return this.tg}set curviness(t){let e=this.tg;e!==t&&(this.tg=t,this.$t(),this.ai(),this.t("curviness",e,t))}get routing(){return this.Wh}set routing(t){let e=this.Wh;e!==t&&(this.Wh=t,this.isAvoiding&&this.diagram!==null&&(this.diagram.lp=!0),this.er=null,this.$t(),this.yk(j.NC(e)||j.NC(t)),this.t("routing",e,t))}get smoothness(){return this.eg}set smoothness(t){let e=this.eg;e!==t&&(this.eg=t,this.ai(),this.t("smoothness",e,t))}Qy(){let t=this.mo;if(t===null)return;let e=this.yo;if(e===null||!isNaN(this.curviness))return;let i=this.po,s=this.wo,n=null,o=null,r=t.ee.r,a=r.length;for(let h=0;h<a;h++){let l=r[h];!(l.mo===t&&l.po===i&&l.yo===e&&l.wo===s)&&!(l.mo===e&&l.po===s&&l.yo===t&&l.wo===i)||(o===null?o=l:(n===null&&(n=[],n.push(o)),n.push(l)))}if(n!==null){let h=t.qD(e,i,s);h===null&&(h=new $n(t,i,e,s),t.KD(h),e.KD(h)),h.on=n;for(let l=0;l<n.length;l++){let u=n[l];u.ir=h}h.Jd()}}Zy(){let t=this.ir;if(t!==null){if(!isNaN(this.curviness))return;this.ir=null;let e=t.on.indexOf(this);e>=0&&(t.on.splice(e,1),t.Jd())}}Lr(){return!0}get key(){let t=this.diagram;if(!(t===null||!t.model.jh()))return t.model.getKeyForLinkData(this.data)}}class $n{Yo;qs;Gy;yC;fk;wC;on;constructor(t,e,i,s){V.Je(this),this.Yo=!1,this.qs=!1,this.Gy=t,this.yC=e,this.fk=i,this.wC=s,this.on=[]}Jd(){if(!this.Yo){let t=this.on;if(t.length>0){let e=t[0].diagram;e!==null&&(e.l2.add(this),this.qs=e.undoManager.isUndoingRedoing)}}this.Yo=!0}S2(){if(this.Yo){this.Yo=!1;let t=this.on;if(t.length>0){let e=t[0],i=e.diagram,s=i===null||i.Qa&&!this.qs;this.qs=!1,e.arrangeBundledLinks(t,s),t.length===1&&(e.ir=null,t.length=0)}t.length===0&&(this.Gy.HD(this),this.fk.HD(this))}}}class Ot{ui;di;ec;ic;we;xe;Bt;Oa;Ia;Ah;E2;Yo;tw;af;U2;V2;constructor(t){V.Je(this),this.Ah=null,this.E2=null,this.Yo=!0,this.tw=!1,this.ui=1,this.di=1,this.ec=-1,this.ic=-1,this.we=t.width,this.xe=t.height,this.Bt=[],this.Oa=0,this.Ia=0,this.af=j.dv,this.U2=this.af*2,this.V2=this.af*2}static rn=0;static sc=1;static sg=999999;static UC=Ot.sg+1;static VC=Ot.sg+2;f1(t){if(t.width<=0||t.height<=0)return;let e=t.x,i=t.y,s=t.x+t.width,n=t.y+t.height;this.ui=Math.floor((e-this.we)/this.we)*this.we,this.di=Math.floor((i-this.xe)/this.xe)*this.xe,this.ec=Math.ceil((s+2*this.we)/this.we)*this.we,this.ic=Math.ceil((n+2*this.xe)/this.xe)*this.xe;let o=1+(Math.ceil((this.ec-this.ui)/this.we)|0),r=1+(Math.ceil((this.ic-this.di)/this.xe)|0);if(this.Bt.length===0||this.Oa<o-1||this.Ia<r-1){let a=[];for(let h=0;h<=o;h++)a[h]=new Uint32Array(r);this.Bt=a,this.Oa=o-1,this.Ia=r-1}this.XE(Ot.UC)}get bounds(){return new I(this.ui,this.di,this.ec-this.ui,this.ic-this.di)}get cellWidth(){return this.we}set cellWidth(t){t>0&&t!==this.we&&(this.we=t,this.f1(this.bounds))}get cellHeight(){return this.xe}set cellHeight(t){t>0&&t!==this.xe&&(this.xe=t,this.f1(this.bounds))}ng(t,e){return this.ui<=t&&t<=this.ec&&this.di<=e&&e<=this.ic}xo(t,e){if(!this.ng(t,e))return Ot.UC;t-=this.ui,t/=this.we,e-=this.di,e/=this.xe;let i=t|0,s=e|0;return this.Bt[i][s]}FO(t,e,i,s){if(!this.ng(t,e))return;let n=(t-this.ui)/this.we|0,o=(e-this.di)/this.xe|0,r=(t+i-this.ui)/this.we|0,a=(e+s-this.di)/this.xe|0,h=Math.min(r,this.Oa),l=Math.min(a,this.Ia);for(let u=n;u<=h;u++){let c=this.Bt[u];if(c.fill)c.fill(Ot.rn,o,l+1);else for(let d=o;d<=l;d++)c[d]=Ot.rn}}XE(t){for(let e=0;e<=this.Oa;e++){let i=this.Bt[e];if(i.fill)i.fill(t);else for(let s=0;s<=this.Ia;s++)i[s]=t}}vT(){for(let t=0;t<=this.Oa;t++){let e=this.Bt[t];for(let i=0;i<=this.Ia;i++)e[i]>=Ot.sc&&(e[i]=Ot.UC)}}GE(t,e){return this.xo(t,e)===Ot.rn}isUnoccupied(t,e,i,s){if(t>this.ec||t+i<this.ui||e>this.ic||e+s<this.di)return!0;let n=(t-this.ui)/this.we|0,o=(e-this.di)/this.xe|0,r=Math.max(0,i)/this.we+1|0,a=Math.max(0,s)/this.xe+1|0;if(n<0&&(r+=n,n=0),o<0&&(a+=o,o=0),r<0||a<0)return!0;let h=Math.min(n+r-1,this.Oa)|0,l=Math.min(o+a-1,this.Ia)|0;for(let u=n;u<=h;u++){let c=this.Bt[u];for(let d=o;d<=l;d++)if(c[d]===Ot.rn)return!1}return!0}maxAvoidsLinksSpaceH(t,e,i,s){if(t>this.ec||e<this.ui||i>this.ic||i<this.di)return 0;let n=(t-this.ui)/this.we|0,o=(e-this.ui)/this.we|0,r=(i-this.di)/this.xe|0,a=s/this.xe+1|0,h;for(h=0;h<a/2;h++){let l=!1;for(let u=n;u<=o;u++)if(this.Bt[u][r+h]===Ot.rn||this.Bt[u][r-h]===Ot.rn){l=!0;break}if(l)return Math.max(0,(2*h-1)*this.xe)}return s}maxAvoidsLinksSpaceV(t,e,i,s){if(t>this.ic||e<this.di||i>this.ec||i<this.ui)return 0;let n=(t-this.di)/this.xe|0,o=(e-this.di)/this.xe|0,r=(i-this.ui)/this.we|0,a=s/this.we+1|0,h;for(h=0;h<a/2;h++){let l=!1;for(let u=n;u<=o;u++)if(this.Bt[r+h][u]===Ot.rn||this.Bt[r-h][u]===Ot.rn){l=!0;break}if(l)return Math.max(0,(2*h-1)*this.we)}return s}YE(t,e,i,s,n,o,r,a){t=t|0,e=e|0;let h=this.Bt[t][e];if(h>=Ot.sc&&h<Ot.sg)for(s?e+=i:t+=i,h+=1;n<=t&&t<=o&&r<=e&&e<=a;){let l=this.Bt[t][e];if(h>=l)break;this.Bt[t][e]=h,h+=1,s?e+=i:t+=i}return s?e:t}bo(t,e,i,s,n,o,r,a){if(t<n||t>o||e<r||e>a)return;let h=this.YE(t,e,i,s,n,o,r,a);if(s)if(i>0)for(let l=e+i;l<h;l+=i)this.bo(t,l,1,!s,n,o,r,a),this.bo(t,l,-1,!s,n,o,r,a);else for(let l=e+i;l>h;l+=i)this.bo(t,l,1,!s,n,o,r,a),this.bo(t,l,-1,!s,n,o,r,a);else if(i>0)for(let l=t+i;l<h;l+=i)this.bo(l,e,1,!s,n,o,r,a),this.bo(l,e,-1,!s,n,o,r,a);else for(let l=t+i;l>h;l+=i)this.bo(l,e,1,!s,n,o,r,a),this.bo(l,e,-1,!s,n,o,r,a)}Pk(t,e,i,s,n,o,r,a,h,l){let u=t|0,c=e|0,d=Ot.rn,f=Ot.sc;for(this.Bt[u][c]=f;d===Ot.rn&&u>r&&u<a&&c>h&&c<l;)f+=1,this.Bt[u][c]=f,o?c+=n:u+=n,d=this.Bt[u][c];return o?c:u}Sk(t,e,i,s,n,o,r,a,h,l){let u=i|0,c=s|0,d=Ot.rn,f=Ot.sg;for(this.Bt[u][c]=f;d===Ot.rn&&u>r&&u<a&&c>h&&c<l;)this.Bt[u][c]=f,o?c+=n:u+=n,d=this.Bt[u][c]}wv(t,e,i,s,n,o){this.tw=!1;let r=t.x,a=t.y;if(!this.ng(r,a))return;r-=this.ui,r/=this.we,a-=this.di,a/=this.xe;let h=i.x,l=i.y;if(!this.ng(h,l))return;if(h-=this.ui,h/=this.we,l-=this.di,l/=this.xe,Math.abs(r-h)<=1&&Math.abs(a-l)<=1){this.tw=!0;return}let u=n.x,c=n.y,d=n.x+n.width,f=n.y+n.height;u-=this.ui,u/=this.we,c-=this.di,c/=this.xe,d-=this.ui,d/=this.we,f-=this.di,f/=this.xe;let p=Math.max(0,Math.min(this.Oa,u|0)),g=Math.min(this.Oa,Math.max(0,d|0)),y=Math.max(0,Math.min(this.Ia,c|0)),b=Math.min(this.Ia,Math.max(0,f|0)),v=0,w=90,k=270,S=this.Bt,N=r|0,D=a|0,L=h|0,M=l|0,A=e===v||e===w?1:-1,F=e===w||e===k;S[N][D]===Ot.rn?(this.Pk(N,D,L,M,A,F,p,g,y,b),this.Pk(N,D,L,M,1,!F,p,g,y,b),this.Pk(N,D,L,M,-1,!F,p,g,y,b)):this.Pk(N,D,L,M,A,F,N,D,N,D),S[L][M]===Ot.rn?(this.Sk(N,D,L,M,s===v||s===w?1:-1,s===w||s===k,p,g,y,b),this.Sk(N,D,L,M,1,!(s===w||s===k),p,g,y,b),this.Sk(N,D,L,M,-1,!(s===w||s===k),p,g,y,b)):this.Sk(N,D,L,M,A,F,L,M,L,M);let O=m.nt();if(o&&this.xv(L,M,s,N,D,O)){(O[0]!==L||O[1]!==M)&&(O.unshift(M),O.unshift(L)),(O[O.length-2]!==N||O[O.length-1]!==D)&&(O.push(N),O.push(D));let E=Ot.sc,B=O[O.length-2],K=O[O.length-1];S[B][K]=E++;for(let z=O.length-4;z>=0;z-=2){B=O[z+2],K=O[z+3];let U=O[z],tt=O[z+1];for(;U>B?B++:U<B?B--:tt>K?K++:tt<K&&K--,S[B][K]=E++,!(B===U&&K===tt););}}else this.bo(N,D,1,!1,p,g,y,b),this.bo(N,D,-1,!1,p,g,y,b),this.bo(N,D,1,!0,p,g,y,b),this.bo(N,D,-1,!0,p,g,y,b);m.Z(O)}xv(t,e,i,s,n,o){let r=this.Bt,a=t,h=e;for(;;){if(a===s&&h===n)return!0;let l=a,u=h;if(i===0)if(l<s)l++;else break;else if(i===90)if(u<n)u++;else break;else if(i===180)if(l>s)l--;else break;else if(u>n)u--;else break;let c=r[l][u];if(c===0||c===Ot.VC)break;a=l,h=u}for(;;){let l=i,u=a,c=h;i===0?c<n?(l=90,c++):c>n&&(l=270,c--):i===90?u<s?(l=0,u++):u>s&&(l=180,u--):i===180?c<n?(l=90,c++):c>n&&(l=270,c--):u<s?(l=0,u++):u>s&&(l=180,u--);let d=r[u][c];if(l!==i&&d!==0&&d!==Ot.VC){if(o.push(a),o.push(h),this.xv(a,h,l,s,n,o))return!0;o.pop(),o.pop()}if(r[a][h]=Ot.VC,i===0){if(a===t)return!1;a--}else if(i===90){if(h===e)return!1;h--}else if(i===180){if(a===t)return!1;a++}else{if(h===e)return!1;h++}}}}class Ji{Ri;kl;Ei;og;constructor(t,e){V.Je(this),this.Ri=t,this.kl=e,this.Ei=[],this.og=!1}toString(){let t=this.Ei,e=this.Ri.toString()+" "+t.length.toString()+":";for(let i=0;i<t.length;i++){let s=t[i];s!==null&&(e+=`
|
|
12
|
+
`);if(t.length===0)return 8;if(this.isMultiline){let e=0,i=0,s=!1;for(;!s;){let n=this.ok(t,i);n===-1&&(n=t.length,s=!0);let o=t.substring(i,n);this.formatting===0&&(o=o.trim()),e=Math.max(e,this.getStringWidth(o)),i=n+1}return e}else{let e=this.ok(t,0);return e>=0&&(t=t.substring(0,e)),this.getStringWidth(t)}}get textValidation(){return this.tt!==null?this.tt.zl:null}set textValidation(t){let e=this.textValidation;e!==t&&(t!==null&&m.S(t,lt,"textValidation"),this.Rs().zl=t,this.t("textValidation",e,t))}get textEdited(){return this.tt!==null?this.tt.ny:null}set textEdited(t){let e=this.textEdited;e!==t&&(t!==null&&m.S(t,lt,"textEdited"),this.Rs().ny=t,this.t("textEdited",e,t))}get spacingAbove(){return this.tt!==null?this.tt.ly:0}set spacingAbove(t){let e=this.spacingAbove;e!==t&&(this.Rs().ly=t,this.f(),this.t("spacingAbove",e,t))}get spacingBelow(){return this.tt!==null?this.tt.hy:0}set spacingBelow(t){let e=this.spacingBelow;e!==t&&(this.Rs().hy=t,this.f(),this.t("spacingBelow",e,t))}get letterSpacing(){return this.tt!==null?this.tt.cy:"0px"}set letterSpacing(t){let e=this.letterSpacing;e!==t&&(lt.nk=!0,this.Rs().cy=t,this.f(),this.t("letterSpacing",e,t))}get wordSpacing(){return this.tt!==null?this.tt.fy:"0px"}set wordSpacing(t){let e=this.wordSpacing;e!==t&&(lt.nk=!0,this.Rs().fy=t,this.f(),this.t("wordSpacing",e,t))}get formatting(){return this.tt!==null?this.tt.uy:0}set formatting(t){let e=this.formatting;e!==t&&(this.Rs().uy=t,this.f(),this.t("formatting",e,t))}get maxLines(){return this.tt!==null?this.tt.gy:1/0}set maxLines(t){let e=this.maxLines;e!==t&&(t=Math.floor(t),t<=0&&m.J(t,"> 0",lt,"maxLines"),this.Rs().gy=t,this.f(),this.t("maxLines",e,t))}getMetrics(){return[this.pe,this.Xl,this.uo,this.vn,this.Ii,this.ye,this.Fn||""]}rE(t){t!==void 0&&(this.pe=t[0],this.Xl=t[1],this.uo=t[2],this.vn=t[3],this.Ii=t[4],this.ye=t[5],this.Fn=t[6])}get metrics(){return{arrSize:this.Ii!==null?this.Ii:[this.pe],arrText:this.ye!==null?this.ye:[this.Fn],maxLineWidth:this.pe,fontHeight:this.uo}}get choices(){return this.Kd}set choices(t){let e=this.Kd;e!==t&&(this.Kd=t,this.t("choices",e,t))}static fE=new RegExp("[ \u200B\xAD]");static lC=new bt;static vD=0;static ek=new bt;static nC=0;static $0="...";static TD="";static us=null;static M0=!1;static nk=!1}class Ui{me;gs;go;uy;gy;_0;ly;hy;Z0;ny;ey;zl;al;Q0;cy;fy;constructor(){this.me=!1,this.gs=null,this.go=0,this.uy=0,this.gy=1/0,this._0=0,this.ly=0,this.hy=0,this.Z0="start",this.ny=null,this.ey=null,this.zl=null,this.al=T.Top,this.Q0=2,this.cy="0px",this.fy="0px"}copy(){let t=new Ui;return t.gs=this.gs,t.go=this.go,t.uy=this.uy,t.gy=this.gy,t._0=this._0,t.ly=this.ly,t.hy=this.hy,t.Z0=this.Z0,t.ny=this.ny,t.ey=this.ey,t.zl=this.zl,t.al=this.al,t.Q0=this.Q0,t.cy=this.cy,t.fy=this.fy,t}}class xe{vf;Ff;Rf;iy;Of;constructor(){this.vf=1,this.Ff=0,this.Rf=1,this.iy=null,this.Of=null}copy(){let t=new xe;return t.vf=this.vf,t.Ff=this.Ff,t.Rf=this.Rf,t.iy=this.iy,t.Of=this.Of,t}}var ji=(x=>(x[x.None=0]="None",x[x.Fill=2]="Fill",x[x.Uniform=6]="Uniform",x[x.UniformToFill=7]="UniformToFill",x))(ji||{});class Bt extends ${hl;en;cl;If;gs;fl;Ef;go;Uf;Vf;U1;constructor(t,e){super(),this.n|=2097152,this.hl=null,this.en="",this.cl=I.YF,this.If=2,this.gs=null,this.fl=null,this.Ef=T.Center,this.go=0,this.Uf=null,this.Vf=null,this.U1=null,typeof t=="string"?this.source=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.en=this.en,t.element=this.hl,t.cl=this.cl.N(),t.If=this.If,t.go=this.go,t.gs=this.gs,t.fl=this.fl,t.Ef=this.Ef.N(),t.Vf=this.Vf}fe(t){t in ji?this.imageStretch=t:super.fe(t)}toString(){return"Picture("+this.source+")#"+V.xs(this)}get Bf(){return(this.n&1048576)!==0}set Bf(t){this.Bf!==t&&(this.n=this.n^1048576)}get my(){return(this.n&2097152)!==0}set my(t){this.my!==t&&(this.n=this.n^2097152)}get Sn(){return(this.n&4194304)!==0}set Sn(t){this.Sn!==t&&(this.n=this.n^4194304)}static clearCache(t){t===void 0&&(t=""),m.s(t,"string",Bt,"clearCache:url"),t!==""?Bt.yy[t]&&(delete Bt.yy[t],Bt.rk--):(Bt.yy=new bt,Bt.rk=0)}static NT(t,e){e.FD||(e.lk=i=>{Bt.uE(e,i),t.desiredSize.isReal()||(t.xi(!1),t.f())},e.ak=i=>Bt.dE(e,i),e.addEventListener("load",e.lk),e.addEventListener("error",e.ak),e.FD=!0)}static vO(t){t.lk&&t.removeEventListener("load",t.lk),t.ak&&t.removeEventListener("error",t.ak),delete t.lk,delete t.ak,t.FD=!1}get element(){return this.hl}set element(t){let e=this.hl;if(this.Ji(!0),e!==t){let i=Y.isUsingDOM(),s=!1;i&&(this.Bf=t instanceof HTMLCanvasElement,s=t instanceof HTMLImageElement,t!==null&&!(s||t instanceof HTMLVideoElement||this.Bf)&&m.o("Picture.element must be an instance of Image, Canvas, or Video, not: "+t));let n=this.diagram;n!==null&&n.O2(this),this.hl=t,t!==null&&s&&t.hs===void 0&&(t.hs=new V),n!==null&&s&&n.R2(this),this.t("element",e,t),this.C()}}TO(){let t=this.hl;if(t===null)return;let e=this.desiredSize.isReal();(this.Bf||t.complete===!0)&&(t.Dp&&(t.wy instanceof Event&&this.gs!==null?this.gs(this,t.wy):t.Sn===!0&&!t.wy&&this.fl!==null&&t.aC&&this.fl(this,t.aC)),t.Sn=!0),t.Sn&&e&&this.diagram!==null&&this.diagram.od.add(this)}gE(){if(this.hl===null){this.Uf=!1;return}let t=new Fe(null)._t;try{t.drawImage(this.hl,0,0)}catch{this.my=!1}try{t.getImageData(0,0,1,1).data[3]&&(this.Uf=!1),this.Uf=!1}catch{this.Uf=!0}}get source(){return this.en}set source(t){let e=this.en;if(e!==t){this.Ji(!0),m.s(t,"string",Bt,"source"),this.en=t;let i=Bt.yy,s=null;if(i[t]!==void 0)s=i[t];else if(t!==""){Bt.rk>30&&(Bt.clearCache(),i=Bt.yy),s=m.Ni("img"),s.Dp=!0,Bt.NT(this,s);let n=this.Vf;n!==null&&(s.crossOrigin=n(this)),s.src=t,i[t]=s,Bt.rk++}this.element=s,s!==null&&s.__goCache===void 0&&(s.__goCache=new Hn),this.f(),this.C(),this.t("source",e,t)}}static uE(t,e){t.Sn=!0,t.wy=!1;let i,s=t.hs.copy();if(s==null)return;let n=s.iterator;for(;n.next();){let o=n.value;o.C();let r=t.getAttribute("src")||"",a=o.oa.get(r);if(a===null)continue;let h=a.length;for(let l=0;l<h;l++)i=a[l],i.desiredSize.isReal()||o.od.add(i),i.Ji(!0),o.requestUpdate(),t.Dp&&(t.aC===void 0&&(t.aC=e),i.fl!==null&&i.fl(i,e))}t.hs.clear()}static dE(t,e){t.wy=e;let i,s=t.hs.copy();if(s==null)return;let n=s.iterator;for(;n.next();){let o=n.value,r=t.getAttribute("src")||"",a=o.oa.get(r);if(a===null)continue;let h=a.length,l=m.nt();for(let u=0;u<h;u++)l.push(a[u]);if(t.Dp)for(let u=0;u<h;u++)i=l[u],i.gs!==null&&i.gs(i,e);m.Z(l)}t.hs.clear()}reloadSource(){if(this.source==="")return;Bt.clearCache(this.source);let t=this.source;this.source="",this.source=t}redraw(){this.C(),this.Ji(!0)}get sourceCrossOrigin(){return this.Vf}set sourceCrossOrigin(t){if(this.Vf!==t){t!==null&&m.S(t,Bt,"sourceCrossOrigin"),this.Vf=t;let e=this.element;if(e!==null){let i=e.getAttribute("src");e.crossOrigin!==void 0&&(t===null&&typeof i=="string"?e.crossOrigin=null:t!==null&&(e.crossOrigin=t(this)),i&&(e.src=i))}}}get sourceRect(){return this.cl}set sourceRect(t){let e=this.cl;e.equals(t)||(t=t.N(),this.cl=t,this.f(),this.t("sourceRect",e,t))}get imageStretch(){return this.If}set imageStretch(t){let e=this.If;e!==t&&(this.If=t,this.C(),this.t("imageStretch",e,t))}get flip(){return this.go}set flip(t){let e=this.go;e!==t&&(this.go=t,this.C(),this.t("flip",e,t))}get imageAlignment(){return this.Ef}set imageAlignment(t){let e=this.Ef;e.equals(t)||(t=t.N(),this.Ef=t,this.C(),this.t("imageAlignment",e,t))}get errorFunction(){return this.gs}set errorFunction(t){let e=this.gs;e!==t&&(t!==null&&m.S(t,Bt,"errorFunction"),this.gs=t,this.t("errorFunction",e,t))}get successFunction(){return this.fl}set successFunction(t){let e=this.fl;e!==t&&(t!==null&&m.S(t,Bt,"successFunction"),this.fl=t,this.t("successFunction",e,t))}Ma(t,e){let i=this.hl;if(i===null)return;let s=i.getAttribute("src"),n=Y.isUsingDOM();if(n&&i instanceof HTMLImageElement&&(s===null||s==="")||i.wy instanceof Event&&t instanceof ci)return;let o=t instanceof re,r=this.naturalBounds,a=0,h=0,l=this.Bf,u=l?+i.width:i.naturalWidth,c=l?+i.height:i.naturalHeight;if(u===void 0&&i.videoWidth&&(u=i.videoWidth),c===void 0&&i.videoHeight&&(c=i.videoHeight),n){if(u===0||c===0)return}else u=this.width,c=this.height;let d=u,f=c;this.sourceRect.isReal()&&(a=this.cl.x,h=this.cl.y,u=this.cl.width,c=this.cl.height);let p=u,g=c,y=this.If,b=this.Ef;switch(y){case 0:if(this.sourceRect.isReal())break;p>=r.width&&(a=a+b.offsetX+(p*b.x-r.width*b.x)),g>=r.height&&(h=h+b.offsetY+(g*b.y-r.height*b.y)),u=Math.min(r.width,p),c=Math.min(r.height,g);break;case 2:p=r.width,g=r.height;break;case 6:case 7:let E=0;y===6?(E=Math.min(r.height/g,r.width/p),p*=E,g*=E):y===7&&(E=Math.max(r.height/g,r.width/p),p*=E,g*=E,p>=r.width&&(a=(a+b.offsetX+(p*b.x-r.width*b.x)/p)*u),g>=r.height&&(h=(h+b.offsetY+(g*b.y-r.height*b.y)/g)*c),u*=1/(p/r.width),c*=1/(g/r.height),p=r.width,g=r.height);break}let v=u*c,w=this.getDocumentScale()*e.scale,k=p*w,S=g*w,N=k*S,D=v/N,L=i.__goCache,M=null,A=Bt.mE;if(!o){if(i.Sn&&L!==void 0&&d<8e3&&f<8e3&&N>4&&D>A*A){L.Bt===null&&(L.RD(4,d,f,i),L.RD(16,d,f,i));let E=L.Bt,B=E.length;for(let K=0;K<B&&E[K].qd*E[K].qd<D;K++)M=E[K]}if(!e.nd&&(this.Uf===null&&this.gE(),this.Uf))return}let F=p<r.width?b.offsetX+(r.width*b.x-p*b.x):0,O=g<r.height?b.offsetY+(r.height*b.y-g*b.y):0;switch(this.flip){case 0:break;case 2:t.translate(Math.min(r.width,p),0),t.scale(-1,1);break;case 1:t.translate(0,Math.min(r.height,g)),t.scale(1,-1);break;case 3:t.translate(Math.min(r.width,p),Math.min(r.height,g)),t.scale(-1,-1);break}if(t.commitTransform(),e.getRenderingHint("pictureRatioOptimization")&&!e.ph&&L!==void 0&&M!==null&&M.qd!==1){t.save();let E=M.qd;try{t.drawImage(M.en,a/E,h/E,Math.min(M.en.width,u/E),Math.min(M.en.height,c/E),F,O,Math.min(r.width,p),Math.min(r.height,g)),t instanceof re&&(this.U1=[a/E,h/E,Math.min(M.en.width,u/E),Math.min(M.en.height,c/E),F,O,Math.min(r.width,p),Math.min(r.height,g)])}catch{this.my=!1}t.restore()}else try{t.drawImage(i,a,h,u,c,F,O,Math.min(r.width,p),Math.min(r.height,g)),t instanceof re&&(this.U1=[a,h,u,c,F,O,Math.min(r.width,p),Math.min(r.height,g)])}catch{this.my=!1}switch(this.flip){case 0:break;case 2:t.scale(-1,1),t.translate(-Math.min(r.width,p),0);break;case 1:t.scale(1,-1),t.translate(0,-Math.min(r.height,g));break;case 3:t.scale(-1,-1),t.translate(-Math.min(r.width,p),-Math.min(r.height,g));break}}get naturalBounds(){return this.Ke}bd(t,e,i,s){let n=this.desiredSize,o=this.Zs(!0),r=this.hl,a=this.Bf,h=0,l=0;(a||!this.Sn&&r&&r.complete)&&(this.Sn=!0),r===null?(isFinite(n.width)||(t=i),isFinite(n.height)||(e=s)):(h=a?+r.width:r.naturalWidth,l=a?+r.height:r.naturalHeight),!isFinite(n.width)&&o!==2&&o!==5?r!==null&&this.Sn!==!1&&(this.sourceRect.isReal()?t=this.sourceRect.width:t=h):(isFinite(t)||(this.sourceRect.isReal()?t=this.sourceRect.width:r!==null&&(t=h)),i=0),!isFinite(n.height)&&o!==2&&o!==4?r!==null&&this.Sn!==!1&&(this.sourceRect.isReal()?e=this.sourceRect.height:e=l):(isFinite(e)||(this.sourceRect.isReal()?e=this.sourceRect.height:r!==null&&(e=l)),s=0),isFinite(n.width)&&(t=n.width),isFinite(n.height)&&(e=n.height);let u=this.maxSize,c=this.minSize;i=Math.max(i||0,c.width),s=Math.max(s||0,c.height),t=Math.min(u.width,t),e=Math.min(u.height,e),t=Math.max(i,t),e=Math.max(s,e),r!==null&&!r.complete&&(isFinite(t)||(t=0),isFinite(e)||(e=0)),this.Ke.Hn(t,e),this.ro(0,0,t,e)}Pa(t,e,i,s){this.commonArrange(t,e,i,s)}static yy=new bt;static rk=0;static mE=4}class Hn{Bt;constructor(){this.Bt=null}RD(t,e,i,s){this.Bt===null&&(this.Bt=[]);let n=new Fe(null),o=n._t,r=1/t;if(n.width=e/t,n.height=i/t,n.width===0||n.height===0)return;let a=new Wn(n.bt,t),h=s,l=1;if(this.Bt.length>0){let u=this.Bt[this.Bt.length-1];h=u.en,l=u.qd}o.setTransform(r*l,0,0,r*l,0,0),o.commitTransform(),o.drawImage(h,0,0),this.Bt.push(a)}}class Wn{en;qd;constructor(t,e){this.en=t,this.qd=e}}class Ce{Ne;um;constructor(){this.um=new wt,this.Ne=null}Ue(t){t!==null?(this.um=t,t.figures.clear()):this.um=new wt,this.Ne=null}Lu(t,e,i,s,n,o){if(s!==void 0&&s===!0){let r=new mt(1);r.endX=t,r.endY=e,this.Ne.segments.add(r)}else this.Ne=new Kt,this.Ne.startX=t,this.Ne.startY=e,this.Ne.isFilled=i,this.Ne.isEvenOdd=o||!1,this.um.figures.add(this.Ne);n!==void 0&&(this.Ne.isShadowed=n)}tR(){let t=this.Ne.segments.length;t>0&&this.Ne.segments.elt(t-1).close()}eR(){this.Ne.segments.length>0&&(this.Ne.isFilled=!0)}iR(t){this.Ne.isShadowed=t}zU(t){this.Ne.isEvenOdd=t}ZF(t,e,i){i===void 0&&(i=!1);let s=new mt(1);s.endX=t,s.endY=e,i&&s.close(),this.Ne.segments.add(s)}Ys(t,e,i){i===void 0&&(i=!1);let s=new mt(2);s.endX=t,s.endY=e,i&&s.close(),this.Ne.segments.add(s)}wr(t,e,i,s,n,o,r){r===void 0&&(r=!1);let a=new mt(3);a.point1X=t,a.point1Y=e,a.point2X=i,a.point2Y=s,a.endX=n,a.endY=o,r&&a.close(),this.Ne.segments.add(a)}Au(t,e,i,s,n){n===void 0&&(n=!1);let o=new mt(4);o.point1X=t,o.point1Y=e,o.endX=i,o.endY=s,n&&o.close(),this.Ne.segments.add(o)}QF(t,e,i,s,n,o,r){o===void 0&&(o=0),r===void 0&&(r=!1);let a=new mt(5);a.startAngle=t,a.sweepAngle=e,a.centerX=i,a.centerY=s,a.radiusX=n,o!==0?a.radiusY=o:a.radiusY=n,r&&a.close(),this.Ne.segments.add(a)}_F(t,e,i,s,n,o,r,a){a===void 0&&(a=!1);let h=new mt(6,o,r,t,e,i,s,n);a&&h.close(),this.Ne.segments.add(h)}static hC=null;static JL(t){let e=Ce.hC;if(e!==null)return Ce.hC=null,e.Ue(t),e;{let i=new Ce;return i.Ue(t),i}}static $L(t){Ce.hC=t}}{let x=function(n,o){let r=n.toLowerCase(),a=C.Wn;a[n]=o,a[r]=n};x("Rectangle",(n,o,r)=>{let a="r"+o+","+r,h=C.pr[a];return h!==void 0||(h=new wt(2),h.endX=o,h.endY=r,C.yr<C.am&&(C.pr[a]=h,C.yr++)),h}),x("Square",(n,o,r)=>{let a="s"+o+","+r,h=C.pr[a];return h!==void 0||(h=new wt(2),h.endX=o,h.endY=r,h.defaultStretch=6,C.yr<C.am&&(C.pr[a]=h,C.yr++)),h});let t=(n,o,r,a,h)=>{(isNaN(a)||a<0)&&(a=5),isNaN(h)&&(h=15);let l="rr"+o+","+r+","+a+","+h,u=C.pr[l];if(u!==void 0)return u;let c=a;(h&1)===1?(c=Math.min(c,(h&2)===2?o/3:o),c=Math.min(c,(h&8)===8?r/3:r)):c=0;let d=new Kt(c,0,!0);u=new wt().add(d);let f=T.TopLeft.copy(),p=T.BottomRight.copy();if((h&2)===2){let g=a;g=Math.min(g,(h&1)===1?o/3:o),g=Math.min(g,(h&4)===4?r/3:r);let y=g*C.qn;d.add(new mt(2,o-g,0)).add(new mt(3,o,g,o-y,0,o,y)),f.offsetY=y,p.offsetX=-y}else d.add(new mt(2,o,0));if((h&4)===4){let g=a;g=Math.min(g,(h&8)===8?o/3:o),g=Math.min(g,(h&2)===2?r/3:r);let y=g*C.qn;d.add(new mt(2,o,r-g)).add(new mt(3,o-g,r,o,r-y,o-y,r)),p.offsetX=-y,p.offsetY=-y}else d.add(new mt(2,o,r));if((h&8)===8){let g=a;g=Math.min(g,(h&4)===4?o/3:o),g=Math.min(g,(h&1)===1?r/3:r);let y=g*C.qn;d.add(new mt(2,g,r)).add(new mt(3,0,r-g,y,r,0,r-y)),f.offsetX=y,p.offsetY=-y}else d.add(new mt(2,0,r));if((h&1)===1){let g=c*C.qn;d.add(new mt(2,0,c)).add(new mt(3,c,0,0,g,g,0).close()),f.offsetX=g,f.offsetY=g}else d.add(new mt(2,0,0).close());return u.spot1=f,u.spot2=p,C.yr<C.am&&(C.pr[l]=u,C.yr++),u};x("RoundedRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN,h=n?n.parameter2:NaN;return t(n,o,r,a,h)}),x("Border","RoundedRectangle"),x("RoundedTopRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN;return t(n,o,r,a,3)}),x("RoundedBottomRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN;return t(n,o,r,a,12)}),x("RoundedLeftRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN;return t(n,o,r,a,9)}),x("RoundedRightRectangle",(n,o,r)=>{let a=n?n.parameter1:NaN;return t(n,o,r,a,6)}),x("Ellipse",(n,o,r)=>{let a="e"+o+","+r,h=C.pr[a];return h!==void 0||(h=new wt(3),h.endX=o,h.endY=r,h.spot1=T.vP,h.spot2=T.FP,C.yr<C.am&&(C.pr[a]=h,C.yr++)),h}),x("Circle",(n,o,r)=>{let a="c"+o+","+r,h=C.pr[a];return h!==void 0||(h=new wt(3),h.endX=o,h.endY=r,h.spot1=T.vP,h.spot2=T.FP,h.defaultStretch=6,C.yr<C.am&&(C.pr[a]=h,C.yr++)),h}),x("TriangleRight",(n,o,r)=>new wt().add(new Kt(0,0).add(new mt(2,o,.5*r)).add(new mt(2,0,r).close())).setSpots(0,.25,.5,.75)),x("TriangleDown",(n,o,r)=>new wt().add(new Kt(0,0).add(new mt(2,o,0)).add(new mt(2,.5*o,r).close())).setSpots(.25,0,.75,.5)),x("TriangleLeft",(n,o,r)=>new wt().add(new Kt(o,r).add(new mt(2,0,.5*r)).add(new mt(2,o,0).close())).setSpots(.5,.25,1,.75)),x("TriangleUp",(n,o,r)=>new wt().add(new Kt(o,r).add(new mt(2,0,r)).add(new mt(2,.5*o,0).close())).setSpots(.25,.5,.75,1)),x("Triangle","TriangleUp"),x("Diamond",(n,o,r)=>new wt().add(new Kt(.5*o,0).add(new mt(2,0,.5*r)).add(new mt(2,.5*o,r)).add(new mt(2,o,.5*r).close())).setSpots(.25,.25,.75,.75)),x("LineH",(n,o,r)=>{let a=new wt(1);return a.startX=0,a.startY=r/2,a.endX=o,a.endY=r/2,a}),x("LineV",(n,o,r)=>{let a=new wt(1);return a.startX=o/2,a.startY=0,a.endX=o/2,a.endY=r,a}),x("None","Rectangle"),x("BarH","Rectangle"),x("BarV","Rectangle"),x("MinusLine","LineH"),x("PlusLine",(n,o,r)=>new wt().add(new Kt(0,r/2,!1).add(new mt(2,o,r/2)).add(new mt(1,o/2,0)).add(new mt(2,o/2,r)))),x("XLine",(n,o,r)=>new wt().add(new Kt(0,r,!1).add(new mt(2,o,0)).add(new mt(1,0,0)).add(new mt(2,o,r)))),x("LineRight",(n,o,r)=>new wt().add(new Kt(.25*o,0,!1).add(new mt(2,.75*o,.5*r)).add(new mt(2,.25*o,r)))),x("LineDown",(n,o,r)=>new wt().add(new Kt(0,.25*r,!1).add(new mt(2,.5*o,.75*r)).add(new mt(2,o,.25*r)))),x("LineLeft",(n,o,r)=>new wt().add(new Kt(.75*o,0,!1).add(new mt(2,.25*o,.5*r)).add(new mt(2,.75*o,r)))),x("LineUp",(n,o,r)=>new wt().add(new Kt(0,.75*r,!1).add(new mt(2,.5*o,.25*r)).add(new mt(2,o,.75*r)))),x("Capsule",(n,o,r)=>{let a=new wt;if(o<r){let h=o/2,l=new Kt(0,h,!0);a.add(l),l.add(new mt(5,180,180,h,h,h,h)),l.add(new mt(2,o,r-h)),l.add(new mt(5,0,180,h,r-h,h,h)),l.add(new mt(2,0,h));let u=isFinite(n.parameter1)?n.parameter1:o*.156;return a.setSpots(0,0,1,1,0,u,0,-u),a}else if(o>r){let h=r/2,l=new Kt(h,0,!0);a.add(l),l.add(new mt(2,o-h,0)),l.add(new mt(5,270,180,o-h,h,h,h)),l.add(new mt(2,h,r)),l.add(new mt(5,90,180,h,h,h,h));let u=isFinite(n.parameter1)?n.parameter1:r*.156;return a.setSpots(0,0,1,1,u,0,-u,0),a}else return a.type=3,a.endX=o,a.endY=r,a.spot1=T.vP,a.spot2=T.FP,a});let e=(n,o)=>new Kt(n,o,!1,!1),i=(n,o,r)=>n.add(new mt(2,o,r)),s=(n,o,r)=>n.add(new mt(1,o,r));x("Borders",(n,o,r)=>{let a=n?n.parameter1:NaN;isNaN(a)?a=10:a=a&15;let h=new wt,l;return a===10?(l=e(o,0),i(l,o,r),s(l,0,r),i(l,0,0)):a===5?(l=e(0,0),i(l,o,0),s(l,o,r),i(l,0,r)):a===1?(l=e(0,0),i(l,o,0),s(l,o,r)):a===2?(l=e(o,0),i(l,o,r)):a===4?(l=e(o,r),i(l,0,r)):a===8?(l=e(0,r),i(l,0,0),s(l,o,r)):a===3?(l=e(0,0),i(l,o,0),i(l,o,r)):a===6?(l=e(o,0),i(l,o,r),i(l,0,r)):a===12?(l=e(o,r),i(l,0,r),i(l,0,0)):a===9?(l=e(0,r),i(l,0,0),i(l,o,0)):a===7?(l=e(0,0),i(l,o,0),i(l,o,r),i(l,0,r)):a===14?(l=e(o,0),i(l,o,r),i(l,0,r),i(l,0,0)):a===13?(l=e(o,r),i(l,0,r),i(l,0,0),i(l,o,0)):a===11?(l=e(0,r),i(l,0,0),i(l,o,0),i(l,o,r)):a===15?(l=e(0,0),i(l,o,0),i(l,o,r),i(l,0,r),l.add(new mt(2,0,0).close())):(l=e(0,0),s(l,o,r)),h.add(l),h})}C.lm={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};var Gs=(x=>(x[x.None=0]="None",x[x.Added=1]="Added",x[x.Removed=2]="Removed",x[x.Shown=4]="Shown",x[x.Hidden=8]="Hidden",x[x.NodeSized=16]="NodeSized",x[x.GroupLayout=32]="GroupLayout",x[x.NodeReplaced=64]="NodeReplaced",x[x.Standard=127]="Standard",x[x.All=16777215]="All",x))(Gs||{});class pt extends G{b;Qo;H;ul;dl;_o;ue;gl;Da;sn;tr;jd;VM;OD;xy;ky;constructor(t,e){let i;t===void 0||t instanceof Lt||typeof t=="string"?i=t:t&&(e=t),super(i),this.b=2408959,this.Qo="",this.H=null,this.ul="",this.dl=null,this._o=null,this.ue="",this.gl=null,this.Da=null,this.sn=new P(NaN,NaN).k(),this.tr=null,this.jd=NaN,this.VM=-1,this.OD=new I,this.xy=null,this.ky=NaN,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.b=this.b&-4097|16384|32768,t.Qo=this.Qo,this.H!==null&&(this.H.me?t.H=this.H:t.H=this.H.copy()),t.ul=this.ul,t._o=null,t.ue=this.ue,t.sn.h(this.sn),t.jd=this.jd}Ho(t){super.Ho(t),t.Sa(),t.dl=null,t.tr=null,t.xy=null}toString(){let t=m.Kn(this.constructor)+"#"+V.xs(this);return this.data!==null&&(t+="("+m.toString(this.data)+")"),t}static LayoutNone=0;static LayoutAdded=1;static LayoutRemoved=2;static LayoutShown=4;static LayoutHidden=8;static LayoutNodeSized=16;static LayoutGroupLayout=32;static LayoutNodeReplaced=64;static LayoutStandard=127;static LayoutAll=16777215;_e(){return this.H===null?this.H=new Gi:this.H.me&&(this.H=this.H.copy()),this.H}ba(){super.ba(),this.H!==null&&(this.H.me=!0)}df(t,e,i,s,n,o,r){let a=this.diagram;a!==null&&(t===3&&e==="elements"?n instanceof G?n.Pn(h=>{a.partManager.C2(h,a)}):n instanceof Bt&&a.R2(n):t===4&&e==="elements"&&(n instanceof G?n.Pn(h=>a.partManager.L2(h,a)):n instanceof Bt&&a.O2(n)),a.raiseChangedEvent(t,e,i,s,n,o,r))}updateTargetBindings(t){if(super.updateTargetBindings(t),this.data===null)return;let e=this.D.r,i=e.length;for(let n=0;n<i;n++){let o=e[n];o instanceof G&&o.Pn(r=>{r.data!==null&&r.JI(t)})}let s=this.adornments;for(;s.next();)s.value.updateTargetBindings(t)}Go(){if(super.Go(),this.ON()){let e=this.D.r,i=e.length;for(let s=0;s<i;s++){let n=e[s];n instanceof G&&n.Pn(o=>o.Go())}}let t=this.adornments;for(;t.next();)t.value.Go()}updateRelationshipsFromData(){this.data!==null&&this.diagram?.partManager.updateRelationshipsFromData(this)}get key(){let t=this.diagram;if(t!==null)return t.model.getKeyForNodeData(this.data)}get adornments(){return this._o===null?Pt.instance:this._o.iteratorValues}findAdornment(t){let e=this._o;return e===null?null:e.get(t)}addAdornment(t,e){if(e===null)return;let i=null,s=this._o;if(s!==null&&(i=s.get(t)),i!==e){if(i!==null){let o=i.diagram;o!==null&&o.remove(i)}s===null&&(s=new Mt,this._o=s),e.Qo!==t&&(e.category=t),s.set(t,e);let n=this.diagram;if(n!==null){n.add(e);let o=e.adornedObject;if(o!==null){let r=o.findBindingPanel();r!==null&&(e.data=r.data)}}}}removeAdornment(t){let e=this._o;if(e===null)return;let i=e.get(t);if(i!==null){let s=i.diagram;s!==null&&(s.remove(i),i.data=null)}e.delete(t),e.count===0&&(this._o=null)}clearAdornments(){let t=this._o;if(t===null)return;let e=m.nt(),i=t.iterator;for(;i.next();){let n=i.key;e.push(n)}let s=e.length;for(let n=0;n<s;n++)this.removeAdornment(e[n]);m.Z(e)}updateAdornments(){let t=this.diagram;if(t===null)return;this.pE(t),this.yE(t);let e=this.adornments;for(;e.next();){let i=e.value;i.f(),i.hasPlaceholder()&&i.placeholder.f()}for(e=this.adornments;e.next();)e.value.updateTargetBindings()}invalidateAdornments(){let t=this.diagram;t!==null&&(t.ha(),this.ID()!==!0&&this.ED(!0))}BM(){this.ID()!==!1&&(this.updateAdornments(),this.ED(!1))}pE(t){let e="Selection";if(this.isSelected&&this.selectionAdorned){let i=this.selectionObject;if(i!==null&&this.actualBounds.isReal()&&this.isVisible()&&i.isVisibleObject()&&i.actualBounds.isReal()){let s=this.findAdornment(e);if(s===null){let n=this.selectionAdornmentTemplate;n===null&&(this.Lr()?n=t.linkSelectionAdornmentTemplate:this instanceof ht?n=t.groupSelectionAdornmentTemplate:n=t.nodeSelectionAdornmentTemplate),s=n.copy(),s!==null&&(this.Lr()&&this.selectionObject===this.path&&(s.type=G.Link),s.adornedObject=i)}if(s!==null){s.type===G.Link&&s.f(),this.addAdornment(e,s);return}}}this.removeAdornment(e)}yE(t){let e=this;t.toolManager.mouseDownTools.each(i=>{i.isEnabled&&i.updateAdornments(e)}),t.toolManager.updateAdornments(e)}EM(t){this.gl=t,t===null&&this.dI()}get layer(){return this.gl}get diagram(){let t=this.gl;return t==null?null:t.diagram}get layerName(){return this.ul}set layerName(t){let e=this.ul;if(e===t)return;let i=this.diagram;if(i!==null&&(i.findLayer(t)===null||i.partManager.addsToTemporaryLayer))return;this.ul=t,i!==null&&i.invalidateDocumentBounds(),this.t("layerName",e,t);let s=this.layer;if(s===null||s.name===t||(i=s.diagram,i===null))return;let n=i.findLayer(t);if(n===null||n===s)return;let o=s.ri(-1,this,!0);o>=0&&i.raiseChangedEvent(4,"parts",s,this,null,o,!0),o=n.ch(99999999,this,!0),s.visible!==n.visible&&this.Xe(n.visible),o>=0&&i.raiseChangedEvent(3,"parts",n,null,this,!0,o);let r=this.layerChanged;if(r===null)return;let a=i.G;i.G=!0,r(this,s,n),i.G=a}get layerChanged(){return this.H!==null?this.H.Py:null}set layerChanged(t){let e=this.layerChanged;e!==t&&(t!==null&&m.S(t,pt,"layerChanged"),this._e().Py=t,this.t("layerChanged",e,t))}get zOrder(){return this.jd}set zOrder(t){let e=this.jd;if(e===t)return;this.jd=t;let i=this.layer;i!==null&&i.rb(-1,this),this.t("zOrder",e,t);let s=this.diagram;s!==null&&s.C()}wE(){let t=this.layer;t!==null&&t.rb(-1,this)}hk(){if(this.fa()!==!1)return;this.cC(!0),this.pf();let t=this.diagram;t!==null&&(t.Cp(this),t.requestUpdate())}UD(){if(this.b|=2097152,this.fa()===!1)return;let t=this.position,e=this.location;(!e.isReal()||!t.isReal())&&this.VD(t,e);let i=this.De,s=I.l().h(i);i.ce(),i.x=t.x,i.y=t.y,i.k(),this.kd(s,i),I.i(s),this.cC(!1),this.pf()}ro(t,e,i,s){let n=this.hi;n.e(t,e,i,s),this.Se===null&&(this.Se=new Nt);let o=this.Se;o.Ue(),this.Kp(o,t,e,i,s),this.Se=o,o.RP()||o.sm(n)}Kp(t,e,i,s,n){if(this.it!==1&&t.it(this.it),this.Xt===0)return;let o=T.Center;this.locationSpot.isSpot()&&(o=this.locationSpot);let r=P.l();if(this.locationObject!==this){let a=this.locationObject,h=a.naturalBounds;r.setSpot(h.x,h.y,h.width,h.height,o),a.Se!==null&&a.Se.gt(r),r.offset(-a.measuredBounds.x,-a.measuredBounds.y);let l=a.panel;for(;l!==null&&l!==this;)l.Se!==null&&l.Se.gt(r),r.offset(-l.measuredBounds.x,-l.measuredBounds.y),l=l.panel}else r.setSpot(e,i,s,n,o);t.ks(this.Xt,r.x,r.y),P.i(r)}get locationObject(){if(this.tr===null)if(this instanceof vt&&this.type!==G.Link&&this.hasPlaceholder())this.tr=this.placeholder;else{let t=this.locationObjectName;if(t!==""){let e=this.findObject(t);e!==null?this.tr=e:this.tr=this}else this.tr=this}return this.tr?.visible?this.tr:this}get minLocation(){return this.H!==null?this.H.Sy:P.FL}set minLocation(t){let e=this.minLocation;e.equals(t)||(t=t.N(),this._e().Sy=t,this.t("minLocation",e,t))}get maxLocation(){return this.H!==null?this.H.My:P.RL}set maxLocation(t){let e=this.maxLocation;e.equals(t)||(t=t.N(),this._e().My=t,this.t("maxLocation",e,t))}get locationObjectName(){return this.H!==null?this.H.Ny:""}set locationObjectName(t){let e=this.locationObjectName;e!==t&&(this._e().Ny=t,this.tr=null,this.f(),this.t("locationObjectName",e,t))}get locationSpot(){return this.H!==null?this.H.Cy:T.TopLeft}set locationSpot(t){let e=this.locationSpot;e.equals(t)||(t=t.N(),this._e().Cy=t,this.f(),this.t("locationSpot",e,t))}move(t,e){e===!0?this.location=t:this.position=t}moveTo(t,e,i){let s=P.z(t,e);this.move(s,i),P.i(s)}isVisible(){if(!this.visible)return!1;let t=this.layer;if(t!==null){if(!t.visible)return!1;let i=t.diagram;if(i!==null&&i.animationManager.Wx(this))return!0}let e=this.containingGroup;return!(e!==null&&(!e.isSubGraphExpanded||!e.isVisible()))}Xe(t){let e=this.diagram;t?(this.invalidateLayout(4),this.invalidateAdornments(),e!==null&&e.Cp(this)):(this.invalidateLayout(8),this.clearAdornments()),this.Sa(),e!==null&&(e.invalidateDocumentBounds(),this instanceof J&&this.canAvoid()&&e.fd(this),e.C())}findObject(t){if(this.name===t)return this;let e=this.xy;if(e===null&&(this.xy=e=new Mt),e.get(t)!==null)return e.get(t);let i=super.findObject(t);return i!==null?(e.set(t,i),i):(e.set(t,null),null)}s0(){this.xy=null}getRelativePoint(t,e,i){i===void 0&&(i=new P);let s=e.isNoSpot()?T.Center:e,n=t.naturalBounds;if(i.e(n.width*s.x+s.offsetX,n.height*s.y+s.offsetY),t===null||t===this)return i;t.v.gt(i);let o=t.panel;for(;o!==null&&o!==this;)o.v.gt(i),o=o.panel;return this.Se!==null&&this.Se.gt(i),i.offset(-this.hi.x,-this.hi.y),i}getDocumentBounds(t){return t===void 0&&(t=new I),t.h(this.actualBounds)}ensureBounds(){this.ht(1/0,1/0),this.Ut()}uD(t){let e=this.locationSpot,i=this.locationObject,s=i.naturalBounds;s.isReal()||(s=I.em);let n=i instanceof et?i.strokeWidth:0;if(t.setSpot(0,0,s.width+n,s.height+n,e),i!==this){t.offset(-n/2,-n/2),i.v.gt(t);let o=i.panel;for(;o!==null&&o!==this;)o.v.gt(t),o=o.panel}return this.Se!==null&&this.Se.gt(t),t.offset(-this.hi.x,-this.hi.y),t}hh(t,e){let i=e===void 0?this.OD:e,s=this.xE(),n=s*2;if(!this.isShadowed)return i.e(t.x-1-s,t.y-1-s,t.width+2+n,t.height+2+n),i;let o=t.x,r=t.y,a=t.width,h=t.height,l=this.shadowBlur,u=this.shadowOffset;return a+=l,h+=l,o-=l/2,r-=l/2,u.x>0?a+=u.x:(o+=u.x,a-=u.x),u.y>0?h+=u.y:(r+=u.y,h-=u.y),i.e(o-1,r-1,a+2,h+2),i}eE(){return this.type===G.Link&&this instanceof vt&&this.category==="Selection"&&this.adornedObject instanceof et&&this.adornedPart.findMainElement()===this.adornedObject?this.adornedObject.strokeWidth:0}xE(){return isNaN(this.ky)&&(this.ky=this.xD()),this.ky}Tf(){this.ky=NaN}Ut(){if(this.as()===!1){this.UD();return}this.lo(!1);let t=this.De,e=I.l();e.h(t);let i=this.Ul();this.Pa(0,0,this.hi.width,this.hi.height);let s=this.position;this.VD(s,this.location),t.ce(),t.x=s.x,t.y=s.y,t.k(),this.kd(e,t),e.equals(t)?this.rs(i):this.Di()&&(!C.c(e.width,t.width)||!C.c(e.height,t.height))&&this.VM>=0&&this.invalidateLayout(16),I.i(e),this.cC(!1)}kd(t,e){let i=this.diagram;if(i===null)return;let s=!1;if(i.mh===!1&&t.isReal()){let n=I.l();n.h(i.documentBounds),n.subtractMargin(i.padding),t.x>n.x&&t.y>n.y&&t.right<n.right&&t.bottom<n.bottom&&e.x>n.x&&e.y>n.y&&e.right<n.right&&e.bottom<n.bottom&&(s=!0),I.i(n)}(this.bE()===!0||!t.equals(e))&&this.mT(s,i),i.C(),!(!t.isReal()&&!e.isReal()||t.equalsApproxClose(e))&&(this instanceof J&&!i.undoManager.isUndoingRedoing&&this.invalidateConnectedLinks(),this.Sa())}get location(){return this.sn}set location(t){let e=t.x,i=t.y,s=this.sn;(s.x!==e&&(!isNaN(s.x)||!isNaN(e))||s.y!==i&&(!isNaN(s.y)||!isNaN(i)))&&(t=t.copy(),this.kE(t,s)&&this.t("location",s,t.copy()))}kE(t,e){if(this.Lr())return!1;if(this.sn=t,this.b|=2097152,this.as()===!1){this.hk();let i=this.ct;if(i.isReal()){let s=this.diagram;if(s===null||s.animationManager.isTicking||!s.undoManager.isUndoingRedoing){let n=i.copy();i.e(i.x+(t.x-e.x),i.y+(t.y-e.y)),this.BD(s,i,n.x,n.y),this.t("position",n,i.copy())}}}return!0}vN(t,e,i){if(this.Lr()||!t.isReal())return!1;let s=this.diagram;if(s!==null&&this.BD(s,t,e,i),this.ct=t,this.b&=-2097153,this.sn.isReal()&&(s===null||s.animationManager.isTicking||!s.undoManager.isUndoingRedoing)){let n=this.sn;this.sn=new P(n.x+(t.x-e),n.y+(t.y-i)).k(),this.t("location",n,this.sn.copy())}return this.fa()===!1&&this.as()===!1&&(this.hk(),this.UD()),!0}BD(t,e,i,s){if(t===null||this instanceof vt)return;let n=t.animationManager;n.ke&&n.RA(this,new P(i,s),e,!1)}Ec(t,e,i){let s=this.sn,n=this.ct;if(i){if(s.x===t&&s.y===e)return;this.fa()||this.as()?n.e(NaN,NaN):n.e(n.x+t-s.x,n.y+e-s.y),s.e(t,e)}else{if(n.x===t&&n.y===e)return;s.e(s.x+t-n.x,s.y+e-n.y),n.e(t,e)}this.hk()}FN(){this.b&=-2097153,this.hk()}VD(t,e){let i=this.uD(P.l()),s=this.diagram,n=e.isReal(),o=t.isReal();n&&o?(this.b&2097152)!==0?this.zD(t,e,s,i):this.XD(t,e,s,i):n?this.zD(t,e,s,i):o&&this.XD(t,e,s,i),this.b|=2097152,P.i(i),this.pf()}zD(t,e,i,s){let n=t.x,o=t.y;if(t.e(e.x-s.x,e.y-s.y),i!==null){let r=i.animationManager,a=r.defaultAnimation.isAnimating;!a&&r.ke&&!(this instanceof vt)&&r.RA(this,new P(n,o),t,!1),!a&&!(t.x===n&&t.y===o)&&this.t("position",new P(n,o),t.copy())}}XD(t,e,i,s){let n=e.copy();e.e(t.x+s.x,t.y+s.y),!e.equals(n)&&i!==null&&this.t("location",n,e.copy())}mT(t,e){this.CN(!1),this instanceof J&&e.fd(this),!this.layer.isTemporary&&!t&&e.invalidateDocumentBounds();let i=this.De,s=e.viewportBounds;s.isReal()?this.Ul()?(i.BL(s,10)||this.rs(!1),this.updateAdornments()):this.isVisible()&&i.intersectsRect(s)?(this.rs(!0),this.updateAdornments()):this.invalidateAdornments():e._c=!0}Qr(){return!0}Di(){return!0}Lr(){return!1}Qs(){return!0}hasPlaceholder(){return!1}get category(){return this.Qo}set category(t){let e=this.Qo;if(e===t)return;this.svg!==null&&(this.svg.remove(),this.Ji(!0));let i=this.diagram,s=this.data,n=null;if(i!==null&&s!==null&&!(this instanceof vt)){let o=i.model.undoManager;o.isEnabled&&!o.isUndoingRedoing&&(n=this.clone(),n.D.addAll(this.D))}if(this.Qo=t,this.t("category",e,t),i!==null&&s!==null&&!(this instanceof vt)){let o=i.model;if(o.undoManager.isUndoingRedoing)return;if(this.Lr()){i.partManager.setLinkCategoryForData(s,t);let r=i.partManager.findLinkTemplateForCategory(t);if(r!==null){r.It();let a=r.copy();a!==null&&this.fC(a,e,t)}}else{o!==null&&o.setCategoryForNodeData(s,t);let r=i.partManager.findTemplateForNodeData(s,t);if(r!==null){r.It();let a=r.copy();if(a!==null&&!(a instanceof j)){let h=this.location.copy();this.fC(a,e,t),this.location.isReal()||(this.location=h)}}}if(n!==null){let r=this.clone();r.D.addAll(this.D),this.t("self",n,r)}}else if(this instanceof vt){let o=this.adornedPart;if(o!==null){let r=o._o;r!==null&&r.delete(e),o.addAdornment(this.category,this)}}}get self(){return this}set self(t){this.fC(t,this.category,t.category)}static GD=!1;fC(t,e,i){t.constructor!==this.constructor&&(pt.GD||(pt.GD=!0,m.ne('Should not change the class of the Part when changing category from "'+e+'" to "'+i+'"'),m.ne(" Old class: "+m.Kn(this.constructor)+", new class: "+m.Kn(t.constructor)+", part: "+this.toString()))),this.clearAdornments();let s=this.data,n=this.layerName,o=this.isSelected,r=this.isHighlighted,a=!0,h=!0,l=!1;this instanceof J&&(a=this.isTreeLeaf,h=this.isTreeExpanded,l=this.wasTreeExpanded),t.Ho(this),t.cloneProtected(this),this.Qo=i,this.svg!==null&&(this.svg.remove(),this.jc(),this.Ji(!0)),this.f(),this.C();let u=this.diagram,c=!0;u!==null&&(c=u.skipsUndoManager,u.skipsUndoManager=!0),this.te=s,this.b=o?this.b|4096:this.b&-4097,this.b=r?this.b|524288:this.b&-524289,this instanceof J&&(this.E=a?this.E|4:this.E&-5,this.E=h?this.E|1:this.E&-2,this.E=l?this.E|2:this.E&-3),s!==null&&this.updateTargetBindings();let d=this.layerName;d!==n&&(this.ul=n,this.layerName=d),u!==null&&(u.skipsUndoManager=c),this.Di()&&this.invalidateLayout(64)}canCopy(){if(!this.copyable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowCopy)return!1;let e=t.diagram;return e===null?!0:!!e.allowCopy}canDelete(){if(!this.deletable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowDelete)return!1;let e=t.diagram;return e===null?!0:!!e.allowDelete}canEdit(){if(!this.textEditable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowTextEdit)return!1;let e=t.diagram;return e===null?!0:!!e.allowTextEdit}canGroup(){if(!this.groupable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowGroup)return!1;let e=t.diagram;return e===null?!0:!!e.allowGroup}canMove(){if(!this.movable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowMove)return!1;let e=t.diagram;return e===null?!0:!!e.allowMove}canReshape(){if(!this.reshapable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowReshape)return!1;let e=t.diagram;return e===null?!0:!!e.allowReshape}canResize(){if(!this.resizable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowResize)return!1;let e=t.diagram;return e===null?!0:!!e.allowResize}canRotate(){if(!this.rotatable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowRotate)return!1;let e=t.diagram;return e===null?!0:!!e.allowRotate}canSelect(){if(!this.selectable)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowSelect)return!1;let e=t.diagram;return e===null?!0:!!e.allowSelect}get copyable(){return(this.b&1)!==0}set copyable(t){let e=(this.b&1)!==0;e!==t&&(this.b=this.b^1,this.t("copyable",e,t))}get deletable(){return(this.b&2)!==0}set deletable(t){let e=(this.b&2)!==0;e!==t&&(this.b=this.b^2,this.t("deletable",e,t))}get textEditable(){return(this.b&4)!==0}set textEditable(t){let e=(this.b&4)!==0;e!==t&&(this.b=this.b^4,this.t("textEditable",e,t),this.invalidateAdornments())}get groupable(){return(this.b&8)!==0}set groupable(t){let e=(this.b&8)!==0;e!==t&&(this.b=this.b^8,this.t("groupable",e,t))}get movable(){return(this.b&16)!==0}set movable(t){let e=(this.b&16)!==0;e!==t&&(this.b=this.b^16,this.t("movable",e,t))}get selectionAdorned(){return(this.b&32)!==0}set selectionAdorned(t){let e=(this.b&32)!==0;e!==t&&(this.b=this.b^32,this.t("selectionAdorned",e,t),this.invalidateAdornments())}get isInDocumentBounds(){return(this.b&64)!==0}set isInDocumentBounds(t){let e=(this.b&64)!==0;if(e!==t){this.b=this.b^64;let i=this.diagram;i!==null&&i.invalidateDocumentBounds(),this.t("isInDocumentBounds",e,t)}}get isLayoutPositioned(){return(this.b&128)!==0}set isLayoutPositioned(t){let e=(this.b&128)!==0;e!==t&&(this.b=this.b^128,this.t("isLayoutPositioned",e,t),this.invalidateLayout(t?4:8))}get selectable(){return(this.b&256)!==0}set selectable(t){let e=(this.b&256)!==0;e!==t&&(this.b=this.b^256,this.t("selectable",e,t),this.invalidateAdornments())}get reshapable(){return(this.b&512)!==0}set reshapable(t){let e=(this.b&512)!==0;e!==t&&(this.b=this.b^512,this.t("reshapable",e,t),this.invalidateAdornments())}get resizable(){return(this.b&1024)!==0}set resizable(t){let e=(this.b&1024)!==0;e!==t&&(this.b=this.b^1024,this.t("resizable",e,t),this.invalidateAdornments())}get rotatable(){return(this.b&2048)!==0}set rotatable(t){let e=(this.b&2048)!==0;e!==t&&(this.b=this.b^2048,this.t("rotatable",e,t),this.invalidateAdornments())}get isSelected(){return(this.b&4096)!==0}set isSelected(t){let e=(this.b&4096)!==0;if(e!==t){let i=this.diagram;if(t){if(!this.canSelect())return;if(i!==null){let o=i.maxSelectionCount;if(i.selection.count>=o)return}}this.b=this.b^4096;let s=!1;if(i!==null){s=i.skipsUndoManager,i.skipsUndoManager=!0;let o=i.selection;o.ce(),t?o.add(this):o.delete(this),o.k()}this.t("isSelected",e,t),this.invalidateAdornments();let n=this.selectionChanged;n!==null&&n(this),i!==null&&(i.requestUpdate(),i.skipsUndoManager=s)}}get isHighlighted(){return(this.b&524288)!==0}set isHighlighted(t){let e=(this.b&524288)!==0;if(e!==t){this.b=this.b^524288;let i=this.diagram;if(i!==null){let n=i.highlighteds;n.ce(),t?n.add(this):n.delete(this),n.k()}this.t("isHighlighted",e,t),this.C();let s=this.highlightedChanged;s!==null&&s(this)}}get isShadowed(){return(this.b&8192)!==0}set isShadowed(t){let e=(this.b&8192)!==0;e!==t&&(this.b=this.b^8192,this.Ji(!0),this.t("isShadowed",e,t),this.C())}ID(){return(this.b&16384)!==0}ED(t){t?this.b|=16384:this.b&=-16385}fa(){return(this.b&32768)!==0}cC(t){t?this.b|=32768:this.b&=-32769}bE(){return(this.b&65536)!==0}CN(t){t?this.b|=65536:this.b&=-65537}Ul(){return(this.b&131072)!==0}rs(t){t?this.b|=131072:this.b&=-131073}YD(){return(this.b&1048576)!==0}ck(t){t?this.b|=1048576:this.b&=-1048577}get isAnimated(){return(this.b&262144)!==0}set isAnimated(t){let e=(this.b&262144)!==0;e!==t&&(this.b=this.b^262144,this.t("isAnimated",e,t))}get highlightedChanged(){return this.H!==null?this.H.Ly:null}set highlightedChanged(t){let e=this.highlightedChanged;e!==t&&(t!==null&&m.S(t,pt,"highlightedChanged"),this._e().Ly=t,this.t("highlightedChanged",e,t))}get selectionObjectName(){return this.H!==null?this.H.Ay:""}set selectionObjectName(t){let e=this.selectionObjectName;e!==t&&(this._e().Ay=t,this.dl=null,this.t("selectionObjectName",e,t))}get selectionAdornmentTemplate(){return this.H!==null?this.H.Ty:null}set selectionAdornmentTemplate(t){let e=this.selectionAdornmentTemplate;e!==t&&(t!==null&&t.It(),this._e().Ty=t,this.t("selectionAdornmentTemplate",e,t))}get selectionObject(){if(this.dl===null){let t=this.selectionObjectName;if(t!==null&&t!==""){let e=this.findObject(t);e!==null?this.dl=e:this.dl=this}else if(this instanceof j){let e=this.path;e!==null?this.dl=e:this.dl=this}else this.dl=this}return this.dl}get selectionChanged(){return this.H!==null?this.H.Dy:null}set selectionChanged(t){let e=this.selectionChanged;e!==t&&(t!==null&&m.S(t,pt,"selectionChanged"),this._e().Dy=t,this.t("selectionChanged",e,t))}get resizeAdornmentTemplate(){return this.H!==null?this.H.vy:null}set resizeAdornmentTemplate(t){let e=this.resizeAdornmentTemplate;e!==t&&(this._e().vy=t!==null?t.It():null,this.t("resizeAdornmentTemplate",e,t))}get resizeObjectName(){return this.H!==null?this.H.Fy:""}set resizeObjectName(t){let e=this.resizeObjectName;e!==t&&(this._e().Fy=t,this.t("resizeObjectName",e,t))}get resizeObject(){let t=this.resizeObjectName;if(t!==""){let e=this.findObject(t);if(e!==null)return e}return this}get resizeCellSize(){return this.H!==null?this.H.Ry:st.Zw}set resizeCellSize(t){let e=this.resizeCellSize;e.equals(t)||(t=t.N(),this._e().Ry=t,this.t("resizeCellSize",e,t))}get rotateAdornmentTemplate(){return this.H!==null?this.H.Oy:null}set rotateAdornmentTemplate(t){let e=this.rotateAdornmentTemplate;e!==t&&(this._e().Oy=t!==null?t.It():null,this.t("rotateAdornmentTemplate",e,t))}get rotateObjectName(){return this.H!==null?this.H.Iy:""}set rotateObjectName(t){let e=this.rotateObjectName;e!==t&&(this._e().Iy=t,this.t("rotateObjectName",e,t))}get rotateObject(){let t=this.rotateObjectName;if(t!==""){let e=this.findObject(t);if(e!==null)return e}return this}get rotationSpot(){return this.H!==null?this.H.Ey:T.Default}set rotationSpot(t){let e=this.rotationSpot;e.equals(t)||(t=t.N(),this._e().Ey=t,this.t("rotationSpot",e,t))}get text(){return this.ue}set text(t){let e=this.ue;e!==t&&(this.ue=t,this.t("text",e,t))}get containingGroup(){return this.Da}set containingGroup(t){if(this.Di()){let e=this.Da;if(e!==t){t!==null&&(this===t||t.isMemberOf(this))&&(this===t&&m.o("Cannot make a Group a member of itself: "+this.toString()),m.o("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+t.toString())),this.invalidateLayout(2);let i=this.diagram;if(e!==null?e.uC(this):this instanceof ht&&i!==null&&i.$r.delete(this),this.Da=t,t!==null?t.dC(this):this instanceof ht&&i!==null&&i.$r.add(this),this.invalidateLayout(1),i!==null&&i.G){let n=this.data,o=i.model;if(n!==null&&o.ff()){let r=t!==null?t.data:null;o.setGroupForData(n,o.getKeyForNodeData(r))}}let s=this.containingGroupChanged;if(s!==null){let n=!0;i!==null&&(n=i.G,i.G=!0),s(this,e,t),i!==null&&(i.G=n)}if(this instanceof ht){let n=new V;pt.ga(n,this,!0,0,!0);let o=n.iterator;for(;o.next();){let r=o.value;if(r instanceof J){let a=r.linksConnected;for(;a.next();)a.value.Wd()}}}if(this instanceof J){let n=this.linksConnected;for(;n.next();)n.value.Wd();let o=this.labeledLink;o!==null&&o.Wd()}this.t("containingGroup",e,t),t!==null&&t.wE()}}else m.o("cannot set the Part.containingGroup of a Link or Adornment")}Sa(){let t=this.containingGroup;t!==null&&(t.hasPlaceholder()&&t.placeholder.f(),t.f(),t.invalidateConnectedLinks())}C(){let t=this.diagram;t!==null&&!this.as()&&!this.fa()&&this.isVisible()&&this.De.isReal()&&t.C(this.hh(this.De))}f(){if(this.Xo())return;super.f();let t=this.diagram;t!==null&&(t.Cp(this),this instanceof J&&this.labeledLink!==null&&this.labeledLink.kf(),t.requestUpdate(!0))}kf(t){if(this.as())return;let e=this.diagram;e!==null&&(e.Cp(this),this instanceof J&&this.invalidateConnectedLinks(),e.requestUpdate()),this.lo(!0)}tp(t){if(!t){let e=this.Da;e!==null&&e.dC(this)}}ep(t){if(!t){let e=this.Da;e!==null&&e.uC(this)}}rf(){let t=this.data;if(t!==null){let e=this.diagram;if(e!==null){let i=e.model;i!==null&&i.removeNodeData(t)}}}get containingGroupChanged(){return this.H!==null?this.H.Uy:null}set containingGroupChanged(t){let e=this.containingGroupChanged;e!==t&&(t!==null&&m.S(t,pt,"containingGroupChanged"),this._e().Uy=t,this.t("containingGroupChanged",e,t))}findSubGraphLevel(){return this.gC(this)}gC(t){let e=t.containingGroup;if(e!==null)return 1+this.gC(e);if(t instanceof J){let i=t.labeledLink;if(i!==null)return this.gC(i)}return 0}findTopLevelPart(){return this.mC(this)}mC(t){let e=t.containingGroup;if(e!==null)return this.mC(e);if(t instanceof J){let i=t.labeledLink;if(i!==null)return this.mC(i)}return t}get isTopLevel(){return!(this.containingGroup!==null||this instanceof J&&this.labeledLink!==null)}isMemberOf(t){return t instanceof ht?this.pC(this,t):!1}pC(t,e){if(t===e||e===null)return!1;let i=t.containingGroup;if(i!==null&&(i===e||this.pC(i,e)))return!0;if(t instanceof J){let s=t.labeledLink;if(s!==null)return this.pC(s,e)}return!1}findCommonContainingGroup(t){if(t===null)return null;if(this===t)return this.containingGroup;let e=this;for(;e!==null;){if(e instanceof ht&&e.ck(!0),e instanceof J){let s=e.labeledLink;s!==null&&(e=s)}e=e.containingGroup}let i=null;for(e=t;e!==null;){if(e.YD()){i=e;break}if(e instanceof J){let s=e.labeledLink;s!==null&&(e=s)}e=e.containingGroup}for(e=this;e!==null;){if(e instanceof ht&&e.ck(!1),e instanceof J){let s=e.labeledLink;s!==null&&(e=s)}e=e.containingGroup}return i}get layoutConditions(){return this.H!==null?this.H.Vy:127}set layoutConditions(t){let e=this.layoutConditions;e!==t&&(this._e().Vy=t,this.t("layoutConditions",e,t))}canLayout(){if(!this.isLayoutPositioned||!this.isVisible())return!1;let t=this.layer;return!(t!==null&&t.isTemporary||this instanceof J&&this.isLinkLabel)}PE(t){if(!this.isLayoutPositioned||(t&this.layoutConditions)===0)return!1;let e=this.layer;if(e!==null&&e.isTemporary||this instanceof J&&this.isLinkLabel)return!1;let i=this.diagram;return!(i!==null&&i.undoManager.isUndoingRedoing)}invalidateLayout(t){if(t===void 0&&(t=16777215),!this.PE(t))return;let e=this.Da;if(e!==null){let i=e.layout;i!==null?i.p():e.invalidateLayout(t)}else{let i=this.diagram;if(i!==null){let s=i.layout;s!==null&&s.p()}}}pT(){if(!this.isVisible())return!1;let t=this.layer;return!(t!==null&&t.isTemporary)}static ga(t,e,i,s,n,o){if(o===void 0&&(o=null),!t.has(e)&&!(o!==null&&!o(e))&&!(e instanceof vt)){if(t.add(e),e instanceof J){if(i&&e instanceof ht){let r=e.memberParts;for(;r.next();){let a=r.value;pt.ga(t,a,i,s,n,o)}}if(n!==!1){let r=e.linksConnected;for(;r.next();){let a=r.value;if(t.has(a))continue;let h=a.fromNode,l=a.toNode,u=h===null||t.has(h),c=l===null||t.has(l);(n?u&&c:u||c)&&pt.ga(t,a,i,s,n,o)}}if(s>1){let r=e.findTreeChildrenNodes();for(;r.next();){let a=r.value;pt.ga(t,a,i,s-1,n,o)}}}else if(e instanceof j){let r=e.labelNodes;for(;r.next();){let a=r.value;pt.ga(t,a,i,s,n,o)}}}}get dragComputation(){return this.H!==null?this.H.By:null}set dragComputation(t){let e=this.dragComputation;e!==t&&(t!==null&&m.S(t,pt,"dragComputation"),this._e().By=t,this.t("dragComputation",e,t))}get shadowOffset(){return this.H!==null?this.H.zy:P.OL}set shadowOffset(t){let e=this.shadowOffset;e.equals(t)||(t=t.N(),this._e().zy=t,this.C(),this.t("shadowOffset",e,t))}get shadowColor(){return this.H!==null?this.H.Xy:"gray"}set shadowColor(t){let e=this.shadowColor;e!==t&&(this._e().Xy=t,this.C(),this.t("shadowColor",e,t))}get shadowBlur(){return this.H!==null?this.H.Ln:4}set shadowBlur(t){let e=this.shadowBlur;e!==t&&(this._e().Ln=t,this.C(),this.t("shadowBlur",e,t))}}class Gi{me;Py;Uy;Ty;Ay;Dy;Ly;vy;Fy;Ry;Oy;Iy;Ey;Ny;Cy;Sy;My;By;Vy;zy;Xy;Ln;constructor(){this.me=!1,this.Py=null,this.Uy=null,this.Ty=null,this.Ay="",this.Dy=null,this.Ly=null,this.vy=null,this.Fy="",this.Ry=st.Zw,this.Oy=null,this.Iy="",this.Ey=T.Default,this.Ny="",this.Cy=T.TopLeft,this.Sy=P.FL,this.My=P.RL,this.By=null,this.Vy=127,this.zy=P.OL,this.Xy="gray",this.Ln=4}copy(){let t=new Gi;return t.Py=this.Py,t.Uy=this.Uy,t.Ty=this.Ty,t.Ay=this.Ay,t.Dy=this.Dy,t.Ly=this.Ly,t.vy=this.vy,t.Fy=this.Fy,t.Ry=this.Ry.N(),t.Oy=this.Oy,t.Iy=this.Iy,t.Ey=this.Ey.N(),t.Ny=this.Ny,t.Cy=this.Cy.N(),t.Sy=this.Sy.N(),t.My=this.My.N(),t.By=this.By,t.Vy=this.Vy,t.zy=this.zy.N(),t.Xy=this.Xy,t.Ln=this.Ln,t}}class vt extends pt{Ms;Dt;WS;JS;Lf;constructor(t,e){let i;t===void 0||t instanceof Lt||typeof t=="string"?i=t:t&&(e=t),super(i),this.b&=-257,this.ul="Adornment",this.Ms=null,this.WS=0,this.JS=!1,this.Dt=null,this.Lf=null,e&&Object.assign(this,e)}toString(){let t=this.adornedPart;return"Adornment("+this.category+")"+(t!==null?t.toString():"")}updateRelationshipsFromData(){}Td(t){let e=this.adornedObject;if(!(e instanceof et))return;let i=e.part;if(!(i instanceof j))return;let s=i.path,n=s.geometry;i.Td(t),n=s.geometry;let o=this.D.r,r=o.length;for(let a=0;a<r;a++){let h=o[a];h.isPanelMain&&h instanceof et&&(h.ut=n)}}hasPlaceholder(){return this.Dt!==null&&this.Dt.isVisibleObject()}get placeholder(){return this.Dt}get adornedObject(){return this.Ms}set adornedObject(t){let e=this.adornedPart,i=null;t!==null&&(i=t.part),e!==null&&(t===null||e!==i)&&e.removeAdornment(this.category),this.Ms=t,i!==null&&i.addAdornment(this.category,this)}get adornedPart(){let t=this.Ms;return t!==null?t.part:null}Qr(){let t=this.Ms;if(t===null)return!0;let e=t.part;return e===null||!e.as()}Di(){return!1}get containingGroup(){return null}df(t,e,i,s,n,o,r){if(t===3&&e==="elements"){if(n instanceof le)this.Dt===null&&(this.Dt=n);else if(n instanceof G){let a=n.findInVisualTree(h=>h instanceof le);a instanceof le&&this.Dt===null&&(this.Dt=a)}}else t===4&&e==="elements"&&this.Dt!==null&&(s===this.Dt?this.Dt=null:s instanceof G&&this.Dt.isContainedBy(s)&&(this.Dt=null));super.df(t,e,i,s,n,o,r)}updateAdornments(){}rf(){}}var qs=(x=>(x[x.None=0]="None",x[x.Evenly=1]="Evenly",x[x.Packed=2]="Packed",x))(qs||{});class J extends pt{E;vt;zf;pl;va;ci;ee;constructor(t,e){let i;t===void 0||t instanceof Lt||typeof t=="string"?i=t:t&&(e=t),super(i),this.E=13,this.vt=null,this.ee=new q,this.zf=null,this.pl=null,this.ci=null,this.va=!1,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.E=this.E,this.vt!==null&&(this.vt.me?t.vt=this.vt:t.vt=this.vt.copy())}Ho(t){super.Ho(t),t.invalidateConnectedLinks(),t.pl=this.pl,t.ci=null}static SpreadingNone=0;static SpreadingEvenly=1;static SpreadingPacked=2;yl(){return this.vt===null?this.vt=new qi:this.vt.me&&(this.vt=this.vt.copy()),this.vt}ba(){super.ba(),this.vt!==null&&(this.vt.me=!0)}KD(t){t!==null&&(this.pl===null&&(this.pl=new V),this.pl.add(t))}HD(t){t!==null&&this.pl!==null&&this.pl.delete(t)}qD(t,e,i){if(t===null||this.pl===null)return null;let s=this.pl.iterator;for(;s.next();){let n=s.value;if(n.Gy===this&&n.fk===t&&n.yC===e&&n.wC===i||n.Gy===t&&n.fk===this&&n.yC===i&&n.wC===e)return n}return null}invalidateLinkBundle(t,e,i){e==null&&(e=""),i==null&&(i="");let s=this.qD(t,e,i);s!==null&&s.Jd()}df(t,e,i,s,n,o,r){t===3&&e==="elements"?this.ci=null:t===4&&e==="elements"&&(this.ci=null),super.df(t,e,i,s,n,o,r)}invalidateConnectedLinks(t,e){let i=this.linksConnected;for(;i.next();){let s=i.value;t&&t.has(s)||e&&s.fromPort!==e&&s.toPort!==e||(this.Ze(s.fromPort),this.Ze(s.toPort),s.$t())}}Ze(t){if(t===null)return;let e=t.yd;e!==null&&e.Jd();let i=t.part,s=i.containingGroup;s!==null&&!i.isVisible()&&s.Ze(s.port)}Qr(){return!0}get portSpreading(){return this.vt!==null?this.vt.Yy:1}set portSpreading(t){let e=this.portSpreading;if(e!==t){this.yl().Yy=t,this.t("portSpreading",e,t);let i=this.diagram;if(i!==null&&i.undoManager.isUndoingRedoing)return;this.invalidateConnectedLinks()}}get avoidable(){return(this.E&8)!==0}set avoidable(t){let e=(this.E&8)!==0;if(e!==t){this.E=this.E^8;let i=this.diagram;i!==null&&i.fd(this),this.t("avoidable",e,t)}}get avoidableMargin(){return this.vt!==null?this.vt.Ky:Dt.XL}set avoidableMargin(t){typeof t=="number"&&(t=new Dt(t));let e=this.avoidableMargin;if(!e.equals(t)){t=t.N(),this.yl().Ky=t;let i=this.diagram;i!==null&&i.fd(this),this.t("avoidableMargin",e,t)}}canAvoid(){return this.avoidable&&!this.isLinkLabel}getAvoidableRect(t){return t.set(this.actualBounds),t.addMargin(this.avoidableMargin),t}findVisibleNode(){let t=this;for(;t!==null&&!t.isVisible();)t=t.containingGroup;return t}isVisible(){if(!super.isVisible())return!1;let t=!0,e=1,i=this.diagram;if(i!==null){if(i.animationManager.Wx(this))return!0;t=i.isTreePathToChildren,e=i.treeCollapsePolicy}if(e===1){let n=this.findTreeParentNode();if(n!==null&&!n.isTreeExpanded)return!1}else if(e===2){let n=t?this.findLinksInto():this.findLinksOutOf(),o=!1,r=!1;for(;n.next();){let a=n.value;if(a.isTreeLink){o=!0;let h=t?a.fromNode:a.toNode;if(h&&h.isTreeExpanded){r=!0;break}}}if(o&&!r)return!1}else if(e===3){let n=t?this.findLinksInto():this.findLinksOutOf(),o=!1,r=!1;for(;n.next();){let a=n.value;if(a.isTreeLink){o=!0;let h=t?a.fromNode:a.toNode;if(h&&!h.isTreeExpanded){r=!0;break}}}if(o&&r)return!1}let s=this.labeledLink;return s!==null?s.isVisible():!0}Xe(t){super.Xe(t);let e=this.linksConnected;for(;e.next();){let i=e.value;if(t&&this.containingGroup!==null){let s=i.getOtherNode(this);s!==null&&!s.isMemberOf(this.containingGroup)&&i.$t()}i.Xe(t)}}get linksConnected(){return this.ee.iterator}findExternalTreeLinksConnected(){let t=new V,e=new V;return this.jD(this,t,e),e.iterator}jD(t,e,i){if(t===null||e.has(t))return;e.add(t);let s=!0,n=this.diagram;n!==null&&(s=n.isTreePathToChildren),t.linksConnected.each(o=>{o.isTreeLink?(s?o.fromNode===t:o.toNode===t)&&this.jD(s?o.toNode:o.fromNode,e,i):i.add(o)})}findLinksConnected(t){if(t===void 0&&(t=null),t===null)return this.ee.iterator;let e=new gt(this.ee),i=this;return e.predicate=s=>s.fromNode===i&&s.fromPortId===t||s.toNode===i&&s.toPortId===t,e}findLinksOutOf(t){t===void 0&&(t=null);let e=new gt(this.ee),i=this;return e.predicate=s=>s.fromNode!==i?!1:t===null?!0:s.fromPortId===t,e}findLinksInto(t){t===void 0&&(t=null);let e=new gt(this.ee),i=this;return e.predicate=s=>s.toNode!==i?!1:t===null?!0:s.toPortId===t,e}findNodesConnected(t){t===void 0&&(t=null);let e=null,i=null,s=this.ee.iterator;for(;s.next();){let n=s.value;if(n.fromNode===this){if(t===null||n.fromPortId===t){let o=n.toNode;e!==null?e.add(o):i!==null&&i!==o?(e=new V,e.add(i),e.add(o)):i=o}}else if(n.toNode===this&&(t===null||n.toPortId===t)){let o=n.fromNode;e!==null?e.add(o):i!==null&&i!==o?(e=new V,e.add(i),e.add(o)):i=o}}return e!==null?e.iterator:i!==null?new dt(i):Pt.instance}findNodesOutOf(t){t===void 0&&(t=null);let e=null,i=null,s=this.ee.iterator;for(;s.next();){let n=s.value;if(n.fromNode===this&&(t===null||n.fromPortId===t)){let o=n.toNode;e!==null?e.add(o):i!==null&&i!==o?(e=new V,e.add(i),e.add(o)):i=o}}return e!==null?e.iterator:i!==null?new dt(i):Pt.instance}findNodesInto(t){t===void 0&&(t=null);let e=null,i=null,s=this.ee.iterator;for(;s.next();){let n=s.value;if(n.toNode===this&&(t===null||n.toPortId===t)){let o=n.fromNode;e!==null?e.add(o):i!==null&&i!==o?(e=new V,e.add(i),e.add(o)):i=o}}return e!==null?e.iterator:i!==null?new dt(i):Pt.instance}findLinksBetween(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null);let s=new gt(this.ee),n=this;return s.predicate=o=>o.fromNode===n&&o.toNode===t&&(e===null||o.fromPortId===e)&&(i===null||o.toPortId===i)||o.fromNode===t&&o.toNode===n&&(i===null||o.fromPortId===i)&&(e===null||o.toPortId===e),s}findLinksTo(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null);let s=new gt(this.ee),n=this;return s.predicate=o=>!(o.fromNode!==n||o.toNode!==t||e!==null&&o.fromPortId!==e||i!==null&&o.toPortId!==i),s}findSuccessorParts(t){return t===void 0&&(t=new V),this.WD(this,t),t.remove(this),t}WD(t,e){t!==null&&(e.has(t)||(e.add(t),t.findLinksOutOf().each(i=>{if(e.has(i))return;e.add(i);let s=i.toNode;s!==null&&this.WD(s,e)})))}findPredecessorParts(t){return t===void 0&&(t=new V),this.JD(this,t),t.remove(this),t}JD(t,e){t!==null&&(e.has(t)||(e.add(t),t.findLinksInto().each(i=>{if(e.has(i))return;e.add(i);let s=i.fromNode;s!==null&&this.JD(s,e)})))}get linkConnected(){return this.vt!==null?this.vt.Hy:null}set linkConnected(t){let e=this.linkConnected;e!==t&&(t!==null&&m.S(t,J,"linkConnected"),this.yl().Hy=t,this.t("linkConnected",e,t))}get linkDisconnected(){return this.vt!==null?this.vt.qy:null}set linkDisconnected(t){let e=this.linkDisconnected;e!==t&&(t!==null&&m.S(t,J,"linkDisconnected"),this.yl().qy=t,this.t("linkDisconnected",e,t))}get linkValidation(){return this.vt!==null?this.vt.El:null}set linkValidation(t){let e=this.linkValidation;e!==t&&(t!==null&&m.S(t,J,"linkValidation"),this.yl().El=t,this.t("linkValidation",e,t))}uk(t,e){this.Ze(e);let i=this.ee.has(t);if(i||this.ee.add(t),!i||t.fromNode===t.toNode){let s=this.linkConnected;if(s!==null){let n=!0,o=this.diagram;o!==null&&(n=o.G,o.G=!0),s(this,t,e),o!==null&&(o.G=n)}}if(!i){if(!t.isTreeLink)return;let s=t.fromNode,n=t.toNode;if(s!==null&&n!==null&&s!==n){let o=!0,r=this.diagram;r!==null&&(o=r.isTreePathToChildren);let a=o?n:s,h=o?s:n;if(a.va||(a.va=h),h.isTreeLeaf){if(r!==null&&r.undoManager.isUndoingRedoing)return;o?s===h&&(h.isTreeLeaf=!1):n===h&&(h.isTreeLeaf=!1)}}}}dk(t,e){this.Ze(e);let i=this.ee.delete(t),s=null;if(i||t.toNode===t.fromNode){let n=this.linkDisconnected;if(s=this.diagram,n!==null){let o=!0;s!==null&&(o=s.G,s.G=!0),n(this,t,e),s!==null&&(s.G=o)}}if(i){if(!t.isTreeLink)return;let n=!0;s!==null&&(n=s.isTreePathToChildren);let o=n?t.toNode:t.fromNode,r=n?t.fromNode:t.toNode;if(o!==null&&(o.va=!1),r!==null&&!r.isTreeLeaf)if(r.ee.count===0){if(r.va=null,s!==null&&s.undoManager.isUndoingRedoing)return;r.isTreeLeaf=!0}else r.vp()}}vp(){if(this.va=!1,this.ee.count===0)return;let t=!0,e=this.diagram;if(e!==null&&e.undoManager.isUndoingRedoing)return;e!==null&&(t=e.isTreePathToChildren);let i=this.ee.iterator;for(;i.next();){let s=i.value;if(s.isTreeLink){if(t){if(s.fromNode===this){this.isTreeLeaf=!1;return}}else if(s.toNode===this){this.isTreeLeaf=!1;return}}}this.isTreeLeaf=!0}updateRelationshipsFromData(){let t=this.diagram;t!==null&&t.partManager.updateRelationshipsFromData(this)}tp(t){if(super.tp(t),!t){this.vp();let e=this.zf;e!==null&&e.$D(this)}}ep(t){if(super.ep(t),!t){let e=this.zf;e!==null&&e.ZD(this)}}rf(){if(this.ee.count>0){let t=this.diagram;if(t!==null){let e=t.commandHandler!==null?t.commandHandler.deletesConnectedLinks:!0,i=this.ee.copy().iterator;for(;i.next();){let s=i.value;e?t.remove(s):(s.fromNode===this&&(s.fromNode=null),s.toNode===this&&(s.toNode=null))}}}this.labeledLink=null,super.rf()}get isLinkLabel(){return this.zf!==null}get labeledLink(){return this.zf}set labeledLink(t){let e=this.zf;if(e!==t){let i=this.diagram,s=this.data;if(e!==null){if(e.ZD(this),i!==null&&s!==null&&!i.undoManager.isUndoingRedoing){let n=e.data,o=i.model;if(n!==null&&o.jh()){let r=o.getKeyForNodeData(s);r!==void 0&&o.removeLabelKeyForLinkData(n,r)}}this.containingGroup=null}if(this.zf=t,t!==null){if(t.$D(this),i!==null&&s!==null&&!i.undoManager.isUndoingRedoing){let n=t.data,o=i.model;if(n!==null&&o.jh()){let r=o.getKeyForNodeData(s);r!==void 0&&o.addLabelKeyForLinkData(n,r)}}this.containingGroup=t.containingGroup}this.kf(),this.t("labeledLink",e,t)}}findVisiblePort(t){let e=t;for(;e!==null&&(!e.actualBounds.isReal()||!e.isVisibleObject());)e=e.panel;return e===null?this.port:e}findPort(t){if(this.ci===null){if(t===""&&this.Cn===!1)return this;this.QD()}let e=this.ci.get(t);return e!==null||t!==""&&(e=this.ci.get(""),e!==null)?e:this}get port(){return this.findPort("")}get ports(){return this.ci===null&&this.QD(),this.ci.iteratorValues}QD(){this.ci===null?this.ci=new Mt:this.ci.clear(),this.walkVisualTreeFrom(this,(t,e)=>t.oD(e)),this.ci.count===0&&this.ci.set("",this)}oD(t){let e=t.portId;e!==null&&this.ci!==null&&this.ci.set(e,t)}RN(t,e){let i=t.portId;if(i!==null){this.ci!==null&&this.ci.delete(i);let s=this.diagram;if(s!==null&&e){let n=null,o=this.findLinksConnected(i);for(;o.next();){let r=o.value;n===null&&(n=m.nt()),n.push(r)}if(n!==null){for(let r=0;r<n.length;r++){let a=n[r];s.remove(a)}m.Z(n)}}}}isInTreeOf(t){if(t===null||t===this)return!1;let e=!0,i=this.diagram;i!==null&&(e=i.isTreePathToChildren);let s=this,n=t,o;if(e)for(;s!==n;){o=null;let r=s.ee.iterator;for(;r.next();){let a=r.value;if(a.isTreeLink&&(o=a.fromNode,o!==s&&o!==this))break}if(o===this||o===null||o===s)return!1;s=o}else for(;s!==n;){o=null;let r=s.ee.iterator;for(;r.next();){let a=r.value;if(a.isTreeLink&&(o=a.toNode,o!==s&&o!==this))break}if(o===this||o===null||o===s)return!1;s=o}return!0}findTreeRoot(){let t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);let i=this,s;if(t)for(;;){s=null;let n=i.ee.iterator;for(;n.next();){let o=n.value;if(o.isTreeLink&&(s=o.fromNode,s!==i&&s!==this))break}if(s===this)return this;if(s===null||s===i)return i;i=s}else for(;;){s=null;let n=i.ee.iterator;for(;n.next();){let o=n.value;if(o.isTreeLink&&(s=o.toNode,s!==i&&s!==this))break}if(s===this)return this;if(s===null||s===i)return i;i=s}}findCommonTreeParent(t){if(t===null)return null;if(this===t)return this;let e=this;for(;e!==null;)e.ck(!0),e=e.findTreeParentNode();let i=null;for(e=t;e!==null;){if(e.YD()){i=e;break}e=e.findTreeParentNode()}for(e=this;e!==null;)e.ck(!1),e=e.findTreeParentNode();return i}findTreeParentLink(){let t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);let i=this.ee.iterator;if(t)for(;i.next();){let s=i.value;if(s.isTreeLink&&s.fromNode!==this)return s}else for(;i.next();){let s=i.value;if(s.isTreeLink&&s.toNode!==this)return s}return null}findTreeParentNode(){let t=this.va;if(t===null)return null;if(t instanceof J)return t;let e=this.diagram,i=e!==null?e.isTreePathToChildren:!0,s=this.ee.iterator;for(;s.next();){let n=s.value;if(!n.isTreeLink)continue;let o=i?n.fromNode:n.toNode;if(o!==this)return this.va=o,o}return this.va=null,null}findTreeParentChain(t){function e(i,s){s.add(i);let n=i.findTreeParentLink();if(n!==null){s.add(n);let o=i.findTreeParentNode();if(o===null)return;e(o,s)}}return t===void 0&&(t=new V),e(this,t),t}findTreeLevel(){return this.SE(this)}SE(t){let e=0,i=t.findTreeParentNode();for(;i!==null&&i!==t;)i=i.findTreeParentNode(),e++;return e}findTreeChildrenLinks(){let t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);let i=new gt(this.ee),s=this;return t?i.predicate=n=>!(!n.isTreeLink||n.fromNode!==s):i.predicate=n=>!(!n.isTreeLink||n.toNode!==s),i}findTreeChildrenNodes(){let t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);let i=null,s=null,n=this.ee.iterator;if(t)for(;n.next();){let o=n.value;if(o.isTreeLink&&o.fromNode===this){let r=o.toNode;i!==null?i.add(r):s!==null&&s!==r?(i=new q,i.add(s),i.add(r)):s=r}}else for(;n.next();){let o=n.value;if(o.isTreeLink&&o.toNode===this){let r=o.fromNode;i!==null?i.add(r):s!==null&&s!==r?(i=new q,i.add(s),i.add(r)):s=r}}return i!==null?i.iterator:s!==null?new dt(s):Pt.instance}findTreeParts(t,e){return t===void 0&&(t=1/0),m.s(t,"number",J,"findTreeParts:level"),e===void 0&&(e=new V),pt.ga(e,this,!1,t,!0),e}collapseTree(t){t===void 0&&(t=1),t<1&&(t=1);let e=this.diagram;if(e===null||e.isCollapsingExpanding)return;e.isCollapsingExpanding=!0;let i=new V;i.add(this),this._D(i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===1),e.isCollapsingExpanding=!1}_D(t,e,i,s,n,o){if(i>1){let r=e?this.findLinksOutOf():this.findLinksInto();for(;r.next();){let a=r.value;if(!a.isTreeLink)continue;let h=a.getOtherNode(this);h!==null&&h!==this&&!t.has(h)&&(t.add(h),h._D(t,e,i-1,s,n,o))}}else this.tv(t,e,s,n,o)}tv(t,e,i,s,n){let o=s===this?!0:this.isTreeExpanded,r=e?this.findLinksOutOf():this.findLinksInto();for(;r.next();){let a=r.value;if(!a.isTreeLink)continue;let h=a.getOtherNode(this);if(h!==null&&h!==this){let l=t.has(h);if(l||t.add(h),o){let u=e?h.findNodesInto():h.findNodesOutOf(),c=this;u.all(d=>d===c||!d.isTreeExpanded)&&i.Yc(h,s),h.Sa(),h.Xe(!1)}h.isTreeExpanded&&(h.wasTreeExpanded=h.isTreeExpanded,l||h.tv(t,e,i,s,n))}}this.isTreeExpanded=!1}expandTree(t){t===void 0&&(t=2),t<2&&(t=2);let e=this.diagram;if(e===null||e.isCollapsingExpanding)return;e.isCollapsingExpanding=!0;let i=new V;i.add(this),this.ev(i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===1),e.isCollapsingExpanding=!1}ev(t,e,i,s,n,o){let r=n===this?!1:this.isTreeExpanded,a=e?this.findLinksOutOf():this.findLinksInto();for(;a.next();){let h=a.value;if(!h.isTreeLink)continue;r||h.Fi||h.$t();let l=h.getOtherNode(this);if(l!==null&&l!==this&&!t.has(l)){if(t.add(l),!r){l.Xe(!0),l.Sa();let u=e?l.findNodesInto():l.findNodesOutOf(),c=this;u.all(d=>d===c||!d.isTreeExpanded)&&s.Gc(l,n)}(i>2||l.wasTreeExpanded)&&(l.wasTreeExpanded=!1,l.ev(t,e,i-1,s,n,o))}}this.isTreeExpanded=!0}get isTreeExpanded(){return(this.E&1)!==0}set isTreeExpanded(t){let e=(this.E&1)!==0;if(e!==t){this.E=this.E^1;let i=this.diagram;this.t("isTreeExpanded",e,t);let s=this.treeExpandedChanged;if(s!==null){let n=!0;i!==null&&(n=i.G,i.G=!0),s(this),i!==null&&(i.G=n)}if(i!==null&&i.undoManager.isUndoingRedoing){this.Xe(t);return}t?this.expandTree():this.collapseTree()}}get wasTreeExpanded(){return(this.E&2)!==0}set wasTreeExpanded(t){let e=(this.E&2)!==0;e!==t&&(this.E=this.E^2,this.t("wasTreeExpanded",e,t))}get treeExpandedChanged(){return this.vt!==null?this.vt.jy:null}set treeExpandedChanged(t){let e=this.treeExpandedChanged;e!==t&&(t!==null&&m.S(t,J,"treeExpandedChanged"),this.yl().jy=t,this.t("treeExpandedChanged",e,t))}get isTreeLeaf(){return(this.E&4)!==0}set isTreeLeaf(t){let e=(this.E&4)!==0;e!==t&&(this.E=this.E^4,this.t("isTreeLeaf",e,t))}get isTreeRoot(){return this.findTreeParentLink()===null}}class qi{me;Hy;qy;El;jy;Ky;Yy;Wy;Jy;da;$y;constructor(){this.me=!1,this.Hy=null,this.qy=null,this.El=null,this.jy=null,this.Ky=Dt.XL,this.Yy=1,this.Wy=null,this.Jy=null,this.da=null,this.$y=null}copy(){let t=new qi;return t.Hy=this.Hy,t.qy=this.qy,t.El=this.El,t.jy=this.jy,t.Ky=this.Ky.N(),t.Yy=this.Yy,t.Wy=this.Wy,t.Jy=this.Jy,t.da=this.da,t.$y=this.$y,t}}var Hi=(x=>(x[x.None=0]="None",x[x.End=17]="End",x[x.Scale=18]="Scale",x[x.Stretch=19]="Stretch",x))(Hi||{}),Wi=(x=>(x[x.Normal=1]="Normal",x[x.Orthogonal=2]="Orthogonal",x[x.AvoidsNodes=6]="AvoidsNodes",x[x.AvoidsNodesStraight=7]="AvoidsNodesStraight",x))(Wi||{}),$i=(x=>(x[x.None=0]="None",x[x.Bezier=9]="Bezier",x[x.JumpGap=10]="JumpGap",x[x.JumpOver=11]="JumpOver",x))($i||{});class j extends pt{Mt;mo;po;$d;yo;wo;Zd;Xf;Qd;_d;tg;Wh;eg;nn;Me;wl;Dr;xl;er;xC;bC;gk;kC;PC;Jh;mk;ut;ir;static $h=null;static Zh=null;Lf;SC;MC;constructor(t){super(G.Link),this.Mt=8,this.mo=null,this.po="",this.$d=null,this.yo=null,this.wo="",this.Zd=null,this.Xf=0,this.Qd=0,this._d=0,this.tg=NaN,this.Wh=1,this.eg=.5,this.nn=null,this.Me=new q().k(),this.wl=null,this.Dr=null,this.xl=new I,this.ut=new wt,this.er=null,this.ir=null,this.xC=P.gn,this.bC=P.gn,this.SC=0,this.MC=0,this.gk=new P,this.kC=null,this.PC=null,this.Jh=null,this.mk=NaN,this.ft=null,this.Lf=[],t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Mt=this.Mt&-113,t.po=this.po,t.$d=this.$d,t.wo=this.wo,t.Zd=this.Zd,t.Xf=this.Xf,t.Qd=this.Qd,t._d=this._d,t.tg=this.tg,t.Wh=this.Wh,t.eg=this.eg,this.ft!==null&&(t.ft=this.ft.copy())}Ho(t){super.Ho(t),this.po=t.po,this.wo=t.wo,t.wl=null,t.$t(),t.ir=this.ir;let e=t.fromPort;e!==null&&t.fromNode.Ze(e);let i=t.toPort;i!==null&&t.toNode.Ze(i)}fe(t){t in Wi||t in $i||t in Hi?j.NC(t)?this.routing=t:t===9||t===10||t===11?this.curve=t:t===17||t===18||t===19?this.adjusting=t:t===1||t===0||m.o("Unknown Link enum value for a Link property: "+t):super.fe(t)}static Normal=1;static Orthogonal=2;static AvoidsNodes=6;static AvoidsNodesStraight=7;static None=0;static Bezier=9;static JumpGap=10;static JumpOver=11;static End=17;static Scale=18;static Stretch=19;static OrientAlong=21;static OrientPlus90=22;static OrientMinus90=23;static OrientOpposite=24;static OrientUpright=25;static OrientPlus90Upright=26;static OrientMinus90Upright=27;static OrientUpright45=28;static iv=8;static sv=16;static Fa=8;static J1=3;static nv=3;static ov=1.333;static CC=1;static LC=0;static rv=10;static Gf=9999;static lv=30;static av=30;static AC=10;static hv=10;static cv=14;static fv=30;static uv=14;static eT=8;static iT=8;static dv=11;static setRoutingParameter(t,e){switch(t){case 1:j.iv=e;break;case 2:j.sv=e;break;case 3:j.Fa=e;break;case 4:j.J1=e;break;case 5:j.nv=e;break;case 6:j.ov=e;break;case 7:j.CC=e;break;case 8:j.LC=e;break;case 9:j.rv=e;break;case 10:j.Gf=e;break;case 11:j.lv=e;break;case 12:j.av=e;break;case 13:j.AC=e;break;case 14:j.hv=e;break;case 15:j.cv=e;break;case 16:j.fv=e;break;case 17:j.uv=e;break;case 18:j.eT=e;break;case 19:j.iT=e;break;case 20:j.dv=e;break}t>29&&t<71&&(j.UT=t+parseInt(e.toString().slice(0,-1)))}static UT;Wi(){return this.ft===null&&(this.ft=new Ni),this.ft}EI(t,e,i){let s=t.segmentIndex,n=t.segmentFraction,o=t.alignmentFocus,r=t.segmentOrientation,a=t.segmentOffset,h=0,l=0,u=0,c=0;if(isNaN(s)){let L=this.ut,M=m.nt();L.getPointAndAngleAlongPath(n,M);let A=P.z(M[0],M[1]);if(c=M[2],A.add(this.getPoint(0)),L.type===1)A.offset(-L.startX,-L.startY);else{let F=L.figures.first();A.offset(-F.startX,-F.startY)}r!==0&&(u=this.computeAngle(t,r,c),t.angle=u),h=A.x,l=A.y,P.i(A),m.Z(M)}else if(s<-e||s>=e){let L=P.l();this.qN(L),c=this.midAngle,r!==0&&(u=this.computeAngle(t,r,c),t.angle=u),h=L.x,l=L.y,P.i(L)}else{let L,M,A=0;if(s>=0?(L=i.r[s],M=s<e-1?i.r[s+1]:L):(A=e+s,L=i.r[A],M=A>0?i.r[A-1]:L),L.equalsApprox(M)){let F,O;s>=0?(F=s>0?i.r[s-1]:L,O=s<e-2?i.r[s+2]:M):(F=A<e-1?i.r[A+1]:L,O=A>1?i.r[A-2]:M);let E=F.distanceSquaredPoint(L),B=M.distanceSquaredPoint(O);E>B+10?c=s>=0?F.directionPoint(L):L.directionPoint(F):B>E+10?c=s>=0?M.directionPoint(O):O.directionPoint(M):c=s>=0?F.directionPoint(O):O.directionPoint(F)}else c=s>=0?L.directionPoint(M):M.directionPoint(L);r!==0&&(u=this.computeAngle(t,r,c),t.angle=u),h=L.x+(M.x-L.x)*n,l=L.y+(M.y-L.y)*n}if(o.isNone()){t.moveTo(h,l,!0);return}else o.isNoSpot()&&(o=T.Center);let d=Nt.l();d.Ue(),d.it(t.scale,t.scale),d.ks(t.angle,0,0);let f=t.naturalBounds,p=I.z(0,0,f.width,f.height),g=P.l();g.setRectSpot(p,o),d.gt(g);let y=-g.x,b=-g.y,v=f.width,w=f.height,k=P.bs(a),S=isNaN(a.x),N=isNaN(a.y);if(S||N){let L=v/2+j.J1,M=w/2+j.nv,A=c>=45&&c<=135,F=c>=225&&c<=315;r===0&&(A||F)?(k.x=N?L:a.y,k.y=S?M:a.x,A?s>=0||isNaN(s)&&n<.5||S&&(k.y=-M):F&&((s>=0||isNaN(s)&&n<.5)&&S&&(k.y=-M),N&&(k.x=-L))):(S&&(s>=0||isNaN(s)&&n<.5?k.x=L:k.x=-L),N&&(k.y=-M),k.rotate(c))}else k.rotate(c);h+=k.x,l+=k.y,d.sm(p),y+=p.x,b+=p.y;let D=P.z(h+y,l+b);t.move(D),P.i(D),P.i(k),P.i(g),I.i(p),Nt.i(d)}Qr(){let t=this.fromNode;if(t!==null){let i=t.findVisibleNode();if(i!==null&&(t=i),t.as()||t.fa())return!1}let e=this.toNode;if(e!==null){let i=e.findVisibleNode();if(i!==null&&(e=i),e.as()||e.fa())return!1}return!0}vN(t,e,i){return!1}FN(){}Di(){return!1}computeAngle(t,e,i){return j.computeAngle(e,i)}static computeAngle(t,e){let i=0;switch(t){default:case 0:i=0;break;case 21:i=e;break;case 22:i=e+90;break;case 23:i=e-90;break;case 24:i=e+180;break;case 25:i=C.Ee(e),i>90&&i<270&&(i-=180);break;case 26:i=C.Ee(e+90),i>90&&i<270&&(i-=180);break;case 27:i=C.Ee(e-90),i>90&&i<270&&(i-=180);break;case 28:if(i=C.Ee(e),i>45&&i<135||i>225&&i<315)return 0;i>90&&i<270&&(i-=180);break}return C.Ee(i)}get fromNode(){return this.mo}set fromNode(t){let e=this.mo;if(e!==t){let i=this.fromPort;e!==null&&(this.yo!==e&&e.dk(this,i),this.Zy(),this.invalidateLayout(2)),this.mo=t,t!==null&&this.Xe(t.isVisible()),this.er=null,this.$t();let s=this.diagram;s!==null&&s.G&&s.partManager.setFromNodeForLink(this,t,e);let n=this.fromPort,o=this.fromPortChanged;if(o!==null){let r=!0;s!==null&&(r=s.G,s.G=!0),o(this,i,n),s!==null&&(s.G=r)}t!==null&&(this.yo!==t&&t.uk(this,n),this.Qy(),this.invalidateLayout(1)),this.t("fromNode",e,t),this.Wd()}}get fromPortId(){return this.po}set fromPortId(t){let e=this.po;if(e!==t){let i=this.fromPort;i!==null&&this.fromNode?.Ze(i),this.Zy(),this.po=t;let s=this.fromPort;s!==null&&this.fromNode?.Ze(s);let n=this.diagram;if(n!==null){let o=this.data,r=n.model;o!==null&&r.jh()&&r.setFromPortIdForLinkData(o,t)}if(i!==s){this.er=null,this.$t();let o=this.fromPortChanged;if(o!==null){let r=!0;n!==null&&(r=n.G,n.G=!0),o(this,i,s),n!==null&&(n.G=r)}}this.Qy(),this.t("fromPortId",e,t)}}get fromPort(){let t=this.mo;if(t===null)return null;let e=this.po;return t.findPort(e)}get fromPortChanged(){return this.$d}set fromPortChanged(t){let e=this.$d;e!==t&&(t!==null&&m.S(t,j,"fromPortChanged"),this.$d=t,this.t("fromPortChanged",e,t))}get toNode(){return this.yo}set toNode(t){let e=this.yo;if(e!==t){let i=this.toPort;e!==null&&(this.mo!==e&&e.dk(this,i),this.Zy(),this.invalidateLayout(2)),this.yo=t,t!==null&&this.Xe(t.isVisible()),this.er=null,this.$t();let s=this.diagram;s!==null&&s.G&&s.partManager.setToNodeForLink(this,t,e);let n=this.toPort,o=this.toPortChanged;if(o!==null){let r=!0;s!==null&&(r=s.G,s.G=!0),o(this,i,n),s!==null&&(s.G=r)}t!==null&&(this.mo!==t&&t.uk(this,n),this.Qy(),this.invalidateLayout(1)),this.t("toNode",e,t),this.Wd()}}get toPortId(){return this.wo}set toPortId(t){let e=this.wo;if(e!==t){let i=this.toPort;i!==null&&this.toNode?.Ze(i),this.Zy(),this.wo=t;let s=this.toPort;s!==null&&this.toNode?.Ze(s);let n=this.diagram;if(n!==null){let o=this.data,r=n.model;o!==null&&r.jh()&&r.setToPortIdForLinkData(o,t)}if(i!==s){this.er=null,this.$t();let o=this.toPortChanged;if(o!==null){let r=!0;n!==null&&(r=n.G,n.G=!0),o(this,i,s),n!==null&&(n.G=r)}}this.Qy(),this.t("toPortId",e,t)}}get toPort(){let t=this.yo;if(t===null)return null;let e=this.wo;return t.findPort(e)}get toPortChanged(){return this.Zd}set toPortChanged(t){let e=this.Zd;e!==t&&(t!==null&&m.S(t,j,"toPortChanged"),this.Zd=t,this.t("toPortChanged",e,t))}get fromSpot(){return this.ft!==null?this.ft.Dh:T.Default}set fromSpot(t){let e=this.fromSpot;if(!e.equals(t)){if(t=t.N(),this.Wi().Dh=t,this.t("fromSpot",e,t),e.isSide()||t.isSide()){let i=this.fromNode;i!==null&&i.Ze(this.fromPort)}this.$t()}}get fromEndSegmentLength(){return this.ft!==null?this.ft.Fh:NaN}set fromEndSegmentLength(t){let e=this.fromEndSegmentLength;if(e!==t){if(t<0&&m.J(t,">= 0",j,"fromEndSegmentLength"),this.Wi().Fh=t,this.t("fromEndSegmentLength",e,t),this.computeSpot(!0,this.fromPort).isSide()){let i=this.fromNode;i!==null&&i.Ze(this.fromPort)}this.$t()}}get fromShortLength(){return this.ft!==null?this.ft.Oh:NaN}set fromShortLength(t){let e=this.fromShortLength;e!==t&&(this.Wi().Oh=t,this.ai(),this.t("fromShortLength",e,t))}get toSpot(){return this.ft!==null?this.ft.vh:T.Default}set toSpot(t){let e=this.toSpot;if(!e.equals(t)){if(t=t.N(),this.Wi().vh=t,this.t("toSpot",e,t),e.isSide()||t.isSide()){let i=this.toNode;i!==null&&i.Ze(this.toPort)}this.$t()}}get toEndSegmentLength(){return this.ft!==null?this.ft.Rh:NaN}set toEndSegmentLength(t){let e=this.toEndSegmentLength;if(e!==t){if(t<0&&m.J(t,">= 0",j,"toEndSegmentLength"),this.Wi().Rh=t,this.t("toEndSegmentLength",e,t),this.computeSpot(!1,this.toPort).isSide()){let i=this.toNode;i!==null&&i.Ze(this.toPort)}this.$t()}}get toShortLength(){return this.ft!==null?this.ft.Ih:NaN}set toShortLength(t){let e=this.toShortLength;e!==t&&(this.Wi().Ih=t,this.ai(),this.t("toShortLength",e,t))}Wd(){let t=this.fromNode,e=this.toNode,i=null;if(t!==null?e!==null?i=t.findCommonContainingGroup(e):i=t.containingGroup:e!==null?i=e.containingGroup:i=null,this.ME(i),this.isLabeledLink){let s=this.labelNodes;for(;s.next();){let n=s.value;n.containingGroup=i}}}ME(t){let e=this.Da;if(e!==t){e!==null&&e.uC(this),this.Da=t,t!==null&&t.dC(this);let i=this.containingGroupChanged;if(i!==null){let s=!0,n=this.diagram;n!==null&&(s=n.G,n.G=!0),i(this,e,t),n!==null&&(n.G=s)}this.Fi&&(this.kC===e||this.PC===e)&&this.$t()}}Sa(){let t=this.containingGroup;t!==null&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&super.Sa()}getOtherNode(t){let e=this.fromNode;return t===e?this.toNode:e}getOtherPort(t){let e=this.fromPort;return t===e?this.toPort:e}get isLabeledLink(){return this.nn===null?!1:this.nn.count>0}get labelNodes(){return this.nn===null?Pt.instance:this.nn.iterator}$D(t){this.nn===null&&(this.nn=new V),this.nn.add(t),this.f()}ZD(t){this.nn!==null&&(this.nn.delete(t),this.f())}tp(t){if(super.tp(t),this.Qh()&&this.invalidateOtherJumpOvers(this.actualBounds),!t){let e=this.mo,i=null;e!==null&&(i=this.fromPort,e.uk(this,i));let s=this.yo,n=null;s!==null&&(n=this.toPort,(s!==e||n!==i)&&s.uk(this,n)),this.Qy()}}ep(t){if(super.ep(t),this.Qh()&&this.invalidateOtherJumpOvers(this.actualBounds),!t){let e=this.mo,i=null;e!==null&&(i=this.fromPort,e.dk(this,i));let s=this.yo,n=null;s!==null&&(n=this.toPort,(s!==e||n!==i)&&s.dk(this,n)),this.Zy()}}rf(){if(this.Fi=!0,this.nn!==null){let t=this.diagram;if(t!==null){let e=this.nn.copy().iterator;for(;e.next();){let i=e.value;t.remove(i)}}}if(this.data!==null){let t=this.diagram;t!==null&&t.partManager.TC(this)}}updateRelationshipsFromData(){if(this.data===null)return;let t=this.diagram;t!==null&&t.partManager.updateRelationshipsFromData(this)}move(t,e){let i=e?this.location:this.position,s=i.x;isNaN(s)&&(s=0);let n=i.y;isNaN(n)&&(n=0);let o=t.x-s,r=t.y-n;if(e===!0)super.move(t,!1);else{let h=P.z(i.x+o,i.y+r);super.move(h,!1),P.i(h)}this.kr(o,r);let a=this.labelNodes;for(;a.next();){let h=a.value,l=h.position;h.moveTo(l.x+o,l.y+r)}}get relinkableFrom(){return(this.Mt&1)!==0}set relinkableFrom(t){let e=(this.Mt&1)!==0;e!==t&&(this.Mt=this.Mt^1,this.t("relinkableFrom",e,t),this.invalidateAdornments())}get relinkableTo(){return(this.Mt&2)!==0}set relinkableTo(t){let e=(this.Mt&2)!==0;e!==t&&(this.Mt=this.Mt^2,this.t("relinkableTo",e,t),this.invalidateAdornments())}canRelinkFrom(){if(!this.relinkableFrom)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowRelink)return!1;let e=t.diagram;return!(e!==null&&!e.allowRelink)}canRelinkTo(){if(!this.relinkableTo)return!1;let t=this.layer;if(t===null)return!0;if(!t.allowRelink)return!1;let e=t.diagram;return!(e!==null&&!e.allowRelink)}get resegmentable(){return(this.Mt&4)!==0}set resegmentable(t){let e=(this.Mt&4)!==0;e!==t&&(this.Mt=this.Mt^4,this.t("resegmentable",e,t),this.invalidateAdornments())}get isTreeLink(){return(this.Mt&8)!==0}set isTreeLink(t){let e=(this.Mt&8)!==0;e!==t&&(this.Mt=this.Mt^8,this.t("isTreeLink",e,t),this.fromNode!==null&&this.fromNode.vp(),this.toNode!==null&&this.toNode.vp())}get path(){let t=this.findMainElement();return t instanceof et?t:null}get routeBounds(){return this.updateRoute(),this.xl}DC(t){let e=1/0,i=1/0,s=this.pointsCount;if(s===0)return t.e(NaN,NaN,0,0),t;if(s===1){let n=this.getPoint(0);e=Math.min(n.x,e),i=Math.min(n.y,i),t.e(n.x,n.y,0,0)}else if(s===2){let n=this.getPoint(0),o=this.getPoint(1);e=Math.min(n.x,o.x),i=Math.min(n.y,o.y),t.e(n.x,n.y,0,0),t.unionPoint(o)}else if(this.computeCurve()===9&&s>=3&&!this.isOrthogonal){let n=this.getPoint(0);if(e=n.x,i=n.y,t.e(e,i,0,0),s===3){let o=this.getPoint(1);e=Math.min(o.x,e),i=Math.min(o.y,i);let r=this.getPoint(2);e=Math.min(r.x,e),i=Math.min(r.y,i),C.Mu(n.x,n.y,o.x,o.y,o.x,o.y,r.x,r.y,.5,t)}else for(let o=3;o<s;o+=3){let r=this.getPoint(o-2);o+3>=s&&(o=s-1);let a=this.getPoint(o-1),h=this.getPoint(o);C.Mu(n.x,n.y,r.x,r.y,a.x,a.y,h.x,h.y,.5,t),e=Math.min(h.x,e),i=Math.min(h.y,i),n=h}}else{let n=this.getPoint(0),o=this.getPoint(1);e=Math.min(n.x,o.x),i=Math.min(n.y,o.y),t.e(n.x,n.y,0,0),t.unionPoint(o);for(let r=2;r<s;r++){let a=this.getPoint(r);e=Math.min(a.x,e),i=Math.min(a.y,i),t.unionPoint(a)}}return this.gk.e(e-t.x,i-t.y),t}get midPoint(){return this.qN(new P)}qN(t){return this.updateRoute(),this.computeMidPoint(t)}computeMidPoint(t){let e=this.pointsCount;if(e===0)return t.h(P.gn),t;if(e===1)return t.h(this.getPoint(0)),t;if(e===2){let l=this.getPoint(0),u=this.getPoint(1);return t.e((l.x+u.x)/2,(l.y+u.y)/2),t}if(this.isOrthogonal&&(this.computeCorner()>=15||this.computeCurve()===9)){this.ut.getPointAlongPath(.5,t),t.add(this.getPoint(0));let l=this.ut.figures.first();return t.offset(-l.startX,-l.startY),t}if(this.computeCurve()===9){if(e===3){let c=this.getPoint(0),d=this.getPoint(1),f=this.getPoint(2);return C.HL(c.x,c.y,d.x,d.y,d.x,d.y,f.x,f.y,t),t}let l=(e-1)/3|0,u=(l/2|0)*3;if(l%2===1){let c=this.getPoint(u),d=this.getPoint(u+1),f=this.getPoint(u+2),p=this.getPoint(u+3);return C.HL(c.x,c.y,d.x,d.y,f.x,f.y,p.x,p.y,t),t}else return t.h(this.getPoint(u)),t}let i=this.flattenedLengths,s=this.flattenedTotalLength,n=0,o=0,r=0;for(;n<s/2&&o<e&&(r=i[o],!(n+r>s/2));)n+=r,o++;let a=this.getPoint(o),h=this.getPoint(o+1);if(Math.abs(a.x-h.x)<1)a.y>h.y?t.e(a.x,a.y-(s/2-n)):t.e(a.x,a.y+(s/2-n));else if(Math.abs(a.y-h.y)<1)a.x>h.x?t.e(a.x-(s/2-n),a.y):t.e(a.x+(s/2-n),a.y);else{let l=(s/2-n)/r,u=l*(h.x-a.x),c=l*(h.y-a.y);t.e(a.x+u,a.y+c)}return t}get midAngle(){return this.updateRoute(),this.computeMidAngle()}computeMidAngle(){let t=this.pointsCount;if(t<2)return NaN;if(t===2){let h=this.getPoint(0),l=this.getPoint(1);return h.directionPoint(l)}if(this.isOrthogonal&&(this.computeCorner()>=15||this.computeCurve()===9))return this.ut.getAngleAlongPath(.5);if(this.computeCurve()===9&&t>=4){let h=(t-1)/3|0,l=(h/2|0)*3;if(h%2===1){l=Math.floor(l);let u=this.getPoint(l),c=this.getPoint(l+1),d=this.getPoint(l+2),f=this.getPoint(l+3);return C.qF(u.x,u.y,c.x,c.y,d.x,d.y,f.x,f.y)}else if(l>0&&l+1<t){let u=this.getPoint(l-1),c=this.getPoint(l+1);return u.directionPoint(c)}}let e=this.flattenedLengths,i=this.flattenedTotalLength,s=0,n=0,o=0;for(;s<i/2&&n<t&&(o=e[n],!(s+o>i/2));)s+=o,n++;let r=this.getPoint(n),a=this.getPoint(n+1);if(Math.abs(r.x-a.x)<.5&&Math.abs(r.y-a.y)<j.CC){if(n>0&&n<t-2){let h=this.getPoint(n-1),l=this.getPoint(n+2);return h.x<l.x?0:h.x>l.x?180:h.y<l.y?90:270}}else if(Math.abs(r.y-a.y)<.5&&Math.abs(r.x-a.x)<j.CC&&n>0&&n<t-2){let h=this.getPoint(n-1),l=this.getPoint(n+2);return h.y<l.y?90:h.y>l.y?270:h.x<l.x?0:180}return r.directionPoint(a)}get flattenedLengths(){return this.Jh!==null?this.Jh:(this.Fi||this.pk(),this.NE())}get flattenedTotalLength(){let t=this.mk;if(isNaN(t)){let e=this.flattenedLengths,i=e.length;t=0;for(let s=0;s<i;s++)t+=e[s];this.mk=t}return t}NE(){this.Jh===null?this.Jh=[]:this.Jh.length=0;let t=this.Jh,e=this.pointsCount;for(let i=0;i<e-1;i++){let s=0,n=this.getPoint(i),o=this.getPoint(i+1);C.X(n.x,o.x)?(s=o.y-n.y,s<0&&(s=-s),t.push(s)):C.X(n.y,o.y)?(s=o.x-n.x,s<0&&(s=-s),t.push(s)):(s=Math.sqrt(n.distanceSquaredPoint(o)),t.push(s))}return t}get points(){return this.Me}set points(t){let e=this.Me;if(e===t)return;let i=null;if(Array.isArray(t))i=this.convertPointsArrayToList(t);else if(t instanceof q){i=t.copy();let n=i.iterator;for(;n.next();)n.value.k()}else m.o("Link.points value is not an instance of List or Array: "+t);if(i===null)return;i.k(),this.Me=i,this.ai(),this.pk();let s=this.diagram;s!==null&&(!s.Qa&&!s.undoManager.isUndoingRedoing&&s.nb.add(this),s.animationManager.ke&&s.animationManager.TM(this,i)),this.t("points",e,i)}convertPointsArrayToList(t){let e=null,i=t.length%2===0;if(i){for(let s=0;s<t.length;s++)if(typeof t[s]!="number"||isNaN(t[s])){i=!1;break}}if(i){e=new q;for(let s=0;s<t.length/2;s++)e.add(new P(t[s*2],t[s*2+1]).k())}else{let s=!0;for(let n=0;n<t.length;n++){let o=t[n];if(!m.$(o)||typeof o.x!="number"||isNaN(o.x)||typeof o.y!="number"||isNaN(o.y)){s=!1;break}}if(s){e=new q;for(let n=0;n<t.length;n++){let o=t[n];e.add(new P(o.x,o.y).k())}}}return e}get pointsCount(){return this.Me.count}getPoint(t){return this.Me.r[t]}setPoint(t,e){this.Me.setElt(t,e)}setPointAt(t,e,i){this.Me.setElt(t,new P(e,i))}insertPoint(t,e){this.Me.insertAt(t,e)}insertPointAt(t,e,i){this.Me.insertAt(t,new P(e,i))}addPoint(t){this.Me.add(t)}addPointAt(t,e){this.Me.add(new P(t,e))}removePoint(t){this.Me.removeAt(t)}clearPoints(){this.Me.clear()}kr(t,e){if(t===0&&e===0)return;if(this.pointsCount===0){this.defaultFromPoint.isReal()&&this.defaultFromPoint.offset(t,e),this.defaultToPoint.isReal()&&this.defaultToPoint.offset(t,e);return}let i=this.Fi,s=new q,n=this.Me.iterator;for(;n.next();){let a=n.value;s.add(new P(a.x+t,a.y+e).k())}s.k();let o=this.Me;this.Me=s;let r=this.diagram;isNaN(t)||isNaN(e)||r!==null&&r.animationManager.ke?this.f():(this.sn.e(this.sn.x+t,this.sn.y+e),this.ct.e(this.ct.x+t,this.ct.y+e),this.kf()),i?this.pk():(this.defaultFromPoint.isReal()&&(this.defaultFromPoint=this.getPoint(0)),this.defaultToPoint.isReal()&&(this.defaultToPoint=this.getPoint(this.pointsCount-1))),r!==null&&r.animationManager.ke&&r.animationManager.TM(this,s),this.t("points",o,s)}startRoute(){this.wl===null&&(this.wl=this.Me,this.Me=this.Me.copy())}commitRoute(){if(this.wl===null)return;let t=this.wl,e=this.Me;this.wl=null;let i=this.diagram;i!==null&&i.animationManager.ke&&i.animationManager.TM(this,e),this.ai(),this.pk(),this.t("points",t,e)}rollbackRoute(){this.wl!==null&&(this.Me=this.wl,this.wl=null,this.DC(this.xl))}vR(){this.Dr!==null&&(this.points=this.Dr,this.Dr=null)}pk(){if(this.Me.count===0){this.Fi=!1;return}this.Fi=!0,this.DC(this.xl),this.Jh=null,this.mk=NaN,this.defaultFromPoint=this.getPoint(0),this.defaultToPoint=this.getPoint(this.pointsCount-1),this.yk(!1)}invalidateRoute(){this.$t()}$t(){if(this.suspendsRouting)return;let t=this.path;if(t===null)return;let e=this.diagram;if(e){if(e.nb.has(this)||e.undoManager.isUndoingRedoing)return;let i=e.animationManager;if(i.isTicking&&!i.isAnimating)return;this.Dr!==null&&!i.isTicking&&(this.Dr=null)}this.Fi=!1,this.f(),t.f()}get Fi(){return(this.Mt&16)!==0}set Fi(t){(this.Mt&16)!==0!==t&&(this.Mt=this.Mt^16)}get suspendsRouting(){return(this.Mt&32)!==0}set suspendsRouting(t){(this.Mt&32)!==0!==t&&(this.Mt=this.Mt^32)}get _y(){return(this.Mt&64)!==0}set _y(t){(this.Mt&64)!==0!==t&&(this.Mt=this.Mt^64)}get vC(){return(this.Mt&512)!==0}set vC(t){(this.Mt&512)!==0!==t&&(this.Mt=this.Mt^512)}get defaultFromPoint(){return this.xC}set defaultFromPoint(t){this.xC=t&&t.isReal()?t.copy():P.gn}get defaultToPoint(){return this.bC}set defaultToPoint(t){this.bC=t&&t.isReal()?t.copy():P.gn}updateRoute(){if(this.Fi||this._y)return;let t=!0;try{this._y=!0,this.startRoute(),t=this.computePoints()}catch{this._y=!1,this.rollbackRoute()}finally{this._y=!1,t?this.commitRoute():this.rollbackRoute()}}computePoints(){let t=this.diagram;if(t===null)return!1;let e=this.fromNode,i=null;if(e===null?(j.$h||(j.$h=new J,j.$h.desiredSize=st.xc,j.$h.ensureBounds()),this.defaultFromPoint.isReal()&&(j.$h.location=this.defaultFromPoint,j.$h.ensureBounds(),e=j.$h,i=j.$h)):i=this.fromPort,i!==null&&!e.isVisible()){let p=e.findVisibleNode();p!==null&&p!==e?(e=p,i=p.port):e=p}if(this.kC=e,e===null||!e.location.isReal()||i===null||(i=e.findVisiblePort(i),i===null))return!1;let s=this.toNode,n=null;if(s===null?(j.Zh||(j.Zh=new J,j.Zh.desiredSize=st.xc,j.Zh.ensureBounds()),this.defaultToPoint.isReal()&&(j.Zh.location=this.defaultToPoint,j.Zh.ensureBounds(),s=j.Zh,n=j.Zh)):n=this.toPort,n!==null&&!s.isVisible()){let p=s.findVisibleNode();p!==null&&p!==s?(s=p,n=p.port):s=p}if(this.PC=s,s===null||!s.location.isReal()||n===null||(n=s.findVisiblePort(n),n===null))return!1;let o=this.pointsCount,r=this.computeSpot(!0,i),a=this.computeSpot(!1,n),h=this.bl(r),l=this.bl(a),u=i===n&&i!==null,c=this.isOrthogonal,d=this.curve===9;u&&!c?(d=!0,this.er=!0):this.er=!1;let f=this.computeAdjusting()===0||u;if(!c&&!u&&h&&l){let p=!1;if(!f&&o>=3){let g=this.getLinkPoint(e,i,r,!0,!1,s,n),y=this.getLinkPoint(s,n,a,!1,!1,e,i);p=this.adjustPoints(0,g,o-1,y),p&&(g=this.getLinkPoint(e,i,r,!0,!1,s,n),y=this.getLinkPoint(s,n,a,!1,!1,e,i),this.adjustPoints(0,g,o-1,y))}p||(this.clearPoints(),d?this.CE(e,i,r,s,n,a):this.LE(e,i,r,s,n,a))}else{let p=u?this.computeCurviness():0;f&&(c&&this.isAvoiding||u)&&this.clearPoints();let g=this.getLinkPoint(e,i,r,!0,c,s,n),y=this.getLinkPoint(s,n,a,!1,c,e,i),b=0,v=0,w=0;if(c||!h||u){w=this.getLinkDirection(e,i,g,r,!0,c,s,n);let M=this.wk(e,i,r,!0,w);if(u&&(h||r.equals(a)||!c&&r.x+a.x===1&&r.y+a.y===1)&&(w-=c?90:j.lv,p<0&&(w-=180)),w=C.Ee(w),u&&(M+=Math.abs(p)*(c?1:2)),w===0?b=M:w===90?v=M:w===180?b=-M:w===270?v=-M:(b=M*Math.cos(w*Math.PI/180),v=M*Math.sin(w*Math.PI/180)),r.isNoSpot()&&u){let A=i.getDocumentPoint(T.Center,P.l()),F=P.z(A.x+b*j.Gf,A.y+v*j.Gf);this.getLinkPointFromPoint(e,i,A,F,!0,g),P.i(A),P.i(F)}}let k=0,S=0,N=0;if(c||!l||u){N=this.getLinkDirection(s,n,y,a,!1,c,e,i);let M=this.wk(s,n,a,!1,N);if(u&&(l||r.equals(a)||!c&&r.x+a.x===1&&r.y+a.y===1)&&(N+=c?0:j.av,p<0&&(N+=180)),N=C.Ee(N),u&&(M+=Math.abs(p)*(c?1:2)),N===0?k=M:N===90?S=M:N===180?k=-M:N===270?S=-M:(k=M*Math.cos(N*Math.PI/180),S=M*Math.sin(N*Math.PI/180)),a.isNoSpot()&&u){let A=n.getDocumentPoint(T.Center,P.l()),F=P.z(A.x+k*j.Gf,A.y+S*j.Gf);this.getLinkPointFromPoint(s,n,A,F,!1,y),P.i(A),P.i(F)}}let D=g;(c||!h||u)&&(D=new P(g.x+b,g.y+v));let L=y;(c||!l||u)&&(L=new P(y.x+k,y.y+S)),!f&&!c&&h&&o>3&&this.adjustPoints(0,g,o-2,L)?this.setPoint(o-1,y):!f&&!c&&l&&o>3&&this.adjustPoints(1,D,o-1,y)?this.setPoint(0,g):!f&&(c?o>=6:o>4)&&this.adjustPoints(1,D,o-2,L)?(this.setPoint(0,g),this.setPoint(o-1,y)):(this.clearPoints(),this.addPoint(g),(c||!h||u)&&this.addPoint(D),c&&this.addOrthoPoints(D,w,L,N,e,s),(c||!l||u)&&this.addPoint(L),this.addPoint(y))}return t.addInvalidRoute(this),!0}FC(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?(e.x>=t.x?e.x=t.x+9e9:e.x=t.x-9e9,e.y=t.y):(e.y>=t.y?e.y=t.y+9e9:e.y=t.y-9e9,e.x=t.x),e}getLinkPointFromPoint(t,e,i,s,n,o){if(o===void 0&&(o=new P),t===null||e===null)return o.h(i),o;if(!t.isVisible()){let d=t.findVisibleNode();d!==null&&d!==t&&(t=d,e=t.port)}let r=0,a=0,h=0,l=0,u=null,c=e.panel;if(c!==null&&!c.Mn()&&(c=c.panel),c===null)r=s.x,a=s.y,h=i.x,l=i.y;else{u=c.Ws;let d=1/(u.m11*u.m22-u.m12*u.m21),f=u.m22*d,p=-u.m12*d,g=-u.m21*d,y=u.m11*d,b=d*(u.m21*u.dy-u.m22*u.dx),v=d*(u.m12*u.dx-u.m11*u.dy);r=s.x*f+s.y*g+b,a=s.x*p+s.y*y+v,h=i.x*f+i.y*g+b,l=i.x*p+i.y*y+v}return e.mf(r,a,h,l,o),u!==null&&o.v(u),o}AE(t,e){let i=t.yd;return i!==null?i.gv(e):null}xk(t){if(t===null)return null;let e=t.yd;return e===null&&(e=new Ji(t.part,t),t.yd=e),e.gv(this)}getLinkPoint(t,e,i,s,n,o,r,a){if(a===void 0&&(a=new P),i.isSpot()&&!this.bl(i))return e.getDocumentPoint(i,a),a;if(i.isSide()){let u=this.xk(e);if(u!==null){let c=u._h;if(a.h(c),n&&this.routing===7){let d=this.xk(r);if(d!==null&&u.Yf<d.Yf){let f=P.l(),p=P.l(),g=I.l();e.getDocumentPoint(T.TopLeft,f),e.getDocumentPoint(T.BottomRight,p);let y=f.x,b=f.y,v=p.x,w=p.y;g.x=Math.min(y,v),g.y=Math.min(b,w),g.width=Math.abs(y-v),g.height=Math.abs(b-w);let k=this.computeSpot(!s,r),S=this.getLinkPoint(o,r,k,!s,n,t,e,p);(i.includesSide(T.LeftSide)||i.includesSide(T.RightSide))&&S.y>=g.y&&S.y<=g.y+g.height?a.y=S.y:(i.includesSide(T.TopSide)||i.includesSide(T.BottomSide))&&S.x>=g.x&&S.x<=g.x+g.width&&(a.x=S.x),I.i(g),P.i(f),P.i(p)}}return a}}let h=e.getDocumentPoint(this.ig(i,s),P.l()),l=P.l();if(this.pointsCount>(n?6:2))l.h(s?this.getPoint(1):this.getPoint(this.pointsCount-2)),n&&this.FC(h,l);else if(t?.isMemberOf(o)||o?.isMemberOf(t)){let u=e.getDocumentBounds(I.l()),c=r.getDocumentBounds(I.l());u.isReal()&&c.isReal()?c.containsRect(u)?(l.h(h),this.RC(c,h.x,h.y,0,this.computeSpot(r===this.toPort,r),l)):u.containsRect(c)?(r.getDocumentPoint(T.Center,l),this.RC(u,l.x,l.y,0,this.computeSpot(e===this.toPort,e),l)):this.OC(r,h,s,n,l):this.OC(r,h,s,n,l),I.i(u),I.i(c)}else this.OC(r,h,s,n,l);return this.getLinkPointFromPoint(t,e,h,l,s,a),P.i(l),P.i(h),a}OC(t,e,i,s,n){let o=this.computeSpot(!i,t);t.getDocumentPoint(this.ig(o,!i),n),s&&this.FC(e,n)}getLinkDirection(t,e,i,s,n,o,r,a){let h=this.TE(t,e,i,s,n,o,r,a);if(t&&r){let u=I.l(),c=I.l();if(s.isNone()&&t.isMemberOf(r)&&e&&a){if(e.getDocumentBounds(u),a.getDocumentBounds(c),u.isReal()&&c.isReal()&&c.containsRect(u)){let d=this.computeSpot(a===this.toPort,a);d.equals(T.Left)||d.equals(T.LeftSide)?h=180:d.equals(T.Right)||d.equals(T.RightSide)?h=0:d.equals(T.Top)||d.equals(T.TopSide)?h=270:d.equals(T.Bottom)||d.equals(T.BottomSide)?h=90:h=C.Ee(h+180)}}else r?.isMemberOf(t)&&e&&a&&(e.getDocumentBounds(u),a.getDocumentBounds(c),u.isReal()&&c.isReal()&&u.containsRect(c)&&(h=C.Ee(h+180)));I.i(u),I.i(c)}if(this.bl(s)||e===null)return h;let l=e.getDocumentAngle();return l===0?h:(45<=l&&l<135?h+=90:135<=l&&l<225?h+=180:225<=l&&l<315&&(h+=270),C.Ee(h))}TE(t,e,i,s,n,o,r,a){if(s.isSpot())return C._w(null,s.x,s.y);if(s.isSide()){let c=this.xk(e);if(c!==null)switch(c.fi){case 1:return 270;case 8:return 90;case 2:return 180;default:return 0}else return s.includesSide(T.TopSide)?270:s.includesSide(T.BottomSide)?90:s.includesSide(T.LeftSide)?180:0}if(e===null||a===null)return 0;let h=e.getDocumentPoint(T.Center,P.l()),l=P.l();this.pointsCount>(o?6:2)?o?(l.h(n?this.getPoint(1):this.getPoint(this.pointsCount-2)),this.FC(h,l)):l.h(i):a.getDocumentPoint(T.Center,l);let u=0;return Math.abs(l.x-h.x)>Math.abs(l.y-h.y)?l.x>=h.x?u=0:u=180:l.y>=h.y?u=90:u=270,P.i(l),P.i(h),u}computeEndSegmentLength(t,e,i,s){return this.wk(t,e,i,s,NaN)}wk(t,e,i,s,n){if(e!==null&&i.isSide()){let r=this.xk(e);if(r!==null)return r.bk}let o=NaN;if(s?o=this.fromEndSegmentLength:o=this.toEndSegmentLength,e!==null&&isNaN(o))if(n===void 0&&(n=NaN),j.LC>0&&this.computeCurve()===9&&!isNaN(n)&&i.isSpot()){let r=this.getOtherPort(e);if(r){let a=P.l(),h=P.l(),l=e.getDocumentPoint(i,a),u=r.getDocumentPoint(i.opposite(),h),c=n>=315||n<=45||n>=135&&n<=225,d=Math.abs(c?l.x-u.x:l.y-u.y)/j.LC;return d=Math.max(d,j.AC),P.i(a),P.i(h),d}}else s?o=e.fromEndSegmentLength:o=e.toEndSegmentLength;return isNaN(o)&&(o=j.AC),o}computeSpot(t,e){return e===void 0&&(e=null),t?this.DE(e||this.fromPort):this.vE(e||this.toPort)}DE(t){if(t===null)return T.Center;let e=this.fromSpot;return e.isDefault()&&(e=t.fromSpot),e===T.Default?T.None:e}vE(t){if(t===null)return T.Center;let e=this.toSpot;return e.isDefault()&&(e=t.toSpot),e===T.Default?T.None:e}bl(t){return t===T.None||t.x===.5&&t.y===.5}ig(t,e){return t.x===.5&&t.y===.5?t:T.Center}computeOtherPoint(t,e){if(this.computeAdjusting()!==0&&this.pointsCount>4)return this.computeMidPoint(new P);{let i=this.AE(e,this);if(i!==null)return i._h;if(t instanceof ht){let s=this.fromNode,n=this.fromPort;n===e&&(s=this.toNode,n=this.toPort);let o=I.l(),r=I.l();if(n&&s?.isMemberOf(t)){let a=this.computeSpot(n===e,e);if(e.getDocumentBounds(o),n.getDocumentBounds(r),o.isReal()&&r.isReal()&&o.containsRect(r)){let h=n.getDocumentPoint(T.Center);return this.RC(o,h.x,h.y,0,a,h),I.i(o),I.i(r),h}}I.i(o),I.i(r)}return e.getDocumentPoint(T.Center)}}computeShortLength(t){if(t){let e=this.fromShortLength;if(isNaN(e)){let i=this.fromPort;i!==null&&(e=i.fromShortLength)}return isNaN(e)?0:e}else{let e=this.toShortLength;if(isNaN(e)){let i=this.toPort;i!==null&&(e=i.toShortLength)}return isNaN(e)?0:e}}Zm(t,e,i,s,n,o){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);let r;if(o===void 0?(r=Nt.l(),r.Ue()):r=o,r.bc(this.v),this.containedInRect(t,r))return this.$N(e,i,n),o===void 0&&Nt.i(r),!0;if(this.intersectsRect(t,r)){let a=!1;if(!this.Af){let h=this.D.r,l=h.length;for(let u=l;u--;){let c=h[u];if(!c.visible&&c!==this.locationObject)continue;let d=c.actualBounds,f=this.naturalBounds;if(d.x>f.width||d.y>f.height||d.x+d.width<0||d.y+d.height<0)continue;let p=c,g=Nt.l();if(g.set(r),p instanceof G?a=p.Zm(t,e,i,s,n,g):this.path===p?p instanceof et&&(a=p.nE(t,s,g)):a=p.ZT(t,s,g),a){let y=p;e!==null&&(y=e(p)),y&&(i===null||i(y))&&n.add(y)}Nt.i(g)}}return o===void 0&&Nt.i(r),a||this.background!==null}return o===void 0&&Nt.i(r),!1}get isOrthogonal(){return(this.Wh&2)===2}static NC(t){return(t&2)===2}get isAvoiding(){return(this.Wh&4)===4}computeCurve(){if(this.er===null){let t=this.fromPort,e=t!==null&&t===this.toPort,i=this.isOrthogonal;this.er=e&&!i}return this.er?9:this.curve}computeCorner(){if(this.curve===9)return 0;let t=this.corner;return(isNaN(t)||t<0)&&(t=j.hv),t}findMidLabel(){let t=this.path,e=this.D.r,i=e.length;for(let n=0;n<i;n++){let o=e[n];if(!(o===t||o.isPanelMain)&&(o.segmentIndex===-1/0||isNaN(o.segmentIndex)))return o}let s=this.labelNodes;for(;s.next();){let n=s.value;if(n.segmentIndex===-1/0||isNaN(n.segmentIndex))return n}return null}computeSpacing(){if(!this.isVisible())return 0;let t=j.cv;t=Math.max(t,this.computeThickness());let e=this.fromPort,i=this.toPort;if(e!==null&&i!==null){let s=this.findMidLabel();if(s!==null){let n=s.naturalBounds,o=s.margin,r=isNaN(n.width)?j.fv:n.width*s.scale+o.left+o.right,a=isNaN(n.height)?j.uv:n.height*s.scale+o.top+o.bottom,h=s.segmentOrientation;if(h===21||h===25||h===24)t=Math.max(t,a);else if(h===23||h===27||h===22||h===26)t=Math.max(t,r);else{let l=e.getDocumentPoint(T.Center).directionPoint(i.getDocumentPoint(T.Center))/180*Math.PI;t=Math.max(t,Math.abs(Math.sin(l)*r)+Math.abs(Math.cos(l)*a)+1)}this.curve===9&&(t*=j.ov)}}return t}arrangeBundledLinks(t,e){if(e)for(let i=0;i<t.length;i++){let s=t[i];s.computeAdjusting()===0&&s.$t()}}computeCurviness(){let t=this.curviness;if(isNaN(t)){t=j.sv;let e=this.ir;if(e!==null){let i=m.nt(),s=0,n=e.on;for(let r=0;r<n.length;r++){let a=n[r].computeSpacing();i.push(a),s+=a}let o=-s/2;for(let r=0;r<n.length;r++){if(n[r]===this){t=o+i[r]/2;break}o+=i[r]}e.Gy===this.fromNode&&(t=-t),m.Z(i)}}return t}computeThickness(){if(!this.isVisible())return 0;let t=this.path;return t!==null?Math.max(t.strokeWidth,1):1}hasCurviness(){return!isNaN(this.curviness)||this.ir!==null}LE(t,e,i,s,n,o){let r=this.getLinkPoint(t,e,i,!0,!1,s,n),a=this.getLinkPoint(s,n,o,!1,!1,t,e);if(this.mv(t,e,i,r,s,n,o,a),this.addPoint(r),this.addPoint(a),this.hasCurviness()){let h=a.x-r.x,l=a.y-r.y,u=this.computeCurviness(),c=u,d=r.x+h/2,f=r.y+l/2,p=d,g=f;if(C.c(l,0))h>0?g-=c:g+=c;else{let y=-h/l,b=Math.sqrt(c*c/(y*y+1));u<0&&(b=-b),p=(l<0?-1:1)*b+d,g=y*(p-d)+f}this.insertPointAt(1,p,g)}}mv(t,e,i,s,n,o,r,a){let h=o.getDocumentBounds(I.l()),l=e.getDocumentBounds(I.l());if(h.intersectsRect(l)&&!h.containsRect(l)&&!l.containsRect(h)){let u=P.l();e.getDocumentPoint(this.ig(i,!0),u);let c=P.l();o.getDocumentPoint(this.ig(r,!1),c);let d=l.width*l.height,f=h.width*h.height;d>f?(s.h(u),this.getLinkPointFromPoint(n,o,c,u,!1,c),a.h(c)):d<f?(this.getLinkPointFromPoint(t,e,u,c,!0,u),s.h(u),a.h(c)):(s.h(u),a.h(c)),P.i(u),P.i(c)}else if(h.containsPoint(s)){let u=P.l();e.getDocumentPoint(this.ig(i,!0),u),a.h(u),this.IC(h,u.x,u.y,j.Gf,a),this.getLinkPointFromPoint(n,o,h.containsPoint(u)?u:s,a,!1,a),this.getLinkPointFromPoint(t,e,u,a,!0,s),P.i(u)}else if(l.containsPoint(a)){let u=P.l();o.getDocumentPoint(this.ig(r,!1),u),s.h(u),this.IC(l,u.x,u.y,j.Gf,s),this.getLinkPointFromPoint(t,e,l.containsPoint(u)?u:a,s,!0,s),this.getLinkPointFromPoint(n,o,u,s,!1,a),P.i(u)}I.i(l),I.i(h)}RC(t,e,i,s,n,o){let r=-1;return n.equals(T.Left)||n.equals(T.LeftSide)?r=180:n.equals(T.Right)||n.equals(T.RightSide)?r=0:n.equals(T.Top)||n.equals(T.TopSide)?r=270:(n.equals(T.Bottom)||n.equals(T.BottomSide))&&(r=90),r===-1?this.IC(t,e,i,0,o):this.pv(t,e,i,0,r,o)}IC(t,e,i,s,n){let o=C._w(t,e,i);return this.pv(t,e,i,s,o,n)}pv(t,e,i,s,n,o){return n===0?o.x=t.right+s:n===90?o.y=t.bottom+s:n===180?o.x=t.x-s:n===270?o.y=t.y-s:n===45?(o.x=t.right+s,o.y=t.bottom+s):n===135?(o.x=t.x-s,o.y=t.bottom+s):n===225?(o.x=t.x-s,o.y=t.y-s):n===315&&(o.x=t.right+s,o.y=t.y-s),o}CE(t,e,i,s,n,o){let r=this.getLinkPoint(t,e,i,!0,!1,s,n),a=this.getLinkPoint(s,n,o,!1,!1,t,e);this.mv(t,e,i,r,s,n,o,a),this.addPoint(r),this.addPoint(a);let h=a.x-r.x,l=a.y-r.y,u=this.computeCurviness(),c=0,d=0,f=r.x+h/3,p=r.y+l/3,g=f,y=p;C.c(l,0)?h>0?y-=u:y+=u:(c=-h/l,d=Math.sqrt(u*u/(c*c+1)),u<0&&(d=-d),g=(l<0?-1:1)*d+f,y=c*(g-f)+p),f=r.x+2*h/3,p=r.y+2*l/3;let b=f,v=p;C.c(l,0)?h>0?v-=u:v+=u:(b=(l<0?-1:1)*d+f,v=c*(b-f)+p),this.insertPointAt(1,g,y),this.insertPointAt(2,b,v),this.setPoint(0,this.getLinkPoint(t,e,i,!0,!1,s,n)),this.setPoint(3,this.getLinkPoint(s,n,o,!1,!1,t,e))}adjustPoints(t,e,i,s){let n=this.computeAdjusting();if(this.isOrthogonal){if(n===18)return!1;n===19&&(n=17)}switch(n){case 18:return this.FE(t,e,i,s);case 19:return this.RE(t,e,i,s);case 17:return this.OE(t,e,i,s);default:return!1}}FE(t,e,i,s){let n=this.getPoint(t),o=this.getPoint(i);if(n.equalsApprox(e)&&o.equalsApprox(s))return!0;let r=n.x,a=n.y,h=o.x,l=o.y,u=h-r,c=l-a,d=Math.sqrt(u*u+c*c);if(C.X(d,0))return!0;let f=0;C.X(u,0)?c<0?f=-Math.PI/2:f=Math.PI/2:(f=Math.atan(c/Math.abs(u)),u<0&&(f=Math.PI-f));let p=e.x,g=e.y,y=s.x,b=s.y,v=y-p,w=b-g,k=Math.sqrt(v*v+w*w),S=0;C.X(v,0)?w<0?S=-Math.PI/2:S=Math.PI/2:(S=Math.atan(w/Math.abs(v)),v<0&&(S=Math.PI-S));let N=k/d,D=S-f;this.setPoint(t,e);for(let L=t+1;L<i;L++){let M=this.getPoint(L);u=M.x-r,c=M.y-a;let A=Math.sqrt(u*u+c*c);if(C.X(A,0))continue;let F=0;C.X(u,0)?c<0?F=-Math.PI/2:F=Math.PI/2:(F=Math.atan(c/Math.abs(u)),u<0&&(F=Math.PI-F));let O=F+D,E=A*N,B=p+E*Math.cos(O),K=g+E*Math.sin(O);this.setPointAt(L,B,K)}return this.setPoint(i,s),!0}RE(t,e,i,s){let n=this.getPoint(t),o=this.getPoint(i);if(n.equalsApprox(e)&&o.equalsApprox(s))return!0;let r=n.x,a=n.y,h=o.x,l=o.y,u=(h-r)**2+(l-a)**2,c=e.x,d=e.y,f=s.x,p=s.y,g=0,y=1;f-c!==0?(g=(p-d)/(f-c),y=Math.sqrt(1+1/(g*g))):g=9e9,this.setPoint(t,e);for(let b=t+1;b<i;b++){let v=this.getPoint(b),w=v.x,k=v.y,S=.5;u!==0&&(S=((r-w)*(r-h)+(a-k)*(a-l))/u);let N=r+S*(h-r),D=a+S*(l-a),L=Math.sqrt((w-N)**2+(k-D)**2);k<g*(w-N)+D&&(L=-L),g>0&&(L=-L);let M=c+S*(f-c),A=d+S*(p-d);if(g!==0){let F=M+L/y,O=A-(F-M)/g;this.setPointAt(b,F,O)}else this.setPointAt(b,M,A+L)}return this.setPoint(i,s),!0}OE(t,e,i,s){if(this.isOrthogonal){let n=this.getPoint(t),o=this.getPoint(t+1),r=this.getPoint(t+2),a=o.x,h=o.y,l=a,u=h;C.c(n.y,o.y)?C.c(o.x,r.x)?h=e.y:C.c(o.y,r.y)&&(a=e.x):C.c(n.x,o.x)&&(C.c(o.y,r.y)?a=e.x:C.c(o.x,r.x)&&(h=e.y)),this.setPointAt(t+1,a,h),n=this.getPoint(i),o=this.getPoint(i-1),r=this.getPoint(i-2);let c=o.x,d=o.y,f=c,p=d;if(C.c(n.y,o.y)?C.c(o.x,r.x)?d=s.y:C.c(o.y,r.y)&&(c=s.x):C.c(n.x,o.x)&&(C.c(o.y,r.y)?c=s.x:C.c(o.x,r.x)&&(d=s.y)),this.setPointAt(i-1,c,d),this.xT())return this.setPointAt(t+1,l,u),this.setPointAt(i-1,f,p),!1}return this.setPoint(t,e),this.setPoint(i,s),!0}addOrthoPoints(t,e,i,s,n,o){e=C.Ee(e),s=C.Ee(s);let r=s;e>=315||e<45?e=0:45<=e&&e<135?e=90:135<=e&&e<225?e=180:e=270,s>=315||s<45?s=0:45<=s&&s<135?s=90:135<=s&&s<225?s=180:s=270;let a=t,h=i,l=I.bs(n.actualBounds),u=I.bs(o.actualBounds);l.inflate(j.Fa,j.Fa),u.inflate(j.Fa,j.Fa),l.unionPoint(t),u.unionPoint(i);let c=P.l(),d=P.l();e===0?h.x>a.x||s===270&&h.y<a.y&&u.right>a.x||s===90&&h.y>a.y&&u.right>a.x?(c.e(h.x,a.y),d.e(h.x,(a.y+h.y)/2),s===180?(c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1),d.x=c.x,d.y=h.y):s===270&&h.y<a.y||s===90&&h.y>a.y?(a.x<u.left?c.x=this.computeMidOrthoPosition(a.x,a.y,u.left,h.y,!1):a.x<u.right&&(s===270&&a.y<u.top||s===90&&a.y>u.bottom)?c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1):c.x=u.right,d.x=c.x,d.y=h.y):s===0&&a.x<u.left&&a.y>u.top&&a.y<u.bottom&&(c.x=a.x,a.y<h.y?c.y=Math.min(h.y,u.top):c.y=Math.max(h.y,u.bottom),d.y=c.y)):(c.e(a.x,h.y),d.e((a.x+h.x)/2,h.y),(s===180||s===90&&h.y<l.top||s===270&&h.y>l.bottom)&&(s===180&&(u.containsPoint(a)||l.containsPoint(h))?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0):h.y<a.y&&(s===180||s===90)?c.y=this.computeMidOrthoPosition(a.x,l.top,h.x,Math.min(h.y,u.bottom),!0):h.y>a.y&&(s===180||s===270)&&(c.y=this.computeMidOrthoPosition(a.x,l.bottom,h.x,Math.max(h.y,u.top),!0)),d.x=h.x,d.y=c.y),c.y>l.top&&c.y<l.bottom&&(h.x>=l.left&&h.x<=a.x||a.x<=u.right&&a.x>=h.x?(s===90||s===270)&&(c.e(Math.max((a.x+h.x)/2,a.x),a.y),d.e(c.x,h.y)):(s===270||(s===0||s===180)&&h.y<a.y?c.y=Math.min(h.y,s===0?l.top:Math.min(l.top,u.top)):c.y=Math.max(h.y,s===0?l.bottom:Math.max(l.bottom,u.bottom)),d.x=h.x,d.y=c.y))):e===180?h.x<a.x||s===270&&h.y<a.y&&u.left<a.x||s===90&&h.y>a.y&&u.left<a.x?(c.e(h.x,a.y),d.e(h.x,(a.y+h.y)/2),s===0?(c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1),d.x=c.x,d.y=h.y):s===270&&h.y<a.y||s===90&&h.y>a.y?(a.x>u.right?c.x=this.computeMidOrthoPosition(a.x,a.y,u.right,h.y,!1):a.x>u.left&&(s===270&&a.y<u.top||s===90&&a.y>u.bottom)?c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1):c.x=u.left,d.x=c.x,d.y=h.y):s===180&&a.x>u.right&&a.y>u.top&&a.y<u.bottom&&(c.x=a.x,a.y<h.y?c.y=Math.min(h.y,u.top):c.y=Math.max(h.y,u.bottom),d.y=c.y)):(c.e(a.x,h.y),d.e((a.x+h.x)/2,h.y),(s===0||s===90&&h.y<l.top||s===270&&h.y>l.bottom)&&(s===0&&(u.containsPoint(a)||l.containsPoint(h))?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0):h.y<a.y&&(s===0||s===90)?c.y=this.computeMidOrthoPosition(a.x,l.top,h.x,Math.min(h.y,u.bottom),!0):h.y>a.y&&(s===0||s===270)&&(c.y=this.computeMidOrthoPosition(a.x,l.bottom,h.x,Math.max(h.y,u.top),!0)),d.x=h.x,d.y=c.y),c.y>l.top&&c.y<l.bottom&&(h.x<=l.right&&h.x>=a.x||a.x>=u.left&&a.x<=h.x?(s===90||s===270)&&(c.e(Math.min((a.x+h.x)/2,a.x),a.y),d.e(c.x,h.y)):(s===270||(s===0||s===180)&&h.y<a.y?c.y=Math.min(h.y,s===180?l.top:Math.min(l.top,u.top)):c.y=Math.max(h.y,s===180?l.bottom:Math.max(l.bottom,u.bottom)),d.x=h.x,d.y=c.y))):e===90?h.y>a.y||s===180&&h.x<a.x&&u.bottom>a.y||s===0&&h.x>a.x&&u.bottom>a.y?(c.e(a.x,h.y),d.e((a.x+h.x)/2,h.y),s===270?(c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0),d.x=h.x,d.y=c.y):s===180&&h.x<a.x||s===0&&h.x>a.x?(a.y<u.top?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,u.top,!0):a.y<u.bottom&&(s===180&&a.x<u.left||s===0&&a.x>u.right)?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0):c.y=u.bottom,d.x=h.x,d.y=c.y):s===90&&a.y<u.top&&a.x>u.left&&a.x<u.right&&(a.x<h.x?c.x=Math.min(h.x,u.left):c.x=Math.max(h.x,u.right),c.y=a.y,d.x=c.x)):(c.e(h.x,a.y),d.e(h.x,(a.y+h.y)/2),(s===270||s===0&&h.x<l.left||s===180&&h.x>l.right)&&(s===270&&(u.containsPoint(a)||l.containsPoint(h))?c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1):h.x<a.x&&(s===270||s===0)?c.x=this.computeMidOrthoPosition(l.left,a.y,Math.min(h.x,u.right),h.y,!1):h.x>a.x&&(s===270||s===180)&&(c.x=this.computeMidOrthoPosition(l.right,a.y,Math.max(h.x,u.left),h.y,!1)),d.x=c.x,d.y=h.y),c.x>l.left&&c.x<l.right&&(h.y>=l.top&&h.y<=a.y||a.y<=u.bottom&&a.y>=h.y?(s===0||s===180)&&(c.e(a.x,Math.max((a.y+h.y)/2,a.y)),d.e(h.x,c.y)):(s===180||(s===90||s===270)&&h.x<a.x?c.x=Math.min(h.x,s===90?l.left:Math.min(l.left,u.left)):c.x=Math.max(h.x,s===90?l.right:Math.max(l.right,u.right)),d.x=c.x,d.y=h.y))):h.y<a.y||s===180&&h.x<a.x&&u.top<a.y||s===0&&h.x>a.x&&u.top<a.y?(c.e(a.x,h.y),d.e((a.x+h.x)/2,h.y),s===90?(c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0),d.x=h.x,d.y=c.y):s===180&&h.x<a.x||s===0&&h.x>=a.x?(a.y>u.bottom?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,u.bottom,!0):a.y>u.top&&(s===180&&a.x<u.left||s===0&&a.x>u.right)?c.y=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!0):c.y=u.top,d.x=h.x,d.y=c.y):s===270&&a.y>u.bottom&&a.x>u.left&&a.x<u.right&&(a.x<h.x?c.x=Math.min(h.x,u.left):c.x=Math.max(h.x,u.right),c.y=a.y,d.x=c.x)):(c.e(h.x,a.y),d.e(h.x,(a.y+h.y)/2),(s===90||s===0&&h.x<l.left||s===180&&h.x>l.right)&&(s===90&&(u.containsPoint(a)||l.containsPoint(h))?c.x=this.computeMidOrthoPosition(a.x,a.y,h.x,h.y,!1):h.x<a.x&&(s===90||s===0)?c.x=this.computeMidOrthoPosition(l.left,a.y,Math.min(h.x,u.right),h.y,!1):h.x>a.x&&(s===90||s===180)&&(c.x=this.computeMidOrthoPosition(l.right,a.y,Math.max(h.x,u.left),h.y,!1)),d.x=c.x,d.y=h.y),c.x>l.left&&c.x<l.right&&(h.y<=l.bottom&&h.y>=a.y||a.y>=u.top&&a.y<=h.y?(s===0||s===180)&&(c.e(a.x,Math.min((a.y+h.y)/2,a.y)),d.e(h.x,c.y)):(s===180||(s===90||s===270)&&h.x<a.x?c.x=Math.min(h.x,s===270?l.left:Math.min(l.left,u.left)):c.x=Math.max(h.x,s===270?l.right:Math.max(l.right,u.right)),d.x=c.x,d.y=h.y))),this.vC=s!==r,this.SC=e,this.MC=s,this.addPoint(c.copy()),this.addPoint(d.copy()),P.i(c),P.i(d),I.i(l),I.i(u)}computeMidOrthoPosition(t,e,i,s,n){let o=0;return this.hasCurviness()&&!this.computeSpot(!0,this.fromPort).isSide()&&!this.computeSpot(!1,this.toPort).isSide()&&(o=this.computeCurviness()),n?(e+s)/2+o:(t+i)/2+o}xT(){if(this.diagram===null||!this.isAvoiding||this.diagram.animationManager.isTicking)return!1;let t=this.points.r,e=t.length;if(e<4)return!1;let i=this.diagram.getPositions(!1,this.containingGroup,null);for(let s=1;s<e-2;s++){let n=t[s],o=t[s+1];if(!i.isUnoccupied(Math.min(n.x,o.x),Math.min(n.y,o.y),Math.abs(n.x-o.x),Math.abs(n.y-o.y)))return!0}return!1}findClosestSegment(t){let e=t.x,i=t.y,s=this.getPoint(0),n=this.getPoint(1),o=P.distanceLineSegmentSquared(e,i,s.x,s.y,n.x,n.y),r=0;for(let a=1;a<this.pointsCount-1;a++){s=this.getPoint(a+1);let h=P.distanceLineSegmentSquared(e,i,n.x,n.y,s.x,s.y);n=s,h<o&&(r=a,o=h)}return r}invalidateGeometry(){this.ai()}ai(){this.Ra&&(this.Ra=!1,this.f())}get Ra(){return(this.Mt&128)!==0}set Ra(t){(this.Mt&128)!==0!==t&&(this.Mt=this.Mt^128)}get geometry(){if(!this.Ra){if(this.updateRoute(),this.pointsCount<2)return this.Ra=!0,this.ut;this.ut=this.makeGeometry(),this.Ra=!0}return this.ut}Td(t){if(!t){if(this.Fi===!1)return;let n=this.findMainElement();if(this.Ra&&(n===null||n.geometry!==null))return}this.pointsCount>=2&&(this.ut=this.makeGeometry()),this.Ra=!0;let e=this.path;if(e===null)return;e.ut=this.ut;let i=this.D.r,s=i.length;for(let n=0;n<s;n++){let o=i[n];o!==e&&o.isPanelMain&&o instanceof et&&(o.ut=this.ut)}}IE(t){return this.Qh()&&t.ra.has(this)&&(this.xl.width!==0||this.xl.height!==0)&&(t.animationManager.isAnimating||t.currentTool!==t.toolManager)}makeGeometry(){let t=this.ut,e=this.pointsCount,i=!1,s=this.diagram;s!==null&&this.IE(s)&&(i=!0);let n=0,o=0,r=P.bs(this.getPoint(0)),a=P.bs(r),h=this.Me.r,l=this.computeCurve();if(l===9&&e>=3&&!C.X(this.smoothness,0))if(e===3){let u=this.getPoint(1);n=Math.min(r.x,u.x),o=Math.min(r.y,u.y),u=this.getPoint(2),n=Math.min(n,u.x),o=Math.min(o,u.y)}else if(this.isOrthogonal){for(let u=0;u<e;u++){let c=h[u];a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y)}n=a.x,o=a.y}else{for(let u=3;u<e;u+=3){u+3>=e&&(u=e-1);let c=this.getPoint(u);a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y)}n=a.x,o=a.y}else{for(let u=0;u<e;u++){let c=h[u];a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y)}n=a.x,o=a.y}if(n-=this.gk.x,o-=this.gk.y,r.x-=n,r.y-=o,this.computeShortLength(!0)!==0&&(r=this.tc(r,!0,a)),e===2&&!this.Qh()){let u=P.bs(this.getPoint(1));return u.x-=n,u.y-=o,this.computeShortLength(!1)!==0&&(u=this.tc(u,!1,a)),t.type=1,t.startX=r.x,t.startY=r.y,t.endX=u.x,t.endY=u.y,P.i(u),P.i(r),P.i(a),t}else{t.type=4;let u=Ce.JL(t);if(u.Lu(r.x,r.y,!1,!1),l===9&&e>=3&&!C.X(this.smoothness,0))if(e===3){let c=this.getPoint(1),d=c.x-n,f=c.y-o,p=P.bs(this.getPoint(2));p.x-=n,p.y-=o,this.computeShortLength(!1)!==0&&this.tc(p,!1,a),u.wr(d,f,d,f,p.x,p.y),P.i(p)}else if(this.isOrthogonal){let c=P.z(n,o),d=P.bs(this.getPoint(1)),f=P.z(n,o),p=P.z(n,o),g=this.getPoint(0),y,b=this.smoothness/3;for(let S=1;S<this.pointsCount-1;S++){y=this.getPoint(S);let N=g,D=y,L=this.getPoint(this.EC(y,S,!1));C.X(N.x,D.x)&&C.X(D.x,L.x)||C.X(N.y,D.y)&&C.X(D.y,L.y)||(this.EE(N,D,L,b,f,p),(S===1||S===2&&C.X(g.x,this.getPoint(0).x)&&C.X(g.y,this.getPoint(0).y))&&(d.x=(g.x+y.x)*.5,d.y=(g.y+y.y)*.5),u.wr(d.x-n,d.y-o,f.x-n,f.y-o,y.x-n,y.y-o),c.h(f),d.h(p),g=y)}let v=g.x,w=g.y,k=P.bs(this.getPoint(this.pointsCount-1));this.computeShortLength(!1)!==0&&this.tc(k,!1,P.dn),v=.5*(v+k.x),w=.5*(w+k.y),u.wr(p.x-n,p.y-o,v-n,w-o,k.x-n,k.y-o),P.i(k),P.i(c),P.i(d),P.i(f),P.i(p)}else for(let c=3;c<e;c+=3){let d=this.getPoint(c-2);c+3>=e&&(c=e-1);let f=this.getPoint(c-1),p=P.bs(this.getPoint(c));c===e-1&&this.computeShortLength(!1)!==0&&this.tc(p,!1,P.dn),u.wr(d.x-n,d.y-o,f.x-n,f.y-o,p.x-n,p.y-o),P.i(p)}else if(this.isOrthogonal||e===2){let c=P.bs(this.getPoint(0)),d=P.l(),f=P.bs(c),p=this.computeCorner(),g=1,y=0;for(;g<e;){if(g=this.EC(c,g,g>1),d.h(this.getPoint(g)),g>=e-1){if(!c.equals(d))this.computeShortLength(!1)!==0&&this.tc(d,!1,P.dn),this.Rn(u,-n,-o,c,d,i);else if(y===0)for(g=1;g<e;)f.h(c),d.h(this.getPoint(g++)),this.Rn(u,-n,-o,c,d,i),c.h(d);break}y=this.EC(d,g+1,g<e-3);let b=this.getPoint(y);this.UE(u,-n,-o,c,d,b,c,f,p,i),f.h(d),g=y}P.i(c),P.i(d),P.i(f)}else{let c=this.computeCorner();if(e>2&&c>=.5){let d=P.bs(h[e-1]);this.computeShortLength(!1)!==0&&this.tc(d,!1,P.dn),r.x+=n,r.y+=o;for(let f=1;f<e;f++){let p=f===1?r:h[f-1],g=f===e-1?d:h[f],y=Math.sqrt(p.distanceSquaredPoint(g)),b=c/y;if(b<.5){if(f>1){let v=p.x+(g.x-p.x)*b,w=p.y+(g.y-p.y)*b;u.Au(p.x-n,p.y-o,v-n,w-o)}u.Ys(g.x+(p.x-g.x)*b-n,g.y+(p.y-g.y)*b-o)}else f>1&&u.Au(p.x-n,p.y-o,(p.x+g.x)/2-n,(p.y+g.y)/2-o);f===e-1&&u.Ys(d.x-n,d.y-o)}P.i(d)}else if(e>=2){let d=P.bs(h[e-1]);this.computeShortLength(!1)!==0&&this.tc(d,!1,P.dn);for(let f=1;f<e-1;f++)u.Ys(h[f].x-n,h[f].y-o);u.Ys(d.x-n,d.y-o),P.i(d)}}return Ce.$L(u),P.i(r),P.i(a),t}}kk(t,e,i,s){let n=i-t;if(isNaN(n)||n===1/0||n===-1/0)return NaN;n<0&&(n=-n);let o=s-e;return isNaN(o)||o===1/0||o===-1/0?NaN:(o<0&&(o=-o),C.X(n,0)?o:C.X(o,0)?n:Math.sqrt(n*n+o*o))}EE(t,e,i,s,n,o){isNaN(s)&&(s=this.smoothness/3);let r=t.x,a=t.y,h=e.x,l=e.y,u=i.x,c=i.y,d=s*this.kk(r,a,h,l),f=s*this.kk(h,l,u,c);if(C.X(a,l)&&C.X(h,u)&&(h>r?c>l?(n.x=h-d,n.y=l-d,o.x=h+f,o.y=l+f):(n.x=h-d,n.y=l+d,o.x=h+f,o.y=l-f):c>l?(n.x=h+d,n.y=l-d,o.x=h-f,o.y=l+f):(n.x=h+d,n.y=l+d,o.x=h-f,o.y=l-f)),C.X(r,h)&&C.X(l,c)&&(l>a?u>h?(n.x=h-d,n.y=l-d,o.x=h+f,o.y=l+f):(n.x=h+d,n.y=l-d,o.x=h-f,o.y=l+f):u>h?(n.x=h-d,n.y=l+d,o.x=h+f,o.y=l-f):(n.x=h+d,n.y=l+d,o.x=h-f,o.y=l-f)),C.X(r,h)&&C.X(h,u)||C.X(a,l)&&C.X(l,c)){let p=.5*(r+u),g=.5*(a+c);n.x=p,n.y=g,o.x=p,o.y=g}}tc(t,e,i){let s=this.pointsCount;if(s<2)return t;if(e){let n=this.getPoint(1),o=n.x-i.x,r=n.y-i.y,a=this.kk(t.x,t.y,o,r);if(a===0)return t;let h=s===2?a*.5:a,l=this.computeShortLength(!0);l>h&&(l=h);let u=l*(o-t.x)/a,c=l*(r-t.y)/a;t.x+=u,t.y+=c}else{let n=this.getPoint(s-2),o=n.x-i.x,r=n.y-i.y,a=this.kk(t.x,t.y,o,r);if(a===0)return t;let h=s===2?a*.5:a,l=this.computeShortLength(!1);l>h&&(l=h);let u=l*(t.x-o)/a,c=l*(t.y-r)/a;t.x-=u,t.y-=c}return t}EC(t,e,i){let s=this.pointsCount,n=t;for(;C.X(t.x,n.x)&&C.X(t.y,n.y);){if(e>=s)return s-1;n=this.getPoint(e++)}if(!C.X(t.x,n.x)&&!C.X(t.y,n.y))return e-1;let o=n;for(;C.X(t.x,n.x)&&C.X(n.x,o.x)&&(!i||(t.y>=n.y?n.y>=o.y:n.y<=o.y))||C.X(t.y,n.y)&&C.X(n.y,o.y)&&(!i||(t.x>=n.x?n.x>=o.x:n.x<=o.x));){if(e>=s)return s-1;o=this.getPoint(e++)}return e-2}UE(t,e,i,s,n,o,r,a,h,l){if(C.c(s.y,n.y)&&C.c(n.x,o.x)){let u=Math.min(h,Math.abs(n.x-a.x)/2),c=Math.min(u,Math.abs(o.y-n.y)/2);if(u=c,C.c(u,0)){this.Rn(t,e,i,s,n,l),r.h(n);return}let d=n.x,f=n.y,p=d,g=f;n.x>s.x?(d=n.x-u,o.y>n.y?g=n.y+c:g=n.y-c):(d=n.x+u,o.y>n.y?g=n.y+c:g=n.y-c);let y=P.z(d,f);this.Rn(t,e,i,s,y,l),P.i(y),t.Au(n.x+e,n.y+i,p+e,g+i),r.e(p,g)}else if(C.c(s.x,n.x)&&C.c(n.y,o.y)){let u=Math.min(h,Math.abs(n.y-a.y)/2),c=Math.min(u,Math.abs(o.x-n.x)/2);if(u=c,C.c(c,0)){this.Rn(t,e,i,s,n,l),r.h(n);return}let d=n.x,f=n.y,p=d,g=f;n.y>s.y?(f=n.y-u,o.x>n.x?p=n.x+c:p=n.x-c):(f=n.y+u,o.x>n.x?p=n.x+c:p=n.x-c);let y=P.z(d,f);this.Rn(t,e,i,s,y,l),P.i(y),t.Au(n.x+e,n.y+i,p+e,g+i),r.e(p,g)}else this.Rn(t,e,i,s,n,l),r.h(n)}Rn(t,e,i,s,n,o){if(o||!this.Qh())t.Ys(n.x+e,n.y+i);else{let r=j.rv,a=r/2,h=[],l=0;this.isVisible()&&(l=this.VE(s,n,h));let u=s.x,c=s.y;if(l>0){if(C.c(s.y,n.y))if(s.x<n.x){let d=0;for(;d<l;){let f=Math.max(s.x,Math.min(h[d++]-a,n.x-r));t.Ys(f+e,n.y+i),u=f+e,c=n.y+i;let p=Math.min(f+r,n.x);for(;d<l;){let v=h[d];if(v<p+r)d++,p=Math.min(v+a,n.x);else break}let g=n.y-r+i,y=p+e,b=n.y+i;this.curve===10?t.Lu(y,b,!1,!1):t.wr(u,g,y,g,y,b),u=y,c=b}}else{let d=l-1;for(;d>=0;){let f=Math.min(s.x,Math.max(h[d--]+a,n.x+r));t.Ys(f+e,n.y+i),u=f+e,c=n.y+i;let p=Math.max(f-r,n.x);for(;d>=0;){let v=h[d];if(v>p-r)d--,p=Math.max(v-a,n.x);else break}let g=n.y-r+i,y=p+e,b=n.y+i;this.curve===10?t.Lu(y,b,!1,!1):t.wr(u,g,y,g,y,b),u=y,c=b}}else if(C.c(s.x,n.x))if(s.y<n.y){let d=0;for(;d<l;){let f=Math.max(s.y,Math.min(h[d++]-a,n.y-r));t.Ys(n.x+e,f+i),u=n.x+e,c=f+i;let p=Math.min(f+r,n.y);for(;d<l;){let v=h[d];if(v<p+r)d++,p=Math.min(v+a,n.y);else break}let g=n.x-r+e,y=n.x+e,b=p+i;this.curve===10?t.Lu(y,b,!1,!1):t.wr(g,c,g,b,y,b),u=y,c=b}}else{let d=l-1;for(;d>=0;){let f=Math.min(s.y,Math.max(h[d--]+a,n.y+r));t.Ys(n.x+e,f+i),u=n.x+e,c=f+i;let p=Math.max(f-r,n.y);for(;d>=0;){let v=h[d];if(v>p-r)d--,p=Math.max(v-a,n.y);else break}let g=n.x-r+e,y=n.x+e,b=p+i;this.curve===10?t.Lu(y,b,!1,!1):t.wr(g,c,g,b,y,b),u=y,c=b}}}t.Ys(n.x+e,n.y+i)}}VE(t,e,i){let s=this.diagram;if(s===null||t.equals(e))return 0;let n=s.layers;for(;n.next();){let o=n.value;if(o!==null&&o.visible){let r=o.UM(),a=r.length;for(let h=0;h<a;h++){let l=r[h];if(!(l instanceof j))continue;if(l===this)return i.length>0&&i.sort((d,f)=>d-f),i.length;if(!l.isVisible()||!l.Qh())continue;let u=l.routeBounds;if(!u.isReal()||!this.routeBounds.intersectsRect(u)||this.usesSamePort(l))continue;let c=l.path;c!==null&&c.isVisibleObject()&&this.BE(t,e,i,l)}}}return i.length>0&&i.sort((o,r)=>o-r),i.length}BE(t,e,i,s){let n=C.c(t.y,e.y),o=s.pointsCount,r=s.getPoint(0),a=P.l();for(let h=1;h<o;h++){let l=s.getPoint(h);if(h<o-1){let u=s.getPoint(h+1);if(r.y===l.y&&l.y===u.y){if(l.x>r.x&&u.x>=l.x||l.x<r.x&&u.x<=l.x)continue}else if(r.x===l.x&&l.x===u.x&&(l.y>r.y&&u.y>=l.y||l.y<r.y&&u.y<=l.y))continue}this.zE(t,e,r,l,a)&&(n?i.push(a.x):i.push(a.y)),r=l}P.i(a)}zE(t,e,i,s,n){let o=t.x,r=t.y,a=e.x,h=e.y,l=i.x,u=i.y,c=s.x,d=s.y;if(C.c(o,a)){if(!C.c(r,h)&&C.c(u,d)&&Math.min(r,h)<u&&Math.max(r,h)>u&&Math.min(l,c)<o&&Math.max(l,c)>o&&!C.c(l,c))return n.x=o,n.y=u,!0}else if(C.c(r,h)&&C.c(l,c)&&Math.min(o,a)<l&&Math.max(o,a)>l&&Math.min(u,d)<r&&Math.max(u,d)>r&&!C.c(u,d))return n.x=l,n.y=r,!0;return n.x=0,n.y=0,!1}get firstPickIndex(){return this.pointsCount<=2?0:this.isOrthogonal||!this.bl(this.computeSpot(!0))?1:0}get lastPickIndex(){let t=this.pointsCount;return t===0?0:t<=2?t-1:this.isOrthogonal||!this.bl(this.computeSpot(!1))?t-2:t-1}Qh(){let t=this.curve;return t===11||t===10}yk(t){if(t||this.Qh()){let e=this.diagram;e!==null&&!e.animationManager.isTicking&&!e.ra.has(this)&&(this.xl.width!==0||this.xl.height!==0)&&e.ra.set(this,this.xl.copy())}}invalidateOtherJumpOvers(t){let e=this.layer;if(e===null||!e.visible||e.isTemporary)return;let i=e.diagram;if(i===null||i.animationManager.isTicking)return;let s=!1,n=i.layers;for(;n.next();){let o=n.value;if(o.visible){if(o===e){s=!0;let r=!1,a=o.UM(),h=a.length;for(let l=0;l<h;l++){let u=a[l];u instanceof j&&(u===this?r=!0:r&&this.yv(u,t))}}else if(s){let r=o.UM(),a=r.length;for(let h=0;h<a;h++){let l=r[h];l instanceof j&&this.yv(l,t)}}}}}yv(t,e){if(t===null||!t.Ra||!t.Fi||!t.Qh())return;let i=t.routeBounds;i.isReal()&&(!this.routeBounds.intersectsRect(i)&&!e.intersectsRect(i)||this.usesSamePort(t)||t.ai())}usesSamePort(t){let e=this.pointsCount,i=t.pointsCount;if(e>0&&i>0){let s=this.getPoint(0),n=t.getPoint(0);if(s.equalsApprox(n))return!0;let o=this.getPoint(e-1),r=t.getPoint(i-1);if(o.equalsApprox(r)||s.equalsApprox(r)||o.equalsApprox(n))return!0}else if(this.fromNode===t.fromNode||this.toNode===t.toNode||this.fromNode===t.toNode||this.toNode===t.fromNode)return!0;return!1}isVisible(){if(!super.isVisible())return!1;let t=this.containingGroup,e=!0,i=this.diagram;i!==null&&(e=i.isTreePathToChildren);let s=this.fromNode;if(s!==null){if(this.isTreeLink&&e&&!s.isTreeExpanded)return!1;if(s===t)return!0;let o=s;for(;o!==null;){if(o.labeledLink===this)return!0;o=o.containingGroup}let r=s.findVisibleNode();if(r===null||r===t)return!1}let n=this.toNode;if(n!==null){if(this.isTreeLink&&!e&&!n.isTreeExpanded)return!1;if(n===t)return!0;let o=n;for(;o!==null;){if(o.labeledLink===this)return!0;o=o.containingGroup}let r=n.findVisibleNode();if(r===null||r===t)return!1}return!0}Xe(t){if(super.Xe(t),t&&this.yk(!1),this.ir!==null&&this.ir.Jd(),this.nn!==null){let e=this.nn.iterator;for(;e.next();)e.value.Xe(t)}}get adjusting(){return this.Xf}set adjusting(t){let e=this.Xf;e!==t&&(this.Xf=t,this.t("adjusting",e,t))}computeAdjusting(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?17:this.Xf}get corner(){return this.Qd}set corner(t){let e=this.Qd;e!==t&&(this.Qd=t,this.ai(),this.t("corner",e,t))}get curve(){return this._d}set curve(t){let e=this._d;e!==t&&(this._d=t,(e===9||t===9)&&this.DC(this.xl),this.$t(),this.ai(),this.yk(e===10||e===11||t===10||t===11),this.t("curve",e,t))}get curviness(){return this.tg}set curviness(t){let e=this.tg;e!==t&&(this.tg=t,this.$t(),this.ai(),this.t("curviness",e,t))}get routing(){return this.Wh}set routing(t){let e=this.Wh;e!==t&&(this.Wh=t,this.isAvoiding&&this.diagram!==null&&(this.diagram.lp=!0),this.er=null,this.$t(),this.yk(j.NC(e)||j.NC(t)),this.t("routing",e,t))}get smoothness(){return this.eg}set smoothness(t){let e=this.eg;e!==t&&(this.eg=t,this.ai(),this.t("smoothness",e,t))}Qy(){let t=this.mo;if(t===null)return;let e=this.yo;if(e===null||!isNaN(this.curviness))return;let i=this.po,s=this.wo,n=null,o=null,r=t.ee.r,a=r.length;for(let h=0;h<a;h++){let l=r[h];!(l.mo===t&&l.po===i&&l.yo===e&&l.wo===s)&&!(l.mo===e&&l.po===s&&l.yo===t&&l.wo===i)||(o===null?o=l:(n===null&&(n=[],n.push(o)),n.push(l)))}if(n!==null){let h=t.qD(e,i,s);h===null&&(h=new $n(t,i,e,s),t.KD(h),e.KD(h)),h.on=n;for(let l=0;l<n.length;l++){let u=n[l];u.ir=h}h.Jd()}}Zy(){let t=this.ir;if(t!==null){if(!isNaN(this.curviness))return;this.ir=null;let e=t.on.indexOf(this);e>=0&&(t.on.splice(e,1),t.Jd())}}Lr(){return!0}get key(){let t=this.diagram;if(!(t===null||!t.model.jh()))return t.model.getKeyForLinkData(this.data)}}class $n{Yo;qs;Gy;yC;fk;wC;on;constructor(t,e,i,s){V.Je(this),this.Yo=!1,this.qs=!1,this.Gy=t,this.yC=e,this.fk=i,this.wC=s,this.on=[]}Jd(){if(!this.Yo){let t=this.on;if(t.length>0){let e=t[0].diagram;e!==null&&(e.l2.add(this),this.qs=e.undoManager.isUndoingRedoing)}}this.Yo=!0}S2(){if(this.Yo){this.Yo=!1;let t=this.on;if(t.length>0){let e=t[0],i=e.diagram,s=i===null||i.Qa&&!this.qs;this.qs=!1,e.arrangeBundledLinks(t,s),t.length===1&&(e.ir=null,t.length=0)}t.length===0&&(this.Gy.HD(this),this.fk.HD(this))}}}class Ot{ui;di;ec;ic;we;xe;Bt;Oa;Ia;Ah;E2;Yo;tw;af;U2;V2;constructor(t){V.Je(this),this.Ah=null,this.E2=null,this.Yo=!0,this.tw=!1,this.ui=1,this.di=1,this.ec=-1,this.ic=-1,this.we=t.width,this.xe=t.height,this.Bt=[],this.Oa=0,this.Ia=0,this.af=j.dv,this.U2=this.af*2,this.V2=this.af*2}static rn=0;static sc=1;static sg=999999;static UC=Ot.sg+1;static VC=Ot.sg+2;f1(t){if(t.width<=0||t.height<=0)return;let e=t.x,i=t.y,s=t.x+t.width,n=t.y+t.height;this.ui=Math.floor((e-this.we)/this.we)*this.we,this.di=Math.floor((i-this.xe)/this.xe)*this.xe,this.ec=Math.ceil((s+2*this.we)/this.we)*this.we,this.ic=Math.ceil((n+2*this.xe)/this.xe)*this.xe;let o=1+(Math.ceil((this.ec-this.ui)/this.we)|0),r=1+(Math.ceil((this.ic-this.di)/this.xe)|0);if(this.Bt.length===0||this.Oa<o-1||this.Ia<r-1){let a=[];for(let h=0;h<=o;h++)a[h]=new Uint32Array(r);this.Bt=a,this.Oa=o-1,this.Ia=r-1}this.XE(Ot.UC)}get bounds(){return new I(this.ui,this.di,this.ec-this.ui,this.ic-this.di)}get cellWidth(){return this.we}set cellWidth(t){t>0&&t!==this.we&&(this.we=t,this.f1(this.bounds))}get cellHeight(){return this.xe}set cellHeight(t){t>0&&t!==this.xe&&(this.xe=t,this.f1(this.bounds))}ng(t,e){return this.ui<=t&&t<=this.ec&&this.di<=e&&e<=this.ic}xo(t,e){if(!this.ng(t,e))return Ot.UC;t-=this.ui,t/=this.we,e-=this.di,e/=this.xe;let i=t|0,s=e|0;return this.Bt[i][s]}FO(t,e,i,s){if(!this.ng(t,e))return;let n=(t-this.ui)/this.we|0,o=(e-this.di)/this.xe|0,r=(t+i-this.ui)/this.we|0,a=(e+s-this.di)/this.xe|0,h=Math.min(r,this.Oa),l=Math.min(a,this.Ia);for(let u=n;u<=h;u++){let c=this.Bt[u];if(c.fill)c.fill(Ot.rn,o,l+1);else for(let d=o;d<=l;d++)c[d]=Ot.rn}}XE(t){for(let e=0;e<=this.Oa;e++){let i=this.Bt[e];if(i.fill)i.fill(t);else for(let s=0;s<=this.Ia;s++)i[s]=t}}vT(){for(let t=0;t<=this.Oa;t++){let e=this.Bt[t];for(let i=0;i<=this.Ia;i++)e[i]>=Ot.sc&&(e[i]=Ot.UC)}}GE(t,e){return this.xo(t,e)===Ot.rn}isUnoccupied(t,e,i,s){if(t>this.ec||t+i<this.ui||e>this.ic||e+s<this.di)return!0;let n=(t-this.ui)/this.we|0,o=(e-this.di)/this.xe|0,r=Math.max(0,i)/this.we+1|0,a=Math.max(0,s)/this.xe+1|0;if(n<0&&(r+=n,n=0),o<0&&(a+=o,o=0),r<0||a<0)return!0;let h=Math.min(n+r-1,this.Oa)|0,l=Math.min(o+a-1,this.Ia)|0;for(let u=n;u<=h;u++){let c=this.Bt[u];for(let d=o;d<=l;d++)if(c[d]===Ot.rn)return!1}return!0}maxAvoidsLinksSpaceH(t,e,i,s){if(t>this.ec||e<this.ui||i>this.ic||i<this.di)return 0;let n=(t-this.ui)/this.we|0,o=(e-this.ui)/this.we|0,r=(i-this.di)/this.xe|0,a=s/this.xe+1|0,h;for(h=0;h<a/2;h++){let l=!1;for(let u=n;u<=o;u++)if(this.Bt[u][r+h]===Ot.rn||this.Bt[u][r-h]===Ot.rn){l=!0;break}if(l)return Math.max(0,(2*h-1)*this.xe)}return s}maxAvoidsLinksSpaceV(t,e,i,s){if(t>this.ic||e<this.di||i>this.ec||i<this.ui)return 0;let n=(t-this.di)/this.xe|0,o=(e-this.di)/this.xe|0,r=(i-this.ui)/this.we|0,a=s/this.we+1|0,h;for(h=0;h<a/2;h++){let l=!1;for(let u=n;u<=o;u++)if(this.Bt[r+h][u]===Ot.rn||this.Bt[r-h][u]===Ot.rn){l=!0;break}if(l)return Math.max(0,(2*h-1)*this.we)}return s}YE(t,e,i,s,n,o,r,a){t=t|0,e=e|0;let h=this.Bt[t][e];if(h>=Ot.sc&&h<Ot.sg)for(s?e+=i:t+=i,h+=1;n<=t&&t<=o&&r<=e&&e<=a;){let l=this.Bt[t][e];if(h>=l)break;this.Bt[t][e]=h,h+=1,s?e+=i:t+=i}return s?e:t}bo(t,e,i,s,n,o,r,a){if(t<n||t>o||e<r||e>a)return;let h=this.YE(t,e,i,s,n,o,r,a);if(s)if(i>0)for(let l=e+i;l<h;l+=i)this.bo(t,l,1,!s,n,o,r,a),this.bo(t,l,-1,!s,n,o,r,a);else for(let l=e+i;l>h;l+=i)this.bo(t,l,1,!s,n,o,r,a),this.bo(t,l,-1,!s,n,o,r,a);else if(i>0)for(let l=t+i;l<h;l+=i)this.bo(l,e,1,!s,n,o,r,a),this.bo(l,e,-1,!s,n,o,r,a);else for(let l=t+i;l>h;l+=i)this.bo(l,e,1,!s,n,o,r,a),this.bo(l,e,-1,!s,n,o,r,a)}Pk(t,e,i,s,n,o,r,a,h,l){let u=t|0,c=e|0,d=Ot.rn,f=Ot.sc;for(this.Bt[u][c]=f;d===Ot.rn&&u>r&&u<a&&c>h&&c<l;)f+=1,this.Bt[u][c]=f,o?c+=n:u+=n,d=this.Bt[u][c];return o?c:u}Sk(t,e,i,s,n,o,r,a,h,l){let u=i|0,c=s|0,d=Ot.rn,f=Ot.sg;for(this.Bt[u][c]=f;d===Ot.rn&&u>r&&u<a&&c>h&&c<l;)this.Bt[u][c]=f,o?c+=n:u+=n,d=this.Bt[u][c]}wv(t,e,i,s,n,o){this.tw=!1;let r=t.x,a=t.y;if(!this.ng(r,a))return;r-=this.ui,r/=this.we,a-=this.di,a/=this.xe;let h=i.x,l=i.y;if(!this.ng(h,l))return;if(h-=this.ui,h/=this.we,l-=this.di,l/=this.xe,Math.abs(r-h)<=1&&Math.abs(a-l)<=1){this.tw=!0;return}let u=n.x,c=n.y,d=n.x+n.width,f=n.y+n.height;u-=this.ui,u/=this.we,c-=this.di,c/=this.xe,d-=this.ui,d/=this.we,f-=this.di,f/=this.xe;let p=Math.max(0,Math.min(this.Oa,u|0)),g=Math.min(this.Oa,Math.max(0,d|0)),y=Math.max(0,Math.min(this.Ia,c|0)),b=Math.min(this.Ia,Math.max(0,f|0)),v=0,w=90,k=270,S=this.Bt,N=r|0,D=a|0,L=h|0,M=l|0,A=e===v||e===w?1:-1,F=e===w||e===k;S[N][D]===Ot.rn?(this.Pk(N,D,L,M,A,F,p,g,y,b),this.Pk(N,D,L,M,1,!F,p,g,y,b),this.Pk(N,D,L,M,-1,!F,p,g,y,b)):this.Pk(N,D,L,M,A,F,N,D,N,D),S[L][M]===Ot.rn?(this.Sk(N,D,L,M,s===v||s===w?1:-1,s===w||s===k,p,g,y,b),this.Sk(N,D,L,M,1,!(s===w||s===k),p,g,y,b),this.Sk(N,D,L,M,-1,!(s===w||s===k),p,g,y,b)):this.Sk(N,D,L,M,A,F,L,M,L,M);let O=m.nt();if(o&&this.xv(L,M,s,N,D,O)){(O[0]!==L||O[1]!==M)&&(O.unshift(M),O.unshift(L)),(O[O.length-2]!==N||O[O.length-1]!==D)&&(O.push(N),O.push(D));let E=Ot.sc,B=O[O.length-2],K=O[O.length-1];S[B][K]=E++;for(let z=O.length-4;z>=0;z-=2){B=O[z+2],K=O[z+3];let U=O[z],tt=O[z+1];for(;U>B?B++:U<B?B--:tt>K?K++:tt<K&&K--,S[B][K]=E++,!(B===U&&K===tt););}}else this.bo(N,D,1,!1,p,g,y,b),this.bo(N,D,-1,!1,p,g,y,b),this.bo(N,D,1,!0,p,g,y,b),this.bo(N,D,-1,!0,p,g,y,b);m.Z(O)}xv(t,e,i,s,n,o){let r=this.Bt,a=t,h=e;for(;;){if(a===s&&h===n)return!0;let l=a,u=h;if(i===0)if(l<s)l++;else break;else if(i===90)if(u<n)u++;else break;else if(i===180)if(l>s)l--;else break;else if(u>n)u--;else break;let c=r[l][u];if(c===0||c===Ot.VC)break;a=l,h=u}for(;;){let l=i,u=a,c=h;i===0?c<n?(l=90,c++):c>n&&(l=270,c--):i===90?u<s?(l=0,u++):u>s&&(l=180,u--):i===180?c<n?(l=90,c++):c>n&&(l=270,c--):u<s?(l=0,u++):u>s&&(l=180,u--);let d=r[u][c];if(l!==i&&d!==0&&d!==Ot.VC){if(o.push(a),o.push(h),this.xv(a,h,l,s,n,o))return!0;o.pop(),o.pop()}if(r[a][h]=Ot.VC,i===0){if(a===t)return!1;a--}else if(i===90){if(h===e)return!1;h--}else if(i===180){if(a===t)return!1;a++}else{if(h===e)return!1;h++}}}}class Ji{Ri;kl;Ei;og;constructor(t,e){V.Je(this),this.Ri=t,this.kl=e,this.Ei=[],this.og=!1}toString(){let t=this.Ei,e=this.Ri.toString()+" "+t.length.toString()+":";for(let i=0;i<t.length;i++){let s=t[i];s!==null&&(e+=`
|
|
13
13
|
`+s.toString())}return e}KE(t,e,i,s){let n=e.offsetY;switch(n){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}let o=i;switch(n){case 9:return o>180?270:90;case 6:return o>90&&o<=270?180:0}let r=Math.atan2(t.height,t.width)*180/Math.PI;switch(n){case 3:return o>r&&o<=180+r?180:270;case 5:return o>180-r&&o<=360-r?270:0;case 12:return o>r&&o<=180+r?90:0;case 10:return o>180-r&&o<=360-r?180:90;case 7:return o>90&&o<=180+r?180:o>180+r&&o<=360-r?270:0;case 13:return o>180&&o<=360-r?270:o>r&&o<=180?90:0;case 14:return o>r&&o<=180-r?90:o>180-r&&o<=270?180:0;case 11:return o>180-r&&o<=180+r?180:o>180+r?270:90}return s&&n!==15&&(o-=15,o<0&&(o+=360)),o>r&&o<180-r?90:o>=180-r&&o<=180+r?180:o>180+r&&o<360-r?270:0}Jd(){this.Ei.length=0}gv(t){let e=this.Ei;e.length===0&&(this.HE(),e=this.Ei);for(let i=0;i<e.length;i++){let s=e[i];if(s!==null&&s.ts===t)return s}return null}HE(){if(!this.og){let t=this.og;this.og=!0;let e,i=null,s=this.Ri,n=s instanceof ht?s:null;if(n!==null&&!n.isSubGraphExpanded){if(!n.actualBounds.isReal())return this.og=t,this.Ei;i=n,e=i.findExternalLinksConnected()}else s.isTreeExpanded?e=s.findLinksConnected(this.kl.portId):e=s.findExternalTreeLinksConnected();this.Ei.length=0;let o=0,r=this.kl.getDocumentPoint(T.TopLeft,P.l()),a=this.kl.getDocumentPoint(T.BottomRight,P.l()),h=I.z(r.x,r.y,0,0);h.unionPoint(a),P.i(r),P.i(a);let l=P.z(h.x+h.width/2,h.y+h.height/2),u=this.kl.getDocumentAngle(),c=e.iterator;for(;c.next();){let g=c.value;if(!g.isVisible()||g.fromPort===g.toPort)continue;let y=g.fromPort===this.kl||i!==null&&g.fromNode!==null&&g.fromNode.isMemberOf(i),b=g.computeSpot(y,this.kl);if(!b.isSide())continue;let v;if(y?v=g.toPort:v=g.fromPort,v===null)continue;let w=v.part;if(w===null)continue;let k=w.findVisibleNode();k!==null&&k!==w&&(w=k,v=w.port);let S=g.computeOtherPoint(w,v),N=l.directionPoint(S);u!==0&&(N=C.Ee(N-u));let D=this.KE(h,b,N,g.isOrthogonal),L=0;D===0?(L=4,N>180&&(N-=360)):D===90?(L=8,N>270&&(N-=360)):D===180?L=2:(L=1,N<90&&(N+=360));let M=this.Ei[o];M===void 0?(M=new Jn(g,N,L),this.Ei[o]=M):(M.ts=g,M.Xt=N,M.fi=L),M.Mk.h(S),o++}P.i(l),this.qE();let d=this.Ei.length,f=-1,p=0;for(o=0;o<d;o++){let g=this.Ei[o];g!==void 0&&(g.fi!==f&&(f=g.fi,p=0),g.rg=p,p++)}for(f=-1,p=0,o=d-1;o>=0;o--){let g=this.Ei[o];g!==void 0&&(g.fi!==f&&(f=g.fi,p=g.rg+1),g.Yf=p)}this.jE(this.Ei),this.WE(this.Ei),this.og=t,I.i(h)}return this.Ei}JE(t,e){return t===e?0:t===null?-1:e===null?1:t.fi<e.fi?-1:t.fi>e.fi?1:t.Xt<e.Xt?-1:t.Xt>e.Xt?1:0}qE(){this.Ei.sort(Ji.prototype.JE)}jE(t){let e=this.kl,i=this.Ri.portSpreading,s=P.l(),n=P.l(),o=P.l(),r=P.l();e.getDocumentPoint(T.TopLeft,s),e.getDocumentPoint(T.TopRight,n),e.getDocumentPoint(T.BottomRight,o),e.getDocumentPoint(T.BottomLeft,r);let a=0,h=0,l=0,u=0;if(i===2)for(let v=0;v<t.length;v++){let w=t[v];if(w===null)continue;let k=w.ts.computeThickness();switch(w.fi){case 8:l+=k;break;case 2:u+=k;break;case 1:a+=k;break;default:case 4:h+=k;break}}let c=0,d=0,f=1,p=n,g=o,y=0,b=0;for(let v=0;v<t.length;v++){let w=t[v];if(w===null)continue;if(c!==w.fi){switch(c=w.fi,c){case 8:p=o,g=r;break;case 2:p=r,g=s;break;case 1:p=s,g=n;break;default:case 4:p=n,g=o;break}switch(y=g.x-p.x,b=g.y-p.y,c){case 8:l>Math.abs(y)?(f=Math.abs(y)/l,l=Math.abs(y)):f=1;break;case 2:u>Math.abs(b)?(f=Math.abs(b)/u,u=Math.abs(b)):f=1;break;case 1:a>Math.abs(y)?(f=Math.abs(y)/a,a=Math.abs(y)):f=1;break;default:case 4:h>Math.abs(b)?(f=Math.abs(b)/h,h=Math.abs(b)):f=1;break}d=0}let k=w._h;if(i===2){let S=w.ts.computeThickness();switch(S*=f,k.h(p),c){case 8:k.x=p.x+y/2+l/2-d-S/2;break;case 2:k.y=p.y+b/2+u/2-d-S/2;break;case 1:k.x=p.x+y/2-a/2+d+S/2;break;default:case 4:k.y=p.y+b/2-h/2+d+S/2;break}d+=S}else{let S=.5;i===1&&(S=(w.rg+1)/(w.Yf+1)),k.x=p.x+y*S,k.y=p.y+b*S}}P.i(s),P.i(n),P.i(o),P.i(r)}WE(t){for(let e=0;e<t.length;e++){let i=t[e];i!==null&&(i.bk=this.$E(i,e))}}$E(t,e){let i=t.ts,s=i.fromPort===this.kl,n=0;switch(t.fi){case 1:n=270;break;case 2:n=180;break;case 4:n=0;break;case 8:n=90;break}let o=i.wk(this.Ri,this.kl,T.None,s,n),r=t.rg;if(r<0)return o;let a=t.Yf;if(a<=1||!i.isOrthogonal)return o;let h=t.Mk,l=t._h,u=t.fi===2||t.fi===8;u&&(r=a-1-r);let c=j.iv,d=t.fi===2||t.fi===4,f=r<=0?l:this.Ei[u?e+1:e-1]._h,p=r>=a-1?l:this.Ei[u?e-1:e+1]._h;return(d?h.y>=f.y&&h.y<=p.y:h.x>=f.x&&h.x<=p.x)?o:(d?h.y<l.y:h.x<l.x)?o+r*c:o+(a-1-r)*c}}class Jn{ts;Xt;fi;Mk;rg;Yf;_h;bk;constructor(t,e,i){this.ts=t,this.Xt=e,this.fi=i,this.Mk=new P,this.rg=0,this.Yf=0,this._h=new P,this.bk=0}toString(){return this.ts.toString()+" "+this.Xt.toString()+" "+this.fi.toString()+":"+this.rg.toString()+"/"+this.Yf.toString()+" "+this._h.toString()+" "+this.bk.toString()+" "+this.Mk.toString()}}class Ni{Dh;vh;Fh;Rh;Oh;Ih;c0;a0;f0;h0;constructor(){this.Dh=T.Default,this.vh=T.Default,this.Fh=NaN,this.Rh=NaN,this.Oh=NaN,this.Ih=NaN,this.c0=null,this.a0=null,this.f0=1/0,this.h0=1/0}copy(){let t=new Ni;return t.Dh=this.Dh.N(),t.vh=this.vh.N(),t.Fh=this.Fh,t.Rh=this.Rh,t.Oh=this.Oh,t.Ih=this.Ih,t.c0=this.c0,t.a0=this.a0,t.f0=this.f0,t.h0=this.h0,t}}class Re{t0;e0;i0;_p;q0;j0;constructor(){this.t0=-1/0,this.e0=0,this.i0=P.dn,this._p=0,this.q0="None",this.j0="None"}copy(){let t=new Re;return t.t0=this.t0,t.e0=this.e0,t.i0=this.i0.N(),t._p=this._p,t.q0=this.q0,t.j0=this.j0,t}}class ht extends J{lg;Dt;Ch;Fp;he;li;constructor(t,e){let i;t===void 0||t instanceof Lt||typeof t=="string"?i=t:t&&(e=t),super(i),this.E=this.E|4608,this.lg=new V,this.Dt=null,this.li=new _t,this.li.group=this,this.Ch=new V,this.Fp=null,this.he=null,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),this.E=this.E&-32769;let e=t.findInVisualTree(i=>i instanceof le);e instanceof le?t.Dt=e:t.Dt=null,this.li!==null?(t.li=this.li.copy(),t.li.group=t):(t.li!==null&&(t.li.group=null),t.li=null),this.he!==null&&(t.he=this.he.copy())}Ho(t){super.Ho(t);let e=t.findSubGraphParts(),i=t.memberParts;for(;i.next();){let s=i.value;if(s.f(),s.invalidateLayout(8),s.clearAdornments(),s instanceof J)s.invalidateConnectedLinks(e);else if(s instanceof j){let n=s.labelNodes;for(;n.next();)n.value.invalidateConnectedLinks(e)}}}df(t,e,i,s,n,o,r){if(t===3&&e==="elements"){if(n instanceof le)this.Dt===null?this.Dt=n:this.Dt!==n&&m.o("Cannot insert a second Placeholder into the visual tree of a Group.");else if(n instanceof G){let a=n.findInVisualTree(h=>h instanceof le);a instanceof le&&(this.Dt===null?this.Dt=a:this.Dt!==a&&m.o("Cannot insert a second Placeholder into the visual tree of a Group."))}}else t===4&&e==="elements"&&this.Dt!==null&&(s===this.Dt?this.Dt=null:s instanceof G&&this.Dt.isContainedBy(s)&&(this.Dt=null));super.df(t,e,i,s,n,o,r)}kd(t,e){if(super.kd(t,e),this.isClipping&&this.type!==G.Spot&&this.isSubGraphExpanded){let i=this.resizeObject;i instanceof G&&(i=i.findMainElement()),this.he===null&&(this.he=new I),i.getDocumentBounds(this.he),i instanceof et&&this.he.inflate(-i.strokeWidth,-i.strokeWidth)}}Pa(t,e,i,s){this.hasPlaceholder()&&(this.tr=this.placeholder),super.Pa(t,e,i,s)}ensureBounds(){this.isSubGraphExpanded&&this.memberParts.each(t=>{t.ensureBounds()}),super.ensureBounds()}Qr(){if(!super.Qr())return!1;let t=this.memberParts;for(;t.next();){let e=t.value;if(e instanceof J){if(!e.isVisible())continue;if(e.as())return!1}else if(e instanceof j){if(!e.isVisible())continue;if(e.as()&&e.fromNode!==this&&e.toNode!==this)return!1}}return!0}hasPlaceholder(){return this.Dt!==null&&this.Dt.isVisibleObject()&&this.isSubGraphExpanded}get placeholder(){return this.Dt}get computesBoundsAfterDrag(){return(this.E&2048)!==0}set computesBoundsAfterDrag(t){let e=(this.E&2048)!==0;e!==t&&(this.E=this.E^2048,this.t("computesBoundsAfterDrag",e,t))}get computesBoundsIncludingLinks(){return(this.E&4096)!==0}set computesBoundsIncludingLinks(t){let e=(this.E&4096)!==0;e!==t&&(this.E=this.E^4096,this.t("computesBoundsIncludingLinks",e,t))}get computesBoundsIncludingLocation(){return(this.E&8192)!==0}set computesBoundsIncludingLocation(t){let e=(this.E&8192)!==0;e!==t&&(this.E=this.E^8192,this.t("computesBoundsIncludingLocation",e,t))}get handlesDragDropForMembers(){return(this.E&16384)!==0}set handlesDragDropForMembers(t){let e=(this.E&16384)!==0;e!==t&&(this.E=this.E^16384,this.t("handlesDragDropForMembers",e,t))}get avoidableMembers(){return(this.E&131072)!==0}set avoidableMembers(t){let e=(this.E&131072)!==0;e!==t&&(this.E=this.E^131072,this.t("avoidableMembers",e,t))}get memberParts(){return this.lg.iterator}dC(t){if(this.lg.add(t)){t instanceof ht&&this.Ch.add(t);let i=this.memberAdded;if(i!==null){let s=!0,n=this.diagram;n!==null&&(s=n.G,n.G=!0),i(this,t),n!==null&&(n.G=s)}(!this.isVisible()||!this.isSubGraphExpanded)&&t.Xe(!1)}if(t instanceof j&&!this.computesBoundsIncludingLinks)return;let e=this.Dt;e===null&&(e=this),e.f()}uC(t){if(this.lg.delete(t)){t instanceof ht&&this.Ch.delete(t);let i=this.memberRemoved;if(i!==null){let s=!0,n=this.diagram;n!==null&&(s=n.G,n.G=!0),i(this,t),n!==null&&(n.G=s)}(!this.isVisible()||!this.isSubGraphExpanded)&&t.Xe(!0)}if(t instanceof j&&!this.computesBoundsIncludingLinks)return;let e=this.Dt;e===null&&(e=this),e.f()}rf(){if(this.lg.count>0){let t=this.diagram;if(t!==null){let e=this.lg.copy().iterator;for(;e.next();){let i=e.value;t.remove(i)}}}super.rf()}get layout(){return this.li}set layout(t){let e=this.li;if(e!==t){t!==null&&t.diagram!==null&&t.diagram.layout===t&&m.o("A layout cannot be both the Diagram.layout and a Group.layout: "+t),e!==null&&(e.diagram=null,e.group=null),this.li=t;let i=this.diagram;t!==null&&(t.diagram=i,t.group=this),i!==null&&(i.Jr=!0),this.t("layout",e,t),i!==null&&i.requestUpdate()}}get memberAdded(){return this.vt!==null?this.vt.Wy:null}set memberAdded(t){let e=this.memberAdded;e!==t&&(t!==null&&m.S(t,ht,"memberAdded"),this.yl().Wy=t,this.t("memberAdded",e,t))}get memberRemoved(){return this.vt!==null?this.vt.Jy:null}set memberRemoved(t){let e=this.memberRemoved;e!==t&&(t!==null&&m.S(t,ht,"memberRemoved"),this.yl().Jy=t,this.t("memberRemoved",e,t))}get memberValidation(){return this.vt!==null?this.vt.da:null}set memberValidation(t){let e=this.memberValidation;e!==t&&(t!==null&&m.S(t,ht,"memberValidation"),this.yl().da=t,this.t("memberValidation",e,t))}canAddMembers(t){let e=this.diagram;if(e===null)return!1;let i=e.commandHandler,s=i.xN(t).iterator;for(;s.next();){let n=s.value;if(!i.isValidMember(this,n))return!1}return!0}addMembers(t,e){let i=this.diagram;if(i===null)return!1;let s=i.commandHandler,n=s.xN(t),o=!0,r=n.iterator;for(;r.next();){let a=r.value;!e||s.isValidMember(this,a)?a.containingGroup=this:o=!1}return o}get ungroupable(){return(this.E&256)!==0}set ungroupable(t){let e=(this.E&256)!==0;e!==t&&(this.E=this.E^256,this.t("ungroupable",e,t))}canUngroup(){if(!this.ungroupable)return!1;let t=this.layer;if(t===null||!t.allowUngroup)return!1;let e=t.diagram;return!(e!==null&&!e.allowUngroup)}invalidateConnectedLinks(t){let e=this.ZE();if(super.invalidateConnectedLinks(t),e)return;this.uT(!0);let i=this.findExternalLinksConnected();for(;i.next();){let s=i.value;if(t!==void 0&&t.has(s))continue;let n=s.fromNode;if(n!==null&&n!==this&&n.isMemberOf(this)&&!n.isVisible())n.Ze(s.fromPort),n.Ze(s.toPort),s.$t();else{let o=s.toNode;o!==null&&o!==this&&o.isMemberOf(this)&&!o.isVisible()&&(o.Ze(s.fromPort),o.Ze(s.toPort),s.$t())}}}findExternalLinksConnected(){let t=this.diagram!==null&&this.diagram.d2;if(t&&this.Fp!==null)return this.Fp.iterator;let e=this.findSubGraphParts();e.add(this);let i=new V,s=e.iterator;for(;s.next();){let n=s.value;if(!(n instanceof J))continue;let o=n.linksConnected;for(;o.next();){let r=o.value;e.has(r)||i.add(r)}}return t&&(this.Fp=i),i.iterator}findExternalNodesConnected(){let t=this.findSubGraphParts();t.add(this);let e=new V,i=t.iterator;for(;i.next();){let s=i.value;if(!(s instanceof J))continue;let n=s.linksConnected;for(;n.next();){let o=n.value,r=o.fromNode;r!==null&&(!t.has(r)||r===this)&&e.add(r);let a=o.toNode;a!==null&&(!t.has(a)||a===this)&&e.add(a)}}return e.iterator}XU(){function t(i,s){i!==null&&(s.add(i),t(i.containingGroup,s))}let e=new V;return t(this,e),e}findSubGraphParts(){let t=new V;return pt.ga(t,this,!0,0,!0),t.delete(this),t}Xe(t){super.Xe(t);let e=this.memberParts;for(;e.next();)e.value.Xe(t)}collapseSubGraph(){let t=this.diagram;if(t===null||t.isCollapsingExpanding)return;t.isCollapsingExpanding=!0;let e=this.findSubGraphParts();this.bv(e,t,this),t.isCollapsingExpanding=!1}bv(t,e,i){let s=this.memberParts;for(;s.next();){let n=s.value;if(n.Xe(!1),n instanceof ht&&n.isSubGraphExpanded&&(n.wasSubGraphExpanded=n.isSubGraphExpanded,n.bv(t,e,i)),n instanceof J)n.invalidateConnectedLinks(t),e.Yc(n,i);else if(n instanceof j){let o=n.labelNodes;for(;o.next();)o.value.invalidateConnectedLinks(t)}}this.isSubGraphExpanded=!1}expandSubGraph(){let t=this.diagram;if(t===null||t.isCollapsingExpanding)return;t.isCollapsingExpanding=!0;let e=this.findSubGraphParts();this.kv(e,t,this),t.isCollapsingExpanding=!1}kv(t,e,i){let s=this.memberParts;for(;s.next();){let n=s.value;if(n.Xe(!0),n instanceof ht&&n.wasSubGraphExpanded&&(n.wasSubGraphExpanded=!1,n.kv(t,e,i)),n instanceof J)n.invalidateConnectedLinks(t);else if(n instanceof j){let o=n.labelNodes;for(;o.next();)o.value.invalidateConnectedLinks(t)}}this.isSubGraphExpanded=!0}get isSubGraphExpanded(){return(this.E&512)!==0}set isSubGraphExpanded(t){let e=(this.E&512)!==0;if(e!==t){this.E=this.E^512;let i=this.diagram;this.t("isSubGraphExpanded",e,t);let s=this.subGraphExpandedChanged;if(s!==null){let n=!0;i!==null&&(n=i.G,i.G=!0),s(this),i!==null&&(i.G=n)}if(i!==null&&i.undoManager.isUndoingRedoing){this.Dt!==null&&this.Dt.f(),this.memberParts.each(n=>n.updateAdornments());return}t?this.expandSubGraph():this.collapseSubGraph()}}get wasSubGraphExpanded(){return(this.E&1024)!==0}set wasSubGraphExpanded(t){let e=(this.E&1024)!==0;e!==t&&(this.E=this.E^1024,this.t("wasSubGraphExpanded",e,t))}get subGraphExpandedChanged(){return this.vt!==null?this.vt.$y:null}set subGraphExpandedChanged(t){let e=this.subGraphExpandedChanged;e!==t&&(t!==null&&m.S(t,ht,"subGraphExpandedChanged"),this.yl().$y=t,this.t("subGraphExpandedChanged",e,t))}move(t,e){e===void 0&&(e=!1);let i=e?this.location:this.position,s=i.x,n=i.y,o=t.x,r=t.y;if((s===o||isNaN(s)&&isNaN(o))&&(n===r||isNaN(n)&&isNaN(r)))return;let a=o-(isNaN(s)?0:s),h=r-(isNaN(n)?0:n),l=P.l();super.move(t,e);let u=new V,c=this.findSubGraphParts().iterator;for(;c.next();){let d=c.value;d instanceof j&&(d.suspendsRouting&&u.add(d),!(!d.Fi&&(d.fromNode===this||d.toNode===this))&&(d.suspendsRouting=!0))}for(c.reset();c.next();){let d=c.value;if(d.Lr()||d instanceof J&&d.isLinkLabel)continue;let f=d.position,p=d.location;f.isReal()?(l.x=f.x+a,l.y=f.y+h,d.position=l):p.isReal()&&(l.x=p.x+a,l.y=p.y+h,d.location=l)}for(c.reset();c.next();){let d=c.value;if(!(d instanceof j)||(d.suspendsRouting=u.has(d),!d.Fi&&(d.fromNode===this||d.toNode===this)))continue;let f=d.position;l.x=f.x+a,l.y=f.y+h,l.isReal()?d.move(l):d.$t()}P.i(l)}ZE(){return(this.E&65536)!==0}uT(t){(this.E&65536)!==0!==t&&(this.E=this.E^65536)}get Lh(){return(this.E&32768)!==0}set Lh(t){(this.E&32768)!==0!==t&&(this.E=this.E^32768)}}class le extends ${Qt;ag;constructor(t){super(),this.Qt=Dt.im,this.ag=new I(NaN,NaN,NaN,NaN),t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Qt=this.Qt.N(),t.ag=this.ag.copy()}ka(t){if(this.background===null)return!1;let e=this.naturalBounds;return I.contains(0,0,e.width,e.height,t.x,t.y)}bd(t,e,i,s){let n=this.part;if((n===null||!(n instanceof ht)&&!(n instanceof vt))&&m.o("Placeholder is not inside a Group or Adornment."),n instanceof ht){let o=this.computeBorder(this.ag),r=this.minSize,a=isFinite(r.width)?Math.max(r.width,o.width):o.width,h=isFinite(r.height)?Math.max(r.height,o.height):o.height,l=this.Ke;l.Hn(a||0,h||0),this.ro(0,0,l.width,l.height);let u=n.memberParts,c=!1;for(;u.next();)if(u.value.isVisible()){c=!0;break}let d=n.diagram;if(c&&d!==null&&!d.animationManager.LM(n)&&!isNaN(o.x)&&!isNaN(o.y)){let f=P.l();f.setRectSpot(o,n.locationSpot),n.location=f,P.i(f)}}else{let o=n,r=this.Ke,a=this.Qt,h=a.left+a.right,l=a.top+a.bottom,u=o.adornedObject,c=u.getDocumentAngle();o.angle=c;let d=0;u instanceof et&&(d=u.strokeWidth);let f=u.getDocumentScale(),p=u.naturalBounds,g=(p.width+d)*f,y=(p.height+d)*f;if(o.type!==G.Link){let b=o.category==="Selection"?T.TopLeft:o.locationSpot,v=u.getDocumentPoint(b,P.l());o.location=v,P.i(v)}if(!isNaN(g)&&!isNaN(y))r.Hn(g+h||0,y+l||0),this.ro(-a.left,-a.top,r.width,r.height);else{let b=u.getDocumentPoint(T.TopLeft,P.l()),v=I.z(b.x,b.y,0,0);v.unionPoint(u.getDocumentPoint(T.BottomRight,b)),v.unionPoint(u.getDocumentPoint(T.TopRight,b)),v.unionPoint(u.getDocumentPoint(T.BottomLeft,b)),r.Hn(v.width+h||0,v.height+l||0),this.ro(-a.left,-a.top,r.width,r.height),P.i(b),I.i(v)}}}Pa(t,e,i,s){this.actualBounds.e(t,e,i,s)}computeBorder(t){let e=this.part,i=e.diagram;if(i===null||i.animationManager.isAnimating)return t;if(e instanceof ht&&!e.layer.isTemporary&&e.computesBoundsAfterDrag&&this.ag.isReal()){let r=i.toolManager.findTool("Dragging");if(r===i.currentTool&&r.pR(e,this.ag,t))return t}let s=I.l(),n=this.computeMemberBounds(s),o=this.Qt;return e instanceof ht&&!e.isSubGraphExpanded?t.e(n.x-o.left,n.y-o.top,0,0):t.e(n.x-o.left,n.y-o.top,Math.max(n.width+o.left+o.right,0),Math.max(n.height+o.top+o.bottom,0)),I.i(s),e instanceof ht&&e.computesBoundsIncludingLocation&&e.location.isReal()&&t.unionPoint(e.location),t}computeMemberBounds(t){if(!(this.part instanceof ht))return t.e(0,0,0,0),t;let e=this.part,i=1/0,s=1/0,n=-1/0,o=-1/0,r=e.memberParts;for(;r.next();){let a=r.value;if(!a.isVisible()||a instanceof j&&(!e.computesBoundsIncludingLinks||a.Xo()||a.fromNode===e||a.toNode===e))continue;let h=a.actualBounds;h.left<i&&(i=h.left),h.top<s&&(s=h.top),h.right>n&&(n=h.right),h.bottom>o&&(o=h.bottom)}if(!isFinite(i)||!isFinite(s)){let a=e.location;t.e(a.x,a.y,0,0)}else t.e(i,s,n-i,o-s);return t}get padding(){return this.Qt}set padding(t){typeof t=="number"&&(t=new Dt(t));let e=this.Qt;e.equals(t)||(t=t.N(),this.Qt=t,this.t("padding",e,t),this.f())}}class _t{a;Ah;hg;Ar;cg;fg;Uo;Pl;ug;dg;ko;constructor(t){V.Je(this),this.a=null,this.Ah=null,this.hg=!0,this.Ar=!0,this.cg=!1,this.fg=new P(0,0),this.Uo=!0,this.Pl=null,this.ug=null,this.dg=!1,this.ko=null,t&&Object.assign(this,t)}cloneProtected(t){t.hg=this.hg,t.Ar=this.Ar,t.cg=this.cg,t.fg.h(this.fg),t.Uo=this.Uo,t.Pl=this.Pl,t.ug=this.ug,t.dg=!0}copy(){let t=new this.constructor;return this.cloneProtected(t),t}fe(t){m.ur(this,t)}toString(){let t=m.Kn(this.constructor);return t+="(",this.group!==null&&(t+=" in "+this.group),this.diagram!==null&&(t+=" for "+this.diagram),t+=")",t}get diagram(){return this.a}set diagram(t){this.a=t}get group(){return this.Ah}set group(t){this.Ah!==t&&(this.Ah=t,t!==null&&(this.a=t.diagram))}get isOngoing(){return this.hg}set isOngoing(t){this.hg!==t&&(m.s(t,"boolean",_t,"isOngoing"),this.hg=t)}get isInitial(){return this.Ar}set isInitial(t){m.s(t,"boolean",_t,"isInitial"),this.Ar=t,t||(this.dg=!0)}get isViewportSized(){return this.cg}set isViewportSized(t){this.cg!==t&&(m.s(t,"boolean",_t,"isViewportSized"),this.cg=t,t&&this.p())}get isRouting(){return this.Uo}set isRouting(t){this.Uo!==t&&(m.s(t,"boolean",_t,"isRouting"),this.Uo=t)}get isRealtime(){return this.Pl}set isRealtime(t){this.Pl!==t&&(t!==null&&m.s(t,"boolean",_t,"isRealtime"),this.Pl=t)}get isValidLayout(){return this.dg}set isValidLayout(t){if(this.dg!==t&&(m.s(t,"boolean",_t,"isValidLayout"),this.dg=t,!t)){let e=this.diagram;e!==null&&(e.Jr=!0)}}invalidateLayout(){if(!this.isValidLayout)return;let t=this.diagram;if(t===null||t.undoManager.isUndoingRedoing)return;let e=t.animationManager;e.isTicking||(e.defaultAnimation.isAnimating&&e.stopAnimation(),(this.isOngoing&&t.Qa||this.isInitial&&!t.Qa)&&(this.isValidLayout=!1,t.requestUpdate()))}p(){this.invalidateLayout()}get network(){return this.ko}set network(t){this.ko!==t&&(this.ko=t,t!==null&&(t.layout=this))}createNetwork(){return new Ee(this)}makeNetwork(t){let e=this.createNetwork();return t instanceof Y?(e.addParts(t.nodes,!0),e.addParts(t.links,!0)):t instanceof ht?e.addParts(t.memberParts):e.addParts(t.iterator),e}updateParts(){this.isValidLayout=!0;let t=this.diagram;if(t===null&&this.network!==null){let e=this.network.vertexes.iterator;for(;e.next();){let i=e.value.node;if(i!==null&&(t=i.diagram,t!==null))break}}try{t!==null&&t.startTransaction("Layout"),this.commitLayout()}finally{t!==null&&t.commitTransaction("Layout")}}commitLayout(){if(this.network===null)return;let t=this.network.vertexes.iterator;for(;t.next();)t.value.commit();if(this.isRouting){let e=this.network.edges.iterator;for(;e.next();)e.value.commit()}}doLayout(t){let e=new V;if(t instanceof Y?(this.Ea(e,t.nodes,!0,this.Lh,!0,!1,!0),this.Ea(e,t.parts,!0,this.Lh,!0,!1,!0)):t instanceof ht?this.Ea(e,t.memberParts,!1,this.Lh,!0,!1,!0):e.addAll(t.iterator),e.count>0){let i=this.diagram;i!==null&&i.startTransaction("Layout"),this.doMinimalNoNetworkLayout(e),i!==null&&i.commitTransaction("Layout")}this.isValidLayout=!0}doMinimalNoNetworkLayout(t){let e=t.count,i=Math.ceil(Math.sqrt(e));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);let s=this.arrangementOrigin.x,n=this.arrangementOrigin.y,o=s,r=n,a=0,h=0,l=t.iterator;for(;l.next();){let u=l.value;u.ensureBounds();let c=u.measuredBounds,d=c.width,f=c.height;u.moveTo(o,r),u instanceof ht&&(u.Lh=!1),o+=Math.max(d,50)+20,h=Math.max(h,Math.max(f,50)),a>=i-1?(a=0,o=s,r+=h+20,h=0):a++}}Lh(t){return!!(!t.location.isReal()&&!t.position.isReal()||t instanceof ht&&t.Lh)}Ea(t,e,i,s,n,o,r){let a=e.iterator;for(;a.next();){let h=a.value;if(!(i&&!h.isTopLevel)&&!(s!==null&&!s(h))&&h.canLayout())if(n&&h instanceof J){if(h.isLinkLabel)continue;h instanceof ht&&h.layout===null?this.Ea(t,h.memberParts,!1,s,n,o,r):(h.ensureBounds(),t.add(h))}else o&&h instanceof j?t.add(h):r&&h.Di()&&!(h instanceof J)&&(h.ensureBounds(),t.add(h))}}getLayoutBounds(t,e){let i=this.boundsComputation;return i!==null?(e||(e=new I),i(t,this,e)):!e&&t.margin.equalTo(0,0,0,0)?t.actualBounds:(e||(e=new I),e.set(t.actualBounds),e.addMargin(t.margin),e)}get boundsComputation(){return this.ug}set boundsComputation(t){this.ug!==t&&(t!==null&&m.S(t,_t,"boundsComputation"),this.ug=t,this.p())}collectParts(t){let e=new V;return t instanceof Y?(this.Ea(e,t.nodes,!0,null,!0,!0,!0),this.Ea(e,t.links,!0,null,!0,!0,!0),this.Ea(e,t.parts,!0,null,!0,!0,!0)):t instanceof ht?this.Ea(e,t.memberParts,!1,null,!0,!0,!0):this.Ea(e,t.iterator,!1,null,!0,!0,!0),e}get arrangementOrigin(){return this.fg}set arrangementOrigin(t){this.fg.equals(t)||(this.fg.h(t),this.p())}initialOrigin(t){let e=this.group;if(e!==null)if(e.hasPlaceholder()){let i=e.placeholder,s=i.getDocumentPoint(T.TopLeft);(isNaN(s.x)||isNaN(s.y))&&s.set(t);let n=i.padding;return s.x+=n.left,s.y+=n.top,s}else{let i=e.position.copy();return(isNaN(i.x)||isNaN(i.y))&&i.set(t),i}return t}}class Ee{li;Po;On;ew;iw;constructor(t){V.Je(this),this.li=t,this.Po=new V,this.On=new V,this.ew=new Mt,this.iw=new Mt}clear(){if(this.Po){let t=this.Po.iterator;for(;t.next();)t.value.clear()}if(this.On){let t=this.On.iterator;for(;t.next();)t.value.clear()}this.Po=new V,this.On=new V,this.ew=new Mt,this.iw=new Mt}toString(t){t===void 0&&(t=0);let e="LayoutNetwork"+(this.layout!==null?"("+this.layout.toString()+")":"");if(t<=0)return e;if(e+=" vertexes: "+this.Po.count+" edges: "+this.On.count,t>1){let i=this.Po.iterator;for(;i.next();){let n=i.value;e+=`
|
|
14
14
|
`+n.toString(t-1)}let s=this.On.iterator;for(;s.next();){let n=s.value;e+=`
|
|
15
15
|
`+n.toString(t-1)}}return e}get layout(){return this.li}set layout(t){t!==null&&(this.li=t)}get vertexes(){return this.Po}get edges(){return this.On}createVertex(){return new Ie(this)}createEdge(){return new ei(this)}addParts(t,e,i){if(t===null)return;e===void 0&&(e=!1),m.s(e,"boolean",Ee,"addParts:toplevelonly"),i===void 0&&(i=null),i===null&&(i=n=>{if(n instanceof J)return!n.isLinkLabel;if(n instanceof j){let o=n.fromNode;if(o===null||o.isLinkLabel)return!1;let r=n.toNode;return!(r===null||r.isLinkLabel)}return!1});let s=t.iterator;for(;s.next();){let n=s.value;if(n instanceof J&&!(e&&!n.isTopLevel)&&n.canLayout()&&i(n))if(n instanceof ht&&n.layout===null)this.addParts(n.memberParts,!1);else{if(this.findVertex(n)!==null)continue;let o=this.createVertex();o.node=n,this.addVertex(o)}}for(s.reset();s.next();){let n=s.value;if(!(n instanceof j)||e&&!n.isTopLevel||!n.canLayout()||!i(n)||this.findEdge(n)!==null)continue;let o=n.fromNode,r=n.toNode;if(o===null||r===null||o===r)continue;let a=this.findGroupVertex(o),h=this.findGroupVertex(r);this.linkVertexes(a,h,n)}}findGroupVertex(t){let e=t.findVisibleNode();if(e===null)return null;let i=this.findVertex(e);if(i!==null)return i;let s=e.containingGroup;for(;s!==null;){if(i=this.findVertex(s),i!==null)return i;s=s.containingGroup}return null}addVertex(t){this.Po.add(t);let e=t.node;e!==null&&this.ew.set(e,t),t.network=this}addNode(t){let e=this.findVertex(t);return e===null&&(e=this.createVertex(),e.node=t,this.addVertex(e)),e}deleteVertex(t){if(this.Pv(t)){let e=t.sr;for(let i=e.count-1;i>=0;i--){let s=e.elt(i);this.deleteEdge(s)}e=t.nr;for(let i=e.count-1;i>=0;i--){let s=e.elt(i);this.deleteEdge(s)}}}Pv(t){let e=this.Po.delete(t);if(e){let i=t.node;i!==null&&this.ew.delete(i)}return e}deleteNode(t){let e=this.findVertex(t);e!==null&&this.deleteVertex(e)}findVertex(t){return this.ew.get(t)}addEdge(t){this.BC(t);let e=t.toVertex;e!==null&&e.addSourceEdge(t);let i=t.fromVertex;i!==null&&i.addDestinationEdge(t)}BC(t){this.On.add(t);let e=t.link;e!==null&&this.findEdge(e)===null&&this.iw.set(e,t),t.network=this}addLink(t){let e=t.fromNode,i=t.toNode,s=this.findEdge(t);return s===null?(s=this.createEdge(),s.link=t,e!==null&&(s.fromVertex=this.addNode(e)),i!==null&&(s.toVertex=this.addNode(i)),this.addEdge(s)):(e!==null?s.fromVertex=this.addNode(e):s.fromVertex=null,i!==null?s.toVertex=this.addNode(i):s.toVertex=null),s}deleteEdge(t){let e=t.toVertex;e!==null&&e.deleteSourceEdge(t);let i=t.fromVertex;i!==null&&i.deleteDestinationEdge(t),this.zC(t)}zC(t){let e=this.On.delete(t);if(e){let i=t.link;i!==null&&this.iw.delete(i)}return e}deleteLink(t){let e=this.findEdge(t);e!==null&&this.deleteEdge(e)}findEdge(t){return this.iw.get(t)}linkVertexes(t,e,i){if(t===null||e===null)return null;if(t.network===this&&e.network===this){let s=this.createEdge();return s.link=i,s.fromVertex=t,s.toVertex=e,this.addEdge(s),s}return null}reverseEdge(t){let e=t.fromVertex,i=t.toVertex;e===null||i===null||(e.deleteDestinationEdge(t),i.deleteSourceEdge(t),t.reverseEdge(),e.addSourceEdge(t),i.addDestinationEdge(t))}deleteSelfEdges(){let t=m.nt(),e=this.On.iterator;for(;e.next();){let s=e.value;s.fromVertex===s.toVertex&&t.push(s)}let i=t.length;for(let s=0;s<i;s++)this.deleteEdge(t[s]);m.Z(t)}deleteArtificialVertexes(){let t=m.nt(),e=this.Po.iterator;for(;e.next();){let o=e.value;o.node===null&&o.data===null&&t.push(o)}let i=t.length;for(let o=0;o<i;o++)this.deleteVertex(t[o]);let s=m.nt(),n=this.On.iterator;for(;n.next();){let o=n.value;o.link===null&&o.data===null&&s.push(o)}i=s.length;for(let o=0;o<i;o++)this.deleteEdge(s[o]);m.Z(t),m.Z(s)}deleteUselessEdges(){let t=m.nt(),e=this.On.iterator;for(;e.next();){let s=e.value;(s.fromVertex===null||s.toVertex===null)&&t.push(s)}let i=t.length;for(let s=0;s<i;s++)this.deleteEdge(t[s]);m.Z(t)}isSingleton(t){return!(t.sr.count>0||t.nr.count>0)}splitIntoSubNetworks(t){t===void 0&&(t=!0),t&&(this.deleteArtificialVertexes(),this.deleteUselessEdges(),this.deleteSelfEdges());let e=new q,i=!0;for(;i;){i=!1;let s=this.Po.iterator;for(;s.next();){let n=s.value;if(this.isSingleton(n))continue;let o=this.layout.createNetwork();e.add(o),this.QE(o,n),i=!0;break}}return e.sort((s,n)=>s===null||n===null||s===n?0:n.vertexes.count-s.vertexes.count),e}QE(t,e){if(e===null)return;let i=new q;for(i.add(e);i.count>0;){let s=i.first();if(i.removeAt(0),!s||s.network===t)continue;this.Pv(s),t.addVertex(s);let n=s.sourceEdges;for(;n.next();){let o=n.value;o.network!==t&&(this.zC(o),t.BC(o),o.fromVertex&&i.add(o.fromVertex))}for(n=s.destinationEdges;n.next();){let o=n.value;o.network!==t&&(this.zC(o),t.BC(o),o.toVertex&&i.add(o.toVertex))}}}findAllParts(){let t=new V,e=this.Po.iterator;for(;e.next();){let s=e.value;s.node&&t.add(s.node)}let i=this.On.iterator;for(;i.next();){let s=i.value;s.link&&t.add(s.link)}return t}}class Ie{ko;te;Ri;Ui;es;sr;nr;constructor(t){V.Je(this),this.ko=t,this.Ui=new I(0,0,10,10),this.es=new P(5,5),this.te=null,this.Ri=null,this.sr=new q,this.nr=new q}clear(){this.te=null,this.Ri=null,this.sr=new q,this.nr=new q}toString(t){t===void 0&&(t=0);let e="LayoutVertex#"+V.xs(this);if(t>0&&(e+=this.node!==null?"("+this.node.toString()+")":"",t>1)){let i="",s=!0,n=this.sr.iterator;for(;n.next();){let r=n.value;s?s=!1:i+=",",i+=r.toString(0)}let o="";for(s=!0,n=this.nr.iterator;n.next();){let r=n.value;s?s=!1:o+=",",o+=r.toString(0)}e+=" sources: "+i+" destinations: "+o}return e}get So(){return this.sr.DL}get or(){return this.nr.DL}get data(){return this.te}set data(t){if(this.te=t,t!==null&&t.bounds){let e=t.bounds,i=e.x,s=e.y,n=e.width,o=e.height;this.es.e(n/2,o/2),this.Ui.e(i,s,n,o)}}get node(){return this.Ri}set node(t){if(this.Ri!==t){if(this.Ri=t,t===null)return;t.ensureBounds();let e=this.network.layout,i=I.l(),s=e.getLayoutBounds(t,i),n=s.x,o=s.y,r=s.width,a=s.height;if(isNaN(n)&&(n=0),isNaN(o)&&(o=0),this.Ui.e(n,o,r,a),I.i(i),!(t instanceof ht)){let h=t.locationObject.getDocumentPoint(T.Center);if(h.isReal()){this.es.e(h.x-n,h.y-o);return}}this.es.e(r/2,a/2)}}get bounds(){return this.Ui}set bounds(t){this.Ui.equals(t)||this.Ui.h(t)}get focus(){return this.es}set focus(t){this.es.equals(t)||this.es.h(t)}get centerX(){return this.Ui.x+this.es.x}set centerX(t){let e=this.Ui;e.x+this.es.x!==t&&(e.x=t-this.es.x)}get centerY(){return this.Ui.y+this.es.y}set centerY(t){let e=this.Ui;e.y+this.es.y!==t&&(e.y=t-this.es.y)}get focusX(){return this.es.x}set focusX(t){let e=this.es;e.x!==t&&(e.x=t)}get focusY(){return this.es.y}set focusY(t){let e=this.es;e.y!==t&&(e.y=t)}get x(){return this.Ui.x}set x(t){let e=this.Ui;e.x!==t&&(e.x=t)}get y(){return this.Ui.y}set y(t){let e=this.Ui;e.y!==t&&(e.y=t)}get width(){return this.Ui.width}set width(t){let e=this.Ui;e.width!==t&&(e.width=t)}get height(){return this.Ui.height}set height(t){let e=this.Ui;e.height!==t&&(e.height=t)}commit(){let t=this.te;if(t!==null){let i=this.bounds,s=t.bounds;m.$(s)?(s.x=i.x,s.y=i.y,s.width=i.width,s.height=i.height):t.bounds=i.copy();return}let e=this.node;if(e!==null){let i=this.bounds;if(!(e instanceof ht)){let s=I.l();e.ensureBounds();let n=this.network.layout.getLayoutBounds(e,s),o=e.locationObject.getDocumentPoint(T.Center);if(n.isReal()&&o.isReal()){e.moveTo(i.x+this.focusX-(o.x-n.x)+e.margin.left,i.y+this.focusY-(o.y-n.y+e.margin.top)),I.i(s);return}I.i(s)}e.moveTo(i.x+e.margin.left,i.y+e.margin.top)}}addSourceEdge(t){t!==null&&(this.sr.has(t)||this.sr.add(t))}deleteSourceEdge(t){t!==null&&this.sr.delete(t)}addDestinationEdge(t){t!==null&&(this.nr.has(t)||this.nr.add(t))}deleteDestinationEdge(t){t!==null&&this.nr.delete(t)}get network(){return this.ko}set network(t){this.ko=t}get sourceVertexes(){let t=new V,e=this.sourceEdges;for(;e.next();){let i=e.value;i.fromVertex&&t.add(i.fromVertex)}return t.iterator}get destinationVertexes(){let t=new V,e=this.destinationEdges;for(;e.next();){let i=e.value;i.toVertex&&t.add(i.toVertex)}return t.iterator}get vertexes(){let t=new V,e=this.sourceEdges;for(;e.next();){let i=e.value;i.fromVertex&&t.add(i.fromVertex)}for(e=this.destinationEdges;e.next();){let i=e.value;i.toVertex&&t.add(i.toVertex)}return t.iterator}get sourceEdges(){return this.sr.iterator}get destinationEdges(){return this.nr.iterator}get edges(){let t=new q,e=this.sourceEdges;for(;e.next();){let i=e.value;t.add(i)}for(e=this.destinationEdges;e.next();){let i=e.value;t.add(i)}return t.iterator}get edgesCount(){return this.sr.count+this.nr.count}static standardComparer(t,e){let i=t.Ri,s=e.Ri;if(i)if(s){let n=i.text,o=s.text;return n<o?-1:n>o?1:0}else return 1;else return s!==null?-1:0}static smartComparer(t,e){if(t!==null)if(e!==null){let i=t.Ri,s=e.Ri;if(i!==null)if(s!==null){let n=i.text.toLocaleLowerCase(),o=s.text.toLocaleLowerCase(),r=n.split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),a=o.split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),h=0;for(;h<r.length;h++)if(a[h]!==""&&a[h]!==void 0){let l=parseFloat(r[h]),u=parseFloat(a[h]);if(isNaN(l))if(isNaN(u)){if(r[h].localeCompare(a[h])!==0)return r[h].localeCompare(a[h]);continue}else return 1;else{if(isNaN(u))return-1;if(l-u!==0)return l-u;continue}}else{if(r[h]==="")continue;return 1}return a[h]!==""&&a[h]!==void 0?-1:0}else return 1;else return s!==null?-1:0}else return 1;else return e!==null?-1:0}}class ei{ko;te;ts;is;ss;constructor(t){V.Je(this),this.ko=t,this.te=null,this.ts=null,this.is=null,this.ss=null}clear(){this.te=null,this.ts=null,this.is=null,this.ss=null}toString(t){t===void 0&&(t=0);let e="LayoutEdge#"+V.xs(this);return t>0&&(e+=this.ts!==null?"("+this.ts.toString()+")":"",t>1&&(e+=" "+(this.is?this.is.toString():"null")+" --> "+(this.ss?this.ss.toString():"null"))),e}reverseEdge(){let t=this.is;this.is=this.ss,this.ss=t}commit(){}getOtherVertex(t){return this.ss===t?this.is:this.is===t?this.ss:null}get network(){return this.ko}set network(t){this.ko=t}get data(){return this.te}set data(t){this.te!==t&&(this.te=t)}get link(){return this.ts}set link(t){this.ts!==t&&(this.ts=t)}get fromVertex(){return this.is}set fromVertex(t){this.is!==t&&(this.is=t)}get toVertex(){return this.ss}set toVertex(t){this.ss!==t&&(this.ss=t)}}var Zi=(x=>(x[x.Position=0]="Position",x[x.Location=1]="Location",x))(Zi||{}),Qi=(x=>(x[x.LeftToRight=10]="LeftToRight",x[x.RightToLeft=11]="RightToLeft",x))(Qi||{}),_i=(x=>(x[x.Forwards=20]="Forwards",x[x.Reverse=21]="Reverse",x[x.Ascending=22]="Ascending",x[x.Descending=23]="Descending",x))(_i||{});class je extends _t{gg;mg;Ro;In;de;He;Si;Mi;constructor(t){super(),this.isViewportSized=!0,this.gg=NaN,this.mg=NaN,this.Ro=new st(NaN,NaN).k(),this.In=new st(10,10).k(),this.de=1,this.He=10,this.Si=22,this.Mi=je.standardComparer,t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.gg=this.gg,t.mg=this.mg,t.Ro.h(this.Ro),t.In.h(this.In),t.de=this.de,t.He=this.He,t.Si=this.Si,t.Mi=this.Mi}fe(t){t in _i?this.sorting=t:t in Qi?this.arrangement=t:t in Zi?this.alignment=t:super.fe(t)}doLayout(t){this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);let e=this.collectParts(t),i=this.diagram,s=e.copy().iterator;for(;s.next();){let f=s.value;if(f.Lr()&&(f.fromNode!==null||f.toNode!==null)){e.delete(f);continue}if(f.ensureBounds(),f instanceof ht){let p=f.memberParts;for(;p.next();){let g=p.value;e.delete(g)}}}let n=e.toArray();if(n.length===0)return;switch(this.sorting){case 20:break;case 21:n.reverse();break;case 22:n.sort(this.comparer);break;case 23:n.sort(this.comparer),n.reverse();break}let o=this.wrappingColumn;isNaN(o)&&(o=0);let r=this.wrappingWidth;if(isNaN(r)&&i!==null){let f=i.viewportBounds,p=i.padding;r=Math.max(f.width-p.left-p.right,0)}else r=Math.max(this.wrappingWidth,0);o<=0&&r<=0&&(o=1);let a=this.spacing.width;isFinite(a)||(a=0);let h=this.spacing.height;isFinite(h)||(h=0),i!==null&&i.startTransaction("Layout");let l=[];switch(this.alignment){case 0:this._E(n,r,o,a,h,l);break;case 1:this.t3(n,r,o,a,h,l);break}let u=0,c=0,d=0;for(let f=0;f<l.length;f++){let p=l[f];u=Math.min(u,p.x),c=Math.min(c,p.y),d=Math.max(d,p.x+p.width)}this.arrangement===11?this.commitLayers(l,new P(u+a/2-(d+u),c-h/2)):this.commitLayers(l,new P(u-a/2,c-h/2)),i!==null&&i.commitTransaction("Layout"),this.isValidLayout=!0}_E(t,e,i,s,n,o){let r=I.l(),a=Math.max(this.cellSize.width,1);if(!isFinite(a)){a=0;for(let y=0;y<t.length;y++){let b=t[y],v=this.getLayoutBounds(b,r);a=Math.max(a,v.width)}}a+=s,a=Math.max(a,1);let h=Math.max(this.cellSize.height,1);if(!isFinite(h)){h=0;for(let y=0;y<t.length;y++){let b=t[y],v=this.getLayoutBounds(b,r);h=Math.max(h,v.height)}}h+=n,h=Math.max(h,1);let l=this.arrangement,u=this.arrangementOrigin.x,c=this.arrangementOrigin.y,d=u,f=c,p=0,g=0;for(let y=0;y<t.length;y++){let b=t[y],v=this.getLayoutBounds(b,r),w=Math.ceil((v.width+s)/a),k=Math.ceil((v.height+n)/h),S=w*a,N=k*h,D=0;switch(l){case 11:D=Math.abs(d-v.width);break;default:D=d+v.width;break}(i>0&&p>i-1||e>0&&p>0&&D-u>e)&&(o.push(new I(0,f,e+s,g)),p=0,d=u,f+=g,g=0),g=Math.max(g,N);let L=0;switch(l){case 11:L=-v.width;break;default:L=0;break}switch(b.moveTo(d+L+b.margin.left,f+b.margin.top),l){case 11:d-=S;break;default:d+=S;break}p++}o.push(new I(0,f,e+s,g)),I.i(r)}t3(t,e,i,s,n,o){let r=I.l(),a=Math.max(this.cellSize.width,1),h=0,l=0,u=0,c=P.l();for(let L=0;L<t.length;L++){let M=t[L],A=this.getLayoutBounds(M,r),F=M.getRelativePoint(M.locationObject,M.locationSpot,c);h=Math.max(h,F.x),l=Math.max(l,A.width-F.x),u=Math.max(u,F.y)}let d=this.arrangement;switch(d){case 11:h+=s;break;default:l+=s;break}isFinite(a)?a=Math.max(a+s,1):a=Math.max(h+l,1);let f=this.arrangementOrigin.x,p=this.arrangementOrigin.y,g=f,y=p,b=0;e>=h&&(e-=h);let v=0,w=0,k=Math.max(this.cellSize.height,1);u=0;let S=0,N=!0,D=P.l();for(let L=0;L<t.length;L++){let M=t[L],A=this.getLayoutBounds(M,r),F=M.getRelativePoint(M.locationObject,M.locationSpot,c);if(b>0)switch(d){case 11:{let E=(g-f-(A.width-F.x))/a;C.X(Math.round(E),E)?E=Math.round(E):E=Math.floor(E),g=E*a+f;break}default:{let E=(g-f+F.x)/a;C.X(Math.round(E),E)?E=Math.round(E):E=Math.ceil(E),g=E*a+f;break}}else switch(d){case 11:v=g+F.x+A.width;break;default:v=g-F.x;break}let O=0;switch(d){case 11:O=-(g+F.x)+v;break;default:O=g+A.width-F.x-v;break}if(i>0&&b>i-1||e>0&&b>0&&O>e){o.push(new I(0,N?y-u:y,e+s,S+u+n));for(let E=0;E<b&&L!==b;E++){let B=t[L-b+E],K=B.getRelativePoint(B.locationObject,B.locationSpot,D);B.moveTo(B.position.x,B.position.y+u-K.y)}S+=n,N?y+=S:y+=S+u,u=0,S=0,b=0,g=f,N=!1}switch(g===f&&(d===11?w=Math.max(w,A.width-F.x):w=Math.min(w,-F.x)),u=Math.max(u,F.y),S=Math.max(S,A.height-F.y),isFinite(k)&&(S=Math.max(S,Math.max(A.height,k)-F.y)),N?M.moveTo(g-F.x,y-F.y):M.moveTo(g-F.x,y),d){case 11:g-=F.x+s;break;default:g+=A.width-F.x+s;break}b++}if(o.push(new I(0,y,e+s,(N?S:S+u)+n)),t.length!==b)for(let L=0;L<b;L++){let M=t[t.length-b+L],A=M.getRelativePoint(M.locationObject,M.locationSpot,c);M.moveTo(M.position.x,M.position.y+u-A.y)}if(P.i(c),P.i(D),d===11)for(let L=0;L<o.length;L++){let M=o[L];M.width+=w,M.x-=w}else for(let L=0;L<o.length;L++){let M=o[L];M.x>w&&(M.width+=M.x-w,M.x=w)}I.i(r)}commitLayers(t,e){}get wrappingWidth(){return this.gg}set wrappingWidth(t){this.gg!==t&&(m.s(t,"number",je,"wrappingWidth"),(t>0||isNaN(t))&&(this.gg=t,this.isViewportSized=isNaN(t),this.p()))}get wrappingColumn(){return this.mg}set wrappingColumn(t){this.mg!==t&&(m.s(t,"number",je,"wrappingColumn"),(t>0||isNaN(t))&&(this.mg=t,this.p()))}get cellSize(){return this.Ro}set cellSize(t){this.Ro.equals(t)||(this.Ro.h(t),this.p())}get spacing(){return this.In}set spacing(t){this.In.equals(t)||(this.In.h(t),this.p())}get alignment(){return this.de}set alignment(t){this.de!==t&&(t===1||t===0)&&(this.de=t,this.p())}get arrangement(){return this.He}set arrangement(t){this.He!==t&&(t===10||t===11)&&(this.He=t,this.p())}get sorting(){return this.Si}set sorting(t){this.Si!==t&&(t===20||t===21||t===22||t===23)&&(this.Si=t,this.p())}get comparer(){return this.Mi}set comparer(t){this.Mi!==t&&(m.S(t,je,"comparer"),this.Mi=t,this.p())}static standardComparer(t,e){let i=t.text,s=e.text;return i<s?-1:i>s?1:0}static smartComparer(t,e){if(t!==null)if(e!==null){let i=t.text.toLocaleLowerCase(),s=e.text.toLocaleLowerCase(),n=i.split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),o=s.split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),r=0;for(;r<n.length;r++)if(o[r]!==""&&o[r]!==void 0){let a=parseFloat(n[r]),h=parseFloat(o[r]);if(isNaN(a))if(isNaN(h)){if(n[r].localeCompare(o[r])!==0)return n[r].localeCompare(o[r]);continue}else return 1;else{if(isNaN(h))return-1;if(a-h!==0)return a-h;continue}}else{if(n[r]==="")continue;return 1}return o[r]!==""&&o[r]!==void 0?-1:0}else return 1;else return e!==null?-1:0}static Position=0;static Location=1;static LeftToRight=10;static RightToLeft=11;static Forward=20;static Reverse=21;static Ascending=22;static Descending=23}class ge{pg;on;Ct;Mo;yg;wg;a;XC;constructor(){this.pg=new V,this.on=new V,this.Ct=new V,this.Mo=new Mt,this.yg=new Mt,this.wg=new Mt,this.a=null,this.XC=!1}clear(){this.pg.clear(),this.on.clear(),this.Ct.clear(),this.Mo.clear(),this.yg.clear(),this.wg.clear()}Io(t){this.a=t}ch(t){if(t instanceof J){if(this.pg.add(t),t instanceof ht){let i=t.containingGroup;i===null?this.diagram.$r.add(t):i.Ch.add(t);let s=t.layout;s!==null&&(s.diagram=this.diagram)}}else t instanceof j?(this.on.add(t),t.isAvoiding&&(this.diagram.lp=!0)):t instanceof vt||this.Ct.add(t);let e=t.data;e!==null&&(t instanceof vt||(t instanceof j?this.Sv(e,t):this.Mo.set(e,t)))}ri(t){if(t.clearAdornments(),t instanceof J){if(this.pg.delete(t),t instanceof ht){let i=t.containingGroup;i===null?this.diagram.$r.delete(t):i.Ch.delete(t);let s=t.layout;s!==null&&(s.diagram=null)}}else t instanceof j?this.on.delete(t):t instanceof vt||this.Ct.delete(t);let e=t.data;e!==null&&(t instanceof vt||(t instanceof j?this.Mv(e,t):this.Mo.delete(e)))}Sv(t,e){this.yg.set(t,e)}Mv(t,e){this.yg.delete(t)}rebuildParts(){let t=this.diagram;if(t===null)return;let e=t.nodeTemplateMap.iterator;for(;e.next();){let d=e.value,f=e.key;(!d.Di()||d instanceof ht)&&m.o(`Invalid node template in Diagram.nodeTemplateMap: template for "${f}" must be a Node or a simple Part, not a Group or Link: ${d}`)}let i=t.groupTemplateMap.iterator;for(;i.next();){let d=i.value,f=i.key;d instanceof ht||m.o(`Invalid group template in Diagram.groupTemplateMap: template for "${f}" must be a Group, not a normal Node or Link: ${d}`)}let s=t.linkTemplateMap.iterator;for(;s.next();){let d=s.value,f=s.key;d instanceof j||m.o(`Invalid link template in Diagram.linkTemplateMap: template for "${f}" must be a Link, not a normal Node or simple Part: ${d}`)}let n=m.nt(),o=t.selection.iterator;for(;o.next();){let d=o.value.data;d&&n.push(d)}let r=m.nt(),a=t.highlighteds.iterator;for(;a.next();){let d=a.value.data;d&&r.push(d)}let h=m.nt(),l=this.nodes.iterator;for(;l.next();){let d=l.value;d.data!==null&&(h.push(d.data),h.push(d.location))}let u=this.links.iterator;for(;u.next();){let d=u.value;d.data!==null&&(h.push(d.data),h.push(d.location))}let c=this.parts.iterator;for(;c.next();){let d=c.value;d.data!==null&&(h.push(d.data),h.push(d.location))}this.Nv(),this.v2();for(let d=0;d<n.length;d++){let f=this.findPartForData(n[d]);f!==null&&(f.isSelected=!0)}for(let d=0;d<r.length;d++){let f=this.findPartForData(r[d]);f!==null&&(f.isHighlighted=!0)}for(let d=0;d<h.length;d+=2){let f=this.findPartForData(h[d]);f!==null&&(f.location=h[d+1])}m.Z(n),m.Z(r),m.Z(h)}v2(){let t=this.diagram.model;this.nw(t.nodeDataArray)}nw(t,e){let i=this.diagram.model;t.forEach(s=>{i.containsNodeData(s)&&this.Cv(s,!1)}),t.forEach(s=>{i.containsNodeData(s)&&this.Nk(s)}),e!==!1&&this.diagram.c1(!1)}Cv(t,e){if(t==null||this.diagram.undoManager.isUndoingRedoing||this.Mo.has(t))return null;e===void 0&&(e=!0);let i=this.e3(t);return i!==null&&e&&this.Nk(t),i}e3(t){if(t==null||this.diagram.undoManager.isUndoingRedoing||this.Mo.has(t))return null;let e=this.i3(t),i=this.findTemplateForNodeData(t,e);if(i!==null){i.It();let s=i.copy();if(s!==null){let n=this.diagram.wi;return this.diagram.wi=!0,s.Qo=e,s.te=t,this.addsToTemporaryLayer&&(s.ul="Tool"),this.diagram.add(s),s.te=null,s.data=t,this.diagram.wi=n,s}}return null}insertLink(t,e,i,s){return null}Nk(t){}i3(t){return this.diagram.model.getCategoryForNodeData(t)}static Lv=!1;static Av=!1;findTemplateForNodeData(t,e){let i=this.diagram,s=i.model,n=s.ff()&&s.isGroupForData(t),o=null;return n?(o=i.groupTemplateMap.get(e),o===null&&(o=i.groupTemplateMap.get(""),o===null&&(ge.Av||(ge.Av=!0,m.ne('No Group template found for category "'+e+'"'),m.ne(" Using default group template")),o=i.o2))):(o=i.nodeTemplateMap.get(e),o===null&&(o=i.nodeTemplateMap.get(""),o===null&&(ge.Lv||(ge.Lv=!0,m.ne('No Node template found for category "'+e+'"'),m.ne(" Using default node template")),o=i.e2))),o}getLinkCategoryForData(t){return""}setLinkCategoryForData(t,e){}setFromNodeForLink(t,e,i){}setToNodeForLink(t,e,i){}static Tv=!1;findLinkTemplateForCategory(t){let e=this.diagram,i=e.linkTemplateMap.get(t);return i===null&&(i=e.linkTemplateMap.get(""),i===null&&(ge.Tv||(ge.Tv=!0,m.ne('No Link template found for category "'+t+'"'),m.ne(" Using default link template")),i=e.i2)),i}WI(t,e,i){t instanceof j?(e!==null&&this.Mv(e,t),i!==null&&this.Sv(i,t)):t instanceof pt&&(e!==null&&this.Mo.delete(e),i!==null&&this.Mo.set(i,t))}Nv(){let t=this.diagram.model;this.GC(t.nodeDataArray)}GC(t){t.forEach(e=>{this.Ck(e)})}Ck(t){let e=this.findPartForData(t);e!==null&&(this.diagram.A2(e,!1),this.YC(e))}YC(t){}TC(t){}findPartForKey(t){if(t==null)return null;let e=this.diagram.model.findNodeDataForKey(t);return e!==null?this.Mo.get(e):null}findNodeForKey(t){if(t==null)return null;let e=this.diagram.model.findNodeDataForKey(t);if(e===null)return null;let i=this.Mo.get(e);return i instanceof J?i:null}findLinkForKey(t){return null}findPartForData(t){if(t===null)return null;let e=this.Mo.get(t);return e!==null||(e=this.yg.get(t)),e}findNodeForData(t){if(t===null)return null;let e=this.Mo.get(t);return e instanceof J?e:null}findLinkForData(t,e){return t===null?null:this.yg.get(t)}findNodesByExample(...t){let e=new V,i=this.pg.iterator;for(;i.next();){let s=i.value,n=s.data;if(n!==null)for(let o=0;o<arguments.length;o++){let r=arguments[o];if(m.$(r)&&this.KC(n,r)){e.add(s);break}}}return e.iterator}findLinksByExample(...t){let e=new V,i=this.on.iterator;for(;i.next();){let s=i.value,n=s.data;if(n!==null)for(let o=0;o<arguments.length;o++){let r=arguments[o];if(m.$(r)&&this.KC(n,r)){e.add(s);break}}}return e.iterator}KC(t,e){for(let i in e){let s=t[i],n=e[i];if(Array.isArray(n)){if(!Array.isArray(s))return!1;let o=s,r=n;if(o.length<r.length)return!1;for(let a=0;a<o.length;a++){let h=o[a],l=r[a];if(l!==void 0&&!this.Dv(h,l))return!1}}else if(!this.Dv(s,n))return!1}return!0}Dv(t,e){if(m.st(e)){if(!e(t))return!1}else if(e instanceof RegExp){if(!t||!e.test(t.toString()))return!1}else if(m.$(t)&&m.$(e)){if(!this.KC(t,e))return!1}else if(t!==e)return!1;return!0}doModelDataChanged(t){if(t.model===this.diagram.model&&this.diagram.G){this.diagram.G=!1;try{let e=t.change;t.modelChange===""&&t.object!==null&&e===2&&this.ow(t.object,t.propertyName)}finally{this.diagram.G=!0}}}doModelChanged(t){let e=this.diagram;if(!e||t.model!==e.model)return;let i=t.change;if(e.AO(t),!!e.G){e.G=!1;try{let s=t.modelChange;if(s!=="")if(i===2){if(s==="nodeCategory"){let n=t.object;if(n!==null){let o=this.findPartForData(n),r=t.newValue;o!==null&&typeof r=="string"&&(o.category=r)}}else if(s==="nodeDataArray"){let n=t.oldValue;this.GC(n);let o=t.newValue;this.nw(o)}e.isModified=!0}else if(i===3){let n=t.newValue;s==="nodeDataArray"&&m.$(n)&&this.Cv(n),e.isModified=!0}else if(i===4){let n=t.oldValue;s==="nodeDataArray"&&m.$(n)&&this.Ck(n),e.isModified=!0}else i===1&&(s==="SourceChanged"?t.object!==null?this.ow(t.object,t.propertyName):(this.updateAllRelationshipsFromData(),this.updateAllTargetBindings()):s==="ModelDisplaced"&&this.rebuildParts());else if(i===2){let n=t.propertyName,o=t.object,r=e.model;o===r?(n==="nodeKeyProperty"||n==="nodeCategoryProperty")&&(e.undoManager.isUndoingRedoing||this.rebuildParts()):o!==null&&this.ow(o,n),e.isModified=!0}else(i===3||i===4)&&(this.s3(t,e.model),e.isModified=!0)}finally{e.G=!0}}}updateAllTargetBindings(t){t===void 0&&(t="");let e=this.parts.iterator;for(;e.next();)e.value.updateTargetBindings(t);for(e=this.nodes.iterator;e.next();)e.value.updateTargetBindings(t);for(e=this.links.iterator;e.next();)e.value.updateTargetBindings(t)}updateAllThemeBindings(){let t=this.parts.iterator;for(;t.next();)t.value.Go();for(t=this.nodes.iterator;t.next();)t.value.Go();for(t=this.links.iterator;t.next();)t.value.Go()}updateAllRelationshipsFromData(){let t=this.diagram.model,e=new V,i=t.nodeDataArray;for(let o=0;o<i.length;o++){let r=i[o];e.add(r)}let s=[];this.nodes.each(o=>{o.data!==null&&!e.has(o.data)&&s.push(o.data)}),this.parts.each(o=>{o.data!==null&&!e.has(o.data)&&s.push(o.data)}),s.forEach(o=>t.vv(o,!1));for(let o=0;o<i.length;o++){let r=i[o];this.findPartForData(r)===null&&t.Fv(r,!1)}this.Rv();let n=this.parts.iterator;for(;n.next();)n.value.updateRelationshipsFromData();for(n=this.nodes.iterator;n.next();)n.value.updateRelationshipsFromData();for(n=this.links.iterator;n.next();)n.value.updateRelationshipsFromData()}Rv(){}updateRelationshipsFromData(t){}ow(t,e){if(typeof e=="string"){let i=this.findPartForData(t);if(i!==null)i.updateTargetBindings(e);else{let s=this.o3(t);if(s!==null&&s.length>0){for(let o=0;o<s.length;o++)s[o].updateTargetBindings(e);let n=s[0].part;if(n!==null){let o=n.adornments;for(;o.next();)o.value.updateTargetBindings(e)}m.Z(s)}}t===this.diagram.model.modelData&&this.updateAllTargetBindings(e)}}o3(t){let e=null,i=this.wg.iterator;for(;i.next();){let s=i.value;for(let n=0;n<s.length;n++){let o=s[n].findItemPanelForData(t);o!==null&&(e===null&&(e=m.nt()),e.push(o))}if(e!==null)break}return e}HC(t){return this.wg.get(t)}s3(t,e){let i=t.object;if(!Array.isArray(i))return;let s=t.change===3,n=s?t.newParam:t.oldParam,o=s?t.newValue:t.oldValue,r=this.HC(i);if(Array.isArray(r))for(let a=0;a<r.length;a++){let h=r[a];s?h.Q1(o,n,!0):h.ZI(n)}}C2(t,e){e!==null&&t.Pn(s=>e.gT(s));let i=t.Ta;if(Array.isArray(i)){let s=this.HC(i);if(s===null)this.wg.set(i,[t]);else{for(let n=0;n<s.length;n++)if(s[n]===t)return;s.push(t)}}}L2(t,e){t.Pn(s=>e.DO(s));let i=t.Ta;if(Array.isArray(i)){let s=this.HC(i);if(s!==null){for(let n=0;n<s.length;n++)if(s[n]===t){s.splice(n,1),s.length===0&&this.wg.delete(i);return}}}}copyParts(t,e,i){i===void 0&&(i=!1);let s=new Mt;if(Array.isArray(t))for(let o=0;o<t.length;o++)this.Lk(t[o],e,s,i);else{let o=t.iterator;for(;o.next();)this.Lk(o.value,e,s,i)}if(e!==null){let o=e.model,r=e.Tp().dragsLink,a=new V,h=new Mt,l=s.iterator;for(;l.next();){let u=l.value;if(u instanceof j)!r&&(u.fromNode===null||u.toNode===null)&&a.add(u);else if(u instanceof J&&u.data!==null){if(o.Vm()){let c=u,d=l.key,f=d.findTreeParentNode();if(f!==null){let p=s.get(f);if(p!==null){o.setParentKeyForNodeData(c.data,o.getKeyForNodeData(p.data));let g=e.findLinkForData(c.data),y=d.findTreeParentLink();y!==null&&g!==null&&h.set(y,g)}}}else if(o.a1()){let c=u,d=l.key,f=o.isRelatedKeysPathTo?d.findNodesOutOf():d.findNodesInto();for(;f.next();){let p=f.value,g=s.get(p);if(g!==null){o.addRelatedKeyForNodeData(c.data,g.key);let y=e.partManager.findLinkForData(c.data,g.key),b=this.findLinkForData(d.data,p.key);b!==null&&y!==null&&h.set(b,y)}else o.removeRelatedKeyForNodeData(c.data,p.key)}}}}if(a.count>0&&e.removeParts(a,!1),h.count>0){let u=h.iterator;for(;u.next();){let c=u.key,d=u.value;s.set(c,d)}}}if(e!==null&&this.diagram!==null){let o=e.model,r=o.afterCopyFunction;if(r!==null){let a=new Mt;s.each(l=>{l.key.data!==null&&a.set(l.key.data,l.value.data)});let h=this.diagram.model;r(a,o,h)}}let n=s.iterator;for(;n.next();)n.value.updateTargetBindings();return s}Lk(t,e,i,s){if(t===null||s&&!t.canCopy())return null;if(i.has(t))return i.get(t);let n=this.qC(t,e);if(!(n instanceof pt))return null;if(n.isSelected=!1,n.isHighlighted=!1,i.set(t,n),t instanceof J){let o=t.linksConnected;for(;o.next();){let r=o.value;if(r.fromNode===t){let a=i.get(r);a!==null&&(a.fromNode=n)}if(r.toNode===t){let a=i.get(r);a!==null&&(a.toNode=n)}}if(t instanceof ht&&n instanceof ht){let r=t.memberParts;for(;r.next();){let a=r.value,h=this.Lk(a,e,i,s);h instanceof j||h!==null&&(h.containingGroup=n)}}}else if(t instanceof j&&n instanceof j){let o=t.fromNode;if(o!==null){let h=i.get(o);h!==null&&(n.fromNode=h)}let r=t.toNode;if(r!==null){let h=i.get(r);h!==null&&(n.toNode=h)}let a=t.labelNodes;for(;a.next();){let h=a.value,l=this.Lk(h,e,i,s);l!==null&&l instanceof J&&(l.labeledLink=n)}}return n}qC(t,e){let i=null,s=t.data;if(s!==null&&e!==null){let n=e.model;if(!(t instanceof j)){let o=n.copyNodeData(s);n.addNodeData(o),i=e.findPartForData(o)}}else if(t.It(),i=t.copy(),i!==null){let n=this.diagram;if(e!==null)e.add(i);else if(s!==null&&n!==null&&n.commandHandler!==null&&n.commandHandler.copiesClipboardData){let o=n.model,r=null;i instanceof j||(r=o.copyNodeData(s)),i.data=r}}return i}get nodes(){return this.pg}get links(){return this.on}get parts(){return this.Ct}get diagram(){return this.a}get addsToTemporaryLayer(){return this.XC}set addsToTemporaryLayer(t){this.XC=t}}class Zn extends ge{v2(){let t=this.diagram.model;this.nw(t.nodeDataArray),this.Ov(t.linkDataArray)}nw(t){super.nw(t,!1);let e=this.links.iterator;for(;e.next();)e.value.Wd();this.diagram.c1(!1)}Ov(t){t.forEach(e=>{this.Iv(e)}),this.diagram.c1(!1)}Iv(t){if(t==null||this.diagram.undoManager.isUndoingRedoing||this.findLinkForData(t))return null;let e=this.getLinkCategoryForData(t),i=this.findLinkTemplateForCategory(e);if(i!==null){i.It();let s=i.copy();if(s!==null){let n=this.diagram.wi;this.diagram.wi=!0,s.Qo=e,s.te=t;let o=this.diagram.model,r=o.Ak(t,!0);r!==""&&(s.fromPortId=r);let a=o.Vi(t,!0);if(a!==void 0){let c=this.findNodeForKey(a);c instanceof J&&(s.fromNode=c)}let h=o.Ak(t,!1);h!==""&&(s.toPortId=h);let l=o.Vi(t,!1);if(l!==void 0){let c=this.findNodeForKey(l);c instanceof J&&(s.toNode=c)}let u=o.getLabelKeysForLinkData(t);return Array.isArray(u)&&u.forEach(c=>{let d=this.findNodeForKey(c);d!==null&&(d.labeledLink=s)}),this.addsToTemporaryLayer&&(s.ul="Tool"),this.diagram.add(s),s.te=null,s.data=t,this.diagram.wi=n,s}}return null}Nv(){let t=this.diagram.model;this.Ev(t.linkDataArray),this.GC(t.nodeDataArray)}Ev(t){t.forEach(e=>{this.Ck(e)})}getLinkCategoryForData(t){return this.diagram.model.getCategoryForLinkData(t)}setLinkCategoryForData(t,e){return this.diagram.model.setCategoryForLinkData(t,e)}setFromNodeForLink(t,e,i){let s=this.diagram.model,n=e!==null?e.data:null;s.setFromKeyForLinkData(t.data,s.getKeyForNodeData(n))}setToNodeForLink(t,e,i){let s=this.diagram.model,n=e!==null?e.data:null;s.setToKeyForLinkData(t.data,s.getKeyForNodeData(n))}TC(t){this.diagram.model.removeLinkData(t.data)}findPartForKey(t){let e=super.findPartForKey(t);if(e===null){let i=this.diagram.model.findLinkDataForKey(t);if(i!==null)return this.findLinkForData(i)}return e}findLinkForKey(t){if(t==null)return null;let e=this.diagram.model.findLinkDataForKey(t);return e!==null?this.findLinkForData(e):null}doModelChanged(t){if(super.doModelChanged(t),!this.diagram)return;let e=this.diagram;if(t.model!==e.model)return;let i=t.change;if(e.G){e.G=!1;try{let s=t.modelChange;if(s!==""){if(i===2){if(s==="linkFromKey"){let n=t.object,o=this.findLinkForData(n);if(o!==null){let r=t.newValue,a=this.findNodeForKey(r);o.fromNode=a}}else if(s==="linkToKey"){let n=t.object,o=this.findLinkForData(n);if(o!==null){let r=t.newValue,a=this.findNodeForKey(r);o.toNode=a}}else if(s==="linkFromPortId"){let n=t.object,o=this.findLinkForData(n);if(o!==null){let r=t.newValue;typeof r=="string"&&(o.fromPortId=r)}}else if(s==="linkToPortId"){let n=t.object,o=this.findLinkForData(n);if(o!==null){let r=t.newValue;typeof r=="string"&&(o.toPortId=r)}}else if(s==="nodeGroupKey"){let n=t.object,o=this.findPartForData(n);if(o!==null){let r=t.newValue;if(r!==void 0){let a=this.findNodeForKey(r);a instanceof ht?o.containingGroup=a:o.containingGroup=null}else o.containingGroup=null}}else if(s==="linkLabelKeys"){let n=t.object,o=this.findLinkForData(n);if(o!==null){let r=t.oldValue,a=t.newValue;Array.isArray(r)&&r.forEach(h=>{if(a.indexOf(h)>=0)return;let l=this.findNodeForKey(h);l!==null&&(l.labeledLink=null)}),Array.isArray(a)&&a.forEach(h=>{let l=this.findNodeForKey(h);l!==null&&(l.labeledLink=o)})}}else if(s==="linkCategory"){let n=t.object,o=this.findLinkForData(n),r=t.newValue;o!==null&&typeof r=="string"&&(o.category=r)}else if(s==="linkDataArray"){let n=t.oldValue;this.Ev(n);let o=t.newValue;this.Ov(o)}e.isModified=!0}else if(i===3){let n=t.newValue;if(s==="linkDataArray"&&m.$(n))this.Iv(n);else if(s==="linkLabelKeys"&&t.model.isKeyType(n)){let o=t.object,r=this.findLinkForData(o),a=this.findNodeForKey(n);r!==null&&a!==null&&(a.labeledLink=r)}e.isModified=!0}else if(i===4){let n=t.oldValue;if(s==="linkDataArray"&&m.$(n))this.Ck(n);else if(s==="linkLabelKeys"&&t.model.isKeyType(n)){let o=this.findNodeForKey(n);o!==null&&(o.labeledLink=null)}e.isModified=!0}}else if(i===2){let n=t.propertyName,o=t.object,r=e.model;o===r&&(n==="linkFromKeyProperty"||n==="linkToKeyProperty"||n==="linkFromPortIdProperty"||n==="linkToPortIdProperty"||n==="linkLabelKeysProperty"||n==="nodeIsGroupProperty"||n==="nodeGroupKeyProperty"||n==="linkCategoryProperty")&&(e.undoManager.isUndoingRedoing||this.rebuildParts()),e.isModified=!0}}finally{e.G=!0}}}Rv(){let t=this.diagram.model,e=new Set,i=t.linkDataArray;i.forEach(n=>{e.add(n)});let s=[];this.links.each(n=>{n.data!==null&&!e.has(n.data)&&s.push(n.data)}),s.forEach(n=>{t.Uv(n,!1)}),i.forEach(n=>{this.findLinkForData(n)===null&&t.Vv(n,!1)})}updateRelationshipsFromData(t){let e=t.data;if(e===null)return;let i=t.diagram;if(i===null)return;let s=i.model;if(t instanceof j){let n=s.Vi(e,!0),o=i.findNodeForKey(n);t.fromNode=o,n=s.Vi(e,!1),o=i.findNodeForKey(n),t.toNode=o;let r=s.getLabelKeysForLinkData(e);if(r.length>0||t.labelNodes.count>0){if(r.length===1&&t.labelNodes.count===1){let c=r[0],d=t.labelNodes.first();if(d!==null&&s.getKeyForNodeData(d.data)===c)return}let a=new V().addAll(r),h=new V;t.labelNodes.each(c=>{if(c.data!==null){let d=s.getKeyForNodeData(c.data);d!==void 0&&h.add(d)}});let l=h.copy();l.removeAll(a);let u=a.copy();if(u.removeAll(h),l.count>0||u.count>0){let c=t;l.each(d=>{let f=i.findNodeForKey(d);f!==null&&f.labeledLink===c&&(f.labeledLink=null)}),u.each(d=>{let f=i.findNodeForKey(d);f!==null&&f.labeledLink!==c&&(f.labeledLink=c)})}}}else if(!(t instanceof vt)){let n=s.getGroupKeyForNodeData(e),o=i.findPartForKey(n);(o===null||o instanceof ht)&&(t.containingGroup=o)}}Nk(t){let e=this.diagram.model,i=e.getKeyForNodeData(t);if(i!==void 0){let s=e.lw(i),n=this.findPartForData(t);if(s!==null&&n!==null){let r=s.iterator;for(;r.next();){let a=r.value;if(e.containsNodeData(a)){if(n instanceof ht&&e.getGroupKeyForNodeData(a)===i){let h=this.findPartForData(a);h!==null&&(h.containingGroup=n)}}else{let h=this.findLinkForData(a);if(h!==null&&n instanceof J){e.Vi(a,!0)===i&&(h.fromNode=n),e.Vi(a,!1)===i&&(h.toNode=n);let l=e.getLabelKeysForLinkData(a);Array.isArray(l)&&l.some(u=>u===i?(n.labeledLink=h,!0):!1)}}}e.ln(i)}let o=e.getGroupKeyForNodeData(t);if(o!==void 0){let r=this.findNodeForKey(o);n!==null&&r instanceof ht&&(n.containingGroup=r)}}}YC(t){let e=this.diagram.model;if(t instanceof J){let i=e.getKeyForNodeData(t.data);if(i!==void 0){let s=t.linksConnected;for(;s.next();){let n=s.value;e.an(i,n.data)}if(t.isLinkLabel){let n=t.labeledLink;n!==null&&e.an(i,n.data)}if(t instanceof ht){let n=t.memberParts;for(;n.next();){let o=n.value.data;e.containsNodeData(o)&&e.an(i,o)}}}}}qC(t,e){let i=super.qC(t,e);if(t instanceof j){let s=t.data;if(s!==null&&e!==null){let n=e.model,o=n.copyLinkData(s);n.addLinkData(o),i=e.findLinkForData(o)}else if(i!==null){let n=this.diagram;if(s!==null&&n!==null&&n.commandHandler!==null&&n.commandHandler.copiesClipboardData){let o=n.model.copyLinkData(s);i.data=o}}}return i}insertLink(t,e,i,s){let n=this.diagram,o=n.model,r=n.toolManager.findTool("Linking"),a="";t!==null&&(e===null&&(e=t),a=e.portId,a===null&&(a=""));let h="";i!==null&&(s===null&&(s=i),h=s.portId,h===null&&(h=""));let l=r.archetypeLinkData;if(l instanceof j){l.It();let u=l.copy();if(u!==null){u.fromNode=t,u.fromPortId=a,u.toNode=i,u.toPortId=h,n.add(u);let c=r.archetypeLabelNodeData;if(c instanceof J){c.It();let d=c.copy();d!==null&&(d.labeledLink=u,n.add(d))}return u}}else if(l!==null){let u=o.copyLinkData(l);if(m.$(u)){t!==null&&o.xg(u,o.getKeyForNodeData(t.data),!0),o.bg(u,a,!0),i!==null&&o.xg(u,o.getKeyForNodeData(i.data),!1),o.bg(u,h,!1),o.addLinkData(u);let c=r.archetypeLabelNodeData;if(c!==null&&!(c instanceof J)){let d=o.copyNodeData(c);o.addNodeData(d);let f=o.getKeyForNodeData(d);f!==void 0&&o.addLabelKeyForLinkData(u,f)}return n.findLinkForData(u)}}return null}}class Qn extends ge{Ua=null;Tk(t,e){if(t===null||e===null||e.findTreeParentLink()!==null)return;let i=this.diagram.toolManager.findTool("Linking"),s=t,n=e;if(this.diagram.isTreePathToChildren){if(i!==null&&i.Uu(s,n,null,!0))return}else if(s=e,n=t,i!==null&&i.Uu(s,n,null,!0))return;let o=this.getLinkCategoryForData(e.data),r=this.findLinkTemplateForCategory(o);if(r!==null){r.It();let a=r.copy();if(a!==null){let h=this.diagram.wi;this.diagram.wi=!0,a.Qo=o,a.te=e.data,a.fromNode=s,a.toNode=n,this.diagram.add(a),a.te=null,a.data=e.data,this.diagram.wi=h}}}getLinkCategoryForData(t){return this.diagram.model.getParentLinkCategoryForNodeData(t)}setLinkCategoryForData(t,e){this.diagram.model.setParentLinkCategoryForNodeData(t,e)}setFromNodeForLink(t,e,i){let s=this.diagram.model;i===void 0&&(i=null);let n=e!==null?e.data:null;if(this.diagram.isTreePathToChildren)s.setParentKeyForNodeData(t.data,s.getKeyForNodeData(n));else{let o=this.Ua;this.Ua=t,i!==null&&s.setParentKeyForNodeData(i.data,void 0);let r=t.toNode!==null?t.toNode.data:null;s.setParentKeyForNodeData(n,s.getKeyForNodeData(r)),this.Ua=o}}setToNodeForLink(t,e,i){let s=this.diagram.model;i===void 0&&(i=null);let n=e!==null?e.data:null;if(this.diagram.isTreePathToChildren){let o=this.Ua;this.Ua=t,i!==null&&s.setParentKeyForNodeData(i.data,void 0);let r=t.fromNode!==null?t.fromNode.data:null;s.setParentKeyForNodeData(n,s.getKeyForNodeData(r)),this.Ua=o}else s.setParentKeyForNodeData(t.data,s.getKeyForNodeData(n))}TC(t){this.diagram.model.setParentKeyForNodeData(t.data,void 0)}findLinkForKey(t){if(t==null)return null;let e=this.diagram.model.findNodeDataForKey(t);return e!==null?this.findLinkForData(e):null}doModelChanged(t){if(super.doModelChanged(t),!this.diagram)return;let e=this.diagram;if(t.model!==e.model)return;let i=t.change;if(e.G){e.G=!1;try{let s=t.modelChange;if(s!==""){if(i===2){if(s==="nodeParentKey"){let n=t.object,o=n?this.findNodeForData(n):null,r=t.newValue,a=this.findNodeForKey(r);if(n&&this.Ua!==null)a!==null&&(this.Ua.data=n,this.Ua.category=this.getLinkCategoryForData(n));else if(o!==null){let h=o.findTreeParentLink();h!==null?a===null?e.remove(h):e.isTreePathToChildren?h.fromNode=a:h.toNode=a:this.Tk(a,o)}}else if(s==="parentLinkCategory"){let n=t.object,o=n?this.findNodeForData(n):null,r=t.newValue;if(o!==null&&typeof r=="string"){let a=o.findTreeParentLink();a!==null&&(a.category=r)}}e.isModified=!0}}else i===2&&(t.object===e.model&&t.propertyName==="nodeParentKeyProperty"&&(e.undoManager.isUndoingRedoing||this.rebuildParts()),e.isModified=!0)}finally{e.G=!0}}}updateRelationshipsFromData(t){let e=t.data;if(e===null)return;let i=t.diagram;if(i===null)return;let s=i.model;if(t instanceof J){let n=s.getParentKeyForNodeData(e),o=i.findNodeForKey(n),r=t.findTreeParentNode();if(o!==r){let a=t.findTreeParentLink();o!==null?a!==null?i.isTreePathToChildren?a.fromNode=o:a.toNode=o:this.Tk(o,t):a!==null&&i.A2(a,!1)}}}ow(t,e){if(super.ow(t,e),typeof e=="string"&&this.findPartForData(t)!==null){let i=this.findLinkForData(t);i!==null&&i.updateTargetBindings(e)}}Nk(t){let e=this.diagram.model,i=e.getKeyForNodeData(t);if(i!==void 0){let s=e.lw(i),n=this.findPartForData(t);if(s!==null&&n!==null){let r=s.iterator;for(;r.next();){let a=r.value;if(e.containsNodeData(a)&&n instanceof J&&e.getParentKeyForNodeData(a)===i){let h=this.findNodeForData(a);this.Tk(n,h)}}e.ln(i)}let o=e.getParentKeyForNodeData(t);if(o!==void 0&&n instanceof J){let r=this.findNodeForKey(o);this.Tk(r,n)}}}YC(t){let e=this.diagram.model;if(t instanceof J){let i=e.getKeyForNodeData(t.data),s=this.findLinkForData(t.data);if(s!==null){s.isSelected=!1,s.isHighlighted=!1;let r=s.layer;if(r!==null){let a=r.ri(-1,s,!1);a>=0&&this.diagram.raiseChangedEvent(4,"parts",r,s,null,a,null);let h=s.layerChanged;h!==null&&h(s,r,null)}}let n=this.diagram.isTreePathToChildren,o=t.linksConnected;for(;o.next();){let r=o.value,a=n?r.toNode:r.fromNode;if(a!==null){let h=a.data;e.containsNodeData(h)&&e.an(i,h)}}}}insertLink(t,e,i,s){let n=this.diagram.model,o=t,r=i;if(this.diagram.isTreePathToChildren||(o=i,r=t),o!==null&&r!==null){let a=o.data,h=r.data;return n.setParentKeyForNodeData(h,n.getKeyForNodeData(a)),r.findTreeParentLink()}return null}}var Ci=(x=>(x[x.OneWay=1]="OneWay",x[x.TwoWay=2]="TwoWay",x))(Ci||{});class te{n;jC;nc;Kf;Va;Hf;qf;jf;Dk;Ti;Id;Df;constructor(t,e,i,s){V.Je(this),t===void 0?t="":m.s(t,"string",te,"constructor:targetprop"),e===void 0?e=t:m.s(e,"string",te,"constructor:sourceprop"),i===void 0?i=null:i!==null&&m.S(i,te,"constructor:conv"),this.jC=-1,this.Ti=null,this.nc=t,this.Id=0,this.Df=0,this.Kf=null,this.Va=e,this.Hf=i,s===void 0?(this.qf=1,this.jf=null):(this.qf=2,this.jf=s),this.Dk=new V,this.n=2}copy(){let t=new this.constructor;return this.cloneProtected(t),t}cloneProtected(t){t.nc=this.nc,t.Id=this.Id,t.Df=this.Df,t.Kf=this.Kf,t.Va=this.Va,t.Hf=this.Hf,t.qf=this.qf,t.jf=this.jf,t.n=this.n&-2}static OneWay=1;static TwoWay=2;static parseEnum(t,e){return m.S(t,te,"parseEnum:ctor"),i=>{let s=parseInt(i);return isNaN(s)&&(s=m.$a(t,i),s===null)?e:s}}fe(t){t in Ci?this.mode=t:m.ur(this,t)}static toString(t){return m.toString(t)}toString(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.targetId!==-1?" "+this.targetId:"")+" "+Ci[this.mode]+")"}k(){return this.n=this.n|1,this}get targetId(){return this.jC}set targetId(t){this.u&&m.L(this),this.jC=t}get targetProperty(){return this.nc}set targetProperty(t){this.u&&m.L(this),m.s(t,"string",te,"targetProperty"),this.nc=t}get sourceProperty(){return this.Va}set sourceProperty(t){this.u&&m.L(this),m.s(t,"string",te,"sourceProperty"),this.Va=t}get u(){return(this.n&1)!==0}get isToData(){return(this.n&2)!==0}get isToObject(){return(this.n&4)!==0}get isToModel(){return(this.n&8)!==0}get isToTheme(){return(this.n&16)!==0}get WC(){return this.isToTheme&&!(this.isToData||this.isToObject||this.isToModel)}xd(){return!1}get sourceName(){return this.Kf}set sourceName(t){this.u&&m.L(this),t!==null&&m.s(t,"string",te,"sourceName"),this.Kf=t,t!==null?this.n=this.n&-3|4:this.n=this.n|2}get converter(){return this.Hf}set converter(t){this.u&&m.L(this),t!==null&&m.S(t,te,"converter"),this.Hf=t}get backConverter(){return this.jf}set backConverter(t){this.u&&m.L(this),t!==null&&m.S(t,te,"backConverter"),this.jf=t}get mode(){return this.qf}set mode(t){this.u&&m.L(this),this.isToTheme&&t===2&&m.o("Theme Bindings cannot be TwoWay."),this.qf=t}makeTwoWay(t){return this.isToTheme&&m.o("Theme Bindings cannot be TwoWay."),this.mode=2,t&&(m.S(t,te,"makeTwoWay"),this.backConverter=t),this}ofObject(t){return this.u&&m.L(this),t===void 0&&(t=""),this.sourceName=t,this}ofModel(){return this.u&&m.L(this),this.n=this.n&-3&-5|8,this.Kf=null,this}$T(t,e){let i=this.sourceName,s=null;return i===null||i===""?s=t:i==="/"?s=e.part:i==="."?s=e:i===".."?s=e.panel:s=t.findObject(i),s}check(t){let e=this.nc,i=this.Va,s=this.Hf;(this.xd()&&s===null&&this.Ba===null&&e===""||s===null&&e==="")&&m.ne("Binding error: target property is the empty string: "+this.toString()),this.xd()&&this.WC&&i===""&&s===null&&this.Ba===null&&m.ne("Binding error: theme bindings require a source property when not using a converter: "+this.toString()),t&&typeof e=="string"&&(!m.st(["setAttribute"])&&e.length>0&&e[0]!=="_"&&!m.qw(t,e)?m.ne("Binding error: undefined target property: "+e+" on "+t.toString()):e==="name"&&t instanceof $&&m.ne("Binding error: cannot modify GraphObject.name on "+t.toString()))}updateTarget(t,e,i,s){let n=this.Va;if(i!==void 0&&n!==""&&n!==i||this.isToTheme&&t.diagram===null)return;let o=this.nc,r=this.Hf,a=e;if(n!==""&&!this.WC&&(a=ut.St(e,n)),a!==void 0)if(r===null){if(o!==""){if(this.xd()){let h=t.diagram?.themeManager;if(a=this.Bv(h,a,t,o),a===void 0)return}s?s.et(t,o,a):(e instanceof $||e instanceof Xt)&&ut.et(t,o,a)}}else try{if(o!==""){let h=r(a,t);if(this.xd()){let l=t.diagram?.themeManager;if(h=this.Bv(l,h,t,o),h===void 0)return}s?s.et(t,o,h):(e instanceof $||e instanceof Xt)&&ut.et(t,o,h)}else r(a,t)}catch{}}updateSource(t,e,i,s){if(this.qf!==2)return;let n=this.nc;if(i!==void 0&&n!==i)return;let o=this.Va,r=this.jf,a=s!==null?s.diagram:null,h=a!==null?a.model:null,l=t;if(n!==""&&(l=ut.St(t,n)),l!==void 0&&!this.Dk.has(t))try{if(this.Dk.add(t),r===null){if(o!=="")h!==null?h.setDataProperty(e,o,l):(e instanceof $||e instanceof Xt)&&(e[o]=l);else if(h!==null&&s!==null&&s.itemIndex>=0&&s.panel!==null&&Array.isArray(s.panel.itemArray)){let u=s.itemIndex,c=s.panel.itemArray;h.removeArrayItem(c,u),h.insertArrayItem(c,u,l)}}else try{if(o!==""){let u=r(l,e,h);h!==null?h.setDataProperty(e,o,u):(e instanceof $||e instanceof Xt)&&(e[o]=u)}else{let u=r(l,e,h);if(u!==void 0&&h!==null&&s!==null&&s.itemIndex>=0&&s.panel!==null&&Array.isArray(s.panel.itemArray)){let c=s.itemIndex,d=s.panel.itemArray;h.removeArrayItem(d,c),h.insertArrayItem(d,c,u)}}}catch{}}finally{this.Dk.delete(t)}}}class ii extends te{aw;Ba;oc;constructor(t,e,i,s,n){super(t,e,s),i==null&&(i=""),n===void 0&&(n=null),this.aw=i,this.Ba=n,this.oc=null,this.n=16}cloneProtected(t){super.cloneProtected(t),t.aw=this.aw,t.Ba=this.Ba,t.oc=this.oc}xd(){return!0}get themeSource(){return this.aw}set themeSource(t){this.u&&m.L(this),t!==null&&m.s(t,"string",ii,"themeSource"),this.aw=t,this.oc=null,t!==null?this.n=this.n|16:this.n=this.n&-17}get themeConverter(){return this.Ba}set themeConverter(t){this.u&&m.L(this),t!==null&&m.S(t,ii,"themeConverter"),this.Ba=t}ofData(){return this.u&&m.L(this),this.n=this.n|2,this.Kf=null,this}Bv(t,e,i,s){if(!t||(this.WC&&(e=this.Va),!e&&e!==0))return;let n=this.themeSource;this.oc!==null?n=this.oc:typeof n=="string"&&n.includes(".")&&(this.oc=n.split("."),n=this.oc);let o=t.findValue(e,n,s);if(o===void 0&&m.ne(`Theme warning: ${e} could not be found when setting target property ${s}.`),t.readsCssVariables&&typeof o=="string"&&o.startsWith("var(")){let r=o.match(this.r3);r&&(o=getComputedStyle(X.document.documentElement).getPropertyValue(r[1]))}return m.st(this.Ba)&&(o=this.Ba(o,i)),o}r3=/var\((.*)\)/}class ut{Pt;kg;Bo;JC;Bi;be;za;Wf;Jf;Pg;Sg;Mg;Ng;hw;rc;rr;cw;Vo;vk;constructor(t,e){if(V.Je(this),this.Pt="",this.kg="",this.Bo=!1,this.JC={},this.Bi=[],this.be=new Mt,this.za="key",this.Wf=null,this.Jf=null,this.Pg=!1,this.Sg=!1,this.Mg=!1,this.Ng=null,this.hw=100,this.rc="category",this.rr=new Mt,this.cw=[],this.Vo=!1,this.vk=null,this.undoManager=new vi,t!==void 0&&(Array.isArray(t)?this.nodeDataArray=t:e=t),e){Object.assign(this,e);let i=e.Changed;i&&(delete this.Changed,this.addChangedListener(i))}}cloneProtected(t){t.Pt=this.Pt,t.kg=this.kg,t.Bo=this.Bo,t.za=this.za,t.Wf=this.Wf,t.Jf=this.Jf,t.Pg=this.Pg,t.Sg=this.Sg,t.Mg=this.Mg,t.Ng=this.Ng,t.hw=this.hw,t.rc=this.rc}copy(){let t=new this.constructor;return this.cloneProtected(t),t}clear(){this.Bi=[],this.be.clear(),this.rr.clear(),this.undoManager.clear()}toString(t){if(t===void 0&&(t=0),t>1)return this.toJson();{let e=(this.name!==""?this.name:"")+" Model";if(t>0){e+=`
|
|
@@ -47,63 +47,4 @@ string: ${t}`);break}}let A=k.um;if(Ce.$L(k),e){let F=A.figures.iterator;for(;F.
|
|
|
47
47
|
"modifiedLinkData": `;tF=`,
|
|
48
48
|
"removedLinkKeys": `;Qv(t){let e=new V;for(let i=0;i<this.linkDataArray.length;i++){let s=this.linkDataArray[i];this.Rk(t,s,s,e)}return e}eL(t,e,i){if(this.linkKeyProperty===""){let c=this.skipsUndoManager;this.skipsUndoManager=!0,this.linkKeyProperty="key",this.skipsUndoManager=c}let s=super.eL(t,e,i),n=this,o=new V,r=new V,a=new V;t.changes.each(c=>{if(c.model===n){if(c.modelChange==="linkDataArray")c.change===3?o.add(c.newValue):c.change===4&&a.add(c.oldValue);else if(n.containsLinkData(c.object))c.object!==null&&r.add(c.object);else if(c.object!==null)if(c.object!==null&&i.has(c.object)){let d=i.get(c.object);d&&d.each(f=>{n.containsLinkData(f)&&r.add(f)})}else{if(c.object instanceof ut||n.containsNodeData(c.object))return;n.Qv(c.object).each(d=>r.add(d))}}});let h=new V;o.each(c=>{let d=n.getKeyForLinkData(c);d!==void 0&&h.add(d),e||r.add(c)});let l=new V;a.each(c=>{let d=n.getKeyForLinkData(c);d!==void 0&&l.add(d),e&&r.add(c)});let u=s;return h.count>0&&(u+=(e?this.tF:this._v)+this.Xa(h.toArray(),!0)),r.count>0&&(u+=this.c3+this.Xa(r.toArray(),!0)),l.count>0&&(u+=(e?this._v:this.tF)+this.Xa(l.toArray(),!0)),u}uw(t){(t.linkCategoryProperty!==void 0&&t.linkCategoryProperty!==this.linkCategoryProperty||t.linkKeyProperty!==void 0&&t.linkKeyProperty!==this.linkKeyProperty||t.linkFromKeyProperty!==void 0&&t.linkFromKeyProperty!==this.linkFromKeyProperty||t.linkToKeyProperty!==void 0&&t.linkToKeyProperty!==this.linkToKeyProperty||t.linkFromPortIdProperty!==void 0&&t.linkFromPortIdProperty!==this.linkFromPortIdProperty||t.linkToPortIdProperty!==void 0&&t.linkToPortIdProperty!==this.linkToPortIdProperty||t.linkLabelKeysProperty!==void 0&&t.linkLabelKeysProperty!==this.linkLabelKeysProperty||t.nodeIsGroupProperty!==void 0&&t.nodeIsGroupProperty!==this.nodeIsGroupProperty||t.nodeGroupKeyProperty!==void 0&&t.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&m.o("applyIncrementalJson cannot change Model properties"),super.uw(t);let e=t.insertedLinkKeys;if(Array.isArray(e)){let n=e.length;for(let o=0;o<n;o++){let r=e[o],a=this.findLinkDataForKey(r);a===null&&(a=this.copyLinkData({}),this.setKeyForLinkData(a,r),this.addLinkData(a))}}let i=t.modifiedLinkData;if(Array.isArray(i)){let n=i.length;for(let o=0;o<n;o++){let r=i[o],a=this.getKeyForLinkData(r),h=this.findLinkDataForKey(a);if(h!==null){for(let l in r)l==="__gohashid"||l===this.linkKeyProperty||this.setDataProperty(h,l,r[l]);this.eF(r,h)}}}let s=t.removedLinkKeys;if(Array.isArray(s)){let n=s.length;for(let o=0;o<n;o++){let r=s[o],a=this.findLinkDataForKey(r);a!==null&&this.removeLinkData(a)}}}changeState(t,e){if(!(t===null||t.model!==this)){if(t.change===2){let i=t.object,s=t.propertyName;if(i!==null&&s===this.linkKeyProperty&&this.containsLinkData(i)){let n=t.getValue(e),o=t.getValue(!e);o!==void 0&&this.Oe.delete(o),n!==void 0&&this.Oe.set(n,i),this.et(i,s,n);return}}else if(t.change===3){let i=t.newParam;if(t.modelChange==="linkDataArray"){let s=t.newValue;if(m.$(s)&&typeof i=="number"){let n=this.getKeyForLinkData(s);e?(this.ar.delete(s),this.Os[i]===s&&this.No(this.linkDataArray,i),n!==void 0&&this.Oe.delete(n)):(this.ar.add(s),this.Os[i]!==s&&this.lr(this.Os,i,s),n!==void 0&&this.Oe.set(n,s))}return}else if(t.modelChange==="linkLabelKeys"){let s=t.object,n=s!==null?this.getLabelKeysForLinkData(s):null;Array.isArray(n)&&typeof i=="number"&&(e?(i=n.indexOf(t.newValue),i>=0&&this.No(n,i)):n.indexOf(t.newValue)<0&&this.lr(n,i,t.newValue));return}}else if(t.change===4){let i=t.oldParam;if(t.modelChange==="linkDataArray"){let s=t.oldValue;if(m.$(s)&&typeof i=="number"){let n=this.getKeyForLinkData(s);e?(this.ar.add(s),this.Os[i]!==s&&this.lr(this.Os,i,s),n!==void 0&&this.Oe.set(n,s)):(this.ar.delete(s),this.Os[i]===s&&this.No(this.linkDataArray,i),n!==void 0&&this.Oe.delete(n))}return}else if(t.modelChange==="linkLabelKeys"){let s=t.object,n=s!==null?this.getLabelKeysForLinkData(s):null;Array.isArray(n)&&typeof i=="number"&&(e?n.indexOf(t.oldValue)<0&&this.lr(n,i,t.oldValue):(i=n.indexOf(t.oldValue),i>=0&&this.No(n,i)));return}}super.changeState(t,e)}}get archetypeNodeData(){return this.Vl}set archetypeNodeData(t){let e=this.Vl;e!==t&&(t!==null&&m.wc(t,Vt,"archetypeNodeData"),this.Vl=t,this.t("archetypeNodeData",e,t))}rL(t){if(t===void 0)return;let e=this.Vl;if(e!==null){let i=this.findNodeDataForKey(t);i===null&&(i=this.copyNodeData(e),this.et(i,this.nodeKeyProperty,t),this.addNodeData(i))}return t}get linkFromKeyProperty(){return this.Co}set linkFromKeyProperty(t){let e=this.Co;e!==t&&(this.En(t,Vt,"linkFromKeyProperty"),this.Co=t,this.t("linkFromKeyProperty",e,t))}getFromKeyForLinkData(t){return this.Vi(t,!0)}setFromKeyForLinkData(t,e){this.xg(t,e,!0)}get linkToKeyProperty(){return this.Lo}set linkToKeyProperty(t){let e=this.Lo;e!==t&&(this.En(t,Vt,"linkToKeyProperty"),this.Lo=t,this.t("linkToKeyProperty",e,t))}getToKeyForLinkData(t){return this.Vi(t,!1)}setToKeyForLinkData(t,e){this.xg(t,e,!1)}Vi(t,e){if(t===null)return;let i=e?this.Co:this.Lo;if(i==="")return;let s=this.St(t,i);if(s!==void 0){if(this.isKeyType(s))return s;m.o((e?"FromKey":"ToKey")+" value for link data "+t+" is not a number or a string: "+s)}}xg(t,e,i){if(e===null&&(e=void 0),e!==void 0&&!this.isKeyType(e)&&m.si(e,"number or string",Vt,i?"setFromKeyForLinkData:key":"setToKeyForLinkData:key"),t===null)return;let s=i?this.Co:this.Lo;if(s==="")return;if(e=this.rL(e),!this.containsLinkData(t)){this.et(t,s,e);return}let n=this.St(t,s);n!==e&&(this.ln(n,t),this.et(t,s,e),this.findNodeDataForKey(e)===null&&this.an(e,t),this.Ft(i?"linkFromKey":"linkToKey",2,s,t,n,e),typeof s=="string"&&this.updateTargetBindings(t,s))}get linkFromPortIdProperty(){return this.lc}set linkFromPortIdProperty(t){let e=this.lc;e!==t&&(this.En(t,Vt,"linkFromPortIdProperty"),this.lc=t,this.t("linkFromPortIdProperty",e,t))}getFromPortIdForLinkData(t){return this.Ak(t,!0)}setFromPortIdForLinkData(t,e){this.bg(t,e,!0)}get linkToPortIdProperty(){return this.ac}set linkToPortIdProperty(t){let e=this.ac;e!==t&&(this.En(t,Vt,"linkToPortIdProperty"),this.ac=t,this.t("linkToPortIdProperty",e,t))}getToPortIdForLinkData(t){return this.Ak(t,!1)}setToPortIdForLinkData(t,e){this.bg(t,e,!1)}Ak(t,e){if(t===null)return"";let i=e?this.lc:this.ac;if(i==="")return"";let s=this.St(t,i);return s===void 0?"":s}bg(t,e,i){if(m.s(e,"string",Vt,i?"setFromPortIdForLinkData:portname":"setToPortIdForLinkData:portname"),t===null)return;let s=i?this.lc:this.ac;if(s==="")return;if(!this.containsLinkData(t)){this.et(t,s,e);return}let n=this.St(t,s);n===void 0&&(n=""),n!==e&&(this.et(t,s,e),this.Ft(i?"linkFromPortId":"linkToPortId",2,s,t,n,e),typeof s=="string"&&this.updateTargetBindings(t,s))}get linkLabelKeysProperty(){return this.hn}set linkLabelKeysProperty(t){let e=this.hn;e!==t&&(this.En(t,Vt,"linkLabelKeysProperty"),this.hn=t,this.t("linkLabelKeysProperty",e,t))}getLabelKeysForLinkData(t){if(t===null)return Vt.EmptyArray;let e=this.hn;if(e==="")return Vt.EmptyArray;let i=this.St(t,e);return i===void 0?Vt.EmptyArray:i}setLabelKeysForLinkData(t,e){if(this.sL(e,Vt,"setLabelKeysForLinkData:arr"),t===null)return;let i=this.hn;if(i==="")return;if(!this.containsLinkData(t)){this.et(t,i,e);return}let s=this.St(t,i);if(s===void 0&&(s=Vt.EmptyArray),s!==e){if(Array.isArray(s)){let o=s.length;for(let r=0;r<o;r++){let a=s[r];this.ln(a,t)}}this.et(t,i,e);let n=e.length;for(let o=0;o<n;o++){let r=e[o];this.findNodeDataForKey(r)===null&&this.an(r,t)}this.Ft("linkLabelKeys",2,i,t,s,e),typeof i=="string"&&this.updateTargetBindings(t,i)}}addLabelKeyForLinkData(t,e){if(e==null||(this.isKeyType(e)||m.si(e,"number or string",Vt,"addLabelKeyForLinkData:key"),t===null))return;let i=this.hn;if(i==="")return;let s=this.St(t,i);if(s===void 0){let n=[];n.push(e),this.setLabelKeysForLinkData(t,n)}else if(Array.isArray(s)){let n=s.indexOf(e);if(n>=0)return;n=s.length,s.push(e),this.containsLinkData(t)&&(this.findNodeDataForKey(e)===null&&this.an(e,t),this.Ft("linkLabelKeys",3,i,t,null,e,null,n))}else m.o(i+" property is not an Array; cannot addLabelKeyForLinkData: "+t)}removeLabelKeyForLinkData(t,e){if(e==null||(this.isKeyType(e)||m.si(e,"number or string",Vt,"removeLabelKeyForLinkData:key"),t===null))return;let i=this.hn;if(i==="")return;let s=this.St(t,i);if(Array.isArray(s)){let n=s.indexOf(e);if(n<0)return;this.No(s,n),this.containsLinkData(t)&&(this.ln(e,t),this.Ft("linkLabelKeys",4,i,t,e,null,n,null))}else s!==void 0&&m.o(i+" property is not an Array; cannot removeLabelKeyforLinkData: "+t)}get linkDataArray(){return this.Os}set linkDataArray(t){let e=this.Os;if(e!==t){this.sL(t,Vt,"linkDataArray"),this.Oe.clear();let i=t.length;for(let n=0;n<i;n++){let o=t[n];m.$(o)||m.o("GraphLinksModel.linkDataArray must only contain Objects, not: "+o)}if(this.Os=t,this.linkKeyProperty!==""){let n=new q;for(let r=0;r<i;r++){let a=t[r],h=this.getKeyForLinkData(a);h===void 0||this.Oe.get(h)!==null?n.add(a):this.Oe.set(h,a)}let o=n.iterator;for(;o.next();){let r=o.value;this.makeLinkDataKeyUnique(r);let a=this.getKeyForLinkData(r);a!==void 0&&this.Oe.set(a,r)}}let s=new V;for(let n=0;n<i;n++){let o=t[n];s.add(o)}this.ar=s,this.Ft("linkDataArray",2,"linkDataArray",this,e,t);for(let n=0;n<i;n++){let o=t[n];this.lL(o)}}}get linkKeyProperty(){return this.Ga}set linkKeyProperty(t){let e=this.Ga;if(e!==t){this.En(t,Vt,"linkKeyProperty"),this.Ga=t,this.Oe.clear();let i=this.linkDataArray.length;for(let s=0;s<i;s++){let n=this.linkDataArray[s],o=this.getKeyForLinkData(n);o===void 0&&(this.makeLinkDataKeyUnique(n),o=this.getKeyForLinkData(n)),o!==void 0&&this.Oe.set(o,n)}this.t("linkKeyProperty",e,t)}}getKeyForLinkData(t){if(t===null)return;let e=this.Ga;if(e==="")return;let i=this.St(t,e);if(i!==void 0){if(this.isKeyType(i))return i;m.o("Key value for link data "+t+" is not a number or a string: "+i)}}setKeyForLinkData(t,e){if((e==null||!this.isKeyType(e))&&m.si(e,"number or string",Vt,"setKeyForLinkData:key"),t===null)return;let i=this.Ga;if(i==="")return;if(!this.containsLinkData(t)){this.et(t,i,e);return}let s=this.St(t,i);if(s!==e){if(this.findLinkDataForKey(e)!==null)return;this.et(t,i,e),s!==void 0&&this.Oe.delete(s),this.Oe.set(e,t),this.Ft("linkKey",2,i,t,s,e),typeof i=="string"&&this.updateTargetBindings(t,i)}}get makeUniqueLinkKeyFunction(){return this.$f}set makeUniqueLinkKeyFunction(t){let e=this.$f;e!==t&&(t!==null&&m.S(t,Vt,"makeUniqueLinkKeyFunction"),this.$f=t,this.t("makeUniqueLinkKeyFunction",e,t))}findLinkDataForKey(t){return t===null&&m.o("GraphLinksModel.findLinkDataForKey:key must not be null"),t===void 0||!this.isKeyType(t)?null:this.Oe.get(t)}Ek(t){return t===void 0?!1:this.Oe.has(t)}makeLinkDataKeyUnique(t){if(t===null)return;let e=this.Ga;if(e==="")return;let i=this.getKeyForLinkData(t);if(i!==void 0&&!this.Ek(i))return;let s=this.$f;if(s!==null&&(i=s(this,t),i!=null&&!this.Ek(i))){this.et(t,e,i);return}if(typeof i=="string"){let n=2;for(;this.Ek(i+n);)n++;this.et(t,e,i+n)}else if(i===void 0||typeof i=="number"){let n=-this.Oe.count-1;for(;this.Ek(n);)n--;this.et(t,e,n)}}containsLinkData(t){return t===null?!1:this.ar.has(t)}addLinkData(t){t!==null&&(this.containsLinkData(t)||this.Vv(t,!0))}Vv(t,e){if(this.linkKeyProperty!==""){let s=this.getKeyForLinkData(t);if(s===void 0)this.makeLinkDataKeyUnique(t),s=this.getKeyForLinkData(t);else{if(this.Oe.get(s)===t)return;this.makeLinkDataKeyUnique(t),s=this.getKeyForLinkData(t)}s===void 0&&m.o("GraphLinksModel.makeLinkDataKeyUnique failed on "+t+". Data not added to model."),this.Oe.set(s,t)}this.ar.add(t);let i=null;e&&(i=this.Os.length,this.lr(this.Os,i,t)),this.Ft("linkDataArray",3,"linkDataArray",this,null,t,null,i),this.lL(t)}addLinkDataCollection(t){if(Array.isArray(t)){let e=t.length;for(let i=0;i<e;i++)this.addLinkData(t[i])}else{let e=t.iterator;for(;e.next();){let i=e.value;this.addLinkData(i)}}}removeLinkData(t){t!==null&&this.Uv(t,!0)}Uv(t,e){this.ar.delete(t);let i=this.getKeyForLinkData(t);i!==void 0&&this.Oe.delete(i);let s=null;if(e){if(s=this.Os.indexOf(t),s<0)return;this.No(this.Os,s)}this.Ft("linkDataArray",4,"linkDataArray",this,t,null,s,null),this.f3(t)}removeLinkDataCollection(t){if(Array.isArray(t)){let e=t.length;for(let i=0;i<e;i++)this.removeLinkData(t[i])}else{let e=t.iterator;for(;e.next();){let i=e.value;this.removeLinkData(i)}}}mergeLinkDataArray(t){if(this.linkKeyProperty===""&&m.o("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),t===this.linkDataArray||!Array.isArray(t))return;let e=new V;e.addAll(this.Oe.iteratorKeys);let i=new V,s=t.length;for(let o=0;o<s;o++){let r=t[o],a=this.getKeyForLinkData(r);if(a!==void 0){i.add(a);let h=this.findLinkDataForKey(a);if(h===r)continue;if(h!==null)this.assignAllDataProperties(h,r),this.eF(r,h);else{let l=this.cloneDeep(r);this.setKeyForLinkData(l,a),this.addLinkData(l)}}else{let h=this.cloneDeep(r);this.addLinkData(h);let l=this.getKeyForLinkData(h);l!==void 0&&i.add(l)}}let n=e.iterator;for(;n.next();){let o=n.value;if(!i.has(o)){let r=this.findLinkDataForKey(o);r&&this.removeLinkData(r)}}}lL(t){let e=this.Vi(t,!0);e=this.rL(e),this.findNodeDataForKey(e)===null&&this.an(e,t),e=this.Vi(t,!1),e=this.rL(e),this.findNodeDataForKey(e)===null&&this.an(e,t);let i=this.getLabelKeysForLinkData(t);if(Array.isArray(i)){let s=i.length;for(let n=0;n<s;n++)e=i[n],this.findNodeDataForKey(e)===null&&this.an(e,t)}}f3(t){let e=this.Vi(t,!0);this.ln(e,t),e=this.Vi(t,!1),this.ln(e,t);let i=this.getLabelKeysForLinkData(t);if(Array.isArray(i)){let s=i.length;for(let n=0;n<s;n++)e=i[n],this.ln(e,t)}}get copyLinkDataFunction(){return this.Zf}set copyLinkDataFunction(t){let e=this.Zf;e!==t&&(t!==null&&m.S(t,Vt,"copyLinkDataFunction"),this.Zf=t,this.t("copyLinkDataFunction",e,t))}copyLinkData(t){let e=null,i=this.Zf;return i!==null?e=i(t,this):e=this.Ik(t,!0),m.$(e)&&(this.Co!==""&&this.et(e,this.Co,void 0),this.Lo!==""&&this.et(e,this.Lo,void 0),this.hn!==""&&this.et(e,this.hn,[])),e}get nodeIsGroupProperty(){return this.Qf}set nodeIsGroupProperty(t){let e=this.Qf;e!==t&&(this.En(t,Vt,"nodeIsGroupProperty"),this.Qf=t,this.t("nodeIsGroupProperty",e,t))}isGroupForNodeData(t){if(t===null)return!1;let e=this.Qf;return e===""?!1:!!this.St(t,e)}isGroupForData(t){return this.isGroupForNodeData(t)}get nodeGroupKeyProperty(){return this.Un}set nodeGroupKeyProperty(t){let e=this.Un;e!==t&&(this.En(t,Vt,"nodeGroupKeyProperty"),this.Un=t,this.t("nodeGroupKeyProperty",e,t))}get copiesGroupKeyOfNodeData(){return this.vg}set copiesGroupKeyOfNodeData(t){this.vg!==t&&(m.s(t,"boolean",Vt,"copiesGroupKeyOfNodeData"),this.vg=t)}getGroupKeyForNodeData(t){if(t===null)return;let e=this.Un;if(e==="")return;let i=this.St(t,e);if(i!==void 0){if(this.isKeyType(i))return i;m.o("GroupKey value for node data "+t+" is not a number or a string: "+i)}}getGroupForData(t){return this.getGroupKeyForNodeData(t)}setGroupKeyForNodeData(t,e){if(e===null&&(e=void 0),e!==void 0&&!this.isKeyType(e)&&m.si(e,"number or string",Vt,"setGroupKeyForNodeData:key"),t===null)return;let i=this.Un;if(i==="")return;if(!this.containsNodeData(t)){this.et(t,i,e);return}let s=this.St(t,i);s!==e&&(this.ln(s,t),this.et(t,i,e),this.findNodeDataForKey(e)===null&&this.an(e,t),this.Ft("nodeGroupKey",2,i,t,s,e),typeof i=="string"&&this.updateTargetBindings(t,i))}setGroupForData(t,e){this.setGroupKeyForNodeData(t,e)}copyNodeData(t){let e=super.copyNodeData(t);return!this.copiesGroupKeyOfNodeData&&this.Un!==""&&this.St(e,this.Un)!==void 0&&this.et(e,this.Un,void 0),e}setDataProperty(t,e,i){if(this.containsNodeData(t)){if(e===this.nodeKeyProperty){this.setKeyForNodeData(t,i);return}else if(e===this.nodeCategoryProperty){this.setCategoryForNodeData(t,i);return}else if(e===this.nodeGroupKeyProperty){this.setGroupKeyForNodeData(t,i);return}}else if(this.containsLinkData(t)){if(e===this.linkFromKeyProperty){this.xg(t,i,!0);return}else if(e===this.linkToKeyProperty){this.xg(t,i,!1);return}else if(e===this.linkFromPortIdProperty){this.bg(t,i,!0);return}else if(e===this.linkToPortIdProperty){this.bg(t,i,!1);return}else if(e===this.linkKeyProperty){this.setKeyForLinkData(t,i);return}else if(e===this.linkCategoryProperty){this.setCategoryForLinkData(t,i);return}else if(e===this.linkLabelKeysProperty){this.setLabelKeysForLinkData(t,i);return}}let s=this.St(t,e);s!==i&&(this.et(t,e,i),this.raiseDataChanged(t,e,s,i))}assignAllDataProperties(t,e){if(!e)return;let i=this.containsNodeData(t),s=this.containsLinkData(t);for(let n in e)if(n!=="__gohashid"&&!(i&&n===this.nodeKeyProperty)){if(i&&n===this.nodeIsGroupProperty&&this.St(t,n)===e[n]||s&&n===this.linkKeyProperty)continue;this.setDataProperty(t,n,e[n])}}dw(t,e){super.dw(t,e);let i=this.be.iterator;for(;i.next();){let n=i.value;this.aL(n,t,e)}let s=this.ar.iterator;for(;s.next();){let n=s.value;this.u3(n,t,e)}}aL(t,e,i){if(this.getGroupKeyForNodeData(t)===e){let s=this.Un;this.et(t,s,i),this.Ft("nodeGroupKey",2,s,t,e,i),typeof s=="string"&&this.updateTargetBindings(t,s)}}u3(t,e,i){if(this.Vi(t,!0)===e){let n=this.Co;this.et(t,n,i),this.Ft("linkFromKey",2,n,t,e,i),typeof n=="string"&&this.updateTargetBindings(t,n)}if(this.Vi(t,!1)===e){let n=this.Lo;this.et(t,n,i),this.Ft("linkToKey",2,n,t,e,i),typeof n=="string"&&this.updateTargetBindings(t,n)}let s=this.getLabelKeysForLinkData(t);if(Array.isArray(s)){let n=s.length,o=this.hn;for(let r=0;r<n;r++)s[r]===e&&(this.Wv(s,r,i),this.Ft("linkLabelKeys",3,o,t,e,i,r,r))}}nL(){super.nL();let t=this.linkDataArray,e=t.length;for(let i=0;i<e;i++){let s=t[i];this.lL(s)}}Tg(t){super.Tg(t);let e=this.getKeyForNodeData(t),i=this.lw(e);if(i!==null){let s=m.nt(),n=i.iterator;for(;n.next();){let o=n.value;if(this.containsNodeData(o)){if(this.getGroupKeyForNodeData(o)===e){let r=this.Un;this.Ft("nodeGroupKey",2,r,o,e,e),typeof r=="string"&&this.updateTargetBindings(o,r),s.push(o)}}else{if(this.Vi(o,!0)===e){let a=this.Co;this.Ft("linkFromKey",2,a,o,e,e),typeof a=="string"&&this.updateTargetBindings(o,a),s.push(o)}if(this.Vi(o,!1)===e){let a=this.Lo;this.Ft("linkToKey",2,a,o,e,e),typeof a=="string"&&this.updateTargetBindings(o,a),s.push(o)}let r=this.getLabelKeysForLinkData(o);if(Array.isArray(r)){let a=r.length,h=this.hn;for(let l=0;l<a;l++)r[l]===e&&(this.Ft("linkLabelKeys",3,h,o,e,e,l,l),s.push(o))}}}for(let o=0;o<s.length;o++)this.ln(e,s[o]);m.Z(s)}}Dg(t){super.Dg(t);let e=this.getGroupKeyForNodeData(t);this.findNodeDataForKey(e)===null&&this.an(e,t)}gw(t){super.gw(t);let e=this.getGroupKeyForNodeData(t);this.ln(e,t)}get linkCategoryProperty(){return this.hc}set linkCategoryProperty(t){let e=this.hc;e!==t&&(this.En(t,Vt,"linkCategoryProperty"),this.hc=t,this.t("linkCategoryProperty",e,t))}getCategoryForLinkData(t){if(t===null)return"";let e=this.hc;if(e==="")return"";let i=this.St(t,e);if(i===void 0)return"";if(typeof i=="string")return i;m.o("getCategoryForLinkData found a non-string category for "+t+": "+i)}getLinkCategoryForData(t){return this.getCategoryForLinkData(t)}setCategoryForLinkData(t,e){if(m.s(e,"string",Vt,"setCategoryForLinkData:cat"),t===null)return;let i=this.hc;if(i==="")return;if(!this.containsLinkData(t)){this.et(t,i,e);return}let s=this.St(t,i);s===void 0&&(s=""),s!==e&&(this.et(t,i,e),this.Ft("linkCategory",2,i,t,s,e),typeof i=="string"&&this.updateTargetBindings(t,i))}setLinkCategoryForData(t,e){this.setCategoryForLinkData(t,e)}Ag(t,e){super.Ag(t,e),this.setGroupKeyForNodeData(e,this.getGroupKeyForNodeData(t))}eF(t,e){this.setCategoryForLinkData(e,this.getCategoryForLinkData(t)),this.setFromKeyForLinkData(e,this.getFromKeyForLinkData(t)),this.setToKeyForLinkData(e,this.getToKeyForLinkData(t)),this.setLabelKeysForLinkData(e,this.getLabelKeysForLinkData(t)),this.setFromPortIdForLinkData(e,this.getFromPortIdForLinkData(t)),this.setToPortIdForLinkData(e,this.getToPortIdForLinkData(t))}get type(){return"GraphLinksModel"}Um(){return!0}jh(){return!0}Ax(){return!0}ff(){return!0}static EmptyArray=Object.freeze([])}ut.Sl(Vt,"GraphLinksModel"),ut.jv=()=>new Vt,ut.p2=()=>new Vt;class Be extends ut{Vn;Fg;cc;constructor(t,e){if(super(),this.Vn="parent",this.Fg=!1,this.cc="parentLinkCategory",t!==void 0&&(Array.isArray(t)?this.nodeDataArray=t:e=t),e){Object.assign(this,e);let i=e.Changed;i&&(delete this.Changed,this.addChangedListener(i))}}cloneProtected(t){super.cloneProtected(t),t.Vn=this.Vn,t.Fg=this.Fg,t.cc=this.cc}toString(t){if(t===void 0&&(t=0),t>=2)return this.toJson();{let e=(this.name!==""?this.name:"")+" TreeModel";if(t>0){e+=`
|
|
49
49
|
node data:`;let i=this.nodeDataArray,s=i.length;for(let n=0;n<s;n++){let o=i[n];e+=" "+this.getKeyForNodeData(o)+":"+te.toString(o)}}return e}}Lg(){let t=super.Lg(),e="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(e+=`,
|
|
50
|
-
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),t+e}fw(t){super.fw(t),t.nodeParentKeyProperty&&(this.nodeParentKeyProperty=t.nodeParentKeyProperty)}uw(t){t.nodeParentKeyProperty!==void 0&&t.nodeParentKeyProperty!==this.nodeParentKeyProperty&&m.o("applyIncrementalJson cannot change Model properties"),super.uw(t)}maybeEnsureLinkReference(t){return t}get nodeParentKeyProperty(){return this.Vn}set nodeParentKeyProperty(t){let e=this.Vn;e!==t&&(this.En(t,Be,"nodeParentKeyProperty"),this.Vn=t,this.t("nodeParentKeyProperty",e,t))}get copiesParentKeyOfNodeData(){return this.Fg}set copiesParentKeyOfNodeData(t){this.Fg!==t&&(m.s(t,"boolean",Be,"copiesParentKeyOfNodeData"),this.Fg=t)}getParentKeyForNodeData(t){if(t===null)return;let e=this.Vn;if(e==="")return;let i=this.St(t,e);if(i!==void 0){if(this.isKeyType(i))return i;m.o("ParentKey value for node data "+t+" is not a number or a string: "+i)}}setParentKeyForNodeData(t,e){if(e===null&&(e=void 0),e!==void 0&&!this.isKeyType(e)&&m.si(e,"number or string",Be,"setParentKeyForNodeData:key"),t===null)return;let i=this.Vn;if(i==="")return;if(e=this.maybeEnsureLinkReference(e),!this.containsNodeData(t)){this.et(t,i,e);return}let s=this.St(t,i);s!==e&&(this.ln(s,t),this.et(t,i,e),this.findNodeDataForKey(e)===null&&this.an(e,t),this.Ft("nodeParentKey",2,i,t,s,e),typeof i=="string"&&this.updateTargetBindings(t,i))}get parentLinkCategoryProperty(){return this.cc}set parentLinkCategoryProperty(t){let e=this.cc;e!==t&&(this.En(t,Be,"parentLinkCategoryProperty"),this.cc=t,this.t("parentLinkCategoryProperty",e,t))}get linkCategoryProperty(){return this.parentLinkCategoryProperty}set linkCategoryProperty(t){this.parentLinkCategoryProperty=t}getParentLinkCategoryForNodeData(t){if(t===null)return"";let e=this.cc;if(e==="")return"";let i=this.St(t,e);if(i===void 0)return"";if(typeof i=="string")return i;m.o("getParentLinkCategoryForNodeData found a non-string category for "+t+": "+i)}getLinkCategoryForData(t){return this.getParentLinkCategoryForNodeData(t)}setParentLinkCategoryForNodeData(t,e){if(m.s(e,"string",Be,"setParentLinkCategoryForNodeData:cat"),t===null)return;let i=this.cc;if(i==="")return;if(!this.containsNodeData(t)){this.et(t,i,e);return}let s=this.St(t,i);s===void 0&&(s=""),s!==e&&(this.et(t,i,e),this.Ft("parentLinkCategory",2,i,t,s,e),typeof i=="string"&&this.updateTargetBindings(t,i))}setLinkCategoryForData(t,e){this.setParentLinkCategoryForNodeData(t,e)}copyNodeData(t){let e=super.copyNodeData(t);return!this.copiesParentKeyOfNodeData&&this.Vn!==""&&this.St(e,this.Vn)!==void 0&&this.et(e,this.Vn,void 0),e}setDataProperty(t,e,i){if(this.containsNodeData(t)){if(e===this.nodeKeyProperty){this.setKeyForNodeData(t,i);return}else if(e===this.nodeCategoryProperty){this.setCategoryForNodeData(t,i);return}else if(e===this.nodeParentKeyProperty){this.setParentKeyForNodeData(t,i);return}else if(e===this.parentLinkCategoryProperty){this.setParentLinkCategoryForNodeData(t,i);return}}let s=this.St(t,e);s!==i&&(this.et(t,e,i),this.raiseDataChanged(t,e,s,i))}dw(t,e){super.dw(t,e);let i=this.be.iterator;for(;i.next();){let s=i.value;this.aL(s,t,e)}}aL(t,e,i){if(this.getParentKeyForNodeData(t)===e){let s=this.Vn;this.et(t,s,i),this.Ft("nodeParentKey",2,s,t,e,i),typeof s=="string"&&this.updateTargetBindings(t,s)}}Tg(t){super.Tg(t);let e=this.getKeyForNodeData(t),i=this.lw(e);if(i!==null){let s=m.nt(),n=i.iterator;for(;n.next();){let o=n.value;if(this.containsNodeData(o)&&this.getParentKeyForNodeData(o)===e){let r=this.Vn;this.Ft("nodeParentKey",2,r,o,e,e),typeof r=="string"&&this.updateTargetBindings(o,r),s.push(o)}}for(let o=0;o<s.length;o++)this.ln(e,s[o]);m.Z(s)}}Dg(t){super.Dg(t);let e=this.getParentKeyForNodeData(t);e=this.maybeEnsureLinkReference(e),this.findNodeDataForKey(e)===null&&this.an(e,t)}gw(t){super.gw(t);let e=this.getParentKeyForNodeData(t);this.ln(e,t)}Ag(t,e){super.Ag(t,e),this.setParentLinkCategoryForNodeData(e,this.getParentLinkCategoryForNodeData(t)),this.setParentKeyForNodeData(e,this.getParentKeyForNodeData(t))}get type(){return"TreeModel"}Vm(){return!0}Ax(){return!0}}ut.Sl(Be,"TreeModel");var ts=(x=>(x[x.ConstantSpacing=0]="ConstantSpacing",x[x.ConstantDistance=1]="ConstantDistance",x[x.ConstantAngle=2]="ConstantAngle",x[x.Packed=3]="Packed",x))(ts||{}),es=(x=>(x[x.Clockwise=10]="Clockwise",x[x.Counterclockwise=11]="Counterclockwise",x[x.BidirectionalLeft=12]="BidirectionalLeft",x[x.BidirectionalRight=13]="BidirectionalRight",x))(es||{}),is=(x=>(x[x.Forwards=20]="Forwards",x[x.Reverse=21]="Reverse",x[x.Ascending=22]="Ascending",x[x.Descending=23]="Descending",x[x.Optimized=24]="Optimized",x))(is||{}),ss=(x=>(x[x.Pythagorean=30]="Pythagorean",x[x.Circular=31]="Circular",x))(ss||{});class Ve extends _t{gi;_f;Uk;Rg;Vk;Ya;hL;cL;fL;Is;mw;pw;fc;yw;iF;Og;Ig;Eg;tu;He;P;Si;Mi;In;Ug;constructor(t){super(),this.gi=0,this._f=0,this.Uk=0,this.Rg=360,this.Vk=0,this.Ya=0,this.hL=new P,this.cL=30,this.fL=0,this.Is=0,this.mw=0,this.pw=new Hs,this.fc=0,this.yw=0,this.iF=600,this.Og=NaN,this.Ig=1,this.Eg=0,this.tu=360,this.He=0,this.P=10,this.Si=24,this.Mi=Ie.standardComparer,this.In=6,this.Ug=30,t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Og=this.Og,t.Ig=this.Ig,t.Eg=this.Eg,t.tu=this.tu,t.He=this.He,t.P=this.P,t.Si=this.Si,t.Mi=this.Mi,t.In=this.In,t.Ug=this.Ug}fe(t){t in is?this.sorting=t:t in es?this.direction=t:t in ts?this.arrangement=t:t in ss?this.nodeDiameterFormula=t:super.fe(t)}createNetwork(){return new Ws(this)}d3(t,e,i){t=this.g3(t);let s=this.Vk,n=this.cL,o=this.gi,r=this._f,a=this.Uk,h=this.Rg,l=this.Ya,u=this.fL,c=this.Is,d=this.mw;if(s=this.arrangement,n=this.nodeDiameterFormula,o=this.radius,(!isFinite(o)||o<=0)&&(o=NaN),r=this.aspectRatio,(!isFinite(r)||r<=0)&&(r=1),a=this.startAngle,isFinite(a)||(a=0),h=this.sweepAngle,(!isFinite(h)||h>360||h<1)&&(h=360),l=this.spacing,isFinite(l)||(l=NaN),s===3&&n===31?s=0:s===3&&n!==31&&(n=31,s=this.arrangement),(this.direction===12||this.direction===13)&&this.sorting!==24){for(let g=0;!(g>=t.length||(e.add(t.elt(g)),g+1>=t.length));g+=2)i.add(t.elt(g+1));this.direction===12?(this.arrangement===3&&e.reverse(),t=new q,t.addAll(e),t.addAll(i)):(this.arrangement===3&&i.reverse(),t=new q,t.addAll(i),t.addAll(e))}let f=t.length;u=0;let p=0;for(let g=0;g<t.length;g++){let y=a+h*p*(this.direction===10?1:-1)/f,b=t.elt(g).diameter;isNaN(b)&&(b=t.elt(g).Ka(y)),h<360&&(g===0||g===t.length-1)&&(b/=2),u+=b,p++}if(isNaN(o)||s===3){if(isNaN(l)&&(l=6),s!==0&&s!==3){let g=-1/0;for(let y=0;y<f;y++){let b=t.elt(y),v=t.elt(y===f-1?0:y+1);isNaN(b.diameter)&&b.Ka(0),isNaN(v.diameter)&&v.Ka(0),g=Math.max(g,(b.diameter+v.diameter)/2)}if(d=g+l,s===2){let y=2*Math.PI/f,b=(g+l)/y;r>1?(o=b,c=o*r):(c=b,o=c)}else o=this.Bk(d*(h>=360?f:f-1),r,a*Math.PI/180,h*Math.PI/180)}else o=this.Bk(u+(h>=360?f:f-1)*(s!==3?l:l*1.6),r,a*Math.PI/180,h*Math.PI/180);c=o*r}else{c=o*r;let g=this.uL(o,c,a*Math.PI/180,h*Math.PI/180);if(isNaN(l))s===0&&(l=(g-u)/(h>=360?f:f-1));else if(s===0){let y=(g-u)/(h>=360?f:f-1);y<l?(o=this.Bk(u+l*(h>=360?f:f-1),r,a*Math.PI/180,h*Math.PI/180),c=o*r):l=y}else{let y=-1/0;for(let w=0;w<f;w++){let k=t.elt(w),S=t.elt(w===f-1?0:w+1);isNaN(k.diameter)&&k.Ka(0),isNaN(S.diameter)&&S.Ka(0),y=Math.max(y,(k.diameter+S.diameter)/2)}let b=y+l,v=this.Bk(b*(h>=360?f:f-1),r,a*Math.PI/180,h*Math.PI/180);v>o?(o=v,c=o*r,d=b):d=g/(h>=360?f:f-1)}}return this.Vk=s,this.cL=n,this.gi=o,this._f=r,this.Uk=a,this.Rg=h,this.Ya=l,this.fL=u,this.Is=c,this.mw=d,t}doLayout(t){this.network===null&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);let e=this.network.vertexes;if(e.count<=1){if(e.count===1){let d=e.first();d.centerX=0,d.centerY=0}this.updateParts(),this.network=null,this.isValidLayout=!0;return}let i=new q;i.addAll(e.iterator);let s=new q,n=new q;i=this.d3(i,s,n);let o=this.Vk,r=this.gi,a=this.Uk,h=this.Rg,l=this.Ya,u=this.Is,c=this.mw;if((this.direction===12||this.direction===13)&&o===3)this.sF(i,h,a-h/2,10);else if(this.direction===12||this.direction===13){let d=0;switch(o){case 1:d=this.zk(r,u,a,c)*180/Math.PI;break;case 0:{let f=0,p=0,g=s.first();g!==null&&(f=g.Ka(Math.PI/2));let y=n.first();y!==null&&(p=y.Ka(Math.PI/2)),d=this.zk(r,u,a,l+(f+p)/2)*180/Math.PI;break}case 2:d=h/i.length;break}if(this.direction===12){switch(o){case 1:this.ww(s,h/2,a,11);break;case 0:this.xw(s,h/2,a,11);break;case 2:this.bw(s,h/2,a,11);break}switch(o){case 1:this.ww(n,h/2,a+d,10);break;case 0:this.xw(n,h/2,a+d,10);break;case 2:this.bw(n,h/2,a+d,10);break}}else{switch(o){case 1:this.ww(n,h/2,a,11);break;case 0:this.xw(n,h/2,a,11);break;case 2:this.bw(n,h/2,a,11);break}switch(o){case 1:this.ww(s,h/2,a+d,10);break;case 0:this.xw(s,h/2,a+d,10);break;case 2:this.bw(s,h/2,a+d,10);break}}}else switch(o){case 1:this.ww(i,h,a,this.direction);break;case 0:this.xw(i,h,a,this.direction);break;case 2:this.bw(i,h,a,this.direction);break;case 3:this.sF(i,h,a,this.direction);break}this.updateParts(),this.network=null,this.isValidLayout=!0}bw(t,e,i,s){let n=this.Rg,o=this.gi,r=this.Is,a=i*Math.PI/180,h=e*Math.PI/180,l=t.length;for(let u=0;u<l;u++){let c=a+(s===10?u*h/(n>=360?l:l-1):-(u*h)/l),d=t.elt(u),f=o*Math.tan(c)/r,p=Math.sqrt((o*o+r*r*f*f)/(1+f*f));d.centerX=p*Math.cos(c),d.centerY=p*Math.sin(c),d.actualAngle=c*180/Math.PI}}xw(t,e,i,s){let n=this.gi,o=this.Is,r=this.Ya,a=i*Math.PI/180,h=t.length;for(let l=0;l<h;l++){let u=t.elt(l),c=t.elt(l===h-1?0:l+1),d=n*Math.cos(a),f=o*Math.sin(a);u.centerX=d,u.centerY=f,u.actualAngle=a*180/Math.PI,isNaN(u.diameter)&&u.Ka(0),isNaN(c.diameter)&&c.Ka(0);let p=(u.diameter+c.diameter)/2,g=this.zk(n,o,s===10?a:-a,p+r);a+=s===10?g:-g}}ww(t,e,i,s){let n=this.gi,o=this.Is,r=this.mw,a=i*Math.PI/180,h=t.length;for(let l=0;l<h;l++){let u=t.elt(l);u.centerX=n*Math.cos(a),u.centerY=o*Math.sin(a),u.actualAngle=a*180/Math.PI;let c=this.zk(n,o,s===10?a:-a,r);a+=s===10?c:-c}}sF(t,e,i,s){let n=this.yw,o=this.Rg;if(this.fc=0,this.pw=new Hs,e<360){for(n=i+(s===10?o:-o);n<0;)n+=360;n%=360,n>180&&(n-=360),n*=Math.PI/180,this.yw=n,this.nF(t,e,i,s)}else this.oF(t,e,i,s);this.pw.commit(t)}oF(t,e,i,s){let n=this.gi,o=this.Is,r=this.Ya,a=this._f,h=n*Math.cos(i*Math.PI/180),l=o*Math.sin(i*Math.PI/180),u=t.toArray();if(u.length===3){u[0].centerX=n,u[0].centerY=0,u[1].centerX=u[0].centerX-u[0].width/2-u[1].width/2-r,u[1].y=u[0].y,u[2].centerX=(u[0].centerX+u[1].centerX)/2,u[2].y=u[0].y-u[2].height-r;return}else if(u.length===4){u[0].centerX=n,u[0].centerY=0,u[2].centerX=-u[0].centerX,u[2].centerY=u[0].centerY,u[1].centerX=0,u[1].y=Math.min(u[0].y,u[2].y)-u[1].height-r,u[3].centerX=0,u[3].y=Math.max(u[0].y+u[0].height+r,u[2].y+u[2].height+r);return}let c=P.l();for(let k=0;k<u.length&&(u[k].centerX=h,u[k].centerY=l,!(k>=u.length-1));k++)this.rF(h,l,u,k,s,c)||this.lF(h,l,u,k,s,c),h=c.x,l=c.y;if(P.i(c),this.fc++,this.fc>23)return;let d=u[0].centerX,f=u[0].centerY,p=u[u.length-1].centerX,g=u[u.length-1].centerY,y=Math.abs(d-p)-((u[0].width+u[u.length-1].width)/2+r),b=Math.abs(f-g)-((u[0].height+u[u.length-1].height)/2+r),v=0;if(Math.abs(b)<1){let k=Math.abs(d-p),S=(u[0].width+u[u.length-1].width)/2;k<S&&(v=0),y=k-S}else b>0?v=b:Math.abs(y)<1?v=0:v=y;let w=!1;Math.abs(p)>Math.abs(g)?w=p>0!=f>g:w=g>0!=d<p,w=s===10?w:!w,w&&(v=-Math.abs(v),v=Math.min(v,-u[u.length-1].width),v=Math.min(v,-u[u.length-1].height)),this.pw.m3(v,u),Math.abs(v)>1&&(this.fc<8?this.gi-=v/(2*Math.PI):u.length<5&&v>10?this.gi/=2:this.gi-=v>0?1.7:-2.3,this.Is=this.gi*a,this.oF(t,e,i,s))}nF(t,e,i,s){let n=this.gi,o=this.Is,r=this._f,a=n*Math.cos(i*Math.PI/180),h=o*Math.sin(i*Math.PI/180),l=P.l(),u=t.toArray();for(let p=0;p<u.length&&(u[p].centerX=a,u[p].centerY=h,!(p>=u.length-1));p++)this.rF(a,h,u,p,s,l)||this.lF(a,h,u,p,s,l),a=l.x,h=l.y;if(P.i(l),this.fc++,this.fc>23)return;let c=Math.atan2(h,a),d=s===10?this.yw-c:c-this.yw;d=Math.abs(d)<Math.abs(d-2*Math.PI)?d:d-2*Math.PI;let f=d*(n+o)/2;this.pw.p3(f,u),Math.abs(f)>1&&(this.fc<8?this.gi-=f/(2*Math.PI):this.gi-=f>0?1.7:-2.3,this.Is=this.gi*r,this.nF(t,e,i,s))}rF(t,e,i,s,n,o){let r=this.Ya,a=this.gi,h=this.Is,l=0,u=0,c=(i[s].width+i[s+1].width)/2+r,d=!1;if(e>=0!=(n===10)){if(l=t+c,l>a){if(l=t-c,l<-a)return o.x=l,o.y=u,!1;d=!0}}else if(l=t-c,l<-a){if(l=t+c,l>a)return o.x=l,o.y=u,!1;d=!0}return u=Math.sqrt(1-Math.min(1,l*l/(a*a)))*h,e<0!==d&&(u=-u),Math.abs(e-u)>(i[s].height+i[s+1].height)/2?(o.x=l,o.y=u,!1):(o.x=l,o.y=u,!0)}lF(t,e,i,s,n,o){let r=this.Ya,a=this.gi,h=this.Is,l=0,u=0,c=(i[s].height+i[s+1].height)/2+r,d=!1;if(t>=0!=(n===10)){if(u=e-c,u<-h){if(u=e+c,u>h)return o.x=l,o.y=u,!1;d=!0}}else if(u=e+c,u>h){if(u=e-c,u<-h)return o.x=l,o.y=u,!1;d=!0}return l=Math.sqrt(1-Math.min(1,u*u/(h*h)))*a,t<0!==d&&(l=-l),Math.abs(t-l)>(i[s].width+i[s+1].width)/2?(o.x=l,o.y=u,!1):(o.x=l,o.y=u,!0)}commitLayout(){this.commitNodes(),this.isRouting&&this.commitLinks()}commitNodes(){let t=this.group!==null&&this.group.hasPlaceholder(),e=t?this.group.location.copy():null,i=this.actualCenter;if(t?i=new P(0,0):(i.x=this.arrangementOrigin.x+this.gi,i.y=this.arrangementOrigin.y+this.Is),this.network!==null){let s=this.network.vertexes.iterator;for(;s.next();){let n=s.value;n.x+=i.x,n.y+=i.y,n.commit()}}if(t&&this.group&&e){this.group.ensureBounds();let s=this.group.position.copy(),n=this.group.location.copy(),o=e.subtract(n.subtract(s));this.group.move(o),this.hL=o.subtract(s)}}commitLinks(){if(this.network!==null){let t=this.network.edges.iterator;for(;t.next();)t.value.commit()}}uL(t,e,i,s){let n=this.iF;if(Math.abs(this._f-1)<.001)return i!==void 0&&s!==void 0?s*t:2*Math.PI*t;let o=t>e?Math.sqrt(t*t-e*e)/t:Math.sqrt(e*e-t*t)/e,r=0,a=0;i!==void 0&&s!==void 0?a=s/(n+1):a=Math.PI/(2*(n+1));let h=0;for(let l=0;l<=n;l++){i!==void 0&&s!==void 0?h=i+l*s/n:h=l*Math.PI/(2*n);let u=Math.sin(h);r+=Math.sqrt(1-o*o*u*u)*a}return i!==void 0&&s!==void 0?(t>e?t:e)*r:4*(t>e?t:e)*r}Bk(t,e,i,s){let n=0;return i!==void 0&&s!==void 0?n=this.uL(1,e,i,s):n=this.uL(1,e),t/n}zk(t,e,i,s){if(Math.abs(this._f-1)<.001)return s/t;let n=t>e?Math.sqrt(t*t-e*e)/t:Math.sqrt(e*e-t*t)/e,o=0,r=2*Math.PI/(this.network.vertexes.count*700);t>e&&(i+=Math.PI/2);for(let a=0;;a++){let h=i+a*r,l=Math.sin(h);if(o+=(t>e?t:e)*Math.sqrt(1-n*n*l*l)*r,o>=s)return a*r}}g3(t){switch(this.sorting){case 20:break;case 21:t.reverse();break;case 22:t.sort(this.comparer);break;case 23:t.sort(this.comparer),t.reverse();break;case 24:return this.y3(this.w3(t));default:m.o("Invalid sorting type.")}return t}w3(t){let e=[];for(let s=0;s<t.length;s++)e.push(0);let i=new q;for(let s=0;s<t.length;s++){let n=-1,o=-1;if(s===0)for(let u=0;u<t.length;u++){let c=t.elt(u).edgesCount;c>n&&(n=c,o=u)}else for(let u=0;u<t.length;u++){let c=e[u];c>n&&(n=c,o=u)}i.add(t.elt(o)),e[o]=-1;let r=t.elt(o),a=0,h=r.sourceEdges;for(;h.next();){let u=h.value.fromVertex;a=t.indexOf(u),!(a<0)&&e[a]>=0&&e[a]++}let l=r.destinationEdges;for(;l.next();){let u=l.value.toVertex;a=t.indexOf(u),!(a<0)&&e[a]>=0&&e[a]++}}return i}y3(t){let e=[];for(let c=0;c<t.length;c++){let d=t.elt(c);e[c]=[];let f=0,p=d.destinationEdges;for(;p.next();){let y=p.value.toVertex;f=t.indexOf(y),f!==c&&e[c].indexOf(f)<0&&e[c].push(f)}let g=d.sourceEdges;for(;g.next();){let y=g.value.fromVertex;f=t.indexOf(y),f!==c&&e[c].indexOf(f)<0&&e[c].push(f)}}let i=[];for(let c=0;c<e.length;c++)i[c]=0;let s=[],n=[],o=[],r=[],a=new q,h=0;for(let c=0;c<e.length;c++){let d=e[c].length;if(d===1){r.push(c);continue}if(d===0){a.add(t.elt(c));continue}if(h===0){s.push(c),h++;continue}let f=1/0,p=1/0,g=-1,y=[];for(let b=0;b<s.length;b++)e[s[b]].indexOf(s[b===s.length-1?0:b+1])<0&&y.push(b===s.length-1?0:b+1);if(y.length===0)for(let b=0;b<s.length;b++)y.push(b);for(let b=0;b<y.length;b++){let v=y[b],w=this.x3(e[c],n,o,i,v,s),k=0;for(let S=0;S<e[c].length;S++){let N=e[c][S],D=s.indexOf(N);if(D>=0){let L=Math.abs(v-(D>=v?D+1:D));k+=L<s.length+1-L?L:s.length+1-L}}for(let S=0;S<n.length;S++){let N=i[n[S]],D=i[o[S]];if(N>=v&&N++,D>=v&&D++,N>D){let L=D;D=N,N=L}D-N<(s.length+2)/2==(N<v&&v<=D)&&k++}(w<f||w===f&&k<p)&&(f=w,p=k,g=v)}s.splice(g,0,c);for(let b=0;b<s.length;b++)i[s[b]]=b;for(let b=0;b<e[c].length;b++){let v=e[c][b];s.indexOf(v)>=0&&(n.push(c),o.push(v))}h++}let l=!1,u=s.length;for(;;){l=!0;for(let c=0;c<r.length;c++){let d=r[c],f=e[d][0],p=s.indexOf(f);if(p>=0){let g=0;for(let y=0;y<e[f].length;y++){let b=e[f][y],v=s.indexOf(b);if(v<0||v===p)continue;let w=v>p?v-p:p-v,k=u-w;g+=v<p!=w>k?1:-1}s.splice(g<0?p:p+1,0,d),r.splice(c,1),c--}else l=!1}if(l)break;s.push(r[0]),r.splice(0,1)}for(let c=0;c<s.length;c++){let d=s[c];a.add(t.elt(d))}return a}x3(t,e,i,s,n,o){let r=0;for(let a=0;a<e.length;a++){let h=e[a],l=i[a],u=s[h],c=s[l],d=0,f=0;if(u<c?(d=u,f=c):(d=c,f=u),d<n&&n<=f)for(let p=0;p<t.length;p++){let g=t[p];o.indexOf(g)<0||d<s[g]&&s[g]<f||d===s[g]||f===s[g]||r++}else for(let p=0;p<t.length;p++){let g=t[p];o.indexOf(g)<0||!(d<s[g]&&s[g]<f)||d===s[g]||f===s[g]||r++}}return r}get radius(){return this.Og}set radius(t){this.Og!==t&&(m.s(t,"number",Ve,"radius"),(t>0||isNaN(t))&&(this.Og=t,this.p()))}get aspectRatio(){return this.Ig}set aspectRatio(t){this.Ig!==t&&(m.s(t,"number",Ve,"aspectRatio"),t>0&&(this.Ig=t,this.p()))}get startAngle(){return this.Eg}set startAngle(t){this.Eg!==t&&(m.s(t,"number",Ve,"startAngle"),this.Eg=t,this.p())}get sweepAngle(){return this.tu}set sweepAngle(t){this.tu!==t&&(m.s(t,"number",Ve,"sweepAngle"),t>0&&t<=360?this.tu=t:this.tu=360,this.p())}get arrangement(){return this.He}set arrangement(t){this.He!==t&&(t===3||t===0||t===1||t===2)&&(this.He=t,this.p())}get direction(){return this.P}set direction(t){this.P!==t&&(t===10||t===11||t===12||t===13)&&(this.P=t,this.p())}get sorting(){return this.Si}set sorting(t){this.Si!==t&&(this.Si=t,this.p())}get comparer(){return this.Mi}set comparer(t){this.Mi!==t&&(m.S(t,Ve,"comparer"),this.Mi=t,this.p())}get spacing(){return this.In}set spacing(t){this.In!==t&&(m.s(t,"number",Ve,"spacing"),this.In=t,this.p())}get nodeDiameterFormula(){return this.Ug}set nodeDiameterFormula(t){this.Ug!==t&&(t===30||t===31)&&(this.Ug=t,this.p())}get actualXRadius(){return this.gi}get actualYRadius(){return this.Is}get actualSpacing(){return this.Ya}get actualCenter(){return this.hL}static ConstantSpacing=0;static ConstantDistance=1;static ConstantAngle=2;static Packed=3;static Clockwise=10;static Counterclockwise=11;static BidirectionalLeft=12;static BidirectionalRight=13;static Forwards=20;static Reverse=21;static Ascending=22;static Descending=23;static Optimized=24;static Pythagorean=30;static Circular=31}class Hs{eu;uc;iu;constructor(){this.eu=-1/0,this.uc=null,this.iu=null}m3(t,e){if(t>0&&this.eu<0||Math.abs(t)<Math.abs(this.eu)&&!(t<0&&this.eu>0)){this.eu=t,this.uc=[],this.iu=[];for(let i=0;i<e.length;i++)this.uc[i]=e[i].bounds.x,this.iu[i]=e[i].bounds.y}}p3(t,e){if(Math.abs(t)<Math.abs(this.eu)){this.eu=t,this.uc=[],this.iu=[];for(let i=0;i<e.length;i++)this.uc[i]=e[i].bounds.x,this.iu[i]=e[i].bounds.y}}commit(t){if(!(this.uc===null||this.iu===null))for(let e=0;e<this.uc.length;e++){let i=t.elt(e);i.x=this.uc[e],i.y=this.iu[e]}}}class Ws extends Ee{constructor(t){super(t)}createVertex(){return new di(this)}createEdge(){return new $s(this)}}class di extends Ie{Ao;Xk;constructor(t){super(t),this.Ao=NaN,this.Xk=NaN}Ka(t){let e=this.network;if(e===null)return NaN;let i=e.layout;if(i===null)return NaN;if(i.arrangement===3){if(i.nodeDiameterFormula===31)return this.Ao=Math.max(this.width,this.height),this.Ao;{let s=Math.abs(Math.sin(t)),n=Math.abs(Math.cos(t));return s===0?this.width:n===0?this.height:(this.Ao=Math.min(this.height/s,this.width/n),this.Ao)}}else return i.nodeDiameterFormula===31?(this.Ao=Math.max(this.width,this.height),this.Ao):(this.Ao=Math.sqrt(this.width*this.width+this.height*this.height),this.Ao)}get diameter(){return this.Ao}set diameter(t){this.Ao!==t&&(m.s(t,"number",di,"diameter"),this.Ao=t)}get actualAngle(){return this.Xk}set actualAngle(t){this.Xk!==t&&(m.s(t,"number",di,"actualAngle"),this.Xk=t)}}class $s extends ei{constructor(t){super(t)}}class ee extends _t{kw;Ha;Es;Vg;Bn;zi;Bg;zg;Xg;su;Gg;Yg;nu;ou;ru;lu;Kg;Hg;au;dc;constructor(t){super(),this.kw=0,this.Ha=0,this.Es=new st(100,100).k(),this.Vg=!1,this.Bn=!0,this.zi=!1,this.Bg=100,this.zg=300,this.Xg=1,this.su=1e3,this.Gg=10,this.Yg=Math,this.nu=.05,this.ou=50,this.ru=150,this.lu=0,this.Kg=10,this.Hg=5,this.au=NaN,this.dc=10,t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Es.h(this.Es),t.Vg=this.Vg,t.Bn=this.Bn,t.zi=this.zi,t.Bg=this.Bg,t.zg=this.zg,t.Xg=this.Xg,t.su=this.su,t.Gg=this.Gg,t.Yg=this.Yg,t.nu=this.nu,t.ou=this.ou,t.ru=this.ru,t.lu=this.lu,t.Kg=this.Kg,t.Hg=this.Hg,t.au=this.au,t.dc=this.dc}createNetwork(){return new Js(this)}doLayout(t){this.network=this.makeNetwork(t);let e=this.network.vertexes.iterator,i=this.maxIterations;if(this.network.vertexes.count>0){for(this.network.deleteSelfEdges(),e=this.network.vertexes.iterator;e.next();){let n=e.value;n.charge=this.electricalCharge(n),n.mass=this.gravitationalMass(n)}let s=this.network.edges.iterator;for(;s.next();){let n=s.value;n.stiffness=this.springStiffness(n),n.length=this.springLength(n)}if(this.dL(),this.Ha=0,this.needsPrelayout()){let n=this.network,o=n.splitIntoSubNetworks(!1),r=o.iterator;for(;r.next();){let a=r.value;this.doConnectedSubnetLayout(a)}for(r=o.iterator,this.b3(r,n),r=o.iterator;r.next();){let a=r.value,h=a.vertexes.iterator;for(;h.next();){let u=h.value;n.addVertex(u)}let l=a.edges.iterator;for(;l.next();){let u=l.value;n.addEdge(u)}}}else this.aF(this.network,this.maxIterations);this.updateParts()}this.maxIterations=i,this.isValidLayout=!0}needsPrelayout(){if(this.network===null||this.network.vertexes.count<3)return!1;let t=0,e=0,i=this.network.vertexes.first().bounds,s=this.network.vertexes.iterator;for(;s.next();){let n=s.value,o=n.bounds;if(isNaN(n.x)||isNaN(n.y)||o.intersectsRect(i)&&(t++,t>2))return!0;if(e>10)return!1;e++}return!1}doConnectedSubnetLayout(t){let e=t.vertexes.iterator;for(;e.next();){let a=e.value;a.hierarchicalVertexes.add(a)}let i=t,s=this.au;if(isNaN(s)&&(s=t.edges.count/t.vertexes.count),s<t.vertexes.count)for(;i.vertexes.count>Math.max(100,Math.sqrt(s*t.vertexes.count));)i=this.coarsenNetwork(i);let n=0;e=i.vertexes.iterator;let o=this.randomNumberGenerator;for(o===null&&(this.randomNumberGenerator=o=new Zs(0));e.next();){e.value.idInCluster=n++;let a=10*(o.random()-.5),h=10*(o.random()-.5);this.isFixed(e.value)||(e.value.x=a,e.value.y=h);let l=e.value.hierarchicalVertexes.iterator;for(;l.next();)this.isFixed(l.value)||(l.value.x=a,l.value.y=h)}let r=this.computePairwiseDistances(i);this.k3(i,r,this.maxPrelayoutIterations,t.vertexes.count),this.aF(t,this.maxIterations)}computePairwiseDistances(t){let e=t.vertexes.count,i=new Array(e);for(let r=0;r<e;r++)i[r]=new Array(e).fill(-1),i[r][r]=0;let s=t.vertexes.iterator,n=new Map,o=[];for(;s.next();){let r=s.value;for(o=[r],n=new Map,n.set(r.idInCluster,0);o.length>0;){let a=o.shift(),h=a.vertexes.iterator;for(;h.next();){let l=h.value;n.has(l.idInCluster)||(n.set(l.idInCluster,n.get(a.idInCluster)+1),o.push(l))}}for(let a=0;a<e;a++){let h=Math.min(i[r.idInCluster][a],i[a][r.idInCluster]),l=n.get(a);(h<0||l<h)&&(i[r.idInCluster][a]=l,i[a][r.idInCluster]=l)}}return i}coarsenNetwork(t){let e=this.createNetwork(),i=new Map,s=0,n=t.vertexes.iterator;for(;n.next();)n.value.idInCluster=s++;for(n=t.vertexes.iterator;n.next();){let r=n.value;if(i.has(r.idInCluster))continue;let a=Number.MAX_SAFE_INTEGER,h=null,l=r.vertexes.iterator;for(;l.next();){let c=l.value;i.has(c.idInCluster)||c.hierarchicalVertexes.length<a&&(a=c.hierarchicalVertexes.length,h=c)}let u=e.createVertex();u.hierarchicalVertexes.addAll(r.hierarchicalVertexes),h!=null&&u.hierarchicalVertexes.addAll(h.hierarchicalVertexes),i.set(r.idInCluster,u),h!=null&&i.set(h.idInCluster,u),e.addVertex(u)}let o=t.edges.iterator;for(;o.next();){let r=o.value,a=i.get(r.fromVertex.idInCluster),h=i.get(r.toVertex.idInCluster);if(a===h)continue;let l=e.createEdge();l.fromVertex=a||null,l.toVertex=h||null,e.addEdge(l)}return e}cx(t,e){let i=!0,s=t.vertexes.iterator;for(;s.next();){let n=s.value;i?(i=!1,e.set(n.bounds)):e.unionRect(n.bounds)}return e}b3(t,e){let i=this.arrangementSpacing,s=t.count,n=!0,o=0,r=0,a=m.nt();for(let c=0;c<s+e.vertexes.count+2;c++)a[c]=null;let h=0;t.reset();let l=I.l(),u;for(;t.next();){let c=t.value;if(this.cx(c,l),n)n=!1,o=l.x+l.width/2,r=l.y+l.height/2,a[0]=new P(l.x+l.width+i.width,l.y),a[1]=new P(l.x,l.y+l.height+i.height),h=2;else{let d=this.hF(a,h,o,r,l.width,l.height,i),f=a[d],p=new P(f.x+l.width+i.width,f.y),g=new P(f.x,f.y+l.height+i.height);d+1<h&&a.splice(d+1,0,null),a[d]=p,a[d+1]=g,h++;let y=f.x-l.x,b=f.y-l.y;for(u=c.vertexes.iterator;u.next();){let v=u.value;this.isFixed(v)||(v.centerX+=y,v.centerY+=b)}}}for(I.i(l),u=e.vertexes.iterator;u.next();){let c=u.value,d=c.bounds;if(h<2){o=d.x+d.width/2,r=d.y+d.height/2,a[0]=new P(d.x+d.width+i.width,d.y),a[1]=new P(d.x,d.y+d.height+i.height),h=2;continue}let f=this.hF(a,h,o,r,d.width,d.height,i),p=a[f],g=new P(p.x+d.width+i.width,p.y),y=new P(p.x,p.y+d.height+i.height);f+1<h&&a.splice(f+1,0,null),a[f]=g,a[f+1]=y,h++,this.isFixed(c)||(c.centerX=p.x+c.width/2,c.centerY=p.y+c.height/2)}m.Z(a)}hF(t,e,i,s,n,o,r){let a=9e19,h=-1;t:for(let l=0;l<e;l++){let u=t[l],c=u.x-i,d=u.y-s,f=c*c+d*d;if(f<a){for(let p=l-1;p>=0;p--)if(t[p].y>u.y&&t[p].x-u.x<n+r.width)continue t;for(let p=l+1;p<e;p++)if(t[p].x>u.x&&t[p].y-u.y<o+r.height)continue t;h=l,a=f}}return h}dL(){if(this.network===null||!this.comments)return;let t=this.network.vertexes.iterator;for(;t.next();){let e=t.value;this.addComments(e)}}addComments(t){if(this.network===null)return;let e=t.node;if(e!==null){let i=e.findNodesConnected();for(;i.next();){let s=i.value;if(s.category!=="Comment"||!s.isVisible())continue;let n=this.network.findVertex(s);n===null&&(n=this.network.addNode(s)),n.charge=this.defaultCommentElectricalCharge;let o=null,r=n.destinationEdges;for(;r.next();){let a=r.value;if(a.toVertex===t){o=a;break}}if(o===null){let a=n.sourceEdges;for(;a.next();){let h=a.value;if(h.fromVertex===t){o=h;break}}}o===null&&(o=this.network.linkVertexes(t,n,null)),o.length=this.defaultCommentSpringLength}}}cF(t,e){let i=t.bounds,s=i.x,n=i.y,o=i.width,r=i.height,a=e.bounds,h=a.x,l=a.y,u=a.width,c=a.height;if(s+o<h)if(n>l+c){let d=s+o-h,f=n-l-c;return C.ix(d*d+f*f)}else if(n+r<l){let d=s+o-h,f=n+r-l;return C.ix(d*d+f*f)}else return h-(s+o);else if(s>h+u)if(n>l+c){let d=s-h-u,f=n-l-c;return C.ix(d*d+f*f)}else if(n+r<l){let d=s-h-u,f=n+r-l;return C.ix(d*d+f*f)}else return s-(h+u);else return n>l+c?n-(l+c):n+r<l?l-(n+r):.1}aF(t,e){let i=this.Ha+e;for(;this.Ha<i&&(this.Ha++,!!this.P3(t)););}P3(t){let e=t.vertexes.toArray();if(e.length<=0)return!1;let i=e[0];i.forceX=0,i.forceY=0;let s=i.centerX,n=s,o=i.centerY,r=o;for(let p=1;p<e.length;p++){let g=e[p];g.forceX=0,g.forceY=0;let y=g.centerX,b=g.centerY;s=Math.min(s,y),n=Math.max(n,y),o=Math.min(o,b),r=Math.max(r,b)}let a=n-s>r-o;a?e.sort((p,g)=>p===null||g===null||p===g?0:p.centerX-g.centerX):e.sort((p,g)=>p===null||g===null||p===g?0:p.centerY-g.centerY);let h=this.su,l=0,u=0,c=0;for(let p=0;p<e.length;p++){let g=e[p],y=g.bounds,b=g.focus,v=y.x+b.x,w=y.y+b.y;u=g.charge*this.electricalFieldX(v,w),c=g.charge*this.electricalFieldY(v,w),u+=g.mass*this.gravitationalFieldX(v,w),c+=g.mass*this.gravitationalFieldY(v,w),g.forceX+=u,g.forceY+=c;for(let k=p+1;k<e.length;k++){let S=e[k];if(!this.shouldInteract(g,S)||k===p)continue;let N=S.bounds,D=S.focus,L=N.x+D.x,M=N.y+D.y;if(v-L>h||L-v>h){if(a)break;continue}if(w-M>h||M-w>h){if(!a)break;continue}let A=this.cF(g,S),F=2*g.charge,O=2*S.charge;if(A>1)l=F*O/(A*A),u=l*(v-L)/A,c=l*(w-M)/A;else{let E=this.randomNumberGenerator;E===null&&(this.randomNumberGenerator=E=new Zs(0));let B=E.random(),K=E.random();if(v>L)u=Math.abs(S.bounds.right-g.bounds.x),u=F*O*(1+u)*B;else if(v<L)u=Math.abs(S.bounds.x-g.bounds.right),u=-(F*O)*(1+u)*B;else{let z=Math.max(S.width,g.width);u=F*O*((1+z)*B-z/2)}if(w>M)c=Math.abs(S.bounds.bottom-g.bounds.y),c=F*O*(1+c)*K;else if(v<L)c=Math.abs(S.bounds.y-g.bounds.bottom),c=-(F*O)*(1+c)*K;else{let z=Math.max(S.height,g.height);c=F*O*((1+z)*K-z/2)}}g.forceX+=u,g.forceY+=c,S.forceX-=u,S.forceY-=c}}let d=t.edges.iterator;for(;d.next();){let p=d.value,g=p.fromVertex,y=p.toVertex,b=g.bounds,v=g.focus,w=b.x+v.x,k=b.y+v.y,S=y.bounds,N=y.focus,D=S.x+N.x,L=S.y+N.y,M=this.cF(g,y);M>1&&(l=.1*p.stiffness*(M-p.length),u=l*.5*(g.width+y.height)*(w-D)/M,c=l*.5*(g.width+y.height)*(k-L)/M),g.forceX-=u,g.forceY-=c,y.forceX+=u,y.forceY+=c}let f=0;for(let p=0;p<e.length;p++){let g=e[p];this.isFixed(g)?this.moveFixedVertex(g):f=Math.max(f,this.moveVertex(g)||0)}return f>this.epsilonDistance*this.epsilonDistance}k3(t,e,i,s){let n=this.Ha+i,o=Math.sqrt(s);this.kw=this.dc*t.vertexes.count;let r=t.vertexes.toArray(),a=0,h=0,l=0;for(;this.Ha<n;){this.Ha++,h=a,a=0;for(let u=0;u<r.length;u++){r[u].forceX=0,r[u].forceY=0;for(let d=0;d<r.length;d++){if(u===d)continue;let f=Math.sqrt((r[u].centerX-r[d].centerX)**2+(r[u].centerY-r[d].centerY)**2),p=e[r[u].idInCluster][r[d].idInCluster],g=(f-this.dc*o*p)/f;r[u].forceX+=g*(r[d].x-r[u].x),r[u].forceY+=g*(r[d].y-r[u].y)}let c=Math.sqrt(r[u].forceX*r[u].forceX+r[u].forceY*r[u].forceY);if(c>0){r[u].forceX=this.kw*r[u].forceX/c,r[u].forceY=this.kw*r[u].forceY/c,this.isFixed(r[u])||(r[u].x+=r[u].forceX,r[u].y+=r[u].forceY);let d=r[u].hierarchicalVertexes.iterator;for(;d.next();){let f=d.value;this.isFixed(f)||(f.centerX+=r[u].forceX,f.centerY+=r[u].forceY)}}a+=c*c}if(a>=h){if(l++,l>=5)break}else l=0;this.kw*=.95}}moveVertex(t){let e=t.forceX,i=t.forceY,s=this.moveLimit;return e<-s?e=-s:e>s&&(e=s),i<-s?i=-s:i>s&&(i=s),t.centerX+=e,t.centerY+=i,e*e+i*i}shouldInteract(t,e){return!0}moveFixedVertex(t){}commitLayout(){this.Pw(),this.commitNodes(),this.isRouting&&this.commitLinks()}Pw(){if(this.network===null||!this.setsPortSpots)return;let t=this.network.edges.iterator;for(;t.next();){let e=t.value.link;e!==null&&(e.fromSpot=T.Default,e.toSpot=T.Default)}}commitNodes(){if(!this.network)return;let t=0,e=0;if(this.arrangesToOrigin){let n=I.l();this.cx(this.network,n);let o=this.arrangementOrigin;t=o.x-n.x,e=o.y-n.y,I.i(n)}let i=I.l(),s=this.network.vertexes.iterator;for(;s.next();){let n=s.value;(t!==0||e!==0)&&(i.h(n.bounds),i.x+=t,i.y+=e,n.bounds=i),n.commit()}I.i(i)}commitLinks(){if(!this.network)return;let t=this.network.edges.iterator;for(;t.next();)t.value.commit()}springStiffness(t){let e=t.stiffness;return isNaN(e)?this.nu:e}springLength(t){let e=t.length;return isNaN(e)?this.ou:e}electricalCharge(t){let e=t.charge;return isNaN(e)?this.ru:e}electricalFieldX(t,e){return 0}electricalFieldY(t,e){return 0}gravitationalMass(t){let e=t.mass;return isNaN(e)?this.lu:e}gravitationalFieldX(t,e){return 0}gravitationalFieldY(t,e){return 0}isFixed(t){return t.isFixed}get currentIteration(){return this.Ha}get arrangementSpacing(){return this.Es}set arrangementSpacing(t){this.Es.equals(t)||(this.Es.h(t),this.p())}get arrangesToOrigin(){return this.Vg}set arrangesToOrigin(t){this.Vg!==t&&(m.s(t,"boolean",ee,"arrangesToOrigin"),this.Vg=t,this.p())}get setsPortSpots(){return this.Bn}set setsPortSpots(t){this.Bn!==t&&(m.s(t,"boolean",ee,"setsPortSpots"),this.Bn=t,this.p())}get comments(){return this.zi}set comments(t){this.zi!==t&&(m.s(t,"boolean",ee,"comments"),this.zi=t,this.p())}get maxPrelayoutIterations(){return this.Bg}set maxPrelayoutIterations(t){this.Bg!==t&&(m.s(t,"number",ee,"maxPrelayoutIterations"),t>=0&&(this.Bg=t,this.p()))}get maxIterations(){return this.zg}set maxIterations(t){this.zg!==t&&(m.s(t,"number",ee,"maxIterations"),t>=0&&(this.zg=t,this.p()))}get epsilonDistance(){return this.Xg}set epsilonDistance(t){this.Xg!==t&&(m.s(t,"number",ee,"epsilonDistance"),t>0&&(this.Xg=t,this.p()))}get infinityDistance(){return this.su}set infinityDistance(t){this.su!==t&&(m.s(t,"number",ee,"infinityDistance"),t>1&&(this.su=t,this.p()))}get moveLimit(){return this.Gg}set moveLimit(t){this.Gg!==t&&(m.s(t,"number",ee,"moveLimit"),this.Gg=t,this.p())}get randomNumberGenerator(){return this.Yg}set randomNumberGenerator(t){this.Yg!==t&&(t!==null&&!m.st(t.random)&&m.o('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+t),this.Yg=t)}get defaultSpringStiffness(){return this.nu}set defaultSpringStiffness(t){this.nu!==t&&(m.s(t,"number",ee,"defaultSpringStiffness"),this.nu=t,this.p())}get defaultSpringLength(){return this.ou}set defaultSpringLength(t){this.ou!==t&&(m.s(t,"number",ee,"defaultSpringLength"),this.ou=t,this.p())}get defaultElectricalCharge(){return this.ru}set defaultElectricalCharge(t){this.ru!==t&&(m.s(t,"number",ee,"defaultElectricalCharge"),this.ru=t,this.p())}get defaultGravitationalMass(){return this.lu}set defaultGravitationalMass(t){this.lu!==t&&(m.s(t,"number",ee,"defaultGravitationalMass"),this.lu=t,this.p())}get defaultCommentSpringLength(){return this.Kg}set defaultCommentSpringLength(t){this.Kg!==t&&(m.s(t,"number",ee,"defaultCommentSpringLength"),this.Kg=t,this.p())}get defaultCommentElectricalCharge(){return this.Hg}set defaultCommentElectricalCharge(t){this.Hg!==t&&(m.s(t,"number",ee,"defaultCommentElectricalCharge"),this.Hg=t,this.p())}get prelayoutQuality(){return this.au}set prelayoutQuality(t){this.au!==t&&(m.s(t,"number",ee,"prelayoutQuality"),this.au=t,this.p())}get prelayoutSpread(){return this.dc}set prelayoutSpread(t){this.dc!==t&&(m.s(t,"number",ee,"prelayoutSpread"),this.dc=t,this.p())}}class Js extends Ee{constructor(t){super(t)}createVertex(){return new ze(this)}createEdge(){return new fi(this)}}class ze extends Ie{Gk;Yk;Kk;Hk;qk;hierarchicalVertexes;idInCluster;constructor(t){super(t),this.Gk=!1,this.Yk=NaN,this.Kk=NaN,this.Hk=0,this.qk=0,this.hierarchicalVertexes=new q,this.idInCluster=-1}get isFixed(){return this.Gk}set isFixed(t){this.Gk!==t&&(m.s(t,"boolean",ze,"isFixed"),this.Gk=t)}get charge(){return this.Yk}set charge(t){this.Yk!==t&&(m.s(t,"number",ze,"charge"),this.Yk=t)}get mass(){return this.Kk}set mass(t){this.Kk!==t&&(m.s(t,"number",ze,"mass"),this.Kk=t)}get forceX(){return this.Hk}set forceX(t){this.Hk!==t&&(m.s(t,"number",ze,"forceX"),this.Hk=t)}get forceY(){return this.qk}set forceY(t){this.qk!==t&&(m.s(t,"number",ze,"forceY"),this.qk=t)}}class fi extends ei{jk;Wk;constructor(t){super(t),this.jk=NaN,this.Wk=NaN}get stiffness(){return this.jk}set stiffness(t){this.jk!==t&&(m.s(t,"number",fi,"stiffness"),this.jk=t)}get length(){return this.Wk}set length(t){this.Wk!==t&&(m.s(t,"number",fi,"length"),this.Wk=t)}}class Zs{I;R;Q;M;A;seed;constructor(t){t===void 0&&(t=42),this.seed=t,this.A=48271,this.M=2147483647,this.Q=this.M/this.A,this.R=this.M%this.A,this.I=1/this.M,this.random()}random(){let t=this.seed/this.Q,e=this.seed%this.Q,i=this.A*e-this.R*t;return i>0?this.seed=i:this.seed=i+this.M,this.seed*this.I}}var ns=(x=>(x[x.DepthFirst=0]="DepthFirst",x[x.Greedy=1]="Greedy",x[x.FromLayers=2]="FromLayers",x))(ns||{}),os=(x=>(x[x.OptimalLinkLength=10]="OptimalLinkLength",x[x.LongestPathSink=11]="LongestPathSink",x[x.LongestPathSource=12]="LongestPathSource",x))(os||{}),rs=(x=>(x[x.DepthFirstOut=20]="DepthFirstOut",x[x.DepthFirstIn=21]="DepthFirstIn",x[x.Naive=22]="Naive",x))(rs||{}),as=(x=>(x[x.None=30]="None",x[x.Less=31]="Less",x[x.More=32]="More",x))(as||{}),Qs=(x=>(x[x.None=0]="None",x[x.Expand=1]="Expand",x[x.Straighten=2]="Straighten",x[x.Median=4]="Median",x[x.MaybeExpand=8]="MaybeExpand",x[x.All=15]="All",x))(Qs||{}),_s=(x=>(x[x.None=0]="None",x[x.UpperLeft=1]="UpperLeft",x[x.UpperRight=2]="UpperRight",x[x.LowerLeft=4]="LowerLeft",x[x.LowerRight=8]="LowerRight",x[x.All=15]="All",x))(_s||{});class Ae extends _t{Us;ti;P;hu;cu;fu;gc;uu;hr;du;Bn;_;Sw;zt;qg;Vs;ie;Bs;ms;ps;Rt;jg;Wg;Jk;cn;gu;cr;zn;Xn;gL;qa;constructor(t){super(),this.Us=25,this.ti=25,this.P=0,this.hu=0,this.cu=10,this.fu=20,this.gc=4,this.uu=31,this.hr=15,this.du=10,this.Bn=!0,this._=-1,this.Sw=-1,this.zt=-1,this.qg=0,this.Vs=0,this.ie=new Int16Array(0),this.Bs=new Float32Array(0),this.ms=new Float32Array(0),this.ps=new Float32Array(0),this.Rt=new Float32Array(0),this.jg=0,this.Wg=new Int16Array(0),this.Jk=new Int16Array(0),this.cn=0,this.gu=null,this.cr=new P,this.zn=[],this.zn.length=100,this.Xn=15,this.gL=0,this.qa=!0,t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Us=this.Us,t.ti=this.ti,t.P=this.P,t.hu=this.hu,t.cu=this.cu,t.fu=this.fu,t.gc=this.gc,t.uu=this.uu,t.hr=this.hr,t.du=this.du,t.Bn=this.Bn,t.Xn=this.Xn,t.qa=this.qa}fe(t){t in as?this.aggressiveOption=t:t in ns?this.cycleRemoveOption=t:t in rs?this.initializeOption=t:t in os?this.layeringOption=t:super.fe(t)}createNetwork(){return new tn(this)}doLayout(t){this.network===null&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.S3(),this.network.vertexes.count>0&&(this.network.deleteSelfEdges(),this.cycleRemoveOption!==2&&this.removeCycles(),this.M3(),this.cycleRemoveOption===2&&this.removeCycles(),this.N3(),this.C3(),this.L3(),this.reduceCrossings(),this.straightenAndPack(),this.updateParts()),this.network=null,this.isValidLayout=!0}linkMinLength(t){return 1}linkLengthWeight(t){return 1}linkStraightenWeight(t){let e=t.fromVertex.node||t.fromVertex.data,i=t.toVertex.node||t.toVertex.data;return e===null&&i===null?8:e===null||i===null?4:1}nodeMinLayerSpace(t,e){return t.node===null&&t.data===null?0:this.P===90||this.P===270?e?t.focus.y+10:t.bounds.height-t.focus.y+10:e?t.focus.x+10:t.bounds.width-t.focus.x+10}nodeMinColumnSpace(t,e){if(t.node===null&&t.data===null)return 0;let i=e?t.$k:t.Zk;if(i!==null)return i;let s=this.P;return s===90||s===270?e?t.$k=t.focus.x/this.ti+1|0:t.Zk=(t.bounds.width-t.focus.x)/this.ti+1|0:e?t.$k=t.focus.y/this.ti+1|0:t.Zk=(t.bounds.height-t.focus.y)/this.ti+1|0}ei(){let t=this.network.vertexes.count;this.Wg.length<t*2&&(this.Wg=new Int16Array(t*2));let e=0,i=this.network.vertexes.iterator;for(;i.next();){let s=i.value;this.Wg[e]=s.column,e++,this.Wg[e]=s.index,e++}return this.Wg}ns(t){let e=0,i=this.network.vertexes.iterator;for(;i.next();){let s=i.value;s.column=t[e],e++,s.index=t[e],e++}}fF(t,e){let i=this.ja(t),s=this.ie[t];this.Jk.length<s*s&&(this.Jk=new Int16Array(s*s));let n=this.Jk;for(let o=0;o<s;o++){let r=0,a=i[o],h=a.near,l=0;h!==null&&h!==a&&h.layer===a.layer&&(r+=Math.max(0,Math.abs(h.index-a.index)-1));let u,c=0,d,f=0,p=0,g=0,y,b=0,v,w=0,k=0,S=0,N;if(e>=0){for(u=i[o].So,c=0;c<u.length;c++)if(d=u[c],d.valid&&d.fromVertex.layer!==t)for(f=d.fromVertex.index,p=d.portToPos,g=d.portFromPos,b=c+1;b<u.length;b++)v=u[b],v.valid&&v.fromVertex.layer!==t&&(w=v.fromVertex.index,k=v.portToPos,S=v.portFromPos,p<k&&(f>w||f===w&&g>S)&&r++,k<p&&(w>f||w===f&&S>g)&&r++)}if(e<=0){for(u=i[o].or,c=0;c<u.length;c++)if(d=u[c],d.valid&&d.toVertex.layer!==t)for(f=d.toVertex.index,p=d.portToPos,g=d.portFromPos,b=c+1;b<u.length;b++)v=u[b],v.valid&&v.toVertex.layer!==t&&(w=v.toVertex.index,k=v.portToPos,S=v.portFromPos,g<S&&(f>w||f===w&&p>k)&&r++,S<g&&(w>f||w===f&&k>p)&&r++)}for(n[o*s+o]=r,l=o+1;l<s;l++){let D=0,L=0;if(e>=0){for(y=i[o].So,N=i[l].So,c=0;c<y.length;c++)if(d=y[c],d.valid&&d.fromVertex.layer!==t)for(f=d.fromVertex.index,p=d.portToPos,g=d.portFromPos,b=0;b<N.length;b++)v=N[b],v.valid&&v.fromVertex.layer!==t&&(w=v.fromVertex.index,k=v.portToPos,S=v.portFromPos,(f<w||f===w&&g<S)&&L++,(w<f||w===f&&S<g)&&D++)}if(e<=0){for(y=i[o].or,N=i[l].or,c=0;c<y.length;c++)if(d=y[c],d.valid&&d.toVertex.layer!==t)for(f=d.toVertex.index,p=d.portToPos,g=d.portFromPos,b=0;b<N.length;b++)v=N[b],v.valid&&v.toVertex.layer!==t&&(w=v.toVertex.index,k=v.portToPos,S=v.portFromPos,(f<w||f===w&&p<k)&&L++,(w<f||w===f&&k<p)&&D++)}n[o*s+l]=D,n[l*s+o]=L}}return this.Wa(t,i),n}countCrossings(){let t=0;for(let e=0;e<=this._;e++){let i=this.fF(e,1),s=this.ie[e];for(let n=0;n<s;n++)for(let o=n;o<s;o++)t+=i[n*s+o]}return t}A3(t,e,i){let s=this.ja(t),n=this.ie[t],o=0;for(let r=0;r<n;r++){let a=null;e<=0&&(a=s[r].So);let h=null;e>=0&&(h=s[r].or);let l,u=0,c=0;if(a!==null)for(let d=0;d<a.length;d++)l=a[d],l.valid&&l.fromVertex.layer!==t&&(u=l.fromVertex.column+l.portFromColOffset,c=l.toVertex.column+l.portToColOffset,i?o+=Math.abs(u-c)*this.linkStraightenWeight(l):o+=Math.abs(u-c));if(h!==null)for(let d=0;d<h.length;d++)l=h[d],l.valid&&l.toVertex.layer!==t&&(u=l.fromVertex.column+l.portFromColOffset,c=l.toVertex.column+l.portToColOffset,i?o+=(Math.abs(u-c)+1)*this.linkStraightenWeight(l):o+=Math.abs(u-c))}return this.Wa(t,s),o}Qk(t){let e=0;for(let i=0;i<=this._;i++)e+=this.A3(i,1,t);return e}Mw(){let t=1/0;this.zt=-1;let e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;t=Math.min(t,i.column-this.nodeMinColumnSpace(i,!0)),this.zt=Math.max(this.zt,i.column+this.nodeMinColumnSpace(i,!1))}for(e.reset();e.next();){let i=e.value;i.column-=t}this.zt-=t}Nw(t,e){let i=this.ja(t),s=this.ie[t],n=new Float32Array(s);for(let o=0;o<s;o++){let r=i[o],a=null;e<=0&&(a=r.So);let h=null;e>=0&&(h=r.or);let l=0,u=0,c=r.near;c!==null&&c.layer===r.layer&&(l+=c.column-1,u++);let d;if(a!==null)for(let f=0;f<a.length;f++){d=a[f];let p=d.fromVertex;d.valid&&!d.rev&&p.layer!==t&&(l+=p.column,u++)}if(h!==null)for(let f=0;f<h.length;f++){d=h[f];let p=d.toVertex;d.valid&&!d.rev&&p.layer!==t&&(l+=p.column,u++)}u===0?n[o]=-1:n[o]=l/u}return this.Wa(t,i),n}uF(t,e){let i=this.ja(t),s=this.ie[t],n=new Int16Array(s);for(let o=0;o<s;o++){let r=i[o],a=null;e<=0&&(a=r.So);let h=null;e>=0&&(h=r.or);let l=0,u=[],c=r.near;c!==null&&c.layer===r.layer&&(u[l]=c.column-1,l++);let d;if(a!==null)for(let f=0;f<a.length;f++){d=a[f];let p=d.fromVertex;d.valid&&!d.rev&&p.layer!==t&&(u[l]=p.column+d.portFromColOffset,l++)}if(h!==null)for(let f=0;f<h.length;f++){d=h[f];let p=d.toVertex;d.valid&&!d.rev&&p.layer!==t&&(u[l]=p.column+d.portToColOffset,l++)}if(l===0)n[o]=-1;else{u.sort((p,g)=>p-g);let f=l>>1;(l&1)!==0?n[o]=u[f]:n[o]=u[f-1]+u[f]>>1}}return this.Wa(t,i),n}Cw(t,e,i,s,n){if(t.component===i){t.component=e;let o=0,r=0;if(s){let a=t.destinationEdges;for(;a.next();){let h=a.value,l=h.toVertex;o=t.layer-l.layer,r=this.linkMinLength(h),o===r&&this.Cw(l,e,i,s,n)}}if(n){let a=t.sourceEdges;for(;a.next();){let h=a.value,l=h.fromVertex;o=l.layer-t.layer,r=this.linkMinLength(h),o===r&&this.Cw(l,e,i,s,n)}}}}mL(t,e,i,s,n){if(t.component===i){if(t.component=e,s){let o=t.destinationEdges;for(;o.next();){let r=o.value.toVertex;this.mL(r,e,i,s,n)}}if(n){let o=t.sourceEdges;for(;o.next();){let r=o.value.fromVertex;this.mL(r,e,i,s,n)}}}}removeCycles(){let t=this.network.edges.iterator;for(;t.next();){let e=t.value;e.rev=!1}switch(this.hu){default:case 1:this.T3();break;case 0:this.D3();break;case 2:this.v3();break}}v3(){let t=this.network,e=t.vertexes.iterator,i=1/0;for(;e.next();){let s=e.value;i=Math.min(i,s.layer)}if(i<1/0){if(i<0)for(e.reset();e.next();){let r=e.value;r.layer-=i}let s=[];for(e.reset();e.next();){let r=e.value,a=s[r.layer];a===void 0?s[r.layer]=[r]:a.push(r)}let n=0;for(let r=0;r<s.length;r++){let a=s[r];if(!a||a.length===0)n++;else if(r>0)for(let h=0;h<a.length;h++){let l=a[h];l.layer-=n}}let o=t.edges.iterator;for(;o.next();){let r=o.value,a=r.fromVertex,h=r.toVertex;a.layer<h.layer&&(t.reverseEdge(r),r.rev=!0)}}}T3(){let t=this.network,e=0,i=t.vertexes.count-1,s=[];s.length=i+1;let n=t.vertexes.iterator;for(;n.next();){let r=n.value;r.ii=!0}for(;this.F3(t)!==null;){let r;for(r=this.dF(t);r!==null;)s[i]=r,i--,r.ii=!1,r=this.dF(t);for(r=this.gF(t);r!==null;)s[e]=r,e++,r.ii=!1,r=this.gF(t);r=this.R3(t),r!==null&&(s[e]=r,e++,r.ii=!1)}for(let r=0;r<t.vertexes.count;r++)s[r].index=r;let o=t.edges.iterator;for(;o.next();){let r=o.value,a=r.fromVertex,h=r.toVertex;a.index>h.index&&(t.reverseEdge(r),r.rev=!0)}}F3(t){let e=t.vertexes.iterator;for(;e.next();){let i=e.value;if(i.ii)return i}return null}dF(t){let e=t.vertexes.iterator;for(;e.next();){let i=e.value;if(i.ii){let s=!0,n=i.destinationEdges;for(;n.next();)if(n.value.toVertex.ii){s=!1;break}if(s)return i}}return null}gF(t){let e=t.vertexes.iterator;for(;e.next();){let i=e.value;if(i.ii){let s=!0,n=i.sourceEdges;for(;n.next();)if(n.value.fromVertex.ii){s=!1;break}if(s)return i}}return null}R3(t){let e=null,i=0,s=this.network.vertexes.iterator;for(;s.next();){let n=s.value;if(n.ii){let o=0,r=n.destinationEdges;for(;r.next();)r.value.toVertex.ii&&o++;let a=0,h=n.sourceEdges;for(;h.next();)h.value.fromVertex.ii&&a++;(e===null||i<o-a)&&(e=n,i=o-a)}}return e}D3(){let t=this.network.vertexes.iterator;for(;t.next();){let i=t.value;i.mu=-1,i._n=-1}let e=this.network.edges.iterator;for(;e.next();){let i=e.value;i.forest=!1}for(this.jg=0,t.reset();t.next();){let i=t.value;i.sourceEdges.count===0&&this.pL(i)}for(t.reset();t.next();){let i=t.value;i.mu===-1&&this.pL(i)}for(e.reset();e.next();){let i=e.value;if(!i.forest){let s=i.fromVertex,n=s.mu,o=s._n,r=i.toVertex,a=r.mu,h=r._n;a<n&&o<h&&(this.network.reverseEdge(i),i.rev=!0)}}}pL(t){t.mu=this.jg,this.jg++;let e=t.destinationEdges;for(;e.next();){let i=e.value,s=i.toVertex;s.mu===-1&&(i.forest=!0,this.pL(s))}t._n=this.jg,this.jg++}M3(){let t=this.network.vertexes.iterator;for(;t.next();){let s=t.value;s.layer=-1}for(this._=-1,this.assignLayers(),t.reset();t.next();){let s=t.value;this._=Math.max(this._,s.layer)}this._>=9999&&m.o("LayeredDigraphLayout, too many layers: "+this._);let e=this.direction==0||this.direction==180,i=[];for(let s=this.network.vertexes.iterator;s.next();){let n=s.value;if(n.node===null||n.centered)continue;let o=n.layer,r=i[o];r===void 0&&(r=0);let a=e?n.width:n.height;a>r&&(i[o]=a)}for(let s=this.network.vertexes.iterator;s.next();){let n=s.value;if(n.node===null||n.centered)continue;let o=i[n.layer];e?(n.focusX=o/2,n.focusY=n.focus.y,n.width=o):(n.focusX=n.focus.x,n.focusY=o/2,n.height=o)}}assignLayers(){switch(this.cu){case 11:this.mF();break;case 12:this.O3();break;default:case 10:this.I3();break}}mF(){let t=this.network.vertexes.iterator;for(;t.next();){let e=t.value,i=this.pF(e);this._=Math.max(i,this._)}}pF(t){let e=0;if(t.layer===-1){let i=t.destinationEdges;for(;i.next();){let s=i.value,n=s.toVertex,o=this.linkMinLength(s);e=Math.max(e,this.pF(n)+o)}t.layer=e}else e=t.layer;return e}O3(){let t=0,e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;t=this.yF(i),this._=Math.max(t,this._)}for(e.reset();e.next();){let i=e.value;i.layer=this._-i.layer}}yF(t){let e=0;if(t.layer===-1){let i=t.sourceEdges;for(;i.next();){let s=i.value,n=s.fromVertex,o=this.linkMinLength(s);e=Math.max(e,this.yF(n)+o)}t.layer=e}else e=t.layer;return e}I3(){this.mF();let t=this.network.vertexes.iterator;for(;t.next();){let i=t.value;i.ii=!1}for(t.reset();t.next();){let i=t.value;i.sourceEdges.count===0&&this.wF(i)}let e=1/0;for(t.reset();t.next();){let i=t.value;e=Math.min(e,i.layer)}for(this._=-1,t.reset();t.next();){let i=t.value;i.layer-=e,this._=Math.max(this._,i.layer)}}wF(t){if(!t.ii){t.ii=!0;let e=t.destinationEdges;for(;e.next();){let i=e.value.toVertex;this.wF(i)}this.E3(t),this.U3(t)}}E3(t){let e=this.network.vertexes.iterator;for(;e.next();){let r=e.value;r.component=-1}let i=0,s=1,n=t.So,o=n.length;for(let r=0;r<o;r++){let a=n[r],h=a.fromVertex,l=a.toVertex,u=this.linkMinLength(a);h.layer-l.layer>u&&this.Cw(h,i,-1,!0,!1)}for(this.Cw(t,s,-1,!0,!0);t.component!==i;){let r=0,a=1/0,h=0,l=null,u=this.network.vertexes.iterator;for(;u.next();){let c=u.value;if(c.component===s){let d=0,f=!1,p=c.So;o=p.length;for(let y=0;y<o;y++){let b=p[y],v=b.fromVertex;if(d+=this.linkLengthWeight(b),v.component!==s){r+=this.linkLengthWeight(b);let w=v.layer-c.layer,k=this.linkMinLength(b);a=Math.min(a,w-k)}}let g=c.or;o=g.length;for(let y=0;y<o;y++){let b=g[y],v=b.toVertex;d-=this.linkLengthWeight(b),v.component!==s?r-=this.linkLengthWeight(b):f=!0}(l===null||d<h)&&!f&&(l=c,h=d)}}if(r>0){for(e.reset();e.next();){let c=e.value;c.component===s&&(c.layer+=a)}t.component=i}else l.component=i}}U3(t){let e=this.network.vertexes.iterator;for(;e.next();){let n=e.value;n.component=-1}let i=0,s=1;for(this.Cw(t,s,-1,!0,!1);t.component!==i;){let n=0,o=1/0,r=0,a=null,h=this.network.vertexes.iterator;for(;h.next();){let l=h.value;if(l.component===s){let u=0,c=!1,d=l.So,f=d.length;for(let g=0;g<f;g++){let y=d[g],b=y.fromVertex;u+=this.linkLengthWeight(y),b.component!==s?n+=this.linkLengthWeight(y):c=!0}let p=l.or;f=p.length;for(let g=0;g<f;g++){let y=p[g],b=y.toVertex;if(u-=this.linkLengthWeight(y),b.component!==s){n-=this.linkLengthWeight(y);let v=l.layer-b.layer,w=this.linkMinLength(y);o=Math.min(o,v-w)}}(a===null||u>r)&&!c&&(a=l,r=u)}}if(n<0){for(e.reset();e.next();){let l=e.value;l.component===s&&(l.layer-=o)}t.component=i}else a.component=i}}N3(){let t=this.network,e=[],i=t.edges.iterator;for(;i.next();){let s=i.value;s.valid=!1,e.push(s)}for(let s=0;s<e.length;s++){let n=e[s],o=n.fromVertex,r=n.toVertex;if(n.valid||(o.node===null&&o.data===null||r.node===null&&r.data===null)&&o.layer===r.layer)continue;let a=0,h=0,l=0,u=0;if(n.link!==null){let S=n.link;if(S===null)continue;let N=o.node,D=r.node;if(N===null||D===null)continue;let L=S.fromNode,M=S.toNode,A=S.fromPort;for(;A!==null&&!A.isVisibleObject();)A=A.panel;let F=S.toPort;for(;F!==null&&!F.isVisibleObject();)F=F.panel;if(n.rev){let tt=L,nt=A;L=M,A=F,M=tt,F=nt}let O=o.focus,E=r.focus,B=n.rev?r.bounds:o.bounds,K=P.l();N!==L?B.isReal()&&L.isVisible()?L.actualBounds.isReal()?(L.getRelativePoint(A,T.Center,K),K.x+=L.actualBounds.x-B.x,K.y+=L.actualBounds.y-B.y):(L.getRelativePoint(A,T.Center,K),K.isReal()||K.h(O)):K.h(O):B.isReal()?(L.getRelativePoint(A,T.Center,K),K.isReal()||K.h(O)):K.h(O);let z=n.rev?o.bounds:r.bounds,U=P.l();D!==M?z.isReal()&&M.isVisible()?M.actualBounds.isReal()?(M.getRelativePoint(F,T.Center,U),U.x+=M.actualBounds.x-z.x,U.y+=M.actualBounds.y-z.y):(M.getRelativePoint(F,T.Center,U),U.isReal()||U.h(E)):U.h(E):z.isReal()?(M.getRelativePoint(F,T.Center,U),U.isReal()||U.h(E)):U.h(E),this.P===90||this.P===270?(a=Math.round((K.x-O.x)/this.ti),l=K.x,h=Math.round((U.x-E.x)/this.ti),u=U.x):(a=Math.round((K.y-O.y)/this.ti),l=K.y,h=Math.round((U.y-E.y)/this.ti),u=U.y),P.i(K),P.i(U),n.portFromColOffset=a,n.portFromPos=l,n.portToColOffset=h,n.portToPos=u}else n.portFromColOffset=0,n.portFromPos=0,n.portToColOffset=0,n.portToPos=0;let c=o.layer,d=r.layer,f=this.V3(n),p=f===1||f===3,g=f===2||f===3,y,b,v=null,w;g&&(v=this.B3(o,r),w=1,b=t.createVertex(),b.node=null,b._k=1,b.layer=c,b.near=o,t.addVertex(b),y=t.linkVertexes(o,b,n.link),y.valid=!1,y.rev=n.rev,y.portFromColOffset=a,y.portToColOffset=0,y.portFromPos=l,y.portToPos=0,o=b);let k=1;if(p&&k--,c-d>k&&c>0){for(n.valid=!1,b=t.createVertex(),b.node=null,b._k=2,b.layer=c-1,v&&w<v.length&&b.layer===v[w].layer&&(b.near=v[w++]),t.addVertex(b),y=t.linkVertexes(o,b,n.link),y.valid=!0,y.rev=n.rev,y.portFromColOffset=g?0:a,y.portToColOffset=0,y.portFromPos=g?0:l,y.portToPos=0,o=b,c--;c-d>k&&c>0;)b=t.createVertex(),b.node=null,b._k=3,b.layer=c-1,v&&w<v.length&&b.layer===v[w].layer&&(b.near=v[w++]),t.addVertex(b),y=t.linkVertexes(o,b,n.link),y.valid=!0,y.rev=n.rev,y.portFromColOffset=0,y.portToColOffset=0,y.portFromPos=0,y.portToPos=0,o=b,c--;y=t.linkVertexes(b,r,n.link),y.valid=!p,p&&(b.near=r),y.rev=n.rev,y.portFromColOffset=0,y.portToColOffset=h,y.portFromPos=0,y.portToPos=u}else n.valid=!0}}V3(t){let e=0,i=t.link;if(i!==null){let s=i.fromPort,n=i.toPort;if(s!==null&&n!==null){let o=i.fromNode,r=i.toNode;if(o!==null&&r!==null){let a=this.tP(!0),h=this.tP(!1),l=this.setsPortSpots?a:i.computeSpot(!0,s),u=this.setsPortSpots?h:i.computeSpot(!1,n),c=i.isOrthogonal;if(l.isSide()&&l.includesSide(h)&&u.isSide()&&u.includesSide(a))return 0;let d=i.getLinkPoint(o,s,l,!0,c,r,n,P.l()),f=i.getLinkDirection(o,s,d,l,!0,c,r,n);P.i(d),(!l.isNone()&&f===this.xF(t,!0)||this.setsPortSpots&&o!==null&&o.ports.count===1&&t.rev)&&(e+=1);let p=i.getLinkPoint(r,n,u,!1,c,o,s,P.l()),g=i.getLinkDirection(r,n,p,u,!1,c,o,s);P.i(p),(!u.isNone()&&g===this.xF(t,!1)||this.setsPortSpots&&r!==null&&r.ports.count===1&&t.rev)&&(e+=2)}}}return e}xF(t,e){return this.P===90?e&&!t.rev||!e&&t.rev?270:90:this.P===180?e&&!t.rev||!e&&t.rev?0:180:this.P===270?e&&!t.rev||!e&&t.rev?90:270:e&&!t.rev||!e&&t.rev?180:0}B3(t,e){let i=[];return i.push(e),this.bF(t,i)?i.reverse():[]}bF(t,e){let i=e[e.length-1].sourceEdges.iterator;for(;i.next();){let s=i.value;if(s.rev||!s.valid)continue;let n=s.fromVertex;if(e.push(n),n===t||this.bF(t,e))return!0;e.pop()}return!1}C3(){this.ie.length!==this._+1&&(this.ie=new Int16Array(this._+1));let t=this.ie;for(let i=0;i<=this._;i++)t[i]=0;let e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;i.index=-1}this.initializeIndices(),this.Sw=-1,this.qg=0,this.Vs=0;for(let i=0;i<=this._;i++)t[i]>t[this.Vs]&&(this.Sw=t[i]-1,this.Vs=i),t[i]<t[this.qg]&&(this.qg=i);this.gu=[];for(let i=0;i<t.length;i++)this.gu[i]=[];for(e.reset();e.next();){let i=e.value,s=i.layer,n=this.gu[s];n[i.index]=i}}initializeIndices(){switch(this.fu){default:case 22:this.z3();break;case 20:this.X3();break;case 21:this.G3();break}}z3(){let t=null,e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;if(i.near&&(t===null&&(t=new Map),i.layer===i.near.layer)){let s=t.get(i.near)||[];s.push(i),t.set(i.near,s)}}for(e.reset();e.next();){let i=e.value;if(i.near)continue;let s=i.layer;if(i.index=this.ie[s],this.ie[s]++,!t)continue;let n=t.get(i);Array.isArray(n)&&n.forEach(o=>{o.index=this.ie[s],this.ie[s]++})}}X3(){let t=null,e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;if(i.near&&(t===null&&(t=new Map),i.layer===i.near.layer)){let s=t.get(i.near)||[];s.push(i),t.set(i.near,s)}}for(let i=this._;i>=0;i--)for(e.reset();e.next();){let s=e.value;s.layer===i&&s.index===-1&&this.kF(s,t)}}kF(t,e){if(t.near)return;let i=t.layer;if(t.index=this.ie[i],this.ie[i]++,e){let o=e.get(t);Array.isArray(o)&&o.forEach(r=>{r.index=this.ie[i],this.ie[i]++})}let s=t.or,n=!0;for(;n;){n=!1;for(let o=0;o<s.length-1;o++){let r=s[o],a=s[o+1];r.portFromColOffset>a.portFromColOffset&&(n=!0,s[o]=a,s[o+1]=r)}}for(let o=0;o<s.length;o++){let r=s[o];if(r.valid){let a=r.toVertex;a.index===-1&&this.kF(a,e)}}}G3(){let t=null,e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;if(i.near&&(t===null&&(t=new Map),i.layer===i.near.layer)){let s=t.get(i.near)||[];s.push(i),t.set(i.near,s)}}for(let i=0;i<=this._;i++)for(e.reset();e.next();){let s=e.value;s.layer===i&&s.index===-1&&this.PF(s,t)}}PF(t,e){if(t.near)return;let i=t.layer;if(t.index=this.ie[i],this.ie[i]++,e){let h=e.get(t);Array.isArray(h)&&h.forEach(l=>{l.index=this.ie[i],this.ie[i]++})}let s=t.So,n=!0,o=0;for(;n;)for(n=!1,o=0;o<s.length-1;o++){let h=s[o],l=s[o+1];h.portToColOffset>l.portToColOffset&&(n=!0,s[o]=l,s[o+1]=h)}let r,a;for(o=0;o<s.length;o++)a=s[o],a.valid&&(r=a.fromVertex,r.index===-1&&this.PF(r,e))}L3(){this.zt=-1;for(let t=0;t<=this._;t++){let e=this.ja(t),i=0,s=this.ie[t];for(let n=0;n<s;n++){let o=e[n];i+=this.nodeMinColumnSpace(o,!0),o.column=i,i+=1,i+=this.nodeMinColumnSpace(o,!1)}this.zt=Math.max(this.zt,i-1),this.Wa(t,e)}}reduceCrossings(){let t=this.countCrossings(),e=this.ei(),i=0,s=0,n=0;for(i=0;i<this.gc;i++){for(s=0;s<=this._;s++)this.eP(s,1),this.ys(s,1,!1,1);for(n=this.countCrossings(),n<t&&(t=n,e=this.ei()),s=this._;s>=0;s--)this.eP(s,-1),this.ys(s,-1,!1,-1);n=this.countCrossings(),n<t&&(t=n,e=this.ei())}for(this.ns(e),i=0;i<this.gc;i++){for(s=0;s<=this._;s++)this.eP(s,0),this.ys(s,0,!1,0);for(n=this.countCrossings(),n<t&&(t=n,e=this.ei()),s=this._;s>=0;s--)this.eP(s,0),this.ys(s,0,!1,0);n=this.countCrossings(),n<t&&(t=n,e=this.ei())}this.ns(e);let o=!1,r=0,a=0,h=0,l=0;switch(this.uu){case 30:break;case 32:for(h=t+1;(l=this.countCrossings())<h;)for(h=l,r=this._;r>=0;r--)for(a=0;a<=r;a++){for(o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,-1,!1,-1)||o;for(n=this.countCrossings(),n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,1,!1,1)||o;for(n=this.countCrossings(),n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,1,!1,1)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,-1,!1,-1)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,0,!1,0)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,0,!1,0)||o;n>=t?this.ns(e):(t=n,e=this.ei())}break;default:case 31:for(r=this._,a=0,h=t+1;(l=this.countCrossings())<h;){for(h=l,o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,-1,!1,-1)||o;for(n=this.countCrossings(),n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,1,!1,1)||o;for(n=this.countCrossings(),n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,1,!1,1)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,-1,!1,-1)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,0,!1,0)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,0,!1,0)||o;n>=t?this.ns(e):(t=n,e=this.ei())}break}this.ns(e)}eP(t,e){let i=0,s=!1,n=this.ja(t),o=this.ie[t],r=this.uF(t,e),a=this.Nw(t,e);for(i=0;i<o;i++)a[i]===-1&&(a[i]=n[i].column),r[i]===-1&&(r[i]=n[i].column);let h=!0,l;for(;h;)for(h=!1,i=0;i<o-1;i++)if(r[i+1]<r[i]||r[i+1]===r[i]&&a[i+1]<a[i]){s=!0,h=!0;let c=r[i];r[i]=r[i+1],r[i+1]=c;let d=a[i];a[i]=a[i+1],a[i+1]=d,l=n[i],n[i]=n[i+1],n[i+1]=l}let u=0;for(i=0;i<o;i++)l=n[i],l.index=i,u+=this.nodeMinColumnSpace(l,!0),l.column=u,u+=1,u+=this.nodeMinColumnSpace(l,!1);return this.Wa(t,n),s}ys(t,e,i,s){let n=this.ja(t),o=this.ie[t],r=this.fF(t,e),a=0,h;if(!i||s>0)for(h=new Float32Array(o),a=0;a<o;a++)h[a]=-1;else h=this.Nw(t,-1);let l;if(!i||s<0)for(l=new Float32Array(o),a=0;a<o;a++)l[a]=-1;else l=this.Nw(t,1);let u=!1,c=!0;for(;c;)for(c=!1,a=0;a<o-1;a++){let d=r[n[a].index*o+n[a+1].index],f=r[n[a+1].index*o+n[a].index],p=0,g=0,y=n[a].column,b=n[a+1].column,v=this.nodeMinColumnSpace(n[a],!0),w=this.nodeMinColumnSpace(n[a],!1),k=this.nodeMinColumnSpace(n[a+1],!0),S=this.nodeMinColumnSpace(n[a+1],!1),N=y-v+k,D=b-w+S,L=0,M=0,A=0,F=0,O=0,E=0,B=0,K,z=0,U,tt=0,nt=n[a].sourceEdges.iterator;if(i&&s<=0)for(;nt.next();){let bt=nt.value;K=bt.fromVertex,bt.valid&&K.layer!==t&&(A=this.linkStraightenWeight(bt),F=bt.portFromColOffset,O=bt.portToColOffset,E=K.column,L+=(Math.abs(y+O-(E+F))+1)*A,M+=(Math.abs(D+O-(E+F))+1)*A)}for(nt.reset();nt.next();){let bt=nt.value;if(K=bt.fromVertex,bt.valid&&K.layer===t){for(z=0;z<n.length&&n[z]!==K;)z++;z<a&&(p+=2*(a-z),g+=2*(a+1-z)),z===a+1&&(p+=1),z>a+1&&(p+=4*(z-a),g+=4*(z-(a+1)))}}let Z=n[a].destinationEdges.iterator;if(i&&s>=0)for(;Z.next();){let bt=Z.value;U=bt.toVertex,bt.valid&&U.layer!==t&&(A=this.linkStraightenWeight(bt),F=bt.portFromColOffset,O=bt.portToColOffset,B=U.column,L+=(Math.abs(y+F-(B+O))+1)*A,M+=(Math.abs(D+F-(B+O))+1)*A)}for(Z.reset();Z.next();){let bt=Z.value;if(U=bt.toVertex,bt.valid&&U.layer===t){for(tt=0;tt<n.length&&n[tt]!==U;)tt++;tt===a+1&&(g+=1)}}let it=n[a+1].sourceEdges.iterator;if(i&&s<=0)for(;it.next();){let bt=it.value;K=bt.fromVertex,bt.valid&&K.layer!==t&&(A=this.linkStraightenWeight(bt),F=bt.portFromColOffset,O=bt.portToColOffset,E=K.column,L+=(Math.abs(b+O-(E+F))+1)*A,M+=(Math.abs(N+O-(E+F))+1)*A)}for(it.reset();it.next();){let bt=it.value;if(K=bt.fromVertex,bt.valid&&K.layer===t){for(z=0;z<n.length&&n[z]!==K;)z++;z<a&&(p+=2*(a+1-z),g+=2*(a-z)),z===a&&(g+=1),z>a+1&&(p+=4*(z-(a+1)),g+=4*(z-a))}}let _=n[a+1].destinationEdges.iterator;if(i&&s>=0)for(;_.next();){let bt=_.value;U=bt.toVertex,bt.valid&&U.layer!==t&&(A=this.linkStraightenWeight(bt),F=bt.portFromColOffset,O=bt.portToColOffset,B=U.column,L+=(Math.abs(b+F-(B+O))+1)*A,M+=(Math.abs(N+F-(B+O))+1)*A)}for(_.reset();_.next();){let bt=_.value;if(U=bt.toVertex,bt.valid&&U.layer===t){for(tt=0;tt<n.length&&n[tt]!==U;)tt++;tt===a&&(p+=1)}}let at=0,ct=0,xt=h[n[a].index],Ct=l[n[a].index],Q=h[n[a+1].index],Pt=l[n[a+1].index];if(xt!==-1&&(at+=Math.abs(xt-y),ct+=Math.abs(xt-D)),Ct!==-1&&(at+=Math.abs(Ct-y),ct+=Math.abs(Ct-D)),Q!==-1&&(at+=Math.abs(Q-b),ct+=Math.abs(Q-N)),Pt!==-1&&(at+=Math.abs(Pt-b),ct+=Math.abs(Pt-N)),g<p-.5||g===p&&f<d-.5||g===p&&f===d&&M<L-.5||g===p&&f===d&&M===L&&ct<at-.5){u=!0,c=!0,n[a].column=D,n[a+1].column=N;let bt=n[a];n[a]=n[a+1],n[a+1]=bt}}for(a=0;a<o;a++)n[a].index=a;return this.Wa(t,n),u}straightenAndPack(){if(this.Xn!==0){this.Y3();return}let t=0,e=!1,i=(this.hr&1)!==0,s=(this.hr&8)!==0;if(this.network.edges.count>1e3&&s&&(i=!1),i){let n=[],o=0;for(o=0;o<=this._;o++)n[o]=0;let r=0,a=this.network.vertexes.iterator;for(;a.next();){let l=a.value;t=l.layer,r=l.column;let u=this.nodeMinColumnSpace(l,!1);n[t]=Math.max(n[t],r+u)}let h=8;for(a.reset();a.next();){let l=a.value;t=l.layer,r=l.column,l.column=((this.zt-n[t])*h>>1)+r*h}this.zt*=h}if((this.hr&2)!==0){e=!0;let n=0;for(;e&&n<this.du;){for(e=!1,t=this.Vs+1;t<=this._;t++)e=this.Jg(t,1)||e;for(t=this.Vs-1;t>=0;t--)e=this.Jg(t,-1)||e;e=this.Jg(this.Vs,0)||e,n++}}if((this.hr&4)!==0){for(t=this.Vs+1;t<=this._;t++)this.yL(t,1);for(t=this.Vs-1;t>=0;t--)this.yL(t,-1);this.yL(this.Vs,0)}if(i&&(this.SF(-1),this.SF(1)),(this.hr&2)!==0){e=!0;let n=0;for(;e&&n<this.du;){for(e=!1,e=this.Jg(this.Vs,0)||e,t=this.Vs+1;t<=this._;t++)e=this.Jg(t,0)||e;for(t=this.Vs-1;t>=0;t--)e=this.Jg(t,0)||e;n++}}}Jg(t,e){let i=!1;for(;this.K3(t,e);)i=!0;return i}K3(t,e){let i=0,s=this.ja(t),n=this.ie[t],o=this.Nw(t,-1);if(e>0)for(i=0;i<n;i++)o[i]=-1;let r=this.Nw(t,1);if(e<0)for(i=0;i<n;i++)r[i]=-1;let a=!1,h=!0;for(;h;)for(h=!1,i=0;i<n;i++){let l=s[i].column,u=this.nodeMinColumnSpace(s[i],!0),c=this.nodeMinColumnSpace(s[i],!1),d=0;i-1<0||l-s[i-1].column-1>u+this.nodeMinColumnSpace(s[i-1],!1)?d=l-1:d=l;let f=0;i+1>=n||s[i+1].column-l-1>c+this.nodeMinColumnSpace(s[i+1],!0)?f=l+1:f=l;let p=0,g=0,y=0,b=0,v=0,w=0;if(e<=0){let M=s[i].sourceEdges.iterator;for(;M.next();){let A=M.value,F=A.fromVertex;if(A.valid&&F.layer!==t){b=this.linkStraightenWeight(A),v=A.portFromColOffset,w=A.portToColOffset;let O=F.column;p+=(Math.abs(l+w-(O+v))+1)*b,g+=(Math.abs(d+w-(O+v))+1)*b,y+=(Math.abs(f+w-(O+v))+1)*b}}}if(e>=0){let M=s[i].destinationEdges.iterator;for(;M.next();){let A=M.value,F=A.toVertex;if(A.valid&&F.layer!==t){b=this.linkStraightenWeight(A),v=A.portFromColOffset,w=A.portToColOffset;let O=F.column;p+=(Math.abs(l+v-(O+w))+1)*b,g+=(Math.abs(d+v-(O+w))+1)*b,y+=(Math.abs(f+v-(O+w))+1)*b}}}let k=0,S=0,N=0,D=o[s[i].index],L=r[s[i].index];D!==-1&&(k+=Math.abs(D-l),S+=Math.abs(D-d),N+=Math.abs(D-f)),L!==-1&&(k+=Math.abs(L-l),S+=Math.abs(L-d),N+=Math.abs(L-f)),g<p||g===p&&S<k?(a=!0,h=!0,s[i].column=d):(y<p||y===p&&N<k)&&(a=!0,h=!0,s[i].column=f)}return this.Wa(t,s),this.Mw(),a}yL(t,e){let i=0,s=this.ja(t),n=this.ie[t],o=this.uF(t,e),r=new Int16Array(o),a=!1,h=!0;for(;h;)for(h=!1,i=0;i<n;i++){let l=s[i].column,u=this.nodeMinColumnSpace(s[i],!0),c=this.nodeMinColumnSpace(s[i],!1),d=0,f=0,p=0,g=0,y=0;r[i]===-1?i===0&&i===n-1?d=l:i===0?(f=s[i+1].column,f-l===c+this.nodeMinColumnSpace(s[i+1],!0)?d=l-1:d=l):i===n-1?(p=s[i-1].column,l-p===u+this.nodeMinColumnSpace(s[i-1],!1)?d=l+1:d=l):(p=s[i-1].column,y=p+this.nodeMinColumnSpace(s[i-1],!1)+u+1,f=s[i+1].column,g=f-this.nodeMinColumnSpace(s[i+1],!0)-c-1,d=(y+g)/2|0):i===0&&i===n-1?d=r[i]:i===0?(f=s[i+1].column,g=f-this.nodeMinColumnSpace(s[i+1],!0)-c-1,d=Math.min(r[i],g)):i===n-1?(p=s[i-1].column,y=p+this.nodeMinColumnSpace(s[i-1],!1)+u+1,d=Math.max(r[i],y)):(p=s[i-1].column,y=p+this.nodeMinColumnSpace(s[i-1],!1)+u+1,f=s[i+1].column,g=f-this.nodeMinColumnSpace(s[i+1],!0)-c-1,y<r[i]&&r[i]<g?d=r[i]:y>=r[i]?d=y:g<=r[i]&&(d=g)),d!==l&&(a=!0,h=!0,s[i].column=d)}return this.Wa(t,s),this.Mw(),a}H3(){for(let t=0;t<=this.zt;t++)for(;this.q3(t,1););this.Mw()}q3(t,e){let i=!0,s=this.network.vertexes.iterator;for(;s.next();){let o=s.value,r=this.nodeMinColumnSpace(o,!0),a=this.nodeMinColumnSpace(o,!1);if(o.column-r<=t&&o.column+a>=t){i=!1;break}}let n=!1;if(i){if(e>0)for(s.reset();s.next();){let o=s.value;o.column>t&&(o.column-=1,n=!0)}if(e<0)for(s.reset();s.next();){let o=s.value;o.column<t&&(o.column+=1,n=!0)}}return n}j3(){this.H3();for(let t=0;t<this.zt;t++)for(;this.W3(t,1););this.Mw()}W3(t,e){let i=t;e>0&&(i=t+1),e<0&&(i=t-1);let s=0,n=[],o=[];for(s=0;s<=this._;s++)n[s]=!1,o[s]=!1;let r=this.network.vertexes.iterator;for(;r.next();){let l=r.value,u=l.column-this.nodeMinColumnSpace(l,!0),c=l.column+this.nodeMinColumnSpace(l,!1);u<=t&&c>=t&&(n[l.layer]=!0),u<=i&&c>=i&&(o[l.layer]=!0)}let a=!0,h=!1;for(s=0;s<=this._;s++)a=a&&!(n[s]&&o[s]);if(a){if(e>0)for(r.reset();r.next();){let l=r.value;l.column>t&&(l.column-=1,h=!0)}if(e<0)for(r.reset();r.next();){let l=r.value;l.column<t&&(l.column+=1,h=!0)}}return h}SF(t){this.j3();let e=0,i,s=0,n=0,o=0;if(t>0)for(e=0;e<=this.zt;e++)for(i=this.ei(),s=this.Qk(!0),n=s+1;s<n;)n=s,this.MF(e,1),o=this.Qk(!0),o>s?this.ns(i):o<s&&(s=o,i=this.ei());if(t<0)for(e=this.zt;e>=0;e--)for(i=this.ei(),s=this.Qk(!0),n=s+1;s<n;)n=s,this.MF(e,-1),o=this.Qk(!0),o>s?this.ns(i):o<s&&(s=o,i=this.ei());this.Mw()}MF(t,e){this.cn=0;let i=this.network.vertexes.iterator;for(;i.next();){let u=i.value;u.component=-1}if(e>0)for(i.reset();i.next();){let u=i.value;u.column-this.nodeMinColumnSpace(u,!0)<=t&&(u.component=this.cn)}if(e<0)for(i.reset();i.next();){let u=i.value;u.column+this.nodeMinColumnSpace(u,!1)>=t&&(u.component=this.cn)}for(this.cn++,i.reset();i.next();){let u=i.value;u.component===-1&&(this.mL(u,this.cn,-1,!0,!0),this.cn++)}let s=0,n=[];for(s=0;s<this.cn*this.cn;s++)n[s]=!1;let o=[];for(s=0;s<(this._+1)*(this.zt+1);s++)o[s]=-1;for(i.reset();i.next();){let u=i.value,c=u.layer,d=Math.max(0,u.column-this.nodeMinColumnSpace(u,!0)),f=Math.min(this.zt,u.column+this.nodeMinColumnSpace(u,!1));for(let p=d;p<=f;p++)o[c*(this.zt+1)+p]=u.component}for(let u=0;u<=this._;u++){if(e>0)for(let c=0;c<this.zt;c++)o[u*(this.zt+1)+c]!==-1&&o[u*(this.zt+1)+c+1]!==-1&&o[u*(this.zt+1)+c]!==o[u*(this.zt+1)+c+1]&&(n[o[u*(this.zt+1)+c]*this.cn+o[u*(this.zt+1)+c+1]]=!0);if(e<0)for(let c=this.zt;c>0;c--)o[u*(this.zt+1)+c]!==-1&&o[u*(this.zt+1)+c-1]!==-1&&o[u*(this.zt+1)+c]!==o[u*(this.zt+1)+c-1]&&(n[o[u*(this.zt+1)+c]*this.cn+o[u*(this.zt+1)+c-1]]=!0)}let r=[];for(s=0;s<this.cn;s++)r[s]=!0;let a=[];a.push(0);let h=0;for(;a.length!==0;)if(h=a[a.length-1],a.pop(),r[h])for(r[h]=!1,s=0;s<this.cn;s++)n[h*this.cn+s]&&a.splice(0,0,s);let l=!1;if(e>0)for(i.reset();i.next();){let u=i.value;r[u.component]&&(u.column-=1,l=!0)}if(e<0)for(i.reset();i.next();){let u=i.value;r[u.component]&&(u.column+=1,l=!0)}return l}Y3(){let t=m.nt(),e=this.gu.length;for(let d=0;d<=e;d++)t[d]=[];let i=this.network.vertexes.iterator;for(;i.next();){let d=i.value,f=e-d.layer,p=t[f];p[d.index]=d}let s=new V;this.J3(t,s);let n=null,o=null,r=null,a=null,h=(this.Xn&1)!==0,l=(this.Xn&2)!==0,u=(this.Xn&4)!==0,c=(this.Xn&8)!==0;h&&(this.al(t,s,!0),n=this.iP(t,!0,!1)),t.reverse(),u&&(this.al(t,s,!1),r=this.iP(t,!1,!1));for(let d of t)d.reverse();c&&(this.al(t,s,!1),a=this.iP(t,!1,!0)),t.reverse(),l&&(this.al(t,s,!0),o=this.iP(t,!0,!0)),m.Z(t),this.$3(n,o,r,a),this.network.vertexes.each(d=>{let f=d,p=m.nt();h&&p.push(n.get(f)),l&&p.push(o.get(f)),u&&p.push(r.get(f)),c&&p.push(a.get(f)),p.sort((w,k)=>w-k);let g=p.length,y=Math.floor((g-1)/2),b=Math.ceil((g-1)/2),v=(p[y]+p[b])/2;m.Z(p),f.mi=v})}J3(t,e){let i=t.length;for(let s=1;s<i-1;s++){let n=0,o=0,r=t[s],a=t[s+1];for(let h=0;o<a.length;h++){let l=a[h],u=this.Z3(l);if(h===a.length-1||u){let c=r.length-1;for(u&&(c=l.getProperSourceVertexes()[0].index);o<=h;){let d=a[o].getProperSourceEdges();for(let f of d){let p=f.fromVertex.index;(p<n||p>c)&&e.add(f)}o++}n=c}}}}Z3(t){if(t.node===null){let e=t.getProperSourceVertexes();if(e.length>0)return e[0].node===null}return!1}al(t,e,i){this.Q3(t);for(let s of t){let n=-1;for(let o of s){let r=i?o.getProperSourceVertexes():o.getProperDestinationVertexes(),a=r.length;if(a>0){r.sort((l,u)=>l.Ja-u.Ja);let h=(a-1)/2;for(let l=Math.floor(h),u=Math.ceil(h);l<=u;l++)if(o.Gn===o){let c=r[l],d;i?d=c.getDestinationEdge(o):d=o.getDestinationEdge(c),!e.has(d)&&n<c.Ja&&(c.Gn=o,o.mc=c.mc,o.Gn=c.mc,n=c.Ja)}}}}}Q3(t){for(let e=0;e<t.length;e++){let i=t[e];for(let s=0;s<i.length;s++){let n=i[s];n.mc=n,n.Gn=n,n.NF=e,n.Ja=s}}}iP(t,e,i){let s=this.P===90||this.P===270;for(let o of t)for(let r of o)r.os=r,r.pu=1/0,r.mi=NaN,r.Yn=0;this._3(t,e,i);for(let o of t)for(let r of o)r.mc===r&&this.CF(r,t);for(let o=0;o<t.length;o++){if(t[o].length<=0)continue;let r=t[o][0];if(r.os===r){r.os.pu===1/0&&(r.os.pu=0);let a=o,h=0,l;do{for(l=t[a][h];l.Gn!==l.mc;)if(l=l.Gn,a++,l.Ja>0){let u=this.LF(l,t),c=s?u.width:u.height,d=l.os.pu+l.mi+l.Yn-(u.mi+u.Yn+c+this.columnSpacing);u.os.pu=Math.min(u.os.pu,d)}h=l.Ja+1}while(a<t.length&&h<t[a].length&&l.os===t[a][h].os)}}let n=new Mt;for(let o of t)for(let r of o){r.mi=r.mi+r.os.pu+r.Yn;let a=s?r.width:r.height;n.set(r,i?-r.mi-a:r.mi)}return n}_3(t,e,i){let s=this.P===90||this.P===270;for(let n of t)for(let o of n)if(o.mc===o){let r=0,a=o;for(;a.Gn!==o;){let h=a.Gn,l=s?a.width:a.height,u=s?h.width:h.height,c,d,f,p;e?(f=a.getDestinationEdge(h),c=f.portFromPos,d=f.portToPos,f.link!==null&&(a.node&&a.node!==f.link.fromNode&&(c=s?a.focusX:a.focusY),h.node&&h.node!==f.link.toNode&&(d=s?h.focusX:h.focusY)),i?p=a.Yn+(l-c)-(u-d):p=a.Yn+c-d):(f=h.getDestinationEdge(a),c=f.portToPos,d=f.portFromPos,f.link!==null&&(a.node&&a.node!==f.link.toNode&&(c=s?a.focusX:a.focusY),h.node&&h.node!==f.link.fromNode&&(d=s?h.focusX:h.focusY)),i?p=a.Yn+(l-c)-(u-d):p=a.Yn+c-d),h.Yn=p,r=Math.min(r,p),a=a.Gn}a=o;do a.Yn=a.Yn-r,a=a.Gn;while(a!==o)}}CF(t,e){if(!isNaN(t.mi))return;t.mi=0;let i=t;do{if(i.Ja>0){let s=this.LF(i,e),n=s.mc;this.CF(n,e),t.os===t&&(t.os=n.os);let o=this.P===90||this.P===270?s.width:s.height;if(t.os===n.os){let r=n.mi+s.Yn+o-i.Yn+this.columnSpacing;t.mi=Math.max(t.mi,r)}}i=i.Gn}while(i!==t);for(;i.Gn!==t;)i=i.Gn,i.mi=t.mi,i.os=t.os}LF(t,e){let i=t.NF,s=t.Ja;return s<1&&m.o("Could not determine previous vertex in layer"),e[i][s-1]}$3(...t){let e=-1,i=m.nt(),s=m.nt(),n=1/0;for(let o=0;o<4;o++){if(!t[o])continue;let r=this.tU(t[o],i,s,o);r<n&&(e=o,n=r)}for(let o=0;o<4;o++){let r=t[o];if(!r)continue;let a=o===0||o===2?i[e]-i[o]:s[e]-s[o];a!==0&&r.each(h=>{r.set(h.key,h.value+a)})}m.Z(i),m.Z(s)}tU(t,e,i,s){if(!t||t.count===0)return e[s]=0,i[s]=0,1/0;let n=1/0,o=-1/0;return t.each(r=>{let a=r.key,h=r.value,l=this.P===90||this.P===270?a.width:a.height;h<n&&(n=h),h+l>o&&(o=h+l)}),e[s]=n,i[s]=o,o-n}commitLayout(){this.Pw(),this.commitNodes(),this.wL(),this.isRouting&&this.commitLinks()}Pw(){if(!this.setsPortSpots)return;let t=this.tP(!0),e=this.tP(!1),i=this.network.edges.iterator;for(;i.next();){let s=i.value.link;s!==null&&(s.fromSpot=t,s.toSpot=e)}}tP(t){return this.P===270?t?T.MiddleTop:T.MiddleBottom:this.P===90?t?T.MiddleBottom:T.MiddleTop:this.P===180?t?T.MiddleLeft:T.MiddleRight:t?T.MiddleRight:T.MiddleLeft}commitNodes(){this.Bs.length!==this._+1&&(this.Bs=new Float32Array(this._+1)),this.ms.length!==this._+1&&(this.ms=new Float32Array(this._+1)),this.ps.length!==this._+1&&(this.ps=new Float32Array(this._+1)),this.Rt.length!==this._+1&&(this.Rt=new Float32Array(this._+1));for(let f=0;f<=this._;f++)this.Bs[f]=0,this.ms[f]=0,this.ps[f]=0,this.Rt[f]=0;let t=this.network.vertexes.iterator;for(;t.next();){let f=t.value,p=f.layer;this.Bs[p]=Math.max(this.Bs[p],this.nodeMinLayerSpace(f,!0)),this.ms[p]=Math.max(this.ms[p],this.nodeMinLayerSpace(f,!1))}let e=0,i=this.Us;for(let f=0;f<=this._;f++){let p=i;this.Bs[f]+this.ms[f]<=0&&(p=0),f>0&&(e+=p/2),this.P===90||this.P===0?(e+=this.ms[f],this.ps[f]=e,e+=this.Bs[f]):(e+=this.Bs[f],this.ps[f]=e,e+=this.ms[f]),f<this._&&(e+=p/2),this.Rt[f]=e}let s=e,n=this.arrangementOrigin;for(let f=0;f<=this._;f++)this.P===270?this.ps[f]=n.y+this.ps[f]:this.P===90?(this.ps[f]=n.y+s-this.ps[f],this.Rt[f]=s-this.Rt[f]):this.P===180?this.ps[f]=n.x+this.ps[f]:(this.ps[f]=n.x+s-this.ps[f],this.Rt[f]=s-this.Rt[f]);let o=this.Xn!==0;t.reset();let r=this.P===270||this.P===90,a=1/0,h=1/0,l=1/0,u=-1/0;for(;t.next();){let f=t.value,p=f.layer,g=f.column|0,y=0,b=0;r?(y=n.x+this.ti*g,b=this.ps[p]):(y=this.ps[p],b=n.y+this.ti*g),f.centerX=y,f.centerY=b,o&&isFinite(f.mi)&&(r?f.node?f.x=n.x+f.mi:f.centerX=n.x+f.mi:f.node?f.y=n.y+f.mi:f.centerY=n.y+f.mi),a=Math.min(f.x,a),h=Math.min(f.y,h),r?(l=a,u=Math.max(u,f.bounds.right)):(l=h,u=Math.max(u,f.bounds.bottom))}this.gL=u-l;let c=n.x-a,d=n.y-h;for(this.cr=new P(o&&r?0:c,o&&!r?0:d),t.reset();t.next();){let f=t.value;f.x+=c,f.y+=d,f.commit()}}wL(){let t=0,e=this.Us;for(let n=0;n<=this._;n++)t+=this.Bs[n],t+=this.ms[n];t+=this._*e;let i=[],s=this.Xn!==0?this.gL:this.ti*this.zt;for(let n=this.maxLayer;n>=0;n--)this.P===270?n===0?i.push(new I(0,0,s,Math.abs(this.Rt[0]))):i.push(new I(0,this.Rt[n-1],s,Math.abs(this.Rt[n-1]-this.Rt[n]))):this.P===90?n===0?i.push(new I(0,this.Rt[0],s,Math.abs(this.Rt[0]-t))):i.push(new I(0,this.Rt[n],s,Math.abs(this.Rt[n-1]-this.Rt[n]))):this.P===180?n===0?i.push(new I(0,0,Math.abs(this.Rt[0]),s)):i.push(new I(this.Rt[n-1],0,Math.abs(this.Rt[n-1]-this.Rt[n]),s)):n===0?i.push(new I(this.Rt[0],0,Math.abs(this.Rt[0]-t),s)):i.push(new I(this.Rt[n],0,Math.abs(this.Rt[n-1]-this.Rt[n]),s));this.commitLayers(i,this.cr)}commitLayers(t,e){}commitLinks(){let t=this.network.edges.iterator,e=null;for(;t.next();)e=t.value.link,e!==null&&e.pointsCount>0&&(e.startRoute(),e.clearPoints(),e.commitRoute());for(t.reset();t.next();)e=t.value.link,e!==null&&e.updateRoute();for(t.reset();t.next();){let i=t.value;if(e=i.link,e===null||e.pointsCount===0)continue;e.startRoute();let s=e,n=s.fromNode,o=s.toNode,r=s.fromPort,a=s.toPort;if(n!==null){let A=n.findVisibleNode();A!==null&&A!==n&&(n=A,r=A.port)}if(o!==null){let A=o.findVisibleNode();A!==null&&A!==o&&(o=A,a=A.port)}let h=e.computeSpot(!0,r),l=e.computeSpot(!1,a),u=i.fromVertex,c=i.toVertex;if(i.valid){if(e.curve===9&&e.pointsCount===4)if(u.column===c.column&&this.alignOption===0){let A=e.getLinkPoint(n,r,h,!0,!1,o,a),F=e.getLinkPoint(o,a,l,!1,!1,n,r);A.isReal()||A.set(n.actualBounds.center),F.isReal()||F.set(o.actualBounds.center),e.clearPoints(),e.addPointAt(A.x,A.y),e.addPointAt((2*A.x+F.x)/3,(2*A.y+F.y)/3),e.addPointAt((A.x+2*F.x)/3,(A.y+2*F.y)/3),e.addPointAt(F.x,F.y)}else{let A=!1,F=!1;if(r!==null&&e.bl(h)&&(A=!0),a!==null&&e.bl(l)&&(F=!0),A||F){let O=null;A&&(O=e.getLinkPointFromPoint(n,r,r.getDocumentPoint(T.Center),e.getPoint(3),!0),O.isReal()||O.set(n.actualBounds.center),e.setPointAt(0,O.x,O.y));let E=null;if(F&&(E=e.getLinkPointFromPoint(o,a,a.getDocumentPoint(T.Center),e.getPoint(0),!1),E.isReal()||E.set(o.actualBounds.center),e.setPointAt(3,E.x,E.y)),O){let B=e.getPoint(2);e.setPointAt(1,(O.x*2+B.x)/3,(O.y*2+B.y)/3)}if(E){let B=e.getPoint(1);e.setPointAt(2,(E.x*2+B.x)/3,(E.y*2+B.y)/3)}}}e.commitRoute();continue}if(u.layer===c.layer){e.commitRoute();continue}let d=!1,f=!1,p=this.Us,g=0,y=e.firstPickIndex+1;if(e.isOrthogonal)f=!0,g=e.pointsCount,g>4&&e.points.removeRange(2,g-3);else if(e.curve===9)d=!0,g=e.pointsCount,g>4&&e.points.removeRange(2,g-3),g===4&&(y=2);else{g=e.pointsCount;let A=h===T.None,F=l===T.None;g>2&&A&&F?e.points.removeRange(1,g-2):g>3&&A&&!F?e.points.removeRange(1,g-3):g>3&&!A&&F?e.points.removeRange(2,g-2):g>4&&!A&&!F&&e.points.removeRange(2,g-3)}let b,v,w=0,k=0,S=0,N=0,D=0,L=0,M=0;if(i.rev){let A=0;for(;c!==null&&u!==c;){b=null,v=null;let F=c.sourceEdges.iterator;for(;F.next();){let O=F.value;if(O.link===i.link&&(b=O.fromVertex,v=O.toVertex,b.node===null))break}if(b===null)break;if(b!==u)if(w=e.getPoint(y-1).x,k=e.getPoint(y-1).y,S=b.centerX,N=b.centerY,f)this.P===180||this.P===0?y===e.firstPickIndex+1?(e.insertPointAt(y++,w,k),e.insertPointAt(y++,w,N)):(v!==null?v.centerY:k)!==N&&(D=this.Rt[b.layer-1]+this.cr.x,e.insertPointAt(y++,D,k),e.insertPointAt(y++,D,N)):y===e.firstPickIndex+1?(e.insertPointAt(y++,w,k),e.insertPointAt(y++,S,k)):(v!==null?v.centerX:w)!==S&&(D=this.Rt[b.layer-1]+this.cr.y,e.insertPointAt(y++,w,D),e.insertPointAt(y++,S,D));else if(y===e.firstPickIndex+1)if(L=Math.max(10,this.Bs[c.layer]),M=Math.max(10,this.ms[c.layer]),d)this.P===180?S<=c.bounds.x?(A=c.bounds.x,e.insertPointAt(y++,A-L,N),e.insertPointAt(y++,A,N),e.insertPointAt(y++,A+M,N)):(e.insertPointAt(y++,S-L,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S+M,N)):this.P===90?N>=c.bounds.bottom?(A=c.bounds.y+c.bounds.height,e.insertPointAt(y++,S,A+M),e.insertPointAt(y++,S,A),e.insertPointAt(y++,S,A-L)):(e.insertPointAt(y++,S,N+M),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N-L)):this.P===270?N<=c.bounds.y?(A=c.bounds.y,e.insertPointAt(y++,S,A-L),e.insertPointAt(y++,S,A),e.insertPointAt(y++,S,A+M)):(e.insertPointAt(y++,S,N-L),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N+M)):this.P===0&&(S>=c.bounds.right?(A=c.bounds.x+c.bounds.width,e.insertPointAt(y++,A+M,N),e.insertPointAt(y++,A,N),e.insertPointAt(y++,A-L,N)):(e.insertPointAt(y++,S+M,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S-L,N)));else{e.insertPointAt(y++,w,k);let O=0;this.P===180||this.P===0?((this.P===180?S>=c.bounds.right:S<=c.bounds.x)&&(O=(this.P===0?-L:M)/2),e.insertPointAt(y++,w+O,N)):((this.P===270?N>=c.bounds.bottom:N<=c.bounds.y)&&(O=(this.P===90?-L:M)/2),e.insertPointAt(y++,S,k+O)),e.insertPointAt(y++,S,N)}else L=Math.max(10,this.Bs[b.layer]),M=Math.max(10,this.ms[b.layer]),d?this.P===180?(e.insertPointAt(y++,S-L-Math.max(10,p),N),e.insertPointAt(y++,Math.min(S-L+p/2,S),N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,Math.max(S+M-p/2,S),N),e.insertPointAt(y++,S+M+p,N)):this.P===90?(e.insertPointAt(y++,S,N+M+Math.max(10,p)),e.insertPointAt(y++,S,Math.max(N+M-p/2,N)),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,Math.min(N-L+p/2,N)),e.insertPointAt(y++,S,N-L-p)):this.P===270?(e.insertPointAt(y++,S,N-L-Math.max(10,p)),e.insertPointAt(y++,S,Math.min(N-L+p/2,N)),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,Math.max(N+M-p/2,N)),e.insertPointAt(y++,S,N+M+p)):(e.insertPointAt(y++,S+M+Math.max(10,p),N),e.insertPointAt(y++,Math.max(S+M-p/2,S),N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,Math.min(S-L+p/2,S),N),e.insertPointAt(y++,S-L-p,N)):(this.P===180||this.P===90||this.P,e.insertPointAt(y++,S,N));c=b}if(a===null||h!==T.None||f)if(w=e.getPoint(y-1).x,k=e.getPoint(y-1).y,S=e.getPoint(y).x,N=e.getPoint(y).y,f){let F=this.ms[u.layer],O=0;this.P===180||this.P===0?(O=k,O>=u.bounds.y&&O<=u.bounds.bottom&&(this.P===180?S>=u.bounds.x:S<=u.bounds.right)&&(A=u.centerX+(this.P===180?-F:F),O<u.bounds.y+u.bounds.height/2?O=u.bounds.y-this.ti/2:O=u.bounds.bottom+this.ti/2,e.insertPointAt(y++,A,k),e.insertPointAt(y++,A,O)),e.insertPointAt(y++,S,O),e.insertPointAt(y++,S,N)):(O=w,O>=u.bounds.x&&O<=u.bounds.right&&(this.P===270?N>=u.bounds.y:N<=u.bounds.bottom)&&(A=u.centerY+(this.P===270?-F:F),O<u.bounds.x+u.bounds.width/2?O=u.bounds.x-this.ti/2:O=u.bounds.right+this.ti/2,e.insertPointAt(y++,w,A),e.insertPointAt(y++,O,A)),e.insertPointAt(y++,O,N),e.insertPointAt(y++,S,N))}else if(d)L=Math.max(10,this.Bs[u.layer]),M=Math.max(10,this.ms[u.layer]),this.P===180&&S>=u.bounds.x?(A=u.bounds.x+u.bounds.width,e.setPointAt(y-2,A,k),e.setPointAt(y-1,A+M,k)):this.P===90&&N<=u.bounds.bottom?(A=u.bounds.y,e.setPointAt(y-2,w,A),e.setPointAt(y-1,w,A-L)):this.P===270&&N>=u.bounds.y?(A=u.bounds.y+u.bounds.height,e.setPointAt(y-2,w,A),e.setPointAt(y-1,w,A+M)):this.P===0&&S<=u.bounds.right&&(A=u.bounds.x,e.setPointAt(y-2,A,k),e.setPointAt(y-1,A-L,k));else{L=Math.max(10,this.Bs[u.layer]),M=Math.max(10,this.ms[u.layer]);let F=0;this.P===180||this.P===0?((this.P===180?S<=u.bounds.x:S>=u.bounds.right)&&(F=(this.P===0?M:-L)/2),e.insertPointAt(y++,S+F,k)):((this.P===270?N<=u.bounds.y:N>=u.bounds.bottom)&&(F=(this.P===90?M:-L)/2),e.insertPointAt(y++,w,N+F)),e.insertPointAt(y++,S,N)}}else{for(;u!==null&&u!==c;){b=null,v=null;let A=u.destinationEdges.iterator;for(;A.next();){let F=A.value;if(F.link===i.link&&(b=F.toVertex,v=F.fromVertex,v.node!==null&&(v=null),b.node===null))break}if(b===null)break;b!==c&&(w=e.getPoint(y-1).x,k=e.getPoint(y-1).y,S=b.centerX,N=b.centerY,f?this.P===180||this.P===0?(v!==null?v.centerY:k)!==N&&(D=this.Rt[b.layer]+this.cr.x,y===e.firstPickIndex+1&&(this.P===0?D=Math.max(D,w):D=Math.min(D,w)),e.insertPointAt(y++,D,k),e.insertPointAt(y++,D,N)):(v!==null?v.centerX:w)!==S&&(D=this.Rt[b.layer]+this.cr.y,y===e.firstPickIndex+1&&(this.P===90?D=Math.max(D,k):D=Math.min(D,k)),e.insertPointAt(y++,w,D),e.insertPointAt(y++,S,D)):(L=Math.max(10,this.Bs[b.layer]),M=Math.max(10,this.ms[b.layer]),d?this.P===180?(e.insertPointAt(y++,S+M+Math.max(10,p),N),e.insertPointAt(y++,Math.max(S+M-p/2,S),N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,Math.min(S-L+p/2,S),N),e.insertPointAt(y++,S-L-p,N)):this.P===90?(e.insertPointAt(y++,S,N-L-Math.max(10,p)),e.insertPointAt(y++,S,Math.min(N-L+p/2,N)),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,Math.max(N+M-p/2,N)),e.insertPointAt(y++,S,N+M+p)):this.P===270?(e.insertPointAt(y++,S,N+M+Math.max(10,p)),e.insertPointAt(y++,S,Math.max(N+M-p/2,N)),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,Math.min(N-L+p/2,N)),e.insertPointAt(y++,S,N-L-p)):(e.insertPointAt(y++,S-L-Math.max(10,p),N),e.insertPointAt(y++,Math.min(S-L+p/2,S),N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,Math.max(S+M-p/2,S),N),e.insertPointAt(y++,S+M+p,N)):this.P===180?(e.insertPointAt(y++,S+M,N),e.insertPointAt(y++,S-L,N)):this.P===90?(e.insertPointAt(y++,S,N-L),e.insertPointAt(y++,S,N+M)):this.P===270?(e.insertPointAt(y++,S,N+M),e.insertPointAt(y++,S,N-L)):(e.insertPointAt(y++,S-L,N),e.insertPointAt(y++,S+M,N)))),u=b}f&&(w=e.getPoint(y-1).x,k=e.getPoint(y-1).y,S=e.getPoint(y).x,N=e.getPoint(y).y,this.P===180||this.P===0?k!==N&&(this.P===0?D=Math.min(Math.max((S+w)/2,this.Rt[c.layer]+this.cr.x),S):D=Math.max(Math.min((S+w)/2,this.Rt[c.layer]+this.cr.x),S),e.insertPointAt(y++,D,k),e.insertPointAt(y++,D,N)):w!==S&&(this.P===90?D=Math.min(Math.max((N+k)/2,this.Rt[c.layer]+this.cr.y),N):D=Math.max(Math.min((N+k)/2,this.Rt[c.layer]+this.cr.y),N),e.insertPointAt(y++,w,D),e.insertPointAt(y++,S,D)))}if(s!==null&&d&&e.pointsCount>=4){if(n!==null&&r!==null&&s.bl(h)){let A=r.getDocumentPoint(T.Center);A.isReal()||A.setTo(n.actualBounds.centerX,n.actualBounds.centerY);let F=e.getPoint(3),O=e.getPoint(2);this.direction===90||this.direction===270?(e.setPointAt(1,F.x,(O.y+F.y)/2),e.setPointAt(2,F.x,(O.y+F.y)/2)):(e.setPointAt(1,(O.x+F.x)/2,F.y),e.setPointAt(2,(O.x+F.x)/2,F.y));let E=e.getLinkPointFromPoint(n,r,A,e.getPoint(1),!0);e.setPointAt(0,E.x,E.y)}if(o!==null&&a!==null&&s.bl(l)){let A=a.getDocumentPoint(T.Center);A.isReal()||A.setTo(o.actualBounds.centerX,o.actualBounds.centerY);let F=e.getPoint(e.pointsCount-4),O=e.getLinkPointFromPoint(o,a,A,F,!1),E=e.getPoint(e.pointsCount-3);this.direction===90||this.direction===270?(e.setPointAt(e.pointsCount-2,F.x,(E.y+O.y)/2),e.setPointAt(e.pointsCount-3,F.x,(E.y+O.y)/2)):(e.setPointAt(e.pointsCount-2,(E.x+O.x)/2,F.y),e.setPointAt(e.pointsCount-3,(E.x+O.x)/2,F.y));let B=e.getLinkPointFromPoint(o,a,A,e.getPoint(e.pointsCount-2),!1);e.setPointAt(e.pointsCount-1,B.x,B.y)}}e.commitRoute(),i.commit()}}S3(){this.Sw=-1,this.qg=0,this.Vs=0,this.gu=null;for(let t=0;t<this.zn.length;t++)this.zn[t]=null}ja(t){let e,i=this.ie[t];if(i>=this.zn.length){let n=[];for(let o=0;o<this.zn.length;o++)n[o]=this.zn[o];this.zn=n}this.zn[i]===void 0||this.zn[i]===null?e=[]:(e=this.zn[i],this.zn[i]=null);let s=this.gu[t];for(let n=0;n<s.length;n++){let o=s[n];e[o.index]=o}return e}Wa(t,e){this.zn[this.ie[t]]=e}get layerSpacing(){return this.Us}set layerSpacing(t){this.Us!==t&&(m.s(t,"number",Ae,"layerSpacing"),t>=0&&(this.Us=t,this.p()))}get columnSpacing(){return this.ti}set columnSpacing(t){this.ti!==t&&(m.s(t,"number",Ae,"columnSpacing"),t>0&&(this.ti=t,this.p()))}get direction(){return this.P}set direction(t){this.P!==t&&(m.s(t,"number",Ae,"direction"),t===0||t===90||t===180||t===270?(this.P=t,this.p()):m.o("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}get cycleRemoveOption(){return this.hu}set cycleRemoveOption(t){this.hu!==t&&(t===1||t===0||t===2)&&(this.hu=t,this.p())}get layeringOption(){return this.cu}set layeringOption(t){this.cu!==t&&(t===10||t===11||t===12)&&(this.cu=t,this.p())}get initializeOption(){return this.fu}set initializeOption(t){this.fu!==t&&(t===20||t===21||t===22)&&(this.fu=t,this.p())}get iterations(){return this.gc}set iterations(t){this.gc!==t&&t>=0&&(this.gc=t,this.p())}get aggressiveOption(){return this.uu}set aggressiveOption(t){this.uu!==t&&(t===30||t===31||t===32)&&(this.uu=t,this.p())}get packOption(){return this.hr}set packOption(t){this.hr!==t&&(m.s(t,"number",Ae,"packOption"),t>=0&&t<8&&(this.hr=t,this.p()))}get packIterations(){return this.du}set packIterations(t){this.du=t}get alignOption(){return this.Xn}set alignOption(t){this.Xn!==t&&(m.s(t,"number",Ae,"align"),t>=0&&t<16&&(this.Xn=t,this.p()))}get centered(){return this.qa}set centered(t){this.centered!==t&&(m.s(t,"boolean",Ae,"centered"),this.qa=t,this.p())}get setsPortSpots(){return this.Bn}set setsPortSpots(t){this.Bn!==t&&(m.s(t,"boolean",Ae,"setsPortSpots"),this.Bn=t,this.p())}get maxLayer(){return this._}get maxIndex(){return this.Sw}get maxColumn(){return this.zt}get minIndexLayer(){return this.qg}get maxIndexLayer(){return this.Vs}static CycleDepthFirst=0;static CycleGreedy=1;static CycleFromLayers=2;static LayerOptimalLinkLength=10;static LayerLongestPathSink=11;static LayerLongestPathSource=12;static InitDepthFirstOut=20;static InitDepthFirstIn=21;static InitNaive=22;static AggressiveNone=30;static AggressiveLess=31;static AggressiveMore=32;static PackNone=0;static PackExpand=1;static PackStraighten=2;static PackMedian=4;static PackAll=15;static AlignNone=0;static AlignUpperLeft=1;static AlignUpperRight=2;static AlignLowerLeft=4;static AlignLowerRight=8;static AlignAll=15}class tn extends Ee{constructor(t){super(t)}createVertex(){let t=new si(this);return t.centered=this.layout.centered,t}createEdge(){return new Se(this)}}class si extends Ie{gl;pa;Tt;sP;nP;qa;ii;mu;_n;_k;$k;Zk;mc;Gn;NF;Ja;os;pu;mi;Yn;Lw=null;Aw=null;Tw=null;Dw=null;constructor(t){super(t),this.gl=-1,this.pa=-1,this.Tt=-1,this.sP=NaN,this.nP=null,this.qa=!0,this.ii=!1,this.mu=NaN,this._n=NaN,this._k=0,this.$k=null,this.Zk=null}static AF(t,e){return t.index-e.index}getProperSourceEdges(){if(!this.Tw){let t=[];for(let e of this.So){let i=e;i.valid&&t.push(i)}this.Tw=t}return this.Tw}getProperDestinationEdges(){if(!this.Dw){let t=[];for(let e of this.or){let i=e;i.valid&&t.push(i)}this.Dw=t}return this.Dw}getDestinationEdge(t){let e=this.getProperDestinationEdges();for(let i of e)if(i.toVertex===t)return i;m.o("Unable to find destination edge to given vertex")}getProperSourceVertexes(){if(!this.Lw){let t=[];for(let e of this.So){let i=e;!i.valid||i.fromVertex.layer<=i.toVertex.layer||t.push(i.fromVertex)}t.sort(si.AF),this.Lw=t}return this.Lw}getProperDestinationVertexes(){if(!this.Aw){let t=[];for(let e of this.or){let i=e;!i.valid||i.fromVertex.layer<=i.toVertex.layer||t.push(i.toVertex)}t.sort(si.AF),this.Aw=t}return this.Aw}addSourceEdge(t){super.addSourceEdge(t),this.Lw=null,this.Tw=null}deleteSourceEdge(t){super.deleteSourceEdge(t),this.Lw=null,this.Tw=null}addDestinationEdge(t){super.addDestinationEdge(t),this.Aw=null,this.Dw=null}deleteDestinationEdge(t){super.deleteDestinationEdge(t),this.Aw=null,this.Dw=null}commit(){if(this.centered)super.commit();else{let t=this.node;if(t!==null){let e=this.network.layout;if(!e)return;e.direction===180||e.direction===270?t.moveTo(this.bounds.right-t.actualBounds.width,this.bounds.bottom-t.actualBounds.height):t.moveTo(this.bounds.x,this.bounds.y)}}}get layer(){return this.gl}set layer(t){this.gl=t}get column(){return this.pa}set column(t){this.pa=t}get index(){return this.Tt}set index(t){this.Tt=t}get component(){return this.sP}set component(t){this.sP!==t&&(m.s(t,"number",si,"component"),this.sP=t)}get near(){return this.nP}set near(t){this.nP!==t&&(this.nP=t)}get centered(){return this.qa}set centered(t){this.qa=t}}class Se extends ei{ii;oP;rP;lP;aP;hP;cP;constructor(t){super(t),this.ii=!1,this.oP=!1,this.rP=!1,this.lP=NaN,this.aP=NaN,this.hP=0,this.cP=0}get fromVertex(){return this.is}set fromVertex(t){this.is!==t&&(this.is=t)}get toVertex(){return this.ss}set toVertex(t){this.ss!==t&&(this.ss=t)}get valid(){return this.ii}set valid(t){this.ii!==t&&(m.s(t,"boolean",Se,"valid"),this.ii=t)}get rev(){return this.oP}set rev(t){this.oP!==t&&(m.s(t,"boolean",Se,"rev"),this.oP=t)}get forest(){return this.rP}set forest(t){this.rP!==t&&(m.s(t,"boolean",Se,"forest"),this.rP=t)}get portFromPos(){return this.lP}set portFromPos(t){this.lP!==t&&(m.s(t,"number",Se,"portFromPos"),this.lP=t)}get portToPos(){return this.aP}set portToPos(t){this.aP!==t&&(m.s(t,"number",Se,"portToPos"),this.aP=t)}get portFromColOffset(){return this.hP}set portFromColOffset(t){this.hP!==t&&(m.s(t,"number",Se,"portFromColOffset"),this.hP=t)}get portToColOffset(){return this.cP}set portToColOffset(t){this.cP!==t&&(m.s(t,"number",Se,"portToColOffset"),this.cP=t)}}var hs=(x=>(x[x.Default=0]="Default",x[x.Destination=1]="Destination",x[x.Source=2]="Source",x))(hs||{}),ls=(x=>(x[x.Forwards=10]="Forwards",x[x.Reverse=11]="Reverse",x[x.Ascending=12]="Ascending",x[x.Descending=13]="Descending",x))(ls||{}),us=(x=>(x[x.CenterSubtrees=20]="CenterSubtrees",x[x.CenterChildren=21]="CenterChildren",x[x.Start=22]="Start",x[x.End=23]="End",x[x.Bus=24]="Bus",x[x.BusBranching=25]="BusBranching",x[x.TopLeftBus=26]="TopLeftBus",x[x.BottomRightBus=27]="BottomRightBus",x[x.Custom=28]="Custom",x))(us||{}),cs=(x=>(x[x.None=30]="None",x[x.Block=31]="Block",x))(cs||{}),ds=(x=>(x[x.Layered=40]="Layered",x[x.LastParents=41]="LastParents",x[x.Alternating=42]="Alternating",x[x.RootOnly=43]="RootOnly",x))(ds||{}),fs=(x=>(x[x.Vertical=50]="Vertical",x[x.Horizontal=51]="Horizontal",x[x.FixedRoots=52]="FixedRoots",x))(fs||{}),en=(x=>(x[x.Individual=60]="Individual",x[x.Siblings=61]="Siblings",x[x.Uniform=62]="Uniform",x))(en||{});class zt extends _t{Ie;Fe;yu;$g;xL;zi;He;Es;V;B;fP;ws;constructor(t){super(),this.Ie=new V,this.Fe=0,this.ws=1,this.yu=40,this.$g=60,this.xL=[],this.zi=!0,this.He=50,this.Es=new st(10,10).k();let e=new gs(this);this.V=new Rt(e),this.B=new Rt(e),this.fP=[],t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Fe=this.Fe,t.yu=this.yu,t.$g=this.$g,t.zi=this.zi,t.He=this.He,t.Es.h(this.Es),t.V.copyInheritedPropertiesFrom(this.V),t.B.copyInheritedPropertiesFrom(this.B)}fe(t){t in us?this.alignment=t:t in fs?this.arrangement=t:t in cs?this.compaction=t:t in hs?this.path=t:t in ls?this.sorting=t:t in ds?this.treeStyle=t:super.fe(t)}createNetwork(){return new gs(this)}makeNetwork(t){let e=this.createNetwork(),i=s=>{if(s instanceof J)return!s.isLinkLabel&&s.category!=="Comment";if(s instanceof j){let n=s.fromNode;if(n===null||n.isLinkLabel||n.category==="Comment")return!1;let o=s.toNode;return!(o===null||o.isLinkLabel||o.category==="Comment")}return!1};return t instanceof Y?(e.addParts(t.nodes,!0,i),e.addParts(t.links,!0,i)):t instanceof ht?e.addParts(t.memberParts,!1,i):e.addParts(t.iterator,!1,i),e}doLayout(t){this.network===null&&(this.network=this.makeNetwork(t)),this.arrangement!==52&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));let e=this.diagram;e===null&&t instanceof Y&&(e=t),this.path===0&&e!==null?this.ws=e.isTreePathToChildren?1:2:this.ws=this.path===0?1:this.path,this.network.vertexes.count>0&&(this.oU(),this.rU(),this.lU(),this.aU(),this.dL(),this.hU(),this.arrangeTrees(),this.updateParts()),this.network=null,this.Ie=new V,this.isValidLayout=!0}oU(){if(this.network===null)return;this.network.deleteSelfEdges();let t=this.network.vertexes.iterator;for(;t.next();){let n=t.value;n.initialized=!1,n.level=0,n.parent=null,n.children=[]}if(this.Ie.count>0){let n=new V,o=this.Ie.iterator;for(;o.next();){let r=o.value;if(r instanceof J){let a=this.network.findVertex(r);a!==null&&n.add(a)}else r instanceof Rt&&n.add(r)}this.Ie=n}this.Ie.count===0&&this.findRoots();let e=this.Ie.copy().iterator;for(;e.next();){let n=e.value;n.initialized||(n.initialized=!0,this.bL(n))}let i=this.network.vertexes,s=null;for(;s=this.cU(i),s.count>0;){let n=this.TF(s);n!==null&&(this.Ie.add(n),n.initialized=!0,this.bL(n)),i=s}}cU(t){let e=new V,i=t.iterator;for(;i.next();){let s=i.value;s.initialized||e.add(s)}return e}findRoots(){if(this.network===null)return;let t=this.network.vertexes,e=t.iterator;for(;e.next();){let i=e.value;switch(this.ws){case 1:i.sourceEdges.count===0&&this.Ie.add(i);break;case 2:i.destinationEdges.count===0&&this.Ie.add(i);break;default:m.o("Unhandled path value "+this.ws.toString())}}if(this.Ie.count===0){let i=this.TF(t);i!==null&&this.Ie.add(i)}}TF(t){let e=999999,i=null,s=t.iterator;for(;s.next();){let n=s.value;switch(this.ws){case 1:n.sourceEdges.count<e&&(e=n.sourceEdges.count,i=n);break;case 2:n.destinationEdges.count<e&&(e=n.destinationEdges.count,i=n);break;default:m.o("Unhandled path value "+this.ws.toString())}}return i}bL(t){if(t===null)return;switch(this.ws){case 1:if(t.destinationEdges.count>0){let s=new q,n=t.destinationVertexes;for(;n.next();){let o=n.value;this.DF(t,o)&&s.add(o)}s.count>0&&(t.children=s.toArray())}break;case 2:if(t.sourceEdges.count>0){let s=new q,n=t.sourceVertexes;for(;n.next();){let o=n.value;this.DF(t,o)&&s.add(o)}s.count>0&&(t.children=s.toArray())}break;default:m.o("Unhandled path value"+this.ws.toString())}let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];n.initialized=!0,n.level=t.level+1,n.parent=t,this.Ie.delete(n)}for(let s=0;s<i;s++){let n=e[s];this.bL(n)}}DF(t,e){return e.initialized?this.fU(e,t)||e.level>t.level?!1:(this.uU(e.parent,e),!0):!0}fU(t,e){if(e===null)return!1;let i=e.parent;for(;i!==null&&i!==t;)i=i.parent;return i===t}uU(t,e){if(t===null||e===null)return;let i=t.children,s=0;for(let n=0;n<i.length;n++)i[n]===e&&s++;if(s>0){let n=new Array(i.length-s),o=0;for(let r=0;r<i.length;r++)i[r]!==e&&(n[o++]=i[r]);t.children=n}}rU(){let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.vF(e)}}vF(t){if(t===null)return;this.initializeTreeVertexValues(t),t.alignment===25&&this.sortTreeVertexChildren(t);let e=0,i=t.childrenCount,s=0,n=t.children,o=n.length;for(let r=0;r<o;r++){let a=n[r];this.vF(a),e+=a.descendantCount+1,i=Math.max(i,a.maxChildrenCount),s=Math.max(s,a.maxGenerationCount)}t.descendantCount=e,t.maxChildrenCount=i,t.maxGenerationCount=i>0?s+1:0}dU(t){switch(this.yu){default:case 40:return t.parent!==null?t.parent:this.V;case 43:return t.parent===null?this.V:t.parent.parent===null?this.B:t.parent;case 42:return t.parent!==null?t.parent.parent!==null?t.parent.parent:this.B:this.V;case 41:{let e=!0;if(t.childrenCount===0)e=!1;else{let i=t.children,s=i.length;for(let n=0;n<s;n++)if(i[n].childrenCount>0){e=!1;break}}return e&&t.parent!==null?this.B:t.parent!==null?t.parent:this.V}}}initializeTreeVertexValues(t){let e=this.dU(t);if(t.copyInheritedPropertiesFrom(e),t.parent!==null&&t.parent.alignment===25){let i=t.angle,s=t.parent.children,n=0;for(;n<s.length&&t!==s[n];)n++;n%2===0?n!==s.length-1&&(i===90?i=180:i===180?i=270:i===270?i=180:i=270):i===90?i=0:i===180?i=90:i===270?i=0:i=90,t.angle=i}t.initialized=!0}lU(){let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.FF(e)}}FF(t){if(t===null)return;this.assignTreeVertexValues(t);let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];this.FF(n)}}assignTreeVertexValues(t){}aU(){let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.RF(e)}}RF(t){if(t===null)return;t.alignment!==25&&this.sortTreeVertexChildren(t);let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];this.RF(n)}}sortTreeVertexChildren(t){switch(t.sorting){default:case 10:break;case 11:t.children.reverse();break;case 12:t.children.sort(t.comparer);break;case 13:t.children.sort(t.comparer),t.children.reverse();break}}dL(){if(!this.comments||this.network===null)return;let t=this.network.vertexes.iterator;for(;t.next();){let e=t.value;this.addComments(e)}}addComments(t){let e=t.angle,i=t.parent,s=0,n=21,o=!1;i!==null&&(s=i.angle,n=i.alignment,o=this.isBusAlignment(n));let r=e===90||e===270,a=s===90||s===270,h=t.childrenCount===0,l=0,u=0,c=0,d=t.commentSpacing;if(t.node!==null){let f=t.node.findNodesConnected();for(;f.next();){let p=f.value;if(p.category!=="Comment"||!p.canLayout())continue;t.comments===null&&(t.comments=[]),t.comments.push(p),p.ensureBounds();let g=p.measuredBounds;r&&!h||!o&&!a&&h||o&&a&&h?(l=Math.max(l,g.width),u+=g.height+Math.abs(c)):(l+=g.width+Math.abs(c),u=Math.max(u,g.height)),c=d}}if(t.comments!==null){r&&!h||!o&&!a&&h||o&&a&&h?(l+=Math.abs(t.commentMargin),u=Math.max(0,u-t.height)):(u+=Math.abs(t.commentMargin),l=Math.max(0,l-t.width));let f=I.z(0,0,t.bounds.width+l,t.bounds.height+u);t.bounds=f,I.i(f)}}isBusAlignment(t){return t===24||t===25||t===26||t===27}vw(t){return t===24||t===25}kL(t){let e=t.parent;if(e!==null){let i=e.alignment;if(this.isBusAlignment(i))if(this.vw(i)){let s=e.children,n=0;for(;n<s.length&&t!==s[n];)n++;return n%2===0}else return i===26}return!1}layoutComments(t){if(t.comments!==null){let e=t.node.measuredBounds,i=t.parent,s=t.angle,n=0,o=21,r=!1;i!==null&&(n=i.angle,o=i.alignment,r=this.isBusAlignment(o));let a=s===90||s===270,h=n===90||n===270,l=t.childrenCount===0,u=this.kL(t),c=0,d=t.comments,f=d.length,p=P.l();for(let y=0;y<f;y++){let b=d[y],v=b.measuredBounds;if(a&&!l||!r&&!h&&l||r&&h&&l){if(n>135&&!r||h&&u)if(t.commentMargin>=0){p.e(t.bounds.x-t.commentMargin-v.width,t.bounds.y+c),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleLeft,k.toSpot=T.MiddleRight}}else{p.e(t.bounds.x+t.focus.x*2-t.commentMargin,t.bounds.y+c),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleRight,k.toSpot=T.MiddleLeft}}else if(t.commentMargin>=0){p.e(t.bounds.x+t.focus.x*2+t.commentMargin,t.bounds.y+c),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleRight,k.toSpot=T.MiddleLeft}}else{p.e(t.bounds.x+t.commentMargin-v.width,t.bounds.y+c),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleLeft,k.toSpot=T.MiddleRight}}t.commentSpacing>=0?c+=v.height+t.commentSpacing:c+=t.commentSpacing-v.height}else{if(n>135&&!r||!h&&u)if(t.commentMargin>=0){p.e(t.bounds.x+c,t.bounds.y-t.commentMargin-v.height),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleTop,k.toSpot=T.MiddleBottom}}else{p.e(t.bounds.x+c,t.bounds.y+t.focus.y*2-t.commentMargin),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleBottom,k.toSpot=T.MiddleTop}}else if(t.commentMargin>=0){p.e(t.bounds.x+c,t.bounds.y+t.focus.y*2+t.commentMargin),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleBottom,k.toSpot=T.MiddleTop}}else{p.e(t.bounds.x+c,t.bounds.y+t.commentMargin-v.height),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleTop,k.toSpot=T.MiddleBottom}}t.commentSpacing>=0?c+=v.width+t.commentSpacing:c+=t.commentSpacing-v.width}}P.i(p);let g=c-t.commentSpacing-(a?e.height:e.width);if(this.ws===1){let y=t.destinationEdges;for(;y.next();){let b=y.value.link;b!==null&&!b.isAvoiding&&(b.fromEndSegmentLength=g>0?g:NaN)}}else{let y=t.sourceEdges;for(;y.next();){let b=y.value.link;b!==null&&!b.isAvoiding&&(b.toEndSegmentLength=g>0?g:NaN)}}}}hU(){if(this.network===null)return;if(this.layerStyle===62){let e=[],i=this.network.vertexes.iterator;for(;i.next();){let s=i.value,n=s.parent;n===null&&(n=s);let o=n.angle===0||n.angle===180,r=e[s.level];r===void 0&&(r=0),e[s.level]=Math.max(r,o?s.width:s.height)}for(let s=0;s<e.length;s++)e[s]===void 0&&(e[s]=0);for(this.xL=e,i=this.network.vertexes.iterator;i.next();){let s=i.value,n=s.parent;n===null&&(n=s),n.angle===0||n.angle===180?(n.angle===180&&(s.focusX+=e[s.level]-s.width),s.width=e[s.level]):(n.angle===270&&(s.focusY+=e[s.level]-s.height),s.height=e[s.level])}}else if(this.layerStyle===61){let e=this.network.vertexes.iterator;for(;e.next();){let i=e.value,s=i.angle===0||i.angle===180,n=-1;for(let o=0;o<i.children.length;o++){let r=i.children[o];n=Math.max(n,s?r.width:r.height)}if(n>=0)for(let o=0;o<i.children.length;o++){let r=i.children[o];s?(i.angle===180&&(r.focusX+=n-r.width),r.width=n):(i.angle===270&&(r.focusY+=n-r.height),r.height=n)}}}let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.layoutTree(e)}}layoutTree(t){if(t===null)return;let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];this.layoutTree(n)}switch(t.compaction){case 30:this.OF(t);break;default:case 31:t.alignment===25?this.OF(t):this.gU(t);break}}OF(t){if(t.childrenCount===0){let K=!1,z=0,U=21;t.parent!==null&&(z=t.parent.angle,U=t.parent.alignment,K=this.isBusAlignment(U));let tt=this.kL(t);t.U.e(0,0),t.dt.e(t.width,t.height),t.parent!==null&&t.comments!==null&&((z===180||z===270)&&!K||tt)?z===180&&!K||(z===90||z===270)&&tt?t.at.e(t.width-t.focus.x*2,0):t.at.e(0,t.height-t.focus.y*2):t.at.e(0,0);return}let e=this.orthoAngle(t),i=e===90||e===270,s=0,n=t.children,o=n.length;for(let K=0;K<o;K++){let z=n[K];s=Math.max(s,i?z.dt.width:z.dt.height)}let r=t.alignment,a=r===22,h=r===23,l=this.isBusAlignment(r),u=Math.max(0,t.breadthLimit),c=this.computeLayerSpacing(t),d=t.nodeSpacing,f=this.computeNodeIndent(t),p=a||h?0:f/2,g=t.rowSpacing,y=0;(a||h)&&(y=Math.max(0,t.rowIndent));let b=t.width,v=t.height,w=0,k=0,S=0,N=0,D=0,L=0,M=0,A=0,F=0,O=0;if(l&&!this.vw(r)&&e>135&&n.reverse(),this.vw(r))if(o>1)for(let K=0;K<o;K++){let z=n[K],U=z.dt;K%2===0&&K!==o-1?F=Math.max(F,(i?U.width:U.height)+this.computeBusNodeSpacing(z)-d):K%2!==0&&(O=Math.max(O,(i?U.width:U.height)+this.computeBusNodeSpacing(z)-d))}else o===1&&(F=i?n[0].dt.width:n[0].dt.height);if(l)switch(r){case 24:case 25:let K=I.l();e<135?this.IF(t,n,F,O,w,k,K):this.EF(t,n,F,O,w,k,K),F=K.x,w=K.width,k=K.height,I.i(K);break;case 26:for(let z=0;z<o;z++){let U=n[z],tt=U.dt,nt=M===0?0:g;i?(U.U.e(s-tt.width,D+nt),w=Math.max(w,tt.width),k=Math.max(k,D+nt+tt.height),D+=nt+tt.height):(U.U.e(N+nt,s-tt.height),w=Math.max(w,N+nt+tt.width),k=Math.max(k,tt.height),N+=nt+tt.width),M++}break;case 27:for(let z=0;z<o;z++){let U=n[z],tt=U.dt,nt=M===0?0:g;i?(U.U.e(d/2+t.focus.x,D+nt),w=Math.max(w,tt.width),k=Math.max(k,D+nt+tt.height),D+=nt+tt.height):(U.U.e(N+nt,d/2+t.focus.y),w=Math.max(w,N+nt+tt.width),k=Math.max(k,tt.height),N+=nt+tt.width),M++}break}else for(let K=0;K<o;K++){let z=n[K],U=z.dt;if(i){u>0&&M>0&&N+d+U.width>u&&(N<s&&this.pc(t,r,s-N,0,A,K-1),L++,M=0,A=K,S=k,N=0,D=e>135?-k-g:k+g);let tt=M===0?p:d;this.uP(z,0,D),z.U.e(N+tt,D),w=Math.max(w,N+tt+U.width),k=Math.max(k,S+(L===0?0:g)+U.height),N+=tt+U.width}else{u>0&&M>0&&D+d+U.height>u&&(D<s&&this.pc(t,r,0,s-D,A,K-1),L++,M=0,A=K,S=w,D=0,N=e>135?-w-g:w+g);let tt=M===0?p:d;this.uP(z,N,0),z.U.e(N,D+tt),k=Math.max(k,D+tt+U.height),w=Math.max(w,S+(L===0?0:g)+U.width),D+=tt+U.height}M++}L>0&&(i?(k+=Math.max(0,c),N<w&&this.pc(t,r,w-N,0,A,o-1),y>0&&(h||this.wu(t,y,0,0,o-1),w+=y)):(w+=Math.max(0,c),D<k&&this.pc(t,r,0,k-D,A,o-1),y>0&&(h||this.wu(t,0,y,0,o-1),k+=y)));let E=0,B=0;switch(r){case 20:i?E+=w/2-t.focus.x-f/2:B+=k/2-t.focus.y-f/2;break;default:case 21:if(L>0)i?E+=w/2-t.focus.x-f/2:B+=k/2-t.focus.y-f/2;else{let z=o;if(i){let U=n[0].U.x+n[0].at.x,tt=n[z-1].U.x+n[z-1].at.x+n[z-1].focus.x*2;E+=U+(tt-U)/2-t.focus.x-f/2}else{let U=n[0].U.y+n[0].at.y,tt=n[z-1].U.y+n[z-1].at.y+n[z-1].focus.y*2;B+=U+(tt-U)/2-t.focus.y-f/2}}break;case 22:i?(E-=f,w+=f):(B-=f,k+=f);break;case 23:i?(E+=w-t.width+f,w+=f):(B+=k-t.height+f,k+=f);break;case 24:case 25:i?o>1?E+=F+d/2-t.focus.x:E+=n[0].focus.x-t.focus.x+n[0].at.x:o>1?B+=F+d/2-t.focus.y:B+=n[0].focus.y-t.focus.y+n[0].at.y;break;case 26:i?E+=w+d/2-t.focus.x:B+=k+d/2-t.focus.y;break;case 27:break;case 28:let K=this.customAlignment(t,E,B,w,k);E=K[0],B=K[1],w=K[2],k=K[3];break}for(let K=0;K<o;K++){let z=n[K];i?z.U.e(z.U.x+z.at.x-E,z.U.y+(e>135?(l?-k:-z.dt.height)+z.at.y-c:v+c+z.at.y)):z.U.e(z.U.x+(e>135?(l?-w:-z.dt.width)+z.at.x-c:b+c+z.at.x),z.U.y+z.at.y-B)}i?(w=this.PL(t,w,E),E<0&&(E=0),e>135&&(B+=k+c),k=Math.max(Math.max(k,v),k+v+c)):(e>135&&(E+=w+c),w=Math.max(Math.max(w,b),w+b+c),k=this.SL(t,k,B),B<0&&(B=0)),t.at.e(E,B),t.dt.e(w,k)}customAlignment(t,e,i,s,n){return[e,i,s,n]}IF(t,e,i,s,n,o,r){let a=e.length;if(a===0)return r.e(i,0,n,o),r;if(a===1){let y=e[0];return n=y.dt.width,o=y.dt.height,r.e(i,0,n,o),r}let h=t.nodeSpacing,l=t.rowSpacing,u=this.orthoAngle(t)===90,c=0,d=0,f=0;for(let y=0;y<a;y++){if(y%2!==0||a>1&&y===a-1)continue;let b=e[y],v=b.dt,w=c===0?0:l;if(u){let k=this.computeBusNodeSpacing(b)-h;b.U.e(i-(v.width+k),f+w),n=Math.max(n,v.width+k),o=Math.max(o,f+w+v.height),f+=w+v.height}else{let k=this.computeBusNodeSpacing(b)-h;b.U.e(d+w,i-(v.height+k)),o=Math.max(o,v.height+k),n=Math.max(n,d+w+v.width),d+=w+v.width}c++}c=0;let p=d,g=f;u?(d=i+h,f=0):(d=0,f=i+h);for(let y=0;y<a;y++){if(y%2===0)continue;let b=e[y],v=b.dt,w=c===0?0:l;if(u){let k=this.computeBusNodeSpacing(b)-h;b.U.e(d+k,f+w),n=Math.max(n,d+v.width+k),o=Math.max(o,f+w+v.height),f+=w+v.height}else{let k=this.computeBusNodeSpacing(b)-h;b.U.e(d+w,f+k),n=Math.max(n,d+w+v.width),o=Math.max(o,f+v.height+k),d+=w+v.width}c++}if(a>1&&a%2===1){let y=e[a-1],b=y.dt,v=this.computeBusLastRowSpacing(y,u?Math.max(Math.abs(g),Math.abs(f)):Math.max(Math.abs(p),Math.abs(d)));if(u){y.U.e(i+h/2-y.focus.x-y.at.x,o+v);let w=i+h/2-y.focus.x-y.at.x;n=Math.max(n,w+b.width),w<0&&(n-=w),o=Math.max(o,Math.max(g,f)+v+b.height),y.U.x<0&&(i=this.dP(t,y.U.x,!1,i,h))}else{y.U.e(n+v,i+h/2-y.focus.y-y.at.y),n=Math.max(n,Math.max(p,d)+v+b.width);let w=i+h/2-y.focus.y-y.at.y;o=Math.max(o,w+b.height),w<0&&(o-=w),y.U.y<0&&(i=this.dP(t,y.U.y,!0,i,h))}}return r.e(i,0,n,o),r}EF(t,e,i,s,n,o,r){let a=e.length;if(a===0)return r.e(i,0,n,o),r;if(a===1){let y=e[0];return n=y.dt.width,o=y.dt.height,r.e(i,0,n,o),r}let h=t.nodeSpacing,l=t.rowSpacing,u=this.orthoAngle(t)===270,c=0,d=0,f=0;for(let y=0;y<a;y++){if(y%2!==0||a>1&&y===a-1)continue;let b=e[y],v=b.dt,w=c===0?0:l;if(u){let k=this.computeBusNodeSpacing(b)-h;f-=w+v.height,b.U.e(i-(v.width+k),f),n=Math.max(n,v.width+k),o=Math.max(o,Math.abs(f))}else{let k=this.computeBusNodeSpacing(b)-h;d-=w+v.width,b.U.e(d,i-(v.height+k)),o=Math.max(o,v.height+k),n=Math.max(n,Math.abs(d))}c++}c=0;let p=d,g=f;u?(d=i+h,f=0):(d=0,f=i+h);for(let y=0;y<a;y++){if(y%2===0)continue;let b=e[y],v=b.dt,w=c===0?0:l;if(u){let k=this.computeBusNodeSpacing(b)-h;f-=w+v.height,b.U.e(d+k,f),n=Math.max(n,d+v.width+k),o=Math.max(o,Math.abs(f))}else{let k=this.computeBusNodeSpacing(b)-h;d-=w+v.width,b.U.e(d,f+k),o=Math.max(o,f+v.height+k),n=Math.max(n,Math.abs(d))}c++}if(a>1&&a%2===1){let y=e[a-1],b=y.dt,v=this.computeBusLastRowSpacing(y,u?Math.max(Math.abs(g),Math.abs(f)):Math.max(Math.abs(p),Math.abs(d)));if(u){y.U.e(i+h/2-y.focus.x-y.at.x,-o-b.height-v);let w=i+h/2-y.focus.x-y.at.x;n=Math.max(n,w+b.width),w<0&&(n-=w),o=Math.max(o,Math.abs(Math.min(g,f))+v+b.height),y.U.x<0&&(i=this.dP(t,y.U.x,!1,i,h))}else{y.U.e(-n-b.width-v,i+h/2-y.focus.y-y.at.y),n=Math.max(n,Math.abs(Math.min(p,d))+v+b.width);let w=i+h/2-y.focus.y-y.at.y;o=Math.max(o,w+b.height),w<0&&(o-=w),y.U.y<0&&(i=this.dP(t,y.U.y,!0,i,h))}}for(let y=0;y<a;y++){let b=e[y];u?b.U.e(b.U.x,b.U.y+o):b.U.e(b.U.x+n,b.U.y)}return r.e(i,0,n,o),r}computeBusNodeSpacing(t){return t.parent===null?0:t.parent.nodeSpacing}computeBusLastRowSpacing(t,e){return t.parent===null?0:t.parent.rowSpacing}dP(t,e,i,s,n){let o=t.children,r=o.length;for(let h=0;h<r;h++)i?o[h].U.e(o[h].U.x,o[h].U.y-e):o[h].U.e(o[h].U.x-e,o[h].U.y);let a=o[r-1];return Math.max(s,i?a.at.y+a.focus.y-n/2:a.at.x+a.focus.x-n/2)}PL(t,e,i){switch(t.alignment){case 21:case 20:let s=e;return i+t.width>s&&(s=i+t.width),i<0&&(s-=i),s;case 22:return t.width>e?t.width:e;case 23:return t.focus.x*2>e?t.width:e+t.width-t.focus.x*2;case 24:case 25:let n=Math.min(0,i),o=Math.max(e,i+t.width);return Math.max(t.width,o-n);case 26:return t.width-t.focus.x+t.nodeSpacing/2+e;case 27:return Math.max(t.width,t.focus.x+t.nodeSpacing/2+e);default:return e}}SL(t,e,i){switch(t.alignment){case 21:case 20:let s=e;return i+t.height>s&&(s=i+t.height),i<0&&(s-=i),s;case 22:return t.height>e?t.height:e;case 23:return t.focus.y*2>e?t.height:e+t.height-t.focus.y*2;case 24:case 25:let n=Math.min(0,i),o=Math.max(e,i+t.height);return Math.max(t.height,o-n);case 26:return t.height-t.focus.y+t.nodeSpacing/2+e;case 27:return Math.max(t.height,t.focus.y+t.nodeSpacing/2+e);default:return e}}ML(t,e,i){switch(t){case 20:e/=2,i/=2;break;case 21:e/=2,i/=2;break;case 22:e=0,i=0;break;case 23:break;default:m.o("Unhandled alignment value "+t.toString())}return new P(e,i)}pc(t,e,i,s,n,o){let r=this.ML(e,i,s);this.wu(t,r.x,r.y,n,o)}wu(t,e,i,s,n){if(e===0&&i===0)return;let o=t.children;for(let r=s;r<=n;r++){let a=o[r].U;a.x+=e,a.y+=i}}uP(t,e,i){let s=t.parent;switch(this.ws){case 1:{let n=t.sourceEdges;for(;n.next();){let o=n.value;o.fromVertex===s&&o.relativePoint.e(e,i)}break}case 2:{let n=t.destinationEdges;for(;n.next();){let o=n.value;o.toVertex===s&&o.relativePoint.e(e,i)}break}default:m.o("Unhandled path value "+this.ws.toString())}}gU(t){if(t.childrenCount===0){let _=t.parent,at=!1,ct=0,xt=21;_!==null&&(ct=_.angle,xt=_.alignment,at=this.isBusAlignment(xt));let Ct=this.kL(t);t.U.e(0,0),t.dt.e(t.width,t.height),t.parent!==null&&t.comments!==null&&((ct===180||ct===270)&&!at||Ct)?ct===180&&!at||(ct===90||ct===270)&&Ct?t.at.e(t.width-t.focus.x*2,0):t.at.e(0,t.height-t.focus.y*2):t.at.e(0,0),t.Zg=null,t.Qg=null;return}let e=this.orthoAngle(t),i=e===90||e===270,s=0,n=t.children,o=n.length;for(let _=0;_<o;_++){let at=n[_];s=Math.max(s,i?at.dt.width:at.dt.height)}let r=t.alignment,a=r===22,h=r===23,l=this.isBusAlignment(r),u=Math.max(0,t.breadthLimit),c=this.computeLayerSpacing(t),d=t.nodeSpacing,f=this.computeNodeIndent(t),p=t.rowSpacing,g=0;(a||h)&&(g=Math.max(0,t.rowIndent));let y=t.width,b=t.height,v=0,w=0,k=0,S=null,N=null,D=0,L=0,M=0,A=0,F=0,O=0,E=0,B=0,K=0;if(l&&!this.vw(r)&&e>135&&n.reverse(),this.vw(r))if(o>1)for(let _=0;_<o;_++)_%2===0&&_!==o-1?B=Math.max(B,i?n[_].dt.width:n[_].dt.height):_%2!==0&&(K=Math.max(K,i?n[_].dt.width:n[_].dt.height));else o===1&&(B=i?n[0].dt.width:n[0].dt.height);if(l){switch(r){case 24:let _=I.l();e<135?this.IF(t,n,B,K,v,w,_):this.EF(t,n,B,K,v,w,_),B=_.x,v=_.width,w=_.height,I.i(_);break;case 26:for(let at=0;at<o;at++){let ct=n[at],xt=ct.dt,Ct=O===0?0:p;i?(ct.U.e(s-xt.width,A+Ct),v=Math.max(v,xt.width),w=Math.max(w,A+Ct+xt.height),A+=Ct+xt.height):(ct.U.e(M+Ct,s-xt.height),v=Math.max(v,M+Ct+xt.width),w=Math.max(w,xt.height),M+=Ct+xt.width),O++}break;case 27:for(let at=0;at<o;at++){let ct=n[at],xt=ct.dt,Ct=O===0?0:p;i?(ct.U.e(d/2+t.focus.x,A+Ct),v=Math.max(v,xt.width),w=Math.max(w,A+Ct+xt.height),A+=Ct+xt.height):(ct.U.e(M+Ct,d/2+t.focus.y),v=Math.max(v,M+Ct+xt.width),w=Math.max(w,xt.height),M+=Ct+xt.width),O++}break}S=this.pi(2),N=this.pi(2),i?(S[0].e(0,0),S[1].e(0,w),N[0].e(v,0),N[1].e(v,w)):(S[0].e(0,0),S[1].e(v,0),N[0].e(0,w),N[1].e(v,w))}else for(let _=0;_<o;_++){let at=n[_],ct=at.dt;if(i){u>0&&O>0&&M+d+ct.width>u&&(M<s&&this.pc(t,r,s-M,0,E,_-1),F++,O=0,E=_,k=w,M=0,A=e>135?-w-p:w+p),this.uP(at,0,A);let xt=0;if(O===0)S=at.Zg,N=at.Qg,D=ct.width,L=ct.height,(S===null||N===null||e!==this.orthoAngle(at))&&(S=this.pi(2),N=this.pi(2),S[0].e(0,0),S[1].e(0,L),N[0].e(D,0),N[1].e(D,L));else{let Ct=m.nt(),Q=I.l();this.UF(t,at,S,N,D,L,Ct,Q),xt=Q.x,S=Ct[0],N=Ct[1],D=Q.width,L=Q.height,m.Z(Ct),M<ct.width&&xt<0&&(this.wu(t,-xt,0,E,_-1),this.gP(S,-xt,0),this.gP(N,-xt,0),xt=0),I.i(Q)}at.U.e(xt,A),v=Math.max(v,D),w=Math.max(w,k+(F===0?0:p)+ct.height),M=D}else{u>0&&O>0&&A+d+ct.height>u&&(A<s&&this.pc(t,r,0,s-A,E,_-1),F++,O=0,E=_,k=v,A=0,M=e>135?-v-p:v+p),this.uP(at,M,0);let xt=0;if(O===0)S=at.Zg,N=at.Qg,D=ct.width,L=ct.height,(S===null||N===null||e!==this.orthoAngle(at))&&(S=this.pi(2),N=this.pi(2),S[0].e(0,0),S[1].e(D,0),N[0].e(0,L),N[1].e(D,L));else{let Ct=m.nt(),Q=I.l();this.UF(t,at,S,N,D,L,Ct,Q),xt=Q.x,S=Ct[0],N=Ct[1],D=Q.width,L=Q.height,m.Z(Ct),A<ct.height&&xt<0&&(this.wu(t,0,-xt,E,_-1),this.gP(S,0,-xt),this.gP(N,0,-xt),xt=0),I.i(Q)}at.U.e(M,xt),w=Math.max(w,L),v=Math.max(v,k+(F===0?0:p)+ct.width),A=L}O++}F>0&&(i?(w+=Math.max(0,c),M<v&&this.pc(t,r,v-M,0,E,o-1),g>0&&(h||this.wu(t,g,0,0,o-1),v+=g)):(v+=Math.max(0,c),A<w&&this.pc(t,r,0,w-A,E,o-1),g>0&&(h||this.wu(t,0,g,0,o-1),w+=g)));let z=0,U=0;switch(r){case 20:i?z+=v/2-t.focus.x-f/2:U+=w/2-t.focus.y-f/2;break;default:case 21:if(F>0)i?z+=v/2-t.focus.x-f/2:U+=w/2-t.focus.y-f/2;else{let at=o;if(i){let ct=n[0].U.x+n[0].at.x,xt=n[at-1].U.x+n[at-1].at.x+n[at-1].focus.x*2;z+=ct+(xt-ct)/2-t.focus.x-f/2}else{let ct=n[0].U.y+n[0].at.y,xt=n[at-1].U.y+n[at-1].at.y+n[at-1].focus.y*2;U+=ct+(xt-ct)/2-t.focus.y-f/2}}break;case 22:i?(z-=f,v+=f):(U-=f,w+=f);break;case 23:i?(z+=v-t.width+f,v+=f):(U+=w-t.height+f,w+=f);break;case 24:i?o>1?z+=B+d/2-t.focus.x:z+=n[0].focus.x-t.focus.x+n[0].at.x:o>1?U+=B+d/2-t.focus.y:U+=n[0].focus.y-t.focus.y+n[0].at.y;break;case 26:i?z+=v+d/2-t.focus.x:U+=w+d/2-t.focus.y;break;case 27:break;case 28:let _=this.customAlignment(t,z,U,v,w);z=_[0],U=_[1],v=_[2],w=_[3];break}for(let _=0;_<o;_++){let at=n[_];i?at.U.e(at.U.x+at.at.x-z,at.U.y+(e>135?(l?-w:-at.dt.height)+at.at.y-c:b+c+at.at.y)):at.U.e(at.U.x+(e>135?(l?-v:-at.dt.width)+at.at.x-c:y+c+at.at.x),at.U.y+at.at.y-U)}let tt=0,nt=0;if(l)i?(v=this.PL(t,v,z),z<0&&(z=0),e>135&&(U+=w+c),w+=b+c,r===27&&(tt+=d/2+t.focus.x),nt+=b+c):(e>135&&(z+=v+c),v+=y+c,w=this.SL(t,w,U),U<0&&(U=0),r===27&&(nt+=d/2+t.focus.y),tt+=y+c);else if(i){if(t.comments===null){if(y>v){let _=this.ML(r,y-v,0);tt=_.x,nt=_.y,v=y,z=0}}else v=this.PL(t,v,z);z<0&&(tt-=z,z=0),e>135&&(U+=w+c),w=Math.max(Math.max(w,b),w+b+c),nt+=b+c}else{if(e>135&&(z+=v+c),v=Math.max(Math.max(v,y),v+y+c),t.comments===null){if(b>w){let _=this.ML(r,0,b-w);tt=_.x,nt=_.y,w=b,U=0}}else w=this.SL(t,w,U);U<0&&(nt-=U,U=0),tt+=y+c}let Z,it;if(F>0)Z=this.pi(4),it=this.pi(4),i?(Z[2].e(0,b+c),Z[3].e(Z[2].x,w),it[2].e(v,Z[2].y),it[3].e(it[2].x,Z[3].y)):(Z[2].e(y+c,0),Z[3].e(v,Z[2].y),it[2].e(Z[2].x,w),it[3].e(Z[3].x,it[2].y));else{Z=this.pi(S.length+2),it=this.pi(N.length+2);for(let _=0;_<S.length;_++){let at=S[_];Z[_+2].e(at.x+tt,at.y+nt)}for(let _=0;_<N.length;_++){let at=N[_];it[_+2].e(at.x+tt,at.y+nt)}}i?(Z[0].e(z,0),Z[1].e(Z[0].x,b),Z[2].y<Z[1].y&&(Z[2].x>Z[0].x?Z[2].h(Z[1]):Z[1].h(Z[2])),Z[3].y<Z[2].y&&(Z[3].x>Z[0].x?Z[3].h(Z[2]):Z[2].h(Z[3])),it[0].e(z+y,0),it[1].e(it[0].x,b),it[2].y<it[1].y&&(it[2].x<it[0].x?it[2].h(it[1]):it[1].h(it[2])),it[3].y<it[2].y&&(it[3].x<it[0].x?it[3].h(it[2]):it[2].h(it[3])),Z[2].y-=c/2,it[2].y-=c/2):(Z[0].e(0,U),Z[1].e(y,Z[0].y),Z[2].x<Z[1].x&&(Z[2].y>Z[0].y?Z[2].h(Z[1]):Z[1].h(Z[2])),Z[3].x<Z[2].x&&(Z[3].y>Z[0].y?Z[3].h(Z[2]):Z[2].h(Z[3])),it[0].e(0,U+b),it[1].e(y,it[0].y),it[2].x<it[1].x&&(it[2].y<it[0].y?it[2].h(it[1]):it[1].h(it[2])),it[3].x<it[2].x&&(it[3].y<it[0].y?it[3].h(it[2]):it[2].h(it[3])),Z[2].x-=c/2,it[2].x-=c/2),this.fn(S),this.fn(N),t.Zg=Z,t.Qg=it,t.at.e(z,U),t.dt.e(v,w)}gP(t,e,i){for(let s=0;s<t.length;s++){let n=t[s];n.x+=e,n.y+=i}}UF(t,e,i,s,n,o,r,a){let h=this.orthoAngle(t),l=h===90||h===270,u=t.nodeSpacing,c=i,d=s,f=n,p=o,g=e.Zg,y=e.Qg,b=e.dt,v=l?Math.max(p,b.height):Math.max(f,b.width);if((g===null||h!==this.orthoAngle(e))&&(g=this.pi(2),y=this.pi(2),l?(g[0].e(0,0),g[1].e(0,b.height),y[0].e(b.width,0),y[1].e(y[0].x,g[1].y)):(g[0].e(0,0),g[1].e(b.width,0),y[0].e(0,b.height),y[1].e(g[1].x,y[0].y))),l){let w=f,k=w-this.mU(d,g,w);return k+=u,i=this.pU(c,g,k),s=this.yU(d,y,k),n=Math.max(0,k)+b.width,o=v,this.fn(c),this.fn(g),this.fn(d),this.fn(y),r[0]=i,r[1]=s,a.e(k,0,n,o),a}else{let w=p,k=w-this.wU(d,g,w);return k+=u,i=this.xU(c,g,k),s=this.bU(d,y,k),n=v,o=Math.max(0,k)+b.height,this.fn(c),this.fn(g),this.fn(d),this.fn(y),r[0]=i,r[1]=s,a.e(k,0,n,o),a}}xU(t,e,i){if(t===null||t.length<2||e===null||e.length<2)return null;let s=this.pi(t.length+e.length),n=0,o=0,r=0;for(;o<e.length&&e[o].x<t[0].x;){let l=e[o++];s[r++].e(l.x,l.y+i)}for(;n<t.length;){let l=t[n++];s[r++].e(l.x,l.y)}let a=t[t.length-1].x;for(;o<e.length&&e[o].x<=a;)o++;for(;o<e.length&&e[o].x>a;){let l=e[o++];s[r++].e(l.x,l.y+i)}let h=this.pi(r);for(n=0;n<r;n++)h[n].h(s[n]);return this.fn(s),h}pU(t,e,i){if(t===null||t.length<2||e===null||e.length<2)return null;let s=this.pi(t.length+e.length),n=0,o=0,r=0;for(;o<e.length&&e[o].y<t[0].y;){let l=e[o++];s[r++].e(l.x+i,l.y)}for(;n<t.length;){let l=t[n++];s[r++].e(l.x,l.y)}let a=t[t.length-1].y;for(;o<e.length&&e[o].y<=a;)o++;for(;o<e.length&&e[o].y>a;){let l=e[o++];s[r++].e(l.x+i,l.y)}let h=this.pi(r);for(n=0;n<r;n++)h[n].h(s[n]);return this.fn(s),h}bU(t,e,i){if(t===null||t.length<2||e===null||e.length<2)return null;let s=this.pi(t.length+e.length),n=0,o=0,r=0;for(;n<t.length&&t[n].x<e[0].x;){let l=t[n++];s[r++].e(l.x,l.y)}for(;o<e.length;){let l=e[o++];s[r++].e(l.x,l.y+i)}let a=e[e.length-1].x;for(;n<t.length&&t[n].x<=a;)n++;for(;n<t.length&&t[n].x>a;){let l=t[n++];s[r++].e(l.x,l.y)}let h=this.pi(r);for(n=0;n<r;n++)h[n].h(s[n]);return this.fn(s),h}yU(t,e,i){if(t===null||t.length<2||e===null||e.length<2)return null;let s=this.pi(t.length+e.length),n=0,o=0,r=0;for(;n<t.length&&t[n].y<e[0].y;){let l=t[n++];s[r++].e(l.x,l.y)}for(;o<e.length;){let l=e[o++];s[r++].e(l.x+i,l.y)}let a=e[e.length-1].y;for(;n<t.length&&t[n].y<=a;)n++;for(;n<t.length&&t[n].y>a;){let l=t[n++];s[r++].e(l.x,l.y)}let h=this.pi(r);for(n=0;n<r;n++)h[n].h(s[n]);return this.fn(s),h}wU(t,e,i){let s=9999999;if(t===null||t.length<2||e===null||e.length<2)return s;let n=0,o=0;for(;n<t.length&&o<e.length;){let r=t[n],a=e[o],h=a.x,l=a.y;l+=i;let u=r;n+1<t.length&&(u=t[n+1]);let c=a,d=c.x,f=c.y;o+1<e.length&&(c=e[o+1],d=c.x,f=c.y,f+=i);let p=s;r.x===h?p=l-r.y:r.x>h&&r.x<d?p=l+(r.x-h)/(d-h)*(f-l)-r.y:h>r.x&&h<u.x&&(p=l-(r.y+(h-r.x)/(u.x-r.x)*(u.y-r.y))),p<s&&(s=p),u.x<=r.x?n++:d<=h?o++:(u.x<=d&&n++,d<=u.x&&o++)}return s}mU(t,e,i){let s=9999999;if(t===null||t.length<2||e===null||e.length<2)return s;let n=0,o=0;for(;n<t.length&&o<e.length;){let r=t[n],a=e[o],h=a.x,l=a.y;h+=i;let u=r;n+1<t.length&&(u=t[n+1]);let c=a,d=c.x,f=c.y;o+1<e.length&&(c=e[o+1],d=c.x,f=c.y,d+=i);let p=s;r.y===l?p=h-r.x:r.y>l&&r.y<f?p=h+(r.y-l)/(f-l)*(d-h)-r.x:l>r.y&&l<u.y&&(p=h-(r.x+(l-r.y)/(u.y-r.y)*(u.x-r.x))),p<s&&(s=p),u.y<=r.y?n++:f<=l?o++:(u.y<=f&&n++,f<=u.y&&o++)}return s}pi(t){let e=this.fP[t];if(e!==void 0){let s=e.pop();if(s!==void 0)return s}let i=[];for(let s=0;s<t;s++)i[s]=new P;return i}fn(t){if(!t)return;let e=t.length,i=this.fP[e];i===void 0&&(i=[],this.fP[e]=i),i.push(t)}arrangeTrees(){if(this.He===52){let t=this.Ie.iterator;for(;t.next();){let e=t.value;if(!(e instanceof Rt))continue;let i=e.node;if(i===null)continue;let s=i.position,n=s.x,o=s.y;isFinite(n)||(n=0),isFinite(o)||(o=0),this.NL(e,n,o)}}else{let t=[],e=this.Ie.iterator;for(;e.next();){let o=e.value;o instanceof Rt&&t.push(o)}switch(this.sorting){default:case 10:break;case 11:t.reverse();break;case 12:t.sort(this.comparer);break;case 13:t.sort(this.comparer),t.reverse();break}let i=this.arrangementOrigin,s=i.x,n=i.y;for(let o=0;o<t.length;o++){let r=t[o];switch(this.NL(r,s+r.at.x,n+r.at.y),this.He){case 50:n+=r.dt.height+this.Es.height;break;default:case 51:s+=r.dt.width+this.Es.width;break}}}}NL(t,e,i){if(t===null)return;t.x=e,t.y=i;let s=t.children,n=s.length;for(let o=0;o<n;o++){let r=s[o];this.NL(r,e+r.U.x,i+r.U.y)}}commitLayout(){this.Pw(),this.commitNodes(),this.wL(),this.isRouting&&this.commitLinks()}commitNodes(){if(this.network===null)return;let t=this.network.vertexes.iterator;for(;t.next();)t.value.commit();for(t.reset();t.next();){let e=t.value;this.layoutComments(e)}}wL(){if(this.network===null||this.layerStyle!==62)return;let t=this.xL,e=[],i,s=this.network.vertexes.iterator;for(;s.next();){let h=s.value;i===void 0?i=h.bounds.copy():i.unionRect(h.bounds);let l=e[h.level];l===void 0?l=this.computeLayerSpacing(h):l=Math.max(l,this.computeLayerSpacing(h)),e[h.level]=l}if(!i)return;for(let h=0;h<e.length;h++)e[h]===void 0&&(e[h]=0);let n;this.angle===90||this.angle===270?(i.inflate(this.nodeSpacing/2,this.layerSpacing),n=new P(-this.nodeSpacing/2,-this.layerSpacing/2)):(i.inflate(this.layerSpacing,this.nodeSpacing/2),n=new P(-this.layerSpacing/2,-this.nodeSpacing/2));let o=[],r=this.angle===90||this.angle===270?i.width:i.height,a=0;if(this.angle===180||this.angle===270)for(let h=0;h<t.length;h++)a+=t[h]+e[h];for(let h=0;h<t.length;h++){let l=t[h]+e[h];this.angle===270?(a-=l,o.push(new I(0,a,r,l))):this.angle===90?(o.push(new I(0,a,r,l)),a+=l):this.angle===180?(a-=l,o.push(new I(a,0,l,r))):(o.push(new I(a,0,l,r)),a+=l)}this.commitLayers(o,n)}commitLayers(t,e){}commitLinks(){if(this.network===null)return;let t=this.network.edges.iterator;for(;t.next();)t.value.commit()}Pw(){let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.VF(e)}}VF(t){if(t===null)return;this.setPortSpots(t);let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];this.VF(n)}}setPortSpots(t){let e=t.alignment;if(this.isBusAlignment(e))this.kU(t,e);else{let i=this.orthoAngle(t);if(this.ws===1){let s=t.destinationEdges;for(;s.next();){let n=s.value.link;if(n!==null){if(t.setsPortSpot)if(t.portSpot.isDefault())switch(i){case 0:n.fromSpot=T.MiddleRight;break;case 90:n.fromSpot=T.MiddleBottom;break;case 180:n.fromSpot=T.MiddleLeft;break;default:n.fromSpot=T.MiddleTop;break}else n.fromSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.isDefault())switch(i){case 0:n.toSpot=T.MiddleLeft;break;case 90:n.toSpot=T.MiddleTop;break;case 180:n.toSpot=T.MiddleRight;break;default:n.toSpot=T.MiddleBottom;break}else n.toSpot=t.childPortSpot}}}else{let s=t.sourceEdges;for(;s.next();){let n=s.value.link;if(n!==null){if(t.setsPortSpot)if(t.portSpot.isDefault())switch(i){case 0:n.toSpot=T.MiddleRight;break;case 90:n.toSpot=T.MiddleBottom;break;case 180:n.toSpot=T.MiddleLeft;break;default:n.toSpot=T.MiddleTop;break}else n.toSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.isDefault())switch(i){case 0:n.fromSpot=T.MiddleLeft;break;case 90:n.fromSpot=T.MiddleTop;break;case 180:n.fromSpot=T.MiddleRight;break;default:n.fromSpot=T.MiddleBottom;break}else n.fromSpot=t.childPortSpot}}}}}kU(t,e){let i=this.ws===1,s=this.orthoAngle(t),n;switch(s){case 0:n=T.MiddleRight;break;case 90:n=T.MiddleBottom;break;case 180:n=T.MiddleLeft;break;default:n=T.MiddleTop;break}let o=t.children,r=o.length;switch(e){case 24:case 25:{for(let a=0;a<r;a++){let h=o[a],l=(i?h.sourceEdges:h.destinationEdges).first();if(l===null)continue;let u=l.link;if(u!==null){let c=s===90||s===270?T.MiddleLeft:T.MiddleTop;if(r===1||a===r-1&&r%2===1)switch(s){case 0:c=T.MiddleLeft;break;case 90:c=T.MiddleTop;break;case 180:c=T.MiddleRight;break;default:c=T.MiddleBottom;break}else a%2===0&&(c=s===90||s===270?T.MiddleRight:T.MiddleBottom);i?(t.setsPortSpot&&(u.fromSpot=n),t.setsChildPortSpot&&(u.toSpot=c)):(t.setsPortSpot&&(u.fromSpot=c),t.setsChildPortSpot&&(u.toSpot=n))}}break}case 26:{let a=s===90||s===270?T.MiddleRight:T.MiddleBottom,h=i?t.destinationEdges:t.sourceEdges;for(;h.next();){let l=h.value.link;l!==null&&(i?(t.setsPortSpot&&(l.fromSpot=n),t.setsChildPortSpot&&(l.toSpot=a)):(t.setsPortSpot&&(l.fromSpot=a),t.setsChildPortSpot&&(l.toSpot=n)))}break}case 27:{let a=s===90||s===270?T.MiddleLeft:T.MiddleTop,h=i?t.destinationEdges:t.sourceEdges;for(;h.next();){let l=h.value.link;l!==null&&(i?(t.setsPortSpot&&(l.fromSpot=n),t.setsChildPortSpot&&(l.toSpot=a)):(t.setsPortSpot&&(l.fromSpot=a),t.setsChildPortSpot&&(l.toSpot=n)))}break}}}orthoAngle(t){let e=t.angle;return e<=45?0:e<=135?90:e<=225?180:e<=315?270:0}computeLayerSpacing(t){let e=this.orthoAngle(t),i=e===90||e===270,s=t.layerSpacing;if(t.layerSpacingParentOverlap>0){let n=Math.min(1,t.layerSpacingParentOverlap);s-=i?t.height*n:t.width*n}return s<(i?-t.height:-t.width)&&(s=i?-t.height:-t.width),s}computeNodeIndent(t){let e=this.orthoAngle(t),i=e===90||e===270,s=t.nodeIndent;if(t.nodeIndentPastParent>0){let n=Math.min(1,t.nodeIndentPastParent);s+=i?t.width*n:t.height*n}return s=Math.max(0,s),s}get roots(){return this.Ie}set roots(t){this.Ie!==t&&(this.Ie=t,this.p())}get path(){return this.Fe}set path(t){this.Fe!==t&&(this.Fe=t,this.p())}get treeStyle(){return this.yu}set treeStyle(t){this.yu!==t&&(t===40||t===42||t===41||t===43)&&(this.yu=t,this.p())}get layerStyle(){return this.$g}set layerStyle(t){this.$g!==t&&(t===60||t===61||t===62)&&(this.$g=t,this.p())}get comments(){return this.zi}set comments(t){this.zi!==t&&(m.s(t,"boolean",zt,"comments"),this.zi=t,this.p())}get arrangement(){return this.He}set arrangement(t){this.He!==t&&(t===50||t===51||t===52)&&(this.He=t,this.p())}get arrangementSpacing(){return this.Es}set arrangementSpacing(t){this.Es.equals(t)||(this.Es.h(t),this.p())}get rootDefaults(){return this.V}set rootDefaults(t){this.V!==t&&(this.V=t,this.p())}get alternateDefaults(){return this.B}set alternateDefaults(t){this.B!==t&&(this.B=t,this.p())}get sorting(){return this.V.sorting}set sorting(t){this.V.sorting!==t&&(this.V.sorting=t,this.p())}get comparer(){return this.V.comparer}set comparer(t){this.V.comparer!==t&&(m.S(t,zt,"comparer"),this.V.comparer=t,this.p())}get angle(){return this.V.angle}set angle(t){this.V.angle!==t&&(m.s(t,"number",zt,"angle"),t===0||t===90||t===180||t===270?(this.V.angle=t,this.p()):m.o("TreeLayout.angle must be 0, 90, 180, or 270"))}get alignment(){return this.V.alignment}set alignment(t){this.V.alignment!==t&&(this.V.alignment=t,this.p())}get nodeIndent(){return this.V.nodeIndent}set nodeIndent(t){this.V.nodeIndent!==t&&(m.s(t,"number",zt,"nodeIndent"),t>=0&&(this.V.nodeIndent=t,this.p()))}get nodeIndentPastParent(){return this.V.nodeIndentPastParent}set nodeIndentPastParent(t){this.V.nodeIndentPastParent!==t&&(m.s(t,"number",zt,"nodeIndentPastParent"),t>=0&&t<=1&&(this.V.nodeIndentPastParent=t,this.p()))}get nodeSpacing(){return this.V.nodeSpacing}set nodeSpacing(t){this.V.nodeSpacing!==t&&(m.s(t,"number",zt,"nodeSpacing"),this.V.nodeSpacing=t,this.p())}get layerSpacing(){return this.V.layerSpacing}set layerSpacing(t){this.V.layerSpacing!==t&&(m.s(t,"number",zt,"layerSpacing"),this.V.layerSpacing=t,this.p())}get layerSpacingParentOverlap(){return this.V.layerSpacingParentOverlap}set layerSpacingParentOverlap(t){this.V.layerSpacingParentOverlap!==t&&(m.s(t,"number",zt,"layerSpacingParentOverlap"),t>=0&&t<=1&&(this.V.layerSpacingParentOverlap=t,this.p()))}get compaction(){return this.V.compaction}set compaction(t){this.V.compaction!==t&&(t===30||t===31)&&(this.V.compaction=t,this.p())}get breadthLimit(){return this.V.breadthLimit}set breadthLimit(t){this.V.breadthLimit!==t&&(m.s(t,"number",zt,"breadthLimit"),t>=0&&(this.V.breadthLimit=t,this.p()))}get rowSpacing(){return this.V.rowSpacing}set rowSpacing(t){this.V.rowSpacing!==t&&(m.s(t,"number",zt,"rowSpacing"),this.V.rowSpacing=t,this.p())}get rowIndent(){return this.V.rowIndent}set rowIndent(t){this.V.rowIndent!==t&&(m.s(t,"number",zt,"rowIndent"),t>=0&&(this.V.rowIndent=t,this.p()))}get commentSpacing(){return this.V.commentSpacing}set commentSpacing(t){this.V.commentSpacing!==t&&(m.s(t,"number",zt,"commentSpacing"),this.V.commentSpacing=t,this.p())}get commentMargin(){return this.V.commentMargin}set commentMargin(t){this.V.commentMargin!==t&&(m.s(t,"number",zt,"commentMargin"),this.V.commentMargin=t,this.p())}get setsPortSpot(){return this.V.setsPortSpot}set setsPortSpot(t){this.V.setsPortSpot!==t&&(m.s(t,"boolean",zt,"setsPortSpot"),this.V.setsPortSpot=t,this.p())}get portSpot(){return this.V.portSpot}set portSpot(t){this.V.portSpot.equals(t)||(this.V.portSpot=t,this.p())}get setsChildPortSpot(){return this.V.setsChildPortSpot}set setsChildPortSpot(t){this.V.setsChildPortSpot!==t&&(m.s(t,"boolean",zt,"setsChildPortSpot"),this.V.setsChildPortSpot=t,this.p())}get childPortSpot(){return this.V.childPortSpot}set childPortSpot(t){this.V.childPortSpot.equals(t)||(this.V.childPortSpot=t,this.p())}get alternateSorting(){return this.B.sorting}set alternateSorting(t){this.B.sorting!==t&&(this.B.sorting=t,this.p())}get alternateComparer(){return this.B.comparer}set alternateComparer(t){this.B.comparer!==t&&(m.S(t,zt,"alternateComparer"),this.B.comparer=t,this.p())}get alternateAngle(){return this.B.angle}set alternateAngle(t){this.B.angle!==t&&(m.s(t,"number",zt,"alternateAngle"),(t===0||t===90||t===180||t===270)&&(this.B.angle=t,this.p()))}get alternateAlignment(){return this.B.alignment}set alternateAlignment(t){this.B.alignment!==t&&(this.B.alignment=t,this.p())}get alternateNodeIndent(){return this.B.nodeIndent}set alternateNodeIndent(t){this.B.nodeIndent!==t&&(m.s(t,"number",zt,"alternateNodeIndent"),t>=0&&(this.B.nodeIndent=t,this.p()))}get alternateNodeIndentPastParent(){return this.B.nodeIndentPastParent}set alternateNodeIndentPastParent(t){this.B.nodeIndentPastParent!==t&&(m.s(t,"number",zt,"alternateNodeIndentPastParent"),t>=0&&t<=1&&(this.B.nodeIndentPastParent=t,this.p()))}get alternateNodeSpacing(){return this.B.nodeSpacing}set alternateNodeSpacing(t){this.B.nodeSpacing!==t&&(m.s(t,"number",zt,"alternateNodeSpacing"),this.B.nodeSpacing=t,this.p())}get alternateLayerSpacing(){return this.B.layerSpacing}set alternateLayerSpacing(t){this.B.layerSpacing!==t&&(m.s(t,"number",zt,"alternateLayerSpacing"),this.B.layerSpacing=t,this.p())}get alternateLayerSpacingParentOverlap(){return this.B.layerSpacingParentOverlap}set alternateLayerSpacingParentOverlap(t){this.B.layerSpacingParentOverlap!==t&&(m.s(t,"number",zt,"alternateLayerSpacingParentOverlap"),t>=0&&t<=1&&(this.B.layerSpacingParentOverlap=t,this.p()))}get alternateCompaction(){return this.B.compaction}set alternateCompaction(t){this.B.compaction!==t&&(t===30||t===31)&&(this.B.compaction=t,this.p())}get alternateBreadthLimit(){return this.B.breadthLimit}set alternateBreadthLimit(t){this.B.breadthLimit!==t&&(m.s(t,"number",zt,"alternateBreadthLimit"),t>=0&&(this.B.breadthLimit=t,this.p()))}get alternateRowSpacing(){return this.B.rowSpacing}set alternateRowSpacing(t){this.B.rowSpacing!==t&&(m.s(t,"number",zt,"alternateRowSpacing"),this.B.rowSpacing=t,this.p())}get alternateRowIndent(){return this.B.rowIndent}set alternateRowIndent(t){this.B.rowIndent!==t&&(m.s(t,"number",zt,"alternateRowIndent"),t>=0&&(this.B.rowIndent=t,this.p()))}get alternateCommentSpacing(){return this.B.commentSpacing}set alternateCommentSpacing(t){this.B.commentSpacing!==t&&(m.s(t,"number",zt,"alternateCommentSpacing"),this.B.commentSpacing=t,this.p())}get alternateCommentMargin(){return this.B.commentMargin}set alternateCommentMargin(t){this.B.commentMargin!==t&&(m.s(t,"number",zt,"alternateCommentMargin"),this.B.commentMargin=t,this.p())}get alternateSetsPortSpot(){return this.B.setsPortSpot}set alternateSetsPortSpot(t){this.B.setsPortSpot!==t&&(m.s(t,"boolean",zt,"alternateSetsPortSpot"),this.B.setsPortSpot=t,this.p())}get alternatePortSpot(){return this.B.portSpot}set alternatePortSpot(t){this.B.portSpot.equals(t)||(this.B.portSpot=t,this.p())}get alternateSetsChildPortSpot(){return this.B.setsChildPortSpot}set alternateSetsChildPortSpot(t){this.B.setsChildPortSpot!==t&&(m.s(t,"boolean",zt,"alternateSetsChildPortSpot"),this.B.setsChildPortSpot=t,this.p())}get alternateChildPortSpot(){return this.B.childPortSpot}set alternateChildPortSpot(t){this.B.childPortSpot.equals(t)||(this.B.childPortSpot=t,this.p())}static PathDefault=0;static PathDestination=1;static PathSource=2;static SortingForwards=10;static SortingReverse=11;static SortingAscending=12;static SortingDescending=13;static AlignmentCenterSubtrees=20;static AlignmentCenterChildren=21;static AlignmentStart=22;static AlignmentEnd=23;static AlignmentBus=24;static AlignmentBusBranching=25;static AlignmentTopLeftBus=26;static AlignmentBottomRightBus=27;static CompactionNone=30;static CompactionBlock=31;static StyleLayered=40;static StyleLastParents=41;static StyleAlternating=42;static StyleRootOnly=43;static ArrangementVertical=50;static ArrangementHorizontal=51;static ArrangementFixedRoots=52;static LayerIndividual=60;static LayerSiblings=61;static LayerUniform=62}class gs extends Ee{constructor(t){super(t)}createVertex(){return new Rt(this)}createEdge(){return new sn(this)}}class Rt extends Ie{U;dt;at;mP;pP;yP;wP;xP;bP;kP;zi;Zg;Qg;Si;Mi;Xt;de;Fw;Rw;Ow;Us;Iw;Ew;Uw;Vw;Bw;zw;Xw;Gw;Yw;Kw;Hw;constructor(t){super(t),this.mP=!1,this.pP=null,this.yP=[],this.wP=0,this.xP=0,this.bP=0,this.kP=0,this.zi=null,this.U=new P(0,0),this.dt=new st(0,0),this.at=new P(0,0),this.Zg=null,this.Qg=null,this.Si=10,this.Mi=Ie.standardComparer,this.Xt=0,this.de=21,this.Fw=0,this.Rw=0,this.Ow=20,this.Us=50,this.Iw=0,this.Ew=31,this.Uw=0,this.Vw=25,this.Bw=10,this.zw=10,this.Xw=20,this.Gw=!0,this.Yw=T.Default,this.Kw=!0,this.Hw=T.Default}copyInheritedPropertiesFrom(t){t!==null&&(this.Si=t.sorting,this.Mi=t.comparer,this.Xt=t.angle,this.de=t.alignment,this.Fw=t.nodeIndent,this.Rw=t.nodeIndentPastParent,this.Ow=t.nodeSpacing,this.Us=t.layerSpacing,this.Iw=t.layerSpacingParentOverlap,this.Ew=t.compaction,this.Uw=t.breadthLimit,this.Vw=t.rowSpacing,this.Bw=t.rowIndent,this.zw=t.commentSpacing,this.Xw=t.commentMargin,this.Gw=t.setsPortSpot,this.Yw=t.portSpot,this.Kw=t.setsChildPortSpot,this.Hw=t.childPortSpot)}get initialized(){return this.mP}set initialized(t){this.mP!==t&&(m.s(t,"boolean",Rt,"initialized"),this.mP=t)}get parent(){return this.pP}set parent(t){this.pP!==t&&(this.pP=t)}get children(){return this.yP}set children(t){if(this.yP!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",Rt,"children:value"),t!==null){let e=t.length;for(let i=0;i<e;i++){let s=t[i]}}this.yP=t}}get level(){return this.wP}set level(t){this.wP!==t&&(m.s(t,"number",Rt,"level"),this.wP=t)}get descendantCount(){return this.xP}set descendantCount(t){this.xP!==t&&(m.s(t,"number",Rt,"descendantCount"),this.xP=t)}get maxChildrenCount(){return this.bP}set maxChildrenCount(t){this.bP!==t&&(m.s(t,"number",Rt,"maxChildrenCount"),this.bP=t)}get maxGenerationCount(){return this.kP}set maxGenerationCount(t){this.kP!==t&&(m.s(t,"number",Rt,"maxGenerationCount"),this.kP=t)}get comments(){return this.zi}set comments(t){if(this.zi!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",Rt,"comments:value"),t!==null){let e=t.length;for(let i=0;i<e;i++){let s=t[i]}}this.zi=t}}get sorting(){return this.Si}set sorting(t){this.Si!==t&&(this.Si=t)}get comparer(){return this.Mi}set comparer(t){this.Mi!==t&&(m.S(t,Rt,"comparer"),this.Mi=t)}get angle(){return this.Xt}set angle(t){this.Xt!==t&&(m.s(t,"number",Rt,"angle"),this.Xt=t)}get alignment(){return this.de}set alignment(t){this.de!==t&&(this.de=t)}get nodeIndent(){return this.Fw}set nodeIndent(t){this.Fw!==t&&(m.s(t,"number",Rt,"nodeIndent"),this.Fw=t)}get nodeIndentPastParent(){return this.Rw}set nodeIndentPastParent(t){this.Rw!==t&&(m.s(t,"number",Rt,"nodeIndentPastParent"),this.Rw=t)}get nodeSpacing(){return this.Ow}set nodeSpacing(t){this.Ow!==t&&(m.s(t,"number",Rt,"nodeSpacing"),this.Ow=t)}get layerSpacing(){return this.Us}set layerSpacing(t){this.Us!==t&&(m.s(t,"number",Rt,"layerSpacing"),this.Us=t)}get layerSpacingParentOverlap(){return this.Iw}set layerSpacingParentOverlap(t){this.Iw!==t&&(m.s(t,"number",Rt,"layerSpacingParentOverlap"),this.Iw=t)}get compaction(){return this.Ew}set compaction(t){this.Ew!==t&&(this.Ew=t)}get breadthLimit(){return this.Uw}set breadthLimit(t){this.Uw!==t&&(m.s(t,"number",Rt,"breadthLimit"),this.Uw=t)}get rowSpacing(){return this.Vw}set rowSpacing(t){this.Vw!==t&&(m.s(t,"number",Rt,"rowSpacing"),this.Vw=t)}get rowIndent(){return this.Bw}set rowIndent(t){this.Bw!==t&&(m.s(t,"number",Rt,"rowIndent"),this.Bw=t)}get commentSpacing(){return this.zw}set commentSpacing(t){this.zw!==t&&(m.s(t,"number",Rt,"commentSpacing"),this.zw=t)}get commentMargin(){return this.Xw}set commentMargin(t){this.Xw!==t&&(m.s(t,"number",Rt,"commentMargin"),this.Xw=t)}get setsPortSpot(){return this.Gw}set setsPortSpot(t){this.Gw!==t&&(m.s(t,"boolean",Rt,"setsPortSpot"),this.Gw=t)}get portSpot(){return this.Yw}set portSpot(t){this.Yw.equals(t)||(this.Yw=t)}get setsChildPortSpot(){return this.Kw}set setsChildPortSpot(t){this.Kw!==t&&(m.s(t,"boolean",Rt,"setsChildPortSpot"),this.Kw=t)}get childPortSpot(){return this.Hw}set childPortSpot(t){this.Hw.equals(t)||(this.Hw=t)}get childrenCount(){return this.children.length}get relativePosition(){return this.U}set relativePosition(t){this.U.set(t)}get subtreeSize(){return this.dt}set subtreeSize(t){this.dt.set(t)}get subtreeOffset(){return this.at}set subtreeOffset(t){this.at.set(t)}}class sn extends ei{PP;constructor(t){super(t),this.PP=new P(0,0)}commit(){let t=this.link;if(t===null||t.isAvoiding)return;let e=this.network.layout,i=null,s=null;switch(e.ws){case 1:i=this.fromVertex,s=this.toVertex;break;case 2:i=this.toVertex,s=this.fromVertex;break;default:m.o("Unhandled path value "+e.ws.toString())}if(i===null||s===null)return;let n=this.PP;if(n.x===0&&n.y===0){this.PU(i,s);return}let o=i.bounds,r=e.orthoAngle(i),a=e.computeLayerSpacing(i),h=i.rowSpacing;t.updateRoute();let l=t.curve===9,u=t.isOrthogonal,c=0,d,f;if(t.startRoute(),u||l){for(c=2;t.pointsCount>4;)t.removePoint(2);d=t.getPoint(1),f=t.getPoint(2)}else{for(c=1;t.pointsCount>3;)t.removePoint(1);d=t.getPoint(0),f=t.getPoint(t.pointsCount-1)}let p=t.getPoint(t.pointsCount-1),g=0;r===0?(i.alignment===23?(g=o.bottom+n.y,n.y===0&&d.y>p.y+i.rowIndent&&(g=Math.min(g,Math.max(d.y,g-e.computeNodeIndent(i))))):i.alignment===22?(g=o.top+n.y,n.y===0&&d.y<p.y-i.rowIndent&&(g=Math.max(g,Math.min(d.y,g+e.computeNodeIndent(i))))):g=o.y+o.height/2+n.y,l?(t.insertPointAt(c,d.x,g),c++,t.insertPointAt(c,o.right+a,g),c++,t.insertPointAt(c,o.right+a+(n.x-h)/3,g),c++,t.insertPointAt(c,o.right+a+(n.x-h)*2/3,g),c++,t.insertPointAt(c,o.right+a+(n.x-h),g),c++,t.insertPointAt(c,f.x,g),c++):(u&&(t.insertPointAt(c,o.right+a/2,d.y),c++),t.insertPointAt(c,o.right+a/2,g),c++,t.insertPointAt(c,o.right+a+n.x-(u?h/2:h),g),c++,u&&(t.insertPointAt(c,t.getPoint(c-1).x,f.y),c++))):r===90?(i.alignment===23?(g=o.right+n.x,n.x===0&&d.x>p.x+i.rowIndent&&(g=Math.min(g,Math.max(d.x,g-e.computeNodeIndent(i))))):i.alignment===22?(g=o.left+n.x,n.x===0&&d.x<p.x-i.rowIndent&&(g=Math.max(g,Math.min(d.x,g+e.computeNodeIndent(i))))):g=o.x+o.width/2+n.x,l?(t.insertPointAt(c,g,d.y),c++,t.insertPointAt(c,g,o.bottom+a),c++,t.insertPointAt(c,g,o.bottom+a+(n.y-h)/3),c++,t.insertPointAt(c,g,o.bottom+a+(n.y-h)*2/3),c++,t.insertPointAt(c,g,o.bottom+a+(n.y-h)),c++,t.insertPointAt(c,g,f.y),c++):(u&&(t.insertPointAt(c,d.x,o.bottom+a/2),c++),t.insertPointAt(c,g,o.bottom+a/2),c++,t.insertPointAt(c,g,o.bottom+a+n.y-(u?h/2:h)),c++,u&&(t.insertPointAt(c,f.x,t.getPoint(c-1).y),c++))):r===180?(i.alignment===23?(g=o.bottom+n.y,n.y===0&&d.y>p.y+i.rowIndent&&(g=Math.min(g,Math.max(d.y,g-e.computeNodeIndent(i))))):i.alignment===22?(g=o.top+n.y,n.y===0&&d.y<p.y-i.rowIndent&&(g=Math.max(g,Math.min(d.y,g+e.computeNodeIndent(i))))):g=o.y+o.height/2+n.y,l?(t.insertPointAt(c,d.x,g),c++,t.insertPointAt(c,o.left-a,g),c++,t.insertPointAt(c,o.left-a+(n.x+h)/3,g),c++,t.insertPointAt(c,o.left-a+(n.x+h)*2/3,g),c++,t.insertPointAt(c,o.left-a+(n.x+h),g),c++,t.insertPointAt(c,f.x,g),c++):(u&&(t.insertPointAt(c,o.left-a/2,d.y),c++),t.insertPointAt(c,o.left-a/2,g),c++,t.insertPointAt(c,o.left-a+n.x+(u?h/2:h),g),c++,u&&(t.insertPointAt(c,t.getPoint(c-1).x,f.y),c++))):r===270?(i.alignment===23?(g=o.right+n.x,n.x===0&&d.x>p.x+i.rowIndent&&(g=Math.min(g,Math.max(d.x,g-e.computeNodeIndent(i))))):i.alignment===22?(g=o.left+n.x,n.x===0&&d.x<p.x-i.rowIndent&&(g=Math.max(g,Math.min(d.x,g+e.computeNodeIndent(i))))):g=o.x+o.width/2+n.x,l?(t.insertPointAt(c,g,d.y),c++,t.insertPointAt(c,g,o.top-a),c++,t.insertPointAt(c,g,o.top-a+(n.y+h)/3),c++,t.insertPointAt(c,g,o.top-a+(n.y+h)*2/3),c++,t.insertPointAt(c,g,o.top-a+(n.y+h)),c++,t.insertPointAt(c,g,f.y),c++):(u&&(t.insertPointAt(c,d.x,o.top-a/2),c++),t.insertPointAt(c,g,o.top-a/2),c++,t.insertPointAt(c,g,o.top-a+n.y+(u?h/2:h)),c++,u&&(t.insertPointAt(c,f.x,t.getPoint(c-1).y),c++))):m.o("Invalid angle "+r),t.commitRoute()}PU(t,e){let i=this.link;if(i===null)return;let s=this.network.layout,n=s.orthoAngle(t),o=s.orthoAngle(e);if(n===o)return;let r=s.computeLayerSpacing(t),a=t.bounds,h=e.bounds;if(n===0&&h.left-a.right<r+1||n===90&&h.top-a.bottom<r+1||n===180&&a.left-h.right<r+1||n===270&&a.top-h.bottom<r+1)return;i.updateRoute();let l=i.curve===9,u=i.isOrthogonal,c=this.fromVertex,d=s.isBusAlignment(c.alignment);if(i.startRoute(),n===0){let f=a.right+r/2;if(l){if(i.pointsCount===4){let p=i.getPoint(3).y;i.setPointAt(1,f-20,i.getPoint(1).y),i.insertPointAt(2,f-20,p),i.insertPointAt(3,f,p),i.insertPointAt(4,f+20,p),i.setPointAt(5,i.getPoint(5).x,p)}}else u?d?i.setPointAt(3,i.getPoint(2).x,i.getPoint(4).y):i.pointsCount===6&&(i.setPointAt(2,f,i.getPoint(2).y),i.setPointAt(3,f,i.getPoint(3).y)):i.pointsCount===4?i.insertPointAt(2,f,i.getPoint(2).y):i.pointsCount===3?i.setPointAt(1,f,i.getPoint(2).y):i.pointsCount===2&&i.insertPointAt(1,f,i.getPoint(1).y)}else if(n===90){let f=a.bottom+r/2;if(l){if(i.pointsCount===4){let p=i.getPoint(3).x;i.setPointAt(1,i.getPoint(1).x,f-20),i.insertPointAt(2,p,f-20),i.insertPointAt(3,p,f),i.insertPointAt(4,p,f+20),i.setPointAt(5,p,i.getPoint(5).y)}}else u?d?i.setPointAt(3,i.getPoint(2).x,i.getPoint(4).y):i.pointsCount===6&&(i.setPointAt(2,i.getPoint(2).x,f),i.setPointAt(3,i.getPoint(3).x,f)):i.pointsCount===4?i.insertPointAt(2,i.getPoint(2).x,f):i.pointsCount===3?i.setPointAt(1,i.getPoint(2).x,f):i.pointsCount===2&&i.insertPointAt(1,i.getPoint(1).x,f)}else if(n===180){let f=a.left-r/2;if(l){if(i.pointsCount===4){let p=i.getPoint(3).y;i.setPointAt(1,f+20,i.getPoint(1).y),i.insertPointAt(2,f+20,p),i.insertPointAt(3,f,p),i.insertPointAt(4,f-20,p),i.setPointAt(5,i.getPoint(5).x,p)}}else u?d?i.setPointAt(3,i.getPoint(2).x,i.getPoint(4).y):i.pointsCount===6&&(i.setPointAt(2,f,i.getPoint(2).y),i.setPointAt(3,f,i.getPoint(3).y)):i.pointsCount===4?i.insertPointAt(2,f,i.getPoint(2).y):i.pointsCount===3?i.setPointAt(1,f,i.getPoint(2).y):i.pointsCount===2&&i.insertPointAt(1,f,i.getPoint(1).y)}else if(n===270){let f=a.top-r/2;if(l){if(i.pointsCount===4){let p=i.getPoint(3).x;i.setPointAt(1,i.getPoint(1).x,f+20),i.insertPointAt(2,p,f+20),i.insertPointAt(3,p,f),i.insertPointAt(4,p,f-20),i.setPointAt(5,p,i.getPoint(5).y)}}else u?d?i.setPointAt(3,i.getPoint(2).x,i.getPoint(4).y):i.pointsCount===6&&(i.setPointAt(2,i.getPoint(2).x,f),i.setPointAt(3,i.getPoint(3).x,f)):i.pointsCount===4?i.insertPointAt(2,i.getPoint(2).x,f):i.pointsCount===3?i.setPointAt(1,i.getPoint(2).x,f):i.pointsCount===2&&i.insertPointAt(1,i.getPoint(1).x,f)}i.commitRoute()}get fromVertex(){return this.is}set fromVertex(t){this.is!==t&&(this.is=t)}get toVertex(){return this.ss}set toVertex(t){this.ss!==t&&(this.ss=t)}get relativePoint(){return this.PP}set relativePoint(t){this.PP.set(t)}}class be{constructor(){}static Light={colors:{text:"#0a0a0a",comment:"#ca8a04",link:"#0a0a0a",group:"#a3a3a344",outline:"#a3a3a3",selection:"#0ea5e9",div:"#fff",gridMinor:"#e5e5e5",gridMajor:"#a3a3a3",overviewBox:"#c026d3",tempLink:"#2563eb",tempPort:"#c026d3",adornmentFill:"#0ea5e9",adornmentStroke:"#1e40af",dragSelect:"#c026d3"},fonts:{normal:"10pt sans-serif",bold:"bold 12pt sans-serif"},numbers:{group:1,selection:3},margins:{group:new Dt(5)},arrowheads:{toArrow:"Standard"}};static Dark={colors:{text:"#f5f5f5",comment:"#facc15",link:"#f5f5f5",group:"#a3a3a388",outline:"#a3a3a3",selection:"#38bdf8",div:"#171717",gridMinor:"#262626",gridMajor:"#404040",overviewBox:"#e879f9",tempLink:"#60a5fa",tempPort:"#e879f9",adornmentFill:"#38bdf8",adornmentStroke:"#2563eb",dragSelect:"#e879f9"},fonts:{normal:"10pt sans-serif",bold:"bold 12pt sans-serif"},numbers:{group:1,selection:3},margins:{group:new Dt(5)},arrowheads:{toArrow:"Standard"}}}class Ge{hs=new Set;xu=new Mt;SP="light";MP="light";NP=!1;CL=!0;_g="light";BF=t=>{let e=t.matches?"dark":"light";e!==this._g&&(this._g=e,this.MP==="system"&&this.updateDiagrams())};constructor(t){t&&Object.assign(this,t),t?.themeMap||(this.xu.set("light",{colors:{...be.Light.colors},fonts:{...be.Light.fonts},numbers:{...be.Light.numbers},margins:{...be.Light.margins},arrowheads:{...be.Light.arrowheads}}),this.xu.set("dark",{colors:{...be.Dark.colors},fonts:{...be.Dark.fonts},numbers:{...be.Dark.numbers},margins:{...be.Dark.margins},arrowheads:{...be.Dark.arrowheads}})),X.matchMedia&&(this._g=X.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}get themeMap(){return this.xu}set themeMap(t){this.xu!==t&&(this.xu=t,this.updateDiagrams())}get defaultTheme(){return this.SP}set defaultTheme(t){this.SP!==t&&(m.s(t,"string",Ge,"defaultTheme"),this.SP=t,this.updateDiagrams())}get currentTheme(){return this.MP}set currentTheme(t){this.MP!==t&&(m.s(t,"string",Ge,"currentTheme"),this.MP=t,this.updateDiagrams())}get changesDivBackground(){return this.NP}set changesDivBackground(t){if(this.NP!==t&&(this.NP=t,t))for(let e of this.hs)e.setDivBackground(this.findValue("div","","fill")),e.T("ThemeChanged",this)}get readsCssVariables(){return this.CL}set readsCssVariables(t){this.CL!==t&&(this.CL=t,this.updateDiagrams())}get preferredColorScheme(){return this._g}addDiagram(t){return this.hs.add(t),this.LL(t),this}removeDiagram(t){return this.hs.delete(t),this.LL(t),this}eO(){this.hs.size===0&&X.matchMedia&&X.matchMedia("(prefers-color-scheme: dark)")?.addEventListener("change",this.BF)}iO(){this.hs.size===0&&X.matchMedia&&X.matchMedia("(prefers-color-scheme: dark)")?.removeEventListener("change",this.BF)}set(t,e){t===""&&(t=this.SP),t==="system"&&(t=this._g);let i=this.xu.get(t);return i?i=this.zF(i,e):i=e,this.xu.set(t,i),this.updateDiagrams(),this}findValue(t,e,i){return this.getValue(this.findTheme(this.currentTheme),t,e,i)||this.getValue(this.findTheme(this.defaultTheme),t,e,i)}getValue(t,e,i,s){if(!t)return;i==null&&(i="");let n=t,o=a=>{if(n===void 0||a==="")return;if(typeof a=="number"||!(Array.isArray(a)||a.includes(".")))return n[a];let h=Array.isArray(a)?a:a.split(".");for(let l=0;l<h.length;l++){let u=h[l];if(u!==""&&(n=n[u],n===void 0))return}return n},r=()=>{if(!(i!==""&&(n=o(i),n===void 0)))return Array.isArray(n)&&typeof e=="number"?n=n[e%n.length]:n=o(e),n};if(n=r(),n===void 0&&typeof s=="string"&&s.length>0){let a=t.targetPropertyMap?.get(s);if(a?n=t[a]:(a=Ge.SU.get(s),n=a?t[a]:t.colors),n=r(),n!==void 0)return n}return n}findTheme(t){return this.themeMap.get(t==="system"?this._g:t)}updateDiagrams(){for(let t of this.hs)this.LL(t)}LL(t){let e=t.skipsUndoManager;t.skipsUndoManager=!0,t.updateAllThemeBindings(),this.NP&&t.setDivBackground(this.findValue("div","","fill")),t.skipsUndoManager=e,t.T("ThemeChanged",this)}zF(t,e){for(let i in e)if(m.qw(e,i))try{e[i]?.constructor===Object?t[i]=this.zF(t[i]??{},e[i]):t[i]=e[i]}catch{delete t[i]}return t}static SU=new Map([["background","colors"],["defaultColumnSeparatorStroke","colors"],["defaultRowSeparatorStroke","colors"],["shadowColor","colors"],["fill","colors"],["stroke","colors"],["font","fonts"],["angle","numbers"],["fromEndSegmentLength","numbers"],["fromShortLength","numbers"],["height","numbers"],["opacity","numbers"],["scale","numbers"],["toEndSegmentLength","numbers"],["toShortLength","numbers"],["width","numbers"],["defaultColumnSeparatorStrokeWidth","numbers"],["defaultRowSeparatorStrokeWidth","numbers"],["shadowBlur","numbers"],["corner","numbers"],["curviness","numbers"],["smoothness","numbers"],["parameter1","numbers"],["parameter2","numbers"],["strokeWidth","numbers"],["strokeDashOffset","numbers"],["maxLines","numbers"],["spacingAbove","numbers"],["spacingBelow","numbers"],["position","points"],["shadowOffset","points"],["desiredSize","sizes"],["maxSize","sizes"],["minSize","sizes"],["margin","margins"],["defaultSeparatorPadding","margins"],["padding","margins"],["alignment","spots"],["alignmentFocus","spots"],["fromSpot","spots"],["toSpot","spots"],["defaultAlignment","spots"],["spot1","spots"],["spot2","spots"],["verticalAlignment","spots"],["imageAlignment","spots"],["fromArrow","arrowheads"],["toArrow","arrowheads"]])}class nn{Pt;a;Be;Pl;constructor(){this.a=Y.Om(),this.Pt="",this.Be=!0,this.Pl=!0}get name(){return this.Pt}set name(t){this.Pt=t}get isEnabled(){return this.Be}set isEnabled(t){this.Be=t}get isRealtime(){return this.Pl}set isRealtime(t){this.Pl=t}get diagram(){return this.a}set diagram(t){this.a!==t&&(this.a=t,t.Fl=!0,t.requestUpdate())}invalidateRouter(){this.a!==null&&(this.a.Fl=!0,this.a.requestUpdate())}canRoute(t){if(!this.isEnabled)return!1;let e=this.diagram;return!(e&&(!this.isRealtime&&e.Ou||e.animationManager.isTicking))}isRoutable(t,e){return!0}routeLinks(t,e){}toString(){return this.name!==""?this.name+" Router":m.Kn(this.constructor)}}class _n extends nn{constructor(t){super(),this.name="AvoidsNodes",t&&Object.assign(this,t)}canRoute(t){return(t instanceof Y?t.lp:t.diagram?.lp)?super.canRoute(t):!1}isRoutable(t,e){return!(!t.isAvoiding||t.containingGroup!==(e instanceof ht?e:null)||t.toNode===null||t.fromNode===null||t.pointsCount<4)}routeLinks(t,e){let i=e instanceof Y?null:e,s=t.iterator,n=this.diagram.getPositions(!0,i,null);for(;s.next();){let o=s.value;if(!this.isRoutable(o,e))continue;o.startRoute();let r=o.pointsCount,a=o.getPoint(1),h=o.getPoint(r-2),l=o.fromNode.actualBounds.copy();l.inflate(j.Fa,j.Fa),l.unionPoint(o.getPoint(0));let u=o.toNode.actualBounds.copy();u.inflate(j.Fa,j.Fa),u.unionPoint(o.getPoint(r-1)),this.MU(o,l,u,n)&&this.NU(o,a,o.SC,h,o.MC,l,u,n),o.commitRoute()}}MU(t,e,i,s){let n=t.diagram,o=t.pointsCount;if(n===null||!t.fromNode||!t.toNode||t.fromNode===t.toNode||!t.layer||t.layer.isTemporary||e.containsPoint(t.getPoint(o-1))&&!t.toNode.isMemberOf(t.fromNode)||i.containsPoint(t.getPoint(0))&&!t.fromNode.isMemberOf(t.toNode)||!t.isOrthogonal)return!1;if(t.segmentIndex===17)return!0;let r=t.getPoint(1),a=t.getPoint(o-2),h=t.getPoint(2);if(!s.isUnoccupied(Math.min(r.x,h.x),Math.min(r.y,h.y),Math.abs(r.x-h.x),Math.abs(r.y-h.y)))return!0;for(let u=2;u<o-3;u++){let c=t.getPoint(u),d=t.getPoint(u+1);if(!s.isUnoccupied(Math.min(c.x,d.x),Math.min(c.y,d.y),Math.abs(c.x-d.x),Math.abs(c.y-d.y)))return!0}let l=t.getPoint(o-3);return!s.isUnoccupied(Math.min(l.x,a.x),Math.min(l.y,a.y),Math.abs(l.x-a.x),Math.abs(l.y-a.y))}NU(t,e,i,s,n,o,r,a){let h=t.diagram;if(h===null)return;let l=e,u=s,c=P.gn,d=P.gn;if(h.isVirtualized){let g=a.bounds.copy(),y=t.getPoint(2),b=t.getPoint(t.pointsCount-3);g.inflate(-a.cellWidth,-a.cellHeight);let v=P.l();a.ng(e.x,e.y)||(C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,e.x,e.y,y.x,y.y,v)?(c=e=v.copy(),i=v.directionPoint(y)):C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,y.x,y.y,b.x,b.y,v)?(c=e=v.copy(),i=v.directionPoint(b)):C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,b.x,b.y,s.x,s.y,v)&&(c=e=v.copy(),i=v.directionPoint(s))),a.ng(s.x,s.y)||(C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,s.x,s.y,b.x,b.y,v)?(d=s=v.copy(),n=b.directionPoint(v)):C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,b.x,b.y,y.x,y.y,v)?(d=s=v.copy(),n=y.directionPoint(v)):C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,y.x,y.y,e.x,e.y,v)&&(d=s=v.copy(),n=e.directionPoint(v))),P.i(v)}let f=o.copy().unionRect(r);f.inflate(a.cellWidth*a.af,a.cellHeight*a.af),a.wv(e,i,s,n,f,!0);let p=a.xo(s.x,s.y);if(!a.tw&&p>=Ot.sg&&(a.vT(),f.inflate(a.cellWidth*a.U2,a.cellHeight*a.V2),a.wv(e,i,s,n,f,!1),p=a.xo(s.x,s.y)),!a.tw&&p<Ot.sg&&!a.GE(s.x,s.y)){t.points.removeRange(2,t.pointsCount-3),this.AL(t,a,s.x,s.y,n,!0);let g=0,y=90,b=180,v=270,w=t.getPoint(2);if(t.pointsCount<4)i===g||i===b?(w.x=e.x,w.y=s.y):(w.x=s.x,w.y=e.y),t.setPointAt(2,w.x,w.y),t.insertPointAt(3,w.x,w.y);else{let k=t.getPoint(3);if(i===g||i===b)if(C.c(w.x,k.x)){let S=i===g?Math.max(w.x,e.x):Math.min(w.x,e.x);t.setPointAt(2,S,e.y),t.setPointAt(3,S,k.y)}else C.c(w.y,k.y)?(Math.abs(e.y-w.y)<=a.cellHeight/2&&(t.setPointAt(2,w.x,e.y),t.setPointAt(3,k.x,e.y)),t.insertPointAt(2,w.x,e.y)):t.setPointAt(2,e.x,w.y);else if(i===y||i===v)if(C.c(w.y,k.y)){let S=i===y?Math.max(w.y,e.y):Math.min(w.y,e.y);t.setPointAt(2,e.x,S),t.setPointAt(3,k.x,S)}else C.c(w.x,k.x)?(Math.abs(e.x-w.x)<=a.cellWidth/2&&(t.setPointAt(2,e.x,w.y),t.setPointAt(3,e.x,k.y)),t.insertPointAt(2,e.x,w.y)):t.setPointAt(2,w.x,e.y)}if(c.isReal()){let k=t.getPoint(1),S=t.getPoint(2);k.x!==S.x&&k.y!==S.y?i===g||i===b?t.insertPointAt(2,k.x,S.y):t.insertPointAt(2,S.x,k.y):i===g||i===b?t.insertPointAt(2,l.x,c.y):t.insertPointAt(2,c.x,l.y)}d.isReal()&&(n===g||n===b?t.insertPointAt(t.pointsCount-2,u.x,d.y):t.insertPointAt(t.pointsCount-2,d.x,u.y))}}AL(t,e,i,s,n,o){let r=e.cellWidth,a=e.cellHeight,h=e.xo(i,s),l=i,u=s,c=l,d=u;for(n===0?c+=r:n===90?d+=a:n===180?c-=r:d-=a,t.vC&&h>Ot.sc&&e.xo(c,d)!==h-1&&(e.xo(l-r,u)===h-1?(n=180,c=l-r,d=u):e.xo(l+r,u)===h-1?(n=0,c=l+r,d=u):e.xo(l,u-a)===h-1?(n=270,c=l,d=u-a):e.xo(l,u+a)===h-1&&(n=90,c=l,d=u+a));h>Ot.sc&&e.xo(c,d)===h-1;)l=c,u=d,n===0?c+=r:n===90?d+=a:n===180?c-=r:d-=a,h-=1;if(o?h>Ot.sc&&(n===180||n===0?l=Math.floor(l/r)*r+r/2:(n===90||n===270)&&(u=Math.floor(u/a)*a+a/2)):(l=Math.floor(l/r)*r+r/2,u=Math.floor(u/a)*a+a/2),h>Ot.sc){let f=n,p=l,g=u;if(n===0?(f=90,g+=a):n===90?(f=180,p-=r):n===180?(f=270,g-=a):n===270&&(f=0,p+=r),e.xo(p,g)===h-1)this.AL(t,e,p,g,f,!1);else{let y=l,b=u;n===0?(f=270,b-=a):n===90?(f=0,y+=r):n===180?(f=90,b+=a):n===270&&(f=180,y-=r),e.xo(y,b)===h-1&&this.AL(t,e,y,b,f,!1)}}t.insertPointAt(t.pointsCount-2,l,u)}}ne.prototype.initializeStandardTools=function(){return this.Jt("Action",new Fs,this.mouseDownTools),this.Jt("Relinking",new $e,this.mouseDownTools),this.Jt("LinkReshaping",new Je,this.mouseDownTools),this.Jt("Rotating",new De,this.mouseDownTools),this.Jt("Resizing",new Ze,this.mouseDownTools),this.Jt("Linking",new Le,this.mouseMoveTools),this.Jt("Dragging",new Tt,this.mouseMoveTools),this.Jt("DragSelecting",new ri,this.mouseMoveTools),this.Jt("Panning",new ki,this.mouseMoveTools),this.Jt("ContextMenu",new It,this.mouseUpTools),this.Jt("TextEditing",new oe,this.mouseUpTools),this.Jt("ClickCreating",new Qe,this.mouseUpTools),this.Jt("ClickSelecting",new Ds,this.mouseUpTools),this},Y.m2("GraphLinksModel",Zn),Y.m2("TreeModel",Qn);let Ai=X.go,gi={get version(){return Y.version},Group:ht,List:q,Set:V,Map:Mt,Point:P,Size:st,Rect:I,Margin:Dt,Spot:T,Geometry:wt,PathFigure:Kt,PathSegment:mt,InputEvent:Qt,DiagramEvent:wi,ChangedEvent:Xe,Model:ut,GraphLinksModel:Vt,TreeModel:Be,Binding:te,ThemeBinding:ii,Transaction:oi,UndoManager:vi,CommandHandler:jt,Tool:$t,DraggingTool:Tt,DraggingInfo:Ye,DraggingOptions:Pi,LinkingBaseTool:ae,LinkingTool:Le,RelinkingTool:$e,LinkReshapingTool:Je,ResizingTool:Ze,RotatingTool:De,ClickSelectingTool:Ds,ActionTool:Fs,ClickCreatingTool:Qe,HTMLInfo:fe,ContextMenuTool:It,DragSelectingTool:ri,PanningTool:ki,TextEditingTool:oe,ToolManager:ne,Animation:ye,AnimationManager:he,AnimationTrigger:ai,Layer:Et,Diagram:Y,Palette:Rn,Overview:hi,Brush:R,GraphObject:$,Panel:G,RowColumnDefinition:Xt,Shape:et,TextBlock:lt,Picture:Bt,Part:pt,Adornment:vt,Node:J,Link:j,Placeholder:le,Layout:_t,LayoutNetwork:Ee,LayoutVertex:Ie,LayoutEdge:ei,GridLayout:je,PanelLayout:Lt,CircularLayout:Ve,CircularNetwork:Ws,CircularVertex:di,CircularEdge:$s,ForceDirectedLayout:ee,ForceDirectedNetwork:Js,ForceDirectedVertex:ze,ForceDirectedEdge:fi,LayeredDigraphLayout:Ae,LayeredDigraphNetwork:tn,LayeredDigraphVertex:si,LayeredDigraphEdge:Se,TreeLayout:zt,TreeNetwork:gs,TreeVertex:Rt,TreeEdge:sn,Themes:be,ThemeManager:Ge,Router:nn,AnimationStyle:Is,AutoScale:Ii,CycleMode:Vs,Flip:Xs,TextFormat:Yi,ImageStretch:ji,LayoutConditions:Gs,LinkAdjusting:Hi,Curve:$i,Routing:Wi,Orientation:Vi,TextOverflow:js,PortSpreading:qs,ScrollMode:zs,CollapsePolicy:Ks,Sizing:zi,TriggerStart:Bs,Stretch:Bi,ViewboxStretch:Us,Wrap:Xi,BrushType:Oe,ColorSpace:Ys,GeometryStretch:Ri,GeometryType:Ke,SegmentType:ni,BindingMode:Ci,ChangeType:Ei,CircularArrangement:ts,CircularDirection:es,CircularNodeDiameterFormula:ss,CircularSorting:is,GridAlignment:Zi,GridArrangement:Qi,GridSorting:_i,LayeredDigraphAggressive:as,LayeredDigraphAlign:_s,LayeredDigraphCycleRemove:ns,LayeredDigraphInit:rs,LayeredDigraphLayering:os,LayeredDigraphPack:Qs,TreeAlignment:us,TreeArrangement:fs,TreeCompaction:cs,TreeLayerStyle:en,TreePath:hs,TreeSorting:ls,TreeStyle:ds,GestureMode:As,LinkingDirection:Ts,ReshapingBehavior:Ls,TextEditingAccept:Os,TextEditingStarting:Rs,TextEditingState:Es,WheelMode:Cs};for(let x in gi){let t=gi[x];m.st(t)&&t!==Yi&&(t.className=x)}m.$(Ai)&&Ai.version&&m.ne("WARNING: a `go` object on the root object is already defined. "+("Debug"in Ai?"debug ":"")+"version: "+Ai.version+", replaced with version: "+gi.version),Y.prototype.go=gi,X.go=gi})();var Eo=typeof global<"u"?global.go:self.go,H=typeof global<"u"?global.go:self.go,Io=H.Group,Bo=H.List,Vo=H.Set;var zo=H.Map;var cn=H.Point,pi=H.Size,Ko=H.Rect,ys=H.Margin,Ne=H.Spot,Xo=H.Geometry,Yo=H.PathFigure,Uo=H.PathSegment,jo=H.InputEvent,Go=H.DiagramEvent,qo=H.ChangedEvent,Ho=H.Model,dn=H.GraphLinksModel,Wo=H.TreeModel,$o=H.Binding,Jo=H.ThemeBinding,Zo=H.Transaction,Qo=H.UndoManager,_o=H.CommandHandler,tr=H.Tool,er=H.DraggingTool,ir=H.DraggingInfo,sr=H.DraggingOptions,nr=H.LinkingBaseTool,or=H.LinkingTool,rr=H.RelinkingTool,ar=H.LinkReshapingTool,hr=H.ResizingTool,lr=H.RotatingTool,ur=H.ClickSelectingTool,cr=H.ActionTool,dr=H.ClickCreatingTool,fr=H.HTMLInfo,gr=H.ContextMenuTool,mr=H.DragSelectingTool,pr=H.PanningTool,yr=H.TextEditingTool,xr=H.ToolManager,xs=H.Animation,br=H.AnimationManager,wr=H.AnimationTrigger,vr=H.Layer,Ti=H.Diagram,kr=H.Palette,Pr=H.Overview,Sr=H.Brush,Mr=H.GraphObject,qe=H.Panel,Nr=H.RowColumnDefinition,yi=H.Shape,Li=H.TextBlock,fn=H.Picture,Cr=H.Part,bs=H.Adornment,ws=H.Node,vs=H.Link,gn=H.Placeholder,Ar=H.Layout,Tr=H.LayoutNetwork,Lr=H.LayoutVertex,Dr=H.LayoutEdge,Fr=H.GridLayout,Or=H.PanelLayout,Rr=H.CircularLayout,Er=H.CircularNetwork,Ir=H.CircularVertex,Br=H.CircularEdge,Vr=H.ForceDirectedLayout,zr=H.ForceDirectedNetwork,Kr=H.ForceDirectedVertex,Xr=H.ForceDirectedEdge,mn=H.LayeredDigraphLayout,Yr=H.LayeredDigraphNetwork,Ur=H.LayeredDigraphVertex,jr=H.LayeredDigraphEdge,Gr=H.TreeLayout,qr=H.TreeNetwork,Hr=H.TreeVertex,Wr=H.TreeEdge,$r=H.Themes,Jr=H.ThemeManager,Zr=H.Router,Qr=H.version,_r=H.AnimationStyle,pn=H.AutoScale,ta=H.Curve,ea=H.CycleMode,ia=H.Flip,sa=H.ImageStretch,na=H.LayoutConditions,oa=H.LinkAdjusting,ra=H.Orientation,aa=H.PortSpreading,yn=H.Routing,xn=H.ScrollMode,ha=H.CollapsePolicy,la=H.Sizing,ua=H.TriggerStart,bn=H.Stretch,ca=H.TextFormat,ks=H.TextOverflow,da=H.ViewboxStretch,Ps=H.Wrap,fa=H.BrushType,ga=H.ColorSpace,ma=H.GeometryStretch,pa=H.GeometryType,ya=H.SegmentType,xa=H.BindingMode,ba=H.ChangeType,wa=H.CircularArrangement,va=H.CircularDirection,ka=H.CircularNodeDiameterFormula,Pa=H.CircularSorting,Sa=H.GridAlignment,Ma=H.GridArrangement,Na=H.GridSorting,Ca=H.LayeredDigraphAggressive,Aa=H.LayeredDigraphAlign,Ta=H.LayeredDigraphCycleRemove,La=H.LayeredDigraphInit,Da=H.LayeredDigraphLayering,Fa=H.LayeredDigraphPack,Oa=H.TreeAlignment,Ra=H.TreeArrangement,Ea=H.TreeCompaction,Ia=H.TreeLayerStyle,Ba=H.TreePath,Va=H.TreeSorting,za=H.TreeStyle,Ka=H.GestureMode,Xa=H.LinkingDirection,Ya=H.ReshapingBehavior,Ua=H.TextEditingAccept,ja=H.TextEditingStarting,Ga=H.TextEditingState,wn=H.WheelMode;var eo=on`/** @license
|
|
51
|
-
* Copyright 2025 Esri
|
|
52
|
-
*
|
|
53
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
54
|
-
* you may not use this file except in compliance with the License.
|
|
55
|
-
* You may obtain a copy of the License at
|
|
56
|
-
*
|
|
57
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
58
|
-
*
|
|
59
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
60
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
61
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
62
|
-
* See the License for the specific language governing permissions and
|
|
63
|
-
* limitations under the License.
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
#filter-bar {
|
|
67
|
-
background-color: var(--calcite-color-foreground-1);
|
|
68
|
-
position: absolute;
|
|
69
|
-
top: 16px;
|
|
70
|
-
right: 196px;
|
|
71
|
-
z-index: 100;
|
|
72
|
-
box-shadow: var(--calcite-shadow-sm);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
#filteredViewButtonDiv {
|
|
76
|
-
padding: 8px 8px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
#filteredViewButtonLabel {
|
|
80
|
-
--calcite-label-margin-bottom: 0;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
#graph-navigation-bar {
|
|
84
|
-
background-color: var(--calcite-color-foreground-1);
|
|
85
|
-
position: absolute;
|
|
86
|
-
top: 16px;
|
|
87
|
-
right: 16px;
|
|
88
|
-
z-index: 100;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
#graph-navigation-controls {
|
|
92
|
-
position: absolute;
|
|
93
|
-
top: 0;
|
|
94
|
-
right: 0;
|
|
95
|
-
box-shadow: var(--calcite-shadow-sm);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.z-index-1 {
|
|
99
|
-
z-index: 1;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
#diagram-panel {
|
|
103
|
-
--calcite-panel-space: 0px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
#diagram-shell-panel {
|
|
107
|
-
--calcite-color-background: var(--calcite-color-foreground-1);
|
|
108
|
-
padding: 16px;
|
|
109
|
-
}`,io=15,so=15,no=10,xi=new pi(220,48),oo=1,ro=8,vn=new pi(48,48),ao=new pi(16,16),kn=new pi(153,17),ho='400 0.75rem "Avenir Next", Avenir, "Helvetica Neue", sans-serif',lo='500 0.75rem "Avenir Next", Avenir, "Helvetica Neue", sans-serif',uo="val(--calcite-color-background)",co=bi("--calcite-color-border-1"),Pn=bi("--calcite-color-foreground-1"),Di=bi("--calcite-color-text-1"),Sn=bi("--calcite-color-border-input"),fo=bi("--calcite-color-foreground-1"),Fi=1,Nn=.3,Ss=1,Cn=.2,go=1;function mo(X){let m=document.createElement("div");m.style.width="100%",m.style.height="100%",X.appendChild(m);let rt=new Ti(m,{click:Po,contentAlignment:Ne.Center,dragSelectingTool:null,hoverDelay:50,initialAutoScale:pn.Uniform,layout:new mn({columnSpacing:io,layerSpacing:so}),padding:no,scrollMode:xn.Infinite,"toolManager.hoverDelay":50,"toolManager.mouseWheelBehavior":wn.Zoom});rt.nodeTemplate=new ws("Auto",{click:So,movable:!1,opacity:Fi,toolTip:new bs("Auto",{isShadowed:!0,margin:new ys(12,16,6,16),padding:0,shadowBlur:16,shadowColor:To(Di,.05),shadowOffset:new cn(0,0)}).add(new qe("Vertical",{background:fo,margin:0}).add(new Li({margin:14,stroke:Di}).bind("text","title")))}).bind("text","title").add(new yi({desiredSize:xi,fill:Pn,geometryString:ko(xi.width,xi.height,ro,vn.width,!!Pn),height:xi.height,portId:"",stroke:co,strokeWidth:oo,width:xi.width})).add(new qe("Horizontal",{alignment:Ne.Left,stretch:bn.Horizontal}).add(new qe("Horizontal",{alignment:Ne.Left,desiredSize:vn,margin:1}).add(new qe("Horizontal",{alignment:Ne.Center,margin:16}).add(new fn({desiredSize:ao}).bind("source","",dt=>un(dt.itemType,dt.itemTypeKeywords)))),new qe("Horizontal",{alignment:Ne.Right,margin:new ys(4,8,0,8)}).add(new qe("Vertical",{}).add(new Li({alignment:Ne.Left,desiredSize:kn,font:lo,overflow:ks.Ellipsis,stroke:Di,wrap:Ps.None}).bind("text","title"),new Li({alignment:Ne.Left,desiredSize:kn,font:ho,overflow:ks.Ellipsis,stroke:Di,wrap:Ps.None}).bind("text","itemTypeForDisplay"))))),rt.commandHandler.zoomFactor=1.05,rt.setDivBackground(uo);let yt=rt.toolManager.clickSelectingTool;yt.standardMouseSelect=function(){};let kt=rt.toolManager.draggingTool;return kt.isEnabled=!1,rt.linkTemplate=new vs({corner:5,movable:!1,routing:yn.Orthogonal,selectable:!1}).add(new yi({opacity:Ss,stroke:Sn}),new yi({fill:Sn,opacity:Ss,stroke:null,toArrow:"Standard"})),rt}function He(X,m){X.model=new dn(m.nodes,m.links,{linkFromPortIdProperty:"fromPort",linkToPortIdProperty:"toPort"})}function po(X,m,rt,yt=!0){if(yt){let q=Mo(X,rt);q.addEventListener("calciteSwitchChange",()=>document.dispatchEvent(new CustomEvent("filteredViewChanged",{detail:q.checked})))}let{resetButton:kt,centerButton:dt,zoomInButton:gt,zoomOutButton:St}=No(X,rt);kt.addEventListener("click",()=>Ao(m)),dt.addEventListener("click",()=>m.zoomToFit()),gt.addEventListener("click",()=>m.commandHandler.increaseZoom()),St.addEventListener("click",()=>m.commandHandler.decreaseZoom())}function yo(X,m,rt){let yt=mo(X);return He(yt,m),po(X,yt,rt),yt}function An(X){let m=new Set,rt=new Set;function yt(dt){dt.findLinksInto().each(gt=>{rt.add(gt);let St=gt.fromNode;St&&!m.has(St)&&(m.add(St),yt(St))})}yt(X);function kt(dt){dt.findLinksOutOf().each(gt=>{rt.add(gt);let St=gt.toNode;St&&!m.has(St)&&(m.add(St),kt(St))})}return kt(X),{connectedNodes:m,connectedLinks:rt}}function xo(X,m=!1,rt){let yt=[],kt=X.map(gt=>{if(gt.type!=="Group"){let St=vo(gt);return wo(gt,St,m,rt)}else{yt.push(gt.id);return}}).filter(gt=>gt!==void 0),dt=[];return kt.forEach(gt=>{(X.find(q=>q.id===gt.itemId)?.dependencies||[]).forEach(q=>{let Jt=kt.find(V=>V?.itemId===q);Jt&&dt.push({from:Jt.key,fromSpot:Ne.AllSides,to:gt.key,toSpot:Ne.AllSides})})}),{nodes:kt,links:dt,groupPseudoNodes:yt}}function bo(X,m,rt,yt=!0){let kt=X.diagram;if(!kt)return;let dt={};if(yt){for(let gt of kt.nodes)dt[gt.key]=gt===X?Fi:Nn;for(let gt of kt.links){let St=`${gt.fromNode?.key}-${gt.toNode?.key}`;dt[St]=Cn}{let{connectedNodes:gt,connectedLinks:St}=An(X);for(let q of gt)dt[q.key]=Fi;for(let q of St){let Jt=`${q.fromNode?.key}-${q.toNode?.key}`;dt[Jt]=go}}}if(rt&&(rt.adornedObject=X),yt){let gt=new xs;gt.duration=1;for(let St of kt.nodes)gt.add(St,"opacity",St.opacity,dt[St.key]);for(let St of kt.links){let q=`${St.fromNode?.key}-${St.toNode?.key}`;gt.add(St,"opacity",St.opacity,dt[q])}gt.start()}}function Mn(X,m,rt,yt,kt=!0){if(X.length===0)return;let dt=m[0].diagram;if(!dt)return;let gt={};if(kt){for(let St of dt.nodes){let q=X.includes(St.key);gt[St.key]=!rt||q?Fi:Nn}for(let St of dt.links){let q=`${St.fromNode?.key}-${St.toNode?.key}`;gt[q]=rt?Cn:Ss}}if(Object.keys(yt).forEach(St=>{yt[St].adornedObject=null}),kt){let St=new xs;St.duration=1;for(let q of dt.nodes)St.add(q,"opacity",q.opacity,gt[q.key]);for(let q of dt.links){let Jt=`${q.fromNode?.key}-${q.toNode?.key}`;St.add(q,"opacity",q.opacity,gt[Jt])}St.start()}}function wo(X,m,rt=!1,yt){return{key:m,title:X.title,itemId:X.id,itemType:X.type,itemTypeForDisplay:Co(X.type,X.typeKeywords),itemTypeKeywords:X.typeKeywords,group:X.type,url:rt?`${yt}?id=${X.id}`:void 0}}function vo(X){return X.id}function ko(X,m,rt,yt=0,kt=!1){let dt="";kt&&(dt+="F");let gt=X-2*rt,St=m-2*rt;return dt+=" M0 0",dt+=` h${gt}`,dt+=` a${rt} ${rt} 0 0 1 ${rt} ${rt}`,dt+=` v${St}`,dt+=` a${rt} ${rt} 0 0 1 ${-rt} ${rt}`,dt+=` h${-gt}`,dt+=` a${rt} ${rt} 0 0 1 ${-rt} ${-rt}`,dt+=` v${-St}`,dt+=` a${rt} ${rt} 0 0 1 ${rt} ${-rt}`,yt>0&&(dt+=` M${yt-rt} 0 v${m}`),dt}function Po(){document.dispatchEvent(new CustomEvent("clickInDiagram"))}function So(X,m){let rt=m.part;rt instanceof ws&&(rt.selectionAdorned=!1,document.dispatchEvent(new CustomEvent("clickOnNode",{detail:rt})))}function Mo(X,m){let rt=document.createElement("calcite-switch");rt.id="filteredViewButton",rt.label=m.filteredView;let yt=document.createElement("calcite-label");yt.id="filteredViewButtonLabel",yt.setAttribute("layout","inline"),yt.innerHTML=m.filteredView,yt.appendChild(rt);let kt=document.createElement("div");kt.id="filteredViewButtonDiv",kt.appendChild(yt);let dt=document.createElement("calcite-action-bar");dt.id="filter-bar-controls",dt.layout="horizontal",dt.expandDisabled=!0,dt.appendChild(kt);let gt=document.createElement("div");return gt.id="filter-bar",X.appendChild(gt),gt.appendChild(dt),rt}function No(X,m){let rt=document.createElement("calcite-action");rt.icon="reset",rt.id="showHideGrayedOutButton";let yt=document.createElement("calcite-tooltip");yt.id="resetButtonTooltip",yt.innerHTML=m.reset,yt.overlayPositioning="fixed",yt.placement="bottom",yt.referenceElement=rt.id;let kt=document.createElement("calcite-action");kt.icon="zoom-to-object",kt.id="centerButton";let dt=document.createElement("calcite-tooltip");dt.id="centerButtonTooltip",dt.innerHTML=m.centerDiagram,dt.overlayPositioning="fixed",dt.placement="bottom",dt.referenceElement=kt.id;let gt=document.createElement("calcite-action");gt.icon="plus",gt.id="zoomInButton";let St=document.createElement("calcite-tooltip");St.id="zoomInButtonTooltip",St.innerHTML=m.zoomIn,St.overlayPositioning="fixed",St.placement="bottom",St.referenceElement=gt.id;let q=document.createElement("calcite-action");q.appearance="solid",q.icon="minus",q.id="zoomOutButton";let Jt=document.createElement("calcite-tooltip");Jt.id="zoomOutButtonTooltip",Jt.innerHTML=m.zoomOut,Jt.overlayPositioning="fixed",Jt.placement="bottom",Jt.referenceElement=q.id;let V=document.createElement("calcite-action-bar");V.id="graph-navigation-controls",V.layout="horizontal",V.expandDisabled=!0,V.appendChild(rt),V.appendChild(yt),V.appendChild(kt),V.appendChild(dt),V.appendChild(gt),V.appendChild(St),V.appendChild(q),V.appendChild(Jt);let We=document.createElement("div");return We.id="graph-navigation-bar",X.appendChild(We),We.appendChild(V),{resetButton:rt,centerButton:kt,zoomInButton:gt,zoomOutButton:q}}function Co(X,m){let rt=X;if(X==="Feature Service"){let yt=m.indexOf("View Service")>-1,kt=m.indexOf("Table")>-1;rt=yt&&kt?"Table (hosted, view)":kt?"Table (hosted)":yt?"Feature Layer (hosted, view)":"Feature Layer (hosted)"}return X==="Web Mapping Application"&&(rt=m.indexOf("configurableApp")>-1?"Instant App":rt),rt=X==="Geoprocessing Service"?"Tool":rt,rt=X==="Feed"?"Feed (hosted)":rt,rt=X==="Real Time Analytic"?"Real Time Analytic (hosted)":rt,rt=X==="Big Data Analytic"?"Big Data Analytic (hosted)":rt,rt=X==="Vector Tile Service"?"Tile Layer":rt,rt}function Ao(X){X.zoomToFit(),document.dispatchEvent(new CustomEvent("reset"))}function bi(X){let m=document.body;return getComputedStyle(m).getPropertyValue(X).trim()}function To(X,m){if(X=X.replace(/^#/,""),X.length===3&&(X=X.split("").map(dt=>dt+dt).join("")),X.length!==6)throw new Error("Invalid hex color");let rt=parseInt(X.slice(0,2),16),yt=parseInt(X.slice(2,4),16),kt=parseInt(X.slice(4,6),16);return`rgba(${rt}, ${yt}, ${kt}, ${m})`}var Lo=8,Do=15,Fo=Ro("--calcite-color-brand"),Oo=4;function Ro(X){let m=document.documentElement;return getComputedStyle(m).getPropertyValue(X).trim()}var Ms=class{constructor(m,rt,yt,kt){this.indexPanel=m,this.diagramPanel=rt,this.diagramTranslations=yt,this.diagramKey=kt,this.currentSelectedGroupId="",this.currentSelectedItemId="",this.diagramNeedsRedraw=!1,this.usefilteredView=!1,this.handle_clickInDiagram=dt=>{dt.stopImmediatePropagation(),(this.currentSelectedGroupId||this.currentSelectedItemId)&&(this.currentSelectedGroupId="",this.currentSelectedItemId="",this.diagramNeedsRedraw=this.usefilteredView,this.redraw())},this.handle_clickOnNode=dt=>{dt.stopImmediatePropagation();let gt=dt.detail.data.key;this.redraw(gt,gt===this.currentSelectedItemId)},this.handle_filteredViewChanged=dt=>{this.usefilteredView=dt.detail,this.diagramNeedsRedraw=!!this.currentSelectedGroupId||!!this.currentSelectedItemId,this.redraw(this.currentSelectedItemId||this.currentSelectedGroupId)},this.handle_reset=dt=>{dt.stopImmediatePropagation(),this.reset()},this.handle_solutionItemSelect=dt=>{dt.stopImmediatePropagation();let gt=dt.detail.itemId;this.redraw(gt,gt===this.currentSelectedItemId||gt===this.currentSelectedGroupId,!1)},Ti.licenseKey===""&&(Ti.licenseKey=kt??"")}create(m,rt){this.collection=m,this.index=document.createElement("solution-item-accordion"),this.index.linkType="action",this.index.listSelectionMode="single",this.index.typeKeywords=rt,this.index.style.overflowY="auto",this.indexPanel.appendChild(this.index),this.index.templateInfos=m,this.allNodesAndLinks=xo(m),this.diagram=yo(this.diagramPanel,this.allNodesAndLinks,this.diagramTranslations),this.diagram.addDiagramListener("LayoutCompleted",()=>{setTimeout(()=>{this.diagram.zoomToFit()},1e3)}),vs.setRoutingParameter(44,600942),this.createNodeHighlighters(),document.addEventListener("clickInDiagram",this.handle_clickInDiagram),document.addEventListener("clickOnNode",this.handle_clickOnNode),document.addEventListener("filteredViewChanged",this.handle_filteredViewChanged),document.addEventListener("reset",this.handle_reset),this.index.addEventListener("solutionItemSelect",this.handle_solutionItemSelect)}dispose(){document.removeEventListener("clickInDiagram",this.handle_clickInDiagram),document.removeEventListener("clickOnNode",this.handle_clickOnNode),document.removeEventListener("filteredViewChanged",this.handle_filteredViewChanged),document.removeEventListener("reset",this.handle_reset),this.index.removeEventListener("solutionItemSelect",this.handle_solutionItemSelect),this.indexPanel.innerHTML="",this.diagramPanel.innerHTML=""}clearSelections(m=!0){this.index.deselectAll(),m&&this.index.collapseAll();let rt=this.getNodesFromDiagram(this.diagram),yt=rt.map(kt=>kt.data.key);Mn(yt,rt,!1,this.diagramNodeHighlighterIndex)}createNodeHighlighters(){this.diagramNodeIndex={},this.diagramNodeHighlighterIndex={},this.getNodesFromDiagram(this.diagram).forEach(rt=>{this.diagramNodeIndex[rt.data.key]=rt;let yt=new bs("Auto",{background:"transparent",margin:2});yt.add(new yi("RoundedRectangle",{fill:"transparent",parameter1:Lo,parameter2:Do,stroke:Fo,strokeWidth:Oo})),yt.add(new gn({margin:1})),this.diagramNodeHighlighterIndex[rt.data.key]=yt})}getNodeById(m){return this.diagramNodeIndex[m]}getNodesFromDiagram(m){let rt=[],yt=m.nodes.iterator;for(;yt.next();)rt.push(yt.value);return rt}redraw(m="",rt=!1,yt=!0){let kt=this.allNodesAndLinks.groupPseudoNodes.includes(m);this.diagramNeedsRedraw&&(He(this.diagram,this.allNodesAndLinks),this.createNodeHighlighters(),this.diagramNeedsRedraw=!1);let dt=!1;if(this.clearSelections(yt),!!m){if(kt){if(this.currentSelectedItemId="",this.currentSelectedGroupId!==m?this.currentSelectedGroupId=m:rt&&(this.currentSelectedGroupId=this.currentSelectedGroupId?"":m,dt=this.usefilteredView&&!this.currentSelectedGroupId),this.currentSelectedGroupId){this.usefilteredView&&(He(this.diagram,this.allNodesAndLinks),this.createNodeHighlighters());let gt=this.collection.filter(q=>q.id===m)[0],St=gt.dependencies.map(q=>this.diagramNodeIndex[q]);if(this.usefilteredView){let q=St.map(Jt=>Jt.data);He(this.diagram,{nodes:q,links:[]})}else Mn(gt.dependencies,St,!0,this.diagramNodeHighlighterIndex);this.index.selectItem(this.currentSelectedGroupId)}}else{this.currentSelectedGroupId="",this.currentSelectedItemId!==m?this.currentSelectedItemId=m:rt&&(this.currentSelectedItemId=this.currentSelectedItemId?"":m,dt=this.usefilteredView&&!this.currentSelectedItemId);let gt=this.getNodeById(m);if((!gt||this.usefilteredView)&&(He(this.diagram,this.allNodesAndLinks),this.createNodeHighlighters(),gt=this.getNodeById(m),!gt))return;if(this.currentSelectedItemId){if(this.usefilteredView){let St=An(gt);St.connectedNodes.add(gt);let q=Array.from(St.connectedNodes).map(V=>V.data),Jt=Array.from(St.connectedLinks).map(V=>V.data);if(He(this.diagram,{nodes:q,links:Jt}),this.createNodeHighlighters(),gt=this.getNodeById(m),!gt)return}gt&&setTimeout(()=>bo(gt,!0,this.diagramNodeHighlighterIndex[m]),1),this.index.selectItem(this.currentSelectedItemId)}}dt&&this.reset()}}reset(){this.diagramNeedsRedraw=!1,this.currentSelectedGroupId="",this.currentSelectedItemId="",He(this.diagram,this.allNodesAndLinks),this.createNodeHighlighters(),this.clearSelections()}},Ns=class extends an{constructor(){super(...arguments),this.diagramKey="",this.templateInfoGraph=[],this.typeKeywords=[],this._diagramPanel=ms(),this._diagramShell=ms(),this._translations=ln({name:"solution-item-diagram",blocking:!0})}static{this.properties={diagramKey:1,templateInfoGraph:[0,{},{attribute:!1}],typeKeywords:[0,{},{attribute:!1}],_diagramPanel:[16,{},{state:!0}],_diagramShell:[16,{},{state:!0}],_translations:[16,{},{state:!0}]}}static{this.styles=eo}updated(){if(this.solutionDisplay&&(this.solutionDisplay.dispose(),this.solutionDisplay=void 0),this.templateInfoGraph.length>0){let m={centerDiagram:this._translations.graphTranslations.centerDiagram,filteredView:this._translations.graphTranslations.filteredView,reset:this._translations.graphTranslations.reset,zoomIn:this._translations.graphTranslations.zoomIn,zoomOut:this._translations.graphTranslations.zoomOut};this.solutionDisplay=new Ms(this._diagramShell.value,this._diagramPanel.value,m,this.diagramKey),this.solutionDisplay.create(this.templateInfoGraph,this.typeKeywords)}requestAnimationFrame(()=>this._preventDiagramScrollbars())}disconnectedCallback(){super.disconnectedCallback(),this.solutionDisplay&&(this.solutionDisplay.dispose(),this.solutionDisplay=void 0)}render(){return rn`<calcite-shell><calcite-shell-panel id=diagram-shell-panel slot=panel-start ${ps(this._diagramShell)}></calcite-shell-panel><calcite-panel class="z-index-1" id=diagram-panel slot=panel-bottom ${ps(this._diagramPanel)}></calcite-panel></calcite-shell>`}_preventDiagramScrollbars(){if(!this._diagramPanel.value)return;let m=this._diagramPanel.value.shadowRoot;if(!m)return;let rt=m.querySelector(".content-wrapper");rt instanceof HTMLElement&&(rt.style.overflow="hidden")}};hn("solution-item-diagram",Ns);export{Ns as SolutionItemDiagram};
|
|
50
|
+
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),t+e}fw(t){super.fw(t),t.nodeParentKeyProperty&&(this.nodeParentKeyProperty=t.nodeParentKeyProperty)}uw(t){t.nodeParentKeyProperty!==void 0&&t.nodeParentKeyProperty!==this.nodeParentKeyProperty&&m.o("applyIncrementalJson cannot change Model properties"),super.uw(t)}maybeEnsureLinkReference(t){return t}get nodeParentKeyProperty(){return this.Vn}set nodeParentKeyProperty(t){let e=this.Vn;e!==t&&(this.En(t,Be,"nodeParentKeyProperty"),this.Vn=t,this.t("nodeParentKeyProperty",e,t))}get copiesParentKeyOfNodeData(){return this.Fg}set copiesParentKeyOfNodeData(t){this.Fg!==t&&(m.s(t,"boolean",Be,"copiesParentKeyOfNodeData"),this.Fg=t)}getParentKeyForNodeData(t){if(t===null)return;let e=this.Vn;if(e==="")return;let i=this.St(t,e);if(i!==void 0){if(this.isKeyType(i))return i;m.o("ParentKey value for node data "+t+" is not a number or a string: "+i)}}setParentKeyForNodeData(t,e){if(e===null&&(e=void 0),e!==void 0&&!this.isKeyType(e)&&m.si(e,"number or string",Be,"setParentKeyForNodeData:key"),t===null)return;let i=this.Vn;if(i==="")return;if(e=this.maybeEnsureLinkReference(e),!this.containsNodeData(t)){this.et(t,i,e);return}let s=this.St(t,i);s!==e&&(this.ln(s,t),this.et(t,i,e),this.findNodeDataForKey(e)===null&&this.an(e,t),this.Ft("nodeParentKey",2,i,t,s,e),typeof i=="string"&&this.updateTargetBindings(t,i))}get parentLinkCategoryProperty(){return this.cc}set parentLinkCategoryProperty(t){let e=this.cc;e!==t&&(this.En(t,Be,"parentLinkCategoryProperty"),this.cc=t,this.t("parentLinkCategoryProperty",e,t))}get linkCategoryProperty(){return this.parentLinkCategoryProperty}set linkCategoryProperty(t){this.parentLinkCategoryProperty=t}getParentLinkCategoryForNodeData(t){if(t===null)return"";let e=this.cc;if(e==="")return"";let i=this.St(t,e);if(i===void 0)return"";if(typeof i=="string")return i;m.o("getParentLinkCategoryForNodeData found a non-string category for "+t+": "+i)}getLinkCategoryForData(t){return this.getParentLinkCategoryForNodeData(t)}setParentLinkCategoryForNodeData(t,e){if(m.s(e,"string",Be,"setParentLinkCategoryForNodeData:cat"),t===null)return;let i=this.cc;if(i==="")return;if(!this.containsNodeData(t)){this.et(t,i,e);return}let s=this.St(t,i);s===void 0&&(s=""),s!==e&&(this.et(t,i,e),this.Ft("parentLinkCategory",2,i,t,s,e),typeof i=="string"&&this.updateTargetBindings(t,i))}setLinkCategoryForData(t,e){this.setParentLinkCategoryForNodeData(t,e)}copyNodeData(t){let e=super.copyNodeData(t);return!this.copiesParentKeyOfNodeData&&this.Vn!==""&&this.St(e,this.Vn)!==void 0&&this.et(e,this.Vn,void 0),e}setDataProperty(t,e,i){if(this.containsNodeData(t)){if(e===this.nodeKeyProperty){this.setKeyForNodeData(t,i);return}else if(e===this.nodeCategoryProperty){this.setCategoryForNodeData(t,i);return}else if(e===this.nodeParentKeyProperty){this.setParentKeyForNodeData(t,i);return}else if(e===this.parentLinkCategoryProperty){this.setParentLinkCategoryForNodeData(t,i);return}}let s=this.St(t,e);s!==i&&(this.et(t,e,i),this.raiseDataChanged(t,e,s,i))}dw(t,e){super.dw(t,e);let i=this.be.iterator;for(;i.next();){let s=i.value;this.aL(s,t,e)}}aL(t,e,i){if(this.getParentKeyForNodeData(t)===e){let s=this.Vn;this.et(t,s,i),this.Ft("nodeParentKey",2,s,t,e,i),typeof s=="string"&&this.updateTargetBindings(t,s)}}Tg(t){super.Tg(t);let e=this.getKeyForNodeData(t),i=this.lw(e);if(i!==null){let s=m.nt(),n=i.iterator;for(;n.next();){let o=n.value;if(this.containsNodeData(o)&&this.getParentKeyForNodeData(o)===e){let r=this.Vn;this.Ft("nodeParentKey",2,r,o,e,e),typeof r=="string"&&this.updateTargetBindings(o,r),s.push(o)}}for(let o=0;o<s.length;o++)this.ln(e,s[o]);m.Z(s)}}Dg(t){super.Dg(t);let e=this.getParentKeyForNodeData(t);e=this.maybeEnsureLinkReference(e),this.findNodeDataForKey(e)===null&&this.an(e,t)}gw(t){super.gw(t);let e=this.getParentKeyForNodeData(t);this.ln(e,t)}Ag(t,e){super.Ag(t,e),this.setParentLinkCategoryForNodeData(e,this.getParentLinkCategoryForNodeData(t)),this.setParentKeyForNodeData(e,this.getParentKeyForNodeData(t))}get type(){return"TreeModel"}Vm(){return!0}Ax(){return!0}}ut.Sl(Be,"TreeModel");var ts=(x=>(x[x.ConstantSpacing=0]="ConstantSpacing",x[x.ConstantDistance=1]="ConstantDistance",x[x.ConstantAngle=2]="ConstantAngle",x[x.Packed=3]="Packed",x))(ts||{}),es=(x=>(x[x.Clockwise=10]="Clockwise",x[x.Counterclockwise=11]="Counterclockwise",x[x.BidirectionalLeft=12]="BidirectionalLeft",x[x.BidirectionalRight=13]="BidirectionalRight",x))(es||{}),is=(x=>(x[x.Forwards=20]="Forwards",x[x.Reverse=21]="Reverse",x[x.Ascending=22]="Ascending",x[x.Descending=23]="Descending",x[x.Optimized=24]="Optimized",x))(is||{}),ss=(x=>(x[x.Pythagorean=30]="Pythagorean",x[x.Circular=31]="Circular",x))(ss||{});class Ve extends _t{gi;_f;Uk;Rg;Vk;Ya;hL;cL;fL;Is;mw;pw;fc;yw;iF;Og;Ig;Eg;tu;He;P;Si;Mi;In;Ug;constructor(t){super(),this.gi=0,this._f=0,this.Uk=0,this.Rg=360,this.Vk=0,this.Ya=0,this.hL=new P,this.cL=30,this.fL=0,this.Is=0,this.mw=0,this.pw=new Hs,this.fc=0,this.yw=0,this.iF=600,this.Og=NaN,this.Ig=1,this.Eg=0,this.tu=360,this.He=0,this.P=10,this.Si=24,this.Mi=Ie.standardComparer,this.In=6,this.Ug=30,t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Og=this.Og,t.Ig=this.Ig,t.Eg=this.Eg,t.tu=this.tu,t.He=this.He,t.P=this.P,t.Si=this.Si,t.Mi=this.Mi,t.In=this.In,t.Ug=this.Ug}fe(t){t in is?this.sorting=t:t in es?this.direction=t:t in ts?this.arrangement=t:t in ss?this.nodeDiameterFormula=t:super.fe(t)}createNetwork(){return new Ws(this)}d3(t,e,i){t=this.g3(t);let s=this.Vk,n=this.cL,o=this.gi,r=this._f,a=this.Uk,h=this.Rg,l=this.Ya,u=this.fL,c=this.Is,d=this.mw;if(s=this.arrangement,n=this.nodeDiameterFormula,o=this.radius,(!isFinite(o)||o<=0)&&(o=NaN),r=this.aspectRatio,(!isFinite(r)||r<=0)&&(r=1),a=this.startAngle,isFinite(a)||(a=0),h=this.sweepAngle,(!isFinite(h)||h>360||h<1)&&(h=360),l=this.spacing,isFinite(l)||(l=NaN),s===3&&n===31?s=0:s===3&&n!==31&&(n=31,s=this.arrangement),(this.direction===12||this.direction===13)&&this.sorting!==24){for(let g=0;!(g>=t.length||(e.add(t.elt(g)),g+1>=t.length));g+=2)i.add(t.elt(g+1));this.direction===12?(this.arrangement===3&&e.reverse(),t=new q,t.addAll(e),t.addAll(i)):(this.arrangement===3&&i.reverse(),t=new q,t.addAll(i),t.addAll(e))}let f=t.length;u=0;let p=0;for(let g=0;g<t.length;g++){let y=a+h*p*(this.direction===10?1:-1)/f,b=t.elt(g).diameter;isNaN(b)&&(b=t.elt(g).Ka(y)),h<360&&(g===0||g===t.length-1)&&(b/=2),u+=b,p++}if(isNaN(o)||s===3){if(isNaN(l)&&(l=6),s!==0&&s!==3){let g=-1/0;for(let y=0;y<f;y++){let b=t.elt(y),v=t.elt(y===f-1?0:y+1);isNaN(b.diameter)&&b.Ka(0),isNaN(v.diameter)&&v.Ka(0),g=Math.max(g,(b.diameter+v.diameter)/2)}if(d=g+l,s===2){let y=2*Math.PI/f,b=(g+l)/y;r>1?(o=b,c=o*r):(c=b,o=c)}else o=this.Bk(d*(h>=360?f:f-1),r,a*Math.PI/180,h*Math.PI/180)}else o=this.Bk(u+(h>=360?f:f-1)*(s!==3?l:l*1.6),r,a*Math.PI/180,h*Math.PI/180);c=o*r}else{c=o*r;let g=this.uL(o,c,a*Math.PI/180,h*Math.PI/180);if(isNaN(l))s===0&&(l=(g-u)/(h>=360?f:f-1));else if(s===0){let y=(g-u)/(h>=360?f:f-1);y<l?(o=this.Bk(u+l*(h>=360?f:f-1),r,a*Math.PI/180,h*Math.PI/180),c=o*r):l=y}else{let y=-1/0;for(let w=0;w<f;w++){let k=t.elt(w),S=t.elt(w===f-1?0:w+1);isNaN(k.diameter)&&k.Ka(0),isNaN(S.diameter)&&S.Ka(0),y=Math.max(y,(k.diameter+S.diameter)/2)}let b=y+l,v=this.Bk(b*(h>=360?f:f-1),r,a*Math.PI/180,h*Math.PI/180);v>o?(o=v,c=o*r,d=b):d=g/(h>=360?f:f-1)}}return this.Vk=s,this.cL=n,this.gi=o,this._f=r,this.Uk=a,this.Rg=h,this.Ya=l,this.fL=u,this.Is=c,this.mw=d,t}doLayout(t){this.network===null&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);let e=this.network.vertexes;if(e.count<=1){if(e.count===1){let d=e.first();d.centerX=0,d.centerY=0}this.updateParts(),this.network=null,this.isValidLayout=!0;return}let i=new q;i.addAll(e.iterator);let s=new q,n=new q;i=this.d3(i,s,n);let o=this.Vk,r=this.gi,a=this.Uk,h=this.Rg,l=this.Ya,u=this.Is,c=this.mw;if((this.direction===12||this.direction===13)&&o===3)this.sF(i,h,a-h/2,10);else if(this.direction===12||this.direction===13){let d=0;switch(o){case 1:d=this.zk(r,u,a,c)*180/Math.PI;break;case 0:{let f=0,p=0,g=s.first();g!==null&&(f=g.Ka(Math.PI/2));let y=n.first();y!==null&&(p=y.Ka(Math.PI/2)),d=this.zk(r,u,a,l+(f+p)/2)*180/Math.PI;break}case 2:d=h/i.length;break}if(this.direction===12){switch(o){case 1:this.ww(s,h/2,a,11);break;case 0:this.xw(s,h/2,a,11);break;case 2:this.bw(s,h/2,a,11);break}switch(o){case 1:this.ww(n,h/2,a+d,10);break;case 0:this.xw(n,h/2,a+d,10);break;case 2:this.bw(n,h/2,a+d,10);break}}else{switch(o){case 1:this.ww(n,h/2,a,11);break;case 0:this.xw(n,h/2,a,11);break;case 2:this.bw(n,h/2,a,11);break}switch(o){case 1:this.ww(s,h/2,a+d,10);break;case 0:this.xw(s,h/2,a+d,10);break;case 2:this.bw(s,h/2,a+d,10);break}}}else switch(o){case 1:this.ww(i,h,a,this.direction);break;case 0:this.xw(i,h,a,this.direction);break;case 2:this.bw(i,h,a,this.direction);break;case 3:this.sF(i,h,a,this.direction);break}this.updateParts(),this.network=null,this.isValidLayout=!0}bw(t,e,i,s){let n=this.Rg,o=this.gi,r=this.Is,a=i*Math.PI/180,h=e*Math.PI/180,l=t.length;for(let u=0;u<l;u++){let c=a+(s===10?u*h/(n>=360?l:l-1):-(u*h)/l),d=t.elt(u),f=o*Math.tan(c)/r,p=Math.sqrt((o*o+r*r*f*f)/(1+f*f));d.centerX=p*Math.cos(c),d.centerY=p*Math.sin(c),d.actualAngle=c*180/Math.PI}}xw(t,e,i,s){let n=this.gi,o=this.Is,r=this.Ya,a=i*Math.PI/180,h=t.length;for(let l=0;l<h;l++){let u=t.elt(l),c=t.elt(l===h-1?0:l+1),d=n*Math.cos(a),f=o*Math.sin(a);u.centerX=d,u.centerY=f,u.actualAngle=a*180/Math.PI,isNaN(u.diameter)&&u.Ka(0),isNaN(c.diameter)&&c.Ka(0);let p=(u.diameter+c.diameter)/2,g=this.zk(n,o,s===10?a:-a,p+r);a+=s===10?g:-g}}ww(t,e,i,s){let n=this.gi,o=this.Is,r=this.mw,a=i*Math.PI/180,h=t.length;for(let l=0;l<h;l++){let u=t.elt(l);u.centerX=n*Math.cos(a),u.centerY=o*Math.sin(a),u.actualAngle=a*180/Math.PI;let c=this.zk(n,o,s===10?a:-a,r);a+=s===10?c:-c}}sF(t,e,i,s){let n=this.yw,o=this.Rg;if(this.fc=0,this.pw=new Hs,e<360){for(n=i+(s===10?o:-o);n<0;)n+=360;n%=360,n>180&&(n-=360),n*=Math.PI/180,this.yw=n,this.nF(t,e,i,s)}else this.oF(t,e,i,s);this.pw.commit(t)}oF(t,e,i,s){let n=this.gi,o=this.Is,r=this.Ya,a=this._f,h=n*Math.cos(i*Math.PI/180),l=o*Math.sin(i*Math.PI/180),u=t.toArray();if(u.length===3){u[0].centerX=n,u[0].centerY=0,u[1].centerX=u[0].centerX-u[0].width/2-u[1].width/2-r,u[1].y=u[0].y,u[2].centerX=(u[0].centerX+u[1].centerX)/2,u[2].y=u[0].y-u[2].height-r;return}else if(u.length===4){u[0].centerX=n,u[0].centerY=0,u[2].centerX=-u[0].centerX,u[2].centerY=u[0].centerY,u[1].centerX=0,u[1].y=Math.min(u[0].y,u[2].y)-u[1].height-r,u[3].centerX=0,u[3].y=Math.max(u[0].y+u[0].height+r,u[2].y+u[2].height+r);return}let c=P.l();for(let k=0;k<u.length&&(u[k].centerX=h,u[k].centerY=l,!(k>=u.length-1));k++)this.rF(h,l,u,k,s,c)||this.lF(h,l,u,k,s,c),h=c.x,l=c.y;if(P.i(c),this.fc++,this.fc>23)return;let d=u[0].centerX,f=u[0].centerY,p=u[u.length-1].centerX,g=u[u.length-1].centerY,y=Math.abs(d-p)-((u[0].width+u[u.length-1].width)/2+r),b=Math.abs(f-g)-((u[0].height+u[u.length-1].height)/2+r),v=0;if(Math.abs(b)<1){let k=Math.abs(d-p),S=(u[0].width+u[u.length-1].width)/2;k<S&&(v=0),y=k-S}else b>0?v=b:Math.abs(y)<1?v=0:v=y;let w=!1;Math.abs(p)>Math.abs(g)?w=p>0!=f>g:w=g>0!=d<p,w=s===10?w:!w,w&&(v=-Math.abs(v),v=Math.min(v,-u[u.length-1].width),v=Math.min(v,-u[u.length-1].height)),this.pw.m3(v,u),Math.abs(v)>1&&(this.fc<8?this.gi-=v/(2*Math.PI):u.length<5&&v>10?this.gi/=2:this.gi-=v>0?1.7:-2.3,this.Is=this.gi*a,this.oF(t,e,i,s))}nF(t,e,i,s){let n=this.gi,o=this.Is,r=this._f,a=n*Math.cos(i*Math.PI/180),h=o*Math.sin(i*Math.PI/180),l=P.l(),u=t.toArray();for(let p=0;p<u.length&&(u[p].centerX=a,u[p].centerY=h,!(p>=u.length-1));p++)this.rF(a,h,u,p,s,l)||this.lF(a,h,u,p,s,l),a=l.x,h=l.y;if(P.i(l),this.fc++,this.fc>23)return;let c=Math.atan2(h,a),d=s===10?this.yw-c:c-this.yw;d=Math.abs(d)<Math.abs(d-2*Math.PI)?d:d-2*Math.PI;let f=d*(n+o)/2;this.pw.p3(f,u),Math.abs(f)>1&&(this.fc<8?this.gi-=f/(2*Math.PI):this.gi-=f>0?1.7:-2.3,this.Is=this.gi*r,this.nF(t,e,i,s))}rF(t,e,i,s,n,o){let r=this.Ya,a=this.gi,h=this.Is,l=0,u=0,c=(i[s].width+i[s+1].width)/2+r,d=!1;if(e>=0!=(n===10)){if(l=t+c,l>a){if(l=t-c,l<-a)return o.x=l,o.y=u,!1;d=!0}}else if(l=t-c,l<-a){if(l=t+c,l>a)return o.x=l,o.y=u,!1;d=!0}return u=Math.sqrt(1-Math.min(1,l*l/(a*a)))*h,e<0!==d&&(u=-u),Math.abs(e-u)>(i[s].height+i[s+1].height)/2?(o.x=l,o.y=u,!1):(o.x=l,o.y=u,!0)}lF(t,e,i,s,n,o){let r=this.Ya,a=this.gi,h=this.Is,l=0,u=0,c=(i[s].height+i[s+1].height)/2+r,d=!1;if(t>=0!=(n===10)){if(u=e-c,u<-h){if(u=e+c,u>h)return o.x=l,o.y=u,!1;d=!0}}else if(u=e+c,u>h){if(u=e-c,u<-h)return o.x=l,o.y=u,!1;d=!0}return l=Math.sqrt(1-Math.min(1,u*u/(h*h)))*a,t<0!==d&&(l=-l),Math.abs(t-l)>(i[s].width+i[s+1].width)/2?(o.x=l,o.y=u,!1):(o.x=l,o.y=u,!0)}commitLayout(){this.commitNodes(),this.isRouting&&this.commitLinks()}commitNodes(){let t=this.group!==null&&this.group.hasPlaceholder(),e=t?this.group.location.copy():null,i=this.actualCenter;if(t?i=new P(0,0):(i.x=this.arrangementOrigin.x+this.gi,i.y=this.arrangementOrigin.y+this.Is),this.network!==null){let s=this.network.vertexes.iterator;for(;s.next();){let n=s.value;n.x+=i.x,n.y+=i.y,n.commit()}}if(t&&this.group&&e){this.group.ensureBounds();let s=this.group.position.copy(),n=this.group.location.copy(),o=e.subtract(n.subtract(s));this.group.move(o),this.hL=o.subtract(s)}}commitLinks(){if(this.network!==null){let t=this.network.edges.iterator;for(;t.next();)t.value.commit()}}uL(t,e,i,s){let n=this.iF;if(Math.abs(this._f-1)<.001)return i!==void 0&&s!==void 0?s*t:2*Math.PI*t;let o=t>e?Math.sqrt(t*t-e*e)/t:Math.sqrt(e*e-t*t)/e,r=0,a=0;i!==void 0&&s!==void 0?a=s/(n+1):a=Math.PI/(2*(n+1));let h=0;for(let l=0;l<=n;l++){i!==void 0&&s!==void 0?h=i+l*s/n:h=l*Math.PI/(2*n);let u=Math.sin(h);r+=Math.sqrt(1-o*o*u*u)*a}return i!==void 0&&s!==void 0?(t>e?t:e)*r:4*(t>e?t:e)*r}Bk(t,e,i,s){let n=0;return i!==void 0&&s!==void 0?n=this.uL(1,e,i,s):n=this.uL(1,e),t/n}zk(t,e,i,s){if(Math.abs(this._f-1)<.001)return s/t;let n=t>e?Math.sqrt(t*t-e*e)/t:Math.sqrt(e*e-t*t)/e,o=0,r=2*Math.PI/(this.network.vertexes.count*700);t>e&&(i+=Math.PI/2);for(let a=0;;a++){let h=i+a*r,l=Math.sin(h);if(o+=(t>e?t:e)*Math.sqrt(1-n*n*l*l)*r,o>=s)return a*r}}g3(t){switch(this.sorting){case 20:break;case 21:t.reverse();break;case 22:t.sort(this.comparer);break;case 23:t.sort(this.comparer),t.reverse();break;case 24:return this.y3(this.w3(t));default:m.o("Invalid sorting type.")}return t}w3(t){let e=[];for(let s=0;s<t.length;s++)e.push(0);let i=new q;for(let s=0;s<t.length;s++){let n=-1,o=-1;if(s===0)for(let u=0;u<t.length;u++){let c=t.elt(u).edgesCount;c>n&&(n=c,o=u)}else for(let u=0;u<t.length;u++){let c=e[u];c>n&&(n=c,o=u)}i.add(t.elt(o)),e[o]=-1;let r=t.elt(o),a=0,h=r.sourceEdges;for(;h.next();){let u=h.value.fromVertex;a=t.indexOf(u),!(a<0)&&e[a]>=0&&e[a]++}let l=r.destinationEdges;for(;l.next();){let u=l.value.toVertex;a=t.indexOf(u),!(a<0)&&e[a]>=0&&e[a]++}}return i}y3(t){let e=[];for(let c=0;c<t.length;c++){let d=t.elt(c);e[c]=[];let f=0,p=d.destinationEdges;for(;p.next();){let y=p.value.toVertex;f=t.indexOf(y),f!==c&&e[c].indexOf(f)<0&&e[c].push(f)}let g=d.sourceEdges;for(;g.next();){let y=g.value.fromVertex;f=t.indexOf(y),f!==c&&e[c].indexOf(f)<0&&e[c].push(f)}}let i=[];for(let c=0;c<e.length;c++)i[c]=0;let s=[],n=[],o=[],r=[],a=new q,h=0;for(let c=0;c<e.length;c++){let d=e[c].length;if(d===1){r.push(c);continue}if(d===0){a.add(t.elt(c));continue}if(h===0){s.push(c),h++;continue}let f=1/0,p=1/0,g=-1,y=[];for(let b=0;b<s.length;b++)e[s[b]].indexOf(s[b===s.length-1?0:b+1])<0&&y.push(b===s.length-1?0:b+1);if(y.length===0)for(let b=0;b<s.length;b++)y.push(b);for(let b=0;b<y.length;b++){let v=y[b],w=this.x3(e[c],n,o,i,v,s),k=0;for(let S=0;S<e[c].length;S++){let N=e[c][S],D=s.indexOf(N);if(D>=0){let L=Math.abs(v-(D>=v?D+1:D));k+=L<s.length+1-L?L:s.length+1-L}}for(let S=0;S<n.length;S++){let N=i[n[S]],D=i[o[S]];if(N>=v&&N++,D>=v&&D++,N>D){let L=D;D=N,N=L}D-N<(s.length+2)/2==(N<v&&v<=D)&&k++}(w<f||w===f&&k<p)&&(f=w,p=k,g=v)}s.splice(g,0,c);for(let b=0;b<s.length;b++)i[s[b]]=b;for(let b=0;b<e[c].length;b++){let v=e[c][b];s.indexOf(v)>=0&&(n.push(c),o.push(v))}h++}let l=!1,u=s.length;for(;;){l=!0;for(let c=0;c<r.length;c++){let d=r[c],f=e[d][0],p=s.indexOf(f);if(p>=0){let g=0;for(let y=0;y<e[f].length;y++){let b=e[f][y],v=s.indexOf(b);if(v<0||v===p)continue;let w=v>p?v-p:p-v,k=u-w;g+=v<p!=w>k?1:-1}s.splice(g<0?p:p+1,0,d),r.splice(c,1),c--}else l=!1}if(l)break;s.push(r[0]),r.splice(0,1)}for(let c=0;c<s.length;c++){let d=s[c];a.add(t.elt(d))}return a}x3(t,e,i,s,n,o){let r=0;for(let a=0;a<e.length;a++){let h=e[a],l=i[a],u=s[h],c=s[l],d=0,f=0;if(u<c?(d=u,f=c):(d=c,f=u),d<n&&n<=f)for(let p=0;p<t.length;p++){let g=t[p];o.indexOf(g)<0||d<s[g]&&s[g]<f||d===s[g]||f===s[g]||r++}else for(let p=0;p<t.length;p++){let g=t[p];o.indexOf(g)<0||!(d<s[g]&&s[g]<f)||d===s[g]||f===s[g]||r++}}return r}get radius(){return this.Og}set radius(t){this.Og!==t&&(m.s(t,"number",Ve,"radius"),(t>0||isNaN(t))&&(this.Og=t,this.p()))}get aspectRatio(){return this.Ig}set aspectRatio(t){this.Ig!==t&&(m.s(t,"number",Ve,"aspectRatio"),t>0&&(this.Ig=t,this.p()))}get startAngle(){return this.Eg}set startAngle(t){this.Eg!==t&&(m.s(t,"number",Ve,"startAngle"),this.Eg=t,this.p())}get sweepAngle(){return this.tu}set sweepAngle(t){this.tu!==t&&(m.s(t,"number",Ve,"sweepAngle"),t>0&&t<=360?this.tu=t:this.tu=360,this.p())}get arrangement(){return this.He}set arrangement(t){this.He!==t&&(t===3||t===0||t===1||t===2)&&(this.He=t,this.p())}get direction(){return this.P}set direction(t){this.P!==t&&(t===10||t===11||t===12||t===13)&&(this.P=t,this.p())}get sorting(){return this.Si}set sorting(t){this.Si!==t&&(this.Si=t,this.p())}get comparer(){return this.Mi}set comparer(t){this.Mi!==t&&(m.S(t,Ve,"comparer"),this.Mi=t,this.p())}get spacing(){return this.In}set spacing(t){this.In!==t&&(m.s(t,"number",Ve,"spacing"),this.In=t,this.p())}get nodeDiameterFormula(){return this.Ug}set nodeDiameterFormula(t){this.Ug!==t&&(t===30||t===31)&&(this.Ug=t,this.p())}get actualXRadius(){return this.gi}get actualYRadius(){return this.Is}get actualSpacing(){return this.Ya}get actualCenter(){return this.hL}static ConstantSpacing=0;static ConstantDistance=1;static ConstantAngle=2;static Packed=3;static Clockwise=10;static Counterclockwise=11;static BidirectionalLeft=12;static BidirectionalRight=13;static Forwards=20;static Reverse=21;static Ascending=22;static Descending=23;static Optimized=24;static Pythagorean=30;static Circular=31}class Hs{eu;uc;iu;constructor(){this.eu=-1/0,this.uc=null,this.iu=null}m3(t,e){if(t>0&&this.eu<0||Math.abs(t)<Math.abs(this.eu)&&!(t<0&&this.eu>0)){this.eu=t,this.uc=[],this.iu=[];for(let i=0;i<e.length;i++)this.uc[i]=e[i].bounds.x,this.iu[i]=e[i].bounds.y}}p3(t,e){if(Math.abs(t)<Math.abs(this.eu)){this.eu=t,this.uc=[],this.iu=[];for(let i=0;i<e.length;i++)this.uc[i]=e[i].bounds.x,this.iu[i]=e[i].bounds.y}}commit(t){if(!(this.uc===null||this.iu===null))for(let e=0;e<this.uc.length;e++){let i=t.elt(e);i.x=this.uc[e],i.y=this.iu[e]}}}class Ws extends Ee{constructor(t){super(t)}createVertex(){return new di(this)}createEdge(){return new $s(this)}}class di extends Ie{Ao;Xk;constructor(t){super(t),this.Ao=NaN,this.Xk=NaN}Ka(t){let e=this.network;if(e===null)return NaN;let i=e.layout;if(i===null)return NaN;if(i.arrangement===3){if(i.nodeDiameterFormula===31)return this.Ao=Math.max(this.width,this.height),this.Ao;{let s=Math.abs(Math.sin(t)),n=Math.abs(Math.cos(t));return s===0?this.width:n===0?this.height:(this.Ao=Math.min(this.height/s,this.width/n),this.Ao)}}else return i.nodeDiameterFormula===31?(this.Ao=Math.max(this.width,this.height),this.Ao):(this.Ao=Math.sqrt(this.width*this.width+this.height*this.height),this.Ao)}get diameter(){return this.Ao}set diameter(t){this.Ao!==t&&(m.s(t,"number",di,"diameter"),this.Ao=t)}get actualAngle(){return this.Xk}set actualAngle(t){this.Xk!==t&&(m.s(t,"number",di,"actualAngle"),this.Xk=t)}}class $s extends ei{constructor(t){super(t)}}class ee extends _t{kw;Ha;Es;Vg;Bn;zi;Bg;zg;Xg;su;Gg;Yg;nu;ou;ru;lu;Kg;Hg;au;dc;constructor(t){super(),this.kw=0,this.Ha=0,this.Es=new st(100,100).k(),this.Vg=!1,this.Bn=!0,this.zi=!1,this.Bg=100,this.zg=300,this.Xg=1,this.su=1e3,this.Gg=10,this.Yg=Math,this.nu=.05,this.ou=50,this.ru=150,this.lu=0,this.Kg=10,this.Hg=5,this.au=NaN,this.dc=10,t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Es.h(this.Es),t.Vg=this.Vg,t.Bn=this.Bn,t.zi=this.zi,t.Bg=this.Bg,t.zg=this.zg,t.Xg=this.Xg,t.su=this.su,t.Gg=this.Gg,t.Yg=this.Yg,t.nu=this.nu,t.ou=this.ou,t.ru=this.ru,t.lu=this.lu,t.Kg=this.Kg,t.Hg=this.Hg,t.au=this.au,t.dc=this.dc}createNetwork(){return new Js(this)}doLayout(t){this.network=this.makeNetwork(t);let e=this.network.vertexes.iterator,i=this.maxIterations;if(this.network.vertexes.count>0){for(this.network.deleteSelfEdges(),e=this.network.vertexes.iterator;e.next();){let n=e.value;n.charge=this.electricalCharge(n),n.mass=this.gravitationalMass(n)}let s=this.network.edges.iterator;for(;s.next();){let n=s.value;n.stiffness=this.springStiffness(n),n.length=this.springLength(n)}if(this.dL(),this.Ha=0,this.needsPrelayout()){let n=this.network,o=n.splitIntoSubNetworks(!1),r=o.iterator;for(;r.next();){let a=r.value;this.doConnectedSubnetLayout(a)}for(r=o.iterator,this.b3(r,n),r=o.iterator;r.next();){let a=r.value,h=a.vertexes.iterator;for(;h.next();){let u=h.value;n.addVertex(u)}let l=a.edges.iterator;for(;l.next();){let u=l.value;n.addEdge(u)}}}else this.aF(this.network,this.maxIterations);this.updateParts()}this.maxIterations=i,this.isValidLayout=!0}needsPrelayout(){if(this.network===null||this.network.vertexes.count<3)return!1;let t=0,e=0,i=this.network.vertexes.first().bounds,s=this.network.vertexes.iterator;for(;s.next();){let n=s.value,o=n.bounds;if(isNaN(n.x)||isNaN(n.y)||o.intersectsRect(i)&&(t++,t>2))return!0;if(e>10)return!1;e++}return!1}doConnectedSubnetLayout(t){let e=t.vertexes.iterator;for(;e.next();){let a=e.value;a.hierarchicalVertexes.add(a)}let i=t,s=this.au;if(isNaN(s)&&(s=t.edges.count/t.vertexes.count),s<t.vertexes.count)for(;i.vertexes.count>Math.max(100,Math.sqrt(s*t.vertexes.count));)i=this.coarsenNetwork(i);let n=0;e=i.vertexes.iterator;let o=this.randomNumberGenerator;for(o===null&&(this.randomNumberGenerator=o=new Zs(0));e.next();){e.value.idInCluster=n++;let a=10*(o.random()-.5),h=10*(o.random()-.5);this.isFixed(e.value)||(e.value.x=a,e.value.y=h);let l=e.value.hierarchicalVertexes.iterator;for(;l.next();)this.isFixed(l.value)||(l.value.x=a,l.value.y=h)}let r=this.computePairwiseDistances(i);this.k3(i,r,this.maxPrelayoutIterations,t.vertexes.count),this.aF(t,this.maxIterations)}computePairwiseDistances(t){let e=t.vertexes.count,i=new Array(e);for(let r=0;r<e;r++)i[r]=new Array(e).fill(-1),i[r][r]=0;let s=t.vertexes.iterator,n=new Map,o=[];for(;s.next();){let r=s.value;for(o=[r],n=new Map,n.set(r.idInCluster,0);o.length>0;){let a=o.shift(),h=a.vertexes.iterator;for(;h.next();){let l=h.value;n.has(l.idInCluster)||(n.set(l.idInCluster,n.get(a.idInCluster)+1),o.push(l))}}for(let a=0;a<e;a++){let h=Math.min(i[r.idInCluster][a],i[a][r.idInCluster]),l=n.get(a);(h<0||l<h)&&(i[r.idInCluster][a]=l,i[a][r.idInCluster]=l)}}return i}coarsenNetwork(t){let e=this.createNetwork(),i=new Map,s=0,n=t.vertexes.iterator;for(;n.next();)n.value.idInCluster=s++;for(n=t.vertexes.iterator;n.next();){let r=n.value;if(i.has(r.idInCluster))continue;let a=Number.MAX_SAFE_INTEGER,h=null,l=r.vertexes.iterator;for(;l.next();){let c=l.value;i.has(c.idInCluster)||c.hierarchicalVertexes.length<a&&(a=c.hierarchicalVertexes.length,h=c)}let u=e.createVertex();u.hierarchicalVertexes.addAll(r.hierarchicalVertexes),h!=null&&u.hierarchicalVertexes.addAll(h.hierarchicalVertexes),i.set(r.idInCluster,u),h!=null&&i.set(h.idInCluster,u),e.addVertex(u)}let o=t.edges.iterator;for(;o.next();){let r=o.value,a=i.get(r.fromVertex.idInCluster),h=i.get(r.toVertex.idInCluster);if(a===h)continue;let l=e.createEdge();l.fromVertex=a||null,l.toVertex=h||null,e.addEdge(l)}return e}cx(t,e){let i=!0,s=t.vertexes.iterator;for(;s.next();){let n=s.value;i?(i=!1,e.set(n.bounds)):e.unionRect(n.bounds)}return e}b3(t,e){let i=this.arrangementSpacing,s=t.count,n=!0,o=0,r=0,a=m.nt();for(let c=0;c<s+e.vertexes.count+2;c++)a[c]=null;let h=0;t.reset();let l=I.l(),u;for(;t.next();){let c=t.value;if(this.cx(c,l),n)n=!1,o=l.x+l.width/2,r=l.y+l.height/2,a[0]=new P(l.x+l.width+i.width,l.y),a[1]=new P(l.x,l.y+l.height+i.height),h=2;else{let d=this.hF(a,h,o,r,l.width,l.height,i),f=a[d],p=new P(f.x+l.width+i.width,f.y),g=new P(f.x,f.y+l.height+i.height);d+1<h&&a.splice(d+1,0,null),a[d]=p,a[d+1]=g,h++;let y=f.x-l.x,b=f.y-l.y;for(u=c.vertexes.iterator;u.next();){let v=u.value;this.isFixed(v)||(v.centerX+=y,v.centerY+=b)}}}for(I.i(l),u=e.vertexes.iterator;u.next();){let c=u.value,d=c.bounds;if(h<2){o=d.x+d.width/2,r=d.y+d.height/2,a[0]=new P(d.x+d.width+i.width,d.y),a[1]=new P(d.x,d.y+d.height+i.height),h=2;continue}let f=this.hF(a,h,o,r,d.width,d.height,i),p=a[f],g=new P(p.x+d.width+i.width,p.y),y=new P(p.x,p.y+d.height+i.height);f+1<h&&a.splice(f+1,0,null),a[f]=g,a[f+1]=y,h++,this.isFixed(c)||(c.centerX=p.x+c.width/2,c.centerY=p.y+c.height/2)}m.Z(a)}hF(t,e,i,s,n,o,r){let a=9e19,h=-1;t:for(let l=0;l<e;l++){let u=t[l],c=u.x-i,d=u.y-s,f=c*c+d*d;if(f<a){for(let p=l-1;p>=0;p--)if(t[p].y>u.y&&t[p].x-u.x<n+r.width)continue t;for(let p=l+1;p<e;p++)if(t[p].x>u.x&&t[p].y-u.y<o+r.height)continue t;h=l,a=f}}return h}dL(){if(this.network===null||!this.comments)return;let t=this.network.vertexes.iterator;for(;t.next();){let e=t.value;this.addComments(e)}}addComments(t){if(this.network===null)return;let e=t.node;if(e!==null){let i=e.findNodesConnected();for(;i.next();){let s=i.value;if(s.category!=="Comment"||!s.isVisible())continue;let n=this.network.findVertex(s);n===null&&(n=this.network.addNode(s)),n.charge=this.defaultCommentElectricalCharge;let o=null,r=n.destinationEdges;for(;r.next();){let a=r.value;if(a.toVertex===t){o=a;break}}if(o===null){let a=n.sourceEdges;for(;a.next();){let h=a.value;if(h.fromVertex===t){o=h;break}}}o===null&&(o=this.network.linkVertexes(t,n,null)),o.length=this.defaultCommentSpringLength}}}cF(t,e){let i=t.bounds,s=i.x,n=i.y,o=i.width,r=i.height,a=e.bounds,h=a.x,l=a.y,u=a.width,c=a.height;if(s+o<h)if(n>l+c){let d=s+o-h,f=n-l-c;return C.ix(d*d+f*f)}else if(n+r<l){let d=s+o-h,f=n+r-l;return C.ix(d*d+f*f)}else return h-(s+o);else if(s>h+u)if(n>l+c){let d=s-h-u,f=n-l-c;return C.ix(d*d+f*f)}else if(n+r<l){let d=s-h-u,f=n+r-l;return C.ix(d*d+f*f)}else return s-(h+u);else return n>l+c?n-(l+c):n+r<l?l-(n+r):.1}aF(t,e){let i=this.Ha+e;for(;this.Ha<i&&(this.Ha++,!!this.P3(t)););}P3(t){let e=t.vertexes.toArray();if(e.length<=0)return!1;let i=e[0];i.forceX=0,i.forceY=0;let s=i.centerX,n=s,o=i.centerY,r=o;for(let p=1;p<e.length;p++){let g=e[p];g.forceX=0,g.forceY=0;let y=g.centerX,b=g.centerY;s=Math.min(s,y),n=Math.max(n,y),o=Math.min(o,b),r=Math.max(r,b)}let a=n-s>r-o;a?e.sort((p,g)=>p===null||g===null||p===g?0:p.centerX-g.centerX):e.sort((p,g)=>p===null||g===null||p===g?0:p.centerY-g.centerY);let h=this.su,l=0,u=0,c=0;for(let p=0;p<e.length;p++){let g=e[p],y=g.bounds,b=g.focus,v=y.x+b.x,w=y.y+b.y;u=g.charge*this.electricalFieldX(v,w),c=g.charge*this.electricalFieldY(v,w),u+=g.mass*this.gravitationalFieldX(v,w),c+=g.mass*this.gravitationalFieldY(v,w),g.forceX+=u,g.forceY+=c;for(let k=p+1;k<e.length;k++){let S=e[k];if(!this.shouldInteract(g,S)||k===p)continue;let N=S.bounds,D=S.focus,L=N.x+D.x,M=N.y+D.y;if(v-L>h||L-v>h){if(a)break;continue}if(w-M>h||M-w>h){if(!a)break;continue}let A=this.cF(g,S),F=2*g.charge,O=2*S.charge;if(A>1)l=F*O/(A*A),u=l*(v-L)/A,c=l*(w-M)/A;else{let E=this.randomNumberGenerator;E===null&&(this.randomNumberGenerator=E=new Zs(0));let B=E.random(),K=E.random();if(v>L)u=Math.abs(S.bounds.right-g.bounds.x),u=F*O*(1+u)*B;else if(v<L)u=Math.abs(S.bounds.x-g.bounds.right),u=-(F*O)*(1+u)*B;else{let z=Math.max(S.width,g.width);u=F*O*((1+z)*B-z/2)}if(w>M)c=Math.abs(S.bounds.bottom-g.bounds.y),c=F*O*(1+c)*K;else if(v<L)c=Math.abs(S.bounds.y-g.bounds.bottom),c=-(F*O)*(1+c)*K;else{let z=Math.max(S.height,g.height);c=F*O*((1+z)*K-z/2)}}g.forceX+=u,g.forceY+=c,S.forceX-=u,S.forceY-=c}}let d=t.edges.iterator;for(;d.next();){let p=d.value,g=p.fromVertex,y=p.toVertex,b=g.bounds,v=g.focus,w=b.x+v.x,k=b.y+v.y,S=y.bounds,N=y.focus,D=S.x+N.x,L=S.y+N.y,M=this.cF(g,y);M>1&&(l=.1*p.stiffness*(M-p.length),u=l*.5*(g.width+y.height)*(w-D)/M,c=l*.5*(g.width+y.height)*(k-L)/M),g.forceX-=u,g.forceY-=c,y.forceX+=u,y.forceY+=c}let f=0;for(let p=0;p<e.length;p++){let g=e[p];this.isFixed(g)?this.moveFixedVertex(g):f=Math.max(f,this.moveVertex(g)||0)}return f>this.epsilonDistance*this.epsilonDistance}k3(t,e,i,s){let n=this.Ha+i,o=Math.sqrt(s);this.kw=this.dc*t.vertexes.count;let r=t.vertexes.toArray(),a=0,h=0,l=0;for(;this.Ha<n;){this.Ha++,h=a,a=0;for(let u=0;u<r.length;u++){r[u].forceX=0,r[u].forceY=0;for(let d=0;d<r.length;d++){if(u===d)continue;let f=Math.sqrt((r[u].centerX-r[d].centerX)**2+(r[u].centerY-r[d].centerY)**2),p=e[r[u].idInCluster][r[d].idInCluster],g=(f-this.dc*o*p)/f;r[u].forceX+=g*(r[d].x-r[u].x),r[u].forceY+=g*(r[d].y-r[u].y)}let c=Math.sqrt(r[u].forceX*r[u].forceX+r[u].forceY*r[u].forceY);if(c>0){r[u].forceX=this.kw*r[u].forceX/c,r[u].forceY=this.kw*r[u].forceY/c,this.isFixed(r[u])||(r[u].x+=r[u].forceX,r[u].y+=r[u].forceY);let d=r[u].hierarchicalVertexes.iterator;for(;d.next();){let f=d.value;this.isFixed(f)||(f.centerX+=r[u].forceX,f.centerY+=r[u].forceY)}}a+=c*c}if(a>=h){if(l++,l>=5)break}else l=0;this.kw*=.95}}moveVertex(t){let e=t.forceX,i=t.forceY,s=this.moveLimit;return e<-s?e=-s:e>s&&(e=s),i<-s?i=-s:i>s&&(i=s),t.centerX+=e,t.centerY+=i,e*e+i*i}shouldInteract(t,e){return!0}moveFixedVertex(t){}commitLayout(){this.Pw(),this.commitNodes(),this.isRouting&&this.commitLinks()}Pw(){if(this.network===null||!this.setsPortSpots)return;let t=this.network.edges.iterator;for(;t.next();){let e=t.value.link;e!==null&&(e.fromSpot=T.Default,e.toSpot=T.Default)}}commitNodes(){if(!this.network)return;let t=0,e=0;if(this.arrangesToOrigin){let n=I.l();this.cx(this.network,n);let o=this.arrangementOrigin;t=o.x-n.x,e=o.y-n.y,I.i(n)}let i=I.l(),s=this.network.vertexes.iterator;for(;s.next();){let n=s.value;(t!==0||e!==0)&&(i.h(n.bounds),i.x+=t,i.y+=e,n.bounds=i),n.commit()}I.i(i)}commitLinks(){if(!this.network)return;let t=this.network.edges.iterator;for(;t.next();)t.value.commit()}springStiffness(t){let e=t.stiffness;return isNaN(e)?this.nu:e}springLength(t){let e=t.length;return isNaN(e)?this.ou:e}electricalCharge(t){let e=t.charge;return isNaN(e)?this.ru:e}electricalFieldX(t,e){return 0}electricalFieldY(t,e){return 0}gravitationalMass(t){let e=t.mass;return isNaN(e)?this.lu:e}gravitationalFieldX(t,e){return 0}gravitationalFieldY(t,e){return 0}isFixed(t){return t.isFixed}get currentIteration(){return this.Ha}get arrangementSpacing(){return this.Es}set arrangementSpacing(t){this.Es.equals(t)||(this.Es.h(t),this.p())}get arrangesToOrigin(){return this.Vg}set arrangesToOrigin(t){this.Vg!==t&&(m.s(t,"boolean",ee,"arrangesToOrigin"),this.Vg=t,this.p())}get setsPortSpots(){return this.Bn}set setsPortSpots(t){this.Bn!==t&&(m.s(t,"boolean",ee,"setsPortSpots"),this.Bn=t,this.p())}get comments(){return this.zi}set comments(t){this.zi!==t&&(m.s(t,"boolean",ee,"comments"),this.zi=t,this.p())}get maxPrelayoutIterations(){return this.Bg}set maxPrelayoutIterations(t){this.Bg!==t&&(m.s(t,"number",ee,"maxPrelayoutIterations"),t>=0&&(this.Bg=t,this.p()))}get maxIterations(){return this.zg}set maxIterations(t){this.zg!==t&&(m.s(t,"number",ee,"maxIterations"),t>=0&&(this.zg=t,this.p()))}get epsilonDistance(){return this.Xg}set epsilonDistance(t){this.Xg!==t&&(m.s(t,"number",ee,"epsilonDistance"),t>0&&(this.Xg=t,this.p()))}get infinityDistance(){return this.su}set infinityDistance(t){this.su!==t&&(m.s(t,"number",ee,"infinityDistance"),t>1&&(this.su=t,this.p()))}get moveLimit(){return this.Gg}set moveLimit(t){this.Gg!==t&&(m.s(t,"number",ee,"moveLimit"),this.Gg=t,this.p())}get randomNumberGenerator(){return this.Yg}set randomNumberGenerator(t){this.Yg!==t&&(t!==null&&!m.st(t.random)&&m.o('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+t),this.Yg=t)}get defaultSpringStiffness(){return this.nu}set defaultSpringStiffness(t){this.nu!==t&&(m.s(t,"number",ee,"defaultSpringStiffness"),this.nu=t,this.p())}get defaultSpringLength(){return this.ou}set defaultSpringLength(t){this.ou!==t&&(m.s(t,"number",ee,"defaultSpringLength"),this.ou=t,this.p())}get defaultElectricalCharge(){return this.ru}set defaultElectricalCharge(t){this.ru!==t&&(m.s(t,"number",ee,"defaultElectricalCharge"),this.ru=t,this.p())}get defaultGravitationalMass(){return this.lu}set defaultGravitationalMass(t){this.lu!==t&&(m.s(t,"number",ee,"defaultGravitationalMass"),this.lu=t,this.p())}get defaultCommentSpringLength(){return this.Kg}set defaultCommentSpringLength(t){this.Kg!==t&&(m.s(t,"number",ee,"defaultCommentSpringLength"),this.Kg=t,this.p())}get defaultCommentElectricalCharge(){return this.Hg}set defaultCommentElectricalCharge(t){this.Hg!==t&&(m.s(t,"number",ee,"defaultCommentElectricalCharge"),this.Hg=t,this.p())}get prelayoutQuality(){return this.au}set prelayoutQuality(t){this.au!==t&&(m.s(t,"number",ee,"prelayoutQuality"),this.au=t,this.p())}get prelayoutSpread(){return this.dc}set prelayoutSpread(t){this.dc!==t&&(m.s(t,"number",ee,"prelayoutSpread"),this.dc=t,this.p())}}class Js extends Ee{constructor(t){super(t)}createVertex(){return new ze(this)}createEdge(){return new fi(this)}}class ze extends Ie{Gk;Yk;Kk;Hk;qk;hierarchicalVertexes;idInCluster;constructor(t){super(t),this.Gk=!1,this.Yk=NaN,this.Kk=NaN,this.Hk=0,this.qk=0,this.hierarchicalVertexes=new q,this.idInCluster=-1}get isFixed(){return this.Gk}set isFixed(t){this.Gk!==t&&(m.s(t,"boolean",ze,"isFixed"),this.Gk=t)}get charge(){return this.Yk}set charge(t){this.Yk!==t&&(m.s(t,"number",ze,"charge"),this.Yk=t)}get mass(){return this.Kk}set mass(t){this.Kk!==t&&(m.s(t,"number",ze,"mass"),this.Kk=t)}get forceX(){return this.Hk}set forceX(t){this.Hk!==t&&(m.s(t,"number",ze,"forceX"),this.Hk=t)}get forceY(){return this.qk}set forceY(t){this.qk!==t&&(m.s(t,"number",ze,"forceY"),this.qk=t)}}class fi extends ei{jk;Wk;constructor(t){super(t),this.jk=NaN,this.Wk=NaN}get stiffness(){return this.jk}set stiffness(t){this.jk!==t&&(m.s(t,"number",fi,"stiffness"),this.jk=t)}get length(){return this.Wk}set length(t){this.Wk!==t&&(m.s(t,"number",fi,"length"),this.Wk=t)}}class Zs{I;R;Q;M;A;seed;constructor(t){t===void 0&&(t=42),this.seed=t,this.A=48271,this.M=2147483647,this.Q=this.M/this.A,this.R=this.M%this.A,this.I=1/this.M,this.random()}random(){let t=this.seed/this.Q,e=this.seed%this.Q,i=this.A*e-this.R*t;return i>0?this.seed=i:this.seed=i+this.M,this.seed*this.I}}var ns=(x=>(x[x.DepthFirst=0]="DepthFirst",x[x.Greedy=1]="Greedy",x[x.FromLayers=2]="FromLayers",x))(ns||{}),os=(x=>(x[x.OptimalLinkLength=10]="OptimalLinkLength",x[x.LongestPathSink=11]="LongestPathSink",x[x.LongestPathSource=12]="LongestPathSource",x))(os||{}),rs=(x=>(x[x.DepthFirstOut=20]="DepthFirstOut",x[x.DepthFirstIn=21]="DepthFirstIn",x[x.Naive=22]="Naive",x))(rs||{}),as=(x=>(x[x.None=30]="None",x[x.Less=31]="Less",x[x.More=32]="More",x))(as||{}),Qs=(x=>(x[x.None=0]="None",x[x.Expand=1]="Expand",x[x.Straighten=2]="Straighten",x[x.Median=4]="Median",x[x.MaybeExpand=8]="MaybeExpand",x[x.All=15]="All",x))(Qs||{}),_s=(x=>(x[x.None=0]="None",x[x.UpperLeft=1]="UpperLeft",x[x.UpperRight=2]="UpperRight",x[x.LowerLeft=4]="LowerLeft",x[x.LowerRight=8]="LowerRight",x[x.All=15]="All",x))(_s||{});class Ae extends _t{Us;ti;P;hu;cu;fu;gc;uu;hr;du;Bn;_;Sw;zt;qg;Vs;ie;Bs;ms;ps;Rt;jg;Wg;Jk;cn;gu;cr;zn;Xn;gL;qa;constructor(t){super(),this.Us=25,this.ti=25,this.P=0,this.hu=0,this.cu=10,this.fu=20,this.gc=4,this.uu=31,this.hr=15,this.du=10,this.Bn=!0,this._=-1,this.Sw=-1,this.zt=-1,this.qg=0,this.Vs=0,this.ie=new Int16Array(0),this.Bs=new Float32Array(0),this.ms=new Float32Array(0),this.ps=new Float32Array(0),this.Rt=new Float32Array(0),this.jg=0,this.Wg=new Int16Array(0),this.Jk=new Int16Array(0),this.cn=0,this.gu=null,this.cr=new P,this.zn=[],this.zn.length=100,this.Xn=15,this.gL=0,this.qa=!0,t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Us=this.Us,t.ti=this.ti,t.P=this.P,t.hu=this.hu,t.cu=this.cu,t.fu=this.fu,t.gc=this.gc,t.uu=this.uu,t.hr=this.hr,t.du=this.du,t.Bn=this.Bn,t.Xn=this.Xn,t.qa=this.qa}fe(t){t in as?this.aggressiveOption=t:t in ns?this.cycleRemoveOption=t:t in rs?this.initializeOption=t:t in os?this.layeringOption=t:super.fe(t)}createNetwork(){return new tn(this)}doLayout(t){this.network===null&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.S3(),this.network.vertexes.count>0&&(this.network.deleteSelfEdges(),this.cycleRemoveOption!==2&&this.removeCycles(),this.M3(),this.cycleRemoveOption===2&&this.removeCycles(),this.N3(),this.C3(),this.L3(),this.reduceCrossings(),this.straightenAndPack(),this.updateParts()),this.network=null,this.isValidLayout=!0}linkMinLength(t){return 1}linkLengthWeight(t){return 1}linkStraightenWeight(t){let e=t.fromVertex.node||t.fromVertex.data,i=t.toVertex.node||t.toVertex.data;return e===null&&i===null?8:e===null||i===null?4:1}nodeMinLayerSpace(t,e){return t.node===null&&t.data===null?0:this.P===90||this.P===270?e?t.focus.y+10:t.bounds.height-t.focus.y+10:e?t.focus.x+10:t.bounds.width-t.focus.x+10}nodeMinColumnSpace(t,e){if(t.node===null&&t.data===null)return 0;let i=e?t.$k:t.Zk;if(i!==null)return i;let s=this.P;return s===90||s===270?e?t.$k=t.focus.x/this.ti+1|0:t.Zk=(t.bounds.width-t.focus.x)/this.ti+1|0:e?t.$k=t.focus.y/this.ti+1|0:t.Zk=(t.bounds.height-t.focus.y)/this.ti+1|0}ei(){let t=this.network.vertexes.count;this.Wg.length<t*2&&(this.Wg=new Int16Array(t*2));let e=0,i=this.network.vertexes.iterator;for(;i.next();){let s=i.value;this.Wg[e]=s.column,e++,this.Wg[e]=s.index,e++}return this.Wg}ns(t){let e=0,i=this.network.vertexes.iterator;for(;i.next();){let s=i.value;s.column=t[e],e++,s.index=t[e],e++}}fF(t,e){let i=this.ja(t),s=this.ie[t];this.Jk.length<s*s&&(this.Jk=new Int16Array(s*s));let n=this.Jk;for(let o=0;o<s;o++){let r=0,a=i[o],h=a.near,l=0;h!==null&&h!==a&&h.layer===a.layer&&(r+=Math.max(0,Math.abs(h.index-a.index)-1));let u,c=0,d,f=0,p=0,g=0,y,b=0,v,w=0,k=0,S=0,N;if(e>=0){for(u=i[o].So,c=0;c<u.length;c++)if(d=u[c],d.valid&&d.fromVertex.layer!==t)for(f=d.fromVertex.index,p=d.portToPos,g=d.portFromPos,b=c+1;b<u.length;b++)v=u[b],v.valid&&v.fromVertex.layer!==t&&(w=v.fromVertex.index,k=v.portToPos,S=v.portFromPos,p<k&&(f>w||f===w&&g>S)&&r++,k<p&&(w>f||w===f&&S>g)&&r++)}if(e<=0){for(u=i[o].or,c=0;c<u.length;c++)if(d=u[c],d.valid&&d.toVertex.layer!==t)for(f=d.toVertex.index,p=d.portToPos,g=d.portFromPos,b=c+1;b<u.length;b++)v=u[b],v.valid&&v.toVertex.layer!==t&&(w=v.toVertex.index,k=v.portToPos,S=v.portFromPos,g<S&&(f>w||f===w&&p>k)&&r++,S<g&&(w>f||w===f&&k>p)&&r++)}for(n[o*s+o]=r,l=o+1;l<s;l++){let D=0,L=0;if(e>=0){for(y=i[o].So,N=i[l].So,c=0;c<y.length;c++)if(d=y[c],d.valid&&d.fromVertex.layer!==t)for(f=d.fromVertex.index,p=d.portToPos,g=d.portFromPos,b=0;b<N.length;b++)v=N[b],v.valid&&v.fromVertex.layer!==t&&(w=v.fromVertex.index,k=v.portToPos,S=v.portFromPos,(f<w||f===w&&g<S)&&L++,(w<f||w===f&&S<g)&&D++)}if(e<=0){for(y=i[o].or,N=i[l].or,c=0;c<y.length;c++)if(d=y[c],d.valid&&d.toVertex.layer!==t)for(f=d.toVertex.index,p=d.portToPos,g=d.portFromPos,b=0;b<N.length;b++)v=N[b],v.valid&&v.toVertex.layer!==t&&(w=v.toVertex.index,k=v.portToPos,S=v.portFromPos,(f<w||f===w&&p<k)&&L++,(w<f||w===f&&k<p)&&D++)}n[o*s+l]=D,n[l*s+o]=L}}return this.Wa(t,i),n}countCrossings(){let t=0;for(let e=0;e<=this._;e++){let i=this.fF(e,1),s=this.ie[e];for(let n=0;n<s;n++)for(let o=n;o<s;o++)t+=i[n*s+o]}return t}A3(t,e,i){let s=this.ja(t),n=this.ie[t],o=0;for(let r=0;r<n;r++){let a=null;e<=0&&(a=s[r].So);let h=null;e>=0&&(h=s[r].or);let l,u=0,c=0;if(a!==null)for(let d=0;d<a.length;d++)l=a[d],l.valid&&l.fromVertex.layer!==t&&(u=l.fromVertex.column+l.portFromColOffset,c=l.toVertex.column+l.portToColOffset,i?o+=Math.abs(u-c)*this.linkStraightenWeight(l):o+=Math.abs(u-c));if(h!==null)for(let d=0;d<h.length;d++)l=h[d],l.valid&&l.toVertex.layer!==t&&(u=l.fromVertex.column+l.portFromColOffset,c=l.toVertex.column+l.portToColOffset,i?o+=(Math.abs(u-c)+1)*this.linkStraightenWeight(l):o+=Math.abs(u-c))}return this.Wa(t,s),o}Qk(t){let e=0;for(let i=0;i<=this._;i++)e+=this.A3(i,1,t);return e}Mw(){let t=1/0;this.zt=-1;let e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;t=Math.min(t,i.column-this.nodeMinColumnSpace(i,!0)),this.zt=Math.max(this.zt,i.column+this.nodeMinColumnSpace(i,!1))}for(e.reset();e.next();){let i=e.value;i.column-=t}this.zt-=t}Nw(t,e){let i=this.ja(t),s=this.ie[t],n=new Float32Array(s);for(let o=0;o<s;o++){let r=i[o],a=null;e<=0&&(a=r.So);let h=null;e>=0&&(h=r.or);let l=0,u=0,c=r.near;c!==null&&c.layer===r.layer&&(l+=c.column-1,u++);let d;if(a!==null)for(let f=0;f<a.length;f++){d=a[f];let p=d.fromVertex;d.valid&&!d.rev&&p.layer!==t&&(l+=p.column,u++)}if(h!==null)for(let f=0;f<h.length;f++){d=h[f];let p=d.toVertex;d.valid&&!d.rev&&p.layer!==t&&(l+=p.column,u++)}u===0?n[o]=-1:n[o]=l/u}return this.Wa(t,i),n}uF(t,e){let i=this.ja(t),s=this.ie[t],n=new Int16Array(s);for(let o=0;o<s;o++){let r=i[o],a=null;e<=0&&(a=r.So);let h=null;e>=0&&(h=r.or);let l=0,u=[],c=r.near;c!==null&&c.layer===r.layer&&(u[l]=c.column-1,l++);let d;if(a!==null)for(let f=0;f<a.length;f++){d=a[f];let p=d.fromVertex;d.valid&&!d.rev&&p.layer!==t&&(u[l]=p.column+d.portFromColOffset,l++)}if(h!==null)for(let f=0;f<h.length;f++){d=h[f];let p=d.toVertex;d.valid&&!d.rev&&p.layer!==t&&(u[l]=p.column+d.portToColOffset,l++)}if(l===0)n[o]=-1;else{u.sort((p,g)=>p-g);let f=l>>1;(l&1)!==0?n[o]=u[f]:n[o]=u[f-1]+u[f]>>1}}return this.Wa(t,i),n}Cw(t,e,i,s,n){if(t.component===i){t.component=e;let o=0,r=0;if(s){let a=t.destinationEdges;for(;a.next();){let h=a.value,l=h.toVertex;o=t.layer-l.layer,r=this.linkMinLength(h),o===r&&this.Cw(l,e,i,s,n)}}if(n){let a=t.sourceEdges;for(;a.next();){let h=a.value,l=h.fromVertex;o=l.layer-t.layer,r=this.linkMinLength(h),o===r&&this.Cw(l,e,i,s,n)}}}}mL(t,e,i,s,n){if(t.component===i){if(t.component=e,s){let o=t.destinationEdges;for(;o.next();){let r=o.value.toVertex;this.mL(r,e,i,s,n)}}if(n){let o=t.sourceEdges;for(;o.next();){let r=o.value.fromVertex;this.mL(r,e,i,s,n)}}}}removeCycles(){let t=this.network.edges.iterator;for(;t.next();){let e=t.value;e.rev=!1}switch(this.hu){default:case 1:this.T3();break;case 0:this.D3();break;case 2:this.v3();break}}v3(){let t=this.network,e=t.vertexes.iterator,i=1/0;for(;e.next();){let s=e.value;i=Math.min(i,s.layer)}if(i<1/0){if(i<0)for(e.reset();e.next();){let r=e.value;r.layer-=i}let s=[];for(e.reset();e.next();){let r=e.value,a=s[r.layer];a===void 0?s[r.layer]=[r]:a.push(r)}let n=0;for(let r=0;r<s.length;r++){let a=s[r];if(!a||a.length===0)n++;else if(r>0)for(let h=0;h<a.length;h++){let l=a[h];l.layer-=n}}let o=t.edges.iterator;for(;o.next();){let r=o.value,a=r.fromVertex,h=r.toVertex;a.layer<h.layer&&(t.reverseEdge(r),r.rev=!0)}}}T3(){let t=this.network,e=0,i=t.vertexes.count-1,s=[];s.length=i+1;let n=t.vertexes.iterator;for(;n.next();){let r=n.value;r.ii=!0}for(;this.F3(t)!==null;){let r;for(r=this.dF(t);r!==null;)s[i]=r,i--,r.ii=!1,r=this.dF(t);for(r=this.gF(t);r!==null;)s[e]=r,e++,r.ii=!1,r=this.gF(t);r=this.R3(t),r!==null&&(s[e]=r,e++,r.ii=!1)}for(let r=0;r<t.vertexes.count;r++)s[r].index=r;let o=t.edges.iterator;for(;o.next();){let r=o.value,a=r.fromVertex,h=r.toVertex;a.index>h.index&&(t.reverseEdge(r),r.rev=!0)}}F3(t){let e=t.vertexes.iterator;for(;e.next();){let i=e.value;if(i.ii)return i}return null}dF(t){let e=t.vertexes.iterator;for(;e.next();){let i=e.value;if(i.ii){let s=!0,n=i.destinationEdges;for(;n.next();)if(n.value.toVertex.ii){s=!1;break}if(s)return i}}return null}gF(t){let e=t.vertexes.iterator;for(;e.next();){let i=e.value;if(i.ii){let s=!0,n=i.sourceEdges;for(;n.next();)if(n.value.fromVertex.ii){s=!1;break}if(s)return i}}return null}R3(t){let e=null,i=0,s=this.network.vertexes.iterator;for(;s.next();){let n=s.value;if(n.ii){let o=0,r=n.destinationEdges;for(;r.next();)r.value.toVertex.ii&&o++;let a=0,h=n.sourceEdges;for(;h.next();)h.value.fromVertex.ii&&a++;(e===null||i<o-a)&&(e=n,i=o-a)}}return e}D3(){let t=this.network.vertexes.iterator;for(;t.next();){let i=t.value;i.mu=-1,i._n=-1}let e=this.network.edges.iterator;for(;e.next();){let i=e.value;i.forest=!1}for(this.jg=0,t.reset();t.next();){let i=t.value;i.sourceEdges.count===0&&this.pL(i)}for(t.reset();t.next();){let i=t.value;i.mu===-1&&this.pL(i)}for(e.reset();e.next();){let i=e.value;if(!i.forest){let s=i.fromVertex,n=s.mu,o=s._n,r=i.toVertex,a=r.mu,h=r._n;a<n&&o<h&&(this.network.reverseEdge(i),i.rev=!0)}}}pL(t){t.mu=this.jg,this.jg++;let e=t.destinationEdges;for(;e.next();){let i=e.value,s=i.toVertex;s.mu===-1&&(i.forest=!0,this.pL(s))}t._n=this.jg,this.jg++}M3(){let t=this.network.vertexes.iterator;for(;t.next();){let s=t.value;s.layer=-1}for(this._=-1,this.assignLayers(),t.reset();t.next();){let s=t.value;this._=Math.max(this._,s.layer)}this._>=9999&&m.o("LayeredDigraphLayout, too many layers: "+this._);let e=this.direction==0||this.direction==180,i=[];for(let s=this.network.vertexes.iterator;s.next();){let n=s.value;if(n.node===null||n.centered)continue;let o=n.layer,r=i[o];r===void 0&&(r=0);let a=e?n.width:n.height;a>r&&(i[o]=a)}for(let s=this.network.vertexes.iterator;s.next();){let n=s.value;if(n.node===null||n.centered)continue;let o=i[n.layer];e?(n.focusX=o/2,n.focusY=n.focus.y,n.width=o):(n.focusX=n.focus.x,n.focusY=o/2,n.height=o)}}assignLayers(){switch(this.cu){case 11:this.mF();break;case 12:this.O3();break;default:case 10:this.I3();break}}mF(){let t=this.network.vertexes.iterator;for(;t.next();){let e=t.value,i=this.pF(e);this._=Math.max(i,this._)}}pF(t){let e=0;if(t.layer===-1){let i=t.destinationEdges;for(;i.next();){let s=i.value,n=s.toVertex,o=this.linkMinLength(s);e=Math.max(e,this.pF(n)+o)}t.layer=e}else e=t.layer;return e}O3(){let t=0,e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;t=this.yF(i),this._=Math.max(t,this._)}for(e.reset();e.next();){let i=e.value;i.layer=this._-i.layer}}yF(t){let e=0;if(t.layer===-1){let i=t.sourceEdges;for(;i.next();){let s=i.value,n=s.fromVertex,o=this.linkMinLength(s);e=Math.max(e,this.yF(n)+o)}t.layer=e}else e=t.layer;return e}I3(){this.mF();let t=this.network.vertexes.iterator;for(;t.next();){let i=t.value;i.ii=!1}for(t.reset();t.next();){let i=t.value;i.sourceEdges.count===0&&this.wF(i)}let e=1/0;for(t.reset();t.next();){let i=t.value;e=Math.min(e,i.layer)}for(this._=-1,t.reset();t.next();){let i=t.value;i.layer-=e,this._=Math.max(this._,i.layer)}}wF(t){if(!t.ii){t.ii=!0;let e=t.destinationEdges;for(;e.next();){let i=e.value.toVertex;this.wF(i)}this.E3(t),this.U3(t)}}E3(t){let e=this.network.vertexes.iterator;for(;e.next();){let r=e.value;r.component=-1}let i=0,s=1,n=t.So,o=n.length;for(let r=0;r<o;r++){let a=n[r],h=a.fromVertex,l=a.toVertex,u=this.linkMinLength(a);h.layer-l.layer>u&&this.Cw(h,i,-1,!0,!1)}for(this.Cw(t,s,-1,!0,!0);t.component!==i;){let r=0,a=1/0,h=0,l=null,u=this.network.vertexes.iterator;for(;u.next();){let c=u.value;if(c.component===s){let d=0,f=!1,p=c.So;o=p.length;for(let y=0;y<o;y++){let b=p[y],v=b.fromVertex;if(d+=this.linkLengthWeight(b),v.component!==s){r+=this.linkLengthWeight(b);let w=v.layer-c.layer,k=this.linkMinLength(b);a=Math.min(a,w-k)}}let g=c.or;o=g.length;for(let y=0;y<o;y++){let b=g[y],v=b.toVertex;d-=this.linkLengthWeight(b),v.component!==s?r-=this.linkLengthWeight(b):f=!0}(l===null||d<h)&&!f&&(l=c,h=d)}}if(r>0){for(e.reset();e.next();){let c=e.value;c.component===s&&(c.layer+=a)}t.component=i}else l.component=i}}U3(t){let e=this.network.vertexes.iterator;for(;e.next();){let n=e.value;n.component=-1}let i=0,s=1;for(this.Cw(t,s,-1,!0,!1);t.component!==i;){let n=0,o=1/0,r=0,a=null,h=this.network.vertexes.iterator;for(;h.next();){let l=h.value;if(l.component===s){let u=0,c=!1,d=l.So,f=d.length;for(let g=0;g<f;g++){let y=d[g],b=y.fromVertex;u+=this.linkLengthWeight(y),b.component!==s?n+=this.linkLengthWeight(y):c=!0}let p=l.or;f=p.length;for(let g=0;g<f;g++){let y=p[g],b=y.toVertex;if(u-=this.linkLengthWeight(y),b.component!==s){n-=this.linkLengthWeight(y);let v=l.layer-b.layer,w=this.linkMinLength(y);o=Math.min(o,v-w)}}(a===null||u>r)&&!c&&(a=l,r=u)}}if(n<0){for(e.reset();e.next();){let l=e.value;l.component===s&&(l.layer-=o)}t.component=i}else a.component=i}}N3(){let t=this.network,e=[],i=t.edges.iterator;for(;i.next();){let s=i.value;s.valid=!1,e.push(s)}for(let s=0;s<e.length;s++){let n=e[s],o=n.fromVertex,r=n.toVertex;if(n.valid||(o.node===null&&o.data===null||r.node===null&&r.data===null)&&o.layer===r.layer)continue;let a=0,h=0,l=0,u=0;if(n.link!==null){let S=n.link;if(S===null)continue;let N=o.node,D=r.node;if(N===null||D===null)continue;let L=S.fromNode,M=S.toNode,A=S.fromPort;for(;A!==null&&!A.isVisibleObject();)A=A.panel;let F=S.toPort;for(;F!==null&&!F.isVisibleObject();)F=F.panel;if(n.rev){let tt=L,nt=A;L=M,A=F,M=tt,F=nt}let O=o.focus,E=r.focus,B=n.rev?r.bounds:o.bounds,K=P.l();N!==L?B.isReal()&&L.isVisible()?L.actualBounds.isReal()?(L.getRelativePoint(A,T.Center,K),K.x+=L.actualBounds.x-B.x,K.y+=L.actualBounds.y-B.y):(L.getRelativePoint(A,T.Center,K),K.isReal()||K.h(O)):K.h(O):B.isReal()?(L.getRelativePoint(A,T.Center,K),K.isReal()||K.h(O)):K.h(O);let z=n.rev?o.bounds:r.bounds,U=P.l();D!==M?z.isReal()&&M.isVisible()?M.actualBounds.isReal()?(M.getRelativePoint(F,T.Center,U),U.x+=M.actualBounds.x-z.x,U.y+=M.actualBounds.y-z.y):(M.getRelativePoint(F,T.Center,U),U.isReal()||U.h(E)):U.h(E):z.isReal()?(M.getRelativePoint(F,T.Center,U),U.isReal()||U.h(E)):U.h(E),this.P===90||this.P===270?(a=Math.round((K.x-O.x)/this.ti),l=K.x,h=Math.round((U.x-E.x)/this.ti),u=U.x):(a=Math.round((K.y-O.y)/this.ti),l=K.y,h=Math.round((U.y-E.y)/this.ti),u=U.y),P.i(K),P.i(U),n.portFromColOffset=a,n.portFromPos=l,n.portToColOffset=h,n.portToPos=u}else n.portFromColOffset=0,n.portFromPos=0,n.portToColOffset=0,n.portToPos=0;let c=o.layer,d=r.layer,f=this.V3(n),p=f===1||f===3,g=f===2||f===3,y,b,v=null,w;g&&(v=this.B3(o,r),w=1,b=t.createVertex(),b.node=null,b._k=1,b.layer=c,b.near=o,t.addVertex(b),y=t.linkVertexes(o,b,n.link),y.valid=!1,y.rev=n.rev,y.portFromColOffset=a,y.portToColOffset=0,y.portFromPos=l,y.portToPos=0,o=b);let k=1;if(p&&k--,c-d>k&&c>0){for(n.valid=!1,b=t.createVertex(),b.node=null,b._k=2,b.layer=c-1,v&&w<v.length&&b.layer===v[w].layer&&(b.near=v[w++]),t.addVertex(b),y=t.linkVertexes(o,b,n.link),y.valid=!0,y.rev=n.rev,y.portFromColOffset=g?0:a,y.portToColOffset=0,y.portFromPos=g?0:l,y.portToPos=0,o=b,c--;c-d>k&&c>0;)b=t.createVertex(),b.node=null,b._k=3,b.layer=c-1,v&&w<v.length&&b.layer===v[w].layer&&(b.near=v[w++]),t.addVertex(b),y=t.linkVertexes(o,b,n.link),y.valid=!0,y.rev=n.rev,y.portFromColOffset=0,y.portToColOffset=0,y.portFromPos=0,y.portToPos=0,o=b,c--;y=t.linkVertexes(b,r,n.link),y.valid=!p,p&&(b.near=r),y.rev=n.rev,y.portFromColOffset=0,y.portToColOffset=h,y.portFromPos=0,y.portToPos=u}else n.valid=!0}}V3(t){let e=0,i=t.link;if(i!==null){let s=i.fromPort,n=i.toPort;if(s!==null&&n!==null){let o=i.fromNode,r=i.toNode;if(o!==null&&r!==null){let a=this.tP(!0),h=this.tP(!1),l=this.setsPortSpots?a:i.computeSpot(!0,s),u=this.setsPortSpots?h:i.computeSpot(!1,n),c=i.isOrthogonal;if(l.isSide()&&l.includesSide(h)&&u.isSide()&&u.includesSide(a))return 0;let d=i.getLinkPoint(o,s,l,!0,c,r,n,P.l()),f=i.getLinkDirection(o,s,d,l,!0,c,r,n);P.i(d),(!l.isNone()&&f===this.xF(t,!0)||this.setsPortSpots&&o!==null&&o.ports.count===1&&t.rev)&&(e+=1);let p=i.getLinkPoint(r,n,u,!1,c,o,s,P.l()),g=i.getLinkDirection(r,n,p,u,!1,c,o,s);P.i(p),(!u.isNone()&&g===this.xF(t,!1)||this.setsPortSpots&&r!==null&&r.ports.count===1&&t.rev)&&(e+=2)}}}return e}xF(t,e){return this.P===90?e&&!t.rev||!e&&t.rev?270:90:this.P===180?e&&!t.rev||!e&&t.rev?0:180:this.P===270?e&&!t.rev||!e&&t.rev?90:270:e&&!t.rev||!e&&t.rev?180:0}B3(t,e){let i=[];return i.push(e),this.bF(t,i)?i.reverse():[]}bF(t,e){let i=e[e.length-1].sourceEdges.iterator;for(;i.next();){let s=i.value;if(s.rev||!s.valid)continue;let n=s.fromVertex;if(e.push(n),n===t||this.bF(t,e))return!0;e.pop()}return!1}C3(){this.ie.length!==this._+1&&(this.ie=new Int16Array(this._+1));let t=this.ie;for(let i=0;i<=this._;i++)t[i]=0;let e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;i.index=-1}this.initializeIndices(),this.Sw=-1,this.qg=0,this.Vs=0;for(let i=0;i<=this._;i++)t[i]>t[this.Vs]&&(this.Sw=t[i]-1,this.Vs=i),t[i]<t[this.qg]&&(this.qg=i);this.gu=[];for(let i=0;i<t.length;i++)this.gu[i]=[];for(e.reset();e.next();){let i=e.value,s=i.layer,n=this.gu[s];n[i.index]=i}}initializeIndices(){switch(this.fu){default:case 22:this.z3();break;case 20:this.X3();break;case 21:this.G3();break}}z3(){let t=null,e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;if(i.near&&(t===null&&(t=new Map),i.layer===i.near.layer)){let s=t.get(i.near)||[];s.push(i),t.set(i.near,s)}}for(e.reset();e.next();){let i=e.value;if(i.near)continue;let s=i.layer;if(i.index=this.ie[s],this.ie[s]++,!t)continue;let n=t.get(i);Array.isArray(n)&&n.forEach(o=>{o.index=this.ie[s],this.ie[s]++})}}X3(){let t=null,e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;if(i.near&&(t===null&&(t=new Map),i.layer===i.near.layer)){let s=t.get(i.near)||[];s.push(i),t.set(i.near,s)}}for(let i=this._;i>=0;i--)for(e.reset();e.next();){let s=e.value;s.layer===i&&s.index===-1&&this.kF(s,t)}}kF(t,e){if(t.near)return;let i=t.layer;if(t.index=this.ie[i],this.ie[i]++,e){let o=e.get(t);Array.isArray(o)&&o.forEach(r=>{r.index=this.ie[i],this.ie[i]++})}let s=t.or,n=!0;for(;n;){n=!1;for(let o=0;o<s.length-1;o++){let r=s[o],a=s[o+1];r.portFromColOffset>a.portFromColOffset&&(n=!0,s[o]=a,s[o+1]=r)}}for(let o=0;o<s.length;o++){let r=s[o];if(r.valid){let a=r.toVertex;a.index===-1&&this.kF(a,e)}}}G3(){let t=null,e=this.network.vertexes.iterator;for(;e.next();){let i=e.value;if(i.near&&(t===null&&(t=new Map),i.layer===i.near.layer)){let s=t.get(i.near)||[];s.push(i),t.set(i.near,s)}}for(let i=0;i<=this._;i++)for(e.reset();e.next();){let s=e.value;s.layer===i&&s.index===-1&&this.PF(s,t)}}PF(t,e){if(t.near)return;let i=t.layer;if(t.index=this.ie[i],this.ie[i]++,e){let h=e.get(t);Array.isArray(h)&&h.forEach(l=>{l.index=this.ie[i],this.ie[i]++})}let s=t.So,n=!0,o=0;for(;n;)for(n=!1,o=0;o<s.length-1;o++){let h=s[o],l=s[o+1];h.portToColOffset>l.portToColOffset&&(n=!0,s[o]=l,s[o+1]=h)}let r,a;for(o=0;o<s.length;o++)a=s[o],a.valid&&(r=a.fromVertex,r.index===-1&&this.PF(r,e))}L3(){this.zt=-1;for(let t=0;t<=this._;t++){let e=this.ja(t),i=0,s=this.ie[t];for(let n=0;n<s;n++){let o=e[n];i+=this.nodeMinColumnSpace(o,!0),o.column=i,i+=1,i+=this.nodeMinColumnSpace(o,!1)}this.zt=Math.max(this.zt,i-1),this.Wa(t,e)}}reduceCrossings(){let t=this.countCrossings(),e=this.ei(),i=0,s=0,n=0;for(i=0;i<this.gc;i++){for(s=0;s<=this._;s++)this.eP(s,1),this.ys(s,1,!1,1);for(n=this.countCrossings(),n<t&&(t=n,e=this.ei()),s=this._;s>=0;s--)this.eP(s,-1),this.ys(s,-1,!1,-1);n=this.countCrossings(),n<t&&(t=n,e=this.ei())}for(this.ns(e),i=0;i<this.gc;i++){for(s=0;s<=this._;s++)this.eP(s,0),this.ys(s,0,!1,0);for(n=this.countCrossings(),n<t&&(t=n,e=this.ei()),s=this._;s>=0;s--)this.eP(s,0),this.ys(s,0,!1,0);n=this.countCrossings(),n<t&&(t=n,e=this.ei())}this.ns(e);let o=!1,r=0,a=0,h=0,l=0;switch(this.uu){case 30:break;case 32:for(h=t+1;(l=this.countCrossings())<h;)for(h=l,r=this._;r>=0;r--)for(a=0;a<=r;a++){for(o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,-1,!1,-1)||o;for(n=this.countCrossings(),n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,1,!1,1)||o;for(n=this.countCrossings(),n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,1,!1,1)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,-1,!1,-1)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,0,!1,0)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,0,!1,0)||o;n>=t?this.ns(e):(t=n,e=this.ei())}break;default:case 31:for(r=this._,a=0,h=t+1;(l=this.countCrossings())<h;){for(h=l,o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,-1,!1,-1)||o;for(n=this.countCrossings(),n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,1,!1,1)||o;for(n=this.countCrossings(),n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,1,!1,1)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,-1,!1,-1)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=r;s>=a;s--)o=this.ys(s,0,!1,0)||o;for(n>=t?this.ns(e):(t=n,e=this.ei()),o=!0;o;)for(o=!1,s=a;s<=r;s++)o=this.ys(s,0,!1,0)||o;n>=t?this.ns(e):(t=n,e=this.ei())}break}this.ns(e)}eP(t,e){let i=0,s=!1,n=this.ja(t),o=this.ie[t],r=this.uF(t,e),a=this.Nw(t,e);for(i=0;i<o;i++)a[i]===-1&&(a[i]=n[i].column),r[i]===-1&&(r[i]=n[i].column);let h=!0,l;for(;h;)for(h=!1,i=0;i<o-1;i++)if(r[i+1]<r[i]||r[i+1]===r[i]&&a[i+1]<a[i]){s=!0,h=!0;let c=r[i];r[i]=r[i+1],r[i+1]=c;let d=a[i];a[i]=a[i+1],a[i+1]=d,l=n[i],n[i]=n[i+1],n[i+1]=l}let u=0;for(i=0;i<o;i++)l=n[i],l.index=i,u+=this.nodeMinColumnSpace(l,!0),l.column=u,u+=1,u+=this.nodeMinColumnSpace(l,!1);return this.Wa(t,n),s}ys(t,e,i,s){let n=this.ja(t),o=this.ie[t],r=this.fF(t,e),a=0,h;if(!i||s>0)for(h=new Float32Array(o),a=0;a<o;a++)h[a]=-1;else h=this.Nw(t,-1);let l;if(!i||s<0)for(l=new Float32Array(o),a=0;a<o;a++)l[a]=-1;else l=this.Nw(t,1);let u=!1,c=!0;for(;c;)for(c=!1,a=0;a<o-1;a++){let d=r[n[a].index*o+n[a+1].index],f=r[n[a+1].index*o+n[a].index],p=0,g=0,y=n[a].column,b=n[a+1].column,v=this.nodeMinColumnSpace(n[a],!0),w=this.nodeMinColumnSpace(n[a],!1),k=this.nodeMinColumnSpace(n[a+1],!0),S=this.nodeMinColumnSpace(n[a+1],!1),N=y-v+k,D=b-w+S,L=0,M=0,A=0,F=0,O=0,E=0,B=0,K,z=0,U,tt=0,nt=n[a].sourceEdges.iterator;if(i&&s<=0)for(;nt.next();){let xt=nt.value;K=xt.fromVertex,xt.valid&&K.layer!==t&&(A=this.linkStraightenWeight(xt),F=xt.portFromColOffset,O=xt.portToColOffset,E=K.column,L+=(Math.abs(y+O-(E+F))+1)*A,M+=(Math.abs(D+O-(E+F))+1)*A)}for(nt.reset();nt.next();){let xt=nt.value;if(K=xt.fromVertex,xt.valid&&K.layer===t){for(z=0;z<n.length&&n[z]!==K;)z++;z<a&&(p+=2*(a-z),g+=2*(a+1-z)),z===a+1&&(p+=1),z>a+1&&(p+=4*(z-a),g+=4*(z-(a+1)))}}let Z=n[a].destinationEdges.iterator;if(i&&s>=0)for(;Z.next();){let xt=Z.value;U=xt.toVertex,xt.valid&&U.layer!==t&&(A=this.linkStraightenWeight(xt),F=xt.portFromColOffset,O=xt.portToColOffset,B=U.column,L+=(Math.abs(y+F-(B+O))+1)*A,M+=(Math.abs(D+F-(B+O))+1)*A)}for(Z.reset();Z.next();){let xt=Z.value;if(U=xt.toVertex,xt.valid&&U.layer===t){for(tt=0;tt<n.length&&n[tt]!==U;)tt++;tt===a+1&&(g+=1)}}let it=n[a+1].sourceEdges.iterator;if(i&&s<=0)for(;it.next();){let xt=it.value;K=xt.fromVertex,xt.valid&&K.layer!==t&&(A=this.linkStraightenWeight(xt),F=xt.portFromColOffset,O=xt.portToColOffset,E=K.column,L+=(Math.abs(b+O-(E+F))+1)*A,M+=(Math.abs(N+O-(E+F))+1)*A)}for(it.reset();it.next();){let xt=it.value;if(K=xt.fromVertex,xt.valid&&K.layer===t){for(z=0;z<n.length&&n[z]!==K;)z++;z<a&&(p+=2*(a+1-z),g+=2*(a-z)),z===a&&(g+=1),z>a+1&&(p+=4*(z-(a+1)),g+=4*(z-a))}}let _=n[a+1].destinationEdges.iterator;if(i&&s>=0)for(;_.next();){let xt=_.value;U=xt.toVertex,xt.valid&&U.layer!==t&&(A=this.linkStraightenWeight(xt),F=xt.portFromColOffset,O=xt.portToColOffset,B=U.column,L+=(Math.abs(b+F-(B+O))+1)*A,M+=(Math.abs(N+F-(B+O))+1)*A)}for(_.reset();_.next();){let xt=_.value;if(U=xt.toVertex,xt.valid&&U.layer===t){for(tt=0;tt<n.length&&n[tt]!==U;)tt++;tt===a&&(p+=1)}}let at=0,ct=0,yt=h[n[a].index],Ct=l[n[a].index],Q=h[n[a+1].index],St=l[n[a+1].index];if(yt!==-1&&(at+=Math.abs(yt-y),ct+=Math.abs(yt-D)),Ct!==-1&&(at+=Math.abs(Ct-y),ct+=Math.abs(Ct-D)),Q!==-1&&(at+=Math.abs(Q-b),ct+=Math.abs(Q-N)),St!==-1&&(at+=Math.abs(St-b),ct+=Math.abs(St-N)),g<p-.5||g===p&&f<d-.5||g===p&&f===d&&M<L-.5||g===p&&f===d&&M===L&&ct<at-.5){u=!0,c=!0,n[a].column=D,n[a+1].column=N;let xt=n[a];n[a]=n[a+1],n[a+1]=xt}}for(a=0;a<o;a++)n[a].index=a;return this.Wa(t,n),u}straightenAndPack(){if(this.Xn!==0){this.Y3();return}let t=0,e=!1,i=(this.hr&1)!==0,s=(this.hr&8)!==0;if(this.network.edges.count>1e3&&s&&(i=!1),i){let n=[],o=0;for(o=0;o<=this._;o++)n[o]=0;let r=0,a=this.network.vertexes.iterator;for(;a.next();){let l=a.value;t=l.layer,r=l.column;let u=this.nodeMinColumnSpace(l,!1);n[t]=Math.max(n[t],r+u)}let h=8;for(a.reset();a.next();){let l=a.value;t=l.layer,r=l.column,l.column=((this.zt-n[t])*h>>1)+r*h}this.zt*=h}if((this.hr&2)!==0){e=!0;let n=0;for(;e&&n<this.du;){for(e=!1,t=this.Vs+1;t<=this._;t++)e=this.Jg(t,1)||e;for(t=this.Vs-1;t>=0;t--)e=this.Jg(t,-1)||e;e=this.Jg(this.Vs,0)||e,n++}}if((this.hr&4)!==0){for(t=this.Vs+1;t<=this._;t++)this.yL(t,1);for(t=this.Vs-1;t>=0;t--)this.yL(t,-1);this.yL(this.Vs,0)}if(i&&(this.SF(-1),this.SF(1)),(this.hr&2)!==0){e=!0;let n=0;for(;e&&n<this.du;){for(e=!1,e=this.Jg(this.Vs,0)||e,t=this.Vs+1;t<=this._;t++)e=this.Jg(t,0)||e;for(t=this.Vs-1;t>=0;t--)e=this.Jg(t,0)||e;n++}}}Jg(t,e){let i=!1;for(;this.K3(t,e);)i=!0;return i}K3(t,e){let i=0,s=this.ja(t),n=this.ie[t],o=this.Nw(t,-1);if(e>0)for(i=0;i<n;i++)o[i]=-1;let r=this.Nw(t,1);if(e<0)for(i=0;i<n;i++)r[i]=-1;let a=!1,h=!0;for(;h;)for(h=!1,i=0;i<n;i++){let l=s[i].column,u=this.nodeMinColumnSpace(s[i],!0),c=this.nodeMinColumnSpace(s[i],!1),d=0;i-1<0||l-s[i-1].column-1>u+this.nodeMinColumnSpace(s[i-1],!1)?d=l-1:d=l;let f=0;i+1>=n||s[i+1].column-l-1>c+this.nodeMinColumnSpace(s[i+1],!0)?f=l+1:f=l;let p=0,g=0,y=0,b=0,v=0,w=0;if(e<=0){let M=s[i].sourceEdges.iterator;for(;M.next();){let A=M.value,F=A.fromVertex;if(A.valid&&F.layer!==t){b=this.linkStraightenWeight(A),v=A.portFromColOffset,w=A.portToColOffset;let O=F.column;p+=(Math.abs(l+w-(O+v))+1)*b,g+=(Math.abs(d+w-(O+v))+1)*b,y+=(Math.abs(f+w-(O+v))+1)*b}}}if(e>=0){let M=s[i].destinationEdges.iterator;for(;M.next();){let A=M.value,F=A.toVertex;if(A.valid&&F.layer!==t){b=this.linkStraightenWeight(A),v=A.portFromColOffset,w=A.portToColOffset;let O=F.column;p+=(Math.abs(l+v-(O+w))+1)*b,g+=(Math.abs(d+v-(O+w))+1)*b,y+=(Math.abs(f+v-(O+w))+1)*b}}}let k=0,S=0,N=0,D=o[s[i].index],L=r[s[i].index];D!==-1&&(k+=Math.abs(D-l),S+=Math.abs(D-d),N+=Math.abs(D-f)),L!==-1&&(k+=Math.abs(L-l),S+=Math.abs(L-d),N+=Math.abs(L-f)),g<p||g===p&&S<k?(a=!0,h=!0,s[i].column=d):(y<p||y===p&&N<k)&&(a=!0,h=!0,s[i].column=f)}return this.Wa(t,s),this.Mw(),a}yL(t,e){let i=0,s=this.ja(t),n=this.ie[t],o=this.uF(t,e),r=new Int16Array(o),a=!1,h=!0;for(;h;)for(h=!1,i=0;i<n;i++){let l=s[i].column,u=this.nodeMinColumnSpace(s[i],!0),c=this.nodeMinColumnSpace(s[i],!1),d=0,f=0,p=0,g=0,y=0;r[i]===-1?i===0&&i===n-1?d=l:i===0?(f=s[i+1].column,f-l===c+this.nodeMinColumnSpace(s[i+1],!0)?d=l-1:d=l):i===n-1?(p=s[i-1].column,l-p===u+this.nodeMinColumnSpace(s[i-1],!1)?d=l+1:d=l):(p=s[i-1].column,y=p+this.nodeMinColumnSpace(s[i-1],!1)+u+1,f=s[i+1].column,g=f-this.nodeMinColumnSpace(s[i+1],!0)-c-1,d=(y+g)/2|0):i===0&&i===n-1?d=r[i]:i===0?(f=s[i+1].column,g=f-this.nodeMinColumnSpace(s[i+1],!0)-c-1,d=Math.min(r[i],g)):i===n-1?(p=s[i-1].column,y=p+this.nodeMinColumnSpace(s[i-1],!1)+u+1,d=Math.max(r[i],y)):(p=s[i-1].column,y=p+this.nodeMinColumnSpace(s[i-1],!1)+u+1,f=s[i+1].column,g=f-this.nodeMinColumnSpace(s[i+1],!0)-c-1,y<r[i]&&r[i]<g?d=r[i]:y>=r[i]?d=y:g<=r[i]&&(d=g)),d!==l&&(a=!0,h=!0,s[i].column=d)}return this.Wa(t,s),this.Mw(),a}H3(){for(let t=0;t<=this.zt;t++)for(;this.q3(t,1););this.Mw()}q3(t,e){let i=!0,s=this.network.vertexes.iterator;for(;s.next();){let o=s.value,r=this.nodeMinColumnSpace(o,!0),a=this.nodeMinColumnSpace(o,!1);if(o.column-r<=t&&o.column+a>=t){i=!1;break}}let n=!1;if(i){if(e>0)for(s.reset();s.next();){let o=s.value;o.column>t&&(o.column-=1,n=!0)}if(e<0)for(s.reset();s.next();){let o=s.value;o.column<t&&(o.column+=1,n=!0)}}return n}j3(){this.H3();for(let t=0;t<this.zt;t++)for(;this.W3(t,1););this.Mw()}W3(t,e){let i=t;e>0&&(i=t+1),e<0&&(i=t-1);let s=0,n=[],o=[];for(s=0;s<=this._;s++)n[s]=!1,o[s]=!1;let r=this.network.vertexes.iterator;for(;r.next();){let l=r.value,u=l.column-this.nodeMinColumnSpace(l,!0),c=l.column+this.nodeMinColumnSpace(l,!1);u<=t&&c>=t&&(n[l.layer]=!0),u<=i&&c>=i&&(o[l.layer]=!0)}let a=!0,h=!1;for(s=0;s<=this._;s++)a=a&&!(n[s]&&o[s]);if(a){if(e>0)for(r.reset();r.next();){let l=r.value;l.column>t&&(l.column-=1,h=!0)}if(e<0)for(r.reset();r.next();){let l=r.value;l.column<t&&(l.column+=1,h=!0)}}return h}SF(t){this.j3();let e=0,i,s=0,n=0,o=0;if(t>0)for(e=0;e<=this.zt;e++)for(i=this.ei(),s=this.Qk(!0),n=s+1;s<n;)n=s,this.MF(e,1),o=this.Qk(!0),o>s?this.ns(i):o<s&&(s=o,i=this.ei());if(t<0)for(e=this.zt;e>=0;e--)for(i=this.ei(),s=this.Qk(!0),n=s+1;s<n;)n=s,this.MF(e,-1),o=this.Qk(!0),o>s?this.ns(i):o<s&&(s=o,i=this.ei());this.Mw()}MF(t,e){this.cn=0;let i=this.network.vertexes.iterator;for(;i.next();){let u=i.value;u.component=-1}if(e>0)for(i.reset();i.next();){let u=i.value;u.column-this.nodeMinColumnSpace(u,!0)<=t&&(u.component=this.cn)}if(e<0)for(i.reset();i.next();){let u=i.value;u.column+this.nodeMinColumnSpace(u,!1)>=t&&(u.component=this.cn)}for(this.cn++,i.reset();i.next();){let u=i.value;u.component===-1&&(this.mL(u,this.cn,-1,!0,!0),this.cn++)}let s=0,n=[];for(s=0;s<this.cn*this.cn;s++)n[s]=!1;let o=[];for(s=0;s<(this._+1)*(this.zt+1);s++)o[s]=-1;for(i.reset();i.next();){let u=i.value,c=u.layer,d=Math.max(0,u.column-this.nodeMinColumnSpace(u,!0)),f=Math.min(this.zt,u.column+this.nodeMinColumnSpace(u,!1));for(let p=d;p<=f;p++)o[c*(this.zt+1)+p]=u.component}for(let u=0;u<=this._;u++){if(e>0)for(let c=0;c<this.zt;c++)o[u*(this.zt+1)+c]!==-1&&o[u*(this.zt+1)+c+1]!==-1&&o[u*(this.zt+1)+c]!==o[u*(this.zt+1)+c+1]&&(n[o[u*(this.zt+1)+c]*this.cn+o[u*(this.zt+1)+c+1]]=!0);if(e<0)for(let c=this.zt;c>0;c--)o[u*(this.zt+1)+c]!==-1&&o[u*(this.zt+1)+c-1]!==-1&&o[u*(this.zt+1)+c]!==o[u*(this.zt+1)+c-1]&&(n[o[u*(this.zt+1)+c]*this.cn+o[u*(this.zt+1)+c-1]]=!0)}let r=[];for(s=0;s<this.cn;s++)r[s]=!0;let a=[];a.push(0);let h=0;for(;a.length!==0;)if(h=a[a.length-1],a.pop(),r[h])for(r[h]=!1,s=0;s<this.cn;s++)n[h*this.cn+s]&&a.splice(0,0,s);let l=!1;if(e>0)for(i.reset();i.next();){let u=i.value;r[u.component]&&(u.column-=1,l=!0)}if(e<0)for(i.reset();i.next();){let u=i.value;r[u.component]&&(u.column+=1,l=!0)}return l}Y3(){let t=m.nt(),e=this.gu.length;for(let d=0;d<=e;d++)t[d]=[];let i=this.network.vertexes.iterator;for(;i.next();){let d=i.value,f=e-d.layer,p=t[f];p[d.index]=d}let s=new V;this.J3(t,s);let n=null,o=null,r=null,a=null,h=(this.Xn&1)!==0,l=(this.Xn&2)!==0,u=(this.Xn&4)!==0,c=(this.Xn&8)!==0;h&&(this.al(t,s,!0),n=this.iP(t,!0,!1)),t.reverse(),u&&(this.al(t,s,!1),r=this.iP(t,!1,!1));for(let d of t)d.reverse();c&&(this.al(t,s,!1),a=this.iP(t,!1,!0)),t.reverse(),l&&(this.al(t,s,!0),o=this.iP(t,!0,!0)),m.Z(t),this.$3(n,o,r,a),this.network.vertexes.each(d=>{let f=d,p=m.nt();h&&p.push(n.get(f)),l&&p.push(o.get(f)),u&&p.push(r.get(f)),c&&p.push(a.get(f)),p.sort((w,k)=>w-k);let g=p.length,y=Math.floor((g-1)/2),b=Math.ceil((g-1)/2),v=(p[y]+p[b])/2;m.Z(p),f.mi=v})}J3(t,e){let i=t.length;for(let s=1;s<i-1;s++){let n=0,o=0,r=t[s],a=t[s+1];for(let h=0;o<a.length;h++){let l=a[h],u=this.Z3(l);if(h===a.length-1||u){let c=r.length-1;for(u&&(c=l.getProperSourceVertexes()[0].index);o<=h;){let d=a[o].getProperSourceEdges();for(let f of d){let p=f.fromVertex.index;(p<n||p>c)&&e.add(f)}o++}n=c}}}}Z3(t){if(t.node===null){let e=t.getProperSourceVertexes();if(e.length>0)return e[0].node===null}return!1}al(t,e,i){this.Q3(t);for(let s of t){let n=-1;for(let o of s){let r=i?o.getProperSourceVertexes():o.getProperDestinationVertexes(),a=r.length;if(a>0){r.sort((l,u)=>l.Ja-u.Ja);let h=(a-1)/2;for(let l=Math.floor(h),u=Math.ceil(h);l<=u;l++)if(o.Gn===o){let c=r[l],d;i?d=c.getDestinationEdge(o):d=o.getDestinationEdge(c),!e.has(d)&&n<c.Ja&&(c.Gn=o,o.mc=c.mc,o.Gn=c.mc,n=c.Ja)}}}}}Q3(t){for(let e=0;e<t.length;e++){let i=t[e];for(let s=0;s<i.length;s++){let n=i[s];n.mc=n,n.Gn=n,n.NF=e,n.Ja=s}}}iP(t,e,i){let s=this.P===90||this.P===270;for(let o of t)for(let r of o)r.os=r,r.pu=1/0,r.mi=NaN,r.Yn=0;this._3(t,e,i);for(let o of t)for(let r of o)r.mc===r&&this.CF(r,t);for(let o=0;o<t.length;o++){if(t[o].length<=0)continue;let r=t[o][0];if(r.os===r){r.os.pu===1/0&&(r.os.pu=0);let a=o,h=0,l;do{for(l=t[a][h];l.Gn!==l.mc;)if(l=l.Gn,a++,l.Ja>0){let u=this.LF(l,t),c=s?u.width:u.height,d=l.os.pu+l.mi+l.Yn-(u.mi+u.Yn+c+this.columnSpacing);u.os.pu=Math.min(u.os.pu,d)}h=l.Ja+1}while(a<t.length&&h<t[a].length&&l.os===t[a][h].os)}}let n=new Mt;for(let o of t)for(let r of o){r.mi=r.mi+r.os.pu+r.Yn;let a=s?r.width:r.height;n.set(r,i?-r.mi-a:r.mi)}return n}_3(t,e,i){let s=this.P===90||this.P===270;for(let n of t)for(let o of n)if(o.mc===o){let r=0,a=o;for(;a.Gn!==o;){let h=a.Gn,l=s?a.width:a.height,u=s?h.width:h.height,c,d,f,p;e?(f=a.getDestinationEdge(h),c=f.portFromPos,d=f.portToPos,f.link!==null&&(a.node&&a.node!==f.link.fromNode&&(c=s?a.focusX:a.focusY),h.node&&h.node!==f.link.toNode&&(d=s?h.focusX:h.focusY)),i?p=a.Yn+(l-c)-(u-d):p=a.Yn+c-d):(f=h.getDestinationEdge(a),c=f.portToPos,d=f.portFromPos,f.link!==null&&(a.node&&a.node!==f.link.toNode&&(c=s?a.focusX:a.focusY),h.node&&h.node!==f.link.fromNode&&(d=s?h.focusX:h.focusY)),i?p=a.Yn+(l-c)-(u-d):p=a.Yn+c-d),h.Yn=p,r=Math.min(r,p),a=a.Gn}a=o;do a.Yn=a.Yn-r,a=a.Gn;while(a!==o)}}CF(t,e){if(!isNaN(t.mi))return;t.mi=0;let i=t;do{if(i.Ja>0){let s=this.LF(i,e),n=s.mc;this.CF(n,e),t.os===t&&(t.os=n.os);let o=this.P===90||this.P===270?s.width:s.height;if(t.os===n.os){let r=n.mi+s.Yn+o-i.Yn+this.columnSpacing;t.mi=Math.max(t.mi,r)}}i=i.Gn}while(i!==t);for(;i.Gn!==t;)i=i.Gn,i.mi=t.mi,i.os=t.os}LF(t,e){let i=t.NF,s=t.Ja;return s<1&&m.o("Could not determine previous vertex in layer"),e[i][s-1]}$3(...t){let e=-1,i=m.nt(),s=m.nt(),n=1/0;for(let o=0;o<4;o++){if(!t[o])continue;let r=this.tU(t[o],i,s,o);r<n&&(e=o,n=r)}for(let o=0;o<4;o++){let r=t[o];if(!r)continue;let a=o===0||o===2?i[e]-i[o]:s[e]-s[o];a!==0&&r.each(h=>{r.set(h.key,h.value+a)})}m.Z(i),m.Z(s)}tU(t,e,i,s){if(!t||t.count===0)return e[s]=0,i[s]=0,1/0;let n=1/0,o=-1/0;return t.each(r=>{let a=r.key,h=r.value,l=this.P===90||this.P===270?a.width:a.height;h<n&&(n=h),h+l>o&&(o=h+l)}),e[s]=n,i[s]=o,o-n}commitLayout(){this.Pw(),this.commitNodes(),this.wL(),this.isRouting&&this.commitLinks()}Pw(){if(!this.setsPortSpots)return;let t=this.tP(!0),e=this.tP(!1),i=this.network.edges.iterator;for(;i.next();){let s=i.value.link;s!==null&&(s.fromSpot=t,s.toSpot=e)}}tP(t){return this.P===270?t?T.MiddleTop:T.MiddleBottom:this.P===90?t?T.MiddleBottom:T.MiddleTop:this.P===180?t?T.MiddleLeft:T.MiddleRight:t?T.MiddleRight:T.MiddleLeft}commitNodes(){this.Bs.length!==this._+1&&(this.Bs=new Float32Array(this._+1)),this.ms.length!==this._+1&&(this.ms=new Float32Array(this._+1)),this.ps.length!==this._+1&&(this.ps=new Float32Array(this._+1)),this.Rt.length!==this._+1&&(this.Rt=new Float32Array(this._+1));for(let f=0;f<=this._;f++)this.Bs[f]=0,this.ms[f]=0,this.ps[f]=0,this.Rt[f]=0;let t=this.network.vertexes.iterator;for(;t.next();){let f=t.value,p=f.layer;this.Bs[p]=Math.max(this.Bs[p],this.nodeMinLayerSpace(f,!0)),this.ms[p]=Math.max(this.ms[p],this.nodeMinLayerSpace(f,!1))}let e=0,i=this.Us;for(let f=0;f<=this._;f++){let p=i;this.Bs[f]+this.ms[f]<=0&&(p=0),f>0&&(e+=p/2),this.P===90||this.P===0?(e+=this.ms[f],this.ps[f]=e,e+=this.Bs[f]):(e+=this.Bs[f],this.ps[f]=e,e+=this.ms[f]),f<this._&&(e+=p/2),this.Rt[f]=e}let s=e,n=this.arrangementOrigin;for(let f=0;f<=this._;f++)this.P===270?this.ps[f]=n.y+this.ps[f]:this.P===90?(this.ps[f]=n.y+s-this.ps[f],this.Rt[f]=s-this.Rt[f]):this.P===180?this.ps[f]=n.x+this.ps[f]:(this.ps[f]=n.x+s-this.ps[f],this.Rt[f]=s-this.Rt[f]);let o=this.Xn!==0;t.reset();let r=this.P===270||this.P===90,a=1/0,h=1/0,l=1/0,u=-1/0;for(;t.next();){let f=t.value,p=f.layer,g=f.column|0,y=0,b=0;r?(y=n.x+this.ti*g,b=this.ps[p]):(y=this.ps[p],b=n.y+this.ti*g),f.centerX=y,f.centerY=b,o&&isFinite(f.mi)&&(r?f.node?f.x=n.x+f.mi:f.centerX=n.x+f.mi:f.node?f.y=n.y+f.mi:f.centerY=n.y+f.mi),a=Math.min(f.x,a),h=Math.min(f.y,h),r?(l=a,u=Math.max(u,f.bounds.right)):(l=h,u=Math.max(u,f.bounds.bottom))}this.gL=u-l;let c=n.x-a,d=n.y-h;for(this.cr=new P(o&&r?0:c,o&&!r?0:d),t.reset();t.next();){let f=t.value;f.x+=c,f.y+=d,f.commit()}}wL(){let t=0,e=this.Us;for(let n=0;n<=this._;n++)t+=this.Bs[n],t+=this.ms[n];t+=this._*e;let i=[],s=this.Xn!==0?this.gL:this.ti*this.zt;for(let n=this.maxLayer;n>=0;n--)this.P===270?n===0?i.push(new I(0,0,s,Math.abs(this.Rt[0]))):i.push(new I(0,this.Rt[n-1],s,Math.abs(this.Rt[n-1]-this.Rt[n]))):this.P===90?n===0?i.push(new I(0,this.Rt[0],s,Math.abs(this.Rt[0]-t))):i.push(new I(0,this.Rt[n],s,Math.abs(this.Rt[n-1]-this.Rt[n]))):this.P===180?n===0?i.push(new I(0,0,Math.abs(this.Rt[0]),s)):i.push(new I(this.Rt[n-1],0,Math.abs(this.Rt[n-1]-this.Rt[n]),s)):n===0?i.push(new I(this.Rt[0],0,Math.abs(this.Rt[0]-t),s)):i.push(new I(this.Rt[n],0,Math.abs(this.Rt[n-1]-this.Rt[n]),s));this.commitLayers(i,this.cr)}commitLayers(t,e){}commitLinks(){let t=this.network.edges.iterator,e=null;for(;t.next();)e=t.value.link,e!==null&&e.pointsCount>0&&(e.startRoute(),e.clearPoints(),e.commitRoute());for(t.reset();t.next();)e=t.value.link,e!==null&&e.updateRoute();for(t.reset();t.next();){let i=t.value;if(e=i.link,e===null||e.pointsCount===0)continue;e.startRoute();let s=e,n=s.fromNode,o=s.toNode,r=s.fromPort,a=s.toPort;if(n!==null){let A=n.findVisibleNode();A!==null&&A!==n&&(n=A,r=A.port)}if(o!==null){let A=o.findVisibleNode();A!==null&&A!==o&&(o=A,a=A.port)}let h=e.computeSpot(!0,r),l=e.computeSpot(!1,a),u=i.fromVertex,c=i.toVertex;if(i.valid){if(e.curve===9&&e.pointsCount===4)if(u.column===c.column&&this.alignOption===0){let A=e.getLinkPoint(n,r,h,!0,!1,o,a),F=e.getLinkPoint(o,a,l,!1,!1,n,r);A.isReal()||A.set(n.actualBounds.center),F.isReal()||F.set(o.actualBounds.center),e.clearPoints(),e.addPointAt(A.x,A.y),e.addPointAt((2*A.x+F.x)/3,(2*A.y+F.y)/3),e.addPointAt((A.x+2*F.x)/3,(A.y+2*F.y)/3),e.addPointAt(F.x,F.y)}else{let A=!1,F=!1;if(r!==null&&e.bl(h)&&(A=!0),a!==null&&e.bl(l)&&(F=!0),A||F){let O=null;A&&(O=e.getLinkPointFromPoint(n,r,r.getDocumentPoint(T.Center),e.getPoint(3),!0),O.isReal()||O.set(n.actualBounds.center),e.setPointAt(0,O.x,O.y));let E=null;if(F&&(E=e.getLinkPointFromPoint(o,a,a.getDocumentPoint(T.Center),e.getPoint(0),!1),E.isReal()||E.set(o.actualBounds.center),e.setPointAt(3,E.x,E.y)),O){let B=e.getPoint(2);e.setPointAt(1,(O.x*2+B.x)/3,(O.y*2+B.y)/3)}if(E){let B=e.getPoint(1);e.setPointAt(2,(E.x*2+B.x)/3,(E.y*2+B.y)/3)}}}e.commitRoute();continue}if(u.layer===c.layer){e.commitRoute();continue}let d=!1,f=!1,p=this.Us,g=0,y=e.firstPickIndex+1;if(e.isOrthogonal)f=!0,g=e.pointsCount,g>4&&e.points.removeRange(2,g-3);else if(e.curve===9)d=!0,g=e.pointsCount,g>4&&e.points.removeRange(2,g-3),g===4&&(y=2);else{g=e.pointsCount;let A=h===T.None,F=l===T.None;g>2&&A&&F?e.points.removeRange(1,g-2):g>3&&A&&!F?e.points.removeRange(1,g-3):g>3&&!A&&F?e.points.removeRange(2,g-2):g>4&&!A&&!F&&e.points.removeRange(2,g-3)}let b,v,w=0,k=0,S=0,N=0,D=0,L=0,M=0;if(i.rev){let A=0;for(;c!==null&&u!==c;){b=null,v=null;let F=c.sourceEdges.iterator;for(;F.next();){let O=F.value;if(O.link===i.link&&(b=O.fromVertex,v=O.toVertex,b.node===null))break}if(b===null)break;if(b!==u)if(w=e.getPoint(y-1).x,k=e.getPoint(y-1).y,S=b.centerX,N=b.centerY,f)this.P===180||this.P===0?y===e.firstPickIndex+1?(e.insertPointAt(y++,w,k),e.insertPointAt(y++,w,N)):(v!==null?v.centerY:k)!==N&&(D=this.Rt[b.layer-1]+this.cr.x,e.insertPointAt(y++,D,k),e.insertPointAt(y++,D,N)):y===e.firstPickIndex+1?(e.insertPointAt(y++,w,k),e.insertPointAt(y++,S,k)):(v!==null?v.centerX:w)!==S&&(D=this.Rt[b.layer-1]+this.cr.y,e.insertPointAt(y++,w,D),e.insertPointAt(y++,S,D));else if(y===e.firstPickIndex+1)if(L=Math.max(10,this.Bs[c.layer]),M=Math.max(10,this.ms[c.layer]),d)this.P===180?S<=c.bounds.x?(A=c.bounds.x,e.insertPointAt(y++,A-L,N),e.insertPointAt(y++,A,N),e.insertPointAt(y++,A+M,N)):(e.insertPointAt(y++,S-L,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S+M,N)):this.P===90?N>=c.bounds.bottom?(A=c.bounds.y+c.bounds.height,e.insertPointAt(y++,S,A+M),e.insertPointAt(y++,S,A),e.insertPointAt(y++,S,A-L)):(e.insertPointAt(y++,S,N+M),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N-L)):this.P===270?N<=c.bounds.y?(A=c.bounds.y,e.insertPointAt(y++,S,A-L),e.insertPointAt(y++,S,A),e.insertPointAt(y++,S,A+M)):(e.insertPointAt(y++,S,N-L),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N+M)):this.P===0&&(S>=c.bounds.right?(A=c.bounds.x+c.bounds.width,e.insertPointAt(y++,A+M,N),e.insertPointAt(y++,A,N),e.insertPointAt(y++,A-L,N)):(e.insertPointAt(y++,S+M,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S-L,N)));else{e.insertPointAt(y++,w,k);let O=0;this.P===180||this.P===0?((this.P===180?S>=c.bounds.right:S<=c.bounds.x)&&(O=(this.P===0?-L:M)/2),e.insertPointAt(y++,w+O,N)):((this.P===270?N>=c.bounds.bottom:N<=c.bounds.y)&&(O=(this.P===90?-L:M)/2),e.insertPointAt(y++,S,k+O)),e.insertPointAt(y++,S,N)}else L=Math.max(10,this.Bs[b.layer]),M=Math.max(10,this.ms[b.layer]),d?this.P===180?(e.insertPointAt(y++,S-L-Math.max(10,p),N),e.insertPointAt(y++,Math.min(S-L+p/2,S),N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,Math.max(S+M-p/2,S),N),e.insertPointAt(y++,S+M+p,N)):this.P===90?(e.insertPointAt(y++,S,N+M+Math.max(10,p)),e.insertPointAt(y++,S,Math.max(N+M-p/2,N)),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,Math.min(N-L+p/2,N)),e.insertPointAt(y++,S,N-L-p)):this.P===270?(e.insertPointAt(y++,S,N-L-Math.max(10,p)),e.insertPointAt(y++,S,Math.min(N-L+p/2,N)),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,Math.max(N+M-p/2,N)),e.insertPointAt(y++,S,N+M+p)):(e.insertPointAt(y++,S+M+Math.max(10,p),N),e.insertPointAt(y++,Math.max(S+M-p/2,S),N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,Math.min(S-L+p/2,S),N),e.insertPointAt(y++,S-L-p,N)):(this.P===180||this.P===90||this.P,e.insertPointAt(y++,S,N));c=b}if(a===null||h!==T.None||f)if(w=e.getPoint(y-1).x,k=e.getPoint(y-1).y,S=e.getPoint(y).x,N=e.getPoint(y).y,f){let F=this.ms[u.layer],O=0;this.P===180||this.P===0?(O=k,O>=u.bounds.y&&O<=u.bounds.bottom&&(this.P===180?S>=u.bounds.x:S<=u.bounds.right)&&(A=u.centerX+(this.P===180?-F:F),O<u.bounds.y+u.bounds.height/2?O=u.bounds.y-this.ti/2:O=u.bounds.bottom+this.ti/2,e.insertPointAt(y++,A,k),e.insertPointAt(y++,A,O)),e.insertPointAt(y++,S,O),e.insertPointAt(y++,S,N)):(O=w,O>=u.bounds.x&&O<=u.bounds.right&&(this.P===270?N>=u.bounds.y:N<=u.bounds.bottom)&&(A=u.centerY+(this.P===270?-F:F),O<u.bounds.x+u.bounds.width/2?O=u.bounds.x-this.ti/2:O=u.bounds.right+this.ti/2,e.insertPointAt(y++,w,A),e.insertPointAt(y++,O,A)),e.insertPointAt(y++,O,N),e.insertPointAt(y++,S,N))}else if(d)L=Math.max(10,this.Bs[u.layer]),M=Math.max(10,this.ms[u.layer]),this.P===180&&S>=u.bounds.x?(A=u.bounds.x+u.bounds.width,e.setPointAt(y-2,A,k),e.setPointAt(y-1,A+M,k)):this.P===90&&N<=u.bounds.bottom?(A=u.bounds.y,e.setPointAt(y-2,w,A),e.setPointAt(y-1,w,A-L)):this.P===270&&N>=u.bounds.y?(A=u.bounds.y+u.bounds.height,e.setPointAt(y-2,w,A),e.setPointAt(y-1,w,A+M)):this.P===0&&S<=u.bounds.right&&(A=u.bounds.x,e.setPointAt(y-2,A,k),e.setPointAt(y-1,A-L,k));else{L=Math.max(10,this.Bs[u.layer]),M=Math.max(10,this.ms[u.layer]);let F=0;this.P===180||this.P===0?((this.P===180?S<=u.bounds.x:S>=u.bounds.right)&&(F=(this.P===0?M:-L)/2),e.insertPointAt(y++,S+F,k)):((this.P===270?N<=u.bounds.y:N>=u.bounds.bottom)&&(F=(this.P===90?M:-L)/2),e.insertPointAt(y++,w,N+F)),e.insertPointAt(y++,S,N)}}else{for(;u!==null&&u!==c;){b=null,v=null;let A=u.destinationEdges.iterator;for(;A.next();){let F=A.value;if(F.link===i.link&&(b=F.toVertex,v=F.fromVertex,v.node!==null&&(v=null),b.node===null))break}if(b===null)break;b!==c&&(w=e.getPoint(y-1).x,k=e.getPoint(y-1).y,S=b.centerX,N=b.centerY,f?this.P===180||this.P===0?(v!==null?v.centerY:k)!==N&&(D=this.Rt[b.layer]+this.cr.x,y===e.firstPickIndex+1&&(this.P===0?D=Math.max(D,w):D=Math.min(D,w)),e.insertPointAt(y++,D,k),e.insertPointAt(y++,D,N)):(v!==null?v.centerX:w)!==S&&(D=this.Rt[b.layer]+this.cr.y,y===e.firstPickIndex+1&&(this.P===90?D=Math.max(D,k):D=Math.min(D,k)),e.insertPointAt(y++,w,D),e.insertPointAt(y++,S,D)):(L=Math.max(10,this.Bs[b.layer]),M=Math.max(10,this.ms[b.layer]),d?this.P===180?(e.insertPointAt(y++,S+M+Math.max(10,p),N),e.insertPointAt(y++,Math.max(S+M-p/2,S),N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,Math.min(S-L+p/2,S),N),e.insertPointAt(y++,S-L-p,N)):this.P===90?(e.insertPointAt(y++,S,N-L-Math.max(10,p)),e.insertPointAt(y++,S,Math.min(N-L+p/2,N)),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,Math.max(N+M-p/2,N)),e.insertPointAt(y++,S,N+M+p)):this.P===270?(e.insertPointAt(y++,S,N+M+Math.max(10,p)),e.insertPointAt(y++,S,Math.max(N+M-p/2,N)),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,Math.min(N-L+p/2,N)),e.insertPointAt(y++,S,N-L-p)):(e.insertPointAt(y++,S-L-Math.max(10,p),N),e.insertPointAt(y++,Math.min(S-L+p/2,S),N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,S,N),e.insertPointAt(y++,Math.max(S+M-p/2,S),N),e.insertPointAt(y++,S+M+p,N)):this.P===180?(e.insertPointAt(y++,S+M,N),e.insertPointAt(y++,S-L,N)):this.P===90?(e.insertPointAt(y++,S,N-L),e.insertPointAt(y++,S,N+M)):this.P===270?(e.insertPointAt(y++,S,N+M),e.insertPointAt(y++,S,N-L)):(e.insertPointAt(y++,S-L,N),e.insertPointAt(y++,S+M,N)))),u=b}f&&(w=e.getPoint(y-1).x,k=e.getPoint(y-1).y,S=e.getPoint(y).x,N=e.getPoint(y).y,this.P===180||this.P===0?k!==N&&(this.P===0?D=Math.min(Math.max((S+w)/2,this.Rt[c.layer]+this.cr.x),S):D=Math.max(Math.min((S+w)/2,this.Rt[c.layer]+this.cr.x),S),e.insertPointAt(y++,D,k),e.insertPointAt(y++,D,N)):w!==S&&(this.P===90?D=Math.min(Math.max((N+k)/2,this.Rt[c.layer]+this.cr.y),N):D=Math.max(Math.min((N+k)/2,this.Rt[c.layer]+this.cr.y),N),e.insertPointAt(y++,w,D),e.insertPointAt(y++,S,D)))}if(s!==null&&d&&e.pointsCount>=4){if(n!==null&&r!==null&&s.bl(h)){let A=r.getDocumentPoint(T.Center);A.isReal()||A.setTo(n.actualBounds.centerX,n.actualBounds.centerY);let F=e.getPoint(3),O=e.getPoint(2);this.direction===90||this.direction===270?(e.setPointAt(1,F.x,(O.y+F.y)/2),e.setPointAt(2,F.x,(O.y+F.y)/2)):(e.setPointAt(1,(O.x+F.x)/2,F.y),e.setPointAt(2,(O.x+F.x)/2,F.y));let E=e.getLinkPointFromPoint(n,r,A,e.getPoint(1),!0);e.setPointAt(0,E.x,E.y)}if(o!==null&&a!==null&&s.bl(l)){let A=a.getDocumentPoint(T.Center);A.isReal()||A.setTo(o.actualBounds.centerX,o.actualBounds.centerY);let F=e.getPoint(e.pointsCount-4),O=e.getLinkPointFromPoint(o,a,A,F,!1),E=e.getPoint(e.pointsCount-3);this.direction===90||this.direction===270?(e.setPointAt(e.pointsCount-2,F.x,(E.y+O.y)/2),e.setPointAt(e.pointsCount-3,F.x,(E.y+O.y)/2)):(e.setPointAt(e.pointsCount-2,(E.x+O.x)/2,F.y),e.setPointAt(e.pointsCount-3,(E.x+O.x)/2,F.y));let B=e.getLinkPointFromPoint(o,a,A,e.getPoint(e.pointsCount-2),!1);e.setPointAt(e.pointsCount-1,B.x,B.y)}}e.commitRoute(),i.commit()}}S3(){this.Sw=-1,this.qg=0,this.Vs=0,this.gu=null;for(let t=0;t<this.zn.length;t++)this.zn[t]=null}ja(t){let e,i=this.ie[t];if(i>=this.zn.length){let n=[];for(let o=0;o<this.zn.length;o++)n[o]=this.zn[o];this.zn=n}this.zn[i]===void 0||this.zn[i]===null?e=[]:(e=this.zn[i],this.zn[i]=null);let s=this.gu[t];for(let n=0;n<s.length;n++){let o=s[n];e[o.index]=o}return e}Wa(t,e){this.zn[this.ie[t]]=e}get layerSpacing(){return this.Us}set layerSpacing(t){this.Us!==t&&(m.s(t,"number",Ae,"layerSpacing"),t>=0&&(this.Us=t,this.p()))}get columnSpacing(){return this.ti}set columnSpacing(t){this.ti!==t&&(m.s(t,"number",Ae,"columnSpacing"),t>0&&(this.ti=t,this.p()))}get direction(){return this.P}set direction(t){this.P!==t&&(m.s(t,"number",Ae,"direction"),t===0||t===90||t===180||t===270?(this.P=t,this.p()):m.o("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}get cycleRemoveOption(){return this.hu}set cycleRemoveOption(t){this.hu!==t&&(t===1||t===0||t===2)&&(this.hu=t,this.p())}get layeringOption(){return this.cu}set layeringOption(t){this.cu!==t&&(t===10||t===11||t===12)&&(this.cu=t,this.p())}get initializeOption(){return this.fu}set initializeOption(t){this.fu!==t&&(t===20||t===21||t===22)&&(this.fu=t,this.p())}get iterations(){return this.gc}set iterations(t){this.gc!==t&&t>=0&&(this.gc=t,this.p())}get aggressiveOption(){return this.uu}set aggressiveOption(t){this.uu!==t&&(t===30||t===31||t===32)&&(this.uu=t,this.p())}get packOption(){return this.hr}set packOption(t){this.hr!==t&&(m.s(t,"number",Ae,"packOption"),t>=0&&t<8&&(this.hr=t,this.p()))}get packIterations(){return this.du}set packIterations(t){this.du=t}get alignOption(){return this.Xn}set alignOption(t){this.Xn!==t&&(m.s(t,"number",Ae,"align"),t>=0&&t<16&&(this.Xn=t,this.p()))}get centered(){return this.qa}set centered(t){this.centered!==t&&(m.s(t,"boolean",Ae,"centered"),this.qa=t,this.p())}get setsPortSpots(){return this.Bn}set setsPortSpots(t){this.Bn!==t&&(m.s(t,"boolean",Ae,"setsPortSpots"),this.Bn=t,this.p())}get maxLayer(){return this._}get maxIndex(){return this.Sw}get maxColumn(){return this.zt}get minIndexLayer(){return this.qg}get maxIndexLayer(){return this.Vs}static CycleDepthFirst=0;static CycleGreedy=1;static CycleFromLayers=2;static LayerOptimalLinkLength=10;static LayerLongestPathSink=11;static LayerLongestPathSource=12;static InitDepthFirstOut=20;static InitDepthFirstIn=21;static InitNaive=22;static AggressiveNone=30;static AggressiveLess=31;static AggressiveMore=32;static PackNone=0;static PackExpand=1;static PackStraighten=2;static PackMedian=4;static PackAll=15;static AlignNone=0;static AlignUpperLeft=1;static AlignUpperRight=2;static AlignLowerLeft=4;static AlignLowerRight=8;static AlignAll=15}class tn extends Ee{constructor(t){super(t)}createVertex(){let t=new si(this);return t.centered=this.layout.centered,t}createEdge(){return new Se(this)}}class si extends Ie{gl;pa;Tt;sP;nP;qa;ii;mu;_n;_k;$k;Zk;mc;Gn;NF;Ja;os;pu;mi;Yn;Lw=null;Aw=null;Tw=null;Dw=null;constructor(t){super(t),this.gl=-1,this.pa=-1,this.Tt=-1,this.sP=NaN,this.nP=null,this.qa=!0,this.ii=!1,this.mu=NaN,this._n=NaN,this._k=0,this.$k=null,this.Zk=null}static AF(t,e){return t.index-e.index}getProperSourceEdges(){if(!this.Tw){let t=[];for(let e of this.So){let i=e;i.valid&&t.push(i)}this.Tw=t}return this.Tw}getProperDestinationEdges(){if(!this.Dw){let t=[];for(let e of this.or){let i=e;i.valid&&t.push(i)}this.Dw=t}return this.Dw}getDestinationEdge(t){let e=this.getProperDestinationEdges();for(let i of e)if(i.toVertex===t)return i;m.o("Unable to find destination edge to given vertex")}getProperSourceVertexes(){if(!this.Lw){let t=[];for(let e of this.So){let i=e;!i.valid||i.fromVertex.layer<=i.toVertex.layer||t.push(i.fromVertex)}t.sort(si.AF),this.Lw=t}return this.Lw}getProperDestinationVertexes(){if(!this.Aw){let t=[];for(let e of this.or){let i=e;!i.valid||i.fromVertex.layer<=i.toVertex.layer||t.push(i.toVertex)}t.sort(si.AF),this.Aw=t}return this.Aw}addSourceEdge(t){super.addSourceEdge(t),this.Lw=null,this.Tw=null}deleteSourceEdge(t){super.deleteSourceEdge(t),this.Lw=null,this.Tw=null}addDestinationEdge(t){super.addDestinationEdge(t),this.Aw=null,this.Dw=null}deleteDestinationEdge(t){super.deleteDestinationEdge(t),this.Aw=null,this.Dw=null}commit(){if(this.centered)super.commit();else{let t=this.node;if(t!==null){let e=this.network.layout;if(!e)return;e.direction===180||e.direction===270?t.moveTo(this.bounds.right-t.actualBounds.width,this.bounds.bottom-t.actualBounds.height):t.moveTo(this.bounds.x,this.bounds.y)}}}get layer(){return this.gl}set layer(t){this.gl=t}get column(){return this.pa}set column(t){this.pa=t}get index(){return this.Tt}set index(t){this.Tt=t}get component(){return this.sP}set component(t){this.sP!==t&&(m.s(t,"number",si,"component"),this.sP=t)}get near(){return this.nP}set near(t){this.nP!==t&&(this.nP=t)}get centered(){return this.qa}set centered(t){this.qa=t}}class Se extends ei{ii;oP;rP;lP;aP;hP;cP;constructor(t){super(t),this.ii=!1,this.oP=!1,this.rP=!1,this.lP=NaN,this.aP=NaN,this.hP=0,this.cP=0}get fromVertex(){return this.is}set fromVertex(t){this.is!==t&&(this.is=t)}get toVertex(){return this.ss}set toVertex(t){this.ss!==t&&(this.ss=t)}get valid(){return this.ii}set valid(t){this.ii!==t&&(m.s(t,"boolean",Se,"valid"),this.ii=t)}get rev(){return this.oP}set rev(t){this.oP!==t&&(m.s(t,"boolean",Se,"rev"),this.oP=t)}get forest(){return this.rP}set forest(t){this.rP!==t&&(m.s(t,"boolean",Se,"forest"),this.rP=t)}get portFromPos(){return this.lP}set portFromPos(t){this.lP!==t&&(m.s(t,"number",Se,"portFromPos"),this.lP=t)}get portToPos(){return this.aP}set portToPos(t){this.aP!==t&&(m.s(t,"number",Se,"portToPos"),this.aP=t)}get portFromColOffset(){return this.hP}set portFromColOffset(t){this.hP!==t&&(m.s(t,"number",Se,"portFromColOffset"),this.hP=t)}get portToColOffset(){return this.cP}set portToColOffset(t){this.cP!==t&&(m.s(t,"number",Se,"portToColOffset"),this.cP=t)}}var hs=(x=>(x[x.Default=0]="Default",x[x.Destination=1]="Destination",x[x.Source=2]="Source",x))(hs||{}),ls=(x=>(x[x.Forwards=10]="Forwards",x[x.Reverse=11]="Reverse",x[x.Ascending=12]="Ascending",x[x.Descending=13]="Descending",x))(ls||{}),us=(x=>(x[x.CenterSubtrees=20]="CenterSubtrees",x[x.CenterChildren=21]="CenterChildren",x[x.Start=22]="Start",x[x.End=23]="End",x[x.Bus=24]="Bus",x[x.BusBranching=25]="BusBranching",x[x.TopLeftBus=26]="TopLeftBus",x[x.BottomRightBus=27]="BottomRightBus",x[x.Custom=28]="Custom",x))(us||{}),cs=(x=>(x[x.None=30]="None",x[x.Block=31]="Block",x))(cs||{}),ds=(x=>(x[x.Layered=40]="Layered",x[x.LastParents=41]="LastParents",x[x.Alternating=42]="Alternating",x[x.RootOnly=43]="RootOnly",x))(ds||{}),fs=(x=>(x[x.Vertical=50]="Vertical",x[x.Horizontal=51]="Horizontal",x[x.FixedRoots=52]="FixedRoots",x))(fs||{}),en=(x=>(x[x.Individual=60]="Individual",x[x.Siblings=61]="Siblings",x[x.Uniform=62]="Uniform",x))(en||{});class zt extends _t{Ie;Fe;yu;$g;xL;zi;He;Es;V;B;fP;ws;constructor(t){super(),this.Ie=new V,this.Fe=0,this.ws=1,this.yu=40,this.$g=60,this.xL=[],this.zi=!0,this.He=50,this.Es=new st(10,10).k();let e=new gs(this);this.V=new Rt(e),this.B=new Rt(e),this.fP=[],t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.Fe=this.Fe,t.yu=this.yu,t.$g=this.$g,t.zi=this.zi,t.He=this.He,t.Es.h(this.Es),t.V.copyInheritedPropertiesFrom(this.V),t.B.copyInheritedPropertiesFrom(this.B)}fe(t){t in us?this.alignment=t:t in fs?this.arrangement=t:t in cs?this.compaction=t:t in hs?this.path=t:t in ls?this.sorting=t:t in ds?this.treeStyle=t:super.fe(t)}createNetwork(){return new gs(this)}makeNetwork(t){let e=this.createNetwork(),i=s=>{if(s instanceof J)return!s.isLinkLabel&&s.category!=="Comment";if(s instanceof j){let n=s.fromNode;if(n===null||n.isLinkLabel||n.category==="Comment")return!1;let o=s.toNode;return!(o===null||o.isLinkLabel||o.category==="Comment")}return!1};return t instanceof Y?(e.addParts(t.nodes,!0,i),e.addParts(t.links,!0,i)):t instanceof ht?e.addParts(t.memberParts,!1,i):e.addParts(t.iterator,!1,i),e}doLayout(t){this.network===null&&(this.network=this.makeNetwork(t)),this.arrangement!==52&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));let e=this.diagram;e===null&&t instanceof Y&&(e=t),this.path===0&&e!==null?this.ws=e.isTreePathToChildren?1:2:this.ws=this.path===0?1:this.path,this.network.vertexes.count>0&&(this.oU(),this.rU(),this.lU(),this.aU(),this.dL(),this.hU(),this.arrangeTrees(),this.updateParts()),this.network=null,this.Ie=new V,this.isValidLayout=!0}oU(){if(this.network===null)return;this.network.deleteSelfEdges();let t=this.network.vertexes.iterator;for(;t.next();){let n=t.value;n.initialized=!1,n.level=0,n.parent=null,n.children=[]}if(this.Ie.count>0){let n=new V,o=this.Ie.iterator;for(;o.next();){let r=o.value;if(r instanceof J){let a=this.network.findVertex(r);a!==null&&n.add(a)}else r instanceof Rt&&n.add(r)}this.Ie=n}this.Ie.count===0&&this.findRoots();let e=this.Ie.copy().iterator;for(;e.next();){let n=e.value;n.initialized||(n.initialized=!0,this.bL(n))}let i=this.network.vertexes,s=null;for(;s=this.cU(i),s.count>0;){let n=this.TF(s);n!==null&&(this.Ie.add(n),n.initialized=!0,this.bL(n)),i=s}}cU(t){let e=new V,i=t.iterator;for(;i.next();){let s=i.value;s.initialized||e.add(s)}return e}findRoots(){if(this.network===null)return;let t=this.network.vertexes,e=t.iterator;for(;e.next();){let i=e.value;switch(this.ws){case 1:i.sourceEdges.count===0&&this.Ie.add(i);break;case 2:i.destinationEdges.count===0&&this.Ie.add(i);break;default:m.o("Unhandled path value "+this.ws.toString())}}if(this.Ie.count===0){let i=this.TF(t);i!==null&&this.Ie.add(i)}}TF(t){let e=999999,i=null,s=t.iterator;for(;s.next();){let n=s.value;switch(this.ws){case 1:n.sourceEdges.count<e&&(e=n.sourceEdges.count,i=n);break;case 2:n.destinationEdges.count<e&&(e=n.destinationEdges.count,i=n);break;default:m.o("Unhandled path value "+this.ws.toString())}}return i}bL(t){if(t===null)return;switch(this.ws){case 1:if(t.destinationEdges.count>0){let s=new q,n=t.destinationVertexes;for(;n.next();){let o=n.value;this.DF(t,o)&&s.add(o)}s.count>0&&(t.children=s.toArray())}break;case 2:if(t.sourceEdges.count>0){let s=new q,n=t.sourceVertexes;for(;n.next();){let o=n.value;this.DF(t,o)&&s.add(o)}s.count>0&&(t.children=s.toArray())}break;default:m.o("Unhandled path value"+this.ws.toString())}let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];n.initialized=!0,n.level=t.level+1,n.parent=t,this.Ie.delete(n)}for(let s=0;s<i;s++){let n=e[s];this.bL(n)}}DF(t,e){return e.initialized?this.fU(e,t)||e.level>t.level?!1:(this.uU(e.parent,e),!0):!0}fU(t,e){if(e===null)return!1;let i=e.parent;for(;i!==null&&i!==t;)i=i.parent;return i===t}uU(t,e){if(t===null||e===null)return;let i=t.children,s=0;for(let n=0;n<i.length;n++)i[n]===e&&s++;if(s>0){let n=new Array(i.length-s),o=0;for(let r=0;r<i.length;r++)i[r]!==e&&(n[o++]=i[r]);t.children=n}}rU(){let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.vF(e)}}vF(t){if(t===null)return;this.initializeTreeVertexValues(t),t.alignment===25&&this.sortTreeVertexChildren(t);let e=0,i=t.childrenCount,s=0,n=t.children,o=n.length;for(let r=0;r<o;r++){let a=n[r];this.vF(a),e+=a.descendantCount+1,i=Math.max(i,a.maxChildrenCount),s=Math.max(s,a.maxGenerationCount)}t.descendantCount=e,t.maxChildrenCount=i,t.maxGenerationCount=i>0?s+1:0}dU(t){switch(this.yu){default:case 40:return t.parent!==null?t.parent:this.V;case 43:return t.parent===null?this.V:t.parent.parent===null?this.B:t.parent;case 42:return t.parent!==null?t.parent.parent!==null?t.parent.parent:this.B:this.V;case 41:{let e=!0;if(t.childrenCount===0)e=!1;else{let i=t.children,s=i.length;for(let n=0;n<s;n++)if(i[n].childrenCount>0){e=!1;break}}return e&&t.parent!==null?this.B:t.parent!==null?t.parent:this.V}}}initializeTreeVertexValues(t){let e=this.dU(t);if(t.copyInheritedPropertiesFrom(e),t.parent!==null&&t.parent.alignment===25){let i=t.angle,s=t.parent.children,n=0;for(;n<s.length&&t!==s[n];)n++;n%2===0?n!==s.length-1&&(i===90?i=180:i===180?i=270:i===270?i=180:i=270):i===90?i=0:i===180?i=90:i===270?i=0:i=90,t.angle=i}t.initialized=!0}lU(){let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.FF(e)}}FF(t){if(t===null)return;this.assignTreeVertexValues(t);let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];this.FF(n)}}assignTreeVertexValues(t){}aU(){let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.RF(e)}}RF(t){if(t===null)return;t.alignment!==25&&this.sortTreeVertexChildren(t);let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];this.RF(n)}}sortTreeVertexChildren(t){switch(t.sorting){default:case 10:break;case 11:t.children.reverse();break;case 12:t.children.sort(t.comparer);break;case 13:t.children.sort(t.comparer),t.children.reverse();break}}dL(){if(!this.comments||this.network===null)return;let t=this.network.vertexes.iterator;for(;t.next();){let e=t.value;this.addComments(e)}}addComments(t){let e=t.angle,i=t.parent,s=0,n=21,o=!1;i!==null&&(s=i.angle,n=i.alignment,o=this.isBusAlignment(n));let r=e===90||e===270,a=s===90||s===270,h=t.childrenCount===0,l=0,u=0,c=0,d=t.commentSpacing;if(t.node!==null){let f=t.node.findNodesConnected();for(;f.next();){let p=f.value;if(p.category!=="Comment"||!p.canLayout())continue;t.comments===null&&(t.comments=[]),t.comments.push(p),p.ensureBounds();let g=p.measuredBounds;r&&!h||!o&&!a&&h||o&&a&&h?(l=Math.max(l,g.width),u+=g.height+Math.abs(c)):(l+=g.width+Math.abs(c),u=Math.max(u,g.height)),c=d}}if(t.comments!==null){r&&!h||!o&&!a&&h||o&&a&&h?(l+=Math.abs(t.commentMargin),u=Math.max(0,u-t.height)):(u+=Math.abs(t.commentMargin),l=Math.max(0,l-t.width));let f=I.z(0,0,t.bounds.width+l,t.bounds.height+u);t.bounds=f,I.i(f)}}isBusAlignment(t){return t===24||t===25||t===26||t===27}vw(t){return t===24||t===25}kL(t){let e=t.parent;if(e!==null){let i=e.alignment;if(this.isBusAlignment(i))if(this.vw(i)){let s=e.children,n=0;for(;n<s.length&&t!==s[n];)n++;return n%2===0}else return i===26}return!1}layoutComments(t){if(t.comments!==null){let e=t.node.measuredBounds,i=t.parent,s=t.angle,n=0,o=21,r=!1;i!==null&&(n=i.angle,o=i.alignment,r=this.isBusAlignment(o));let a=s===90||s===270,h=n===90||n===270,l=t.childrenCount===0,u=this.kL(t),c=0,d=t.comments,f=d.length,p=P.l();for(let y=0;y<f;y++){let b=d[y],v=b.measuredBounds;if(a&&!l||!r&&!h&&l||r&&h&&l){if(n>135&&!r||h&&u)if(t.commentMargin>=0){p.e(t.bounds.x-t.commentMargin-v.width,t.bounds.y+c),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleLeft,k.toSpot=T.MiddleRight}}else{p.e(t.bounds.x+t.focus.x*2-t.commentMargin,t.bounds.y+c),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleRight,k.toSpot=T.MiddleLeft}}else if(t.commentMargin>=0){p.e(t.bounds.x+t.focus.x*2+t.commentMargin,t.bounds.y+c),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleRight,k.toSpot=T.MiddleLeft}}else{p.e(t.bounds.x+t.commentMargin-v.width,t.bounds.y+c),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleLeft,k.toSpot=T.MiddleRight}}t.commentSpacing>=0?c+=v.height+t.commentSpacing:c+=t.commentSpacing-v.height}else{if(n>135&&!r||!h&&u)if(t.commentMargin>=0){p.e(t.bounds.x+c,t.bounds.y-t.commentMargin-v.height),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleTop,k.toSpot=T.MiddleBottom}}else{p.e(t.bounds.x+c,t.bounds.y+t.focus.y*2-t.commentMargin),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleBottom,k.toSpot=T.MiddleTop}}else if(t.commentMargin>=0){p.e(t.bounds.x+c,t.bounds.y+t.focus.y*2+t.commentMargin),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleBottom,k.toSpot=T.MiddleTop}}else{p.e(t.bounds.x+c,t.bounds.y+t.commentMargin-v.height),b.move(p);let w=b.findLinksInto();for(;w.next();){let k=w.value;k.fromSpot=T.MiddleTop,k.toSpot=T.MiddleBottom}}t.commentSpacing>=0?c+=v.width+t.commentSpacing:c+=t.commentSpacing-v.width}}P.i(p);let g=c-t.commentSpacing-(a?e.height:e.width);if(this.ws===1){let y=t.destinationEdges;for(;y.next();){let b=y.value.link;b!==null&&!b.isAvoiding&&(b.fromEndSegmentLength=g>0?g:NaN)}}else{let y=t.sourceEdges;for(;y.next();){let b=y.value.link;b!==null&&!b.isAvoiding&&(b.toEndSegmentLength=g>0?g:NaN)}}}}hU(){if(this.network===null)return;if(this.layerStyle===62){let e=[],i=this.network.vertexes.iterator;for(;i.next();){let s=i.value,n=s.parent;n===null&&(n=s);let o=n.angle===0||n.angle===180,r=e[s.level];r===void 0&&(r=0),e[s.level]=Math.max(r,o?s.width:s.height)}for(let s=0;s<e.length;s++)e[s]===void 0&&(e[s]=0);for(this.xL=e,i=this.network.vertexes.iterator;i.next();){let s=i.value,n=s.parent;n===null&&(n=s),n.angle===0||n.angle===180?(n.angle===180&&(s.focusX+=e[s.level]-s.width),s.width=e[s.level]):(n.angle===270&&(s.focusY+=e[s.level]-s.height),s.height=e[s.level])}}else if(this.layerStyle===61){let e=this.network.vertexes.iterator;for(;e.next();){let i=e.value,s=i.angle===0||i.angle===180,n=-1;for(let o=0;o<i.children.length;o++){let r=i.children[o];n=Math.max(n,s?r.width:r.height)}if(n>=0)for(let o=0;o<i.children.length;o++){let r=i.children[o];s?(i.angle===180&&(r.focusX+=n-r.width),r.width=n):(i.angle===270&&(r.focusY+=n-r.height),r.height=n)}}}let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.layoutTree(e)}}layoutTree(t){if(t===null)return;let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];this.layoutTree(n)}switch(t.compaction){case 30:this.OF(t);break;default:case 31:t.alignment===25?this.OF(t):this.gU(t);break}}OF(t){if(t.childrenCount===0){let K=!1,z=0,U=21;t.parent!==null&&(z=t.parent.angle,U=t.parent.alignment,K=this.isBusAlignment(U));let tt=this.kL(t);t.U.e(0,0),t.dt.e(t.width,t.height),t.parent!==null&&t.comments!==null&&((z===180||z===270)&&!K||tt)?z===180&&!K||(z===90||z===270)&&tt?t.at.e(t.width-t.focus.x*2,0):t.at.e(0,t.height-t.focus.y*2):t.at.e(0,0);return}let e=this.orthoAngle(t),i=e===90||e===270,s=0,n=t.children,o=n.length;for(let K=0;K<o;K++){let z=n[K];s=Math.max(s,i?z.dt.width:z.dt.height)}let r=t.alignment,a=r===22,h=r===23,l=this.isBusAlignment(r),u=Math.max(0,t.breadthLimit),c=this.computeLayerSpacing(t),d=t.nodeSpacing,f=this.computeNodeIndent(t),p=a||h?0:f/2,g=t.rowSpacing,y=0;(a||h)&&(y=Math.max(0,t.rowIndent));let b=t.width,v=t.height,w=0,k=0,S=0,N=0,D=0,L=0,M=0,A=0,F=0,O=0;if(l&&!this.vw(r)&&e>135&&n.reverse(),this.vw(r))if(o>1)for(let K=0;K<o;K++){let z=n[K],U=z.dt;K%2===0&&K!==o-1?F=Math.max(F,(i?U.width:U.height)+this.computeBusNodeSpacing(z)-d):K%2!==0&&(O=Math.max(O,(i?U.width:U.height)+this.computeBusNodeSpacing(z)-d))}else o===1&&(F=i?n[0].dt.width:n[0].dt.height);if(l)switch(r){case 24:case 25:let K=I.l();e<135?this.IF(t,n,F,O,w,k,K):this.EF(t,n,F,O,w,k,K),F=K.x,w=K.width,k=K.height,I.i(K);break;case 26:for(let z=0;z<o;z++){let U=n[z],tt=U.dt,nt=M===0?0:g;i?(U.U.e(s-tt.width,D+nt),w=Math.max(w,tt.width),k=Math.max(k,D+nt+tt.height),D+=nt+tt.height):(U.U.e(N+nt,s-tt.height),w=Math.max(w,N+nt+tt.width),k=Math.max(k,tt.height),N+=nt+tt.width),M++}break;case 27:for(let z=0;z<o;z++){let U=n[z],tt=U.dt,nt=M===0?0:g;i?(U.U.e(d/2+t.focus.x,D+nt),w=Math.max(w,tt.width),k=Math.max(k,D+nt+tt.height),D+=nt+tt.height):(U.U.e(N+nt,d/2+t.focus.y),w=Math.max(w,N+nt+tt.width),k=Math.max(k,tt.height),N+=nt+tt.width),M++}break}else for(let K=0;K<o;K++){let z=n[K],U=z.dt;if(i){u>0&&M>0&&N+d+U.width>u&&(N<s&&this.pc(t,r,s-N,0,A,K-1),L++,M=0,A=K,S=k,N=0,D=e>135?-k-g:k+g);let tt=M===0?p:d;this.uP(z,0,D),z.U.e(N+tt,D),w=Math.max(w,N+tt+U.width),k=Math.max(k,S+(L===0?0:g)+U.height),N+=tt+U.width}else{u>0&&M>0&&D+d+U.height>u&&(D<s&&this.pc(t,r,0,s-D,A,K-1),L++,M=0,A=K,S=w,D=0,N=e>135?-w-g:w+g);let tt=M===0?p:d;this.uP(z,N,0),z.U.e(N,D+tt),k=Math.max(k,D+tt+U.height),w=Math.max(w,S+(L===0?0:g)+U.width),D+=tt+U.height}M++}L>0&&(i?(k+=Math.max(0,c),N<w&&this.pc(t,r,w-N,0,A,o-1),y>0&&(h||this.wu(t,y,0,0,o-1),w+=y)):(w+=Math.max(0,c),D<k&&this.pc(t,r,0,k-D,A,o-1),y>0&&(h||this.wu(t,0,y,0,o-1),k+=y)));let E=0,B=0;switch(r){case 20:i?E+=w/2-t.focus.x-f/2:B+=k/2-t.focus.y-f/2;break;default:case 21:if(L>0)i?E+=w/2-t.focus.x-f/2:B+=k/2-t.focus.y-f/2;else{let z=o;if(i){let U=n[0].U.x+n[0].at.x,tt=n[z-1].U.x+n[z-1].at.x+n[z-1].focus.x*2;E+=U+(tt-U)/2-t.focus.x-f/2}else{let U=n[0].U.y+n[0].at.y,tt=n[z-1].U.y+n[z-1].at.y+n[z-1].focus.y*2;B+=U+(tt-U)/2-t.focus.y-f/2}}break;case 22:i?(E-=f,w+=f):(B-=f,k+=f);break;case 23:i?(E+=w-t.width+f,w+=f):(B+=k-t.height+f,k+=f);break;case 24:case 25:i?o>1?E+=F+d/2-t.focus.x:E+=n[0].focus.x-t.focus.x+n[0].at.x:o>1?B+=F+d/2-t.focus.y:B+=n[0].focus.y-t.focus.y+n[0].at.y;break;case 26:i?E+=w+d/2-t.focus.x:B+=k+d/2-t.focus.y;break;case 27:break;case 28:let K=this.customAlignment(t,E,B,w,k);E=K[0],B=K[1],w=K[2],k=K[3];break}for(let K=0;K<o;K++){let z=n[K];i?z.U.e(z.U.x+z.at.x-E,z.U.y+(e>135?(l?-k:-z.dt.height)+z.at.y-c:v+c+z.at.y)):z.U.e(z.U.x+(e>135?(l?-w:-z.dt.width)+z.at.x-c:b+c+z.at.x),z.U.y+z.at.y-B)}i?(w=this.PL(t,w,E),E<0&&(E=0),e>135&&(B+=k+c),k=Math.max(Math.max(k,v),k+v+c)):(e>135&&(E+=w+c),w=Math.max(Math.max(w,b),w+b+c),k=this.SL(t,k,B),B<0&&(B=0)),t.at.e(E,B),t.dt.e(w,k)}customAlignment(t,e,i,s,n){return[e,i,s,n]}IF(t,e,i,s,n,o,r){let a=e.length;if(a===0)return r.e(i,0,n,o),r;if(a===1){let y=e[0];return n=y.dt.width,o=y.dt.height,r.e(i,0,n,o),r}let h=t.nodeSpacing,l=t.rowSpacing,u=this.orthoAngle(t)===90,c=0,d=0,f=0;for(let y=0;y<a;y++){if(y%2!==0||a>1&&y===a-1)continue;let b=e[y],v=b.dt,w=c===0?0:l;if(u){let k=this.computeBusNodeSpacing(b)-h;b.U.e(i-(v.width+k),f+w),n=Math.max(n,v.width+k),o=Math.max(o,f+w+v.height),f+=w+v.height}else{let k=this.computeBusNodeSpacing(b)-h;b.U.e(d+w,i-(v.height+k)),o=Math.max(o,v.height+k),n=Math.max(n,d+w+v.width),d+=w+v.width}c++}c=0;let p=d,g=f;u?(d=i+h,f=0):(d=0,f=i+h);for(let y=0;y<a;y++){if(y%2===0)continue;let b=e[y],v=b.dt,w=c===0?0:l;if(u){let k=this.computeBusNodeSpacing(b)-h;b.U.e(d+k,f+w),n=Math.max(n,d+v.width+k),o=Math.max(o,f+w+v.height),f+=w+v.height}else{let k=this.computeBusNodeSpacing(b)-h;b.U.e(d+w,f+k),n=Math.max(n,d+w+v.width),o=Math.max(o,f+v.height+k),d+=w+v.width}c++}if(a>1&&a%2===1){let y=e[a-1],b=y.dt,v=this.computeBusLastRowSpacing(y,u?Math.max(Math.abs(g),Math.abs(f)):Math.max(Math.abs(p),Math.abs(d)));if(u){y.U.e(i+h/2-y.focus.x-y.at.x,o+v);let w=i+h/2-y.focus.x-y.at.x;n=Math.max(n,w+b.width),w<0&&(n-=w),o=Math.max(o,Math.max(g,f)+v+b.height),y.U.x<0&&(i=this.dP(t,y.U.x,!1,i,h))}else{y.U.e(n+v,i+h/2-y.focus.y-y.at.y),n=Math.max(n,Math.max(p,d)+v+b.width);let w=i+h/2-y.focus.y-y.at.y;o=Math.max(o,w+b.height),w<0&&(o-=w),y.U.y<0&&(i=this.dP(t,y.U.y,!0,i,h))}}return r.e(i,0,n,o),r}EF(t,e,i,s,n,o,r){let a=e.length;if(a===0)return r.e(i,0,n,o),r;if(a===1){let y=e[0];return n=y.dt.width,o=y.dt.height,r.e(i,0,n,o),r}let h=t.nodeSpacing,l=t.rowSpacing,u=this.orthoAngle(t)===270,c=0,d=0,f=0;for(let y=0;y<a;y++){if(y%2!==0||a>1&&y===a-1)continue;let b=e[y],v=b.dt,w=c===0?0:l;if(u){let k=this.computeBusNodeSpacing(b)-h;f-=w+v.height,b.U.e(i-(v.width+k),f),n=Math.max(n,v.width+k),o=Math.max(o,Math.abs(f))}else{let k=this.computeBusNodeSpacing(b)-h;d-=w+v.width,b.U.e(d,i-(v.height+k)),o=Math.max(o,v.height+k),n=Math.max(n,Math.abs(d))}c++}c=0;let p=d,g=f;u?(d=i+h,f=0):(d=0,f=i+h);for(let y=0;y<a;y++){if(y%2===0)continue;let b=e[y],v=b.dt,w=c===0?0:l;if(u){let k=this.computeBusNodeSpacing(b)-h;f-=w+v.height,b.U.e(d+k,f),n=Math.max(n,d+v.width+k),o=Math.max(o,Math.abs(f))}else{let k=this.computeBusNodeSpacing(b)-h;d-=w+v.width,b.U.e(d,f+k),o=Math.max(o,f+v.height+k),n=Math.max(n,Math.abs(d))}c++}if(a>1&&a%2===1){let y=e[a-1],b=y.dt,v=this.computeBusLastRowSpacing(y,u?Math.max(Math.abs(g),Math.abs(f)):Math.max(Math.abs(p),Math.abs(d)));if(u){y.U.e(i+h/2-y.focus.x-y.at.x,-o-b.height-v);let w=i+h/2-y.focus.x-y.at.x;n=Math.max(n,w+b.width),w<0&&(n-=w),o=Math.max(o,Math.abs(Math.min(g,f))+v+b.height),y.U.x<0&&(i=this.dP(t,y.U.x,!1,i,h))}else{y.U.e(-n-b.width-v,i+h/2-y.focus.y-y.at.y),n=Math.max(n,Math.abs(Math.min(p,d))+v+b.width);let w=i+h/2-y.focus.y-y.at.y;o=Math.max(o,w+b.height),w<0&&(o-=w),y.U.y<0&&(i=this.dP(t,y.U.y,!0,i,h))}}for(let y=0;y<a;y++){let b=e[y];u?b.U.e(b.U.x,b.U.y+o):b.U.e(b.U.x+n,b.U.y)}return r.e(i,0,n,o),r}computeBusNodeSpacing(t){return t.parent===null?0:t.parent.nodeSpacing}computeBusLastRowSpacing(t,e){return t.parent===null?0:t.parent.rowSpacing}dP(t,e,i,s,n){let o=t.children,r=o.length;for(let h=0;h<r;h++)i?o[h].U.e(o[h].U.x,o[h].U.y-e):o[h].U.e(o[h].U.x-e,o[h].U.y);let a=o[r-1];return Math.max(s,i?a.at.y+a.focus.y-n/2:a.at.x+a.focus.x-n/2)}PL(t,e,i){switch(t.alignment){case 21:case 20:let s=e;return i+t.width>s&&(s=i+t.width),i<0&&(s-=i),s;case 22:return t.width>e?t.width:e;case 23:return t.focus.x*2>e?t.width:e+t.width-t.focus.x*2;case 24:case 25:let n=Math.min(0,i),o=Math.max(e,i+t.width);return Math.max(t.width,o-n);case 26:return t.width-t.focus.x+t.nodeSpacing/2+e;case 27:return Math.max(t.width,t.focus.x+t.nodeSpacing/2+e);default:return e}}SL(t,e,i){switch(t.alignment){case 21:case 20:let s=e;return i+t.height>s&&(s=i+t.height),i<0&&(s-=i),s;case 22:return t.height>e?t.height:e;case 23:return t.focus.y*2>e?t.height:e+t.height-t.focus.y*2;case 24:case 25:let n=Math.min(0,i),o=Math.max(e,i+t.height);return Math.max(t.height,o-n);case 26:return t.height-t.focus.y+t.nodeSpacing/2+e;case 27:return Math.max(t.height,t.focus.y+t.nodeSpacing/2+e);default:return e}}ML(t,e,i){switch(t){case 20:e/=2,i/=2;break;case 21:e/=2,i/=2;break;case 22:e=0,i=0;break;case 23:break;default:m.o("Unhandled alignment value "+t.toString())}return new P(e,i)}pc(t,e,i,s,n,o){let r=this.ML(e,i,s);this.wu(t,r.x,r.y,n,o)}wu(t,e,i,s,n){if(e===0&&i===0)return;let o=t.children;for(let r=s;r<=n;r++){let a=o[r].U;a.x+=e,a.y+=i}}uP(t,e,i){let s=t.parent;switch(this.ws){case 1:{let n=t.sourceEdges;for(;n.next();){let o=n.value;o.fromVertex===s&&o.relativePoint.e(e,i)}break}case 2:{let n=t.destinationEdges;for(;n.next();){let o=n.value;o.toVertex===s&&o.relativePoint.e(e,i)}break}default:m.o("Unhandled path value "+this.ws.toString())}}gU(t){if(t.childrenCount===0){let _=t.parent,at=!1,ct=0,yt=21;_!==null&&(ct=_.angle,yt=_.alignment,at=this.isBusAlignment(yt));let Ct=this.kL(t);t.U.e(0,0),t.dt.e(t.width,t.height),t.parent!==null&&t.comments!==null&&((ct===180||ct===270)&&!at||Ct)?ct===180&&!at||(ct===90||ct===270)&&Ct?t.at.e(t.width-t.focus.x*2,0):t.at.e(0,t.height-t.focus.y*2):t.at.e(0,0),t.Zg=null,t.Qg=null;return}let e=this.orthoAngle(t),i=e===90||e===270,s=0,n=t.children,o=n.length;for(let _=0;_<o;_++){let at=n[_];s=Math.max(s,i?at.dt.width:at.dt.height)}let r=t.alignment,a=r===22,h=r===23,l=this.isBusAlignment(r),u=Math.max(0,t.breadthLimit),c=this.computeLayerSpacing(t),d=t.nodeSpacing,f=this.computeNodeIndent(t),p=t.rowSpacing,g=0;(a||h)&&(g=Math.max(0,t.rowIndent));let y=t.width,b=t.height,v=0,w=0,k=0,S=null,N=null,D=0,L=0,M=0,A=0,F=0,O=0,E=0,B=0,K=0;if(l&&!this.vw(r)&&e>135&&n.reverse(),this.vw(r))if(o>1)for(let _=0;_<o;_++)_%2===0&&_!==o-1?B=Math.max(B,i?n[_].dt.width:n[_].dt.height):_%2!==0&&(K=Math.max(K,i?n[_].dt.width:n[_].dt.height));else o===1&&(B=i?n[0].dt.width:n[0].dt.height);if(l){switch(r){case 24:let _=I.l();e<135?this.IF(t,n,B,K,v,w,_):this.EF(t,n,B,K,v,w,_),B=_.x,v=_.width,w=_.height,I.i(_);break;case 26:for(let at=0;at<o;at++){let ct=n[at],yt=ct.dt,Ct=O===0?0:p;i?(ct.U.e(s-yt.width,A+Ct),v=Math.max(v,yt.width),w=Math.max(w,A+Ct+yt.height),A+=Ct+yt.height):(ct.U.e(M+Ct,s-yt.height),v=Math.max(v,M+Ct+yt.width),w=Math.max(w,yt.height),M+=Ct+yt.width),O++}break;case 27:for(let at=0;at<o;at++){let ct=n[at],yt=ct.dt,Ct=O===0?0:p;i?(ct.U.e(d/2+t.focus.x,A+Ct),v=Math.max(v,yt.width),w=Math.max(w,A+Ct+yt.height),A+=Ct+yt.height):(ct.U.e(M+Ct,d/2+t.focus.y),v=Math.max(v,M+Ct+yt.width),w=Math.max(w,yt.height),M+=Ct+yt.width),O++}break}S=this.pi(2),N=this.pi(2),i?(S[0].e(0,0),S[1].e(0,w),N[0].e(v,0),N[1].e(v,w)):(S[0].e(0,0),S[1].e(v,0),N[0].e(0,w),N[1].e(v,w))}else for(let _=0;_<o;_++){let at=n[_],ct=at.dt;if(i){u>0&&O>0&&M+d+ct.width>u&&(M<s&&this.pc(t,r,s-M,0,E,_-1),F++,O=0,E=_,k=w,M=0,A=e>135?-w-p:w+p),this.uP(at,0,A);let yt=0;if(O===0)S=at.Zg,N=at.Qg,D=ct.width,L=ct.height,(S===null||N===null||e!==this.orthoAngle(at))&&(S=this.pi(2),N=this.pi(2),S[0].e(0,0),S[1].e(0,L),N[0].e(D,0),N[1].e(D,L));else{let Ct=m.nt(),Q=I.l();this.UF(t,at,S,N,D,L,Ct,Q),yt=Q.x,S=Ct[0],N=Ct[1],D=Q.width,L=Q.height,m.Z(Ct),M<ct.width&&yt<0&&(this.wu(t,-yt,0,E,_-1),this.gP(S,-yt,0),this.gP(N,-yt,0),yt=0),I.i(Q)}at.U.e(yt,A),v=Math.max(v,D),w=Math.max(w,k+(F===0?0:p)+ct.height),M=D}else{u>0&&O>0&&A+d+ct.height>u&&(A<s&&this.pc(t,r,0,s-A,E,_-1),F++,O=0,E=_,k=v,A=0,M=e>135?-v-p:v+p),this.uP(at,M,0);let yt=0;if(O===0)S=at.Zg,N=at.Qg,D=ct.width,L=ct.height,(S===null||N===null||e!==this.orthoAngle(at))&&(S=this.pi(2),N=this.pi(2),S[0].e(0,0),S[1].e(D,0),N[0].e(0,L),N[1].e(D,L));else{let Ct=m.nt(),Q=I.l();this.UF(t,at,S,N,D,L,Ct,Q),yt=Q.x,S=Ct[0],N=Ct[1],D=Q.width,L=Q.height,m.Z(Ct),A<ct.height&&yt<0&&(this.wu(t,0,-yt,E,_-1),this.gP(S,0,-yt),this.gP(N,0,-yt),yt=0),I.i(Q)}at.U.e(M,yt),w=Math.max(w,L),v=Math.max(v,k+(F===0?0:p)+ct.width),A=L}O++}F>0&&(i?(w+=Math.max(0,c),M<v&&this.pc(t,r,v-M,0,E,o-1),g>0&&(h||this.wu(t,g,0,0,o-1),v+=g)):(v+=Math.max(0,c),A<w&&this.pc(t,r,0,w-A,E,o-1),g>0&&(h||this.wu(t,0,g,0,o-1),w+=g)));let z=0,U=0;switch(r){case 20:i?z+=v/2-t.focus.x-f/2:U+=w/2-t.focus.y-f/2;break;default:case 21:if(F>0)i?z+=v/2-t.focus.x-f/2:U+=w/2-t.focus.y-f/2;else{let at=o;if(i){let ct=n[0].U.x+n[0].at.x,yt=n[at-1].U.x+n[at-1].at.x+n[at-1].focus.x*2;z+=ct+(yt-ct)/2-t.focus.x-f/2}else{let ct=n[0].U.y+n[0].at.y,yt=n[at-1].U.y+n[at-1].at.y+n[at-1].focus.y*2;U+=ct+(yt-ct)/2-t.focus.y-f/2}}break;case 22:i?(z-=f,v+=f):(U-=f,w+=f);break;case 23:i?(z+=v-t.width+f,v+=f):(U+=w-t.height+f,w+=f);break;case 24:i?o>1?z+=B+d/2-t.focus.x:z+=n[0].focus.x-t.focus.x+n[0].at.x:o>1?U+=B+d/2-t.focus.y:U+=n[0].focus.y-t.focus.y+n[0].at.y;break;case 26:i?z+=v+d/2-t.focus.x:U+=w+d/2-t.focus.y;break;case 27:break;case 28:let _=this.customAlignment(t,z,U,v,w);z=_[0],U=_[1],v=_[2],w=_[3];break}for(let _=0;_<o;_++){let at=n[_];i?at.U.e(at.U.x+at.at.x-z,at.U.y+(e>135?(l?-w:-at.dt.height)+at.at.y-c:b+c+at.at.y)):at.U.e(at.U.x+(e>135?(l?-v:-at.dt.width)+at.at.x-c:y+c+at.at.x),at.U.y+at.at.y-U)}let tt=0,nt=0;if(l)i?(v=this.PL(t,v,z),z<0&&(z=0),e>135&&(U+=w+c),w+=b+c,r===27&&(tt+=d/2+t.focus.x),nt+=b+c):(e>135&&(z+=v+c),v+=y+c,w=this.SL(t,w,U),U<0&&(U=0),r===27&&(nt+=d/2+t.focus.y),tt+=y+c);else if(i){if(t.comments===null){if(y>v){let _=this.ML(r,y-v,0);tt=_.x,nt=_.y,v=y,z=0}}else v=this.PL(t,v,z);z<0&&(tt-=z,z=0),e>135&&(U+=w+c),w=Math.max(Math.max(w,b),w+b+c),nt+=b+c}else{if(e>135&&(z+=v+c),v=Math.max(Math.max(v,y),v+y+c),t.comments===null){if(b>w){let _=this.ML(r,0,b-w);tt=_.x,nt=_.y,w=b,U=0}}else w=this.SL(t,w,U);U<0&&(nt-=U,U=0),tt+=y+c}let Z,it;if(F>0)Z=this.pi(4),it=this.pi(4),i?(Z[2].e(0,b+c),Z[3].e(Z[2].x,w),it[2].e(v,Z[2].y),it[3].e(it[2].x,Z[3].y)):(Z[2].e(y+c,0),Z[3].e(v,Z[2].y),it[2].e(Z[2].x,w),it[3].e(Z[3].x,it[2].y));else{Z=this.pi(S.length+2),it=this.pi(N.length+2);for(let _=0;_<S.length;_++){let at=S[_];Z[_+2].e(at.x+tt,at.y+nt)}for(let _=0;_<N.length;_++){let at=N[_];it[_+2].e(at.x+tt,at.y+nt)}}i?(Z[0].e(z,0),Z[1].e(Z[0].x,b),Z[2].y<Z[1].y&&(Z[2].x>Z[0].x?Z[2].h(Z[1]):Z[1].h(Z[2])),Z[3].y<Z[2].y&&(Z[3].x>Z[0].x?Z[3].h(Z[2]):Z[2].h(Z[3])),it[0].e(z+y,0),it[1].e(it[0].x,b),it[2].y<it[1].y&&(it[2].x<it[0].x?it[2].h(it[1]):it[1].h(it[2])),it[3].y<it[2].y&&(it[3].x<it[0].x?it[3].h(it[2]):it[2].h(it[3])),Z[2].y-=c/2,it[2].y-=c/2):(Z[0].e(0,U),Z[1].e(y,Z[0].y),Z[2].x<Z[1].x&&(Z[2].y>Z[0].y?Z[2].h(Z[1]):Z[1].h(Z[2])),Z[3].x<Z[2].x&&(Z[3].y>Z[0].y?Z[3].h(Z[2]):Z[2].h(Z[3])),it[0].e(0,U+b),it[1].e(y,it[0].y),it[2].x<it[1].x&&(it[2].y<it[0].y?it[2].h(it[1]):it[1].h(it[2])),it[3].x<it[2].x&&(it[3].y<it[0].y?it[3].h(it[2]):it[2].h(it[3])),Z[2].x-=c/2,it[2].x-=c/2),this.fn(S),this.fn(N),t.Zg=Z,t.Qg=it,t.at.e(z,U),t.dt.e(v,w)}gP(t,e,i){for(let s=0;s<t.length;s++){let n=t[s];n.x+=e,n.y+=i}}UF(t,e,i,s,n,o,r,a){let h=this.orthoAngle(t),l=h===90||h===270,u=t.nodeSpacing,c=i,d=s,f=n,p=o,g=e.Zg,y=e.Qg,b=e.dt,v=l?Math.max(p,b.height):Math.max(f,b.width);if((g===null||h!==this.orthoAngle(e))&&(g=this.pi(2),y=this.pi(2),l?(g[0].e(0,0),g[1].e(0,b.height),y[0].e(b.width,0),y[1].e(y[0].x,g[1].y)):(g[0].e(0,0),g[1].e(b.width,0),y[0].e(0,b.height),y[1].e(g[1].x,y[0].y))),l){let w=f,k=w-this.mU(d,g,w);return k+=u,i=this.pU(c,g,k),s=this.yU(d,y,k),n=Math.max(0,k)+b.width,o=v,this.fn(c),this.fn(g),this.fn(d),this.fn(y),r[0]=i,r[1]=s,a.e(k,0,n,o),a}else{let w=p,k=w-this.wU(d,g,w);return k+=u,i=this.xU(c,g,k),s=this.bU(d,y,k),n=v,o=Math.max(0,k)+b.height,this.fn(c),this.fn(g),this.fn(d),this.fn(y),r[0]=i,r[1]=s,a.e(k,0,n,o),a}}xU(t,e,i){if(t===null||t.length<2||e===null||e.length<2)return null;let s=this.pi(t.length+e.length),n=0,o=0,r=0;for(;o<e.length&&e[o].x<t[0].x;){let l=e[o++];s[r++].e(l.x,l.y+i)}for(;n<t.length;){let l=t[n++];s[r++].e(l.x,l.y)}let a=t[t.length-1].x;for(;o<e.length&&e[o].x<=a;)o++;for(;o<e.length&&e[o].x>a;){let l=e[o++];s[r++].e(l.x,l.y+i)}let h=this.pi(r);for(n=0;n<r;n++)h[n].h(s[n]);return this.fn(s),h}pU(t,e,i){if(t===null||t.length<2||e===null||e.length<2)return null;let s=this.pi(t.length+e.length),n=0,o=0,r=0;for(;o<e.length&&e[o].y<t[0].y;){let l=e[o++];s[r++].e(l.x+i,l.y)}for(;n<t.length;){let l=t[n++];s[r++].e(l.x,l.y)}let a=t[t.length-1].y;for(;o<e.length&&e[o].y<=a;)o++;for(;o<e.length&&e[o].y>a;){let l=e[o++];s[r++].e(l.x+i,l.y)}let h=this.pi(r);for(n=0;n<r;n++)h[n].h(s[n]);return this.fn(s),h}bU(t,e,i){if(t===null||t.length<2||e===null||e.length<2)return null;let s=this.pi(t.length+e.length),n=0,o=0,r=0;for(;n<t.length&&t[n].x<e[0].x;){let l=t[n++];s[r++].e(l.x,l.y)}for(;o<e.length;){let l=e[o++];s[r++].e(l.x,l.y+i)}let a=e[e.length-1].x;for(;n<t.length&&t[n].x<=a;)n++;for(;n<t.length&&t[n].x>a;){let l=t[n++];s[r++].e(l.x,l.y)}let h=this.pi(r);for(n=0;n<r;n++)h[n].h(s[n]);return this.fn(s),h}yU(t,e,i){if(t===null||t.length<2||e===null||e.length<2)return null;let s=this.pi(t.length+e.length),n=0,o=0,r=0;for(;n<t.length&&t[n].y<e[0].y;){let l=t[n++];s[r++].e(l.x,l.y)}for(;o<e.length;){let l=e[o++];s[r++].e(l.x+i,l.y)}let a=e[e.length-1].y;for(;n<t.length&&t[n].y<=a;)n++;for(;n<t.length&&t[n].y>a;){let l=t[n++];s[r++].e(l.x,l.y)}let h=this.pi(r);for(n=0;n<r;n++)h[n].h(s[n]);return this.fn(s),h}wU(t,e,i){let s=9999999;if(t===null||t.length<2||e===null||e.length<2)return s;let n=0,o=0;for(;n<t.length&&o<e.length;){let r=t[n],a=e[o],h=a.x,l=a.y;l+=i;let u=r;n+1<t.length&&(u=t[n+1]);let c=a,d=c.x,f=c.y;o+1<e.length&&(c=e[o+1],d=c.x,f=c.y,f+=i);let p=s;r.x===h?p=l-r.y:r.x>h&&r.x<d?p=l+(r.x-h)/(d-h)*(f-l)-r.y:h>r.x&&h<u.x&&(p=l-(r.y+(h-r.x)/(u.x-r.x)*(u.y-r.y))),p<s&&(s=p),u.x<=r.x?n++:d<=h?o++:(u.x<=d&&n++,d<=u.x&&o++)}return s}mU(t,e,i){let s=9999999;if(t===null||t.length<2||e===null||e.length<2)return s;let n=0,o=0;for(;n<t.length&&o<e.length;){let r=t[n],a=e[o],h=a.x,l=a.y;h+=i;let u=r;n+1<t.length&&(u=t[n+1]);let c=a,d=c.x,f=c.y;o+1<e.length&&(c=e[o+1],d=c.x,f=c.y,d+=i);let p=s;r.y===l?p=h-r.x:r.y>l&&r.y<f?p=h+(r.y-l)/(f-l)*(d-h)-r.x:l>r.y&&l<u.y&&(p=h-(r.x+(l-r.y)/(u.y-r.y)*(u.x-r.x))),p<s&&(s=p),u.y<=r.y?n++:f<=l?o++:(u.y<=f&&n++,f<=u.y&&o++)}return s}pi(t){let e=this.fP[t];if(e!==void 0){let s=e.pop();if(s!==void 0)return s}let i=[];for(let s=0;s<t;s++)i[s]=new P;return i}fn(t){if(!t)return;let e=t.length,i=this.fP[e];i===void 0&&(i=[],this.fP[e]=i),i.push(t)}arrangeTrees(){if(this.He===52){let t=this.Ie.iterator;for(;t.next();){let e=t.value;if(!(e instanceof Rt))continue;let i=e.node;if(i===null)continue;let s=i.position,n=s.x,o=s.y;isFinite(n)||(n=0),isFinite(o)||(o=0),this.NL(e,n,o)}}else{let t=[],e=this.Ie.iterator;for(;e.next();){let o=e.value;o instanceof Rt&&t.push(o)}switch(this.sorting){default:case 10:break;case 11:t.reverse();break;case 12:t.sort(this.comparer);break;case 13:t.sort(this.comparer),t.reverse();break}let i=this.arrangementOrigin,s=i.x,n=i.y;for(let o=0;o<t.length;o++){let r=t[o];switch(this.NL(r,s+r.at.x,n+r.at.y),this.He){case 50:n+=r.dt.height+this.Es.height;break;default:case 51:s+=r.dt.width+this.Es.width;break}}}}NL(t,e,i){if(t===null)return;t.x=e,t.y=i;let s=t.children,n=s.length;for(let o=0;o<n;o++){let r=s[o];this.NL(r,e+r.U.x,i+r.U.y)}}commitLayout(){this.Pw(),this.commitNodes(),this.wL(),this.isRouting&&this.commitLinks()}commitNodes(){if(this.network===null)return;let t=this.network.vertexes.iterator;for(;t.next();)t.value.commit();for(t.reset();t.next();){let e=t.value;this.layoutComments(e)}}wL(){if(this.network===null||this.layerStyle!==62)return;let t=this.xL,e=[],i,s=this.network.vertexes.iterator;for(;s.next();){let h=s.value;i===void 0?i=h.bounds.copy():i.unionRect(h.bounds);let l=e[h.level];l===void 0?l=this.computeLayerSpacing(h):l=Math.max(l,this.computeLayerSpacing(h)),e[h.level]=l}if(!i)return;for(let h=0;h<e.length;h++)e[h]===void 0&&(e[h]=0);let n;this.angle===90||this.angle===270?(i.inflate(this.nodeSpacing/2,this.layerSpacing),n=new P(-this.nodeSpacing/2,-this.layerSpacing/2)):(i.inflate(this.layerSpacing,this.nodeSpacing/2),n=new P(-this.layerSpacing/2,-this.nodeSpacing/2));let o=[],r=this.angle===90||this.angle===270?i.width:i.height,a=0;if(this.angle===180||this.angle===270)for(let h=0;h<t.length;h++)a+=t[h]+e[h];for(let h=0;h<t.length;h++){let l=t[h]+e[h];this.angle===270?(a-=l,o.push(new I(0,a,r,l))):this.angle===90?(o.push(new I(0,a,r,l)),a+=l):this.angle===180?(a-=l,o.push(new I(a,0,l,r))):(o.push(new I(a,0,l,r)),a+=l)}this.commitLayers(o,n)}commitLayers(t,e){}commitLinks(){if(this.network===null)return;let t=this.network.edges.iterator;for(;t.next();)t.value.commit()}Pw(){let t=this.Ie.iterator;for(;t.next();){let e=t.value;e instanceof Rt&&this.VF(e)}}VF(t){if(t===null)return;this.setPortSpots(t);let e=t.children,i=e.length;for(let s=0;s<i;s++){let n=e[s];this.VF(n)}}setPortSpots(t){let e=t.alignment;if(this.isBusAlignment(e))this.kU(t,e);else{let i=this.orthoAngle(t);if(this.ws===1){let s=t.destinationEdges;for(;s.next();){let n=s.value.link;if(n!==null){if(t.setsPortSpot)if(t.portSpot.isDefault())switch(i){case 0:n.fromSpot=T.MiddleRight;break;case 90:n.fromSpot=T.MiddleBottom;break;case 180:n.fromSpot=T.MiddleLeft;break;default:n.fromSpot=T.MiddleTop;break}else n.fromSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.isDefault())switch(i){case 0:n.toSpot=T.MiddleLeft;break;case 90:n.toSpot=T.MiddleTop;break;case 180:n.toSpot=T.MiddleRight;break;default:n.toSpot=T.MiddleBottom;break}else n.toSpot=t.childPortSpot}}}else{let s=t.sourceEdges;for(;s.next();){let n=s.value.link;if(n!==null){if(t.setsPortSpot)if(t.portSpot.isDefault())switch(i){case 0:n.toSpot=T.MiddleRight;break;case 90:n.toSpot=T.MiddleBottom;break;case 180:n.toSpot=T.MiddleLeft;break;default:n.toSpot=T.MiddleTop;break}else n.toSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.isDefault())switch(i){case 0:n.fromSpot=T.MiddleLeft;break;case 90:n.fromSpot=T.MiddleTop;break;case 180:n.fromSpot=T.MiddleRight;break;default:n.fromSpot=T.MiddleBottom;break}else n.fromSpot=t.childPortSpot}}}}}kU(t,e){let i=this.ws===1,s=this.orthoAngle(t),n;switch(s){case 0:n=T.MiddleRight;break;case 90:n=T.MiddleBottom;break;case 180:n=T.MiddleLeft;break;default:n=T.MiddleTop;break}let o=t.children,r=o.length;switch(e){case 24:case 25:{for(let a=0;a<r;a++){let h=o[a],l=(i?h.sourceEdges:h.destinationEdges).first();if(l===null)continue;let u=l.link;if(u!==null){let c=s===90||s===270?T.MiddleLeft:T.MiddleTop;if(r===1||a===r-1&&r%2===1)switch(s){case 0:c=T.MiddleLeft;break;case 90:c=T.MiddleTop;break;case 180:c=T.MiddleRight;break;default:c=T.MiddleBottom;break}else a%2===0&&(c=s===90||s===270?T.MiddleRight:T.MiddleBottom);i?(t.setsPortSpot&&(u.fromSpot=n),t.setsChildPortSpot&&(u.toSpot=c)):(t.setsPortSpot&&(u.fromSpot=c),t.setsChildPortSpot&&(u.toSpot=n))}}break}case 26:{let a=s===90||s===270?T.MiddleRight:T.MiddleBottom,h=i?t.destinationEdges:t.sourceEdges;for(;h.next();){let l=h.value.link;l!==null&&(i?(t.setsPortSpot&&(l.fromSpot=n),t.setsChildPortSpot&&(l.toSpot=a)):(t.setsPortSpot&&(l.fromSpot=a),t.setsChildPortSpot&&(l.toSpot=n)))}break}case 27:{let a=s===90||s===270?T.MiddleLeft:T.MiddleTop,h=i?t.destinationEdges:t.sourceEdges;for(;h.next();){let l=h.value.link;l!==null&&(i?(t.setsPortSpot&&(l.fromSpot=n),t.setsChildPortSpot&&(l.toSpot=a)):(t.setsPortSpot&&(l.fromSpot=a),t.setsChildPortSpot&&(l.toSpot=n)))}break}}}orthoAngle(t){let e=t.angle;return e<=45?0:e<=135?90:e<=225?180:e<=315?270:0}computeLayerSpacing(t){let e=this.orthoAngle(t),i=e===90||e===270,s=t.layerSpacing;if(t.layerSpacingParentOverlap>0){let n=Math.min(1,t.layerSpacingParentOverlap);s-=i?t.height*n:t.width*n}return s<(i?-t.height:-t.width)&&(s=i?-t.height:-t.width),s}computeNodeIndent(t){let e=this.orthoAngle(t),i=e===90||e===270,s=t.nodeIndent;if(t.nodeIndentPastParent>0){let n=Math.min(1,t.nodeIndentPastParent);s+=i?t.width*n:t.height*n}return s=Math.max(0,s),s}get roots(){return this.Ie}set roots(t){this.Ie!==t&&(this.Ie=t,this.p())}get path(){return this.Fe}set path(t){this.Fe!==t&&(this.Fe=t,this.p())}get treeStyle(){return this.yu}set treeStyle(t){this.yu!==t&&(t===40||t===42||t===41||t===43)&&(this.yu=t,this.p())}get layerStyle(){return this.$g}set layerStyle(t){this.$g!==t&&(t===60||t===61||t===62)&&(this.$g=t,this.p())}get comments(){return this.zi}set comments(t){this.zi!==t&&(m.s(t,"boolean",zt,"comments"),this.zi=t,this.p())}get arrangement(){return this.He}set arrangement(t){this.He!==t&&(t===50||t===51||t===52)&&(this.He=t,this.p())}get arrangementSpacing(){return this.Es}set arrangementSpacing(t){this.Es.equals(t)||(this.Es.h(t),this.p())}get rootDefaults(){return this.V}set rootDefaults(t){this.V!==t&&(this.V=t,this.p())}get alternateDefaults(){return this.B}set alternateDefaults(t){this.B!==t&&(this.B=t,this.p())}get sorting(){return this.V.sorting}set sorting(t){this.V.sorting!==t&&(this.V.sorting=t,this.p())}get comparer(){return this.V.comparer}set comparer(t){this.V.comparer!==t&&(m.S(t,zt,"comparer"),this.V.comparer=t,this.p())}get angle(){return this.V.angle}set angle(t){this.V.angle!==t&&(m.s(t,"number",zt,"angle"),t===0||t===90||t===180||t===270?(this.V.angle=t,this.p()):m.o("TreeLayout.angle must be 0, 90, 180, or 270"))}get alignment(){return this.V.alignment}set alignment(t){this.V.alignment!==t&&(this.V.alignment=t,this.p())}get nodeIndent(){return this.V.nodeIndent}set nodeIndent(t){this.V.nodeIndent!==t&&(m.s(t,"number",zt,"nodeIndent"),t>=0&&(this.V.nodeIndent=t,this.p()))}get nodeIndentPastParent(){return this.V.nodeIndentPastParent}set nodeIndentPastParent(t){this.V.nodeIndentPastParent!==t&&(m.s(t,"number",zt,"nodeIndentPastParent"),t>=0&&t<=1&&(this.V.nodeIndentPastParent=t,this.p()))}get nodeSpacing(){return this.V.nodeSpacing}set nodeSpacing(t){this.V.nodeSpacing!==t&&(m.s(t,"number",zt,"nodeSpacing"),this.V.nodeSpacing=t,this.p())}get layerSpacing(){return this.V.layerSpacing}set layerSpacing(t){this.V.layerSpacing!==t&&(m.s(t,"number",zt,"layerSpacing"),this.V.layerSpacing=t,this.p())}get layerSpacingParentOverlap(){return this.V.layerSpacingParentOverlap}set layerSpacingParentOverlap(t){this.V.layerSpacingParentOverlap!==t&&(m.s(t,"number",zt,"layerSpacingParentOverlap"),t>=0&&t<=1&&(this.V.layerSpacingParentOverlap=t,this.p()))}get compaction(){return this.V.compaction}set compaction(t){this.V.compaction!==t&&(t===30||t===31)&&(this.V.compaction=t,this.p())}get breadthLimit(){return this.V.breadthLimit}set breadthLimit(t){this.V.breadthLimit!==t&&(m.s(t,"number",zt,"breadthLimit"),t>=0&&(this.V.breadthLimit=t,this.p()))}get rowSpacing(){return this.V.rowSpacing}set rowSpacing(t){this.V.rowSpacing!==t&&(m.s(t,"number",zt,"rowSpacing"),this.V.rowSpacing=t,this.p())}get rowIndent(){return this.V.rowIndent}set rowIndent(t){this.V.rowIndent!==t&&(m.s(t,"number",zt,"rowIndent"),t>=0&&(this.V.rowIndent=t,this.p()))}get commentSpacing(){return this.V.commentSpacing}set commentSpacing(t){this.V.commentSpacing!==t&&(m.s(t,"number",zt,"commentSpacing"),this.V.commentSpacing=t,this.p())}get commentMargin(){return this.V.commentMargin}set commentMargin(t){this.V.commentMargin!==t&&(m.s(t,"number",zt,"commentMargin"),this.V.commentMargin=t,this.p())}get setsPortSpot(){return this.V.setsPortSpot}set setsPortSpot(t){this.V.setsPortSpot!==t&&(m.s(t,"boolean",zt,"setsPortSpot"),this.V.setsPortSpot=t,this.p())}get portSpot(){return this.V.portSpot}set portSpot(t){this.V.portSpot.equals(t)||(this.V.portSpot=t,this.p())}get setsChildPortSpot(){return this.V.setsChildPortSpot}set setsChildPortSpot(t){this.V.setsChildPortSpot!==t&&(m.s(t,"boolean",zt,"setsChildPortSpot"),this.V.setsChildPortSpot=t,this.p())}get childPortSpot(){return this.V.childPortSpot}set childPortSpot(t){this.V.childPortSpot.equals(t)||(this.V.childPortSpot=t,this.p())}get alternateSorting(){return this.B.sorting}set alternateSorting(t){this.B.sorting!==t&&(this.B.sorting=t,this.p())}get alternateComparer(){return this.B.comparer}set alternateComparer(t){this.B.comparer!==t&&(m.S(t,zt,"alternateComparer"),this.B.comparer=t,this.p())}get alternateAngle(){return this.B.angle}set alternateAngle(t){this.B.angle!==t&&(m.s(t,"number",zt,"alternateAngle"),(t===0||t===90||t===180||t===270)&&(this.B.angle=t,this.p()))}get alternateAlignment(){return this.B.alignment}set alternateAlignment(t){this.B.alignment!==t&&(this.B.alignment=t,this.p())}get alternateNodeIndent(){return this.B.nodeIndent}set alternateNodeIndent(t){this.B.nodeIndent!==t&&(m.s(t,"number",zt,"alternateNodeIndent"),t>=0&&(this.B.nodeIndent=t,this.p()))}get alternateNodeIndentPastParent(){return this.B.nodeIndentPastParent}set alternateNodeIndentPastParent(t){this.B.nodeIndentPastParent!==t&&(m.s(t,"number",zt,"alternateNodeIndentPastParent"),t>=0&&t<=1&&(this.B.nodeIndentPastParent=t,this.p()))}get alternateNodeSpacing(){return this.B.nodeSpacing}set alternateNodeSpacing(t){this.B.nodeSpacing!==t&&(m.s(t,"number",zt,"alternateNodeSpacing"),this.B.nodeSpacing=t,this.p())}get alternateLayerSpacing(){return this.B.layerSpacing}set alternateLayerSpacing(t){this.B.layerSpacing!==t&&(m.s(t,"number",zt,"alternateLayerSpacing"),this.B.layerSpacing=t,this.p())}get alternateLayerSpacingParentOverlap(){return this.B.layerSpacingParentOverlap}set alternateLayerSpacingParentOverlap(t){this.B.layerSpacingParentOverlap!==t&&(m.s(t,"number",zt,"alternateLayerSpacingParentOverlap"),t>=0&&t<=1&&(this.B.layerSpacingParentOverlap=t,this.p()))}get alternateCompaction(){return this.B.compaction}set alternateCompaction(t){this.B.compaction!==t&&(t===30||t===31)&&(this.B.compaction=t,this.p())}get alternateBreadthLimit(){return this.B.breadthLimit}set alternateBreadthLimit(t){this.B.breadthLimit!==t&&(m.s(t,"number",zt,"alternateBreadthLimit"),t>=0&&(this.B.breadthLimit=t,this.p()))}get alternateRowSpacing(){return this.B.rowSpacing}set alternateRowSpacing(t){this.B.rowSpacing!==t&&(m.s(t,"number",zt,"alternateRowSpacing"),this.B.rowSpacing=t,this.p())}get alternateRowIndent(){return this.B.rowIndent}set alternateRowIndent(t){this.B.rowIndent!==t&&(m.s(t,"number",zt,"alternateRowIndent"),t>=0&&(this.B.rowIndent=t,this.p()))}get alternateCommentSpacing(){return this.B.commentSpacing}set alternateCommentSpacing(t){this.B.commentSpacing!==t&&(m.s(t,"number",zt,"alternateCommentSpacing"),this.B.commentSpacing=t,this.p())}get alternateCommentMargin(){return this.B.commentMargin}set alternateCommentMargin(t){this.B.commentMargin!==t&&(m.s(t,"number",zt,"alternateCommentMargin"),this.B.commentMargin=t,this.p())}get alternateSetsPortSpot(){return this.B.setsPortSpot}set alternateSetsPortSpot(t){this.B.setsPortSpot!==t&&(m.s(t,"boolean",zt,"alternateSetsPortSpot"),this.B.setsPortSpot=t,this.p())}get alternatePortSpot(){return this.B.portSpot}set alternatePortSpot(t){this.B.portSpot.equals(t)||(this.B.portSpot=t,this.p())}get alternateSetsChildPortSpot(){return this.B.setsChildPortSpot}set alternateSetsChildPortSpot(t){this.B.setsChildPortSpot!==t&&(m.s(t,"boolean",zt,"alternateSetsChildPortSpot"),this.B.setsChildPortSpot=t,this.p())}get alternateChildPortSpot(){return this.B.childPortSpot}set alternateChildPortSpot(t){this.B.childPortSpot.equals(t)||(this.B.childPortSpot=t,this.p())}static PathDefault=0;static PathDestination=1;static PathSource=2;static SortingForwards=10;static SortingReverse=11;static SortingAscending=12;static SortingDescending=13;static AlignmentCenterSubtrees=20;static AlignmentCenterChildren=21;static AlignmentStart=22;static AlignmentEnd=23;static AlignmentBus=24;static AlignmentBusBranching=25;static AlignmentTopLeftBus=26;static AlignmentBottomRightBus=27;static CompactionNone=30;static CompactionBlock=31;static StyleLayered=40;static StyleLastParents=41;static StyleAlternating=42;static StyleRootOnly=43;static ArrangementVertical=50;static ArrangementHorizontal=51;static ArrangementFixedRoots=52;static LayerIndividual=60;static LayerSiblings=61;static LayerUniform=62}class gs extends Ee{constructor(t){super(t)}createVertex(){return new Rt(this)}createEdge(){return new sn(this)}}class Rt extends Ie{U;dt;at;mP;pP;yP;wP;xP;bP;kP;zi;Zg;Qg;Si;Mi;Xt;de;Fw;Rw;Ow;Us;Iw;Ew;Uw;Vw;Bw;zw;Xw;Gw;Yw;Kw;Hw;constructor(t){super(t),this.mP=!1,this.pP=null,this.yP=[],this.wP=0,this.xP=0,this.bP=0,this.kP=0,this.zi=null,this.U=new P(0,0),this.dt=new st(0,0),this.at=new P(0,0),this.Zg=null,this.Qg=null,this.Si=10,this.Mi=Ie.standardComparer,this.Xt=0,this.de=21,this.Fw=0,this.Rw=0,this.Ow=20,this.Us=50,this.Iw=0,this.Ew=31,this.Uw=0,this.Vw=25,this.Bw=10,this.zw=10,this.Xw=20,this.Gw=!0,this.Yw=T.Default,this.Kw=!0,this.Hw=T.Default}copyInheritedPropertiesFrom(t){t!==null&&(this.Si=t.sorting,this.Mi=t.comparer,this.Xt=t.angle,this.de=t.alignment,this.Fw=t.nodeIndent,this.Rw=t.nodeIndentPastParent,this.Ow=t.nodeSpacing,this.Us=t.layerSpacing,this.Iw=t.layerSpacingParentOverlap,this.Ew=t.compaction,this.Uw=t.breadthLimit,this.Vw=t.rowSpacing,this.Bw=t.rowIndent,this.zw=t.commentSpacing,this.Xw=t.commentMargin,this.Gw=t.setsPortSpot,this.Yw=t.portSpot,this.Kw=t.setsChildPortSpot,this.Hw=t.childPortSpot)}get initialized(){return this.mP}set initialized(t){this.mP!==t&&(m.s(t,"boolean",Rt,"initialized"),this.mP=t)}get parent(){return this.pP}set parent(t){this.pP!==t&&(this.pP=t)}get children(){return this.yP}set children(t){if(this.yP!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",Rt,"children:value"),t!==null){let e=t.length;for(let i=0;i<e;i++){let s=t[i]}}this.yP=t}}get level(){return this.wP}set level(t){this.wP!==t&&(m.s(t,"number",Rt,"level"),this.wP=t)}get descendantCount(){return this.xP}set descendantCount(t){this.xP!==t&&(m.s(t,"number",Rt,"descendantCount"),this.xP=t)}get maxChildrenCount(){return this.bP}set maxChildrenCount(t){this.bP!==t&&(m.s(t,"number",Rt,"maxChildrenCount"),this.bP=t)}get maxGenerationCount(){return this.kP}set maxGenerationCount(t){this.kP!==t&&(m.s(t,"number",Rt,"maxGenerationCount"),this.kP=t)}get comments(){return this.zi}set comments(t){if(this.zi!==t){if(t!==null&&!Array.isArray(t)&&m.si(t,"Array",Rt,"comments:value"),t!==null){let e=t.length;for(let i=0;i<e;i++){let s=t[i]}}this.zi=t}}get sorting(){return this.Si}set sorting(t){this.Si!==t&&(this.Si=t)}get comparer(){return this.Mi}set comparer(t){this.Mi!==t&&(m.S(t,Rt,"comparer"),this.Mi=t)}get angle(){return this.Xt}set angle(t){this.Xt!==t&&(m.s(t,"number",Rt,"angle"),this.Xt=t)}get alignment(){return this.de}set alignment(t){this.de!==t&&(this.de=t)}get nodeIndent(){return this.Fw}set nodeIndent(t){this.Fw!==t&&(m.s(t,"number",Rt,"nodeIndent"),this.Fw=t)}get nodeIndentPastParent(){return this.Rw}set nodeIndentPastParent(t){this.Rw!==t&&(m.s(t,"number",Rt,"nodeIndentPastParent"),this.Rw=t)}get nodeSpacing(){return this.Ow}set nodeSpacing(t){this.Ow!==t&&(m.s(t,"number",Rt,"nodeSpacing"),this.Ow=t)}get layerSpacing(){return this.Us}set layerSpacing(t){this.Us!==t&&(m.s(t,"number",Rt,"layerSpacing"),this.Us=t)}get layerSpacingParentOverlap(){return this.Iw}set layerSpacingParentOverlap(t){this.Iw!==t&&(m.s(t,"number",Rt,"layerSpacingParentOverlap"),this.Iw=t)}get compaction(){return this.Ew}set compaction(t){this.Ew!==t&&(this.Ew=t)}get breadthLimit(){return this.Uw}set breadthLimit(t){this.Uw!==t&&(m.s(t,"number",Rt,"breadthLimit"),this.Uw=t)}get rowSpacing(){return this.Vw}set rowSpacing(t){this.Vw!==t&&(m.s(t,"number",Rt,"rowSpacing"),this.Vw=t)}get rowIndent(){return this.Bw}set rowIndent(t){this.Bw!==t&&(m.s(t,"number",Rt,"rowIndent"),this.Bw=t)}get commentSpacing(){return this.zw}set commentSpacing(t){this.zw!==t&&(m.s(t,"number",Rt,"commentSpacing"),this.zw=t)}get commentMargin(){return this.Xw}set commentMargin(t){this.Xw!==t&&(m.s(t,"number",Rt,"commentMargin"),this.Xw=t)}get setsPortSpot(){return this.Gw}set setsPortSpot(t){this.Gw!==t&&(m.s(t,"boolean",Rt,"setsPortSpot"),this.Gw=t)}get portSpot(){return this.Yw}set portSpot(t){this.Yw.equals(t)||(this.Yw=t)}get setsChildPortSpot(){return this.Kw}set setsChildPortSpot(t){this.Kw!==t&&(m.s(t,"boolean",Rt,"setsChildPortSpot"),this.Kw=t)}get childPortSpot(){return this.Hw}set childPortSpot(t){this.Hw.equals(t)||(this.Hw=t)}get childrenCount(){return this.children.length}get relativePosition(){return this.U}set relativePosition(t){this.U.set(t)}get subtreeSize(){return this.dt}set subtreeSize(t){this.dt.set(t)}get subtreeOffset(){return this.at}set subtreeOffset(t){this.at.set(t)}}class sn extends ei{PP;constructor(t){super(t),this.PP=new P(0,0)}commit(){let t=this.link;if(t===null||t.isAvoiding)return;let e=this.network.layout,i=null,s=null;switch(e.ws){case 1:i=this.fromVertex,s=this.toVertex;break;case 2:i=this.toVertex,s=this.fromVertex;break;default:m.o("Unhandled path value "+e.ws.toString())}if(i===null||s===null)return;let n=this.PP;if(n.x===0&&n.y===0){this.PU(i,s);return}let o=i.bounds,r=e.orthoAngle(i),a=e.computeLayerSpacing(i),h=i.rowSpacing;t.updateRoute();let l=t.curve===9,u=t.isOrthogonal,c=0,d,f;if(t.startRoute(),u||l){for(c=2;t.pointsCount>4;)t.removePoint(2);d=t.getPoint(1),f=t.getPoint(2)}else{for(c=1;t.pointsCount>3;)t.removePoint(1);d=t.getPoint(0),f=t.getPoint(t.pointsCount-1)}let p=t.getPoint(t.pointsCount-1),g=0;r===0?(i.alignment===23?(g=o.bottom+n.y,n.y===0&&d.y>p.y+i.rowIndent&&(g=Math.min(g,Math.max(d.y,g-e.computeNodeIndent(i))))):i.alignment===22?(g=o.top+n.y,n.y===0&&d.y<p.y-i.rowIndent&&(g=Math.max(g,Math.min(d.y,g+e.computeNodeIndent(i))))):g=o.y+o.height/2+n.y,l?(t.insertPointAt(c,d.x,g),c++,t.insertPointAt(c,o.right+a,g),c++,t.insertPointAt(c,o.right+a+(n.x-h)/3,g),c++,t.insertPointAt(c,o.right+a+(n.x-h)*2/3,g),c++,t.insertPointAt(c,o.right+a+(n.x-h),g),c++,t.insertPointAt(c,f.x,g),c++):(u&&(t.insertPointAt(c,o.right+a/2,d.y),c++),t.insertPointAt(c,o.right+a/2,g),c++,t.insertPointAt(c,o.right+a+n.x-(u?h/2:h),g),c++,u&&(t.insertPointAt(c,t.getPoint(c-1).x,f.y),c++))):r===90?(i.alignment===23?(g=o.right+n.x,n.x===0&&d.x>p.x+i.rowIndent&&(g=Math.min(g,Math.max(d.x,g-e.computeNodeIndent(i))))):i.alignment===22?(g=o.left+n.x,n.x===0&&d.x<p.x-i.rowIndent&&(g=Math.max(g,Math.min(d.x,g+e.computeNodeIndent(i))))):g=o.x+o.width/2+n.x,l?(t.insertPointAt(c,g,d.y),c++,t.insertPointAt(c,g,o.bottom+a),c++,t.insertPointAt(c,g,o.bottom+a+(n.y-h)/3),c++,t.insertPointAt(c,g,o.bottom+a+(n.y-h)*2/3),c++,t.insertPointAt(c,g,o.bottom+a+(n.y-h)),c++,t.insertPointAt(c,g,f.y),c++):(u&&(t.insertPointAt(c,d.x,o.bottom+a/2),c++),t.insertPointAt(c,g,o.bottom+a/2),c++,t.insertPointAt(c,g,o.bottom+a+n.y-(u?h/2:h)),c++,u&&(t.insertPointAt(c,f.x,t.getPoint(c-1).y),c++))):r===180?(i.alignment===23?(g=o.bottom+n.y,n.y===0&&d.y>p.y+i.rowIndent&&(g=Math.min(g,Math.max(d.y,g-e.computeNodeIndent(i))))):i.alignment===22?(g=o.top+n.y,n.y===0&&d.y<p.y-i.rowIndent&&(g=Math.max(g,Math.min(d.y,g+e.computeNodeIndent(i))))):g=o.y+o.height/2+n.y,l?(t.insertPointAt(c,d.x,g),c++,t.insertPointAt(c,o.left-a,g),c++,t.insertPointAt(c,o.left-a+(n.x+h)/3,g),c++,t.insertPointAt(c,o.left-a+(n.x+h)*2/3,g),c++,t.insertPointAt(c,o.left-a+(n.x+h),g),c++,t.insertPointAt(c,f.x,g),c++):(u&&(t.insertPointAt(c,o.left-a/2,d.y),c++),t.insertPointAt(c,o.left-a/2,g),c++,t.insertPointAt(c,o.left-a+n.x+(u?h/2:h),g),c++,u&&(t.insertPointAt(c,t.getPoint(c-1).x,f.y),c++))):r===270?(i.alignment===23?(g=o.right+n.x,n.x===0&&d.x>p.x+i.rowIndent&&(g=Math.min(g,Math.max(d.x,g-e.computeNodeIndent(i))))):i.alignment===22?(g=o.left+n.x,n.x===0&&d.x<p.x-i.rowIndent&&(g=Math.max(g,Math.min(d.x,g+e.computeNodeIndent(i))))):g=o.x+o.width/2+n.x,l?(t.insertPointAt(c,g,d.y),c++,t.insertPointAt(c,g,o.top-a),c++,t.insertPointAt(c,g,o.top-a+(n.y+h)/3),c++,t.insertPointAt(c,g,o.top-a+(n.y+h)*2/3),c++,t.insertPointAt(c,g,o.top-a+(n.y+h)),c++,t.insertPointAt(c,g,f.y),c++):(u&&(t.insertPointAt(c,d.x,o.top-a/2),c++),t.insertPointAt(c,g,o.top-a/2),c++,t.insertPointAt(c,g,o.top-a+n.y+(u?h/2:h)),c++,u&&(t.insertPointAt(c,f.x,t.getPoint(c-1).y),c++))):m.o("Invalid angle "+r),t.commitRoute()}PU(t,e){let i=this.link;if(i===null)return;let s=this.network.layout,n=s.orthoAngle(t),o=s.orthoAngle(e);if(n===o)return;let r=s.computeLayerSpacing(t),a=t.bounds,h=e.bounds;if(n===0&&h.left-a.right<r+1||n===90&&h.top-a.bottom<r+1||n===180&&a.left-h.right<r+1||n===270&&a.top-h.bottom<r+1)return;i.updateRoute();let l=i.curve===9,u=i.isOrthogonal,c=this.fromVertex,d=s.isBusAlignment(c.alignment);if(i.startRoute(),n===0){let f=a.right+r/2;if(l){if(i.pointsCount===4){let p=i.getPoint(3).y;i.setPointAt(1,f-20,i.getPoint(1).y),i.insertPointAt(2,f-20,p),i.insertPointAt(3,f,p),i.insertPointAt(4,f+20,p),i.setPointAt(5,i.getPoint(5).x,p)}}else u?d?i.setPointAt(3,i.getPoint(2).x,i.getPoint(4).y):i.pointsCount===6&&(i.setPointAt(2,f,i.getPoint(2).y),i.setPointAt(3,f,i.getPoint(3).y)):i.pointsCount===4?i.insertPointAt(2,f,i.getPoint(2).y):i.pointsCount===3?i.setPointAt(1,f,i.getPoint(2).y):i.pointsCount===2&&i.insertPointAt(1,f,i.getPoint(1).y)}else if(n===90){let f=a.bottom+r/2;if(l){if(i.pointsCount===4){let p=i.getPoint(3).x;i.setPointAt(1,i.getPoint(1).x,f-20),i.insertPointAt(2,p,f-20),i.insertPointAt(3,p,f),i.insertPointAt(4,p,f+20),i.setPointAt(5,p,i.getPoint(5).y)}}else u?d?i.setPointAt(3,i.getPoint(2).x,i.getPoint(4).y):i.pointsCount===6&&(i.setPointAt(2,i.getPoint(2).x,f),i.setPointAt(3,i.getPoint(3).x,f)):i.pointsCount===4?i.insertPointAt(2,i.getPoint(2).x,f):i.pointsCount===3?i.setPointAt(1,i.getPoint(2).x,f):i.pointsCount===2&&i.insertPointAt(1,i.getPoint(1).x,f)}else if(n===180){let f=a.left-r/2;if(l){if(i.pointsCount===4){let p=i.getPoint(3).y;i.setPointAt(1,f+20,i.getPoint(1).y),i.insertPointAt(2,f+20,p),i.insertPointAt(3,f,p),i.insertPointAt(4,f-20,p),i.setPointAt(5,i.getPoint(5).x,p)}}else u?d?i.setPointAt(3,i.getPoint(2).x,i.getPoint(4).y):i.pointsCount===6&&(i.setPointAt(2,f,i.getPoint(2).y),i.setPointAt(3,f,i.getPoint(3).y)):i.pointsCount===4?i.insertPointAt(2,f,i.getPoint(2).y):i.pointsCount===3?i.setPointAt(1,f,i.getPoint(2).y):i.pointsCount===2&&i.insertPointAt(1,f,i.getPoint(1).y)}else if(n===270){let f=a.top-r/2;if(l){if(i.pointsCount===4){let p=i.getPoint(3).x;i.setPointAt(1,i.getPoint(1).x,f+20),i.insertPointAt(2,p,f+20),i.insertPointAt(3,p,f),i.insertPointAt(4,p,f-20),i.setPointAt(5,p,i.getPoint(5).y)}}else u?d?i.setPointAt(3,i.getPoint(2).x,i.getPoint(4).y):i.pointsCount===6&&(i.setPointAt(2,i.getPoint(2).x,f),i.setPointAt(3,i.getPoint(3).x,f)):i.pointsCount===4?i.insertPointAt(2,i.getPoint(2).x,f):i.pointsCount===3?i.setPointAt(1,i.getPoint(2).x,f):i.pointsCount===2&&i.insertPointAt(1,i.getPoint(1).x,f)}i.commitRoute()}get fromVertex(){return this.is}set fromVertex(t){this.is!==t&&(this.is=t)}get toVertex(){return this.ss}set toVertex(t){this.ss!==t&&(this.ss=t)}get relativePoint(){return this.PP}set relativePoint(t){this.PP.set(t)}}class be{constructor(){}static Light={colors:{text:"#0a0a0a",comment:"#ca8a04",link:"#0a0a0a",group:"#a3a3a344",outline:"#a3a3a3",selection:"#0ea5e9",div:"#fff",gridMinor:"#e5e5e5",gridMajor:"#a3a3a3",overviewBox:"#c026d3",tempLink:"#2563eb",tempPort:"#c026d3",adornmentFill:"#0ea5e9",adornmentStroke:"#1e40af",dragSelect:"#c026d3"},fonts:{normal:"10pt sans-serif",bold:"bold 12pt sans-serif"},numbers:{group:1,selection:3},margins:{group:new Dt(5)},arrowheads:{toArrow:"Standard"}};static Dark={colors:{text:"#f5f5f5",comment:"#facc15",link:"#f5f5f5",group:"#a3a3a388",outline:"#a3a3a3",selection:"#38bdf8",div:"#171717",gridMinor:"#262626",gridMajor:"#404040",overviewBox:"#e879f9",tempLink:"#60a5fa",tempPort:"#e879f9",adornmentFill:"#38bdf8",adornmentStroke:"#2563eb",dragSelect:"#e879f9"},fonts:{normal:"10pt sans-serif",bold:"bold 12pt sans-serif"},numbers:{group:1,selection:3},margins:{group:new Dt(5)},arrowheads:{toArrow:"Standard"}}}class Ge{hs=new Set;xu=new Mt;SP="light";MP="light";NP=!1;CL=!0;_g="light";BF=t=>{let e=t.matches?"dark":"light";e!==this._g&&(this._g=e,this.MP==="system"&&this.updateDiagrams())};constructor(t){t&&Object.assign(this,t),t?.themeMap||(this.xu.set("light",{colors:{...be.Light.colors},fonts:{...be.Light.fonts},numbers:{...be.Light.numbers},margins:{...be.Light.margins},arrowheads:{...be.Light.arrowheads}}),this.xu.set("dark",{colors:{...be.Dark.colors},fonts:{...be.Dark.fonts},numbers:{...be.Dark.numbers},margins:{...be.Dark.margins},arrowheads:{...be.Dark.arrowheads}})),X.matchMedia&&(this._g=X.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}get themeMap(){return this.xu}set themeMap(t){this.xu!==t&&(this.xu=t,this.updateDiagrams())}get defaultTheme(){return this.SP}set defaultTheme(t){this.SP!==t&&(m.s(t,"string",Ge,"defaultTheme"),this.SP=t,this.updateDiagrams())}get currentTheme(){return this.MP}set currentTheme(t){this.MP!==t&&(m.s(t,"string",Ge,"currentTheme"),this.MP=t,this.updateDiagrams())}get changesDivBackground(){return this.NP}set changesDivBackground(t){if(this.NP!==t&&(this.NP=t,t))for(let e of this.hs)e.setDivBackground(this.findValue("div","","fill")),e.T("ThemeChanged",this)}get readsCssVariables(){return this.CL}set readsCssVariables(t){this.CL!==t&&(this.CL=t,this.updateDiagrams())}get preferredColorScheme(){return this._g}addDiagram(t){return this.hs.add(t),this.LL(t),this}removeDiagram(t){return this.hs.delete(t),this.LL(t),this}eO(){this.hs.size===0&&X.matchMedia&&X.matchMedia("(prefers-color-scheme: dark)")?.addEventListener("change",this.BF)}iO(){this.hs.size===0&&X.matchMedia&&X.matchMedia("(prefers-color-scheme: dark)")?.removeEventListener("change",this.BF)}set(t,e){t===""&&(t=this.SP),t==="system"&&(t=this._g);let i=this.xu.get(t);return i?i=this.zF(i,e):i=e,this.xu.set(t,i),this.updateDiagrams(),this}findValue(t,e,i){return this.getValue(this.findTheme(this.currentTheme),t,e,i)||this.getValue(this.findTheme(this.defaultTheme),t,e,i)}getValue(t,e,i,s){if(!t)return;i==null&&(i="");let n=t,o=a=>{if(n===void 0||a==="")return;if(typeof a=="number"||!(Array.isArray(a)||a.includes(".")))return n[a];let h=Array.isArray(a)?a:a.split(".");for(let l=0;l<h.length;l++){let u=h[l];if(u!==""&&(n=n[u],n===void 0))return}return n},r=()=>{if(!(i!==""&&(n=o(i),n===void 0)))return Array.isArray(n)&&typeof e=="number"?n=n[e%n.length]:n=o(e),n};if(n=r(),n===void 0&&typeof s=="string"&&s.length>0){let a=t.targetPropertyMap?.get(s);if(a?n=t[a]:(a=Ge.SU.get(s),n=a?t[a]:t.colors),n=r(),n!==void 0)return n}return n}findTheme(t){return this.themeMap.get(t==="system"?this._g:t)}updateDiagrams(){for(let t of this.hs)this.LL(t)}LL(t){let e=t.skipsUndoManager;t.skipsUndoManager=!0,t.updateAllThemeBindings(),this.NP&&t.setDivBackground(this.findValue("div","","fill")),t.skipsUndoManager=e,t.T("ThemeChanged",this)}zF(t,e){for(let i in e)if(m.qw(e,i))try{e[i]?.constructor===Object?t[i]=this.zF(t[i]??{},e[i]):t[i]=e[i]}catch{delete t[i]}return t}static SU=new Map([["background","colors"],["defaultColumnSeparatorStroke","colors"],["defaultRowSeparatorStroke","colors"],["shadowColor","colors"],["fill","colors"],["stroke","colors"],["font","fonts"],["angle","numbers"],["fromEndSegmentLength","numbers"],["fromShortLength","numbers"],["height","numbers"],["opacity","numbers"],["scale","numbers"],["toEndSegmentLength","numbers"],["toShortLength","numbers"],["width","numbers"],["defaultColumnSeparatorStrokeWidth","numbers"],["defaultRowSeparatorStrokeWidth","numbers"],["shadowBlur","numbers"],["corner","numbers"],["curviness","numbers"],["smoothness","numbers"],["parameter1","numbers"],["parameter2","numbers"],["strokeWidth","numbers"],["strokeDashOffset","numbers"],["maxLines","numbers"],["spacingAbove","numbers"],["spacingBelow","numbers"],["position","points"],["shadowOffset","points"],["desiredSize","sizes"],["maxSize","sizes"],["minSize","sizes"],["margin","margins"],["defaultSeparatorPadding","margins"],["padding","margins"],["alignment","spots"],["alignmentFocus","spots"],["fromSpot","spots"],["toSpot","spots"],["defaultAlignment","spots"],["spot1","spots"],["spot2","spots"],["verticalAlignment","spots"],["imageAlignment","spots"],["fromArrow","arrowheads"],["toArrow","arrowheads"]])}class nn{Pt;a;Be;Pl;constructor(){this.a=Y.Om(),this.Pt="",this.Be=!0,this.Pl=!0}get name(){return this.Pt}set name(t){this.Pt=t}get isEnabled(){return this.Be}set isEnabled(t){this.Be=t}get isRealtime(){return this.Pl}set isRealtime(t){this.Pl=t}get diagram(){return this.a}set diagram(t){this.a!==t&&(this.a=t,t.Fl=!0,t.requestUpdate())}invalidateRouter(){this.a!==null&&(this.a.Fl=!0,this.a.requestUpdate())}canRoute(t){if(!this.isEnabled)return!1;let e=this.diagram;return!(e&&(!this.isRealtime&&e.Ou||e.animationManager.isTicking))}isRoutable(t,e){return!0}routeLinks(t,e){}toString(){return this.name!==""?this.name+" Router":m.Kn(this.constructor)}}class _n extends nn{constructor(t){super(),this.name="AvoidsNodes",t&&Object.assign(this,t)}canRoute(t){return(t instanceof Y?t.lp:t.diagram?.lp)?super.canRoute(t):!1}isRoutable(t,e){return!(!t.isAvoiding||t.containingGroup!==(e instanceof ht?e:null)||t.toNode===null||t.fromNode===null||t.pointsCount<4)}routeLinks(t,e){let i=e instanceof Y?null:e,s=t.iterator,n=this.diagram.getPositions(!0,i,null);for(;s.next();){let o=s.value;if(!this.isRoutable(o,e))continue;o.startRoute();let r=o.pointsCount,a=o.getPoint(1),h=o.getPoint(r-2),l=o.fromNode.actualBounds.copy();l.inflate(j.Fa,j.Fa),l.unionPoint(o.getPoint(0));let u=o.toNode.actualBounds.copy();u.inflate(j.Fa,j.Fa),u.unionPoint(o.getPoint(r-1)),this.MU(o,l,u,n)&&this.NU(o,a,o.SC,h,o.MC,l,u,n),o.commitRoute()}}MU(t,e,i,s){let n=t.diagram,o=t.pointsCount;if(n===null||!t.fromNode||!t.toNode||t.fromNode===t.toNode||!t.layer||t.layer.isTemporary||e.containsPoint(t.getPoint(o-1))&&!t.toNode.isMemberOf(t.fromNode)||i.containsPoint(t.getPoint(0))&&!t.fromNode.isMemberOf(t.toNode)||!t.isOrthogonal)return!1;if(t.segmentIndex===17)return!0;let r=t.getPoint(1),a=t.getPoint(o-2),h=t.getPoint(2);if(!s.isUnoccupied(Math.min(r.x,h.x),Math.min(r.y,h.y),Math.abs(r.x-h.x),Math.abs(r.y-h.y)))return!0;for(let u=2;u<o-3;u++){let c=t.getPoint(u),d=t.getPoint(u+1);if(!s.isUnoccupied(Math.min(c.x,d.x),Math.min(c.y,d.y),Math.abs(c.x-d.x),Math.abs(c.y-d.y)))return!0}let l=t.getPoint(o-3);return!s.isUnoccupied(Math.min(l.x,a.x),Math.min(l.y,a.y),Math.abs(l.x-a.x),Math.abs(l.y-a.y))}NU(t,e,i,s,n,o,r,a){let h=t.diagram;if(h===null)return;let l=e,u=s,c=P.gn,d=P.gn;if(h.isVirtualized){let g=a.bounds.copy(),y=t.getPoint(2),b=t.getPoint(t.pointsCount-3);g.inflate(-a.cellWidth,-a.cellHeight);let v=P.l();a.ng(e.x,e.y)||(C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,e.x,e.y,y.x,y.y,v)?(c=e=v.copy(),i=v.directionPoint(y)):C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,y.x,y.y,b.x,b.y,v)?(c=e=v.copy(),i=v.directionPoint(b)):C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,b.x,b.y,s.x,s.y,v)&&(c=e=v.copy(),i=v.directionPoint(s))),a.ng(s.x,s.y)||(C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,s.x,s.y,b.x,b.y,v)?(d=s=v.copy(),n=b.directionPoint(v)):C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,b.x,b.y,y.x,y.y,v)?(d=s=v.copy(),n=y.directionPoint(v)):C.Cl(g.x,g.y,g.x+g.width,g.y+g.height,y.x,y.y,e.x,e.y,v)&&(d=s=v.copy(),n=e.directionPoint(v))),P.i(v)}let f=o.copy().unionRect(r);f.inflate(a.cellWidth*a.af,a.cellHeight*a.af),a.wv(e,i,s,n,f,!0);let p=a.xo(s.x,s.y);if(!a.tw&&p>=Ot.sg&&(a.vT(),f.inflate(a.cellWidth*a.U2,a.cellHeight*a.V2),a.wv(e,i,s,n,f,!1),p=a.xo(s.x,s.y)),!a.tw&&p<Ot.sg&&!a.GE(s.x,s.y)){t.points.removeRange(2,t.pointsCount-3),this.AL(t,a,s.x,s.y,n,!0);let g=0,y=90,b=180,v=270,w=t.getPoint(2);if(t.pointsCount<4)i===g||i===b?(w.x=e.x,w.y=s.y):(w.x=s.x,w.y=e.y),t.setPointAt(2,w.x,w.y),t.insertPointAt(3,w.x,w.y);else{let k=t.getPoint(3);if(i===g||i===b)if(C.c(w.x,k.x)){let S=i===g?Math.max(w.x,e.x):Math.min(w.x,e.x);t.setPointAt(2,S,e.y),t.setPointAt(3,S,k.y)}else C.c(w.y,k.y)?(Math.abs(e.y-w.y)<=a.cellHeight/2&&(t.setPointAt(2,w.x,e.y),t.setPointAt(3,k.x,e.y)),t.insertPointAt(2,w.x,e.y)):t.setPointAt(2,e.x,w.y);else if(i===y||i===v)if(C.c(w.y,k.y)){let S=i===y?Math.max(w.y,e.y):Math.min(w.y,e.y);t.setPointAt(2,e.x,S),t.setPointAt(3,k.x,S)}else C.c(w.x,k.x)?(Math.abs(e.x-w.x)<=a.cellWidth/2&&(t.setPointAt(2,e.x,w.y),t.setPointAt(3,e.x,k.y)),t.insertPointAt(2,e.x,w.y)):t.setPointAt(2,w.x,e.y)}if(c.isReal()){let k=t.getPoint(1),S=t.getPoint(2);k.x!==S.x&&k.y!==S.y?i===g||i===b?t.insertPointAt(2,k.x,S.y):t.insertPointAt(2,S.x,k.y):i===g||i===b?t.insertPointAt(2,l.x,c.y):t.insertPointAt(2,c.x,l.y)}d.isReal()&&(n===g||n===b?t.insertPointAt(t.pointsCount-2,u.x,d.y):t.insertPointAt(t.pointsCount-2,d.x,u.y))}}AL(t,e,i,s,n,o){let r=e.cellWidth,a=e.cellHeight,h=e.xo(i,s),l=i,u=s,c=l,d=u;for(n===0?c+=r:n===90?d+=a:n===180?c-=r:d-=a,t.vC&&h>Ot.sc&&e.xo(c,d)!==h-1&&(e.xo(l-r,u)===h-1?(n=180,c=l-r,d=u):e.xo(l+r,u)===h-1?(n=0,c=l+r,d=u):e.xo(l,u-a)===h-1?(n=270,c=l,d=u-a):e.xo(l,u+a)===h-1&&(n=90,c=l,d=u+a));h>Ot.sc&&e.xo(c,d)===h-1;)l=c,u=d,n===0?c+=r:n===90?d+=a:n===180?c-=r:d-=a,h-=1;if(o?h>Ot.sc&&(n===180||n===0?l=Math.floor(l/r)*r+r/2:(n===90||n===270)&&(u=Math.floor(u/a)*a+a/2)):(l=Math.floor(l/r)*r+r/2,u=Math.floor(u/a)*a+a/2),h>Ot.sc){let f=n,p=l,g=u;if(n===0?(f=90,g+=a):n===90?(f=180,p-=r):n===180?(f=270,g-=a):n===270&&(f=0,p+=r),e.xo(p,g)===h-1)this.AL(t,e,p,g,f,!1);else{let y=l,b=u;n===0?(f=270,b-=a):n===90?(f=0,y+=r):n===180?(f=90,b+=a):n===270&&(f=180,y-=r),e.xo(y,b)===h-1&&this.AL(t,e,y,b,f,!1)}}t.insertPointAt(t.pointsCount-2,l,u)}}ne.prototype.initializeStandardTools=function(){return this.Jt("Action",new Fs,this.mouseDownTools),this.Jt("Relinking",new $e,this.mouseDownTools),this.Jt("LinkReshaping",new Je,this.mouseDownTools),this.Jt("Rotating",new De,this.mouseDownTools),this.Jt("Resizing",new Ze,this.mouseDownTools),this.Jt("Linking",new Le,this.mouseMoveTools),this.Jt("Dragging",new Tt,this.mouseMoveTools),this.Jt("DragSelecting",new ri,this.mouseMoveTools),this.Jt("Panning",new ki,this.mouseMoveTools),this.Jt("ContextMenu",new It,this.mouseUpTools),this.Jt("TextEditing",new oe,this.mouseUpTools),this.Jt("ClickCreating",new Qe,this.mouseUpTools),this.Jt("ClickSelecting",new Ds,this.mouseUpTools),this},Y.m2("GraphLinksModel",Zn),Y.m2("TreeModel",Qn);let Ai=X.go,gi={get version(){return Y.version},Group:ht,List:q,Set:V,Map:Mt,Point:P,Size:st,Rect:I,Margin:Dt,Spot:T,Geometry:wt,PathFigure:Kt,PathSegment:mt,InputEvent:Qt,DiagramEvent:wi,ChangedEvent:Xe,Model:ut,GraphLinksModel:Vt,TreeModel:Be,Binding:te,ThemeBinding:ii,Transaction:oi,UndoManager:vi,CommandHandler:jt,Tool:$t,DraggingTool:Tt,DraggingInfo:Ye,DraggingOptions:Pi,LinkingBaseTool:ae,LinkingTool:Le,RelinkingTool:$e,LinkReshapingTool:Je,ResizingTool:Ze,RotatingTool:De,ClickSelectingTool:Ds,ActionTool:Fs,ClickCreatingTool:Qe,HTMLInfo:fe,ContextMenuTool:It,DragSelectingTool:ri,PanningTool:ki,TextEditingTool:oe,ToolManager:ne,Animation:ye,AnimationManager:he,AnimationTrigger:ai,Layer:Et,Diagram:Y,Palette:Rn,Overview:hi,Brush:R,GraphObject:$,Panel:G,RowColumnDefinition:Xt,Shape:et,TextBlock:lt,Picture:Bt,Part:pt,Adornment:vt,Node:J,Link:j,Placeholder:le,Layout:_t,LayoutNetwork:Ee,LayoutVertex:Ie,LayoutEdge:ei,GridLayout:je,PanelLayout:Lt,CircularLayout:Ve,CircularNetwork:Ws,CircularVertex:di,CircularEdge:$s,ForceDirectedLayout:ee,ForceDirectedNetwork:Js,ForceDirectedVertex:ze,ForceDirectedEdge:fi,LayeredDigraphLayout:Ae,LayeredDigraphNetwork:tn,LayeredDigraphVertex:si,LayeredDigraphEdge:Se,TreeLayout:zt,TreeNetwork:gs,TreeVertex:Rt,TreeEdge:sn,Themes:be,ThemeManager:Ge,Router:nn,AnimationStyle:Is,AutoScale:Ii,CycleMode:Vs,Flip:Xs,TextFormat:Yi,ImageStretch:ji,LayoutConditions:Gs,LinkAdjusting:Hi,Curve:$i,Routing:Wi,Orientation:Vi,TextOverflow:js,PortSpreading:qs,ScrollMode:zs,CollapsePolicy:Ks,Sizing:zi,TriggerStart:Bs,Stretch:Bi,ViewboxStretch:Us,Wrap:Xi,BrushType:Oe,ColorSpace:Ys,GeometryStretch:Ri,GeometryType:Ke,SegmentType:ni,BindingMode:Ci,ChangeType:Ei,CircularArrangement:ts,CircularDirection:es,CircularNodeDiameterFormula:ss,CircularSorting:is,GridAlignment:Zi,GridArrangement:Qi,GridSorting:_i,LayeredDigraphAggressive:as,LayeredDigraphAlign:_s,LayeredDigraphCycleRemove:ns,LayeredDigraphInit:rs,LayeredDigraphLayering:os,LayeredDigraphPack:Qs,TreeAlignment:us,TreeArrangement:fs,TreeCompaction:cs,TreeLayerStyle:en,TreePath:hs,TreeSorting:ls,TreeStyle:ds,GestureMode:As,LinkingDirection:Ts,ReshapingBehavior:Ls,TextEditingAccept:Os,TextEditingStarting:Rs,TextEditingState:Es,WheelMode:Cs};for(let x in gi){let t=gi[x];m.st(t)&&t!==Yi&&(t.className=x)}m.$(Ai)&&Ai.version&&m.ne("WARNING: a `go` object on the root object is already defined. "+("Debug"in Ai?"debug ":"")+"version: "+Ai.version+", replaced with version: "+gi.version),Y.prototype.go=gi,X.go=gi})();var Eo=typeof global<"u"?global.go:self.go,H=typeof global<"u"?global.go:self.go,Io=H.Group,Bo=H.List,Vo=H.Set;var zo=H.Map;var cn=H.Point,pi=H.Size,Ko=H.Rect,ys=H.Margin,Ne=H.Spot,Xo=H.Geometry,Yo=H.PathFigure,Uo=H.PathSegment,jo=H.InputEvent,Go=H.DiagramEvent,qo=H.ChangedEvent,Ho=H.Model,dn=H.GraphLinksModel,Wo=H.TreeModel,$o=H.Binding,Jo=H.ThemeBinding,Zo=H.Transaction,Qo=H.UndoManager,_o=H.CommandHandler,tr=H.Tool,er=H.DraggingTool,ir=H.DraggingInfo,sr=H.DraggingOptions,nr=H.LinkingBaseTool,or=H.LinkingTool,rr=H.RelinkingTool,ar=H.LinkReshapingTool,hr=H.ResizingTool,lr=H.RotatingTool,ur=H.ClickSelectingTool,cr=H.ActionTool,dr=H.ClickCreatingTool,fr=H.HTMLInfo,gr=H.ContextMenuTool,mr=H.DragSelectingTool,pr=H.PanningTool,yr=H.TextEditingTool,xr=H.ToolManager,xs=H.Animation,br=H.AnimationManager,wr=H.AnimationTrigger,vr=H.Layer,Ti=H.Diagram,kr=H.Palette,Pr=H.Overview,Sr=H.Brush,Mr=H.GraphObject,qe=H.Panel,Nr=H.RowColumnDefinition,yi=H.Shape,Li=H.TextBlock,fn=H.Picture,Cr=H.Part,bs=H.Adornment,ws=H.Node,vs=H.Link,gn=H.Placeholder,Ar=H.Layout,Tr=H.LayoutNetwork,Lr=H.LayoutVertex,Dr=H.LayoutEdge,Fr=H.GridLayout,Or=H.PanelLayout,Rr=H.CircularLayout,Er=H.CircularNetwork,Ir=H.CircularVertex,Br=H.CircularEdge,Vr=H.ForceDirectedLayout,zr=H.ForceDirectedNetwork,Kr=H.ForceDirectedVertex,Xr=H.ForceDirectedEdge,mn=H.LayeredDigraphLayout,Yr=H.LayeredDigraphNetwork,Ur=H.LayeredDigraphVertex,jr=H.LayeredDigraphEdge,Gr=H.TreeLayout,qr=H.TreeNetwork,Hr=H.TreeVertex,Wr=H.TreeEdge,$r=H.Themes,Jr=H.ThemeManager,Zr=H.Router,Qr=H.version,_r=H.AnimationStyle,pn=H.AutoScale,ta=H.Curve,ea=H.CycleMode,ia=H.Flip,sa=H.ImageStretch,na=H.LayoutConditions,oa=H.LinkAdjusting,ra=H.Orientation,aa=H.PortSpreading,yn=H.Routing,xn=H.ScrollMode,ha=H.CollapsePolicy,la=H.Sizing,ua=H.TriggerStart,bn=H.Stretch,ca=H.TextFormat,ks=H.TextOverflow,da=H.ViewboxStretch,Ps=H.Wrap,fa=H.BrushType,ga=H.ColorSpace,ma=H.GeometryStretch,pa=H.GeometryType,ya=H.SegmentType,xa=H.BindingMode,ba=H.ChangeType,wa=H.CircularArrangement,va=H.CircularDirection,ka=H.CircularNodeDiameterFormula,Pa=H.CircularSorting,Sa=H.GridAlignment,Ma=H.GridArrangement,Na=H.GridSorting,Ca=H.LayeredDigraphAggressive,Aa=H.LayeredDigraphAlign,Ta=H.LayeredDigraphCycleRemove,La=H.LayeredDigraphInit,Da=H.LayeredDigraphLayering,Fa=H.LayeredDigraphPack,Oa=H.TreeAlignment,Ra=H.TreeArrangement,Ea=H.TreeCompaction,Ia=H.TreeLayerStyle,Ba=H.TreePath,Va=H.TreeSorting,za=H.TreeStyle,Ka=H.GestureMode,Xa=H.LinkingDirection,Ya=H.ReshapingBehavior,Ua=H.TextEditingAccept,ja=H.TextEditingStarting,Ga=H.TextEditingState,wn=H.WheelMode;var eo=on`#filter-bar{background-color:var(--calcite-color-foreground-1);position:absolute;top:16px;right:196px;z-index:100;box-shadow:var(--calcite-shadow-sm)}#filteredViewButtonDiv{padding:8px}#filteredViewButtonLabel{--calcite-label-margin-bottom: 0}#graph-navigation-bar{background-color:var(--calcite-color-foreground-1);position:absolute;top:16px;right:16px;z-index:100}#graph-navigation-controls{position:absolute;top:0;right:0;box-shadow:var(--calcite-shadow-sm)}.z-index-1{z-index:1}#diagram-panel{--calcite-panel-space: 0px}#diagram-shell-panel{--calcite-color-background: var(--calcite-color-foreground-1);padding:16px}`,io=15,so=15,no=10,xi=new pi(220,48),oo=1,ro=8,vn=new pi(48,48),ao=new pi(16,16),kn=new pi(153,17),ho='400 0.75rem "Avenir Next", Avenir, "Helvetica Neue", sans-serif',lo='500 0.75rem "Avenir Next", Avenir, "Helvetica Neue", sans-serif',uo="val(--calcite-color-background)",co=bi("--calcite-color-border-1"),Pn=bi("--calcite-color-foreground-1"),Di=bi("--calcite-color-text-1"),Sn=bi("--calcite-color-border-input"),fo=bi("--calcite-color-foreground-1"),Fi=1,Nn=.3,Ss=1,Cn=.2,go=1;function mo(X){let m=document.createElement("div");m.style.width="100%",m.style.height="100%",X.appendChild(m);let rt=new Ti(m,{click:Po,contentAlignment:Ne.Center,dragSelectingTool:null,hoverDelay:50,initialAutoScale:pn.Uniform,layout:new mn({columnSpacing:io,layerSpacing:so}),padding:no,scrollMode:xn.Infinite,"toolManager.hoverDelay":50,"toolManager.mouseWheelBehavior":wn.Zoom});rt.nodeTemplate=new ws("Auto",{click:So,movable:!1,opacity:Fi,toolTip:new bs("Auto",{isShadowed:!0,margin:new ys(12,16,6,16),padding:0,shadowBlur:16,shadowColor:To(Di,.05),shadowOffset:new cn(0,0)}).add(new qe("Vertical",{background:fo,margin:0}).add(new Li({margin:14,stroke:Di}).bind("text","title")))}).bind("text","title").add(new yi({desiredSize:xi,fill:Pn,geometryString:ko(xi.width,xi.height,ro,vn.width,!!Pn),height:xi.height,portId:"",stroke:co,strokeWidth:oo,width:xi.width})).add(new qe("Horizontal",{alignment:Ne.Left,stretch:bn.Horizontal}).add(new qe("Horizontal",{alignment:Ne.Left,desiredSize:vn,margin:1}).add(new qe("Horizontal",{alignment:Ne.Center,margin:16}).add(new fn({desiredSize:ao}).bind("source","",dt=>un(dt.itemType,dt.itemTypeKeywords)))),new qe("Horizontal",{alignment:Ne.Right,margin:new ys(4,8,0,8)}).add(new qe("Vertical",{}).add(new Li({alignment:Ne.Left,desiredSize:kn,font:lo,overflow:ks.Ellipsis,stroke:Di,wrap:Ps.None}).bind("text","title"),new Li({alignment:Ne.Left,desiredSize:kn,font:ho,overflow:ks.Ellipsis,stroke:Di,wrap:Ps.None}).bind("text","itemTypeForDisplay"))))),rt.commandHandler.zoomFactor=1.05,rt.setDivBackground(uo);let bt=rt.toolManager.clickSelectingTool;bt.standardMouseSelect=function(){};let Pt=rt.toolManager.draggingTool;return Pt.isEnabled=!1,rt.linkTemplate=new vs({corner:5,movable:!1,routing:yn.Orthogonal,selectable:!1}).add(new yi({opacity:Ss,stroke:Sn}),new yi({fill:Sn,opacity:Ss,stroke:null,toArrow:"Standard"})),rt}function He(X,m){X.model=new dn(m.nodes,m.links,{linkFromPortIdProperty:"fromPort",linkToPortIdProperty:"toPort"})}function po(X,m,rt,bt=!0){if(bt){let q=Mo(X,rt);q.addEventListener("calciteSwitchChange",()=>document.dispatchEvent(new CustomEvent("filteredViewChanged",{detail:q.checked})))}let{resetButton:Pt,centerButton:dt,zoomInButton:gt,zoomOutButton:kt}=No(X,rt);Pt.addEventListener("click",()=>Ao(m)),dt.addEventListener("click",()=>m.zoomToFit()),gt.addEventListener("click",()=>m.commandHandler.increaseZoom()),kt.addEventListener("click",()=>m.commandHandler.decreaseZoom())}function yo(X,m,rt){let bt=mo(X);return He(bt,m),po(X,bt,rt),bt}function An(X){let m=new Set,rt=new Set;function bt(dt){dt.findLinksInto().each(gt=>{rt.add(gt);let kt=gt.fromNode;kt&&!m.has(kt)&&(m.add(kt),bt(kt))})}bt(X);function Pt(dt){dt.findLinksOutOf().each(gt=>{rt.add(gt);let kt=gt.toNode;kt&&!m.has(kt)&&(m.add(kt),Pt(kt))})}return Pt(X),{connectedNodes:m,connectedLinks:rt}}function xo(X,m=!1,rt){let bt=[],Pt=X.map(gt=>{if(gt.type!=="Group"){let kt=vo(gt);return wo(gt,kt,m,rt)}else{bt.push(gt.id);return}}).filter(gt=>gt!==void 0),dt=[];return Pt.forEach(gt=>{(X.find(kt=>kt.id===gt.itemId)?.dependencies||[]).forEach(kt=>{let q=Pt.find(Zt=>Zt?.itemId===kt);q&&dt.push({from:q.key,fromSpot:Ne.AllSides,to:gt.key,toSpot:Ne.AllSides})})}),{nodes:Pt,links:dt,groupPseudoNodes:bt}}function bo(X,m,rt,bt=!0){let Pt=X.diagram;if(!Pt)return;let dt={};if(bt){for(let gt of Pt.nodes)dt[gt.key]=gt===X?Fi:Nn;for(let gt of Pt.links){let kt=`${gt.fromNode?.key}-${gt.toNode?.key}`;dt[kt]=Cn}{let{connectedNodes:gt,connectedLinks:kt}=An(X);for(let q of gt)dt[q.key]=Fi;for(let q of kt){let Zt=`${q.fromNode?.key}-${q.toNode?.key}`;dt[Zt]=go}}}if(rt&&(rt.adornedObject=X),bt){let gt=new xs;gt.duration=1;for(let kt of Pt.nodes)gt.add(kt,"opacity",kt.opacity,dt[kt.key]);for(let kt of Pt.links){let q=`${kt.fromNode?.key}-${kt.toNode?.key}`;gt.add(kt,"opacity",kt.opacity,dt[q])}gt.start()}}function Mn(X,m,rt,bt,Pt=!0){if(X.length===0)return;let dt=m[0].diagram;if(!dt)return;let gt={};if(Pt){for(let kt of dt.nodes){let q=X.includes(kt.key);gt[kt.key]=!rt||q?Fi:Nn}for(let kt of dt.links){let q=`${kt.fromNode?.key}-${kt.toNode?.key}`;gt[q]=rt?Cn:Ss}}if(Object.keys(bt).forEach(kt=>{bt[kt].adornedObject=null}),Pt){let kt=new xs;kt.duration=1;for(let q of dt.nodes)kt.add(q,"opacity",q.opacity,gt[q.key]);for(let q of dt.links){let Zt=`${q.fromNode?.key}-${q.toNode?.key}`;kt.add(q,"opacity",q.opacity,gt[Zt])}kt.start()}}function wo(X,m,rt=!1,bt){return{key:m,title:X.title,itemId:X.id,itemType:X.type,itemTypeForDisplay:Co(X.type,X.typeKeywords),itemTypeKeywords:X.typeKeywords,group:X.type,url:rt?`${bt}?id=${X.id}`:void 0}}function vo(X){return X.id}function ko(X,m,rt,bt=0,Pt=!1){let dt="";Pt&&(dt+="F");let gt=X-2*rt,kt=m-2*rt;return dt+=" M0 0",dt+=` h${gt}`,dt+=` a${rt} ${rt} 0 0 1 ${rt} ${rt}`,dt+=` v${kt}`,dt+=` a${rt} ${rt} 0 0 1 ${-rt} ${rt}`,dt+=` h${-gt}`,dt+=` a${rt} ${rt} 0 0 1 ${-rt} ${-rt}`,dt+=` v${-kt}`,dt+=` a${rt} ${rt} 0 0 1 ${rt} ${-rt}`,bt>0&&(dt+=` M${bt-rt} 0 v${m}`),dt}function Po(){document.dispatchEvent(new CustomEvent("clickInDiagram"))}function So(X,m){let rt=m.part;rt instanceof ws&&(rt.selectionAdorned=!1,document.dispatchEvent(new CustomEvent("clickOnNode",{detail:rt})))}function Mo(X,m){let rt=document.createElement("calcite-switch");rt.id="filteredViewButton",rt.label=m.filteredView;let bt=document.createElement("calcite-label");bt.id="filteredViewButtonLabel",bt.setAttribute("layout","inline"),bt.innerHTML=m.filteredView,bt.appendChild(rt);let Pt=document.createElement("div");Pt.id="filteredViewButtonDiv",Pt.appendChild(bt);let dt=document.createElement("calcite-action-bar");dt.id="filter-bar-controls",dt.layout="horizontal",dt.expandDisabled=!0,dt.appendChild(Pt);let gt=document.createElement("div");return gt.id="filter-bar",X.appendChild(gt),gt.appendChild(dt),rt}function No(X,m){let rt=document.createElement("calcite-action");rt.icon="reset",rt.id="showHideGrayedOutButton";let bt=document.createElement("calcite-tooltip");bt.id="resetButtonTooltip",bt.innerHTML=m.reset,bt.overlayPositioning="fixed",bt.placement="bottom",bt.referenceElement=rt.id;let Pt=document.createElement("calcite-action");Pt.icon="zoom-to-object",Pt.id="centerButton";let dt=document.createElement("calcite-tooltip");dt.id="centerButtonTooltip",dt.innerHTML=m.centerDiagram,dt.overlayPositioning="fixed",dt.placement="bottom",dt.referenceElement=Pt.id;let gt=document.createElement("calcite-action");gt.icon="plus",gt.id="zoomInButton";let kt=document.createElement("calcite-tooltip");kt.id="zoomInButtonTooltip",kt.innerHTML=m.zoomIn,kt.overlayPositioning="fixed",kt.placement="bottom",kt.referenceElement=gt.id;let q=document.createElement("calcite-action");q.appearance="solid",q.icon="minus",q.id="zoomOutButton";let Zt=document.createElement("calcite-tooltip");Zt.id="zoomOutButtonTooltip",Zt.innerHTML=m.zoomOut,Zt.overlayPositioning="fixed",Zt.placement="bottom",Zt.referenceElement=q.id;let V=document.createElement("calcite-action-bar");V.id="graph-navigation-controls",V.layout="horizontal",V.expandDisabled=!0,V.appendChild(rt),V.appendChild(bt),V.appendChild(Pt),V.appendChild(dt),V.appendChild(gt),V.appendChild(kt),V.appendChild(q),V.appendChild(Zt);let We=document.createElement("div");return We.id="graph-navigation-bar",X.appendChild(We),We.appendChild(V),{resetButton:rt,centerButton:Pt,zoomInButton:gt,zoomOutButton:q}}function Co(X,m){let rt=X;if(X==="Feature Service"){let bt=m.indexOf("View Service")>-1,Pt=m.indexOf("Table")>-1;rt=bt&&Pt?"Table (hosted, view)":Pt?"Table (hosted)":bt?"Feature Layer (hosted, view)":"Feature Layer (hosted)"}return X==="Web Mapping Application"&&(rt=m.indexOf("configurableApp")>-1?"Instant App":rt),rt=X==="Geoprocessing Service"?"Tool":rt,rt=X==="Feed"?"Feed (hosted)":rt,rt=X==="Real Time Analytic"?"Real Time Analytic (hosted)":rt,rt=X==="Big Data Analytic"?"Big Data Analytic (hosted)":rt,rt=X==="Vector Tile Service"?"Tile Layer":rt,rt}function Ao(X){X.zoomToFit(),document.dispatchEvent(new CustomEvent("reset"))}function bi(X){let m=document.body;return getComputedStyle(m).getPropertyValue(X).trim()}function To(X,m){if(X=X.replace(/^#/,""),X.length===3&&(X=X.split("").map(dt=>dt+dt).join("")),X.length!==6)throw new Error("Invalid hex color");let rt=parseInt(X.slice(0,2),16),bt=parseInt(X.slice(2,4),16),Pt=parseInt(X.slice(4,6),16);return`rgba(${rt}, ${bt}, ${Pt}, ${m})`}var Lo=8,Do=15,Fo=Ro("--calcite-color-brand"),Oo=4;function Ro(X){let m=document.documentElement;return getComputedStyle(m).getPropertyValue(X).trim()}var Ms=class{constructor(m,rt,bt,Pt){this.indexPanel=m,this.diagramPanel=rt,this.diagramTranslations=bt,this.diagramKey=Pt,this.currentSelectedGroupId="",this.currentSelectedItemId="",this.diagramNeedsRedraw=!1,this.usefilteredView=!1,this.handle_clickInDiagram=dt=>{dt.stopImmediatePropagation(),(this.currentSelectedGroupId||this.currentSelectedItemId)&&(this.currentSelectedGroupId="",this.currentSelectedItemId="",this.diagramNeedsRedraw=this.usefilteredView,this.redraw())},this.handle_clickOnNode=dt=>{dt.stopImmediatePropagation();let gt=dt.detail.data.key;this.redraw(gt,gt===this.currentSelectedItemId)},this.handle_filteredViewChanged=dt=>{this.usefilteredView=dt.detail,this.diagramNeedsRedraw=!!this.currentSelectedGroupId||!!this.currentSelectedItemId,this.redraw(this.currentSelectedItemId||this.currentSelectedGroupId)},this.handle_reset=dt=>{dt.stopImmediatePropagation(),this.reset()},this.handle_solutionItemSelect=dt=>{dt.stopImmediatePropagation();let gt=dt.detail.itemId;this.redraw(gt,gt===this.currentSelectedItemId||gt===this.currentSelectedGroupId,!1)},Ti.licenseKey===""&&(Ti.licenseKey=Pt??"")}create(m,rt){this.collection=m,this.index=document.createElement("solution-item-accordion"),this.index.linkType="action",this.index.listSelectionMode="single",this.index.typeKeywords=rt,this.index.style.overflowY="auto",this.indexPanel.appendChild(this.index),this.index.templateInfos=m,this.allNodesAndLinks=xo(m),this.diagram=yo(this.diagramPanel,this.allNodesAndLinks,this.diagramTranslations),this.diagram.addDiagramListener("LayoutCompleted",()=>{setTimeout(()=>{this.diagram.zoomToFit()},1e3)}),vs.setRoutingParameter(44,600942),this.createNodeHighlighters(),document.addEventListener("clickInDiagram",this.handle_clickInDiagram),document.addEventListener("clickOnNode",this.handle_clickOnNode),document.addEventListener("filteredViewChanged",this.handle_filteredViewChanged),document.addEventListener("reset",this.handle_reset),this.index.addEventListener("solutionItemSelect",this.handle_solutionItemSelect)}dispose(){document.removeEventListener("clickInDiagram",this.handle_clickInDiagram),document.removeEventListener("clickOnNode",this.handle_clickOnNode),document.removeEventListener("filteredViewChanged",this.handle_filteredViewChanged),document.removeEventListener("reset",this.handle_reset),this.index.removeEventListener("solutionItemSelect",this.handle_solutionItemSelect),this.indexPanel.innerHTML="",this.diagramPanel.innerHTML=""}clearSelections(m=!0){this.index.deselectAll(),m&&this.index.collapseAll();let rt=this.getNodesFromDiagram(this.diagram),bt=rt.map(Pt=>Pt.data.key);Mn(bt,rt,!1,this.diagramNodeHighlighterIndex)}createNodeHighlighters(){this.diagramNodeIndex={},this.diagramNodeHighlighterIndex={},this.getNodesFromDiagram(this.diagram).forEach(m=>{this.diagramNodeIndex[m.data.key]=m;let rt=new bs("Auto",{background:"transparent",margin:2});rt.add(new yi("RoundedRectangle",{fill:"transparent",parameter1:Lo,parameter2:Do,stroke:Fo,strokeWidth:Oo})),rt.add(new gn({margin:1})),this.diagramNodeHighlighterIndex[m.data.key]=rt})}getNodeById(m){return this.diagramNodeIndex[m]}getNodesFromDiagram(m){let rt=[],bt=m.nodes.iterator;for(;bt.next();)rt.push(bt.value);return rt}redraw(m="",rt=!1,bt=!0){let Pt=this.allNodesAndLinks.groupPseudoNodes.includes(m);this.diagramNeedsRedraw&&(He(this.diagram,this.allNodesAndLinks),this.createNodeHighlighters(),this.diagramNeedsRedraw=!1);let dt=!1;if(this.clearSelections(bt),!!m){if(Pt){if(this.currentSelectedItemId="",this.currentSelectedGroupId!==m?this.currentSelectedGroupId=m:rt&&(this.currentSelectedGroupId=this.currentSelectedGroupId?"":m,dt=this.usefilteredView&&!this.currentSelectedGroupId),this.currentSelectedGroupId){this.usefilteredView&&(He(this.diagram,this.allNodesAndLinks),this.createNodeHighlighters());let gt=this.collection.filter(q=>q.id===m)[0],kt=gt.dependencies.map(q=>this.diagramNodeIndex[q]);if(this.usefilteredView){let q=kt.map(Zt=>Zt.data);He(this.diagram,{nodes:q,links:[]})}else Mn(gt.dependencies,kt,!0,this.diagramNodeHighlighterIndex);this.index.selectItem(this.currentSelectedGroupId)}}else{this.currentSelectedGroupId="",this.currentSelectedItemId!==m?this.currentSelectedItemId=m:rt&&(this.currentSelectedItemId=this.currentSelectedItemId?"":m,dt=this.usefilteredView&&!this.currentSelectedItemId);let gt=this.getNodeById(m);if((!gt||this.usefilteredView)&&(He(this.diagram,this.allNodesAndLinks),this.createNodeHighlighters(),gt=this.getNodeById(m),!gt))return;if(this.currentSelectedItemId){if(this.usefilteredView){let kt=An(gt);kt.connectedNodes.add(gt);let q=Array.from(kt.connectedNodes).map(V=>V.data),Zt=Array.from(kt.connectedLinks).map(V=>V.data);if(He(this.diagram,{nodes:q,links:Zt}),this.createNodeHighlighters(),gt=this.getNodeById(m),!gt)return}gt&&setTimeout(()=>bo(gt,!0,this.diagramNodeHighlighterIndex[m]),1),this.index.selectItem(this.currentSelectedItemId)}}dt&&this.reset()}}reset(){this.diagramNeedsRedraw=!1,this.currentSelectedGroupId="",this.currentSelectedItemId="",He(this.diagram,this.allNodesAndLinks),this.createNodeHighlighters(),this.clearSelections()}},Ns=class extends an{constructor(){super(...arguments),this.diagramKey="",this.templateInfoGraph=[],this.typeKeywords=[],this._diagramPanel=ms(),this._diagramShell=ms(),this._translations=ln({name:"solution-item-diagram",blocking:!0})}static{this.properties={diagramKey:1,templateInfoGraph:0,typeKeywords:0,_diagramPanel:16,_diagramShell:16,_translations:16}}static{this.styles=eo}updated(){if(this.solutionDisplay&&(this.solutionDisplay.dispose(),this.solutionDisplay=void 0),this.templateInfoGraph.length>0){let m={centerDiagram:this._translations.graphTranslations.centerDiagram,filteredView:this._translations.graphTranslations.filteredView,reset:this._translations.graphTranslations.reset,zoomIn:this._translations.graphTranslations.zoomIn,zoomOut:this._translations.graphTranslations.zoomOut};this.solutionDisplay=new Ms(this._diagramShell.value,this._diagramPanel.value,m,this.diagramKey),this.solutionDisplay.create(this.templateInfoGraph,this.typeKeywords)}requestAnimationFrame(()=>this._preventDiagramScrollbars())}disconnectedCallback(){super.disconnectedCallback(),this.solutionDisplay&&(this.solutionDisplay.dispose(),this.solutionDisplay=void 0)}render(){return rn`<calcite-shell><calcite-shell-panel id=diagram-shell-panel slot=panel-start ${ps(this._diagramShell)}></calcite-shell-panel><calcite-panel class="z-index-1" id=diagram-panel slot=panel-bottom ${ps(this._diagramPanel)}></calcite-panel></calcite-shell>`}_preventDiagramScrollbars(){if(!this._diagramPanel.value)return;let m=this._diagramPanel.value.shadowRoot;if(!m)return;let rt=m.querySelector(".content-wrapper");rt instanceof HTMLElement&&(rt.style.overflow="hidden")}};hn("solution-item-diagram",Ns);export{Ns as SolutionItemDiagram};
|