graview 0.1.69 → 0.1.71

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 (247) hide show
  1. package/dist/preview/chunk.23DATB5Y.js +1 -0
  2. package/dist/preview/chunk.2INDKSJI.js +1 -0
  3. package/dist/preview/chunk.3CLTABGP.js +1 -0
  4. package/dist/preview/chunk.3RRK6UTN.js +8 -0
  5. package/dist/preview/chunk.45HUV56Z.js +1 -0
  6. package/dist/preview/chunk.4HU2ILFY.js +1 -0
  7. package/dist/preview/{chunk.3VNOTHA5.js → chunk.4LWWXIM4.js} +1 -1
  8. package/dist/preview/chunk.4O64QV2Y.js +1 -0
  9. package/dist/preview/{chunk.PJL3I2IW.js → chunk.4QMAYVPU.js} +1 -1
  10. package/dist/preview/chunk.4UDST6IF.js +1 -0
  11. package/dist/preview/{chunk.6BNSDPZE.js → chunk.4YZ2A6SJ.js} +3 -3
  12. package/dist/preview/{chunk.523EFGHU.js → chunk.4ZEHLUXV.js} +1 -1
  13. package/dist/preview/{chunk.F4CDJBDS.js → chunk.5EQRIZ6I.js} +1 -1
  14. package/dist/preview/chunk.5OS4SYHE.js +1 -0
  15. package/dist/preview/{chunk.BO32A3W5.js → chunk.5PQV7GFE.js} +1 -1
  16. package/dist/preview/{chunk.PZ3KM3TY.js → chunk.5WCSQFS5.js} +1 -1
  17. package/dist/preview/{chunk.HU3KEWFO.js → chunk.64K5ELSQ.js} +1 -1
  18. package/dist/preview/{chunk.MKN7ADJB.js → chunk.67S2UWBT.js} +1 -1
  19. package/dist/preview/chunk.6A3KTD66.js +1 -0
  20. package/dist/preview/chunk.6BBUTKFC.js +23 -0
  21. package/dist/preview/chunk.6IMRCKB4.js +1 -0
  22. package/dist/preview/chunk.6L6RUOSF.js +5 -0
  23. package/dist/preview/{chunk.MH3AQO2R.js → chunk.6TBQV3NO.js} +1 -1
  24. package/dist/preview/chunk.6ZRVVRDQ.js +1 -0
  25. package/dist/preview/{chunk.YZKHTBTC.js → chunk.7FI75ZVE.js} +1 -1
  26. package/dist/preview/{chunk.IO5VFTXC.js → chunk.7KX36ENH.js} +1 -1
  27. package/dist/preview/chunk.7LPHWJB4.js +3 -0
  28. package/dist/preview/chunk.7MDGPTYF.js +1 -0
  29. package/dist/preview/{chunk.I4H2GS4O.js → chunk.7PWLRRUS.js} +2 -2
  30. package/dist/preview/{chunk.7T2P42VW.js → chunk.7TACFS7Q.js} +1 -1
  31. package/dist/preview/{chunk.KLEKC4ZX.js → chunk.7THS3DLZ.js} +1 -1
  32. package/dist/preview/{chunk.CSVDBDRZ.js → chunk.7XGU6KVF.js} +2 -2
  33. package/dist/preview/chunk.7ZLCA3WK.js +1 -0
  34. package/dist/preview/{chunk.RRCPEHM4.js → chunk.AIFT2HNP.js} +1 -1
  35. package/dist/preview/{chunk.LMZ2WMGH.js → chunk.ARGEGV5T.js} +1 -1
  36. package/dist/preview/{chunk.4FJ4OPSJ.js → chunk.BSWR5SGX.js} +1 -1
  37. package/dist/preview/{chunk.RNAL35ID.js → chunk.BWMPC7LK.js} +1 -1
  38. package/dist/preview/{chunk.KW7PHJYX.js → chunk.CEJIH3CN.js} +1 -1
  39. package/dist/preview/chunk.CEOQY5KS.js +5 -0
  40. package/dist/preview/{chunk.G43YUGNW.js → chunk.CGRX6SDE.js} +1 -1
  41. package/dist/preview/chunk.CPK6CYKN.js +111 -0
  42. package/dist/preview/{chunk.AZRICZKT.js → chunk.CVN2XFMF.js} +1 -1
  43. package/dist/preview/chunk.D4F6QX5L.js +1 -0
  44. package/dist/preview/{chunk.JPAE6K4E.js → chunk.D6ODKMOV.js} +1 -1
  45. package/dist/preview/{chunk.CCCONK73.js → chunk.DDSAFU3B.js} +1 -1
  46. package/dist/preview/{chunk.AHYMIVBX.js → chunk.DG3YNOH3.js} +1 -1
  47. package/dist/preview/chunk.DGYWNM5U.js +1 -0
  48. package/dist/preview/{chunk.ML5EHDZG.js → chunk.DHO3QZYK.js} +1 -1
  49. package/dist/preview/{chunk.EL7XXGQY.js → chunk.DJGZOPAS.js} +1 -1
  50. package/dist/preview/chunk.DOJCYXIJ.js +1 -0
  51. package/dist/preview/{chunk.CKSRW3LA.js → chunk.DX7RGK5G.js} +1 -1
  52. package/dist/preview/{chunk.QK7EUIPL.js → chunk.EA2KYBBR.js} +1 -1
  53. package/dist/preview/chunk.EEGVI266.js +1 -0
  54. package/dist/preview/{chunk.I7OFRF6N.js → chunk.EHLV3LND.js} +2 -2
  55. package/dist/preview/{chunk.QEBD7SC4.js → chunk.EJC7ACZT.js} +4 -2
  56. package/dist/preview/{chunk.QRNKGPAD.js → chunk.EJIQDMLU.js} +1 -1
  57. package/dist/preview/chunk.EOSN5DWW.js +1 -0
  58. package/dist/preview/{chunk.4RPKCW4J.js → chunk.EPSYX2SF.js} +1 -1
  59. package/dist/preview/chunk.EUXAIG73.js +1 -0
  60. package/dist/preview/chunk.EZQK23AB.js +1 -0
  61. package/dist/preview/{chunk.KKFKSJUN.js → chunk.F5O3HR7X.js} +1 -1
  62. package/dist/preview/chunk.F6MY6WJ4.js +1 -0
  63. package/dist/preview/{chunk.GTF6EMVE.js → chunk.F7KVEWFH.js} +1 -1
  64. package/dist/preview/{chunk.EEUCRZA3.js → chunk.FIUPDGUZ.js} +1 -1
  65. package/dist/preview/chunk.FNSVGSZI.js +1 -0
  66. package/dist/preview/chunk.FOHZPYUV.js +1 -0
  67. package/dist/preview/chunk.FW6M6GIU.js +32 -0
  68. package/dist/preview/{chunk.VXPEXUQF.js → chunk.G5AF5IXL.js} +1 -1
  69. package/dist/preview/chunk.G767NLBH.js +1 -0
  70. package/dist/preview/chunk.GFBE4VNT.js +1 -0
  71. package/dist/preview/{chunk.CDSHUWSK.js → chunk.GFOZVQBQ.js} +1 -1
  72. package/dist/preview/chunk.GKYJQE5A.js +1 -0
  73. package/dist/preview/chunk.GOVRX2YX.js +4 -0
  74. package/dist/preview/{chunk.T3PELB6I.js → chunk.H33XWGAY.js} +1 -1
  75. package/dist/preview/{chunk.2AL26ZPJ.js → chunk.H4BPTMED.js} +1 -1
  76. package/dist/preview/chunk.HLKDYI6J.js +1 -0
  77. package/dist/preview/{chunk.VEQIH7HR.js → chunk.HPFEYMGP.js} +1 -1
  78. package/dist/preview/chunk.HT35PAHI.js +21 -0
  79. package/dist/preview/{chunk.VR553M6J.js → chunk.HXRHEPPJ.js} +1 -1
  80. package/dist/preview/chunk.IPKODEOZ.js +1 -0
  81. package/dist/preview/{chunk.EP7YT7LT.js → chunk.IXYG65TM.js} +1 -1
  82. package/dist/preview/chunk.IZDB777E.js +1 -0
  83. package/dist/preview/{chunk.VBBH5R5T.js → chunk.JAPTTM6Y.js} +1 -1
  84. package/dist/preview/chunk.JCKIJSW7.js +25 -0
  85. package/dist/preview/{chunk.4R7H3GIL.js → chunk.JLNTE5CH.js} +2 -2
  86. package/dist/preview/chunk.JNK5WBSU.js +1 -0
  87. package/dist/preview/chunk.JREA2XDG.js +1 -0
  88. package/dist/preview/{chunk.WV6SP6IJ.js → chunk.KBJ3UUER.js} +1 -1
  89. package/dist/preview/{chunk.VBHV4TLG.js → chunk.KHRS2SKB.js} +1 -1
  90. package/dist/preview/{chunk.ISZFRLNJ.js → chunk.KJPLX72N.js} +1 -1
  91. package/dist/preview/chunk.KZUHXOZU.js +21 -0
  92. package/dist/preview/{chunk.6ZFYFT5A.js → chunk.L3MLGFIS.js} +1 -1
  93. package/dist/preview/{chunk.KEGL6NBD.js → chunk.L6P55HFW.js} +1 -1
  94. package/dist/preview/{chunk.N7A3T5QU.js → chunk.LDWWUKKX.js} +1 -1
  95. package/dist/preview/{chunk.CA2SYEYE.js → chunk.LHCGC3K6.js} +1 -1
  96. package/dist/preview/{chunk.BQORHDAH.js → chunk.LNKY6MT4.js} +1 -1
  97. package/dist/preview/chunk.LQ5J6YQW.js +1 -0
  98. package/dist/preview/{chunk.47VEV4BX.js → chunk.MEAUTBVM.js} +1 -1
  99. package/dist/preview/chunk.MEBKTW7H.js +17 -0
  100. package/dist/preview/{chunk.WQ7K5O2I.js → chunk.MFMC35ET.js} +1 -1
  101. package/dist/preview/chunk.MJ4T6YXI.js +1 -0
  102. package/dist/preview/chunk.MKJV3BM5.js +240 -0
  103. package/dist/preview/chunk.ML4X7VVK.js +1 -0
  104. package/dist/preview/chunk.MM7MLBGB.js +1 -0
  105. package/dist/preview/{chunk.5MOXQUZH.js → chunk.MQNW3O67.js} +1 -1
  106. package/dist/preview/{chunk.J2N7EKMX.js → chunk.MT252WP4.js} +1 -1
  107. package/dist/preview/chunk.MWWNKM3I.js +1 -0
  108. package/dist/preview/chunk.N3MXLORL.js +3 -0
  109. package/dist/preview/chunk.NH3VXTGX.js +1 -0
  110. package/dist/preview/{chunk.B422DSYN.js → chunk.NI4OPHTL.js} +1 -1
  111. package/dist/preview/chunk.NNGG7RCO.js +1 -0
  112. package/dist/preview/{chunk.LKM2R5UF.js → chunk.NXHEOHRR.js} +1 -1
  113. package/dist/preview/{chunk.TQQDUJLX.js → chunk.O5RPSUXV.js} +1 -1
  114. package/dist/preview/{chunk.FE3SINPK.js → chunk.OKHXXIMN.js} +1 -1
  115. package/dist/preview/chunk.ONAH6MC4.js +1 -0
  116. package/dist/preview/chunk.OOQG2AEF.js +1 -0
  117. package/dist/preview/{chunk.ZQYHNFRZ.js → chunk.OPMGQS5J.js} +1 -1
  118. package/dist/preview/{chunk.UHJSZ2XZ.js → chunk.OUF2QFZL.js} +1 -1
  119. package/dist/preview/{chunk.CUEIGKFG.js → chunk.OVSKPBPS.js} +1 -1
  120. package/dist/preview/chunk.OYMN3IFX.js +1 -0
  121. package/dist/preview/{chunk.QNC2OKLF.js → chunk.P43LPXXJ.js} +1 -1
  122. package/dist/preview/chunk.PGT4ZQDG.js +4 -0
  123. package/dist/preview/{chunk.WFJCC6G3.js → chunk.PQTXM4VY.js} +1 -1
  124. package/dist/preview/{chunk.KHKCTVHD.js → chunk.Q6GEPVQ7.js} +1 -1
  125. package/dist/preview/chunk.QDDDKEBH.js +1 -0
  126. package/dist/preview/{chunk.26RYER7Y.js → chunk.QJJWAYHB.js} +1 -1
  127. package/dist/preview/chunk.QK4QZVQG.js +1 -0
  128. package/dist/preview/{chunk.CLIC2QBA.js → chunk.QKRQPUCE.js} +1 -1
  129. package/dist/preview/{chunk.DU76ASS4.js → chunk.QNWGDG2Z.js} +2 -2
  130. package/dist/preview/{chunk.447RWLS7.js → chunk.QVBP4UZG.js} +2 -2
  131. package/dist/preview/chunk.RDUGUC7R.js +1 -0
  132. package/dist/preview/{chunk.EK3JXEZL.js → chunk.RHIP2UYE.js} +1 -1
  133. package/dist/preview/chunk.RJ7VSWTA.js +87 -0
  134. package/dist/preview/{chunk.JHAMSDAI.js → chunk.RO3D2RNP.js} +1 -1
  135. package/dist/preview/{chunk.C6CT6F4C.js → chunk.S2BMI23H.js} +1 -1
  136. package/dist/preview/{chunk.ZRBGYXAO.js → chunk.SGYZM6ZU.js} +1 -1
  137. package/dist/preview/{chunk.UPOYRCKI.js → chunk.SPJ34VHA.js} +1 -1
  138. package/dist/preview/{chunk.UAEOCWSG.js → chunk.T6KOL7TW.js} +1 -1
  139. package/dist/preview/{chunk.AUNQNTKY.js → chunk.T6UJEXFL.js} +3 -2
  140. package/dist/preview/chunk.TBEKEHFS.js +1 -0
  141. package/dist/preview/chunk.TO3ZKCA2.js +1 -0
  142. package/dist/preview/{chunk.FIY4RUK5.js → chunk.TQ3MNB6K.js} +1 -1
  143. package/dist/preview/{chunk.GG47EIKO.js → chunk.TRP66PHK.js} +1 -1
  144. package/dist/preview/{chunk.LGNGFG5V.js → chunk.TSZ2S3VG.js} +1 -1
  145. package/dist/preview/chunk.TTM5GQ2U.js +1 -0
  146. package/dist/preview/chunk.TUBY6SV3.js +1 -0
  147. package/dist/preview/{chunk.ZE5RSKXF.js → chunk.U5KJQFAP.js} +1 -1
  148. package/dist/preview/chunk.U6V4KZF5.js +1 -0
  149. package/dist/preview/chunk.UJ7RTNT4.js +1 -0
  150. package/dist/preview/{chunk.HCX6KPRF.js → chunk.UQZ2P6KD.js} +1 -1
  151. package/dist/preview/{chunk.CLZYNFFH.js → chunk.UZKBFI52.js} +1 -1
  152. package/dist/preview/{chunk.66TRDXYR.js → chunk.V5JB5UJS.js} +2 -2
  153. package/dist/preview/{chunk.3TKIZGC7.js → chunk.VDFQFLTU.js} +1 -1
  154. package/dist/preview/{chunk.IY3DV52G.js → chunk.VGYG2IBZ.js} +1 -1
  155. package/dist/preview/chunk.VICBF3MQ.js +2 -0
  156. package/dist/preview/{chunk.EQZPEOIW.js → chunk.VL3YDD7D.js} +1 -1
  157. package/dist/preview/{chunk.IYHY4VEC.js → chunk.VPFUOTY7.js} +1 -1
  158. package/dist/preview/chunk.VUDNQOOX.js +1 -0
  159. package/dist/preview/{chunk.P26ATAAI.js → chunk.VVIQSFM4.js} +1 -1
  160. package/dist/preview/{chunk.DO3FQM6R.js → chunk.W332P5T3.js} +6 -6
  161. package/dist/preview/{chunk.POKGLN4T.js → chunk.W3TJF4EH.js} +1 -1
  162. package/dist/preview/{chunk.D5JZQZ74.js → chunk.W5O5F4FT.js} +1 -1
  163. package/dist/preview/chunk.W6L2VAJG.js +2 -0
  164. package/dist/preview/{chunk.O7NYSO6F.js → chunk.WGH2P2YL.js} +1 -1
  165. package/dist/preview/{chunk.OD5QZHRC.js → chunk.WS5ORRGS.js} +1 -1
  166. package/dist/preview/{chunk.VQDL4EEP.js → chunk.WU6D3SPL.js} +1 -1
  167. package/dist/preview/{chunk.MV27WMNW.js → chunk.X2UYEA7H.js} +1 -1
  168. package/dist/preview/chunk.X45EITTK.js +18 -0
  169. package/dist/preview/{chunk.TAJBXG5U.js → chunk.X7U3JMBR.js} +1 -1
  170. package/dist/preview/chunk.XSM4OTF4.js +1 -0
  171. package/dist/preview/{chunk.DRAPVGQZ.js → chunk.XTHSPLZZ.js} +1 -1
  172. package/dist/preview/{chunk.VQOYFBEV.js → chunk.Y5WQD6KV.js} +1 -1
  173. package/dist/preview/chunk.YXVUJ3NB.js +1 -0
  174. package/dist/preview/{chunk.NRECR3NQ.js → chunk.Z22C2JJ4.js} +1 -1
  175. package/dist/preview/{chunk.TQRC5VAM.js → chunk.Z2BCOZDZ.js} +1 -1
  176. package/dist/preview/{chunk.S2NQRD6W.js → chunk.Z3TK2LJM.js} +1 -1
  177. package/dist/preview/chunk.ZGLOXN7O.js +1 -0
  178. package/dist/preview/{chunk.R7POSVUK.js → chunk.ZLQIGZXO.js} +2 -2
  179. package/dist/preview/{chunk.YJ4PFOPC.js → chunk.ZONRIOIA.js} +1 -1
  180. package/dist/preview/{chunk.QVCKTDG3.js → chunk.ZY3NAJDM.js} +1 -1
  181. package/dist/preview/index.html +55 -55
  182. package/dist/preview/page.js +2 -2
  183. package/package.json +7 -7
  184. package/dist/preview/chunk.2WFOKJB4.js +0 -1
  185. package/dist/preview/chunk.32SHA3EY.js +0 -1
  186. package/dist/preview/chunk.3D37E2G5.js +0 -1
  187. package/dist/preview/chunk.3PT3BU6K.js +0 -1
  188. package/dist/preview/chunk.3XTIYX6M.js +0 -1
  189. package/dist/preview/chunk.4O7WYLCK.js +0 -1
  190. package/dist/preview/chunk.5DU6FA5R.js +0 -1
  191. package/dist/preview/chunk.5TWRTGP6.js +0 -1
  192. package/dist/preview/chunk.6BR2SUAE.js +0 -1
  193. package/dist/preview/chunk.6TDVNWFU.js +0 -17
  194. package/dist/preview/chunk.6XBQDXT6.js +0 -3
  195. package/dist/preview/chunk.7L3I776Z.js +0 -1
  196. package/dist/preview/chunk.7OLKVOS6.js +0 -1
  197. package/dist/preview/chunk.AG7WJYM5.js +0 -3
  198. package/dist/preview/chunk.AMAOZVEO.js +0 -1
  199. package/dist/preview/chunk.AMV2ILR6.js +0 -1
  200. package/dist/preview/chunk.B5EFNTDA.js +0 -1
  201. package/dist/preview/chunk.BBLIT7S7.js +0 -1
  202. package/dist/preview/chunk.BSQI3KM2.js +0 -1
  203. package/dist/preview/chunk.CYEPHT7V.js +0 -1
  204. package/dist/preview/chunk.D3SWJ7OS.js +0 -1
  205. package/dist/preview/chunk.DHPXRDT5.js +0 -5
  206. package/dist/preview/chunk.DKUEZPGR.js +0 -1
  207. package/dist/preview/chunk.FWXW4T4I.js +0 -25
  208. package/dist/preview/chunk.GF5CZPZ7.js +0 -1
  209. package/dist/preview/chunk.GPBHUIZQ.js +0 -2
  210. package/dist/preview/chunk.GVFGS2HY.js +0 -1
  211. package/dist/preview/chunk.HGH27XZG.js +0 -23
  212. package/dist/preview/chunk.HMJXB6KC.js +0 -5
  213. package/dist/preview/chunk.HTEQCRVP.js +0 -1
  214. package/dist/preview/chunk.I7KN732Z.js +0 -2
  215. package/dist/preview/chunk.IAVIYJTL.js +0 -1
  216. package/dist/preview/chunk.IPKESOIU.js +0 -21
  217. package/dist/preview/chunk.IRNEWNUB.js +0 -1
  218. package/dist/preview/chunk.J7O23NKZ.js +0 -22
  219. package/dist/preview/chunk.JDUA5PH2.js +0 -1
  220. package/dist/preview/chunk.JN3WZGJY.js +0 -1
  221. package/dist/preview/chunk.JQEXH23N.js +0 -1
  222. package/dist/preview/chunk.KVQYOFDV.js +0 -1
  223. package/dist/preview/chunk.LAVLPYSC.js +0 -1
  224. package/dist/preview/chunk.MATUPDZ3.js +0 -1
  225. package/dist/preview/chunk.MD3N26BC.js +0 -23
  226. package/dist/preview/chunk.MHHNO3O2.js +0 -1
  227. package/dist/preview/chunk.MUWI54IP.js +0 -1
  228. package/dist/preview/chunk.NLZHNPDU.js +0 -93
  229. package/dist/preview/chunk.NSAGOOJW.js +0 -1
  230. package/dist/preview/chunk.NYLKG25K.js +0 -4
  231. package/dist/preview/chunk.OWO3OV62.js +0 -1
  232. package/dist/preview/chunk.ROYCJXPE.js +0 -1
  233. package/dist/preview/chunk.RZ73YG5K.js +0 -1
  234. package/dist/preview/chunk.SAWASNDO.js +0 -1
  235. package/dist/preview/chunk.SCVKHGO3.js +0 -1
  236. package/dist/preview/chunk.SM37MNS2.js +0 -1
  237. package/dist/preview/chunk.T2BZBR7S.js +0 -50
  238. package/dist/preview/chunk.TLPCYKLW.js +0 -3
  239. package/dist/preview/chunk.U563J5IM.js +0 -1
  240. package/dist/preview/chunk.U6QXLNHF.js +0 -15
  241. package/dist/preview/chunk.VBYJBW32.js +0 -1
  242. package/dist/preview/chunk.VHLL6VC6.js +0 -1
  243. package/dist/preview/chunk.W3WXI5B3.js +0 -1
  244. package/dist/preview/chunk.W43XWQRC.js +0 -1
  245. package/dist/preview/chunk.WJHLE73Y.js +0 -111
  246. package/dist/preview/chunk.ZT3ZG52B.js +0 -1
  247. package/dist/preview/chunk.ZU3RPI34.js +0 -1
@@ -1 +1 @@
1
- import{a as v,b as w,c as x}from"./chunk.MB7LKKUD.js";import"./chunk.NLZHNPDU.js";import"./chunk.QNC2OKLF.js";import{G as R,Va as g,W as y,Xa as h}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import{lb as b,td as m}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var c=p(R(),1);var r=p(y(),1);function W({notices:e,anchor:n,board:a,report:i}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="banner"),at:"top",anchor:n,board:a,report:i}),(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="toast"),at:"foot",anchor:n,board:a,report:i})]})}var E={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"},C={info:"i",good:"\u2713",warn:"!",bad:"!"};function k({notices:e,at:n,anchor:a,board:i,report:s}){let l=(0,c.useRef)(null),t=e.length>0;return(0,c.useLayoutEffect)(()=>{let o=l.current;if(!t||!o)return;if(typeof o.showPopover=="function"&&!g(o))try{o.showPopover()}catch{}let d=()=>(n==="top"?x:w)(o,a());d(),n==="foot"&&i.hold?.(()=>o.matches(":hover")||o.contains(document.activeElement));let N=h(o);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let u=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return u?.observe(o),()=>{if(N(),u?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),o.isConnected&&g(o))try{o.hidePopover()}catch{}}},[t,n,a,i]),t?(0,r.jsx)("div",{ref:l,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:m("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:e.map(o=>(0,r.jsx)(O,{notice:o,board:i,report:s},o.id))}):null}var T=e=>e.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or "),H=e=>/^.*?[.!?](?=\s|$)/.exec(e.trim())?.[0]??e.trim(),L=e=>e.from==="framework"&&(e.tone==="bad"||e.tone==="warn");function O({notice:e,board:n,report:a}){let i=e.tone??"info",s=[...e.action?[e.action]:[],...e.actions??[]],l=()=>n.dismiss(e.id);return(0,r.jsxs)("div",{"data-testid":"notice","data-kind":e.kind,"data-tone":i,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:e.kind==="banner"?"8px 10px 8px 12px":"10px 12px 10px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,r.jsx)("span",{"aria-hidden":"true","data-testid":"notice-chip",style:{width:20,height:20,borderRadius:"var(--graview-radius-sm, 6px)",flex:"0 0 auto",display:"inline-grid",placeItems:"center",fontSize:"0.75rem",fontWeight:700,lineHeight:1,color:"var(--graview-ink)",background:`color-mix(in srgb, ${E[i]} 22%, transparent)`},children:C[i]}),(0,r.jsx)("span",{"data-testid":"notice-sentence",style:{flex:"1 1 16rem",minWidth:0},children:e.sentence}),s.length>0?(0,r.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:s.map((t,o)=>t.href!==void 0?(0,r.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),l()},style:{...f,...o===0?S:{}},children:t.label},t.label):(0,r.jsx)("button",{type:"button","data-testid":"notice-action",...t.keys?{"aria-keyshortcuts":t.keys,title:`${t.label} \u2014 ${T(t.keys)}`}:{},onClick:()=>{l(),t.onSelect?.()},style:{...f,...o===0?S:{}},children:t.label},t.label))}):null,a&&L(e)?(0,r.jsx)("button",{type:"button","data-testid":"notice-report","aria-label":`Report this: ${H(e.sentence)}`,onClick:()=>a.tell({message:e.sentence,...e.code?{code:e.code}:{},...a.where(),version:b}),style:f,children:"Report this"}):null,(0,r.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${e.sentence}`,title:"Dismiss",onClick:l,style:z,children:"\xD7"})]})}var f={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},S={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},z={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{W as NoticeStacks,H as firstSentenceOf,L as reportable};
1
+ import{a as v,b as w,c as x}from"./chunk.MB7LKKUD.js";import"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{G as R,Y as y,Ya as g,_a as h}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import{wb as b,zd as m}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var c=p(R(),1);var r=p(y(),1);function W({notices:e,anchor:n,board:a,report:i}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="banner"),at:"top",anchor:n,board:a,report:i}),(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="toast"),at:"foot",anchor:n,board:a,report:i})]})}var E={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"},C={info:"i",good:"\u2713",warn:"!",bad:"!"};function k({notices:e,at:n,anchor:a,board:i,report:s}){let l=(0,c.useRef)(null),t=e.length>0;return(0,c.useLayoutEffect)(()=>{let o=l.current;if(!t||!o)return;if(typeof o.showPopover=="function"&&!g(o))try{o.showPopover()}catch{}let d=()=>(n==="top"?x:w)(o,a());d(),n==="foot"&&i.hold?.(()=>o.matches(":hover")||o.contains(document.activeElement));let N=h(o);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let u=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return u?.observe(o),()=>{if(N(),u?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),o.isConnected&&g(o))try{o.hidePopover()}catch{}}},[t,n,a,i]),t?(0,r.jsx)("div",{ref:l,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:m("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:e.map(o=>(0,r.jsx)(O,{notice:o,board:i,report:s},o.id))}):null}var T=e=>e.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or "),H=e=>/^.*?[.!?](?=\s|$)/.exec(e.trim())?.[0]??e.trim(),L=e=>e.from==="framework"&&(e.tone==="bad"||e.tone==="warn");function O({notice:e,board:n,report:a}){let i=e.tone??"info",s=[...e.action?[e.action]:[],...e.actions??[]],l=()=>n.dismiss(e.id);return(0,r.jsxs)("div",{"data-testid":"notice","data-kind":e.kind,"data-tone":i,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:e.kind==="banner"?"8px 10px 8px 12px":"10px 12px 10px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,r.jsx)("span",{"aria-hidden":"true","data-testid":"notice-chip",style:{width:20,height:20,borderRadius:"var(--graview-radius-sm, 6px)",flex:"0 0 auto",display:"inline-grid",placeItems:"center",fontSize:"0.75rem",fontWeight:700,lineHeight:1,color:"var(--graview-ink)",background:`color-mix(in srgb, ${E[i]} 22%, transparent)`},children:C[i]}),(0,r.jsx)("span",{"data-testid":"notice-sentence",style:{flex:"1 1 16rem",minWidth:0},children:e.sentence}),s.length>0?(0,r.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:s.map((t,o)=>t.href!==void 0?(0,r.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),l()},style:{...f,...o===0?S:{}},children:t.label},t.label):(0,r.jsx)("button",{type:"button","data-testid":"notice-action",...t.keys?{"aria-keyshortcuts":t.keys,title:`${t.label} \u2014 ${T(t.keys)}`}:{},onClick:()=>{l(),t.onSelect?.()},style:{...f,...o===0?S:{}},children:t.label},t.label))}):null,a&&L(e)?(0,r.jsx)("button",{type:"button","data-testid":"notice-report","aria-label":`Report this: ${H(e.sentence)}`,onClick:()=>a.tell({message:e.sentence,...e.code?{code:e.code}:{},...a.where(),version:b}),style:f,children:"Report this"}):null,(0,r.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${e.sentence}`,title:"Dismiss",onClick:l,style:z,children:"\xD7"})]})}var f={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},S={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},z={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{W as NoticeStacks,H as firstSentenceOf,L as reportable};
@@ -0,0 +1 @@
1
+ var t={padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"start"};export{t as a};
@@ -1 +1 @@
1
- import{a as O,b}from"./chunk.EQZPEOIW.js";import"./chunk.ZQYHNFRZ.js";import"./chunk.EP7YT7LT.js";import"./chunk.I7KN732Z.js";import"./chunk.TLPCYKLW.js";import"./chunk.NLZHNPDU.js";import"./chunk.QNC2OKLF.js";import{G as z,W as M,ea as S}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import{Bd as A}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function $({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[x,C]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='inbox-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){C(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),C(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),x?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:x}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function j({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='inbox-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{j as NotifiedList,$ as NotifySheet};
1
+ import{a as O,b}from"./chunk.VL3YDD7D.js";import"./chunk.OPMGQS5J.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{G as z,Y as M,ga as S}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import{Hd as A}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function $({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[x,C]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='inbox-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){C(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),C(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),x?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:x}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function j({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='inbox-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{j as NotifiedList,$ as NotifySheet};
@@ -1,4 +1,4 @@
1
- import{c as Ry}from"./chunk.QNC2OKLF.js";import{G as Cy}from"./chunk.FWXW4T4I.js";import{a as an}from"./chunk.AJZBJBMO.js";var Ti=an(J=>{"use strict";function Gf(l,a){var t=l.length;l.push(a);l:for(;0<t;){var u=t-1>>>1,n=l[u];if(0<tn(n,a))l[u]=a,l[t]=n,t=u;else break l}}function Ll(l){return l.length===0?null:l[0]}function nn(l){if(l.length===0)return null;var a=l[0],t=l.pop();if(t!==a){l[0]=t;l:for(var u=0,n=l.length,f=n>>>1;u<f;){var e=2*(u+1)-1,c=l[e],i=e+1,m=l[i];if(0>tn(c,t))i<n&&0>tn(m,c)?(l[u]=m,l[i]=t,u=i):(l[u]=c,l[e]=t,u=e);else if(i<n&&0>tn(m,t))l[u]=m,l[i]=t,u=i;else break l}}return a}function tn(l,a){var t=l.sortIndex-a.sortIndex;return t!==0?t:l.id-a.id}J.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(yi=performance,J.unstable_now=function(){return yi.now()}):(Yf=Date,mi=Yf.now(),J.unstable_now=function(){return Yf.now()-mi});var yi,Yf,mi,Il=[],Aa=[],jy=1,Bl=null,ml=3,Zf=!1,au=!1,tu=!1,Cf=!1,Si=typeof setTimeout=="function"?setTimeout:null,gi=typeof clearTimeout=="function"?clearTimeout:null,hi=typeof setImmediate<"u"?setImmediate:null;function un(l){for(var a=Ll(Aa);a!==null;){if(a.callback===null)nn(Aa);else if(a.startTime<=l)nn(Aa),a.sortIndex=a.expirationTime,Gf(Il,a);else break;a=Ll(Aa)}}function Rf(l){if(tu=!1,un(l),!au)if(Ll(Il)!==null)au=!0,ht||(ht=!0,mt());else{var a=Ll(Aa);a!==null&&jf(Rf,a.startTime-l)}}var ht=!1,uu=-1,bi=5,zi=-1;function Ai(){return Cf?!0:!(J.unstable_now()-zi<bi)}function Qf(){if(Cf=!1,ht){var l=J.unstable_now();zi=l;var a=!0;try{l:{au=!1,tu&&(tu=!1,gi(uu),uu=-1),Zf=!0;var t=ml;try{a:{for(un(l),Bl=Ll(Il);Bl!==null&&!(Bl.expirationTime>l&&Ai());){var u=Bl.callback;if(typeof u=="function"){Bl.callback=null,ml=Bl.priorityLevel;var n=u(Bl.expirationTime<=l);if(l=J.unstable_now(),typeof n=="function"){Bl.callback=n,un(l),a=!0;break a}Bl===Ll(Il)&&nn(Il),un(l)}else nn(Il);Bl=Ll(Il)}if(Bl!==null)a=!0;else{var f=Ll(Aa);f!==null&&jf(Rf,f.startTime-l),a=!1}}break l}finally{Bl=null,ml=t,Zf=!1}a=void 0}}finally{a?mt():ht=!1}}}var mt;typeof hi=="function"?mt=function(){hi(Qf)}:typeof MessageChannel<"u"?(Xf=new MessageChannel,di=Xf.port2,Xf.port1.onmessage=Qf,mt=function(){di.postMessage(null)}):mt=function(){Si(Qf,0)};var Xf,di;function jf(l,a){uu=Si(function(){l(J.unstable_now())},a)}J.unstable_IdlePriority=5;J.unstable_ImmediatePriority=1;J.unstable_LowPriority=4;J.unstable_NormalPriority=3;J.unstable_Profiling=null;J.unstable_UserBlockingPriority=2;J.unstable_cancelCallback=function(l){l.callback=null};J.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):bi=0<l?Math.floor(1e3/l):5};J.unstable_getCurrentPriorityLevel=function(){return ml};J.unstable_next=function(l){switch(ml){case 1:case 2:case 3:var a=3;break;default:a=ml}var t=ml;ml=a;try{return l()}finally{ml=t}};J.unstable_requestPaint=function(){Cf=!0};J.unstable_runWithPriority=function(l,a){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var t=ml;ml=l;try{return a()}finally{ml=t}};J.unstable_scheduleCallback=function(l,a,t){var u=J.unstable_now();switch(typeof t=="object"&&t!==null?(t=t.delay,t=typeof t=="number"&&0<t?u+t:u):t=u,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=t+n,l={id:jy++,callback:a,priorityLevel:l,startTime:t,expirationTime:n,sortIndex:-1},t>u?(l.sortIndex=t,Gf(Aa,l),Ll(Il)===null&&l===Ll(Aa)&&(tu?(gi(uu),uu=-1):tu=!0,jf(Rf,t-u))):(l.sortIndex=n,Gf(Il,l),au||Zf||(au=!0,ht||(ht=!0,mt()))),l};J.unstable_shouldYield=Ai;J.unstable_wrapCallback=function(l){var a=ml;return function(){var t=ml;ml=a;try{return l.apply(this,arguments)}finally{ml=t}}}});var Mi=an((dd,Ei)=>{"use strict";Ei.exports=Ti()});var Qy=an(qf=>{"use strict";var tl=Mi(),w0=Cy(),Vy=Ry();function A(l){var a="https://react.dev/errors/"+l;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)a+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+l+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function F0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Ku(l){var a=l,t=l;if(l.alternate)for(;a.return;)a=a.return;else{l=a;do a=l,(a.flags&4098)!==0&&(t=a.return),l=a.return;while(l)}return a.tag===3?t:null}function $0(l){if(l.tag===13){var a=l.memoizedState;if(a===null&&(l=l.alternate,l!==null&&(a=l.memoizedState)),a!==null)return a.dehydrated}return null}function k0(l){if(l.tag===31){var a=l.memoizedState;if(a===null&&(l=l.alternate,l!==null&&(a=l.memoizedState)),a!==null)return a.dehydrated}return null}function Oi(l){if(Ku(l)!==l)throw Error(A(188))}function xy(l){var a=l.alternate;if(!a){if(a=Ku(l),a===null)throw Error(A(188));return a!==l?null:l}for(var t=l,u=a;;){var n=t.return;if(n===null)break;var f=n.alternate;if(f===null){if(u=n.return,u!==null){t=u;continue}break}if(n.child===f.child){for(f=n.child;f;){if(f===t)return Oi(n),l;if(f===u)return Oi(n),a;f=f.sibling}throw Error(A(188))}if(t.return!==u.return)t=n,u=f;else{for(var e=!1,c=n.child;c;){if(c===t){e=!0,t=n,u=f;break}if(c===u){e=!0,u=n,t=f;break}c=c.sibling}if(!e){for(c=f.child;c;){if(c===t){e=!0,t=f,u=n;break}if(c===u){e=!0,u=f,t=n;break}c=c.sibling}if(!e)throw Error(A(189))}}if(t.alternate!==u)throw Error(A(190))}if(t.tag!==3)throw Error(A(188));return t.stateNode.current===t?l:a}function I0(l){var a=l.tag;if(a===5||a===26||a===27||a===6)return l;for(l=l.child;l!==null;){if(a=I0(l),a!==null)return a;l=l.sibling}return null}var L=Object.assign,py=Symbol.for("react.element"),fn=Symbol.for("react.transitional.element"),mu=Symbol.for("react.portal"),At=Symbol.for("react.fragment"),r0=Symbol.for("react.strict_mode"),Te=Symbol.for("react.profiler"),P0=Symbol.for("react.consumer"),fa=Symbol.for("react.context"),Sc=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),Me=Symbol.for("react.suspense_list"),gc=Symbol.for("react.memo"),Ta=Symbol.for("react.lazy");Symbol.for("react.scope");var Oe=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var Ky=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var Di=Symbol.iterator;function nu(l){return l===null||typeof l!="object"?null:(l=Di&&l[Di]||l["@@iterator"],typeof l=="function"?l:null)}var Ly=Symbol.for("react.client.reference");function De(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Ly?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case At:return"Fragment";case Te:return"Profiler";case r0:return"StrictMode";case Ee:return"Suspense";case Me:return"SuspenseList";case Oe:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case mu:return"Portal";case fa:return l.displayName||"Context";case P0:return(l._context.displayName||"Context")+".Consumer";case Sc:var a=l.render;return l=l.displayName,l||(l=a.displayName||a.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case gc:return a=l.displayName||null,a!==null?a:De(l.type)||"Memo";case Ta:a=l._payload,l=l._init;try{return De(l(a))}catch{}}return null}var hu=Array.isArray,D=w0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Vy.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ka={pending:!1,data:null,method:null,action:null},Ue=[],Tt=-1;function $l(l){return{current:l}}function fl(l){0>Tt||(l.current=Ue[Tt],Ue[Tt]=null,Tt--)}function x(l,a){Tt++,Ue[Tt]=l.current,l.current=a}var Fl=$l(null),Nu=$l(null),Ba=$l(null),jn=$l(null);function Vn(l,a){switch(x(Ba,a),x(Nu,l),x(Fl,null),a.nodeType){case 9:case 11:l=(l=a.documentElement)&&(l=l.namespaceURI)?B0(l):0;break;default:if(l=a.tagName,a=a.namespaceURI)a=B0(a),l=Ty(a,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}fl(Fl),x(Fl,l)}function Ct(){fl(Fl),fl(Nu),fl(Ba)}function se(l){l.memoizedState!==null&&x(jn,l);var a=Fl.current,t=Ty(a,l.type);a!==t&&(x(Nu,l),x(Fl,t))}function xn(l){Nu.current===l&&(fl(Fl),fl(Nu)),jn.current===l&&(fl(jn),Vu._currentValue=ka)}var Vf,Ui;function Wa(l){if(Vf===void 0)try{throw Error()}catch(t){var a=t.stack.trim().match(/\n( *(at )?)/);Vf=a&&a[1]||"",Ui=-1<t.stack.indexOf(`
1
+ import{c as Ry}from"./chunk.P43LPXXJ.js";import{G as Cy}from"./chunk.JCKIJSW7.js";import{a as an}from"./chunk.AJZBJBMO.js";var Ti=an(J=>{"use strict";function Gf(l,a){var t=l.length;l.push(a);l:for(;0<t;){var u=t-1>>>1,n=l[u];if(0<tn(n,a))l[u]=a,l[t]=n,t=u;else break l}}function Ll(l){return l.length===0?null:l[0]}function nn(l){if(l.length===0)return null;var a=l[0],t=l.pop();if(t!==a){l[0]=t;l:for(var u=0,n=l.length,f=n>>>1;u<f;){var e=2*(u+1)-1,c=l[e],i=e+1,m=l[i];if(0>tn(c,t))i<n&&0>tn(m,c)?(l[u]=m,l[i]=t,u=i):(l[u]=c,l[e]=t,u=e);else if(i<n&&0>tn(m,t))l[u]=m,l[i]=t,u=i;else break l}}return a}function tn(l,a){var t=l.sortIndex-a.sortIndex;return t!==0?t:l.id-a.id}J.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(yi=performance,J.unstable_now=function(){return yi.now()}):(Yf=Date,mi=Yf.now(),J.unstable_now=function(){return Yf.now()-mi});var yi,Yf,mi,Il=[],Aa=[],jy=1,Bl=null,ml=3,Zf=!1,au=!1,tu=!1,Cf=!1,Si=typeof setTimeout=="function"?setTimeout:null,gi=typeof clearTimeout=="function"?clearTimeout:null,hi=typeof setImmediate<"u"?setImmediate:null;function un(l){for(var a=Ll(Aa);a!==null;){if(a.callback===null)nn(Aa);else if(a.startTime<=l)nn(Aa),a.sortIndex=a.expirationTime,Gf(Il,a);else break;a=Ll(Aa)}}function Rf(l){if(tu=!1,un(l),!au)if(Ll(Il)!==null)au=!0,ht||(ht=!0,mt());else{var a=Ll(Aa);a!==null&&jf(Rf,a.startTime-l)}}var ht=!1,uu=-1,bi=5,zi=-1;function Ai(){return Cf?!0:!(J.unstable_now()-zi<bi)}function Qf(){if(Cf=!1,ht){var l=J.unstable_now();zi=l;var a=!0;try{l:{au=!1,tu&&(tu=!1,gi(uu),uu=-1),Zf=!0;var t=ml;try{a:{for(un(l),Bl=Ll(Il);Bl!==null&&!(Bl.expirationTime>l&&Ai());){var u=Bl.callback;if(typeof u=="function"){Bl.callback=null,ml=Bl.priorityLevel;var n=u(Bl.expirationTime<=l);if(l=J.unstable_now(),typeof n=="function"){Bl.callback=n,un(l),a=!0;break a}Bl===Ll(Il)&&nn(Il),un(l)}else nn(Il);Bl=Ll(Il)}if(Bl!==null)a=!0;else{var f=Ll(Aa);f!==null&&jf(Rf,f.startTime-l),a=!1}}break l}finally{Bl=null,ml=t,Zf=!1}a=void 0}}finally{a?mt():ht=!1}}}var mt;typeof hi=="function"?mt=function(){hi(Qf)}:typeof MessageChannel<"u"?(Xf=new MessageChannel,di=Xf.port2,Xf.port1.onmessage=Qf,mt=function(){di.postMessage(null)}):mt=function(){Si(Qf,0)};var Xf,di;function jf(l,a){uu=Si(function(){l(J.unstable_now())},a)}J.unstable_IdlePriority=5;J.unstable_ImmediatePriority=1;J.unstable_LowPriority=4;J.unstable_NormalPriority=3;J.unstable_Profiling=null;J.unstable_UserBlockingPriority=2;J.unstable_cancelCallback=function(l){l.callback=null};J.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):bi=0<l?Math.floor(1e3/l):5};J.unstable_getCurrentPriorityLevel=function(){return ml};J.unstable_next=function(l){switch(ml){case 1:case 2:case 3:var a=3;break;default:a=ml}var t=ml;ml=a;try{return l()}finally{ml=t}};J.unstable_requestPaint=function(){Cf=!0};J.unstable_runWithPriority=function(l,a){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var t=ml;ml=l;try{return a()}finally{ml=t}};J.unstable_scheduleCallback=function(l,a,t){var u=J.unstable_now();switch(typeof t=="object"&&t!==null?(t=t.delay,t=typeof t=="number"&&0<t?u+t:u):t=u,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=t+n,l={id:jy++,callback:a,priorityLevel:l,startTime:t,expirationTime:n,sortIndex:-1},t>u?(l.sortIndex=t,Gf(Aa,l),Ll(Il)===null&&l===Ll(Aa)&&(tu?(gi(uu),uu=-1):tu=!0,jf(Rf,t-u))):(l.sortIndex=n,Gf(Il,l),au||Zf||(au=!0,ht||(ht=!0,mt()))),l};J.unstable_shouldYield=Ai;J.unstable_wrapCallback=function(l){var a=ml;return function(){var t=ml;ml=a;try{return l.apply(this,arguments)}finally{ml=t}}}});var Mi=an((dd,Ei)=>{"use strict";Ei.exports=Ti()});var Qy=an(qf=>{"use strict";var tl=Mi(),w0=Cy(),Vy=Ry();function A(l){var a="https://react.dev/errors/"+l;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)a+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+l+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function F0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Ku(l){var a=l,t=l;if(l.alternate)for(;a.return;)a=a.return;else{l=a;do a=l,(a.flags&4098)!==0&&(t=a.return),l=a.return;while(l)}return a.tag===3?t:null}function $0(l){if(l.tag===13){var a=l.memoizedState;if(a===null&&(l=l.alternate,l!==null&&(a=l.memoizedState)),a!==null)return a.dehydrated}return null}function k0(l){if(l.tag===31){var a=l.memoizedState;if(a===null&&(l=l.alternate,l!==null&&(a=l.memoizedState)),a!==null)return a.dehydrated}return null}function Oi(l){if(Ku(l)!==l)throw Error(A(188))}function xy(l){var a=l.alternate;if(!a){if(a=Ku(l),a===null)throw Error(A(188));return a!==l?null:l}for(var t=l,u=a;;){var n=t.return;if(n===null)break;var f=n.alternate;if(f===null){if(u=n.return,u!==null){t=u;continue}break}if(n.child===f.child){for(f=n.child;f;){if(f===t)return Oi(n),l;if(f===u)return Oi(n),a;f=f.sibling}throw Error(A(188))}if(t.return!==u.return)t=n,u=f;else{for(var e=!1,c=n.child;c;){if(c===t){e=!0,t=n,u=f;break}if(c===u){e=!0,u=n,t=f;break}c=c.sibling}if(!e){for(c=f.child;c;){if(c===t){e=!0,t=f,u=n;break}if(c===u){e=!0,u=f,t=n;break}c=c.sibling}if(!e)throw Error(A(189))}}if(t.alternate!==u)throw Error(A(190))}if(t.tag!==3)throw Error(A(188));return t.stateNode.current===t?l:a}function I0(l){var a=l.tag;if(a===5||a===26||a===27||a===6)return l;for(l=l.child;l!==null;){if(a=I0(l),a!==null)return a;l=l.sibling}return null}var L=Object.assign,py=Symbol.for("react.element"),fn=Symbol.for("react.transitional.element"),mu=Symbol.for("react.portal"),At=Symbol.for("react.fragment"),r0=Symbol.for("react.strict_mode"),Te=Symbol.for("react.profiler"),P0=Symbol.for("react.consumer"),fa=Symbol.for("react.context"),Sc=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),Me=Symbol.for("react.suspense_list"),gc=Symbol.for("react.memo"),Ta=Symbol.for("react.lazy");Symbol.for("react.scope");var Oe=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var Ky=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var Di=Symbol.iterator;function nu(l){return l===null||typeof l!="object"?null:(l=Di&&l[Di]||l["@@iterator"],typeof l=="function"?l:null)}var Ly=Symbol.for("react.client.reference");function De(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Ly?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case At:return"Fragment";case Te:return"Profiler";case r0:return"StrictMode";case Ee:return"Suspense";case Me:return"SuspenseList";case Oe:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case mu:return"Portal";case fa:return l.displayName||"Context";case P0:return(l._context.displayName||"Context")+".Consumer";case Sc:var a=l.render;return l=l.displayName,l||(l=a.displayName||a.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case gc:return a=l.displayName||null,a!==null?a:De(l.type)||"Memo";case Ta:a=l._payload,l=l._init;try{return De(l(a))}catch{}}return null}var hu=Array.isArray,D=w0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Vy.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ka={pending:!1,data:null,method:null,action:null},Ue=[],Tt=-1;function $l(l){return{current:l}}function fl(l){0>Tt||(l.current=Ue[Tt],Ue[Tt]=null,Tt--)}function x(l,a){Tt++,Ue[Tt]=l.current,l.current=a}var Fl=$l(null),Nu=$l(null),Ba=$l(null),jn=$l(null);function Vn(l,a){switch(x(Ba,a),x(Nu,l),x(Fl,null),a.nodeType){case 9:case 11:l=(l=a.documentElement)&&(l=l.namespaceURI)?B0(l):0;break;default:if(l=a.tagName,a=a.namespaceURI)a=B0(a),l=Ty(a,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}fl(Fl),x(Fl,l)}function Ct(){fl(Fl),fl(Nu),fl(Ba)}function se(l){l.memoizedState!==null&&x(jn,l);var a=Fl.current,t=Ty(a,l.type);a!==t&&(x(Nu,l),x(Fl,t))}function xn(l){Nu.current===l&&(fl(Fl),fl(Nu)),jn.current===l&&(fl(jn),Vu._currentValue=ka)}var Vf,Ui;function Wa(l){if(Vf===void 0)try{throw Error()}catch(t){var a=t.stack.trim().match(/\n( *(at )?)/);Vf=a&&a[1]||"",Ui=-1<t.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
3
3
  `+Vf+l+Ui}var xf=!1;function pf(l,a){if(!l||xf)return"";xf=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(S){var d=S}Reflect.construct(l,[],z)}else{try{z.call()}catch(S){d=S}l.call(z.prototype)}}else{try{throw Error()}catch(S){d=S}(z=l())&&typeof z.catch=="function"&&z.catch(function(){})}}catch(S){if(S&&d&&typeof S.stack=="string")return[S.stack,d.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=u.DetermineComponentFrameRoot(),e=f[0],c=f[1];if(e&&c){var i=e.split(`
4
4
  `),m=c.split(`
@@ -1,4 +1,4 @@
1
- import{a as k}from"./chunk.G4JJXA63.js";import{b as Q}from"./chunk.IO5VFTXC.js";import{a as Z}from"./chunk.UPOYRCKI.js";import{a as Y}from"./chunk.ZE5RSKXF.js";import{c as V}from"./chunk.I7KN732Z.js";import{ee as P,ge as H,he as T,ie as U,yb as z,zb as B}from"./chunk.DHPXRDT5.js";var x=n=>"failed"in n;function fn(n,e){let s=n.schema.kinds,t=n.policy?.sees;if(!t?.length||B(e))return{kinds:s};let o=z(e).roles??[],r=new Set(t.filter(i=>i.roles==="*"||o.some(a=>i.roles.includes(a))).flatMap(i=>i.kinds));return{kinds:s.filter(i=>r.has(i))}}function O(n,e){if(!e)return n;let s=new Set(e.kinds.filter(r=>n.tryDefinition(r)!==void 0));if(s.size===n.kinds.length)return n;let t=new Map,o=r=>{if(s.has(r)){if(!t.has(r)){let i=n.tryDefinition(r),a=Object.fromEntries(Object.entries(i?.edges??{}).flatMap(([l,d])=>{if(d.to==="*")return[[l,d]];let c=d.to.filter(u=>s.has(u));return c.length>0?[[l,{...d,to:c}]]:[]}));t.set(r,{...i,edges:a})}return t.get(r)}};return{...n,definitions:n.definitions.filter(r=>s.has(r.kind)),kinds:n.kinds.filter(r=>s.has(r)),tryDefinition:o,definition:r=>{let i=o(r);if(!i)throw new Error(`Unknown node kind "${r}"`);return i}}}var gn=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),b=n=>gn(n).replace(/[-_]+/g," ").trim();function j(n){let e=[];for(let t of n.kinds){let o=n.tryDefinition(t);if(!o)continue;let r=o.display?.labels??{},i=Object.entries(o.fields?.shape??{}).filter(([d])=>d!=="id"&&d!=="kind").map(([d,c])=>{let u=Y(c);return{name:d,type:u?.type==="enum"&&u.multiple?"list":u?.type,...u?.options?{options:u.options}:{},words:(r[d]??b(d)).toLowerCase()}}),a=Object.entries(o.edges??{}).map(([d,c])=>({name:d,from:t,to:c.to==="*"?n.kinds.filter(u=>u!==t):c.to,words:b(d)})),l=(o.plural??`${b(t)}s`).toLowerCase();e.push({kind:t,plural:l,noun:(o.noun??b(t)).toLowerCase(),fields:i,roles:o.fieldRoles??{},edges:a})}let s=new Map(e.map(t=>[t.kind,t]));return{schema:n,kinds:e,info:t=>s.get(t)}}var $=(n,e)=>e===void 0?void 0:n.fields.find(s=>s.name===e),R=n=>n?.type==="date"||n?.type==="datetime",K=n=>n?.type==="number"||n?.type==="integer"||n?.type==="duration",sn=n=>` ${n.toLowerCase().replace(/[“”"’‘]/g,"'").replace(/[^\p{L}\p{N}' -]+/gu," ").replace(/\s+/g," ").trim()} `,A=(n,e)=>n.includes(` ${e} `),L=n=>n.endsWith("ies")?`${n.slice(0,-3)}y`:n.endsWith("ses")?n.slice(0,-2):n.endsWith("s")?n.slice(0,-1):n;function yn(n,e){let s=[];for(let t of e.kinds){let o=new Set([t.plural,t.noun,`${t.noun}s`,b(t.kind),`${b(t.kind)}s`]),r=-1;for(let i of o){let a=n.indexOf(` ${i} `);a>=0&&(r<0||a<r)&&(r=a)}r>=0&&s.push({info:t,at:r})}return s.sort((t,o)=>t.at-o.at).map(t=>t.info)}function I(n,e,s){let t=e.trim().toLowerCase();if(t.length===0)return;let o=n.fields.filter(r=>!s||s(r));return o.find(r=>r.words===t||b(r.name)===t||r.name.toLowerCase()===t)??o.find(r=>r.words===L(t)||b(r.name)===L(t))??o.find(r=>t.split(" ").some(i=>i.length>2&&(r.words.split(" ").includes(i)||r.words.split(" ").includes(L(i)))))}function rn(n,e,s){let t=e.trim().toLowerCase();if(t.length!==0)return n.edges.find(o=>o.words===t||o.name.toLowerCase()===t)??n.edges.find(o=>o.to.some(r=>{let i=s.info(r);return i!==void 0&&(i.noun===L(t)||i.plural===t||b(r)===L(t))}))??n.edges.find(o=>t.split(" ").some(r=>r.length>2&&o.words.split(" ").includes(r)))}function W(n){return/ (?:grouped |group |split |sorted |organi[sz]ed )?by ([\p{L}\p{N}' -]+?)(?= (?:and|with|for|in|on|only|where|from|this|that|as|sorted|grouped) |\s*$)/u.exec(n)?.[1]?.trim()}var mn=/\bwho\b.*\b(covers?|cover|tends?|owns?|handles?|does|works? on|looks? after|is on|is assigned|staffs?|runs?)\b|\bcoverage\b|\bmatrix\b|\bwho covers\b/,bn=/\bcalendar\b|\bmonth\b|\bagenda\b|\bschedule\b|\bdue\b|\bdeadlines?\b|\bdates?\b|\bwhen\b/,hn=/\btimeline\b|\bover time\b|\bgantt\b|\bspans?\b|\bweek\b/,pn=/\bboard\b|\bkanban\b|\bcolumns?\b|\bpipeline\b|\bstages?\b|\bstatus\b/,wn=/\blaid out\b|\blayout\b|\bseating\b|\bwhere (?:they|it|each) (?:sits?|lies?|stands?)\b|\bfloor\b/,kn=/\bplan\b|\bmap\b|\bregions?\b/,$n=/\blist\b|\btable\b|\bgroup(?:ed)? by\b|\bsort(?:ed)? by\b|\bonly\b|\bjust the\b/;function Sn(n){let e=[];return/\blist\b|\btable\b/.test(n)&&e.push("blocks"),mn.test(n)&&e.push("coverage"),wn.test(n)&&e.push("board"),(/\bfloor plan\b/.test(n)||kn.test(n))&&e.push("plan"),hn.test(n)&&e.push("timeline"),bn.test(n)&&e.push("calendar"),pn.test(n)&&e.push("columns"),$n.test(n)&&!e.includes("blocks")&&e.push("blocks"),e.length===0&&W(n)&&e.push("columns"),e}var on=n=>{let e=s=>s?` and not ${s}`:"";if(/\boverdue\b|\blate\b|\bpast due\b/.test(n))return{cond:(s,t)=>`days(today(), ${s}) < 0${e(t)}`,says:s=>`overdue by ${s.words}`};if(/\btoday\b/.test(n))return{range:"day",cond:s=>`days(today(), ${s}) == 0`,says:s=>`with ${s.words} today`};if(/\bthis week\b|\bnext 7 days\b|\bnext week\b/.test(n))return{range:"week",cond:s=>`days(today(), ${s}) >= 0 and days(today(), ${s}) <= 6`,says:s=>`with ${s.words} in the next week`};if(/\bthis month\b|\bnext 30 days\b|\bnext month\b/.test(n))return{range:"month",cond:s=>`days(today(), ${s}) >= 0 and days(today(), ${s}) <= 30`,says:s=>`with ${s.words} in the next month`};if(/\blast month\b|\bpast month\b/.test(n))return{range:"month",cond:s=>`days(today(), ${s}) >= -30 and days(today(), ${s}) <= 0`,says:s=>`with ${s.words} in the last month`};if(/\bthis year\b/.test(n))return{range:"year",cond:s=>`days(today(), ${s}) >= 0 and days(today(), ${s}) <= 365`,says:s=>`with ${s.words} in the next year`};if(/\bquarter\b/.test(n))return{range:"quarter",cond:s=>`days(today(), ${s}) >= 0 and days(today(), ${s}) <= 91`,says:s=>`with ${s.words} in the next quarter`}},_=n=>{if(/\bagenda\b|\bin order\b/.test(n))return"agenda";if(/\btoday\b|\bday\b/.test(n))return"day";if(/\bweek\b/.test(n))return"week";if(/\bquarter\b/.test(n))return"quarter";if(/\byears\b/.test(n))return"years";if(/\byear\b/.test(n))return"year";if(/\bmonth\b/.test(n))return"month"},X=/^(user|person|people|member|staff|gardener|volunteer|owner|agent|employee|worker|team|player|customer|client|contact|party|attendee|guest)s?$/,N=class extends Error{},h=n=>{throw new N(n)};function Dn(n,e){let s=n.fields.filter(r=>r.type==="enum");if(e){let r=I(n,e);if(r&&r.type==="enum")return r;r&&h(`${n.plural}' ${r.words} is not a choice, so it has no columns`)}let t=$(n,n.roles.status??n.roles.column);if(t?.type==="enum")return t;let o=s.find(r=>/^(status|stage|state|phase)$/.test(r.name));return o||(s[0]?s[0]:h(`${n.plural} have no choice field to put in columns`))}function nn(n,e){let s=n.fields.filter(R),t=l=>{let d=$(n,n.roles[l]);return R(d)?d:void 0},r=s.find(l=>A(e,l.words)||A(e,b(l.name)))??t("start")??s.find(l=>/^(due|date|on|at|start|starts|begins|from|sown|when)/i.test(l.name))??s[0];if(!r)return h(`no date field on ${n.plural}`);let i=t("end")??s.find(l=>l!==r&&/^(end|ends|until|to|finish|finished|harvested|due|closes|through)/i.test(l.name)),a=n.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));return{start:r,...i&&i!==r?{end:i}:{},...a?{done:a}:{}}}function an(n){let e=$(n,n.roles.start),s=$(n,n.roles.end),t=$(n,n.roles.column??n.roles.day??n.roles.columns);if(K(e)&&K(s)&&t?.type==="enum")return{start:e,end:s,column:t}}function vn(n,e,s,t){let o=[];for(let i of n.kinds)for(let a of i.edges)for(let l of a.to){let d=n.info(l);if(!d||d.kind===i.kind)continue;let c=0;e.includes(i)&&(c+=4),e.includes(d)&&(c+=4),(X.test(d.kind)||X.test(d.noun))&&(c+=3),t&&(a.words.includes(t)||d.noun===L(t))&&(c+=5),a.words.split(" ").some(u=>u.length>2&&s.includes(` ${u}`))&&(c+=2),o.push({rows:i,across:d,link:a,score:c})}let r=o.sort((i,a)=>a.score-i.score)[0];return r||h(e[0]?`${e[0].plural} are joined to nothing else, so there is no who-covers-what to draw`:"nothing here is joined to anything else, so there is no who-covers-what to draw")}function dn(n,e,s,t,o){let r=W(t);switch(n){case"columns":{if(r){let i=I(e,r);if(!i||i.type!=="enum"){let a=rn(e,r,s);if(a){let l=s.info(a.to[0]);return{lens:"coverage",kind:e.kind,across:l.kind,link:a.name}}}}return{lens:"columns",kind:e.kind,column:Dn(e,r).name}}case"calendar":{let i=nn(e,t),a=_(t);return{lens:"calendar",kind:e.kind,start:i.start.name,...i.end?{end:i.end.name}:{},...i.done?{done:i.done.name}:{},...a?{range:a}:{}}}case"timeline":{let i=an(e);if(i&&!/\bdates?\b|\bdue\b|\bdeadlines?\b|\bmonths?\b|\byears?\b/.test(t))return{lens:"timeline",kind:e.kind,start:i.start.name,end:i.end.name,column:i.column.name};let a=nn(e,t);return{lens:"calendar",kind:e.kind,start:a.start.name,...a.end?{end:a.end.name}:{},...a.done?{done:a.done.name}:{},range:_(t)??"quarter"}}case"coverage":{let i=vn(s,o,t,r);return{lens:"coverage",kind:i.rows.kind,across:i.across.kind,link:i.link.name}}case"board":{let i=$(e,e.roles.x)??e.fields.find(c=>c.name==="x"),a=$(e,e.roles.y)??e.fields.find(c=>c.name==="y");if(!K(i)||!K(a))return h(`${e.plural} have no x and y to be laid out by`);let d=s.kinds.flatMap(c=>c.edges.filter(u=>u.to.includes(e.kind)&&c.kind!==e.kind))[0]??e.edges[0];return d?{lens:"board",kind:e.kind,x:i.name,y:a.name,fill:d.name,...d.from!==e.kind?{fillFrom:"occupant"}:{}}:h(`nothing is joined to ${e.plural} to fill them`)}case"plan":{let i=$(e,e.roles.outline)??e.fields.find(a=>a.name==="outline");return i?{lens:"plan",kind:e.kind,outline:i.name}:h(`${e.plural} have no outline to draw a plan from`)}case"blocks":{let i={lens:"blocks",kind:e.kind,as:/\bcards?\b/.test(t)?"card":"row"},a=/ group(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|sorted|with)|\s*$)/u.exec(t)?.[1]??(r&&!/ sort(?:ed)? by /.test(t)?r:void 0);if(a){let c=I(e,a);if(!c||c.type!=="enum")return h(c?`${e.plural}' ${c.words} is not a choice, so they cannot be grouped by it`:`${e.plural} have nothing called ${a} to group by`);i.group=c.name}let l=/ sort(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|grouped|with)|\s*$)/u.exec(t)?.[1];if(l){let c=I(e,l);if(!c)return h(`${e.plural} have nothing called ${l} to sort by`);i.sort={by:c.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}let d=q(e,t);return d.length>0&&(i.where=d),i}}}function q(n,e){let s=[],t=on(e);if(t){let o=n.fields.filter(R),r=$(n,n.roles.start),i=o.find(l=>A(e,l.words))??(R(r)?r:void 0)??o[0];(!i||!R(i))&&h(`no date field on ${n.plural}`);let a=n.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));s.push({expr:t.cond(i.name,/\boverdue\b|\blate\b|\bpast due\b/.test(e)?a?.name:void 0),says:t.says(i)})}if(/\bonly\b|\bjust\b|\bthat are\b|\bwhich are\b/.test(e)){for(let o of n.fields){if(o.type!=="enum")continue;let r=o.options?.find(i=>A(e,i.toLowerCase())||A(e,b(i)));r&&s.push({expr:`${o.name} == '${r.replace(/'/g,"")}'`,says:`that are ${b(r)}`})}if(/\bnot done\b|\bundone\b|\bunfinished\b|\bopen ones\b|\bstill to do\b/.test(e)){let o=n.fields.find(r=>r.type==="boolean"&&/^(done|finished|complete|completed)$/.test(r.name));o&&s.push({expr:`not ${o.name}`,says:`not ${o.words}`})}}return s}var J={columns:"A board",calendar:"A calendar",timeline:"A timeline",coverage:"A grid",board:"A layout",plan:"A plan",blocks:"A list",reach:"A picture"};function Rn(n,e){let s=e.info(n.kind),t=o=>o?$(s,o)?.words??b(o):"";switch(n.lens){case"columns":return{title:`${k(s.plural)} by ${t(n.column)}`,detail:`of ${s.plural} by ${t(n.column)}`};case"calendar":{let o=n.range??"month";if(o==="agenda")return{title:`${k(s.plural)} in date order`,detail:`of ${s.plural} in order of ${t(n.start)}`};let r=o==="years"?"year":o;return{title:`${k(s.plural)} by ${r}`,detail:`of ${s.plural} by ${t(n.start)}, a ${r} at a time`}}case"timeline":return{title:`${k(s.plural)} over the ${t(n.column)}`,detail:`of ${s.plural} from ${t(n.start)} to ${t(n.end)}, by ${t(n.column)}`};case"coverage":{let o=e.info(n.across);return{title:`${k(s.plural)} by ${o.noun}`,detail:`of which ${o.noun} covers which ${s.noun}`}}case"board":return{title:`${k(s.plural)} where they stand`,detail:`of ${s.plural} where they stand`};case"plan":return{title:`${k(s.plural)} on a plan`,detail:`of ${s.plural}`};default:{let o=[n.where?.map(r=>r.says).join(" and "),n.group?`by ${t(n.group)}`:void 0,n.sort?`in order of ${t(n.sort.by)}`:void 0].filter(r=>!!r);return{title:[k(s.plural),...o].join(" "),detail:[`of ${s.plural}`,...o].join(" ")}}}}function An(n,e){let s={title:e,on:n.kind};switch(n.lens){case"columns":return{name:"columns",...s,bindings:{[n.kind]:{column:n.column}}};case"calendar":return{name:"calendar",...s,bindings:{[n.kind]:{start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{}}},...n.range?{options:{range:n.range}}:{}};case"timeline":return{name:"timeline",...s,bindings:{[n.kind]:{start:n.start,end:n.end,column:n.column}}};case"coverage":return{name:"coverage",...s,bindings:{rows:{kind:n.kind},columns:{kind:n.across},link:{edge:n.link}}};case"board":return{name:"board",...s,bindings:{slots:{kind:n.kind},x:{field:n.x,on:"slots"},y:{field:n.y,on:"slots"},fill:{edge:n.fill}},...n.fillFrom?{options:{fillFrom:n.fillFrom}}:{}};case"plan":return{name:"plan",...s,bindings:{regions:{kind:n.kind},outline:{field:n.outline,on:"regions"}}};default:{let t=n.where?.length?` where ${n.where.map(r=>n.where.length>1?`(${r.expr})`:r.expr).join(" and ")}`:"",o={list:`all('${n.kind}')${t}`,as:n.as??"row"};return n.group&&(o.group=n.group),n.sort&&(o.sort=n.sort.direction?{by:n.sort.by,direction:n.sort.direction}:n.sort.by),o.empty="Nothing here yet.",{name:"blocks",...s,options:{blocks:[o]}}}}}function F(n,e){let{app:s}=e,t=r=>r.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,""),o=new Set(["home","overview",...Q(s,e.views?{views:e.views}:{}).map(r=>r.slug),...(s.lenses??[]).flatMap(r=>r.title?[t(r.title)]:[])]);if(!o.has(t(n)))return n;for(let r=2;;r++)if(!o.has(t(`${n} ${r}`)))return`${n} ${r}`}var en={title:[],headline:[],text:["tone"],figure:["as","currency","label"],list:["sort","limit","group","empty","as"],progress:["label"],group:["direction"],when:["show"],divider:[]};function Ln(n,e){if(!Array.isArray(e)||e.length===0)return"it has no blocks to draw";if(e.length>40)return"it has more blocks than a place draws";let s=(i,a)=>{if(typeof i!="string"||i.trim()==="")return`its ${a} says nothing`;try{return V(i)}catch(l){return`its ${a} does not read: ${l instanceof Error?l.message.replace(/ \(at character.*$/,""):String(l)}`}},t=i=>{if(i.t==="where")return t(i.set);if(i.t==="call"&&i.fn==="all"){let a=i.args[0];return a?.t==="lit"&&typeof a.value=="string"?n.info(a.value)??null:void 0}},o=(i,a)=>{switch(i.t){case"lit":return;case"ident":return a&&!a.fields.some(l=>l.name===i.name)&&!a.edges.some(l=>l.name===i.name)?`${a.plural} have nothing called ${i.name}`:void 0;case"member":return o(i.object,a);case"list":return i.items.map(l=>o(l,a)).find(Boolean);case"unary":return o(i.operand,a);case"binary":return o(i.left,a)??o(i.right,a);case"where":{let l=t(i.set);return l===null?"Nothing by that name here":o(i.set,a)??o(i.filter,l??void 0)}case"call":return i.fn==="all"?t(i)===null?"Nothing by that name here":void 0:i.args.map(l=>o(l,a)).find(Boolean)}},r=(i,a)=>{if(a>4)return"its blocks nest deeper than a place draws";for(let l of i){if(!w(l))return"a block is not an object";let d=Object.keys(en).find(g=>g in l);if(!d)return`"${Object.keys(l)[0]??""}" is not a block a place draws`;let c=Object.keys(l).find(g=>g!==d&&g!=="key"&&!en[d].includes(g));if(c)return`a ${d} block takes no "${c}"`;let u=l[d];if(d==="list"||d==="figure"||d==="when"){if(d==="figure"&&u===!0)continue;let g=s(u,d);if(typeof g=="string")return g;let m=o(g,void 0);if(m)return m;if(d==="list"){let f=t(g);if(f==null)return f===null?"Nothing by that name here":"its list does not say which records it lists, like all('task')";for(let y of["group","sort"]){let p=l[y],S=typeof p=="string"?p:w(p)&&typeof p.by=="string"?p.by:void 0;if(p===void 0)continue;let D=S?f.fields.find(un=>un.name===S):void 0;if(!D)return`${f.plural} have nothing called ${String(S??p)} to ${y} by`;if(y==="group"&&D.type!=="enum")return`${f.plural}' ${D.words} is not a choice, so they cannot be grouped by it`}}if(d==="when"){let f=l.show;if(!Array.isArray(f))return"a when block shows a list of blocks";let y=r(f,a+1);if(y)return y}}else if(d==="group"){if(!Array.isArray(u))return"a group block holds a list of blocks";let g=r(u,a+1);if(g)return g}else{if(d!=="divider"&&typeof u!="string")return`a ${d} block says words`;if(typeof u=="string")for(let g of u.matchAll(/\{([^{}]*)\}/g)){let m=g[1].split(/\|(?![|])/)[0],f=s(m,`${d}'s braces`);if(typeof f=="string")return f;let y=o(f,void 0);if(y)return y}}}};return r(e,1)}function E(n,e,s){let t=O(n.schema,s),o=f=>({ok:!1,failed:`Couldn't draw that: ${f.replace(/\.$/,"")}.`});if(!T(e.name)||e.name==="reach")return o(`"${String(e.name)}" is not a picture the seat can draw; it draws ${H.filter(f=>f!=="reach").join(", ")}`);if(typeof e.title!="string"||e.title.trim().length===0||e.title.length>80)return o("it needs a title of a few words");if(typeof e.on!="string"||!t.tryDefinition(e.on))return o("Nothing by that name here");let r=P[e.name],i=e.bindings??{};if(r.binds==="fields")for(let[f,y]of Object.entries(i)){if(!t.tryDefinition(f))return o("Nothing by that name here");let p=Object.keys(t.tryDefinition(f).fields?.shape??{});for(let[S,D]of Object.entries(y??{}))if(typeof D!="string"||!p.includes(D))return o(`${b(f)} has no field "${String(D)}" for its ${S}`);for(let S of r.requiredRoles)if(!(S in(y??{})))return o(`a ${e.name} needs ${b(f)}'s ${S}`)}else if(r.binds==="entities")for(let f of r.requiredRoles){let y=i[f];if(!y)return o(`a ${e.name} needs its ${f}`);if(typeof y.kind=="string"&&!t.tryDefinition(y.kind))return o("Nothing by that name here")}let a={...n,schema:t,lenses:[...n.lenses??[],e]},l=a.lenses.length-1,d=U(a),c=`lenses.${l}`,u=d.findings.find(f=>f.path===c||f.path.startsWith(`${c}.`));if(u)return o(u.message.replace(/^"[^"]*" /,"it "));let g=d.undrawn.find(f=>f.index===l);if(g)return o(g.why);let m=d.drawn.find(f=>f.index===l);if(!m)return o("its bindings name something the app does not have");if(m.as==="overview")return o(`"${e.title}" is the scene's own address; give it another title`);if(e.name==="blocks"){let f=Ln(j(t),e.options?.blocks);if(f)return o(f)}return{ok:!0,drawn:m}}function G(n){return{op:"add-lens",title:n.title,lens:n.name,on:n.on,...n.bindings?{bindings:n.bindings}:{},...n.options?{options:n.options}:{}}}function In(n){return{op:"remove-lens",title:n.title,on:n.on}}var w=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function ln(n){let e=w(n)?n:{},s=String(e.lens??e.name??""),t=e.bindings,o=typeof e.on=="string"?e.on:w(t)&&P[s]?.binds==="fields"?Object.keys(t)[0]??"":"";return{name:s,title:typeof e.title=="string"?e.title.trim():"",on:o,...w(t)?{bindings:t}:{},...w(e.options)?{options:e.options}:{}}}function On(n){let e=o=>w(n.bindings?.[o])?n.bindings[o]:{},s=o=>typeof o=="string"?o:void 0,t=e(n.on);switch(n.name){case"columns":return s(t.column)?{lens:"columns",kind:n.on,column:t.column}:void 0;case"calendar":{let o=s(n.options?.range);return s(t.start)?{lens:"calendar",kind:n.on,start:t.start,...s(t.end)?{end:t.end}:{},...s(t.done)?{done:t.done}:{},...o?{range:o}:{}}:void 0}case"timeline":return s(t.start)&&s(t.end)&&s(t.column)?{lens:"timeline",kind:n.on,start:t.start,end:t.end,column:t.column}:void 0;case"coverage":{let o=w(n.bindings?.columns)?s(n.bindings.columns.kind):void 0,r=w(n.bindings?.link)?s(n.bindings.link.edge):void 0;return o&&r?{lens:"coverage",kind:n.on,across:o,link:r}:void 0}case"blocks":{let o=n.options?.blocks;if(!Array.isArray(o)||o.length!==1||!w(o[0]))return;let r=o[0],i=new RegExp(`^all\\('${n.on}'\\)(?: where (.+))?$`).exec(String(r.list??""));if(!i)return;let a=r.sort;return{lens:"blocks",kind:n.on,as:r.as==="card"?"card":"row",...typeof r.group=="string"?{group:r.group}:{},...typeof a=="string"?{sort:{by:a}}:w(a)&&typeof a.by=="string"?{sort:{by:a.by,...a.direction==="desc"?{direction:"desc"}:{}}}:{},...i[1]?{where:[{expr:i[1],says:"as asked"}]}:{}}}default:return}}function M(n,e,s,t,o){let r=j(O(n.schema,t)).info(e.on),i=On(e);return{title:e.title,said:`${J[e.name]??"A picture"} of ${r?.plural??b(e.on)}.`,kind:e.on,lens:e,drawn:s,edit:G(e),by:o,asks:[],...i?{recipe:i}:{}}}function tn(n){return{title:n.title,said:n.said,lens:{title:n.lens.title,lens:n.lens.name,on:n.lens.on,...n.lens.bindings?{bindings:n.lens.bindings}:{},...n.lens.options?{options:n.lens.options}:{}},edit:n.edit,by:n.by,check:"It draws, and graview check would take it."}}function C(n,e,s,t,o){let r=Rn(n,e),i=n.title??o??F(r.title,s),a=An(n,i),l=E(s.app,a,s.sight);return l.ok?{title:i,said:`${J[n.lens]} ${r.detail}.`,kind:n.kind,lens:a,drawn:l.drawn,edit:G(a),by:"template",asks:t,recipe:n}:{failed:l.failed,...s.lastGood?{lastGood:s.lastGood}:{}}}function zn(n,e){let s=j(O(e.app.schema,e.sight)),t=s.info(n.kind);if(!t)return{failed:"Couldn't draw that: Nothing by that name here."};let o=n.lens==="blocks"&&!n.group&&!n.sort&&!n.where?.length&&n.title===void 0;return C(o?{...n,title:F(`Every ${t.noun}`,e)}:n,s,e,[])}function jn(n,e,s,t){if(s.length>0)return s;let o=i=>{switch(n){case"columns":return i.fields.some(a=>a.type==="enum");case"calendar":return i.fields.some(R);case"timeline":return an(i)!==void 0||i.fields.some(R);case"coverage":return i.edges.some(a=>a.to.some(l=>l!==i.kind));case"board":return i.fields.some(a=>a.name==="x")&&i.fields.some(a=>a.name==="y");case"plan":return i.fields.some(a=>a.name==="outline")||i.roles.outline!==void 0;default:return!0}};return[...e.kinds.filter(o)].sort((i,a)=>Number(a.fields.some(l=>A(t,l.words)))-Number(i.fields.some(l=>A(t,l.words))))}function xn(n,e){let s=j(O(e.app.schema,e.sight)),t=sn(n),o=Sn(t);if(o.length===0)return;let r=yn(t,s),i;for(let a of o){let l=a==="coverage"?[r[0]??s.kinds[0]].filter(d=>!!d):jn(a,s,r,t);for(let d of l)try{let c=dn(a,d,s,t,r),u=C(c,s,e,[n]);if(!x(u))return u;i??=u.failed}catch(c){if(!(c instanceof N))throw c;i??=`Couldn't draw that: ${c.message}.`}l.length===0&&r.length===0&&(i??=`Couldn't draw that: nothing here has what ${J[a].toLowerCase()} needs.`)}return{failed:i??"Couldn't draw that: Nothing by that name here.",...e.lastGood?{lastGood:e.lastGood}:{}}}async function Nn(n,e){let s=e.lastGood?{lastGood:e.lastGood}:{};if(n.trim().length===0)return{failed:"Say what you would like to see, like \u201Ca board of tasks by status\u201D.",...s};let t=xn(n,e);if(t&&!x(t))return t;if(!e.complete)return t??{failed:"Couldn't draw that: drawing freely needs AI, which isn't on here. Ask for a board, a calendar, a timeline, a list or who covers what.",...s};let o=await cn(n,e,void 0);return x(o)&&t?t:o}async function En(n,e,s){let t={lastGood:n},o={...s,lastGood:n},r=j(O(s.app.schema,s.sight)),i=sn(e),a=r.info(n.kind),l=[...n.asks,e];if(!a)return{failed:"Couldn't change that: Nothing by that name here.",...t};let d=n.recipe,c=/^ (?:call|name|title) (?:it|this)? ?(.+?) $/.exec(i)??/ (?:call|name) it (.+?) $/.exec(i);try{if(c){let m=e.replace(/^.*?\b(?:call|name|title)\b\s*(?:it|this)?\s*/i,"").replace(/^["“']|["”']$/g,"").trim();if(m.length===0)return{failed:"Couldn't change that: say what to call it.",...t};let f={...n.lens,title:F(m,s)},y=E(s.app,f,s.sight);return y.ok?{...n,title:f.title,lens:f,drawn:y.drawn,edit:G(f),asks:l,...d?{recipe:{...d,title:f.title}}:{}}:{failed:y.failed,...t}}let g=/ as (?:a |an )?(board|kanban|calendar|timeline|list|table|cards|rows|grid|plan|layout)\b/.exec(i);if(g){let m=g[1]==="board"||g[1]==="kanban"?"columns":g[1]==="calendar"?"calendar":g[1]==="timeline"?"timeline":g[1]==="grid"?"coverage":g[1]==="plan"?"plan":g[1]==="layout"?"board":"blocks",f=dn(m,a,r,i,[a]),y=g[1]==="cards"?"card":g[1]==="rows"?"row":void 0,p=m==="blocks"&&d?.lens==="blocks"?{...d,...y?{as:y}:{}}:m==="blocks"&&d?.lens==="columns"?{...f,group:d.column,...y?{as:y}:{}}:f;return C(v(p),r,o,l)}if(d){let m=Kn(d,a,r,i);if(m)return C(m,r,o,l)}}catch(g){if(!(g instanceof N))throw g;return{failed:`Couldn't change that: ${g.message}.`,...t}}if(!s.complete)return{failed:"Couldn't change that: changing it freely needs AI, which isn't on here. Try \u201Cgroup by status\u201D, \u201Conly this month\u201D or \u201Cas a calendar\u201D.",...t};let u=await cn(e,o,n);return x(u)?u:{...u,asks:l}}var v=n=>{let{title:e,...s}=n;return s};function Kn(n,e,s,t){let o=/ (?:group(?:ed)?|split|organi[sz]ed?|put them|columns) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1]??(/^ by /.test(t)?W(t):void 0);if(o){let d=I(e,o);if(d?.type==="enum")return n.lens==="blocks"?{...v(n),group:d.name}:{lens:"columns",kind:n.kind,column:d.name};let c=rn(e,o,s);return c?{lens:"coverage",kind:n.kind,across:c.to[0],link:c.name}:h(d?`${e.plural}' ${d.words} is not a choice, so they cannot be grouped by it`:`${e.plural} have nothing called ${o} to group by`)}let r=/ (?:sort(?:ed)?|order(?:ed)?) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1];if(r){let d=I(e,r);return d?{...n.lens==="blocks"?v(n):{lens:"blocks",kind:n.kind,as:"row",...n.lens==="columns"?{group:n.column}:{}},sort:{by:d.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}:h(`${e.plural} have nothing called ${r} to sort by`)}if(/\b(?:all of them|everything|show all|clear the filter|no filter|without the filter)\b/.test(t)){if(n.lens!=="blocks"||!n.where)return h("it already shows all of them");let{where:d,...c}=v(n);return c}let i=on(t);if(i&&n.lens==="calendar"&&i.range)return{...v(n),range:i.range};if(i&&n.lens==="calendar"&&!i.range)return{lens:"blocks",kind:n.kind,as:"row",sort:{by:n.start},where:q(e,t)};let a=q(e,t);if(a.length>0){let d=n.lens==="blocks"?v(n):{lens:"blocks",kind:n.kind,as:"row",...n.lens==="columns"?{group:n.column}:{}};return{...d,where:[...d.where??[],...a]}}let l=n.lens==="calendar"?_(t):void 0;if(l)return{...v(n),range:l}}function Cn(n){return n.kinds.map(e=>{let s=e.fields.map(r=>`${r.name} (${r.type??"value"}${r.options?`: ${r.options.join(" | ")}`:""})`).join(", "),t=e.edges.map(r=>`${r.name} \u2192 ${r.to.join(" | ")}`).join(", "),o=Object.entries(e.roles).map(([r,i])=>`${r}=${i}`).join(", ");return`- ${e.kind} ("${e.plural}"): ${s}${t?`; relations: ${t}`:""}${o?`; roles: ${o}`:""}`}).join(`
1
+ import{a as k}from"./chunk.G4JJXA63.js";import{b as Q}from"./chunk.7KX36ENH.js";import{a as Z}from"./chunk.SPJ34VHA.js";import{a as Y}from"./chunk.U5KJQFAP.js";import{c as V}from"./chunk.W6L2VAJG.js";import{fb as z,jb as B,ke as P,me as H,ne as T,oe as U}from"./chunk.6L6RUOSF.js";var x=n=>"failed"in n;function fn(n,e){let s=n.schema.kinds,t=n.policy?.sees;if(!t?.length||B(e))return{kinds:s};let o=z(e).roles??[],r=new Set(t.filter(i=>i.roles==="*"||o.some(a=>i.roles.includes(a))).flatMap(i=>i.kinds));return{kinds:s.filter(i=>r.has(i))}}function O(n,e){if(!e)return n;let s=new Set(e.kinds.filter(r=>n.tryDefinition(r)!==void 0));if(s.size===n.kinds.length)return n;let t=new Map,o=r=>{if(s.has(r)){if(!t.has(r)){let i=n.tryDefinition(r),a=Object.fromEntries(Object.entries(i?.edges??{}).flatMap(([l,d])=>{if(d.to==="*")return[[l,d]];let c=d.to.filter(u=>s.has(u));return c.length>0?[[l,{...d,to:c}]]:[]}));t.set(r,{...i,edges:a})}return t.get(r)}};return{...n,definitions:n.definitions.filter(r=>s.has(r.kind)),kinds:n.kinds.filter(r=>s.has(r)),tryDefinition:o,definition:r=>{let i=o(r);if(!i)throw new Error(`Unknown node kind "${r}"`);return i}}}var gn=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),b=n=>gn(n).replace(/[-_]+/g," ").trim();function j(n){let e=[];for(let t of n.kinds){let o=n.tryDefinition(t);if(!o)continue;let r=o.display?.labels??{},i=Object.entries(o.fields?.shape??{}).filter(([d])=>d!=="id"&&d!=="kind").map(([d,c])=>{let u=Y(c);return{name:d,type:u?.type==="enum"&&u.multiple?"list":u?.type,...u?.options?{options:u.options}:{},words:(r[d]??b(d)).toLowerCase()}}),a=Object.entries(o.edges??{}).map(([d,c])=>({name:d,from:t,to:c.to==="*"?n.kinds.filter(u=>u!==t):c.to,words:b(d)})),l=(o.plural??`${b(t)}s`).toLowerCase();e.push({kind:t,plural:l,noun:(o.noun??b(t)).toLowerCase(),fields:i,roles:o.fieldRoles??{},edges:a})}let s=new Map(e.map(t=>[t.kind,t]));return{schema:n,kinds:e,info:t=>s.get(t)}}var $=(n,e)=>e===void 0?void 0:n.fields.find(s=>s.name===e),R=n=>n?.type==="date"||n?.type==="datetime",K=n=>n?.type==="number"||n?.type==="integer"||n?.type==="duration",sn=n=>` ${n.toLowerCase().replace(/[“”"’‘]/g,"'").replace(/[^\p{L}\p{N}' -]+/gu," ").replace(/\s+/g," ").trim()} `,A=(n,e)=>n.includes(` ${e} `),L=n=>n.endsWith("ies")?`${n.slice(0,-3)}y`:n.endsWith("ses")?n.slice(0,-2):n.endsWith("s")?n.slice(0,-1):n;function yn(n,e){let s=[];for(let t of e.kinds){let o=new Set([t.plural,t.noun,`${t.noun}s`,b(t.kind),`${b(t.kind)}s`]),r=-1;for(let i of o){let a=n.indexOf(` ${i} `);a>=0&&(r<0||a<r)&&(r=a)}r>=0&&s.push({info:t,at:r})}return s.sort((t,o)=>t.at-o.at).map(t=>t.info)}function I(n,e,s){let t=e.trim().toLowerCase();if(t.length===0)return;let o=n.fields.filter(r=>!s||s(r));return o.find(r=>r.words===t||b(r.name)===t||r.name.toLowerCase()===t)??o.find(r=>r.words===L(t)||b(r.name)===L(t))??o.find(r=>t.split(" ").some(i=>i.length>2&&(r.words.split(" ").includes(i)||r.words.split(" ").includes(L(i)))))}function rn(n,e,s){let t=e.trim().toLowerCase();if(t.length!==0)return n.edges.find(o=>o.words===t||o.name.toLowerCase()===t)??n.edges.find(o=>o.to.some(r=>{let i=s.info(r);return i!==void 0&&(i.noun===L(t)||i.plural===t||b(r)===L(t))}))??n.edges.find(o=>t.split(" ").some(r=>r.length>2&&o.words.split(" ").includes(r)))}function W(n){return/ (?:grouped |group |split |sorted |organi[sz]ed )?by ([\p{L}\p{N}' -]+?)(?= (?:and|with|for|in|on|only|where|from|this|that|as|sorted|grouped) |\s*$)/u.exec(n)?.[1]?.trim()}var mn=/\bwho\b.*\b(covers?|cover|tends?|owns?|handles?|does|works? on|looks? after|is on|is assigned|staffs?|runs?)\b|\bcoverage\b|\bmatrix\b|\bwho covers\b/,bn=/\bcalendar\b|\bmonth\b|\bagenda\b|\bschedule\b|\bdue\b|\bdeadlines?\b|\bdates?\b|\bwhen\b/,hn=/\btimeline\b|\bover time\b|\bgantt\b|\bspans?\b|\bweek\b/,pn=/\bboard\b|\bkanban\b|\bcolumns?\b|\bpipeline\b|\bstages?\b|\bstatus\b/,wn=/\blaid out\b|\blayout\b|\bseating\b|\bwhere (?:they|it|each) (?:sits?|lies?|stands?)\b|\bfloor\b/,kn=/\bplan\b|\bmap\b|\bregions?\b/,$n=/\blist\b|\btable\b|\bgroup(?:ed)? by\b|\bsort(?:ed)? by\b|\bonly\b|\bjust the\b/;function Sn(n){let e=[];return/\blist\b|\btable\b/.test(n)&&e.push("blocks"),mn.test(n)&&e.push("coverage"),wn.test(n)&&e.push("board"),(/\bfloor plan\b/.test(n)||kn.test(n))&&e.push("plan"),hn.test(n)&&e.push("timeline"),bn.test(n)&&e.push("calendar"),pn.test(n)&&e.push("columns"),$n.test(n)&&!e.includes("blocks")&&e.push("blocks"),e.length===0&&W(n)&&e.push("columns"),e}var on=n=>{let e=s=>s?` and not ${s}`:"";if(/\boverdue\b|\blate\b|\bpast due\b/.test(n))return{cond:(s,t)=>`days(today(), ${s}) < 0${e(t)}`,says:s=>`overdue by ${s.words}`};if(/\btoday\b/.test(n))return{range:"day",cond:s=>`days(today(), ${s}) == 0`,says:s=>`with ${s.words} today`};if(/\bthis week\b|\bnext 7 days\b|\bnext week\b/.test(n))return{range:"week",cond:s=>`days(today(), ${s}) >= 0 and days(today(), ${s}) <= 6`,says:s=>`with ${s.words} in the next week`};if(/\bthis month\b|\bnext 30 days\b|\bnext month\b/.test(n))return{range:"month",cond:s=>`days(today(), ${s}) >= 0 and days(today(), ${s}) <= 30`,says:s=>`with ${s.words} in the next month`};if(/\blast month\b|\bpast month\b/.test(n))return{range:"month",cond:s=>`days(today(), ${s}) >= -30 and days(today(), ${s}) <= 0`,says:s=>`with ${s.words} in the last month`};if(/\bthis year\b/.test(n))return{range:"year",cond:s=>`days(today(), ${s}) >= 0 and days(today(), ${s}) <= 365`,says:s=>`with ${s.words} in the next year`};if(/\bquarter\b/.test(n))return{range:"quarter",cond:s=>`days(today(), ${s}) >= 0 and days(today(), ${s}) <= 91`,says:s=>`with ${s.words} in the next quarter`}},_=n=>{if(/\bagenda\b|\bin order\b/.test(n))return"agenda";if(/\btoday\b|\bday\b/.test(n))return"day";if(/\bweek\b/.test(n))return"week";if(/\bquarter\b/.test(n))return"quarter";if(/\byears\b/.test(n))return"years";if(/\byear\b/.test(n))return"year";if(/\bmonth\b/.test(n))return"month"},X=/^(user|person|people|member|staff|gardener|volunteer|owner|agent|employee|worker|team|player|customer|client|contact|party|attendee|guest)s?$/,N=class extends Error{},h=n=>{throw new N(n)};function Dn(n,e){let s=n.fields.filter(r=>r.type==="enum");if(e){let r=I(n,e);if(r&&r.type==="enum")return r;r&&h(`${n.plural}' ${r.words} is not a choice, so it has no columns`)}let t=$(n,n.roles.status??n.roles.column);if(t?.type==="enum")return t;let o=s.find(r=>/^(status|stage|state|phase)$/.test(r.name));return o||(s[0]?s[0]:h(`${n.plural} have no choice field to put in columns`))}function nn(n,e){let s=n.fields.filter(R),t=l=>{let d=$(n,n.roles[l]);return R(d)?d:void 0},r=s.find(l=>A(e,l.words)||A(e,b(l.name)))??t("start")??s.find(l=>/^(due|date|on|at|start|starts|begins|from|sown|when)/i.test(l.name))??s[0];if(!r)return h(`no date field on ${n.plural}`);let i=t("end")??s.find(l=>l!==r&&/^(end|ends|until|to|finish|finished|harvested|due|closes|through)/i.test(l.name)),a=n.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));return{start:r,...i&&i!==r?{end:i}:{},...a?{done:a}:{}}}function an(n){let e=$(n,n.roles.start),s=$(n,n.roles.end),t=$(n,n.roles.column??n.roles.day??n.roles.columns);if(K(e)&&K(s)&&t?.type==="enum")return{start:e,end:s,column:t}}function vn(n,e,s,t){let o=[];for(let i of n.kinds)for(let a of i.edges)for(let l of a.to){let d=n.info(l);if(!d||d.kind===i.kind)continue;let c=0;e.includes(i)&&(c+=4),e.includes(d)&&(c+=4),(X.test(d.kind)||X.test(d.noun))&&(c+=3),t&&(a.words.includes(t)||d.noun===L(t))&&(c+=5),a.words.split(" ").some(u=>u.length>2&&s.includes(` ${u}`))&&(c+=2),o.push({rows:i,across:d,link:a,score:c})}let r=o.sort((i,a)=>a.score-i.score)[0];return r||h(e[0]?`${e[0].plural} are joined to nothing else, so there is no who-covers-what to draw`:"nothing here is joined to anything else, so there is no who-covers-what to draw")}function dn(n,e,s,t,o){let r=W(t);switch(n){case"columns":{if(r){let i=I(e,r);if(!i||i.type!=="enum"){let a=rn(e,r,s);if(a){let l=s.info(a.to[0]);return{lens:"coverage",kind:e.kind,across:l.kind,link:a.name}}}}return{lens:"columns",kind:e.kind,column:Dn(e,r).name}}case"calendar":{let i=nn(e,t),a=_(t);return{lens:"calendar",kind:e.kind,start:i.start.name,...i.end?{end:i.end.name}:{},...i.done?{done:i.done.name}:{},...a?{range:a}:{}}}case"timeline":{let i=an(e);if(i&&!/\bdates?\b|\bdue\b|\bdeadlines?\b|\bmonths?\b|\byears?\b/.test(t))return{lens:"timeline",kind:e.kind,start:i.start.name,end:i.end.name,column:i.column.name};let a=nn(e,t);return{lens:"calendar",kind:e.kind,start:a.start.name,...a.end?{end:a.end.name}:{},...a.done?{done:a.done.name}:{},range:_(t)??"quarter"}}case"coverage":{let i=vn(s,o,t,r);return{lens:"coverage",kind:i.rows.kind,across:i.across.kind,link:i.link.name}}case"board":{let i=$(e,e.roles.x)??e.fields.find(c=>c.name==="x"),a=$(e,e.roles.y)??e.fields.find(c=>c.name==="y");if(!K(i)||!K(a))return h(`${e.plural} have no x and y to be laid out by`);let d=s.kinds.flatMap(c=>c.edges.filter(u=>u.to.includes(e.kind)&&c.kind!==e.kind))[0]??e.edges[0];return d?{lens:"board",kind:e.kind,x:i.name,y:a.name,fill:d.name,...d.from!==e.kind?{fillFrom:"occupant"}:{}}:h(`nothing is joined to ${e.plural} to fill them`)}case"plan":{let i=$(e,e.roles.outline)??e.fields.find(a=>a.name==="outline");return i?{lens:"plan",kind:e.kind,outline:i.name}:h(`${e.plural} have no outline to draw a plan from`)}case"blocks":{let i={lens:"blocks",kind:e.kind,as:/\bcards?\b/.test(t)?"card":"row"},a=/ group(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|sorted|with)|\s*$)/u.exec(t)?.[1]??(r&&!/ sort(?:ed)? by /.test(t)?r:void 0);if(a){let c=I(e,a);if(!c||c.type!=="enum")return h(c?`${e.plural}' ${c.words} is not a choice, so they cannot be grouped by it`:`${e.plural} have nothing called ${a} to group by`);i.group=c.name}let l=/ sort(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|grouped|with)|\s*$)/u.exec(t)?.[1];if(l){let c=I(e,l);if(!c)return h(`${e.plural} have nothing called ${l} to sort by`);i.sort={by:c.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}let d=q(e,t);return d.length>0&&(i.where=d),i}}}function q(n,e){let s=[],t=on(e);if(t){let o=n.fields.filter(R),r=$(n,n.roles.start),i=o.find(l=>A(e,l.words))??(R(r)?r:void 0)??o[0];(!i||!R(i))&&h(`no date field on ${n.plural}`);let a=n.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));s.push({expr:t.cond(i.name,/\boverdue\b|\blate\b|\bpast due\b/.test(e)?a?.name:void 0),says:t.says(i)})}if(/\bonly\b|\bjust\b|\bthat are\b|\bwhich are\b/.test(e)){for(let o of n.fields){if(o.type!=="enum")continue;let r=o.options?.find(i=>A(e,i.toLowerCase())||A(e,b(i)));r&&s.push({expr:`${o.name} == '${r.replace(/'/g,"")}'`,says:`that are ${b(r)}`})}if(/\bnot done\b|\bundone\b|\bunfinished\b|\bopen ones\b|\bstill to do\b/.test(e)){let o=n.fields.find(r=>r.type==="boolean"&&/^(done|finished|complete|completed)$/.test(r.name));o&&s.push({expr:`not ${o.name}`,says:`not ${o.words}`})}}return s}var J={columns:"A board",calendar:"A calendar",timeline:"A timeline",coverage:"A grid",board:"A layout",plan:"A plan",blocks:"A list",reach:"A picture"};function Rn(n,e){let s=e.info(n.kind),t=o=>o?$(s,o)?.words??b(o):"";switch(n.lens){case"columns":return{title:`${k(s.plural)} by ${t(n.column)}`,detail:`of ${s.plural} by ${t(n.column)}`};case"calendar":{let o=n.range??"month";if(o==="agenda")return{title:`${k(s.plural)} in date order`,detail:`of ${s.plural} in order of ${t(n.start)}`};let r=o==="years"?"year":o;return{title:`${k(s.plural)} by ${r}`,detail:`of ${s.plural} by ${t(n.start)}, a ${r} at a time`}}case"timeline":return{title:`${k(s.plural)} over the ${t(n.column)}`,detail:`of ${s.plural} from ${t(n.start)} to ${t(n.end)}, by ${t(n.column)}`};case"coverage":{let o=e.info(n.across);return{title:`${k(s.plural)} by ${o.noun}`,detail:`of which ${o.noun} covers which ${s.noun}`}}case"board":return{title:`${k(s.plural)} where they stand`,detail:`of ${s.plural} where they stand`};case"plan":return{title:`${k(s.plural)} on a plan`,detail:`of ${s.plural}`};default:{let o=[n.where?.map(r=>r.says).join(" and "),n.group?`by ${t(n.group)}`:void 0,n.sort?`in order of ${t(n.sort.by)}`:void 0].filter(r=>!!r);return{title:[k(s.plural),...o].join(" "),detail:[`of ${s.plural}`,...o].join(" ")}}}}function An(n,e){let s={title:e,on:n.kind};switch(n.lens){case"columns":return{name:"columns",...s,bindings:{[n.kind]:{column:n.column}}};case"calendar":return{name:"calendar",...s,bindings:{[n.kind]:{start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{}}},...n.range?{options:{range:n.range}}:{}};case"timeline":return{name:"timeline",...s,bindings:{[n.kind]:{start:n.start,end:n.end,column:n.column}}};case"coverage":return{name:"coverage",...s,bindings:{rows:{kind:n.kind},columns:{kind:n.across},link:{edge:n.link}}};case"board":return{name:"board",...s,bindings:{slots:{kind:n.kind},x:{field:n.x,on:"slots"},y:{field:n.y,on:"slots"},fill:{edge:n.fill}},...n.fillFrom?{options:{fillFrom:n.fillFrom}}:{}};case"plan":return{name:"plan",...s,bindings:{regions:{kind:n.kind},outline:{field:n.outline,on:"regions"}}};default:{let t=n.where?.length?` where ${n.where.map(r=>n.where.length>1?`(${r.expr})`:r.expr).join(" and ")}`:"",o={list:`all('${n.kind}')${t}`,as:n.as??"row"};return n.group&&(o.group=n.group),n.sort&&(o.sort=n.sort.direction?{by:n.sort.by,direction:n.sort.direction}:n.sort.by),o.empty="Nothing here yet.",{name:"blocks",...s,options:{blocks:[o]}}}}}function F(n,e){let{app:s}=e,t=r=>r.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,""),o=new Set(["home","overview",...Q(s,e.views?{views:e.views}:{}).map(r=>r.slug),...(s.lenses??[]).flatMap(r=>r.title?[t(r.title)]:[])]);if(!o.has(t(n)))return n;for(let r=2;;r++)if(!o.has(t(`${n} ${r}`)))return`${n} ${r}`}var en={title:[],headline:[],text:["tone"],figure:["as","currency","label"],list:["sort","limit","group","empty","as"],progress:["label"],group:["direction"],when:["show"],divider:[]};function Ln(n,e){if(!Array.isArray(e)||e.length===0)return"it has no blocks to draw";if(e.length>40)return"it has more blocks than a place draws";let s=(i,a)=>{if(typeof i!="string"||i.trim()==="")return`its ${a} says nothing`;try{return V(i)}catch(l){return`its ${a} does not read: ${l instanceof Error?l.message.replace(/ \(at character.*$/,""):String(l)}`}},t=i=>{if(i.t==="where")return t(i.set);if(i.t==="call"&&i.fn==="all"){let a=i.args[0];return a?.t==="lit"&&typeof a.value=="string"?n.info(a.value)??null:void 0}},o=(i,a)=>{switch(i.t){case"lit":return;case"ident":return a&&!a.fields.some(l=>l.name===i.name)&&!a.edges.some(l=>l.name===i.name)?`${a.plural} have nothing called ${i.name}`:void 0;case"member":return o(i.object,a);case"list":return i.items.map(l=>o(l,a)).find(Boolean);case"unary":return o(i.operand,a);case"binary":return o(i.left,a)??o(i.right,a);case"where":{let l=t(i.set);return l===null?"Nothing by that name here":o(i.set,a)??o(i.filter,l??void 0)}case"call":return i.fn==="all"?t(i)===null?"Nothing by that name here":void 0:i.args.map(l=>o(l,a)).find(Boolean)}},r=(i,a)=>{if(a>4)return"its blocks nest deeper than a place draws";for(let l of i){if(!w(l))return"a block is not an object";let d=Object.keys(en).find(g=>g in l);if(!d)return`"${Object.keys(l)[0]??""}" is not a block a place draws`;let c=Object.keys(l).find(g=>g!==d&&g!=="key"&&!en[d].includes(g));if(c)return`a ${d} block takes no "${c}"`;let u=l[d];if(d==="list"||d==="figure"||d==="when"){if(d==="figure"&&u===!0)continue;let g=s(u,d);if(typeof g=="string")return g;let m=o(g,void 0);if(m)return m;if(d==="list"){let f=t(g);if(f==null)return f===null?"Nothing by that name here":"its list does not say which records it lists, like all('task')";for(let y of["group","sort"]){let p=l[y],S=typeof p=="string"?p:w(p)&&typeof p.by=="string"?p.by:void 0;if(p===void 0)continue;let D=S?f.fields.find(un=>un.name===S):void 0;if(!D)return`${f.plural} have nothing called ${String(S??p)} to ${y} by`;if(y==="group"&&D.type!=="enum")return`${f.plural}' ${D.words} is not a choice, so they cannot be grouped by it`}}if(d==="when"){let f=l.show;if(!Array.isArray(f))return"a when block shows a list of blocks";let y=r(f,a+1);if(y)return y}}else if(d==="group"){if(!Array.isArray(u))return"a group block holds a list of blocks";let g=r(u,a+1);if(g)return g}else{if(d!=="divider"&&typeof u!="string")return`a ${d} block says words`;if(typeof u=="string")for(let g of u.matchAll(/\{([^{}]*)\}/g)){let m=g[1].split(/\|(?![|])/)[0],f=s(m,`${d}'s braces`);if(typeof f=="string")return f;let y=o(f,void 0);if(y)return y}}}};return r(e,1)}function E(n,e,s){let t=O(n.schema,s),o=f=>({ok:!1,failed:`Couldn't draw that: ${f.replace(/\.$/,"")}.`});if(!T(e.name)||e.name==="reach")return o(`"${String(e.name)}" is not a picture the seat can draw; it draws ${H.filter(f=>f!=="reach").join(", ")}`);if(typeof e.title!="string"||e.title.trim().length===0||e.title.length>80)return o("it needs a title of a few words");if(typeof e.on!="string"||!t.tryDefinition(e.on))return o("Nothing by that name here");let r=P[e.name],i=e.bindings??{};if(r.binds==="fields")for(let[f,y]of Object.entries(i)){if(!t.tryDefinition(f))return o("Nothing by that name here");let p=Object.keys(t.tryDefinition(f).fields?.shape??{});for(let[S,D]of Object.entries(y??{}))if(typeof D!="string"||!p.includes(D))return o(`${b(f)} has no field "${String(D)}" for its ${S}`);for(let S of r.requiredRoles)if(!(S in(y??{})))return o(`a ${e.name} needs ${b(f)}'s ${S}`)}else if(r.binds==="entities")for(let f of r.requiredRoles){let y=i[f];if(!y)return o(`a ${e.name} needs its ${f}`);if(typeof y.kind=="string"&&!t.tryDefinition(y.kind))return o("Nothing by that name here")}let a={...n,schema:t,lenses:[...n.lenses??[],e]},l=a.lenses.length-1,d=U(a),c=`lenses.${l}`,u=d.findings.find(f=>f.path===c||f.path.startsWith(`${c}.`));if(u)return o(u.message.replace(/^"[^"]*" /,"it "));let g=d.undrawn.find(f=>f.index===l);if(g)return o(g.why);let m=d.drawn.find(f=>f.index===l);if(!m)return o("its bindings name something the app does not have");if(m.as==="overview")return o(`"${e.title}" is the scene's own address; give it another title`);if(e.name==="blocks"){let f=Ln(j(t),e.options?.blocks);if(f)return o(f)}return{ok:!0,drawn:m}}function G(n){return{op:"add-lens",title:n.title,lens:n.name,on:n.on,...n.bindings?{bindings:n.bindings}:{},...n.options?{options:n.options}:{}}}function In(n){return{op:"remove-lens",title:n.title,on:n.on}}var w=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function ln(n){let e=w(n)?n:{},s=String(e.lens??e.name??""),t=e.bindings,o=typeof e.on=="string"?e.on:w(t)&&P[s]?.binds==="fields"?Object.keys(t)[0]??"":"";return{name:s,title:typeof e.title=="string"?e.title.trim():"",on:o,...w(t)?{bindings:t}:{},...w(e.options)?{options:e.options}:{}}}function On(n){let e=o=>w(n.bindings?.[o])?n.bindings[o]:{},s=o=>typeof o=="string"?o:void 0,t=e(n.on);switch(n.name){case"columns":return s(t.column)?{lens:"columns",kind:n.on,column:t.column}:void 0;case"calendar":{let o=s(n.options?.range);return s(t.start)?{lens:"calendar",kind:n.on,start:t.start,...s(t.end)?{end:t.end}:{},...s(t.done)?{done:t.done}:{},...o?{range:o}:{}}:void 0}case"timeline":return s(t.start)&&s(t.end)&&s(t.column)?{lens:"timeline",kind:n.on,start:t.start,end:t.end,column:t.column}:void 0;case"coverage":{let o=w(n.bindings?.columns)?s(n.bindings.columns.kind):void 0,r=w(n.bindings?.link)?s(n.bindings.link.edge):void 0;return o&&r?{lens:"coverage",kind:n.on,across:o,link:r}:void 0}case"blocks":{let o=n.options?.blocks;if(!Array.isArray(o)||o.length!==1||!w(o[0]))return;let r=o[0],i=new RegExp(`^all\\('${n.on}'\\)(?: where (.+))?$`).exec(String(r.list??""));if(!i)return;let a=r.sort;return{lens:"blocks",kind:n.on,as:r.as==="card"?"card":"row",...typeof r.group=="string"?{group:r.group}:{},...typeof a=="string"?{sort:{by:a}}:w(a)&&typeof a.by=="string"?{sort:{by:a.by,...a.direction==="desc"?{direction:"desc"}:{}}}:{},...i[1]?{where:[{expr:i[1],says:"as asked"}]}:{}}}default:return}}function M(n,e,s,t,o){let r=j(O(n.schema,t)).info(e.on),i=On(e);return{title:e.title,said:`${J[e.name]??"A picture"} of ${r?.plural??b(e.on)}.`,kind:e.on,lens:e,drawn:s,edit:G(e),by:o,asks:[],...i?{recipe:i}:{}}}function tn(n){return{title:n.title,said:n.said,lens:{title:n.lens.title,lens:n.lens.name,on:n.lens.on,...n.lens.bindings?{bindings:n.lens.bindings}:{},...n.lens.options?{options:n.lens.options}:{}},edit:n.edit,by:n.by,check:"It draws, and graview check would take it."}}function C(n,e,s,t,o){let r=Rn(n,e),i=n.title??o??F(r.title,s),a=An(n,i),l=E(s.app,a,s.sight);return l.ok?{title:i,said:`${J[n.lens]} ${r.detail}.`,kind:n.kind,lens:a,drawn:l.drawn,edit:G(a),by:"template",asks:t,recipe:n}:{failed:l.failed,...s.lastGood?{lastGood:s.lastGood}:{}}}function zn(n,e){let s=j(O(e.app.schema,e.sight)),t=s.info(n.kind);if(!t)return{failed:"Couldn't draw that: Nothing by that name here."};let o=n.lens==="blocks"&&!n.group&&!n.sort&&!n.where?.length&&n.title===void 0;return C(o?{...n,title:F(`Every ${t.noun}`,e)}:n,s,e,[])}function jn(n,e,s,t){if(s.length>0)return s;let o=i=>{switch(n){case"columns":return i.fields.some(a=>a.type==="enum");case"calendar":return i.fields.some(R);case"timeline":return an(i)!==void 0||i.fields.some(R);case"coverage":return i.edges.some(a=>a.to.some(l=>l!==i.kind));case"board":return i.fields.some(a=>a.name==="x")&&i.fields.some(a=>a.name==="y");case"plan":return i.fields.some(a=>a.name==="outline")||i.roles.outline!==void 0;default:return!0}};return[...e.kinds.filter(o)].sort((i,a)=>Number(a.fields.some(l=>A(t,l.words)))-Number(i.fields.some(l=>A(t,l.words))))}function xn(n,e){let s=j(O(e.app.schema,e.sight)),t=sn(n),o=Sn(t);if(o.length===0)return;let r=yn(t,s),i;for(let a of o){let l=a==="coverage"?[r[0]??s.kinds[0]].filter(d=>!!d):jn(a,s,r,t);for(let d of l)try{let c=dn(a,d,s,t,r),u=C(c,s,e,[n]);if(!x(u))return u;i??=u.failed}catch(c){if(!(c instanceof N))throw c;i??=`Couldn't draw that: ${c.message}.`}l.length===0&&r.length===0&&(i??=`Couldn't draw that: nothing here has what ${J[a].toLowerCase()} needs.`)}return{failed:i??"Couldn't draw that: Nothing by that name here.",...e.lastGood?{lastGood:e.lastGood}:{}}}async function Nn(n,e){let s=e.lastGood?{lastGood:e.lastGood}:{};if(n.trim().length===0)return{failed:"Say what you would like to see, like \u201Ca board of tasks by status\u201D.",...s};let t=xn(n,e);if(t&&!x(t))return t;if(!e.complete)return t??{failed:"Couldn't draw that: drawing freely needs AI, which isn't on here. Ask for a board, a calendar, a timeline, a list or who covers what.",...s};let o=await cn(n,e,void 0);return x(o)&&t?t:o}async function En(n,e,s){let t={lastGood:n},o={...s,lastGood:n},r=j(O(s.app.schema,s.sight)),i=sn(e),a=r.info(n.kind),l=[...n.asks,e];if(!a)return{failed:"Couldn't change that: Nothing by that name here.",...t};let d=n.recipe,c=/^ (?:call|name|title) (?:it|this)? ?(.+?) $/.exec(i)??/ (?:call|name) it (.+?) $/.exec(i);try{if(c){let m=e.replace(/^.*?\b(?:call|name|title)\b\s*(?:it|this)?\s*/i,"").replace(/^["“']|["”']$/g,"").trim();if(m.length===0)return{failed:"Couldn't change that: say what to call it.",...t};let f={...n.lens,title:F(m,s)},y=E(s.app,f,s.sight);return y.ok?{...n,title:f.title,lens:f,drawn:y.drawn,edit:G(f),asks:l,...d?{recipe:{...d,title:f.title}}:{}}:{failed:y.failed,...t}}let g=/ as (?:a |an )?(board|kanban|calendar|timeline|list|table|cards|rows|grid|plan|layout)\b/.exec(i);if(g){let m=g[1]==="board"||g[1]==="kanban"?"columns":g[1]==="calendar"?"calendar":g[1]==="timeline"?"timeline":g[1]==="grid"?"coverage":g[1]==="plan"?"plan":g[1]==="layout"?"board":"blocks",f=dn(m,a,r,i,[a]),y=g[1]==="cards"?"card":g[1]==="rows"?"row":void 0,p=m==="blocks"&&d?.lens==="blocks"?{...d,...y?{as:y}:{}}:m==="blocks"&&d?.lens==="columns"?{...f,group:d.column,...y?{as:y}:{}}:f;return C(v(p),r,o,l)}if(d){let m=Kn(d,a,r,i);if(m)return C(m,r,o,l)}}catch(g){if(!(g instanceof N))throw g;return{failed:`Couldn't change that: ${g.message}.`,...t}}if(!s.complete)return{failed:"Couldn't change that: changing it freely needs AI, which isn't on here. Try \u201Cgroup by status\u201D, \u201Conly this month\u201D or \u201Cas a calendar\u201D.",...t};let u=await cn(e,o,n);return x(u)?u:{...u,asks:l}}var v=n=>{let{title:e,...s}=n;return s};function Kn(n,e,s,t){let o=/ (?:group(?:ed)?|split|organi[sz]ed?|put them|columns) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1]??(/^ by /.test(t)?W(t):void 0);if(o){let d=I(e,o);if(d?.type==="enum")return n.lens==="blocks"?{...v(n),group:d.name}:{lens:"columns",kind:n.kind,column:d.name};let c=rn(e,o,s);return c?{lens:"coverage",kind:n.kind,across:c.to[0],link:c.name}:h(d?`${e.plural}' ${d.words} is not a choice, so they cannot be grouped by it`:`${e.plural} have nothing called ${o} to group by`)}let r=/ (?:sort(?:ed)?|order(?:ed)?) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1];if(r){let d=I(e,r);return d?{...n.lens==="blocks"?v(n):{lens:"blocks",kind:n.kind,as:"row",...n.lens==="columns"?{group:n.column}:{}},sort:{by:d.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}:h(`${e.plural} have nothing called ${r} to sort by`)}if(/\b(?:all of them|everything|show all|clear the filter|no filter|without the filter)\b/.test(t)){if(n.lens!=="blocks"||!n.where)return h("it already shows all of them");let{where:d,...c}=v(n);return c}let i=on(t);if(i&&n.lens==="calendar"&&i.range)return{...v(n),range:i.range};if(i&&n.lens==="calendar"&&!i.range)return{lens:"blocks",kind:n.kind,as:"row",sort:{by:n.start},where:q(e,t)};let a=q(e,t);if(a.length>0){let d=n.lens==="blocks"?v(n):{lens:"blocks",kind:n.kind,as:"row",...n.lens==="columns"?{group:n.column}:{}};return{...d,where:[...d.where??[],...a]}}let l=n.lens==="calendar"?_(t):void 0;if(l)return{...v(n),range:l}}function Cn(n){return n.kinds.map(e=>{let s=e.fields.map(r=>`${r.name} (${r.type??"value"}${r.options?`: ${r.options.join(" | ")}`:""})`).join(", "),t=e.edges.map(r=>`${r.name} \u2192 ${r.to.join(" | ")}`).join(", "),o=Object.entries(e.roles).map(([r,i])=>`${r}=${i}`).join(", ");return`- ${e.kind} ("${e.plural}"): ${s}${t?`; relations: ${t}`:""}${o?`; roles: ${o}`:""}`}).join(`
2
2
  `)}var Fn=['columns \u2014 a board, records in columns by one choice field: {"lens": "columns", "on": K, "bindings": {K: {"column": "<enum field>"}}}','calendar \u2014 records on a calendar by a date: {"lens": "calendar", "on": K, "bindings": {K: {"start": "<date field>", "end"?: "<date field>", "done"?: "<boolean field>"}}, "options": {"range"?: "day" | "week" | "month" | "quarter" | "year" | "agenda"}}','timeline \u2014 minutes of a day in columns: {"lens": "timeline", "on": K, "bindings": {K: {"start": "<number field>", "end": "<number field>", "column": "<enum field>"}}}','coverage \u2014 who covers what, a grid of two kinds joined by a relation: {"lens": "coverage", "on": K, "bindings": {"rows": {"kind": K}, "columns": {"kind": J}, "link": {"edge": "<relation of K to J>"}}}',`blocks \u2014 anything else, as blocks: {"lens": "blocks", "on": K, "options": {"blocks": [{"headline": "words"}, {"list": "all('K') where <condition>", "group"?: "<enum field>", "sort"?: "<field>" | {"by": "<field>", "direction": "desc"}, "as"?: "row" | "card", "empty"?: "words"}, {"figure": "count(all('K'))", "label": "words"}]}}. Conditions read a record's own fields: status == 'open', not done, days(today(), due) <= 7.`].join(`
3
3
  `);function Gn(n,e,s){return["You draw a view of an app's data as JSON \u2014 never code. The app's kinds, their fields (with types) and relations:",Cn(e),"","The lenses you may use (prefer the first four; use blocks only when none of them fits):",Fn,"",s?`The view on screen now:
4
4
  ${JSON.stringify(s.lens)}
@@ -1 +1 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{b as ae}from"./chunk.I4H2GS4O.js";import{a as te,b as Pe,e as Me,f as Ne,g as ze}from"./chunk.3D37E2G5.js";import{c as Ie}from"./chunk.B422DSYN.js";import{o as G}from"./chunk.SCVKHGO3.js";import{b as P,c as Ee,d as Le}from"./chunk.MH3AQO2R.js";import{k as Ae,l as Re}from"./chunk.J2N7EKMX.js";import{d as Ce,e as Te,l as We}from"./chunk.P26ATAAI.js";import{a as O,e as $e}from"./chunk.FIY4RUK5.js";import{G as je,Ka as Se,La as xe,V as be,W as ve,ea as _,fa as ke,ha as ne}from"./chunk.FWXW4T4I.js";import{a as we}from"./chunk.SDO3U72B.js";import{C as pe,Fb as ye,L as ue,R as ce,X as ge,Y as me,_ as fe,ga as I,ra as he}from"./chunk.DHPXRDT5.js";import{b as ee}from"./chunk.AJZBJBMO.js";var g=ee(je(),1);var Ye=xe(we(()=>(__graviewPreload(import.meta.url,["./chunk.MKN7ADJB.js","./chunk.I4H2GS4O.js","./chunk.3D37E2G5.js","./chunk.WVUJXDXZ.js","./chunk.B422DSYN.js","./chunk.ZE5RSKXF.js","./chunk.DKUEZPGR.js","./chunk.EP7YT7LT.js","./chunk.I7KN732Z.js","./chunk.TLPCYKLW.js","./chunk.MIE4TJRW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.CKSRW3LA.js")))),Be=Ye.part((i,e)=>i.drawAppLink(e),{quiet:!0});var Xe=864e5;function qe(i,e){let o=Math.round((Date.parse(`${i}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/Xe);if(!Number.isFinite(o))return"";if(o===0)return"today";if(o===1)return"tomorrow";if(o===-1)return"yesterday";let s=Math.abs(o),[y,c]=s<14?[s,"day"]:s<60?[Math.round(s/7),"week"]:s<730?[Math.round(s/30.44),"month"]:[Math.round(s/365.25),"year"],p=`${y} ${c}${y===1?"":"s"}`;return o>0?`in ${p}`:`${p} ago`}function He(i,e,o={}){let s=me(i,o.timeZone);if(s===void 0)return;let y=fe(s,{weekday:"short",year:s.slice(0,4)!==e.slice(0,4)},o.locale),c=i.length>10?`, ${ge(i,o.locale,o.timeZone)}`:"";return{words:`${y}${c} \xB7 ${qe(s,e)}`,day:s,past:s<e}}function Fe(i){return i.today?.()??ue(ce())}var n=ee(ve(),1);function re({nodeId:i,field:e,value:o,stored:s=o,said:y,blank:c=!1,late:p=!1}){let{fields:S,commit:$}=G(i),t=S.find(r=>r.field===e),{store:m,principal:C}=_(),M=m.graph.getNode(i)?.kind,w=m.schema.definitions.find(r=>r.kind===M),a=he(w,e),x=a.toLowerCase(),T=c&&t?Ve(t,a):void 0,V=T!==void 0?T.toLowerCase().includes(x)?T:`${a.charAt(0).toUpperCase()}${a.slice(1)}: ${T.charAt(0).toLowerCase()}${T.slice(1)}`:y??`${a.charAt(0).toUpperCase()}${a.slice(1)}: ${o}`,[W,N]=(0,g.useState)(!1),f=t?.shape.type==="number"?t.shape.amount:void 0,z=f&&s!==""&&Number.isFinite(Number(s))?Ee(Number(s),f):s,[b,D]=(0,g.useState)(z),B=(0,g.useRef)(null),ie=(0,g.useRef)(null),Z=(0,g.useRef)(!1),[j,A]=(0,g.useState)(void 0),Y=r=>{try{r(),A(void 0)}catch(u){A(We(m.schema,m.allMutations(),u))}},R=(r,u)=>Y(()=>$(r,u)),E=r=>{Z.current=r,N(!1)};(0,g.useEffect)(()=>D(z),[z,W]);let oe=t?.shape.type==="date";(0,g.useEffect)(()=>{if(oe)return Se(()=>void ze())},[oe]),(0,g.useEffect)(()=>{W?B.current?.focus():Z.current&&(Z.current=!1,ie.current?.focus())},[W]);let se=m.graph.getNode(i),L=se?.[e],Ue=w?.fields?.shape?.[e],X=w?.display?.format?.[e],_e=typeof L=="boolean"||L==null&&De(Ue)==="boolean",Ge=se?.[`${e}Repeat`]!==void 0||Object.hasOwn(w?.fields?.shape??{},`${e}Repeat`),q=X===void 0&&!c&&!Ge&&typeof L=="string"?He(L,Fe(m)):void 0,le=q?q.words:o,de=p&&q?.past?{color:"var(--graview-warn)"}:{},Ke=w?.computed!==void 0&&Object.hasOwn(w.computed,e),J=j?(0,n.jsx)("span",{role:"status","data-graview-refused":e,style:{marginLeft:6,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:j}):null;if(t&&_e){let r=L===!0,u=[t,...t.alternatives],h=u.find(l=>l.takesValue&&l.shape.type==="boolean"),v=h?h.call(!r):u.map(l=>l.call(void 0)).find(l=>m.wouldChange(l,C));if(v){let l=o||(X?X(r):r?"Yes":"No"),d=u.find(k=>k.mutation===v.name)??t;return(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:6,maxWidth:"100%"},children:[(0,n.jsxs)("button",{type:"button",role:"switch","aria-checked":r,"aria-label":`${a.charAt(0).toUpperCase()}${a.slice(1)}`,"data-graview-field":e,"data-graview-editable":d.mutation,"data-graview-switch":"",title:`${d.title} \u2014 changes the ${a.toLowerCase()}, and can be undone`,onClick:()=>Y(()=>m.apply(v,{author:C})),style:on,children:[(0,n.jsx)("span",{"aria-hidden":"true","data-graview-track":"",style:{...sn,background:r?"var(--graview-accent)":"color-mix(in oklab, var(--graview-ink) 24%, transparent)"},children:(0,n.jsx)("span",{style:{...ln,transform:r?"translateX(12px)":"none",background:r?"var(--graview-accent-ink, #fff)":"var(--graview-ground)"}})}),(0,n.jsx)("span",{"aria-hidden":"true",children:l})]}),J]})}}if(!t)return(0,n.jsxs)("span",{"data-graview-field":e,"data-graview-readonly":"",title:`Read-only \u2014 nothing in this app changes the ${x}`,style:{color:"var(--graview-ink)",cursor:"default",overflowWrap:"anywhere",...de},children:[le,Ke?(0,n.jsx)("span",{"data-graview-worked-out":"",title:"Worked out from the other facts; it changes when they do",style:{marginLeft:8,fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"worked out"}):null]});if(!W&&t.takesValue&&t.shape.type==="choice"&&t.open.length===0){let r=t.shape.options,u=typeof L=="string"?L:"",h=`${a.charAt(0).toUpperCase()}${a.slice(1)}`,v=r.length<=4&&r.every(d=>O(w,e,d).length<=14),l=d=>{if(d!==u){if(d===""){t.clearable&&R(t,null);return}R(t,d)}};return(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:6,maxWidth:"100%"},children:[v?(0,n.jsx)("span",{role:"group","aria-label":h,"data-graview-field":e,"data-graview-editable":t.mutation,"data-graview-choices":e,style:dn,children:r.map(d=>{let k=d===u;return(0,n.jsx)("button",{type:"button","aria-pressed":k,"data-graview-option":d,title:`${t.title} \u2014 changes the ${x}, and can be undone`,onClick:()=>l(d),style:{...pn,...k?un:{}},children:O(w,e,d)},d)})}):(0,n.jsxs)("select",{"aria-label":h,"data-graview-field":e,"data-graview-editable":t.mutation,title:`${t.title} \u2014 changes the ${x}, and can be undone`,value:u,onChange:d=>l(d.target.value),style:cn,children:[u===""||t.clearable?(0,n.jsx)("option",{value:"",children:u===""&&!t.clearable?"Choose\u2026":"None"}):null,r.map(d=>(0,n.jsx)("option",{value:d,children:O(w,e,d)},d))]}),J]})}if(!W){let r=(0,n.jsxs)("button",{ref:ie,type:"button","data-graview-field":e,"data-graview-editable":t.mutation,...c?{"data-graview-blank":""}:{},...V===o?{}:{"aria-label":V},title:`${t.title} \u2014 changes the ${x}, and can be undone`,onClick:()=>{A(void 0),N(!0)},style:{all:"unset",cursor:"text",display:"inline-flex",alignItems:"flex-end",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",paddingBottom:1,borderBottom:"1px dashed var(--graview-edge-bright)",color:c?"var(--graview-ink-muted)":"var(--graview-ink)",...de},children:[c?Ve(t,a):le,!c&&!t.takesValue?(0,n.jsx)("span",{"aria-hidden":"true",style:{marginLeft:4,fontSize:"0.75em",color:"var(--graview-ink-faint)"},children:"\u25BE"}):null]});return j?(0,n.jsxs)(n.Fragment,{children:[r,J]}):r}let U=(r,{left:u=!1}={})=>{if(E(!u),r!==s){if(r===""||r===void 0||r===null){if(s==="")return;t.clearable?R(t,null):A(`${a.charAt(0).toUpperCase()}${a.slice(1)} can't be empty; it keeps ${o}.`);return}if(t.shape.type==="number"&&typeof r=="number"&&Number.isFinite(r)){let{min:h,max:v}=t.shape,l=`${a.charAt(0).toUpperCase()}${a.slice(1)}`;if(v!==void 0&&r>v)return void A(`${l} is at most ${v}; it keeps ${o}.`);if(h!==void 0&&r<h)return void A(`${l} is at least ${h}; it keeps ${o}.`)}t.shape.type==="date"&&typeof r=="string"&&Ze(r)||R(t,r)}},Ze=r=>{if(t.shape.type!=="date")return!1;let u=S.filter(F=>F.shape.type==="date"&&F.takesValue),h=Re(u.map(F=>F.field),w?.fieldRoles??{}),v=h?.start===e?u.find(F=>F.field===h.end):void 0,d=m.graph.getNode(i)?.[h?.end??""];if(!v||typeof d!="string")return!1;let k=Ae(s===""?void 0:s,r,d,{time:t.shape.time===!0,instant:t.shape.instant===!0});if(k===void 0||k===d)return!1;let H=t.call(r),Q=v.call(k);return Y(()=>m.applyAll(H.name===Q.name?[{name:H.name,args:{...H.args,...Q.args}}]:[H,Q],{author:C})),!0};if(!t.takesValue){let r=[t,...t.alternatives];return(0,n.jsx)("span",{role:"group","aria-label":`Change ${I(e).toLowerCase()}`,"data-graview-field":e,style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},onKeyDown:u=>{u.key==="Escape"&&E(!0)},children:r.map((u,h)=>(0,n.jsx)("button",{type:"button",ref:h===0?B:void 0,"data-graview-act":u.mutation,onClick:()=>{E(!0),R(u,void 0)},onBlur:v=>{let l=v.relatedTarget;(!l||!v.currentTarget.parentElement?.contains(l))&&E(!1)},style:{padding:"2px 9px",fontSize:"0.8125rem",borderRadius:999},children:u.title},u.mutation))})}if(t.shape.type==="several"&&t.shape.of.type==="choice"){let r=t.shape.of.options,u=m.graph.getNode(i),h=Array.isArray(u?.[e])?u[e].map(String):[],v=l=>{let d=r.filter(k=>l.includes(k));if(d.length>0)return R(t,d);t.clearable?R(t,null):A(`${a.charAt(0).toUpperCase()}${a.slice(1)} can't be empty; it keeps ${o}.`)};return(0,n.jsxs)("fieldset",{"data-graview-field":e,"data-graview-choices":e,style:{display:"inline-flex",flexWrap:"wrap",gap:"4px 12px",margin:0,padding:"2px 6px",border:"1px solid var(--graview-edge-bright)",borderRadius:6,maxWidth:"100%"},onKeyDown:l=>{l.key==="Escape"&&E(!0)},onBlur:l=>{let d=l.relatedTarget;(!d||!l.currentTarget.contains(d))&&E(!1)},children:[(0,n.jsx)("legend",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:I(e)}),r.map((l,d)=>(0,n.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,cursor:"pointer"},children:[(0,n.jsx)("input",{ref:d===0?B:void 0,type:"checkbox",value:l,checked:h.includes(l),onChange:k=>v(k.target.checked?[...h,l]:h.filter(H=>H!==l))}),O(w,e,l)]},l))]})}return(0,n.jsxs)("form",{noValidate:!0,style:{display:"inline-flex",flexWrap:"wrap",gap:4,maxWidth:"100%"},onSubmit:r=>{r.preventDefault(),U(Oe(t,b))},children:[t.shape.type==="choice"?(0,n.jsxs)("select",{ref:B,"aria-label":I(e),"data-graview-field":e,value:b,onChange:r=>U(r.target.value),onBlur:()=>E(!1),style:{font:"inherit",fontSize:"inherit"},children:[b===""?(0,n.jsx)("option",{value:"",disabled:!0,children:"Choose\u2026"}):null,t.shape.options.map(r=>(0,n.jsx)("option",{value:r,children:O(w,e,r)},r))]}):t.shape.type==="date"?(0,n.jsx)(Ne,{inputRef:B,label:I(e),value:b===""?void 0:b,time:t.shape.time===!0,instant:t.shape.instant===!0,partial:t.shape.partial===!0,onChange:r=>D(r??""),onLeave:r=>U(r,{left:!0}),onCancel:()=>E(!0),autoSelect:!0,boxStyle:{fontSize:"inherit",minHeight:24,padding:"0 3px"}}):(0,n.jsxs)(n.Fragment,{children:[f&&P(f).prefix?(0,n.jsx)("span",{"aria-hidden":"true",children:P(f).prefix}):null,(0,n.jsx)("input",{ref:B,"aria-label":f?`${I(e)}, ${P(f).hint}`:I(e),"data-graview-field":e,...f?{inputMode:"decimal",placeholder:P(f).placeholder,"data-graview-amount":f.format??"unit"}:{},type:f?"text":t.shape.type==="number"&&!t.shape.duration?"number":"text",...t.shape.type==="number"&&t.shape.duration?{placeholder:"1h 30m"}:{},...t.shape.type==="text"&&t.shape.holds==="phone"?{inputMode:"tel",autoComplete:"tel"}:{},...t.shape.type==="number"&&t.shape.min!==void 0&&!f?{min:t.shape.min}:{},...t.shape.type==="number"&&t.shape.max!==void 0&&!f?{max:t.shape.max}:{},...t.shape.type==="number"&&t.shape.step!==void 0&&!f?{step:t.shape.step}:{},value:b,onChange:r=>D(r.target.value),onBlur:()=>U(Oe(t,b),{left:!0}),onKeyDown:r=>{r.key==="Escape"&&E(!0)},style:{font:"inherit",fontSize:"inherit",width:`min(${Math.max(6,b.length+1)}ch, 100%)`,maxWidth:"100%",minWidth:0,boxSizing:"border-box",minHeight:24,display:"inline-flex",alignItems:"center",padding:"0 3px"}}),f&&P(f).suffix?(0,n.jsx)("span",{"aria-hidden":"true",children:P(f).suffix}):null]}),t.open.length>0?(0,n.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["also needs ",t.open.map(r=>r.name).join(", ")]}):null]})}function Oe(i,e){return e.trim()===""?"":i.shape.type==="number"&&i.shape.amount?Le(e,i.shape.amount):i.shape.type==="number"?i.shape.duration?$e(e)??e:Number(e):i.shape.type==="text"&&i.shape.holds?e.trim():e}function Je({href:i,field:e,value:o,stored:s,nodeId:y}){let c=i.startsWith("tel:"),p=(S,$)=>(0,n.jsx)("a",{href:i,"data-graview-link":e,...$?{"aria-label":$}:{},...c?{}:{target:"_blank",rel:"noopener noreferrer"},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",color:"var(--graview-accent)"},children:S});return y===void 0?p(o):(0,n.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"center",gap:"0 10px",maxWidth:"100%"},children:[(0,n.jsx)(re,{nodeId:y,field:e,value:o,...s===void 0?{}:{stored:s}}),p(c?"Call":"Map",c?`Call ${o}`:`Open ${o} in maps`)]})}function Rn({id:i,hide:e=[],limit:o=10,labels:s={},shown:y=[]}){let{store:c}=_(),p=ne(i);if(!p)return null;let S=c.schema.tryDefinition(p.kind),$=Ce(p,S,{limit:o,said:y}).filter(m=>!e.includes(m.key)),t=Ie(S).length>0;return $.length===0&&!t?null:(0,n.jsxs)("div",{"data-graview-fields":p.id,style:{display:"grid",gap:14,alignContent:"start",minWidth:0,fontSize:"0.875rem"},children:[Te(S,$).map((m,C)=>{let M=(0,n.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"auto 1fr",gap:"5px 16px",alignContent:"start",minWidth:0},children:m.fields.map(a=>a.files?(0,n.jsx)(te,{as:"field",nodeId:p.id,field:a.key,label:s[a.key]??a.label,files:a.files,labelStyle:K,style:{marginTop:6}},a.key):a.long?(0,n.jsx)(en,{nodeId:p.id,field:a.key,label:s[a.key]??a.label,value:a.value,markdown:a.markdown,labelStyle:K,style:{gridColumn:"1 / -1",marginTop:6}},a.key):(0,n.jsxs)("div",{style:{display:"contents"},children:[(0,n.jsx)("dt",{style:{...K,whiteSpace:"nowrap"},children:s[a.key]??a.label}),(0,n.jsxs)("dd",{style:{margin:0,minWidth:0},children:[a.linked?(0,n.jsx)(Pe,{relation:a.linked.relation,refs:a.linked.refs,nodeId:p.id,field:a.key}):a.app?(0,n.jsx)(Be,{address:a.app,as:"record",nodeId:p.id,field:a.key}):a.href?(0,n.jsx)(Je,{href:a.href,field:a.key,value:a.value,stored:a.stored,nodeId:p.id}):(0,n.jsx)(re,{nodeId:p.id,field:a.key,value:a.value,stored:a.stored}),a.repeats?(0,n.jsx)(Me,{nodeId:p.id,field:a.key,start:p[a.key],value:p[`${a.key}Repeat`],label:`${s[a.key]??a.label} repeats`}):null]})]},a.key))});if(!m.title)return(0,n.jsx)("div",{children:M},C);let w=`graview-field-group-${p.id}-${C}`;return(0,n.jsxs)("div",{role:"group","aria-labelledby":w,style:{display:"grid",gap:6,minWidth:0},children:[(0,n.jsx)("p",{id:w,"data-graview-field-group":m.title,style:Qe,children:m.title}),M]},C)}),t?(0,n.jsx)(te,{as:"unfilled",nodeId:p.id,skip:e,labels:s,labelStyle:K}):null]})}var K={color:"var(--graview-ink-faint)",fontSize:"0.8125rem"},Qe={margin:0,fontSize:"0.75rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)",fontWeight:560};function en(i){return ke()?(0,n.jsx)(tn,{...i}):(0,n.jsx)(nn,{...i})}function nn({field:i,label:e,value:o,labelStyle:s,valueStyle:y,style:c,markdown:p}){return(0,n.jsxs)("div",{"data-graview-long":i,style:{display:"grid",gap:6,minWidth:0,...c},children:[(0,n.jsx)("dt",{style:s,children:e}),(0,n.jsx)("dd",{style:{margin:0,minWidth:0,...y},children:(0,n.jsx)("div",{"data-graview-field":i,children:(0,n.jsx)(ae,{text:o,markdown:p})})})]})}function tn({nodeId:i,field:e,label:o,value:s,labelStyle:y,valueStyle:c,style:p,markdown:S}){let{fields:$,commit:t}=G(i),{store:m,principal:C}=_(),M=(0,g.useContext)(be)!==null&&m.collaborative(i,e),w=$.find(b=>b.field===e&&b.takesValue),a=w&&(!M||m.permits({name:ye,args:{node:i,field:e,at:0,remove:0,insert:""}},C).ok)?w:void 0,[x,T]=(0,g.useState)(!1),V=(0,g.useRef)(null),W=(0,g.useRef)(!1);(0,g.useEffect)(()=>{!x&&W.current&&(W.current=!1,V.current?.focus())},[x]);let N=b=>{W.current=b,T(!1)},f=o.toLowerCase(),z=(0,n.jsx)(ae,{text:s,markdown:S});return(0,n.jsxs)("div",{"data-graview-long":e,style:{display:"grid",gap:6,minWidth:0,...p},children:[(0,n.jsxs)("dt",{style:{display:"flex",alignItems:"baseline",gap:10,...y},children:[(0,n.jsx)("span",{children:o}),a&&!x?(0,n.jsx)("button",{ref:V,type:"button","data-graview-editable":a.mutation,"aria-label":`Edit the ${f}`,title:`${a.title} \u2014 changes the ${f}, and can be undone`,onClick:()=>T(!0),style:rn,children:"Edit"}):null]}),(0,n.jsx)("dd",{style:{margin:0,minWidth:0,...c},children:x&&a?(0,n.jsx)(g.Suspense,{fallback:z,children:(0,n.jsx)(an,{nodeId:i,field:e,label:o,value:s,...S?{markdown:!0}:{},onCancel:()=>N(!0),onDone:b=>N(!b),onSave:(b,D)=>{N(!D),b!==s&&t(a,b)}})}):(0,n.jsx)("div",{"data-graview-field":e,...a?{}:{"data-graview-readonly":"",title:`Read-only \u2014 nothing in this app changes the ${f}`},...a?{onClick:()=>T(!0)}:{},style:{cursor:a?"text":"default",minWidth:0},children:z})})]})}var an=(0,g.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.I4H2GS4O.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.N7A3T5QU.js"))),rn={all:"unset",cursor:"pointer",fontSize:"0.75rem",letterSpacing:"normal",textTransform:"none",color:"var(--graview-accent)",borderBottom:"1px dashed currentColor",minHeight:24,minWidth:24,display:"inline-flex",alignItems:"flex-end"};function In({nodeId:i,children:e}){let{fields:o}=G(i),s=ne(i);if(!s)return(0,n.jsx)(n.Fragment,{children:e});let y=o.find(c=>{let p=s[c.field];return typeof p=="string"&&p===e});return y?(0,n.jsx)(re,{nodeId:i,field:y.field,value:e,said:e}):(0,n.jsx)(n.Fragment,{children:e})}function De(i){let e=pe(i);if(e)return e.type==="optional"||e.type==="nullable"||e.type==="default"?De(e.innerType):e.type}function Ve(i,e){let o=i.shape;return o.type==="date"?o.time?"Pick a day and time":"Pick a day":o.type==="choice"||o.type==="several"&&o.of.type==="choice"?"Choose\u2026":`Add ${e.toLowerCase()}`}var on={all:"unset",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:8,minHeight:24,minWidth:24,color:"var(--graview-ink)"},sn={position:"relative",display:"inline-block",width:28,height:16,borderRadius:8,flex:"none",transition:"background 120ms"},ln={position:"absolute",top:2,left:2,width:12,height:12,borderRadius:6,background:"var(--graview-ground)",transition:"transform 120ms"},dn={display:"inline-flex",flexWrap:"wrap",gap:2,padding:2,borderRadius:8,border:"1px solid var(--graview-edge)",maxWidth:"100%"},pn={all:"unset",cursor:"pointer",minHeight:24,minWidth:24,padding:"0 10px",display:"inline-flex",alignItems:"center",borderRadius:6,fontSize:"0.875em",color:"var(--graview-ink-muted)"},un={background:"var(--graview-accent)",color:"var(--graview-accent-ink, #fff)"},cn={font:"inherit",fontSize:"inherit",color:"var(--graview-ink)",background:"transparent",border:0,borderBottom:"1px dashed var(--graview-edge-bright)",borderRadius:0,padding:"0 2px",minHeight:24,maxWidth:"100%",cursor:"pointer"};export{Be as a,re as b,Je as c,Rn as d,en as e,In as f};
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{b as ae}from"./chunk.7PWLRRUS.js";import{a as te,b as Pe,e as Me,f as Ne,g as ze}from"./chunk.6IMRCKB4.js";import{c as Ie}from"./chunk.NI4OPHTL.js";import{o as G}from"./chunk.3CLTABGP.js";import{b as P,c as Ee,d as Le}from"./chunk.6TBQV3NO.js";import{k as Ae,l as Re}from"./chunk.MT252WP4.js";import{d as Ce,e as Te,l as We}from"./chunk.VVIQSFM4.js";import{a as O,e as $e}from"./chunk.TQ3MNB6K.js";import{G as je,Na as Se,Oa as xe,X as be,Y as ve,ga as _,ha as ke,ja as ne}from"./chunk.JCKIJSW7.js";import{a as we}from"./chunk.SDO3U72B.js";import{C as pe,Jb as ye,L as ue,R as ce,X as ge,Y as me,_ as fe,ha as I,sa as he}from"./chunk.6L6RUOSF.js";import{b as ee}from"./chunk.AJZBJBMO.js";var g=ee(je(),1);var Ye=xe(we(()=>(__graviewPreload(import.meta.url,["./chunk.67S2UWBT.js","./chunk.7PWLRRUS.js","./chunk.6IMRCKB4.js","./chunk.WVUJXDXZ.js","./chunk.NI4OPHTL.js","./chunk.U5KJQFAP.js","./chunk.FOHZPYUV.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.MIE4TJRW.js","./chunk.3CLTABGP.js","./chunk.RD2FSSLV.js","./chunk.CVN2XFMF.js","./chunk.6TBQV3NO.js","./chunk.MT252WP4.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DX7RGK5G.js")))),Be=Ye.part((i,e)=>i.drawAppLink(e),{quiet:!0});var Xe=864e5;function qe(i,e){let o=Math.round((Date.parse(`${i}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/Xe);if(!Number.isFinite(o))return"";if(o===0)return"today";if(o===1)return"tomorrow";if(o===-1)return"yesterday";let s=Math.abs(o),[y,c]=s<14?[s,"day"]:s<60?[Math.round(s/7),"week"]:s<730?[Math.round(s/30.44),"month"]:[Math.round(s/365.25),"year"],p=`${y} ${c}${y===1?"":"s"}`;return o>0?`in ${p}`:`${p} ago`}function He(i,e,o={}){let s=me(i,o.timeZone);if(s===void 0)return;let y=fe(s,{weekday:"short",year:s.slice(0,4)!==e.slice(0,4)},o.locale),c=i.length>10?`, ${ge(i,o.locale,o.timeZone)}`:"";return{words:`${y}${c} \xB7 ${qe(s,e)}`,day:s,past:s<e}}function Fe(i){return i.today?.()??ue(ce())}var n=ee(ve(),1);function re({nodeId:i,field:e,value:o,stored:s=o,said:y,blank:c=!1,late:p=!1}){let{fields:S,commit:$}=G(i),t=S.find(r=>r.field===e),{store:m,principal:C}=_(),M=m.graph.getNode(i)?.kind,w=m.schema.definitions.find(r=>r.kind===M),a=he(w,e),x=a.toLowerCase(),T=c&&t?Ve(t,a):void 0,V=T!==void 0?T.toLowerCase().includes(x)?T:`${a.charAt(0).toUpperCase()}${a.slice(1)}: ${T.charAt(0).toLowerCase()}${T.slice(1)}`:y??`${a.charAt(0).toUpperCase()}${a.slice(1)}: ${o}`,[W,N]=(0,g.useState)(!1),f=t?.shape.type==="number"?t.shape.amount:void 0,z=f&&s!==""&&Number.isFinite(Number(s))?Ee(Number(s),f):s,[b,D]=(0,g.useState)(z),B=(0,g.useRef)(null),ie=(0,g.useRef)(null),Z=(0,g.useRef)(!1),[j,A]=(0,g.useState)(void 0),Y=r=>{try{r(),A(void 0)}catch(u){A(We(m.schema,m.allMutations(),u))}},R=(r,u)=>Y(()=>$(r,u)),E=r=>{Z.current=r,N(!1)};(0,g.useEffect)(()=>D(z),[z,W]);let oe=t?.shape.type==="date";(0,g.useEffect)(()=>{if(oe)return Se(()=>void ze())},[oe]),(0,g.useEffect)(()=>{W?B.current?.focus():Z.current&&(Z.current=!1,ie.current?.focus())},[W]);let se=m.graph.getNode(i),L=se?.[e],Ue=w?.fields?.shape?.[e],X=w?.display?.format?.[e],_e=typeof L=="boolean"||L==null&&De(Ue)==="boolean",Ge=se?.[`${e}Repeat`]!==void 0||Object.hasOwn(w?.fields?.shape??{},`${e}Repeat`),q=X===void 0&&!c&&!Ge&&typeof L=="string"?He(L,Fe(m)):void 0,le=q?q.words:o,de=p&&q?.past?{color:"var(--graview-warn)"}:{},Ke=w?.computed!==void 0&&Object.hasOwn(w.computed,e),J=j?(0,n.jsx)("span",{role:"status","data-graview-refused":e,style:{marginLeft:6,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:j}):null;if(t&&_e){let r=L===!0,u=[t,...t.alternatives],h=u.find(l=>l.takesValue&&l.shape.type==="boolean"),v=h?h.call(!r):u.map(l=>l.call(void 0)).find(l=>m.wouldChange(l,C));if(v){let l=o||(X?X(r):r?"Yes":"No"),d=u.find(k=>k.mutation===v.name)??t;return(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:6,maxWidth:"100%"},children:[(0,n.jsxs)("button",{type:"button",role:"switch","aria-checked":r,"aria-label":`${a.charAt(0).toUpperCase()}${a.slice(1)}`,"data-graview-field":e,"data-graview-editable":d.mutation,"data-graview-switch":"",title:`${d.title} \u2014 changes the ${a.toLowerCase()}, and can be undone`,onClick:()=>Y(()=>m.apply(v,{author:C})),style:on,children:[(0,n.jsx)("span",{"aria-hidden":"true","data-graview-track":"",style:{...sn,background:r?"var(--graview-accent)":"color-mix(in oklab, var(--graview-ink) 24%, transparent)"},children:(0,n.jsx)("span",{style:{...ln,transform:r?"translateX(12px)":"none",background:r?"var(--graview-accent-ink, #fff)":"var(--graview-ground)"}})}),(0,n.jsx)("span",{"aria-hidden":"true",children:l})]}),J]})}}if(!t)return(0,n.jsxs)("span",{"data-graview-field":e,"data-graview-readonly":"",title:`Read-only \u2014 nothing in this app changes the ${x}`,style:{color:"var(--graview-ink)",cursor:"default",overflowWrap:"anywhere",...de},children:[le,Ke?(0,n.jsx)("span",{"data-graview-worked-out":"",title:"Worked out from the other facts; it changes when they do",style:{marginLeft:8,fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"worked out"}):null]});if(!W&&t.takesValue&&t.shape.type==="choice"&&t.open.length===0){let r=t.shape.options,u=typeof L=="string"?L:"",h=`${a.charAt(0).toUpperCase()}${a.slice(1)}`,v=r.length<=4&&r.every(d=>O(w,e,d).length<=14),l=d=>{if(d!==u){if(d===""){t.clearable&&R(t,null);return}R(t,d)}};return(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:6,maxWidth:"100%"},children:[v?(0,n.jsx)("span",{role:"group","aria-label":h,"data-graview-field":e,"data-graview-editable":t.mutation,"data-graview-choices":e,style:dn,children:r.map(d=>{let k=d===u;return(0,n.jsx)("button",{type:"button","aria-pressed":k,"data-graview-option":d,title:`${t.title} \u2014 changes the ${x}, and can be undone`,onClick:()=>l(d),style:{...pn,...k?un:{}},children:O(w,e,d)},d)})}):(0,n.jsxs)("select",{"aria-label":h,"data-graview-field":e,"data-graview-editable":t.mutation,title:`${t.title} \u2014 changes the ${x}, and can be undone`,value:u,onChange:d=>l(d.target.value),style:cn,children:[u===""||t.clearable?(0,n.jsx)("option",{value:"",children:u===""&&!t.clearable?"Choose\u2026":"None"}):null,r.map(d=>(0,n.jsx)("option",{value:d,children:O(w,e,d)},d))]}),J]})}if(!W){let r=(0,n.jsxs)("button",{ref:ie,type:"button","data-graview-field":e,"data-graview-editable":t.mutation,...c?{"data-graview-blank":""}:{},...V===o?{}:{"aria-label":V},title:`${t.title} \u2014 changes the ${x}, and can be undone`,onClick:()=>{A(void 0),N(!0)},style:{all:"unset",cursor:"text",display:"inline-flex",alignItems:"flex-end",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",paddingBottom:1,borderBottom:"1px dashed var(--graview-edge-bright)",color:c?"var(--graview-ink-muted)":"var(--graview-ink)",...de},children:[c?Ve(t,a):le,!c&&!t.takesValue?(0,n.jsx)("span",{"aria-hidden":"true",style:{marginLeft:4,fontSize:"0.75em",color:"var(--graview-ink-faint)"},children:"\u25BE"}):null]});return j?(0,n.jsxs)(n.Fragment,{children:[r,J]}):r}let U=(r,{left:u=!1}={})=>{if(E(!u),r!==s){if(r===""||r===void 0||r===null){if(s==="")return;t.clearable?R(t,null):A(`${a.charAt(0).toUpperCase()}${a.slice(1)} can't be empty; it keeps ${o}.`);return}if(t.shape.type==="number"&&typeof r=="number"&&Number.isFinite(r)){let{min:h,max:v}=t.shape,l=`${a.charAt(0).toUpperCase()}${a.slice(1)}`;if(v!==void 0&&r>v)return void A(`${l} is at most ${v}; it keeps ${o}.`);if(h!==void 0&&r<h)return void A(`${l} is at least ${h}; it keeps ${o}.`)}t.shape.type==="date"&&typeof r=="string"&&Ze(r)||R(t,r)}},Ze=r=>{if(t.shape.type!=="date")return!1;let u=S.filter(F=>F.shape.type==="date"&&F.takesValue),h=Re(u.map(F=>F.field),w?.fieldRoles??{}),v=h?.start===e?u.find(F=>F.field===h.end):void 0,d=m.graph.getNode(i)?.[h?.end??""];if(!v||typeof d!="string")return!1;let k=Ae(s===""?void 0:s,r,d,{time:t.shape.time===!0,instant:t.shape.instant===!0});if(k===void 0||k===d)return!1;let H=t.call(r),Q=v.call(k);return Y(()=>m.applyAll(H.name===Q.name?[{name:H.name,args:{...H.args,...Q.args}}]:[H,Q],{author:C})),!0};if(!t.takesValue){let r=[t,...t.alternatives];return(0,n.jsx)("span",{role:"group","aria-label":`Change ${I(e).toLowerCase()}`,"data-graview-field":e,style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},onKeyDown:u=>{u.key==="Escape"&&E(!0)},children:r.map((u,h)=>(0,n.jsx)("button",{type:"button",ref:h===0?B:void 0,"data-graview-act":u.mutation,onClick:()=>{E(!0),R(u,void 0)},onBlur:v=>{let l=v.relatedTarget;(!l||!v.currentTarget.parentElement?.contains(l))&&E(!1)},style:{padding:"2px 9px",fontSize:"0.8125rem",borderRadius:999},children:u.title},u.mutation))})}if(t.shape.type==="several"&&t.shape.of.type==="choice"){let r=t.shape.of.options,u=m.graph.getNode(i),h=Array.isArray(u?.[e])?u[e].map(String):[],v=l=>{let d=r.filter(k=>l.includes(k));if(d.length>0)return R(t,d);t.clearable?R(t,null):A(`${a.charAt(0).toUpperCase()}${a.slice(1)} can't be empty; it keeps ${o}.`)};return(0,n.jsxs)("fieldset",{"data-graview-field":e,"data-graview-choices":e,style:{display:"inline-flex",flexWrap:"wrap",gap:"4px 12px",margin:0,padding:"2px 6px",border:"1px solid var(--graview-edge-bright)",borderRadius:6,maxWidth:"100%"},onKeyDown:l=>{l.key==="Escape"&&E(!0)},onBlur:l=>{let d=l.relatedTarget;(!d||!l.currentTarget.contains(d))&&E(!1)},children:[(0,n.jsx)("legend",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:I(e)}),r.map((l,d)=>(0,n.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,cursor:"pointer"},children:[(0,n.jsx)("input",{ref:d===0?B:void 0,type:"checkbox",value:l,checked:h.includes(l),onChange:k=>v(k.target.checked?[...h,l]:h.filter(H=>H!==l))}),O(w,e,l)]},l))]})}return(0,n.jsxs)("form",{noValidate:!0,style:{display:"inline-flex",flexWrap:"wrap",gap:4,maxWidth:"100%"},onSubmit:r=>{r.preventDefault(),U(Oe(t,b))},children:[t.shape.type==="choice"?(0,n.jsxs)("select",{ref:B,"aria-label":I(e),"data-graview-field":e,value:b,onChange:r=>U(r.target.value),onBlur:()=>E(!1),style:{font:"inherit",fontSize:"inherit"},children:[b===""?(0,n.jsx)("option",{value:"",disabled:!0,children:"Choose\u2026"}):null,t.shape.options.map(r=>(0,n.jsx)("option",{value:r,children:O(w,e,r)},r))]}):t.shape.type==="date"?(0,n.jsx)(Ne,{inputRef:B,label:I(e),value:b===""?void 0:b,time:t.shape.time===!0,instant:t.shape.instant===!0,partial:t.shape.partial===!0,onChange:r=>D(r??""),onLeave:r=>U(r,{left:!0}),onCancel:()=>E(!0),autoSelect:!0,boxStyle:{fontSize:"inherit",minHeight:24,padding:"0 3px"}}):(0,n.jsxs)(n.Fragment,{children:[f&&P(f).prefix?(0,n.jsx)("span",{"aria-hidden":"true",children:P(f).prefix}):null,(0,n.jsx)("input",{ref:B,"aria-label":f?`${I(e)}, ${P(f).hint}`:I(e),"data-graview-field":e,...f?{inputMode:"decimal",placeholder:P(f).placeholder,"data-graview-amount":f.format??"unit"}:{},type:f?"text":t.shape.type==="number"&&!t.shape.duration?"number":"text",...t.shape.type==="number"&&t.shape.duration?{placeholder:"1h 30m"}:{},...t.shape.type==="text"&&t.shape.holds==="phone"?{inputMode:"tel",autoComplete:"tel"}:{},...t.shape.type==="number"&&t.shape.min!==void 0&&!f?{min:t.shape.min}:{},...t.shape.type==="number"&&t.shape.max!==void 0&&!f?{max:t.shape.max}:{},...t.shape.type==="number"&&t.shape.step!==void 0&&!f?{step:t.shape.step}:{},value:b,onChange:r=>D(r.target.value),onBlur:()=>U(Oe(t,b),{left:!0}),onKeyDown:r=>{r.key==="Escape"&&E(!0)},style:{font:"inherit",fontSize:"inherit",width:`min(${Math.max(6,b.length+1)}ch, 100%)`,maxWidth:"100%",minWidth:0,boxSizing:"border-box",minHeight:24,display:"inline-flex",alignItems:"center",padding:"0 3px"}}),f&&P(f).suffix?(0,n.jsx)("span",{"aria-hidden":"true",children:P(f).suffix}):null]}),t.open.length>0?(0,n.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["also needs ",t.open.map(r=>r.name).join(", ")]}):null]})}function Oe(i,e){return e.trim()===""?"":i.shape.type==="number"&&i.shape.amount?Le(e,i.shape.amount):i.shape.type==="number"?i.shape.duration?$e(e)??e:Number(e):i.shape.type==="text"&&i.shape.holds?e.trim():e}function Je({href:i,field:e,value:o,stored:s,nodeId:y}){let c=i.startsWith("tel:"),p=(S,$)=>(0,n.jsx)("a",{href:i,"data-graview-link":e,...$?{"aria-label":$}:{},...c?{}:{target:"_blank",rel:"noopener noreferrer"},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",color:"var(--graview-accent)"},children:S});return y===void 0?p(o):(0,n.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"center",gap:"0 10px",maxWidth:"100%"},children:[(0,n.jsx)(re,{nodeId:y,field:e,value:o,...s===void 0?{}:{stored:s}}),p(c?"Call":"Map",c?`Call ${o}`:`Open ${o} in maps`)]})}function Rn({id:i,hide:e=[],limit:o=10,labels:s={},shown:y=[]}){let{store:c}=_(),p=ne(i);if(!p)return null;let S=c.schema.tryDefinition(p.kind),$=Ce(p,S,{limit:o,said:y}).filter(m=>!e.includes(m.key)),t=Ie(S).length>0;return $.length===0&&!t?null:(0,n.jsxs)("div",{"data-graview-fields":p.id,style:{display:"grid",gap:14,alignContent:"start",minWidth:0,fontSize:"0.875rem"},children:[Te(S,$).map((m,C)=>{let M=(0,n.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"auto 1fr",gap:"5px 16px",alignContent:"start",minWidth:0},children:m.fields.map(a=>a.files?(0,n.jsx)(te,{as:"field",nodeId:p.id,field:a.key,label:s[a.key]??a.label,files:a.files,labelStyle:K,style:{marginTop:6}},a.key):a.long?(0,n.jsx)(en,{nodeId:p.id,field:a.key,label:s[a.key]??a.label,value:a.value,markdown:a.markdown,labelStyle:K,style:{gridColumn:"1 / -1",marginTop:6}},a.key):(0,n.jsxs)("div",{style:{display:"contents"},children:[(0,n.jsx)("dt",{style:{...K,whiteSpace:"nowrap"},children:s[a.key]??a.label}),(0,n.jsxs)("dd",{style:{margin:0,minWidth:0},children:[a.linked?(0,n.jsx)(Pe,{relation:a.linked.relation,refs:a.linked.refs,nodeId:p.id,field:a.key}):a.app?(0,n.jsx)(Be,{address:a.app,as:"record",nodeId:p.id,field:a.key}):a.href?(0,n.jsx)(Je,{href:a.href,field:a.key,value:a.value,stored:a.stored,nodeId:p.id}):(0,n.jsx)(re,{nodeId:p.id,field:a.key,value:a.value,stored:a.stored}),a.repeats?(0,n.jsx)(Me,{nodeId:p.id,field:a.key,start:p[a.key],value:p[`${a.key}Repeat`],label:`${s[a.key]??a.label} repeats`}):null]})]},a.key))});if(!m.title)return(0,n.jsx)("div",{children:M},C);let w=`graview-field-group-${p.id}-${C}`;return(0,n.jsxs)("div",{role:"group","aria-labelledby":w,style:{display:"grid",gap:6,minWidth:0},children:[(0,n.jsx)("p",{id:w,"data-graview-field-group":m.title,style:Qe,children:m.title}),M]},C)}),t?(0,n.jsx)(te,{as:"unfilled",nodeId:p.id,skip:e,labels:s,labelStyle:K}):null]})}var K={color:"var(--graview-ink-faint)",fontSize:"0.8125rem"},Qe={margin:0,fontSize:"0.75rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)",fontWeight:560};function en(i){return ke()?(0,n.jsx)(tn,{...i}):(0,n.jsx)(nn,{...i})}function nn({field:i,label:e,value:o,labelStyle:s,valueStyle:y,style:c,markdown:p}){return(0,n.jsxs)("div",{"data-graview-long":i,style:{display:"grid",gap:6,minWidth:0,...c},children:[(0,n.jsx)("dt",{style:s,children:e}),(0,n.jsx)("dd",{style:{margin:0,minWidth:0,...y},children:(0,n.jsx)("div",{"data-graview-field":i,children:(0,n.jsx)(ae,{text:o,markdown:p})})})]})}function tn({nodeId:i,field:e,label:o,value:s,labelStyle:y,valueStyle:c,style:p,markdown:S}){let{fields:$,commit:t}=G(i),{store:m,principal:C}=_(),M=(0,g.useContext)(be)!==null&&m.collaborative(i,e),w=$.find(b=>b.field===e&&b.takesValue),a=w&&(!M||m.permits({name:ye,args:{node:i,field:e,at:0,remove:0,insert:""}},C).ok)?w:void 0,[x,T]=(0,g.useState)(!1),V=(0,g.useRef)(null),W=(0,g.useRef)(!1);(0,g.useEffect)(()=>{!x&&W.current&&(W.current=!1,V.current?.focus())},[x]);let N=b=>{W.current=b,T(!1)},f=o.toLowerCase(),z=(0,n.jsx)(ae,{text:s,markdown:S});return(0,n.jsxs)("div",{"data-graview-long":e,style:{display:"grid",gap:6,minWidth:0,...p},children:[(0,n.jsxs)("dt",{style:{display:"flex",alignItems:"baseline",gap:10,...y},children:[(0,n.jsx)("span",{children:o}),a&&!x?(0,n.jsx)("button",{ref:V,type:"button","data-graview-editable":a.mutation,"aria-label":`Edit the ${f}`,title:`${a.title} \u2014 changes the ${f}, and can be undone`,onClick:()=>T(!0),style:rn,children:"Edit"}):null]}),(0,n.jsx)("dd",{style:{margin:0,minWidth:0,...c},children:x&&a?(0,n.jsx)(g.Suspense,{fallback:z,children:(0,n.jsx)(an,{nodeId:i,field:e,label:o,value:s,...S?{markdown:!0}:{},onCancel:()=>N(!0),onDone:b=>N(!b),onSave:(b,D)=>{N(!D),b!==s&&t(a,b)}})}):(0,n.jsx)("div",{"data-graview-field":e,...a?{}:{"data-graview-readonly":"",title:`Read-only \u2014 nothing in this app changes the ${f}`},...a?{onClick:()=>T(!0)}:{},style:{cursor:a?"text":"default",minWidth:0},children:z})})]})}var an=(0,g.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.7PWLRRUS.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.LDWWUKKX.js"))),rn={all:"unset",cursor:"pointer",fontSize:"0.75rem",letterSpacing:"normal",textTransform:"none",color:"var(--graview-accent)",borderBottom:"1px dashed currentColor",minHeight:24,minWidth:24,display:"inline-flex",alignItems:"flex-end"};function In({nodeId:i,children:e}){let{fields:o}=G(i),s=ne(i);if(!s)return(0,n.jsx)(n.Fragment,{children:e});let y=o.find(c=>{let p=s[c.field];return typeof p=="string"&&p===e});return y?(0,n.jsx)(re,{nodeId:i,field:y.field,value:e,said:e}):(0,n.jsx)(n.Fragment,{children:e})}function De(i){let e=pe(i);if(e)return e.type==="optional"||e.type==="nullable"||e.type==="default"?De(e.innerType):e.type}function Ve(i,e){let o=i.shape;return o.type==="date"?o.time?"Pick a day and time":"Pick a day":o.type==="choice"||o.type==="several"&&o.of.type==="choice"?"Choose\u2026":`Add ${e.toLowerCase()}`}var on={all:"unset",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:8,minHeight:24,minWidth:24,color:"var(--graview-ink)"},sn={position:"relative",display:"inline-block",width:28,height:16,borderRadius:8,flex:"none",transition:"background 120ms"},ln={position:"absolute",top:2,left:2,width:12,height:12,borderRadius:6,background:"var(--graview-ground)",transition:"transform 120ms"},dn={display:"inline-flex",flexWrap:"wrap",gap:2,padding:2,borderRadius:8,border:"1px solid var(--graview-edge)",maxWidth:"100%"},pn={all:"unset",cursor:"pointer",minHeight:24,minWidth:24,padding:"0 10px",display:"inline-flex",alignItems:"center",borderRadius:6,fontSize:"0.875em",color:"var(--graview-ink-muted)"},un={background:"var(--graview-accent)",color:"var(--graview-accent-ink, #fff)"},cn={font:"inherit",fontSize:"inherit",color:"var(--graview-ink)",background:"transparent",border:0,borderBottom:"1px dashed var(--graview-edge-bright)",borderRadius:0,padding:"0 2px",minHeight:24,maxWidth:"100%",cursor:"pointer"};export{Be as a,re as b,Je as c,Rn as d,en as e,In as f};
@@ -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{t as P}from"./chunk.3CLTABGP.js";import{G as M,Oa as S,T as w,Y as y,ga as m,ha as I,s as b,w as T,x as A}from"./chunk.JCKIJSW7.js";import{a as p}from"./chunk.SDO3U72B.js";import{b as f}from"./chunk.AJZBJBMO.js";var C=f(M(),1),h=f(y(),1),x=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.GFBE4VNT.js","./chunk.RDUGUC7R.js","./chunk.OPMGQS5J.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.YXVUJ3NB.js")))),O=x.part((e,n)=>(0,h.jsx)(e.Timeline,{...n}),{what:"The timeline"}),q=()=>x.prefetch();function K({face:e}){return w()?.open?(0,h.jsx)(C.Suspense,{fallback:null,children:(0,h.jsx)(O,{face:e})}):null}var i=f(M(),1),u=f(y(),1),v=new WeakMap,D=e=>{let n=v.get(e);return n||v.set(e,n={ask:null,doors:[],listeners:new Set}),n},k=e=>{for(let n of e.listeners)n()};function g(e,n){let t=D(e);t.ask=n,k(t)}var N=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.VL3YDD7D.js","./chunk.OPMGQS5J.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.5PQV7GFE.js")))),B=N.part((e,n)=>{let t=e.NotifySheet;return(0,u.jsx)(t,{...n})},{what:"Notify me"}),W=N.part((e,n)=>{let t=e.NotifiedList;return(0,u.jsx)(t,{...n})},{quiet:!0}),E=(e,n)=>n===void 0&&(e.onBehalfOf??e).id!==void 0;function F(e,n,t){let c=d=>t.tryDefinition(d)?.noun??d.replace(/[-_]+/g," "),o=e.on!==void 0?e.on:e.about.length===1?e.about[0]:void 0;if(e.act!==void 0){let d=o!==void 0&&n(o)!==void 0?o:void 0;return{label:"Notify me when someone does this\u2026",choices:[{on:"act",act:e.act,...d!==void 0?{record:d}:{}},...d!==void 0?[{on:"act",act:e.act}]:[]]}}if(o===void 0)return null;let s=n(o);if(s!==void 0)return{label:"Notify me when this changes\u2026",choices:[{on:"changed",record:o},{on:"act",record:o},{on:"reaches",kind:s,condition:"",record:o}]};let r=b(o)!==null?[b(o)]:T(o)?A(o):[];if(r.length!==1||!t.kinds.includes(r[0]))return null;let l=r[0],a=c(l);return{label:`Notify me when ${/^[aeiou]/i.test(a)?"an":"a"} ${a} is added\u2026`,choices:[{on:"created",kind:l},{on:"changed",kind:l},{on:"reaches",kind:l,condition:""}]}}function L(){let{store:e,principal:n,subscriptions:t,signIn:c}=m(),o=E(n,c);return(0,i.useMemo)(()=>o?s=>{let r=F(s,a=>e.graph.getNode(a)?.kind,e.schema);return r?{id:"notify",items:[{id:"notify-me",label:r.label,run:()=>g(t,{choices:r.choices,returnTo:s.element??null})}],prepare:()=>N.prefetch()}:null}:null,[o,e,t])}var z=[];function U({children:e}){let n=L(),t=(0,i.useMemo)(()=>n?[n]:z,[n]);return(0,u.jsx)(P,{sections:t,children:e})}function V(){let{subscriptions:e}=m(),n=(0,i.useId)(),t=D(e);(0,i.useEffect)(()=>(t.doors.push(n),k(t),()=>{t.doors.splice(t.doors.indexOf(n),1),k(t)}),[t,n]);let c=(0,i.useMemo)(()=>r=>(t.listeners.add(r),()=>void t.listeners.delete(r)),[t]),o=(0,i.useSyncExternalStore)(c,()=>t.ask,()=>null),s=(0,i.useSyncExternalStore)(c,()=>t.doors[0]===n,()=>!1);return!o||!s?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(B,{ask:o,close:()=>g(e,null)})})}function X({choices:e,label:n="Notify me",style:t,className:c,testId:o="notify-me"}){let{principal:s,subscriptions:r,signIn:l}=m();return E(s,l)?(0,u.jsx)("button",{type:"button","data-testid":o,className:c,onClick:a=>g(r,{choices:e,returnTo:a.currentTarget}),style:t,children:n}):null}function G(){let e=I(),n=e?.subscriptions,t=e?(e.principal.onBehalfOf??e.principal).id:void 0,[c,o]=(0,i.useState)(0);return(0,i.useEffect)(()=>{if(t===void 0||!n)return;let s=!0,r=()=>void Promise.resolve(n.list(t)).then(a=>s&&o(a.length),()=>s&&o(0));r();let l=n.onChange?.(r);return()=>{s=!1,l?.()}},[n,t]),c}function Y({style:e}){return G()===0?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(W,{...e?{style:e}:{}})})}export{q as a,K as b,L as c,U as d,V as e,X as f,G as g,Y as h};