graview 0.1.60 → 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 (228) 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.QDSEVPF3.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.2GEJNG2U.js +1 -0
  8. package/dist/preview/{chunk.7N32AVIJ.js → chunk.2N4Z5K5S.js} +1 -1
  9. package/dist/preview/{chunk.NHUQ2N6J.js → chunk.3FON2Y72.js} +1 -1
  10. package/dist/preview/chunk.3L37FY3G.js +4 -0
  11. package/dist/preview/{chunk.ZYM2SSGW.js → chunk.4HEFUOLV.js} +1 -1
  12. package/dist/preview/chunk.4HRYB7HF.js +1 -0
  13. package/dist/preview/{chunk.YZ7FUKAL.js → chunk.4TX6VCBT.js} +1 -1
  14. package/dist/preview/{chunk.IGJZ4UH3.js → chunk.5HGD6OWL.js} +2 -2
  15. package/dist/preview/{chunk.2USDHXB4.js → chunk.5J3O2FVG.js} +1 -1
  16. package/dist/preview/{chunk.H45Q3O4F.js → chunk.5MZYCELA.js} +1 -1
  17. package/dist/preview/{chunk.SRVQJZRT.js → chunk.5ODHHH35.js} +1 -1
  18. package/dist/preview/{chunk.HDUO2USQ.js → chunk.5STU3KYG.js} +1 -1
  19. package/dist/preview/{chunk.TFWIG6LL.js → chunk.5YAOKOGV.js} +1 -1
  20. package/dist/preview/{chunk.BQIHNT7C.js → chunk.66P5IDTH.js} +1 -1
  21. package/dist/preview/{chunk.M4UD4ARP.js → chunk.6AKW7TXM.js} +1 -1
  22. package/dist/preview/{chunk.URWAFZHF.js → chunk.6JO5HQDR.js} +1 -1
  23. package/dist/preview/{chunk.HUJ6YTWE.js → chunk.75GVFX7L.js} +1 -1
  24. package/dist/preview/{chunk.A3ZXDG6V.js → chunk.7KVUUEZA.js} +1 -1
  25. package/dist/preview/{chunk.FFTYMBBT.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.7XLS6XTY.js +1 -0
  29. package/dist/preview/chunk.7YOAW7ED.js +1 -0
  30. package/dist/preview/{chunk.FBJARKDT.js → chunk.A3OL2BI2.js} +1 -1
  31. package/dist/preview/{chunk.NGTRL5U4.js → chunk.A3ZC2JBO.js} +1 -1
  32. package/dist/preview/{chunk.A5PDXNY6.js → chunk.ACTXR2MI.js} +1 -1
  33. package/dist/preview/chunk.AFNSAQEQ.js +1 -0
  34. package/dist/preview/chunk.AI34V6WV.js +74 -0
  35. package/dist/preview/{chunk.3XGA65Y3.js → chunk.AJSUHPBE.js} +1 -1
  36. package/dist/preview/chunk.AQRB7LDA.js +1 -0
  37. package/dist/preview/{chunk.GNBIVVL3.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.LSY256J4.js → chunk.CHHYIMB7.js} +1 -1
  44. package/dist/preview/chunk.CXDGE5ZS.js +1 -0
  45. package/dist/preview/{chunk.CC5BJH5A.js → chunk.CY3ELWCM.js} +1 -1
  46. package/dist/preview/chunk.DC35FJAB.js +1 -0
  47. package/dist/preview/{chunk.AVBTPSQF.js → chunk.DD2NKFDX.js} +1 -1
  48. package/dist/preview/{chunk.6HF6POIX.js → chunk.DDO3GLEJ.js} +1 -1
  49. package/dist/preview/{chunk.TLJOZSDD.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.P6RORYOT.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.IGVASEZU.js → chunk.ELOFPE25.js} +1 -1
  57. package/dist/preview/{chunk.MVWC3VR3.js → chunk.ELTV44HU.js} +2 -2
  58. package/dist/preview/chunk.EVBCEEQ4.js +1 -0
  59. package/dist/preview/{chunk.TKVLNBRD.js → chunk.F7YXLYLX.js} +1 -1
  60. package/dist/preview/{chunk.DCHQHKSA.js → chunk.FULEUL34.js} +1 -1
  61. package/dist/preview/{chunk.VNDKKTED.js → chunk.G4ULQK64.js} +14 -14
  62. package/dist/preview/{chunk.Y7G3OGDE.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.GTKJJYQH.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.MJVYWLQQ.js → chunk.ILIIBSGA.js} +1 -1
  71. package/dist/preview/chunk.IQ3PRWGO.js +104 -0
  72. package/dist/preview/{chunk.NC7FXY2H.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.ULL6ZIJJ.js → chunk.J7Q2WAF4.js} +1 -1
  76. package/dist/preview/{chunk.TLWT67ON.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.FRYBMS3W.js → chunk.KMV6PJFL.js} +1 -1
  82. package/dist/preview/{chunk.RXYNW5QB.js → chunk.L3WTKQQL.js} +1 -1
  83. package/dist/preview/chunk.LAYQ5PFS.js +1 -0
  84. package/dist/preview/{chunk.KBVTLNS5.js → chunk.LGRLVJGS.js} +3 -3
  85. package/dist/preview/chunk.LTZUF5VG.js +1 -0
  86. package/dist/preview/{chunk.OLFJH4RK.js → chunk.M4AYA2PL.js} +1 -1
  87. package/dist/preview/chunk.M7RESZB6.js +25 -0
  88. package/dist/preview/{chunk.WXUFATY5.js → chunk.MAKODQO3.js} +1 -1
  89. package/dist/preview/{chunk.F6V7RWDK.js → chunk.MDEX6ZVE.js} +1 -1
  90. package/dist/preview/chunk.MGALQLRW.js +1 -0
  91. package/dist/preview/{chunk.7OPM55I2.js → chunk.MYNMBOLD.js} +1 -1
  92. package/dist/preview/chunk.N6EJXXQK.js +2 -0
  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.VFOON3Z3.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.VUBNBTJP.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.EL5ICOOM.js → chunk.OUDATENL.js} +1 -1
  104. package/dist/preview/chunk.OUPURRDE.js +1 -0
  105. package/dist/preview/{chunk.Y5C4RXG7.js → chunk.OWOOKLIU.js} +2 -1
  106. package/dist/preview/{chunk.PI44XMY2.js → chunk.OWT3VVOT.js} +1 -1
  107. package/dist/preview/{chunk.VDMDPZ6U.js → chunk.PCDUV3WP.js} +1 -1
  108. package/dist/preview/chunk.PD2DECOP.js +1 -0
  109. package/dist/preview/{chunk.ZXOT3IXJ.js → chunk.PKWQKFPE.js} +1 -1
  110. package/dist/preview/{chunk.ENL2JJ47.js → chunk.PLTH2LW5.js} +1 -1
  111. package/dist/preview/{chunk.ZP5RT2EK.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.VADQ7ZGA.js → chunk.QGU5QTR6.js} +1 -1
  115. package/dist/preview/chunk.QHY5NVYH.js +1 -0
  116. package/dist/preview/{chunk.6ZQAR5ZA.js → chunk.QIPASE42.js} +1 -1
  117. package/dist/preview/{chunk.7MHCGVGM.js → chunk.RD2X25XB.js} +1 -1
  118. package/dist/preview/chunk.RMR24LFJ.js +4 -0
  119. package/dist/preview/chunk.ROZTJ6IY.js +6 -0
  120. package/dist/preview/{chunk.RQOX5YDW.js → chunk.RPDH32XV.js} +1 -1
  121. package/dist/preview/chunk.RRKI24WY.js +1 -0
  122. package/dist/preview/{chunk.HDP3PS7N.js → chunk.RYRQ66JN.js} +1 -1
  123. package/dist/preview/chunk.SEHRPTNA.js +7 -0
  124. package/dist/preview/chunk.SGCW2XRC.js +1 -0
  125. package/dist/preview/{chunk.JPONLMU7.js → chunk.SS7234R6.js} +1 -1
  126. package/dist/preview/{chunk.BXDM3UMN.js → chunk.SVPKUWZU.js} +1 -1
  127. package/dist/preview/{chunk.LQVAABPS.js → chunk.SWMDFXUX.js} +1 -1
  128. package/dist/preview/{chunk.6WHAWOO7.js → chunk.T3UQ7ZQK.js} +1 -1
  129. package/dist/preview/chunk.T6PU3NKP.js +1 -0
  130. package/dist/preview/{chunk.6C2MHWSX.js → chunk.T6WHGKWR.js} +1 -1
  131. package/dist/preview/{chunk.QBLKTFF4.js → chunk.THVC2BEC.js} +1 -1
  132. package/dist/preview/{chunk.KDRLUBVF.js → chunk.TIALD6SC.js} +1 -1
  133. package/dist/preview/{chunk.Z2ERZ4S6.js → chunk.TM4EPUNO.js} +1 -1
  134. package/dist/preview/chunk.U5P23GO7.js +1 -0
  135. package/dist/preview/chunk.U6ZRJKVM.js +1 -0
  136. package/dist/preview/chunk.UFDJXQQQ.js +32 -0
  137. package/dist/preview/{chunk.IOK4GVJC.js → chunk.UKQUUPKE.js} +1 -1
  138. package/dist/preview/{chunk.TAT2IQUR.js → chunk.UQQKDBIH.js} +1 -1
  139. package/dist/preview/{chunk.QHDCTAD7.js → chunk.UVA7AALY.js} +1 -1
  140. package/dist/preview/chunk.UXMPFPFH.js +20 -0
  141. package/dist/preview/chunk.VACKSKGJ.js +1 -0
  142. package/dist/preview/{chunk.3UOKUF5Z.js → chunk.VC3V7HLL.js} +1 -1
  143. package/dist/preview/chunk.VIH5AX7S.js +5 -0
  144. package/dist/preview/{chunk.4LR64TPU.js → chunk.VJBBVLGZ.js} +1 -1
  145. package/dist/preview/chunk.VN23AGIY.js +1 -0
  146. package/dist/preview/{chunk.VZJWJ5XM.js → chunk.W4BKYSZX.js} +1 -1
  147. package/dist/preview/{chunk.CQT3W2SF.js → chunk.WEOVK2T4.js} +1 -1
  148. package/dist/preview/chunk.WKI5INH7.js +1 -0
  149. package/dist/preview/chunk.WPXPVD33.js +88 -0
  150. package/dist/preview/chunk.X6KYRBL6.js +1 -0
  151. package/dist/preview/chunk.Y2YYH3JN.js +1 -0
  152. package/dist/preview/chunk.Y4FZKUOK.js +1 -0
  153. package/dist/preview/chunk.Y4S7CDRB.js +1 -0
  154. package/dist/preview/{chunk.YFSBVZTG.js → chunk.YP2QSPXU.js} +1 -1
  155. package/dist/preview/{chunk.VWJGQDCE.js → chunk.Z2TDZSMN.js} +1 -1
  156. package/dist/preview/chunk.ZN3PUM2I.js +1 -0
  157. package/dist/preview/index.html +53 -51
  158. package/dist/preview/page.js +2 -2
  159. package/dist/preview/splash.js +57 -0
  160. package/package.json +6 -6
  161. package/dist/preview/chunk.2K4TT2BV.js +0 -1
  162. package/dist/preview/chunk.37TVS7CA.js +0 -1
  163. package/dist/preview/chunk.3IZ3ABII.js +0 -1
  164. package/dist/preview/chunk.3MOJF7BA.js +0 -1
  165. package/dist/preview/chunk.3V4WP7RY.js +0 -18
  166. package/dist/preview/chunk.3ZT5WQYL.js +0 -1
  167. package/dist/preview/chunk.4MP72LPR.js +0 -25
  168. package/dist/preview/chunk.4TCKEG6I.js +0 -1
  169. package/dist/preview/chunk.5DD62IOW.js +0 -21
  170. package/dist/preview/chunk.5YOLUDVO.js +0 -1
  171. package/dist/preview/chunk.644FUGSX.js +0 -1
  172. package/dist/preview/chunk.67U6M7OV.js +0 -1
  173. package/dist/preview/chunk.7TFLRR7D.js +0 -1
  174. package/dist/preview/chunk.7VKSXGTX.js +0 -1
  175. package/dist/preview/chunk.BF6S5UE4.js +0 -1
  176. package/dist/preview/chunk.BLPYNNR4.js +0 -1
  177. package/dist/preview/chunk.BRT27WON.js +0 -1
  178. package/dist/preview/chunk.BYKD5RLA.js +0 -1
  179. package/dist/preview/chunk.C7OLSEWK.js +0 -1
  180. package/dist/preview/chunk.CFKZXLXS.js +0 -1
  181. package/dist/preview/chunk.CMN6BBAD.js +0 -1
  182. package/dist/preview/chunk.D7YSL3NK.js +0 -2
  183. package/dist/preview/chunk.EQXB7LKI.js +0 -1
  184. package/dist/preview/chunk.ERFT54HT.js +0 -1
  185. package/dist/preview/chunk.FLUK3UXF.js +0 -1
  186. package/dist/preview/chunk.G3R4BTI7.js +0 -1
  187. package/dist/preview/chunk.G4YJPKRG.js +0 -5
  188. package/dist/preview/chunk.GLWSVSQL.js +0 -1
  189. package/dist/preview/chunk.I4XQBQRC.js +0 -1
  190. package/dist/preview/chunk.IBOKXVWN.js +0 -1
  191. package/dist/preview/chunk.IHBUBZQT.js +0 -2
  192. package/dist/preview/chunk.JEYQBH33.js +0 -32
  193. package/dist/preview/chunk.JJGCTGWA.js +0 -1
  194. package/dist/preview/chunk.KGW75Z5L.js +0 -3
  195. package/dist/preview/chunk.KI37ZEV3.js +0 -1
  196. package/dist/preview/chunk.KNYLY7MH.js +0 -1
  197. package/dist/preview/chunk.L6AWE76F.js +0 -1
  198. package/dist/preview/chunk.LGEA5257.js +0 -6
  199. package/dist/preview/chunk.LLYRFVIN.js +0 -104
  200. package/dist/preview/chunk.LZIBQ3VX.js +0 -1
  201. package/dist/preview/chunk.MDJWK5W2.js +0 -1
  202. package/dist/preview/chunk.MSWWWLEA.js +0 -1
  203. package/dist/preview/chunk.PFSYXD6Q.js +0 -1
  204. package/dist/preview/chunk.PHC2MI4C.js +0 -1
  205. package/dist/preview/chunk.PHJ6WPWH.js +0 -1
  206. package/dist/preview/chunk.PNW5K7BW.js +0 -1
  207. package/dist/preview/chunk.PXQVXBNG.js +0 -1
  208. package/dist/preview/chunk.QFUMFQJU.js +0 -1
  209. package/dist/preview/chunk.QI4SLPQ4.js +0 -4
  210. package/dist/preview/chunk.QUJS63OJ.js +0 -13
  211. package/dist/preview/chunk.SB2PZKN5.js +0 -88
  212. package/dist/preview/chunk.T7LQD67N.js +0 -20
  213. package/dist/preview/chunk.TY4GQJKC.js +0 -1
  214. package/dist/preview/chunk.UDCDK7XJ.js +0 -4
  215. package/dist/preview/chunk.UITT6JWW.js +0 -2
  216. package/dist/preview/chunk.UJTE7UAP.js +0 -1
  217. package/dist/preview/chunk.UQWTZJBV.js +0 -1
  218. package/dist/preview/chunk.VMV464JK.js +0 -1
  219. package/dist/preview/chunk.VSCIXAHN.js +0 -5
  220. package/dist/preview/chunk.W3W54DSX.js +0 -1
  221. package/dist/preview/chunk.WC3DENU4.js +0 -67
  222. package/dist/preview/chunk.WQ6RCEUQ.js +0 -1
  223. package/dist/preview/chunk.X6A4VSSD.js +0 -1
  224. package/dist/preview/chunk.XGASJAV2.js +0 -7
  225. package/dist/preview/chunk.XR6YR6RV.js +0 -1
  226. package/dist/preview/chunk.XZPKBHJT.js +0 -1
  227. package/dist/preview/chunk.YEBGI6ED.js +0 -1
  228. package/dist/preview/chunk.YH63KQ2G.js +0 -1
@@ -1,67 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{c as sr}from"./chunk.VNDKKTED.js";import{G as R,Ga as O,Ma as hn,Na as vn,Oa as bn,Ra as U,T as S,Va as Q,a as Pe,ba as ce,ca as Y,e as Le,l as un,la as yn,m as fn,s as gn,ta as wn,v as re,z as mn}from"./chunk.4MP72LPR.js";import{a as C}from"./chunk.SDO3U72B.js";import{Ac as Ze,Ad as ne,Bd as rn,Dd as xe,Fd as tn,Gd as an,Hc as z,Hd as j,Ic as Je,Jc as Xe,Lc as en,Mc as nn,Od as on,Pd as sn,Qd as ln,Rd as dn,Sd as cn,Td as Se,Xd as pn,_a as Ue,ga as ze,ka as je,la as Ye,pb as Qe,zd as de}from"./chunk.VSCIXAHN.js";import{b as v}from"./chunk.AJZBJBMO.js";var Ee=v(R(),1),kn=new WeakMap,pe=e=>{let n=kn.get(e);return n||kn.set(e,n={open:null,drawn:0,listeners:new Set}),n},lr=e=>{for(let n of[...e.listeners])n()},dr=0;function kt(e,n){let t=pe(e);t.open=n?{...n,at:++dr}:null,lr(t)}var xn=e=>n=>{let t=pe(e);return t.listeners.add(n),()=>void t.listeners.delete(n)};function Sn(e){let n=()=>e?pe(e).drawn>0:!1;return(0,Ee.useSyncExternalStore)(e?xn(e):cr,n,n)}var cr=()=>()=>{};function xt(e){let n=()=>pe(e).open;return(0,Ee.useSyncExternalStore)(xn(e),n,n)}var V=v(R(),1),Pn=v(sr(),1);function pr(e){let[n,t]=(0,V.useState)(null),[r,o]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{e.current!==r&&o(e.current)}),(0,V.useLayoutEffect)(()=>{if(!r||typeof ResizeObserver>"u")return;let a=()=>Math.round(r.getBoundingClientRect().width),i=a();t(i);let p=new ResizeObserver(()=>{let c=a();c!==i&&(i=c,(0,Pn.flushSync)(()=>t(c)))});return p.observe(r),()=>p.disconnect()},[r]),n}function ur(e=!0){let[n,t]=(0,V.useState)();return(0,V.useEffect)(()=>{if(!e)return t(void 0);let r=0,o=()=>t(innerHeight),a=()=>{o(),clearTimeout(r),r=window.setTimeout(o,300)},i=p=>{for(let[c,d]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])c?.[p](d,a)};return i("addEventListener"),o(),()=>{clearTimeout(r),i("removeEventListener")}},[e]),n}var ue={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var L=v(R(),1);var T=v(S(),1),Ln=6e3;function fr(){let e=[],n=0,t=new Set,r=new Map,o,a=()=>{for(let d of[...t])d()},i=d=>{if(clearTimeout(r.get(d.id)),r.delete(d.id),d.kind!=="toast")return;let u=(d.actions?.length??0)+(d.action?1:0),l=d.timeout??(u>0?!1:Ln);l!==!1&&r.set(d.id,setTimeout(()=>o?.()?i(d):p(d.id),l))},p=d=>{clearTimeout(r.get(d)),r.delete(d),e.some(u=>u.id===d)&&(e=e.filter(u=>u.id!==d),a())},c=d=>{e=e.some(u=>u.id===d.id)?e.map(u=>u.id===d.id?d:u):[...e,d],i(d),a()};return{notify(d){let u=d.id??`notice-${++n}`;return c({...d,id:u,said:++n}),{id:u,dismiss:()=>p(u),update:l=>{let g=e.find(w=>w.id===u);g&&c({...g,...l,id:u,kind:g.kind,said:l.sentence!==void 0&&l.sentence!==g.sentence?++n:g.said})}}},dismiss:p,hold(d){o=d},list:()=>e,subscribe(d){return t.add(d),()=>t.delete(d)}}}function gr({notices:e}){let n=e.reduce((p,c)=>!p||c.said>p.said?c:p,void 0),[t,r]=(0,L.useState)(""),[o,a]=(0,L.useState)(""),i=(0,L.useRef)(0);return(0,L.useEffect)(()=>{if(!n||n.said===i.current)return;i.current=n.said;let p=n.tone==="bad";(p?a:r)("");let c=setTimeout(()=>(p?a:r)(n.sentence),50);return()=>clearTimeout(c)},[n]),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ue,children:t}),(0,T.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ue,children:o})]})}var mr=(0,L.createContext)(null);function yr({board:e,anchor:n}){let t=(0,L.useSyncExternalStore)(e.subscribe,e.list,e.list);return(0,L.useEffect)(()=>vr(Ae.prefetch),[]),(0,T.jsxs)(T.Fragment,{children:[t.length>0?(0,T.jsx)(L.Suspense,{fallback:null,children:(0,T.jsx)(hr,{notices:t,anchor:n,board:e})}):null,(0,T.jsx)(gr,{notices:t})]})}var Ae=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.KI37ZEV3.js")))),wr=()=>Ae.load().then(()=>{},()=>{}),hr=Ae.part((e,n)=>(0,T.jsx)(e.NoticeStacks,{...n}),{quiet:!0});function vr(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(o)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}var M=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.X6A4VSSD.js","./chunk.YZ7FUKAL.js","./chunk.KDRLUBVF.js","./chunk.PNW5K7BW.js","./chunk.ENL2JJ47.js","./chunk.BQIHNT7C.js","./chunk.TAT2IQUR.js","./chunk.3XGA65Y3.js","./chunk.2K4TT2BV.js","./chunk.VZJWJ5XM.js","./chunk.GZHZLJBF.js","./chunk.IOK4GVJC.js","./chunk.OJGHDWI6.js","./chunk.TLJOZSDD.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.IGJZ4UH3.js"))));var y=v(R(),1);var Tn=v(R(),1);var En=v(R(),1);function Te(e){return(0,En.useMemo)(()=>e===void 0||e===""?void 0:{__html:e},[e])}var $=v(S(),1);function He({brand:e,size:n=22}){let t=en(e),r=An(t?.light),o=r?An(t?.dark):void 0,a=Te(r!==void 0&&z(r)?r:void 0),i=Te(o!==void 0&&z(o)?o:void 0),p={display:"inline-flex",flex:"0 0 auto",height:n,color:"var(--graview-accent)"},c=nn(e);if(c)return(0,$.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...p,alignItems:"center",fontSize:`${n*.86/16}rem`,lineHeight:1},children:c});if(!r)return null;let d=e?.logoAlt??e?.name??"",u=d!==""&&d!==e?.name,l=u?{role:"img","aria-label":d}:{"aria-hidden":!0};if(o){let w=(h,x,b)=>z(h)?(0,$.jsx)("span",{className:"graview-logo-face","data-graview-scheme-only":b,dangerouslySetInnerHTML:x}):(0,$.jsx)("img",{className:"graview-logo-face","data-graview-scheme-only":b,src:h,alt:""});return(0,$.jsxs)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...l,children:[w(r,a,"light"),w(o,i,"dark")]})}let g=t?.darkFallback==="invert"?{"data-graview-logo-fallback":"invert"}:{};return z(r)?(0,$.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...g,...l,dangerouslySetInnerHTML:a}):(0,$.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:r,alt:u?d:"",...g,style:{...p,width:"auto"}})}function An(e){if(!(!e||!Xe(e)))return z(e)&&Je(e)!==null?void 0:e}function br(e){(0,Tn.useEffect)(()=>{if(!e||typeof document>"u")return;let n=[...document.querySelectorAll('link[rel~="icon"]')],t=n.map(o=>o.getAttribute("href")),r;n.length===0&&(r=document.createElement("link"),r.rel="icon",r.setAttribute("data-graview-favicon",""),document.head.appendChild(r),n.push(r));for(let o of n)o.href=e;return()=>{r&&r.remove(),n.forEach((o,a)=>{o!==r&&t[a]!==null&&t[a]!==void 0&&o.setAttribute("href",t[a])})}},[e])}var s=v(S(),1),kr=M.part((e,n)=>(0,s.jsx)(e.TidyFoot,{...n}),{quiet:!0}),xr=M.part((e,n)=>(0,s.jsx)(e.Here,{...n}),{quiet:!0});function Sr(){let e=Y(),[n,t]=(0,y.useState)("");return(0,y.useEffect)(()=>e?.store.subscribe((r,o)=>{o.some(a=>a.author.id!==e.principal.id)&&M.load().then(a=>a.sayTheirChange(o,e,t),String)}),[e]),(0,s.jsx)("span",{role:"status",className:"graview-bar-said",children:n})}var Hn="home",Bn="/",q="scene:whole";function Pr(e){let{store:n,principal:t,views:r}=e,o=n.kindsKeptFrom(t),a=n.schema.kinds.filter(f=>!n.modules.disabledKinds.has(f)&&!o.has(f)),i=r?.arrangement?.(),p=r?.places()??[],c=dn(i,n.schema,p),d=ln(n.schema,i,[...n.modules.administered.values()].flatMap(f=>f.kinds??[])),u=(f,P)=>(!n.graph.size.nodes||n.graph.count(f)>0)&&(c?P?c.places.has(`${f}|${P}`):c.kinds.has(f):!d.has(f)),l=[{key:Hn,label:"Home",path:Bn,group:"home",primary:!0}],g=p.filter(f=>a.includes(f.kind)&&f.as!==cn),w=g.filter(f=>!f.hidden),h=new Set(ne(w).map(f=>j(f,p,n.schema).toLowerCase())),x=f=>tn(f.as,an(f,p)?xe(n.schema,f.kind).slice(1):void 0),b=new Set(i?.hide??[]),H=pn(a,i?.order,w);for(let{kind:f,view:P}of H){if(P){l.push({key:`place:${P.kind}:${P.as}`,label:j(P,p,n.schema),path:x(P),group:"lists",kind:f,primary:c?c.places.has(`${f}|${P.as}`):!0});continue}let W=je(n.schema,f),B=h.has(W.toLowerCase());l.push({key:`kind:${f}`,label:B?Ye(n.schema,f):W,path:xe(n.schema,f),group:"lists",kind:f,primary:B||b.has(f)?!1:u(f),...b.has(f)?{hidden:!0}:{}})}for(let f of ne(g)){if(H.some(B=>B.view&&de(B.view,f)))continue;let P=x(f),W=[f.kind,...f.over??[]].some(B=>a.includes(B)&&u(B,f.as));l.some(B=>B.path===P)||l.push({key:`place:${f.kind}:${f.as}`,label:j(f,p,n.schema),path:P,group:"pictures",kind:f.kind,primary:W,hidden:f.hidden})}return a.some(f=>Object.keys(n.schema.tryDefinition(f)?.edges??{}).length>0)&&l.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),l}function Lr(e,n){let[t="/",r=""]=n.split("?"),o=e.find(i=>i.path===(r?`${t}?${r}`:t))??e.find(i=>i.path===t);if(o)return o.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return e.find(i=>i.group==="lists"&&i.path===a)?.key??null}var Nn=(0,y.createContext)(null),Er=()=>(0,y.useContext)(Nn),Z=30,Mn=48,te=640,Me=4,Be=2;function Cn(e){let{widths:n,current:t,room:r,more:o,gap:a=Me,primary:i,most:p=sn}=e;if(n.length===0||!(r>0)||!(o>0)||n.some(l=>!(l>0)))return null;let c=(l,g)=>l.reduce((w,h)=>w+n[h],0)+a*Math.max(0,l.length-1)+(g?a+o:0),d=(l,g)=>t<0||!l.includes(t)||l.slice(0,g).includes(t)?l.slice(0,g):[...l.filter(w=>w!==t).slice(0,g-1),t].sort((w,h)=>w-h),u=d(n.map((l,g)=>g).filter(l=>i?.[l]!==!1||l===t),p);if(c(u,u.length<n.length)<=r)return u.length>=Be?u:null;for(let l=u.length-1;l>=Be;l--){let g=d(u,l);if(c(g,!0)<=r)return g}return null}var Ar=`
2
- .graview-bar{display:block;margin:0;padding:0;container:graview-bar/inline-size;flex:0 0 auto;position:relative;background:var(--graview-bar);border-bottom:1px solid var(--graview-edge);color:var(--graview-ink);font-family:var(--graview-font-body,system-ui)}
3
- .graview-bar-row{display:flex;flex-wrap:nowrap;align-items:center;gap:16px;height:${Mn-1}px;margin:0;padding:0 16px}
4
- .graview-bar-home,.graview-bar-face,.graview-bar-place,.graview-bar-item,.graview-bar-at{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;margin:0;border:0;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-decoration:none;color:var(--graview-ink);cursor:pointer;text-align:left}
5
- .graview-bar-app{display:flex;flex:0 1 auto;max-width:50%}
6
- .graview-bar-app::after{content:"";flex:0 100000 auto;width:2px;min-width:0}
7
- .graview-bar-name{margin:0;display:flex;font-family:var(--graview-font-display,var(--graview-font-body,system-ui));font-size:.9375rem;font-weight:600;line-height:1.25}
8
- .graview-bar-home{gap:8px;min-width:auto;min-height:30px;padding:0;letter-spacing:-.005em}
9
- .graview-bar-app-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;word-break:normal}
10
- .graview-bar-faces{display:inline-flex;flex:0 0 auto;box-sizing:border-box;height:30px;margin:0;padding:2px;gap:2px;border:1px solid var(--graview-edge);border-radius:8px}
11
- .graview-bar-face{gap:6px;padding:0 10px;border-radius:6px;font-size:.8125rem;white-space:nowrap;color:var(--graview-ink-muted)}
12
- .graview-bar-face span{min-width:0;max-width:11em;overflow:hidden;text-overflow:ellipsis}
13
- .graview-bar-face[aria-pressed=true]{color:var(--graview-ink);font-weight:600;background:color-mix(in srgb,var(--graview-accent) 16%,transparent)}
14
- [data-switch-drawn=icons] .graview-bar-face{padding:0 8px}
15
- .graview-bar-said,[data-switch-drawn=icons] .graview-bar-face span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
16
- .graview-bar-mid{display:flex;flex:1 100 0;min-width:0}
17
- .graview-bar-mid[data-place]{min-width:9em;flex-basis:auto}
18
- .graview-bar-place-at{position:relative;display:inline-flex;min-width:0;max-width:100%}
19
- .graview-bar-place{gap:6px;height:30px;max-width:100%;padding:0 8px;border:1px solid transparent;border-radius:8px;font-size:.875rem;font-weight:600}
20
- .graview-bar-face:hover,.graview-bar-place:hover{border-color:var(--graview-edge);color:var(--graview-ink)}
21
- .graview-bar-place-words{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
22
- .graview-bar-mid[data-places=standing]{flex:0 0 auto}
23
- .graview-bar-places{display:flex;align-items:center;gap:${Me}px;min-width:0;margin:0;padding:0}
24
- .graview-bar-at{gap:6px;flex:0 0 auto;height:30px;padding:0 8px;border-block:2px solid transparent;border-radius:0;font-size:.875rem;font-weight:500;white-space:nowrap;color:var(--graview-ink-muted)}
25
- .graview-bar-at:is(:hover,[aria-current],[aria-expanded=true]){color:var(--graview-ink)}
26
- .graview-bar-at[aria-current]{font-weight:600;border-bottom-color:var(--graview-accent)}
27
- .graview-bar-ruler{position:absolute;left:0;top:0;display:flex;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none}
28
- .graview-bar-ruler .graview-bar-at{font-weight:600}
29
- .graview-bar-ruler>.graview-bar-name{flex:none;white-space:nowrap;letter-spacing:-.005em}
30
- .graview-bar-list{display:grid;align-content:start;width:min(320px,calc(100vw - 24px));height:auto;max-height:min(70vh,560px);overflow:auto;margin:0;padding:6px;border-radius:10px;border:1px solid var(--graview-edge);background:var(--graview-float);box-shadow:var(--graview-lift-high);color:var(--graview-ink)}
31
- .graview-bar-list[hidden]{display:none}
32
- .graview-bar-list p{margin:8px 8px 2px;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--graview-ink-muted)}
33
- .graview-bar-list ul,.graview-bar-list li{display:grid;margin:0;padding:0;list-style:none}
34
- .graview-bar-item{align-items:flex-start;gap:10px;width:100%;padding:7px 8px;border-radius:7px;font-size:.875rem;line-height:1.3;overflow-wrap:anywhere}
35
- .graview-bar-item:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
36
- .graview-bar-item[aria-current]{font-weight:600;background:color-mix(in srgb,var(--graview-accent) 14%,transparent)}
37
- .graview-bar-mark{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:14px;height:1.3em;color:var(--graview-ink-muted)}
38
- .graview-bar :focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}
39
- .graview-bar-tools{display:contents}
40
- .graview-bar-tools>*{margin-left:-8px}
41
- .graview-bar-tools>:is(.graview-bar-find,.graview-bar-find-open){margin-left:auto}
42
- .graview-bar-own{display:flex;align-items:center;flex:0 0 auto}
43
- .graview-bar-own:empty{display:none}
44
- .graview-bar-find{position:relative;display:flex;min-width:7.5rem;flex:0 600 9rem;--graview-bar-find-end:3.25em}
45
- .graview-bar-find-slot{display:flex;flex:1;min-width:0}
46
- .graview-bar-find-keys{position:absolute;right:10px;line-height:30px;pointer-events:none;font-size:.75rem;color:var(--graview-ink-faint)}
47
- .graview-bar-find:is(:focus-within,:has(input:not(:placeholder-shown))){flex-basis:16rem;--graview-bar-find-end:10px}
48
- :is(:focus-within,:has(input:not(:placeholder-shown)))>.graview-bar-find-keys,.graview-bar-find-open{display:none}
49
- .graview-bar-line{display:flex;flex:0 0 auto;padding:6px 8px;background:var(--graview-ground);border-bottom:1px solid var(--graview-edge);font-family:var(--graview-font-body,system-ui)}
50
- .graview-bar-line .graview-bar-place{height:auto;min-height:32px}
51
- .graview-bar-line .graview-bar-place-words{white-space:normal}
52
- @media (pointer:coarse){.graview-bar-find-keys{display:none}}
53
- @container graview-bar (max-width: ${te-1}px){
54
- .graview-bar-row{gap:10px;padding:0 12px}
55
- .graview-bar-app,.graview-bar-home{max-width:none;flex:1 1 auto;min-width:28px}
56
- .graview-bar-name,.graview-bar-app-name{min-width:0}
57
- .graview-bar-mid,.graview-bar-find{display:none}
58
- .graview-bar-find-open{display:inline-flex}
59
- .graview-bar-own{--graview-activity-mark:inline}
60
- .graview-bar-own .graview-activity-word{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
61
- .graview-bar[data-finding] :is(.graview-bar-app,.graview-bar-faces,.graview-bar-find-open){display:none}
62
- .graview-bar[data-finding] .graview-bar-find{display:flex;flex:1 1 auto;min-width:0}
63
- }
64
- @container graview-bar (max-width: 300px){
65
- .graview-bar-row{gap:4px;padding:0 10px}
66
- }`,J={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,minWidth:Z,height:Z,padding:0,borderRadius:8,border:"1px solid transparent",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.875rem",cursor:"pointer",flex:"0 0 auto"};function Tr({brand:e,name:n,heading:t=1,home:r,faces:o,places:a,current:i,reach:p,tools:c,find:d=!0,description:u,findBox:l,onFind:g,switch:w="words",scenePlaces:h,skips:x,named:b=!0}){let H=(0,y.useRef)(null),De=Y()?.who.size,[f,P]=(0,y.useState)(null),[W,B]=(0,y.useState)(null),[A,Un]=(0,y.useState)(!1),[Qn,Ie]=(0,y.useState)(!1),[Zn,Jn]=(0,y.useState)(!0),[$e,Xn]=(0,y.useState)(null),oe=o?o.pages.current:!h,ee=oe?{places:a,current:i,reach:p}:h,he=ee&&{...ee,places:rn(ee.places),here:ee.places.find(m=>m.key===ee.current)?.label},k=he&&he.places.length>0?he:null,ve=k?k.places.findIndex(m=>m.key===k.current):-1,_e=!!o&&w==="words",Ke=k?k.places.map(m=>m.primary===!1?"0":"1").join(""):"",I=(0,y.useCallback)(()=>{let m=H.current;if(!m)return;let N=$r(m,ve,_e,Ke);N!==void 0&&Xn(N);let G=N?!0:Br(m);G!==null&&Jn(G)},[ve,_e,Ke]);(0,y.useLayoutEffect)(()=>{let m=H.current;if(!m)return;let N=()=>{let le=m.getBoundingClientRect().width;Un(le<te),m.style.setProperty("--graview-bar-width",`${Math.round(le)}px`),I()};N();let G=typeof document>"u"?void 0:document.fonts;if(G?.ready.then(I),G?.addEventListener?.("loadingdone",I),typeof ResizeObserver>"u")return()=>G?.removeEventListener?.("loadingdone",I);let ke=new ResizeObserver(N);ke.observe(m);for(let le of m.querySelectorAll(".graview-bar-tools > *"))ke.observe(le);return()=>{ke.disconnect(),G?.removeEventListener?.("loadingdone",I)}},[I]);let be=(0,y.useRef)(g);be.current=g,(0,y.useLayoutEffect)(()=>{be.current?.(d&&f?{slot:f,compact:A,own:W}:null)},[d,f,A,W]),(0,y.useLayoutEffect)(()=>()=>be.current?.(null),[]);let er=(0,y.useCallback)(()=>{Ie(!0),requestAnimationFrame(()=>f?.querySelector("input")?.focus())},[f]),We=(0,y.useRef)(null),ie=(0,y.useRef)(!1),Ge=(0,y.useCallback)(()=>{Ie(!1),ie.current&&(ie.current=!1,requestAnimationFrame(()=>We.current?.focus()))},[]),nr=t===!1?"span":`h${t}`,rr=r.href!==void 0?"a":"button",tr=m=>N=>{!m||!On(N)||(N.preventDefault(),m())},ar=!oe,qe=k&&!A&&$e!==null&&!(ve<0&&k.here)?$e.split(",").map(Number).filter(m=>m<k.places.length):null,se=k?(0,s.jsx)(Dr,{places:k.places,current:k.current,here:k.here,reach:k.reach,scene:ar,stands:qe}):null,or=k?k.places.map(m=>m.label).join(`
67
- `):"";(0,y.useLayoutEffect)(I,[I,n,e,or,k?.current,oe,A,w,d]);let ir=w==="icons"||!Zn||A?"icons":"words";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("header",{ref:H,className:"graview-bar","data-testid":"app-bar","data-graview-app-bar":"",...Qn&&A?{"data-finding":""}:{},children:[(0,s.jsx)("style",{children:Ar}),x,(0,s.jsxs)("div",{className:"graview-bar-row",children:[b?(0,s.jsx)("div",{className:"graview-bar-app",children:(0,s.jsx)(nr,{className:"graview-bar-name",children:(0,s.jsxs)(rr,{...r.href!==void 0?{href:r.href,onClick:tr(r.go)}:{type:"button",onClick:r.go},"data-testid":"app-home",...r.current?{"aria-current":"page"}:{},title:u?`${n} \u2014 ${u}`:`${n} \u2014 home`,className:"graview-bar-home",children:[(0,s.jsx)(He,{brand:e,size:20}),(0,s.jsx)("span",{className:"graview-bar-app-name","data-testid":"app-name",children:n})]})})}):null,o?(0,s.jsx)(Hr,{faces:o,form:w,drawn:ir}):null,(0,s.jsx)("div",{className:"graview-bar-mid",...qe?{"data-places":"standing"}:!A&&se?{"data-place":""}:{},children:A?null:se}),!A&&k&&k.places.length>1?(0,s.jsxs)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-ruler":"",children:[k.places.map(m=>(0,s.jsx)("span",{className:"graview-bar-at",children:m.label},m.key)),(0,s.jsxs)("span",{className:"graview-bar-at",children:[Ne,(0,s.jsx)(Vn,{})]})]}):null,b?(0,s.jsx)("span",{className:"graview-bar-ruler","aria-hidden":"true",children:(0,s.jsx)("span",{className:"graview-bar-name",children:n})}):null,(0,s.jsxs)("div",{className:"graview-bar-tools",children:[d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"graview-bar-find-open",ref:We,"data-testid":"app-find-open","aria-label":"Find",title:"Find",onClick:er,style:{...J,display:void 0},children:(0,s.jsx)(Rr,{})}),(0,s.jsxs)("div",{className:"graview-bar-find","data-testid":"app-find",onBlur:m=>{let N=m.relatedTarget;N instanceof Node&&m.currentTarget.contains(N)||m.currentTarget.querySelector("input")?.value||Ge()},onKeyDownCapture:m=>{m.key==="Escape"&&A&&(ie.current=!0)},onKeyDown:m=>{m.key!=="Escape"||!A||(!m.defaultPrevented||!m.currentTarget.querySelector("input")?.value?Ge():ie.current=!1)},children:[(0,s.jsx)("div",{ref:P,className:"graview-bar-find-slot",children:l}),(0,s.jsx)(Mr,{})]})]}):null,(0,s.jsx)("div",{ref:B,className:"graview-bar-own","data-graview-bar-own":""}),De?(0,s.jsx)(y.Suspense,{fallback:null,children:(0,s.jsx)(xr,{scene:!oe,compact:A})}):null,(0,s.jsx)(Sr,{}),c]})]})]}),A&&se?(0,s.jsx)("div",{className:"graview-bar-line","data-graview-place-line":"","data-testid":"app-place-line",children:se}):null]})}function Hr({faces:e,form:n,drawn:t}){let r=o=>{let a=e[o];return(0,s.jsxs)("button",{type:"button",className:"graview-bar-face","data-testid":`app-face-${o}`,"aria-pressed":a.current,title:a.label,...a.reach&&!a.current?{onPointerEnter:a.reach,onPointerDown:a.reach,onFocus:a.reach}:{},onClick:()=>{a.current||a.go()},children:[o==="scene"?(0,s.jsx)(Fn,{}):(0,s.jsx)(Cr,{}),(0,s.jsx)("span",{children:a.label})]})};return(0,s.jsxs)("div",{className:"graview-bar-faces",role:"group","aria-label":`${e.scene.label} or ${e.pages.label}`,"data-testid":"app-faces","data-switch":n,"data-switch-drawn":t,children:[r("scene"),r("pages")]})}function Br(e){let n=e.querySelector(".graview-bar-faces"),t=e.querySelector(".graview-bar-mid"),r=e.querySelector(".graview-bar-find");if(!n||!t||r?.matches(":focus-within")||e.getBoundingClientRect().width<te)return null;let a=In(n),i=t.querySelector(".graview-bar-place-words"),p=i?parseFloat(getComputedStyle(i).fontSize)||14:0,c=i?Math.min(i.scrollWidth+34,14*p):0,d=Rn(e);if(d===null)return!1;let u=t.getBoundingClientRect().width-c-d;if(r&&r.getBoundingClientRect().width>0){let l=parseFloat(getComputedStyle(r).flexBasis);isFinite(l)&&(u-=Math.max(0,l-r.getBoundingClientRect().width))}return n.getAttribute("data-switch-drawn")==="icons"?u>=a+2:u>=-1}function Rn(e){let n=e.querySelector(".graview-bar-app"),t=e.querySelector(".graview-bar-ruler>.graview-bar-name");if(!n||!t)return 0;let r=i=>i?.getBoundingClientRect().width??0,o=r(n.firstElementChild)-r(e.querySelector(".graview-bar-app-name"))+r(t)+2,a=parseFloat(getComputedStyle(n).maxWidth)/100*(n.parentElement.clientWidth-2*n.offsetLeft)||1/0;return o>a+.5?null:Math.max(0,o-r(n))}var On=e=>e.button===0&&!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey);function Nr(){let e=globalThis.navigator?.platform??"";return/Mac|iPhone|iPad|iPod/.test(e)?"\u2318K":"Ctrl K"}function Mr(){let e=Sn(Y()?.aiDesk);return(0,s.jsx)("span",{className:"graview-bar-find-keys","data-testid":"app-find-keys","aria-hidden":"true",children:e?"/":Nr()})}function ae({size:e,box:n=e,children:t}){return(0,s.jsx)("svg",{width:e,height:e,viewBox:`0 0 ${n} ${n}`,"aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:t})}function Fn(){return(0,s.jsxs)(ae,{size:14,children:[(0,s.jsx)("path",{d:"M7 1.5 L12.5 4.5 L7 7.5 L1.5 4.5 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M1.5 7.5 L7 10.5 L12.5 7.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",strokeLinecap:"round"})]})}function Cr(){return(0,s.jsxs)(ae,{size:14,children:[(0,s.jsx)("rect",{x:"2.25",y:"1.75",width:"9.5",height:"10.5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,s.jsx)("path",{d:"M4.5 5 H9.5 M4.5 7.25 H9.5 M4.5 9.5 H7.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Vn(){return(0,s.jsx)(ae,{size:10,children:(0,s.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Rr(){return(0,s.jsxs)(ae,{size:16,children:[(0,s.jsx)("circle",{cx:"7",cy:"7",r:"4.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,s.jsx)("path",{d:"M10.5 10.5 L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Or({place:e}){if(e.key===q)return(0,s.jsx)(Fn,{});if(e.group==="home")return(0,s.jsx)(ae,{size:13,box:14,children:(0,s.jsx)("path",{d:"M2 6.5 L7 2 L12 6.5 V12 H2 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})});let n=e.kind?`hsl(${Math.round(Ze(e.kind))} 55% 52%`:"rgb(128 128 128";return(0,s.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:12,height:8,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",background:e.group==="lists"?`${n})`:`linear-gradient(${n}), ${n})) center / 6px 4px no-repeat, ${n} / 0.35)`}})}var Fr=[{group:"home"},{group:"lists",heading:"Lists"},{group:"pictures",heading:"Pictures"}],Ne="More";function Dn({place:e,current:n,reach:t,standing:r,done:o}){let a=e.key===n,i=t.href?.(e.path);return(0,s.jsxs)(i!==void 0?"a":"button",{className:r?"graview-bar-at":"graview-bar-item","data-testid":`app-place-${e.key}`,"data-place-path":e.path,...a?{"aria-current":"page"}:{},...i!==void 0?{href:i}:{type:"button"},onClick:c=>{o(),t.go&&(i!==void 0&&!On(c)||(c.preventDefault(),t.go(e)))},children:[r?null:(0,s.jsx)("span",{className:"graview-bar-mark",children:(0,s.jsx)(Or,{place:e})}),r&&a?(0,s.jsx)("span",{"data-testid":"app-place-current",children:e.label}):(0,s.jsx)("span",{children:e.label})]})}function Vr({places:e,current:n,reach:t,id:r,done:o}){return(0,s.jsx)(s.Fragment,{children:Fr.map(({group:a,heading:i})=>{let p=e.filter(d=>d.group===a);if(p.length===0)return null;let c=`${r}-${a}`;return(0,s.jsxs)("div",{role:"group",...i?{"aria-labelledby":c}:{"aria-label":p[0].label},"data-place-group":a,children:[i?(0,s.jsx)("p",{id:c,children:i}):null,(0,s.jsx)("ul",{children:p.map(d=>(0,s.jsx)("li",{children:(0,s.jsx)(Dn,{place:d,current:n,reach:t,standing:!1,done:o})},d.key))})]},a)})})}function Dr({places:e,current:n,here:t,reach:r,scene:o,stands:a}){let i=Q("places"),p=(0,y.useRef)(a);i.open||(p.current=a);let c=p.current,u=e.find(b=>b.key===n)?.label??t??"Places",l=c?e.filter((b,H)=>!c.includes(H)):e,g=Ir(e,n,o),w=Y(),h=w?.keptViews?.current(),x=!!(h&&(h.removed.length>0||w.views.places().some(b=>b.hidden)||h.may.lenses&&(w.views.arrangement?.()?.hide?.length??0)>0));return(0,s.jsxs)("nav",{className:c?"graview-bar-places":"graview-bar-place-at","aria-label":o?"What the scene shows":"The app\u2019s places",...c?{"data-testid":"app-places-standing"}:{},...g,children:[c?.map(b=>(0,s.jsx)(Dn,{place:e[b],current:n,reach:r,standing:!0,done:()=>{}},e[b].key)),l.length>0||x?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:c?"graview-bar-at":"graview-bar-place","data-testid":"app-places-open",...i.trigger,onClick:i.toggle,"aria-label":c?`${Ne} \u2014 ${l.length} more ${o?"pictures":"places"}`:`${u} \u2014 ${o?"everything the scene shows":"every place"}`,title:c?l.map(b=>b.label).join(", "):u,children:[c?Ne:(0,s.jsx)("span",{className:"graview-bar-place-words","data-testid":"app-place-current",children:u}),(0,s.jsx)(Vn,{})]}),(0,s.jsxs)("div",{...i.pane,"data-testid":"app-places",hidden:!i.open,className:"graview-bar-list",style:U,children:[(0,s.jsx)(Vr,{places:l,current:n,reach:r,id:i.pane.id,done:()=>i.setOpen(!1)}),x&&i.open?(0,s.jsx)(y.Suspense,{fallback:null,children:(0,s.jsx)(kr,{id:i.pane.id,scene:o,reach:r,done:()=>i.setOpen(!1)})}):null]})]}):null]})}function Ir(e,n,t){let r=Y()?.setMenuAt,o=a=>{let i=a.target.closest?.("[data-place-path],[data-testid=app-places-open]");if(!i||!r)return;let p={at:0};a.type==="pointerdown"?document.addEventListener("pointerup",()=>p.at||=Date.now(),{once:!0}):a.preventDefault();let c=a.nativeEvent;M.load().then(d=>d.placeGesture(c,i,e,n,t,r,p),String)};return{onContextMenu:a=>a.shiftKey||o(a),onKeyDown:a=>(a.key==="ContextMenu"||a.key==="F10"&&a.shiftKey)&&o(a),onPointerDown:a=>a.pointerType!=="mouse"&&a.isPrimary&&o(a)}}function $r(e,n,t,r){let o=e.querySelector("[data-graview-bar-ruler]"),a=e.querySelector(".graview-bar-mid");if(!o||!a)return null;let i=e.querySelector(".graview-bar-find");if(i?.matches(":focus-within"))return;if(e.getBoundingClientRect().width<te)return null;let p=Rn(e);if(p===null)return null;let c=[...o.children].map(H=>H.getBoundingClientRect().width),d=c.pop()??0,u=e.querySelector(".graview-bar-faces"),l=u&&t?In(u):0,g=u?.getAttribute("data-switch-drawn")==="words"?l:0,w=a.getBoundingClientRect().left+p,h=i?.getBoundingClientRect(),x=h&&h.width>0?h.right-w-(parseFloat(getComputedStyle(i).minWidth)||0)-16:a.getBoundingClientRect().width-p,b=[...r].map(H=>H!=="0");return Cn({widths:c,current:n,room:Math.floor(x+g-l),more:d,primary:b})?.join(",")??null}function In(e){return[...e.querySelectorAll(".graview-bar-face span")].reduce((n,t)=>n+t.scrollWidth+10,0)}var _r=e=>`graview:lenses:${e}`,Kr=(e,n)=>e?.name??n.kinds.join(",");function Ce(e){try{let n=JSON.parse(localStorage.getItem(_r(e))??"[]");return Array.isArray(n)?n.filter(t=>typeof t?.title=="string"&&typeof t.lens=="string"):[]}catch{return[]}}var _=v(R(),1);var E=v(S(),1);function Wr({scheme:e,onScheme:n,profileHref:t,keeping:r,hostActions:o=Gr,signature:a=!1}){let{store:i,principal:p,seats:c,people:d}=ce(),u=Q("profile"),l=u.open,[g,w]=(0,_.useState)(!1);(0,_.useEffect)(()=>jr(fe),[]),l&&!g&&w(!0),(0,_.useEffect)(()=>{l&&fe()},[l]);let h=p.id===void 0?void 0:i.graph.getNode(p.id),x=h===void 0?p.id===void 0?"Nobody in particular":Ue(p,{graph:i.graph,schema:i.schema,seats:c,people:d}):ze(i.schema.tryDefinition(h.kind),h);return(0,E.jsxs)("div",{style:{position:"relative"},children:[(0,E.jsx)("button",{type:"button","data-testid":"profile-button",...u.trigger,onClick:u.toggle,onPointerEnter:fe,onFocus:fe,"aria-label":`${x} \u2014 you, your seat and your settings`,title:`${x} \u2014 you, your seat and your settings`,style:{...J,borderRadius:999},children:(0,E.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:Z-4,height:Z-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:Yr(x)})}),(0,E.jsxs)("section",{...u.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!l,style:{...U,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:l?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[g?(0,E.jsx)(_.Suspense,{fallback:null,children:(0,E.jsx)(qr,{part:"top",name:x,me:h,profileHref:t,hostActions:o,close:()=>u.setOpen(!1)})}):null,(0,E.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:Qr,children:[(0,E.jsx)("span",{style:Ur,children:"Keeping this app"}),r]}),g?(0,E.jsx)(_.Suspense,{fallback:null,children:(0,E.jsx)(zr,{part:"rest",name:x,me:h,scheme:e,onScheme:n,hostActions:o,signature:a,close:()=>u.setOpen(!1)})}):null]})]})}var Gr=[],fe=()=>M.prefetch(),qr=M.part((e,n)=>(0,E.jsx)(e.ProfilePane,{...n}),{what:"The rest of your menu"}),zr=M.part((e,n)=>(0,E.jsx)(e.ProfilePane,{...n}),{quiet:!0});function jr(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(o)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}function Yr(e){return(e.trim()[0]??"?").toUpperCase()}var Ur={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},Qr={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function Zr(e){return!(e==="hidden"||e===!1)}var Re=v(R(),1);var $n="The whole thing",ge=e=>`scene:${e.kind}:${e.as}`;function _n(e){let{view:n}=e,t=e.places.filter(l=>!e.hidden.has(l.kind)),r=ne(t),o=(l,g)=>{if(l===q)return un(fn(g,!0),"view",null);let w=r.find(h=>ge(h)===l);return w?mn(g,w.over?.find(h=>g.focusId===re(h))??w.kind,w.as):null},a=n.within?.view,i=l=>n.focusId===re(l.kind)&&(a===void 0?t.filter(g=>g.kind===l.kind).at(-1)===l:a===l.as),p=t.find(l=>i(l)&&(a!==void 0||!n.overview)),c=p?r.find(l=>de(l,p)):void 0,d=r.filter(l=>!l.hidden||l===c);return{places:[{key:q,label:$n,path:`${Se}${Le(o(q,Pe))}`,group:"home"},...d.map(l=>({key:ge(l),label:j(l,t,e.schema),path:`${Se}${Le(o(ge(l),Pe))}`,group:"pictures",kind:l.kind,hidden:l.hidden}))],current:c?ge(c):q,to:o}}function Jr(){let{store:e,views:n,hiddenKinds:t}=ce(),{view:r,go:o}=bn(),a=n.places(),i=(0,Re.useMemo)(()=>_n({places:a,hidden:t,view:r,schema:e.schema}),[a,t,r,e.schema]),p=(0,Re.useMemo)(()=>({go:c=>{let d=i.to(c.key,r);d&&o(d)}}),[i,r,o]);return{places:i.places,current:i.current,reach:p}}var X=v(R(),1);var F=v(S(),1),Xr=M.part((e,n)=>(0,F.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"}),Oe=()=>M.prefetch();function et({clean:e="All rules hold"}){let n=vn(),{set:t}=hn(),r=n.length,[o,a]=(0,X.useState)(!1),i=Q("problems",{open:o&&r>0,onOpenChange:a}),p=i.open,c=Wn(n,e);return(0,X.useEffect)(()=>{if(r===0)return;let d=setTimeout(Oe,1500);return()=>clearTimeout(d)},[r>0]),(0,F.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,F.jsxs)("button",{type:"button","data-testid":"standing",...i.trigger,"aria-disabled":r===0?!0:void 0,"aria-label":c,onClick:r===0?void 0:i.toggle,onPointerEnter:r===0?void 0:Oe,onFocus:r===0?void 0:Oe,title:c,style:{...J,padding:r===0?0:"0 8px",cursor:r===0?"default":"pointer",color:r===0?"var(--graview-ink-muted)":Kn(n),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,F.jsx)(Gn,{tone:r===0?"var(--graview-good)":Kn(n)}),r>0?(0,F.jsx)("span",{"aria-hidden":"true",children:r}):null]}),p?(0,F.jsx)("ol",{...i.pane,"data-testid":"problems",style:{...U,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,F.jsx)(X.Suspense,{fallback:null,children:(0,F.jsx)(Xr,{violations:n,pick:d=>{t(d.nodeIds),i.setOpen(!1)}})})}):null]})}function Wn(e,n){return e.length===0?n:`${Qe(e)} \u2014 open what is broken, and what would fix it`}var Kn=e=>e.some(n=>n.status==="could-not-judge"||n.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function Gn({tone:e}){return(0,F.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:e}})}function nt(e,n,t=[]){if(e.focusId)return e.focusId;let o=(e.selection??[]).map(gn).find(a=>a!==null)??t.find(a=>n.includes(a))??n[0]??null;return o===null?null:re(o)}var ye=v(S(),1),me=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.CFKZXLXS.js","./chunk.Y5C4RXG7.js","./chunk.7MHCGVGM.js","./chunk.FRYBMS3W.js","./chunk.NGTRL5U4.js","./chunk.3MOJF7BA.js","./chunk.LZIBQ3VX.js","./chunk.TAT2IQUR.js","./chunk.3XGA65Y3.js","./chunk.BYKD5RLA.js","./chunk.2K4TT2BV.js","./chunk.VUBNBTJP.js","./chunk.WVUJXDXZ.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.GZHZLJBF.js","./chunk.IOK4GVJC.js","./chunk.OJGHDWI6.js","./chunk.TLJOZSDD.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.3IZ3ABII.js"))));function rt(){return me.load().then(()=>{})}var tt=[{cardinality:"one",fidelity:"full",slot:"page"},{cardinality:"one",fidelity:"summary",slot:"card"},{cardinality:"one",fidelity:"glyph",slot:"row"},{cardinality:"many",fidelity:"full"},{cardinality:"many",fidelity:"summary"},{cardinality:"many",fidelity:"glyph"}];function at({schema:e,specs:n,kind:t,view:r}){let o=me.current.frameworkViews(e,n).lookup(t,{cardinality:r.cardinality,fidelity:r.fidelity});return o?(0,ye.jsx)(o,{...r}):null}var ot=me.part((e,n)=>(0,ye.jsx)(at,{...n}),{what:"This view"});function qn(e,n,t){for(let r of n.kinds){let o=t?.[r];for(let a of tt){let i=c=>(0,ye.jsx)(ot,{schema:n,specs:t,kind:r,view:c}),p=a.slot!==void 0&&o?.[a.slot]!==void 0;p&&(i.says=(c,d)=>me.current?.frameworkViews(n,t).lookup(r,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(c,d)),e.register(r,{cardinality:a.cardinality,fidelity:a.fidelity},p?i:yn(i))}}return e}function it(e,n){return qn(wn(e),e,n)}var Fe=v(R(),1);var D=v(S(),1),zn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.JEYQBH33.js","./chunk.MVWC3VR3.js","./chunk.CC5BJH5A.js","./chunk.QI4SLPQ4.js","./chunk.CFKZXLXS.js","./chunk.Y5C4RXG7.js","./chunk.7MHCGVGM.js","./chunk.FRYBMS3W.js","./chunk.LQVAABPS.js","./chunk.NGTRL5U4.js","./chunk.3MOJF7BA.js","./chunk.LZIBQ3VX.js","./chunk.HJCQ6I3S.js","./chunk.QDSEVPF3.js","./chunk.7N32AVIJ.js","./chunk.IHBUBZQT.js","./chunk.TAT2IQUR.js","./chunk.3XGA65Y3.js","./chunk.BYKD5RLA.js","./chunk.2K4TT2BV.js","./chunk.VUBNBTJP.js","./chunk.OLFJH4RK.js","./chunk.67U6M7OV.js","./chunk.ZP5RT2EK.js","./chunk.VZJWJ5XM.js","./chunk.GLWSVSQL.js","./chunk.VFOON3Z3.js","./chunk.WVUJXDXZ.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.GZHZLJBF.js","./chunk.IOK4GVJC.js","./chunk.OJGHDWI6.js","./chunk.TLJOZSDD.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.WQ6RCEUQ.js"))));function st({lens:e,view:n}){let t=zn.current.declaredLensView(e);return(0,D.jsx)(t,{...n})}var lt=zn.part((e,n)=>(0,D.jsx)(st,{...n}),{what:"This picture"});function dt(e){let n=r=>(0,D.jsx)(Fe.Suspense,{fallback:null,children:(0,D.jsx)(lt,{lens:e,view:r})});e.lens==="blocks"&&(n.flows=!0);let t=e.lens==="blocks"?e.options.blocks?.[0]:void 0;return typeof t?.headline=="string"&&(n.lede=t),e.create===!1&&(n.creates=!1),n}var jn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.CFKZXLXS.js","./chunk.Y5C4RXG7.js","./chunk.7MHCGVGM.js","./chunk.FRYBMS3W.js","./chunk.NGTRL5U4.js","./chunk.3MOJF7BA.js","./chunk.LZIBQ3VX.js","./chunk.TAT2IQUR.js","./chunk.3XGA65Y3.js","./chunk.BYKD5RLA.js","./chunk.2K4TT2BV.js","./chunk.VUBNBTJP.js","./chunk.WVUJXDXZ.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.GZHZLJBF.js","./chunk.IOK4GVJC.js","./chunk.OJGHDWI6.js","./chunk.TLJOZSDD.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.BLPYNNR4.js"))));function ct({blocks:e,view:n}){let t=jn.current.homeView(e);return(0,D.jsx)(t,{...n})}var pt=jn.part((e,n)=>(0,D.jsx)(ct,{...n}),{what:"The home"});function ut(e){let n=t=>(0,D.jsx)(Fe.Suspense,{fallback:null,children:(0,D.jsx)(pt,{blocks:e,view:t})});return Object.defineProperty(n,Symbol.for("graview.home-blocks"),{value:!0}),n}function ft(e,n){return n.home&&n.home.length>0&&e.home?.(ut(n.home)),Yn(e,n),e.arrange?.(n.pages),e}function Yn(e,n,t){for(let r of on(n).drawn){if(t&&e.places().some(i=>i.title===r.title))continue;let o=dt(r),a={title:r.title,lens:r.lens,...r.across?{across:r.across}:{},...t?{beside:t}:{},...r.hidden?{hidden:!0}:{},over:r.kinds,...t?{}:{declared:!0}};for(let i of r.kinds)e.register(i,{cardinality:"many",fidelity:"full"},o,a),e.register(i,{cardinality:"many",fidelity:"summary"},o,a)}}function gt(e,n,t){t.length>0&&Yn(e,{schema:n,lenses:t.map(({lens:r,...o})=>({...o,name:r}))},!0)}function mt(e,n,t){gt(e,n,Ce(t))}var K=v(R(),1),we=v(S(),1);var Ve=e=>`graview:first-look:${e}`;function yt(e,n){if(e.seen!==void 0)try{return typeof e.seen=="function"?e.seen():e.seen}catch{return!0}try{return window.localStorage.getItem(Ve(n))!==null}catch{return!1}}function wt(e,n){if(e.seen===void 0)try{window.localStorage.setItem(Ve(n),"seen")}catch{}}var ht=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VADQ7ZGA.js")))),vt=ht.part((e,n)=>{let t=e.FirstLookHints;return(0,we.jsx)(t,{...n})},{quiet:!0});function bt({firstLook:e,root:n,app:t}){let r=(0,K.useRef)(null);r.current=e===!0?{}:e||null;let[o,a]=(0,K.useState)(()=>r.current!==null&&typeof window<"u"&&!yt(r.current,t)),i=(0,K.useCallback)(p=>{if(a(!1),p===null)return;let c=r.current??{};wt(c,t),c.onDone?.(p)},[t]);return!o||r.current===null?null:(0,we.jsx)(K.Suspense,{fallback:null,children:(0,we.jsx)(vt,{root:n,steps:r.current.steps??[],onEnd:i})})}export{pe as a,lr as b,kt as c,Sn as d,xt as e,Te as f,br as g,pr as h,ur as i,ue as j,fr as k,mr as l,yr as m,wr as n,M as o,Pr as p,Lr as q,Nn as r,Er as s,J as t,Tr as u,Wr as v,Zr as w,Jr as x,_r as y,Kr as z,Ce as A,et as B,Wn as C,Gn as D,nt as E,ft as F,gt as G,mt as H,rt as I,it as J,bt as K};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk.JEYQBH33.js";import"./chunk.MVWC3VR3.js";import"./chunk.CC5BJH5A.js";import"./chunk.QI4SLPQ4.js";import"./chunk.CFKZXLXS.js";import"./chunk.Y5C4RXG7.js";import"./chunk.7MHCGVGM.js";import"./chunk.FRYBMS3W.js";import"./chunk.LQVAABPS.js";import"./chunk.NGTRL5U4.js";import"./chunk.3MOJF7BA.js";import"./chunk.LZIBQ3VX.js";import"./chunk.HJCQ6I3S.js";import"./chunk.QDSEVPF3.js";import"./chunk.7N32AVIJ.js";import"./chunk.IHBUBZQT.js";import"./chunk.TAT2IQUR.js";import"./chunk.3XGA65Y3.js";import"./chunk.BYKD5RLA.js";import"./chunk.2K4TT2BV.js";import"./chunk.VUBNBTJP.js";import"./chunk.OLFJH4RK.js";import"./chunk.67U6M7OV.js";import"./chunk.ZP5RT2EK.js";import"./chunk.VZJWJ5XM.js";import"./chunk.GLWSVSQL.js";import"./chunk.VFOON3Z3.js";import"./chunk.WVUJXDXZ.js";import"./chunk.7VKSXGTX.js";import"./chunk.TY4GQJKC.js";import"./chunk.6ZQAR5ZA.js";import"./chunk.W3W54DSX.js";import"./chunk.PI44XMY2.js";import"./chunk.KGW75Z5L.js";import"./chunk.GZHZLJBF.js";import"./chunk.IOK4GVJC.js";import"./chunk.OJGHDWI6.js";import"./chunk.TLJOZSDD.js";import"./chunk.MSWWWLEA.js";import"./chunk.UITT6JWW.js";import"./chunk.A5PDXNY6.js";import"./chunk.WC3DENU4.js";import"./chunk.VNDKKTED.js";import"./chunk.4MP72LPR.js";import"./chunk.SDO3U72B.js";import"./chunk.VSCIXAHN.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as D,g as ae,h as re}from"./chunk.KDRLUBVF.js";import{a as te,b as ne,c as ie}from"./chunk.PNW5K7BW.js";import{b}from"./chunk.ENL2JJ47.js";import{d as j}from"./chunk.3XGA65Y3.js";import{a as ee}from"./chunk.VZJWJ5XM.js";import{a as A}from"./chunk.MSWWWLEA.js";import{j as Z}from"./chunk.WC3DENU4.js";import{G as V,Ga as K,J as Y,O as T,P as M,Ra as Q,T as _,Va as X,ba as w,ja as J}from"./chunk.4MP72LPR.js";import{a as G}from"./chunk.SDO3U72B.js";import{$a as B,_a as q,da as F,fe as U,ga as P,zb as x}from"./chunk.VSCIXAHN.js";import{b as O}from"./chunk.AJZBJBMO.js";var c=O(V(),1);var oe=O(V(),1);function se(){let{ai:n,aiDesk:i}=w(),{entries:a}=Y(i),r=n.off===!0;return(0,oe.useEffect)(()=>{r||i.load()},[i,r]),r?[]:a}var e=O(_(),1),le=K(G(()=>(__graviewPreload(import.meta.url,["./chunk.YEBGI6ED.js","./chunk.HDUO2USQ.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.CMN6BBAD.js")))),ce=le.part((n,i)=>(0,e.jsx)(n.InteractionRow,{...i}),{quiet:!0,as:"li"}),ye=le.part((n,i)=>(0,e.jsx)(n.ActivityFilter,{...i}),{quiet:!0,as:"div"}),fe=n=>n.undoes===void 0&&n.primitives.some(i=>i.op==="remove-node"||i.op==="patch-node"&&i.after[B]===!0&&i.before[B]!==!0);function me(n){let i=[...new Set(n.ops.filter(a=>!x(a)&&fe(a)).map(a=>a.intent))].filter(a=>a!==n.intent);return i.length===0?n.intent:`${n.intent} \u2014 ${i.join("; ")}`}var de=(n,i,a=pe(n,[i]))=>({intent:me(i),author:i.author.kind,...i.author.id?{authorId:i.author.id}:{},by:i.author,...i.ops[0]?.via?{via:i.ops[0].via}:{},...i.lineage?{basis:ee(i.lineage)}:{},touched:[...new Set(i.ops.filter(r=>!x(r)).flatMap(r=>r.writes))],...we(i.ops.filter(r=>!x(r)).flatMap(r=>r.writes),a),batch:i.id,at:i.at,...i.lineage?.interaction?{interaction:i.lineage.interaction}:{},seq:i.ops.at(-1).seq+1,...i.ops.every(x)?{withheld:!0}:{}});function ve(n=4){let{store:i,principal:a}=w(),r=M(i,a),s=r.log.length;return(0,c.useMemo)(()=>{let d=r.batches(),l=pe(r,d);return ne(d,o=>r.log.get(o)).reverse().slice(0,n).map(o=>{if("batch"in o){let p=de(r,o.batch,l);return o.typed?{...p,intent:te(o.typed,r.schema,r.graph),batches:o.typed.batches.filter(k=>!k.undone).map(k=>k.id)}:p}let u=[...o.digest.batches].reverse().map(p=>de(r,p,l));return{intent:ie(o.digest),author:o.digest.author.kind,...o.digest.author.id?{authorId:o.digest.author.id}:{},by:o.digest.author,touched:[...new Set(u.flatMap(p=>p.touched))],batch:"",...u[0]?.at?{at:u[0].at}:{},seq:u[0]?.seq??0,digest:u}})},[r,s,n])}function pe(n,i){let a=new Map;for(let r of i)for(let s of r.ops)if(!x(s))for(let d of s.primitives)(d.op==="add-node"||d.op==="remove-node")&&d.node&&a.set(d.node.id,P(n.schema.tryDefinition(d.node.kind),d.node));return a}function we(n,i){let a={};for(let r of n){let s=i.get(r);s!==void 0&&(a[r]=s)}return Object.keys(a).length>0?{named:a}:{}}function ke({change:n}){let{store:i,principal:a,seats:r,people:s}=w();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[n.author==="human"&&n.by?.onBehalfOf===void 0&&(n.authorId===void 0||a.id===void 0||n.authorId===a.id)?"you":q(n.by??{kind:n.author,id:n.authorId},{graph:i.graph,schema:i.schema,seats:r,people:s}),A(n.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",A(n.via)]}):null]})}function be({change:n,goes:i}){let{store:a}=w(),[r,s]=(0,c.useState)(!1),d=n.digest??[];return(0,e.jsxs)("li",{"data-testid":"activity-digest",style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)(ke,{change:n})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:n.intent})]}),(0,e.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":r,onClick:()=>s(l=>!l),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:r?"Hide":"Show each"})]}),r?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:d.map(l=>(0,e.jsxs)("li",{"data-testid":"digest-change",style:{display:"grid",gap:3},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:l.intent}),l.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",l.basis]}):null]}),l.withheld?null:(0,e.jsx)(N,{batch:l.batch})]}),l.touched.length>0?(0,e.jsx)("div",{"data-touched":l.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:l.touched.slice(0,4).map(o=>(0,e.jsx)(H,{id:o,label:a.graph.has(o)?b(a,o):l.named?.[o]??b(a,o),go:i(o)},o))}):null]},l.batch))}):null]})}function N({batch:n}){let{store:i,principal:a,noteSeat:r}=w(),s=M(i,a),d=T()?.open??!1,l=s.log.length,[o,u]=(0,c.useState)(null),p=(0,c.useMemo)(()=>s.canUndo(n),[s,n,l]),k=(0,c.useMemo)(()=>p.ok?s.mayUndo(n,a):{ok:!0},[s,n,l,a,p]);if(d||!p.ok&&p.ops.length===0||!k.ok)return null;let f=!p.ok,I=f?p.includeBatches:[];return(0,e.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,e.jsx)("button",{type:"button","data-testid":"undo-turn",title:f?`${p.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{u(null);try{let m=typeof n=="string"?[n]:n,C=s.log.all().find(W=>m.includes(W.batch)&&W.author.kind==="agent");s.undo(f?[...m,...I]:typeof n=="string"?n:[...n],{author:a}),C&&r({type:"home",author:C.author})}catch(m){u(m instanceof Error?m.message:String(m))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...f?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:f?`undo +${I.length}`:"undo"}),o?(0,e.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:o}):null]})}function xe({seq:n,intent:i}){let a=T();if(!a)return null;let r=a.past?.seq===n;return(0,e.jsx)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${i}\u201D`,title:"Show the app as it was here","aria-pressed":r,onPointerEnter:D,onFocus:D,onClick:()=>a.show(n),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",flex:"0 0 auto"},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,e.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}function Se(){let n=()=>U(window.location.href);return(0,e.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:i=>{i.preventDefault(),window.location.assign(n())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function H({id:n,label:i,go:a}){return a?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":n,title:`Go to ${i}`,onClick:()=>a(n),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(j,{label:i})}):(0,e.jsx)(j,{label:i})}function De({calls:n,seat:i,remembers:a=!1}){let r=ve(),{store:s,principal:d,seats:l,people:o}=w(),u=se(),[p,k]=(0,c.useState)("all"),[f,I]=(0,c.useState)(!1),m=t=>t!==void 0&&(t.id===d.id||t.onBehalfOf?.id===d.id)&&d.id!==void 0,C=new Set(u.map(t=>t.id)),W=r.filter(t=>!(t.interaction!==void 0&&C.has(t.interaction))&&(!f||m(t.by))),ge=u.filter(t=>!f||m(t.by)).slice(0,4),R=[...p==="ai"?[]:W.map(t=>({at:t.at??"",change:t})),...p==="changes"?[]:ge.map(t=>({at:t.at,entry:t}))].sort((t,y)=>t.at<y.at?1:t.at>y.at?-1:0),v=M(s,d),z=n.some(t=>t.phase==="running"),ue=ae(),S=X("activity"),$=S.open,he=J(),E=T(),L=t=>v.graph.has(t)?y=>{S.setOpen(!1),E?.past&&E.show(null),he.record(y)}:null;return i===void 0&&n.length===0&&r.length===0&&u.length===0&&!a&&ue===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"activity-button",...S.trigger,onClick:S.toggle,title:z?"An agent is working":"What has happened",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:z?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[z?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,r.length>0?r.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!$&&i!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:i}):null,$?(0,e.jsxs)("section",{...S.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...Q,width:300,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...Z,margin:0},children:"Activity"}),i!==void 0?(0,e.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:n.length>0||R.length>0?9:0,...n.length>0||R.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,e.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),i]}):null,n.length>0?(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:n.slice(0,6).map((t,y)=>(0,e.jsxs)("li",{style:{display:"grid",gap:2,fontSize:"0.8125rem",lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:t.phase==="running"?"var(--graview-accent)":t.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,e.jsxs)("span",{style:{color:"var(--graview-ink)"},children:[t.mutating?"changed":"read"," \xB7"," ",v.allMutations().find(g=>g.name===t.name)?.title??F(t.name)]})]}),!t.mutating&&t.reads&&t.reads.length>0?(0,e.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(t.reads)].slice(0,3).map(g=>(0,e.jsx)(H,{id:g,label:b(v,g),go:L(g)},g)),new Set(t.reads).size>3?(0,e.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(t.reads).size-3]}):null]}):Object.values(t.args).some(g=>typeof g=="string")?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(t.args).filter(g=>typeof g[1]=="string").slice(0,3).map(([g,h])=>(0,e.jsx)(H,{id:h,label:b(v,h),go:L(h)},g))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${y}`))}):null,u.length>0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ye,{shows:p,onShows:k,mine:f,onMine:I})}):null,R.length>0?(0,e.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:R.map(({change:t,entry:y},g)=>y!==void 0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ce,{entry:y,undo:h=>(0,e.jsx)(N,{batch:h})})},`ai:${y.id}`):t.digest?(0,e.jsx)(be,{change:t,goes:L},`digest:${t.digest[0]?.batch??g}`):t.withheld?(0,e.jsx)("li",{"data-testid":"withheld-change",style:{display:"grid",gap:3,lineHeight:1.45},children:(0,e.jsx)("span",{"data-touched":"",style:{color:"var(--graview-ink-muted)",fontStyle:"italic"},children:t.intent})},`change:${g}`):(0,e.jsxs)("li",{"data-batch":t.batch,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsxs)("strong",{style:{fontWeight:600},children:[t.author==="human"&&t.by?.onBehalfOf===void 0&&(t.authorId===void 0||d.id===void 0||t.authorId===d.id)?"you":q(t.by??{kind:t.author,id:t.authorId},{graph:v.graph,schema:v.schema,seats:l,people:o}),A(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",A(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(xe,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(N,{batch:t.batches&&t.batches.length>0?t.batches.length===1?t.batches[0]:t.batches:t.batch}):null]}),(0,e.jsx)("div",{"data-touched":t.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:t.touched.slice(0,4).map(h=>(0,e.jsx)(H,{id:h,label:v.graph.has(h)?b(v,h):t.named?.[h]??b(v,h),go:L(h)},h))})]},`change:${g}`))}):null,(0,e.jsx)(re,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),a?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(Se,{})]}):null]}):null]})}export{N as a,De as b};
@@ -1,7 +0,0 @@
1
- import{l as K}from"./chunk.WC3DENU4.js";import"./chunk.VNDKKTED.js";import{G as R,T as x,ba as N,ca as $}from"./chunk.4MP72LPR.js";import"./chunk.SDO3U72B.js";import{Dd as h,Fd as k,ka as w,vd as g,wd as b,xd as f}from"./chunk.VSCIXAHN.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var u=v(R(),1);var o=v(x(),1),E=()=>()=>{};function C(e){let n=(0,u.useMemo)(()=>e?.onChange?i=>e.onChange(i):E,[e]),t=()=>e?.current()??b;return(0,u.useSyncExternalStore)(n,t,t)}var D=(e,n)=>e.lens?n.may.lenses:n.may.views;async function p(e,n,t){try{return await n(),!0}catch(i){return e?.notify({kind:"toast",tone:"bad",sentence:i instanceof Error&&i.message?i.message:t}),!1}}function H(e,n,t,i,r){let s=e.name;return p(r,()=>n==="view"&&s!==void 0?i?t.hide(s):t.show(s):t.lens?.({op:"set-lens-hidden",title:e.title,on:e.kind,hidden:i}),i?`\u201C${e.title}\u201D could not be hidden.`:`\u201C${e.title}\u201D could not be shown.`)}function L(e,n,t,i,r){return p(r,()=>t.lens?.({op:"set-lens-hidden",title:e,hidden:i}),i?`\u201C${n}\u201D could not be hidden.`:`\u201C${n}\u201D could not be shown.`)}function V(e,n,t){return p(t,()=>n.restore(e.name),`\u201C${e.title}\u201D could not be restored.`)}async function A(e,n,t,i){let r=n==="view"&&e.name!==void 0?e.name:g(e.title),s=await p(i,()=>n==="view"&&e.name!==void 0?t.remove(e.name,{title:e.title,kind:e.kind}):t.lens?.({op:"remove-lens",title:e.title,on:e.kind}),`\u201C${e.title}\u201D could not be deleted.`);return s&&i?.notify({kind:"toast",id:`deleted-view-${r}`,sentence:`Deleted \u201C${e.title}\u201D. It is under Recently deleted in the places for ${30} days.`,action:{label:"Restore",onSelect:()=>void V({name:r,title:e.title},t,i)}}),s}function G(){let e=$(),n=e?.keptViews,t=C(n),i=e?.views;return(0,u.useMemo)(()=>{if(!n||!i)return null;let r=d=>f(d,t,n),s=new Set,m=i.places().filter(d=>{if(!d.hidden||r(d)===null)return!1;let c=`${d.name??""}|${d.title}`;return s.has(c)?!1:(s.add(c),!0)}),l=e?.store.schema,y=t.may.lenses&&n.lens&&l?(i.arrangement?.()?.hide??[]).filter(d=>l.tryDefinition(d)!==void 0).map(d=>({kind:d,title:w(l,d),path:h(l,d)})):[];return{keeper:n,hidden:m,lists:y,removed:t.removed.filter(d=>D(d,t)),how:r}},[n,t,i,e?.store.schema])}function T(e,n){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(n??"en-US",{month:"short",day:"numeric"})}var I=`.graview-bar-list li.graview-bar-tidied{display:flex;align-items:flex-start;gap:8px;padding:0 0 0 2px}
2
- .graview-bar-tidied>.graview-bar-item,.graview-bar-gone{flex:1 1 auto;min-width:0}
3
- .graview-bar-gone{display:grid;gap:1px;padding:7px 8px;font-size:.875rem;line-height:1.3;overflow-wrap:anywhere;color:var(--graview-ink-muted)}
4
- .graview-bar-gone small{font-size:.75rem}
5
- .graview-bar-tidy{flex:0 0 auto;margin:3px 2px;padding:4px 10px;border:1px solid var(--graview-edge);border-radius:6px;background:none;font:inherit;font-size:.8125rem;color:var(--graview-ink);cursor:pointer}
6
- .graview-bar-tidy:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
7
- .graview-bar-tidy:focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}`;function P({place:e,scene:n,reach:t,done:i}){if(n)return(0,o.jsx)("span",{className:"graview-bar-gone",children:e.title});let r="as"in e?{key:`place:${e.kind}:${e.as}`,label:e.title,path:k(e.as),group:"pictures",kind:e.kind}:{key:`kind:${e.kind}`,label:e.title,path:e.path,group:"lists",kind:e.kind},s=t.href?.(r.path);return(0,o.jsx)(s!==void 0?"a":"button",{className:"graview-bar-item","data-testid":"app-view-hidden-place",...s!==void 0?{href:s}:{type:"button"},onClick:l=>{i(),!(!t.go||s!==void 0&&(l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey))&&(l.preventDefault(),t.go(r))},children:e.title})}function M({id:e,scene:n,reach:t,done:i}){let r=G(),{locale:s}=N(),m=(0,u.useContext)(K);if(!r||r.hidden.length===0&&r.lists.length===0&&r.removed.length===0)return null;let{keeper:l,hidden:y,lists:d,removed:c,how:S}=r;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{children:I}),y.length>0||d.length>0?(0,o.jsxs)("div",{role:"group","aria-labelledby":`${e}-hidden`,"data-place-group":"hidden",children:[(0,o.jsx)("p",{id:`${e}-hidden`,children:"Hidden"}),(0,o.jsxs)("ul",{children:[d.map(a=>(0,o.jsxs)("li",{className:"graview-bar-tidied",children:[(0,o.jsx)(P,{place:a,scene:n,reach:t,done:i}),(0,o.jsx)("button",{type:"button",className:"graview-bar-tidy","data-testid":"app-list-show","data-kind":a.kind,"aria-label":`Show \u201C${a.title}\u201D`,onClick:()=>void L(a.kind,a.title,l,!1,m),children:"Show"})]},`kind:${a.kind}`)),y.map(a=>(0,o.jsxs)("li",{className:"graview-bar-tidied",children:[(0,o.jsx)(P,{place:a,scene:n,reach:t,done:i}),(0,o.jsx)("button",{type:"button",className:"graview-bar-tidy","data-testid":"app-view-show","data-view":a.name??a.title,"aria-label":`Show \u201C${a.title}\u201D`,onClick:()=>void H(a,S(a),l,!1,m),children:"Show"})]},`${a.kind}:${a.as}`))]})]}):null,c.length>0?(0,o.jsxs)("div",{role:"group","aria-labelledby":`${e}-removed`,"data-place-group":"removed",children:[(0,o.jsx)("p",{id:`${e}-removed`,children:"Recently deleted"}),(0,o.jsx)("ul",{children:c.map(a=>(0,o.jsxs)("li",{className:"graview-bar-tidied",children:[(0,o.jsxs)("span",{className:"graview-bar-gone",children:[(0,o.jsx)("span",{children:a.title}),(0,o.jsxs)("small",{children:["until ",T(a.until,s)]})]}),(0,o.jsx)("button",{type:"button",className:"graview-bar-tidy","data-testid":"app-view-restore","data-view":a.name,"aria-label":`Restore \u201C${a.title}\u201D`,onClick:()=>void V(a,l,m),children:"Restore"})]},a.name))})]}):null]})}export{M as TidyGroups,A as remove,V as restore,H as setHidden,L as setListHidden,C as useKeptViewsState,G as useTidied};
@@ -1 +0,0 @@
1
- import{G as h}from"./chunk.4MP72LPR.js";import{Bc as a,Nc as m,ud as u}from"./chunk.VSCIXAHN.js";import{b as l}from"./chunk.AJZBJBMO.js";function f(e){let t=[e?.typography?.body,e?.typography?.display,e?.typography?.mono],o=[];for(let i of t){let n=i?.split(",")[0]?.trim().replace(/^["']|["']$/g,"");!n||m(n)||n.toLowerCase()!==a.toLowerCase()&&(o.includes(n)||o.push(n))}return o}function g(e){let t=f(e);return t.length===0?null:`https://fonts.googleapis.com/css2?${t.map(i=>`family=${encodeURIComponent(i).replace(/%20/g,"+")}:wght@400;500;600;700`).join("&")}&display=swap`}var r=l(h(),1);function k(e,t){return new u({schema:e.schema,mutations:e.mutations??[],invariants:e.invariants??[],...t?{snapshot:t}:{},...e.policy?{policy:e.policy}:{},...e.publishing?{publishing:e.publishing}:{},...e.intelligence?{intelligence:e.intelligence}:{},...e.brand?.timeZone?{timeZone:e.brand.timeZone}:{}})}function d(e){if(typeof document>"u")return e==="dark"?"dark":"light";let t=document.documentElement.dataset.theme;return t==="dark"||t==="light"?t:e==="dark"||e==="light"?e:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function v(e,t){let[o,i]=(0,r.useState)(()=>d(t));return(0,r.useEffect)(()=>{if(!e||typeof document>"u")return;let n=()=>i(d(t));n();let s=new MutationObserver(n);s.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let c=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null;return c?.addEventListener?.("change",n),()=>{s.disconnect(),c?.removeEventListener?.("change",n)}},[e,t]),o}export{g as a,k as b,v as c};
@@ -1 +0,0 @@
1
- import{a}from"./chunk.X6A4VSSD.js";import"./chunk.KDRLUBVF.js";import"./chunk.PNW5K7BW.js";import"./chunk.ENL2JJ47.js";import"./chunk.BQIHNT7C.js";import"./chunk.3XGA65Y3.js";import"./chunk.2K4TT2BV.js";import"./chunk.VZJWJ5XM.js";import{b as n}from"./chunk.YEBGI6ED.js";import"./chunk.HDUO2USQ.js";import"./chunk.GZHZLJBF.js";import"./chunk.IOK4GVJC.js";import"./chunk.OJGHDWI6.js";import"./chunk.TLJOZSDD.js";import"./chunk.MSWWWLEA.js";import"./chunk.UITT6JWW.js";import"./chunk.A5PDXNY6.js";import"./chunk.WC3DENU4.js";import"./chunk.VNDKKTED.js";import{T as i}from"./chunk.4MP72LPR.js";import"./chunk.SDO3U72B.js";import"./chunk.VSCIXAHN.js";import"./chunk.FQLNBIQ5.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function m({entries:d,style:l,headingStyle:p,className:r}){return(0,e.jsxs)("section",{...r?{className:r}:{},"data-testid":"record-ai","aria-label":"What AI did here",style:{display:"grid",gap:10,...l},children:[(0,e.jsx)("h2",{style:p??{margin:0,fontSize:"1rem"},children:"What AI did here"}),(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,fontSize:"0.875rem"},children:d.slice(0,8).map(t=>(0,e.jsx)(n,{entry:t,undo:s=>(0,e.jsx)(a,{batch:s})},t.id))})]})}export{m as RecordInteractions};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.HDUO2USQ.js";import{D as v,G as I,T as h,ba as w}from"./chunk.4MP72LPR.js";import{_a as g}from"./chunk.VSCIXAHN.js";import{b as d}from"./chunk.AJZBJBMO.js";var k=d(I(),1);var t=d(h(),1),r={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function D({shows:e,onShows:i,mine:a,onMine:l}){let o={all:"All",changes:"Changes",ai:"AI"};return(0,t.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(s=>(0,t.jsx)("button",{type:"button","data-shows":s,"aria-pressed":e===s,onClick:()=>i(s),style:{...r,...e===s?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:o[s]},s)),(0,t.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>l(!a),style:{...r,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var x=e=>e.ask.kind==="suggest"?"suggest":e.ask.kind==="fill"?"fill in":e.ask.kind==="record"?"add one":e.ask.kind==="panel"?"draw a panel":`answer \u201C${e.ask.said}\u201D`;function $(e){let i=e.offered.filter(a=>e.accepted?.includes(a.id)).map(a=>a.label);switch(e.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${e.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return e.panel?`Drew \u201C${e.panel.title}\u201D`:"Drew a panel";case"failed":return e.failed??"Failed";default:return"Offered, not yet taken"}}function C(e){let i=[...new Set((e.usage??[]).map(o=>o.model))];if(i.length===0)return null;let a=(e.usage??[]).flatMap(o=>o.costUsd===void 0?[]:[o.costUsd]),l=a.length>0?a.reduce((o,s)=>o+s,0):void 0;return`${i.join(", ")}${l!==void 0?` \xB7 $${l<.01?l.toPrecision(2):l.toFixed(2)}`:""}`}function E({entry:e,undo:i}){let{store:a,principal:l,seats:o,people:s,ai:b}=w(),c=y(),[p,u]=(0,k.useState)(!1),A=e.by.kind==="human"&&e.by.onBehalfOf===void 0&&(e.by.id===void 0||l.id===void 0||e.by.id===l.id)?"you":g(e.by,{graph:a.graph,schema:a.schema,seats:o,people:s}),f=C(e),S=v(b),m=n=>{u(!0),(__graviewPreload(import.meta.url,["./chunk.D7YSL3NK.js","./chunk.BJUUSIQY.js","./chunk.ZP5RT2EK.js","./chunk.VZJWJ5XM.js","./chunk.6C2MHWSX.js","./chunk.XOZU4OFA.js","./chunk.GLWSVSQL.js","./chunk.HDUO2USQ.js","./chunk.TY4GQJKC.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.IBOKXVWN.js")).then(n).finally(()=>u(!1))};return(0,t.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":e.id,"data-outcome":e.outcome,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:(0,t.jsxs)("span",{style:{minWidth:0},children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:A})," ",(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["asked AI to ",x(e)]}),(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.targetLabel]})]})}),e.offered.length>0&&e.outcome!=="accepted"&&e.outcome!=="partly"?(0,t.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",e.offered.map(n=>n.label).join(", ")]}):null,(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{"data-testid":"interaction-outcome",style:{color:e.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:$(e)}),(e.batches??[]).map(n=>(0,t.jsx)("span",{"data-interaction-batch":n,style:{marginLeft:"auto"},children:i(n)},n))]}),f?(0,t.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,S?(0,t.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.panel?(0,t.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:p,onClick:()=>m(n=>n.drawPanel(c,e.panel)),style:r,children:"Show the panel"}):null,(0,t.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:p,onClick:()=>m(n=>n.askAgain(c,e)),style:r,children:"Ask again"})]}):null]})}export{D as a,E as b};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{r as Ie}from"./chunk.LZIBQ3VX.js";import{d as Je,e as Ee,f as je,g as ze}from"./chunk.PNW5K7BW.js";import{a as He}from"./chunk.ZP5RT2EK.js";import{e as X}from"./chunk.GLWSVSQL.js";import{a as z}from"./chunk.VFOON3Z3.js";import{f as Pe,g as Y,i as De}from"./chunk.UITT6JWW.js";import{a as Se}from"./chunk.A5PDXNY6.js";import{Aa as me,Da as K,Eb as ve,Fa as he,Ha as ye,Ia as Z,M as pe,Mb as Ae,Nb as Oe,Pa as ge,Qa as be,Rb as Re,Ta as we,Ub as _e,Xb as B,_a as W,a as fe,cb as ke,dc as Te,ha as G,qd as $e,tc as xe,uc as Me,vc as Ne}from"./chunk.VSCIXAHN.js";var E=(n,e,t)=>{(n[e]===void 0||t>n[e])&&(n[e]=t)},j=(n,e,t)=>{(n[e]===void 0||t<n[e])&&(n[e]=t)},Q=(n,e)=>{n.format=e,e.includes("int")&&(n.isInt=!0)},Le=(n,e)=>{n.mime=n.mime?n.mime.filter(t=>e.includes(t)):[...e]},qe=(n,e)=>{n.multipleOf??=[],n.multipleOf.includes(e)||n.multipleOf.push(e)},Fe=(n,e)=>(n.patterns??=new Set).add(e),st={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function H(n){let e={},{def:t,bag:r}=n._zod,i=n._zod.traits.has("$ZodCheck")?[n,...t.checks??[]]:t.checks??[];for(let o of i){let a=o._zod.def;switch(a.check){case"greater_than":E(e,a.inclusive?"minimum":"exclusiveMinimum",a.value);break;case"less_than":j(e,a.inclusive?"maximum":"exclusiveMaximum",a.value);break;case"multiple_of":qe(e,a.value);break;case"number_format":{Q(e,a.format);let d=st[a.format];d&&(E(e,"minimum",d[0]),j(e,"maximum",d[1]));break}case"bigint_format":Q(e,a.format);break;case"min_length":case"min_size":E(e,"minimum",a.minimum);break;case"max_length":case"max_size":j(e,"maximum",a.maximum);break;case"length_equals":E(e,"minimum",a.length),j(e,"maximum",a.length);break;case"size_equals":E(e,"minimum",a.size),j(e,"maximum",a.size);break;case"string_format":Q(e,a.format),a.pattern&&Fe(e,a.pattern),(a.format==="base64"||a.format==="base64url")&&(e.contentEncoding=a.format),(a.local||a.precision===-1)&&(e.laxFormat=!0);break;case"mime_type":Le(e,a.mime);break}}r.minimum!==void 0&&E(e,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&E(e,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&j(e,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&j(e,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&qe(e,r.multipleOf),r.format!==void 0&&(e.format??=r.format,r.format.includes("int")&&(e.isInt=!0)),r.mime&&Le(e,r.mime);for(let o of r.patterns??[])Fe(e,o);return e}var dt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function L(n){let e=n._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?L(e.out):e.type==="catch"?L(e.innerType):n._zod.optin}var ct=new Set(["promise","optional","nonoptional","nullable","readonly","default","prefault","catch"]);function T(n,e=new Set){if(e.has(n))return!1;e.add(n);let t=n._zod.def,r=t.type;return r==="transform"?!0:r==="array"?T(t.element,e):r==="set"?T(t.valueType,e):r==="lazy"?T(t.getter(),e):ct.has(r)?T(t.innerType,e):r==="intersection"?T(t.left,e)||T(t.right,e):r==="record"||r==="map"?T(t.keyType,e)||T(t.valueType,e):r==="pipe"?n._zod.traits.has("$ZodCodec")||T(t.in,e)||T(t.out,e):r==="object"?Object.values(t.shape).some(i=>T(i,e)):r==="union"?t.options.some(i=>T(i,e)):r==="tuple"?t.items.some(i=>T(i,e))||(t.rest?T(t.rest,e):!1):!1}function lt(n){let e=Object.values(n).filter(t=>typeof t=="number");return Object.entries(n).filter(([t])=>e.indexOf(+t)===-1).map(([,t])=>t)}function Ce(n){let e=n.anyOf;if(!Array.isArray(e)||e.length===0||n.type!==void 0)return;let t=[];for(let r of e){if(!r||typeof r!="object")return;Ce(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;for(let o of[r.type].flat()){if(typeof o!="string")return;t.includes(o)||t.push(o)}}delete n.anyOf,n.type=t.length===1?t[0]:t}var Ue=new Set(["type","properties","required","additionalProperties"]),We=n=>{let e=n.additionalProperties;return e&&typeof e=="object"&&Object.keys(e).length?e:null},Be=(n,e)=>JSON.stringify(n)===JSON.stringify(e);function ee(n){for(let i of n){if(typeof i!="object"||i.type!=="object")return null;for(let o in i)if(!Ue.has(o))return null}let e={},t=new Set;for(let i of n){for(let o in i.properties){if(Object.prototype.hasOwnProperty.call(e,o))continue;let a=[];for(let d of n){let s=d.properties?.[o]??We(d);s&&!a.some(b=>Be(b,s))&&a.push(s)}e[o]=a.length===1?a[0]:ee(a)??{allOf:a}}for(let o of i.required??[])t.add(o)}let r={type:"object",properties:e};if(t.size&&(r.required=[...t]),n.every(i=>i.additionalProperties===!1))r.additionalProperties=!1;else{let i=[];for(let o of n){let a=We(o);a&&!i.some(d=>Be(d,a))&&i.push(a)}i.length===1?r.additionalProperties=i[0]:i.length>1&&(r.additionalProperties={allOf:i})}return r}function ut(n){let e=n.allOf;if(!Array.isArray(e)||e.length<2)return;for(let i of Ue)if(i in n)return;let t=e.filter(i=>Array.isArray(i.oneOf)||Array.isArray(i.anyOf)),r;if(!t.length)r=ee(e);else{let i=t[0],o=Array.isArray(i.oneOf)?"oneOf":"anyOf";if(Object.keys(i).length!==1)return;let a=e.filter(s=>s!==i),d=i[o].map(s=>ee([...a,s]));if(d.some(s=>!s))return;r={[o]:d}}r&&(delete n.allOf,Object.assign(n,r))}function Ve(n){let e=n;for(let y of["anyOf","oneOf"]){let _=e[y];if(!Array.isArray(_))continue;let O=_.map(Ve);O.some((v,m)=>v!==_[m])&&(e={...e,[y]:O})}let t=[e.type].flat(),r=!t.includes("string")&&t.some(y=>y==="number"||y==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!r&&!i?.some(y=>typeof y=="number"))return e;let{minimum:o,maximum:a,exclusiveMinimum:d,exclusiveMaximum:s,multipleOf:b,format:f,id:w,...h}=e;return h.enum?h.enum=h.enum.map(y=>typeof y=="number"?String(y):y):typeof h.const=="number"&&(h.const=String(h.const)),r&&(h.type="string",i||(h.pattern=t.includes("number")?"^-?\\d+(?:\\.\\d+)?$":"^-?\\d+$")),h}var C=class{constructor(e,t){this.override=e;this.refs=t}done=new Map;path=[];cyclic=new Map;write(e,t=!1){let r=this.refs.get(e);if(r!==void 0&&!t)return{$ref:r};if(this.path.includes(e))return this.cyclic.has(e)||this.cyclic.set(e,""),{};let i=this.done.get(e);if(i)return i;this.path.push(e);try{let o=this.written(e);return this.done.set(e,o),o}finally{this.path.pop()}}written(e){let t={},r,i=e._zod.toJSONSchema?.();i?Object.assign(t,i):r=this.process(e,t);let o=fe.get(e);if(o)for(let d of Object.keys(o))t[d]=o[d];T(e)&&(delete t.examples,delete t.default),"_prefault"in t&&(t.default??=t._prefault,delete t._prefault);let a=t;if(r){let d=this.write(r);a={...t};for(let s of Object.keys(d))s in t||(a[s]=d[s])}return this.override({zodSchema:e,jsonSchema:a}),Ce(a),e._zod.def.type==="intersection"&&ut(a),a}process(e,t){let r=e._zod.def;switch(r.type){case"string":{t.type="string";let{minimum:i,maximum:o,format:a,patterns:d,contentEncoding:s,laxFormat:b}=H(e);if(typeof i=="number"&&(t.minLength=i),typeof o=="number"&&(t.maxLength=o),a&&(t.format=dt[a]??a,(t.format===""||a==="time"||b)&&delete t.format),s&&(t.contentEncoding=s),d&&d.size>0){let f=[...d];f.length===1?t.pattern=f[0].source:t.allOf=f.map(w=>({pattern:w.source}))}return}case"number":{let{minimum:i,maximum:o,multipleOf:a,exclusiveMinimum:d,exclusiveMaximum:s,isInt:b}=H(e);if(t.type=b?"integer":"number",typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY)?t.exclusiveMinimum=d:typeof i=="number"&&(t.minimum=i),typeof s=="number"&&s<=(o??Number.POSITIVE_INFINITY)?t.exclusiveMaximum=s:typeof o=="number"&&(t.maximum=o),a){let[f,...w]=new Set(a.filter(h=>Number.isFinite(h)&&h!==0).map(Math.abs));f!==void 0&&(t.multipleOf=f),w.length&&(t.allOf=[...t.allOf??[],...w.map(h=>({multipleOf:h}))])}return}case"boolean":case"success":t.type="boolean";return;case"null":t.type="null";return;case"never":t.not={};return;case"enum":{let i=lt(r.entries);i.length===0?t.not={}:(i.every(o=>typeof o=="number")&&(t.type="number"),i.every(o=>typeof o=="string")&&(t.type="string"),t.enum=i);return}case"literal":{let i=r.values.filter(o=>o!==void 0).map(o=>typeof o=="bigint"?Number(o):o);if(r.values.length===0)t.not={};else if(i.length===1)t.type=i[0]===null?"null":typeof i[0],t.const=i[0];else if(i.length>1){for(let o of["number","string","boolean"])i.every(a=>typeof a===o)&&(t.type=o);i.every(o=>o===null)&&(t.type="null"),t.enum=i}return}case"template_literal":t.type="string",t.pattern=e._zod.pattern.source;return;case"file":{t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:i,maximum:o,mime:a}=H(e);i!==void 0&&(t.minLength=i),o!==void 0&&(t.maxLength=o),a&&(a.length===0?t.not={}:a.length===1?t.contentMediaType=a[0]:t.anyOf=a.map(d=>({contentMediaType:d})));return}case"array":{let{minimum:i,maximum:o}=H(e);typeof i=="number"&&(t.minItems=i),typeof o=="number"&&(t.maxItems=o),t.type="array",t.items=this.write(r.element);return}case"object":{let i=r.shape;t.type="object";let o={};t.properties=o;for(let d in i)Object.defineProperty(o,d,{value:this.write(i[d]),writable:!0,enumerable:!0,configurable:!0});let a=Object.keys(i).filter(d=>L(i[d])===void 0);a.length>0&&(t.required=a),r.catchall?._zod.def.type==="never"?t.additionalProperties=!1:r.catchall&&(t.additionalProperties=this.write(r.catchall));return}case"union":t[r.inclusive===!1?"oneOf":"anyOf"]=r.options.map(i=>this.write(i));return;case"intersection":{let i=d=>"allOf"in d&&Object.keys(d).length===1,o=this.write(r.left),a=this.write(r.right);t.allOf=[...i(o)?o.allOf:[o],...i(a)?a.allOf:[a]];return}case"tuple":{let i=r.items;t.type="array",t.prefixItems=i.map(s=>this.write(s)),r.rest?t.items=this.write(r.rest):t.items=!1;let o=i.length;for(;o>0&&L(i[o-1])!==void 0;)o-=1;o>0&&(t.minItems=o),r.rest||(t.maxItems=i.length);let{minimum:a,maximum:d}=H(e);typeof a=="number"&&(t.minItems=a),typeof d=="number"&&(t.maxItems=d);return}case"record":{let i=r.keyType;t.type="object";let o=H(i).patterns;if(r.mode==="loose"&&o&&o.size>0){let d=this.write(r.valueType),s={};for(let b of o)s[b.source]=d;t.patternProperties=s}else t.propertyNames=Ve(this.write(i)),t.additionalProperties=this.write(r.valueType);let a=i._zod.values;if(a&&!r.partial&&L(r.valueType)===void 0){let d=[...a].filter(s=>typeof s=="string"||typeof s=="number");d.length>0&&(t.required=d.map(String))}return}case"nullable":t.anyOf=[this.write(r.innerType),{type:"null"}];return;case"default":case"prefault":{let i=r.defaultValue,o,a=!1,d=JSON.stringify(i,(s,b)=>typeof b=="bigint"?(a=!0,null):b);return!a&&d!==void 0&&(o=JSON.parse(d)),a||(t[r.type==="default"?"default":"_prefault"]=o),r.innerType}case"catch":{try{t.default=r.catchValue(void 0)}catch{}return r.innerType}case"readonly":return t.readOnly=!0,r.innerType;case"pipe":return r.in._zod.traits.has("$ZodTransform")?r.out:r.in;case"lazy":return e._zod.innerType;case"optional":case"nonoptional":case"promise":return r.innerType;default:return}}};function Ge(n,e=()=>{}){let t=n,r=new C(e,new Map),i=r.write(t,!0);if(r.cyclic.size>0){let o=new Map,a=0,d=[];for(let b of r.cyclic.keys())if(b===t)o.set(b,"#");else{let f=`__schema${a++}`;o.set(b,`#/$defs/${f}`),d.push([b,f])}r=new C(e,o),i=r.write(t,!0);let s={};for(let[b,f]of d)s[f]=r.write(b,!0);d.length>0&&(i={...i,$defs:s})}return JSON.parse(JSON.stringify({$schema:"https://json-schema.org/draft/2020-12/schema",...i}))}function Ke(n){return Ge(n,mt)}var ft={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"},pt={phone:"A phone number as it is written, like +1 555 123 4567 or 020 7946 0958 ext. 12.",place:"An address or a place's name, as a person would search a map for it.",duration:"A length of time in whole minutes: 90 is 1 h 30 min."};function mt(n){me(n.zodSchema)&&(n.jsonSchema["x-graview-app-link"]=!0);let e=ye(n.zodSchema);if(e&&(n.jsonSchema.type==="string"||n.jsonSchema.type==="array")){n.jsonSchema["x-graview-linked"]={address:e.address,kinds:[...e.kinds],cardinality:e.cardinality};let s=e.kinds.join(" or "),b=`${e.cardinality==="many"?"Records":"A record"}: a ${s} in the app ${e.address}, as "${e.kinds[0]}:<id>" \u2014 an id found there with find_linked. Linking never changes that app.`,f=n.jsonSchema.description;typeof f=="string"&&f.includes(b)||(n.jsonSchema.description=`${typeof f=="string"&&f?`${f.replace(/\.?$/,".")} `:""}${b}`)}if(we(n.zodSchema)&&(n.jsonSchema["x-graview-repeat"]=!0,!n.jsonSchema.type&&!n.jsonSchema.anyOf&&!n.jsonSchema.oneOf&&Object.assign(n.jsonSchema,ht())),Se(n.zodSchema)){n.jsonSchema.contentMediaType="text/markdown";let s=n.jsonSchema.description;typeof s=="string"&&s.endsWith("Written in Markdown.")||(n.jsonSchema.description=`${typeof s=="string"&&s?`${s.replace(/\.?$/,".")} `:""}Written in Markdown.`)}let t=_e(n.zodSchema);if(t){let s=n.jsonSchema;s["x-graview-type"]=t,t==="duration"&&(s["x-graview-unit"]="minutes"),s.description??=pt[t]}let r=Re(n.zodSchema,!1);if(r){let s=Pe(r);n.jsonSchema["x-graview-format"]=s.format??"unit",s.currency&&(n.jsonSchema["x-graview-currency"]=s.currency),s.unit&&s.format!=="money"&&(n.jsonSchema["x-graview-unit"]=s.unit);let b=n.jsonSchema.description;n.jsonSchema.description=typeof b=="string"&&b.length>0?`${b} ${Y(s)}`:Y(s)}let i=n.zodSchema._zod?.def;if(!i||i.type!=="string"||typeof i.format!="string"||i.format==="regex")return;let o=n.jsonSchema,a=(i.checks??[]).map(s=>s._zod?.def).filter(s=>s?.format==="regex"&&s.pattern instanceof RegExp).map(s=>s.pattern.source);delete o.pattern;let d=o.allOf;Array.isArray(d)&&d.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete o.allOf,o.format=ft[i.format]??i.format,a.length===1?o.pattern=a[0]:a.length>1&&(o.allOf=a.map(s=>({pattern:s})))}function te(n,e){let t=B(n.input),r=Ke(n.input);if(e&&r.properties){let o=a=>e.includes(a)?e.indexOf(a):e.length;r.properties=Object.fromEntries(Object.entries(r.properties).sort(([a],[d])=>o(a)-o(d)))}let i=r.properties??{};if(Ae(n)){let o=n.creates.join(" | ");i.id={type:"string",minLength:1,description:`Optional: the id for the ${o} this makes, beginning with its kind (${n.creates.map(a=>`"${a}:"`).join(" or ")}). Refused if the graph already has it; left out, one is minted from the label.`},r.properties=i}Oe(n)&&(r.additionalProperties=!1);for(let o of t){let a=i[o.name];if(!a)continue;let d=o.kinds.includes("*")?"any node kind":o.kinds.join(" | ");a.description=[a.description,`Id of a node (${d}).`].filter(Boolean).join(" ")}return{name:n.name,...n.title===void 0?{}:{title:n.title},description:n.description??n.title??n.name,inputSchema:r,nodeRefs:t}}function ht(){let n={type:"string",pattern:"^\\d{4}-\\d{2}-\\d{2}$"},e=(t,r)=>({type:"integer",minimum:t,maximum:r});return{type:"object",description:'How the date beside it repeats; the date is the first occurrence. "on" is weekdays for "week", days of the month (-1 the last) for "month".',properties:{every:{type:"string",enum:[...be]},interval:e(1,99),on:{type:"array",minItems:1,maxItems:31,items:{anyOf:[{type:"string",enum:[...ge]},e(-1,31)]}},until:n,count:e(1,1e3),except:{type:"array",maxItems:500,items:n},continues:{type:"string",maxLength:200}},required:["every"],additionalProperties:!1}}function Ze(n){let e=new Set;for(let t=n;t;t=t.onBehalfOf)t.id!==void 0&&e.add(`${t.kind}:${t.id}`);return e}function U(n,e){let t=Ze(e),r=f=>{if(f.kind==="rule")return!1;let w=Ze(f);if(w.size===0)return!1;for(let h of w)if(t.has(h))return!1;return!0},i,o=()=>{if(i)return i;i=new Map;for(let f of n.log.live()){if(f.undoes!==void 0)continue;let w=r(f.author)?f.author:void 0;for(let h of f.primitives){h.op==="remove-node"&&i.delete(h.node.id);let y=h.op==="add-node"?h.node.id:h.op==="patch-node"||h.op==="splice-text"?h.id:void 0;if(y===void 0)continue;let _=h.op==="add-node"?Object.keys(h.node):h.op==="splice-text"?[h.field]:Object.keys(h.after),O=i.get(y);(h.op==="add-node"||!O)&&i.set(y,O=new Map);for(let v of _)v==="id"||v==="kind"||(w?O.set(v,w):O.delete(v))}}return i},a=n.schema,d=new Map,s=(f,w)=>{let h=`${f}\0${w}`,y=d.get(h);if(y===void 0){let _=a.tryDefinition(f)?.fields?.shape;y=_!==void 0&&w in _&&De(_[w]).type==="text",d.set(h,y)}return y},b=f=>n.graph.getNode(f)?.kind;return{prose:s,say:f=>W(f,{graph:n.graph,schema:a}),fieldBy(f,w){let h=b(f);if(!(h===void 0||!s(h,w)))return o().get(f)?.get(w)},recordBy(f){let w=b(f),h=o().get(f);if(w===void 0||!h)return;let y;for(let[_,O]of h)s(w,_)&&(y=O);return y}}}var ne=(n,e,t)=>({untrusted:!0,authoredBy:t.say(e),text:n}),yt="the host's ranker";function Ye(n,e){return{...n,hits:n.hits.map(t=>{if(t.about!=="node")return t;t.why.by==="meaning"&&t.why.matched!==void 0&&(t={...t,why:{...t.why,matched:{untrusted:!0,authoredBy:yt,text:t.why.matched}}});let r=e.recordBy(t.id);if(!r)return t;let i=e.prose(t.kind,t.why.field)?e.fieldBy(t.id,t.why.field):r;return{...t,label:ne(t.label,r,e),...t.apart!==void 0?{apart:ne(t.apart,r,e)}:{},why:i?{...t.why,fragment:ne(t.why.fragment,i,e)}:t.why}})}}var ie=(n,e,t)=>({title:n,readOnlyHint:e,destructiveHint:!1,idempotentHint:t,openWorldHint:!1}),gt={name:"subscribe",title:"Notify me when something happens",description:`Subscribe the person you act for to be told when something happens in this app \u2014 their host delivers it (an email, a push). on is one of: "act" (an act runs; give act, its declared name, and/or record), "created" (a record of kind is added), "changed" (a record of kind, or the one record, changes), "reaches" (a record of kind, or the one record, comes to satisfy condition, an expression in the app's rule language such as done == true or amount > 100). They are told only of changes someone else made, unless alsoMine is true, and only of records they may see. Returns the subscription and its sentence. Changes nothing in the app.`,inputSchema:{type:"object",properties:{on:{type:"string",enum:["act","created","changed","reaches"],description:"What to be told of."},act:{type:"string",description:"An act's declared name, for on: act."},kind:{type:"string",description:"A kind, for created, changed and reaches."},record:{type:"string",description:"One record, by id or name: for act, changed and reaches."},condition:{type:"string",description:"For reaches: what the record should come to satisfy, in the rule language (done == true)."},alsoMine:{type:"boolean",description:"Also when the person themselves made the change; false when unsaid."}},required:["on"],additionalProperties:!1},mutating:!1,annotations:ie("Notify me when something happens",!1,!1)},bt={name:"unsubscribe",title:"Stop notifying me",description:"Take away one of the person's subscriptions, by the id list_subscriptions or subscribe answered. Changes nothing in the app.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The subscription's id."}},required:["id"],additionalProperties:!1},mutating:!1,annotations:ie("Stop notifying me",!1,!0)},wt={name:"list_subscriptions",title:"What I am notified of",description:`List what the person you act for is told of in this app: each subscription's id and its sentence ("When someone else adds a task").`,inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:ie("What I am notified of",!0,!0)},re=[gt,bt,wt];var F=n=>{let e;return()=>e??=n().catch(t=>{throw e=void 0,t})},St=F(()=>(__graviewPreload(import.meta.url,["./chunk.IHBUBZQT.js","./chunk.67U6M7OV.js","./chunk.GLWSVSQL.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.PHJ6WPWH.js"))),kt=()=>(__graviewPreload(import.meta.url,["./chunk.VFOON3Z3.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.3ZT5WQYL.js")).catch(()=>{}),vt=async()=>{(await kt())?.judgeWithLines()},q=F(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.A5PDXNY6.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.SRVQJZRT.js"))),At=F(()=>(__graviewPreload(import.meta.url,["./chunk.LGEA5257.js","./chunk.G4JJXA63.js","./chunk.OLFJH4RK.js","./chunk.67U6M7OV.js","./chunk.6C2MHWSX.js","./chunk.XOZU4OFA.js","./chunk.GLWSVSQL.js","./chunk.VFOON3Z3.js","./chunk.WVUJXDXZ.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QFUMFQJU.js"))),Ot=F(()=>(__graviewPreload(import.meta.url,["./chunk.IGVASEZU.js","./chunk.IHBUBZQT.js","./chunk.67U6M7OV.js","./chunk.ZP5RT2EK.js","./chunk.VZJWJ5XM.js","./chunk.GLWSVSQL.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.G3R4BTI7.js"))),Rt=F(()=>(__graviewPreload(import.meta.url,["./chunk.F6V7RWDK.js","./chunk.RQOX5YDW.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.WXUFATY5.js"))),_t=n=>n.definitions.some(e=>Z(e).size>0),Xe=n=>({value:K(n),label:n.label,...n.describe?{describe:n.describe}:{},...n.card?{card:n.card}:{},fields:n.fields,...n.app?{app:n.app}:{}});async function Tt(n,e,t,r){let i=String(t.relation??""),[o,a]=i.includes(".")?i.split(".",2):[void 0,i],d=n.schema.definitions.flatMap(v=>[...Z(v)].map(([m,u])=>({kind:v.kind,name:m,relation:u}))),s=d.filter(v=>v.name===a&&(o===void 0||v.kind===o));if(s.length!==1){let v=d.map(m=>`${m.kind}.${m.name}`).join(", ")||"none";return{ok:!1,error:`${s.length===0?`No relation to another app is called "${i}"`:`"${i}" names a relation of several kinds`}. The relations to other apps are: ${v}.`}}let{kind:b,name:f,relation:w}=s[0];if(!r)return{ok:!1,error:`This seat cannot read ${w.address}: its host reads no other app's records. Nothing was changed.`};let h={kind:e.kind,...e.id===void 0?{}:{id:e.id},...e.roles?{roles:e.roles}:{},...e.onBehalfOf?{onBehalfOf:e.onBehalfOf}:{}},y=typeof t.of=="string"?t.of:void 0;if(y!==void 0){let v=n.graph.getNode(y);if(!v||v.kind!==b)return{ok:!1,error:`No ${b} "${y}".`};let m=he(v[f],w),u=await Promise.all(m.map(S=>Promise.resolve().then(()=>r.resolve(S,h)).catch(()=>null)));return{ok:!0,data:{relation:`${b}.${f}`,app:w.address,records:u.map((S,k)=>S===null?{value:K(m[k]),missing:!0}:"denied"in S?{denied:!0,said:"linked record (no access)"}:Xe(S))},reads:[y]}}let _=typeof t.limit=="number"&&t.limit>0?Math.min(t.limit,20):20,O=await Promise.resolve().then(()=>r.find({address:w.address,kinds:w.kinds,query:String(t.query??""),limit:_},h)).catch(()=>[]);return Array.isArray(O)?{ok:!0,data:{relation:`${b}.${f}`,app:w.address,records:O.map(Xe),link:`edit-${b} with ${f} set to a record's value`}}:{ok:!0,data:{relation:`${b}.${f}`,app:w.address,denied:!0,said:"linked record (no access)"}}}var N=n=>({title:n,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),Qe={description:'Which records: false (the default) the live ones, true only the archived ones, "all" both. An archived record is set aside, not gone: unarchive-<kind> brings it back.',anyOf:[{type:"boolean"},{type:"string",enum:["all"]}]},oe={type:"number",description:"Where the page starts; 0 when unsaid."},se=[{name:"search_graph",title:"Find by name",description:"Find things by name: records whose name or readable fields carry the words, and the kinds, places and rules the words name \u2014 each with why it matched. Reach for this before get_graph when you know what something is called. Words match the start of words, case and accents aside; key:value tokens narrow as a list's filter does (done:false, is:any for past records, kind:<kind>). Pass subject (a node id) to get the acts you may run on it as hits too. When few records match exactly, records with a near word follow \u2014 a typo, another form of the word, a meaning \u2014 each with near: true and why.matched, the record's own word that answered.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Words, with optional key:value conditions."},limit:{type:"number",description:"Most hits to return; at most 20."},subject:{type:"string",description:"A node id whose acts to include."},archived:Qe},required:["query"],additionalProperties:!1},mutating:!1,annotations:N("Find by name")},{name:"get_graph",title:"Read the graph",description:"Read the graph, 25 nodes a page: their fields, the edges out of them, and how many more. Start here when you need the shape of the domain rather than one thing in it.",inputSchema:{type:"object",properties:{offset:oe,archived:Qe},additionalProperties:!1},mutating:!1,annotations:N("Read the graph")},{name:"get_node",title:"Read one node",description:"Read one node: its fields, its links (id, kind and label, 20 each way a page), the violations that implicate it, and its computed values: read-only fields worked out from what you can see, which no act sets. Use this to check a thing before you change it.",inputSchema:{type:"object",properties:{id:{type:"string",description:"A node's id, or its name."},offset:oe},required:["id"],additionalProperties:!1},mutating:!1,annotations:N("Read one node")},{name:"get_violations",title:"List the problems",description:"List the invariant violations the graph currently has, 20 a page, with the repairs that would resolve each one. Read this before proposing work: a rule that is already broken is more urgent than anything you could add.",inputSchema:{type:"object",properties:{offset:oe,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:N("List the problems")},{name:"get_affordances",title:"Ask what can be done",description:"Ask what can legally be done with a selection, ranked. Prefer these over composing a mutation by hand: they are derived from the schema, the invariants and the shape of the graph, so they cannot name an action that does not exist.",inputSchema:{type:"object",properties:{selection:{type:"array",items:{type:"string"},description:"Node ids."},context:{type:"object"}},required:["selection"],additionalProperties:!1},mutating:!1,annotations:N("Ask what can be done")},{name:"describe_place",title:"Say what a place shows",description:`Say what one place of the app shows you, as a person in your seat would see it: its headings, its figures as drawn, its lists with each record's title and what its card or row says, the headings a list is grouped under, what an empty list says, the forms it offers (each field in the order asked, its label, whether it must be answered, what it takes and its choices), and any block that could not be worked out. Pass a place's slug ("home", a lens's address like "the-offers", a kind's like "offers"), a record's id, or a visitor form's "forms/<name>", and width 390 for a phone. Use it after a change to check what somebody now sees, instead of guessing.`,inputSchema:{type:"object",properties:{place:{type:"string",description:`"home", a place's slug, a record's id, or "forms/<name>" for a visitor form.`},width:{type:"number",description:"The screen's width in CSS pixels; 390 is a phone, 1440 when unsaid."}},required:["place"],additionalProperties:!1},mutating:!1,annotations:N("Say what a place shows")},{name:"preview_mutation",title:"Try an act without applying it",description:"Try a mutation without applying it: get back the diff it would produce and any invariant it would break. Do this when you are unsure, rather than applying and undoing.",inputSchema:{type:"object",properties:{mutation:{type:"string"},args:{type:"object"}},required:["mutation","args"],additionalProperties:!1},mutating:!1,annotations:N("Try an act without applying it")},{name:"undo_batch",title:"Undo a batch",description:"Undo one batch of operations. Fails, naming the blocking operation, when a later operation read what it wrote.",inputSchema:{type:"object",properties:{batch:{type:"string"},include:{type:"array",items:{type:"string"}}},required:["batch"],additionalProperties:!1},mutating:!0,annotations:{title:"Undo a batch",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},{name:"list_suggestions",title:"List what is suggested",description:"List the suggestions waiting for a person: changes the app's own actor proposed and did not make, each with its id, what it would do, who suggested it, what it was based on and how sure (0 to 1). Nothing changes until one is accepted (accept_suggestion) or declined (decline_suggestion); a declined one is never suggested again.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:N("List what is suggested")},{name:"accept_suggestion",title:"Accept a suggestion",description:"Make a waiting suggestion's change, as this seat, carrying what it was based on. Returns the batch (undo_batch takes it back).",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Accept a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}},{name:"decline_suggestion",title:"Decline a suggestion",description:"Decline a waiting suggestion: nothing changes, the decline is kept in the log, and the same change is never suggested or made by the app's own actor again.",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Decline a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}],tt={name:"act_on_several",title:"Do one act to several records",description:`Run one act on several records at once, as one change with one undo. act is the act (its tool name or its declared name), records the records it runs on (ids or names; each goes in the act's subject), args what every call shares ("Set stage to Declined" is args { stage: "declined" }). Each record is judged on its own: one this seat may not change is named with why, and the rest still apply. Returns the batch (undo_batch takes it all back), the records changed, those already so, and those refused.`,inputSchema:{type:"object",properties:{act:{type:"string",description:"The act to run on each record."},records:{type:"array",items:{type:"string"},minItems:1,maxItems:200,description:"Ids or names of the records."},args:{type:"object",description:"Arguments every call shares, besides the record."}},required:["act","records"],additionalProperties:!1},mutating:!0,annotations:{title:"Do one act to several records",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},ue={name:"suggest_changes",title:"Suggest changes",description:"Keep calls ({ act, args }) as one suggestion a person accepts or declines, with its basis and confidence (0 to 1). Changes nothing; a declined change is refused.",inputSchema:{type:"object",properties:{calls:{type:"array",items:{type:"object"}},basis:{type:"string"},confidence:{type:"number"}},required:["calls","basis"]},mutating:!0,annotations:{title:"Suggest changes",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},de={type:"object",description:"A lens, as draft_view returns one.",properties:{title:{type:"string"},lens:{type:"string"},on:{type:"string"},bindings:{type:"object"},options:{type:"object"}},required:["title","lens","on"]},ce={name:"draft_view",title:"Draw a view",description:'Draw a view of the data from words ("a board of tasks by status", "who covers what") as a lens the app could keep; or check a lens you wrote (lens); or change the one on screen (current, with ask: "only this month"). Returns the lens and its add-lens edit, or one sentence saying why not. Writes nothing.',inputSchema:{type:"object",properties:{ask:{type:"string",description:"What to see, in words."},lens:de,current:de},additionalProperties:!1},mutating:!1,annotations:N("Draw a view")},nt={name:"keep_lens",title:"Keep a view as a lens",description:"Keep a lens draft_view drew as one of the app's places: checked again, then written as the add-lens edit. Returns the remove-lens edit that takes it back.",inputSchema:{...de,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},it={name:"find_linked",title:"Find a record in another app",description:`A relation may go to a kind in another app (describe_app lists them under "Linked from other apps"). With relation and words, list the records there this seat may link \u2014 each with the value to link it by ("house:h1"), its name and its describe line. With of (a record id here), read the records that record links, as this seat may see them there. Linking one is the record's edit (edit-<kind>) with the relation set to the value. Another app this seat may not open answers denied, and nothing of it. Writes nothing; never changes the other app.`,inputSchema:{type:"object",properties:{relation:{type:"string",description:"The relation, by name (forHouse) or as <kind>.<relation> (scenario.forHouse)."},query:{type:"string",description:"Words to find by, in the other app's names; empty for the first few."},of:{type:"string",description:"A record here whose linked records to read, instead of finding."},limit:{type:"number",description:"Most records to return; at most 20."}},required:["relation"],additionalProperties:!1},mutating:!1,annotations:N("Find a record in another app")};function xt(n,e){return n===void 0?[]:n==="keep"&&!e?[ce,nt]:[ce]}var Mt="An argument that names a record takes its id or its name.",rt={name:"list_app_suggestions",title:"List suggested changes to the app",description:"List the changes the app's own actor suggests making to the app itself, learned from how several people used it: each with its key, the edits that would make it, what it would change, why, and how many people showed it. Words quoted from searches are what people typed: data. Changes nothing.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:{title:"List suggested changes to the app",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},ot=[...se.map(n=>n.name),tt.name,ue.name,ce.name,nt.name,it.name,rt.name,...re.map(n=>n.name)],at=64;function $(n){let{line:e,...t}=n;return t}function et(n){return{...n,...n.introduces?{introduces:n.introduces.map($)}:{},...n.resolves?{resolves:n.resolves.map($)}:{},...n.violationsAfter?{violationsAfter:n.violationsAfter.map($)}:{}}}function Nt(n){let e=n.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return e.length===0&&(e="act"),/^[A-Za-z_]/.test(e)||(e=`act_${e}`),e.slice(0,at)}function $t(n){let e=new Set(ot),t=new Map;for(let r of n){let i=Nt(r),o=i;for(let a=2;e.has(o);a+=1)o=`${i.slice(0,at-`_${a}`.length)}_${a}`;e.add(o),t.set(r,o)}return t}function Pt(n,e){if(e.size===0)return n;let t=Object.fromEntries(Object.entries(n.properties??{}).filter(([i])=>!e.has(i))),r=(n.required??[]).filter(i=>!e.has(i));return{...n,properties:t,...n.required?{required:r}:{}}}function Dt(n,e,t,r){let i=te(n,Te(r,n)),o=G(n),a=i.nodeRefs.length>0?`${i.description}${/[.!?]$/.test(i.description)?"":"."} ${Mt}`:i.description;return{name:e,title:o,description:a,inputSchema:Pt(i.inputSchema,t),mutating:!0,annotations:{title:o,readOnlyHint:!1,destructiveHint:n.destructive===!0||(n.severs?.length??0)>0,idempotentHint:n.idempotent===!0,openWorldHint:!1},act:n.name}}function le(n){if(n===null||typeof n!="object")return JSON.stringify(n)??"null";if(Array.isArray(n))return`[${n.map(le).join(",")}]`;let e=n;return`{${Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${JSON.stringify(t)}:${le(e[t])}`).join(",")}}`}function Jt(n){return`sha256:${$e(le(n))}`}function Et(n,e,t,r,i,o=!1,a=!1,d=!1,s,b=!1){let f=$t(n.map(y=>y.name)),w=[...xt(r,t),...o?[it]:[],...a?re:[],...b?[rt]:[]];return{definitions:t?[...se.filter(y=>!y.mutating),...w]:[...se,tt,...d?[ue]:[],...w,...n.filter(y=>e.has(y.name)).map(y=>Dt(y,f.get(y.name),i(y),s))],names:f}}function On(n,e={}){let t=e.author??{kind:"agent"},r=n.allMutations(),i=new Set(n.permittedMutations(t).map(m=>m.name)),{definitions:o,names:a}=Et(r,i,e.readOnly===!0,e.drafts?e.drafts.keep?"keep":"draw":void 0,m=>X(n.schema,n.policy,t,m),_t(n.schema),e.subscriptions!==void 0,Ne(t),n.schema,e.learned!==void 0),d=Jt(o),s={app:e.app?.brand?.locale,appTimeZone:e.app?.brand?.timeZone},b=m=>pe(s,m),f=m=>{if(!ot.includes(m)){for(let[u,S]of a)if(S===m)return u;return a.has(m)?m:xe(m,a.keys())}},w=m=>{let u=Me(m,a.keys());return u?` Did you mean "${u}"?`:""},h=m=>{let u=o.find(k=>k.name===m)??o.find(k=>k.act===m);if(u)return u;let S=f(m);return S===void 0?void 0:o.find(k=>k.act===S)},y=(m,u)=>{let S=r.find(c=>c.name===m);if(!S)return{args:u,resolved:[]};let k={...u},l=[];for(let c of B(S.input)){let p=k[c.name];if(typeof p!="string"||p.trim()==="")continue;let g=n.resolveRef(c,p,t);if(!g.ok){let A=g.reason==="none"?` Nothing was changed. Use search_graph to look it up, then pass its id as ${c.name}.`:" Nothing was changed.";return{ok:!1,error:`${g.message}${A}`,argument:c.name,candidates:g.candidates}}g.by!=="id"&&(k[c.name]=g.id,l.push({argument:c.name,given:p,id:g.id,label:g.label}))}return{args:k,resolved:l}},_=async(m,u)=>{try{await vt();let S=h(m);if(!S&&m===ue.name)return{ok:!1,error:"Only the app's own actor (automated: true) suggests changes.",reason:"forbidden"};if(!S){let l=f(m);if(l){let c=n.permits({name:l,args:u},t);if(!c.ok)return{ok:!1,error:c.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${m}".${w(m)} Available: ${o.map(c=>c.name).join(", ")}`}}if(S.mutating&&e.readOnly)return{ok:!1,error:`"${m}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(S.act!==void 0){let l=y(S.act,u);if("ok"in l)return l;let c=S.act,p=b(()=>z(n,t,n.apply({name:c,args:l.args},{...e.author?{author:e.author}:{},...V(e.via)})));return{ok:!0,data:{batch:p.batch,intent:p.intent,introduces:p.introduces.map($),resolves:p.resolves.map($),...l.resolved.length>0?{resolved:l.resolved}:{}},diff:p.diff}}let k=n.seenBy(t);switch(S.name){case"search_graph":{let l=typeof e.places=="function"?e.places():e.places,c=typeof u.subject=="string"?u.subject:void 0,p=Ie(k,String(u.query??""),{principal:t,rank:e.near,archived:ke(u.archived),limit:typeof u.limit=="number"&&u.limit>0?Math.min(u.limit,20):20,...l?{places:l}:{},...c?{subject:c,from:[c]}:{}}),g=p.later?await p.later:p;return{ok:!0,data:(await q()).searchRead(g,Ye(g,U(k,t))),reads:g.hits.flatMap(A=>A.about==="node"?[A.id]:[])}}case"get_graph":return{ok:!0,...(await q()).graphRead(k,U(k,t),u)};case"get_node":{let l=String(u.id??""),c=l,p;if(!k.graph.getNode(l)){let A=l.trim()===""?void 0:n.resolveRef({name:"id",kinds:["*"]},l,t);if(A?.ok)c=A.id,p={argument:"id",given:l,id:c,label:A.label};else return A?.reason==="ambiguous"?{ok:!1,error:A.message,argument:"id",candidates:A.candidates}:{ok:!1,error:`No node "${l}".`}}let g=(await q()).nodeRead(k,U(k,t),c,u);return{ok:!0,data:p?{...g.data,resolved:[p]}:g.data,reads:g.reads}}case"describe_place":{let l=e.app??{name:"",schema:n.schema},c=typeof u.width=="number"&&Number.isFinite(u.width)&&u.width>0?u.width:1440,{describePlace:p}=await St(),g=p(n,t,String(u.place??""),{app:l,width:c});if(!g.ok)return{ok:!1,error:`${g.error} The places are: ${g.places.join(", ")}.`};let A=new Set,M=I=>{for(let D of I)for(let x of D.groups??[])for(let P of x.items)A.add(P.id),M(P.parts)};return M(g.description.parts),{ok:!0,data:g.description,reads:[...A]}}case"find_linked":return Tt(k,t,u,e.linked);case"draft_view":case"keep_lens":{let l=e.app??{name:"",schema:n.schema};return(await At()).runDraftTool(S.name,u,{app:l,principal:t,...e.drafts?{drafts:e.drafts}:{}})}case"get_violations":{let l=k.violations(u.context);return{ok:!0,...(await q()).violationsRead(l,u)}}case"get_affordances":{let l=u.selection??[];return{ok:!0,data:He(k,l,{...typeof e.derive=="function"?e.derive():e.derive,...e.author?{principal:e.author}:{},...u.context?{context:u.context}:{}}),reads:l.filter(p=>k.graph.has(p))}}case"preview_mutation":{let l=String(u.mutation),c=f(l)??l,p=y(c,u.args??{});if("ok"in p)return p;let g=n.missingFor({name:c,args:p.args},t);if(g)return{ok:!1,error:g.message,reason:"missing"};let A=z(n,t,n.preview({name:c,args:p.args},void 0,{author:t})),M=et(A);return{ok:!0,data:p.resolved.length>0?{...M,resolved:p.resolved}:M}}case"act_on_several":{let l=String(u.act??""),c=f(l)??l,p=r.find(R=>R.name===c);if(!p||!i.has(c)){let R=p?n.permits({name:c,args:{}},t):void 0;return R&&!R.ok?{ok:!1,error:R.refusal.message,reason:"forbidden"}:{ok:!1,error:`There is no act "${l}" this seat may run.${w(l)} Nothing was changed.`,reason:"invalid"}}let g=p.subject;if(!g)return{ok:!1,error:`"${G(p)}" does not act on a record, so it cannot be run on several. Nothing was changed.`,reason:"invalid"};let A=Array.isArray(u.records)?u.records.filter(R=>typeof R=="string"&&R.trim()!==""):[];if(A.length===0)return{ok:!1,error:"Name at least one record. Nothing was changed.",reason:"invalid"};let M=[],I=[];for(let R of A.slice(0,200)){let J=n.resolveRef({name:g.arg,kinds:g.kinds},R,t);if(!J.ok)return{ok:!1,error:`${J.message} Nothing was changed.`,argument:"records",candidates:J.candidates};M.push(J.id),J.by!=="id"&&I.push({argument:"records",given:R,id:J.id,label:J.label})}let D=y(c,{...u.args??{}});if("ok"in D)return D;let x=(await Ot()).actOnSeveral(n,{mutation:c,subject:g.arg,args:D.args},M,{author:t,...V(e.via)}),P=x.result?z(n,t,x.result):void 0;return{ok:!0,data:{...x.batch?{batch:x.batch,intent:x.intent}:{},applied:x.applied,unchanged:x.unchanged,refused:x.refused.map(R=>({record:R.id,label:R.label,error:R.message,reason:R.reason})),...x.allOrNothing?{keptNone:!0}:{},...P?{introduces:P.introduces.map($),resolves:P.resolves.map($)}:{},...I.length>0||D.resolved.length>0?{resolved:[...I,...D.resolved]}:{}},...P?{diff:P.diff}:{}}}case"subscribe":case"unsubscribe":case"list_subscriptions":{let l=await(await Rt()).runSubscriptionTool(S.name,u,{store:n,principal:e.subscriber??t,app:e.app?.name??"app",subscriptions:e.subscriptions});return l.ok?{ok:!0,data:l.data}:{ok:!1,error:l.error}}case"list_app_suggestions":return{ok:!0,data:{suggestions:(await e.learned()).map(({key:c,said:p,why:g,edits:A,evidence:M})=>({key:c,said:p,why:g,edits:A,evidence:M}))}};case"list_suggestions":{let l=Ee(n,t).map(c=>{let p=W(c.author,{graph:k.graph,schema:n.schema});return{id:c.id,intent:c.intent,by:p,at:c.at,about:c.about,...c.lineage?{basis:{untrusted:!0,authoredBy:p,text:c.lineage.basis},...c.lineage.confidence!==void 0?{confidence:c.lineage.confidence}:{}}:{}}});return{ok:!0,data:{suggestions:l},reads:[...new Set(l.flatMap(c=>c.about))]}}case"suggest_changes":{let l=u.calls.map(p=>({name:f(p.act)??p.act,args:p.args}));return{ok:!0,data:{suggestion:Je(n,l,{author:t,lineage:{basis:u.basis,confidence:u.confidence},...V(e.via)})?.id??null}}}case"accept_suggestion":case"decline_suggestion":{let l=String(u.suggestion??""),c={author:t,...V(e.via)},p=S.name==="accept_suggestion"?je(n,l,c):ze(n,l,c),g=z(n,t,p);return{ok:!0,data:{batch:g.batch,intent:g.intent,introduces:g.introduces.map($),resolves:g.resolves.map($)},diff:g.diff}}case"undo_batch":{let l=String(u.batch),c=u.include??[],p=k.canUndo([l,...c]);if(!p.ok)return{ok:!1,error:p.message};let g=z(n,t,n.undo([l,...c],{...e.author?{author:e.author}:{}}));return{ok:!0,data:et(g),diff:g.diff}}default:return{ok:!1,error:`Unknown tool "${m}".`}}}catch(S){let{reason:k,wouldNeed:l}=ve(S);return{ok:!1,error:S instanceof Error?S.message:String(S),reason:k,...l?{wouldNeed:l}:{}}}},O=new Set,v=m=>{for(let u of O)u(m)};return{definitions:o,hash:d,...e.author?{author:e.author}:{},onDiff(m){return n.subscribe(m)},onCall(m){return O.add(m),()=>O.delete(m)},async call(m,u){let S=h(m)?.mutating??!1,k={name:m,args:u,mutating:S,at:new Date().toISOString()};v({...k,phase:"running"});let l=p=>(v(p.ok?{...k,phase:"ok",...!S&&p.reads?{reads:p.reads}:{}}:{...k,phase:"failed",error:p.error}),p),c=await _(m,u);return l(c.ok&&!S?{...c,data:(await q()).withinReadChars(m,c.data)}:c)}}}function V(n){let e=typeof n=="function"?n():n;return e?{via:e}:{}}export{le as a,On as b};