graview 0.1.62 → 0.1.64

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 (202) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +1 -1
  4. package/dist/preview/chunk.2D7K2IJQ.js +4 -0
  5. package/dist/preview/{chunk.UFDJXQQQ.js → chunk.2DH42I7L.js} +6 -6
  6. package/dist/preview/chunk.2E62YCMZ.js +1 -0
  7. package/dist/preview/{chunk.GX4G4BX3.js → chunk.2G5WLG3Z.js} +1 -1
  8. package/dist/preview/chunk.2HV5FF6O.js +1 -0
  9. package/dist/preview/{chunk.LGRLVJGS.js → chunk.2JDAUKSN.js} +3 -3
  10. package/dist/preview/{chunk.ZN3PUM2I.js → chunk.2JEN2RCB.js} +1 -1
  11. package/dist/preview/{chunk.66P5IDTH.js → chunk.2TCOLAL2.js} +1 -1
  12. package/dist/preview/{chunk.OWOOKLIU.js → chunk.2V7QTIAV.js} +1 -1
  13. package/dist/preview/{chunk.IQ3PRWGO.js → chunk.2VIS2NAT.js} +2 -2
  14. package/dist/preview/{chunk.UQQKDBIH.js → chunk.2VYGDY5Z.js} +1 -1
  15. package/dist/preview/{chunk.WEOVK2T4.js → chunk.37I45R6V.js} +1 -1
  16. package/dist/preview/chunk.3FKKH2XU.js +74 -0
  17. package/dist/preview/chunk.3J7XLJP2.js +1 -0
  18. package/dist/preview/chunk.3OEODIHB.js +1 -0
  19. package/dist/preview/{chunk.WPXPVD33.js → chunk.3RD4JHVG.js} +1 -1
  20. package/dist/preview/{chunk.CHHYIMB7.js → chunk.3RUV4HE4.js} +1 -1
  21. package/dist/preview/chunk.3SAESG6X.js +1 -0
  22. package/dist/preview/{chunk.4HEFUOLV.js → chunk.47N2G7A5.js} +1 -1
  23. package/dist/preview/{chunk.A3ZC2JBO.js → chunk.4DZOAB4D.js} +1 -1
  24. package/dist/preview/chunk.4HTB6TX2.js +1 -0
  25. package/dist/preview/chunk.4Q5PCMGZ.js +18 -0
  26. package/dist/preview/{chunk.DPEIT3TW.js → chunk.4U45EY5M.js} +1 -1
  27. package/dist/preview/{chunk.2B6P4GPS.js → chunk.4VRX7FCO.js} +1 -1
  28. package/dist/preview/{chunk.JT3MFPRD.js → chunk.4XCYZRZ3.js} +1 -1
  29. package/dist/preview/chunk.52MBXPEK.js +1 -0
  30. package/dist/preview/chunk.5AD2QHWH.js +3 -0
  31. package/dist/preview/{chunk.MDEX6ZVE.js → chunk.5B7NG6WH.js} +1 -1
  32. package/dist/preview/chunk.5HJ2GTKZ.js +1 -0
  33. package/dist/preview/chunk.5IEZF433.js +2 -0
  34. package/dist/preview/{chunk.QGU5QTR6.js → chunk.5PPCK7QT.js} +1 -1
  35. package/dist/preview/chunk.6NRWLCIZ.js +5 -0
  36. package/dist/preview/chunk.75JQCTR6.js +1 -0
  37. package/dist/preview/{chunk.KMV6PJFL.js → chunk.77JI5T4F.js} +1 -1
  38. package/dist/preview/chunk.77MLXWZV.js +35 -0
  39. package/dist/preview/chunk.7AOEZJRM.js +1 -0
  40. package/dist/preview/{chunk.QIPASE42.js → chunk.7CLKGKSF.js} +1 -1
  41. package/dist/preview/{chunk.BZMQDEIY.js → chunk.7SRSE5IS.js} +1 -1
  42. package/dist/preview/{chunk.2GEJNG2U.js → chunk.7VAHHEDX.js} +1 -1
  43. package/dist/preview/{chunk.VJBBVLGZ.js → chunk.7ZG77OI3.js} +1 -1
  44. package/dist/preview/chunk.7ZHH7WBN.js +1 -0
  45. package/dist/preview/chunk.AJEK3I5X.js +6 -0
  46. package/dist/preview/chunk.APRWUIE3.js +1 -0
  47. package/dist/preview/{chunk.QHY5NVYH.js → chunk.APUQIELA.js} +1 -1
  48. package/dist/preview/{chunk.Y4FZKUOK.js → chunk.ATHLE33D.js} +1 -1
  49. package/dist/preview/chunk.B2YTHEX5.js +1 -0
  50. package/dist/preview/{chunk.ELOFPE25.js → chunk.B6JR7EQO.js} +1 -1
  51. package/dist/preview/{chunk.5ODHHH35.js → chunk.BN42H3C6.js} +1 -1
  52. package/dist/preview/{chunk.DD2NKFDX.js → chunk.BVIJXL4J.js} +1 -1
  53. package/dist/preview/{chunk.5HGD6OWL.js → chunk.CC7P435K.js} +2 -2
  54. package/dist/preview/{chunk.IQMD7DG3.js → chunk.CJHYGRWV.js} +1 -1
  55. package/dist/preview/chunk.CM65MCHA.js +1 -0
  56. package/dist/preview/{chunk.MYNMBOLD.js → chunk.D2XLECMP.js} +1 -1
  57. package/dist/preview/chunk.DJIF7IAQ.js +2 -0
  58. package/dist/preview/{chunk.G4ULQK64.js → chunk.DLWFULWE.js} +1 -1
  59. package/dist/preview/{chunk.QDWSU47A.js → chunk.DMENNIHT.js} +1 -1
  60. package/dist/preview/{chunk.L3WTKQQL.js → chunk.DN7UCBOA.js} +1 -1
  61. package/dist/preview/{chunk.22BZU7ME.js → chunk.DQAMVVE6.js} +1 -1
  62. package/dist/preview/chunk.DUP2CGVH.js +1 -0
  63. package/dist/preview/{chunk.TM4EPUNO.js → chunk.DYRULRFX.js} +1 -1
  64. package/dist/preview/{chunk.AFNSAQEQ.js → chunk.E4TXLT25.js} +1 -1
  65. package/dist/preview/{chunk.DDUCIUVW.js → chunk.F6BNFLQM.js} +1 -1
  66. package/dist/preview/chunk.FN34P4IS.js +1 -0
  67. package/dist/preview/{chunk.AJSUHPBE.js → chunk.FUPYIOXZ.js} +1 -1
  68. package/dist/preview/{chunk.7KVUUEZA.js → chunk.FXRYMT3U.js} +1 -1
  69. package/dist/preview/{chunk.DEAP3H2L.js → chunk.G5BVZLCM.js} +1 -1
  70. package/dist/preview/{chunk.Y2YYH3JN.js → chunk.G7YLK4PX.js} +1 -1
  71. package/dist/preview/chunk.GF62K25C.js +1 -0
  72. package/dist/preview/chunk.GFQPO3NC.js +1 -0
  73. package/dist/preview/{chunk.5STU3KYG.js → chunk.GH5UBSQI.js} +1 -1
  74. package/dist/preview/chunk.GHHKRFPD.js +1 -0
  75. package/dist/preview/{chunk.THVC2BEC.js → chunk.GP5DAA4P.js} +1 -1
  76. package/dist/preview/{chunk.VN23AGIY.js → chunk.HPG6CNKM.js} +1 -1
  77. package/dist/preview/chunk.HSJEOM3W.js +1 -0
  78. package/dist/preview/{chunk.H5S7OL2U.js → chunk.HZPRMHSL.js} +1 -1
  79. package/dist/preview/chunk.IQGSEAQ2.js +5 -0
  80. package/dist/preview/{chunk.PCDUV3WP.js → chunk.ITBG37WJ.js} +1 -1
  81. package/dist/preview/{chunk.SVPKUWZU.js → chunk.JHUCKEJS.js} +1 -1
  82. package/dist/preview/{chunk.H7N7WN4U.js → chunk.JOM6MFVE.js} +1 -1
  83. package/dist/preview/{chunk.DNVWSWL2.js → chunk.JS2UZYGB.js} +1 -1
  84. package/dist/preview/{chunk.7XLS6XTY.js → chunk.K2PXP5H6.js} +1 -1
  85. package/dist/preview/{chunk.6AKW7TXM.js → chunk.K54ISAXN.js} +1 -1
  86. package/dist/preview/{chunk.3FON2Y72.js → chunk.K5YFUMRS.js} +1 -1
  87. package/dist/preview/chunk.KHXRJLLU.js +50 -0
  88. package/dist/preview/chunk.KMIFSPGQ.js +1 -0
  89. package/dist/preview/chunk.L4V5VLSM.js +1 -0
  90. package/dist/preview/{chunk.T6WHGKWR.js → chunk.LDMBJC3B.js} +1 -1
  91. package/dist/preview/{chunk.PLTH2LW5.js → chunk.LTOQ22ZJ.js} +1 -1
  92. package/dist/preview/{chunk.UVA7AALY.js → chunk.M5VHUIDB.js} +1 -1
  93. package/dist/preview/chunk.N643PVQA.js +1 -0
  94. package/dist/preview/{chunk.FULEUL34.js → chunk.NGRL3QOI.js} +1 -1
  95. package/dist/preview/{chunk.OFWNMTGB.js → chunk.NRPBTV6O.js} +2 -2
  96. package/dist/preview/{chunk.N6EJXXQK.js → chunk.O7HHNQK4.js} +2 -2
  97. package/dist/preview/{chunk.5YAOKOGV.js → chunk.OW3M4OBN.js} +1 -1
  98. package/dist/preview/{chunk.2N4Z5K5S.js → chunk.OXFDB5BB.js} +1 -1
  99. package/dist/preview/{chunk.4TX6VCBT.js → chunk.P4TAX3HE.js} +1 -1
  100. package/dist/preview/{chunk.RYRQ66JN.js → chunk.P6FNJR6E.js} +1 -1
  101. package/dist/preview/chunk.PR74PGLC.js +1 -0
  102. package/dist/preview/{chunk.F7YXLYLX.js → chunk.PVDDSBRG.js} +1 -1
  103. package/dist/preview/{chunk.OUDATENL.js → chunk.QROPDEJF.js} +1 -1
  104. package/dist/preview/{chunk.I77ZGIFE.js → chunk.QRT6BZR6.js} +1 -1
  105. package/dist/preview/{chunk.OWT3VVOT.js → chunk.R5MLRKAO.js} +2 -2
  106. package/dist/preview/chunk.RDA35HZB.js +2 -0
  107. package/dist/preview/{chunk.ROZTJ6IY.js → chunk.REXU6ARY.js} +1 -1
  108. package/dist/preview/chunk.S6QZBWCJ.js +1 -0
  109. package/dist/preview/{chunk.MAKODQO3.js → chunk.S7SHWDPR.js} +1 -1
  110. package/dist/preview/{chunk.SWMDFXUX.js → chunk.SADHOSRC.js} +1 -1
  111. package/dist/preview/chunk.SJHUC4TL.js +1 -0
  112. package/dist/preview/chunk.SL5FXE3R.js +1 -0
  113. package/dist/preview/{chunk.X6KYRBL6.js → chunk.T4JP6BGP.js} +1 -1
  114. package/dist/preview/{chunk.TIALD6SC.js → chunk.T4TRJDBF.js} +1 -1
  115. package/dist/preview/{chunk.M4AYA2PL.js → chunk.TA2JTUNX.js} +1 -1
  116. package/dist/preview/{chunk.EVBCEEQ4.js → chunk.TMHVYI5R.js} +1 -1
  117. package/dist/preview/chunk.TOLW64EO.js +1 -0
  118. package/dist/preview/chunk.TP3PZRHE.js +1 -0
  119. package/dist/preview/{chunk.PZQNR4KZ.js → chunk.TQ2G4AM4.js} +1 -1
  120. package/dist/preview/{chunk.5J3O2FVG.js → chunk.TUR2DA2M.js} +1 -1
  121. package/dist/preview/{chunk.B23WZQXQ.js → chunk.TYIBLD2D.js} +1 -1
  122. package/dist/preview/{chunk.DC35FJAB.js → chunk.UD2GGG7L.js} +1 -1
  123. package/dist/preview/chunk.UDU545CL.js +1 -0
  124. package/dist/preview/{chunk.RPDH32XV.js → chunk.UDYFGYJP.js} +1 -1
  125. package/dist/preview/{chunk.SEHRPTNA.js → chunk.UJNLT3L6.js} +1 -1
  126. package/dist/preview/chunk.UN2IAA5R.js +1 -0
  127. package/dist/preview/chunk.VLX7YWVH.js +25 -0
  128. package/dist/preview/{chunk.T3UQ7ZQK.js → chunk.VT4YBFZL.js} +1 -1
  129. package/dist/preview/{chunk.ELTV44HU.js → chunk.VZAF3452.js} +2 -2
  130. package/dist/preview/{chunk.O2BHPYA4.js → chunk.WFCE7NLK.js} +2 -2
  131. package/dist/preview/{chunk.CY3ELWCM.js → chunk.WHX47OJM.js} +1 -1
  132. package/dist/preview/{chunk.NUWDMH47.js → chunk.WMARJ5E3.js} +1 -1
  133. package/dist/preview/chunk.WPQP54FM.js +1 -0
  134. package/dist/preview/{chunk.6JO5HQDR.js → chunk.WX23K7ZU.js} +1 -1
  135. package/dist/preview/{chunk.W4BKYSZX.js → chunk.X36BYTEG.js} +1 -1
  136. package/dist/preview/{chunk.AQRB7LDA.js → chunk.XCLW4GP7.js} +1 -1
  137. package/dist/preview/{chunk.DDO3GLEJ.js → chunk.XEG7ZDRG.js} +1 -1
  138. package/dist/preview/{chunk.ILIIBSGA.js → chunk.XIVELWAM.js} +1 -1
  139. package/dist/preview/{chunk.75GVFX7L.js → chunk.XJWKIXPV.js} +1 -1
  140. package/dist/preview/{chunk.O75HWF3F.js → chunk.XQ5RTPEF.js} +1 -1
  141. package/dist/preview/{chunk.NOGGSLVG.js → chunk.YEXFVDRA.js} +1 -1
  142. package/dist/preview/{chunk.UXMPFPFH.js → chunk.YIZPW7IK.js} +2 -2
  143. package/dist/preview/chunk.YLOGIJOH.js +1 -0
  144. package/dist/preview/chunk.YMXWS4XN.js +3 -0
  145. package/dist/preview/{chunk.Z2TDZSMN.js → chunk.YSBTE3PX.js} +1 -1
  146. package/dist/preview/{chunk.RD2X25XB.js → chunk.Z26T5E76.js} +1 -1
  147. package/dist/preview/{chunk.A3OL2BI2.js → chunk.Z4XGEV34.js} +1 -1
  148. package/dist/preview/chunk.ZA5TDCBC.js +1 -0
  149. package/dist/preview/chunk.ZNDVJGTY.js +1 -0
  150. package/dist/preview/chunk.ZQGLPP7A.js +1 -0
  151. package/dist/preview/index.html +53 -52
  152. package/dist/preview/page.js +2 -2
  153. package/dist/preview/splash.js +7 -6
  154. package/package.json +6 -6
  155. package/dist/preview/chunk.2AT3GRXM.js +0 -1
  156. package/dist/preview/chunk.4HRYB7HF.js +0 -1
  157. package/dist/preview/chunk.5MZYCELA.js +0 -6
  158. package/dist/preview/chunk.7M4HNKDR.js +0 -1
  159. package/dist/preview/chunk.7OBIBPYH.js +0 -1
  160. package/dist/preview/chunk.7V56P2A7.js +0 -1
  161. package/dist/preview/chunk.7YOAW7ED.js +0 -1
  162. package/dist/preview/chunk.ACTXR2MI.js +0 -3
  163. package/dist/preview/chunk.AI34V6WV.js +0 -74
  164. package/dist/preview/chunk.BLUKSGI4.js +0 -1
  165. package/dist/preview/chunk.CAKFNKN5.js +0 -1
  166. package/dist/preview/chunk.CGALLZ54.js +0 -1
  167. package/dist/preview/chunk.DHJ3FQTR.js +0 -1
  168. package/dist/preview/chunk.DZZL5IDD.js +0 -5
  169. package/dist/preview/chunk.H24OC6OE.js +0 -1
  170. package/dist/preview/chunk.H73ZPYUX.js +0 -1
  171. package/dist/preview/chunk.HANJZ6FA.js +0 -1
  172. package/dist/preview/chunk.HIMQ65QT.js +0 -1
  173. package/dist/preview/chunk.IQPILSV3.js +0 -18
  174. package/dist/preview/chunk.IYBEXENQ.js +0 -1
  175. package/dist/preview/chunk.J7Q2WAF4.js +0 -28
  176. package/dist/preview/chunk.JYFZCJ4N.js +0 -2
  177. package/dist/preview/chunk.KDXU5DT3.js +0 -1
  178. package/dist/preview/chunk.KL7E4YHJ.js +0 -1
  179. package/dist/preview/chunk.LAYQ5PFS.js +0 -1
  180. package/dist/preview/chunk.LTZUF5VG.js +0 -1
  181. package/dist/preview/chunk.M7RESZB6.js +0 -25
  182. package/dist/preview/chunk.MGALQLRW.js +0 -1
  183. package/dist/preview/chunk.NAD7ZXYP.js +0 -1
  184. package/dist/preview/chunk.NHTGAP3G.js +0 -3
  185. package/dist/preview/chunk.NUYA4BWI.js +0 -1
  186. package/dist/preview/chunk.OKZT2QBM.js +0 -2
  187. package/dist/preview/chunk.OUPURRDE.js +0 -1
  188. package/dist/preview/chunk.PD2DECOP.js +0 -1
  189. package/dist/preview/chunk.PKWQKFPE.js +0 -2
  190. package/dist/preview/chunk.RMR24LFJ.js +0 -4
  191. package/dist/preview/chunk.RRKI24WY.js +0 -1
  192. package/dist/preview/chunk.SGCW2XRC.js +0 -1
  193. package/dist/preview/chunk.SS7234R6.js +0 -1
  194. package/dist/preview/chunk.TKUNRFDE.js +0 -1
  195. package/dist/preview/chunk.U6ZRJKVM.js +0 -1
  196. package/dist/preview/chunk.UKQUUPKE.js +0 -1
  197. package/dist/preview/chunk.VACKSKGJ.js +0 -1
  198. package/dist/preview/chunk.VC3V7HLL.js +0 -1
  199. package/dist/preview/chunk.VIH5AX7S.js +0 -5
  200. package/dist/preview/chunk.WKI5INH7.js +0 -1
  201. package/dist/preview/chunk.Y4S7CDRB.js +0 -1
  202. package/dist/preview/chunk.YP2QSPXU.js +0 -50
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * or `graview check` from inside a project that has it as a devDependency.
7
7
  * It owns no logic. Every subcommand lives in the package whose concern it
8
8
  * is — the generator, the checker and `doctor` in core, `serve`,
9
- * `sync-seed`, `preview` and `shots` in ship, `mcp`, `apply`, `dream` and `learn` in tools,
9
+ * `sync-seed`, `preview` and `shots` in ship, `mcp`, `apply`, `dream`, `learn` and `workflow` in tools,
10
10
  * `skills` in skills, `view` in guest — and this dispatches to it, so a
11
11
  * project made with `graview create` and one made by calling core's own
12
12
  * CLI are the same project. What it carries is the page `preview` serves,
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { main as core, USAGE as CORE_USAGE } from "@graview/core/cli";
8
8
  * or `graview check` from inside a project that has it as a devDependency.
9
9
  * It owns no logic. Every subcommand lives in the package whose concern it
10
10
  * is — the generator, the checker and `doctor` in core, `serve`,
11
- * `sync-seed`, `preview` and `shots` in ship, `mcp`, `apply`, `dream` and `learn` in tools,
11
+ * `sync-seed`, `preview` and `shots` in ship, `mcp`, `apply`, `dream`, `learn` and `workflow` in tools,
12
12
  * `skills` in skills, `view` in guest — and this dispatches to it, so a
13
13
  * project made with `graview create` and one made by calling core's own
14
14
  * CLI are the same project. What it carries is the page `preview` serves,
@@ -41,9 +41,9 @@ export async function main(given) {
41
41
  const { syncSeed } = await import("@graview/ship/cli");
42
42
  return syncSeed(rest);
43
43
  }
44
- if (command === "mcp" || command === "apply" || command === "dream" || command === "learn") {
45
- const { mcp, apply, dream, learn } = await import("@graview/tools/cli");
46
- return command === "mcp" ? mcp(rest) : command === "apply" ? apply(rest) : command === "dream" ? dream(rest) : learn(rest);
44
+ if (command === "mcp" || command === "apply" || command === "dream" || command === "learn" || command === "workflow") {
45
+ const { mcp, apply, dream, learn, workflow } = await import("@graview/tools/cli");
46
+ return command === "mcp" ? mcp(rest) : command === "apply" ? apply(rest) : command === "dream" ? dream(rest) : command === "workflow" ? workflow(rest) : learn(rest);
47
47
  }
48
48
  if (command === "skills") {
49
49
  const { skills } = await import("@graview/skills/cli");
@@ -62,9 +62,9 @@ export async function main(given) {
62
62
  /** Core's usage, then the subcommands the other packages contribute. */
63
63
  async function usage() {
64
64
  const { SERVE_USAGE } = await import("@graview/ship/cli");
65
- const { MCP_USAGE, DREAM_USAGE, LEARN_USAGE } = await import("@graview/tools/cli");
65
+ const { MCP_USAGE, DREAM_USAGE, LEARN_USAGE, WORKFLOW_USAGE } = await import("@graview/tools/cli");
66
66
  const { SKILLS_USAGE } = await import("@graview/skills/cli");
67
67
  const { VIEW_USAGE } = await import("@graview/guest/cli");
68
- return `${CORE_USAGE}\n${SERVE_USAGE}\n${MCP_USAGE}\n${DREAM_USAGE}\n${LEARN_USAGE}\n${SKILLS_USAGE}\n${VIEW_USAGE}`;
68
+ return `${CORE_USAGE}\n${SERVE_USAGE}\n${MCP_USAGE}\n${DREAM_USAGE}\n${WORKFLOW_USAGE}\n${LEARN_USAGE}\n${SKILLS_USAGE}\n${VIEW_USAGE}`;
69
69
  }
70
70
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,KAAwB;IACjD,iGAAiG;IACjG,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACpD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACjD,gKAAgK;QAChK,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,IAAI,OAAO,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,2IAA2I;QAC3I,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAyE,CAAC;QACpK,OAAO,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QAC5B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACvD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QAC3F,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACxE,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7H,CAAC;IACD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;QACvD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC/E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;QACpC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,wEAAwE;AACxE,KAAK,UAAU,KAAK;IAClB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACnF,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAC7D,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC1D,OAAO,GAAG,UAAU,KAAK,WAAW,KAAK,SAAS,KAAK,WAAW,KAAK,WAAW,KAAK,YAAY,KAAK,UAAU,EAAE,CAAC;AACvH,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,KAAwB;IACjD,iGAAiG;IACjG,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACpD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACjD,gKAAgK;QAChK,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,IAAI,OAAO,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,2IAA2I;QAC3I,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAyE,CAAC;QACpK,OAAO,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QAC5B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACvD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QACrH,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QAClF,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvK,CAAC;IACD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;QACvD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC/E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;QACpC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,wEAAwE;AACxE,KAAK,UAAU,KAAK;IAClB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACnG,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAC7D,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC1D,OAAO,GAAG,UAAU,KAAK,WAAW,KAAK,SAAS,KAAK,WAAW,KAAK,cAAc,KAAK,WAAW,KAAK,YAAY,KAAK,UAAU,EAAE,CAAC;AAC1I,CAAC"}
@@ -0,0 +1,4 @@
1
+ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Yt,f as dt,g as Pn}from"./chunk.77JI5T4F.js";import{h as vi}from"./chunk.UDU545CL.js";import{e as xi,q as nr,r as bi}from"./chunk.7VAHHEDX.js";import{b as Tn}from"./chunk.DQAMVVE6.js";import{a as Be,b as Ur,c as dn,d as ki,e as Xr}from"./chunk.OXFDB5BB.js";import{a as wi}from"./chunk.TA2JTUNX.js";import{a as pi,b as yi,c as gi}from"./chunk.TQ2G4AM4.js";import{b as si,d as di}from"./chunk.X36BYTEG.js";import{c as jo}from"./chunk.DUP2CGVH.js";import{a as li,b as Gr,c as zr,f as Yr,g as _r,h as Kr,i as ci,j as on,k as an,p as zt,q as sn,r as hi,s as mi}from"./chunk.3SAESG6X.js";import{A as ii,f as Xo,g as nn,h as qo,i as Qo,j as Zo,k as Jo,m as tr,n as An,o as Ln,p as rn,q as Vr,v as ei,w as ti,x as ni,y as ri,z as oi}from"./chunk.OJGHDWI6.js";import{a as ui,b as fi}from"./chunk.F6BNFLQM.js";import{c as ai}from"./chunk.5AD2QHWH.js";import{A as yt,B as Hr,C as Rn,G as Re,K as Rt,Ka as On,Pa as $r,Qa as Fr,Ra as Gt,Ta as Wr,V as Ee,X as Jn,Xa as jr,Y as Br,a as Lr,aa as Dr,b as Pr,ba as er,c as Tr,ca as jt,d as Vo,da as we,e as Go,f as Qn,fa as Vt,h as Ft,j as Mt,k as Cr,ka as Yo,l as Zn,la as _o,m as Mn,oa as tn,p as Ir,qa as Ko,r as Me,s as Ie,t as zo,u as En,v as Ne,w as Wt,wa as Uo,x as Et,y as Nr}from"./chunk.VLX7YWVH.js";import{a as en}from"./chunk.SDO3U72B.js";import{Qc as Sn,Ud as Ar,Wd as Do,ga as Xn,ka as Ho,ke as $o,la as Zt,na as Jt,ne as Fo,oa as $t,pa as qn,qd as Ve,ta as Bo,ue as Wo}from"./chunk.IQGSEAQ2.js";import{b as ie}from"./chunk.AJZBJBMO.js";var rr=ie(Re(),1);var Si=ie(Ee(),1);function or(e){let t=(0,rr.useRef)(e);t.current=e;let n=(0,rr.useRef)(null),o=(0,rr.useRef)(new Map),r=n.current;if(r&&(r.outer===e||vs(r.outer,e)))return r.outer=e,r.inner;let s=dt(e.view,null),i=(c,l,a)=>{let u=o.current.get(c);return u&&u.made===l?u.call:(o.current.set(c,{made:l,call:a}),a)},d=Object.fromEntries(Object.entries(e).map(([c,l])=>[c,c==="view"?s:c==="setView"?i(c,l,bs(t)):typeof l=="function"?i(c,l,(...a)=>t.current[c](...a)):l]));return n.current={outer:e,inner:d},d}function bs(e){return t=>e.current.setView(typeof t=="function"?t:n=>t.pan===void 0&&n.pan?{...t,pan:n.pan}:t)}function vs(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let o of n){if(o==="view"||o==="movedByHand")continue;let r=e[o],s=t[o];if(r!==s&&!(typeof r=="function"&&typeof s=="function"))return!1}return qr(e.view,t.view)}function qr(e,t){if(e===t)return!0;let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let o of n)if(o!=="pan"&&e[o]!==t[o])return!1;return!0}function ks({children:e}){let t=or(we());return(0,Si.jsx)(Jn.Provider,{value:t,children:e})}var Mi={width:1200,height:760,focusSize:{width:1200,height:420},relationSize:{width:240,height:140},contextSize:{width:300,height:104},gap:16,unit:16};var Ei=(e,t)=>e?`${e.edgeKind}|${e.direction}`:`raised|${t}`,_t=(e,t,n)=>`${Hr}${e}|${t}|${n}`;function ir(e,t){let n=e.map(()=>0),o=e.map((i,d)=>({size:i,index:d})).sort((i,d)=>i.size-d.size||i.index-d.index),r=Math.max(t,e.length),s=e.length;for(let{size:i,index:d}of o){let c=Math.max(1,Math.floor(r/s));n[d]=Math.min(i,c),r-=n[d],s-=1}return n}function Zr(e){return Ei(e.via,e.node.kind)}function ln(e,t,n=[]){let o=[],r=0;return e.forEach((s,i)=>{if(s<=0)return;let d=Math.min(t,Math.max(1,n[i]??1)),c=Math.max(s,d);if(o.length>0&&s<=t&&c<=r){o[o.length-1].push({run:i,cards:s,slots:c}),r-=c;return}let l=s,a=!0;for(;l>0;){let u=Math.min(t,l),f=a?Math.max(u,d):u;o.push([{run:i,cards:u,slots:f}]),l-=u,r=t-f,a=!1}}),o}function Jr(e,t,n,o=[]){let r=ir(e,t*n);for(;ln(r,t,o).length>n;){let s=-1;if(r.forEach((i,d)=>{i>1&&(s<0||i>r[s])&&(s=d)}),s<0)break;r[s]=r[s]-1}return r}function Ss(e,t,n){let o=r=>[t.chosen?.has(r.id)?0:1,t.hits?.has(r.id)?0:1,t.flagged?.has(r.id)?0:1,-(t.touched?.get(r.id)??0),-n.neighbors(r.id).length];return e.map((r,s)=>({node:r,index:s,key:o(r)})).sort((r,s)=>{for(let i=0;i<r.key.length;i++)if(r.key[i]!==s.key[i])return r.key[i]-s.key[i];return r.index-s.index}).map(r=>r.node)}var Ms=5,Es=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n];return!1};function Ri(e,t,n){if(e.length===0||t<2)return;let o=e[0].kind,r={schema:n.schema,graph:n.graph,...n.today?{today:n.today}:{}},s=[];for(let d of xi(n.schema,o).groups)if(d.key!==n.exclude)if(d.buckets)for(let c of["decade","year","month"])s.push({by:d.key,bucket:c});else s.push({by:d.key});let i;return s.forEach((d,c)=>{let a=vi(e,{group:d},r).groups;if(a.length<2||a.length>t)return;let f=a.filter(x=>x.key!=="").reduce((x,m)=>x+m.nodes.length,0)/e.length;if(f<.5||a.some(x=>x.nodes.length>e.length*.75))return;let h=[-Math.round(f*100),Math.abs(a.length-Ms),c];(!i||Es(h,i.score))&&(i={grouping:{by:d.by,...d.bucket?{bucket:d.bucket}:{},groups:a},score:h})}),i?.grouping}function eo(e,t){let n=m=>({id:m.node.id,kind:m.node.kind,node:m.node,...m.via?{via:m.via}:{}});if(e.length<=t.budget)return e.map(n);let o={...t.relevance,chosen:new Set([...t.relevance?.chosen??[],...t.selection??[]])},r=new Map;for(let m of e){let g=Ei(m.via,m.node.kind),S=r.get(g);S?S.push(m):r.set(g,[m])}let s=[...r.entries()].map(([m,g])=>({key:m,run:g,via:g[0].via,kinds:[...new Set(g.map(S=>S.node.kind))],members:[],whole:!1,extra:0})),i=ir(s.map(m=>m.run.length),t.budget);s.forEach((m,g)=>m.whole=m.run.length<=i[g]);let d=s.filter(m=>!m.whole),c=s.filter(m=>m.whole).reduce((m,g)=>m+g.run.length,0),l=Math.max(d.length,t.budget-c);for(let m of d){m.members=Ss(m.run.map(S=>S.node),o,t.graph);let g=l-(d.length-1);m.kinds.length>1&&m.kinds.length<=g?m.byKind=!0:m.kinds.length===1&&(m.grouping=Ri(m.members,g,{schema:t.schema,graph:t.graph,...m.via?{exclude:m.via.edgeKind}:{},...t.today?{today:t.today}:{}}))}let a=m=>m.byKind?m.kinds.length:m.grouping?m.grouping.groups.length:1;for(;d.reduce((m,g)=>m+a(g),0)>l;){let m=[...d].filter(g=>a(g)>1).sort((g,S)=>a(S)-a(g))[0];if(!m)break;m.grouping=void 0,m.byKind=!1}l-=d.reduce((m,g)=>m+a(g),0);let u=m=>m.byKind?m.kinds.some(g=>t.expanded.has(_t(g,m.key,"kind"))):m.grouping?.groups.some(g=>t.expanded.has(_t(m.kinds[0],m.key,Qr(m.grouping,g.key)))),f=d.filter(m=>!m.grouping&&!m.byKind?!0:u(m)),h=ir(f.map(m=>m.members.length),Math.max(0,l));f.forEach((m,g)=>m.extra=l>0?h[g]:0);let x=[];for(let m of s){let{key:g,via:S}=m;if(m.whole){x.push(...m.run.map(n));continue}let M=y=>({id:y.id,kind:y.kind,node:y,...S?{via:S}:{}}),w=new Map(m.run.map((y,b)=>[y.node.id,b])),v=(y,b,L)=>{let P=[...y.slice(0,b)].sort((ne,D)=>w.get(ne.id)-w.get(D.id));x.push(...P.map(M));let V=y.slice(b);if(V.length===0)return;let Z=V[0].kind;x.push({id:_t(Z,g,L?`more:${L}`:"more"),kind:Z,...S?{via:S}:{},aggregate:{kind:Z,memberIds:V.map(ne=>ne.id),label:b>0?`${V.length} more ${t.plural(Z).toLowerCase()}`:`${V.length} ${t.plural(Z).toLowerCase()}`,opens:{in:"picture",focus:Ne(Z),within:L?{filter:L}:{}}}})},T=S&&t.focusId?`${S.edgeKind}:${t.focusId}`:void 0;if(m.byKind){let y=m.kinds.find(b=>t.expanded.has(_t(b,g,"kind")));for(let b of m.kinds){let L=m.members.filter(P=>P.kind===b);if(b===y){let P=m.extra+1;L.length<=P?x.push(...L.map(M)):v(L,P-1,T);continue}x.push({id:_t(b,g,"kind"),kind:b,...S?{via:S}:{},aggregate:{kind:b,memberIds:L.map(P=>P.id),label:t.plural(b),opens:{in:"place"}}})}continue}let E=m.grouping;if(!E){v(m.members,m.extra,T);continue}let N=m.kinds[0],F=E.groups.find(y=>t.expanded.has(_t(N,g,Qr(E,y.key))));for(let y of E.groups){if(y===F){let b=m.members.filter(P=>y.nodes.includes(P)),L=m.extra+1;if(b.length<=L)x.push(...b.map(M));else{let P=y.key!==""&&!y.key.includes(",")&&!E.bucket,V=[T,P?`${E.by}:${y.key}`:void 0].filter(Boolean).join(",")||void 0;v(b,L-1,V)}continue}x.push({id:_t(N,g,Qr(E,y.key)),kind:N,...S?{via:S}:{},aggregate:{kind:N,memberIds:m.members.filter(b=>y.nodes.includes(b)).map(b=>b.id),label:y.label.charAt(0).toUpperCase()+y.label.slice(1),opens:{in:"place"}}})}}return x}var Qr=(e,t)=>`${e.by}${e.bucket?`:${e.bucket}`:""}=${t||"none"}`;var ar=300,Oi=12,cn=8,to=19;var sr=(e,t=1)=>(e.length*8.4+16)*t;function Cn(e){return e.description??`${e.direction==="in"?"\u2190":"\u2192"} ${Xn(e.edgeKind).toLowerCase()}`}function no(e,t,n=1){let o=d=>sr(d,n),r=new Map;for(let d of e){let c=r.get(d.key);c?c.push(d):r.set(d.key,[d])}let s=[...r.values()].map(d=>{let c=Math.min(...d.map(a=>a.top)),l=d.filter(a=>a.top-c<=Oi);return{key:d[0].key,text:d[0].text,left:Math.min(...l.map(a=>a.left)),right:Math.max(...l.map(a=>a.right)),top:c}});s.sort((d,c)=>d.top-c.top||d.left-c.left);let i=s.map(d=>{let c=Math.max(d.right-d.left,Math.min(ar,o(d.text))),l=(d.left+d.right)/2;return{left:l-c/2,right:l+c/2}});return s.map((d,c)=>{let l=s.map((w,v)=>({other:w,at:v})).filter(({other:w})=>w!==d&&Math.abs(w.top-d.top)<=Oi),a=l.filter(({other:w})=>w.right<=d.left).map(({other:w,at:v})=>i[v].right+cn<=(w.right+d.left)/2?i[v].right+cn:(w.right+d.left+cn)/2),u=l.filter(({other:w})=>w.left>=d.right).map(({other:w,at:v})=>i[v].left-cn>=(d.right+w.left)/2?i[v].left-cn:(d.right+w.left-cn)/2),f=Math.max(t.left,...a),h=Math.min(t.right,...u),x=d.right-d.left,m=i[c].right-i[c].left,g=Math.max(x,Math.min(m,h-f)),S=(d.left+d.right)/2,M=x>=g?d.left:Math.max(f,Math.min(S-g/2,h-g));return{key:d.key,text:d.text,left:M,width:g,top:d.top}})}function Li(e,t,n,o,r=1){let s=d=>String(d).length*7.4,i=e.length*8.6+6+s(t)+14+(n>0?22+s(n):0);return{width:Math.max(i,o?184:0)*r,height:(o?38:22)*r,short:{width:i*r,height:22*r}}}function Kt(e,t,n=6){return e.x<t.x+t.width+n&&t.x<e.x+e.width+n&&e.y<t.y+t.height+n&&t.y<e.y+e.height+n}var ro=(e,t,n,o)=>{let r=Math.max(e.x,Math.min(t.x,e.x+e.width)),s=Math.max(e.y,Math.min(t.y,e.y+e.height));return Math.abs(r-t.x)/n+Math.abs(s-t.y)/o<.92},In=4,Ai=.45;function oo(e,t,n,o={},r={}){let s={};for(let k of e)s[k.kind]=k.count;let i={x:(o.left??0)+8,y:(o.top??0)+8,width:n.width-(o.left??0)-(o.right??0)-16,height:n.height-(o.top??0)-(o.bottom??0)-16},d=r.avoid??[],c=r.tilt??.5,l=k=>k.nameplate??{width:120,height:34,short:{width:90,height:20}},a=k=>e.map(R=>{let I=k.get(R.kind);return{card:R,plot:I,center:dn(I.col+I.side/2,I.row+I.side/2,1,c)}}),u=(k,R)=>{let I=1/0,O=-1/0,C=1/0,j=-1/0;for(let{card:G,plot:J,center:_}of k){let oe=_.x*R,re=_.y*R,Y=J.side*R/2,me=G.opened>0?l(G).width:l(G).short.width;I=Math.min(I,oe-Math.max(Y+(G.count>12?30:0),me/2)),O=Math.max(O,oe+Math.max(Y,me/2)),C=Math.min(C,re-Y*c-R*Ai),j=Math.max(j,re+Y*c+In+l(G).short.height)}return{minX:I,maxX:O,minY:C,maxY:j}},f=k=>{let R=4,I=160;for(let O=0;O<24;O++){let C=(R+I)/2,j=u(k,C);j.maxX-j.minX<=i.width&&j.maxY-j.minY<=i.height?R=C:I=C}return R},h=k=>{let R={...r.order?{order:r.order}:{},counts:s,...r.plots?{plots:r.plots}:{},pitch:k},I=Ur(t,R),O=Ur(t,{...R,upright:!0}),C=f(a(I)),j=f(a(O)),G=n.height>n.width&&j>=C?O:I;return{map:G,fitted:G===O?j:C}},x=[],m=new Map,g=0,S=(k,R={x:0,y:0})=>{let I=u(x,k),O=i.x+i.width/2-(I.minX+I.maxX)/2+R.x,C=i.y+i.height/2-(I.minY+I.maxY)/2+R.y;return{originX:O,originY:C,cell:k}},M=k=>{let{originX:R,originY:I,cell:O}=k,C=x.map(({center:J})=>J.y),j=Math.max(...C),G=Math.min(...C);return x.map(({card:J,plot:_,center:oe})=>{let re=R+oe.x*O,Y=I+oe.y*O,me=_.side*O/2,le=me*c,ve=j===G?.5:(oe.y-G)/(j-G);return{card:J,plot:_,x:re,y:Y,halfW:me,halfH:le,depth:1-ve*.65}})},w=(k,R=!0)=>{let I=[];return[...k].sort((C,j)=>(j.card.weight??j.card.count)-(C.card.weight??C.card.count)||e.indexOf(C.card)-e.indexOf(j.card)).filter(C=>[l(C.card),l(C.card).short].some(j=>{let G=E(C,j),J=(!R||G.x>=0&&G.y>=0&&G.x+G.width<=n.width&&G.y+G.height<=n.height)&&!I.some(_=>Kt(G,_,4))&&!k.some(_=>_!==C&&ro(G,_,_.halfW,_.halfH))&&!d.some(_=>Kt(G,_,0));return J&&I.push(G),J})).length},v=k=>k.card.marquee?{x:k.x-k.card.marquee.width/2,y:k.y+k.halfH+In+l(k.card).height,width:k.card.marquee.width,height:k.card.marquee.height}:null,T=(k,R,I)=>I.some(O=>{if(O===R)return!1;let C=v(O);return C!==null&&Kt(k,C,4)}),E=(k,R,I="under")=>I==="aside"?{x:k.x+k.halfW+In,y:k.y-R.height/2,width:R.width,height:R.height}:I==="above"?{x:k.x-R.width/2,y:k.y-k.halfH-In-Ai*b.cell-R.height,width:R.width,height:R.height}:{x:k.x-R.width/2,y:k.y+k.halfH+In,width:R.width,height:R.height},N=k=>k.some(R=>d.some(I=>ro(I,R,R.halfW,R.halfH)||Kt(I,E(R,l(R.card).short),0))),F=k=>k.every(R=>{let I=E(R,l(R.card).short);return R.x-R.halfW>=0&&R.x+R.halfW<=n.width&&R.y-R.halfH>=0&&I.x>=0&&I.x+I.width<=n.width&&I.y+I.height<=n.height}),y={pitch:Be,said:-1};for(let k of[Be,Be+1,Be+2,Be+3,Be+5,Be+7]){({map:m,fitted:g}=h(k)),x=a(m);let R=w(M(S(g)));if(R>y.said&&(y={pitch:k,said:R}),R===e.length)break}(y.pitch!==Be+7||y.said!==e.length)&&({map:m,fitted:g}=h(y.pitch),x=a(m));let b=S(g);if(d.length>0&&N(M(b))){let k;for(let R=1;R>=.3&&!k;R-=.05){let I=g*R,O=Math.max(...d.map(j=>j.width))/2+I,C=Math.max(...d.map(j=>j.height))/2+I/2;for(let j of[0,.5,.75,1,1.25]){for(let[G,J]of[[1,0],[-1,0],[0,1],[0,-1],[1,1],[-1,1],[1,-1],[-1,-1]]){let _=S(I,{x:G*O*j,y:J*C*j}),oe=M(_);if(!N(oe)&&F(oe)){k=_;break}if(j===0)break}if(k)break}}k&&(b=k)}let L=(k,R)=>{let I={x:n.width/2,y:n.height/2};return{cell:k.cell*R,originX:I.x+(k.originX-I.x)*R,originY:I.y+(k.originY-I.y)*R}},P=1,V;if(w(M(b))<e.length){let k={said:w(M(b),!1),area:1/0,pitch:-1,by:1},R={map:m,shape:x,fitted:g,where:b};for(let j of[Be,Be+1,Be+2,Be+3,Be+5,Be+7]){({map:m,fitted:g}=h(j)),x=a(m);let G=S(g);for(let J=1;J<=3.001;J+=.1){let _=w(M(L(G,J)),!1),oe=u(x,g*J),re=(oe.maxX-oe.minX)*(oe.maxY-oe.minY);if((_>k.said||_===k.said&&re<k.area)&&(k={said:_,area:re,pitch:j,by:J}),_===e.length)break}}k.pitch<0?{map:m,shape:x,fitted:g,where:b}=R:({map:m,fitted:g}=h(k.pitch),x=a(m),P=k.by,b=L(S(g),P));let I=r.stood&&Math.abs(r.stood.cell-b.cell)<.01?r.stood:null;I&&(b={...b,originX:b.originX+I.x,originY:b.originY+I.y});let O={x:b.originX-(I?.x??0),y:b.originY-(I?.y??0)},C=M(b).filter(j=>r.keep?.includes(j.card.kind));if(C.length>0){let j=C.flatMap(Y=>[{x:Y.x-Y.halfW,y:Y.y-Y.halfH,width:Y.halfW*2,height:Y.halfH*2},E(Y,l(Y.card))]),G=Math.min(...j.map(Y=>Y.x)),J=Math.max(...j.map(Y=>Y.x+Y.width)),_=Math.min(...j.map(Y=>Y.y)),oe=Math.max(...j.map(Y=>Y.y+Y.height)),re=(Y,me,le)=>me-Y>le-16?le/2-(Y+me)/2:Y<8?8-Y:me>le-8?le-8-me:0;b={...b,originX:b.originX+re(G,J,n.width),originY:b.originY+re(_,oe,n.height)}}V={x:b.originX-O.x,y:b.originY-O.y,cell:b.cell}}let Z=r.zoom&&r.zoom!==1?r.zoom:1;Z!==1&&(b=L(b,Z));let ne=M(b),D=[],$=new Map,B=new Map,Q=[...ne].sort((k,R)=>(R.card.weight??R.card.count)-(k.card.weight??k.card.count)||e.indexOf(k.card)-e.indexOf(R.card));for(let k of Q){let R=[["full",l(k.card),"under"],["short",l(k.card).short,"under"]],I="none",O=k===Q[0],C=(G,J)=>R.filter(([_])=>_.startsWith(J)).map(([_,oe,re])=>[_,oe,re,G]),j=O?[...C(!1,"full"),...C(!1,"short"),...C(!0,"full"),...C(!0,"short")]:R.map(([G,J,_])=>[G,J,_,!1]);for(let[G,J,_,oe]of j){let re=E(k,J,_);if((Z!==1||P!==1||re.x>=0&&re.y>=0&&re.x+re.width<=n.width&&re.y+re.height<=n.height)&&!D.some(le=>Kt(re,le,4))&&(oe||!ne.some(le=>le!==k&&ro(re,le,le.halfW,le.halfH)))&&!T(re,k,ne)&&!d.some(le=>Kt(re,le,0))){I=G,D.push(re),B.set(k.card.id,re);break}}$.set(k.card.id,I)}let A=ne.map(k=>({id:k.card.id,x:k.x-k.halfW,y:k.y-k.halfH,width:k.halfW*2,height:k.halfH*2+(k.card.opened>0?Math.max(k.card.openedMin??0,k.card.opened):0),depth:k.depth,plot:k.plot,nameplate:$.get(k.card.id)??"none"})),W=u(x,b.cell),K={cell:b.cell,originX:b.originX,originY:b.originY,pan:r.pan??{x:0,y:0},extent:{x:b.originX+W.minX,y:b.originY+W.minY,width:W.maxX-W.minX,height:W.maxY-W.minY},openedShare:1,...c!==.5?{tilt:c}:{},...V&&(V.x!==0||V.y!==0)?{stood:V}:{},...B.size>0?{nameplates:ne.flatMap(k=>{let R=B.get(k.card.id);return R?[{id:k.card.id,x:R.x-(k.x-k.halfW),y:R.y-(k.y-k.halfH),width:R.width,height:R.height}]:[]})}:{},...ne.some(k=>k.card.marquee)?{showings:ne.flatMap(k=>{let R=v(k);return R?[{id:k.card.id,x:R.x-(k.x-k.halfW),y:R.y-(k.y-k.halfH),width:R.width,height:R.height}]:[]})}:{}};return{placed:A,frame:K,map:m}}function Ot(e){let{width:t,height:n}=e.visible??e,o={x:t*.45,y:n*.45};if(!e.city)return o;let{extent:r}=e.city,s=24;return{x:Math.max(o.x,r.x+r.width-t+s,-r.x+s),y:Math.max(o.y,r.y+r.height-n+s,-r.y+s)}}var dr=48;function io(e){if(!e.city)return[];let{width:t,height:n}=e.visible??e,o=[];for(let r of e.nodes){if(!r.id.startsWith("kind:")||Math.round(r.plane)!==2)continue;let s=r.x+r.width/2,i=r.y+r.height/2,d=s<0?"left":s>t?"right":i<0?"top":i>n?"bottom":null;if(!d)continue;let c=d==="left"||d==="right",l=c?Math.max(0,Math.min(n,i)):Math.max(0,Math.min(t,s)),a=(h,x)=>h<x/4?x/4-h:h>x*3/4?x*3/4-h:0,u=(h,x)=>h<dr?dr-h:h>x-dr?x-dr-h:0,f=c?{x:a(s,t),y:u(i,n)}:{x:u(s,t),y:a(i,n)};o.push({id:r.id,kind:r.id.slice(5),side:d,along:l,by:f})}return o}function lr(e,t,n,o,r){return{x:e.x+(n.x-e.x-t.x-o.x)*(1-r),y:e.y+(n.y-e.y-t.y-o.y)*(1-r)}}var Rs={rankOf:()=>{},parentOf:()=>{}};function Pi(e,t){if(t.size===0)return Rs;let n=e.kinds,o=new Map,r=(l,a)=>{l!==a&&((o.get(l)??o.set(l,new Set).get(l)).add(a),(o.get(a)??o.set(a,new Set).get(a)).add(l))};for(let l of n){let a=e.tryDefinition(l);if(a)for(let u of Object.values(a.edges??{})){let f=u.to==="*"?n:u.to;for(let h of f)r(l,h)}}let s=new Map,i=new Map,d=[...t].filter(l=>n.includes(l));for(let l of d)s.set(l,0);let c=0;for(;d.length>0;){c+=1;let l=[];for(let a of[...d].sort((u,f)=>n.indexOf(u)-n.indexOf(f)))for(let u of[...o.get(a)??[]].sort((f,h)=>n.indexOf(f)-n.indexOf(h)))s.has(u)||(s.set(u,c),c===2&&i.set(u,a),l.push(u));d=l}return{rankOf:l=>{let a=s.get(l);if(a!==0)return a===1?"primary":"secondary"},parentOf:l=>i.get(l)}}function Ti(e,t,n,o,r={}){if(n){let s=new Map;for(let i of e.allEdges()){if(o&&i.kind!==o)continue;let d=i.from===n.id?i.to:i.to===n.id?i.from:null;if(d===null||d===n.id)continue;let c=e.getNode(d);if(!c||s.has(d))continue;let l=i.from===n.id?"out":"in",a=l==="out"?n.kind:c.kind,u=Os(t,a,i.kind,l);s.set(d,{node:c,via:{edgeKind:i.kind,direction:l,...u?{description:u}:{}}})}if(s.size>0){let i=d=>`${d.via.edgeKind}|${d.via.description??""}`;return[...s.values()].sort((d,c)=>(i(d)<i(c)?-1:i(d)>i(c)?1:0)||yt(d.node,c.node))}}if(n){let s=r[n.id]??[],i=new Set,d=[];for(let c of s){if(c===n.id||i.has(c))continue;let l=e.getNode(c);l&&(o&&o!=="judges"&&l.kind!==o||(i.add(c),d.push({node:l,via:{edgeKind:"judges",direction:"out",description:"what it finds wrong"}})))}if(d.length>0)return d.sort((c,l)=>yt(c.node,l.node))}return o?e.allNodes().filter(s=>s.kind===o).sort(yt).map(s=>({node:s})):[]}function Os(e,t,n,o){let s=e.tryDefinition(t)?.edges?.[n];return o==="out"?s?.description:s?.inverse}function Ci(e,t,n){let o=new Map,r=[...t.values()].sort((l,a)=>l.plane-a.plane);for(let l of r)for(let a of l.aggregate?.memberIds??[])!t.has(a)&&!o.has(a)&&o.set(a,l.id);let s=l=>t.get(l)??t.get(o.get(l)??""),i=new Map,d=new Map,c=new Map;for(let l of e.allEdges()){let a=s(l.from),u=s(l.to);if(!a||!u||a.id===u.id&&!(n.overview&&a.aggregate&&a.plane===2))continue;let f=`${l.kind}:${a.id}:${u.id}`,h=i.get(f);if(h){let x=`${l.from}
2
+ ${l.to}`,m=d.get(f);if(m.has(x))continue;if(m.add(x),c.get(f).push({from:l.from,to:l.to}),h.single){let{single:g,...S}=h;i.set(f,S)}continue}d.set(f,new Set([`${l.from}
3
+ ${l.to}`])),c.set(f,[{from:l.from,to:l.to}]),i.set(f,{id:f,kind:l.kind,from:a.id,to:u.id,edges:[{from:l.from,to:l.to}],single:{from:l.from,to:l.to},...a.id===u.id?{loop:!0}:{},x1:a.x+a.width/2,y1:a.y+a.height/2,x2:u.x+u.width/2,y2:u.y+u.height/2})}return[...i.values()].map(l=>({...l,edges:c.get(l.id)})).sort(yt)}var Ni=.85,Ii=60,ao=160;function As(e,t,n,o,r,s=Ni){let i=e*t.width+Math.max(0,e-1)*n,d=Math.max(n,(o-i)/2);return Array.from({length:e},(c,l)=>({x:d+l*(t.width+n),y:r,depth:s}))}function cr(e,t,n,o={}){let r={...Mi,...o},s=Math.max(8,r.unit??16)/16,i=r.inset?.left??0,d=n.overview?Math.max(0,r.dock?.right??0):0,c=n.overview?Math.max(0,r.dock?.bottom??0):0,l=r.width-d-i-(r.inset?.right??0),a=[],u=new Map,f=p=>n.past===!0||Ho(t.tryDefinition(p.kind),p,r.today),h=new Set(o.hiddenKinds??[]),x=p=>!h.has(p.kind),m=n.focusId?Et(n.focusId).filter(p=>t.tryDefinition(p)!==void 0).filter(p=>!h.has(p)):[];n.focusId&&Et(n.focusId).length>0&&m.length===0&&(n={...n,focusId:null});let g=n.focusId?e.getNode(n.focusId):void 0;g&&!x(g)&&(n={...n,focusId:null},m=[]);let S=m.length>0?[...e.allNodes()].filter(p=>m.includes(p.kind)).sort(yt):[],M=S.filter(x).filter(f),w=S.length-M.length,v=n.focusId&&m.length===0?e.getNode(n.focusId):void 0,T=n.zoom===!0&&!n.overview&&n.focusId!==null,E=Math.max(56,r.height*.062),N=Math.min(r.height*.895,r.height-E),F=T?v!==void 0?{focusY:r.height*.03,focusH:r.height*.58,relationY:r.height*.645,relationH:r.height*.2,contextY:N,contextH:E}:{focusY:r.height*.03,focusH:r.height*.71,relationY:r.height*.765,relationH:r.height*.1,contextY:N,contextH:E}:v===void 0?{focusY:r.height*.045,focusH:r.height*.62,relationY:r.height*.68,relationH:r.height*.2,contextY:r.height*.918,contextH:r.height*.082}:(()=>{let p=r.height,z=p*.04,X=Math.max(p*.42,Math.min(p*.56,300)),se=z+X+p*.06;return{focusY:z,focusH:X,relationY:se,relationH:Math.max(p*.12,p*.878-p*.068-se),contextY:p*.878,contextH:p*.092}})(),y=Math.min(r.headroom??0,F.focusY+F.focusH*.2),b=y>F.focusY?{...F,focusY:y,focusH:F.focusH-(y-F.focusY)}:F,L=p=>Math.min(r.gap*p,Math.round(l*.1)),P=T?Math.min(880,l-L(5)):Math.min(700,l-L(6)),V=T?l-L(5):Math.min(r.focusSize.width,l-L(6)),Z=(p,z,X)=>({width:p===0?z:Math.min(z,(l-r.gap*(p+1))/p),height:X}),ne=(p,z,X)=>{let se=Z(p,z,X),Se=Math.min(z,ao*s,l-r.gap*2);return se.width>=Se?se:{width:Se,height:X}},D=p=>Math.max(1,Math.floor((l-r.gap)/(Math.min(p,ao*s,l-r.gap*2)+r.gap))),$=new Set(n.expanded),B=n.overview?[]:Ti(e,t,v,n.relation,r.judged).filter(p=>x(p.node)).filter(p=>f(p.node)),Q=n.overview?0:Math.max(0,Ii*s-b.contextH),A=B.length>0?b.focusH:b.contextY-b.focusY-r.gap*2-Q,W=V,K=r.height,k=Math.min(l*.5/W,r.height*.48/K),R=W*k,I=K*k,O=new Set(o.plainGroups??[]),C=n.overview&&!v&&m.length>0&&n.focusId!==null,j=C&&m.length>0&&m.every(p=>O.has(p));if(C)for(let p of m)j&&o.besideTheMap!==!0?$.add(Me(p)):$.delete(Me(p));let G=C&&!j&&m.length===1?m[0]:void 0,J=G!==void 0&&(o.screens?.[G]?.length??0)>0,_,oe=n.overview===!0&&v!==void 0&&o.besideTheMap===!0;n.overview&&(v||m.length>0)&&n.focusId&&!j&&!J&&!(C&&o.besideTheMap===!0)&&!oe?(_={x:i+(l-R)/2,y:r.height*.53-I/2,width:R,height:I},Dt({id:n.focusId,kind:v?v.kind:m[0],plane:0,x:_.x,y:_.y,width:R,height:I,natural:{width:W,height:K},...v?{}:{aggregate:{kind:m.join("+"),memberIds:M.map(p=>p.id),label:o.plurals?.[n.focusId]??m.map(p=>$t(t,p)).join(" and "),...w>0?{retired:w}:{}}}})):n.overview||(v?Dt({id:v.id,kind:v.kind,plane:0,x:i+(l-P)/2,y:b.focusY,width:P,height:A}):m.length>0&&n.focusId&&Dt({id:n.focusId,kind:m[0],plane:0,x:i+(l-V)/2,y:b.focusY,width:V,height:A,aggregate:{kind:m.join("+"),memberIds:M.map(p=>p.id),label:o.plurals?.[n.focusId]??m.map(p=>$t(t,p)).join(" and "),...w>0?{retired:w}:{}}}));let re=26,Y=52,me=22,le=Math.round(r.relationSize.width*.75),ve=Math.max(1,Math.floor((l-r.gap)/(le+r.gap))),He=r.unit/16,De=new Map;for(let p of B){let z=Zr(p),X=De.get(z);X?X.push(p):De.set(z,[p])}let Pe=[...De.values()],q=Pe.length>1,Te=Math.max(r.gap,me*He),$e=q?Te:r.gap,Tt=Math.max(2,Math.floor((b.relationH+$e)/(re*He+$e))),Ct=Math.min(r.relationSize.width,(l-r.gap*(ve+1))/ve)+r.gap,et=Pe.map(p=>{let z=p[0].via;return!q||!z?1:Math.ceil((Math.min(ar*He,sr(Cn(z),He))+r.gap)/Ct)}),Fe=Pe.map(p=>p.length),It=ln(Fe,ve,et),tt=B.length>ve*Tt||It.length>Tt,wt={schema:t,graph:e,focusId:v?.id,expanded:$,...r.relevance?{relevance:r.relevance}:{},...n.selection?{selection:n.selection}:{},plural:p=>$t(t,p),...r.today?{today:r.today}:{}},Oe=tt||q?Te:r.gap,We,Ye;if(!tt)We=Pe.flat().map(p=>({id:p.node.id,kind:p.node.kind,node:p.node,...p.via?{via:p.via}:{}})),Ye=It;else{let p=Math.max(1,Math.floor((b.relationH+Oe)/(Y*He+Oe))),X=ln(Fe.map(()=>1),ve,et).length<=p?et:[],se=Jr(Fe,ve,p,X),Se=Pe.map((pe,Le)=>eo(pe,{...wt,budget:se[Le]}));We=Se.flat(),Ye=ln(Se.map(pe=>pe.length),ve,X)}let ee=Ye.length,Nt=ee===1?b.relationH:(b.relationH-Oe*(ee-1))/ee,qe=Z(Math.max(...Ye.map(p=>p.reduce((z,X)=>z+X.slots,0)),1),We.length<=2?Math.round(r.relationSize.width*1.35):r.relationSize.width,Nt),xt=[];{let p=qe.width+r.gap,z=[],X=0,se=new Map;for(let pe of Ye.flat())se.set(pe.run,(se.get(pe.run)??0)+pe.cards);for(let pe=0;pe<Pe.length;pe++)z[pe]=X,X+=se.get(pe)??0;let Se=Pe.map(()=>0);Ye.forEach((pe,Le)=>{let pt=pe.reduce((St,Rr)=>St+Rr.slots,0),Kn=pt*qe.width+Math.max(0,pt-1)*r.gap,Un=i+Math.max(r.gap,(l-Kn)/2),gs=b.relationY+Le*(Nt+Oe);for(let St of pe){let Rr=St.slots*p-r.gap,ws=St.cards*p-r.gap,xs=Un+(Rr-ws)/2;for(let Or=0;Or<St.cards;Or++)xt[z[St.run]+Se[St.run]++]={x:xs+Or*p,y:gs};Un+=St.slots*p}})}We.forEach((p,z)=>{let X=xt[z];Dt({id:p.id,kind:p.kind,plane:1,x:X.x,y:X.y,width:qe.width,height:qe.height,...p.via?{via:p.via}:{},...p.aggregate?{aggregate:p.aggregate}:{},...tt&&!p.aggregate?{compact:!0}:{}})});let yn=new Set(u.keys());for(let p of M)yn.add(p.id);let it=new Map;for(let p of e.allNodes()){let z=it.get(p.kind);z?z.push(p):it.set(p.kind,[p])}let ce=new Set(m.length>0?m:v?[v.kind]:[]),ke=[];for(let p of t.kinds){if(h.has(p))continue;let z=it.get(p)??[],X=z.filter(f);ke.push({id:Me(p),kind:p,members:X.sort(yt),retired:z.length-X.length,...ce.has(p)?{focused:!0}:{}})}for(let p of ke)p.kind===n.relation&&(p.raised=!0);ke.sort(yt);let ht=Pi(t,ce),at=!n.overview&&t.kinds.some(p=>ht.rankOf(p)==="primary"),Ae=[];for(let p of ke)if(!n.overview&&$.has(p.id)&&p.members.length>0)for(let z of p.members)Ae.push({id:z.id,kind:z.kind});else{let z=at?ht.rankOf(p.kind):void 0,X=z==="secondary"?ht.parentOf(p.kind):void 0;Ae.push({id:p.id,kind:p.kind,...p.raised?{raised:!0}:{},...p.focused?{focused:!0}:{},...n.overview&&$.has(p.id)?{opened:!0}:{},...z?{rank:z}:{},...X&&!$.has(Me(X))?{nestedUnder:Me(X)}:{},aggregate:{kind:p.kind,memberIds:p.members.map(se=>se.id),label:o.plurals?.[p.kind]??$t(t,p.kind),...p.retired>0?{retired:p.retired}:{}}})}let Ht=2;if(Ae.length<=D((T?240:r.contextSize.width)*s))for(let p of Ae)delete p.nestedUnder;let jn=new Map;for(let p of Ae){if(p.nestedUnder===void 0)continue;let z=jn.get(p.nestedUnder)??0;z>=Ht?delete p.nestedUnder:jn.set(p.nestedUnder,z+1)}let Vn=Ae.filter(p=>p.nestedUnder!==void 0),mt=Ae.filter(p=>p.nestedUnder===void 0),gn=D((T?240:r.contextSize.width)*s),wn=!n.overview&&mt.length>gn,bt=Math.max(0,gn-1),vt=p=>p.focused?0:p.raised?1:2,xn=new Set([...mt].map((p,z)=>({item:p,at:z})).sort((p,z)=>vt(p.item)-vt(z.item)||p.at-z.at).slice(0,bt).map(({item:p})=>p.id)),bn=new Set(wn?mt.filter(p=>!xn.has(p.id)).map(p=>p.id):[]),vn=Vn.filter(p=>!bn.has(p.nestedUnder)),Er=Vn.filter(p=>bn.has(p.nestedUnder)),kt=wn?[...mt.filter(p=>xn.has(p.id)),{id:zo,kind:"",beyond:[...mt.filter(p=>bn.has(p.id)),...Er].map(p=>p.kind)}]:mt,st=n.overview?{width:Math.min(220,l/6.5),height:Math.min(92,r.height*.125)}:ne(kt.length,(T?240:r.contextSize.width)*s,b.contextH),Qe=r.relevance?.flagged,Gn=(p,z)=>{let X=Xr(t,p);if(!X)return{};let se=X.values.map(()=>0),Se=0;for(let pe of z){let Le=X.values.indexOf(e.getNode(pe)?.[X.field]);Le<0?Se++:se[Le]++}return{states:{field:X.field,values:[...X.values.map((pe,Le)=>({value:pe,tier:X.tiers[Le],count:se[Le]})),...Se>0?[{value:null,tier:"waiting",count:Se}]:[]]}}},_e=n.overview?oo(kt.map(p=>{let z=p.aggregate?.memberIds??[],X=Qe?z.filter(se=>Qe.has(se)).length:0;return{id:p.id,kind:p.kind,count:z.length,opened:$.has(p.id)?an(on(z.length))*s:0,openedMin:$.has(p.id)?an(Math.min(Kr,on(z.length)))*s:0,nameplate:Li(p.aggregate?.label??$t(t,p.kind),z.length,X,Xr(t,p.kind)!==void 0,s),weight:X*1e3+z.length,...m.includes(p.kind)&&(o.screens?.[p.kind]?.length??0)>0?{marquee:{width:zr+12,height:Yr(o.screens[p.kind].map(se=>se.title),zr,o.nameWidth)+8}}:{}}}),t,{width:r.width-d,height:r.height-c},r.chrome?{...r.inset,right:Math.min(r.inset?.right??0,8)}:r.inset??{},{...r.cityOrder?{order:r.cityOrder}:{},...r.plots?{plots:r.plots}:{},...o.cityZoom&&o.cityZoom!==1?{zoom:o.cityZoom}:{},...o.cityStood?{stood:o.cityStood}:{},keep:[...n.selection??[],...n.focusId?[n.focusId]:[]].flatMap(p=>p.startsWith("kind:")?[p.slice(5)]:p.startsWith("aggregate:")&&!p.includes("|")?[p.slice(10)]:oe&&p===v?.id?[v.kind]:[]),...o.tilt!==void 0?{tilt:o.tilt}:{},pan:{x:n.pan?.x??0,y:n.pan?.y??0},..._||r.chrome?.length?{avoid:[..._?[_]:[],...r.chrome??[]]}:{}}):null,zn=new Map(_e?.placed.map(p=>[p.id,p.plot])??[]),Yn=new Map(_e?.placed.map(p=>[p.id,p.nameplate])??[]),Bt=_e?_e.placed.map(({x:p,y:z,depth:X,width:se,height:Se})=>({x:p,y:z,depth:X,width:se,height:Se})):As(kt.length,st,r.gap,l,b.contextY,T?.97:Ni).map(p=>({...p,x:p.x+i})),kn=.74,H=.8,fe=52*s,ye=86*s,ge=(p,z)=>Math.min(1,p+(1-p)*z),Ce=new Map;kt.forEach((p,z)=>{let X=Bt[z],se=X.width??st.width,Se=X.height??st.height,pe=p.rank==="secondary"?kn:1,Le=_e?se:Math.max(Math.min(se,ao*s),se*pe),pt=_e?Se:Math.max(Ii*s,Se*pe);Ce.set(p.id,{x:X.x+(se-Le)/2,y:X.y+(Se-pt),depth:p.rank==="secondary"?ge(X.depth,.5):X.depth,width:Le,height:pt})});let je=[],Ze=Bt[Bt.length-1],Qt=new Map;for(let p of vn)Qt.set(p.nestedUnder,(Qt.get(p.nestedUnder)??0)+1);let _n=new Map;for(let p of vn){let z=Ce.get(p.nestedUnder);if(z){let X=Qt.get(p.nestedUnder)??1,se=_n.get(p.nestedUnder)??0;_n.set(p.nestedUnder,se+1);let Se=.98,pe=st.width*H,Le=Math.max(ye,Math.min(pe,z.width/(Se*(X-1)+1))),pt=Math.max(fe,st.height*H*(Le/pe)),Kn=Le*Se,Un=(X-1)*Kn+Le;je.push({...p,x:z.x+(z.width-Un)/2+se*Kn,y:Math.max(0,z.y-pt+Math.min(pt*.5,16)),width:Le,height:pt,depth:ge(z.depth,.8)})}else if(Ze){let X=st.width*H,se=st.height*H;je.push({...p,x:Ze.x,y:Ze.y,width:X,height:se,depth:ge(Ze.depth??1,.8)})}}for(let p of kt)je.push({...p,...Ce.get(p.id)});return je.forEach(p=>{Dt({id:p.id,kind:p.kind,plane:2,x:p.x,y:p.y,width:p.width,height:p.height,...p.aggregate?{aggregate:p.aggregate}:{},...p.raised?{raised:!0}:{},...p.focused?{focused:!0}:{},...p.opened?{opened:!0}:{},...p.opened?{openedRows:Math.max(1,Math.floor((Math.max(an(Math.min(Kr,on(p.aggregate?.memberIds.length??0))),an(on(p.aggregate?.memberIds.length??0))*(_e?.frame.openedShare??1))-ci)/_r))}:{},...p.rank?{rank:p.rank}:{},...p.nestedUnder?{nestedUnder:p.nestedUnder}:{},...p.beyond?{beyond:p.beyond}:{},...zn.has(p.id)?{plot:zn.get(p.id)}:{},...Yn.has(p.id)?{nameplate:Yn.get(p.id)}:{},..._e&&p.aggregate?Gn(p.kind,p.aggregate.memberIds):{},depth:p.depth})}),{nodes:a,connectors:Ci(e,u,n),width:r.width,height:r.height,..._e?{city:_e.frame}:{},...n.pan&&(n.pan.x!==0||n.pan.y!==0)?{pan:{x:n.pan.x,y:n.pan.y}}:{},...d>0||c>0?{visible:{width:r.width-d,height:r.height-c}}:{}};function Dt(p){let z=n.overview&&Ie(p.id)!==null?void 0:n.pins[p.id],X=z?{...p,x:z.x,y:z.y,pinned:!0}:{...p,pinned:!1},se=n.pan?{...X,x:X.x+n.pan.x,y:X.y+n.pan.y}:X;a.push(se),u.set(se.id,se)}}function so(e,t,n){let o=e.nodes.find(d=>d.id===t);if(!o||o.screenOf!==void 0)return null;let r={...o,x:n.x,y:n.y,pinned:!0},s=r.x+r.width/2,i=r.y+r.height/2;return{...e,nodes:e.nodes.map(d=>d.id===t?r:d),connectors:e.connectors.map(d=>d.from===t?{...d,x1:s,y1:i}:d.to===t?{...d,x2:s,y2:i}:d)}}function lo(e,t){return t.x===0&&t.y===0?e:{...e,nodes:e.nodes.map(n=>({...n,x:n.x+t.x,y:n.y+t.y})),connectors:e.connectors.map(n=>({...n,x1:n.x1+t.x,y1:n.y1+t.y,x2:n.x2+t.x,y2:n.y2+t.y})),...e.city?{city:{...e.city,pan:{x:t.x,y:t.y}}}:{},pan:{x:t.x,y:t.y}}}var xe=(e,t,n)=>e+(t-e)*n;function Hi(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}var Bi=new WeakMap;function Ls(e){let t=Bi.get(e);if(t)return t;let n=new Map,o=new Map;for(let r of e.nodes){n.set(r.id,r);for(let s of r.aggregate?.memberIds??[]){let i=o.get(s);i?i.push(r):o.set(s,[r])}}return t={byId:n,groupsOf:o},Bi.set(e,t),t}var Di=new WeakMap;function $i(e,t){let n=Di.get(t);if(n||Di.set(t,n=new WeakMap),n.has(e))return n.get(e);let o=Ps(e,t);return n.set(e,o),o}function Ps(e,t){let{byId:n,groupsOf:o}=Ls(t);if(e.screenOf!==void 0){let i=n.get(Me(e.screenOf));if(i)return{...e,x:i.x,y:i.y,width:i.width,height:i.height}}if(Wt(e.id)||Ie(e.id)!==null){let i=(e.aggregate?.memberIds??[]).map(a=>n.get(a)).filter(a=>a!==void 0);if(i.length===0)return null;let d=i.map(Hi),c=d.reduce((a,u)=>a+u.x,0)/d.length,l=d.reduce((a,u)=>a+u.y,0)/d.length;return{...e,x:c-e.width/2,y:l-e.height/2}}let r=o.get(e.id)?.find(i=>i.id===Me(e.kind)||i.id===Ne(e.kind));if(!r)return null;let s=Hi(r);return{...e,x:s.x-e.width/2,y:s.y-e.height/2}}function lt(e,t,n){let o=Math.max(0,Math.min(1,n)),r=new Map(e.nodes.map(a=>[a.id,a])),s=new Map(t.nodes.map(a=>[a.id,a])),i=[];for(let[a,u]of r){let f=s.get(a);if(f){i.push(co(u,f,o,1));continue}let h=$i(u,t)??u;i.push(co(u,h,o,1-o))}for(let[a,u]of s){if(r.has(a))continue;let f=$i(u,e)??u;i.push(co(f,u,o,o))}let d=new Map(e.connectors.map(a=>[a.id,a])),c=new Map(t.connectors.map(a=>[a.id,a])),l=[];for(let[a,u]of d){let f=c.get(a);l.push(f?{...Ts(u,f,o),opacity:1}:{...u,opacity:1-o})}for(let[a,u]of c)d.has(a)||l.push({...u,opacity:o});return{nodes:i.filter(a=>a.opacity>0).sort((a,u)=>a.id<u.id?-1:a.id>u.id?1:0),connectors:l.filter(a=>a.opacity>0).sort((a,u)=>a.id<u.id?-1:a.id>u.id?1:0),width:xe(e.width,t.width,o),height:xe(e.height,t.height,o),t:o,...Fi(e.city,t.city,o)?{city:Fi(e.city,t.city,o)}:{},...e.pan||t.pan?{pan:{x:xe(e.pan?.x??0,t.pan?.x??0,o),y:xe(e.pan?.y??0,t.pan?.y??0,o)}}:{}}}function Fi(e,t,n){return e?t?{cell:xe(e.cell,t.cell,n),...e.tilt!==void 0||t.tilt!==void 0?{tilt:xe(e.tilt??.5,t.tilt??.5,n)}:{},originX:xe(e.originX,t.originX,n),originY:xe(e.originY,t.originY,n),pan:{x:xe(e.pan.x,t.pan.x,n),y:xe(e.pan.y,t.pan.y,n)},extent:{x:xe(e.extent.x,t.extent.x,n),y:xe(e.extent.y,t.extent.y,n),width:xe(e.extent.width,t.extent.width,n),height:xe(e.extent.height,t.extent.height,n)}}:e:t}function co(e,t,n,o){return{id:t.id,kind:t.kind,plane:xe(e.plane,t.plane,n),x:xe(e.x,t.x,n),y:xe(e.y,t.y,n),width:xe(e.width,t.width,n),height:xe(e.height,t.height,n),pinned:t.pinned,opacity:o,...t.aggregate?{aggregate:t.aggregate}:{},...t.via?{via:t.via}:{},...t.raised?{raised:!0}:{},...t.focused?{focused:!0}:{},...t.opened?{opened:!0}:{},...t.openedRows!==void 0?{openedRows:t.openedRows}:{},...t.compact?{compact:!0}:{},...t.rank?{rank:t.rank}:{},...t.nestedUnder?{nestedUnder:t.nestedUnder}:{},...t.beyond?{beyond:t.beyond}:{},...t.plot?{plot:t.plot}:{},...t.nameplate?{nameplate:t.nameplate}:{},...t.states?{states:t.states}:{},...t.screenOf?{screenOf:t.screenOf}:{},...t.depth===void 0?{}:{depth:xe(e.depth??1,t.depth,n)},...t.natural?{natural:t.natural}:{}}}function Ts(e,t,n){return{...t,x1:xe(e.x1,t.x1,n),y1:xe(e.y1,t.y1,n),x2:xe(e.x2,t.x2,n),y2:xe(e.y2,t.y2,n)}}function ur(e){let t=Math.max(0,Math.min(1,e));return t<.5?4*t*t*t:1-(-2*t+2)**3/2}function Cs(e,t){let n=[];for(let r=0;r<e.length;r+=1){let s=e[r],i=e[(r+1)%e.length];if(s.y===i.y)continue;let d=Math.min(s.y,i.y),c=Math.max(s.y,i.y);t<d||t>=c||n.push(s.x+(t-s.y)/(i.y-s.y)*(i.x-s.x))}n.sort((r,s)=>r-s);let o={x0:0,x1:0};for(let r=0;r+1<n.length;r+=2){let s={x0:n[r],x1:n[r+1]};s.x1-s.x0>o.x1-o.x0&&(o=s)}return o}function Is(e){let t=1/0,n=-1/0;for(let o of e)o.y<t&&(t=o.y),o.y>n&&(n=o.y);return{top:t,bottom:n}}function Ns(e){let t=0;for(let n=0;n<e.length;n+=1){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2}function Hs(e){let t=0,n=0,o=0;for(let r=0;r<e.length;r+=1){let s=e[r],i=e[(r+1)%e.length],d=s.x*i.y-i.x*s.y;t+=d,n+=(s.x+i.x)*d,o+=(s.y+i.y)*d}if(Math.abs(t)<1e-9){let r=e.reduce((s,i)=>({x:s.x+i.x,y:s.y+i.y}),{x:0,y:0});return{x:r.x/e.length,y:r.y/e.length}}return{x:n/(3*t),y:o/(3*t)}}function Bs(e,t){let{room:n,height:o,size:r,floor:s,measure:i=Gr,lines:d=2}=t,c=(m,g)=>m.every(S=>i(S,g)<=n)&&m.length*g*1.15<=o;if(c([e],r))return{lines:[e],fontSize:r,whole:!0};let l=e.split(/\s+/);if(d>1&&l.length>1){let m=1,g=1/0,S=0;for(let w=0;w<l.length-1;w+=1){S+=l[w].length+1;let v=Math.abs(S-e.length/2);v<g&&(g=v,m=w+1)}let M=[l.slice(0,m).join(" "),l.slice(m).join(" ")];if(c(M,r))return{lines:M,fontSize:r,whole:!0};for(let w=r;w>=s;w-=r*.06)if(c(M,w))return{lines:M,fontSize:w,whole:!0}}for(let m=r;m>=s;m-=r*.06)if(c([e],m))return{lines:[e],fontSize:m,whole:!0};let a=i(e,s)/Math.max(1,e.length),u=Math.floor(n/a)-1;if(u<4||s*1.15>o)return null;let f=e.slice(0,u),h=f.lastIndexOf(" ");return{lines:[`${h>3?f.slice(0,h):f}\u2026`],fontSize:s,whole:!1}}var Ds=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;var U=ie(Re(),1);var uo=ie(Re(),1),$s=500,Fs=10;function Wi(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Ws(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function js(e){return e.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??e.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0}function ji({swallow:e,setMenuAt:t,setSelection:n}){let o=(0,uo.useRef)(0),r=(0,uo.useRef)(null),s=()=>{r.current&&clearTimeout(r.current.timer),r.current=null},i=(d,c,l)=>{let a=js(d);a&&n([a]),t(a?{x:c,y:l,on:a}:{x:c,y:l})};return{onContextMenu:d=>{let c=d.target;d.shiftKey||Wi(c)||Ws(c)||(d.preventDefault(),!c.closest("[data-graview-popover], [data-graview-offstage]")&&(Date.now()-o.current<700||i(c,d.clientX,d.clientY)))},onPointerDown:d=>{if(s(),d.pointerType==="mouse"||!d.isPrimary)return;let c=d.target;if(Wi(c)||c.closest("[data-graview-popover], [data-graview-offstage], button, a, input, select, textarea"))return;let{clientX:l,clientY:a}=d;r.current={x:l,y:a,timer:setTimeout(()=>{r.current=null,o.current=Date.now(),e.current=!0,setTimeout(()=>e.current=!1,700),i(c,l,a)},$s)}},onPointerMove:d=>{let c=r.current;c&&Math.hypot(d.clientX-c.x,d.clientY-c.y)>Fs&&s()},onPointerUp:s}}var At=ie(Re(),1);function Vi(e){let[t,n]=(0,At.useState)(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(e).matches);return(0,At.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia(e),r=()=>n(o.matches);return r(),o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function Vs(){let e=()=>typeof document>"u"?null:document.documentElement.getAttribute("data-graview-motion"),[t,n]=(0,At.useState)(e);return(0,At.useEffect)(()=>{if(typeof document>"u"||typeof MutationObserver>"u")return;let o=new MutationObserver(()=>n(e()));return o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-graview-motion"]}),n(e()),()=>o.disconnect()},[]),t}function Gi(e){let t=Vi("(prefers-reduced-motion: reduce)"),n=Vi("(prefers-reduced-transparency: reduce)"),o=Vs();return oi({off:!e,reducedMotion:o==="reduce"||o!=="full"&&t,reducedTransparency:n})}var Gs=ei*1.5,zs=30;function zi(e,t){let[n,o]=(0,At.useState)(!1),r=e&&!n;return(0,At.useEffect)(()=>{if(!r||!t||typeof requestAnimationFrame>"u")return;let s=[],i=0,d=0,c=l=>{if(i>0&&s.push(l-i),i=l,s.length>=zs){if(!ii(s,Gs)){o(!0);return}s.length=0}d=requestAnimationFrame(c)};return d=requestAnimationFrame(c),()=>cancelAnimationFrame(d)},[r,t]),r}var Ge=ie(Re(),1);var Ys=520;function _s(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Yi(e,t={}){let n=t.duration??Ys,o=(t.enabled??!0)&&!_s(),r=t.settle??!0,s=(0,Ge.useRef)(e),[,i]=(0,Ge.useState)(()=>lt(e,e,1)),d=(0,Ge.useRef)(null);d.current??=lt(e,e,1);let c=(0,Ge.useRef)(null),l=(0,Ge.useRef)(null);!o&&l.current!==e&&(l.current=e,d.current=lt(e,e,1)),o&&(l.current=null);let a=(0,Ge.useRef)(null);return(0,Ge.useEffect)(()=>{if(!o||typeof requestAnimationFrame>"u"){if(s.current=e,l.current!==e){let M=lt(e,e,1);d.current=M,i(M)}if(typeof requestAnimationFrame>"u"||!r)return;let S=requestAnimationFrame(()=>{let M=lt(e,e,1);d.current=M,i(M)});return()=>cancelAnimationFrame(S)}if(s.current===e&&d.current.t>=1){if(!r)return;let S=requestAnimationFrame(()=>{let M=lt(e,e,1);d.current=M,i(M)});return()=>cancelAnimationFrame(S)}let u=performance.now(),h=a.current!==null&&d.current.t<1&&u-a.current<n?a.current:u;a.current=h;let x=ur(Math.min(1,(u-h)/n)),m=s.current,g=S=>{let M=Math.min(1,(S-h)/n),w=x>=1?1:(ur(M)-x)/(1-x),v=lt(m,e,Math.max(0,w));d.current=v,i(v),M<1?c.current=requestAnimationFrame(g):(a.current=null,s.current=e,c.current=requestAnimationFrame(()=>{let T=lt(e,e,1);d.current=T,i(T),c.current=null}))};return c.current=requestAnimationFrame(g),()=>{c.current!==null&&cancelAnimationFrame(c.current);let S=d.current;s.current={...e,...S.city?{city:S.city}:{},pan:S.pan??{x:0,y:0},nodes:S.nodes.map(M=>({...M,plane:Math.round(M.plane)})),connectors:S.connectors}}},[e,n,o,r]),d.current}function _i(e=1100){let{store:t}=we(),[n,o]=(0,Ge.useState)(()=>new Set);return(0,Ge.useEffect)(()=>{let r=null,s=t.subscribe(i=>{o(new Set(i.touched)),r&&clearTimeout(r),r=setTimeout(()=>o(new Set),e)});return()=>{s(),r&&clearTimeout(r)}},[t,e]),n}var Ks={marks:new Map,acts:[]};function Ki(e=4e3){let{store:t}=we(),[n,o]=(0,Ge.useState)(Ks);return(0,Ge.useEffect)(()=>{let r=null,s=t.subscribe((i,d)=>{o(c=>{let l=new Map(c.marks),a=[...c.acts];for(let u of d){if(u.undoes!==void 0){let x=a.find(g=>g.batch===u.undoes||g.wrote.length>0),m=a.filter(g=>u.writes.some(S=>g.wrote.includes(S)));for(let g of m.length>0?m:x?[x]:[]){for(let S of g.wrote)l.delete(S);a=a.filter(S=>S.batch!==g.batch)}continue}if(u.author.kind!=="agent")continue;let f=u.author.id??"the seat";for(let x of u.writes)l.set(x,f);a.find(x=>x.batch===u.batch)?a=a.map(x=>x.batch===u.batch?{...x,wrote:[...new Set([...x.wrote,...u.writes])]}:x):a=[{batch:u.batch,who:f,intent:u.batchIntent??u.intent,at:u.at,wrote:[...u.writes]},...a].slice(0,12)}return l.size===c.marks.size&&a===c.acts&&l.size===0?c:{marks:l,acts:a}}),r&&clearTimeout(r),r=setTimeout(()=>o(c=>c.marks.size===0?c:{...c,marks:new Map}),e)});return()=>{s(),r&&clearTimeout(r)}},[t,e]),n}var Ut=ie(Ee(),1),nt=16;function Ui({marks:e,questions:t=[],whereIs:n,stageRef:o,width:r,height:s}){if(e.size===0&&t.length===0)return null;let i=o.current,d=i?.getBoundingClientRect()??null,c=[];for(let[a,u]of e){let f=null;if(i&&d&&typeof CSS<"u"){let g=i.querySelector(`[data-graview-pick="${CSS.escape(a)}"]`)?.getBoundingClientRect();g&&g.width>0&&g.height>0&&(f={x:g.left-d.left,y:g.top-d.top,width:g.width,height:g.height})}if(f??=n(a),!f)continue;let h=Math.min(Math.max(f.x+f.width-nt/2,nt/2),r-nt/2),x=Math.min(Math.max(f.y-nt/4,nt/2),s-nt/2);c.push({id:a,who:u,x:h,y:x})}let l=[];for(let a of t){let u=n(a.id);u&&l.push({...a,x:Math.min(Math.max(u.x+u.width/2,nt),r-nt),y:Math.min(Math.max(u.y-nt/2,nt),s-nt)})}return c.length===0&&l.length===0?null:(0,Ut.jsxs)("div",{className:"graview-seat-marks","data-testid":"seat-marks","data-graview-seat-marks":c.length,children:[c.map(({id:a,who:u,x:f,y:h})=>(0,Ut.jsx)("span",{className:"graview-seat-mark","data-testid":"seat-mark","data-graview-seat-mark":a,"data-graview-seat-who":u,title:`${u} just changed this`,"aria-hidden":"true",style:{left:f,top:h,"--graview-hue":Sn(u)},children:"\u25C6"},a)),l.map(a=>(0,Ut.jsxs)("span",{className:"graview-seat-asking","data-testid":"seat-question","data-graview-seat-asking":a.id,title:a.asks,style:{left:a.x,top:a.y},children:[(0,Ut.jsx)("span",{"aria-hidden":"true",children:"?"}),(0,Ut.jsx)("span",{className:"graview-seat-asking-said",children:a.asks})]},`asking:${a.id}`))]})}var te=ie(Ee(),1);function Us({hue:e,mode:t}){let n=t==="docked";return(0,te.jsxs)("svg",{viewBox:"0 0 32 38","aria-hidden":"true",children:[(0,te.jsxs)("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round",strokeLinecap:"round",children:[(0,te.jsx)("line",{x1:"16",y1:"3.5",x2:"16",y2:"7"}),(0,te.jsx)("circle",{cx:"16",cy:"2.6",r:"1.5",fill:"none"}),(0,te.jsx)("path",{d:"M8 16 V12.5 C8 8.5 11.5 7 16 7 C20.5 7 24 8.5 24 12.5 V16 Z",fill:"currentColor",fillOpacity:"0.1"}),t==="refused"?(0,te.jsx)("line",{x1:"11",y1:"12.5",x2:"21",y2:"12.5",strokeWidth:"2"}):(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)("rect",{x:"10.2",y:"10.2",width:"11.6",height:"4.6",rx:"2.3",fill:"currentColor",fillOpacity:"0.14",strokeWidth:"1"}),(0,te.jsx)("circle",{cx:"13.4",cy:"12.5",r:"1.25",fill:"currentColor",stroke:"none",opacity:n?.45:1}),(0,te.jsx)("circle",{cx:"18.6",cy:"12.5",r:"1.25",fill:"currentColor",stroke:"none",opacity:n?.45:1}),t==="reading"?(0,te.jsx)("line",{x1:"10.2",y1:"12.5",x2:"21.8",y2:"12.5",strokeWidth:"0.8",opacity:"0.7"}):null]}),(0,te.jsx)("line",{x1:"16",y1:"16",x2:"16",y2:"18.5"}),(0,te.jsx)("polygon",{points:"16,18.5 24,22.5 16,26.5 8,22.5",fill:"currentColor",fillOpacity:"0.22"}),(0,te.jsx)("polygon",{points:"8,22.5 16,26.5 16,33.5 8,29.5",fill:"currentColor",fillOpacity:"0.08"}),(0,te.jsx)("polygon",{points:"24,22.5 16,26.5 16,33.5 24,29.5",fill:"currentColor",fillOpacity:"0.3"}),t==="writing"?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)("polyline",{points:"24,24 28.5,20.5"}),(0,te.jsx)("line",{x1:"27.5",y1:"19",x2:"30",y2:"21.5",strokeWidth:"1.8"})]}):(0,te.jsx)("line",{x1:"24",y1:"24",x2:"26.5",y2:"29"}),(0,te.jsx)("line",{x1:"8",y1:"24",x2:"5.5",y2:"29"}),(0,te.jsx)("path",{d:"M9.5 33.5 v2.2 h4"}),(0,te.jsx)("path",{d:"M22.5 33.5 v2.2 h-4"})]}),(0,te.jsx)("title",{children:`robot, ${t}`})]})}function Xs({hue:e}){return(0,te.jsxs)("svg",{viewBox:"0 0 22 24","aria-hidden":"true",style:{color:`hsl(${Math.round(e)} 50% 48%)`},children:[(0,te.jsxs)("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round",strokeLinecap:"round",children:[(0,te.jsx)("circle",{cx:"11",cy:"6",r:"4.2"}),(0,te.jsx)("path",{d:"M3 23 C3 15.5 6 13 11 13 C16 13 19 15.5 19 23"})]}),(0,te.jsx)("title",{children:"somebody"})]})}function Xi({width:e,whereIs:t}){let{who:n,following:o,follow:r}=we(),s=hi([...n.values()],t,e);return s.length===0?null:(0,te.jsx)("div",{className:"graview-occupants","data-testid":"occupants","data-graview-occupants":s.length,children:s.map((i,d)=>{if(i.kind==="over")return(0,te.jsx)("div",{className:"graview-presence-over","data-testid":"presence-over","data-graview-over-by":i.presence.participant,style:{left:i.box.x-3,top:i.box.y-3,width:i.box.width+6,height:i.box.height+6,"--graview-hue":i.presence.hue}},`over:${i.presence.participant}`);if(i.kind==="count")return(0,te.jsxs)("span",{className:"graview-figure-count","data-testid":"presence-count","data-graview-at":i.at,style:{left:i.point.x,top:i.point.y},title:`${i.n} more here`,children:["+",i.n]},`count:${i.at}:${d}`);let c=i.presence.hue,l=Wo(i.presence)||"somebody";if(i.kind==="edge")return(0,te.jsxs)("button",{type:"button",className:"graview-figure-edge","data-testid":"presence-edge","data-graview-person":i.presence.participant,style:{right:`calc(${Math.max(8,e-i.point.x)}px + var(--graview-dock, 0px))`,top:i.point.y},onClick:()=>r(i.presence.participant),"aria-label":`${l} is somewhere else \u2014 press to go where they are`,children:["\u2192 ",l]},`edge:${i.presence.participant}`);if(i.kind==="robot")return(0,te.jsxs)("div",{className:"graview-figure","data-graview-figure":`theirs:${i.presence.participant}`,"data-graview-theirs":"","data-graview-mode":i.mode,"data-graview-at":i.presence.robot?.at??"",style:{transform:`translate(${i.point.x.toFixed(1)}px, ${i.point.y.toFixed(1)}px)`,"--graview-hue":c},children:[(0,te.jsx)("span",{className:"graview-figure-body",role:"img","aria-label":`${l}'s agent \u2014 ${i.mode}`,style:{cursor:"default"},children:(0,te.jsx)(Us,{hue:c,mode:i.mode})}),(0,te.jsxs)("span",{className:"graview-figure-name",children:[l,"'s agent"]})]},`robot:${i.presence.participant}`);let a=o?.participant===i.presence.participant;return(0,te.jsxs)("div",{className:"graview-figure","data-graview-figure":i.presence.participant,"data-graview-person":"","data-graview-at":i.at,"data-graview-audience":i.audience?"":void 0,"data-graview-followed":a?"":void 0,style:{transform:`translate(${i.point.x.toFixed(1)}px, ${i.point.y.toFixed(1)}px)`,"--graview-hue":c},children:[(0,te.jsx)("button",{type:"button",className:"graview-figure-body","aria-label":`${l} is here${a?". Press to stop following":". Press to go where they go"}`,"aria-pressed":a,onClick:u=>{u.stopPropagation(),r(a?null:i.presence.participant)},onPointerDown:u=>u.stopPropagation(),children:(0,te.jsx)(Xs,{hue:c})}),(0,te.jsx)("span",{className:"graview-figure-name",children:l})]},`person:${i.presence.participant}`)})})}var un=ie(Re(),1),Bn=ie(Ee(),1),qi={left:"\u2190",right:"\u2192",top:"\u2191",bottom:"\u2193"},fo=36,Hn=56;function Qi({result:e,schema:t,chrome:n=[],onGo:o}){let r=io(e);if(r.length===0)return null;let s=a=>(a??[]).flatMap(u=>{let f=e.nodes.find(h=>h.id===u.id);return f?[{left:f.x+u.x,top:f.y+u.y,right:f.x+u.x+u.width,bottom:f.y+u.y+u.height}]:[]}),i=s(e.city?.showings),d=s(e.city?.nameplates),c=[...i,...d,...n.map(a=>({left:a.x,top:a.y,right:a.x+a.width,bottom:a.y+a.height}))],l=[];for(let a of["left","right","top","bottom"]){let u=e.visible??e,f=a==="left"||a==="right"?u.height:u.width,h=a==="left"||a==="right",x=a==="bottom"?Zs:a==="top"?Hn:Js+Hn/2,m=-1/0,g=[],S=r.filter(M=>M.side===a).sort((M,w)=>M.along-w.along);for(let M of S){let w=qn(t,M.kind),v=qs(w),T=h?fr:v/2,E=f-x-(h?0:T),N=Math.max(Hn,M.along,m+T+Qs);if(N>E)continue;let{at:F,inset:y}=ed([...c,...g],a,N,v,u,f);if(F>E+.5)continue;m=F+T,g.push(Zi(a,F,v,u,y));let b=a==="left"?{left:y,top:F,transform:"translateY(-50%)"}:a==="right"?{right:`calc(${y}px + var(--graview-dock, 0px))`,top:F,transform:"translateY(-50%)"}:a==="top"?{top:y,left:F,transform:"translateX(-50%)"}:{bottom:`calc(${y}px + var(--graview-scene-foot, var(--graview-sheet, 0px)))`,left:F,transform:"translateX(-50%)"};l.push((0,Bn.jsx)("button",{type:"button",className:"graview-edge-sign","data-graview-past-edge":M.id,"aria-label":`${w}, past the ${a} edge \u2014 bring it into view`,title:`${w} is past the ${a} edge`,tabIndex:-1,onPointerDown:L=>L.stopPropagation(),onClick:L=>{L.stopPropagation(),o(M.by)},style:{...td,...b},children:a==="right"||a==="bottom"?`${w} ${qi[a]}`:`${qi[a]} ${w}`},M.id))}}return(0,Bn.jsx)(Bn.Fragment,{children:l})}var qs=e=>(e.length+2)*7.4+22,fr=fo/2,Nn=6,Qs=6,Zs=236,Js=56;function Zi(e,t,n,o,r=Nn){return e==="left"||e==="right"?{left:e==="left"?r:o.width-r-n,right:e==="left"?r+n:o.width-r,top:t-fr,bottom:t+fr}:{left:t-n/2,right:t+n/2,top:e==="top"?r:o.height-r-fo,bottom:e==="top"?r+fo:o.height-r}}function ed(e,t,n,o,r,s){let i=t==="left"||t==="right",d=m=>Zi(t,m,o,r),c=m=>e.find(g=>{let S=d(m);return S.left<g.right&&g.left<S.right&&S.top<g.bottom&&g.top<S.bottom}),l=c(n);if(!l)return{at:n,inset:Nn};let a=i?fr:o/2,u=m=>{let g=n;for(let S=0;S<12;S++){let M=c(g);if(!M)return g;if(g=m>0?(i?M.bottom:M.right)+a+4:(i?M.top:M.left)-a-4,g>s-Hn||g<Hn)return null}return null},f=u(1);if(f!==null)return{at:f,inset:Nn};let h=u(-1);if(h!==null)return{at:h,inset:Nn};let x=t==="left"?l.right:t==="right"?r.width-l.left:t==="top"?l.bottom:r.height-l.top;return{at:n,inset:Math.max(Nn,x+4)}}var td={position:"absolute",zIndex:Ve.lines,minHeight:28,maxWidth:"40%",padding:"3px 10px",font:"inherit",fontSize:"0.75rem",letterSpacing:"0.04em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:6,boxShadow:"0 2px 8px rgb(0 0 0 / 0.12)",cursor:"pointer"};function Ji(e){let[t,n]=(0,un.useState)(null);return(0,un.useLayoutEffect)(()=>{let o=e.current,r=null;for(let d=o?.parentElement??null,c=0;d&&!r&&c<4;d=d.parentElement,c++)r=d.querySelector(":scope > [data-graview-scene-trail]");if(!o||!r)return;let s=()=>{let d=o.getBoundingClientRect(),c=r.getBoundingClientRect(),l=c.width>0&&c.height>0?{x:c.left-d.left,y:c.top-d.top,width:c.width,height:c.height}:null;n(a=>a===l||a&&l&&a.x===l.x&&a.y===l.y&&a.width===l.width&&a.height===l.height?a:l)};if(s(),typeof ResizeObserver>"u")return;let i=new ResizeObserver(s);return i.observe(r),()=>i.disconnect()},[e]),t}function ea(e,t,n){let[o,r]=(0,un.useState)([]);return(0,un.useLayoutEffect)(()=>{let s=e.current;if(!s||!t)return;let i=[...s.querySelectorAll(".graview-drive-in")].flatMap(d=>{let c=d.closest("[data-graview-view]"),l=d.getBoundingClientRect();if(!c||l.width===0||l.height===0)return[];let a=c.getBoundingClientRect();return[{id:c.getAttribute("data-graview-view"),x:Math.round(l.left-a.left),y:Math.round(l.top-a.top),width:Math.round(l.width),height:Math.round(l.height)}]});r(d=>d.length===i.length&&d.every((c,l)=>c.id===i[l].id&&c.x===i[l].x&&c.y===i[l].y&&c.width===i[l].width&&c.height===i[l].height)?d:i)},[e,t,n]),o}function ta(e,t){return e.flatMap(n=>{let o=t.find(r=>r.id===n.id);return o?[{x:o.x+n.x,y:o.y+n.y,width:n.width,height:n.height}]:[]})}var Lt=ie(Re(),1),nd=180;function na({view:e,result:t,frame:n,panned:o,closer:r,screenId:s,setCamera:i}){let d=(0,Lt.useRef)(new Map),c=Math.round((t.nodes.find(u=>u.id===s)?.height??0)/16),l=(0,Lt.useRef)(e.overview??!1),a=(0,Lt.useRef)(null);if((0,Lt.useEffect)(()=>{if(!e.overview||!s||!t.city){if(l.current&&!e.overview)return;i(E=>E.x===0&&E.y===0?E:{x:0,y:0});return}let u=t.nodes.find(E=>E.id===s);if(!u)return;let f=r>1&&u.screenOf?t.nodes.find(E=>E.id===Me(u.screenOf)):void 0,h=f?{x:Math.min(u.x,f.x),y:Math.min(u.y,f.y),width:Math.max(u.x+u.width,f.x+f.width)-Math.min(u.x,f.x),height:Math.max(u.y+u.height,f.y+f.height)-Math.min(u.y,f.y)}:u;if(h.x>=0&&h.y>=0&&h.x+h.width<=t.width&&h.y+h.height<=t.height&&!f)return;let m=24,g=(E,N,F)=>E<m?m-E:E+N>F-m?F-m-(E+N):0,S=Ot(t),M=e.pan??{x:0,y:0},w=f?o.x+(t.width/2-(h.x+h.width/2)):o.x+g(h.x,h.width,t.width),v=t.height/2-(h.y+h.height/2),T=f?o.y+(u.y+v<m?m-u.y:v):o.y+g(h.y,h.height,t.height);i({x:(f?w:Math.max(-S.x,Math.min(S.x,w)))-M.x,y:(f?T:Math.max(-S.y,Math.min(S.y,T)))-M.y})},[s,e.overview,r,e.within?.view,c]),n.city){let u=new Map;for(let f of n.nodes){if(!f.plot||Math.round(f.plane)!==2)continue;let h=dn(f.plot.col+f.plot.side/2,f.plot.row+f.plot.side/2,n.city.cell,n.city.tilt);u.set(f.id,{x:n.city.originX+o.x+h.x,y:n.city.originY+o.y+h.y})}d.current=u}return(0,Lt.useEffect)(()=>{let u=e.overview??!1,f=l.current&&!u;if(l.current=u,u&&a.current&&(clearTimeout(a.current),a.current=null),!f)return;let h=e.focusId?Et(e.focusId)[0]:void 0,x=h?d.current.get(Me(h)):void 0,m=t.nodes.find(g=>g.id===e.focusId);if(!x||!m){i({x:0,y:0});return}i({x:x.x-(m.x+m.width/2),y:x.y-(m.y+m.height/2)}),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,i({x:0,y:0})},nd)},[e.overview]),(0,Lt.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),{gliding:()=>a.current!==null}}var mr=ie(Re(),1),hr="[data-graview-view]";function rd(e,t){let n=null;for(let o=e?.closest(hr)??null;o&&t.contains(o);o=o.parentElement?.closest(hr)??null)n=o;return n}function ra(e,t){let n=e.getBoundingClientRect();return{left:n.left,top:n.top,right:n.right-t.right,bottom:n.bottom-t.bottom,box:n}}function oa(e,t,n){let o=(0,mr.useRef)({dock:t,reveal:n});o.current={dock:t,reveal:n},(0,mr.useEffect)(()=>{let r=e.current;if(!r)return;let s=c=>{let{dock:l}=o.current;if(c.key!=="Tab"||c.defaultPrevented||l.right<=0&&l.bottom<=0)return;let a=ra(r,l),u=[];for(let f of r.querySelectorAll(hr)){if(f.parentElement?.closest(hr)||f.inert||f.contains(document.activeElement))continue;let h=f.getBoundingClientRect(),x=Math.max(h.left,a.box.left),m=Math.min(h.right,a.box.right),g=Math.max(h.top,a.box.top),S=Math.min(h.bottom,a.box.bottom);m<=x||S<=g||!(l.right>0&&x>=a.right-1||l.bottom>0&&g>=a.bottom-1)||(f.inert=!0,u.push(f))}u.length!==0&&setTimeout(()=>{for(let f of u)f.inert=!1},0)},i=c=>{let l=c.target,a=rd(l,r);if(!a)return;let u=!0;try{u=l?.matches(":focus-visible")??!0}catch{}requestAnimationFrame(()=>{for(let f=a.parentElement;f;f=f===r?null:f.parentElement)f.scrollTop!==0&&(f.scrollTop=0),f.scrollLeft!==0&&(f.scrollLeft=0);u&&a.isConnected&&d(a)})},d=c=>{let l=ra(r,o.current.dock),a=c.getBoundingClientRect(),u=12,f=(m,g,S,M)=>M-S>g-m-2*u||S<m+u?m+u-S:M>g-u?g-u-M:0,h=f(l.left,l.right,a.left,a.right),x=f(l.top,l.bottom,a.top,a.bottom);(Math.abs(h)>=1||Math.abs(x)>=1)&&o.current.reveal(Math.round(h),Math.round(x))};return document.addEventListener("keydown",s,!0),r.addEventListener("focusin",i),()=>{document.removeEventListener("keydown",s,!0),r.removeEventListener("focusin",i)}},[e])}var ae=ie(Re(),1);function aa(){let e=(0,ae.useRef)(null),[t,n]=(0,ae.useState)({right:0,bottom:0});return(0,ae.useLayoutEffect)(()=>{let o=e.current;if(!o)return;let r=()=>{let i=o.getBoundingClientRect(),d={right:Math.round(i.width),bottom:Math.round(i.height)};n(c=>c.right===d.right&&c.bottom===d.bottom?c:d)};if(r(),typeof ResizeObserver>"u")return;let s=new ResizeObserver(r);return s.observe(o),()=>s.disconnect()},[]),{probe:e,dock:t}}function sa(){let[e,t]=(0,ae.useState)(null),n=(0,ae.useRef)(null),o=(0,ae.useRef)(0),r=(0,ae.useCallback)(i=>{n.current=i,o.current===0&&(o.current=requestAnimationFrame(()=>{o.current=0,t(n.current)}))},[]),s=(0,ae.useCallback)(()=>{o.current!==0&&cancelAnimationFrame(o.current),o.current=0;let i=n.current;return n.current=null,i&&t(null),i},[]);return{held:e,place:r,release:s}}function da({stage:e,pan:t,zoom:n,setView:o,settled:r,zoomTo:s}){let i=(0,ae.useRef)({x:0,y:0,s:1}),d=(0,ae.useRef)(0),c=(0,ae.useRef)(!1),l=(0,ae.useRef)(r);l.current=r;let a=(0,ae.useCallback)(()=>[...e.current?.querySelectorAll("[data-graview-world]")??[]],[e]),u=(0,ae.useCallback)(({x:w,y:v,s:T})=>{let E=T!==1?`translate3d(${w}px, ${v}px, 0) scale(${T})`:w===0&&v===0?"":`translate3d(${w}px, ${v}px, 0)`;for(let N of a())N.style.transform=E,N.style.transformOrigin=T!==1?"0 0":"";ia(e.current,w,v,T)},[a,e]),f=(0,ae.useCallback)(()=>{d.current===0&&(d.current=requestAnimationFrame(()=>{d.current=0,u(i.current)}))},[u]),h=(0,ae.useCallback)(()=>{c.current=!1;for(let w of a())w.style.transform="",w.style.transformOrigin="";ia(e.current,0,0,1),l.current()},[a,e]),x=(0,ae.useCallback)((w,v)=>{i.current={x:w.x-v.x,y:w.y-v.y,s:i.current.s},f()},[f]),m=(0,ae.useCallback)((w,v,T,E,N,F)=>{let{x:y,y:b,s:L}=i.current,P=Math.max(N,Math.min(F,L*w)),V=P/L;i.current={x:y*V+v.x*(1-V)+T,y:b*V+v.y*(1-V)+E,s:P},f()},[f]),g=(0,ae.useCallback)(()=>{let{x:w,y:v,s:T}=i.current;return w===0&&v===0&&T===1?!1:(d.current!==0&&cancelAnimationFrame(d.current),d.current=0,u({x:w,y:v,s:T}),i.current={x:0,y:0,s:1},c.current=!0,Math.abs(T-1)>1e-4?s.current(T,{x:w/(1-T),y:v/(1-T)}):o(E=>{let N=E.pan??{x:0,y:0};return dt(E,{x:N.x+w,y:N.y+v})}),window.setTimeout(()=>{c.current&&h()},300),!0)},[o,h,u,s]);(0,ae.useLayoutEffect)(()=>{c.current&&h()},[t,n,h]);let S=(0,ae.useCallback)(()=>{d.current!==0&&cancelAnimationFrame(d.current),d.current=0,i.current={x:0,y:0,s:1},h()},[h]),M=(0,ae.useCallback)(()=>i.current,[]);return{shiftTo:x,zoomBy:m,settle:g,drop:S,settling:c,offset:M}}function ia(e,t,n,o){for(let r of e?.querySelectorAll(":scope > .graview-lattice, :scope > .graview-measure")??[]){let s=o!==1&&r.classList.contains("graview-lattice")&&e?od(e):null;s?r.style.setProperty("--graview-lattice-cell",`${(s.cell*o).toFixed(2)}px`):r.style.removeProperty("--graview-lattice-cell");let i=s?s.x*(o-1)+t:t,d=s?s.y*(o-1)+n:n;if(i===0&&d===0){r.style.removeProperty("--graview-hand-x"),r.style.removeProperty("--graview-hand-y");continue}r.style.setProperty("--graview-hand-x",`${i}px`),r.style.setProperty("--graview-hand-y",`${d}px`)}}function od(e){let t=parseFloat(e.style.getPropertyValue("--graview-lattice-cell"));return Number.isFinite(t)?{cell:t,x:parseFloat(e.style.getPropertyValue("--graview-lattice-x"))||0,y:parseFloat(e.style.getPropertyValue("--graview-lattice-y"))||0}:null}var id=4;function ad(e,t){for(let n=e;n&&n!==t;n=n.parentElement){let o=getComputedStyle(n);if(/(auto|scroll)/.test(o.overflowY)&&n.scrollHeight>n.clientHeight+1||/(auto|scroll)/.test(o.overflowX)&&n.scrollWidth>n.clientWidth+1)return!0}return!1}function la({view:e,panned:t,limit:n,panWithin:o,moveByTransform:r,setView:s,setDragging:i,noteMoved:d,shift:c,district:l,pinching:a}){let u=(0,ae.useRef)(!1),f=(0,ae.useRef)(null),h=v=>{let T=e.pan??{x:0,y:0};f.current={kind:"pan",fromX:v.clientX,fromY:v.clientY,baseX:T.x,baseY:T.y,moved:!1}},x=v=>{v.button!==0||a.current||v.target.closest("[data-graview-view]")||h(v)},m=(v,T)=>{if(!(T.button!==0||a.current)&&!(T.pointerType!=="mouse"&&ad(T.target,T.currentTarget))){if(v.screenOf!==void 0&&!T.target.closest("[data-graview-grip]")){h(T);return}if(e.overview&&Ie(v.id)!==null){h(T);return}f.current={kind:"card",id:v.id,fromX:T.clientX,fromY:T.clientY,baseX:v.x-t.x,baseY:v.y-t.y,moved:!1}}},g=v=>{let T=f.current;f.current=null,l.release(),v?c.settle():c.drop(),T&&(u.current=!0,setTimeout(()=>u.current=!1,0)),c.settling.current||i(!1)};return{onGroundDown:x,onCardDown:m,onDragMove:v=>{let T=f.current;if(!T)return;if(a.current){g(!0);return}let E=v.clientX-T.fromX,N=v.clientY-T.fromY;if(!T.moved){if(Math.hypot(E,N)<id)return;T.moved=!0,i(!0);try{v.currentTarget.setPointerCapture(v.pointerId)}catch{}}if(T.kind==="pan"){let F=o(n(),{x:T.baseX+E,y:T.baseY+N});r?c.shiftTo(F,e.pan??{x:0,y:0}):s(y=>dt(y,F))}else T.id&&l.place({id:T.id,x:T.baseX+E,y:T.baseY+N})},onDragUp:()=>{c.settle();let v=l.release();v&&s(T=>Pn(T,v.id,{x:v.x,y:v.y})),f.current?.moved&&(u.current=!0,setTimeout(()=>u.current=!1,0),d()),f.current=null,!c.settling.current&&i(!1)},onDragCancel:()=>{f.current&&g(!1)},swallow:u}}function ca({stage:e,view:t,setView:n}){let o=(0,ae.useRef)({view:t,charge:0,coolUntil:0,lastScale:1});o.current.view=t;let r=(0,ae.useRef)(()=>{}),s=(0,ae.useRef)(()=>{}),i=(0,ae.useRef)(()=>{}),d=(0,ae.useRef)(()=>{}),c=(0,ae.useRef)(!1),l=(0,ae.useRef)({fingers:new Map,pinch:null,owed:null,owing:0});return(0,ae.useEffect)(()=>{let a=e.current;if(!a)return;let u=(E,N)=>{let F=o.current;if(N<F.coolUntil)return;let y=F.view.overview??!1;E!==y&&(F.coolUntil=N+600,F.charge=0,n(Mn(F.view,E)))},f=E=>{let N=o.current,F=N.view.overview??!1;if(E.ctrlKey){if(E.preventDefault(),!F){if(N.charge+=E.deltaY,Math.abs(N.charge)<60)return;N.charge>0?u(!0,performance.now()):N.charge=0;return}i.current(Math.exp(-E.deltaY*.004),E.clientX,E.clientY,0,0);return}!F||E.target?.closest("[data-graview-view], .graview-scroll, [data-graview-overlay], .graview-zoom")||(E.preventDefault(),s.current(-E.deltaX,-E.deltaY))},h=l.current,x=h.fingers,m=()=>{h.owing=0;let E=h.owed;h.owed=null,E&&i.current(E.factor,E.x,E.y,E.dx,E.dy)},g=()=>{let[E,N]=[...x.values()];return{apart:Math.max(1,Math.hypot(E.x-N.x,E.y-N.y)),mid:{x:(E.x+N.x)/2,y:(E.y+N.y)/2}}},S=E=>{if(E.pointerType!=="touch"||(E.isPrimary&&(x.clear(),h.pinch=null,c.current=!1),x.set(E.pointerId,{x:E.clientX,y:E.clientY}),x.size!==2))return;let{apart:N,mid:F}=g();h.pinch={from:N,last:N,mid:F},c.current=!0},M=E=>{if(!x.has(E.pointerId))return;x.set(E.pointerId,{x:E.clientX,y:E.clientY});let N=h.pinch;if(!N||x.size!==2)return;let{apart:F,mid:y}=g();if(!(o.current.view.overview??!1))F/N.from<.72&&u(!0,performance.now());else{let L=h.owed??={factor:1,x:N.mid.x,y:N.mid.y,dx:0,dy:0};L.factor*=F/N.last,L.dx+=y.x-N.mid.x,L.dy+=y.y-N.mid.y,h.owing===0&&(h.owing=requestAnimationFrame(m))}N.last=F,N.mid=y},w=E=>{x.delete(E.pointerId)&&(x.size<2&&(h.pinch=null),!(x.size>0)&&(h.owing!==0&&cancelAnimationFrame(h.owing),m(),c.current=!1,d.current()))},v=E=>{E.preventDefault(),o.current.lastScale=1},T=E=>{if(E.preventDefault(),c.current||x.size>1)return;let N=o.current,F=E.scale??1;if(!(N.view.overview??!1)){F<.72&&u(!0,performance.now());return}let y=F/(N.lastScale||1);N.lastScale=F;let b=E;r.current(y,b.clientX,b.clientY)};return a.addEventListener("wheel",f,{passive:!1}),a.addEventListener("gesturestart",v),a.addEventListener("gesturechange",T),a.addEventListener("pointerdown",S),a.addEventListener("pointermove",M),a.addEventListener("pointerup",w),a.addEventListener("pointercancel",w),()=>{h.owing!==0&&(cancelAnimationFrame(h.owing),m()),a.removeEventListener("pointerdown",S),a.removeEventListener("pointermove",M),a.removeEventListener("pointerup",w),a.removeEventListener("pointercancel",w),a.removeEventListener("wheel",f),a.removeEventListener("gesturestart",v),a.removeEventListener("gesturechange",T)}},[n,e]),{zoomAbout:r,panBy:s,pinchBy:i,pinchDone:d,pinching:c}}var fa=ie(Re(),1),sd=650,dd=400,ho="[data-graview-view]",ha="button, a, input, select, textarea, [role='button'], aside, section[aria-label], [data-graview-popover], [data-graview-offstage], [data-graview-overlay]";function ld(e,t){if(!(e instanceof Element)||e.closest("[data-graview-pick]"))return!1;let n=e.closest(ha);return n!==null&&n!==t&&t.contains(n)}function ua(e){return e instanceof Element?e.closest(ho):null}function cd(e,t,n){let o=null;for(let{id:r,box:s}of e.cards){if(t<s.left||t>s.right||n<s.top||n>s.bottom)continue;let i=s.width*s.height;(!o||i<o.area)&&(o={id:r,area:i})}return o?.id??null}function ma(e,t){(0,fa.useEffect)(()=>{let n=e.current;if(!n)return;let o=null,r=null,s=-1/0,i=!1,d=f=>{let h=o;if(o=null,r=null,!f.isPrimary||f.button!==0||!h||f.timeStamp-h.at>sd)return;let x=ua(f.target)?.getAttribute("data-graview-view")??null,m=cd(h,f.clientX,f.clientY);!(f.pointerType==="touch"&&h.on!==null&&m===h.on&&f.timeStamp-h.at<=dd)&&(m===x||ld(f.target,n)||m===null)||(f.stopPropagation(),r={to:m,double:m!==null&&m===h.on})},c=(f,h,x,m)=>{i=!0;try{f.dispatchEvent(new MouseEvent(h,{bubbles:!0,cancelable:!0,clientX:x.clientX,clientY:x.clientY,detail:m?2:1}))}finally{i=!1}},l=f=>{if(i)return;if(r){let{to:m,double:g}=r;r=null,s=f.timeStamp+500,f.stopPropagation(),f.preventDefault();let S=m===null?null:[...n.querySelectorAll(ho)].find(M=>M.getAttribute("data-graview-view")===m);m===null?c(n,"click",f,!1):S&&c(S,g?"dblclick":"click",f,g);return}if(t.current)return;let h=f.target instanceof Element?f.target.closest(ha):null;if(h&&h!==n&&n.contains(h)&&!f.target.closest("[data-graview-pick]"))return;let x=ua(f.target)?.getAttribute("data-graview-view")??null;o={at:f.timeStamp,on:x,cards:[...n.querySelectorAll(ho)].map(m=>({id:m.getAttribute("data-graview-view"),box:m.getBoundingClientRect()}))}},a=f=>{i||f.timeStamp>s||(f.stopPropagation(),f.preventDefault(),s=-1/0)},u=f=>{r&&f.stopPropagation()};return n.addEventListener("pointerdown",d,!0),n.addEventListener("pointerup",u,!0),n.addEventListener("click",l,!0),n.addEventListener("dblclick",a,!0),()=>{n.removeEventListener("pointerdown",d,!0),n.removeEventListener("pointerup",u,!0),n.removeEventListener("click",l,!0),n.removeEventListener("dblclick",a,!0)}},[e,t])}var pa={directed:"You",autonomous:"An agent","co-edited":"You and an agent",rule:"A rule"};function mo(e,t){let n=new Set(e.map(r=>r.id)),o=new Set;for(let r of t){if(n.has(r)){o.add(r);continue}let s=e.find(i=>i.aggregate?.memberIds.includes(r));s&&o.add(s.id)}return o}function po(e){return e.emphasized?e.stressed?.95:.08:e.anyChosen?e.mine?.9:.12:e.touches?Math.max(.34,.9-.09*Math.max(0,(e.siblings??1)-1)):.12}function yo(e){return e.edgeChosen?.9:e.lit?.78:e.own*(e.anyLit?e.kit.dim:e.kit.rest)}function ct(e,t){if(!e)return null;let n=Math.max(0,Math.min(2,Math.floor(e.plane))),o=Math.max(0,Math.min(2,Math.ceil(e.plane))),{scale:r}=n===o?nn(n,t):qo(nn(n,t),nn(o,t),e.plane-n);return{x:e.x,y:e.y,width:e.width*r,height:e.height*r}}function fn(e,t){if(typeof getComputedStyle>"u"||getComputedStyle(e).visibility==="hidden")return null;let n=-1/0,o=-1/0,r=1/0,s=1/0,i=e.getBoundingClientRect();n=Math.max(n,i.left),o=Math.max(o,i.top),r=Math.min(r,i.right),s=Math.min(s,i.bottom);let d=e.parentElement;for(;d&&d!==t;){let l=getComputedStyle(d);if(l.overflowX!=="visible"||l.overflowY!=="visible"){let a=d.getBoundingClientRect();l.overflowX!=="visible"&&(n=Math.max(n,a.left),r=Math.min(r,a.right)),l.overflowY!=="visible"&&(o=Math.max(o,a.top),s=Math.min(s,a.bottom))}d=d.parentElement}if(r-n<=2||s-o<=2)return null;let c=t.getBoundingClientRect();return{x:n-c.left,y:o-c.top,width:r-n,height:s-o}}function ze(e,t,n,o=!1){if(!e||typeof document>"u")return null;let r=e.querySelector(`[data-graview-view="${CSS.escape(t)}"]`);return r?fn(go(r,n,o),e):null}function go(e,t=!1,n=!1){return(t?e.querySelector(".graview-kind-block"):null)??e.querySelector('[data-graview-primitive="panel"], .graview-kind-face, .graview-kind-card')??(n?null:e.querySelector(':scope > [data-graview-primitive="chip"]'))??e}function pr(e,t,n,o,r){let s=l=>e.nodes.find(a=>a.id===l);if(r.startsWith("screen:")){let l=e.nodes.find(a=>a.id===Me(r.slice(7)));return l?ze(t,l.id,!0)??ct(l,n):null}let i=s(r),d=Ie(r);if(!i&&d!==null&&(i=s(Ne(d))),!i&&Wt(r)){let[l]=Et(r);l&&(i=s(Me(l)))}if(!i){let l=o.places().find(a=>a.as===r);l&&(i=s(Ne(l.kind))??s(Me(l.kind)))}if(i||(i=[...e.nodes].filter(l=>l.aggregate?.memberIds.includes(r)).sort((l,a)=>l.plane-a.plane)[0]),!i)return null;let c=e.city!==void 0;return ze(t,i.id,c&&i.aggregate!==void 0&&Math.round(i.plane)===2)??ct(i,n)}var ut=ie(Re(),1);var Ue=ie(Re(),1);var Ke=ie(Ee(),1);function xa({title:e,name:t,path:n,maxHeight:o,children:r}){let s=(0,Ue.useContext)(_o),[i,d]=(0,Ue.useState)(void 0),[c,l]=(0,Ue.useState)(void 0),[a,u]=(0,Ue.useState)(void 0),[f,h]=(0,Ue.useState)(!1),[x,m]=(0,Ue.useState)(!1),g=(0,Ue.useRef)(null),S=(0,Ue.useRef)(null);(0,Ue.useLayoutEffect)(()=>{let b=g.current,L=S.current;if(!b||!L||typeof ResizeObserver>"u")return;let P=()=>{u(b.clientHeight),l(L.offsetHeight||void 0)};P();let V=new ResizeObserver(P);return V.observe(b),V.observe(L),()=>V.disconnect()},[]);let M=Math.max(i??0,c??0)||void 0,w=!f&&M!==void 0&&a!==void 0&&M>a+1,v=s&&n?n:void 0,T=v&&s?.href?s.href(v):void 0,E=b=>b.stopPropagation(),N=b=>{E(b),!(T&&(b.metaKey||b.ctrlKey||b.shiftKey||b.button!==0))&&(b.preventDefault(),v&&s?.open(v))},F=T?{href:T}:{role:"link",tabIndex:0},y={onPointerDown:E,onDoubleClick:E,onKeyDown:b=>{b.key!=="Enter"&&b.key!==" "||(E(b),b.key==="Enter"&&b.currentTarget.tagName==="A"&&!b.currentTarget.hasAttribute("href")&&(b.preventDefault(),b.currentTarget.click()))}};return(0,Ke.jsxs)("section",{"data-graview-preview":t,"aria-label":e,...f?{"data-graview-expanded":"","data-graview-overlay":""}:{},onKeyDown:f?b=>{b.key==="Escape"&&(b.stopPropagation(),h(!1))}:void 0,style:{...ud,...f?fd:{}},children:[(0,Ke.jsxs)("div",{style:hd,children:[(0,Ke.jsx)("strong",{style:md,children:e}),v?(0,Ke.jsx)("a",{"data-graview-preview-open":"",...F,"aria-label":`Open ${e}`,style:ya,...y,onClick:N,children:"Open"}):w||f?(0,Ke.jsx)("button",{type:"button","data-graview-preview-expand":"","aria-expanded":f,"aria-label":`${f?"Collapse":"Expand"} ${e}`,style:{...ya,...ga},...y,onClick:b=>{E(b),h(L=>!L)},children:f?"Collapse":"Expand"}):null]}),(0,Ke.jsxs)("div",{ref:g,"data-graview-preview-body":"",...i!==void 0?{"data-graview-content-height":i}:{},...w?{"data-graview-more":""}:{},onFocus:()=>m(!0),onBlur:()=>m(!1),style:{...pd,...o!==void 0&&!f?{maxHeight:o}:{},...x?{overflowClipMargin:4}:{}},children:[(0,Ke.jsx)("div",{ref:S,"data-graview-preview-drawn":"",style:yd,children:(0,Ke.jsx)(Yo.Provider,{value:d,children:r})}),w?(0,Ke.jsx)("div",{"aria-hidden":"true","data-graview-preview-fade":"",style:gd}):null,w?v?(0,Ke.jsx)("a",{"data-graview-preview-more":"",...F,"aria-label":`More of ${e}`,style:wa,...y,onClick:N,children:"More"}):(0,Ke.jsx)("button",{type:"button","data-graview-preview-more":"","aria-label":`More of ${e}`,style:{...wa,...ga},...y,onClick:b=>{E(b),h(!0)},children:"More"}):null]})]})}var ud={display:"flex",flexDirection:"column",gap:"var(--graview-gap, 7px)",width:"100%",maxHeight:"100%",minHeight:0,padding:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge, #e4e0d8)",boxShadow:"var(--graview-lift-low)",background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)",overflow:"hidden"},fd={maxHeight:"none",position:"absolute",top:0,left:0,right:0,width:"auto"},hd={display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0,flex:"0 0 auto"},md={fontFamily:"var(--graview-font-display, inherit)",fontSize:"0.9375rem",lineHeight:1.25,fontWeight:560,letterSpacing:"0.005em",minWidth:0,overflowWrap:"anywhere"},ya={marginLeft:"auto",fontSize:"0.8125rem",fontWeight:560,color:"var(--graview-accent, #2f6f5e)",textDecoration:"none",textUnderlineOffset:"0.2em"},ga={font:"inherit",fontSize:"0.8125rem",fontWeight:560,background:"none",border:0,padding:0,cursor:"pointer"},pd={position:"relative",flex:"0 1 auto",minHeight:0,overflowX:"visible",overflowY:"clip",minWidth:0},yd={display:"flow-root",minWidth:0},gd={position:"absolute",left:0,right:0,bottom:0,height:64,pointerEvents:"none",background:"linear-gradient(to bottom, transparent, var(--graview-panel, #ffffff) 66%)"},wa={position:"absolute",right:0,bottom:0,lineHeight:1.5,fontSize:"0.8125rem",fontWeight:560,color:"var(--graview-accent, #2f6f5e)",textDecoration:"none",textUnderlineOffset:"0.2em"};var ue=ie(Ee(),1),va=(0,ut.memo)(function({kinds:t}){let{store:n}=we(),{view:o,go:r}=Fr(),s=(0,ut.useRef)(null),i=jr("districts",{align:"start"}),d=i.open,c=h=>qn(n.schema,h),l=h=>n.graph.allNodes().filter(x=>x.kind===h).length,a=h=>!o.overview&&o.focusId===Ne(h),u=t.filter(h=>!a(h)),f=h=>{i.setOpen(!1);let x=s.current?.querySelector(".graview-beyond-more")??null;a(h)||r(Mt(o,Ne(h))),x?.focus({preventScroll:!0});let m=`[data-graview-view="${Ne(h)}"][tabindex], [data-graview-view="${Me(h)}"][tabindex]`,g=40,S=()=>{let M=document.querySelector(m);M?M.focus({preventScroll:!0}):--g>0&&requestAnimationFrame(S)};requestAnimationFrame(S)};return(0,ue.jsxs)("div",{ref:s,className:"graview-beyond","data-graview-beyond":t.length,"data-graview-beyond-open":d?"":void 0,children:[(0,ue.jsxs)("button",{type:"button",className:"graview-beyond-more","data-testid":"beyond-more",...i.trigger,"aria-haspopup":"menu",title:`${u.length} more district${u.length===1?"":"s"} \u2014 press to see them`,onPointerDown:h=>h.stopPropagation(),onClick:h=>{h.stopPropagation(),i.toggle()},children:[(0,ue.jsxs)("span",{className:"graview-beyond-count",children:["+",u.length]}),(0,ue.jsx)("span",{className:"graview-beyond-word",children:"more"}),(0,ue.jsx)("span",{className:"graview-beyond-chevron","aria-hidden":"true",children:d?"\u25BE":"\u25B4"})]}),d?(0,ue.jsx)("ul",{...i.pane,className:"graview-beyond-list",role:"menu","aria-label":"The other districts","data-testid":"beyond-list",style:Wr,onPointerDown:h=>h.stopPropagation(),children:t.map(h=>(0,ue.jsx)("li",{role:"none",children:(0,ue.jsxs)("button",{type:"button",role:"menuitem","data-graview-pick":Me(h),"aria-current":a(h)?"location":void 0,title:a(h)?`${c(h)} \u2014 where you are`:`Go to ${c(h)}`,onPointerDown:x=>x.stopPropagation(),onClick:x=>{x.stopPropagation(),f(h)},children:[(0,ue.jsx)("span",{className:"graview-beyond-name",children:c(h)}),(0,ue.jsx)("span",{className:"graview-beyond-tally",children:a(h)?"here":l(h)})]})},h))}):null]})},(e,t)=>e.kinds.length===t.kinds.length&&e.kinds.every((n,o)=>n===t.kinds[o]));function ka(e,t){if(e===t)return!0;let n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(o=>o==="x"||o==="y"||xo(e[o],t[o]))}function xo(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t)||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==Array.prototype)return!1;if(Array.isArray(e)){let r=t;if(e.length!==r.length)return!1;for(let s=0;s<e.length;s++)if(!xo(e[s],r[s]))return!1;return!0}let o=Object.keys(e);return o.length!==Object.keys(t).length?!1:o.every(r=>xo(e[r],t[r]))}var Sa=(0,ut.memo)(Ma,(e,t)=>e.mode===t.mode&&e.selected===t.selected&&e.fidelity===t.fidelity&&ka(e.node,t.node));function Ma({node:e,mode:t,selected:n,fidelity:o}){let{store:r,views:s,view:i}=we(),d=Vt(),c=fi(),l=ui(),a=e.aggregate||Wt(e.id)||Ie(e.id)!==null?"many":"one",u={cardinality:a,fidelity:o??Xo[xd(e.plane)].fidelity},f=a==="many"&&e.id===i.focusId?i.within?.view:void 0,h=s.resolve(e.kind,u,f),x=h?.view,m=s.resolve(e.kind,{cardinality:"many",fidelity:"full"})?.view,g=m!==void 0&&m.generic!==!0,S=e.aggregate?.memberIds,M=(0,ut.useMemo)(()=>(S??[]).map(F=>r.graph.getNode(F)).filter(F=>F!==void 0),[S,r,d]),w={...e.aggregate?{nodes:M,label:h?.title??e.aggregate.label}:{node:r.graph.getNode(e.id)},fidelity:u.fidelity,cardinality:u.cardinality,mode:t,selected:n,implicated:c,flagged:l,...e.raised?{raised:!0}:{},...e.focused?{focused:!0}:{},...e.opened?{opened:!0}:{},...e.openedRows!==void 0?{openedRows:e.openedRows}:{},...e.plot?{plot:e.plot}:{},...e.nameplate?{nameplate:e.nameplate}:{},...e.states?{states:e.states}:{},...e.aggregate?.retired?{retired:e.aggregate.retired}:{},...e.rank?{rank:e.rank}:{},...e.nestedUnder?{nestedUnder:e.nestedUnder}:{},...g?{hasOwnView:!0}:{}};if(!x)return(0,ue.jsx)(bd,{node:e,props:w});let v=Uo(x),T=!e.aggregate&&w.node?w.node:void 0,E=v?T?{title:Zt(r.schema.tryDefinition(T.kind),T),name:T.id,path:Do(r.schema,T.kind,T.id)}:{title:w.label??e.kind,name:h?.title?Ar(h.title):"",path:h?.title?`/places/${Ar(h.title)}`:void 0}:void 0,N=[e.id,h?.title??"",u.fidelity,u.cardinality,t,n,e.raised??!1,e.focused??!1,e.opened??!1,e.openedRows??"",e.rank??"",e.nestedUnder??"",e.plot?`${e.plot.col},${e.plot.row},${e.plot.side}`:"",e.nameplate??"",e.states?e.states.values.map(F=>F.count).join(","):"",e.aggregate?wo(e.aggregate.memberIds):"",e.aggregate?.retired??"",c?wo(c):"",l?wo(l):"",g].join("|");return(0,ue.jsx)(Br,{mode:t,children:(0,ue.jsx)(mi,{kind:w.label??e.kind,...h?.title?{view:h.title}:{},children:(0,ue.jsx)(wd,{signature:N,graph:d,draw:()=>v&&E?(0,ue.jsx)(xa,{...E,maxHeight:v.maxHeight,children:(0,ue.jsx)(x,{...w})}):(0,ue.jsx)(x,{...w})})},`${e.id}|${h?.title??""}`)})}var wd=(0,ut.memo)(function({draw:t}){return(0,ue.jsx)(ue.Fragment,{children:t()})},(e,t)=>e.signature===t.signature&&e.graph===t.graph);function xd(e){return Math.max(0,Math.min(2,Math.round(e)))}function bd({node:e,props:t}){return(0,ue.jsxs)("div",{style:{padding:8,font:"13px/1.4 system-ui",overflow:"hidden"},children:[(0,ue.jsx)("strong",{children:t.label??e.kind}),t.nodes?(0,ue.jsxs)("div",{children:[t.nodes.length," items"]}):(0,ue.jsx)("div",{children:e.id})]})}var Ea=(0,ut.memo)(function({node:t}){let{store:n}=we(),o=jt(),r=t.aggregate,s=r.opens,i=r.memberIds.length,d=Jt(n.schema,r.kind,i),c=r.memberIds.slice(0,3).map(f=>{let h=n.graph.getNode(f),x=h?n.schema.tryDefinition(h.kind):void 0;return h?x?.label?x.label(h):String(h.label??f):f}),l=r.memberIds,a=(0,ut.useMemo)(()=>{let f=o?er(o):null;return f?l.filter(h=>f.has(h)).length:0},[o,l]),u=s.in==="picture";return(0,ue.jsxs)("div",{className:"graview-band-group","data-graview-band":s.in,"data-graview-band-count":i,"data-graview-emphasis":o?a>0?"lit":"dimmed":void 0,title:u?`${r.label} \u2014 press twice to see them all, arranged`:`${r.label}: ${d} \u2014 press twice to open`,children:[(0,ue.jsxs)("span",{className:"graview-band-group-head",children:[(0,ue.jsx)("span",{className:"graview-band-group-name",children:r.label}),(0,ue.jsx)("span",{className:"graview-band-group-open","aria-hidden":"true",children:u?"\u2197":"\u25BE"})]}),(0,ue.jsxs)("span",{className:"graview-band-group-names",children:[u?null:(0,ue.jsxs)("span",{className:"graview-band-group-count",children:[d,a>0?` \xB7 ${a} match`:""," \xB7 "]}),c.join(" \xB7 "),i>c.length?" \u2026":""]})]})},(e,t)=>ka(e.node,t.node)),ba=new WeakMap;function wo(e){let t=ba.get(e);if(t!==void 0)return t;let n=2166136261;for(let r of e){for(let s=0;s<r.length;s++)n=Math.imul(n^r.charCodeAt(s),16777619);n=Math.imul(n^44,16777619)}let o=`${e.length}:${(n>>>0).toString(36)}`;return ba.set(e,o),o}var ft=ie(Re(),1);function bo(e,t,n){let o=e.aggregate?[...e.aggregate.memberIds]:[e.id];return n?o.every(s=>t.includes(s))?t.filter(s=>!o.includes(s)):[...t,...o.filter(s=>!t.includes(s))]:o}function Ra(){let[e,t]=(0,ft.useState)(16);return(0,ft.useEffect)(()=>{if(typeof window>"u")return;let n=document.documentElement,o=()=>{let s=parseFloat(getComputedStyle(n).fontSize);Number.isFinite(s)&&t(i=>Math.abs(i-s)<.5?i:s)};o();let r=new MutationObserver(o);return r.observe(n,{attributes:!0,attributeFilter:["style"]}),window.addEventListener("resize",o),()=>{r.disconnect(),window.removeEventListener("resize",o)}},[]),e}function Oa(e){let[t,n]=(0,ft.useState)(null);return(0,ft.useLayoutEffect)(()=>{let o=e.current?.getBoundingClientRect();!o||o.width===0||o.height===0||n(r=>r??{width:Math.round(o.width),height:Math.round(o.height)})},[e]),(0,ft.useEffect)(()=>{let o=e.current;if(!o||typeof ResizeObserver>"u")return;let r=d=>{!d||d.width===0||d.height===0||n(c=>{let l={width:Math.round(d.width),height:Math.round(d.height)};return c&&c.width===l.width&&c.height===l.height?c:l})},s=new ResizeObserver(d=>r(d[0]?.contentRect)),i=()=>r(o.getBoundingClientRect());return s.observe(o),addEventListener("resize",i),()=>{s.disconnect(),removeEventListener("resize",i)}},[e]),t}var vd=120;function Aa(e){let t=(0,ft.useRef)(null);if(e===null)return t.current?.size??null;let n=t.current,o=typeof innerHeight=="number"?innerHeight:0;if(n&&n.size.width===e.width&&n.size.height===e.height)return n.size;let r=n?e.height-n.size.height:0,s=typeof navigator<"u"&&(navigator.maxTouchPoints>0||typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches);return n&&s&&e.width===n.size.width&&r>0&&r<=vd&&Math.abs(o-n.screen-r)<=1?n.size:(t.current={size:e,screen:o},e)}function vo(e,t){if(t==="dark")return`0 ${(10*e).toFixed(1)}px ${(34*e).toFixed(1)}px rgba(0,0,0,${(e+.12).toFixed(2)})`;let n=`0 ${(1+2*e).toFixed(1)}px ${(2+5*e).toFixed(1)}px rgba(20,30,32,${(.03+.06*e).toFixed(3)})`,o=`0 ${(6+26*e).toFixed(1)}px ${(18+60*e).toFixed(1)}px -${(10+10*e).toFixed(1)}px rgba(20,30,32,${(.1+.3*e).toFixed(3)})`;return`${n}, ${o}`}function La(e){return`matrix3d(${e.join(",")})`}var he=ie(Re(),1);var ko=(e,t)=>t.some(n=>e.x>n.x&&e.x<n.x+n.width&&e.y>n.y&&e.y<n.y+n.height);function So(e,t){let n=[],o=[];for(let s=0;s<e.length-1;s++){let i=e[s],d=e[s+1],c=!ko(i,t);c&&o.length===0&&o.push(i);for(let l=1;l<=48;l++){let a=l/48,u={x:i.x+(d.x-i.x)*a,y:i.y+(d.y-i.y)*a},f=!ko(u,t);if(f===c)continue;let h=(l-1)/48,x=a;for(let S=0;S<10;S++){let M=(h+x)/2,w={x:i.x+(d.x-i.x)*M,y:i.y+(d.y-i.y)*M};!ko(w,t)===c?h=M:x=M}let m=(h+x)/2,g={x:i.x+(d.x-i.x)*m,y:i.y+(d.y-i.y)*m};f?o=[g]:(o.push(g),o.length>=2&&n.push(o),o=[]),c=f}c&&o.push(d)}return o.length>=2&&n.push(o),n}function Dn(e,t){let n=Math.abs(t.x-e.x);if(Math.abs(t.y-e.y)>n){if(n<2)return[e,t];let s=(e.y+t.y)/2;return[e,{x:e.x,y:s},{x:t.x,y:s},t]}let r=(e.x+t.x)/2;return Math.abs(t.x-e.x)<2?[e,t]:[e,{x:r,y:e.y},{x:r,y:t.y},t]}var Je=e=>Math.round(e*100)/100,Pt=e=>e.map(t=>t.map((n,o)=>`${o===0?"M":"L"} ${Je(n.x)} ${Je(n.y)}`).join(" ")).join(" ");function Mo(e,t){if(e.length<3)return Pt([e]);let n=[`M ${Je(e[0].x)} ${Je(e[0].y)}`];for(let r=1;r<e.length-1;r++){let s=e[r-1],i=e[r],d=e[r+1],c=Math.hypot(i.x-s.x,i.y-s.y),l=Math.hypot(d.x-i.x,d.y-i.y),a=Math.min(t,c/2,l/2),u={x:i.x+(s.x-i.x)/(c||1)*a,y:i.y+(s.y-i.y)/(c||1)*a},f={x:i.x+(d.x-i.x)/(l||1)*a,y:i.y+(d.y-i.y)/(l||1)*a};n.push(`L ${Je(u.x)} ${Je(u.y)} Q ${Je(i.x)} ${Je(i.y)} ${Je(f.x)} ${Je(f.y)}`)}let o=e[e.length-1];return n.push(`L ${Je(o.x)} ${Je(o.y)}`),n.join(" ")}function Pa(e,t){return t==="orthogonal"?Pt([e]):Mo(e,10)}function Ta(e,t,n){if(e==="orthogonal"){let d=Dn(t.p0,t.p1),c=d.slice(1).map((u,f)=>Math.hypot(u.x-d[f].x,u.y-d[f].y)),l=c.reduce((u,f)=>u+f,0)||1,a=n*l;for(let u=0;u<c.length;u++){let f=c[u];if(a<=f||u===c.length-1){let h=f===0?0:Math.min(1,a/f),x=d[u],m=d[u+1];return{x:x.x+(m.x-x.x)*h,y:x.y+(m.y-x.y)*h}}a-=f}return t.p1}let o=e==="straight"?{x:(t.p0.x+t.p1.x)/2,y:(t.p0.y+t.p1.y)/2}:t.c,r=(1-n)*(1-n),s=2*(1-n)*n,i=n*n;return{x:r*t.p0.x+s*o.x+i*t.p1.x,y:r*t.p0.y+s*o.y+i*t.p1.y}}function yr(e,t){return e!=="straight"?t:{...t,c:{x:(t.p0.x+t.p1.x)/2,y:(t.p0.y+t.p1.y)/2}}}function Ca(e,t){let n=t.x-e.x,o=t.y-e.y,r=(n/2+o)/2,s=(o-n/2)/2;if(Math.abs(r)<1||Math.abs(s)<1)return[e,t];let i={x:e.x+2*r,y:e.y+r};return[e,i,t]}function Ia(e){let t=[...e].sort((o,r)=>o.y-r.y||o.x-r.x),n=[];for(let o of t){let r=n.find(s=>o.y<s.bottom+3&&o.y+o.height>s.top-3);r?(r.boxes.push(o),r.top=Math.min(r.top,o.y),r.bottom=Math.max(r.bottom,o.y+o.height)):n.push({top:o.y,bottom:o.y+o.height,boxes:[o]})}for(let o of n)o.boxes.sort((r,s)=>r.x-s.x);return n.sort((o,r)=>o.top-r.top)}var $n=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Ro=(e,t)=>e.findIndex(n=>n.boxes.some(o=>$n(o,t)));function Na(e,t,n){return t<0?e[0].top-12*2:n>=e.length?e[e.length-1].bottom+12*2:(e[t].bottom+e[n].top)/2}function Ao(e,t){let n=[{from:-1/0,to:1/0}];for(let s of e){let i=[],d=-1/0;for(let l of s.boxes)i.push({from:d,to:l.x-12}),d=Math.max(d,l.x+l.width+12);i.push({from:d,to:1/0});let c=[];for(let l of n)for(let a of i){let u=Math.max(l.from,a.from),f=Math.min(l.to,a.to);f-u>=0&&c.push({from:u,to:f})}n=c}let o=t,r=1/0;for(let s of n){let i=Math.min(Math.max(t,s.from),s.to),d=s.from===-1/0||s.to===1/0,c=Math.abs(i-t)+(d?60:0);c<r&&(r=c,o=i)}return o}var rt=e=>({x:e.x,y:-(e.y+e.height),width:e.width,height:e.height}),gr=e=>e.map(t=>({x:t.x,y:-t.y}));function Oo(e){let t=(o,r)=>Math.abs(o-r)<.5,n=e.filter((o,r)=>r===0||!(t(o.x,e[r-1].x)&&t(o.y,e[r-1].y)));return n.filter((o,r)=>{let s=n[r-1],i=n[r+1];return!s||!i||!(t(s.x,o.x)&&t(o.x,i.x)||t(s.y,o.y)&&t(o.y,i.y))})}function Lo(e,t,n){let o=e.boxes.filter(l=>!$n(l,t)&&l.y+l.height<=t.y+1&&l.x<t.x+t.width&&l.x+l.width>t.x),r=[{from:t.x+6,to:t.x+t.width-6}];for(let l of o)r=r.flatMap(a=>[{from:a.from,to:Math.min(a.to,l.x-12/2)},{from:Math.max(a.from,l.x+l.width+12/2),to:a.to}]).filter(a=>a.to>=a.from);let s=null;for(let l of r){let a=Math.min(Math.max(n,l.from),l.to);(s===null||Math.abs(a-n)<Math.abs(s-n))&&(s=a)}if(s!==null)return{x:s,tail:[{x:s,y:t.y}]};let i=n<t.x+t.width/2,d=Ao([e],i?t.x-12:t.x+t.width+12),c=t.y+t.height/2;return{x:d,tail:[{x:d,y:c},{x:d<t.x?t.x:t.x+t.width,y:c}]}}function Eo(e,t,n){let o=Lo({top:-e.bottom,bottom:-e.top,boxes:e.boxes.map(rt)},rt(t),n);return{x:o.x,head:gr(o.tail).reverse()}}function Ha(e,t,n,o){let r=t;for(;r>o&&!e[r-1].boxes.some(s=>n>s.x-12/2&&n<s.x+s.width+12/2);)r--;return r}var Ba=(e,t)=>(e%3-1)*Math.max(0,Math.min(4,t/2-3));function Da(e,t,n,o,r,s,i,d){let c=m=>m<0?e[0].top-n:e[m+1].top-e[m].bottom,l=m=>(m<0?(n+e[0].top)/2:Na(e,m,m+1))+Ba(d,c(m)),a=Lo(e[s],r,i),u=Ha(e,s,a.x,t+1),f=l(t);if(u===t+1)return Oo([...o.head,{x:o.x,y:f},{x:a.x,y:f},...a.tail]);let h=Ao(e.slice(t+1,u),a.x),x=l(u-1);return Oo([...o.head,{x:o.x,y:f},{x:h,y:f},{x:h,y:x},{x:a.x,y:x},...a.tail])}function hn(e,t,n,o=0){let r=Ia(n.some(a=>$n(a,e))&&n.some(a=>$n(a,t))?n:[...n,e,t]),s=Ro(r,e),i=Ro(r,t),d=e.x+e.width/2,c=t.x+t.width/2;if(s===i){if(!(s<r.length-1||r.length===1))return gr(hn(rt(e),rt(t),n.map(rt),o));let u=Na(r,s,s+1)+Ba(o,s<r.length-1?r[s+1].top-r[s].bottom:2*12),f=Eo(r[s],e,c),h=Eo(r[s],t,d);return Oo([...f.head,{x:f.x,y:u},{x:h.x,y:u},...[...h.head].reverse()])}if(i<s)return gr(hn(rt(e),rt(t),n.map(rt),o));let l=Eo(r[s],e,c);return Da(r,s,r[s].bottom,l,t,i,d,o)}function Po(e,t,n,o=0){if(t.y+t.height<=e.y){let h=Po(rt(e),rt(t),n.map(rt),o);return h?gr(h):null}let r=e.y+e.height;if(t.y<r)return null;let s=Ia([...n.filter(h=>h.y>=r&&!$n(h,t)),t]),i=Ro(s,t),d=t.x+t.width/2,c=Lo(s[i],t,d),l=Ha(s,i,c.x,0),a=l===0?c.x:Ao(s.slice(0,l),c.x),u=Math.min(12,e.width/2),f=Math.min(Math.max(a,e.x+u),e.x+e.width-u);return Da(s,-1,r,{x:f,head:[{x:f,y:r}]},t,i,d,o)}function $a(e,t=16){let n=new Map;for(let r of e){let s=r.a<r.b?`${r.a}\0${r.b}`:`${r.b}\0${r.a}`,i=n.get(s);i?i.push(r.key):n.set(s,[r.key])}let o=new Map;for(let r of n.values())r.forEach((s,i)=>o.set(s,(i-(r.length-1)/2)*t));return o}var Xe=ie(Ee(),1);function Co(e,t,n,o){let r=[];for(let s of e.querySelectorAll("[data-graview-relation] > span")){let i=s.getBoundingClientRect();if(i.width<=0||i.height<=0)continue;let d=i.top-t.top,c=s.parentElement?.getAttribute("data-graview-relation"),l=1/0;for(let a of n){if(Math.round(a.plane)!==1||!a.via||`${a.via.edgeKind}|${a.via.direction}`!==c)continue;let u=o(a.id);u&&u.y>=d+i.height-1&&(l=Math.min(l,u.y))}r.push({x:i.left-t.left,y:d,width:i.width,height:l-d<=i.height*4?l-d:i.height})}return r}function xr(e,t){let n=Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x),o=Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y);if(n>0&&o>0)return null;let r=n>.5*Math.min(e.width,t.width),s=!r&&o>.5*Math.min(e.height,t.height);if(r){let x={x:e.x+e.width,y:e.y+e.height/2},m={x:t.x+t.width,y:t.y+t.height/2};return{from:x,to:m,control:{x:Math.max(x.x,m.x)+18,y:(x.y+m.y)/2},mode:"stacked"}}if(s){let x={x:e.x+e.width/2,y:e.y},m={x:t.x+t.width/2,y:t.y};return{from:x,to:m,control:{x:(x.x+m.x)/2,y:Math.min(x.y,m.y)-18},mode:"abreast"}}let i={x:t.x+t.width/2,y:t.y+t.height/2},d={x:e.x+e.width/2,y:e.y+e.height/2},c=wr(e,i),l=wr(t,d),a=Math.hypot(l.x-c.x,l.y-c.y);if(a<8)return null;let u=Math.min(36,a*.12),f=-(l.y-c.y)/a,h=(l.x-c.x)/a;return{from:c,to:l,control:{x:(c.x+l.x)/2+f*u,y:(c.y+l.y)/2+h*u},mode:"direct"}}function wr(e,t){let n=e.x+e.width/2,o=e.y+e.height/2,r=t.x-n,s=t.y-o;if(r===0&&s===0)return{x:n,y:o};let i=r===0?1/0:e.width/2/Math.abs(r),d=s===0?1/0:e.height/2/Math.abs(s),c=Math.min(i,d),l=Math.max(0,c*.98);return{x:n+r*l,y:o+s*l}}function kd(e,t,n){let o=t.get(e.from),r=t.get(e.to);if(!o||!r)return!1;if(n)return!0;let s=Math.round(o.plane)===1||Math.round(r.plane)===1,i=d=>!!d.aggregate&&Math.round(d.plane)===2;return s&&!i(o)&&!i(r)}var Wa=e=>({clips:new Map,members:new Map,marks:new Map,...e?{owed:e}:{}});function ja(e,t){let n=Wa();for(let[o,r]of t){let s=e.querySelector(`[data-graview-view="${CSS.escape(o)}"]`);if(s!==null){for(let i of r)if(mn(e,s,i,n).length>0)return!0}}return!1}function Va(e,t){let n=t.marks.get(e);if(n)return n;n=new Map;for(let o of e.querySelectorAll("[data-graview-pick], [data-graview-slot]"))for(let r of new Set([o.getAttribute("data-graview-pick"),o.getAttribute("data-graview-slot")])){if(r===null)continue;let s=n.get(r);s?s.push(o):n.set(r,[o])}return t.marks.set(e,n),n}function Sd(e,t){let n=t.clips.get(e);if(n===void 0){let o=getComputedStyle(e);n=o.overflow!=="visible"||o.overflowX!=="visible"||o.overflowY!=="visible"?e.getBoundingClientRect():null,t.clips.set(e,n)}return n}function Md(e,t,n){let o=e.parentElement;for(;o!==null;){let r=Sd(o,n);if(r&&!(t.right>r.left+1&&t.left<r.right-1&&t.bottom>r.top+1&&t.top<r.bottom-1))return!1;if(o.hasAttribute("data-graview-view"))break;o=o.parentElement}return!0}function mn(e,t,n,o){if(!e||!t||typeof document>"u")return[];let r=o.members.get(t);r||o.members.set(t,r=new Map);let s=r.get(n);if(s)return s;let i=e.getBoundingClientRect(),d=[];for(let l of Va(t,o).get(n)??[]){if(l.closest("[data-graview-offstage]"))continue;let a=l.getBoundingClientRect();a.width<=2||a.height<=2||Md(l,a,o)&&d.push({x:a.left-i.left,y:a.top-i.top,width:a.width,height:a.height})}d.sort((l,a)=>l.width*l.height-a.width*a.height),r.set(n,d);let c=t.getAttribute("data-graview-view");return d.length===0&&o.owed&&c!==null&&o.owed.set(c,(o.owed.get(c)??new Set).add(n)),d}function br(e,t,n,o,r,s){let i=new Map(e.map(w=>[w.id,w])),d=Wa(s),c=new Map,l=w=>{if(!n||typeof document>"u")return null;let v=c.get(w);return v===void 0&&(v=n.querySelector(`[data-graview-view="${CSS.escape(w)}"]`),c.set(w,v)),v},a=new Map;for(let w of e){let v=ze(n,w.id,o)??ct(w,r);v&&a.set(w.id,v)}let u=new Map;if(n&&typeof document<"u"){let w=n.getBoundingClientRect();for(let v of n.querySelectorAll("[data-graview-pick], [data-graview-slot]")){if(v.closest("[data-graview-offstage]"))continue;let T=v.getAttribute("data-graview-pick")??v.getAttribute("data-graview-slot");if(T===null)continue;let E=v.getBoundingClientRect();if(E.width<=2||E.height<=2||E.width>w.width*.6&&E.height>w.height*.6)continue;let N=u.get(T),F={x:E.left-w.left,y:E.top-w.top,width:E.width,height:E.height};N?N.push(F):u.set(T,[F])}}let f=(w,v)=>{let T=[];for(let[E,N]of a)E!==w&&E!==v&&T.push(N);for(let[E,N]of u)E!==w&&E!==v&&T.push(...N);return T},h=w=>Math.round(i.get(w)?.plane??-1)===1,x=[];for(let w of e){let v=a.get(w.id);v&&Math.round(w.plane)===1&&x.push(v)}if(!o&&n&&typeof document<"u"){let w=n.getBoundingClientRect();x.push(...Co(n,w,e,v=>a.get(v)))}let m=(w,v)=>!o&&h(w)&&h(v)?x:void 0,g=o?void 0:e.find(w=>Math.round(w.plane)===0&&!w.aggregate),S=(w,v,T,E)=>{if(!g)return{};let N=w.to===g.id&&T===g.id;if(!N&&!(w.from===g.id&&v===g.id))return{};let F=N?w.from:w.to,y=a.get(g.id),b=a.get(F);if(F===g.id||!h(F)||!y||!b)return{};let L=l(g.id),P=ne=>L!==null&&Va(L,d).get(ne)?.some(D=>!D.closest("[data-graview-offstage]"))===!0,V=E.map(ne=>ne.from===g.id?ne.to:ne.from),Z=V.length>0&&V.every(P);return{band:x,tie:{card:y,chip:b,cardIsTo:N,toward:F,holds:i.get(F)?.aggregate?.memberIds??[F]},...Z?{said:V}:{}}},M=[];for(let w of t){if(!kd(w,i,o))continue;let v=a.get(w.from),T=a.get(w.to);if(!v||!T)continue;let E=f(w.from,w.to),N=w.edges,F=o&&N.some(L=>L.from!==w.from&&mn(n,l(w.from),L.from,d).length>0||L.to!==w.to&&mn(n,l(w.to),L.to,d).length>0),y=m(w.from,w.to);if(o&&!F||w.loop||N.length===0){M.push({key:w.id,connector:w,edges:N,fromBox:v,toBox:T,fromAnchor:w.from,toAnchor:w.to,obstacles:E,hosts:[],...y?{band:y}:{},...S(w,w.from,w.to,N)});continue}let b=new Map;for(let L of N){let P=L.from===w.from?[]:mn(n,l(w.from),L.from,d),V=L.to===w.to?[]:mn(n,l(w.to),L.to,d),Z=[w.from,w.to].find(I=>Math.round(i.get(I)?.plane??-1)===0);if(!o&&Z!==void 0&&(Z===w.from?L.from!==w.from:L.to!==w.to)&&mn(n,l(Z),Z===w.from?L.to:L.from,d).length>0)continue;let ne=Z!==void 0?i.get(Z):void 0;if(!o&&ne?.aggregate&&n&&(Z===w.from?L.from!==w.from&&P.length===0:L.to!==w.to&&V.length===0))continue;let D=P.length>0?L.from:w.from,$=V.length>0?L.to:w.to,B=`${w.id}|${D}|${$}`,Q=b.get(B);if(Q){Q.edges.push(L);continue}let A=P.length>0?P:[v],W=V.length>0?V:[T],K=A[0],k=W[0],R=1/0;for(let I of A)for(let O of W){let C=Math.hypot(I.x+I.width/2-(O.x+O.width/2),I.y+I.height/2-(O.y+O.height/2));C<R&&(R=C,K=I,k=O)}b.set(B,{edges:[L],fromBox:K,toBox:k,fromAnchor:D,toAnchor:$})}for(let[L,P]of b)M.push({key:L,connector:w,obstacles:E,hosts:[...P.fromAnchor!==w.from?[v]:[],...P.toAnchor!==w.to?[T]:[]],...y?{band:y}:{},...P,...S(w,P.fromAnchor,P.toAnchor,P.edges)})}return M}function Ga(e,t,n){let o=new Map(t.map(i=>[i.id,i])),r=new Map;for(let i of n){let d=o.get(i.id);d&&(d.x!==i.x||d.y!==i.y)&&r.set(i.id,{x:i.x-d.x,y:i.y-d.y})}if(r.size===0)return[...e];let s=(i,d)=>{let c=r.get(d);return c?{...i,x:i.x+c.x,y:i.y+c.y}:i};return e.map(i=>{let{from:d,to:c}=i.connector;if(!r.has(d)&&!r.has(c))return i;let l=s(i.fromBox,d),a=s(i.toBox,c),u=i.tie&&{...i.tie,card:s(i.tie.card,i.tie.cardIsTo?c:d),chip:s(i.tie.chip,i.tie.toward)},f=h=>h===i.fromBox?l:h===i.toBox?a:i.tie&&h===i.tie.chip?u.chip:h;return{...i,fromBox:l,toBox:a,...u?{tie:u}:{},...i.band?{band:i.band.map(f)}:{}}})}function To(e,t){let n=(1-t)*(1-t),o=2*(1-t)*t,r=t*t;return{x:n*e.p0.x+o*e.c.x+r*e.p1.x,y:n*e.p0.y+o*e.c.y+r*e.p1.y}}function Fa(e,t,n){let o=(1-t)*(1-n),r=(1-t)*n+t*(1-n),s=t*n;return{p0:To(e,t),c:{x:o*e.p0.x+r*e.c.x+s*e.p1.x,y:o*e.p0.y+r*e.c.y+s*e.p1.y},p1:To(e,n)}}function Fn(e,t){let n=l=>t.some(a=>l.x>a.x&&l.x<a.x+a.width&&l.y>a.y&&l.y<a.y+a.height),o=l=>!n(To(e,l)),s=(l,a,u)=>{for(let f=0;f<10;f++){let h=(l+a)/2;o(h)===u?l=h:a=h}return(l+a)/2},i=[],d=null,c=o(0);c&&(d=0);for(let l=1;l<=64;l++){let a=l/64,u=o(a);if(u===c)continue;let f=s((l-1)/64,a,c);u?d=f:d!==null&&(f-d>.001&&i.push(Fa(e,d,f)),d=null),c=u}return d!==null&&1-d>.001&&i.push(Fa(e,d,1)),i}function za({strands:e,result:t,scheme:n,overview:o,selection:r,emphasis:s,stageRef:i,liveOf:d,onPickEdge:c,provisional:l,pointed:a=null}){let u=zt(),f=new Set(t.nodes.filter(y=>y.plot!==void 0&&Math.round(y.plane)===2).map(y=>y.id)),h=y=>o&&t.city!==void 0&&f.has(y.from)&&f.has(y.to),x=mo(t.nodes,r),m=y=>x.size===0||x.has(y.from)||x.has(y.to),g=new Set(r.filter(y=>Ft(y)===null)),S=o?t.nodes.find(y=>Math.round(y.plane)===0):void 0,M=S?ze(i.current,S.id,!1)??ct(S,n):null;if(e.length===0)return null;let w=y=>y.edges.some(b=>g.has(b.from)||g.has(b.to)),v=g.size>0&&e.some(w),T=new Map;for(let y of e)T.set(y.connector.id,(T.get(y.connector.id)??0)+1);let E=$a(e.map(y=>({key:y.key,a:y.fromAnchor,b:y.toAnchor}))),N=new Set,F=e.map((y,b)=>{let{connector:L,fromBox:P,toBox:V}=y,Z={x:P.x+P.width/2,y:P.y+P.height/2},ne={x:V.x+V.width/2,y:V.y+V.height/2},D=o?wr(P,ne):Z,$=o?wr(V,Z):ne,B=L.loop===!0,{connector:Q,style:A}=sn(u,L.kind);if(!Q.visible)return null;let W=B?Math.max(22,Math.min(P.width,P.height)*.3):0,K=B?{x:Z.x+P.width*.22,y:Z.y-P.height/2-W+7}:D,k=(D.x+$.x)/2,R=(D.y+$.y)/2,I=Math.hypot($.x-D.x,$.y-D.y),O=Math.min(o?40:90,I*(o?.09:.16)),C=0,j=0;if(I>0){C=-($.y-D.y)/I,j=($.x-D.x)/I;let ce=k-t.width/2,ke=R-t.height/2;if(M&&!B){let ht=M.x+M.width/2,at=M.y+M.height/2;ce=k-ht,ke=R-at;let Ae=Math.abs(C*(ht-D.x)+j*(at-D.y)),Ht=Math.hypot(M.width/2,M.height/2)*.85+24,qt=((ht-D.x)*($.x-D.x)+(at-D.y)*($.y-D.y))/(I*I);Ae<Ht&&qt>.1&&qt<.9&&(O=Math.min(180,Math.max(O,(Ht-Ae)*2)))}C*ce+j*ke<0&&(C=-C,j=-j)}O+=2*(E.get(y.key)??0);let G=yr(Q.route,{p0:D,c:{x:k+C*O,y:R+j*O},p1:$}),J=h(L),_=Q.route==="orthogonal"||J,oe=(ce,ke)=>J?Ca(ce,ke):Dn(ce,ke),re=!B&&y.tie?Po(y.tie.card,y.tie.chip,y.band??[],b):null,Y=re?y.tie.cardIsTo?re.reverse():re:!B&&y.band?hn(P,V,y.band,b):null,me=B||_||Y?[]:Fn(G,[P,V,...y.obstacles]),le=Y?[Y]:!B&&_?So(oe(D,$),[P,V,...y.obstacles]):[];if(!B&&me.length===0&&le.length===0)return null;let ve=le[le.length-1],He=_||Y?le[0]?.[0]:me[0]?.p0,De=_||Y?ve?.[ve.length-1]:me[me.length-1]?.p1,Pe=ce=>ce.map(ke=>`M ${ke.p0.x} ${ke.p0.y} Q ${ke.c.x} ${ke.c.y} ${ke.p1.x} ${ke.p1.y}`).join(" "),q=`M ${K.x-W} ${K.y} A ${W} ${W} 0 1 1 ${K.x+W} ${K.y} A ${W} ${W} 0 0 1 ${K.x-W} ${K.y}`,Te=B?q:Y?Pa(Y,Q.route):_?Pt(le):Pe(me),$e=ce=>({x:ce.x-8,y:ce.y-8,width:ce.width+16,height:ce.height+16}),Tt=[P,V,...y.hosts,...y.obstacles].map($e),Ct=B?q:Y?Pt(le):_?Pt(So(oe(D,$),Tt)):Pe(Fn(G,Tt)),et=y.edges.length===1?y.edges[0]:null,Fe=et?Yt(L.kind,et.from,et.to):null,It=Fe!==null&&r.includes(Fe),tt=Fe!==null?l?.get(Fe):void 0,wt=y.edges.some(ce=>g.has(ce.from)||g.has(ce.to)),Oe=y.tie?.toward??"",We=y.tie!==void 0&&(a!==null&&(Oe===a||y.tie.holds.includes(a)||y.said?.includes(a)===!0)||g.has(Oe))&&!N.has(Oe);We&&N.add(Oe);let Ye=!o&&g.size>0&&wt||We,ee=s!==null&&L.kind===s||It,Nt=d?.(L)!==void 0;if(o&&!Nt||!o&&!Nt&&g.size>0&&!wt&&!ee&&!We||y.said!==void 0&&!We&&!y.said.some(ce=>g.has(ce))&&!ee)return null;let qe=o?po({emphasized:s!==null,stressed:ee,anyChosen:v,mine:wt,touches:m(L),siblings:T.get(L.id)??1}):yo({edgeChosen:It,lit:Ye,anyLit:v||s!==null,own:A.opacity,kit:u.emphasis}),xt=Ye&&He&&De?y.tie?y.tie.cardIsTo?He:De:y.edges.some(ce=>g.has(ce.from))?De:He:null,yn=(0,Xe.jsxs)("g",{children:[(0,Xe.jsx)("path",{"data-graview-connector":L.kind,"data-graview-edges":y.edges.length,"data-graview-from":y.fromAnchor,"data-graview-to":y.toAnchor,"data-graview-lit":Ye||void 0,"data-graview-activity":d?.(L)?.manner,"data-graview-provisional":tt!==void 0||void 0,opacity:qe*(L.opacity??1)*(tt!==void 0?Ln:1),d:Te,fill:"none",stroke:rn(A),strokeWidth:(Ye?Math.max(1.6,Vr(A,o)):Vr(A,o))+(ee?.6:0),strokeDasharray:tt!==void 0?An:tr[A.pattern],strokeLinecap:"round"}),xt?(0,Xe.jsx)("circle",{cx:xt.x,cy:xt.y,r:2.6,fill:rn(A),opacity:qe}):null,B&&o?(0,Xe.jsx)("text",{x:K.x,y:K.y-W-5,textAnchor:"middle",opacity:qe,style:{font:"9px var(--graview-font-body, system-ui)",letterSpacing:"0.09em",textTransform:"uppercase",fill:"var(--graview-ink-faint)"},children:Xn(L.kind).toLowerCase()}):null]},y.key),it=null;return Fe&&c&&!B&&qe>=.2&&(it=(0,Xe.jsx)("path",{"data-graview-edge":Fe,className:"graview-edge-hit",d:Ct,fill:"none",pathLength:1,strokeDasharray:"0.86",strokeDashoffset:-.07,stroke:"transparent",strokeWidth:14,style:{pointerEvents:"stroke",cursor:"pointer"},onClick:ce=>{ce.stopPropagation(),c(Fe,{x:ce.clientX,y:ce.clientY})},onContextMenu:ce=>{ce.preventDefault(),ce.stopPropagation(),c(Fe,{x:ce.clientX,y:ce.clientY})},children:tt!==void 0?(0,Xe.jsx)("title",{children:tt}):null},`hit:${y.key}`)),{key:y.key,line:yn,hit:it}});return(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)("svg",{"aria-hidden":"true","data-graview-world":"",width:t.width,height:t.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:Ve.ties},children:F.map(y=>y?.line)}),F.some(y=>y?.hit)?(0,Xe.jsx)("svg",{"data-graview-world":"",width:t.width,height:t.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:Ve.tieLabels},children:F.map(y=>y?.hit)}):null]})}function Ya(e,t,n){if(t.size===0||typeof MutationObserver>"u")return()=>{};let o=0,r=()=>{o=0,ja(e,t)&&n()},s=()=>{o===0&&(o=requestAnimationFrame(r))},i=({target:c})=>{for(let l=c instanceof Element?c:c.parentElement;l&&l!==e;l=l.parentElement)if(t.has(l.getAttribute("data-graview-view")??""))return!0;return!1},d=new MutationObserver(c=>{c.some(i)&&s()});return d.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-graview-pick","data-graview-slot","data-graview-offstage"]}),s(),()=>{d.disconnect(),cancelAnimationFrame(o)}}function vr(e){return e<640?{left:8,right:56}:{left:8,right:Math.round(Math.min(128,e*.107))}}function Ed(e){return Math.min(260,16+e.length*6.6)}var Wn=(e,t)=>Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));function Ka(e,t,n){let o=new Map;for(let i of e){let d=o.get(i.said);d?d.push(i):o.set(i.said,[i])}let r=[],s=[];for(let[i,d]of o){let c=d[0],l=Ed(i),{end:a,far:u}=c,f=g=>Math.max(0,Math.min(n.width-l,g)),h=[{x:f(a.x-l/2),y:u.y-22-6,width:l,height:22},{x:f(a.x-l/2),y:u.y+u.height+6,width:l,height:22},{x:u.x+u.width+6,y:a.y-22/2,width:l,height:22},{x:u.x-l-6,y:a.y-22/2,width:l,height:22}],x=h[0],m=1/0;for(let g of h){let M=g.x<0||g.y<0||g.x+g.width>n.width||g.y+g.height>n.height?1e9:0;for(let w of t)M+=Wn(g,w.title)*100+Wn(g,w.box);for(let w of r)M+=Wn(g,w)*100;if(M<m&&(m=M,x=g),M===0)break}r.push(x),s.push({said:i,keys:d.map(g=>g.key),...x})}return s}var _a=(e,t,n=2)=>t.x>=e.x-n&&t.x<=e.x+e.width+n&&t.y>=e.y-n&&t.y<=e.y+e.height+n;function Io(e,t){let n=new Set;for(let o of e)(t.edgeId&&o.edgeId===t.edgeId||t.point&&(_a(o.fromBox,t.point)||_a(o.toBox,t.point))||t.ids?.some(r=>o.ids.includes(r))||t.box&&(Wn(t.box,o.fromBox)>0||Wn(t.box,o.toBox)>0))&&n.add(o.key);return n}var be=ie(Ee(),1);function qa(e){let t=di(e);return t.length>0?new Map(t.map(n=>[Yt(n.edge.kind,n.edge.from,n.edge.to),si(n)])):void 0}function Qa({frame:e,width:t,height:n,scheme:o,overview:r,selection:s,emphasis:i,stageRef:d,store:c,graphNodes:l,onPickEdge:a,liveOf:u,holding:f=!1,provisional:h,focusId:x=null,beside:m=!1}){let[g,S]=(0,he.useState)(0),[M,w]=(0,he.useState)(null),v=e.t<1,T=(0,he.useRef)(""),E=(0,he.useRef)([]),N=(0,he.useRef)(new Map),F=()=>[...d.current?.querySelectorAll("[data-graview-relation] > span")??[]].map(D=>{let $=D.getBoundingClientRect();return`${Math.round($.left)},${Math.round($.top)},${Math.round($.width)}`}).join(" ");(0,he.useLayoutEffect)(()=>{if(v||f)return;T.current=F(),E.current=e.nodes;let D=new Map;w(br(e.nodes,e.connectors,d.current,r,o,D)),N.current=D},[e,v,f,s,r,l,o,g,d]),(0,he.useEffect)(()=>{let D=d.current;if(!(v||f||D===null))return Ya(D,N.current,()=>S($=>$+1))},[M,v,f,d]),(0,he.useEffect)(()=>{if(v||f||r||typeof requestAnimationFrame>"u")return;let D=requestAnimationFrame(()=>{F()!==T.current&&S($=>$+1)});return()=>cancelAnimationFrame(D)},[M]);let y=e.nodes.map(D=>D.id).join(`
4
+ `);(0,he.useLayoutEffect)(()=>{let D=d.current;if(D===null||typeof window>"u")return;let $=0,B=()=>{$===0&&($=requestAnimationFrame(()=>{$=0,S(A=>A+1)}))};D.addEventListener("scroll",B,{capture:!0,passive:!0}),window.addEventListener("resize",B,{passive:!0});let Q=typeof ResizeObserver>"u"?null:new ResizeObserver(B);if(Q){Q.observe(D);for(let A of D.querySelectorAll("[data-graview-view]"))Q.observe(A)}return()=>{$!==0&&cancelAnimationFrame($),D.removeEventListener("scroll",B,{capture:!0}),window.removeEventListener("resize",B),Q?.disconnect()}},[d,y]);let b=(0,he.useRef)(new WeakMap);(0,he.useEffect)(()=>{let D=d.current;if(v||f||D===null||typeof ResizeObserver>"u")return;let $=0,B=new ResizeObserver(Q=>{let A=!1;for(let{target:W,contentRect:K}of Q){let k=`${Math.round(K.width)}x${Math.round(K.height)}`;b.current.has(W)&&b.current.get(W)!==k&&(A=!0),b.current.set(W,k)}A&&$===0&&($=requestAnimationFrame(()=>{$=0,S(W=>W+1)}))});for(let Q of D.querySelectorAll("[data-graview-view]")){let A=go(Q);A!==Q&&B.observe(A)}return()=>{$!==0&&cancelAnimationFrame($),B.disconnect()}},[M,v,f,d]);let[L,P]=(0,he.useState)(null),V=(M??[]).some(D=>D.tie!==void 0);if((0,he.useEffect)(()=>{let D=d.current;if(!V||D===null)return;let $=Q=>{let A=Q.target?.closest?.("[data-graview-pick], [data-graview-view]");P(A?.getAttribute("data-graview-pick")??A?.getAttribute("data-graview-view")??null)},B=()=>P(null);return D.addEventListener("pointerover",$),D.addEventListener("focusin",$),D.addEventListener("pointerleave",B),D.addEventListener("focusout",B),()=>{D.removeEventListener("pointerover",$),D.removeEventListener("focusin",$),D.removeEventListener("pointerleave",B),D.removeEventListener("focusout",B)}},[V,d]),v)return null;let Z=(M&&f?Ga(M,E.current,e.nodes):M)??br(e.nodes,e.connectors,null,r,o),ne=new Set;for(let D of Z){if(D.edges.length===1){let $=D.edges[0];ne.add(`${D.connector.kind}|${$.from}|${$.to}`);continue}for(let $ of D.edges)(D.connector.from===$.from||D.connector.to===$.to)&&ne.add(`${D.connector.kind}|${$.from}|${$.to}`)}return(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(za,{strands:Z,result:e,scheme:o,overview:r,selection:s,emphasis:i,stageRef:d,onPickEdge:a,liveOf:u,pointed:L,...h?{provisional:h}:{}}),r&&Tn(s,{overview:r,focusId:x,beside:m},D=>c.graph.getNode(D)?.kind).records.length>0?(0,be.jsx)(he.Suspense,{fallback:null,children:(0,be.jsx)(Od,{frame:e,width:t,height:n,stageRef:d,tick:g,store:c,graphVersion:l,selection:s,view:{overview:r,focusId:x,beside:m},rulers:h?{...Ua,unsureOf:(D,$,B)=>h.get(Yt(D,$,B))}:Ua})}):null,r?null:(0,be.jsx)(Ld,{...h?{provisional:h}:{},stageRef:d,nodes:e.nodes,scheme:o,selection:s,store:c,graphNodes:l,overview:r,width:t,height:n,onPickEdge:a,alreadyDrawn:ne,tick:g})]})}var Ua={visibleRect:fn,clipQuadratic:Fn,unsureDash:An,unsureOpacity:Ln},Rd=On(en(()=>(__graviewPreload(import.meta.url,["./chunk.DQAMVVE6.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.D2XLECMP.js")))),Od=Rd.part((e,t)=>(0,be.jsx)(e.RecordLinks,{...t}),{what:"The links",quiet:!0}),Ad=44;function Ld({stageRef:e,nodes:t,scheme:n,selection:o,store:r,graphNodes:s,overview:i,width:d,height:c,onPickEdge:l,alreadyDrawn:a,tick:u,provisional:f}){let h=zt(),x=(0,he.useMemo)(()=>{if(o.length===0||o.length>4)return[];let y=new Set(o),b=[];for(let P of o){let V=Ft(P);V&&b.push({kind:V.kind,self:V.from,other:V.to})}for(let P of r.graph.allEdges()){let V=y.has(P.from)?P.from:y.has(P.to)?P.to:null;if(!V)continue;let Z=V===P.from?P.to:P.from;y.has(Z)||b.push({kind:P.kind,self:V,other:Z})}if(b.length<=14)return b;let L=new Set(t.map(P=>P.id));return b.map((P,V)=>({tie:P,index:V,real:L.has(P.other)?0:1})).sort((P,V)=>P.real-V.real||P.index-V.index).slice(0,14).map(({tie:P})=>P)},[r,o,s,t]),m=()=>{if(x.length===0||typeof document>"u")return[];let y=e.current?.getBoundingClientRect();if(!y)return[];let b=[...e.current?.querySelectorAll("[data-graview-joins]")??[]].find(A=>{if(A.closest("[data-graview-offstage]"))return!1;try{let W=JSON.parse(A.getAttribute("data-graview-joins")??"[]");return W.length===o.length&&W.every(K=>o.includes(K))}catch{return!1}});if(b){let A=fn(b,e.current);if(!A)return[];let W=[];for(let K of o){let k=t.find(C=>C.id===K);if(!k)continue;let R=ze(e.current,k.id,i)??ct(k,n),I=R?xr(A,R):null;if(!R||!I)continue;let O=[...r.graph.allEdges()].find(C=>C.from===K&&o.includes(C.to)||C.to===K&&o.includes(C.from));W.push({key:`join:${K}`,self:K,other:"",others:1,kind:O?.kind??"",endX:I.to.x,endY:I.to.y,...I,fromBox:A,toBox:R,proxy:!1,edgeId:O?Yt(O.kind,O.from,O.to):null})}return W}let L=(A,W)=>{let K=e.current?.querySelectorAll(`[data-graview-pick="${CSS.escape(A)}"], [data-graview-slot="${CSS.escape(A)}"]`),k=[];for(let R of K??[]){if(R.closest("[data-graview-offstage]")||W(R)||R.closest("[data-graview-mark]"))continue;let I=fn(R,e.current);I&&k.push(I)}return k.sort((R,I)=>R.width*R.height-I.width*I.height)},P=A=>t.find(W=>W.id===A)??t.find(W=>W.aggregate?.memberIds.includes(A)),V=A=>`[data-graview-pick="${CSS.escape(A)}"], [data-graview-slot="${CSS.escape(A)}"]`,Z=(A,W)=>{let K=e.current;if(!K)return!1;for(let k of K.querySelectorAll("[data-graview-view]")){let R=k.querySelector(V(A));if(R===null||R.closest("[data-graview-offstage]"))continue;let I=k.querySelector(V(W));if(I!==null&&!I.closest("[data-graview-offstage]"))return!0}return!1},ne=[];if(!i&&e.current){for(let W of t){if(Math.round(W.plane)!==1)continue;let K=ze(e.current,W.id,!1);K&&ne.push(K)}let A=e.current;ne.push(...Co(A,y,t,W=>ze(A,W,!1)))}let D=new Map,$=[];for(let A of x){if(Z(A.self,A.other))continue;let W=P(A.self),K=W?e.current?.querySelector(`[data-graview-view="${CSS.escape(W.id)}"]`):null,k=!i&&W?.id===A.self&&Math.round(W.plane)===1?ze(e.current,W.id,!1):null,R=k?[k]:L(A.self,()=>!1);if(!(R.length>0)&&W){let q=ze(e.current,W.id,!1)??ct(W,n);q&&R.push(q)}let O=t.find(q=>q.id===A.other),C=[],j=!1;if(O){let q=ze(e.current,O.id,i)??ct(O,n);q&&C.push(q)}else if(C.push(...L(A.other,q=>K?K.contains(q):!1)),C.length===0){let q=P(A.other);if(q&&(!W||q.id!==W.id)){let Te=ze(e.current,q.id,i)??ct(q,n);Te&&(C.push(Te),j=!0)}}if(R.length===0||C.length===0||j&&i)continue;let G=R[0],J=C[0],_=1/0;for(let q of R)for(let Te of C){let $e=Math.hypot(q.x+q.width/2-(Te.x+Te.width/2),q.y+q.height/2-(Te.y+Te.height/2));$e<_&&(_=$e,G=q,J=Te)}if(a?.has(`${A.kind}|${A.self}|${A.other}`)||a?.has(`${A.kind}|${A.other}|${A.self}`))continue;let oe=`${A.kind}:${Math.round(G.x)},${Math.round(G.y)}:${Math.round(J.x)},${Math.round(J.y)}`,re=D.get(oe);if(re){re.others+=1;continue}let Y=xr(G,J);if(!Y)continue;let{from:me,control:le}=Y,ve=k&&G===k?hn(G,J,ne,$.length):void 0,He=ve?ve[ve.length-1]:Y.to,De=[...r.graph.allEdges()].find(q=>q.kind===A.kind&&(q.from===A.self&&q.to===A.other||q.from===A.other&&q.to===A.self)),Pe={key:`${A.kind}:${A.self}:${A.other}`,self:A.self,other:A.other,others:1,kind:A.kind,endX:He.x,endY:He.y,from:me,to:He,control:le,fromBox:G,toBox:J,...ve?{points:ve}:{},proxy:j,edgeId:De?Yt(De.kind,De.from,De.to):null};D.set(oe,Pe),$.push(Pe)}let B=i?void 0:t.find(A=>Math.round(A.plane)===0&&!A.aggregate),Q=A=>{let W=t.find(K=>K.id===A.other)??t.find(K=>K.aggregate?.memberIds.includes(A.other));return W!==void 0&&Math.round(W.plane)===1&&W.via?.edgeKind===A.kind};for(let A of $){if(B&&(A.self!==B.id||Q(A)))continue;let W=[...r.graph.allEdges()].find(C=>C.kind===A.kind&&(C.from===A.self&&C.to===A.other||C.from===A.other&&C.to===A.self)),K=r.graph.getNode(A.self),k=r.graph.getNode(A.other);if(!W||!K||!k)continue;let R=W.from===A.self?"out":"in",I=ai(r.schema,R==="out"?K.kind:k.kind,A.kind,R),O=A.proxy?(R==="out"?r.graph.out(A.self,A.kind):r.graph.in(A.self,A.kind)).filter(C=>C.kind===k.kind).length:1;A.said=A.proxy?`${I}: ${Jt(r.schema,k.kind,Math.max(O,A.others))}`:`${I}: ${Zt(r.schema.tryDefinition(k.kind),k)}`}return $},[g,S]=(0,he.useState)([]),[M,w]=(0,he.useState)([]);(0,he.useLayoutEffect)(()=>{let y=m();S(y),w(y.some(b=>b.said)?v(y):[])},[x,t,i,n,d,c,a,u,e]);let v=y=>{let b=e.current;if(!b)return[];let L=[];for(let P of b.querySelectorAll("[data-graview-view]")){let V=[...P.children].find(ne=>!ne.classList.contains("graview-kind-tag")),Z=V?fn(V,b):null;Z&&L.push({box:Z,title:{...Z,height:Math.min(Z.height,Ad)}})}return Ka(y.flatMap(P=>P.said?[{key:P.key,said:P.said,end:{x:P.endX,y:P.endY},far:P.toBox}]:[]),L,{width:d,height:c})},[T,E]=(0,he.useState)(()=>new Set),N=(0,he.useRef)([]);N.current=g.map(y=>({key:y.key,fromBox:y.fromBox,toBox:y.toBox,ids:[y.self,y.other],edgeId:y.edgeId}));let F=M.length>0;return(0,he.useEffect)(()=>{let y=e.current;if(!y||!F)return;let b=B=>E(Q=>Q.size===B.size&&[...B].every(A=>Q.has(A))?Q:B),L=0,P=null,V=()=>{if(L=0,!P)return;let B=y.getBoundingClientRect(),Q=P.target instanceof Element?P.target:null;b(Io(N.current,{point:{x:P.clientX-B.left,y:P.clientY-B.top},edgeId:Q?.closest("[data-graview-edge]")?.getAttribute("data-graview-edge")??null}))},Z=B=>{P=B,L||(L=requestAnimationFrame(V))},ne=()=>{P=null,b(new Set)},D=B=>{let Q=B.target instanceof Element?B.target:null;if(!Q)return;let A=y.getBoundingClientRect(),W=Q.getBoundingClientRect(),K=Q.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??Q.closest("[data-graview-view]")?.getAttribute("data-graview-view");b(Io(N.current,{...K?{ids:[K]}:{},box:{x:W.left-A.left,y:W.top-A.top,width:W.width,height:W.height}}))},$=B=>{B.relatedTarget instanceof Node&&y.contains(B.relatedTarget)||b(new Set)};return y.addEventListener("pointermove",Z,{passive:!0}),y.addEventListener("pointerleave",ne),y.addEventListener("focusin",D),y.addEventListener("focusout",$),()=>{L&&cancelAnimationFrame(L),y.removeEventListener("pointermove",Z),y.removeEventListener("pointerleave",ne),y.removeEventListener("focusin",D),y.removeEventListener("focusout",$)}},[e,F]),g.length===0?null:(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)("svg",{"aria-hidden":g.some(y=>y.edgeId)?void 0:!0,"data-graview-ties":g.length,"data-graview-world":"",width:d,height:c,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:Ve.lines},children:g.map(y=>{let{connector:b,style:L}=sn(h,y.kind);if(!b.visible)return null;let P=y.edgeId?f?.get(y.edgeId):void 0,V={p0:y.from,c:y.control,p1:y.to},Z=y.points?Mo(y.points,10):b.route==="orthogonal"?Pt([Dn(y.from,y.to)]):(({p0:D,c:$,p1:B})=>`M ${D.x} ${D.y} Q ${$.x} ${$.y} ${B.x} ${B.y}`)(yr(b.route,V)),ne=null;if(y.edgeId&&l&&!y.proxy){let D=(B,Q)=>Q.x>=B.x&&Q.x<=B.x+B.width&&Q.y>=B.y&&Q.y<=B.y+B.height,$=y.points?[...y.points]:[];for(let B=0;B<=(y.points?-1:40);B++){let Q=Ta(b.route,V,B/40);D(y.fromBox,Q)||D(y.toBox,Q)||$.push(Q)}$.length>=2&&(ne=(0,be.jsx)("path",{"data-graview-edge":y.edgeId,className:"graview-edge-hit",d:`M ${$[0].x} ${$[0].y} ${$.slice(1).map(B=>`L ${B.x} ${B.y}`).join(" ")}`,fill:"none",pathLength:1,strokeDasharray:"0.86",strokeDashoffset:-.07,stroke:"transparent",strokeWidth:14,style:{pointerEvents:"stroke",cursor:"pointer"},onClick:B=>{B.stopPropagation(),l(y.edgeId,{x:B.clientX,y:B.clientY})},onContextMenu:B=>{B.preventDefault(),B.stopPropagation(),l(y.edgeId,{x:B.clientX,y:B.clientY})},children:P!==void 0?(0,be.jsx)("title",{children:P}):null}))}return(0,be.jsxs)("g",{opacity:(y.proxy?.32:.72)*(P!==void 0?Ln:1),children:[(0,be.jsx)("path",{"data-graview-tie":y.kind,"data-graview-tie-proxy":y.proxy||void 0,"data-graview-provisional":P!==void 0||void 0,d:Z,fill:"none",stroke:rn(L),strokeWidth:y.proxy?1.1:1.6,strokeDasharray:P!==void 0?An:tr[L.pattern],strokeLinecap:"round"}),(0,be.jsx)("circle",{cx:y.endX,cy:y.endY,r:y.proxy?2:2.6,fill:rn(L)}),ne]},y.key)})}),(0,be.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:Ve.tieLabels},children:M.map(y=>{let b=g.find(L=>L.key===y.keys[0]);return(0,be.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":b?.kind,"data-graview-lands":b?.proxy?"district":"record","data-graview-said-for":y.keys.length,"data-graview-tie-said":y.keys.some(L=>T.has(L))?"shown":"waiting",style:{position:"absolute",left:y.x,top:y.y,transform:`translateX(min(0px, calc(${Math.round(d-y.x-8)}px - 100%)))`},children:y.said},y.said)})})]})}function Xa(){return typeof document>"u"?1:parseFloat(getComputedStyle(document.documentElement).fontSize)/16||1}function Za({nodes:e,scheme:t,width:n,stageRef:o,moving:r=!1,holding:s=!1}){let i=zt(),[d,c]=(0,he.useState)([]);(0,he.useLayoutEffect)(()=>{r||s||c(l())},[e,r,s,t,n,o]);function l(){let u=[],f=[];for(let g of e){if(!g.via||Math.round(g.plane)!==1)continue;let S=ze(o.current,g.id,!1,!0),{scale:M}=nn(1,t);u.push({key:`${g.via.edgeKind}|${g.via.direction}`,text:Cn(g.via),left:S?.x??g.x,right:S?S.x+S.width:g.x+g.width*M,top:S?.y??g.y}),f.push(Math.round(g.y))}let h=new Map;u.forEach((g,S)=>h.set(f[S],Math.min(h.get(f[S])??1/0,g.top)));let x=u.map((g,S)=>({...g,top:h.get(f[S])??g.top})),m=vr(n);return no(x,{left:m.left,right:n-m.right},Xa())}if(d.length===0||!i.captions.visible||r)return null;let a=to*Xa();return(0,be.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:Ve.lines},children:d.map(u=>{let{left:f,width:h}=u;return(0,be.jsx)("div",{"data-graview-relation":u.key,title:u.text,style:{position:"absolute",left:f,width:h,textAlign:"center",top:Math.max(0,u.top-a),fontSize:"0.75rem",letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,be.jsx)("span",{style:{background:"var(--graview-ground)",padding:"1px 7px",borderRadius:4},children:u.text})},u.key)})})}var Xt=ie(Re(),1);var Td=new Set;function es(e,t,n,o,r,s,i=0,d=0){let{store:c,views:l,hiddenKinds:a}=we(),u=jt(),f=(0,Xt.useContext)(tn),h=$r(),x=(0,Xt.useMemo)(()=>{let S={};for(let M of h){if(M.subjectId===void 0)continue;let w=S[M.subjectId]??=[];for(let v of M.nodeIds)v!==M.subjectId&&!w.includes(v)&&w.push(v)}return S},[h]),m=(0,Xt.useMemo)(()=>({flagged:new Set(h.flatMap(S=>S.nodeIds)),touched:nr(c.log.all())}),[h,c,s]),g=(0,Xt.useMemo)(()=>({hits:u?er(u):Td,...m}),[u,m]);return(0,Xt.useMemo)(()=>({...e,cityZoom:o,...f?{besideTheMap:!0}:{},...a.size>0?{hiddenKinds:[...a].sort()}:{},...Object.keys(x).length>0?{judged:x}:{},relevance:g,inset:{...vr((t?.width??1200)-r.right),top:8,bottom:0},chrome:[{x:(t?.width??1200)-r.right-176,y:0,width:176,height:100},Cd(t,r)],...r.right>0||r.bottom>0?{dock:r}:{},...i>0?{headroom:i}:{},unit:n,plainGroups:c.schema.kinds.filter(S=>Ko(l.lookup(S,{cardinality:"many",fidelity:"full"}))),cityOrder:Fo(wi({name:"scene",schema:c.schema,mutations:c.allMutations().filter(S=>!S.derived)}).order.map(S=>S.kind),l.arrangement?.()?.order),screens:l.places().reduce((S,M)=>((S[M.kind]??=[]).push({as:M.as,title:M.title,...M.across?{across:M.across}:{}}),S),{}),...t?{width:t.width,height:Math.max(0,t.height-Math.max(64,d))}:{}}),[e,t,n,c,l,a,x,g,o,f,r.right,r.bottom,i,d])}var Ja=224;function Cd(e,t){let n=e?.width??1200,o=e?.height??800,r=58;return{x:n-t.right-Ja,y:o-t.bottom-r,width:Ja,height:r}}var gt=ie(Re(),1);var ts=ie(Re(),1);function kr(e){let t=e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-joins");if(!t)return null;try{let n=JSON.parse(t);return Array.isArray(n)&&n.length>0&&n.every(o=>typeof o=="string")?n:null}catch{return null}}function ns(e){(0,ts.useEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{for(let s of t.querySelectorAll("[data-graview-pick]"))s.getAttribute("tabindex")===null&&s.setAttribute("tabindex","0"),s.getAttribute("role")===null&&Nd(s)&&s.setAttribute("role","button")};if(n(),typeof MutationObserver>"u")return;let o=0,r=new MutationObserver(()=>{o===0&&(o=typeof requestAnimationFrame>"u"?0:requestAnimationFrame(()=>{o=0,n()}),o===0&&n())});return r.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-graview-pick"]}),()=>{r.disconnect(),o!==0&&cancelAnimationFrame(o)}},[e])}var Id=new Set(["div","span","p","figure","img","td","output","b","i","em","strong","small","canvas","g","polygon","circle","rect","path","ellipse","polyline","line","use"]);function Nd(e){return Id.has(e.localName.toLowerCase())}var pn=ie(Ee(),1);function rs({node:e,useDom:t,blur:n,touched:o,frontY:r,centerY:s,screen:i,onDrawnHeight:d,crowded:c,activity:l,scheme:a,canvasWidth:u,canvasHeight:f,selected:h,onSelect:x,onPick:m,onTravel:g,onMenu:S,selection:M,onJackIn:w,onDragStart:v,onDragMove:T,onDragEnd:E,onDragCancel:N,swallowClick:F,children:y}){let{brand:b,store:L,actsDoor:P}=we(),V=e.beyond?`${e.beyond.length} more district${e.beyond.length===1?"":"s"}`:e.aggregate?.opens?.in==="place"?`${e.aggregate.label}, ${Jt(L.schema,e.aggregate.kind,e.aggregate.memberIds.length)}`:e.aggregate?e.aggregate.label:(()=>{let O=L.graph.getNode(e.id);return O?Zt(L.schema.tryDefinition(e.kind),O):e.id})(),[Z,ne]=(0,gt.useState)(null),D=Math.round(e.plane)===0&&!e.aggregate;(0,gt.useLayoutEffect)(()=>{if(!D)return;let O=W.current;if(!O)return;let C=()=>{let G=[...O.children].find(Y=>Y.dataset.graviewKindtag===void 0);if(!G)return;let J=O.getBoundingClientRect(),_=G.getBoundingClientRect(),oe=O.offsetWidth>0?J.width/O.offsetWidth:1,re={top:Math.round((_.top-J.top)/oe)-9,right:Math.round((J.right-_.right)/oe)+14};ne(Y=>Y&&Y.top===re.top&&Y.right===re.right?Y:re)};if(typeof ResizeObserver>"u"){C();return}let j=new ResizeObserver(C);j.observe(O);for(let G of O.children)j.observe(G);return()=>j.disconnect()},[D,e.id]);let $=Zo({plane:e.plane,...e.depth!==void 0?{depth:e.depth}:{},onPlot:r!==void 0},a),B=$.style,Q=Qo(B,e.x,e.y,u,f),A=n?$.blur:0,W=(0,gt.useRef)(null);ns(W);let K=e.natural,k=K?Math.min(e.width/K.width,e.height/K.height):1,R=(0,gt.useRef)(null);(0,gt.useEffect)(()=>{if(!i||!d)return;let O=R.current;if(!O||typeof ResizeObserver>"u")return;let C=()=>{let oe=0,re=0;for(let Y of O.children)if(!(!(Y instanceof HTMLElement)||Y.classList.contains("graview-screen-fullscreen"))){oe=Math.max(oe,Y.offsetTop+Y.offsetHeight);for(let me of[Y,...Y.querySelectorAll("*")]){let le=getComputedStyle(me).overflowY;(le==="auto"||le==="scroll")&&(re+=me.scrollHeight-me.clientHeight)}}d(oe+re)},j=0,G=()=>{j||(j=requestAnimationFrame(()=>{j=0,C()}))};C();let J=new ResizeObserver(G);J.observe(O);for(let oe of O.children)J.observe(oe);let _=new MutationObserver(G);return _.observe(O,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),()=>{j&&cancelAnimationFrame(j),J.disconnect(),_.disconnect(),d(void 0)}},[i,d,e.id]);let I=t?{transform:La(Q),transformOrigin:"0 0",filter:A>0?`blur(${A}px)`:void 0,opacity:Jo(B)*(e.opacity??1),"--graview-lift-low":vo(B.shadow,a),...r!==void 0?{"--graview-front-y":`${r.toFixed(1)}px`}:{},...s!==void 0?{"--graview-center-y":`${s.toFixed(1)}px`}:{}}:{"--graview-lift-low":vo(B.shadow,a)};return(0,pn.jsxs)("div",{ref:W,"data-graview-view":e.id,...t?{}:{drawable:""},"data-graview-plane":Math.round(e.plane),"data-graview-selected":h||void 0,"data-graview-touched":o||void 0,"data-graview-plot":r!==void 0?"":void 0,"data-graview-screen":i?"":void 0,"data-graview-record-focus":Math.round(e.plane)===0&&!e.aggregate&&!K&&!i?"":void 0,"data-graview-nested":e.nestedUnder??void 0,"data-graview-crowded":c||void 0,"data-graview-pinned":e.pinned||void 0,"data-graview-activity":l?l.manner:void 0,"data-graview-wrote":l?.wrote||void 0,"data-graview-read":l&&!l.wrote?!0:void 0,"data-graview-broke":l?.broke||void 0,title:l?`${pa[l.manner]} ${l.wrote?"changed this":"read this"}: ${l.intent}`:e.aggregate&&Math.round(e.plane)!==0?`Open ${e.aggregate.label}`:void 0,role:"group","aria-label":V,"aria-keyshortcuts":P&&!e.beyond?P.key:void 0,tabIndex:0,onPointerDown:v,onPointerMove:T,onPointerUp:E,onPointerCancel:N??E,onClick:O=>{if(F.current)return;let C=O.target?.closest("input, textarea, select, button, a[href], [contenteditable='true']");if(C&&!C.hasAttribute("data-graview-pick"))return;let j=O.metaKey||O.shiftKey,G=Rt(O.target);if(G&&G!==e.id){O.stopPropagation(),m(G,j,kr(O.target)??void 0);return}x(j)},onKeyDown:O=>{if(P&&!e.beyond&&O.key.toLowerCase()===P.key.toLowerCase()&&!O.metaKey&&!O.ctrlKey&&!O.altKey&&!O.target?.closest("input, textarea, select, [contenteditable='true']")){O.preventDefault(),O.stopPropagation();let _=Rt(O.target)??e.id;M.includes(_)||m(_,!1),P.open(O.target instanceof HTMLElement?O.target:O.currentTarget);return}if(O.key!=="Enter"&&O.key!==" "||O.target?.closest("input, textarea, select, button, [contenteditable='true']"))return;let j=Rt(O.target);if(O.preventDefault(),O.stopPropagation(),!j||j===e.id){M.length===1&&M[0]===e.id&&!O.metaKey&&!O.shiftKey?w():x(O.metaKey||O.shiftKey);return}let G=kr(O.target);(G?M.length===G.length&&G.every(_=>M.includes(_)):M.length===1&&M[0]===j)&&!O.metaKey&&!O.shiftKey?g(j):m(j,O.metaKey||O.shiftKey,G??void 0)},onContextMenu:O=>{let C=Rt(O.target);O.preventDefault(),O.stopPropagation();let j=C&&C!==e.id?C:e.id;m(j,!1,(j===C?kr(O.target):null)??void 0),S({x:O.clientX,y:O.clientY,on:j})},onDoubleClick:O=>{let C=Rt(O.target);if(C&&C!==e.id){O.stopPropagation(),g(C);return}w()},style:{position:"absolute",...t?{}:{pointerEvents:"none"},zIndex:e.opened?Ve.opened:Ve.card-Math.round(e.plane),left:t?0:Math.round(e.x),top:t?0:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",...I},children:[K?(0,pn.jsx)("div",{ref:R,"data-graview-natural":`${Math.round(K.width)}x${Math.round(K.height)}`,style:{position:"absolute",left:"50%",top:"50%",width:K.width,height:K.height,transform:`translate(-50%, -50%) scale(${k})`,transformOrigin:"50% 50%",display:"flex",flexDirection:"column"},children:y}):y,Math.round(e.plane)===0&&!e.aggregate?(0,pn.jsxs)("span",{"data-graview-kindtag":"",className:"graview-kind-tag","aria-hidden":"true",style:{...Z??{},"--graview-hue":Math.round(Sn(e.kind,b?.accents))},children:[(0,pn.jsx)("span",{style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",background:`hsl(${Math.round(Sn(e.kind,b?.accents))} 55% var(--graview-tint-lightness) / 0.9)`}}),Bo(L.schema.tryDefinition(e.kind),e.kind)]}):null]})}var de=ie(Ee(),1);Dr({search:bi,touchWeights:nr});var Hd=e=>e?{activity:e}:{},Bd=e=>`${Math.round(e.x)} ${Math.round(e.y)}`,os=e=>e.stopPropagation(),Sr=.6,Mr=3,Dd=80,is=e=>Math.round(e.plane)===1&&(e.compact===!0||e.width<175||e.height<Dd);function $d(e){let[t,n]=(0,U.useState)(1),o=(0,U.useRef)(1);return(0,U.useEffect)(()=>{e||(o.current=1,n(1))},[e]),[t,o,n]}function Fd(e){let[t,n]=(0,U.useState)({x:0,y:0}),o=(0,U.useMemo)(()=>({x:(e.pan?.x??0)+t.x,y:(e.pan?.y??0)+t.y}),[e.pan,t]),r=(0,U.useMemo)(()=>t.x===0&&t.y===0?e:dt(e,o),[e,t,o]),s=(0,U.useRef)(t);s.current=t;let i=(0,U.useCallback)((d,c)=>{let l=s.current,a=(u,f,h)=>Math.max(Math.min(-u,f),Math.min(Math.max(u,f),h+f))-f;return{x:a(d.x,l.x,c.x),y:a(d.y,l.y,c.y)}},[]);return[o,r,i,s,n]}function Wd(e,t,n,o,r,s){let i=n!==null&&!t.overview,d=i?null:n,c=(0,U.useRef)(t);qr(c.current,t)||(c.current=t);let l=c.current,a=(0,U.useMemo)(()=>{let m=l.pan?{...l,pan:void 0}:l;return d?Pn(m,d.id,{x:d.x,y:d.y}):m},[l,d]),u=(0,U.useRef)(void 0),f=(0,U.useMemo)(()=>{let m=u.current?.stood,g=cr(e.graph,e.schema,a,m?{...o,cityStood:m}:o);return u.current=g.city,g},[e,a,o,r]),h=(0,U.useMemo)(()=>n&&i?so(f,n.id,{x:n.x,y:n.y})??cr(e.graph,e.schema,Pn(a,n.id,{x:n.x,y:n.y}),o):f,[f,n,i,e,a,o]);return[(0,U.useMemo)(()=>lo(h,s??{x:0,y:0}),[h,s]),i]}function jd(e,t){let n=(0,U.useRef)(!1),o=(0,U.useRef)(!1),r=(0,U.useRef)(null),s=(0,U.useRef)(!1),i=(0,U.useCallback)(()=>{Vd(e.current,{dragging:n.current,steering:o.current}),t.set(n.current||o.current||s.current)},[e,t]),d=(0,U.useCallback)(u=>{n.current!==u&&(n.current=u,i())},[i]),c=(0,U.useRef)(()=>!1),l=(0,U.useCallback)(()=>{o.current||(o.current=!0,i()),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,!c.current()&&(o.current=!1,i())},160)},[i]),a=(0,U.useCallback)(()=>{n.current=!1,o.current=!1,i()},[i]);return{dragging:n,steering:o,tweening:s,setDragging:d,steer:l,settleLive:c,settled:a}}function Vd(e,{dragging:t,steering:n}){e&&(t||n?e.setAttribute("data-graview-hand",t?"drag":"wheel"):e.removeAttribute("data-graview-hand"),e.style.cursor=t?"grabbing":"grab",e.style.userSelect=t?"none":"")}function Gd(e){let t=(0,U.useRef)(!1),n=e!==null&&!t.current;return(0,U.useEffect)(()=>{e!==null&&(t.current=!0)},[e]),n}function zd({registerScene:e,scheme:t,views:n},o,r){let s=(0,U.useRef)(o);s.current=o,(0,U.useEffect)(()=>(e({whereIs:i=>pr(s.current,r.current,t,n,i)}),()=>e(null)),[e,t,n])}function Yd(e,t){(0,U.useEffect)(()=>{let n;return e.onActive(o=>{let r=t.current;if(!r)return;let s=c=>{let l=r.getBoundingClientRect();e.set({x:c.clientX-l.left,y:c.clientY-l.top})},i=c=>{c.buttons===0&&s(c)},d=()=>e.set(null);o?(r.addEventListener("pointermove",i),r.addEventListener("pointerup",s),r.addEventListener("pointerleave",d),n=()=>{r.removeEventListener("pointermove",i),r.removeEventListener("pointerup",s),r.removeEventListener("pointerleave",d)}):(n?.(),n=void 0)})},[e])}function _d(e,t,n,o,r,s,i,d){(0,U.useEffect)(()=>{let c=t.current;if(!c||!e)return;let l=new Set;for(let u of n.nodes)(o.has(u.id)||u.aggregate?.memberIds.some(f=>o.has(f)))&&l.add(u.id);let a=e({canvas:c,layout:n,dirty:l,hostOf:u=>(c.parentElement??c).querySelector(`[data-graview-view="${CSS.escape(u)}"]`),drawOnDom:r,blur:s,scheme:i,fallBack:d});return()=>{a?.()}},[e,n,o,r,s,i,d])}var Kd=en(()=>(__graviewPreload(import.meta.url,["./chunk.OJGHDWI6.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JS2UZYGB.js")));function Ud(e,t){let[n]=(0,U.useState)(()=>{let a=ti();return t?e==="dom"||e==="auto"&&a==="dom"?"dom":"gpu":ri(e,{operator:a,present:ni()})}),[o,r]=(0,U.useState)(!1),s=(0,U.useCallback)(()=>r(!0),[]),[i,d]=(0,U.useState)(null),c=n==="gpu"&&!t&&!o&&i===null;return(0,U.useEffect)(()=>{if(!c)return;let a=!0;return Kd().then(u=>{a&&d(()=>u.attachGpu())},()=>{a&&r(!0)}),()=>{a=!1}},[c]),{attach:(n==="gpu"&&!o?t??i:null)??null,fallBack:s}}function Xd(){let[e,t]=(0,U.useState)(()=>new Set),n=(0,U.useCallback)(o=>{t(r=>r.size===o.size&&[...o].every(s=>r.has(s))?r:new Set(o))},[]);return[e,n]}function qd(){let e=li();return t=>{let n=t?e.get(t.id):void 0,o=t?.aggregate?.memberIds??[];if(!n&&o.length===0)return;let r=n,s=n?.wrote??!1,i=n?.read??!1,d=n?.broke??!1;for(let c of o){let l=e.get(c);l&&(s||=l.wrote,i||=l.read,d||=l.broke,(!r||l.at>r.at||l.at===r.at&&l.wrote&&!r.wrote)&&(r=l))}return r?{...r,wrote:s,read:i,broke:d}:void 0}}var as=(e,t)=>e.includes(t)?e.filter(n=>n!==t):[...e,t];function Qd(){let{views:e,view:t,setView:n,setSelection:o}=we(),r=jt(),s=(0,U.useContext)(tn),i=d=>{if(Ie(d.id)===null&&!d.aggregate)return!1;let c=e.resolve(d.kind,{cardinality:"many",fidelity:"full"})?.view;return c!==void 0&&c.generic!==!0};return d=>({onSelect:c=>{if(Rn(d.id)){o(a=>c?as(a,d.id):[d.id]);return}let l=d.aggregate?En(d.id):[];if(t.overview){o(a=>c?[...new Set([...a,d.id])]:[d.id]);return}if(l.length===1&&!c&&Math.round(d.plane)!==0){let a=l[0];n(u=>Cr(u,u.relation===a?null:a));return}o(a=>bo(d,a,c))},onPick:(c,l,a)=>o(u=>a?l?[...new Set([...u,...a])]:[...a]:l?as(u,c):[c]),onTravel:c=>{n(l=>({...Mt(l,c),relation:null})),o([c])},onJackIn:()=>{let c=d.aggregate?.opens;if(c){c.in==="place"?n(u=>Ir(u,d.id)):n(u=>Object.entries(c.within).reduce((f,[h,x])=>Zn(f,h,x),Mt(Mn(u,!1),c.focus))),o([]);return}let l=Ie(d.id),a=l!==null&&(r?.byKind[l]??0)>0;if(s&&l!==null&&t.overview&&!i(d)&&!(a&&t.q)){n(u=>Zn({...Mt(u,`aggregate:${l}`),relation:null},"view",null)),o([]);return}n(u=>Nr(u,d.id,{ownPicture:i(d),...a&&u.q?{carry:u.q}:{}})),o(d.aggregate?[]:[d.id])}})}var Zd=On(en(()=>(__graviewPreload(import.meta.url,["./chunk.HJCQ6I3S.js","./chunk.DQAMVVE6.js","./chunk.WPQP54FM.js","./chunk.OXFDB5BB.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.3RUV4HE4.js")))),Jd=Zd.part((e,t)=>(0,de.jsx)(e.Ribbons,{...t}),{what:"The relations",quiet:!0}),ss="graview:map-from-above";function el(){let[e,t]=(0,U.useState)(()=>{try{return globalThis.localStorage?.getItem(ss)==="1"}catch{return!1}}),n=(0,U.useCallback)(o=>{t(o);try{globalThis.localStorage?.setItem(ss,o?"1":"0")}catch{}},[]);return[e,n]}var ds=On(en(()=>(__graviewPreload(import.meta.url,["./chunk.WPQP54FM.js","./chunk.OXFDB5BB.js","./chunk.F6BNFLQM.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.77MLXWZV.js")))),tl=ds.part((e,t)=>(0,de.jsx)(e.Plots,{...t}),{quiet:!0}),nl=ds.part((e,t)=>(0,de.jsx)(e.WorkflowsLayer,{...t}),{quiet:!0});function rl({zoom:e,zoomBy:t,above:n,setAbove:o}){let r=(s,i,d,c)=>(0,de.jsx)("button",{type:"button",className:"graview-zoom-button","data-testid":`zoom-${s}`,"aria-label":`Zoom ${s}`,title:`Zoom ${s} \u2014 or pinch, or ctrl+wheel`,disabled:c,onClick:()=>t(d),children:i});return(0,de.jsxs)("div",{className:"graview-zoom","data-graview-foot":"",role:"group","aria-label":"Zoom",onPointerDown:os,onClick:os,children:[r("out","\u2212",1/1.25,e<=Sr+1e-6),(0,de.jsxs)("span",{className:"graview-zoom-level","data-testid":"zoom-level","aria-live":"polite",children:[Math.round(e*100),"%"]}),r("in","+",1.25,e>=Mr-1e-6),(0,de.jsx)("button",{type:"button",className:"graview-zoom-button graview-zoom-above","data-testid":"from-above","aria-pressed":n,title:n?"See the city at an angle again":"See the city from straight above",onClick:()=>o(!n),children:"From above"})]})}function ol({options:e,renderer:t="auto",attachRenderer:n,blur:o=!0,className:r,style:s,animate:i=!0,children:d}){let c=we(),l=c.app?c.app.workflows??jo(c.app)?.workflows:void 0,{store:a,scheme:u,views:f,view:h,setView:x,selection:m,setSelection:g,setMenuAt:S,emphasis:M,brand:w,noteMoved:v,robots:T,motion:E}=c,N=(0,U.useContext)(tn),F=(0,U.useRef)(null),y=(0,U.useRef)(null),b=Oa(y),L=Aa(b),P=Ra(),{zoomAbout:V,panBy:Z,pinchBy:ne,pinchDone:D,pinching:$}=ca({stage:y,view:h,setView:x}),B=Vt(),Q=1,[A,W,K]=$d(h.overview),[k,R]=el(),I=(0,U.useMemo)(()=>k?{...e,tilt:ki}:e,[e,k]),{probe:O,dock:C}=aa(),j=!h.overview&&(h.zoom||h.past||h.relation)?Math.ceil(14+34*P/16+6):0,G=b&&L?b.height-L.height:0,J=(0,U.useRef)(C);G<=0&&(J.current=C);let _=G>0?J.current:C,oe=es(I,L,P,Q*A,_,B,j,h.overview?0:_.bottom),re=Ji(y),[Y,me,le,ve,He]=Fd(h),De=(0,U.useMemo)(()=>new Set(Object.keys(h.pins).filter(H=>Ie(H)===null)),[h.pins]),Pe=sa(),[q,Te]=Wd(a,h,Pe.held,oe,B,me.pan),$e=jd(y,E),{setDragging:Tt,steer:Ct,settleLive:et,settled:Fe}=$e,It=$e.dragging.current||$e.steering.current,tt=Gd(L),wt=(0,U.useRef)(()=>{}),Oe=da({stage:y,pan:h.pan,zoom:A,setView:x,settled:Fe,zoomTo:wt}),We=(0,U.useRef)(!1);Oe.settling.current||(We.current=!1);let Ye=Oe.settling.current&&!We.current,ee=Yi(q,{enabled:i&&!It&&L!==null&&!tt,settle:!Ye});$e.tweening.current=ee.t<1;let Nt=ea(y,ee.t>=1,q);(0,U.useEffect)(()=>E.set($e.dragging.current||$e.steering.current||ee.t<1),[E,ee]);let qe=_i(),xt=Ki(),yn=na({view:h,result:q,frame:ee,panned:Y,closer:Q,screenId:null,setCamera:He});zd(c,ee,y),Yd(c.pointer,y);let[it,ce]=Xd(),{attach:ke,fallBack:ht}=Ud(t,n),at=Gi(o);_d(ke,F,ee,qe,ce,at,u,ht);let Ae=ke===null,Ht=zi(at&&Ae,ee.t<1),qt=qd();et.current=Oe.settle;let{onGroundDown:jn,onCardDown:Vn,onDragMove:mt,onDragUp:gn,onDragCancel:wn,swallow:bt}=la({view:h,panned:Y,limit:()=>Ot(q),panWithin:le,moveByTransform:!0,setView:x,setDragging:Tt,noteMoved:v,shift:Oe,district:Pe,pinching:$}),vt=ji({swallow:bt,setMenuAt:S,setSelection:g});ma(y,bt),V.current=(H,fe,ye)=>{if(!h.overview)return;et.current();let ge=W.current,Ce=Math.max(Sr,Math.min(Mr,ge*H));if(Math.abs(Ce-ge)<1e-4)return;W.current=Ce,We.current=!0,Ct(),K(Ce);let je=y.current?.getBoundingClientRect(),Ze=q.visible??q,Qt={x:Ze.width/2,y:Ze.height/2},_n=je&&fe!==void 0&&ye!==void 0?{x:fe-je.left,y:ye-je.top}:Qt,Dt=Ce/ge;x(p=>dt(p,lr(p.pan??{x:0,y:0},ve.current,_n,Qt,Dt))),v()},ne.current=(H,fe,ye,ge,Ce)=>{if(!h.overview)return;Ct();let je=y.current?.getBoundingClientRect(),Ze=je?{x:fe-je.left,y:ye-je.top}:{x:0,y:0};Oe.zoomBy(H,Ze,ge,Ce,Sr/W.current,Mr/W.current),v()},D.current=()=>{et.current()},wt.current=(H,fe)=>{let ye=W.current,ge=Math.max(Sr,Math.min(Mr,ye*H));W.current=ge,We.current=!0,K(ge);let Ce=q.visible??q,je={x:Ce.width/2,y:Ce.height/2};x(Ze=>dt(Ze,lr(Ze.pan??{x:0,y:0},ve.current,fe,je,ge/ye)))};let xn=(H,fe,ye=Ot(q))=>x(ge=>dt(ge,le(ye,{x:(ge.pan?.x??0)+H,y:(ge.pan?.y??0)+fe})));oa(y,C,(H,fe)=>xn(H,fe)),Z.current=(H,fe)=>{Ct();let ye=Ot(q),ge=h.pan??{x:0,y:0},Ce=Oe.offset();Oe.shiftTo(le(ye,{x:ge.x+Ce.x+H,y:ge.y+Ce.y+fe}),ge),v()};let bn=Qd(),vn=zt(),Er=(0,U.useCallback)(H=>sn(vn,H).connector.visible,[vn]),kt=H=>qt(ee.nodes.find(fe=>fe.id===H)),st=(H,fe,ye,ge)=>H.originY+Y.y+dn(ye.col+ye.side/ge,ye.row+ye.side/ge,H.cell,H.tilt).y-fe.y,Qe={width:q.width,height:q.height},Gn={position:"relative",zIndex:Ve.stage,...Qe},_e=H=>pr(ee,y.current,u,f,H),zn=H=>Ae||it.has(H),Yn=or(c),Bt=H=>(0,de.jsx)(Jn.Provider,{value:Yn,children:H}),kn=ee.nodes.filter(H=>H.screenOf===void 0).map(H=>(0,de.jsx)(rs,{node:H,crowded:is(H),useDom:zn(H.id),blur:Ht||!Ae&&at,...H.plot&&ee.city&&Math.round(H.plane)===2?{frontY:st(ee.city,H,H.plot,1),centerY:st(ee.city,H,H.plot,2)}:{},touched:qe.has(H.id),...Hd(qt(H)),scheme:u,canvasWidth:q.width,canvasHeight:q.height,selected:m.includes(H.id),...bn(H),onMenu:S,selection:m,onDragStart:fe=>Vn(H,fe),onDragMove:mt,onDragEnd:gn,onDragCancel:wn,swallowClick:bt,children:H.beyond?(0,de.jsx)(va,{kinds:H.beyond}):H.aggregate?.opens?(0,de.jsx)(Ea,{node:H}):(0,de.jsx)(Sa,{node:H,mode:"scene",selected:m.includes(H.id),...is(H)?{fidelity:"glyph"}:{}})},H.id));return(0,de.jsxs)("div",{ref:y,className:`graview-ground${r?` ${r}`:""}`,"data-graview-altitude":h.overview?"":void 0,"data-graview-reach":ee.city?Bd(Ot(q)):void 0,"data-graview-settled":ee.t>=1&&!yn.gliding()?"":void 0,"data-graview-box":L?`${L.width}x${L.height}`:void 0,"data-graview-renderer":Ae?"dom":"gpu","data-graview-blur":(Ae?Ht:at)?"":void 0,onPointerDown:H=>{vt.onPointerDown(H),jn(H)},onPointerMove:H=>{vt.onPointerMove(H),mt(H)},onPointerUp:()=>{vt.onPointerUp(),gn()},onPointerCancel:()=>{vt.onPointerUp(),wn()},onContextMenu:vt.onContextMenu,onClick:H=>{bt.current||H.target.closest("[data-graview-view], button, aside, section[aria-label], [data-graview-offstage], a, input, select")||(g([]),S(null))},style:{position:"relative",width:"100%",height:"100%",cursor:"grab",touchAction:"none",overscrollBehavior:"contain","--graview-altitude":h.overview?1:0,...ee.city?{"--graview-lattice-cell":`${ee.city.cell.toFixed(2)}px`,"--graview-lattice-tilt":(ee.city.tilt??.5).toFixed(3),"--graview-lattice-x":`${(ee.city.originX+ee.city.pan.x).toFixed(1)}px`,"--graview-lattice-y":`${(ee.city.originY+ee.city.pan.y).toFixed(1)}px`}:{},overflow:"hidden",...s},children:[(0,de.jsx)("div",{className:"graview-measure","aria-hidden":"true",style:{"--graview-world-x":`${(ee.pan?.x??0).toFixed(1)}px`,"--graview-world-y":`${(ee.pan?.y??0).toFixed(1)}px`}}),h.overview&&ee.city?(0,de.jsx)(U.Suspense,{fallback:null,children:(0,de.jsx)(Jd,{frame:ee,...Qe,pan:ee.city.pan,store:a,graphVersion:B,selection:m,view:{overview:h.overview,focusId:h.focusId,beside:N},emphasis:M,hiddenKinds:c.hiddenKinds,drawn:Er})}):null,(0,de.jsx)("div",{ref:O,"aria-hidden":"true",style:{position:"absolute",top:0,right:0,width:"var(--graview-dock, 0px)",height:"var(--graview-sheet, 0px)",visibility:"hidden",pointerEvents:"none"}}),ee.city?(0,de.jsx)(U.Suspense,{fallback:null,children:(0,de.jsx)(tl,{frame:ee,...Qe,pan:ee.city?ee.city.pan:Y,brand:w,pinned:De,close:Q*A>1.2,swallowed:bt,...h.overview?{chosen:Tn(m,{overview:h.overview,focusId:h.focusId,beside:N},H=>a.graph.getNode(H)?.kind).records}:{},onFocus:H=>{let fe=Ie(H);fe!==null&&x(ye=>Mt(ye,Ne(fe)))}})}):null,h.overview&&ee.city&&l?(0,de.jsx)(U.Suspense,{fallback:null,children:(0,de.jsx)(nl,{frame:ee,...Qe,pan:ee.city.pan,app:c.app,workflows:l,acts:a.allMutations(),runs:c.workflowRuns,graphVersion:B,hiddenKinds:c.hiddenKinds})}):null,Ae?(0,de.jsx)("div",{"data-graview-stage":"dom","data-graview-world":"",style:{...Gn,overflow:"hidden"},children:Bt(kn)}):(0,de.jsxs)("div",{"data-graview-world":"",style:Gn,children:[(0,de.jsx)("div",{"data-graview-stage":"dom","data-graview-under-canvas":"",style:{position:"absolute",left:0,top:0,...Qe,overflow:"hidden"},children:Bt(kn.filter(H=>it.has(String(H.key))))}),(0,de.jsx)("canvas",{ref:F,"data-graview-stage":"gpu",content:"drawable",layoutsubtree:"",...Qe,style:{display:"block",position:"relative",...Qe},children:Bt(kn.filter(H=>!it.has(String(H.key))))})]}),h.overview?(0,de.jsx)(Qi,{result:q,schema:a.schema,chrome:[...oe.chrome??[],...re?[re]:[],...ta(Nt,q.nodes)],onGo:H=>{xn(H.x,H.y),v()}}):null,h.overview?(0,de.jsx)(rl,{zoom:A,zoomBy:H=>V.current(H),above:k,setAbove:R}):null,(0,de.jsx)(Qa,{frame:ee,focusId:h.focusId,beside:N,holding:Te,...Qe,scheme:u,overview:!!h.overview,selection:m,emphasis:M,stageRef:y,store:a,graphNodes:B,...(H=>H?{provisional:H}:{})(qa(a)),onPickEdge:(H,fe)=>{bt.current||(g([H]),S(fe?{...fe,on:H}:null))},liveOf:H=>{let fe=kt(H.from),ye=kt(H.to);return fe?.wrote&&ye?.wrote?fe.at>ye.at?fe:ye:void 0}}),(0,de.jsx)(Xi,{width:q.width,whereIs:_e}),(0,de.jsx)(Ui,{marks:xt.marks,questions:[...T.values()].filter(H=>H.mode==="asking"&&H.at!==null&&H.say).map(H=>({id:H.at,who:H.who,asks:H.say})),whereIs:_e,stageRef:y,...Qe}),(0,de.jsx)(Za,{nodes:ee.nodes,moving:ee.t<1,holding:Te,scheme:u,width:q.width,stageRef:y}),d,(0,de.jsx)("div",{className:"graview-lattice","aria-hidden":"true"})]})}var ot=ie(Re(),1);function il(){return fs(),null}var us=()=>window.location.pathname.endsWith($o),ls=()=>(us()?Vo:Tr)(window.location.hash),al=e=>(us()?Go:Pr)(e);function fs(){let{view:e,setView:t,views:n,principal:o}=we(),r=JSON.stringify(o),s=(0,ot.useCallback)(a=>{let u=a.within?.view;if(u===void 0||a.focusId)return a;let f=n.places().find(h=>h.as===u);return f?{...a,focusId:Ne(f.kind)}:a},[n]),i=(0,ot.useRef)(!1);(0,ot.useEffect)(()=>{if(typeof window>"u")return;let a=s(ls());!Qn(a,Lr)&&!Qn(a,e)&&(i.current=!0,t(a))},[]),(0,ot.useEffect)(()=>{if(typeof window>"u")return;let a=()=>t(s(ls()));return window.addEventListener("popstate",a),window.addEventListener("hashchange",a),()=>{window.removeEventListener("popstate",a),window.removeEventListener("hashchange",a)}},[t,s]);let d=(0,ot.useRef)(!1),c=(0,ot.useRef)(null),l=(0,ot.useRef)(r);(0,ot.useEffect)(()=>{if(typeof window>"u")return;if(i.current){i.current=!1;return}let a=l.current!==r;l.current=r;let u=al(e),f=u||`${window.location.pathname}${window.location.search}`;if((window.location.hash||(window.location.href.includes("#")?"#":""))===u){d.current=!0,c.current=e;return}if(!d.current){d.current=!0,c.current=e,window.history.replaceState({graview:Gt.at},"",f);return}if(a||hs(c.current,e)){window.history.replaceState({graview:Gt.at},"",f),c.current=e;return}c.current=e,window.history.pushState({graview:++Gt.at},"",f),Gt.depth=Gt.at,Gt.tell()},[e,r])}function hs(e,t){return e?e.focusId===t.focusId&&e.relation===t.relation&&(e.overview??!1)===(t.overview??!1)&&(e.zoom??!1)===(t.zoom??!1)&&(e.past??!1)===(t.past??!1)&&e.expanded.join(",")===t.expanded.join(",")&&(e.shown??[]).join(",")===(t.shown??[]).join(",")&&sl(e.within,t.within):!1}function sl(e,t){let n=o=>Object.entries(o??{}).sort(([r],[s])=>r.localeCompare(s)).map(([r,s])=>`${r}=${s}`).join("&");return n(cs(e))===n(cs(t))}function cs(e){if(!e||!("q"in e))return e;let{q:t,...n}=e;return n}var No=ie(Re(),1);var ms=new WeakMap,dl=64,ps=new WeakMap,ll=0,cl=e=>{if(e===void 0)return 0;let t=ps.get(e);return t===void 0&&ps.set(e,t=ll+=1),t};function ys(e,t,n,o={}){let r=()=>{let l=[...new Set(t.flatMap(u=>En(u)))],a=t.map(u=>Ft(u)).filter(u=>u!==null);return pi(e,t,{...n.principal?{principal:n.principal}:{},kindSelection:l,edgeSelection:a,...n.providers?{providers:n.providers}:{},...n.pins?{pins:n.pins}:{},...n.focus!==void 0?{focus:n.focus}:{},...o})};if(Object.keys(o).length>0)return r();let s=ms.get(e);if(!s){let l={kept:new Map,at:e.log.length};ms.set(e,s=l),e.subscribe(()=>l.kept.clear())}s.at!==e.log.length&&(s.kept.clear(),s.at=e.log.length);let i=JSON.stringify([t,n.principal??null,cl(n.providers),n.pins??null,n.focus??null]),d=s.kept.get(i);if(d)return d;let c=r();return s.kept.set(i,c),s.kept.size>dl&&s.kept.delete(s.kept.keys().next().value),c}function ul(e,t,n={}){return ys(e,t,n)}function fl(e={}){let{store:t,selection:n,principal:o,providers:r}=we(),{about:s,principal:i=o,providers:d=r,pins:c,focus:l,...a}=e,u=s??n,f=Vt();return(0,No.useMemo)(()=>ys(t,u,{principal:i,providers:d,pins:c,focus:l},a),[t,u,e,f,i,d])}function hl(){let{store:e,principal:t}=we();return(0,No.useMemo)(()=>({preview:(n,o)=>gi(e,n,o??{},{pressed:t?{author:t}:{}}),apply:(n,o)=>yi(e,n,o??{},{author:t})}),[e,t])}export{Cs as a,Is as b,Ns as c,Hs as d,Bs as e,Ds as f,ks as g,ol as h,il as i,ul as j,fl as k,hl as l};