graview 0.1.42 → 0.1.43

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 (201) hide show
  1. package/dist/preview/chunk.22E4GKYU.js +1 -0
  2. package/dist/preview/chunk.25VAWLKJ.js +1 -0
  3. package/dist/preview/chunk.26SI4K3P.js +35 -0
  4. package/dist/preview/chunk.27QYTMXP.js +1 -0
  5. package/dist/preview/chunk.2AZTW66C.js +1 -0
  6. package/dist/preview/chunk.2JMJTREH.js +1 -0
  7. package/dist/preview/chunk.3B47UX2J.js +2 -0
  8. package/dist/preview/{chunk.37NF3YXZ.js → chunk.3GQL4K3Q.js} +1 -1
  9. package/dist/preview/chunk.3HLNRVFY.js +1 -0
  10. package/dist/preview/chunk.4C65DXZB.js +1 -0
  11. package/dist/preview/{chunk.HQMGTPDC.js → chunk.4HAGPMY6.js} +3 -3
  12. package/dist/preview/{chunk.LQGXUMUX.js → chunk.4IDXQVSW.js} +1 -1
  13. package/dist/preview/{chunk.SUQU4AXG.js → chunk.4P3LS2OE.js} +1 -1
  14. package/dist/preview/{chunk.6HUS5UHZ.js → chunk.4YLBGGWT.js} +1 -1
  15. package/dist/preview/chunk.4ZHUGSJL.js +1 -0
  16. package/dist/preview/{chunk.2ZGICECC.js → chunk.4ZSHTUNK.js} +1 -1
  17. package/dist/preview/chunk.5BJW4IPW.js +1 -0
  18. package/dist/preview/{chunk.L6HKDIZB.js → chunk.5J2HETUO.js} +1 -1
  19. package/dist/preview/{chunk.U3MQUIJL.js → chunk.5TBK44MK.js} +1 -1
  20. package/dist/preview/chunk.63DI7XNE.js +21 -0
  21. package/dist/preview/{chunk.X2M7IOQA.js → chunk.64MP7636.js} +1 -1
  22. package/dist/preview/chunk.6AYTF53S.js +1 -0
  23. package/dist/preview/chunk.6BU3GCHK.js +1 -0
  24. package/dist/preview/{chunk.P6J6VFF5.js → chunk.6IEDQHKI.js} +1 -1
  25. package/dist/preview/chunk.6K4JBLOP.js +1 -0
  26. package/dist/preview/{chunk.KSXB4LDF.js → chunk.6PF5LWRK.js} +1 -1
  27. package/dist/preview/{chunk.27P37343.js → chunk.6ROYIMQ2.js} +1 -1
  28. package/dist/preview/{chunk.QHP7AJUV.js → chunk.6XEATXZC.js} +1 -1
  29. package/dist/preview/chunk.7IXLH7PR.js +1 -0
  30. package/dist/preview/chunk.7L6LYXCV.js +25 -0
  31. package/dist/preview/chunk.7MQ7UWVW.js +5 -0
  32. package/dist/preview/{chunk.7EB6SDUQ.js → chunk.7MXQRSNR.js} +1 -1
  33. package/dist/preview/{chunk.5NDYYTT4.js → chunk.7ROWZZN5.js} +1 -1
  34. package/dist/preview/chunk.7TU2PDYW.js +1 -0
  35. package/dist/preview/{chunk.57R4ZUMM.js → chunk.7XCBIID7.js} +1 -1
  36. package/dist/preview/{chunk.5FHH5NR6.js → chunk.A3WOUDOG.js} +1 -1
  37. package/dist/preview/{chunk.VO6DBVZR.js → chunk.AXJJUCWT.js} +1 -1
  38. package/dist/preview/chunk.B2KDYES6.js +1 -0
  39. package/dist/preview/{chunk.V3K32XD7.js → chunk.BT6FUNQI.js} +1 -1
  40. package/dist/preview/chunk.BYVE2NQY.js +1 -0
  41. package/dist/preview/chunk.BYVLGDVJ.js +1 -0
  42. package/dist/preview/{chunk.ROHM3ETN.js → chunk.C3DX4LWD.js} +1 -1
  43. package/dist/preview/chunk.C3X3R7LP.js +9 -0
  44. package/dist/preview/{chunk.I7QCXRP7.js → chunk.C5NOO4CC.js} +1 -1
  45. package/dist/preview/{chunk.EC2T2UVH.js → chunk.CO2ZPX3D.js} +2 -2
  46. package/dist/preview/{chunk.ARTJL3X2.js → chunk.CTSPNTDX.js} +1 -1
  47. package/dist/preview/{chunk.K63BUJBF.js → chunk.CW6IPHRR.js} +2 -2
  48. package/dist/preview/chunk.CXJXVBGF.js +1 -0
  49. package/dist/preview/{chunk.B6DKKNVR.js → chunk.DJ3BD7AZ.js} +1 -1
  50. package/dist/preview/{chunk.PACJFDDU.js → chunk.DQR45N7V.js} +1 -1
  51. package/dist/preview/{chunk.PCTVLNOS.js → chunk.DYW4D74X.js} +1 -1
  52. package/dist/preview/chunk.DZN26GKS.js +1 -0
  53. package/dist/preview/chunk.E2AJ7U5Z.js +1 -0
  54. package/dist/preview/chunk.E5PHLNXR.js +1 -0
  55. package/dist/preview/{chunk.HG2IO5NS.js → chunk.EBTYR5CZ.js} +1 -1
  56. package/dist/preview/chunk.EPPAFWP7.js +5 -0
  57. package/dist/preview/{chunk.NS3Z7QNP.js → chunk.F6CPM7SL.js} +1 -1
  58. package/dist/preview/chunk.FCPH4YZN.js +1 -0
  59. package/dist/preview/{chunk.PH5ITX3N.js → chunk.FKLEIR4Y.js} +1 -1
  60. package/dist/preview/chunk.FLMNHV6A.js +19 -0
  61. package/dist/preview/chunk.FTF67QE2.js +1 -0
  62. package/dist/preview/chunk.GNPYSMHA.js +1 -0
  63. package/dist/preview/chunk.GSZYT6GF.js +1 -0
  64. package/dist/preview/{chunk.X5WIS4BC.js → chunk.GZA5ZNLJ.js} +1 -1
  65. package/dist/preview/chunk.HMABYAZR.js +1 -0
  66. package/dist/preview/chunk.I4HUBO22.js +1 -0
  67. package/dist/preview/chunk.IJ2AF3AW.js +1 -0
  68. package/dist/preview/{chunk.HOTOH7ZB.js → chunk.IJU322EP.js} +1 -1
  69. package/dist/preview/chunk.IWUSCCZN.js +1 -0
  70. package/dist/preview/{chunk.B7DCQJXV.js → chunk.JNCSGUO3.js} +1 -1
  71. package/dist/preview/{chunk.LZH65VSN.js → chunk.K6SPN4D6.js} +1 -1
  72. package/dist/preview/chunk.KBMVUIWR.js +6 -0
  73. package/dist/preview/{chunk.HAY22FPJ.js → chunk.KG5R4GTK.js} +1 -1
  74. package/dist/preview/chunk.KR3J27IA.js +88 -0
  75. package/dist/preview/chunk.KWQ67UK2.js +1 -0
  76. package/dist/preview/chunk.LBIDNJ6G.js +1 -0
  77. package/dist/preview/{chunk.ILPD5CZG.js → chunk.LDU25CCL.js} +1 -1
  78. package/dist/preview/{chunk.CAZX6OPN.js → chunk.MBOOUJOE.js} +1 -1
  79. package/dist/preview/{chunk.J7ZMNAWB.js → chunk.MI2HL3LQ.js} +1 -1
  80. package/dist/preview/chunk.MXU3VQSQ.js +1 -0
  81. package/dist/preview/{chunk.KZDLDXLB.js → chunk.N3FONYEP.js} +2 -2
  82. package/dist/preview/chunk.NH6D6TWY.js +1 -0
  83. package/dist/preview/chunk.NQTCOBOQ.js +1 -0
  84. package/dist/preview/chunk.O4X5WJIC.js +1 -0
  85. package/dist/preview/chunk.OH2N3SX7.js +1 -0
  86. package/dist/preview/chunk.OIJP6PQV.js +1 -0
  87. package/dist/preview/{chunk.CSWX7YGI.js → chunk.ONSG3OIL.js} +1 -1
  88. package/dist/preview/chunk.ORKXXLWD.js +1 -0
  89. package/dist/preview/chunk.OUN2H3TR.js +1 -0
  90. package/dist/preview/{chunk.AQTCN7KQ.js → chunk.OWL5GZ6U.js} +1 -1
  91. package/dist/preview/chunk.PEXPTDX7.js +1 -0
  92. package/dist/preview/chunk.PWYMZWAN.js +1 -0
  93. package/dist/preview/{chunk.V5VQCANB.js → chunk.Q5XICUDZ.js} +1 -1
  94. package/dist/preview/chunk.QJUFVEAU.js +1 -0
  95. package/dist/preview/{chunk.WVN62OMH.js → chunk.QWY54AVN.js} +1 -1
  96. package/dist/preview/{chunk.Y2QDZLSY.js → chunk.QXTLZSBL.js} +1 -1
  97. package/dist/preview/{chunk.XDPIS7RS.js → chunk.R2B2ZAWI.js} +1 -1
  98. package/dist/preview/{chunk.VTUMPH4Z.js → chunk.R7F6UJVG.js} +1 -1
  99. package/dist/preview/chunk.RDXDEFOC.js +1 -0
  100. package/dist/preview/{chunk.WUQOSVQU.js → chunk.RPDTWQKA.js} +3 -3
  101. package/dist/preview/{chunk.4YBP552Z.js → chunk.RQBX7M7Q.js} +2 -2
  102. package/dist/preview/{chunk.LFJH6X6O.js → chunk.RSYFIL2Z.js} +1 -1
  103. package/dist/preview/{chunk.WZEA2UK6.js → chunk.RY4E4JRI.js} +1 -1
  104. package/dist/preview/{chunk.VEP4EJ2N.js → chunk.S2MP53RO.js} +1 -1
  105. package/dist/preview/{chunk.IWLVZGW5.js → chunk.S6BZXNMV.js} +1 -1
  106. package/dist/preview/{chunk.WERBD5ZR.js → chunk.SGRKCQ2X.js} +1 -1
  107. package/dist/preview/chunk.SKB4XSDG.js +1 -0
  108. package/dist/preview/chunk.T4M4MLOS.js +1 -0
  109. package/dist/preview/{chunk.BZ4VZ6WQ.js → chunk.T4Q6OLZU.js} +1 -1
  110. package/dist/preview/{chunk.QHLD4TZW.js → chunk.T4QT5SZY.js} +1 -1
  111. package/dist/preview/{chunk.VKJAGZNU.js → chunk.TMBFLZNH.js} +1 -1
  112. package/dist/preview/chunk.TX65ZO27.js +1 -0
  113. package/dist/preview/chunk.U3ETEQDO.js +1 -0
  114. package/dist/preview/chunk.VCOIFBUE.js +1 -0
  115. package/dist/preview/{chunk.4QEDYRES.js → chunk.VP35BUUZ.js} +5 -5
  116. package/dist/preview/{chunk.VMBIFUYX.js → chunk.WH2RYGXR.js} +1 -1
  117. package/dist/preview/{chunk.P7ISPJAQ.js → chunk.WWR7Y2KE.js} +1 -1
  118. package/dist/preview/chunk.X5WB4GJ4.js +1 -0
  119. package/dist/preview/chunk.XAXZCOZK.js +1 -0
  120. package/dist/preview/chunk.XBV4WO7D.js +1 -0
  121. package/dist/preview/chunk.XFQUVMRI.js +1 -0
  122. package/dist/preview/{chunk.QXMTGLHR.js → chunk.XGRMQUFB.js} +1 -1
  123. package/dist/preview/{chunk.O7VHAKSA.js → chunk.XVWJD2DG.js} +1 -1
  124. package/dist/preview/{chunk.LWAZ6ZO6.js → chunk.YKN2VWWQ.js} +2 -2
  125. package/dist/preview/{chunk.ZRIDKFTV.js → chunk.YPEZZLOY.js} +1 -1
  126. package/dist/preview/chunk.YQDIVHCH.js +1 -0
  127. package/dist/preview/{chunk.ZQCGDTQ3.js → chunk.Z56L6V6Z.js} +1 -1
  128. package/dist/preview/{chunk.KMGGP6XT.js → chunk.ZE4U4JBF.js} +2 -2
  129. package/dist/preview/chunk.ZE6LJVVN.js +1 -0
  130. package/dist/preview/{chunk.U6YOAS4X.js → chunk.ZEC64CK6.js} +1 -1
  131. package/dist/preview/chunk.ZHRW2UF4.js +1 -0
  132. package/dist/preview/{chunk.XNW7PUAF.js → chunk.ZRICIE6T.js} +1 -1
  133. package/dist/preview/chunk.ZUJZVK2X.js +1 -0
  134. package/dist/preview/index.html +46 -45
  135. package/dist/preview/page.js +6 -6
  136. package/package.json +6 -6
  137. package/dist/preview/chunk.22QEYFWI.js +0 -1
  138. package/dist/preview/chunk.35FR36BQ.js +0 -1
  139. package/dist/preview/chunk.36LP3I7Z.js +0 -21
  140. package/dist/preview/chunk.3K2KBIRG.js +0 -1
  141. package/dist/preview/chunk.3SKUJWFC.js +0 -1
  142. package/dist/preview/chunk.3WABA2WQ.js +0 -1
  143. package/dist/preview/chunk.4NBB44YU.js +0 -1
  144. package/dist/preview/chunk.4YRCKOX2.js +0 -1
  145. package/dist/preview/chunk.6MLAJKYM.js +0 -1
  146. package/dist/preview/chunk.6NF32PAT.js +0 -1
  147. package/dist/preview/chunk.6WB24MS3.js +0 -1
  148. package/dist/preview/chunk.7HZVCW3Q.js +0 -1
  149. package/dist/preview/chunk.7MJM3OVC.js +0 -1
  150. package/dist/preview/chunk.7OSL64QH.js +0 -1
  151. package/dist/preview/chunk.7XDNCCLG.js +0 -6
  152. package/dist/preview/chunk.7Z2GTKA4.js +0 -1
  153. package/dist/preview/chunk.AOC2KUFE.js +0 -1
  154. package/dist/preview/chunk.AWSUMY3D.js +0 -1
  155. package/dist/preview/chunk.B65HPL4I.js +0 -1
  156. package/dist/preview/chunk.BJET6KOG.js +0 -1
  157. package/dist/preview/chunk.D3ELYLME.js +0 -1
  158. package/dist/preview/chunk.DNMBZONP.js +0 -1
  159. package/dist/preview/chunk.DXAUXGNN.js +0 -1
  160. package/dist/preview/chunk.EHMCRUYR.js +0 -1
  161. package/dist/preview/chunk.EQIQPY4O.js +0 -1
  162. package/dist/preview/chunk.ETWOZQWL.js +0 -1
  163. package/dist/preview/chunk.EVHXF7LZ.js +0 -19
  164. package/dist/preview/chunk.FFRWSODT.js +0 -1
  165. package/dist/preview/chunk.G4AY6NGN.js +0 -1
  166. package/dist/preview/chunk.GN2SZEFH.js +0 -1
  167. package/dist/preview/chunk.GXWOEOUY.js +0 -1
  168. package/dist/preview/chunk.IGA7OD3L.js +0 -1
  169. package/dist/preview/chunk.IXS5XBG6.js +0 -1
  170. package/dist/preview/chunk.JCTT2LAK.js +0 -1
  171. package/dist/preview/chunk.JE4QQEJE.js +0 -25
  172. package/dist/preview/chunk.JEBB3WM7.js +0 -1
  173. package/dist/preview/chunk.JPD2I4Z7.js +0 -1
  174. package/dist/preview/chunk.LKGDN25E.js +0 -1
  175. package/dist/preview/chunk.LMUFLZYT.js +0 -1
  176. package/dist/preview/chunk.MUBZIU6F.js +0 -1
  177. package/dist/preview/chunk.MZ6I2Q4E.js +0 -1
  178. package/dist/preview/chunk.NTJNBKWC.js +0 -1
  179. package/dist/preview/chunk.OMCXJGDI.js +0 -1
  180. package/dist/preview/chunk.OTHGZPUC.js +0 -1
  181. package/dist/preview/chunk.P6FGIYWP.js +0 -35
  182. package/dist/preview/chunk.PYFQGBU3.js +0 -1
  183. package/dist/preview/chunk.RFCTUGMU.js +0 -1
  184. package/dist/preview/chunk.RR4RZH4S.js +0 -1
  185. package/dist/preview/chunk.S5K4FLLG.js +0 -1
  186. package/dist/preview/chunk.SZKVNPEF.js +0 -1
  187. package/dist/preview/chunk.T3F6BKIO.js +0 -1
  188. package/dist/preview/chunk.UG727PEE.js +0 -5
  189. package/dist/preview/chunk.VXZFW52D.js +0 -1
  190. package/dist/preview/chunk.VYPR2MZO.js +0 -1
  191. package/dist/preview/chunk.W77OH637.js +0 -1
  192. package/dist/preview/chunk.WODEO2JF.js +0 -9
  193. package/dist/preview/chunk.XPML6T3P.js +0 -1
  194. package/dist/preview/chunk.YJM23BJL.js +0 -88
  195. package/dist/preview/chunk.YLGSXLXF.js +0 -1
  196. package/dist/preview/chunk.YLI6I6XP.js +0 -1
  197. package/dist/preview/chunk.YRYEWVNP.js +0 -1
  198. package/dist/preview/chunk.Z2TYCMBT.js +0 -5
  199. package/dist/preview/chunk.ZAFIZXGX.js +0 -1
  200. package/dist/preview/chunk.ZBYLAC3B.js +0 -2
  201. package/dist/preview/chunk.ZOS5APMD.js +0 -1
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as Se,f as be}from"./chunk.B6DKKNVR.js";import{e as pt}from"./chunk.7EB6SDUQ.js";import{a as ae,b as tt}from"./chunk.QHP7AJUV.js";import{b as Pe,c as U,d as X,e as it,f as rt}from"./chunk.U3MQUIJL.js";import{a as yt,d as wt,f as vt}from"./chunk.DNMBZONP.js";import{a as ve,b as gt}from"./chunk.OTHGZPUC.js";import{a as Ce,b as ft}from"./chunk.4YBP552Z.js";import{a as mt,b as ht}from"./chunk.ARTJL3X2.js";import{h as ut}from"./chunk.V3K32XD7.js";import{d as ot,e as ie,f as J,g as ye,h as st,j as lt,k as re}from"./chunk.WVN62OMH.js";import{j as dt,o as we}from"./chunk.HG2IO5NS.js";import{c as ct}from"./chunk.AQTCN7KQ.js";import{c as at,d as Re}from"./chunk.VTUMPH4Z.js";import{c as nt}from"./chunk.PCTVLNOS.js";import{Aa as Ne,G as q,R as I,T as Ye,Z as Ze,_ as V,aa as ue,ha as Qe,ia as _,j as _e,ja as pe,l as je,m as qe,ma as me,r as ne,ua as he,v as Ue,wa as et,y as Xe,ya as xe,z as Je,za as fe}from"./chunk.JE4QQEJE.js";import{a as ge}from"./chunk.SDO3U72B.js";import{$b as te,U as Q,ca as $,ea as ee,hb as Ke,la as H}from"./chunk.UG727PEE.js";import{b as L}from"./chunk.AJZBJBMO.js";var v=L(q(),1);var St=L(q(),1);function bt(e){(0,St.useLayoutEffect)(()=>{let n=e.current,t=n?.parentElement;if(!n||!t)return;let a=n.style.bottom,o=()=>{let g=t.querySelector(zt);if(!g){n.style.bottom=a;return}let u=t.getBoundingClientRect(),m=g.getBoundingClientRect(),c=u.height>0?t.offsetHeight/u.height:1;n.style.bottom=`${Math.max(0,Math.round((u.bottom-m.top)*c))}px`};if(o(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(o);return l.observe(t),()=>l.disconnect()},[e])}var zt=".graview-spec-listing";var $e=L(q(),1);var P=L(q(),1);var kt=L(q(),1);var B=L(I(),1);function xt({id:e,max:n=8,empty:t,hide:a}){let{store:o}=V();ue();let l=Kt(o,e,o.violations()),[g,u]=(0,kt.useState)(()=>new Set),m=a?l.flatMap(c=>{let f=c.ids.filter(r=>!a.has(r));return f.length>0?[{...c,ids:f}]:[]}):l;return m.length===0?t&&l.length===0?(0,B.jsx)("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-faint)"},children:t}):null:(0,B.jsx)("div",{"data-graview-primitive":"connections",style:{display:"flex",flexDirection:"column",gap:12},children:m.map(c=>{let f=g.has(c.key),r=c.ids.length>n,d=f?c.ids:c.ids.slice(0,n),y=c.ids.length-Math.min(n,c.ids.length),k=`graview-more-${e}-${c.key}`.replace(/[^A-Za-z0-9_-]/g,"-");return(0,B.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)("h2",{...c.said?{"aria-label":c.said}:{},style:{margin:0,fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:c.label}),(0,B.jsxs)("div",{id:k,style:{display:"flex",flexWrap:"wrap",gap:6},children:[d.map(h=>{let w=o.graph.getNode(h);return w?(0,B.jsx)(X,{pickId:h,hue:te(w.kind),title:`Go to the ${H(o.schema.tryDefinition(w.kind),w.kind)}`,label:$(o.schema.tryDefinition(w.kind),w)},h):null}),r?(0,B.jsx)("button",{type:"button","data-graview-more":c.key,"aria-expanded":f,"aria-controls":k,...f?{}:{"aria-label":`${y} more: ${c.said??c.label}`},onClick:h=>{h.stopPropagation(),u(w=>{let S=new Set(w);return S.has(c.key)?S.delete(c.key):S.add(c.key),S})},style:Ft,children:f?"Show fewer":`+${y} more`}):null]})]},c.key)})})}var Ft={display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,border:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",color:"var(--graview-accent)",font:"inherit",fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",cursor:"pointer"};function Kt(e,n,t=[]){let a=e.graph.getNode(n);if(!a)return[];let o=new Map,l=[];for(let g of t)if(g.subjectId===n)for(let u of g.nodeIds)u!==n&&!l.includes(u)&&e.graph.has(u)&&l.push(u);l.length>0&&o.set("judges",{key:"judges",label:"what it finds wrong",ids:l});for(let g of e.graph.allEdges()){let u=g.from===n?g.to:g.to===n?g.from:null;if(u===null||u===n)continue;let m=e.graph.getNode(u);if(!m)continue;let c=g.from===n?"out":"in",f=c==="out"?a.kind:m.kind,r=_t(e.schema,f,g.kind,c),d=`${g.kind}:${c}:${r.label}`,y=o.get(d)??{key:d,...r,ids:[]};y.ids.includes(u)||y.ids.push(u),o.set(d,y)}for(let g of o.values())g.ids.sort();return[...o.values()].sort((g,u)=>g.key<u.key?-1:g.key>u.key?1:0)}function _t(e,n,t,a){let o=nt(e,n,t,a),l=ee(t).toLowerCase();return o.trim().toLowerCase()!==l?{label:o}:a==="out"?{label:`\u2192 ${l}`,said:l}:{label:`\u2190 ${l}`,said:`${l}, pointing here`}}var Nt=L(q(),1),oe=(0,Nt.createContext)(null);var s=L(I(),1),jt=he(ge(()=>(__graviewPreload(import.meta.url,["./chunk.EVHXF7LZ.js","./chunk.ARTJL3X2.js","./chunk.V3K32XD7.js","./chunk.CAZX6OPN.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.IXS5XBG6.js")))).part((e,n)=>(0,s.jsx)(e.ArrangeBar,{...n}),{what:"Arranging this list"}),qt=he(ge(()=>(__graviewPreload(import.meta.url,["./chunk.ILPD5CZG.js","./chunk.KZDLDXLB.js","./chunk.EC2T2UVH.js","./chunk.Y2QDZLSY.js","./chunk.WUQOSVQU.js","./chunk.ETWOZQWL.js","./chunk.B6DKKNVR.js","./chunk.VEP4EJ2N.js","./chunk.7EB6SDUQ.js","./chunk.HJCQ6I3S.js","./chunk.5FHH5NR6.js","./chunk.VMBIFUYX.js","./chunk.O7VHAKSA.js","./chunk.P6J6VFF5.js","./chunk.L6HKDIZB.js","./chunk.QHP7AJUV.js","./chunk.U3MQUIJL.js","./chunk.DNMBZONP.js","./chunk.OTHGZPUC.js","./chunk.4YBP552Z.js","./chunk.EVHXF7LZ.js","./chunk.ARTJL3X2.js","./chunk.V3K32XD7.js","./chunk.CAZX6OPN.js","./chunk.37NF3YXZ.js","./chunk.G4JJXA63.js","./chunk.X2M7IOQA.js","./chunk.WZEA2UK6.js","./chunk.V5VQCANB.js","./chunk.UT6642FC.js","./chunk.WERBD5ZR.js","./chunk.HAY22FPJ.js","./chunk.Q5WEOX3Q.js","./chunk.IWLVZGW5.js","./chunk.X5WIS4BC.js","./chunk.PH5ITX3N.js","./chunk.WVUJXDXZ.js","./chunk.WVN62OMH.js","./chunk.BZ4VZ6WQ.js","./chunk.XDPIS7RS.js","./chunk.57R4ZUMM.js","./chunk.J7ZMNAWB.js","./chunk.VKJAGZNU.js","./chunk.GZHZLJBF.js","./chunk.HG2IO5NS.js","./chunk.OJGHDWI6.js","./chunk.AQTCN7KQ.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.YJM23BJL.js")))).part((e,n)=>(0,s.jsx)(e.KindStop,{...n}),{what:"This list"});function Ae(e){let{brand:n}=V();return te(e,n?.accents)}function Ut(e,n){if(!n.endsWith("\u2026")&&!n.endsWith("..."))return;let t=n.replace(/[…]|\.\.\.$/g,"").trim();if(!(t.length<12)){for(let a of Object.values(e))if(typeof a=="string"&&a.length>t.length&&a.startsWith(t))return a}}function Xt(e,n){let a=Math.max(0,...e.slice(0,n*2).map(l=>l.length))*7.5+28<=212/2?2:1,o=n*a;return{columns:a,shown:Math.min(e.length,o)}}var Jt=8,Rt=500,Yt=12;function Ct(e){return{x:e.clientX,y:e.clientY,pointerType:e.pointerType??""}}function Zt(e,n,t){let a=performance.now()+Rt,o=["pointerdown","pointerup","mousedown","mouseup","dblclick"],l=r=>{if(performance.now()>a||!(r instanceof MouseEvent))return!1;let d=Ct(r);return n.pointerType&&d.pointerType&&n.pointerType!==d.pointerType?!1:Math.hypot(d.x-n.x,d.y-n.y)<=Yt},g=r=>{if(!l(r))return c();r.stopPropagation()},u=r=>{if(!l(r))return c();r.stopPropagation(),r.preventDefault(),e.removeEventListener("click",u,!0),setTimeout(c,50),t()},m=!1,c=()=>{if(!m){m=!0,clearTimeout(f),e.removeEventListener("click",u,!0);for(let r of o)e.removeEventListener(r,g,!0)}};for(let r of o)e.addEventListener(r,g,!0);e.addEventListener("click",u,!0);let f=setTimeout(c,Rt)}function Qt({View:e,members:n,mode:t,flagged:a}){let{isSelected:o}=xe(),l=n.slice(0,Jt);return(0,s.jsxs)("div",{"data-graview-rows":"",style:{display:"grid",gap:4,minWidth:0},children:[l.map(g=>(0,s.jsx)("div",{"data-graview-pick":g.id,style:{minWidth:0,cursor:"pointer"},children:(0,s.jsx)(e,{node:g,cardinality:"one",fidelity:"glyph",mode:t,selected:o(g.id),...a?.includes(g.id)?{flagged:[g.id]}:{}})},g.id)),n.length>l.length?(0,s.jsx)(X,{label:`+${n.length-l.length} more`}):null]})}var en=11/15,tn=he(ge(()=>(__graviewPreload(import.meta.url,["./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.3K2KBIRG.js")))).part((e,n)=>(0,s.jsx)(e.StatesBar,{...n}),{quiet:!0});function nn({text:e,accent:n}){let t=(0,P.useRef)(null),a=(0,P.useRef)(null),[o,l]=(0,P.useState)(1),[g,u]=(0,P.useState)(!1),m=o<1?`${o}em`:void 0;return(0,P.useLayoutEffect)(()=>{let c=t.current,f=a.current;if(!c||!f)return;let r=()=>{let y=c.clientWidth,k=f.offsetWidth;if(y<=0||k<=0)return;let h=parseFloat(getComputedStyle(f).fontSize)/parseFloat(getComputedStyle(c).fontSize)||1,w=k/h,S=Math.max(en,Math.min(1,Math.floor(y/w*100)/100));l(x=>Math.abs(x-S)<.01?x:S),u(w*S>y+.5)};if(r(),typeof ResizeObserver>"u")return;let d=new ResizeObserver(r);return d.observe(c),()=>d.disconnect()},[e]),(0,s.jsx)("span",{ref:t,"data-graview-district-name":"",...o<1?{"data-graview-fitted":""}:{},...g?{title:e}:{},style:{display:"block",minWidth:0,fontSize:"0.9375rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,s.jsx)("span",{ref:a,style:{fontSize:m},children:e})})}function Pt(e,n){return!!e?.display?.page?.groups?.length||Re(n,e).some(t=>t.long)}function At(e,n=me(e)){for(let t of e.kinds){let a=e.tryDefinition(t),o=a?.plural??`${String(t)}s`,l=r=>{let d=r.node,y=fe(),k=(0,P.useContext)(oe);if(!d)return null;let h=k?.nodeId===d.id?k:null,w=$(a,d),S=r.mode==="fullscreen"?Ut(d,w)??w:w,x=Ke(y,[d.id]);return(0,s.jsxs)(U,{title:(0,s.jsx)(vt,{nodeId:d.id,children:h?.title??S}),...h?{}:{subtitle:a?.describe?at(a,d):a?.description??String(t)},selected:r.selected,...r.flagged?.includes(d.id)?{tone:"warning"}:{},fit:!0,children:[h?(0,s.jsx)(oe.Provider,{value:null,children:h.body}):null,(0,s.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"22px 34px",alignItems:"flex-start"},children:[(0,s.jsx)("div",{style:{flex:Pt(a,d)?"1 1 100%":"1 1 0",minWidth:"min(200px, 100%)"},children:(0,s.jsx)(wt,{id:d.id,shown:[S,w,a?.description,h?.title],...h?{hide:[...h.fields]}:{}})}),(0,s.jsx)("div",{style:{flex:Pt(a,d)?"1 1 100%":"1.4 1 0",minWidth:"min(220px, 100%)"},children:(0,s.jsx)(xt,{id:d.id,empty:`Nothing is connected to this ${H(a,String(t))} yet.`,...h?{hide:h.records}:{}})})]}),x.length>0?(0,s.jsx)("p",{"data-graview-broken":"",style:{margin:"14px 0 0",paddingTop:12,borderTop:"1px solid var(--graview-edge)",fontSize:"0.875rem",color:"var(--graview-warn)"},children:x.map(b=>b.message).join(" \xB7 ")}):null]})},g=r=>{let d=r.node;if(!d)return null;let{store:y}=V(),k=a?.computed?lt(y.schema,y.graph,d):d,h=Re(k,a,{limit:3,said:[$(a,d)],glance:!0}),w=Ae(t),S=h.filter(N=>!N.long&&!N.markdown),x=h.find(N=>N.long||N.markdown),b=ot(d,a);return(0,s.jsxs)(U,{title:$(a,d),selected:r.selected,tone:r.flagged?.includes(d.id)?"warning":"muted",fit:!0,children:[b?(0,s.jsx)(ve,{as:"thumb",file:b,size:64,style:{marginBottom:6}}):null,(0,s.jsx)(it,{items:S.map(N=>({id:N.key,label:N.alone,hue:w})),max:3}),x?(0,s.jsx)("p",{"data-graview-excerpt":x.key,title:x.value,style:{margin:S.length>0?"6px 0 0":0,fontSize:"0.8125rem",lineHeight:1.35,color:"var(--graview-ink-muted)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:x.value}):null]})},u=r=>{let d=r.node,y=Ae(t),k=we().marks.flag;if(!d)return null;let h=r.flagged?.includes(d.id)??!1;return(0,s.jsx)(X,{label:h?`${$(a,d)} ${k}`:$(a,d),hue:y,selected:r.selected,title:h?`${ee(H(a,String(t)))} \u2014 implicated in a problem`:ee(H(a,String(t)))})},m=r=>r.fidelity==="full"?(0,s.jsx)(P.Suspense,{fallback:(0,s.jsx)(c,{...r}),children:(0,s.jsx)(qt,{kind:String(t),members:r.nodes??[],...r.flagged?{flagged:r.flagged}:{},...r.label?{label:r.label}:{},...r.retired?{retired:r.retired}:{}})}):(0,s.jsx)(c,{...r}),c=r=>{let{brand:d,store:y,views:k}=V(),{view:h,go:w}=Ne(),S=r.nodes??[],x=k.lookup(String(t),{cardinality:"one",fidelity:"glyph"}),b=x!==void 0&&!pe(x)?x:void 0,N=mt(h),C=ut(S,N,{schema:e,graph:y.graph,flagged:new Set(r.flagged??[])}),M=R=>({id:R.id,label:$(e.tryDefinition(R.kind),R),hue:te(R.kind,d?.accents)}),W=r.fidelity==="full"&&S.length>1?(0,s.jsx)(P.Suspense,{fallback:null,children:(0,s.jsx)(jt,{schema:e,graph:y.graph,kind:String(t),arrangement:N,onChange:R=>w(ht(h,R)),kept:{shown:C.nodes.length,of:S.length},style:{marginBottom:8}})}):null,se=R=>R.some(A=>r.flagged?.includes(A.id)),le=fe(),Y=we().marks.flag,z=(R,A,de)=>b?(0,s.jsx)(U,{title:R,meta:(0,s.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(be,{kind:String(t),plural:o,problems:Se(le,A),flag:Y}),(0,s.jsx)("span",{title:`${Q(A.length)} ${A.length===1?H(a,String(t)):o.toLowerCase()}`,children:Q(A.length)})]}),tone:se(A)?"warning":"muted",children:(0,s.jsx)(Qt,{View:b,members:A,mode:r.mode,...r.flagged?{flagged:r.flagged}:{}})},de):(0,s.jsx)(rt,{label:R,count:A.length,flagged:se(A),items:A.map(M),problems:(0,s.jsx)(be,{kind:String(t),plural:o,problems:Se(le,A),flag:Y})},de);return C.grouped?(0,s.jsxs)("div",{style:{display:"grid",gap:8},"data-graview-grouped":N.group?.by,children:[W,C.groups.map(R=>z(`${r.label??o} \xB7 ${R.label}`,R.nodes,R.key||"-"))]}):(0,s.jsxs)("div",{style:{display:"grid",gap:4},children:[W,z(r.label??o,C.nodes)]})},f=r=>{let d=r.nodes??[],y=Xt(d.map(p=>$(a,p)),r.openedRows??dt(d.length)),k=Ae(t),{brand:h}=V(),w=tt(String(t),e,h),S=we().marks.flag,{selection:x,set:b,clear:N}=xe(),{toggle:C,view:M,go:W}=Ne(),{views:se,hiddenKinds:le}=V(),Y=(0,P.useContext)(Qe),z=M.overview&&!le.has(String(t))?se.places().filter(p=>p.kind===String(t)):[],R=r.focused?M.within?.view??z[0]?.as:void 0,A=d.filter(p=>r.flagged?.includes(p.id)).length,de=A>0,Ot=fe(),Ht=Se(Ot,d),F=(M.overview??!1)&&r.nestedUnder===void 0,G=r.focused||r.raised,He=r.rank==="secondary"&&!G,E=r.nestedUnder!==void 0,Ie=new Set(x),K=Y?x.length===1&&x[0]===ne(String(t)):r.opened??!1,It=ct(),O=G||F?0:d.filter(p=>It.includes(p.id)&&!Ie.has(p.id)).length,ke=O>0&&!de,ce=Ze(),j=ce&&!E?ce.byKind[String(t)]??0:0,We=(0,P.useRef)(null),ze=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let p=ze.current,T=We.current;if(!p||!T||!F)return;let D=()=>T.style.setProperty("--graview-plate-h",`${p.offsetHeight}px`);if(D(),typeof ResizeObserver>"u")return;let Z=new ResizeObserver(D);return Z.observe(p,{box:"border-box"}),()=>Z.disconnect()},[F]);let Wt=E?8:Math.min(46,10+Math.round(Math.sqrt(d.length)*8)),Fe=E?(0,s.jsx)("span",{style:{fontSize:"0.75rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:G?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.label??o}):(0,s.jsx)(nn,{text:r.label??o,accent:!!G});return(0,s.jsxs)("div",{ref:We,className:"graview-kind-card","data-graview-rank":r.rank,"data-graview-landmark":w||void 0,"data-graview-nested":E||void 0,"data-graview-tied":O||void 0,"data-graview-hits":ce&&!E?j:void 0,"data-graview-emphasis":ce&&!E?j>0?"lit":"dimmed":void 0,...a?.description||E?{title:E?[r.label??o,a?.description].filter(Boolean).join(" \u2014 "):a.description}:{},style:{position:"relative",height:"100%","--graview-hue":Math.round(k)},children:[w?(0,s.jsx)("span",{className:"graview-kind-block graview-kind-landmark","data-graview-opened":r.opened||void 0,"aria-hidden":"true",style:{"--graview-rise":Wt},children:(0,s.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:96})}):null,(0,s.jsxs)("div",{ref:ze,className:"graview-kind-face","data-graview-opened":r.opened||void 0,"data-graview-nameplate":F?r.nameplate??"full":void 0,style:{display:"flex",flexDirection:"column",gap:E?1:3,padding:E?"5px 7px":"7px 10px",borderRadius:"var(--graview-radius-sm, 9px)",justifyContent:"center",position:"relative",height:"100%",overflow:"hidden",boxSizing:"border-box",border:G?"1px solid var(--graview-accent)":O>0?"1px solid var(--graview-accent-dim)":`1px solid hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.34)`,backgroundColor:"var(--graview-panel)",backgroundImage:`linear-gradient(hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:He?.28:.5})), hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:He?.28:.5})))`,boxShadow:G?"0 0 0 1px var(--graview-accent-dim)":void 0},children:[!E&&!F&&d.length>0?(0,s.jsx)("div",{"data-graview-tally":d.length,"data-graview-broken":A||void 0,"aria-hidden":"true",style:{position:"absolute",left:0,right:0,top:0,display:"flex",height:3,background:`hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.4)`},children:A>0?(0,s.jsx)("span",{style:{width:`${Math.max(6,Math.round(A/d.length*100))}%`,background:"var(--graview-warn)"}}):null}):null,w?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:E?4:6},children:[(0,s.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:E?14:18}),Fe]}):Fe,(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"0.875rem"},children:[(0,s.jsx)("span",{title:d.length>0?`${Q(d.length)} ${d.length===1?H(a,String(t)):o.toLowerCase()}`:void 0,style:{fontVariantNumeric:"tabular-nums",color:ke?"var(--graview-accent)":"var(--graview-ink-faint)"},children:d.length===0?"none yet":ke?O===d.length?`${O} tied`:`${O} of ${d.length} tied`:Q(d.length)}),(0,s.jsx)(be,{kind:String(t),plural:o,problems:Ht,flag:S,listed:K}),(r.retired??0)>0?(0,s.jsxs)("button",{type:"button",className:"graview-kind-past","data-graview-retired":r.retired,title:`${r.retired} retired ${o.toLowerCase()} \u2014 press to widen the view to the past`,onClick:p=>{p.stopPropagation(),W(pt(M,!0))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:["+",r.retired," past"]}):null,j>0?(0,s.jsxs)("button",{type:"button",className:"graview-kind-hits","data-testid":`hits-${String(t)}`,title:`${j} ${j===1?"match":"matches"} for \u201C${M.q??""}\u201D \u2014 press to go in, narrowed`,onClick:p=>{p.stopPropagation(),W(Xe(M,ne(String(t)),{ownPicture:!0,...M.q?{carry:M.q}:{}}))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[j," match"]}):null,O>0&&!ke?(0,s.jsxs)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-accent)"},children:[O," tied"]}):null,r.hasOwnView&&!F?(0,s.jsx)("span",{title:`${o} has a view of its own`,"aria-label":"has its own view",style:{fontSize:"0.6875rem",color:"var(--graview-accent)"},children:"\u25C6"}):null,!E&&d.length>0&&!r.focused?(0,s.jsxs)("button",{type:"button",className:"graview-kind-open","data-testid":`open-${String(t)}`,"aria-expanded":K,"aria-label":K?`Close up the ${o}`:`See the ${o} in here`,title:K?"Close it up":`See the ${o} in here`,onClick:p=>{p.stopPropagation(),Y?K?N():b([ne(String(t))]):C(ne(String(t)))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[(0,s.jsx)("span",{className:"graview-kind-open-word",children:K?"close":"open"})," ",(0,s.jsx)("span",{"aria-hidden":"true",children:K?"\u25B4":"\u25BE"})]}):null]}),F&&r.states?(0,s.jsx)(P.Suspense,{fallback:null,children:(0,s.jsx)(tn,{states:r.states,definition:a})}):null,r.opened?(0,s.jsxs)("div",{className:"graview-kind-members","data-graview-buildings":r.plot?.side??1,style:{display:"grid",gridTemplateColumns:`repeat(${y.columns}, minmax(0, 1fr))`,gap:3},children:[d.slice(0,y.shown).map(p=>{let T=r.flagged?.includes(p.id)??!1,D=$(a,p);return(0,s.jsx)(X,{pickId:p.id,label:T?`${D} ${S}`:D,title:T?`${D} \u2014 implicated in a problem`:void 0,hue:k,selected:Ie.has(p.id)},p.id)}),d.length>y.shown?(0,s.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",padding:"2px 4px",gridColumn:"1 / -1"},children:["+",d.length-y.shown," more \u2014 double-click to go in"]}):null]}):null]}),!E&&z.length>0?(0,s.jsx)("div",{className:"graview-drive-in","data-testid":`drive-in-${String(t)}`,"data-graview-showing":R,onPointerDown:p=>p.stopPropagation(),onDoubleClick:p=>p.stopPropagation(),children:(0,s.jsx)("div",{className:"graview-drive-in-marquee",role:"group","aria-label":`${o}: pictures`,"data-graview-thumbs":z.length===1?"one":"two",children:z.map(p=>{let T=R===p.as;return(0,s.jsxs)("div",{className:"graview-drive-in-thumb","data-graview-pressed":T||void 0,children:[(0,s.jsx)("span",{className:"graview-drive-in-thumb-title","aria-hidden":"true",children:p.title}),(0,s.jsx)("button",{type:"button",className:"graview-drive-in-thumb-press","data-testid":`showing-${p.as}`,"aria-label":`${o}: ${p.title}`,"aria-pressed":T,title:T?`${p.title} is showing \u2014 press again to open it`:`Show ${p.title} on the billboard \u2014 double-click to open it`,onClick:D=>{D.stopPropagation();let Z=()=>W(Je(M,String(t),p.as));if(D.detail>=2||T&&r.focused){Z();return}W(je(_e(qe(M,!0),Ue(String(t))),"view",p.as)),D.detail===1&&Zt(D.currentTarget.ownerDocument,Ct(D.nativeEvent),Z)}})]},p.as)})})}):null]})};m.generic=!0,f.generic=!0,n.register(t,{cardinality:"one",fidelity:"full"},_(l)).register(t,{cardinality:"one",fidelity:"summary"},_(g)).register(t,{cardinality:"one",fidelity:"glyph"},_(u)).register(t,{cardinality:"many",fidelity:"full"},_(m)).register(t,{cardinality:"many",fidelity:"summary"},_(m)).register(t,{cardinality:"many",fidelity:"glyph"},_(f))}return n}var Ee=L(I(),1),$t=new WeakMap;function an(e){let n=$t.get(e);return n||$t.set(e,n=At(e,me(e))),n}var Ve=et;function Vt(){return(0,$e.useContext)(Ve)}function jn({children:e}){return(0,Ee.jsx)(Ve.Provider,{value:!0,children:e})}function Et(e){let n=(0,$e.useContext)(Ve),{store:t}=V();if(n)return null;let a=e.kind??e.node?.kind??e.nodes?.[0]?.kind;if(!a)return null;let o=an(t.schema).lookup(a,{cardinality:e.cardinality,fidelity:e.fidelity});return o?(0,Ee.jsx)(o,{...e}):null}var i=L(I(),1),rn=90,Dt=(0,v.createContext)(null),Lt=(e,n)=>e.trim().toLowerCase().replace(/[_-]+/g," ")===n.trim().toLowerCase().replace(/[_-]+/g," "),on=(0,v.createContext)(null),Be=(0,v.createContext)(null);function Mt({block:e}){let n=(0,v.useContext)(Be),t=n?.slots?.[e.key],a=(0,i.jsx)(sn,{block:e});return t?(0,i.jsx)(v.Suspense,{fallback:a,children:(0,i.jsx)(t,{block:e,node:n.node,drawn:a})}):a}function sn({block:e}){let n=(0,v.useContext)(Dt),t=(0,v.useContext)(dn),a=(0,v.useContext)(De),o=(0,v.useContext)(Pe);if(n&&e.t==="badge"&&n.values.some(l=>Lt(l,e.text))||n&&e.t==="field"&&n.field!==void 0&&e.field===n.field||e.t==="badge"&&/^0(?:\s+\p{L}+)?$/u.test(e.text.trim()))return null;switch(e.t){case"title":return(0,i.jsx)("strong",{className:"graview-spec-title",...o!==null&&Lt(o,e.text)?{"aria-hidden":!0}:{},children:e.text});case"text":return e.markdown||Ce(e.text)?(0,i.jsx)("div",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:(0,i.jsx)(ft,{text:e.text,markdown:e.markdown})}):(0,i.jsx)("p",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:e.text});case"badge":return(0,i.jsx)("span",{className:"graview-spec-badge","data-graview-tone":e.tone,children:e.text});case"field":return(0,i.jsxs)("span",{className:"graview-spec-field","data-graview-field":e.field,children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",...Ce(e.text)?{style:{whiteSpace:"pre-line"}}:{},children:e.linked?(0,i.jsx)(gt,{relation:e.linked.relation,refs:e.linked.refs,as:"chip"}):e.app?(0,i.jsx)(yt,{address:e.app}):e.href?(0,i.jsx)("a",{className:"graview-spec-link",href:e.href,...e.href.startsWith("tel:")?{}:{rel:"noopener noreferrer",target:"_blank"},children:e.text}):e.text})]});case"image":return(0,i.jsx)(ve,{as:"block",field:e.field,files:e.files,label:e.label,view:e.as});case"progress":return e.value===void 0||e.max===void 0?(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]}):(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-track",role:"progressbar","aria-label":e.label,"aria-valuemin":0,"aria-valuemax":e.max,"aria-valuenow":Math.max(0,Math.min(e.value,e.max)),"aria-valuetext":e.text,children:(0,i.jsx)("span",{className:"graview-spec-fill",style:{width:`${Math.round(Math.max(0,Math.min(e.value,e.max))/e.max*100)}%`}})}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]});case"group":return(0,i.jsx)("span",{className:"graview-spec-group","data-direction":e.direction,children:(0,i.jsx)(Le,{blocks:e.blocks})});case"when":return e.shown?(0,i.jsx)(Le,{blocks:e.blocks}):null;case"divider":return(0,i.jsx)("hr",{className:"graview-spec-divider"});case"figure":return(0,i.jsx)(ln,{});case"headline":{let l=`h${Math.min(6,e.level+t)}`,g=(0,i.jsx)(l,{className:"graview-spec-headline","data-level":e.level,"data-long":e.text.length>rn?"":void 0,children:e.text});return a!==null&&e.level===1?(0,i.jsxs)(i.Fragment,{children:[g,a]}):g}case"number":return(0,i.jsxs)("span",{className:"graview-spec-number",...e.emphasis?{"data-emphasis":e.emphasis}:{},children:[(0,i.jsx)("span",{className:"graview-spec-number-value",children:e.text}),e.label?(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}):null]});case"list":return(0,i.jsx)(gn,{list:e})}}function ln(){let e=(0,v.useContext)(Be)?.figure;return e?(0,i.jsx)("span",{className:"graview-spec-figure","aria-hidden":"true",children:e()}):null}function Le({blocks:e}){let n=[];for(let t=0;t<e.length;t++){let a=t;for(;e[a]?.t==="badge"&&e[a+1]?.t==="badge";)a++;if(a===t){n.push((0,i.jsx)(Mt,{block:e[t]},t));continue}n.push((0,i.jsx)("span",{className:"graview-spec-badges",children:e.slice(t,a+1).map((o,l)=>(0,i.jsx)(Mt,{block:o},l))},t)),t=a}return n}function Tt({blocks:e,ctx:n,view:t}){let a=(0,v.useContext)(on)?.[t];return(0,i.jsx)(Be.Provider,{value:{figure:n.figure,slots:a,node:n.node},children:(0,i.jsx)(Le,{blocks:e})})}function Ge({blocks:e,ctx:n,view:t}){return(0,i.jsx)(Tt,{blocks:J(e,n),ctx:n,view:t})}var Me=3,Bt=(0,v.createContext)(0),Gt=(0,v.createContext)(null),dn=(0,v.createContext)(0),De=(0,v.createContext)(null);function cn({node:e,as:n,depth:t,said:a=null}){let{store:o,views:l}=V(),g=$(o.schema.tryDefinition(e.kind),e),u=l.lookup(e.kind,{cardinality:"one",fidelity:n==="card"?"summary":"glyph"});return n==="row"&&t<=Me&&(!u||pe(u))?(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(Te,{node:e,label:g}),(0,i.jsx)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":e.kind,"aria-hidden":"true",children:(0,i.jsx)("strong",{className:"graview-spec-title",children:g})})]}):(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(Te,{node:e,label:g}),t<=Me&&u?(0,i.jsx)(Ye,{mode:"scene",children:(0,i.jsx)(Bt.Provider,{value:t,children:(0,i.jsx)(Dt.Provider,{value:a,children:(0,i.jsx)(Pe.Provider,{value:g,children:(0,i.jsx)(u,{node:e,cardinality:"one",fidelity:n==="card"?"summary":"glyph",mode:"scene",selected:!1})})})})}):(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:g})]})}function Te({node:e,label:n,describedBy:t}){let a=(0,v.useContext)(Gt),o=(0,v.useRef)(null);return bt(o),a?(0,i.jsx)("a",{ref:o,className:"graview-spec-item-link",href:a.href(e),"aria-label":n,...t?{"aria-describedby":t}:{},onClick:l=>{l.metaKey||l.ctrlKey||l.shiftKey||l.button!==0||(l.preventDefault(),l.stopPropagation(),a.go(e))}}):(0,i.jsx)("button",{ref:o,type:"button",className:"graview-spec-item-link","data-graview-pick":e.id,"aria-label":n,...t?{"aria-describedby":t}:{}})}function gn({list:e}){let n=(0,v.useContext)(Bt)+1,{store:t}=V(),a=(0,v.useContext)(Gt),[o,l]=(0,v.useState)(e.members.length);if(e.failed)return(0,i.jsx)("p",{className:"graview-spec-text",children:"\u2014"});if(e.members.length===0)return e.empty?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-empty",children:e.empty}):null;let g=(b,N=null)=>n>Me?(0,i.jsx)("ul",{className:"graview-spec-list","data-as":"names",children:b.map(C=>(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":C.id,"data-as":"name",children:[(0,i.jsx)(Te,{node:C,label:$(t.schema.tryDefinition(C.kind),C)}),(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:$(t.schema.tryDefinition(C.kind),C)})]},C.id))}):(0,i.jsx)("ul",{className:"graview-spec-list","data-as":e.as,children:b.map(C=>(0,i.jsx)(cn,{node:C,as:e.as,depth:n,said:N},C.id))}),u=e.rest??[],m=Math.min(o,e.members.length+u.length),c=m>e.members.length?[...e.members,...u].slice(0,m):e.members,f=e.members.length+u.length-m,r=Math.max(1,e.members.length),d=f>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,i.jsx)("button",{type:"button",className:"graview-spec-show-more","data-graview-show-more":f,onClick:()=>l(m+r),children:`Show ${Math.min(r,f)} more`})}):null,y=e.total??e.members.length+e.more,k=e.more-u.length,h=d??(a?.more&&y>c.length?a.more({members:c,total:y}):k>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${k} more`}):null);if(!e.groups)return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[g(c),h]});let w=`h${e.headingLevel}`,S=m,x=m>e.members.length&&e.everyGroup?e.everyGroup.flatMap(b=>{if(S<=0)return[];let N=b.members.slice(0,S);return S-=N.length,[{...b,members:N}]}):e.groups;return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[x.map(b=>(0,i.jsxs)("section",{className:"graview-spec-list-group","data-graview-group":b.value??"",children:[b.heading?(0,i.jsx)(w,{className:"graview-spec-list-heading",children:b.heading}):null,g(b.members,b.value!==null?{values:[b.value,...b.heading?[b.heading]:[]]}:null)]},b.value??"")),h]})}function la({blocks:e,heading:n=2,firstHeading:t,slot:a,view:o=a}){let{store:l,brand:g}=V();ue();let u=re(l,null,null,{heading:n,firstHeading:t,money:g}),m=(0,v.useContext)(De),c=e.some(f=>f.t==="headline");return(0,i.jsxs)("div",{className:`graview-spec graview-spec-${a}`,"data-graview-spec":a,children:[m!==null&&!c?m:null,(0,i.jsx)(De.Provider,{value:c?m:null,children:(0,i.jsx)(Ge,{blocks:e,ctx:u,view:o})})]})}function Oe(e,n="card"){let{store:t,brand:a}=V(),o=t.schema;return{...re(t,null,e,{slot:n,money:a}),figure:()=>(0,i.jsx)(ae,{kind:e.kind,schema:o,...a?{brand:a}:{},size:22})}}function un({slot:e,blocks:n,node:t,selected:a}){let o=Oe(t,e);return(0,i.jsx)("div",{className:`graview-spec graview-spec-${e}`,"data-graview-spec":e,"data-graview-kind":t.kind,...e==="row"&&n.some(st)?{"data-graview-tall":""}:{},...a?{"data-selected":""}:{},children:(0,i.jsx)(Ge,{blocks:n,ctx:o,view:`${t.kind}.${e}`})})}function pn({blocks:e,node:n,selected:t,flagged:a}){let o=Oe(n),[l,...g]=e,u=l?.t==="title";return(0,i.jsx)(U,{...u?{title:J([l],o)[0].text}:{},selected:t,tone:a?"warning":"muted",fit:!0,children:(0,i.jsx)("div",{className:"graview-spec graview-spec-card","data-graview-spec":"card","data-graview-kind":n.kind,children:(0,i.jsx)(Ge,{blocks:u?g:e,ctx:o,view:`${n.kind}.card`})})})}function mn({blocks:e,props:n}){let t=n.node,a=Oe(t,"page"),o=Vt(),l=J(e,a),g=ye(e,l),u=g.title!==void 0&&(!o||g.title===$(a.schema?.tryDefinition(t.kind),t)),m=(0,i.jsx)("div",{className:"graview-spec graview-spec-page","data-graview-spec":"page","data-graview-kind":t.kind,children:(0,i.jsx)(Tt,{blocks:u?l.slice(1):l,ctx:a,view:`${t.kind}.page`})});return o?m:(0,i.jsx)(oe.Provider,{value:{nodeId:t.id,...g.title!==void 0?{title:g.title}:{},body:m,fields:g.fields,records:g.records},children:(0,i.jsx)(Et,{...n})})}function da(e,n,t){return typeof e=="function"?e.says?.(n,t):void 0}function hn({blocks:e,node:n,selected:t}){let{store:a}=V();return(0,i.jsx)("div",{title:$(a.schema.tryDefinition(n.kind),n),style:{minWidth:0,maxWidth:"100%"},children:(0,i.jsx)(un,{slot:"row",blocks:e,node:n,selected:t})})}function ca(e,n,t){if(!t)return e;let a=new Set(n.kinds);for(let[o,l]of Object.entries(t)){if(!a.has(o)||!l)continue;let g=o;if(l.card){let u=ie(l.card),m=c=>c.node?(0,i.jsx)(pn,{blocks:u,node:c.node,selected:c.selected,flagged:c.flagged?.includes(c.node.id)??!1}):null;e.register(g,{cardinality:"one",fidelity:"summary"},m)}if(l.row){let u=ie(l.row),m=c=>c.node?(0,i.jsx)(hn,{blocks:u,node:c.node,selected:c.selected}):null;m.says=(c,f)=>ye(u,J(u,re({graph:f,schema:n},null,c,{slot:"row"}))),e.register(g,{cardinality:"one",fidelity:"glyph"},m)}if(l.page){let u=ie(l.page),m=c=>c.node?(0,i.jsx)(mn,{blocks:u,props:c}):null;m.says=(c,f)=>ye(u,J(u,re({graph:f,schema:n},null,c))),e.register(g,{cardinality:"one",fidelity:"full"},m)}}return e}export{bt as a,jn as b,Dt as c,Gt as d,dn as e,De as f,Te as g,la as h,da as i,ca as j,At as k};
@@ -1,19 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as C,e as re}from"./chunk.V3K32XD7.js";import{e as ee}from"./chunk.CAZX6OPN.js";import{b as S}from"./chunk.PCTVLNOS.js";import{m as X}from"./chunk.4QEDYRES.js";import{Da as J,G as se,Ha as Q,R as Z,ua as V}from"./chunk.JE4QQEJE.js";import{a as K}from"./chunk.SDO3U72B.js";import{O as Y,U as M,ca as U}from"./chunk.UG727PEE.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Re=9,le=40,ge=2;function de(e){let r=new Map;for(let i of e.allNodes())r.set(i.kind,(r.get(i.kind)??0)+1);return r}var ue=(e,r)=>(e.far??[]).reduce((i,a)=>i+(r.get(a)??0),0);function ce(e,r,i){if(i)return i.flatMap(s=>e.filters.filter(u=>u.key===s));let a=de(r),o=new Set(e.filters.filter(s=>s.about==="edge"&&ue(s,a)>le).map(s=>s.key));return e.filters.filter(s=>s.about==="edge"?!o.has(s.key):s.about==="via"?o.has(s.key.split(".")[0]):!0)}function pe(e,r){let i=e.filter(a=>a.about==="field"&&a.type==="choice"&&(a.options?.length??0)>0);return r?i:i.slice(0,ge)}var fe=520;function ye(e,r,i,a){let o=i.filters.find(s=>s.key===a.key);if(!o)return`${a.key}: ${a.value}`;if(o.about==="is")return a.value.charAt(0).toUpperCase()+a.value.slice(1);if(o.about==="via")return`${o.label}: ${S(e.tryDefinition(o.far?.[0]??""),o.key.split(".")[1],a.value)}`;if(o.about==="edge"){if(a.value==="*")return`${o.label}: anything`;if(a.value==="none")return`${o.label}: nothing`;let s=r.getNode(a.value);return`${o.label}: ${s?U(e.tryDefinition(s.kind),s):a.value}`}if(o.type==="date"){let[s,u]=a.value.split(":");return`${o.label} ${s} ${u?Y(u):""}`.trim()}if(o.type==="boolean")return`${o.label}: ${a.value==="true"?"yes":"no"}`;if(o.type==="number"){let s=a.value.lastIndexOf(":"),u=a.value.slice(0,Math.max(0,s));if(u==="at-most"||u==="at-least")return`${o.label}: ${u==="at-most"?"at most":"at least"} ${S(e.tryDefinition(i.kind),o.key,Number(a.value.slice(s+1)))}`}return o.type==="text"?`${o.label}: ${a.value}`:`${o.label}: ${S(e.tryDefinition(i.kind),o.key,a.value)}`}var P=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function me(e){return e?.type==="date"?{asc:"Earliest first",desc:"Latest first"}:e?.type==="number"?{asc:"Lowest first",desc:"Highest first"}:e?.type==="boolean"?{asc:"No first",desc:"Yes first"}:e?.type==="choice"?{asc:"In their order",desc:"In reverse order"}:{asc:"A to Z",desc:"Z to A"}}var x=V(K(()=>(__graviewPreload(import.meta.url,["./chunk.EVHXF7LZ.js","./chunk.ARTJL3X2.js","./chunk.V3K32XD7.js","./chunk.CAZX6OPN.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.P6FGIYWP.js")))),N=x.part((e,r)=>(0,n.jsx)(e.ArrangeLists,{...r}),{what:"This list",quiet:!0}),he=x.part((e,r)=>(0,n.jsx)(e.ArrangeChips,{...r}),{what:"This list",quiet:!0}),Te=()=>x.load(),q=new Map;function Ie(e){let{schema:r,graph:i,kind:a,arrangement:o,onChange:s}=e,u=e.offers??ee(r,a),g=e.testId??"arrange",y=C(e.allow,"sort")&&u.sorts.length>1,m=C(e.allow,"group")&&u.groups.length>0,F=C(e.allow,"filter")?ce(u,i,e.filters):[],L=e.chips?pe(F,e.filters):[],H=F.filter(t=>!L.includes(t)),G=H.length>0,_=e.query!==!1&&e.allow!==!1,w=we(e.noun,e.kept),v=e.past&&e.past.count>0?e.past:null;if(!y&&!m&&!G&&!_&&!w&&!v)return null;let z=t=>JSON.stringify(re(t)),O=`${g}|${a}`,p={current:q.get(O)??{words:new Set,latest:null,at:0}};q.set(O,p.current),p.current.latest&&Date.now()-p.current.at>1500&&!p.current.words.has(z(o))&&(p.current={words:new Set,latest:null,at:0},q.set(O,p.current));let d=p.current.latest??o,b=t=>{let l={...p.current.latest??o,...t};for(let c of Object.keys(l))l[c]===void 0&&delete l[c];p.current.latest=l,p.current.at=Date.now(),p.current.words.add(z(l)),s(l)},f=d.filter??[],R=t=>{let l=f.filter((c,I)=>I!==t);b({filter:l.length>0?l:void 0})},A=t=>f.some(l=>l.key===t.key&&l.value===t.value),te=t=>A(t)?R(f.findIndex(l=>l.key===t.key&&l.value===t.value)):b({filter:[...f,t]}),T=d.sort?u.sorts.find(t=>t.key===d.sort.by):void 0,j=d.group?u.groups.find(t=>t.key===d.group.by):void 0,ne=me(T),k={schema:r,graph:i,offers:{...u,filters:H},arrangement:d,set:b,toggle:te,has:A,testId:g},ae=(t,l)=>A({key:t,value:l})?R(f.findIndex(c=>c.key===t&&c.value===l)):b({filter:[...f.filter(c=>c.key!==t),{key:t,value:l}]}),oe=d.sort?(0,n.jsxs)(n.Fragment,{children:["Sorted by ",P(T?.label??d.sort.by),(0,n.jsx)("span",{"aria-hidden":"true",children:d.sort.direction==="desc"?" \u2193":" \u2191"})]}):"Sort",ie=d.group?.bucket&&j?.buckets?`, a ${d.group.bucket} each`:"",B=d.group?`Grouped by ${P(j?.label??d.group.by)}${ie}`:"Group";return(0,n.jsxs)("div",{"data-testid":`${g}-bar`,role:"group","aria-label":"Arrange",className:"graview-arrange",style:e.style,onPointerEnter:x.prefetch,onFocus:x.prefetch,children:[(0,n.jsx)("style",{children:xe}),(0,n.jsxs)("div",{className:"graview-arrange-line",children:[w?(0,n.jsxs)("span",{className:"graview-arrange-count","data-testid":`${g}-count`,children:[w.kept?(0,n.jsx)("span",{"data-testid":`${g}-kept`,children:w.kept}):null,w.words]}):null,v?(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":`${g}-past`,title:`${M(v.count)} more behind the horizon \u2014 press to widen the view to the past`,onClick:t=>{let l=t.currentTarget.closest("[data-graview-view]"),c=t.currentTarget;v.widen();let I=0,W=()=>{if(document.activeElement!==c&&document.activeElement!==document.body&&c.isConnected)return;let $=l?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if($&&$!==c&&$.isConnected)return $.focus({preventScroll:!0});++I<120&&requestAnimationFrame(W)};requestAnimationFrame(W)},children:["+",M(v.count)," past"]}):null,f.map((t,l)=>{let c=ye(r,i,u,t);return(0,n.jsxs)("span",{className:"graview-arrange-token","data-testid":`${g}-condition`,children:[c,(0,n.jsx)("button",{type:"button","aria-label":`Remove: ${c}`,title:"Remove",onClick:()=>R(l),children:"\xD7"})]},`${t.key}:${t.value}`)}),y?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-sort`,value:d.sort?.by??"",set:d.sort!==void 0,label:"Sort",name:d.sort?`Sorted by ${P(T?.label??d.sort.by)}, ${ne[d.sort.direction].toLowerCase()}`:"Sort",list:t=>(0,n.jsx)(N,{which:"sort",done:t,...k}),children:oe})}):null,m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-group`,value:d.group?.by??"",set:d.group!==void 0,label:"Group",name:B,list:t=>(0,n.jsx)(N,{which:"group",done:t,...k}),children:B})}):null,G?(0,n.jsx)("span",{className:"graview-arrange-part",children:(0,n.jsx)(E,{testId:`${g}-add`,value:"",set:!1,label:"Filter",name:f.length>0?`Filter \u2014 ${f.length} on`:"Filter",list:t=>(0,n.jsx)(N,{which:"filter",done:t,...k}),children:"Filter"})}):null,y||m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-all",children:(0,n.jsx)(E,{testId:`${g}-all`,value:"",set:!1,label:"Arrange",name:"Arrange: sort and group",list:t=>(0,n.jsx)(N,{which:"all",done:t,parts:{sort:y,group:m,filter:!1},...k}),children:"Arrange"})}):null,_?(0,n.jsxs)("label",{className:"graview-arrange-words-at",children:[(0,n.jsx)("span",{style:X,children:"Find"}),(0,n.jsx)("input",{type:"search",className:"graview-arrange-words","data-testid":`${g}-query`,value:d.query??"",placeholder:"Find\u2026",onChange:t=>b({query:t.target.value.length>0?t.target.value:void 0})})]}):null,L.length>0&&e.chips?(0,n.jsx)(h.Suspense,{fallback:null,children:(0,n.jsx)(he,{offers:L,chips:e.chips,schema:r,graph:i,kind:a,arrangement:d,has:A,choose:ae,testId:g})}):null]})]})}function we(e,r){if(!r)return null;let i=r.shown!==r.of;if(!e)return i?{words:"",kept:`${r.shown} of ${r.of}`}:null;let a=r.of===1?e.one:e.many;return i?{words:` ${a}`,kept:`${r.shown} of ${r.of}`}:{words:`${r.of} ${a}`}}function E({testId:e,value:r,set:i,label:a,name:o,list:s,children:u}){let g=Q("arrange",{align:"start"}),y=(0,h.useRef)(null);return(0,h.useEffect)(()=>{g.open&&y.current?.querySelector('[aria-pressed="true"]')?.focus({preventScroll:!0})},[g.open]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":e,"data-set":i?"":void 0,value:r,"aria-label":o,...g.trigger,onClick:g.toggle,children:[u,(0,n.jsx)(be,{})]}),g.open?(0,n.jsx)("div",{...g.pane,ref:m=>{g.pane.ref(m),y.current=m},role:"group","aria-label":a,"data-testid":"arrange-list","data-arrange":e,className:"graview-arrange-list",style:J,onKeyDown:ve,children:s(()=>g.setOpen(!1))}):null]})}function ve(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let r=[...e.currentTarget.querySelectorAll("button:not([disabled]), input")];if(r.length===0)return;let i=r.indexOf(document.activeElement);if(document.activeElement instanceof HTMLInputElement&&document.activeElement.type==="date"&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return;e.preventDefault();let a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowDown"?(i+1)%r.length:(i-1+r.length)%r.length;r[a].focus()}function be(){return(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto",opacity:.7},children:(0,n.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var xe=`
2
- .graview-arrange{container-type:inline-size;box-sizing:border-box;width:100%;min-width:0;max-width:100%}
3
- .graview-arrange-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;font-size:.875rem;line-height:1.35;color:var(--graview-ink-muted)}
4
- .graview-arrange-count{margin-right:2px;color:var(--graview-ink-muted)}
5
- .graview-arrange-part{display:inline-flex;align-items:center;min-width:0}
6
- .graview-arrange-count~.graview-arrange-part::before{content:"\xB7" / "";margin-right:6px;color:var(--graview-ink-muted)}
7
- .graview-arrange-open{display:inline-flex;align-items:center;gap:5px;min-height:28px;min-width:0;max-width:100%;margin:0;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-align:left;color:var(--graview-ink-muted);cursor:pointer}
8
- .graview-arrange-open[data-set]{color:var(--graview-ink)}
9
- .graview-arrange-open:hover,.graview-arrange-open[aria-expanded=true]{border-color:var(--graview-edge);color:var(--graview-ink)}
10
- .graview-arrange :focus-visible,.graview-arrange-list :focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}
11
- .graview-arrange-all{display:none}
12
- @container (max-width: ${fe-1}px){.graview-arrange-one{display:none}.graview-arrange-all{display:inline-flex}}
13
- .graview-arrange-token{display:inline-flex;align-items:center;gap:0;min-width:0;min-height:26px;box-sizing:border-box;padding:0 2px 0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:var(--graview-panel);color:var(--graview-ink);overflow-wrap:anywhere}
14
- .graview-arrange-token button{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:0;padding:0;border:0;border-radius:6px;background:none;font:inherit;line-height:1;color:var(--graview-ink-muted);cursor:pointer}
15
- .graview-arrange-token button:hover{color:var(--graview-ink);background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
16
- .graview-arrange-words-at{display:inline-flex;min-width:0;max-width:100%}
17
- .graview-arrange-words{box-sizing:border-box;width:min(100%,12rem);min-height:28px;margin:0;padding:0 8px;border:1px solid transparent;border-radius:7px;background:transparent;font:inherit;color:var(--graview-ink)}
18
- .graview-arrange-words:hover,.graview-arrange-words:focus{border-color:var(--graview-edge)}
19
- `;function De(e){let r=[];return e.query&&r.push(`\u201C${e.query}\u201D`),e.filter?.length&&r.push(`${e.filter.length} condition${e.filter.length===1?"":"s"}`),e.group&&r.push(`by ${e.group.by}`),e.sort&&r.push(`sorted by ${e.sort.by}`),r.length>0?r.join(" \xB7 "):null}export{Re as a,le as b,ge as c,de as d,ue as e,ce as f,pe as g,fe as h,ye as i,P as j,me as k,Te as l,Ie as m,De as n};
@@ -1 +0,0 @@
1
- import"./chunk.WVUJXDXZ.js";import{a as k,b as q,c as pe}from"./chunk.WVN62OMH.js";import"./chunk.BZ4VZ6WQ.js";import"./chunk.XDPIS7RS.js";import"./chunk.57R4ZUMM.js";import"./chunk.J7ZMNAWB.js";import"./chunk.VKJAGZNU.js";import"./chunk.GZHZLJBF.js";import{n as me}from"./chunk.HG2IO5NS.js";import"./chunk.OJGHDWI6.js";import"./chunk.AQTCN7KQ.js";import"./chunk.LFJH6X6O.js";import"./chunk.VTUMPH4Z.js";import"./chunk.PCTVLNOS.js";import"./chunk.4QEDYRES.js";import{G as Le,M as S,O as ue,R as ce,_ as ge,ba as he}from"./chunk.JE4QQEJE.js";import"./chunk.SDO3U72B.js";import{ja as oe,ma as w,oa as le,qa as E,ra as x,sa as se,ta as Y,vc as de}from"./chunk.UG727PEE.js";import{b as U}from"./chunk.AJZBJBMO.js";var h=U(Le(),1);async function ye(e,n){let i=await createImageBitmap(e);try{let r=Math.min(1,n/Math.max(i.width,i.height)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(i.width*r)),a.height=Math.max(1,Math.round(i.height*r));let l=a.getContext("2d");if(l===null)throw new Error("This browser will not give us a canvas to resize with.");return l.drawImage(i,0,0,a.width,a.height),a}finally{i.close()}}var t=U(ce(),1),Ve=2048,Ie=.85;function _(e){return e<1e3?`${e} bytes`:e<1e6?`${Math.round(e/1e3)} KB`:`${(e/1e6).toFixed(e<1e7?1:0)} MB`}function z(e){if(e.type==="application/pdf")return"PDF";let n=/\.([a-z0-9]{2,5})$/i.exec(e.name??"")?.[1];return n?n.toUpperCase():(e.type.split("/")[1]??e.type).replace(/^x-|^vnd\./,"").split(/[.+-]/)[0].toUpperCase()}function ke(e){let n=[...new Set(e.map(i=>i==="image/*"?"pictures":i==="video/*"?"videos":i==="*/*"||i==="*"?"any file":`${z({type:i})} files`))];return n.length<=1?n[0]??"no files":`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function Fe(e,n){if(e.length===0)return!0;let i=`${n.split("/")[0]}/*`;return e.some(r=>r==="*"||r==="*/*"||r===n||r===i)}var fe=/^image\/hei[cf]$|\.hei[cf]$/i,be=e=>fe.test(e.type)||fe.test(e.name),De={mov:"video/quicktime",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",ogv:"video/ogg"},Be=e=>De[/\.([a-z0-9]{2,4})$/i.exec(e)?.[1]?.toLowerCase()??""];async function je(e,n,i){let r=e.name||(i.camera?"photo.jpg":"file"),a=e.type||(be({type:"",name:r})?"image/heic":Be(r)??"application/octet-stream"),l=be({type:a,name:r}),u=a.startsWith("image/")||l;if(i.image&&!u)return{refused:`\u201C${r}\u201D isn\u2019t a picture.`};if(i.video)return a.startsWith("video/")?K({blob:e,name:r,type:a},n):{refused:`\u201C${r}\u201D isn\u2019t a video.`};if(l||u&&/^image\/(jpeg|webp)$/.test(a)&&(i.camera||e.size>n.maxBytes||e.size>15e5))try{let c=await ye(e,Ve),b=await new Promise(p=>c.toBlob(p,"image/jpeg",Ie));if(b)return K({blob:b,name:l?r.replace(/\.hei[cf]$/i,"")+".jpg":r,type:"image/jpeg",width:c.width,height:c.height},n)}catch{if(l&&!Fe(n.kinds,a))return{refused:`\u201C${r}\u201D is a HEIC photo, which this browser can\u2019t turn into a JPEG and this host doesn\u2019t take. Save it as a JPEG and try again.`}}let y={};if(u&&!l)try{let c=await createImageBitmap(e);y={width:c.width,height:c.height},c.close()}catch{}return K({blob:e,name:r,type:a,...y},n)}function K(e,n){return Fe(n.kinds,e.type)?e.blob.size>n.maxBytes?{refused:`\u201C${e.name}\u201D is ${_(e.blob.size)}; this host takes files up to ${_(n.maxBytes)}.`}:e:{refused:`\u201C${e.name}\u201D is a ${z(e)} file; this host takes ${ke(n.kinds)}.`}}async function _e(e,n,i,r=!1){let a;try{a=await n.upload(e.blob,e.name)}catch(u){let s=u instanceof Error&&u.message.trim()?u.message.trim():"the host refused it";return{refused:`\u201C${e.name}\u201D wasn\u2019t kept: ${s}`}}return le(a)?i&&!E(a)?{refused:`\u201C${e.name}\u201D isn\u2019t a picture.`}:r&&!x(a)?{refused:`The host kept \u201C${e.name}\u201D as ${z(a)}, not as a video.`}:{...a,...a.width===void 0&&e.width?{width:e.width}:{},...a.height===void 0&&e.height?{height:e.height}:{}}:{refused:`The host\u2019s answer for \u201C${e.name}\u201D isn\u2019t a file a record can keep.`}}var F="var(--graview-radius, 8px)",P={color:"var(--graview-ink-muted)",fontSize:"0.8125rem"};function Z(e){let n=S(),i=ue()?.past!=null,[r,a]=(0,h.useState)(!1),l=n?.kept?ze(n,e.href):!0,[,u]=(0,h.useState)(0);return(0,h.useEffect)(()=>{if(typeof l!="object")return;let s=!0;return l.then(()=>s&&u(y=>y+1)),()=>void(s=!1)},[l]),[l===!1||i&&r,()=>a(!0)]}var J=new WeakMap;function ze(e,n){let i=J.get(e)?.get(n);if(i!==void 0)return i;let r;try{r=e.kept(n)}catch{return!0}if(typeof r=="boolean")return r;let a=J.get(e)??new Map;J.set(e,a);let l=Promise.resolve(r).then(u=>u!==!1,()=>!0);return a.set(n,l),l.then(u=>a.set(n,u)),l}function ee({file:e,style:n}){return(0,t.jsx)("span",{role:"img","aria-label":`${k(e)}, removed later`,"data-graview-removed-later":e.href,style:{display:"grid",placeItems:"center",textAlign:"center",padding:4,boxSizing:"border-box",fontSize:"0.6875rem",lineHeight:1.2,color:"var(--graview-ink-muted)",border:"1px dashed var(--graview-edge-bright)",borderRadius:F,...n},children:"removed later"})}function Q({file:e,size:n=56,style:i}){let r=S(),[a,l]=Z(e);return a?(0,t.jsx)(ee,{file:e,style:{width:n,height:n,flex:"none",...i}}):x(e)?(0,t.jsx)(Ae,{file:e,size:n,...i?{style:i}:{},onError:l}):(0,t.jsx)("img",{onError:l,src:w(r,e.href),alt:k(e),width:n,height:n,loading:"lazy",decoding:"async","data-graview-thumb":e.href,style:{width:n,height:n,objectFit:"cover",borderRadius:F,display:"block",flex:"none",background:"var(--graview-edge)",...i}})}function $e(e){let[n,i]=(0,h.useState)({}),r=e.duration??n.duration;return[{...r!==void 0?{duration:r}:{},width:e.width??n.width,height:e.height??n.height},u=>{let s=u.currentTarget;i({...Number.isFinite(s.duration)&&s.duration>0?{duration:s.duration}:{},...s.videoWidth>0&&s.videoHeight>0?{width:s.videoWidth,height:s.videoHeight}:{}})}]}var Ne=320,xe=(e,n)=>`${k(e)}, ${se({...n!==void 0?{duration:n}:{}})}`,Oe=(0,t.jsx)("span",{"data-graview-play-glyph":"","aria-hidden":"true",style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",width:"40%",height:"40%",style:{maxWidth:40,maxHeight:40,filter:"drop-shadow(0 1px 2px rgb(0 0 0 / 0.5))"},children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"11",fill:"rgb(0 0 0 / 0.55)"}),(0,t.jsx)("path",{d:"M9.5 7.5v9l7-4.5z",fill:"#fff"})]})});function Ae({file:e,size:n,style:i,onError:r}){let a=S(),[l,u]=$e(e),s={width:n,height:n,objectFit:"cover",display:"block",borderRadius:F,background:"var(--graview-edge)"};return(0,t.jsxs)("span",{role:"img","aria-label":xe(e,l.duration),"data-graview-thumb":e.href,"data-graview-video-thumb":"",style:{position:"relative",display:"block",width:n,height:n,flex:"none",...i},children:[e.poster?(0,t.jsx)("img",{src:w(a,e.poster),alt:"",width:n,height:n,loading:"lazy",decoding:"async",onError:r,style:s}):(0,t.jsx)("video",{src:w(a,e.href),preload:"metadata",muted:!0,playsInline:!0,"aria-hidden":"true",tabIndex:-1,width:n,height:n,onLoadedMetadata:u,onError:r,style:s}),Oe,l.duration!==void 0?(0,t.jsx)("span",{"data-graview-video-clock":"","aria-hidden":"true",style:{position:"absolute",right:3,bottom:3,padding:"0 4px",borderRadius:4,background:"rgb(0 0 0 / 0.65)",color:"#fff",fontSize:"0.6875rem",lineHeight:"16px",fontVariantNumeric:"tabular-nums"},children:q(l.duration)}):null]})}function Ge({file:e}){let n=S(),[i,r]=Z(e),[a,l]=$e(e);if(i)return(0,t.jsx)(ee,{file:e,style:{width:"100%",aspectRatio:"16 / 9"}});let u=a.width!==void 0&&a.height!==void 0;return(0,t.jsxs)("figure",{"data-graview-video-figure":e.href,style:{margin:0,display:"grid",gap:4,minWidth:0},children:[(0,t.jsx)("video",{"data-graview-video":e.href,src:w(n,e.href),...e.poster?{poster:w(n,e.poster)}:{},controls:!0,preload:"metadata",playsInline:!0,...u?{width:a.width,height:a.height}:{},"aria-label":xe(e,a.duration),onLoadedMetadata:l,onError:r,style:{display:"block",width:"100%",maxWidth:u?Math.max(a.width,Ne):"100%",height:"auto",maxHeight:"80vh",aspectRatio:u?`${a.width} / ${a.height}`:"16 / 9",borderRadius:F,background:"#000"},children:e.captions?(0,t.jsx)("track",{kind:"captions",src:w(n,e.captions),srcLang:"en",label:"Captions",default:!0}):null}),(0,t.jsx)("figcaption",{"data-graview-video-said":"",style:P,children:[e.caption??e.name,...a.duration!==void 0?[q(a.duration)]:[]].join(" \xB7 ")})]})}function Ue({file:e,onOpen:n}){let i=S(),[r,a]=Z(e);return r?(0,t.jsx)(ee,{file:e,style:{width:"100%",aspectRatio:"1"}}):(0,t.jsx)("button",{type:"button","aria-label":`Open ${k(e)} full size`,onClick:l=>n(l.currentTarget),style:{padding:0,border:0,background:"none",cursor:"zoom-in",display:"block",width:"100%",borderRadius:F},children:(0,t.jsx)("img",{src:w(i,e.href),alt:k(e),loading:"lazy",decoding:"async",onError:a,style:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:F,display:"block",background:"var(--graview-edge)"}})})}function X({files:e,label:n}){let i=S(),r=d=>w(i,d.href),a=e.filter(E),l=e.filter(x),u=e.filter(d=>!E(d)&&!x(d)),[s,y]=(0,h.useState)(null),c=(0,h.useRef)(null),b=(0,h.useRef)(null);(0,h.useEffect)(()=>{let d=c.current;s!==null&&d&&!d.open&&d.showModal?.()},[s]);let p=s===null?void 0:a[s];return(0,t.jsxs)("div",{style:{display:"grid",gap:10,minWidth:0},children:[a.length>0?(0,t.jsx)("ul",{"data-graview-gallery":"","aria-label":n,style:{listStyle:"none",margin:0,padding:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:8},children:a.map((d,T)=>(0,t.jsx)("li",{style:{minWidth:0},children:(0,t.jsx)(Ue,{file:d,onOpen:R=>{b.current=R,y(T)}})},d.href))}):null,l.length>0?(0,t.jsx)("ul",{"data-graview-videos":"","aria-label":n,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:12},children:l.map(d=>(0,t.jsx)("li",{style:{minWidth:0},children:(0,t.jsx)(Ge,{file:d})},d.href))}):null,u.length>0?(0,t.jsx)("ul",{"data-graview-documents":"",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:10},children:u.map(d=>(0,t.jsxs)("li",{"data-graview-document":d.type,style:{display:"grid",gap:6,minWidth:0},children:[d.type==="application/pdf"?(0,t.jsx)("object",{data:r(d),type:"application/pdf","aria-label":k(d),style:{width:"100%",height:420,border:"1px solid var(--graview-edge)",borderRadius:F},children:(0,t.jsxs)("p",{style:{margin:0,padding:12},children:["This browser shows no PDF here: ",(0,t.jsxs)("a",{href:r(d),download:d.name,children:["download ",d.name]}),"."]})}):null,(0,t.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",gap:"2px 10px",alignItems:"baseline",minWidth:0,overflowWrap:"anywhere"},children:[(0,t.jsx)("a",{href:r(d),download:d.name,...d.type==="application/pdf"?{target:"_blank",rel:"noopener"}:{},children:d.name}),(0,t.jsxs)("span",{style:P,children:[z(d)," \xB7 ",_(d.bytes)]})]}),d.caption?(0,t.jsx)("span",{style:P,children:d.caption}):null]},d.href))}):null,p?(0,t.jsx)("dialog",{ref:c,"data-graview-full":p.href,"aria-label":k(p),onClose:()=>{y(null),b.current?.focus()},onClick:d=>{d.target===d.currentTarget&&d.currentTarget.close()},style:{padding:0,border:0,borderRadius:F,maxWidth:"min(96vw, 1600px)",maxHeight:"94vh",background:"var(--graview-panel)",color:"var(--graview-ink)"},children:(0,t.jsxs)("figure",{style:{margin:0,display:"grid",gap:8,padding:10},children:[(0,t.jsx)("img",{src:r(p),alt:k(p),style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block",margin:"0 auto"}}),(0,t.jsxs)("figcaption",{style:{display:"flex",gap:12,alignItems:"center",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:p.caption??p.name}),(0,t.jsx)("form",{method:"dialog",style:{margin:0},children:(0,t.jsx)("button",{type:"submit",autoFocus:!0,children:"Close"})})]})]})}):null]})}function Se({value:e,onChange:n,several:i,image:r,video:a=!1,label:l,thumbs:u=!0}){let s=S(),y=(0,h.useId)(),c=(0,h.useRef)(null),b=(0,h.useRef)(null),[p,d]=(0,h.useState)(null),[T,R]=(0,h.useState)(null),[te,H]=(0,h.useState)([]),[N,O]=(0,h.useState)(!1),W=r?"image/":a?"video/":void 0,C=s?W?s.kinds.filter(o=>o.startsWith(W)||o==="*"||o==="*/*"):s.kinds:[],Pe=s?s.kinds.length===0||C.length>0:!1,Re=!a&&(s?s.kinds.length===0||(r?C:s.kinds).some(o=>o.startsWith("image/")||o.startsWith("*")):!1),ne=!!s&&s.maxBytes>0,L=ne&&(!W||Pe),V=r?"picture":a?"video":"file",ae=i?`${V}s`:`a ${V}`,ie=W?C.length>0?C.join(","):`${W}*`:s?.kinds.join(",")||void 0,We=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches,A=(0,h.useRef)(e);A.current=e;let re=(0,h.useRef)(null),I=(0,h.useRef)(null);(0,h.useEffect)(()=>{let o=I.current;if(!o||o.from===e)return;I.current=null;let g=re.current?.children,f=g?.[Math.min(o.at,g.length-1)];((o.what==="move"?f?.querySelector("[data-graview-file-move]"):null)??f?.querySelector("[data-graview-file-remove]")??c.current?.parentElement?.querySelector("[data-graview-file-choose]"))?.focus()});let D=async(o,g)=>{if(!s||o.length===0)return;let f=i?o:o.slice(0,1),m=[],$=[];f.length<o.length&&$.push(`${l} holds one ${V}, so ${o.slice(1).map(v=>`\u201C${v.name||"the photo"}\u201D`).join(", ")} ${o.length>2?"were":"was"} left out.`),H([]),R(null);for(let v of f){d(`Sending ${v.name||"the photo"}\u2026`);let G=await je(v,s,{image:r,video:a,camera:g==="camera"});if("refused"in G){$.push(G.refused);continue}let M=await _e(G,s,r,a);"refused"in M?$.push(M.refused):[...i?A.current:[],...m].some(He=>He.href===M.href)?$.push(`\u201C${M.name}\u201D is already here.`):m.push(M)}if(d(null),H($),m.length!==0)try{n(i?[...A.current,...m]:m.slice(-1)),R(`Added ${m.map(v=>v.name).join(", ")}.`)}catch(v){H([...$,v instanceof Error?v.message:String(v)])}},B=(o,g,f)=>{try{I.current=f?{...f,from:e}:null,n(o),R(g)}catch(m){I.current=null,H([m instanceof Error?m.message:String(m)])}},j=o=>o?Array.from(o):[],Me=o=>{let g=j(o.clipboardData?.files);!L||g.length===0||(o.preventDefault(),D(g,"pasted"))},Te=o=>{O(!1),L&&(o.preventDefault(),D(j(o.dataTransfer?.files),"dropped"))};return(0,t.jsxs)("div",{role:"group","aria-labelledby":`${y}-label`,"data-graview-file-editor":"","data-graview-dropping":N?"":void 0,onPaste:Me,onDragOver:o=>{L&&(o.preventDefault(),O(!0))},onDragLeave:()=>O(!1),onDrop:Te,style:{display:"grid",gap:8,minWidth:0,padding:N?6:0,outline:N?"2px dashed var(--graview-accent)":"none",borderRadius:F},children:[(0,t.jsx)("span",{id:`${y}-label`,style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},children:l}),e.length>0&&(i||e.length>1)?(0,t.jsx)("ul",{ref:re,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:6},children:e.map((o,g)=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",minWidth:0},children:[u&&(E(o)||x(o))?(0,t.jsx)(Q,{file:o,size:40}):null,(0,t.jsx)("span",{style:{flex:"1 1 8rem",minWidth:0,overflowWrap:"anywhere"},children:o.name}),(0,t.jsx)(we,{file:o,onCaption:f=>B(e.map((m,$)=>$===g?ve(m,f):m),f?`${o.name} now says \u201C${f}\u201D.`:`${o.name} says its name again.`)}),i&&g>0?(0,t.jsx)("button",{type:"button","data-graview-file-move":"","aria-label":`Move ${o.name} earlier`,onClick:()=>B(e.map((f,m)=>m===g-1?o:m===g?e[g-1]:f),`Moved ${o.name} earlier.`,{at:g-1,what:"move"}),children:"\u2191"}):null,i?(0,t.jsx)("button",{type:"button","data-graview-file-remove":"","aria-label":`Remove ${o.name}`,onClick:()=>B(e.filter((f,m)=>m!==g),`Removed ${o.name}.`,{at:g,what:"remove"}),children:"Remove"}):null]},`${g}:${o.href}`))}):e.length===1?(0,t.jsx)(we,{file:e[0],onCaption:o=>B([ve(e[0],o)],o?`${e[0].name} now says \u201C${o}\u201D.`:`${e[0].name} says its name again.`)}):null,L?(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{ref:c,type:"file",hidden:!0,multiple:i,...ie?{accept:ie}:{},"data-graview-file-input":"","aria-label":`Choose ${ae}`,onChange:o=>{let g=j(o.currentTarget.files);o.currentTarget.value="",D(g,"picked")}}),(0,t.jsx)("button",{type:"button",disabled:p!==null,onClick:()=>c.current?.click(),"data-graview-file-choose":"",children:e.length>0&&!i?`Replace the ${V}`:`Choose ${ae}`}),Re?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:b,type:"file",hidden:!0,accept:"image/*",capture:"environment","data-graview-photo-input":"","aria-label":"Take a photo",onChange:o=>{let g=j(o.currentTarget.files);o.currentTarget.value="",D(g,"camera")}}),We?(0,t.jsx)("button",{type:"button",disabled:p!==null,onClick:()=>b.current?.click(),children:"Take a photo"}):null]}):null,(0,t.jsxs)("span",{style:P,"data-graview-file-takes":"",children:["or drop or paste ",i?"them":"it"," here \xB7 ",s.kinds.length>0?ke(C.length>0?C:s.kinds):"any file",", up to ",_(s.maxBytes)]})]}):(0,t.jsx)("p",{style:{...P,margin:0},"data-graview-file-none":"",children:ne?`This host doesn\u2019t take ${a?"videos":"pictures"}, so none can be added here.`:"This host doesn\u2019t take files, so none can be added here."}),(0,t.jsx)("p",{"aria-live":"polite",style:{...P,margin:0,minHeight:p||T?void 0:0},"data-graview-file-status":"",children:p??T??""}),te.length>0?(0,t.jsx)("div",{role:"alert","data-graview-file-refused":"",style:{color:"var(--graview-warn)",fontSize:"0.875rem",display:"grid",gap:2},children:te.map((o,g)=>(0,t.jsx)("p",{style:{margin:0},children:o},g))}):null]})}var ve=(e,n)=>{let{caption:i,...r}=e;return n?{...r,caption:n}:r};function we({file:e,onCaption:n}){let[i,r]=(0,h.useState)(e.caption??"");(0,h.useEffect)(()=>r(e.caption??""),[e.caption]);let a=()=>{let l=i.trim().slice(0,500);l!==(e.caption??"")&&n(l)};return(0,t.jsx)("input",{type:"text",value:i,placeholder:E(e)||x(e)?"What it shows":"What it is","aria-label":`What ${e.name} ${E(e)||x(e)?"shows":"is"}`,"data-graview-file-caption":e.href,onChange:l=>r(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a())},style:{flex:"1 1 10rem",minWidth:0,font:"inherit",fontSize:"0.875rem",minHeight:24}})}function Ee({field:e,label:n,labelStyle:i,valueStyle:r,style:a,children:l}){return(0,t.jsxs)("div",{"data-graview-files":e,style:{display:"grid",gap:6,minWidth:0,gridColumn:"1 / -1",...a},children:[(0,t.jsx)("dt",{style:i,children:n}),(0,t.jsx)("dd",{style:{margin:0,minWidth:0,display:"grid",gap:10,...r},children:l})]})}function Ce(e){let{nodeId:n,field:i,label:r,files:a}=e,{fields:l,commit:u}=me(n),s=l.find(p=>p.field===i&&p.takesValue),y=s?.shape,c=y?.type==="several"?y.of:y,b=y?.type==="several";return a.length===0&&c?.type!=="file"?null:(0,t.jsxs)(Ee,{...e,children:[(0,t.jsx)(X,{files:a,label:r}),s&&c?.type==="file"?(0,t.jsx)(Se,{value:a,thumbs:!1,several:b,image:c.image===!0,video:c.video===!0,label:r,onChange:p=>{let d=b?p:p[p.length-1];d!==void 0&&u(s,d)}}):null]})}function tt(e){switch(e.as){case"field":return e.read?e.files.length>0?(0,t.jsx)(Ee,{...e,children:(0,t.jsx)(X,{files:e.files,label:e.label})}):null:(0,t.jsx)(Ce,{...e});case"unfilled":return(0,t.jsx)(Ye,{...e});case"thumb":return(0,t.jsx)(Q,{...e});case"block":return e.files.length>0?(0,t.jsx)("span",{className:"graview-spec-image","data-graview-field":e.field,"data-graview-image":e.view,style:{display:"block",minWidth:0,...e.view==="gallery"?{position:"relative",zIndex:de.raised}:{}},children:e.view==="thumb"?(0,t.jsx)(Q,{file:e.files[0],size:72}):(0,t.jsx)(X,{files:e.files,label:e.label})}):null;case"control":{let n=(0,t.jsx)(Se,{value:Y(e.value),several:e.several,image:e.image,video:e.video===!0,label:e.label,onChange:i=>e.onChange(e.several?i:i[i.length-1])});return e.title===void 0?n:(0,t.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.several?"files":"file",children:[(0,t.jsx)("legend",{"data-graview-part":"label",children:e.title}),n]})}}}function Ye({nodeId:e,skip:n,labels:i,labelStyle:r,style:a}){let{store:l}=ge(),u=he(e),s=u?l.schema.tryDefinition(u.kind):void 0,y=pe(s).filter(c=>!n.includes(c)&&!(s?.display?.hide??[]).includes(c)&&Y(u?.[c]).length===0);return y.length===0?null:(0,t.jsx)("dl",{style:{margin:0,display:"grid",gap:14,minWidth:0},children:y.map(c=>(0,t.jsx)(Ce,{nodeId:e,field:c,label:i?.[c]??oe(s,c),files:[],...r?{labelStyle:r}:{},...a?{style:a}:{}},c))})}export{Se as FilesEditor,Ve as SEND_EDGE,tt as drawFiles,ke as kindsWords,je as prepare,_e as send,_ as sizeWords,Fe as takes,z as typeWords};
@@ -1 +0,0 @@
1
- import{a as v}from"./chunk.TI4OSTQV.js";import"./chunk.AJZBJBMO.js";function N(e,n){let r;for(let o of[...e??[]].sort((a,s)=>a.seq-s.seq)){if(o.seq>n)break;o.declaration&&(r=o.declaration)}return r}var P=new WeakMap;function B(e,n){let r=N(e?.declarations,n),o=e?.declarationAt,a=[...e?.declarations??[]].filter(i=>i.seq<=n).sort((i,d)=>i.seq-d.seq).at(-1);if(!o||!a||a.declaration)return{declaration:r};let s=P.get(o);s||P.set(o,s=new Map);let t=s.get(a.seq);if(!t){let i={settled:!0,declaration:void 0,waiting:Promise.resolve()};try{let d=o(a.seq);d instanceof Promise?(i.settled=!1,i.waiting=d.then(f=>void Object.assign(i,{settled:!0,declaration:f}),()=>void(i.settled=!0))):i.declaration=d}catch{}s.set(a.seq,t=i)}return t.settled?{declaration:t.declaration??r}:{waiting:t.waiting}}var G=e=>e,q=new WeakMap,D=new WeakMap;function E(e,n){let r=typeof n=="string"?Date.parse(n):n.getTime();if(Number.isNaN(r))throw new RangeError(`\u201C${String(n)}\u201D is not a time`);let a=e.log.all().findIndex(s=>Date.parse(s.at)>r);return a===-1?e.log.length:e.log.horizon+a}function H(e,n,r={}){let o=v(e);if(o)return H(o.store,n,r).seenBy(o.principal);let a=e.log,s=a.horizon,t=typeof n=="number"?n:E(e,n);if(!Number.isInteger(t)||t<s||t>a.length)throw new RangeError(`No moment at seq ${t}: this store holds seqs ${s} to ${a.length}${s>0?"; what is before its horizon is in the archive":""}`);let i=a.all(),d=r.declaration,f=d?.schema??e.schema,p=a.epochs().filter(c=>c.seq<=t),l=p.at(-1),u=l?.seq??s,A=c=>c>s?i[c-1-s]?.id:void 0,m=(q.get(e)??[]).filter(c=>c.seq<=a.length&&A(c.seq)===c.id);q.set(e,m);let w=[...m].reverse().find(c=>c.seq>=u&&c.seq<=t),g=w?.seq??u,K=w?.base??l?.base??F(e),S=I(e,f,K),M=e.pastEvery,O=(c,y)=>{m.some(b=>b.seq===c)||(m.push({seq:c,id:y,base:S.snapshot()}),m.sort((b,W)=>b.seq-W.seq))};for(let c=g;c<t;c++){let y=i[c-s];try{R(S,y)}catch{}(c+1)%M===0&&c+1<t&&O(c+1,y.id)}t-g>=M&&O(t,A(t));let V=i[t-1-s]?.at??l?.at;return j(e,d,{graph:S,log:i.slice(0,t-s),epochs:p,...s>0&&!p.some(c=>c.horizon)?{horizon:s}:{},seq:t,at:V,from:g})}var h=(e,n)=>n===void 0?{}:{[e]:n};function j(e,n,r){let o=G(e),a=e.constructor;return new a({schema:n?.schema??e.schema,invariants:n?.invariants??o.invariants,invariantOptions:o.invariantOptions,...h("policy",n?n.policy:e.policy),...h("modules",n?.modules??o.declaredModules),...h("enabledModules",o.startingModules),...h("timeZone",e.timeZone),intelligence:e.intelligence,principal:o.by,log:[...r.log],epochs:[...r.epochs],...h("horizon",r.horizon),snapshot:r.graph.snapshot(),validate:!1,now:o.now,past:{seq:r.seq,...h("at",r.at),foldedFrom:r.from,folded:r.seq-r.from}})}function I(e,n,r){let o=e.graph.constructor;try{return o.from(n,r,{validate:G(e).validate})}catch{return o.from(n,r,{validate:!1})}}var z=256,x=new WeakMap;function $(e){let n=x.get(e);return n||x.set(e,n={ops:new Map,epochs:new Map,chunks:new Map,marks:new Map}),n}function k(e,n){let r=-1,o;for(let[i,d]of e.epochs)i<=n&&i>r&&([r,o]=[i,d.base]);for(let[i,d]of e.marks)i<=n&&i>r&&([r,o]=[i,d]);let a=-1;for(let i=n-1;i>=Math.max(r,0);i--)if(!e.ops.has(i)){a=i;break}if(a<0&&o)return{from:r,base:o};let s=a<0?0:a-a%z,t=e.chunks.get(s);return!t||t.settled&&!t.refused&&a>=t.to?{ask:s}:t.settled?t.refused?{refused:t.refused}:a<0?{from:0,base:{nodes:[],edges:[]}}:{refused:`The archive is missing a change this moment needs (seq ${a})`}:{waiting:t.waiting}}function T(e,n,r,o){let a=Math.min(r+z,o),s={to:a,settled:!1,waiting:Promise.resolve()};s.waiting=Promise.resolve().then(()=>n(r,a)).then(t=>{let i=Array.isArray(t)?{ops:t}:t;if(!Array.isArray(i?.ops))throw new Error("its answer held no ops");for(let d of i.ops)Number.isInteger(d?.seq)&&d.seq<o&&!e.ops.has(d.seq)&&e.ops.set(d.seq,d);for(let d of i.epochs??[])Number.isInteger(d?.seq)&&d.seq<o&&d.base&&e.epochs.set(d.seq,d)}).then(()=>void(s.settled=!0),t=>void Object.assign(s,{settled:!0,refused:`Could not read the older changes from the archive: ${t instanceof Error?t.message:String(t)}`})),e.chunks.set(r,s)}function Z(e,n,r){let o=r?.archived,a=e.log.horizon;if(!o||n>=a)return;let s=$(o),t=k(s,n);return"ask"in t&&(T(s,o,t.ask,a),t=k(s,n)),"base"in t||"ask"in t?void 0:{seq:n,...t}}function C(e,n,r,o){let a=v(e);if(a)return C(a.store,n,r,o).seenBy(a.principal);if(!Number.isInteger(n)||n<0)throw new RangeError(`No moment at seq ${n}`);let s=$(r),t=k(s,n);if(!("base"in t))throw new RangeError("refused"in t?t.refused:`The changes before seq ${n} are still being read from the archive`);let i=I(e,o?.schema??e.schema,t.base),d=[],f=e.pastEvery;for(let l=t.from;l<n;l++){let u=s.ops.get(l);d.push(u);try{R(i,u)}catch{}(l+1)%f===0&&l+1<n&&!s.marks.has(l+1)&&s.marks.set(l+1,i.snapshot())}n-t.from>=f&&s.marks.set(n,i.snapshot());let p=s.epochs.get(t.from);return j(e,o,{graph:i,log:d,epochs:p?[p]:[],...t.from>0?{horizon:t.from}:{},seq:n,at:d.at(-1)?.at??p?.at,from:t.from})}function F(e){let n=e.log.all(),r=e.log.horizon,o=n[0]?.id,a=D.get(e);if(a&&a.firstId===o)return a.base;let s=e.log.epochs().find(d=>d.seq>r),t=e.graph.constructor.from(e.schema,s?.base??e.graph.snapshot(),{validate:!1});for(let d=(s?.seq??e.log.length)-1;d>=r;d--)try{t.applyPrimitives(n[d-r].inverse,{restoring:!0})}catch{}let i=t.snapshot();return D.set(e,{firstId:o,base:i}),i}function _(e,n,r={}){let o=typeof n=="number"?n:E(e,n),a=B(r,o),s="declaration"in a?a.declaration:N(r.declarations,o);return r.archived&&o<e.log.horizon?C(e,o,r.archived,s):H(e,o,{declaration:s})}function R(e,n){if(n.undoes!==void 0){e.applyPrimitives(n.primitives,{restoring:!0});return}try{e.applyPrimitives(n.primitives)}catch{e.applyPrimitives(n.primitives,{restoring:!0})}}export{Z as askArchived,B as askDeclaration,N as declarationAt,_ as pastAt,H as pastOf,E as seqAt};
@@ -1 +0,0 @@
1
- import"./chunk.4QEDYRES.js";import{G as W,R as x}from"./chunk.JE4QQEJE.js";import"./chunk.SDO3U72B.js";import"./chunk.UG727PEE.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function L({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{L as WhenMonth};
@@ -1 +0,0 @@
1
- import{a as r,b as m,d as k,e as h}from"./chunk.UGFDSE37.js";import"./chunk.4QEDYRES.js";import"./chunk.JE4QQEJE.js";import"./chunk.SDO3U72B.js";import"./chunk.UG727PEE.js";import"./chunk.AJZBJBMO.js";var o="way-back",b='[data-testid="notices-toasts"]';function g(t){let a=document.activeElement;a!==null&&a!==document.body&&!a.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function w(t,a,i,d,y){if(t.past)return i?.dismiss(o),()=>{};let c=y?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,a)?.batch!==e)return!1;try{let n=k(t,a);return n&&i?.notify({kind:"toast",id:o,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return i?.notify({kind:"toast",id:o,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,a,d);if(d=t.batches().length,e){let n=s=e.batch;i?.notify({kind:"toast",id:o,sentence:e.intent,timeout:1e4,action:{label:"Take back",onSelect:()=>(g(c),f(n))}})}else s&&r(t,a)?.batch!==s&&(s=void 0,i?.dismiss(o))},l=e=>{h(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&i?.dismiss(o)}}export{w as sceneWay};
@@ -1 +0,0 @@
1
- import{q as ce}from"./chunk.CAZX6OPN.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.LWAZ6ZO6.js";import{a as ie,b as ne,c as ae}from"./chunk.V5VQCANB.js";import"./chunk.UT6642FC.js";import"./chunk.WERBD5ZR.js";import"./chunk.HAY22FPJ.js";import{a as X}from"./chunk.U6YOAS4X.js";import"./chunk.TI4OSTQV.js";import"./chunk.BZ4VZ6WQ.js";import"./chunk.LFJH6X6O.js";import"./chunk.VTUMPH4Z.js";import"./chunk.PCTVLNOS.js";import{e as _,m as J}from"./chunk.4QEDYRES.js";import{G as me,J as U,R as V,_ as j}from"./chunk.JE4QQEJE.js";import"./chunk.SDO3U72B.js";import{ga as B,wc as Y}from"./chunk.UG727PEE.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=s=>s.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,""),W=(s,p)=>{let r=ge(s);return p.every(t=>r.includes(t))},pe=s=>s&&`${s[0].toLowerCase()}${s.slice(1)}`,I={act:4,show:3,place:3,record:4},we=360,h=12;function Oe({face:s,opening:p,close:r}){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,L]=(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,s);r(),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,s,r]),F=(0,a.useCallback)(e=>{if(e.open.length>0){let i=E.current?.getBoundingClientRect();r(),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){L(i instanceof Error?i.message:String(i))}},[t.store,t.principal,r,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),L(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,I.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:()=>{r(),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,I.show))x.push({id:g.id,kind:"show",label:`Show ${pe(g.label)}`,hint:"a panel",take:()=>{r(),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,I.place))x.push({id:`place:${o.as}`,kind:"place",label:`Go to ${o.title}`,take:()=>(r(),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:I.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:()=>(r(),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,r,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,s)),i=requestAnimationFrame(c)};return c(),()=>cancelAnimationFrame(i)},[n,s]),(0,a.useEffect)(()=>{if(l)return;let e=i=>{i.target instanceof Node&&E.current?.contains(i.target)||r()};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[l,r]);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":s,"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,r).then(i=>{i&&R.current&&L(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(s,p,r){let t=s?.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(s?.contains(f))continue;let u=f.getBoundingClientRect();if(u.width>0&&u.height>0)return f}return r==="pages"?t.querySelector("main [data-graview-page-title]")??t.querySelector("main h1"):null}function be(s,p){let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(we,r.width-2*h),v=s.getBoundingClientRect().height,n=p?.getBoundingClientRect(),f,u,y,b=A=>Math.max(h,Math.min(A,r.height-v-h));if(n&&n.width>0&&n.bottom>0&&n.top<r.height)if(n.right+h+t<=r.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,r.width-t-h));let A=n.bottom+h;u=A+v<=r.height-h?A:b(n.top-h-v),y=A+v<=r.height-h?"below":"above"}else f=(r.width-t)/2,u=b(72),y="top";let m=s.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":"");s.getAttribute("data-quick-ask-beside")!==$&&s.setAttribute("data-quick-ask-beside",$),s.getAttribute("data-quick-ask-side")!==y&&s.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 +0,0 @@
1
- import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p}from"./chunk.EVHXF7LZ.js";import{a,b}from"./chunk.ARTJL3X2.js";import"./chunk.V3K32XD7.js";import"./chunk.CAZX6OPN.js";import"./chunk.LFJH6X6O.js";import"./chunk.VTUMPH4Z.js";import"./chunk.PCTVLNOS.js";import"./chunk.4QEDYRES.js";import"./chunk.JE4QQEJE.js";import"./chunk.SDO3U72B.js";import"./chunk.UG727PEE.js";import"./chunk.AJZBJBMO.js";export{j as ARRANGE_NARROW,o as ArrangeBar,e as CHIP_FIELDS,d as MANY_AT_THE_FAR_END,c as TYPED_FROM,p as arrangementCaption,a as arrangementOf,i as chipOffers,m as directionWords,g as farCount,f as farCounts,l as inSentence,h as offeredFilters,n as preloadArrangeLists,k as sayCondition,b as withArrangement};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{l as k,n as M,o as I,p as B,s as P}from"./chunk.LFJH6X6O.js";import"./chunk.VTUMPH4Z.js";import"./chunk.PCTVLNOS.js";import"./chunk.4QEDYRES.js";import{G as te,R as W,ua as q}from"./chunk.JE4QQEJE.js";import{a as L}from"./chunk.SDO3U72B.js";import"./chunk.UG727PEE.js";import{b as h}from"./chunk.AJZBJBMO.js";var r=h(te(),1);var A=h(W(),1),U=q(L(()=>(__graviewPreload(import.meta.url,["./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.GN2SZEFH.js")))),v={Part:U.part((n,t)=>(0,A.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>U.prefetch()};var o=h(W(),1),z="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function K(n,t,d,p=!1){let S=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),g={weekday:p?"long":"short",year:"numeric",month:p?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},m;try{m=new Intl.DateTimeFormat(d??"en-US",g)}catch{m=new Intl.DateTimeFormat("en-US",g)}return m.format(S).replace(/ /g," ")}function ce({value:n,time:t,instant:d=!1,label:p,name:S,required:g,autoFocus:m,autoSelect:H,locale:s,onChange:j,onLeave:_,onCancel:V,inputRef:w,boxStyle:Z}){let x=(0,r.useId)(),u=(0,r.useRef)(null),D=(0,r.useRef)(null),b=e=>{let a=M(e);return a?K(a,t,s):e??""},[T,C]=(0,r.useState)(()=>b(n)),[F,y]=(0,r.useState)(!1),[G,E]=(0,r.useState)(n),[J,Q]=(0,r.useState)(n);n!==J&&(Q(n),n!==G&&(E(n),C(b(n)))),(0,r.useEffect)(()=>{H&&(u.current?.focus(),u.current?.select())},[H]);let i=t&&d?B(s):void 0,N=T===b(n),l=M(n),c=N?l:P(T,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}}),X=N?n:c?I(c,{time:t,instant:d}):void 0,$=T.trim()==="",f=!$&&c===void 0;(0,r.useEffect)(()=>{u.current?.setCustomValidity(f?`Not a date this reads \u2014 ${z}`:"")},[f]);let O=e=>{E(e),j(e)},Y=e=>{C(e);let a=e.trim()===""?void 0:P(e,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}});O(a?I(a,{time:t,instant:d}):void 0)},ee=e=>{let a=t?{day:e,minutes:c?.minutes??l?.minutes??540}:{day:e},R=I(a,{time:t,instant:d});C(b(R)),O(R),y(!1),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},ne=$?`Type a date, or pick one \u2014 ${z}`:f?`Not a date this reads \u2014 ${z}`:c?`${K(c,t,s,!0)}${i?` ${i.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?d?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(y(!1),_?.(X))},children:[(0,o.jsx)("input",{ref:e=>{u.current=e,typeof w=="function"?w(e):w&&(w.current=e)},type:"text",name:S,required:g,autoFocus:m,"aria-label":p,"aria-describedby":`${x}-said`,"aria-invalid":f||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:T,"data-graview-part":"control",onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),V?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),y(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Z}}),(0,o.jsx)("button",{ref:D,type:"button","aria-label":`Pick a date for ${p}`,"aria-expanded":F,"aria-controls":`${x}-month`,"data-graview-part":"when-pick",onClick:()=>y(e=>!e),onPointerEnter:()=>v.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${x}-said`,"aria-live":"polite","data-graview-part":"when-said",...i?{"data-graview-zone":i.zone,title:`Times are in ${i.zone.replace(/_/g," ")} (${i.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:f?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ne,i&&!f&&!$?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(i.zone.split("/").at(-1)??i.zone).replace(/_/g," ")} time`}):null]}),F?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(v.Part,{id:`${x}-month`,label:p,selected:c?.day??l?.day,today:k().day,locale:s,onPick:ee,onClose:()=>{y(!1),D.current?.focus()}})}):null]})}export{ce as WhenInput,K as wallAsRead};
@@ -1,25 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ke}from"./chunk.SDO3U72B.js";import{$b as Dn,Fa as _n,Hc as jn,J as Cn,Ja as mt,Kc as Gn,La as Ln,Nc as Wn,Wa as Hn,ad as Fn,pd as Kn,ud as Fe,vd as gt,wc as Nn}from"./chunk.UG727PEE.js";import{a as We,b as _}from"./chunk.AJZBJBMO.js";var lo=We(w=>{"use strict";var At=Symbol.for("react.transitional.element"),Tr=Symbol.for("react.portal"),Mr=Symbol.for("react.fragment"),Or=Symbol.for("react.strict_mode"),Vr=Symbol.for("react.profiler"),Ir=Symbol.for("react.consumer"),Cr=Symbol.for("react.context"),_r=Symbol.for("react.forward_ref"),Lr=Symbol.for("react.suspense"),Hr=Symbol.for("react.memo"),no=Symbol.for("react.lazy"),Dr=Symbol.for("react.activity"),Jn=Symbol.iterator;function Nr(e){return e===null||typeof e!="object"?null:(e=Jn&&e[Jn]||e["@@iterator"],typeof e=="function"?e:null)}var oo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ro=Object.assign,io={};function ge(e,t,n){this.props=e,this.context=t,this.refs=io,this.updater=n||oo}ge.prototype.isReactComponent={};ge.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ge.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ao(){}ao.prototype=ge.prototype;function kt(e,t,n){this.props=e,this.context=t,this.refs=io,this.updater=n||oo}var Pt=kt.prototype=new ao;Pt.constructor=kt;ro(Pt,ge.prototype);Pt.isPureReactComponent=!0;var Qn=Array.isArray;function Et(){}var M={H:null,A:null,T:null,S:null},so=Object.prototype.hasOwnProperty;function Rt(e,t,n){var o=n.ref;return{$$typeof:At,type:e,key:t,ref:o!==void 0?o:null,props:n}}function jr(e,t){return Rt(e.type,t,e.props)}function Tt(e){return typeof e=="object"&&e!==null&&e.$$typeof===At}function Gr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var eo=/\/+/g;function xt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Gr(""+e.key):t.toString(36)}function Wr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Et,Et):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function me(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case At:case Tr:a=!0;break;case no:return a=e._init,me(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+xt(e,0):o,Qn(r)?(n="",a!=null&&(n=a.replace(eo,"$&/")+"/"),me(r,t,n,"",function(u){return u})):r!=null&&(Tt(r)&&(r=jr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(eo,"$&/")+"/")+a)),t.push(r)),1;a=0;var d=o===""?".":o+":";if(Qn(e))for(var s=0;s<e.length;s++)o=e[s],i=d+xt(o,s),a+=me(o,t,n,i,r);else if(s=Nr(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=d+xt(o,s++),a+=me(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return me(Wr(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function Xe(e,t,n){if(e==null)return e;var o=[],r=0;return me(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Fr(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var to=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Kr={map:Xe,forEach:function(e,t,n){Xe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xe(e,function(){t++}),t},toArray:function(e){return Xe(e,function(t){return t})||[]},only:function(e){if(!Tt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=Dr;w.Children=Kr;w.Component=ge;w.Fragment=Mr;w.Profiler=Vr;w.PureComponent=kt;w.StrictMode=Or;w.Suspense=Lr;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return M.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=ro({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!so.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),d=0;d<i;d++)a[d]=arguments[d+2];o.children=a}return Rt(e.type,r,o)};w.createContext=function(e){return e={$$typeof:Cr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Ir,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)so.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var d=Array(a),s=0;s<a;s++)d[s]=arguments[s+2];r.children=d}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Rt(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:_r,render:e}};w.isValidElement=Tt;w.lazy=function(e){return{$$typeof:no,_payload:{_status:-1,_result:e},_init:Fr}};w.memo=function(e,t){return{$$typeof:Hr,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=M.T,n={};M.T=n;try{var o=e(),r=M.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Et,to)}catch(i){to(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),M.T=t}};w.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()};w.use=function(e){return M.H.use(e)};w.useActionState=function(e,t,n){return M.H.useActionState(e,t,n)};w.useCallback=function(e,t){return M.H.useCallback(e,t)};w.useContext=function(e){return M.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return M.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return M.H.useEffect(e,t)};w.useEffectEvent=function(e){return M.H.useEffectEvent(e)};w.useId=function(){return M.H.useId()};w.useImperativeHandle=function(e,t,n){return M.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return M.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return M.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return M.H.useMemo(e,t)};w.useOptimistic=function(e,t){return M.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return M.H.useReducer(e,t,n)};w.useRef=function(e){return M.H.useRef(e)};w.useState=function(e){return M.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return M.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return M.H.useTransition()};w.version="19.2.8"});var N=We((xa,uo)=>{"use strict";uo.exports=lo()});var wo=We(et=>{"use strict";var ei=Symbol.for("react.transitional.element"),ti=Symbol.for("react.fragment");function So(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:ei,type:e,key:o,ref:t!==void 0?t:null,props:n}}et.Fragment=ti;et.jsx=So;et.jsxs=So});var Ce=We((Oa,vo)=>{"use strict";vo.exports=wo()});var fe={focusId:null,relation:null,expanded:[],pins:{}},qe=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function te(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${Be(r.x)},${Be(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Be(e.pan.x)},${Be(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function xr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function $e(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[m,p]of n){if(!m.startsWith("pin."))continue;let[g,v]=p.split(","),k=g===void 0?null:qe(g),y=v===void 0?null:qe(v);k===null||y===null||(o[m.slice(4)]={x:k,y})}let r=Object.create(null);for(let[m,p]of n)!m.startsWith("in.")||p.length===0||(r[m.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],d=a[0]===void 0?null:qe(a[0]),s=a[1]===void 0?null:qe(a[1]),u=(n.get("sel")??"").split(",").filter(m=>m.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...d!==null&&s!==null?{pan:{x:d,y:s}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:xr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(m=>m.length>0&&(f||!m.startsWith("kind:"))).sort(),pins:o}}function ia(e){let t=$e(e);return te(t)==="#"?{...t,overview:!0}:t}function aa(e){let t=te(e);return t==="#overview=1"?"":t}function Be(e){return Math.round(e*100)/100}function Bn(e,t){return te(e)===te(t)}var qn="edge:";function $n(e){if(!e.startsWith(qn))return null;let t=e.slice(qn.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function ht(e){let{pan:t,...n}=e;return{...n,pins:{}}}function B(e,t){if(t===e.focusId)return{...e,focusId:t};let n=ht(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function zn(e,t){return{...e,relation:t}}function ae(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function pe(e,t){if(t!==e.overview&&(e=ht(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function ze(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Ve(e,t){if(t!==(e.zoom===!0)&&(e=ht(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Ue(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Ze="aggregate:",Ye="kind:";function St(e){return`${Ye}${e}`}function ye(e){return e.startsWith(Ye)?e.slice(Ye.length):null}var da="kinds:beyond";function Er(e){let t=ye(e);return t?[t]:se(e)}function ne(...e){return`${Ze}${[...e].sort().join("+")}`}function Un(e){return e.startsWith(Ze)}function se(e){return!Un(e)||e.includes("|")?[]:e.slice(Ze.length).split("+").filter(Boolean)}function Yn(e,t,n={}){let o=ye(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Ue(e,t);let r=o!==null?ne(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Ve(e,!1);if(o!==null&&n.carry){let i=pe({...B(e,r),relation:null},!1);return ae(Ve(i,!0),"q",n.carry)}return Ve({...B(e,r),relation:null},!0)}function Ar(e,t,n){return ae(pe(B(e,ne(t)),!1),"view",n)}function ua(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Zn="aggregate:";function wt(e){return e.startsWith(Zn)&&e.includes("|")}var vt=e=>e?.off===!0,kr=e=>e!==void 0&&!vt(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),Xn=e=>e!==void 0&&!vt(e)&&(e.fast!==void 0||e.decide!==void 0),Pr=e=>e?.suggestOnOpen!==!1&&Xn(e),Rr=e=>e?.hoverChips===!0&&Xn(e);var bt={};var co=_(N(),1),qr={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},fo=e=>`graview:seat:${e}`;function Br(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function $r(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Mt(e){let t=e===null?null:fo(e),n={...qr,...Br(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&$r(t,n);for(let d of[...o])d()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function zr(e){return(0,co.useSyncExternalStore)(e.subscribe,e.get,e.get)}var yo=_(N(),1),Ur={entries:[],ghost:null,loaded:!1};function po(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function Ot(e){let t=Ur,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:po(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:po(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function Yr(e){return(0,yo.useSyncExternalStore)(e.subscribe,e.get,e.get)}function mo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Je=_(N(),1),Qe=(0,Je.createContext)(void 0),Zr=()=>(0,Je.useContext)(Qe);var A=_(N(),1),Ie=(0,A.createContext)(null);function ho(){return(0,A.useContext)(Ie)}function Xr(e,t){let n=ho(),o=(0,A.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,A.useRef)(0),i=(0,A.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,A.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Jr=Ke(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.AJZBJBMO.js"]),import("./chunk.G4AY6NGN.js"))),go,Qr=400;function Vt(e,t,n){let o=(0,A.useContext)(Ie),r=o!==null&&o.owns(e,t),[i,a]=(0,A.useState)(null),[d,s]=(0,A.useState)(go);(0,A.useEffect)(()=>{if(d||r||i===null)return;let x=!0;return Jr().then(V=>{go=V,x&&s(V)},()=>{}),()=>{x=!1}},[d,r,i]);let[u,f]=(0,A.useState)(0),m=(0,A.useMemo)(()=>r||i===null||i>=e.log.length||!d?void 0:d.askArchived(e,i,n)??d.askDeclaration(n,i),[r,e,i,n,d,u]),p=m&&"waiting"in m?m.waiting:void 0,g=m&&"seq"in m?m:null,[v,k]=(0,A.useState)(void 0);(0,A.useEffect)(()=>{if(!p)return;let x=!0,V=setTimeout(()=>x&&k(p),Qr);return p.then(()=>x&&f(O=>O+1)),()=>{x=!1,clearTimeout(V)}},[p]);let y=p!==void 0&&v!==p||g!==null,b=(0,A.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d||y)return null;try{let x=d.pastAt(e,i,n);return{seq:i,at:x.past?.at,store:x}}catch{return null}},[r,e,i,n,d,y,u]),h=(0,A.useRef)(null),E=y?h.current:b;(0,A.useEffect)(()=>{h.current=E},[E]);let P=(0,A.useCallback)(x=>a(x===null?null:x>=e.log.length?Number.POSITIVE_INFINITY:x),[e]),D=(0,A.useCallback)((x,V)=>[e,E?.store].some(O=>O!==void 0&&(O===x||O.seenBy(V)===x)),[e,E]),C=i!==null,G=(0,A.useMemo)(()=>({past:E,open:C,show:P,live:e,host:n,owns:D,archive:g}),[E,C,P,e,n,D,g]);return r?o:G}var bo=e=>`graview:setting:${e}`;function xo(){return localStorage}function Eo(e,t){try{let n=(t??xo()).getItem(bo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function Ao(e,t,n){try{(n??xo()).setItem(bo(e.name),t)}catch{}}function ko(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var L=_(N(),1);function It(e){return Fe(e)}var ni=12,oi=4;function ri(e,t,n){let o=It(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var tt=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-ni);function Po(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=oi)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?St([...o][0]):n[0]}function Ct(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,d]of e)d.mode!=="asking"&&d.mode!=="docked"&&t.at-d.since>=t.holdMs&&o.set(a,{...d,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=ri(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=Po(t.ids,n);return i({at:a,mode:"reading",trail:tt(r.trail,a)}),o}case"about-to-write":case"write":{let a=Po(t.ids,n);return i({at:a,mode:"writing",trail:tt(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:tt(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:tt(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var Ro="graview:session";function To(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(Ro);if(o)return o;let r=t();return n.setItem(Ro,r),r}catch{return t()}}var _t={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},Lt={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},Mo=[_t,Lt],ai=800;function Oo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:s,setView:u,ttlMs:f=1e4,people:m,seats:p}=e,[g,v]=(0,L.useState)(()=>new Map),[k,y]=(0,L.useState)(null),[b,h]=(0,L.useState)(null),[E,P]=(0,L.useState)(null),D=typeof r.id=="string"&&r.id.length>0,C=D&&(s[_t.name]??_t.initial)==="shared",G=C&&(s[Lt.name]??Lt.initial)==="shared",x=It({kind:r.kind,...r.id?{id:r.id}:{},session:i}),V=D?Hn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...m?{people:m}:{}}):"",O=d?a.get(`agent:${d}:${i}`):void 0,W=(0,L.useMemo)(()=>!t||!C?null:{participant:x,kind:r.kind,name:V,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:Dn(r.id??"nobody"),stop:E??te(o),...G?{over:k}:{},...O?{robot:{at:O.at,mode:O.mode}}:{},at:new Date().toISOString()},[t,C,G,x,V,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,k,O?.at,O?.mode]);(0,L.useEffect)(()=>{if(!t||!W)return;t.here(W);let I=setInterval(()=>t.here({...W,at:new Date().toISOString()}),ai);return()=>clearInterval(I)},[t,W]),(0,L.useEffect)(()=>t?t.onWho(K=>v(gt(new Map,K,Date.now(),f))):void 0,[t,f]);let Z=g.size>0;(0,L.useEffect)(()=>{if(!Z)return;let I=setInterval(()=>{v(K=>{let Q=gt(K,[],Date.now(),f);return Q.size===K.size?K:Q})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(I)},[Z,f]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let I=()=>t.leave();return window.addEventListener("pagehide",I),()=>window.removeEventListener("pagehide",I)},[t]),(0,L.useEffect)(()=>{if(!G||typeof document>"u")return;let I=null,K=Q=>{let Ee=mo(Q.target);Ee!==I&&(I=Ee,y(Ee))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[G]);let X=(0,L.useRef)(null),$=b?g.get(b)??null:null,de=(0,L.useCallback)(I=>{X.current=null,h(I)},[]);return(0,L.useEffect)(()=>{if(b){if(!$){h(null);return}$.stop!==X.current?.stop&&(X.current={stop:$.stop,at:Date.now()},u($e($.stop)))}},[b,$,u]),(0,L.useEffect)(()=>{let I=X.current;!b||I===null||Date.now()-I.at<400||Bn(o,$e(I.stop))||h(null)},[o,b]),(0,L.useEffect)(()=>{if(!b||typeof document>"u")return;let I=K=>{K.key==="Escape"&&h(null)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[b]),(0,L.useMemo)(()=>({who:g,sharing:W?{participant:x,name:V}:null,following:$,follow:de,sayWhere:P}),[g,W,x,V,$,de])}var U=_(N(),1);function Vo(e){return Fe(e.author)}function si(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Io(e,t,n,o,r){let i=new Map;for(let[s,u]of e)o-u.at<r&&i.set(s,u);let a=new Set(n.flatMap(s=>s.nodeIds)),d=(s,u,f)=>{let m=i.get(s),p=m?.participants.includes(Vo(u))?m.participants:[...m?.participants??[],Vo(u)];i.set(s,{at:o,manner:si(p,u.author.kind),intent:u.intent,wrote:(m?.wrote??!1)||(f.wrote??!1),read:(m?.read??!1)||(f.read??!1),broke:(m?.broke??!1)||a.has(s),participants:p})};for(let s of t){for(let u of s.writes)d(u,s,{wrote:!0});for(let u of s.reads)s.writes.includes(u)||d(u,s,{read:!0})}for(let s of n)for(let u of s.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??s.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var li=2600;function Co(e,t=li){let[n,o]=(0,U.useState)(()=>new Map),r=(0,U.useRef)(n);r.current=n;let i=(0,U.useRef)(null),a=(0,U.useCallback)(s=>{r.current=s,o(s),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,m)=>{let p=e.violations(),g=Wn(e.allInvariants(),s,p).introduces;s=p,a(Io(r.current,m,g.map(v=>({nodeIds:v.nodeIds,message:v.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let d=(0,U.useCallback)(s=>{s.reads.length!==0&&a(Io(r.current,[di(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function di(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],inverse:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var l=_(N(),1);function _o(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var nt=_(N(),1),ui=e=>e.definitions.some(t=>_n(t).size>0);function Lo(e,t,n){let[o,r]=(0,nt.useState)(void 0),i=(n.roles??[]).join("\0");return(0,nt.useEffect)(()=>{if(!t||!ui(e.schema)){r(void 0);return}let a=!0,d=!1,s=e.graph,u=()=>{d||(d=!0,queueMicrotask(()=>{d=!1,a&&e.reread()}))},f=Ln(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return mt(s,f.read),r(f),e.reread(),()=>{a=!1,mt(s,void 0)}},[e,t,n.kind,n.id,i]),o}function Ho(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var le=_(Ce(),1),ci="graview:place-menu",_e=(0,l.createContext)(null),Go=(0,l.createContext)("scene");function fi({mode:e,children:t}){return(0,le.jsx)(Go.Provider,{value:e,children:t})}function pi(){return(0,l.useContext)(Go)}var Wo={kind:"human"},yi=[],mi=[],gi=[],Ht=[];function Fo(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Wo,r=()=>Gn(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var hi={off:!0};function Si({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=yi,onSeat:d,people:s=mi,memory:u,presenceTtlMs:f,app:m,settings:p=m?.settings??gi,presence:g,brand:v,locale:k,timeZone:y,onKeepLens:b,providers:h,ai:E,files:P,resolveApp:D,history:C,linkedRecords:G,menuSections:x,keptViews:V,subscriptions:O,signIn:W,view:Z,onViewChange:X,children:$}){let de=(0,l.useContext)(_e),I=x??de?.menuSections,K=W??de?.signIn,Q=V??de?.keptViews,[Ee,dr]=(0,l.useState)(null),ue=Ee??i??a[0]?.principal??Wo,He=Vt(e,ue,C),Xt=He.past&&He.live===e?He.past.store:e,H=(0,l.useMemo)(()=>Xt.seenBy(ue),[Xt,ue]);Fo(e,ue);let[re]=(0,l.useState)(()=>To(u)),[Jt,ur]=(0,l.useState)(!1),Qt=(0,l.useCallback)(()=>ur(!0),[]),ie=(0,l.useMemo)(()=>g?[...p,...Mo]:p,[p,g]),[ut]=(0,l.useState)(()=>n??Gt(t,e.schema)),[cr,en]=(0,l.useState)(()=>ze(ut??fe,r??ut?.selection??[])),Ae=(0,l.useRef)(ut??fe).current,[tn,fr]=(0,l.useState)(null),[nn,pr]=(0,l.useState)(null),J=(0,l.useContext)(_e),[on]=(0,l.useState)(()=>J?.seatTalk??Mt(v?.name??e.schema.kinds.join(","))),ct=E??J?.ai??bt,De=(0,l.useMemo)(()=>ct.off?hi:ct,[ct]),rn=(0,l.useRef)(De.interactions);rn.current=De.interactions;let[an]=(0,l.useState)(()=>J?.aiDesk??Ot(()=>rn.current)),[yr]=(0,l.useState)(()=>J?.subscriptions??jn()),sn=O??J?.subscriptions??yr,ft=b??J?.onKeepLens,Ne=m??J?.app,je=k??J?.locale,mr=v?.locale??Ne?.brand?.locale,Ge=y??J?.timeZone;Cn({reader:je,app:mr,readerTimeZone:Ge,appTimeZone:v?.timeZone??Ne?.brand?.timeZone});let ln=(0,l.useRef)(null),dn=(0,l.useCallback)(c=>{ln.current=c},[]),un=(0,l.useCallback)(c=>ln.current?.whereIs(c)??null,[]),[cn]=(0,l.useState)(()=>_o()),[fn]=(0,l.useState)(()=>Ho()),[pt,gr]=(0,l.useState)(null),[ke,pn]=(0,l.useState)(()=>new Map),Pe=(0,l.useRef)(ke);Pe.current=ke;let Re=(0,l.useRef)(null),yt=(0,l.useCallback)(c=>H.graph.getNode(c)?.kind,[H]),ee=(0,l.useCallback)(c=>{let S=Ct(Pe.current,c,yt);Pe.current=S,pn(S),Re.current&&clearTimeout(Re.current),[...S.values()].some(T=>T.mode!=="docked"&&T.mode!=="asking")&&(Re.current=setTimeout(()=>{let T=Ct(Pe.current,{type:"rest",at:Date.now(),holdMs:jt},yt);Pe.current=T,pn(T)},jt+20))},[yt]),yn=(0,l.useCallback)(c=>ee({...c,at:c.at??Date.now()}),[ee]),mn=(0,l.useCallback)(c=>{gr(c),c&&ee({type:"home",author:{kind:"agent",id:c,session:re},at:Date.now()})},[ee,re]);(0,l.useEffect)(()=>H.subscribe((c,S)=>{for(let R of S)R.author.kind==="agent"&&ee({type:"write",author:R.author,ids:R.writes,at:Date.now()})}),[H,ee]),(0,l.useEffect)(()=>()=>{Re.current&&clearTimeout(Re.current)},[]);let z=(0,l.useMemo)(()=>({...ue,session:re}),[ue,re]),gn=Lo(H,G,z),hn=(0,l.useCallback)(c=>{dr(c),d?.(c)},[d]),[Te,hr]=(0,l.useState)(()=>Object.fromEntries(ie.map(c=>[c.name,Eo(c,u)])));(0,l.useEffect)(()=>{for(let c of ie)ko(c,Te[c.name]??c.initial)},[ie,Te]);let Sn=(0,l.useCallback)((c,S)=>{let R=ie.find(T=>T.name===c);!R||!R.options.some(T=>T.value===S)||(Ao(R,S,u),hr(T=>({...T,[c]:S})))},[ie,u]),[wn,Sr]=(0,l.useState)(null),{activity:vn,noteAttention:bn}=Co(H),xn=(0,l.useCallback)(c=>{bn(c),ee({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[bn,ee]),ce=(0,l.useCallback)(c=>{if(ye(c)!==null||se(c).length>0||wt(c))return!0;let S=$n(c);return S?H.graph.allEdges().some(R=>R.kind===S.kind&&R.from===S.from&&R.to===S.to):H.graph.getNode(c)!==void 0},[H]),En=(0,l.useCallback)(c=>{let S=c.selection??Ht,R=S.filter(ce),T=R.length===S.length?c:ze(c,R);return T.focusId!==null&&!ce(T.focusId)&&(T=B(T,null)),T},[ce]),Me=(0,l.useCallback)(c=>{let S=En(c),R=jo(H,z,S.shown);if(S.focusId!==null&&R.size>0){let T=se(S.focusId),In=H.graph.getNode(S.focusId);(T.length>0?T.every(br=>R.has(br)):In?R.has(In.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let T=Ae.focusId!==null&&!ce(Ae.focusId)?Gt(t,e.schema)??{...fe,overview:!0}:Ae;T.focusId!==null&&ce(T.focusId)?S={...S,focusId:T.focusId}:T.overview===!0&&(S={...S,overview:!0})}return S},[En,ce,H,Ae,z,t,e.schema]),q=Me(Z??cr),An=(0,l.useMemo)(()=>jo(H,z,q.shown),[H,z,q.shown]),kn=(0,l.useMemo)(()=>[...H.modules.administered.entries()].map(([c,S])=>{let R=H.mayAdminister(c,z);return{name:c,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:R,shown:R&&(q.shown??[]).includes(c)}}),[H,z,q.shown]),Oe=(0,l.useCallback)(c=>{let S=R=>Me(typeof c=="function"?c(R):c);if(Z!==void 0){X?.(S(Z));return}X&&X(S(q)),en(R=>S(R))},[q,X,Z,Me]);(0,l.useEffect)(()=>{Z===void 0&&en(c=>{let S=Me(c);return S===c?c:S})},[q,Z,Me]);let Pn=q.selection??Ht,Rn=(0,l.useCallback)(c=>{Oe(S=>ze(S,typeof c=="function"?c(S.selection??Ht):c))},[Oe]),{who:Tn,following:Mn,follow:On,sayWhere:wr,sharing:Vn}=Oo({channel:g,store:H,view:q,principal:z,session:re,robots:ke,seatWho:pt,settingValues:Te,setView:Oe,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),vr=(0,l.useMemo)(()=>({store:H,scheme:o,views:t,view:q,setView:Oe,homeView:Ae,selection:Pn,setSelection:Rn,menuAt:tn,setMenuAt:fr,whereIs:un,pointer:cn,motion:fn,registerScene:dn,robots:ke,noteSeat:yn,seatWho:pt,registerSeatWho:mn,actsDoor:nn,registerActsDoor:pr,seatTalk:on,aiDesk:an,...u?{memory:u}:{},who:Tn,following:Mn,follow:On,sayWhere:wr,sharing:Vn,session:re,ai:De,resolveApp:D,linkedRecords:G,menuSections:I,...Q?{keptViews:Q}:{},subscriptions:sn,signIn:K,linkedReads:gn,movedByHand:Jt,noteMoved:Qt,emphasis:wn,setEmphasis:Sr,activity:vn,noteAttention:xn,principal:z,seats:a,people:s,takeSeat:hn,settings:ie,settingValues:Te,chooseSetting:Sn,hiddenKinds:An,administered:kn,...h?{providers:h}:{},...v?{brand:v}:{},...ft?{onKeepLens:ft}:{},app:Ne,...je?{locale:je}:{},...Ge?{timeZone:Ge}:{}}),[H,o,t,q,Oe,Pn,Rn,tn,un,cn,fn,dn,ke,yn,pt,mn,nn,on,an,u,Tn,Mn,On,Vn,re,De,D,G,I,Q,sn,K,gn,Jt,Qt,wn,vn,xn,z,a,s,hn,ie,Te,Sn,An,kn,h,v,ft,Ne,je,Ge]);return(0,le.jsx)(_e.Provider,{value:vr,children:(0,le.jsx)(Ie.Provider,{value:He,children:(0,le.jsx)(Ei,{children:P?(0,le.jsx)(Qe.Provider,{value:P,children:$}):$})})})}var Ko=(0,l.createContext)(null),Dt,Nt=new Set,wi=e=>(Nt.add(e),()=>void Nt.delete(e)),Do=()=>Dt;function vi(e){if(!Dt){Dt=e;for(let t of[...Nt])t()}}var bi=300;function xi(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,bi)),r===t?e(n,o):[]}}function Ei({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=oe(),s=ot(),u=n.q,f=n.focusId,m=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(wi,Do,Do),g=(0,l.useMemo)(()=>m&&p?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,m,p]),v=f?t.graph.getNode(f)?.kind??ye(f)??(se(f).length===1?se(f)[0]:void 0):void 0,k=(0,l.useMemo)(()=>d.near&&xi(d.near),[d.near]),y=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...v?{inKind:v}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:k}),[t,u,r,o,i,a,f,v,g,k]),[b,h]=(0,l.useState)();return(0,l.useEffect)(()=>void y?.later?.then(E=>h([y,E])),[y]),(0,le.jsx)(Ko.Provider,{value:b?.[0]===y?b[1]:y,children:e})}var No=new WeakMap;function as(e){let t=No.get(e);return t||No.set(e,t=new Set(e.matched)),t}function Ai(){return(0,l.useContext)(Ko)}function oe(){let e=(0,l.useContext)(_e);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Wt(){return(0,l.useContext)(_e)??null}function ot(){let{store:e}=oe(),t=(0,l.useRef)(null),n=(0,l.useRef)(null),o=(0,l.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,l.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,l.useSyncExternalStore)(r,o,o)}function ki(e){let{store:t}=oe(),n=(0,l.useCallback)(r=>t.subscribe(r),[t]),o=(0,l.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,l.useSyncExternalStore)(n,o,o)}function jo(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var jt=2600;var qo=new WeakSet,Pi=e=>qo.has(e),Ri=e=>void qo.add(e);function Gt(e,t){let n=Kn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...fe,focusId:ne(n.place.kind),within:{view:n.place.as}}:{...fe,focusId:ne(n.kind)}}var Bo=_(N(),1),Ti=(0,Bo.createContext)(!1);var rt=Symbol.for("graview.default-view");function $o(e){return Object.defineProperty(e,rt,{value:!0,enumerable:!1}),e}function zo(e){return typeof e=="function"&&e[rt]===!0}var it=Symbol.for("graview.replaces-page");function Uo(e){return Object.defineProperty(e,it,{value:!0,enumerable:!1}),e}function Yo(e){return typeof e=="function"&&e[it]===!0}function Mi(e){return Fn(e)}function Oi(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var F=_(N(),1),Y=_(Ce(),1),Ft=new Set,at=0;function Jo(e){return()=>{at+=1;let t=e();return t.then(()=>void(at-=1),()=>void(at-=1)),t}}var Vi=()=>at,Qo=!1,er=!1,st=new Set;function Ii(){Qo=!0}function Ci(){er=!0;for(let e of[...st])e();st.clear()}var tr=()=>er||!Qo;function _i(e){return tr()?(e(),()=>{}):(st.add(e),()=>void st.delete(e))}var Zo=!1;function Kt(){for(let e of[...Ft])e()}function Li(){Zo||typeof window>"u"||(Zo=!0,window.addEventListener("online",Kt))}function qt(e){let t,n=!1,o=!1,r,i=0,a=new Set,d=()=>{i+=1;for(let p of[...a])p()},s=p=>(a.add(p),()=>void a.delete(p)),u=()=>i,f=()=>void m().catch(()=>{});function m(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Ft.delete(f),d(),g),g=>{throw r=void 0,o=!0,Ft.add(f),Li(),d(),g});return p.catch(()=>{}),r=p,p}return{load:m,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let v=g.what??"This part";function k(h){(0,F.useSyncExternalStore)(s,u,u);let E=(0,F.useRef)(null),P=(0,F.useRef)(null),D=(0,F.useRef)(!1);return(0,F.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&E.current!==null&&document.activeElement===E.current&&(D.current=!0),(0,F.useLayoutEffect)(()=>{if(!(!n||!D.current)){D.current=!1;for(let C=P.current?.nextElementSibling??null;C!==null;C=C.nextElementSibling){let G=C.matches(Xo)?C:C.querySelector(Xo);if(G instanceof HTMLElement){G.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[D.current?(0,Y.jsx)("span",{ref:P,hidden:!0}):null,p(t,h)]}):g.quiet?null:(0,Y.jsx)(Hi,{what:v,button:E,...g.as?{as:g.as}:{}})}let y=(0,F.lazy)(Jo(()=>m().then(()=>({default:k}),()=>({default:k}))));function b(h){let[E]=(0,F.useState)(()=>n||o);return(0,F.createElement)(E?k:y,h)}return b}}}var Xo="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Hi({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,Y.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,Y.jsx)("span",{role:"status",children:r})," ",(0,Y.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:Kt,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var Se=_(N(),1);function Di(){let{selection:e,setSelection:t}=oe();return(0,Se.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function Ni(){let{store:e}=oe(),t=ot();return(0,Se.useMemo)(()=>ji(e),[e,t])}var nr=new WeakMap;function ji(e){let t=nr.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),nr.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Gi(){let{view:e,setView:t}=oe();return(0,Se.useMemo)(()=>({view:e,url:te(e),focus:n=>t(o=>B(o,n)),show:n=>t(o=>zn(o,n)),toggle:n=>t(o=>Ue(o,n)),go:n=>t(n)}),[e,t])}var he={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;he.at=typeof t?.graview=="number"?t.graview:0,he.at>he.depth&&(he.depth=he.at),he.tell()});var j=_(N(),1),$t={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},Wi={position:"fixed",inset:"auto",margin:0,zIndex:Nn("popover"),boxSizing:"border-box"},lt=6,we=8,Fi=e=>typeof e.showPopover=="function";function dt(e){try{return e.matches(":popover-open")}catch{return!1}}function Ki(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function zt(e,t,n={}){let o=Ki(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),d=r.height-o.bottom-lt-we,s=o.top-lt-we,u=a.height<=d||d>=s,f=Math.max(96,Math.floor(u?d:s)),m=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,v=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();v&&p<=v.right-v.left&&(g<v.left?g=o.left+p<=v.right?o.left:v.left:g+p>v.right&&(g=o.right-p>=v.left?o.right-p:v.right-p));let k=p>=r.width-2*we?Math.max(0,(r.width-p)/2):Math.max(we,Math.min(g,r.width-we-p)),y=u?o.bottom+lt:Math.max(we,o.top-lt-m);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(y)}px`}function or(e,t,n,o={}){let r=o.align??"end";(0,j.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Fi(i)&&!dt(i))try{i.showPopover(),Bi()}catch{}let a=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>zt(i,n,{align:r})))};zt(i,n,{align:r}),addEventListener("resize",d),addEventListener("scroll",d,!0);let s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>d());return s?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",d),removeEventListener("scroll",d,!0),s?.disconnect(),i.isConnected&&dt(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Ut=new Set;function qi(e){return Ut.add(e),()=>Ut.delete(e)}function Bi(){for(let e of Ut)if(!(!e.isConnected||!dt(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ve=null,$i='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function zi(e){for(let t of e.querySelectorAll($i))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Bt=()=>{let e=document.activeElement;return e===null||e===document.body};function Ui(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,d]=(0,j.useState)(!1),s=t.open??a,u=(0,j.useRef)(null),f=(0,j.useRef)(null),m=(0,j.useCallback)(h=>{u.current=h},[]),p=(0,j.useCallback)(h=>{f.current=h},[]),g=`graview-popover-${(0,j.useId)().replace(/:/g,"")}`,v=(0,j.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});v.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,j.useCallback)(h=>{v.current.controlled||d(h),v.current.onOpenChange?.(h)},[]),y=(0,j.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??v.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),b=(0,j.useCallback)(h=>{let E=f.current,P=typeof document>"u"?null:document.activeElement,D=P===null||P===document.body||E!==null&&E.contains(P);k(!1),!(!h||!D)&&(y(),requestAnimationFrame(()=>{Bt()&&y()}))},[k,y]);return or(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,j.useEffect)(()=>{if(!i||!s)return;let h={name:e,close:()=>b(!1)};if(ve&&ve.close!==h.close&&ve.close(),ve=h,$t[e].focus==="into"){let x=f.current;x&&!x.contains(document.activeElement)&&zi(x).focus({preventScroll:!0})}let E=x=>{x.key==="Escape"&&b(!0)},P=x=>{let V=x.target;if(!(V instanceof Node))return;let O=f.current;if(O?.contains(V)||u.current?.contains(V))return;let W=V instanceof Element?V.closest('[role="dialog"], [role="alertdialog"]'):null;W&&!(O&&W.contains(O))||(b(!1),$t[e].focus==="into"&&requestAnimationFrame(()=>{(Bt()||O!==null&&O.contains(document.activeElement))&&y()}))},D=null,C=null,G=x=>{let V=x.target;if(!(V instanceof Element))return;let O=f.current,W=V.closest('[role="dialog"], [role="alertdialog"]');!W||O&&(O.contains(W)||W.contains(O))||(D=W,b(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",P,!0),document.addEventListener("focusin",G),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",P,!0),document.removeEventListener("focusin",G);let x=D;x&&typeof MutationObserver<"u"&&(C?.disconnect(),C=new MutationObserver(()=>{x.isConnected||(C?.disconnect(),requestAnimationFrame(()=>{(Bt()||document.activeElement.closest("[hidden]")!==null)&&y()}))}),C.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>C?.disconnect(),10*6e4)),ve?.close===h.close&&(ve=null)}},[i,s,e,b,y]),{open:s,setOpen:h=>h?k(!0):b(!0),toggle:()=>s?b(!0):k(!0),trigger:{ref:m,"aria-expanded":s,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var be=_(N(),1);var rr=(0,be.createContext)(null);function Yi(){let e=(0,be.useContext)(rr),t=Wt(),n=(o,r,i)=>t?.setView(a=>ae(ae(pe(B(a,ne(o)),!1),"view",r),"filter",i?.filter??null));return(0,be.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>B(pe(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var xe=_(N(),1);var Zi=qt(Ke(()=>(__graviewPreload(import.meta.url,["./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.4NBB44YU.js"))));function Xi(e,t,n){let o,r=!1,i=()=>{let{hidden:d,removed:s}=t.current();o||r||d.length+s.length===0||(o=()=>{},Zi.load().then(u=>{r||(o=u.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function Ji(e,t){let[n,o]=(0,xe.useState)();return(0,xe.useEffect)(()=>t?Xi(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var ir=_(N(),1),Qi=(0,ir.createContext)(!1);var ar=_(N(),1),ea=(0,ar.createContext)(null);var sr=_(N(),1),Yt='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Zt=e=>e instanceof HTMLElement&&(e.matches(Yt)||e.hasAttribute("tabindex")),Le=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function ta(e,t){let n=s=>s.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let d=e.querySelector(a);return d&&Zt(d)&&Le(d)?d:null}var na=e=>e.isConnected&&Zt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Le(e);function lr(e,t){let n=t?ta(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Le(o))return o;for(let r of e.querySelectorAll(Yt))if(Le(r))return r;return Zt(e)&&Le(e)?e:null}function oa(e){(0,sr.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=y=>{let b=y.target;if(b instanceof Element){n=[];for(let h=b;h&&h!==t.parentElement;h=h.parentElement)n.push(h)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,s=(y,b)=>void setTimeout(()=>d()&&b(),y),u=y=>void requestAnimationFrame(()=>d()&&y()),f=y=>{if(r=!1,i)return;let b=a.activeElement;if(!(!(b===null||b===a.body||b===a.documentElement)||n.length===0)){if(na(n[0])){y&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let P=lr(E,n[0]);if(P){P.focus({preventScroll:!0}),n=[];return}}}},m=(y,b=Date.now()+2500)=>{s(100,()=>{f(y);let h=a.activeElement;(h===null||h===a.body||h===a.documentElement)&&n.length>0&&Date.now()<b&&m(y,b)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),m(!1)})))},g=y=>{if(!(y instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(y.key))){if(!(y instanceof KeyboardEvent)){let b=y.target instanceof Element?y.target.closest(Yt):null,h=a.activeElement,E=h===null||h===a.body||h===a.documentElement;if(b&&E&&t.contains(b)){n=[];for(let P=b;P&&P!==t.parentElement;P=P.parentElement)n.push(P);s(150,()=>u(()=>{f(!1),m(!1)}));return}}!(y instanceof KeyboardEvent)&&!(y.target instanceof Node&&n[0]?.contains(y.target))||s(150,()=>u(()=>{f(!0),m(!0)}))}},v=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),k=y=>{y.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",g),t.addEventListener("keydown",g),v.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",g),t.removeEventListener("keydown",g),v.disconnect()}},[e])}export{fe as a,te as b,$e as c,ia as d,aa as e,Bn as f,qn as g,$n as h,ht as i,B as j,zn as k,ae as l,pe as m,ze as n,Ve as o,Ue as p,Ze as q,St as r,ye as s,da as t,Er as u,ne as v,Un as w,se as x,Yn as y,Ar as z,ua as A,Zn as B,wt as C,kr as D,Pr as E,Rr as F,N as G,Mt as H,zr as I,Yr as J,mo as K,Qe as L,Zr as M,Ie as N,ho as O,Xr as P,Vt as Q,Ce as R,ci as S,fi as T,pi as U,Fo as V,Si as W,vi as X,as as Y,Ai as Z,oe as _,Wt as $,ot as aa,ki as ba,Pi as ca,Ri as da,Gt as ea,rr as fa,Yi as ga,Ti as ha,$o as ia,zo as ja,Uo as ka,Yo as la,Mi as ma,Oi as na,Jo as oa,Vi as pa,Ii as qa,Ci as ra,tr as sa,_i as ta,qt as ua,Ji as va,Qi as wa,ea as xa,Di as ya,Ni as za,Gi as Aa,he as Ba,oa as Ca,Wi as Da,dt as Ea,or as Fa,qi as Ga,Ui as Ha};
2
- /*! Bundled license information:
3
-
4
- react/cjs/react.production.js:
5
- (**
6
- * @license React
7
- * react.production.js
8
- *
9
- * Copyright (c) Meta Platforms, Inc. and affiliates.
10
- *
11
- * This source code is licensed under the MIT license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- *)
14
-
15
- react/cjs/react-jsx-runtime.production.js:
16
- (**
17
- * @license React
18
- * react-jsx-runtime.production.js
19
- *
20
- * Copyright (c) Meta Platforms, Inc. and affiliates.
21
- *
22
- * This source code is licensed under the MIT license found in the
23
- * LICENSE file in the root directory of this source tree.
24
- *)
25
- */
@@ -1 +0,0 @@
1
- import"./chunk.GZHZLJBF.js";import{n as P}from"./chunk.HG2IO5NS.js";import"./chunk.OJGHDWI6.js";import"./chunk.AQTCN7KQ.js";import"./chunk.LFJH6X6O.js";import"./chunk.VTUMPH4Z.js";import"./chunk.PCTVLNOS.js";import"./chunk.4QEDYRES.js";import{$ as b,G as A,R as S}from"./chunk.JE4QQEJE.js";import"./chunk.SDO3U72B.js";import{Aa as w,na as L,vc as x}from"./chunk.UG727PEE.js";import{b as R}from"./chunk.AJZBJBMO.js";var u=R(A(),1);var n=R(S(),1),C={kind:"human"},p={color:"var(--graview-ink-muted)"};function I(e){if(e){if(/^https?:\/\//i.test(e))try{return new URL(e).href}catch{return}return L(e)?e:void 0}}function z(e){let o=b(),t=o?.linkedReads,[i,a]=(0,u.useState)(()=>t?t.answered(e)??"asking":null);return(0,u.useEffect)(()=>{if(!t){a(o?.linkedRecords?"asking":null);return}let d=t.answered(e);if(a(d===void 0?"asking":d),d!==void 0)return;let s=!0;return t.ask(e).then(l=>s&&a(l)),()=>{s=!1}},[t,o?.linkedRecords,e.address,e.kind,e.id]),i}function V({reference:e,as:o}){let t=b(),i=z(e),a={position:"relative",zIndex:x.raised,overflowWrap:"anywhere",minWidth:0,maxWidth:"100%"};if(i==="asking")return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"asking","aria-busy":"true",style:{...p,...a},children:"Linked record"});if(i&&"denied"in i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"denied",style:{...p,fontStyle:"italic",...a},children:"linked record (no access)"});if(!i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"missing",style:{...p,fontStyle:"italic",...a},children:"linked record (not found)"});let d=I(i.href),s=t?.linkedRecords,l=t?.principal??C,g=s?.open?c=>{c.metaKey||c.ctrlKey||(c.preventDefault(),s.open(e,l))}:void 0,k=(0,n.jsx)("a",{"data-graview-linked-title":"",...d?{href:d}:{role:"link",tabIndex:0},...g?{onClick:g,onKeyDown:c=>!d&&(c.key==="Enter"||c.key===" ")?g(c):void 0}:{},style:{fontWeight:600,color:"inherit",textUnderlineOffset:3,cursor:d||g?"pointer":"default"},children:i.label});return o==="chip"?(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"found",title:i.describe,style:{display:"inline-flex",alignItems:"center",minHeight:24,...a},children:k}):(0,n.jsx)(D,{record:i,title:k,base:a})}function D({record:e,title:o,base:t}){return(0,n.jsxs)("span",{"data-graview-linked":"","data-graview-linked-state":"found",style:{display:"grid",gap:2,padding:"8px 10px",border:"1px solid var(--graview-line)",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-surface)",...t},children:[(0,n.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"2px 8px"},children:[o,e.app?(0,n.jsxs)("span",{"data-graview-linked-app":"",style:{...p,fontSize:"0.75rem"},children:["in ",e.app]}):null]}),e.describe?(0,n.jsx)("span",{"data-graview-linked-describe":"",style:{...p,fontSize:"0.8125rem"},children:e.describe}):null,e.card&&e.card.length>0?(0,n.jsx)("span",{"data-graview-linked-card":"",style:{display:"flex",flexWrap:"wrap",gap:"2px 12px",fontSize:"0.8125rem"},children:e.card.map(i=>(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{style:p,children:i.label})," ",i.text]},i.label))}):null]})}function H({relation:e,refs:o,as:t="record",nodeId:i,field:a,style:d}){let s=(0,n.jsx)("span",{"data-graview-linked-list":"",style:{display:"grid",gap:6,minWidth:0,...d},children:o.map(l=>(0,n.jsx)(V,{reference:l,as:t},w(l)))});return i&&a?(0,n.jsx)(K,{nodeId:i,field:a,relation:e,refs:o,drawn:s}):s}function K({nodeId:e,field:o,relation:t,refs:i,drawn:a}){let{fields:d,commit:s}=P(e),l=d.find(f=>f.field===o),[g,k]=(0,u.useState)(!1);if(!l)return a;let c=t.cardinality==="one"?i[0]?w(i[0]):void 0:i.map(w);return(0,n.jsxs)("span",{style:{display:"grid",gap:6,minWidth:0},children:[a,g?(0,n.jsx)(N,{relation:t,value:c,label:"Link another record",onChange:f=>{s(l,f),k(!1)},onCancel:()=>k(!1)}):(0,n.jsx)("button",{type:"button","data-graview-linked-change":"",onClick:()=>k(!0),style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-accent)",cursor:"pointer",minHeight:24},children:"Change"})]})}function N({relation:e,value:o,onChange:t,onCancel:i,label:a}){let d=b(),s=d?.linkedRecords,l=d?.principal??C,g=(0,u.useId)(),[k,c]=(0,u.useState)(""),[f,m]=(0,u.useState)("asking");(0,u.useEffect)(()=>{if(!s)return;let r=!0;m("asking");let y=setTimeout(()=>{Promise.resolve().then(()=>s.find({address:e.address,kinds:e.kinds,query:k,limit:20},l)).then(h=>r&&m(Array.isArray(h)?h:"denied"),()=>r&&m([]))},150);return()=>{r=!1,clearTimeout(y)}},[s,e.address,e.kinds.join(","),k,l.kind,l.id]);let v=new Set([o].flat().filter(r=>typeof r=="string")),W=r=>{let y=w(r);if(e.cardinality==="one")return t(y);t(v.has(y)?[...v].filter(h=>h!==y):[...v,y])};return s?(0,n.jsxs)("span",{"data-graview-linked-picker":"",style:{display:"grid",gap:6,minWidth:0},children:[(0,n.jsx)("label",{htmlFor:g,style:{...p,fontSize:"0.8125rem"},children:a}),(0,n.jsx)("input",{id:g,type:"search",value:k,placeholder:`Find one in ${e.address}`,onChange:r=>c(r.target.value),style:{font:"inherit",minHeight:32,padding:"4px 8px",border:"1px solid var(--graview-line)",borderRadius:6,background:"var(--graview-surface)",color:"inherit",minWidth:0}}),f==="asking"?(0,n.jsx)("span",{"aria-busy":"true",style:p,children:"Looking\u2026"}):f==="denied"?(0,n.jsx)("span",{"data-graview-linked-state":"denied",style:{...p,fontStyle:"italic"},children:"linked record (no access)"}):f.length===0?(0,n.jsx)("span",{style:p,children:"Nothing there matches."}):(0,n.jsx)("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:4},children:f.map(r=>{let y=v.has(w(r));return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-graview-linked-candidate":w(r),"aria-pressed":y,onClick:()=>W(r),style:{display:"grid",gap:2,width:"100%",textAlign:"start",font:"inherit",padding:"6px 8px",minHeight:32,border:"1px solid var(--graview-line)",borderRadius:6,background:y?"var(--graview-accent-soft, var(--graview-surface))":"var(--graview-surface)",color:"inherit",cursor:"pointer"},children:[(0,n.jsx)("span",{style:{fontWeight:600},children:r.label}),r.describe?(0,n.jsx)("span",{style:{...p,fontSize:"0.8125rem"},children:r.describe}):null]})},w(r))})}),i?(0,n.jsx)("button",{type:"button",onClick:i,style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-ink-muted)",cursor:"pointer",minHeight:24},children:"Keep it as it is"}):null]}):(0,n.jsxs)("span",{"data-graview-linked-picker":"","data-graview-linked-state":"no-host",style:p,children:["This page cannot read ",e.address,", so nothing there can be linked here."]})}var U=e=>(0,n.jsx)(H,{...e}),j=e=>(0,n.jsx)(N,{...e});export{N as LinkedPicker,H as LinkedRecordView,j as drawLinkedPicker,U as drawLinkedRecord};
@@ -1 +0,0 @@
1
- import{b as pt}from"./chunk.PH5ITX3N.js";import{a as dt}from"./chunk.57R4ZUMM.js";import{f as ct}from"./chunk.J7ZMNAWB.js";import{a as C,f as q}from"./chunk.VKJAGZNU.js";import{Eb as ut,F as Q,G as X,I as k,Nc as ft,O as G,R as tt,T as nt,U as et,bb as st,ca as _,db as it,ea as M,ga as rt,gb as lt,ja as ot,la as at}from"./chunk.UG727PEE.js";import"./chunk.AJZBJBMO.js";function J(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let s=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!s}),n=r.as==="open"}return e}function D(t,e){return J(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Ot(t){return D(t,!1)}function Et(t){return D(t,!0)}function mt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function z(t){let e=u=>J(u).map(({part:o,space:a})=>({...o,space:a})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,s=u=>`${D(n,u)}${r?`, when ${D(r,u)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:s(!1),said:s(!0)}}function Pt(t,e=!1){return t.line?mt(t.line,e):t.message}var yt=60,O=t=>({text:t,as:"name"}),c=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},L=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},R=(t,e)=>({text:t,as:"op",said:e}),v={text:"(",as:"open"},w={text:")",as:"close"},N={text:"\u2014",as:"value",said:"empty"},V={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},Lt={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},ht=t=>t.t==="binary"&&t.op in V;function I(t){return t.length>1&&t[1]===t[1].toUpperCase()&&/[A-Z]/.test(t[1])?t:t.charAt(0).toLowerCase()+t.slice(1)}function bt(t){let{schema:e}=t,n=l=>l===null?void 0:e.tryDefinition(l),r=(l,m)=>{let g=n(l)?.edges;return g&&Object.hasOwn(g,m)?g[m]:void 0},s=(l,m)=>{let g=r(l,m)?.to;return Array.isArray(g)&&g.length===1?g[0]:null},u=(l,m)=>{let g=(e.edge(m)?.from??[]).filter(W=>{let K=r(W,m)?.to;return l===null||K==="*"||Array.isArray(K)&&K.includes(l)});return g.length===1?g[0]:null},o=(l,m)=>r(l,m)?M(m).toLowerCase():I(ot(n(l),m)),a=l=>I(rt(e,l)),d=l=>I(ct(e).get(l)?.label??M(l)),x=l=>I(at(n(l),l)),i=(l,m)=>{let g=l===null?void 0:t.formatOf?.(l,m);if(g?.format)return g;let W=t.said?.get(m);return W?{...g,format:W}:g},p=l=>_(e.tryDefinition(l.kind),l),h=t.money?.locale,y=(l,m)=>{if(l==null)return N;if(l instanceof C){if(l.nodes.length===0)return N;let A=l.nodes.slice(0,3).map(p),Y=l.nodes.length-A.length;return L(Y>0?`${A.join(", ")} and ${Y} more`:A.length>1?`${A.slice(0,-1).join(", ")} and ${A[A.length-1]}`:A[0])}if(Array.isArray(l))return L(`{${l.map(A=>y(A,m).text).join(", ")}}`,l.map(A=>y(A,m).text).join(" or "));if(typeof l=="object")return L(p(l));if(typeof l=="boolean")return L(l?"yes":"no");let g=m?.format??(m?i(m.kind,m.key):void 0);if(typeof l=="number")return L(g&&g.format!=="date"?ut(l,{...t.money,...g}):et(l,h));if(Q.test(l)||g?.format==="date")return L(G(nt(l,t.money?.timeZone)??l.slice(0,10),h));if(X.test(l))return L(tt(l,h,t.money?.timeZone));let W=m&&m.kind!==null?n(m.kind)?.display?.format?.[m.key]:void 0;if(W)return L(W(l));let K=l.length>yt?`${l.slice(0,yt-1).trimEnd()}\u2026`:l;return L(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test(K)?K.replace(/[-_]+/g," "):K)};return{definition:n,relation:r,farOf:s,nearOf:u,fieldName:o,plural:a,noun:x,factName:d,formatOf:i,valueWords:y,locale:h}}function P(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:E(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=E(t.args[0],e,n),s=t.args[1];if(s.t==="ident")return{kind:r,key:s.name};if(s.t==="lit"&&typeof s.value=="string")return{kind:r,key:s.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return P(t.left,e,n)??P(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return P(t.args[1],e,n)??P(t.args[2],e,n)}function E(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(E(t.object,e,n),t.name);case"where":return E(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?E(t.left,e,n):null;case"call":{let r=s=>{let u=t.args[s];return u?.t==="lit"&&typeof u.value=="string"?u.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(E(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(E(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?E(t.args[0],e,n):null}default:return null}}function j(t){return t.t==="binary"?t.op==="||"?U(t)?4:1:t.op==="&&"?2:t.op in V||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var $=t=>t.t==="lit",b=(t,e)=>t.t==="call"&&t.fn===e;function F(t,e){return t.t==="binary"&&t.op===e?[...F(t.left,e),...F(t.right,e)]:[t]}function U(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...F(t,"||"));let n,r=[];for(let s of e){if(s.t!=="binary"||s.op!=="=="||!$(s.right)||typeof s.right.value!="string"||n&&JSON.stringify(gt(n))!==JSON.stringify(gt(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var gt=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,o,a=e)=>j(u)<o?[v,...f(u,a,n),w]:f(u,a,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(u=>u.t==="lit"?u.value:null),r)];case"ident":return[O(n.fieldName(e,t.name))];case"member":{let u=b(t.object,"first")&&t.object.args[0]&&b(t.object.args[0],"all"),o=E(t.object,e,n);if(u&&o)return e!==null&&n.fieldName(e,t.name)===n.fieldName(o,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(o)}'s ${n.fieldName(o,t.name)}`)]:[O(n.fieldName(o,t.name))];let a=f(t.object,e,n),d=a[a.length-1];return a.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(o,t.name)}`)]:[...a,c("'s"),O(n.fieldName(o,t.name))]}case"unary":return t.op==="-"?[R("\u2212","minus"),...s(t.operand,7)]:T(t.operand,e,n);case"where":{let u=E(t.set,e,n),o=f(t.filter,u,n),a=o.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...a?[]:[c("with")],...j(t.filter)<=2?[v,...o,w]:o]}case"binary":return xt(t,e,n);case"call":return At(t,e,n)}}function T(t,e,n){return ht(t)?xt({...t,op:B[t.op]},e,n):b(t,"present")||b(t,"exists")?[...f(t.args[0],e,n),R("=","is"),N]:t.t==="ident"?[c("not"),O(n.fieldName(e,t.name))]:[c("not"),v,...f(t,e,n),w]}function xt(t,e,n){let r=(o,a)=>j(o)<a?[v,...f(o,e,n),w]:f(o,e,n);if(t.op==="&&"||t.op==="||"){let o=U(t);if(o){let d=P(o.subject,e,n);return[...f(o.subject,e,n),R("\u2208","is one of"),n.valueWords(o.values.map(x=>x.value),d)]}let a=t.op==="&&"?2:1;return[...r(t.left,a),c(t.op==="&&"?"and":"or"),...r(t.right,a+.5)]}if(t.op in V){if($(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?f(t.left,e,n):T(t.left,e,n);let[o,a]=V[t.op],d=P(t.left,e,n),x=P(t.right,e,n);return[...S(t.left,e,n,x),R(o,a),...S(t.right,e,n,d)]}if(t.op==="in")return[...r(t.left,5),R("\u2208","is one of"),...S(t.right,e,n,P(t.left,e,n))];let s=Lt[t.op];if(s){let o=j(t);return[...r(t.left,o),R(s[0],s[1]),...r(t.right,o+.5)]}let u={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),c(u[t.op]??t.op),...r(t.right,5)]}function S(t,e,n,r){return t.t==="lit"||t.t==="list"?f(t,e,n,r):j(t)<5?[v,...f(t,e,n),w]:f(t,e,n)}function At(t,e,n){let r=o=>t.args[o],s=o=>{let a=t.args[o];return a?.t==="lit"&&typeof a.value=="string"?a.value:void 0},u=o=>{let a=r(o);return j(a)<9&&a.t!=="where"?[v,...f(a,e,n),w]:f(a,e,n)};switch(t.fn){case"out":{let o=s(t.args.length-1)??"",a=O(M(o).toLowerCase());return t.args.length===2?[a,c("of"),...u(0)]:[a]}case"in":{let o=s(t.args.length-1)??"",a=t.args.length===2?n.nearOf(E(r(0),e,n),o):n.nearOf(e,o),d=O(a?n.plural(a):M(o).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let o=s(0),a=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=a===!0?[c("archived")]:a==="all"?[c("archived or not")]:[];return a===!0?[...d,O(o?n.plural(o):"everything")]:[O(o?n.plural(o):"everything"),...d]}case"fact":{let o=s(0);return[O(o?n.factName(o):"fact")]}case"count":return[c("number of"),...u(0)];case"exists":return[...u(0),R("\u2260","is not"),N];case"present":return[...f(r(0),e,n),R("\u2260","is not"),N];case"some":case"every":{let o=E(r(0),e,n),a=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(a)<=2?[v,...f(a,o,n),w]:f(a,o,n)]}case"sum":case"min":case"max":{let o=E(r(0),e,n),a=r(1),d=a.t==="lit"&&typeof a.value=="string"?[O(n.fieldName(o,a.value))]:j(a)<9?[v,...f(a,o,n),w]:f(a,o,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let o=r(0);if(b(o,"all")){let a=o.args[0]?.value;if(typeof a=="string")return[O(`the ${n.noun(a)}`)]}return[c("first of"),...u(0)]}case"sort":return[...u(0),c("by"),...f(r(1),E(r(0),e,n),n)];case"len":return[c("length of"),...f(r(0),e,n)];case"lower":return f(r(0),e,n);case"contains":case"startsWith":return[...f(r(0),e,n),c(t.fn==="contains"?"contains":"starts with"),...S(r(1),e,n,P(r(0),e,n))];case"today":return[L("today")];case"now":return[L("now")];case"date":return $(r(0))&&typeof r(0).value=="string"?[L(G(String(r(0).value),n.locale))]:f(r(0),e,n);case"days":case"hours":{let o=t.fn,[a,d]=[r(0),r(1)];return b(d,"today")||b(d,"now")?[c(`${o} since`),...f(a,e,n)]:b(a,"today")||b(a,"now")?[c(`${o} until`),...f(d,e,n)]:[c(`${o} from`),...f(a,e,n),c("to"),...f(d,e,n)]}case"if":return[v,...f(r(1),e,n),c("if"),...f(r(0),e,n),c(","),c("else"),...f(r(2),e,n),w];case"either":return t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),c("else"),...f(o,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),...f(o,e,n)]),w]}}function Z(t,e){let n=bt(e),r=t.over==="graph"?null:t.over;return z({...r===null?{}:{kind:r},parts:f(t.require,r,n),...t.when?{when:f(t.when,r,n)}:{}})}function H(t,e,n){let r=bt(e),s=t.over==="graph"?null:t.over,u=n.subject,o=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},a=(i,p)=>{let h=S(i,s,r,p);if(i.t==="lit"||i.t==="list"||b(i,"today")||b(i,"now")||b(i,"date"))return h;let y=o(i);if(y===void 0)return h;let l=P(i,s,r),m=r.valueWords(y,l?{...l,format:r.formatOf(l.kind,l.key)??(p?r.formatOf(p.kind,p.key):void 0)}:p);return y instanceof C?[...h,c(":"),m]:[...h,m]},d=i=>{if(i.t==="binary"&&i.op==="&&"){let p=[];p.push(...F(i,"&&"));let h=p.filter(y=>o(y)!==!0);return(h.length>0?h:p).flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op==="||"){let p=U(i);if(p){let y=P(p.subject,s,r);return[...a(p.subject),R("\u2209","is not one of"),r.valueWords(p.values.map(l=>l.value),y)]}let h=[];return h.push(...F(i,"||")),h.flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op in V){if($(i.right)&&typeof i.right.value=="boolean"&&(i.op==="=="||i.op==="!="))return i.op==="=="===i.right.value?T(i.left,s,r):f(i.left,s,r);let p=B[i.op],[h,y]=V[p],l=P(i.left,s,r),m=P(i.right,s,r);if($(i.right)&&i.right.value===null)return[...p==="=="?S(i.left,s,r,m):a(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):a(i.left,m),R(h,y),...g?S(i.right,s,r,l):a(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...a(i.left),R("\u2209","is not one of"),...S(i.right,s,r,P(i.left,s,r))];if(i.t==="unary"&&i.op==="!"){let p=i.operand;return ht(p)?d({...p,op:B[p.op]}):b(p,"present")||b(p,"exists")?[...a(p.args[0]),R("\u2260","is not"),N]:p.t==="ident"?f(p,s,r):[c("not"),v,...T(p,s,r),w]}if(b(i,"present")||b(i,"exists"))return[...f(i.args[0],s,r),R("=","is"),N];if(b(i,"some"))return[...f(i,s,r).slice(1),R("=","is"),N];if(b(i,"every")&&i.args.length===2){let p=o(i.args[0]);if(p instanceof C){let h=p.nodes.filter(y=>{try{return q(i.args[1],{...n,subject:y,budget:2e3})!==!0}catch{return!0}});return[...f(i,s,r),c(","),c("not"),r.valueWords(new C(h))]}}return i.t==="ident"?[c("not"),O(r.fieldName(s,i.name))]:[c("not"),v,...f(i,s,r),w]},x;try{x=d(t.require)}catch{x=[c("not"),v,...f(t.require,s,r),w]}return z({...s===null?{}:{kind:s},parts:x,...u?{record:_(e.schema.tryDefinition(u.kind),u)}:{}})}function Rt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function jt(t){return(e,n)=>{let r=t[e]?.fields?.[n],s=r?.format??(r?.type==="date"?"date":void 0);return s||r?.unit?{...s?{format:s}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function wt(t,e){return{schema:e,said:Rt(t.says),...t.declared?{formatOf:jt(t.declared)}:{},...t.money?{money:t.money}:{}}}function Yt(t,e){return t.shape?Z(t.shape,wt(t.shape,e)):void 0}var vt=new WeakMap;function St(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=Kt(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let o=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!o)return s;let a=u.kinds;a||(a=vt.get(t.schema),a||vt.set(t.schema,a=dt(t.schema)));try{let d=t.today?.()??u.today?.()??k(),x=H(u,wt(u,t.schema),{graph:t.graph,subject:o??null,kinds:a,today:d});return{...s,line:x,...u.says?{}:{message:`${s.message} \u2014 ${x.text}`}}}catch{return s}})}function Nt(){lt((t,e,n,r)=>St({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),pt(Wt)}function Wt(t,e,n,r){let s=e.graph,u=it.from(t.schema,s.snapshot(),{validate:!1});for(let x of n?[...r].reverse().map(st):r)try{u.applyPrimitives([x],{restoring:!0})}catch{}let o=x=>t.violations(void 0,x),a=o(n?u:s),d=o(n?s:u);return{...ft(t.allInvariants(),a,d),violationsAfter:d}}function Kt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}Nt();export{H as brokenLineOf,Nt as judgeWithLines,Wt as judgedForASeat,Pt as problemWords,Yt as ruleLine,Z as ruleLineOf,mt as ruleLineWords,J as ruleSpacing,Et as ruleSpoken,Ot as ruleText,Kt as unlined,St as withLines};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as z,g as Z,h as ee}from"./chunk.4YRCKOX2.js";import{a as Q,b as X}from"./chunk.QXMTGLHR.js";import{b}from"./chunk.P6J6VFF5.js";import{d as q}from"./chunk.U3MQUIJL.js";import{a as K}from"./chunk.UT6642FC.js";import{h as I}from"./chunk.LFJH6X6O.js";import{m as J}from"./chunk.4QEDYRES.js";import{Da as Y,G as F,Ha as _,J as P,O as L,P as T,R as U,_ as v,ga as G,ua as V}from"./chunk.JE4QQEJE.js";import{a as $}from"./chunk.SDO3U72B.js";import{Wa as H,ca as j,ea as E,qb as A}from"./chunk.UG727PEE.js";import{b as W}from"./chunk.AJZBJBMO.js";var c=W(F(),1);var te=W(F(),1);function ne(){let{ai:i,aiDesk:n}=v(),{entries:r}=P(n),a=i.off===!0;return(0,te.useEffect)(()=>{a||n.load()},[n,a]),a?[]:r}var e=W(U(),1),ae=V($(()=>(__graviewPreload(import.meta.url,["./chunk.B7DCQJXV.js","./chunk.U6YOAS4X.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.3SKUJWFC.js")))),ge=ae.part((i,n)=>(0,e.jsx)(i.InteractionRow,{...n}),{quiet:!0,as:"li"}),ue=ae.part((i,n)=>(0,e.jsx)(i.ActivityFilter,{...n}),{quiet:!0,as:"div"}),ie=(i,n,r=re(i,[n]))=>({intent:n.intent,author:n.author.kind,...n.author.id?{authorId:n.author.id}:{},by:n.author,...n.ops[0]?.via?{via:n.ops[0].via}:{},...n.lineage?{basis:K(n.lineage)}:{},touched:[...new Set(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes))],...ce(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes),r),batch:n.id,at:n.at,...n.lineage?.interaction?{interaction:n.lineage.interaction}:{},seq:n.ops.at(-1).seq+1,...n.ops.every(A)?{withheld:!0}:{}});function he(i=4){let{store:n,principal:r}=v(),a=T(n,r),d=a.log.length;return(0,c.useMemo)(()=>{let s=a.batches(),l=re(a,s);return Q(s,o=>a.log.get(o)).reverse().slice(0,i).map(o=>{if("batch"in o)return ie(a,o.batch,l);let g=[...o.digest.batches].reverse().map(u=>ie(a,u,l));return{intent:X(o.digest),author:o.digest.author.kind,...o.digest.author.id?{authorId:o.digest.author.id}:{},by:o.digest.author,touched:[...new Set(g.flatMap(u=>u.touched))],batch:"",...g[0]?.at?{at:g[0].at}:{},seq:g[0]?.seq??0,digest:g}})},[a,d,i])}function re(i,n){let r=new Map;for(let a of n)for(let d of a.ops)if(!A(d))for(let s of d.primitives)(s.op==="add-node"||s.op==="remove-node")&&s.node&&r.set(s.node.id,j(i.schema.tryDefinition(s.node.kind),s.node));return r}function ce(i,n){let r={};for(let a of i){let d=n.get(a);d!==void 0&&(r[a]=d)}return Object.keys(r).length>0?{named:r}:{}}function ye({change:i}){let{store:n,principal:r,seats:a,people:d}=v();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[i.author==="human"&&i.by?.onBehalfOf===void 0&&(i.authorId===void 0||r.id===void 0||i.authorId===r.id)?"you":H(i.by??{kind:i.author,id:i.authorId},{graph:n.graph,schema:n.schema,seats:a,people:d}),I(i.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(i.via)]}):null]})}function fe({change:i,goes:n}){let{store:r}=v(),[a,d]=(0,c.useState)(!1),s=i.digest??[];return(0,e.jsxs)("li",{"data-testid":"activity-digest",style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)(ye,{change:i})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:i.intent})]}),(0,e.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":a,onClick:()=>d(l=>!l),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:a?"Hide":"Show each"})]}),a?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:s.map(l=>(0,e.jsxs)("li",{"data-testid":"digest-change",style:{display:"grid",gap:3},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:l.intent}),l.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",l.basis]}):null]}),l.withheld?null:(0,e.jsx)(B,{batch:l.batch})]}),l.touched.length>0?(0,e.jsx)("div",{"data-touched":l.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:l.touched.slice(0,4).map(o=>(0,e.jsx)(M,{id:o,label:r.graph.has(o)?b(r,o):l.named?.[o]??b(r,o),go:n(o)},o))}):null]},l.batch))}):null]})}function B({batch:i}){let{store:n,principal:r,noteSeat:a}=v(),d=T(n,r),s=L()?.open??!1,l=d.log.length,[o,g]=(0,c.useState)(null),u=(0,c.useMemo)(()=>d.canUndo(i),[d,i,l]);if(s||!u.ok&&u.ops.length===0)return null;let w=!u.ok,k=w?u.includeBatches:[];return(0,e.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,e.jsx)("button",{type:"button","data-testid":"undo-turn",title:w?`${u.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{g(null);try{let m=d.log.all().find(x=>x.batch===i&&x.author.kind==="agent");d.undo(w?[i,...k]:i,{author:r}),m&&a({type:"home",author:m.author})}catch(m){g(m instanceof Error?m.message:String(m))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...w?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:w?`undo +${k.length}`:"undo"}),o?(0,e.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:o}):null]})}function me({seq:i,intent:n}){let r=L();if(!r)return null;let a=r.past?.seq===i;return(0,e.jsx)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${n}\u201D`,title:"Show the app as it was here","aria-pressed":a,onPointerEnter:z,onFocus:z,onClick:()=>r.show(i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",flex:"0 0 auto"},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,e.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}function ve(){let i=()=>{let n=new URL(window.location.href);return n.searchParams.set("fresh","1"),n.toString()};return(0,e.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:n=>{n.preventDefault(),window.location.assign(i())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function M({id:i,label:n,go:r}){return r?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":i,title:`Go to ${n}`,onClick:()=>r(i),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(q,{label:n})}):(0,e.jsx)(q,{label:n})}function Oe({calls:i,seat:n,remembers:r=!1}){let a=he(),{store:d,principal:s,seats:l,people:o}=v(),g=ne(),[u,w]=(0,c.useState)("all"),[k,m]=(0,c.useState)(!1),x=t=>t!==void 0&&(t.id===s.id||t.onBehalfOf?.id===s.id)&&s.id!==void 0,oe=new Set(g.map(t=>t.id)),se=a.filter(t=>!(t.interaction!==void 0&&oe.has(t.interaction))&&(!k||x(t.by))),de=g.filter(t=>!k||x(t.by)).slice(0,4),C=[...u==="ai"?[]:se.map(t=>({at:t.at??"",change:t})),...u==="changes"?[]:de.map(t=>({at:t.at,entry:t}))].sort((t,y)=>t.at<y.at?1:t.at>y.at?-1:0),f=T(d,s),O=i.some(t=>t.phase==="running"),le=Z(),S=_("activity"),D=S.open,pe=G(),N=L(),R=t=>f.graph.has(t)?y=>{S.setOpen(!1),N?.past&&N.show(null),pe.record(y)}:null;return n===void 0&&i.length===0&&a.length===0&&g.length===0&&!r&&le===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"activity-button",...S.trigger,onClick:S.toggle,title:O?"An agent is working":"What has happened",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:O?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[O?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,a.length>0?a.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!D&&n!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,D?(0,e.jsxs)("section",{...S.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...Y,width:300,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...J,margin:0},children:"Activity"}),n!==void 0?(0,e.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:i.length>0||C.length>0?9:0,...i.length>0||C.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,e.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),n]}):null,i.length>0?(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:i.slice(0,6).map((t,y)=>(0,e.jsxs)("li",{style:{display:"grid",gap:2,fontSize:"0.8125rem",lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:t.phase==="running"?"var(--graview-accent)":t.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,e.jsxs)("span",{style:{color:"var(--graview-ink)"},children:[t.mutating?"changed":"read"," \xB7"," ",f.allMutations().find(p=>p.name===t.name)?.title??E(t.name)]})]}),!t.mutating&&t.reads&&t.reads.length>0?(0,e.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(t.reads)].slice(0,3).map(p=>(0,e.jsx)(M,{id:p,label:b(f,p),go:R(p)},p)),new Set(t.reads).size>3?(0,e.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(t.reads).size-3]}):null]}):Object.values(t.args).some(p=>typeof p=="string")?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(t.args).filter(p=>typeof p[1]=="string").slice(0,3).map(([p,h])=>(0,e.jsx)(M,{id:h,label:b(f,h),go:R(h)},p))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${y}`))}):null,g.length>0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ue,{shows:u,onShows:w,mine:k,onMine:m})}):null,C.length>0?(0,e.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:C.map(({change:t,entry:y},p)=>y!==void 0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ge,{entry:y,undo:h=>(0,e.jsx)(B,{batch:h})})},`ai:${y.id}`):t.digest?(0,e.jsx)(fe,{change:t,goes:R},`digest:${t.digest[0]?.batch??p}`):t.withheld?(0,e.jsx)("li",{"data-testid":"withheld-change",style:{display:"grid",gap:3,lineHeight:1.45},children:(0,e.jsx)("span",{"data-touched":"",style:{color:"var(--graview-ink-muted)",fontStyle:"italic"},children:t.intent})},`change:${p}`):(0,e.jsxs)("li",{"data-batch":t.batch,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsxs)("strong",{style:{fontWeight:600},children:[t.author==="human"&&t.by?.onBehalfOf===void 0&&(t.authorId===void 0||s.id===void 0||t.authorId===s.id)?"you":H(t.by??{kind:t.author,id:t.authorId},{graph:f.graph,schema:f.schema,seats:l,people:o}),I(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(me,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(B,{batch:t.batch}):null]}),(0,e.jsx)("div",{"data-touched":t.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:t.touched.slice(0,4).map(h=>(0,e.jsx)(M,{id:h,label:f.graph.has(h)?b(f,h):t.named?.[h]??b(f,h),go:R(h)},h))})]},`change:${p}`))}):null,(0,e.jsx)(ee,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),r?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(ve,{})]}):null]}):null]})}export{B as a,Oe as b};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{$ as S,F as g,G as T,R as v,ua as C}from"./chunk.JE4QQEJE.js";import{a as m}from"./chunk.SDO3U72B.js";import"./chunk.UG727PEE.js";import{b as c}from"./chunk.AJZBJBMO.js";var n=c(T(),1),r=c(v(),1),s=null,u=null,f=new Set,a=()=>{for(let e of f)e()},y=e=>(f.add(e),()=>void f.delete(e)),E=300,d=()=>{u!==null&&clearTimeout(u),u=null};function q(e,t){d(),x.prefetch(),!(s?.element===t&&s.target.on===e.on)&&(s={target:e,element:t},a())}function M(e=!1){if(d(),s!==null){if(e){s=null,a();return}u=setTimeout(()=>{u=null,s=null,a()},E)}}var R=()=>d(),P=()=>s,b="graview:hover-chips",h;function A(e){if(h!==void 0)return h;try{return(e??localStorage).getItem(b)!=="off"}catch{return!0}}function I(e,t){h=e;try{(t??localStorage).setItem(b,e?"on":"off")}catch{}e||(s=null),a()}function w(){let e=S(),t=g(e?.ai),o=e?.memory,l=(0,n.useSyncExternalStore)(y,()=>A(o),()=>!1),i=(0,n.useCallback)(H=>I(H,o),[o]);return{offered:t,on:t&&l,set:i}}function z({legend:e,style:t,choice:o}){let l=w();return l.offered?(0,r.jsxs)("fieldset",{"data-testid":"setting-hover-chips",style:{border:0,margin:0,padding:0,display:"grid",gap:5,...t},children:[(0,r.jsx)("legend",{style:{...e,padding:0},children:"AI suggestions on hover"}),(0,r.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:"A quiet suggestion beside a record the pointer rests on, when the AI is sure of one."}),(0,r.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[!0,!1].map(i=>(0,r.jsx)("button",{type:"button","aria-pressed":l.on===i,"data-testid":`setting-hover-chips-${i?"on":"off"}`,onClick:()=>l.set(i),style:o(l.on===i),children:i?"On":"Off"},String(i)))})]}):null}var x=C(m(()=>(__graviewPreload(import.meta.url,["./chunk.LWAZ6ZO6.js","./chunk.V5VQCANB.js","./chunk.UT6642FC.js","./chunk.WERBD5ZR.js","./chunk.HAY22FPJ.js","./chunk.U6YOAS4X.js","./chunk.TI4OSTQV.js","./chunk.BZ4VZ6WQ.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.35FR36BQ.js")))),k=x.part((e,t)=>{let o=e.HoverChip;return(0,r.jsx)(o,{...t})},{quiet:!0}),p=null,O=()=>p;function L(){let{on:e}=w(),t=(0,n.useSyncExternalStore)(y,P,()=>null),[o]=(0,n.useState)(()=>Symbol("hover-chip")),l=(0,n.useSyncExternalStore)(y,O,()=>null);return(0,n.useEffect)(()=>{if(e)return p===null&&(p=o,a()),()=>{p===o&&(p=null,s=null,d(),a())}},[e,o,l]),!e||t===null||l!==o||!t.element.isConnected?null:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(k,{rest:t,hold:R,leave:M})})}export{L as HoverChipDoor,z as HoverChipsSwitch,R as holdRest,A as hoverChipsWanted,M as leaveRest,q as restOn,I as setHoverChipsWanted,w as useHoverChipsSetting};