graview 0.1.65 → 0.1.67

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 (265) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/index.js.map +1 -1
  3. package/dist/preview/{chunk.3IZEZPJB.js → chunk.25QFDTCU.js} +1 -1
  4. package/dist/preview/{chunk.SOMRYDDH.js → chunk.264PB572.js} +1 -1
  5. package/dist/preview/chunk.2FHIINXG.js +2 -0
  6. package/dist/preview/chunk.2VUX54XH.js +1 -0
  7. package/dist/preview/chunk.32SHA3EY.js +1 -0
  8. package/dist/preview/{chunk.ZDUTEM3Z.js → chunk.35KMZHB7.js} +1 -1
  9. package/dist/preview/{chunk.74B6KQF4.js → chunk.37RFCHSS.js} +1 -1
  10. package/dist/preview/chunk.3ENPWZBG.js +1 -0
  11. package/dist/preview/chunk.3GNT5MKP.js +50 -0
  12. package/dist/preview/chunk.3NSV3WKM.js +22 -0
  13. package/dist/preview/chunk.3ZODN6BW.js +1 -0
  14. package/dist/preview/{chunk.7VQ3C7F4.js → chunk.47XEJZ3O.js} +1 -1
  15. package/dist/preview/{chunk.KIQXTQDU.js → chunk.4EMKCKDB.js} +1 -1
  16. package/dist/preview/{chunk.LKK5YF2H.js → chunk.4UUJHLHR.js} +1 -1
  17. package/dist/preview/{chunk.L6FGKJ5H.js → chunk.4W57E7AX.js} +1 -1
  18. package/dist/preview/chunk.55G4IPOO.js +1 -0
  19. package/dist/preview/chunk.5AKZROMR.js +1 -0
  20. package/dist/preview/chunk.5J6DVR7S.js +1 -0
  21. package/dist/preview/chunk.5R744JGZ.js +19 -0
  22. package/dist/preview/{chunk.64FCAUAJ.js → chunk.6KJGRM7A.js} +1 -1
  23. package/dist/preview/{chunk.INTJD5WG.js → chunk.6N4PE3U5.js} +1 -1
  24. package/dist/preview/{chunk.44ZHHPPJ.js → chunk.6NG76MDA.js} +2 -2
  25. package/dist/preview/chunk.6SJEZWH3.js +1 -0
  26. package/dist/preview/chunk.6UQFV53C.js +1 -0
  27. package/dist/preview/chunk.6W6XMLSF.js +1 -0
  28. package/dist/preview/chunk.77C556NM.js +1 -0
  29. package/dist/preview/{chunk.7E4CSXBT.js → chunk.7ARRVNUR.js} +1 -1
  30. package/dist/preview/chunk.7BJRHPE3.js +23 -0
  31. package/dist/preview/{chunk.TY74U3EI.js → chunk.7S6ZRMW4.js} +1 -1
  32. package/dist/preview/{chunk.F5VEHAP2.js → chunk.7UHPHEH5.js} +1 -1
  33. package/dist/preview/chunk.7WHQWLL6.js +1 -0
  34. package/dist/preview/{chunk.NSO6RUKW.js → chunk.A4EZAGG7.js} +1 -1
  35. package/dist/preview/chunk.A5PSEU3W.js +25 -0
  36. package/dist/preview/{chunk.2TZSLREX.js → chunk.A7GVTE5Y.js} +2 -2
  37. package/dist/preview/chunk.AJMVRFYX.js +5 -0
  38. package/dist/preview/chunk.AKJS2NUM.js +1 -0
  39. package/dist/preview/chunk.ARWO4WOV.js +1 -0
  40. package/dist/preview/chunk.B5SJMCTT.js +7 -0
  41. package/dist/preview/{chunk.2QQ37RCZ.js → chunk.B7KZBT27.js} +1 -1
  42. package/dist/preview/chunk.BDNQMKDG.js +35 -0
  43. package/dist/preview/chunk.BKYZSV2Y.js +2 -0
  44. package/dist/preview/chunk.CEQQIW7Z.js +1 -0
  45. package/dist/preview/chunk.CKDCTFLU.js +1 -0
  46. package/dist/preview/chunk.CTUJZ3IV.js +1 -0
  47. package/dist/preview/chunk.CY7FFKEZ.js +1 -0
  48. package/dist/preview/chunk.D4WJ7OM5.js +1 -0
  49. package/dist/preview/{chunk.AB4RZSYW.js → chunk.D7NWMXSX.js} +16 -16
  50. package/dist/preview/chunk.DEKRFTRN.js +4 -0
  51. package/dist/preview/{chunk.6YDC6IDA.js → chunk.DKEIEH2D.js} +1 -1
  52. package/dist/preview/{chunk.S2DOVJRL.js → chunk.DWM7AR5Y.js} +1 -1
  53. package/dist/preview/{chunk.FHHVW2WB.js → chunk.DZMIYEHQ.js} +1 -1
  54. package/dist/preview/chunk.E5PYNAYT.js +21 -0
  55. package/dist/preview/chunk.EBKH3ILT.js +1 -0
  56. package/dist/preview/chunk.EFVSZKB5.js +1 -0
  57. package/dist/preview/chunk.EG7OOJH5.js +1 -0
  58. package/dist/preview/chunk.EGPCVMDU.js +1 -0
  59. package/dist/preview/{chunk.C437FVD7.js → chunk.EJ2EZL2G.js} +1 -1
  60. package/dist/preview/{chunk.IR4OW67N.js → chunk.EP6Q32WT.js} +1 -1
  61. package/dist/preview/{chunk.G3Q5IMM3.js → chunk.F464JKHZ.js} +1 -1
  62. package/dist/preview/{chunk.IFBGYFS4.js → chunk.FLJXYESX.js} +1 -1
  63. package/dist/preview/chunk.FOUBDGL3.js +1 -0
  64. package/dist/preview/chunk.FPHRAO3R.js +1 -0
  65. package/dist/preview/chunk.FRQSLWP4.js +1 -0
  66. package/dist/preview/chunk.FVQKSN33.js +1 -0
  67. package/dist/preview/{chunk.CGQ6KXVK.js → chunk.G3GFDVO2.js} +1 -1
  68. package/dist/preview/{chunk.4O3C2LJF.js → chunk.G5GVT6JY.js} +1 -1
  69. package/dist/preview/chunk.GFLH7RCI.js +1 -0
  70. package/dist/preview/chunk.GG47EIKO.js +1 -0
  71. package/dist/preview/chunk.GMLONS5L.js +1 -0
  72. package/dist/preview/{chunk.RFVOXX3P.js → chunk.GRFD42WM.js} +1 -1
  73. package/dist/preview/{chunk.2PK335JQ.js → chunk.GVT4UUQA.js} +1 -1
  74. package/dist/preview/{chunk.5M34BJIQ.js → chunk.H3EGBDW2.js} +1 -1
  75. package/dist/preview/chunk.H6KIEDZN.js +1 -0
  76. package/dist/preview/chunk.HAOB6O72.js +1 -0
  77. package/dist/preview/chunk.HB5NWHFP.js +3 -0
  78. package/dist/preview/{chunk.GPCKOYSF.js → chunk.HJUZMOW2.js} +1 -1
  79. package/dist/preview/chunk.HN4ZJ4B4.js +1 -0
  80. package/dist/preview/chunk.HVBKI5ZO.js +1 -0
  81. package/dist/preview/chunk.I3SDKMQS.js +1 -0
  82. package/dist/preview/chunk.IAEGJDF3.js +1 -0
  83. package/dist/preview/{chunk.CS72MISN.js → chunk.IDALEKIW.js} +1 -1
  84. package/dist/preview/chunk.ILJDLBPJ.js +1 -0
  85. package/dist/preview/chunk.J2OPIS3H.js +111 -0
  86. package/dist/preview/chunk.J5OLYVZ4.js +1 -0
  87. package/dist/preview/{chunk.3KUYB5ZT.js → chunk.J6HF7IRQ.js} +1 -1
  88. package/dist/preview/chunk.JEC5FDKX.js +1 -0
  89. package/dist/preview/chunk.JKFVNQY7.js +1 -0
  90. package/dist/preview/chunk.JO2X52D4.js +1 -0
  91. package/dist/preview/{chunk.LVD3V77M.js → chunk.JQ2WNKDW.js} +1 -1
  92. package/dist/preview/{chunk.NBVPWLRY.js → chunk.JQ63N4MZ.js} +1 -1
  93. package/dist/preview/{chunk.7Q43N5JS.js → chunk.JU6UFWS3.js} +1 -1
  94. package/dist/preview/chunk.JVB5KDSG.js +1 -0
  95. package/dist/preview/chunk.KFT7JIEH.js +1 -0
  96. package/dist/preview/chunk.KGMSSXZL.js +1 -0
  97. package/dist/preview/chunk.KX5ZBHMA.js +2 -0
  98. package/dist/preview/{chunk.XTTESA7X.js → chunk.LP2ZMAT2.js} +1 -1
  99. package/dist/preview/{chunk.IMKD6QQG.js → chunk.LRNFE3UK.js} +1 -1
  100. package/dist/preview/{chunk.BUQKRXI6.js → chunk.LVOTLGJB.js} +1 -1
  101. package/dist/preview/chunk.LYEGRY77.js +3 -0
  102. package/dist/preview/{chunk.B3WVCSW5.js → chunk.M5FP4Y4Q.js} +1 -1
  103. package/dist/preview/{chunk.MH46V556.js → chunk.M7KXQGQL.js} +1 -1
  104. package/dist/preview/{chunk.LY5CY7GE.js → chunk.MAKCZ6B6.js} +1 -1
  105. package/dist/preview/{chunk.5THLLSS4.js → chunk.MJY4SLWA.js} +1 -1
  106. package/dist/preview/{chunk.J6KNEI5R.js → chunk.MSAYU25L.js} +1 -1
  107. package/dist/preview/chunk.MUSMNKE4.js +1 -0
  108. package/dist/preview/chunk.MW7R5G3C.js +1 -0
  109. package/dist/preview/chunk.N4ZKZ4GM.js +6 -0
  110. package/dist/preview/chunk.NAXOXBOF.js +1 -0
  111. package/dist/preview/{chunk.LGRQDILY.js → chunk.NKLPL7QD.js} +1 -1
  112. package/dist/preview/chunk.NKYWIGC7.js +3 -0
  113. package/dist/preview/{chunk.35E75QJ7.js → chunk.NRURQGXV.js} +1 -1
  114. package/dist/preview/chunk.NSOPYIT4.js +1 -0
  115. package/dist/preview/chunk.NXZL5CA2.js +1 -0
  116. package/dist/preview/chunk.NYLKG25K.js +4 -0
  117. package/dist/preview/{chunk.BU5PVRX7.js → chunk.O2OL6RQQ.js} +1 -1
  118. package/dist/preview/chunk.O5VFKVZS.js +1 -0
  119. package/dist/preview/chunk.OCXY5DCD.js +6 -0
  120. package/dist/preview/chunk.OHAO6KKH.js +1 -0
  121. package/dist/preview/{chunk.CXDGE5ZS.js → chunk.OWO3OV62.js} +1 -1
  122. package/dist/preview/chunk.P2EKKKK2.js +1 -0
  123. package/dist/preview/chunk.PSNMZBVS.js +1 -0
  124. package/dist/preview/{chunk.NKYYDFIX.js → chunk.PZ7KY6XH.js} +1 -1
  125. package/dist/preview/chunk.QAM76AXV.js +1 -0
  126. package/dist/preview/chunk.QDVGHI7R.js +1 -0
  127. package/dist/preview/{chunk.HJS3LTSR.js → chunk.QF5QB5YR.js} +1 -1
  128. package/dist/preview/chunk.QNP5OR3P.js +93 -0
  129. package/dist/preview/chunk.QRQ5WPZI.js +1 -0
  130. package/dist/preview/chunk.QWGWOEBZ.js +90 -0
  131. package/dist/preview/chunk.QXLJGHMC.js +23 -0
  132. package/dist/preview/{chunk.3RFAUIGT.js → chunk.QZQCQWQG.js} +1 -1
  133. package/dist/preview/chunk.R6JBA7UK.js +1 -0
  134. package/dist/preview/chunk.R7CRBRD4.js +1 -0
  135. package/dist/preview/chunk.RD2FSSLV.js +1 -0
  136. package/dist/preview/{chunk.CD6YWH6T.js → chunk.RG5G6YQD.js} +1 -1
  137. package/dist/preview/{chunk.T3KNLP7C.js → chunk.RJY7VJBH.js} +1 -1
  138. package/dist/preview/chunk.RR25BGWP.js +1 -0
  139. package/dist/preview/chunk.RSMCTI2N.js +1 -0
  140. package/dist/preview/{chunk.ZYNC73DJ.js → chunk.RSQ432QN.js} +1 -1
  141. package/dist/preview/chunk.SFBHPYRD.js +1 -0
  142. package/dist/preview/{chunk.FOSY7MZF.js → chunk.SJQPTDAT.js} +1 -1
  143. package/dist/preview/{chunk.TUCSUZNO.js → chunk.SNHKYH72.js} +1 -1
  144. package/dist/preview/chunk.SO6NT5K7.js +1 -0
  145. package/dist/preview/{chunk.FDWRH5P2.js → chunk.STPA7HBK.js} +3 -3
  146. package/dist/preview/{chunk.R2TSTDS3.js → chunk.SY5ID44D.js} +1 -1
  147. package/dist/preview/chunk.T27QKVKP.js +1 -0
  148. package/dist/preview/{chunk.FXG5AJF6.js → chunk.T2OUHRAA.js} +1 -1
  149. package/dist/preview/chunk.T3WCRS6M.js +1 -0
  150. package/dist/preview/chunk.TI5FR2QQ.js +1 -0
  151. package/dist/preview/{chunk.N2FNHRI2.js → chunk.TTSGCNPT.js} +1 -1
  152. package/dist/preview/{chunk.P6TZGR3A.js → chunk.TXZQEJ5T.js} +1 -1
  153. package/dist/preview/chunk.U6QXLNHF.js +15 -0
  154. package/dist/preview/{chunk.DICM56FT.js → chunk.UDHPMVC4.js} +1 -1
  155. package/dist/preview/{chunk.ZMWAZACO.js → chunk.UGQYMN4J.js} +1 -1
  156. package/dist/preview/chunk.UJPX3BUV.js +1 -0
  157. package/dist/preview/{chunk.CPYBJNHP.js → chunk.UQIPEMJ5.js} +1 -1
  158. package/dist/preview/{chunk.XSWR5LI4.js → chunk.URQTF5SY.js} +1 -1
  159. package/dist/preview/{chunk.7IGD2K4M.js → chunk.UW52CMGJ.js} +1 -1
  160. package/dist/preview/chunk.UWS4RMM3.js +1 -0
  161. package/dist/preview/{chunk.KHAVEYT7.js → chunk.V7H4BUEB.js} +1 -1
  162. package/dist/preview/{chunk.KHRS2SKB.js → chunk.VBHV4TLG.js} +1 -1
  163. package/dist/preview/chunk.VBLQJVQ5.js +1 -0
  164. package/dist/preview/{chunk.SPCAMQJE.js → chunk.WALVW3KJ.js} +1 -1
  165. package/dist/preview/{chunk.6RZHKQP3.js → chunk.WEMUKZKH.js} +1 -1
  166. package/dist/preview/chunk.X226YATK.js +2 -0
  167. package/dist/preview/{chunk.IJ3YDBWI.js → chunk.XFLGSUYO.js} +1 -1
  168. package/dist/preview/{chunk.ZTN7BS5O.js → chunk.XSWSBTUO.js} +1 -1
  169. package/dist/preview/{chunk.ZJFXM3LE.js → chunk.YCD4JSXD.js} +1 -1
  170. package/dist/preview/{chunk.QSDBF7VL.js → chunk.YZPESGCP.js} +1 -1
  171. package/dist/preview/{chunk.QO5RXOCS.js → chunk.Z27NSSYL.js} +2 -2
  172. package/dist/preview/chunk.Z2XUVJAL.js +1 -0
  173. package/dist/preview/{chunk.S3EEY7T3.js → chunk.Z3O2VZAJ.js} +1 -1
  174. package/dist/preview/chunk.Z4TY44CD.js +1 -0
  175. package/dist/preview/{chunk.O2W5JTWA.js → chunk.ZAPS4J6G.js} +1 -1
  176. package/dist/preview/{chunk.F2TWV4TX.js → chunk.ZAQ4IDX6.js} +1 -1
  177. package/dist/preview/chunk.ZEZUKRC6.js +5 -0
  178. package/dist/preview/{chunk.PTQPS2FJ.js → chunk.ZG5VGP5U.js} +1 -1
  179. package/dist/preview/chunk.ZRBGYXAO.js +6 -0
  180. package/dist/preview/index.html +57 -55
  181. package/dist/preview/page.js +2 -2
  182. package/dist/preview/splash.js +17 -14
  183. package/package.json +6 -6
  184. package/dist/preview/chunk.2P34ML3O.js +0 -111
  185. package/dist/preview/chunk.2UW5CRHF.js +0 -1
  186. package/dist/preview/chunk.2YMO7ZVX.js +0 -1
  187. package/dist/preview/chunk.33ULA3CG.js +0 -1
  188. package/dist/preview/chunk.3CJLAJXP.js +0 -25
  189. package/dist/preview/chunk.3IJSB5ET.js +0 -1
  190. package/dist/preview/chunk.3KO35VN4.js +0 -1
  191. package/dist/preview/chunk.3L37FY3G.js +0 -4
  192. package/dist/preview/chunk.3WP66LB5.js +0 -1
  193. package/dist/preview/chunk.4GJ7F4SP.js +0 -35
  194. package/dist/preview/chunk.4IJTPV5X.js +0 -1
  195. package/dist/preview/chunk.4JFBLVXJ.js +0 -1
  196. package/dist/preview/chunk.4PCVQEVI.js +0 -1
  197. package/dist/preview/chunk.5FQSYMAE.js +0 -1
  198. package/dist/preview/chunk.5NCLZ4NZ.js +0 -1
  199. package/dist/preview/chunk.5YNLFOBJ.js +0 -5
  200. package/dist/preview/chunk.77XQEDT5.js +0 -1
  201. package/dist/preview/chunk.7HPQI5SY.js +0 -1
  202. package/dist/preview/chunk.A4VA3DU5.js +0 -1
  203. package/dist/preview/chunk.ABSY3UZF.js +0 -1
  204. package/dist/preview/chunk.ARHAD5IS.js +0 -1
  205. package/dist/preview/chunk.BOC2EOGB.js +0 -9
  206. package/dist/preview/chunk.BR6TINGU.js +0 -1
  207. package/dist/preview/chunk.CDEAAWPS.js +0 -1
  208. package/dist/preview/chunk.CXJJB3MK.js +0 -1
  209. package/dist/preview/chunk.CXLQPE4J.js +0 -1
  210. package/dist/preview/chunk.DA4RSHLW.js +0 -1
  211. package/dist/preview/chunk.DJMSXXP4.js +0 -90
  212. package/dist/preview/chunk.DJPNVXBQ.js +0 -6
  213. package/dist/preview/chunk.DJVHKBEI.js +0 -1
  214. package/dist/preview/chunk.DVSTLVIH.js +0 -15
  215. package/dist/preview/chunk.E5WJSTOV.js +0 -1
  216. package/dist/preview/chunk.FEGSYSA7.js +0 -1
  217. package/dist/preview/chunk.HJUXC5GM.js +0 -1
  218. package/dist/preview/chunk.HNMSYQRA.js +0 -1
  219. package/dist/preview/chunk.HWLRKOI3.js +0 -1
  220. package/dist/preview/chunk.IHUMKFYH.js +0 -10
  221. package/dist/preview/chunk.IQ54QTA5.js +0 -1
  222. package/dist/preview/chunk.IQC3GOXO.js +0 -1
  223. package/dist/preview/chunk.ISN2QTVL.js +0 -2
  224. package/dist/preview/chunk.J24YPQ5I.js +0 -5
  225. package/dist/preview/chunk.J545NAMY.js +0 -1
  226. package/dist/preview/chunk.K2HDEL7I.js +0 -1
  227. package/dist/preview/chunk.K3JARAWU.js +0 -1
  228. package/dist/preview/chunk.KROR65KD.js +0 -2
  229. package/dist/preview/chunk.KV7GZBJ6.js +0 -50
  230. package/dist/preview/chunk.L7NJLZWV.js +0 -1
  231. package/dist/preview/chunk.LON75VHP.js +0 -1
  232. package/dist/preview/chunk.LQWVJQ5X.js +0 -18
  233. package/dist/preview/chunk.M5W2RHC6.js +0 -1
  234. package/dist/preview/chunk.M6BTLH24.js +0 -1
  235. package/dist/preview/chunk.MAGKI4PD.js +0 -1
  236. package/dist/preview/chunk.MD36ZSM5.js +0 -74
  237. package/dist/preview/chunk.MFZJVHWP.js +0 -1
  238. package/dist/preview/chunk.MHTA4HYB.js +0 -19
  239. package/dist/preview/chunk.N2YM247R.js +0 -1
  240. package/dist/preview/chunk.N35SJWAM.js +0 -1
  241. package/dist/preview/chunk.NJSK3UO2.js +0 -6
  242. package/dist/preview/chunk.OHMHPTEW.js +0 -1
  243. package/dist/preview/chunk.OJGHDWI6.js +0 -1
  244. package/dist/preview/chunk.PV2I4UPH.js +0 -1
  245. package/dist/preview/chunk.QFQSSZN7.js +0 -1
  246. package/dist/preview/chunk.RSS6OHXG.js +0 -1
  247. package/dist/preview/chunk.SBCAYTMT.js +0 -1
  248. package/dist/preview/chunk.SMTGRCMG.js +0 -3
  249. package/dist/preview/chunk.TCZIZ2PU.js +0 -1
  250. package/dist/preview/chunk.U74PTRHJ.js +0 -1
  251. package/dist/preview/chunk.UAORKZLO.js +0 -1
  252. package/dist/preview/chunk.UDVTPI2W.js +0 -1
  253. package/dist/preview/chunk.UETLP5KC.js +0 -1
  254. package/dist/preview/chunk.UHI3X2YD.js +0 -1
  255. package/dist/preview/chunk.UL62ELNR.js +0 -1
  256. package/dist/preview/chunk.VRYSZYAD.js +0 -1
  257. package/dist/preview/chunk.VUZFLDOX.js +0 -1
  258. package/dist/preview/chunk.X2NGFOAF.js +0 -1
  259. package/dist/preview/chunk.XE762VL2.js +0 -2
  260. package/dist/preview/chunk.Y2RZ5B4U.js +0 -1
  261. package/dist/preview/chunk.YKMBXMZE.js +0 -1
  262. package/dist/preview/chunk.Z34KASY7.js +0 -1
  263. package/dist/preview/chunk.ZMGKWMID.js +0 -1
  264. package/dist/preview/chunk.ZT5YQSSP.js +0 -21
  265. package/dist/preview/chunk.ZZM75ZTN.js +0 -4
@@ -1,10 +0,0 @@
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 Ee,b as De,c as Le,d as N,e as te}from"./chunk.PV2I4UPH.js";import{c as Pe,d as Te}from"./chunk.FEGSYSA7.js";import"./chunk.KROR65KD.js";import"./chunk.BJUUSIQY.js";import"./chunk.MH46V556.js";import"./chunk.XOZU4OFA.js";import"./chunk.5M34BJIQ.js";import"./chunk.MIE4TJRW.js";import{A as Ce,x as Me}from"./chunk.CXJJB3MK.js";import"./chunk.OJGHDWI6.js";import"./chunk.74B6KQF4.js";import"./chunk.64FCAUAJ.js";import"./chunk.DA4RSHLW.js";import"./chunk.FOSY7MZF.js";import"./chunk.NBVPWLRY.js";import"./chunk.S3EEY7T3.js";import{m as $e}from"./chunk.MD36ZSM5.js";import"./chunk.L6FGKJ5H.js";import{G as et,Ka as Re,V as xe,da as Ae}from"./chunk.3CJLAJXP.js";import{a as ke}from"./chunk.SDO3U72B.js";import{sd as ee}from"./chunk.J24YPQ5I.js";import"./chunk.FQLNBIQ5.js";import{b as Q}from"./chunk.AJZBJBMO.js";var tt=/^h([1-6])$/,ne={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"},nt=e=>typeof e=="object"&&e!==null&&typeof e.getAttribute=="function"&&(e.nodeType===void 0||e.nodeType===1),B=e=>(e??"").replace(/\s+/g," ").trim();function*V(e){yield e;for(let t of Array.from(e.childNodes))nt(t)&&(yield*V(t))}var Oe=e=>(e.getAttribute("data-graview-as")??e.localName??"").toLowerCase();function Ie(e){let t=tt.exec(Oe(e));return t?Number(t[1]):e.getAttribute("role")==="heading"?Number(e.getAttribute("aria-level")??2):void 0}function Ne(e){let t=[...V(e)],o=new Map;for(let s of t){let u=s.getAttribute("id");u&&o.set(u,s)}let n=[],d=new Set,i=(s,u)=>{let a=s.toLowerCase();!s||d.has(a)||(d.add(a),n.push({name:s.length>80?`${s.slice(0,79)}\u2026`:s,as:u}))};for(let s of t){if(s.getAttribute("aria-hidden")==="true"||s.getAttribute("hidden")!==null)continue;if(Ie(s)!==void 0){i(B(s.textContent),"heading");continue}let a=Oe(s),l=(s.getAttribute("role")??"").toLowerCase(),r=l in ne?l:a in ne?a:void 0;if(!r)continue;let g=(s.getAttribute("aria-labelledby")??"").split(/\s+/).flatMap(f=>o.get(f)?[B(o.get(f).textContent)]:[]).join(" "),h=[...V(s)].find(f=>f!==s&&Ie(f)!==void 0),c=B(s.getAttribute("aria-label"))||g||(h?B(h.textContent):"")||ne[r]||"";i(c,r==="region"?"section":r)}return n}var _="\0";function je(e){let t=[],o=e.length,n=0,d="",i=r=>r.replace(/\\(u\{[0-9a-fA-F]+\}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}|.)/gs,(g,h)=>h==="n"?`
2
- `:h==="t"?" ":h[0]==="u"||h[0]==="x"?String.fromCodePoint(parseInt(h.replace(/[ux{}]/g,""),16)):h),s=r=>{let g=++n;for(;n<o&&e[n]!==r&&e[n]!==`
3
- `;)n+=e[n]==="\\"?2:1;let h=e.slice(g,n);return n++,i(h)},u=()=>{n++;let r=!1;for(;n<o&&e[n]!==`
4
- `;){let g=e[n];if(g==="\\")n+=2;else if(g==="[")r=!0,n++;else if(g==="]")r=!1,n++;else{if(g==="/"&&!r)break;n++}}for(n++;n<o&&/[a-z]/i.test(e[n]);)n++},a=()=>{n++;let r="";for(;n<o;){let g=e[n];if(g==="\\")r+=i(e.slice(n,n+2)),n+=2;else{if(g==="`")return n++,r;g==="$"&&e[n+1]==="{"?(n+=2,l(!0),r+=_):(r+=g,n++)}}return r};function l(r){let g=0;for(;n<o;){let h=e[n];if(h==="/"&&e[n+1]==="/"){let c=e.indexOf(`
5
- `,n);n=c<0?o:c}else if(h==="/"&&e[n+1]==="*"){let c=e.indexOf("*/",n+2);n=c<0?o:c+2}else if(h==='"'||h==="'")t.push(s(h)),d="a";else if(h==="`")t.push(a()),d="a";else if(h==="/"&&(d===""||"(,=:[!&|?{};+-*%<>~^".includes(d)))u(),d="a";else{if(h==="{"&&g++,h==="}"){if(r&&g===0){n++;return}g--}/\s/.test(h)||(d=h),n++}}}return l(!1),t}var rt=e=>e.replace(/\s+/g," ").replace(/\s*([>+~,])\s*/g,"$1").trim();function ot(e){let t=[],o=0,n=0;for(let d=0;d<e.length;d++){let i=e[d];i==="("||i==="["?o++:i===")"||i==="]"?o--:i===","&&o===0&&(t.push(e.slice(n,d)),n=d+1)}return t.push(e.slice(n)),t.map(rt).filter(Boolean)}var it=new Set(["media","supports","container","layer","scope","document"]);function ie(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,""),o=[],n=s=>{let u=t[s],a=s+1;for(;a<t.length&&t[a]!==u;)a+=t[a]==="\\"?2:1;return a+1},d=s=>{let u=1,a=s;for(;a<t.length&&u>0;){let l=t[a];if(l==='"'||l==="'"){a=n(a);continue}l==="{"?u++:l==="}"&&u--,a++}return a},i=s=>{let u="",a=s;for(;a<t.length;){let l=t[a];if(l==='"'||l==="'"){let r=n(a);u+=t.slice(a,r),a=r}else{if(l==="}")return a+1;if(l===";")u="",a++;else if(l==="{"){let r=u.trim();if(u="",r.startsWith("@")){let g=(/^@([\w-]+)/.exec(r)?.[1]??"").toLowerCase();a=it.has(g)?i(a+1):d(a+1)}else o.push(...ot(r)),a=d(a+1)}else u+=l,a++}}return a};return i(0),[...new Set(o)]}function q(e){let t=e.replace(/\[[^\]]*\]/g,"").replace(/"[^"]*"|'[^']*'/g,"");return[...new Set([...t.matchAll(/([.#])(-?[_a-zA-Z -￿][\w -￿-]*)/g)].map(o=>`${o[1]}${o[2]}`))]}var st=e=>!e.includes(_)&&e.length<300&&!/[<;!@]|=>|^\d/.test(e)&&/^[\w\s.#:>+~*()[\]="'^$|,\\%-]+$/u.test(e),at=/\b(?:class|className)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,lt=/\bid\s*=\s*(?:"([^"]*)"|'([^']*)')/g,dt=/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1\s*>/gi,ct=/<(section|nav|main|aside|header|footer|article|form)\b[^>]*?\baria-label\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;function Ve(e){let t=e.css===void 0||e.drawing===void 0&&e.classes===void 0?je(e.source):[],o=e.css!==void 0?ie(e.css):[...new Set(t.filter(i=>i.includes("{")&&i.includes("}")).flatMap(i=>ie(i)).filter(st))],n=new Set,d;if(e.drawing){for(let i of V(e.drawing)){for(let u of(i.getAttribute("class")??"").split(/\s+/))u&&n.add(`.${u}`);let s=i.getAttribute("id");s&&n.add(`#${s}`)}d=Ne(e.drawing)}else{let i=a=>(a[1]??a[2]??"").split(/\s+/).filter(l=>l&&!l.includes(_));for(let a of t){for(let l of a.matchAll(at))for(let r of i(l))n.add(`.${r}`);for(let l of a.matchAll(lt))for(let r of i(l))n.add(`#${r}`)}let s=new Set;d=[];let u=(a,l)=>{let r=a.replace(/\s+/g," ").trim();!r||r.includes(_)||s.has(r.toLowerCase())||(s.add(r.toLowerCase()),d.push({name:r,as:l}))};for(let a of t){for(let l of a.matchAll(ct))u(l[2]??l[3]??"",l[1].toLowerCase());for(let l of a.matchAll(dt))u(l[2].replace(/<[^>]*>/g,""),"heading")}}for(let i of e.classes??[])n.add(`.${i}`);return{from:e.drawing||e.classes?"drawing":"source",selectors:o,drawn:n,sections:d}}var re=8,oe=e=>e.length<=re?e.join(", "):`${e.slice(0,re).join(", ")} and ${e.length-re} more`,He=e=>`${Math.round(e).toLocaleString("en-US")}px`;function se(e,t){let o=Ve(e),n=Ve(t),d=new Set(n.selectors.flatMap(q)),i=new Map;for(let m of o.selectors)for(let x of q(m))x.startsWith(".")&&i.set(x,[...i.get(x)??[],m]);let s=[...i].filter(([m])=>n.drawn.has(m)&&!d.has(m)).map(([m,x])=>({class:m.slice(1),styledBy:x})),u=new Set(s.map(m=>`.${m.class}`)),a=new Set(n.selectors),l=o.selectors.filter(m=>!a.has(m)).map(m=>({selector:m,names:q(m)})).filter(m=>m.names.length>0&&m.names.every(x=>n.drawn.has(x)&&(o.from==="source"||o.drawn.has(x)))),r=new Set(n.sections.map(m=>m.name.toLowerCase())),g=o.sections.filter(m=>!r.has(m.name.toLowerCase())),h=e.height!==void 0&&t.height!==void 0&&e.height>0?{before:e.height,after:t.height,change:t.height-e.height,ratio:Math.round((t.height-e.height)/e.height*1e3)/1e3}:void 0,c=h!==void 0&&Math.abs(h.ratio)>=.1&&Math.abs(h.change)>=50,f=[];if(s.length>0){let m=s.map(x=>`.${x.class}`);f.push(`${s.length===1?"A class":`${s.length} classes`} it still draws lost every rule that styled ${s.length===1?"it":"them"} before: ${oe(m)}. Put back the rules for ${s.length===1?"it":"them"}, or stop drawing ${s.length===1?"it":"them"}.`)}let S=l.filter(m=>!m.names.some(x=>u.has(x)));S.length>0&&f.push(`${S.length===1?"A rule was":`${S.length} rules were`} taken out while the markup ${S.length===1?"it":"they"} styled is still drawn: ${oe(S.map(m=>`"${m.selector}"`))}.`),g.length>0&&f.push(`${g.length===1?"A section":`${g.length} sections`} drawn before ${g.length===1?"is":"are"} not drawn now: ${oe(g.map(m=>`"${m.name}"`))}.`),h&&c&&f.push(`The page is ${He(h.after)} tall, ${h.change<0?"down":"up"} from ${He(h.before)} (${h.change<0?"\u2212":"+"}${Math.round(Math.abs(h.ratio)*100)}%).`);let $=f.length>0;return{regressed:$,unstyled:s,selectorsRemoved:l,sectionsMissing:g,...h?{height:h}:{},read:{before:o.from,after:n.from},said:f,text:$?f.join(" "):`Nothing it drew before lost its style, and no section it drew is gone${h?"; the page is about as tall":""}.`}}var qe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),ut=new Set(["section","article","nav","aside","header","footer","main","form","search"]),de=/^h([1-6])$/,gt=/<(\/?)([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|\$\{(?:[^{}]|\{[^{}]*\})*\}|[^>"'$]|\$(?!\{))*)>/g,H=e=>e.replace(/\s+/g," ").trim(),ue=e=>H(e.replace(/\$\{(?:[^{}]|\{[^{}]*\})*\}/g," ").replace(/<[^>]*>/g," ")),Ue=(e,t)=>H(e).toLowerCase()===H(t).toLowerCase();function _e(e){let t=[];for(let o of e.matchAll(gt)){let n=o[2].toLowerCase(),d=o[3]??"";t.push({start:o.index,end:o.index+o[0].length,name:n,closing:o[1]==="/",attrs:qe.has(n)||d.trimEnd().endsWith("/")?`${d}\0void`:d})}return t}var ce=e=>qe.has(e.name)||e.attrs.endsWith("\0void");function P(e,t){let o=new RegExp(`(?:^|\\s)${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s"'>]+))`,"i").exec(e.attrs),n=o?o[1]??o[2]??o[3]:void 0;return n===void 0||n.includes("${")?void 0:n}function W(e,t){let o=e[t],n=0;for(let d=t+1;d<e.length;d++){let i=e[d];if(!(i.name!==o.name||ce(i)))if(!i.closing)n+=1;else{if(n===0)return d;n-=1}}return-1}function ht(e,t,o){let n=t.findIndex(i=>!i.closing&&P(i,"id")===o);if(n<0)return;let d=W(t,n);return d<0?void 0:ue(e.slice(t[n].end,t[d].start))}function ft(e,t,o,n){let d=t[o],i=P(d,"data-section");if(i)return H(i);let s=P(d,"aria-label");if(s)return H(s);let u=P(d,"aria-labelledby");if(u){let a=u.split(/\s+/).filter(Boolean).map(l=>ht(e,t,l)??"").filter(Boolean).join(" ");if(a)return a}for(let a=o+1;a<n;a++){let l=t[a];if(l.closing||!de.test(l.name))continue;let r=W(t,a);if(r>0)return ue(e.slice(l.end,t[r].start))}return""}function pt(e){let t=[];for(let o of e.matchAll(/graview\.style\(\s*([`"'])/g)){let n=o[1],d=o.index+o[0].length,i=d;for(;i<e.length&&e[i]!==n;)i+=e[i]==="\\"?2:1;i<e.length&&t.push({start:d,end:i,quote:n})}return t}function mt(e,t,o){let n=[],d=0;for(;d<e.length;){let i=e.indexOf("{",d);if(i<0)break;let s=0,u=i;for(;u<e.length;u++)if(e[u]==="{")s+=1;else if(e[u]==="}"&&--s===0)break;if(u>=e.length)break;let a=d;for(;a<i&&/\s/.test(e[a]);)a+=1;for(;e.startsWith("/*",a);){let g=e.indexOf("*/",a);for(a=g<0?i:g+2;a<i&&/\s/.test(e[a]);)a+=1}let l=e.slice(a,i).trim(),r=l.startsWith("@")?[...e.slice(i+1,u).matchAll(/([^{}]+)\{/g)].map(g=>g[1].trim()).join(", "):l;n.push({start:t+a,end:t+u+1,selector:r,text:e.slice(a,u+1),sheet:o}),d=u+1}return n}var yt=e=>[...e.replace(/\[[^\]]*\]|:[\w-]+\([^)]*\)/g," ").matchAll(/([.#])(-?[_a-zA-Z][\w-]*)/g)].map(t=>`${t[1]}${t[2]}`);function wt(e){let t=new Set;for(let o of _e(e)){if(o.closing)continue;let n=/(?:^|\s)class\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(o.attrs);for(let i of(n?.[1]??n?.[2]??"").replace(/\$\{(?:[^{}]|\{[^{}]*\})*\}/g," ").split(/\s+/))i&&t.add(`.${i}`);let d=P(o,"id");d&&t.add(`#${d}`)}return t}function bt(e,t){let o=_e(e),n,d=1/0;for(let l=0;l<o.length;l++){let r=o[l];if(r.closing||ce(r)||!(ut.has(r.name)||P(r,"data-section")!==void 0||P(r,"role")==="region"))continue;let h=W(o,l);if(h<0)continue;let c=o[h].end;c-r.start<d&&Ue(ft(e,o,l,h),t)&&(d=c-r.start,n={start:r.start,end:c,text:e.slice(r.start,c)})}if(!n)for(let l=0;l<o.length&&!n;l++){let r=o[l],g=de.exec(r.name);if(r.closing||!g)continue;let h=W(o,l);if(h<0||!Ue(ue(e.slice(r.end,o[h].start)),t))continue;let c=0,f=o[h].end;for(let S=h+1;S<o.length;S++){let $=o[S];if(ce($))continue;let m=de.exec($.name);if(c===0&&!$.closing&&m&&Number(m[1])<=Number(g[1])||$.closing&&c===0)break;c+=$.closing?-1:1,f=$.end}n={start:r.start,end:f,text:e.slice(r.start,f)}}if(!n)return;let i=wt(n.text),s=pt(e),u=[],a=[];return s.forEach((l,r)=>{for(let g of mt(e.slice(l.start,l.end),l.start,r)){let h=g.selector.split(",").map(f=>yt(f));h.some(f=>f.some(S=>i.has(S)))&&(h.every(f=>f.some(S=>i.has(S)))?u.push(g):a.push(g))}}),{name:t,markup:n,rules:u,shared:a,names:[...i],sheets:s}}function ae(e,t){return t==="`"?e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"):e.replace(/\\/g,"\\\\").replace(new RegExp(t,"g"),`\\${t}`).replace(/\n/g,"\\n")}function Be(e,t,o){let n=[{start:t.markup.start,end:t.markup.end,text:o.markup}],d=o.css.trim(),[i,...s]=t.rules;if(i){let a=t.sheets[i.sheet];n.push({start:i.start,end:i.end,text:ae(d,a.quote)});for(let l of s)n.push({start:l.start,end:l.end,text:""})}else if(d){let a=t.sheets[0];a?n.push({start:a.end,end:a.end,text:ae(`
6
- ${d}
7
- `,a.quote)}):n.push({start:0,end:0,text:`graview.style(\`
8
- ${ae(d,"`")}
9
- \`);
10
- `})}n.sort((a,l)=>l.start-a.start);let u=e;for(let a of n)u=u.slice(0,a.start)+a.text+u.slice(a.end);return u}var vt=["You revise one section of a view in a Graview app.","The view is a plain script: it draws HTML with graview.html`\u2026` templates and styles it with graview.style(css).","You are given the section's markup exactly as it stands in the script's template. It may hold ${\u2026} interpolations: keep each one you keep exactly as written, and never name a variable that is not already in them.","You are given the stylesheet rules that style only this section (you rewrite them), the rules it shares with the rest of the view (never restate or change those), the app's look (its scheme and the values of its --graview-* tokens), and the words the section shows now.",`Answer with one JSON object and nothing else: {"markup": "<the section's whole new markup>", "css": "<every rule that styles it now>", "said": "<one sentence to the person saying what you changed>"}.`,"Keep the same outer element, and keep its name \u2014 its label or its heading's words \u2014 so it is still found. Show the same data. Style every class the markup uses, or stop using it. Use var(--graview-\u2026) tokens for colors, type and corners, never colors of your own.","Never use import, export, require, <script>, <style>, or on\u2026= attributes."].join(" ");function le(e){let t=e.mode==="just"?"Make this section better: easier to read at a glance, laid out cleanly at a phone's width and at a desk's, in the app's own look. Change no data it shows.":(e.words??"").trim();return JSON.stringify({section:e.located.name,asked:t,...e.mode==="highlight"&&e.highlighted?.length?{pointed_at:e.highlighted}:{},markup:e.located.markup.text,rules:e.located.rules.map(o=>o.text),shared_rules:e.located.shared.map(o=>o.text),...e.theme?{look:e.theme}:{},...e.shows?{shows:e.shows.slice(0,1200)}:{},...e.findings?.length?{your_last_answer:e.last,what_broke:e.findings,repair:"Your last answer broke the view as said in what_broke. Answer again, fixing each one."}:{}})}function St(e){let t=/```(?:json)?\s*([\s\S]*?)```/.exec(e)?.[1]??e,o=t.indexOf("{"),n=t.lastIndexOf("}");if(!(o<0||n<=o))try{let d=JSON.parse(t.slice(o,n+1));return typeof d.markup!="string"||!d.markup.trim().startsWith("<")?void 0:{markup:d.markup.trim(),css:typeof d.css=="string"?d.css:"",said:typeof d.said=="string"&&d.said.trim()?d.said.trim():"Revised this section."}}catch{return}}async function We(e){let t=[],o=bt(e.source,e.section);if(!o)return{ok:!1,refused:`\u201C${e.section}\u201D could not be found in the view's code, so it cannot be revised on its own.`,stages:t};let n=e.ai.off?void 0:e.ai.light,d=Pe(e.ai),i=n??d;if(!i)return{ok:!1,refused:e.ai.withoutModel??"Revising a section needs AI, and none is on here.",stages:t};let s=async(f,S,$)=>{let m=Date.now();try{let x=await f.think({system:vt,prompt:$,state:{},catalog:{candidates:[]}});return t.push({stage:S,model:f.model,ms:Date.now()-m,...x.usage?{usage:x.usage}:{}}),St(x.text)}catch{t.push({stage:S,model:f.model,ms:Date.now()-m});return}},u={located:o,mode:e.mode,...e.words?{words:e.words}:{},...e.highlighted?{highlighted:e.highlighted}:{},...e.theme?{theme:e.theme}:{},...e.shows?{shows:e.shows}:{}},l=await s(i,n?"light":"thinking",le(u));if(!l&&n&&d&&d!==n&&(l=await s(d,"thinking",le(u))),!l)return{ok:!1,refused:"The model did not answer with a revision of this section.",stages:t};let r=Be(e.source,o,l),g=await e.judge(r);if(g.length===0)return{ok:!0,source:r,said:l.said,located:o,repaired:!1,stages:t};let h=d??i,c=await s(h,h===n?"light":"thinking",le({...u,findings:g,last:l}));return c?(r=Be(e.source,o,c),g=await e.judge(r),g.length>0?{ok:!1,refused:`It could not be revised without breaking the view: ${g.join(" ")}`,stages:t}:{ok:!0,source:r,said:c.said,located:o,repaired:!0,stages:t}):{ok:!1,refused:`It could not be revised without breaking the view: ${g.join(" ")}`,stages:t}}var w=Q(et(),1);var p=Q(xe(),1);var ge=Re(ke(()=>(__graviewPreload(import.meta.url,["./chunk.KROR65KD.js","./chunk.BJUUSIQY.js","./chunk.64FCAUAJ.js","./chunk.S3EEY7T3.js","./chunk.MD36ZSM5.js","./chunk.L6FGKJ5H.js","./chunk.3CJLAJXP.js","./chunk.SDO3U72B.js","./chunk.J24YPQ5I.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UL62ELNR.js")))),kt=ge.part((e,t)=>(0,p.jsx)(e.RateTelling,{...t}),{quiet:!0});function en({ask:e,open:t,close:o}){return e?(0,p.jsx)(Mt,{ask:e,close:o},e.at):t?(0,p.jsx)(te,{elements:t}):null}var xt=360,R=12;function At(e,t){let o={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},n=Math.min(xt,o.width-2*R),d=e.getBoundingClientRect().height,i=a=>Math.max(R,Math.min(a,o.height-d-R)),s=(o.width-n)/2,u=i(72);t&&t.width>0&&(t.right+R+n<=o.width-R?[s,u]=[t.right+R,i(t.top)]:t.left-R-n>=R?[s,u]=[t.left-R-n,i(t.top)]:(s=Math.max(R,Math.min(t.left,o.width-n-R)),u=t.bottom+R+d<=o.height-R?t.bottom+R:i(t.top-R-d))),e.style.left=`${Math.round(s)}px`,e.style.top=`${Math.round(u)}px`,e.style.width=`${Math.round(n)}px`}var Rt=e=>e.map(t=>t.innerText??t.textContent??"").join(" ").replace(/\s+/g," ").trim(),Ye=e=>{let t=e.getBoundingClientRect();return{tag:(e.getAttribute("data-graview-as")??e.localName).toLowerCase(),classes:[...e.classList],text:e.textContent??"",box:{left:t.left,top:t.top,width:t.width,height:t.height}}};function $t(e,t,o){let n=[...e.querySelectorAll("*")].filter(s=>{let u=s.getBoundingClientRect();return u.width>0&&u.height>0});if(o){let s=n.filter(l=>{let r=l.getBoundingClientRect();return t.left>=r.left&&t.left<=r.right&&t.top>=r.top&&t.top<=r.bottom}),a=s.filter(l=>!s.some(r=>r!==l&&l.contains(r)))[0];if(!a)return[];for(let l=a;l&&l!==e;l=l.parentElement)if(l.classList.length>0||/^(h[1-6]|li|a|button|img|p|article|section)$/.test(l.localName))return[l];return[a]}let d=n.filter(s=>{let u=s.getBoundingClientRect();return u.left>=t.left-2&&u.right<=t.right+2&&u.top>=t.top-2&&u.bottom<=t.bottom+2}),i=d.filter(s=>!d.some(u=>u!==s&&u.contains(s)));for(;i.length===1;){let s=[...i[0].children].filter(u=>d.includes(u));if(s.length<2)break;i=s}return i}function ze(e,t,o,n,d,i){let s=d.drawing(),u=se({source:t,css:o.css,...o.root?{drawing:o.root}:{},...o.height!==void 0?{height:o.height}:{}},{source:i,css:s.css,...s.root?{drawing:s.root}:{},...s.height!==void 0?{height:s.height}:{}}),a=[];for(let g of u.unstyled)a.push(`The class \u201C${g.class}\u201D is still drawn and no rule styles it now.`);for(let g of u.sectionsMissing)a.push(`\u201C${g.name}\u201D is not drawn any more.`);for(let g of d.refused())n.includes(g)||a.push(g);let l=[],r=u.height;return r&&Math.abs(r.ratio)>=.1&&l.push(`The view is ${Math.abs(Math.round(r.change))} px ${r.change>0?"taller":"shorter"} (${Math.round(r.before)} \u2192 ${Math.round(r.after)}).`),{findings:a,notes:l}}function Mt({ask:e,close:t}){let{ai:o,aiDesk:n,principal:d,keptViews:i}=Ae(),[s,u]=(0,w.useState)(e.section),a=Ee(e.section),l=(0,w.useRef)(Me(a)),r=(0,w.useRef)(null),g=(0,w.useRef)(null),h=(0,w.useRef)(null),[c,f]=(0,w.useState)(e.mode==="highlight"?{at:"highlighting"}:e.mode==="describe"?{at:"asking"}:{at:"working"}),[S,$]=(0,w.useState)(""),m=(0,w.useRef)(void 0),[x,Xe]=(0,w.useState)(null),he=(0,w.useRef)(null),T=(0,w.useCallback)(y=>{let v=he.current;v&&o.told&&ge.load().then(b=>b.changeTelling(o.told,v.id,{outcome:y}),()=>{})},[o.told]),K=(0,w.useCallback)((y,v,b,A,k,E)=>{let C=o.told;if(!C)return;let L=A.at(-1)?.stage==="thinking"?"full":A.length>0?"light":void 0;ge.load().then(U=>{let I=U.keepTelling(C,{words:y,target:{on:"place",place:v.view},decided:b?{type:"refusal"}:{type:"view",section:v.name},...L?{slot:L}:{},stages:A.map(O=>({stage:O.stage==="thinking"?"full":"light",ms:O.ms,model:O.model})),ms:k,outcome:b?"abandoned":"previewed",interaction:E},d);he.current=I??null,Xe(I??null)},()=>{})},[o.told,d]);(0,w.useEffect)(()=>()=>{r.current?.dispose(),r.current=null},[]);let F=(0,w.useCallback)((y,v,b,A={})=>({id:Te(),at:new Date().toISOString(),by:d,target:{on:"place",place:s.view},targetLabel:l.current?.title??s.view,ask:{kind:"section",said:y},offered:[],outcome:v,stages:b.map(k=>({stage:k.stage,ms:k.ms,model:k.model})),usage:b.flatMap(k=>k.usage?[{tier:k.stage==="light"?"fast":"thinking",model:k.model,inputTokens:k.usage.inputTokens,outputTokens:k.usage.outputTokens}]:[]),...A}),[d,s.view]),X=(0,w.useCallback)(async(y,v,b,A=s)=>{let k=l.current,E=y==="just"?`Make \u201C${A.name}\u201D better`:`Make \u201C${A.name}\u201D better: ${v}`;if(!k)return f({at:"refused",said:"This view is not drawn here any more."});f({at:"working",...b?{pointed:b}:{}});let C=await k.source();if(C===void 0)return f({at:"refused",said:"This view is a whole worker script, and only a plain script's section can be revised here."});m.current??=C;let L=Date.now(),U=k.drawing(),I=k.refused(),O=await k.theme().catch(()=>({})),M=await We({ai:o,source:C,section:A.name,mode:y,...v?{words:v}:{},...b?{highlighted:[b.name,...b.lines]}:{},theme:O,shows:Rt(A.elements),judge:async D=>{r.current?.dispose(),r.current=null;let ve=await k.check(D);if(ve.length>0)return ve;let Z=k.draft(D);r.current=Z;let{failed:Se}=await Z.drawn;return Se?[`The view did not draw: ${Se}`]:(await new Promise(Qe=>requestAnimationFrame(()=>requestAnimationFrame(Qe))),ze(k,C,U,I,Z,D).findings)}});if(!M.ok){r.current?.dispose(),r.current=null;let D=F(E,"failed",M.stages,{failed:M.refused});return n.record(D),K(v||E,A,!0,M.stages,Date.now()-L,D.id),f({at:"refused",said:M.refused})}let we=r.current?ze(k,C,U,I,r.current,M.source).notes:[],be=F(E,"offered",M.stages);K(v||E,A,!1,M.stages,Date.now()-L,be.id),f({at:"draft",source:M.source,said:M.said,notes:M.repaired?["Repaired once after the first try broke the view.",...we]:we,entry:be})},[o,n,F,s,K]),fe=(0,w.useRef)(!1);(0,w.useEffect)(()=>{e.mode!=="just"||fe.current||(fe.current=!0,X("just",""))},[e.mode,X]);let Je=(0,w.useCallback)(async()=>{if(c.at!=="draft"||!i?.revise||!l.current)return;let y=l.current,v=await y.source()??"";f({at:"keeping",source:c.source,entry:c.entry});try{let b=await i.revise({name:y.name,title:y.title,source:c.source,before:v,section:s.name,said:c.said});r.current?.dispose(),r.current=null,y.draw(c.source);let A={...c.entry,outcome:"accepted"};n.record(A),T("accepted"),f({at:"kept",source:v,...b&&b.note?{note:b.note}:{},answer:b,entry:A})}catch(b){f({at:"refused",said:b instanceof Error?b.message:"The host did not keep it."})}},[c,i,n,s.name,T]),J=(0,w.useCallback)(()=>{r.current?.dispose(),r.current=null,c.at==="draft"&&(n.record({...c.entry,outcome:"dismissed"}),T("declined")),t()},[c,n,t,T]),Ze=(0,w.useCallback)(async()=>{if(c.at!=="kept"||!l.current)return;let y=l.current,v=await y.source()??"";try{c.answer&&typeof c.answer.undo=="function"?await c.answer.undo():await i?.revise?.({name:y.name,title:y.title,source:c.source,before:v,section:s.name,said:"Put back as it was.",undoes:!0}),y.draw(c.source===m.current?void 0:c.source),n.record({...c.entry,outcome:"dismissed"}),T("undone"),f({at:"undone"})}catch(b){f({at:"refused",said:b instanceof Error?b.message:"The host did not put it back."})}},[c,i,n,s.name,T]);(0,w.useLayoutEffect)(()=>{let y=0,v=()=>{if(g.current){let b=a?.querySelector("[data-graview-section-draft]");At(g.current,b?N([b]):N(s.elements)??(a?N([a]):null))}y=requestAnimationFrame(v)};return v(),()=>cancelAnimationFrame(y)},[s,a]),(0,w.useEffect)(()=>{c.at==="asking"?h.current?.focus():c.at!=="highlighting"&&g.current?.querySelector("button[data-first]")?.focus()},[c.at]),(0,w.useEffect)(()=>{let y=v=>{v.key==="Escape"&&(v.preventDefault(),J(),e.returnTo?.focus?.())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[J,e.returnTo]);let pe=c.at==="asking"||c.at==="working"?c.pointed:void 0;if(c.at==="highlighting")return(0,p.jsx)(Ct,{place:a,section:s,cancel:t,chose:y=>{let v=y[0],A=(v?Ce(v):void 0)??s;u(A),f({at:"asking",pointed:{name:De(y.map(Ye)),lines:Le(y.map(Ye))}})}});let me=c.at==="draft"||c.at==="keeping",ye=me?[...a?.querySelectorAll("[data-graview-section-draft]")??[]]:c.at==="kept"||c.at==="undone"?[]:s.elements;return(0,p.jsxs)(p.Fragment,{children:[ye.length>0?(0,p.jsx)(te,{elements:ye,label:me?"Draft":void 0}):null,(0,p.jsxs)("div",{ref:g,role:"dialog","aria-label":`Make \u201C${s.name}\u201D better`,"data-testid":"section-card","data-section-phase":c.at,"data-graview-popover":"",style:Pt,children:[(0,p.jsxs)("p",{style:Tt,children:["Make ",(0,p.jsxs)("strong",{children:["\u201C",s.name,"\u201D"]})," better"]}),pe?(0,p.jsxs)("p",{"data-testid":"section-pointed",style:Y,children:["You pointed at ",pe.name,"."]}):null,c.at==="asking"?(0,p.jsxs)("form",{onSubmit:y=>{y.preventDefault(),S.trim()&&X(e.mode,S.trim(),c.pointed)},style:{display:"grid",gap:8},children:[(0,p.jsx)("label",{style:$e,htmlFor:"graview-section-words",children:c.pointed?"What should change here?":"What should change?"}),(0,p.jsx)("input",{id:"graview-section-words",ref:h,"data-testid":"section-words",value:S,onChange:y=>$(y.target.value),placeholder:c.pointed?"What should change here?":"What should change?",style:Dt}),(0,p.jsxs)("div",{style:z,children:[(0,p.jsx)("button",{type:"submit","data-first":"",disabled:!S.trim(),style:Ge,children:"Revise"}),(0,p.jsx)("button",{type:"button",onClick:t,style:j,children:"Cancel"})]})]}):null,(0,p.jsx)("p",{role:"status","aria-live":"polite","data-testid":"section-status",style:c.at==="working"||c.at==="keeping"?Et:Y,children:c.at==="working"?`Revising \u201C${s.name}\u201D\u2026`:c.at==="keeping"?"Keeping it\u2026":c.at==="draft"?c.said:c.at==="kept"?`Kept.${c.note?` ${c.note}`:""}`:c.at==="undone"?"Put back as it was.":c.at==="refused"?c.said:""}),c.at==="draft"?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("p",{"data-testid":"section-draft-line",style:Y,children:"Draft \u2014 shown in place, not kept."}),c.notes.map(y=>(0,p.jsx)("p",{"data-testid":"section-note",style:Y,children:y},y)),(0,p.jsxs)("div",{style:z,children:[(0,p.jsx)("button",{type:"button","data-first":"","data-testid":"section-keep",onClick:()=>void Je(),style:Ge,children:"Keep"}),(0,p.jsx)("button",{type:"button","data-testid":"section-discard",onClick:J,style:j,children:"Discard"})]})]}):null,c.at==="kept"?(0,p.jsxs)("div",{style:z,children:[(0,p.jsx)("button",{type:"button","data-first":"","data-testid":"section-undo",onClick:()=>void Ze(),style:j,children:"Undo"}),(0,p.jsx)("button",{type:"button",onClick:t,style:j,children:"Close"})]}):null,c.at==="refused"||c.at==="undone"?(0,p.jsx)("div",{style:z,children:(0,p.jsx)("button",{type:"button","data-first":"",onClick:t,style:j,children:"Close"})}):null,x&&o.told&&c.at!=="working"&&c.at!=="asking"?(0,p.jsx)(kt,{told:o.told,telling:x}):null]})]})}function Ct({place:e,section:t,cancel:o,chose:n}){let d=(0,w.useRef)(null),[i,s]=(0,w.useState)(null),u=e?.querySelector("[data-worker-view]")?.shadowRoot?.querySelector("[data-graview-view-root]")??void 0;(0,w.useLayoutEffect)(()=>{let r=0,g=()=>{let h=e?N([e]):null,c=d.current;c&&h&&(c.style.left=`${Math.round(h.left-G)}px`,c.style.top=`${Math.round(h.top-G)}px`,c.style.width=`${Math.round(h.width+2*G)}px`,c.style.height=`${Math.round(h.height+2*G)}px`),r=requestAnimationFrame(g)};return g(),()=>cancelAnimationFrame(r)},[e]),(0,w.useEffect)(()=>{d.current?.focus()},[]);let a=r=>{if(!i||!u)return s(null);let g=Math.hypot(r.clientX-i.x0,r.clientY-i.y0)>4,h={left:Math.min(i.x0,r.clientX),top:Math.min(i.y0,r.clientY),right:Math.max(i.x0,r.clientX),bottom:Math.max(i.y0,r.clientY)};s(null);let c=$t(u,h,!g);c.length>0&&n(c)},l=i?{left:Math.min(i.x0,i.x1),top:Math.min(i.y0,i.y1),width:Math.abs(i.x1-i.x0),height:Math.abs(i.y1-i.y0)}:null;return(0,p.jsxs)("div",{ref:d,tabIndex:-1,role:"application","aria-label":"Highlight the area to change: drag over it, or click one part","data-testid":"section-highlighter","data-graview-popover":"",onKeyDown:r=>{r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),o())},onMouseDown:r=>r.preventDefault(),onPointerDown:r=>{r.preventDefault(),r.currentTarget.setPointerCapture?.(r.pointerId),s({x0:r.clientX,y0:r.clientY,x1:r.clientX,y1:r.clientY})},onPointerMove:r=>s(g=>g&&{...g,x1:r.clientX,y1:r.clientY}),onPointerUp:a,onPointerCancel:()=>s(null),style:Lt,children:[(0,p.jsxs)("p",{style:It,children:["Drag over the part to change, or click one \xB7"," ",(0,p.jsx)("button",{type:"button",onPointerDown:r=>r.stopPropagation(),onClick:()=>n(t.elements),style:Ke,children:"The whole section"})," ","\xB7"," ",(0,p.jsx)("button",{type:"button",onPointerDown:r=>r.stopPropagation(),onClick:o,style:Ke,children:"Cancel"})]}),l?(0,p.jsx)("div",{"data-testid":"section-drag",style:{...Ot,left:l.left-(d.current?.getBoundingClientRect().left??0),top:l.top-(d.current?.getBoundingClientRect().top??0),width:l.width,height:l.height}}):null]})}var Pt={position:"fixed",zIndex:ee("popover"),boxSizing:"border-box",display:"grid",gap:10,padding:12,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float, var(--graview-panel))",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",maxHeight:"calc(100dvh - 24px)",overflowY:"auto",fontSize:"0.875rem"},Tt={margin:0,fontSize:"0.9375rem"},Y={margin:0,color:"var(--graview-ink-muted)"},Et={margin:0,color:"var(--graview-ink)",fontStyle:"italic"},z={display:"flex",flexWrap:"wrap",gap:8},Dt={boxSizing:"border-box",width:"100%",height:36,padding:"0 10px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8},Fe={minHeight:36,padding:"0 14px",font:"inherit",borderRadius:8,cursor:"pointer"},Ge={...Fe,color:"var(--graview-accent-ink, #fff)",background:"var(--graview-accent)",border:"1px solid var(--graview-accent)"},j={...Fe,color:"var(--graview-ink)",background:"transparent",border:"1px solid var(--graview-edge)"},Ke={font:"inherit",color:"inherit",background:"none",border:0,padding:0,textDecoration:"underline",cursor:"pointer"},G=12,Lt={userSelect:"none",WebkitUserSelect:"none",position:"fixed",zIndex:ee("popover"),boxSizing:"border-box",cursor:"crosshair",touchAction:"none",outline:"2px dashed var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 6%, transparent)"},It={position:"absolute",left:8,top:8,margin:0,padding:"4px 10px",borderRadius:999,fontSize:"0.8125rem",color:"var(--graview-ink)",background:"var(--graview-float, var(--graview-panel))",border:"1px solid var(--graview-edge)",boxShadow:"var(--graview-lift-low)",cursor:"default"},Ot={position:"absolute",border:"2px solid var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 14%, transparent)",borderRadius:4,pointerEvents:"none"};export{Mt as SectionCard,en as SectionDrawn,te as SectionOutline};
@@ -1 +0,0 @@
1
- import{G as l,N as p,U as k,W as y,c}from"./chunk.KV7GZBJ6.js";import"./chunk.5YNLFOBJ.js";import"./chunk.Q355UPFG.js";import{b as m}from"./chunk.HNMSYQRA.js";import"./chunk.44ZHHPPJ.js";import"./chunk.ZDUTEM3Z.js";import"./chunk.ARHAD5IS.js";import"./chunk.R2TSTDS3.js";import"./chunk.QSDBF7VL.js";import"./chunk.2PK335JQ.js";import"./chunk.MHTA4HYB.js";import"./chunk.BU5PVRX7.js";import"./chunk.3KUYB5ZT.js";import"./chunk.IMKD6QQG.js";import"./chunk.MB7LKKUD.js";import"./chunk.FXG5AJF6.js";import"./chunk.RFVOXX3P.js";import"./chunk.NKYYDFIX.js";import"./chunk.IR4OW67N.js";import"./chunk.6RZHKQP3.js";import"./chunk.N35SJWAM.js";import"./chunk.L7NJLZWV.js";import"./chunk.QO5RXOCS.js";import"./chunk.MIE4TJRW.js";import"./chunk.CXJJB3MK.js";import"./chunk.OJGHDWI6.js";import"./chunk.74B6KQF4.js";import"./chunk.WVUJXDXZ.js";import"./chunk.S2DOVJRL.js";import"./chunk.64FCAUAJ.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"./chunk.MD36ZSM5.js";import"./chunk.L6FGKJ5H.js";import{G as S,H as s,I as d,V as f,ea as g}from"./chunk.3CJLAJXP.js";import"./chunk.SDO3U72B.js";import"./chunk.J24YPQ5I.js";import"./chunk.FQLNBIQ5.js";import{b as n}from"./chunk.AJZBJBMO.js";var u=n(S(),1);var t=n(f(),1);function D({context:a}){let r=l(),h=g(),[w]=(0,u.useState)(()=>s(null)),o=d(h?.seatTalk??w),P=()=>{(window.history.state?.idx??0)>0?r(-1):r("/")};return(0,t.jsxs)(k,{context:a,"data-testid":"draft-page",children:[(0,t.jsx)(y,{context:a,...o.draft?{"data-testid":"draft-title"}:{},children:o.draft?o.draft.title:"Nothing drawn"}),o.draft?(0,t.jsx)(m,{page:!0,go:e=>r(e.address),onPick:e=>{let i=a.store.graph.getNode(e);i&&r(c(a.store.schema,i.kind,e))},onDiscard:P}):(0,t.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:["Ask for a way of seeing \u2014 \u201Ca board of tasks by status\u201D \u2014 and it is drawn here."," ",(0,t.jsx)(p,{to:"/",style:{color:"var(--graview-accent)"},children:"Home \u2192"})]})]})}export{D as DraftPage};
@@ -1 +0,0 @@
1
- import{a as B,b as ve}from"./chunk.NKYYDFIX.js";import{a as ye,c as he,d as be,f as we}from"./chunk.L7NJLZWV.js";import{b as S,c as fe,d as me,j as ce,k as ge}from"./chunk.DA4RSHLW.js";import{b as pe,k as q}from"./chunk.FOSY7MZF.js";import{b as de,e as ue}from"./chunk.NBVPWLRY.js";import{G as Re,V as se,ea as le,h as ae,u as ie}from"./chunk.3CJLAJXP.js";import{Ma as te,Xa as re,Ya as oe,ga as Z,la as ee,ta as ne}from"./chunk.J24YPQ5I.js";import{b as W}from"./chunk.AJZBJBMO.js";var l=W(Re(),1);var i=W(se(),1);function qe({affordance:n,onApply:a,onCancel:u,store:w}){let y=le(),s=w??y?.store,[x,_]=(0,l.useState)({}),[p,D]=(0,l.useState)(""),[I,F]=(0,l.useState)(G),[J,V]=(0,l.useState)(void 0),U=(0,l.useId)(),L=(0,l.useRef)(null),A=n.open.filter(e=>!(e.name in x)),o=A[0],v=s.allMutations().find(e=>e.name===n.mutation),P=(0,l.useMemo)(()=>De(v,s,n.args??{}),[v,s,n.args]),d=o?P[o.name]:void 0,E=ge(n.open.filter(e=>e.shape?.type==="date").map(e=>e.name)),Se=(()=>{if(!E||o?.name!==E.end||o.shape?.type!=="date")return;let e=x[E.start];if(typeof e!="string")return;let r=P[E.start];return ce(typeof r=="string"?r:void 0,e,typeof d=="string"?d:void 0,{time:o.shape.time===!0,instant:o.shape.instant===!0})})();(0,l.useEffect)(()=>{D(Se??ke(d,o?.shape)),F(Array.isArray(d)?d:G),V(d)},[o?.name]),(0,l.useEffect)(()=>{L.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[o?.name]),(0,l.useLayoutEffect)(()=>{let e=L.current,r=typeof document>"u"?null:document.activeElement,f=r instanceof HTMLElement&&r.getAttribute("data-affordance")===n.id;if(!e||r&&r!==document.body&&!e.contains(r)&&!f)return;let b=e.querySelector('[data-testid="ask-filter"], form input, [role=group] button:not([disabled])');b&&b!==r&&b.focus()},[o?.name]);let Y=ve({flow:"both",letters:!0});if(!o)return null;let h=e=>{let r=d!==void 0&&JSON.stringify(e)===JSON.stringify(d)?void 0:e,f={...x,[o.name]:r};if(n.open.filter(R=>!(R.name in f)).length===0){let R=a(Object.fromEntries(Object.entries(f).filter(([,M])=>M!==void 0)));R&&R.length>0&&_(Object.fromEntries(Object.entries(f).filter(([M])=>!R.includes(M))))}else _(f)},O=o.optional?(0,i.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=o.shape??{type:"unknown"},c=t.type==="number"?t.amount:void 0,g=Ee(o,t),m=q(s.schema,v,o.name),Q=te((v?.input?.shape??{})[o.name]),xe=oe((v?.input?.shape??{})[o.name]),N=re(o.name),Ae=typeof d=="boolean"?d?"yes":"no":d,[T,Oe]=(0,l.useState)(""),X=(0,l.useMemo)(()=>{let e=g.map(r=>s.graph.getNode(r)).filter(r=>r!==void 0);return pe(e,r=>s.schema.tryDefinition(r))},[g,s]),j=e=>{let r=Ce(s,t,e),f=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?m.option(e):r,b=X.get(e);return b?`${f} \xB7 ${b}`:f},$=(0,l.useMemo)(()=>{let e=T.trim().toLowerCase();return e===""?g:g.filter(r=>j(r).toLowerCase().includes(e))},[g,T,s,t,X]),k=t.type==="several",H=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,K=k&&g.length===0,C=o.kinds&&o.kinds.length>0&&!o.kinds.includes("*")?o.kinds.map(e=>Z(ne(s.schema.tryDefinition(e),e))).join(" or "):m.label,Ne=n.open.length>1?`${C} \xB7 ${n.open.length-A.length+1} of ${n.open.length}`:C;return(0,i.jsxs)("div",{ref:L,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||g.length>0?(0,i.jsx)("span",{id:U,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:Ne}):null,g.length>z?(0,i.jsx)("input",{type:"search",value:T,onChange:e=>Oe(e.target.value),placeholder:`Filter ${g.length}\u2026`,"aria-label":`Filter ${C}`,"data-testid":"ask-filter",onKeyDown:e=>{if(e.key!=="ArrowDown"||e.metaKey||e.ctrlKey||e.altKey)return;let r=Y.ref.current?.querySelector(`[${B}][tabindex="0"]`);r&&(e.preventDefault(),r.focus())},style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,xe?(0,i.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(J??(d===void 0?void 0:null))},children:[(0,i.jsx)(be,{value:J,onChange:V,start:N?x[N]??P[N]:void 0,label:`${N?q(s.schema,v,N).label:m.label} repeats`,name:o.name}),(0,i.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,i.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]}):Q?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(he,{relation:Q,value:d,onChange:h,label:m.label}),O]}):H?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ye,{as:"control",value:d,onChange:h,several:k,image:H.image===!0,video:H.video===!0,label:m.label}),O]}):g.length>0?(0,i.jsxs)("div",{...Y,role:"group","aria-labelledby":U,style:{display:"flex",flexWrap:"wrap",gap:4},children:[$.slice(0,z).map(e=>{let r=k?I.includes(e):e===Ae;return(0,i.jsx)("button",{type:"button",[B]:"","aria-label":`${C}: ${j(e)}`,...k?{"aria-pressed":r}:r?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...r?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>k?F(f=>f.includes(e)?f.filter(b=>b!==e):[...f,e]):h(t.type==="boolean"?e==="yes":e),children:j(e)},e)}),$.length>z?(0,i.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[$.length-z," more \u2014 type to narrow"]}):null,$.length===0?(0,i.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",g.length," match that."]}):null,k?(0,i.jsx)("button",{type:"button",disabled:I.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=I;F(G),h(e)},children:A.length>1?"Next":"Apply"}):null,O]}):(0,i.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),d!==void 0&&p===ke(d,t)){h(void 0);return}if(K){h(p.split(/[,\n]/).map(r=>r.trim()).filter(Boolean));return}if(p.trim().length!==0){if(c){let r=me(p,c);r!==void 0&&h(r);return}h(t.type==="number"?t.duration?ue(p)??p:Number(p):p)}},children:[t.type==="text"&&t.long?(0,i.jsx)("textarea",{autoFocus:!0,name:o.name,"aria-label":m.label,placeholder:m.label,value:p,rows:4,onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"?u():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):t.type==="date"?(0,i.jsx)(we,{autoFocus:!0,name:o.name,label:m.label,value:p===""?void 0:p,time:t.time===!0,instant:t.instant===!0,partial:t.partial===!0,onChange:e=>D(e??""),onCancel:u,boxStyle:{fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):(0,i.jsx)("input",{autoFocus:!0,type:t.type==="number"&&!t.duration&&!c?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...c?{inputMode:"decimal","data-graview-amount":c.format??"unit"}:{},name:o.name,"aria-label":m.label,placeholder:K?`${m.label}, separated by commas`:c?`${m.label}, ${S(c).hint} \u2014 ${S(c).prefix??""}${S(c).placeholder}${S(c).suffix?` ${S(c).suffix}`:""}`:m.label,value:p,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"&&u()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,i.jsx)("button",{type:"submit",disabled:!K&&p.trim().length===0,style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]})}var G=[];function De(n,a,u){let w=n?.derived?.act==="edit"&&n.subject?u[n.subject.arg]:void 0,y=typeof w=="string"?a.graph.getNode(w):void 0;return y?Object.fromEntries((n.writes??[]).filter(s=>y[s]!==void 0&&y[s]!==null).map(s=>[s,y[s]])):{}}function ke(n,a){return typeof n=="number"?a?.type==="number"&&a.amount?fe(n,a.amount):String(n):Array.isArray(n)?n.every(u=>typeof u=="string")?n.join(", "):"":typeof n!="string"?"":n}var z=10;function Ee(n,a){return n.candidates&&n.candidates.length>0?n.candidates:a.type==="choice"?a.options:a.type==="several"&&a.of.type==="choice"?a.of.options:a.type==="boolean"?$e:[]}var $e=["yes","no"];function Ce(n,a,u){return a.type==="boolean"||a.type==="choice"||a.type==="several"&&a.of.type==="choice"?u:ze(n,u)}function ze(n,a){let u=ae(a);if(u){let s=de(n.schema,n.graph.getNode(u.from)?.kind??"",u.kind,"out");return s.charAt(0).toUpperCase()+s.slice(1)}let w=ie(a);if(w.length>0)return w.map(s=>n.schema.tryDefinition(s)?.plural??`${s}s`).join(" + ");let y=n.graph.getNode(a);return y?ee(n.schema.tryDefinition(y.kind),y):a}export{qe as a,ze as b};
@@ -1,2 +0,0 @@
1
- import{a as Ie}from"./chunk.XTTESA7X.js";import{c as Oe,d as Be,f as Ge}from"./chunk.5M34BJIQ.js";import{e as Ce,f as Re,k as Fe,l as re,n as Me}from"./chunk.S2DOVJRL.js";import{d as z,e as Pe,k as ne}from"./chunk.FOSY7MZF.js";import{a as Ae,d as je}from"./chunk.NBVPWLRY.js";import{f as De}from"./chunk.ZMWAZACO.js";import{$c as be,C as Q,Fd as ve,L as de,Wd as ke,Xb as ge,Xc as ye,Zc as we,ea as ue,ee as xe,ga as U,ha as me,ka as H,kd as Z,la as T,ld as $e,ma as pe,na as ee,ne as Se,oa as fe,oc as te,pc as he,ra as _,ta as q}from"./chunk.J24YPQ5I.js";function Xe(t,e,n){let o=t.tryDefinition(e)?.fields.shape,r=Q(o?.[n]),a=!1,s=!1;for(;r&&(r.type==="optional"||r.type==="default"||r.type==="nullable"||r.type==="prefault");)(r.type==="optional"||r.type==="nullable")&&(a=!0),(r.type==="default"||r.type==="prefault")&&(s=!0),r=Q(r.innerType);if(r?.type!=="enum")return;let p=(r.entries?Object.values(r.entries):r.values??[]).filter(m=>typeof m=="string");return p.length>0?{values:p,empty:a&&!s}:void 0}function L(t,e,n){let o=Xe(t,e,n);if(!o)return[];let r=t.tryDefinition(e),a=o.values.map(s=>({value:s,label:Ae(r,n,s)}));return o.empty&&a.push({value:null,label:`No ${_(r,n).toLowerCase()}`}),a}function X(t,e,n){let o=t[e];return typeof o=="string"&&n.some(r=>r.value===o)?o:null}function se(t,e,n,o,r=L(t.schema,n.kind,o)){return Ve(t,e,n,o,r).flatMap(a=>a.move?[a.move]:[])}function Ve(t,e,n,o,r=L(t.schema,n.kind,o)){let a=Ne(t.schema,t.allMutations(),n.kind,o,r),s=X(n,o,r),p=q(t.schema.tryDefinition(n.kind),n.kind),m=[];for(let{value:A,label:C,by:R,acts:F}of a){if(A===s)continue;let x,I,V;for(let c of F){let w=R==="step"?{[c.subject.arg]:n.id}:{[c.subject.arg]:n.id,[o]:A},S={name:c.name,args:w};if(!c.input.safeParse(w).success){V??=`${c.title??c.name} asks for more than the ${p} itself.`;continue}let k=t.permits(S,e);if(!k.ok){I??=k.refusal?.message??`You may not ${c.title??c.name}.`;continue}try{ge(t.graph,c,w)}catch(f){I??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:c.title??c.name};break}m.push(x?{to:A,label:C,move:x}:{to:A,label:C,why:I??V??`Nothing in this app moves a ${p} to ${C}.`})}return m}function Ne(t,e,n,o,r=L(t,n,o)){let a=Ke(t,e,n,o),s=We(t,e,n,o);return r.flatMap(p=>{if(p.value===null)return[];let m=a.filter(A=>A.sets?.[o]===p.value);return[{value:p.value,label:p.label,by:m.length>0?"step":s.length>0?"value":"none",acts:m.length>0?m:s}]})}function Ke(t,e,n,o){return e.filter(r=>r.subject!==void 0&&r.derived===void 0&&typeof r.sets?.[o]=="string"&&te(t,r).includes(n))}function We(t,e,n,o){let r=t.tryDefinition(n);return r?e.filter(a=>{if(!a.subject||!te(t,a).includes(n)||!he(a,r).includes(o))return!1;let s=a.input.shape;return s!==void 0&&o in s}).sort((a,s)=>+(a.derived!==void 0)-+(s.derived!==void 0)):[]}var oe=(t,e)=>e&&t[e]!==void 0?String(t[e]):"";function Ye(t,e,n){let o=c=>t.tryDefinition(c)?e.nodesOfKind(c).filter(w=>H(t.tryDefinition(c),w)):[],r=o(n.rows),a=o(n.columns),s=new Set(r.map(c=>c.id)),p=new Set(a.map(c=>c.id)),m=e.allEdges(),A=[],C=n.link;if(typeof C=="string"){let c=f=>t.tryDefinition(f)?.edges?.[C]?.to,w=(c(n.columns)??[]).some(f=>f===n.rows||f==="*"),S=(c(n.rows)??[]).some(f=>f===n.columns||f==="*"),k=w||!S;for(let f of m){if(f.kind!==C)continue;let j=k?f.to:f.from,i=k?f.from:f.to;s.has(j)&&p.has(i)&&A.push({rowId:j,columnId:i,via:[]})}}else{let c=new Map(C.path.map(S=>[S,new Map]));for(let S of m){let k=c.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let j=k.get(S.to);j?j.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of C.path){let j=[],i=new Set;for(let v of k)for(let b of c.get(f).get(v.id)??[])i.has(`${v.id}|${b}`)||(i.add(`${v.id}|${b}`),j.push({id:b,via:[...v.via,v.id]}));k=j}for(let f of k){let j=`${f.id}|${S.id}`;!s.has(f.id)||w.has(j)||(w.add(j),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let R=n.groupOrder??[],F=c=>R.indexOf(c)===-1?R.length:R.indexOf(c),x=(c,w)=>w==="label"?T(t.tryDefinition(c.kind),c):c[w],I=Z(r,n.sort,x).map(c=>{let w=c;return{node:c,label:T(t.tryDefinition(c.kind),c),group:oe(w,n.rowGroup),ref:oe(w,n.rowRef)}}).sort((c,w)=>F(c.group)-F(w.group)||(n.sort!==void 0?0:c.ref<w.ref?-1:c.ref>w.ref?1:0)),V=Z(a,n.columnSort,x).map(c=>({node:c,label:T(t.tryDefinition(c.kind),c),group:oe(c,n.columnGroup)})).sort((c,w)=>c.group<w.group?-1:c.group>w.group?1:n.columnSort!==void 0?0:c.node.id<w.node.id?-1:c.node.id>w.node.id?1:0);return{rows:I,columns:V,cells:A}}function Te(t,e,n){let{rows:o,columns:r,cells:a}=Ye(t,e,n),s=(i,v)=>ee(t,i,v),p=i=>ee(t,i,1).replace(/^1 /,""),m=i=>({id:i.id,kind:i.kind,title:T(t.tryDefinition(i.kind),i),parts:[]}),A=i=>{let v=e.getNode(i);if(!v)return null;let b=t.tryDefinition(v.kind),P=T(b,v),N=z(v,b,{limit:3,said:[P],glance:!0}).map(K=>K.alone.startsWith(K.label)?`${K.label.toLowerCase()}${K.alone.slice(K.label.length)}`:K.alone);return[P,...N].join(", ")},C=typeof n.link=="string"?[]:n.link.path.slice(0,-1).flatMap((i,v,b)=>{let P=ve(t,n.columns,b.slice(0,v+1));return P.ok?[...P.reached]:[]}),R=$e(t,n,{rows:o.length,columns:r.length,cells:a.length});if(R)return[{t:"text",text:`${s(n.rows,o.length)} against ${s(n.columns,r.length)}.`},{t:"text",text:R}];let F=[{t:"text",text:`${s(n.rows,o.length)} against ${s(n.columns,r.length)}${C.length>0?`, through ${[...new Set(C)].map(i=>s(i,2).replace(/^2 /,"")).join(" and ")}`:""}${r.length>0?`: ${r.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(r.map(i=>[i.node.id,i.label])),I=new Map(r.map((i,v)=>[i.node.id,v])),V=new Map,c=new Map;for(let i of a){let v=V.get(i.rowId);v?v.push(i):V.set(i.rowId,[i]);let b=c.get(i.columnId);b?b.add(i.rowId):c.set(i.columnId,new Set([i.rowId]))}for(let i of o){let b=[...V.get(i.node.id)??[]].sort((P,N)=>I.get(P.columnId)-I.get(N.columnId)).map(P=>{let N=P.via.map(A).filter(K=>K!==null);return`${x.get(P.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});F.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}F.push({t:"list",as:"name",columns:1,groups:r.map(i=>{let v=c.get(i.node.id)??new Set,b=o.filter(P=>v.has(P.node.id)).map(P=>m(P.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=o.filter(i=>!w.has(i.node.id)),f=r.filter(i=>!S.has(i.node.id)),j=n.rows===n.columns;return k.length>0&&F.push({t:"text",text:`${j?`${k.length} with none across`:`${s(n.rows,k.length)} with no ${p(n.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&F.push({t:"text",text:`${j?`${f.length} with none down`:`${s(n.columns,f.length)} on no ${p(n.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),F}function ie(t,e,n,o={}){let{app:r,blocks:a=n?r?.viewSpecs?.[n.kind]?.[o.slot??"page"]:r?.home}=o;if(!a?.length)return[];let s=o.firstHeading??(n||o.blocks?void 0:1),p=Me(t,e,n,{...o,money:o.money??r?.brand,firstHeading:s});return n&&!p.node?[]:Re(typeof a[0]?.t=="string"?a:Ce(a),p)}function Y(t,e,n){let o=!(e.optional||e.control==="boolean"),r=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(s=>U(q(t.tryDefinition(s),s))).join(" or "):n(e.name).label,a={name:e.name,label:r,required:o};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(s=>n(e.name).option(s))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(t,e.item,n).input}`};case"group":return{...a,input:"group",fields:e.fields.map(s=>Y(t,s,n))};case"variant":return{...a,input:"one of",choices:e.options.map(s=>me(s.value))};default:return{...a,input:"answer"}}}function He(t,e,n){let o=Be(t,e,n),r=t.schema,a=Oe(r,n).filter(p=>p.name!==n.subject?.arg&&!o.has(p.name)),s=pe(n);return{act:n.name,title:s,submit:s,fields:a.map(p=>Y(r,p,m=>ne(r,n,m)))}}function Le(t,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(n=>Y(t,n,o=>ne(t,e.act,o)))}}function Ee(t,e,n){return t.permittedMutations(e).filter(o=>!o.derived&&!o.subject&&(o.creates??[]).includes(n))}function Ze(t,e=""){let n=[`${e}Form "${t.title}" (${t.visitor?`the visitor form ${t.visitor}, running `:""}act ${t.act}), button "${t.submit}":`],o=(r,a)=>{for(let s of r){let p=s.choices?`${s.input}: ${s.choices.join(", ")}`:s.kinds?`${s.input} (${s.kinds.join(" or ")})`:s.input,m=s.min!==void 0||s.max!==void 0?`, ${s.min??"\u2026"} to ${s.max??"\u2026"}`:"";n.push(`${a}- ${s.label}${s.required?" *":""} (${s.name}) \u2014 ${p}${m}`),s.fields&&o(s.fields,`${a} `)}};return o(t.fields,`${e} `),t.fields.length===0&&n.push(`${e} (asks nothing)`),n}function Ue(t,e){let n=t.viewSpecs??{};return e.filter(o=>o.cardinality==="one"&&o.replaces==="page"&&(n[o.attach]?.page?.length??0)>0).map(o=>{let r=E(t.schema,o.attach,1);return{at:`views.${o.attach}.page`,says:`The view "${o.name}" replaces ${Je(r)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Je=t=>`${/^[aeiou]/i.test(t)?"an":"a"} ${t}`,Qe=240,ze=10,et=1160,tt=40,_e=640,nt=3,rt=t=>Math.max(1,Math.floor((Math.min(t,et)-tt+ze)/(Qe+ze)));function st(t,e,n,o){let{app:r}=o,a=o.width??1440,s=o.today??t.today()??de(r.brand?.timeZone),p=t.seenBy(e),m=p.schema,A=p.graph,C=Ie(r,o.views?{views:o.views}:{}),R=typeof n=="string"?n.trim():n.slug,F=typeof n=="string"?C.find(l=>l.slug===R||l.title===R||l.address===R):C.find(l=>l.slug===n.slug&&l.kind===n.kind)??n,x=!F&&typeof n=="string"?A.getNode(R):void 0,I=!F&&!x?/^\/?forms\/(.+)$/.exec(R)?.[1]:void 0,V=I!==void 0?Ge(r,I):void 0;if(V)return{ok:!0,description:ot(m,V,a)};if(!F&&!x)return{ok:!1,error:`"${R}" is not a place this app has, nor a record this seat can see.`,places:[...C.map(l=>l.slug),...Object.keys(r.forms??{}).map(l=>`forms/${l}`)]};let c=[],w=r.viewSpecs??{},S=rt(a),k=(l,h)=>ie(p,null,l,{app:r,today:s,...h}),f=(l,h,M)=>{let d=m.tryDefinition(l.kind),g=T(d,l);if(h==="name")return{id:l.id,kind:l.kind,title:g,parts:[]};if(w[l.kind]?.[h]){let G=k(l,{slot:h}),[B,...O]=G,y=B?.t==="title"||h==="row"&&B?.t==="headline";return{id:l.id,kind:l.kind,title:y?B.text:g,parts:j(y?O:G,M,`views.${l.kind}.${h}`,` (${l.id})`,y?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:g,parts:[]};let u=d?.computed?re(m,A,l):l,W=z(u,d,{limit:3,said:[g],glance:!0,locale:r.brand?.locale,timeZone:r.brand?.timeZone});return{id:l.id,kind:l.kind,title:g,parts:W.map(G=>({t:"text",text:G.alone}))}};function j(l,h,M,d="",g=0){let $=[];return l.forEach((u,W)=>{let G=`${M}.${W+g}`;switch("problem"in u&&u.problem&&c.push({at:`${G}${d}`,says:u.problem}),u.t){case"title":$.push({t:"heading",level:3,text:u.text});return;case"text":$.push({t:"text",text:u.markdown?je(u.text):u.runs?lt(u.runs):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":$.push({t:"badge",text:u.text});return;case"field":case"image":$.push({t:"field",label:u.label,text:u.text});return;case"progress":$.push({t:"progress",label:u.label,text:u.text});return;case"group":$.push(...j(u.blocks,h,`${G}.group`,d));return;case"when":$.push(...j(u.blocks,h,`${G}.show`,d));return;case"divider":case"figure":return;case"headline":$.push({t:"heading",level:u.level,text:u.text});return;case"number":$.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){$.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&$.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let B=h+1,O=B>nt?"name":u.as,y=(u.groups??[{value:null,members:u.members}]).map(D=>({..."heading"in D&&D.heading?{heading:D.heading,count:(u.everyGroup?.find(J=>J.value===D.value)??D).members.length}:{},items:D.members.map(J=>f(J,O,B))}));$.push({t:"list",as:O,columns:O==="card"?S:1,groups:y,...u.more>0?{more:u.more}:{}});return}}}),$}let i=[],v,b,P,N=[];if(x){b="record";let l=m.tryDefinition(x.kind),h=T(l,x);P={slug:x.id,title:h,kind:x.kind,address:ke(m,x.kind,x.id)};let M=w[x.kind]?.page,d=o.views?.find(g=>g.attach===x.kind&&g.cardinality==="one");if(d&&i.push({t:"view",name:d.name,...d.title?{title:d.title}:{},...d.replaces==="page"?{replaces:!0}:{},...d.parts?{parts:d.parts}:{}}),d?.replaces==="page")b=`view:${d.name}`,c.push(...Ue(r,[d]));else{M&&i.push(...j(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let g=l?.computed?re(m,A,x):x;for(let $ of Pe(l,z(g,l,{said:[h],locale:r.brand?.locale,timeZone:r.brand?.timeZone}))){$.title&&i.push({t:"heading",level:2,text:$.title});for(let u of $.fields)i.push({t:"field",label:u.label,text:u.value,...u.long?{long:!0}:{},...u.markdown?{markdown:!0}:{}})}}}else{let l=F;P={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?xe(r).drawn.find(d=>d.as===l.slug&&(l.kind===null||d.kinds.includes(l.kind))):void 0,M=l.kind!==null&&l.view===void 0&&!h?o.views?.find(d=>d.attach===l.kind&&d.cardinality==="many"&&d.replaces==="page"&&!d.hidden):void 0;if(l.kind!==null&&h?.create!==!1&&l.view===void 0&&!M&&(N=Ee(t,e,l.kind).map(d=>He(t,e,d))),l.view!==void 0&&!h){let d=o.views?.find(g=>g.name===l.view);b=`view:${l.view}`,i.push({t:"view",name:l.view,title:d?.title??l.title,...typeof d?.flows=="boolean"?{flows:d.flows}:{},...d?.parts?{parts:d.parts}:{}})}else if(l.kind===null){let d=r.brand,g=d?.name??r.name,$=be(d)?.light,u=$&&we($)?$:void 0;if(v={name:g,...d?.subtitle&&d.subtitleDrawn!==!1?{subtitle:d.subtitle}:{},...u?{logo:{alt:d?.logoAlt??g,...ye(u)?{drawn:"inline SVG"}:{drawn:"image",src:u}}}:{}},r.home)b="blocks",i=j(k(null,{}),0,"views.home");else{b="derived";let W=t.kindsKeptFrom(e),G=new Set([...r.pages?.hide??[],...W,...t.modules.disabledKinds]),B=Se(m.kinds,r.pages?.order).filter(O=>!G.has(O));i.push({t:"heading",level:1,text:r.name??"Home"});for(let O of B){let y=A.nodesOfKind(O).filter(D=>H(m.tryDefinition(O),D)).length;y>0&&i.push({t:"text",text:`${y} ${E(m,O,y)}`})}}}else if(h?.lens==="blocks")b="lens:blocks",i=j(k(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){b="lens:columns";let d=h.options.bindings??{};for(let g of Object.keys(d)){let $=d[g]?.column;if(!$)continue;let u=L(m,g,$),W=Z(A.nodesOfKind(g).filter(y=>H(m.tryDefinition(g),y)),h.options.sort,(y,D)=>D==="label"?T(m.tryDefinition(y.kind),y):y[D]);Object.keys(d).length>1&&i.push({t:"heading",level:2,text:E(m,g,2).replace(/^./,y=>y.toUpperCase())}),i.push({t:"text",text:`${W.length} ${E(m,g,W.length)} in columns by ${_(m.tryDefinition(g),$).toLowerCase()}.`});let G=u.map(y=>({column:y,items:W.filter(D=>X(D,$,u)===y.value).map(D=>f(D,"card",1))})).filter(({column:y,items:D})=>y.value!==null||D.length>0).map(({column:y,items:D})=>({heading:`${y.label} (${D.length})`,items:D}));i.push({t:"list",as:"card",columns:1,groups:G});let B=new Map;for(let y of W)for(let D of se(t,e,y,$,u))B.set(D.to,(B.get(D.to)??new Set).add(`"${D.title}"`));let O=u.filter(y=>y.value!==null&&B.has(y.value)).map(y=>`to ${y.label} by ${[...B.get(y.value)].join(" or ")}`);i.push({t:"text",text:O.length>0?`Moves: ${O.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")b="lens:coverage",i=Te(m,A,h.options);else if(h){b=`lens:${h.lens}`;let d=h.kinds.flatMap(g=>A.nodesOfKind(g).filter($=>H(m.tryDefinition(g),$)));i.push({t:"text",text:`A ${h.lens} of ${d.length} ${h.kinds.map(g=>E(m,g,d.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:d.map(g=>f(g,"name",1))}]})}else if(M)b=`view:${M.name}`,i.push({t:"heading",level:1,text:l.title}),i.push({t:"view",name:M.name,...M.title?{title:M.title}:{},replaces:!0,...M.parts?{parts:M.parts}:{}});else{b="derived";let d=A.nodesOfKind(l.kind).filter(g=>H(m.tryDefinition(l.kind),g));i.push({t:"heading",level:1,text:l.title}),d.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${E(m,l.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:d.map(g=>f(g,"row",1))}]})}}let K=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=P.kind===null?it(m,A):[],ce={...v?{masthead:v}:{},...le.length>0?{facts:le}:{},place:P,seat:K,width:a,variant:qe,drawnBy:b,parts:i,...N.length>0?{forms:N}:{},problems:c};return{ok:!0,description:{...ce,text:ae(ce)}}}function ot(t,e,n){let o=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],r={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:n,variant:n<_e?"phone":"wide",drawnBy:"form",parts:o,forms:[Le(t,e)],problems:[]};return{...r,text:ae(r)}}function it(t,e){let n=Fe(t,e,null),o=r=>Array.isArray(r)?r.map(o).join(", "):r===null?"nothing":typeof r=="boolean"?r?"yes":"no":typeof r=="object"?r.label:String(r);return[...De(t)].map(([r,a])=>{let s=a.label??U(r);return Object.hasOwn(n.values,r)?{name:r,label:s,value:o(n.values[r])}:{name:r,label:s,refused:n.refused[r]??"it could not be worked out"}})}function E(t,e,n){let o=t.tryDefinition(e);if(n===1)return o?.noun??e;let r=fe(t,e);return ue(r)}function ae(t){let e=[`${t.place.title} (${t.place.address}) \u2014 as ${t.seat}, ${t.width} wide (${t.variant}).`],n=t.masthead;n&&e.push(`Masthead: ${n.logo?`the logo ("${n.logo.alt}", ${n.logo.drawn==="image"?n.logo.src:"inline SVG"}), `:""}${n.name}${n.subtitle?` \u2014 ${n.subtitle}`:""}`);let o=(r,a)=>{for(let s of r)switch(s.t){case"heading":e.push(`${a}${"#".repeat(s.level)} ${s.text}`);break;case"text":e.push(`${a}${s.text}`);break;case"badge":e.push(`${a}[${s.text}]`);break;case"field":case"progress":e.push(`${a}${s.label}: ${s.text}`);break;case"figure":e.push(`${a}${s.text}${s.label?` \u2014 ${s.label}`:""}`);break;case"list":if(s.groups.length===0){s.empty&&e.push(`${a}(${s.empty})`);break}for(let p of s.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let m of p.items)e.push(`${a}${p.heading?" ":""}- ${m.title}`),o(m.parts,`${a}${p.heading?" ":" "}`)}s.as==="card"&&s.columns>1&&e.push(`${a}(cards, ${s.columns} across)`),s.more&&e.push(`${a}and ${s.more} more`);break;case"view":e.push(`${a}[the view "${s.title??s.name}"${s.replaces?", in place of the page":""}${s.flows===!0?", flowing with the page":s.flows===!1?", in a frame of its own":""}]`),s.parts&&o(s.parts,`${a} `);break}};o(t.parts,"");for(let r of t.forms??[])e.push(...Ze(r));if(t.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let r of t.facts)e.push(`- ${r.label} (${r.name}): ${r.value??`not worked out \u2014 ${r.refused}`}`)}if(t.videos&&t.videos.length>0){e.push("Videos:");for(let r of t.videos)e.push(`- ${at(r)}`)}if(t.problems.length>0){e.push("Problems:");for(let r of t.problems)e.push(`- ${r.at}: ${r.says}`)}return e.join(`
2
- `)}function at(t){let e=t.autoplay?"plays as a background, muted and looping, with no controls":"plays with the browser's controls";return`${t.text} (${t.field} of ${t.record}): ${t.source}${t.duration!==void 0?`, ${Math.round(t.duration)} s`:""}, ${t.poster?"with a poster":"no poster"}; ${e}${t.cover?", filling its box":""}; ${t.playable?"playable":`not playable: ${t.why??"it is not a video a browser plays"}`}.`}function lt(t){return t.map((e,n)=>(n===0?"":e.field===void 0&&t[n-1].field===void 0?" \xB7 ":" ")+e.text).join("")}export{L as a,X as b,se as c,Ve as d,Ne as e,Ke as f,We as g,ie as h,Ue as i,st as j,ae as k};