graview 0.1.30 → 0.1.33

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 (174) hide show
  1. package/dist/preview/chunk.26LLZN3C.js +1 -0
  2. package/dist/preview/chunk.2NIOHEMX.js +1 -0
  3. package/dist/preview/chunk.2WPZXIRP.js +2 -0
  4. package/dist/preview/{chunk.XRJBLH4N.js → chunk.3AGY4QVS.js} +1 -1
  5. package/dist/preview/chunk.3HXN4BOY.js +1 -0
  6. package/dist/preview/{chunk.2CIBWZJG.js → chunk.3K6YSVHC.js} +1 -1
  7. package/dist/preview/chunk.3NDH3EDN.js +47 -0
  8. package/dist/preview/{chunk.FWCOJDOD.js → chunk.3TVXGJTU.js} +1 -1
  9. package/dist/preview/{chunk.NDADLJE6.js → chunk.3TY5NFLY.js} +1 -1
  10. package/dist/preview/{chunk.UWGWXFWZ.js → chunk.47STJVRV.js} +1 -1
  11. package/dist/preview/{chunk.X37L5TN5.js → chunk.4HNG4UXT.js} +1 -1
  12. package/dist/preview/{chunk.34ZMMURV.js → chunk.4HRAQNJO.js} +6 -6
  13. package/dist/preview/{chunk.QTMWHE5O.js → chunk.4HZ7QTXZ.js} +1 -1
  14. package/dist/preview/{chunk.3JGGBLRB.js → chunk.4MERAWS2.js} +1 -1
  15. package/dist/preview/chunk.52W7WYME.js +1 -0
  16. package/dist/preview/chunk.5A4AOFOA.js +1 -0
  17. package/dist/preview/chunk.5H4VXLZF.js +88 -0
  18. package/dist/preview/{chunk.XS7YFNDU.js → chunk.5T5XGILP.js} +1 -1
  19. package/dist/preview/chunk.5UL7YDUD.js +1 -0
  20. package/dist/preview/chunk.63GXY2ME.js +1 -0
  21. package/dist/preview/chunk.67TPUXAY.js +1 -0
  22. package/dist/preview/chunk.6QWV5MVH.js +25 -0
  23. package/dist/preview/{chunk.PAVR5TK5.js → chunk.6UGEYZAC.js} +1 -1
  24. package/dist/preview/chunk.6YCBYL2Y.js +2 -0
  25. package/dist/preview/{chunk.ZYKAS4BT.js → chunk.7GKUVQVF.js} +1 -1
  26. package/dist/preview/{chunk.T3VPD7JQ.js → chunk.7T7NZZTC.js} +1 -1
  27. package/dist/preview/chunk.AKFKM4SW.js +3 -0
  28. package/dist/preview/chunk.AOSMJKLH.js +1 -0
  29. package/dist/preview/{chunk.DT7LHWU2.js → chunk.AR3DCDHU.js} +1 -1
  30. package/dist/preview/{chunk.D3IECJ2S.js → chunk.ASCLIM2P.js} +1 -1
  31. package/dist/preview/chunk.B2GLDIAS.js +1 -0
  32. package/dist/preview/chunk.BHXGM3PV.js +1 -0
  33. package/dist/preview/chunk.BNV77BQZ.js +4 -0
  34. package/dist/preview/chunk.BQ3JHEHV.js +1 -0
  35. package/dist/preview/chunk.CAVBSL27.js +1 -0
  36. package/dist/preview/{chunk.YLQB3KBA.js → chunk.CDP2XL66.js} +1 -1
  37. package/dist/preview/chunk.CIPS2OGR.js +1 -0
  38. package/dist/preview/chunk.CN3UEF5N.js +90 -0
  39. package/dist/preview/{chunk.6XMEU2Q2.js → chunk.COQKECUH.js} +1 -1
  40. package/dist/preview/{chunk.QTA4ROAK.js → chunk.CWHRDBOF.js} +1 -1
  41. package/dist/preview/chunk.CX3KL2C5.js +1 -0
  42. package/dist/preview/{chunk.AK3IHFCF.js → chunk.D75KC3LL.js} +1 -1
  43. package/dist/preview/chunk.DAZ2VSRD.js +1 -0
  44. package/dist/preview/{chunk.3ADPAGPY.js → chunk.DYSPCGXX.js} +1 -1
  45. package/dist/preview/chunk.E2YEOMPH.js +1 -0
  46. package/dist/preview/chunk.EBGAYL32.js +1 -0
  47. package/dist/preview/chunk.EF3XNU4O.js +1 -0
  48. package/dist/preview/chunk.EJPI3ST6.js +1 -0
  49. package/dist/preview/chunk.EKPRNDUV.js +1 -0
  50. package/dist/preview/chunk.ERIT3R6N.js +1 -0
  51. package/dist/preview/chunk.EYTBDMTW.js +1 -0
  52. package/dist/preview/{chunk.HHPGWJDO.js → chunk.FWTIUYXH.js} +1 -1
  53. package/dist/preview/{chunk.6T2Q6NLO.js → chunk.G5NZVPJU.js} +1 -1
  54. package/dist/preview/chunk.GBRRGTIH.js +1 -0
  55. package/dist/preview/{chunk.VG56IUIQ.js → chunk.GO4XBWJO.js} +1 -1
  56. package/dist/preview/chunk.GV2CQVKV.js +1 -0
  57. package/dist/preview/chunk.GYICGZMG.js +3 -0
  58. package/dist/preview/chunk.H7BST3XO.js +1 -0
  59. package/dist/preview/chunk.H7EPE74C.js +1 -0
  60. package/dist/preview/{chunk.26CZTUY4.js → chunk.HAIG6NVX.js} +1 -1
  61. package/dist/preview/{chunk.V7BDAGDE.js → chunk.HLTRQU4Y.js} +1 -1
  62. package/dist/preview/{chunk.VS7K3SCD.js → chunk.I6FPNX43.js} +1 -1
  63. package/dist/preview/chunk.IDVAR5HM.js +1 -0
  64. package/dist/preview/{chunk.3URFMWXZ.js → chunk.IWQCOGHW.js} +2 -2
  65. package/dist/preview/chunk.J25KOSNW.js +1 -0
  66. package/dist/preview/chunk.JDUJDAGA.js +1 -0
  67. package/dist/preview/chunk.JOOQUWLT.js +341 -0
  68. package/dist/preview/{chunk.4SJUTBDV.js → chunk.JQU5GEU3.js} +1 -1
  69. package/dist/preview/chunk.K5ME5GCG.js +1 -0
  70. package/dist/preview/chunk.KSES5U5B.js +1 -0
  71. package/dist/preview/chunk.KSXB4LDF.js +1 -0
  72. package/dist/preview/chunk.LR3VDXPI.js +1 -0
  73. package/dist/preview/{chunk.WYTIOLPP.js → chunk.LXBOVRFI.js} +1 -1
  74. package/dist/preview/{chunk.42YX6NOY.js → chunk.MAF7C3VM.js} +1 -1
  75. package/dist/preview/chunk.MNP4JI33.js +5 -0
  76. package/dist/preview/{chunk.O2LK2AO7.js → chunk.MWGGV7DE.js} +1 -1
  77. package/dist/preview/chunk.N6OX4NEQ.js +1 -0
  78. package/dist/preview/chunk.NRAYZY3X.js +1 -0
  79. package/dist/preview/chunk.NTF7FVB2.js +1 -0
  80. package/dist/preview/{chunk.DZRTOURR.js → chunk.OC6IWRQ3.js} +1 -1
  81. package/dist/preview/chunk.OJGHDWI6.js +1 -0
  82. package/dist/preview/chunk.OKRNJXTV.js +1 -0
  83. package/dist/preview/chunk.PBSMLINK.js +1 -0
  84. package/dist/preview/chunk.PHKSMUIA.js +1 -0
  85. package/dist/preview/{chunk.JN7DIFR3.js → chunk.PIP6Z563.js} +1 -1
  86. package/dist/preview/chunk.QVVJRSRM.js +1 -0
  87. package/dist/preview/{chunk.L6OMEYL6.js → chunk.QYZNAUIR.js} +1 -1
  88. package/dist/preview/chunk.R6K6GF5R.js +1 -0
  89. package/dist/preview/{chunk.JTNWD2CN.js → chunk.RCKTBOY2.js} +1 -1
  90. package/dist/preview/{chunk.QNGWEV47.js → chunk.RIJUCHP4.js} +1 -1
  91. package/dist/preview/chunk.SHTJZ6UX.js +1 -0
  92. package/dist/preview/{chunk.PKK6FRZR.js → chunk.SYAEBGDC.js} +1 -1
  93. package/dist/preview/chunk.T5VG5A6V.js +1 -0
  94. package/dist/preview/{chunk.ERXSYPYL.js → chunk.TAQ764IQ.js} +1 -1
  95. package/dist/preview/{chunk.RIEHYQLK.js → chunk.TMVCTBAD.js} +50 -24
  96. package/dist/preview/{chunk.HHI65WFZ.js → chunk.UATVTXZY.js} +1 -1
  97. package/dist/preview/{chunk.XSTXV6FP.js → chunk.UBFNZMUX.js} +2 -2
  98. package/dist/preview/{chunk.WAFDCOOG.js → chunk.UGFJKSHU.js} +1 -1
  99. package/dist/preview/chunk.UHUGOTUU.js +19 -0
  100. package/dist/preview/chunk.ULRW47RP.js +1 -0
  101. package/dist/preview/chunk.UNL2HIF2.js +1 -0
  102. package/dist/preview/chunk.UVR2Z5ZC.js +1 -0
  103. package/dist/preview/chunk.UZGRRDHD.js +1 -0
  104. package/dist/preview/{chunk.BPWNWE7N.js → chunk.VG3O4LWB.js} +1 -1
  105. package/dist/preview/chunk.WAZ7OGBD.js +1 -0
  106. package/dist/preview/{chunk.3JNMSOFG.js → chunk.XANVHJQ4.js} +1 -1
  107. package/dist/preview/chunk.XBJYQNVE.js +1 -0
  108. package/dist/preview/chunk.XKABS745.js +1 -0
  109. package/dist/preview/chunk.XMC7YDWT.js +1 -0
  110. package/dist/preview/chunk.XNJEFUF7.js +3 -0
  111. package/dist/preview/chunk.Y2SFUALD.js +117 -0
  112. package/dist/preview/chunk.Y6ZNFQK3.js +6 -0
  113. package/dist/preview/{chunk.J2ITFGN3.js → chunk.YIR7PPF3.js} +1 -1
  114. package/dist/preview/index.html +51 -0
  115. package/dist/preview/page.js +6 -6
  116. package/package.json +6 -6
  117. package/dist/preview/chunk.2EXGG6BB.js +0 -1
  118. package/dist/preview/chunk.2NBYNZRD.js +0 -1
  119. package/dist/preview/chunk.2XAONC66.js +0 -1
  120. package/dist/preview/chunk.3R4W2P5X.js +0 -1
  121. package/dist/preview/chunk.3SKKIHU3.js +0 -4
  122. package/dist/preview/chunk.3VL5WECB.js +0 -1
  123. package/dist/preview/chunk.4ALKPNXM.js +0 -1
  124. package/dist/preview/chunk.4HP7UWA2.js +0 -1
  125. package/dist/preview/chunk.5U5J3ISK.js +0 -1
  126. package/dist/preview/chunk.6V2RG5JG.js +0 -5
  127. package/dist/preview/chunk.7BWT5L2L.js +0 -1
  128. package/dist/preview/chunk.C5CYZNSJ.js +0 -1
  129. package/dist/preview/chunk.CM6LOIQE.js +0 -88
  130. package/dist/preview/chunk.FDELO7NY.js +0 -116
  131. package/dist/preview/chunk.FGVKJWNS.js +0 -6
  132. package/dist/preview/chunk.GFF2FB2J.js +0 -25
  133. package/dist/preview/chunk.GLBHQFJ2.js +0 -1
  134. package/dist/preview/chunk.HSCTWAUV.js +0 -1
  135. package/dist/preview/chunk.INZUEWC5.js +0 -1
  136. package/dist/preview/chunk.JH6MU6TX.js +0 -2
  137. package/dist/preview/chunk.JISMMIMX.js +0 -1
  138. package/dist/preview/chunk.JPHNKWTY.js +0 -1
  139. package/dist/preview/chunk.K75FUIZI.js +0 -1
  140. package/dist/preview/chunk.K776HO42.js +0 -2
  141. package/dist/preview/chunk.KN3ULTGF.js +0 -1
  142. package/dist/preview/chunk.KOB6N3SL.js +0 -1
  143. package/dist/preview/chunk.KQT7WAQE.js +0 -1
  144. package/dist/preview/chunk.L4DECHXR.js +0 -327
  145. package/dist/preview/chunk.LQ7V6KEE.js +0 -1
  146. package/dist/preview/chunk.MD74YVRN.js +0 -3
  147. package/dist/preview/chunk.MGNP4LAM.js +0 -1
  148. package/dist/preview/chunk.NCTOBUCT.js +0 -1
  149. package/dist/preview/chunk.NO52VON3.js +0 -1
  150. package/dist/preview/chunk.OAF7TUMI.js +0 -1
  151. package/dist/preview/chunk.OQ4KFN6W.js +0 -1
  152. package/dist/preview/chunk.OQDETV4X.js +0 -1
  153. package/dist/preview/chunk.OXQMNIRO.js +0 -1
  154. package/dist/preview/chunk.OZNW5W4Z.js +0 -1
  155. package/dist/preview/chunk.QIAKO27D.js +0 -1
  156. package/dist/preview/chunk.R26DREVU.js +0 -1
  157. package/dist/preview/chunk.RI3PYG5T.js +0 -19
  158. package/dist/preview/chunk.RRVIXV7W.js +0 -1
  159. package/dist/preview/chunk.RYT5U3QM.js +0 -1
  160. package/dist/preview/chunk.SE5SKFQH.js +0 -1
  161. package/dist/preview/chunk.SOBC3CTN.js +0 -47
  162. package/dist/preview/chunk.SOD3PBJM.js +0 -1
  163. package/dist/preview/chunk.UDSEJKCY.js +0 -1
  164. package/dist/preview/chunk.UZWWDAGM.js +0 -14
  165. package/dist/preview/chunk.V5ZYUVMH.js +0 -1
  166. package/dist/preview/chunk.VOAZBHCG.js +0 -1
  167. package/dist/preview/chunk.VSZQXB4Q.js +0 -3
  168. package/dist/preview/chunk.W3S6UXNA.js +0 -1
  169. package/dist/preview/chunk.Y4UXEL6Y.js +0 -1
  170. package/dist/preview/chunk.YJUB4OD7.js +0 -1
  171. package/dist/preview/chunk.YNQDVGZM.js +0 -1
  172. package/dist/preview/chunk.YV2LJFGS.js +0 -1
  173. package/dist/preview/chunk.Z2YUYZT4.js +0 -1
  174. /package/dist/preview/{chunk.EYZ7MHBZ.js → chunk.GZHZLJBF.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26DREVU.js";import{h as ca,i as va}from"./chunk.3SKKIHU3.js";import{a as ga}from"./chunk.HJCQ6I3S.js";import"./chunk.O2LK2AO7.js";import"./chunk.26CZTUY4.js";import"./chunk.3JNMSOFG.js";import"./chunk.OAF7TUMI.js";import"./chunk.ERXSYPYL.js";import{b as da,c as sa,d as fe,e as la}from"./chunk.J2ITFGN3.js";import{a as ea}from"./chunk.KOB6N3SL.js";import{b as ue}from"./chunk.GLBHQFJ2.js";import"./chunk.6XMEU2Q2.js";import{b as me}from"./chunk.QIAKO27D.js";import"./chunk.UT6642FC.js";import"./chunk.2CIBWZJG.js";import"./chunk.MB7LKKUD.js";import"./chunk.7BWT5L2L.js";import"./chunk.SE5SKFQH.js";import{p as ia,q as na,r as oa}from"./chunk.W3S6UXNA.js";import{b as pa}from"./chunk.4SJUTBDV.js";import{e as wa}from"./chunk.DT7LHWU2.js";import{a as La}from"./chunk.UZWWDAGM.js";import"./chunk.TI4OSTQV.js";import"./chunk.6T2Q6NLO.js";import"./chunk.EYZ7MHBZ.js";import{d as Je,e as Qe,f as Q,p as Ze}from"./chunk.KQT7WAQE.js";import"./chunk.PAVR5TK5.js";import"./chunk.OQDETV4X.js";import"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import"./chunk.WAFDCOOG.js";import{b as We,g as Xe,l as aa,r as ra,z as ta}from"./chunk.L4DECHXR.js";import{$ as se,A as Ke,G as O,J as qe,R as h,W as Ge,Y as _e,Z as $,a as Y,ga as Ue,j as ve,k as ie,n as V,o as ne,p as we,pa as Ye,qa as F,s as oe,ta as Ve,xa as je,y as Fe,ya as le,z as de}from"./chunk.GFF2FB2J.js";import{$ as te,Jb as Oe,M as Be,Z as De,bc as L,dc as P}from"./chunk.6V2RG5JG.js";import{b as p}from"./chunk.AJZBJBMO.js";function Ha(e){return`
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 ye,b as ke,c as Se,d as ya,e as ka,h as $e,i as ze,j as Ee,k as Sa}from"./chunk.67TPUXAY.js";import{g as ha,h as xa}from"./chunk.BNV77BQZ.js";import"./chunk.TAQ764IQ.js";import{b as va,c as wa,d as be,e as ua}from"./chunk.YIR7PPF3.js";import"./chunk.EBGAYL32.js";import{p as pa,q as ga,r as ca}from"./chunk.DAZ2VSRD.js";import{a as fa}from"./chunk.HJCQ6I3S.js";import"./chunk.MWGGV7DE.js";import{b as ma}from"./chunk.JQU5GEU3.js";import"./chunk.HAIG6NVX.js";import"./chunk.UZGRRDHD.js";import"./chunk.XANVHJQ4.js";import{b as oa}from"./chunk.JDUJDAGA.js";import{b as me,d as he,e as xe}from"./chunk.LR3VDXPI.js";import"./chunk.COQKECUH.js";import{b as fe}from"./chunk.EJPI3ST6.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.UT6642FC.js";import{e as ba}from"./chunk.AR3DCDHU.js";import"./chunk.TI4OSTQV.js";import"./chunk.G5NZVPJU.js";import"./chunk.GZHZLJBF.js";import{c as ta,d as ia,e as Z,o as na}from"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import{H as la,b as Qe,e as ea,f as aa,j as Oa,m as ra,r as da,y as sa}from"./chunk.JOOQUWLT.js";import{A as Ue,F as O,Q as f,V as je,X as Ye,Y as S,_ as le,a as Q,fa as Ve,j as we,k as ne,n as j,o as oe,oa as Xe,p as ue,pa as K,s as de,sa as Je,wa as Ze,xa as pe,y as _e,z as se}from"./chunk.6QWV5MVH.js";import{Kb as Ge,N as qe,_ as Fe,aa as ie,cc as H,ec as D}from"./chunk.MNP4JI33.js";import{b as p}from"./chunk.AJZBJBMO.js";function Ka(e){return`
2
2
 
3
3
 
4
4
  .graview-altitude-control {
@@ -45,7 +45,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
45
45
  transform: translateY(-4px) scale(1.05);
46
46
  box-shadow: var(--graview-lift-high);
47
47
  position: relative;
48
- z-index: ${L.lines};
48
+ z-index: ${H.lines};
49
49
  }
50
50
 
51
51
 
@@ -59,7 +59,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
59
59
  left: 50%;
60
60
  top: 42px;
61
61
  transform: translateX(-50%);
62
- z-index: ${L.lines};
62
+ z-index: ${H.lines};
63
63
  display: grid;
64
64
  justify-items: center;
65
65
  gap: 4px;
@@ -71,8 +71,8 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
71
71
 
72
72
  .graview-drive-in-marquee {
73
73
  display: grid;
74
- gap: ${Qe}px;
75
- width: ${Je}px;
74
+ gap: ${ia}px;
75
+ width: ${ta}px;
76
76
  justify-items: stretch;
77
77
  }
78
78
  .graview-drive-in-thumb {
@@ -80,7 +80,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
80
80
  display: grid;
81
81
  align-content: center;
82
82
  box-sizing: border-box;
83
- min-height: max(${Q/16}rem, ${Q}px);
83
+ min-height: max(${Z/16}rem, ${Z}px);
84
84
  padding: 3px 6px 3px 10px;
85
85
  border-left: 2px solid var(--graview-edge-bright, var(--graview-edge));
86
86
  color: var(--graview-ink);
@@ -95,7 +95,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
95
95
  .graview-drive-in-thumb-press {
96
96
  position: absolute;
97
97
  inset: 0;
98
- min-height: max(${Q/16}rem, ${Q}px);
98
+ min-height: max(${Z/16}rem, ${Z}px);
99
99
  margin: 0;
100
100
  padding: 0;
101
101
  border: none;
@@ -128,7 +128,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
128
128
  position: absolute;
129
129
  inset: 0;
130
130
  pointer-events: none;
131
- z-index: ${L.occupants};
131
+ z-index: ${H.occupants};
132
132
  }
133
133
  .graview-figure {
134
134
  position: absolute;
@@ -184,16 +184,18 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
184
184
  pointer-events: none;
185
185
  }
186
186
 
187
+
187
188
  .graview-figure[data-graview-person] .graview-figure-body {
188
- left: -11px;
189
+ left: -12px;
189
190
  top: -24px;
190
- width: 22px;
191
+ width: 24px;
191
192
  height: 24px;
192
193
  min-height: 0;
193
194
  }
194
195
  .graview-figure[data-graview-person] .graview-figure-body svg {
195
196
  width: 22px;
196
197
  height: 24px;
198
+ margin: 0 auto;
197
199
  }
198
200
  .graview-figure[data-graview-person][data-graview-followed] .graview-figure-body {
199
201
  color: var(--graview-accent);
@@ -277,7 +279,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
277
279
  transition: opacity 160ms ease;
278
280
  }
279
281
  .graview-kind-card[data-graview-emphasis="lit"] {
280
- z-index: ${L.stage};
282
+ z-index: ${H.stage};
281
283
  }
282
284
  .graview-kind-card[data-graview-emphasis="lit"] .graview-kind-face {
283
285
  border-color: var(--graview-accent) !important;
@@ -364,7 +366,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
364
366
  position: absolute;
365
367
  inset: 0;
366
368
  pointer-events: none;
367
- z-index: ${L.seatMarks};
369
+ z-index: ${H.seatMarks};
368
370
  }
369
371
  .graview-seat-mark {
370
372
  position: absolute;
@@ -464,7 +466,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
464
466
  }
465
467
  .graview-ribbon-said,
466
468
  .graview-record-link-said {
467
- z-index: ${L.tieLabels};
469
+ z-index: ${H.tieLabels};
468
470
  box-sizing: border-box;
469
471
  white-space: nowrap;
470
472
  font-size: 0.8125rem;
@@ -618,7 +620,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
618
620
  position: absolute;
619
621
  top: -9px;
620
622
  right: 14px;
621
- z-index: ${L.tag};
623
+ z-index: ${H.tag};
622
624
  display: var(--graview-kit-tags, inline-flex);
623
625
  align-items: center;
624
626
  gap: 5px;
@@ -754,7 +756,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
754
756
  left: 0;
755
757
  bottom: calc(100% + 6px);
756
758
 
757
- z-index: ${P("popover")};
759
+ z-index: ${D("popover")};
758
760
  margin: 0;
759
761
  padding: 6px;
760
762
  list-style: none;
@@ -826,7 +828,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
826
828
  border-radius: 5px !important;
827
829
  background: var(--graview-panel) !important;
828
830
  box-shadow: 0 1px 2px rgba(0, 0, 0, ${e==="light"?"0.08":"0.3"}) !important;
829
- z-index: ${L.tag};
831
+ z-index: ${H.tag};
830
832
  }
831
833
  [data-graview-altitude] [data-graview-plot] .graview-kind-face {
832
834
  top: calc(var(--graview-front-y) + 4px) !important;
@@ -923,9 +925,11 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
923
925
  opacity: 1;
924
926
  pointer-events: auto;
925
927
  }
928
+
926
929
  [data-graview-altitude] [data-graview-plot]:hover,
927
- [data-graview-altitude] [data-graview-plot]:focus-within {
928
- z-index: ${L.opened} !important;
930
+ [data-graview-altitude] [data-graview-plot]:focus-within,
931
+ [data-graview-altitude] [data-graview-plot]:has(.graview-drive-in[data-graview-showing]) {
932
+ z-index: ${H.opened} !important;
929
933
  }
930
934
 
931
935
  [data-graview-altitude] [data-graview-landmark]:not([data-graview-plot] *) .graview-kind-face {
@@ -935,7 +939,8 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
935
939
 
936
940
  [data-graview-altitude] .graview-drive-in {
937
941
 
938
- top: calc(var(--graview-front-y, 42px) + var(--graview-plate-h, 26px));
942
+
943
+ top: calc(var(--graview-front-y, 42px) + 4px + var(--graview-plate-h, 28px));
939
944
  padding: 4px 6px;
940
945
  border-radius: 5px;
941
946
  background: var(--graview-panel);
@@ -965,7 +970,8 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
965
970
  @container (max-width: 639px) {
966
971
  .graview-zoom,
967
972
  .graview-edge-sign {
968
- --graview-scene-foot: calc(var(--graview-sheet, 0px) + var(--graview-foot-room, 0px));
973
+
974
+ --graview-scene-foot: max(var(--graview-sheet, 0px), var(--graview-foot-room, 0px));
969
975
  }
970
976
  }
971
977
  .graview-zoom {
@@ -974,7 +980,7 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
974
980
  right: calc(16px + var(--graview-dock, 0px));
975
981
  bottom: calc(16px + var(--graview-scene-foot, var(--graview-sheet, 0px)));
976
982
 
977
- z-index: ${L.zoom};
983
+ z-index: ${H.zoom};
978
984
  display: inline-flex;
979
985
  align-items: center;
980
986
  gap: 2px;
@@ -1037,7 +1043,27 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
1037
1043
  outline: none;
1038
1044
  }
1039
1045
  [data-graview-stage="dom"] [data-graview-view] > :not([data-graview-natural]),
1040
- [data-graview-stage="dom"] [data-graview-view] > [data-graview-natural] > * {
1046
+ [data-graview-stage="dom"] [data-graview-view] > [data-graview-natural] > *,
1047
+ [data-graview-stage="gpu"][data-graview-hit="platform"] > [data-graview-view] > :not([data-graview-natural]),
1048
+ [data-graview-stage="gpu"][data-graview-hit="platform"] > [data-graview-view] > [data-graview-natural] > * {
1049
+ pointer-events: auto;
1050
+ }
1051
+
1052
+ [data-graview-altitude] [data-graview-view][data-graview-plot] > .graview-kind-card {
1053
+ pointer-events: none;
1054
+ }
1055
+ [data-graview-altitude] [data-graview-plot] > .graview-kind-card > .graview-kind-face:not([data-graview-nameplate="none"]),
1056
+ [data-graview-altitude] [data-graview-plot] > .graview-kind-card > .graview-drive-in {
1057
+ pointer-events: auto;
1058
+ }
1059
+ [data-graview-altitude] [data-graview-plot] > .graview-kind-card::before {
1060
+ content: "";
1061
+ position: absolute;
1062
+ left: 0;
1063
+ top: 0;
1064
+ width: 100%;
1065
+ height: calc(2 * var(--graview-center-y, 50%));
1066
+ clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
1041
1067
  pointer-events: auto;
1042
1068
  }
1043
1069
 
@@ -1097,5 +1123,5 @@ import{a as he,b as xe,c as be,d as ua,e as ma,g as ye,h as fa}from"./chunk.R26D
1097
1123
  }
1098
1124
  [data-graview-connector][data-graview-activity] {
1099
1125
  animation: graview-relation 1200ms cubic-bezier(0.22, 1, 0.36, 1);
1100
- }`}function ke(e="dark",n={}){let s=Ha(e);return n.scope===void 0?s:We(s,n.scope)}var H=p(O(),1);var K=p(h(),1),Pa=le(Y(()=>import("./chunk.L6OMEYL6.js"))).part(e=>(0,K.jsx)(e.MapKey,{}),{quiet:!0});function Se(){let{store:e}=$(),{view:n}=F(),s=se(),o=(0,H.useMemo)(()=>e.graph.allEdges().length>0,[e,s]),[r,g]=(0,H.useState)(!1),m=(0,H.useId)(),w=(0,H.useRef)(null),M=(0,H.useRef)(null);return(0,H.useEffect)(()=>{if(!r)return;let c=B=>{let A=B.target;A&&(M.current?.contains(A)||w.current?.contains(A))||g(!1)};return document.addEventListener("pointerdown",c,!0),()=>document.removeEventListener("pointerdown",c,!0)},[r]),o?(0,K.jsxs)("div",{style:{display:"contents"},onKeyDown:c=>{c.key!=="Escape"||!r||(c.preventDefault(),c.stopPropagation(),g(!1),w.current?.focus({preventScroll:!0}))},children:[(0,K.jsx)("button",{ref:w,type:"button","data-testid":"lines-key","aria-expanded":r,"aria-controls":m,title:"What the lines mean",onClick:()=>g(c=>!c),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:r?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Key"}),r?(0,K.jsxs)("div",{ref:M,id:m,"data-testid":"lines-key-pane","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("rail"),width:ma,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[n.overview?(0,K.jsx)(Pa,{}):null,(0,K.jsx)(ua,{inside:!0,widthOf:ga})]}):null]}):null}var ha=p(O(),1),pe=p(h(),1);function xa(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Na=le(Y(()=>import("./chunk.MD74YVRN.js"))),Ba=Na.part((e,n)=>(0,pe.jsx)(e.MapPanelFor,{showing:n.showing}),{what:"This panel",quiet:!0});function $e(){let{store:e,view:n,selection:s,hiddenKinds:o}=$();if(se(),!n.overview)return null;let r=xa(pa(s,{...n,beside:!0},g=>e.graph.getNode(g)?.kind));return!r||r.what!=="record"&&(o.has(r.kind)||!e.schema.kinds.includes(r.kind))?null:(0,pe.jsx)(ha.Suspense,{fallback:null,children:(0,pe.jsx)(Ba,{showing:r})})}var Da=p(O(),1);var N=p(h(),1);function ze(){let{view:e,go:n}=F(),{store:s,views:o,hiddenKinds:r}=$(),g=e.overview??!1,m=o.places().map(u=>u.kind).filter(u=>!r.has(u)),w=ta(e,s.schema.kinds,m),M=()=>{n(ie(V(e,!1),w))},c=(()=>{if(!w)return null;let u=Fe(w)[0],S=e.within?.view,D=(S?o.places().find(f=>f.as===S):void 0)??(u?o.places().filter(f=>f.kind===u).at(-1):void 0);return D?D.title:u?te(s.schema,u):s.graph.getNode(w)?.label??null})(),B=g?"Close the map":"Up",A=g&&c?`Close the map, down to ${c}`:B;return(0,N.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":g,"aria-label":A,title:g?A:"Up \u2014 the whole thing, from above",onClick:()=>g?M():n(V(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":g?1:0,...g?{color:"var(--graview-accent)"}:{}},children:[(0,N.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,N.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,N.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,N.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,N.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,N.jsx)("span",{className:"graview-altitude-label",children:B})]})}var Ce=p(h(),1);function Ee(){let{administered:e}=$(),{view:n,go:s}=F(),o=e.filter(r=>r.canShow);return o.length===0?null:(0,Ce.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:o.map(r=>(0,Ce.jsx)("button",{type:"button","aria-pressed":r.shown,"data-testid":`show-${r.name}`,title:r.shown?`Hide the ${r.name}'s own districts again`:r.description??`Show the ${r.name}'s own districts beside the domain`,onClick:()=>s(da(n,r.name,!r.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:r.shown?"var(--graview-accent)":"var(--graview-edge)",color:r.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:r.shown?"var(--graview-panel)":"transparent"},children:r.shown?`Hide the ${r.name}`:`Show the ${r.name}`},r.name))})}var x=p(O(),1);var l=p(h(),1);Ge({search:na,touchWeights:ia});var Oa=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Sa({compact:e=!1}){let{store:n,view:s,setView:o,principal:r,setMenuAt:g,brand:m,seatTalk:w}=$(),M=qe(w),c=_e(),B=Ye(),A=Ze().marks.flag,u=(0,x.useRef)(null),S=(0,x.useId)(),[D,f]=(0,x.useState)(!1),[z,Z]=(0,x.useState)(null),[q,ee]=(0,x.useState)(null),E=s.q??"";(0,x.useEffect)(()=>{let a=t=>{if(t.defaultPrevented)return;let i=t.key.toLowerCase()==="k"&&(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey,v=t.key==="/"&&!t.metaKey&&!t.ctrlKey&&!t.altKey;if(!i&&!v)return;let d=u.current;if(!d)return;let _=d.closest("[data-graview-embed]"),R=t.target,J=R===document.body||R===document.documentElement||R===window;if(_&&!(i&&J||R instanceof Node&&_.contains(R)))return;let U=document.activeElement,Ia=U instanceof HTMLInputElement||U instanceof HTMLTextAreaElement||U instanceof HTMLSelectElement||U instanceof HTMLElement&&U.isContentEditable;v&&Ia||(t.preventDefault(),d.getClientRects().length===0&&d.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),d.focus({preventScroll:!0}),d.select(),f(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Le=(0,x.useMemo)(()=>q&&E.trim()?oa(n,q,c?.words??E,{principal:r,limit:4}):[],[n,E,c,q,r]),ge=(0,x.useMemo)(()=>{let a=new Map;for(let[t,i]of(c?.hits??[]).entries()){if(i.about==="act")continue;let v=Oa(i),d=a.get(v)??[];if(d.push({id:`${S}-${t}`,hit:i}),a.set(v,d),i.about==="node"&&i.id===q)for(let[_,R]of Le.entries())d.push({id:`${S}-${t}-act-${_}`,hit:R})}return[...a.entries()]},[c,Le,q,S]),I=M.drawn>0&&E.trim()?{id:`${S}-ask`,ask:E.trim()}:null,y=(0,x.useMemo)(()=>[...ge.flatMap(([,a])=>a),...I?[I]:[]],[ge,I?.ask]),T=y.find(a=>a.id===z)??y[0],He=(c?.hits??[]).filter(a=>a.about==="node").length;(0,x.useEffect)(()=>{Z(null),ee(null)},[E]);let ae=(0,x.useRef)(null);(0,x.useEffect)(()=>{let a=ae.current;if(!a)return;ae.current=null;let t=0,i=()=>{let v=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),d=document.activeElement;if(!(!d||d===document.body||d===document.documentElement||d===u.current||d===v))return;let R=v?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if(R)return R.focus({preventScroll:!0});v&&v.tabIndex>=0&&d!==v&&t>30&&v.focus({preventScroll:!0}),++t<240&&requestAnimationFrame(i)};requestAnimationFrame(i)},[s]);let G=a=>{if(a){if(Z(a.id),"ask"in a){ee(null);return}a.hit.about==="node"?ee(a.hit.id):a.hit.about!=="act"&&ee(null)}},Pe=a=>{let t=document.getElementById(S),i=t?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,v=t?.clientHeight??0;return Math.min(a,i>0&&v>0?Math.max(1,Math.floor(v/i)-1):qa)};(0,x.useEffect)(()=>{z&&document.getElementById(z)?.scrollIntoView?.({block:"nearest"})},[z]);let ce=a=>{if(!a)return;if("ask"in a){w.ask(a.ask),o(i=>fe(i)),f(!1);return}let t=a.hit;switch(t.about){case"node":o(i=>ne(ie(V(i,!1),t.id),[t.id]));break;case"kind":o(i=>de(V(i,!1),oe(t.kind),{ownPicture:!0})),ae.current=t.kind;break;case"place":o(i=>Ke(i,t.kind,t.as)),ae.current=t.kind;break;case"rule":{let i=B.filter(v=>v.invariant===t.name).flatMap(v=>v.nodeIds);o(v=>ne(v,[...new Set(i)]));break}case"act":{o(v=>ne(v,[t.subject]));let i=u.current?.getBoundingClientRect();g({x:i?.left??0,y:(i?.bottom??0)+6,on:t.subject});break}}f(!1),u.current?.blur()},Aa=c?Wa(c.byKind,c.hits,n.schema):"",re=D&&E.trim().length>0,Ra=(0,x.useCallback)(()=>{let a=u.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-_a};let t=u.current?.getBoundingClientRect();return t?{x:t.right,y:t.bottom}:null},[]),Ne=je("find",{open:re,onOpenChange:a=>{a||f(!1)},...e?{at:Ra}:{}});return(0,l.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,l.jsx)("input",{ref:a=>{u.current=a,Ne.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":re,"aria-controls":S,"aria-autocomplete":"list",...re&&T?{"aria-activedescendant":T.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:E,onChange:a=>{let t=a.target.value;f(!0),o(i=>sa(i,t.length>0?t:null))},onFocus:()=>f(!0),onBlur:()=>f(!1),onKeyDown:a=>{let t=z!==null&&T?y.indexOf(T):-1,i=d=>d!==void 0&&!("ask"in d)&&d.hit.about==="act",v=t>=0&&T!==void 0&&!("ask"in T)&&T.hit.about==="node";if(a.key==="ArrowDown"){a.preventDefault(),f(!0);let d=t+1;if(v)for(;d<y.length-1&&i(y[d]);)d+=1;G(y[Math.min(y.length-1,d)])}else if(a.key==="ArrowUp")a.preventDefault(),G(y[Math.max(0,t-1)]);else if((a.key==="PageDown"||a.key==="PageUp")&&y.length>0){a.preventDefault(),f(!0);let d=y.flatMap((J,U)=>i(J)?[]:[U]),_=Math.max(0,d.findIndex(J=>J>=Math.max(t,0))),R=a.key==="PageDown"?Pe(y.length):-Pe(y.length);G(y[d[Math.min(d.length-1,Math.max(0,(t<0?-1:_)+R))]])}else if(a.key==="ArrowRight"&&v&&i(y[t+1]))a.preventDefault(),G(y[t+1]);else if(a.key==="ArrowLeft"&&i(T)){a.preventDefault();let d=t-1;for(;d>0&&i(y[d]);)d-=1;G(y[d])}else a.key==="Enter"?(a.preventDefault(),ce(T)):a.key==="Escape"&&(a.preventDefault(),E?o(d=>fe(d)):u.current?.blur())},style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${E?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,l.jsx)("span",{role:"status","aria-live":"polite",style:Xe,"data-testid":"find-count",children:E.trim()?Aa:""}),(0,l.jsxs)("div",{...Ne.pane,id:S,role:"listbox","aria-label":E?`What \u201C${E}\u201D finds`:"What the words find","data-testid":"find-strip",hidden:!re,onMouseDown:a=>a.preventDefault(),style:e?{...ya,...Ua}:ya,children:[y.every(a=>"ask"in a)?(0,l.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",c?.words||E,"\u201D."]}):ge.map(([a,t])=>(0,l.jsxs)("div",{role:"group","aria-label":ba(a,n.schema),children:[(0,l.jsxs)("div",{role:"presentation",style:Ya,children:[a!=="rule:"?(0,l.jsx)(Ka,{kind:a,accents:m?.accents}):null,ba(a,n.schema)]}),t.map(i=>(0,l.jsx)("div",{id:i.id,role:"option","aria-selected":i===T,"data-testid":"find-hit","data-about":i.hit.about,...i.hit.about==="node"&&i.hit.near?{"data-near":""}:{},onMouseEnter:()=>G(i),onClick:()=>ce(i),style:{...ka,...i.hit.about==="act"?{paddingLeft:30}:{},background:i===T?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsx)(Fa,{hit:i.hit,flag:A})},i.id))]},a)),I?(0,l.jsx)("div",{id:I.id,role:"option","aria-selected":I===T||T?.id===I.id,"data-testid":"find-ask",onMouseEnter:()=>G(I),onClick:()=>ce(I),style:{...ka,borderTop:"1px solid var(--graview-edge)",marginTop:4,background:T?.id===I.id?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsxs)("span",{children:["Ask: ",(0,l.jsxs)("span",{style:{fontWeight:600},children:["\u2018",I.ask,"\u2019"]})]})}):null,He>Ga?(0,l.jsxs)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 2px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},"data-testid":"find-more-words",children:[Be(He)," found: another word of the name narrows them."]}):null,c&&c.searched.past===!1&&c.searched.kinds.some(a=>n.schema.tryDefinition(a)?.lifecycle)?(0,l.jsx)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 8px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"Current ones; add is:any for the past."}):null]})]})}function Fa({hit:e,flag:n}){switch(e.about){case"node":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{style:{fontWeight:600,overflowWrap:"anywhere"},children:[e.flagged?(0,l.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[n," "]}):null,e.label,e.apart?(0,l.jsxs)("span",{style:j,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,l.jsx)("span",{style:j,children:" \xB7 past"})]}),e.near?(0,l.jsxs)("span",{style:j,"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: ${e.why.fragment}`:""]}):e.why.field!=="label"?(0,l.jsxs)("span",{style:j,children:[e.why.reading.toLowerCase(),": ",e.why.fragment]}):null]});case"kind":return(0,l.jsxs)("span",{children:[e.label,(0,l.jsxs)("span",{style:j,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,l.jsxs)("span",{children:["Go to ",e.title]});case"rule":return(0,l.jsxs)("span",{children:["The rule \u201C",e.label,"\u201D"]});case"act":return(0,l.jsxs)("span",{style:e.destructive?{color:"var(--graview-warn)"}:void 0,children:[e.title,(0,l.jsxs)("span",{style:j,children:[" \xB7 ",e.why.field==="title"?"act":`on ${e.why.fragment}`]})]})}}function Ka({kind:e,accents:n}){let s=Math.round(Oe(e,n));return(0,l.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${s} 55% 52%)`}})}function ba(e,n){return e==="rule:"?"Rules":e==="act:"?"Acts":n.tryDefinition(e)?.plural??`${e}s`}function Wa(e,n,s){let o=Object.entries(e).map(([m,w])=>De(s,m,w)),r=n.filter(m=>m.about==="kind"||m.about==="place"||m.about==="rule").length;r>0&&o.push(`${r} ${r===1?"place or rule":"places and rules"}`);let g=n.filter(m=>m.about==="node"&&m.near).length;return o.length===0?"Nothing found":`${o.join(", ")} found${g>0?`, ${g} of them near`:""}`}var qa=10,Ga=12,ya={...Ve,width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(60vh, 28rem)",overflowY:"auto",boxSizing:"border-box",background:"var(--graview-panel)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:"4px 0"},_a=6,Ua={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},Ya={display:"flex",alignItems:"center",gap:6,padding:"8px 12px 2px",fontSize:"0.6875rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},ka={display:"grid",gap:1,minHeight:32,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)"},j={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400};var X=p(O(),1);var Te=p(La(),1);var za=p(h(),1);function $a(){let{following:e,follow:n}=$();return e?(0,za.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>n(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var Ca=p(O(),1);var b=p(h(),1);function Ea({home:e,homeLabel:n,children:s,onPicture:o=!1}){let{view:r,focus:g,show:m,go:w}=F(),{store:M}=$(),{movedByHand:c}=$(),B=c&&(r.pan!==void 0||Object.keys(r.pins).length>0),A=r.focusId&&r.focusId!==e?M.graph.getNode(r.focusId):void 0,u=z=>te(M.schema,z),S={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},D=n!==void 0&&A!==void 0,f=[];if(A&&!o&&f.push({key:"focused",node:(0,b.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>w(we({...r,focusId:e},!1)),title:me(M,A.id),style:{...S,maxWidth:"min(14rem, 15vw)"},children:[(0,b.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:me(M,A.id)}),(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),r.past&&f.push({key:"past",node:(0,b.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>w(la(r,!1)),title:"Back to now \u2014 retired things leave the picture again",style:S,children:["the past",(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),r.zoom&&f.push({key:"zoomed",node:(0,b.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>w(we(r,!1)),title:"Zoom back out",style:S,children:["zoomed in",(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),B&&f.push({key:"moved",node:(0,b.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>w(ve(r)),title:"Put the camera and everything you dragged back where the layout wanted them",style:S,children:"Reset view"})}),r.relation){let z=r.relation;f.push({key:"raised",node:(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,b.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>w(de(r,oe(z),{ownPicture:!0})),title:`Go into the ${u(z).toLowerCase()}`,"aria-label":`Go into the ${u(z).toLowerCase()}`,style:{...S,color:"var(--graview-ink)"},children:[u(z),(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,b.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>m(null),title:`Stop showing ${u(z).toLowerCase()}`,"aria-label":`Stop showing ${u(z).toLowerCase()}`,style:{...S,minWidth:26,justifyContent:"center"},children:(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return o&&!D&&f.length===0&&s===void 0?null:(0,b.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...o?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[D?(0,b.jsx)("button",{type:"button",onClick:()=>g(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:n}):null,f.map(({key:z,node:Z},q)=>(0,b.jsxs)(Ca.Fragment,{children:[D||q>0?(0,b.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,Z]},z)),s]})}var C=p(h(),1);function Me(){let[e,n]=(0,X.useState)([]),s=(0,X.useCallback)(o=>{n(r=>{let g=o.phase!=="running"&&r[0]?.name===o.name&&r[0]?.at===o.at;return[o,...g?r.slice(1):r].slice(0,12)})},[]);return[e,s]}function Ae({find:e,calls:n,seat:s,remembers:o=!1}){return e?(0,C.jsxs)(C.Fragment,{children:[(0,Te.createPortal)((0,C.jsx)(Sa,{compact:e.compact}),e.slot),e.own?(0,Te.createPortal)((0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(X.Suspense,{fallback:null,children:(0,C.jsx)(fa,{})}),(0,C.jsx)(ea,{calls:n,remembers:o,...s!==void 0?{seat:s}:{}})]}),e.own):null]}):null}function Re({home:e=null}){return(0,C.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:P("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,C.jsx)(Ea,{home:e,onPicture:!0}),(0,C.jsx)("span",{style:{pointerEvents:"auto"},children:(0,C.jsx)($a,{})})]})}var W=p(O(),1);var Ta=p(h(),1),Va=Y(()=>import("./chunk.BPWNWE7N.js"));function Ie(){let{store:e,principal:n}=$(),s=(0,W.useContext)(ra),o=(0,W.useRef)(null),r=(0,W.useRef)(!1);return(0,W.useEffect)(()=>()=>void(r.current=!0),[]),(0,W.useEffect)(()=>{let g=e.batches().length,m=Va().then(w=>w.sceneWay(e,n,s,g,o.current),()=>{});return()=>void m.then(w=>w?.(r.current))},[e,n,s]),(0,Ta.jsx)("span",{ref:o,hidden:!0})}var Ma=p(O(),1);var k=p(h(),1);function vt({address:e=!1,auto:n,seat:s,scheme:o,scope:r}){let g=(0,Ma.useMemo)(()=>`${ye({scope:`.${r}`})}
1101
- ${ke(o,{scope:`.${r}`})}`,[o,r]),m=aa(),[w,M]=Me();return(0,k.jsx)(Ue.Provider,{value:!0,children:(0,k.jsxs)("div",{"data-embed-content":"",style:{position:"relative",flex:n?`0 0 ${wa}px`:"1 1 auto",minHeight:0,containerType:"size"},children:[(0,k.jsx)("style",{children:g}),e?(0,k.jsx)(va,{}):null,(0,k.jsx)(ca,{renderer:"dom"}),(0,k.jsx)(Re,{}),(0,k.jsx)(ze,{}),(0,k.jsx)(Se,{}),(0,k.jsx)(be,{}),(0,k.jsx)(xe,{...s?{start:s}:{},onCall:M}),(0,k.jsx)($e,{}),(0,k.jsx)(he,{placement:"menu"}),(0,k.jsx)(Ae,{find:m,calls:w}),(0,k.jsx)(Ie,{}),(0,k.jsx)(ue,{face:"scene"})]})})}function wt(){return(0,k.jsx)(Ee,{})}export{vt as SceneFace,wt as SceneKeeping};
1126
+ }`}function Ce(e="dark",n={}){let s=Ka(e);return n.scope===void 0?s:Qe(s,n.scope)}var P=p(O(),1);var W=p(f(),1),Wa=pe(Q(()=>(__graviewPreload(import.meta.url,["./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.QYZNAUIR.js")))).part(e=>(0,W.jsx)(e.MapKey,{}),{quiet:!0});function Ae(){let{store:e}=S(),{view:n}=K(),s=le(),o=(0,P.useMemo)(()=>e.graph.allEdges().length>0,[e,s]),[r,g]=(0,P.useState)(!1),u=(0,P.useId)(),v=(0,P.useRef)(null),T=(0,P.useRef)(null);return(0,P.useEffect)(()=>{if(!r)return;let z=x=>{let I=x.target;I&&(T.current?.contains(I)||v.current?.contains(I))||g(!1)};return document.addEventListener("pointerdown",z,!0),()=>document.removeEventListener("pointerdown",z,!0)},[r]),o?(0,W.jsxs)("div",{style:{display:"contents"},onKeyDown:z=>{z.key!=="Escape"||!r||(z.preventDefault(),z.stopPropagation(),g(!1),v.current?.focus({preventScroll:!0}))},children:[(0,W.jsx)("button",{ref:v,type:"button","data-testid":"lines-key","aria-expanded":r,"aria-controls":u,title:"What the lines mean",onClick:()=>g(z=>!z),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:D("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:r?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Key"}),r?(0,W.jsxs)("div",{ref:T,id:u,"data-testid":"lines-key-pane","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:D("rail"),width:ka,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[n.overview?(0,W.jsx)(Wa,{}):null,(0,W.jsx)(ya,{inside:!0,widthOf:fa})]}):null]}):null}var $a=p(O(),1),ge=p(f(),1);function za(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var qa=pe(Q(()=>(__graviewPreload(import.meta.url,["./chunk.BNV77BQZ.js","./chunk.RIJUCHP4.js","./chunk.YIR7PPF3.js","./chunk.3HXN4BOY.js","./chunk.GYICGZMG.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.HJCQ6I3S.js","./chunk.MWGGV7DE.js","./chunk.JQU5GEU3.js","./chunk.HAIG6NVX.js","./chunk.UZGRRDHD.js","./chunk.XANVHJQ4.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.UT6642FC.js","./chunk.G5NZVPJU.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.XNJEFUF7.js")))),Fa=qa.part((e,n)=>(0,ge.jsx)(e.MapPanelFor,{showing:n.showing}),{what:"This panel",quiet:!0});function Me(){let{store:e,view:n,selection:s,hiddenKinds:o}=S();if(le(),!n.overview)return null;let r=za(ma(s,{...n,beside:!0},g=>e.graph.getNode(g)?.kind));return!r||r.what!=="record"&&(o.has(r.kind)||!e.schema.kinds.includes(r.kind))?null:(0,ge.jsx)($a.Suspense,{fallback:null,children:(0,ge.jsx)(Fa,{showing:r})})}var Ga=p(O(),1);var B=p(f(),1);function Te(){let{view:e,go:n}=K(),{store:s,views:o,hiddenKinds:r}=S(),g=e.overview??!1,u=o.places().map($=>$.kind).filter($=>!r.has($)),v=la(e,s.schema.kinds,u),T=()=>{n(ne(j(e,!1),v))},z=(()=>{if(!v)return null;let $=_e(v)[0],y=e.within?.view,C=(y?o.places().find(R=>R.as===y):void 0)??($?o.places().filter(R=>R.kind===$).at(-1):void 0);return C?C.title:$?ie(s.schema,$):s.graph.getNode(v)?.label??null})(),x=g?"Close the map":"Up",I=g&&z?`Close the map, down to ${z}`:x;return(0,B.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":g,"aria-label":I,title:g?I:"Up \u2014 the whole thing, from above",onClick:()=>g?T():n(j(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:D("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":g?1:0,...g?{color:"var(--graview-accent)"}:{}},children:[(0,B.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,B.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,B.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,B.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,B.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,B.jsx)("span",{className:"graview-altitude-label",children:x})]})}var Ie=p(f(),1);function Re(){let{administered:e}=S(),{view:n,go:s}=K(),o=e.filter(r=>r.canShow);return o.length===0?null:(0,Ie.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:o.map(r=>(0,Ie.jsx)("button",{type:"button","aria-pressed":r.shown,"data-testid":`show-${r.name}`,title:r.shown?`Hide the ${r.name}'s own districts again`:r.description??`Show the ${r.name}'s own districts beside the domain`,onClick:()=>s(va(n,r.name,!r.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:r.shown?"var(--graview-accent)":"var(--graview-edge)",color:r.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:r.shown?"var(--graview-panel)":"transparent"},children:r.shown?`Hide the ${r.name}`:`Show the ${r.name}`},r.name))})}var h=p(O(),1);var l=p(f(),1);je({search:ga,touchWeights:pa});var _a=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Ma({compact:e=!1}){let{store:n,view:s,setView:o,principal:r,setMenuAt:g,brand:u,aiDesk:v,selection:T}=S(),z=aa(v),x=Ye(),I=Xe(),$=na().marks.flag,y=(0,h.useRef)(null),C=(0,h.useId)(),[R,m]=(0,h.useState)(!1),[F,ee]=(0,h.useState)(null),[X,ae]=(0,h.useState)(null),A=s.q??"";(0,h.useEffect)(()=>{let a=t=>{if(t.defaultPrevented)return;let i=t.key.toLowerCase()==="k"&&(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey,c=t.key==="/"&&!t.metaKey&&!t.ctrlKey&&!t.altKey;if(!i&&!c)return;let d=y.current;if(!d)return;let _=d.closest("[data-graview-embed]"),L=t.target,J=L===document.body||L===document.documentElement||L===window;if(_&&!(i&&J||L instanceof Node&&_.contains(L)))return;let U=document.activeElement,Ba=U instanceof HTMLInputElement||U instanceof HTMLTextAreaElement||U instanceof HTMLSelectElement||U instanceof HTMLElement&&U.isContentEditable;c&&Ba||(t.preventDefault(),d.getClientRects().length===0&&d.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),d.focus({preventScroll:!0}),d.select(),m(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Be=(0,h.useMemo)(()=>X&&A.trim()?ca(n,X,x?.words??A,{principal:r,limit:4}):[],[n,A,x,X,r]),ce=(0,h.useMemo)(()=>{let a=new Map;for(let[t,i]of(x?.hits??[]).entries()){if(i.about==="act")continue;let c=_a(i),d=a.get(c)??[];if(d.push({id:`${C}-${t}`,hit:i}),a.set(c,d),i.about==="node"&&i.id===X)for(let[_,L]of Be.entries())d.push({id:`${C}-${t}-act-${_}`,hit:L})}return[...a.entries()]},[x,Be,X,C]),N=z&&A.trim()?{id:`${C}-ask`,ask:A.trim()}:null,k=(0,h.useMemo)(()=>[...ce.flatMap(([,a])=>a),...N?[N]:[]],[ce,N?.ask]),M=k.find(a=>a.id===F)??k[0],Oe=(x?.hits??[]).filter(a=>a.about==="node").length;(0,h.useEffect)(()=>{ee(null),ae(null)},[A]);let re=(0,h.useRef)(null);(0,h.useEffect)(()=>{let a=re.current;if(!a)return;re.current=null;let t=0,i=()=>{let c=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),d=document.activeElement;if(!(!d||d===document.body||d===document.documentElement||d===y.current||d===c))return;let L=c?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if(L)return L.focus({preventScroll:!0});c&&c.tabIndex>=0&&d!==c&&t>30&&c.focus({preventScroll:!0}),++t<240&&requestAnimationFrame(i)};requestAnimationFrame(i)},[s]);let G=a=>{if(a){if(ee(a.id),"ask"in a){ae(null);return}a.hit.about==="node"?ae(a.hit.id):a.hit.about!=="act"&&ae(null)}},Ke=a=>{let t=document.getElementById(C),i=t?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,c=t?.clientHeight??0;return Math.min(a,i>0&&c>0?Math.max(1,Math.floor(c/i)-1):Ya)};(0,h.useEffect)(()=>{F&&document.getElementById(F)?.scrollIntoView?.({block:"nearest"})},[F]);let ve=a=>{if(!a)return;if("ask"in a){ea(v,{pointed:{...T[0]!==void 0?{on:T[0]}:{},about:T},asked:a.ask}),o(i=>be(i)),m(!1);return}let t=a.hit;switch(t.about){case"node":o(i=>oe(ne(j(i,!1),t.id),[t.id]));break;case"kind":o(i=>se(j(i,!1),de(t.kind),{ownPicture:!0})),re.current=t.kind;break;case"place":o(i=>Ue(i,t.kind,t.as)),re.current=t.kind;break;case"rule":{let i=I.filter(c=>c.invariant===t.name).flatMap(c=>c.nodeIds);o(c=>oe(c,[...new Set(i)]));break}case"act":{o(c=>oe(c,[t.subject]));let i=y.current?.getBoundingClientRect();g({x:i?.left??0,y:(i?.bottom??0)+6,on:t.subject});break}}m(!1),y.current?.blur()},Pa=x?ja(x.byKind,x.hits,n.schema):"",te=R&&A.trim().length>0,Da=(0,h.useCallback)(()=>{let a=y.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Xa};let t=y.current?.getBoundingClientRect();return t?{x:t.right,y:t.bottom}:null},[]),We=Ze("find",{open:te,onOpenChange:a=>{a||m(!1)},...e?{at:Da}:{}});return(0,l.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,l.jsx)("input",{ref:a=>{y.current=a,We.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":te,"aria-controls":C,"aria-autocomplete":"list",...te&&M?{"aria-activedescendant":M.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:A,onChange:a=>{let t=a.target.value;m(!0),o(i=>wa(i,t.length>0?t:null))},onFocus:()=>m(!0),onBlur:()=>m(!1),onKeyDown:a=>{let t=F!==null&&M?k.indexOf(M):-1,i=d=>d!==void 0&&!("ask"in d)&&d.hit.about==="act",c=t>=0&&M!==void 0&&!("ask"in M)&&M.hit.about==="node";if(a.key==="ArrowDown"){a.preventDefault(),m(!0);let d=t+1;if(c)for(;d<k.length-1&&i(k[d]);)d+=1;G(k[Math.min(k.length-1,d)])}else if(a.key==="ArrowUp")a.preventDefault(),G(k[Math.max(0,t-1)]);else if((a.key==="PageDown"||a.key==="PageUp")&&k.length>0){a.preventDefault(),m(!0);let d=k.flatMap((J,U)=>i(J)?[]:[U]),_=Math.max(0,d.findIndex(J=>J>=Math.max(t,0))),L=a.key==="PageDown"?Ke(k.length):-Ke(k.length);G(k[d[Math.min(d.length-1,Math.max(0,(t<0?-1:_)+L))]])}else if(a.key==="ArrowRight"&&c&&i(k[t+1]))a.preventDefault(),G(k[t+1]);else if(a.key==="ArrowLeft"&&i(M)){a.preventDefault();let d=t-1;for(;d>0&&i(k[d]);)d-=1;G(k[d])}else a.key==="Enter"?(a.preventDefault(),ve(M)):a.key==="Escape"&&(a.preventDefault(),A?o(d=>be(d)):y.current?.blur())},style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${A?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,l.jsx)("span",{role:"status","aria-live":"polite",style:ra,"data-testid":"find-count",children:A.trim()?Pa:""}),(0,l.jsxs)("div",{...We.pane,id:C,role:"listbox","aria-label":A?`What \u201C${A}\u201D finds`:"What the words find","data-testid":"find-strip",hidden:!te,onMouseDown:a=>a.preventDefault(),style:e?{...Ca,...Ja}:Ca,children:[k.every(a=>"ask"in a)?(0,l.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",x?.words||A,"\u201D."]}):ce.map(([a,t])=>(0,l.jsxs)("div",{role:"group","aria-label":Ea(a,n.schema),children:[(0,l.jsxs)("div",{role:"presentation",style:Za,children:[a!=="rule:"?(0,l.jsx)(Qa,{kind:a,accents:u?.accents}):null,Ea(a,n.schema)]}),t.map(i=>(0,l.jsx)("div",{id:i.id,role:"option","aria-selected":i===M,"data-testid":"find-hit","data-about":i.hit.about,...i.hit.about==="node"&&i.hit.near?{"data-near":""}:{},onMouseEnter:()=>G(i),onClick:()=>ve(i),style:{...Aa,...i.hit.about==="act"?{paddingLeft:30}:{},background:i===M?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsx)(Ua,{hit:i.hit,flag:$})},i.id))]},a)),N?(0,l.jsx)("div",{id:N.id,role:"option","aria-selected":N===M||M?.id===N.id,"data-testid":"find-ask",onMouseEnter:()=>G(N),onClick:()=>ve(N),style:{...Aa,borderTop:"1px solid var(--graview-edge)",marginTop:4,background:M?.id===N.id?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsxs)("span",{children:["Ask: ",(0,l.jsxs)("span",{style:{fontWeight:600},children:["\u2018",N.ask,"\u2019"]})]})}):null,Oe>Va?(0,l.jsxs)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 2px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},"data-testid":"find-more-words",children:[qe(Oe)," found: another word of the name narrows them."]}):null,x&&x.searched.past===!1&&x.searched.kinds.some(a=>n.schema.tryDefinition(a)?.lifecycle)?(0,l.jsx)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 8px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"Current ones; add is:any for the past."}):null]})]})}function Ua({hit:e,flag:n}){switch(e.about){case"node":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("span",{style:{fontWeight:600,overflowWrap:"anywhere"},children:[e.flagged?(0,l.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[n," "]}):null,e.label,e.apart?(0,l.jsxs)("span",{style:Y,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,l.jsx)("span",{style:Y,children:" \xB7 past"})]}),e.near?(0,l.jsxs)("span",{style:Y,"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: ${e.why.fragment}`:""]}):e.why.field!=="label"?(0,l.jsxs)("span",{style:Y,children:[e.why.reading.toLowerCase(),": ",e.why.fragment]}):null]});case"kind":return(0,l.jsxs)("span",{children:[e.label,(0,l.jsxs)("span",{style:Y,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,l.jsxs)("span",{children:["Go to ",e.title]});case"rule":return(0,l.jsxs)("span",{children:["The rule \u201C",e.label,"\u201D"]});case"act":return(0,l.jsxs)("span",{style:e.destructive?{color:"var(--graview-warn)"}:void 0,children:[e.title,(0,l.jsxs)("span",{style:Y,children:[" \xB7 ",e.why.field==="title"?"act":`on ${e.why.fragment}`]})]})}}function Qa({kind:e,accents:n}){let s=Math.round(Ge(e,n));return(0,l.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${s} 55% 52%)`}})}function Ea(e,n){return e==="rule:"?"Rules":e==="act:"?"Acts":n.tryDefinition(e)?.plural??`${e}s`}function ja(e,n,s){let o=Object.entries(e).map(([u,v])=>Fe(s,u,v)),r=n.filter(u=>u.about==="kind"||u.about==="place"||u.about==="rule").length;r>0&&o.push(`${r} ${r===1?"place or rule":"places and rules"}`);let g=n.filter(u=>u.about==="node"&&u.near).length;return o.length===0?"Nothing found":`${o.join(", ")} found${g>0?`, ${g} of them near`:""}`}var Ya=10,Va=12,Ca={...Je,width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(60vh, 28rem)",overflowY:"auto",boxSizing:"border-box",background:"var(--graview-panel)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:"4px 0"},Xa=6,Ja={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},Za={display:"flex",alignItems:"center",gap:6,padding:"8px 12px 2px",fontSize:"0.6875rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Aa={display:"grid",gap:1,minHeight:32,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)"},Y={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400};var V=p(O(),1);var Le=p(Oa(),1);var Ia=p(f(),1);function Ta(){let{following:e,follow:n}=S();return e?(0,Ia.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>n(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var Ra=p(O(),1);var b=p(f(),1);function La({home:e,homeLabel:n,children:s,onPicture:o=!1}){let{view:r,focus:g,show:u,go:v}=K(),{store:T}=S(),{movedByHand:z}=S(),x=z&&(r.pan!==void 0||Object.keys(r.pins).length>0),I=r.focusId&&r.focusId!==e?T.graph.getNode(r.focusId):void 0,$=m=>ie(T.schema,m),y={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},C=n!==void 0&&I!==void 0,R=[];if(I&&!o&&R.push({key:"focused",node:(0,b.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>v(ue({...r,focusId:e},!1)),title:fe(T,I.id),style:{...y,maxWidth:"min(14rem, 15vw)"},children:[(0,b.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:fe(T,I.id)}),(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),r.past&&R.push({key:"past",node:(0,b.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>v(ua(r,!1)),title:"Back to now \u2014 retired things leave the picture again",style:y,children:["the past",(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),r.zoom&&R.push({key:"zoomed",node:(0,b.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>v(ue(r,!1)),title:"Zoom back out",style:y,children:["zoomed in",(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),x&&R.push({key:"moved",node:(0,b.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>v(we(r)),title:"Put the camera and everything you dragged back where the layout wanted them",style:y,children:"Reset view"})}),r.relation){let m=r.relation;R.push({key:"raised",node:(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,b.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>v(se(r,de(m),{ownPicture:!0})),title:`Go into the ${$(m).toLowerCase()}`,"aria-label":`Go into the ${$(m).toLowerCase()}`,style:{...y,color:"var(--graview-ink)"},children:[$(m),(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,b.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>u(null),title:`Stop showing ${$(m).toLowerCase()}`,"aria-label":`Stop showing ${$(m).toLowerCase()}`,style:{...y,minWidth:26,justifyContent:"center"},children:(0,b.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return o&&!C&&R.length===0&&s===void 0?null:(0,b.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...o?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[C?(0,b.jsx)("button",{type:"button",onClick:()=>g(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:n}):null,R.map(({key:m,node:F},ee)=>(0,b.jsxs)(Ra.Fragment,{children:[C||ee>0?(0,b.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,F]},m)),s]})}var E=p(f(),1);function Ne(){let[e,n]=(0,V.useState)([]),s=(0,V.useCallback)(o=>{n(r=>{let g=o.phase!=="running"&&r[0]?.name===o.name&&r[0]?.at===o.at;return[o,...g?r.slice(1):r].slice(0,12)})},[]);return[e,s]}function He({find:e,calls:n,seat:s,remembers:o=!1}){return e?(0,E.jsxs)(E.Fragment,{children:[(0,Le.createPortal)((0,E.jsx)(Ma,{compact:e.compact}),e.slot),e.own?(0,Le.createPortal)((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(V.Suspense,{fallback:null,children:(0,E.jsx)(Sa,{})}),(0,E.jsx)(oa,{calls:n,remembers:o,...s!==void 0?{seat:s}:{}})]}),e.own):null]}):null}function Pe({home:e=null}){return(0,E.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:D("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,E.jsx)(La,{home:e,onPicture:!0}),(0,E.jsx)("span",{style:{pointerEvents:"auto"},children:(0,E.jsx)(Ta,{})})]})}var q=p(O(),1);var Na=p(f(),1),er=Q(()=>(__graviewPreload(import.meta.url,["./chunk.UGFDSE37.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.VG3O4LWB.js")));function De(){let{store:e,principal:n}=S(),s=(0,q.useContext)(sa),o=(0,q.useRef)(null),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>()=>void(r.current=!0),[]),(0,q.useEffect)(()=>{let g=e.batches().length,u=er().then(v=>v.sceneWay(e,n,s,g,o.current),()=>{});return()=>void u.then(v=>v?.(r.current))},[e,n,s]),(0,Na.jsx)("span",{ref:o,hidden:!0})}var Ha=p(O(),1);var w=p(f(),1);function At({address:e=!1,auto:n,quickAsk:s=!0,scheme:o,scope:r}){let g=(0,Ha.useMemo)(()=>`${Ee({scope:`.${r}`})}
1127
+ ${Ce(o,{scope:`.${r}`})}`,[o,r]),u=da(),[v]=Ne();return(0,w.jsx)(Ve.Provider,{value:!0,children:(0,w.jsxs)("div",{"data-embed-content":"",style:{position:"relative",flex:n?`0 0 ${ba}px`:"1 1 auto",minHeight:0,containerType:"size"},children:[(0,w.jsx)("style",{children:g}),e?(0,w.jsx)(xa,{}):null,(0,w.jsx)(ha,{}),(0,w.jsx)(Pe,{}),(0,w.jsx)(Te,{}),(0,w.jsx)(Ae,{}),(0,w.jsx)(ke,{}),(0,w.jsx)(Se,{face:"scene",on:s}),(0,w.jsx)(Me,{}),(0,w.jsx)(he,{children:(0,w.jsx)($e,{children:(0,w.jsx)(ye,{placement:"menu"})})}),(0,w.jsx)(xe,{}),(0,w.jsx)(ze,{}),(0,w.jsx)(He,{find:u,calls:v}),(0,w.jsx)(De,{}),(0,w.jsx)(me,{face:"scene"})]})})}function Mt(){return(0,w.jsx)(Re,{})}export{At as SceneFace,Mt as SceneKeeping};
@@ -1,3 +1,3 @@
1
- import{b as ee}from"./chunk.4SJUTBDV.js";import"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import{c as Z}from"./chunk.WAFDCOOG.js";import{G as ce,R as X}from"./chunk.GFF2FB2J.js";import{W as J,Z as U,bc as j}from"./chunk.6V2RG5JG.js";import{b as _}from"./chunk.AJZBJBMO.js";var B=_(ce(),1);var ue=6;function ne(v,b,h,f,L){let t=new Set(v),o=new Map;for(let r of b)for(let[u,a,S]of[[r.from,r.to,"out"],[r.to,r.from,"in"]]){if(!t.has(u)||t.has(a))continue;let p=h(a);if(p===void 0)continue;let m=`${u}|${r.kind}|${S}|${p}`,k=o.get(m);k?k.others.includes(a)||k.others.push(a):o.set(m,{self:u,edge:r.kind,direction:S,kind:p,others:[a]})}let d=[];for(let r of o.values()){let u=h(r.self)??"",a=Z(L,r.direction==="out"?u:r.kind,r.edge,r.direction),S=r.others.filter(f),p=r.others.filter(m=>!f(m));if(r.others.length>ue){d.push({...r,others:r.others,lands:"district",words:a});continue}for(let m of S)d.push({...r,others:[m],lands:"record",words:a});p.length>0&&d.push({...r,others:p,lands:"district",words:a})}return d}function te(v,b=[]){let h=[...b],f=new Map,L=t=>h.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...v].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&L(o);d++)o.y+=t.height+2;h.push(o),f.set(t.key,{x:o.x,y:o.y})}return f}var s=_(X(),1),ge=4;function we({frame:v,width:b,height:h,stageRef:f,tick:L,store:t,graphVersion:o,selection:d,view:r,rulers:{visibleRect:u,clipQuadratic:a,unsureOf:S,unsureDash:p,unsureOpacity:m}}){let k=n=>t.graph.getNode(n)?.kind,C=ee(d,r,k),$=C.lens===null&&C.records.length<=ge?C.records:[],re=$.join(`
1
+ import{b as ee}from"./chunk.JQU5GEU3.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import{c as Z}from"./chunk.UGFJKSHU.js";import{F as ce,Q as X}from"./chunk.6QWV5MVH.js";import{X as J,_ as U,cc as j}from"./chunk.MNP4JI33.js";import{b as _}from"./chunk.AJZBJBMO.js";var B=_(ce(),1);var ue=6;function ne(v,b,h,f,L){let t=new Set(v),o=new Map;for(let r of b)for(let[u,a,S]of[[r.from,r.to,"out"],[r.to,r.from,"in"]]){if(!t.has(u)||t.has(a))continue;let p=h(a);if(p===void 0)continue;let m=`${u}|${r.kind}|${S}|${p}`,k=o.get(m);k?k.others.includes(a)||k.others.push(a):o.set(m,{self:u,edge:r.kind,direction:S,kind:p,others:[a]})}let d=[];for(let r of o.values()){let u=h(r.self)??"",a=Z(L,r.direction==="out"?u:r.kind,r.edge,r.direction),S=r.others.filter(f),p=r.others.filter(m=>!f(m));if(r.others.length>ue){d.push({...r,others:r.others,lands:"district",words:a});continue}for(let m of S)d.push({...r,others:[m],lands:"record",words:a});p.length>0&&d.push({...r,others:p,lands:"district",words:a})}return d}function te(v,b=[]){let h=[...b],f=new Map,L=t=>h.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...v].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&L(o);d++)o.y+=t.height+2;h.push(o),f.set(t.key,{x:o.x,y:o.y})}return f}var s=_(X(),1),ge=4;function we({frame:v,width:b,height:h,stageRef:f,tick:L,store:t,graphVersion:o,selection:d,view:r,rulers:{visibleRect:u,clipQuadratic:a,unsureOf:S,unsureDash:p,unsureOpacity:m}}){let k=n=>t.graph.getNode(n)?.kind,C=ee(d,r,k),$=C.lens===null&&C.records.length<=ge?C.records:[],re=$.join(`
2
2
  `),[c,q]=(0,B.useState)(null);(0,B.useLayoutEffect)(()=>{let n=f.current;if(!r.overview||$.length===0||!n||typeof document>"u"||v.t<1){q(null);return}let g=n.getBoundingClientRect(),R=e=>({x:e.left-g.left,y:e.top-g.top,width:e.width,height:e.height}),N=new Map,oe=$.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),D=e=>{if(N.has(e))return N.get(e);let i=null;for(let y of n.querySelectorAll(`[data-graview-pick="${CSS.escape(e)}"], [data-graview-view="${CSS.escape(e)}"]`))if(!y.closest("[data-graview-offstage], [data-graview-screen]")&&!(!$.includes(e)&&y.closest(oe))&&(i=u(y,n),i))break;if(!i){let y=n.querySelector(`[data-graview-building="${CSS.escape(e)}"]`);y&&(i=R(y.getBoundingClientRect()))}return N.set(e,i),i},T=e=>{let i=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return i?R(i.getBoundingClientRect()):null},ie=ne($,t.graph.allEdges(),k,e=>D(e)!==null,t.schema),K=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let i=u(e,n);i&&K.push(i)}let H=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),E=[],W=new Set($),A=new Set;for(let e of ie){let i=k(e.self),y=D(e.self)??(i?T(i):null),Q=e.lands==="record"?D(e.others[0]):T(e.kind);if(!y||!Q)continue;for(let l of e.others)W.add(l);A.add(e.kind),i&&A.add(i);let x=H(y),w=H(Q),O=Math.hypot(w.x-x.x,w.y-x.y);if(O<6)continue;let V=Math.min(40,O*.12)*(E.length%2===0?1:-1),de={x:(x.x+w.x)/2-(w.y-x.y)/O*V,y:(x.y+w.y)/2+(w.x-x.x)/O*V},Y=a({p0:x,c:de,p1:w},K);if(Y.length===0)continue;let ae=Y.map(l=>`M ${l.p0.x.toFixed(1)} ${l.p0.y.toFixed(1)} Q ${l.c.x.toFixed(1)} ${l.c.y.toFixed(1)} ${l.p1.x.toFixed(1)} ${l.p1.y.toFixed(1)}`).join(" "),le=l=>{let F=t.graph.getNode(l);return F?J(t.schema.tryDefinition(F.kind),F):l},G=e.lands==="record"?`${e.words}: ${le(e.others[0])}`:`${e.words}: ${U(t.schema,e.kind,e.others.length)}`,P=e.others[0],I=e.lands==="record"?S?.(e.edge,e.direction==="out"?e.self:P,e.direction==="out"?P:e.self):void 0;E.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${P}`,link:e,d:ae,end:w,said:I!==void 0?`${G} \xB7 unsure`:G,...I!==void 0?{unsure:I}:{}})}let z=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let i=u(e,n);i&&z.push(i)}let se=te(E.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),z);q({lines:E,labels:se,reached:[...W],districts:[...A]})},[re,r.overview,v,o,L,b,h,f,t]);let M=(0,B.useMemo)(()=>{if(!c)return"";let n=c.reached.map(R=>`[data-graview-building="${CSS.escape(R)}"]`).join(","),g=c.districts.map(R=>`[data-graview-plot="kind:${CSS.escape(R)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",g?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${g})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
3
3
  `)},[c]);return!c||c.lines.length===0?M?(0,s.jsx)("style",{children:M}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:M}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":c.lines.length,"aria-hidden":"true",width:b,height:h,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:j.lines},children:c.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:p,strokeOpacity:m}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:j.tieLabels},children:c.lines.map(n=>{let g=c.labels.get(n.key);return g?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:g.x,top:g.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{we as RecordLinks};
@@ -1,6 +1,6 @@
1
- import{a as k}from"./chunk.G4JJXA63.js";import{a as Q}from"./chunk.C5CYZNSJ.js";import{a as Y}from"./chunk.OAF7TUMI.js";import{a as X}from"./chunk.OZNW5W4Z.js";import{c as _}from"./chunk.HHPGWJDO.js";import{$a as z,Ec as G,Fc as H,Gc as P,Hc as J,_a as q}from"./chunk.6V2RG5JG.js";var O=e=>"failed"in e;function ue(e,n){let r=e.schema.kinds,t=e.policy?.sees;if(!t?.length||z(n))return{kinds:r};let o=q(n).roles??[],i=new Set(t.filter(s=>s.roles==="*"||o.some(a=>s.roles.includes(a))).flatMap(s=>s.kinds));return{kinds:r.filter(s=>i.has(s))}}function L(e,n){if(!n)return e;let r=new Set(n.kinds.filter(i=>e.tryDefinition(i)!==void 0));if(r.size===e.kinds.length)return e;let t=new Map,o=i=>{if(r.has(i)){if(!t.has(i)){let s=e.tryDefinition(i),a=Object.fromEntries(Object.entries(s?.edges??{}).flatMap(([l,d])=>{if(d.to==="*")return[[l,d]];let c=d.to.filter(u=>r.has(u));return c.length>0?[[l,{...d,to:c}]]:[]}));t.set(i,{...s,edges:a})}return t.get(i)}};return{...e,definitions:e.definitions.filter(i=>r.has(i.kind)),kinds:e.kinds.filter(i=>r.has(i)),tryDefinition:o,definition:i=>{let s=o(i);if(!s)throw new Error(`Unknown node kind "${i}"`);return s}}}var fe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=e=>fe(e).replace(/[-_]+/g," ").trim();function I(e){let n=[];for(let t of e.kinds){let o=e.tryDefinition(t);if(!o)continue;let i=o.display?.labels??{},s=Object.entries(o.fields?.shape??{}).filter(([d])=>d!=="id"&&d!=="kind").map(([d,c])=>{let u=X(c);return{name:d,type:u?.type,...u?.options?{options:u.options}:{},words:(i[d]??y(d)).toLowerCase()}}),a=Object.entries(o.edges??{}).map(([d,c])=>({name:d,from:t,to:c.to==="*"?e.kinds.filter(u=>u!==t):c.to,words:y(d)})),l=(o.plural??`${y(t)}s`).toLowerCase();n.push({kind:t,plural:l,noun:(o.noun??y(t)).toLowerCase(),fields:s,roles:o.fieldRoles??{},edges:a})}let r=new Map(n.map(t=>[t.kind,t]));return{schema:e,kinds:n,info:t=>r.get(t)}}var $=(e,n)=>n===void 0?void 0:e.fields.find(r=>r.name===n),R=e=>e?.type==="date"||e?.type==="datetime",N=e=>e?.type==="number"||e?.type==="integer"||e?.type==="duration",re=e=>` ${e.toLowerCase().replace(/[“”"’‘]/g,"'").replace(/[^\p{L}\p{N}' -]+/gu," ").replace(/\s+/g," ").trim()} `,E=(e,n)=>e.includes(` ${n} `),x=e=>e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("ses")?e.slice(0,-2):e.endsWith("s")?e.slice(0,-1):e;function pe(e,n){let r=[];for(let t of n.kinds){let o=new Set([t.plural,t.noun,`${t.noun}s`,y(t.kind),`${y(t.kind)}s`]),i=-1;for(let s of o){let a=e.indexOf(` ${s} `);a>=0&&(i<0||a<i)&&(i=a)}i>=0&&r.push({info:t,at:i})}return r.sort((t,o)=>t.at-o.at).map(t=>t.info)}function v(e,n,r){let t=n.trim().toLowerCase();if(t.length===0)return;let o=e.fields.filter(i=>!r||r(i));return o.find(i=>i.words===t||y(i.name)===t||i.name.toLowerCase()===t)??o.find(i=>i.words===x(t)||y(i.name)===x(t))??o.find(i=>t.split(" ").some(s=>s.length>2&&(i.words.split(" ").includes(s)||i.words.split(" ").includes(x(s)))))}function oe(e,n,r){let t=n.trim().toLowerCase();if(t.length!==0)return e.edges.find(o=>o.words===t||o.name.toLowerCase()===t)??e.edges.find(o=>o.to.some(i=>{let s=r.info(i);return s!==void 0&&(s.noun===x(t)||s.plural===t||y(i)===x(t))}))??e.edges.find(o=>t.split(" ").some(i=>i.length>2&&o.words.split(" ").includes(i)))}function U(e){return/ (?:grouped |group |split |sorted |organi[sz]ed )?by ([\p{L}\p{N}' -]+?)(?= (?:and|with|for|in|on|only|where|from|this|that|as|sorted|grouped) |\s*$)/u.exec(e)?.[1]?.trim()}var me=/\bwho\b.*\b(covers?|cover|tends?|owns?|handles?|does|works? on|looks? after|is on|is assigned|staffs?|runs?)\b|\bcoverage\b|\bmatrix\b|\bwho covers\b/,ge=/\bcalendar\b|\bmonth\b|\bagenda\b|\bschedule\b|\bdue\b|\bdeadlines?\b|\bdates?\b|\bwhen\b/,ye=/\btimeline\b|\bover time\b|\bgantt\b|\bspans?\b|\bweek\b/,he=/\bboard\b|\bkanban\b|\bcolumns?\b|\bpipeline\b|\bstages?\b|\bstatus\b/,be=/\blaid out\b|\blayout\b|\bseating\b|\bwhere (?:they|it|each) (?:sits?|lies?|stands?)\b|\bfloor\b/,we=/\bplan\b|\bmap\b|\bregions?\b/,ke=/\blist\b|\btable\b|\bgroup(?:ed)? by\b|\bsort(?:ed)? by\b|\bonly\b|\bjust the\b/;function $e(e){let n=[];return/\blist\b|\btable\b/.test(e)&&n.push("blocks"),me.test(e)&&n.push("coverage"),be.test(e)&&n.push("board"),(/\bfloor plan\b/.test(e)||we.test(e))&&n.push("plan"),ye.test(e)&&n.push("timeline"),ge.test(e)&&n.push("calendar"),he.test(e)&&n.push("columns"),ke.test(e)&&!n.includes("blocks")&&n.push("blocks"),n.length===0&&U(e)&&n.push("columns"),n}var se=e=>{let n=r=>r?` and not ${r}`:"";if(/\boverdue\b|\blate\b|\bpast due\b/.test(e))return{cond:(r,t)=>`days(today(), ${r}) < 0${n(t)}`,says:r=>`overdue by ${r.words}`};if(/\btoday\b/.test(e))return{range:"day",cond:r=>`days(today(), ${r}) == 0`,says:r=>`with ${r.words} today`};if(/\bthis week\b|\bnext 7 days\b|\bnext week\b/.test(e))return{range:"week",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 6`,says:r=>`with ${r.words} in the next week`};if(/\bthis month\b|\bnext 30 days\b|\bnext month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 30`,says:r=>`with ${r.words} in the next month`};if(/\blast month\b|\bpast month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= -30 and days(today(), ${r}) <= 0`,says:r=>`with ${r.words} in the last month`};if(/\bthis year\b/.test(e))return{range:"year",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 365`,says:r=>`with ${r.words} in the next year`};if(/\bquarter\b/.test(e))return{range:"quarter",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 91`,says:r=>`with ${r.words} in the next quarter`}},M=e=>{if(/\bagenda\b|\bin order\b/.test(e))return"agenda";if(/\btoday\b|\bday\b/.test(e))return"day";if(/\bweek\b/.test(e))return"week";if(/\bquarter\b/.test(e))return"quarter";if(/\byears\b/.test(e))return"years";if(/\byear\b/.test(e))return"year";if(/\bmonth\b/.test(e))return"month"},Z=/^(user|person|people|member|staff|gardener|volunteer|owner|agent|employee|worker|team|player|customer|client|contact|party|attendee|guest)s?$/,j=class extends Error{},h=e=>{throw new j(e)};function Se(e,n){let r=e.fields.filter(i=>i.type==="enum");if(n){let i=v(e,n);if(i&&i.type==="enum")return i;i&&h(`${e.plural}' ${i.words} is not a choice, so it has no columns`)}let t=$(e,e.roles.status??e.roles.column);if(t?.type==="enum")return t;let o=r.find(i=>/^(status|stage|state|phase)$/.test(i.name));return o||(r[0]?r[0]:h(`${e.plural} have no choice field to put in columns`))}function ee(e,n){let r=e.fields.filter(R),t=l=>{let d=$(e,e.roles[l]);return R(d)?d:void 0},i=r.find(l=>E(n,l.words)||E(n,y(l.name)))??t("start")??r.find(l=>/^(due|date|on|at|start|starts|begins|from|sown|when)/i.test(l.name))??r[0];if(!i)return h(`no date field on ${e.plural}`);let s=t("end")??r.find(l=>l!==i&&/^(end|ends|until|to|finish|finished|harvested|due|closes|through)/i.test(l.name)),a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));return{start:i,...s&&s!==i?{end:s}:{},...a?{done:a}:{}}}function ie(e){let n=$(e,e.roles.start),r=$(e,e.roles.end),t=$(e,e.roles.column??e.roles.day??e.roles.columns);if(N(n)&&N(r)&&t?.type==="enum")return{start:n,end:r,column:t}}function De(e,n,r,t){let o=[];for(let s of e.kinds)for(let a of s.edges)for(let l of a.to){let d=e.info(l);if(!d||d.kind===s.kind)continue;let c=0;n.includes(s)&&(c+=4),n.includes(d)&&(c+=4),(Z.test(d.kind)||Z.test(d.noun))&&(c+=3),t&&(a.words.includes(t)||d.noun===x(t))&&(c+=5),a.words.split(" ").some(u=>u.length>2&&r.includes(` ${u}`))&&(c+=2),o.push({rows:s,across:d,link:a,score:c})}let i=o.sort((s,a)=>a.score-s.score)[0];return i||h(n[0]?`${n[0].plural} are joined to nothing else, so there is no who-covers-what to draw`:"nothing here is joined to anything else, so there is no who-covers-what to draw")}function ae(e,n,r,t,o){let i=U(t);switch(e){case"columns":{if(i){let s=v(n,i);if(!s||s.type!=="enum"){let a=oe(n,i,r);if(a){let l=r.info(a.to[0]);return{lens:"coverage",kind:n.kind,across:l.kind,link:a.name}}}}return{lens:"columns",kind:n.kind,column:Se(n,i).name}}case"calendar":{let s=ee(n,t),a=M(t);return{lens:"calendar",kind:n.kind,start:s.start.name,...s.end?{end:s.end.name}:{},...s.done?{done:s.done.name}:{},...a?{range:a}:{}}}case"timeline":{let s=ie(n);if(s&&!/\bdates?\b|\bdue\b|\bdeadlines?\b|\bmonths?\b|\byears?\b/.test(t))return{lens:"timeline",kind:n.kind,start:s.start.name,end:s.end.name,column:s.column.name};let a=ee(n,t);return{lens:"calendar",kind:n.kind,start:a.start.name,...a.end?{end:a.end.name}:{},...a.done?{done:a.done.name}:{},range:M(t)??"quarter"}}case"coverage":{let s=De(r,o,t,i);return{lens:"coverage",kind:s.rows.kind,across:s.across.kind,link:s.link.name}}case"board":{let s=$(n,n.roles.x)??n.fields.find(c=>c.name==="x"),a=$(n,n.roles.y)??n.fields.find(c=>c.name==="y");if(!N(s)||!N(a))return h(`${n.plural} have no x and y to be laid out by`);let d=r.kinds.flatMap(c=>c.edges.filter(u=>u.to.includes(n.kind)&&c.kind!==n.kind))[0]??n.edges[0];return d?{lens:"board",kind:n.kind,x:s.name,y:a.name,fill:d.name,...d.from!==n.kind?{fillFrom:"occupant"}:{}}:h(`nothing is joined to ${n.plural} to fill them`)}case"plan":{let s=$(n,n.roles.outline)??n.fields.find(a=>a.name==="outline");return s?{lens:"plan",kind:n.kind,outline:s.name}:h(`${n.plural} have no outline to draw a plan from`)}case"blocks":{let s={lens:"blocks",kind:n.kind,as:/\bcards?\b/.test(t)?"card":"row"},a=/ group(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|sorted|with)|\s*$)/u.exec(t)?.[1]??(i&&!/ sort(?:ed)? by /.test(t)?i:void 0);if(a){let c=v(n,a);if(!c||c.type!=="enum")return h(c?`${n.plural}' ${c.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${a} to group by`);s.group=c.name}let l=/ sort(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|grouped|with)|\s*$)/u.exec(t)?.[1];if(l){let c=v(n,l);if(!c)return h(`${n.plural} have nothing called ${l} to sort by`);s.sort={by:c.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}let d=V(n,t);return d.length>0&&(s.where=d),s}}}function V(e,n){let r=[],t=se(n);if(t){let o=e.fields.filter(R),i=$(e,e.roles.start),s=o.find(l=>E(n,l.words))??(R(i)?i:void 0)??o[0];(!s||!R(s))&&h(`no date field on ${e.plural}`);let a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));r.push({expr:t.cond(s.name,/\boverdue\b|\blate\b|\bpast due\b/.test(n)?a?.name:void 0),says:t.says(s)})}if(/\bonly\b|\bjust\b|\bthat are\b|\bwhich are\b/.test(n)){for(let o of e.fields){if(o.type!=="enum")continue;let i=o.options?.find(s=>E(n,s.toLowerCase())||E(n,y(s)));i&&r.push({expr:`${o.name} == '${i.replace(/'/g,"")}'`,says:`that are ${y(i)}`})}if(/\bnot done\b|\bundone\b|\bunfinished\b|\bopen ones\b|\bstill to do\b/.test(n)){let o=e.fields.find(i=>i.type==="boolean"&&/^(done|finished|complete|completed)$/.test(i.name));o&&r.push({expr:`not ${o.name}`,says:`not ${o.words}`})}}return r}var B={columns:"A board",calendar:"A calendar",timeline:"A timeline",coverage:"A grid",board:"A layout",plan:"A plan",blocks:"A list",reach:"A picture"};function Ae(e,n){let r=n.info(e.kind),t=o=>o?$(r,o)?.words??y(o):"";switch(e.lens){case"columns":return{title:`${k(r.plural)} by ${t(e.column)}`,detail:`of ${r.plural} by ${t(e.column)}`};case"calendar":{let o=e.range??"month";if(o==="agenda")return{title:`${k(r.plural)} in date order`,detail:`of ${r.plural} in order of ${t(e.start)}`};let i=o==="years"?"year":o;return{title:`${k(r.plural)} by ${i}`,detail:`of ${r.plural} by ${t(e.start)}, a ${i} at a time`}}case"timeline":return{title:`${k(r.plural)} over the ${t(e.column)}`,detail:`of ${r.plural} from ${t(e.start)} to ${t(e.end)}, by ${t(e.column)}`};case"coverage":{let o=n.info(e.across);return{title:`${k(r.plural)} by ${o.noun}`,detail:`of which ${o.noun} covers which ${r.noun}`}}case"board":return{title:`${k(r.plural)} where they stand`,detail:`of ${r.plural} where they stand`};case"plan":return{title:`${k(r.plural)} on a plan`,detail:`of ${r.plural}`};default:{let o=[e.where?.map(i=>i.says).join(" and "),e.group?`by ${t(e.group)}`:void 0,e.sort?`in order of ${t(e.sort.by)}`:void 0].filter(i=>!!i);return{title:[k(r.plural),...o].join(" "),detail:[`of ${r.plural}`,...o].join(" ")}}}}function Re(e,n){let r={title:n,on:e.kind};switch(e.lens){case"columns":return{name:"columns",...r,bindings:{[e.kind]:{column:e.column}}};case"calendar":return{name:"calendar",...r,bindings:{[e.kind]:{start:e.start,...e.end?{end:e.end}:{},...e.done?{done:e.done}:{}}},...e.range?{options:{range:e.range}}:{}};case"timeline":return{name:"timeline",...r,bindings:{[e.kind]:{start:e.start,end:e.end,column:e.column}}};case"coverage":return{name:"coverage",...r,bindings:{rows:{kind:e.kind},columns:{kind:e.across},link:{edge:e.link}}};case"board":return{name:"board",...r,bindings:{slots:{kind:e.kind},x:{field:e.x,on:"slots"},y:{field:e.y,on:"slots"},fill:{edge:e.fill}},...e.fillFrom?{options:{fillFrom:e.fillFrom}}:{}};case"plan":return{name:"plan",...r,bindings:{regions:{kind:e.kind},outline:{field:e.outline,on:"regions"}}};default:{let t=e.where?.length?` where ${e.where.map(i=>e.where.length>1?`(${i.expr})`:i.expr).join(" and ")}`:"",o={list:`all('${e.kind}')${t}`,as:e.as??"row"};return e.group&&(o.group=e.group),e.sort&&(o.sort=e.sort.direction?{by:e.sort.by,direction:e.sort.direction}:e.sort.by),o.empty="Nothing here yet.",{name:"blocks",...r,options:{blocks:[o]}}}}}function C(e,n){let r=o=>o.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,""),t=new Set(["home","overview",...Y(n).map(o=>o.slug),...(n.lenses??[]).flatMap(o=>o.title?[r(o.title)]:[])]);if(!t.has(r(e)))return e;for(let o=2;;o++)if(!t.has(r(`${e} ${o}`)))return`${e} ${o}`}var ne={title:[],headline:[],text:["tone"],figure:["as","currency","label"],list:["sort","limit","group","empty","as"],progress:["label"],group:["direction"],when:["show"],divider:[]};function Ee(e,n){if(!Array.isArray(n)||n.length===0)return"it has no blocks to draw";if(n.length>40)return"it has more blocks than a place draws";let r=(s,a)=>{if(typeof s!="string"||s.trim()==="")return`its ${a} says nothing`;try{return _(s)}catch(l){return`its ${a} does not read: ${l instanceof Error?l.message.replace(/ \(at character.*$/,""):String(l)}`}},t=s=>{if(s.t==="where")return t(s.set);if(s.t==="call"&&s.fn==="all"){let a=s.args[0];return a?.t==="lit"&&typeof a.value=="string"?e.info(a.value)??null:void 0}},o=(s,a)=>{switch(s.t){case"lit":return;case"ident":return a&&!a.fields.some(l=>l.name===s.name)&&!a.edges.some(l=>l.name===s.name)?`${a.plural} have nothing called ${s.name}`:void 0;case"member":return o(s.object,a);case"list":return s.items.map(l=>o(l,a)).find(Boolean);case"unary":return o(s.operand,a);case"binary":return o(s.left,a)??o(s.right,a);case"where":{let l=t(s.set);return l===null?"Nothing by that name here":o(s.set,a)??o(s.filter,l??void 0)}case"call":return s.fn==="all"?t(s)===null?"Nothing by that name here":void 0:s.args.map(l=>o(l,a)).find(Boolean)}},i=(s,a)=>{if(a>4)return"its blocks nest deeper than a place draws";for(let l of s){if(!w(l))return"a block is not an object";let d=Object.keys(ne).find(p=>p in l);if(!d)return`"${Object.keys(l)[0]??""}" is not a block a place draws`;let c=Object.keys(l).find(p=>p!==d&&p!=="key"&&!ne[d].includes(p));if(c)return`a ${d} block takes no "${c}"`;let u=l[d];if(d==="list"||d==="figure"||d==="when"){if(d==="figure"&&u===!0)continue;let p=r(u,d);if(typeof p=="string")return p;let g=o(p,void 0);if(g)return g;if(d==="list"){let f=t(p);if(f==null)return f===null?"Nothing by that name here":"its list does not say which records it lists, like all('task')";for(let m of["group","sort"]){let b=l[m],S=typeof b=="string"?b:w(b)&&typeof b.by=="string"?b.by:void 0;if(b===void 0)continue;let D=S?f.fields.find(ce=>ce.name===S):void 0;if(!D)return`${f.plural} have nothing called ${String(S??b)} to ${m} by`;if(m==="group"&&D.type!=="enum")return`${f.plural}' ${D.words} is not a choice, so they cannot be grouped by it`}}if(d==="when"){let f=l.show;if(!Array.isArray(f))return"a when block shows a list of blocks";let m=i(f,a+1);if(m)return m}}else if(d==="group"){if(!Array.isArray(u))return"a group block holds a list of blocks";let p=i(u,a+1);if(p)return p}else{if(d!=="divider"&&typeof u!="string")return`a ${d} block says words`;if(typeof u=="string")for(let p of u.matchAll(/\{([^{}]*)\}/g)){let g=p[1].split(/\|(?![|])/)[0],f=r(g,`${d}'s braces`);if(typeof f=="string")return f;let m=o(f,void 0);if(m)return m}}}};return i(n,1)}function T(e,n,r){let t=L(e.schema,r),o=f=>({ok:!1,failed:`Couldn't draw that: ${f.replace(/\.$/,"")}.`});if(!P(n.name)||n.name==="reach")return o(`"${String(n.name)}" is not a picture the seat can draw; it draws ${H.filter(f=>f!=="reach").join(", ")}`);if(typeof n.title!="string"||n.title.trim().length===0||n.title.length>80)return o("it needs a title of a few words");if(typeof n.on!="string"||!t.tryDefinition(n.on))return o("Nothing by that name here");let i=G[n.name],s=n.bindings??{};if(i.binds==="fields")for(let[f,m]of Object.entries(s)){if(!t.tryDefinition(f))return o("Nothing by that name here");let b=Object.keys(t.tryDefinition(f).fields?.shape??{});for(let[S,D]of Object.entries(m??{}))if(typeof D!="string"||!b.includes(D))return o(`${y(f)} has no field "${String(D)}" for its ${S}`);for(let S of i.requiredRoles)if(!(S in(m??{})))return o(`a ${n.name} needs ${y(f)}'s ${S}`)}else if(i.binds==="entities")for(let f of i.requiredRoles){let m=s[f];if(!m)return o(`a ${n.name} needs its ${f}`);if(typeof m.kind=="string"&&!t.tryDefinition(m.kind))return o("Nothing by that name here")}let a={...e,schema:t,lenses:[...e.lenses??[],n]},l=a.lenses.length-1,d=J(a),c=`lenses.${l}`,u=d.findings.find(f=>f.path===c||f.path.startsWith(`${c}.`));if(u)return o(u.message.replace(/^"[^"]*" /,"it "));let p=d.undrawn.find(f=>f.index===l);if(p)return o(p.why);let g=d.drawn.find(f=>f.index===l);if(!g)return o("its bindings name something the app does not have");if(g.as==="overview")return o(`"${n.title}" is the scene's own address; give it another title`);if(n.name==="blocks"){let f=Ee(I(t),n.options?.blocks);if(f)return o(f)}return{ok:!0,drawn:g}}function K(e){return{op:"add-lens",title:e.title,lens:e.name,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}}}function xe(e){return{op:"remove-lens",title:e.title,on:e.on}}var w=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function de(e){let n=w(e)?e:{},r=String(n.lens??n.name??""),t=n.bindings,o=typeof n.on=="string"?n.on:w(t)&&G[r]?.binds==="fields"?Object.keys(t)[0]??"":"";return{name:r,title:typeof n.title=="string"?n.title.trim():"",on:o,...w(t)?{bindings:t}:{},...w(n.options)?{options:n.options}:{}}}function ve(e){let n=o=>w(e.bindings?.[o])?e.bindings[o]:{},r=o=>typeof o=="string"?o:void 0,t=n(e.on);switch(e.name){case"columns":return r(t.column)?{lens:"columns",kind:e.on,column:t.column}:void 0;case"calendar":{let o=r(e.options?.range);return r(t.start)?{lens:"calendar",kind:e.on,start:t.start,...r(t.end)?{end:t.end}:{},...r(t.done)?{done:t.done}:{},...o?{range:o}:{}}:void 0}case"timeline":return r(t.start)&&r(t.end)&&r(t.column)?{lens:"timeline",kind:e.on,start:t.start,end:t.end,column:t.column}:void 0;case"coverage":{let o=w(e.bindings?.columns)?r(e.bindings.columns.kind):void 0,i=w(e.bindings?.link)?r(e.bindings.link.edge):void 0;return o&&i?{lens:"coverage",kind:e.on,across:o,link:i}:void 0}case"blocks":{let o=e.options?.blocks;if(!Array.isArray(o)||o.length!==1||!w(o[0]))return;let i=o[0],s=new RegExp(`^all\\('${e.on}'\\)(?: where (.+))?$`).exec(String(i.list??""));if(!s)return;let a=i.sort;return{lens:"blocks",kind:e.on,as:i.as==="card"?"card":"row",...typeof i.group=="string"?{group:i.group}:{},...typeof a=="string"?{sort:{by:a}}:w(a)&&typeof a.by=="string"?{sort:{by:a.by,...a.direction==="desc"?{direction:"desc"}:{}}}:{},...s[1]?{where:[{expr:s[1],says:"as asked"}]}:{}}}default:return}}function W(e,n,r,t,o){let i=I(L(e.schema,t)).info(n.on),s=ve(n);return{title:n.title,said:`${B[n.name]??"A picture"} of ${i?.plural??y(n.on)}.`,kind:n.on,lens:n,drawn:r,edit:K(n),by:o,asks:[],...s?{recipe:s}:{}}}function te(e){return{title:e.title,said:e.said,lens:{title:e.lens.title,lens:e.lens.name,on:e.lens.on,...e.lens.bindings?{bindings:e.lens.bindings}:{},...e.lens.options?{options:e.lens.options}:{}},edit:e.edit,by:e.by,check:"It draws, and graview check would take it."}}function F(e,n,r,t,o){let i=Ae(e,n),s=e.title??o??C(i.title,r.app),a=Re(e,s),l=T(r.app,a,r.sight);return l.ok?{title:s,said:`${B[e.lens]} ${i.detail}.`,kind:e.kind,lens:a,drawn:l.drawn,edit:K(a),by:"template",asks:t,recipe:e}:{failed:l.failed,...r.lastGood?{lastGood:r.lastGood}:{}}}function Ye(e,n){let r=I(L(n.app.schema,n.sight)),t=r.info(e.kind);if(!t)return{failed:"Couldn't draw that: Nothing by that name here."};let o=e.lens==="blocks"&&!e.group&&!e.sort&&!e.where?.length&&e.title===void 0;return F(o?{...e,title:C(`Every ${t.noun}`,n.app)}:e,r,n,[])}function Le(e,n,r,t){if(r.length>0)return r;let o=s=>{switch(e){case"columns":return s.fields.some(a=>a.type==="enum");case"calendar":return s.fields.some(R);case"timeline":return ie(s)!==void 0||s.fields.some(R);case"coverage":return s.edges.some(a=>a.to.some(l=>l!==s.kind));case"board":return s.fields.some(a=>a.name==="x")&&s.fields.some(a=>a.name==="y");case"plan":return s.fields.some(a=>a.name==="outline")||s.roles.outline!==void 0;default:return!0}};return[...n.kinds.filter(o)].sort((s,a)=>Number(a.fields.some(l=>E(t,l.words)))-Number(s.fields.some(l=>E(t,l.words))))}function Ie(e,n){let r=I(L(n.app.schema,n.sight)),t=re(e),o=$e(t);if(o.length===0)return;let i=pe(t,r),s;for(let a of o){let l=a==="coverage"?[i[0]??r.kinds[0]].filter(d=>!!d):Le(a,r,i,t);for(let d of l)try{let c=ae(a,d,r,t,i),u=F(c,r,n,[e]);if(!O(u))return u;s??=u.failed}catch(c){if(!(c instanceof j))throw c;s??=`Couldn't draw that: ${c.message}.`}l.length===0&&i.length===0&&(s??=`Couldn't draw that: nothing here has what ${B[a].toLowerCase()} needs.`)}return{failed:s??"Couldn't draw that: Nothing by that name here.",...n.lastGood?{lastGood:n.lastGood}:{}}}async function Oe(e,n){let r=n.lastGood?{lastGood:n.lastGood}:{};if(e.trim().length===0)return{failed:"Say what you would like to see, like \u201Ca board of tasks by status\u201D.",...r};let t=Ie(e,n);if(t&&!O(t))return t;if(!n.complete)return t??{failed:"Couldn't draw that: drawing freely needs AI, which isn't on here. Ask for a board, a calendar, a timeline, a list or who covers what.",...r};let o=await le(e,n,void 0);return O(o)&&t?t:o}async function je(e,n,r){let t={lastGood:e},o={...r,lastGood:e},i=I(L(r.app.schema,r.sight)),s=re(n),a=i.info(e.kind),l=[...e.asks,n];if(!a)return{failed:"Couldn't change that: Nothing by that name here.",...t};let d=e.recipe,c=/^ (?:call|name|title) (?:it|this)? ?(.+?) $/.exec(s)??/ (?:call|name) it (.+?) $/.exec(s);try{if(c){let g=n.replace(/^.*?\b(?:call|name|title)\b\s*(?:it|this)?\s*/i,"").replace(/^["“']|["”']$/g,"").trim();if(g.length===0)return{failed:"Couldn't change that: say what to call it.",...t};let f={...e.lens,title:C(g,r.app)},m=T(r.app,f,r.sight);return m.ok?{...e,title:f.title,lens:f,drawn:m.drawn,edit:K(f),asks:l,...d?{recipe:{...d,title:f.title}}:{}}:{failed:m.failed,...t}}let p=/ as (?:a |an )?(board|kanban|calendar|timeline|list|table|cards|rows|grid|plan|layout)\b/.exec(s);if(p){let g=p[1]==="board"||p[1]==="kanban"?"columns":p[1]==="calendar"?"calendar":p[1]==="timeline"?"timeline":p[1]==="grid"?"coverage":p[1]==="plan"?"plan":p[1]==="layout"?"board":"blocks",f=ae(g,a,i,s,[a]),m=p[1]==="cards"?"card":p[1]==="rows"?"row":void 0,b=g==="blocks"&&d?.lens==="blocks"?{...d,...m?{as:m}:{}}:g==="blocks"&&d?.lens==="columns"?{...f,group:d.column,...m?{as:m}:{}}:f;return F(A(b),i,o,l)}if(d){let g=Te(d,a,i,s);if(g)return F(g,i,o,l)}}catch(p){if(!(p instanceof j))throw p;return{failed:`Couldn't change that: ${p.message}.`,...t}}if(!r.complete)return{failed:"Couldn't change that: changing it freely needs AI, which isn't on here. Try \u201Cgroup by status\u201D, \u201Conly this month\u201D or \u201Cas a calendar\u201D.",...t};let u=await le(n,o,e);return O(u)?u:{...u,asks:l}}var A=e=>{let{title:n,...r}=e;return r};function Te(e,n,r,t){let o=/ (?:group(?:ed)?|split|organi[sz]ed?|put them|columns) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1]??(/^ by /.test(t)?U(t):void 0);if(o){let d=v(n,o);if(d?.type==="enum")return e.lens==="blocks"?{...A(e),group:d.name}:{lens:"columns",kind:e.kind,column:d.name};let c=oe(n,o,r);return c?{lens:"coverage",kind:e.kind,across:c.to[0],link:c.name}:h(d?`${n.plural}' ${d.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${o} to group by`)}let i=/ (?:sort(?:ed)?|order(?:ed)?) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1];if(i){let d=v(n,i);return d?{...e.lens==="blocks"?A(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}},sort:{by:d.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}:h(`${n.plural} have nothing called ${i} to sort by`)}if(/\b(?:all of them|everything|show all|clear the filter|no filter|without the filter)\b/.test(t)){if(e.lens!=="blocks"||!e.where)return h("it already shows all of them");let{where:d,...c}=A(e);return c}let s=se(t);if(s&&e.lens==="calendar"&&s.range)return{...A(e),range:s.range};if(s&&e.lens==="calendar"&&!s.range)return{lens:"blocks",kind:e.kind,as:"row",sort:{by:e.start},where:V(n,t)};let a=V(n,t);if(a.length>0){let d=e.lens==="blocks"?A(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}};return{...d,where:[...d.where??[],...a]}}let l=e.lens==="calendar"?M(t):void 0;if(l)return{...A(e),range:l}}function Ne(e){return e.kinds.map(n=>{let r=n.fields.map(i=>`${i.name} (${i.type??"value"}${i.options?`: ${i.options.join(" | ")}`:""})`).join(", "),t=n.edges.map(i=>`${i.name} \u2192 ${i.to.join(" | ")}`).join(", "),o=Object.entries(n.roles).map(([i,s])=>`${i}=${s}`).join(", ");return`- ${n.kind} ("${n.plural}"): ${r}${t?`; relations: ${t}`:""}${o?`; roles: ${o}`:""}`}).join(`
1
+ import{a as k}from"./chunk.G4JJXA63.js";import{a as Q}from"./chunk.UZGRRDHD.js";import{a as Y}from"./chunk.OKRNJXTV.js";import{a as X}from"./chunk.PBSMLINK.js";import{c as _}from"./chunk.FWTIUYXH.js";import{$a as q,Hc as G,Ic as H,Jc as P,Kc as J,ab as z}from"./chunk.MNP4JI33.js";var O=e=>"failed"in e;function ue(e,n){let r=e.schema.kinds,t=e.policy?.sees;if(!t?.length||z(n))return{kinds:r};let o=q(n).roles??[],i=new Set(t.filter(s=>s.roles==="*"||o.some(a=>s.roles.includes(a))).flatMap(s=>s.kinds));return{kinds:r.filter(s=>i.has(s))}}function L(e,n){if(!n)return e;let r=new Set(n.kinds.filter(i=>e.tryDefinition(i)!==void 0));if(r.size===e.kinds.length)return e;let t=new Map,o=i=>{if(r.has(i)){if(!t.has(i)){let s=e.tryDefinition(i),a=Object.fromEntries(Object.entries(s?.edges??{}).flatMap(([l,d])=>{if(d.to==="*")return[[l,d]];let c=d.to.filter(u=>r.has(u));return c.length>0?[[l,{...d,to:c}]]:[]}));t.set(i,{...s,edges:a})}return t.get(i)}};return{...e,definitions:e.definitions.filter(i=>r.has(i.kind)),kinds:e.kinds.filter(i=>r.has(i)),tryDefinition:o,definition:i=>{let s=o(i);if(!s)throw new Error(`Unknown node kind "${i}"`);return s}}}var fe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=e=>fe(e).replace(/[-_]+/g," ").trim();function I(e){let n=[];for(let t of e.kinds){let o=e.tryDefinition(t);if(!o)continue;let i=o.display?.labels??{},s=Object.entries(o.fields?.shape??{}).filter(([d])=>d!=="id"&&d!=="kind").map(([d,c])=>{let u=X(c);return{name:d,type:u?.type,...u?.options?{options:u.options}:{},words:(i[d]??y(d)).toLowerCase()}}),a=Object.entries(o.edges??{}).map(([d,c])=>({name:d,from:t,to:c.to==="*"?e.kinds.filter(u=>u!==t):c.to,words:y(d)})),l=(o.plural??`${y(t)}s`).toLowerCase();n.push({kind:t,plural:l,noun:(o.noun??y(t)).toLowerCase(),fields:s,roles:o.fieldRoles??{},edges:a})}let r=new Map(n.map(t=>[t.kind,t]));return{schema:e,kinds:n,info:t=>r.get(t)}}var $=(e,n)=>n===void 0?void 0:e.fields.find(r=>r.name===n),R=e=>e?.type==="date"||e?.type==="datetime",N=e=>e?.type==="number"||e?.type==="integer"||e?.type==="duration",re=e=>` ${e.toLowerCase().replace(/[“”"’‘]/g,"'").replace(/[^\p{L}\p{N}' -]+/gu," ").replace(/\s+/g," ").trim()} `,E=(e,n)=>e.includes(` ${n} `),x=e=>e.endsWith("ies")?`${e.slice(0,-3)}y`:e.endsWith("ses")?e.slice(0,-2):e.endsWith("s")?e.slice(0,-1):e;function pe(e,n){let r=[];for(let t of n.kinds){let o=new Set([t.plural,t.noun,`${t.noun}s`,y(t.kind),`${y(t.kind)}s`]),i=-1;for(let s of o){let a=e.indexOf(` ${s} `);a>=0&&(i<0||a<i)&&(i=a)}i>=0&&r.push({info:t,at:i})}return r.sort((t,o)=>t.at-o.at).map(t=>t.info)}function v(e,n,r){let t=n.trim().toLowerCase();if(t.length===0)return;let o=e.fields.filter(i=>!r||r(i));return o.find(i=>i.words===t||y(i.name)===t||i.name.toLowerCase()===t)??o.find(i=>i.words===x(t)||y(i.name)===x(t))??o.find(i=>t.split(" ").some(s=>s.length>2&&(i.words.split(" ").includes(s)||i.words.split(" ").includes(x(s)))))}function oe(e,n,r){let t=n.trim().toLowerCase();if(t.length!==0)return e.edges.find(o=>o.words===t||o.name.toLowerCase()===t)??e.edges.find(o=>o.to.some(i=>{let s=r.info(i);return s!==void 0&&(s.noun===x(t)||s.plural===t||y(i)===x(t))}))??e.edges.find(o=>t.split(" ").some(i=>i.length>2&&o.words.split(" ").includes(i)))}function U(e){return/ (?:grouped |group |split |sorted |organi[sz]ed )?by ([\p{L}\p{N}' -]+?)(?= (?:and|with|for|in|on|only|where|from|this|that|as|sorted|grouped) |\s*$)/u.exec(e)?.[1]?.trim()}var me=/\bwho\b.*\b(covers?|cover|tends?|owns?|handles?|does|works? on|looks? after|is on|is assigned|staffs?|runs?)\b|\bcoverage\b|\bmatrix\b|\bwho covers\b/,ge=/\bcalendar\b|\bmonth\b|\bagenda\b|\bschedule\b|\bdue\b|\bdeadlines?\b|\bdates?\b|\bwhen\b/,ye=/\btimeline\b|\bover time\b|\bgantt\b|\bspans?\b|\bweek\b/,he=/\bboard\b|\bkanban\b|\bcolumns?\b|\bpipeline\b|\bstages?\b|\bstatus\b/,be=/\blaid out\b|\blayout\b|\bseating\b|\bwhere (?:they|it|each) (?:sits?|lies?|stands?)\b|\bfloor\b/,we=/\bplan\b|\bmap\b|\bregions?\b/,ke=/\blist\b|\btable\b|\bgroup(?:ed)? by\b|\bsort(?:ed)? by\b|\bonly\b|\bjust the\b/;function $e(e){let n=[];return/\blist\b|\btable\b/.test(e)&&n.push("blocks"),me.test(e)&&n.push("coverage"),be.test(e)&&n.push("board"),(/\bfloor plan\b/.test(e)||we.test(e))&&n.push("plan"),ye.test(e)&&n.push("timeline"),ge.test(e)&&n.push("calendar"),he.test(e)&&n.push("columns"),ke.test(e)&&!n.includes("blocks")&&n.push("blocks"),n.length===0&&U(e)&&n.push("columns"),n}var se=e=>{let n=r=>r?` and not ${r}`:"";if(/\boverdue\b|\blate\b|\bpast due\b/.test(e))return{cond:(r,t)=>`days(today(), ${r}) < 0${n(t)}`,says:r=>`overdue by ${r.words}`};if(/\btoday\b/.test(e))return{range:"day",cond:r=>`days(today(), ${r}) == 0`,says:r=>`with ${r.words} today`};if(/\bthis week\b|\bnext 7 days\b|\bnext week\b/.test(e))return{range:"week",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 6`,says:r=>`with ${r.words} in the next week`};if(/\bthis month\b|\bnext 30 days\b|\bnext month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 30`,says:r=>`with ${r.words} in the next month`};if(/\blast month\b|\bpast month\b/.test(e))return{range:"month",cond:r=>`days(today(), ${r}) >= -30 and days(today(), ${r}) <= 0`,says:r=>`with ${r.words} in the last month`};if(/\bthis year\b/.test(e))return{range:"year",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 365`,says:r=>`with ${r.words} in the next year`};if(/\bquarter\b/.test(e))return{range:"quarter",cond:r=>`days(today(), ${r}) >= 0 and days(today(), ${r}) <= 91`,says:r=>`with ${r.words} in the next quarter`}},M=e=>{if(/\bagenda\b|\bin order\b/.test(e))return"agenda";if(/\btoday\b|\bday\b/.test(e))return"day";if(/\bweek\b/.test(e))return"week";if(/\bquarter\b/.test(e))return"quarter";if(/\byears\b/.test(e))return"years";if(/\byear\b/.test(e))return"year";if(/\bmonth\b/.test(e))return"month"},Z=/^(user|person|people|member|staff|gardener|volunteer|owner|agent|employee|worker|team|player|customer|client|contact|party|attendee|guest)s?$/,j=class extends Error{},h=e=>{throw new j(e)};function Se(e,n){let r=e.fields.filter(i=>i.type==="enum");if(n){let i=v(e,n);if(i&&i.type==="enum")return i;i&&h(`${e.plural}' ${i.words} is not a choice, so it has no columns`)}let t=$(e,e.roles.status??e.roles.column);if(t?.type==="enum")return t;let o=r.find(i=>/^(status|stage|state|phase)$/.test(i.name));return o||(r[0]?r[0]:h(`${e.plural} have no choice field to put in columns`))}function ee(e,n){let r=e.fields.filter(R),t=l=>{let d=$(e,e.roles[l]);return R(d)?d:void 0},i=r.find(l=>E(n,l.words)||E(n,y(l.name)))??t("start")??r.find(l=>/^(due|date|on|at|start|starts|begins|from|sown|when)/i.test(l.name))??r[0];if(!i)return h(`no date field on ${e.plural}`);let s=t("end")??r.find(l=>l!==i&&/^(end|ends|until|to|finish|finished|harvested|due|closes|through)/i.test(l.name)),a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));return{start:i,...s&&s!==i?{end:s}:{},...a?{done:a}:{}}}function ie(e){let n=$(e,e.roles.start),r=$(e,e.roles.end),t=$(e,e.roles.column??e.roles.day??e.roles.columns);if(N(n)&&N(r)&&t?.type==="enum")return{start:n,end:r,column:t}}function De(e,n,r,t){let o=[];for(let s of e.kinds)for(let a of s.edges)for(let l of a.to){let d=e.info(l);if(!d||d.kind===s.kind)continue;let c=0;n.includes(s)&&(c+=4),n.includes(d)&&(c+=4),(Z.test(d.kind)||Z.test(d.noun))&&(c+=3),t&&(a.words.includes(t)||d.noun===x(t))&&(c+=5),a.words.split(" ").some(u=>u.length>2&&r.includes(` ${u}`))&&(c+=2),o.push({rows:s,across:d,link:a,score:c})}let i=o.sort((s,a)=>a.score-s.score)[0];return i||h(n[0]?`${n[0].plural} are joined to nothing else, so there is no who-covers-what to draw`:"nothing here is joined to anything else, so there is no who-covers-what to draw")}function ae(e,n,r,t,o){let i=U(t);switch(e){case"columns":{if(i){let s=v(n,i);if(!s||s.type!=="enum"){let a=oe(n,i,r);if(a){let l=r.info(a.to[0]);return{lens:"coverage",kind:n.kind,across:l.kind,link:a.name}}}}return{lens:"columns",kind:n.kind,column:Se(n,i).name}}case"calendar":{let s=ee(n,t),a=M(t);return{lens:"calendar",kind:n.kind,start:s.start.name,...s.end?{end:s.end.name}:{},...s.done?{done:s.done.name}:{},...a?{range:a}:{}}}case"timeline":{let s=ie(n);if(s&&!/\bdates?\b|\bdue\b|\bdeadlines?\b|\bmonths?\b|\byears?\b/.test(t))return{lens:"timeline",kind:n.kind,start:s.start.name,end:s.end.name,column:s.column.name};let a=ee(n,t);return{lens:"calendar",kind:n.kind,start:a.start.name,...a.end?{end:a.end.name}:{},...a.done?{done:a.done.name}:{},range:M(t)??"quarter"}}case"coverage":{let s=De(r,o,t,i);return{lens:"coverage",kind:s.rows.kind,across:s.across.kind,link:s.link.name}}case"board":{let s=$(n,n.roles.x)??n.fields.find(c=>c.name==="x"),a=$(n,n.roles.y)??n.fields.find(c=>c.name==="y");if(!N(s)||!N(a))return h(`${n.plural} have no x and y to be laid out by`);let d=r.kinds.flatMap(c=>c.edges.filter(u=>u.to.includes(n.kind)&&c.kind!==n.kind))[0]??n.edges[0];return d?{lens:"board",kind:n.kind,x:s.name,y:a.name,fill:d.name,...d.from!==n.kind?{fillFrom:"occupant"}:{}}:h(`nothing is joined to ${n.plural} to fill them`)}case"plan":{let s=$(n,n.roles.outline)??n.fields.find(a=>a.name==="outline");return s?{lens:"plan",kind:n.kind,outline:s.name}:h(`${n.plural} have no outline to draw a plan from`)}case"blocks":{let s={lens:"blocks",kind:n.kind,as:/\bcards?\b/.test(t)?"card":"row"},a=/ group(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|sorted|with)|\s*$)/u.exec(t)?.[1]??(i&&!/ sort(?:ed)? by /.test(t)?i:void 0);if(a){let c=v(n,a);if(!c||c.type!=="enum")return h(c?`${n.plural}' ${c.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${a} to group by`);s.group=c.name}let l=/ sort(?:ed)? by ([\p{L}\p{N} -]+?)(?= (?:and|only|grouped|with)|\s*$)/u.exec(t)?.[1];if(l){let c=v(n,l);if(!c)return h(`${n.plural} have nothing called ${l} to sort by`);s.sort={by:c.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}let d=V(n,t);return d.length>0&&(s.where=d),s}}}function V(e,n){let r=[],t=se(n);if(t){let o=e.fields.filter(R),i=$(e,e.roles.start),s=o.find(l=>E(n,l.words))??(R(i)?i:void 0)??o[0];(!s||!R(s))&&h(`no date field on ${e.plural}`);let a=e.fields.find(l=>l.type==="boolean"&&/^(done|finished|complete|completed|closed)$/.test(l.name));r.push({expr:t.cond(s.name,/\boverdue\b|\blate\b|\bpast due\b/.test(n)?a?.name:void 0),says:t.says(s)})}if(/\bonly\b|\bjust\b|\bthat are\b|\bwhich are\b/.test(n)){for(let o of e.fields){if(o.type!=="enum")continue;let i=o.options?.find(s=>E(n,s.toLowerCase())||E(n,y(s)));i&&r.push({expr:`${o.name} == '${i.replace(/'/g,"")}'`,says:`that are ${y(i)}`})}if(/\bnot done\b|\bundone\b|\bunfinished\b|\bopen ones\b|\bstill to do\b/.test(n)){let o=e.fields.find(i=>i.type==="boolean"&&/^(done|finished|complete|completed)$/.test(i.name));o&&r.push({expr:`not ${o.name}`,says:`not ${o.words}`})}}return r}var B={columns:"A board",calendar:"A calendar",timeline:"A timeline",coverage:"A grid",board:"A layout",plan:"A plan",blocks:"A list",reach:"A picture"};function Ae(e,n){let r=n.info(e.kind),t=o=>o?$(r,o)?.words??y(o):"";switch(e.lens){case"columns":return{title:`${k(r.plural)} by ${t(e.column)}`,detail:`of ${r.plural} by ${t(e.column)}`};case"calendar":{let o=e.range??"month";if(o==="agenda")return{title:`${k(r.plural)} in date order`,detail:`of ${r.plural} in order of ${t(e.start)}`};let i=o==="years"?"year":o;return{title:`${k(r.plural)} by ${i}`,detail:`of ${r.plural} by ${t(e.start)}, a ${i} at a time`}}case"timeline":return{title:`${k(r.plural)} over the ${t(e.column)}`,detail:`of ${r.plural} from ${t(e.start)} to ${t(e.end)}, by ${t(e.column)}`};case"coverage":{let o=n.info(e.across);return{title:`${k(r.plural)} by ${o.noun}`,detail:`of which ${o.noun} covers which ${r.noun}`}}case"board":return{title:`${k(r.plural)} where they stand`,detail:`of ${r.plural} where they stand`};case"plan":return{title:`${k(r.plural)} on a plan`,detail:`of ${r.plural}`};default:{let o=[e.where?.map(i=>i.says).join(" and "),e.group?`by ${t(e.group)}`:void 0,e.sort?`in order of ${t(e.sort.by)}`:void 0].filter(i=>!!i);return{title:[k(r.plural),...o].join(" "),detail:[`of ${r.plural}`,...o].join(" ")}}}}function Re(e,n){let r={title:n,on:e.kind};switch(e.lens){case"columns":return{name:"columns",...r,bindings:{[e.kind]:{column:e.column}}};case"calendar":return{name:"calendar",...r,bindings:{[e.kind]:{start:e.start,...e.end?{end:e.end}:{},...e.done?{done:e.done}:{}}},...e.range?{options:{range:e.range}}:{}};case"timeline":return{name:"timeline",...r,bindings:{[e.kind]:{start:e.start,end:e.end,column:e.column}}};case"coverage":return{name:"coverage",...r,bindings:{rows:{kind:e.kind},columns:{kind:e.across},link:{edge:e.link}}};case"board":return{name:"board",...r,bindings:{slots:{kind:e.kind},x:{field:e.x,on:"slots"},y:{field:e.y,on:"slots"},fill:{edge:e.fill}},...e.fillFrom?{options:{fillFrom:e.fillFrom}}:{}};case"plan":return{name:"plan",...r,bindings:{regions:{kind:e.kind},outline:{field:e.outline,on:"regions"}}};default:{let t=e.where?.length?` where ${e.where.map(i=>e.where.length>1?`(${i.expr})`:i.expr).join(" and ")}`:"",o={list:`all('${e.kind}')${t}`,as:e.as??"row"};return e.group&&(o.group=e.group),e.sort&&(o.sort=e.sort.direction?{by:e.sort.by,direction:e.sort.direction}:e.sort.by),o.empty="Nothing here yet.",{name:"blocks",...r,options:{blocks:[o]}}}}}function C(e,n){let r=o=>o.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,""),t=new Set(["home","overview",...Q(n).map(o=>o.slug),...(n.lenses??[]).flatMap(o=>o.title?[r(o.title)]:[])]);if(!t.has(r(e)))return e;for(let o=2;;o++)if(!t.has(r(`${e} ${o}`)))return`${e} ${o}`}var ne={title:[],headline:[],text:["tone"],figure:["as","currency","label"],list:["sort","limit","group","empty","as"],progress:["label"],group:["direction"],when:["show"],divider:[]};function Ee(e,n){if(!Array.isArray(n)||n.length===0)return"it has no blocks to draw";if(n.length>40)return"it has more blocks than a place draws";let r=(s,a)=>{if(typeof s!="string"||s.trim()==="")return`its ${a} says nothing`;try{return _(s)}catch(l){return`its ${a} does not read: ${l instanceof Error?l.message.replace(/ \(at character.*$/,""):String(l)}`}},t=s=>{if(s.t==="where")return t(s.set);if(s.t==="call"&&s.fn==="all"){let a=s.args[0];return a?.t==="lit"&&typeof a.value=="string"?e.info(a.value)??null:void 0}},o=(s,a)=>{switch(s.t){case"lit":return;case"ident":return a&&!a.fields.some(l=>l.name===s.name)&&!a.edges.some(l=>l.name===s.name)?`${a.plural} have nothing called ${s.name}`:void 0;case"member":return o(s.object,a);case"list":return s.items.map(l=>o(l,a)).find(Boolean);case"unary":return o(s.operand,a);case"binary":return o(s.left,a)??o(s.right,a);case"where":{let l=t(s.set);return l===null?"Nothing by that name here":o(s.set,a)??o(s.filter,l??void 0)}case"call":return s.fn==="all"?t(s)===null?"Nothing by that name here":void 0:s.args.map(l=>o(l,a)).find(Boolean)}},i=(s,a)=>{if(a>4)return"its blocks nest deeper than a place draws";for(let l of s){if(!w(l))return"a block is not an object";let d=Object.keys(ne).find(p=>p in l);if(!d)return`"${Object.keys(l)[0]??""}" is not a block a place draws`;let c=Object.keys(l).find(p=>p!==d&&p!=="key"&&!ne[d].includes(p));if(c)return`a ${d} block takes no "${c}"`;let u=l[d];if(d==="list"||d==="figure"||d==="when"){if(d==="figure"&&u===!0)continue;let p=r(u,d);if(typeof p=="string")return p;let g=o(p,void 0);if(g)return g;if(d==="list"){let f=t(p);if(f==null)return f===null?"Nothing by that name here":"its list does not say which records it lists, like all('task')";for(let m of["group","sort"]){let b=l[m],S=typeof b=="string"?b:w(b)&&typeof b.by=="string"?b.by:void 0;if(b===void 0)continue;let D=S?f.fields.find(ce=>ce.name===S):void 0;if(!D)return`${f.plural} have nothing called ${String(S??b)} to ${m} by`;if(m==="group"&&D.type!=="enum")return`${f.plural}' ${D.words} is not a choice, so they cannot be grouped by it`}}if(d==="when"){let f=l.show;if(!Array.isArray(f))return"a when block shows a list of blocks";let m=i(f,a+1);if(m)return m}}else if(d==="group"){if(!Array.isArray(u))return"a group block holds a list of blocks";let p=i(u,a+1);if(p)return p}else{if(d!=="divider"&&typeof u!="string")return`a ${d} block says words`;if(typeof u=="string")for(let p of u.matchAll(/\{([^{}]*)\}/g)){let g=p[1].split(/\|(?![|])/)[0],f=r(g,`${d}'s braces`);if(typeof f=="string")return f;let m=o(f,void 0);if(m)return m}}}};return i(n,1)}function T(e,n,r){let t=L(e.schema,r),o=f=>({ok:!1,failed:`Couldn't draw that: ${f.replace(/\.$/,"")}.`});if(!P(n.name)||n.name==="reach")return o(`"${String(n.name)}" is not a picture the seat can draw; it draws ${H.filter(f=>f!=="reach").join(", ")}`);if(typeof n.title!="string"||n.title.trim().length===0||n.title.length>80)return o("it needs a title of a few words");if(typeof n.on!="string"||!t.tryDefinition(n.on))return o("Nothing by that name here");let i=G[n.name],s=n.bindings??{};if(i.binds==="fields")for(let[f,m]of Object.entries(s)){if(!t.tryDefinition(f))return o("Nothing by that name here");let b=Object.keys(t.tryDefinition(f).fields?.shape??{});for(let[S,D]of Object.entries(m??{}))if(typeof D!="string"||!b.includes(D))return o(`${y(f)} has no field "${String(D)}" for its ${S}`);for(let S of i.requiredRoles)if(!(S in(m??{})))return o(`a ${n.name} needs ${y(f)}'s ${S}`)}else if(i.binds==="entities")for(let f of i.requiredRoles){let m=s[f];if(!m)return o(`a ${n.name} needs its ${f}`);if(typeof m.kind=="string"&&!t.tryDefinition(m.kind))return o("Nothing by that name here")}let a={...e,schema:t,lenses:[...e.lenses??[],n]},l=a.lenses.length-1,d=J(a),c=`lenses.${l}`,u=d.findings.find(f=>f.path===c||f.path.startsWith(`${c}.`));if(u)return o(u.message.replace(/^"[^"]*" /,"it "));let p=d.undrawn.find(f=>f.index===l);if(p)return o(p.why);let g=d.drawn.find(f=>f.index===l);if(!g)return o("its bindings name something the app does not have");if(g.as==="overview")return o(`"${n.title}" is the scene's own address; give it another title`);if(n.name==="blocks"){let f=Ee(I(t),n.options?.blocks);if(f)return o(f)}return{ok:!0,drawn:g}}function K(e){return{op:"add-lens",title:e.title,lens:e.name,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}}}function xe(e){return{op:"remove-lens",title:e.title,on:e.on}}var w=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function de(e){let n=w(e)?e:{},r=String(n.lens??n.name??""),t=n.bindings,o=typeof n.on=="string"?n.on:w(t)&&G[r]?.binds==="fields"?Object.keys(t)[0]??"":"";return{name:r,title:typeof n.title=="string"?n.title.trim():"",on:o,...w(t)?{bindings:t}:{},...w(n.options)?{options:n.options}:{}}}function ve(e){let n=o=>w(e.bindings?.[o])?e.bindings[o]:{},r=o=>typeof o=="string"?o:void 0,t=n(e.on);switch(e.name){case"columns":return r(t.column)?{lens:"columns",kind:e.on,column:t.column}:void 0;case"calendar":{let o=r(e.options?.range);return r(t.start)?{lens:"calendar",kind:e.on,start:t.start,...r(t.end)?{end:t.end}:{},...r(t.done)?{done:t.done}:{},...o?{range:o}:{}}:void 0}case"timeline":return r(t.start)&&r(t.end)&&r(t.column)?{lens:"timeline",kind:e.on,start:t.start,end:t.end,column:t.column}:void 0;case"coverage":{let o=w(e.bindings?.columns)?r(e.bindings.columns.kind):void 0,i=w(e.bindings?.link)?r(e.bindings.link.edge):void 0;return o&&i?{lens:"coverage",kind:e.on,across:o,link:i}:void 0}case"blocks":{let o=e.options?.blocks;if(!Array.isArray(o)||o.length!==1||!w(o[0]))return;let i=o[0],s=new RegExp(`^all\\('${e.on}'\\)(?: where (.+))?$`).exec(String(i.list??""));if(!s)return;let a=i.sort;return{lens:"blocks",kind:e.on,as:i.as==="card"?"card":"row",...typeof i.group=="string"?{group:i.group}:{},...typeof a=="string"?{sort:{by:a}}:w(a)&&typeof a.by=="string"?{sort:{by:a.by,...a.direction==="desc"?{direction:"desc"}:{}}}:{},...s[1]?{where:[{expr:s[1],says:"as asked"}]}:{}}}default:return}}function W(e,n,r,t,o){let i=I(L(e.schema,t)).info(n.on),s=ve(n);return{title:n.title,said:`${B[n.name]??"A picture"} of ${i?.plural??y(n.on)}.`,kind:n.on,lens:n,drawn:r,edit:K(n),by:o,asks:[],...s?{recipe:s}:{}}}function te(e){return{title:e.title,said:e.said,lens:{title:e.lens.title,lens:e.lens.name,on:e.lens.on,...e.lens.bindings?{bindings:e.lens.bindings}:{},...e.lens.options?{options:e.lens.options}:{}},edit:e.edit,by:e.by,check:"It draws, and graview check would take it."}}function F(e,n,r,t,o){let i=Ae(e,n),s=e.title??o??C(i.title,r.app),a=Re(e,s),l=T(r.app,a,r.sight);return l.ok?{title:s,said:`${B[e.lens]} ${i.detail}.`,kind:e.kind,lens:a,drawn:l.drawn,edit:K(a),by:"template",asks:t,recipe:e}:{failed:l.failed,...r.lastGood?{lastGood:r.lastGood}:{}}}function Ye(e,n){let r=I(L(n.app.schema,n.sight)),t=r.info(e.kind);if(!t)return{failed:"Couldn't draw that: Nothing by that name here."};let o=e.lens==="blocks"&&!e.group&&!e.sort&&!e.where?.length&&e.title===void 0;return F(o?{...e,title:C(`Every ${t.noun}`,n.app)}:e,r,n,[])}function Le(e,n,r,t){if(r.length>0)return r;let o=s=>{switch(e){case"columns":return s.fields.some(a=>a.type==="enum");case"calendar":return s.fields.some(R);case"timeline":return ie(s)!==void 0||s.fields.some(R);case"coverage":return s.edges.some(a=>a.to.some(l=>l!==s.kind));case"board":return s.fields.some(a=>a.name==="x")&&s.fields.some(a=>a.name==="y");case"plan":return s.fields.some(a=>a.name==="outline")||s.roles.outline!==void 0;default:return!0}};return[...n.kinds.filter(o)].sort((s,a)=>Number(a.fields.some(l=>E(t,l.words)))-Number(s.fields.some(l=>E(t,l.words))))}function Ie(e,n){let r=I(L(n.app.schema,n.sight)),t=re(e),o=$e(t);if(o.length===0)return;let i=pe(t,r),s;for(let a of o){let l=a==="coverage"?[i[0]??r.kinds[0]].filter(d=>!!d):Le(a,r,i,t);for(let d of l)try{let c=ae(a,d,r,t,i),u=F(c,r,n,[e]);if(!O(u))return u;s??=u.failed}catch(c){if(!(c instanceof j))throw c;s??=`Couldn't draw that: ${c.message}.`}l.length===0&&i.length===0&&(s??=`Couldn't draw that: nothing here has what ${B[a].toLowerCase()} needs.`)}return{failed:s??"Couldn't draw that: Nothing by that name here.",...n.lastGood?{lastGood:n.lastGood}:{}}}async function Oe(e,n){let r=n.lastGood?{lastGood:n.lastGood}:{};if(e.trim().length===0)return{failed:"Say what you would like to see, like \u201Ca board of tasks by status\u201D.",...r};let t=Ie(e,n);if(t&&!O(t))return t;if(!n.complete)return t??{failed:"Couldn't draw that: drawing freely needs AI, which isn't on here. Ask for a board, a calendar, a timeline, a list or who covers what.",...r};let o=await le(e,n,void 0);return O(o)&&t?t:o}async function je(e,n,r){let t={lastGood:e},o={...r,lastGood:e},i=I(L(r.app.schema,r.sight)),s=re(n),a=i.info(e.kind),l=[...e.asks,n];if(!a)return{failed:"Couldn't change that: Nothing by that name here.",...t};let d=e.recipe,c=/^ (?:call|name|title) (?:it|this)? ?(.+?) $/.exec(s)??/ (?:call|name) it (.+?) $/.exec(s);try{if(c){let g=n.replace(/^.*?\b(?:call|name|title)\b\s*(?:it|this)?\s*/i,"").replace(/^["“']|["”']$/g,"").trim();if(g.length===0)return{failed:"Couldn't change that: say what to call it.",...t};let f={...e.lens,title:C(g,r.app)},m=T(r.app,f,r.sight);return m.ok?{...e,title:f.title,lens:f,drawn:m.drawn,edit:K(f),asks:l,...d?{recipe:{...d,title:f.title}}:{}}:{failed:m.failed,...t}}let p=/ as (?:a |an )?(board|kanban|calendar|timeline|list|table|cards|rows|grid|plan|layout)\b/.exec(s);if(p){let g=p[1]==="board"||p[1]==="kanban"?"columns":p[1]==="calendar"?"calendar":p[1]==="timeline"?"timeline":p[1]==="grid"?"coverage":p[1]==="plan"?"plan":p[1]==="layout"?"board":"blocks",f=ae(g,a,i,s,[a]),m=p[1]==="cards"?"card":p[1]==="rows"?"row":void 0,b=g==="blocks"&&d?.lens==="blocks"?{...d,...m?{as:m}:{}}:g==="blocks"&&d?.lens==="columns"?{...f,group:d.column,...m?{as:m}:{}}:f;return F(A(b),i,o,l)}if(d){let g=Te(d,a,i,s);if(g)return F(g,i,o,l)}}catch(p){if(!(p instanceof j))throw p;return{failed:`Couldn't change that: ${p.message}.`,...t}}if(!r.complete)return{failed:"Couldn't change that: changing it freely needs AI, which isn't on here. Try \u201Cgroup by status\u201D, \u201Conly this month\u201D or \u201Cas a calendar\u201D.",...t};let u=await le(n,o,e);return O(u)?u:{...u,asks:l}}var A=e=>{let{title:n,...r}=e;return r};function Te(e,n,r,t){let o=/ (?:group(?:ed)?|split|organi[sz]ed?|put them|columns) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1]??(/^ by /.test(t)?U(t):void 0);if(o){let d=v(n,o);if(d?.type==="enum")return e.lens==="blocks"?{...A(e),group:d.name}:{lens:"columns",kind:e.kind,column:d.name};let c=oe(n,o,r);return c?{lens:"coverage",kind:e.kind,across:c.to[0],link:c.name}:h(d?`${n.plural}' ${d.words} is not a choice, so they cannot be grouped by it`:`${n.plural} have nothing called ${o} to group by`)}let i=/ (?:sort(?:ed)?|order(?:ed)?) by ([\p{L}\p{N} -]+?)(?= (?:and|only|with)|\s*$)/u.exec(t)?.[1];if(i){let d=v(n,i);return d?{...e.lens==="blocks"?A(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}},sort:{by:d.name,.../\b(newest|latest|desc|descending|most)\b/.test(t)?{direction:"desc"}:{}}}:h(`${n.plural} have nothing called ${i} to sort by`)}if(/\b(?:all of them|everything|show all|clear the filter|no filter|without the filter)\b/.test(t)){if(e.lens!=="blocks"||!e.where)return h("it already shows all of them");let{where:d,...c}=A(e);return c}let s=se(t);if(s&&e.lens==="calendar"&&s.range)return{...A(e),range:s.range};if(s&&e.lens==="calendar"&&!s.range)return{lens:"blocks",kind:e.kind,as:"row",sort:{by:e.start},where:V(n,t)};let a=V(n,t);if(a.length>0){let d=e.lens==="blocks"?A(e):{lens:"blocks",kind:e.kind,as:"row",...e.lens==="columns"?{group:e.column}:{}};return{...d,where:[...d.where??[],...a]}}let l=e.lens==="calendar"?M(t):void 0;if(l)return{...A(e),range:l}}function Ne(e){return e.kinds.map(n=>{let r=n.fields.map(i=>`${i.name} (${i.type??"value"}${i.options?`: ${i.options.join(" | ")}`:""})`).join(", "),t=n.edges.map(i=>`${i.name} \u2192 ${i.to.join(" | ")}`).join(", "),o=Object.entries(n.roles).map(([i,s])=>`${i}=${s}`).join(", ");return`- ${n.kind} ("${n.plural}"): ${r}${t?`; relations: ${t}`:""}${o?`; roles: ${o}`:""}`}).join(`
2
2
  `)}var Fe=['columns \u2014 a board, records in columns by one choice field: {"lens": "columns", "on": K, "bindings": {K: {"column": "<enum field>"}}}','calendar \u2014 records on a calendar by a date: {"lens": "calendar", "on": K, "bindings": {K: {"start": "<date field>", "end"?: "<date field>", "done"?: "<boolean field>"}}, "options": {"range"?: "day" | "week" | "month" | "quarter" | "year" | "agenda"}}','timeline \u2014 minutes of a day in columns: {"lens": "timeline", "on": K, "bindings": {K: {"start": "<number field>", "end": "<number field>", "column": "<enum field>"}}}','coverage \u2014 who covers what, a grid of two kinds joined by a relation: {"lens": "coverage", "on": K, "bindings": {"rows": {"kind": K}, "columns": {"kind": J}, "link": {"edge": "<relation of K to J>"}}}',`blocks \u2014 anything else, as blocks: {"lens": "blocks", "on": K, "options": {"blocks": [{"headline": "words"}, {"list": "all('K') where <condition>", "group"?: "<enum field>", "sort"?: "<field>" | {"by": "<field>", "direction": "desc"}, "as"?: "row" | "card", "empty"?: "words"}, {"figure": "count(all('K'))", "label": "words"}]}}. Conditions read a record's own fields: status == 'open', not done, days(today(), due) <= 7.`].join(`
3
3
  `);function Ce(e,n,r){return["You draw a view of an app's data as JSON \u2014 never code. The app's kinds, their fields (with types) and relations:",Ne(n),"","The lenses you may use (prefer the first four; use blocks only when none of them fits):",Fe,"",r?`The view on screen now:
4
4
  ${JSON.stringify(r.lens)}
5
5
  Change it as asked, and keep everything not asked about.`:"",`Asked: ${JSON.stringify(e)}`,'Answer with ONE JSON object: {"title": "<a few words, like Deliverables by status>", "lens": \u2026, "on": \u2026, "bindings"?: \u2026, "options"?: \u2026}. Name only the kinds, fields and relations listed above. If it cannot be drawn from them, answer {"failed": "<one sentence saying why>"}.'].filter(t=>t!=="").join(`
6
- `)}async function le(e,n,r){let t=n.lastGood?{lastGood:n.lastGood}:{},o=I(L(n.app.schema,n.sight)),i;try{i=await n.complete(Ce(e,o,r))}catch{return{failed:"Couldn't draw that: the model did not answer.",...t}}let s=Q(i);if(typeof s!="object"||s===null||Array.isArray(s))return{failed:"Couldn't draw that: the model's answer was not a view.",...t};let a=s;if(typeof a.failed=="string")return{failed:`Couldn't draw that: ${a.failed.replace(/^Couldn't draw that:\s*/i,"").replace(/\.$/,"")}.`,...t};let l=de(a);if(!P(l.name))return{failed:`Couldn't draw that: "${l.name}" is not a picture the seat can draw.`,...t};let d=l.title?l.title.slice(0,80):r?.title??k(e.trim()).slice(0,80),c={...l,title:r&&r.title===d?d:C(d,n.app)},u=T(n.app,c,n.sight);return u.ok?{...W(n.app,c,u.drawn,n.sight,"model"),asks:[e]}:{failed:u.failed,...t}}function Qe(e,n,r){let t=[...e.lenses??[]];for(let o of n){let i={name:o.lens,title:o.title,on:o.on,...o.bindings?{bindings:o.bindings}:{},...o.options?{options:o.options}:{}};if(t.some(a=>a.title===i.title))continue;T({...e,lenses:t},i,r).ok&&(t=[...t,i])}return t.length===(e.lenses??[]).length?e:{...e,lenses:t}}async function Ze(e,n,r){let{app:t,drafts:o}=r,i=ue(t,r.principal),s=c=>{let u=de(c);return{lens:u,verdict:T(t,u,i)}};if(e==="keep_lens"){let{lens:c,verdict:u}=s(n);if(!u.ok)return{ok:!1,error:u.failed,reason:"invalid"};if(!o?.keep)return{ok:!1,error:"This app's declaration cannot be written from here."};let p=K(c),g=await o.keep(p);return g.ok?{ok:!0,data:{kept:p,said:g.said??`Adds \u201C${p.title}\u201D to the places.`,undo:xe(p)}}:{ok:!1,error:g.error}}if(n.lens!==void 0){let{lens:c,verdict:u}=s(n.lens);return u.ok?{ok:!0,data:te(W(t,c,u.drawn,i,"model"))}:{ok:!1,error:u.failed,reason:"invalid"}}let a={app:t,sight:i,...o?.complete?{complete:o.complete}:{}},l=String(n.ask??""),d;if(n.current!==void 0){let{lens:c,verdict:u}=s(n.current);if(!u.ok)return{ok:!1,error:u.failed,reason:"invalid"};d=await je(W(t,c,u.drawn,i,"model"),l,a)}else d=await Oe(l,a);return O(d)?{ok:!1,error:d.failed,reason:"invalid"}:{ok:!0,data:te(d)}}export{O as a,ue as b,T as c,K as d,xe as e,de as f,ve as g,W as h,te as i,Ye as j,Ie as k,Oe as l,je as m,Qe as n,Ze as o};
6
+ `)}async function le(e,n,r){let t=n.lastGood?{lastGood:n.lastGood}:{},o=I(L(n.app.schema,n.sight)),i;try{i=await n.complete(Ce(e,o,r))}catch{return{failed:"Couldn't draw that: the model did not answer.",...t}}let s=Y(i);if(typeof s!="object"||s===null||Array.isArray(s))return{failed:"Couldn't draw that: the model's answer was not a view.",...t};let a=s;if(typeof a.failed=="string")return{failed:`Couldn't draw that: ${a.failed.replace(/^Couldn't draw that:\s*/i,"").replace(/\.$/,"")}.`,...t};let l=de(a);if(!P(l.name))return{failed:`Couldn't draw that: "${l.name}" is not a picture the seat can draw.`,...t};let d=l.title?l.title.slice(0,80):r?.title??k(e.trim()).slice(0,80),c={...l,title:r&&r.title===d?d:C(d,n.app)},u=T(n.app,c,n.sight);return u.ok?{...W(n.app,c,u.drawn,n.sight,"model"),asks:[e]}:{failed:u.failed,...t}}function Qe(e,n,r){let t=[...e.lenses??[]];for(let o of n){let i={name:o.lens,title:o.title,on:o.on,...o.bindings?{bindings:o.bindings}:{},...o.options?{options:o.options}:{}};if(t.some(a=>a.title===i.title))continue;T({...e,lenses:t},i,r).ok&&(t=[...t,i])}return t.length===(e.lenses??[]).length?e:{...e,lenses:t}}async function Ze(e,n,r){let{app:t,drafts:o}=r,i=ue(t,r.principal),s=c=>{let u=de(c);return{lens:u,verdict:T(t,u,i)}};if(e==="keep_lens"){let{lens:c,verdict:u}=s(n);if(!u.ok)return{ok:!1,error:u.failed,reason:"invalid"};if(!o?.keep)return{ok:!1,error:"This app's declaration cannot be written from here."};let p=K(c),g=await o.keep(p);return g.ok?{ok:!0,data:{kept:p,said:g.said??`Adds \u201C${p.title}\u201D to the places.`,undo:xe(p)}}:{ok:!1,error:g.error}}if(n.lens!==void 0){let{lens:c,verdict:u}=s(n.lens);return u.ok?{ok:!0,data:te(W(t,c,u.drawn,i,"model"))}:{ok:!1,error:u.failed,reason:"invalid"}}let a={app:t,sight:i,...o?.complete?{complete:o.complete}:{}},l=String(n.ask??""),d;if(n.current!==void 0){let{lens:c,verdict:u}=s(n.current);if(!u.ok)return{ok:!1,error:u.failed,reason:"invalid"};d=await je(W(t,c,u.drawn,i,"model"),l,a)}else d=await Oe(l,a);return O(d)?{ok:!1,error:d.failed,reason:"invalid"}:{ok:!0,data:te(d)}}export{O as a,ue as b,T as c,K as d,xe as e,de as f,ve as g,W as h,te as i,Ye as j,Ie as k,Oe as l,je as m,Qe as n,Ze as o};
@@ -1,3 +1,3 @@
1
- import{B as y,I as h,M as g,Y as m,sb as $,wb as x}from"./chunk.6V2RG5JG.js";function B(n,e,t){let o=n?.display?.format?.[e];return o?o(t):typeof t=="string"?m(t):String(t)}function G(n,e,t,o){let s=n.tryDefinition(e)?.edges,i=s&&Object.hasOwn(s,t)?s[t]:void 0;return(o==="out"?i?.description:i?.inverse)??m(t).toLowerCase()}var O=Symbol.for("@graview/core:markdown");function S(n){let e=y(n);return!!e&&(e[O]===1||S(e.innerType))}var w=/^ {0,3}#{1,6}(?:[ \t]+|$)/,b=/^[ \t]*(?:[-*+•]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/,k=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,R=/^ {0,3}(?:`{3,}|~{3,})/,F=/^ {0,3}(?:>[ \t]?)+/,A=/^\|?\s*:?-{2,}:?\s*(?:\|\s*:?-{2,}:?\s*)*\|?$/,_={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'",nbsp:" "};function E(n){return n.replace(/!?\[([^\]\n]{0,500})\]\([^)\n]{0,500}\)/g,"$1").replace(/<((?:https?:|mailto:)[^>\s]*)>/gi,"$1").replace(/<\/?[A-Za-z][^<>\n]*>/g,"").replace(/`+([^`\n]*)`+/g,"$1").replace(/(\*\*|__|~~)(?=\S)([^\n]{0,500}?\S)\1/g,"$2").replace(/(^|[^\w*])\*(?=\S)([^*\n]{0,500}?\S)\*(?![\w*])/g,"$1$2").replace(/(^|\W)_(?=\S)([^_\n]{0,500}?\S)_(?!\w)/g,"$1$2").replace(/\\([\\`*_{}[\]()#+\-.!>|~])/g,"$1").replace(/&(amp|lt|gt|quot|#39|nbsp);/g,(e,t)=>_[t]??"")}function N(n,e,t){let o=n.replace(/\r\n?/g,`
1
+ import{B as y,J as h,N as g,Z as m,tb as $,xb as x}from"./chunk.MNP4JI33.js";function B(n,e,t){let o=n?.display?.format?.[e];return o?o(t):typeof t=="string"?m(t):String(t)}function G(n,e,t,o){let s=n.tryDefinition(e)?.edges,i=s&&Object.hasOwn(s,t)?s[t]:void 0;return(o==="out"?i?.description:i?.inverse)??m(t).toLowerCase()}var O=Symbol.for("@graview/core:markdown");function S(n){let e=y(n);return!!e&&(e[O]===1||S(e.innerType))}var w=/^ {0,3}#{1,6}(?:[ \t]+|$)/,b=/^[ \t]*(?:[-*+•]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/,k=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,R=/^ {0,3}(?:`{3,}|~{3,})/,F=/^ {0,3}(?:>[ \t]?)+/,A=/^\|?\s*:?-{2,}:?\s*(?:\|\s*:?-{2,}:?\s*)*\|?$/,_={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'",nbsp:" "};function E(n){return n.replace(/!?\[([^\]\n]{0,500})\]\([^)\n]{0,500}\)/g,"$1").replace(/<((?:https?:|mailto:)[^>\s]*)>/gi,"$1").replace(/<\/?[A-Za-z][^<>\n]*>/g,"").replace(/`+([^`\n]*)`+/g,"$1").replace(/(\*\*|__|~~)(?=\S)([^\n]{0,500}?\S)\1/g,"$2").replace(/(^|[^\w*])\*(?=\S)([^*\n]{0,500}?\S)\*(?![\w*])/g,"$1$2").replace(/(^|\W)_(?=\S)([^_\n]{0,500}?\S)_(?!\w)/g,"$1$2").replace(/\\([\\`*_{}[\]()#+\-.!>|~])/g,"$1").replace(/&(amp|lt|gt|quot|#39|nbsp);/g,(e,t)=>_[t]??"")}function N(n,e,t){let o=n.replace(/\r\n?/g,`
2
2
  `).split(`
3
3
  `),s=[],i=[],c=0,d=!1,u=()=>{let r=i.join(" ").replace(/\s+/g," ").trim();r&&(s.push(r),c+=r.length),i=[]},a=0;for(;a<o.length&&c<=t;){let r=o[a++];if(e&&R.test(r)){d=!d,d||u();continue}if(!d&&(r.trim().length===0||e&&(k.test(r)||A.test(r.trim())))){u();continue}let f=!d&&e&&w.test(r),l=!d&&b.test(r);if((f||l)&&u(),e&&!d?(r=r.replace(F,""),f&&(r=r.replace(w,"").replace(/[ \t]+#+[ \t]*$/,"")),l&&(r=r.replace(b,"")),r.includes("|")&&(r=r.replace(/^[ \t]*\||\|[ \t]*$/g,"").split("|").map(p=>p.trim()).filter(Boolean).join(" \xB7 ")),r=E(Number.isFinite(t)?r.slice(0,t*2+200):r)):l&&(r=r.replace(b,"")),i.push(r),f&&u(),i.reduce((p,T)=>p+T.length,0)>t)break}return u(),{blocks:s,more:o.slice(a).some(r=>r.trim().length>0&&!(e&&(R.test(r)||k.test(r))))}}function M(n,e){return`${(n.slice(0,e+1).replace(/\s+\S*$/,"")||n.slice(0,e)).replace(/[\s,;:.—-]+$/,"")}\u2026`}function Z(n,e={}){let t=e.most??160,{blocks:o,more:s}=N(n,e.markdown===!0,t),i=o[0]??"";if(i.length<=t)return(s||o.length>1)&&i.length>0&&!/[.!?…:]$/.test(i)?`${i}\u2026`:i;let c=x(i);return c&&c.length<=t?c:M(i,t)}var J=n=>N(n,!0,Number.POSITIVE_INFINITY).blocks.join(" ");var j={d:1440,h:60,m:1};function ne(n){if(typeof n=="number")return Number.isFinite(n)&&n>=0?Math.round(n):void 0;if(typeof n!="string")return;let e=n.trim().toLowerCase();if(/^\d+$/.test(e))return Number(e);let t=/^(\d+):([0-5]\d)(?::([0-5]\d))?$/.exec(e);if(t)return Number(t[1])*60+Number(t[2])+Math.round(Number(t[3]??0)/60);let o=0,s=!1,i=e.replace(/(\d*[.,]?\d+) *(days?|d|hours?|hrs?|hr|h|minutes?|mins?|min|m)(?![a-z])/g,(c,d,u)=>(s=!0,o+=Number(d.replace(",","."))*j[u[0]]," "));return s&&/^[\s,+]*(?:and[\s,+]*)*$/.test(i)?Math.round(o):void 0}function I(n,e){if(!Number.isFinite(n))return String(n);let t=Math.round(Math.abs(n)),o=Math.floor(t/60),s=t%60,i=[o?`${g(o,e)} h`:"",s||!o?`${g(s,e)} min`:""].filter(Boolean).join(" ");return n<0?`\u2212${i}`:i}var D=/^(\+?1[ .-]?)?\(?([2-9]\d\d)\)?[ .-]?(\d{3})[ .-]?(\d{4})(?: *(?:ext\.?|x|#) *(\d+))?$/i;function W(n,e){let t=n.trim(),o=/[-_](US|CA)\b/i.test(h(e))?D.exec(t):null;if(!o)return t;let[,s,i,c,d,u]=o;return`${s?.startsWith("+")?"+1 ":""}(${i}) ${c}-${d}${u?` ext. ${u}`:""}`}function P(n){let[,e="",t]=/^(.*?)(?: *(?:ext\.?|x|#) *(\d+))?$/i.exec(n.trim())??[],o=e.replace(/\D/g,"");return o.length<3?void 0:`tel:${e.startsWith("+")?"+":""}${o}${t?`;ext=${t}`:""}`}var L=()=>/Mac|iPhone|iPad|iPod/.test(globalThis.navigator?.userAgent??"");function q(n,e=L()){let t=encodeURIComponent(n.trim());return e?`https://maps.apple.com/?q=${t}`:`https://www.google.com/maps/search/?api=1&query=${t}`}var C=n=>n?.fields?.shape??{},U=(n,e)=>{let t=C(n);return Object.hasOwn(t,e)?$(t[e]):void 0},H=(n,e)=>{let t=n.computed,o=t&&Object.hasOwn(t,e)?t[e]:void 0;return typeof o=="object"?o.as:void 0};function te(n,e){return U(n,e)??(n&&H(n,e)==="duration"?"duration":void 0)}function re(n,e,t){return n==="duration"?typeof e=="number"?I(e,t):void 0:n==="phone"?typeof e=="string"?W(e,t):void 0:n==="place"&&typeof e=="string"?e.trim():void 0}function oe(n,e){if(!(typeof e!="string"||!e.trim()))return n==="phone"?P(e):n==="place"?q(e):void 0}export{S as a,B as b,G as c,Z as d,J as e,ne as f,te as g,re as h,oe as i};