graview 0.1.65 → 0.1.66

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 (261) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/index.js.map +1 -1
  3. package/dist/preview/{chunk.6RZHKQP3.js → chunk.2KFZHUAC.js} +1 -1
  4. package/dist/preview/chunk.2MHNPBHC.js +1 -0
  5. package/dist/preview/{chunk.2PK335JQ.js → chunk.2VR7YEJ6.js} +1 -1
  6. package/dist/preview/chunk.32SHA3EY.js +1 -0
  7. package/dist/preview/chunk.3L4JMM3P.js +1 -0
  8. package/dist/preview/chunk.3PBTN7RO.js +1 -0
  9. package/dist/preview/chunk.45JP6VGJ.js +5 -0
  10. package/dist/preview/{chunk.INTJD5WG.js → chunk.4AC2QM7T.js} +1 -1
  11. package/dist/preview/chunk.4FCFNAA4.js +1 -0
  12. package/dist/preview/chunk.4FDVINRJ.js +1 -0
  13. package/dist/preview/chunk.4JULYKGD.js +1 -0
  14. package/dist/preview/chunk.4U4D7WOI.js +1 -0
  15. package/dist/preview/chunk.4WGYUYWU.js +2 -0
  16. package/dist/preview/chunk.5B5SRTUK.js +1 -0
  17. package/dist/preview/chunk.5BX66FBP.js +1 -0
  18. package/dist/preview/chunk.5CXIEYHY.js +2 -0
  19. package/dist/preview/chunk.5EMIWORS.js +1 -0
  20. package/dist/preview/{chunk.KIQXTQDU.js → chunk.5FNFRVTL.js} +1 -1
  21. package/dist/preview/chunk.5LJVOLKR.js +1 -0
  22. package/dist/preview/{chunk.GPCKOYSF.js → chunk.6EHHMWPP.js} +1 -1
  23. package/dist/preview/chunk.6EVMXBNB.js +1 -0
  24. package/dist/preview/chunk.6FQW6FNL.js +1 -0
  25. package/dist/preview/chunk.6HY6ZGEE.js +5 -0
  26. package/dist/preview/{chunk.DICM56FT.js → chunk.6LXIEM6B.js} +1 -1
  27. package/dist/preview/chunk.6MQ5NT7S.js +1 -0
  28. package/dist/preview/chunk.6P6NGZ6D.js +1 -0
  29. package/dist/preview/{chunk.F2TWV4TX.js → chunk.6TLXFMX2.js} +1 -1
  30. package/dist/preview/chunk.72XP2ARZ.js +1 -0
  31. package/dist/preview/{chunk.QSDBF7VL.js → chunk.72ZCLEQC.js} +1 -1
  32. package/dist/preview/{chunk.LY5CY7GE.js → chunk.7BIPZTJB.js} +1 -1
  33. package/dist/preview/chunk.7VADSNPZ.js +1 -0
  34. package/dist/preview/{chunk.IR4OW67N.js → chunk.7VP6Y6D2.js} +1 -1
  35. package/dist/preview/{chunk.C437FVD7.js → chunk.7ZKBYXUM.js} +1 -1
  36. package/dist/preview/chunk.AK7NGFEX.js +6 -0
  37. package/dist/preview/{chunk.FHHVW2WB.js → chunk.ANS2IEEV.js} +1 -1
  38. package/dist/preview/{chunk.LKK5YF2H.js → chunk.B6JRTW3A.js} +1 -1
  39. package/dist/preview/chunk.BCQWAFGD.js +1 -0
  40. package/dist/preview/{chunk.SOMRYDDH.js → chunk.BFAFCVL4.js} +1 -1
  41. package/dist/preview/chunk.BGAC3B7X.js +1 -0
  42. package/dist/preview/chunk.BMENTGDC.js +21 -0
  43. package/dist/preview/chunk.BOCVLC7X.js +1 -0
  44. package/dist/preview/{chunk.IMKD6QQG.js → chunk.BUVTUAB5.js} +1 -1
  45. package/dist/preview/chunk.BXBEGMPO.js +22 -0
  46. package/dist/preview/{chunk.ZYNC73DJ.js → chunk.BZ7QWHAE.js} +1 -1
  47. package/dist/preview/{chunk.AB4RZSYW.js → chunk.C2C3AXGI.js} +16 -16
  48. package/dist/preview/chunk.CBXS23YH.js +23 -0
  49. package/dist/preview/chunk.CEQQIW7Z.js +1 -0
  50. package/dist/preview/chunk.CEVGND3Y.js +6 -0
  51. package/dist/preview/{chunk.ZDUTEM3Z.js → chunk.CTASTRQN.js} +1 -1
  52. package/dist/preview/chunk.CU2WCYMK.js +1 -0
  53. package/dist/preview/{chunk.SPCAMQJE.js → chunk.CVPMSPCH.js} +1 -1
  54. package/dist/preview/chunk.DEHIR4EG.js +1 -0
  55. package/dist/preview/chunk.DPJNGFEZ.js +4 -0
  56. package/dist/preview/chunk.DQFHIJFN.js +1 -0
  57. package/dist/preview/chunk.DSYP43NN.js +1 -0
  58. package/dist/preview/chunk.DTCAUPLC.js +1 -0
  59. package/dist/preview/{chunk.7Q43N5JS.js → chunk.DZFM6GSY.js} +1 -1
  60. package/dist/preview/chunk.E3UL4MCD.js +35 -0
  61. package/dist/preview/chunk.E4VRRWFP.js +1 -0
  62. package/dist/preview/{chunk.6YDC6IDA.js → chunk.E7EWNWAN.js} +1 -1
  63. package/dist/preview/chunk.EG7OOJH5.js +1 -0
  64. package/dist/preview/{chunk.J6KNEI5R.js → chunk.EMFOMSMI.js} +1 -1
  65. package/dist/preview/{chunk.5THLLSS4.js → chunk.EQ4OODGO.js} +1 -1
  66. package/dist/preview/{chunk.P6TZGR3A.js → chunk.ES63XSIM.js} +1 -1
  67. package/dist/preview/chunk.EUAO4QNV.js +1 -0
  68. package/dist/preview/{chunk.O2W5JTWA.js → chunk.EXYCN4WI.js} +1 -1
  69. package/dist/preview/chunk.F4VB6Q2W.js +1 -0
  70. package/dist/preview/chunk.F7672TKJ.js +1 -0
  71. package/dist/preview/chunk.FA42HCPW.js +1 -0
  72. package/dist/preview/{chunk.L6FGKJ5H.js → chunk.FBILPNGH.js} +1 -1
  73. package/dist/preview/chunk.FBJAQPZ6.js +1 -0
  74. package/dist/preview/{chunk.FDWRH5P2.js → chunk.FDZE5LTJ.js} +2 -2
  75. package/dist/preview/{chunk.FOSY7MZF.js → chunk.FFOD5B4B.js} +1 -1
  76. package/dist/preview/{chunk.XSWR5LI4.js → chunk.FIFUMX5X.js} +1 -1
  77. package/dist/preview/{chunk.RFVOXX3P.js → chunk.FK722SHI.js} +1 -1
  78. package/dist/preview/chunk.FV72U33M.js +1 -0
  79. package/dist/preview/chunk.FXT5CN32.js +19 -0
  80. package/dist/preview/chunk.GAFMWOME.js +1 -0
  81. package/dist/preview/{chunk.PTQPS2FJ.js → chunk.GEFXU4VO.js} +1 -1
  82. package/dist/preview/chunk.GG47EIKO.js +1 -0
  83. package/dist/preview/{chunk.5M34BJIQ.js → chunk.GME63ZHI.js} +1 -1
  84. package/dist/preview/{chunk.IJ3YDBWI.js → chunk.GNEOSHQ6.js} +1 -1
  85. package/dist/preview/{chunk.N2FNHRI2.js → chunk.HOCD7KIR.js} +1 -1
  86. package/dist/preview/chunk.HSSIMVVM.js +1 -0
  87. package/dist/preview/{chunk.S2DOVJRL.js → chunk.I2737CPF.js} +1 -1
  88. package/dist/preview/chunk.I4Z7HVRT.js +1 -0
  89. package/dist/preview/{chunk.F5VEHAP2.js → chunk.IAEHUSQQ.js} +1 -1
  90. package/dist/preview/{chunk.7E4CSXBT.js → chunk.IGK7EZCX.js} +1 -1
  91. package/dist/preview/chunk.INHS3KTK.js +1 -0
  92. package/dist/preview/{chunk.LGRQDILY.js → chunk.IWYMKGZZ.js} +1 -1
  93. package/dist/preview/{chunk.3RFAUIGT.js → chunk.J2MM6BUW.js} +1 -1
  94. package/dist/preview/{chunk.7IGD2K4M.js → chunk.J7W2OFHY.js} +1 -1
  95. package/dist/preview/chunk.JMXXA4YG.js +1 -0
  96. package/dist/preview/chunk.JMYUQNXN.js +6 -0
  97. package/dist/preview/chunk.JO2X52D4.js +1 -0
  98. package/dist/preview/{chunk.2QQ37RCZ.js → chunk.JXNVNFV4.js} +1 -1
  99. package/dist/preview/chunk.K6DFXDPZ.js +1 -0
  100. package/dist/preview/{chunk.NSO6RUKW.js → chunk.KACSYPEV.js} +1 -1
  101. package/dist/preview/{chunk.ZMWAZACO.js → chunk.KBPJ7X7W.js} +1 -1
  102. package/dist/preview/chunk.KF27ME27.js +1 -0
  103. package/dist/preview/{chunk.35E75QJ7.js → chunk.KSIEO5W7.js} +1 -1
  104. package/dist/preview/chunk.L25DCT5S.js +1 -0
  105. package/dist/preview/{chunk.3KUYB5ZT.js → chunk.LETAQTLJ.js} +1 -1
  106. package/dist/preview/{chunk.44ZHHPPJ.js → chunk.LGRVEHXT.js} +2 -2
  107. package/dist/preview/chunk.LINSO5PN.js +1 -0
  108. package/dist/preview/{chunk.LVD3V77M.js → chunk.LLIURXFP.js} +1 -1
  109. package/dist/preview/{chunk.3IZEZPJB.js → chunk.LSN2IPAI.js} +1 -1
  110. package/dist/preview/chunk.M2JCFNHJ.js +1 -0
  111. package/dist/preview/{chunk.B3WVCSW5.js → chunk.M5FP4Y4Q.js} +1 -1
  112. package/dist/preview/{chunk.CPYBJNHP.js → chunk.M6ZN2KUO.js} +1 -1
  113. package/dist/preview/chunk.MODLZJD4.js +25 -0
  114. package/dist/preview/chunk.MWGZKZD6.js +1 -0
  115. package/dist/preview/{chunk.64FCAUAJ.js → chunk.NJRLJEJY.js} +1 -1
  116. package/dist/preview/chunk.NYLKG25K.js +4 -0
  117. package/dist/preview/{chunk.CD6YWH6T.js → chunk.OEIWIZCP.js} +1 -1
  118. package/dist/preview/{chunk.ZJFXM3LE.js → chunk.OJY7VJ7D.js} +1 -1
  119. package/dist/preview/chunk.OMT4QUZY.js +23 -0
  120. package/dist/preview/{chunk.R2TSTDS3.js → chunk.ONYBW45K.js} +1 -1
  121. package/dist/preview/chunk.OO2OP76C.js +1 -0
  122. package/dist/preview/{chunk.G3Q5IMM3.js → chunk.OOSIKCOS.js} +1 -1
  123. package/dist/preview/{chunk.7VQ3C7F4.js → chunk.OPTYYIGC.js} +1 -1
  124. package/dist/preview/{chunk.TUCSUZNO.js → chunk.OTV5XTBB.js} +1 -1
  125. package/dist/preview/{chunk.74B6KQF4.js → chunk.OWFS2YDQ.js} +1 -1
  126. package/dist/preview/{chunk.CXDGE5ZS.js → chunk.OWO3OV62.js} +1 -1
  127. package/dist/preview/{chunk.BUQKRXI6.js → chunk.PAGEGBUD.js} +1 -1
  128. package/dist/preview/{chunk.CGQ6KXVK.js → chunk.PDDIQ6PK.js} +1 -1
  129. package/dist/preview/{chunk.T3KNLP7C.js → chunk.PFQBCHQA.js} +1 -1
  130. package/dist/preview/{chunk.MH46V556.js → chunk.PPSYUOH7.js} +1 -1
  131. package/dist/preview/{chunk.HJS3LTSR.js → chunk.PSQYDCVM.js} +1 -1
  132. package/dist/preview/chunk.QDVGHI7R.js +1 -0
  133. package/dist/preview/chunk.QFHWG4LN.js +1 -0
  134. package/dist/preview/chunk.QGIM2WAY.js +1 -0
  135. package/dist/preview/chunk.QHMHUL6B.js +3 -0
  136. package/dist/preview/chunk.QOS5T46W.js +1 -0
  137. package/dist/preview/{chunk.KHAVEYT7.js → chunk.QPF4KSAW.js} +1 -1
  138. package/dist/preview/chunk.QQAZQDRW.js +1 -0
  139. package/dist/preview/chunk.QU52E5RG.js +3 -0
  140. package/dist/preview/{chunk.CS72MISN.js → chunk.QWNSHISU.js} +1 -1
  141. package/dist/preview/chunk.RSMCTI2N.js +1 -0
  142. package/dist/preview/chunk.RWIN3POV.js +1 -0
  143. package/dist/preview/chunk.SSF47GUY.js +1 -0
  144. package/dist/preview/chunk.T6DPWW2K.js +3 -0
  145. package/dist/preview/chunk.TA36WBHK.js +1 -0
  146. package/dist/preview/chunk.TGEL6EUA.js +1 -0
  147. package/dist/preview/chunk.TTGKX7LT.js +1 -0
  148. package/dist/preview/chunk.TXHYGFIZ.js +1 -0
  149. package/dist/preview/chunk.U3ED7W2U.js +1 -0
  150. package/dist/preview/chunk.U3HERHAI.js +88 -0
  151. package/dist/preview/chunk.U6QXLNHF.js +15 -0
  152. package/dist/preview/{chunk.FXG5AJF6.js → chunk.U6TEW6YD.js} +1 -1
  153. package/dist/preview/chunk.UJPX3BUV.js +1 -0
  154. package/dist/preview/chunk.V5I4GZEY.js +1 -0
  155. package/dist/preview/{chunk.XTTESA7X.js → chunk.V7W5AQKL.js} +1 -1
  156. package/dist/preview/{chunk.IFBGYFS4.js → chunk.VGHO3VCB.js} +1 -1
  157. package/dist/preview/{chunk.2TZSLREX.js → chunk.VKZIEZ5C.js} +2 -2
  158. package/dist/preview/chunk.VT2YGDK2.js +1 -0
  159. package/dist/preview/{chunk.ZTN7BS5O.js → chunk.W4YDPHCQ.js} +1 -1
  160. package/dist/preview/{chunk.NKYYDFIX.js → chunk.W53YNBSM.js} +1 -1
  161. package/dist/preview/chunk.WAB3L3ZI.js +1 -0
  162. package/dist/preview/chunk.WSDJPXJD.js +1 -0
  163. package/dist/preview/chunk.WSO7JOW5.js +1 -0
  164. package/dist/preview/{chunk.BU5PVRX7.js → chunk.WVLEGCRI.js} +1 -1
  165. package/dist/preview/chunk.XK65Y2KX.js +1 -0
  166. package/dist/preview/chunk.XMQG2PSM.js +50 -0
  167. package/dist/preview/{chunk.QO5RXOCS.js → chunk.XOE4KNP2.js} +2 -2
  168. package/dist/preview/chunk.YIPXZUTT.js +2 -0
  169. package/dist/preview/chunk.YNEHJWJV.js +2 -0
  170. package/dist/preview/{chunk.S3EEY7T3.js → chunk.YXEO3Y65.js} +1 -1
  171. package/dist/preview/chunk.Z274CL7J.js +1 -0
  172. package/dist/preview/{chunk.NBVPWLRY.js → chunk.Z7Y3R3YR.js} +1 -1
  173. package/dist/preview/{chunk.DJMSXXP4.js → chunk.ZBVYD4OX.js} +1 -1
  174. package/dist/preview/{chunk.4O3C2LJF.js → chunk.ZD7T234N.js} +1 -1
  175. package/dist/preview/{chunk.TY74U3EI.js → chunk.ZQR2SN65.js} +1 -1
  176. package/dist/preview/chunk.ZR2TP3BF.js +111 -0
  177. package/dist/preview/chunk.ZRBGYXAO.js +6 -0
  178. package/dist/preview/index.html +56 -54
  179. package/dist/preview/page.js +2 -2
  180. package/dist/preview/splash.js +17 -14
  181. package/package.json +6 -6
  182. package/dist/preview/chunk.2P34ML3O.js +0 -111
  183. package/dist/preview/chunk.2UW5CRHF.js +0 -1
  184. package/dist/preview/chunk.2YMO7ZVX.js +0 -1
  185. package/dist/preview/chunk.33ULA3CG.js +0 -1
  186. package/dist/preview/chunk.3CJLAJXP.js +0 -25
  187. package/dist/preview/chunk.3IJSB5ET.js +0 -1
  188. package/dist/preview/chunk.3KO35VN4.js +0 -1
  189. package/dist/preview/chunk.3L37FY3G.js +0 -4
  190. package/dist/preview/chunk.3WP66LB5.js +0 -1
  191. package/dist/preview/chunk.4GJ7F4SP.js +0 -35
  192. package/dist/preview/chunk.4IJTPV5X.js +0 -1
  193. package/dist/preview/chunk.4JFBLVXJ.js +0 -1
  194. package/dist/preview/chunk.4PCVQEVI.js +0 -1
  195. package/dist/preview/chunk.5FQSYMAE.js +0 -1
  196. package/dist/preview/chunk.5NCLZ4NZ.js +0 -1
  197. package/dist/preview/chunk.5YNLFOBJ.js +0 -5
  198. package/dist/preview/chunk.77XQEDT5.js +0 -1
  199. package/dist/preview/chunk.7HPQI5SY.js +0 -1
  200. package/dist/preview/chunk.A4VA3DU5.js +0 -1
  201. package/dist/preview/chunk.ABSY3UZF.js +0 -1
  202. package/dist/preview/chunk.ARHAD5IS.js +0 -1
  203. package/dist/preview/chunk.BOC2EOGB.js +0 -9
  204. package/dist/preview/chunk.BR6TINGU.js +0 -1
  205. package/dist/preview/chunk.CDEAAWPS.js +0 -1
  206. package/dist/preview/chunk.CXJJB3MK.js +0 -1
  207. package/dist/preview/chunk.CXLQPE4J.js +0 -1
  208. package/dist/preview/chunk.DA4RSHLW.js +0 -1
  209. package/dist/preview/chunk.DJPNVXBQ.js +0 -6
  210. package/dist/preview/chunk.DJVHKBEI.js +0 -1
  211. package/dist/preview/chunk.DVSTLVIH.js +0 -15
  212. package/dist/preview/chunk.E5WJSTOV.js +0 -1
  213. package/dist/preview/chunk.FEGSYSA7.js +0 -1
  214. package/dist/preview/chunk.HJUXC5GM.js +0 -1
  215. package/dist/preview/chunk.HNMSYQRA.js +0 -1
  216. package/dist/preview/chunk.HWLRKOI3.js +0 -1
  217. package/dist/preview/chunk.IHUMKFYH.js +0 -10
  218. package/dist/preview/chunk.IQ54QTA5.js +0 -1
  219. package/dist/preview/chunk.IQC3GOXO.js +0 -1
  220. package/dist/preview/chunk.ISN2QTVL.js +0 -2
  221. package/dist/preview/chunk.J24YPQ5I.js +0 -5
  222. package/dist/preview/chunk.J545NAMY.js +0 -1
  223. package/dist/preview/chunk.K2HDEL7I.js +0 -1
  224. package/dist/preview/chunk.K3JARAWU.js +0 -1
  225. package/dist/preview/chunk.KROR65KD.js +0 -2
  226. package/dist/preview/chunk.KV7GZBJ6.js +0 -50
  227. package/dist/preview/chunk.L7NJLZWV.js +0 -1
  228. package/dist/preview/chunk.LON75VHP.js +0 -1
  229. package/dist/preview/chunk.LQWVJQ5X.js +0 -18
  230. package/dist/preview/chunk.M5W2RHC6.js +0 -1
  231. package/dist/preview/chunk.M6BTLH24.js +0 -1
  232. package/dist/preview/chunk.MAGKI4PD.js +0 -1
  233. package/dist/preview/chunk.MD36ZSM5.js +0 -74
  234. package/dist/preview/chunk.MFZJVHWP.js +0 -1
  235. package/dist/preview/chunk.MHTA4HYB.js +0 -19
  236. package/dist/preview/chunk.N2YM247R.js +0 -1
  237. package/dist/preview/chunk.N35SJWAM.js +0 -1
  238. package/dist/preview/chunk.NJSK3UO2.js +0 -6
  239. package/dist/preview/chunk.OHMHPTEW.js +0 -1
  240. package/dist/preview/chunk.PV2I4UPH.js +0 -1
  241. package/dist/preview/chunk.QFQSSZN7.js +0 -1
  242. package/dist/preview/chunk.RSS6OHXG.js +0 -1
  243. package/dist/preview/chunk.SBCAYTMT.js +0 -1
  244. package/dist/preview/chunk.SMTGRCMG.js +0 -3
  245. package/dist/preview/chunk.TCZIZ2PU.js +0 -1
  246. package/dist/preview/chunk.U74PTRHJ.js +0 -1
  247. package/dist/preview/chunk.UAORKZLO.js +0 -1
  248. package/dist/preview/chunk.UDVTPI2W.js +0 -1
  249. package/dist/preview/chunk.UETLP5KC.js +0 -1
  250. package/dist/preview/chunk.UHI3X2YD.js +0 -1
  251. package/dist/preview/chunk.UL62ELNR.js +0 -1
  252. package/dist/preview/chunk.VRYSZYAD.js +0 -1
  253. package/dist/preview/chunk.VUZFLDOX.js +0 -1
  254. package/dist/preview/chunk.X2NGFOAF.js +0 -1
  255. package/dist/preview/chunk.XE762VL2.js +0 -2
  256. package/dist/preview/chunk.Y2RZ5B4U.js +0 -1
  257. package/dist/preview/chunk.YKMBXMZE.js +0 -1
  258. package/dist/preview/chunk.Z34KASY7.js +0 -1
  259. package/dist/preview/chunk.ZMGKWMID.js +0 -1
  260. package/dist/preview/chunk.ZT5YQSSP.js +0 -21
  261. package/dist/preview/chunk.ZZM75ZTN.js +0 -4
@@ -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,m as ta,n as ra,o as ia,p as nt}from"./chunk.HNMSYQRA.js";import{c as je}from"./chunk.ZDUTEM3Z.js";import{g as Ja,h as et,i as at}from"./chunk.ZZM75ZTN.js";import"./chunk.QSDBF7VL.js";import{b as Ya,c as ja,d as Ye,e as Qa}from"./chunk.2PK335JQ.js";import"./chunk.3KUYB5ZT.js";import{m as Re,q as _a,r as Ua,s as Va}from"./chunk.IMKD6QQG.js";import{a as Za}from"./chunk.HJCQ6I3S.js";import{b as Xa}from"./chunk.ZJFXM3LE.js";import"./chunk.PTQPS2FJ.js";import{b as Ka}from"./chunk.M5W2RHC6.js";import{b as Ge,d as Ue,e as Ve}from"./chunk.RFVOXX3P.js";import"./chunk.GPCKOYSF.js";import"./chunk.UETLP5KC.js";import{b as _e}from"./chunk.IQC3GOXO.js";import"./chunk.NKYYDFIX.js";import"./chunk.6RZHKQP3.js";import"./chunk.L7NJLZWV.js";import"./chunk.XSWR5LI4.js";import"./chunk.BIDL7GQD.js";import"./chunk.XTTESA7X.js";import"./chunk.J6KNEI5R.js";import"./chunk.2YMO7ZVX.js";import"./chunk.U5P23GO7.js";import{e as tt}from"./chunk.Z34KASY7.js";import"./chunk.BUQKRXI6.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.UHI3X2YD.js";import"./chunk.INTJD5WG.js";import"./chunk.2QQ37RCZ.js";import"./chunk.MIE4TJRW.js";import{c as Ba,d as Da,e as we,p as Wa}from"./chunk.CXJJB3MK.js";import"./chunk.OJGHDWI6.js";import"./chunk.74B6KQF4.js";import"./chunk.DA4RSHLW.js";import"./chunk.FOSY7MZF.js";import"./chunk.NBVPWLRY.js";import"./chunk.S3EEY7T3.js";import"./chunk.SPCAMQJE.js";import"./chunk.TUCSUZNO.js";import"./chunk.ZMWAZACO.js";import"./chunk.CD6YWH6T.js";import{J as Ga,e as Ha,f as Oa,m as qe,q as Fa,x as qa}from"./chunk.MD36ZSM5.js";import{b as Ta,c as At}from"./chunk.L6FGKJ5H.js";import{G as _,Ka as Ee,Pa,Qa as U,Ta as Na,V as A,Xa as Ia,aa as za,ca as Ma,da as T,fa as Ae,i as Ke,j as $e,m as ee,n as Ce,o as Fe,oa as La,r as ve,x as Ea,y as ue,z as Ra}from"./chunk.3CJLAJXP.js";import{a as ie}from"./chunk.SDO3U72B.js";import{Qc as Aa,Z as re,na as $a,oa as Se,pa as G,qd as O,sd as B,ta as Ca}from"./chunk.J24YPQ5I.js";import"./chunk.FQLNBIQ5.js";import{b as f}from"./chunk.AJZBJBMO.js";function Et(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,m as ta,n as ra,o as ia}from"./chunk.OO2OP76C.js";import{c as je}from"./chunk.CTASTRQN.js";import{g as Ja,h as et,i as at}from"./chunk.DPJNGFEZ.js";import"./chunk.72ZCLEQC.js";import{b as Ya,c as ja,d as Ye,e as Qa}from"./chunk.2VR7YEJ6.js";import"./chunk.LETAQTLJ.js";import{m as Ee,q as _a,r as Ua,s as Va}from"./chunk.BUVTUAB5.js";import{a as Za}from"./chunk.HJCQ6I3S.js";import{b as Xa}from"./chunk.OJY7VJ7D.js";import"./chunk.GEFXU4VO.js";import{b as Ka}from"./chunk.QU52E5RG.js";import"./chunk.7VADSNPZ.js";import{b as _e,d as Ue,e as Ve}from"./chunk.FK722SHI.js";import"./chunk.U5P23GO7.js";import"./chunk.6EHHMWPP.js";import"./chunk.TXHYGFIZ.js";import{b as Ge}from"./chunk.WAB3L3ZI.js";import"./chunk.W53YNBSM.js";import"./chunk.2KFZHUAC.js";import"./chunk.V5I4GZEY.js";import"./chunk.FIFUMX5X.js";import"./chunk.BIDL7GQD.js";import"./chunk.V7W5AQKL.js";import"./chunk.EMFOMSMI.js";import"./chunk.QOS5T46W.js";import{i as tt}from"./chunk.SSF47GUY.js";import"./chunk.PAGEGBUD.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.4FCFNAA4.js";import"./chunk.4AC2QM7T.js";import"./chunk.JXNVNFV4.js";import"./chunk.CVPMSPCH.js";import"./chunk.OTV5XTBB.js";import"./chunk.KBPJ7X7W.js";import"./chunk.OEIWIZCP.js";import"./chunk.MIE4TJRW.js";import{c as Ba,d as Da,e as ue,p as Wa}from"./chunk.5LJVOLKR.js";import"./chunk.OJGHDWI6.js";import"./chunk.OWFS2YDQ.js";import"./chunk.WSDJPXJD.js";import"./chunk.F4VB6Q2W.js";import"./chunk.FFOD5B4B.js";import"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import{K as Ga,e as Ha,f as Oa,m as qe,q as Fa,x as qa}from"./chunk.U3HERHAI.js";import{b as Ta,c as Ct}from"./chunk.FBILPNGH.js";import{G as _,La as Ae,Qa as Pa,Ra as U,Ua as Na,W as A,Ya as Ia,ba as za,da as Ma,ea as T,ga as Ce,i as Ke,j as Se,m as ee,n as $e,o as Fe,pa as La,r as ge,x as Ea,y as ve,z as Ra}from"./chunk.MODLZJD4.js";import{a as ie}from"./chunk.SDO3U72B.js";import{Rc as Aa,Z as re,na as $a,oa as ke,pa as G,rd as H,td as B,ua as Ca}from"./chunk.6HY6ZGEE.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 {
@@ -45,7 +45,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
45
45
  transform: translateY(-4px) scale(1.05);
46
46
  box-shadow: var(--graview-lift-high);
47
47
  position: relative;
48
- z-index: ${O.lines};
48
+ z-index: ${H.lines};
49
49
  }
50
50
 
51
51
 
@@ -59,7 +59,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
59
59
  left: 50%;
60
60
  top: 42px;
61
61
  transform: translateX(-50%);
62
- z-index: ${O.lines};
62
+ z-index: ${H.lines};
63
63
  display: grid;
64
64
  justify-items: center;
65
65
  gap: 4px;
@@ -80,7 +80,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
80
80
  display: grid;
81
81
  align-content: center;
82
82
  box-sizing: border-box;
83
- min-height: max(${we/16}rem, ${we}px);
83
+ min-height: max(${ue/16}rem, ${ue}px);
84
84
  padding: 3px 6px 3px 10px;
85
85
  border-left: 2px solid var(--graview-edge-bright, var(--graview-edge));
86
86
  color: var(--graview-ink);
@@ -95,7 +95,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
95
95
  .graview-drive-in-thumb-press {
96
96
  position: absolute;
97
97
  inset: 0;
98
- min-height: max(${we/16}rem, ${we}px);
98
+ min-height: max(${ue/16}rem, ${ue}px);
99
99
  margin: 0;
100
100
  padding: 0;
101
101
  border: none;
@@ -128,7 +128,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
128
128
  position: absolute;
129
129
  inset: 0;
130
130
  pointer-events: none;
131
- z-index: ${O.occupants};
131
+ z-index: ${H.occupants};
132
132
  }
133
133
  .graview-figure {
134
134
  position: absolute;
@@ -279,7 +279,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
279
279
  transition: opacity 160ms ease;
280
280
  }
281
281
  .graview-kind-card[data-graview-emphasis="lit"] {
282
- z-index: ${O.stage};
282
+ z-index: ${H.stage};
283
283
  }
284
284
  .graview-kind-card[data-graview-emphasis="lit"] .graview-kind-face {
285
285
  border-color: var(--graview-accent) !important;
@@ -366,7 +366,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
366
366
  position: absolute;
367
367
  inset: 0;
368
368
  pointer-events: none;
369
- z-index: ${O.seatMarks};
369
+ z-index: ${H.seatMarks};
370
370
  }
371
371
  .graview-seat-mark {
372
372
  position: absolute;
@@ -466,7 +466,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
466
466
  }
467
467
  .graview-ribbon-said,
468
468
  .graview-record-link-said {
469
- z-index: ${O.tieLabels};
469
+ z-index: ${H.tieLabels};
470
470
  box-sizing: border-box;
471
471
  white-space: nowrap;
472
472
  font-size: 0.8125rem;
@@ -620,7 +620,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
620
620
  position: absolute;
621
621
  top: -9px;
622
622
  right: 14px;
623
- z-index: ${O.tag};
623
+ z-index: ${H.tag};
624
624
  display: var(--graview-kit-tags, inline-flex);
625
625
  align-items: center;
626
626
  gap: 5px;
@@ -826,7 +826,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
826
826
  border-radius: 5px !important;
827
827
  background: var(--graview-panel) !important;
828
828
  box-shadow: 0 1px 2px rgba(0, 0, 0, ${e==="light"?"0.08":"0.3"}) !important;
829
- z-index: ${O.tag};
829
+ z-index: ${H.tag};
830
830
  }
831
831
  [data-graview-altitude] [data-graview-plot] .graview-kind-face {
832
832
  top: calc(var(--graview-front-y) + 4px) !important;
@@ -927,7 +927,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
927
927
  [data-graview-altitude] [data-graview-plot]:hover,
928
928
  [data-graview-altitude] [data-graview-plot]:focus-within,
929
929
  [data-graview-altitude] [data-graview-plot]:has(.graview-drive-in[data-graview-showing]) {
930
- z-index: ${O.opened} !important;
930
+ z-index: ${H.opened} !important;
931
931
  }
932
932
 
933
933
  [data-graview-altitude] [data-graview-landmark]:not([data-graview-plot] *) .graview-kind-face {
@@ -993,7 +993,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
993
993
  right: calc(16px + var(--graview-dock, 0px));
994
994
  bottom: calc(16px + var(--graview-scene-foot, var(--graview-sheet, 0px)));
995
995
 
996
- z-index: ${O.zoom};
996
+ z-index: ${H.zoom};
997
997
  display: inline-flex;
998
998
  align-items: center;
999
999
  gap: 2px;
@@ -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=Et(e);return o.scope===void 0?d:Ta(d,o.scope)}var H=f(_(),1);var V=f(A(),1),Rt=Ee(ie(()=>(__graviewPreload(import.meta.url,["./chunk.MD36ZSM5.js","./chunk.L6FGKJ5H.js","./chunk.3CJLAJXP.js","./chunk.SDO3U72B.js","./chunk.J24YPQ5I.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.P6TZGR3A.js")))).part(e=>(0,V.jsx)(e.MapKey,{}),{quiet:!0});function oa(){let{store:e}=T(),{view:o}=U(),d=Ae(),s=(0,H.useMemo)(()=>e.graph.allEdges().length>0,[e,d]),[n,m]=(0,H.useState)(!1),v=(0,H.useId)(),g=(0,H.useRef)(null),y=(0,H.useRef)(null);(0,H.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,H.useState)(null);return(0,H.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)(Rt,{}):null,(0,V.jsx)(rt,{inside:!0,widthOf:Za})]}):null]}):null}var ze=f(_(),1),Te=f(A(),1);function ot(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 Tt=Ee(ie(()=>(__graviewPreload(import.meta.url,["./chunk.ZZM75ZTN.js","./chunk.R2TSTDS3.js","./chunk.2PK335JQ.js","./chunk.3KUYB5ZT.js","./chunk.IMKD6QQG.js","./chunk.HJCQ6I3S.js","./chunk.ZJFXM3LE.js","./chunk.PTQPS2FJ.js","./chunk.6RZHKQP3.js","./chunk.N35SJWAM.js","./chunk.L7NJLZWV.js","./chunk.QO5RXOCS.js","./chunk.XSWR5LI4.js","./chunk.BIDL7GQD.js","./chunk.XTTESA7X.js","./chunk.J6KNEI5R.js","./chunk.2YMO7ZVX.js","./chunk.Q5WEOX3Q.js","./chunk.UHI3X2YD.js","./chunk.INTJD5WG.js","./chunk.2QQ37RCZ.js","./chunk.MIE4TJRW.js","./chunk.CXJJB3MK.js","./chunk.OJGHDWI6.js","./chunk.74B6KQF4.js","./chunk.WVUJXDXZ.js","./chunk.S2DOVJRL.js","./chunk.64FCAUAJ.js","./chunk.DA4RSHLW.js","./chunk.FOSY7MZF.js","./chunk.NBVPWLRY.js","./chunk.S3EEY7T3.js","./chunk.SPCAMQJE.js","./chunk.TUCSUZNO.js","./chunk.ZMWAZACO.js","./chunk.CD6YWH6T.js","./chunk.MD36ZSM5.js","./chunk.L6FGKJ5H.js","./chunk.3CJLAJXP.js","./chunk.SDO3U72B.js","./chunk.J24YPQ5I.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.SMTGRCMG.js")))),zt=Tt.part((e,o)=>(0,Te.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();Ae();let m=(0,ze.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1);if(!o.overview||m)return null;let v=ot(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,Te.jsx)(ze.Suspense,{fallback:null,children:(0,Te.jsx)(zt,{showing:v})})}var Mt=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($e(ee(e,!1),g))},S=(()=>{if(!g)return null;let k=Ea(g)[0],w=e.within?.view,R=(w?s.places().find(N=>N.as===w):void 0)??(k?s.places().filter(N=>N.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,Me=e=>e!==void 0&&"hit"in e&&e.hit.about==="node"?e:void 0,Lt=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Pt(e){let o=()=>typeof window>"u"||window.innerWidth>=Gt,[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 ct({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=Pt(e),R=(0,u.useRef)(null),N=(0,u.useRef)(null),z=(0,u.useRef)(null),W=(0,u.useId)(),[Le,I]=(0,u.useState)(!1),[K,se]=(0,u.useState)(null),[bt,he]=(0,u.useState)(null),[Pe,be]=(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,ge=Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLSelectElement||Z instanceof HTMLElement&&Z.isContentEditable;l&&ge||(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(),I(!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=Lt(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(ge=>ge.hit.about!=="node"||!r||++p<=Kt),C=h.filter(ge=>ge.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,xe=c?.words??M,Ie=(0,u.useMemo)(()=>Re(xe).split(" ").filter(Boolean),[xe]),F=(0,u.useCallback)(a=>a.hit.about==="node"?Va(o,a.hit.id,xe,{principal:n,limit:Ft}).map((r,i)=>({id:`${a.id}-act-${i}`,act:r,of:a.id})):[],[o,xe,n]),He=$.find(a=>a.id===K),q=$.find(a=>a.id===bt)??He??$[0],de=(0,u.useMemo)(()=>w&&Me(q)?F(q):[],[w,q?.id,F]),ye=(0,u.useMemo)(()=>w?new Map:new Map(Pe.flatMap(a=>{let r=Me($.find(i=>i.id===a));return r?[[a,F(r)]]:[]})),[w,Pe,$,F]),xt=(0,u.useMemo)(()=>w?new Set:new Set($.flatMap(a=>Me(a)&&F(a).length>0?[a.id]:[])),[w,$,F]),Oe=(0,u.useMemo)(()=>w?de:[...ye.values()].flat(),[w,de,ye]),L=He??Oe.find(a=>a.id===K)??$[0];(0,u.useEffect)(()=>{se(null),he(null),be([])},[M]);let le=(0,u.useRef)(null);(0,u.useEffect)(()=>{let a=le.current;if(!a)return;le.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 ce=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>clearTimeout(ce.current),[]);let te=a=>{a&&(clearTimeout(ce.current),se(a.id),ne(a)||he(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&&(se(i.id),!ne(i)&&(clearTimeout(ce.current),ce.current=setTimeout(()=>he(i.id),qt)))},yt=()=>{clearTimeout(ce.current),q&&!ne(L)&&se(q.id)},kt=a=>be(r=>r.includes(a.id)?r.filter(i=>i!==a.id):[...r,a.id]),xa=a=>{let r=N.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):Dt)};(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)),I(!1);return}if("all"in a)return s(i=>ue(ee(i,!1),ve(a.all),{ownPicture:!0,...i.q?{carry:i.q}:{}})),le.current=a.all,I(!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=>Ce(p,[i]));let l=R.current?.getBoundingClientRect();m({x:l?.left??0,y:(l?.bottom??0)+6,on:i}),I(!1),R.current?.blur();return}let r=a.hit;switch(r.about){case"node":s(i=>Ce($e(ee(i,!1),r.id),[r.id]));break;case"kind":return s(i=>ue(ee(i,!1),ve(r.kind),{ownPicture:!0})),le.current=r.kind,I(!1),Be(r.kind,`Opening ${r.label}\u2026`);case"place":return s(i=>Ra(i,r.kind,r.as)),le.current=r.kind,I(!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=>Ce(l,[...new Set(i)]));break}case"act":break}I(!1),R.current?.blur()},St=c?Bt(c.byKind,c.hits,o.schema):"",pe=Le&&M.trim().length>0,$t=(0,u.useCallback)(()=>{let a=R.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Yt};let r=R.current?.getBoundingClientRect();return r?{x:r.right,y:r.bottom}:null},[]),ya=Ia("find",{open:pe,onOpenChange:a=>{a||I(!1)},...e?{at:$t}:{}}),ke=$.every(a=>"ask"in a),ka=a=>ne(a)?Oe.filter(r=>r.of===a.of):[],Ct=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(),I(!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(),I(!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&&Me(L)){let p=L,h=w?p.id===q?.id?de:F(p):ye.get(p.id)??F(p);if(h.length===0)return;a.preventDefault(),!w&&!Pe.includes(p.id)&&be(C=>[...C,p.id]),he(p.id),se(h[0].id)}else if(a.key==="ArrowLeft"&&r){a.preventDefault();let p=L.of;w||be(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:{...ar,...p?tr: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?or:gt,...i?sr: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":pe,"aria-controls":W,"aria-autocomplete":"list",...pe&&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;I(!0),s(i=>ja(i,r.length>0?r:null))},onFocus:()=>I(!0),onBlur:()=>I(!1),onKeyDown:Ct,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()?St:""}),(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:!pe,onMouseDown:a=>a.preventDefault(),style:{...Ut,...e?jt:w&&!ke?Vt:null,...pe?{display:"flex"}:null},children:[(0,t.jsxs)("div",{style:{...Qt,gridTemplateColumns:w&&!ke?`minmax(0, 1fr) ${_t}`:"minmax(0, 1fr)"},children:[(0,t.jsxs)("div",{ref:N,role:"presentation","data-testid":"find-list",onMouseMove:ba,style:Xt,children:[ke?(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":dt(a.key,o.schema),children:[(0,t.jsxs)("div",{role:"presentation",style:pa,children:[a.key!=="rule:"&&a.key!=="act:"?(0,t.jsx)(pt,{kind:a.key,accents:v?.accents}):null,(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:dt(a.key,o.schema)}),(0,t.jsx)("span",{"aria-hidden":"true",style:er,"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&&xt.has(r.id),h=ye.get(r.id);return(0,t.jsxs)(u.Fragment,{children:[We(r,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(It,{hit:i,flag:k,words:l?.near&&l.why.matched?[...Ie,Re(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(),kt(r)},style:{...lr,...h?cr: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:Ot(i)}),h?(0,t.jsx)("div",{role:"group","aria-label":`What can be done about ${l?.label??"it"}`,style:dr,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)," ",Se(o.schema,a.more.all).toLowerCase()," matching \u201C",M.trim(),"\u201D"]}),rr,{"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>Wt?(0,t.jsxs)("p",{role:"presentation",style:lt,"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:lt,children:"Current ones; add is:any for the past."}):null]}),w&&!ke&&q?(0,t.jsxs)("div",{role:"group","aria-label":"The one lit","data-testid":"find-panel",onMouseEnter:yt,onMouseMove:ba,style:Jt,children:[(0,t.jsx)(Nt,{row:q,schema:o.schema,accents:v?.accents,marking:Ie,q:M.trim(),flag:k}),de.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"}),de.map(a=>Sa(a,!1))]}):null]}):null]}),e?null:(0,t.jsxs)("div",{"aria-hidden":"true",style:pr,"data-testid":"find-keys",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"\u2191"}),(0,t.jsx)("kbd",{style:fe,children:"\u2193"})," move"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"\u21B5"})," open"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"\u2192"})," actions"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"esc"})," close"]})]})]})]})}function Nt({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 ",Se(o,e.all).toLowerCase(),", narrowed by these words."]});else{let c=e.hit;switch(c.about){case"node":{v=c.kind,g=st(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:st(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 ",Se(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)(pt,{kind:v,accents:d}):null,g]}),(0,t.jsx)("div",{style:Zt,children:y}),S]})}function It({hit:e,flag:o,words:d}){switch(e.about){case"node":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:ir,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:me,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,t.jsx)("span",{style:me,children:" \xB7 past"})]}),e.near?(0,t.jsxs)("span",{style:{...Q,...me},"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,...me},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:me,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 Ht(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=Re(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:Ht(e,o).map((d,s)=>d.marked?(0,t.jsx)("mark",{style:nr,children:d.text},s):(0,t.jsx)(u.Fragment,{children:d.text},s))})}function Ot(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 st=e=>e&&e[0].toUpperCase()+e.slice(1);function pt({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 dt(e,o){return e==="rule:"?"Rules":e==="act:"?"Acts":G(o,e)}function Bt(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 Dt=10,Wt=12,Kt=5,Ft=6,qt=140,Gt=760,_t="15.5rem",Ut={...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},Vt={width:"min(42rem, calc(100vw - 24px))"},Yt=6,jt={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},Qt={display:"grid",gridTemplateRows:"minmax(0, 1fr)",flex:"1 1 auto",minHeight:0},Xt={overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"4px 0",overscrollBehavior:"contain"},Jt={overflowY:"auto",minHeight:0,padding:"12px 14px",borderLeft:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",display:"flex",flexDirection:"column",gap:4},Zt={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)"},er={marginLeft:"auto",fontWeight:400,letterSpacing:0,fontVariantNumeric:"tabular-nums",color:"var(--graview-ink-faint)"},ar={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},tr={background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))",boxShadow:"inset 3px 0 0 var(--graview-accent)"},rr={color:"var(--graview-accent)",fontSize:"0.8125rem",minHeight:30},Q={display:"block",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ir={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,minWidth:0,overflow:"hidden",overflowWrap:"anywhere",fontWeight:600},me={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400},nr={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)"},gt={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"},or={...gt,minHeight:32,margin:"0 12px 4px 24px"},sr={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))"},dr={display:"grid",padding:"2px 0 6px"},lr={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"},cr={color:"var(--graview-accent)",borderColor:"var(--graview-edge)",background:"var(--graview-panel)"},lt={margin:0,padding:"6px 12px 4px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},pr={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"},fe={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 oe=f(_(),1);var ga=f(At(),1);var ut=f(A(),1);function vt(){let{following:e,follow:o}=T();return e?(0,ut.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 wt=f(_(),1);var E=f(A(),1);function mt({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,N=[];if(b&&!s&&N.push({key:"focused",node:(0,E.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>g(Fe({...n,focusId:e},!1)),title:_e(y,b.id),style:{...w,maxWidth:"min(14rem, 15vw)"},children:[(0,E.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:_e(y,b.id)}),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.past&&N.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&&N.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&&N.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;N.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(ue(n,ve(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&&N.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,N.map(({key:z,node:W},Le)=>(0,E.jsxs)(wt.Fragment,{children:[R||Le>0?(0,E.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,W]},z)),d]})}var P=f(A(),1);function va(){let[e,o]=(0,oe.useState)([]),d=(0,oe.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,P.jsxs)(P.Fragment,{children:[(0,ga.createPortal)((0,P.jsx)(ct,{compact:e.compact}),e.slot),e.own?(0,ga.createPortal)((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(oe.Suspense,{fallback:null,children:(0,P.jsx)(nt,{})}),(0,P.jsx)(Ka,{calls:o,remembers:s,...d!==void 0?{seat:d}:{}})]}),e.own):null]}):null}function wa({home:e=null}){return(0,P.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,P.jsx)(mt,{home:e,onPicture:!0}),(0,P.jsx)("span",{style:{pointerEvents:"auto"},children:(0,P.jsx)(vt,{})})]})}var X=f(_(),1);var ft=f(A(),1),gr=ie(()=>(__graviewPreload(import.meta.url,["./chunk.Q355UPFG.js","./chunk.MD36ZSM5.js","./chunk.L6FGKJ5H.js","./chunk.3CJLAJXP.js","./chunk.SDO3U72B.js","./chunk.J24YPQ5I.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.IJ3YDBWI.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=gr().then(g=>g.sceneWay(e,o,d,m,s.current),()=>{});return()=>void v.then(g=>g?.(n.current))},[e,o,d]),(0,ft.jsx)("span",{ref:s,hidden:!0})}var ht=f(_(),1);var x=f(A(),1);function Vi({address:e=!1,auto:o,quickAsk:d=!0,scheme:s,scope:n}){let m=(0,ht.useMemo)(()=>`${ia({scope:`.${n}`})}
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)(Ge,{face:"scene"})]})]})})}function Yi(){return(0,x.jsx)(ca,{})}export{Vi as SceneFace,Yi as SceneKeeping};
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.U3HERHAI.js","./chunk.FBILPNGH.js","./chunk.MODLZJD4.js","./chunk.SDO3U72B.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ES63XSIM.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.DPJNGFEZ.js","./chunk.ONYBW45K.js","./chunk.2VR7YEJ6.js","./chunk.LETAQTLJ.js","./chunk.BUVTUAB5.js","./chunk.HJCQ6I3S.js","./chunk.OJY7VJ7D.js","./chunk.GEFXU4VO.js","./chunk.WSO7JOW5.js","./chunk.XOE4KNP2.js","./chunk.2KFZHUAC.js","./chunk.V5I4GZEY.js","./chunk.FIFUMX5X.js","./chunk.BIDL7GQD.js","./chunk.V7W5AQKL.js","./chunk.EMFOMSMI.js","./chunk.QOS5T46W.js","./chunk.Q5WEOX3Q.js","./chunk.4FCFNAA4.js","./chunk.4AC2QM7T.js","./chunk.JXNVNFV4.js","./chunk.WVUJXDXZ.js","./chunk.I2737CPF.js","./chunk.NJRLJEJY.js","./chunk.CVPMSPCH.js","./chunk.OTV5XTBB.js","./chunk.KBPJ7X7W.js","./chunk.OEIWIZCP.js","./chunk.MIE4TJRW.js","./chunk.5LJVOLKR.js","./chunk.OJGHDWI6.js","./chunk.OWFS2YDQ.js","./chunk.WSDJPXJD.js","./chunk.F4VB6Q2W.js","./chunk.FFOD5B4B.js","./chunk.Z7Y3R3YR.js","./chunk.YXEO3Y65.js","./chunk.U3HERHAI.js","./chunk.FBILPNGH.js","./chunk.MODLZJD4.js","./chunk.SDO3U72B.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QHMHUL6B.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.U3HERHAI.js","./chunk.FBILPNGH.js","./chunk.MODLZJD4.js","./chunk.SDO3U72B.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.GNEOSHQ6.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
+ ${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,23 @@
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 de,b as xe}from"./chunk.QU52E5RG.js";import{b as pe,c as ce,d as ue}from"./chunk.7VADSNPZ.js";import{a as ie,c as G,d as se,e as le}from"./chunk.U6TEW6YD.js";import"./chunk.FK722SHI.js";import"./chunk.7VP6Y6D2.js";import"./chunk.U5P23GO7.js";import"./chunk.6EHHMWPP.js";import"./chunk.TXHYGFIZ.js";import"./chunk.WAB3L3ZI.js";import"./chunk.W53YNBSM.js";import"./chunk.2KFZHUAC.js";import"./chunk.V5I4GZEY.js";import"./chunk.QOS5T46W.js";import"./chunk.MIE4TJRW.js";import"./chunk.5LJVOLKR.js";import"./chunk.OJGHDWI6.js";import"./chunk.OWFS2YDQ.js";import"./chunk.WSDJPXJD.js";import"./chunk.F4VB6Q2W.js";import"./chunk.FFOD5B4B.js";import"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import{h as oe,m as _}from"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import{F as te,G as D,La as B,Ua as re,W as P,X as ne,Ya as ae,c as Q,ea as A,x as ee}from"./chunk.MODLZJD4.js";import{a as W}from"./chunk.SDO3U72B.js";import{Jb as Z,Yc as J,db as Y,eb as X,ga as V,la as q,pa as U}from"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import{b as k}from"./chunk.AJZBJBMO.js";var ve=k(D(),1);function L(e){return{minHeight:24,padding:"3px 10px",borderRadius:6,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:e?"transparent":"var(--graview-edge)",color:e?"var(--graview-ink)":"var(--graview-ink-muted)",fontWeight:e?600:400,background:e?"color-mix(in srgb, var(--graview-accent) 16%, transparent)":"transparent"}}var T=k(P(),1);function ge(){let{seats:e,principal:t,takeSeat:n}=A();return e.length<2?null:(0,T.jsxs)("div",{role:"group","aria-label":"Seat","data-testid":"seats",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,rowGap:4},children:[(0,T.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"As"}),e.map(r=>{let d=ke(t,r.principal);return(0,T.jsx)("button",{type:"button","aria-pressed":d,"data-testid":`seat-${r.principal.id??r.label}`,title:`Sit down as ${r.label}: the acts, the kinds and the pages narrow to what this seat may do`,onClick:()=>n(r.principal),style:{...L(d),whiteSpace:"nowrap"},children:r.label},r.principal.id??r.label)})]})}function ke(e,t){return e.kind===t.kind&&e.id===t.id}var R=k(D(),1),y=k(P(),1),Se=`
2
+ .graview-here{display:flex;flex:none}
3
+ .graview-here>button{display:inline-flex;align-items:center;gap:4px;height:30px;margin:0;padding:0 4px;border:1px solid transparent;border-radius:8px;background:none;box-shadow:none;font:inherit;font-size:.75rem;color:var(--graview-ink-muted);cursor:pointer}
4
+ .graview-here-mark{display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;width:24px;height:24px;border-radius:50%;border:1.5px solid hsl(var(--graview-hue) 50% 48%);background:var(--graview-panel-muted);color:var(--graview-ink);font-size:.75rem;font-weight:600;box-shadow:0 0 0 2px var(--graview-bar)}
5
+ .graview-here-mark+.graview-here-mark{margin-left:-10px}
6
+ .graview-here-mark[data-agent]{border-radius:5px}
7
+ .graview-here-mark[data-counted]{--graview-hue:0;border-color:var(--graview-edge)}
8
+ .graview-here small{display:block;font-size:.75rem;color:var(--graview-ink-muted)}
9
+ .graview-bar[data-finding] .graview-here{display:none}`,Pe={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"};function Me(e,t){let n=t.id===void 0?null:`${t.kind}:${t.id}`,r=new Map;for(let d of e.values()){let i=d.participant.slice(0,d.participant.lastIndexOf(":"));if(i===n)continue;let o=i.endsWith(":")?d.participant:i,p=r.get(o);(!p||p.at<d.at)&&r.set(o,d)}return[...r.values()]}var me=e=>e.name&&e.onBehalfOfName?`${e.name}, for ${e.onBehalfOfName}`:e.name??"",ye=e=>e===1?"1 viewer":`${e} viewers`;function Ne(e){let t=e.map(me).filter(Boolean),n=t.length<e.length?[...t,ye(e.length-t.length)]:t,r=n.pop();return`${n.length>0?`${n.join(", ")} and ${r}`:r} ${e.length===1?"is":"are"} here`}function Ce(e,t){let{store:n,hidden:r,pictures:d}=t,i=Q(e),o=n.kindsKeptFrom(t.principal),p=m=>!r.has(m)&&!o.has(m)&&!n.modules.disabledKinds.has(m),b=d.find(m=>m.as===i.within?.view&&p(m.kind));if(b)return b.title;if(!i.focusId)return i.overview?"everything":null;let u=ee(i.focusId);if(u.length>0)return u.every(p)?u.map(m=>U(n.schema,m)).join(" and "):null;let h=n.graph.getNode(i.focusId);return h&&p(h.kind)?q(n.schema.tryDefinition(h.kind),h):null}function Ae(e,t){let n=p=>p.id!==void 0&&(p.id===t.principal.id||p.onBehalfOf?.id===t.principal.id),r=e.filter(p=>!Z(p)&&Y(p.author)!=="system"&&!n(p.author)),d=r[0];if(!d)return null;let i=X(d.author,{graph:t.store.graph,schema:t.store.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),o=[...new Set(r.map(p=>p.intent))].join("; ");return`${i}: ${o}`}function Ee(e,t,n){let r=Ae(e,t);r&&(n(""),setTimeout(()=>n(r),50))}function Le({scene:e,compact:t}){let{who:n,principal:r,store:d,views:i,hiddenKinds:o,follow:p}=A(),b=ae("here"),u=Me(n,r),h=u.length===0?"":Ne(u),[m,S]=(0,R.useState)("");if((0,R.useEffect)(()=>S(h),[h]),u.length===0)return null;let x=u.filter(w=>w.name),v=x.slice(0,t?2:3),f=u.length-v.length,c=u.length-x.length,M=i.places();return(0,y.jsxs)("div",{className:"graview-here","data-testid":"here",children:[(0,y.jsx)("style",{children:Se}),(0,y.jsx)("span",{role:"status","aria-live":"polite",style:Pe,children:m}),(0,y.jsxs)("button",{type:"button","data-testid":"here-open",...b.trigger,onClick:b.toggle,"aria-label":`${h} \u2014 who and where`,title:h,children:[v.length>0?(0,y.jsx)("span",{style:{display:"flex"},children:v.map(w=>(0,y.jsx)($,{one:w},w.participant))}):(0,y.jsx)($,{count:f}),v.length>0&&f>0?(0,y.jsxs)("span",{"aria-hidden":"true",children:["+",f]}):null]}),(0,y.jsxs)("ul",{...b.pane,"aria-label":"Who is here","data-testid":"here-list",hidden:!b.open,className:"graview-bar-list",style:re,children:[x.map(w=>{let g=Ce(w.stop,{store:d,principal:r,hidden:o,pictures:M}),C=me(w);return(0,y.jsx)("li",{children:(0,y.jsxs)(e?"button":"span",{className:"graview-bar-item","data-testid":"here-one",...e?{type:"button",title:`Go where ${C} is`,onClick:()=>{b.setOpen(!1),p(w.participant)}}:{style:{cursor:"default"}},children:[(0,y.jsx)($,{one:w}),(0,y.jsxs)("span",{children:[C,g?(0,y.jsxs)("small",{children:["On ",g]}):null]})]})},w.participant)}),c>0?(0,y.jsx)("li",{children:(0,y.jsxs)("span",{className:"graview-bar-item","data-testid":"here-viewers",style:{cursor:"default"},children:[(0,y.jsx)($,{count:c}),(0,y.jsxs)("span",{children:[ye(c),(0,y.jsx)("small",{children:"Not signed in"})]})]})}):null]})]})}function $({one:e,count:t}){return(0,y.jsx)("span",{className:"graview-here-mark","aria-hidden":"true",...e?{style:{"--graview-hue":Math.round(e.hue)}}:{"data-counted":""},...e?.kind==="agent"?{"data-agent":""}:{},children:e?(e.name??"").trim().charAt(0).toUpperCase():t})}var N=k(D(),1);var s=k(P(),1),Te=[{tab:"for-you",label:"For you"},{tab:"activity",label:"Activity"},{tab:"asks",label:"Your asks"}],Ie=`
10
+ .graview-inbox-tabs{display:flex;gap:4px;padding:6px 8px 0;border-bottom:1px solid var(--graview-edge);position:sticky;top:0;background:var(--graview-float)}
11
+ .graview-inbox-tabs button{display:inline-flex;align-items:center;gap:6px;min-height:34px;margin:0 0 -1px;padding:0 8px;border:0;border-bottom:2px solid transparent;border-radius:0;background:none;box-shadow:none;font:inherit;font-size:.8125rem;font-weight:500;white-space:nowrap;color:var(--graview-ink-muted);cursor:pointer}
12
+ .graview-inbox-tabs button[aria-selected=true]{color:var(--graview-ink);font-weight:600;border-bottom-color:var(--graview-accent)}
13
+ .graview-inbox-tab-count{font-size:.6875rem;font-weight:600;font-variant-numeric:tabular-nums;color:var(--graview-ink-faint)}
14
+ .graview-inbox-row{display:grid;gap:2px;width:100%;box-sizing:border-box;padding:7px 8px;border:0;border-radius:7px;background:none;box-shadow:none;font:inherit;font-size:.8125rem;line-height:1.4;text-align:left;text-decoration:none;color:var(--graview-ink)}
15
+ :is(a,button).graview-inbox-row{cursor:pointer}
16
+ :is(a,button).graview-inbox-row:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
17
+ .graview-inbox-unread{flex:none;width:7px;height:7px;border-radius:50%;background:var(--graview-accent);transform:translateY(-1px)}`,$e=e=>e>99?"99+":String(e);function Re({tab:e,choose:t,asksOn:n,counts:r,notifications:d,asks:i,tray:o,waits:p,activityHas:b,calls:u,seat:h,remembers:m,close:S}){let x=(0,N.useRef)(null),v=(0,N.useId)(),f=Te.filter(g=>g.tab!=="asks"||n),c=g=>requestAnimationFrame(()=>x.current?.querySelector(`[data-inbox-tab="${g}"]`)?.focus());(0,N.useEffect)(()=>{let g=x.current?.parentElement;g&&document.activeElement===g&&x.current?.querySelector('[aria-selected="true"]')?.focus()},[]);let M=g=>{let C=f.findIndex(we=>we.tab===e),E=g.key==="ArrowRight"?C+1:g.key==="ArrowLeft"?C-1:g.key==="Home"?0:g.key==="End"?f.length-1:null;if(E===null)return;g.preventDefault();let K=f[(E+f.length)%f.length].tab;t(K),c(K)},w=()=>{t("activity"),c("activity")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:Ie}),(0,s.jsx)("h2",{style:{..._,margin:0},children:"Inbox"}),(0,s.jsx)("div",{ref:x,role:"tablist","aria-label":"Inbox",className:"graview-inbox-tabs",onKeyDown:M,children:f.map(g=>{let C=g.tab===e,E=r[g.tab];return(0,s.jsxs)("button",{type:"button",role:"tab",id:`${v}-${g.tab}`,"data-testid":`inbox-tab-${g.tab}`,"data-inbox-tab":g.tab,"aria-selected":C,"aria-controls":`${v}-${g.tab}-panel`,tabIndex:C?0:-1,onClick:()=>t(g.tab),children:[g.label,E>0?(0,s.jsx)("span",{className:"graview-inbox-tab-count",children:$e(E)}):null]},g.tab)})}),(0,s.jsx)("div",{role:"tabpanel",id:`${v}-${e}-panel`,"aria-labelledby":`${v}-${e}`,"data-testid":`inbox-panel-${e}`,style:{display:"flex",flexDirection:"column",gap:9,padding:12,minWidth:0},children:e==="for-you"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(He,{notifications:d,close:S}),o?(0,s.jsx)(N.Suspense,{fallback:null,children:(0,s.jsx)(de,{close:S,done:w})}):null,p||d.length>0?null:(0,s.jsx)(F,{children:"Nothing waits for you."})]}):e==="activity"?(0,s.jsxs)("div",{"data-testid":"activity","aria-label":"Activity",style:{display:"flex",flexDirection:"column",gap:9,minWidth:0},children:[(0,s.jsx)(ue,{calls:u,remembers:m,close:S,headed:!1,...h!==void 0?{seat:h}:{}}),b?null:(0,s.jsx)(F,{children:"Nothing has happened here yet."})]}):(0,s.jsx)(Oe,{asks:i})})]})}function F({children:e}){return(0,s.jsx)("p",{"data-testid":"inbox-empty",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:e})}function he(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function He({notifications:e,close:t}){return e.length===0?null:(0,s.jsx)("ol",{"data-testid":"inbox-notifications","aria-label":"From the host",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:2,minWidth:0},children:e.map(n=>{let r=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{style:{display:"flex",alignItems:"baseline",gap:6,minWidth:0},children:[n.read?null:(0,s.jsx)("span",{className:"graview-inbox-unread","aria-hidden":"true"}),(0,s.jsx)("span",{style:{fontWeight:n.read?400:600,overflowWrap:"anywhere"},children:n.title}),n.read?null:(0,s.jsx)("span",{style:_,children:", unread"})]}),n.body?(0,s.jsx)("span",{style:{color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},children:n.body}):null,he(n.at)?(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:he(n.at)}):null]}),d=n.href!==void 0?"a":n.onSelect?"button":"div";return(0,s.jsx)("li",{children:(0,s.jsx)(d,{className:"graview-inbox-row","data-testid":"inbox-notification",...n.read?{}:{"data-unread":""},...n.href!==void 0?{href:n.href,...n.target?{target:n.target,rel:"noopener"}:{}}:n.onSelect?{type:"button"}:{},...n.href!==void 0||n.onSelect?{onClick:()=>{n.onSelect?.(),t()}}:{},children:r})},n.id)})})}function Oe({asks:e}){return e.length===0?(0,s.jsx)(F,{children:"What you ask the app is kept here, with what came of it."}):(0,s.jsx)("ol",{"data-testid":"inbox-asks",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem",minWidth:0},children:e.slice(0,20).map(t=>(0,s.jsx)(N.Suspense,{fallback:null,children:(0,s.jsx)(pe,{entry:t,undo:n=>(0,s.jsx)(ce,{batch:n})})},t.id))})}var l=k(P(),1),ze=`
18
+ .graview-app-menu{width:min(280px,calc(100vw - 24px))}
19
+ .graview-app-menu-group{display:grid;margin:0;padding:0 0 4px;list-style:none}
20
+ .graview-app-menu-group+.graview-app-menu-group{padding-top:4px;border-top:1px solid var(--graview-edge)}
21
+ .graview-app-menu-choice{display:flex;gap:2px;margin:4px 8px 6px;padding:2px;border:1px solid var(--graview-edge);border-radius:8px}
22
+ .graview-app-menu-choice button{flex:1 1 0;min-height:28px;margin:0;padding:0 8px;border:0;border-radius:6px;background:none;box-shadow:none;font:inherit;font-size:.8125rem;color:var(--graview-ink-muted);cursor:pointer}
23
+ .graview-app-menu-choice button[aria-pressed=true]{background:color-mix(in srgb,var(--graview-accent) 16%,transparent);color:var(--graview-ink);font-weight:600}`,We={system:"System",light:"Light",dark:"Dark"};function De({faces:e,rows:t,scheme:n,close:r}){let d=n?.offers??["system","light","dark"];return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("style",{children:ze}),e?(0,l.jsx)("div",{role:"group","aria-label":`${e.scene.label} or ${e.pages.label}`,"data-testid":"app-faces",className:"graview-app-menu-group",children:["scene","pages"].map(i=>{let o=e[i];return(0,l.jsxs)("button",{type:"button",className:"graview-bar-item","data-testid":`app-face-${i}`,"aria-pressed":o.current,...o.reach&&!o.current?{onPointerEnter:o.reach,onPointerDown:o.reach,onFocus:o.reach}:{},onClick:()=>{r(),o.current||o.go()},children:[(0,l.jsx)("span",{className:"graview-bar-mark",children:i==="scene"?(0,l.jsx)(Ge,{}):(0,l.jsx)(Fe,{})}),(0,l.jsx)("span",{style:{flex:"1 1 auto"},children:o.label}),o.current?(0,l.jsx)("span",{className:"graview-bar-mark","aria-hidden":"true",children:(0,l.jsx)(je,{})}):null]},i)})}):null,t.length>0?(0,l.jsx)("ul",{"aria-label":"From the host","data-testid":"app-menu-rows",className:"graview-app-menu-group",children:t.map(i=>(0,l.jsx)("li",{children:(0,l.jsx)(Be,{row:i,close:r})},i.label))}):null,n?(0,l.jsxs)("div",{role:"group","aria-labelledby":"graview-app-menu-scheme","data-testid":"app-menu-scheme",className:"graview-app-menu-group",children:[(0,l.jsx)("p",{id:"graview-app-menu-scheme",children:"Appearance"}),(0,l.jsx)("div",{className:"graview-app-menu-choice",children:d.map(i=>(0,l.jsx)("button",{type:"button","data-testid":`app-menu-scheme-${i}`,"aria-pressed":n.value===i,onClick:()=>n.onChoose(i),children:We[i]},i))})]}):null]})}function Be({row:e,close:t}){let n=e.href!==void 0?"a":"button";return(0,l.jsxs)(n,{className:"graview-bar-item","data-testid":"app-menu-row",...e.href!==void 0?{href:e.href,...e.target?{target:e.target,rel:"noopener"}:{}}:{type:"button"},onClick:r=>{t(),e.onSelect?.()},children:[(0,l.jsx)("span",{className:"graview-bar-mark",children:e.icon?(0,l.jsx)(_e,{icon:e.icon}):null}),(0,l.jsx)("span",{children:e.label})]})}function _e({icon:e}){let t=oe(J(e)?e:void 0);return t?(0,l.jsx)("span",{className:"graview-bar-host-mark","aria-hidden":"true",dangerouslySetInnerHTML:t}):(0,l.jsx)("span",{className:"graview-bar-host-mark","aria-hidden":"true",children:e})}function j({children:e}){return(0,l.jsx)("svg",{width:14,height:14,viewBox:"0 0 14 14","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:e})}function Ge(){return(0,l.jsxs)(j,{children:[(0,l.jsx)("path",{d:"M7 1.5 L12.5 4.5 L7 7.5 L1.5 4.5 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M1.5 7.5 L7 10.5 L12.5 7.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",strokeLinecap:"round"})]})}function Fe(){return(0,l.jsxs)(j,{children:[(0,l.jsx)("rect",{x:"2.25",y:"1.75",width:"9.5",height:"10.5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,l.jsx)("path",{d:"M4.5 5 H9.5 M4.5 7.25 H9.5 M4.5 9.5 H7.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function je(){return(0,l.jsx)(j,{children:(0,l.jsx)("path",{d:"M3 7.25 L5.75 10 L11 4.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ke(e){let t=/^(?:place|scene):([^:]+):(.+)$/.exec(e.key);return t?{place:t[2],about:[`aggregate:${t[1]}`],title:e.label}:{about:e.group==="lists"&&e.kind?[`aggregate:${e.kind}`]:[],title:e.label}}function H(e,t,n,r,d,i){let o=Ke(t),p=e.getBoundingClientRect(),b={...o,face:n?"scene":"pages",x:Math.round(d??p.left+Math.min(16,p.width/2)),y:Math.round(i??Math.min(p.bottom,p.top+36)),returnTo:e},u=n?null:e.closest("[data-graview-embed], [data-graview-shell]")?.querySelector("[data-graview-face='pages']")??document.querySelector("[data-graview-face='pages']");u?u.dispatchEvent(new CustomEvent(ne,{detail:b})):r(b)}var O={on:null,at:0},fe=500,Ve=10;function qe(e,t,n,r,d,i,o){let p=t.getAttribute("data-testid")??"",b=p==="app-places-open"?r:p.slice(10),u=n.find(f=>f.key===b);if(!u)return;if(e.type==="keydown")return O={on:t,at:Date.now()},H(t,u,d,i);let{clientX:h,clientY:m}=e;if(e.type==="contextmenu")return O.on===t&&Date.now()-O.at<700?void 0:h===0&&m===0?H(t,u,d,i):H(t,u,d,i,h,m);let S=Date.now()-Math.max(0,performance.now()-e.timeStamp),x=!1,v=f=>{Math.hypot(f.clientX-h,f.clientY-m)>Ve&&(x=!0)};document.addEventListener("pointermove",v),setTimeout(()=>{document.removeEventListener("pointermove",v),!(x||o.at!==0&&o.at-S<fe)&&(O={on:t,at:Date.now()},t.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation()},{capture:!0,once:!0}),H(t,u,d,i,h,m))},Math.max(0,fe-(Date.now()-S)))}var a=k(P(),1),wt=B(W(()=>(__graviewPreload(import.meta.url,["./chunk.U3HERHAI.js","./chunk.FBILPNGH.js","./chunk.MODLZJD4.js","./chunk.SDO3U72B.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.OOSIKCOS.js")))).part((e,t)=>(0,a.jsx)(e.TidyGroups,{...t}),{quiet:!0}),Ue=B(W(()=>(__graviewPreload(import.meta.url,["./chunk.MODLZJD4.js","./chunk.SDO3U72B.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.M6ZN2KUO.js")))).part((e,t)=>(0,a.jsx)(e.HoverChipsSwitch,{...t}),{quiet:!0});function xt({violations:e,pick:t}){let{store:n,brand:r,setMenuAt:d}=A(),i=ie(n,e);return(0,a.jsx)(a.Fragment,{children:i.map((o,p)=>{let b=le(o),u=o.repairs.length>0?`${o.repairs.length} ${o.repairs.length===1?"way":"ways"} to fix`:"";return(0,a.jsx)("li",{style:{borderTop:p===0?"none":"1px solid var(--graview-edge)"},children:(0,a.jsxs)("button",{type:"button",onClick:h=>{let m=h.currentTarget.closest("ol").getBoundingClientRect();t(o),d({x:m.left,y:m.top,on:o.subjectId})},...G(o)!==void 0?{title:G(o)}:{},style:{width:"100%",textAlign:"left",fontSize:"0.8125rem",lineHeight:1.4,padding:"7px 8px",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7},children:[o.line?(0,a.jsx)(se,{line:o.line,schema:n.schema,...r?{brand:r}:{},stacked:!0,style:{display:"block",color:"var(--graview-ink)"}}):(0,a.jsx)("span",{style:{display:"block",color:"var(--graview-ink)"},children:o.message}),b||u?(0,a.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:[b,u].filter(Boolean).join(" \xB7 ")}):null]})},`${o.invariant}:${p}`)})})}function kt({name:e,me:t,profileHref:n,hostActions:r,close:d,part:i,signature:o=!1}){let{principal:p,seats:b,settings:u,settingValues:h,chooseSetting:m,sharing:S,ai:x}=A(),v=p.roles??[],f={setOpen:c=>d()};return(0,a.jsx)(a.Fragment,{children:i==="top"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:{display:"grid",gap:3},children:[(0,a.jsx)("span",{style:z,children:"Signed in as"}),(0,a.jsx)("strong",{style:{fontSize:"1rem",fontWeight:550},children:e}),(0,a.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:v.length>0?v.map(c=>V(c)).join(", "):t===void 0?"This app has no sign-in; everything here is yours.":"No role in particular"}),t!==void 0&&n!==void 0?(0,a.jsx)("a",{href:n(t.id),"data-testid":"profile-record",style:{display:"inline-flex",alignItems:"center",minHeight:24,justifySelf:"start",fontSize:"0.875rem",color:"var(--graview-accent)"},children:"Your record \u2197"}):null,S?(0,a.jsxs)("span",{"data-testid":"profile-seen-as",style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["Seen by others as ",S.name]}):null]}),r.length>0?(0,a.jsx)("ul",{role:"list","aria-label":"From the host","data-testid":"host-actions",style:{...I,margin:0,paddingLeft:0,listStyle:"none",display:"grid",gap:2},children:r.map(c=>(0,a.jsx)("li",{children:c.href!==void 0?(0,a.jsx)("a",{href:c.href,"data-testid":"host-action",className:"graview-host-action",...c.target?{target:c.target,rel:"noopener"}:{},onClick:()=>{c.onSelect?.(),f.setOpen(!1)},style:be,children:c.label}):(0,a.jsx)("button",{type:"button","data-testid":"host-action",className:"graview-host-action",onClick:()=>{f.setOpen(!1),c.onSelect?.()},style:{...be,width:"100%",textAlign:"left",border:"none",background:"none",boxShadow:"none",font:"inherit",cursor:"pointer"},children:c.label})},c.label))}):null]}):(0,a.jsxs)(a.Fragment,{children:[b.length>1?(0,a.jsxs)("div",{style:{display:"grid",gap:6,...I},children:[(0,a.jsx)("span",{style:z,children:"Sit as somebody else"}),(0,a.jsx)(ge,{})]}):null,u.length>0?(0,a.jsx)("div",{style:{display:"grid",gap:10,...I},children:u.map(c=>(0,a.jsxs)("fieldset",{"data-testid":`setting-${c.name}`,style:{border:0,margin:0,padding:0,display:"grid",gap:5},children:[(0,a.jsx)("legend",{style:{...z,padding:0},children:c.title}),c.description?(0,a.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:c.description}):null,(0,a.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:c.options.map(M=>{let w=(h[c.name]??c.initial)===M.value;return(0,a.jsx)("button",{type:"button","aria-pressed":w,"data-testid":`setting-${c.name}-${M.value}`,onClick:()=>m(c.name,M.value),style:L(w),children:M.label},M.value)})})]},c.name))}):null,te(x)?(0,a.jsx)(ve.Suspense,{fallback:null,children:(0,a.jsx)(Ue,{legend:z,style:I,choice:L})}):null,o?(0,a.jsxs)("p",{"data-testid":"graview-signature",style:{...I,margin:0,display:"flex",alignItems:"center",gap:6,fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["Built with",(0,a.jsxs)("a",{href:"https://graview.dev",target:"_blank",rel:"noopener",style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,color:"var(--graview-ink-muted)",fontWeight:600,textDecoration:"none"},children:[(0,a.jsx)("span",{"data-testid":"graview-mark",style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:Ye}}),"Graview"]})]}):null]})})}var Ye='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="14" height="14" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="2.4" stroke-linejoin="round"><path d="M13 11 L3 8 L14 3 H29 L21 9"/><path d="M10 18 L3 23 L16.5 28 L29 21 L22 19"/><path d="M16.5 18.5 V23.5" stroke-linecap="round"/></g><circle cx="16.5" cy="13.5" r="2" fill="var(--graview-mark-point, currentColor)"/></svg>',be={display:"flex",alignItems:"center",minHeight:28,padding:"2px 8px",borderRadius:7,fontSize:"0.875rem",color:"var(--graview-ink)",textDecoration:"none"},z={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},I={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};export{De as AppMenuPane,Le as Here,xe as Inbox,Re as InboxPane,xt as ProblemRows,kt as ProfilePane,wt as TidyFoot,qe as placeGesture,Ee as sayTheirChange};
@@ -0,0 +1 @@
1
+ function e(t){let i=[];return typeof t!="string"?["A view's source is text."]:(/\bimport\b/.test(t)&&i.push("It says import: a view loads nothing, so the word may not appear in it at all, even in a string or a comment."),/\bimportScripts\b/.test(t)&&i.push("It names importScripts: a view loads nothing."),/^\s*export\b/m.test(t)&&i.push("It exports something: a view is a plain script that draws through the graview global, not a module."),/\brequire\s*\(/.test(t)&&i.push("It calls require(): a view has no modules to require."),i)}export{e as a};
@@ -0,0 +1,6 @@
1
+ import{c as N}from"./chunk.F4VB6Q2W.js";import{_ as L}from"./chunk.6HY6ZGEE.js";var H=/^h([1-6])$/,D={section:null,article:null,form:null,region:null,nav:"navigation",navigation:"navigation",main:"main content",header:"header",banner:"header",footer:"footer",contentinfo:"footer",aside:"aside",complementary:"aside",search:"search"},G=e=>typeof e=="object"&&e!==null&&typeof e.getAttribute=="function"&&(e.nodeType===void 0||e.nodeType===1),$=e=>(e??"").replace(/\s+/g," ").trim();function*x(e){yield e;for(let r of Array.from(e.childNodes))G(r)&&(yield*x(r))}var C=e=>(e.getAttribute("data-graview-as")??e.localName??"").toLowerCase();function O(e){let r=H.exec(C(e));return r?Number(r[1]):e.getAttribute("role")==="heading"?Number(e.getAttribute("aria-level")??2):void 0}function P(e){let r=[...x(e)],i=new Map;for(let n of r){let d=n.getAttribute("id");d&&i.set(d,n)}let t=[],g=new Set,a=(n,d)=>{let s=n.toLowerCase();!n||g.has(s)||(g.add(s),t.push({name:n.length>80?`${n.slice(0,79)}\u2026`:n,as:d}))};for(let n of r){if(n.getAttribute("aria-hidden")==="true"||n.getAttribute("hidden")!==null)continue;if(O(n)!==void 0){a($(n.textContent),"heading");continue}let s=C(n),f=(n.getAttribute("role")??"").toLowerCase(),l=f in D?f:s in D?s:void 0;if(!l)continue;let m=(n.getAttribute("aria-labelledby")??"").split(/\s+/).flatMap(u=>i.get(u)?[$(i.get(u).textContent)]:[]).join(" "),c=[...x(n)].find(u=>u!==n&&O(u)!==void 0),o=$(n.getAttribute("aria-label"))||m||(c?$(c.textContent):"")||D[l]||"";a(o,l==="region"?"section":l)}return t}var v="\0";function _(e){let r=[],i=e.length,t=0,g="",a=l=>l.replace(/\\(u\{[0-9a-fA-F]+\}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}|.)/gs,(m,c)=>c==="n"?`
2
+ `:c==="t"?" ":c[0]==="u"||c[0]==="x"?String.fromCodePoint(parseInt(c.replace(/[ux{}]/g,""),16)):c),n=l=>{let m=++t;for(;t<i&&e[t]!==l&&e[t]!==`
3
+ `;)t+=e[t]==="\\"?2:1;let c=e.slice(m,t);return t++,a(c)},d=()=>{t++;let l=!1;for(;t<i&&e[t]!==`
4
+ `;){let m=e[t];if(m==="\\")t+=2;else if(m==="[")l=!0,t++;else if(m==="]")l=!1,t++;else{if(m==="/"&&!l)break;t++}}for(t++;t<i&&/[a-z]/i.test(e[t]);)t++},s=()=>{t++;let l="";for(;t<i;){let m=e[t];if(m==="\\")l+=a(e.slice(t,t+2)),t+=2;else{if(m==="`")return t++,l;m==="$"&&e[t+1]==="{"?(t+=2,f(!0),l+=v):(l+=m,t++)}}return l};function f(l){let m=0;for(;t<i;){let c=e[t];if(c==="/"&&e[t+1]==="/"){let o=e.indexOf(`
5
+ `,t);t=o<0?i:o}else if(c==="/"&&e[t+1]==="*"){let o=e.indexOf("*/",t+2);t=o<0?i:o+2}else if(c==='"'||c==="'")r.push(n(c)),g="a";else if(c==="`")r.push(s()),g="a";else if(c==="/"&&(g===""||"(,=:[!&|?{};+-*%<>~^".includes(g)))d(),g="a";else{if(c==="{"&&m++,c==="}"){if(l&&m===0){t++;return}m--}/\s/.test(c)||(g=c),t++}}}return f(!1),r}var F=e=>e.replace(/\s+/g," ").replace(/\s*([>+~,])\s*/g,"$1").trim();function J(e){let r=[],i=0,t=0;for(let g=0;g<e.length;g++){let a=e[g];a==="("||a==="["?i++:a===")"||a==="]"?i--:a===","&&i===0&&(r.push(e.slice(t,g)),t=g+1)}return r.push(e.slice(t)),r.map(F).filter(Boolean)}var K=new Set(["media","supports","container","layer","scope","document"]);function M(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,""),i=[],t=n=>{let d=r[n],s=n+1;for(;s<r.length&&r[s]!==d;)s+=r[s]==="\\"?2:1;return s+1},g=n=>{let d=1,s=n;for(;s<r.length&&d>0;){let f=r[s];if(f==='"'||f==="'"){s=t(s);continue}f==="{"?d++:f==="}"&&d--,s++}return s},a=n=>{let d="",s=n;for(;s<r.length;){let f=r[s];if(f==='"'||f==="'"){let l=t(s);d+=r.slice(s,l),s=l}else{if(f==="}")return s+1;if(f===";")d="",s++;else if(f==="{"){let l=d.trim();if(d="",l.startsWith("@")){let m=(/^@([\w-]+)/.exec(l)?.[1]??"").toLowerCase();s=K.has(m)?a(s+1):g(s+1)}else i.push(...J(l)),s=g(s+1)}else d+=f,s++}}return s};return a(0),[...new Set(i)]}function A(e){let r=e.replace(/\[[^\]]*\]/g,"").replace(/"[^"]*"|'[^']*'/g,"");return[...new Set([...r.matchAll(/([.#])(-?[_a-zA-Z -￿][\w -￿-]*)/g)].map(i=>`${i[1]}${i[2]}`))]}var z=e=>!e.includes(v)&&e.length<300&&!/[<;!@]|=>|^\d/.test(e)&&/^[\w\s.#:>+~*()[\]="'^$|,\\%-]+$/u.test(e),Y=/\b(?:class|className)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,q=/\bid\s*=\s*(?:"([^"]*)"|'([^']*)')/g,Z=/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1\s*>/gi,Q=/<(section|nav|main|aside|header|footer|article|form)\b[^>]*?\baria-label\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;function T(e){let r=e.css===void 0||e.drawing===void 0&&e.classes===void 0?_(e.source):[],i=e.css!==void 0?M(e.css):[...new Set(r.filter(a=>a.includes("{")&&a.includes("}")).flatMap(a=>M(a)).filter(z))],t=new Set,g;if(e.drawing){for(let a of x(e.drawing)){for(let d of(a.getAttribute("class")??"").split(/\s+/))d&&t.add(`.${d}`);let n=a.getAttribute("id");n&&t.add(`#${n}`)}g=P(e.drawing)}else{let a=s=>(s[1]??s[2]??"").split(/\s+/).filter(f=>f&&!f.includes(v));for(let s of r){for(let f of s.matchAll(Y))for(let l of a(f))t.add(`.${l}`);for(let f of s.matchAll(q))for(let l of a(f))t.add(`#${l}`)}let n=new Set;g=[];let d=(s,f)=>{let l=s.replace(/\s+/g," ").trim();!l||l.includes(v)||n.has(l.toLowerCase())||(n.add(l.toLowerCase()),g.push({name:l,as:f}))};for(let s of r){for(let f of s.matchAll(Q))d(f[2]??f[3]??"",f[1].toLowerCase());for(let f of s.matchAll(Z))d(f[2].replace(/<[^>]*>/g,""),"heading")}}for(let a of e.classes??[])t.add(`.${a}`);return{from:e.drawing||e.classes?"drawing":"source",selectors:i,drawn:t,sections:g}}var R=8,E=e=>e.length<=R?e.join(", "):`${e.slice(0,R).join(", ")} and ${e.length-R} more`,I=e=>`${Math.round(e).toLocaleString("en-US")}px`;function X(e,r){let i=T(e),t=T(r),g=new Set(t.selectors.flatMap(A)),a=new Map;for(let h of i.selectors)for(let y of A(h))y.startsWith(".")&&a.set(y,[...a.get(y)??[],h]);let n=[...a].filter(([h])=>t.drawn.has(h)&&!g.has(h)).map(([h,y])=>({class:h.slice(1),styledBy:y})),d=new Set(n.map(h=>`.${h.class}`)),s=new Set(t.selectors),f=i.selectors.filter(h=>!s.has(h)).map(h=>({selector:h,names:A(h)})).filter(h=>h.names.length>0&&h.names.every(y=>t.drawn.has(y)&&(i.from==="source"||i.drawn.has(y)))),l=new Set(t.sections.map(h=>h.name.toLowerCase())),m=i.sections.filter(h=>!l.has(h.name.toLowerCase())),c=e.height!==void 0&&r.height!==void 0&&e.height>0?{before:e.height,after:r.height,change:r.height-e.height,ratio:Math.round((r.height-e.height)/e.height*1e3)/1e3}:void 0,o=c!==void 0&&Math.abs(c.ratio)>=.1&&Math.abs(c.change)>=50,u=[];if(n.length>0){let h=n.map(y=>`.${y.class}`);u.push(`${n.length===1?"A class":`${n.length} classes`} it still draws lost every rule that styled ${n.length===1?"it":"them"} before: ${E(h)}. Put back the rules for ${n.length===1?"it":"them"}, or stop drawing ${n.length===1?"it":"them"}.`)}let p=f.filter(h=>!h.names.some(y=>d.has(y)));p.length>0&&u.push(`${p.length===1?"A rule was":`${p.length} rules were`} taken out while the markup ${p.length===1?"it":"they"} styled is still drawn: ${E(p.map(h=>`"${h.selector}"`))}.`),m.length>0&&u.push(`${m.length===1?"A section":`${m.length} sections`} drawn before ${m.length===1?"is":"are"} not drawn now: ${E(m.map(h=>`"${h.name}"`))}.`),c&&o&&u.push(`The page is ${I(c.after)} tall, ${c.change<0?"down":"up"} from ${I(c.before)} (${c.change<0?"\u2212":"+"}${Math.round(Math.abs(c.ratio)*100)}%).`);let w=u.length>0;return{regressed:w,unstyled:n,selectorsRemoved:f,sectionsMissing:m,...c?{height:c}:{},read:{before:i.from,after:t.from},said:u,text:w?u.join(" "):`Nothing it drew before lost its style, and no section it drew is gone${c?"; the page is about as tall":""}.`}}var j=String.raw`(?:Mon(?:day)?|Tue(?:s(?:day)?)?|Wed(?:nesday)?|Thu(?:r(?:s(?:day)?)?)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?)\.?`,ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],V=String.raw`(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sept?(?:ember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\.?`,U=String.raw`(?:st|nd|rd|th)?`,te=[/\b(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})\b/g,new RegExp(String.raw`\b(?:${j},?\s+)?(?<day>\d{1,2})${U}\s+(?<name>${V})(?![a-z])(?:,?\s+(?<year>\d{4})\b)?`,"g"),new RegExp(String.raw`\b(?:${j},?\s+)?(?<name>${V})\s+(?<day>\d{1,2})${U}(?!\d)\b(?:,?\s+(?<year>\d{4})\b)?`,"g")],ne=/^(?:.*today.*|now|current_?(?:day|date))$/i,se=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:new\s+Date\(\s*)?(["'`])(\d{4}-\d{2}-\d{2})[^"'`\n]*\2/g,B=String.raw`(?:today|tomorrow|yesterday|tonight)`,W=String.raw`[\s·•|,:()\-–—]{1,5}`;function re(e,r){let i=e.month!==void 0?Number(e.month):ee.indexOf(e.name.slice(0,3))+1,t=Number(e.day);if(!(i>=1&&i<=12&&t>=1&&t<=31))return;let g=d=>`${d}-${String(i).padStart(2,"0")}-${String(t).padStart(2,"0")}`;if(e.year!==void 0)return g(Number(e.year));let a=Number(r.slice(0,4)),n=d=>Math.abs(Date.parse(d)-Date.parse(r));return[a-1,a,a+1].map(g).sort((d,s)=>n(d)-n(s))[0]}function oe(e,r){let i=[];for(let t of te)for(let g of e.matchAll(t)){let a=g.index,n=a+g[0].length;if(i.some(s=>a<s.to&&n>s.from))continue;let d=re(g.groups??{},r);d!==void 0&&!Number.isNaN(Date.parse(d))&&i.push({from:a,to:n,day:d})}return i.sort((t,g)=>t.from-g.from)}var k=(e,r)=>`source line ${e.slice(0,r).split(`
6
+ `).length}`;function ie(e,r){if(typeof e!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(r.today))return[];let{today:i}=r,t=r.title?.trim()||"This view",g=L(i,{weekday:"short",year:!1},r.locale),a=o=>`${t} may be out of date: it says \u201C${o}\u201D and today is ${g}. Read today from graview instead.`,n=[],d=(o,u)=>n.some(p=>o<p.to&&u>p.from);for(let o of e.matchAll(se)){if(!ne.test(o[1]))continue;let u=`${o[1]} = "${o[3]}"`;n.push({at:k(e,o.index),phrase:u,why:"today",says:a(u),from:o.index,to:o.index+o[0].length})}let s=new RegExp(String.raw`\b${B}${W}$`,"i"),f=new RegExp(String.raw`^${W}${B}\b`,"i"),l=/\b(?:due|by|until|on)\s+$/i,m=N(i,-(r.pastDays??31));for(let o of oe(e,i)){if(d(o.from,o.to)||/fromToday\(\s*["'`]$/.test(e.slice(Math.max(0,o.from-24),o.from)))continue;let u=e.slice(Math.max(0,o.from-16),o.from),p=e.slice(o.to,o.to+16),w=s.exec(u),h=f.exec(p);if(w||h){let y=w?o.from-w[0].length:o.from,b=h?o.to+h[0].length:o.to,S=e.slice(y,b).replace(/\s+/g," ").trim();n.push({at:k(e,y),phrase:S,why:"day-words",says:a(S),from:y,to:b});continue}if(o.day<i&&o.day>=m){let y=l.exec(u),b=y?o.from-y[0].length:o.from,S=e.slice(b,o.to).replace(/\s+/g," ").trim();n.push({at:k(e,b),phrase:S,why:"past",says:a(S),from:b,to:o.to})}}let c=new Set;return n.sort((o,u)=>o.from-u.from).filter(o=>!c.has(o.phrase)&&c.add(o.phrase)).map(({at:o,phrase:u,why:p,says:w})=>({at:o,phrase:u,why:p,says:w}))}export{X as a,ie as b};
@@ -1 +1 @@
1
- import{t as a}from"./chunk.CXJJB3MK.js";import{G as f,V as s,da as l}from"./chunk.3CJLAJXP.js";import{b as i}from"./chunk.AJZBJBMO.js";var d=i(f(),1),p=i(s(),1),c=new Set;function B(e){return c.add(e),()=>void c.delete(e)}function S(){let{store:e,principal:o}=l();return(0,d.useMemo)(()=>n=>{let t=n.on===void 0?void 0:e.graph.getNode(n.on);if(!t)return null;let u=[...c].filter(r=>r.store===e&&r.kind===t.kind);return(n.element?u.find(r=>r.root()?.contains(n.element)??!1):u[0])?.section(t.id,o)??null},[e,o])}function v({children:e}){let o=S(),n=(0,d.useMemo)(()=>[o],[o]);return(0,p.jsx)(a,{sections:n,children:e})}export{B as a,S as b,v as c};
1
+ import{t as a}from"./chunk.5LJVOLKR.js";import{G as f,W as s,ea as l}from"./chunk.MODLZJD4.js";import{b as i}from"./chunk.AJZBJBMO.js";var d=i(f(),1),p=i(s(),1),c=new Set;function B(e){return c.add(e),()=>void c.delete(e)}function S(){let{store:e,principal:o}=l();return(0,d.useMemo)(()=>n=>{let t=n.on===void 0?void 0:e.graph.getNode(n.on);if(!t)return null;let u=[...c].filter(r=>r.store===e&&r.kind===t.kind);return(n.element?u.find(r=>r.root()?.contains(n.element)??!1):u[0])?.section(t.id,o)??null},[e,o])}function v({children:e}){let o=S(),n=(0,d.useMemo)(()=>[o],[o]);return(0,p.jsx)(a,{sections:n,children:e})}export{B as a,S as b,v as c};
@@ -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{e as K,f as H}from"./chunk.WSDJPXJD.js";import{f as $,h as F,i as P,j as B}from"./chunk.F4VB6Q2W.js";import"./chunk.FFOD5B4B.js";import"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import"./chunk.U3HERHAI.js";import"./chunk.FBILPNGH.js";import{G as se,La as A,W as S}from"./chunk.MODLZJD4.js";import{a as q}from"./chunk.SDO3U72B.js";import"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var r=T(se(),1);var j=T(S(),1),Z=A(q(()=>(__graviewPreload(import.meta.url,["./chunk.U3HERHAI.js","./chunk.FBILPNGH.js","./chunk.MODLZJD4.js","./chunk.SDO3U72B.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZD7T234N.js")))),U={Part:Z.part((n,t)=>(0,j.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>Z.prefetch()};var o=T(S(),1),E="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function _(n,t,i,b=!1){let y=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),x={weekday:b?"long":"short",year:"numeric",month:b?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},h;try{h=new Intl.DateTimeFormat(i??"en-US",x)}catch{h=new Intl.DateTimeFormat("en-US",x)}return h.format(y).replace(/ /g," ")}function V(n,t){if(n.length===4)return n;let i=Date.UTC(+n.slice(0,4),+n.slice(5,7)-1,1);try{return new Intl.DateTimeFormat(t??"en-US",{month:"long",year:"numeric",timeZone:"UTC"}).format(i)}catch{return new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric",timeZone:"UTC"}).format(i)}}function me({value:n,time:t,instant:i=!1,partial:b=!1,label:y,name:x,required:h,autoFocus:G,autoSelect:N,locale:s,onChange:J,onLeave:Q,onCancel:X,inputRef:W,boxStyle:Y}){let k=(0,r.useId)(),p=(0,r.useRef)(null),O=(0,r.useRef)(null),I=e=>b&&!t&&e!==void 0?K(e):void 0,C=e=>{let a=I(e);if(a!==void 0)return V(a,s);let l=F(e);return l?_(l,t,s):e??""},[g,D]=(0,r.useState)(()=>C(n)),[R,w]=(0,r.useState)(!1),[ee,L]=(0,r.useState)(n),[ne,te]=(0,r.useState)(n);n!==ne&&(te(n),n!==ee&&(L(n),D(C(n)))),(0,r.useEffect)(()=>{N&&(p.current?.focus(),p.current?.select())},[N]);let d=t&&i?B(s):void 0,M=g===C(n),u=F(n),c=I(M?n:g),f=c!==void 0?void 0:M?u:H(g,{today:$().day,time:t,...u?{base:u}:{},...s?{locale:s}:{}}),re=M?n:c!==void 0?c:f?P(f,{time:t,instant:i}):void 0,v=g.trim()==="",m=!v&&f===void 0&&c===void 0;(0,r.useEffect)(()=>{p.current?.setCustomValidity(m?`Not a date this reads \u2014 ${E}`:"")},[m]);let z=e=>{L(e),J(e)},oe=e=>{D(e);let a=I(e);if(a!==void 0)return z(a);let l=e.trim()===""?void 0:H(e,{today:$().day,time:t,...u?{base:u}:{},...s?{locale:s}:{}});z(l?P(l,{time:t,instant:i}):void 0)},ae=e=>{let a=t?{day:e,minutes:f?.minutes??u?.minutes??540}:{day:e},l=P(a,{time:t,instant:i});D(C(l)),z(l),w(!1),requestAnimationFrame(()=>{p.current?.focus(),p.current?.select()})},ie=v?`Type a date, or pick one \u2014 ${E}`:m?`Not a date this reads \u2014 ${E}`:c!==void 0?`${V(c,s)} (${c.length===4?"a year":"a month"} alone)`:f?`${_(f,t,s,!0)}${d?` ${d.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?i?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(w(!1),Q?.(re))},children:[(0,o.jsx)("input",{ref:e=>{p.current=e,typeof W=="function"?W(e):W&&(W.current=e)},type:"text",name:x,required:h,autoFocus:G,"aria-label":y,"aria-describedby":`${k}-said`,"aria-invalid":m||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:g,"data-graview-part":"control",onChange:e=>oe(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),X?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),w(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Y}}),(0,o.jsx)("button",{ref:O,type:"button","aria-label":`Pick a date for ${y}`,"aria-expanded":R,"aria-controls":`${k}-month`,"data-graview-part":"when-pick",onClick:()=>w(e=>!e),onPointerEnter:()=>U.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${k}-said`,"aria-live":"polite","data-graview-part":"when-said",...d?{"data-graview-zone":d.zone,title:`Times are in ${d.zone.replace(/_/g," ")} (${d.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:m?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ie,d&&!m&&!v?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(d.zone.split("/").at(-1)??d.zone).replace(/_/g," ")} time`}):null]}),R?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(U.Part,{id:`${k}-month`,label:y,selected:f?.day??u?.day,today:$().day,locale:s,onPick:ae,onClose:()=>{w(!1),O.current?.focus()}})}):null]})}export{me as WhenInput,_ as wallAsRead};
@@ -1 +1 @@
1
- import{a as O,b,c as w,d as R,e as V}from"./chunk.ZMWAZACO.js";import{h as d,i as S}from"./chunk.CD6YWH6T.js";import{Pa as $,Qa as F}from"./chunk.J24YPQ5I.js";var E=["card","row","page"],j=["good","warn","bad","neutral","accent"],U=["money","percent","date","time","datetime","relative","count"],_=4,T=40,I=120,L=["number","money","percent"],B=["large"],C=["card","row"],M=1e3,ce=100;function X(e){let n=/^\s*(out|in)\(\s*['"]([A-Za-z][A-Za-z0-9_-]*)['"]\s*\)\s*$/.exec(e);return n?{edge:n[2],way:n[1]}:/^[A-Za-z][A-Za-z0-9_-]*$/.test(e)?{edge:e}:void 0}var v={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone","lines"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label","emphasis"]},Z=Object.keys(v),G=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?, "emphasis"?: "large"}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?, "lines"?: 0-12}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,Y=e=>/^(image|video|file)$/.test(e?.of??e?.type??"");function ge(e){return Object.fromEntries(Object.entries(e.views??{}).filter(([,n])=>!Array.isArray(n)))}function ye(e){let n=e.views?.home;return Array.isArray(n)?n:void 0}var q={field:()=>!1,relation:()=>!1,figure:!1},z=e=>e.kind??"the home",m=(e,n)=>e!==void 0&&Object.hasOwn(e,n),g=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function W(e,n,t){let s=O(e);for(let a of s.unknownFunctions)t.findings.push(d("unknown-function",n,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of s.names){if(t.kind===null){t.findings.push(d("view-name",n,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||t.spec.field(a)||t.spec.relation(a)||t.findings.push(d("view-name",n,`${t.kind} has no field or relation called "${a}"`))}for(let a of s.edges)t.edges.has(a)||t.findings.push(d("view-edge",n,`"${a}" is not a relation any kind declares`));for(let a of s.sweeps)t.kinds.has(a)||t.findings.push(d("view-kind",n,`"${a}" is not a kind this document declares`))}function k(e,n,t){if(typeof e!="string"||e.length===0||e.length>2e3){t.findings.push(d("view-expression",n,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{W(w(e),n,t)}catch(s){if(!(s instanceof b))throw s;t.findings.push(d("expression",n,`${s.sentence} (at character ${s.at+1})`))}}function A(e,n,t,s,a=!1){let l=s==="text";if(typeof e!="string"||e.length===0||e.length>300){t.findings.push(d("view-template",n,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let r;try{r=V(e)}catch(i){if(i instanceof R||i instanceof b){t.findings.push(d("template",n,i.sentence));return}throw i}for(let i of r)if(i.expr){if(W(i.expr,n,t),l&&!a&&!i.format&&i.expr.t==="ident"&&(t.slot==="card"||t.slot==="row")&&t.spec.prose?.(i.expr.name)){let o=i.expr.name;t.findings.push(S("view-whole-text",n,`${t.kind} ${t.slot} shows ${o} whole; it will be clamped. Use {${o}|excerpt} or move it to the page.`,`write {${o}|excerpt}, or {${o}|excerpt: 80} for fewer characters`))}if(s==="headline"&&!i.format&&i.expr.t==="ident"&&t.spec.prose?.(i.expr.name)){let o=i.expr.name;t.findings.push(S("view-headline-long",n,`${z(t)}${t.slot?` ${t.slot}`:""} heads it with ${o}, a long text, drawn at a headline's size; a headline is a few words.`,`say it in a text block, {"text": "{${o}}"}, or head it with {${o}|excerpt: 60}`))}}}var K=12;function J(e,n,t){typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=K||t.findings.push(d("view-lines",n,`lines is ${JSON.stringify(e)}, and a text block's lines is a whole number from 1 to ${K}, or 0 to show it whole`,'{"text": "{awards}", "lines": 6}, or "lines": 0 for no cut at all'))}function Q(e,n,t){if(typeof e=="string"){j.includes(e)||t.findings.push(d("view-tone",n,`"${e}" is not a tone`,`use one of ${j.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(g(e)&&Object.keys(e).length===1&&"expr"in e){k(e.expr,`${n}.expr`,t);return}t.findings.push(d("view-tone",n,'a tone is a word or {"expr": \u2026}',`one of ${j.join(", ")}`))}function x(e,n,t,s){if(!Array.isArray(e)){s.findings.push(d("view-shape",n,"a view is a list of blocks"));return}if(t>_){s.findings.push(d("view-depth",n,`blocks nest at most ${_} deep`,"flatten a group or a condition"));return}e.forEach((a,l)=>ee(a,`${n}.${l}`,t,s))}function ee(e,n,t,s){if(t===1&&s.count++,s.all++,!g(e)){s.findings.push(d("view-block",n,"a block is an object naming what it shows",`one of ${G}`));return}let a=Object.keys(e),l=a.filter(o=>Z.includes(o)&&!(o==="group"&&a.includes("list")));if(l.length===0){s.findings.push(d("view-block",n,`${a.length>0?a.map(o=>`"${o}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${G}`));return}if(l.length>1){s.findings.push(d("view-block",n,`a block is one thing, and this says ${l.map(o=>`"${o}"`).join(" and ")}`,"split it into two blocks"));return}let r=l[0];for(let o of a)o!==r&&o!="key"&&!v[r].includes(o)&&s.findings.push(d("unknown-key",`${n}.${o}`,`"${o}" is not part of a ${r} block`,v[r].length>0?`a ${r} block may also say ${v[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=e[r];switch(r){case"title":case"headline":case"text":case"badge":A(i,`${n}.${r}`,s,r==="text"||r==="headline"?r:void 0,r==="text"&&"lines"in e),"tone"in e&&Q(e.tone,`${n}.tone`,s),r==="text"&&"lines"in e&&J(e.lines,`${n}.lines`,s);return;case"image":case"field":{let o=r==="image";if(typeof i!="string"||!(o?s.spec.files?.(i):s.spec.field(i))){let u=typeof i=="string"&&s.spec.relation(i);s.findings.push(d(`view-${r}`,`${n}.${r}`,`${s.kind} has no ${o?"image, video or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=o?["thumb","gallery"]:U;"as"in e&&!f.includes(e.as)&&s.findings.push(d("view-format",`${n}.as`,`"${String(e.as)}" is not a way to show ${o?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),o||D(e,n,s,"field"),"label"in e&&oe(e.label,`${n}.label`,s);return}case"progress":{!g(i)||Object.keys(i).some(o=>o!=="value"&&o!=="max")||!("value"in i)||!("max"in i)?s.findings.push(d("view-progress",`${n}.progress`,'progress is {"value": expression, "max": expression}')):(k(i.value,`${n}.progress.value`,s),k(i.max,`${n}.progress.max`,s)),"label"in e&&A(e.label,`${n}.label`,s);return}case"group":"direction"in e&&e.direction!=="row"&&e.direction!=="column"&&s.findings.push(d("view-direction",`${n}.direction`,`a group runs "row" or "column", not "${String(e.direction)}"`)),x(i,`${n}.group`,t+1,s);return;case"when":k(i,`${n}.when`,s),"show"in e?x(e.show,`${n}.show`,t+1,s):s.findings.push(d("view-when",n,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return ne(e,n,s);for(let o of["as","currency","label","emphasis"])o in e&&s.findings.push(d("unknown-key",`${n}.${o}`,`"${o}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?s.findings.push(d("view-block",`${n}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):s.spec.figure||s.findings.push(d("view-figure",`${n}.figure`,`${z(s)} has no figure to show`,s.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return te(e,n,s);case"divider":i!==!0&&s.findings.push(d("view-block",`${n}.${r}`,`write {"${r}": true}`));return}}function ne(e,n,t){k(e.figure,`${n}.figure`,t),"as"in e&&!L.includes(e.as)&&t.findings.push(d("view-format",`${n}.as`,`"${String(e.as)}" is not a way to say a figure`,`use one of ${L.join(", ")}`)),D(e,n,t,"figure"),"label"in e&&A(e.label,`${n}.label`,t),"emphasis"in e&&!B.includes(e.emphasis)&&t.findings.push(d("view-emphasis",`${n}.emphasis`,`"${String(e.emphasis)}" is not how loudly a figure is said`,`use ${B.map(s=>`"${s}"`).join(", ")}, or leave it out for the figure's own size`))}function D(e,n,t,s){"currency"in e&&(typeof e.currency!="string"||!/^[A-Z]{3}$/.test(e.currency)?t.findings.push(d("view-currency",`${n}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):e.as!=="money"&&t.findings.push(d("view-currency",`${n}.currency`,`a currency belongs on a ${s} shown as money`,'add "as": "money"')))}function ie(e,n){let t=[...n.kinds],s=(l,r)=>{let i=new Set;for(let o of l){let f=n.vocabulary.namesOf(o)?.targets?.(r);if(f==="*")return t;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=l=>{switch(l.t){case"ident":return n.kind!==null&&n.spec.relation(l.name)?s([n.kind],l.name):void 0;case"member":{let r=a(l.object);return r?s(r,l.name):void 0}case"where":return a(l.set);case"call":{let r=l.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(l.fn==="all")return i!==void 0&&n.kinds.has(i)?[i]:void 0;let o=l.args.length===2&&l.args[1]?.t==="lit"&&typeof l.args[1].value=="string"?l.args[1].value:void 0;if(l.fn==="out"&&o!==void 0){let f=a(r);return f?s(f,o):void 0}if(l.fn==="out")return i!==void 0&&n.kind!==null?s([n.kind],i):void 0;if(l.fn==="in"){let f=o??i,u=o!==void 0?a(r):n.kind!==null?[n.kind]:void 0,c=f!==void 0?n.vocabulary.sources(f).filter(p=>{let y=n.vocabulary.namesOf(p)?.targets?.(f);return!u||y==="*"||u.some(h=>y?.includes(h))}):[];return c.length>0?c:void 0}if((l.fn==="sort"||l.fn==="first")&&r)return a(r);if(l.fn==="either"){let f=l.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(e)}function N(e,n,t,s){let a;try{a=w(e)}catch(r){if(!(r instanceof b))throw r;s.findings.push(d("expression",n,`${r.sentence} (at character ${r.at+1})`));return}let l=O(a);for(let r of l.unknownFunctions)s.findings.push(d("unknown-function",n,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of l.edges)s.edges.has(r)||s.findings.push(d("view-edge",n,`"${r}" is not a relation any kind declares`));if(t)for(let r of l.names)r==="id"||t.some(i=>s.vocabulary.namesOf(i)?.field(r)||s.vocabulary.namesOf(i)?.relation(r))||s.findings.push(d("view-name",n,`${t.join(" and ")} ${t.length===1?"has":"have"} no field or relation called "${r}"`))}function te(e,n,t){let s=e.list;k(s,`${n}.list`,t);let a;if(typeof s=="string")try{a=ie(w(s),t)}catch{a=void 0}let l=i=>{if(!a)return[...t.kinds].map(f=>t.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let o=a.map(f=>t.vocabulary.namesOf(f)?.choices?.(i));return o.every(f=>f!==void 0)?[...new Set(o.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in e){let i=e.sort;if(typeof i=="string")N(i,`${n}.sort`,a,t);else if(g(i)&&typeof i.by=="string"&&Object.keys(i).every(o=>o==="by"||o==="direction")){let o=i.direction;o!==void 0&&o!=="asc"&&o!=="desc"&&o!=="choices"?t.findings.push(d("list-sort",`${n}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(o)}"`,'"choices" puts a choice field in the order its choices are declared')):o==="choices"?l(i.by)===void 0&&t.findings.push(d("list-sort",`${n}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):N(i.by,`${n}.sort.by`,a,t)}else t.findings.push(d("list-sort",`${n}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in e){let i=e.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>M)&&t.findings.push(d("list-limit",`${n}.limit`,`a limit is a whole number from 1 to ${M}`))}if("group"in e){let i=e.group,o=typeof i=="string"?i:g(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||g(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||o===void 0)t.findings.push(d("list-group",`${n}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}} \u2014 or a relation, like "inGenre", a heading per linked record'));else{let u=l(o),c=u===void 0?X(o):void 0,p=c!==void 0&&(c.way!==void 0?t.edges.has(c.edge):a?a.every(y=>t.vocabulary.namesOf(y)?.relation(c.edge)):t.edges.has(c.edge));if(u===void 0&&!p&&t.findings.push(d("list-group",`${n}.group`,`"${o}" is not a choice field or a relation of ${r}, so it has nothing to group by`,'group by a field whose type is enum, or by a relation of the kind listed, like "inGenre"')),g(i)&&"headings"in i){let y=i.headings;if(!g(y)||Object.values(y).some(h=>typeof h!="string"||h.length===0||h.length>80))t.findings.push(d("list-group",`${n}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let h of Object.keys(y))u.includes(h)||t.findings.push(d("list-group",`${n}.group.headings.${h}`,`"${h}" is not one of ${o}'s choices`,`use ${u.join(", ")}`))}}}"empty"in e&&(typeof e.empty!="string"||e.empty.length===0||e.empty.length>200)&&t.findings.push(d("list-empty",`${n}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in e&&!C.includes(e.as)&&t.findings.push(d("list-as",`${n}.as`,`a list draws each record as its "card" or its "row", not "${String(e.as)}"`))}function oe(e,n,t){(typeof e!="string"||e.length===0||e.length>60)&&t.findings.push(d("view-label",n,"a label is a few words, at most 60 characters"))}function P(e,n,t,s,a,l,r){let i={kind:null,spec:q,kinds:s,edges:a,vocabulary:t,findings:l,count:0,all:0};Array.isArray(e)&&e.length===0&&l.push(d("view-shape",n,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),x(e,n,1,i),H(i,n,r,"show less")}function H(e,n,t,s){e.count>T?e.findings.push(d("view-size",n,`${t} has ${e.count} blocks at its top; a view has at most ${T} there, a group or a condition counting as one`,`${s}, or gather some into a group`)):e.all>I&&e.findings.push(d("view-size",n,`${t} has ${e.all} blocks counting the ones inside its groups and conditions; a view has at most ${I} in all`,s))}function se(e,n,t,s,a){Array.isArray(e)&&e.forEach((l,r)=>{if(!g(l)||l.name!=="blocks"||!g(l.options)||!("blocks"in l.options))return;let i=[];P(l.options.blocks,`lenses.${r}.options.blocks`,n,t,s,i,`the lens "${String(l.title??r)}"`);for(let o of i)a.push({...o,severity:"warning"})})}function re(e,n,t,s,a,l,r){let i=[];if(e===void 0)return i;if(!g(e))return i.push(d("view-shape",n,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[o,f]of Object.entries(e)){if(o==="home"&&Array.isArray(f)){P(f,`${n}.home`,r,s,a,i,"the home");continue}let u=t(o);if(!u){i.push(d("view-kind",`${n}.${o}`,`"${o}" is not a kind this ${l} declares`));continue}if(!g(f)){i.push(d("view-shape",`${n}.${o}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))E.includes(c)||i.push(d("view-slot",`${n}.${o}.${c}`,`"${c}" is not a place a view is drawn`,`use ${E.map(p=>`"${p}"`).join(", ")}`));for(let c of E){let p=f[c];if(p===void 0)continue;let y={kind:o,spec:u,kinds:s,edges:a,vocabulary:r,findings:i,count:0,all:0,slot:c};x(p,`${n}.${o}.${c}`,1,y),H(y,`${n}.${o}.${c}`,`this ${c}`,"show less, or move detail to the page")}}return i}function he(e){let n=new Set(Object.keys(e.kinds)),t=new Set(Object.values(e.kinds).flatMap(r=>Object.keys($(r.edges)))),s=r=>{let i=m(e.kinds,r)?e.kinds[r]:void 0;return i?{field:o=>m(i.fields,o)||m(i.computed,o)||F(i.edges).has(o),relation:o=>m($(i.edges),o),figure:i.figure!==void 0,files:o=>m(i.fields,o)&&Y(i.fields[o]),choices:o=>m(i.fields,o)&&i.fields[o].type==="enum"?i.fields[o].options:void 0,targets:o=>m($(i.edges),o)?i.edges[o].to:void 0,prose:o=>m(i.fields,o)&&i.fields[o].type==="text"}:void 0},a={namesOf:s,sources:r=>Object.keys(e.kinds).filter(i=>m(e.kinds[i].edges,r))},l=re(e.views,"views",s,n,t,"document",a);return se(e.lenses,a,n,t,l),l}export{j as a,U as b,L as c,B as d,M as e,ce as f,X as g,ge as h,ye as i,he as j};
1
+ import{a as O,b,c as w,d as R,e as V}from"./chunk.KBPJ7X7W.js";import{h as d,i as S}from"./chunk.OEIWIZCP.js";import{Qa as $,Ra as F}from"./chunk.6HY6ZGEE.js";var E=["card","row","page"],j=["good","warn","bad","neutral","accent"],U=["money","percent","date","time","datetime","relative","count"],_=4,T=40,I=120,L=["number","money","percent"],B=["large"],C=["card","row"],M=1e3,ce=100;function X(e){let n=/^\s*(out|in)\(\s*['"]([A-Za-z][A-Za-z0-9_-]*)['"]\s*\)\s*$/.exec(e);return n?{edge:n[2],way:n[1]}:/^[A-Za-z][A-Za-z0-9_-]*$/.test(e)?{edge:e}:void 0}var v={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone","lines"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label","emphasis"]},Z=Object.keys(v),G=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?, "emphasis"?: "large"}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?, "lines"?: 0-12}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,Y=e=>/^(image|video|file)$/.test(e?.of??e?.type??"");function ge(e){return Object.fromEntries(Object.entries(e.views??{}).filter(([,n])=>!Array.isArray(n)))}function ye(e){let n=e.views?.home;return Array.isArray(n)?n:void 0}var q={field:()=>!1,relation:()=>!1,figure:!1},z=e=>e.kind??"the home",m=(e,n)=>e!==void 0&&Object.hasOwn(e,n),g=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function W(e,n,t){let s=O(e);for(let a of s.unknownFunctions)t.findings.push(d("unknown-function",n,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of s.names){if(t.kind===null){t.findings.push(d("view-name",n,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||t.spec.field(a)||t.spec.relation(a)||t.findings.push(d("view-name",n,`${t.kind} has no field or relation called "${a}"`))}for(let a of s.edges)t.edges.has(a)||t.findings.push(d("view-edge",n,`"${a}" is not a relation any kind declares`));for(let a of s.sweeps)t.kinds.has(a)||t.findings.push(d("view-kind",n,`"${a}" is not a kind this document declares`))}function k(e,n,t){if(typeof e!="string"||e.length===0||e.length>2e3){t.findings.push(d("view-expression",n,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{W(w(e),n,t)}catch(s){if(!(s instanceof b))throw s;t.findings.push(d("expression",n,`${s.sentence} (at character ${s.at+1})`))}}function A(e,n,t,s,a=!1){let l=s==="text";if(typeof e!="string"||e.length===0||e.length>300){t.findings.push(d("view-template",n,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let r;try{r=V(e)}catch(i){if(i instanceof R||i instanceof b){t.findings.push(d("template",n,i.sentence));return}throw i}for(let i of r)if(i.expr){if(W(i.expr,n,t),l&&!a&&!i.format&&i.expr.t==="ident"&&(t.slot==="card"||t.slot==="row")&&t.spec.prose?.(i.expr.name)){let o=i.expr.name;t.findings.push(S("view-whole-text",n,`${t.kind} ${t.slot} shows ${o} whole; it will be clamped. Use {${o}|excerpt} or move it to the page.`,`write {${o}|excerpt}, or {${o}|excerpt: 80} for fewer characters`))}if(s==="headline"&&!i.format&&i.expr.t==="ident"&&t.spec.prose?.(i.expr.name)){let o=i.expr.name;t.findings.push(S("view-headline-long",n,`${z(t)}${t.slot?` ${t.slot}`:""} heads it with ${o}, a long text, drawn at a headline's size; a headline is a few words.`,`say it in a text block, {"text": "{${o}}"}, or head it with {${o}|excerpt: 60}`))}}}var K=12;function J(e,n,t){typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=K||t.findings.push(d("view-lines",n,`lines is ${JSON.stringify(e)}, and a text block's lines is a whole number from 1 to ${K}, or 0 to show it whole`,'{"text": "{awards}", "lines": 6}, or "lines": 0 for no cut at all'))}function Q(e,n,t){if(typeof e=="string"){j.includes(e)||t.findings.push(d("view-tone",n,`"${e}" is not a tone`,`use one of ${j.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(g(e)&&Object.keys(e).length===1&&"expr"in e){k(e.expr,`${n}.expr`,t);return}t.findings.push(d("view-tone",n,'a tone is a word or {"expr": \u2026}',`one of ${j.join(", ")}`))}function x(e,n,t,s){if(!Array.isArray(e)){s.findings.push(d("view-shape",n,"a view is a list of blocks"));return}if(t>_){s.findings.push(d("view-depth",n,`blocks nest at most ${_} deep`,"flatten a group or a condition"));return}e.forEach((a,l)=>ee(a,`${n}.${l}`,t,s))}function ee(e,n,t,s){if(t===1&&s.count++,s.all++,!g(e)){s.findings.push(d("view-block",n,"a block is an object naming what it shows",`one of ${G}`));return}let a=Object.keys(e),l=a.filter(o=>Z.includes(o)&&!(o==="group"&&a.includes("list")));if(l.length===0){s.findings.push(d("view-block",n,`${a.length>0?a.map(o=>`"${o}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${G}`));return}if(l.length>1){s.findings.push(d("view-block",n,`a block is one thing, and this says ${l.map(o=>`"${o}"`).join(" and ")}`,"split it into two blocks"));return}let r=l[0];for(let o of a)o!==r&&o!="key"&&!v[r].includes(o)&&s.findings.push(d("unknown-key",`${n}.${o}`,`"${o}" is not part of a ${r} block`,v[r].length>0?`a ${r} block may also say ${v[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=e[r];switch(r){case"title":case"headline":case"text":case"badge":A(i,`${n}.${r}`,s,r==="text"||r==="headline"?r:void 0,r==="text"&&"lines"in e),"tone"in e&&Q(e.tone,`${n}.tone`,s),r==="text"&&"lines"in e&&J(e.lines,`${n}.lines`,s);return;case"image":case"field":{let o=r==="image";if(typeof i!="string"||!(o?s.spec.files?.(i):s.spec.field(i))){let u=typeof i=="string"&&s.spec.relation(i);s.findings.push(d(`view-${r}`,`${n}.${r}`,`${s.kind} has no ${o?"image, video or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=o?["thumb","gallery"]:U;"as"in e&&!f.includes(e.as)&&s.findings.push(d("view-format",`${n}.as`,`"${String(e.as)}" is not a way to show ${o?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),o||D(e,n,s,"field"),"label"in e&&oe(e.label,`${n}.label`,s);return}case"progress":{!g(i)||Object.keys(i).some(o=>o!=="value"&&o!=="max")||!("value"in i)||!("max"in i)?s.findings.push(d("view-progress",`${n}.progress`,'progress is {"value": expression, "max": expression}')):(k(i.value,`${n}.progress.value`,s),k(i.max,`${n}.progress.max`,s)),"label"in e&&A(e.label,`${n}.label`,s);return}case"group":"direction"in e&&e.direction!=="row"&&e.direction!=="column"&&s.findings.push(d("view-direction",`${n}.direction`,`a group runs "row" or "column", not "${String(e.direction)}"`)),x(i,`${n}.group`,t+1,s);return;case"when":k(i,`${n}.when`,s),"show"in e?x(e.show,`${n}.show`,t+1,s):s.findings.push(d("view-when",n,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return ne(e,n,s);for(let o of["as","currency","label","emphasis"])o in e&&s.findings.push(d("unknown-key",`${n}.${o}`,`"${o}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?s.findings.push(d("view-block",`${n}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):s.spec.figure||s.findings.push(d("view-figure",`${n}.figure`,`${z(s)} has no figure to show`,s.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return te(e,n,s);case"divider":i!==!0&&s.findings.push(d("view-block",`${n}.${r}`,`write {"${r}": true}`));return}}function ne(e,n,t){k(e.figure,`${n}.figure`,t),"as"in e&&!L.includes(e.as)&&t.findings.push(d("view-format",`${n}.as`,`"${String(e.as)}" is not a way to say a figure`,`use one of ${L.join(", ")}`)),D(e,n,t,"figure"),"label"in e&&A(e.label,`${n}.label`,t),"emphasis"in e&&!B.includes(e.emphasis)&&t.findings.push(d("view-emphasis",`${n}.emphasis`,`"${String(e.emphasis)}" is not how loudly a figure is said`,`use ${B.map(s=>`"${s}"`).join(", ")}, or leave it out for the figure's own size`))}function D(e,n,t,s){"currency"in e&&(typeof e.currency!="string"||!/^[A-Z]{3}$/.test(e.currency)?t.findings.push(d("view-currency",`${n}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):e.as!=="money"&&t.findings.push(d("view-currency",`${n}.currency`,`a currency belongs on a ${s} shown as money`,'add "as": "money"')))}function ie(e,n){let t=[...n.kinds],s=(l,r)=>{let i=new Set;for(let o of l){let f=n.vocabulary.namesOf(o)?.targets?.(r);if(f==="*")return t;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=l=>{switch(l.t){case"ident":return n.kind!==null&&n.spec.relation(l.name)?s([n.kind],l.name):void 0;case"member":{let r=a(l.object);return r?s(r,l.name):void 0}case"where":return a(l.set);case"call":{let r=l.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(l.fn==="all")return i!==void 0&&n.kinds.has(i)?[i]:void 0;let o=l.args.length===2&&l.args[1]?.t==="lit"&&typeof l.args[1].value=="string"?l.args[1].value:void 0;if(l.fn==="out"&&o!==void 0){let f=a(r);return f?s(f,o):void 0}if(l.fn==="out")return i!==void 0&&n.kind!==null?s([n.kind],i):void 0;if(l.fn==="in"){let f=o??i,u=o!==void 0?a(r):n.kind!==null?[n.kind]:void 0,c=f!==void 0?n.vocabulary.sources(f).filter(p=>{let y=n.vocabulary.namesOf(p)?.targets?.(f);return!u||y==="*"||u.some(h=>y?.includes(h))}):[];return c.length>0?c:void 0}if((l.fn==="sort"||l.fn==="first")&&r)return a(r);if(l.fn==="either"){let f=l.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(e)}function N(e,n,t,s){let a;try{a=w(e)}catch(r){if(!(r instanceof b))throw r;s.findings.push(d("expression",n,`${r.sentence} (at character ${r.at+1})`));return}let l=O(a);for(let r of l.unknownFunctions)s.findings.push(d("unknown-function",n,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of l.edges)s.edges.has(r)||s.findings.push(d("view-edge",n,`"${r}" is not a relation any kind declares`));if(t)for(let r of l.names)r==="id"||t.some(i=>s.vocabulary.namesOf(i)?.field(r)||s.vocabulary.namesOf(i)?.relation(r))||s.findings.push(d("view-name",n,`${t.join(" and ")} ${t.length===1?"has":"have"} no field or relation called "${r}"`))}function te(e,n,t){let s=e.list;k(s,`${n}.list`,t);let a;if(typeof s=="string")try{a=ie(w(s),t)}catch{a=void 0}let l=i=>{if(!a)return[...t.kinds].map(f=>t.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let o=a.map(f=>t.vocabulary.namesOf(f)?.choices?.(i));return o.every(f=>f!==void 0)?[...new Set(o.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in e){let i=e.sort;if(typeof i=="string")N(i,`${n}.sort`,a,t);else if(g(i)&&typeof i.by=="string"&&Object.keys(i).every(o=>o==="by"||o==="direction")){let o=i.direction;o!==void 0&&o!=="asc"&&o!=="desc"&&o!=="choices"?t.findings.push(d("list-sort",`${n}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(o)}"`,'"choices" puts a choice field in the order its choices are declared')):o==="choices"?l(i.by)===void 0&&t.findings.push(d("list-sort",`${n}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):N(i.by,`${n}.sort.by`,a,t)}else t.findings.push(d("list-sort",`${n}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in e){let i=e.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>M)&&t.findings.push(d("list-limit",`${n}.limit`,`a limit is a whole number from 1 to ${M}`))}if("group"in e){let i=e.group,o=typeof i=="string"?i:g(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||g(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||o===void 0)t.findings.push(d("list-group",`${n}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}} \u2014 or a relation, like "inGenre", a heading per linked record'));else{let u=l(o),c=u===void 0?X(o):void 0,p=c!==void 0&&(c.way!==void 0?t.edges.has(c.edge):a?a.every(y=>t.vocabulary.namesOf(y)?.relation(c.edge)):t.edges.has(c.edge));if(u===void 0&&!p&&t.findings.push(d("list-group",`${n}.group`,`"${o}" is not a choice field or a relation of ${r}, so it has nothing to group by`,'group by a field whose type is enum, or by a relation of the kind listed, like "inGenre"')),g(i)&&"headings"in i){let y=i.headings;if(!g(y)||Object.values(y).some(h=>typeof h!="string"||h.length===0||h.length>80))t.findings.push(d("list-group",`${n}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let h of Object.keys(y))u.includes(h)||t.findings.push(d("list-group",`${n}.group.headings.${h}`,`"${h}" is not one of ${o}'s choices`,`use ${u.join(", ")}`))}}}"empty"in e&&(typeof e.empty!="string"||e.empty.length===0||e.empty.length>200)&&t.findings.push(d("list-empty",`${n}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in e&&!C.includes(e.as)&&t.findings.push(d("list-as",`${n}.as`,`a list draws each record as its "card" or its "row", not "${String(e.as)}"`))}function oe(e,n,t){(typeof e!="string"||e.length===0||e.length>60)&&t.findings.push(d("view-label",n,"a label is a few words, at most 60 characters"))}function P(e,n,t,s,a,l,r){let i={kind:null,spec:q,kinds:s,edges:a,vocabulary:t,findings:l,count:0,all:0};Array.isArray(e)&&e.length===0&&l.push(d("view-shape",n,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),x(e,n,1,i),H(i,n,r,"show less")}function H(e,n,t,s){e.count>T?e.findings.push(d("view-size",n,`${t} has ${e.count} blocks at its top; a view has at most ${T} there, a group or a condition counting as one`,`${s}, or gather some into a group`)):e.all>I&&e.findings.push(d("view-size",n,`${t} has ${e.all} blocks counting the ones inside its groups and conditions; a view has at most ${I} in all`,s))}function se(e,n,t,s,a){Array.isArray(e)&&e.forEach((l,r)=>{if(!g(l)||l.name!=="blocks"||!g(l.options)||!("blocks"in l.options))return;let i=[];P(l.options.blocks,`lenses.${r}.options.blocks`,n,t,s,i,`the lens "${String(l.title??r)}"`);for(let o of i)a.push({...o,severity:"warning"})})}function re(e,n,t,s,a,l,r){let i=[];if(e===void 0)return i;if(!g(e))return i.push(d("view-shape",n,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[o,f]of Object.entries(e)){if(o==="home"&&Array.isArray(f)){P(f,`${n}.home`,r,s,a,i,"the home");continue}let u=t(o);if(!u){i.push(d("view-kind",`${n}.${o}`,`"${o}" is not a kind this ${l} declares`));continue}if(!g(f)){i.push(d("view-shape",`${n}.${o}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))E.includes(c)||i.push(d("view-slot",`${n}.${o}.${c}`,`"${c}" is not a place a view is drawn`,`use ${E.map(p=>`"${p}"`).join(", ")}`));for(let c of E){let p=f[c];if(p===void 0)continue;let y={kind:o,spec:u,kinds:s,edges:a,vocabulary:r,findings:i,count:0,all:0,slot:c};x(p,`${n}.${o}.${c}`,1,y),H(y,`${n}.${o}.${c}`,`this ${c}`,"show less, or move detail to the page")}}return i}function he(e){let n=new Set(Object.keys(e.kinds)),t=new Set(Object.values(e.kinds).flatMap(r=>Object.keys($(r.edges)))),s=r=>{let i=m(e.kinds,r)?e.kinds[r]:void 0;return i?{field:o=>m(i.fields,o)||m(i.computed,o)||F(i.edges).has(o),relation:o=>m($(i.edges),o),figure:i.figure!==void 0,files:o=>m(i.fields,o)&&Y(i.fields[o]),choices:o=>m(i.fields,o)&&i.fields[o].type==="enum"?i.fields[o].options:void 0,targets:o=>m($(i.edges),o)?i.edges[o].to:void 0,prose:o=>m(i.fields,o)&&i.fields[o].type==="text"}:void 0},a={namesOf:s,sources:r=>Object.keys(e.kinds).filter(i=>m(e.kinds[i].edges,r))},l=re(e.views,"views",s,n,t,"document",a);return se(e.lenses,a,n,t,l),l}export{j as a,U as b,L as c,B as d,M as e,ce as f,X as g,ge as h,ye as i,he as j};