@rubytech/create-maxy-code 0.1.488 → 0.1.490

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/docs/superpowers/plans/2026-07-22-task-1899-reconcile-report-only.md +748 -0
  3. package/payload/platform/docs/superpowers/plans/2026-07-22-task-1910-two-way-portal-exchange.md +1716 -0
  4. package/payload/platform/docs/superpowers/specs/2026-07-22-task-1899-reconcile-report-only-design.md +121 -0
  5. package/payload/platform/docs/superpowers/specs/2026-07-22-task-1910-two-way-portal-exchange-design.md +103 -0
  6. package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.js +51 -0
  7. package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.js.map +1 -1
  8. package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.d.ts +2 -2
  9. package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.d.ts.map +1 -1
  10. package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.js +20 -4
  11. package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.js.map +1 -1
  12. package/payload/platform/lib/graph-mcp/src/__tests__/schema-cypher-parser.test.ts +55 -0
  13. package/payload/platform/lib/graph-mcp/src/schema-cypher-parser.ts +19 -4
  14. package/payload/platform/lib/graph-style/dist/index.d.ts +24 -0
  15. package/payload/platform/lib/graph-style/dist/index.d.ts.map +1 -1
  16. package/payload/platform/lib/graph-style/dist/index.js +25 -1
  17. package/payload/platform/lib/graph-style/dist/index.js.map +1 -1
  18. package/payload/platform/lib/graph-style/src/__tests__/additional-base-labels.test.ts +22 -0
  19. package/payload/platform/lib/graph-style/src/index.ts +27 -0
  20. package/payload/platform/lib/storage-broker/dist/__tests__/audit.test.js +15 -0
  21. package/payload/platform/lib/storage-broker/dist/__tests__/audit.test.js.map +1 -1
  22. package/payload/platform/lib/storage-broker/dist/audit.d.ts +34 -1
  23. package/payload/platform/lib/storage-broker/dist/audit.d.ts.map +1 -1
  24. package/payload/platform/lib/storage-broker/dist/audit.js +28 -4
  25. package/payload/platform/lib/storage-broker/dist/audit.js.map +1 -1
  26. package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts +13 -0
  27. package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts.map +1 -1
  28. package/payload/platform/lib/storage-broker/dist/cf-exec.js +22 -0
  29. package/payload/platform/lib/storage-broker/dist/cf-exec.js.map +1 -1
  30. package/payload/platform/lib/storage-broker/src/__tests__/audit.test.ts +21 -0
  31. package/payload/platform/lib/storage-broker/src/audit.ts +67 -3
  32. package/payload/platform/lib/storage-broker/src/cf-exec.ts +48 -0
  33. package/payload/platform/neo4j/schema.cypher +105 -0
  34. package/payload/platform/plugins/admin/skills/agent-builder/references/agent-pattern.md +34 -5
  35. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +8 -2
  36. package/payload/platform/plugins/cloudflare/PLUGIN.md +22 -2
  37. package/payload/platform/plugins/cloudflare/bin/portal-index-push.mjs +161 -41
  38. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-delete-withdraw.test.ts +95 -0
  39. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-directory-listing.test.ts +75 -13
  40. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-index-push.test.ts +216 -16
  41. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-indexed-download.test.ts +38 -2
  42. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-moved-download.test.ts +83 -0
  43. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-schema-shape.test.ts +48 -0
  44. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-sign.test.ts +62 -0
  45. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-target.test.ts +103 -0
  46. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-upload-multipart.test.ts +211 -0
  47. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-upload-target.test.ts +168 -0
  48. package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-uploads-listing.test.ts +138 -0
  49. package/payload/platform/plugins/cloudflare/mcp/__tests__/template-config.test.ts +179 -0
  50. package/payload/platform/plugins/cloudflare/mcp/__tests__/upload-route.test.ts +14 -13
  51. package/payload/platform/plugins/cloudflare/skills/data-portal/SKILL.md +87 -13
  52. package/payload/platform/plugins/cloudflare/skills/data-portal/schema.sql +87 -9
  53. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/portal-sign.mjs +74 -0
  54. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/target.ts +91 -0
  55. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/types.ts +23 -0
  56. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/delete.ts +45 -0
  57. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/download.ts +72 -5
  58. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/files.ts +80 -13
  59. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/upload.ts +358 -16
  60. package/payload/platform/plugins/cloudflare/skills/data-portal/template/index.html +12 -1
  61. package/payload/platform/plugins/cloudflare/skills/data-portal/template/portal.css +45 -0
  62. package/payload/platform/plugins/cloudflare/skills/data-portal/template/portal.js +258 -21
  63. package/payload/platform/plugins/docs/references/calendar-booking.md +5 -1
  64. package/payload/platform/plugins/docs/references/internals.md +2 -0
  65. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.js +61 -31
  66. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-cypher-drift.test.js.map +1 -1
  67. package/payload/platform/plugins/scheduling/PLUGIN.md +1 -1
  68. package/payload/platform/plugins/scheduling/mcp/dist/index.js +2 -2
  69. package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -1
  70. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/booking-reconcile.test.js +70 -5
  71. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/booking-reconcile.test.js.map +1 -1
  72. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.js +31 -6
  73. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.js.map +1 -1
  74. package/payload/platform/plugins/scheduling/mcp/dist/lib/booking-reconcile.d.ts +31 -4
  75. package/payload/platform/plugins/scheduling/mcp/dist/lib/booking-reconcile.d.ts.map +1 -1
  76. package/payload/platform/plugins/scheduling/mcp/dist/lib/booking-reconcile.js +18 -7
  77. package/payload/platform/plugins/scheduling/mcp/dist/lib/booking-reconcile.js.map +1 -1
  78. package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.d.ts +15 -6
  79. package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.d.ts.map +1 -1
  80. package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.js +24 -11
  81. package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.js.map +1 -1
  82. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js +5 -122
  83. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js.map +1 -1
  84. package/payload/platform/plugins/scheduling/mcp/dist/scripts/reconcile-bookings.js +84 -5
  85. package/payload/platform/plugins/scheduling/mcp/dist/scripts/reconcile-bookings.js.map +1 -1
  86. package/payload/platform/scripts/__tests__/quarantine-restore.test.sh +143 -0
  87. package/payload/platform/scripts/quarantine-restore.mjs +175 -0
  88. package/payload/platform/services/claude-session-manager/dist/account-dir-schema-reconcile.d.ts +24 -7
  89. package/payload/platform/services/claude-session-manager/dist/account-dir-schema-reconcile.d.ts.map +1 -1
  90. package/payload/platform/services/claude-session-manager/dist/account-dir-schema-reconcile.js +52 -74
  91. package/payload/platform/services/claude-session-manager/dist/account-dir-schema-reconcile.js.map +1 -1
  92. package/payload/platform/services/claude-session-manager/dist/index.js +11 -8
  93. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  94. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +32 -0
  95. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
  96. package/payload/platform/services/whatsapp-channel/dist/notification.js +32 -2
  97. package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
  98. package/payload/platform/services/whatsapp-channel/dist/targets.d.ts +6 -1
  99. package/payload/platform/services/whatsapp-channel/dist/targets.d.ts.map +1 -1
  100. package/payload/platform/services/whatsapp-channel/dist/targets.js +6 -0
  101. package/payload/platform/services/whatsapp-channel/dist/targets.js.map +1 -1
  102. package/payload/platform/templates/account-schema/SCHEMA.md +7 -4
  103. package/payload/platform/templates/agents/admin/IDENTITY.md +1 -1
  104. package/payload/platform/templates/agents/passive/IDENTITY.md +6 -0
  105. package/payload/platform/templates/agents/public/IDENTITY.md +6 -0
  106. package/payload/platform/templates/specialists/agents/citation-auditor.md +6 -0
  107. package/payload/platform/templates/specialists/agents/coding-assistant.md +6 -0
  108. package/payload/platform/templates/specialists/agents/compiled-truth-rewriter.md +6 -0
  109. package/payload/platform/templates/specialists/agents/content-producer.md +6 -0
  110. package/payload/platform/templates/specialists/agents/data-manager.md +6 -0
  111. package/payload/platform/templates/specialists/agents/database-operator.md +6 -0
  112. package/payload/platform/templates/specialists/agents/librarian.md +6 -0
  113. package/payload/platform/templates/specialists/agents/personal-assistant.md +6 -0
  114. package/payload/platform/templates/specialists/agents/project-manager.md +6 -0
  115. package/payload/platform/templates/specialists/agents/public-session-reviewer.md +6 -0
  116. package/payload/platform/templates/specialists/agents/research-assistant.md +7 -1
  117. package/payload/platform/templates/specialists/agents/typed-edge-classifier.md +6 -0
  118. package/payload/premium-plugins/writer-craft/agents/writer-craft--manuscript-reviewer.md +6 -0
  119. package/payload/server/{chunk-REWXLAPC.js → chunk-KZFE3MOY.js} +52 -4
  120. package/payload/server/public/activity.html +5 -6
  121. package/payload/server/public/assets/AdminLoginScreens-DgVFsHtd.js +1 -0
  122. package/payload/server/public/assets/AdminShell-BwNqwb4k.js +2 -0
  123. package/payload/server/public/assets/activity-2DL2DwLr.js +1 -0
  124. package/payload/server/public/assets/admin-COe0dT2U.js +1 -0
  125. package/payload/server/public/assets/{arc-D-QzyndF.js → arc-CFMJyMm-.js} +1 -1
  126. package/payload/server/public/assets/architecture-YZFGNWBL-Cypt5qHL.js +1 -0
  127. package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-W7f0Us4S.js → architectureDiagram-Q4EWVU46-CiSSgdL8.js} +1 -1
  128. package/payload/server/public/assets/{blockDiagram-DXYQGD6D-CfPS4FXg.js → blockDiagram-DXYQGD6D-_sXtIW5c.js} +1 -1
  129. package/payload/server/public/assets/{bot-DnuyRsLS.js → bot-CpBuDQlF.js} +1 -1
  130. package/payload/server/public/assets/{browser-q4EFqKvR.js → browser-CSApuZrv.js} +1 -1
  131. package/payload/server/public/assets/{c4Diagram-AHTNJAMY-Dq60cLVI.js → c4Diagram-AHTNJAMY-Bh7OAMXs.js} +1 -1
  132. package/payload/server/public/assets/{calendar-C-q9kWmA.js → calendar-DlvwZnS7.js} +1 -1
  133. package/payload/server/public/assets/channel-BMyXE4zc.js +1 -0
  134. package/payload/server/public/assets/chat-DWvYv9jq.js +1 -0
  135. package/payload/server/public/assets/chevron-down-Dnuuw6Q2.js +1 -0
  136. package/payload/server/public/assets/chevron-left-CC4zmWOr.js +1 -0
  137. package/payload/server/public/assets/chevron-right-CG_lHTx_.js +1 -0
  138. package/payload/server/public/assets/{chunk-2KRD3SAO-CXDjuDN0.js → chunk-2KRD3SAO-D4fktAwW.js} +1 -1
  139. package/payload/server/public/assets/{chunk-336JU56O-926ox0tj.js → chunk-336JU56O-CcQoKH2G.js} +2 -2
  140. package/payload/server/public/assets/chunk-426QAEUC-Xu6JKP4d.js +1 -0
  141. package/payload/server/public/assets/{chunk-4BX2VUAB-C2nrPCfN.js → chunk-4BX2VUAB-C13Wz3zS.js} +1 -1
  142. package/payload/server/public/assets/{chunk-4TB4RGXK-CuW3FOR6.js → chunk-4TB4RGXK-BL48D7gN.js} +1 -1
  143. package/payload/server/public/assets/{chunk-55IACEB6-B4_-In90.js → chunk-55IACEB6-TmOKdy8a.js} +1 -1
  144. package/payload/server/public/assets/{chunk-5FUZZQ4R-DnYGr9CP.js → chunk-5FUZZQ4R-DZ_jSF6N.js} +1 -1
  145. package/payload/server/public/assets/{chunk-5PVQY5BW-BYCOi9bf.js → chunk-5PVQY5BW-De4G1vfV.js} +1 -1
  146. package/payload/server/public/assets/{chunk-67CJDMHE-CBxsC4JP.js → chunk-67CJDMHE-Cif9Uu5C.js} +1 -1
  147. package/payload/server/public/assets/{chunk-7N4EOEYR-CAACaqFr.js → chunk-7N4EOEYR-WjTHCXnd.js} +1 -1
  148. package/payload/server/public/assets/{chunk-AA7GKIK3-BoamZdS6.js → chunk-AA7GKIK3-CwCfdQmb.js} +1 -1
  149. package/payload/server/public/assets/{chunk-BSJP7CBP-CHk82eFy.js → chunk-BSJP7CBP-9A67yXwT.js} +1 -1
  150. package/payload/server/public/assets/{chunk-CIAEETIT-DdeW9zxl.js → chunk-CIAEETIT-DPMiWSBi.js} +1 -1
  151. package/payload/server/public/assets/{chunk-EDXVE4YY-DJqSRv2w.js → chunk-EDXVE4YY-C2f_Qvx-.js} +1 -1
  152. package/payload/server/public/assets/{chunk-ENJZ2VHE-BRi4BwM5.js → chunk-ENJZ2VHE-B-Q9EbSQ.js} +1 -1
  153. package/payload/server/public/assets/{chunk-FMBD7UC4-OJp2CtUE.js → chunk-FMBD7UC4-Bmt_ZRlV.js} +1 -1
  154. package/payload/server/public/assets/{chunk-FOC6F5B3-BUAQ6spG.js → chunk-FOC6F5B3-DfGJGxpX.js} +1 -1
  155. package/payload/server/public/assets/{chunk-ICPOFSXX-DeRggD-Q.js → chunk-ICPOFSXX-Wyym1Q8K.js} +2 -2
  156. package/payload/server/public/assets/{chunk-K5T4RW27-EHiXZ8Py.js → chunk-K5T4RW27-DMpoaqw2.js} +1 -1
  157. package/payload/server/public/assets/{chunk-KGLVRYIC-tOajPcpn.js → chunk-KGLVRYIC-DYUFgri2.js} +1 -1
  158. package/payload/server/public/assets/{chunk-LIHQZDEY-uwO6oHIU.js → chunk-LIHQZDEY-x3LmeKmx.js} +1 -1
  159. package/payload/server/public/assets/{chunk-ORNJ4GCN-Dpa1_BCA.js → chunk-ORNJ4GCN-BeuNAWkW.js} +1 -1
  160. package/payload/server/public/assets/{chunk-OYMX7WX6-ChdDqaQL.js → chunk-OYMX7WX6-BUWVAfQA.js} +1 -1
  161. package/payload/server/public/assets/chunk-QZHKN3VN-7_kS3RBy.js +1 -0
  162. package/payload/server/public/assets/{chunk-U2HBQHQK-5JgWosPv.js → chunk-U2HBQHQK-DKS5adQo.js} +1 -1
  163. package/payload/server/public/assets/{chunk-X2U36JSP-BGJqysB2.js → chunk-X2U36JSP-CT_UM4IN.js} +1 -1
  164. package/payload/server/public/assets/{chunk-XPW4576I-GERE2ekx.js → chunk-XPW4576I-ByFnN4JO.js} +1 -1
  165. package/payload/server/public/assets/{chunk-YZCP3GAM-BskqX1V5.js → chunk-YZCP3GAM-DCetC20J.js} +1 -1
  166. package/payload/server/public/assets/{chunk-ZZ45TVLE-DG1iY-L9.js → chunk-ZZ45TVLE-Bh1QIv8N.js} +1 -1
  167. package/payload/server/public/assets/classDiagram-6PBFFD2Q-DJqbNcuC.js +1 -0
  168. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-CGglqfQA.js +1 -0
  169. package/payload/server/public/assets/clone-BiTMTzp_.js +1 -0
  170. package/payload/server/public/assets/{cose-bilkent-S5V4N54A-C8Rl4ykh.js → cose-bilkent-S5V4N54A-DgLEaApT.js} +1 -1
  171. package/payload/server/public/assets/{dagre-KV5264BT-C0YrJPF3.js → dagre-KV5264BT-BfkUPrEV.js} +1 -1
  172. package/payload/server/public/assets/{dagre-DTlv-FFy.js → dagre-unhMIyVo.js} +1 -1
  173. package/payload/server/public/assets/data-CJbC_cVy.js +1 -0
  174. package/payload/server/public/assets/{diagram-5BDNPKRD-Dfk5oepI.js → diagram-5BDNPKRD-BjjwcTD9.js} +1 -1
  175. package/payload/server/public/assets/{diagram-G4DWMVQ6-QRj55DiB.js → diagram-G4DWMVQ6-BbgWtVSS.js} +1 -1
  176. package/payload/server/public/assets/{diagram-MMDJMWI5-BAPKsohU.js → diagram-MMDJMWI5-DyAnkWGy.js} +1 -1
  177. package/payload/server/public/assets/{diagram-TYMM5635-C3iZXPkC.js → diagram-TYMM5635-SAMMoLxq.js} +1 -1
  178. package/payload/server/public/assets/{erDiagram-SMLLAGMA-DIbI7g_5.js → erDiagram-SMLLAGMA-Cvo-5-fD.js} +1 -1
  179. package/payload/server/public/assets/{flatten-DlAJeN0L.js → flatten-BXzaHgtL.js} +1 -1
  180. package/payload/server/public/assets/{flowDiagram-DWJPFMVM-l3eJJr8R.js → flowDiagram-DWJPFMVM-y3o2Ycld.js} +1 -1
  181. package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-aaEzHxIq.js → ganttDiagram-T4ZO3ILL-BEm_CQaK.js} +1 -1
  182. package/payload/server/public/assets/gitGraph-7Q5UKJZL-C_-XjxLd.js +1 -0
  183. package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-Di-1eg_m.js → gitGraphDiagram-UUTBAWPF-CqmOxS7F.js} +1 -1
  184. package/payload/server/public/assets/{graph-CNgt7ygi.js → graph-kaxS9a_7.js} +2 -2
  185. package/payload/server/public/assets/graph-labels-GgejRtgV.js +1 -0
  186. package/payload/server/public/assets/{graphlib-D5awC2yp.js → graphlib-_HfbQcBf.js} +1 -1
  187. package/payload/server/public/assets/info-OMHHGYJF-BH8yDCfL.js +1 -0
  188. package/payload/server/public/assets/infoDiagram-42DDH7IO-DyDXyJ6U.js +2 -0
  189. package/payload/server/public/assets/{isEmpty-Dh1dF-tM.js → isEmpty-uB1dEu_Z.js} +1 -1
  190. package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-CLOd_cNf.js → ishikawaDiagram-UXIWVN3A-C_d0vcZC.js} +1 -1
  191. package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-cGyfW6Tg.js → journeyDiagram-VCZTEJTY-DsjRBqlW.js} +1 -1
  192. package/payload/server/public/assets/{kanban-definition-6JOO6SKY-CRTKWPlh.js → kanban-definition-6JOO6SKY-BwtK6LS-.js} +1 -1
  193. package/payload/server/public/assets/{line-B8Brm0TD.js → line-szBCFOLJ.js} +1 -1
  194. package/payload/server/public/assets/{linear-BHnSKXBe.js → linear-X3O7lwK3.js} +1 -1
  195. package/payload/server/public/assets/{maximize-2-k3Fu5hdP.js → maximize-2-CPq3nwZA.js} +1 -1
  196. package/payload/server/public/assets/{mermaid-parser.core-BtNpdQct.js → mermaid-parser.core-BavvMAhU.js} +2 -2
  197. package/payload/server/public/assets/{mermaid.core-BY87anQZ.js → mermaid.core-Br2F9Hdm.js} +3 -3
  198. package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-rUSv9qN1.js → mindmap-definition-QFDTVHPH-4qlwXoJ-.js} +1 -1
  199. package/payload/server/public/assets/operator-CldXXilj.js +1 -0
  200. package/payload/server/public/assets/{ordinal-Bnl5GL-x.js → ordinal-CZY9laxg.js} +1 -1
  201. package/payload/server/public/assets/packet-4T2RLAQJ-Bajcns4r.js +1 -0
  202. package/payload/server/public/assets/{page-Bvx0A2jB.js → page-BE6DkJP9.js} +1 -1
  203. package/payload/server/public/assets/{page-DhwPG5Zf.js → page-BIwdWXnv.js} +3 -3
  204. package/payload/server/public/assets/{pdf-render-CrpAi4Ba.js → pdf-render-H884L3EI.js} +1 -1
  205. package/payload/server/public/assets/pie-ZZUOXDRM-D7hjM5w1.js +1 -0
  206. package/payload/server/public/assets/{pieDiagram-DEJITSTG-Cjn9IP-C.js → pieDiagram-DEJITSTG-BbXryIg0.js} +1 -1
  207. package/payload/server/public/assets/{public-BJ5Oo2Fw.js → public-BKQEQGPE.js} +1 -1
  208. package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-BkSHkSsn.js → quadrantDiagram-34T5L4WZ-BHLjcvh3.js} +1 -1
  209. package/payload/server/public/assets/radar-PYXPWWZC-B46d5x7a.js +1 -0
  210. package/payload/server/public/assets/{reduce-Bp5oNw1n.js → reduce-BGQzAenn.js} +1 -1
  211. package/payload/server/public/assets/{requirementDiagram-MS252O5E-hLwgyB-F.js → requirementDiagram-MS252O5E-BXaVO0lk.js} +1 -1
  212. package/payload/server/public/assets/{rotate-ccw-D-ov5jM4.js → rotate-ccw-DieZzl10.js} +1 -1
  213. package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-D6Dl1RIa.js → sankeyDiagram-XADWPNL6-CmN1s17Q.js} +1 -1
  214. package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-j0QBqkbL.js → sequenceDiagram-FGHM5R23-DC08e5NY.js} +1 -1
  215. package/payload/server/public/assets/{stateDiagram-FHFEXIEX-TvEBNsuV.js → stateDiagram-FHFEXIEX-DnoQMuOW.js} +1 -1
  216. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CrstH34p.js +1 -0
  217. package/payload/server/public/assets/{tasks-DHMxTZVD.js → tasks-DYyCGz8W.js} +1 -1
  218. package/payload/server/public/assets/{time-entry-format-EmV5lz6o.js → time-entry-format-CC_9jFuR.js} +1 -1
  219. package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-BfivOP-j.js → timeline-definition-GMOUNBTQ-eTn3uRaH.js} +1 -1
  220. package/payload/server/public/assets/treeView-SZITEDCU-3XQh5xQ1.js +1 -0
  221. package/payload/server/public/assets/treemap-W4RFUUIX-DwR-_l5z.js +1 -0
  222. package/payload/server/public/assets/{triangle-alert-CivyPfAL.js → triangle-alert-7mQfCQWP.js} +1 -1
  223. package/payload/server/public/assets/{useCopyFeedback-hbnPS-r9.js → useCopyFeedback-os7N0yCx.js} +1 -1
  224. package/payload/server/public/assets/useSubAccountSwitcher-Bgfqig1V.css +1 -0
  225. package/payload/server/public/assets/{useVoiceRecorder-QN9_GqB_.js → useVoiceRecorder-ZFwt5i6d.js} +2 -2
  226. package/payload/server/public/assets/{vennDiagram-DHZGUBPP-Bvfw9aFJ.js → vennDiagram-DHZGUBPP-DNx6o_ZQ.js} +1 -1
  227. package/payload/server/public/assets/wardley-RL74JXVD-DZp9oCGv.js +1 -0
  228. package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-C9h04G6b.js → wardleyDiagram-NUSXRM2D-BZOchqF3.js} +1 -1
  229. package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-BMvi2m2q.js → xychartDiagram-5P7HB3ND-ZBEGH6ZI.js} +1 -1
  230. package/payload/server/public/browser.html +4 -4
  231. package/payload/server/public/calendar.html +6 -6
  232. package/payload/server/public/chat.html +14 -14
  233. package/payload/server/public/data.html +11 -11
  234. package/payload/server/public/graph.html +10 -11
  235. package/payload/server/public/index.html +16 -17
  236. package/payload/server/public/operator.html +15 -16
  237. package/payload/server/public/public.html +14 -14
  238. package/payload/server/public/tasks.html +6 -6
  239. package/payload/server/server.js +1836 -998
  240. package/payload/server/{src-JJ6PHO5I.js → src-UYDFMWF4.js} +1 -1
  241. package/payload/server/public/assets/AdminLoginScreens-Dic_fPt6.js +0 -1
  242. package/payload/server/public/assets/AdminShell-JN7rZ8aG.js +0 -2
  243. package/payload/server/public/assets/Checkbox-CB74kINA.js +0 -1
  244. package/payload/server/public/assets/activity-DbfpHg3i.js +0 -1
  245. package/payload/server/public/assets/admin-CThbXaYH.js +0 -1
  246. package/payload/server/public/assets/architecture-YZFGNWBL-CGvD4r9F.js +0 -1
  247. package/payload/server/public/assets/channel-Bpg-ADC0.js +0 -1
  248. package/payload/server/public/assets/chat-DcefIV9q.js +0 -1
  249. package/payload/server/public/assets/chevron-down-Blma_CKl.js +0 -1
  250. package/payload/server/public/assets/chevron-left-xeYDxFiC.js +0 -1
  251. package/payload/server/public/assets/chevron-right-BonbtjqJ.js +0 -1
  252. package/payload/server/public/assets/chunk-426QAEUC-1poG7Nd3.js +0 -1
  253. package/payload/server/public/assets/chunk-QZHKN3VN-GN1tIO8J.js +0 -1
  254. package/payload/server/public/assets/classDiagram-6PBFFD2Q-DMGVq8Jv.js +0 -1
  255. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DfddT8UV.js +0 -1
  256. package/payload/server/public/assets/clone-Cc9vFIEk.js +0 -1
  257. package/payload/server/public/assets/data-D5dp6nj6.js +0 -1
  258. package/payload/server/public/assets/gitGraph-7Q5UKJZL-DtjXE0UI.js +0 -1
  259. package/payload/server/public/assets/graph-labels-DA48HrRR.js +0 -1
  260. package/payload/server/public/assets/info-OMHHGYJF-CmArhGYf.js +0 -1
  261. package/payload/server/public/assets/infoDiagram-42DDH7IO-utWz7oZy.js +0 -2
  262. package/payload/server/public/assets/operator-8NVpNLeD.js +0 -1
  263. package/payload/server/public/assets/packet-4T2RLAQJ-BTfK0Zw4.js +0 -1
  264. package/payload/server/public/assets/pie-ZZUOXDRM-BvtPeMQY.js +0 -1
  265. package/payload/server/public/assets/radar-PYXPWWZC-D2UXvQgn.js +0 -1
  266. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-Ur4eM6rb.js +0 -1
  267. package/payload/server/public/assets/treeView-SZITEDCU-0dE7FvM2.js +0 -1
  268. package/payload/server/public/assets/treemap-W4RFUUIX-BrwlXpr5.js +0 -1
  269. package/payload/server/public/assets/useSubAccountSwitcher-kwhG-aJj.css +0 -1
  270. package/payload/server/public/assets/wardley-RL74JXVD-CO9HdfJ-.js +0 -1
  271. /package/payload/server/public/assets/{_baseFor-BBkmqPEk.js → _baseFor-CMWvz0uA.js} +0 -0
  272. /package/payload/server/public/assets/{array-Bjtb2C_5.js → array-Cny_NT6T.js} +0 -0
  273. /package/payload/server/public/assets/{cytoscape.esm-B1dQ664k.js → cytoscape.esm-De0CCmB2.js} +0 -0
  274. /package/payload/server/public/assets/{defaultLocale-iwYA7ne8.js → defaultLocale-BahRht8U.js} +0 -0
  275. /package/payload/server/public/assets/{dist-CLmrZbY7.js → dist-C9D_xz81.js} +0 -0
  276. /package/payload/server/public/assets/{init-CxnBAgcf.js → init-DoIvjoJ_.js} +0 -0
  277. /package/payload/server/public/assets/{katex-DojHoLIr.js → katex-Bfn1OZEl.js} +0 -0
  278. /package/payload/server/public/assets/{path-JZiojYzQ.js → path-CTezU8L5.js} +0 -0
  279. /package/payload/server/public/assets/{preload-helper-CT1Z6Pdu.js → preload-helper-D_sPnjeL.js} +0 -0
  280. /package/payload/server/public/assets/{rough.esm-D5NinLFK.js → rough.esm-BJo4pvXu.js} +0 -0
  281. /package/payload/server/public/assets/{src-DQ0MSD6q.js → src-BTKk8KAG.js} +0 -0
  282. /package/payload/server/public/assets/{useSubAccountSwitcher-DotTrvX3.js → useSubAccountSwitcher-Q941cZYV.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{o as e,t}from"./chunk-TPjIAO9U.js";import{A as n,B as r,N as i,R as a,U as o,V as s,b as c,g as l,h as u,p as d,v as f,w as p,y as m}from"./useSubAccountSwitcher-DotTrvX3.js";import{d as h,n as g,t as _,v}from"./AdminShell-JN7rZ8aG.js";import{t as y}from"./Checkbox-CB74kINA.js";import{t as b}from"./chevron-down-Blma_CKl.js";import{t as x}from"./chevron-left-xeYDxFiC.js";import{n as S,t as ee}from"./maximize-2-k3Fu5hdP.js";import{t as C}from"./rotate-ccw-D-ov5jM4.js";import{i as te,n as w,r as ne}from"./graph-labels-DA48HrRR.js";import{t as T}from"./useCopyFeedback-hbnPS-r9.js";var E=i(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),D=i(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),O=i(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),k=i(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),re=i(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ie=i(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),A=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},w=typeof document==`object`&&document.all,ne={all:w,IS_HTMLDDA:w===void 0&&w!==void 0},T=ne,E=T.all,D=T.IS_HTMLDDA?function(e){return typeof e==`function`||e===E}:function(e){return typeof e==`function`},O={},k=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),re=c,ie=Function.prototype.call,A=re?ie.bind(ie):function(){return ie.apply(ie,arguments)},ae={},oe={}.propertyIsEnumerable,se=Object.getOwnPropertyDescriptor;ae.f=se&&!oe.call({1:2},1)?function(e){var t=se(this,e);return!!t&&t.enumerable}:oe;var ce=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},j=v,le=s,ue=S,de=Object,fe=j(``.split),pe=le(function(){return!de(`z`).propertyIsEnumerable(0)})?function(e){return ue(e)===`String`?fe(e,``):de(e)}:de,me=function(e){return e==null},he=me,ge=TypeError,_e=function(e){if(he(e))throw new ge(`Can't call method on `+e);return e},ve=pe,ye=_e,be=function(e){return ve(ye(e))},xe=D,Se=ne,M=Se.all,N=Se.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:xe(e)||e===M}:function(e){return typeof e==`object`?e!==null:xe(e)},Ce={},we=Ce,Te=o,Ee=D,P=function(e){return Ee(e)?e:void 0},F=function(e,t){return arguments.length<2?P(we[e])||P(Te[e]):we[e]&&we[e][t]||Te[e]&&Te[e][t]},De=v({}.isPrototypeOf),Oe=typeof navigator<`u`&&String(navigator.userAgent)||``,ke=o,Ae=Oe,je=ke.process,Me=ke.Deno,Ne=je&&je.versions||Me&&Me.version,Pe=Ne&&Ne.v8,Fe,Ie;Pe&&(Fe=Pe.split(`.`),Ie=Fe[0]>0&&Fe[0]<4?1:+(Fe[0]+Fe[1])),!Ie&&Ae&&(Fe=Ae.match(/Edge\/(\d+)/),(!Fe||Fe[1]>=74)&&(Fe=Ae.match(/Chrome\/(\d+)/),Fe&&(Ie=+Fe[1])));var Le=Ie,Re=Le,ze=s,Be=o.String,Ve=!!Object.getOwnPropertySymbols&&!ze(function(){var e=Symbol(`symbol detection`);return!Be(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Re&&Re<41}),He=Ve&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,Ue=F,We=D,Ge=De,Ke=He,qe=Object,Je=Ke?function(e){return typeof e==`symbol`}:function(e){var t=Ue(`Symbol`);return We(t)&&Ge(t.prototype,qe(e))},Ye=String,Xe=function(e){try{return Ye(e)}catch{return`Object`}},Ze=D,Qe=Xe,$e=TypeError,et=function(e){if(Ze(e))return e;throw new $e(Qe(e)+` is not a function`)},tt=et,nt=me,rt=function(e,t){var n=e[t];return nt(n)?void 0:tt(n)},it=A,at=D,ot=N,st=TypeError,I=function(e,t){var n,r;if(t===`string`&&at(n=e.toString)&&!ot(r=it(n,e))||at(n=e.valueOf)&&!ot(r=it(n,e))||t!==`string`&&at(n=e.toString)&&!ot(r=it(n,e)))return r;throw new st(`Can't convert object to primitive value`)},ct={exports:{}},lt=!0,ut=o,dt=Object.defineProperty,ft=function(e,t){try{dt(ut,e,{value:t,configurable:!0,writable:!0})}catch{ut[e]=t}return t},pt=o,mt=ft,ht=`__core-js_shared__`,gt=pt[ht]||mt(ht,{}),_t=gt;(ct.exports=function(e,t){return _t[e]||(_t[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var vt=ct.exports,yt=_e,bt=Object,xt=function(e){return bt(yt(e))},St=v,Ct=xt,wt=St({}.hasOwnProperty),Tt=Object.hasOwn||function(e,t){return wt(Ct(e),t)},Et=v,Dt=0,Ot=Math.random(),kt=Et(1 .toString),At=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+kt(++Dt+Ot,36)},jt=o,Mt=vt,Nt=Tt,Pt=At,Ft=Ve,It=He,Lt=jt.Symbol,Rt=Mt(`wks`),zt=It?Lt.for||Lt:Lt&&Lt.withoutSetter||Pt,Bt=function(e){return Nt(Rt,e)||(Rt[e]=Ft&&Nt(Lt,e)?Lt[e]:zt(`Symbol.`+e)),Rt[e]},Vt=A,Ht=N,Ut=Je,Wt=rt,Gt=I,Kt=Bt,qt=TypeError,Jt=Kt(`toPrimitive`),Yt=function(e,t){if(!Ht(e)||Ut(e))return e;var n=Wt(e,Jt),r;if(n){if(t===void 0&&(t=`default`),r=Vt(n,e,t),!Ht(r)||Ut(r))return r;throw new qt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Gt(e,t)},Xt=Je,Zt=function(e){var t=Yt(e,`string`);return Xt(t)?t:t+``},Qt=o,$t=N,en=Qt.document,tn=$t(en)&&$t(en.createElement),nn=function(e){return tn?en.createElement(e):{}},rn=k,an=s,on=nn,sn=!rn&&!an(function(){return Object.defineProperty(on(`div`),`a`,{get:function(){return 7}}).a!==7}),cn=k,ln=A,un=ae,dn=ce,fn=be,pn=Zt,mn=Tt,hn=sn,gn=Object.getOwnPropertyDescriptor;O.f=cn?gn:function(e,t){if(e=fn(e),t=pn(t),hn)try{return gn(e,t)}catch{}if(mn(e,t))return dn(!ln(un.f,e,t),e[t])};var _n=s,vn=D,yn=/#|\.prototype\./,bn=function(e,t){var n=Sn[xn(e)];return n===wn?!0:n===Cn?!1:vn(t)?_n(t):!!t},xn=bn.normalize=function(e){return String(e).replace(yn,`.`).toLowerCase()},Sn=bn.data={},Cn=bn.NATIVE=`N`,wn=bn.POLYFILL=`P`,Tn=bn,En=te,Dn=et,On=c,kn=En(En.bind),An=function(e,t){return Dn(e),t===void 0?e:On?kn(e,t):function(){return e.apply(t,arguments)}},jn={},Mn=k&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Nn=N,Pn=String,Fn=TypeError,In=function(e){if(Nn(e))return e;throw new Fn(Pn(e)+` is not an object`)},Ln=k,Rn=sn,zn=Mn,Bn=In,Vn=Zt,Hn=TypeError,Un=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,Gn=`enumerable`,L=`configurable`,R=`writable`;jn.f=Ln?zn?function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&R in n&&!n[R]){var r=Wn(e,t);r&&r[R]&&(e[t]=n.value,n={configurable:L in n?n[L]:r[L],enumerable:Gn in n?n[Gn]:r[Gn],writable:!1})}return Un(e,t,n)}:Un:function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),Rn)try{return Un(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Hn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Kn=k,qn=jn,Jn=ce,Yn=Kn?function(e,t,n){return qn.f(e,t,Jn(1,n))}:function(e,t,n){return e[t]=n,e},Xn=o,Zn=p,Qn=te,$n=D,er=O.f,tr=Tn,nr=Ce,rr=An,ir=Yn,ar=Tt,or=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Zn(e,this,arguments)};return t.prototype=e.prototype,t},z=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Xn:i?Xn[n]:(Xn[n]||{}).prototype,s=r?nr:nr[n]||ir(nr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=tr(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ar(o,f),m=s[f],u&&(e.dontCallGetSet?(_=er(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?rr(p,Xn):e.wrap&&u?or(p):a&&$n(p)?Qn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&ir(g,`sham`,!0),ir(s,f,g),a&&(d=n+`Prototype`,ar(nr,d)||ir(nr,d,{}),ir(nr[d],f,p),e.real&&c&&(l||!c[f])&&ir(c,f,p)))},sr=z,cr=k,lr=jn.f;sr({target:`Object`,stat:!0,forced:Object.defineProperty!==lr,sham:!cr},{defineProperty:lr});var ur=Ce.Object,dr=i.exports=function(e,t,n){return ur.defineProperty(e,t,n)};ur.defineProperty.sham&&(dr.sham=!0);var fr=i.exports,pr=fr,mr=r(pr),hr=S,gr=Array.isArray||function(e){return hr(e)===`Array`},_r=Math.ceil,vr=Math.floor,yr=Math.trunc||function(e){var t=+e;return(t>0?vr:_r)(t)},br=function(e){var t=+e;return t!==t||t===0?0:yr(t)},xr=br,Sr=Math.min,Cr=function(e){return e>0?Sr(xr(e),9007199254740991):0},wr=function(e){return Cr(e.length)},Tr=TypeError,Er=9007199254740991,Dr=function(e){if(e>Er)throw Tr(`Maximum allowed index exceeded`);return e},Or=Zt,kr=jn,Ar=ce,jr=function(e,t,n){var r=Or(t);r in e?kr.f(e,r,Ar(0,n)):e[r]=n},Mr=Bt(`toStringTag`),Nr={};Nr[Mr]=`z`;var Pr=String(Nr)===`[object z]`,Fr=Pr,Ir=D,Lr=S,Rr=Bt(`toStringTag`),zr=Object,Br=Lr(function(){return arguments}())===`Arguments`,Vr=function(e,t){try{return e[t]}catch{}},Hr=Fr?Lr:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Vr(t=zr(e),Rr))==`string`?n:Br?Lr(t):(r=Lr(t))===`Object`&&Ir(t.callee)?`Arguments`:r},Ur=v,Wr=D,Gr=gt,Kr=Ur(Function.toString);Wr(Gr.inspectSource)||(Gr.inspectSource=function(e){return Kr(e)});var qr=Gr.inspectSource,Jr=v,Yr=s,Xr=D,Zr=Hr,Qr=F,B=qr,$r=function(){},ei=[],ti=Qr(`Reflect`,`construct`),ni=/^\s*(?:class|function)\b/,ri=Jr(ni.exec),ii=!ni.test($r),ai=function(e){if(!Xr(e))return!1;try{return ti($r,ei,e),!0}catch{return!1}},oi=function(e){if(!Xr(e))return!1;switch(Zr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ii||!!ri(ni,B(e))}catch{return!0}};oi.sham=!0;var si=!ti||Yr(function(){var e;return ai(ai.call)||!ai(Object)||!ai(function(){e=!0})||e})?oi:ai,ci=gr,li=si,ui=N,di=Bt(`species`),fi=Array,pi=function(e){var t;return ci(e)&&(t=e.constructor,li(t)&&(t===fi||ci(t.prototype))?t=void 0:ui(t)&&(t=t[di],t===null&&(t=void 0))),t===void 0?fi:t},mi=function(e,t){return new(pi(e))(t===0?0:t)},hi=s,gi=Bt,_i=Le,vi=gi(`species`),yi=function(e){return _i>=51||!hi(function(){var t=[],n=t.constructor={};return n[vi]=function(){return{foo:1}},t[e](Boolean).foo!==1})},bi=z,xi=s,Si=gr,Ci=N,wi=xt,Ti=wr,Ei=Dr,Di=jr,Oi=mi,ki=yi,Ai=Bt,ji=Le,Mi=Ai(`isConcatSpreadable`),Ni=ji>=51||!xi(function(){var e=[];return e[Mi]=!1,e.concat()[0]!==e}),Pi=function(e){if(!Ci(e))return!1;var t=e[Mi];return t===void 0?Si(e):!!t};bi({target:`Array`,proto:!0,arity:1,forced:!Ni||!ki(`concat`)},{concat:function(e){var t=wi(this),n=Oi(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Pi(c))for(s=Ti(c),Ei(r+s),a=0;a<s;a++,r++)a in c&&Di(n,r,c[a]);else Ei(r+1),Di(n,r++,c);return n.length=r,n}});var Fi=Hr,Ii=String,Li=function(e){if(Fi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Ii(e)},Ri={},zi=br,Bi=Math.max,Vi=Math.min,Hi=function(e,t){var n=zi(e);return n<0?Bi(n+t,0):Vi(n,t)},Ui=be,Wi=Hi,Gi=wr,Ki=function(e){return function(t,n,r){var i=Ui(t),a=Gi(i),o=Wi(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},qi={includes:Ki(!0),indexOf:Ki(!1)},Ji={},Yi=v,Xi=Tt,Zi=be,Qi=qi.indexOf,$i=Ji,ea=Yi([].push),ta=function(e,t){var n=Zi(e),r=0,i=[],a;for(a in n)!Xi($i,a)&&Xi(n,a)&&ea(i,a);for(;t.length>r;)Xi(n,a=t[r++])&&(~Qi(i,a)||ea(i,a));return i},na=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],ra=ta,ia=na,aa=Object.keys||function(e){return ra(e,ia)},oa=k,sa=Mn,ca=jn,la=In,ua=be,da=aa;Ri.f=oa&&!sa?Object.defineProperties:function(e,t){la(e);for(var n=ua(t),r=da(t),i=r.length,a=0,o;i>a;)ca.f(e,o=r[a++],n[o]);return e};var fa=F(`document`,`documentElement`),pa=vt,ma=At,ha=pa(`keys`),ga=function(e){return ha[e]||(ha[e]=ma(e))},_a=In,va=Ri,ya=na,ba=Ji,xa=fa,Sa=nn,Ca=ga,wa=`>`,Ta=`<`,Ea=`prototype`,Da=`script`,Oa=Ca(`IE_PROTO`),ka=function(){},Aa=function(e){return Ta+Da+wa+e+Ta+`/`+Da+wa},ja=function(e){e.write(Aa(``)),e.close();var t=e.parentWindow.Object;return e=null,t},Ma=function(){var e=Sa(`iframe`),t=`java`+Da+`:`,n;return e.style.display=`none`,xa.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(Aa(`document.F=Object`)),n.close(),n.F},Na,Pa=function(){try{Na=new ActiveXObject(`htmlfile`)}catch{}Pa=typeof document<`u`?document.domain&&Na?ja(Na):Ma():ja(Na);for(var e=ya.length;e--;)delete Pa[Ea][ya[e]];return Pa()};ba[Oa]=!0;var Fa=Object.create||function(e,t){var n;return e===null?n=Pa():(ka[Ea]=_a(e),n=new ka,ka[Ea]=null,n[Oa]=e),t===void 0?n:va.f(n,t)},Ia={},La=ta,Ra=na.concat(`length`,`prototype`);Ia.f=Object.getOwnPropertyNames||function(e){return La(e,Ra)};var za={},Ba=Hi,Va=wr,Ha=jr,Ua=Array,Wa=Math.max,Ga=function(e,t,n){for(var r=Va(e),i=Ba(t,r),a=Ba(n===void 0?r:n,r),o=Ua(Wa(a-i,0)),s=0;i<a;i++,s++)Ha(o,s,e[i]);return o.length=s,o},Ka=S,qa=be,Ja=Ia.f,Ya=Ga,Xa=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Za=function(e){try{return Ja(e)}catch{return Ya(Xa)}};za.f=function(e){return Xa&&Ka(e)===`Window`?Za(e):Ja(qa(e))};var Qa={};Qa.f=Object.getOwnPropertySymbols;var $a=Yn,eo=function(e,t,n,r){return r&&r.enumerable?e[t]=n:$a(e,t,n),e},to=jn,no=function(e,t,n){return to.f(e,t,n)},ro={};ro.f=Bt;var io=Ce,ao=Tt,oo=ro,so=jn.f,co=function(e){var t=io.Symbol||={};ao(t,e)||so(t,e,{value:oo.f(e)})},lo=A,uo=F,fo=Bt,po=eo,mo=function(){var e=uo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=fo(`toPrimitive`);t&&!t[r]&&po(t,r,function(e){return lo(n,this)},{arity:1})},ho=Pr,go=Hr,_o=ho?{}.toString:function(){return`[object `+go(this)+`]`},vo=Pr,yo=jn.f,bo=Yn,xo=Tt,So=_o,Co=Bt(`toStringTag`),wo=function(e,t,n,r){if(e){var i=n?e:e.prototype;xo(i,Co)||yo(i,Co,{configurable:!0,value:t}),r&&!vo&&bo(i,`toString`,So)}},To=o,Eo=D,Do=To.WeakMap,Oo=Eo(Do)&&/native code/.test(String(Do)),ko=o,Ao=N,jo=Yn,Mo=Tt,No=gt,Po=ga,Fo=Ji,Io=`Object already initialized`,Lo=ko.TypeError,Ro=ko.WeakMap,zo,Bo,Vo,Ho=function(e){return Vo(e)?Bo(e):zo(e,{})},Uo=function(e){return function(t){var n;if(!Ao(t)||(n=Bo(t)).type!==e)throw new Lo(`Incompatible receiver, `+e+` required`);return n}};if(Oo||No.state){var Wo=No.state||=new Ro;Wo.get=Wo.get,Wo.has=Wo.has,Wo.set=Wo.set,zo=function(e,t){if(Wo.has(e))throw new Lo(Io);return t.facade=e,Wo.set(e,t),t},Bo=function(e){return Wo.get(e)||{}},Vo=function(e){return Wo.has(e)}}else{var Go=Po(`state`);Fo[Go]=!0,zo=function(e,t){if(Mo(e,Go))throw new Lo(Io);return t.facade=e,jo(e,Go,t),t},Bo=function(e){return Mo(e,Go)?e[Go]:{}},Vo=function(e){return Mo(e,Go)}}var Ko={set:zo,get:Bo,has:Vo,enforce:Ho,getterFor:Uo},qo=An,Jo=v,Yo=pe,Xo=xt,Zo=wr,Qo=mi,$o=Jo([].push),es=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Xo(c),p=Yo(f),m=qo(l,u),h=Zo(p),g=0,_=d||Qo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:$o(v,y)}else switch(e){case 4:return!1;case 7:$o(v,y)}return a?-1:r||i?i:v}},ts={forEach:es(0),map:es(1),filter:es(2),some:es(3),every:es(4),find:es(5),findIndex:es(6),filterReject:es(7)},ns=z,rs=o,is=A,as=v,os=k,ss=Ve,cs=s,ls=Tt,us=De,ds=In,fs=be,ps=Zt,ms=Li,hs=ce,gs=Fa,_s=aa,vs=Ia,ys=za,bs=Qa,xs=O,Ss=jn,Cs=Ri,ws=ae,Ts=eo,Es=no,Ds=vt,Os=ga,ks=Ji,As=At,js=Bt,Ms=ro,Ns=co,Ps=mo,Fs=wo,Is=Ko,Ls=ts.forEach,Rs=Os(`hidden`),zs=`Symbol`,Bs=`prototype`,Vs=Is.set,Hs=Is.getterFor(zs),Us=Object[Bs],Ws=rs.Symbol,Gs=Ws&&Ws[Bs],Ks=rs.RangeError,qs=rs.TypeError,Js=rs.QObject,Ys=xs.f,Xs=Ss.f,Zs=ys.f,Qs=ws.f,$s=as([].push),ec=Ds(`symbols`),tc=Ds(`op-symbols`),nc=Ds(`wks`),rc=!Js||!Js[Bs]||!Js[Bs].findChild,ic=function(e,t,n){var r=Ys(Us,t);r&&delete Us[t],Xs(e,t,n),r&&e!==Us&&Xs(Us,t,r)},ac=os&&cs(function(){return gs(Xs({},`a`,{get:function(){return Xs(this,`a`,{value:7}).a}})).a!==7})?ic:Xs,oc=function(e,t){var n=ec[e]=gs(Gs);return Vs(n,{type:zs,tag:e,description:t}),os||(n.description=t),n},sc=function(e,t,n){e===Us&&sc(tc,t,n),ds(e);var r=ps(t);return ds(n),ls(ec,r)?(n.enumerable?(ls(e,Rs)&&e[Rs][r]&&(e[Rs][r]=!1),n=gs(n,{enumerable:hs(0,!1)})):(ls(e,Rs)||Xs(e,Rs,hs(1,{})),e[Rs][r]=!0),ac(e,r,n)):Xs(e,r,n)},cc=function(e,t){ds(e);var n=fs(t);return Ls(_s(n).concat(pc(n)),function(t){(!os||is(uc,n,t))&&sc(e,t,n[t])}),e},lc=function(e,t){return t===void 0?gs(e):cc(gs(e),t)},uc=function(e){var t=ps(e),n=is(Qs,this,t);return this===Us&&ls(ec,t)&&!ls(tc,t)?!1:n||!ls(this,t)||!ls(ec,t)||ls(this,Rs)&&this[Rs][t]?n:!0},dc=function(e,t){var n=fs(e),r=ps(t);if(!(n===Us&&ls(ec,r)&&!ls(tc,r))){var i=Ys(n,r);return i&&ls(ec,r)&&!(ls(n,Rs)&&n[Rs][r])&&(i.enumerable=!0),i}},fc=function(e){var t=Zs(fs(e)),n=[];return Ls(t,function(e){!ls(ec,e)&&!ls(ks,e)&&$s(n,e)}),n},pc=function(e){var t=e===Us,n=Zs(t?tc:fs(e)),r=[];return Ls(n,function(e){ls(ec,e)&&(!t||ls(Us,e))&&$s(r,ec[e])}),r};ss||(Ws=function(){if(us(Gs,this))throw new qs(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ms(arguments[0]),t=As(e),n=function(e){var r=this===void 0?rs:this;r===Us&&is(n,tc,e),ls(r,Rs)&&ls(r[Rs],t)&&(r[Rs][t]=!1);var i=hs(1,e);try{ac(r,t,i)}catch(e){if(!(e instanceof Ks))throw e;ic(r,t,i)}};return os&&rc&&ac(Us,t,{configurable:!0,set:n}),oc(t,e)},Gs=Ws[Bs],Ts(Gs,`toString`,function(){return Hs(this).tag}),Ts(Ws,`withoutSetter`,function(e){return oc(As(e),e)}),ws.f=uc,Ss.f=sc,Cs.f=cc,xs.f=dc,vs.f=ys.f=fc,bs.f=pc,Ms.f=function(e){return oc(js(e),e)},os&&Es(Gs,`description`,{configurable:!0,get:function(){return Hs(this).description}})),ns({global:!0,constructor:!0,wrap:!0,forced:!ss,sham:!ss},{Symbol:Ws}),Ls(_s(nc),function(e){Ns(e)}),ns({target:zs,stat:!0,forced:!ss},{useSetter:function(){rc=!0},useSimple:function(){rc=!1}}),ns({target:`Object`,stat:!0,forced:!ss,sham:!os},{create:lc,defineProperty:sc,defineProperties:cc,getOwnPropertyDescriptor:dc}),ns({target:`Object`,stat:!0,forced:!ss},{getOwnPropertyNames:fc}),Ps(),Fs(Ws,zs),ks[Rs]=!0;var mc=Ve&&!!Symbol.for&&!!Symbol.keyFor,hc=z,gc=F,_c=Tt,vc=Li,yc=vt,bc=mc,xc=yc(`string-to-symbol-registry`),V=yc(`symbol-to-string-registry`);hc({target:`Symbol`,stat:!0,forced:!bc},{for:function(e){var t=vc(e);if(_c(xc,t))return xc[t];var n=gc(`Symbol`)(t);return xc[t]=n,V[n]=t,n}});var Sc=z,Cc=Tt,wc=Je,Tc=Xe,Ec=vt,Dc=mc,Oc=Ec(`symbol-to-string-registry`);Sc({target:`Symbol`,stat:!0,forced:!Dc},{keyFor:function(e){if(!wc(e))throw TypeError(Tc(e)+` is not a symbol`);if(Cc(Oc,e))return Oc[e]}});var kc=v([].slice),Ac=v,jc=gr,Mc=D,Nc=S,Pc=Li,Fc=Ac([].push),Ic=function(e){if(Mc(e))return e;if(jc(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Fc(n,i):(typeof i==`number`||Nc(i)===`Number`||Nc(i)===`String`)&&Fc(n,Pc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(jc(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Lc=z,Rc=F,zc=p,Bc=A,Vc=v,Hc=s,Uc=D,Wc=Je,Gc=kc,Kc=Ic,qc=Ve,Jc=String,Yc=Rc(`JSON`,`stringify`),Xc=Vc(/./.exec),Zc=Vc(``.charAt),Qc=Vc(``.charCodeAt),$c=Vc(``.replace),el=Vc(1 .toString),tl=/[\uD800-\uDFFF]/g,nl=/^[\uD800-\uDBFF]$/,rl=/^[\uDC00-\uDFFF]$/,il=!qc||Hc(function(){var e=Rc(`Symbol`)(`stringify detection`);return Yc([e])!==`[null]`||Yc({a:e})!==`{}`||Yc(Object(e))!==`{}`}),al=Hc(function(){return Yc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Yc(`\udead`)!==`"\\udead"`}),ol=function(e,t){var n=Gc(arguments),r=Kc(t);if(!(!Uc(r)&&(e===void 0||Wc(e))))return n[1]=function(e,t){if(Uc(r)&&(t=Bc(r,this,Jc(e),t)),!Wc(t))return t},zc(Yc,null,n)},sl=function(e,t,n){var r=Zc(n,t-1),i=Zc(n,t+1);return Xc(nl,e)&&!Xc(rl,i)||Xc(rl,e)&&!Xc(nl,r)?`\\u`+el(Qc(e,0),16):e};Yc&&Lc({target:`JSON`,stat:!0,arity:3,forced:il||al},{stringify:function(e,t,n){var r=Gc(arguments),i=zc(il?ol:Yc,null,r);return al&&typeof i==`string`?$c(i,tl,sl):i}});var cl=z,ll=Ve,ul=s,dl=Qa,fl=xt;cl({target:`Object`,stat:!0,forced:!ll||ul(function(){dl.f(1)})},{getOwnPropertySymbols:function(e){var t=dl.f;return t?t(fl(e)):[]}}),co(`asyncIterator`),co(`hasInstance`),co(`isConcatSpreadable`),co(`iterator`),co(`match`),co(`matchAll`),co(`replace`),co(`search`),co(`species`),co(`split`);var pl=co,ml=mo;pl(`toPrimitive`),ml();var hl=F,gl=co,_l=wo;gl(`toStringTag`),_l(hl(`Symbol`),`Symbol`),co(`unscopables`),wo(o.JSON,`JSON`,!0);var vl=Ce.Symbol,yl={},bl=k,xl=Tt,Sl=Function.prototype,Cl=bl&&Object.getOwnPropertyDescriptor,wl=xl(Sl,`name`),Tl={EXISTS:wl,PROPER:wl&&(function(){}).name===`something`,CONFIGURABLE:wl&&(!bl||bl&&Cl(Sl,`name`).configurable)},El=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Dl=Tt,Ol=D,kl=xt,Al=ga,jl=El,Ml=Al(`IE_PROTO`),Nl=Object,Pl=Nl.prototype,Fl=jl?Nl.getPrototypeOf:function(e){var t=kl(e);if(Dl(t,Ml))return t[Ml];var n=t.constructor;return Ol(n)&&t instanceof n?n.prototype:t instanceof Nl?Pl:null},Il=s,Ll=D,Rl=N,zl=Fa,Bl=Fl,Vl=eo,Hl=Bt(`iterator`),Ul=!1,Wl,Gl,Kl;[].keys&&(Kl=[].keys(),`next`in Kl?(Gl=Bl(Bl(Kl)),Gl!==Object.prototype&&(Wl=Gl)):Ul=!0),Wl=!Rl(Wl)||Il(function(){var e={};return Wl[Hl].call(e)!==e})?{}:zl(Wl),Ll(Wl[Hl])||Vl(Wl,Hl,function(){return this});var ql={IteratorPrototype:Wl,BUGGY_SAFARI_ITERATORS:Ul},Jl=ql.IteratorPrototype,Yl=Fa,Xl=ce,Zl=wo,Ql=yl,$l=function(){return this},eu=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Yl(Jl,{next:Xl(+!r,n)}),Zl(e,i,!1,!0),Ql[i]=$l,e},tu=v,nu=et,ru=function(e,t,n){try{return tu(nu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},iu=D,au=String,ou=TypeError,su=function(e){if(typeof e==`object`||iu(e))return e;throw new ou(`Can't set `+au(e)+` as a prototype`)},cu=ru,lu=In,uu=su,du=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=cu(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return lu(t),uu(r),e?n(t,r):t.__proto__=r,t}}():void 0),fu=z,pu=A,mu=Tl,hu=eu,gu=Fl,_u=wo,vu=eo,yu=Bt,bu=yl,xu=ql,Su=mu.PROPER;mu.CONFIGURABLE,xu.IteratorPrototype;var Cu=xu.BUGGY_SAFARI_ITERATORS,wu=yu(`iterator`),Tu=`keys`,Eu=`values`,Du=`entries`,Ou=function(){return this},ku=function(e,t,n,r,i,a,o){hu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Cu&&e&&e in u)return u[e];switch(e){case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)};case Du:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[wu]||u[`@@iterator`]||i&&u[i],f=!Cu&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=gu(p.call(new e)),m!==Object.prototype&&m.next&&(_u(m,c,!0,!0),bu[c]=Ou)),Su&&i===Eu&&d&&d.name!==Eu&&(l=!0,f=function(){return pu(d,this)}),i)if(h={values:s(Eu),keys:a?f:s(Tu),entries:s(Du)},o)for(g in h)(Cu||l||!(g in u))&&vu(u,g,h[g]);else fu({target:t,proto:!0,forced:Cu||l},h);return o&&u[wu]!==f&&vu(u,wu,f,{name:i}),bu[t]=f,h},Au=function(e,t){return{value:e,done:t}},ju=be,Mu=yl,Nu=Ko;jn.f;var Pu=ku,Fu=Au,Iu=`Array Iterator`,Lu=Nu.set,Ru=Nu.getterFor(Iu);Pu(Array,`Array`,function(e,t){Lu(this,{type:Iu,target:ju(e),index:0,kind:t})},function(){var e=Ru(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Fu(void 0,!0);switch(e.kind){case`keys`:return Fu(n,!1);case`values`:return Fu(t[n],!1)}return Fu([n,t[n]],!1)},`values`),Mu.Arguments=Mu.Array;var zu={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Bu=o,Vu=Hr,Hu=Yn,Uu=yl,Wu=Bt(`toStringTag`);for(var Gu in zu){var Ku=Bu[Gu],qu=Ku&&Ku.prototype;qu&&Vu(qu)!==Wu&&Hu(qu,Wu,Gu),Uu[Gu]=Uu.Array}var Ju=vl,Yu=Bt,Xu=jn.f,Zu=Yu(`metadata`),Qu=Function.prototype;Qu[Zu]===void 0&&Xu(Qu,Zu,{value:null}),co(`asyncDispose`),co(`dispose`),co(`metadata`);var $u=Ju,ed=F,td=v,nd=ed(`Symbol`),rd=nd.keyFor,id=td(nd.prototype.valueOf),ad=nd.isRegisteredSymbol||function(e){try{return rd(id(e))!==void 0}catch{return!1}};z({target:`Symbol`,stat:!0},{isRegisteredSymbol:ad});for(var od=vt,sd=F,cd=v,ld=Je,ud=Bt,dd=sd(`Symbol`),fd=dd.isWellKnownSymbol,pd=sd(`Object`,`getOwnPropertyNames`),md=cd(dd.prototype.valueOf),hd=od(`wks`),gd=0,_d=pd(dd),vd=_d.length;gd<vd;gd++)try{var yd=_d[gd];ld(dd[yd])&&ud(yd)}catch{}var bd=function(e){if(fd&&fd(e))return!0;try{for(var t=md(e),n=0,r=pd(hd),i=r.length;n<i;n++)if(hd[r[n]]==t)return!0}catch{}return!1};z({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:bd}),co(`matcher`),co(`observable`),z({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:ad}),z({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:bd}),co(`metadataKey`),co(`patternMatch`),co(`replaceAll`);var xd=$u,Sd=r(xd),Cd=v,wd=br,Td=Li,Ed=_e,Dd=Cd(``.charAt),Od=Cd(``.charCodeAt),kd=Cd(``.slice),Ad=function(e){return function(t,n){var r=Td(Ed(t)),i=wd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Od(r,i),o<55296||o>56319||i+1===a||(s=Od(r,i+1))<56320||s>57343?e?Dd(r,i):o:e?kd(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},jd={codeAt:Ad(!1),charAt:Ad(!0)}.charAt,Md=Li,Nd=Ko,Pd=ku,Fd=Au,Id=`String Iterator`,Ld=Nd.set,Rd=Nd.getterFor(Id);Pd(String,`String`,function(e){Ld(this,{type:Id,string:Md(e),index:0})},function(){var e=Rd(this),t=e.string,n=e.index,r;return n>=t.length?Fd(void 0,!0):(r=jd(t,n),e.index+=r.length,Fd(r,!1))});var zd=ro.f(`iterator`),Bd=zd,Vd=r(Bd);function Hd(e){"@babel/helpers - typeof";return Hd=typeof Sd==`function`&&typeof Vd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Sd==`function`&&e.constructor===Sd&&e!==Sd.prototype?`symbol`:typeof e},Hd(e)}var Ud=r(ro.f(`toPrimitive`));function Wd(e,t){if(Hd(e)!==`object`||e===null)return e;var n=e[Ud];if(n!==void 0){var r=n.call(e,t||`default`);if(Hd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Gd(e){var t=Wd(e,`string`);return Hd(t)===`symbol`?t:String(t)}function Kd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),mr(e,Gd(r.key),r)}}function qd(e,t,n){return t&&Kd(e.prototype,t),n&&Kd(e,n),mr(e,`prototype`,{writable:!1}),e}function Jd(e,t,n){return t=Gd(t),t in e?mr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yd=v,Xd=et,Zd=N,Qd=Tt,$d=kc,ef=c,tf=Function,nf=Yd([].concat),rf=Yd([].join),af={},of=function(e,t,n){if(!Qd(af,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;af[t]=tf(`C,a`,`return new C(`+rf(r,`,`)+`)`)}return af[t](e,n)},sf=ef?tf.bind:function(e){var t=Xd(this),n=t.prototype,r=$d(arguments,1),i=function(){var n=nf(r,$d(arguments));return this instanceof i?of(t,n.length,n):t.apply(e,n)};return Zd(n)&&(i.prototype=n),i},cf=z,lf=sf;cf({target:`Function`,proto:!0,forced:Function.bind!==lf},{bind:lf});var uf=o,df=Ce,ff=function(e,t){var n=df[e+`Prototype`],r=n&&n[t];if(r)return r;var i=uf[e],a=i&&i.prototype;return a&&a[t]},pf=ff(`Function`,`bind`),mf=De,hf=pf,gf=Function.prototype,_f=function(e){var t=e.bind;return e===gf||mf(gf,e)&&t===gf.bind?hf:t},vf=r(_f),yf=et,bf=xt,xf=pe,Sf=wr,Cf=TypeError,wf=function(e){return function(t,n,r,i){yf(n);var a=bf(t),o=xf(a),s=Sf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Cf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},Tf={left:wf(!1),right:wf(!0)},H=s,Ef=function(e,t){var n=[][e];return!!n&&H(function(){n.call(null,t||function(){return 1},1)})},Df=S(o.process)===`process`,Of=z,kf=Tf.left,Af=Ef,jf=Le;Of({target:`Array`,proto:!0,forced:!Df&&jf>79&&jf<83||!Af(`reduce`)},{reduce:function(e){var t=arguments.length;return kf(this,e,t,t>1?arguments[1]:void 0)}});var Mf=ff(`Array`,`reduce`),Nf=De,Pf=Mf,Ff=Array.prototype,If=r(function(e){var t=e.reduce;return e===Ff||Nf(Ff,e)&&t===Ff.reduce?Pf:t}),Lf=z,Rf=ts.filter;Lf({target:`Array`,proto:!0,forced:!yi(`filter`)},{filter:function(e){return Rf(this,e,arguments.length>1?arguments[1]:void 0)}});var zf=ff(`Array`,`filter`),Bf=De,Vf=zf,Hf=Array.prototype,Uf=r(function(e){var t=e.filter;return e===Hf||Bf(Hf,e)&&t===Hf.filter?Vf:t}),Wf=z,Gf=ts.map;Wf({target:`Array`,proto:!0,forced:!yi(`map`)},{map:function(e){return Gf(this,e,arguments.length>1?arguments[1]:void 0)}});var Kf=ff(`Array`,`map`),qf=De,Jf=Kf,Yf=Array.prototype,Xf=r(function(e){var t=e.map;return e===Yf||qf(Yf,e)&&t===Yf.map?Jf:t}),Zf=gr,Qf=wr,$f=Dr,ep=An,tp=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?ep(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Zf(d)?(f=Qf(d),c=tp(e,t,d,f,c,a-1)-1):($f(c+1),e[c]=d),c++),l++;return c},np=tp,rp=z,ip=np,ap=et,op=xt,sp=wr,cp=mi;rp({target:`Array`,proto:!0},{flatMap:function(e){var t=op(this),n=sp(t),r;return ap(e),r=cp(t,0),r.length=ip(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var lp=ff(`Array`,`flatMap`),up=De,dp=lp,fp=Array.prototype,pp=r(function(e){var t=e.flatMap;return e===fp||up(fp,e)&&t===fp.flatMap?dp:t});function mp(e){return new gp(e)}var hp=function(){function e(n,r,i){var a,o,s;t(this,e),Jd(this,`_listeners`,{add:vf(a=this._add).call(a,this),remove:vf(o=this._remove).call(o,this),update:vf(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return qd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return If(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),gp=function(){function e(n){t(this,e),Jd(this,`_transformers`,[]),this._source=n}return qd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Uf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Xf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return pp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new hp(this._source,this._transformers,e)}}]),e}(),_p=A,vp=In,yp=rt,bp=function(e,t,n){var r,i;vp(e);try{if(r=yp(e,`return`),!r){if(t===`throw`)throw n;return n}r=_p(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return vp(r),n},xp=In,Sp=bp,Cp=function(e,t,n,r){try{return r?t(xp(n)[0],n[1]):t(n)}catch(t){Sp(e,`throw`,t)}},wp=Bt,Tp=yl,Ep=wp(`iterator`),Dp=Array.prototype,Op=function(e){return e!==void 0&&(Tp.Array===e||Dp[Ep]===e)},kp=Hr,Ap=rt,jp=me,Mp=yl,Np=Bt(`iterator`),Pp=function(e){if(!jp(e))return Ap(e,Np)||Ap(e,`@@iterator`)||Mp[kp(e)]},Fp=A,Ip=et,Lp=In,Rp=Xe,zp=Pp,Bp=TypeError,Vp=function(e,t){var n=arguments.length<2?zp(e):t;if(Ip(n))return Lp(Fp(n,e));throw new Bp(Rp(e)+` is not iterable`)},Hp=An,Up=A,Wp=xt,Gp=Cp,Kp=Op,qp=si,Jp=wr,Yp=jr,Xp=Vp,Zp=Pp,Qp=Array,$p=function(e){var t=Wp(e),n=qp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Hp(i,r>2?arguments[2]:void 0));var o=Zp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Qp&&Kp(o)))for(d=Xp(t,o),f=d.next,l=n?new this:[];!(u=Up(f,d)).done;s++)p=a?Gp(d,i,[u.value,s],!0):u.value,Yp(l,s,p);else for(c=Jp(t),l=n?new this(c):Qp(c);c>s;s++)p=a?i(t[s],s):t[s],Yp(l,s,p);return l.length=s,l},em=Bt(`iterator`),tm=!1;try{var nm=0,rm={next:function(){return{done:!!nm++}},return:function(){tm=!0}};rm[em]=function(){return this},Array.from(rm,function(){throw 2})}catch{}var im=function(e,t){try{if(!t&&!tm)return!1}catch{return!1}var n=!1;try{var r={};r[em]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},am=z,om=$p;am({target:`Array`,stat:!0,forced:!im(function(e){Array.from(e)})},{from:om});var sm=Ce.Array.from,cm=r(sm),lm=Pp,um=r(lm),dm=r(lm);z({target:`Array`,stat:!0},{isArray:gr});var fm=Ce.Array.isArray,pm=r(fm);function mm(e){if(pm(e))return e}var hm=k,gm=gr,_m=TypeError,vm=Object.getOwnPropertyDescriptor,ym=hm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(gm(e)&&!vm(e,`length`).writable)throw new _m(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},bm=z,xm=xt,Sm=wr,Cm=ym,wm=Dr;bm({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=xm(this),n=Sm(t),r=arguments.length;wm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Cm(t,n),n}});var Tm=ff(`Array`,`push`),Em=De,Dm=Tm,Om=Array.prototype,km=function(e){var t=e.push;return e===Om||Em(Om,e)&&t===Om.push?Dm:t},Am=r(km);function jm(e,t){var n=e==null?null:Sd!==void 0&&um(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(Am(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}var Mm=z,Nm=gr,Pm=si,Fm=N,Im=Hi,Lm=wr,Rm=be,zm=jr,Bm=Bt,Vm=yi,Hm=kc,Um=Vm(`slice`),Wm=Bm(`species`),Gm=Array,Km=Math.max;Mm({target:`Array`,proto:!0,forced:!Um},{slice:function(e,t){var n=Rm(this),r=Lm(n),i=Im(e,r),a=Im(t===void 0?r:t,r),o,s,c;if(Nm(n)&&(o=n.constructor,Pm(o)&&(o===Gm||Nm(o.prototype))?o=void 0:Fm(o)&&(o=o[Wm],o===null&&(o=void 0)),o===Gm||o===void 0))return Hm(n,i,a);for(s=new(o===void 0?Gm:o)(Km(a-i,0)),c=0;i<a;i++,c++)i in n&&zm(s,c,n[i]);return s.length=c,s}});var qm=ff(`Array`,`slice`),Jm=De,Ym=qm,Xm=Array.prototype,Zm=function(e){var t=e.slice;return e===Xm||Jm(Xm,e)&&t===Xm.slice?Ym:t},Qm=Zm,$m=r(Qm),eh=r(sm);function th(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nh(e,t){var n;if(e){if(typeof e==`string`)return th(e,t);var r=$m(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return eh(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return th(e,t)}}function rh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{o as e,t}from"./chunk-TPjIAO9U.js";import{A as n,B as r,N as i,R as a,U as o,V as s,b as c,g as l,h as u,p as d,v as f,w as p,y as m}from"./useSubAccountSwitcher-Q941cZYV.js";import{d as h,n as g,t as _,v,y}from"./AdminShell-BwNqwb4k.js";import{t as b}from"./chevron-down-Dnuuw6Q2.js";import{t as x}from"./chevron-left-CC4zmWOr.js";import{n as S,t as ee}from"./maximize-2-CPq3nwZA.js";import{t as C}from"./rotate-ccw-DieZzl10.js";import{i as te,n as w,r as ne}from"./graph-labels-GgejRtgV.js";import{t as T}from"./useCopyFeedback-os7N0yCx.js";var E=i(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),D=i(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),O=i(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),k=i(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),re=i(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ie=i(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),A=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},w=typeof document==`object`&&document.all,ne={all:w,IS_HTMLDDA:w===void 0&&w!==void 0},T=ne,E=T.all,D=T.IS_HTMLDDA?function(e){return typeof e==`function`||e===E}:function(e){return typeof e==`function`},O={},k=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),re=c,ie=Function.prototype.call,A=re?ie.bind(ie):function(){return ie.apply(ie,arguments)},ae={},oe={}.propertyIsEnumerable,se=Object.getOwnPropertyDescriptor;ae.f=se&&!oe.call({1:2},1)?function(e){var t=se(this,e);return!!t&&t.enumerable}:oe;var ce=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},j=v,le=s,ue=S,de=Object,fe=j(``.split),pe=le(function(){return!de(`z`).propertyIsEnumerable(0)})?function(e){return ue(e)===`String`?fe(e,``):de(e)}:de,me=function(e){return e==null},he=me,ge=TypeError,_e=function(e){if(he(e))throw new ge(`Can't call method on `+e);return e},ve=pe,ye=_e,be=function(e){return ve(ye(e))},xe=D,Se=ne,M=Se.all,N=Se.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:xe(e)||e===M}:function(e){return typeof e==`object`?e!==null:xe(e)},Ce={},we=Ce,Te=o,Ee=D,P=function(e){return Ee(e)?e:void 0},F=function(e,t){return arguments.length<2?P(we[e])||P(Te[e]):we[e]&&we[e][t]||Te[e]&&Te[e][t]},De=v({}.isPrototypeOf),Oe=typeof navigator<`u`&&String(navigator.userAgent)||``,ke=o,Ae=Oe,je=ke.process,Me=ke.Deno,Ne=je&&je.versions||Me&&Me.version,Pe=Ne&&Ne.v8,Fe,Ie;Pe&&(Fe=Pe.split(`.`),Ie=Fe[0]>0&&Fe[0]<4?1:+(Fe[0]+Fe[1])),!Ie&&Ae&&(Fe=Ae.match(/Edge\/(\d+)/),(!Fe||Fe[1]>=74)&&(Fe=Ae.match(/Chrome\/(\d+)/),Fe&&(Ie=+Fe[1])));var Le=Ie,Re=Le,ze=s,Be=o.String,Ve=!!Object.getOwnPropertySymbols&&!ze(function(){var e=Symbol(`symbol detection`);return!Be(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Re&&Re<41}),He=Ve&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,Ue=F,We=D,Ge=De,Ke=He,qe=Object,Je=Ke?function(e){return typeof e==`symbol`}:function(e){var t=Ue(`Symbol`);return We(t)&&Ge(t.prototype,qe(e))},Ye=String,Xe=function(e){try{return Ye(e)}catch{return`Object`}},Ze=D,Qe=Xe,$e=TypeError,et=function(e){if(Ze(e))return e;throw new $e(Qe(e)+` is not a function`)},tt=et,nt=me,rt=function(e,t){var n=e[t];return nt(n)?void 0:tt(n)},it=A,at=D,ot=N,st=TypeError,I=function(e,t){var n,r;if(t===`string`&&at(n=e.toString)&&!ot(r=it(n,e))||at(n=e.valueOf)&&!ot(r=it(n,e))||t!==`string`&&at(n=e.toString)&&!ot(r=it(n,e)))return r;throw new st(`Can't convert object to primitive value`)},ct={exports:{}},lt=!0,ut=o,dt=Object.defineProperty,ft=function(e,t){try{dt(ut,e,{value:t,configurable:!0,writable:!0})}catch{ut[e]=t}return t},pt=o,mt=ft,ht=`__core-js_shared__`,gt=pt[ht]||mt(ht,{}),_t=gt;(ct.exports=function(e,t){return _t[e]||(_t[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var vt=ct.exports,yt=_e,bt=Object,xt=function(e){return bt(yt(e))},St=v,Ct=xt,wt=St({}.hasOwnProperty),Tt=Object.hasOwn||function(e,t){return wt(Ct(e),t)},Et=v,Dt=0,Ot=Math.random(),kt=Et(1 .toString),At=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+kt(++Dt+Ot,36)},jt=o,Mt=vt,Nt=Tt,Pt=At,Ft=Ve,It=He,Lt=jt.Symbol,Rt=Mt(`wks`),zt=It?Lt.for||Lt:Lt&&Lt.withoutSetter||Pt,Bt=function(e){return Nt(Rt,e)||(Rt[e]=Ft&&Nt(Lt,e)?Lt[e]:zt(`Symbol.`+e)),Rt[e]},Vt=A,Ht=N,Ut=Je,Wt=rt,Gt=I,Kt=Bt,qt=TypeError,Jt=Kt(`toPrimitive`),Yt=function(e,t){if(!Ht(e)||Ut(e))return e;var n=Wt(e,Jt),r;if(n){if(t===void 0&&(t=`default`),r=Vt(n,e,t),!Ht(r)||Ut(r))return r;throw new qt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Gt(e,t)},Xt=Je,Zt=function(e){var t=Yt(e,`string`);return Xt(t)?t:t+``},Qt=o,$t=N,en=Qt.document,tn=$t(en)&&$t(en.createElement),nn=function(e){return tn?en.createElement(e):{}},rn=k,an=s,on=nn,sn=!rn&&!an(function(){return Object.defineProperty(on(`div`),`a`,{get:function(){return 7}}).a!==7}),cn=k,ln=A,un=ae,dn=ce,fn=be,pn=Zt,mn=Tt,hn=sn,gn=Object.getOwnPropertyDescriptor;O.f=cn?gn:function(e,t){if(e=fn(e),t=pn(t),hn)try{return gn(e,t)}catch{}if(mn(e,t))return dn(!ln(un.f,e,t),e[t])};var _n=s,vn=D,yn=/#|\.prototype\./,bn=function(e,t){var n=Sn[xn(e)];return n===wn?!0:n===Cn?!1:vn(t)?_n(t):!!t},xn=bn.normalize=function(e){return String(e).replace(yn,`.`).toLowerCase()},Sn=bn.data={},Cn=bn.NATIVE=`N`,wn=bn.POLYFILL=`P`,Tn=bn,En=te,Dn=et,On=c,kn=En(En.bind),An=function(e,t){return Dn(e),t===void 0?e:On?kn(e,t):function(){return e.apply(t,arguments)}},jn={},Mn=k&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Nn=N,Pn=String,Fn=TypeError,In=function(e){if(Nn(e))return e;throw new Fn(Pn(e)+` is not an object`)},Ln=k,Rn=sn,zn=Mn,Bn=In,Vn=Zt,Hn=TypeError,Un=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,Gn=`enumerable`,L=`configurable`,R=`writable`;jn.f=Ln?zn?function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&R in n&&!n[R]){var r=Wn(e,t);r&&r[R]&&(e[t]=n.value,n={configurable:L in n?n[L]:r[L],enumerable:Gn in n?n[Gn]:r[Gn],writable:!1})}return Un(e,t,n)}:Un:function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),Rn)try{return Un(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Hn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Kn=k,qn=jn,Jn=ce,Yn=Kn?function(e,t,n){return qn.f(e,t,Jn(1,n))}:function(e,t,n){return e[t]=n,e},Xn=o,Zn=p,Qn=te,$n=D,er=O.f,tr=Tn,nr=Ce,rr=An,ir=Yn,ar=Tt,or=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Zn(e,this,arguments)};return t.prototype=e.prototype,t},z=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Xn:i?Xn[n]:(Xn[n]||{}).prototype,s=r?nr:nr[n]||ir(nr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=tr(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ar(o,f),m=s[f],u&&(e.dontCallGetSet?(_=er(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?rr(p,Xn):e.wrap&&u?or(p):a&&$n(p)?Qn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&ir(g,`sham`,!0),ir(s,f,g),a&&(d=n+`Prototype`,ar(nr,d)||ir(nr,d,{}),ir(nr[d],f,p),e.real&&c&&(l||!c[f])&&ir(c,f,p)))},sr=z,cr=k,lr=jn.f;sr({target:`Object`,stat:!0,forced:Object.defineProperty!==lr,sham:!cr},{defineProperty:lr});var ur=Ce.Object,dr=i.exports=function(e,t,n){return ur.defineProperty(e,t,n)};ur.defineProperty.sham&&(dr.sham=!0);var fr=i.exports,pr=fr,mr=r(pr),hr=S,gr=Array.isArray||function(e){return hr(e)===`Array`},_r=Math.ceil,vr=Math.floor,yr=Math.trunc||function(e){var t=+e;return(t>0?vr:_r)(t)},br=function(e){var t=+e;return t!==t||t===0?0:yr(t)},xr=br,Sr=Math.min,Cr=function(e){return e>0?Sr(xr(e),9007199254740991):0},wr=function(e){return Cr(e.length)},Tr=TypeError,Er=9007199254740991,Dr=function(e){if(e>Er)throw Tr(`Maximum allowed index exceeded`);return e},Or=Zt,kr=jn,Ar=ce,jr=function(e,t,n){var r=Or(t);r in e?kr.f(e,r,Ar(0,n)):e[r]=n},Mr=Bt(`toStringTag`),Nr={};Nr[Mr]=`z`;var Pr=String(Nr)===`[object z]`,Fr=Pr,Ir=D,Lr=S,Rr=Bt(`toStringTag`),zr=Object,Br=Lr(function(){return arguments}())===`Arguments`,Vr=function(e,t){try{return e[t]}catch{}},Hr=Fr?Lr:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Vr(t=zr(e),Rr))==`string`?n:Br?Lr(t):(r=Lr(t))===`Object`&&Ir(t.callee)?`Arguments`:r},Ur=v,Wr=D,Gr=gt,Kr=Ur(Function.toString);Wr(Gr.inspectSource)||(Gr.inspectSource=function(e){return Kr(e)});var qr=Gr.inspectSource,Jr=v,Yr=s,Xr=D,Zr=Hr,Qr=F,B=qr,$r=function(){},ei=[],ti=Qr(`Reflect`,`construct`),ni=/^\s*(?:class|function)\b/,ri=Jr(ni.exec),ii=!ni.test($r),ai=function(e){if(!Xr(e))return!1;try{return ti($r,ei,e),!0}catch{return!1}},oi=function(e){if(!Xr(e))return!1;switch(Zr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ii||!!ri(ni,B(e))}catch{return!0}};oi.sham=!0;var si=!ti||Yr(function(){var e;return ai(ai.call)||!ai(Object)||!ai(function(){e=!0})||e})?oi:ai,ci=gr,li=si,ui=N,di=Bt(`species`),fi=Array,pi=function(e){var t;return ci(e)&&(t=e.constructor,li(t)&&(t===fi||ci(t.prototype))?t=void 0:ui(t)&&(t=t[di],t===null&&(t=void 0))),t===void 0?fi:t},mi=function(e,t){return new(pi(e))(t===0?0:t)},hi=s,gi=Bt,_i=Le,vi=gi(`species`),yi=function(e){return _i>=51||!hi(function(){var t=[],n=t.constructor={};return n[vi]=function(){return{foo:1}},t[e](Boolean).foo!==1})},bi=z,xi=s,Si=gr,Ci=N,wi=xt,Ti=wr,Ei=Dr,Di=jr,Oi=mi,ki=yi,Ai=Bt,ji=Le,Mi=Ai(`isConcatSpreadable`),Ni=ji>=51||!xi(function(){var e=[];return e[Mi]=!1,e.concat()[0]!==e}),Pi=function(e){if(!Ci(e))return!1;var t=e[Mi];return t===void 0?Si(e):!!t};bi({target:`Array`,proto:!0,arity:1,forced:!Ni||!ki(`concat`)},{concat:function(e){var t=wi(this),n=Oi(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Pi(c))for(s=Ti(c),Ei(r+s),a=0;a<s;a++,r++)a in c&&Di(n,r,c[a]);else Ei(r+1),Di(n,r++,c);return n.length=r,n}});var Fi=Hr,Ii=String,Li=function(e){if(Fi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Ii(e)},Ri={},zi=br,Bi=Math.max,Vi=Math.min,Hi=function(e,t){var n=zi(e);return n<0?Bi(n+t,0):Vi(n,t)},Ui=be,Wi=Hi,Gi=wr,Ki=function(e){return function(t,n,r){var i=Ui(t),a=Gi(i),o=Wi(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},qi={includes:Ki(!0),indexOf:Ki(!1)},Ji={},Yi=v,Xi=Tt,Zi=be,Qi=qi.indexOf,$i=Ji,ea=Yi([].push),ta=function(e,t){var n=Zi(e),r=0,i=[],a;for(a in n)!Xi($i,a)&&Xi(n,a)&&ea(i,a);for(;t.length>r;)Xi(n,a=t[r++])&&(~Qi(i,a)||ea(i,a));return i},na=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],ra=ta,ia=na,aa=Object.keys||function(e){return ra(e,ia)},oa=k,sa=Mn,ca=jn,la=In,ua=be,da=aa;Ri.f=oa&&!sa?Object.defineProperties:function(e,t){la(e);for(var n=ua(t),r=da(t),i=r.length,a=0,o;i>a;)ca.f(e,o=r[a++],n[o]);return e};var fa=F(`document`,`documentElement`),pa=vt,ma=At,ha=pa(`keys`),ga=function(e){return ha[e]||(ha[e]=ma(e))},_a=In,va=Ri,ya=na,ba=Ji,xa=fa,Sa=nn,Ca=ga,wa=`>`,Ta=`<`,Ea=`prototype`,Da=`script`,Oa=Ca(`IE_PROTO`),ka=function(){},Aa=function(e){return Ta+Da+wa+e+Ta+`/`+Da+wa},ja=function(e){e.write(Aa(``)),e.close();var t=e.parentWindow.Object;return e=null,t},Ma=function(){var e=Sa(`iframe`),t=`java`+Da+`:`,n;return e.style.display=`none`,xa.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(Aa(`document.F=Object`)),n.close(),n.F},Na,Pa=function(){try{Na=new ActiveXObject(`htmlfile`)}catch{}Pa=typeof document<`u`?document.domain&&Na?ja(Na):Ma():ja(Na);for(var e=ya.length;e--;)delete Pa[Ea][ya[e]];return Pa()};ba[Oa]=!0;var Fa=Object.create||function(e,t){var n;return e===null?n=Pa():(ka[Ea]=_a(e),n=new ka,ka[Ea]=null,n[Oa]=e),t===void 0?n:va.f(n,t)},Ia={},La=ta,Ra=na.concat(`length`,`prototype`);Ia.f=Object.getOwnPropertyNames||function(e){return La(e,Ra)};var za={},Ba=Hi,Va=wr,Ha=jr,Ua=Array,Wa=Math.max,Ga=function(e,t,n){for(var r=Va(e),i=Ba(t,r),a=Ba(n===void 0?r:n,r),o=Ua(Wa(a-i,0)),s=0;i<a;i++,s++)Ha(o,s,e[i]);return o.length=s,o},Ka=S,qa=be,Ja=Ia.f,Ya=Ga,Xa=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Za=function(e){try{return Ja(e)}catch{return Ya(Xa)}};za.f=function(e){return Xa&&Ka(e)===`Window`?Za(e):Ja(qa(e))};var Qa={};Qa.f=Object.getOwnPropertySymbols;var $a=Yn,eo=function(e,t,n,r){return r&&r.enumerable?e[t]=n:$a(e,t,n),e},to=jn,no=function(e,t,n){return to.f(e,t,n)},ro={};ro.f=Bt;var io=Ce,ao=Tt,oo=ro,so=jn.f,co=function(e){var t=io.Symbol||={};ao(t,e)||so(t,e,{value:oo.f(e)})},lo=A,uo=F,fo=Bt,po=eo,mo=function(){var e=uo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=fo(`toPrimitive`);t&&!t[r]&&po(t,r,function(e){return lo(n,this)},{arity:1})},ho=Pr,go=Hr,_o=ho?{}.toString:function(){return`[object `+go(this)+`]`},vo=Pr,yo=jn.f,bo=Yn,xo=Tt,So=_o,Co=Bt(`toStringTag`),wo=function(e,t,n,r){if(e){var i=n?e:e.prototype;xo(i,Co)||yo(i,Co,{configurable:!0,value:t}),r&&!vo&&bo(i,`toString`,So)}},To=o,Eo=D,Do=To.WeakMap,Oo=Eo(Do)&&/native code/.test(String(Do)),ko=o,Ao=N,jo=Yn,Mo=Tt,No=gt,Po=ga,Fo=Ji,Io=`Object already initialized`,Lo=ko.TypeError,Ro=ko.WeakMap,zo,Bo,Vo,Ho=function(e){return Vo(e)?Bo(e):zo(e,{})},Uo=function(e){return function(t){var n;if(!Ao(t)||(n=Bo(t)).type!==e)throw new Lo(`Incompatible receiver, `+e+` required`);return n}};if(Oo||No.state){var Wo=No.state||=new Ro;Wo.get=Wo.get,Wo.has=Wo.has,Wo.set=Wo.set,zo=function(e,t){if(Wo.has(e))throw new Lo(Io);return t.facade=e,Wo.set(e,t),t},Bo=function(e){return Wo.get(e)||{}},Vo=function(e){return Wo.has(e)}}else{var Go=Po(`state`);Fo[Go]=!0,zo=function(e,t){if(Mo(e,Go))throw new Lo(Io);return t.facade=e,jo(e,Go,t),t},Bo=function(e){return Mo(e,Go)?e[Go]:{}},Vo=function(e){return Mo(e,Go)}}var Ko={set:zo,get:Bo,has:Vo,enforce:Ho,getterFor:Uo},qo=An,Jo=v,Yo=pe,Xo=xt,Zo=wr,Qo=mi,$o=Jo([].push),es=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Xo(c),p=Yo(f),m=qo(l,u),h=Zo(p),g=0,_=d||Qo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:$o(v,y)}else switch(e){case 4:return!1;case 7:$o(v,y)}return a?-1:r||i?i:v}},ts={forEach:es(0),map:es(1),filter:es(2),some:es(3),every:es(4),find:es(5),findIndex:es(6),filterReject:es(7)},ns=z,rs=o,is=A,as=v,os=k,ss=Ve,cs=s,ls=Tt,us=De,ds=In,fs=be,ps=Zt,ms=Li,hs=ce,gs=Fa,_s=aa,vs=Ia,ys=za,bs=Qa,xs=O,Ss=jn,Cs=Ri,ws=ae,Ts=eo,Es=no,Ds=vt,Os=ga,ks=Ji,As=At,js=Bt,Ms=ro,Ns=co,Ps=mo,Fs=wo,Is=Ko,Ls=ts.forEach,Rs=Os(`hidden`),zs=`Symbol`,Bs=`prototype`,Vs=Is.set,Hs=Is.getterFor(zs),Us=Object[Bs],Ws=rs.Symbol,Gs=Ws&&Ws[Bs],Ks=rs.RangeError,qs=rs.TypeError,Js=rs.QObject,Ys=xs.f,Xs=Ss.f,Zs=ys.f,Qs=ws.f,$s=as([].push),ec=Ds(`symbols`),tc=Ds(`op-symbols`),nc=Ds(`wks`),rc=!Js||!Js[Bs]||!Js[Bs].findChild,ic=function(e,t,n){var r=Ys(Us,t);r&&delete Us[t],Xs(e,t,n),r&&e!==Us&&Xs(Us,t,r)},ac=os&&cs(function(){return gs(Xs({},`a`,{get:function(){return Xs(this,`a`,{value:7}).a}})).a!==7})?ic:Xs,oc=function(e,t){var n=ec[e]=gs(Gs);return Vs(n,{type:zs,tag:e,description:t}),os||(n.description=t),n},sc=function(e,t,n){e===Us&&sc(tc,t,n),ds(e);var r=ps(t);return ds(n),ls(ec,r)?(n.enumerable?(ls(e,Rs)&&e[Rs][r]&&(e[Rs][r]=!1),n=gs(n,{enumerable:hs(0,!1)})):(ls(e,Rs)||Xs(e,Rs,hs(1,{})),e[Rs][r]=!0),ac(e,r,n)):Xs(e,r,n)},cc=function(e,t){ds(e);var n=fs(t);return Ls(_s(n).concat(pc(n)),function(t){(!os||is(uc,n,t))&&sc(e,t,n[t])}),e},lc=function(e,t){return t===void 0?gs(e):cc(gs(e),t)},uc=function(e){var t=ps(e),n=is(Qs,this,t);return this===Us&&ls(ec,t)&&!ls(tc,t)?!1:n||!ls(this,t)||!ls(ec,t)||ls(this,Rs)&&this[Rs][t]?n:!0},dc=function(e,t){var n=fs(e),r=ps(t);if(!(n===Us&&ls(ec,r)&&!ls(tc,r))){var i=Ys(n,r);return i&&ls(ec,r)&&!(ls(n,Rs)&&n[Rs][r])&&(i.enumerable=!0),i}},fc=function(e){var t=Zs(fs(e)),n=[];return Ls(t,function(e){!ls(ec,e)&&!ls(ks,e)&&$s(n,e)}),n},pc=function(e){var t=e===Us,n=Zs(t?tc:fs(e)),r=[];return Ls(n,function(e){ls(ec,e)&&(!t||ls(Us,e))&&$s(r,ec[e])}),r};ss||(Ws=function(){if(us(Gs,this))throw new qs(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ms(arguments[0]),t=As(e),n=function(e){var r=this===void 0?rs:this;r===Us&&is(n,tc,e),ls(r,Rs)&&ls(r[Rs],t)&&(r[Rs][t]=!1);var i=hs(1,e);try{ac(r,t,i)}catch(e){if(!(e instanceof Ks))throw e;ic(r,t,i)}};return os&&rc&&ac(Us,t,{configurable:!0,set:n}),oc(t,e)},Gs=Ws[Bs],Ts(Gs,`toString`,function(){return Hs(this).tag}),Ts(Ws,`withoutSetter`,function(e){return oc(As(e),e)}),ws.f=uc,Ss.f=sc,Cs.f=cc,xs.f=dc,vs.f=ys.f=fc,bs.f=pc,Ms.f=function(e){return oc(js(e),e)},os&&Es(Gs,`description`,{configurable:!0,get:function(){return Hs(this).description}})),ns({global:!0,constructor:!0,wrap:!0,forced:!ss,sham:!ss},{Symbol:Ws}),Ls(_s(nc),function(e){Ns(e)}),ns({target:zs,stat:!0,forced:!ss},{useSetter:function(){rc=!0},useSimple:function(){rc=!1}}),ns({target:`Object`,stat:!0,forced:!ss,sham:!os},{create:lc,defineProperty:sc,defineProperties:cc,getOwnPropertyDescriptor:dc}),ns({target:`Object`,stat:!0,forced:!ss},{getOwnPropertyNames:fc}),Ps(),Fs(Ws,zs),ks[Rs]=!0;var mc=Ve&&!!Symbol.for&&!!Symbol.keyFor,hc=z,gc=F,_c=Tt,vc=Li,yc=vt,bc=mc,xc=yc(`string-to-symbol-registry`),V=yc(`symbol-to-string-registry`);hc({target:`Symbol`,stat:!0,forced:!bc},{for:function(e){var t=vc(e);if(_c(xc,t))return xc[t];var n=gc(`Symbol`)(t);return xc[t]=n,V[n]=t,n}});var Sc=z,Cc=Tt,wc=Je,Tc=Xe,Ec=vt,Dc=mc,Oc=Ec(`symbol-to-string-registry`);Sc({target:`Symbol`,stat:!0,forced:!Dc},{keyFor:function(e){if(!wc(e))throw TypeError(Tc(e)+` is not a symbol`);if(Cc(Oc,e))return Oc[e]}});var kc=v([].slice),Ac=v,jc=gr,Mc=D,Nc=S,Pc=Li,Fc=Ac([].push),Ic=function(e){if(Mc(e))return e;if(jc(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Fc(n,i):(typeof i==`number`||Nc(i)===`Number`||Nc(i)===`String`)&&Fc(n,Pc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(jc(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Lc=z,Rc=F,zc=p,Bc=A,Vc=v,Hc=s,Uc=D,Wc=Je,Gc=kc,Kc=Ic,qc=Ve,Jc=String,Yc=Rc(`JSON`,`stringify`),Xc=Vc(/./.exec),Zc=Vc(``.charAt),Qc=Vc(``.charCodeAt),$c=Vc(``.replace),el=Vc(1 .toString),tl=/[\uD800-\uDFFF]/g,nl=/^[\uD800-\uDBFF]$/,rl=/^[\uDC00-\uDFFF]$/,il=!qc||Hc(function(){var e=Rc(`Symbol`)(`stringify detection`);return Yc([e])!==`[null]`||Yc({a:e})!==`{}`||Yc(Object(e))!==`{}`}),al=Hc(function(){return Yc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Yc(`\udead`)!==`"\\udead"`}),ol=function(e,t){var n=Gc(arguments),r=Kc(t);if(!(!Uc(r)&&(e===void 0||Wc(e))))return n[1]=function(e,t){if(Uc(r)&&(t=Bc(r,this,Jc(e),t)),!Wc(t))return t},zc(Yc,null,n)},sl=function(e,t,n){var r=Zc(n,t-1),i=Zc(n,t+1);return Xc(nl,e)&&!Xc(rl,i)||Xc(rl,e)&&!Xc(nl,r)?`\\u`+el(Qc(e,0),16):e};Yc&&Lc({target:`JSON`,stat:!0,arity:3,forced:il||al},{stringify:function(e,t,n){var r=Gc(arguments),i=zc(il?ol:Yc,null,r);return al&&typeof i==`string`?$c(i,tl,sl):i}});var cl=z,ll=Ve,ul=s,dl=Qa,fl=xt;cl({target:`Object`,stat:!0,forced:!ll||ul(function(){dl.f(1)})},{getOwnPropertySymbols:function(e){var t=dl.f;return t?t(fl(e)):[]}}),co(`asyncIterator`),co(`hasInstance`),co(`isConcatSpreadable`),co(`iterator`),co(`match`),co(`matchAll`),co(`replace`),co(`search`),co(`species`),co(`split`);var pl=co,ml=mo;pl(`toPrimitive`),ml();var hl=F,gl=co,_l=wo;gl(`toStringTag`),_l(hl(`Symbol`),`Symbol`),co(`unscopables`),wo(o.JSON,`JSON`,!0);var vl=Ce.Symbol,yl={},bl=k,xl=Tt,Sl=Function.prototype,Cl=bl&&Object.getOwnPropertyDescriptor,wl=xl(Sl,`name`),Tl={EXISTS:wl,PROPER:wl&&(function(){}).name===`something`,CONFIGURABLE:wl&&(!bl||bl&&Cl(Sl,`name`).configurable)},El=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Dl=Tt,Ol=D,kl=xt,Al=ga,jl=El,Ml=Al(`IE_PROTO`),Nl=Object,Pl=Nl.prototype,Fl=jl?Nl.getPrototypeOf:function(e){var t=kl(e);if(Dl(t,Ml))return t[Ml];var n=t.constructor;return Ol(n)&&t instanceof n?n.prototype:t instanceof Nl?Pl:null},Il=s,Ll=D,Rl=N,zl=Fa,Bl=Fl,Vl=eo,Hl=Bt(`iterator`),Ul=!1,Wl,Gl,Kl;[].keys&&(Kl=[].keys(),`next`in Kl?(Gl=Bl(Bl(Kl)),Gl!==Object.prototype&&(Wl=Gl)):Ul=!0),Wl=!Rl(Wl)||Il(function(){var e={};return Wl[Hl].call(e)!==e})?{}:zl(Wl),Ll(Wl[Hl])||Vl(Wl,Hl,function(){return this});var ql={IteratorPrototype:Wl,BUGGY_SAFARI_ITERATORS:Ul},Jl=ql.IteratorPrototype,Yl=Fa,Xl=ce,Zl=wo,Ql=yl,$l=function(){return this},eu=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Yl(Jl,{next:Xl(+!r,n)}),Zl(e,i,!1,!0),Ql[i]=$l,e},tu=v,nu=et,ru=function(e,t,n){try{return tu(nu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},iu=D,au=String,ou=TypeError,su=function(e){if(typeof e==`object`||iu(e))return e;throw new ou(`Can't set `+au(e)+` as a prototype`)},cu=ru,lu=In,uu=su,du=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=cu(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return lu(t),uu(r),e?n(t,r):t.__proto__=r,t}}():void 0),fu=z,pu=A,mu=Tl,hu=eu,gu=Fl,_u=wo,vu=eo,yu=Bt,bu=yl,xu=ql,Su=mu.PROPER;mu.CONFIGURABLE,xu.IteratorPrototype;var Cu=xu.BUGGY_SAFARI_ITERATORS,wu=yu(`iterator`),Tu=`keys`,Eu=`values`,Du=`entries`,Ou=function(){return this},ku=function(e,t,n,r,i,a,o){hu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Cu&&e&&e in u)return u[e];switch(e){case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)};case Du:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[wu]||u[`@@iterator`]||i&&u[i],f=!Cu&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=gu(p.call(new e)),m!==Object.prototype&&m.next&&(_u(m,c,!0,!0),bu[c]=Ou)),Su&&i===Eu&&d&&d.name!==Eu&&(l=!0,f=function(){return pu(d,this)}),i)if(h={values:s(Eu),keys:a?f:s(Tu),entries:s(Du)},o)for(g in h)(Cu||l||!(g in u))&&vu(u,g,h[g]);else fu({target:t,proto:!0,forced:Cu||l},h);return o&&u[wu]!==f&&vu(u,wu,f,{name:i}),bu[t]=f,h},Au=function(e,t){return{value:e,done:t}},ju=be,Mu=yl,Nu=Ko;jn.f;var Pu=ku,Fu=Au,Iu=`Array Iterator`,Lu=Nu.set,Ru=Nu.getterFor(Iu);Pu(Array,`Array`,function(e,t){Lu(this,{type:Iu,target:ju(e),index:0,kind:t})},function(){var e=Ru(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Fu(void 0,!0);switch(e.kind){case`keys`:return Fu(n,!1);case`values`:return Fu(t[n],!1)}return Fu([n,t[n]],!1)},`values`),Mu.Arguments=Mu.Array;var zu={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Bu=o,Vu=Hr,Hu=Yn,Uu=yl,Wu=Bt(`toStringTag`);for(var Gu in zu){var Ku=Bu[Gu],qu=Ku&&Ku.prototype;qu&&Vu(qu)!==Wu&&Hu(qu,Wu,Gu),Uu[Gu]=Uu.Array}var Ju=vl,Yu=Bt,Xu=jn.f,Zu=Yu(`metadata`),Qu=Function.prototype;Qu[Zu]===void 0&&Xu(Qu,Zu,{value:null}),co(`asyncDispose`),co(`dispose`),co(`metadata`);var $u=Ju,ed=F,td=v,nd=ed(`Symbol`),rd=nd.keyFor,id=td(nd.prototype.valueOf),ad=nd.isRegisteredSymbol||function(e){try{return rd(id(e))!==void 0}catch{return!1}};z({target:`Symbol`,stat:!0},{isRegisteredSymbol:ad});for(var od=vt,sd=F,cd=v,ld=Je,ud=Bt,dd=sd(`Symbol`),fd=dd.isWellKnownSymbol,pd=sd(`Object`,`getOwnPropertyNames`),md=cd(dd.prototype.valueOf),hd=od(`wks`),gd=0,_d=pd(dd),vd=_d.length;gd<vd;gd++)try{var yd=_d[gd];ld(dd[yd])&&ud(yd)}catch{}var bd=function(e){if(fd&&fd(e))return!0;try{for(var t=md(e),n=0,r=pd(hd),i=r.length;n<i;n++)if(hd[r[n]]==t)return!0}catch{}return!1};z({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:bd}),co(`matcher`),co(`observable`),z({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:ad}),z({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:bd}),co(`metadataKey`),co(`patternMatch`),co(`replaceAll`);var xd=$u,Sd=r(xd),Cd=v,wd=br,Td=Li,Ed=_e,Dd=Cd(``.charAt),Od=Cd(``.charCodeAt),kd=Cd(``.slice),Ad=function(e){return function(t,n){var r=Td(Ed(t)),i=wd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Od(r,i),o<55296||o>56319||i+1===a||(s=Od(r,i+1))<56320||s>57343?e?Dd(r,i):o:e?kd(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},jd={codeAt:Ad(!1),charAt:Ad(!0)}.charAt,Md=Li,Nd=Ko,Pd=ku,Fd=Au,Id=`String Iterator`,Ld=Nd.set,Rd=Nd.getterFor(Id);Pd(String,`String`,function(e){Ld(this,{type:Id,string:Md(e),index:0})},function(){var e=Rd(this),t=e.string,n=e.index,r;return n>=t.length?Fd(void 0,!0):(r=jd(t,n),e.index+=r.length,Fd(r,!1))});var zd=ro.f(`iterator`),Bd=zd,Vd=r(Bd);function Hd(e){"@babel/helpers - typeof";return Hd=typeof Sd==`function`&&typeof Vd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Sd==`function`&&e.constructor===Sd&&e!==Sd.prototype?`symbol`:typeof e},Hd(e)}var Ud=r(ro.f(`toPrimitive`));function Wd(e,t){if(Hd(e)!==`object`||e===null)return e;var n=e[Ud];if(n!==void 0){var r=n.call(e,t||`default`);if(Hd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Gd(e){var t=Wd(e,`string`);return Hd(t)===`symbol`?t:String(t)}function Kd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),mr(e,Gd(r.key),r)}}function qd(e,t,n){return t&&Kd(e.prototype,t),n&&Kd(e,n),mr(e,`prototype`,{writable:!1}),e}function Jd(e,t,n){return t=Gd(t),t in e?mr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yd=v,Xd=et,Zd=N,Qd=Tt,$d=kc,ef=c,tf=Function,nf=Yd([].concat),rf=Yd([].join),af={},of=function(e,t,n){if(!Qd(af,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;af[t]=tf(`C,a`,`return new C(`+rf(r,`,`)+`)`)}return af[t](e,n)},sf=ef?tf.bind:function(e){var t=Xd(this),n=t.prototype,r=$d(arguments,1),i=function(){var n=nf(r,$d(arguments));return this instanceof i?of(t,n.length,n):t.apply(e,n)};return Zd(n)&&(i.prototype=n),i},cf=z,lf=sf;cf({target:`Function`,proto:!0,forced:Function.bind!==lf},{bind:lf});var uf=o,df=Ce,ff=function(e,t){var n=df[e+`Prototype`],r=n&&n[t];if(r)return r;var i=uf[e],a=i&&i.prototype;return a&&a[t]},pf=ff(`Function`,`bind`),mf=De,hf=pf,gf=Function.prototype,_f=function(e){var t=e.bind;return e===gf||mf(gf,e)&&t===gf.bind?hf:t},vf=r(_f),yf=et,bf=xt,xf=pe,Sf=wr,Cf=TypeError,wf=function(e){return function(t,n,r,i){yf(n);var a=bf(t),o=xf(a),s=Sf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Cf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},Tf={left:wf(!1),right:wf(!0)},H=s,Ef=function(e,t){var n=[][e];return!!n&&H(function(){n.call(null,t||function(){return 1},1)})},Df=S(o.process)===`process`,Of=z,kf=Tf.left,Af=Ef,jf=Le;Of({target:`Array`,proto:!0,forced:!Df&&jf>79&&jf<83||!Af(`reduce`)},{reduce:function(e){var t=arguments.length;return kf(this,e,t,t>1?arguments[1]:void 0)}});var Mf=ff(`Array`,`reduce`),Nf=De,Pf=Mf,Ff=Array.prototype,If=r(function(e){var t=e.reduce;return e===Ff||Nf(Ff,e)&&t===Ff.reduce?Pf:t}),Lf=z,Rf=ts.filter;Lf({target:`Array`,proto:!0,forced:!yi(`filter`)},{filter:function(e){return Rf(this,e,arguments.length>1?arguments[1]:void 0)}});var zf=ff(`Array`,`filter`),Bf=De,Vf=zf,Hf=Array.prototype,Uf=r(function(e){var t=e.filter;return e===Hf||Bf(Hf,e)&&t===Hf.filter?Vf:t}),Wf=z,Gf=ts.map;Wf({target:`Array`,proto:!0,forced:!yi(`map`)},{map:function(e){return Gf(this,e,arguments.length>1?arguments[1]:void 0)}});var Kf=ff(`Array`,`map`),qf=De,Jf=Kf,Yf=Array.prototype,Xf=r(function(e){var t=e.map;return e===Yf||qf(Yf,e)&&t===Yf.map?Jf:t}),Zf=gr,Qf=wr,$f=Dr,ep=An,tp=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?ep(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Zf(d)?(f=Qf(d),c=tp(e,t,d,f,c,a-1)-1):($f(c+1),e[c]=d),c++),l++;return c},np=tp,rp=z,ip=np,ap=et,op=xt,sp=wr,cp=mi;rp({target:`Array`,proto:!0},{flatMap:function(e){var t=op(this),n=sp(t),r;return ap(e),r=cp(t,0),r.length=ip(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var lp=ff(`Array`,`flatMap`),up=De,dp=lp,fp=Array.prototype,pp=r(function(e){var t=e.flatMap;return e===fp||up(fp,e)&&t===fp.flatMap?dp:t});function mp(e){return new gp(e)}var hp=function(){function e(n,r,i){var a,o,s;t(this,e),Jd(this,`_listeners`,{add:vf(a=this._add).call(a,this),remove:vf(o=this._remove).call(o,this),update:vf(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return qd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return If(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),gp=function(){function e(n){t(this,e),Jd(this,`_transformers`,[]),this._source=n}return qd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Uf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Xf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return pp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new hp(this._source,this._transformers,e)}}]),e}(),_p=A,vp=In,yp=rt,bp=function(e,t,n){var r,i;vp(e);try{if(r=yp(e,`return`),!r){if(t===`throw`)throw n;return n}r=_p(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return vp(r),n},xp=In,Sp=bp,Cp=function(e,t,n,r){try{return r?t(xp(n)[0],n[1]):t(n)}catch(t){Sp(e,`throw`,t)}},wp=Bt,Tp=yl,Ep=wp(`iterator`),Dp=Array.prototype,Op=function(e){return e!==void 0&&(Tp.Array===e||Dp[Ep]===e)},kp=Hr,Ap=rt,jp=me,Mp=yl,Np=Bt(`iterator`),Pp=function(e){if(!jp(e))return Ap(e,Np)||Ap(e,`@@iterator`)||Mp[kp(e)]},Fp=A,Ip=et,Lp=In,Rp=Xe,zp=Pp,Bp=TypeError,Vp=function(e,t){var n=arguments.length<2?zp(e):t;if(Ip(n))return Lp(Fp(n,e));throw new Bp(Rp(e)+` is not iterable`)},Hp=An,Up=A,Wp=xt,Gp=Cp,Kp=Op,qp=si,Jp=wr,Yp=jr,Xp=Vp,Zp=Pp,Qp=Array,$p=function(e){var t=Wp(e),n=qp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Hp(i,r>2?arguments[2]:void 0));var o=Zp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Qp&&Kp(o)))for(d=Xp(t,o),f=d.next,l=n?new this:[];!(u=Up(f,d)).done;s++)p=a?Gp(d,i,[u.value,s],!0):u.value,Yp(l,s,p);else for(c=Jp(t),l=n?new this(c):Qp(c);c>s;s++)p=a?i(t[s],s):t[s],Yp(l,s,p);return l.length=s,l},em=Bt(`iterator`),tm=!1;try{var nm=0,rm={next:function(){return{done:!!nm++}},return:function(){tm=!0}};rm[em]=function(){return this},Array.from(rm,function(){throw 2})}catch{}var im=function(e,t){try{if(!t&&!tm)return!1}catch{return!1}var n=!1;try{var r={};r[em]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},am=z,om=$p;am({target:`Array`,stat:!0,forced:!im(function(e){Array.from(e)})},{from:om});var sm=Ce.Array.from,cm=r(sm),lm=Pp,um=r(lm),dm=r(lm);z({target:`Array`,stat:!0},{isArray:gr});var fm=Ce.Array.isArray,pm=r(fm);function mm(e){if(pm(e))return e}var hm=k,gm=gr,_m=TypeError,vm=Object.getOwnPropertyDescriptor,ym=hm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(gm(e)&&!vm(e,`length`).writable)throw new _m(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},bm=z,xm=xt,Sm=wr,Cm=ym,wm=Dr;bm({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=xm(this),n=Sm(t),r=arguments.length;wm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Cm(t,n),n}});var Tm=ff(`Array`,`push`),Em=De,Dm=Tm,Om=Array.prototype,km=function(e){var t=e.push;return e===Om||Em(Om,e)&&t===Om.push?Dm:t},Am=r(km);function jm(e,t){var n=e==null?null:Sd!==void 0&&um(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(Am(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}var Mm=z,Nm=gr,Pm=si,Fm=N,Im=Hi,Lm=wr,Rm=be,zm=jr,Bm=Bt,Vm=yi,Hm=kc,Um=Vm(`slice`),Wm=Bm(`species`),Gm=Array,Km=Math.max;Mm({target:`Array`,proto:!0,forced:!Um},{slice:function(e,t){var n=Rm(this),r=Lm(n),i=Im(e,r),a=Im(t===void 0?r:t,r),o,s,c;if(Nm(n)&&(o=n.constructor,Pm(o)&&(o===Gm||Nm(o.prototype))?o=void 0:Fm(o)&&(o=o[Wm],o===null&&(o=void 0)),o===Gm||o===void 0))return Hm(n,i,a);for(s=new(o===void 0?Gm:o)(Km(a-i,0)),c=0;i<a;i++,c++)i in n&&zm(s,c,n[i]);return s.length=c,s}});var qm=ff(`Array`,`slice`),Jm=De,Ym=qm,Xm=Array.prototype,Zm=function(e){var t=e.slice;return e===Xm||Jm(Xm,e)&&t===Xm.slice?Ym:t},Qm=Zm,$m=r(Qm),eh=r(sm);function th(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nh(e,t){var n;if(e){if(typeof e==`string`)return th(e,t);var r=$m(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return eh(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return th(e,t)}}function rh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ih(e,t){return mm(e)||jm(e,t)||nh(e,t)||rh()}function ah(e){if(pm(e))return th(e)}function oh(e){if(Sd!==void 0&&um(e)!=null||e[`@@iterator`]!=null)return eh(e)}function sh(){throw TypeError(`Invalid attempt to spread non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ch(e){return ah(e)||oh(e)||nh(e)||sh()}var lh=r(Ju),uh=ff(`Array`,`concat`),dh=De,fh=uh,ph=Array.prototype,mh=r(function(e){var t=e.concat;return e===ph||dh(ph,e)&&t===ph.concat?fh:t}),hh=r(Zm),gh=F,_h=v,vh=Ia,yh=Qa,bh=In,xh=_h([].concat),Sh=gh(`Reflect`,`ownKeys`)||function(e){var t=vh.f(bh(e)),n=yh.f;return n?xh(t,n(e)):t};z({target:`Reflect`,stat:!0},{ownKeys:Sh});var Ch=Ce.Reflect.ownKeys,wh=r(Ch),Th=r(fm),Eh=z,Dh=xt,Oh=aa;Eh({target:`Object`,stat:!0,forced:s(function(){Oh(1)})},{keys:function(e){return Oh(Dh(e))}});var kh=Ce.Object.keys,Ah=r(kh),jh=ts.forEach,Mh=Ef(`forEach`)?[].forEach:function(e){return jh(this,e,arguments.length>1?arguments[1]:void 0)},Nh=z,Ph=Mh;Nh({target:`Array`,proto:!0,forced:[].forEach!==Ph},{forEach:Ph});var Fh=ff(`Array`,`forEach`),Ih=Hr,Lh=Tt,Rh=De,zh=Fh,Bh=Array.prototype,Vh={DOMTokenList:!0,NodeList:!0},Hh=function(e){var t=e.forEach;return e===Bh||Rh(Bh,e)&&t===Bh.forEach||Lh(Vh,Ih(e))?zh:t},Uh=r(Hh),Wh=z,Gh=v,Kh=gr,qh=Gh([].reverse),Jh=[1,2];Wh({target:`Array`,proto:!0,forced:String(Jh)===String(Jh.reverse())},{reverse:function(){return Kh(this)&&(this.length=this.length),qh(this)}});var Yh=ff(`Array`,`reverse`),Xh=De,Zh=Yh,Qh=Array.prototype,$h=function(e){var t=e.reverse;return e===Qh||Xh(Qh,e)&&t===Qh.reverse?Zh:t},eg=r($h),tg=Xe,ng=TypeError,rg=function(e,t){if(!delete e[t])throw new ng(`Cannot delete property `+tg(t)+` of `+tg(e))},ig=z,ag=xt,og=Hi,sg=br,cg=wr,lg=ym,ug=Dr,dg=mi,fg=jr,pg=rg,mg=yi(`splice`),hg=Math.max,gg=Math.min;ig({target:`Array`,proto:!0,forced:!mg},{splice:function(e,t){var n=ag(this),r=cg(n),i=og(e,r),a=arguments.length,o,s,c,l,u,d;for(a===0?o=s=0:a===1?(o=0,s=r-i):(o=a-2,s=gg(hg(sg(t),0),r-i)),ug(r+o-s),c=dg(n,s),l=0;l<s;l++)u=i+l,u in n&&fg(c,l,n[u]);if(c.length=s,o<s){for(l=i;l<r-s;l++)u=l+s,d=l+o,u in n?n[d]=n[u]:pg(n,d);for(l=r;l>r-s+o;l--)pg(n,l-1)}else if(o>s)for(l=r-s;l>i;l--)u=l+s-1,d=l+o-1,u in n?n[d]=n[u]:pg(n,d);for(l=0;l<o;l++)n[l+i]=arguments[l+2];return lg(n,r-s+o),c}});var _g=ff(`Array`,`splice`),vg=De,yg=_g,bg=Array.prototype,xg=r(function(e){var t=e.splice;return e===bg||vg(bg,e)&&t===bg.splice?yg:t}),Sg=k,Cg=v,wg=A,Tg=s,Eg=aa,Dg=Qa,Og=ae,kg=xt,Ag=pe,jg=Object.assign,Mg=Object.defineProperty,Ng=Cg([].concat),Pg=!jg||Tg(function(){if(Sg&&jg({b:1},jg(Mg({},`a`,{enumerable:!0,get:function(){Mg(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),r=`abcdefghijklmnopqrst`;return e[n]=7,r.split(``).forEach(function(e){t[e]=e}),jg({},e)[n]!==7||Eg(jg({},t)).join(``)!==r})?function(e,t){for(var n=kg(e),r=arguments.length,i=1,a=Dg.f,o=Og.f;r>i;)for(var s=Ag(arguments[i++]),c=a?Ng(Eg(s),a(s)):Eg(s),l=c.length,u=0,d;l>u;)d=c[u++],(!Sg||wg(o,s,d))&&(n[d]=s[d]);return n}:jg,Fg=z,Ig=Pg;Fg({target:`Object`,stat:!0,arity:2,forced:Object.assign!==Ig},{assign:Ig});var Lg=Ce.Object.assign,Rg=r(Lg),zg=z,Bg=s,Vg=xt,Hg=Fl,Ug=El;zg({target:`Object`,stat:!0,forced:Bg(function(){Hg(1)}),sham:!Ug},{getPrototypeOf:function(e){return Hg(Vg(e))}});var Wg=Ce.Object.getPrototypeOf;z({target:`Object`,stat:!0,sham:!k},{create:Fa});var Gg=Ce.Object,Kg=function(e,t){return Gg.create(e,t)},qg=r(Kg),Jg=Ce,Yg=p;Jg.JSON||={stringify:JSON.stringify};var Xg=r(function(e,t,n){return Yg(Jg.JSON.stringify,null,arguments)}),Zg=typeof Bun==`function`&&Bun&&typeof Bun.version==`string`,Qg=TypeError,$g=function(e,t){if(e<t)throw new Qg(`Not enough arguments`);return e},e_=o,t_=p,n_=D,r_=Zg,i_=Oe,a_=kc,o_=$g,s_=e_.Function,c_=/MSIE .\./.test(i_)||r_&&(function(){var e=e_.Bun.version.split(`.`);return e.length<3||e[0]===`0`&&(e[1]<3||e[1]===`3`&&e[2]===`0`)})(),l_=function(e,t){var n=t?2:1;return c_?function(r,i){var a=o_(arguments.length,1)>n,o=n_(r)?r:s_(r),s=a?a_(arguments,n):[],c=a?function(){t_(o,this,s)}:o;return t?e(c,i):e(c)}:e},u_=z,d_=o,f_=l_(d_.setInterval,!0);u_({global:!0,bind:!0,forced:d_.setInterval!==f_},{setInterval:f_});var p_=z,m_=o,h_=l_(m_.setTimeout,!0);p_({global:!0,bind:!0,forced:m_.setTimeout!==h_},{setTimeout:h_});var g_=Ce.setTimeout,__=r(g_),v_={exports:{}};(function(e){function t(e){if(e)return n(e);this._callbacks=new Map}function n(e){return Object.assign(e,t.prototype),e._callbacks=new Map,e}t.prototype.on=function(e,t){let n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},t.prototype.once=function(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},t.prototype.off=function(e,t){if(e===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(e),this;let n=this._callbacks.get(e);if(n){for(let[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}n.length===0?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e,...t){let n=this._callbacks.get(e);if(n){let e=[...n];for(let n of e)n.apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks.get(e)??[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(let e of this._callbacks.values())t+=e.length;return t},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t})(v_);var y_=v_.exports,b_=r(y_);function x_(){return x_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x_.apply(this,arguments)}function S_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function C_(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var w_=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},T_=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],E_=typeof document>`u`?{style:{}}:document.createElement(`div`),D_=`function`,O_=Math.round,k_=Math.abs,A_=Date.now;function j_(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<T_.length;){if(n=T_[a],r=n?n+i:t,r in e)return r;a++}}var M_=typeof window>`u`?{}:window,N_=j_(E_.style,`touchAction`),P_=N_!==void 0;function F_(){if(!P_)return!1;var e={},t=M_.CSS&&M_.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?M_.CSS.supports(`touch-action`,n):!0}),e}var I_=`compute`,L_=`auto`,R_=`manipulation`,z_=`none`,B_=`pan-x`,V_=`pan-y`,H_=F_(),U_=/mobile|tablet|ip(ad|hone|od)|android/i,W_=`ontouchstart`in M_,G_=j_(M_,`PointerEvent`)!==void 0,K_=W_&&U_.test(navigator.userAgent),q_=`touch`,J_=`pen`,Y_=`mouse`,X_=`kinect`,Z_=25,Q_=1,$_=2,ev=4,tv=8,nv=1,rv=2,iv=4,av=8,ov=16,sv=rv|iv,cv=av|ov,lv=sv|cv,uv=[`x`,`y`],dv=[`clientX`,`clientY`];function fv(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function pv(e,t){return typeof e===D_?e.apply(t&&t[0]||void 0,t):e}function mv(e,t){return e.indexOf(t)>-1}function hv(e){if(mv(e,z_))return z_;var t=mv(e,B_),n=mv(e,V_);return t&&n?z_:t||n?t?B_:V_:mv(e,R_)?R_:L_}var gv=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===I_&&(e=this.compute()),P_&&this.manager.element.style&&H_[e]&&(this.manager.element.style[N_]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return fv(this.manager.recognizers,function(t){pv(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),hv(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=mv(r,z_)&&!H_[z_],a=mv(r,V_)&&!H_[V_],o=mv(r,B_)&&!H_[B_];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&sv||o&&n&cv))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function _v(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function vv(e){var t=e.length;if(t===1)return{x:O_(e[0].clientX),y:O_(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:O_(n/t),y:O_(r/t)}}function yv(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:O_(e.pointers[n].clientX),clientY:O_(e.pointers[n].clientY)},n++;return{timeStamp:A_(),pointers:t,center:vv(t),deltaX:e.deltaX,deltaY:e.deltaY}}function bv(e,t,n){n||=uv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function xv(e,t,n){n||=uv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function Sv(e,t){return e===t?nv:k_(e)>=k_(t)?e<0?rv:iv:t<0?av:ov}function Cv(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===Q_||a.eventType===ev)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function wv(e,t,n){return{x:t/e||0,y:n/e||0}}function Tv(e,t){return bv(t[0],t[1],dv)/bv(e[0],e[1],dv)}function Ev(e,t){return xv(t[1],t[0],dv)+xv(e[1],e[0],dv)}function Dv(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==tv&&(r>Z_||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=wv(r,c,l);a=u.x,o=u.y,i=k_(u.x)>k_(u.y)?u.x:u.y,s=Sv(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function Ov(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=yv(t),i>1&&!n.firstMultiple?n.firstMultiple=yv(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=vv(r);t.timeStamp=A_(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=xv(s,c),t.distance=bv(s,c),Cv(n,t),t.offsetDirection=Sv(t.deltaX,t.deltaY);var l=wv(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=k_(l.x)>k_(l.y)?l.x:l.y,t.scale=o?Tv(o.pointers,r):1,t.rotation=o?Ev(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Dv(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;_v(f,u)&&(u=f),t.target=u}function kv(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&Q_&&r-i===0,o=t&(ev|tv)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Ov(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function Av(e){return e.trim().split(/\s+/g)}function jv(e,t,n){fv(Av(t),function(t){e.addEventListener(t,n,!1)})}function U(e,t,n){fv(Av(t),function(t){e.removeEventListener(t,n,!1)})}function Mv(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Nv=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){pv(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&jv(this.element,this.evEl,this.domHandler),this.evTarget&&jv(this.target,this.evTarget,this.domHandler),this.evWin&&jv(Mv(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&U(this.element,this.evEl,this.domHandler),this.evTarget&&U(this.target,this.evTarget,this.domHandler),this.evWin&&U(Mv(this.element),this.evWin,this.domHandler)},e}();function Pv(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var Fv={pointerdown:Q_,pointermove:$_,pointerup:ev,pointercancel:tv,pointerout:tv},Iv={2:q_,3:J_,4:Y_,5:X_},Lv=`pointerdown`,Rv=`pointermove pointerup pointercancel`;M_.MSPointerEvent&&!M_.PointerEvent&&(Lv=`MSPointerDown`,Rv=`MSPointerMove MSPointerUp MSPointerCancel`);var zv=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evEl=Lv,r.evWin=Rv,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}var n=t.prototype;return n.handler=function(e){var t=this.store,n=!1,r=Fv[e.type.toLowerCase().replace(`ms`,``)],i=Iv[e.pointerType]||e.pointerType,a=i===q_,o=Pv(t,e.pointerId,`pointerId`);r&Q_&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(ev|tv)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(Nv);function Bv(e){return Array.prototype.slice.call(e,0)}function Vv(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Pv(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}var Hv={touchstart:Q_,touchmove:$_,touchend:ev,touchcancel:tv},Uv=`touchstart touchmove touchend touchcancel`,Wv=function(e){S_(t,e);function t(){var n;return t.prototype.evTarget=Uv,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=Hv[e.type],n=Gv.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:q_,srcEvent:e})},t}(Nv);function Gv(e,t){var n=Bv(e.touches),r=this.targetIds;if(t&(Q_|$_)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=Bv(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return _v(e.target,c)}),t===Q_)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&(ev|tv)&&delete r[o[i].identifier],i++;if(s.length)return[Vv(a.concat(s),`identifier`,!0),s]}var Kv={mousedown:Q_,mousemove:$_,mouseup:ev},qv=`mousedown`,Jv=`mousemove mouseup`,Yv=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evEl=qv,r.evWin=Jv,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=Kv[e.type];t&Q_&&e.button===0&&(this.pressed=!0),t&$_&&e.which!==1&&(t=ev),this.pressed&&(t&ev&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:Y_,srcEvent:e}))},t}(Nv),Xv=2500,Zv=25;function Qv(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Xv)}}function $v(e,t){e&Q_?(this.primaryTouch=t.changedPointers[0].identifier,Qv.call(this,t)):e&(ev|tv)&&Qv.call(this,t)}function ey(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=Zv&&o<=Zv)return!0}return!1}var ty=function(){return function(e){S_(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.handler=function(e,t,n){var i=n.pointerType===q_,a=n.pointerType===Y_;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)$v.call(C_(C_(r)),t,n);else if(a&&ey.call(C_(C_(r)),n))return;r.callback(e,t,n)}},r.touch=new Wv(r.manager,r.handler),r.mouse=new Yv(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}var n=t.prototype;return n.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Nv)}();function ny(e){var t;return t=e.options.inputClass||(G_?zv:K_?Wv:W_?ty:Yv),new t(e,kv)}function ry(e,t,n){return Array.isArray(e)?(fv(e,n[t],n),!0):!1}var iy=1,ay=2,oy=4,sy=8,cy=sy,ly=16,uy=32,dy=1;function fy(){return dy++}function W(e,t){var n=t.manager;return n?n.get(e):e}function G(e){return e&ly?`cancel`:e&sy?`end`:e&oy?`move`:e&ay?`start`:``}var py=function(){function e(e){e===void 0&&(e={}),this.options=x_({enable:!0},e),this.id=fy(),this.manager=null,this.state=iy,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return w_(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(ry(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=W(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return ry(e,`dropRecognizeWith`,this)?this:(e=W(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(ry(e,`requireFailure`,this))return this;var t=this.requireFail;return e=W(e,this),Pv(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(ry(e,`dropRequireFailure`,this))return this;e=W(e,this);var t=Pv(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<sy&&r(t.options.event+G(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=sy&&r(t.options.event+G(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=uy},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(uy|iy)))return!1;e++}return!0},t.recognize=function(e){var t=w_({},e);if(!pv(this.options.enable,[this,t])){this.reset(),this.state=uy;return}this.state&(cy|ly|uy)&&(this.state=iy),this.state=this.process(t),this.state&(ay|oy|sy|ly)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),my=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var n=t.prototype;return n.getTouchAction=function(){return[R_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&Q_&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==ev)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||bv(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!s||!o?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=cy,t.tryEmit()},n.interval),ay):cy}return uy},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=uy},this.options.interval),uy},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===cy&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(py),hy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({pointers:1},t))||this}var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=t&(ay|oy),i=this.attrTest(e);return r&&(n&tv||!i)?t|ly:r||i?n&ev?t|sy:t&ay?t|oy:ay:uy},t}(py);function gy(e){return e===ov?`down`:e===av?`up`:e===rv?`left`:e===iv?`right`:``}var _y=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`pan`,threshold:10,pointers:1,direction:lv},t))||this,n.pX=null,n.pY=null,n}var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&sv&&t.push(V_),e&cv&&t.push(B_),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&sv?(i=a===0?nv:a<0?rv:iv,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?nv:o<0?av:ov,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return hy.prototype.attrTest.call(this,e)&&(this.state&ay||!(this.state&ay)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=gy(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(hy),vy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`swipe`,threshold:10,velocity:.3,direction:sv|cv,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return _y.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(sv|cv)?r=t.overallVelocity:n&sv?r=t.overallVelocityX:n&cv&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&k_(r)>this.options.velocity&&t.eventType&ev},n.emit=function(e){var t=gy(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(hy),yy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[z_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ay)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(hy),by=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[z_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ay)},t}(hy),xy=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`press`,pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var n=t.prototype;return n.getTouchAction=function(){return[L_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&(ev|tv)&&!a)this.reset();else if(e.eventType&Q_)this.reset(),this._timer=setTimeout(function(){t.state=cy,t.tryEmit()},n.time);else if(e.eventType&ev)return cy;return uy},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===cy&&(e&&e.eventType&ev?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=A_(),this.manager.emit(this.options.event,this._input)))},t}(py),Sy={domEvents:!1,touchAction:I_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},Cy=[[by,{enable:!1}],[yy,{enable:!1},[`rotate`]],[vy,{direction:sv}],[_y,{direction:sv},[`swipe`]],[my],[my,{event:`doubletap`,taps:2},[`tap`]],[xy]],wy=1,Ty=2;function Ey(e,t){var n=e.element;if(n.style){var r;fv(e.options.cssProps,function(i,a){r=j_(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function Dy(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var Oy=function(){function e(e,t){var n=this;this.options=w_({},Sy,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=ny(this),this.touchAction=new gv(this,this.options.touchAction),Ey(this,!0),fv(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return w_(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?Ty:wy},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&cy)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==Ty&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(ay|oy|sy)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof py)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(ry(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(ry(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Pv(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return fv(Av(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return fv(Av(e),function(e){t?n[e]&&n[e].splice(Pv(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&Dy(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&Ey(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),ky={touchstart:Q_,touchmove:$_,touchend:ev,touchcancel:tv},Ay=`touchstart`,jy=`touchstart touchmove touchend touchcancel`,My=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evTarget=Ay,r.evWin=jy,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=ky[e.type];if(t===Q_&&(this.started=!0),this.started){var n=Ny.call(this,e,t);t&(ev|tv)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:q_,srcEvent:e})}},t}(Nv);function Ny(e,t){var n=Bv(e.touches),r=Bv(e.changedTouches);return t&(ev|tv)&&(n=Vv(n.concat(r),`identifier`,!0)),[n,r]}function Py(e,t,n){var r=`DEPRECATED METHOD: `+t+`
4
4
  `+n+` AT
@@ -48,4 +48,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function tE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nE(e){var t=function(){if(typeof Reflect>`u`||!cv||cv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(cv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Hv(e);if(t){var i=Hv(this).constructor;n=cv(r,arguments,i)}else n=r.apply(this,arguments);return zv(this,n)}}var rE=function(e){Rv(r,e);var n=nE(r);function r(e,i){var a;return t(this,r),Xu(U(a=n.call(this)),`_queue`,null),e&&!nm(e)&&(i=e,e=[]),a._options=i||{},a._data=new Cw,a.length=0,a._idProp=a._options.fieldId||`id`,e&&e.length&&a.add(e),a.setOptions(i),a}return Yu(r,[{key:`idProp`,get:function(){return this._idProp}},{key:`setOptions`,value:function(e){e&&e.queue!==void 0&&(!1===e.queue?this._queue&&=(this._queue.destroy(),null):(this._queue||=GT.extend(this,{replace:[`add`,`update`,`remove`]}),e.queue&&typeof e.queue==`object`&&this._queue.setOptions(e.queue)))}},{key:`add`,value:function(e,t){var n,r=this,i=[];if(nm(e)){var a=Gd(e).call(e,(function(e){return e[r._idProp]}));if(kw(a).call(a,(function(e){return r._data.has(e)})))throw Error(`A duplicate id was found in the parameter array.`);for(var o=0,s=e.length;o<s;o++)n=this._addItem(e[o]),i.push(n)}else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);n=this._addItem(e),i.push(n)}return i.length&&this._trigger(`add`,{items:i},t),i}},{key:`update`,value:function(e,t){var n=this,r=[],i=[],a=[],o=[],s=this._idProp,c=function(e){var t=e[s];if(t!=null&&n._data.has(t)){var c=e,l=sh({},n._data.get(t)),u=n._updateItem(c);i.push(u),o.push(c),a.push(l)}else{var d=n._addItem(e);r.push(d)}};if(nm(e))for(var l=0,u=e.length;l<u;l++)e[l]&&typeof e[l]==`object`?c(e[l]):console.warn(`Ignoring input item, which is not an object at index `+l);else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);c(e)}if(r.length&&this._trigger(`add`,{items:r},t),i.length){var d={items:i,oldData:a,data:o};this._trigger(`update`,d,t)}return qp(r).call(r,i)}},{key:`updateOnly`,value:function(e,t){var n,r=this;nm(e)||(e=[e]);var i=Gd(n=Gd(e).call(e,(function(e){var t=r._data.get(e[r._idProp]);if(t==null)throw Error(`Updating non-existent items is not allowed.`);return{oldData:t,update:e}}))).call(n,(function(e){var t=e.oldData,n=e.update,i=t[r._idProp],a=function(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return R_.apply(void 0,qp(t=[{},e]).call(t,r))}(t,n);return r._data.set(i,a),{id:i,oldData:t,updatedData:a}}));if(i.length){var a={items:Gd(i).call(i,(function(e){return e.id})),oldData:Gd(i).call(i,(function(e){return e.oldData})),data:Gd(i).call(i,(function(e){return e.updatedData}))};return this._trigger(`update`,a,t),a.items}return[]}},{key:`get`,value:function(e,t){var n=void 0,r=void 0,i=void 0;WT(e)?(n=e,i=t):nm(e)?(r=e,i=t):i=e;var a=i&&i.returnType===`Object`?`Object`:`Array`,o=i&&zd(i),s=[],c=void 0,l=void 0,u=void 0;if(n!=null)(c=this._data.get(n))&&o&&!o(c)&&(c=void 0);else if(r!=null)for(var d=0,f=r.length;d<f;d++)(c=this._data.get(r[d]))==null||o&&!o(c)||s.push(c);else for(var p,m=0,h=(l=Vp(Lw(p=this._data).call(p))).length;m<h;m++)u=l[m],(c=this._data.get(u))==null||o&&!o(c)||s.push(c);if(i&&i.order&&n==null&&this._sort(s,i.order),i&&i.fields){var g=i.fields;if(n!=null&&c!=null)c=this._filterFields(c,g);else for(var _=0,v=s.length;_<v;_++)s[_]=this._filterFields(s[_],g)}if(a==`Object`){for(var y={},b=0,x=s.length;b<x;b++){var S=s[b];y[S[this._idProp]]=S}return y}return n==null?s:c??null}},{key:`getIds`,value:function(e){var t=this._data,n=e&&zd(e),r=e&&e.order,i=Vp(Lw(t).call(t)),a=[];if(n)if(r){for(var o=[],s=0,c=i.length;s<c;s++){var l=i[s],u=this._data.get(l);u!=null&&n(u)&&o.push(u)}this._sort(o,r);for(var d=0,f=o.length;d<f;d++)a.push(o[d][this._idProp])}else for(var p=0,m=i.length;p<m;p++){var h=i[p],g=this._data.get(h);g!=null&&n(g)&&a.push(g[this._idProp])}else if(r){for(var _=[],v=0,y=i.length;v<y;v++){var b=i[v];_.push(t.get(b))}this._sort(_,r);for(var x=0,S=_.length;x<S;x++)a.push(_[x][this._idProp])}else for(var ee=0,C=i.length;ee<C;ee++){var te=i[ee],w=t.get(te);w!=null&&a.push(w[this._idProp])}return a}},{key:`getDataSet`,value:function(){return this}},{key:`forEach`,value:function(e,t){var n=t&&zd(t),r=this._data,i=Vp(Lw(r).call(r));if(t&&t.order)for(var a=this.get(t),o=0,s=a.length;o<s;o++){var c=a[o];e(c,c[this._idProp])}else for(var l=0,u=i.length;l<u;l++){var d=i[l],f=this._data.get(d);f==null||n&&!n(f)||e(f,d)}}},{key:`map`,value:function(e,t){for(var n=t&&zd(t),r=[],i=this._data,a=Vp(Lw(i).call(i)),o=0,s=a.length;o<s;o++){var c=a[o],l=this._data.get(c);l==null||n&&!n(l)||r.push(e(l,c))}return t&&t.order&&this._sort(r,t.order),r}},{key:`_filterFields`,value:function(e,t){var n;return e&&Nd(n=nm(t)?t:am(t)).call(n,(function(t,n){return t[n]=e[n],t}),{})}},{key:`_sort`,value:function(e,t){if(typeof t==`string`){var n=t;bT(e).call(e,(function(e,t){var r=e[n],i=t[n];return r>i?1:r<i?-1:0}))}else{if(typeof t!=`function`)throw TypeError(`Order must be a function or a string`);bT(e).call(e,t)}}},{key:`remove`,value:function(e,t){for(var n=[],r=[],i=nm(e)?e:[e],a=0,o=i.length;a<o;a++){var s=this._remove(i[a]);if(s){var c=s[this._idProp];c!=null&&(n.push(c),r.push(s))}}return n.length&&this._trigger(`remove`,{items:n,oldData:r},t),n}},{key:`_remove`,value:function(e){var t;if(WT(e)?t=e:e&&typeof e==`object`&&(t=e[this._idProp]),t!=null&&this._data.has(t)){var n=this._data.get(t)||null;return this._data.delete(t),--this.length,n}return null}},{key:`clear`,value:function(e){for(var t,n=Vp(Lw(t=this._data).call(t)),r=[],i=0,a=n.length;i<a;i++)r.push(this._data.get(n[i]));return this._data.clear(),this.length=0,this._trigger(`remove`,{items:n,oldData:r},e),n}},{key:`max`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s>i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`min`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s<i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`distinct`,value:function(e){for(var t=this._data,n=Vp(Lw(t).call(t)),r=[],i=0,a=0,o=n.length;a<o;a++){for(var s=n[a],c=t.get(s)[e],l=!1,u=0;u<i;u++)if(r[u]==c){l=!0;break}l||c===void 0||(r[i]=c,i++)}return r}},{key:`_addItem`,value:function(e){var t=function(e,t){return e[t]??(e[t]=UT()),e}(e,this._idProp),n=t[this._idProp];if(this._data.has(n))throw Error(`Cannot add item: item with id `+n+` already exists`);return this._data.set(n,t),++this.length,n}},{key:`_updateItem`,value:function(e){var t=e[this._idProp];if(t==null)throw Error(`Cannot update item: item has no id (item: `+_h(e)+`)`);var n=this._data.get(t);if(!n)throw Error(`Cannot update item: no item with id `+t+` found`);return this._data.set(t,$T($T({},n),e)),t}},{key:`stream`,value:function(e){if(e){var t=this._data;return new ZT({[kT]:()=>vC.mark((function n(){var r,i,a,o;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=eE(e),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=11;break}if(a=i.value,(o=t.get(a))==null){n.next=9;break}return n.next=9,[a,o];case 9:n.next=3;break;case 11:n.next=16;break;case 13:n.prev=13,n.t0=n.catch(1),r.e(n.t0);case 16:return n.prev=16,r.f(),n.finish(16);case 19:case`end`:return n.stop()}}),n,null,[[1,13,16,19]])}))()})}var n;return new ZT({[kT]:_d(n=LT(this._data)).call(n,this._data)})}}]),r}(KT);function iE(e,t){var n=Hp!==void 0&&Qf(e)||e[`@@iterator`];if(!n){if(nm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return aE(e,t);var r=Jp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Yf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
49
49
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function aE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oE(e){var t=function(){if(typeof Reflect>`u`||!cv||cv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(cv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Hv(e);if(t){var i=Hv(this).constructor;n=cv(r,arguments,i)}else n=r.apply(this,arguments);return zv(this,n)}}var sE=function(e){Rv(r,e);var n=oE(r);function r(e,i){var a,o;return t(this,r),Xu(U(o=n.call(this)),`length`,0),Xu(U(o),`_ids`,new qT),o._options=i||{},o._listener=_d(a=o._onEvent).call(a,U(o)),o.setData(e),o}return Yu(r,[{key:`idProp`,get:function(){return this.getDataSet().idProp}},{key:`setData`,value:function(e){if(this._data){this._data.off&&this._data.off(`*`,this._listener);var t=this._data.getIds({filter:zd(this._options)}),n=this._data.get(t);this._ids.clear(),this.length=0,this._trigger(`remove`,{items:t,oldData:n})}if(e!=null){this._data=e;for(var r=this._data.getIds({filter:zd(this._options)}),i=0,a=r.length;i<a;i++){var o=r[i];this._ids.add(o)}this.length=r.length,this._trigger(`add`,{items:r})}else this._data=new rE;this._data.on&&this._data.on(`*`,this._listener)}},{key:`refresh`,value:function(){for(var e=this._data.getIds({filter:zd(this._options)}),t=Vp(this._ids),n={},r=[],i=[],a=[],o=0,s=e.length;o<s;o++){var c=e[o];n[c]=!0,this._ids.has(c)||(r.push(c),this._ids.add(c))}for(var l=0,u=t.length;l<u;l++){var d=t[l],f=this._data.get(d);f==null?console.error(`If you see this, report it please.`):n[d]||(i.push(d),a.push(f),this._ids.delete(d))}this.length+=r.length-i.length,r.length&&this._trigger(`add`,{items:r}),i.length&&this._trigger(`remove`,{items:i,oldData:a})}},{key:`get`,value:function(e,t){if(this._data==null)return null;var n,r=null;WT(e)||nm(e)?(r=e,n=t):n=e;var i=sh({},this._options,n),a=zd(this._options),o=n&&zd(n);return a&&o&&(i.filter=function(e){return a(e)&&o(e)}),r==null?this._data.get(i):this._data.get(r,i)}},{key:`getIds`,value:function(e){if(this._data.length){var t,n=zd(this._options),r=e==null?null:zd(e);return t=r?n?function(e){return n(e)&&r(e)}:r:n,this._data.getIds({filter:t,order:e&&e.order})}return[]}},{key:`forEach`,value:function(e,t){if(this._data){var n,r,i=zd(this._options),a=t&&zd(t);r=a?i?function(e){return i(e)&&a(e)}:a:i,gm(n=this._data).call(n,e,{filter:r,order:t&&t.order})}}},{key:`map`,value:function(e,t){if(this._data){var n,r,i=zd(this._options),a=t&&zd(t);return r=a?i?function(e){return i(e)&&a(e)}:a:i,Gd(n=this._data).call(n,e,{filter:r,order:t&&t.order})}return[]}},{key:`getDataSet`,value:function(){return this._data.getDataSet()}},{key:`stream`,value:function(e){var t;return this._data.stream(e||{[kT]:_d(t=Lw(this._ids)).call(t,this._ids)})}},{key:`dispose`,value:function(){var e;(e=this._data)!=null&&e.off&&this._data.off(`*`,this._listener);var t,n=`This data view has already been disposed of.`,i={get:function(){throw Error(n)},set:function(){throw Error(n)},configurable:!1},a=iE(tm(r.prototype));try{for(a.s();!(t=a.n()).done;){var o=t.value;jv(this,o,i)}}catch(e){a.e(e)}finally{a.f()}}},{key:`_onEvent`,value:function(e,t,n){if(t&&t.items&&this._data){var r=t.items,i=[],a=[],o=[],s=[],c=[],l=[];switch(e){case`add`:for(var u=0,d=r.length;u<d;u++){var f=r[u];this.get(f)&&(this._ids.add(f),i.push(f))}break;case`update`:for(var p=0,m=r.length;p<m;p++){var h=r[p];this.get(h)?this._ids.has(h)?(a.push(h),c.push(t.data[p]),s.push(t.oldData[p])):(this._ids.add(h),i.push(h)):this._ids.has(h)&&(this._ids.delete(h),o.push(h),l.push(t.oldData[p]))}break;case`remove`:for(var g=0,_=r.length;g<_;g++){var v=r[g];this._ids.has(v)&&(this._ids.delete(v),o.push(v),l.push(t.oldData[g]))}}this.length+=i.length-o.length,i.length&&this._trigger(`add`,{items:i},n),a.length&&this._trigger(`update`,{items:a,oldData:s,data:c},n),o.length&&this._trigger(`remove`,{items:o,oldData:l},n)}}}]),r}(KT);function cE(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof t.add==`function`&&typeof t.clear==`function`&&typeof t.distinct==`function`&&typeof gm(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Gd(t)==`function`&&typeof t.max==`function`&&typeof t.min==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.remove==`function`&&typeof t.setOptions==`function`&&typeof t.stream==`function`&&typeof t.update==`function`&&typeof t.updateOnly==`function`}e.DELETE=L_,e.DataSet=rE,e.DataStream=ZT,e.DataView=sE,e.Queue=GT,e.createNewDataPipeFrom=function(e){return new lf(e)},e.isDataSetLike=cE,e.isDataViewLike=function(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof gm(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Gd(t)==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.stream==`function`&&cE(e,t.getDataSet())}}))}))(),se=ae(),ce=s(),j=e(o(),1);function le(e){let t=new Map,n=e=>t.set(e,(t.get(e)??0)+1);for(let t of e)t.from===t.to?n(t.from):(n(t.from),n(t.to));return t}function ue(e,t=14,n=40,r=25){if(e<=0)return t;let i=Math.min(1,Math.sqrt(e/r));return Math.round(t+(n-t)*i)}var de=ne();function fe(e){let t=new Map;for(let n of e){let e=(0,de.pickDisplayLabel)(n.labels);e&&t.set(e,(t.get(e)??0)+1)}return[...t.entries()].map(([e,t])=>({label:e,count:t,colour:(0,de.colourForLabel)(e),shape:(0,de.shapeForLabel)(e)})).sort((e,t)=>e.label.localeCompare(t.label))}var pe=new Set([`Conversation`,`AdminConversation`,`PublicConversation`]),me=/^(\d{4}-\d{2}-\d{2})T/,he=24;function ge(e){let t=e.match(me);return t?t[1]:null}function _e(e,t){if(e.length===0)return``;let n=e.split(/\s+/).filter(e=>e.length>0);if(n.length===0)return``;if(n.length===1){let e=n[0];return e.length<=he?e:e.slice(0,he-1)+`…`}let r=[],i=0;for(;r.length<t&&i<n.length;){let e=``;for(;i<n.length;){let t=e.length===0?n[i]:`${e} ${n[i]}`;if(t.length<=he)e=t,i++;else break}e.length===0&&(e=n[i].slice(0,he-1)+`…`,i++),r.push(e)}if(i<n.length&&r.length>0){let e=n.slice(i).join(` `),t=r.length-1;r[t]=(r[t].length===0?e:`${r[t]} ${e}`).slice(0,he-1)+`…`}return r.join(`
50
50
  `)}function ve(e){return _e(e,2)}function ye(e,t){let n=e.labels[0];if(!n||!pe.has(n)||t<.7)return(0,de.pickShortLabel)(e);let r=ve((0,de.pickDisplayName)(e));if(t<1.3)return r;let i=e.properties,a=typeof i.createdAt==`string`?i.createdAt:``,o=typeof i.messageCount==`number`?i.messageCount:null;if(a.length===0||o===null)return r;let s=ge(a);return s===null?r:`${r}\n${s} · ${o} msgs`}var be=new Set([`Person`,`Organization`,`Concept`]),xe=80;function Se(e,t){let n=(0,de.pickDisplayName)(e);if(t<1.3)return _e(n,3);let r=n.length<=24?n:n.slice(0,23)+`…`,i=e.properties.compiledTruth;if(typeof i!=`string`||i.length===0)return _e((0,de.pickDisplayName)(e),3);let a=_e(i.length>xe?i.slice(0,xe-1)+`…`:i,2);return a.length===0?r:`${r}\n${a}`}function M(e,t){if(t<.7)return(0,de.pickShortLabel)(e);let n=e.labels[0];return n&&pe.has(n)?ye(e,t):n&&be.has(n)?Se(e,t):_e((0,de.pickDisplayName)(e),3)}function N(e){let t=e.properties,n=typeof t.createdAt==`string`?t.createdAt:``,r=typeof t.updatedAt==`string`?t.updatedAt:``,i=e.labels.join(` · `);return[(0,de.pickDisplayName)(e),i,`id: ${e.id}`,n?`createdAt: ${n}`:``,r?`updatedAt: ${r}`:``].filter(e=>e.length>0).join(`
51
- `)}function Ce(e){let{node:t,degree:n,revealed:r}=e,i=e.scale??1,a=t.labels[0]??`Unknown`,o=(0,w.resolveNodeColour)(t.labels),s=o.displayLabel,c=o.colour,l=s??a,u=(0,w.nodeImageDataUri)(l),d=u===null?l:null,f=ue(n),p=r?M(t,i):``,m=N(t),h=e.position?{x:e.position.x,y:e.position.y,physics:!1}:{},g;return g=t.trashed?u===null?{id:t.id,label:p,title:m,color:{background:`${c}40`,border:c},borderWidth:2,shapeProperties:{borderDashes:[6,4]},shape:(0,w.shapeForLabel)(l),size:f,group:a,...h}:{id:t.id,label:p,title:m,shape:`image`,image:u,size:f,opacity:.35,group:a,...h}:u===null?{id:t.id,label:p,title:m,color:c,shape:(0,w.shapeForLabel)(l),size:f,group:a,...h}:{id:t.id,label:p,title:m,shape:`image`,image:u,size:f,group:a,...h},{visNode:g,iconFallbackLabel:d}}function we(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(n[i]!==r[i]||JSON.stringify(e[n[i]])!==JSON.stringify(t[r[i]]))return!1;return!0}function Te(e,t){if(!!e.trashed!=!!t.trashed||e.labels.length!==t.labels.length)return!1;for(let n=0;n<e.labels.length;n++)if(e.labels[n]!==t.labels[n])return!1;return we(e.properties,t.properties)}function Ee(e,t){let n=[],r=[],i=new Set;for(let a of t){i.add(a.id);let t=e.get(a.id);t===void 0?n.push(a):Te(t,a)||r.push(a)}let a=[];for(let t of e.keys())i.has(t)||a.push(t);return{added:n,updated:r,removed:a}}function P(e,t){let n=[],r=new Set;for(let i of t)r.add(i.id),e.has(i.id)||n.push(i);let i=[];for(let t of e.keys())r.has(t)||i.push(t);return{added:n,removed:i}}function F(e,t){return e.added.length>0||e.updated.length>0||e.removed.length>0||t.added.length>0||t.removed.length>0}function De(e){let t=new URLSearchParams(e),n=t.get(`nodeId`);if(n)return{kind:`focus`,nodeId:n,nodeLabel:t.get(`label`)};let r=t.get(`label`);return r?{kind:`labels`,labels:[r]}:null}function Oe(e){return!e.inNeighbourhood&&!e.searchActive&&e.selectedLabelsCount===0&&e.topLevelTotal!==null&&e.nodeCount>0}function ke(e,t){let n=t===1?`node`:`nodes`;return`Showing ${e.toLocaleString()} of ${t.toLocaleString()} top-level ${n}`}function Ae(e){return typeof e.total==`number`?e.total:null}function je(e){return(e.loading||e.rendering)&&!e.searchActive}function Me(e){return!e.inNeighbourhood&&!e.searchActive}function Ne(e,t){let n=`/api/admin/graph-subgraph`,r=t.includeAgentActions?`&includeAgentActions=1`:``;if(e.kind===`neighbourhood`){let i=t.search&&t.search.q?`&q=${encodeURIComponent(t.search.q)}&limit=${t.search.limit}`:``;return`${n}?mode=neighbourhood&elementId=${encodeURIComponent(e.rootElementId)}${r}${i}`}let i=e.includeTrashed?`&includeTrashed=1`:``;return e.selectedLabels.length===0?`${n}?mode=default&topLevel=1${i}${r}`:`${n}?mode=default&labels=${encodeURIComponent(e.selectedLabels.join(`,`))}${i}${r}`}function Pe(e,t){return e.length<10?[...e,t]:[e[0],...e.slice(e.length-8),t]}function Fe(e){return e.length<=1?e:e.slice(0,-1)}function Ie(e){return[e]}function Le(e){let t=e[e.length-1];return t.kind===`filter`?`f:${[...t.selectedLabels].sort().join(`,`)}:${t.includeTrashed?1:0}:${t.includeAgentActions?1:0}`:`n:${t.rootElementId}`}function Re(e){let t=e[0];if(t.kind!==`filter`)throw Error(`view-stack invariant: root must be filter view`);return t}var ze=`admin-sessions`;function Be(){if(typeof window>`u`)return null;if(typeof BroadcastChannel>`u`)return console.warn(`[admin-sessions/broadcast] unsupported — manual refresh only`),null;try{return new BroadcastChannel(ze)}catch(e){return console.warn(`[admin-sessions/broadcast] ctor failed: ${e instanceof Error?e.message:String(e)} — manual refresh only`),null}}function Ve(e){let t=Be();if(t)try{let n={type:`mutated`,reason:e};t.postMessage(n)}catch(e){console.warn(`[admin-sessions/broadcast] postMessage failed: ${e instanceof Error?e.message:String(e)}`)}finally{try{t.close()}catch{}}}function He(e){return e.trashed===!0?`skip-trashed`:`pivot`}function Ue(e,t,n,r){let i=[],a=[];for(let o of e){let e=t.get(o.nodeId);if(!e)continue;a.push(o.nodeId);let{colour:s}=n(e.labels),c=e.trashed?`${s}40`:s;i.push({id:o.nodeId,borderWidth:3,color:{background:c,border:r}})}return{updates:i,inWindow:a}}function We(e,t){let n=t.length>0?new Set(t):null,r=new Map,i=new Set,a=[];for(let t of e)n&&!t.labels.some(e=>n.has(e))||r.set(t.nodeId,{id:t.nodeId,labels:t.labels,properties:t.properties});for(let t of e)if(r.has(t.nodeId))for(let e of t.related){if(n&&!e.labels.some(e=>n.has(e)))continue;r.has(e.nodeId)||r.set(e.nodeId,{id:e.nodeId,labels:e.labels,properties:e.properties});let[o,s]=e.direction===`outgoing`?[t.nodeId,e.nodeId]:[e.nodeId,t.nodeId],c=`${o}|${s}|${e.relationship}`;i.has(c)||(i.add(c),a.push({id:c,from:o,to:s,type:e.relationship}))}return{nodes:[...r.values()],edges:a}}var Ge=2e3;function Ke(e){let t=typeof e==`number`?e:Number(e);return!Number.isFinite(t)||t<=0?100:Math.min(Math.max(Math.floor(t),1),Ge)}function qe(e,t,n,r){let i=encodeURIComponent(t.join(`,`));return`/api/admin/graph-search?q=${encodeURIComponent(e)}&labels=${i}&limit=${n}${r?`&threshold=0`:``}`}var Je={solver:`forceAtlas2Based`,forceAtlas2Based:{gravitationalConstant:-50,centralGravity:.01,springLength:100,springConstant:.08,damping:.4,avoidOverlap:0},stabilization:{iterations:2e3}},Ye=220,Xe=3;function Ze(e){if(!(e.nodes.length<=5))return{physics:Je,nodePositions:new Map};let t=new Map,n=(Xe-1)*Ye/2,r=(Math.ceil(e.nodes.length/Xe)-1)*Ye/2;for(let i=0;i<e.nodes.length;i++){let a=i%Xe,o=Math.floor(i/Xe);t.set(e.nodes[i].id,{x:a*Ye-n,y:o*Ye-r})}return{physics:!1,nodePositions:t}}function Qe(e,t){let n=(t.t-e.t)/1e3;if(n<=0)return 0;let r=0,i=0;for(let n of Object.keys(t.positions)){let a=e.positions[n];if(!a)continue;let o=t.positions[n];r+=Math.hypot(o.x-a.x,o.y-a.y),i++}return i===0?0:r/i/n}function $e(e,t,n){if(t>n.threshold)return{belowCount:0,freeze:!1};let r=e+1;return{belowCount:r,freeze:r>=n.needed}}function et(e,t){let n=Date.now(),r=null,i=0,a=null,o=()=>{a!==null&&(clearInterval(a),a=null)},s=(r,i,a)=>{o();try{e.setOptions({physics:!1})}catch{}t.report?.({avgMotion:r,settleMs:Date.now()-n,capped:a,nodeCount:i})};return a=setInterval(()=>{let t;try{t=e.getPositions()}catch{o();return}let a={t:Date.now(),positions:t},c=Object.keys(t).length;if(r){let e=Qe(r,a),t=$e(i,e,{threshold:5,needed:2});if(i=t.belowCount,t.freeze){s(e,c,!1);return}if(Date.now()-n>=3e4){s(e,c,!0);return}}r=a},250),o}var tt=`graph-side-panel-size`;function nt(e,t){let n=Math.max(280,t.maxWidth),r=Math.max(240,t.maxHeight),i=Math.min(Math.max(e.width,280),n),a=Math.min(Math.max(e.height,240),r);return{width:i,height:a,clampedW:i!==e.width,clampedH:a!==e.height}}function rt(e){try{localStorage.setItem(tt,JSON.stringify({width:e.width,height:e.height}))}catch{}}function it(){try{let e=localStorage.getItem(tt);if(!e)return{size:null,source:`default`};let t=JSON.parse(e);return t&&typeof t==`object`&&typeof t.width==`number`&&typeof t.height==`number`&&Number.isFinite(t.width)&&Number.isFinite(t.height)?{size:{width:t.width,height:t.height},source:`storage`}:{size:null,source:`default`}}catch{return{size:null,source:`default`}}}function at(e){return typeof e==`string`?/^https?:\/\/\S+$/i.test(e.trim()):!1}function ot(e){let t=t=>{let n=e[t];if(n&&typeof n==`object`&&`low`in n){let e=n.low;return typeof e==`number`?e:null}return null},n=t(`year`),r=t(`month`),i=t(`day`);if(n===null||r===null||i===null)return null;let a=`${String(n).padStart(4,`0`)}-${String(r).padStart(2,`0`)}-${String(i).padStart(2,`0`)}`;if(!(`hour`in e))return a;let o=t(`hour`),s=t(`minute`),c=t(`second`);return o===null||s===null||c===null?a:`${a} ${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`}function st(e){if(e==null)return``;if(Array.isArray(e))return e.length>8?`[${e.length} items]`:e.map(String).join(`, `);if(typeof e==`object`){if(`year`in e&&`month`in e&&`day`in e&&typeof e.year==`object`){let t=ot(e);if(t)return t}return JSON.stringify(e)}return String(e)}var I=a(),ct=76,lt=36,ut=16,dt=520;function ft(e){let t=e?.offsetParent??null,n=t?.clientWidth??0,r=t?.clientHeight??0;return{maxWidth:n-lt-ut,maxHeight:r-ct-ut}}function pt(e){return typeof e==`string`?e:st(e)}function mt(e){return at(e)?(0,I.jsx)(`a`,{className:`graph-side-link`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:e}):st(e)}function ht({value:e,label:t,field:r}){let{status:i,copy:a}=T({onResult:e=>{e?console.log(`[graph-panel] op=copy result=ok field=${r}`):console.warn(`[graph-panel] op=copy result=error field=${r} msg=clipboard-write-failed`)}}),o=i===`ok`?`Copied`:i===`fail`?`Copy failed`:`Copy ${t}`;return(0,I.jsxs)(`button`,{type:`button`,className:`graph-side-copy${i===`ok`?` graph-side-copy-ok`:``}${i===`fail`?` graph-side-copy-fail`:``}`,onClick:()=>a(e),"aria-label":o,title:o,children:[i===`ok`?(0,I.jsx)(n,{size:12}):(0,I.jsx)(S,{size:12}),i!==`idle`&&(0,I.jsx)(`span`,{className:`graph-side-copy-feedback`,children:i===`ok`?`Copied`:`Copy failed`})]})}function gt({node:e,edges:t,nodesById:n,adminFetch:r,onClose:i,onRestored:a,onTrashed:o}){let s=Object.entries(e.properties).filter(([,e])=>e!=null),c=t.filter(t=>t.from===e.id||t.to===e.id),d=c.length>0,[f,m]=(0,j.useState)(!1),[h,_]=(0,j.useState)(null),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(null),[S,ee]=(0,j.useState)(`properties`),te=g(`(max-width: 640px)`),w=(0,j.useRef)(null),ne=(0,j.useRef)(it()),[T,E]=(0,j.useState)(()=>ne.current.size??{width:280,height:dt}),D=(0,j.useRef)(!1),O=(0,j.useRef)(null);(0,j.useEffect)(()=>()=>{O.current?.()},[]),(0,j.useEffect)(()=>{m(!1),_(null),y(!1),x(null),ee(`properties`)},[e.id]),(0,j.useLayoutEffect)(()=>{if(D.current)return;D.current=!0;let e=ft(w.current),t=nt(ne.current.size??{width:280,height:dt},e);E({width:t.width,height:t.height}),console.log(`[graph-panel] op=restore-size w=${t.width} h=${t.height} source=${ne.current.source}`)},[]);let k=(0,j.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=e.clientY,r=T.width,i=T.height,a=ft(w.current);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}let o={width:r,height:i,clampedW:!1,clampedH:!1},s=e=>{o=nt({width:r+(t-e.clientX),height:i+(e.clientY-n)},a),E({width:o.width,height:o.height})},c=()=>{window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l),O.current=null},l=()=>{c(),rt({width:o.width,height:o.height}),console.log(`[graph-panel] op=resize w=${o.width} h=${o.height} clampedW=${o.clampedW} clampedH=${o.clampedH}`)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l),O.current=c},[T.width,T.height]),re=(0,j.useCallback)(()=>{m(!0),_(null),r(`/api/admin/graph-restore`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);a()}).catch(e=>{_(e instanceof Error?e.message:String(e)),m(!1)})},[e.id,a,r]),ie=(0,j.useCallback)(()=>{y(!0),x(null),r(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id,by:`graph-side-panel-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);o()}).catch(e=>{x(e instanceof Error?e.message:String(e)),y(!1)})},[e.id,o,r]),A=S===`connections`&&d?`connections`:`properties`,ae=te?void 0:{width:`${T.width}px`,height:`${T.height}px`};return(0,I.jsxs)(`aside`,{ref:w,className:`graph-side-panel${e.trashed?` graph-side-panel-trashed`:``}`,style:ae,children:[!te&&(0,I.jsx)(`div`,{className:`graph-side-resize-handle`,role:`separator`,"aria-label":`Resize panel`,"aria-orientation":`vertical`,onPointerDown:k}),(0,I.jsxs)(`header`,{className:`graph-side-header`,children:[(0,I.jsx)(`div`,{children:(()=>{if(e.labels.some(e=>pe.has(e))){let t=(0,de.pickDisplayName)(e),n=e.properties.createdAt,r=typeof n==`string`?n:``,i=r?(0,de.formatRunTimestamp)(r):null,a=e.labels.join(` · `)+(e.trashed?` · Trashed`:``)+` · ${e.id}`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h2`,{className:`graph-side-name`,title:t,children:t}),i&&(0,I.jsx)(`div`,{className:`graph-side-created`,children:i}),(0,I.jsxs)(`div`,{className:`graph-side-meta`,children:[(0,I.jsx)(`span`,{children:a}),(0,I.jsx)(ht,{value:e.id,label:`id`,field:`id`})]})]})}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`graph-side-labels`,children:[e.labels.join(` · `),e.trashed?` · Trashed`:``]}),(0,I.jsxs)(`div`,{className:`graph-side-id-row`,children:[(0,I.jsx)(`span`,{className:`graph-side-id`,children:e.id}),(0,I.jsx)(ht,{value:e.id,label:`id`,field:`id`})]})]})})()}),(0,I.jsx)(`button`,{type:`button`,className:`graph-side-close`,onClick:i,"aria-label":`Close`,children:(0,I.jsx)(u,{size:14})})]}),e.trashed&&(0,I.jsxs)(`dl`,{className:`graph-side-props graph-side-trash-meta`,children:[(0,I.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,I.jsx)(`dt`,{children:`trashedAt`}),(0,I.jsx)(`dd`,{children:st(e.properties.trashedAt)})]}),(0,I.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,I.jsx)(`dt`,{children:`trashedBy`}),(0,I.jsx)(`dd`,{children:st(e.properties.trashedBy)})]})]}),(0,I.jsxs)(`div`,{className:`graph-side-tabs`,role:`tablist`,"aria-label":`Node detail sections`,children:[(0,I.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`properties`,className:`graph-side-tab${A===`properties`?` graph-side-tab-on`:``}`,onClick:()=>ee(`properties`),children:`Properties`}),d&&(0,I.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`connections`,className:`graph-side-tab${A===`connections`?` graph-side-tab-on`:``}`,onClick:()=>ee(`connections`),children:[`Connections (`,c.length,`)`]})]}),(0,I.jsxs)(`div`,{className:`graph-side-body`,children:[A===`properties`&&(0,I.jsxs)(`dl`,{className:`graph-side-props`,children:[s.length===0&&(0,I.jsx)(`div`,{className:`graph-side-empty`,children:`No properties.`}),s.map(([e,t])=>(0,I.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,I.jsx)(`dt`,{children:e}),(0,I.jsxs)(`dd`,{children:[(0,I.jsx)(`span`,{className:`graph-side-prop-value`,children:mt(t)}),(0,I.jsx)(ht,{value:pt(t),label:e,field:`prop`})]})]},e))]}),A===`connections`&&d&&(0,I.jsx)(`section`,{className:`graph-side-edges`,children:c.map(t=>{let r=t.from===e.id,i=r?t.to:t.from,a=n.get(i),o=a?(0,de.pickShortLabel)(a):i,s=r?`→`:`←`,c=Object.entries(t.properties??{}).filter(([,e])=>e!=null&&e!==``);return(0,I.jsxs)(`div`,{className:`graph-side-edge`,children:[(0,I.jsxs)(`div`,{className:`graph-side-edge-header`,children:[(0,I.jsx)(`span`,{className:`graph-side-edge-type`,children:t.type}),(0,I.jsx)(`span`,{className:`graph-side-edge-arrow`,children:s}),(0,I.jsx)(`span`,{className:`graph-side-edge-other`,title:o,children:o})]}),c.length>0&&(0,I.jsx)(`dl`,{className:`graph-side-edge-props`,children:c.map(([e,t])=>(0,I.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,I.jsx)(`dt`,{children:e}),(0,I.jsxs)(`dd`,{children:[(0,I.jsx)(`span`,{className:`graph-side-prop-value`,children:mt(t)}),(0,I.jsx)(ht,{value:pt(t),label:e,field:`edge-prop`})]})]},e))})]},t.id)})})]}),e.trashed&&(0,I.jsxs)(`footer`,{className:`graph-side-footer`,children:[!f&&!h&&(0,I.jsxs)(`button`,{type:`button`,className:`graph-side-restore`,onClick:re,children:[(0,I.jsx)(C,{size:14}),` Restore`]}),f&&(0,I.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,I.jsxs)(`p`,{children:[(0,I.jsx)(p,{size:14,className:`spin`}),` Restoring…`]})}),h&&(0,I.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,I.jsxs)(`p`,{children:[`Restore failed: `,h]}),(0,I.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,I.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{_(null)},children:`Close`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:re,children:`Retry`})]})]})]}),!e.trashed&&(0,I.jsxs)(`footer`,{className:`graph-side-footer`,children:[!v&&!b&&(0,I.jsxs)(`button`,{type:`button`,className:`graph-side-trash`,onClick:ie,children:[(0,I.jsx)(l,{size:14}),` Trash`]}),v&&(0,I.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,I.jsxs)(`p`,{children:[(0,I.jsx)(p,{size:14,className:`spin`}),` Trashing…`]})}),b&&(0,I.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,I.jsxs)(`p`,{children:[`Trash failed: `,b]}),(0,I.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,I.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{x(null)},children:`Close`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:ie,children:`Retry`})]})]})]})]})}var _t=`graph-shell`,vt=`graph-shell--fullscreen`;function yt(e,t){return t&&e?`${_t} ${vt}`:_t}function bt(e){return e}function xt(e){return e.isFullscreen&&!e.filterOpen}function St(e){return e<.7?`compact`:e<1.3?`wrapped`:`detailed`}var Ct=150,wt=`#FBBF24`;function Tt(e,t,n){let r=getComputedStyle(e).getPropertyValue(t).trim();return r.length>0?r:n}var Et=`#0F172A`,Dt=`#475569`,Ot=`#CBD5E1`;function kt(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}var At=`maxy-graph-search-limit-v1`,jt=250,Mt=12e3,Nt=1200;function Pt(){let[e,t]=(0,j.useState)(null),[n,r]=(0,j.useState)(!1),[i,a]=(0,j.useState)(void 0),[o,s]=(0,j.useState)(null),[c,l]=(0,j.useState)(void 0),[u,m]=(0,j.useState)(null),[h,g]=(0,j.useState)(null),y=(0,j.useMemo)(()=>typeof window>`u`?null:De(window.location.search),[]),b=(0,j.useMemo)(()=>y?.kind===`focus`?{nodeId:y.nodeId,nodeLabel:y.nodeLabel}:null,[y]),x=(0,j.useMemo)(()=>y?.kind===`labels`?y.labels:null,[y]);(0,j.useEffect)(()=>{b&&Bt(`deep-link`,{nodeId:b.nodeId.length>16?b.nodeId.slice(0,16)+`…`:b.nodeId,label:b.nodeLabel??``})},[b]),(0,j.useEffect)(()=>{!x||x.length===0||Bt(`label-seed`,{label:x[0]})},[x]),(0,j.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&a(e.businessName),e.sessionId!==void 0&&s(e.sessionId??null),g(e.role??null),l(e.userName===void 0?null:e.userName),m(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let S=(0,j.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[ee,C]=(0,j.useState)(!1),te=(0,j.useCallback)(async()=>{C(!0);try{let e=await v();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{C(!1)}},[]);return n?e?(0,I.jsx)(d,{cacheKey:e,surface:`graph`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=graph`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,I.jsx)(_,{cacheKey:e,businessName:i,sessionId:o,onLogout:S,onDisconnect:te,disconnecting:ee,userName:c,userAvatar:u,role:h,children:(0,I.jsxs)(`div`,{className:`data-page graph-page`,children:[(0,I.jsx)(`header`,{className:`data-header`,children:(0,I.jsxs)(`h1`,{className:`data-title`,children:[(0,I.jsx)(f,{size:18}),` Graph`]})}),(0,I.jsx)(`main`,{className:`graph-main`,children:(0,I.jsx)(Lt,{cacheKey:e,initialFocus:b,initialLabels:x,allowFullscreen:!0})})]})})}):(0,I.jsxs)(`div`,{className:`data-page`,children:[(0,I.jsx)(`header`,{className:`data-header`,children:(0,I.jsxs)(`h1`,{className:`data-title`,children:[(0,I.jsx)(f,{size:18}),` Graph`]})}),(0,I.jsxs)(`div`,{className:`data-empty`,children:[(0,I.jsx)(`p`,{children:`You are not signed in.`}),(0,I.jsxs)(`p`,{children:[`Open the `,(0,I.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,I.jsx)(`div`,{className:`data-page`,children:(0,I.jsxs)(`div`,{className:`data-loading`,children:[(0,I.jsx)(p,{size:18,className:`spin`}),` Loading…`]})})}var Ft={triangle:`7,1 13,13 1,13`,triangleDown:`1,1 13,1 7,13`,square:`2,2 12,2 12,12 2,12`,diamond:`7,1 13,7 7,13 1,7`,star:`7,1 8.8,5.2 13,5.2 9.6,8 10.9,12.4 7,9.7 3.1,12.4 4.4,8 1,5.2 5.2,5.2`,hexagon:`4,1.5 10,1.5 13,7 10,12.5 4,12.5 1,7`};function It({label:e,shape:t,colour:n}){let r=(0,w.nodeImageDataUri)(e);return r===null?(0,I.jsx)(`svg`,{className:`graph-legend-swatch`,viewBox:`0 0 14 14`,width:`14`,height:`14`,"aria-hidden":`true`,children:t===`dot`?(0,I.jsx)(`circle`,{cx:`7`,cy:`7`,r:`6`,fill:n}):(0,I.jsx)(`polygon`,{points:Ft[t],fill:n})}):(0,I.jsx)(`img`,{className:`graph-legend-swatch`,src:r,width:14,height:14,alt:``,"aria-hidden":`true`})}function Lt({cacheKey:e,initialFocus:t=null,initialLabels:n=null,allowFullscreen:i=!1}){let{adminFetch:a,cacheKey:o,sessionRefetchNonce:s}=r({initialCacheKey:e,surface:`graph`}),d=(0,j.useRef)(null),f=(0,j.useRef)(null),[g,_]=(0,j.useState)(!1),v=(0,j.useRef)(null),S=(0,j.useRef)(null),C=(0,j.useRef)(null),ne=(0,j.useRef)(null),T=(0,j.useRef)(new Map),A=(0,j.useRef)([]),ae=(0,j.useRef)(null),ce=(0,j.useRef)(null),de=(0,j.useRef)(null),pe=(0,j.useRef)([]),me=(0,j.useRef)(null),he=(0,j.useRef)(null),ge=(0,j.useRef)(null),_e=(0,j.useRef)(null),ve=(0,j.useRef)(!1),ye=(0,j.useRef)(!1),be=(0,j.useRef)(!1),[xe,Se]=(0,j.useState)([{kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}]);(0,j.useEffect)(()=>{t?.nodeId&&Se(e=>{let n=e[e.length-1];return n.kind===`neighbourhood`&&n.rootElementId===t.nodeId?e:[e[0],{kind:`neighbourhood`,rootElementId:t.nodeId,rootLabel:t.nodeLabel}]})},[t?.nodeId,t?.nodeLabel]);let N=n&&n.length>0?[...n].sort().join(`,`):null;(0,j.useEffect)(()=>{N&&(sn.current=!0,Se([{kind:`filter`,selectedLabels:N.split(`,`),includeTrashed:!1,includeAgentActions:!1}]))},[N]);let[we,Te]=(0,j.useState)(!1),[De,ze]=(0,j.useState)(!1),[Be,Ge]=(0,j.useState)(null),[Je,Ye]=(0,j.useState)(null),[Xe,Qe]=(0,j.useState)(0),[$e,tt]=(0,j.useState)(null),[nt,rt]=(0,j.useState)(null),[it,at]=(0,j.useState)(!1),[ot,st]=(0,j.useState)(!1),[ct,lt]=(0,j.useState)(null),[ut,dt]=(0,j.useState)(``),[ft,pt]=(0,j.useState)(``),[mt,ht]=(0,j.useState)(null),[_t,vt]=(0,j.useState)(null),[Pt,Ft]=(0,j.useState)(()=>{if(typeof window>`u`)return 100;let e=window.localStorage.getItem(At);return e?Ke(e):100}),[Lt,Vt]=(0,j.useState)(Pt),[Ht,Ut]=(0,j.useState)(`hybrid`),[Wt,Gt]=(0,j.useState)(0),[Kt,qt]=(0,j.useState)(!1),[Jt,Yt]=(0,j.useState)(0),[Xt,Zt]=(0,j.useState)(0),[Qt,$t]=(0,j.useState)([]),[en,tn]=(0,j.useState)({labels:[],includeTrashed:!1}),[nn,rn]=(0,j.useState)(!1),[an,on]=(0,j.useState)(!1),sn=(0,j.useRef)(!1),cn=(0,j.useRef)(null),ln=(0,j.useRef)(null),un=(0,j.useRef)(null),[dn,fn]=(0,j.useState)(null),[pn,mn]=(0,j.useState)(!1),hn=(0,j.useCallback)(e=>{let t=ln.current;if(!t)return;let n=t.getBoundingClientRect();un.current={dx:e.clientX-n.left,dy:e.clientY-n.top};try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}},[]),gn=(0,j.useCallback)(e=>{let t=un.current,n=ln.current,r=n?.offsetParent;if(!t||!n||!r)return;let i=r.getBoundingClientRect(),a=Math.max(0,r.clientWidth-n.offsetWidth),o=Math.max(0,r.clientHeight-n.offsetHeight);fn({x:Math.min(Math.max(0,e.clientX-i.left-t.dx),a),y:Math.min(Math.max(0,e.clientY-i.top-t.dy),o)})},[]),_n=(0,j.useCallback)(e=>{un.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),vn=(0,j.useMemo)(()=>fe(T.current.values()),[Xe]);(0,j.useEffect)(()=>{let e=!1,t=a(`/api/admin/graph-labels-in-graph`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[]}}),n=a(`/api/admin/graph-default-view`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[],includeTrashed:!1}});return Promise.all([t,n]).then(([t,n])=>{if(!e&&($t(t.labels),tn(n),!sn.current)){sn.current=!0;let e=new Set(t.labels.map(e=>e.label)),r=n.labels.filter(t=>e.has(t));(r.length>0||n.includeTrashed)&&Se(e=>[{kind:`filter`,selectedLabels:r,includeTrashed:n.includeTrashed,includeAgentActions:!1},...e.slice(1)])}}),()=>{e=!0}},[o,s,a]);let yn=xe[0].kind===`filter`?xe[0].includeAgentActions:!1;(0,j.useEffect)(()=>{if(!sn.current)return;let e=!1;return a(`/api/admin/graph-labels-in-graph?includeAgentActions=${yn?`1`:`0`}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(t=>{e||$t(t.labels)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph-refetch`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}),()=>{e=!0}},[o,s,yn,Xt,a]),(0,j.useEffect)(()=>{if(!nn)return;let e=e=>{cn.current&&(cn.current.contains(e.target)||rn(!1))},t=e=>{e.key===`Escape`&&rn(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[nn]);let bn=(0,j.useCallback)((e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:e,msg:t}),keepalive:!0}).catch(()=>{})}catch{}},[]),xn=(0,j.useCallback)(e=>{console.log(`[graph-fullscreen] op=exit reason=${e}`),_(!1)},[]);(0,j.useEffect)(()=>{if(!i||!g)return;let e=e=>{e.key===`Escape`&&xt({isFullscreen:g,filterOpen:nn})&&xn(`escape`)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i,g,nn,xn]);let Sn=(0,j.useRef)(g);(0,j.useEffect)(()=>{if(!i)return;let e=Sn.current!==g;if(Sn.current=g,!e)return;let t=requestAnimationFrame(()=>{let e=f.current;try{e?.redraw()}catch{}if(!g)return;let t=v.current?.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=t?Math.round(t.width):0,a=t?Math.round(t.height):0;console.log(`[graph-fullscreen] op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`),t&&(t.width<n-2||t.height<r-2)&&bn(`graph-fullscreen-not-covering`,`op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`);try{let t=e?.canvas?.frame?.canvas,n=d.current;if(t&&n){let e=t.clientWidth,r=t.clientHeight,i=n.clientWidth,a=n.clientHeight;console.log(`[graph-fullscreen] op=resized canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`),(Math.abs(e-i)>2||Math.abs(r-a)>2)&&bn(`graph-fullscreen-canvas-mismatch`,`canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`)}}catch{}});return()=>cancelAnimationFrame(t)},[i,g,bn]);let Cn=(0,j.useCallback)(()=>{if(C.current)try{C.current.clear()}catch{}if(ne.current)try{ne.current.clear()}catch{}},[]),wn=(0,j.useCallback)((e,t)=>{lt(null),a(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);rt(null);try{f.current?.unselectAll()}catch{}Se(e=>[Re(e)]),Yt(e=>e+1),Ve(`graph-trash`)}).catch(n=>{let r=n instanceof Error?n.message:String(n);lt(`Failed to delete: ${r}`),st(!0),window.setTimeout(()=>st(!1),Nt);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete`,elementId:e,label:t,msg:r}),keepalive:!0}).catch(()=>{})}catch{}})},[a]),Tn=(0,j.useCallback)(e=>{lt(null);let t=e.length;Promise.allSettled(e.map(e=>a(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async t=>{let n=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(n.error??`HTTP ${t.status}`);return e}))).then(e=>{let n=e.filter(e=>e.status===`rejected`);rt(null);try{f.current?.unselectAll()}catch{}if(Se(e=>[Re(e)]),Yt(e=>e+1),Ve(`graph-trash`),n.length>0){let e=t-n.length;lt(e===0?`Failed to delete ${t} node${t===1?``:`s`}.`:`Deleted ${e} of ${t}; ${n.length} failed.`),st(!0),window.setTimeout(()=>st(!1),Nt);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete-batch`,total:t,failed:n.length}),keepalive:!0}).catch(()=>{})}catch{}}})},[a]),En=xe[xe.length-1],Dn=(0,j.useMemo)(()=>Le(xe),[xe]),On=(0,j.useRef)(Dn);(0,j.useEffect)(()=>{On.current=Dn},[Dn]);let kn=(0,j.useRef)(xe);(0,j.useEffect)(()=>{kn.current=xe},[xe]),(0,j.useEffect)(()=>{if(ft){ae.current?.abort(),ae.current=null;return}let e=window.setTimeout(()=>{ae.current?.abort();let e=new AbortController;ae.current=e,Te(!0),console.log(`[graph-page] op=render-spinner state=shown reason=fetch-start`),Ge(null),Ye(null),a(Ne(En,{includeAgentActions:Re(xe).includeAgentActions,search:null}),{signal:e.signal}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(e.status===413)throw new Rt(t);if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{e.signal.aborted||(T.current=new Map(t.nodes.map(e=>[e.id,e])),Qe(t.nodes.length),tt(Ae(t)),jn(t.nodes,t.edges))}).catch(t=>{if(!e.signal.aborted){if(ze(!1),t instanceof Rt){console.log(`[graph-page] op=render-spinner state=hidden reason=ceiling`),Ye(t.body),Qe(0),T.current=new Map,Cn();return}console.log(`[graph-page] op=render-spinner state=hidden reason=error`),Ge(t instanceof Error?t.message:String(t))}}).finally(()=>{e.signal.aborted||Te(!1)})},jt);return()=>{window.clearTimeout(e)}},[o,Dn,Jt,s,ft,Lt]),(0,j.useEffect)(()=>{be.current=we},[we]);let An=(0,j.useCallback)((e,t)=>{let n=C.current,r=ne.current;if(!n||!r||!f.current)return{added:0,updated:0,removed:0,edgesAdded:0,edgesRemoved:0,maxDegree:0};let i=Ee(T.current,e),a=P(new Map(A.current.map(e=>[e.id,e])),t);if(!F(i,a))return{added:0,updated:0,removed:0,edgesAdded:0,edgesRemoved:0,maxDegree:0};let o=le(t),s=0;for(let e of o.values())e>s&&(s=e);let c=(()=>{try{return f.current.getScale()||1}catch{return 1}})();a.removed.length>0&&r.remove(a.removed);let l=new Set(e.map(e=>e.id)),u=a.added.filter(e=>e.type!==`PART_OF`||l.has(e.from)&&l.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type}));u.length>0&&r.add(u),i.removed.length>0&&n.remove(i.removed);let d=i.updated.map(e=>e.id),p=d.length>0?(()=>{try{return f.current.getPositions(d)}catch{return{}}})():{},m=new Set(i.added.map(e=>e.id)),h=[...i.added,...i.updated];for(let e of h){let{visNode:t}=Ce({node:e,degree:o.get(e.id)??0,revealed:ve.current,scale:c,position:m.has(e.id)?void 0:p[e.id]});n.update(t)}let g=new Set(h.map(e=>e.id));for(let t of e){if(g.has(t.id))continue;let e=ue(o.get(t.id)??0),r=n.get(t.id);r&&r.size!==e&&n.update({id:t.id,size:e})}return T.current=new Map(e.map(e=>[e.id,e])),A.current=t,Qe(e.length),{added:i.added.length,updated:i.updated.length,removed:i.removed.length,edgesAdded:u.length,edgesRemoved:a.removed.length,maxDegree:s}},[Qe]);(0,j.useEffect)(()=>{if(En.kind!==`filter`||ft)return;let e=Ne(En,{includeAgentActions:Re(xe).includeAgentActions,search:null}),t=!1,n=null,r=(e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-poll`,op:e,view:En.kind,...t}),keepalive:!0}).catch(()=>{})}catch{}},i=()=>{if(document.hidden||be.current)return;n?.abort();let i=new AbortController;n=i;let o=Date.now();a(e,{signal:i.signal}).then(e=>e.ok?e.json():null).then(e=>{if(t||i.signal.aborted||!e||!Array.isArray(e.nodes))return;let n=An(e.nodes,e.edges??[]),a=Ae(e);tt(a),r(`tick`,{fetchMs:Date.now()-o,total:a,...n})}).catch(e=>{i.signal.aborted||r(`poll-error`,{msg:e instanceof Error?e.message:String(e)})})};r(`start`,{intervalMs:Mt});let o=window.setInterval(i,Mt),s=()=>{document.visibilityState===`visible`?(r(`resume`,{}),i()):r(`pause`,{})};return document.addEventListener(`visibilitychange`,s),()=>{t=!0,n?.abort(),window.clearInterval(o),document.removeEventListener(`visibilitychange`,s),r(`stop`,{})}},[o,Dn,ft,s,En.kind]),(0,j.useEffect)(()=>()=>{ae.current?.abort(),S.current?.(),S.current=null,f.current?.destroy(),f.current=null,_e.current!==null&&(clearTimeout(_e.current),_e.current=null)},[]);let jn=(0,j.useCallback)((e,t)=>{if(!d.current)return;ze(!0),A.current=t;let n=new Set([`Message`,`UserMessage`,`AssistantMessage`]),r=e=>e.labels.some(e=>n.has(e)),i=new Map,a=e.filter(r);if(a.length>0){let e=new Set(a.map(e=>e.id)),n=new Map,r=new Set;for(let i of t)i.type===`NEXT`&&e.has(i.from)&&e.has(i.to)&&(n.set(i.from,i.to),r.add(i.to));let o=[],s=new Set;for(let e of a){if(r.has(e.id))continue;let t=e.id;for(;t&&!s.has(t);)s.add(t),o.push(t),t=n.get(t)}for(let e of a)s.has(e.id)||(o.push(e.id),s.add(e.id));let c=d.current?.clientWidth??1200,l=Math.max(c-160,300),u=Math.max(Math.floor(l/150),2);o.forEach((e,t)=>{let n=t%u,r=Math.floor(t/u);i.set(e,{x:n*150,y:r*90})})}let o=le(t),s=0,c=new Set,l=e.map(e=>{(0,w.resolveNodeColour)(e.labels).driftCandidates;let t=o.get(e.id)??0;t>s&&(s=t);let{visNode:n,iconFallbackLabel:r}=Ce({node:e,degree:t,revealed:ve.current,scale:1,position:i.get(e.id)});return r!==null&&c.add(r),n}),u=new Set(l.map(e=>e.id)),p=t.filter(e=>e.type!==`PART_OF`||u.has(e.from)&&u.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type})),m=Ze({nodes:e,edges:t});C.current=new oe.DataSet(m.nodePositions.size>0?l.map(e=>{if(e.x!==void 0||e.y!==void 0)return e;let t=m.nodePositions.get(e.id);return t?{...e,x:t.x,y:t.y,physics:!1}:e}):l),ne.current=new oe.DataSet(p);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-style`,op:`degree-size`,nodes:l.length,maxDegree:s,minPx:14,maxPx:40}),keepalive:!0}).catch(()=>{})}catch{}if(c.size>0&&!ye.current){ye.current=!0;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-style`,op:`icon-fallback`,labels:Array.from(c).sort().join(`,`)}),keepalive:!0}).catch(()=>{})}catch{}}let h=Tt(d.current,`--accent-brand`,Et),g=Tt(d.current,`--border-strong`,Dt),_=Tt(d.current,`--border`,Ot),v={autoResize:!0,layout:{improvedLayout:!1,randomSeed:kt(On.current)},physics:m.physics===!1?!1:{solver:m.physics.solver,forceAtlas2Based:m.physics.forceAtlas2Based,stabilization:m.physics.stabilization},nodes:{shape:`dot`,size:18,font:{color:`#1F2937`,size:12,face:`DM Sans, sans-serif`},scaling:{label:{enabled:!0,min:12,max:30,drawThreshold:0}},borderWidth:0,chosen:{node:e=>{e.size=Math.round(e.size*1.2),e.borderWidth=3,e.borderColor=h,e.shadow=!0,e.shadowColor=`rgba(15, 23, 42, 0.55)`,e.shadowSize=8,e.shadowX=0,e.shadowY=0},label:e=>{e.size=14}}},edges:{arrows:{to:{enabled:!0,scaleFactor:.4}},color:{color:_,highlight:g},font:{color:`#64748B`,size:9,face:`DM Sans, sans-serif`,align:`middle`,strokeWidth:0},smooth:{enabled:!0,type:`continuous`,roundness:.4},width:1,chosen:{edge:!0,label:!1}},interaction:{hover:!0,tooltipDelay:150,multiselect:!0}};try{S.current?.(),S.current=null,f.current?.destroy(),_e.current!==null&&(clearTimeout(_e.current),_e.current=null),ge.current=null;let e=new se.Network(d.current,{nodes:C.current,edges:ne.current},v);f.current=e,m.physics===!1?(ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=no-physics`)):S.current=et(e,{report:({avgMotion:e,settleMs:t,capped:n,nodeCount:r})=>{ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=${n?`settle-capped`:`settled`}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-settle`,avgMotion:Math.round(e*100)/100,settleMs:t,capped:n,nodeCount:r}),keepalive:!0}).catch(()=>{})}catch{}}}),e.on(`zoom`,()=>{_e.current!==null&&clearTimeout(_e.current),_e.current=setTimeout(()=>{_e.current=null;let e=f.current,t=C.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=St(n);if(r===ge.current)return;ge.current=r;let i=[];for(let e of T.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),r=e.trashed?{background:`${t}40`,border:t}:t,a=ve.current?M(e,n):``;i.push({id:e.id,label:a,color:r})}i.length>0&&t.update(i),console.error(`[graph-page] zoom-tier scale=${n.toFixed(3)} tier=${r} nodes=${i.length}`)},Ct)}),e.on(`click`,e=>{let t=e.nodes[0];if(!t)return;let n=T.current.get(t);if(!n)return;if(He(n)===`skip-trashed`){rt(n);return}let r=kn.current[kn.current.length-1];if(r.kind===`neighbourhood`&&r.rootElementId===t){rt(e=>e?.id===t?null:n);return}rt(null);let i={kind:`neighbourhood`,rootElementId:t,rootLabel:n.labels[0]??null};Se(e=>{let n=Pe(e,i),r=n.length-1;return n.length>e.length&&Bt(`nav-push`,{depth:r,kind:i.kind,rootElementId:t}),n.length===10&&e.length===10&&Bt(`view-stack-cap-hit`,{depth:10,rootElementId:t}),n})}),e.on(`deselectNode`,()=>{rt(null)});let t=e=>{let t=d.current,n=ce.current;if(!t||!n)return!1;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,o=r.top+e.y;return a>=i.left&&a<=i.right&&o>=i.top&&o<=i.bottom},n=d.current?.parentElement??null;e.on(`dragStart`,e=>{if(e.nodes.length===0){de.current=null,pe.current=[];return}pe.current=[...e.nodes],de.current=e.nodes[0],n?.classList.add(`graph-dragging`)}),e.on(`dragging`,e=>{if(pe.current.length===0)return;let n=t(e.pointer.DOM);at(e=>e===n?e:n)}),e.on(`dragEnd`,e=>{let r=pe.current;if(pe.current=[],de.current=null,at(!1),n?.classList.remove(`graph-dragging`),r.length!==0&&t(e.pointer.DOM))if(r.length===1){let e=T.current.get(r[0])?.labels[0]??`Unknown`;wn(r[0],e)}else Tn(r)})}catch(e){ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=render-error`);let t=e instanceof Error?e.message:String(e);Ge(`Visualisation failed to load: ${t}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-render`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}},[]),Mn=(0,j.useCallback)(()=>{let e=f.current,t=C.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=[];for(let e of T.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),i=e.trashed?{background:`${t}40`,border:t}:t;r.push({id:e.id,label:ve.current?M(e,n):``,color:i})}r.length>0&&t.update(r)},[]),Nn=(0,j.useCallback)(()=>{ve.current||(ve.current=!0,Mn())},[Mn]);(0,j.useEffect)(()=>{let e=v.current;if(!e)return;let t=()=>Nn();return e.addEventListener(`pointerdown`,t,!0),e.addEventListener(`wheel`,t,!0),e.addEventListener(`keydown`,t,!0),()=>{e.removeEventListener(`pointerdown`,t,!0),e.removeEventListener(`wheel`,t,!0),e.removeEventListener(`keydown`,t,!0)}},[Nn]),(0,j.useEffect)(()=>{let e=d.current;if(!e)return;let t=t=>{let n=he.current,r=me.current,i=e.parentElement;if(!n||!r||!i)return;let a=i.getBoundingClientRect(),o=Math.min(n.clientX,t.clientX)-a.left,s=Math.min(n.clientY,t.clientY)-a.top,c=Math.max(n.clientX,t.clientX)-a.left,l=Math.max(n.clientY,t.clientY)-a.top;r.style.left=`${o}px`,r.style.top=`${s}px`,r.style.width=`${c-o}px`,r.style.height=`${l-s}px`},n=r=>{document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0);let i=he.current;he.current=null;let a=me.current;a&&(a.style.display=`none`);let o=f.current;if(!i||!o)return;let s=e.getBoundingClientRect(),c=i.clientX-s.left,l=i.clientY-s.top,u=r.clientX-s.left,d=r.clientY-s.top,p=Math.min(c,u),m=Math.min(l,d),h=Math.max(c,u),g=Math.max(l,d);if(h-p<3&&g-m<3)return;let _=o.getPositions(),v=[];for(let[e,t]of Object.entries(_)){let n=o.canvasToDOM(t);n.x>=p&&n.x<=h&&n.y>=m&&n.y<=g&&v.push(e)}try{o.selectNodes(v,!1)}catch{}},r=r=>{if(!r.shiftKey||r.button!==0)return;let i=f.current,a=e.parentElement;if(!i||!a)return;let o=e.getBoundingClientRect(),s={x:r.clientX-o.left,y:r.clientY-o.top};if(i.getNodeAt(s))return;r.preventDefault(),r.stopImmediatePropagation(),he.current={clientX:r.clientX,clientY:r.clientY};let c=me.current,l=a.getBoundingClientRect();c&&(c.style.display=`block`,c.style.left=`${r.clientX-l.left}px`,c.style.top=`${r.clientY-l.top}px`,c.style.width=`0px`,c.style.height=`0px`),document.addEventListener(`mousemove`,t,!0),document.addEventListener(`mouseup`,n,!0)};return e.addEventListener(`mousedown`,r,!0),()=>{e.removeEventListener(`mousedown`,r,!0),document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0)}},[]),(0,j.useEffect)(()=>{let e=ut.trim();if(!e){pt(``),ht(null),vt(null),Ut(`hybrid`),Gt(0),qt(!1),f.current?.unselectAll();return}qt(!1);let t=setTimeout(()=>pt(e),300);return()=>clearTimeout(t)},[ut]),(0,j.useEffect)(()=>{let e=setTimeout(()=>{let e=Ke(Pt);Vt(e);try{window.localStorage.setItem(At,String(e))}catch{}},200);return()=>clearTimeout(e)},[Pt]);let Pn=(0,j.useCallback)(e=>{let t=f.current,n=C.current;if(!t||!n)return;let{updates:r,inWindow:i}=Ue(e,T.current,w.resolveNodeColour,wt);r.length>0&&(n.update(r),t.fit({nodes:i,animation:{duration:400,easingFunction:`easeInOutQuad`}}))},[]),Fn=Re(xe);(0,j.useEffect)(()=>{if(!ft)return;let e=!1;return vt(null),a(qe(ft,Fn.selectedLabels,Lt,Kt)).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{if(e)return;ht(t.results);let n=t.mode===`bm25`?`bm25`:`hybrid`;if(Ut(n),Gt(typeof t.suppressed==`number`?t.suppressed:0),n===`bm25`)try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-page`,msg:`[graph-page] search-result-degraded mode=bm25 query="${ft}"`}),keepalive:!0}).catch(()=>{})}catch{}let{nodes:r,edges:i}=We(t.results,Fn.selectedLabels);T.current=new Map(r.map(e=>[e.id,e])),Qe(r.length),Ye(null),jn(r,i),Pn(t.results),console.info(`[graph-page] search-applied view=${En.kind} q="${ft}" labels=${Fn.selectedLabels.join(`|`)} hits=${r.length}`)}).catch(t=>{e||vt(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[ft,Lt,o,s,a,Pn,En.kind,Fn.selectedLabels,jn,Kt]);let In=(0,j.useCallback)(e=>{Se(t=>{let n=Re(t),r=new Set(n.selectedLabels);return r.has(e)?r.delete(e):r.add(e),Ie({kind:`filter`,selectedLabels:[...r].sort(),includeTrashed:n.includeTrashed,includeAgentActions:n.includeAgentActions})})},[]),Ln=(0,j.useCallback)(()=>{Se(e=>{let t=Re(e);return Ie({...t,includeTrashed:!t.includeTrashed})})},[]),Rn=(0,j.useCallback)(()=>{Se(e=>{let t=Re(e);return Ie({...t,includeAgentActions:!t.includeAgentActions})})},[]),zn=(0,j.useCallback)(()=>{dt(``),pt(``),ht(null),vt(null),Ut(`hybrid`),Gt(0),qt(!1);try{f.current?.unselectAll()}catch{}},[]),Bn=(0,j.useCallback)(()=>{Se(()=>Ie({kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}))},[]),Vn=(0,j.useCallback)(()=>{rt(null);try{f.current?.unselectAll()}catch{}Se(e=>{let t=Fe(e);return t!==e&&Bt(`nav-pop`,{depth:t.length-1}),t})},[]),Hn=(0,j.useCallback)(()=>{rt(null);try{f.current?.unselectAll()}catch{}Se(e=>e.length<=1?e:(Bt(`nav-home`,{depth:0,popped:e.length-1}),[Re(e)]))},[]),Un=(0,j.useCallback)(()=>{let e=Re(xe),t={labels:[...e.selectedLabels].sort(),includeTrashed:e.includeTrashed};on(!0),a(`/api/admin/graph-default-view`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));throw Error(t.error??`HTTP ${e.status}`)}tn(t)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view-save`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}).finally(()=>on(!1))},[a,xe]),Wn=(0,j.useCallback)(()=>{rt(null);try{f.current?.unselectAll()}catch{}Yt(e=>e+1),Ve(`graph-restore`)},[]),Gn=(0,j.useCallback)(()=>{rt(null);try{f.current?.unselectAll()}catch{}Se(e=>[Re(e)]),Yt(e=>e+1),Ve(`graph-trash`)},[]),L=(0,j.useCallback)(()=>{Yt(e=>e+1),Zt(e=>e+1)},[]),R=En.kind===`neighbourhood`,Kn=Re(xe),qn=Kn.selectedLabels,Jn=Kn.includeTrashed,Yn=Kn.includeAgentActions,Xn=Me({inNeighbourhood:R,searchActive:!!ft}),Zn=(0,j.useMemo)(()=>{if(Jn!==en.includeTrashed||qn.length!==en.labels.length)return!0;for(let e=0;e<qn.length;e++)if(qn[e]!==en.labels[e])return!0;return!1},[Jn,qn,en]);return(0,I.jsxs)(`div`,{ref:v,className:yt(g,i),children:[(0,I.jsxs)(`div`,{className:`graph-toolbar`,children:[xe.length>1&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-desktop`,onClick:Hn,title:`Clear breadcrumb — return to filter root`,children:[(0,I.jsx)(k,{size:12}),` Home`]}),(0,I.jsx)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-mobile`,onClick:Hn,"aria-label":`Home`,title:`Clear breadcrumb — return to filter root`,children:(0,I.jsx)(k,{size:14})}),(0,I.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-desktop`,onClick:Vn,children:`← Back`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-mobile`,onClick:Vn,"aria-label":`Back`,children:(0,I.jsx)(x,{size:16})})]}),(0,I.jsxs)(`div`,{className:`data-search-input graph-search-input`,children:[(0,I.jsx)(te,{size:14}),(0,I.jsx)(`input`,{type:`text`,placeholder:`Search nodes…`,value:ut,onChange:e=>dt(e.target.value),autoComplete:`off`,spellCheck:!1}),ft&&!mt&&!_t&&(0,I.jsx)(p,{size:14,className:`spin`}),ut.length>0&&(0,I.jsx)(`button`,{type:`button`,className:`graph-search-clear`,onClick:zn,"aria-label":`Clear search`,title:`Clear search`,children:(0,I.jsx)(u,{size:14})})]}),ft&&(0,I.jsxs)(`div`,{className:`graph-search-limit`,title:`Show top ${Pt} matches (1-2000)`,children:[(0,I.jsx)(`label`,{htmlFor:`graph-search-limit-input`,className:`graph-search-limit-label`,children:`Top`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>Ft(Ke(Pt-1)),disabled:Pt<=1,"aria-label":`Decrement search limit`,title:`Decrement`,children:(0,I.jsx)(ie,{size:12})}),(0,I.jsx)(`input`,{id:`graph-search-limit-input`,type:`number`,min:1,max:2e3,step:1,value:Pt,onChange:e=>Ft(Ke(e.target.value)),className:`graph-search-limit-number`,"aria-label":`Maximum search results to render`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>Ft(Ke(Pt+1)),disabled:Pt>=2e3,"aria-label":`Increment search limit`,title:`Increment`,children:(0,I.jsx)(c,{size:12})}),(0,I.jsx)(`input`,{id:`graph-search-limit-slider`,type:`range`,min:1,max:2e3,step:1,value:Pt,onChange:e=>Ft(Ke(e.target.value)),"aria-label":`Maximum search results to render (drag for ballpark)`})]}),(0,I.jsx)(`button`,{type:`button`,className:`graph-refresh-button`,onClick:L,disabled:we,"aria-label":`Refresh graph`,title:`Refresh graph`,children:(0,I.jsx)(m,{size:14,className:we?`spin`:void 0})}),bt(i)&&(0,I.jsx)(`button`,{type:`button`,className:`graph-fullscreen-toggle`,onClick:()=>{g?xn(`button`):_(!0)},"aria-label":g?`Exit full screen`:`Full screen`,title:g?`Exit full screen`:`Full screen`,"aria-pressed":g,children:g?(0,I.jsx)(re,{size:14}):(0,I.jsx)(ee,{size:14})}),!R&&(0,I.jsxs)(`div`,{className:`graph-filter-wrap`,ref:cn,children:[(0,I.jsxs)(`button`,{type:`button`,className:`graph-filter-toggle${nn?` is-open`:``}${qn.length>0||Jn||Yn?` has-selection`:``}`,onClick:()=>rn(e=>!e),"aria-haspopup":`true`,"aria-expanded":nn,"aria-label":`Filter node types`,children:[(0,I.jsx)(h,{size:14}),(0,I.jsx)(`span`,{children:`Filter`}),qn.length>0&&(0,I.jsx)(`span`,{className:`graph-filter-count`,children:qn.length})]}),nn&&(0,I.jsxs)(`div`,{className:`graph-filter-popover`,role:`dialog`,"aria-label":`Node type filter`,children:[(0,I.jsxs)(`div`,{className:`graph-filter-popover-header`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`graph-toggle-trashed${Jn?` active`:``}`,onClick:Ln,"aria-pressed":Jn,title:`Show trashed nodes — restored with Restore button on each node`,children:[(0,I.jsx)(D,{size:14}),` Show trashed`]}),(qn.length>0||Jn||Yn)&&(0,I.jsx)(`button`,{type:`button`,className:`graph-filter-clear`,onClick:Bn,"aria-label":`Clear filter selection`,title:`Clear filter selection`,children:(0,I.jsx)(u,{size:14})})]}),(0,I.jsx)(`div`,{className:`graph-toggle-agent-actions`,title:`Hide ToolCall, StepResult, WorkflowStep, WorkflowRun — agent-execution telemetry. Flip on for audit/debug.`,children:(0,I.jsx)(y,{checked:Yn,onChange:Rn,label:`Include agent actions`})}),Qt.length===0&&(0,I.jsx)(`p`,{className:`graph-filter-popover-empty`,children:`No node types in your graph yet.`}),(0,I.jsx)(`div`,{className:`graph-filter-rows`,role:`group`,"aria-label":`Node type filter`,children:Qt.map(({label:e,nodeCount:t})=>{let n=qn.includes(e),r=(0,w.colourForLabel)(e);return(0,I.jsxs)(`button`,{type:`button`,className:`graph-filter-row${n?` active`:``}`,onClick:()=>In(e),"aria-pressed":n,children:[(0,I.jsx)(`span`,{className:`graph-filter-row-swatch`,style:{backgroundColor:r}}),(0,I.jsx)(`span`,{className:`graph-filter-row-label`,children:e}),(0,I.jsx)(`span`,{className:`graph-filter-row-count`,children:t})]},e)})}),(0,I.jsx)(`div`,{className:`graph-filter-popover-footer`,children:(0,I.jsx)(`button`,{type:`button`,className:`graph-filter-set-default`,onClick:Un,disabled:!Zn||an,children:an?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(p,{size:12,className:`spin`}),` Saving…`]}):`Set default view`})})]})]}),(0,I.jsx)(`div`,{className:`graph-meta`,children:Oe({inNeighbourhood:R,searchActive:!!ft,selectedLabelsCount:qn.length,topLevelTotal:$e,nodeCount:Xe})?(0,I.jsx)(`span`,{className:`graph-meta-count`,children:ke(Xe,$e)}):Xe>0&&(0,I.jsxs)(`span`,{className:`graph-meta-count`,children:[Xe,` node`,Xe===1?``:`s`]})})]}),xe.length>1&&(0,I.jsx)(zt,{viewStack:xe}),ft&&Ht===`bm25`&&!_t&&(0,I.jsx)(`div`,{className:`graph-error-banner graph-search-degraded`,role:`status`,children:`Vector ranking unavailable — showing keyword-only results.`}),_t&&(0,I.jsxs)(`div`,{className:`data-error graph-error-banner`,children:[`Search unavailable: `,_t]}),ft&&Wt>0&&!Kt&&!_t&&(0,I.jsxs)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>qt(!0),children:[Wt,` low-confidence match`,Wt===1?``:`es`,` hidden — show all`]}),ft&&Kt&&!_t&&(0,I.jsx)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>qt(!1),children:`Showing all matches — hide low-confidence`}),mt&&mt.length===0&&!_t&&(0,I.jsx)(`div`,{className:`graph-search-status`,children:`No matches in your graph.`}),(0,I.jsxs)(`div`,{className:`graph-canvas-wrap`,children:[je({loading:we,rendering:De,searchActive:!!ft})&&(0,I.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,I.jsx)(p,{size:20,className:`spin`}),` Loading your graph…`]}),Be&&!we&&!De&&(0,I.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,I.jsx)(`p`,{children:Be}),(0,I.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:()=>{Ge(null),Yt(e=>e+1)},children:`Retry`})]}),Je&&!we&&!De&&(0,I.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,I.jsxs)(`p`,{children:[`Refine your filter — `,(0,I.jsx)(`strong`,{children:Je.matched}),` matches exceed the 2000 cap.`]}),(0,I.jsx)(`p`,{className:`graph-canvas-hint`,children:`Pick a more specific label combination, or narrow your brand's data.`})]}),!we&&!De&&!Be&&!Je&&Xe===0&&!R&&qn.length===0&&(0,I.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,I.jsx)(h,{size:20}),(0,I.jsx)(`p`,{children:`No nodes in your graph yet.`})]}),!we&&!De&&!Be&&!Je&&Xe===0&&!R&&qn.length>0&&(0,I.jsx)(`div`,{className:`graph-canvas-overlay`,children:(0,I.jsxs)(`p`,{children:[`No `,qn.join(`, `),` nodes match this view.`]})}),(0,I.jsx)(`div`,{ref:d,className:`graph-canvas`}),(0,I.jsx)(`div`,{ref:me,className:`graph-marquee`,"aria-hidden":`true`}),Xe>0&&(0,I.jsx)(`div`,{ref:ce,className:`graph-trash-drop-zone${it?` is-hover`:``}${ot?` is-error`:``}`,"aria-hidden":`true`,children:(0,I.jsx)(l,{size:18})}),ct&&(0,I.jsxs)(`div`,{className:`graph-drag-error-banner`,role:`alert`,children:[(0,I.jsx)(`span`,{children:ct}),(0,I.jsx)(`button`,{type:`button`,className:`graph-drag-error-dismiss`,onClick:()=>lt(null),"aria-label":`Dismiss`,children:(0,I.jsx)(u,{size:14})})]}),Xe>0&&vn.length>0&&(0,I.jsxs)(`div`,{ref:ln,className:`graph-legend${pn?` is-collapsed`:``}`,style:dn?{"--legend-x":`${dn.x}px`,"--legend-y":`${dn.y}px`}:void 0,children:[(0,I.jsxs)(`div`,{className:`graph-legend-header`,onPointerDown:hn,onPointerMove:gn,onPointerUp:_n,children:[(0,I.jsx)(O,{size:13,className:`graph-legend-grip`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`graph-legend-title`,children:`Legend`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-legend-collapse`,onPointerDown:e=>e.stopPropagation(),onClick:()=>mn(e=>!e),"aria-label":pn?`Expand legend`:`Collapse legend`,"aria-expanded":!pn,children:pn?(0,I.jsx)(E,{size:14}):(0,I.jsx)(b,{size:14})})]}),(0,I.jsx)(`div`,{className:`graph-legend-body`,children:vn.map(e=>{let t=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(It,{label:e.label,shape:e.shape,colour:e.colour}),(0,I.jsx)(`span`,{className:`graph-legend-label`,children:e.label}),(0,I.jsx)(`span`,{className:`graph-legend-count`,children:e.count})]});if(!Xn)return(0,I.jsx)(`div`,{className:`graph-legend-item`,children:t},e.label);let n=qn.includes(e.label);return(0,I.jsx)(`button`,{type:`button`,className:`graph-legend-item graph-legend-item--interactive${n?` is-selected`:``}`,"aria-pressed":n,onClick:()=>{let t=n?`remove`:`add`,r=n?qn.length-1:qn.length+1;console.log(`[graph-page] op=legend-filter label=${e.label} action=${t} selected=${r}`),In(e.label)},children:t},e.label)})})]})]}),nt&&(0,I.jsx)(gt,{node:nt,edges:A.current,nodesById:T.current,adminFetch:a,onClose:()=>{rt(null);try{f.current?.unselectAll()}catch{}},onRestored:Wn,onTrashed:Gn})]})}var Rt=class extends Error{body;constructor(e){super(e.error),this.body=e}};function zt({viewStack:e}){let t=e.map(e=>e.kind===`filter`?`Filter`:e.rootLabel??`Node`);return(0,I.jsx)(`div`,{className:`graph-breadcrumb`,role:`navigation`,"aria-label":`Graph navigation breadcrumb`,children:t.map((e,n)=>(0,I.jsxs)(`span`,{className:`graph-breadcrumb-item`,children:[n>0&&(0,I.jsx)(`span`,{className:`graph-breadcrumb-separator`,"aria-hidden":`true`,children:`›`}),(0,I.jsx)(`span`,{className:`graph-breadcrumb-label${n===t.length-1?` is-current`:``}`,children:e})]},n))})}function Bt(e,t){let n=`[graph-page] ${e} ${Object.entries(t).map(([e,t])=>`${e}=${String(t)}`).join(` `)}`;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-nav`,msg:n}),keepalive:!0}).catch(()=>{})}catch{}}(0,ce.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(Pt,{}));
51
+ `)}function Ce(e){let{node:t,degree:n,revealed:r}=e,i=e.scale??1,a=t.labels[0]??`Unknown`,o=(0,w.resolveNodeColour)(t.labels),s=o.displayLabel,c=o.colour,l=s??a,u=(0,w.nodeImageDataUri)(l),d=u===null?l:null,f=ue(n),p=r?M(t,i):``,m=N(t),h=e.position?{x:e.position.x,y:e.position.y,physics:!1}:{},g;return g=t.trashed?u===null?{id:t.id,label:p,title:m,color:{background:`${c}40`,border:c},borderWidth:2,shapeProperties:{borderDashes:[6,4]},shape:(0,w.shapeForLabel)(l),size:f,group:a,...h}:{id:t.id,label:p,title:m,shape:`image`,image:u,size:f,opacity:.35,group:a,...h}:u===null?{id:t.id,label:p,title:m,color:c,shape:(0,w.shapeForLabel)(l),size:f,group:a,...h}:{id:t.id,label:p,title:m,shape:`image`,image:u,size:f,group:a,...h},{visNode:g,iconFallbackLabel:d}}function we(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(n[i]!==r[i]||JSON.stringify(e[n[i]])!==JSON.stringify(t[r[i]]))return!1;return!0}function Te(e,t){if(!!e.trashed!=!!t.trashed||e.labels.length!==t.labels.length)return!1;for(let n=0;n<e.labels.length;n++)if(e.labels[n]!==t.labels[n])return!1;return we(e.properties,t.properties)}function Ee(e,t){let n=[],r=[],i=new Set;for(let a of t){i.add(a.id);let t=e.get(a.id);t===void 0?n.push(a):Te(t,a)||r.push(a)}let a=[];for(let t of e.keys())i.has(t)||a.push(t);return{added:n,updated:r,removed:a}}function P(e,t){let n=[],r=new Set;for(let i of t)r.add(i.id),e.has(i.id)||n.push(i);let i=[];for(let t of e.keys())r.has(t)||i.push(t);return{added:n,removed:i}}function F(e,t){return e.added.length>0||e.updated.length>0||e.removed.length>0||t.added.length>0||t.removed.length>0}function De(e){let t=new URLSearchParams(e),n=t.get(`nodeId`);if(n)return{kind:`focus`,nodeId:n,nodeLabel:t.get(`label`)};let r=t.get(`label`);return r?{kind:`labels`,labels:[r]}:null}function Oe(e){return!e.inNeighbourhood&&!e.searchActive&&e.selectedLabelsCount===0&&e.topLevelTotal!==null&&e.nodeCount>0}function ke(e,t){let n=t===1?`node`:`nodes`;return`Showing ${e.toLocaleString()} of ${t.toLocaleString()} top-level ${n}`}function Ae(e){return typeof e.total==`number`?e.total:null}function je(e){return(e.loading||e.rendering)&&!e.searchActive}function Me(e){return!e.inNeighbourhood&&!e.searchActive}function Ne(e,t){let n=`/api/admin/graph-subgraph`,r=t.includeAgentActions?`&includeAgentActions=1`:``;if(e.kind===`neighbourhood`){let i=t.search&&t.search.q?`&q=${encodeURIComponent(t.search.q)}&limit=${t.search.limit}`:``;return`${n}?mode=neighbourhood&elementId=${encodeURIComponent(e.rootElementId)}${r}${i}`}let i=e.includeTrashed?`&includeTrashed=1`:``;return e.selectedLabels.length===0?`${n}?mode=default&topLevel=1${i}${r}`:`${n}?mode=default&labels=${encodeURIComponent(e.selectedLabels.join(`,`))}${i}${r}`}function Pe(e,t){return e.length<10?[...e,t]:[e[0],...e.slice(e.length-8),t]}function Fe(e){return e.length<=1?e:e.slice(0,-1)}function Ie(e){return[e]}function Le(e){let t=e[e.length-1];return t.kind===`filter`?`f:${[...t.selectedLabels].sort().join(`,`)}:${t.includeTrashed?1:0}:${t.includeAgentActions?1:0}`:`n:${t.rootElementId}`}function Re(e){let t=e[0];if(t.kind!==`filter`)throw Error(`view-stack invariant: root must be filter view`);return t}var ze=`admin-sessions`;function Be(){if(typeof window>`u`)return null;if(typeof BroadcastChannel>`u`)return console.warn(`[admin-sessions/broadcast] unsupported — manual refresh only`),null;try{return new BroadcastChannel(ze)}catch(e){return console.warn(`[admin-sessions/broadcast] ctor failed: ${e instanceof Error?e.message:String(e)} — manual refresh only`),null}}function Ve(e){let t=Be();if(t)try{let n={type:`mutated`,reason:e};t.postMessage(n)}catch(e){console.warn(`[admin-sessions/broadcast] postMessage failed: ${e instanceof Error?e.message:String(e)}`)}finally{try{t.close()}catch{}}}function He(e){return e.trashed===!0?`skip-trashed`:`pivot`}function Ue(e,t,n,r){let i=[],a=[];for(let o of e){let e=t.get(o.nodeId);if(!e)continue;a.push(o.nodeId);let{colour:s}=n(e.labels),c=e.trashed?`${s}40`:s;i.push({id:o.nodeId,borderWidth:3,color:{background:c,border:r}})}return{updates:i,inWindow:a}}function We(e,t){let n=t.length>0?new Set(t):null,r=new Map,i=new Set,a=[];for(let t of e)n&&!t.labels.some(e=>n.has(e))||r.set(t.nodeId,{id:t.nodeId,labels:t.labels,properties:t.properties});for(let t of e)if(r.has(t.nodeId))for(let e of t.related){if(n&&!e.labels.some(e=>n.has(e)))continue;r.has(e.nodeId)||r.set(e.nodeId,{id:e.nodeId,labels:e.labels,properties:e.properties});let[o,s]=e.direction===`outgoing`?[t.nodeId,e.nodeId]:[e.nodeId,t.nodeId],c=`${o}|${s}|${e.relationship}`;i.has(c)||(i.add(c),a.push({id:c,from:o,to:s,type:e.relationship}))}return{nodes:[...r.values()],edges:a}}var Ge=2e3;function Ke(e){let t=typeof e==`number`?e:Number(e);return!Number.isFinite(t)||t<=0?100:Math.min(Math.max(Math.floor(t),1),Ge)}function qe(e,t,n,r){let i=encodeURIComponent(t.join(`,`));return`/api/admin/graph-search?q=${encodeURIComponent(e)}&labels=${i}&limit=${n}${r?`&threshold=0`:``}`}var Je={solver:`forceAtlas2Based`,forceAtlas2Based:{gravitationalConstant:-50,centralGravity:.01,springLength:100,springConstant:.08,damping:.4,avoidOverlap:0},stabilization:{iterations:2e3}},Ye=220,Xe=3;function Ze(e){if(!(e.nodes.length<=5))return{physics:Je,nodePositions:new Map};let t=new Map,n=(Xe-1)*Ye/2,r=(Math.ceil(e.nodes.length/Xe)-1)*Ye/2;for(let i=0;i<e.nodes.length;i++){let a=i%Xe,o=Math.floor(i/Xe);t.set(e.nodes[i].id,{x:a*Ye-n,y:o*Ye-r})}return{physics:!1,nodePositions:t}}function Qe(e,t){let n=(t.t-e.t)/1e3;if(n<=0)return 0;let r=0,i=0;for(let n of Object.keys(t.positions)){let a=e.positions[n];if(!a)continue;let o=t.positions[n];r+=Math.hypot(o.x-a.x,o.y-a.y),i++}return i===0?0:r/i/n}function $e(e,t,n){if(t>n.threshold)return{belowCount:0,freeze:!1};let r=e+1;return{belowCount:r,freeze:r>=n.needed}}function et(e,t){let n=Date.now(),r=null,i=0,a=null,o=()=>{a!==null&&(clearInterval(a),a=null)},s=(r,i,a)=>{o();try{e.setOptions({physics:!1})}catch{}t.report?.({avgMotion:r,settleMs:Date.now()-n,capped:a,nodeCount:i})};return a=setInterval(()=>{let t;try{t=e.getPositions()}catch{o();return}let a={t:Date.now(),positions:t},c=Object.keys(t).length;if(r){let e=Qe(r,a),t=$e(i,e,{threshold:5,needed:2});if(i=t.belowCount,t.freeze){s(e,c,!1);return}if(Date.now()-n>=3e4){s(e,c,!0);return}}r=a},250),o}var tt=`graph-side-panel-size`;function nt(e,t){let n=Math.max(280,t.maxWidth),r=Math.max(240,t.maxHeight),i=Math.min(Math.max(e.width,280),n),a=Math.min(Math.max(e.height,240),r);return{width:i,height:a,clampedW:i!==e.width,clampedH:a!==e.height}}function rt(e){try{localStorage.setItem(tt,JSON.stringify({width:e.width,height:e.height}))}catch{}}function it(){try{let e=localStorage.getItem(tt);if(!e)return{size:null,source:`default`};let t=JSON.parse(e);return t&&typeof t==`object`&&typeof t.width==`number`&&typeof t.height==`number`&&Number.isFinite(t.width)&&Number.isFinite(t.height)?{size:{width:t.width,height:t.height},source:`storage`}:{size:null,source:`default`}}catch{return{size:null,source:`default`}}}function at(e){return typeof e==`string`?/^https?:\/\/\S+$/i.test(e.trim()):!1}function ot(e){let t=t=>{let n=e[t];if(n&&typeof n==`object`&&`low`in n){let e=n.low;return typeof e==`number`?e:null}return null},n=t(`year`),r=t(`month`),i=t(`day`);if(n===null||r===null||i===null)return null;let a=`${String(n).padStart(4,`0`)}-${String(r).padStart(2,`0`)}-${String(i).padStart(2,`0`)}`;if(!(`hour`in e))return a;let o=t(`hour`),s=t(`minute`),c=t(`second`);return o===null||s===null||c===null?a:`${a} ${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`}function st(e){if(e==null)return``;if(Array.isArray(e))return e.length>8?`[${e.length} items]`:e.map(String).join(`, `);if(typeof e==`object`){if(`year`in e&&`month`in e&&`day`in e&&typeof e.year==`object`){let t=ot(e);if(t)return t}return JSON.stringify(e)}return String(e)}var I=a(),ct=76,lt=36,ut=16,dt=520;function ft(e){let t=e?.offsetParent??null,n=t?.clientWidth??0,r=t?.clientHeight??0;return{maxWidth:n-lt-ut,maxHeight:r-ct-ut}}function pt(e){return typeof e==`string`?e:st(e)}function mt(e){return at(e)?(0,I.jsx)(`a`,{className:`graph-side-link`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:e}):st(e)}function ht({value:e,label:t,field:r}){let{status:i,copy:a}=T({onResult:e=>{e?console.log(`[graph-panel] op=copy result=ok field=${r}`):console.warn(`[graph-panel] op=copy result=error field=${r} msg=clipboard-write-failed`)}}),o=i===`ok`?`Copied`:i===`fail`?`Copy failed`:`Copy ${t}`;return(0,I.jsxs)(`button`,{type:`button`,className:`graph-side-copy${i===`ok`?` graph-side-copy-ok`:``}${i===`fail`?` graph-side-copy-fail`:``}`,onClick:()=>a(e),"aria-label":o,title:o,children:[i===`ok`?(0,I.jsx)(n,{size:12}):(0,I.jsx)(S,{size:12}),i!==`idle`&&(0,I.jsx)(`span`,{className:`graph-side-copy-feedback`,children:i===`ok`?`Copied`:`Copy failed`})]})}function gt({node:e,edges:t,nodesById:n,adminFetch:r,onClose:i,onRestored:a,onTrashed:o}){let s=Object.entries(e.properties).filter(([,e])=>e!=null),c=t.filter(t=>t.from===e.id||t.to===e.id),d=c.length>0,[f,m]=(0,j.useState)(!1),[h,_]=(0,j.useState)(null),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(null),[S,ee]=(0,j.useState)(`properties`),te=g(`(max-width: 640px)`),w=(0,j.useRef)(null),ne=(0,j.useRef)(it()),[T,E]=(0,j.useState)(()=>ne.current.size??{width:280,height:dt}),D=(0,j.useRef)(!1),O=(0,j.useRef)(null);(0,j.useEffect)(()=>()=>{O.current?.()},[]),(0,j.useEffect)(()=>{m(!1),_(null),y(!1),x(null),ee(`properties`)},[e.id]),(0,j.useLayoutEffect)(()=>{if(D.current)return;D.current=!0;let e=ft(w.current),t=nt(ne.current.size??{width:280,height:dt},e);E({width:t.width,height:t.height}),console.log(`[graph-panel] op=restore-size w=${t.width} h=${t.height} source=${ne.current.source}`)},[]);let k=(0,j.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=e.clientY,r=T.width,i=T.height,a=ft(w.current);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}let o={width:r,height:i,clampedW:!1,clampedH:!1},s=e=>{o=nt({width:r+(t-e.clientX),height:i+(e.clientY-n)},a),E({width:o.width,height:o.height})},c=()=>{window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l),O.current=null},l=()=>{c(),rt({width:o.width,height:o.height}),console.log(`[graph-panel] op=resize w=${o.width} h=${o.height} clampedW=${o.clampedW} clampedH=${o.clampedH}`)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l),O.current=c},[T.width,T.height]),re=(0,j.useCallback)(()=>{m(!0),_(null),r(`/api/admin/graph-restore`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);a()}).catch(e=>{_(e instanceof Error?e.message:String(e)),m(!1)})},[e.id,a,r]),ie=(0,j.useCallback)(()=>{y(!0),x(null),r(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id,by:`graph-side-panel-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);o()}).catch(e=>{x(e instanceof Error?e.message:String(e)),y(!1)})},[e.id,o,r]),A=S===`connections`&&d?`connections`:`properties`,ae=te?void 0:{width:`${T.width}px`,height:`${T.height}px`};return(0,I.jsxs)(`aside`,{ref:w,className:`graph-side-panel${e.trashed?` graph-side-panel-trashed`:``}`,style:ae,children:[!te&&(0,I.jsx)(`div`,{className:`graph-side-resize-handle`,role:`separator`,"aria-label":`Resize panel`,"aria-orientation":`vertical`,onPointerDown:k}),(0,I.jsxs)(`header`,{className:`graph-side-header`,children:[(0,I.jsx)(`div`,{children:(()=>{if(e.labels.some(e=>pe.has(e))){let t=(0,de.pickDisplayName)(e),n=e.properties.createdAt,r=typeof n==`string`?n:``,i=r?(0,de.formatRunTimestamp)(r):null,a=e.labels.join(` · `)+(e.trashed?` · Trashed`:``)+` · ${e.id}`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h2`,{className:`graph-side-name`,title:t,children:t}),i&&(0,I.jsx)(`div`,{className:`graph-side-created`,children:i}),(0,I.jsxs)(`div`,{className:`graph-side-meta`,children:[(0,I.jsx)(`span`,{children:a}),(0,I.jsx)(ht,{value:e.id,label:`id`,field:`id`})]})]})}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`graph-side-labels`,children:[e.labels.join(` · `),e.trashed?` · Trashed`:``]}),(0,I.jsxs)(`div`,{className:`graph-side-id-row`,children:[(0,I.jsx)(`span`,{className:`graph-side-id`,children:e.id}),(0,I.jsx)(ht,{value:e.id,label:`id`,field:`id`})]})]})})()}),(0,I.jsx)(`button`,{type:`button`,className:`graph-side-close`,onClick:i,"aria-label":`Close`,children:(0,I.jsx)(u,{size:14})})]}),e.trashed&&(0,I.jsxs)(`dl`,{className:`graph-side-props graph-side-trash-meta`,children:[(0,I.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,I.jsx)(`dt`,{children:`trashedAt`}),(0,I.jsx)(`dd`,{children:st(e.properties.trashedAt)})]}),(0,I.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,I.jsx)(`dt`,{children:`trashedBy`}),(0,I.jsx)(`dd`,{children:st(e.properties.trashedBy)})]})]}),(0,I.jsxs)(`div`,{className:`graph-side-tabs`,role:`tablist`,"aria-label":`Node detail sections`,children:[(0,I.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`properties`,className:`graph-side-tab${A===`properties`?` graph-side-tab-on`:``}`,onClick:()=>ee(`properties`),children:`Properties`}),d&&(0,I.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`connections`,className:`graph-side-tab${A===`connections`?` graph-side-tab-on`:``}`,onClick:()=>ee(`connections`),children:[`Connections (`,c.length,`)`]})]}),(0,I.jsxs)(`div`,{className:`graph-side-body`,children:[A===`properties`&&(0,I.jsxs)(`dl`,{className:`graph-side-props`,children:[s.length===0&&(0,I.jsx)(`div`,{className:`graph-side-empty`,children:`No properties.`}),s.map(([e,t])=>(0,I.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,I.jsx)(`dt`,{children:e}),(0,I.jsxs)(`dd`,{children:[(0,I.jsx)(`span`,{className:`graph-side-prop-value`,children:mt(t)}),(0,I.jsx)(ht,{value:pt(t),label:e,field:`prop`})]})]},e))]}),A===`connections`&&d&&(0,I.jsx)(`section`,{className:`graph-side-edges`,children:c.map(t=>{let r=t.from===e.id,i=r?t.to:t.from,a=n.get(i),o=a?(0,de.pickShortLabel)(a):i,s=r?`→`:`←`,c=Object.entries(t.properties??{}).filter(([,e])=>e!=null&&e!==``);return(0,I.jsxs)(`div`,{className:`graph-side-edge`,children:[(0,I.jsxs)(`div`,{className:`graph-side-edge-header`,children:[(0,I.jsx)(`span`,{className:`graph-side-edge-type`,children:t.type}),(0,I.jsx)(`span`,{className:`graph-side-edge-arrow`,children:s}),(0,I.jsx)(`span`,{className:`graph-side-edge-other`,title:o,children:o})]}),c.length>0&&(0,I.jsx)(`dl`,{className:`graph-side-edge-props`,children:c.map(([e,t])=>(0,I.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,I.jsx)(`dt`,{children:e}),(0,I.jsxs)(`dd`,{children:[(0,I.jsx)(`span`,{className:`graph-side-prop-value`,children:mt(t)}),(0,I.jsx)(ht,{value:pt(t),label:e,field:`edge-prop`})]})]},e))})]},t.id)})})]}),e.trashed&&(0,I.jsxs)(`footer`,{className:`graph-side-footer`,children:[!f&&!h&&(0,I.jsxs)(`button`,{type:`button`,className:`graph-side-restore`,onClick:re,children:[(0,I.jsx)(C,{size:14}),` Restore`]}),f&&(0,I.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,I.jsxs)(`p`,{children:[(0,I.jsx)(p,{size:14,className:`spin`}),` Restoring…`]})}),h&&(0,I.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,I.jsxs)(`p`,{children:[`Restore failed: `,h]}),(0,I.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,I.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{_(null)},children:`Close`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:re,children:`Retry`})]})]})]}),!e.trashed&&(0,I.jsxs)(`footer`,{className:`graph-side-footer`,children:[!v&&!b&&(0,I.jsxs)(`button`,{type:`button`,className:`graph-side-trash`,onClick:ie,children:[(0,I.jsx)(l,{size:14}),` Trash`]}),v&&(0,I.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,I.jsxs)(`p`,{children:[(0,I.jsx)(p,{size:14,className:`spin`}),` Trashing…`]})}),b&&(0,I.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,I.jsxs)(`p`,{children:[`Trash failed: `,b]}),(0,I.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,I.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{x(null)},children:`Close`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:ie,children:`Retry`})]})]})]})]})}var _t=`graph-shell`,vt=`graph-shell--fullscreen`;function yt(e,t){return t&&e?`${_t} ${vt}`:_t}function bt(e){return e}function xt(e){return e.isFullscreen&&!e.filterOpen}function St(e){return e<.7?`compact`:e<1.3?`wrapped`:`detailed`}var Ct=150,wt=`#FBBF24`;function Tt(e,t,n){let r=getComputedStyle(e).getPropertyValue(t).trim();return r.length>0?r:n}var Et=`#0F172A`,Dt=`#475569`,Ot=`#CBD5E1`;function kt(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}var At=`maxy-graph-search-limit-v1`,jt=250,Mt=12e3,Nt=1200;function Pt(){let[e,t]=(0,j.useState)(null),[n,r]=(0,j.useState)(!1),[i,a]=(0,j.useState)(void 0),[o,s]=(0,j.useState)(null),[c,l]=(0,j.useState)(void 0),[u,m]=(0,j.useState)(null),[h,g]=(0,j.useState)(null),v=(0,j.useMemo)(()=>typeof window>`u`?null:De(window.location.search),[]),b=(0,j.useMemo)(()=>v?.kind===`focus`?{nodeId:v.nodeId,nodeLabel:v.nodeLabel}:null,[v]),x=(0,j.useMemo)(()=>v?.kind===`labels`?v.labels:null,[v]);(0,j.useEffect)(()=>{b&&Bt(`deep-link`,{nodeId:b.nodeId.length>16?b.nodeId.slice(0,16)+`…`:b.nodeId,label:b.nodeLabel??``})},[b]),(0,j.useEffect)(()=>{!x||x.length===0||Bt(`label-seed`,{label:x[0]})},[x]),(0,j.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&a(e.businessName),e.sessionId!==void 0&&s(e.sessionId??null),g(e.role??null),l(e.userName===void 0?null:e.userName),m(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let S=(0,j.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[ee,C]=(0,j.useState)(!1),te=(0,j.useCallback)(async()=>{C(!0);try{let e=await y();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{C(!1)}},[]);return n?e?(0,I.jsx)(d,{cacheKey:e,surface:`graph`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=graph`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,I.jsx)(_,{cacheKey:e,businessName:i,sessionId:o,onLogout:S,onDisconnect:te,disconnecting:ee,userName:c,userAvatar:u,role:h,children:(0,I.jsxs)(`div`,{className:`data-page graph-page`,children:[(0,I.jsx)(`header`,{className:`data-header`,children:(0,I.jsxs)(`h1`,{className:`data-title`,children:[(0,I.jsx)(f,{size:18}),` Graph`]})}),(0,I.jsx)(`main`,{className:`graph-main`,children:(0,I.jsx)(Lt,{cacheKey:e,initialFocus:b,initialLabels:x,allowFullscreen:!0})})]})})}):(0,I.jsxs)(`div`,{className:`data-page`,children:[(0,I.jsx)(`header`,{className:`data-header`,children:(0,I.jsxs)(`h1`,{className:`data-title`,children:[(0,I.jsx)(f,{size:18}),` Graph`]})}),(0,I.jsxs)(`div`,{className:`data-empty`,children:[(0,I.jsx)(`p`,{children:`You are not signed in.`}),(0,I.jsxs)(`p`,{children:[`Open the `,(0,I.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,I.jsx)(`div`,{className:`data-page`,children:(0,I.jsxs)(`div`,{className:`data-loading`,children:[(0,I.jsx)(p,{size:18,className:`spin`}),` Loading…`]})})}var Ft={triangle:`7,1 13,13 1,13`,triangleDown:`1,1 13,1 7,13`,square:`2,2 12,2 12,12 2,12`,diamond:`7,1 13,7 7,13 1,7`,star:`7,1 8.8,5.2 13,5.2 9.6,8 10.9,12.4 7,9.7 3.1,12.4 4.4,8 1,5.2 5.2,5.2`,hexagon:`4,1.5 10,1.5 13,7 10,12.5 4,12.5 1,7`};function It({label:e,shape:t,colour:n}){let r=(0,w.nodeImageDataUri)(e);return r===null?(0,I.jsx)(`svg`,{className:`graph-legend-swatch`,viewBox:`0 0 14 14`,width:`14`,height:`14`,"aria-hidden":`true`,children:t===`dot`?(0,I.jsx)(`circle`,{cx:`7`,cy:`7`,r:`6`,fill:n}):(0,I.jsx)(`polygon`,{points:Ft[t],fill:n})}):(0,I.jsx)(`img`,{className:`graph-legend-swatch`,src:r,width:14,height:14,alt:``,"aria-hidden":`true`})}function Lt({cacheKey:e,initialFocus:t=null,initialLabels:n=null,allowFullscreen:i=!1}){let{adminFetch:a,cacheKey:o,sessionRefetchNonce:s}=r({initialCacheKey:e,surface:`graph`}),d=(0,j.useRef)(null),f=(0,j.useRef)(null),[g,_]=(0,j.useState)(!1),y=(0,j.useRef)(null),S=(0,j.useRef)(null),C=(0,j.useRef)(null),ne=(0,j.useRef)(null),T=(0,j.useRef)(new Map),A=(0,j.useRef)([]),ae=(0,j.useRef)(null),ce=(0,j.useRef)(null),de=(0,j.useRef)(null),pe=(0,j.useRef)([]),me=(0,j.useRef)(null),he=(0,j.useRef)(null),ge=(0,j.useRef)(null),_e=(0,j.useRef)(null),ve=(0,j.useRef)(!1),ye=(0,j.useRef)(!1),be=(0,j.useRef)(!1),[xe,Se]=(0,j.useState)([{kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}]);(0,j.useEffect)(()=>{t?.nodeId&&Se(e=>{let n=e[e.length-1];return n.kind===`neighbourhood`&&n.rootElementId===t.nodeId?e:[e[0],{kind:`neighbourhood`,rootElementId:t.nodeId,rootLabel:t.nodeLabel}]})},[t?.nodeId,t?.nodeLabel]);let N=n&&n.length>0?[...n].sort().join(`,`):null;(0,j.useEffect)(()=>{N&&(sn.current=!0,Se([{kind:`filter`,selectedLabels:N.split(`,`),includeTrashed:!1,includeAgentActions:!1}]))},[N]);let[we,Te]=(0,j.useState)(!1),[De,ze]=(0,j.useState)(!1),[Be,Ge]=(0,j.useState)(null),[Je,Ye]=(0,j.useState)(null),[Xe,Qe]=(0,j.useState)(0),[$e,tt]=(0,j.useState)(null),[nt,rt]=(0,j.useState)(null),[it,at]=(0,j.useState)(!1),[ot,st]=(0,j.useState)(!1),[ct,lt]=(0,j.useState)(null),[ut,dt]=(0,j.useState)(``),[ft,pt]=(0,j.useState)(``),[mt,ht]=(0,j.useState)(null),[_t,vt]=(0,j.useState)(null),[Pt,Ft]=(0,j.useState)(()=>{if(typeof window>`u`)return 100;let e=window.localStorage.getItem(At);return e?Ke(e):100}),[Lt,Vt]=(0,j.useState)(Pt),[Ht,Ut]=(0,j.useState)(`hybrid`),[Wt,Gt]=(0,j.useState)(0),[Kt,qt]=(0,j.useState)(!1),[Jt,Yt]=(0,j.useState)(0),[Xt,Zt]=(0,j.useState)(0),[Qt,$t]=(0,j.useState)([]),[en,tn]=(0,j.useState)({labels:[],includeTrashed:!1}),[nn,rn]=(0,j.useState)(!1),[an,on]=(0,j.useState)(!1),sn=(0,j.useRef)(!1),cn=(0,j.useRef)(null),ln=(0,j.useRef)(null),un=(0,j.useRef)(null),[dn,fn]=(0,j.useState)(null),[pn,mn]=(0,j.useState)(!1),hn=(0,j.useCallback)(e=>{let t=ln.current;if(!t)return;let n=t.getBoundingClientRect();un.current={dx:e.clientX-n.left,dy:e.clientY-n.top};try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}},[]),gn=(0,j.useCallback)(e=>{let t=un.current,n=ln.current,r=n?.offsetParent;if(!t||!n||!r)return;let i=r.getBoundingClientRect(),a=Math.max(0,r.clientWidth-n.offsetWidth),o=Math.max(0,r.clientHeight-n.offsetHeight);fn({x:Math.min(Math.max(0,e.clientX-i.left-t.dx),a),y:Math.min(Math.max(0,e.clientY-i.top-t.dy),o)})},[]),_n=(0,j.useCallback)(e=>{un.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),vn=(0,j.useMemo)(()=>fe(T.current.values()),[Xe]);(0,j.useEffect)(()=>{let e=!1,t=a(`/api/admin/graph-labels-in-graph`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[]}}),n=a(`/api/admin/graph-default-view`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[],includeTrashed:!1}});return Promise.all([t,n]).then(([t,n])=>{if(!e&&($t(t.labels),tn(n),!sn.current)){sn.current=!0;let e=new Set(t.labels.map(e=>e.label)),r=n.labels.filter(t=>e.has(t));(r.length>0||n.includeTrashed)&&Se(e=>[{kind:`filter`,selectedLabels:r,includeTrashed:n.includeTrashed,includeAgentActions:!1},...e.slice(1)])}}),()=>{e=!0}},[o,s,a]);let yn=xe[0].kind===`filter`?xe[0].includeAgentActions:!1;(0,j.useEffect)(()=>{if(!sn.current)return;let e=!1;return a(`/api/admin/graph-labels-in-graph?includeAgentActions=${yn?`1`:`0`}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(t=>{e||$t(t.labels)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph-refetch`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}),()=>{e=!0}},[o,s,yn,Xt,a]),(0,j.useEffect)(()=>{if(!nn)return;let e=e=>{cn.current&&(cn.current.contains(e.target)||rn(!1))},t=e=>{e.key===`Escape`&&rn(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[nn]);let bn=(0,j.useCallback)((e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:e,msg:t}),keepalive:!0}).catch(()=>{})}catch{}},[]),xn=(0,j.useCallback)(e=>{console.log(`[graph-fullscreen] op=exit reason=${e}`),_(!1)},[]);(0,j.useEffect)(()=>{if(!i||!g)return;let e=e=>{e.key===`Escape`&&xt({isFullscreen:g,filterOpen:nn})&&xn(`escape`)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i,g,nn,xn]);let Sn=(0,j.useRef)(g);(0,j.useEffect)(()=>{if(!i)return;let e=Sn.current!==g;if(Sn.current=g,!e)return;let t=requestAnimationFrame(()=>{let e=f.current;try{e?.redraw()}catch{}if(!g)return;let t=y.current?.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=t?Math.round(t.width):0,a=t?Math.round(t.height):0;console.log(`[graph-fullscreen] op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`),t&&(t.width<n-2||t.height<r-2)&&bn(`graph-fullscreen-not-covering`,`op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`);try{let t=e?.canvas?.frame?.canvas,n=d.current;if(t&&n){let e=t.clientWidth,r=t.clientHeight,i=n.clientWidth,a=n.clientHeight;console.log(`[graph-fullscreen] op=resized canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`),(Math.abs(e-i)>2||Math.abs(r-a)>2)&&bn(`graph-fullscreen-canvas-mismatch`,`canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`)}}catch{}});return()=>cancelAnimationFrame(t)},[i,g,bn]);let Cn=(0,j.useCallback)(()=>{if(C.current)try{C.current.clear()}catch{}if(ne.current)try{ne.current.clear()}catch{}},[]),wn=(0,j.useCallback)((e,t)=>{lt(null),a(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);rt(null);try{f.current?.unselectAll()}catch{}Se(e=>[Re(e)]),Yt(e=>e+1),Ve(`graph-trash`)}).catch(n=>{let r=n instanceof Error?n.message:String(n);lt(`Failed to delete: ${r}`),st(!0),window.setTimeout(()=>st(!1),Nt);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete`,elementId:e,label:t,msg:r}),keepalive:!0}).catch(()=>{})}catch{}})},[a]),Tn=(0,j.useCallback)(e=>{lt(null);let t=e.length;Promise.allSettled(e.map(e=>a(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async t=>{let n=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(n.error??`HTTP ${t.status}`);return e}))).then(e=>{let n=e.filter(e=>e.status===`rejected`);rt(null);try{f.current?.unselectAll()}catch{}if(Se(e=>[Re(e)]),Yt(e=>e+1),Ve(`graph-trash`),n.length>0){let e=t-n.length;lt(e===0?`Failed to delete ${t} node${t===1?``:`s`}.`:`Deleted ${e} of ${t}; ${n.length} failed.`),st(!0),window.setTimeout(()=>st(!1),Nt);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete-batch`,total:t,failed:n.length}),keepalive:!0}).catch(()=>{})}catch{}}})},[a]),En=xe[xe.length-1],Dn=(0,j.useMemo)(()=>Le(xe),[xe]),On=(0,j.useRef)(Dn);(0,j.useEffect)(()=>{On.current=Dn},[Dn]);let kn=(0,j.useRef)(xe);(0,j.useEffect)(()=>{kn.current=xe},[xe]),(0,j.useEffect)(()=>{if(ft){ae.current?.abort(),ae.current=null;return}let e=window.setTimeout(()=>{ae.current?.abort();let e=new AbortController;ae.current=e,Te(!0),console.log(`[graph-page] op=render-spinner state=shown reason=fetch-start`),Ge(null),Ye(null),a(Ne(En,{includeAgentActions:Re(xe).includeAgentActions,search:null}),{signal:e.signal}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(e.status===413)throw new Rt(t);if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{e.signal.aborted||(T.current=new Map(t.nodes.map(e=>[e.id,e])),Qe(t.nodes.length),tt(Ae(t)),jn(t.nodes,t.edges))}).catch(t=>{if(!e.signal.aborted){if(ze(!1),t instanceof Rt){console.log(`[graph-page] op=render-spinner state=hidden reason=ceiling`),Ye(t.body),Qe(0),T.current=new Map,Cn();return}console.log(`[graph-page] op=render-spinner state=hidden reason=error`),Ge(t instanceof Error?t.message:String(t))}}).finally(()=>{e.signal.aborted||Te(!1)})},jt);return()=>{window.clearTimeout(e)}},[o,Dn,Jt,s,ft,Lt]),(0,j.useEffect)(()=>{be.current=we},[we]);let An=(0,j.useCallback)((e,t)=>{let n=C.current,r=ne.current;if(!n||!r||!f.current)return{added:0,updated:0,removed:0,edgesAdded:0,edgesRemoved:0,maxDegree:0};let i=Ee(T.current,e),a=P(new Map(A.current.map(e=>[e.id,e])),t);if(!F(i,a))return{added:0,updated:0,removed:0,edgesAdded:0,edgesRemoved:0,maxDegree:0};let o=le(t),s=0;for(let e of o.values())e>s&&(s=e);let c=(()=>{try{return f.current.getScale()||1}catch{return 1}})();a.removed.length>0&&r.remove(a.removed);let l=new Set(e.map(e=>e.id)),u=a.added.filter(e=>e.type!==`PART_OF`||l.has(e.from)&&l.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type}));u.length>0&&r.add(u),i.removed.length>0&&n.remove(i.removed);let d=i.updated.map(e=>e.id),p=d.length>0?(()=>{try{return f.current.getPositions(d)}catch{return{}}})():{},m=new Set(i.added.map(e=>e.id)),h=[...i.added,...i.updated];for(let e of h){let{visNode:t}=Ce({node:e,degree:o.get(e.id)??0,revealed:ve.current,scale:c,position:m.has(e.id)?void 0:p[e.id]});n.update(t)}let g=new Set(h.map(e=>e.id));for(let t of e){if(g.has(t.id))continue;let e=ue(o.get(t.id)??0),r=n.get(t.id);r&&r.size!==e&&n.update({id:t.id,size:e})}return T.current=new Map(e.map(e=>[e.id,e])),A.current=t,Qe(e.length),{added:i.added.length,updated:i.updated.length,removed:i.removed.length,edgesAdded:u.length,edgesRemoved:a.removed.length,maxDegree:s}},[Qe]);(0,j.useEffect)(()=>{if(En.kind!==`filter`||ft)return;let e=Ne(En,{includeAgentActions:Re(xe).includeAgentActions,search:null}),t=!1,n=null,r=(e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-poll`,op:e,view:En.kind,...t}),keepalive:!0}).catch(()=>{})}catch{}},i=()=>{if(document.hidden||be.current)return;n?.abort();let i=new AbortController;n=i;let o=Date.now();a(e,{signal:i.signal}).then(e=>e.ok?e.json():null).then(e=>{if(t||i.signal.aborted||!e||!Array.isArray(e.nodes))return;let n=An(e.nodes,e.edges??[]),a=Ae(e);tt(a),r(`tick`,{fetchMs:Date.now()-o,total:a,...n})}).catch(e=>{i.signal.aborted||r(`poll-error`,{msg:e instanceof Error?e.message:String(e)})})};r(`start`,{intervalMs:Mt});let o=window.setInterval(i,Mt),s=()=>{document.visibilityState===`visible`?(r(`resume`,{}),i()):r(`pause`,{})};return document.addEventListener(`visibilitychange`,s),()=>{t=!0,n?.abort(),window.clearInterval(o),document.removeEventListener(`visibilitychange`,s),r(`stop`,{})}},[o,Dn,ft,s,En.kind]),(0,j.useEffect)(()=>()=>{ae.current?.abort(),S.current?.(),S.current=null,f.current?.destroy(),f.current=null,_e.current!==null&&(clearTimeout(_e.current),_e.current=null)},[]);let jn=(0,j.useCallback)((e,t)=>{if(!d.current)return;ze(!0),A.current=t;let n=new Set([`Message`,`UserMessage`,`AssistantMessage`]),r=e=>e.labels.some(e=>n.has(e)),i=new Map,a=e.filter(r);if(a.length>0){let e=new Set(a.map(e=>e.id)),n=new Map,r=new Set;for(let i of t)i.type===`NEXT`&&e.has(i.from)&&e.has(i.to)&&(n.set(i.from,i.to),r.add(i.to));let o=[],s=new Set;for(let e of a){if(r.has(e.id))continue;let t=e.id;for(;t&&!s.has(t);)s.add(t),o.push(t),t=n.get(t)}for(let e of a)s.has(e.id)||(o.push(e.id),s.add(e.id));let c=d.current?.clientWidth??1200,l=Math.max(c-160,300),u=Math.max(Math.floor(l/150),2);o.forEach((e,t)=>{let n=t%u,r=Math.floor(t/u);i.set(e,{x:n*150,y:r*90})})}let o=le(t),s=0,c=new Set,l=e.map(e=>{(0,w.resolveNodeColour)(e.labels).driftCandidates;let t=o.get(e.id)??0;t>s&&(s=t);let{visNode:n,iconFallbackLabel:r}=Ce({node:e,degree:t,revealed:ve.current,scale:1,position:i.get(e.id)});return r!==null&&c.add(r),n}),u=new Set(l.map(e=>e.id)),p=t.filter(e=>e.type!==`PART_OF`||u.has(e.from)&&u.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type})),m=Ze({nodes:e,edges:t});C.current=new oe.DataSet(m.nodePositions.size>0?l.map(e=>{if(e.x!==void 0||e.y!==void 0)return e;let t=m.nodePositions.get(e.id);return t?{...e,x:t.x,y:t.y,physics:!1}:e}):l),ne.current=new oe.DataSet(p);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-style`,op:`degree-size`,nodes:l.length,maxDegree:s,minPx:14,maxPx:40}),keepalive:!0}).catch(()=>{})}catch{}if(c.size>0&&!ye.current){ye.current=!0;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-style`,op:`icon-fallback`,labels:Array.from(c).sort().join(`,`)}),keepalive:!0}).catch(()=>{})}catch{}}let h=Tt(d.current,`--accent-brand`,Et),g=Tt(d.current,`--border-strong`,Dt),_=Tt(d.current,`--border`,Ot),v={autoResize:!0,layout:{improvedLayout:!1,randomSeed:kt(On.current)},physics:m.physics===!1?!1:{solver:m.physics.solver,forceAtlas2Based:m.physics.forceAtlas2Based,stabilization:m.physics.stabilization},nodes:{shape:`dot`,size:18,font:{color:`#1F2937`,size:12,face:`DM Sans, sans-serif`},scaling:{label:{enabled:!0,min:12,max:30,drawThreshold:0}},borderWidth:0,chosen:{node:e=>{e.size=Math.round(e.size*1.2),e.borderWidth=3,e.borderColor=h,e.shadow=!0,e.shadowColor=`rgba(15, 23, 42, 0.55)`,e.shadowSize=8,e.shadowX=0,e.shadowY=0},label:e=>{e.size=14}}},edges:{arrows:{to:{enabled:!0,scaleFactor:.4}},color:{color:_,highlight:g},font:{color:`#64748B`,size:9,face:`DM Sans, sans-serif`,align:`middle`,strokeWidth:0},smooth:{enabled:!0,type:`continuous`,roundness:.4},width:1,chosen:{edge:!0,label:!1}},interaction:{hover:!0,tooltipDelay:150,multiselect:!0}};try{S.current?.(),S.current=null,f.current?.destroy(),_e.current!==null&&(clearTimeout(_e.current),_e.current=null),ge.current=null;let e=new se.Network(d.current,{nodes:C.current,edges:ne.current},v);f.current=e,m.physics===!1?(ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=no-physics`)):S.current=et(e,{report:({avgMotion:e,settleMs:t,capped:n,nodeCount:r})=>{ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=${n?`settle-capped`:`settled`}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-settle`,avgMotion:Math.round(e*100)/100,settleMs:t,capped:n,nodeCount:r}),keepalive:!0}).catch(()=>{})}catch{}}}),e.on(`zoom`,()=>{_e.current!==null&&clearTimeout(_e.current),_e.current=setTimeout(()=>{_e.current=null;let e=f.current,t=C.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=St(n);if(r===ge.current)return;ge.current=r;let i=[];for(let e of T.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),r=e.trashed?{background:`${t}40`,border:t}:t,a=ve.current?M(e,n):``;i.push({id:e.id,label:a,color:r})}i.length>0&&t.update(i),console.error(`[graph-page] zoom-tier scale=${n.toFixed(3)} tier=${r} nodes=${i.length}`)},Ct)}),e.on(`click`,e=>{let t=e.nodes[0];if(!t)return;let n=T.current.get(t);if(!n)return;if(He(n)===`skip-trashed`){rt(n);return}let r=kn.current[kn.current.length-1];if(r.kind===`neighbourhood`&&r.rootElementId===t){rt(e=>e?.id===t?null:n);return}rt(null);let i={kind:`neighbourhood`,rootElementId:t,rootLabel:n.labels[0]??null};Se(e=>{let n=Pe(e,i),r=n.length-1;return n.length>e.length&&Bt(`nav-push`,{depth:r,kind:i.kind,rootElementId:t}),n.length===10&&e.length===10&&Bt(`view-stack-cap-hit`,{depth:10,rootElementId:t}),n})}),e.on(`deselectNode`,()=>{rt(null)});let t=e=>{let t=d.current,n=ce.current;if(!t||!n)return!1;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,o=r.top+e.y;return a>=i.left&&a<=i.right&&o>=i.top&&o<=i.bottom},n=d.current?.parentElement??null;e.on(`dragStart`,e=>{if(e.nodes.length===0){de.current=null,pe.current=[];return}pe.current=[...e.nodes],de.current=e.nodes[0],n?.classList.add(`graph-dragging`)}),e.on(`dragging`,e=>{if(pe.current.length===0)return;let n=t(e.pointer.DOM);at(e=>e===n?e:n)}),e.on(`dragEnd`,e=>{let r=pe.current;if(pe.current=[],de.current=null,at(!1),n?.classList.remove(`graph-dragging`),r.length!==0&&t(e.pointer.DOM))if(r.length===1){let e=T.current.get(r[0])?.labels[0]??`Unknown`;wn(r[0],e)}else Tn(r)})}catch(e){ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=render-error`);let t=e instanceof Error?e.message:String(e);Ge(`Visualisation failed to load: ${t}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-render`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}},[]),Mn=(0,j.useCallback)(()=>{let e=f.current,t=C.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=[];for(let e of T.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),i=e.trashed?{background:`${t}40`,border:t}:t;r.push({id:e.id,label:ve.current?M(e,n):``,color:i})}r.length>0&&t.update(r)},[]),Nn=(0,j.useCallback)(()=>{ve.current||(ve.current=!0,Mn())},[Mn]);(0,j.useEffect)(()=>{let e=y.current;if(!e)return;let t=()=>Nn();return e.addEventListener(`pointerdown`,t,!0),e.addEventListener(`wheel`,t,!0),e.addEventListener(`keydown`,t,!0),()=>{e.removeEventListener(`pointerdown`,t,!0),e.removeEventListener(`wheel`,t,!0),e.removeEventListener(`keydown`,t,!0)}},[Nn]),(0,j.useEffect)(()=>{let e=d.current;if(!e)return;let t=t=>{let n=he.current,r=me.current,i=e.parentElement;if(!n||!r||!i)return;let a=i.getBoundingClientRect(),o=Math.min(n.clientX,t.clientX)-a.left,s=Math.min(n.clientY,t.clientY)-a.top,c=Math.max(n.clientX,t.clientX)-a.left,l=Math.max(n.clientY,t.clientY)-a.top;r.style.left=`${o}px`,r.style.top=`${s}px`,r.style.width=`${c-o}px`,r.style.height=`${l-s}px`},n=r=>{document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0);let i=he.current;he.current=null;let a=me.current;a&&(a.style.display=`none`);let o=f.current;if(!i||!o)return;let s=e.getBoundingClientRect(),c=i.clientX-s.left,l=i.clientY-s.top,u=r.clientX-s.left,d=r.clientY-s.top,p=Math.min(c,u),m=Math.min(l,d),h=Math.max(c,u),g=Math.max(l,d);if(h-p<3&&g-m<3)return;let _=o.getPositions(),v=[];for(let[e,t]of Object.entries(_)){let n=o.canvasToDOM(t);n.x>=p&&n.x<=h&&n.y>=m&&n.y<=g&&v.push(e)}try{o.selectNodes(v,!1)}catch{}},r=r=>{if(!r.shiftKey||r.button!==0)return;let i=f.current,a=e.parentElement;if(!i||!a)return;let o=e.getBoundingClientRect(),s={x:r.clientX-o.left,y:r.clientY-o.top};if(i.getNodeAt(s))return;r.preventDefault(),r.stopImmediatePropagation(),he.current={clientX:r.clientX,clientY:r.clientY};let c=me.current,l=a.getBoundingClientRect();c&&(c.style.display=`block`,c.style.left=`${r.clientX-l.left}px`,c.style.top=`${r.clientY-l.top}px`,c.style.width=`0px`,c.style.height=`0px`),document.addEventListener(`mousemove`,t,!0),document.addEventListener(`mouseup`,n,!0)};return e.addEventListener(`mousedown`,r,!0),()=>{e.removeEventListener(`mousedown`,r,!0),document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0)}},[]),(0,j.useEffect)(()=>{let e=ut.trim();if(!e){pt(``),ht(null),vt(null),Ut(`hybrid`),Gt(0),qt(!1),f.current?.unselectAll();return}qt(!1);let t=setTimeout(()=>pt(e),300);return()=>clearTimeout(t)},[ut]),(0,j.useEffect)(()=>{let e=setTimeout(()=>{let e=Ke(Pt);Vt(e);try{window.localStorage.setItem(At,String(e))}catch{}},200);return()=>clearTimeout(e)},[Pt]);let Pn=(0,j.useCallback)(e=>{let t=f.current,n=C.current;if(!t||!n)return;let{updates:r,inWindow:i}=Ue(e,T.current,w.resolveNodeColour,wt);r.length>0&&(n.update(r),t.fit({nodes:i,animation:{duration:400,easingFunction:`easeInOutQuad`}}))},[]),Fn=Re(xe);(0,j.useEffect)(()=>{if(!ft)return;let e=!1;return vt(null),a(qe(ft,Fn.selectedLabels,Lt,Kt)).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{if(e)return;ht(t.results);let n=t.mode===`bm25`?`bm25`:`hybrid`;if(Ut(n),Gt(typeof t.suppressed==`number`?t.suppressed:0),n===`bm25`)try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-page`,msg:`[graph-page] search-result-degraded mode=bm25 query="${ft}"`}),keepalive:!0}).catch(()=>{})}catch{}let{nodes:r,edges:i}=We(t.results,Fn.selectedLabels);T.current=new Map(r.map(e=>[e.id,e])),Qe(r.length),Ye(null),jn(r,i),Pn(t.results),console.info(`[graph-page] search-applied view=${En.kind} q="${ft}" labels=${Fn.selectedLabels.join(`|`)} hits=${r.length}`)}).catch(t=>{e||vt(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[ft,Lt,o,s,a,Pn,En.kind,Fn.selectedLabels,jn,Kt]);let In=(0,j.useCallback)(e=>{Se(t=>{let n=Re(t),r=new Set(n.selectedLabels);return r.has(e)?r.delete(e):r.add(e),Ie({kind:`filter`,selectedLabels:[...r].sort(),includeTrashed:n.includeTrashed,includeAgentActions:n.includeAgentActions})})},[]),Ln=(0,j.useCallback)(()=>{Se(e=>{let t=Re(e);return Ie({...t,includeTrashed:!t.includeTrashed})})},[]),Rn=(0,j.useCallback)(()=>{Se(e=>{let t=Re(e);return Ie({...t,includeAgentActions:!t.includeAgentActions})})},[]),zn=(0,j.useCallback)(()=>{dt(``),pt(``),ht(null),vt(null),Ut(`hybrid`),Gt(0),qt(!1);try{f.current?.unselectAll()}catch{}},[]),Bn=(0,j.useCallback)(()=>{Se(()=>Ie({kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}))},[]),Vn=(0,j.useCallback)(()=>{rt(null);try{f.current?.unselectAll()}catch{}Se(e=>{let t=Fe(e);return t!==e&&Bt(`nav-pop`,{depth:t.length-1}),t})},[]),Hn=(0,j.useCallback)(()=>{rt(null);try{f.current?.unselectAll()}catch{}Se(e=>e.length<=1?e:(Bt(`nav-home`,{depth:0,popped:e.length-1}),[Re(e)]))},[]),Un=(0,j.useCallback)(()=>{let e=Re(xe),t={labels:[...e.selectedLabels].sort(),includeTrashed:e.includeTrashed};on(!0),a(`/api/admin/graph-default-view`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));throw Error(t.error??`HTTP ${e.status}`)}tn(t)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view-save`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}).finally(()=>on(!1))},[a,xe]),Wn=(0,j.useCallback)(()=>{rt(null);try{f.current?.unselectAll()}catch{}Yt(e=>e+1),Ve(`graph-restore`)},[]),Gn=(0,j.useCallback)(()=>{rt(null);try{f.current?.unselectAll()}catch{}Se(e=>[Re(e)]),Yt(e=>e+1),Ve(`graph-trash`)},[]),L=(0,j.useCallback)(()=>{Yt(e=>e+1),Zt(e=>e+1)},[]),R=En.kind===`neighbourhood`,Kn=Re(xe),qn=Kn.selectedLabels,Jn=Kn.includeTrashed,Yn=Kn.includeAgentActions,Xn=Me({inNeighbourhood:R,searchActive:!!ft}),Zn=(0,j.useMemo)(()=>{if(Jn!==en.includeTrashed||qn.length!==en.labels.length)return!0;for(let e=0;e<qn.length;e++)if(qn[e]!==en.labels[e])return!0;return!1},[Jn,qn,en]);return(0,I.jsxs)(`div`,{ref:y,className:yt(g,i),children:[(0,I.jsxs)(`div`,{className:`graph-toolbar`,children:[xe.length>1&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-desktop`,onClick:Hn,title:`Clear breadcrumb — return to filter root`,children:[(0,I.jsx)(k,{size:12}),` Home`]}),(0,I.jsx)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-mobile`,onClick:Hn,"aria-label":`Home`,title:`Clear breadcrumb — return to filter root`,children:(0,I.jsx)(k,{size:14})}),(0,I.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-desktop`,onClick:Vn,children:`← Back`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-mobile`,onClick:Vn,"aria-label":`Back`,children:(0,I.jsx)(x,{size:16})})]}),(0,I.jsxs)(`div`,{className:`data-search-input graph-search-input`,children:[(0,I.jsx)(te,{size:14}),(0,I.jsx)(`input`,{type:`text`,placeholder:`Search nodes…`,value:ut,onChange:e=>dt(e.target.value),autoComplete:`off`,spellCheck:!1}),ft&&!mt&&!_t&&(0,I.jsx)(p,{size:14,className:`spin`}),ut.length>0&&(0,I.jsx)(`button`,{type:`button`,className:`graph-search-clear`,onClick:zn,"aria-label":`Clear search`,title:`Clear search`,children:(0,I.jsx)(u,{size:14})})]}),ft&&(0,I.jsxs)(`div`,{className:`graph-search-limit`,title:`Show top ${Pt} matches (1-2000)`,children:[(0,I.jsx)(`label`,{htmlFor:`graph-search-limit-input`,className:`graph-search-limit-label`,children:`Top`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>Ft(Ke(Pt-1)),disabled:Pt<=1,"aria-label":`Decrement search limit`,title:`Decrement`,children:(0,I.jsx)(ie,{size:12})}),(0,I.jsx)(`input`,{id:`graph-search-limit-input`,type:`number`,min:1,max:2e3,step:1,value:Pt,onChange:e=>Ft(Ke(e.target.value)),className:`graph-search-limit-number`,"aria-label":`Maximum search results to render`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>Ft(Ke(Pt+1)),disabled:Pt>=2e3,"aria-label":`Increment search limit`,title:`Increment`,children:(0,I.jsx)(c,{size:12})}),(0,I.jsx)(`input`,{id:`graph-search-limit-slider`,type:`range`,min:1,max:2e3,step:1,value:Pt,onChange:e=>Ft(Ke(e.target.value)),"aria-label":`Maximum search results to render (drag for ballpark)`})]}),(0,I.jsx)(`button`,{type:`button`,className:`graph-refresh-button`,onClick:L,disabled:we,"aria-label":`Refresh graph`,title:`Refresh graph`,children:(0,I.jsx)(m,{size:14,className:we?`spin`:void 0})}),bt(i)&&(0,I.jsx)(`button`,{type:`button`,className:`graph-fullscreen-toggle`,onClick:()=>{g?xn(`button`):_(!0)},"aria-label":g?`Exit full screen`:`Full screen`,title:g?`Exit full screen`:`Full screen`,"aria-pressed":g,children:g?(0,I.jsx)(re,{size:14}):(0,I.jsx)(ee,{size:14})}),!R&&(0,I.jsxs)(`div`,{className:`graph-filter-wrap`,ref:cn,children:[(0,I.jsxs)(`button`,{type:`button`,className:`graph-filter-toggle${nn?` is-open`:``}${qn.length>0||Jn||Yn?` has-selection`:``}`,onClick:()=>rn(e=>!e),"aria-haspopup":`true`,"aria-expanded":nn,"aria-label":`Filter node types`,children:[(0,I.jsx)(h,{size:14}),(0,I.jsx)(`span`,{children:`Filter`}),qn.length>0&&(0,I.jsx)(`span`,{className:`graph-filter-count`,children:qn.length})]}),nn&&(0,I.jsxs)(`div`,{className:`graph-filter-popover`,role:`dialog`,"aria-label":`Node type filter`,children:[(0,I.jsxs)(`div`,{className:`graph-filter-popover-header`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`graph-toggle-trashed${Jn?` active`:``}`,onClick:Ln,"aria-pressed":Jn,title:`Show trashed nodes — restored with Restore button on each node`,children:[(0,I.jsx)(D,{size:14}),` Show trashed`]}),(qn.length>0||Jn||Yn)&&(0,I.jsx)(`button`,{type:`button`,className:`graph-filter-clear`,onClick:Bn,"aria-label":`Clear filter selection`,title:`Clear filter selection`,children:(0,I.jsx)(u,{size:14})})]}),(0,I.jsx)(`div`,{className:`graph-toggle-agent-actions`,title:`Hide ToolCall, StepResult, WorkflowStep, WorkflowRun — agent-execution telemetry. Flip on for audit/debug.`,children:(0,I.jsx)(v,{checked:Yn,onChange:Rn,label:`Include agent actions`})}),Qt.length===0&&(0,I.jsx)(`p`,{className:`graph-filter-popover-empty`,children:`No node types in your graph yet.`}),(0,I.jsx)(`div`,{className:`graph-filter-rows`,role:`group`,"aria-label":`Node type filter`,children:Qt.map(({label:e,nodeCount:t})=>{let n=qn.includes(e),r=(0,w.colourForLabel)(e);return(0,I.jsxs)(`button`,{type:`button`,className:`graph-filter-row${n?` active`:``}`,onClick:()=>In(e),"aria-pressed":n,children:[(0,I.jsx)(`span`,{className:`graph-filter-row-swatch`,style:{backgroundColor:r}}),(0,I.jsx)(`span`,{className:`graph-filter-row-label`,children:e}),(0,I.jsx)(`span`,{className:`graph-filter-row-count`,children:t})]},e)})}),(0,I.jsx)(`div`,{className:`graph-filter-popover-footer`,children:(0,I.jsx)(`button`,{type:`button`,className:`graph-filter-set-default`,onClick:Un,disabled:!Zn||an,children:an?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(p,{size:12,className:`spin`}),` Saving…`]}):`Set default view`})})]})]}),(0,I.jsx)(`div`,{className:`graph-meta`,children:Oe({inNeighbourhood:R,searchActive:!!ft,selectedLabelsCount:qn.length,topLevelTotal:$e,nodeCount:Xe})?(0,I.jsx)(`span`,{className:`graph-meta-count`,children:ke(Xe,$e)}):Xe>0&&(0,I.jsxs)(`span`,{className:`graph-meta-count`,children:[Xe,` node`,Xe===1?``:`s`]})})]}),xe.length>1&&(0,I.jsx)(zt,{viewStack:xe}),ft&&Ht===`bm25`&&!_t&&(0,I.jsx)(`div`,{className:`graph-error-banner graph-search-degraded`,role:`status`,children:`Vector ranking unavailable — showing keyword-only results.`}),_t&&(0,I.jsxs)(`div`,{className:`data-error graph-error-banner`,children:[`Search unavailable: `,_t]}),ft&&Wt>0&&!Kt&&!_t&&(0,I.jsxs)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>qt(!0),children:[Wt,` low-confidence match`,Wt===1?``:`es`,` hidden — show all`]}),ft&&Kt&&!_t&&(0,I.jsx)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>qt(!1),children:`Showing all matches — hide low-confidence`}),mt&&mt.length===0&&!_t&&(0,I.jsx)(`div`,{className:`graph-search-status`,children:`No matches in your graph.`}),(0,I.jsxs)(`div`,{className:`graph-canvas-wrap`,children:[je({loading:we,rendering:De,searchActive:!!ft})&&(0,I.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,I.jsx)(p,{size:20,className:`spin`}),` Loading your graph…`]}),Be&&!we&&!De&&(0,I.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,I.jsx)(`p`,{children:Be}),(0,I.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:()=>{Ge(null),Yt(e=>e+1)},children:`Retry`})]}),Je&&!we&&!De&&(0,I.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,I.jsxs)(`p`,{children:[`Refine your filter — `,(0,I.jsx)(`strong`,{children:Je.matched}),` matches exceed the 2000 cap.`]}),(0,I.jsx)(`p`,{className:`graph-canvas-hint`,children:`Pick a more specific label combination, or narrow your brand's data.`})]}),!we&&!De&&!Be&&!Je&&Xe===0&&!R&&qn.length===0&&(0,I.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,I.jsx)(h,{size:20}),(0,I.jsx)(`p`,{children:`No nodes in your graph yet.`})]}),!we&&!De&&!Be&&!Je&&Xe===0&&!R&&qn.length>0&&(0,I.jsx)(`div`,{className:`graph-canvas-overlay`,children:(0,I.jsxs)(`p`,{children:[`No `,qn.join(`, `),` nodes match this view.`]})}),(0,I.jsx)(`div`,{ref:d,className:`graph-canvas`}),(0,I.jsx)(`div`,{ref:me,className:`graph-marquee`,"aria-hidden":`true`}),Xe>0&&(0,I.jsx)(`div`,{ref:ce,className:`graph-trash-drop-zone${it?` is-hover`:``}${ot?` is-error`:``}`,"aria-hidden":`true`,children:(0,I.jsx)(l,{size:18})}),ct&&(0,I.jsxs)(`div`,{className:`graph-drag-error-banner`,role:`alert`,children:[(0,I.jsx)(`span`,{children:ct}),(0,I.jsx)(`button`,{type:`button`,className:`graph-drag-error-dismiss`,onClick:()=>lt(null),"aria-label":`Dismiss`,children:(0,I.jsx)(u,{size:14})})]}),Xe>0&&vn.length>0&&(0,I.jsxs)(`div`,{ref:ln,className:`graph-legend${pn?` is-collapsed`:``}`,style:dn?{"--legend-x":`${dn.x}px`,"--legend-y":`${dn.y}px`}:void 0,children:[(0,I.jsxs)(`div`,{className:`graph-legend-header`,onPointerDown:hn,onPointerMove:gn,onPointerUp:_n,children:[(0,I.jsx)(O,{size:13,className:`graph-legend-grip`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`graph-legend-title`,children:`Legend`}),(0,I.jsx)(`button`,{type:`button`,className:`graph-legend-collapse`,onPointerDown:e=>e.stopPropagation(),onClick:()=>mn(e=>!e),"aria-label":pn?`Expand legend`:`Collapse legend`,"aria-expanded":!pn,children:pn?(0,I.jsx)(E,{size:14}):(0,I.jsx)(b,{size:14})})]}),(0,I.jsx)(`div`,{className:`graph-legend-body`,children:vn.map(e=>{let t=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(It,{label:e.label,shape:e.shape,colour:e.colour}),(0,I.jsx)(`span`,{className:`graph-legend-label`,children:e.label}),(0,I.jsx)(`span`,{className:`graph-legend-count`,children:e.count})]});if(!Xn)return(0,I.jsx)(`div`,{className:`graph-legend-item`,children:t},e.label);let n=qn.includes(e.label);return(0,I.jsx)(`button`,{type:`button`,className:`graph-legend-item graph-legend-item--interactive${n?` is-selected`:``}`,"aria-pressed":n,onClick:()=>{let t=n?`remove`:`add`,r=n?qn.length-1:qn.length+1;console.log(`[graph-page] op=legend-filter label=${e.label} action=${t} selected=${r}`),In(e.label)},children:t},e.label)})})]})]}),nt&&(0,I.jsx)(gt,{node:nt,edges:A.current,nodesById:T.current,adminFetch:a,onClose:()=>{rt(null);try{f.current?.unselectAll()}catch{}},onRestored:Wn,onTrashed:Gn})]})}var Rt=class extends Error{body;constructor(e){super(e.error),this.body=e}};function zt({viewStack:e}){let t=e.map(e=>e.kind===`filter`?`Filter`:e.rootLabel??`Node`);return(0,I.jsx)(`div`,{className:`graph-breadcrumb`,role:`navigation`,"aria-label":`Graph navigation breadcrumb`,children:t.map((e,n)=>(0,I.jsxs)(`span`,{className:`graph-breadcrumb-item`,children:[n>0&&(0,I.jsx)(`span`,{className:`graph-breadcrumb-separator`,"aria-hidden":`true`,children:`›`}),(0,I.jsx)(`span`,{className:`graph-breadcrumb-label${n===t.length-1?` is-current`:``}`,children:e})]},n))})}function Bt(e,t){let n=`[graph-page] ${e} ${Object.entries(t).map(([e,t])=>`${e}=${String(t)}`).join(` `)}`;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-nav`,msg:n}),keepalive:!0}).catch(()=>{})}catch{}}(0,ce.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(Pt,{}));