graview 0.1.36 → 0.1.38

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 (191) hide show
  1. package/dist/preview/chunk.2EJAIT33.js +1 -0
  2. package/dist/preview/chunk.2HFRVWWM.js +1 -0
  3. package/dist/preview/chunk.2VIGF4FO.js +1 -0
  4. package/dist/preview/chunk.33GN2NUT.js +1 -0
  5. package/dist/preview/chunk.36SQJMEE.js +1 -0
  6. package/dist/preview/chunk.3D5T3XIE.js +2 -0
  7. package/dist/preview/chunk.3FW4QNGV.js +1 -0
  8. package/dist/preview/chunk.3RT2GUZ5.js +1 -0
  9. package/dist/preview/chunk.3ZRHHB7X.js +1 -0
  10. package/dist/preview/{chunk.6QDFBCV4.js → chunk.4DEUD66C.js} +2 -2
  11. package/dist/preview/{chunk.S6GJGTJE.js → chunk.4EQSP7I3.js} +1 -1
  12. package/dist/preview/chunk.4Y6BCHV2.js +1 -0
  13. package/dist/preview/{chunk.LA7535VO.js → chunk.5MSO3KRO.js} +1 -1
  14. package/dist/preview/chunk.5VBBQ6Z3.js +1 -0
  15. package/dist/preview/chunk.5XJEGXDO.js +3 -0
  16. package/dist/preview/{chunk.6KMXLUOS.js → chunk.67WL7BGF.js} +1 -1
  17. package/dist/preview/{chunk.RKHEZ6KZ.js → chunk.6CKBIY7L.js} +1 -1
  18. package/dist/preview/chunk.6IHXTT6Z.js +1 -0
  19. package/dist/preview/{chunk.Y3IJDWNS.js → chunk.6ONRWFA6.js} +1 -1
  20. package/dist/preview/chunk.6UCRL4OF.js +1 -0
  21. package/dist/preview/chunk.6XJP7F3I.js +1 -0
  22. package/dist/preview/chunk.74RMHUCX.js +2 -0
  23. package/dist/preview/{chunk.OXZRGP53.js → chunk.7H5KVW2F.js} +1 -1
  24. package/dist/preview/chunk.7RSZMIAL.js +1 -0
  25. package/dist/preview/{chunk.QDHUDLJB.js → chunk.AFY35RJP.js} +1 -1
  26. package/dist/preview/{chunk.HPX3F7XX.js → chunk.AZCFXPEL.js} +1 -1
  27. package/dist/preview/{chunk.R45BF6JV.js → chunk.B5ILKGEF.js} +1 -1
  28. package/dist/preview/{chunk.5PU3RWYY.js → chunk.BRHRAVU2.js} +2 -2
  29. package/dist/preview/chunk.BUVAMSOZ.js +3 -0
  30. package/dist/preview/{chunk.6ZZZBDEG.js → chunk.DFVVS6C5.js} +1 -1
  31. package/dist/preview/chunk.DL637Q3W.js +1 -0
  32. package/dist/preview/chunk.DQJAEU4V.js +1 -0
  33. package/dist/preview/chunk.ESSQAMPM.js +1 -0
  34. package/dist/preview/{chunk.P75TPZWT.js → chunk.EUGWV3S6.js} +1 -1
  35. package/dist/preview/chunk.EV553KRT.js +1 -0
  36. package/dist/preview/chunk.EZP4FHDX.js +35 -0
  37. package/dist/preview/chunk.F6PIK2J2.js +1 -0
  38. package/dist/preview/{chunk.ZWZ5SEXT.js → chunk.FMVWXSQ7.js} +1 -1
  39. package/dist/preview/chunk.FTJBW25J.js +1 -0
  40. package/dist/preview/chunk.FUJM7GDV.js +1 -0
  41. package/dist/preview/{chunk.H4T56OXM.js → chunk.FYIQZMVF.js} +1 -1
  42. package/dist/preview/{chunk.IMRCAU4T.js → chunk.GR5Q4HTW.js} +1 -1
  43. package/dist/preview/chunk.GZ3IXNA4.js +1 -0
  44. package/dist/preview/chunk.HUSFMFXH.js +1 -0
  45. package/dist/preview/chunk.HVTGPEVW.js +1 -0
  46. package/dist/preview/chunk.I3SQJ2L2.js +1 -0
  47. package/dist/preview/chunk.IEDXW36H.js +1 -0
  48. package/dist/preview/chunk.IM7LXLIB.js +2 -0
  49. package/dist/preview/chunk.IU6ISXXC.js +1 -0
  50. package/dist/preview/{chunk.WQBDTLPZ.js → chunk.J2CR4RRH.js} +1 -1
  51. package/dist/preview/{chunk.J3TEJBI5.js → chunk.JWJQ2VXS.js} +1 -1
  52. package/dist/preview/chunk.K5KEECHL.js +88 -0
  53. package/dist/preview/{chunk.DANDYIB5.js → chunk.KNJZ2YNJ.js} +1 -1
  54. package/dist/preview/{chunk.OF34OZ4V.js → chunk.KSXB4LDF.js} +1 -1
  55. package/dist/preview/chunk.L34FY7QQ.js +1 -0
  56. package/dist/preview/chunk.L73VUBXN.js +4 -0
  57. package/dist/preview/{chunk.LMVCWYYG.js → chunk.L7JKEEMM.js} +1 -1
  58. package/dist/preview/chunk.LAW5PQEM.js +1 -0
  59. package/dist/preview/chunk.LDD3QX7G.js +1 -0
  60. package/dist/preview/chunk.LF7PU77M.js +7 -0
  61. package/dist/preview/chunk.LHO7L3CS.js +1 -0
  62. package/dist/preview/chunk.LU5LSXSW.js +1 -0
  63. package/dist/preview/chunk.MCVY6RRS.js +1 -0
  64. package/dist/preview/chunk.MQ7FNHXG.js +25 -0
  65. package/dist/preview/chunk.MVNUWK5Y.js +1 -0
  66. package/dist/preview/chunk.MWZK3HVG.js +1 -0
  67. package/dist/preview/{chunk.GUDKPK42.js → chunk.NH5TDAB2.js} +1 -1
  68. package/dist/preview/{chunk.MXJS67W4.js → chunk.NORRCKGN.js} +1 -1
  69. package/dist/preview/{chunk.FUR4IHWG.js → chunk.NPX7SPXM.js} +1 -1
  70. package/dist/preview/chunk.NQQHOSOK.js +1 -0
  71. package/dist/preview/chunk.NWWMUOZM.js +1 -0
  72. package/dist/preview/{chunk.2B4WVCVV.js → chunk.OE4QOBJF.js} +1 -1
  73. package/dist/preview/chunk.OEF3GPRM.js +1 -0
  74. package/dist/preview/{chunk.XRCGADKC.js → chunk.OS3L4ZOF.js} +1 -1
  75. package/dist/preview/chunk.OTL3Z345.js +1 -0
  76. package/dist/preview/{chunk.WJ2TWU2I.js → chunk.P3UPCI23.js} +1 -1
  77. package/dist/preview/chunk.PGKIEDYV.js +9 -0
  78. package/dist/preview/{chunk.42WJ6VJZ.js → chunk.PKUWET2F.js} +1 -1
  79. package/dist/preview/chunk.POHEWJKZ.js +1 -0
  80. package/dist/preview/chunk.PUBG2L6F.js +117 -0
  81. package/dist/preview/chunk.QT4XGC5Z.js +344 -0
  82. package/dist/preview/chunk.QTTBZJ6W.js +1 -0
  83. package/dist/preview/{chunk.ZEW2OOZ5.js → chunk.QYRPELLU.js} +1 -1
  84. package/dist/preview/chunk.RJDZOF2L.js +1 -0
  85. package/dist/preview/{chunk.CUCNT7MG.js → chunk.ROGYDMES.js} +1 -1
  86. package/dist/preview/chunk.RVJYEOFN.js +1 -0
  87. package/dist/preview/chunk.RZVZG2BQ.js +1 -0
  88. package/dist/preview/chunk.SGB6IMWN.js +1 -0
  89. package/dist/preview/chunk.SGLJTSTD.js +1 -0
  90. package/dist/preview/{chunk.ITXIFDQ7.js → chunk.SITFEJES.js} +1 -1
  91. package/dist/preview/{chunk.T2CN7UTZ.js → chunk.SZWX56WR.js} +6 -6
  92. package/dist/preview/chunk.TKSGC6XH.js +1 -0
  93. package/dist/preview/chunk.TOWYHWPB.js +17 -0
  94. package/dist/preview/{chunk.UJR3Y7MP.js → chunk.UF3L6FJO.js} +1 -1
  95. package/dist/preview/chunk.UXIFQIHA.js +2 -0
  96. package/dist/preview/{chunk.EBLKEQ7O.js → chunk.V2NBJDAX.js} +1 -1
  97. package/dist/preview/chunk.V5ZT5NSJ.js +1 -0
  98. package/dist/preview/chunk.VKHKYK5L.js +1 -0
  99. package/dist/preview/{chunk.KU6NIMQX.js → chunk.VNBR4DHD.js} +1 -1
  100. package/dist/preview/chunk.VSYHU5MA.js +1 -0
  101. package/dist/preview/chunk.VTWFVPKD.js +19 -0
  102. package/dist/preview/chunk.VV4BPOIK.js +1 -0
  103. package/dist/preview/chunk.W2HCJQVK.js +32 -0
  104. package/dist/preview/{chunk.HZPTBPJY.js → chunk.WERYQENC.js} +1 -1
  105. package/dist/preview/{chunk.FERBNBDE.js → chunk.WG5NIR23.js} +1 -1
  106. package/dist/preview/chunk.WLPTY4BF.js +5 -0
  107. package/dist/preview/chunk.XHWL7QBF.js +1 -0
  108. package/dist/preview/chunk.XM3NPZLP.js +1 -0
  109. package/dist/preview/chunk.YAXZNQY6.js +1 -0
  110. package/dist/preview/chunk.YG423NEB.js +1 -0
  111. package/dist/preview/{chunk.TGEF6TMM.js → chunk.YPY5BOEI.js} +1 -1
  112. package/dist/preview/{chunk.EDSPYKR4.js → chunk.YUJG5SN5.js} +1 -1
  113. package/dist/preview/chunk.YVR3ZMTV.js +1 -0
  114. package/dist/preview/chunk.YXH3IWNR.js +1 -0
  115. package/dist/preview/{chunk.WHTQHU3M.js → chunk.Z3ZKYSPN.js} +1 -1
  116. package/dist/preview/{chunk.O3OALXCI.js → chunk.ZLXPIEUC.js} +2 -2
  117. package/dist/preview/{chunk.OREMUXB5.js → chunk.ZRQI5VJF.js} +1 -1
  118. package/dist/preview/chunk.ZYCNEOAQ.js +1 -0
  119. package/dist/preview/index.html +43 -42
  120. package/dist/preview/page.js +7 -7
  121. package/package.json +6 -6
  122. package/dist/preview/chunk.272ZJXQP.js +0 -1
  123. package/dist/preview/chunk.27TLAVRR.js +0 -19
  124. package/dist/preview/chunk.2A2DLMT3.js +0 -1
  125. package/dist/preview/chunk.3PT55HXT.js +0 -1
  126. package/dist/preview/chunk.3SM2CHKF.js +0 -1
  127. package/dist/preview/chunk.3ZIOAPI5.js +0 -1
  128. package/dist/preview/chunk.4B73P2WA.js +0 -2
  129. package/dist/preview/chunk.4GXXD4NG.js +0 -1
  130. package/dist/preview/chunk.4Q56V7GS.js +0 -1
  131. package/dist/preview/chunk.4STIUIT6.js +0 -1
  132. package/dist/preview/chunk.53IKY7UP.js +0 -1
  133. package/dist/preview/chunk.56BPXB6E.js +0 -1
  134. package/dist/preview/chunk.64MJ5FRL.js +0 -1
  135. package/dist/preview/chunk.6II4BONS.js +0 -25
  136. package/dist/preview/chunk.6W7J76TK.js +0 -1
  137. package/dist/preview/chunk.7CO7S6QM.js +0 -27
  138. package/dist/preview/chunk.7G3B5QPH.js +0 -1
  139. package/dist/preview/chunk.7TBSVQSH.js +0 -1
  140. package/dist/preview/chunk.7YQYWOZR.js +0 -1
  141. package/dist/preview/chunk.AAZFVCSP.js +0 -2
  142. package/dist/preview/chunk.ACEYGWMO.js +0 -1
  143. package/dist/preview/chunk.ACXA55GW.js +0 -1
  144. package/dist/preview/chunk.BZ5VLPKB.js +0 -341
  145. package/dist/preview/chunk.CE3NOADH.js +0 -1
  146. package/dist/preview/chunk.CNJENUPC.js +0 -1
  147. package/dist/preview/chunk.CRPT3ZT3.js +0 -1
  148. package/dist/preview/chunk.D6RDTUX3.js +0 -1
  149. package/dist/preview/chunk.DSP62QYK.js +0 -9
  150. package/dist/preview/chunk.E77K6KBX.js +0 -1
  151. package/dist/preview/chunk.EQIGKXIG.js +0 -1
  152. package/dist/preview/chunk.ER5ILWKY.js +0 -3
  153. package/dist/preview/chunk.ET76FISZ.js +0 -17
  154. package/dist/preview/chunk.F5BCCGFK.js +0 -5
  155. package/dist/preview/chunk.FQKH67BP.js +0 -1
  156. package/dist/preview/chunk.FWBQVPMI.js +0 -1
  157. package/dist/preview/chunk.GOCUBIRW.js +0 -1
  158. package/dist/preview/chunk.GXLAZGYT.js +0 -1
  159. package/dist/preview/chunk.GZLYTPE7.js +0 -1
  160. package/dist/preview/chunk.IB32NOV5.js +0 -2
  161. package/dist/preview/chunk.JLXQ6ZLI.js +0 -1
  162. package/dist/preview/chunk.JZMA2AV7.js +0 -1
  163. package/dist/preview/chunk.K5NJTE3F.js +0 -35
  164. package/dist/preview/chunk.KBJG5SI2.js +0 -3
  165. package/dist/preview/chunk.LNNFNJKN.js +0 -1
  166. package/dist/preview/chunk.M4FQ7SSM.js +0 -1
  167. package/dist/preview/chunk.NJ62C2GU.js +0 -1
  168. package/dist/preview/chunk.NNCTJSD3.js +0 -1
  169. package/dist/preview/chunk.NWYOLGQ3.js +0 -1
  170. package/dist/preview/chunk.O6ROFVFD.js +0 -88
  171. package/dist/preview/chunk.OFJH7LDC.js +0 -1
  172. package/dist/preview/chunk.OH5BBE2B.js +0 -1
  173. package/dist/preview/chunk.OZR5NI4J.js +0 -1
  174. package/dist/preview/chunk.PWOVXARZ.js +0 -1
  175. package/dist/preview/chunk.Q63RPNUS.js +0 -1
  176. package/dist/preview/chunk.QEALNWWL.js +0 -117
  177. package/dist/preview/chunk.QLMUGC7R.js +0 -1
  178. package/dist/preview/chunk.QTITRX5Q.js +0 -1
  179. package/dist/preview/chunk.R7LRJS6B.js +0 -4
  180. package/dist/preview/chunk.SG23JC6D.js +0 -1
  181. package/dist/preview/chunk.SSRP5SBR.js +0 -1
  182. package/dist/preview/chunk.T47DLH5Z.js +0 -1
  183. package/dist/preview/chunk.VHWUGSFW.js +0 -1
  184. package/dist/preview/chunk.W42P7NOL.js +0 -1
  185. package/dist/preview/chunk.WGI5G6NM.js +0 -1
  186. package/dist/preview/chunk.XBTZXWJX.js +0 -1
  187. package/dist/preview/chunk.YNE5QR7Q.js +0 -1
  188. package/dist/preview/chunk.ZDNJK2SX.js +0 -1
  189. package/dist/preview/chunk.ZNS3LYJU.js +0 -1
  190. package/dist/preview/chunk.ZSSOTIFL.js +0 -1
  191. package/dist/preview/chunk.ZVMIHXVK.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graview",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "type": "module",
5
5
  "description": "The Graview command line: start a product, check its declaration, write its agent docs, serve its store, preview a document with no product and photograph its places, say whether a product is on one release, host it for an agent over MCP, apply an act to it, sync its seed, install the authoring skills. The tool; @graview/* is the framework.",
6
6
  "keywords": [
@@ -29,11 +29,11 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@graview/core": "0.1.36",
33
- "@graview/skills": "0.1.36",
34
- "@graview/ship": "0.1.36",
35
- "@graview/guest": "0.1.36",
36
- "@graview/tools": "0.1.36"
32
+ "@graview/guest": "0.1.38",
33
+ "@graview/core": "0.1.38",
34
+ "@graview/ship": "0.1.38",
35
+ "@graview/skills": "0.1.38",
36
+ "@graview/tools": "0.1.38"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=22"
@@ -1 +0,0 @@
1
- import{a as g}from"./chunk.TI4OSTQV.js";import{Eb as c,Ib as y,Ua as p}from"./chunk.F5BCCGFK.js";function h(t,i=()=>!0){let e=c(t),n=new Set(t.map(o=>o.lineage?.suggestion));return t.filter(o=>o.suggests&&!o.withheld&&!e.has(o.id)&&!n.has(o.id)).map(({id:o,batch:s,suggests:r,intent:x,author:b,lineage:d,at:O})=>{let l=new Set;return JSON.stringify(r.map(u=>u.args),(u,a)=>(typeof a=="string"&&i(a)&&l.add(a),a)),{id:o,batch:s,calls:r,intent:x,author:b,...d?{lineage:d}:{},at:O,about:[...l]}})}function S(t,i){return t.ops.length>0&&t.ops.every(e=>e.suggests!==void 0||e.undoes!==void 0&&i(e.undoes)?.suggests!==void 0)}var f=t=>JSON.stringify([t.kind,t.id??"",t.name??""]);function I(t,i=()=>{}){let e=[];for(let n of t){if(S(n,i))continue;let o=e.at(-1);if(!y(n.author)){e.push({batch:n});continue}if(o&&"digest"in o&&f(o.digest.author)===f(n.author)){let s=[...o.digest.batches,n];e[e.length-1]={digest:{author:o.digest.author,batches:s,things:m(s),at:n.at}}}else e.push({digest:{author:n.author,batches:[n],things:m([n]),at:n.at}})}return e}var m=t=>t.reduce((i,e)=>i+(e.undone?0:e.ops.length),0);function j(t,i=new Date().toISOString().slice(0,10)){let e=t.at.slice(0,10),n=e===i?"today":`on ${new Date(`${e}T12:00:00Z`).toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"})}`;return`Tidied ${t.things===1?"one thing":`${t.things} things`} ${n}`}var A=t=>t;function v(t,i){let e=g(t),n=e?.store??t,o=i??e?.principal,s=(o!==void 0?n.seenBy(o):n).log.all();return h(s,r=>n.graph.has(r))}function w(t,i,e){let n=v(t,e).find(o=>o.id===i);if(!n)throw new p("That suggestion is no longer waiting: it was accepted or declined, or it is not one you can see.");return n}function D(t,i,e={}){let n=g(t)?.store??t,o=e.author??A(n).by,s=w(n,i,o);return n.applyAll(s.calls,{...e,author:o,lineage:{...s.lineage,suggestion:i}})}function L(t,i,e={}){let n=g(t)?.store??t,o=e.author??A(n).by,s=w(n,i,o);return n.undo(s.batch,{...e,author:o})}export{I as a,j as b,v as c,D as d,L as e};
@@ -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.ZDNJK2SX.js";import{e as ee}from"./chunk.ZSSOTIFL.js";import{b as S}from"./chunk.IMRCAU4T.js";import{m as X}from"./chunk.BZ5VLPKB.js";import{F as se,Q as Z,a as K,sa as V,wa as J,xa as Q}from"./chunk.6II4BONS.js";import{K as Y,N as M,X as U}from"./chunk.F5BCCGFK.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=Q(K(()=>(__graviewPreload(import.meta.url,["./chunk.27TLAVRR.js","./chunk.OREMUXB5.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.K5NJTE3F.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=J("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:V,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{m as y}from"./chunk.BZ5VLPKB.js";import{F as N,Q as u,S as f}from"./chunk.6II4BONS.js";import{b as g}from"./chunk.AJZBJBMO.js";var p=g(N(),1);var n=g(u(),1);var R={default:{background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)"},muted:{background:"var(--graview-panel-muted, #f7f5f1)",color:"var(--graview-ink, #1a1a1a)"},warning:{background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)"}},T={color:"var(--graview-ink-muted, #55514a)"},C={color:"var(--graview-ink-faint, #625d55)"};function H(e){let[l,a]=(0,p.useState)(z);return(0,p.useEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let t=()=>{let i=W(r,parseFloat(getComputedStyle(r).paddingBottom)||0);a(s=>s.overflowing===i.overflowing&&s.above===i.above&&s.below===i.below?s:i)};t();let d=new ResizeObserver(t);d.observe(r);for(let i of r.children)d.observe(i);return r.addEventListener("scroll",t,{passive:!0}),()=>{d.disconnect(),r.removeEventListener("scroll",t)}}),l}var z={overflowing:!1,above:!1,below:!1};function W(e,l=0){let a=e.scrollHeight>e.clientHeight+1,r=e.scrollWidth>e.clientWidth+1;return{overflowing:a||r,above:a&&e.scrollTop>1,below:a&&e.scrollTop+e.clientHeight<e.scrollHeight-l-1}}var A=(0,p.createContext)(null),I=(0,p.createContext)(null);function O({level:e,said:l=!0,style:a,children:r}){if(e===void 0)return(0,n.jsx)("strong",{style:a,...l?{}:{"aria-hidden":!0},children:r});let t=`h${e}`;return(0,n.jsx)(t,{style:{margin:0,...a},children:r})}function E({title:e,subtitle:l,meta:a,selected:r,tone:t="default",children:d,style:i,fit:s=!1,variant:h,heading:w}){let c=(0,p.useRef)(null),{overflowing:b,above:x,below:S}=H(c),P=f(),o=(h??(P==="fullscreen"?"page":"card"))==="page",k=(0,p.useContext)(A),v=(0,p.useContext)(I);return(0,n.jsxs)("div",{"data-graview-primitive":"panel","data-graview-variant":o?"page":"card","data-selected":r||void 0,style:{display:"flex",flexDirection:"column",gap:o?12:"var(--graview-gap, 7px)",height:o||s?"auto":"100%",maxHeight:o?"none":"100%",padding:o?0:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:o?0:"var(--graview-radius, 12px)",border:o?"none":`1px solid ${r?"var(--graview-accent, #2f6f5e)":"var(--graview-edge, #e4e0d8)"}`,boxShadow:o?"none":r?"0 0 0 1px var(--graview-accent-dim), var(--graview-lift-low)":"var(--graview-lift-low)",overflow:o?"visible":"hidden",...R[t],...o?{background:"transparent"}:{},...i},children:[t==="warning"?(0,n.jsx)("span",{"data-graview-broken":"",style:y,children:"Implicated in a problem."}):null,e===void 0||e===k?null:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0},children:[t==="warning"?(0,n.jsx)("span",{"aria-hidden":"true",title:"Implicated in a problem",style:{color:"var(--graview-warn)",flex:"0 0 auto"},children:"\u26A0"}):null,(0,n.jsx)(O,{level:w,said:v===null||e!==v,style:{fontFamily:"var(--graview-font-display, inherit)",fontSize:o?"1.5625rem":"0.9375rem",lineHeight:o?1.15:1.25,fontWeight:o?600:560,letterSpacing:o?"-0.012em":"0.005em",minWidth:0,overflowWrap:"anywhere"},children:e}),a===void 0?null:(0,n.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",letterSpacing:"0.08em",textTransform:"uppercase",minWidth:0,overflowWrap:"anywhere",...C},children:a})]}),l===void 0?null:(0,n.jsx)("div",{style:{fontSize:o?"0.90625rem":"0.8125rem",lineHeight:1.5,...T},children:l}),(0,n.jsx)("div",{ref:c,className:o?void 0:"graview-scroll",...b&&!o?{tabIndex:0,role:"region",...typeof e=="string"?{"aria-label":e}:{}}:{},style:{display:"flex",flexDirection:"column",gap:o?22:"var(--graview-gap, 7px)",flex:"1 1 auto",...o?{overflow:"visible"}:{marginBottom:"calc(-1 * var(--graview-pad, 15px))",paddingBottom:"var(--graview-pad, 15px)"}},"data-graview-more-above":x&&!o?"":void 0,"data-graview-more-below":S&&!o?"":void 0,children:d})]})}function m({label:e,hue:l,selected:a,title:r,pickId:t,emphasis:d}){let i=typeof e=="string"?e:void 0,s=l===void 0?void 0:Math.round(l);return(0,n.jsxs)("span",{"data-graview-primitive":"chip","data-selected":a||void 0,"data-graview-pick":t,"data-graview-emphasis":d,title:r??i,style:{cursor:t?"pointer":void 0,display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",maxWidth:"min(28ch, 100%)",overflow:"hidden",letterSpacing:"0.01em",border:`1px solid ${a?"var(--graview-accent)":s===void 0?"var(--graview-edge)":`hsl(${s} 55% var(--graview-tint-lightness) / 0.45)`}`,background:s===void 0?"var(--graview-panel-muted)":`hsl(${s} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * 0.65))`,color:"var(--graview-ink, #1a1a1a)",boxShadow:a?"0 0 14px -4px var(--graview-accent)":void 0},children:[s===void 0?null:(0,n.jsx)("span",{"aria-hidden":"true",style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",marginRight:6,background:`hsl(${s} 55% var(--graview-tint-lightness) / 0.9)`}}),(0,n.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]})}function L({items:e,max:l=8,selectedIds:a=[],pick:r=!1}){let t=e.slice(0,l),d=e.length-t.length;return(0,n.jsxs)("div",{"data-graview-primitive":"roster",style:{display:"flex",flexWrap:"wrap",gap:6,alignContent:"flex-start"},children:[t.map(i=>(0,n.jsx)(m,{label:i.label,...i.hue===void 0?{}:{hue:i.hue},...r?{pickId:i.id}:{},...i.emphasis===void 0?{}:{emphasis:i.emphasis},selected:a.includes(i.id)},i.id)),d>0?(0,n.jsx)(m,{label:`+${d} more`}):null]})}function F({label:e,count:l,items:a,onExpand:r,flagged:t,problems:d}){return(0,n.jsx)(E,{title:e,meta:d?(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[d,(0,n.jsx)("span",{children:l})]}):l,tone:t?"warning":"muted",style:r?{cursor:"zoom-in"}:void 0,children:a&&a.length>0?(0,n.jsx)(L,{items:a,max:6,pick:!0}):null})}export{A as a,I as b,E as c,m as d,L as e,F as f};
@@ -1 +0,0 @@
1
- import{c as b,d as J}from"./chunk.GZLYTPE7.js";import{a as O,f as q}from"./chunk.IMRCAU4T.js";import{Ab as P,B as m,Bb as w,Fa as j,Ga as A,Qa as v,ab as D,bb as L,cb as N,ic as Z,jc as k,ka as R,na as x,ua as S,wb as M}from"./chunk.F5BCCGFK.js";var E=n=>n.safeParse?.(void 0).success??!1,T=n=>b(n).shape,F=n=>{let s=b(n);if(m(s)?.type!=="literal")return;let e=m(s)?.values;return e&&e.length===1&&typeof e[0]=="string"?e[0]:void 0};function g(n,s){let e=E(s),o=b(s),r=m(o)?.type,l=M(s);if(l)return{control:"node",name:n,optional:e,kinds:l};let y=S(s);if(y)return{control:"linked",name:n,optional:e,relation:y};if(A(s)){let a=j(n);return{control:"repeat",name:n,optional:e,...a?{of:a}:{}}}if(r==="boolean")return{control:"boolean",name:n,optional:e};let p=R(o);if(p)return{control:"file",name:n,optional:e,...p==="image"?{image:!0}:{}};if(r==="object"){let a=o.shape??{};return{control:"group",name:n,optional:e,fields:Object.entries(a).map(([c,d])=>g(c,d))}}if(r==="union"){let a=m(o)?.options??[],c=a.map(t=>T(t));if(c.every(t=>t!==void 0)){let t=Object.keys(c[0]??{}).find(f=>c.every(u=>F(u?.[f])!==void 0));if(t)return{control:"variant",name:n,optional:e,tag:t,options:a.map((f,u)=>({value:F(c[u]?.[t])??"",fields:Object.entries(c[u]??{}).filter(([h])=>h!==t).map(([h,z])=>g(h,z))}))}}let d=a.map(t=>F(t));return d.every(t=>t!==void 0)?{control:"choice",name:n,optional:e,options:d}:{control:"opaque",name:n,optional:e}}if(r==="array"){let a=m(o)?.element;return a!==void 0?{control:"list",name:n,optional:e,item:g(n,a)}:{control:"opaque",name:n,optional:e}}let i=J(s);return i.type==="text"?{control:"text",name:n,optional:e,...i.long?{long:!0}:{},...x(o)?{app:!0}:{},...O(o)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:e,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:e,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:e,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:e,options:i.options}:{control:"opaque",name:n,optional:e}}function B(n){let s=n.shape;return s?Object.entries(s).map(([e,o])=>g(e,o)):[]}function K(n,s){let e={...s};for(let o of n){let r=s[o.name];r===void 0&&!o.optional&&(o.control==="list"||o.control==="boolean")&&(e[o.name]=o.control==="list"?[]:!1),o.control==="text"&&o.holds&&typeof r=="string"&&(e[o.name]=r.trim()===""?void 0:o.holds==="duration"?q(r)??r:r.trim()),o.control==="group"&&r!==void 0&&typeof r=="object"&&r!==null&&(e[o.name]=K(o.fields,r))}return e}function C(n,s,e){let o=n.derived?.act==="edit"&&n.subject?e[n.subject.arg]:void 0,r=typeof o=="string"?s.getNode(o):void 0;return r?Object.fromEntries((n.writes??[]).filter(l=>r[l]!==void 0&&r[l]!==null).map(l=>[l,r[l]])):{}}function I(n,s){return Object.fromEntries(Object.entries(n).filter(([e,o])=>!Object.hasOwn(s,e)||JSON.stringify(o)!==JSON.stringify(s[e])))}function _(n,s,e,o){let r=Z.keptFrom?.(n,s),l=new Set;if(!r)return l;let y=Object.keys(e.input.shape??{});for(let c of e.creates??[]){let d=r({id:"\0new",kind:c});for(let t of y)d?.(t)&&l.add(t)}let p=o===void 0?void 0:n.graph.getNode(o),i=p&&n.schema.tryDefinition(p.kind),a=p&&r(p);if(i&&a)for(let c of w(e,i))a(c)&&y.includes(c)&&l.add(c);return l}function dn(n,s,e,o){let r=new Set,l=s?.sees??[];if(L(e)||!l.some(k))return r;let y=D(e),p=(d,t)=>{let f=l.filter(u=>u.kinds.includes(d)&&N(u,y));return f.some(k)?v.has(t)||f.some(u=>!k(u)||(u.fields===void 0||u.fields.includes(t))&&!u.hide?.includes(t)):!0},i=Object.keys(o.input.shape??{}),a=new Map,c=(d,t)=>a.set(d,a.get(d)===!0||t);for(let d of o.creates??[]){let t=Object.keys(n.tryDefinition(d)?.fields.shape??{});for(let f of i)t.includes(f)&&c(f,p(d,f))}for(let d of P(n,o)){let t=n.tryDefinition(d);if(t)for(let f of w(o,t))i.includes(f)&&c(f,p(d,f))}for(let[d,t]of a)t||r.add(d);return r}export{B as a,K as b,C as c,I as d,_ as e,dn as f};
@@ -1 +0,0 @@
1
- import{a as ce,c as ge,d as ye,f as he}from"./chunk.E77K6KBX.js";import{f as T,i as k,j as pe,k as ue,q as fe,r as me}from"./chunk.GZLYTPE7.js";import{b as de}from"./chunk.4B73P2WA.js";import{c as se,f as le}from"./chunk.IMRCAU4T.js";import{F as Ae,Q as ae,Z as ie,i as re,v as oe}from"./chunk.6II4BONS.js";import{Fa as ne,Ga as te,X as Q,Z as X,ea as Z,ua as ee}from"./chunk.F5BCCGFK.js";import{b as M}from"./chunk.AJZBJBMO.js";var l=M(Ae(),1),i=M(ae(),1);function He({affordance:n,onApply:a,onCancel:p,store:b}){let y=ie(),s=b??y?.store,[S,B]=(0,l.useState)({}),[f,C]=(0,l.useState)(""),[F,I]=(0,l.useState)(q),[G,J]=(0,l.useState)(void 0),_=(0,l.useId)(),P=(0,l.useRef)(null),x=n.open.filter(e=>!(e.name in S)),o=x[0],w=s.allMutations().find(e=>e.name===n.mutation),j=(0,l.useMemo)(()=>Oe(w,s,n.args??{}),[w,s,n.args]),d=o?j[o.name]:void 0,$=me(n.open.filter(e=>e.shape?.type==="date").map(e=>e.name)),we=(()=>{if(!$||o?.name!==$.end||o.shape?.type!=="date")return;let e=S[$.start];if(typeof e!="string")return;let r=j[$.start];return fe(typeof r=="string"?r:void 0,e,typeof d=="string"?d:void 0,{time:o.shape.time===!0,instant:o.shape.instant===!0})})();if((0,l.useEffect)(()=>{C(we??be(d,o?.shape)),I(Array.isArray(d)?d:q),J(d)},[o?.name]),(0,l.useEffect)(()=>{P.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[o?.name]),(0,l.useLayoutEffect)(()=>{let e=P.current,r=typeof document>"u"?null:document.activeElement;if(!e||r&&r!==document.body&&!e.contains(r))return;let u=e.querySelector("form input, [role=group] button:not([disabled])");u&&u!==r&&u.focus()},[o?.name]),!o)return null;let h=e=>{let r=d!==void 0&&JSON.stringify(e)===JSON.stringify(d)?void 0:e,u={...S,[o.name]:r};if(n.open.filter(R=>!(R.name in u)).length===0){let R=a(Object.fromEntries(Object.entries(u).filter(([,K])=>K!==void 0)));R&&R.length>0&&B(Object.fromEntries(Object.entries(u).filter(([K])=>!R.includes(K))))}else B(u)},A=o.optional?(0,i.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=o.shape??{type:"unknown"},c=t.type==="number"?t.amount:void 0,g=Ne(o,t),m=T(s.schema,w,o.name),U=ee((w?.input?.shape??{})[o.name]),ve=te((w?.input?.shape??{})[o.name]),O=ne(o.name),ke=typeof d=="boolean"?d?"yes":"no":d,[W,Se]=(0,l.useState)(""),V=(0,l.useMemo)(()=>{let e=g.map(r=>s.graph.getNode(r)).filter(r=>r!==void 0);return de(e,r=>s.schema.tryDefinition(r))},[g,s]),L=e=>{let r=Ce(s,t,e),u=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?m.option(e):r,N=V.get(e);return N?`${u} \xB7 ${N}`:u},z=(0,l.useMemo)(()=>{let e=W.trim().toLowerCase();return e===""?g:g.filter(r=>L(r).toLowerCase().includes(e))},[g,W,s,t,V]),v=t.type==="several",Y=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,H=v&&g.length===0,D=o.kinds&&o.kinds.length>0&&!o.kinds.includes("*")?o.kinds.map(e=>X(Z(s.schema.tryDefinition(e),e))).join(" or "):m.label,xe=n.open.length>1?`${D} \xB7 ${n.open.length-x.length+1} of ${n.open.length}`:D;return(0,i.jsxs)("div",{ref:P,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||g.length>0?(0,i.jsx)("span",{id:_,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:xe}):null,g.length>E?(0,i.jsx)("input",{type:"search",value:W,onChange:e=>Se(e.target.value),placeholder:`Filter ${g.length}\u2026`,"aria-label":`Filter ${D}`,"data-testid":"ask-filter",style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,ve?(0,i.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(G??(d===void 0?void 0:null))},children:[(0,i.jsx)(ye,{value:G,onChange:J,start:O?S[O]??j[O]:void 0,label:`${O?T(s.schema,w,O).label:m.label} repeats`,name:o.name}),(0,i.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,i.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:x.length>1?"Next":"Apply"}),A]})]}):U?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ge,{relation:U,value:d,onChange:h,label:m.label}),A]}):Y?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ce,{as:"control",value:d,onChange:h,several:v,image:Y.image===!0,label:m.label}),A]}):g.length>0?(0,i.jsxs)("div",{role:"group","aria-labelledby":_,style:{display:"flex",flexWrap:"wrap",gap:4},children:[z.slice(0,E).map(e=>{let r=v?F.includes(e):e===ke;return(0,i.jsx)("button",{type:"button","aria-label":`${D}: ${L(e)}`,...v?{"aria-pressed":r}:r?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...r?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>v?I(u=>u.includes(e)?u.filter(N=>N!==e):[...u,e]):h(t.type==="boolean"?e==="yes":e),children:L(e)},e)}),z.length>E?(0,i.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[z.length-E," more \u2014 type to narrow"]}):null,z.length===0?(0,i.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",g.length," match that."]}):null,v?(0,i.jsx)("button",{type:"button",disabled:F.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=F;I(q),h(e)},children:x.length>1?"Next":"Apply"}):null,A]}):(0,i.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),d!==void 0&&f===be(d,t)){h(void 0);return}if(H){h(f.split(/[,\n]/).map(r=>r.trim()).filter(Boolean));return}if(f.trim().length!==0){if(c){let r=ue(f,c);r!==void 0&&h(r);return}h(t.type==="number"?t.duration?le(f)??f:Number(f):f)}},children:[t.type==="text"&&t.long?(0,i.jsx)("textarea",{autoFocus:!0,name:o.name,"aria-label":m.label,placeholder:m.label,value:f,rows:4,onChange:e=>C(e.target.value),onKeyDown:e=>{e.key==="Escape"?p():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):t.type==="date"?(0,i.jsx)(he,{autoFocus:!0,name:o.name,label:m.label,value:f===""?void 0:f,time:t.time===!0,instant:t.instant===!0,onChange:e=>C(e??""),onCancel:p,boxStyle:{fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):(0,i.jsx)("input",{autoFocus:!0,type:t.type==="number"&&!t.duration&&!c?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...c?{inputMode:"decimal","data-graview-amount":c.format??"unit"}:{},name:o.name,"aria-label":m.label,placeholder:H?`${m.label}, separated by commas`:c?`${m.label}, ${k(c).hint} \u2014 ${k(c).prefix??""}${k(c).placeholder}${k(c).suffix?` ${k(c).suffix}`:""}`:m.label,value:f,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>C(e.target.value),onKeyDown:e=>{e.key==="Escape"&&p()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,i.jsx)("button",{type:"submit",disabled:!H&&f.trim().length===0,style:{fontSize:"0.8125rem"},children:x.length>1?"Next":"Apply"}),A]})]})}var q=[];function Oe(n,a,p){let b=n?.derived?.act==="edit"&&n.subject?p[n.subject.arg]:void 0,y=typeof b=="string"?a.graph.getNode(b):void 0;return y?Object.fromEntries((n.writes??[]).filter(s=>y[s]!==void 0&&y[s]!==null).map(s=>[s,y[s]])):{}}function be(n,a){return typeof n=="number"?a?.type==="number"&&a.amount?pe(n,a.amount):String(n):Array.isArray(n)?n.every(p=>typeof p=="string")?n.join(", "):"":typeof n!="string"?"":n}var E=10;function Ne(n,a){return n.candidates&&n.candidates.length>0?n.candidates:a.type==="choice"?a.options:a.type==="several"&&a.of.type==="choice"?a.of.options:a.type==="boolean"?Re:[]}var Re=["yes","no"];function Ce(n,a,p){return a.type==="boolean"||a.type==="choice"||a.type==="several"&&a.of.type==="choice"?p:$e(n,p)}function $e(n,a){let p=re(a);if(p){let s=se(n.schema,n.graph.getNode(p.from)?.kind??"",p.kind,"out");return s.charAt(0).toUpperCase()+s.slice(1)}let b=oe(a);if(b.length>0)return b.map(s=>n.schema.tryDefinition(s)?.plural??`${s}s`).join(" + ");let y=n.graph.getNode(a);return y?Q(n.schema.tryDefinition(y.kind),y):a}export{He as a,$e as b};
@@ -1 +0,0 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as q,g as Z,h as ee}from"./chunk.ZVMIHXVK.js";import{a as Q,b as X}from"./chunk.272ZJXQP.js";import{b}from"./chunk.3SM2CHKF.js";import{d as D}from"./chunk.2A2DLMT3.js";import{a as K}from"./chunk.UT6642FC.js";import{h as A}from"./chunk.GZLYTPE7.js";import{m as J}from"./chunk.BZ5VLPKB.js";import{F,I as P,N as L,O as T,Q as U,Y as m,a as $,ea as G,sa as V,wa as Y,xa as _}from"./chunk.6II4BONS.js";import{Ma as z,X as B,Z as E,gb as R}from"./chunk.F5BCCGFK.js";import{b as W}from"./chunk.AJZBJBMO.js";var u=W(F(),1);var te=W(F(),1);function ne(){let{ai:i,aiDesk:n}=m(),{entries:a}=P(n),r=i.off===!0;return(0,te.useEffect)(()=>{r||n.load()},[n,r]),r?[]:a}var e=W(U(),1),ae=_($(()=>(__graviewPreload(import.meta.url,["./chunk.TGEF6TMM.js","./chunk.D6RDTUX3.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.EQIGKXIG.js")))),pe=ae.part((i,n)=>(0,e.jsx)(i.InteractionRow,{...n}),{quiet:!0,as:"li"}),ge=ae.part((i,n)=>(0,e.jsx)(i.ActivityFilter,{...n}),{quiet:!0,as:"div"}),ie=(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=>!R(a)).flatMap(a=>a.writes))],...he(i,n.ops.filter(a=>!R(a))),batch:n.id,at:n.at,...n.lineage?.interaction?{interaction:n.lineage.interaction}:{},seq:n.ops.at(-1).seq+1,...n.ops.every(R)?{withheld:!0}:{}});function ue(i=4){let{store:n,principal:a}=m(),r=T(n,a),d=r.log.length;return(0,u.useMemo)(()=>Q(r.batches(),s=>r.log.get(s)).reverse().slice(0,i).map(s=>{if("batch"in s)return ie(r,s.batch);let o=[...s.digest.batches].reverse().map(l=>ie(r,l));return{intent:X(s.digest,new Date().toISOString().slice(0,10)),author:s.digest.author.kind,...s.digest.author.id?{authorId:s.digest.author.id}:{},by:s.digest.author,touched:[...new Set(o.flatMap(l=>l.touched))],batch:"",...o[0]?.at?{at:o[0].at}:{},seq:o[0]?.seq??0,digest:o}}),[r,d,i])}function he(i,n){let a={};for(let r of n)for(let d of r.primitives)d.op==="remove-node"&&d.node&&(a[d.node.id]=B(i.schema.tryDefinition(d.node.kind),d.node));return Object.keys(a).length>0?{removed:a}:{}}function ce({change:i}){let{store:n,principal:a,seats:r,people:d}=m();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[i.author==="human"&&i.by?.onBehalfOf===void 0&&(i.authorId===void 0||a.id===void 0||i.authorId===a.id)?"you":z(i.by??{kind:i.author,id:i.authorId},{graph:n.graph,schema:n.schema,seats:r,people:d}),A(i.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",A(i.via)]}):null]})}function ye({change:i,goes:n}){let{store:a}=m(),[r,d]=(0,u.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)(ce,{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":r,onClick:()=>d(o=>!o),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:r?"Hide":"Show each"})]}),r?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:s.map(o=>(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:o.intent}),o.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",o.basis]}):null]}),o.withheld?null:(0,e.jsx)(M,{batch:o.batch})]}),o.touched.length>0?(0,e.jsx)("div",{"data-touched":o.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:o.touched.slice(0,4).map(l=>(0,e.jsx)(O,{id:l,label:a.graph.has(l)?b(a,l):o.removed?.[l]??b(a,l),go:n(l)},l))}):null]},o.batch))}):null]})}function M({batch:i}){let{store:n,principal:a,noteSeat:r}=m(),d=T(n,a),s=L()?.open??!1,o=d.log.length,[l,v]=(0,u.useState)(null),c=(0,u.useMemo)(()=>d.canUndo(i),[d,i,o]);if(s||!c.ok&&c.ops.length===0)return null;let w=!c.ok,k=w?c.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?`${c.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{v(null);try{let f=d.log.all().find(x=>x.batch===i&&x.author.kind==="agent");d.undo(w?[i,...k]:i,{author:a}),f&&r({type:"home",author:f.author})}catch(f){v(f instanceof Error?f.message:String(f))}},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"}),l?(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:l}):null]})}function fe({seq:i,intent:n}){let a=L();if(!a)return null;let r=a.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":r,onPointerEnter:q,onFocus:q,onClick:()=>a.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 me(){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 O({id:i,label:n,go:a}){return a?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":i,title:`Go to ${n}`,onClick:()=>a(i),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(D,{label:n})}):(0,e.jsx)(D,{label:n})}function Oe({calls:i,seat:n,remembers:a=!1}){let r=ue(),{store:d,principal:s,seats:o,people:l}=m(),v=ne(),[c,w]=(0,u.useState)("all"),[k,f]=(0,u.useState)(!1),x=t=>t!==void 0&&(t.id===s.id||t.onBehalfOf?.id===s.id)&&s.id!==void 0,re=new Set(v.map(t=>t.id)),oe=r.filter(t=>!(t.interaction!==void 0&&re.has(t.interaction))&&(!k||x(t.by))),se=v.filter(t=>!k||x(t.by)).slice(0,4),I=[...c==="ai"?[]:oe.map(t=>({at:t.at??"",change:t})),...c==="changes"?[]:se.map(t=>({at:t.at,entry:t}))].sort((t,h)=>t.at<h.at?1:t.at>h.at?-1:0),y=T(d,s),H=i.some(t=>t.phase==="running"),de=Z(),S=Y("activity"),N=S.open,le=G(),j=L(),C=t=>y.graph.has(t)?h=>{S.setOpen(!1),j?.past&&j.show(null),le.record(h)}:null;return n===void 0&&i.length===0&&r.length===0&&v.length===0&&!a&&de===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:H?"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:H?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[H?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,r.length>0?r.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!N&&n!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,N?(0,e.jsxs)("section",{...S.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...V,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||I.length>0?9:0,...i.length>0||I.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,h)=>(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"," ",y.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)(O,{id:p,label:b(y,p),go:C(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,g])=>(0,e.jsx)(O,{id:g,label:b(y,g),go:C(g)},p))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${h}`))}):null,v.length>0?(0,e.jsx)(u.Suspense,{fallback:null,children:(0,e.jsx)(ge,{shows:c,onShows:w,mine:k,onMine:f})}):null,I.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:I.map(({change:t,entry:h},p)=>h!==void 0?(0,e.jsx)(u.Suspense,{fallback:null,children:(0,e.jsx)(pe,{entry:h,undo:g=>(0,e.jsx)(M,{batch:g})})},`ai:${h.id}`):t.digest?(0,e.jsx)(ye,{change:t,goes:C},`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":z(t.by??{kind:t.author,id:t.authorId},{graph:y.graph,schema:y.schema,seats:o,people:l}),A(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",A(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(fe,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(M,{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(g=>(0,e.jsx)(O,{id:g,label:y.graph.has(g)?b(y,g):t.removed?.[g]??b(y,g),go:C(g)},g))})]},`change:${p}`))}):null,(0,e.jsx)(ee,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),a?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(me,{})]}):null]}):null]})}export{M as a,Oe as b};
@@ -1,2 +0,0 @@
1
- import{a as ee,b as E,d as oe,g as se,h as re,i as ie}from"./chunk.IMRCAU4T.js";import{Ca as T,E as I,F as w,Ga as Q,H as P,Ia as V,K as b,Ka as X,L as K,M as Y,P as v,R as H,X as $,ca as U,ea as B,ja as G,na as Z,rb as ne,sa as q,tb as te,ua as J}from"./chunk.F5BCCGFK.js";var ce=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,fe={day:"day",week:"week",month:"month",year:"year"},R=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function ye(t,e,n){let o=e.interval??1,i=fe[e.every],a=t.slice(0,10),c=o===1?`Every ${i}`:o===2?`Every other ${i}`:`Every ${o} ${i}s`,d;if(e.every==="week"){let f=(e.on?.length?e.on:[T[new Date(`${a}T00:00:00Z`).getUTCDay()]]).map(l=>H(T.indexOf(l),"long",n));d=o===1?`Every ${R(f)}`:o===2?`Every other ${R(f)}`:`${c} on ${R(f)}`}else if(e.every==="month"){let f=(e.on?.length?e.on:[+a.slice(8,10)]).map(l=>l===-1?"the last day":`the ${ce(Number(l))}`);d=`${c} on ${R(f)}`}else e.every==="year"?d=`${c} on ${v(a,n)}`:d=c;return w.test(t)&&(d+=` at ${Y(t,n)}`),e.until&&(d+=`, until ${b(e.until,n)}`),e.count&&(d+=`, ${e.count===1?"once":`${e.count} times`}`),d}function de(t,e,n={}){if(!V(e)||typeof t!="string")return;let o=n.today??P(),i=X(t,e,o),a=ye(t,e,n.locale),c=i.slice(0,4)===o.slice(0,4)?v(i.slice(0,10),n.locale):b(i.slice(0,10),n.locale);return i.slice(0,10)<o?`${a}, last ${c}`:`${a}, next ${c}`}function Pe(t,e){let n=new Map,o=new Map;for(let i of t){let a=$(e(i.kind),i).trim().toLowerCase();o.set(a,[...o.get(a)??[],i])}for(let i of o.values()){if(i.length<2)continue;let a=new Map;for(let c of i)a.set(c.kind,[...a.get(c.kind)??[],c]);for(let[c,d]of a){if(d.length===1){n.set(d[0].id,B(e(c),c));continue}let f=d.map(y=>new Map(pe(y,e(y.kind)).map(r=>[r.key,r.alone]))),l=[...new Set(f.flatMap(y=>[...y.keys()]))],p=y=>f.every(r=>!/\d/.test(r.get(y)??"")),A=[...l.filter(p),...l.filter(y=>!p(y))].find(y=>new Set(f.map(r=>r.get(y)??"")).size===d.length);d.forEach((y,r)=>{let s=A?f[r].get(A):void 0;n.set(y.id,s??y.id)})}}return n}function Ke(t,e){return t?.describe?t.describe(e):`${e.kind} ${$(t,e)}`}var ue=new Set(["id","kind","label"]);function ge(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function pe(t,e,n={}){let o=e?.display,i=new Set([...ue,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!$(e,t).includes(t.label)&&i.delete("label");let a=(n.said??[]).filter(r=>!!r),c=a.filter(r=>r.endsWith("\u2026")).map(r=>r.replace(/…$/,"").trim()).filter(r=>r.length>12),d=[],f=e?.fields?.shape,l=e?.fieldRoles,p=n.glance?o?.glance??[l?.who,l?.when].filter(r=>!!r):ae(o?.page),M=n.glance&&o?.glance!==void 0,y=[...new Set(M?p:[...p,...be(e),...Object.keys(t)])].filter(r=>Object.hasOwn(t,r)).map(r=>[r,t[r]]);for(let[r,s]of y){if(i.has(r)||s===void 0||s===null)continue;let u=o?.format?.[r],k=u?[]:G(s);if(k[0]&&n.glance)continue;let O=e?.fields?.shape?.[r],_=!u&&typeof s=="string"&&Z(O)?s:void 0,x=!u&&typeof s=="string"&&ee(O);if(_&&n.glance)continue;let S=u?void 0:J(O),m=S?{relation:S,refs:q(s,S)}:void 0;if(m&&(n.glance||m.refs.length===0)||!k[0]&&typeof s=="object"&&(!Array.isArray(s)||s.some(g=>typeof g=="object"&&g!==null))&&u===void 0)continue;let j=typeof s=="string"&&!u?de(s,t[`${r}Repeat`],{locale:n.locale}):void 0,F=k[0]?k.map(g=>g.caption?`${g.name} \u2014 ${g.caption}`:g.name).join(", "):Array.isArray(s)?s.join(", "):typeof s=="boolean"?s?"Yes":"No":String(s),N=u?void 0:se(e,r),L=ie(N,s),W=!u&&!N&&typeof s=="number"?ne(e?.fields?.shape?.[r]):void 0,z=m?m.refs.length>1?`${m.refs.length} linked records`:"linked record":u?u(s):W?te(s,W):re(N,s,n.locale)??(Array.isArray(s)||typeof s=="boolean"?F:typeof s=="string"&&j!==void 0?j:typeof s=="string"&&I.test(s)?b(s,n.locale):typeof s=="string"&&w.test(s)?K(s,n.locale):typeof s=="string"&&ke(e,r)?E(e,r,s):F),C=typeof s=="string"&&Ae(e,r,z),h=(n.glance||n.excerpt)&&!u&&(C||x)?oe(z,{markdown:x}):z;if(a.includes(h)||c.some(g=>h.startsWith(g))||n.glance&&(typeof s=="string"||typeof s=="number")&&a.some(g=>ge(g,h)))continue;let D=U(e,r),le=typeof s=="number"?`${D} ${h}`:typeof s=="boolean"&&!u?`${D}: ${h.toLowerCase()}`:h;if(d.push({key:r,label:D,value:h,stored:F,alone:le,long:C,...x?{markdown:!0}:{},...k[0]?{files:k}:{},..._?{app:_}:{},...m?{linked:m}:{},...L?{href:L}:{},...Q(f?.[`${r}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&d.length>=n.limit)break}return me(d,e)}function me(t,e){let n=new Map;for(let o of t){let i=he(e,o.key);i&&n.set(o.key,new Set(i.map(a=>E(e,o.key,a).toLowerCase())))}return n.size<2?t:t.map(o=>{let i=n.get(o.key);return i!==void 0&&[...n].some(([c,d])=>c!==o.key&&[...i].some(f=>d.has(f)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function he(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function ke(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function be(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function ae(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var we=500,$e=160;function Re(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function Ae(t,e,n){return Re(t?.fields?.shape?.[e])?.checks?.some(i=>i._zod?.def?.check==="max_length"&&(i._zod.def.maximum??0)>we)?!0:typeof n=="string"&&(n.includes(`
2
- `)||n.length>$e)}function Ye(t,e){let n=t?.display?.page,o=n?.groups??[],i=new Map(e.map(l=>[l.key,l])),a=new Set(ae(n)),c=l=>l.flatMap(p=>i.has(p)?[i.get(p)]:[]),d=e.filter(l=>!a.has(l.key));return[{fields:[...c(n?.fields??[]),...o.length>0?[]:d]},...o.map(l=>({title:l.title,fields:c(l.fields)})),...o.length>0?[{title:"Details",fields:d}]:[]].filter(l=>l.fields.length>0)}export{ye as a,Pe as b,Ke as c,pe as d,Ye as e};
@@ -1 +0,0 @@
1
- import"./chunk.5A4AOFOA.js";import"./chunk.OF34OZ4V.js";import"./chunk.NNCTJSD3.js";import"./chunk.GXLAZGYT.js";import{a as L,b as R,c as E}from"./chunk.HPX3F7XX.js";import{b as T}from"./chunk.7CO7S6QM.js";import"./chunk.6QDFBCV4.js";import"./chunk.R7LRJS6B.js";import"./chunk.IB32NOV5.js";import"./chunk.4STIUIT6.js";import"./chunk.WHTQHU3M.js";import"./chunk.KU6NIMQX.js";import"./chunk.Y3IJDWNS.js";import"./chunk.OFJH7LDC.js";import"./chunk.5PU3RWYY.js";import"./chunk.27TLAVRR.js";import"./chunk.OREMUXB5.js";import"./chunk.ZDNJK2SX.js";import"./chunk.ZSSOTIFL.js";import"./chunk.HJCQ6I3S.js";import"./chunk.ZWZ5SEXT.js";import"./chunk.FQKH67BP.js";import"./chunk.LA7535VO.js";import"./chunk.ZEW2OOZ5.js";import"./chunk.7YQYWOZR.js";import"./chunk.ACEYGWMO.js";import"./chunk.3PT55HXT.js";import"./chunk.272ZJXQP.js";import"./chunk.3SM2CHKF.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.EBLKEQ7O.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import{r as A}from"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as S,H as $,Q as p,Y as x,_ as C}from"./chunk.6II4BONS.js";import{W as h,gc as k}from"./chunk.F5BCCGFK.js";import{b as i}from"./chunk.AJZBJBMO.js";var r=i(S(),1);var l=i(S(),1);var g=i(p(),1);var m={font:"inherit",fontSize:"0.875rem",minHeight:24,padding:0,border:0,borderRadius:2,background:"transparent",boxShadow:"none",color:"var(--graview-accent)",textDecoration:"underline",textUnderlineOffset:3,textAlign:"start",cursor:"pointer"};var e=i(p(),1);function Y({page:n=!1,go:D,onPick:y,onDiscard:M}){let{store:d,seatTalk:c}=x(),u=$(c),N=E(),b=D??N,{keep:P}=L(b),[H,f]=(0,r.useState)(!1);C();let t=u.draft;(0,r.useEffect)(()=>f(!1),[t]),(0,r.useEffect)(()=>{n||R(!1)},[n]);let v=(0,r.useRef)(null),w=t!==null&&!n;if((0,r.useLayoutEffect)(()=>{let s=v.current;if(!w||!s?.parentElement)return;let o=[];for(let a=s.previousElementSibling;a;a=a.previousElementSibling)a instanceof HTMLElement&&!a.inert&&a.tagName!=="STYLE"&&(a.inert=!0,o.push(a));return()=>{for(let a of o)a.inert=!1}},[w]),!t)return null;let G=T(t.drawn),F=d.schema.tryDefinition(t.kind),q=d.graph.nodesOfKind(t.kind).filter(s=>h(F,s)),z=()=>{c.setDraft(null),M?.()};return(0,e.jsxs)("section",{ref:v,"data-testid":"draft-frame","data-graview-draft-frame":n?"page":"scene","aria-label":`Draft: ${t.title}`,style:n?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:12,zIndex:k("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:12,boxShadow:"var(--graview-lift-high)",overflow:"hidden",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...K,...n?{}:{padding:"10px 16px"}},children:[n?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:H,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{f(!0),P(t).finally(()=>f(!1))},style:m,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:z,style:m,children:"Discard"})]}),u.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:n?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:u.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,style:n?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:s=>{let o=s.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!o||!d.graph.getNode(o))return;s.preventDefault();let a=d.graph.getNode(o);y?(c.setDraft(null),y(o)):b({to:"record",id:o,kind:a.kind,label:o,address:"",said:""})},children:(0,e.jsx)(A,{kind:t.kind,view:t.title,children:(0,e.jsx)(G,{nodes:q,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var K={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{Y as DraftFrame};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk.IB32NOV5.js";import"./chunk.ZEW2OOZ5.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.F5BCCGFK.js";import"./chunk.AJZBJBMO.js";export{f as columnActs,c as columnMoves,b as columnOf,d as columnReach,e as columnSteps,h as describePlace,i as placeText,g as resolveFor,a as statusColumns};
@@ -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.WHTQHU3M.js";import{e as pt}from"./chunk.Y3IJDWNS.js";import{a as yt,d as wt,f as vt}from"./chunk.OFJH7LDC.js";import{a as Ce,b as ft}from"./chunk.5PU3RWYY.js";import{a as mt,b as ht}from"./chunk.OREMUXB5.js";import{h as ut}from"./chunk.ZDNJK2SX.js";import{a as ae,b as tt}from"./chunk.CUCNT7MG.js";import{b as Pe,c as U,d as X,e as it,f as rt}from"./chunk.2A2DLMT3.js";import{a as ve,b as gt}from"./chunk.E77K6KBX.js";import{c as ot,d as ie,e as J,f as ye,g as st,i as lt,j as re}from"./chunk.VHWUGSFW.js";import{j as dt,o as we}from"./chunk.PWOVXARZ.js";import{c as ct}from"./chunk.SG23JC6D.js";import{c as at,d as Re}from"./chunk.4B73P2WA.js";import{c as nt}from"./chunk.IMRCAU4T.js";import{A as Je,F as q,Q as I,R as Ye,X as Ze,Y as V,_ as ue,a as ge,fa as Qe,ga as j,ha as pe,ja as me,k as je,la as et,m as _e,n as qe,na as xe,oa as he,pa as Ne,s as ne,w as Ue,xa as fe,z as Xe}from"./chunk.6II4BONS.js";import{Mb as te,N as Q,X as $,Z as ee,Za as Ke,ea as H}from"./chunk.F5BCCGFK.js";import{b as E}from"./chunk.AJZBJBMO.js";var v=E(q(),1);var St=E(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 c=t.querySelector(zt);if(!c){n.style.bottom=a;return}let u=t.getBoundingClientRect(),m=c.getBoundingClientRect(),d=u.height>0?t.offsetHeight/u.height:1;n.style.bottom=`${Math.max(0,Math.round((u.bottom-m.top)*d))}px`};if(o(),typeof ResizeObserver>"u")return;let g=new ResizeObserver(o);return g.observe(t),()=>g.disconnect()},[e])}var zt=".graview-spec-listing";var $e=E(q(),1);var P=E(q(),1);var kt=E(q(),1);var B=E(I(),1);function xt({id:e,max:n=8,empty:t,hide:a}){let{store:o}=V();ue();let g=Kt(o,e,o.violations()),[c,u]=(0,kt.useState)(()=>new Set),m=a?g.flatMap(d=>{let f=d.ids.filter(r=>!a.has(r));return f.length>0?[{...d,ids:f}]:[]}):g;return m.length===0?t&&g.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(d=>{let f=c.has(d.key),r=d.ids.length>n,l=f?d.ids:d.ids.slice(0,n),y=d.ids.length-Math.min(n,d.ids.length),k=`graview-more-${e}-${d.key}`.replace(/[^A-Za-z0-9_-]/g,"-");return(0,B.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)("h2",{...d.said?{"aria-label":d.said}:{},style:{margin:0,fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:d.label}),(0,B.jsxs)("div",{id:k,style:{display:"flex",flexWrap:"wrap",gap:6},children:[l.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":d.key,"aria-expanded":f,"aria-controls":k,...f?{}:{"aria-label":`${y} more: ${d.said??d.label}`},onClick:h=>{h.stopPropagation(),u(w=>{let S=new Set(w);return S.has(d.key)?S.delete(d.key):S.add(d.key),S})},style:Ft,children:f?"Show fewer":`+${y} more`}):null]})]},d.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,g=[];for(let c of t)if(c.subjectId===n)for(let u of c.nodeIds)u!==n&&!g.includes(u)&&e.graph.has(u)&&g.push(u);g.length>0&&o.set("judges",{key:"judges",label:"what it finds wrong",ids:g});for(let c of e.graph.allEdges()){let u=c.from===n?c.to:c.to===n?c.from:null;if(u===null||u===n)continue;let m=e.graph.getNode(u);if(!m)continue;let d=c.from===n?"out":"in",f=d==="out"?a.kind:m.kind,r=jt(e.schema,f,c.kind,d),l=`${c.kind}:${d}:${r.label}`,y=o.get(l)??{key:l,...r,ids:[]};y.ids.includes(u)||y.ids.push(u),o.set(l,y)}for(let c of o.values())c.ids.sort();return[...o.values()].sort((c,u)=>c.key<u.key?-1:c.key>u.key?1:0)}function jt(e,n,t,a){let o=nt(e,n,t,a),g=ee(t).toLowerCase();return o.trim().toLowerCase()!==g?{label:o}:a==="out"?{label:`\u2192 ${g}`,said:g}:{label:`\u2190 ${g}`,said:`${g}, pointing here`}}var Nt=E(q(),1),oe=(0,Nt.createContext)(null);var s=E(I(),1),_t=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.27TLAVRR.js","./chunk.OREMUXB5.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.7TBSVQSH.js")))).part((e,n)=>(0,s.jsx)(e.ArrangeBar,{...n}),{what:"Arranging this list"}),qt=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.HPX3F7XX.js","./chunk.7CO7S6QM.js","./chunk.6QDFBCV4.js","./chunk.R7LRJS6B.js","./chunk.IB32NOV5.js","./chunk.4STIUIT6.js","./chunk.WHTQHU3M.js","./chunk.KU6NIMQX.js","./chunk.Y3IJDWNS.js","./chunk.OFJH7LDC.js","./chunk.5PU3RWYY.js","./chunk.27TLAVRR.js","./chunk.OREMUXB5.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.HJCQ6I3S.js","./chunk.ZWZ5SEXT.js","./chunk.FQKH67BP.js","./chunk.6KMXLUOS.js","./chunk.G4JJXA63.js","./chunk.LA7535VO.js","./chunk.ZEW2OOZ5.js","./chunk.7YQYWOZR.js","./chunk.ACEYGWMO.js","./chunk.3PT55HXT.js","./chunk.3SM2CHKF.js","./chunk.CUCNT7MG.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.js","./chunk.UT6642FC.js","./chunk.Q5WEOX3Q.js","./chunk.CRPT3ZT3.js","./chunk.LNNFNJKN.js","./chunk.EBLKEQ7O.js","./chunk.WVUJXDXZ.js","./chunk.VHWUGSFW.js","./chunk.P75TPZWT.js","./chunk.6W7J76TK.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.GZHZLJBF.js","./chunk.PWOVXARZ.js","./chunk.SG23JC6D.js","./chunk.OJGHDWI6.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.O6ROFVFD.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(g=>g.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"],g=r=>{if(performance.now()>a||!(r instanceof MouseEvent))return!1;let l=Ct(r);return n.pointerType&&l.pointerType&&n.pointerType!==l.pointerType?!1:Math.hypot(l.x-n.x,l.y-n.y)<=Yt},c=r=>{if(!g(r))return d();r.stopPropagation()},u=r=>{if(!g(r))return d();r.stopPropagation(),r.preventDefault(),e.removeEventListener("click",u,!0),setTimeout(d,50),t()},m=!1,d=()=>{if(!m){m=!0,clearTimeout(f),e.removeEventListener("click",u,!0);for(let r of o)e.removeEventListener(r,c,!0)}};for(let r of o)e.addEventListener(r,c,!0);e.addEventListener("click",u,!0);let f=setTimeout(d,Rt)}function Qt({View:e,members:n,mode:t,flagged:a}){let{isSelected:o}=xe(),g=n.slice(0,Jt);return(0,s.jsxs)("div",{"data-graview-rows":"",style:{display:"grid",gap:4,minWidth:0},children:[g.map(c=>(0,s.jsx)("div",{"data-graview-pick":c.id,style:{minWidth:0,cursor:"pointer"},children:(0,s.jsx)(e,{node:c,cardinality:"one",fidelity:"glyph",mode:t,selected:o(c.id),...a?.includes(c.id)?{flagged:[c.id]}:{}})},c.id)),n.length>g.length?(0,s.jsx)(X,{label:`+${n.length-g.length} more`}):null]})}var en=11/15,tn=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.UJR3Y7MP.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,g]=(0,P.useState)(1),[c,u]=(0,P.useState)(!1),m=o<1?`${o}em`:void 0;return(0,P.useLayoutEffect)(()=>{let d=t.current,f=a.current;if(!d||!f)return;let r=()=>{let y=d.clientWidth,k=f.offsetWidth;if(y<=0||k<=0)return;let h=parseFloat(getComputedStyle(f).fontSize)/parseFloat(getComputedStyle(d).fontSize)||1,w=k/h,S=Math.max(en,Math.min(1,Math.floor(y/w*100)/100));g(x=>Math.abs(x-S)<.01?x:S),u(w*S>y+.5)};if(r(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(r);return l.observe(d),()=>l.disconnect()},[e]),(0,s.jsx)("span",{ref:t,"data-graview-district-name":"",...o<1?{"data-graview-fitted":""}:{},...c?{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`,g=r=>{let l=r.node,y=he(),k=(0,P.useContext)(oe);if(!l)return null;let h=k?.nodeId===l.id?k:null,w=$(a,l),S=r.mode==="fullscreen"?Ut(l,w)??w:w,x=Ke(y,[l.id]);return(0,s.jsxs)(U,{title:(0,s.jsx)(vt,{nodeId:l.id,children:h?.title??S}),...h?{}:{subtitle:a?.describe?at(a,l):a?.description??String(t)},selected:r.selected,...r.flagged?.includes(l.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,l)?"1 1 100%":"1 1 0",minWidth:"min(200px, 100%)"},children:(0,s.jsx)(wt,{id:l.id,shown:[S,w,a?.description,h?.title],...h?{hide:[...h.fields]}:{}})}),(0,s.jsx)("div",{style:{flex:Pt(a,l)?"1 1 100%":"1.4 1 0",minWidth:"min(220px, 100%)"},children:(0,s.jsx)(xt,{id:l.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]})},c=r=>{let l=r.node;if(!l)return null;let{store:y}=V(),k=a?.computed?lt(y.schema,y.graph,l):l,h=Re(k,a,{limit:3,said:[$(a,l)],glance:!0}),w=Ae(t),S=h.filter(N=>!N.long&&!N.markdown),x=h.find(N=>N.long||N.markdown),b=ot(l,a);return(0,s.jsxs)(U,{title:$(a,l),selected:r.selected,tone:r.flagged?.includes(l.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 l=r.node,y=Ae(t),k=we().marks.flag;if(!l)return null;let h=r.flagged?.includes(l.id)??!1;return(0,s.jsx)(X,{label:h?`${$(a,l)} ${k}`:$(a,l),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)(d,{...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)(d,{...r}),d=r=>{let{brand:l,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??[])}),L=R=>({id:R.id,label:$(e.tryDefinition(R.kind),R),hue:te(R.kind,l?.accents)}),W=r.fidelity==="full"&&S.length>1?(0,s.jsx)(P.Suspense,{fallback:null,children:(0,s.jsx)(_t,{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=he(),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(L),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 l=r.nodes??[],y=Xt(l.map(p=>$(a,p)),r.openedRows??dt(l.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:L,go:W}=Ne(),{views:se,hiddenKinds:le}=V(),Y=(0,P.useContext)(Qe),z=L.overview&&!le.has(String(t))?se.places().filter(p=>p.kind===String(t)):[],R=r.focused?L.within?.view??z[0]?.as:void 0,A=l.filter(p=>r.flagged?.includes(p.id)).length,de=A>0,Ot=he(),Ht=Se(Ot,l),F=(L.overview??!1)&&r.nestedUnder===void 0,G=r.focused||r.raised,He=r.rank==="secondary"&&!G,M=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:l.filter(p=>It.includes(p.id)&&!Ie.has(p.id)).length,ke=O>0&&!de,ce=Ze(),_=ce&&!M?ce.byKind[String(t)]??0:0,We=(0,P.useRef)(null),ze=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let p=ze.current,D=We.current;if(!p||!D||!F)return;let T=()=>D.style.setProperty("--graview-plate-h",`${p.offsetHeight}px`);if(T(),typeof ResizeObserver>"u")return;let Z=new ResizeObserver(T);return Z.observe(p,{box:"border-box"}),()=>Z.disconnect()},[F]);let Wt=M?8:Math.min(46,10+Math.round(Math.sqrt(l.length)*8)),Fe=M?(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":M||void 0,"data-graview-tied":O||void 0,"data-graview-hits":ce&&!M?_:void 0,"data-graview-emphasis":ce&&!M?_>0?"lit":"dimmed":void 0,...a?.description||M?{title:M?[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:M?1:3,padding:M?"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:[!M&&!F&&l.length>0?(0,s.jsx)("div",{"data-graview-tally":l.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/l.length*100))}%`,background:"var(--graview-warn)"}}):null}):null,w?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:M?4:6},children:[(0,s.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:M?14:18}),Fe]}):Fe,(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"0.875rem"},children:[(0,s.jsx)("span",{title:l.length>0?`${Q(l.length)} ${l.length===1?H(a,String(t)):o.toLowerCase()}`:void 0,style:{fontVariantNumeric:"tabular-nums",color:ke?"var(--graview-accent)":"var(--graview-ink-faint)"},children:l.length===0?"none yet":ke?O===l.length?`${O} tied`:`${O} of ${l.length} tied`:Q(l.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(L,!0))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:["+",r.retired," past"]}):null,_>0?(0,s.jsxs)("button",{type:"button",className:"graview-kind-hits","data-testid":`hits-${String(t)}`,title:`${_} ${_===1?"match":"matches"} for \u201C${L.q??""}\u201D \u2014 press to go in, narrowed`,onClick:p=>{p.stopPropagation(),W(Xe(L,ne(String(t)),{ownPicture:!0,...L.q?{carry:L.q}:{}}))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[_," 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,!M&&l.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:[l.slice(0,y.shown).map(p=>{let D=r.flagged?.includes(p.id)??!1,T=$(a,p);return(0,s.jsx)(X,{pickId:p.id,label:D?`${T} ${S}`:T,title:D?`${T} \u2014 implicated in a problem`:void 0,hue:k,selected:Ie.has(p.id)},p.id)}),l.length>y.shown?(0,s.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",padding:"2px 4px",gridColumn:"1 / -1"},children:["+",l.length-y.shown," more \u2014 double-click to go in"]}):null]}):null]}),!M&&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 D=R===p.as;return(0,s.jsxs)("div",{className:"graview-drive-in-thumb","data-graview-pressed":D||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":D,title:D?`${p.title} is showing \u2014 press again to open it`:`Show ${p.title} on the billboard \u2014 double-click to open it`,onClick:T=>{T.stopPropagation();let Z=()=>W(Je(L,String(t),p.as));if(T.detail>=2||D&&r.focused){Z();return}W(_e(je(qe(L,!0),Ue(String(t))),"view",p.as)),T.detail===1&&Zt(T.currentTarget.ownerDocument,Ct(T.nativeEvent),Z)}})]},p.as)})})}):null]})};m.generic=!0,f.generic=!0,n.register(t,{cardinality:"one",fidelity:"full"},j(g)).register(t,{cardinality:"one",fidelity:"summary"},j(c)).register(t,{cardinality:"one",fidelity:"glyph"},j(u)).register(t,{cardinality:"many",fidelity:"full"},j(m)).register(t,{cardinality:"many",fidelity:"summary"},j(m)).register(t,{cardinality:"many",fidelity:"glyph"},j(f))}return n}var Me=E(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,Me.jsx)(Ve.Provider,{value:!0,children:e})}function Mt(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,Me.jsx)(o,{...e}):null}var i=E(I(),1),Tt=(0,v.createContext)(null),Et=(e,n)=>e.trim().toLowerCase().replace(/[_-]+/g," ")===n.trim().toLowerCase().replace(/[_-]+/g," "),rn=(0,v.createContext)(null),Be=(0,v.createContext)(null);function Lt({block:e}){let n=(0,v.useContext)(Be),t=n?.slots?.[e.key],a=(0,i.jsx)(on,{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 on({block:e}){let n=(0,v.useContext)(Tt),t=(0,v.useContext)(ln),a=(0,v.useContext)(Te),o=(0,v.useContext)(Pe);if(n&&e.t==="badge"&&n.values.some(g=>Et(g,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&&Et(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)(Ee,{blocks:e.blocks})});case"when":return e.shown?(0,i.jsx)(Ee,{blocks:e.blocks}):null;case"divider":return(0,i.jsx)("hr",{className:"graview-spec-divider"});case"figure":return(0,i.jsx)(sn,{});case"headline":{let g=`h${Math.min(6,e.level+t)}`,c=(0,i.jsx)(g,{className:"graview-spec-headline","data-level":e.level,children:e.text});return a!==null&&e.level===1?(0,i.jsxs)(i.Fragment,{children:[c,a]}):c}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)(cn,{list:e})}}function sn(){let e=(0,v.useContext)(Be)?.figure;return e?(0,i.jsx)("span",{className:"graview-spec-figure","aria-hidden":"true",children:e()}):null}function Ee({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)(Lt,{block:e[t]},t));continue}n.push((0,i.jsx)("span",{className:"graview-spec-badges",children:e.slice(t,a+1).map((o,g)=>(0,i.jsx)(Lt,{block:o},g))},t)),t=a}return n}function Dt({blocks:e,ctx:n,view:t}){let a=(0,v.useContext)(rn)?.[t];return(0,i.jsx)(Be.Provider,{value:{figure:n.figure,slots:a,node:n.node},children:(0,i.jsx)(Ee,{blocks:e})})}function Ge({blocks:e,ctx:n,view:t}){return(0,i.jsx)(Dt,{blocks:J(e,n),ctx:n,view:t})}var Le=3,Bt=(0,v.createContext)(0),Gt=(0,v.createContext)(null),ln=(0,v.createContext)(0),Te=(0,v.createContext)(null);function dn({node:e,as:n,depth:t,said:a=null}){let{store:o,views:g}=V(),c=$(o.schema.tryDefinition(e.kind),e),u=g.lookup(e.kind,{cardinality:"one",fidelity:n==="card"?"summary":"glyph"});return n==="row"&&t<=Le&&(!u||pe(u))?(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(De,{node:e,label:c}),(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:c})})]}):(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(De,{node:e,label:c}),t<=Le&&u?(0,i.jsx)(Ye,{mode:"scene",children:(0,i.jsx)(Bt.Provider,{value:t,children:(0,i.jsx)(Tt.Provider,{value:a,children:(0,i.jsx)(Pe.Provider,{value:c,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:c})]})}function De({node:e,label:n}){let t=(0,v.useContext)(Gt),a=(0,v.useRef)(null);return bt(a),t?(0,i.jsx)("a",{ref:a,className:"graview-spec-item-link",href:t.href(e),"aria-label":n,onClick:o=>{o.metaKey||o.ctrlKey||o.shiftKey||o.button!==0||(o.preventDefault(),o.stopPropagation(),t.go(e))}}):(0,i.jsx)("button",{ref:a,type:"button",className:"graview-spec-item-link","data-graview-pick":e.id,"aria-label":n})}function cn({list:e}){let n=(0,v.useContext)(Bt)+1,{store:t}=V(),a=(0,v.useContext)(Gt),[o,g]=(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 c=(b,N=null)=>n>Le?(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)(De,{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)(dn,{node:C,as:e.as,depth:n,said:N},C.id))}),u=e.rest??[],m=Math.min(o,e.members.length+u.length),d=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),l=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:()=>g(m+r),children:`Show ${Math.min(r,f)} more`})}):null,y=e.total??e.members.length+e.more,k=e.more-u.length,h=l??(a?.more&&y>d.length?a.more({members:d,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:[c(d),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,c(b.members,b.value!==null?{values:[b.value,...b.heading?[b.heading]:[]]}:null)]},b.value??"")),h]})}function sa({blocks:e,heading:n=2,firstHeading:t,slot:a,view:o=a}){let{store:g,brand:c}=V();ue();let u=re(g,null,null,{heading:n,firstHeading:t,money:c}),m=(0,v.useContext)(Te),d=e.some(f=>f.t==="headline");return(0,i.jsxs)("div",{className:`graview-spec graview-spec-${a}`,"data-graview-spec":a,children:[m!==null&&!d?m:null,(0,i.jsx)(Te.Provider,{value:d?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 gn({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 un({blocks:e,node:n,selected:t,flagged:a}){let o=Oe(n),[g,...c]=e,u=g?.t==="title";return(0,i.jsx)(U,{...u?{title:J([g],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?c:e,ctx:o,view:`${n.kind}.card`})})})}function pn({blocks:e,props:n}){let t=n.node,a=Oe(t,"page"),o=Vt(),g=J(e,a),c=ye(e,g),u=c.title!==void 0&&(!o||c.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)(Dt,{blocks:u?g.slice(1):g,ctx:a,view:`${t.kind}.page`})});return o?m:(0,i.jsx)(oe.Provider,{value:{nodeId:t.id,...c.title!==void 0?{title:c.title}:{},body:m,fields:c.fields,records:c.records},children:(0,i.jsx)(Mt,{...n})})}function la(e,n,t){return typeof e=="function"?e.says?.(n,t):void 0}function mn({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)(gn,{slot:"row",blocks:e,node:n,selected:t})})}function da(e,n,t){if(!t)return e;let a=new Set(n.kinds);for(let[o,g]of Object.entries(t)){if(!a.has(o)||!g)continue;let c=o;if(g.card){let u=ie(g.card),m=d=>d.node?(0,i.jsx)(un,{blocks:u,node:d.node,selected:d.selected,flagged:d.flagged?.includes(d.node.id)??!1}):null;e.register(c,{cardinality:"one",fidelity:"summary"},m)}if(g.row){let u=ie(g.row),m=d=>d.node?(0,i.jsx)(mn,{blocks:u,node:d.node,selected:d.selected}):null;m.says=(d,f)=>ye(u,J(u,re({graph:f,schema:n},null,d,{slot:"row"}))),e.register(c,{cardinality:"one",fidelity:"glyph"},m)}if(g.page){let u=ie(g.page),m=d=>d.node?(0,i.jsx)(pn,{blocks:u,props:d}):null;m.says=(d,f)=>ye(u,J(u,re({graph:f,schema:n},null,d))),e.register(c,{cardinality:"one",fidelity:"full"},m)}}return e}export{bt as a,jn as b,Tt as c,Gt as d,ln as e,Te as f,De as g,sa as h,la as i,da as j,At as k};
@@ -1 +0,0 @@
1
- import{b as c}from"./chunk.QEALNWWL.js";import"./chunk.FERBNBDE.js";import"./chunk.YNE5QR7Q.js";import"./chunk.UGFDSE37.js";import{j as m}from"./chunk.GOCUBIRW.js";import"./chunk.6QDFBCV4.js";import"./chunk.4STIUIT6.js";import"./chunk.WHTQHU3M.js";import"./chunk.KU6NIMQX.js";import"./chunk.Y3IJDWNS.js";import"./chunk.OFJH7LDC.js";import"./chunk.5PU3RWYY.js";import"./chunk.27TLAVRR.js";import"./chunk.OREMUXB5.js";import"./chunk.ZDNJK2SX.js";import"./chunk.ZSSOTIFL.js";import"./chunk.7YQYWOZR.js";import"./chunk.3PT55HXT.js";import"./chunk.QDHUDLJB.js";import"./chunk.ZVMIHXVK.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.UT6642FC.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as S,Q as g}from"./chunk.6II4BONS.js";import{Wc as n}from"./chunk.F5BCCGFK.js";import{b as t}from"./chunk.AJZBJBMO.js";var y=t(S(),1),a=t(g(),1);function E({store:h,auto:f,brand:i,views:u,presence:r,steering:o,overview:s,scope:d,titleLevel:v=2,quickAsk:l,props:e}){let b=(0,y.useMemo)(()=>m({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:f?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:b}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(c,{context:{store:h,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...s?{overview:s}:{},titleLevel:v,views:u,settings:e.app.settings??[],...r?{presence:r}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...o?{steering:o}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{E as PagesContent};
@@ -1 +0,0 @@
1
- import"./chunk.WVUJXDXZ.js";import{a as v,b as ie}from"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import{n as le}from"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{$ as re,F as xe,L as x,N as te,Q as ne,Y as ae}from"./chunk.6II4BONS.js";import{ca as X,fa as I,fc as ee,ha as Z,ia as F,ja as N}from"./chunk.F5BCCGFK.js";import{b as _}from"./chunk.AJZBJBMO.js";var g=_(xe(),1);async function oe(e,n){let r=await createImageBitmap(e);try{let a=Math.min(1,n/Math.max(r.width,r.height)),s=document.createElement("canvas");s.width=Math.max(1,Math.round(r.width*a)),s.height=Math.max(1,Math.round(r.height*a));let l=s.getContext("2d");if(l===null)throw new Error("This browser will not give us a canvas to resize with.");return l.drawImage(r,0,0,s.width,s.height),s}finally{r.close()}}var t=_(ne(),1),Se=2048,Ce=.85;function V(e){return e<1e3?`${e} bytes`:e<1e6?`${Math.round(e/1e3)} KB`:`${(e/1e6).toFixed(e<1e7?1:0)} MB`}function G(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 pe(e){let n=[...new Set(e.map(r=>r==="image/*"?"pictures":r==="*/*"||r==="*"?"any file":`${G({type:r})} files`))];return n.length<=1?n[0]??"no files":`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function me(e,n){if(e.length===0)return!0;let r=`${n.split("/")[0]}/*`;return e.some(a=>a==="*"||a==="*/*"||a===n||a===r)}var se=/^image\/hei[cf]$|\.hei[cf]$/i,de=e=>se.test(e.type)||se.test(e.name);async function Ee(e,n,r){let a=e.name||(r.camera?"photo.jpg":"file"),s=e.type||(de({type:"",name:a})?"image/heic":"application/octet-stream"),l=de({type:s,name:a}),d=s.startsWith("image/")||l;if(r.image&&!d)return{refused:`\u201C${a}\u201D isn\u2019t a picture.`};if(l||d&&/^image\/(jpeg|webp)$/.test(s)&&(r.camera||e.size>n.maxBytes||e.size>15e5))try{let u=await oe(e,Se),h=await new Promise(o=>u.toBlob(o,"image/jpeg",Ce));if(h)return ue({blob:h,name:l?a.replace(/\.hei[cf]$/i,"")+".jpg":a,type:"image/jpeg",width:u.width,height:u.height},n)}catch{if(l&&!me(n.kinds,s))return{refused:`\u201C${a}\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 p={};if(d&&!l)try{let u=await createImageBitmap(e);p={width:u.width,height:u.height},u.close()}catch{}return ue({blob:e,name:a,type:s,...p},n)}function ue(e,n){return me(n.kinds,e.type)?e.blob.size>n.maxBytes?{refused:`\u201C${e.name}\u201D is ${V(e.blob.size)}; this host takes files up to ${V(n.maxBytes)}.`}:e:{refused:`\u201C${e.name}\u201D is a ${G(e)} file; this host takes ${pe(n.kinds)}.`}}async function Pe(e,n,r){let a;try{a=await n.upload(e.blob,e.name)}catch(l){let d=l instanceof Error&&l.message.trim()?l.message.trim():"the host refused it";return{refused:`\u201C${e.name}\u201D wasn\u2019t kept: ${d}`}}return Z(a)?r&&!F(a)?{refused:`\u201C${e.name}\u201D isn\u2019t a picture.`}:{...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 $="var(--graview-radius, 8px)",P={color:"var(--graview-ink-muted)",fontSize:"0.8125rem"};function he(e){let n=x(),r=te()?.past!=null,[a,s]=(0,g.useState)(!1),l=n?.kept?Re(n,e.href):!0,[,d]=(0,g.useState)(0);return(0,g.useEffect)(()=>{if(typeof l!="object")return;let y=!0;return l.then(()=>y&&d(p=>p+1)),()=>void(y=!1)},[l]),[l===!1||r&&a,()=>s(!0)]}var O=new WeakMap;function Re(e,n){let r=O.get(e)?.get(n);if(r!==void 0)return r;let a;try{a=e.kept(n)}catch{return!0}if(typeof a=="boolean")return a;let s=O.get(e)??new Map;O.set(e,s);let l=Promise.resolve(a).then(d=>d!==!1,()=>!0);return s.set(n,l),l.then(d=>s.set(n,d)),l}function ye({file:e,style:n}){return(0,t.jsx)("span",{role:"img","aria-label":`${v(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:$,...n},children:"removed later"})}function A({file:e,size:n=56,style:r}){let a=x(),[s,l]=he(e);return s?(0,t.jsx)(ye,{file:e,style:{width:n,height:n,flex:"none",...r}}):(0,t.jsx)("img",{onError:l,src:I(a,e.href),alt:v(e),width:n,height:n,loading:"lazy",decoding:"async","data-graview-thumb":e.href,style:{width:n,height:n,objectFit:"cover",borderRadius:$,display:"block",flex:"none",background:"var(--graview-edge)",...r}})}function We({file:e,onOpen:n}){let r=x(),[a,s]=he(e);return a?(0,t.jsx)(ye,{file:e,style:{width:"100%",aspectRatio:"1"}}):(0,t.jsx)("button",{type:"button","aria-label":`Open ${v(e)} full size`,onClick:l=>n(l.currentTarget),style:{padding:0,border:0,background:"none",cursor:"zoom-in",display:"block",width:"100%",borderRadius:$},children:(0,t.jsx)("img",{src:I(r,e.href),alt:v(e),loading:"lazy",decoding:"async",onError:s,style:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:$,display:"block",background:"var(--graview-edge)"}})})}function U({files:e,label:n}){let r=x(),a=o=>I(r,o.href),s=e.filter(F),l=e.filter(o=>!F(o)),[d,y]=(0,g.useState)(null),p=(0,g.useRef)(null),u=(0,g.useRef)(null);(0,g.useEffect)(()=>{let o=p.current;d!==null&&o&&!o.open&&o.showModal?.()},[d]);let h=d===null?void 0:s[d];return(0,t.jsxs)("div",{style:{display:"grid",gap:10,minWidth:0},children:[s.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:s.map((o,k)=>(0,t.jsx)("li",{style:{minWidth:0},children:(0,t.jsx)(We,{file:o,onOpen:S=>{u.current=S,y(k)}})},o.href))}):null,l.length>0?(0,t.jsx)("ul",{"data-graview-documents":"",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:10},children:l.map(o=>(0,t.jsxs)("li",{"data-graview-document":o.type,style:{display:"grid",gap:6,minWidth:0},children:[o.type==="application/pdf"?(0,t.jsx)("object",{data:a(o),type:"application/pdf","aria-label":v(o),style:{width:"100%",height:420,border:"1px solid var(--graview-edge)",borderRadius:$},children:(0,t.jsxs)("p",{style:{margin:0,padding:12},children:["This browser shows no PDF here: ",(0,t.jsxs)("a",{href:a(o),download:o.name,children:["download ",o.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:a(o),download:o.name,...o.type==="application/pdf"?{target:"_blank",rel:"noopener"}:{},children:o.name}),(0,t.jsxs)("span",{style:P,children:[G(o)," \xB7 ",V(o.bytes)]})]}),o.caption?(0,t.jsx)("span",{style:P,children:o.caption}):null]},o.href))}):null,h?(0,t.jsx)("dialog",{ref:p,"data-graview-full":h.href,"aria-label":v(h),onClose:()=>{y(null),u.current?.focus()},onClick:o=>{o.target===o.currentTarget&&o.currentTarget.close()},style:{padding:0,border:0,borderRadius:$,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:a(h),alt:v(h),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:h.caption??h.name}),(0,t.jsx)("form",{method:"dialog",style:{margin:0},children:(0,t.jsx)("button",{type:"submit",autoFocus:!0,children:"Close"})})]})]})}):null]})}function fe({value:e,onChange:n,several:r,image:a,label:s,thumbs:l=!0}){let d=x(),y=(0,g.useId)(),p=(0,g.useRef)(null),u=(0,g.useRef)(null),[h,o]=(0,g.useState)(null),[k,S]=(0,g.useState)(null),[q,R]=(0,g.useState)([]),[L,B]=(0,g.useState)(!1),C=d?a?d.kinds.filter(i=>i.startsWith("image/")||i==="*"||i==="*/*"):d.kinds:[],K=d?d.kinds.length===0||C.some(i=>i.startsWith("image/")||i.startsWith("*")):!1,W=!!d&&(!a||K),J=a?r?"pictures":"a picture":r?"files":"a file",Q=a?C.length>0?C.join(","):"image/*":d?.kinds.join(",")||void 0,ve=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches,z=(0,g.useRef)(e);z.current=e;let Y=(0,g.useRef)(null),T=(0,g.useRef)(null);(0,g.useEffect)(()=>{let i=T.current;if(!i||i.from===e)return;T.current=null;let c=Y.current?.children,f=c?.[Math.min(i.at,c.length-1)];((i.what==="move"?f?.querySelector("[data-graview-file-move]"):null)??f?.querySelector("[data-graview-file-remove]")??p.current?.parentElement?.querySelector("[data-graview-file-choose]"))?.focus()});let M=async(i,c)=>{if(!d||i.length===0)return;let f=r?i:i.slice(0,1),m=[],w=[];f.length<i.length&&w.push(`${s} holds one ${a?"picture":"file"}, so ${i.slice(1).map(b=>`\u201C${b.name||"the photo"}\u201D`).join(", ")} ${i.length>2?"were":"was"} left out.`),R([]),S(null);for(let b of f){o(`Sending ${b.name||"the photo"}\u2026`);let j=await Ee(b,d,{image:a,camera:c==="camera"});if("refused"in j){w.push(j.refused);continue}let E=await Pe(j,d,a);"refused"in E?w.push(E.refused):[...r?z.current:[],...m].some($e=>$e.href===E.href)?w.push(`\u201C${E.name}\u201D is already here.`):m.push(E)}if(o(null),R(w),m.length!==0)try{n(r?[...z.current,...m]:m.slice(-1)),S(`Added ${m.map(b=>b.name).join(", ")}.`)}catch(b){R([...w,b instanceof Error?b.message:String(b)])}},H=(i,c,f)=>{try{T.current=f?{...f,from:e}:null,n(i),S(c)}catch(m){T.current=null,R([m instanceof Error?m.message:String(m)])}},D=i=>i?Array.from(i):[],ke=i=>{let c=D(i.clipboardData?.files);!W||c.length===0||(i.preventDefault(),M(c,"pasted"))},Fe=i=>{B(!1),W&&(i.preventDefault(),M(D(i.dataTransfer?.files),"dropped"))};return(0,t.jsxs)("div",{role:"group","aria-labelledby":`${y}-label`,"data-graview-file-editor":"","data-graview-dropping":L?"":void 0,onPaste:ke,onDragOver:i=>{W&&(i.preventDefault(),B(!0))},onDragLeave:()=>B(!1),onDrop:Fe,style:{display:"grid",gap:8,minWidth:0,padding:L?6:0,outline:L?"2px dashed var(--graview-accent)":"none",borderRadius:$},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:s}),e.length>0&&(r||e.length>1)?(0,t.jsx)("ul",{ref:Y,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:6},children:e.map((i,c)=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",minWidth:0},children:[l&&F(i)?(0,t.jsx)(A,{file:i,size:40}):null,(0,t.jsx)("span",{style:{flex:"1 1 8rem",minWidth:0,overflowWrap:"anywhere"},children:i.name}),(0,t.jsx)(ge,{file:i,onCaption:f=>H(e.map((m,w)=>w===c?ce(m,f):m),f?`${i.name} now says \u201C${f}\u201D.`:`${i.name} says its name again.`)}),r&&c>0?(0,t.jsx)("button",{type:"button","data-graview-file-move":"","aria-label":`Move ${i.name} earlier`,onClick:()=>H(e.map((f,m)=>m===c-1?i:m===c?e[c-1]:f),`Moved ${i.name} earlier.`,{at:c-1,what:"move"}),children:"\u2191"}):null,r?(0,t.jsx)("button",{type:"button","data-graview-file-remove":"","aria-label":`Remove ${i.name}`,onClick:()=>H(e.filter((f,m)=>m!==c),`Removed ${i.name}.`,{at:c,what:"remove"}),children:"Remove"}):null]},`${c}:${i.href}`))}):e.length===1?(0,t.jsx)(ge,{file:e[0],onCaption:i=>H([ce(e[0],i)],i?`${e[0].name} now says \u201C${i}\u201D.`:`${e[0].name} says its name again.`)}):null,W?(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{ref:p,type:"file",hidden:!0,multiple:r,...Q?{accept:Q}:{},"data-graview-file-input":"","aria-label":`Choose ${J}`,onChange:i=>{let c=D(i.currentTarget.files);i.currentTarget.value="",M(c,"picked")}}),(0,t.jsx)("button",{type:"button",disabled:h!==null,onClick:()=>p.current?.click(),"data-graview-file-choose":"",children:e.length>0&&!r?`Replace ${a?"the picture":"the file"}`:`Choose ${J}`}),K?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:u,type:"file",hidden:!0,accept:"image/*",capture:"environment","data-graview-photo-input":"","aria-label":"Take a photo",onChange:i=>{let c=D(i.currentTarget.files);i.currentTarget.value="",M(c,"camera")}}),ve?(0,t.jsx)("button",{type:"button",disabled:h!==null,onClick:()=>u.current?.click(),children:"Take a photo"}):null]}):null,(0,t.jsxs)("span",{style:P,"data-graview-file-takes":"",children:["or drop or paste ",r?"them":"it"," here \xB7 ",d.kinds.length>0?pe(C.length>0?C:d.kinds):"any file",", up to ",V(d.maxBytes)]})]}):(0,t.jsx)("p",{style:{...P,margin:0},"data-graview-file-none":"",children:d?"This host doesn\u2019t take 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:h||k?void 0:0},"data-graview-file-status":"",children:h??k??""}),q.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:q.map((i,c)=>(0,t.jsx)("p",{style:{margin:0},children:i},c))}):null]})}var ce=(e,n)=>{let{caption:r,...a}=e;return n?{...a,caption:n}:a};function ge({file:e,onCaption:n}){let[r,a]=(0,g.useState)(e.caption??"");(0,g.useEffect)(()=>a(e.caption??""),[e.caption]);let s=()=>{let l=r.trim().slice(0,500);l!==(e.caption??"")&&n(l)};return(0,t.jsx)("input",{type:"text",value:r,placeholder:F(e)?"What it shows":"What it is","aria-label":`What ${e.name} ${F(e)?"shows":"is"}`,"data-graview-file-caption":e.href,onChange:l=>a(l.target.value),onBlur:s,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),s())},style:{flex:"1 1 10rem",minWidth:0,font:"inherit",fontSize:"0.875rem",minHeight:24}})}function be({field:e,label:n,labelStyle:r,valueStyle:a,style:s,children:l}){return(0,t.jsxs)("div",{"data-graview-files":e,style:{display:"grid",gap:6,minWidth:0,gridColumn:"1 / -1",...s},children:[(0,t.jsx)("dt",{style:r,children:n}),(0,t.jsx)("dd",{style:{margin:0,minWidth:0,display:"grid",gap:10,...a},children:l})]})}function we(e){let{nodeId:n,field:r,label:a,files:s}=e,{fields:l,commit:d}=le(n),y=l.find(o=>o.field===r&&o.takesValue),p=y?.shape,u=p?.type==="several"?p.of:p,h=p?.type==="several";return s.length===0&&u?.type!=="file"?null:(0,t.jsxs)(be,{...e,children:[(0,t.jsx)(U,{files:s,label:a}),y&&u?.type==="file"?(0,t.jsx)(fe,{value:s,thumbs:!1,several:h,image:u.image===!0,label:a,onChange:o=>{let k=h?o:o[o.length-1];k!==void 0&&d(y,k)}}):null]})}function ze(e){switch(e.as){case"field":return e.read?e.files.length>0?(0,t.jsx)(be,{...e,children:(0,t.jsx)(U,{files:e.files,label:e.label})}):null:(0,t.jsx)(we,{...e});case"unfilled":return(0,t.jsx)(Te,{...e});case"thumb":return(0,t.jsx)(A,{...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:ee.raised}:{}},children:e.view==="thumb"?(0,t.jsx)(A,{file:e.files[0],size:72}):(0,t.jsx)(U,{files:e.files,label:e.label})}):null;case"control":{let n=(0,t.jsx)(fe,{value:N(e.value),several:e.several,image:e.image,label:e.label,onChange:r=>e.onChange(e.several?r:r[r.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 Te({nodeId:e,skip:n,labels:r,labelStyle:a,style:s}){let{store:l}=ae(),d=re(e),y=d?l.schema.tryDefinition(d.kind):void 0,p=ie(y).filter(u=>!n.includes(u)&&!(y?.display?.hide??[]).includes(u)&&N(d?.[u]).length===0);return p.length===0?null:(0,t.jsx)("dl",{style:{margin:0,display:"grid",gap:14,minWidth:0},children:p.map(u=>(0,t.jsx)(we,{nodeId:e,field:u,label:r?.[u]??X(y,u),files:[],...a?{labelStyle:a}:{},...s?{style:s}:{}},u))})}export{fe as FilesEditor,Se as SEND_EDGE,ze as drawFiles,pe as kindsWords,Ee as prepare,Pe as send,V as sizeWords,me as takes,G as typeWords};
@@ -1 +0,0 @@
1
- import{D as l,K as p,R as k,S as y,c}from"./chunk.FERBNBDE.js";import"./chunk.YNE5QR7Q.js";import"./chunk.UGFDSE37.js";import{b as m}from"./chunk.GOCUBIRW.js";import"./chunk.6QDFBCV4.js";import"./chunk.4STIUIT6.js";import"./chunk.WHTQHU3M.js";import"./chunk.KU6NIMQX.js";import"./chunk.Y3IJDWNS.js";import"./chunk.OFJH7LDC.js";import"./chunk.5PU3RWYY.js";import"./chunk.27TLAVRR.js";import"./chunk.OREMUXB5.js";import"./chunk.ZDNJK2SX.js";import"./chunk.ZSSOTIFL.js";import"./chunk.QDHUDLJB.js";import"./chunk.ZVMIHXVK.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as S,G as s,H as d,Q as f,Z as g}from"./chunk.6II4BONS.js";import"./chunk.F5BCCGFK.js";import{b as n}from"./chunk.AJZBJBMO.js";var u=n(S(),1);var t=n(f(),1);function D({context:a}){let r=l(),h=g(),[w]=(0,u.useState)(()=>s(null)),o=d(h?.seatTalk??w),P=()=>{(window.history.state?.idx??0)>0?r(-1):r("/")};return(0,t.jsxs)(k,{context:a,"data-testid":"draft-page",children:[(0,t.jsx)(y,{context:a,...o.draft?{"data-testid":"draft-title"}:{},children:o.draft?o.draft.title:"Nothing drawn"}),o.draft?(0,t.jsx)(m,{page:!0,go:e=>r(e.address),onPick:e=>{let i=a.store.graph.getNode(e);i&&r(c(a.store.schema,i.kind,e))},onDiscard:P}):(0,t.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:["Ask for a way of seeing \u2014 \u201Ca board of tasks by status\u201D \u2014 and it is drawn here."," ",(0,t.jsx)(p,{to:"/",style:{color:"var(--graview-accent)"},children:"Home \u2192"})]})]})}export{D as DraftPage};
@@ -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{$c as lt,Ba as Pn,Hc as _n,I as kn,Ma as Rn,Mb as Tn,Vc as Vn,_c as De,gc as Mn,rc as On,tc as In,va as An,wc as Cn,za as st}from"./chunk.F5BCCGFK.js";import{a as He,b as D}from"./chunk.AJZBJBMO.js";var to=He(v=>{"use strict";var mt=Symbol.for("react.transitional.element"),mr=Symbol.for("react.portal"),gr=Symbol.for("react.fragment"),hr=Symbol.for("react.strict_mode"),Sr=Symbol.for("react.profiler"),wr=Symbol.for("react.consumer"),vr=Symbol.for("react.context"),br=Symbol.for("react.forward_ref"),xr=Symbol.for("react.suspense"),Er=Symbol.for("react.memo"),Yn=Symbol.for("react.lazy"),kr=Symbol.for("react.activity"),$n=Symbol.iterator;function Ar(e){return e===null||typeof e!="object"?null:(e=$n&&e[$n]||e["@@iterator"],typeof e=="function"?e:null)}var Xn={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jn=Object.assign,Zn={};function ye(e,t,n){this.props=e,this.context=t,this.refs=Zn,this.updater=n||Xn}ye.prototype.isReactComponent={};ye.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")};ye.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qn(){}Qn.prototype=ye.prototype;function gt(e,t,n){this.props=e,this.context=t,this.refs=Zn,this.updater=n||Xn}var ht=gt.prototype=new Qn;ht.constructor=gt;Jn(ht,ye.prototype);ht.isPureReactComponent=!0;var qn=Array.isArray;function yt(){}var O={H:null,A:null,T:null,S:null},eo=Object.prototype.hasOwnProperty;function St(e,t,n){var o=n.ref;return{$$typeof:mt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Pr(e,t){return St(e.type,t,e.props)}function wt(e){return typeof e=="object"&&e!==null&&e.$$typeof===mt}function Rr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var zn=/\/+/g;function pt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Rr(""+e.key):t.toString(36)}function Tr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(yt,yt):(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 pe(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 mt:case mr:a=!0;break;case Yn:return a=e._init,pe(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+pt(e,0):o,qn(r)?(n="",a!=null&&(n=a.replace(zn,"$&/")+"/"),pe(r,t,n,"",function(u){return u})):r!=null&&(wt(r)&&(r=Pr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(zn,"$&/")+"/")+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+pt(o,s),a+=pe(o,t,n,i,r);else if(s=Ar(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=d+pt(o,s++),a+=pe(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return pe(Tr(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 $e(e,t,n){if(e==null)return e;var o=[],r=0;return pe(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Mr(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 Un=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)},Or={map:$e,forEach:function(e,t,n){$e(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $e(e,function(){t++}),t},toArray:function(e){return $e(e,function(t){return t})||[]},only:function(e){if(!wt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};v.Activity=kr;v.Children=Or;v.Component=ye;v.Fragment=gr;v.Profiler=Sr;v.PureComponent=gt;v.StrictMode=hr;v.Suspense=xr;v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O;v.__COMPILER_RUNTIME={__proto__:null,c:function(e){return O.H.useMemoCache(e)}};v.cache=function(e){return function(){return e.apply(null,arguments)}};v.cacheSignal=function(){return null};v.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Jn({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!eo.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 St(e.type,r,o)};v.createContext=function(e){return e={$$typeof:vr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:wr,_context:e},e};v.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)eo.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 St(e,i,r)};v.createRef=function(){return{current:null}};v.forwardRef=function(e){return{$$typeof:br,render:e}};v.isValidElement=wt;v.lazy=function(e){return{$$typeof:Yn,_payload:{_status:-1,_result:e},_init:Mr}};v.memo=function(e,t){return{$$typeof:Er,type:e,compare:t===void 0?null:t}};v.startTransition=function(e){var t=O.T,n={};O.T=n;try{var o=e(),r=O.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(yt,Un)}catch(i){Un(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),O.T=t}};v.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()};v.use=function(e){return O.H.use(e)};v.useActionState=function(e,t,n){return O.H.useActionState(e,t,n)};v.useCallback=function(e,t){return O.H.useCallback(e,t)};v.useContext=function(e){return O.H.useContext(e)};v.useDebugValue=function(){};v.useDeferredValue=function(e,t){return O.H.useDeferredValue(e,t)};v.useEffect=function(e,t){return O.H.useEffect(e,t)};v.useEffectEvent=function(e){return O.H.useEffectEvent(e)};v.useId=function(){return O.H.useId()};v.useImperativeHandle=function(e,t,n){return O.H.useImperativeHandle(e,t,n)};v.useInsertionEffect=function(e,t){return O.H.useInsertionEffect(e,t)};v.useLayoutEffect=function(e,t){return O.H.useLayoutEffect(e,t)};v.useMemo=function(e,t){return O.H.useMemo(e,t)};v.useOptimistic=function(e,t){return O.H.useOptimistic(e,t)};v.useReducer=function(e,t,n){return O.H.useReducer(e,t,n)};v.useRef=function(e){return O.H.useRef(e)};v.useState=function(e){return O.H.useState(e)};v.useSyncExternalStore=function(e,t,n){return O.H.useSyncExternalStore(e,t,n)};v.useTransition=function(){return O.H.useTransition()};v.version="19.2.8"});var W=He((ra,no)=>{"use strict";no.exports=to()});var fo=He(Ue=>{"use strict";var Wr=Symbol.for("react.transitional.element"),Fr=Symbol.for("react.fragment");function co(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:Wr,type:e,key:o,ref:t!==void 0?t:null,props:n}}Ue.Fragment=Fr;Ue.jsx=co;Ue.jsxs=co});var Ie=He((fa,po)=>{"use strict";po.exports=fo()});function Hn(e){let t,n=!1,o,r,i=0;return()=>{if(n)return Promise.resolve(t);if(o)return o;let a=i>0&&r!==void 0?dr(r):e();i+=1;let d=a.then(s=>(t=s,n=!0,o=void 0,s),s=>{throw o=void 0,r??=ur(s),s});return o=d,d}}var Ln=0;function dr(e){return Ln+=1,import(`${e}${e.includes("?")?"&":"?"}retry=${Ln}`)}function ur(e,t=import.meta.url){let n=e instanceof Error?e.message:typeof e=="string"?e:"",o=/^(?:Failed to fetch|error loading) dynamically imported module: ([a-z]+:\/\/[^\s"'<>]+)/.exec(n)?.[1]?.replace(/[.,;:)\]]+$/,""),r=i=>i.split("/",3).join("/");return o&&r(o)===r(t)?o:void 0}var ue={focusId:null,relation:null,expanded:[],pins:{}},Ne=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function ee(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}`,`${je(r.x)},${je(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${je(e.pan.x)},${je(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 cr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Ge(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[h,p]of n){if(!h.startsWith("pin."))continue;let[g,b]=p.split(","),k=g===void 0?null:Ne(g),m=b===void 0?null:Ne(b);k===null||m===null||(o[h.slice(4)]={x:k,y:m})}let r=Object.create(null);for(let[h,p]of n)!h.startsWith("in.")||p.length===0||(r[h.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:Ne(a[0]),s=a[1]===void 0?null:Ne(a[1]),u=(n.get("sel")??"").split(",").filter(h=>h.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:cr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(h=>h.length>0&&(f||!h.startsWith("kind:"))).sort(),pins:o}}function Wi(e){let t=Ge(e);return ee(t)==="#"?{...t,overview:!0}:t}function Fi(e){let t=ee(e);return t==="#overview=1"?"":t}function je(e){return Math.round(e*100)/100}function Nn(e,t){return ee(e)===ee(t)}var Dn="edge:";function jn(e){if(!e.startsWith(Dn))return null;let t=e.slice(Dn.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 dt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function q(e,t){if(t===e.focusId)return{...e,focusId:t};let n=dt(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function Gn(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 ce(e,t){if(t!==e.overview&&(e=dt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function We(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Me(e,t){if(t!==(e.zoom===!0)&&(e=dt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Fe(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Be="aggregate:",Ke="kind:";function ut(e){return`${Ke}${e}`}function fe(e){return e.startsWith(Ke)?e.slice(Ke.length):null}var $i="kinds:beyond";function fr(e){let t=fe(e);return t?[t]:se(e)}function te(...e){return`${Be}${[...e].sort().join("+")}`}function Wn(e){return e.startsWith(Be)}function se(e){return!Wn(e)||e.includes("|")?[]:e.slice(Be.length).split("+").filter(Boolean)}function Fn(e,t,n={}){let o=fe(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Fe(e,t);let r=o!==null?te(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Me(e,!1);if(o!==null&&n.carry){let i=ce({...q(e,r),relation:null},!1);return ae(Me(i,!0),"q",n.carry)}return Me({...q(e,r),relation:null},!0)}function pr(e,t,n){return ae(ce(q(e,te(t)),!1),"view",n)}function qi(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Kn="aggregate:";function ct(e){return e.startsWith(Kn)&&e.includes("|")}var Bn=e=>e?.off===!0,yr=e=>e!==void 0&&!Bn(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),ft={};var oo=D(W(),1),Ir={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},ro=e=>`graview:seat:${e}`;function Cr(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 vt(e){let t=e===null?null:ro(e),n={...Ir,...Cr(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 Vr(e){return(0,oo.useSyncExternalStore)(e.subscribe,e.get,e.get)}var ao=D(W(),1),Lr={entries:[],ghost:null,loaded:!1};function io(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 bt(e){let t=Lr,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:io(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:io(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function Hr(e){return(0,ao.useSyncExternalStore)(e.subscribe,e.get,e.get)}function so(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var qe=D(W(),1),ze=(0,qe.createContext)(void 0),Dr=()=>(0,qe.useContext)(ze);var A=D(W(),1),Oe=(0,A.createContext)(null);function uo(){return(0,A.useContext)(Oe)}function Nr(e,t){let n=uo(),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=Hn(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.AJZBJBMO.js"]),import("./chunk.WQBDTLPZ.js"))),lo,Gr=400;function xt(e,t,n){let o=(0,A.useContext)(Oe),r=o!==null&&o.owns(e,t),[i,a]=(0,A.useState)(null),[d,s]=(0,A.useState)(lo);(0,A.useEffect)(()=>{if(d||r||i===null)return;let E=!0;return jr().then(R=>{lo=R,E&&s(R)},()=>{}),()=>{E=!1}},[d,r,i]);let[u,f]=(0,A.useState)(0),h=(0,A.useMemo)(()=>r||i===null||i>=e.log.length||!d?void 0:d.askDeclaration(n,i),[r,e,i,n,d,u]),p=h&&"waiting"in h?h.waiting:void 0,[g,b]=(0,A.useState)(void 0);(0,A.useEffect)(()=>{if(!p)return;let E=!0,R=setTimeout(()=>E&&b(p),Gr);return p.then(()=>E&&f(_=>_+1)),()=>{E=!1,clearTimeout(R)}},[p]);let k=p!==void 0&&g!==p,m=(0,A.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d||k)return null;try{let E=d.pastAt(e,i,n);return{seq:i,at:E.past?.at,store:E}}catch{return null}},[r,e,i,n,d,k,u]),w=(0,A.useRef)(null),y=k?w.current:m;(0,A.useEffect)(()=>{w.current=y},[y]);let x=(0,A.useCallback)(E=>a(E===null?null:E>=e.log.length?Number.POSITIVE_INFINITY:E),[e]),P=(0,A.useCallback)((E,R)=>[e,y?.store].some(_=>_!==void 0&&(_===E||_.seenBy(R)===E)),[e,y]),G=i!==null,I=(0,A.useMemo)(()=>({past:y,open:G,show:x,live:e,host:n,owns:P}),[y,G,x,e,n,P]);return r?o:I}var yo=e=>`graview:setting:${e}`;function mo(){return localStorage}function go(e,t){try{let n=(t??mo()).getItem(yo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function ho(e,t,n){try{(n??mo()).setItem(yo(e.name),t)}catch{}}function So(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=D(W(),1);function Et(e){return De(e)}var Kr=12,Br=4;function $r(e,t,n){let o=Et(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var Ye=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Kr);function wo(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Br)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?ut([...o][0]):n[0]}function kt(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=$r(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=wo(t.ids,n);return i({at:a,mode:"reading",trail:Ye(r.trail,a)}),o}case"about-to-write":case"write":{let a=wo(t.ids,n);return i({at:a,mode:"writing",trail:Ye(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:Ye(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:Ye(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 vo="graview:session";function bo(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(vo);if(o)return o;let r=t();return n.setItem(vo,r),r}catch{return t()}}var At={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"},Pt={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"},xo=[At,Pt],zr=800;function Eo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:s,setView:u,ttlMs:f=1e4,people:h,seats:p}=e,[g,b]=(0,L.useState)(()=>new Map),[k,m]=(0,L.useState)(null),[w,y]=(0,L.useState)(null),[x,P]=(0,L.useState)(null),G=typeof r.id=="string"&&r.id.length>0,I=G&&(s[At.name]??At.initial)==="shared",E=I&&(s[Pt.name]??Pt.initial)==="shared",R=Et({kind:r.kind,...r.id?{id:r.id}:{},session:i}),_=G?Rn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...h?{people:h}:{}}):"",C=d?a.get(`agent:${d}:${i}`):void 0,N=(0,L.useMemo)(()=>!t||!I?null:{participant:R,kind:r.kind,name:_,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:Tn(r.id??"nobody"),stop:x??ee(o),...E?{over:k}:{},...C?{robot:{at:C.at,mode:C.mode}}:{},at:new Date().toISOString()},[t,I,E,R,_,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,x,k,C?.at,C?.mode]);(0,L.useEffect)(()=>{if(!t||!N)return;t.here(N);let V=setInterval(()=>t.here({...N,at:new Date().toISOString()}),zr);return()=>clearInterval(V)},[t,N]),(0,L.useEffect)(()=>t?t.onWho(K=>b(lt(new Map,K,Date.now(),f))):void 0,[t,f]);let ve=g.size>0;(0,L.useEffect)(()=>{if(!ve)return;let V=setInterval(()=>{b(K=>{let B=lt(K,[],Date.now(),f);return B.size===K.size?K:B})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(V)},[ve,f]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let V=()=>t.leave();return window.addEventListener("pagehide",V),()=>window.removeEventListener("pagehide",V)},[t]),(0,L.useEffect)(()=>{if(!E||typeof document>"u")return;let V=null,K=B=>{let J=so(B.target);J!==V&&(V=J,m(J))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[E]);let oe=(0,L.useRef)(null),z=w?g.get(w)??null:null,be=(0,L.useCallback)(V=>{oe.current=null,y(V)},[]);return(0,L.useEffect)(()=>{if(w){if(!z){y(null);return}z.stop!==oe.current?.stop&&(oe.current={stop:z.stop,at:Date.now()},u(Ge(z.stop)))}},[w,z,u]),(0,L.useEffect)(()=>{let V=oe.current;!w||V===null||Date.now()-V.at<400||Nn(o,Ge(V.stop))||y(null)},[o,w]),(0,L.useEffect)(()=>{if(!w||typeof document>"u")return;let V=K=>{K.key==="Escape"&&y(null)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[w]),(0,L.useMemo)(()=>({who:g,sharing:N?{participant:R,name:_}:null,following:z,follow:be,sayWhere:P}),[g,N,R,_,z,be])}var Y=D(W(),1);function ko(e){return De(e.author)}function Ur(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Ao(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 h=i.get(s),p=h?.participants.includes(ko(u))?h.participants:[...h?.participants??[],ko(u)];i.set(s,{at:o,manner:Ur(p,u.author.kind),intent:u.intent,wrote:(h?.wrote??!1)||(f.wrote??!1),read:(h?.read??!1)||(f.read??!1),broke:(h?.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 Yr=2600;function Po(e,t=Yr){let[n,o]=(0,Y.useState)(()=>new Map),r=(0,Y.useRef)(n);r.current=n;let i=(0,Y.useRef)(null),a=(0,Y.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,Y.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,h)=>{let p=e.violations(),g=Cn(e.allInvariants(),s,p).introduces;s=p,a(Ao(r.current,h,g.map(b=>({nodeIds:b.nodeIds,message:b.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let d=(0,Y.useCallback)(s=>{s.reads.length!==0&&a(Ao(r.current,[Xr(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function Xr(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=D(W(),1);function Ro(){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 Xe=D(W(),1),Jr=e=>e.definitions.some(t=>An(t).size>0);function To(e,t,n){let[o,r]=(0,Xe.useState)(void 0),i=(n.roles??[]).join("\0");return(0,Xe.useEffect)(()=>{if(!t||!Jr(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=Pn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return st(s,f.read),r(f),e.reread(),()=>{a=!1,st(s,void 0)}},[e,t,n.kind,n.id,i]),o}function Mo(){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=D(Ie(),1),Ce=(0,l.createContext)(null),_o=(0,l.createContext)("scene");function Zr({mode:e,children:t}){return(0,le.jsx)(_o.Provider,{value:e,children:t})}function Qr(){return(0,l.useContext)(_o)}var Vo={kind:"human"},ei=[],ti=[],ni=[],Rt=[];function Lo(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Vo,r=()=>In(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 oi={off:!0};function ri({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=ei,onSeat:d,people:s=ti,memory:u,presenceTtlMs:f,app:h,settings:p=h?.settings??ni,presence:g,brand:b,locale:k,onKeepLens:m,providers:w,ai:y,files:x,resolveApp:P,history:G,linkedRecords:I,menuSections:E,subscriptions:R,signIn:_,view:C,onViewChange:N,children:ve}){let oe=(0,l.useContext)(Ce),z=E??oe?.menuSections,be=_??oe?.signIn,[V,K]=(0,l.useState)(null),B=V??i??a[0]?.principal??Vo,J=xt(e,B,G),Ft=J.past&&J.live===e?J.past.store:e,H=(0,l.useMemo)(()=>Ft.seenBy(B),[Ft,B]);Lo(e,B);let[re]=(0,l.useState)(()=>bo(u)),[Kt,Jo]=(0,l.useState)(!1),Bt=(0,l.useCallback)(()=>Jo(!0),[]),ie=(0,l.useMemo)(()=>g?[...p,...xo]:p,[p,g]),[tt]=(0,l.useState)(()=>n??It(t,e.schema)),[Zo,$t]=(0,l.useState)(()=>We(tt??ue,r??tt?.selection??[])),xe=(0,l.useRef)(tt??ue).current,[qt,Qo]=(0,l.useState)(null),[zt,er]=(0,l.useState)(null),Z=(0,l.useContext)(Ce),[Ut]=(0,l.useState)(()=>Z?.seatTalk??vt(b?.name??e.schema.kinds.join(","))),nt=y??Z?.ai??ft,Ve=(0,l.useMemo)(()=>nt.off?oi:nt,[nt]),Yt=(0,l.useRef)(Ve.interactions);Yt.current=Ve.interactions;let[Xt]=(0,l.useState)(()=>Z?.aiDesk??bt(()=>Yt.current)),[tr]=(0,l.useState)(()=>Z?.subscriptions??On()),Jt=R??Z?.subscriptions??tr,ot=m??Z?.onKeepLens,rt=h??Z?.app,Le=k??Z?.locale,nr=b?.locale??rt?.brand?.locale;kn({reader:Le,app:nr});let Zt=(0,l.useRef)(null),Qt=(0,l.useCallback)(c=>{Zt.current=c},[]),en=(0,l.useCallback)(c=>Zt.current?.whereIs(c)??null,[]),[tn]=(0,l.useState)(()=>Ro()),[nn]=(0,l.useState)(()=>Mo()),[it,or]=(0,l.useState)(null),[Ee,on]=(0,l.useState)(()=>new Map),ke=(0,l.useRef)(Ee);ke.current=Ee;let Ae=(0,l.useRef)(null),at=(0,l.useCallback)(c=>H.graph.getNode(c)?.kind,[H]),Q=(0,l.useCallback)(c=>{let S=kt(ke.current,c,at);ke.current=S,on(S),Ae.current&&clearTimeout(Ae.current),[...S.values()].some(M=>M.mode!=="docked"&&M.mode!=="asking")&&(Ae.current=setTimeout(()=>{let M=kt(ke.current,{type:"rest",at:Date.now(),holdMs:Ot},at);ke.current=M,on(M)},Ot+20))},[at]),rn=(0,l.useCallback)(c=>Q({...c,at:c.at??Date.now()}),[Q]),an=(0,l.useCallback)(c=>{or(c),c&&Q({type:"home",author:{kind:"agent",id:c,session:re},at:Date.now()})},[Q,re]);(0,l.useEffect)(()=>H.subscribe((c,S)=>{for(let T of S)T.author.kind==="agent"&&Q({type:"write",author:T.author,ids:T.writes,at:Date.now()})}),[H,Q]),(0,l.useEffect)(()=>()=>{Ae.current&&clearTimeout(Ae.current)},[]);let U=(0,l.useMemo)(()=>({...B,session:re}),[B,re]),sn=To(H,I,U),ln=(0,l.useCallback)(c=>{K(c),d?.(c)},[d]),[Pe,rr]=(0,l.useState)(()=>Object.fromEntries(ie.map(c=>[c.name,go(c,u)])));(0,l.useEffect)(()=>{for(let c of ie)So(c,Pe[c.name]??c.initial)},[ie,Pe]);let dn=(0,l.useCallback)((c,S)=>{let T=ie.find(M=>M.name===c);!T||!T.options.some(M=>M.value===S)||(ho(T,S,u),rr(M=>({...M,[c]:S})))},[ie,u]),[un,ir]=(0,l.useState)(null),{activity:cn,noteAttention:fn}=Po(H),pn=(0,l.useCallback)(c=>{fn(c),Q({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[fn,Q]),de=(0,l.useCallback)(c=>{if(fe(c)!==null||se(c).length>0||ct(c))return!0;let S=jn(c);return S?H.graph.allEdges().some(T=>T.kind===S.kind&&T.from===S.from&&T.to===S.to):H.graph.getNode(c)!==void 0},[H]),yn=(0,l.useCallback)(c=>{let S=c.selection??Rt,T=S.filter(de),M=T.length===S.length?c:We(c,T);return M.focusId!==null&&!de(M.focusId)&&(M=q(M,null)),M},[de]),Re=(0,l.useCallback)(c=>{let S=yn(c),T=Co(H,U,S.shown);if(S.focusId!==null&&T.size>0){let M=se(S.focusId),En=H.graph.getNode(S.focusId);(M.length>0?M.every(lr=>T.has(lr)):En?T.has(En.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let M=xe.focusId!==null&&!de(xe.focusId)?It(t,e.schema)??{...ue,overview:!0}:xe;M.focusId!==null&&de(M.focusId)?S={...S,focusId:M.focusId}:M.overview===!0&&(S={...S,overview:!0})}return S},[yn,de,H,xe,U,t,e.schema]),$=Re(C??Zo),mn=(0,l.useMemo)(()=>Co(H,U,$.shown),[H,U,$.shown]),gn=(0,l.useMemo)(()=>[...H.modules.administered.entries()].map(([c,S])=>{let T=H.mayAdminister(c,U);return{name:c,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:T,shown:T&&($.shown??[]).includes(c)}}),[H,U,$.shown]),Te=(0,l.useCallback)(c=>{let S=T=>Re(typeof c=="function"?c(T):c);if(C!==void 0){N?.(S(C));return}N&&N(S($)),$t(T=>S(T))},[$,N,C,Re]);(0,l.useEffect)(()=>{C===void 0&&$t(c=>{let S=Re(c);return S===c?c:S})},[$,C,Re]);let hn=$.selection??Rt,Sn=(0,l.useCallback)(c=>{Te(S=>We(S,typeof c=="function"?c(S.selection??Rt):c))},[Te]),{who:wn,following:vn,follow:bn,sayWhere:ar,sharing:xn}=Eo({channel:g,store:H,view:$,principal:U,session:re,robots:Ee,seatWho:it,settingValues:Pe,setView:Te,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),sr=(0,l.useMemo)(()=>({store:H,scheme:o,views:t,view:$,setView:Te,homeView:xe,selection:hn,setSelection:Sn,menuAt:qt,setMenuAt:Qo,whereIs:en,pointer:tn,motion:nn,registerScene:Qt,robots:Ee,noteSeat:rn,seatWho:it,registerSeatWho:an,actsDoor:zt,registerActsDoor:er,seatTalk:Ut,aiDesk:Xt,...u?{memory:u}:{},who:wn,following:vn,follow:bn,sayWhere:ar,sharing:xn,session:re,ai:Ve,resolveApp:P,linkedRecords:I,menuSections:z,subscriptions:Jt,signIn:be,linkedReads:sn,movedByHand:Kt,noteMoved:Bt,emphasis:un,setEmphasis:ir,activity:cn,noteAttention:pn,principal:U,seats:a,people:s,takeSeat:ln,settings:ie,settingValues:Pe,chooseSetting:dn,hiddenKinds:mn,administered:gn,...w?{providers:w}:{},...b?{brand:b}:{},...ot?{onKeepLens:ot}:{},app:rt,...Le?{locale:Le}:{}}),[H,o,t,$,Te,hn,Sn,qt,en,tn,nn,Qt,Ee,rn,it,an,zt,Ut,Xt,u,wn,vn,bn,xn,re,Ve,P,I,z,Jt,be,sn,Kt,Bt,un,cn,pn,U,a,s,ln,ie,Pe,dn,mn,gn,w,b,ot,rt,Le]);return(0,le.jsx)(Ce.Provider,{value:sr,children:(0,le.jsx)(Oe.Provider,{value:J,children:(0,le.jsx)(di,{children:x?(0,le.jsx)(ze.Provider,{value:x,children:ve}):ve})})})}var Ho=(0,l.createContext)(null),Tt,Mt=new Set,ii=e=>(Mt.add(e),()=>void Mt.delete(e)),Oo=()=>Tt;function ai(e){if(!Tt){Tt=e;for(let t of[...Mt])t()}}var si=300;function li(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,si)),r===t?e(n,o):[]}}function di({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=ne(),s=Je(),u=n.q,f=n.focusId,h=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(ii,Oo,Oo),g=(0,l.useMemo)(()=>h&&p?{flagged:new Set(t.violations().flatMap(x=>x.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,h,p]),b=f?t.graph.getNode(f)?.kind??fe(f)??(se(f).length===1?se(f)[0]:void 0):void 0,k=(0,l.useMemo)(()=>d.near&&li(d.near),[d.near]),m=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...b?{inKind:b}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(x=>!i.has(x)),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,b,g,k]),[w,y]=(0,l.useState)();return(0,l.useEffect)(()=>void m?.later?.then(x=>y([m,x])),[m]),(0,le.jsx)(Ho.Provider,{value:w?.[0]===m?w[1]:m,children:e})}var Io=new WeakMap;function Fa(e){let t=Io.get(e);return t||Io.set(e,t=new Set(e.matched)),t}function ui(){return(0,l.useContext)(Ho)}function ne(){let e=(0,l.useContext)(Ce);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Ct(){return(0,l.useContext)(Ce)??null}function Je(){let{store:e}=ne(),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 ci(e){let{store:t}=ne(),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 Co(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 Ot=2600;var Do=new WeakSet,fi=e=>Do.has(e),pi=e=>void Do.add(e);function It(e,t){let n=Vn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...ue,focusId:te(n.place.kind),within:{view:n.place.as}}:{...ue,focusId:te(n.kind)}}var No=D(W(),1),yi=(0,No.createContext)(!1);var Ze=Symbol.for("graview.default-view");function jo(e){return Object.defineProperty(e,Ze,{value:!0,enumerable:!1}),e}function Go(e){return typeof e=="function"&&e[Ze]===!0}var _t=Symbol.for("graview.replaces-page");function Wo(e){return typeof e=="function"&&e[_t]===!0}function gi(e){return _n(e)}function hi(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 ge=D(W(),1);function Si(){let{selection:e,setSelection:t}=ne();return(0,ge.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 wi(){let{store:e}=ne(),t=Je();return(0,ge.useMemo)(()=>vi(e),[e,t])}var Fo=new WeakMap;function vi(e){let t=Fo.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Fo.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function bi(){let{view:e,setView:t}=ne();return(0,ge.useMemo)(()=>({view:e,url:ee(e),focus:n=>t(o=>q(o,n)),show:n=>t(o=>Gn(o,n)),toggle:n=>t(o=>Fe(o,n)),go:n=>t(n)}),[e,t])}var me={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;me.at=typeof t?.graview=="number"?t.graview:0,me.at>me.depth&&(me.depth=me.at),me.tell()});var j=D(W(),1),Lt={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"]}},xi={position:"fixed",inset:"auto",margin:0,zIndex:Mn("popover"),boxSizing:"border-box"},Qe=6,he=8,Ei=e=>typeof e.showPopover=="function";function et(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 Ht(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-Qe-he,s=o.top-Qe-he,u=a.height<=d||d>=s,f=Math.max(96,Math.floor(u?d:s)),h=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,b=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();b&&p<=b.right-b.left&&(g<b.left?g=o.left+p<=b.right?o.left:b.left:g+p>b.right&&(g=o.right-p>=b.left?o.right-p:b.right-p));let k=p>=r.width-2*he?Math.max(0,(r.width-p)/2):Math.max(he,Math.min(g,r.width-he-p)),m=u?o.bottom+Qe:Math.max(he,o.top-Qe-h);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(m)}px`}function Ko(e,t,n,o={}){let r=o.align??"end";(0,j.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Ei(i)&&!et(i))try{i.showPopover(),Pi()}catch{}let a=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>Ht(i,n,{align:r})))};Ht(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&&et(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Dt=new Set;function Ai(e){return Dt.add(e),()=>Dt.delete(e)}function Pi(){for(let e of Dt)if(!(!e.isConnected||!et(e)))try{e.hidePopover(),e.showPopover()}catch{}}var Se=null,Ri='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Ti(e){for(let t of e.querySelectorAll(Ri))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Vt=()=>{let e=document.activeElement;return e===null||e===document.body};function Mi(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),h=(0,j.useCallback)(y=>{u.current=y},[]),p=(0,j.useCallback)(y=>{f.current=y},[]),g=`graview-popover-${(0,j.useId)().replace(/:/g,"")}`,b=(0,j.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});b.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,j.useCallback)(y=>{b.current.controlled||d(y),b.current.onOpenChange?.(y)},[]),m=(0,j.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??b.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),w=(0,j.useCallback)(y=>{let x=f.current,P=typeof document>"u"?null:document.activeElement,G=P===null||P===document.body||x!==null&&x.contains(P);k(!1),!(!y||!G)&&(m(),requestAnimationFrame(()=>{Vt()&&m()}))},[k,m]);return Ko(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,j.useEffect)(()=>{if(!i||!s)return;let y={name:e,close:()=>w(!1)};if(Se&&Se.close!==y.close&&Se.close(),Se=y,Lt[e].focus==="into"){let R=f.current;R&&!R.contains(document.activeElement)&&Ti(R).focus({preventScroll:!0})}let x=R=>{R.key==="Escape"&&w(!0)},P=R=>{let _=R.target;if(!(_ instanceof Node))return;let C=f.current;if(C?.contains(_)||u.current?.contains(_))return;let N=_ instanceof Element?_.closest('[role="dialog"], [role="alertdialog"]'):null;N&&!(C&&N.contains(C))||(w(!1),Lt[e].focus==="into"&&requestAnimationFrame(()=>{(Vt()||C!==null&&C.contains(document.activeElement))&&m()}))},G=null,I=null,E=R=>{let _=R.target;if(!(_ instanceof Element))return;let C=f.current,N=_.closest('[role="dialog"], [role="alertdialog"]');!N||C&&(C.contains(N)||N.contains(C))||(G=N,w(!1))};return document.addEventListener("keydown",x),document.addEventListener("pointerdown",P,!0),document.addEventListener("focusin",E),()=>{document.removeEventListener("keydown",x),document.removeEventListener("pointerdown",P,!0),document.removeEventListener("focusin",E);let R=G;R&&typeof MutationObserver<"u"&&(I?.disconnect(),I=new MutationObserver(()=>{R.isConnected||(I?.disconnect(),requestAnimationFrame(()=>{(Vt()||document.activeElement.closest("[hidden]")!==null)&&m()}))}),I.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>I?.disconnect(),10*6e4)),Se?.close===y.close&&(Se=null)}},[i,s,e,w,m]),{open:s,setOpen:y=>y?k(!0):w(!0),toggle:()=>s?w(!0):k(!0),trigger:{ref:h,"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 F=D(W(),1),X=D(Ie(),1),Nt=new Set,Bo=!1;function jt(){for(let e of[...Nt])e()}function Oi(){Bo||typeof window>"u"||(Bo=!0,window.addEventListener("online",jt))}function Ii(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 h().catch(()=>{});function h(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Nt.delete(f),d(),g),g=>{throw r=void 0,o=!0,Nt.add(f),Oi(),d(),g});return p.catch(()=>{}),r=p,p}return{load:h,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let b=g.what??"This part";function k(y){(0,F.useSyncExternalStore)(s,u,u);let x=(0,F.useRef)(null),P=(0,F.useRef)(null),G=(0,F.useRef)(!1);return(0,F.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(G.current=!0),(0,F.useLayoutEffect)(()=>{if(!(!n||!G.current)){G.current=!1;for(let I=P.current?.nextElementSibling??null;I!==null;I=I.nextElementSibling){let E=I.matches($o)?I:I.querySelector($o);if(E instanceof HTMLElement){E.focus();return}}}}),n?(0,X.jsxs)(X.Fragment,{children:[G.current?(0,X.jsx)("span",{ref:P,hidden:!0}):null,p(t,y)]}):g.quiet?null:(0,X.jsx)(Ci,{what:b,button:x,...g.as?{as:g.as}:{}})}let m=(0,F.lazy)(()=>h().then(()=>({default:k}),()=>({default:k})));function w(y){let[x]=(0,F.useState)(()=>n||o);return(0,F.createElement)(x?k:m,y)}return w}}}var $o="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Ci({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,X.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,X.jsx)("span",{role:"status",children:r})," ",(0,X.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:jt,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 we=D(W(),1);var qo=(0,we.createContext)(null);function _i(){let e=(0,we.useContext)(qo),t=Ct(),n=(o,r,i)=>t?.setView(a=>ae(ae(ce(q(a,te(o)),!1),"view",r),"filter",i?.filter??null));return(0,we.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>q(ce(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 zo=D(W(),1),Vi=(0,zo.createContext)(!1);var Uo=D(W(),1),Li=(0,Uo.createContext)(null);var Yo=D(W(),1),Gt='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Wt=e=>e instanceof HTMLElement&&(e.matches(Gt)||e.hasAttribute("tabindex")),_e=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function Hi(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&&Wt(d)&&_e(d)?d:null}var Di=e=>e.isConnected&&Wt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&_e(e);function Xo(e,t){let n=t?Hi(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&_e(o))return o;for(let r of e.querySelectorAll(Gt))if(_e(r))return r;return Wt(e)&&_e(e)?e:null}function Ni(e){(0,Yo.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=m=>{let w=m.target;if(w instanceof Element){n=[];for(let y=w;y&&y!==t.parentElement;y=y.parentElement)n.push(y)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,s=(m,w)=>void setTimeout(()=>d()&&w(),m),u=m=>void requestAnimationFrame(()=>d()&&m()),f=m=>{if(r=!1,i)return;let w=a.activeElement;if(!(!(w===null||w===a.body||w===a.documentElement)||n.length===0)){if(Di(n[0])){m&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let x of n.slice(1)){if(!x.isConnected)continue;let P=Xo(x,n[0]);if(P){P.focus({preventScroll:!0}),n=[];return}}}},h=(m,w=Date.now()+2500)=>{s(100,()=>{f(m);let y=a.activeElement;(y===null||y===a.body||y===a.documentElement)&&n.length>0&&Date.now()<w&&h(m,w)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),h(!1)})))},g=m=>{if(!(m instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(m.key))){if(!(m instanceof KeyboardEvent)){let w=m.target instanceof Element?m.target.closest(Gt):null,y=a.activeElement,x=y===null||y===a.body||y===a.documentElement;if(w&&x&&t.contains(w)){n=[];for(let P=w;P&&P!==t.parentElement;P=P.parentElement)n.push(P);s(150,()=>u(()=>{f(!1),h(!1)}));return}}!(m instanceof KeyboardEvent)&&!(m.target instanceof Node&&n[0]?.contains(m.target))||s(150,()=>u(()=>{f(!0),h(!0)}))}},b=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),k=m=>{m.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",g),t.addEventListener("keydown",g),b.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",g),t.removeEventListener("keydown",g),b.disconnect()}},[e])}export{Hn as a,ue as b,ee as c,Ge as d,Wi as e,Fi as f,Nn as g,Dn as h,jn as i,dt as j,q as k,Gn as l,ae as m,ce as n,We as o,Me as p,Fe as q,Be as r,ut as s,fe as t,$i as u,fr as v,te as w,Wn as x,se as y,Fn as z,pr as A,qi as B,Kn as C,ct as D,yr as E,W as F,vt as G,Vr as H,Hr as I,so as J,ze as K,Dr as L,Oe as M,uo as N,Nr as O,xt as P,Ie as Q,Zr as R,Qr as S,Lo as T,ri as U,ai as V,Fa as W,ui as X,ne as Y,Ct as Z,Je as _,ci as $,fi as aa,pi as ba,It as ca,qo as da,_i as ea,yi as fa,jo as ga,Go as ha,Wo as ia,gi as ja,hi as ka,Vi as la,Li as ma,Si as na,wi as oa,bi as pa,me as qa,Ni as ra,xi as sa,et as ta,Ko as ua,Ai as va,Mi as wa,Ii as xa};
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
- */