graview 0.1.61 → 0.1.62

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 (215) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +5 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/preview/{chunk.SAYAFOF6.js → chunk.22BZU7ME.js} +1 -1
  5. package/dist/preview/chunk.2AT3GRXM.js +1 -0
  6. package/dist/preview/chunk.2B6P4GPS.js +1 -0
  7. package/dist/preview/{chunk.XZUHFXME.js → chunk.2GEJNG2U.js} +1 -1
  8. package/dist/preview/{chunk.R3N73BJO.js → chunk.2N4Z5K5S.js} +1 -1
  9. package/dist/preview/{chunk.3HFUO3DC.js → chunk.3FON2Y72.js} +1 -1
  10. package/dist/preview/chunk.3L37FY3G.js +4 -0
  11. package/dist/preview/{chunk.CRCJ3TAG.js → chunk.4HEFUOLV.js} +1 -1
  12. package/dist/preview/chunk.4HRYB7HF.js +1 -0
  13. package/dist/preview/{chunk.GQNSNJTJ.js → chunk.4TX6VCBT.js} +1 -1
  14. package/dist/preview/{chunk.4LG34OC2.js → chunk.5HGD6OWL.js} +2 -2
  15. package/dist/preview/{chunk.6VLCMBRE.js → chunk.5J3O2FVG.js} +1 -1
  16. package/dist/preview/{chunk.DP5DUV6F.js → chunk.5MZYCELA.js} +1 -1
  17. package/dist/preview/{chunk.F4VHCQNP.js → chunk.5ODHHH35.js} +1 -1
  18. package/dist/preview/{chunk.D5Q64GA4.js → chunk.5STU3KYG.js} +1 -1
  19. package/dist/preview/{chunk.PYVWGTQS.js → chunk.5YAOKOGV.js} +1 -1
  20. package/dist/preview/{chunk.E6RNMWFN.js → chunk.66P5IDTH.js} +1 -1
  21. package/dist/preview/{chunk.EN2ABVIP.js → chunk.6AKW7TXM.js} +1 -1
  22. package/dist/preview/{chunk.GI6XQF5X.js → chunk.6JO5HQDR.js} +1 -1
  23. package/dist/preview/{chunk.SIYBHZDD.js → chunk.75GVFX7L.js} +1 -1
  24. package/dist/preview/{chunk.E7UDVC4V.js → chunk.7KVUUEZA.js} +1 -1
  25. package/dist/preview/{chunk.W5TVQYAI.js → chunk.7M4HNKDR.js} +1 -1
  26. package/dist/preview/chunk.7OBIBPYH.js +1 -0
  27. package/dist/preview/chunk.7V56P2A7.js +1 -0
  28. package/dist/preview/{chunk.A2ZQASQV.js → chunk.7XLS6XTY.js} +1 -1
  29. package/dist/preview/chunk.7YOAW7ED.js +1 -0
  30. package/dist/preview/{chunk.3SMNWZ3M.js → chunk.A3OL2BI2.js} +1 -1
  31. package/dist/preview/{chunk.WS7LAT4Z.js → chunk.A3ZC2JBO.js} +1 -1
  32. package/dist/preview/{chunk.HZHNM2KI.js → chunk.ACTXR2MI.js} +1 -1
  33. package/dist/preview/chunk.AFNSAQEQ.js +1 -0
  34. package/dist/preview/{chunk.AVFOTYZR.js → chunk.AI34V6WV.js} +4 -4
  35. package/dist/preview/{chunk.VN7I7XIO.js → chunk.AJSUHPBE.js} +1 -1
  36. package/dist/preview/chunk.AQRB7LDA.js +1 -0
  37. package/dist/preview/{chunk.3FUUYYR5.js → chunk.B23WZQXQ.js} +1 -1
  38. package/dist/preview/chunk.BIDL7GQD.js +0 -0
  39. package/dist/preview/chunk.BLUKSGI4.js +1 -0
  40. package/dist/preview/chunk.BZMQDEIY.js +1 -0
  41. package/dist/preview/chunk.CAKFNKN5.js +1 -0
  42. package/dist/preview/chunk.CGALLZ54.js +1 -0
  43. package/dist/preview/{chunk.65KFZV3A.js → chunk.CHHYIMB7.js} +1 -1
  44. package/dist/preview/chunk.CXDGE5ZS.js +1 -0
  45. package/dist/preview/{chunk.KRFRREEW.js → chunk.CY3ELWCM.js} +1 -1
  46. package/dist/preview/chunk.DC35FJAB.js +1 -0
  47. package/dist/preview/{chunk.ZJCM62GH.js → chunk.DD2NKFDX.js} +1 -1
  48. package/dist/preview/{chunk.DHY7KOBV.js → chunk.DDO3GLEJ.js} +1 -1
  49. package/dist/preview/{chunk.6HZY5NRX.js → chunk.DDUCIUVW.js} +1 -1
  50. package/dist/preview/chunk.DEAP3H2L.js +1 -0
  51. package/dist/preview/chunk.DHJ3FQTR.js +1 -0
  52. package/dist/preview/{chunk.R5547CJ7.js → chunk.DNVWSWL2.js} +1 -1
  53. package/dist/preview/chunk.DPEIT3TW.js +1 -0
  54. package/dist/preview/chunk.DVSTLVIH.js +15 -0
  55. package/dist/preview/chunk.DZZL5IDD.js +5 -0
  56. package/dist/preview/{chunk.U2ISOUM2.js → chunk.ELOFPE25.js} +1 -1
  57. package/dist/preview/{chunk.7LZ6JDJA.js → chunk.ELTV44HU.js} +2 -2
  58. package/dist/preview/chunk.EVBCEEQ4.js +1 -0
  59. package/dist/preview/{chunk.HQNE4I4M.js → chunk.F7YXLYLX.js} +1 -1
  60. package/dist/preview/{chunk.MK72IRIY.js → chunk.FULEUL34.js} +1 -1
  61. package/dist/preview/{chunk.HOQMD6WQ.js → chunk.G4ULQK64.js} +14 -14
  62. package/dist/preview/{chunk.UXOBUK3C.js → chunk.GX4G4BX3.js} +1 -1
  63. package/dist/preview/chunk.H24OC6OE.js +1 -0
  64. package/dist/preview/chunk.H5S7OL2U.js +1 -0
  65. package/dist/preview/chunk.H73ZPYUX.js +1 -0
  66. package/dist/preview/{chunk.FJIXSGYU.js → chunk.H7N7WN4U.js} +1 -1
  67. package/dist/preview/chunk.HANJZ6FA.js +1 -0
  68. package/dist/preview/chunk.HIMQ65QT.js +1 -0
  69. package/dist/preview/chunk.I77ZGIFE.js +1 -0
  70. package/dist/preview/{chunk.ZC3FRCJQ.js → chunk.ILIIBSGA.js} +1 -1
  71. package/dist/preview/{chunk.66IKLMYX.js → chunk.IQ3PRWGO.js} +1 -1
  72. package/dist/preview/{chunk.DLDP6OWD.js → chunk.IQMD7DG3.js} +1 -1
  73. package/dist/preview/chunk.IQPILSV3.js +18 -0
  74. package/dist/preview/chunk.IYBEXENQ.js +1 -0
  75. package/dist/preview/{chunk.5S7IGASX.js → chunk.J7Q2WAF4.js} +1 -1
  76. package/dist/preview/{chunk.PJ5AO7CK.js → chunk.JT3MFPRD.js} +1 -1
  77. package/dist/preview/chunk.JYFZCJ4N.js +2 -0
  78. package/dist/preview/chunk.K2HDEL7I.js +1 -0
  79. package/dist/preview/chunk.KDXU5DT3.js +1 -0
  80. package/dist/preview/chunk.KL7E4YHJ.js +1 -0
  81. package/dist/preview/{chunk.SBLYBRDU.js → chunk.KMV6PJFL.js} +1 -1
  82. package/dist/preview/{chunk.DHJI7LIW.js → chunk.L3WTKQQL.js} +1 -1
  83. package/dist/preview/{chunk.REH6RXNH.js → chunk.LAYQ5PFS.js} +1 -1
  84. package/dist/preview/{chunk.UACSX64H.js → chunk.LGRLVJGS.js} +3 -3
  85. package/dist/preview/chunk.LTZUF5VG.js +1 -0
  86. package/dist/preview/{chunk.WD4VPMEE.js → chunk.M4AYA2PL.js} +1 -1
  87. package/dist/preview/chunk.M7RESZB6.js +25 -0
  88. package/dist/preview/{chunk.CUTLO6DA.js → chunk.MAKODQO3.js} +1 -1
  89. package/dist/preview/{chunk.SKQO467Y.js → chunk.MDEX6ZVE.js} +1 -1
  90. package/dist/preview/chunk.MGALQLRW.js +1 -0
  91. package/dist/preview/{chunk.PZXTSWDH.js → chunk.MYNMBOLD.js} +1 -1
  92. package/dist/preview/{chunk.YGIJDHAV.js → chunk.N6EJXXQK.js} +2 -2
  93. package/dist/preview/chunk.NAD7ZXYP.js +1 -0
  94. package/dist/preview/chunk.NHTGAP3G.js +3 -0
  95. package/dist/preview/{chunk.5IEFTFKQ.js → chunk.NJSK3UO2.js} +1 -1
  96. package/dist/preview/{chunk.ISRQQVS4.js → chunk.NOGGSLVG.js} +1 -1
  97. package/dist/preview/chunk.NUWDMH47.js +1 -0
  98. package/dist/preview/chunk.NUYA4BWI.js +1 -0
  99. package/dist/preview/{chunk.BDTT4ENI.js → chunk.O2BHPYA4.js} +2 -2
  100. package/dist/preview/chunk.O75HWF3F.js +1 -0
  101. package/dist/preview/chunk.OFWNMTGB.js +21 -0
  102. package/dist/preview/chunk.OKZT2QBM.js +2 -0
  103. package/dist/preview/{chunk.MBPOYZ3J.js → chunk.OUDATENL.js} +1 -1
  104. package/dist/preview/chunk.OUPURRDE.js +1 -0
  105. package/dist/preview/{chunk.GIW657OR.js → chunk.OWOOKLIU.js} +2 -1
  106. package/dist/preview/{chunk.7R727IKU.js → chunk.OWT3VVOT.js} +1 -1
  107. package/dist/preview/{chunk.VYFMUCBT.js → chunk.PCDUV3WP.js} +1 -1
  108. package/dist/preview/chunk.PD2DECOP.js +1 -0
  109. package/dist/preview/{chunk.2WZAFKJ2.js → chunk.PKWQKFPE.js} +1 -1
  110. package/dist/preview/{chunk.747OH3EE.js → chunk.PLTH2LW5.js} +1 -1
  111. package/dist/preview/{chunk.5POG3G2C.js → chunk.PZQNR4KZ.js} +1 -1
  112. package/dist/preview/chunk.Q5WEOX3Q.js +1 -0
  113. package/dist/preview/chunk.QDWSU47A.js +1 -0
  114. package/dist/preview/{chunk.U3JK2DNC.js → chunk.QGU5QTR6.js} +1 -1
  115. package/dist/preview/{chunk.6DOOLVT4.js → chunk.QHY5NVYH.js} +1 -1
  116. package/dist/preview/{chunk.BI6DS3PZ.js → chunk.QIPASE42.js} +1 -1
  117. package/dist/preview/{chunk.EVEHSENK.js → chunk.RD2X25XB.js} +1 -1
  118. package/dist/preview/{chunk.D4TA5XDC.js → chunk.RMR24LFJ.js} +3 -3
  119. package/dist/preview/chunk.ROZTJ6IY.js +6 -0
  120. package/dist/preview/{chunk.6SO64TUI.js → chunk.RPDH32XV.js} +1 -1
  121. package/dist/preview/chunk.RRKI24WY.js +1 -0
  122. package/dist/preview/{chunk.FWUG7Y6C.js → chunk.RYRQ66JN.js} +1 -1
  123. package/dist/preview/chunk.SEHRPTNA.js +7 -0
  124. package/dist/preview/{chunk.MBU7UH6J.js → chunk.SGCW2XRC.js} +1 -1
  125. package/dist/preview/{chunk.4G32374Q.js → chunk.SS7234R6.js} +1 -1
  126. package/dist/preview/{chunk.WICFQROI.js → chunk.SVPKUWZU.js} +1 -1
  127. package/dist/preview/{chunk.2LNSENPV.js → chunk.SWMDFXUX.js} +1 -1
  128. package/dist/preview/{chunk.XFSGB6EU.js → chunk.T3UQ7ZQK.js} +1 -1
  129. package/dist/preview/chunk.T6PU3NKP.js +1 -0
  130. package/dist/preview/{chunk.ZVG3DR5G.js → chunk.T6WHGKWR.js} +1 -1
  131. package/dist/preview/{chunk.JEQO24GS.js → chunk.THVC2BEC.js} +1 -1
  132. package/dist/preview/{chunk.SJALH7IX.js → chunk.TIALD6SC.js} +1 -1
  133. package/dist/preview/{chunk.ULHB3RYK.js → chunk.TM4EPUNO.js} +1 -1
  134. package/dist/preview/chunk.U6ZRJKVM.js +1 -0
  135. package/dist/preview/chunk.UFDJXQQQ.js +32 -0
  136. package/dist/preview/{chunk.Y7H5O2SL.js → chunk.UKQUUPKE.js} +1 -1
  137. package/dist/preview/{chunk.IA5ZBMRD.js → chunk.UQQKDBIH.js} +1 -1
  138. package/dist/preview/{chunk.NUEPFPRA.js → chunk.UVA7AALY.js} +1 -1
  139. package/dist/preview/chunk.UXMPFPFH.js +20 -0
  140. package/dist/preview/chunk.VACKSKGJ.js +1 -0
  141. package/dist/preview/{chunk.ZQHCNFJK.js → chunk.VC3V7HLL.js} +1 -1
  142. package/dist/preview/{chunk.N5WDQAIM.js → chunk.VIH5AX7S.js} +2 -2
  143. package/dist/preview/{chunk.ZKAZA6UJ.js → chunk.VJBBVLGZ.js} +1 -1
  144. package/dist/preview/chunk.VN23AGIY.js +1 -0
  145. package/dist/preview/{chunk.2XSIJH5J.js → chunk.W4BKYSZX.js} +1 -1
  146. package/dist/preview/{chunk.XZWXDQ3N.js → chunk.WEOVK2T4.js} +1 -1
  147. package/dist/preview/chunk.WKI5INH7.js +1 -0
  148. package/dist/preview/chunk.WPXPVD33.js +88 -0
  149. package/dist/preview/chunk.X6KYRBL6.js +1 -0
  150. package/dist/preview/{chunk.LA2DMHZC.js → chunk.Y2YYH3JN.js} +1 -1
  151. package/dist/preview/{chunk.MU3XII7I.js → chunk.Y4FZKUOK.js} +1 -1
  152. package/dist/preview/chunk.Y4S7CDRB.js +1 -0
  153. package/dist/preview/{chunk.C634A6ZC.js → chunk.YP2QSPXU.js} +1 -1
  154. package/dist/preview/{chunk.JHAFQNGC.js → chunk.Z2TDZSMN.js} +1 -1
  155. package/dist/preview/{chunk.2QFKNTAZ.js → chunk.ZN3PUM2I.js} +1 -1
  156. package/dist/preview/index.html +53 -51
  157. package/dist/preview/page.js +2 -2
  158. package/dist/preview/splash.js +57 -0
  159. package/package.json +6 -6
  160. package/dist/preview/chunk.2AWVQ5SW.js +0 -1
  161. package/dist/preview/chunk.3ICWPRRJ.js +0 -1
  162. package/dist/preview/chunk.3RW677X6.js +0 -1
  163. package/dist/preview/chunk.4OEWFPH3.js +0 -1
  164. package/dist/preview/chunk.4STDIZVI.js +0 -2
  165. package/dist/preview/chunk.5T53SF2K.js +0 -1
  166. package/dist/preview/chunk.5X22RKB3.js +0 -1
  167. package/dist/preview/chunk.644FUGSX.js +0 -1
  168. package/dist/preview/chunk.7CETF4A6.js +0 -1
  169. package/dist/preview/chunk.BFDJTWGX.js +0 -88
  170. package/dist/preview/chunk.BJI2C3IZ.js +0 -1
  171. package/dist/preview/chunk.DKXVEVDG.js +0 -1
  172. package/dist/preview/chunk.DXWTM4SH.js +0 -1
  173. package/dist/preview/chunk.F7IQ4B6A.js +0 -1
  174. package/dist/preview/chunk.F7PIW2EM.js +0 -5
  175. package/dist/preview/chunk.G4VMRYS4.js +0 -1
  176. package/dist/preview/chunk.GPWYWALF.js +0 -1
  177. package/dist/preview/chunk.HGVBGSRS.js +0 -6
  178. package/dist/preview/chunk.ISXNAFRC.js +0 -20
  179. package/dist/preview/chunk.JU3BCCQM.js +0 -1
  180. package/dist/preview/chunk.K2AC536Q.js +0 -21
  181. package/dist/preview/chunk.K3UOXAZS.js +0 -1
  182. package/dist/preview/chunk.KNYLY7MH.js +0 -1
  183. package/dist/preview/chunk.LQAT7FA6.js +0 -3
  184. package/dist/preview/chunk.LTI5PKTS.js +0 -1
  185. package/dist/preview/chunk.MBP7VDYM.js +0 -1
  186. package/dist/preview/chunk.MH6CCHEX.js +0 -1
  187. package/dist/preview/chunk.MNRTA2CB.js +0 -1
  188. package/dist/preview/chunk.MYVED5LU.js +0 -1
  189. package/dist/preview/chunk.N7T7VB77.js +0 -25
  190. package/dist/preview/chunk.ODVRO2BJ.js +0 -1
  191. package/dist/preview/chunk.OVPFROL3.js +0 -1
  192. package/dist/preview/chunk.PGA5TUSN.js +0 -1
  193. package/dist/preview/chunk.PHC2MI4C.js +0 -1
  194. package/dist/preview/chunk.PXQVXBNG.js +0 -1
  195. package/dist/preview/chunk.Q5I5M3FR.js +0 -1
  196. package/dist/preview/chunk.QATUGE34.js +0 -1
  197. package/dist/preview/chunk.QL77K3D4.js +0 -1
  198. package/dist/preview/chunk.QUJS63OJ.js +0 -13
  199. package/dist/preview/chunk.RZ5PPQBV.js +0 -1
  200. package/dist/preview/chunk.SCGF4ZPP.js +0 -1
  201. package/dist/preview/chunk.SLAZFFCQ.js +0 -1
  202. package/dist/preview/chunk.SLPJWOKC.js +0 -1
  203. package/dist/preview/chunk.TKLYUVMR.js +0 -32
  204. package/dist/preview/chunk.TMAZNDA6.js +0 -1
  205. package/dist/preview/chunk.UDCDK7XJ.js +0 -4
  206. package/dist/preview/chunk.UO544PZH.js +0 -1
  207. package/dist/preview/chunk.VKHAAH32.js +0 -1
  208. package/dist/preview/chunk.VOOOIECX.js +0 -1
  209. package/dist/preview/chunk.VS6NT5C4.js +0 -1
  210. package/dist/preview/chunk.VUAOCYG2.js +0 -1
  211. package/dist/preview/chunk.VX65S2FA.js +0 -1
  212. package/dist/preview/chunk.X2I3XH2E.js +0 -2
  213. package/dist/preview/chunk.XWWSW3ZV.js +0 -7
  214. package/dist/preview/chunk.YOT7ESDG.js +0 -18
  215. package/dist/preview/chunk.ZYNUMVEC.js +0 -1
@@ -1,88 +0,0 @@
1
- import{a as qe,c as Be}from"./chunk.LTI5PKTS.js";import{b as Ve}from"./chunk.TKLYUVMR.js";import{a as Ie,b as Ke,c as Fe,d as j}from"./chunk.7LZ6JDJA.js";import"./chunk.KRFRREEW.js";import{k as Me,l as Le}from"./chunk.D4TA5XDC.js";import"./chunk.VOOOIECX.js";import"./chunk.GIW657OR.js";import"./chunk.EVEHSENK.js";import{e as Ee}from"./chunk.SBLYBRDU.js";import{m as Pe}from"./chunk.2LNSENPV.js";import{a as Te,b as Oe}from"./chunk.WS7LAT4Z.js";import{h as $e}from"./chunk.5X22RKB3.js";import{e as Se,f as Ne}from"./chunk.XZUHFXME.js";import"./chunk.HJCQ6I3S.js";import"./chunk.SAYAFOF6.js";import{e as ne}from"./chunk.R3N73BJO.js";import"./chunk.X2I3XH2E.js";import{a as xe}from"./chunk.747OH3EE.js";import"./chunk.E6RNMWFN.js";import"./chunk.IA5ZBMRD.js";import"./chunk.VN7I7XIO.js";import"./chunk.REH6RXNH.js";import"./chunk.MBP7VDYM.js";import"./chunk.BDTT4ENI.js";import{a as Ae,b as Ce,j as Re}from"./chunk.HGVBGSRS.js";import"./chunk.G4JJXA63.js";import"./chunk.WD4VPMEE.js";import"./chunk.VUAOCYG2.js";import"./chunk.5POG3G2C.js";import"./chunk.2XSIJH5J.js";import"./chunk.ZVG3DR5G.js";import"./chunk.XOZU4OFA.js";import"./chunk.LA2DMHZC.js";import"./chunk.ISRQQVS4.js";import"./chunk.WVUJXDXZ.js";import"./chunk.MBU7UH6J.js";import{a as ye}from"./chunk.2QFKNTAZ.js";import"./chunk.BI6DS3PZ.js";import"./chunk.PGA5TUSN.js";import"./chunk.7R727IKU.js";import"./chunk.LQAT7FA6.js";import"./chunk.GZHZLJBF.js";import{r as ke}from"./chunk.Y7H5O2SL.js";import"./chunk.OJGHDWI6.js";import"./chunk.6HZY5NRX.js";import"./chunk.UO544PZH.js";import{d as te,l as be}from"./chunk.4STDIZVI.js";import{c as me}from"./chunk.HZHNM2KI.js";import{o as J,z as De}from"./chunk.AVFOTYZR.js";import"./chunk.HOQMD6WQ.js";import{G as tt,Na as ee,Oa as Y,T as we,W as ve,ba as V,da as X,j as ge,l as ue,m as fe,ma as he,r as U}from"./chunk.N7T7VB77.js";import"./chunk.SDO3U72B.js";import{K as se,Q as de,W as D,Ya as Z,ga as G,ia as le,ka as pe,ma as ce}from"./chunk.F7PIW2EM.js";import"./chunk.FQLNBIQ5.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(tt(),1);var nt=300,it=14,z=50,at=3,ot=2;function _e(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:ye(p[o]))?.type}var rt=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),st=e=>e==="date"||e==="datetime",Ge=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,dt=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,lt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=rt(e,n),a=p.filter(u=>st(_e(e,n,u)));if(a.length===0)return;let i=o?.fieldRoles??{},s=u=>i[u]!==void 0&&a.includes(i[u])?i[u]:void 0,c=s("start")??s("when")??a.find(u=>Ge.test(u))??a.find(u=>dt.test(u));if(!c)return;let S=s("end")??a.find(u=>u!==c&&/^(end|ends|until|to|finish|finished|harvested|through)$/i.test(u)),g=p.find(u=>lt.test(u)&&_e(e,n,u)==="boolean");return{field:c,due:Ge.test(c),...S?{end:S}:{},...g?{done:g}:{}}}function ie(e,n){return Math.round((Date.parse(`${n.slice(0,10)}T00:00:00Z`)-Date.parse(`${e.slice(0,10)}T00:00:00Z`))/864e5)}var q=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e)?e.slice(0,10):void 0;function je(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=nt)return{shape:"board",field:a.field};let i=ae(e,n);if(i&&!i.due){let s=r=>{let y=q(r[i.field]),h=q(Z(r,i.field,p));return y&&h?ie(y,h):0},c=o.map(r=>({from:q(Z(r,i.field,p)),to:i.end&&q(r[i.end])?L(q(r[i.end]),s(r)):void 0})).filter(r=>r.from!==void 0).map(r=>({from:r.from,to:r.to&&r.to>r.from?r.to:r.from})),S=`${p.slice(0,7)}-01`,g=L(`${L(S,31).slice(0,7)}-01`,-1),u=c.filter(r=>r.from<=g&&r.to>=S),w=c.map(r=>ie(r.from,r.to)).sort((r,y)=>r-y),l=w[Math.floor(w.length/2)]??0;if(u.length>0&&l<=it){let r=L(p,-((new Date(`${p}T00:00:00Z`).getUTCDay()+6)%7)),y=L(r,6),h=u.every(m=>m.from>=r&&m.to<=y);return{shape:"calendar",start:i.field,...i.end?{end:i.end}:{},...i.done?{done:i.done}:{},range:h?"week":"month"}}}return{shape:"table"}}function ze(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function He(e,n,o={}){switch(n.shape){case"board":return{lens:"columns",kind:e,column:n.field};case"calendar":return{lens:"calendar",kind:e,start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{},range:n.range};case"table":return{lens:"blocks",kind:e,as:"row",...o.group?.by?{group:o.group.by}:{},...o.sort?{sort:{by:o.sort.by,...o.sort.direction==="desc"?{direction:"desc"}:{}}}:{}}}}var pt=60;function We(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,pt),s=new Map;i.forEach(w=>{let l=G(a,w);te(w,a,{glance:!0,said:[l]}).forEach((r,y)=>{if(r.long||r.files||r.app)return;let h=s.get(r.key);h?h.count++:s.set(r.key,{label:r.label,count:1,at:y})})});let c=Math.max(1,Math.ceil(i.length/3)),S=[...s.entries()].filter(([,w])=>w.count>=c).sort((w,l)=>w[1].at-l[1].at).slice(0,at).map(([w,l])=>({about:"field",key:w,label:l.label})),g=new Map;for(let w of i){let l=new Set;for(let[r,y]of[["out",p.outEdges(w.id)],["in",p.inEdges(w.id)]])for(let h of y){let m=p.getNode(r==="out"?h.to:h.from);if(!m||m.id===w.id)continue;let b=`${h.kind}|${r}`;if(l.has(b))continue;l.add(b);let A=g.get(b);A?A.count++:g.set(b,{edge:h.kind,direction:r,far:m.kind,count:1})}}let u=[...g.entries()].sort((w,l)=>l[1].count-w[1].count).slice(0,ot).map(([w,l])=>{let r=me(e,l.direction==="out"?n:l.far,l.edge,l.direction);return{about:"edge",key:w,label:r.charAt(0).toUpperCase()+r.slice(1),edge:l.edge,direction:l.direction}});return[...S,...u]}function Ze(e,n,o,p){if(o.about==="field"){let s=e.tryDefinition(n.kind);return{text:te(n,s,{excerpt:!0}).find(S=>S.key===o.key)?.value??""}}let i=(o.direction==="out"?p.outEdges(n.id):p.inEdges(n.id)).filter(s=>s.kind===o.edge).map(s=>p.getNode(o.direction==="out"?s.to:s.from)).filter(s=>s!==void 0).map(s=>G(e.tryDefinition(s.kind),s));return i.length===0?{text:""}:i.length===1?{text:i[0]}:{text:`${i[0]} +${i.length-1}`,title:i.join(", ")}}function Ue(e,n,o=()=>{}){let p=new Map;for(let a of e){let i=a.nodeIds.filter(c=>n.has(c));if(i.length===0&&!(a.subjectId!==void 0&&n.has(a.subjectId)))continue;let s=p.get(a.invariant)??{invariant:a.invariant,label:o(a.invariant)||a.label||a.message,violations:[],records:new Set};s.violations.push(a);for(let c of i)s.records.add(c);a.subjectId!==void 0&&n.has(a.subjectId)&&s.records.add(a.subjectId),p.set(a.invariant,s)}return[...p.values()].sort((a,i)=>i.violations.length-a.violations.length).map(a=>({invariant:a.invariant,label:a.label,violations:a.violations,records:[...a.records]}))}var Ye=6;function Je(e,n,o,p){let a=ae(e,n);if(!a)return;let i=ne(e,n),s=g=>{if(a.done!==void 0&&g[a.done]===!0)return!0;if(!i)return!1;let u=i.values.indexOf(String(g[i.field]));return u>=0&&i.tiers[u]==="done"},c=0,S=0;for(let g of o){let u=q(Z(g,a.field,p));if(!u||s(g))continue;let w=ie(p,u);a.due&&w<0?c++:w>=0&&w<=Ye&&S++}if(!(c===0&&S===0))return{field:a.field,due:a.due,overdue:c,soon:S}}function L(e,n){return new Date(Date.parse(`${e.slice(0,10)}T00:00:00Z`)+n*864e5).toISOString().slice(0,10)}function oe(e,n,o){return n==="overdue"?[{key:e.field,value:`before:${o}`}]:[{key:e.field,value:`after:${L(o,-1)}`},{key:e.field,value:`before:${L(o,Ye+1)}`}]}function Qe(e,n,o,p){let a=new Set,i=new Set;for(let s of e)if(!(s.at<=o))for(let c of s.primitives)c.op==="add-node"&&c.node?.kind===n?a.add(c.node.id):(c.op==="patch-node"||c.op==="splice-text")&&c.id!==void 0&&p(c.id)===n&&i.add(c.id);for(let s of a)i.delete(s);return{added:[...a].filter(s=>p(s)===n).length,changed:[...i].filter(s=>p(s)===n).length}}var t=Q(we(),1),Xe="as",ct=(e,n)=>`graview:kind-seen:${e}:${n}`;function gt(e){try{return localStorage.getItem(e)}catch{return null}}function ut(e,n){try{localStorage.setItem(e,n)}catch{}}var ft=(e,n)=>({...ge(fe(e,!1),n),relation:null});function Yt({kind:e,members:n,flagged:o=[],label:p,retired:a=0}){let{store:i,brand:s,principal:c,views:S,view:g}=V(),{go:u}=Y(),w=X(),l=i.schema,r=l.tryDefinition(e),y=p??pe(l,e),h=i.today()??se(),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>je(l,e,m,h),[l,e,m,h]),x=g.within?.[Xe]==="table"?{shape:"table"}:A,k=Te(g),C=x.shape==="table"&&!k.sort?ze(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),T=(0,f.useMemo)(()=>$e(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>Ne(l,Se(l,e)),[l,e]),M=S.arrangement?.()?.lists?.[e]?.filters,K=$=>u(Oe(g,$)),B=(0,f.useMemo)(()=>({name:s?.name??"app",schema:l,...i.policy?{policy:i.policy}:{}}),[s,l,i]),H=JSON.stringify(He(e,x,v)),P=(0,f.useMemo)(()=>{let $=Re(JSON.parse(H),{app:B,sight:Ce(B,c)});return Ae($)?void 0:$},[H,B,c]),W=x.shape!=="table"&&P!==void 0;return(0,t.jsxs)("section",{"aria-labelledby":b,className:"graview-kind-stop","data-testid":"kind-stop","data-graview-kind-stop":e,"data-graview-shape":x.shape,children:[(0,t.jsx)("style",{children:St}),(0,t.jsx)(wt,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(ht,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Pe,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:T.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u(Ee(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(yt,{derived:A,shape:x,draft:P}):null,(0,t.jsx)("div",{className:"graview-kind-stop-body","data-testid":"kind-stop-body",children:m.length===0?(0,t.jsx)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-empty",children:"Nothing here yet."}):W?(0,t.jsx)(kt,{draft:P,nodes:m}):T.nodes.length===0?(0,t.jsxs)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-none-kept",children:["None of the ",D(m.length)," ",y.toLowerCase()," ",v.query?`says \u201C${v.query}\u201D`:"is kept by these filters","."," ",(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link",onClick:()=>K({}),children:"Show them all"})]}):(0,t.jsx)(xt,{kind:e,nodes:T.nodes,groups:T.grouped?T.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function wt({kind:e,plural:n,count:o,headingId:p,description:a}){let{store:i,setSelection:s,setMenuAt:c}=V(),S=(0,f.useMemo)(()=>({about:[U(e)]}),[e]),{affordances:g}=Me(S),{apply:u,preview:w}=Le(),l=(0,f.useMemo)(()=>{let x=k=>i.allMutations().find(C=>C.name===k.mutation)?.creates?.includes(e)??!1;return g.find(k=>!k.destructive&&!k.setsAside&&x(k))},[g,i,e]),[r,y]=(0,f.useState)(!1),[h,m]=(0,f.useState)(null),b=(0,f.useRef)(null),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let x=A.current;!x||x.closest('[data-testid="kind-stop"]')?.contains(document.activeElement)||x.focus({preventScroll:!0})},[e]);let O=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(be(i.schema,i.allMutations(),C)),[]}};return(0,t.jsxs)("header",{className:"graview-kind-stop-head",children:[(0,t.jsxs)("div",{className:"graview-kind-stop-title",children:[(0,t.jsx)("h2",{id:p,ref:A,tabIndex:-1,"data-testid":"kind-stop-title",children:n}),(0,t.jsxs)("p",{"data-testid":"kind-stop-count",children:[le(i.schema,e,o),a?` \xB7 ${a}`:""]})]}),(0,t.jsxs)("div",{className:"graview-kind-stop-acts",children:[l?(0,t.jsx)("button",{ref:b,type:"button",className:"graview-kind-stop-primary","data-testid":"kind-stop-primary","data-affordance":l.id,"aria-expanded":l.open.length>0?r:void 0,onClick:()=>{m(null),l.open.length===0?O(l):y(x=>!x)},children:l.label}):null,(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-quiet","data-testid":"kind-stop-acts","aria-haspopup":"menu","aria-label":`What can be done with the ${n.toLowerCase()}`,onClick:x=>{let k=x.currentTarget.getBoundingClientRect();s([U(e)]),c({x:Math.round(k.left),y:Math.round(k.bottom+4),on:U(e)})},children:"Acts\u2026"})]}),r&&l?(0,t.jsx)("div",{className:"graview-kind-stop-ask","data-testid":"kind-stop-ask","aria-label":l.label,role:"group",children:(0,t.jsx)(xe,{affordance:l,onApply:x=>O(l,x),onCancel:()=>{y(!1),b.current?.focus()}})}):null,h?(0,t.jsx)("p",{role:"alert",className:"graview-kind-stop-failed","data-testid":"kind-stop-failed",children:h}):null]})}var vt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function ht({kind:e,plural:n,members:o,today:p,arrangement:a,onArrange:i}){let{store:s,brand:c,setSelection:S}=V(),g=s.schema,u=ee(),w=(0,f.useMemo)(()=>new Set(o.map(v=>v.id)),[o]),l=(0,f.useMemo)(()=>Ue(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Je(g,e,o,p),[g,e,o,p]),y=ct(De(c,g),e),[h]=(0,f.useState)(()=>gt(y));(0,f.useEffect)(()=>()=>ut(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Qe(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,O]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(T=>T.key===R.key)),...v??[]]}),k=l.reduce((v,R)=>v+R.violations.length,0),C=[];if(r&&(r.overdue>0||r.soon>0)){let v=r.field;C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-dates",children:[r.overdue>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact","data-tone":"warn",onClick:()=>x(oe(r,"overdue",p)),"aria-label":`${D(r.overdue)} overdue \u2014 show only these`,children:[D(r.overdue)," overdue"]}):null,r.soon>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact",onClick:()=>x(oe(r,"soon",p)),"aria-label":`${D(r.soon)} in the next 7 days \u2014 show only these`,children:[D(r.soon)," ",r.due?"due":""," in the next 7 days"]}):null,(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" by ",ce(g.tryDefinition(e),v).toLowerCase()]})]},"dates"))}if(l.length>0&&C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-problems","data-graview-problems":k,children:[(0,t.jsxs)("span",{className:"graview-kind-stop-warn",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0 "}),k===1?"1 problem":`${D(k)} problems`]}),(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" in ",n.toLowerCase(),":"]}),(0,t.jsx)("ul",{className:"graview-kind-stop-rules",children:l.map(v=>(0,t.jsx)(mt,{group:v,open:A===v.invariant,onToggle:()=>O(R=>R===v.invariant?null:v.invariant),onPick:R=>S([R])},v.invariant))}),(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-only-problems",onClick:()=>x([{key:"is",value:"flagged"}]),children:["Show only the ",n.toLowerCase()," with a problem"]})]},"problems")),b&&(b.added>0||b.changed>0)){let v=[b.added>0?`${D(b.added)} added`:"",b.changed>0?`${D(b.changed)} changed`:""].filter(Boolean);C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-since",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["Since you last looked (",de(h.slice(0,10)),"):"]})," ",v.join(", ")]},"since"))}return C.length===0?null:(0,t.jsx)("ul",{className:"graview-kind-stop-going-on","aria-label":`What is going on in the ${n.toLowerCase()}`,"data-testid":"kind-stop-going-on",children:C})}function mt({group:e,open:n,onToggle:o,onPick:p}){let a=(0,f.useId)();return(0,t.jsxs)("li",{"data-graview-rule":e.invariant,children:[(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-rule","aria-expanded":n,"aria-controls":a,onClick:o,onPointerEnter:J.prefetch,onFocus:J.prefetch,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"graview-kind-stop-chevron","data-open":n||void 0,children:"\u203A"}),e.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(e.violations.length)]})]}),n?(0,t.jsx)("ol",{id:a,className:"graview-kind-stop-problem-rows","data-testid":"kind-stop-problem-rows",children:(0,t.jsx)(f.Suspense,{fallback:null,children:(0,t.jsx)(vt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var bt={board:"Board",calendar:"Calendar",table:"Table"};function yt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=qe(Be()),[s,c]=(0,f.useState)(!1),S=e.shape==="table"?[]:[e.shape,"table"];return(0,t.jsxs)("div",{className:"graview-kind-stop-shape","data-testid":"kind-stop-shape",children:[S.length>0?(0,t.jsx)("span",{role:"group","aria-label":"Show as",className:"graview-kind-stop-switch",children:S.map(g=>(0,t.jsx)("button",{type:"button","aria-pressed":n.shape===g,"data-testid":`kind-stop-as-${g}`,onClick:()=>a(ue(p,Xe,g===e.shape?null:g)),children:bt[g]},g))}):null,(0,t.jsx)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-derived",children:o?`${o.said.replace(/\.$/,"")}, derived from the declaration`:"Derived from the declaration"}),o?(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-keep",disabled:s,title:`Keep \u201C${o.title}\u201D as a lens: a place of its own`,onClick:()=>{c(!0),i(o).finally(()=>c(!1))},children:"Keep as a lens"}):null]})}function kt({draft:e,nodes:n}){let o=Ve(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(ve,{mode:"scene",children:(0,t.jsx)(ke,{kind:e.kind,view:e.title,children:(0,t.jsx)(o,{nodes:n,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})}function xt({kind:e,nodes:n,groups:o,flagged:p,plural:a,arrangement:i}){let{store:s,views:c,view:S,selection:g,setSelection:u,setMenuAt:w,principal:l}=V(),{go:r}=Y(),y=s.schema,h=s.graph,m=(0,f.useMemo)(()=>(o?o.flatMap(d=>d.nodes):n).map(d=>d.id),[n,o]),b=Ie(m),A=(0,f.useMemo)(()=>s.permittedMutations(l).some(d=>{let N=d.subject?.kinds;return N!==void 0&&(N==="*"||N.includes(e))}),[s,l,e]),O=(0,f.useRef)(null),x=d=>{b.choose(d),requestAnimationFrame(()=>{let N=b.list.current;((d[0]===void 0?null:N?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??N)?.focus({preventScroll:!0})})},k=b.chosen.length,C=c.lookup(e,{cardinality:"one",fidelity:"glyph"}),v=C!==void 0&&!he(C)?C:void 0,R=d=>g.includes(d),T=ee(),I=(0,f.useMemo)(()=>We(y,e,n,h),[y,e,n,h]),[M,K]=(0,f.useState)(z);(0,f.useEffect)(()=>K(z),[i.query,i.filter?.length,i.sort?.by,i.group?.by]);let B=y.tryDefinition(e),H=d=>T.filter(N=>N.nodeIds.includes(d)||N.subjectId===d).map(N=>N.message),P=i.sort?.by,W=`${a}${i.sort?`, in order of ${I.find(d=>d.key===P)?.label.toLowerCase()??P}`:""}`,$=M,et=d=>{let N=G(B,d),F=p.has(d.id)?H(d.id):[];return(0,t.jsxs)("tr",{"data-graview-pick":d.id,tabIndex:-1,"data-graview-record":d.id,"data-flagged":F.length>0||void 0,...A?{"data-graview-choose":d.id}:{},children:[A?(0,t.jsx)("td",{className:"graview-choose-at",children:(0,t.jsx)("input",{...b.boxProps(d.id,N),onPointerEnter:j,onFocus:j})}):null,(0,t.jsxs)("th",{scope:"row",className:"graview-kind-stop-name",children:[v?(0,t.jsx)("div",{"data-graview-pick":d.id,className:"graview-kind-stop-own-row",children:(0,t.jsx)(v,{node:d,cardinality:"one",fidelity:"glyph",mode:"scene",selected:R(d.id),...F.length>0?{flagged:[d.id]}:{}})}):(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-go",title:`Go to ${N}`,onClick:()=>r(ft(S,d.id)),children:N}),F.length>0?(0,t.jsxs)("span",{className:"graview-kind-stop-flag",title:F.join(" \xB7 "),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:`Problem: ${F.join(". ")}`})]}):null]}),I.map(_=>{let E=Ze(y,d,_,h);return(0,t.jsx)("td",{"data-label":_.label,"data-short":E.text.length>0&&E.text.length<=14||void 0,"data-empty":E.text?void 0:"",...E.title?{title:E.title}:{},children:E.text?(0,t.jsx)("span",{children:E.text}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{"aria-hidden":"true",children:"\u2014"}),(0,t.jsx)("i",{className:"graview-kind-stop-hidden",children:"none"})]})},_.key)}),(0,t.jsx)("td",{className:"graview-kind-stop-row-acts",children:(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-acts","aria-haspopup":"menu","aria-label":`What can be done with ${N}`,onClick:_=>{let E=_.currentTarget.getBoundingClientRect();u([d.id]),w({x:Math.round(E.left),y:Math.round(E.bottom+4),on:d.id})},children:(0,t.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})})})]},d.id)},re=d=>{let N=d.slice(0,Math.max(0,$));return $-=N.length,N.map(et)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{O.current=d,b.list.current=d},tabIndex:-1,role:"group","aria-label":k>0?`${a}, ${k} chosen`:a,"data-graview-choosable":""}:{},children:[A?(0,t.jsx)("style",{children:Ke}):null,(0,t.jsxs)("table",{className:"graview-kind-stop-table","data-testid":"kind-stop-table",children:[(0,t.jsx)("caption",{className:"graview-kind-stop-hidden",children:W}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[A?(0,t.jsx)("td",{className:"graview-choose-at graview-choose-all",children:(0,t.jsx)("input",{type:"checkbox",className:"graview-choose-box","data-testid":"kind-stop-choose-all","aria-label":`Choose all ${D(n.length)} ${a.toLowerCase()}`,checked:k>0&&k===n.length,ref:d=>{d&&(d.indeterminate=k>0&&k<n.length)},onPointerEnter:j,onFocus:j,onChange:()=>k===n.length?b.clear():b.choose(m)})}):null,(0,t.jsx)("th",{scope:"col","aria-sort":P==="label"?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:"Name"}),I.map(d=>(0,t.jsx)("th",{scope:"col","aria-sort":d.about==="field"&&d.key===P?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:d.label},d.key)),(0,t.jsx)("th",{scope:"col",children:(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:"Acts"})})]})}),o?o.map(d=>$<=0?null:(0,t.jsxs)("tbody",{"data-graview-group":d.key,children:[(0,t.jsx)("tr",{className:"graview-kind-stop-group",children:(0,t.jsxs)("th",{scope:"rowgroup",colSpan:I.length+(A?3:2),children:[d.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(d.nodes.length)]})]})}),re(d.nodes)]},d.key||"-")):(0,t.jsx)("tbody",{children:re(n)})]}),A?(0,t.jsx)(Fe,{store:s,chosen:b.chosen,principal:l,anchor:()=>O.current?.closest('[data-testid="kind-stop"]')??null,of:m.length,onChooseAll:()=>b.choose(m),onClear:b.clear,onActed:x}):null,n.length>M?(0,t.jsxs)("p",{className:"graview-kind-stop-more",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-shown",children:[D(M)," of ",D(n.length)," shown"]})," ",(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-more",onClick:()=>K(d=>d+z),children:["Show ",D(Math.min(z,n.length-M))," more"]})]}):null]})}var St=`
2
- .graview-kind-stop{container-type:inline-size;box-sizing:border-box;height:100%;min-height:0;display:flex;flex-direction:column;gap:10px;padding:16px 18px 12px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-panel);color:var(--graview-ink);box-shadow:var(--graview-lift-low);overflow:auto;overscroll-behavior:contain}
3
- [data-graview-map-panel] .graview-kind-stop{height:auto;padding:4px 6px 12px;border:0;box-shadow:none;background:none;overflow:visible}
4
- .graview-kind-stop :focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
5
- .graview-kind-stop button{font:inherit;cursor:pointer}
6
- .graview-kind-stop :is(.graview-kind-stop-link,.graview-kind-stop-rule,.graview-kind-stop-name button,.graview-kind-stop-row-acts button,.graview-kind-stop-fact,.graview-kind-stop-switch button){box-shadow:none}
7
- .graview-kind-stop-head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 16px}
8
- .graview-kind-stop-title{flex:1 1 16rem;min-width:0}
9
- .graview-kind-stop-title h2{margin:0;outline-offset:2px;font-size:var(--graview-text-heading);line-height:1.3;overflow-wrap:anywhere}
10
- .graview-kind-stop-title p{margin:2px 0 0;font-size:.875rem;color:var(--graview-ink-muted);overflow-wrap:anywhere}
11
- .graview-kind-stop-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
12
- .graview-kind-stop-primary,.graview-kind-stop-quiet{min-height:32px;padding:0 14px;border-radius:8px;font-size:.875rem}
13
- .graview-kind-stop-primary{border:1px solid var(--graview-accent);background:var(--graview-accent);color:var(--graview-accent-ink);font-weight:600}
14
- .graview-kind-stop-quiet{border:1px solid var(--graview-edge);background:transparent;color:var(--graview-ink)}
15
- .graview-kind-stop-ask{flex:1 1 100%;min-width:0;padding:10px 12px;border:1px solid var(--graview-edge);border-radius:10px}
16
- .graview-kind-stop-failed{flex:1 1 100%;margin:0;font-size:var(--graview-text-small);color:var(--graview-warn)}
17
- .graview-kind-stop-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
18
- .graview-kind-stop-going-on{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:.875rem}
19
- .graview-kind-stop-going-on>li{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
20
- .graview-kind-stop-fact{min-height:28px;padding:0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:transparent;color:var(--graview-ink)}
21
- .graview-kind-stop-fact[data-tone=warn],.graview-kind-stop-warn{color:var(--graview-warn);font-weight:600}
22
- .graview-kind-stop-quiet-text{color:var(--graview-ink-muted)}
23
- .graview-kind-stop-rules{list-style:none;margin:0;padding:0;flex:1 1 100%;display:grid;gap:2px}
24
- .graview-kind-stop-rule{display:inline-flex;align-items:center;gap:6px;min-height:28px;max-width:100%;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;color:var(--graview-ink);text-align:left;overflow-wrap:anywhere}
25
- .graview-kind-stop-rule:hover{border-color:var(--graview-edge)}
26
- .graview-kind-stop-chevron{display:inline-block;width:.8em}
27
- .graview-kind-stop-chevron[data-open]{transform:rotate(90deg)}
28
- .graview-kind-stop-problem-rows{list-style:none;margin:2px 0 6px 18px;padding:0;max-width:44rem}
29
- .graview-kind-stop-link{min-height:28px;padding:0 4px;border:0;background:none;color:var(--graview-accent);text-decoration:underline;text-underline-offset:2px}
30
- .graview-kind-stop-link:disabled{opacity:.6;cursor:default}
31
- .graview-kind-stop-shape{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:var(--graview-text-small)}
32
- .graview-kind-stop-switch{display:inline-flex;border:1px solid var(--graview-edge);border-radius:8px;overflow:hidden}
33
- .graview-kind-stop-switch button{min-height:28px;padding:0 12px;border:0;background:transparent;color:var(--graview-ink-muted)}
34
- .graview-kind-stop-switch button+button{border-left:1px solid var(--graview-edge)}
35
- .graview-kind-stop-switch button[aria-pressed=true]{background:color-mix(in srgb,var(--graview-accent) 16%,transparent);color:var(--graview-ink);font-weight:600}
36
- .graview-kind-stop-body{flex:1 0 auto;min-width:0}
37
- .graview-kind-stop-empty{margin:24px 0;color:var(--graview-ink-muted)}
38
- .graview-kind-stop-lens{min-width:0}
39
-
40
- .graview-kind-stop-table-at{min-width:0}
41
- .graview-kind-stop-table{width:100%;border-collapse:collapse;font-size:.875rem}
42
- .graview-kind-stop-table th,.graview-kind-stop-table td{padding:7px 8px;text-align:left;vertical-align:top;border-top:1px solid var(--graview-edge);overflow-wrap:break-word}
43
- .graview-kind-stop-table td{color:var(--graview-ink)}
44
- .graview-kind-stop-table td>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
45
- .graview-kind-stop-table td[data-short]{white-space:nowrap;font-variant-numeric:tabular-nums}
46
- .graview-kind-stop-table thead th{border-top:0;font-size:var(--graview-text-small);font-weight:600;letter-spacing:.04em;color:var(--graview-ink-muted)}
47
- .graview-kind-stop-name{font-weight:500;min-width:8rem;max-width:22rem}
48
- .graview-kind-stop-name button{display:inline-block;min-width:24px;min-height:24px;padding:0;border:0;background:none;color:var(--graview-ink);font-weight:500;text-align:left;text-decoration:underline;text-decoration-color:var(--graview-edge);text-underline-offset:3px}
49
- .graview-kind-stop-name button:hover{text-decoration-color:currentColor}
50
- .graview-kind-stop-own-row{display:inline-block;max-width:100%;cursor:pointer}
51
- .graview-kind-stop-flag{margin-left:6px;color:var(--graview-warn)}
52
- .graview-kind-stop-group th{padding-top:12px;font-weight:600;color:var(--graview-ink)}
53
- .graview-kind-stop-row-acts{width:1%;white-space:nowrap;text-align:right}
54
- .graview-kind-stop-row-acts button{min-width:32px;min-height:28px;border:1px solid var(--graview-edge-bright,var(--graview-edge));border-radius:7px;background:none;color:var(--graview-ink);font-size:1.125rem;font-weight:700;line-height:1}
55
- .graview-kind-stop-row-acts button:hover{background:color-mix(in srgb,var(--graview-ink) 8%,transparent)}
56
- .graview-kind-stop-table td[data-empty] b{font-weight:400;color:var(--graview-ink-faint)}
57
- .graview-kind-stop-table tr[data-graview-pick]{cursor:default}
58
- .graview-kind-stop-more{margin:10px 0 0;font-size:.875rem}
59
- .graview-kind-stop-table-at[data-graview-choosable]{outline:none}
60
- [data-graview-choosable]:hover .graview-choose-all .graview-choose-box{opacity:1}
61
- .graview-kind-stop-table .graview-choose-at{width:1%;padding-right:0;vertical-align:middle}
62
- @container (max-width: 559px){
63
- .graview-kind-stop{padding:12px}
64
- .graview-kind-stop-acts{flex:1 1 100%}
65
- .graview-kind-stop-primary{flex:1 1 auto}
66
- .graview-kind-stop-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
67
- .graview-kind-stop-table,.graview-kind-stop-table tbody,.graview-kind-stop-table tr{display:block}
68
- .graview-kind-stop-table tr{position:relative;padding:8px 40px 8px 0;border-top:1px solid var(--graview-edge)}
69
- .graview-kind-stop-table th,.graview-kind-stop-table td{display:block;padding:1px 0;border:0}
70
- .graview-kind-stop-table td>span{display:inline}
71
- .graview-kind-stop-table td[data-short]{white-space:normal}
72
- .graview-kind-stop-table td[data-label]::before{content:attr(data-label) " \xB7 ";color:var(--graview-ink-muted)}
73
- .graview-kind-stop-row-acts{position:absolute;top:6px;right:0;width:auto}
74
- .graview-kind-stop-table [data-graview-choose]{padding-left:34px}
75
- .graview-kind-stop-table td.graview-choose-at{position:absolute;left:0;top:8px;width:auto;padding:0}
76
- .graview-kind-stop-table thead .graview-choose-at{position:static}
77
- }
78
- @media (pointer: coarse){
79
- .graview-kind-stop-table-at:not([data-graview-choosing]) .graview-choose-at{display:none}
80
- .graview-kind-stop-table-at:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
81
- }
82
- @media (pointer: coarse){
83
- .graview-kind-stop-primary,.graview-kind-stop-quiet,.graview-kind-stop-fact,.graview-kind-stop-rule,.graview-kind-stop-link,.graview-kind-stop-switch button,.graview-kind-stop-row-acts button{min-height:44px}
84
- .graview-kind-stop-row-acts button{min-width:44px}
85
- .graview-kind-stop-name button{min-height:44px}
86
- }
87
- @media (prefers-reduced-motion: reduce){.graview-kind-stop *{transition:none!important;animation:none!important}}
88
- `;export{Yt as KindStop};
@@ -1 +0,0 @@
1
- import{a as v,b as y,c as m}from"./chunk.MB7LKKUD.js";import"./chunk.AVFOTYZR.js";import"./chunk.HOQMD6WQ.js";import{G as N,Sa as c,T as u,Ua as b}from"./chunk.N7T7VB77.js";import"./chunk.SDO3U72B.js";import{ad as f}from"./chunk.F7PIW2EM.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var l=p(N(),1);var t=p(u(),1);function z({notices:o,anchor:n,board:a}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="banner"),at:"top",anchor:n,board:a}),(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="toast"),at:"foot",anchor:n,board:a})]})}var h={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function w({notices:o,at:n,anchor:a,board:i}){let d=(0,l.useRef)(null),e=o.length>0;return(0,l.useLayoutEffect)(()=>{let r=d.current;if(!e||!r)return;if(typeof r.showPopover=="function"&&!c(r))try{r.showPopover()}catch{}let s=()=>(n==="top"?m:y)(r,a());s(),n==="foot"&&i.hold?.(()=>r.matches(":hover, :focus-within"));let S=b(r);addEventListener("resize",s),addEventListener("scroll",s,!0),n==="foot"&&addEventListener(v,s);let g=typeof ResizeObserver=="function"?new ResizeObserver(s):null;return g?.observe(r),()=>{if(S(),g?.disconnect(),removeEventListener("resize",s),removeEventListener("scroll",s,!0),removeEventListener(v,s),r.isConnected&&c(r))try{r.hidePopover()}catch{}}},[e,n,a,i]),e?(0,t.jsx)("div",{ref:d,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:f("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:o.map(r=>(0,t.jsx)(C,{notice:r,board:i},r.id))}):null}var T=o=>o.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or ");function C({notice:o,board:n}){let a=o.tone??"info",i=[...o.action?[o.action]:[],...o.actions??[]],d=()=>n.dismiss(o.id);return(0,t.jsxs)("div",{"data-testid":"notice","data-kind":o.kind,"data-tone":a,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:o.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${h[a]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:h[a]}}),(0,t.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:o.sentence}),i.length>0?(0,t.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:i.map((e,r)=>e.href!==void 0?(0,t.jsx)("a",{href:e.href,...e.target?{target:e.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{e.onSelect?.(),d()},style:{...x,...r===0?k:{}},children:e.label},e.label):(0,t.jsx)("button",{type:"button","data-testid":"notice-action",...e.keys?{"aria-keyshortcuts":e.keys,title:`${e.label} \u2014 ${T(e.keys)}`}:{},onClick:()=>{d(),e.onSelect?.()},style:{...x,...r===0?k:{}},children:e.label},e.label))}):null,(0,t.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${o.sentence}`,title:"Dismiss",onClick:d,style:E,children:"\xD7"})]})}var x={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"},k={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},E={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{z as NoticeStacks};
@@ -1 +0,0 @@
1
- import{k as a,l as b,m as c,n as d,o as e,p as f,q as g,r as h,s as i}from"./chunk.YGIJDHAV.js";import"./chunk.BJUUSIQY.js";import"./chunk.5POG3G2C.js";import"./chunk.2XSIJH5J.js";import"./chunk.ZVG3DR5G.js";import"./chunk.XOZU4OFA.js";import"./chunk.LA2DMHZC.js";import"./chunk.D5Q64GA4.js";import"./chunk.2QFKNTAZ.js";import"./chunk.UO544PZH.js";import"./chunk.4STDIZVI.js";import"./chunk.HZHNM2KI.js";import"./chunk.AVFOTYZR.js";import"./chunk.HOQMD6WQ.js";import"./chunk.N7T7VB77.js";import"./chunk.SDO3U72B.js";import"./chunk.F7PIW2EM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
@@ -1 +0,0 @@
1
- import{b as mn,c as gn,d as se,e as yn,f as ne,h as ze,i as je,n as hn,r as de}from"./chunk.LQAT7FA6.js";import{B as ue,Ba as Je,C as ae,Db as J,Dc as ln,Ea as Ye,F as qe,Ga as Qe,H as Be,Ib as on,J as _e,Jb as an,K as He,Ka as Oe,La as xe,Lb as sn,Oc as fn,Pc as pn,Qb as dn,Qc as Ae,Ra as Xe,Rc as un,Sc as Se,Ua as en,Vb as cn,b as Pe,c as Me,d as Fe,da as we,e as M,ea as Ue,eb as nn,g as le,gb as tn,h as F,i as Ne,j as Ce,k as fe,l as Ie,lb as Re,m as Ke,mb as rn,na as We,o as Ve,p as oe,q as be,v as Ze,x as ie,ya as ve,z as pe}from"./chunk.F7PIW2EM.js";function kn(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let s=e,n=v=>typeof s[v]=="string"?s[v]:void 0,t=n("light")??n("src");if(t===void 0)return;let[i,p,g]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...i!==void 0?{dark:i}:{},...p!==void 0?{alt:p}:{},...g!==void 0?{darkFallback:g}:{}}}function qn(e,s){let n=e.brand??{},t=n.ground,i=n.accent?Se(n.accent,t):void 0;t&&un(i?.ok?i.schemes:Ae(t),n.accent)&&(s.push(je("brand","brand.ground","words would not read on that page background, so the app keeps Graview's","pick a lighter ground for the light scheme, a darker one for the dark")),t=void 0,i=n.accent?Se(n.accent):void 0),i&&!i.ok&&s.push(je("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${i.why}`,"pick a color further from orange-red, or a darker one"));let p=kn(n.logo),g=n.name??e.name,v=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,E])=>typeof E=="string"&&pn(E)===null).map(([E,T])=>[E,fn(T)])):void 0;return{name:g,schemes:i?.ok?i.schemes:t?Ae(t):ln,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...p?{logo:p.dark||p.darkFallback==="invert"?{light:p.light,...p.dark?{dark:p.dark}:{darkFallback:"invert"}}:p.light,logoAlt:p.alt??g}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...v?{typography:v}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function bn(e){let{currency:s,locale:n,timeZone:t}=e.brand??{};return{...s?{currency:s}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var jn=Symbol.for("@graview/core:typed-field"),wn=(e,s)=>(/^(phone|place|duration)$/.test(s)&&(ae(e)[jn]=s),e),vn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function On(e){let s=F().check(M(300),pe(t=>Ye(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?s:oe(s).check(M(200));return Qe(e.description?n.check(ue(e.description)):n,e)}var Dn=new WeakMap;function xn(e,s){Dn.set(e,s)}var Ln=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Rn(e,s=Ln){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let i of s)t=Ee(t,i.where.split("."),i,"",n);return{document:t,respelled:n}}function Ee(e,s,n,t,i){if(s.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;i.push(`${t}${n.was}`);let{[n.was]:G,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:G}}if(!V(e))return e;let[p,...g]=s,v=p.endsWith("[]"),E=v?p.slice(0,-2):p,T=e[E],_=T;if(!v)_=Ee(T,g,n,`${t}${E}.`,i);else if(Array.isArray(T)){let G=T.map((N,Y)=>Ee(N,g,n,`${t}${E}.${Y}.`,i));_=G.some((N,Y)=>N!==T[Y])?G:T}return _===T?e:{...e,[E]:_}}var An="graview-compiled@1";function Tn(e,s){return e.find(([n,t])=>n!==B&&"ref"in t&&(t.ref==="*"||t.ref.includes(s)))?.[0]}var B="id",me=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function Sn(e){let s=Object.entries(e.fields),n=t=>["name","title","label"].find(i=>t.some(([p])=>p===i))??t[0]?.[0];return n(s.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(s.filter(([,t])=>t.type==="string"))}function zn(e,s,n){let t;switch(e.type){case"string":case"place":t=F().check(M(500));break;case"phone":t=F().check(M(40),le(vn,"a phone number"));break;case"text":t=F().check(M(2e4)),e.format&&(ae(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let p=e.min??(e.type==="duration"?0:void 0),g=[...e.type==="number"?[]:[Ie()],...p===void 0?[]:[Me(p)],...e.max===void 0?[]:[Pe(e.max)],...e.step===void 0?[]:[Fe(e.step)]];t=g.length>0?fe().check(...g):fe();break}case"boolean":t=Ke();break;case"date":t=F().check(le(Be,"a date like 2026-10-02, or a month (2016-05) or a year (2006) alone"));break;case"datetime":t=F().check(pe(_e,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ze(e.options),e.multiple&&(t=oe(t).check(M(e.options.length)));break;case"list":t=oe(e.of==="number"?fe():e.of==="date"?F().check(le(qe)):e.of==="image"||e.of==="video"||e.of==="file"?ve(e.of):F().check(M(500))).check(M(200));break;case"image":case"video":case"file":t=ve(e.type);break;case"app-link":t=Je();break;case"url":t=Ce();break;case"email":t=Ne();break}let i=e.type==="number"||e.type==="integer";return wn(t,i&&e.format==="duration"?"duration":e.type),e.collaborative!==void 0&&(e.type==="text"||e.type==="string")&&(ae(t)[Symbol.for("@graview/core:collaborative")]=e.collaborative?1:0),e.description&&(t=t.check(ue(e.description))),i&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&dn(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),s?ie(t):t}var ce=e=>{throw new J(`there is no record "${e}"`,"invalid")},$n=(e,s)=>"field"in e?zn(e.field,e.optional,s):"ref"in e?cn(e.ref):ie(Ve()),Gn=new WeakMap;var De=(e,s)=>V(s)&&Object.keys(e??{}).length===Object.keys(s).length&&Object.keys(e??{}).every(n=>Object.hasOwn(s,n));function yt(e,s={}){let n=V(e)?e.format:void 0;if(n!==An)return{ok:!1,findings:[ze("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${An}`,"compile the document instead")]};let t=e,i=Rn(t.document).document,p=i===t.document?t:{...t,document:i},g=V(i)&&typeof i.name=="string"&&V(i.kinds)&&De(i.kinds,p.kinds)&&De(i.acts,p.acts)&&De(i.rules,p.rules)&&Array.isArray(p.edges)&&Array.isArray(p.findings),v={ok:!1,findings:[ze("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!g)return v;try{return Pn(p,s)}catch{return v}}function Pn(e,s={}){let{document:n}=e,t=n.brand?.timeZone,i=s.today??(()=>He(t)),p=new Map(e.edges.map(([y,o])=>[y,o])),g=new Map;for(let[y,o]of Object.entries(n.kinds)){let A=e.kinds[y]?.computed,R=xe(o.edges);g.set(y,{fields:new Set([...Object.keys(o.fields),...R.keys()]),edges:new Map(Object.entries(Oe(o.edges)).map(([$,D])=>[$,D.cardinality??"many"])),...A?{computed:new Map(A)}:{},...R.size>0?{linked:R}:{}})}e.facts&&g.set(gn,{computed:new Map(e.facts)});let v=bn(n),E=new Map,T=Object.entries(n.kinds).map(([y,o])=>{let A={};for(let[r,a]of Object.entries(o.fields))A[r]=zn(a,!a.required,v),a.repeats&&(A[Xe(r)]=ie(en()));for(let[r,a]of xe(o.edges))A[r]=ie(On(a));let{label:R,describe:$,durations:D}=e.kinds[y]??{},P=Object.entries(o.computed??{}).map(([r,a])=>[r,typeof a=="string"?{expr:a}:a]),Q=Object.hasOwn(o.fields,"label")&&!o.fields.label.label&&!/\{\s*label\b/.test(o.label??`{${Sn(o)??""}}`),H=Object.fromEntries([...Q?[["label","Label"]]:[],...Object.entries(o.fields).filter(([,r])=>r.label).map(([r,a])=>[r,a.label]),...P.filter(([,r])=>r.label).map(([r,a])=>[r,a.label])]),S=Object.keys(H).length>0,h=Object.entries(o.fields).filter(([,r])=>r.type==="enum"&&(r.optionLabels&&Object.keys(r.optionLabels).length>0||r.multiple)),z=r=>a=>typeof a=="string"&&r.optionLabels&&Object.hasOwn(r.optionLabels,a)?r.optionLabels[a]:we(String(a)),Z=Object.fromEntries(h.map(([r,a])=>[r,a.multiple?L=>Array.isArray(L)?L.map(z(a)).join(", "):z(a)(L):z(a)])),C=h.length>0,I=Object.fromEntries(Object.entries(o.fields).filter(([,r])=>r.default!==void 0).map(([r,a])=>[r,a.default]));E.set(y,I);let q=Object.fromEntries(Object.entries(Oe(o.edges)).map(([r,{renamedFrom:a,...L}])=>[r,L])),U=Object.entries(o.fields).flatMap(([r,a])=>a.aliases?[[r,a.aliases]]:[]),l=r=>o[r]?{[r]:o[r]}:{};return Ue(y,{fields:be(A),edges:q,...l("plural"),...l("noun"),...l("aliases"),...U.length>0?{fieldAliases:Object.fromEntries(U)}:{},...l("description"),...R?{label:r=>de(R,{node:r,kinds:g,today:i(),money:v})||r.id}:{},...$?{describe:r=>de($,{node:r,kinds:g,today:i(),money:v})}:{},...l("lifecycle"),...l("figure"),...l("fieldRoles"),...l("people"),archives:o.archives,...o.tidying?{tidying:o.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([r,a])=>[r,Mn(a,D?.includes(r)??!1,v)??o.computed[r]]))}:{},...S||C||o.glance||o.page?{display:{...S?{labels:H}:{},...C?{format:Z}:{},...o.glance?{glance:[...o.glance]}:{},...o.page?{page:o.page}:{}}}:{},...Object.keys(I).length>0?{defaults:I}:{},...e.kinds[y]?.keptInStep?{keptInStep:e.kinds[y].keptInStep}:{}})}),_=nn(T,n.computed);function G(y){return _.tryDefinition(y.kind)?.label?.(y)??y.id}let N=y=>({id:"",kind:y,...E.get(y)}),Y=[];for(let[y,o]of Object.entries(n.acts??{})){let A=e.acts[y],{title:R,effects:$,guard:D,refusal:P,destructive:Q,idempotent:H,creates:S,connects:h,severs:z,writes:Z,writesOther:C,sets:I}=A,q=new Map(A.args),U={};for(let[c,w]of q)U[c]=$n(w,v);let l=[o.on??[]].flat(),r=new Map(A.exprs),a=$.find(c=>"create"in c),L=(c,w,u,O=null)=>{if(V(c)&&"expr"in c)return ne(r.get(c.expr),{graph:u,subject:O,kinds:g,bindings:w,today:i()});let b=me(c);return b===void 0?typeof c=="string"&&c.startsWith("$$")?c.slice(1):c:b==="now"?new Date().toISOString():b==="today"?i():w[b]},$e=(c,w)=>{if(!a)return"";let u=n.kinds[a.create].fields,O=N(a.create),b=[];for(let[x,te]of Object.entries(a.set??{})){try{O[x]=L(te,c,w)??O[x]}catch{}let X=me(te);X&&c[X]!==void 0&&b.push(x)}let K=G(O).trim(),W=b.filter(x=>O[x]!==!1&&u[x].type!=="text"&&!(/[^]{41}/.test(O[x])||/ .*[.!?]$/.test(O[x])&&!/[ .][A-Z]\w{0,3}\.$/.test(O[x]))&&G({...O,[x]:void 0}).trim()===K).map(x=>O[x]===!0?u[x].label??we(x):hn(O[x],u[x].format,i(),[],v));return K&&W.length>0?`${K} (${W.join(", ")})`:K};Y.push(sn(y,{input:be(U),title:R,...o.description?{description:o.description}:{},...o.fromTheOtherEnd?{fromTheOtherEnd:o.fromTheOtherEnd}:{},...q.has(B)?{subject:{kinds:l.length>0?l:"*",arg:B}}:{},...Q?{destructive:!0}:{},...H?{idempotent:!0}:{},...S.length>0?{creates:S}:{},...h.length>0?{connects:h}:{},...z.length>0?{severs:z}:{},writes:Z,...Object.keys(C).length>0?{writesOther:C}:{},...Object.keys(I).length>0?{sets:I}:{},...D?{allowedOn:(c,w)=>{let u=c.getNode(w);if(!u||l.length>0&&!l.includes(u.kind))return!1;try{return ne(D,{graph:c,subject:u,kinds:g,bindings:{},today:i()})===!0}catch{return!1}}}:{},describe:(c,w)=>{let u=typeof c[B]=="string"?w.getNode(c[B]):void 0,O=u?G(u):$e(c,w);return O?`${R}: ${O}`:R},apply(c,w){let u=c.graph,O=typeof w[B]=="string"?w[B]:void 0,b=O?u.getNode(O):void 0;if(O&&!b&&ce(O),b&&l.length>0&&!l.includes(b.kind))throw new J(`"${R}" acts on ${l.join(" or ")}, not on ${We(b.kind)}`,"invalid");let K={};for(let[d,f]of Object.entries(w))f!==void 0&&(K[d]=f);if(D&&b){let d;try{d=ne(D,{graph:u,subject:b,kinds:g,bindings:K,today:i()})}catch(f){throw f instanceof se?new J(`"${R}" could not be judged: ${f.sentence}`):f}if(d!==!0)throw new J(P?de(P,{node:b,kinds:g,graph:u,bindings:K,today:i(),money:v}):`"${R}" is not allowed for ${G(b)} right now`)}let W=new Map,x=d=>u.has(d)||[...W.values()].includes(d),te=new Set,X=d=>{let f=tn(d);te.has(f)||(te.add(f),c.removeEdge(d))},ee=(d,f)=>{let m=me(d);if(m==="subject")return O;if(m==="me"){let k=c.me;if(k&&n.kinds[u.getNode(k)?.kind]?.people)return k;throw new J(`"${R}" is done as you, and you have no record here`)}if(W.has(m))return W.get(m);try{return L(d,K,u,f??b??null)}catch(k){throw k instanceof se?new J(`"${R}" could not work out a value: ${k.sentence}`):k}};for(let d of $)if("create"in d){let f=n.kinds[d.create],m=N(d.create);for(let[he,ke]of Object.entries(d.set??{})){let Ge=ee(ke,void 0);Ge!==void 0&&(m[he]=Ge)}let k=Sn(f),j=String((k&&m[k])??d.create),ye=an(j,d.create,m,(he,ke)=>on(n.policy?.sees,he,ke)),re=c.freshId(ye?d.create:j,d.create,m);c.addNode({...m,id:re}),d.as&&W.set(d.as,re)}else if("connect"in d||"sever"in d){let f="connect"in d?d.connect:d.sever,m=String(ee(d.from,void 0)??""),k=String(ee(d.to,void 0)??"");if(x(m)||ce(m),x(k)||ce(k),"connect"in d){if(p.get(f)?.cardinality==="one")for(let j of u.out(m,f))j.id!==k&&X({kind:f,from:m,to:j.id});u.out(m,f).some(j=>j.id===k)||c.addEdge({kind:f,from:m,to:k})}else X({kind:f,from:m,to:k})}else if("set"in d){let f=String(ee(d.target??"$subject",void 0)??""),m=u.getNode(f);!m&&!x(f)&&ce(f);let k={};for(let[j,ye]of Object.entries(d.set)){let re=ee(ye,m);re!==void 0&&(k[j]=re)}Object.keys(k).length>0&&c.patchNode(f,k)}else if("remove"in d){let f=String(ee(d.remove,void 0)??"");u.has(f)||ce(f),c.removeNode(f)}else if("replace"in d&&b){let f=w.to;for(let m of d.replace){let k=p.get(m)?.from.includes(b.kind)??!0;for(let j of k?u.out(b.id,m):u.in(b.id,m))m===d.keep&&j.id===f||X(k?{kind:m,from:b.id,to:j.id}:{kind:m,from:j.id,to:b.id})}}}}))}let Le=[];for(let[y,o]of Object.entries(n.rules??{})){let{title:A,require:R,when:$,says:D}=e.rules[y],P=o.repairs??[],Q=(S,h,z=i(),Z)=>{let C=[],I={graph:S,subject:h,kinds:g,today:z,...Z?{linked:Z}:{},onUnread:l=>C.push(l)},q;try{if($&&ne($,I)!==!0)return[];if(q=ne(R,I)===!0,!q&&C.length>0)throw new se(`it reads ${mn(C[0])}`,0)}catch(l){throw l instanceof yn?new rn(l.sentence):l instanceof se?new Error(l.sentence):l}if(q)return[];let U=P.flatMap(l=>{let r=n.acts?.[l.act],a={},L=h&&r?.on&&r.fromTheOtherEnd&&![r.on].flat().includes(h.kind)?Tn(e.acts[l.act].args,h.kind):void 0;L?a[L]=h.id:h&&(r?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(l.act))&&(a[B]=h.id);for(let[w,u]of Object.entries(l.args??{}))a[w]=me(u)==="subject"?h?.id:u;let c=(r?e.acts[l.act].args:[]).filter(([w,u])=>u.required&&a[w]===void 0).map(([w])=>w);return[{mutation:l.act,label:l.label??(L?r.fromTheOtherEnd:r?.title)??l.act.replace(/-/g," "),args:a,...c.length>0?{missing:c}:{}}]});return[{invariant:y,...h?{subjectId:h.id}:{},label:A,message:D?de(D,{node:h,kinds:g,graph:S,today:z,money:v}):h?`${G(h)}: ${A}`:A,nodeIds:h?[h.id]:[],repairs:U}]},H={label:A,shape:{over:o.over,require:R,when:$,says:D,declared:n.kinds,money:v,kinds:g,today:i},judgment:{require:o.require,...o.when?{when:o.when}:{},...o.says?{says:o.says}:{}},...o.description?{description:o.description}:{},...P.length>0?{repairs:P.map(S=>S.act)}:{}};Le.push(o.over==="graph"?Re(y,{scope:"graph",...H,evaluate:({graph:S,today:h,context:z})=>Q(S,null,h,z?.linked)}):Re(y,{scope:{kind:o.over},...H,evaluate:({graph:S,subject:h,today:z,context:Z})=>Q(S,h,z,Z?.linked)}))}let Te=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:_,mutations:Y,invariants:Le,...Te?{policy:Te}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...n.publishing?{publishing:n.publishing}:{},...n.purpose?{purpose:n.purpose}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return xn(ge,n),Gn.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:g}}function Mn(e,s,n){let t=s||e.format==="duration",i=e.format==="money"||e.format==="percent"||!e.format&&e.unit!==void 0;if(!(!t&&!i))return{...e,...t?{as:"duration"}:{},...i?{amount:{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}}:{}}}export{Rn as a,qn as b,An as c,B as d,me as e,Sn as f,yt as g,Pn as h};
@@ -1 +0,0 @@
1
- import{a as ee,b as re,c as R}from"./chunk.5IEFTFKQ.js";import{a as O,b as B}from"./chunk.VKHAAH32.js";import{a as Y,e as Z}from"./chunk.MK72IRIY.js";import{e as z,f as J,g as _,h as Q,i as U,j as X}from"./chunk.DHJI7LIW.js";import"./chunk.QL77K3D4.js";import{G as q,Ia as j,Ja as M,M as H,O as T,T as G,ca as b,ja as x,ma as V,na as D,pa as C,ra as I}from"./chunk.N7T7VB77.js";import"./chunk.SDO3U72B.js";import"./chunk.F7PIW2EM.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var i=v(q(),1);var o=v(G(),1),ne=e=>({...e.node?{node:{id:e.node.id}}:{},...e.nodes?{nodes:e.nodes.map(n=>({id:n.id}))}:{},...e.label!==void 0?{label:e.label}:{},fidelity:e.fidelity,cardinality:e.cardinality,mode:e.mode,selected:e.selected,...e.implicated?{implicated:e.implicated}:{},...e.flagged?{flagged:e.flagged}:{}});function E(e){let n=T(),r=n?.past?.seq,s=n?.host?.viewAt,t=(0,i.useMemo)(()=>r===void 0||!s||e.draft?void 0:s(e.manifest.name,r),[s,r,e]);return(0,i.useMemo)(()=>t===null?null:t===void 0?e:{...e,worker:t},[t,e])}function N({definition:e,store:n,principal:r,input:s,goTo:t,places:a,scheme:d,brand:l,onFailure:m,drawsItsOwn:u,tick:p}){let w=(0,i.useRef)(null),f=(0,i.useRef)(null),y=H(),k=(0,i.useContext)(M),c=(0,i.useRef)({input:s,goTo:t,places:a,onFailure:m,brand:l,hostFiles:y,told:k});c.current={input:s,goTo:t,places:a,onFailure:m,brand:l,hostFiles:y,told:k},(0,i.useEffect)(()=>{let P=w.current;if(!P)return;let A=e.file??(c.current.hostFiles?.src?g=>c.current.hostFiles?.src?.(g)??g:void 0);typeof e.worker=="function"&&R(e.worker).catch(()=>{});let $=B(O,({mountWorkerView:g})=>{f.current=g(P,{manifest:e.manifest,worker:e.worker,store:n,principal:r,input:()=>c.current.input?.()??{},goTo:()=>c.current.goTo,places:()=>c.current.places?.()??[],brand:()=>c.current.brand,onFailure:(W,K)=>c.current.onFailure(W,K),...u?{fallback:!1}:{},...e.limits?{limits:e.limits}:{},...e.author?{author:e.author}:{},...e.onProblem?{onProblem:e.onProblem}:{},...e.asset?{asset:e.asset}:{},...A?{file:A}:{},...e.images?{images:e.images}:{},...e.links?{links:e.links}:{},files:()=>c.current.hostFiles,onContentHeight:W=>c.current.told?.(W)})});return()=>{$(),f.current?.dispose(),f.current=null}},[e,n,r]),(0,i.useEffect)(()=>f.current?.update(),[d,l,p]);let h=(0,o.jsx)("div",{ref:w,"data-worker-view-place":e.manifest.name,style:{minWidth:0}});if(!e.draft)return h;let F=e.manifest.title??e.manifest.name;return(0,o.jsxs)("div",{role:"group","aria-label":`Draft: ${F}`,"data-graview-draft-view":e.manifest.name,style:{display:"grid",gap:8,alignContent:"start",minWidth:0},children:[(0,o.jsxs)("p",{"data-testid":"draft-view-line",style:te,children:[(0,o.jsxs)("span",{children:["Draft \u2014 ",(0,o.jsx)("span",{style:{color:"var(--graview-ink)",fontWeight:600},children:F})]}),(0,o.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,o.jsx)("span",{children:"Not kept"})]}),h]})}var te={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};function L({view:e,props:n,fellBack:r}){return(0,o.jsx)("div",{"data-worker-view-fallback":"",...r?{"data-worker-view-fell-back":r.name,"data-worker-view-failed":r.reason}:{},style:{display:"contents"},children:(0,o.jsx)(e,{...n})})}function oe({name:e,reason:n,children:r}){return(0,o.jsx)("div",{"data-worker-view-fell-back":e,"data-worker-view-failed":n,style:{display:"contents"},children:r})}function S(e,n={}){let r=n.fallback,s=e.manifest.replaces==="page";function t(a){let d=b(),l=x(),m=(0,i.useContext)(j),[u,p]=(0,i.useState)(null),w=(0,i.useRef)(a);w.current=a;let f=E(e);if(!d)return null;if(f===null)return r&&!(m&&V(r)&&!s)?(0,o.jsx)(L,{view:r,props:a}):null;if(u&&r)return m&&V(r)&&!s?null:(0,o.jsx)(L,{view:r,props:a,fellBack:{name:e.manifest.name,reason:u}});let y=n.beside&&!(m&&V(n.beside))?n.beside:void 0,k=(0,o.jsx)(N,{definition:f,store:d.store,principal:d.principal,input:()=>ne(w.current),goTo:l,places:()=>d.views.places(),scheme:d.scheme,brand:d.brand,tick:a,drawsItsOwn:r!==void 0,onFailure:(c,h)=>{p(c),e.onFailure?.(c,h)}});return y?(0,o.jsxs)("div",{"data-worker-view-beside":e.manifest.name,style:{display:"grid",gap:12,minWidth:0},children:[k,(0,o.jsx)(y,{...a})]}):k}return t.displayName=`WorkerView(${e.manifest.name})`,t}function ae(e,n){let{manifest:r}=n;if(r.attach==="home"){if(!e.home)throw new Error(`The worker view "${r.name}" is the home's body: draw it with workerHome, on the home.`);let u=e.homes?.(),p=n.draft?void 0:u?u.filter(f=>f.name===void 0).at(-1)?.view:e.homeView?.(),w=S(n,p?{fallback:p}:{});return e.home(r.bleed===!0?C(w):w,n.draft?void 0:{name:r.name}),e}let s={cardinality:r.cardinality,fidelity:"full"},t=e.lookup(r.attach,s)??e.resolve(r.attach,s)?.view,a=r.cardinality==="one",d=n.draft===!0,l=S(n,{...t&&!d?{fallback:t}:{},...a&&r.replaces!=="page"&&t?{beside:t}:{}});r.replaces==="page"&&D(l);let m=t?.says;return a&&r.replaces!=="page"&&typeof m=="function"&&(l.says=m),r.bleed===!0&&C(l),l.flows=r.flows!==!1,r.heading==="own"&&(l.ownHeading=!0),I(l,r.scene?.maxHeight!==void 0?{maxHeight:r.scene.maxHeight}:{}),e.register(r.attach,s,l,r.title?{title:r.title,...d?{}:{name:r.name},lens:"view",...r.reads?.kinds?.length?{reads:r.reads.kinds}:{}}:d?void 0:{name:r.name}),e}function ie(e,n={}){let r=n.fallback;function s({context:t}){let a=b(),d=x(),[l,m]=(0,i.useState)(null),u=E(e);return l&&r?(0,o.jsx)(oe,{name:e.manifest.name,reason:l,children:(0,o.jsx)(r,{context:t})}):u===null&&r?(0,o.jsx)(r,{context:t}):u===null?null:(0,o.jsx)(N,{definition:u,store:t.store,principal:t.principal??a?.principal??{kind:"human"},goTo:d,...a?{places:()=>a.views.places(),scheme:a.scheme,brand:a.brand}:{},drawsItsOwn:r!==void 0,onFailure:(p,w)=>{m(p),e.onFailure?.(p,w)}})}return s.displayName=`WorkerHome(${e.manifest.name})`,s}export{J as checkManifest,ee as checkViewSource,Z as judgeCodeAct,z as manifestActs,U as readsComputed,ae as registerWorkerView,Y as sightIsTotal,_ as unreadEdges,Q as unreadEdgesSentence,re as viewScript,ie as workerHome,S as workerView,X as workerViewProps};