graview 0.1.70 → 0.1.72

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 (235) hide show
  1. package/dist/preview/chunk.2IOJNFCR.js +1 -0
  2. package/dist/preview/{chunk.I7CSRZC2.js → chunk.2Q4ZXP7P.js} +1 -1
  3. package/dist/preview/{chunk.O2XPLDMM.js → chunk.2TTKQAWQ.js} +1 -1
  4. package/dist/preview/chunk.2YSE3SQN.js +23 -0
  5. package/dist/preview/{chunk.NZFO6BM3.js → chunk.2ZPR6FRI.js} +1 -1
  6. package/dist/preview/chunk.3BE4SHZD.js +1 -0
  7. package/dist/preview/{chunk.QODVFVWE.js → chunk.43HWCHBN.js} +1 -1
  8. package/dist/preview/{chunk.QILGAV7H.js → chunk.45OLF6BK.js} +1 -1
  9. package/dist/preview/{chunk.NTAC5NNE.js → chunk.47QWCVZD.js} +1 -1
  10. package/dist/preview/{chunk.7HNMG6LG.js → chunk.4A7BRBEA.js} +1 -1
  11. package/dist/preview/chunk.4EPCI6VY.js +1 -0
  12. package/dist/preview/{chunk.OXXZGPJZ.js → chunk.4PB5UFUJ.js} +1 -1
  13. package/dist/preview/{chunk.SWY6DIE4.js → chunk.4TDYDIIM.js} +3 -3
  14. package/dist/preview/{chunk.6VG2LCES.js → chunk.4VX7GPFS.js} +1 -1
  15. package/dist/preview/{chunk.TUVPQLFL.js → chunk.523X2YEQ.js} +1 -1
  16. package/dist/preview/{chunk.CHG522KL.js → chunk.53GQQETN.js} +1 -1
  17. package/dist/preview/{chunk.NBB5ALVJ.js → chunk.5MKZTHU2.js} +1 -1
  18. package/dist/preview/chunk.5OS4SYHE.js +1 -0
  19. package/dist/preview/{chunk.ZTHZHBVN.js → chunk.5ZT4R227.js} +1 -1
  20. package/dist/preview/{chunk.RIP2SAQ5.js → chunk.65SI77M7.js} +1 -1
  21. package/dist/preview/chunk.6ESAFTWB.js +1 -0
  22. package/dist/preview/chunk.6GUIFP2A.js +1 -0
  23. package/dist/preview/{chunk.M3HLZX6Q.js → chunk.6GZYKHEN.js} +1 -1
  24. package/dist/preview/{chunk.UVMHC6VM.js → chunk.6YKKZI4H.js} +1 -1
  25. package/dist/preview/{chunk.BBLA4PSP.js → chunk.73RMM4W7.js} +1 -1
  26. package/dist/preview/chunk.7DCBIMOI.js +1 -0
  27. package/dist/preview/chunk.7JE3J7H4.js +1 -0
  28. package/dist/preview/{chunk.YTRUZ56A.js → chunk.7QGDWAHH.js} +1 -1
  29. package/dist/preview/{chunk.JEQ6CA5M.js → chunk.7VCYVCYM.js} +2 -2
  30. package/dist/preview/{chunk.X7HMTN3Z.js → chunk.A4TBVXHQ.js} +1 -1
  31. package/dist/preview/{chunk.J4NY2K2A.js → chunk.A6LJPXJ3.js} +1 -1
  32. package/dist/preview/chunk.AAPXF6NP.js +1 -0
  33. package/dist/preview/chunk.APUICV5Z.js +1 -0
  34. package/dist/preview/chunk.ASNVH2G4.js +25 -0
  35. package/dist/preview/{chunk.CM7EDQ4E.js → chunk.CJHCUHVN.js} +1 -1
  36. package/dist/preview/chunk.CUEPNS3Z.js +1 -0
  37. package/dist/preview/{chunk.U3CV227I.js → chunk.CUJRWBPX.js} +1 -1
  38. package/dist/preview/{chunk.7TZXDPPO.js → chunk.D5PW6YWF.js} +3 -3
  39. package/dist/preview/chunk.DCIYOZYP.js +1 -0
  40. package/dist/preview/chunk.DEBW4FH6.js +1 -0
  41. package/dist/preview/{chunk.MR776WQ2.js → chunk.DYPSFTRP.js} +1 -1
  42. package/dist/preview/{chunk.BBMX3IIO.js → chunk.E6QZUT4L.js} +1 -1
  43. package/dist/preview/chunk.E7QZZRAQ.js +17 -0
  44. package/dist/preview/chunk.EHCMBAZO.js +3 -0
  45. package/dist/preview/chunk.EXTD5JWD.js +1 -0
  46. package/dist/preview/{chunk.KOVTQCHX.js → chunk.EZF2T3XQ.js} +1 -1
  47. package/dist/preview/chunk.EZSST3IU.js +1 -0
  48. package/dist/preview/{chunk.DIVANC3G.js → chunk.F2BZ4SC4.js} +1 -1
  49. package/dist/preview/chunk.F2I7ERGM.js +1 -0
  50. package/dist/preview/{chunk.UWEFODVV.js → chunk.FCV3NX6L.js} +1 -1
  51. package/dist/preview/{chunk.NZ5TJKPT.js → chunk.FFTBUXKX.js} +2 -2
  52. package/dist/preview/chunk.FILBI7XA.js +1 -0
  53. package/dist/preview/{chunk.MGG5DH2S.js → chunk.FKSI5522.js} +1 -1
  54. package/dist/preview/{chunk.I3ADXJQW.js → chunk.FQ2QUDZS.js} +1 -1
  55. package/dist/preview/{chunk.A5ENJJZN.js → chunk.G2ZDDO3C.js} +1 -1
  56. package/dist/preview/{chunk.IPKODEOZ.js → chunk.GAVEWSXU.js} +1 -1
  57. package/dist/preview/chunk.GH6QX7JR.js +87 -0
  58. package/dist/preview/chunk.GMHBAS45.js +1 -0
  59. package/dist/preview/{chunk.YCMMATFK.js → chunk.GOVRX2YX.js} +1 -1
  60. package/dist/preview/chunk.GXK5PI7I.js +1 -0
  61. package/dist/preview/{chunk.RECTEAG4.js → chunk.GYP3EF6Z.js} +1 -1
  62. package/dist/preview/chunk.H2RVMT4Y.js +111 -0
  63. package/dist/preview/chunk.HCHGKI64.js +1 -0
  64. package/dist/preview/chunk.HE7SAJKZ.js +1 -0
  65. package/dist/preview/{chunk.WAIIXXVI.js → chunk.HIIYDKFC.js} +2 -2
  66. package/dist/preview/chunk.HPDUGKEF.js +32 -0
  67. package/dist/preview/{chunk.DGDOZHYK.js → chunk.HQRPOGTS.js} +1 -1
  68. package/dist/preview/chunk.HUJLELZ3.js +1 -0
  69. package/dist/preview/chunk.HVRUHRXR.js +1 -0
  70. package/dist/preview/{chunk.6KYTCEIH.js → chunk.I46VNAMS.js} +1 -1
  71. package/dist/preview/{chunk.QAERSZVB.js → chunk.ID4GOKT6.js} +1 -1
  72. package/dist/preview/{chunk.RJ7UV3XI.js → chunk.IZKCTF2R.js} +1 -1
  73. package/dist/preview/chunk.IZUAZ6EV.js +1 -0
  74. package/dist/preview/{chunk.ZIGW5VOT.js → chunk.J3CUBMUZ.js} +1 -1
  75. package/dist/preview/{chunk.3HFBHLXC.js → chunk.J4D4BIB4.js} +1 -1
  76. package/dist/preview/{chunk.IRPMGHZN.js → chunk.J7GH2CGV.js} +1 -1
  77. package/dist/preview/{chunk.SSHEFQ4R.js → chunk.JE4RBRKH.js} +1 -1
  78. package/dist/preview/{chunk.4BSEYZMS.js → chunk.JJSZLCNU.js} +1 -1
  79. package/dist/preview/{chunk.KV3N6VRG.js → chunk.JKX4J3KG.js} +1 -1
  80. package/dist/preview/{chunk.FUTSLXWN.js → chunk.JMXBMLKH.js} +1 -1
  81. package/dist/preview/chunk.JOB3EKS6.js +1 -0
  82. package/dist/preview/{chunk.5IM2X3VT.js → chunk.JP33TNCH.js} +1 -1
  83. package/dist/preview/{chunk.BZXJKWNI.js → chunk.K6EN2YR4.js} +1 -1
  84. package/dist/preview/chunk.K6YKXTKC.js +1 -0
  85. package/dist/preview/{chunk.A7JORJJL.js → chunk.KAIZDIRK.js} +1 -1
  86. package/dist/preview/{chunk.7LAXSQQY.js → chunk.KAQGSLC6.js} +3 -3
  87. package/dist/preview/{chunk.QG3LV4RH.js → chunk.KFYSKZC4.js} +1 -1
  88. package/dist/preview/{chunk.VBHV4TLG.js → chunk.KHRS2SKB.js} +1 -1
  89. package/dist/preview/chunk.KHVW6Q3T.js +1 -0
  90. package/dist/preview/chunk.KMFH26SS.js +1 -0
  91. package/dist/preview/{chunk.2T24FYAO.js → chunk.L3ST2YKI.js} +1 -1
  92. package/dist/preview/{chunk.HIJ72QX6.js → chunk.L6BLZJ6K.js} +1 -1
  93. package/dist/preview/{chunk.NCBUECIW.js → chunk.LG2BQ5LB.js} +1 -1
  94. package/dist/preview/{chunk.LZ3HO3HM.js → chunk.LLYHHG67.js} +1 -1
  95. package/dist/preview/{chunk.VKQONZKR.js → chunk.LPWANRBL.js} +1 -1
  96. package/dist/preview/{chunk.3MPLUSVY.js → chunk.LSS64NAA.js} +1 -1
  97. package/dist/preview/{chunk.SUYYDJGZ.js → chunk.MFNWHXGL.js} +1 -1
  98. package/dist/preview/{chunk.UJF6YTEO.js → chunk.MNH3WUAB.js} +1 -1
  99. package/dist/preview/chunk.MQ7AB5N4.js +1 -0
  100. package/dist/preview/{chunk.CZUUFO6A.js → chunk.MU5JK5TK.js} +1 -1
  101. package/dist/preview/{chunk.RXUL6P7Y.js → chunk.N5CACZ5F.js} +1 -1
  102. package/dist/preview/{chunk.S6IKR6RD.js → chunk.NFC2TYA6.js} +1 -1
  103. package/dist/preview/{chunk.TD2V74XU.js → chunk.NKRDVOLJ.js} +1 -1
  104. package/dist/preview/{chunk.SGYZM6ZU.js → chunk.NNK2E2EP.js} +1 -1
  105. package/dist/preview/{chunk.J65CZJIC.js → chunk.NVPKYWMF.js} +1 -1
  106. package/dist/preview/{chunk.DWMFLLJO.js → chunk.NWJ7ELHN.js} +1 -1
  107. package/dist/preview/{chunk.NKUNCQB3.js → chunk.O5P6LXHF.js} +1 -1
  108. package/dist/preview/{chunk.2MWEYNVH.js → chunk.OFK6673S.js} +1 -1
  109. package/dist/preview/{chunk.C4LC2UEU.js → chunk.OG6FEP3K.js} +1 -1
  110. package/dist/preview/{chunk.CZI6J5CE.js → chunk.OHGAZ3D5.js} +1 -1
  111. package/dist/preview/{chunk.XJ4JYROM.js → chunk.ONVYKLRX.js} +1 -1
  112. package/dist/preview/chunk.OQ3FKUP2.js +1 -0
  113. package/dist/preview/chunk.OUJV4CYS.js +1 -0
  114. package/dist/preview/{chunk.T552MHMU.js → chunk.OWHH7JDV.js} +1 -1
  115. package/dist/preview/{chunk.SCN6IYDG.js → chunk.OXDCGGZV.js} +1 -1
  116. package/dist/preview/{chunk.YIDNZTON.js → chunk.P3Z4ZCL3.js} +1 -1
  117. package/dist/preview/chunk.PF7XQ5R5.js +1 -0
  118. package/dist/preview/{chunk.FSZQTX3K.js → chunk.PGT4ZQDG.js} +4 -4
  119. package/dist/preview/chunk.PH547SON.js +1 -0
  120. package/dist/preview/chunk.PS765ODQ.js +3 -0
  121. package/dist/preview/{chunk.MZSWWMX6.js → chunk.PVAYYFT2.js} +1 -1
  122. package/dist/preview/{chunk.F5STM4DX.js → chunk.Q6WOIE5I.js} +1 -1
  123. package/dist/preview/{chunk.55C7WO4X.js → chunk.QE257AXE.js} +1 -1
  124. package/dist/preview/chunk.QKNC5OUC.js +1 -0
  125. package/dist/preview/chunk.QMGBAKX6.js +2 -0
  126. package/dist/preview/{chunk.4QBW46XV.js → chunk.QNFX5VHW.js} +1 -1
  127. package/dist/preview/chunk.QPCDAQTW.js +1 -0
  128. package/dist/preview/{chunk.TS5APXWC.js → chunk.QPTQIGLX.js} +1 -1
  129. package/dist/preview/{chunk.LZNHTROY.js → chunk.R5YGW5ZX.js} +1 -1
  130. package/dist/preview/{chunk.4VTUC5TF.js → chunk.RJ6KEVZC.js} +1 -1
  131. package/dist/preview/{chunk.6QMRDSTD.js → chunk.RKVMRP7B.js} +1 -1
  132. package/dist/preview/{chunk.YBQUP3KE.js → chunk.S7U2CHHG.js} +1 -1
  133. package/dist/preview/{chunk.CLJKQLK2.js → chunk.SD2UYSV6.js} +2 -2
  134. package/dist/preview/chunk.SI5GGFQR.js +1 -0
  135. package/dist/preview/{chunk.7QWGIGHM.js → chunk.SMF5S4DQ.js} +1 -1
  136. package/dist/preview/{chunk.LEZGBHPZ.js → chunk.SNDFIJVX.js} +1 -1
  137. package/dist/preview/{chunk.F5756PXX.js → chunk.STHWM422.js} +2 -2
  138. package/dist/preview/{chunk.JIEBGUCA.js → chunk.SV75TRCH.js} +1 -1
  139. package/dist/preview/{chunk.U2DZE7A5.js → chunk.SXGPRFA4.js} +1 -1
  140. package/dist/preview/{chunk.ZGJUCVT5.js → chunk.T3RFZ66S.js} +1 -1
  141. package/dist/preview/{chunk.I6HIVTXU.js → chunk.T6ISUVUP.js} +1 -1
  142. package/dist/preview/{chunk.R65YX332.js → chunk.TBLOBXZ2.js} +1 -1
  143. package/dist/preview/{chunk.CVVNHQPO.js → chunk.TDWJU6GW.js} +1 -1
  144. package/dist/preview/{chunk.2QALBEWP.js → chunk.THLT6NVO.js} +1 -1
  145. package/dist/preview/{chunk.7FTATAH2.js → chunk.TQCVEKPH.js} +1 -1
  146. package/dist/preview/{chunk.PAIBRJVZ.js → chunk.TQF5XCUS.js} +1 -1
  147. package/dist/preview/{chunk.F5XWYO5W.js → chunk.TRP66PHK.js} +1 -1
  148. package/dist/preview/chunk.TWXYI5AP.js +2 -0
  149. package/dist/preview/{chunk.IQCMV5WD.js → chunk.UOUQZYVD.js} +1 -1
  150. package/dist/preview/{chunk.FJXKQZZS.js → chunk.UPL3D3ZO.js} +1 -1
  151. package/dist/preview/{chunk.U5Q7EVZQ.js → chunk.UXW43HNW.js} +1 -1
  152. package/dist/preview/{chunk.ZOSTOVXR.js → chunk.V4GSVXSV.js} +1 -1
  153. package/dist/preview/chunk.VCEDSOAK.js +1 -0
  154. package/dist/preview/{chunk.4O3STSC4.js → chunk.VE4AQFLW.js} +1 -1
  155. package/dist/preview/{chunk.HMV4ILAC.js → chunk.VGQDPEB5.js} +1 -1
  156. package/dist/preview/{chunk.5A5DI36V.js → chunk.VMYXBFPE.js} +1 -1
  157. package/dist/preview/{chunk.BQWMHHAZ.js → chunk.VNI6HZEF.js} +2 -2
  158. package/dist/preview/chunk.VQRY2NQ6.js +1 -0
  159. package/dist/preview/{chunk.K6EKSURO.js → chunk.VUE6ILQV.js} +1 -1
  160. package/dist/preview/{chunk.3KF5RYPW.js → chunk.W2VSEEKX.js} +1 -1
  161. package/dist/preview/{chunk.KP7HUXH5.js → chunk.WAPY4RCS.js} +1 -1
  162. package/dist/preview/chunk.WFRSGGU5.js +1 -0
  163. package/dist/preview/{chunk.XAN7QXMQ.js → chunk.WIVNFOQR.js} +1 -1
  164. package/dist/preview/chunk.WRIBFLVG.js +1 -0
  165. package/dist/preview/{chunk.TVNY7F64.js → chunk.WWD2TS47.js} +1 -1
  166. package/dist/preview/{chunk.5W7EGQCQ.js → chunk.WWFOQDPR.js} +2 -2
  167. package/dist/preview/{chunk.FBDCHJS2.js → chunk.X45EITTK.js} +1 -1
  168. package/dist/preview/{chunk.5FQHZVE3.js → chunk.X5MCAUFX.js} +1 -1
  169. package/dist/preview/{chunk.IJVR7ZL7.js → chunk.XBWFQ54R.js} +1 -1
  170. package/dist/preview/{chunk.JPJHM62B.js → chunk.XMBGT6UT.js} +1 -1
  171. package/dist/preview/chunk.XP4IVKKR.js +1 -0
  172. package/dist/preview/chunk.XYBWBMNU.js +1 -0
  173. package/dist/preview/{chunk.MYR36HW4.js → chunk.YC2IDHQX.js} +1 -1
  174. package/dist/preview/{chunk.ZQSV5XVB.js → chunk.YCYJHPWS.js} +1 -1
  175. package/dist/preview/{chunk.BJ3G7J2Z.js → chunk.YF5GCOSZ.js} +3 -2
  176. package/dist/preview/{chunk.3I2SGKKF.js → chunk.YGGBGHZU.js} +1 -1
  177. package/dist/preview/chunk.YRC6PKXP.js +1 -0
  178. package/dist/preview/{chunk.6NYSB6OZ.js → chunk.YRN67Z5K.js} +1 -1
  179. package/dist/preview/chunk.ZDUKVXBI.js +5 -0
  180. package/dist/preview/index.html +55 -55
  181. package/dist/preview/page.js +2 -2
  182. package/package.json +6 -6
  183. package/dist/preview/chunk.2QOB62XU.js +0 -1
  184. package/dist/preview/chunk.36FKQJFM.js +0 -2
  185. package/dist/preview/chunk.3A3DCALP.js +0 -1
  186. package/dist/preview/chunk.3GPYKWAD.js +0 -1
  187. package/dist/preview/chunk.3QPMFUMV.js +0 -1
  188. package/dist/preview/chunk.3ZP6IDUC.js +0 -1
  189. package/dist/preview/chunk.53HW224Y.js +0 -1
  190. package/dist/preview/chunk.AW74DZ5V.js +0 -17
  191. package/dist/preview/chunk.C67TMA4U.js +0 -111
  192. package/dist/preview/chunk.CCCSZRKU.js +0 -1
  193. package/dist/preview/chunk.CUA7F3YJ.js +0 -25
  194. package/dist/preview/chunk.DBSSCJQM.js +0 -1
  195. package/dist/preview/chunk.DW6KXAUM.js +0 -1
  196. package/dist/preview/chunk.DWPM7AWA.js +0 -1
  197. package/dist/preview/chunk.FXCKKVT5.js +0 -1
  198. package/dist/preview/chunk.HHQUCFN4.js +0 -1
  199. package/dist/preview/chunk.HPWMCS3H.js +0 -23
  200. package/dist/preview/chunk.HRLCDBMO.js +0 -1
  201. package/dist/preview/chunk.I7ODVOO5.js +0 -1
  202. package/dist/preview/chunk.IANOWT3Z.js +0 -1
  203. package/dist/preview/chunk.IFPJPJ4M.js +0 -1
  204. package/dist/preview/chunk.IUVRJDL3.js +0 -5
  205. package/dist/preview/chunk.J4CSY2D5.js +0 -2
  206. package/dist/preview/chunk.JJIKTTXB.js +0 -1
  207. package/dist/preview/chunk.KDOJC4FX.js +0 -1
  208. package/dist/preview/chunk.KJAOJTZZ.js +0 -1
  209. package/dist/preview/chunk.KLZPUTMU.js +0 -1
  210. package/dist/preview/chunk.LQ2PDW2M.js +0 -32
  211. package/dist/preview/chunk.M7DJJRFH.js +0 -1
  212. package/dist/preview/chunk.MNWP3TPN.js +0 -1
  213. package/dist/preview/chunk.MSWOETXN.js +0 -1
  214. package/dist/preview/chunk.NILR2BWR.js +0 -1
  215. package/dist/preview/chunk.NNYKLENL.js +0 -1
  216. package/dist/preview/chunk.PYGNO2AV.js +0 -87
  217. package/dist/preview/chunk.PZHCWMKT.js +0 -1
  218. package/dist/preview/chunk.QQUZ5RTQ.js +0 -1
  219. package/dist/preview/chunk.QVID5WHS.js +0 -1
  220. package/dist/preview/chunk.RHV73CBA.js +0 -3
  221. package/dist/preview/chunk.RP6C2IUM.js +0 -1
  222. package/dist/preview/chunk.RPHZY7N4.js +0 -1
  223. package/dist/preview/chunk.RSMCTI2N.js +0 -1
  224. package/dist/preview/chunk.S4QSZRKH.js +0 -1
  225. package/dist/preview/chunk.T4QRIJE4.js +0 -1
  226. package/dist/preview/chunk.UJM5EZDM.js +0 -3
  227. package/dist/preview/chunk.UJPX3BUV.js +0 -1
  228. package/dist/preview/chunk.UYBSVE2W.js +0 -1
  229. package/dist/preview/chunk.WMZ2BINI.js +0 -1
  230. package/dist/preview/chunk.X2RHBTJI.js +0 -1
  231. package/dist/preview/chunk.X3FPVFFB.js +0 -1
  232. package/dist/preview/chunk.X4PFLIXB.js +0 -1
  233. package/dist/preview/chunk.YR7DKU5T.js +0 -1
  234. package/dist/preview/chunk.ZBK3FCVE.js +0 -1
  235. package/dist/preview/chunk.ZH5L746C.js +0 -1
@@ -0,0 +1,25 @@
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 ot}from"./chunk.SDO3U72B.js";import{De as Ho,Fe as nt,Gd as ko,Ge as Gt,Id as Ao,N as vo,Od as Ro,Pa as bo,Ta as Wt,Ud as To,Va as xo,Xc as jt,ie as Co,pb as Po,se as Mo,te as Oo,zd as Eo,ze as Vo}from"./chunk.ZDUKVXBI.js";import{a as tt,b as I}from"./chunk.AJZBJBMO.js";var Jo=tt(v=>{"use strict";var Yt=Symbol.for("react.transitional.element"),Ri=Symbol.for("react.portal"),Ti=Symbol.for("react.fragment"),Ci=Symbol.for("react.strict_mode"),Mi=Symbol.for("react.profiler"),Oi=Symbol.for("react.consumer"),Vi=Symbol.for("react.context"),Hi=Symbol.for("react.forward_ref"),Ii=Symbol.for("react.suspense"),Li=Symbol.for("react.memo"),zo=Symbol.for("react.lazy"),_i=Symbol.for("react.activity"),Fo=Symbol.iterator;function Di(e){return e===null||typeof e!="object"?null:(e=Fo&&e[Fo]||e["@@iterator"],typeof e=="function"?e:null)}var $o={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Uo=Object.assign,Yo={};function Pe(e,t,n){this.props=e,this.context=t,this.refs=Yo,this.updater=n||$o}Pe.prototype.isReactComponent={};Pe.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Pe.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zo(){}Zo.prototype=Pe.prototype;function Zt(e,t,n){this.props=e,this.context=t,this.refs=Yo,this.updater=n||$o}var Xt=Zt.prototype=new Zo;Xt.constructor=Zt;Uo(Xt,Pe.prototype);Xt.isPureReactComponent=!0;var Bo=Array.isArray;function Ut(){}var V={H:null,A:null,T:null,S:null},Xo=Object.prototype.hasOwnProperty;function Jt(e,t,n){var o=n.ref;return{$$typeof:Yt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Ni(e,t){return Jt(e.type,t,e.props)}function Qt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yt}function Wi(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ko=/\/+/g;function $t(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wi(""+e.key):t.toString(36)}function ji(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Ut,Ut):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function xe(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Yt:case Ri:a=!0;break;case zo:return a=e._init,xe(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+$t(e,0):o,Bo(r)?(n="",a!=null&&(n=a.replace(Ko,"$&/")+"/"),xe(r,t,n,"",function(c){return c})):r!=null&&(Qt(r)&&(r=Ni(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Ko,"$&/")+"/")+a)),t.push(r)),1;a=0;var s=o===""?".":o+":";if(Bo(e))for(var l=0;l<e.length;l++)o=e[l],i=s+$t(o,l),a+=xe(o,t,n,i,r);else if(l=Di(e),typeof l=="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,i=s+$t(o,l++),a+=xe(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return xe(ji(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function ct(e,t,n){if(e==null)return e;var o=[],r=0;return xe(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Gi(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Fi={map:ct,forEach:function(e,t,n){ct(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ct(e,function(){t++}),t},toArray:function(e){return ct(e,function(t){return t})||[]},only:function(e){if(!Qt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};v.Activity=_i;v.Children=Fi;v.Component=Pe;v.Fragment=Ti;v.Profiler=Mi;v.PureComponent=Zt;v.StrictMode=Ci;v.Suspense=Ii;v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V;v.__COMPILER_RUNTIME={__proto__:null,c:function(e){return V.H.useMemoCache(e)}};v.cache=function(e){return function(){return e.apply(null,arguments)}};v.cacheSignal=function(){return null};v.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Uo({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Xo.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];o.children=a}return Jt(e.type,r,o)};v.createContext=function(e){return e={$$typeof:Vi,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Oi,_context:e},e};v.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Xo.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Jt(e,i,r)};v.createRef=function(){return{current:null}};v.forwardRef=function(e){return{$$typeof:Hi,render:e}};v.isValidElement=Qt;v.lazy=function(e){return{$$typeof:zo,_payload:{_status:-1,_result:e},_init:Gi}};v.memo=function(e,t){return{$$typeof:Li,type:e,compare:t===void 0?null:t}};v.startTransition=function(e){var t=V.T,n={};V.T=n;try{var o=e(),r=V.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Ut,qo)}catch(i){qo(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),V.T=t}};v.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()};v.use=function(e){return V.H.use(e)};v.useActionState=function(e,t,n){return V.H.useActionState(e,t,n)};v.useCallback=function(e,t){return V.H.useCallback(e,t)};v.useContext=function(e){return V.H.useContext(e)};v.useDebugValue=function(){};v.useDeferredValue=function(e,t){return V.H.useDeferredValue(e,t)};v.useEffect=function(e,t){return V.H.useEffect(e,t)};v.useEffectEvent=function(e){return V.H.useEffectEvent(e)};v.useId=function(){return V.H.useId()};v.useImperativeHandle=function(e,t,n){return V.H.useImperativeHandle(e,t,n)};v.useInsertionEffect=function(e,t){return V.H.useInsertionEffect(e,t)};v.useLayoutEffect=function(e,t){return V.H.useLayoutEffect(e,t)};v.useMemo=function(e,t){return V.H.useMemo(e,t)};v.useOptimistic=function(e,t){return V.H.useOptimistic(e,t)};v.useReducer=function(e,t,n){return V.H.useReducer(e,t,n)};v.useRef=function(e){return V.H.useRef(e)};v.useState=function(e){return V.H.useState(e)};v.useSyncExternalStore=function(e,t,n){return V.H.useSyncExternalStore(e,t,n)};v.useTransition=function(){return V.H.useTransition()};v.version="19.2.8"});var W=tt((Ts,Qo)=>{"use strict";Qo.exports=Jo()});var ur=tt(gt=>{"use strict";var na=Symbol.for("react.transitional.element"),oa=Symbol.for("react.fragment");function dr(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:na,type:e,key:o,ref:t!==void 0?t:null,props:n}}gt.Fragment=oa;gt.jsx=dr;gt.jsxs=dr});var Ne=tt((Ws,cr)=>{"use strict";cr.exports=ur()});var ve={focusId:null,relation:null,expanded:[],pins:{}},rt=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function J(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${it(r.x)},${it(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${it(e.pan.x)},${it(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function bi(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function at(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[y,g]of n){if(!y.startsWith("pin."))continue;let[m,x]=g.split(","),R=m===void 0?null:rt(m),p=x===void 0?null:rt(x);R===null||p===null||(o[y.slice(4)]={x:R,y:p})}let r=Object.create(null);for(let[y,g]of n)!y.startsWith("in.")||g.length===0||(r[y.slice(3)]=g);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],s=a[0]===void 0?null:rt(a[0]),l=a[1]===void 0?null:rt(a[1]),c=(n.get("sel")??"").split(",").filter(y=>y.length>0).sort(),u=n.get("overview")==="1";return{...c.length>0?{selection:c}:{},...u?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...s!==null&&l!==null?{pan:{x:s,y:l}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:bi(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(y=>y.length>0&&(u||!y.startsWith("kind:"))).sort(),pins:o}}function cs(e){let t=at(e);return J(t)==="#"?{...t,overview:!0}:t}function fs(e){let t=J(e);return t==="#overview=1"?"":t}function it(e){return Math.round(e*100)/100}function Lo(e,t){return J(e)===J(t)}var Io="edge:";function _o(e){if(!e.startsWith(Io))return null;let t=e.slice(Io.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function Ft(e){let{pan:t,...n}=e;return{...n,pins:{}}}function Y(e,t){if(t===e.focusId)return{...e,focusId:t};let n=Ft(e);return{...n.within?.q!==void 0?ie(n,"q",null):n,focusId:t}}function Do(e,t){return{...e,relation:t}}function ie(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function fe(e,t){if(t!==e.overview&&(e=Ft(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function st(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function _e(e,t){if(t!==(e.zoom===!0)&&(e=Ft(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function lt(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var ut="aggregate:",dt="kind:";function Bt(e){return`${dt}${e}`}function be(e){return e.startsWith(dt)?e.slice(dt.length):null}var gs="kinds:beyond";function xi(e){let t=be(e);return t?[t]:pe(e)}function ae(...e){return`${ut}${[...e].sort().join("+")}`}function No(e){return e.startsWith(ut)}function pe(e){return!No(e)||e.includes("|")?[]:e.slice(ut.length).split("+").filter(Boolean)}function Wo(e,t,n={}){let o=be(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return lt(e,t);let r=o!==null?ae(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return _e(e,!1);if(o!==null&&n.carry){let i=fe({...Y(e,r),relation:null},!1);return ie(_e(i,!0),"q",n.carry)}return _e({...Y(e,r),relation:null},!0)}function Pi(e,t,n){return ie(fe(Y(e,ae(t)),!1),"view",n)}function ms(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var jo="aggregate:";function Kt(e){return e.startsWith(jo)&&e.includes("|")}var qt=e=>e?.off===!0,Ei=e=>e!==void 0&&!qt(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),Go=e=>e!==void 0&&!qt(e)&&(e.fast!==void 0||e.decide!==void 0),ki=e=>e?.suggestOnOpen!==!1&&Go(e),Ai=e=>e?.hoverChips===!0&&Go(e);var zt={};var er=I(W(),1),Bi={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},tr=e=>`graview:seat:${e}`;function Ki(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function qi(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function en(e){let t=e===null?null:tr(e),n={...Bi,...Ki(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&qi(t,n);for(let s of[...o])s()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function zi(e){return(0,er.useSyncExternalStore)(e.subscribe,e.get,e.get)}var or=I(W(),1),$i={entries:[],ghost:null,loaded:!1};function nr(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function tn(e){let t=$i,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:nr(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:nr(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function Ui(e){return(0,or.useSyncExternalStore)(e.subscribe,e.get,e.get)}function rr(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}function Os(e,t,n,o){for(let r=e;r&&r!==t?.parentElement;r=r.parentElement){if(typeof r.querySelectorAll!="function")continue;let i=[...new Set([...r.querySelectorAll("[data-graview-pick]")].map(s=>s.getAttribute("data-graview-pick")??"").filter(s=>s!==""&&s!==o))];if(i.length===0)continue;let a=i[0];return i.slice(1).every(s=>n(a,s))?a:null}return null}var se=I(W(),1),ft=(0,se.createContext)(void 0),Yi=()=>(0,se.useContext)(ft),pt=(0,se.createContext)(void 0),Zi=()=>(0,se.useContext)(pt),yt=(0,se.createContext)(void 0),Xi=()=>(0,se.useContext)(yt);var P=I(W(),1),De=(0,P.createContext)(null);function ar(){return(0,P.useContext)(De)}function Ji(e,t){let n=ar(),o=(0,P.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,P.useRef)(0),i=(0,P.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,P.useSyncExternalStore)(i,()=>r.current,()=>0),o}function Qi(){let e=new Set,t=null,n=!1,o=!1;return{show(r){if(o)return!1;let i={focus:r?.focus===!0};if(e.size===0)return n||(t=i),!1;for(let a of[...e])a(i);return!0},listen(r){if(o)return()=>{};if(e.add(r),t){let i=t;t=null,r(i)}return()=>void e.delete(r)},settle(){n=!0,setTimeout(()=>{e.size===0&&(t=null)},0)},unsettle(){n=!1},forget(){t=null,n=!1},close(){o=!0,t=null,e.clear()}}}var ea=(0,P.createContext)(null),sr=ot(()=>(__graviewPreload(import.meta.url,["./chunk.YFVJUHAK.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FC6AF6CC.js")));function nn(e){let[,t]=(0,P.useReducer)(o=>o+1,0),n=e.publishing?.mode==="on-publish"&&!ko();return(0,P.useEffect)(()=>{n&&sr().then(t,()=>{})},[n]),!n}var ir,ta=400;function on(e,t,n){let o=(0,P.useContext)(De),r=o!==null&&o.owns(e,t),[i,a]=(0,P.useState)(null),[s,l]=(0,P.useState)(ir);(0,P.useEffect)(()=>{if(s||r||i===null)return;let H=!0;return sr().then(q=>{ir=q,H&&l(q)},()=>{}),()=>{H=!1}},[s,r,i]);let[c,u]=(0,P.useState)(0),[y,g]=(0,P.useMemo)(()=>r||i===null||!s?[]:[i>=e.log.length?void 0:s.askArchived(e,i,n)??s.askDeclaration(n,i),s.keptOf(e,n)],[r,e,i,n,s,c]),m=y&&"waiting"in y?y.waiting:void 0,x=y&&"seq"in y?y:null,[R,p]=(0,P.useState)(void 0);(0,P.useEffect)(()=>{if(!m)return;let H=!0,q=setTimeout(()=>H&&p(m),ta);return m.then(()=>H&&u(Z=>Z+1)),()=>{H=!1,clearTimeout(q)}},[m]);let h=m!==void 0&&R!==m||x!==null,w=(0,P.useMemo)(()=>{if(r||i===null||i>=e.log.length||!s||h)return null;try{let H=s.pastAt(e,i,n);return{seq:i,at:H.past?.at,store:H}}catch{return null}},[r,e,i,n,s,h,c]),k=(0,P.useRef)(null),E=h?k.current:w;(0,P.useEffect)(()=>{k.current=E},[E]);let[K,j]=(0,P.useState)(!1),G=(0,P.useCallback)((H,q)=>{a(H===null?null:H>=e.log.length?Number.POSITIVE_INFINITY:H),j(H!==null&&q?.focus===!0)},[e]),T=(0,P.useCallback)(()=>j(!1),[]),F=(0,P.useCallback)((H,q)=>[e,E?.store].some(Z=>Z!==void 0&&(Z===H||Z.seenBy(q)===H)),[e,E]),L=i!==null,_=(0,P.useMemo)(()=>({past:E,open:L,show:G,focusWanted:K,focused:T,live:e,host:n,owns:F,archive:x,kept:g}),[E,L,G,K,T,e,n,F,x,g]);return r?o:_}var lr=I(W(),1),rn=(0,lr.createContext)(null);var fr=e=>`graview:setting:${e}`;function pr(){return localStorage}function yr(e,t){try{let n=(t??pr()).getItem(fr(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function gr(e,t,n){try{(n??pr()).setItem(fr(e.name),t)}catch{}}function mr(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var A=I(W(),1);function an(e){return nt(e)}var ra=12,ia=4;function aa(e,t,n){let o=an(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var mt=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-ra);function hr(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=ia)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?Bt([...o][0]):n[0]}function sn(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,s]of e)s.mode!=="asking"&&s.mode!=="docked"&&t.at-s.since>=t.holdMs&&o.set(a,{...s,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=aa(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=hr(t.ids,n);return i({at:a,mode:"reading",trail:mt(r.trail,a)}),o}case"about-to-write":case"write":{let a=hr(t.ids,n);return i({at:a,mode:"writing",trail:mt(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:mt(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:mt(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var wr="graview:session";function vr(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(wr);if(o)return o;let r=t();return n.setItem(wr,r),r}catch{return t()}}var ln={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},dn={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},br=[ln,dn],Sr=800;function xr(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:s,settingValues:l,setView:c,ttlMs:u=Ho,people:y,seats:g}=e,[m,x]=(0,A.useState)(()=>new Map),[R,p]=(0,A.useState)(null),[h,w]=(0,A.useState)(null),[k,E]=(0,A.useState)(null),K=typeof r.id=="string"&&r.id.length>0,j=K&&(l[ln.name]??ln.initial)==="shared",G=j&&(l[dn.name]??dn.initial)==="shared",T=an({kind:r.kind,...r.id?{id:r.id}:{},session:i}),F=K?Po(r,{graph:n.graph,schema:n.schema,...g?{seats:g}:{},...y?{people:y}:{}}):"",L=s?a.get(`agent:${s}:${i}`):void 0,_=(0,A.useMemo)(()=>!t||!j?null:{participant:T,kind:r.kind,name:F,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:jt(r.id??"nobody"),stop:k??J(o),...G?{over:R}:{},...L?{robot:{at:L.at,mode:L.mode}}:{},at:new Date().toISOString()},[t,j,G,T,F,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,k,R,L?.at,L?.mode]),H=(0,A.useRef)(null),q=b=>b&&t?.here({...b,caret:H.current??void 0,at:new Date().toISOString()}),Z=(0,A.useCallback)(b=>{H.current=b,q(_)},[t,_]);(0,A.useEffect)(()=>{if(!_)return;q(_);let b=setInterval(()=>q(_),Sr);return()=>clearInterval(b)},[t,_]),(0,A.useEffect)(()=>t?t.onWho(D=>x(Gt(new Map,D,Date.now(),u))):void 0,[t,u]);let me=m.size>0;(0,A.useEffect)(()=>{if(!me)return;let b=setInterval(()=>{x(D=>{let de=Gt(D,[],Date.now(),u);return de.size===D.size?D:de})},Math.max(250,Math.min(1e3,u/4)));return()=>clearInterval(b)},[me,u]),(0,A.useEffect)(()=>{if(!t||typeof window>"u")return;let b=()=>t.leave();return window.addEventListener("pagehide",b),()=>window.removeEventListener("pagehide",b)},[t]),(0,A.useEffect)(()=>{if(!G||typeof document>"u")return;let b=null,D=de=>{let $=rr(de.target);$!==b&&(b=$,p($))};return document.addEventListener("pointermove",D,{passive:!0}),()=>document.removeEventListener("pointermove",D)},[G]);let he=(0,A.useRef)(null),ne=h?m.get(h)??null:null,Be=(0,A.useCallback)(b=>{he.current=null,w(b)},[]);(0,A.useEffect)(()=>{if(h){if(!ne){w(null);return}ne.stop!==he.current?.stop&&(he.current={stop:ne.stop,at:Date.now()},c(at(ne.stop)))}},[h,ne,c]),(0,A.useEffect)(()=>{let b=he.current;!h||b===null||Date.now()-b.at<400||Lo(o,at(b.stop))||w(null)},[o,h]),(0,A.useEffect)(()=>{if(!h||typeof document>"u")return;let b=D=>{D.key==="Escape"&&w(null)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[h]);let[oe,Ke]=(0,A.useState)(null),Te=(0,A.useRef)(J(o));Te.current=k??J(o);let qe=(0,A.useCallback)(b=>Ke(D=>(b===null&&D&&t?.alsoHere?.({...D,at:new Date().toISOString(),until:new Date().toISOString()}),b===null?null:{hue:jt("graview"),...b,stop:Te.current,at:new Date().toISOString()})),[t]);(0,A.useEffect)(()=>{if(!oe||!t?.alsoHere)return;let b=()=>t.alsoHere?.({...oe,at:new Date().toISOString()});b();let D=setInterval(b,Sr);return()=>clearInterval(D)},[oe,t]);let ze=(0,A.useMemo)(()=>{if(!oe)return m;let b=new Map(m);return b.set(oe.participant,{...oe,at:new Date().toISOString()}),b},[m,oe]),$e=_!==null,Ue=(0,A.useMemo)(()=>$e?{participant:T,name:F}:null,[$e,T,F]);return(0,A.useMemo)(()=>({who:ze,aiHere:qe,sharing:Ue,following:ne,follow:Be,sayWhere:E,sayCaret:Z}),[ze,qe,Ue,ne,Be,Z])}var Q=I(W(),1);function Pr(e){return nt(e.author)}function sa(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Er(e,t,n,o,r){let i=new Map;for(let[l,c]of e)o-c.at<r&&i.set(l,c);let a=new Set(n.flatMap(l=>l.nodeIds)),s=(l,c,u)=>{let y=i.get(l),g=y?.participants.includes(Pr(c))?y.participants:[...y?.participants??[],Pr(c)];i.set(l,{at:o,manner:sa(g,c.author.kind),intent:c.intent,wrote:(y?.wrote??!1)||(u.wrote??!1),read:(y?.read??!1)||(u.read??!1),broke:(y?.broke??!1)||a.has(l),participants:g})};for(let l of t){for(let c of l.writes)s(c,l,{wrote:!0});for(let c of l.reads)l.writes.includes(c)||s(c,l,{read:!0})}for(let l of n)for(let c of l.nodeIds){let u=i.get(c);i.set(c,{at:o,manner:u?.manner??"rule",intent:u?.intent??l.message,wrote:u?.wrote??!1,read:u?.read??!1,broke:!0,participants:u?.participants??["rule::"]})}return i}var la=2600;function kr(e,t=la){let[n,o]=(0,Q.useState)(()=>new Map),r=(0,Q.useRef)(n);r.current=n;let i=(0,Q.useRef)(null),a=(0,Q.useCallback)(l=>{r.current=l,o(l),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,Q.useEffect)(()=>{let l=e.violations(),c=e.subscribe((u,y)=>{let g=e.violations(),m=To(e.allInvariants(),l,g).introduces;l=g,a(Er(r.current,y,m.map(x=>({nodeIds:x.nodeIds,message:x.message})),Date.now(),t))});return()=>{c(),i.current&&clearTimeout(i.current)}},[e,t,a]);let s=(0,Q.useCallback)(l=>{l.reads.length!==0&&a(Er(r.current,[da(l)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:s}}function da(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var d=I(W(),1);function Ar(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var ht=I(W(),1),ua=e=>e.definitions.some(t=>bo(t).size>0);function Rr(e,t,n){let[o,r]=(0,ht.useState)(void 0),i=(n.roles??[]).join("\0"),a=n.onBehalfOf?JSON.stringify(n.onBehalfOf):"";return(0,ht.useEffect)(()=>{if(!t||!ua(e.schema)){r(void 0);return}let s=!0,l=!1,c=e.graph,u=()=>{l||(l=!0,queueMicrotask(()=>{l=!1,s&&e.reread()}))},y=xo(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{},...n.onBehalfOf?{onBehalfOf:n.onBehalfOf}:{}},u);return Wt(c,y.read),r(y),e.reread(),()=>{s=!1,Wt(c,void 0)}},[e,t,n.kind,n.id,i,a]),o}function Tr(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var ee=I(Ne(),1),ca="graview:place-menu",We=(0,d.createContext)(null),Vr=(0,d.createContext)("scene");function fa({mode:e,children:t}){return(0,ee.jsx)(Vr.Provider,{value:e,children:t})}function pa(){return(0,d.useContext)(Vr)}var Hr={kind:"human"},ya=[],ga=[],ma=[],un=[];function Ir(e,t){let n=(0,d.useId)();(0,d.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Hr,r=()=>Ro(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var ha=()=>{try{return typeof location<"u"&&new URLSearchParams(location.search).get("as")==="published"?"published":void 0}catch{return}},wa={off:!0};function Sa({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,as:a,seats:s=ya,onSeat:l,people:c=ga,memory:u,presenceTtlMs:y,app:g,settings:m=g?.settings??ma,presence:x,typing:R,brand:p,locale:h,timeZone:w,onKeepLens:k,onProposeChange:E,composeChange:K,onDraftChange:j,displayOptions:G,providers:T,ai:F,files:L,viewerState:_,assetsAt:H,resolveApp:q,history:Z,linkedRecords:me,menuSections:he,keptViews:ne,onExport:Be,subscriptions:oe,dismissals:Ke,whileAway:Te,notifications:qe,onNotificationsSeen:ze,workflowRuns:$e,signIn:Ue,view:b,onViewChange:D,children:de}){let $=(0,d.useContext)(We),Rn=he??$?.menuSections,Tn=Ue??$?.signIn,Rt=$e??$?.workflowRuns,Tt=ne??$?.keptViews,Ct=Be??$?.onExport,Mt=qe??$?.notifications,Ot=ze??$?.onNotificationsSeen,[si,li]=(0,d.useState)(null),we=si??i??s[0]?.principal??Hr,Ye=on(e,we,Z),Cn=Ye.past&&Ye.live===e?Ye.past.store:e,Vt=a??ha(),Ht=!nn(e),N=(0,d.useMemo)(()=>Ht?e:Cn.seenBy(we,Vt?{as:Vt}:void 0),[Ht,e,Cn,we,Vt]);Ir(e,we);let[ue]=(0,d.useState)(()=>vr(u)),[Mn,di]=(0,d.useState)(!1),On=(0,d.useCallback)(()=>di(!0),[]),ce=(0,d.useMemo)(()=>x?[...m,...br]:m,[m,x]),[It]=(0,d.useState)(()=>n??yn(t,e.schema)),[ui,Vn]=(0,d.useState)(()=>st(It??ve,r??It?.selection??[])),Ce=(0,d.useRef)(It??ve).current,[Hn,ci]=(0,d.useState)(null),[In,fi]=(0,d.useState)(null),z=(0,d.useContext)(We),[Ln]=(0,d.useState)(()=>z?.seatTalk??en(p?.name??e.schema.kinds.join(","))),Lt=F??z?.ai??zt,Ze=(0,d.useMemo)(()=>Lt.off?wa:Lt,[Lt]),_n=(0,d.useRef)(Ze.interactions);_n.current=Ze.interactions;let[Dn]=(0,d.useState)(()=>z?.aiDesk??tn(()=>_n.current)),[pi]=(0,d.useState)(()=>z?.subscriptions??Ao()),Nn=oe??z?.subscriptions??pi,_t=k??z?.onKeepLens,Wn=E??z?.onProposeChange,jn=K??z?.composeChange,Gn=j??z?.onDraftChange,Fn=G??z?.displayOptions,Xe=g??z?.app,Je=h??z?.locale,yi=p?.locale??Xe?.brand?.locale,Qe=w??z?.timeZone;vo({reader:Je,app:yi,readerTimeZone:Qe,appTimeZone:p?.timeZone??Xe?.brand?.timeZone});let Bn=(0,d.useRef)(null),Kn=(0,d.useCallback)(f=>{Bn.current=f},[]),qn=(0,d.useCallback)(f=>Bn.current?.whereIs(f)??null,[]),[zn]=(0,d.useState)(()=>Ar()),[$n]=(0,d.useState)(()=>Tr()),[Dt,gi]=(0,d.useState)(null),[Me,Un]=(0,d.useState)(()=>new Map),Oe=(0,d.useRef)(Me);Oe.current=Me;let Ve=(0,d.useRef)(null),Nt=(0,d.useCallback)(f=>N.graph.getNode(f)?.kind,[N]),re=(0,d.useCallback)(f=>{let S=sn(Oe.current,f,Nt);Oe.current=S,Un(S),Ve.current&&clearTimeout(Ve.current),[...S.values()].some(O=>O.mode!=="docked"&&O.mode!=="asking")&&(Ve.current=setTimeout(()=>{let O=sn(Oe.current,{type:"rest",at:Date.now(),holdMs:pn},Nt);Oe.current=O,Un(O)},pn+20))},[Nt]),Yn=(0,d.useCallback)(f=>re({...f,at:f.at??Date.now()}),[re]),Zn=(0,d.useCallback)(f=>{gi(f),f&&re({type:"home",author:{kind:"agent",id:f,session:ue},at:Date.now()})},[re,ue]);(0,d.useEffect)(()=>N.subscribe((f,S)=>{for(let C of S)C.author.kind==="agent"&&re({type:"write",author:C.author,ids:C.writes,at:Date.now()})}),[N,re]),(0,d.useEffect)(()=>()=>{Ve.current&&clearTimeout(Ve.current)},[]);let X=(0,d.useMemo)(()=>({...we,session:ue}),[we,ue]),Xn=Rr(N,me,X),Jn=(0,d.useCallback)(f=>{li(f),l?.(f)},[l]),[He,mi]=(0,d.useState)(()=>Object.fromEntries(ce.map(f=>[f.name,yr(f,u)])));(0,d.useEffect)(()=>{for(let f of ce)mr(f,He[f.name]??f.initial)},[ce,He]);let Qn=(0,d.useCallback)((f,S)=>{let C=ce.find(O=>O.name===f);!C||!C.options.some(O=>O.value===S)||(gr(C,S,u),mi(O=>({...O,[f]:S})))},[ce,u]),[eo,hi]=(0,d.useState)(null),{activity:to,noteAttention:no}=kr(N),oo=(0,d.useCallback)(f=>{no(f),re({type:"read",author:f.author,ids:f.reads,at:Date.now()})},[no,re]),Se=(0,d.useCallback)(f=>{if(be(f)!==null||pe(f).length>0||Kt(f))return!0;let S=_o(f);return S?N.graph.allEdges().some(C=>C.kind===S.kind&&C.from===S.from&&C.to===S.to):N.graph.getNode(f)!==void 0},[N]),ro=(0,d.useCallback)(f=>{let S=f.selection??un,C=S.filter(Se),O=C.length===S.length?f:st(f,C);return O.focusId!==null&&!Se(O.focusId)&&(O=Y(O,null)),O},[Se]),Ie=(0,d.useCallback)(f=>{let S=ro(f),C=Or(N,X,S.shown);if(S.focusId!==null&&C.size>0){let O=pe(S.focusId),So=N.graph.getNode(S.focusId);(O.length>0?O.every(vi=>C.has(vi)):So?C.has(So.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let O=Ce.focusId!==null&&!Se(Ce.focusId)?yn(t,e.schema)??{...ve,overview:!0}:Ce;O.focusId!==null&&Se(O.focusId)?S={...S,focusId:O.focusId}:O.overview===!0&&(S={...S,overview:!0})}return S},[ro,Se,N,Ce,X,t,e.schema]),U=Ie(b??ui),io=(0,d.useMemo)(()=>Or(N,X,U.shown),[N,X,U.shown]),ao=(0,d.useMemo)(()=>[...N.modules.administered.entries()].map(([f,S])=>{let C=N.mayAdminister(f,X);return{name:f,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:C,shown:C&&(U.shown??[]).includes(f)}}),[N,X,U.shown]),Le=(0,d.useCallback)(f=>{let S=C=>Ie(typeof f=="function"?f(C):f);if(b!==void 0){D?.(S(b));return}D&&D(S(U)),Vn(C=>S(C))},[U,D,b,Ie]);(0,d.useEffect)(()=>{b===void 0&&Vn(f=>{let S=Ie(f);return S===f?f:S})},[U,b,Ie]);let so=U.selection??un,lo=(0,d.useCallback)(f=>{Le(S=>st(S,typeof f=="function"?f(S.selection??un):f))},[Le]),{who:et,aiHere:uo,following:co,follow:fo,sayWhere:wi,sayCaret:po,sharing:yo}=xr({channel:x,store:N,view:U,principal:X,session:ue,robots:Me,seatWho:Dt,settingValues:He,setView:Le,seats:s,people:c,...y!==void 0?{ttlMs:y}:{}}),Si=(0,d.useMemo)(()=>({store:N,scheme:o,views:t,view:U,setView:Le,homeView:Ce,selection:so,setSelection:lo,menuAt:Hn,setMenuAt:ci,whereIs:qn,pointer:zn,motion:$n,registerScene:Kn,robots:Me,noteSeat:Yn,seatWho:Dt,registerSeatWho:Zn,actsDoor:In,registerActsDoor:fi,seatTalk:Ln,aiDesk:Dn,...u?{memory:u}:{},who:et,aiHere:uo,following:co,follow:fo,sayWhere:wi,sharing:yo,session:ue,ai:Ze,resolveApp:q,linkedRecords:me,menuSections:Rn,...Tt?{keptViews:Tt}:{},...Ct?{onExport:Ct}:{},subscriptions:Nn,dismissals:Ke,whileAway:Te,...Mt?{notifications:Mt}:{},...Ot?{onNotificationsSeen:Ot}:{},...Rt?{workflowRuns:Rt}:{},signIn:Tn,linkedReads:Xn,movedByHand:Mn,noteMoved:On,emphasis:eo,setEmphasis:hi,activity:to,noteAttention:oo,principal:X,seats:s,people:c,takeSeat:Jn,settings:ce,settingValues:He,chooseSetting:Qn,hiddenKinds:io,administered:ao,...T?{providers:T}:{},...p?{brand:p}:{},..._t?{onKeepLens:_t}:{},...Wn?{onProposeChange:Wn}:{},...jn?{composeChange:jn}:{},...Gn?{onDraftChange:Gn}:{},...Fn?{displayOptions:Fn}:{},app:Xe,...Je?{locale:Je}:{},...Qe?{timeZone:Qe}:{}}),[N,o,t,U,Le,so,lo,Hn,qn,zn,$n,Kn,Me,Yn,Dt,Zn,In,Ln,Dn,u,et,uo,co,fo,yo,ue,Ze,q,me,Rn,Tt,Ct,Nn,Ke,Te,Mt,Ot,Rt,Tn,Xn,Mn,On,eo,to,oo,X,s,c,Jn,ce,He,Qn,io,ao,T,p,_t,Xe,Je,Qe]),go=(0,d.useMemo)(()=>R?{typing:R,sayCaret:po,who:et}:null,[R,po,et]),mo=H?(0,ee.jsx)(pt.Provider,{value:H,children:de}):de,ho=L?(0,ee.jsx)(ft.Provider,{value:L,children:mo}):mo,wo=_?(0,ee.jsx)(yt.Provider,{value:_,children:ho}):ho;return(0,ee.jsx)(We.Provider,{value:Si,children:(0,ee.jsx)(De.Provider,{value:Ye,children:(0,ee.jsx)(Ea,{children:Ht?null:go?(0,ee.jsx)(rn.Provider,{value:go,children:wo}):wo})})})}var Lr=(0,d.createContext)(null),cn,fn=new Set,va=e=>(fn.add(e),()=>void fn.delete(e)),Cr=()=>cn;function ba(e){if(!cn){cn=e;for(let t of[...fn])t()}}var xa=300;function Pa(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,xa)),r===t?e(n,o):[]}}function Ea({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:s}=le(),l=wt(),c=n.q,u=n.focusId,y=!!(c&&c.trim().length>0),g=(0,d.useSyncExternalStore)(va,Cr,Cr),m=(0,d.useMemo)(()=>y&&g?{flagged:new Set(t.violations().flatMap(k=>k.nodeIds)),touched:g.touchWeights(t.log.all())}:null,[t,l,y,g]),x=u?t.graph.getNode(u)?.kind??be(u)??(pe(u).length===1?pe(u)[0]:void 0):void 0,R=(0,d.useMemo)(()=>s.near&&Pa(s.near),[s.near]),p=(0,d.useMemo)(()=>!c||!m||!g?null:g.search(t,c,{...x?{inKind:x}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(k=>!i.has(k)),from:[...a,...u&&t.graph.has(u)?[u]:[]],flagged:m.flagged,touched:m.touched,limit:200,rank:R}),[t,c,r,o,i,a,u,x,m,R]),[h,w]=(0,d.useState)();return(0,d.useEffect)(()=>void p?.later?.then(k=>w([p,k])),[p]),(0,ee.jsx)(Lr.Provider,{value:h?.[0]===p?h[1]:p,children:e})}var Mr=new WeakMap;function ml(e){let t=Mr.get(e);return t||Mr.set(e,t=new Set(e.matched)),t}function ka(){return(0,d.useContext)(Lr)}function le(){let e=(0,d.useContext)(We);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function gn(){return(0,d.useContext)(We)??null}function wt(){let{store:e}=le(),t=(0,d.useRef)(null),n=(0,d.useRef)(null),o=(0,d.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,d.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,d.useSyncExternalStore)(r,o,o)}function Aa(e){let{store:t}=le(),n=(0,d.useCallback)(r=>t.subscribe(r),[t]),o=(0,d.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,d.useSyncExternalStore)(n,o,o)}function Or(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var pn=2600;var _r=new WeakSet,Ra=e=>_r.has(e),Ta=e=>void _r.add(e);function yn(e,t){let n=Vo(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...ve,focusId:ae(n.place.kind),within:{view:n.place.as}}:{...ve,focusId:ae(n.kind)}}var ye=I(W(),1);var mn=I(W(),1),Ca=(0,mn.createContext)(null),hn=(0,mn.createContext)(null);var Dr=(0,ye.createContext)(null);function Ma(){let e=(0,ye.useContext)(Dr),t=gn(),n=(0,ye.useContext)(hn),o=(i,a,s)=>t?.setView(l=>ie(ie(fe(Y(l,ae(i)),!1),"view",a),"filter",s?.filter??null)),r=()=>t?.setView(i=>ie(fe(i,!0),"view",null));return(0,ye.useMemo)(()=>e??{record:i=>{t&&(t.setView(a=>Y(fe(a,!1),i)),t.setSelection([i]))},place:(i,a)=>{if(i===Oo)return r();if(i===Mo)return n?n.open("/"):r();let s=t?.views.places().find(l=>l.as===i);s&&o(s.kind,s.as,a)},list:(i,a)=>o(i,null,a)},[e,t,n])}var Nr=I(W(),1),Oa=(0,Nr.createContext)(!1);var St=Symbol.for("graview.default-view");function Wr(e){return Object.defineProperty(e,St,{value:!0,enumerable:!1}),e}function jr(e){return typeof e=="function"&&e[St]===!0}var vt=Symbol.for("graview.replaces-page");function Gr(e){return Object.defineProperty(e,vt,{value:!0,enumerable:!1}),e}function Fr(e){return typeof e=="function"&&e[vt]===!0}var je=Symbol.for("graview.bleeds");function Br(e,t=!0){return Object.defineProperty(e,je,{value:t,enumerable:!1,configurable:!0}),e}function Kr(e){let t=typeof e=="function"?e[je]:void 0;return t===!0||t==="full"}function qr(e){return typeof e=="function"&&e[je]==="full"}var bt=Symbol.for("graview.previews");function zr(e,t={}){return Object.defineProperty(e,bt,{value:t,enumerable:!1}),e}function $r(e){return typeof e=="function"?e[bt]:void 0}function Va(e){return Co(e)}function Ha(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homes?.()??[];if(o.length>0)for(let r of o)e.home?.(r.view,r.name!==void 0?{name:r.name}:void 0);else{let r=t.homeView?.();r&&e.home?.(r)}return e}var M=I(W(),1),te=I(Ne(),1),wn=new Set,xt=0;function Sn(e){return()=>{xt+=1;let t=e();return t.then(()=>void(xt-=1),()=>void(xt-=1)),t}}var Ia=()=>xt,Et=(0,M.createContext)(null);function La(){return{waiting:new Map,at:0}}function _a(e){for(let[t,n]of e.waiting)n<e.at&&e.waiting.delete(t);e.at+=1}var Da=e=>e?.waiting.size??0;function Zr(e,t){e?.waiting.set(t,e.at)}function Xr(e){let t=(0,M.useContext)(Et);(0,M.useLayoutEffect)(()=>{t?.waiting.delete(e)},[t,e])}function Na(e){let t={},n=!1,o=new Set,r=(0,M.lazy)(Sn(()=>e().then(a=>{n=!0;let s=a.default;function l(c){return Xr(t),(0,M.createElement)(s,c)}return{default:l}},a=>{for(let s of o)s.waiting.delete(t);throw a})));function i(a){let s=(0,M.useContext)(Et);return!n&&s&&(o.add(s),Zr(s,t)),(0,M.createElement)(r,a)}return i}var Jr=!1,Qr=!1,Pt=new Set;function Wa(){Jr=!0}function ja(){Qr=!0;for(let e of[...Pt])e();Pt.clear()}var ei=()=>Qr||!Jr;function Ga(e){return ei()?(e(),()=>{}):(Pt.add(e),()=>void Pt.delete(e))}var Ur=!1;function vn(){for(let e of[...wn])e()}function Fa(){Ur||typeof window>"u"||(Ur=!0,window.addEventListener("online",vn))}function bn(e){let t,n=!1,o=!1,r,i=0,a=new Set,s=()=>{i+=1;for(let g of[...a])g()},l=g=>(a.add(g),()=>void a.delete(g)),c=()=>i,u=()=>void y().catch(()=>{});function y(){if(n)return Promise.resolve(t);if(r)return r;let g=e().then(m=>(t=m,n=!0,o=!1,r=void 0,wn.delete(u),s(),m),m=>{throw r=void 0,o=!0,wn.add(u),Fa(),s(),m});return g.catch(()=>{}),r=g,g}return{load:y,prefetch:u,get current(){return t},get failed(){return o},part(g,m={}){let x=m.what??"This part",R={};function p(k){(0,M.useSyncExternalStore)(l,c,c),Xr(R);let E=(0,M.useRef)(null),K=(0,M.useRef)(null),j=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{o&&r===void 0&&u()},[]),n&&typeof document<"u"&&E.current!==null&&document.activeElement===E.current&&(j.current=!0),(0,M.useLayoutEffect)(()=>{if(!(!n||!j.current)){j.current=!1;for(let G=K.current?.nextElementSibling??null;G!==null;G=G.nextElementSibling){let T=G.matches(Yr)?G:G.querySelector(Yr);if(T instanceof HTMLElement){T.focus();return}}}}),n?(0,te.jsxs)(te.Fragment,{children:[j.current?(0,te.jsx)("span",{ref:K,hidden:!0}):null,g(t,k)]}):m.quiet?null:(0,te.jsx)(Ba,{what:x,button:E,...m.as?{as:m.as}:{}})}let h=(0,M.lazy)(Sn(()=>y().then(()=>({default:p}),()=>({default:p}))));function w(k){let E=(0,M.useContext)(Et),[K]=(0,M.useState)(()=>n||o);return!n&&!o&&Zr(E,R),(0,M.createElement)(K?p:h,k)}return w}}}var Yr="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Ba({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,te.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,te.jsx)("span",{role:"status",children:r})," ",(0,te.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:vn,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var ke=I(W(),1);function Ka(){let{selection:e,setSelection:t}=le();return(0,ke.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function qa(){let{store:e}=le(),t=wt();return(0,ke.useMemo)(()=>za(e),[e,t])}var ti=new WeakMap;function za(e){let t=ti.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),ti.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function $a(){let{view:e,setView:t}=le();return(0,ke.useMemo)(()=>({view:e,url:J(e),focus:n=>t(o=>Y(o,n)),show:n=>t(o=>Do(o,n)),toggle:n=>t(o=>lt(o,n)),go:n=>t(n)}),[e,t])}var Ee={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;Ee.at=typeof t?.graview=="number"?t.graview:0,Ee.at>Ee.depth&&(Ee.depth=Ee.at),Ee.tell()});var B=I(W(),1),Pn={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},"app-menu":{trigger:"app-menu-open",pane:"app-menu",opens:"press",focus:"into",drawn:["shell","embed","pages"]},inbox:{trigger:"inbox-button",pane:"inbox",opens:"press",focus:"into",drawn:["shell","embed","pages"]},share:{trigger:"app-share-open",pane:"app-share",opens:"press",focus:"into",drawn:["embed"]},"host-actions":{trigger:"host-bar-actions-open",pane:"host-bar-actions",opens:"press",focus:"into",drawn:["shell","embed"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["studio"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},Ua={position:"fixed",inset:"auto",margin:0,zIndex:Eo("popover"),boxSizing:"border-box"},kt=6,ge=8,Ya=e=>typeof e.showPopover=="function";function Ge(e){try{return e.matches(":popover-open")}catch{return!1}}function Za(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function At(e,t,n={}){let o=Za(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),s=r.height-o.bottom-kt-ge,l=o.top-kt-ge,c=a.height<=s||s>=l,u=Math.max(96,Math.floor(c?s:l)),y=Math.min(a.height,u);a.height>u&&(e.style.maxHeight=i?`min(${i}, ${u}px)`:`${u}px`);let g=a.width,m=n.align==="start"?o.left:o.right-g,x=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();x&&g<=x.right-x.left&&(m<x.left?m=o.left+g<=x.right?o.left:x.left:m+g>x.right&&(m=o.right-g>=x.left?o.right-g:x.right-g));let R=g>=r.width-2*ge?Math.max(0,(r.width-g)/2):Math.max(ge,Math.min(m,r.width-ge-g)),p=Math.round(c?o.bottom+kt:Math.max(ge,o.top-kt-y));e.style.left=`${Math.round(R)}px`,e.style.top=`${p}px`;let h=e.getBoundingClientRect();if(Ge(e)&&(Math.abs(h.left-Math.round(R))>2||Math.abs(h.top-p)>2)){let w=e.style.position;e.style.position=w==="absolute"?"fixed":"absolute",e.offsetWidth,e.style.position=w}}function ni(e,t,n,o={}){let r=o.align??"end";(0,B.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Ya(i)&&!Ge(i))try{i.showPopover(),Ja()}catch{}let a=0,s=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>At(i,n,{align:r})))};At(i,n,{align:r});let l=()=>{let u=i.style.top;cancelAnimationFrame(a),a=requestAnimationFrame(()=>{At(i,n,{align:r});let y=Number.parseFloat(u);typeof n=="function"&&Number.isFinite(y)&&y+i.getBoundingClientRect().height<=innerHeight-ge&&(i.style.top=u)})};addEventListener("resize",s),addEventListener("scroll",s,!0);let c=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>l());return c?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",s),removeEventListener("scroll",s,!0),c?.disconnect(),i.isConnected&&Ge(i))try{i.hidePopover()}catch{}}},[t,e,r])}var En=new Set;function Xa(e){return En.add(e),()=>En.delete(e)}function Ja(){for(let e of En)if(!(!e.isConnected||!Ge(e)))try{e.hidePopover(),e.showPopover()}catch{}}var Ae=null,Qa='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function es(e){for(let t of e.querySelectorAll(Qa))if(t.closest("[hidden]")===null&&!t.hasAttribute("data-graview-not-first")&&getComputedStyle(t).visibility!=="hidden")return t;return e}var xn=()=>{let e=document.activeElement;return e===null||e===document.body};function ts(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,s]=(0,B.useState)(!1),l=t.open??a,c=(0,B.useRef)(null),u=(0,B.useRef)(null),y=(0,B.useCallback)(w=>{c.current=w},[]),g=(0,B.useCallback)(w=>{u.current=w},[]),m=`graview-popover-${(0,B.useId)().replace(/:/g,"")}`,x=(0,B.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});x.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let R=(0,B.useCallback)(w=>{x.current.controlled||s(w),x.current.onOpenChange?.(w)},[]),p=(0,B.useCallback)(()=>{(document.querySelector(`[aria-controls="${m}"]`)??c.current??x.current.returnTo?.()??null)?.focus({preventScroll:!0})},[m]),h=(0,B.useCallback)(w=>{let k=u.current,E=typeof document>"u"?null:document.activeElement,K=E===null||E===document.body||k!==null&&k.contains(E);R(!1),!(!w||!K)&&(p(),requestAnimationFrame(()=>{xn()&&p()}))},[R,p]);return ni(u,i&&l,n??c,t.align?{align:t.align}:{}),(0,B.useEffect)(()=>{if(!i||!l)return;let w={name:e,close:()=>h(!1)};if(Ae&&Ae.close!==w.close&&Ae.close(),Ae=w,Pn[e].focus==="into"){let T=u.current;T&&!T.contains(document.activeElement)&&es(T).focus({preventScroll:!0})}let k=T=>{T.key==="Escape"&&h(!0)},E=T=>{let F=T.target;if(!(F instanceof Node))return;let L=u.current;if(L?.contains(F)||c.current?.contains(F))return;let _=F instanceof Element?F.closest('[role="dialog"], [role="alertdialog"]'):null;_&&!(L&&_.contains(L))||(h(!1),Pn[e].focus==="into"&&requestAnimationFrame(()=>{(xn()||L!==null&&L.contains(document.activeElement))&&p()}))},K=null,j=null,G=T=>{let F=T.target;if(!(F instanceof Element))return;let L=u.current,_=F.closest('[role="dialog"], [role="alertdialog"]');!_||L&&(L.contains(_)||_.contains(L))||(K=_,h(!1))};return document.addEventListener("keydown",k),document.addEventListener("pointerdown",E,!0),document.addEventListener("focusin",G),()=>{document.removeEventListener("keydown",k),document.removeEventListener("pointerdown",E,!0),document.removeEventListener("focusin",G);let T=K;T&&typeof MutationObserver<"u"&&(j?.disconnect(),j=new MutationObserver(()=>{T.isConnected||(j?.disconnect(),requestAnimationFrame(()=>{(xn()||document.activeElement.closest("[hidden]")!==null)&&p()}))}),j.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>j?.disconnect(),10*6e4)),Ae?.close===w.close&&(Ae=null)}},[i,l,e,h,p]),{open:l,setOpen:w=>w?R(!0):h(!0),toggle:()=>l?h(!0):R(!0),trigger:{ref:y,"aria-expanded":l,"aria-controls":m,"data-graview-popover-trigger":e},pane:{ref:g,id:m,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var Re=I(W(),1);var ns=bn(ot(()=>(__graviewPreload(import.meta.url,["./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TQF5XCUS.js"))));function os(e,t,n){let o,r=!1,i=()=>{let{hidden:s,removed:l}=t.current();o||r||s.length+l.length===0||(o=()=>{},ns.load().then(c=>{r||(o=c.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function rs(e,t){let[n,o]=(0,Re.useState)();return(0,Re.useEffect)(()=>t?os(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var oi=I(W(),1),is=(0,oi.createContext)(!1);var ri=I(W(),1),as=(0,ri.createContext)(null);var ii=I(W(),1),kn='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',An=e=>e instanceof HTMLElement&&(e.matches(kn)||e.hasAttribute("tabindex")),Fe=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function ss(e,t){let n=l=>l.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let s=e.querySelector(a);return s&&An(s)&&Fe(s)?s:null}var ls=e=>e.isConnected&&An(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Fe(e);function ai(e,t){let n=t?ss(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Fe(o))return o;for(let r of e.querySelectorAll(kn))if(Fe(r))return r;return An(e)&&Fe(e)?e:null}function ds(e){(0,ii.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=p=>{let h=p.target;if(h instanceof Element){n=[];for(let w=h;w&&w!==t.parentElement;w=w.parentElement)n.push(w)}},r=!1,i=!1,a=t.ownerDocument,s=()=>!i&&a.defaultView!==null,l=(p,h)=>void setTimeout(()=>s()&&h(),p),c=p=>void requestAnimationFrame(()=>s()&&p()),u=p=>{if(r=!1,i)return;let h=a.activeElement;if(!(!(h===null||h===a.body||h===a.documentElement)||n.length===0)){if(ls(n[0])){p&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let k of n.slice(1)){if(!k.isConnected)continue;let E=ai(k,n[0]);if(E){E.focus({preventScroll:!0}),n=[];return}}}},y=(p,h=Date.now()+2500)=>{l(100,()=>{u(p);let w=a.activeElement;(w===null||w===a.body||w===a.documentElement)&&n.length>0&&Date.now()<h&&y(p,h)})},g=()=>{r||n.length===0||(r=!0,l(60,()=>c(()=>{u(!1),y(!1)})))},m=p=>{if(!(p instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(p.key))){if(!(p instanceof KeyboardEvent)){let h=p.target instanceof Element?p.target.closest(kn):null,w=a.activeElement,k=w===null||w===a.body||w===a.documentElement;if(h&&k&&t.contains(h)){n=[];for(let E=h;E&&E!==t.parentElement;E=E.parentElement)n.push(E);l(150,()=>c(()=>{u(!1),y(!1)}));return}}!(p instanceof KeyboardEvent)&&!(p.target instanceof Node&&n[0]?.contains(p.target))||l(150,()=>c(()=>{u(!0),y(!0)}))}},x=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&g()}),R=p=>{p.relatedTarget===null&&g()};return t.addEventListener("focusin",o),t.addEventListener("focusout",R),t.addEventListener("click",m),t.addEventListener("keydown",m),x.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",R),t.removeEventListener("click",m),t.removeEventListener("keydown",m),x.disconnect()}},[e])}export{ve as a,J as b,at as c,cs as d,fs as e,Lo as f,Io as g,_o as h,Ft as i,Y as j,Do as k,ie as l,fe as m,st as n,_e as o,lt as p,ut as q,Bt as r,be as s,gs as t,xi as u,ae as v,No as w,pe as x,Wo as y,Pi as z,ms as A,jo as B,Kt as C,Ei as D,ki as E,Ai as F,W as G,en as H,zi as I,Ui as J,rr as K,Os as L,ft as M,Yi as N,pt as O,Zi as P,yt as Q,Xi as R,De as S,ar as T,Ji as U,Qi as V,ea as W,nn as X,on as Y,rn as Z,Ne as _,ca as $,We as aa,fa as ba,pa as ca,Ir as da,Sa as ea,ba as fa,ml as ga,ka as ha,le as ia,gn as ja,wt as ka,Aa as la,Ra as ma,Ta as na,yn as oa,Ca as pa,hn as qa,Dr as ra,Ma as sa,Oa as ta,Wr as ua,jr as va,Gr as wa,Fr as xa,Br as ya,Kr as za,qr as Aa,zr as Ba,$r as Ca,Va as Da,Ha as Ea,Sn as Fa,Ia as Ga,Et as Ha,La as Ia,_a as Ja,Da as Ka,Na as La,Wa as Ma,ja as Na,ei as Oa,Ga as Pa,bn as Qa,rs as Ra,is as Sa,as as Ta,Ka as Ua,qa as Va,$a as Wa,Ee as Xa,ds as Ya,Ua as Za,Ge as _a,ni as $a,Xa as ab,ts as bb};
2
+ /*! Bundled license information:
3
+
4
+ react/cjs/react.production.js:
5
+ (**
6
+ * @license React
7
+ * react.production.js
8
+ *
9
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ *)
14
+
15
+ react/cjs/react-jsx-runtime.production.js:
16
+ (**
17
+ * @license React
18
+ * react-jsx-runtime.production.js
19
+ *
20
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE file in the root directory of this source tree.
24
+ *)
25
+ */
@@ -1 +1 @@
1
- import{G as T}from"./chunk.CUA7F3YJ.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=g(T(),1),m="data-graview-roving",E="data-graview-roving-item",L={ArrowDown:{column:1,both:1},ArrowUp:{column:-1,both:-1},ArrowRight:{column:0,both:1},ArrowLeft:{column:0,both:-1}},w=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&!["button","checkbox","radio","submit"].includes(e.type));function p(e){return[...e.querySelectorAll(`[${E}]`)].filter(c=>c.closest(`[${m}]`)===e&&!c.disabled&&c.getAttribute("aria-hidden")!=="true")}var M=e=>(e.textContent?.trim()||e.getAttribute("aria-label")||"").toLowerCase();function H({flow:e="column",letters:c=!1}={}){let a=(0,s.useRef)(null),i=(0,s.useRef)(null),f=(0,s.useCallback)(()=>{let t=a.current;if(!t)return;let n=p(t);if(n.length===0)return;let o=typeof document>"u"?null:document.activeElement,u=n.find(r=>r===o)??(i.current&&n.includes(i.current)?i.current:n[0]);for(let r of n){let l=r===u?"0":"-1";r.getAttribute("tabindex")!==l&&r.setAttribute("tabindex",l)}},[]);(0,s.useLayoutEffect)(f);let d=t=>{t&&(i.current=t,t.focus(),f())};return{ref:a,[m]:c?"letters":"",onFocus:t=>{let n=t.target.closest?.(`[${E}]`);n&&n.closest(`[${m}]`)===a.current&&i.current!==n&&(i.current=n,f())},onKeyDown:t=>{let n=a.current;if(!n||t.metaKey||t.ctrlKey||t.altKey||w(t.target))return;let o=p(n),u=o.findIndex(l=>l===t.target||l.contains(t.target));if(u<0)return;let r=L[t.key]?.[e];if(r){t.preventDefault(),t.stopPropagation(),d(o[Math.max(0,Math.min(o.length-1,u+r))]);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),t.stopPropagation(),d(t.key==="Home"?o[0]:o[o.length-1]);return}if(c&&t.key.length===1&&t.key.trim()!==""){let l=t.key.toLowerCase(),y=[...o.slice(u+1),...o.slice(0,u+1)].find(b=>M(b).startsWith(l));if(!y)return;t.preventDefault(),t.stopPropagation(),d(y)}}}}export{E as a,H as b};
1
+ import{G as T}from"./chunk.ASNVH2G4.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=g(T(),1),m="data-graview-roving",E="data-graview-roving-item",L={ArrowDown:{column:1,both:1},ArrowUp:{column:-1,both:-1},ArrowRight:{column:0,both:1},ArrowLeft:{column:0,both:-1}},w=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&!["button","checkbox","radio","submit"].includes(e.type));function p(e){return[...e.querySelectorAll(`[${E}]`)].filter(c=>c.closest(`[${m}]`)===e&&!c.disabled&&c.getAttribute("aria-hidden")!=="true")}var M=e=>(e.textContent?.trim()||e.getAttribute("aria-label")||"").toLowerCase();function H({flow:e="column",letters:c=!1}={}){let a=(0,s.useRef)(null),i=(0,s.useRef)(null),f=(0,s.useCallback)(()=>{let t=a.current;if(!t)return;let n=p(t);if(n.length===0)return;let o=typeof document>"u"?null:document.activeElement,u=n.find(r=>r===o)??(i.current&&n.includes(i.current)?i.current:n[0]);for(let r of n){let l=r===u?"0":"-1";r.getAttribute("tabindex")!==l&&r.setAttribute("tabindex",l)}},[]);(0,s.useLayoutEffect)(f);let d=t=>{t&&(i.current=t,t.focus(),f())};return{ref:a,[m]:c?"letters":"",onFocus:t=>{let n=t.target.closest?.(`[${E}]`);n&&n.closest(`[${m}]`)===a.current&&i.current!==n&&(i.current=n,f())},onKeyDown:t=>{let n=a.current;if(!n||t.metaKey||t.ctrlKey||t.altKey||w(t.target))return;let o=p(n),u=o.findIndex(l=>l===t.target||l.contains(t.target));if(u<0)return;let r=L[t.key]?.[e];if(r){t.preventDefault(),t.stopPropagation(),d(o[Math.max(0,Math.min(o.length-1,u+r))]);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),t.stopPropagation(),d(t.key==="Home"?o[0]:o[o.length-1]);return}if(c&&t.key.length===1&&t.key.trim()!==""){let l=t.key.toLowerCase(),y=[...o.slice(u+1),...o.slice(0,u+1)].find(b=>M(b).startsWith(l));if(!y)return;t.preventDefault(),t.stopPropagation(),d(y)}}}}export{E as a,H as b};
@@ -0,0 +1 @@
1
+ import{a as Y,b as F,c as j,d as G}from"./chunk.A4TBVXHQ.js";import"./chunk.7QGDWAHH.js";import"./chunk.YC2IDHQX.js";import"./chunk.GH6QX7JR.js";import"./chunk.J4D4BIB4.js";import{G as V,T as K,U as D,_,ja as B}from"./chunk.ASNVH2G4.js";import"./chunk.SDO3U72B.js";import{W as L,zd as q}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as $}from"./chunk.AJZBJBMO.js";var s=$(V(),1);var a=$(_(),1),Z={kind:"human"},ee=[1,2,4,8],te=900,M={you:"You",person:"A person",agent:"An agent",app:"The app"},U={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function ae(n,t,i){return[...new Set([...i,t,...n.map(r=>r.seq)])].sort((r,l)=>r-l)}function ne(n,t){let i=n.withheld===!0;return{seq:n.seq+1,from:n.seq,at:n.at,batch:n.batch,maker:i?"person":Y(n.author,t),author:i?void 0:n.author,said:n.batchIntent??n.intent,declaration:!1,withheld:i}}function re(n,t){let i=0;for(let r=0;r<n.length;r++)n[r]<=t&&(i=r);return i}function ie(n,t,i){let r=j(n,t);if(r.length===0)return null;let l=n.canUndo(r);if(!l.ok)return null;let f=new Set(n.permittedMutations(i).map(u=>u.name));return l.ops.every(u=>u.mutation!==null&&f.has(u.mutation.name))?r:null}function ce({face:n}){let t=K(),i=B(),r=i?.principal??Z,l=D(t.live,r),f=l.log.length,u=(0,s.useMemo)(()=>F(l,{me:r,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[l,r,t.host,f]),c=l.log.horizon,S=c>0&&t.host?.archived!==void 0,v=t.kept,O=(0,s.useMemo)(()=>S?v?.stops??Array.from({length:c},(e,p)=>p):[],[S,v,c]),g=(0,s.useMemo)(()=>ae(u,c,O),[u,c,O]),h=t.archive,d=h?.seq??t.past?.seq??f,w=t.host?.kept&&(h?.behindKept||v!==void 0&&(d<=v.through||v.from>0&&d<=v.from))?t.host.kept:void 0,b=re(g,d),m=g.length-1,W=d<c&&t.past?.seq===d?t.past.store.log.all().at(-1):void 0,x=W?ne(W,r):d<c?void 0:[...u].reverse().find(e=>e.seq<=d&&e.seq>(g[b-1]??-1))??[...u].reverse().find(e=>e.seq<=d),[k,R]=(0,s.useState)(!1),[T,X]=(0,s.useState)(1),[N,C]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!k)return;if(b>=m){R(!1);return}let e=setTimeout(()=>t.show(g[b+1]),te/T);return()=>clearTimeout(e)},[k,b,m,T,g,t]);let I=(0,s.useMemo)(()=>t.past&&!h&&d>=c?ie(l,d,r):null,[t.past,h,l,d,c,r,f]),z=e=>G(e,{graph:l.graph,schema:l.schema,...i?.seats?{seats:i.seats}:{},...i?.people?{people:i.people}:{}}),y=t.past?t.past.at?L(t.past.at,i?.locale):"the start":null,E=h?h.refused?"The archive could not be read":h.behindKept?"Nothing this far back is kept":"Reading the older changes from the archive\u2026":x?`${z(x)==="you"?"You":z(x)}: ${x.said}`:f===0&&c===0?"No changes yet":"Nothing had happened yet",H=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!t.focusWanted)return;t.focused?.();let e=document.activeElement,p=A.current?.closest("[data-graview-embed]")??document.body,o=e?.closest('[data-testid="app-menu-open"], [data-testid="app-menu"]');(e===null||e===document.body||o&&p.contains(o))&&H.current?.focus({preventScroll:!0})},[t.focusWanted,t]);let A=(0,s.useRef)(null);(0,s.useLayoutEffect)(()=>{let e=A.current,p=e?.parentElement;if(n!=="scene"||!e||!p)return;let o=()=>p.style.setProperty("--graview-sheet",`${Math.ceil(e.getBoundingClientRect().height)+24}px`);o();let P=typeof ResizeObserver>"u"?null:new ResizeObserver(o);return P?.observe(e),()=>{P?.disconnect(),p.style.removeProperty("--graview-sheet")}},[n]);let J=n==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:q("rail")}:{position:"sticky",top:0,zIndex:q("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,a.jsxs)("section",{ref:A,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...J,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,a.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,a.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:h?"Archived changes":y?`As of ${y}`:"Now"}),(0,a.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:E}),y?(0,a.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,a.jsxs)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:[S?(0,a.jsx)("span",{"data-testid":"timeline-archived",title:"Changes read from the archive as you scrub back",style:{position:"absolute",left:0,bottom:0,height:6,width:`${m===0?0:g.indexOf(c)/m*100}%`,borderRadius:2,background:"var(--graview-edge)"}}):null,g.slice(1).map((e,p)=>{let o=[...u].reverse().find(Q=>Q.seq===e);if(!o)return null;let P=m===0?0:(p+1)/m*100;return(0,a.jsx)("span",{"data-graview-tick":e,"data-maker":o.maker,...o.declaration?{"data-declaration":""}:{},title:`${M[o.maker]}: ${o.said}`,style:{position:"absolute",left:`calc(${P}% - 1px)`,bottom:0,width:o.declaration?4:2,height:o.declaration?22:12,borderRadius:2,background:o.declaration?"var(--graview-ink)":U[o.maker],opacity:e<=d?1:.45}},`${e}:${o.batch??"declaration"}`)})]}),(0,a.jsx)("input",{ref:H,type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:m,step:1,value:b,"aria-valuetext":y?`As of ${y}. ${E}`:`Now. ${E}`,onChange:e=>{R(!1),t.show(g[Number(e.currentTarget.value)]??f)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,a.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,a.jsx)("button",{type:"button","data-testid":"play","aria-pressed":k,onClick:()=>{!k&&b>=m&&t.show(g[0]),R(!k)},style:{minHeight:28,minWidth:64},children:k?"Pause":"Play"}),(0,a.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,a.jsx)("select",{"data-testid":"speed",value:T,onChange:e=>X(Number(e.currentTarget.value)),style:{minHeight:28},children:ee.map(e=>(0,a.jsxs)("option",{value:e,children:[e,"\xD7"]},e))})]}),(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(M).filter(e=>u.some(p=>p.maker===e)).map(e=>(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,a.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:U[e]}}),M[e]]},e))}),(0,a.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[I?(0,a.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{C(null);try{l.undo([...I],{author:r,intent:y?`Restore to ${y}`:"Restore"}),t.show(null)}catch(e){C(e instanceof Error?e.message:String(e))}},style:{minHeight:28},children:"Restore to here"}):null,(0,a.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>t.show(null),style:{minHeight:28},children:"Back to now"})]})]}),N?(0,a.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:N}):null,h?.refused?(0,a.jsx)("span",{role:"alert","data-testid":"archive-refused",style:{color:"var(--graview-warn)"},children:h.refused}):null,w?(0,a.jsxs)("span",{"data-testid":"timeline-kept",style:{color:"var(--graview-ink-faint)"},children:[w.sentence,w.action?(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("a",{"data-testid":"timeline-kept-action",href:w.action.href,style:{color:"var(--graview-ink-muted)"},children:w.action.label})]}):null]}):null,c>0&&!S?(0,a.jsx)("span",{"data-testid":"timeline-horizon",style:{color:"var(--graview-ink-faint)"},children:"The changes before the timeline's start were archived."}):null]})}export{ce as Timeline};
@@ -1 +1 @@
1
- import"./chunk.WVUJXDXZ.js";import{b as P}from"./chunk.IRPMGHZN.js";import"./chunk.7QWGIGHM.js";import"./chunk.HRLCDBMO.js";import"./chunk.LZNHTROY.js";import"./chunk.36FKQJFM.js";import"./chunk.RHV73CBA.js";import"./chunk.QILGAV7H.js";import"./chunk.I6HIVTXU.js";import{Aa as T,Ba as E,Ca as L,ya as M}from"./chunk.IUVRJDL3.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function G(r,l,i){let g=r.getAttribute("data-record")??"",m=r.getAttribute("data-field")??"",c=Number(r.getAttribute("data-index")??"0"),e=[...l?.node?[l.node]:[],...l?.nodes??[]].find(p=>p.id===g);if(!g||!e)return{why:g?`names a record it was not shown ("${g.slice(0,80)}")`:"names no record (data-record)"};let h=m&&Object.hasOwn(e,m)?e[m]:void 0,f=(Array.isArray(h)?h:[h]).filter(M),o=Number.isInteger(c)&&c>=0?f[c]:void 0,v=e.label?`"${e.label}"`:"a record";return m?o?(i==="video"?!E(o):!E(o)&&!T(o))?{why:`names "${o.name}" on ${v}, which is not ${i==="video"?"a video":"a picture or a video"}`}:{file:o,on:e}:{why:f.length===0?`names "${m}" on ${v}, which holds no file it was shown`:`names file ${r.getAttribute("data-index")} of "${m}" on ${v}, which holds ${f.length}`}:{why:`names no field of ${v} (data-field)`}}var C=r=>`${r.caption?.trim()||r.name}, ${L(r)}`;function N(r,l,i,g,m,c={}){let e=r.createElement("video");e.setAttribute("data-graview-video",""),e.setAttribute("playsinline",""),e.setAttribute("aria-label",C(i)),c.autoplay?(e.setAttribute("data-graview-video-autoplay",""),e.setAttribute("muted",""),e.muted=!0,e.setAttribute("loop",""),e.setAttribute("preload",c.still?"metadata":"auto"),c.still?e.setAttribute("data-graview-video-still",""):e.setAttribute("autoplay","")):(e.setAttribute("controls",""),e.setAttribute("preload","metadata"));let h=i.poster?g(i.poster):void 0;h&&e.setAttribute("poster",h),i.width&&i.height?(e.setAttribute("width",String(i.width)),e.setAttribute("height",String(i.height)),e.style.aspectRatio=`${i.width} / ${i.height}`):e.style.aspectRatio="16 / 9",c.cover?(e.setAttribute("data-graview-video-cover",""),e.style.cssText+=";display:block;width:100%;height:100%;max-height:none;aspect-ratio:auto;object-fit:cover;background:#000"):e.style.cssText+=";display:block;width:100%;height:auto;max-height:80vh;background:#000;border-radius:var(--graview-radius, 8px)";let f=i.captions?g(i.captions):void 0;if(f){let o=r.createElement("track");o.setAttribute("kind","captions"),o.setAttribute("src",f),o.setAttribute("srclang","en"),o.setAttribute("label","Captions"),o.setAttribute("default",""),e.appendChild(o)}return i.duration===void 0&&e.addEventListener("loadedmetadata",()=>Number.isFinite(e.duration)&&e.duration>0&&e.setAttribute("aria-label",C({...i,duration:e.duration}))),e.setAttribute("src",m),l.appendChild(e),e}function S(r,l){let i=r.document,g=new Set,m=t=>{g.has(t)||(g.add(t),l.onProblem?.(t))},c=t=>{let a=l.file?l.file(t):t;if(a!==void 0)try{let s=new r.URL(a,i.baseURI);return s.origin===r.location.origin&&/^https?:$/.test(s.protocol)?a:void 0}catch{return}},e=new WeakMap,h=typeof r.matchMedia=="function"?r.matchMedia("(prefers-reduced-motion: reduce)"):void 0,f=new Set,o=(t,a)=>{a?(t.removeAttribute("autoplay"),t.setAttribute("data-graview-video-still",""),t.pause()):(t.removeAttribute("data-graview-video-still"),t.setAttribute("autoplay",""),t.setAttribute("preload","auto"),t.play?.()?.catch?.(()=>{}))},v=()=>{for(let t of f)t.isConnected?o(t,h?.matches===!0):f.delete(t)};h?.addEventListener?.("change",v);let p,k=t=>{if(typeof t.close=="function")return t.close();t.removeAttribute("open"),t.dispatchEvent(new r.Event("close"))},w=(t,a)=>m(`The ${t} in the view ${l.view} was not drawn: it ${a}.`);return{refresh(t){let a=l.shown();for(let s of Array.from(t.querySelectorAll("graview-video"))){let d=s.shadowRoot??s.attachShadow({mode:"open"});if(!l.pictures){e.delete(s),d.replaceChildren(),w("video",`asks for no pictures: a view places a record's video where its manifest says "pictures": true`);continue}let u=G(s,a,"video"),n={autoplay:s.hasAttribute("autoplay"),cover:s.hasAttribute("cover"),still:h?.matches===!0},b="file"in u?JSON.stringify([u.file,n.autoplay,n.cover]):"";if(e.get(s)===b&&d.childNodes.length>0)continue;if(e.set(s,b),d.replaceChildren(),"why"in u){w("video",u.why);continue}let A=c(u.file.href);if(!A){w("video",`names "${u.file.name}", which this host does not say it serves on this page`);continue}let $=i.createElement("style");$.textContent=":host { display: block; min-width: 0; }",d.appendChild($);let y=N(i,d,u.file,c,A,n);n.autoplay&&f.add(y)}},open(t){if(!l.pictures)return w("full-screen viewer",`asks for no pictures: a view opens a record's picture or video full screen where its manifest says "pictures": true`),!1;let a=G(t,l.shown(),"any");if("why"in a)return w("full-screen viewer",a.why),!1;let s=c(a.file.href);if(!s)return w("full-screen viewer",`names "${a.file.name}", which this host does not say it serves on this page`),!1;p&&k(p);let d=a.file,u=d.caption?.trim()||d.name,n=i.createElement("dialog");n.setAttribute("data-graview-lightbox",""),n.setAttribute("aria-label",E(d)?C(d):u),n.style.cssText="padding:0;border:0;border-radius:var(--graview-radius, 8px);max-width:min(96vw, 1600px);max-height:94vh;background:var(--graview-panel, Canvas);color:var(--graview-ink, CanvasText)";let b=i.createElement("figure");if(b.style.cssText="margin:0;display:grid;gap:8px;padding:10px",E(d))N(i,b,d,c,s);else{let x=i.createElement("img");x.setAttribute("src",s),x.setAttribute("alt",u),x.style.cssText="max-width:100%;max-height:80vh;object-fit:contain;display:block;margin:0 auto",b.appendChild(x)}let A=i.createElement("figcaption");A.style.cssText="display:flex;gap:12px;align-items:center;justify-content:space-between";let $=i.createElement("span");$.textContent=E(d)&&d.duration!==void 0?`${u} \xB7 ${P(d.duration)}`:u;let y=i.createElement("button");return y.type="button",y.textContent="Close",y.addEventListener("click",()=>k(n)),A.append($,y),b.appendChild(A),n.appendChild(b),n.addEventListener("click",x=>x.target===n&&k(n)),n.addEventListener("close",()=>{n.remove(),p===n&&(p=void 0),t.focus?.()}),i.body.appendChild(n),p=n,typeof n.showModal=="function"?n.showModal():n.setAttribute("open",""),y.focus(),!0},dispose(){p&&k(p),p?.remove(),p=void 0,h?.removeEventListener?.("change",v),f.clear()}}}export{S as createGuestMedia,G as namedFile};
1
+ import"./chunk.WVUJXDXZ.js";import{b as P}from"./chunk.J7GH2CGV.js";import"./chunk.SMF5S4DQ.js";import"./chunk.XP4IVKKR.js";import"./chunk.R5YGW5ZX.js";import"./chunk.QMGBAKX6.js";import"./chunk.PS765ODQ.js";import"./chunk.45OLF6BK.js";import"./chunk.T6ISUVUP.js";import{Aa as T,Ba as E,Ca as L,ya as M}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function G(r,l,i){let g=r.getAttribute("data-record")??"",m=r.getAttribute("data-field")??"",c=Number(r.getAttribute("data-index")??"0"),e=[...l?.node?[l.node]:[],...l?.nodes??[]].find(p=>p.id===g);if(!g||!e)return{why:g?`names a record it was not shown ("${g.slice(0,80)}")`:"names no record (data-record)"};let h=m&&Object.hasOwn(e,m)?e[m]:void 0,f=(Array.isArray(h)?h:[h]).filter(M),o=Number.isInteger(c)&&c>=0?f[c]:void 0,v=e.label?`"${e.label}"`:"a record";return m?o?(i==="video"?!E(o):!E(o)&&!T(o))?{why:`names "${o.name}" on ${v}, which is not ${i==="video"?"a video":"a picture or a video"}`}:{file:o,on:e}:{why:f.length===0?`names "${m}" on ${v}, which holds no file it was shown`:`names file ${r.getAttribute("data-index")} of "${m}" on ${v}, which holds ${f.length}`}:{why:`names no field of ${v} (data-field)`}}var C=r=>`${r.caption?.trim()||r.name}, ${L(r)}`;function N(r,l,i,g,m,c={}){let e=r.createElement("video");e.setAttribute("data-graview-video",""),e.setAttribute("playsinline",""),e.setAttribute("aria-label",C(i)),c.autoplay?(e.setAttribute("data-graview-video-autoplay",""),e.setAttribute("muted",""),e.muted=!0,e.setAttribute("loop",""),e.setAttribute("preload",c.still?"metadata":"auto"),c.still?e.setAttribute("data-graview-video-still",""):e.setAttribute("autoplay","")):(e.setAttribute("controls",""),e.setAttribute("preload","metadata"));let h=i.poster?g(i.poster):void 0;h&&e.setAttribute("poster",h),i.width&&i.height?(e.setAttribute("width",String(i.width)),e.setAttribute("height",String(i.height)),e.style.aspectRatio=`${i.width} / ${i.height}`):e.style.aspectRatio="16 / 9",c.cover?(e.setAttribute("data-graview-video-cover",""),e.style.cssText+=";display:block;width:100%;height:100%;max-height:none;aspect-ratio:auto;object-fit:cover;background:#000"):e.style.cssText+=";display:block;width:100%;height:auto;max-height:80vh;background:#000;border-radius:var(--graview-radius, 8px)";let f=i.captions?g(i.captions):void 0;if(f){let o=r.createElement("track");o.setAttribute("kind","captions"),o.setAttribute("src",f),o.setAttribute("srclang","en"),o.setAttribute("label","Captions"),o.setAttribute("default",""),e.appendChild(o)}return i.duration===void 0&&e.addEventListener("loadedmetadata",()=>Number.isFinite(e.duration)&&e.duration>0&&e.setAttribute("aria-label",C({...i,duration:e.duration}))),e.setAttribute("src",m),l.appendChild(e),e}function S(r,l){let i=r.document,g=new Set,m=t=>{g.has(t)||(g.add(t),l.onProblem?.(t))},c=t=>{let a=l.file?l.file(t):t;if(a!==void 0)try{let s=new r.URL(a,i.baseURI);return s.origin===r.location.origin&&/^https?:$/.test(s.protocol)?a:void 0}catch{return}},e=new WeakMap,h=typeof r.matchMedia=="function"?r.matchMedia("(prefers-reduced-motion: reduce)"):void 0,f=new Set,o=(t,a)=>{a?(t.removeAttribute("autoplay"),t.setAttribute("data-graview-video-still",""),t.pause()):(t.removeAttribute("data-graview-video-still"),t.setAttribute("autoplay",""),t.setAttribute("preload","auto"),t.play?.()?.catch?.(()=>{}))},v=()=>{for(let t of f)t.isConnected?o(t,h?.matches===!0):f.delete(t)};h?.addEventListener?.("change",v);let p,k=t=>{if(typeof t.close=="function")return t.close();t.removeAttribute("open"),t.dispatchEvent(new r.Event("close"))},w=(t,a)=>m(`The ${t} in the view ${l.view} was not drawn: it ${a}.`);return{refresh(t){let a=l.shown();for(let s of Array.from(t.querySelectorAll("graview-video"))){let d=s.shadowRoot??s.attachShadow({mode:"open"});if(!l.pictures){e.delete(s),d.replaceChildren(),w("video",`asks for no pictures: a view places a record's video where its manifest says "pictures": true`);continue}let u=G(s,a,"video"),n={autoplay:s.hasAttribute("autoplay"),cover:s.hasAttribute("cover"),still:h?.matches===!0},b="file"in u?JSON.stringify([u.file,n.autoplay,n.cover]):"";if(e.get(s)===b&&d.childNodes.length>0)continue;if(e.set(s,b),d.replaceChildren(),"why"in u){w("video",u.why);continue}let A=c(u.file.href);if(!A){w("video",`names "${u.file.name}", which this host does not say it serves on this page`);continue}let $=i.createElement("style");$.textContent=":host { display: block; min-width: 0; }",d.appendChild($);let y=N(i,d,u.file,c,A,n);n.autoplay&&f.add(y)}},open(t){if(!l.pictures)return w("full-screen viewer",`asks for no pictures: a view opens a record's picture or video full screen where its manifest says "pictures": true`),!1;let a=G(t,l.shown(),"any");if("why"in a)return w("full-screen viewer",a.why),!1;let s=c(a.file.href);if(!s)return w("full-screen viewer",`names "${a.file.name}", which this host does not say it serves on this page`),!1;p&&k(p);let d=a.file,u=d.caption?.trim()||d.name,n=i.createElement("dialog");n.setAttribute("data-graview-lightbox",""),n.setAttribute("aria-label",E(d)?C(d):u),n.style.cssText="padding:0;border:0;border-radius:var(--graview-radius, 8px);max-width:min(96vw, 1600px);max-height:94vh;background:var(--graview-panel, Canvas);color:var(--graview-ink, CanvasText)";let b=i.createElement("figure");if(b.style.cssText="margin:0;display:grid;gap:8px;padding:10px",E(d))N(i,b,d,c,s);else{let x=i.createElement("img");x.setAttribute("src",s),x.setAttribute("alt",u),x.style.cssText="max-width:100%;max-height:80vh;object-fit:contain;display:block;margin:0 auto",b.appendChild(x)}let A=i.createElement("figcaption");A.style.cssText="display:flex;gap:12px;align-items:center;justify-content:space-between";let $=i.createElement("span");$.textContent=E(d)&&d.duration!==void 0?`${u} \xB7 ${P(d.duration)}`:u;let y=i.createElement("button");return y.type="button",y.textContent="Close",y.addEventListener("click",()=>k(n)),A.append($,y),b.appendChild(A),n.appendChild(b),n.addEventListener("click",x=>x.target===n&&k(n)),n.addEventListener("close",()=>{n.remove(),p===n&&(p=void 0),t.focus?.()}),i.body.appendChild(n),p=n,typeof n.showModal=="function"?n.showModal():n.setAttribute("open",""),y.focus(),!0},dispose(){p&&k(p),p?.remove(),p=void 0,h?.removeEventListener?.("change",v),f.clear()}}}export{S as createGuestMedia,G as namedFile};
@@ -1,4 +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 Qe,b as Xe,c as Je,d as rt,e as it,h as Ze,i as ea,k as aa,n as ta,o as ra,p as ia}from"./chunk.3ZP6IDUC.js";import{c as je}from"./chunk.2QALBEWP.js";import{g as Ja,h as et,i as at}from"./chunk.WAIIXXVI.js";import"./chunk.BJ3G7J2Z.js";import{b as Ya,c as ja,d as Ye,e as Qa}from"./chunk.KP7HUXH5.js";import"./chunk.FUTSLXWN.js";import{m as Ee,q as _a,r as Ua,s as Va}from"./chunk.MZSWWMX6.js";import{a as Za}from"./chunk.HJCQ6I3S.js";import{b as Xa}from"./chunk.4QBW46XV.js";import"./chunk.U5Q7EVZQ.js";import{c as Ka}from"./chunk.4O3STSC4.js";import"./chunk.VKQONZKR.js";import{b as _e,d as Ue,e as Ve}from"./chunk.FXCKKVT5.js";import"./chunk.U5P23GO7.js";import"./chunk.LEZGBHPZ.js";import{b as Ge}from"./chunk.O2XPLDMM.js";import"./chunk.CM7EDQ4E.js";import"./chunk.SUYYDJGZ.js";import"./chunk.YR7DKU5T.js";import"./chunk.X7HMTN3Z.js";import"./chunk.YTRUZ56A.js";import"./chunk.MYR36HW4.js";import"./chunk.5IM2X3VT.js";import"./chunk.BIDL7GQD.js";import"./chunk.NKUNCQB3.js";import"./chunk.HMV4ILAC.js";import"./chunk.XAN7QXMQ.js";import{i as tt}from"./chunk.T4QRIJE4.js";import"./chunk.RIP2SAQ5.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.ZBK3FCVE.js";import"./chunk.DW6KXAUM.js";import"./chunk.MR776WQ2.js";import"./chunk.HRLCDBMO.js";import"./chunk.LZNHTROY.js";import"./chunk.36FKQJFM.js";import"./chunk.RHV73CBA.js";import"./chunk.MIE4TJRW.js";import{c as Ba,d as Da,e as ue,p as Wa}from"./chunk.RP6C2IUM.js";import"./chunk.RD2FSSLV.js";import"./chunk.T552MHMU.js";import"./chunk.ZGJUCVT5.js";import"./chunk.CVVNHQPO.js";import"./chunk.YIDNZTON.js";import"./chunk.QILGAV7H.js";import"./chunk.I6HIVTXU.js";import{L as Ga,e as Ha,f as Oa,m as qe,q as Fa,x as qa}from"./chunk.PYGNO2AV.js";import{b as Ta,c as Ct}from"./chunk.3HFBHLXC.js";import{$a as Ia,G as _,Oa as Ae,Ta as Pa,Ua as U,Xa as Na,Y as A,da as za,fa as Ma,ga as T,i as Ke,ia as Ce,j as Se,m as ee,n as $e,o as Fe,r as ge,ra as La,x as Ea,y as ve,z as Ra}from"./chunk.CUA7F3YJ.js";import{a as ie}from"./chunk.SDO3U72B.js";import{Xc as Aa,Z as re,oa as $a,pa as ke,qa as G,va as Ca,xd as H,zd as B}from"./chunk.IUVRJDL3.js";import"./chunk.FQLNBIQ5.js";import{b as f}from"./chunk.AJZBJBMO.js";function At(e){return`
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 Qe,b as Xe,c as Je,d as rt,e as it,h as Ze,i as ea,k as aa,n as ta,o as ra,p as ia}from"./chunk.IZUAZ6EV.js";import{c as je}from"./chunk.THLT6NVO.js";import{g as Ja,h as et,i as at}from"./chunk.HIIYDKFC.js";import"./chunk.YF5GCOSZ.js";import{b as Ya,c as ja,d as Ye,e as Qa}from"./chunk.WAPY4RCS.js";import"./chunk.JMXBMLKH.js";import{m as Ee,q as _a,r as Ua,s as Va}from"./chunk.PVAYYFT2.js";import{a as Za}from"./chunk.HJCQ6I3S.js";import{b as Xa}from"./chunk.QNFX5VHW.js";import"./chunk.UXW43HNW.js";import{c as Ka}from"./chunk.VE4AQFLW.js";import"./chunk.LPWANRBL.js";import{b as _e,d as Ue,e as Ve}from"./chunk.3BE4SHZD.js";import"./chunk.U5P23GO7.js";import"./chunk.SNDFIJVX.js";import{b as Ge}from"./chunk.2TTKQAWQ.js";import"./chunk.CJHCUHVN.js";import"./chunk.MFNWHXGL.js";import"./chunk.DCIYOZYP.js";import"./chunk.A4TBVXHQ.js";import"./chunk.7QGDWAHH.js";import"./chunk.YC2IDHQX.js";import"./chunk.JP33TNCH.js";import"./chunk.BIDL7GQD.js";import"./chunk.O5P6LXHF.js";import"./chunk.VGQDPEB5.js";import"./chunk.WIVNFOQR.js";import{i as tt}from"./chunk.HCHGKI64.js";import"./chunk.65SI77M7.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.7DCBIMOI.js";import"./chunk.GXK5PI7I.js";import"./chunk.DYPSFTRP.js";import"./chunk.XP4IVKKR.js";import"./chunk.R5YGW5ZX.js";import"./chunk.QMGBAKX6.js";import"./chunk.PS765ODQ.js";import"./chunk.MIE4TJRW.js";import{c as Ba,d as Da,e as ue,p as Wa}from"./chunk.DEBW4FH6.js";import"./chunk.RD2FSSLV.js";import"./chunk.OWHH7JDV.js";import"./chunk.T3RFZ66S.js";import"./chunk.TDWJU6GW.js";import"./chunk.P3Z4ZCL3.js";import"./chunk.45OLF6BK.js";import"./chunk.T6ISUVUP.js";import{L as Ga,e as Ha,f as Oa,m as qe,q as Fa,x as qa}from"./chunk.GH6QX7JR.js";import{b as Ta,c as Ct}from"./chunk.J4D4BIB4.js";import{G as _,Qa as Ae,Va as Pa,Wa as U,Za as Na,_ as A,bb as Ia,fa as za,ha as Ma,i as Ke,ia as T,j as Se,ka as Ce,m as ee,n as $e,o as Fe,r as ge,ta as La,x as Ea,y as ve,z as Ra}from"./chunk.ASNVH2G4.js";import{a as ie}from"./chunk.SDO3U72B.js";import{Xc as Aa,Z as re,oa as $a,pa as ke,qa as G,va as Ca,xd as H,zd as B}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as f}from"./chunk.AJZBJBMO.js";function At(e){return`
2
2
 
3
3
 
4
4
  .graview-altitude-control {
@@ -1136,6 +1136,6 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
1136
1136
  }
1137
1137
  [data-graview-connector][data-graview-activity] {
1138
1138
  animation: graview-relation 1200ms cubic-bezier(0.22, 1, 0.36, 1);
1139
- }`}function na(e="dark",o={}){let d=At(e);return o.scope===void 0?d:Ta(d,o.scope)}var I=f(_(),1);var V=f(A(),1),Et=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.PYGNO2AV.js","./chunk.3HFBHLXC.js","./chunk.CUA7F3YJ.js","./chunk.SDO3U72B.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.NTAC5NNE.js")))).part(e=>(0,V.jsx)(e.MapKey,{}),{quiet:!0});function oa(){let{store:e}=T(),{view:o}=U(),d=Ce(),s=(0,I.useMemo)(()=>e.graph.allEdges().length>0,[e,d]),[n,m]=(0,I.useState)(!1),v=(0,I.useId)(),g=(0,I.useRef)(null),y=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!n)return;let b=k=>{let w=k.target;w&&(y.current?.contains(w)||g.current?.contains(w))||m(!1)};return document.addEventListener("pointerdown",b,!0),()=>document.removeEventListener("pointerdown",b,!0)},[n]);let[S,c]=(0,I.useState)(null);return(0,I.useEffect)(()=>{let b=g.current?.parentElement?.parentElement?.querySelector('[data-testid="overview"]');if(!b||typeof ResizeObserver>"u")return;let k=()=>c(Math.ceil(b.getBoundingClientRect().width));k();let w=new ResizeObserver(k);return w.observe(b),()=>w.disconnect()},[s]),s?(0,V.jsxs)("div",{style:{display:"contents"},onKeyDown:b=>{b.key!=="Escape"||!n||(b.preventDefault(),b.stopPropagation(),m(!1),g.current?.focus({preventScroll:!0}))},children:[(0,V.jsx)("button",{ref:g,type:"button","data-testid":"lines-key",className:"graview-lines-key","data-graview-up-row":o.overview?void 0:"","aria-expanded":n,"aria-controls":v,title:"What the lines mean",onClick:()=>m(b=>!b),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",...S!==null?{"--graview-up-room":`${S}px`}:{}},children:"Key"}),n?(0,V.jsxs)("div",{ref:y,id:v,"data-testid":"lines-key-pane",className:"graview-lines-key-pane","data-graview-up-row":o.overview?void 0:"","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("rail"),width:it,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[o.overview?(0,V.jsx)(Et,{}):null,(0,V.jsx)(rt,{inside:!0,widthOf:Za})]}):null]}):null}var Te=f(_(),1),Re=f(A(),1);function nt(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Rt=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.WAIIXXVI.js","./chunk.DIVANC3G.js","./chunk.KP7HUXH5.js","./chunk.FUTSLXWN.js","./chunk.MZSWWMX6.js","./chunk.HJCQ6I3S.js","./chunk.4QBW46XV.js","./chunk.U5Q7EVZQ.js","./chunk.2T24FYAO.js","./chunk.JEQ6CA5M.js","./chunk.SUYYDJGZ.js","./chunk.YR7DKU5T.js","./chunk.5IM2X3VT.js","./chunk.BIDL7GQD.js","./chunk.NKUNCQB3.js","./chunk.HMV4ILAC.js","./chunk.XAN7QXMQ.js","./chunk.Q5WEOX3Q.js","./chunk.ZBK3FCVE.js","./chunk.DW6KXAUM.js","./chunk.MR776WQ2.js","./chunk.WVUJXDXZ.js","./chunk.IRPMGHZN.js","./chunk.7QWGIGHM.js","./chunk.HRLCDBMO.js","./chunk.LZNHTROY.js","./chunk.36FKQJFM.js","./chunk.RHV73CBA.js","./chunk.MIE4TJRW.js","./chunk.RP6C2IUM.js","./chunk.RD2FSSLV.js","./chunk.T552MHMU.js","./chunk.ZGJUCVT5.js","./chunk.CVVNHQPO.js","./chunk.YIDNZTON.js","./chunk.QILGAV7H.js","./chunk.I6HIVTXU.js","./chunk.PYGNO2AV.js","./chunk.3HFBHLXC.js","./chunk.CUA7F3YJ.js","./chunk.SDO3U72B.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UJM5EZDM.js")))),Tt=Rt.part((e,o)=>(0,Re.jsx)(e.MapPanelFor,{showing:o.showing}),{what:"This panel",quiet:!0});function sa(){let{store:e,view:o,selection:d,hiddenKinds:s,seatTalk:n}=T();Ce();let m=(0,Te.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1);if(!o.overview||m)return null;let v=nt(Xa(d,{...o,beside:!0},g=>e.graph.getNode(g)?.kind));return!v||v.what!=="record"&&(s.has(v.kind)||!e.schema.kinds.includes(v.kind))?null:(0,Re.jsx)(Te.Suspense,{fallback:null,children:(0,Re.jsx)(Tt,{showing:v})})}var zt=f(_(),1);var D=f(A(),1);function da(){let{view:e,go:o}=U(),{store:d,views:s,hiddenKinds:n}=T(),m=e.overview??!1,v=s.places().map(k=>k.kind).filter(k=>!n.has(k)),g=Ga(e,d.schema.kinds,v),y=()=>{o(Se(ee(e,!1),g))},S=(()=>{if(!g)return null;let k=Ea(g)[0],w=e.within?.view,R=(w?s.places().find(P=>P.as===w):void 0)??(k?s.places().filter(P=>P.kind===k).at(-1):void 0);return R?R.title:k?G(d.schema,k):d.graph.getNode(g)?.label??null})(),c=m?"Close the map":"Up",b=m&&S?`Close the map, down to ${S}`:c;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":m,"aria-label":b,title:m?b:"Up \u2014 everything, from above",onClick:()=>m?y():o(ee(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":m?1:0,...m?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:c})]})}var la=f(A(),1);function ca(){let{administered:e}=T(),{view:o,go:d}=U(),s=e.filter(n=>n.canShow);return s.length===0?null:(0,la.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(n=>(0,la.jsx)("button",{type:"button","aria-pressed":n.shown,"data-testid":`show-${n.name}`,title:n.shown?`Hide the ${n.name}'s own districts again`:n.description??`Show the ${n.name}'s own districts beside the domain`,onClick:()=>d(Ya(o,n.name,!n.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:n.shown?"var(--graview-accent)":"var(--graview-edge)",color:n.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:n.shown?"var(--graview-panel)":"transparent"},children:n.shown?`Hide the ${n.name}`:`Show the ${n.name}`},n.name))})}var u=f(_(),1);var t=f(A(),1);za({search:Ua,touchWeights:_a});var ne=e=>e!==void 0&&"act"in e,ze=e=>e!==void 0&&"hit"in e&&e.hit.about==="node"?e:void 0,Mt=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Lt(e){let o=()=>typeof window>"u"||window.innerWidth>=qt,[d,s]=(0,u.useState)(o);return(0,u.useEffect)(()=>{let n=()=>s(o());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),d&&!e}function lt({compact:e=!1}){let{store:o,view:d,setView:s,principal:n,setMenuAt:m,brand:v,aiDesk:g,selection:y}=T(),S=Oa(g),c=Ma(),b=Pa(),k=Wa().marks.flag,w=Lt(e),R=(0,u.useRef)(null),P=(0,u.useRef)(null),z=(0,u.useRef)(null),W=(0,u.useId)(),[Le,N]=(0,u.useState)(!1),[K,oe]=(0,u.useState)(null),[ht,fe]=(0,u.useState)(null),[Pe,he]=(0,u.useState)([]),M=d.q??"";(0,u.useEffect)(()=>{let a=r=>{if(r.defaultPrevented)return;let i=r.key.toLowerCase()==="k"&&(r.metaKey||r.ctrlKey)&&!r.altKey&&!r.shiftKey,l=r.key==="/"&&!r.metaKey&&!r.ctrlKey&&!r.altKey;if(!i&&!l)return;let p=R.current;if(!p)return;let h=p.closest("[data-graview-embed]"),C=r.target,J=C===document.body||C===document.documentElement||C===window;if(h&&!(i&&J||C instanceof Node&&h.contains(C)))return;let Z=document.activeElement,pe=Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLSelectElement||Z instanceof HTMLElement&&Z.isContentEditable;l&&pe||(r.preventDefault(),p.getClientRects().length===0&&p.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),p.focus({preventScroll:!0}),p.select(),N(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Ne=(0,u.useMemo)(()=>{let a=new Map;for(let[i,l]of(c?.hits??[]).entries()){if(l.about==="act")continue;let p=Mt(l),h=a.get(p)??[];h.push({id:`${W}-${i}`,hit:l}),a.set(p,h)}let r=[...a.values()].filter(i=>i.some(l=>l.hit.about==="node")).length>1;return[...a.entries()].map(([i,l])=>{let p=0,h=l.filter(pe=>pe.hit.about!=="node"||!r||++p<=Wt),C=h.filter(pe=>pe.hit.about==="node").length,J=i.endsWith(":")?l.length:c?.byKind[i]??C,Z=!i.endsWith(":")&&C>0&&J>C?{id:`${W}-all-${i}`,all:i,count:J}:null;return{key:i,rows:h,count:J,more:Z}})},[c,W]),ae=S&&M.trim()?{id:`${W}-ask`,ask:M.trim()}:null,$=(0,u.useMemo)(()=>[...Ne.flatMap(a=>a.more?[...a.rows,a.more]:a.rows),...ae?[ae]:[]],[Ne,ae?.ask]),fa=(c?.hits??[]).filter(a=>a.about==="node").length,be=c?.words??M,Ie=(0,u.useMemo)(()=>Ee(be).split(" ").filter(Boolean),[be]),F=(0,u.useCallback)(a=>a.hit.about==="node"?Va(o,a.hit.id,be,{principal:n,limit:Kt}).map((r,i)=>({id:`${a.id}-act-${i}`,act:r,of:a.id})):[],[o,be,n]),He=$.find(a=>a.id===K),q=$.find(a=>a.id===ht)??He??$[0],se=(0,u.useMemo)(()=>w&&ze(q)?F(q):[],[w,q?.id,F]),xe=(0,u.useMemo)(()=>w?new Map:new Map(Pe.flatMap(a=>{let r=ze($.find(i=>i.id===a));return r?[[a,F(r)]]:[]})),[w,Pe,$,F]),bt=(0,u.useMemo)(()=>w?new Set:new Set($.flatMap(a=>ze(a)&&F(a).length>0?[a.id]:[])),[w,$,F]),Oe=(0,u.useMemo)(()=>w?se:[...xe.values()].flat(),[w,se,xe]),L=He??Oe.find(a=>a.id===K)??$[0];(0,u.useEffect)(()=>{oe(null),fe(null),he([])},[M]);let de=(0,u.useRef)(null);(0,u.useEffect)(()=>{let a=de.current;if(!a)return;de.current=null;let r=0,i=()=>{let l=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),p=document.activeElement;if(!(!p||p===document.body||p===document.documentElement||p===R.current||p===z.current||p===l))return;let C=[...l?.querySelectorAll('[role="group"][aria-label="Arrange"] :is(button, input)')??[]].find(J=>J.checkVisibility?.()??!0);if(C)return C.focus({preventScroll:!0});l&&l.tabIndex>=0&&p!==l&&l.focus({preventScroll:!0}),++r<240?requestAnimationFrame(i):document.activeElement===z.current&&z.current?.blur()};requestAnimationFrame(i)},[d]);let Be=(a,r)=>{let i=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`);if(i&&i.tabIndex>=0)return i.focus({preventScroll:!0});let l=z.current;if(!l)return R.current?.blur();l.setAttribute("aria-label",r),l.focus({preventScroll:!0})},ha=(0,u.useRef)({x:Number.NaN,y:Number.NaN,moved:!1});(0,u.useEffect)(()=>{let a=r=>{let i=ha.current;i.moved=r.clientX!==i.x||r.clientY!==i.y,i.x=r.clientX,i.y=r.clientY};return window.addEventListener("mousemove",a,{capture:!0,passive:!0}),()=>window.removeEventListener("mousemove",a,{capture:!0})},[]);let le=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>clearTimeout(le.current),[]);let te=a=>{a&&(clearTimeout(le.current),oe(a.id),ne(a)||fe(a.id))},ba=a=>{if(!ha.current.moved)return;let r=a.target.closest?.('[role="option"]')?.id;if(!r||r===K)return;let i=$.find(l=>l.id===r)??Oe.find(l=>l.id===r);i&&(oe(i.id),!ne(i)&&(clearTimeout(le.current),le.current=setTimeout(()=>fe(i.id),Ft)))},xt=()=>{clearTimeout(le.current),q&&!ne(L)&&oe(q.id)},yt=a=>he(r=>r.includes(a.id)?r.filter(i=>i!==a.id):[...r,a.id]),xa=a=>{let r=P.current,i=r?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,l=r?.clientHeight??0;return Math.min(a,i>0&&l>0?Math.max(1,Math.floor(l/i)-1):Bt)};(0,u.useEffect)(()=>{K&&document.getElementById(K)?.scrollIntoView?.({block:"nearest"})},[K]);let De=a=>{if(!a)return;if("ask"in a){Ha(g,{pointed:{...y[0]!==void 0?{on:y[0]}:{},about:y},asked:a.ask}),s(i=>Ye(i)),N(!1);return}if("all"in a)return s(i=>ve(ee(i,!1),ge(a.all),{ownPicture:!0,...i.q?{carry:i.q}:{}})),de.current=a.all,N(!1),Be(a.all,`Opening ${G(o.schema,a.all)} matching \u201C${M.trim()}\u201D\u2026`);if(ne(a)){let i=a.act.subject;s(p=>$e(p,[i]));let l=R.current?.getBoundingClientRect();m({x:l?.left??0,y:(l?.bottom??0)+6,on:i}),N(!1),R.current?.blur();return}let r=a.hit;switch(r.about){case"node":s(i=>$e(Se(ee(i,!1),r.id),[r.id]));break;case"kind":return s(i=>ve(ee(i,!1),ge(r.kind),{ownPicture:!0})),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.label}\u2026`);case"place":return s(i=>Ra(i,r.kind,r.as)),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.title}\u2026`);case"rule":{let i=b.filter(l=>l.invariant===r.name).flatMap(l=>l.nodeIds);s(l=>$e(l,[...new Set(i)]));break}case"act":break}N(!1),R.current?.blur()},kt=c?Ot(c.byKind,c.hits,o.schema):"",ce=Le&&M.trim().length>0,St=(0,u.useCallback)(()=>{let a=R.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Vt};let r=R.current?.getBoundingClientRect();return r?{x:r.right,y:r.bottom}:null},[]),ya=Ia("find",{open:ce,onOpenChange:a=>{a||N(!1)},...e?{at:St}:{}}),ye=$.every(a=>"ask"in a),ka=a=>ne(a)?Oe.filter(r=>r.of===a.of):[],$t=a=>{let r=ne(L)&&K!==null,i=r?$.find(p=>p.id===L.of):K!==null?He:void 0,l=i?$.indexOf(i):-1;if(a.key==="ArrowDown"){if(a.preventDefault(),N(!0),r){let p=ka(L),h=p.indexOf(L)+1;if(h<p.length)return te(p[h]);if(w)return}te($[Math.min($.length-1,l+1)])}else if(a.key==="ArrowUp"){if(a.preventDefault(),r){let p=ka(L),h=p.indexOf(L)-1;return te(h>=0?p[h]:i)}te($[Math.max(0,l-1)])}else if((a.key==="PageDown"||a.key==="PageUp")&&$.length>0){a.preventDefault(),N(!0);let p=a.key==="PageDown"?xa($.length):-xa($.length);te($[Math.min($.length-1,Math.max(0,(l<0?-1:l)+p))])}else if(a.key==="ArrowRight"&&!r&&ze(L)){let p=L,h=w?p.id===q?.id?se:F(p):xe.get(p.id)??F(p);if(h.length===0)return;a.preventDefault(),!w&&!Pe.includes(p.id)&&he(C=>[...C,p.id]),fe(p.id),oe(h[0].id)}else if(a.key==="ArrowLeft"&&r){a.preventDefault();let p=L.of;w||he(h=>h.filter(C=>C!==p)),te($.find(h=>h.id===p))}else a.key==="Enter"?(a.preventDefault(),De(L)):a.key==="Escape"&&(a.preventDefault(),M?s(p=>Ye(p)):R.current?.blur())},We=(a,r,i={},l={})=>{let p=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":p,onClick:()=>De(a),style:{...er,...p?ar:null,...i},...l,children:r},a.id)},Sa=(a,r)=>{let i=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":i,"data-testid":"find-act","data-about":"act",onClick:()=>De(a),style:{...r?nr:pt,...i?or:null,...a.act.destructive?{color:"var(--graview-warn)"}:null},children:a.act.title},a.id)};return(0,t.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,t.jsx)("input",{ref:a=>{R.current=a,ya.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":ce,"aria-controls":W,"aria-autocomplete":"list",...ce&&L?{"aria-activedescendant":L.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:M,onChange:a=>{let r=a.target.value;N(!0),s(i=>ja(i,r.length>0?r:null))},onFocus:()=>N(!0),onBlur:()=>N(!1),onKeyDown:$t,style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${M?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,t.jsx)("span",{role:"status","aria-live":"polite",style:qe,"data-testid":"find-count",children:M.trim()?kt:""}),(0,t.jsx)("span",{ref:z,tabIndex:-1,role:"status",style:qe,"data-testid":"find-landing"}),(0,t.jsxs)("div",{...ya.pane,id:W,role:"listbox","aria-label":M?`What \u201C${M}\u201D finds`:"What the words find","data-testid":"find-strip","data-graview-find":w?"panel":"narrow",hidden:!ce,onMouseDown:a=>a.preventDefault(),style:{..._t,...e?Yt:w&&!ye?Ut:null,...ce?{display:"flex"}:null},children:[(0,t.jsxs)("div",{style:{...jt,gridTemplateColumns:w&&!ye?`minmax(0, 1fr) ${Gt}`:"minmax(0, 1fr)"},children:[(0,t.jsxs)("div",{ref:P,role:"presentation","data-testid":"find-list",onMouseMove:ba,style:Qt,children:[ye?(0,t.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",c?.words||M,"\u201D."]}):Ne.map(a=>(0,t.jsxs)("div",{role:"group","aria-label":st(a.key,o.schema),children:[(0,t.jsxs)("div",{role:"presentation",style:pa,children:[a.key!=="rule:"&&a.key!=="act:"?(0,t.jsx)(ct,{kind:a.key,accents:v?.accents}):null,(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:st(a.key,o.schema)}),(0,t.jsx)("span",{"aria-hidden":"true",style:Zt,"data-testid":"find-group-count",children:re(a.count)})]}),a.rows.map(r=>{let i=r.hit,l=i.about==="node"?i:null,p=!w&&l!==null&&bt.has(r.id),h=xe.get(r.id);return(0,t.jsxs)(u.Fragment,{children:[We(r,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Nt,{hit:i,flag:k,words:l?.near&&l.why.matched?[...Ie,Ee(l.why.matched)]:Ie}),p?(0,t.jsx)("span",{"aria-hidden":"true","data-testid":"find-acts-open","data-open":h?"":void 0,title:h?"Put its actions away":"Actions",onClick:C=>{C.stopPropagation(),yt(r)},style:{...dr,...h?lr:null},children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"3.5",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"12.5",cy:"8",r:"1.4",fill:"currentColor"})]})}):null]}),p?{paddingRight:48}:{},{"data-testid":"find-hit","data-about":i.about,...l?.near?{"data-near":""}:{},title:Ht(i)}),h?(0,t.jsx)("div",{role:"group","aria-label":`What can be done about ${l?.label??"it"}`,style:sr,children:h.map(C=>Sa(C,!0))}):null]},r.id)}),a.more?We(a.more,(0,t.jsxs)("span",{style:Q,children:["All ",re(a.more.count)," ",ke(o.schema,a.more.all).toLowerCase()," matching \u201C",M.trim(),"\u201D"]}),tr,{"data-testid":"find-all","data-about":"all"}):null]},a.key)),ae?We(ae,(0,t.jsxs)("span",{style:Q,children:["Tell Graview: ",(0,t.jsxs)("span",{style:{fontWeight:600},children:["\u2018",ae.ask,"\u2019"]})]}),{borderTop:"1px solid var(--graview-edge)",marginTop:4},{"data-testid":"find-ask"}):null,fa>Dt?(0,t.jsxs)("p",{role:"presentation",style:dt,"data-testid":"find-more-words",children:[re(fa)," found: another word of the name narrows them."]}):null,c&&c.searched.past===!1&&c.searched.kinds.some(a=>o.schema.tryDefinition(a)?.lifecycle)?(0,t.jsx)("p",{role:"presentation",style:dt,children:"Current ones; add is:any for the past."}):null]}),w&&!ye&&q?(0,t.jsxs)("div",{role:"group","aria-label":"The one lit","data-testid":"find-panel",onMouseEnter:xt,onMouseMove:ba,style:Xt,children:[(0,t.jsx)(Pt,{row:q,schema:o.schema,accents:v?.accents,marking:Ie,q:M.trim(),flag:k}),se.length>0?(0,t.jsxs)("div",{role:"group","aria-label":"Actions",style:{display:"grid",gap:4},children:[(0,t.jsx)("div",{role:"presentation",style:{...pa,padding:"10px 0 4px"},children:"Actions"}),se.map(a=>Sa(a,!1))]}):null]}):null]}),e?null:(0,t.jsxs)("div",{"aria-hidden":"true",style:cr,"data-testid":"find-keys",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2191"}),(0,t.jsx)("kbd",{style:me,children:"\u2193"})," move"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u21B5"})," open"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2192"})," actions"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"esc"})," close"]})]})]})]})}function Pt({row:e,schema:o,accents:d,marking:s,q:n,flag:m}){let v=null,g="",y,S=null;if("ask"in e)g="Tell Graview",y=`\u2018${e.ask}\u2019`,S=(0,t.jsx)("p",{style:Y,children:"Says it to Graview about what is selected; the answer comes on a card beside it."});else if("all"in e)v=e.all,g=G(o,e.all),y=`All ${re(e.count)} matching \u201C${n}\u201D`,S=(0,t.jsxs)("p",{style:Y,children:["Opens the ",ke(o,e.all).toLowerCase(),", narrowed by these words."]});else{let c=e.hit;switch(c.about){case"node":{v=c.kind,g=ot(Ca(o.tryDefinition(c.kind),c.kind)),y=(0,t.jsxs)(t.Fragment,{children:[c.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[m," "]}):null,(0,t.jsx)(j,{text:c.label,words:s})]});let b=[c.apart,c.current?null:"past",c.archived?"set aside":null].filter(Boolean).join(" \xB7 ");S=(0,t.jsxs)(t.Fragment,{children:[b?(0,t.jsx)("p",{style:Y,children:ot(b)}):null,c.near?(0,t.jsxs)("p",{style:Y,children:["Near \u201C",c.why.asked,"\u201D",c.why.field!=="label"?` \u2014 ${c.why.reading.toLowerCase()}: ${c.why.fragment}`:""]}):c.why.field!=="label"?(0,t.jsxs)("p",{style:Y,children:[(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:c.why.reading}),(0,t.jsx)("br",{}),(0,t.jsx)(j,{text:c.why.fragment,words:s})]}):null]});break}case"kind":v=c.kind,g="Kind",y=c.label,S=(0,t.jsxs)("p",{style:Y,children:["Goes into the ",c.label.toLowerCase(),", all of them",c.count>0?`; ${re(c.count)} match these words`:"","."]});break;case"place":v=c.kind,g="Place",y=c.title,S=(0,t.jsxs)("p",{style:Y,children:["A picture of the ",ke(o,c.kind).toLowerCase(),"."]});break;case"rule":g="Rule",y=c.label,S=(0,t.jsx)("p",{style:Y,children:"Selects what it flags."});break;case"act":g="Act",y=c.title;break}}return(0,t.jsxs)("div",{role:"presentation","data-testid":"find-said",style:{display:"grid",gap:6},children:[(0,t.jsxs)("div",{style:{...pa,padding:0},children:[v?(0,t.jsx)(ct,{kind:v,accents:d}):null,g]}),(0,t.jsx)("div",{style:Jt,children:y}),S]})}function Nt({hit:e,flag:o,words:d}){switch(e.about){case"node":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:rr,children:[e.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[o," "]}):null,(0,t.jsx)(j,{text:e.label,words:d}),e.apart?(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,t.jsx)("span",{style:we,children:" \xB7 past"})]}),e.near?(0,t.jsxs)("span",{style:{...Q,...we},"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: `:"",e.why.field!=="label"?(0,t.jsx)(j,{text:e.why.fragment,words:d}):null]}):e.why.field!=="label"?(0,t.jsxs)("span",{style:{...Q,...we},children:[e.why.reading.toLowerCase(),": ",(0,t.jsx)(j,{text:e.why.fragment,words:d})]}):null]});case"kind":return(0,t.jsxs)("span",{style:Q,children:[(0,t.jsx)(j,{text:e.label,words:d}),(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,t.jsxs)("span",{style:Q,children:["Go to ",(0,t.jsx)(j,{text:e.title,words:d})]});case"rule":return(0,t.jsxs)("span",{style:Q,children:["The rule \u201C",(0,t.jsx)(j,{text:e.label,words:d}),"\u201D"]});case"act":return(0,t.jsx)("span",{style:Q,children:e.title})}}function It(e,o){if(o.length===0)return[{text:e}];let d=[],s=0;for(let n of e.matchAll(/[\p{L}\p{N}]+/gu)){let m=n[0],v=Ee(m).replace(/ /g,""),g=o.filter(c=>v.startsWith(c)).sort((c,b)=>b.length-c.length)[0];if(!g)continue;let y=v.length===m.length?g.length:m.length,S=n.index??0;S>s&&d.push({text:e.slice(s,S)}),d.push({text:m.slice(0,y),marked:!0}),s=S+y}return s<e.length&&d.push({text:e.slice(s)}),d}function j({text:e,words:o}){return(0,t.jsx)(t.Fragment,{children:It(e,o).map((d,s)=>d.marked?(0,t.jsx)("mark",{style:ir,children:d.text},s):(0,t.jsx)(u.Fragment,{children:d.text},s))})}function Ht(e){if(e.about!=="node")return"";let o=e.near?`Near \u201C${e.why.asked}\u201D`:e.why.field!=="label"?`${e.why.reading}: ${e.why.fragment}`:"";return o?`${e.label}
1140
- ${o}`:e.label}var ot=e=>e&&e[0].toUpperCase()+e.slice(1);function ct({kind:e,accents:o}){let d=Math.round(Aa(e,o));return(0,t.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${d} 55% 52%)`}})}function st(e,o){return e==="rule:"?"Rules":e==="act:"?"Acts":G(o,e)}function Ot(e,o,d){let s=Object.entries(e).map(([v,g])=>$a(d,v,g)),n=o.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;n>0&&s.push(`${n} ${n===1?"place or rule":"places and rules"}`);let m=o.filter(v=>v.about==="node"&&v.near).length;return s.length===0?"Nothing found":`${s.join(", ")} found${m>0?`, ${m} of them near`:""}`}var Bt=10,Dt=12,Wt=5,Kt=6,Ft=140,qt=760,Gt="15.5rem",_t={...Na,flexDirection:"column",width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(64vh, 30rem)",overflow:"hidden",boxSizing:"border-box",background:"linear-gradient(var(--graview-panel), var(--graview-panel)) var(--graview-ground, var(--graview-panel))",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:0},Ut={width:"min(42rem, calc(100vw - 24px))"},Vt=6,Yt={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},jt={display:"grid",gridTemplateRows:"minmax(0, 1fr)",flex:"1 1 auto",minHeight:0},Qt={overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"4px 0",overscrollBehavior:"contain"},Xt={overflowY:"auto",minHeight:0,padding:"12px 14px",borderLeft:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",display:"flex",flexDirection:"column",gap:4},Jt={fontWeight:600,fontSize:"0.9375rem",lineHeight:1.35,color:"var(--graview-ink)",overflowWrap:"anywhere"},Y={margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},pa={display:"flex",alignItems:"center",gap:6,padding:"10px 12px 4px",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Zt={marginLeft:"auto",fontWeight:400,letterSpacing:0,fontVariantNumeric:"tabular-nums",color:"var(--graview-ink-faint)"},er={position:"relative",display:"grid",gap:1,minHeight:34,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)",minWidth:0},ar={background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))",boxShadow:"inset 3px 0 0 var(--graview-accent)"},tr={color:"var(--graview-accent)",fontSize:"0.8125rem",minHeight:30},Q={display:"block",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},rr={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,minWidth:0,overflow:"hidden",overflowWrap:"anywhere",fontWeight:600},we={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400},ir={background:"color-mix(in srgb, var(--graview-accent) 24%, transparent)",color:"inherit",borderRadius:2,padding:0,boxShadow:"0 1px 0 color-mix(in srgb, var(--graview-accent) 70%, transparent)"},pt={display:"flex",alignItems:"center",minHeight:32,padding:"4px 10px",boxSizing:"border-box",borderWidth:1,borderStyle:"solid",borderColor:"var(--graview-edge)",borderRadius:6,background:"var(--graview-panel)",color:"var(--graview-ink)",fontSize:"0.8125rem",lineHeight:1.3,cursor:"pointer",overflowWrap:"anywhere"},nr={...pt,minHeight:32,margin:"0 12px 4px 24px"},or={borderColor:"var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))"},sr={display:"grid",padding:"2px 0 6px"},dr={position:"absolute",top:"50%",right:6,transform:"translateY(-50%)",width:36,height:32,display:"grid",placeItems:"center",borderRadius:6,color:"var(--graview-ink-muted)",borderWidth:1,borderStyle:"solid",borderColor:"transparent"},lr={color:"var(--graview-accent)",borderColor:"var(--graview-edge)",background:"var(--graview-panel)"},dt={margin:0,padding:"6px 12px 4px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},cr={display:"flex",flexWrap:"wrap",gap:"4px 14px",padding:"7px 12px",borderTop:"1px solid var(--graview-edge)",color:"var(--graview-ink-faint)",fontSize:"0.75rem",flex:"0 0 auto"},me={display:"inline-block",minWidth:16,padding:"0 4px",marginRight:3,border:"1px solid var(--graview-edge)",borderRadius:4,font:"inherit",fontSize:"0.6875rem",lineHeight:"16px",textAlign:"center",color:"var(--graview-ink-muted)",background:"var(--graview-panel)"};var Me=f(_(),1),ga=f(Ct(),1);var vt=f(A(),1);function gt(){let{following:e,follow:o}=T();return e?(0,vt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>o(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var ut=f(_(),1);var E=f(A(),1);function wt({home:e,homeLabel:o,children:d,onPicture:s=!1}){let{view:n,focus:m,show:v,go:g}=U(),{store:y}=T(),{movedByHand:S}=T(),c=S&&(n.pan!==void 0||Object.keys(n.pins).length>0),b=n.focusId&&n.focusId!==e?y.graph.getNode(n.focusId):void 0,k=z=>G(y.schema,z),w={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},R=o!==void 0&&b!==void 0,P=[];if(b&&!s&&P.push({key:"focused",node:(0,E.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>g(Fe({...n,focusId:e},!1)),title:Ge(y,b.id),style:{...w,maxWidth:"min(14rem, 15vw)"},children:[(0,E.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Ge(y,b.id)}),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.past&&P.push({key:"past",node:(0,E.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>g(Qa(n,!1)),title:"Back to now \u2014 retired things leave the picture again",style:w,children:["the past",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.zoom&&P.push({key:"zoomed",node:(0,E.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>g(Fe(n,!1)),title:"Zoom back out",style:w,children:["zoomed in",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),c&&P.push({key:"moved",node:(0,E.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>g(Ke(n)),title:"Put the camera and everything you dragged back where the layout wanted them",style:w,children:"Reset view"})}),n.relation){let z=n.relation;P.push({key:"raised",node:(0,E.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,E.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>g(ve(n,ge(z),{ownPicture:!0})),title:`Go into the ${k(z).toLowerCase()}`,"aria-label":`Go into the ${k(z).toLowerCase()}`,style:{...w,color:"var(--graview-ink)"},children:[k(z),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,E.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>v(null),title:`Stop showing ${k(z).toLowerCase()}`,"aria-label":`Stop showing ${k(z).toLowerCase()}`,style:{...w,minWidth:26,justifyContent:"center"},children:(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return s&&!R&&P.length===0&&d===void 0?null:(0,E.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[R?(0,E.jsx)("button",{type:"button",onClick:()=>m(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:o}):null,P.map(({key:z,node:W},Le)=>(0,E.jsxs)(ut.Fragment,{children:[R||Le>0?(0,E.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,W]},z)),d]})}var O=f(A(),1);function va(){let[e,o]=(0,Me.useState)([]),d=(0,Me.useCallback)(s=>{o(n=>{let m=s.phase!=="running"&&n[0]?.name===s.name&&n[0]?.at===s.at;return[s,...m?n.slice(1):n].slice(0,12)})},[]);return[e,d]}function ua({find:e,calls:o,seat:d,remembers:s=!1}){return e?(0,O.jsxs)(O.Fragment,{children:[(0,ga.createPortal)((0,O.jsx)(lt,{compact:e.compact}),e.slot),e.own?(0,ga.createPortal)((0,O.jsx)(Ka,{calls:o,remembers:s,...d!==void 0?{seat:d}:{}}),e.own):null]}):null}function wa({home:e=null}){return(0,O.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:B("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,O.jsx)(wt,{home:e,onPicture:!0}),(0,O.jsx)("span",{style:{pointerEvents:"auto"},children:(0,O.jsx)(gt,{})})]})}var X=f(_(),1);var mt=f(A(),1),pr=ie(()=>(__graviewPreload(import.meta.url,["./chunk.Q355UPFG.js","./chunk.PYGNO2AV.js","./chunk.3HFBHLXC.js","./chunk.CUA7F3YJ.js","./chunk.SDO3U72B.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DGDOZHYK.js")));function ma(){let{store:e,principal:o}=T(),d=(0,X.useContext)(Fa),s=(0,X.useRef)(null),n=(0,X.useRef)(!1);return(0,X.useEffect)(()=>()=>void(n.current=!0),[]),(0,X.useEffect)(()=>{let m=e.batches().length,v=pr().then(g=>g.sceneWay(e,o,d,m,s.current),()=>{});return()=>void v.then(g=>g?.(n.current))},[e,o,d]),(0,mt.jsx)("span",{ref:s,hidden:!0})}var ft=f(_(),1);var x=f(A(),1);function _i({address:e=!1,auto:o,quickAsk:d=!0,scheme:s,scope:n}){let m=(0,ft.useMemo)(()=>`${ia({scope:`.${n}`})}
1139
+ }`}function na(e="dark",o={}){let d=At(e);return o.scope===void 0?d:Ta(d,o.scope)}var I=f(_(),1);var V=f(A(),1),Et=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.47QWCVZD.js")))).part(e=>(0,V.jsx)(e.MapKey,{}),{quiet:!0});function oa(){let{store:e}=T(),{view:o}=U(),d=Ce(),s=(0,I.useMemo)(()=>e.graph.allEdges().length>0,[e,d]),[n,m]=(0,I.useState)(!1),v=(0,I.useId)(),g=(0,I.useRef)(null),y=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!n)return;let b=k=>{let w=k.target;w&&(y.current?.contains(w)||g.current?.contains(w))||m(!1)};return document.addEventListener("pointerdown",b,!0),()=>document.removeEventListener("pointerdown",b,!0)},[n]);let[S,c]=(0,I.useState)(null);return(0,I.useEffect)(()=>{let b=g.current?.parentElement?.parentElement?.querySelector('[data-testid="overview"]');if(!b||typeof ResizeObserver>"u")return;let k=()=>c(Math.ceil(b.getBoundingClientRect().width));k();let w=new ResizeObserver(k);return w.observe(b),()=>w.disconnect()},[s]),s?(0,V.jsxs)("div",{style:{display:"contents"},onKeyDown:b=>{b.key!=="Escape"||!n||(b.preventDefault(),b.stopPropagation(),m(!1),g.current?.focus({preventScroll:!0}))},children:[(0,V.jsx)("button",{ref:g,type:"button","data-testid":"lines-key",className:"graview-lines-key","data-graview-up-row":o.overview?void 0:"","aria-expanded":n,"aria-controls":v,title:"What the lines mean",onClick:()=>m(b=>!b),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",...S!==null?{"--graview-up-room":`${S}px`}:{}},children:"Key"}),n?(0,V.jsxs)("div",{ref:y,id:v,"data-testid":"lines-key-pane",className:"graview-lines-key-pane","data-graview-up-row":o.overview?void 0:"","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("rail"),width:it,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[o.overview?(0,V.jsx)(Et,{}):null,(0,V.jsx)(rt,{inside:!0,widthOf:Za})]}):null]}):null}var Te=f(_(),1),Re=f(A(),1);function nt(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Rt=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.HIIYDKFC.js","./chunk.F2BZ4SC4.js","./chunk.WAPY4RCS.js","./chunk.JMXBMLKH.js","./chunk.PVAYYFT2.js","./chunk.HJCQ6I3S.js","./chunk.QNFX5VHW.js","./chunk.UXW43HNW.js","./chunk.L3ST2YKI.js","./chunk.7VCYVCYM.js","./chunk.MFNWHXGL.js","./chunk.DCIYOZYP.js","./chunk.JP33TNCH.js","./chunk.BIDL7GQD.js","./chunk.O5P6LXHF.js","./chunk.VGQDPEB5.js","./chunk.WIVNFOQR.js","./chunk.Q5WEOX3Q.js","./chunk.7DCBIMOI.js","./chunk.GXK5PI7I.js","./chunk.DYPSFTRP.js","./chunk.WVUJXDXZ.js","./chunk.J7GH2CGV.js","./chunk.SMF5S4DQ.js","./chunk.XP4IVKKR.js","./chunk.R5YGW5ZX.js","./chunk.QMGBAKX6.js","./chunk.PS765ODQ.js","./chunk.MIE4TJRW.js","./chunk.DEBW4FH6.js","./chunk.RD2FSSLV.js","./chunk.OWHH7JDV.js","./chunk.T3RFZ66S.js","./chunk.TDWJU6GW.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.EHCMBAZO.js")))),Tt=Rt.part((e,o)=>(0,Re.jsx)(e.MapPanelFor,{showing:o.showing}),{what:"This panel",quiet:!0});function sa(){let{store:e,view:o,selection:d,hiddenKinds:s,seatTalk:n}=T();Ce();let m=(0,Te.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1);if(!o.overview||m)return null;let v=nt(Xa(d,{...o,beside:!0},g=>e.graph.getNode(g)?.kind));return!v||v.what!=="record"&&(s.has(v.kind)||!e.schema.kinds.includes(v.kind))?null:(0,Re.jsx)(Te.Suspense,{fallback:null,children:(0,Re.jsx)(Tt,{showing:v})})}var zt=f(_(),1);var D=f(A(),1);function da(){let{view:e,go:o}=U(),{store:d,views:s,hiddenKinds:n}=T(),m=e.overview??!1,v=s.places().map(k=>k.kind).filter(k=>!n.has(k)),g=Ga(e,d.schema.kinds,v),y=()=>{o(Se(ee(e,!1),g))},S=(()=>{if(!g)return null;let k=Ea(g)[0],w=e.within?.view,R=(w?s.places().find(P=>P.as===w):void 0)??(k?s.places().filter(P=>P.kind===k).at(-1):void 0);return R?R.title:k?G(d.schema,k):d.graph.getNode(g)?.label??null})(),c=m?"Close the map":"Up",b=m&&S?`Close the map, down to ${S}`:c;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":m,"aria-label":b,title:m?b:"Up \u2014 everything, from above",onClick:()=>m?y():o(ee(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":m?1:0,...m?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:c})]})}var la=f(A(),1);function ca(){let{administered:e}=T(),{view:o,go:d}=U(),s=e.filter(n=>n.canShow);return s.length===0?null:(0,la.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(n=>(0,la.jsx)("button",{type:"button","aria-pressed":n.shown,"data-testid":`show-${n.name}`,title:n.shown?`Hide the ${n.name}'s own districts again`:n.description??`Show the ${n.name}'s own districts beside the domain`,onClick:()=>d(Ya(o,n.name,!n.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:n.shown?"var(--graview-accent)":"var(--graview-edge)",color:n.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:n.shown?"var(--graview-panel)":"transparent"},children:n.shown?`Hide the ${n.name}`:`Show the ${n.name}`},n.name))})}var u=f(_(),1);var t=f(A(),1);za({search:Ua,touchWeights:_a});var ne=e=>e!==void 0&&"act"in e,ze=e=>e!==void 0&&"hit"in e&&e.hit.about==="node"?e:void 0,Mt=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Lt(e){let o=()=>typeof window>"u"||window.innerWidth>=qt,[d,s]=(0,u.useState)(o);return(0,u.useEffect)(()=>{let n=()=>s(o());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),d&&!e}function lt({compact:e=!1}){let{store:o,view:d,setView:s,principal:n,setMenuAt:m,brand:v,aiDesk:g,selection:y}=T(),S=Oa(g),c=Ma(),b=Pa(),k=Wa().marks.flag,w=Lt(e),R=(0,u.useRef)(null),P=(0,u.useRef)(null),z=(0,u.useRef)(null),W=(0,u.useId)(),[Le,N]=(0,u.useState)(!1),[K,oe]=(0,u.useState)(null),[ht,fe]=(0,u.useState)(null),[Pe,he]=(0,u.useState)([]),M=d.q??"";(0,u.useEffect)(()=>{let a=r=>{if(r.defaultPrevented)return;let i=r.key.toLowerCase()==="k"&&(r.metaKey||r.ctrlKey)&&!r.altKey&&!r.shiftKey,l=r.key==="/"&&!r.metaKey&&!r.ctrlKey&&!r.altKey;if(!i&&!l)return;let p=R.current;if(!p)return;let h=p.closest("[data-graview-embed]"),C=r.target,J=C===document.body||C===document.documentElement||C===window;if(h&&!(i&&J||C instanceof Node&&h.contains(C)))return;let Z=document.activeElement,pe=Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLSelectElement||Z instanceof HTMLElement&&Z.isContentEditable;l&&pe||(r.preventDefault(),p.getClientRects().length===0&&p.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),p.focus({preventScroll:!0}),p.select(),N(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Ne=(0,u.useMemo)(()=>{let a=new Map;for(let[i,l]of(c?.hits??[]).entries()){if(l.about==="act")continue;let p=Mt(l),h=a.get(p)??[];h.push({id:`${W}-${i}`,hit:l}),a.set(p,h)}let r=[...a.values()].filter(i=>i.some(l=>l.hit.about==="node")).length>1;return[...a.entries()].map(([i,l])=>{let p=0,h=l.filter(pe=>pe.hit.about!=="node"||!r||++p<=Wt),C=h.filter(pe=>pe.hit.about==="node").length,J=i.endsWith(":")?l.length:c?.byKind[i]??C,Z=!i.endsWith(":")&&C>0&&J>C?{id:`${W}-all-${i}`,all:i,count:J}:null;return{key:i,rows:h,count:J,more:Z}})},[c,W]),ae=S&&M.trim()?{id:`${W}-ask`,ask:M.trim()}:null,$=(0,u.useMemo)(()=>[...Ne.flatMap(a=>a.more?[...a.rows,a.more]:a.rows),...ae?[ae]:[]],[Ne,ae?.ask]),fa=(c?.hits??[]).filter(a=>a.about==="node").length,be=c?.words??M,Ie=(0,u.useMemo)(()=>Ee(be).split(" ").filter(Boolean),[be]),F=(0,u.useCallback)(a=>a.hit.about==="node"?Va(o,a.hit.id,be,{principal:n,limit:Kt}).map((r,i)=>({id:`${a.id}-act-${i}`,act:r,of:a.id})):[],[o,be,n]),He=$.find(a=>a.id===K),q=$.find(a=>a.id===ht)??He??$[0],se=(0,u.useMemo)(()=>w&&ze(q)?F(q):[],[w,q?.id,F]),xe=(0,u.useMemo)(()=>w?new Map:new Map(Pe.flatMap(a=>{let r=ze($.find(i=>i.id===a));return r?[[a,F(r)]]:[]})),[w,Pe,$,F]),bt=(0,u.useMemo)(()=>w?new Set:new Set($.flatMap(a=>ze(a)&&F(a).length>0?[a.id]:[])),[w,$,F]),Oe=(0,u.useMemo)(()=>w?se:[...xe.values()].flat(),[w,se,xe]),L=He??Oe.find(a=>a.id===K)??$[0];(0,u.useEffect)(()=>{oe(null),fe(null),he([])},[M]);let de=(0,u.useRef)(null);(0,u.useEffect)(()=>{let a=de.current;if(!a)return;de.current=null;let r=0,i=()=>{let l=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),p=document.activeElement;if(!(!p||p===document.body||p===document.documentElement||p===R.current||p===z.current||p===l))return;let C=[...l?.querySelectorAll('[role="group"][aria-label="Arrange"] :is(button, input)')??[]].find(J=>J.checkVisibility?.()??!0);if(C)return C.focus({preventScroll:!0});l&&l.tabIndex>=0&&p!==l&&l.focus({preventScroll:!0}),++r<240?requestAnimationFrame(i):document.activeElement===z.current&&z.current?.blur()};requestAnimationFrame(i)},[d]);let Be=(a,r)=>{let i=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`);if(i&&i.tabIndex>=0)return i.focus({preventScroll:!0});let l=z.current;if(!l)return R.current?.blur();l.setAttribute("aria-label",r),l.focus({preventScroll:!0})},ha=(0,u.useRef)({x:Number.NaN,y:Number.NaN,moved:!1});(0,u.useEffect)(()=>{let a=r=>{let i=ha.current;i.moved=r.clientX!==i.x||r.clientY!==i.y,i.x=r.clientX,i.y=r.clientY};return window.addEventListener("mousemove",a,{capture:!0,passive:!0}),()=>window.removeEventListener("mousemove",a,{capture:!0})},[]);let le=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>clearTimeout(le.current),[]);let te=a=>{a&&(clearTimeout(le.current),oe(a.id),ne(a)||fe(a.id))},ba=a=>{if(!ha.current.moved)return;let r=a.target.closest?.('[role="option"]')?.id;if(!r||r===K)return;let i=$.find(l=>l.id===r)??Oe.find(l=>l.id===r);i&&(oe(i.id),!ne(i)&&(clearTimeout(le.current),le.current=setTimeout(()=>fe(i.id),Ft)))},xt=()=>{clearTimeout(le.current),q&&!ne(L)&&oe(q.id)},yt=a=>he(r=>r.includes(a.id)?r.filter(i=>i!==a.id):[...r,a.id]),xa=a=>{let r=P.current,i=r?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,l=r?.clientHeight??0;return Math.min(a,i>0&&l>0?Math.max(1,Math.floor(l/i)-1):Bt)};(0,u.useEffect)(()=>{K&&document.getElementById(K)?.scrollIntoView?.({block:"nearest"})},[K]);let De=a=>{if(!a)return;if("ask"in a){Ha(g,{pointed:{...y[0]!==void 0?{on:y[0]}:{},about:y},asked:a.ask}),s(i=>Ye(i)),N(!1);return}if("all"in a)return s(i=>ve(ee(i,!1),ge(a.all),{ownPicture:!0,...i.q?{carry:i.q}:{}})),de.current=a.all,N(!1),Be(a.all,`Opening ${G(o.schema,a.all)} matching \u201C${M.trim()}\u201D\u2026`);if(ne(a)){let i=a.act.subject;s(p=>$e(p,[i]));let l=R.current?.getBoundingClientRect();m({x:l?.left??0,y:(l?.bottom??0)+6,on:i}),N(!1),R.current?.blur();return}let r=a.hit;switch(r.about){case"node":s(i=>$e(Se(ee(i,!1),r.id),[r.id]));break;case"kind":return s(i=>ve(ee(i,!1),ge(r.kind),{ownPicture:!0})),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.label}\u2026`);case"place":return s(i=>Ra(i,r.kind,r.as)),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.title}\u2026`);case"rule":{let i=b.filter(l=>l.invariant===r.name).flatMap(l=>l.nodeIds);s(l=>$e(l,[...new Set(i)]));break}case"act":break}N(!1),R.current?.blur()},kt=c?Ot(c.byKind,c.hits,o.schema):"",ce=Le&&M.trim().length>0,St=(0,u.useCallback)(()=>{let a=R.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Vt};let r=R.current?.getBoundingClientRect();return r?{x:r.right,y:r.bottom}:null},[]),ya=Ia("find",{open:ce,onOpenChange:a=>{a||N(!1)},...e?{at:St}:{}}),ye=$.every(a=>"ask"in a),ka=a=>ne(a)?Oe.filter(r=>r.of===a.of):[],$t=a=>{let r=ne(L)&&K!==null,i=r?$.find(p=>p.id===L.of):K!==null?He:void 0,l=i?$.indexOf(i):-1;if(a.key==="ArrowDown"){if(a.preventDefault(),N(!0),r){let p=ka(L),h=p.indexOf(L)+1;if(h<p.length)return te(p[h]);if(w)return}te($[Math.min($.length-1,l+1)])}else if(a.key==="ArrowUp"){if(a.preventDefault(),r){let p=ka(L),h=p.indexOf(L)-1;return te(h>=0?p[h]:i)}te($[Math.max(0,l-1)])}else if((a.key==="PageDown"||a.key==="PageUp")&&$.length>0){a.preventDefault(),N(!0);let p=a.key==="PageDown"?xa($.length):-xa($.length);te($[Math.min($.length-1,Math.max(0,(l<0?-1:l)+p))])}else if(a.key==="ArrowRight"&&!r&&ze(L)){let p=L,h=w?p.id===q?.id?se:F(p):xe.get(p.id)??F(p);if(h.length===0)return;a.preventDefault(),!w&&!Pe.includes(p.id)&&he(C=>[...C,p.id]),fe(p.id),oe(h[0].id)}else if(a.key==="ArrowLeft"&&r){a.preventDefault();let p=L.of;w||he(h=>h.filter(C=>C!==p)),te($.find(h=>h.id===p))}else a.key==="Enter"?(a.preventDefault(),De(L)):a.key==="Escape"&&(a.preventDefault(),M?s(p=>Ye(p)):R.current?.blur())},We=(a,r,i={},l={})=>{let p=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":p,onClick:()=>De(a),style:{...er,...p?ar:null,...i},...l,children:r},a.id)},Sa=(a,r)=>{let i=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":i,"data-testid":"find-act","data-about":"act",onClick:()=>De(a),style:{...r?nr:pt,...i?or:null,...a.act.destructive?{color:"var(--graview-warn)"}:null},children:a.act.title},a.id)};return(0,t.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,t.jsx)("input",{ref:a=>{R.current=a,ya.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":ce,"aria-controls":W,"aria-autocomplete":"list",...ce&&L?{"aria-activedescendant":L.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:M,onChange:a=>{let r=a.target.value;N(!0),s(i=>ja(i,r.length>0?r:null))},onFocus:()=>N(!0),onBlur:()=>N(!1),onKeyDown:$t,style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${M?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,t.jsx)("span",{role:"status","aria-live":"polite",style:qe,"data-testid":"find-count",children:M.trim()?kt:""}),(0,t.jsx)("span",{ref:z,tabIndex:-1,role:"status",style:qe,"data-testid":"find-landing"}),(0,t.jsxs)("div",{...ya.pane,id:W,role:"listbox","aria-label":M?`What \u201C${M}\u201D finds`:"What the words find","data-testid":"find-strip","data-graview-find":w?"panel":"narrow",hidden:!ce,onMouseDown:a=>a.preventDefault(),style:{..._t,...e?Yt:w&&!ye?Ut:null,...ce?{display:"flex"}:null},children:[(0,t.jsxs)("div",{style:{...jt,gridTemplateColumns:w&&!ye?`minmax(0, 1fr) ${Gt}`:"minmax(0, 1fr)"},children:[(0,t.jsxs)("div",{ref:P,role:"presentation","data-testid":"find-list",onMouseMove:ba,style:Qt,children:[ye?(0,t.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",c?.words||M,"\u201D."]}):Ne.map(a=>(0,t.jsxs)("div",{role:"group","aria-label":st(a.key,o.schema),children:[(0,t.jsxs)("div",{role:"presentation",style:pa,children:[a.key!=="rule:"&&a.key!=="act:"?(0,t.jsx)(ct,{kind:a.key,accents:v?.accents}):null,(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:st(a.key,o.schema)}),(0,t.jsx)("span",{"aria-hidden":"true",style:Zt,"data-testid":"find-group-count",children:re(a.count)})]}),a.rows.map(r=>{let i=r.hit,l=i.about==="node"?i:null,p=!w&&l!==null&&bt.has(r.id),h=xe.get(r.id);return(0,t.jsxs)(u.Fragment,{children:[We(r,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Nt,{hit:i,flag:k,words:l?.near&&l.why.matched?[...Ie,Ee(l.why.matched)]:Ie}),p?(0,t.jsx)("span",{"aria-hidden":"true","data-testid":"find-acts-open","data-open":h?"":void 0,title:h?"Put its actions away":"Actions",onClick:C=>{C.stopPropagation(),yt(r)},style:{...dr,...h?lr:null},children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"3.5",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"12.5",cy:"8",r:"1.4",fill:"currentColor"})]})}):null]}),p?{paddingRight:48}:{},{"data-testid":"find-hit","data-about":i.about,...l?.near?{"data-near":""}:{},title:Ht(i)}),h?(0,t.jsx)("div",{role:"group","aria-label":`What can be done about ${l?.label??"it"}`,style:sr,children:h.map(C=>Sa(C,!0))}):null]},r.id)}),a.more?We(a.more,(0,t.jsxs)("span",{style:Q,children:["All ",re(a.more.count)," ",ke(o.schema,a.more.all).toLowerCase()," matching \u201C",M.trim(),"\u201D"]}),tr,{"data-testid":"find-all","data-about":"all"}):null]},a.key)),ae?We(ae,(0,t.jsxs)("span",{style:Q,children:["Tell Graview: ",(0,t.jsxs)("span",{style:{fontWeight:600},children:["\u2018",ae.ask,"\u2019"]})]}),{borderTop:"1px solid var(--graview-edge)",marginTop:4},{"data-testid":"find-ask"}):null,fa>Dt?(0,t.jsxs)("p",{role:"presentation",style:dt,"data-testid":"find-more-words",children:[re(fa)," found: another word of the name narrows them."]}):null,c&&c.searched.past===!1&&c.searched.kinds.some(a=>o.schema.tryDefinition(a)?.lifecycle)?(0,t.jsx)("p",{role:"presentation",style:dt,children:"Current ones; add is:any for the past."}):null]}),w&&!ye&&q?(0,t.jsxs)("div",{role:"group","aria-label":"The one lit","data-testid":"find-panel",onMouseEnter:xt,onMouseMove:ba,style:Xt,children:[(0,t.jsx)(Pt,{row:q,schema:o.schema,accents:v?.accents,marking:Ie,q:M.trim(),flag:k}),se.length>0?(0,t.jsxs)("div",{role:"group","aria-label":"Actions",style:{display:"grid",gap:4},children:[(0,t.jsx)("div",{role:"presentation",style:{...pa,padding:"10px 0 4px"},children:"Actions"}),se.map(a=>Sa(a,!1))]}):null]}):null]}),e?null:(0,t.jsxs)("div",{"aria-hidden":"true",style:cr,"data-testid":"find-keys",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2191"}),(0,t.jsx)("kbd",{style:me,children:"\u2193"})," move"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u21B5"})," open"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2192"})," actions"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"esc"})," close"]})]})]})]})}function Pt({row:e,schema:o,accents:d,marking:s,q:n,flag:m}){let v=null,g="",y,S=null;if("ask"in e)g="Tell Graview",y=`\u2018${e.ask}\u2019`,S=(0,t.jsx)("p",{style:Y,children:"Says it to Graview about what is selected; the answer comes on a card beside it."});else if("all"in e)v=e.all,g=G(o,e.all),y=`All ${re(e.count)} matching \u201C${n}\u201D`,S=(0,t.jsxs)("p",{style:Y,children:["Opens the ",ke(o,e.all).toLowerCase(),", narrowed by these words."]});else{let c=e.hit;switch(c.about){case"node":{v=c.kind,g=ot(Ca(o.tryDefinition(c.kind),c.kind)),y=(0,t.jsxs)(t.Fragment,{children:[c.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[m," "]}):null,(0,t.jsx)(j,{text:c.label,words:s})]});let b=[c.apart,c.current?null:"past",c.archived?"set aside":null].filter(Boolean).join(" \xB7 ");S=(0,t.jsxs)(t.Fragment,{children:[b?(0,t.jsx)("p",{style:Y,children:ot(b)}):null,c.near?(0,t.jsxs)("p",{style:Y,children:["Near \u201C",c.why.asked,"\u201D",c.why.field!=="label"?` \u2014 ${c.why.reading.toLowerCase()}: ${c.why.fragment}`:""]}):c.why.field!=="label"?(0,t.jsxs)("p",{style:Y,children:[(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:c.why.reading}),(0,t.jsx)("br",{}),(0,t.jsx)(j,{text:c.why.fragment,words:s})]}):null]});break}case"kind":v=c.kind,g="Kind",y=c.label,S=(0,t.jsxs)("p",{style:Y,children:["Goes into the ",c.label.toLowerCase(),", all of them",c.count>0?`; ${re(c.count)} match these words`:"","."]});break;case"place":v=c.kind,g="Place",y=c.title,S=(0,t.jsxs)("p",{style:Y,children:["A picture of the ",ke(o,c.kind).toLowerCase(),"."]});break;case"rule":g="Rule",y=c.label,S=(0,t.jsx)("p",{style:Y,children:"Selects what it flags."});break;case"act":g="Act",y=c.title;break}}return(0,t.jsxs)("div",{role:"presentation","data-testid":"find-said",style:{display:"grid",gap:6},children:[(0,t.jsxs)("div",{style:{...pa,padding:0},children:[v?(0,t.jsx)(ct,{kind:v,accents:d}):null,g]}),(0,t.jsx)("div",{style:Jt,children:y}),S]})}function Nt({hit:e,flag:o,words:d}){switch(e.about){case"node":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:rr,children:[e.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[o," "]}):null,(0,t.jsx)(j,{text:e.label,words:d}),e.apart?(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,t.jsx)("span",{style:we,children:" \xB7 past"})]}),e.near?(0,t.jsxs)("span",{style:{...Q,...we},"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: `:"",e.why.field!=="label"?(0,t.jsx)(j,{text:e.why.fragment,words:d}):null]}):e.why.field!=="label"?(0,t.jsxs)("span",{style:{...Q,...we},children:[e.why.reading.toLowerCase(),": ",(0,t.jsx)(j,{text:e.why.fragment,words:d})]}):null]});case"kind":return(0,t.jsxs)("span",{style:Q,children:[(0,t.jsx)(j,{text:e.label,words:d}),(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,t.jsxs)("span",{style:Q,children:["Go to ",(0,t.jsx)(j,{text:e.title,words:d})]});case"rule":return(0,t.jsxs)("span",{style:Q,children:["The rule \u201C",(0,t.jsx)(j,{text:e.label,words:d}),"\u201D"]});case"act":return(0,t.jsx)("span",{style:Q,children:e.title})}}function It(e,o){if(o.length===0)return[{text:e}];let d=[],s=0;for(let n of e.matchAll(/[\p{L}\p{N}]+/gu)){let m=n[0],v=Ee(m).replace(/ /g,""),g=o.filter(c=>v.startsWith(c)).sort((c,b)=>b.length-c.length)[0];if(!g)continue;let y=v.length===m.length?g.length:m.length,S=n.index??0;S>s&&d.push({text:e.slice(s,S)}),d.push({text:m.slice(0,y),marked:!0}),s=S+y}return s<e.length&&d.push({text:e.slice(s)}),d}function j({text:e,words:o}){return(0,t.jsx)(t.Fragment,{children:It(e,o).map((d,s)=>d.marked?(0,t.jsx)("mark",{style:ir,children:d.text},s):(0,t.jsx)(u.Fragment,{children:d.text},s))})}function Ht(e){if(e.about!=="node")return"";let o=e.near?`Near \u201C${e.why.asked}\u201D`:e.why.field!=="label"?`${e.why.reading}: ${e.why.fragment}`:"";return o?`${e.label}
1140
+ ${o}`:e.label}var ot=e=>e&&e[0].toUpperCase()+e.slice(1);function ct({kind:e,accents:o}){let d=Math.round(Aa(e,o));return(0,t.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${d} 55% 52%)`}})}function st(e,o){return e==="rule:"?"Rules":e==="act:"?"Acts":G(o,e)}function Ot(e,o,d){let s=Object.entries(e).map(([v,g])=>$a(d,v,g)),n=o.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;n>0&&s.push(`${n} ${n===1?"place or rule":"places and rules"}`);let m=o.filter(v=>v.about==="node"&&v.near).length;return s.length===0?"Nothing found":`${s.join(", ")} found${m>0?`, ${m} of them near`:""}`}var Bt=10,Dt=12,Wt=5,Kt=6,Ft=140,qt=760,Gt="15.5rem",_t={...Na,flexDirection:"column",width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(64vh, 30rem)",overflow:"hidden",boxSizing:"border-box",background:"linear-gradient(var(--graview-panel), var(--graview-panel)) var(--graview-ground, var(--graview-panel))",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:0},Ut={width:"min(42rem, calc(100vw - 24px))"},Vt=6,Yt={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},jt={display:"grid",gridTemplateRows:"minmax(0, 1fr)",flex:"1 1 auto",minHeight:0},Qt={overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"4px 0",overscrollBehavior:"contain"},Xt={overflowY:"auto",minHeight:0,padding:"12px 14px",borderLeft:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",display:"flex",flexDirection:"column",gap:4},Jt={fontWeight:600,fontSize:"0.9375rem",lineHeight:1.35,color:"var(--graview-ink)",overflowWrap:"anywhere"},Y={margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},pa={display:"flex",alignItems:"center",gap:6,padding:"10px 12px 4px",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Zt={marginLeft:"auto",fontWeight:400,letterSpacing:0,fontVariantNumeric:"tabular-nums",color:"var(--graview-ink-faint)"},er={position:"relative",display:"grid",gap:1,minHeight:34,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)",minWidth:0},ar={background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))",boxShadow:"inset 3px 0 0 var(--graview-accent)"},tr={color:"var(--graview-accent)",fontSize:"0.8125rem",minHeight:30},Q={display:"block",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},rr={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,minWidth:0,overflow:"hidden",overflowWrap:"anywhere",fontWeight:600},we={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400},ir={background:"color-mix(in srgb, var(--graview-accent) 24%, transparent)",color:"inherit",borderRadius:2,padding:0,boxShadow:"0 1px 0 color-mix(in srgb, var(--graview-accent) 70%, transparent)"},pt={display:"flex",alignItems:"center",minHeight:32,padding:"4px 10px",boxSizing:"border-box",borderWidth:1,borderStyle:"solid",borderColor:"var(--graview-edge)",borderRadius:6,background:"var(--graview-panel)",color:"var(--graview-ink)",fontSize:"0.8125rem",lineHeight:1.3,cursor:"pointer",overflowWrap:"anywhere"},nr={...pt,minHeight:32,margin:"0 12px 4px 24px"},or={borderColor:"var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))"},sr={display:"grid",padding:"2px 0 6px"},dr={position:"absolute",top:"50%",right:6,transform:"translateY(-50%)",width:36,height:32,display:"grid",placeItems:"center",borderRadius:6,color:"var(--graview-ink-muted)",borderWidth:1,borderStyle:"solid",borderColor:"transparent"},lr={color:"var(--graview-accent)",borderColor:"var(--graview-edge)",background:"var(--graview-panel)"},dt={margin:0,padding:"6px 12px 4px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},cr={display:"flex",flexWrap:"wrap",gap:"4px 14px",padding:"7px 12px",borderTop:"1px solid var(--graview-edge)",color:"var(--graview-ink-faint)",fontSize:"0.75rem",flex:"0 0 auto"},me={display:"inline-block",minWidth:16,padding:"0 4px",marginRight:3,border:"1px solid var(--graview-edge)",borderRadius:4,font:"inherit",fontSize:"0.6875rem",lineHeight:"16px",textAlign:"center",color:"var(--graview-ink-muted)",background:"var(--graview-panel)"};var Me=f(_(),1),ga=f(Ct(),1);var vt=f(A(),1);function gt(){let{following:e,follow:o}=T();return e?(0,vt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>o(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var ut=f(_(),1);var E=f(A(),1);function wt({home:e,homeLabel:o,children:d,onPicture:s=!1}){let{view:n,focus:m,show:v,go:g}=U(),{store:y}=T(),{movedByHand:S}=T(),c=S&&(n.pan!==void 0||Object.keys(n.pins).length>0),b=n.focusId&&n.focusId!==e?y.graph.getNode(n.focusId):void 0,k=z=>G(y.schema,z),w={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},R=o!==void 0&&b!==void 0,P=[];if(b&&!s&&P.push({key:"focused",node:(0,E.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>g(Fe({...n,focusId:e},!1)),title:Ge(y,b.id),style:{...w,maxWidth:"min(14rem, 15vw)"},children:[(0,E.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Ge(y,b.id)}),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.past&&P.push({key:"past",node:(0,E.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>g(Qa(n,!1)),title:"Back to now \u2014 retired things leave the picture again",style:w,children:["the past",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.zoom&&P.push({key:"zoomed",node:(0,E.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>g(Fe(n,!1)),title:"Zoom back out",style:w,children:["zoomed in",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),c&&P.push({key:"moved",node:(0,E.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>g(Ke(n)),title:"Put the camera and everything you dragged back where the layout wanted them",style:w,children:"Reset view"})}),n.relation){let z=n.relation;P.push({key:"raised",node:(0,E.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,E.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>g(ve(n,ge(z),{ownPicture:!0})),title:`Go into the ${k(z).toLowerCase()}`,"aria-label":`Go into the ${k(z).toLowerCase()}`,style:{...w,color:"var(--graview-ink)"},children:[k(z),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,E.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>v(null),title:`Stop showing ${k(z).toLowerCase()}`,"aria-label":`Stop showing ${k(z).toLowerCase()}`,style:{...w,minWidth:26,justifyContent:"center"},children:(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return s&&!R&&P.length===0&&d===void 0?null:(0,E.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[R?(0,E.jsx)("button",{type:"button",onClick:()=>m(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:o}):null,P.map(({key:z,node:W},Le)=>(0,E.jsxs)(ut.Fragment,{children:[R||Le>0?(0,E.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,W]},z)),d]})}var O=f(A(),1);function va(){let[e,o]=(0,Me.useState)([]),d=(0,Me.useCallback)(s=>{o(n=>{let m=s.phase!=="running"&&n[0]?.name===s.name&&n[0]?.at===s.at;return[s,...m?n.slice(1):n].slice(0,12)})},[]);return[e,d]}function ua({find:e,calls:o,seat:d,remembers:s=!1}){return e?(0,O.jsxs)(O.Fragment,{children:[(0,ga.createPortal)((0,O.jsx)(lt,{compact:e.compact}),e.slot),e.own?(0,ga.createPortal)((0,O.jsx)(Ka,{calls:o,remembers:s,...d!==void 0?{seat:d}:{}}),e.own):null]}):null}function wa({home:e=null}){return(0,O.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:B("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,O.jsx)(wt,{home:e,onPicture:!0}),(0,O.jsx)("span",{style:{pointerEvents:"auto"},children:(0,O.jsx)(gt,{})})]})}var X=f(_(),1);var mt=f(A(),1),pr=ie(()=>(__graviewPreload(import.meta.url,["./chunk.Q355UPFG.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HQRPOGTS.js")));function ma(){let{store:e,principal:o}=T(),d=(0,X.useContext)(Fa),s=(0,X.useRef)(null),n=(0,X.useRef)(!1);return(0,X.useEffect)(()=>()=>void(n.current=!0),[]),(0,X.useEffect)(()=>{let m=e.batches().length,v=pr().then(g=>g.sceneWay(e,o,d,m,s.current),()=>{});return()=>void v.then(g=>g?.(n.current))},[e,o,d]),(0,mt.jsx)("span",{ref:s,hidden:!0})}var ft=f(_(),1);var x=f(A(),1);function _i({address:e=!1,auto:o,quickAsk:d=!0,scheme:s,scope:n}){let m=(0,ft.useMemo)(()=>`${ia({scope:`.${n}`})}
1141
1141
  ${na(s,{scope:`.${n}`})}`,[s,n]),v=qa(),[g]=va();return(0,x.jsx)(La.Provider,{value:!0,children:(0,x.jsxs)("div",{"data-embed-content":"",style:{position:"relative",flex:o?`0 0 ${tt}px`:"1 1 auto",minHeight:0,containerType:"size"},children:[(0,x.jsx)("style",{children:m}),e?(0,x.jsx)(at,{}):null,(0,x.jsx)(et,{}),(0,x.jsx)(wa,{}),(0,x.jsx)(da,{}),(0,x.jsx)(oa,{}),(0,x.jsxs)(Ja,{children:[(0,x.jsx)(Xe,{}),(0,x.jsx)(Je,{face:"scene",on:d}),(0,x.jsx)(sa,{}),(0,x.jsx)(Ue,{children:(0,x.jsx)(je,{children:(0,x.jsx)(Ze,{children:(0,x.jsx)(aa,{children:(0,x.jsx)(ta,{children:(0,x.jsx)(Qe,{placement:"menu"})})})})})}),(0,x.jsx)(Ve,{}),(0,x.jsx)(ra,{}),(0,x.jsx)(ea,{}),(0,x.jsx)(ua,{find:v,calls:g}),(0,x.jsx)(ma,{}),(0,x.jsx)(_e,{face:"scene"})]})]})})}function Ui(){return(0,x.jsx)(ca,{})}export{_i as SceneFace,Ui as SceneKeeping};
@@ -0,0 +1 @@
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{G as k,Qa as o,_ as n}from"./chunk.ASNVH2G4.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.J7GH2CGV.js","./chunk.SMF5S4DQ.js","./chunk.XP4IVKKR.js","./chunk.R5YGW5ZX.js","./chunk.QMGBAKX6.js","./chunk.PS765ODQ.js","./chunk.MIE4TJRW.js","./chunk.DEBW4FH6.js","./chunk.RD2FSSLV.js","./chunk.OWHH7JDV.js","./chunk.T3RFZ66S.js","./chunk.TDWJU6GW.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.YRN67Z5K.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MIE4TJRW.js","./chunk.DEBW4FH6.js","./chunk.RD2FSSLV.js","./chunk.OWHH7JDV.js","./chunk.T3RFZ66S.js","./chunk.TDWJU6GW.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TQCVEKPH.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MIE4TJRW.js","./chunk.DEBW4FH6.js","./chunk.RD2FSSLV.js","./chunk.OWHH7JDV.js","./chunk.T3RFZ66S.js","./chunk.TDWJU6GW.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.OHGAZ3D5.js")))),g=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),E=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.T3RFZ66S.js","./chunk.TDWJU6GW.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.SV75TRCH.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,g as d,E as e,M as f,N as g};
@@ -0,0 +1 @@
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{l as T}from"./chunk.RD2FSSLV.js";import{j as D}from"./chunk.P3Z4ZCL3.js";import{G as w,Ta as Q,_ as R,c as $,ia as v,ja as q,ka as Y,x as z}from"./chunk.ASNVH2G4.js";import{Ac as U,C as W,_b as H,hc as j,ib as B,pc as I,ud as K,vd as G}from"./chunk.ZDUKVXBI.js";import{b as m}from"./chunk.AJZBJBMO.js";function J(e,n,t={}){let r=e.graph.getNode(n);if(!r)return[];let i=t.principal?new Set(e.permittedMutations(t.principal).map(s=>s.name)):void 0,c=r.kind,d=e.schema.tryDefinition(c);if(!d)return[];let o=e.seenFor,a=o?H.keptFrom?.(e,o)?.(r):void 0,l=new Map;for(let s of e.allMutations()){let u=s.subject;if(!u||!(u.kinds==="*"||u.kinds.includes(c))||i&&!i.has(s.name))continue;let h=s.input.shape??{};for(let p of U(s,d)){if(a?.(p)||!j(s,e.schema,e.graph,n,p,o&&B(e.schema,o)))continue;let M=p in h,_=[];for(let g of Object.keys(h)){if(g===u.arg||g===p||se(h[g]))continue;let S=I(s.input).find(E=>E.name===g);_.push({name:g,...S?{kinds:S.kinds}:{},...S?{candidates:S.kinds.includes("*")?e.graph.allNodes().map(E=>E.id):S.kinds.flatMap(E=>e.graph.nodesOfKind(E).map(ae=>ae.id))}:{},shape:D(s.input,g)})}let ie={field:p,mutation:s.name,title:s.title??s.name,shape:M?D(s.input,p):{type:"unknown"},takesValue:M,alternatives:[],open:_,clearable:M&&(s.clearable?.includes(p)??!1),call:g=>({name:s.name,args:M?{[u.arg]:n,[p]:g}:{[u.arg]:n}})};l.set(p,[...l.get(p)??[],ie])}}return[...l.values()].map(s=>{let u=[...s.filter(p=>p.takesValue),...s.filter(p=>!p.takesValue)],[b,...h]=u;return{...b,alternatives:h}})}function se(e){let n=W(e)?.type;return n==="optional"||n==="default"||n==="nullable"}var C=m(w(),1);function Ae(e){let{store:n,principal:t}=v(),r=Y(),i=(0,C.useMemo)(()=>e===null?[]:J(n,e,{principal:t}),[n,e,r,t]),c=(0,C.useCallback)((d,o,a={})=>{let l=d.call(o);n.apply({name:l.name,args:{...l.args,...a}},{author:t})},[n,t]);return{fields:i,commit:c}}var X=m(w(),1);function pn(){let{brand:e}=v(),n=e?.kit;return(0,X.useMemo)(()=>K(n),[n])}function fn(e,n){let t=G(e,n),r={...t.color!==void 0?{color:t.color}:{},...t.pattern!==void 0?{pattern:t.pattern}:{},...t.width!==void 0?{width:t.width}:{},...t.cap!==void 0?{cap:t.cap}:{},...t.opacity!==void 0?{opacity:t.opacity}:{}};return{connector:t,style:T(n,{[n]:r})}}var O=m(w(),1);var x=m(R(),1);function de(e){let n=e?.hint;return typeof n=="string"&&n.length>0?n:void 0}function le(e){if(e instanceof Error&&e.message)return e.message;let n=String(e);return n==="[object Object]"?"The view threw without a message.":n}var Z='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';function ee(){return document.activeElement===null||document.activeElement===document.body}var ne=class extends O.Component{static contextType=Q;state={};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,t){console.error(`[graview] the ${this.props.view??"view"} of ${this.props.kind} threw while rendering`,n,t.componentStack),this.context?.(n,{module:"@graview/react"}),this.props.onCaught?.(n)}panel=(0,O.createRef)();getSnapshotBeforeUpdate(){if(typeof document>"u")return null;let n=document.activeElement,t=this.panel.current;return t&&n===t?{onPanel:!0,focused:n,parent:t.parentNode,before:t.previousSibling}:{onPanel:!1,focused:n}}componentDidUpdate(n,t,r){if(r&&!t.error&&this.state.error&&r.focused&&r.focused!==document.body&&!r.focused.isConnected&&ee()&&this.panel.current?.focus(),r?.onPanel&&t.error&&!this.state.error&&ee()){let d=r.before?r.before.nextSibling:r.parent?.firstChild??null;if(d instanceof HTMLElement){let o=d.matches(Z)?d:d.querySelector(Z);o?o.focus():(d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus())}}if(!this.state.error)return;let i=n.reset??[],c=this.props.reset??[];(i.length!==c.length||i.some((d,o)=>!Object.is(d,c[o])))&&this.setState({error:void 0})}render(){let{error:n}=this.state;if(!n)return this.props.children;let t=de(n);return(0,x.jsxs)("div",{ref:this.panel,role:"alert",tabIndex:-1,"data-graview-view-error":this.props.kind,style:{display:"flex",flexDirection:"column",gap:"0.375rem",padding:"var(--graview-pad, 12px)",height:"100%",overflow:"auto",boxSizing:"border-box",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)",font:"var(--graview-font-body, 13px/1.45 system-ui)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,x.jsx)("strong",{style:{color:"var(--graview-warn, #b4462a)"},children:this.props.view?`${this.props.view} could not draw`:"This view could not draw"}),this.props.said===""?null:(0,x.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:this.props.said??this.props.kind}),(0,x.jsx)("span",{children:le(n)}),t?(0,x.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:t}):null]})}};var y=m(w(),1);var re=m(R(),1),V=(0,y.createContext)([]);function xn({sections:e,children:n}){let t=(0,y.useContext)(V),r=(0,y.useMemo)(()=>[...t,...e.filter(i=>!t.includes(i))],[t,e]);return(0,re.jsx)(V.Provider,{value:r,children:n})}function te(){let e=(0,y.useContext)(V),n=q()?.menuSections;return(0,y.useMemo)(()=>n?[...e,...n.filter(t=>!e.includes(t))]:e,[e,n])}function bn(){let e=te();return(0,y.useCallback)(n=>{for(let t of e)try{t(n)?.prepare?.()}catch{}},[e])}function wn(e){let n=te();if(e===null||n.length===0)return{start:[],end:[]};let t=n.flatMap(r=>{try{let i=r(e);return i&&((i.items?.length??0)>0||i.render||i.mode)?[i]:[]}catch{return[]}});return{start:t.filter(r=>r.at==="start"),end:t.filter(r=>r.at!=="start")}}var N=new WeakMap;function Sn(e,n){n?N.set(e,n):N.delete(e)}function En(e){return e?N.get(e):void 0}var P,ce,F=new Set;function Pn(e){F.add(e)}function kn(){return ce??=Promise.all([(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.Y7QDQ3WF.js")),...[...F].map(e=>e())]).then(([e])=>void(P=e.sectionUnder))}function Mn(e){return e&&P?P(e):void 0}var Rn=()=>P===void 0&&F.size>0,Cn=e=>P===void 0&&e?.getRootNode()?.host?.hasAttribute("data-worker-view")===!0;var ue=m(w(),1);function Tn(){return v().activity}var A=(e,n)=>e.length*n*.58;var pe=156,fe=2,k=pe-18,me=7.1,ye=16;function ge(e,n){let t=0,r=k;for(let i of e.split(" ")){let c=n(i),d=r+n(" ")+c;if(d<=k)r=d;else{let o=Math.ceil(c/k)||1;t+=o,r=c-(o-1)*k}}return t}var he=16.25,oe=27,xe=(e,n)=>{let t=Math.ceil(e.length*me/k);return n?Math.max(oe,Math.ceil(Math.max(t,ge(e,n))*he)+6):Math.max(oe,t*ye+6)};function Nn(e,n,t){return e.length===0?0:10+e.reduce((r,i)=>r+xe(i,t),0)+(e.length-1)*fe}var be=27,we=8,Fn=4,ve=64,Ln=e=>Math.max(1,Math.min(we,e)),_n=e=>e*be+ve;var f=m(w(),1);function jn(e,{units:n,target:t=0,legibleAt:r=260}){let[i,c]=(0,f.useState)(n);(0,f.useEffect)(()=>{let o=e.current;if(o===null||typeof ResizeObserver>"u")return;let a=new ResizeObserver(([l])=>{let s=l?.contentRect.width??0;s>0&&c(s)});return a.observe(o),()=>a.disconnect()},[e]);let d=i/n;return{scale:d,width:i,touchable:d*t>=24,legible:i>=r}}function In(e="--graview-font-body",n="sans-serif"){let t=(0,f.useRef)(void 0),r=(0,f.useMemo)(()=>{if(typeof getComputedStyle!="function"||typeof document>"u")return n;let i=getComputedStyle(document.documentElement).getPropertyValue(e).trim();return i.length>0?i:n},[e,n]);return(0,f.useMemo)(()=>{t.current===void 0&&(t.current=typeof document>"u"?null:document.createElement("canvas").getContext("2d")??null);let i=t.current;return i===null?A:(c,d)=>{i.font=`${d}px ${r}`;let o=i.measureText(c).width;return o>0?o:A(c,d)}},[r])}var Un=(0,f.createContext)(void 0);var L=3;function Se(e){let n=$(e),t=n.focusId;if(!t)return null;if(n.within?.view){let[i]=z(t);if(i)return{at:`screen:${i}`,audience:!0}}return{at:t,audience:!1}}var Ee=102,Pe=32;function $n(e,n,t){let r=[],i=new Map,c=new Map,d=0;for(let o of e){let a=Se(o.stop),l=a?n(a.at):null;if(!a||!l){o.name&&r.push({kind:"edge",presence:o,point:{x:t-8,y:Ee+d++*Pe}});continue}if(!o.name){let p=c.get(a.at);c.set(a.at,{n:(p?.n??0)+1,box:l});continue}let s=i.get(a.at)??[];if(s.push(o),i.set(a.at,s),s.length>L)continue;let u=l,b=s.length-1,h=a.audience?{x:u.x+u.width*.5+(b-1)*26,y:u.y+Math.min(u.height,24)}:{x:u.x+u.width*.5-26-b*26,y:u.y+u.height-4};r.push({kind:"person",presence:o,point:h,at:a.at,index:b,of:s.length,audience:a.audience})}for(let[o,a]of i){if(a.length<=L)continue;let l=n(o);l&&r.push({kind:"count",at:o,point:{x:l.x+l.width*.5+2*26+18,y:l.y+l.height-4},n:a.length-L})}for(let[o,{n:a,box:l}]of c)r.push({kind:"count",at:o,point:{x:l.x+l.width*.5+40,y:l.y+l.height-4},n:a});for(let o of e)if(o.name){if(o.robot?.at&&o.robot.mode!=="docked"){let a=n(o.robot.at);a&&r.push({kind:"robot",presence:o,point:{x:a.x+a.width/2+22,y:a.y+a.height-4},mode:o.robot.mode})}if(o.over){let a=n(o.over);a&&r.push({kind:"over",presence:o,box:a})}}return r}export{Tn as a,A as b,pe as c,fe as d,oe as e,Nn as f,be as g,Fn as h,ve as i,Ln as j,_n as k,jn as l,In as m,J as n,Ae as o,pn as p,fn as q,$n as r,ne as s,xn as t,bn as u,wn as v,Sn as w,En as x,Pn as y,kn as z,Mn as A,Rn as B,Cn as C};
@@ -1 +1 @@
1
- import{Bd as E,Cd as G,Ed as F,Fd as J,Lb as O,Sb as P,Ub as h,Vb as j,cc as x,fb as k}from"./chunk.IUVRJDL3.js";var W=(o,a)=>{let t=o.kindOf(a);return t===void 0?void 0:o.kept?.({id:a,kind:t})};function w(o,a){return o.flatMap(t=>{if(t.op==="splice-text")return W(a,t.id)?.(t.field)?[]:[t];if(t.op!=="patch-node")return[t];let i=W(a,t.id);if(!i||!Object.keys(t.after).some(i))return[t];let c=r=>Object.fromEntries(Object.entries(r).filter(([f])=>!i(f))),n=c(t.after);return Object.keys(n).length===0?[]:[{op:"patch-node",id:t.id,before:c(t.before),after:n}]})}function _(o,a,t){if(!G(o,a))return t;let i=F(o,a),c=r=>o.graph.getNode(r)!==void 0||x(o.log).kindOf(r)!==void 0,n={...t};if(t.diff){let r=t.diff,f=E(o.log),l=o.log.length??o.log.all().length,u=t.ops?.[0]?.seq??l,M=k(a).id,y=(e,s)=>d=>f.writerAt(e,d,s),m=(e,s)=>i.shows(e.id)?i.servedWith(e,s):void 0,b=(e,s)=>e.flatMap(d=>m(d,s(d.id))??[]),S=e=>i.shows(e.from)&&i.shows(e.to)&&!h(e,i.sees),v=(e,s)=>t.ops?y(e,l):d=>s===void 0||s.includes(d)?M:f.writerAt(e,d,l),D=r.changedNodes.flatMap(e=>{let s=m(e.before,y(e.before.id,u)),d=m(e.after,v(e.after.id,e.fields));return s&&d?[{before:s,after:d,fields:e.fields.filter(p=>p in s||p in d)}]:[]}),B=new Set(r.changedNodes.map(e=>e.after.id)),g=new Map;for(let e of t.ops?.flatMap(s=>s.primitives)??t.primitives??[])e.op!=="patch-node"&&e.op!=="splice-text"||B.has(e.id)||g.set(e.id,[...g.get(e.id)??[],...e.op==="splice-text"?[e.field]:Object.keys(e.after)]);let I=[...g].flatMap(([e,s])=>{let d=o.graph.getNode(e);if(!d)return[];let p=m(d,y(e,u)),N=m(d,v(e,s));return p&&N&&JSON.stringify(p)!==JSON.stringify(N)?[{before:p,after:N,fields:s}]:[]});n.diff={addedNodes:b(r.addedNodes,e=>v(e)),removedNodes:b(r.removedNodes,e=>y(e,u)),changedNodes:[...D,...I],addedEdges:r.addedEdges.filter(S),removedEdges:r.removedEdges.filter(S),touched:[...r.touched.filter(i.shows),...[...g.keys()].filter(e=>i.shows(e)&&!r.touched.includes(e))]}}if(t.ops&&(n.ops=j(t.ops,i)),t.primitives){let r=n.ops;n.primitives=r?r.flatMap(f=>f.primitives):i.timeline?O(t.primitives,i.timeline,{served:(f,l)=>i.servedWith(f,l),edgeClean:f=>!h(f,i.sees),sees:i.sees},k(a).id):j([{id:"",seq:0,batch:"",author:{kind:"system"},intent:"",mutation:null,primitives:t.primitives,reads:[],writes:[],at:""}],i)[0].primitives}return i.kept&&n.primitives&&(n.primitives=w(n.primitives,i)),t.reads&&(n.reads=t.reads.filter(r=>i.shows(r)&&c(r))),t.writes&&(n.writes=t.writes.filter(i.shows)),t.intent!==void 0&&h(t.intent,i.sees)&&(n.intent=P),t.violationsAfter&&Object.assign(n,A?A(o,J(o,a),!!t.ops,n.primitives??[]):{introduces:[],resolves:[],violationsAfter:[]}),n}var A,z=o=>void(A=o);export{_ as a,z as b};
1
+ import{Bd as E,Cd as G,Ed as F,Fd as J,Lb as O,Sb as P,Ub as h,Vb as j,cc as x,fb as k}from"./chunk.ZDUKVXBI.js";var W=(o,a)=>{let t=o.kindOf(a);return t===void 0?void 0:o.kept?.({id:a,kind:t})};function w(o,a){return o.flatMap(t=>{if(t.op==="splice-text")return W(a,t.id)?.(t.field)?[]:[t];if(t.op!=="patch-node")return[t];let i=W(a,t.id);if(!i||!Object.keys(t.after).some(i))return[t];let c=r=>Object.fromEntries(Object.entries(r).filter(([f])=>!i(f))),n=c(t.after);return Object.keys(n).length===0?[]:[{op:"patch-node",id:t.id,before:c(t.before),after:n}]})}function _(o,a,t){if(!G(o,a))return t;let i=F(o,a),c=r=>o.graph.getNode(r)!==void 0||x(o.log).kindOf(r)!==void 0,n={...t};if(t.diff){let r=t.diff,f=E(o.log),l=o.log.length??o.log.all().length,u=t.ops?.[0]?.seq??l,M=k(a).id,y=(e,s)=>d=>f.writerAt(e,d,s),m=(e,s)=>i.shows(e.id)?i.servedWith(e,s):void 0,b=(e,s)=>e.flatMap(d=>m(d,s(d.id))??[]),S=e=>i.shows(e.from)&&i.shows(e.to)&&!h(e,i.sees),v=(e,s)=>t.ops?y(e,l):d=>s===void 0||s.includes(d)?M:f.writerAt(e,d,l),D=r.changedNodes.flatMap(e=>{let s=m(e.before,y(e.before.id,u)),d=m(e.after,v(e.after.id,e.fields));return s&&d?[{before:s,after:d,fields:e.fields.filter(p=>p in s||p in d)}]:[]}),B=new Set(r.changedNodes.map(e=>e.after.id)),g=new Map;for(let e of t.ops?.flatMap(s=>s.primitives)??t.primitives??[])e.op!=="patch-node"&&e.op!=="splice-text"||B.has(e.id)||g.set(e.id,[...g.get(e.id)??[],...e.op==="splice-text"?[e.field]:Object.keys(e.after)]);let I=[...g].flatMap(([e,s])=>{let d=o.graph.getNode(e);if(!d)return[];let p=m(d,y(e,u)),N=m(d,v(e,s));return p&&N&&JSON.stringify(p)!==JSON.stringify(N)?[{before:p,after:N,fields:s}]:[]});n.diff={addedNodes:b(r.addedNodes,e=>v(e)),removedNodes:b(r.removedNodes,e=>y(e,u)),changedNodes:[...D,...I],addedEdges:r.addedEdges.filter(S),removedEdges:r.removedEdges.filter(S),touched:[...r.touched.filter(i.shows),...[...g.keys()].filter(e=>i.shows(e)&&!r.touched.includes(e))]}}if(t.ops&&(n.ops=j(t.ops,i)),t.primitives){let r=n.ops;n.primitives=r?r.flatMap(f=>f.primitives):i.timeline?O(t.primitives,i.timeline,{served:(f,l)=>i.servedWith(f,l),edgeClean:f=>!h(f,i.sees),sees:i.sees},k(a).id):j([{id:"",seq:0,batch:"",author:{kind:"system"},intent:"",mutation:null,primitives:t.primitives,reads:[],writes:[],at:""}],i)[0].primitives}return i.kept&&n.primitives&&(n.primitives=w(n.primitives,i)),t.reads&&(n.reads=t.reads.filter(r=>i.shows(r)&&c(r))),t.writes&&(n.writes=t.writes.filter(i.shows)),t.intent!==void 0&&h(t.intent,i.sees)&&(n.intent=P),t.violationsAfter&&Object.assign(n,A?A(o,J(o,a),!!t.ops,n.primitives??[]):{introduces:[],resolves:[],violationsAfter:[]}),n}var A,z=o=>void(A=o);export{_ as a,z as b};
@@ -1 +1 @@
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{F as g,G as T,Oa as C,Y as v,ha as S}from"./chunk.CUA7F3YJ.js";import{a as m}from"./chunk.SDO3U72B.js";import"./chunk.IUVRJDL3.js";import"./chunk.FQLNBIQ5.js";import{b as c}from"./chunk.AJZBJBMO.js";var n=c(T(),1),r=c(v(),1),s=null,u=null,f=new Set,a=()=>{for(let e of f)e()},y=e=>(f.add(e),()=>void f.delete(e)),E=300,d=()=>{u!==null&&clearTimeout(u),u=null};function q(e,t){d(),x.prefetch(),!(s?.element===t&&s.target.on===e.on)&&(s={target:e,element:t},a())}function M(e=!1){if(d(),s!==null){if(e){s=null,a();return}u=setTimeout(()=>{u=null,s=null,a()},E)}}var R=()=>d(),P=()=>s,b="graview:hover-chips",h;function A(e){if(h!==void 0)return h;try{return(e??localStorage).getItem(b)!=="off"}catch{return!0}}function I(e,t){h=e;try{(t??localStorage).setItem(b,e?"on":"off")}catch{}e||(s=null),a()}function w(){let e=S(),t=g(e?.ai),o=e?.memory,l=(0,n.useSyncExternalStore)(y,()=>A(o),()=>!1),i=(0,n.useCallback)(H=>I(H,o),[o]);return{offered:t,on:t&&l,set:i}}function z({legend:e,style:t,choice:o}){let l=w();return l.offered?(0,r.jsxs)("fieldset",{"data-testid":"setting-hover-chips",style:{border:0,margin:0,padding:0,display:"grid",gap:5,...t},children:[(0,r.jsx)("legend",{style:{...e,padding:0},children:"AI suggestions on hover"}),(0,r.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:"A quiet suggestion beside a record the pointer rests on, when the AI is sure of one."}),(0,r.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[!0,!1].map(i=>(0,r.jsx)("button",{type:"button","aria-pressed":l.on===i,"data-testid":`setting-hover-chips-${i?"on":"off"}`,onClick:()=>l.set(i),style:o(l.on===i),children:i?"On":"Off"},String(i)))})]}):null}var x=C(m(()=>(__graviewPreload(import.meta.url,["./chunk.M7DJJRFH.js","./chunk.6VG2LCES.js","./chunk.I3ADXJQW.js","./chunk.BJUUSIQY.js","./chunk.HMV4ILAC.js","./chunk.UVMHC6VM.js","./chunk.XAN7QXMQ.js","./chunk.XJ4JYROM.js","./chunk.XOZU4OFA.js","./chunk.CHG522KL.js","./chunk.7QWGIGHM.js","./chunk.ZGJUCVT5.js","./chunk.CVVNHQPO.js","./chunk.YIDNZTON.js","./chunk.QILGAV7H.js","./chunk.I6HIVTXU.js","./chunk.PYGNO2AV.js","./chunk.3HFBHLXC.js","./chunk.CUA7F3YJ.js","./chunk.SDO3U72B.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4VTUC5TF.js")))),k=x.part((e,t)=>{let o=e.HoverChip;return(0,r.jsx)(o,{...t})},{quiet:!0}),p=null,O=()=>p;function L(){let{on:e}=w(),t=(0,n.useSyncExternalStore)(y,P,()=>null),[o]=(0,n.useState)(()=>Symbol("hover-chip")),l=(0,n.useSyncExternalStore)(y,O,()=>null);return(0,n.useEffect)(()=>{if(e)return p===null&&(p=o,a()),()=>{p===o&&(p=null,s=null,d(),a())}},[e,o,l]),!e||t===null||l!==o||!t.element.isConnected?null:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(k,{rest:t,hold:R,leave:M})})}export{L as HoverChipDoor,z as HoverChipsSwitch,R as holdRest,A as hoverChipsWanted,M as leaveRest,q as restOn,I as setHoverChipsWanted,w as useHoverChipsSetting};
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{F as g,G as T,Qa as C,_ as v,ja as S}from"./chunk.ASNVH2G4.js";import{a as m}from"./chunk.SDO3U72B.js";import"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as c}from"./chunk.AJZBJBMO.js";var n=c(T(),1),r=c(v(),1),s=null,u=null,f=new Set,a=()=>{for(let e of f)e()},y=e=>(f.add(e),()=>void f.delete(e)),E=300,d=()=>{u!==null&&clearTimeout(u),u=null};function q(e,t){d(),x.prefetch(),!(s?.element===t&&s.target.on===e.on)&&(s={target:e,element:t},a())}function M(e=!1){if(d(),s!==null){if(e){s=null,a();return}u=setTimeout(()=>{u=null,s=null,a()},E)}}var R=()=>d(),P=()=>s,b="graview:hover-chips",h;function A(e){if(h!==void 0)return h;try{return(e??localStorage).getItem(b)!=="off"}catch{return!0}}function I(e,t){h=e;try{(t??localStorage).setItem(b,e?"on":"off")}catch{}e||(s=null),a()}function w(){let e=S(),t=g(e?.ai),o=e?.memory,l=(0,n.useSyncExternalStore)(y,()=>A(o),()=>!1),i=(0,n.useCallback)(H=>I(H,o),[o]);return{offered:t,on:t&&l,set:i}}function z({legend:e,style:t,choice:o}){let l=w();return l.offered?(0,r.jsxs)("fieldset",{"data-testid":"setting-hover-chips",style:{border:0,margin:0,padding:0,display:"grid",gap:5,...t},children:[(0,r.jsx)("legend",{style:{...e,padding:0},children:"AI suggestions on hover"}),(0,r.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:"A quiet suggestion beside a record the pointer rests on, when the AI is sure of one."}),(0,r.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[!0,!1].map(i=>(0,r.jsx)("button",{type:"button","aria-pressed":l.on===i,"data-testid":`setting-hover-chips-${i?"on":"off"}`,onClick:()=>l.set(i),style:o(l.on===i),children:i?"On":"Off"},String(i)))})]}):null}var x=C(m(()=>(__graviewPreload(import.meta.url,["./chunk.GMHBAS45.js","./chunk.4VX7GPFS.js","./chunk.FQ2QUDZS.js","./chunk.BJUUSIQY.js","./chunk.VGQDPEB5.js","./chunk.6YKKZI4H.js","./chunk.WIVNFOQR.js","./chunk.ONVYKLRX.js","./chunk.XOZU4OFA.js","./chunk.53GQQETN.js","./chunk.SMF5S4DQ.js","./chunk.T3RFZ66S.js","./chunk.TDWJU6GW.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.RJ6KEVZC.js")))),k=x.part((e,t)=>{let o=e.HoverChip;return(0,r.jsx)(o,{...t})},{quiet:!0}),p=null,O=()=>p;function L(){let{on:e}=w(),t=(0,n.useSyncExternalStore)(y,P,()=>null),[o]=(0,n.useState)(()=>Symbol("hover-chip")),l=(0,n.useSyncExternalStore)(y,O,()=>null);return(0,n.useEffect)(()=>{if(e)return p===null&&(p=o,a()),()=>{p===o&&(p=null,s=null,d(),a())}},[e,o,l]),!e||t===null||l!==o||!t.element.isConnected?null:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(k,{rest:t,hold:R,leave:M})})}export{L as HoverChipDoor,z as HoverChipsSwitch,R as holdRest,A as hoverChipsWanted,M as leaveRest,q as restOn,I as setHoverChipsWanted,w as useHoverChipsSetting};