graview 0.1.39 → 0.1.40

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 (173) hide show
  1. package/dist/preview/{chunk.WQPNGBR7.js → chunk.242EUAPE.js} +1 -1
  2. package/dist/preview/chunk.2CF2XKOS.js +1 -0
  3. package/dist/preview/chunk.2FGYWAID.js +1 -0
  4. package/dist/preview/{chunk.NSNGPQGT.js → chunk.2FLPDPEL.js} +1 -1
  5. package/dist/preview/{chunk.ZTMDU3OH.js → chunk.2GDXNTY5.js} +1 -1
  6. package/dist/preview/{chunk.C4CFYTCW.js → chunk.2JB4Y2ET.js} +1 -1
  7. package/dist/preview/chunk.2NXH7VAI.js +1 -0
  8. package/dist/preview/chunk.2OSNYF5C.js +1 -0
  9. package/dist/preview/{chunk.Z7JRBKA7.js → chunk.2RVUDRRY.js} +1 -1
  10. package/dist/preview/{chunk.5OJJ2TKZ.js → chunk.2WACBAUN.js} +2 -2
  11. package/dist/preview/chunk.35PHXNOC.js +1 -0
  12. package/dist/preview/{chunk.WJQY4E45.js → chunk.3Q75TIGL.js} +1 -1
  13. package/dist/preview/{chunk.HHUCPVG5.js → chunk.42XSBKPO.js} +1 -1
  14. package/dist/preview/{chunk.6CFP5UYP.js → chunk.47KHZCNG.js} +1 -1
  15. package/dist/preview/{chunk.U7QMA4H7.js → chunk.4QPVS2ZM.js} +1 -1
  16. package/dist/preview/{chunk.NG3YMQ36.js → chunk.4VG2KN7G.js} +1 -1
  17. package/dist/preview/{chunk.6XU2CXRZ.js → chunk.5RABSIF7.js} +1 -1
  18. package/dist/preview/{chunk.7EFNLMKU.js → chunk.67WWRC6Y.js} +1 -1
  19. package/dist/preview/{chunk.QMFUPTR4.js → chunk.6AVZWLRF.js} +1 -1
  20. package/dist/preview/{chunk.C2OAKTZX.js → chunk.6CRRPXKP.js} +1 -1
  21. package/dist/preview/{chunk.WXYUWBKX.js → chunk.6FNMDAX5.js} +1 -1
  22. package/dist/preview/{chunk.U4E5GQTK.js → chunk.6J37UQKG.js} +1 -1
  23. package/dist/preview/chunk.6JEU3ZNE.js +1 -0
  24. package/dist/preview/{chunk.RXSHFG6S.js → chunk.6PSWHBL2.js} +1 -1
  25. package/dist/preview/chunk.74NOI7QN.js +1 -0
  26. package/dist/preview/{chunk.VC4JPG7O.js → chunk.7LIKEE5Z.js} +1 -1
  27. package/dist/preview/{chunk.2NSTEREJ.js → chunk.7WPCP2LZ.js} +1 -1
  28. package/dist/preview/{chunk.JEZTPXEB.js → chunk.ACBUAIDF.js} +1 -1
  29. package/dist/preview/{chunk.EWWJMS6G.js → chunk.AKQXF7GW.js} +1 -1
  30. package/dist/preview/chunk.AUBGUDO5.js +1 -0
  31. package/dist/preview/{chunk.G46WGK5E.js → chunk.AVKDWISO.js} +1 -1
  32. package/dist/preview/{chunk.5JPRFXYQ.js → chunk.AWX7GP72.js} +1 -1
  33. package/dist/preview/chunk.BFNVG5JE.js +1 -0
  34. package/dist/preview/chunk.BNVMMOOY.js +1 -0
  35. package/dist/preview/{chunk.5XNVN4HE.js → chunk.BSAXZQSY.js} +1 -1
  36. package/dist/preview/{chunk.B7TB6YRZ.js → chunk.BXT6FDT4.js} +1 -1
  37. package/dist/preview/{chunk.FCXBCKED.js → chunk.C2PECN4C.js} +1 -1
  38. package/dist/preview/{chunk.OJKS3UQS.js → chunk.CL2ZS5EQ.js} +1 -1
  39. package/dist/preview/chunk.CN5WAKHJ.js +5 -0
  40. package/dist/preview/{chunk.I7CU2E3C.js → chunk.CNFL5IN5.js} +1 -1
  41. package/dist/preview/{chunk.M5QFUGGG.js → chunk.D25XEVKO.js} +1 -1
  42. package/dist/preview/{chunk.P3JYH6HO.js → chunk.DL26BKT7.js} +1 -1
  43. package/dist/preview/{chunk.23WYWIAJ.js → chunk.DPZTW24D.js} +1 -1
  44. package/dist/preview/chunk.ESSSNLEO.js +1 -0
  45. package/dist/preview/chunk.ETOGQE2V.js +1 -0
  46. package/dist/preview/{chunk.XLZ2QRRS.js → chunk.FDE3TSTK.js} +1 -1
  47. package/dist/preview/{chunk.37ASLBGE.js → chunk.FFZBOP65.js} +1 -1
  48. package/dist/preview/chunk.FOQZADMA.js +25 -0
  49. package/dist/preview/{chunk.5R4E5C76.js → chunk.G6VZNRQ5.js} +1 -1
  50. package/dist/preview/{chunk.OM5CDW2S.js → chunk.GT2BITLW.js} +1 -1
  51. package/dist/preview/{chunk.CF7DHTKL.js → chunk.GTV2VZAS.js} +2 -2
  52. package/dist/preview/{chunk.IXYBIDAN.js → chunk.GY6RYJHM.js} +1 -1
  53. package/dist/preview/chunk.GZIVMOY4.js +117 -0
  54. package/dist/preview/{chunk.UIUHGA6W.js → chunk.H5ADMSE7.js} +1 -1
  55. package/dist/preview/{chunk.XBOZTQQA.js → chunk.H5HWN7A2.js} +1 -1
  56. package/dist/preview/{chunk.7WSXVXP3.js → chunk.H6XKMLDQ.js} +1 -1
  57. package/dist/preview/{chunk.OYMM2UWE.js → chunk.H7POIT3V.js} +1 -1
  58. package/dist/preview/{chunk.CMN6VVK2.js → chunk.HB7ELBVK.js} +1 -1
  59. package/dist/preview/{chunk.IAZRY42B.js → chunk.HPAGOEZG.js} +1 -1
  60. package/dist/preview/{chunk.4BBJ62ZO.js → chunk.I7XSDXQ3.js} +1 -1
  61. package/dist/preview/{chunk.WTZOOAIW.js → chunk.IDUPJMJO.js} +1 -1
  62. package/dist/preview/chunk.IFTWVUJO.js +2 -0
  63. package/dist/preview/{chunk.FMN5XDLE.js → chunk.ISXFH3CK.js} +1 -1
  64. package/dist/preview/chunk.J4IULZFD.js +1 -0
  65. package/dist/preview/chunk.JACGQ2PR.js +4 -0
  66. package/dist/preview/{chunk.YXGI7H4Y.js → chunk.JDRLSVOI.js} +1 -1
  67. package/dist/preview/chunk.JLDBFX6O.js +1 -0
  68. package/dist/preview/{chunk.LCYMYLOP.js → chunk.JQEYZB5I.js} +1 -1
  69. package/dist/preview/{chunk.ZR5KVYWZ.js → chunk.L3A6YLMT.js} +2 -2
  70. package/dist/preview/chunk.LLEFYJPJ.js +344 -0
  71. package/dist/preview/chunk.LOZJQ5ZX.js +1 -0
  72. package/dist/preview/{chunk.GXKECZ4S.js → chunk.LPBM5AES.js} +1 -1
  73. package/dist/preview/{chunk.QEXXLWEU.js → chunk.LPE4FLC6.js} +2 -2
  74. package/dist/preview/{chunk.TU4KG22J.js → chunk.MIM2QLF5.js} +2 -2
  75. package/dist/preview/{chunk.P4WYBSYA.js → chunk.N2K25KH3.js} +1 -1
  76. package/dist/preview/{chunk.KJNUZYXS.js → chunk.N6MVK3KD.js} +1 -1
  77. package/dist/preview/{chunk.3ZNQ5YKX.js → chunk.NGDXH66B.js} +1 -1
  78. package/dist/preview/chunk.O5JKDFDH.js +1 -0
  79. package/dist/preview/chunk.O6F3K6CU.js +1 -0
  80. package/dist/preview/{chunk.HA3PPIEQ.js → chunk.OW7NSJ4H.js} +1 -1
  81. package/dist/preview/chunk.P5ODICND.js +32 -0
  82. package/dist/preview/{chunk.67USHK26.js → chunk.PPG2SEIY.js} +1 -1
  83. package/dist/preview/chunk.PYNYHNDS.js +1 -0
  84. package/dist/preview/{chunk.JBTU2PJ4.js → chunk.Q4TZHWQX.js} +1 -1
  85. package/dist/preview/chunk.QCWZSSNC.js +1 -0
  86. package/dist/preview/chunk.QIV65FWE.js +1 -0
  87. package/dist/preview/chunk.R5WY567U.js +88 -0
  88. package/dist/preview/{chunk.GP2F7TIN.js → chunk.RCM7NOPF.js} +2 -1
  89. package/dist/preview/{chunk.F5UVEF2R.js → chunk.S2U5CEP4.js} +1 -1
  90. package/dist/preview/chunk.S356ACK2.js +1 -0
  91. package/dist/preview/{chunk.W4OX4BMP.js → chunk.SIGC3G7S.js} +1 -1
  92. package/dist/preview/{chunk.LP3QUPCE.js → chunk.STI447YW.js} +1 -1
  93. package/dist/preview/chunk.T3TYD7QI.js +1 -0
  94. package/dist/preview/{chunk.BYKR7NEE.js → chunk.T73RB7LC.js} +1 -1
  95. package/dist/preview/chunk.TD2LNFUB.js +1 -0
  96. package/dist/preview/{chunk.2BJRS3YJ.js → chunk.TGVUIFKD.js} +1 -1
  97. package/dist/preview/{chunk.AYHCQWSU.js → chunk.TIH2PDFH.js} +1 -1
  98. package/dist/preview/chunk.TKUNRFDE.js +1 -0
  99. package/dist/preview/{chunk.6DHHUBSC.js → chunk.TNESS3LQ.js} +1 -1
  100. package/dist/preview/chunk.UHI3D7JC.js +1 -0
  101. package/dist/preview/{chunk.XLI44BBI.js → chunk.UOPKRN55.js} +1 -1
  102. package/dist/preview/{chunk.RM7NVN7B.js → chunk.UTCB3CE7.js} +2 -2
  103. package/dist/preview/{chunk.H5CZZZLX.js → chunk.UUBYFBPN.js} +1 -1
  104. package/dist/preview/{chunk.ROINZMNO.js → chunk.UWW6ZEPY.js} +2 -2
  105. package/dist/preview/chunk.V5MYKNL7.js +5 -0
  106. package/dist/preview/{chunk.DYNBWIPF.js → chunk.VDAMCTNL.js} +1 -1
  107. package/dist/preview/{chunk.ROKRQRID.js → chunk.VF7P3ZVZ.js} +1 -1
  108. package/dist/preview/chunk.VIYECFKZ.js +6 -0
  109. package/dist/preview/{chunk.ITEF3U2E.js → chunk.VJXXCUKS.js} +1 -1
  110. package/dist/preview/{chunk.EBHKKOPO.js → chunk.VNUHESMZ.js} +1 -1
  111. package/dist/preview/chunk.VZYCILPJ.js +1 -0
  112. package/dist/preview/chunk.W4HBRXMY.js +1 -0
  113. package/dist/preview/chunk.W7R2GFBW.js +47 -0
  114. package/dist/preview/chunk.WBLHCH5M.js +1 -0
  115. package/dist/preview/{chunk.CC47O2DW.js → chunk.WVDKYUF3.js} +1 -1
  116. package/dist/preview/{chunk.BEC5ZH2L.js → chunk.XEKLEHC3.js} +1 -1
  117. package/dist/preview/{chunk.FILCNVGH.js → chunk.XFZKP4IF.js} +1 -1
  118. package/dist/preview/{chunk.CAMQ7MYJ.js → chunk.XQHDP5C3.js} +1 -1
  119. package/dist/preview/{chunk.UB3O3QJQ.js → chunk.XRYTJNA7.js} +1 -1
  120. package/dist/preview/chunk.YO24NALN.js +1 -0
  121. package/dist/preview/{chunk.4PNFX3TX.js → chunk.YWNHCZQ5.js} +1 -1
  122. package/dist/preview/{chunk.4ECICQ2S.js → chunk.YYFLTMNN.js} +1 -1
  123. package/dist/preview/{chunk.CTK2P4JV.js → chunk.YYIKSH2F.js} +2 -2
  124. package/dist/preview/{chunk.B2IRADR2.js → chunk.Z5AB2DBF.js} +1 -1
  125. package/dist/preview/{chunk.C6X7CKU6.js → chunk.Z7LDT55A.js} +1 -1
  126. package/dist/preview/{chunk.EDC4EMIX.js → chunk.ZGCRMNER.js} +1 -1
  127. package/dist/preview/{chunk.2IX3CZNP.js → chunk.ZHLQWMV5.js} +1 -1
  128. package/dist/preview/{chunk.2GGDOFTF.js → chunk.ZJMDLRC5.js} +1 -1
  129. package/dist/preview/{chunk.N2SV3KX7.js → chunk.ZK3X23EU.js} +1 -1
  130. package/dist/preview/{chunk.JCR3ECUM.js → chunk.ZOR6FKNI.js} +1 -1
  131. package/dist/preview/{chunk.STBJV6HJ.js → chunk.ZRLXVYPG.js} +1 -1
  132. package/dist/preview/index.html +45 -43
  133. package/dist/preview/page.js +8 -8
  134. package/package.json +6 -6
  135. package/dist/preview/chunk.2HF54MYG.js +0 -1
  136. package/dist/preview/chunk.2RCNSHXK.js +0 -1
  137. package/dist/preview/chunk.546WEHEX.js +0 -47
  138. package/dist/preview/chunk.57OPL5WD.js +0 -1
  139. package/dist/preview/chunk.5ZMENPY4.js +0 -5
  140. package/dist/preview/chunk.6HBEYRJU.js +0 -1
  141. package/dist/preview/chunk.6L7IDF3J.js +0 -1
  142. package/dist/preview/chunk.ALDLAQ7V.js +0 -1
  143. package/dist/preview/chunk.BCHHBGM6.js +0 -1
  144. package/dist/preview/chunk.BL4S3I2N.js +0 -1
  145. package/dist/preview/chunk.BS3FX4PX.js +0 -1
  146. package/dist/preview/chunk.BTSXYZ6Z.js +0 -25
  147. package/dist/preview/chunk.BZSU4HH2.js +0 -1
  148. package/dist/preview/chunk.DAA7IDQ4.js +0 -1
  149. package/dist/preview/chunk.E3HXXUKY.js +0 -1
  150. package/dist/preview/chunk.EM4Y4YAD.js +0 -2
  151. package/dist/preview/chunk.FGDHEVH4.js +0 -1
  152. package/dist/preview/chunk.FJBQ4UP3.js +0 -32
  153. package/dist/preview/chunk.G23VFYGF.js +0 -88
  154. package/dist/preview/chunk.HFDYFPMJ.js +0 -1
  155. package/dist/preview/chunk.HGS32FT2.js +0 -1
  156. package/dist/preview/chunk.J3M2MZHG.js +0 -1
  157. package/dist/preview/chunk.KIJCOW25.js +0 -1
  158. package/dist/preview/chunk.L7DQKPJV.js +0 -117
  159. package/dist/preview/chunk.LP2DJ5ZB.js +0 -6
  160. package/dist/preview/chunk.N7N5OFPL.js +0 -1
  161. package/dist/preview/chunk.ORXFUK6F.js +0 -344
  162. package/dist/preview/chunk.OXTUXWMU.js +0 -1
  163. package/dist/preview/chunk.P5325GYR.js +0 -1
  164. package/dist/preview/chunk.PMER4LVT.js +0 -1
  165. package/dist/preview/chunk.PONWLTTB.js +0 -1
  166. package/dist/preview/chunk.QCF6Z2AZ.js +0 -1
  167. package/dist/preview/chunk.RWB4235L.js +0 -1
  168. package/dist/preview/chunk.SK33IHL2.js +0 -4
  169. package/dist/preview/chunk.TCUB6IDY.js +0 -1
  170. package/dist/preview/chunk.TJCTTJWE.js +0 -1
  171. package/dist/preview/chunk.UCZR33MK.js +0 -1
  172. package/dist/preview/chunk.UGCNMAPC.js +0 -1
  173. package/dist/preview/chunk.XDYAG276.js +0 -1
@@ -1,4 +1,4 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Se,b as $e,c as ze,d as $a,e as za,h as Ee,i as Ce,k as Ae,l as Te,m as Ea}from"./chunk.P5325GYR.js";import{c as ke}from"./chunk.BEC5ZH2L.js";import{g as ya,h as ka}from"./chunk.SK33IHL2.js";import"./chunk.GP2F7TIN.js";import{b as ma,c as fa,d as ye,e as ha}from"./chunk.C6X7CKU6.js";import{a as ba}from"./chunk.HJCQ6I3S.js";import{b as xa}from"./chunk.EBHKKOPO.js";import"./chunk.P4WYBSYA.js";import{b as la}from"./chunk.2NSTEREJ.js";import{b as fe,d as xe,e as be}from"./chunk.CAMQ7MYJ.js";import"./chunk.EWWJMS6G.js";import{b as he}from"./chunk.2RCNSHXK.js";import"./chunk.ZTMDU3OH.js";import"./chunk.RWB4235L.js";import"./chunk.3ZNQ5YKX.js";import{p as va,q as wa,r as ua}from"./chunk.7EFNLMKU.js";import"./chunk.ITEF3U2E.js";import"./chunk.B2IRADR2.js";import"./chunk.J3M2MZHG.js";import"./chunk.UT6642FC.js";import{e as Sa}from"./chunk.HGS32FT2.js";import"./chunk.TI4OSTQV.js";import"./chunk.B7TB6YRZ.js";import"./chunk.GZHZLJBF.js";import{c as oa,d as da,e as Z,o as sa}from"./chunk.HHUCPVG5.js";import"./chunk.OJGHDWI6.js";import"./chunk.WXYUWBKX.js";import"./chunk.NSNGPQGT.js";import"./chunk.H5CZZZLX.js";import"./chunk.Z7JRBKA7.js";import{H as ca,b as Ye,e as ta,f as ia,j as Wa,m as na,o as pa,v as ga}from"./chunk.ORXFUK6F.js";import{Da as ra,G as O,R as f,X as Xe,Z as Je,_ as S,aa as le,ha as Ze,i as ue,j as ne,m as j,n as oe,o as me,qa as pe,r as de,va as ea,wa as K,x as je,y as se,z as Qe,za as aa}from"./chunk.BTSXYZ6Z.js";import{a as V}from"./chunk.SDO3U72B.js";import{T as _e,Zb as Ve,ea as Ue,ga as ie,rc as H,tc as P}from"./chunk.5ZMENPY4.js";import{b as p}from"./chunk.AJZBJBMO.js";function qa(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 Se,b as $e,c as ze,d as $a,e as za,h as Ee,i as Ce,k as Ae,l as Te,m as Ea}from"./chunk.PYNYHNDS.js";import{c as ke}from"./chunk.XEKLEHC3.js";import{g as ya,h as ka}from"./chunk.JACGQ2PR.js";import"./chunk.RCM7NOPF.js";import{b as ma,c as fa,d as ye,e as ha}from"./chunk.Z7LDT55A.js";import{a as ba}from"./chunk.HJCQ6I3S.js";import{b as xa}from"./chunk.VNUHESMZ.js";import"./chunk.N2K25KH3.js";import{b as la}from"./chunk.7WPCP2LZ.js";import{b as fe,d as xe,e as be}from"./chunk.XQHDP5C3.js";import"./chunk.AKQXF7GW.js";import{b as he}from"./chunk.6JEU3ZNE.js";import"./chunk.BFNVG5JE.js";import"./chunk.2GDXNTY5.js";import"./chunk.O5JKDFDH.js";import"./chunk.NGDXH66B.js";import{p as va,q as wa,r as ua}from"./chunk.67WWRC6Y.js";import"./chunk.VJXXCUKS.js";import"./chunk.Z5AB2DBF.js";import"./chunk.QIV65FWE.js";import"./chunk.UT6642FC.js";import{f as Sa}from"./chunk.35PHXNOC.js";import"./chunk.TI4OSTQV.js";import"./chunk.BXT6FDT4.js";import"./chunk.GZHZLJBF.js";import{c as oa,d as da,e as Z,o as sa}from"./chunk.42XSBKPO.js";import"./chunk.OJGHDWI6.js";import"./chunk.6FNMDAX5.js";import"./chunk.2FLPDPEL.js";import"./chunk.UUBYFBPN.js";import"./chunk.2RVUDRRY.js";import{H as ca,b as Ye,e as ta,f as ia,j as Wa,m as na,o as pa,v as ga}from"./chunk.LLEFYJPJ.js";import{Aa as K,Da as aa,G as O,Ha as ra,R as f,X as Xe,Z as Je,_ as S,aa as le,ha as Ze,i as ue,j as ne,m as j,n as oe,o as me,r as de,ua as pe,x as je,y as se,z as Qe,za as ea}from"./chunk.FOQZADMA.js";import{a as V}from"./chunk.SDO3U72B.js";import{T as _e,_b as Ve,ea as Ue,ga as ie,sc as H,uc as P}from"./chunk.V5MYKNL7.js";import{b as p}from"./chunk.AJZBJBMO.js";function qa(e){return`
2
2
 
3
3
 
4
4
  .graview-altitude-control {
@@ -1123,5 +1123,5 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
1123
1123
  }
1124
1124
  [data-graview-connector][data-graview-activity] {
1125
1125
  animation: graview-relation 1200ms cubic-bezier(0.22, 1, 0.36, 1);
1126
- }`}function Me(e="dark",n={}){let s=qa(e);return n.scope===void 0?s:Ye(s,n.scope)}var B=p(O(),1);var W=p(f(),1),Fa=pe(V(()=>(__graviewPreload(import.meta.url,["./chunk.ORXFUK6F.js","./chunk.BTSXYZ6Z.js","./chunk.SDO3U72B.js","./chunk.5ZMENPY4.js","./chunk.AJZBJBMO.js"]),import("./chunk.NG3YMQ36.js")))).part(e=>(0,W.jsx)(e.MapKey,{}),{quiet:!0});function Ie(){let{store:e}=S(),{view:n}=K(),s=le(),o=(0,B.useMemo)(()=>e.graph.allEdges().length>0,[e,s]),[r,v]=(0,B.useState)(!1),g=(0,B.useId)(),c=(0,B.useRef)(null),M=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(!r)return;let z=x=>{let I=x.target;I&&(M.current?.contains(I)||c.current?.contains(I))||v(!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(),v(!1),c.current?.focus({preventScroll:!0}))},children:[(0,W.jsx)("button",{ref:c,type:"button","data-testid":"lines-key","aria-expanded":r,"aria-controls":g,title:"What the lines mean",onClick:()=>v(z=>!z),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,W.jsxs)("div",{ref:M,id:g,"data-testid":"lines-key-pane","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("rail"),width:za,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)(Fa,{}):null,(0,W.jsx)($a,{inside:!0,widthOf:ba})]}):null]}):null}var ce=p(O(),1),ge=p(f(),1);function Ca(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 Ga=pe(V(()=>(__graviewPreload(import.meta.url,["./chunk.SK33IHL2.js","./chunk.U7QMA4H7.js","./chunk.C6X7CKU6.js","./chunk.HJCQ6I3S.js","./chunk.EBHKKOPO.js","./chunk.P4WYBSYA.js","./chunk.ZTMDU3OH.js","./chunk.HFDYFPMJ.js","./chunk.RWB4235L.js","./chunk.CTK2P4JV.js","./chunk.3ZNQ5YKX.js","./chunk.7EFNLMKU.js","./chunk.ITEF3U2E.js","./chunk.B2IRADR2.js","./chunk.J3M2MZHG.js","./chunk.UT6642FC.js","./chunk.B7TB6YRZ.js","./chunk.WVUJXDXZ.js","./chunk.KJNUZYXS.js","./chunk.4BBJ62ZO.js","./chunk.UCZR33MK.js","./chunk.CC47O2DW.js","./chunk.2IX3CZNP.js","./chunk.6DHHUBSC.js","./chunk.GZHZLJBF.js","./chunk.HHUCPVG5.js","./chunk.OJGHDWI6.js","./chunk.WXYUWBKX.js","./chunk.NSNGPQGT.js","./chunk.H5CZZZLX.js","./chunk.Z7JRBKA7.js","./chunk.ORXFUK6F.js","./chunk.BTSXYZ6Z.js","./chunk.SDO3U72B.js","./chunk.5ZMENPY4.js","./chunk.AJZBJBMO.js"]),import("./chunk.5XNVN4HE.js")))),_a=Ga.part((e,n)=>(0,ge.jsx)(e.MapPanelFor,{showing:n.showing}),{what:"This panel",quiet:!0});function Re(){let{store:e,view:n,selection:s,hiddenKinds:o,seatTalk:r}=S();le();let v=(0,ce.useSyncExternalStore)(r.subscribe,()=>r.get().draft!==null,()=>!1);if(!n.overview||v)return null;let g=Ca(xa(s,{...n,beside:!0},c=>e.graph.getNode(c)?.kind));return!g||g.what!=="record"&&(o.has(g.kind)||!e.schema.kinds.includes(g.kind))?null:(0,ge.jsx)(ce.Suspense,{fallback:null,children:(0,ge.jsx)(_a,{showing:g})})}var Ua=p(O(),1);var D=p(f(),1);function Le(){let{view:e,go:n}=K(),{store:s,views:o,hiddenKinds:r}=S(),v=e.overview??!1,g=o.places().map($=>$.kind).filter($=>!r.has($)),c=ca(e,s.schema.kinds,g),M=()=>{n(ne(j(e,!1),c))},z=(()=>{if(!c)return null;let $=je(c)[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(c)?.label??null})(),x=v?"Close the map":"Up",I=v&&z?`Close the map, down to ${z}`:x;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":v,"aria-label":I,title:v?I:"Up \u2014 the whole thing, from above",onClick:()=>v?M():n(j(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":v?1:0,...v?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.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,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:x})]})}var Ne=p(f(),1);function He(){let{administered:e}=S(),{view:n,go:s}=K(),o=e.filter(r=>r.canShow);return o.length===0?null:(0,Ne.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:o.map(r=>(0,Ne.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(ma(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);Xe({search:wa,touchWeights:va});var Va=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Ia({compact:e=!1}){let{store:n,view:s,setView:o,principal:r,setMenuAt:v,brand:g,aiDesk:c,selection:M}=S(),z=ia(c),x=Je(),I=ea(),$=sa().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,w=t.key==="/"&&!t.metaKey&&!t.ctrlKey&&!t.altKey;if(!i&&!w)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,Ka=U instanceof HTMLInputElement||U instanceof HTMLTextAreaElement||U instanceof HTMLSelectElement||U instanceof HTMLElement&&U.isContentEditable;w&&Ka||(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 We=(0,h.useMemo)(()=>X&&A.trim()?ua(n,X,x?.words??A,{principal:r,limit:4}):[],[n,A,x,X,r]),ve=(0,h.useMemo)(()=>{let a=new Map;for(let[t,i]of(x?.hits??[]).entries()){if(i.about==="act")continue;let w=Va(i),d=a.get(w)??[];if(d.push({id:`${C}-${t}`,hit:i}),a.set(w,d),i.about==="node"&&i.id===X)for(let[_,L]of We.entries())d.push({id:`${C}-${t}-act-${_}`,hit:L})}return[...a.entries()]},[x,We,X,C]),N=z&&A.trim()?{id:`${C}-ask`,ask:A.trim()}:null,k=(0,h.useMemo)(()=>[...ve.flatMap(([,a])=>a),...N?[N]:[]],[ve,N?.ask]),T=k.find(a=>a.id===F)??k[0],qe=(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 w=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),d=document.activeElement;if(!(!d||d===document.body||d===document.documentElement||d===y.current||d===w))return;let L=w?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if(L)return L.focus({preventScroll:!0});w&&w.tabIndex>=0&&d!==w&&t>30&&w.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)}},Fe=a=>{let t=document.getElementById(C),i=t?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,w=t?.clientHeight??0;return Math.min(a,i>0&&w>0?Math.max(1,Math.floor(w/i)-1):Xa)};(0,h.useEffect)(()=>{F&&document.getElementById(F)?.scrollIntoView?.({block:"nearest"})},[F]);let we=a=>{if(!a)return;if("ask"in a){ta(c,{pointed:{...M[0]!==void 0?{on:M[0]}:{},about:M},asked:a.ask}),o(i=>ye(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=>Qe(i,t.kind,t.as)),re.current=t.kind;break;case"rule":{let i=I.filter(w=>w.invariant===t.name).flatMap(w=>w.nodeIds);o(w=>oe(w,[...new Set(i)]));break}case"act":{o(w=>oe(w,[t.subject]));let i=y.current?.getBoundingClientRect();v({x:i?.left??0,y:(i?.bottom??0)+6,on:t.subject});break}}m(!1),y.current?.blur()},Da=x?Ya(x.byKind,x.hits,n.schema):"",te=R&&A.trim().length>0,Oa=(0,h.useCallback)(()=>{let a=y.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Za};let t=y.current?.getBoundingClientRect();return t?{x:t.right,y:t.bottom}:null},[]),Ge=ra("find",{open:te,onOpenChange:a=>{a||m(!1)},...e?{at:Oa}:{}});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,Ge.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&&T?{"aria-activedescendant":T.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=>fa(i,t.length>0?t:null))},onFocus:()=>m(!0),onBlur:()=>m(!1),onKeyDown:a=>{let t=F!==null&&T?k.indexOf(T):-1,i=d=>d!==void 0&&!("ask"in d)&&d.hit.about==="act",w=t>=0&&T!==void 0&&!("ask"in T)&&T.hit.about==="node";if(a.key==="ArrowDown"){a.preventDefault(),m(!0);let d=t+1;if(w)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"?Fe(k.length):-Fe(k.length);G(k[d[Math.min(d.length-1,Math.max(0,(t<0?-1:_)+L))]])}else if(a.key==="ArrowRight"&&w&&i(k[t+1]))a.preventDefault(),G(k[t+1]);else if(a.key==="ArrowLeft"&&i(T)){a.preventDefault();let d=t-1;for(;d>0&&i(k[d]);)d-=1;G(k[d])}else a.key==="Enter"?(a.preventDefault(),we(T)):a.key==="Escape"&&(a.preventDefault(),A?o(d=>ye(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:na,"data-testid":"find-count",children:A.trim()?Da:""}),(0,l.jsxs)("div",{...Ge.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?{...Ta,...er}:Ta,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."]}):ve.map(([a,t])=>(0,l.jsxs)("div",{role:"group","aria-label":Aa(a,n.schema),children:[(0,l.jsxs)("div",{role:"presentation",style:ar,children:[a!=="rule:"?(0,l.jsx)(Qa,{kind:a,accents:g?.accents}):null,Aa(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:()=>we(i),style:{...Ma,...i.hit.about==="act"?{paddingLeft:30}:{},background:i===T?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsx)(ja,{hit:i.hit,flag:$})},i.id))]},a)),N?(0,l.jsx)("div",{id:N.id,role:"option","aria-selected":N===T||T?.id===N.id,"data-testid":"find-ask",onMouseEnter:()=>G(N),onClick:()=>we(N),style:{...Ma,borderTop:"1px solid var(--graview-edge)",marginTop:4,background:T?.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,qe>Ja?(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:[_e(qe)," 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 ja({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:Q,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,l.jsx)("span",{style:Q,children:" \xB7 past"})]}),e.near?(0,l.jsxs)("span",{style:Q,"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:Q,children:[e.why.reading.toLowerCase(),": ",e.why.fragment]}):null]});case"kind":return(0,l.jsxs)("span",{children:[e.label,(0,l.jsxs)("span",{style:Q,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:Q,children:[" \xB7 ",e.why.field==="title"?"act":`on ${e.why.fragment}`]})]})}}function Qa({kind:e,accents:n}){let s=Math.round(Ve(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 Aa(e,n){return e==="rule:"?"Rules":e==="act:"?"Acts":n.tryDefinition(e)?.plural??`${e}s`}function Ya(e,n,s){let o=Object.entries(e).map(([g,c])=>Ue(s,g,c)),r=n.filter(g=>g.about==="kind"||g.about==="place"||g.about==="rule").length;r>0&&o.push(`${r} ${r===1?"place or rule":"places and rules"}`);let v=n.filter(g=>g.about==="node"&&g.near).length;return o.length===0?"Nothing found":`${o.join(", ")} found${v>0?`, ${v} of them near`:""}`}var Xa=10,Ja=12,Ta={...aa,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"},Za=6,er={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},ar={display:"flex",alignItems:"center",gap:6,padding:"8px 12px 2px",fontSize:"0.6875rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Ma={display:"grid",gap:1,minHeight:32,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)"},Q={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400};var Y=p(O(),1);var Be=p(Wa(),1);var La=p(f(),1);function Ra(){let{following:e,follow:n}=S();return e?(0,La.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 Na=p(O(),1);var b=p(f(),1);function Ha({home:e,homeLabel:n,children:s,onPicture:o=!1}){let{view:r,focus:v,show:g,go:c}=K(),{store:M}=S(),{movedByHand:z}=S(),x=z&&(r.pan!==void 0||Object.keys(r.pins).length>0),I=r.focusId&&r.focusId!==e?M.graph.getNode(r.focusId):void 0,$=m=>ie(M.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:()=>c(me({...r,focusId:e},!1)),title:he(M,I.id),style:{...y,maxWidth:"min(14rem, 15vw)"},children:[(0,b.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:he(M,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:()=>c(ha(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:()=>c(me(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:()=>c(ue(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:()=>c(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:()=>g(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:()=>v(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)(Na.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 Pe(){let[e,n]=(0,Y.useState)([]),s=(0,Y.useCallback)(o=>{n(r=>{let v=o.phase!=="running"&&r[0]?.name===o.name&&r[0]?.at===o.at;return[o,...v?r.slice(1):r].slice(0,12)})},[]);return[e,s]}function De({find:e,calls:n,seat:s,remembers:o=!1}){return e?(0,E.jsxs)(E.Fragment,{children:[(0,Be.createPortal)((0,E.jsx)(Ia,{compact:e.compact}),e.slot),e.own?(0,Be.createPortal)((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Y.Suspense,{fallback:null,children:(0,E.jsx)(Ea,{})}),(0,E.jsx)(la,{calls:n,remembers:o,...s!==void 0?{seat:s}:{}})]}),e.own):null]}):null}function Oe({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:P("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,E.jsx)(Ha,{home:e,onPicture:!0}),(0,E.jsx)("span",{style:{pointerEvents:"auto"},children:(0,E.jsx)(Ra,{})})]})}var q=p(O(),1);var Ba=p(f(),1),rr=V(()=>(__graviewPreload(import.meta.url,["./chunk.UGFDSE37.js","./chunk.ORXFUK6F.js","./chunk.BTSXYZ6Z.js","./chunk.SDO3U72B.js","./chunk.5ZMENPY4.js","./chunk.AJZBJBMO.js"]),import("./chunk.N2SV3KX7.js")));function Ke(){let{store:e,principal:n}=S(),s=(0,q.useContext)(pa),o=(0,q.useRef)(null),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>()=>void(r.current=!0),[]),(0,q.useEffect)(()=>{let v=e.batches().length,g=rr().then(c=>c.sceneWay(e,n,s,v,o.current),()=>{});return()=>void g.then(c=>c?.(r.current))},[e,n,s]),(0,Ba.jsx)("span",{ref:o,hidden:!0})}var Pa=p(O(),1);var u=p(f(),1);function Ht({address:e=!1,auto:n,quickAsk:s=!0,scheme:o,scope:r}){let v=(0,Pa.useMemo)(()=>`${Te({scope:`.${r}`})}
1126
+ }`}function Me(e="dark",n={}){let s=qa(e);return n.scope===void 0?s:Ye(s,n.scope)}var B=p(O(),1);var W=p(f(),1),Fa=pe(V(()=>(__graviewPreload(import.meta.url,["./chunk.LLEFYJPJ.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.4VG2KN7G.js")))).part(e=>(0,W.jsx)(e.MapKey,{}),{quiet:!0});function Ie(){let{store:e}=S(),{view:n}=K(),s=le(),o=(0,B.useMemo)(()=>e.graph.allEdges().length>0,[e,s]),[r,v]=(0,B.useState)(!1),g=(0,B.useId)(),c=(0,B.useRef)(null),M=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(!r)return;let z=x=>{let I=x.target;I&&(M.current?.contains(I)||c.current?.contains(I))||v(!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(),v(!1),c.current?.focus({preventScroll:!0}))},children:[(0,W.jsx)("button",{ref:c,type:"button","data-testid":"lines-key","aria-expanded":r,"aria-controls":g,title:"What the lines mean",onClick:()=>v(z=>!z),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,W.jsxs)("div",{ref:M,id:g,"data-testid":"lines-key-pane","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:P("rail"),width:za,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)(Fa,{}):null,(0,W.jsx)($a,{inside:!0,widthOf:ba})]}):null]}):null}var ce=p(O(),1),ge=p(f(),1);function Ca(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 Ga=pe(V(()=>(__graviewPreload(import.meta.url,["./chunk.JACGQ2PR.js","./chunk.4QPVS2ZM.js","./chunk.Z7LDT55A.js","./chunk.HJCQ6I3S.js","./chunk.VNUHESMZ.js","./chunk.N2K25KH3.js","./chunk.2GDXNTY5.js","./chunk.ETOGQE2V.js","./chunk.O5JKDFDH.js","./chunk.YYIKSH2F.js","./chunk.NGDXH66B.js","./chunk.67WWRC6Y.js","./chunk.VJXXCUKS.js","./chunk.Z5AB2DBF.js","./chunk.QIV65FWE.js","./chunk.UT6642FC.js","./chunk.BXT6FDT4.js","./chunk.WVUJXDXZ.js","./chunk.N6MVK3KD.js","./chunk.I7XSDXQ3.js","./chunk.UHI3D7JC.js","./chunk.WVDKYUF3.js","./chunk.ZHLQWMV5.js","./chunk.TNESS3LQ.js","./chunk.GZHZLJBF.js","./chunk.42XSBKPO.js","./chunk.OJGHDWI6.js","./chunk.6FNMDAX5.js","./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.LLEFYJPJ.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.BSAXZQSY.js")))),_a=Ga.part((e,n)=>(0,ge.jsx)(e.MapPanelFor,{showing:n.showing}),{what:"This panel",quiet:!0});function Re(){let{store:e,view:n,selection:s,hiddenKinds:o,seatTalk:r}=S();le();let v=(0,ce.useSyncExternalStore)(r.subscribe,()=>r.get().draft!==null,()=>!1);if(!n.overview||v)return null;let g=Ca(xa(s,{...n,beside:!0},c=>e.graph.getNode(c)?.kind));return!g||g.what!=="record"&&(o.has(g.kind)||!e.schema.kinds.includes(g.kind))?null:(0,ge.jsx)(ce.Suspense,{fallback:null,children:(0,ge.jsx)(_a,{showing:g})})}var Ua=p(O(),1);var D=p(f(),1);function Le(){let{view:e,go:n}=K(),{store:s,views:o,hiddenKinds:r}=S(),v=e.overview??!1,g=o.places().map($=>$.kind).filter($=>!r.has($)),c=ca(e,s.schema.kinds,g),M=()=>{n(ne(j(e,!1),c))},z=(()=>{if(!c)return null;let $=je(c)[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(c)?.label??null})(),x=v?"Close the map":"Up",I=v&&z?`Close the map, down to ${z}`:x;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":v,"aria-label":I,title:v?I:"Up \u2014 the whole thing, from above",onClick:()=>v?M():n(j(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":v?1:0,...v?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.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,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:x})]})}var Ne=p(f(),1);function He(){let{administered:e}=S(),{view:n,go:s}=K(),o=e.filter(r=>r.canShow);return o.length===0?null:(0,Ne.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:o.map(r=>(0,Ne.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(ma(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);Xe({search:wa,touchWeights:va});var Va=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Ia({compact:e=!1}){let{store:n,view:s,setView:o,principal:r,setMenuAt:v,brand:g,aiDesk:c,selection:M}=S(),z=ia(c),x=Je(),I=ea(),$=sa().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,w=t.key==="/"&&!t.metaKey&&!t.ctrlKey&&!t.altKey;if(!i&&!w)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,Ka=U instanceof HTMLInputElement||U instanceof HTMLTextAreaElement||U instanceof HTMLSelectElement||U instanceof HTMLElement&&U.isContentEditable;w&&Ka||(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 We=(0,h.useMemo)(()=>X&&A.trim()?ua(n,X,x?.words??A,{principal:r,limit:4}):[],[n,A,x,X,r]),ve=(0,h.useMemo)(()=>{let a=new Map;for(let[t,i]of(x?.hits??[]).entries()){if(i.about==="act")continue;let w=Va(i),d=a.get(w)??[];if(d.push({id:`${C}-${t}`,hit:i}),a.set(w,d),i.about==="node"&&i.id===X)for(let[_,L]of We.entries())d.push({id:`${C}-${t}-act-${_}`,hit:L})}return[...a.entries()]},[x,We,X,C]),N=z&&A.trim()?{id:`${C}-ask`,ask:A.trim()}:null,k=(0,h.useMemo)(()=>[...ve.flatMap(([,a])=>a),...N?[N]:[]],[ve,N?.ask]),T=k.find(a=>a.id===F)??k[0],qe=(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 w=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),d=document.activeElement;if(!(!d||d===document.body||d===document.documentElement||d===y.current||d===w))return;let L=w?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if(L)return L.focus({preventScroll:!0});w&&w.tabIndex>=0&&d!==w&&t>30&&w.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)}},Fe=a=>{let t=document.getElementById(C),i=t?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,w=t?.clientHeight??0;return Math.min(a,i>0&&w>0?Math.max(1,Math.floor(w/i)-1):Xa)};(0,h.useEffect)(()=>{F&&document.getElementById(F)?.scrollIntoView?.({block:"nearest"})},[F]);let we=a=>{if(!a)return;if("ask"in a){ta(c,{pointed:{...M[0]!==void 0?{on:M[0]}:{},about:M},asked:a.ask}),o(i=>ye(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=>Qe(i,t.kind,t.as)),re.current=t.kind;break;case"rule":{let i=I.filter(w=>w.invariant===t.name).flatMap(w=>w.nodeIds);o(w=>oe(w,[...new Set(i)]));break}case"act":{o(w=>oe(w,[t.subject]));let i=y.current?.getBoundingClientRect();v({x:i?.left??0,y:(i?.bottom??0)+6,on:t.subject});break}}m(!1),y.current?.blur()},Da=x?Ya(x.byKind,x.hits,n.schema):"",te=R&&A.trim().length>0,Oa=(0,h.useCallback)(()=>{let a=y.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Za};let t=y.current?.getBoundingClientRect();return t?{x:t.right,y:t.bottom}:null},[]),Ge=ra("find",{open:te,onOpenChange:a=>{a||m(!1)},...e?{at:Oa}:{}});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,Ge.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&&T?{"aria-activedescendant":T.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=>fa(i,t.length>0?t:null))},onFocus:()=>m(!0),onBlur:()=>m(!1),onKeyDown:a=>{let t=F!==null&&T?k.indexOf(T):-1,i=d=>d!==void 0&&!("ask"in d)&&d.hit.about==="act",w=t>=0&&T!==void 0&&!("ask"in T)&&T.hit.about==="node";if(a.key==="ArrowDown"){a.preventDefault(),m(!0);let d=t+1;if(w)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"?Fe(k.length):-Fe(k.length);G(k[d[Math.min(d.length-1,Math.max(0,(t<0?-1:_)+L))]])}else if(a.key==="ArrowRight"&&w&&i(k[t+1]))a.preventDefault(),G(k[t+1]);else if(a.key==="ArrowLeft"&&i(T)){a.preventDefault();let d=t-1;for(;d>0&&i(k[d]);)d-=1;G(k[d])}else a.key==="Enter"?(a.preventDefault(),we(T)):a.key==="Escape"&&(a.preventDefault(),A?o(d=>ye(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:na,"data-testid":"find-count",children:A.trim()?Da:""}),(0,l.jsxs)("div",{...Ge.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?{...Ta,...er}:Ta,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."]}):ve.map(([a,t])=>(0,l.jsxs)("div",{role:"group","aria-label":Aa(a,n.schema),children:[(0,l.jsxs)("div",{role:"presentation",style:ar,children:[a!=="rule:"?(0,l.jsx)(Qa,{kind:a,accents:g?.accents}):null,Aa(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:()=>we(i),style:{...Ma,...i.hit.about==="act"?{paddingLeft:30}:{},background:i===T?"var(--graview-panel-muted)":"transparent"},children:(0,l.jsx)(ja,{hit:i.hit,flag:$})},i.id))]},a)),N?(0,l.jsx)("div",{id:N.id,role:"option","aria-selected":N===T||T?.id===N.id,"data-testid":"find-ask",onMouseEnter:()=>G(N),onClick:()=>we(N),style:{...Ma,borderTop:"1px solid var(--graview-edge)",marginTop:4,background:T?.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,qe>Ja?(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:[_e(qe)," 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 ja({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:Q,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,l.jsx)("span",{style:Q,children:" \xB7 past"})]}),e.near?(0,l.jsxs)("span",{style:Q,"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:Q,children:[e.why.reading.toLowerCase(),": ",e.why.fragment]}):null]});case"kind":return(0,l.jsxs)("span",{children:[e.label,(0,l.jsxs)("span",{style:Q,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:Q,children:[" \xB7 ",e.why.field==="title"?"act":`on ${e.why.fragment}`]})]})}}function Qa({kind:e,accents:n}){let s=Math.round(Ve(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 Aa(e,n){return e==="rule:"?"Rules":e==="act:"?"Acts":n.tryDefinition(e)?.plural??`${e}s`}function Ya(e,n,s){let o=Object.entries(e).map(([g,c])=>Ue(s,g,c)),r=n.filter(g=>g.about==="kind"||g.about==="place"||g.about==="rule").length;r>0&&o.push(`${r} ${r===1?"place or rule":"places and rules"}`);let v=n.filter(g=>g.about==="node"&&g.near).length;return o.length===0?"Nothing found":`${o.join(", ")} found${v>0?`, ${v} of them near`:""}`}var Xa=10,Ja=12,Ta={...aa,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"},Za=6,er={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},ar={display:"flex",alignItems:"center",gap:6,padding:"8px 12px 2px",fontSize:"0.6875rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Ma={display:"grid",gap:1,minHeight:32,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)"},Q={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400};var Y=p(O(),1);var Be=p(Wa(),1);var La=p(f(),1);function Ra(){let{following:e,follow:n}=S();return e?(0,La.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 Na=p(O(),1);var b=p(f(),1);function Ha({home:e,homeLabel:n,children:s,onPicture:o=!1}){let{view:r,focus:v,show:g,go:c}=K(),{store:M}=S(),{movedByHand:z}=S(),x=z&&(r.pan!==void 0||Object.keys(r.pins).length>0),I=r.focusId&&r.focusId!==e?M.graph.getNode(r.focusId):void 0,$=m=>ie(M.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:()=>c(me({...r,focusId:e},!1)),title:he(M,I.id),style:{...y,maxWidth:"min(14rem, 15vw)"},children:[(0,b.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:he(M,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:()=>c(ha(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:()=>c(me(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:()=>c(ue(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:()=>c(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:()=>g(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:()=>v(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)(Na.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 Pe(){let[e,n]=(0,Y.useState)([]),s=(0,Y.useCallback)(o=>{n(r=>{let v=o.phase!=="running"&&r[0]?.name===o.name&&r[0]?.at===o.at;return[o,...v?r.slice(1):r].slice(0,12)})},[]);return[e,s]}function De({find:e,calls:n,seat:s,remembers:o=!1}){return e?(0,E.jsxs)(E.Fragment,{children:[(0,Be.createPortal)((0,E.jsx)(Ia,{compact:e.compact}),e.slot),e.own?(0,Be.createPortal)((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Y.Suspense,{fallback:null,children:(0,E.jsx)(Ea,{})}),(0,E.jsx)(la,{calls:n,remembers:o,...s!==void 0?{seat:s}:{}})]}),e.own):null]}):null}function Oe({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:P("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,E.jsx)(Ha,{home:e,onPicture:!0}),(0,E.jsx)("span",{style:{pointerEvents:"auto"},children:(0,E.jsx)(Ra,{})})]})}var q=p(O(),1);var Ba=p(f(),1),rr=V(()=>(__graviewPreload(import.meta.url,["./chunk.UGFDSE37.js","./chunk.LLEFYJPJ.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZK3X23EU.js")));function Ke(){let{store:e,principal:n}=S(),s=(0,q.useContext)(pa),o=(0,q.useRef)(null),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>()=>void(r.current=!0),[]),(0,q.useEffect)(()=>{let v=e.batches().length,g=rr().then(c=>c.sceneWay(e,n,s,v,o.current),()=>{});return()=>void g.then(c=>c?.(r.current))},[e,n,s]),(0,Ba.jsx)("span",{ref:o,hidden:!0})}var Pa=p(O(),1);var u=p(f(),1);function Ht({address:e=!1,auto:n,quickAsk:s=!0,scheme:o,scope:r}){let v=(0,Pa.useMemo)(()=>`${Te({scope:`.${r}`})}
1127
1127
  ${Me(o,{scope:`.${r}`})}`,[o,r]),g=ga(),[c]=Pe();return(0,u.jsx)(Ze.Provider,{value:!0,children:(0,u.jsxs)("div",{"data-embed-content":"",style:{position:"relative",flex:n?`0 0 ${Sa}px`:"1 1 auto",minHeight:0,containerType:"size"},children:[(0,u.jsx)("style",{children:v}),e?(0,u.jsx)(ka,{}):null,(0,u.jsx)(ya,{}),(0,u.jsx)(Oe,{}),(0,u.jsx)(Le,{}),(0,u.jsx)(Ie,{}),(0,u.jsx)($e,{}),(0,u.jsx)(ze,{face:"scene",on:s}),(0,u.jsx)(Re,{}),(0,u.jsx)(xe,{children:(0,u.jsx)(ke,{children:(0,u.jsx)(Ee,{children:(0,u.jsx)(Ae,{children:(0,u.jsx)(Se,{placement:"menu"})})})})}),(0,u.jsx)(be,{}),(0,u.jsx)(Ce,{}),(0,u.jsx)(De,{find:g,calls:c}),(0,u.jsx)(Ke,{}),(0,u.jsx)(fe,{face:"scene"})]})})}function Bt(){return(0,u.jsx)(He,{})}export{Ht as SceneFace,Bt as SceneKeeping};
@@ -1 +1 @@
1
- import{B as O}from"./chunk.5ZMENPY4.js";var k=3,A=k+1,P=A+1,z=(o,r)=>o<r?-1:o>r?1:0;function L(o){return(o??0)>4?k:2}function N(o,r,a){let n=[];for(let d of Object.values(o.tryDefinition(r)?.edges??{}))if(d.to!=="*")for(let i of d.to)i!==r&&a.includes(i)&&!n.includes(i)&&n.push(i);return n}function W(o,r={}){let a=[...o.kinds],n=[...(r.order??[]).filter(e=>a.includes(e)),...a.filter(e=>!(r.order??[]).includes(e)).sort(z)].filter((e,t,s)=>s.indexOf(e)===t),d=e=>n.indexOf(e),i=new Map,g=[],h=(e,t,s)=>{i.set(e,{col:t,row:s,side:L(r.counts?.[e])}),g.push({col:t,row:s})};for(let e of n){let t=o.tryDefinition(e)?.plot??r.plots?.[e];t&&h(e,t.col,t.row)}let l=new Map(n.map(e=>[e,N(o,e,a)])),b=new Set(n.filter(e=>l.get(e).length>0||n.some(t=>l.get(t).includes(e)))),v=new Map,C=new Set,D=e=>{let t=v.get(e);if(t!==void 0)return t;if(C.has(e))return-1;C.add(e);let s=0;for(let c of l.get(e))s=Math.max(s,D(c)+1);return C.delete(e),v.set(e,s),s};for(let e of n)b.has(e)&&D(e);let f=[];for(let e of n)b.has(e)&&(f[v.get(e)]??=[]).push(e);let I=new Map,T=Math.max(1,Math.ceil(Math.sqrt(f.length))),H=Math.max(1,...f.map(e=>e?.length??0)),w=Math.max(P,Math.round(r.pitch??P)),R=(e,t)=>r.upright?{col:e%T*w,row:(Math.floor(e/T)*(H+1)+t)*w}:{col:t*w,row:e===0?0:-e*w},$=e=>!g.some(t=>V(t,e)),S=(e,t,s)=>{let c=s;for(;!$(R(t,c))&&c<s+64;)c++;return i.has(e)||h(e,R(t,c).col,R(t,c).row),c},x=0;f.forEach((e=[],t)=>{let s=u=>{let m=l.get(u).map(p=>I.get(p)).filter(p=>p!==void 0);return m.length>0?m.reduce((p,q)=>p+q,0)/m.length:1/0},c=[...e].sort((u,m)=>s(u)-s(m)||d(u)-d(m)),y=0;for(let u of c)i.has(u)||(y=S(u,t,y),I.set(u,y),x=Math.max(x,y+1),y++)});let j=n.filter(e=>!b.has(e)&&!i.has(e)),M=Math.max(r.upright?x:f.length,Math.ceil(Math.sqrt(j.length*2)),1),E=b.size>0?1:0;return j.forEach((e,t)=>{r.upright?S(e,f.length+E+Math.floor(t/M),t%M):S(e,t%M,x+E+Math.floor(t/M))}),i}function V(o,r){return Math.abs(o.col-r.col)<A&&Math.abs(o.row-r.row)<A}function X(o,r,a,n=.5){return{x:(o-r)*a/2,y:(o+r)*a*n/2}}var G=1,B=/^(done|completed?|closed|finished|shipped|sent|won|lost|passed|declined|dropped|answered|resolved|fixed|archived|cancell?ed|retired|released|published|delivered|paid|merged|rejected|written[-_ ]?up|out)$/i,F=/^(doing|in[-_ ]?progress|active|building|started|working|in[-_ ]?review|review(ing)?|fixing|ongoing|underway|testing|drafting|writing|running)$/i;function _(o,r,a){let n=O(o.tryDefinition(r)?.fields.shape?.[a]);for(;n&&n.innerType!==void 0&&n.type!=="enum";)n=O(n.innerType);if(n?.type!=="enum")return;let d=(n.entries?Object.values(n.entries):n.values??[]).filter(i=>typeof i=="string");return d.length>0?d:void 0}function J(o,r){let a=o.tryDefinition(r);if(!a)return;let n=a.lifecycle,d=Object.keys(a.fields.shape??{}),i=[n?.field,...d.filter(l=>/^(status|stage|state|phase)$/i.test(l))].find(l=>l!==void 0&&_(o,r,l)!==void 0);if(!i)return;let g=_(o,r,i),h=n?.field===i&&Array.isArray(n.retired)?n.retired:[];return{field:i,values:g,tiers:g.map(l=>h.includes(l)||B.test(l)?"done":F.test(l)?"active":"waiting")}}export{P as a,W as b,X as c,G as d,J as e};
1
+ import{B as O}from"./chunk.V5MYKNL7.js";var k=3,A=k+1,P=A+1,z=(o,r)=>o<r?-1:o>r?1:0;function L(o){return(o??0)>4?k:2}function N(o,r,a){let n=[];for(let d of Object.values(o.tryDefinition(r)?.edges??{}))if(d.to!=="*")for(let i of d.to)i!==r&&a.includes(i)&&!n.includes(i)&&n.push(i);return n}function W(o,r={}){let a=[...o.kinds],n=[...(r.order??[]).filter(e=>a.includes(e)),...a.filter(e=>!(r.order??[]).includes(e)).sort(z)].filter((e,t,s)=>s.indexOf(e)===t),d=e=>n.indexOf(e),i=new Map,g=[],h=(e,t,s)=>{i.set(e,{col:t,row:s,side:L(r.counts?.[e])}),g.push({col:t,row:s})};for(let e of n){let t=o.tryDefinition(e)?.plot??r.plots?.[e];t&&h(e,t.col,t.row)}let l=new Map(n.map(e=>[e,N(o,e,a)])),b=new Set(n.filter(e=>l.get(e).length>0||n.some(t=>l.get(t).includes(e)))),v=new Map,C=new Set,D=e=>{let t=v.get(e);if(t!==void 0)return t;if(C.has(e))return-1;C.add(e);let s=0;for(let c of l.get(e))s=Math.max(s,D(c)+1);return C.delete(e),v.set(e,s),s};for(let e of n)b.has(e)&&D(e);let f=[];for(let e of n)b.has(e)&&(f[v.get(e)]??=[]).push(e);let I=new Map,T=Math.max(1,Math.ceil(Math.sqrt(f.length))),H=Math.max(1,...f.map(e=>e?.length??0)),w=Math.max(P,Math.round(r.pitch??P)),R=(e,t)=>r.upright?{col:e%T*w,row:(Math.floor(e/T)*(H+1)+t)*w}:{col:t*w,row:e===0?0:-e*w},$=e=>!g.some(t=>V(t,e)),S=(e,t,s)=>{let c=s;for(;!$(R(t,c))&&c<s+64;)c++;return i.has(e)||h(e,R(t,c).col,R(t,c).row),c},x=0;f.forEach((e=[],t)=>{let s=u=>{let m=l.get(u).map(p=>I.get(p)).filter(p=>p!==void 0);return m.length>0?m.reduce((p,q)=>p+q,0)/m.length:1/0},c=[...e].sort((u,m)=>s(u)-s(m)||d(u)-d(m)),y=0;for(let u of c)i.has(u)||(y=S(u,t,y),I.set(u,y),x=Math.max(x,y+1),y++)});let j=n.filter(e=>!b.has(e)&&!i.has(e)),M=Math.max(r.upright?x:f.length,Math.ceil(Math.sqrt(j.length*2)),1),E=b.size>0?1:0;return j.forEach((e,t)=>{r.upright?S(e,f.length+E+Math.floor(t/M),t%M):S(e,t%M,x+E+Math.floor(t/M))}),i}function V(o,r){return Math.abs(o.col-r.col)<A&&Math.abs(o.row-r.row)<A}function X(o,r,a,n=.5){return{x:(o-r)*a/2,y:(o+r)*a*n/2}}var G=1,B=/^(done|completed?|closed|finished|shipped|sent|won|lost|passed|declined|dropped|answered|resolved|fixed|archived|cancell?ed|retired|released|published|delivered|paid|merged|rejected|written[-_ ]?up|out)$/i,F=/^(doing|in[-_ ]?progress|active|building|started|working|in[-_ ]?review|review(ing)?|fixing|ongoing|underway|testing|drafting|writing|running)$/i;function _(o,r,a){let n=O(o.tryDefinition(r)?.fields.shape?.[a]);for(;n&&n.innerType!==void 0&&n.type!=="enum";)n=O(n.innerType);if(n?.type!=="enum")return;let d=(n.entries?Object.values(n.entries):n.values??[]).filter(i=>typeof i=="string");return d.length>0?d:void 0}function J(o,r){let a=o.tryDefinition(r);if(!a)return;let n=a.lifecycle,d=Object.keys(a.fields.shape??{}),i=[n?.field,...d.filter(l=>/^(status|stage|state|phase)$/i.test(l))].find(l=>l!==void 0&&_(o,r,l)!==void 0);if(!i)return;let g=_(o,r,i),h=n?.field===i&&Array.isArray(n.retired)?n.retired:[];return{field:i,values:g,tiers:g.map(l=>h.includes(l)||B.test(l)?"done":F.test(l)?"active":"waiting")}}export{P as a,W as b,X as c,G as d,J as e};
@@ -1 +1 @@
1
- import{a as L}from"./chunk.4BBJ62ZO.js";import{a as ae,b as ie,c as de,d as se,e as M,f as V,g as le}from"./chunk.UCZR33MK.js";import{a as ue}from"./chunk.CC47O2DW.js";import{c as G,e as oe}from"./chunk.2IX3CZNP.js";import{a as j,b as Q,c as ee,d as ne,f as E,m as re,n as b,o as te,p as B}from"./chunk.6DHHUBSC.js";import{b as v,d as ye,e as fe,g as pe,h as me,i as ce}from"./chunk.Z7JRBKA7.js";import{Aa as J,Ab as Y,B as x,Bb as q,Cb as C,H as W,Q as H,T as P,Z as K,ba as X,ia as F,ka as Z,oa as T,pa as A,qa as z,ra as O,sa as N}from"./chunk.5ZMENPY4.js";var ge=e=>e.caption?.trim()||e.name,_=e=>A(e)?`${ge(e)}, ${z(e)}`:ge(e);function Ye(e){let n=Math.max(0,Math.round(e)),o=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),t=Math.floor(n%3600/60);return r>0?`${r}:${o(t)}:${o(n%60)}`:`${t}:${o(n%60)}`}function Ee(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(o=>{let r=x(n[o]);for(;r?.innerType;)r=x(r.innerType);return N(n[o])!==void 0||r?.type==="array"&&N(r.element)!==void 0})}function qe(e,n){for(let o of Ee(n)){let r=O(e[o]).find(t=>T(t)||A(t));if(r)return r}}var R=e=>{try{return e()}catch{return null}},Re=e=>typeof e=="string"&&ae.includes(e);function Be(e){if(e!==void 0)return Re(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:R(()=>G(e.expr))}:"neutral"}var ve=4;function xe(e){let n=typeof e.list=="string"?R(()=>G(e.list)):null,o=e.sort,r=typeof o=="string"?o:o&&typeof o=="object"&&typeof o.by=="string"?o.by:void 0,t=o&&typeof o=="object"?o.direction:void 0,a=n,d;if(n&&r!==void 0)if(t==="choices")d=r;else{let f=R(()=>G(r));a=f?{t:"call",fn:"sort",args:[n,f,{t:"lit",value:t==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,M):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,y=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(y).filter(f=>typeof f[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function he(e,n=1,o=""){if(!Array.isArray(e)||n>ve)return[];let r={};return e.flatMap(t=>{if(!t||typeof t!="object"||Array.isArray(t))return[];let a=t,d=p=>typeof p=="string"?R(()=>oe(p)):null,l=p=>typeof p=="string"?R(()=>G(p)):null,i=Be(a.tone),s=typeof a.label=="string"?a.label:void 0,y=p=>Object.hasOwn(a,p),f=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=y("list")?"list":y("headline")?"headline":typeof a.figure=="string"?"number":Pe.find(y);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,S=typeof c=="string"&&c?c:`${o}${u}.${m}`;return[{...(()=>{switch(u){case"list":return xe(a);case"number":{let p=de.includes(a.as)?a.as:void 0,U=se.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...f?{currency:f}:{},...s?{label:d(s)}:{},...U?{emphasis:U}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=ie.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...f?{currency:f}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:he(a.group,n+1,`${S}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:he(a.show,n+1,`${S}.`)};default:return{t:u}}})(),key:S}]})}var Pe=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Fe=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:E(e,{graph:n.graph??re,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Fe})}}catch(o){return{ok:!1,problem:o instanceof Error?o.message:String(o)}}}var Ne=(e,n,o)=>!e.format&&e.expr?.t==="ident"&&typeof o=="string"&&n.fields[e.expr.name]?.format==="markdown";function k(e,n,o){if(!e)return{text:g,problem:"a template that does not parse"};let r,t;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(Ne(d,n,l.value))return n.glance?ye(l.value,{markdown:!0}):o&&e.length===1?(t=!0,l.value):fe(l.value);let i=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Oe(n,d.expr.name):void 0;return te(d,i?C(l.value,i):b(l.value,d.format,n.today,d.formatArgs,n.money,B(n.schema)))}).join(""),...r?{problem:r}:{},...t?{markdown:t}:{}}}function be(e,n){if(e===void 0)return;if(typeof e=="string")return e;let o=w(e.expr,n);return o.ok&&Re(o.value)?o.value:"neutral"}function Ce(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var Ae=(e,n)=>{let o=e.fields[n]?.type;return o==="phone"||o==="place"||o==="duration"?o:pe(e.definition,n)},Oe=(e,n)=>Y(e.definition?.fields?.shape?.[n]);function Me(e,n,o,r,t){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,o.today,[],t?{...o.money,currency:t}:o.money);let a=o.fields[e];if(o.definition?.display?.format?.[e])return v(o.definition,e,n);let d=me(Ae(o,e),n,o.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",o.today,[],o.money);if(a?.type==="datetime"&&typeof n=="string")return H(n,o.money?.locale,o.money?.timeZone);if(a?.type==="enum"&&typeof n=="string")return v(o.definition,e,n);let l=typeof n=="number"?Oe(o,e):void 0;if(l)return C(n,l);if(typeof n=="number")return P(n,o.money?.locale,{});let i=O(n);return i[0]?i.map(_).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ve(e,n,o,r,t){return typeof e!="number"?String(e):n==="money"?q(e,o?{...t,currency:o}:t):n==="percent"?b(e,n,r,[],t):P(e,t?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function we(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function Le(e,n,o){switch(e.t){case"title":{let r=k(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=k(e.parts,n,!0),t=be(e.tone,n);return h({t:"text",text:r.text,...t?{tone:t}:{},...r.markdown?{markdown:r.markdown}:{}},r.problem)}case"badge":{let r=k(e.parts,n);return h({t:"badge",text:r.text,tone:be(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??F(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let t=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(t){let f=J(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,t);return{t:"field",field:e.field,label:r,text:f.length>0?"linked record":g,...f.length>0?{linked:{relation:t,refs:f}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let f=w({t:"ident",name:e.field,at:0},n);f.ok?d=f.value!==null&&typeof f.value=="object"?b(f.value,void 0,n.today,[],n.money,B(n.schema)):f.value:l=f.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?Ce(d):ce(Ae(n,e.field),d),s=R(()=>Me(e.field,d,n,e.as,e.currency))??g,y=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...y?{app:y}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),t=e.as==="gallery"?r:r.filter(a=>T(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??F(n.definition,e.field),as:e.as,files:t,text:t.map(_).join(", ")||g}}case"progress":{let r=w(e.value,n),t=w(e.max,n),a=e.label?k(e.label,n):{text:"Progress"},d=a.text,l=r.ok?t.ok?a.problem:t.problem:r.problem;return r.ok&&t.ok&&typeof r.value=="number"&&typeof t.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(t.value)&&t.value>0?h({t:"progress",label:d,value:r.value,max:t.value,text:`${b(r.value,void 0,n.today)} of ${b(t.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:Se(e.blocks,we(n))};case"when":{let r=w(e.when,n),t=r.ok&&r.value===!0;return h({t:"when",shown:t,blocks:t?Se(e.show,we(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=k(e.parts,n),t=Math.min(6,Math.max(1,(o?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:t,text:r.text},r.problem)}case"number":{let r=w(e.value,n),t=!r.ok||r.value===null||typeof r.value=="object"?g:Ve(r.value,e.as,e.currency,n.today,n.money),a=e.label?k(e.label,n):void 0;return h({t:"number",text:t,...a?{label:a.text}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Ie(e,n)}}function Se(e,n){let o=e.findIndex(r=>r.t==="headline");return e.map((r,t)=>({...Le(r,n,t===o),key:r.key}))}var _e=new Set(["every","some","sum","min","max","sort"]);function wn(e,n){let o=new Set,r=new Set,t=i=>{if(i)switch(i.t){case"ident":o.add(i.name);return;case"list":i.items.forEach(t);return;case"member":return t(i.object);case"unary":return t(i.operand);case"binary":return t(i.left),t(i.right);case"where":return t(i.set);case"call":i.args.forEach((s,y)=>{y===1&&_e.has(i.fn)||t(s)});return;default:return}},a=i=>{for(let s of i??[])t(s.expr)},d=(i,s)=>{i.forEach((y,f)=>{let u=s[f];if(u)switch(y.t){case"field":case"image":o.add(y.field);return;case"title":case"text":case"badge":case"headline":a(y.parts);return;case"number":t(y.value),a(y.label);return;case"progress":t(y.value),t(y.max);return;case"group":u.t==="group"&&d(y.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(y.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:o,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Ie(e,n){let o=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:o,more:0,problem:r.problem};let t=r.value,a=t instanceof j?t.nodes:t!==null&&typeof t=="object"&&!Array.isArray(t)?[t]:[];e.choiceOrder&&n.schema&&(a=De(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??M),i=l.slice(0,V),s=l.slice(V),y=(e.limit===void 0?d:l.length)-i.length,f=c=>e.group&&n.schema&&c.length>0?$e(c,e.group,n.schema,n.graph):void 0,u=f(i),m=s.length>0?f(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:o,...i.length===0&&e.empty?{empty:e.empty}:{},more:y,total:d}}function I(e,n,o){let r=e.tryDefinition(n)?.fields?.shape,t=r&&Object.hasOwn(r,o)?L(r[o]):void 0;return t?.type==="enum"?t.options??[]:[]}var D=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function De(e,n,o){let r=t=>{let a=I(o,t.kind,n).indexOf(String(D(t,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((t,a)=>({node:t,i:a,rank:r(t)})).sort((t,a)=>t.rank-a.rank||t.i-a.i).map(t=>t.node)}function $e(e,n,o,r){let t=e.some(i=>I(o,i.kind,n.by).length>0)?void 0:le(n.by);if(t&&r)return Ue(e,t,n.headings,o,r);let a=[];for(let i of e)for(let s of I(o,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(f=>D(f,n.by)===i);if(s.length===0)continue;let y=o.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??K(v(y,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String(D(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function Ue(e,n,o,r,t){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=B(r),s;for(let u of e){let m=a(u)==="out"?t.out(u.id,n.edge):t.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let S=d.get(c.id)??{node:c,members:[]};S.members.push(u),d.set(c.id,S)}}let y=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:o[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let f=s&&s!=="*"?Z(r.tryDefinition(s),s):void 0;return l.length>0&&y.push({value:null,...f?{heading:`No ${f}`}:{},members:l}),y}function ke(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(ke):e.t==="when"?e.show.some(ke):!1}function je(e,n){let o=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[t,a]of Object.entries(o)){let d=L(a);d&&(r[t]=d)}return r}var Ge=new WeakMap;function $(e){let n=Ge.get(e);return n||Ge.set(e,n=ue(e)),n}function We(e,n,o,r={}){let t=$(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:X(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of t.get(o?o.kind:ee)?.computed??[])try{let y=[],f=E(s,{graph:n,subject:o,kinds:t,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>y.push(u)});y.length>0&&(f===null||f instanceof j&&f.nodes.length===0)?d[i]=Q(y[0]):a[i]=l(f)}catch(y){if(!(y instanceof ne))throw y;d[i]=y.sentence}return{values:a,refused:d}}function On(e,n,o){let{values:r}=We(e,n,o);if(Object.keys(r).length===0)return o;let t=a=>Array.isArray(a)?a.map(t):a!==null&&typeof a=="object"?a.label:a;return{...o,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,t(d)]))}}var He=500,Ke=2e4,Te=new WeakMap;function Xe(e,n){let o=Te.get(e);o||Te.set(e,o=new Map);let r=o.get(n);return r||o.set(n,r=je(e,n)),r}function Bn(e,n,o,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let t=n?e.seenBy(n):e,a=n&&o?t.graph.getNode(o.id)??null:o,d=t.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:y}=r;return{node:a,graph:t.graph,schema:d,kinds:$(d),fields:a?Xe(d,a.kind):{},definition:l||void 0,today:r.today??t.today?.()??W(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:y,budget:r.budget??(i?Ke:He),...i?{}:{glance:!0}}}export{ge as a,Ye as b,Ee as c,qe as d,he as e,Se as f,wn as g,ke as h,We as i,On as j,Bn as k};
1
+ import{a as L}from"./chunk.I7XSDXQ3.js";import{a as ae,b as ie,c as de,d as se,e as M,f as V,g as le}from"./chunk.UHI3D7JC.js";import{a as ue}from"./chunk.WVDKYUF3.js";import{c as G,e as oe}from"./chunk.ZHLQWMV5.js";import{a as j,b as Q,c as ee,d as ne,f as E,m as re,n as b,o as te,p as B}from"./chunk.TNESS3LQ.js";import{b as v,d as ye,e as fe,g as pe,h as me,i as ce}from"./chunk.2RVUDRRY.js";import{B as x,Ba as J,Bb as Y,Cb as q,Db as C,H as W,Q as H,T as P,Z as K,ba as X,ia as F,ka as Z,pa as T,qa as A,ra as z,sa as O,ta as N}from"./chunk.V5MYKNL7.js";var ge=e=>e.caption?.trim()||e.name,_=e=>A(e)?`${ge(e)}, ${z(e)}`:ge(e);function Ye(e){let n=Math.max(0,Math.round(e)),o=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),t=Math.floor(n%3600/60);return r>0?`${r}:${o(t)}:${o(n%60)}`:`${t}:${o(n%60)}`}function Ee(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(o=>{let r=x(n[o]);for(;r?.innerType;)r=x(r.innerType);return N(n[o])!==void 0||r?.type==="array"&&N(r.element)!==void 0})}function qe(e,n){for(let o of Ee(n)){let r=O(e[o]).find(t=>T(t)||A(t));if(r)return r}}var R=e=>{try{return e()}catch{return null}},Re=e=>typeof e=="string"&&ae.includes(e);function Be(e){if(e!==void 0)return Re(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:R(()=>G(e.expr))}:"neutral"}var ve=4;function xe(e){let n=typeof e.list=="string"?R(()=>G(e.list)):null,o=e.sort,r=typeof o=="string"?o:o&&typeof o=="object"&&typeof o.by=="string"?o.by:void 0,t=o&&typeof o=="object"?o.direction:void 0,a=n,d;if(n&&r!==void 0)if(t==="choices")d=r;else{let f=R(()=>G(r));a=f?{t:"call",fn:"sort",args:[n,f,{t:"lit",value:t==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,M):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,y=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(y).filter(f=>typeof f[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function he(e,n=1,o=""){if(!Array.isArray(e)||n>ve)return[];let r={};return e.flatMap(t=>{if(!t||typeof t!="object"||Array.isArray(t))return[];let a=t,d=p=>typeof p=="string"?R(()=>oe(p)):null,l=p=>typeof p=="string"?R(()=>G(p)):null,i=Be(a.tone),s=typeof a.label=="string"?a.label:void 0,y=p=>Object.hasOwn(a,p),f=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=y("list")?"list":y("headline")?"headline":typeof a.figure=="string"?"number":Pe.find(y);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,S=typeof c=="string"&&c?c:`${o}${u}.${m}`;return[{...(()=>{switch(u){case"list":return xe(a);case"number":{let p=de.includes(a.as)?a.as:void 0,U=se.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...f?{currency:f}:{},...s?{label:d(s)}:{},...U?{emphasis:U}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=ie.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...f?{currency:f}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:he(a.group,n+1,`${S}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:he(a.show,n+1,`${S}.`)};default:return{t:u}}})(),key:S}]})}var Pe=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Fe=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:E(e,{graph:n.graph??re,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Fe})}}catch(o){return{ok:!1,problem:o instanceof Error?o.message:String(o)}}}var Ne=(e,n,o)=>!e.format&&e.expr?.t==="ident"&&typeof o=="string"&&n.fields[e.expr.name]?.format==="markdown";function k(e,n,o){if(!e)return{text:g,problem:"a template that does not parse"};let r,t;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(Ne(d,n,l.value))return n.glance?ye(l.value,{markdown:!0}):o&&e.length===1?(t=!0,l.value):fe(l.value);let i=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Oe(n,d.expr.name):void 0;return te(d,i?C(l.value,i):b(l.value,d.format,n.today,d.formatArgs,n.money,B(n.schema)))}).join(""),...r?{problem:r}:{},...t?{markdown:t}:{}}}function be(e,n){if(e===void 0)return;if(typeof e=="string")return e;let o=w(e.expr,n);return o.ok&&Re(o.value)?o.value:"neutral"}function Ce(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var Ae=(e,n)=>{let o=e.fields[n]?.type;return o==="phone"||o==="place"||o==="duration"?o:pe(e.definition,n)},Oe=(e,n)=>Y(e.definition?.fields?.shape?.[n]);function Me(e,n,o,r,t){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,o.today,[],t?{...o.money,currency:t}:o.money);let a=o.fields[e];if(o.definition?.display?.format?.[e])return v(o.definition,e,n);let d=me(Ae(o,e),n,o.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",o.today,[],o.money);if(a?.type==="datetime"&&typeof n=="string")return H(n,o.money?.locale,o.money?.timeZone);if(a?.type==="enum"&&typeof n=="string")return v(o.definition,e,n);let l=typeof n=="number"?Oe(o,e):void 0;if(l)return C(n,l);if(typeof n=="number")return P(n,o.money?.locale,{});let i=O(n);return i[0]?i.map(_).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ve(e,n,o,r,t){return typeof e!="number"?String(e):n==="money"?q(e,o?{...t,currency:o}:t):n==="percent"?b(e,n,r,[],t):P(e,t?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function we(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function Le(e,n,o){switch(e.t){case"title":{let r=k(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=k(e.parts,n,!0),t=be(e.tone,n);return h({t:"text",text:r.text,...t?{tone:t}:{},...r.markdown?{markdown:r.markdown}:{}},r.problem)}case"badge":{let r=k(e.parts,n);return h({t:"badge",text:r.text,tone:be(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??F(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let t=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(t){let f=J(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,t);return{t:"field",field:e.field,label:r,text:f.length>0?"linked record":g,...f.length>0?{linked:{relation:t,refs:f}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let f=w({t:"ident",name:e.field,at:0},n);f.ok?d=f.value!==null&&typeof f.value=="object"?b(f.value,void 0,n.today,[],n.money,B(n.schema)):f.value:l=f.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?Ce(d):ce(Ae(n,e.field),d),s=R(()=>Me(e.field,d,n,e.as,e.currency))??g,y=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...y?{app:y}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),t=e.as==="gallery"?r:r.filter(a=>T(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??F(n.definition,e.field),as:e.as,files:t,text:t.map(_).join(", ")||g}}case"progress":{let r=w(e.value,n),t=w(e.max,n),a=e.label?k(e.label,n):{text:"Progress"},d=a.text,l=r.ok?t.ok?a.problem:t.problem:r.problem;return r.ok&&t.ok&&typeof r.value=="number"&&typeof t.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(t.value)&&t.value>0?h({t:"progress",label:d,value:r.value,max:t.value,text:`${b(r.value,void 0,n.today)} of ${b(t.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:Se(e.blocks,we(n))};case"when":{let r=w(e.when,n),t=r.ok&&r.value===!0;return h({t:"when",shown:t,blocks:t?Se(e.show,we(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=k(e.parts,n),t=Math.min(6,Math.max(1,(o?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:t,text:r.text},r.problem)}case"number":{let r=w(e.value,n),t=!r.ok||r.value===null||typeof r.value=="object"?g:Ve(r.value,e.as,e.currency,n.today,n.money),a=e.label?k(e.label,n):void 0;return h({t:"number",text:t,...a?{label:a.text}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Ie(e,n)}}function Se(e,n){let o=e.findIndex(r=>r.t==="headline");return e.map((r,t)=>({...Le(r,n,t===o),key:r.key}))}var _e=new Set(["every","some","sum","min","max","sort"]);function wn(e,n){let o=new Set,r=new Set,t=i=>{if(i)switch(i.t){case"ident":o.add(i.name);return;case"list":i.items.forEach(t);return;case"member":return t(i.object);case"unary":return t(i.operand);case"binary":return t(i.left),t(i.right);case"where":return t(i.set);case"call":i.args.forEach((s,y)=>{y===1&&_e.has(i.fn)||t(s)});return;default:return}},a=i=>{for(let s of i??[])t(s.expr)},d=(i,s)=>{i.forEach((y,f)=>{let u=s[f];if(u)switch(y.t){case"field":case"image":o.add(y.field);return;case"title":case"text":case"badge":case"headline":a(y.parts);return;case"number":t(y.value),a(y.label);return;case"progress":t(y.value),t(y.max);return;case"group":u.t==="group"&&d(y.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(y.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:o,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Ie(e,n){let o=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:o,more:0,problem:r.problem};let t=r.value,a=t instanceof j?t.nodes:t!==null&&typeof t=="object"&&!Array.isArray(t)?[t]:[];e.choiceOrder&&n.schema&&(a=De(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??M),i=l.slice(0,V),s=l.slice(V),y=(e.limit===void 0?d:l.length)-i.length,f=c=>e.group&&n.schema&&c.length>0?$e(c,e.group,n.schema,n.graph):void 0,u=f(i),m=s.length>0?f(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:o,...i.length===0&&e.empty?{empty:e.empty}:{},more:y,total:d}}function I(e,n,o){let r=e.tryDefinition(n)?.fields?.shape,t=r&&Object.hasOwn(r,o)?L(r[o]):void 0;return t?.type==="enum"?t.options??[]:[]}var D=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function De(e,n,o){let r=t=>{let a=I(o,t.kind,n).indexOf(String(D(t,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((t,a)=>({node:t,i:a,rank:r(t)})).sort((t,a)=>t.rank-a.rank||t.i-a.i).map(t=>t.node)}function $e(e,n,o,r){let t=e.some(i=>I(o,i.kind,n.by).length>0)?void 0:le(n.by);if(t&&r)return Ue(e,t,n.headings,o,r);let a=[];for(let i of e)for(let s of I(o,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(f=>D(f,n.by)===i);if(s.length===0)continue;let y=o.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??K(v(y,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String(D(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function Ue(e,n,o,r,t){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=B(r),s;for(let u of e){let m=a(u)==="out"?t.out(u.id,n.edge):t.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let S=d.get(c.id)??{node:c,members:[]};S.members.push(u),d.set(c.id,S)}}let y=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:o[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let f=s&&s!=="*"?Z(r.tryDefinition(s),s):void 0;return l.length>0&&y.push({value:null,...f?{heading:`No ${f}`}:{},members:l}),y}function ke(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(ke):e.t==="when"?e.show.some(ke):!1}function je(e,n){let o=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[t,a]of Object.entries(o)){let d=L(a);d&&(r[t]=d)}return r}var Ge=new WeakMap;function $(e){let n=Ge.get(e);return n||Ge.set(e,n=ue(e)),n}function We(e,n,o,r={}){let t=$(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:X(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of t.get(o?o.kind:ee)?.computed??[])try{let y=[],f=E(s,{graph:n,subject:o,kinds:t,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>y.push(u)});y.length>0&&(f===null||f instanceof j&&f.nodes.length===0)?d[i]=Q(y[0]):a[i]=l(f)}catch(y){if(!(y instanceof ne))throw y;d[i]=y.sentence}return{values:a,refused:d}}function On(e,n,o){let{values:r}=We(e,n,o);if(Object.keys(r).length===0)return o;let t=a=>Array.isArray(a)?a.map(t):a!==null&&typeof a=="object"?a.label:a;return{...o,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,t(d)]))}}var He=500,Ke=2e4,Te=new WeakMap;function Xe(e,n){let o=Te.get(e);o||Te.set(e,o=new Map);let r=o.get(n);return r||o.set(n,r=je(e,n)),r}function Bn(e,n,o,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let t=n?e.seenBy(n):e,a=n&&o?t.graph.getNode(o.id)??null:o,d=t.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:y}=r;return{node:a,graph:t.graph,schema:d,kinds:$(d),fields:a?Xe(d,a.kind):{},definition:l||void 0,today:r.today??t.today?.()??W(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:y,budget:r.budget??(i?Ke:He),...i?{}:{glance:!0}}}export{ge as a,Ye as b,Ee as c,qe as d,he as e,Se as f,wn as g,ke as h,We as i,On as j,Bn as k};
@@ -1 +1 @@
1
- import{a as I,b as H,c as T,e as D,h as V,i as R,j as A,k,l as x,n as Y,o as Z}from"./chunk.7EFNLMKU.js";import{b as U}from"./chunk.H5CZZZLX.js";import{H as C,N as G,Ta as F,W as M,Wa as B,ba as W,da as j}from"./chunk.5ZMENPY4.js";function re(e,r){return e===void 0||e===!0?!0:e===!1?!1:e[r]!==!1}function te(e){let r={};return e.query&&e.query.trim().length>0&&(r.q=e.query),e.archived!==void 0&&e.archived!==!1&&(r.archived=String(e.archived)),e.sort&&(r.sort=e.sort.direction==="desc"?`${e.sort.by}:desc`:e.sort.by),e.filter?.length&&(r.filter=e.filter.map(n=>`${n.key}:${n.value}`).join(",")),e.group&&(r.group=e.group.bucket?`${e.group.by}:${e.group.bucket}`:e.group.by),r}function ne(e,r){let n=[],s={};if(e.query&&(s.query=e.query),e.archived!==void 0&&e.archived!==!1&&(s.archived=e.archived),e.sort&&(r.sorts.some(u=>u.key===e.sort.by)?s.sort=e.sort:n.push(`sort ${e.sort.by}`)),e.filter){let u=e.filter.filter(c=>r.filters.find(f=>f.key===c.key)?!0:(n.push(`filter ${c.key}`),!1));u.length>0&&(s.filter=u)}return e.group&&(r.groups.some(u=>u.key===e.group.by)?s.group=e.group:n.push(`group ${e.group.by}`)),{arrangement:s,dropped:n}}function S(e,r){return W(e.schema.tryDefinition(r.kind),A(r))}var oe=(e,r)=>e==null?r==null?0:1:r==null?-1:typeof e=="number"&&typeof r=="number"?e-r:typeof e=="boolean"&&typeof r=="boolean"?e===r?0:e?1:-1:String(e).localeCompare(String(r),void 0,{numeric:!0,sensitivity:"base"});function ie(e,r,n){if(n==="label")return S(e,r);let s=e.schema.tryDefinition(r.kind);return s&&n in(s.fields.shape??{})?F(R(r),n,e.today??C()):s?.computed?.[n]!==void 0?e.read?.(r,n):k(e.graph,r.id,n).map(c=>S(e,c)).sort()[0]}var se=/^(\d{4})-(\d{2})-(\d{2})/;function _(e,r){let n=se.exec(e);if(!n)return;let[,s,u,c]=n;if(r==="day")return`${s}-${u}-${c}`;if(r==="month")return`${s}-${u}-01`;if(r==="year")return`${s}-01-01`;if(r==="decade")return`${String(Number(s)-Number(s)%10).padStart(4,"0")}-01-01`;let a=new Date(Date.UTC(Number(s),Number(u)-1,Number(c))),f=(a.getUTCDay()+6)%7;return a.setUTCDate(a.getUTCDate()-f),a.toISOString().slice(0,10)}function de(e,r){return r==="month"?M(e):r==="week"?`Week of ${G(e)}`:r==="year"?e.slice(0,4):r==="decade"?`The ${e.slice(0,4)}s`:G(e)}function ue(e,r,n){return z(e,n)(r)}function z(e,r){let{words:n,conditions:s}=Y(r);if(n.length===0&&s.length===0)return()=>!0;let u=new Map,c=a=>{let f=u.get(a);return f||(f=new Set(D(e.schema,a).filters.map(d=>d.key)),u.set(a,f)),f};return a=>{let f=c(a.kind),d=s.filter(i=>f.has(i.key));return d.every(i=>x(e,a,i))?n.length>0?Z(e.schema.tryDefinition(a.kind),A(a),n,e.searchIn)!==void 0:d.length>0:!1}}function ae(e,r,n){let s=r.query?.trim(),u=r.archived===void 0?e:e.filter(t=>B(t,r.archived)),c=s?u.filter(z(n,s)):u,a=r.filter?.length?c.filter(t=>r.filter.every(l=>x(n,t,l))):[...c],f=[];for(let t=r.sort;t&&f.length<4;t=t.then)f.push(t);let d=f.length>0?a.map((t,l)=>({node:t,index:l,values:f.map(o=>ie(n,t,o.by))})).sort((t,l)=>{for(let[o,p]of f.entries()){let[h,K]=[t.values[o],l.values[o]],v=oe(h,K),E=p.direction==="desc"&&v!==0&&h!==void 0&&K!==void 0?-v:v;if(E!==0)return E}return t.index-l.index}).map(t=>t.node):a,i=r.group;if(!i)return{nodes:d,groups:[{key:"",label:"",nodes:d}],grouped:!1};let y=new Map,g=(t,l,o)=>{let p=y.get(t)??{label:l,nodes:[]};p.nodes.push(o),y.set(t,p)},N=d[0],m=N?n.schema.tryDefinition(N.kind):void 0,O=m?.fields.shape??{},J=m?I(m,i.by):j(i.by),$=i.by in O,b=$?H(O[i.by]):void 0,X=T(n.schema,N?.kind??"").find(t=>t.key===i.by)?.label,L=$?`No ${J.toLowerCase()}`:`Without ${(X??j(i.by)).toLowerCase()}`,q=$?new Map:U([...new Map(d.flatMap(t=>k(n.graph,t.id,i.by)).map(t=>[t.id,t])).values()].map(A),t=>n.schema.tryDefinition(t));for(let t of d){if($){let o=F(R(t),i.by,n.today??C());if(o==null||o==="")g("",L,t);else if(b==="date"){let p=i.bucket??"day",h=_(String(o),p);h?g(h,de(h,p),t):g("",L,t)}else if(b==="boolean")g(o?"1":"0",o?"Yes":"No",t);else{let p=m?.display?.format?.[i.by];g(String(o),p?p(o):String(o),t)}continue}let l=k(n.graph,t.id,i.by).map(o=>({id:o.id,label:q.has(o.id)?`${S(n,o)} \xB7 ${q.get(o.id)}`:S(n,o)})).sort((o,p)=>o.label.localeCompare(p.label));l.length===0?g("",L,t):g(l.map(o=>o.id).join(","),l.map(o=>o.label).join(", "),t)}let w=b==="choice"?V(O[i.by]):void 0,ee=[...y.entries()].sort(([t,l],[o,p])=>t===""?1:o===""?-1:w?w.indexOf(t)-w.indexOf(o):b==="boolean"?o.localeCompare(t):b==="date"?t.localeCompare(o):l.label.localeCompare(p.label)).map(([t,l])=>({key:t,label:l.label,nodes:l.nodes}));return{nodes:d,groups:ee,grouped:!0}}function P(e){if(e===void 0)return;if(typeof e=="string")return{by:e,direction:"asc"};let r=e.then===void 0?void 0:typeof e.then=="string"?{by:e.then,direction:"asc"}:{by:e.then.by,direction:e.then.direction??"asc"};return{by:e.by,direction:e.direction??"asc",...r?{then:r}:{}}}function Q(e){if(e!==void 0)return typeof e=="string"?{by:e}:e}function fe(e){let r=P(e?.sort),n=Q(e?.group);if(!(!r&&!n))return{...r?{sort:r}:{},...n?{group:{by:n.by}}:{}}}var le=(e,r)=>r?e==="1"?"true":"false":e;function ce(e,r,n){let s=n.type==="boolean",u=s?["true","false"]:n.options??[],c=[...new Set([...(r.order??[]).filter(d=>u.includes(d)),...u])],a=r.closed??[],f=d=>{if(d.key==="")return[1,0];let i=le(d.key,s);if(a.includes(i))return[2,a.indexOf(i)];let y=c.indexOf(i);return[0,y<0?c.length:y]};return e.map((d,i)=>({group:d,at:i,rank:f(d)})).sort((d,i)=>d.rank[0]-i.rank[0]||d.rank[1]-i.rank[1]||d.at-i.at).map(({group:d,rank:i})=>({...d,closed:i[0]===2}))}export{Q as a,fe as b,ce as c,re as d,te as e,ne as f,ue as g,ae as h};
1
+ import{a as I,b as H,c as T,e as D,h as V,i as R,j as A,k,l as x,n as Y,o as Z}from"./chunk.67WWRC6Y.js";import{b as U}from"./chunk.UUBYFBPN.js";import{H as C,N as G,Ua as F,W as M,Xa as B,ba as W,da as j}from"./chunk.V5MYKNL7.js";function re(e,r){return e===void 0||e===!0?!0:e===!1?!1:e[r]!==!1}function te(e){let r={};return e.query&&e.query.trim().length>0&&(r.q=e.query),e.archived!==void 0&&e.archived!==!1&&(r.archived=String(e.archived)),e.sort&&(r.sort=e.sort.direction==="desc"?`${e.sort.by}:desc`:e.sort.by),e.filter?.length&&(r.filter=e.filter.map(n=>`${n.key}:${n.value}`).join(",")),e.group&&(r.group=e.group.bucket?`${e.group.by}:${e.group.bucket}`:e.group.by),r}function ne(e,r){let n=[],s={};if(e.query&&(s.query=e.query),e.archived!==void 0&&e.archived!==!1&&(s.archived=e.archived),e.sort&&(r.sorts.some(u=>u.key===e.sort.by)?s.sort=e.sort:n.push(`sort ${e.sort.by}`)),e.filter){let u=e.filter.filter(c=>r.filters.find(f=>f.key===c.key)?!0:(n.push(`filter ${c.key}`),!1));u.length>0&&(s.filter=u)}return e.group&&(r.groups.some(u=>u.key===e.group.by)?s.group=e.group:n.push(`group ${e.group.by}`)),{arrangement:s,dropped:n}}function S(e,r){return W(e.schema.tryDefinition(r.kind),A(r))}var oe=(e,r)=>e==null?r==null?0:1:r==null?-1:typeof e=="number"&&typeof r=="number"?e-r:typeof e=="boolean"&&typeof r=="boolean"?e===r?0:e?1:-1:String(e).localeCompare(String(r),void 0,{numeric:!0,sensitivity:"base"});function ie(e,r,n){if(n==="label")return S(e,r);let s=e.schema.tryDefinition(r.kind);return s&&n in(s.fields.shape??{})?F(R(r),n,e.today??C()):s?.computed?.[n]!==void 0?e.read?.(r,n):k(e.graph,r.id,n).map(c=>S(e,c)).sort()[0]}var se=/^(\d{4})-(\d{2})-(\d{2})/;function _(e,r){let n=se.exec(e);if(!n)return;let[,s,u,c]=n;if(r==="day")return`${s}-${u}-${c}`;if(r==="month")return`${s}-${u}-01`;if(r==="year")return`${s}-01-01`;if(r==="decade")return`${String(Number(s)-Number(s)%10).padStart(4,"0")}-01-01`;let a=new Date(Date.UTC(Number(s),Number(u)-1,Number(c))),f=(a.getUTCDay()+6)%7;return a.setUTCDate(a.getUTCDate()-f),a.toISOString().slice(0,10)}function de(e,r){return r==="month"?M(e):r==="week"?`Week of ${G(e)}`:r==="year"?e.slice(0,4):r==="decade"?`The ${e.slice(0,4)}s`:G(e)}function ue(e,r,n){return z(e,n)(r)}function z(e,r){let{words:n,conditions:s}=Y(r);if(n.length===0&&s.length===0)return()=>!0;let u=new Map,c=a=>{let f=u.get(a);return f||(f=new Set(D(e.schema,a).filters.map(d=>d.key)),u.set(a,f)),f};return a=>{let f=c(a.kind),d=s.filter(i=>f.has(i.key));return d.every(i=>x(e,a,i))?n.length>0?Z(e.schema.tryDefinition(a.kind),A(a),n,e.searchIn)!==void 0:d.length>0:!1}}function ae(e,r,n){let s=r.query?.trim(),u=r.archived===void 0?e:e.filter(t=>B(t,r.archived)),c=s?u.filter(z(n,s)):u,a=r.filter?.length?c.filter(t=>r.filter.every(l=>x(n,t,l))):[...c],f=[];for(let t=r.sort;t&&f.length<4;t=t.then)f.push(t);let d=f.length>0?a.map((t,l)=>({node:t,index:l,values:f.map(o=>ie(n,t,o.by))})).sort((t,l)=>{for(let[o,p]of f.entries()){let[h,K]=[t.values[o],l.values[o]],v=oe(h,K),E=p.direction==="desc"&&v!==0&&h!==void 0&&K!==void 0?-v:v;if(E!==0)return E}return t.index-l.index}).map(t=>t.node):a,i=r.group;if(!i)return{nodes:d,groups:[{key:"",label:"",nodes:d}],grouped:!1};let y=new Map,g=(t,l,o)=>{let p=y.get(t)??{label:l,nodes:[]};p.nodes.push(o),y.set(t,p)},N=d[0],m=N?n.schema.tryDefinition(N.kind):void 0,O=m?.fields.shape??{},J=m?I(m,i.by):j(i.by),$=i.by in O,b=$?H(O[i.by]):void 0,X=T(n.schema,N?.kind??"").find(t=>t.key===i.by)?.label,L=$?`No ${J.toLowerCase()}`:`Without ${(X??j(i.by)).toLowerCase()}`,q=$?new Map:U([...new Map(d.flatMap(t=>k(n.graph,t.id,i.by)).map(t=>[t.id,t])).values()].map(A),t=>n.schema.tryDefinition(t));for(let t of d){if($){let o=F(R(t),i.by,n.today??C());if(o==null||o==="")g("",L,t);else if(b==="date"){let p=i.bucket??"day",h=_(String(o),p);h?g(h,de(h,p),t):g("",L,t)}else if(b==="boolean")g(o?"1":"0",o?"Yes":"No",t);else{let p=m?.display?.format?.[i.by];g(String(o),p?p(o):String(o),t)}continue}let l=k(n.graph,t.id,i.by).map(o=>({id:o.id,label:q.has(o.id)?`${S(n,o)} \xB7 ${q.get(o.id)}`:S(n,o)})).sort((o,p)=>o.label.localeCompare(p.label));l.length===0?g("",L,t):g(l.map(o=>o.id).join(","),l.map(o=>o.label).join(", "),t)}let w=b==="choice"?V(O[i.by]):void 0,ee=[...y.entries()].sort(([t,l],[o,p])=>t===""?1:o===""?-1:w?w.indexOf(t)-w.indexOf(o):b==="boolean"?o.localeCompare(t):b==="date"?t.localeCompare(o):l.label.localeCompare(p.label)).map(([t,l])=>({key:t,label:l.label,nodes:l.nodes}));return{nodes:d,groups:ee,grouped:!0}}function P(e){if(e===void 0)return;if(typeof e=="string")return{by:e,direction:"asc"};let r=e.then===void 0?void 0:typeof e.then=="string"?{by:e.then,direction:"asc"}:{by:e.then.by,direction:e.then.direction??"asc"};return{by:e.by,direction:e.direction??"asc",...r?{then:r}:{}}}function Q(e){if(e!==void 0)return typeof e=="string"?{by:e}:e}function fe(e){let r=P(e?.sort),n=Q(e?.group);if(!(!r&&!n))return{...r?{sort:r}:{},...n?{group:{by:n.by}}:{}}}var le=(e,r)=>r?e==="1"?"true":"false":e;function ce(e,r,n){let s=n.type==="boolean",u=s?["true","false"]:n.options??[],c=[...new Set([...(r.order??[]).filter(d=>u.includes(d)),...u])],a=r.closed??[],f=d=>{if(d.key==="")return[1,0];let i=le(d.key,s);if(a.includes(i))return[2,a.indexOf(i)];let y=c.indexOf(i);return[0,y<0?c.length:y]};return e.map((d,i)=>({group:d,at:i,rank:f(d)})).sort((d,i)=>d.rank[0]-i.rank[0]||d.rank[1]-i.rank[1]||d.at-i.at).map(({group:d,rank:i})=>({...d,closed:i[0]===2}))}export{Q as a,fe as b,ce as c,re as d,te as e,ne as f,ue as g,ae as h};
@@ -0,0 +1 @@
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{G as k,R as n,ua as o}from"./chunk.FOQZADMA.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.N6MVK3KD.js","./chunk.I7XSDXQ3.js","./chunk.UHI3D7JC.js","./chunk.WVDKYUF3.js","./chunk.ZHLQWMV5.js","./chunk.TNESS3LQ.js","./chunk.GZHZLJBF.js","./chunk.42XSBKPO.js","./chunk.OJGHDWI6.js","./chunk.6FNMDAX5.js","./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.LLEFYJPJ.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.6J37UQKG.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.42XSBKPO.js","./chunk.OJGHDWI6.js","./chunk.6FNMDAX5.js","./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.LLEFYJPJ.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.CL2ZS5EQ.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.42XSBKPO.js","./chunk.OJGHDWI6.js","./chunk.6FNMDAX5.js","./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.LLEFYJPJ.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.H6XKMLDQ.js")))),E=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),W=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.2FLPDPEL.js","./chunk.UUBYFBPN.js","./chunk.2RVUDRRY.js","./chunk.LLEFYJPJ.js","./chunk.FOQZADMA.js","./chunk.SDO3U72B.js","./chunk.V5MYKNL7.js","./chunk.AJZBJBMO.js"]),import("./chunk.6AVZWLRF.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,E as d,W as e,M as f,N as g};
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk.XFZKP4IF.js";import"./chunk.Z5AB2DBF.js";import"./chunk.N6MVK3KD.js";import"./chunk.I7XSDXQ3.js";import"./chunk.UHI3D7JC.js";import"./chunk.WVDKYUF3.js";import"./chunk.ZHLQWMV5.js";import"./chunk.TNESS3LQ.js";import"./chunk.UUBYFBPN.js";import"./chunk.2RVUDRRY.js";import"./chunk.V5MYKNL7.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,i as describePlace,j as placeText,h as resolveFor,a as statusColumns};
@@ -1 +1 @@
1
- import{b as pt}from"./chunk.B7TB6YRZ.js";import{a as dt}from"./chunk.CC47O2DW.js";import{f as ct}from"./chunk.2IX3CZNP.js";import{a as C,f as q}from"./chunk.6DHHUBSC.js";import{$a as st,Cb as ut,E as Q,F as X,H as k,Jc as ft,N as G,Q as tt,S as nt,T as et,ba as _,bb as it,da as M,eb as lt,fa as rt,ia as ot,ka as at}from"./chunk.5ZMENPY4.js";import"./chunk.AJZBJBMO.js";function J(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let s=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!s}),n=r.as==="open"}return e}function D(t,e){return J(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Ot(t){return D(t,!1)}function Et(t){return D(t,!0)}function mt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function z(t){let e=u=>J(u).map(({part:o,space:a})=>({...o,space:a})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,s=u=>`${D(n,u)}${r?`, when ${D(r,u)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:s(!1),said:s(!0)}}function Pt(t,e=!1){return t.line?mt(t.line,e):t.message}var yt=60,O=t=>({text:t,as:"name"}),c=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},L=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},R=(t,e)=>({text:t,as:"op",said:e}),v={text:"(",as:"open"},w={text:")",as:"close"},N={text:"\u2014",as:"value",said:"empty"},V={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},Lt={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},ht=t=>t.t==="binary"&&t.op in V;function I(t){return t.length>1&&t[1]===t[1].toUpperCase()&&/[A-Z]/.test(t[1])?t:t.charAt(0).toLowerCase()+t.slice(1)}function bt(t){let{schema:e}=t,n=l=>l===null?void 0:e.tryDefinition(l),r=(l,m)=>{let g=n(l)?.edges;return g&&Object.hasOwn(g,m)?g[m]:void 0},s=(l,m)=>{let g=r(l,m)?.to;return Array.isArray(g)&&g.length===1?g[0]:null},u=(l,m)=>{let g=(e.edge(m)?.from??[]).filter(W=>{let K=r(W,m)?.to;return l===null||K==="*"||Array.isArray(K)&&K.includes(l)});return g.length===1?g[0]:null},o=(l,m)=>r(l,m)?M(m).toLowerCase():I(ot(n(l),m)),a=l=>I(rt(e,l)),d=l=>I(ct(e).get(l)?.label??M(l)),x=l=>I(at(n(l),l)),i=(l,m)=>{let g=l===null?void 0:t.formatOf?.(l,m);if(g?.format)return g;let W=t.said?.get(m);return W?{...g,format:W}:g},p=l=>_(e.tryDefinition(l.kind),l),h=t.money?.locale,y=(l,m)=>{if(l==null)return N;if(l instanceof C){if(l.nodes.length===0)return N;let A=l.nodes.slice(0,3).map(p),Y=l.nodes.length-A.length;return L(Y>0?`${A.join(", ")} and ${Y} more`:A.length>1?`${A.slice(0,-1).join(", ")} and ${A[A.length-1]}`:A[0])}if(Array.isArray(l))return L(`{${l.map(A=>y(A,m).text).join(", ")}}`,l.map(A=>y(A,m).text).join(" or "));if(typeof l=="object")return L(p(l));if(typeof l=="boolean")return L(l?"yes":"no");let g=m?.format??(m?i(m.kind,m.key):void 0);if(typeof l=="number")return L(g&&g.format!=="date"?ut(l,{...t.money,...g}):et(l,h));if(Q.test(l)||g?.format==="date")return L(G(nt(l,t.money?.timeZone)??l.slice(0,10),h));if(X.test(l))return L(tt(l,h,t.money?.timeZone));let W=m&&m.kind!==null?n(m.kind)?.display?.format?.[m.key]:void 0;if(W)return L(W(l));let K=l.length>yt?`${l.slice(0,yt-1).trimEnd()}\u2026`:l;return L(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test(K)?K.replace(/[-_]+/g," "):K)};return{definition:n,relation:r,farOf:s,nearOf:u,fieldName:o,plural:a,noun:x,factName:d,formatOf:i,valueWords:y,locale:h}}function P(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:E(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=E(t.args[0],e,n),s=t.args[1];if(s.t==="ident")return{kind:r,key:s.name};if(s.t==="lit"&&typeof s.value=="string")return{kind:r,key:s.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return P(t.left,e,n)??P(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return P(t.args[1],e,n)??P(t.args[2],e,n)}function E(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(E(t.object,e,n),t.name);case"where":return E(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?E(t.left,e,n):null;case"call":{let r=s=>{let u=t.args[s];return u?.t==="lit"&&typeof u.value=="string"?u.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(E(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(E(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?E(t.args[0],e,n):null}default:return null}}function j(t){return t.t==="binary"?t.op==="||"?U(t)?4:1:t.op==="&&"?2:t.op in V||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var $=t=>t.t==="lit",b=(t,e)=>t.t==="call"&&t.fn===e;function F(t,e){return t.t==="binary"&&t.op===e?[...F(t.left,e),...F(t.right,e)]:[t]}function U(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...F(t,"||"));let n,r=[];for(let s of e){if(s.t!=="binary"||s.op!=="=="||!$(s.right)||typeof s.right.value!="string"||n&&JSON.stringify(gt(n))!==JSON.stringify(gt(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var gt=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,o,a=e)=>j(u)<o?[v,...f(u,a,n),w]:f(u,a,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(u=>u.t==="lit"?u.value:null),r)];case"ident":return[O(n.fieldName(e,t.name))];case"member":{let u=b(t.object,"first")&&t.object.args[0]&&b(t.object.args[0],"all"),o=E(t.object,e,n);if(u&&o)return e!==null&&n.fieldName(e,t.name)===n.fieldName(o,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(o)}'s ${n.fieldName(o,t.name)}`)]:[O(n.fieldName(o,t.name))];let a=f(t.object,e,n),d=a[a.length-1];return a.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(o,t.name)}`)]:[...a,c("'s"),O(n.fieldName(o,t.name))]}case"unary":return t.op==="-"?[R("\u2212","minus"),...s(t.operand,7)]:T(t.operand,e,n);case"where":{let u=E(t.set,e,n),o=f(t.filter,u,n),a=o.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...a?[]:[c("with")],...j(t.filter)<=2?[v,...o,w]:o]}case"binary":return xt(t,e,n);case"call":return At(t,e,n)}}function T(t,e,n){return ht(t)?xt({...t,op:B[t.op]},e,n):b(t,"present")||b(t,"exists")?[...f(t.args[0],e,n),R("=","is"),N]:t.t==="ident"?[c("not"),O(n.fieldName(e,t.name))]:[c("not"),v,...f(t,e,n),w]}function xt(t,e,n){let r=(o,a)=>j(o)<a?[v,...f(o,e,n),w]:f(o,e,n);if(t.op==="&&"||t.op==="||"){let o=U(t);if(o){let d=P(o.subject,e,n);return[...f(o.subject,e,n),R("\u2208","is one of"),n.valueWords(o.values.map(x=>x.value),d)]}let a=t.op==="&&"?2:1;return[...r(t.left,a),c(t.op==="&&"?"and":"or"),...r(t.right,a+.5)]}if(t.op in V){if($(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?f(t.left,e,n):T(t.left,e,n);let[o,a]=V[t.op],d=P(t.left,e,n),x=P(t.right,e,n);return[...S(t.left,e,n,x),R(o,a),...S(t.right,e,n,d)]}if(t.op==="in")return[...r(t.left,5),R("\u2208","is one of"),...S(t.right,e,n,P(t.left,e,n))];let s=Lt[t.op];if(s){let o=j(t);return[...r(t.left,o),R(s[0],s[1]),...r(t.right,o+.5)]}let u={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),c(u[t.op]??t.op),...r(t.right,5)]}function S(t,e,n,r){return t.t==="lit"||t.t==="list"?f(t,e,n,r):j(t)<5?[v,...f(t,e,n),w]:f(t,e,n)}function At(t,e,n){let r=o=>t.args[o],s=o=>{let a=t.args[o];return a?.t==="lit"&&typeof a.value=="string"?a.value:void 0},u=o=>{let a=r(o);return j(a)<9&&a.t!=="where"?[v,...f(a,e,n),w]:f(a,e,n)};switch(t.fn){case"out":{let o=s(t.args.length-1)??"",a=O(M(o).toLowerCase());return t.args.length===2?[a,c("of"),...u(0)]:[a]}case"in":{let o=s(t.args.length-1)??"",a=t.args.length===2?n.nearOf(E(r(0),e,n),o):n.nearOf(e,o),d=O(a?n.plural(a):M(o).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let o=s(0),a=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=a===!0?[c("archived")]:a==="all"?[c("archived or not")]:[];return a===!0?[...d,O(o?n.plural(o):"everything")]:[O(o?n.plural(o):"everything"),...d]}case"fact":{let o=s(0);return[O(o?n.factName(o):"fact")]}case"count":return[c("number of"),...u(0)];case"exists":return[...u(0),R("\u2260","is not"),N];case"present":return[...f(r(0),e,n),R("\u2260","is not"),N];case"some":case"every":{let o=E(r(0),e,n),a=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(a)<=2?[v,...f(a,o,n),w]:f(a,o,n)]}case"sum":case"min":case"max":{let o=E(r(0),e,n),a=r(1),d=a.t==="lit"&&typeof a.value=="string"?[O(n.fieldName(o,a.value))]:j(a)<9?[v,...f(a,o,n),w]:f(a,o,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let o=r(0);if(b(o,"all")){let a=o.args[0]?.value;if(typeof a=="string")return[O(`the ${n.noun(a)}`)]}return[c("first of"),...u(0)]}case"sort":return[...u(0),c("by"),...f(r(1),E(r(0),e,n),n)];case"len":return[c("length of"),...f(r(0),e,n)];case"lower":return f(r(0),e,n);case"contains":case"startsWith":return[...f(r(0),e,n),c(t.fn==="contains"?"contains":"starts with"),...S(r(1),e,n,P(r(0),e,n))];case"today":return[L("today")];case"now":return[L("now")];case"date":return $(r(0))&&typeof r(0).value=="string"?[L(G(String(r(0).value),n.locale))]:f(r(0),e,n);case"days":case"hours":{let o=t.fn,[a,d]=[r(0),r(1)];return b(d,"today")||b(d,"now")?[c(`${o} since`),...f(a,e,n)]:b(a,"today")||b(a,"now")?[c(`${o} until`),...f(d,e,n)]:[c(`${o} from`),...f(a,e,n),c("to"),...f(d,e,n)]}case"if":return[v,...f(r(1),e,n),c("if"),...f(r(0),e,n),c(","),c("else"),...f(r(2),e,n),w];case"either":return t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),c("else"),...f(o,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),...f(o,e,n)]),w]}}function Z(t,e){let n=bt(e),r=t.over==="graph"?null:t.over;return z({...r===null?{}:{kind:r},parts:f(t.require,r,n),...t.when?{when:f(t.when,r,n)}:{}})}function H(t,e,n){let r=bt(e),s=t.over==="graph"?null:t.over,u=n.subject,o=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},a=(i,p)=>{let h=S(i,s,r,p);if(i.t==="lit"||i.t==="list"||b(i,"today")||b(i,"now")||b(i,"date"))return h;let y=o(i);if(y===void 0)return h;let l=P(i,s,r),m=r.valueWords(y,l?{...l,format:r.formatOf(l.kind,l.key)??(p?r.formatOf(p.kind,p.key):void 0)}:p);return y instanceof C?[...h,c(":"),m]:[...h,m]},d=i=>{if(i.t==="binary"&&i.op==="&&"){let p=[];p.push(...F(i,"&&"));let h=p.filter(y=>o(y)!==!0);return(h.length>0?h:p).flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op==="||"){let p=U(i);if(p){let y=P(p.subject,s,r);return[...a(p.subject),R("\u2209","is not one of"),r.valueWords(p.values.map(l=>l.value),y)]}let h=[];return h.push(...F(i,"||")),h.flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op in V){if($(i.right)&&typeof i.right.value=="boolean"&&(i.op==="=="||i.op==="!="))return i.op==="=="===i.right.value?T(i.left,s,r):f(i.left,s,r);let p=B[i.op],[h,y]=V[p],l=P(i.left,s,r),m=P(i.right,s,r);if($(i.right)&&i.right.value===null)return[...p==="=="?S(i.left,s,r,m):a(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):a(i.left,m),R(h,y),...g?S(i.right,s,r,l):a(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...a(i.left),R("\u2209","is not one of"),...S(i.right,s,r,P(i.left,s,r))];if(i.t==="unary"&&i.op==="!"){let p=i.operand;return ht(p)?d({...p,op:B[p.op]}):b(p,"present")||b(p,"exists")?[...a(p.args[0]),R("\u2260","is not"),N]:p.t==="ident"?f(p,s,r):[c("not"),v,...T(p,s,r),w]}if(b(i,"present")||b(i,"exists"))return[...f(i.args[0],s,r),R("=","is"),N];if(b(i,"some"))return[...f(i,s,r).slice(1),R("=","is"),N];if(b(i,"every")&&i.args.length===2){let p=o(i.args[0]);if(p instanceof C){let h=p.nodes.filter(y=>{try{return q(i.args[1],{...n,subject:y,budget:2e3})!==!0}catch{return!0}});return[...f(i,s,r),c(","),c("not"),r.valueWords(new C(h))]}}return i.t==="ident"?[c("not"),O(r.fieldName(s,i.name))]:[c("not"),v,...f(i,s,r),w]},x;try{x=d(t.require)}catch{x=[c("not"),v,...f(t.require,s,r),w]}return z({...s===null?{}:{kind:s},parts:x,...u?{record:_(e.schema.tryDefinition(u.kind),u)}:{}})}function Rt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function jt(t){return(e,n)=>{let r=t[e]?.fields?.[n],s=r?.format??(r?.type==="date"?"date":void 0);return s||r?.unit?{...s?{format:s}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function wt(t,e){return{schema:e,said:Rt(t.says),...t.declared?{formatOf:jt(t.declared)}:{},...t.money?{money:t.money}:{}}}function Yt(t,e){return t.shape?Z(t.shape,wt(t.shape,e)):void 0}var vt=new WeakMap;function St(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=Kt(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let o=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!o)return s;let a=u.kinds;a||(a=vt.get(t.schema),a||vt.set(t.schema,a=dt(t.schema)));try{let d=t.today?.()??u.today?.()??k(),x=H(u,wt(u,t.schema),{graph:t.graph,subject:o??null,kinds:a,today:d});return{...s,line:x,...u.says?{}:{message:`${s.message} \u2014 ${x.text}`}}}catch{return s}})}function Nt(){lt((t,e,n,r)=>St({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),pt(Wt)}function Wt(t,e,n,r){let s=e.graph,u=it.from(t.schema,s.snapshot(),{validate:!1});for(let x of n?[...r].reverse().map(st):r)try{u.applyPrimitives([x],{restoring:!0})}catch{}let o=x=>t.violations(void 0,x),a=o(n?u:s),d=o(n?s:u);return{...ft(t.allInvariants(),a,d),violationsAfter:d}}function Kt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}Nt();export{H as brokenLineOf,Nt as judgeWithLines,Wt as judgedForASeat,Pt as problemWords,Yt as ruleLine,Z as ruleLineOf,mt as ruleLineWords,J as ruleSpacing,Et as ruleSpoken,Ot as ruleText,Kt as unlined,St as withLines};
1
+ import{b as pt}from"./chunk.BXT6FDT4.js";import{a as dt}from"./chunk.WVDKYUF3.js";import{f as ct}from"./chunk.ZHLQWMV5.js";import{a as C,f as q}from"./chunk.TNESS3LQ.js";import{Db as ut,E as Q,F as X,H as k,Lc as ft,N as G,Q as tt,S as nt,T as et,ab as st,ba as _,cb as it,da as M,fa as rt,fb as lt,ia as ot,ka as at}from"./chunk.V5MYKNL7.js";import"./chunk.AJZBJBMO.js";function J(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let s=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!s}),n=r.as==="open"}return e}function D(t,e){return J(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Ot(t){return D(t,!1)}function Et(t){return D(t,!0)}function mt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function z(t){let e=u=>J(u).map(({part:o,space:a})=>({...o,space:a})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,s=u=>`${D(n,u)}${r?`, when ${D(r,u)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:s(!1),said:s(!0)}}function Pt(t,e=!1){return t.line?mt(t.line,e):t.message}var yt=60,O=t=>({text:t,as:"name"}),c=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},L=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},R=(t,e)=>({text:t,as:"op",said:e}),v={text:"(",as:"open"},w={text:")",as:"close"},N={text:"\u2014",as:"value",said:"empty"},V={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},Lt={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},ht=t=>t.t==="binary"&&t.op in V;function I(t){return t.length>1&&t[1]===t[1].toUpperCase()&&/[A-Z]/.test(t[1])?t:t.charAt(0).toLowerCase()+t.slice(1)}function bt(t){let{schema:e}=t,n=l=>l===null?void 0:e.tryDefinition(l),r=(l,m)=>{let g=n(l)?.edges;return g&&Object.hasOwn(g,m)?g[m]:void 0},s=(l,m)=>{let g=r(l,m)?.to;return Array.isArray(g)&&g.length===1?g[0]:null},u=(l,m)=>{let g=(e.edge(m)?.from??[]).filter(W=>{let K=r(W,m)?.to;return l===null||K==="*"||Array.isArray(K)&&K.includes(l)});return g.length===1?g[0]:null},o=(l,m)=>r(l,m)?M(m).toLowerCase():I(ot(n(l),m)),a=l=>I(rt(e,l)),d=l=>I(ct(e).get(l)?.label??M(l)),x=l=>I(at(n(l),l)),i=(l,m)=>{let g=l===null?void 0:t.formatOf?.(l,m);if(g?.format)return g;let W=t.said?.get(m);return W?{...g,format:W}:g},p=l=>_(e.tryDefinition(l.kind),l),h=t.money?.locale,y=(l,m)=>{if(l==null)return N;if(l instanceof C){if(l.nodes.length===0)return N;let A=l.nodes.slice(0,3).map(p),Y=l.nodes.length-A.length;return L(Y>0?`${A.join(", ")} and ${Y} more`:A.length>1?`${A.slice(0,-1).join(", ")} and ${A[A.length-1]}`:A[0])}if(Array.isArray(l))return L(`{${l.map(A=>y(A,m).text).join(", ")}}`,l.map(A=>y(A,m).text).join(" or "));if(typeof l=="object")return L(p(l));if(typeof l=="boolean")return L(l?"yes":"no");let g=m?.format??(m?i(m.kind,m.key):void 0);if(typeof l=="number")return L(g&&g.format!=="date"?ut(l,{...t.money,...g}):et(l,h));if(Q.test(l)||g?.format==="date")return L(G(nt(l,t.money?.timeZone)??l.slice(0,10),h));if(X.test(l))return L(tt(l,h,t.money?.timeZone));let W=m&&m.kind!==null?n(m.kind)?.display?.format?.[m.key]:void 0;if(W)return L(W(l));let K=l.length>yt?`${l.slice(0,yt-1).trimEnd()}\u2026`:l;return L(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test(K)?K.replace(/[-_]+/g," "):K)};return{definition:n,relation:r,farOf:s,nearOf:u,fieldName:o,plural:a,noun:x,factName:d,formatOf:i,valueWords:y,locale:h}}function P(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:E(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=E(t.args[0],e,n),s=t.args[1];if(s.t==="ident")return{kind:r,key:s.name};if(s.t==="lit"&&typeof s.value=="string")return{kind:r,key:s.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return P(t.left,e,n)??P(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return P(t.args[1],e,n)??P(t.args[2],e,n)}function E(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(E(t.object,e,n),t.name);case"where":return E(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?E(t.left,e,n):null;case"call":{let r=s=>{let u=t.args[s];return u?.t==="lit"&&typeof u.value=="string"?u.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(E(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(E(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?E(t.args[0],e,n):null}default:return null}}function j(t){return t.t==="binary"?t.op==="||"?U(t)?4:1:t.op==="&&"?2:t.op in V||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var $=t=>t.t==="lit",b=(t,e)=>t.t==="call"&&t.fn===e;function F(t,e){return t.t==="binary"&&t.op===e?[...F(t.left,e),...F(t.right,e)]:[t]}function U(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...F(t,"||"));let n,r=[];for(let s of e){if(s.t!=="binary"||s.op!=="=="||!$(s.right)||typeof s.right.value!="string"||n&&JSON.stringify(gt(n))!==JSON.stringify(gt(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var gt=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,o,a=e)=>j(u)<o?[v,...f(u,a,n),w]:f(u,a,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(u=>u.t==="lit"?u.value:null),r)];case"ident":return[O(n.fieldName(e,t.name))];case"member":{let u=b(t.object,"first")&&t.object.args[0]&&b(t.object.args[0],"all"),o=E(t.object,e,n);if(u&&o)return e!==null&&n.fieldName(e,t.name)===n.fieldName(o,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(o)}'s ${n.fieldName(o,t.name)}`)]:[O(n.fieldName(o,t.name))];let a=f(t.object,e,n),d=a[a.length-1];return a.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(o,t.name)}`)]:[...a,c("'s"),O(n.fieldName(o,t.name))]}case"unary":return t.op==="-"?[R("\u2212","minus"),...s(t.operand,7)]:T(t.operand,e,n);case"where":{let u=E(t.set,e,n),o=f(t.filter,u,n),a=o.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...a?[]:[c("with")],...j(t.filter)<=2?[v,...o,w]:o]}case"binary":return xt(t,e,n);case"call":return At(t,e,n)}}function T(t,e,n){return ht(t)?xt({...t,op:B[t.op]},e,n):b(t,"present")||b(t,"exists")?[...f(t.args[0],e,n),R("=","is"),N]:t.t==="ident"?[c("not"),O(n.fieldName(e,t.name))]:[c("not"),v,...f(t,e,n),w]}function xt(t,e,n){let r=(o,a)=>j(o)<a?[v,...f(o,e,n),w]:f(o,e,n);if(t.op==="&&"||t.op==="||"){let o=U(t);if(o){let d=P(o.subject,e,n);return[...f(o.subject,e,n),R("\u2208","is one of"),n.valueWords(o.values.map(x=>x.value),d)]}let a=t.op==="&&"?2:1;return[...r(t.left,a),c(t.op==="&&"?"and":"or"),...r(t.right,a+.5)]}if(t.op in V){if($(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?f(t.left,e,n):T(t.left,e,n);let[o,a]=V[t.op],d=P(t.left,e,n),x=P(t.right,e,n);return[...S(t.left,e,n,x),R(o,a),...S(t.right,e,n,d)]}if(t.op==="in")return[...r(t.left,5),R("\u2208","is one of"),...S(t.right,e,n,P(t.left,e,n))];let s=Lt[t.op];if(s){let o=j(t);return[...r(t.left,o),R(s[0],s[1]),...r(t.right,o+.5)]}let u={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),c(u[t.op]??t.op),...r(t.right,5)]}function S(t,e,n,r){return t.t==="lit"||t.t==="list"?f(t,e,n,r):j(t)<5?[v,...f(t,e,n),w]:f(t,e,n)}function At(t,e,n){let r=o=>t.args[o],s=o=>{let a=t.args[o];return a?.t==="lit"&&typeof a.value=="string"?a.value:void 0},u=o=>{let a=r(o);return j(a)<9&&a.t!=="where"?[v,...f(a,e,n),w]:f(a,e,n)};switch(t.fn){case"out":{let o=s(t.args.length-1)??"",a=O(M(o).toLowerCase());return t.args.length===2?[a,c("of"),...u(0)]:[a]}case"in":{let o=s(t.args.length-1)??"",a=t.args.length===2?n.nearOf(E(r(0),e,n),o):n.nearOf(e,o),d=O(a?n.plural(a):M(o).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let o=s(0),a=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=a===!0?[c("archived")]:a==="all"?[c("archived or not")]:[];return a===!0?[...d,O(o?n.plural(o):"everything")]:[O(o?n.plural(o):"everything"),...d]}case"fact":{let o=s(0);return[O(o?n.factName(o):"fact")]}case"count":return[c("number of"),...u(0)];case"exists":return[...u(0),R("\u2260","is not"),N];case"present":return[...f(r(0),e,n),R("\u2260","is not"),N];case"some":case"every":{let o=E(r(0),e,n),a=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(a)<=2?[v,...f(a,o,n),w]:f(a,o,n)]}case"sum":case"min":case"max":{let o=E(r(0),e,n),a=r(1),d=a.t==="lit"&&typeof a.value=="string"?[O(n.fieldName(o,a.value))]:j(a)<9?[v,...f(a,o,n),w]:f(a,o,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let o=r(0);if(b(o,"all")){let a=o.args[0]?.value;if(typeof a=="string")return[O(`the ${n.noun(a)}`)]}return[c("first of"),...u(0)]}case"sort":return[...u(0),c("by"),...f(r(1),E(r(0),e,n),n)];case"len":return[c("length of"),...f(r(0),e,n)];case"lower":return f(r(0),e,n);case"contains":case"startsWith":return[...f(r(0),e,n),c(t.fn==="contains"?"contains":"starts with"),...S(r(1),e,n,P(r(0),e,n))];case"today":return[L("today")];case"now":return[L("now")];case"date":return $(r(0))&&typeof r(0).value=="string"?[L(G(String(r(0).value),n.locale))]:f(r(0),e,n);case"days":case"hours":{let o=t.fn,[a,d]=[r(0),r(1)];return b(d,"today")||b(d,"now")?[c(`${o} since`),...f(a,e,n)]:b(a,"today")||b(a,"now")?[c(`${o} until`),...f(d,e,n)]:[c(`${o} from`),...f(a,e,n),c("to"),...f(d,e,n)]}case"if":return[v,...f(r(1),e,n),c("if"),...f(r(0),e,n),c(","),c("else"),...f(r(2),e,n),w];case"either":return t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),c("else"),...f(o,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),...f(o,e,n)]),w]}}function Z(t,e){let n=bt(e),r=t.over==="graph"?null:t.over;return z({...r===null?{}:{kind:r},parts:f(t.require,r,n),...t.when?{when:f(t.when,r,n)}:{}})}function H(t,e,n){let r=bt(e),s=t.over==="graph"?null:t.over,u=n.subject,o=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},a=(i,p)=>{let h=S(i,s,r,p);if(i.t==="lit"||i.t==="list"||b(i,"today")||b(i,"now")||b(i,"date"))return h;let y=o(i);if(y===void 0)return h;let l=P(i,s,r),m=r.valueWords(y,l?{...l,format:r.formatOf(l.kind,l.key)??(p?r.formatOf(p.kind,p.key):void 0)}:p);return y instanceof C?[...h,c(":"),m]:[...h,m]},d=i=>{if(i.t==="binary"&&i.op==="&&"){let p=[];p.push(...F(i,"&&"));let h=p.filter(y=>o(y)!==!0);return(h.length>0?h:p).flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op==="||"){let p=U(i);if(p){let y=P(p.subject,s,r);return[...a(p.subject),R("\u2209","is not one of"),r.valueWords(p.values.map(l=>l.value),y)]}let h=[];return h.push(...F(i,"||")),h.flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op in V){if($(i.right)&&typeof i.right.value=="boolean"&&(i.op==="=="||i.op==="!="))return i.op==="=="===i.right.value?T(i.left,s,r):f(i.left,s,r);let p=B[i.op],[h,y]=V[p],l=P(i.left,s,r),m=P(i.right,s,r);if($(i.right)&&i.right.value===null)return[...p==="=="?S(i.left,s,r,m):a(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):a(i.left,m),R(h,y),...g?S(i.right,s,r,l):a(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...a(i.left),R("\u2209","is not one of"),...S(i.right,s,r,P(i.left,s,r))];if(i.t==="unary"&&i.op==="!"){let p=i.operand;return ht(p)?d({...p,op:B[p.op]}):b(p,"present")||b(p,"exists")?[...a(p.args[0]),R("\u2260","is not"),N]:p.t==="ident"?f(p,s,r):[c("not"),v,...T(p,s,r),w]}if(b(i,"present")||b(i,"exists"))return[...f(i.args[0],s,r),R("=","is"),N];if(b(i,"some"))return[...f(i,s,r).slice(1),R("=","is"),N];if(b(i,"every")&&i.args.length===2){let p=o(i.args[0]);if(p instanceof C){let h=p.nodes.filter(y=>{try{return q(i.args[1],{...n,subject:y,budget:2e3})!==!0}catch{return!0}});return[...f(i,s,r),c(","),c("not"),r.valueWords(new C(h))]}}return i.t==="ident"?[c("not"),O(r.fieldName(s,i.name))]:[c("not"),v,...f(i,s,r),w]},x;try{x=d(t.require)}catch{x=[c("not"),v,...f(t.require,s,r),w]}return z({...s===null?{}:{kind:s},parts:x,...u?{record:_(e.schema.tryDefinition(u.kind),u)}:{}})}function Rt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function jt(t){return(e,n)=>{let r=t[e]?.fields?.[n],s=r?.format??(r?.type==="date"?"date":void 0);return s||r?.unit?{...s?{format:s}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function wt(t,e){return{schema:e,said:Rt(t.says),...t.declared?{formatOf:jt(t.declared)}:{},...t.money?{money:t.money}:{}}}function Yt(t,e){return t.shape?Z(t.shape,wt(t.shape,e)):void 0}var vt=new WeakMap;function St(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=Kt(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let o=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!o)return s;let a=u.kinds;a||(a=vt.get(t.schema),a||vt.set(t.schema,a=dt(t.schema)));try{let d=t.today?.()??u.today?.()??k(),x=H(u,wt(u,t.schema),{graph:t.graph,subject:o??null,kinds:a,today:d});return{...s,line:x,...u.says?{}:{message:`${s.message} \u2014 ${x.text}`}}}catch{return s}})}function Nt(){lt((t,e,n,r)=>St({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),pt(Wt)}function Wt(t,e,n,r){let s=e.graph,u=it.from(t.schema,s.snapshot(),{validate:!1});for(let x of n?[...r].reverse().map(st):r)try{u.applyPrimitives([x],{restoring:!0})}catch{}let o=x=>t.violations(void 0,x),a=o(n?u:s),d=o(n?s:u);return{...ft(t.allInvariants(),a,d),violationsAfter:d}}function Kt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}Nt();export{H as brokenLineOf,Nt as judgeWithLines,Wt as judgedForASeat,Pt as problemWords,Yt as ruleLine,Z as ruleLineOf,mt as ruleLineWords,J as ruleSpacing,Et as ruleSpoken,Ot as ruleText,Kt as unlined,St as withLines};