graview 0.1.48 → 0.1.50

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 (202) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +1 -1
  4. package/dist/preview/chunk.24MUPV4Y.js +1 -0
  5. package/dist/preview/chunk.25VJPUDH.js +1 -0
  6. package/dist/preview/{chunk.PTXLOFQW.js → chunk.2P66HH5Y.js} +1 -1
  7. package/dist/preview/chunk.2VZSC2MB.js +1 -0
  8. package/dist/preview/chunk.3L5USMQD.js +1 -0
  9. package/dist/preview/chunk.3O3H37WD.js +1 -0
  10. package/dist/preview/{chunk.Y4MQGEUS.js → chunk.3SY6WWWQ.js} +2 -2
  11. package/dist/preview/{chunk.HC5N3CT2.js → chunk.4BQNG3W3.js} +1 -1
  12. package/dist/preview/chunk.4SHSEIHT.js +1 -0
  13. package/dist/preview/{chunk.NTLHEHOM.js → chunk.4VJARLJ5.js} +1 -1
  14. package/dist/preview/{chunk.I5TOMBIF.js → chunk.4XOSDCCE.js} +1 -1
  15. package/dist/preview/{chunk.CH5ROV7N.js → chunk.53BGPCM6.js} +1 -1
  16. package/dist/preview/{chunk.NQZ73QV7.js → chunk.5DZR46YG.js} +1 -1
  17. package/dist/preview/{chunk.GNBN3BK7.js → chunk.5RNB6IC5.js} +1 -1
  18. package/dist/preview/{chunk.E5GM2SMO.js → chunk.64TFAR5Z.js} +1 -1
  19. package/dist/preview/chunk.6BMCZPT6.js +1 -0
  20. package/dist/preview/chunk.6SHF6IL5.js +1 -0
  21. package/dist/preview/{chunk.RLXKDXPB.js → chunk.6VA5XFRR.js} +1 -1
  22. package/dist/preview/{chunk.GUMJEVVP.js → chunk.73BJYIYS.js} +1 -1
  23. package/dist/preview/chunk.7PJVMADH.js +2 -0
  24. package/dist/preview/{chunk.YVOABA2U.js → chunk.7QW6JYGP.js} +1 -1
  25. package/dist/preview/{chunk.NR5ODXMO.js → chunk.7VX6TBNY.js} +1 -1
  26. package/dist/preview/{chunk.5IM645XQ.js → chunk.A53G42QO.js} +1 -1
  27. package/dist/preview/chunk.ATWNWPME.js +1 -0
  28. package/dist/preview/chunk.AVCW7C6V.js +1 -0
  29. package/dist/preview/{chunk.V4BCB7N2.js → chunk.AXCRFJDL.js} +1 -1
  30. package/dist/preview/chunk.AXMC6XVT.js +2 -0
  31. package/dist/preview/{chunk.DAUC2DFY.js → chunk.BBNF52IB.js} +1 -1
  32. package/dist/preview/chunk.BJAQRV2R.js +1 -0
  33. package/dist/preview/chunk.BLS2G3CD.js +5 -0
  34. package/dist/preview/chunk.BNQL37AC.js +88 -0
  35. package/dist/preview/{chunk.QGE6YKSU.js → chunk.BORCUDGS.js} +1 -1
  36. package/dist/preview/{chunk.MVRG75ZD.js → chunk.CBJHYNNT.js} +1 -1
  37. package/dist/preview/{chunk.I7QIHN66.js → chunk.CDZVUCEK.js} +1 -1
  38. package/dist/preview/chunk.CR5MQMOL.js +1 -0
  39. package/dist/preview/{chunk.2GLJH253.js → chunk.DUIKIJKC.js} +1 -1
  40. package/dist/preview/{chunk.GT3F6FQ6.js → chunk.DUJUJN35.js} +1 -1
  41. package/dist/preview/chunk.ECSWXLBI.js +9 -0
  42. package/dist/preview/{chunk.KW65F4WA.js → chunk.EF3UB7US.js} +1 -1
  43. package/dist/preview/chunk.EJUZGIQ5.js +1 -0
  44. package/dist/preview/{chunk.NLBIX7LH.js → chunk.ETWREHXF.js} +1 -1
  45. package/dist/preview/{chunk.3BAHAK6W.js → chunk.ETX4QMM2.js} +1 -1
  46. package/dist/preview/{chunk.VQAQQW4Q.js → chunk.F5FJHKWV.js} +1 -1
  47. package/dist/preview/{chunk.D5ETRTAF.js → chunk.F7AFJRPP.js} +1 -1
  48. package/dist/preview/{chunk.TKMQROXF.js → chunk.FDFVGHQE.js} +1 -1
  49. package/dist/preview/{chunk.UJRBOUGC.js → chunk.FFPG4PHX.js} +1 -1
  50. package/dist/preview/{chunk.CJ23XTSW.js → chunk.FKUVIG6D.js} +1 -1
  51. package/dist/preview/chunk.GDYI5QDS.js +1 -0
  52. package/dist/preview/{chunk.OFRGDJYX.js → chunk.GPJFNLEJ.js} +1 -1
  53. package/dist/preview/chunk.GQI53L5P.js +1 -0
  54. package/dist/preview/{chunk.X7JMJSLU.js → chunk.GQX57JIE.js} +1 -1
  55. package/dist/preview/{chunk.ZH4NWRWB.js → chunk.GTUBIJTP.js} +1 -1
  56. package/dist/preview/{chunk.X7N3JUO4.js → chunk.GZEZMU2T.js} +2 -2
  57. package/dist/preview/{chunk.6VAFNCR4.js → chunk.HG34MT7C.js} +1 -1
  58. package/dist/preview/{chunk.DUWYF7BO.js → chunk.HGP3Q7QX.js} +1 -1
  59. package/dist/preview/chunk.IATLUWAD.js +1 -0
  60. package/dist/preview/chunk.IDQHSAAQ.js +1 -0
  61. package/dist/preview/chunk.IMFAPZ6J.js +21 -0
  62. package/dist/preview/{chunk.PQVUQVRL.js → chunk.JC5NXMG3.js} +1 -1
  63. package/dist/preview/chunk.JJP5OL5E.js +1 -0
  64. package/dist/preview/{chunk.QQTRAY5W.js → chunk.JLPBXG4P.js} +1 -1
  65. package/dist/preview/chunk.JLR74UFP.js +1 -0
  66. package/dist/preview/{chunk.2VTMTW7K.js → chunk.JYJNRCK5.js} +1 -1
  67. package/dist/preview/chunk.K4ITS63T.js +1 -0
  68. package/dist/preview/{chunk.KTFUVR4V.js → chunk.KFHXTHIY.js} +1 -1
  69. package/dist/preview/{chunk.QQCDCRR2.js → chunk.KGGWFL54.js} +1 -1
  70. package/dist/preview/{chunk.5A4AOFOA.js → chunk.KHRS2SKB.js} +1 -1
  71. package/dist/preview/{chunk.NWT5FPEK.js → chunk.KOPRZLJH.js} +18 -18
  72. package/dist/preview/{chunk.Z4UM4CMT.js → chunk.KQSD5MLY.js} +1 -1
  73. package/dist/preview/{chunk.DFK2NA6L.js → chunk.KT2LXHSI.js} +1 -1
  74. package/dist/preview/{chunk.ETR6AV47.js → chunk.KVEDMKUN.js} +1 -1
  75. package/dist/preview/{chunk.7LL7OSBY.js → chunk.KZ3UPV2L.js} +2 -2
  76. package/dist/preview/{chunk.J2V76Z6G.js → chunk.L2AV6JRA.js} +1 -1
  77. package/dist/preview/chunk.L5MDUZLQ.js +1 -0
  78. package/dist/preview/chunk.LDE5HLTM.js +1 -0
  79. package/dist/preview/{chunk.IRHSTUZM.js → chunk.LGHMUUTG.js} +1 -1
  80. package/dist/preview/{chunk.PPRSGM64.js → chunk.LJXAZ5TF.js} +1 -1
  81. package/dist/preview/{chunk.OZGETOTK.js → chunk.M55U47A6.js} +1 -1
  82. package/dist/preview/chunk.M5RHVUZ6.js +1 -0
  83. package/dist/preview/chunk.MBZ6N5SO.js +1 -0
  84. package/dist/preview/chunk.MCFLCC42.js +12 -0
  85. package/dist/preview/{chunk.MVSV7T6E.js → chunk.MCPLU2U4.js} +1 -1
  86. package/dist/preview/chunk.MQISKON2.js +1 -0
  87. package/dist/preview/{chunk.DHAK6PPX.js → chunk.MRUDTYOL.js} +2 -2
  88. package/dist/preview/chunk.N7FIUTVY.js +1 -0
  89. package/dist/preview/chunk.NPU4WYRB.js +1 -0
  90. package/dist/preview/{chunk.DPHTUTOS.js → chunk.O6SKKF4V.js} +1 -1
  91. package/dist/preview/{chunk.SKJJBLXF.js → chunk.OB7XLVK6.js} +1 -1
  92. package/dist/preview/{chunk.P6FQAILU.js → chunk.ODHCSYXX.js} +1 -1
  93. package/dist/preview/chunk.OHAWUOUN.js +1 -0
  94. package/dist/preview/chunk.OKQ4JXTW.js +1 -0
  95. package/dist/preview/{chunk.YDL5BSTG.js → chunk.OUNLAMBA.js} +1 -1
  96. package/dist/preview/chunk.OYQ6ZA6T.js +1 -0
  97. package/dist/preview/chunk.Q7RI4SI4.js +1 -0
  98. package/dist/preview/chunk.Q7UQ5OXA.js +1 -0
  99. package/dist/preview/{chunk.PMJUGHW4.js → chunk.QAUZDLDA.js} +1 -1
  100. package/dist/preview/{chunk.5Y3Q7ONN.js → chunk.QFI4L2HK.js} +1 -1
  101. package/dist/preview/{chunk.UGJSMNVO.js → chunk.QSZLY62B.js} +1 -1
  102. package/dist/preview/{chunk.LXCJVZF3.js → chunk.QZMBEG4E.js} +1 -1
  103. package/dist/preview/{chunk.TBRJOKIK.js → chunk.RK6BK5FD.js} +1 -1
  104. package/dist/preview/{chunk.76W2FXEC.js → chunk.ROJZLOKZ.js} +1 -1
  105. package/dist/preview/chunk.RXJBYP7B.js +1 -0
  106. package/dist/preview/chunk.S64LCR23.js +1 -0
  107. package/dist/preview/{chunk.TMDI7KRS.js → chunk.S7OFTGBQ.js} +4 -4
  108. package/dist/preview/chunk.SGMVLKZO.js +25 -0
  109. package/dist/preview/chunk.SJRXBTGP.js +1 -0
  110. package/dist/preview/{chunk.GH2SWMCW.js → chunk.SRU2YDTJ.js} +1 -1
  111. package/dist/preview/chunk.SVH3OMU2.js +1 -0
  112. package/dist/preview/{chunk.SFAAM4KE.js → chunk.SWLDDQJS.js} +1 -1
  113. package/dist/preview/{chunk.ENPCLMP2.js → chunk.T4UYLB3Y.js} +1 -1
  114. package/dist/preview/chunk.THTHNY4N.js +1 -0
  115. package/dist/preview/{chunk.V2GSBYDK.js → chunk.TL7UGUY4.js} +2 -2
  116. package/dist/preview/{chunk.N4M54YK6.js → chunk.TT6QBWRA.js} +1 -1
  117. package/dist/preview/{chunk.7VT3TRHR.js → chunk.TY6VILZB.js} +1 -1
  118. package/dist/preview/{chunk.DOBQ4LO4.js → chunk.U2M4SGUU.js} +1 -1
  119. package/dist/preview/chunk.U6FGWVGB.js +1 -0
  120. package/dist/preview/{chunk.KVJFY7N5.js → chunk.UCS3CBT4.js} +1 -1
  121. package/dist/preview/{chunk.2QNGGF55.js → chunk.UDTBFAS5.js} +2 -2
  122. package/dist/preview/chunk.UEL7FLL7.js +1 -0
  123. package/dist/preview/{chunk.ODRL5OWR.js → chunk.UGJ32SEL.js} +1 -1
  124. package/dist/preview/{chunk.HKA5T7DL.js → chunk.UJTRKSCK.js} +1 -1
  125. package/dist/preview/{chunk.QII2C5OV.js → chunk.UN2OB6OD.js} +1 -1
  126. package/dist/preview/chunk.UOC3SIYT.js +1 -0
  127. package/dist/preview/{chunk.HDE2MGGU.js → chunk.V5IWJ3ZV.js} +1 -1
  128. package/dist/preview/{chunk.LPD74WBI.js → chunk.VM43YREJ.js} +1 -1
  129. package/dist/preview/chunk.VVRI7DNK.js +1 -0
  130. package/dist/preview/{chunk.MZLWLIKR.js → chunk.WGRF6EHC.js} +1 -1
  131. package/dist/preview/{chunk.KVEDIBXS.js → chunk.XWLGHTH6.js} +1 -1
  132. package/dist/preview/chunk.YAS6LXQ7.js +1 -0
  133. package/dist/preview/{chunk.EMQ5POGB.js → chunk.YCJ74LZS.js} +1 -1
  134. package/dist/preview/chunk.YEKHDZ45.js +20 -0
  135. package/dist/preview/chunk.YEMNR4WU.js +1 -0
  136. package/dist/preview/{chunk.44G5A53D.js → chunk.YG3BLY67.js} +1 -1
  137. package/dist/preview/{chunk.J6ANRF6E.js → chunk.YUV7HZYG.js} +1 -1
  138. package/dist/preview/{chunk.5IPH2SCE.js → chunk.YYS45ZGQ.js} +1 -1
  139. package/dist/preview/{chunk.GACKGEUY.js → chunk.YZ6UKKEL.js} +1 -1
  140. package/dist/preview/{chunk.GVNYPFIM.js → chunk.ZBBCUK2K.js} +1 -1
  141. package/dist/preview/chunk.ZI66HRES.js +1 -0
  142. package/dist/preview/{chunk.XTMOFRHL.js → chunk.ZITDUHX3.js} +1 -1
  143. package/dist/preview/{chunk.2UIUMG23.js → chunk.ZK446PSX.js} +3 -3
  144. package/dist/preview/{chunk.6TKILWRM.js → chunk.ZKDJQDKX.js} +1 -1
  145. package/dist/preview/{chunk.QPICKSSM.js → chunk.ZOQ3OKKI.js} +1 -1
  146. package/dist/preview/chunk.ZVETGRUM.js +1 -0
  147. package/dist/preview/{chunk.G7WDMUDV.js → chunk.ZVOP2HHI.js} +1 -1
  148. package/dist/preview/index.html +51 -51
  149. package/dist/preview/page.js +2 -2
  150. package/package.json +6 -6
  151. package/dist/preview/chunk.2AZTW66C.js +0 -1
  152. package/dist/preview/chunk.37CJSWLL.js +0 -1
  153. package/dist/preview/chunk.3RP3N2JP.js +0 -1
  154. package/dist/preview/chunk.3UD7GG5B.js +0 -1
  155. package/dist/preview/chunk.4GQA3AJU.js +0 -1
  156. package/dist/preview/chunk.4KX53HCV.js +0 -9
  157. package/dist/preview/chunk.4TJOS4C7.js +0 -5
  158. package/dist/preview/chunk.4VW6THJF.js +0 -1
  159. package/dist/preview/chunk.664PBQAQ.js +0 -1
  160. package/dist/preview/chunk.72OZLWJL.js +0 -1
  161. package/dist/preview/chunk.72W6S746.js +0 -1
  162. package/dist/preview/chunk.7FRPNQU4.js +0 -1
  163. package/dist/preview/chunk.7QZYFLBS.js +0 -1
  164. package/dist/preview/chunk.B2IIEVBF.js +0 -21
  165. package/dist/preview/chunk.BDHKWVNX.js +0 -1
  166. package/dist/preview/chunk.DQ7M3LFV.js +0 -1
  167. package/dist/preview/chunk.DWPU56S5.js +0 -1
  168. package/dist/preview/chunk.E2AJ7U5Z.js +0 -1
  169. package/dist/preview/chunk.EXEZBZGW.js +0 -1
  170. package/dist/preview/chunk.EZJNUFNQ.js +0 -1
  171. package/dist/preview/chunk.FOP5RBGF.js +0 -1
  172. package/dist/preview/chunk.FPYL6REZ.js +0 -1
  173. package/dist/preview/chunk.FQYOTK34.js +0 -1
  174. package/dist/preview/chunk.GTPC6JOW.js +0 -2
  175. package/dist/preview/chunk.HG4DDNPG.js +0 -1
  176. package/dist/preview/chunk.ILZYRJDS.js +0 -1
  177. package/dist/preview/chunk.KA44WNB4.js +0 -25
  178. package/dist/preview/chunk.LGSFGNWE.js +0 -1
  179. package/dist/preview/chunk.LNON6P7K.js +0 -1
  180. package/dist/preview/chunk.MAFFUPCR.js +0 -1
  181. package/dist/preview/chunk.MTXEURFE.js +0 -1
  182. package/dist/preview/chunk.NFDLCUCC.js +0 -1
  183. package/dist/preview/chunk.NX7IIZLO.js +0 -1
  184. package/dist/preview/chunk.O45VO36H.js +0 -1
  185. package/dist/preview/chunk.OAIWGWGU.js +0 -3
  186. package/dist/preview/chunk.OVO6L5IP.js +0 -88
  187. package/dist/preview/chunk.PCEYZQAW.js +0 -1
  188. package/dist/preview/chunk.PVEPU6EA.js +0 -1
  189. package/dist/preview/chunk.QO7MDWID.js +0 -1
  190. package/dist/preview/chunk.RQBEQYB2.js +0 -1
  191. package/dist/preview/chunk.SA34Y3X5.js +0 -2
  192. package/dist/preview/chunk.SAHNXAV3.js +0 -1
  193. package/dist/preview/chunk.SUPWMV2F.js +0 -1
  194. package/dist/preview/chunk.TPG6IY4M.js +0 -1
  195. package/dist/preview/chunk.UT6642FC.js +0 -1
  196. package/dist/preview/chunk.V3N34DSU.js +0 -1
  197. package/dist/preview/chunk.W72TTRLX.js +0 -20
  198. package/dist/preview/chunk.X5G7FOPY.js +0 -12
  199. package/dist/preview/chunk.YEVA72L2.js +0 -1
  200. package/dist/preview/chunk.YLWON7X3.js +0 -1
  201. package/dist/preview/chunk.YUH43J2K.js +0 -1
  202. package/dist/preview/chunk.ZXZNAG35.js +0 -1
@@ -1 +1 @@
1
- import{B as v,C,D as S,J as G,o as O}from"./chunk.2UIUMG23.js";import{G as I,_ as m,c as V,j as y,l as p,m as g,n as u,o as D,v as B,z as E}from"./chunk.KA44WNB4.js";import{Zc as P,_c as k,ad as R,bd as T,ia as M}from"./chunk.4TJOS4C7.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
1
+ import{B as v,C,D as S,J as G,o as O}from"./chunk.ZK446PSX.js";import{$ as m,G as I,c as V,j as y,l as p,m as g,n as u,o as D,v as B,z as E}from"./chunk.SGMVLKZO.js";import{hd as P,ia as M,id as k,kd as R,ld as T}from"./chunk.BLS2G3CD.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
@@ -1 +1 @@
1
- import{g as o,l as u}from"./chunk.KA44WNB4.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
1
+ import{g as o,l as u}from"./chunk.SGMVLKZO.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
@@ -1 +1 @@
1
- import{ic as g}from"./chunk.4TJOS4C7.js";function v(){let t=new Uint8Array(16);return globalThis.crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function k(t,e){if(!t)return;let i={..."filter"in e&&e.filter?{filter:e.filter}:{},...e.section?{section:e.section}:{}};"record"in e?t.record(e.record,i):"list"in e?t.list(e.list,i):t.place(e.place,i)}function w(t,e){if(!t?.href)return;let i={..."filter"in e&&e.filter?{filter:e.filter}:{},...e.section?{section:e.section}:{}};return t.href("record"in e?{record:e.record}:"list"in e?{list:e.list}:{place:e.place},i)}var b=[["accent","--graview-accent"],["ground","--graview-ground"],["panel","--graview-panel"],["ink","--graview-ink"],["inkMuted","--graview-ink-muted"],["edge","--graview-edge"],["fontBody","--graview-font-body"],["fontDisplay","--graview-font-display"],["fontMono","--graview-font-mono"],["radius","--graview-radius"]];function R(t){let e=t.ownerDocument.defaultView,i=e.getComputedStyle(t),s=t.closest("[data-graview-scheme]")?.getAttribute("data-graview-scheme"),d={scheme:s==="dark"||s==="light"?s:/\bdark\b/.test(i.colorScheme??"")?"dark":/\blight\b/.test(i.colorScheme??"")?"light":e.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"};for(let[l,u]of b)d[l]=i.getPropertyValue(u).trim();return d}function T(t,e){let i=t.defaultView;if(!i||typeof i.MutationObserver!="function")return()=>{};let s=new i.MutationObserver(e);s.observe(t.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-graview-scheme","data-theme"]});let o=i.matchMedia?.("(prefers-color-scheme: dark)");return o?.addEventListener?.("change",e),()=>{s.disconnect(),o?.removeEventListener?.("change",e)}}function x(t,e,i){let s=e?.(),o=t(),d=s?.logo,l=i.url(typeof d=="string"||d===void 0?d:o.scheme==="dark"&&d.dark?d.dark:d.light);return{...o,...s?.name?{name:s.name}:{},...l?{logo:l}:{}}}function B(t,e,i){let s,o,d=n=>{n?.startsWith("blob:")&&t.URL.revokeObjectURL(n)},l=async n=>{if(n.startsWith("<"))return g(n)===null?new t.Blob([n],{type:"image/svg+xml"}):void 0;if(/\\|%2e/i.test(n)||n.split(/[?#]/)[0].split("/").some(m=>m==="."||m===".."))return;let r=new t.URL(n,t.document.baseURI);if(r.origin!==t.location.origin||!/^https?:$/.test(r.protocol))return;let a=await t.fetch(r.href,{credentials:"same-origin"}),c=(a.headers.get("content-type")??"").split(";")[0].trim();return a.ok&&c.startsWith("image/")?new t.Blob([await a.arrayBuffer()],{type:c}):void 0},u=n=>new Promise(r=>{let a=new t.Image;a.onload=()=>r(!0),a.onerror=()=>r(!1),t.setTimeout(()=>r(!1),2e3),a.src=n}),h=n=>new Promise((r,a)=>{let c=new t.FileReader;c.onload=()=>r(String(c.result)),c.onerror=a,c.readAsDataURL(n)}),p=async n=>{if(/^data:image\//i.test(n))return n;let r=await l(n);if(!(!r||s!==n)){if(i==="blob"){let a=t.URL.createObjectURL(r);if(await u(a))return a;t.URL.revokeObjectURL(a)}return h(r)}},f=(n,r)=>{if(s!==n)return d(r);r!==o&&(d(o),o=r,e())};return{url(n){let r=n?.trim()||void 0;return r!==s&&(s=r,r?p(r).then(a=>f(r,a),()=>f(r,void 0)):(d(o),o=void 0)),o},dispose(){s=void 0,d(o),o=void 0}}}export{v as a,k as b,w as c,R as d,T as e,x as f,B as g};
1
+ import{tc as g}from"./chunk.BLS2G3CD.js";function v(){let t=new Uint8Array(16);return globalThis.crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function k(t,e){if(!t)return;let i={..."filter"in e&&e.filter?{filter:e.filter}:{},...e.section?{section:e.section}:{}};"record"in e?t.record(e.record,i):"list"in e?t.list(e.list,i):t.place(e.place,i)}function w(t,e){if(!t?.href)return;let i={..."filter"in e&&e.filter?{filter:e.filter}:{},...e.section?{section:e.section}:{}};return t.href("record"in e?{record:e.record}:"list"in e?{list:e.list}:{place:e.place},i)}var b=[["accent","--graview-accent"],["ground","--graview-ground"],["panel","--graview-panel"],["ink","--graview-ink"],["inkMuted","--graview-ink-muted"],["edge","--graview-edge"],["fontBody","--graview-font-body"],["fontDisplay","--graview-font-display"],["fontMono","--graview-font-mono"],["radius","--graview-radius"]];function R(t){let e=t.ownerDocument.defaultView,i=e.getComputedStyle(t),s=t.closest("[data-graview-scheme]")?.getAttribute("data-graview-scheme"),d={scheme:s==="dark"||s==="light"?s:/\bdark\b/.test(i.colorScheme??"")?"dark":/\blight\b/.test(i.colorScheme??"")?"light":e.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"};for(let[l,u]of b)d[l]=i.getPropertyValue(u).trim();return d}function T(t,e){let i=t.defaultView;if(!i||typeof i.MutationObserver!="function")return()=>{};let s=new i.MutationObserver(e);s.observe(t.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-graview-scheme","data-theme"]});let o=i.matchMedia?.("(prefers-color-scheme: dark)");return o?.addEventListener?.("change",e),()=>{s.disconnect(),o?.removeEventListener?.("change",e)}}function x(t,e,i){let s=e?.(),o=t(),d=s?.logo,l=i.url(typeof d=="string"||d===void 0?d:o.scheme==="dark"&&d.dark?d.dark:d.light);return{...o,...s?.name?{name:s.name}:{},...l?{logo:l}:{}}}function B(t,e,i){let s,o,d=n=>{n?.startsWith("blob:")&&t.URL.revokeObjectURL(n)},l=async n=>{if(n.startsWith("<"))return g(n)===null?new t.Blob([n],{type:"image/svg+xml"}):void 0;if(/\\|%2e/i.test(n)||n.split(/[?#]/)[0].split("/").some(m=>m==="."||m===".."))return;let r=new t.URL(n,t.document.baseURI);if(r.origin!==t.location.origin||!/^https?:$/.test(r.protocol))return;let a=await t.fetch(r.href,{credentials:"same-origin"}),c=(a.headers.get("content-type")??"").split(";")[0].trim();return a.ok&&c.startsWith("image/")?new t.Blob([await a.arrayBuffer()],{type:c}):void 0},u=n=>new Promise(r=>{let a=new t.Image;a.onload=()=>r(!0),a.onerror=()=>r(!1),t.setTimeout(()=>r(!1),2e3),a.src=n}),h=n=>new Promise((r,a)=>{let c=new t.FileReader;c.onload=()=>r(String(c.result)),c.onerror=a,c.readAsDataURL(n)}),p=async n=>{if(/^data:image\//i.test(n))return n;let r=await l(n);if(!(!r||s!==n)){if(i==="blob"){let a=t.URL.createObjectURL(r);if(await u(a))return a;t.URL.revokeObjectURL(a)}return h(r)}},f=(n,r)=>{if(s!==n)return d(r);r!==o&&(d(o),o=r,e())};return{url(n){let r=n?.trim()||void 0;return r!==s&&(s=r,r?p(r).then(a=>f(r,a),()=>f(r,void 0)):(d(o),o=void 0)),o},dispose(){s=void 0,d(o),o=void 0}}}export{v as a,k as b,w as c,R as d,T as e,x as f,B as g};
@@ -0,0 +1 @@
1
+ import{k as a,l as o}from"./chunk.5RNB6IC5.js";import"./chunk.ZITDUHX3.js";import"./chunk.ETWREHXF.js";import"./chunk.YZ6UKKEL.js";import"./chunk.DUIKIJKC.js";import"./chunk.73BJYIYS.js";import"./chunk.OKQ4JXTW.js";import"./chunk.M5RHVUZ6.js";import"./chunk.MRUDTYOL.js";import"./chunk.HGP3Q7QX.js";import"./chunk.QSZLY62B.js";import"./chunk.7VX6TBNY.js";import"./chunk.WVUJXDXZ.js";import"./chunk.6SHF6IL5.js";import"./chunk.MQISKON2.js";import"./chunk.GQX57JIE.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import"./chunk.GZHZLJBF.js";import"./chunk.JLR74UFP.js";import"./chunk.OJGHDWI6.js";import"./chunk.HG34MT7C.js";import"./chunk.TT6QBWRA.js";import"./chunk.UCS3CBT4.js";import"./chunk.O6SKKF4V.js";import"./chunk.ZK446PSX.js";import{ra as n}from"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function s(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{s as frameworkViews};
@@ -1 +1 @@
1
- import{Ja as y,La as k,R as w,j as c,l as h,m as b,r as f}from"./chunk.KA44WNB4.js";import{U as i}from"./chunk.4TJOS4C7.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=null,a=new Set,v=e=>{s={kind:e,n:(s?.n??0)+1};for(let t of a)t()},A=()=>s,C=e=>(a.add(e),()=>a.delete(e)),V=()=>{s=null};var d=g(w(),1);function T(e,t){if(e.length===0||t.length===0)return[];let o=new Set(t.map(n=>n.id));return e.filter(n=>n.nodeIds.some(l=>o.has(l)))}var x=(e,t)=>`${i(e)} ${e===1?"problem":"problems"} in ${t}`;function q({kind:e,plural:t,problems:o,flag:n,listed:l=!1}){let{view:p,go:P}=k(),{set:$}=y();if(o.length===0)return null;let u=x(o.length,t),m=o.length===1?"it":"them";return(0,d.jsx)("button",{type:"button",className:"graview-district-problems","data-testid":`district-problems-${e}`,"data-graview-problems":o.length,"aria-expanded":l,"aria-label":u,title:`${u} \u2014 ${o[0].message}${o.length>1?` (and ${i(o.length-1)} more)`:""}. Press to see ${m} and how to fix ${m}.`,onClick:r=>{r.stopPropagation(),p.overview||P(h(c(b(p,!0),null),"view",null)),$([f(e)]),v(e)},onDoubleClick:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:(0,d.jsx)("span",{"aria-hidden":"true",children:`${n} ${i(o.length)}`})})}export{A as a,C as b,V as c,T as d,x as e,q as f};
1
+ import{Ka as y,Ma as k,S as w,j as c,l as h,m as b,r as f}from"./chunk.SGMVLKZO.js";import{U as i}from"./chunk.BLS2G3CD.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=null,a=new Set,v=e=>{s={kind:e,n:(s?.n??0)+1};for(let t of a)t()},A=()=>s,C=e=>(a.add(e),()=>a.delete(e)),V=()=>{s=null};var d=g(w(),1);function T(e,t){if(e.length===0||t.length===0)return[];let o=new Set(t.map(n=>n.id));return e.filter(n=>n.nodeIds.some(l=>o.has(l)))}var x=(e,t)=>`${i(e)} ${e===1?"problem":"problems"} in ${t}`;function q({kind:e,plural:t,problems:o,flag:n,listed:l=!1}){let{view:p,go:P}=k(),{set:$}=y();if(o.length===0)return null;let u=x(o.length,t),m=o.length===1?"it":"them";return(0,d.jsx)("button",{type:"button",className:"graview-district-problems","data-testid":`district-problems-${e}`,"data-graview-problems":o.length,"aria-expanded":l,"aria-label":u,title:`${u} \u2014 ${o[0].message}${o.length>1?` (and ${i(o.length-1)} more)`:""}. Press to see ${m} and how to fix ${m}.`,onClick:r=>{r.stopPropagation(),p.overview||P(h(c(b(p,!0),null),"view",null)),$([f(e)]),v(e)},onDoubleClick:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:(0,d.jsx)("span",{"aria-hidden":"true",children:`${n} ${i(o.length)}`})})}export{A as a,C as b,V as c,T as d,x as e,q as f};
@@ -1,4 +1,4 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{$ as X,Da as M,G as B,Ja as $r,Ka as Or,La as Nr,Oa as Z,R as S,Sa as J,_ as fe,a as $e,e as Oe,ia as Tr,l as Sr,m as Pr,qa as Ar,s as Lr,v as ae,z as Er}from"./chunk.KA44WNB4.js";import{a as R}from"./chunk.SDO3U72B.js";import{Xa as rr,Xc as ge,Yc as ne,_c as Te,ac as nr,ad as mr,bd as wr,cc as ar,cd as Q,da as Ze,dc as ue,ec as Ee,fc as ir,gc as or,hc as U,ia as Je,ib as tr,ic as sr,ja as er,jc as lr,jd as vr,kd as yr,lc as dr,ld as hr,mc as cr,md as br,nd as xr,od as Ae,sc as pr,sd as kr,uc as ur,xc as gr,yc as fr}from"./chunk.4TJOS4C7.js";import{a as Xe,b as h}from"./chunk.AJZBJBMO.js";var Vr=Xe(L=>{"use strict";var Ft=B();function Fr(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function W(){}var P={d:{f:W,r:function(){throw Error(Fr(522))},D:W,C:W,L:W,m:W,X:W,S:W,M:W},p:0,findDOMNode:null},Vt=Symbol.for("react.portal");function It(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vt,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}var ie=Ft.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function we(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}L.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P;L.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Fr(299));return It(r,e,null,t)};L.flushSync=function(r){var e=ie.T,t=P.p;try{if(ie.T=null,P.p=2,r)return r()}finally{ie.T=e,P.p=t,P.d.f()}};L.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,P.d.C(r,e))};L.prefetchDNS=function(r){typeof r=="string"&&P.d.D(r)};L.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=we(t,e.crossOrigin),i=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?P.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:a}):t==="script"&&P.d.X(r,{crossOrigin:n,integrity:i,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};L.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=we(e.as,e.crossOrigin);P.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&P.d.M(r)};L.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=we(t,e.crossOrigin);P.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};L.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=we(e.as,e.crossOrigin);P.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else P.d.m(r)};L.requestFormReset=function(r){P.d.r(r)};L.unstable_batchedUpdates=function(r,e){return r(e)};L.useFormState=function(r,e,t){return ie.H.useFormState(r,e,t)};L.useFormStatus=function(){return ie.H.useHostTransitionStatus()};L.version="19.2.8"});var Kr=Xe((oa,Wr)=>{"use strict";function Ir(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ir)}catch(r){console.error(r)}}Ir(),Wr.exports=Vr()});var Cr={name:"Graview",typography:{body:Ee.body,mono:Ee.mono},schemes:ue},Hr={ground:"--graview-ground",groundDeep:"--graview-ground-deep",wash:"--graview-wash",panel:"--graview-panel",panelMuted:"--graview-panel-muted",panelWarning:"--graview-panel-warning",edge:"--graview-edge",edgeBright:"--graview-edge-bright",ink:"--graview-ink",inkMuted:"--graview-ink-muted",inkFaint:"--graview-ink-faint",accent:"--graview-accent",accentDim:"--graview-accent-dim",accentInk:"--graview-accent-ink",warn:"--graview-warn",good:"--graview-good",bad:"--graview-bad",glow:"--graview-glow",bar:"--graview-bar",float:"--graview-float",liftLow:"--graview-lift-low",liftHigh:"--graview-lift-high",tintAlpha:"--graview-tint-alpha",tintLightness:"--graview-tint-lightness",gridAlpha:"--graview-grid-alpha"};function Rr(r){return Object.keys(Hr).map(e=>` ${Hr[e]}: ${r[e]};`).join(`
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{$ as fe,Ea as M,G as B,Ka as $r,La as Or,Ma as Nr,Pa as Z,S,Ta as J,a as $e,aa as X,e as Oe,ja as Tr,l as Sr,m as Pr,ra as Ar,s as Lr,v as ae,z as Er}from"./chunk.SGMVLKZO.js";import{a as R}from"./chunk.SDO3U72B.js";import{Cd as kr,Dc as pr,Fc as ur,Ic as gr,Jc as fr,Ya as rr,da as Ze,fd as ge,gd as ne,ia as Je,id as Te,ja as er,kd as mr,lb as tr,lc as nr,ld as wr,md as Q,nc as ar,oc as ue,pc as Ee,qc as ir,rc as or,sc as U,tc as sr,td as vr,uc as lr,ud as yr,vd as hr,wc as dr,wd as br,xc as cr,xd as xr,yd as Ae}from"./chunk.BLS2G3CD.js";import{a as Xe,b as h}from"./chunk.AJZBJBMO.js";var Vr=Xe(L=>{"use strict";var Ft=B();function Fr(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function W(){}var P={d:{f:W,r:function(){throw Error(Fr(522))},D:W,C:W,L:W,m:W,X:W,S:W,M:W},p:0,findDOMNode:null},Vt=Symbol.for("react.portal");function It(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vt,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}var ie=Ft.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function we(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}L.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P;L.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Fr(299));return It(r,e,null,t)};L.flushSync=function(r){var e=ie.T,t=P.p;try{if(ie.T=null,P.p=2,r)return r()}finally{ie.T=e,P.p=t,P.d.f()}};L.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,P.d.C(r,e))};L.prefetchDNS=function(r){typeof r=="string"&&P.d.D(r)};L.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=we(t,e.crossOrigin),i=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?P.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:a}):t==="script"&&P.d.X(r,{crossOrigin:n,integrity:i,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};L.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=we(e.as,e.crossOrigin);P.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&P.d.M(r)};L.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=we(t,e.crossOrigin);P.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};L.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=we(e.as,e.crossOrigin);P.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else P.d.m(r)};L.requestFormReset=function(r){P.d.r(r)};L.unstable_batchedUpdates=function(r,e){return r(e)};L.useFormState=function(r,e,t){return ie.H.useFormState(r,e,t)};L.useFormStatus=function(){return ie.H.useHostTransitionStatus()};L.version="19.2.8"});var Kr=Xe((oa,Wr)=>{"use strict";function Ir(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ir)}catch(r){console.error(r)}}Ir(),Wr.exports=Vr()});var Cr={name:"Graview",typography:{body:Ee.body,mono:Ee.mono},schemes:ue},Hr={ground:"--graview-ground",groundDeep:"--graview-ground-deep",wash:"--graview-wash",panel:"--graview-panel",panelMuted:"--graview-panel-muted",panelWarning:"--graview-panel-warning",edge:"--graview-edge",edgeBright:"--graview-edge-bright",ink:"--graview-ink",inkMuted:"--graview-ink-muted",inkFaint:"--graview-ink-faint",accent:"--graview-accent",accentDim:"--graview-accent-dim",accentInk:"--graview-accent-ink",warn:"--graview-warn",good:"--graview-good",bad:"--graview-bad",glow:"--graview-glow",bar:"--graview-bar",float:"--graview-float",liftLow:"--graview-lift-low",liftHigh:"--graview-lift-high",tintAlpha:"--graview-tint-alpha",tintLightness:"--graview-tint-lightness",gridAlpha:"--graview-grid-alpha"};function Rr(r){return Object.keys(Hr).map(e=>` ${Hr[e]}: ${r[e]};`).join(`
2
2
  `)}function Br(r,e){let t=r===e?r:`${r} ${e}`;return` ${t} [data-graview-view] { transition: none; }
3
3
  ${t} [data-graview-touched] > * { animation: none; }
4
4
  ${t} [data-graview-view][data-graview-wrote] > *,
@@ -277,7 +277,7 @@ code { color: var(--graview-ink-muted); font-size: 0.8125rem; letter-spacing: 0.
277
277
  @media (prefers-reduced-motion: reduce) {
278
278
  ${Br(`${l}:not([data-graview-motion='full'])`,o)}
279
279
  }
280
- ${Br(`${l}[data-graview-motion='reduce']`,o)}`}var Ne=h(B(),1),Mr=new WeakMap,me=r=>{let e=Mr.get(r);return e||Mr.set(r,e={open:null,drawn:0,listeners:new Set}),e},Mt=r=>{for(let e of[...r.listeners])e()},_t=0;function ta(r,e){let t=me(r);t.open=e?{...e,at:++_t}:null,Mt(t)}var _r=r=>e=>{let t=me(r);return t.listeners.add(e),()=>void t.listeners.delete(e)};function Dr(r){let e=()=>r?me(r).drawn>0:!1;return(0,Ne.useSyncExternalStore)(r?_r(r):Dt,e,e)}var Dt=()=>()=>{};function na(r){let e=()=>me(r).open;return(0,Ne.useSyncExternalStore)(_r(r),e,e)}var D=h(B(),1),Gr=h(Kr(),1);function Wt(r){let[e,t]=(0,D.useState)(null),[n,i]=(0,D.useState)(null);return(0,D.useLayoutEffect)(()=>{r.current!==n&&i(r.current)}),(0,D.useLayoutEffect)(()=>{if(!n||typeof ResizeObserver>"u")return;let a=()=>Math.round(n.getBoundingClientRect().width),o=a();t(o);let l=new ResizeObserver(()=>{let p=a();p!==o&&(o=p,(0,Gr.flushSync)(()=>t(p)))});return l.observe(n),()=>l.disconnect()},[n]),e}function Kt(r=!0){let[e,t]=(0,D.useState)();return(0,D.useEffect)(()=>{if(!r)return t(void 0);let n=0,i=()=>t(innerHeight),a=()=>{i(),clearTimeout(n),n=window.setTimeout(i,300)},o=l=>{for(let[p,s]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])p?.[l](s,a)};return o("addEventListener"),i(),()=>{clearTimeout(n),o("removeEventListener")}},[r]),e}var ve={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var E=h(B(),1);var O=h(S(),1),zr=6e3;function Gt(){let r=[],e=0,t=new Set,n=new Map,i,a=()=>{for(let s of[...t])s()},o=s=>{if(clearTimeout(n.get(s.id)),n.delete(s.id),s.kind!=="toast")return;let u=(s.actions?.length??0)+(s.action?1:0),c=s.timeout??(u>0?!1:zr);c!==!1&&n.set(s.id,setTimeout(()=>i?.()?o(s):l(s.id),c))},l=s=>{clearTimeout(n.get(s)),n.delete(s),r.some(u=>u.id===s)&&(r=r.filter(u=>u.id!==s),a())},p=s=>{r=r.some(u=>u.id===s.id)?r.map(u=>u.id===s.id?s:u):[...r,s],o(s),a()};return{notify(s){let u=s.id??`notice-${++e}`;return p({...s,id:u,said:++e}),{id:u,dismiss:()=>l(u),update:c=>{let g=r.find(w=>w.id===u);g&&p({...g,...c,id:u,kind:g.kind,said:c.sentence!==void 0&&c.sentence!==g.sentence?++e:g.said})}}},dismiss:l,hold(s){i=s},list:()=>r,subscribe(s){return t.add(s),()=>t.delete(s)}}}function zt({notices:r}){let e=r.reduce((l,p)=>!l||p.said>l.said?p:l,void 0),[t,n]=(0,E.useState)(""),[i,a]=(0,E.useState)(""),o=(0,E.useRef)(0);return(0,E.useEffect)(()=>{if(!e||e.said===o.current)return;o.current=e.said;let l=e.tone==="bad";(l?a:n)("");let p=setTimeout(()=>(l?a:n)(e.sentence),50);return()=>clearTimeout(p)},[e]),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ve,children:t}),(0,O.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ve,children:i})]})}var qt=(0,E.createContext)(null);function jt({board:r,anchor:e}){let t=(0,E.useSyncExternalStore)(r.subscribe,r.list,r.list);return(0,E.useEffect)(()=>Qt(He.prefetch),[]),(0,O.jsxs)(O.Fragment,{children:[t.length>0?(0,O.jsx)(E.Suspense,{fallback:null,children:(0,O.jsx)(Ut,{notices:t,anchor:e,board:r})}):null,(0,O.jsx)(zt,{notices:t})]})}var He=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.2UIUMG23.js","./chunk.KA44WNB4.js","./chunk.SDO3U72B.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.EMQ5POGB.js")))),Yt=()=>He.load().then(()=>{},()=>{}),Ut=He.part((r,e)=>(0,O.jsx)(r.NoticeStacks,{...e}),{quiet:!0});function Qt(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}var C=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.VQAQQW4Q.js","./chunk.UJRBOUGC.js","./chunk.DWPU56S5.js","./chunk.7FRPNQU4.js","./chunk.BDHKWVNX.js","./chunk.ZH4NWRWB.js","./chunk.2GLJH253.js","./chunk.GUMJEVVP.js","./chunk.SAHNXAV3.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.RQBEQYB2.js","./chunk.OJGHDWI6.js","./chunk.6VAFNCR4.js","./chunk.N4M54YK6.js","./chunk.KVJFY7N5.js","./chunk.DPHTUTOS.js","./chunk.2UIUMG23.js","./chunk.KA44WNB4.js","./chunk.SDO3U72B.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.4KX53HCV.js"))));var v=h(B(),1);var Yr=h(B(),1);var qr=h(B(),1);function Be(r){return(0,qr.useMemo)(()=>r===void 0||r===""?void 0:{__html:r},[r])}var K=h(S(),1);function Ce({brand:r,size:e=22}){let t=dr(r),n=jr(t?.light),i=n?jr(t?.dark):void 0,a=Be(n!==void 0&&U(n)?n:void 0),o=Be(i!==void 0&&U(i)?i:void 0),l={display:"inline-flex",flex:"0 0 auto",height:e,color:"var(--graview-accent)"},p=cr(r);if(p)return(0,K.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...l,alignItems:"center",fontSize:`${e*.86/16}rem`,lineHeight:1},children:p});if(!n)return null;let s=r?.logoAlt??r?.name??"",u=s!==""&&s!==r?.name,c=u?{role:"img","aria-label":s}:{"aria-hidden":!0};if(i){let w=(y,b,N)=>U(y)?(0,K.jsx)("span",{className:"graview-logo-face","data-graview-scheme-only":N,dangerouslySetInnerHTML:b}):(0,K.jsx)("img",{className:"graview-logo-face","data-graview-scheme-only":N,src:y,alt:""});return(0,K.jsxs)("span",{className:"graview-logo","data-testid":"app-mark",style:l,...c,children:[w(n,a,"light"),w(i,o,"dark")]})}let g=t?.darkFallback==="invert"?{"data-graview-logo-fallback":"invert"}:{};return U(n)?(0,K.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:l,...g,...c,dangerouslySetInnerHTML:a}):(0,K.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:n,alt:u?s:"",...g,style:{...l,width:"auto"}})}function jr(r){if(!(!r||!lr(r)))return U(r)&&sr(r)!==null?void 0:r}function Xt(r){(0,Yr.useEffect)(()=>{if(!r||typeof document>"u")return;let e=[...document.querySelectorAll('link[rel~="icon"]')],t=e.map(i=>i.getAttribute("href")),n;e.length===0&&(n=document.createElement("link"),n.rel="icon",n.setAttribute("data-graview-favicon",""),document.head.appendChild(n),e.push(n));for(let i of e)i.href=r;return()=>{n&&n.remove(),e.forEach((i,a)=>{i!==n&&t[a]!==null&&t[a]!==void 0&&i.setAttribute("href",t[a])})}},[r])}var d=h(S(),1),Zt=C.part((r,e)=>(0,d.jsx)(r.TidyFoot,{...e}),{quiet:!0}),Jt=C.part((r,e)=>(0,d.jsx)(r.Here,{...e}),{quiet:!0});function en(){let r=X(),[e,t]=(0,v.useState)("");return(0,v.useEffect)(()=>r?.store.subscribe((n,i)=>{i.some(a=>a.author.id!==r.principal.id)&&C.load().then(a=>a.sayTheirChange(i,r,t),String)}),[r]),(0,d.jsx)("span",{role:"status",className:"graview-bar-said",children:e})}var Ur="home",Qr="/",j="scene:whole";function rn(r){let{store:e,principal:t,views:n}=r,i=e.kindsKeptFrom(t),a=e.schema.kinds.filter(f=>!e.modules.disabledKinds.has(f)&&!i.has(f)),o=n?.arrangement?.(),l=n?.places()??[],p=br(o,e.schema,l),s=hr(e.schema,o,[...e.modules.administered.values()].flatMap(f=>f.kinds??[])),u=(f,x)=>(!e.graph.size.nodes||e.graph.count(f)>0)&&(p?x?p.places.has(`${f}|${x}`):p.kinds.has(f):!s.has(f)),c=[{key:Ur,label:"Home",path:Qr,group:"home",primary:!0}],g=l.filter(f=>a.includes(f.kind)&&f.as!==xr&&!f.hidden),w=new Set(ne(g).map(f=>Q(f,l,e.schema).toLowerCase())),y=f=>mr(f.as,wr(f,l)?Te(e.schema,f.kind).slice(1):void 0),b=new Set(o?.hide??[]),N=kr(a,o?.order,g);for(let{kind:f,view:x}of N){if(x){c.push({key:`place:${x.kind}:${x.as}`,label:Q(x,l,e.schema),path:y(x),group:"lists",kind:f,primary:p?p.places.has(`${f}|${x.as}`):!0});continue}let Y=Je(e.schema,f),A=w.has(Y.toLowerCase());c.push({key:`kind:${f}`,label:A?er(e.schema,f):Y,path:Te(e.schema,f),group:"lists",kind:f,primary:A||b.has(f)?!1:u(f),...b.has(f)?{hidden:!0}:{}})}for(let f of ne(g)){if(N.some(A=>A.view&&ge(A.view,f)))continue;let x=y(f),Y=[f.kind,...f.over??[]].some(A=>a.includes(A)&&u(A,f.as));c.some(A=>A.path===x)||c.push({key:`place:${f.kind}:${f.as}`,label:Q(f,l,e.schema),path:x,group:"pictures",kind:f.kind,primary:Y})}return a.some(f=>Object.keys(e.schema.tryDefinition(f)?.edges??{}).length>0)&&c.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),c}function tn(r,e){let[t="/",n=""]=e.split("?"),i=r.find(o=>o.path===(n?`${t}?${n}`:t))??r.find(o=>o.path===t);if(i)return i.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return r.find(o=>o.group==="lists"&&o.path===a)?.key??null}var Xr=(0,v.createContext)(null),nn=()=>(0,v.useContext)(Xr),ee=30,Zr=48,oe=640,_e=4,Re=2;function Jr(r){let{widths:e,current:t,room:n,more:i,gap:a=_e,primary:o,most:l=yr}=r;if(e.length===0||!(n>0)||!(i>0)||e.some(c=>!(c>0)))return null;let p=(c,g)=>c.reduce((w,y)=>w+e[y],0)+a*Math.max(0,c.length-1)+(g?a+i:0),s=(c,g)=>t<0||!c.includes(t)||c.slice(0,g).includes(t)?c.slice(0,g):[...c.filter(w=>w!==t).slice(0,g-1),t].sort((w,y)=>w-y),u=s(e.map((c,g)=>g).filter(c=>o?.[c]!==!1||c===t),l);if(p(u,u.length<e.length)<=n)return u.length>=Re?u:null;for(let c=u.length-1;c>=Re;c--){let g=s(u,c);if(p(g,!0)<=n)return g}return null}var an=`
280
+ ${Br(`${l}[data-graview-motion='reduce']`,o)}`}var Ne=h(B(),1),Mr=new WeakMap,me=r=>{let e=Mr.get(r);return e||Mr.set(r,e={open:null,drawn:0,listeners:new Set}),e},Mt=r=>{for(let e of[...r.listeners])e()},_t=0;function ta(r,e){let t=me(r);t.open=e?{...e,at:++_t}:null,Mt(t)}var _r=r=>e=>{let t=me(r);return t.listeners.add(e),()=>void t.listeners.delete(e)};function Dr(r){let e=()=>r?me(r).drawn>0:!1;return(0,Ne.useSyncExternalStore)(r?_r(r):Dt,e,e)}var Dt=()=>()=>{};function na(r){let e=()=>me(r).open;return(0,Ne.useSyncExternalStore)(_r(r),e,e)}var D=h(B(),1),Gr=h(Kr(),1);function Wt(r){let[e,t]=(0,D.useState)(null),[n,i]=(0,D.useState)(null);return(0,D.useLayoutEffect)(()=>{r.current!==n&&i(r.current)}),(0,D.useLayoutEffect)(()=>{if(!n||typeof ResizeObserver>"u")return;let a=()=>Math.round(n.getBoundingClientRect().width),o=a();t(o);let l=new ResizeObserver(()=>{let p=a();p!==o&&(o=p,(0,Gr.flushSync)(()=>t(p)))});return l.observe(n),()=>l.disconnect()},[n]),e}function Kt(r=!0){let[e,t]=(0,D.useState)();return(0,D.useEffect)(()=>{if(!r)return t(void 0);let n=0,i=()=>t(innerHeight),a=()=>{i(),clearTimeout(n),n=window.setTimeout(i,300)},o=l=>{for(let[p,s]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])p?.[l](s,a)};return o("addEventListener"),i(),()=>{clearTimeout(n),o("removeEventListener")}},[r]),e}var ve={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var E=h(B(),1);var O=h(S(),1),zr=6e3;function Gt(){let r=[],e=0,t=new Set,n=new Map,i,a=()=>{for(let s of[...t])s()},o=s=>{if(clearTimeout(n.get(s.id)),n.delete(s.id),s.kind!=="toast")return;let u=(s.actions?.length??0)+(s.action?1:0),c=s.timeout??(u>0?!1:zr);c!==!1&&n.set(s.id,setTimeout(()=>i?.()?o(s):l(s.id),c))},l=s=>{clearTimeout(n.get(s)),n.delete(s),r.some(u=>u.id===s)&&(r=r.filter(u=>u.id!==s),a())},p=s=>{r=r.some(u=>u.id===s.id)?r.map(u=>u.id===s.id?s:u):[...r,s],o(s),a()};return{notify(s){let u=s.id??`notice-${++e}`;return p({...s,id:u,said:++e}),{id:u,dismiss:()=>l(u),update:c=>{let g=r.find(w=>w.id===u);g&&p({...g,...c,id:u,kind:g.kind,said:c.sentence!==void 0&&c.sentence!==g.sentence?++e:g.said})}}},dismiss:l,hold(s){i=s},list:()=>r,subscribe(s){return t.add(s),()=>t.delete(s)}}}function zt({notices:r}){let e=r.reduce((l,p)=>!l||p.said>l.said?p:l,void 0),[t,n]=(0,E.useState)(""),[i,a]=(0,E.useState)(""),o=(0,E.useRef)(0);return(0,E.useEffect)(()=>{if(!e||e.said===o.current)return;o.current=e.said;let l=e.tone==="bad";(l?a:n)("");let p=setTimeout(()=>(l?a:n)(e.sentence),50);return()=>clearTimeout(p)},[e]),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ve,children:t}),(0,O.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ve,children:i})]})}var qt=(0,E.createContext)(null);function jt({board:r,anchor:e}){let t=(0,E.useSyncExternalStore)(r.subscribe,r.list,r.list);return(0,E.useEffect)(()=>Qt(He.prefetch),[]),(0,O.jsxs)(O.Fragment,{children:[t.length>0?(0,O.jsx)(E.Suspense,{fallback:null,children:(0,O.jsx)(Ut,{notices:t,anchor:e,board:r})}):null,(0,O.jsx)(zt,{notices:t})]})}var He=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.YCJ74LZS.js")))),Yt=()=>He.load().then(()=>{},()=>{}),Ut=He.part((r,e)=>(0,O.jsx)(r.NoticeStacks,{...e}),{quiet:!0});function Qt(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}var C=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.F5FJHKWV.js","./chunk.FFPG4PHX.js","./chunk.3L5USMQD.js","./chunk.GQI53L5P.js","./chunk.LDE5HLTM.js","./chunk.GTUBIJTP.js","./chunk.DUIKIJKC.js","./chunk.73BJYIYS.js","./chunk.M5RHVUZ6.js","./chunk.IDQHSAAQ.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.JLR74UFP.js","./chunk.OJGHDWI6.js","./chunk.HG34MT7C.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ECSWXLBI.js"))));var v=h(B(),1);var Yr=h(B(),1);var qr=h(B(),1);function Be(r){return(0,qr.useMemo)(()=>r===void 0||r===""?void 0:{__html:r},[r])}var K=h(S(),1);function Ce({brand:r,size:e=22}){let t=dr(r),n=jr(t?.light),i=n?jr(t?.dark):void 0,a=Be(n!==void 0&&U(n)?n:void 0),o=Be(i!==void 0&&U(i)?i:void 0),l={display:"inline-flex",flex:"0 0 auto",height:e,color:"var(--graview-accent)"},p=cr(r);if(p)return(0,K.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...l,alignItems:"center",fontSize:`${e*.86/16}rem`,lineHeight:1},children:p});if(!n)return null;let s=r?.logoAlt??r?.name??"",u=s!==""&&s!==r?.name,c=u?{role:"img","aria-label":s}:{"aria-hidden":!0};if(i){let w=(y,b,N)=>U(y)?(0,K.jsx)("span",{className:"graview-logo-face","data-graview-scheme-only":N,dangerouslySetInnerHTML:b}):(0,K.jsx)("img",{className:"graview-logo-face","data-graview-scheme-only":N,src:y,alt:""});return(0,K.jsxs)("span",{className:"graview-logo","data-testid":"app-mark",style:l,...c,children:[w(n,a,"light"),w(i,o,"dark")]})}let g=t?.darkFallback==="invert"?{"data-graview-logo-fallback":"invert"}:{};return U(n)?(0,K.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:l,...g,...c,dangerouslySetInnerHTML:a}):(0,K.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:n,alt:u?s:"",...g,style:{...l,width:"auto"}})}function jr(r){if(!(!r||!lr(r)))return U(r)&&sr(r)!==null?void 0:r}function Xt(r){(0,Yr.useEffect)(()=>{if(!r||typeof document>"u")return;let e=[...document.querySelectorAll('link[rel~="icon"]')],t=e.map(i=>i.getAttribute("href")),n;e.length===0&&(n=document.createElement("link"),n.rel="icon",n.setAttribute("data-graview-favicon",""),document.head.appendChild(n),e.push(n));for(let i of e)i.href=r;return()=>{n&&n.remove(),e.forEach((i,a)=>{i!==n&&t[a]!==null&&t[a]!==void 0&&i.setAttribute("href",t[a])})}},[r])}var d=h(S(),1),Zt=C.part((r,e)=>(0,d.jsx)(r.TidyFoot,{...e}),{quiet:!0}),Jt=C.part((r,e)=>(0,d.jsx)(r.Here,{...e}),{quiet:!0});function en(){let r=X(),[e,t]=(0,v.useState)("");return(0,v.useEffect)(()=>r?.store.subscribe((n,i)=>{i.some(a=>a.author.id!==r.principal.id)&&C.load().then(a=>a.sayTheirChange(i,r,t),String)}),[r]),(0,d.jsx)("span",{role:"status",className:"graview-bar-said",children:e})}var Ur="home",Qr="/",j="scene:whole";function rn(r){let{store:e,principal:t,views:n}=r,i=e.kindsKeptFrom(t),a=e.schema.kinds.filter(f=>!e.modules.disabledKinds.has(f)&&!i.has(f)),o=n?.arrangement?.(),l=n?.places()??[],p=br(o,e.schema,l),s=hr(e.schema,o,[...e.modules.administered.values()].flatMap(f=>f.kinds??[])),u=(f,x)=>(!e.graph.size.nodes||e.graph.count(f)>0)&&(p?x?p.places.has(`${f}|${x}`):p.kinds.has(f):!s.has(f)),c=[{key:Ur,label:"Home",path:Qr,group:"home",primary:!0}],g=l.filter(f=>a.includes(f.kind)&&f.as!==xr&&!f.hidden),w=new Set(ne(g).map(f=>Q(f,l,e.schema).toLowerCase())),y=f=>mr(f.as,wr(f,l)?Te(e.schema,f.kind).slice(1):void 0),b=new Set(o?.hide??[]),N=kr(a,o?.order,g);for(let{kind:f,view:x}of N){if(x){c.push({key:`place:${x.kind}:${x.as}`,label:Q(x,l,e.schema),path:y(x),group:"lists",kind:f,primary:p?p.places.has(`${f}|${x.as}`):!0});continue}let Y=Je(e.schema,f),A=w.has(Y.toLowerCase());c.push({key:`kind:${f}`,label:A?er(e.schema,f):Y,path:Te(e.schema,f),group:"lists",kind:f,primary:A||b.has(f)?!1:u(f),...b.has(f)?{hidden:!0}:{}})}for(let f of ne(g)){if(N.some(A=>A.view&&ge(A.view,f)))continue;let x=y(f),Y=[f.kind,...f.over??[]].some(A=>a.includes(A)&&u(A,f.as));c.some(A=>A.path===x)||c.push({key:`place:${f.kind}:${f.as}`,label:Q(f,l,e.schema),path:x,group:"pictures",kind:f.kind,primary:Y})}return a.some(f=>Object.keys(e.schema.tryDefinition(f)?.edges??{}).length>0)&&c.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),c}function tn(r,e){let[t="/",n=""]=e.split("?"),i=r.find(o=>o.path===(n?`${t}?${n}`:t))??r.find(o=>o.path===t);if(i)return i.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return r.find(o=>o.group==="lists"&&o.path===a)?.key??null}var Xr=(0,v.createContext)(null),nn=()=>(0,v.useContext)(Xr),ee=30,Zr=48,oe=640,_e=4,Re=2;function Jr(r){let{widths:e,current:t,room:n,more:i,gap:a=_e,primary:o,most:l=yr}=r;if(e.length===0||!(n>0)||!(i>0)||e.some(c=>!(c>0)))return null;let p=(c,g)=>c.reduce((w,y)=>w+e[y],0)+a*Math.max(0,c.length-1)+(g?a+i:0),s=(c,g)=>t<0||!c.includes(t)||c.slice(0,g).includes(t)?c.slice(0,g):[...c.filter(w=>w!==t).slice(0,g-1),t].sort((w,y)=>w-y),u=s(e.map((c,g)=>g).filter(c=>o?.[c]!==!1||c===t),l);if(p(u,u.length<e.length)<=n)return u.length>=Re?u:null;for(let c=u.length-1;c>=Re;c--){let g=s(u,c);if(p(g,!0)<=n)return g}return null}var an=`
281
281
  .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)}
282
282
  .graview-bar-row{display:flex;flex-wrap:nowrap;align-items:center;gap:16px;height:${Zr-1}px;margin:0;padding:0 16px}
283
283
  .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}
@@ -343,7 +343,7 @@ ${Br(`${l}[data-graview-motion='reduce']`,o)}`}var Ne=h(B(),1),Mr=new WeakMap,me
343
343
  @container graview-bar (max-width: 300px){
344
344
  .graview-bar-row{gap:4px;padding:0 10px}
345
345
  }`,re={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,minWidth:ee,height:ee,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 on({brand:r,name:e,heading:t=1,home:n,faces:i,places:a,current:o,reach:l,tools:p,find:s=!0,description:u,findBox:c,onFind:g,switch:w="words",scenePlaces:y,skips:b,named:N=!0}){let V=(0,v.useRef)(null),f=X()?.who.size,[x,Y]=(0,v.useState)(null),[A,mt]=(0,v.useState)(null),[$,wt]=(0,v.useState)(!1),[vt,Ke]=(0,v.useState)(!1),[yt,ht]=(0,v.useState)(!0),[Ge,bt]=(0,v.useState)(null),le=i?i.pages.current:!y,xt=(0,v.useMemo)(()=>a.some(m=>m.hidden&&m.key!==o)?a.filter(m=>!m.hidden||m.key===o):a,[a,o]),Se=le?{places:xt,current:o,reach:l}:y,k=Se&&Se.places.length>0?Se:null,ze=k?k.places.findIndex(m=>m.key===k.current):-1,qe=!!i&&w==="words",je=k?k.places.map(m=>m.primary===!1?"0":"1").join(""):"",I=(0,v.useCallback)(()=>{let m=V.current;if(!m)return;let H=yn(m,ze,qe,je);H!==void 0&&bt(H);let q=H?!0:ln(m);q!==null&&ht(q)},[ze,qe,je]);(0,v.useLayoutEffect)(()=>{let m=V.current;if(!m)return;let H=()=>{let pe=m.getBoundingClientRect().width;wt(pe<oe),m.style.setProperty("--graview-bar-width",`${Math.round(pe)}px`),I()};H();let q=typeof document>"u"?void 0:document.fonts;if(q?.ready.then(I),q?.addEventListener?.("loadingdone",I),typeof ResizeObserver>"u")return()=>q?.removeEventListener?.("loadingdone",I);let Le=new ResizeObserver(H);Le.observe(m);for(let pe of m.querySelectorAll(".graview-bar-tools > *"))Le.observe(pe);return()=>{Le.disconnect(),q?.removeEventListener?.("loadingdone",I)}},[I]);let Pe=(0,v.useRef)(g);Pe.current=g,(0,v.useLayoutEffect)(()=>{Pe.current?.(s&&x?{slot:x,compact:$,own:A}:null)},[s,x,$,A]),(0,v.useLayoutEffect)(()=>()=>Pe.current?.(null),[]);let kt=(0,v.useCallback)(()=>{Ke(!0),requestAnimationFrame(()=>x?.querySelector("input")?.focus())},[x]),Ye=(0,v.useRef)(null),de=(0,v.useRef)(!1),Ue=(0,v.useCallback)(()=>{Ke(!1),de.current&&(de.current=!1,requestAnimationFrame(()=>Ye.current?.focus()))},[]),St=t===!1?"span":`h${t}`,Pt=n.href!==void 0?"a":"button",Lt=m=>H=>{!m||!rt(H)||(H.preventDefault(),m())},Et=!le,Qe=k&&!$&&Ge!==null?Ge.split(",").map(Number).filter(m=>m<k.places.length):null,ce=k?(0,d.jsx)(wn,{places:k.places,current:k.current,reach:k.reach,scene:Et,stands:Qe}):null,Tt=k?k.places.map(m=>m.label).join(`
346
- `):"";(0,v.useLayoutEffect)(I,[I,e,r,Tt,k?.current,le,$,w,s]);let At=w==="icons"||!yt||$?"icons":"words";return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("header",{ref:V,className:"graview-bar","data-testid":"app-bar","data-graview-app-bar":"",...vt&&$?{"data-finding":""}:{},children:[(0,d.jsx)("style",{children:an}),b,(0,d.jsxs)("div",{className:"graview-bar-row",children:[N?(0,d.jsx)("div",{className:"graview-bar-app",children:(0,d.jsx)(St,{className:"graview-bar-name",children:(0,d.jsxs)(Pt,{...n.href!==void 0?{href:n.href,onClick:Lt(n.go)}:{type:"button",onClick:n.go},"data-testid":"app-home",...n.current?{"aria-current":"page"}:{},title:u?`${e} \u2014 ${u}`:`${e} \u2014 home`,className:"graview-bar-home",children:[(0,d.jsx)(Ce,{brand:r,size:20}),(0,d.jsx)("span",{className:"graview-bar-app-name","data-testid":"app-name",children:e})]})})}):null,i?(0,d.jsx)(sn,{faces:i,form:w,drawn:At}):null,(0,d.jsx)("div",{className:"graview-bar-mid",...Qe?{"data-places":"standing"}:!$&&ce?{"data-place":""}:{},children:$?null:ce}),!$&&k&&k.places.length>1?(0,d.jsxs)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-ruler":"",children:[k.places.map(m=>(0,d.jsx)("span",{className:"graview-bar-at",children:m.label},m.key)),(0,d.jsxs)("span",{className:"graview-bar-at",children:[Me,(0,d.jsx)(nt,{})]})]}):null,N?(0,d.jsx)("span",{className:"graview-bar-ruler","aria-hidden":"true",children:(0,d.jsx)("span",{className:"graview-bar-name",children:e})}):null,(0,d.jsxs)("div",{className:"graview-bar-tools",children:[s?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{type:"button",className:"graview-bar-find-open",ref:Ye,"data-testid":"app-find-open","aria-label":"Find",title:"Find",onClick:kt,style:{...re,display:void 0},children:(0,d.jsx)(un,{})}),(0,d.jsxs)("div",{className:"graview-bar-find","data-testid":"app-find",onBlur:m=>{let H=m.relatedTarget;H instanceof Node&&m.currentTarget.contains(H)||m.currentTarget.querySelector("input")?.value||Ue()},onKeyDownCapture:m=>{m.key==="Escape"&&$&&(de.current=!0)},onKeyDown:m=>{m.key!=="Escape"||!$||(!m.defaultPrevented||!m.currentTarget.querySelector("input")?.value?Ue():de.current=!1)},children:[(0,d.jsx)("div",{ref:Y,className:"graview-bar-find-slot",children:c}),(0,d.jsx)(cn,{})]})]}):null,(0,d.jsx)("div",{ref:mt,className:"graview-bar-own","data-graview-bar-own":""}),f?(0,d.jsx)(v.Suspense,{fallback:null,children:(0,d.jsx)(Jt,{scene:!le,compact:$})}):null,(0,d.jsx)(en,{}),p]})]})]}),$&&ce?(0,d.jsx)("div",{className:"graview-bar-line","data-graview-place-line":"","data-testid":"app-place-line",children:ce}):null]})}function sn({faces:r,form:e,drawn:t}){let n=i=>{let a=r[i];return(0,d.jsxs)("button",{type:"button",className:"graview-bar-face","data-testid":`app-face-${i}`,"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:[i==="scene"?(0,d.jsx)(tt,{}):(0,d.jsx)(pn,{}),(0,d.jsx)("span",{children:a.label})]})};return(0,d.jsxs)("div",{className:"graview-bar-faces",role:"group","aria-label":`${r.scene.label} or ${r.pages.label}`,"data-testid":"app-faces","data-switch":e,"data-switch-drawn":t,children:[n("scene"),n("pages")]})}function ln(r){let e=r.querySelector(".graview-bar-faces"),t=r.querySelector(".graview-bar-mid"),n=r.querySelector(".graview-bar-find");if(!e||!t||n?.matches(":focus-within")||r.getBoundingClientRect().width<oe)return null;let a=it(e),o=t.querySelector(".graview-bar-place-words"),l=o?parseFloat(getComputedStyle(o).fontSize)||14:0,p=o?Math.min(o.scrollWidth+34,14*l):0,s=et(r);if(s===null)return!1;let u=t.getBoundingClientRect().width-p-s;if(n&&n.getBoundingClientRect().width>0){let c=parseFloat(getComputedStyle(n).flexBasis);isFinite(c)&&(u-=Math.max(0,c-n.getBoundingClientRect().width))}return e.getAttribute("data-switch-drawn")==="icons"?u>=a+2:u>=-1}function et(r){let e=r.querySelector(".graview-bar-app"),t=r.querySelector(".graview-bar-ruler>.graview-bar-name");if(!e||!t)return 0;let n=o=>o?.getBoundingClientRect().width??0,i=n(e.firstElementChild)-n(r.querySelector(".graview-bar-app-name"))+n(t)+2,a=parseFloat(getComputedStyle(e).maxWidth)/100*(e.parentElement.clientWidth-2*e.offsetLeft)||1/0;return i>a+.5?null:Math.max(0,i-n(e))}var rt=r=>r.button===0&&!(r.metaKey||r.ctrlKey||r.shiftKey||r.altKey);function dn(){let r=globalThis.navigator?.platform??"";return/Mac|iPhone|iPad|iPod/.test(r)?"\u2318K":"Ctrl K"}function cn(){let r=Dr(X()?.aiDesk);return(0,d.jsx)("span",{className:"graview-bar-find-keys","data-testid":"app-find-keys","aria-hidden":"true",children:r?"/":dn()})}function se({size:r,box:e=r,children:t}){return(0,d.jsx)("svg",{width:r,height:r,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:t})}function tt(){return(0,d.jsxs)(se,{size:14,children:[(0,d.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,d.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 pn(){return(0,d.jsxs)(se,{size:14,children:[(0,d.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,d.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 nt(){return(0,d.jsx)(se,{size:10,children:(0,d.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function un(){return(0,d.jsxs)(se,{size:16,children:[(0,d.jsx)("circle",{cx:"7",cy:"7",r:"4.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,d.jsx)("path",{d:"M10.5 10.5 L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function gn({place:r}){if(r.key===j)return(0,d.jsx)(tt,{});if(r.group==="home")return(0,d.jsx)(se,{size:13,box:14,children:(0,d.jsx)("path",{d:"M2 6.5 L7 2 L12 6.5 V12 H2 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})});let e=r.kind?`hsl(${Math.round(nr(r.kind))} 55% 52%`:"rgb(128 128 128";return(0,d.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:12,height:8,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",background:r.group==="lists"?`${e})`:`linear-gradient(${e}), ${e})) center / 6px 4px no-repeat, ${e} / 0.35)`}})}var fn=[{group:"home"},{group:"lists",heading:"Lists"},{group:"pictures",heading:"Pictures"}],Me="More";function at({place:r,current:e,reach:t,standing:n,done:i}){let a=r.key===e,o=t.href?.(r.path);return(0,d.jsxs)(o!==void 0?"a":"button",{className:n?"graview-bar-at":"graview-bar-item","data-testid":`app-place-${r.key}`,"data-place-path":r.path,...a?{"aria-current":"page"}:{},...o!==void 0?{href:o}:{type:"button"},onClick:p=>{i(),t.go&&(o!==void 0&&!rt(p)||(p.preventDefault(),t.go(r)))},children:[n?null:(0,d.jsx)("span",{className:"graview-bar-mark",children:(0,d.jsx)(gn,{place:r})}),n&&a?(0,d.jsx)("span",{"data-testid":"app-place-current",children:r.label}):(0,d.jsx)("span",{children:r.label})]})}function mn({places:r,current:e,reach:t,id:n,done:i}){return(0,d.jsx)(d.Fragment,{children:fn.map(({group:a,heading:o})=>{let l=r.filter(s=>s.group===a);if(l.length===0)return null;let p=`${n}-${a}`;return(0,d.jsxs)("div",{role:"group",...o?{"aria-labelledby":p}:{"aria-label":l[0].label},"data-place-group":a,children:[o?(0,d.jsx)("p",{id:p,children:o}):null,(0,d.jsx)("ul",{children:l.map(s=>(0,d.jsx)("li",{children:(0,d.jsx)(at,{place:s,current:e,reach:t,standing:!1,done:i})},s.key))})]},a)})})}function wn({places:r,current:e,reach:t,scene:n,stands:i}){let a=J("places"),o=(0,v.useRef)(i);a.open||(o.current=i);let l=o.current,s=r.find(b=>b.key===e)?.label??"Places",u=l?r.filter((b,N)=>!l.includes(N)):r,c=vn(r,e,n),g=X(),w=g?.keptViews?.current(),y=!!(w&&(w.removed.length>0||g.views.places().some(b=>b.hidden)||w.may.lenses&&(g.views.arrangement?.()?.hide?.length??0)>0));return(0,d.jsxs)("nav",{className:l?"graview-bar-places":"graview-bar-place-at","aria-label":n?"What the scene shows":"The app\u2019s places",...l?{"data-testid":"app-places-standing"}:{},...c,children:[l?.map(b=>(0,d.jsx)(at,{place:r[b],current:e,reach:t,standing:!0,done:()=>{}},r[b].key)),u.length>0||y?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",className:l?"graview-bar-at":"graview-bar-place","data-testid":"app-places-open",...a.trigger,onClick:a.toggle,"aria-label":l?`${Me} \u2014 ${u.length} more ${n?"pictures":"places"}`:`${s} \u2014 ${n?"everything the scene shows":"every place"}`,title:l?u.map(b=>b.label).join(", "):s,children:[l?Me:(0,d.jsx)("span",{className:"graview-bar-place-words","data-testid":"app-place-current",children:s}),(0,d.jsx)(nt,{})]}),(0,d.jsxs)("div",{...a.pane,"data-testid":"app-places",hidden:!a.open,className:"graview-bar-list",style:Z,children:[(0,d.jsx)(mn,{places:u,current:e,reach:t,id:a.pane.id,done:()=>a.setOpen(!1)}),y&&a.open?(0,d.jsx)(v.Suspense,{fallback:null,children:(0,d.jsx)(Zt,{id:a.pane.id,scene:n,reach:t,done:()=>a.setOpen(!1)})}):null]})]}):null]})}function vn(r,e,t){let n=X()?.setMenuAt,i=a=>{let o=a.target.closest?.("[data-place-path],[data-testid=app-places-open]");if(!o||!n)return;let l={at:0};a.type==="pointerdown"?document.addEventListener("pointerup",()=>l.at||=Date.now(),{once:!0}):a.preventDefault();let p=a.nativeEvent;C.load().then(s=>s.placeGesture(p,o,r,e,t,n,l),String)};return{onContextMenu:a=>a.shiftKey||i(a),onKeyDown:a=>(a.key==="ContextMenu"||a.key==="F10"&&a.shiftKey)&&i(a),onPointerDown:a=>a.pointerType!=="mouse"&&a.isPrimary&&i(a)}}function yn(r,e,t,n){let i=r.querySelector("[data-graview-bar-ruler]"),a=r.querySelector(".graview-bar-mid");if(!i||!a)return null;let o=r.querySelector(".graview-bar-find");if(o?.matches(":focus-within"))return;if(r.getBoundingClientRect().width<oe)return null;let l=et(r);if(l===null)return null;let p=[...i.children].map(V=>V.getBoundingClientRect().width),s=p.pop()??0,u=r.querySelector(".graview-bar-faces"),c=u&&t?it(u):0,g=u?.getAttribute("data-switch-drawn")==="words"?c:0,w=a.getBoundingClientRect().left+l,y=o?.getBoundingClientRect(),b=y&&y.width>0?y.right-w-(parseFloat(getComputedStyle(o).minWidth)||0)-16:a.getBoundingClientRect().width-l,N=[...n].map(V=>V!=="0");return Jr({widths:p,current:e,room:Math.floor(b+g-c),more:s,primary:N})?.join(",")??null}function it(r){return[...r.querySelectorAll(".graview-bar-face span")].reduce((e,t)=>e+t.scrollWidth+10,0)}var hn=r=>`graview:lenses:${r}`,bn=(r,e)=>r?.name??e.kinds.join(",");function De(r){try{let e=JSON.parse(localStorage.getItem(hn(r))??"[]");return Array.isArray(e)?e.filter(t=>typeof t?.title=="string"&&typeof t.lens=="string"):[]}catch{return[]}}var G=h(B(),1);var T=h(S(),1);function xn({scheme:r,onScheme:e,profileHref:t,keeping:n,hostActions:i=kn,signature:a=!1}){let{store:o,principal:l,seats:p,people:s}=fe(),u=J("profile"),c=u.open,[g,w]=(0,G.useState)(!1);(0,G.useEffect)(()=>Ln(ye),[]),c&&!g&&w(!0),(0,G.useEffect)(()=>{c&&ye()},[c]);let y=l.id===void 0?void 0:o.graph.getNode(l.id),b=y===void 0?l.id===void 0?"Nobody in particular":rr(l,{graph:o.graph,schema:o.schema,seats:p,people:s}):Ze(o.schema.tryDefinition(y.kind),y);return(0,T.jsxs)("div",{style:{position:"relative"},children:[(0,T.jsx)("button",{type:"button","data-testid":"profile-button",...u.trigger,onClick:u.toggle,onPointerEnter:ye,onFocus:ye,"aria-label":`${b} \u2014 you, your seat and your settings`,title:`${b} \u2014 you, your seat and your settings`,style:{...re,borderRadius:999},children:(0,T.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:ee-4,height:ee-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:En(b)})}),(0,T.jsxs)("section",{...u.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!c,style:{...Z,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:c?"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,T.jsx)(G.Suspense,{fallback:null,children:(0,T.jsx)(Sn,{part:"top",name:b,me:y,profileHref:t,hostActions:i,close:()=>u.setOpen(!1)})}):null,(0,T.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:An,children:[(0,T.jsx)("span",{style:Tn,children:"Keeping this app"}),n]}),g?(0,T.jsx)(G.Suspense,{fallback:null,children:(0,T.jsx)(Pn,{part:"rest",name:b,me:y,scheme:r,onScheme:e,hostActions:i,signature:a,close:()=>u.setOpen(!1)})}):null]})]})}var kn=[],ye=()=>C.prefetch(),Sn=C.part((r,e)=>(0,T.jsx)(r.ProfilePane,{...e}),{what:"The rest of your menu"}),Pn=C.part((r,e)=>(0,T.jsx)(r.ProfilePane,{...e}),{quiet:!0});function Ln(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}function En(r){return(r.trim()[0]??"?").toUpperCase()}var Tn={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},An={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function $n(r){return!(r==="hidden"||r===!1)}var Fe=h(B(),1);var ot="The whole thing",he=r=>`scene:${r.kind}:${r.as}`;function st(r){let{view:e}=r,t=r.places.filter(c=>!r.hidden.has(c.kind)),n=ne(t),i=(c,g)=>{if(c===j)return Sr(Pr(g,!0),"view",null);let w=n.find(y=>he(y)===c);return w?Er(g,w.over?.find(y=>g.focusId===ae(y))??w.kind,w.as):null},a=e.within?.view,o=c=>e.focusId===ae(c.kind)&&(a===void 0?t.filter(g=>g.kind===c.kind).at(-1)===c:a===c.as),l=t.find(c=>o(c)&&(a!==void 0||!e.overview)),p=l?n.find(c=>ge(c,l)):void 0,s=n.filter(c=>!c.hidden||c===p);return{places:[{key:j,label:ot,path:`${Ae}${Oe(i(j,$e))}`,group:"home"},...s.map(c=>({key:he(c),label:Q(c,t,r.schema),path:`${Ae}${Oe(i(he(c),$e))}`,group:"pictures",kind:c.kind}))],current:p?he(p):j,to:i}}function On(){let{store:r,views:e,hiddenKinds:t}=fe(),{view:n,go:i}=Nr(),a=e.places(),o=(0,Fe.useMemo)(()=>st({places:a,hidden:t,view:n,schema:r.schema}),[a,t,n,r.schema]),l=(0,Fe.useMemo)(()=>({go:p=>{let s=o.to(p.key,n);s&&i(s)}}),[o,n,i]);return{places:o.places,current:o.current,reach:l}}var te=h(B(),1);var _=h(S(),1),Nn=C.part((r,e)=>(0,_.jsx)(r.ProblemRows,{...e}),{what:"The problems",as:"li"}),Ve=()=>C.prefetch();function Hn({clean:r="All rules hold"}){let e=Or(),{set:t}=$r(),n=e.length,[i,a]=(0,te.useState)(!1),o=J("problems",{open:i&&n>0,onOpenChange:a}),l=o.open,p=dt(e,r);return(0,te.useEffect)(()=>{if(n===0)return;let s=setTimeout(Ve,1500);return()=>clearTimeout(s)},[n>0]),(0,_.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,_.jsxs)("button",{type:"button","data-testid":"standing",...o.trigger,"aria-disabled":n===0?!0:void 0,"aria-label":p,onClick:n===0?void 0:o.toggle,onPointerEnter:n===0?void 0:Ve,onFocus:n===0?void 0:Ve,title:p,style:{...re,padding:n===0?0:"0 8px",cursor:n===0?"default":"pointer",color:n===0?"var(--graview-ink-muted)":lt(e),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,_.jsx)(ct,{tone:n===0?"var(--graview-good)":lt(e)}),n>0?(0,_.jsx)("span",{"aria-hidden":"true",children:n}):null]}),l?(0,_.jsx)("ol",{...o.pane,"data-testid":"problems",style:{...Z,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,_.jsx)(te.Suspense,{fallback:null,children:(0,_.jsx)(Nn,{violations:e,pick:s=>{t(s.nodeIds),o.setOpen(!1)}})})}):null]})}function dt(r,e){return r.length===0?e:`${tr(r)} \u2014 open what is broken, and what would fix it`}var lt=r=>r.some(e=>e.status==="could-not-judge"||e.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function ct({tone:r}){return(0,_.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:r}})}function Bn(r,e,t=[]){if(r.focusId)return r.focusId;let i=(r.selection??[]).map(Lr).find(a=>a!==null)??t.find(a=>e.includes(a))??e[0]??null;return i===null?null:ae(i)}var xe=h(S(),1),be=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.GNBN3BK7.js","./chunk.XTMOFRHL.js","./chunk.NLBIX7LH.js","./chunk.GACKGEUY.js","./chunk.2GLJH253.js","./chunk.GUMJEVVP.js","./chunk.4VW6THJF.js","./chunk.SAHNXAV3.js","./chunk.DHAK6PPX.js","./chunk.DUWYF7BO.js","./chunk.UGJSMNVO.js","./chunk.NR5ODXMO.js","./chunk.WVUJXDXZ.js","./chunk.TPG6IY4M.js","./chunk.NFDLCUCC.js","./chunk.X7JMJSLU.js","./chunk.PPRSGM64.js","./chunk.5Y3Q7ONN.js","./chunk.KTFUVR4V.js","./chunk.GZHZLJBF.js","./chunk.RQBEQYB2.js","./chunk.OJGHDWI6.js","./chunk.6VAFNCR4.js","./chunk.N4M54YK6.js","./chunk.KVJFY7N5.js","./chunk.DPHTUTOS.js","./chunk.2UIUMG23.js","./chunk.KA44WNB4.js","./chunk.SDO3U72B.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.YEVA72L2.js"))));function Cn(){return be.load().then(()=>{})}var Rn=[{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 Mn({schema:r,specs:e,kind:t,view:n}){let i=be.current.frameworkViews(r,e).lookup(t,{cardinality:n.cardinality,fidelity:n.fidelity});return i?(0,xe.jsx)(i,{...n}):null}var _n=be.part((r,e)=>(0,xe.jsx)(Mn,{...e}),{what:"This view"});function pt(r,e,t){for(let n of e.kinds){let i=t?.[n];for(let a of Rn){let o=p=>(0,xe.jsx)(_n,{schema:e,specs:t,kind:n,view:p}),l=a.slot!==void 0&&i?.[a.slot]!==void 0;l&&(o.says=(p,s)=>be.current?.frameworkViews(e,t).lookup(n,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(p,s)),r.register(n,{cardinality:a.cardinality,fidelity:a.fidelity},l?o:Tr(o))}}return r}function Dn(r,e){return pt(Ar(r),r,e)}var Ie=h(B(),1);var F=h(S(),1),ut=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.44G5A53D.js","./chunk.X7N3JUO4.js","./chunk.NTLHEHOM.js","./chunk.V2GSBYDK.js","./chunk.GNBN3BK7.js","./chunk.XTMOFRHL.js","./chunk.NLBIX7LH.js","./chunk.GACKGEUY.js","./chunk.HJCQ6I3S.js","./chunk.KVEDIBXS.js","./chunk.7VT3TRHR.js","./chunk.GTPC6JOW.js","./chunk.2GLJH253.js","./chunk.GUMJEVVP.js","./chunk.4VW6THJF.js","./chunk.SAHNXAV3.js","./chunk.DHAK6PPX.js","./chunk.YDL5BSTG.js","./chunk.DUWYF7BO.js","./chunk.UGJSMNVO.js","./chunk.NR5ODXMO.js","./chunk.E5GM2SMO.js","./chunk.NQZ73QV7.js","./chunk.O45VO36H.js","./chunk.UT6642FC.js","./chunk.SUPWMV2F.js","./chunk.MAFFUPCR.js","./chunk.WVUJXDXZ.js","./chunk.TPG6IY4M.js","./chunk.NFDLCUCC.js","./chunk.X7JMJSLU.js","./chunk.PPRSGM64.js","./chunk.5Y3Q7ONN.js","./chunk.KTFUVR4V.js","./chunk.GZHZLJBF.js","./chunk.RQBEQYB2.js","./chunk.OJGHDWI6.js","./chunk.6VAFNCR4.js","./chunk.N4M54YK6.js","./chunk.KVJFY7N5.js","./chunk.DPHTUTOS.js","./chunk.2UIUMG23.js","./chunk.KA44WNB4.js","./chunk.SDO3U72B.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.72W6S746.js"))));function Fn({lens:r,view:e}){let t=ut.current.declaredLensView(r);return(0,F.jsx)(t,{...e})}var Vn=ut.part((r,e)=>(0,F.jsx)(Fn,{...e}),{what:"This picture"});function In(r){let e=n=>(0,F.jsx)(Ie.Suspense,{fallback:null,children:(0,F.jsx)(Vn,{lens:r,view:n})});r.lens==="blocks"&&(e.flows=!0);let t=r.lens==="blocks"?r.options.blocks?.[0]:void 0;return typeof t?.headline=="string"&&(e.lede=t),r.create===!1&&(e.creates=!1),e}var gt=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.GNBN3BK7.js","./chunk.XTMOFRHL.js","./chunk.NLBIX7LH.js","./chunk.GACKGEUY.js","./chunk.2GLJH253.js","./chunk.GUMJEVVP.js","./chunk.4VW6THJF.js","./chunk.SAHNXAV3.js","./chunk.DHAK6PPX.js","./chunk.DUWYF7BO.js","./chunk.UGJSMNVO.js","./chunk.NR5ODXMO.js","./chunk.WVUJXDXZ.js","./chunk.TPG6IY4M.js","./chunk.NFDLCUCC.js","./chunk.X7JMJSLU.js","./chunk.PPRSGM64.js","./chunk.5Y3Q7ONN.js","./chunk.KTFUVR4V.js","./chunk.GZHZLJBF.js","./chunk.RQBEQYB2.js","./chunk.OJGHDWI6.js","./chunk.6VAFNCR4.js","./chunk.N4M54YK6.js","./chunk.KVJFY7N5.js","./chunk.DPHTUTOS.js","./chunk.2UIUMG23.js","./chunk.KA44WNB4.js","./chunk.SDO3U72B.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ILZYRJDS.js"))));function Wn({blocks:r,view:e}){let t=gt.current.homeView(r);return(0,F.jsx)(t,{...e})}var Kn=gt.part((r,e)=>(0,F.jsx)(Wn,{...e}),{what:"The home"});function Gn(r){let e=t=>(0,F.jsx)(Ie.Suspense,{fallback:null,children:(0,F.jsx)(Kn,{blocks:r,view:t})});return Object.defineProperty(e,Symbol.for("graview.home-blocks"),{value:!0}),e}function zn(r,e){return e.home&&e.home.length>0&&r.home?.(Gn(e.home)),ft(r,e),r.arrange?.(e.pages),r}function ft(r,e,t){for(let n of vr(e).drawn){if(t&&r.places().some(o=>o.title===n.title))continue;let i=In(n),a={title:n.title,lens:n.lens,...n.across?{across:n.across}:{},...t?{beside:t}:{},...n.hidden?{hidden:!0}:{},over:n.kinds,...t?{}:{declared:!0}};for(let o of n.kinds)r.register(o,{cardinality:"many",fidelity:"full"},i,a),r.register(o,{cardinality:"many",fidelity:"summary"},i,a)}}function qn(r,e,t){t.length>0&&ft(r,{schema:e,lenses:t.map(({lens:n,...i})=>({...i,name:n}))},!0)}function jn(r,e,t){qn(r,e,De(t))}var z=h(B(),1),ke=h(S(),1);var We=r=>`graview:first-look:${r}`;function Yn(r,e){if(r.seen!==void 0)try{return typeof r.seen=="function"?r.seen():r.seen}catch{return!0}try{return window.localStorage.getItem(We(e))!==null}catch{return!1}}function Un(r,e){if(r.seen===void 0)try{window.localStorage.setItem(We(e),"seen")}catch{}}var Qn=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.KA44WNB4.js","./chunk.SDO3U72B.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.SFAAM4KE.js")))),Xn=Qn.part((r,e)=>{let t=r.FirstLookHints;return(0,ke.jsx)(t,{...e})},{quiet:!0});function Zn({firstLook:r,root:e,app:t}){let n=(0,z.useRef)(null);n.current=r===!0?{}:r||null;let[i,a]=(0,z.useState)(()=>n.current!==null&&typeof window<"u"&&!Yn(n.current,t)),o=(0,z.useCallback)(l=>{if(a(!1),l===null)return;let p=n.current??{};Un(p,t),p.onDone?.(l)},[t]);return!i||n.current===null?null:(0,ke.jsx)(z.Suspense,{fallback:null,children:(0,ke.jsx)(Xn,{root:e,steps:n.current.steps??[],onEnd:o})})}export{Nt as a,Ht as b,me as c,Mt as d,ta as e,Dr as f,na as g,Be as h,Xt as i,Kr as j,Wt as k,Kt as l,ve as m,Gt as n,qt as o,jt as p,Yt as q,C as r,rn as s,tn as t,Xr as u,nn as v,re as w,on as x,xn as y,$n as z,On as A,hn as B,bn as C,De as D,Hn as E,dt as F,ct as G,Bn as H,zn as I,qn as J,jn as K,Cn as L,Dn as M,Zn as N};
346
+ `):"";(0,v.useLayoutEffect)(I,[I,e,r,Tt,k?.current,le,$,w,s]);let At=w==="icons"||!yt||$?"icons":"words";return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("header",{ref:V,className:"graview-bar","data-testid":"app-bar","data-graview-app-bar":"",...vt&&$?{"data-finding":""}:{},children:[(0,d.jsx)("style",{children:an}),b,(0,d.jsxs)("div",{className:"graview-bar-row",children:[N?(0,d.jsx)("div",{className:"graview-bar-app",children:(0,d.jsx)(St,{className:"graview-bar-name",children:(0,d.jsxs)(Pt,{...n.href!==void 0?{href:n.href,onClick:Lt(n.go)}:{type:"button",onClick:n.go},"data-testid":"app-home",...n.current?{"aria-current":"page"}:{},title:u?`${e} \u2014 ${u}`:`${e} \u2014 home`,className:"graview-bar-home",children:[(0,d.jsx)(Ce,{brand:r,size:20}),(0,d.jsx)("span",{className:"graview-bar-app-name","data-testid":"app-name",children:e})]})})}):null,i?(0,d.jsx)(sn,{faces:i,form:w,drawn:At}):null,(0,d.jsx)("div",{className:"graview-bar-mid",...Qe?{"data-places":"standing"}:!$&&ce?{"data-place":""}:{},children:$?null:ce}),!$&&k&&k.places.length>1?(0,d.jsxs)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-ruler":"",children:[k.places.map(m=>(0,d.jsx)("span",{className:"graview-bar-at",children:m.label},m.key)),(0,d.jsxs)("span",{className:"graview-bar-at",children:[Me,(0,d.jsx)(nt,{})]})]}):null,N?(0,d.jsx)("span",{className:"graview-bar-ruler","aria-hidden":"true",children:(0,d.jsx)("span",{className:"graview-bar-name",children:e})}):null,(0,d.jsxs)("div",{className:"graview-bar-tools",children:[s?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{type:"button",className:"graview-bar-find-open",ref:Ye,"data-testid":"app-find-open","aria-label":"Find",title:"Find",onClick:kt,style:{...re,display:void 0},children:(0,d.jsx)(un,{})}),(0,d.jsxs)("div",{className:"graview-bar-find","data-testid":"app-find",onBlur:m=>{let H=m.relatedTarget;H instanceof Node&&m.currentTarget.contains(H)||m.currentTarget.querySelector("input")?.value||Ue()},onKeyDownCapture:m=>{m.key==="Escape"&&$&&(de.current=!0)},onKeyDown:m=>{m.key!=="Escape"||!$||(!m.defaultPrevented||!m.currentTarget.querySelector("input")?.value?Ue():de.current=!1)},children:[(0,d.jsx)("div",{ref:Y,className:"graview-bar-find-slot",children:c}),(0,d.jsx)(cn,{})]})]}):null,(0,d.jsx)("div",{ref:mt,className:"graview-bar-own","data-graview-bar-own":""}),f?(0,d.jsx)(v.Suspense,{fallback:null,children:(0,d.jsx)(Jt,{scene:!le,compact:$})}):null,(0,d.jsx)(en,{}),p]})]})]}),$&&ce?(0,d.jsx)("div",{className:"graview-bar-line","data-graview-place-line":"","data-testid":"app-place-line",children:ce}):null]})}function sn({faces:r,form:e,drawn:t}){let n=i=>{let a=r[i];return(0,d.jsxs)("button",{type:"button",className:"graview-bar-face","data-testid":`app-face-${i}`,"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:[i==="scene"?(0,d.jsx)(tt,{}):(0,d.jsx)(pn,{}),(0,d.jsx)("span",{children:a.label})]})};return(0,d.jsxs)("div",{className:"graview-bar-faces",role:"group","aria-label":`${r.scene.label} or ${r.pages.label}`,"data-testid":"app-faces","data-switch":e,"data-switch-drawn":t,children:[n("scene"),n("pages")]})}function ln(r){let e=r.querySelector(".graview-bar-faces"),t=r.querySelector(".graview-bar-mid"),n=r.querySelector(".graview-bar-find");if(!e||!t||n?.matches(":focus-within")||r.getBoundingClientRect().width<oe)return null;let a=it(e),o=t.querySelector(".graview-bar-place-words"),l=o?parseFloat(getComputedStyle(o).fontSize)||14:0,p=o?Math.min(o.scrollWidth+34,14*l):0,s=et(r);if(s===null)return!1;let u=t.getBoundingClientRect().width-p-s;if(n&&n.getBoundingClientRect().width>0){let c=parseFloat(getComputedStyle(n).flexBasis);isFinite(c)&&(u-=Math.max(0,c-n.getBoundingClientRect().width))}return e.getAttribute("data-switch-drawn")==="icons"?u>=a+2:u>=-1}function et(r){let e=r.querySelector(".graview-bar-app"),t=r.querySelector(".graview-bar-ruler>.graview-bar-name");if(!e||!t)return 0;let n=o=>o?.getBoundingClientRect().width??0,i=n(e.firstElementChild)-n(r.querySelector(".graview-bar-app-name"))+n(t)+2,a=parseFloat(getComputedStyle(e).maxWidth)/100*(e.parentElement.clientWidth-2*e.offsetLeft)||1/0;return i>a+.5?null:Math.max(0,i-n(e))}var rt=r=>r.button===0&&!(r.metaKey||r.ctrlKey||r.shiftKey||r.altKey);function dn(){let r=globalThis.navigator?.platform??"";return/Mac|iPhone|iPad|iPod/.test(r)?"\u2318K":"Ctrl K"}function cn(){let r=Dr(X()?.aiDesk);return(0,d.jsx)("span",{className:"graview-bar-find-keys","data-testid":"app-find-keys","aria-hidden":"true",children:r?"/":dn()})}function se({size:r,box:e=r,children:t}){return(0,d.jsx)("svg",{width:r,height:r,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:t})}function tt(){return(0,d.jsxs)(se,{size:14,children:[(0,d.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,d.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 pn(){return(0,d.jsxs)(se,{size:14,children:[(0,d.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,d.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 nt(){return(0,d.jsx)(se,{size:10,children:(0,d.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function un(){return(0,d.jsxs)(se,{size:16,children:[(0,d.jsx)("circle",{cx:"7",cy:"7",r:"4.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,d.jsx)("path",{d:"M10.5 10.5 L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function gn({place:r}){if(r.key===j)return(0,d.jsx)(tt,{});if(r.group==="home")return(0,d.jsx)(se,{size:13,box:14,children:(0,d.jsx)("path",{d:"M2 6.5 L7 2 L12 6.5 V12 H2 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})});let e=r.kind?`hsl(${Math.round(nr(r.kind))} 55% 52%`:"rgb(128 128 128";return(0,d.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:12,height:8,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",background:r.group==="lists"?`${e})`:`linear-gradient(${e}), ${e})) center / 6px 4px no-repeat, ${e} / 0.35)`}})}var fn=[{group:"home"},{group:"lists",heading:"Lists"},{group:"pictures",heading:"Pictures"}],Me="More";function at({place:r,current:e,reach:t,standing:n,done:i}){let a=r.key===e,o=t.href?.(r.path);return(0,d.jsxs)(o!==void 0?"a":"button",{className:n?"graview-bar-at":"graview-bar-item","data-testid":`app-place-${r.key}`,"data-place-path":r.path,...a?{"aria-current":"page"}:{},...o!==void 0?{href:o}:{type:"button"},onClick:p=>{i(),t.go&&(o!==void 0&&!rt(p)||(p.preventDefault(),t.go(r)))},children:[n?null:(0,d.jsx)("span",{className:"graview-bar-mark",children:(0,d.jsx)(gn,{place:r})}),n&&a?(0,d.jsx)("span",{"data-testid":"app-place-current",children:r.label}):(0,d.jsx)("span",{children:r.label})]})}function mn({places:r,current:e,reach:t,id:n,done:i}){return(0,d.jsx)(d.Fragment,{children:fn.map(({group:a,heading:o})=>{let l=r.filter(s=>s.group===a);if(l.length===0)return null;let p=`${n}-${a}`;return(0,d.jsxs)("div",{role:"group",...o?{"aria-labelledby":p}:{"aria-label":l[0].label},"data-place-group":a,children:[o?(0,d.jsx)("p",{id:p,children:o}):null,(0,d.jsx)("ul",{children:l.map(s=>(0,d.jsx)("li",{children:(0,d.jsx)(at,{place:s,current:e,reach:t,standing:!1,done:i})},s.key))})]},a)})})}function wn({places:r,current:e,reach:t,scene:n,stands:i}){let a=J("places"),o=(0,v.useRef)(i);a.open||(o.current=i);let l=o.current,s=r.find(b=>b.key===e)?.label??"Places",u=l?r.filter((b,N)=>!l.includes(N)):r,c=vn(r,e,n),g=X(),w=g?.keptViews?.current(),y=!!(w&&(w.removed.length>0||g.views.places().some(b=>b.hidden)||w.may.lenses&&(g.views.arrangement?.()?.hide?.length??0)>0));return(0,d.jsxs)("nav",{className:l?"graview-bar-places":"graview-bar-place-at","aria-label":n?"What the scene shows":"The app\u2019s places",...l?{"data-testid":"app-places-standing"}:{},...c,children:[l?.map(b=>(0,d.jsx)(at,{place:r[b],current:e,reach:t,standing:!0,done:()=>{}},r[b].key)),u.length>0||y?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",className:l?"graview-bar-at":"graview-bar-place","data-testid":"app-places-open",...a.trigger,onClick:a.toggle,"aria-label":l?`${Me} \u2014 ${u.length} more ${n?"pictures":"places"}`:`${s} \u2014 ${n?"everything the scene shows":"every place"}`,title:l?u.map(b=>b.label).join(", "):s,children:[l?Me:(0,d.jsx)("span",{className:"graview-bar-place-words","data-testid":"app-place-current",children:s}),(0,d.jsx)(nt,{})]}),(0,d.jsxs)("div",{...a.pane,"data-testid":"app-places",hidden:!a.open,className:"graview-bar-list",style:Z,children:[(0,d.jsx)(mn,{places:u,current:e,reach:t,id:a.pane.id,done:()=>a.setOpen(!1)}),y&&a.open?(0,d.jsx)(v.Suspense,{fallback:null,children:(0,d.jsx)(Zt,{id:a.pane.id,scene:n,reach:t,done:()=>a.setOpen(!1)})}):null]})]}):null]})}function vn(r,e,t){let n=X()?.setMenuAt,i=a=>{let o=a.target.closest?.("[data-place-path],[data-testid=app-places-open]");if(!o||!n)return;let l={at:0};a.type==="pointerdown"?document.addEventListener("pointerup",()=>l.at||=Date.now(),{once:!0}):a.preventDefault();let p=a.nativeEvent;C.load().then(s=>s.placeGesture(p,o,r,e,t,n,l),String)};return{onContextMenu:a=>a.shiftKey||i(a),onKeyDown:a=>(a.key==="ContextMenu"||a.key==="F10"&&a.shiftKey)&&i(a),onPointerDown:a=>a.pointerType!=="mouse"&&a.isPrimary&&i(a)}}function yn(r,e,t,n){let i=r.querySelector("[data-graview-bar-ruler]"),a=r.querySelector(".graview-bar-mid");if(!i||!a)return null;let o=r.querySelector(".graview-bar-find");if(o?.matches(":focus-within"))return;if(r.getBoundingClientRect().width<oe)return null;let l=et(r);if(l===null)return null;let p=[...i.children].map(V=>V.getBoundingClientRect().width),s=p.pop()??0,u=r.querySelector(".graview-bar-faces"),c=u&&t?it(u):0,g=u?.getAttribute("data-switch-drawn")==="words"?c:0,w=a.getBoundingClientRect().left+l,y=o?.getBoundingClientRect(),b=y&&y.width>0?y.right-w-(parseFloat(getComputedStyle(o).minWidth)||0)-16:a.getBoundingClientRect().width-l,N=[...n].map(V=>V!=="0");return Jr({widths:p,current:e,room:Math.floor(b+g-c),more:s,primary:N})?.join(",")??null}function it(r){return[...r.querySelectorAll(".graview-bar-face span")].reduce((e,t)=>e+t.scrollWidth+10,0)}var hn=r=>`graview:lenses:${r}`,bn=(r,e)=>r?.name??e.kinds.join(",");function De(r){try{let e=JSON.parse(localStorage.getItem(hn(r))??"[]");return Array.isArray(e)?e.filter(t=>typeof t?.title=="string"&&typeof t.lens=="string"):[]}catch{return[]}}var G=h(B(),1);var T=h(S(),1);function xn({scheme:r,onScheme:e,profileHref:t,keeping:n,hostActions:i=kn,signature:a=!1}){let{store:o,principal:l,seats:p,people:s}=fe(),u=J("profile"),c=u.open,[g,w]=(0,G.useState)(!1);(0,G.useEffect)(()=>Ln(ye),[]),c&&!g&&w(!0),(0,G.useEffect)(()=>{c&&ye()},[c]);let y=l.id===void 0?void 0:o.graph.getNode(l.id),b=y===void 0?l.id===void 0?"Nobody in particular":rr(l,{graph:o.graph,schema:o.schema,seats:p,people:s}):Ze(o.schema.tryDefinition(y.kind),y);return(0,T.jsxs)("div",{style:{position:"relative"},children:[(0,T.jsx)("button",{type:"button","data-testid":"profile-button",...u.trigger,onClick:u.toggle,onPointerEnter:ye,onFocus:ye,"aria-label":`${b} \u2014 you, your seat and your settings`,title:`${b} \u2014 you, your seat and your settings`,style:{...re,borderRadius:999},children:(0,T.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:ee-4,height:ee-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:En(b)})}),(0,T.jsxs)("section",{...u.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!c,style:{...Z,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:c?"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,T.jsx)(G.Suspense,{fallback:null,children:(0,T.jsx)(Sn,{part:"top",name:b,me:y,profileHref:t,hostActions:i,close:()=>u.setOpen(!1)})}):null,(0,T.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:An,children:[(0,T.jsx)("span",{style:Tn,children:"Keeping this app"}),n]}),g?(0,T.jsx)(G.Suspense,{fallback:null,children:(0,T.jsx)(Pn,{part:"rest",name:b,me:y,scheme:r,onScheme:e,hostActions:i,signature:a,close:()=>u.setOpen(!1)})}):null]})]})}var kn=[],ye=()=>C.prefetch(),Sn=C.part((r,e)=>(0,T.jsx)(r.ProfilePane,{...e}),{what:"The rest of your menu"}),Pn=C.part((r,e)=>(0,T.jsx)(r.ProfilePane,{...e}),{quiet:!0});function Ln(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}function En(r){return(r.trim()[0]??"?").toUpperCase()}var Tn={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},An={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function $n(r){return!(r==="hidden"||r===!1)}var Fe=h(B(),1);var ot="The whole thing",he=r=>`scene:${r.kind}:${r.as}`;function st(r){let{view:e}=r,t=r.places.filter(c=>!r.hidden.has(c.kind)),n=ne(t),i=(c,g)=>{if(c===j)return Sr(Pr(g,!0),"view",null);let w=n.find(y=>he(y)===c);return w?Er(g,w.over?.find(y=>g.focusId===ae(y))??w.kind,w.as):null},a=e.within?.view,o=c=>e.focusId===ae(c.kind)&&(a===void 0?t.filter(g=>g.kind===c.kind).at(-1)===c:a===c.as),l=t.find(c=>o(c)&&(a!==void 0||!e.overview)),p=l?n.find(c=>ge(c,l)):void 0,s=n.filter(c=>!c.hidden||c===p);return{places:[{key:j,label:ot,path:`${Ae}${Oe(i(j,$e))}`,group:"home"},...s.map(c=>({key:he(c),label:Q(c,t,r.schema),path:`${Ae}${Oe(i(he(c),$e))}`,group:"pictures",kind:c.kind}))],current:p?he(p):j,to:i}}function On(){let{store:r,views:e,hiddenKinds:t}=fe(),{view:n,go:i}=Nr(),a=e.places(),o=(0,Fe.useMemo)(()=>st({places:a,hidden:t,view:n,schema:r.schema}),[a,t,n,r.schema]),l=(0,Fe.useMemo)(()=>({go:p=>{let s=o.to(p.key,n);s&&i(s)}}),[o,n,i]);return{places:o.places,current:o.current,reach:l}}var te=h(B(),1);var _=h(S(),1),Nn=C.part((r,e)=>(0,_.jsx)(r.ProblemRows,{...e}),{what:"The problems",as:"li"}),Ve=()=>C.prefetch();function Hn({clean:r="All rules hold"}){let e=Or(),{set:t}=$r(),n=e.length,[i,a]=(0,te.useState)(!1),o=J("problems",{open:i&&n>0,onOpenChange:a}),l=o.open,p=dt(e,r);return(0,te.useEffect)(()=>{if(n===0)return;let s=setTimeout(Ve,1500);return()=>clearTimeout(s)},[n>0]),(0,_.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,_.jsxs)("button",{type:"button","data-testid":"standing",...o.trigger,"aria-disabled":n===0?!0:void 0,"aria-label":p,onClick:n===0?void 0:o.toggle,onPointerEnter:n===0?void 0:Ve,onFocus:n===0?void 0:Ve,title:p,style:{...re,padding:n===0?0:"0 8px",cursor:n===0?"default":"pointer",color:n===0?"var(--graview-ink-muted)":lt(e),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,_.jsx)(ct,{tone:n===0?"var(--graview-good)":lt(e)}),n>0?(0,_.jsx)("span",{"aria-hidden":"true",children:n}):null]}),l?(0,_.jsx)("ol",{...o.pane,"data-testid":"problems",style:{...Z,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,_.jsx)(te.Suspense,{fallback:null,children:(0,_.jsx)(Nn,{violations:e,pick:s=>{t(s.nodeIds),o.setOpen(!1)}})})}):null]})}function dt(r,e){return r.length===0?e:`${tr(r)} \u2014 open what is broken, and what would fix it`}var lt=r=>r.some(e=>e.status==="could-not-judge"||e.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function ct({tone:r}){return(0,_.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:r}})}function Bn(r,e,t=[]){if(r.focusId)return r.focusId;let i=(r.selection??[]).map(Lr).find(a=>a!==null)??t.find(a=>e.includes(a))??e[0]??null;return i===null?null:ae(i)}var xe=h(S(),1),be=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.5RNB6IC5.js","./chunk.ZITDUHX3.js","./chunk.ETWREHXF.js","./chunk.YZ6UKKEL.js","./chunk.DUIKIJKC.js","./chunk.73BJYIYS.js","./chunk.OKQ4JXTW.js","./chunk.M5RHVUZ6.js","./chunk.MRUDTYOL.js","./chunk.HGP3Q7QX.js","./chunk.QSZLY62B.js","./chunk.7VX6TBNY.js","./chunk.WVUJXDXZ.js","./chunk.6SHF6IL5.js","./chunk.MQISKON2.js","./chunk.GQX57JIE.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.GZHZLJBF.js","./chunk.JLR74UFP.js","./chunk.OJGHDWI6.js","./chunk.HG34MT7C.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZI66HRES.js"))));function Cn(){return be.load().then(()=>{})}var Rn=[{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 Mn({schema:r,specs:e,kind:t,view:n}){let i=be.current.frameworkViews(r,e).lookup(t,{cardinality:n.cardinality,fidelity:n.fidelity});return i?(0,xe.jsx)(i,{...n}):null}var _n=be.part((r,e)=>(0,xe.jsx)(Mn,{...e}),{what:"This view"});function pt(r,e,t){for(let n of e.kinds){let i=t?.[n];for(let a of Rn){let o=p=>(0,xe.jsx)(_n,{schema:e,specs:t,kind:n,view:p}),l=a.slot!==void 0&&i?.[a.slot]!==void 0;l&&(o.says=(p,s)=>be.current?.frameworkViews(e,t).lookup(n,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(p,s)),r.register(n,{cardinality:a.cardinality,fidelity:a.fidelity},l?o:Tr(o))}}return r}function Dn(r,e){return pt(Ar(r),r,e)}var Ie=h(B(),1);var F=h(S(),1),ut=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.YG3BLY67.js","./chunk.GZEZMU2T.js","./chunk.4VJARLJ5.js","./chunk.TL7UGUY4.js","./chunk.5RNB6IC5.js","./chunk.ZITDUHX3.js","./chunk.ETWREHXF.js","./chunk.YZ6UKKEL.js","./chunk.HJCQ6I3S.js","./chunk.XWLGHTH6.js","./chunk.TY6VILZB.js","./chunk.AXMC6XVT.js","./chunk.DUIKIJKC.js","./chunk.73BJYIYS.js","./chunk.OKQ4JXTW.js","./chunk.M5RHVUZ6.js","./chunk.MRUDTYOL.js","./chunk.OUNLAMBA.js","./chunk.HGP3Q7QX.js","./chunk.QSZLY62B.js","./chunk.7VX6TBNY.js","./chunk.64TFAR5Z.js","./chunk.5DZR46YG.js","./chunk.L5MDUZLQ.js","./chunk.IDQHSAAQ.js","./chunk.CR5MQMOL.js","./chunk.JJP5OL5E.js","./chunk.WVUJXDXZ.js","./chunk.6SHF6IL5.js","./chunk.MQISKON2.js","./chunk.GQX57JIE.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.GZHZLJBF.js","./chunk.JLR74UFP.js","./chunk.OJGHDWI6.js","./chunk.HG34MT7C.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.YAS6LXQ7.js"))));function Fn({lens:r,view:e}){let t=ut.current.declaredLensView(r);return(0,F.jsx)(t,{...e})}var Vn=ut.part((r,e)=>(0,F.jsx)(Fn,{...e}),{what:"This picture"});function In(r){let e=n=>(0,F.jsx)(Ie.Suspense,{fallback:null,children:(0,F.jsx)(Vn,{lens:r,view:n})});r.lens==="blocks"&&(e.flows=!0);let t=r.lens==="blocks"?r.options.blocks?.[0]:void 0;return typeof t?.headline=="string"&&(e.lede=t),r.create===!1&&(e.creates=!1),e}var gt=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.5RNB6IC5.js","./chunk.ZITDUHX3.js","./chunk.ETWREHXF.js","./chunk.YZ6UKKEL.js","./chunk.DUIKIJKC.js","./chunk.73BJYIYS.js","./chunk.OKQ4JXTW.js","./chunk.M5RHVUZ6.js","./chunk.MRUDTYOL.js","./chunk.HGP3Q7QX.js","./chunk.QSZLY62B.js","./chunk.7VX6TBNY.js","./chunk.WVUJXDXZ.js","./chunk.6SHF6IL5.js","./chunk.MQISKON2.js","./chunk.GQX57JIE.js","./chunk.LJXAZ5TF.js","./chunk.QFI4L2HK.js","./chunk.KFHXTHIY.js","./chunk.GZHZLJBF.js","./chunk.JLR74UFP.js","./chunk.OJGHDWI6.js","./chunk.HG34MT7C.js","./chunk.TT6QBWRA.js","./chunk.UCS3CBT4.js","./chunk.O6SKKF4V.js","./chunk.ZK446PSX.js","./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.THTHNY4N.js"))));function Wn({blocks:r,view:e}){let t=gt.current.homeView(r);return(0,F.jsx)(t,{...e})}var Kn=gt.part((r,e)=>(0,F.jsx)(Wn,{...e}),{what:"The home"});function Gn(r){let e=t=>(0,F.jsx)(Ie.Suspense,{fallback:null,children:(0,F.jsx)(Kn,{blocks:r,view:t})});return Object.defineProperty(e,Symbol.for("graview.home-blocks"),{value:!0}),e}function zn(r,e){return e.home&&e.home.length>0&&r.home?.(Gn(e.home)),ft(r,e),r.arrange?.(e.pages),r}function ft(r,e,t){for(let n of vr(e).drawn){if(t&&r.places().some(o=>o.title===n.title))continue;let i=In(n),a={title:n.title,lens:n.lens,...n.across?{across:n.across}:{},...t?{beside:t}:{},...n.hidden?{hidden:!0}:{},over:n.kinds,...t?{}:{declared:!0}};for(let o of n.kinds)r.register(o,{cardinality:"many",fidelity:"full"},i,a),r.register(o,{cardinality:"many",fidelity:"summary"},i,a)}}function qn(r,e,t){t.length>0&&ft(r,{schema:e,lenses:t.map(({lens:n,...i})=>({...i,name:n}))},!0)}function jn(r,e,t){qn(r,e,De(t))}var z=h(B(),1),ke=h(S(),1);var We=r=>`graview:first-look:${r}`;function Yn(r,e){if(r.seen!==void 0)try{return typeof r.seen=="function"?r.seen():r.seen}catch{return!0}try{return window.localStorage.getItem(We(e))!==null}catch{return!1}}function Un(r,e){if(r.seen===void 0)try{window.localStorage.setItem(We(e),"seen")}catch{}}var Qn=M(R(()=>(__graviewPreload(import.meta.url,["./chunk.SGMVLKZO.js","./chunk.SDO3U72B.js","./chunk.BLS2G3CD.js","./chunk.EJUZGIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.SWLDDQJS.js")))),Xn=Qn.part((r,e)=>{let t=r.FirstLookHints;return(0,ke.jsx)(t,{...e})},{quiet:!0});function Zn({firstLook:r,root:e,app:t}){let n=(0,z.useRef)(null);n.current=r===!0?{}:r||null;let[i,a]=(0,z.useState)(()=>n.current!==null&&typeof window<"u"&&!Yn(n.current,t)),o=(0,z.useCallback)(l=>{if(a(!1),l===null)return;let p=n.current??{};Un(p,t),p.onDone?.(l)},[t]);return!i||n.current===null?null:(0,ke.jsx)(z.Suspense,{fallback:null,children:(0,ke.jsx)(Xn,{root:e,steps:n.current.steps??[],onEnd:o})})}export{Nt as a,Ht as b,me as c,Mt as d,ta as e,Dr as f,na as g,Be as h,Xt as i,Kr as j,Wt as k,Kt as l,ve as m,Gt as n,qt as o,jt as p,Yt as q,C as r,rn as s,tn as t,Xr as u,nn as v,re as w,on as x,xn as y,$n as z,On as A,hn as B,bn as C,De as D,Hn as E,dt as F,ct as G,Bn as H,zn as I,qn as J,jn as K,Cn as L,Dn as M,Zn as N};
347
347
  /*! Bundled license information:
348
348
 
349
349
  react-dom/cjs/react-dom.production.js:
@@ -1 +1 @@
1
- import{a as D}from"./chunk.PXQVXBNG.js";import{a as L,f as P,g as N,h as R}from"./chunk.G446PWV6.js";import{_c as E}from"./chunk.4TJOS4C7.js";var z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),T=e=>e?._zod?.def;function W(e){let n=T(e);for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)n=T(n.innerType);return n}function K(e){if(e?.type==="boolean")return["true","false"];if(e?.type==="enum")return(e.entries?Object.values(e.entries):e.values??[]).filter(n=>typeof n=="string")}var v=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/^./,n=>n.toUpperCase());function J(e,n,i){let a=e.tryDefinition(n);if(!a)return[];let c=new Set(a.display?.hide??[]),r=[];for(let[s,l]of Object.entries(a.fields.shape??{})){if(s==="id"||s==="kind"||s==="label"||c.has(s))continue;let o=W(l);if(o?.type==="array"||o?.type==="object"||o?.type==="record")continue;let u=K(o);r.push({key:s,label:v(s),...u?{options:u}:{}})}let y=new Map;for(let[s,l]of Object.entries(a.edges??{}))y.set(s,l.to==="*"?[]:[...l.to]);for(let s of e.definitions)if(s.kind!==n)for(let[l,o]of Object.entries(s.edges??{}))!y.has(l)&&(o.to==="*"||o.to.includes(n))&&y.set(l,[s.kind]);let g=[];for(let[s,l]of y){r.push({key:s,label:v(s)});let o=i&&l.length===1&&l[0]!==n?e.tryDefinition(l[0]):void 0;for(let[u,f]of Object.entries(o?.fields.shape??{})){let p=W(f);p?.type==="enum"&&!o?.display?.hide?.includes(u)&&g.push({key:`${s}.${u}`,label:`${v(s)} \xB7 ${v(u)}`,options:K(p)})}}return r.push(...g),r.push({key:"is",label:"Is",options:a.lifecycle?["current","past","any","flagged","clear"]:["flagged","clear"]}),r}var I=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function G(e,n,i,a={}){if(i==null)return{ok:!0};if(!z(i))return{ok:!1,says:'A filter is an object of a field and the value it keeps, like { where: { stage: "building" } }.'};let c=Object.entries(i);if(c.length===0)return{ok:!0};let r=[];for(let l of n)for(let o of J(e,l,a.through===!0))r.some(u=>u.key===o.key)||r.push(o);let y=n[0]?e.tryDefinition(n[0]):void 0,g=y?y.plural??`${v(y.kind)}s`:"These",s=[];for(let[l,o]of c){let u=r.find(p=>p.key===l);if(!u)return{ok:!1,says:`${g.replace(/^./,p=>p.toUpperCase())} have no field "${l}" to filter by${r.length>0?`; they filter by ${I(r.map(p=>p.key))}`:""}.`};if(typeof o!="string"&&typeof o!="number"&&typeof o!="boolean")return{ok:!1,says:`The filter on "${l}" is ${Array.isArray(o)?"a list":o===null?"null":`a ${typeof o}`}; it keeps one value: a word, a number, or true or false.`};let f=String(o);if(f.trim().length===0)return{ok:!1,says:`The filter on "${l}" keeps nothing; give it a value, or leave "${l}" out.`};if(f.includes(","))return{ok:!1,says:`The filter on "${l}" holds a comma, which an address reads as a second filter; keep one value.`};if(u.options&&u.options.length>0&&!u.options.includes(f))return{ok:!1,says:`${u.label} has no choice "${f}"; its choices are ${I(u.options.map(p=>`"${p}"`))}.`};s.push(`${l}:${f}`)}return{ok:!0,filter:s.join(",")}}var C=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function q(e,n){let i=e.find(r=>r.as===n);if(i)return i;let a=n.trim().toLowerCase(),c=C(n);return e.find(r=>r.title!==void 0&&r.title.trim().toLowerCase()===a)??(c?e.find(r=>r.as===c||r.title!==void 0&&C(r.title)===c):void 0)}function Z(e){let n=[];for(let i of e){if(typeof i!="object"||i===null)continue;let{as:a,slug:c,title:r,kind:y}=i,g=typeof a=="string"&&a.length>0?a:typeof c=="string"&&c.length>0?c:void 0;!g||n.some(s=>s.as===g)||n.push({as:g,title:typeof r=="string"?r:g,kind:typeof y=="string"?y:""})}return n}var F=e=>` Its places: ${e.map(n=>typeof n=="string"?`"${n}"`:n.title&&n.title!==n.as?`"${n.as}" (${n.title})`:`"${n.as}"`).join(", ")||"none"}.`;var b=e=>`"${e.length>80?`${e.slice(0,79)}\u2026`:e}"`,O=(e,n)=>`${"place"in e?`The place ${b(e.place)}`:`${b(e.record)} is no record this viewer may see and`} is no place of this app: it goes nowhere.${F(n)}`;function S(e){let n={};for(let i of e.split(",")){let a=i.indexOf(":");a>0&&(n[i.slice(0,a).trim()]=i.slice(a+1).trim())}return n}function ne(e,n=new Set){return e.kinds.filter(i=>!n.has(i)).map(i=>({slug:E(e,i).slice(1),kind:i}))}function U(e,n){let i=[...new Set(n.places.map(f=>f.as))],a=n.lists.map(f=>f.slug).filter(f=>!i.includes(f)),c;if(e.section!==void 0&&e.section!==null){if(typeof e.section!="string"||D(e.section).length===0||e.section.length>120)return{ok:!1,says:`The section ${typeof e.section=="string"?b(e.section):"asked for"} names nothing on a page: a section is a heading's words or an element's id, like "shipping-soon". It goes nowhere.`};c=e.section}let r=c!==void 0?{section:c}:{};if("record"in e&&n.sees(e.record))return e.where!==void 0&&e.where!==null?{ok:!1,says:`${b(e.record)} is one record, and a filter narrows a list or a place: it goes nowhere. Go to { place, where } for a list narrowed.`}:{ok:!0,arrival:{record:e.record,...r}};let y="place"in e?e.place:e.record,g=q(n.places,y),s=g?void 0:n.lists.find(f=>f.slug===y||f.kind===y);if(!g&&!s)return{ok:!1,says:`${O(e,n.places.filter((f,p,m)=>m.findIndex(t=>t.as===f.as)===p))}${_(a)}`};let l=g?[g.kind]:[s.kind],o;if(e.where!==void 0&&e.where!==null){if(!n.schema)return{ok:!1,says:`The place ${b(y)} cannot be narrowed here: it goes nowhere.`};let f=G(n.schema,l,e.where,{through:s!==void 0});if(!f.ok)return{ok:!1,says:`The filter on ${b(y)} goes nowhere: ${f.says}`};o=f.filter}let u=o?{filter:o}:{};return{ok:!0,arrival:g?{place:g.as,...u,...r}:{list:s.kind,...u,...r}}}var _=e=>e.length===0?"":` Its lists: ${e.slice(0,8).map(n=>`"${n}"`).join(", ")}${e.length>8?` and ${e.length-8} more`:""}.`,M="http://www.w3.org/1999/xhtml",V=e=>{let n=e;return n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||e.type==="click"&&typeof n.button=="number"&&n.button!==0};function re(e){let n=new WeakSet,i=new WeakSet,a=new WeakMap,c=new WeakMap,r=t=>U(t,{sees:e.sees,places:e.places(),lists:e.lists?.()??[],...e.schema?{schema:e.schema}:{}}),y=t=>{let d=r(t);return d.ok?e.onNavigate?.(d.arrival):e.onLost?.(d.says),d.ok},g=t=>{let d=t.getAttribute("data-record"),h=t.getAttribute("data-place"),k=t.getAttribute("data-filter"),w=t.getAttribute("data-section"),$={...k?{where:S(k)}:{},...w?{section:w}:{}};if(d)return{record:d,...$};if(h)return{place:h,...$}},s=t=>{if(!e.hrefOf)return;let d=g(t),h=d?r(d):void 0;return h?.ok?e.hrefOf(h.arrival):void 0},l=t=>t.hasAttribute("tabindex")?!1:(t.setAttribute("tabindex","0"),n.add(t),!0),o=t=>{n.delete(t)&&t.removeAttribute("tabindex")},u=t=>{i.delete(t)&&t.getAttribute("role")==="link"&&t.removeAttribute("role")},f=t=>{let d=a.get(t);d&&(a.delete(t),t.getAttribute("href")===d.href&&t.removeAttribute("href"),d.target!==null&&!t.hasAttribute("target")&&t.setAttribute("target",d.target))},p=t=>{let d=c.get(t);d&&(c.delete(t),o(d))},m={link(t){if(!N(t,[...t.querySelectorAll("input, select, textarea")].some(L))){if(!t.hasAttribute("data-graview-link"))return;t.removeAttribute("data-graview-link"),u(t),o(t),f(t),p(t);return}t.hasAttribute("data-graview-link")||t.setAttribute("data-graview-link","");let h=t.localName==="a"&&t.namespaceURI===M,k=t.getAttribute("href"),w=a.get(t),$=k!==null&&w?.href!==k,A=h&&!$?s(t):void 0;if(A!==void 0){k!==A&&t.setAttribute("href",A),a.set(t,{href:A,target:w?w.target:t.getAttribute("target")}),t.removeAttribute("target"),u(t),o(t);return}if($?a.delete(t):f(t),!t.hasAttribute("role")&&(h||P(t))&&(t.setAttribute("role","link"),i.add(t)),t.localName==="tr"&&t.namespaceURI===M){o(t);let x=[...t.children].find(j=>j.localName==="td"||j.localName==="th");c.get(t)!==x&&p(t),x&&!c.has(t)&&l(x)&&c.set(t,x);return}t.localName!=="button"&&l(t)},refresh(t){for(let d of t.querySelectorAll("[data-record], [data-place], [data-graview-link]"))m.link(d)},pressed(t,d,h){if(t.type!=="click"&&!(t.type==="keydown"&&t.key==="Enter"))return!1;let k=R(d,h,w=>w.hasAttribute("data-graview-link"));return k?(t.stopPropagation(),a.has(k)&&V(t)||(t.preventDefault(),m.follow(k)),!0):!1},follow(t){let d=g(t);d&&y(d)},go:y};return m}export{Z as a,F as b,b as c,O as d,S as e,ne as f,U as g,re as h};
1
+ import{a as D}from"./chunk.PXQVXBNG.js";import{a as L,f as P,g as N,h as R}from"./chunk.G446PWV6.js";import{id as E}from"./chunk.BLS2G3CD.js";var z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),T=e=>e?._zod?.def;function W(e){let n=T(e);for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)n=T(n.innerType);return n}function K(e){if(e?.type==="boolean")return["true","false"];if(e?.type==="enum")return(e.entries?Object.values(e.entries):e.values??[]).filter(n=>typeof n=="string")}var v=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/^./,n=>n.toUpperCase());function J(e,n,i){let a=e.tryDefinition(n);if(!a)return[];let c=new Set(a.display?.hide??[]),r=[];for(let[s,l]of Object.entries(a.fields.shape??{})){if(s==="id"||s==="kind"||s==="label"||c.has(s))continue;let o=W(l);if(o?.type==="array"||o?.type==="object"||o?.type==="record")continue;let u=K(o);r.push({key:s,label:v(s),...u?{options:u}:{}})}let y=new Map;for(let[s,l]of Object.entries(a.edges??{}))y.set(s,l.to==="*"?[]:[...l.to]);for(let s of e.definitions)if(s.kind!==n)for(let[l,o]of Object.entries(s.edges??{}))!y.has(l)&&(o.to==="*"||o.to.includes(n))&&y.set(l,[s.kind]);let g=[];for(let[s,l]of y){r.push({key:s,label:v(s)});let o=i&&l.length===1&&l[0]!==n?e.tryDefinition(l[0]):void 0;for(let[u,f]of Object.entries(o?.fields.shape??{})){let p=W(f);p?.type==="enum"&&!o?.display?.hide?.includes(u)&&g.push({key:`${s}.${u}`,label:`${v(s)} \xB7 ${v(u)}`,options:K(p)})}}return r.push(...g),r.push({key:"is",label:"Is",options:a.lifecycle?["current","past","any","flagged","clear"]:["flagged","clear"]}),r}var I=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function G(e,n,i,a={}){if(i==null)return{ok:!0};if(!z(i))return{ok:!1,says:'A filter is an object of a field and the value it keeps, like { where: { stage: "building" } }.'};let c=Object.entries(i);if(c.length===0)return{ok:!0};let r=[];for(let l of n)for(let o of J(e,l,a.through===!0))r.some(u=>u.key===o.key)||r.push(o);let y=n[0]?e.tryDefinition(n[0]):void 0,g=y?y.plural??`${v(y.kind)}s`:"These",s=[];for(let[l,o]of c){let u=r.find(p=>p.key===l);if(!u)return{ok:!1,says:`${g.replace(/^./,p=>p.toUpperCase())} have no field "${l}" to filter by${r.length>0?`; they filter by ${I(r.map(p=>p.key))}`:""}.`};if(typeof o!="string"&&typeof o!="number"&&typeof o!="boolean")return{ok:!1,says:`The filter on "${l}" is ${Array.isArray(o)?"a list":o===null?"null":`a ${typeof o}`}; it keeps one value: a word, a number, or true or false.`};let f=String(o);if(f.trim().length===0)return{ok:!1,says:`The filter on "${l}" keeps nothing; give it a value, or leave "${l}" out.`};if(f.includes(","))return{ok:!1,says:`The filter on "${l}" holds a comma, which an address reads as a second filter; keep one value.`};if(u.options&&u.options.length>0&&!u.options.includes(f))return{ok:!1,says:`${u.label} has no choice "${f}"; its choices are ${I(u.options.map(p=>`"${p}"`))}.`};s.push(`${l}:${f}`)}return{ok:!0,filter:s.join(",")}}var C=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function q(e,n){let i=e.find(r=>r.as===n);if(i)return i;let a=n.trim().toLowerCase(),c=C(n);return e.find(r=>r.title!==void 0&&r.title.trim().toLowerCase()===a)??(c?e.find(r=>r.as===c||r.title!==void 0&&C(r.title)===c):void 0)}function Z(e){let n=[];for(let i of e){if(typeof i!="object"||i===null)continue;let{as:a,slug:c,title:r,kind:y}=i,g=typeof a=="string"&&a.length>0?a:typeof c=="string"&&c.length>0?c:void 0;!g||n.some(s=>s.as===g)||n.push({as:g,title:typeof r=="string"?r:g,kind:typeof y=="string"?y:""})}return n}var F=e=>` Its places: ${e.map(n=>typeof n=="string"?`"${n}"`:n.title&&n.title!==n.as?`"${n.as}" (${n.title})`:`"${n.as}"`).join(", ")||"none"}.`;var b=e=>`"${e.length>80?`${e.slice(0,79)}\u2026`:e}"`,O=(e,n)=>`${"place"in e?`The place ${b(e.place)}`:`${b(e.record)} is no record this viewer may see and`} is no place of this app: it goes nowhere.${F(n)}`;function S(e){let n={};for(let i of e.split(",")){let a=i.indexOf(":");a>0&&(n[i.slice(0,a).trim()]=i.slice(a+1).trim())}return n}function ne(e,n=new Set){return e.kinds.filter(i=>!n.has(i)).map(i=>({slug:E(e,i).slice(1),kind:i}))}function U(e,n){let i=[...new Set(n.places.map(f=>f.as))],a=n.lists.map(f=>f.slug).filter(f=>!i.includes(f)),c;if(e.section!==void 0&&e.section!==null){if(typeof e.section!="string"||D(e.section).length===0||e.section.length>120)return{ok:!1,says:`The section ${typeof e.section=="string"?b(e.section):"asked for"} names nothing on a page: a section is a heading's words or an element's id, like "shipping-soon". It goes nowhere.`};c=e.section}let r=c!==void 0?{section:c}:{};if("record"in e&&n.sees(e.record))return e.where!==void 0&&e.where!==null?{ok:!1,says:`${b(e.record)} is one record, and a filter narrows a list or a place: it goes nowhere. Go to { place, where } for a list narrowed.`}:{ok:!0,arrival:{record:e.record,...r}};let y="place"in e?e.place:e.record,g=q(n.places,y),s=g?void 0:n.lists.find(f=>f.slug===y||f.kind===y);if(!g&&!s)return{ok:!1,says:`${O(e,n.places.filter((f,p,m)=>m.findIndex(t=>t.as===f.as)===p))}${_(a)}`};let l=g?[g.kind]:[s.kind],o;if(e.where!==void 0&&e.where!==null){if(!n.schema)return{ok:!1,says:`The place ${b(y)} cannot be narrowed here: it goes nowhere.`};let f=G(n.schema,l,e.where,{through:s!==void 0});if(!f.ok)return{ok:!1,says:`The filter on ${b(y)} goes nowhere: ${f.says}`};o=f.filter}let u=o?{filter:o}:{};return{ok:!0,arrival:g?{place:g.as,...u,...r}:{list:s.kind,...u,...r}}}var _=e=>e.length===0?"":` Its lists: ${e.slice(0,8).map(n=>`"${n}"`).join(", ")}${e.length>8?` and ${e.length-8} more`:""}.`,M="http://www.w3.org/1999/xhtml",V=e=>{let n=e;return n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||e.type==="click"&&typeof n.button=="number"&&n.button!==0};function re(e){let n=new WeakSet,i=new WeakSet,a=new WeakMap,c=new WeakMap,r=t=>U(t,{sees:e.sees,places:e.places(),lists:e.lists?.()??[],...e.schema?{schema:e.schema}:{}}),y=t=>{let d=r(t);return d.ok?e.onNavigate?.(d.arrival):e.onLost?.(d.says),d.ok},g=t=>{let d=t.getAttribute("data-record"),h=t.getAttribute("data-place"),k=t.getAttribute("data-filter"),w=t.getAttribute("data-section"),$={...k?{where:S(k)}:{},...w?{section:w}:{}};if(d)return{record:d,...$};if(h)return{place:h,...$}},s=t=>{if(!e.hrefOf)return;let d=g(t),h=d?r(d):void 0;return h?.ok?e.hrefOf(h.arrival):void 0},l=t=>t.hasAttribute("tabindex")?!1:(t.setAttribute("tabindex","0"),n.add(t),!0),o=t=>{n.delete(t)&&t.removeAttribute("tabindex")},u=t=>{i.delete(t)&&t.getAttribute("role")==="link"&&t.removeAttribute("role")},f=t=>{let d=a.get(t);d&&(a.delete(t),t.getAttribute("href")===d.href&&t.removeAttribute("href"),d.target!==null&&!t.hasAttribute("target")&&t.setAttribute("target",d.target))},p=t=>{let d=c.get(t);d&&(c.delete(t),o(d))},m={link(t){if(!N(t,[...t.querySelectorAll("input, select, textarea")].some(L))){if(!t.hasAttribute("data-graview-link"))return;t.removeAttribute("data-graview-link"),u(t),o(t),f(t),p(t);return}t.hasAttribute("data-graview-link")||t.setAttribute("data-graview-link","");let h=t.localName==="a"&&t.namespaceURI===M,k=t.getAttribute("href"),w=a.get(t),$=k!==null&&w?.href!==k,A=h&&!$?s(t):void 0;if(A!==void 0){k!==A&&t.setAttribute("href",A),a.set(t,{href:A,target:w?w.target:t.getAttribute("target")}),t.removeAttribute("target"),u(t),o(t);return}if($?a.delete(t):f(t),!t.hasAttribute("role")&&(h||P(t))&&(t.setAttribute("role","link"),i.add(t)),t.localName==="tr"&&t.namespaceURI===M){o(t);let x=[...t.children].find(j=>j.localName==="td"||j.localName==="th");c.get(t)!==x&&p(t),x&&!c.has(t)&&l(x)&&c.set(t,x);return}t.localName!=="button"&&l(t)},refresh(t){for(let d of t.querySelectorAll("[data-record], [data-place], [data-graview-link]"))m.link(d)},pressed(t,d,h){if(t.type!=="click"&&!(t.type==="keydown"&&t.key==="Enter"))return!1;let k=R(d,h,w=>w.hasAttribute("data-graview-link"));return k?(t.stopPropagation(),a.has(k)&&V(t)||(t.preventDefault(),m.follow(k)),!0):!1},follow(t){let d=g(t);d&&y(d)},go:y};return m}export{Z as a,F as b,b as c,O as d,S as e,ne as f,U as g,re as h};
@@ -1,3 +1,3 @@
1
- import{b as te}from"./chunk.KVEDIBXS.js";import"./chunk.N4M54YK6.js";import"./chunk.KVJFY7N5.js";import{c as ne}from"./chunk.DPHTUTOS.js";import{G as ge,R as ee}from"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import{da as X,ga as Z,vc as q}from"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
1
+ import{b as te}from"./chunk.XWLGHTH6.js";import"./chunk.TT6QBWRA.js";import"./chunk.UCS3CBT4.js";import{c as ne}from"./chunk.O6SKKF4V.js";import{G as ge,S as ee}from"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import{Gc as q,da as X,ga as Z}from"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
2
2
  `),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
3
3
  `)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk.BBNF52IB.js";import"./chunk.AXMC6XVT.js";import"./chunk.5DZR46YG.js";import"./chunk.L5MDUZLQ.js";import"./chunk.IDQHSAAQ.js";import"./chunk.CR5MQMOL.js";import"./chunk.6SHF6IL5.js";import"./chunk.MQISKON2.js";import"./chunk.GQX57JIE.js";import"./chunk.LJXAZ5TF.js";import"./chunk.QFI4L2HK.js";import"./chunk.KFHXTHIY.js";import"./chunk.TT6QBWRA.js";import"./chunk.UCS3CBT4.js";import"./chunk.O6SKKF4V.js";import"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
@@ -1 +1 @@
1
- import{q as ce}from"./chunk.NR5ODXMO.js";import{a as Z,b as C,c as ee,d as te,g as oe,j as re,k as P,l as se,p as le,s as de}from"./chunk.OAIWGWGU.js";import{a as ie,b as ne,c as ae}from"./chunk.O45VO36H.js";import"./chunk.UT6642FC.js";import"./chunk.NX7IIZLO.js";import"./chunk.XOZU4OFA.js";import"./chunk.SUPWMV2F.js";import{a as X}from"./chunk.LPD74WBI.js";import"./chunk.TI4OSTQV.js";import"./chunk.NFDLCUCC.js";import"./chunk.N4M54YK6.js";import"./chunk.KVJFY7N5.js";import"./chunk.DPHTUTOS.js";import{e as _,m as J}from"./chunk.2UIUMG23.js";import{G as me,J as U,R as V,_ as j}from"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import{ha as B,xc as Y}from"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import{b as O}from"./chunk.AJZBJBMO.js";var a=O(me(),1);var d=O(V(),1),ke=new Set(["show","go","to","open","the","a","an","me"]),ge=r=>r.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,""),W=(r,p)=>{let s=ge(r);return p.every(t=>s.includes(t))},pe=r=>r&&!/^.\p{Lu}/u.test(r)?`${r[0].toLowerCase()}${r.slice(1)}`:r,L={act:4,show:3,place:3,record:4},we=360,h=12;function Oe({face:r,opening:p,close:s}){let t=X(),{setMenuAt:v}=j(),n=(0,a.useMemo)(()=>p.target??Z(p.pointed??{about:[]},e=>t.store.graph.has(e)),[p,t.store]),f=(0,a.useMemo)(()=>oe(t.store,n,t.places),[t.store,n,t.places]),[u,y]=(0,a.useState)(""),[b,m]=(0,a.useState)(-1),[l,$]=(0,a.useState)(null),[A,I]=(0,a.useState)(null),E=(0,a.useRef)(null),z=(0,a.useRef)(null),T=(0,a.useId)(),R=(0,a.useRef)(!0),{ghost:G}=U(t.desk);(0,a.useEffect)(()=>()=>{R.current=!1;let e=t.desk.get().ghost;e?.onCard&&t.desk.setGhost({...e,onCard:!1})},[t.desk]);let M=(0,a.useMemo)(()=>{let e=P(t,n);return ee(t.store,n,{principal:t.principal,places:t.places,...e.acts?{acts:e.acts}:{}})},[t,n]),K=(0,a.useMemo)(()=>{let e=C(n);if(e.length===0)return[];let i=new Set(M.candidates.flatMap(c=>c.type==="act"?[c.mutation]:[]));return ie(t.store,e,{principal:t.principal,...e.length===1?{focus:e[0]}:{}}).affordances.filter(c=>!c.destructive&&i.has(c.mutation))},[t.store,t.principal,n,M]),q=(0,a.useCallback)(()=>{let e=p.returnTo,i=ue(E.current,n,r);s(),requestAnimationFrame(()=>{if(e?.isConnected&&!e.closest("[inert]"))return e.focus({preventScroll:!0});let c=(i&&i.tabIndex>=0?i:null)??document.querySelector("[data-graview-page-title]")??document.querySelector("main");c&&c.tabIndex<0&&!c.hasAttribute("tabindex")&&c.setAttribute("tabindex","-1"),c?.focus({preventScroll:!0})})},[p.returnTo,n,r,s]),F=(0,a.useCallback)(e=>{if(e.open.length>0){let i=E.current?.getBoundingClientRect();s(),v({x:i?.left??0,y:i?.top??0,on:e.args.id??C(n)[0],about:C(n)});return}try{ae(t.store,e,{},{pressed:t.principal?{author:t.principal}:{}}),ne(t.store,e,{},{author:t.principal}),q()}catch(i){I(i instanceof Error?i.message:String(i))}},[t.store,t.principal,s,q,v,n]),H=(0,a.useCallback)(async e=>{let i=e.trim();if(!i)return;let c=l?.result?.answer?{said:l.said,answer:l.result.answer}:void 0;y(""),m(-1),I(null),$({said:i,result:null});let S=await re(t.ai,{...P(t,n,i),said:i,...c?{follows:c}:{}});t.desk.record(S.interaction),S.ghost&&S.ghost.proposals.length>0&&t.desk.setGhost({ghost:S.ghost,onCard:!0}),R.current&&$({said:i,result:S})},[l,t,n]),N=(0,a.useRef)(p.asked);(0,a.useEffect)(()=>{let e=N.current;N.current=void 0,e&&H(e)},[]);let k=(0,a.useMemo)(()=>{let e=u.trim();if(!e&&l)return[];let i=ge(e).split(/\s+/).filter(o=>o&&!ke.has(o)),c=/^show\b/i.test(e),S=/^(go|open)\b/i.test(e),x=[];if(!c&&!S)for(let o of K.filter(g=>W(g.label,i)).slice(0,L.act))x.push({id:`act:${o.id}`,kind:"act",label:o.label,hint:o.open.length>0?"asks more":"do it",take:()=>F(o)});let Q=e&&!/\?\s*$/.test(e)?te(t.store,n,{principal:t.principal,places:t.places,said:e}):[];for(let o of Q)x.push({id:`place:${o.place}`,kind:"place",label:o.fit==="full"?`Open ${o.title}`:`Open and adjust ${o.title}`,hint:o.fit==="full"?"a view you have":"adjust it",take:()=>{s(),t.goTo.place(o.place),o.fit==="partial"&&_(t.desk,{target:{on:"lens",place:o.place,...o.kind?{kind:o.kind}:{}},asked:e})}});if(!S){let o=M.candidates.filter(g=>g.type==="panel");for(let g of o.filter(D=>W(`show ${D.label}`,i)).slice(0,L.show))x.push({id:g.id,kind:"show",label:`Show ${pe(g.label)}`,hint:"a panel",take:()=>{s(),se(t,{title:g.label,recipe:{...g.panel,title:g.label}})}})}if(!c){for(let o of t.places.filter(g=>W(g.title,i)&&!Q.some(D=>D.place===g.as)).slice(0,L.place))x.push({id:`place:${o.as}`,kind:"place",label:`Go to ${o.title}`,take:()=>(s(),t.goTo.place(o.as))});if(i.length>0){let o=ce(t.store,e.replace(/^(go to|open)\s+/i,""),{principal:t.principal,from:C(n),limit:L.record}).hits;for(let g of o)g.about==="node"&&x.push({id:`record:${g.id}`,kind:"record",label:g.label,hint:B(t.store.schema,g.kind),take:()=>(s(),t.goTo.record(g.id))})}}return e&&x.push({id:"ask",kind:"ask",label:e,take:()=>void H(e)}),x},[u,K,M,t,n,F,H,s,l]);(0,a.useEffect)(()=>m(u.trim()?0:-1),[u]),(0,a.useLayoutEffect)(()=>{let e=E.current;if(!e)return;if(typeof e.showPopover=="function")try{e.showPopover()}catch{}z.current?.focus({preventScroll:!0});let i=0,c=()=>{be(e,ue(e,n,r)),i=requestAnimationFrame(c)};return c(),()=>cancelAnimationFrame(i)},[n,r]),(0,a.useEffect)(()=>{if(l)return;let e=i=>{i.target instanceof Node&&E.current?.contains(i.target)||s()};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[l,s]);let fe=e=>{if(e.key==="ArrowDown"&&k.length>0)e.preventDefault(),m(i=>Math.min(k.length-1,i+1));else if(e.key==="ArrowUp"&&k.length>0)e.preventDefault(),m(i=>Math.max(0,i-1));else if(e.key==="Enter"){e.preventDefault();let i=k[b];i?i.take():u.trim()&&H(u)}},w=l?.result??null,he=k[b];return(0,d.jsxs)("section",{ref:E,popover:"manual",role:"region","aria-label":l?`Answer about ${f}`:`Ask about ${f}`,"data-testid":"quick-ask","data-quick-ask":l?"answer":"bar","data-quick-ask-face":r,"data-graview-offstage":"","data-graview-overlay":"",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),q())},onMouseDown:e=>e.stopPropagation(),style:ve,children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,d.jsxs)("p",{"data-testid":"quick-ask-about",style:{margin:0,flex:"1 1 auto",minWidth:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},children:["About ",f]}),(0,d.jsx)("button",{type:"button","data-testid":"quick-ask-close","aria-label":"Close",title:"Close",onClick:q,style:ye,children:(0,d.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]}),l?(0,d.jsxs)("div",{"data-testid":"quick-answer",style:{display:"grid",gap:8},children:[(0,d.jsxs)("p",{"data-testid":"quick-answer-asked",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",fontStyle:"italic",overflowWrap:"anywhere"},children:["\u201C",l.said,"\u201D"]}),(0,d.jsx)("p",{"data-testid":"quick-answer-text","aria-live":"polite",style:{margin:0,fontSize:"0.9375rem",lineHeight:1.45,color:w?.interaction.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)",overflowWrap:"anywhere"},children:w===null?"Thinking\u2026":w.interaction.outcome==="failed"?w.interaction.failed??"The AI could not answer that here.":w.answer??""}),w&&w.offers.length>0?(0,d.jsx)("ul",{"aria-label":"What acts on it",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:6},children:w.offers.map(e=>(0,d.jsx)("li",{children:(0,d.jsx)("button",{type:"button","data-testid":"quick-answer-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>{le(t,w,e,s).then(i=>{i&&R.current&&I(i)})},style:xe,children:e.type==="panel"?`Show ${pe(e.label)}`:e.type==="place"?`Go to ${e.label}`:e.label})},e.id))}):null,G?.onCard&&G.ghost.interaction===w?.interaction.id?(0,d.jsx)(de,{placement:"card"}):null]}):null,(0,d.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,d.jsx)("input",{ref:z,type:"text",role:"combobox","data-testid":"quick-ask-input","aria-label":l?`Ask a follow-up about ${f}`:`Ask about ${f}, or go somewhere`,"aria-expanded":k.length>0,"aria-controls":T,"aria-autocomplete":"list",...he?{"aria-activedescendant":`${T}-${b}`}:{},autoComplete:"off",enterKeyHint:"go",placeholder:l?"Ask a follow-up\u2026":"Ask, or go to\u2026",value:u,readOnly:l!==null&&w===null,"aria-busy":l!==null&&w===null,onChange:e=>y(e.target.value),onKeyDown:fe,style:Ae}),(0,d.jsx)("div",{id:T,role:"listbox","aria-label":u.trim()?`What \u201C${u.trim()}\u201D finds here`:"What can be done here",hidden:k.length===0,style:{display:k.length===0?"none":"grid",gap:1,maxHeight:280,overflowY:"auto"},children:k.map((e,i)=>(0,d.jsx)("div",{id:`${T}-${i}`,role:"option","aria-selected":i===b,"data-testid":"quick-ask-option","data-quick-ask-kind":e.kind,"data-quick-ask-row":e.id,onMouseEnter:()=>m(i),onMouseDown:c=>c.preventDefault(),onClick:e.take,style:{...Se,background:i===b?"var(--graview-panel-muted)":"transparent",...e.kind==="ask"?{borderTop:"1px solid var(--graview-edge)",marginTop:2}:{}},children:e.kind==="ask"?(0,d.jsxs)("span",{children:["Ask: ",(0,d.jsxs)("span",{style:{fontWeight:600},children:["\u2018",e.label,"\u2019"]})]}):(0,d.jsxs)("span",{children:[e.label,e.hint?(0,d.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.hint]}):null]})},e.id))})]}),A?(0,d.jsx)("p",{role:"alert","data-testid":"quick-ask-refused",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-warn)"},children:A}):null,(0,d.jsx)("span",{style:J,"aria-live":"polite",children:k.length>0&&u.trim()?`${k.length} ${k.length===1?"way":"ways"} to go on`:""})]})}function ue(r,p,s){let t=r?.closest("[data-graview-embed]")??document,v=p.on==="list"?[`aggregate:${p.kind}`,`kind:${p.kind}`]:p.on==="lens"&&p.kind?[`aggregate:${p.kind}`]:C(p);for(let n of v)for(let f of t.querySelectorAll(`[data-graview-view="${CSS.escape(n)}"], [data-graview-pick="${CSS.escape(n)}"]`)){if(r?.contains(f))continue;let u=f.getBoundingClientRect();if(u.width>0&&u.height>0)return f}return s==="pages"?t.querySelector("main [data-graview-page-title]")??t.querySelector("main h1"):null}function be(r,p){let s={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(we,s.width-2*h),v=r.getBoundingClientRect().height,n=p?.getBoundingClientRect(),f,u,y,b=A=>Math.max(h,Math.min(A,s.height-v-h));if(n&&n.width>0&&n.bottom>0&&n.top<s.height)if(n.right+h+t<=s.width-h)f=n.right+h,u=b(n.top),y="right";else if(n.left-h-t>=h)f=n.left-h-t,u=b(n.top),y="left";else{f=Math.max(h,Math.min(n.left,s.width-t-h));let A=n.bottom+h;u=A+v<=s.height-h?A:b(n.top-h-v),y=A+v<=s.height-h?"below":"above"}else f=(s.width-t)/2,u=b(72),y="top";let m=r.style,l={left:`${Math.round(f)}px`,top:`${Math.round(u)}px`,width:`${Math.round(t)}px`};m.left!==l.left&&(m.left=l.left),m.top!==l.top&&(m.top=l.top),m.width!==l.width&&(m.width=l.width);let $=p?.getAttribute("data-graview-view")??p?.getAttribute("data-graview-pick")??(p?"page":"");r.getAttribute("data-quick-ask-beside")!==$&&r.setAttribute("data-quick-ask-beside",$),r.getAttribute("data-quick-ask-side")!==y&&r.setAttribute("data-quick-ask-side",y)}var ve={position:"fixed",inset:"auto",margin:0,zIndex:Y("popover"),boxSizing:"border-box",display:"grid",gap:10,padding:12,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",maxHeight:"calc(100dvh - 24px)",overflowY:"auto",fontSize:"0.875rem"},ye={display:"inline-grid",placeItems:"center",width:28,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,color:"var(--graview-ink-muted)",background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer"},Ae={boxSizing:"border-box",width:"100%",height:36,padding:"0 10px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8},Se={display:"flex",alignItems:"center",minHeight:30,padding:"4px 8px",borderRadius:6,cursor:"pointer",overflowWrap:"anywhere"},xe={display:"inline-flex",alignItems:"center",minHeight:30,padding:"2px 10px",font:"inherit",fontSize:"0.8125rem",borderRadius:8};export{Oe as QuickAskCard};
1
+ import{q as ce}from"./chunk.7VX6TBNY.js";import{a as Z,b as C,c as ee,d as te,g as oe,j as re,k as P,l as se,p as le,s as de}from"./chunk.SJRXBTGP.js";import{a as ie,b as ne,c as ae}from"./chunk.L5MDUZLQ.js";import"./chunk.IDQHSAAQ.js";import"./chunk.Q7RI4SI4.js";import"./chunk.XOZU4OFA.js";import"./chunk.CR5MQMOL.js";import{a as X}from"./chunk.VM43YREJ.js";import"./chunk.TI4OSTQV.js";import"./chunk.MQISKON2.js";import"./chunk.TT6QBWRA.js";import"./chunk.UCS3CBT4.js";import"./chunk.O6SKKF4V.js";import{e as _,m as J}from"./chunk.ZK446PSX.js";import{$ as j,G as me,J as U,S as V}from"./chunk.SGMVLKZO.js";import"./chunk.SDO3U72B.js";import{Ic as Y,ha as B}from"./chunk.BLS2G3CD.js";import"./chunk.EJUZGIQ5.js";import{b as O}from"./chunk.AJZBJBMO.js";var a=O(me(),1);var d=O(V(),1),ke=new Set(["show","go","to","open","the","a","an","me"]),ge=r=>r.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,""),W=(r,p)=>{let s=ge(r);return p.every(t=>s.includes(t))},pe=r=>r&&!/^.\p{Lu}/u.test(r)?`${r[0].toLowerCase()}${r.slice(1)}`:r,L={act:4,show:3,place:3,record:4},we=360,h=12;function Oe({face:r,opening:p,close:s}){let t=X(),{setMenuAt:v}=j(),n=(0,a.useMemo)(()=>p.target??Z(p.pointed??{about:[]},e=>t.store.graph.has(e)),[p,t.store]),f=(0,a.useMemo)(()=>oe(t.store,n,t.places),[t.store,n,t.places]),[u,y]=(0,a.useState)(""),[b,m]=(0,a.useState)(-1),[l,$]=(0,a.useState)(null),[A,I]=(0,a.useState)(null),E=(0,a.useRef)(null),z=(0,a.useRef)(null),T=(0,a.useId)(),R=(0,a.useRef)(!0),{ghost:G}=U(t.desk);(0,a.useEffect)(()=>()=>{R.current=!1;let e=t.desk.get().ghost;e?.onCard&&t.desk.setGhost({...e,onCard:!1})},[t.desk]);let M=(0,a.useMemo)(()=>{let e=P(t,n);return ee(t.store,n,{principal:t.principal,places:t.places,...e.acts?{acts:e.acts}:{}})},[t,n]),K=(0,a.useMemo)(()=>{let e=C(n);if(e.length===0)return[];let i=new Set(M.candidates.flatMap(c=>c.type==="act"?[c.mutation]:[]));return ie(t.store,e,{principal:t.principal,...e.length===1?{focus:e[0]}:{}}).affordances.filter(c=>!c.destructive&&i.has(c.mutation))},[t.store,t.principal,n,M]),q=(0,a.useCallback)(()=>{let e=p.returnTo,i=ue(E.current,n,r);s(),requestAnimationFrame(()=>{if(e?.isConnected&&!e.closest("[inert]"))return e.focus({preventScroll:!0});let c=(i&&i.tabIndex>=0?i:null)??document.querySelector("[data-graview-page-title]")??document.querySelector("main");c&&c.tabIndex<0&&!c.hasAttribute("tabindex")&&c.setAttribute("tabindex","-1"),c?.focus({preventScroll:!0})})},[p.returnTo,n,r,s]),F=(0,a.useCallback)(e=>{if(e.open.length>0){let i=E.current?.getBoundingClientRect();s(),v({x:i?.left??0,y:i?.top??0,on:e.args.id??C(n)[0],about:C(n)});return}try{ae(t.store,e,{},{pressed:t.principal?{author:t.principal}:{}}),ne(t.store,e,{},{author:t.principal}),q()}catch(i){I(i instanceof Error?i.message:String(i))}},[t.store,t.principal,s,q,v,n]),H=(0,a.useCallback)(async e=>{let i=e.trim();if(!i)return;let c=l?.result?.answer?{said:l.said,answer:l.result.answer}:void 0;y(""),m(-1),I(null),$({said:i,result:null});let S=await re(t.ai,{...P(t,n,i),said:i,...c?{follows:c}:{}});t.desk.record(S.interaction),S.ghost&&S.ghost.proposals.length>0&&t.desk.setGhost({ghost:S.ghost,onCard:!0}),R.current&&$({said:i,result:S})},[l,t,n]),N=(0,a.useRef)(p.asked);(0,a.useEffect)(()=>{let e=N.current;N.current=void 0,e&&H(e)},[]);let k=(0,a.useMemo)(()=>{let e=u.trim();if(!e&&l)return[];let i=ge(e).split(/\s+/).filter(o=>o&&!ke.has(o)),c=/^show\b/i.test(e),S=/^(go|open)\b/i.test(e),x=[];if(!c&&!S)for(let o of K.filter(g=>W(g.label,i)).slice(0,L.act))x.push({id:`act:${o.id}`,kind:"act",label:o.label,hint:o.open.length>0?"asks more":"do it",take:()=>F(o)});let Q=e&&!/\?\s*$/.test(e)?te(t.store,n,{principal:t.principal,places:t.places,said:e}):[];for(let o of Q)x.push({id:`place:${o.place}`,kind:"place",label:o.fit==="full"?`Open ${o.title}`:`Open and adjust ${o.title}`,hint:o.fit==="full"?"a view you have":"adjust it",take:()=>{s(),t.goTo.place(o.place),o.fit==="partial"&&_(t.desk,{target:{on:"lens",place:o.place,...o.kind?{kind:o.kind}:{}},asked:e})}});if(!S){let o=M.candidates.filter(g=>g.type==="panel");for(let g of o.filter(D=>W(`show ${D.label}`,i)).slice(0,L.show))x.push({id:g.id,kind:"show",label:`Show ${pe(g.label)}`,hint:"a panel",take:()=>{s(),se(t,{title:g.label,recipe:{...g.panel,title:g.label}})}})}if(!c){for(let o of t.places.filter(g=>W(g.title,i)&&!Q.some(D=>D.place===g.as)).slice(0,L.place))x.push({id:`place:${o.as}`,kind:"place",label:`Go to ${o.title}`,take:()=>(s(),t.goTo.place(o.as))});if(i.length>0){let o=ce(t.store,e.replace(/^(go to|open)\s+/i,""),{principal:t.principal,from:C(n),limit:L.record}).hits;for(let g of o)g.about==="node"&&x.push({id:`record:${g.id}`,kind:"record",label:g.label,hint:B(t.store.schema,g.kind),take:()=>(s(),t.goTo.record(g.id))})}}return e&&x.push({id:"ask",kind:"ask",label:e,take:()=>void H(e)}),x},[u,K,M,t,n,F,H,s,l]);(0,a.useEffect)(()=>m(u.trim()?0:-1),[u]),(0,a.useLayoutEffect)(()=>{let e=E.current;if(!e)return;if(typeof e.showPopover=="function")try{e.showPopover()}catch{}z.current?.focus({preventScroll:!0});let i=0,c=()=>{be(e,ue(e,n,r)),i=requestAnimationFrame(c)};return c(),()=>cancelAnimationFrame(i)},[n,r]),(0,a.useEffect)(()=>{if(l)return;let e=i=>{i.target instanceof Node&&E.current?.contains(i.target)||s()};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[l,s]);let fe=e=>{if(e.key==="ArrowDown"&&k.length>0)e.preventDefault(),m(i=>Math.min(k.length-1,i+1));else if(e.key==="ArrowUp"&&k.length>0)e.preventDefault(),m(i=>Math.max(0,i-1));else if(e.key==="Enter"){e.preventDefault();let i=k[b];i?i.take():u.trim()&&H(u)}},w=l?.result??null,he=k[b];return(0,d.jsxs)("section",{ref:E,popover:"manual",role:"region","aria-label":l?`Answer about ${f}`:`Ask about ${f}`,"data-testid":"quick-ask","data-quick-ask":l?"answer":"bar","data-quick-ask-face":r,"data-graview-offstage":"","data-graview-overlay":"",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),q())},onMouseDown:e=>e.stopPropagation(),style:ve,children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,d.jsxs)("p",{"data-testid":"quick-ask-about",style:{margin:0,flex:"1 1 auto",minWidth:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},children:["About ",f]}),(0,d.jsx)("button",{type:"button","data-testid":"quick-ask-close","aria-label":"Close",title:"Close",onClick:q,style:ye,children:(0,d.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]}),l?(0,d.jsxs)("div",{"data-testid":"quick-answer",style:{display:"grid",gap:8},children:[(0,d.jsxs)("p",{"data-testid":"quick-answer-asked",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",fontStyle:"italic",overflowWrap:"anywhere"},children:["\u201C",l.said,"\u201D"]}),(0,d.jsx)("p",{"data-testid":"quick-answer-text","aria-live":"polite",style:{margin:0,fontSize:"0.9375rem",lineHeight:1.45,color:w?.interaction.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)",overflowWrap:"anywhere"},children:w===null?"Thinking\u2026":w.interaction.outcome==="failed"?w.interaction.failed??"The AI could not answer that here.":w.answer??""}),w&&w.offers.length>0?(0,d.jsx)("ul",{"aria-label":"What acts on it",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:6},children:w.offers.map(e=>(0,d.jsx)("li",{children:(0,d.jsx)("button",{type:"button","data-testid":"quick-answer-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>{le(t,w,e,s).then(i=>{i&&R.current&&I(i)})},style:xe,children:e.type==="panel"?`Show ${pe(e.label)}`:e.type==="place"?`Go to ${e.label}`:e.label})},e.id))}):null,G?.onCard&&G.ghost.interaction===w?.interaction.id?(0,d.jsx)(de,{placement:"card"}):null]}):null,(0,d.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,d.jsx)("input",{ref:z,type:"text",role:"combobox","data-testid":"quick-ask-input","aria-label":l?`Ask a follow-up about ${f}`:`Ask about ${f}, or go somewhere`,"aria-expanded":k.length>0,"aria-controls":T,"aria-autocomplete":"list",...he?{"aria-activedescendant":`${T}-${b}`}:{},autoComplete:"off",enterKeyHint:"go",placeholder:l?"Ask a follow-up\u2026":"Ask, or go to\u2026",value:u,readOnly:l!==null&&w===null,"aria-busy":l!==null&&w===null,onChange:e=>y(e.target.value),onKeyDown:fe,style:Ae}),(0,d.jsx)("div",{id:T,role:"listbox","aria-label":u.trim()?`What \u201C${u.trim()}\u201D finds here`:"What can be done here",hidden:k.length===0,style:{display:k.length===0?"none":"grid",gap:1,maxHeight:280,overflowY:"auto"},children:k.map((e,i)=>(0,d.jsx)("div",{id:`${T}-${i}`,role:"option","aria-selected":i===b,"data-testid":"quick-ask-option","data-quick-ask-kind":e.kind,"data-quick-ask-row":e.id,onMouseEnter:()=>m(i),onMouseDown:c=>c.preventDefault(),onClick:e.take,style:{...Se,background:i===b?"var(--graview-panel-muted)":"transparent",...e.kind==="ask"?{borderTop:"1px solid var(--graview-edge)",marginTop:2}:{}},children:e.kind==="ask"?(0,d.jsxs)("span",{children:["Ask: ",(0,d.jsxs)("span",{style:{fontWeight:600},children:["\u2018",e.label,"\u2019"]})]}):(0,d.jsxs)("span",{children:[e.label,e.hint?(0,d.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.hint]}):null]})},e.id))})]}),A?(0,d.jsx)("p",{role:"alert","data-testid":"quick-ask-refused",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-warn)"},children:A}):null,(0,d.jsx)("span",{style:J,"aria-live":"polite",children:k.length>0&&u.trim()?`${k.length} ${k.length===1?"way":"ways"} to go on`:""})]})}function ue(r,p,s){let t=r?.closest("[data-graview-embed]")??document,v=p.on==="list"?[`aggregate:${p.kind}`,`kind:${p.kind}`]:p.on==="lens"&&p.kind?[`aggregate:${p.kind}`]:C(p);for(let n of v)for(let f of t.querySelectorAll(`[data-graview-view="${CSS.escape(n)}"], [data-graview-pick="${CSS.escape(n)}"]`)){if(r?.contains(f))continue;let u=f.getBoundingClientRect();if(u.width>0&&u.height>0)return f}return s==="pages"?t.querySelector("main [data-graview-page-title]")??t.querySelector("main h1"):null}function be(r,p){let s={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(we,s.width-2*h),v=r.getBoundingClientRect().height,n=p?.getBoundingClientRect(),f,u,y,b=A=>Math.max(h,Math.min(A,s.height-v-h));if(n&&n.width>0&&n.bottom>0&&n.top<s.height)if(n.right+h+t<=s.width-h)f=n.right+h,u=b(n.top),y="right";else if(n.left-h-t>=h)f=n.left-h-t,u=b(n.top),y="left";else{f=Math.max(h,Math.min(n.left,s.width-t-h));let A=n.bottom+h;u=A+v<=s.height-h?A:b(n.top-h-v),y=A+v<=s.height-h?"below":"above"}else f=(s.width-t)/2,u=b(72),y="top";let m=r.style,l={left:`${Math.round(f)}px`,top:`${Math.round(u)}px`,width:`${Math.round(t)}px`};m.left!==l.left&&(m.left=l.left),m.top!==l.top&&(m.top=l.top),m.width!==l.width&&(m.width=l.width);let $=p?.getAttribute("data-graview-view")??p?.getAttribute("data-graview-pick")??(p?"page":"");r.getAttribute("data-quick-ask-beside")!==$&&r.setAttribute("data-quick-ask-beside",$),r.getAttribute("data-quick-ask-side")!==y&&r.setAttribute("data-quick-ask-side",y)}var ve={position:"fixed",inset:"auto",margin:0,zIndex:Y("popover"),boxSizing:"border-box",display:"grid",gap:10,padding:12,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",maxHeight:"calc(100dvh - 24px)",overflowY:"auto",fontSize:"0.875rem"},ye={display:"inline-grid",placeItems:"center",width:28,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,color:"var(--graview-ink-muted)",background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer"},Ae={boxSizing:"border-box",width:"100%",height:36,padding:"0 10px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8},Se={display:"flex",alignItems:"center",minHeight:30,padding:"4px 8px",borderRadius:6,cursor:"pointer",overflowWrap:"anywhere"},xe={display:"inline-flex",alignItems:"center",minHeight:30,padding:"2px 10px",font:"inherit",fontSize:"0.8125rem",borderRadius:8};export{Oe as QuickAskCard};