graview 0.1.30 → 0.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/preview/chunk.26LLZN3C.js +1 -0
  2. package/dist/preview/chunk.2NIOHEMX.js +1 -0
  3. package/dist/preview/chunk.2WPZXIRP.js +2 -0
  4. package/dist/preview/{chunk.XRJBLH4N.js → chunk.3AGY4QVS.js} +1 -1
  5. package/dist/preview/chunk.3HXN4BOY.js +1 -0
  6. package/dist/preview/{chunk.2CIBWZJG.js → chunk.3K6YSVHC.js} +1 -1
  7. package/dist/preview/chunk.3NDH3EDN.js +47 -0
  8. package/dist/preview/{chunk.FWCOJDOD.js → chunk.3TVXGJTU.js} +1 -1
  9. package/dist/preview/{chunk.NDADLJE6.js → chunk.3TY5NFLY.js} +1 -1
  10. package/dist/preview/{chunk.UWGWXFWZ.js → chunk.47STJVRV.js} +1 -1
  11. package/dist/preview/{chunk.X37L5TN5.js → chunk.4HNG4UXT.js} +1 -1
  12. package/dist/preview/{chunk.34ZMMURV.js → chunk.4HRAQNJO.js} +6 -6
  13. package/dist/preview/{chunk.QTMWHE5O.js → chunk.4HZ7QTXZ.js} +1 -1
  14. package/dist/preview/{chunk.3JGGBLRB.js → chunk.4MERAWS2.js} +1 -1
  15. package/dist/preview/chunk.52W7WYME.js +1 -0
  16. package/dist/preview/chunk.5A4AOFOA.js +1 -0
  17. package/dist/preview/chunk.5H4VXLZF.js +88 -0
  18. package/dist/preview/{chunk.XS7YFNDU.js → chunk.5T5XGILP.js} +1 -1
  19. package/dist/preview/chunk.5UL7YDUD.js +1 -0
  20. package/dist/preview/chunk.63GXY2ME.js +1 -0
  21. package/dist/preview/chunk.67TPUXAY.js +1 -0
  22. package/dist/preview/chunk.6QWV5MVH.js +25 -0
  23. package/dist/preview/{chunk.PAVR5TK5.js → chunk.6UGEYZAC.js} +1 -1
  24. package/dist/preview/chunk.6YCBYL2Y.js +2 -0
  25. package/dist/preview/{chunk.ZYKAS4BT.js → chunk.7GKUVQVF.js} +1 -1
  26. package/dist/preview/{chunk.T3VPD7JQ.js → chunk.7T7NZZTC.js} +1 -1
  27. package/dist/preview/chunk.AKFKM4SW.js +3 -0
  28. package/dist/preview/chunk.AOSMJKLH.js +1 -0
  29. package/dist/preview/{chunk.DT7LHWU2.js → chunk.AR3DCDHU.js} +1 -1
  30. package/dist/preview/{chunk.D3IECJ2S.js → chunk.ASCLIM2P.js} +1 -1
  31. package/dist/preview/chunk.B2GLDIAS.js +1 -0
  32. package/dist/preview/chunk.BHXGM3PV.js +1 -0
  33. package/dist/preview/chunk.BNV77BQZ.js +4 -0
  34. package/dist/preview/chunk.BQ3JHEHV.js +1 -0
  35. package/dist/preview/chunk.CAVBSL27.js +1 -0
  36. package/dist/preview/{chunk.YLQB3KBA.js → chunk.CDP2XL66.js} +1 -1
  37. package/dist/preview/chunk.CIPS2OGR.js +1 -0
  38. package/dist/preview/chunk.CN3UEF5N.js +90 -0
  39. package/dist/preview/{chunk.6XMEU2Q2.js → chunk.COQKECUH.js} +1 -1
  40. package/dist/preview/{chunk.QTA4ROAK.js → chunk.CWHRDBOF.js} +1 -1
  41. package/dist/preview/chunk.CX3KL2C5.js +1 -0
  42. package/dist/preview/{chunk.AK3IHFCF.js → chunk.D75KC3LL.js} +1 -1
  43. package/dist/preview/chunk.DAZ2VSRD.js +1 -0
  44. package/dist/preview/{chunk.3ADPAGPY.js → chunk.DYSPCGXX.js} +1 -1
  45. package/dist/preview/chunk.E2YEOMPH.js +1 -0
  46. package/dist/preview/chunk.EBGAYL32.js +1 -0
  47. package/dist/preview/chunk.EF3XNU4O.js +1 -0
  48. package/dist/preview/chunk.EJPI3ST6.js +1 -0
  49. package/dist/preview/chunk.EKPRNDUV.js +1 -0
  50. package/dist/preview/chunk.ERIT3R6N.js +1 -0
  51. package/dist/preview/chunk.EYTBDMTW.js +1 -0
  52. package/dist/preview/{chunk.HHPGWJDO.js → chunk.FWTIUYXH.js} +1 -1
  53. package/dist/preview/{chunk.6T2Q6NLO.js → chunk.G5NZVPJU.js} +1 -1
  54. package/dist/preview/chunk.GBRRGTIH.js +1 -0
  55. package/dist/preview/{chunk.VG56IUIQ.js → chunk.GO4XBWJO.js} +1 -1
  56. package/dist/preview/chunk.GV2CQVKV.js +1 -0
  57. package/dist/preview/chunk.GYICGZMG.js +3 -0
  58. package/dist/preview/chunk.H7BST3XO.js +1 -0
  59. package/dist/preview/chunk.H7EPE74C.js +1 -0
  60. package/dist/preview/{chunk.26CZTUY4.js → chunk.HAIG6NVX.js} +1 -1
  61. package/dist/preview/{chunk.V7BDAGDE.js → chunk.HLTRQU4Y.js} +1 -1
  62. package/dist/preview/{chunk.VS7K3SCD.js → chunk.I6FPNX43.js} +1 -1
  63. package/dist/preview/chunk.IDVAR5HM.js +1 -0
  64. package/dist/preview/{chunk.3URFMWXZ.js → chunk.IWQCOGHW.js} +2 -2
  65. package/dist/preview/chunk.J25KOSNW.js +1 -0
  66. package/dist/preview/chunk.JDUJDAGA.js +1 -0
  67. package/dist/preview/chunk.JOOQUWLT.js +341 -0
  68. package/dist/preview/{chunk.4SJUTBDV.js → chunk.JQU5GEU3.js} +1 -1
  69. package/dist/preview/chunk.K5ME5GCG.js +1 -0
  70. package/dist/preview/chunk.KSES5U5B.js +1 -0
  71. package/dist/preview/chunk.KSXB4LDF.js +1 -0
  72. package/dist/preview/chunk.LR3VDXPI.js +1 -0
  73. package/dist/preview/{chunk.WYTIOLPP.js → chunk.LXBOVRFI.js} +1 -1
  74. package/dist/preview/{chunk.42YX6NOY.js → chunk.MAF7C3VM.js} +1 -1
  75. package/dist/preview/chunk.MNP4JI33.js +5 -0
  76. package/dist/preview/{chunk.O2LK2AO7.js → chunk.MWGGV7DE.js} +1 -1
  77. package/dist/preview/chunk.N6OX4NEQ.js +1 -0
  78. package/dist/preview/chunk.NRAYZY3X.js +1 -0
  79. package/dist/preview/chunk.NTF7FVB2.js +1 -0
  80. package/dist/preview/{chunk.DZRTOURR.js → chunk.OC6IWRQ3.js} +1 -1
  81. package/dist/preview/chunk.OJGHDWI6.js +1 -0
  82. package/dist/preview/chunk.OKRNJXTV.js +1 -0
  83. package/dist/preview/chunk.PBSMLINK.js +1 -0
  84. package/dist/preview/chunk.PHKSMUIA.js +1 -0
  85. package/dist/preview/{chunk.JN7DIFR3.js → chunk.PIP6Z563.js} +1 -1
  86. package/dist/preview/chunk.QVVJRSRM.js +1 -0
  87. package/dist/preview/{chunk.L6OMEYL6.js → chunk.QYZNAUIR.js} +1 -1
  88. package/dist/preview/chunk.R6K6GF5R.js +1 -0
  89. package/dist/preview/{chunk.JTNWD2CN.js → chunk.RCKTBOY2.js} +1 -1
  90. package/dist/preview/{chunk.QNGWEV47.js → chunk.RIJUCHP4.js} +1 -1
  91. package/dist/preview/chunk.SHTJZ6UX.js +1 -0
  92. package/dist/preview/{chunk.PKK6FRZR.js → chunk.SYAEBGDC.js} +1 -1
  93. package/dist/preview/chunk.T5VG5A6V.js +1 -0
  94. package/dist/preview/{chunk.ERXSYPYL.js → chunk.TAQ764IQ.js} +1 -1
  95. package/dist/preview/{chunk.RIEHYQLK.js → chunk.TMVCTBAD.js} +50 -24
  96. package/dist/preview/{chunk.HHI65WFZ.js → chunk.UATVTXZY.js} +1 -1
  97. package/dist/preview/{chunk.XSTXV6FP.js → chunk.UBFNZMUX.js} +2 -2
  98. package/dist/preview/{chunk.WAFDCOOG.js → chunk.UGFJKSHU.js} +1 -1
  99. package/dist/preview/chunk.UHUGOTUU.js +19 -0
  100. package/dist/preview/chunk.ULRW47RP.js +1 -0
  101. package/dist/preview/chunk.UNL2HIF2.js +1 -0
  102. package/dist/preview/chunk.UVR2Z5ZC.js +1 -0
  103. package/dist/preview/chunk.UZGRRDHD.js +1 -0
  104. package/dist/preview/{chunk.BPWNWE7N.js → chunk.VG3O4LWB.js} +1 -1
  105. package/dist/preview/chunk.WAZ7OGBD.js +1 -0
  106. package/dist/preview/{chunk.3JNMSOFG.js → chunk.XANVHJQ4.js} +1 -1
  107. package/dist/preview/chunk.XBJYQNVE.js +1 -0
  108. package/dist/preview/chunk.XKABS745.js +1 -0
  109. package/dist/preview/chunk.XMC7YDWT.js +1 -0
  110. package/dist/preview/chunk.XNJEFUF7.js +3 -0
  111. package/dist/preview/chunk.Y2SFUALD.js +117 -0
  112. package/dist/preview/chunk.Y6ZNFQK3.js +6 -0
  113. package/dist/preview/{chunk.J2ITFGN3.js → chunk.YIR7PPF3.js} +1 -1
  114. package/dist/preview/index.html +51 -0
  115. package/dist/preview/page.js +6 -6
  116. package/package.json +6 -6
  117. package/dist/preview/chunk.2EXGG6BB.js +0 -1
  118. package/dist/preview/chunk.2NBYNZRD.js +0 -1
  119. package/dist/preview/chunk.2XAONC66.js +0 -1
  120. package/dist/preview/chunk.3R4W2P5X.js +0 -1
  121. package/dist/preview/chunk.3SKKIHU3.js +0 -4
  122. package/dist/preview/chunk.3VL5WECB.js +0 -1
  123. package/dist/preview/chunk.4ALKPNXM.js +0 -1
  124. package/dist/preview/chunk.4HP7UWA2.js +0 -1
  125. package/dist/preview/chunk.5U5J3ISK.js +0 -1
  126. package/dist/preview/chunk.6V2RG5JG.js +0 -5
  127. package/dist/preview/chunk.7BWT5L2L.js +0 -1
  128. package/dist/preview/chunk.C5CYZNSJ.js +0 -1
  129. package/dist/preview/chunk.CM6LOIQE.js +0 -88
  130. package/dist/preview/chunk.FDELO7NY.js +0 -116
  131. package/dist/preview/chunk.FGVKJWNS.js +0 -6
  132. package/dist/preview/chunk.GFF2FB2J.js +0 -25
  133. package/dist/preview/chunk.GLBHQFJ2.js +0 -1
  134. package/dist/preview/chunk.HSCTWAUV.js +0 -1
  135. package/dist/preview/chunk.INZUEWC5.js +0 -1
  136. package/dist/preview/chunk.JH6MU6TX.js +0 -2
  137. package/dist/preview/chunk.JISMMIMX.js +0 -1
  138. package/dist/preview/chunk.JPHNKWTY.js +0 -1
  139. package/dist/preview/chunk.K75FUIZI.js +0 -1
  140. package/dist/preview/chunk.K776HO42.js +0 -2
  141. package/dist/preview/chunk.KN3ULTGF.js +0 -1
  142. package/dist/preview/chunk.KOB6N3SL.js +0 -1
  143. package/dist/preview/chunk.KQT7WAQE.js +0 -1
  144. package/dist/preview/chunk.L4DECHXR.js +0 -327
  145. package/dist/preview/chunk.LQ7V6KEE.js +0 -1
  146. package/dist/preview/chunk.MD74YVRN.js +0 -3
  147. package/dist/preview/chunk.MGNP4LAM.js +0 -1
  148. package/dist/preview/chunk.NCTOBUCT.js +0 -1
  149. package/dist/preview/chunk.NO52VON3.js +0 -1
  150. package/dist/preview/chunk.OAF7TUMI.js +0 -1
  151. package/dist/preview/chunk.OQ4KFN6W.js +0 -1
  152. package/dist/preview/chunk.OQDETV4X.js +0 -1
  153. package/dist/preview/chunk.OXQMNIRO.js +0 -1
  154. package/dist/preview/chunk.OZNW5W4Z.js +0 -1
  155. package/dist/preview/chunk.QIAKO27D.js +0 -1
  156. package/dist/preview/chunk.R26DREVU.js +0 -1
  157. package/dist/preview/chunk.RI3PYG5T.js +0 -19
  158. package/dist/preview/chunk.RRVIXV7W.js +0 -1
  159. package/dist/preview/chunk.RYT5U3QM.js +0 -1
  160. package/dist/preview/chunk.SE5SKFQH.js +0 -1
  161. package/dist/preview/chunk.SOBC3CTN.js +0 -47
  162. package/dist/preview/chunk.SOD3PBJM.js +0 -1
  163. package/dist/preview/chunk.UDSEJKCY.js +0 -1
  164. package/dist/preview/chunk.UZWWDAGM.js +0 -14
  165. package/dist/preview/chunk.V5ZYUVMH.js +0 -1
  166. package/dist/preview/chunk.VOAZBHCG.js +0 -1
  167. package/dist/preview/chunk.VSZQXB4Q.js +0 -3
  168. package/dist/preview/chunk.W3S6UXNA.js +0 -1
  169. package/dist/preview/chunk.Y4UXEL6Y.js +0 -1
  170. package/dist/preview/chunk.YJUB4OD7.js +0 -1
  171. package/dist/preview/chunk.YNQDVGZM.js +0 -1
  172. package/dist/preview/chunk.YV2LJFGS.js +0 -1
  173. package/dist/preview/chunk.Z2YUYZT4.js +0 -1
  174. /package/dist/preview/{chunk.EYZ7MHBZ.js → chunk.GZHZLJBF.js} +0 -0
@@ -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{d as Se,f as be}from"./chunk.RIJUCHP4.js";import{e as pt}from"./chunk.YIR7PPF3.js";import{a as yt,d as wt,f as vt}from"./chunk.3HXN4BOY.js";import{a as Ce,b as ft}from"./chunk.GYICGZMG.js";import{a as mt,b as ht}from"./chunk.47STJVRV.js";import{h as ut}from"./chunk.EBGAYL32.js";import{a as ae,b as tt}from"./chunk.CWHRDBOF.js";import{b as Pe,c as U,d as X,e as it,f as rt}from"./chunk.3K6YSVHC.js";import{a as ve,b as gt}from"./chunk.SHTJZ6UX.js";import{c as ot,d as ie,e as J,f as ye,g as st,i as lt,j as re}from"./chunk.ULRW47RP.js";import{j as dt,o as we}from"./chunk.XMC7YDWT.js";import{c as ct}from"./chunk.6UGEYZAC.js";import{c as at,d as Re}from"./chunk.6YCBYL2Y.js";import{c as nt}from"./chunk.UGFJKSHU.js";import{A as Je,F as q,Q as I,R as Ye,X as Ze,Y as V,_ as ue,a as ge,fa as Qe,ga as j,ha as pe,ja as me,k as je,la as et,m as _e,n as qe,na as xe,oa as he,pa as Ne,s as ne,w as Ue,xa as fe,z as Xe}from"./chunk.6QWV5MVH.js";import{Kb as te,N as Q,X as $,Ya as Ke,Z as ee,ea as H}from"./chunk.MNP4JI33.js";import{b as E}from"./chunk.AJZBJBMO.js";var v=E(q(),1);var St=E(q(),1);function bt(e){(0,St.useLayoutEffect)(()=>{let n=e.current,t=n?.parentElement;if(!n||!t)return;let a=n.style.bottom,o=()=>{let c=t.querySelector(zt);if(!c){n.style.bottom=a;return}let u=t.getBoundingClientRect(),m=c.getBoundingClientRect(),d=u.height>0?t.offsetHeight/u.height:1;n.style.bottom=`${Math.max(0,Math.round((u.bottom-m.top)*d))}px`};if(o(),typeof ResizeObserver>"u")return;let g=new ResizeObserver(o);return g.observe(t),()=>g.disconnect()},[e])}var zt=".graview-spec-listing";var $e=E(q(),1);var P=E(q(),1);var kt=E(q(),1);var B=E(I(),1);function xt({id:e,max:n=8,empty:t,hide:a}){let{store:o}=V();ue();let g=Kt(o,e,o.violations()),[c,u]=(0,kt.useState)(()=>new Set),m=a?g.flatMap(d=>{let f=d.ids.filter(r=>!a.has(r));return f.length>0?[{...d,ids:f}]:[]}):g;return m.length===0?t&&g.length===0?(0,B.jsx)("p",{style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-faint)"},children:t}):null:(0,B.jsx)("div",{"data-graview-primitive":"connections",style:{display:"flex",flexDirection:"column",gap:12},children:m.map(d=>{let f=c.has(d.key),r=d.ids.length>n,l=f?d.ids:d.ids.slice(0,n),y=d.ids.length-Math.min(n,d.ids.length),k=`graview-more-${e}-${d.key}`.replace(/[^A-Za-z0-9_-]/g,"-");return(0,B.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)("h2",{...d.said?{"aria-label":d.said}:{},style:{margin:0,fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.09em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:d.label}),(0,B.jsxs)("div",{id:k,style:{display:"flex",flexWrap:"wrap",gap:6},children:[l.map(h=>{let w=o.graph.getNode(h);return w?(0,B.jsx)(X,{pickId:h,hue:te(w.kind),title:`Go to the ${H(o.schema.tryDefinition(w.kind),w.kind)}`,label:$(o.schema.tryDefinition(w.kind),w)},h):null}),r?(0,B.jsx)("button",{type:"button","data-graview-more":d.key,"aria-expanded":f,"aria-controls":k,...f?{}:{"aria-label":`${y} more: ${d.said??d.label}`},onClick:h=>{h.stopPropagation(),u(w=>{let S=new Set(w);return S.has(d.key)?S.delete(d.key):S.add(d.key),S})},style:Ft,children:f?"Show fewer":`+${y} more`}):null]})]},d.key)})})}var Ft={display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,border:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",color:"var(--graview-accent)",font:"inherit",fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",cursor:"pointer"};function Kt(e,n,t=[]){let a=e.graph.getNode(n);if(!a)return[];let o=new Map,g=[];for(let c of t)if(c.subjectId===n)for(let u of c.nodeIds)u!==n&&!g.includes(u)&&e.graph.has(u)&&g.push(u);g.length>0&&o.set("judges",{key:"judges",label:"what it finds wrong",ids:g});for(let c of e.graph.allEdges()){let u=c.from===n?c.to:c.to===n?c.from:null;if(u===null||u===n)continue;let m=e.graph.getNode(u);if(!m)continue;let d=c.from===n?"out":"in",f=d==="out"?a.kind:m.kind,r=jt(e.schema,f,c.kind,d),l=`${c.kind}:${d}:${r.label}`,y=o.get(l)??{key:l,...r,ids:[]};y.ids.includes(u)||y.ids.push(u),o.set(l,y)}for(let c of o.values())c.ids.sort();return[...o.values()].sort((c,u)=>c.key<u.key?-1:c.key>u.key?1:0)}function jt(e,n,t,a){let o=nt(e,n,t,a),g=ee(t).toLowerCase();return o.trim().toLowerCase()!==g?{label:o}:a==="out"?{label:`\u2192 ${g}`,said:g}:{label:`\u2190 ${g}`,said:`${g}, pointing here`}}var Nt=E(q(),1),oe=(0,Nt.createContext)(null);var s=E(I(),1),_t=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.UHUGOTUU.js","./chunk.47STJVRV.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.WAZ7OGBD.js")))).part((e,n)=>(0,s.jsx)(e.ArrangeBar,{...n}),{what:"Arranging this list"}),qt=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.2NIOHEMX.js","./chunk.4HRAQNJO.js","./chunk.Y6ZNFQK3.js","./chunk.BNV77BQZ.js","./chunk.SYAEBGDC.js","./chunk.NRAYZY3X.js","./chunk.RIJUCHP4.js","./chunk.TAQ764IQ.js","./chunk.YIR7PPF3.js","./chunk.3HXN4BOY.js","./chunk.GYICGZMG.js","./chunk.UHUGOTUU.js","./chunk.47STJVRV.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.HJCQ6I3S.js","./chunk.MWGGV7DE.js","./chunk.JQU5GEU3.js","./chunk.UBFNZMUX.js","./chunk.G4JJXA63.js","./chunk.HAIG6NVX.js","./chunk.UZGRRDHD.js","./chunk.XANVHJQ4.js","./chunk.OKRNJXTV.js","./chunk.CAVBSL27.js","./chunk.EJPI3ST6.js","./chunk.CWHRDBOF.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.UT6642FC.js","./chunk.Q5WEOX3Q.js","./chunk.GV2CQVKV.js","./chunk.4HZ7QTXZ.js","./chunk.G5NZVPJU.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.5H4VXLZF.js")))).part((e,n)=>(0,s.jsx)(e.KindStop,{...n}),{what:"This list"});function Ae(e){let{brand:n}=V();return te(e,n?.accents)}function Ut(e,n){if(!n.endsWith("\u2026")&&!n.endsWith("..."))return;let t=n.replace(/[…]|\.\.\.$/g,"").trim();if(!(t.length<12)){for(let a of Object.values(e))if(typeof a=="string"&&a.length>t.length&&a.startsWith(t))return a}}function Xt(e,n){let a=Math.max(0,...e.slice(0,n*2).map(g=>g.length))*7.5+28<=212/2?2:1,o=n*a;return{columns:a,shown:Math.min(e.length,o)}}var Jt=8,Rt=500,Yt=12;function Ct(e){return{x:e.clientX,y:e.clientY,pointerType:e.pointerType??""}}function Zt(e,n,t){let a=performance.now()+Rt,o=["pointerdown","pointerup","mousedown","mouseup","dblclick"],g=r=>{if(performance.now()>a||!(r instanceof MouseEvent))return!1;let l=Ct(r);return n.pointerType&&l.pointerType&&n.pointerType!==l.pointerType?!1:Math.hypot(l.x-n.x,l.y-n.y)<=Yt},c=r=>{if(!g(r))return d();r.stopPropagation()},u=r=>{if(!g(r))return d();r.stopPropagation(),r.preventDefault(),e.removeEventListener("click",u,!0),setTimeout(d,50),t()},m=!1,d=()=>{if(!m){m=!0,clearTimeout(f),e.removeEventListener("click",u,!0);for(let r of o)e.removeEventListener(r,c,!0)}};for(let r of o)e.addEventListener(r,c,!0);e.addEventListener("click",u,!0);let f=setTimeout(d,Rt)}function Qt({View:e,members:n,mode:t,flagged:a}){let{isSelected:o}=xe(),g=n.slice(0,Jt);return(0,s.jsxs)("div",{"data-graview-rows":"",style:{display:"grid",gap:4,minWidth:0},children:[g.map(c=>(0,s.jsx)("div",{"data-graview-pick":c.id,style:{minWidth:0,cursor:"pointer"},children:(0,s.jsx)(e,{node:c,cardinality:"one",fidelity:"glyph",mode:t,selected:o(c.id),...a?.includes(c.id)?{flagged:[c.id]}:{}})},c.id)),n.length>g.length?(0,s.jsx)(X,{label:`+${n.length-g.length} more`}):null]})}var en=11/15,tn=fe(ge(()=>(__graviewPreload(import.meta.url,["./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.PIP6Z563.js")))).part((e,n)=>(0,s.jsx)(e.StatesBar,{...n}),{quiet:!0});function nn({text:e,accent:n}){let t=(0,P.useRef)(null),a=(0,P.useRef)(null),[o,g]=(0,P.useState)(1),[c,u]=(0,P.useState)(!1),m=o<1?`${o}em`:void 0;return(0,P.useLayoutEffect)(()=>{let d=t.current,f=a.current;if(!d||!f)return;let r=()=>{let y=d.clientWidth,k=f.offsetWidth;if(y<=0||k<=0)return;let h=parseFloat(getComputedStyle(f).fontSize)/parseFloat(getComputedStyle(d).fontSize)||1,w=k/h,S=Math.max(en,Math.min(1,Math.floor(y/w*100)/100));g(x=>Math.abs(x-S)<.01?x:S),u(w*S>y+.5)};if(r(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(r);return l.observe(d),()=>l.disconnect()},[e]),(0,s.jsx)("span",{ref:t,"data-graview-district-name":"",...o<1?{"data-graview-fitted":""}:{},...c?{title:e}:{},style:{display:"block",minWidth:0,fontSize:"0.9375rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,s.jsx)("span",{ref:a,style:{fontSize:m},children:e})})}function Pt(e,n){return!!e?.display?.page?.groups?.length||Re(n,e).some(t=>t.long)}function At(e,n=me(e)){for(let t of e.kinds){let a=e.tryDefinition(t),o=a?.plural??`${String(t)}s`,g=r=>{let l=r.node,y=he(),k=(0,P.useContext)(oe);if(!l)return null;let h=k?.nodeId===l.id?k:null,w=$(a,l),S=r.mode==="fullscreen"?Ut(l,w)??w:w,x=Ke(y,[l.id]);return(0,s.jsxs)(U,{title:(0,s.jsx)(vt,{nodeId:l.id,children:h?.title??S}),...h?{}:{subtitle:a?.describe?at(a,l):a?.description??String(t)},selected:r.selected,...r.flagged?.includes(l.id)?{tone:"warning"}:{},fit:!0,children:[h?(0,s.jsx)(oe.Provider,{value:null,children:h.body}):null,(0,s.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"22px 34px",alignItems:"flex-start"},children:[(0,s.jsx)("div",{style:{flex:Pt(a,l)?"1 1 100%":"1 1 0",minWidth:"min(200px, 100%)"},children:(0,s.jsx)(wt,{id:l.id,shown:[S,w,a?.description,h?.title],...h?{hide:[...h.fields]}:{}})}),(0,s.jsx)("div",{style:{flex:Pt(a,l)?"1 1 100%":"1.4 1 0",minWidth:"min(220px, 100%)"},children:(0,s.jsx)(xt,{id:l.id,empty:`Nothing is connected to this ${H(a,String(t))} yet.`,...h?{hide:h.records}:{}})})]}),x.length>0?(0,s.jsx)("p",{"data-graview-broken":"",style:{margin:"14px 0 0",paddingTop:12,borderTop:"1px solid var(--graview-edge)",fontSize:"0.875rem",color:"var(--graview-warn)"},children:x.map(b=>b.message).join(" \xB7 ")}):null]})},c=r=>{let l=r.node;if(!l)return null;let{store:y}=V(),k=a?.computed?lt(y.schema,y.graph,l):l,h=Re(k,a,{limit:3,said:[$(a,l)],glance:!0}),w=Ae(t),S=h.filter(N=>!N.long&&!N.markdown),x=h.find(N=>N.long||N.markdown),b=ot(l,a);return(0,s.jsxs)(U,{title:$(a,l),selected:r.selected,tone:r.flagged?.includes(l.id)?"warning":"muted",fit:!0,children:[b?(0,s.jsx)(ve,{as:"thumb",file:b,size:64,style:{marginBottom:6}}):null,(0,s.jsx)(it,{items:S.map(N=>({id:N.key,label:N.alone,hue:w})),max:3}),x?(0,s.jsx)("p",{"data-graview-excerpt":x.key,title:x.value,style:{margin:S.length>0?"6px 0 0":0,fontSize:"0.8125rem",lineHeight:1.35,color:"var(--graview-ink-muted)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:x.value}):null]})},u=r=>{let l=r.node,y=Ae(t),k=we().marks.flag;if(!l)return null;let h=r.flagged?.includes(l.id)??!1;return(0,s.jsx)(X,{label:h?`${$(a,l)} ${k}`:$(a,l),hue:y,selected:r.selected,title:h?`${ee(H(a,String(t)))} \u2014 implicated in a problem`:ee(H(a,String(t)))})},m=r=>r.fidelity==="full"?(0,s.jsx)(P.Suspense,{fallback:(0,s.jsx)(d,{...r}),children:(0,s.jsx)(qt,{kind:String(t),members:r.nodes??[],...r.flagged?{flagged:r.flagged}:{},...r.label?{label:r.label}:{},...r.retired?{retired:r.retired}:{}})}):(0,s.jsx)(d,{...r}),d=r=>{let{brand:l,store:y,views:k}=V(),{view:h,go:w}=Ne(),S=r.nodes??[],x=k.lookup(String(t),{cardinality:"one",fidelity:"glyph"}),b=x!==void 0&&!pe(x)?x:void 0,N=mt(h),C=ut(S,N,{schema:e,graph:y.graph,flagged:new Set(r.flagged??[])}),L=R=>({id:R.id,label:$(e.tryDefinition(R.kind),R),hue:te(R.kind,l?.accents)}),W=r.fidelity==="full"&&S.length>1?(0,s.jsx)(P.Suspense,{fallback:null,children:(0,s.jsx)(_t,{schema:e,graph:y.graph,kind:String(t),arrangement:N,onChange:R=>w(ht(h,R)),kept:{shown:C.nodes.length,of:S.length},style:{marginBottom:8}})}):null,se=R=>R.some(A=>r.flagged?.includes(A.id)),le=he(),Y=we().marks.flag,z=(R,A,de)=>b?(0,s.jsx)(U,{title:R,meta:(0,s.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(be,{kind:String(t),plural:o,problems:Se(le,A),flag:Y}),(0,s.jsx)("span",{title:`${Q(A.length)} ${A.length===1?H(a,String(t)):o.toLowerCase()}`,children:Q(A.length)})]}),tone:se(A)?"warning":"muted",children:(0,s.jsx)(Qt,{View:b,members:A,mode:r.mode,...r.flagged?{flagged:r.flagged}:{}})},de):(0,s.jsx)(rt,{label:R,count:A.length,flagged:se(A),items:A.map(L),problems:(0,s.jsx)(be,{kind:String(t),plural:o,problems:Se(le,A),flag:Y})},de);return C.grouped?(0,s.jsxs)("div",{style:{display:"grid",gap:8},"data-graview-grouped":N.group?.by,children:[W,C.groups.map(R=>z(`${r.label??o} \xB7 ${R.label}`,R.nodes,R.key||"-"))]}):(0,s.jsxs)("div",{style:{display:"grid",gap:4},children:[W,z(r.label??o,C.nodes)]})},f=r=>{let l=r.nodes??[],y=Xt(l.map(p=>$(a,p)),r.openedRows??dt(l.length)),k=Ae(t),{brand:h}=V(),w=tt(String(t),e,h),S=we().marks.flag,{selection:x,set:b,clear:N}=xe(),{toggle:C,view:L,go:W}=Ne(),{views:se,hiddenKinds:le}=V(),Y=(0,P.useContext)(Qe),z=L.overview&&!le.has(String(t))?se.places().filter(p=>p.kind===String(t)):[],R=r.focused?L.within?.view??z[0]?.as:void 0,A=l.filter(p=>r.flagged?.includes(p.id)).length,de=A>0,Ot=he(),Ht=Se(Ot,l),F=(L.overview??!1)&&r.nestedUnder===void 0,G=r.focused||r.raised,He=r.rank==="secondary"&&!G,M=r.nestedUnder!==void 0,Ie=new Set(x),K=Y?x.length===1&&x[0]===ne(String(t)):r.opened??!1,It=ct(),O=G||F?0:l.filter(p=>It.includes(p.id)&&!Ie.has(p.id)).length,ke=O>0&&!de,ce=Ze(),_=ce&&!M?ce.byKind[String(t)]??0:0,We=(0,P.useRef)(null),ze=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let p=ze.current,D=We.current;if(!p||!D||!F)return;let T=()=>D.style.setProperty("--graview-plate-h",`${p.offsetHeight}px`);if(T(),typeof ResizeObserver>"u")return;let Z=new ResizeObserver(T);return Z.observe(p,{box:"border-box"}),()=>Z.disconnect()},[F]);let Wt=M?8:Math.min(46,10+Math.round(Math.sqrt(l.length)*8)),Fe=M?(0,s.jsx)("span",{style:{fontSize:"0.75rem",lineHeight:1.25,letterSpacing:"0.05em",textTransform:"uppercase",color:G?"var(--graview-accent)":"var(--graview-ink-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.label??o}):(0,s.jsx)(nn,{text:r.label??o,accent:!!G});return(0,s.jsxs)("div",{ref:We,className:"graview-kind-card","data-graview-rank":r.rank,"data-graview-landmark":w||void 0,"data-graview-nested":M||void 0,"data-graview-tied":O||void 0,"data-graview-hits":ce&&!M?_:void 0,"data-graview-emphasis":ce&&!M?_>0?"lit":"dimmed":void 0,...a?.description||M?{title:M?[r.label??o,a?.description].filter(Boolean).join(" \u2014 "):a.description}:{},style:{position:"relative",height:"100%","--graview-hue":Math.round(k)},children:[w?(0,s.jsx)("span",{className:"graview-kind-block graview-kind-landmark","data-graview-opened":r.opened||void 0,"aria-hidden":"true",style:{"--graview-rise":Wt},children:(0,s.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:96})}):null,(0,s.jsxs)("div",{ref:ze,className:"graview-kind-face","data-graview-opened":r.opened||void 0,"data-graview-nameplate":F?r.nameplate??"full":void 0,style:{display:"flex",flexDirection:"column",gap:M?1:3,padding:M?"5px 7px":"7px 10px",borderRadius:"var(--graview-radius-sm, 9px)",justifyContent:"center",position:"relative",height:"100%",overflow:"hidden",boxSizing:"border-box",border:G?"1px solid var(--graview-accent)":O>0?"1px solid var(--graview-accent-dim)":`1px solid hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.34)`,backgroundColor:"var(--graview-panel)",backgroundImage:`linear-gradient(hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:He?.28:.5})), hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * ${G?1.1:He?.28:.5})))`,boxShadow:G?"0 0 0 1px var(--graview-accent-dim)":void 0},children:[!M&&!F&&l.length>0?(0,s.jsx)("div",{"data-graview-tally":l.length,"data-graview-broken":A||void 0,"aria-hidden":"true",style:{position:"absolute",left:0,right:0,top:0,display:"flex",height:3,background:`hsl(${Math.round(k)} 55% var(--graview-tint-lightness) / 0.4)`},children:A>0?(0,s.jsx)("span",{style:{width:`${Math.max(6,Math.round(A/l.length*100))}%`,background:"var(--graview-warn)"}}):null}):null,w?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:M?4:6},children:[(0,s.jsx)(ae,{kind:String(t),schema:e,...h?{brand:h}:{},size:M?14:18}),Fe]}):Fe,(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"0.875rem"},children:[(0,s.jsx)("span",{title:l.length>0?`${Q(l.length)} ${l.length===1?H(a,String(t)):o.toLowerCase()}`:void 0,style:{fontVariantNumeric:"tabular-nums",color:ke?"var(--graview-accent)":"var(--graview-ink-faint)"},children:l.length===0?"none yet":ke?O===l.length?`${O} tied`:`${O} of ${l.length} tied`:Q(l.length)}),(0,s.jsx)(be,{kind:String(t),plural:o,problems:Ht,flag:S,listed:K}),(r.retired??0)>0?(0,s.jsxs)("button",{type:"button",className:"graview-kind-past","data-graview-retired":r.retired,title:`${r.retired} retired ${o.toLowerCase()} \u2014 press to widen the view to the past`,onClick:p=>{p.stopPropagation(),W(pt(L,!0))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:["+",r.retired," past"]}):null,_>0?(0,s.jsxs)("button",{type:"button",className:"graview-kind-hits","data-testid":`hits-${String(t)}`,title:`${_} ${_===1?"match":"matches"} for \u201C${L.q??""}\u201D \u2014 press to go in, narrowed`,onClick:p=>{p.stopPropagation(),W(Xe(L,ne(String(t)),{ownPicture:!0,...L.q?{carry:L.q}:{}}))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[_," match"]}):null,O>0&&!ke?(0,s.jsxs)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-accent)"},children:[O," tied"]}):null,r.hasOwnView&&!F?(0,s.jsx)("span",{title:`${o} has a view of its own`,"aria-label":"has its own view",style:{fontSize:"0.6875rem",color:"var(--graview-accent)"},children:"\u25C6"}):null,!M&&l.length>0&&!r.focused?(0,s.jsxs)("button",{type:"button",className:"graview-kind-open","data-testid":`open-${String(t)}`,"aria-expanded":K,"aria-label":K?`Close up the ${o}`:`See the ${o} in here`,title:K?"Close it up":`See the ${o} in here`,onClick:p=>{p.stopPropagation(),Y?K?N():b([ne(String(t))]):C(ne(String(t)))},onDoubleClick:p=>p.stopPropagation(),onPointerDown:p=>p.stopPropagation(),children:[(0,s.jsx)("span",{className:"graview-kind-open-word",children:K?"close":"open"})," ",(0,s.jsx)("span",{"aria-hidden":"true",children:K?"\u25B4":"\u25BE"})]}):null]}),F&&r.states?(0,s.jsx)(P.Suspense,{fallback:null,children:(0,s.jsx)(tn,{states:r.states,definition:a})}):null,r.opened?(0,s.jsxs)("div",{className:"graview-kind-members","data-graview-buildings":r.plot?.side??1,style:{display:"grid",gridTemplateColumns:`repeat(${y.columns}, minmax(0, 1fr))`,gap:3},children:[l.slice(0,y.shown).map(p=>{let D=r.flagged?.includes(p.id)??!1,T=$(a,p);return(0,s.jsx)(X,{pickId:p.id,label:D?`${T} ${S}`:T,title:D?`${T} \u2014 implicated in a problem`:void 0,hue:k,selected:Ie.has(p.id)},p.id)}),l.length>y.shown?(0,s.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",padding:"2px 4px",gridColumn:"1 / -1"},children:["+",l.length-y.shown," more \u2014 double-click to go in"]}):null]}):null]}),!M&&z.length>0?(0,s.jsx)("div",{className:"graview-drive-in","data-testid":`drive-in-${String(t)}`,"data-graview-showing":R,onPointerDown:p=>p.stopPropagation(),onDoubleClick:p=>p.stopPropagation(),children:(0,s.jsx)("div",{className:"graview-drive-in-marquee",role:"group","aria-label":`${o}: pictures`,"data-graview-thumbs":z.length===1?"one":"two",children:z.map(p=>{let D=R===p.as;return(0,s.jsxs)("div",{className:"graview-drive-in-thumb","data-graview-pressed":D||void 0,children:[(0,s.jsx)("span",{className:"graview-drive-in-thumb-title","aria-hidden":"true",children:p.title}),(0,s.jsx)("button",{type:"button",className:"graview-drive-in-thumb-press","data-testid":`showing-${p.as}`,"aria-label":`${o}: ${p.title}`,"aria-pressed":D,title:D?`${p.title} is showing \u2014 press again to open it`:`Show ${p.title} on the billboard \u2014 double-click to open it`,onClick:T=>{T.stopPropagation();let Z=()=>W(Je(L,String(t),p.as));if(T.detail>=2||D&&r.focused){Z();return}W(_e(je(qe(L,!0),Ue(String(t))),"view",p.as)),T.detail===1&&Zt(T.currentTarget.ownerDocument,Ct(T.nativeEvent),Z)}})]},p.as)})})}):null]})};m.generic=!0,f.generic=!0,n.register(t,{cardinality:"one",fidelity:"full"},j(g)).register(t,{cardinality:"one",fidelity:"summary"},j(c)).register(t,{cardinality:"one",fidelity:"glyph"},j(u)).register(t,{cardinality:"many",fidelity:"full"},j(m)).register(t,{cardinality:"many",fidelity:"summary"},j(m)).register(t,{cardinality:"many",fidelity:"glyph"},j(f))}return n}var Me=E(I(),1),$t=new WeakMap;function an(e){let n=$t.get(e);return n||$t.set(e,n=At(e,me(e))),n}var Ve=et;function Vt(){return(0,$e.useContext)(Ve)}function jn({children:e}){return(0,Me.jsx)(Ve.Provider,{value:!0,children:e})}function Mt(e){let n=(0,$e.useContext)(Ve),{store:t}=V();if(n)return null;let a=e.kind??e.node?.kind??e.nodes?.[0]?.kind;if(!a)return null;let o=an(t.schema).lookup(a,{cardinality:e.cardinality,fidelity:e.fidelity});return o?(0,Me.jsx)(o,{...e}):null}var i=E(I(),1),Tt=(0,v.createContext)(null),Et=(e,n)=>e.trim().toLowerCase().replace(/[_-]+/g," ")===n.trim().toLowerCase().replace(/[_-]+/g," "),rn=(0,v.createContext)(null),Be=(0,v.createContext)(null);function Lt({block:e}){let n=(0,v.useContext)(Be),t=n?.slots?.[e.key],a=(0,i.jsx)(on,{block:e});return t?(0,i.jsx)(v.Suspense,{fallback:a,children:(0,i.jsx)(t,{block:e,node:n.node,drawn:a})}):a}function on({block:e}){let n=(0,v.useContext)(Tt),t=(0,v.useContext)(ln),a=(0,v.useContext)(Te),o=(0,v.useContext)(Pe);if(n&&e.t==="badge"&&n.values.some(g=>Et(g,e.text))||n&&e.t==="field"&&n.field!==void 0&&e.field===n.field||e.t==="badge"&&/^0(?:\s+\p{L}+)?$/u.test(e.text.trim()))return null;switch(e.t){case"title":return(0,i.jsx)("strong",{className:"graview-spec-title",...o!==null&&Et(o,e.text)?{"aria-hidden":!0}:{},children:e.text});case"text":return e.markdown||Ce(e.text)?(0,i.jsx)("div",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:(0,i.jsx)(ft,{text:e.text,markdown:e.markdown})}):(0,i.jsx)("p",{className:"graview-spec-text",...e.tone?{"data-graview-tone":e.tone}:{},children:e.text});case"badge":return(0,i.jsx)("span",{className:"graview-spec-badge","data-graview-tone":e.tone,children:e.text});case"field":return(0,i.jsxs)("span",{className:"graview-spec-field","data-graview-field":e.field,children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",...Ce(e.text)?{style:{whiteSpace:"pre-line"}}:{},children:e.linked?(0,i.jsx)(gt,{relation:e.linked.relation,refs:e.linked.refs,as:"chip"}):e.app?(0,i.jsx)(yt,{address:e.app}):e.href?(0,i.jsx)("a",{className:"graview-spec-link",href:e.href,...e.href.startsWith("tel:")?{}:{rel:"noopener noreferrer",target:"_blank"},children:e.text}):e.text})]});case"image":return(0,i.jsx)(ve,{as:"block",field:e.field,files:e.files,label:e.label,view:e.as});case"progress":return e.value===void 0||e.max===void 0?(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]}):(0,i.jsxs)("span",{className:"graview-spec-progress",children:[(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}),(0,i.jsx)("span",{className:"graview-spec-track",role:"progressbar","aria-label":e.label,"aria-valuemin":0,"aria-valuemax":e.max,"aria-valuenow":Math.max(0,Math.min(e.value,e.max)),"aria-valuetext":e.text,children:(0,i.jsx)("span",{className:"graview-spec-fill",style:{width:`${Math.round(Math.max(0,Math.min(e.value,e.max))/e.max*100)}%`}})}),(0,i.jsx)("span",{className:"graview-spec-value",children:e.text})]});case"group":return(0,i.jsx)("span",{className:"graview-spec-group","data-direction":e.direction,children:(0,i.jsx)(Ee,{blocks:e.blocks})});case"when":return e.shown?(0,i.jsx)(Ee,{blocks:e.blocks}):null;case"divider":return(0,i.jsx)("hr",{className:"graview-spec-divider"});case"figure":return(0,i.jsx)(sn,{});case"headline":{let g=`h${Math.min(6,e.level+t)}`,c=(0,i.jsx)(g,{className:"graview-spec-headline","data-level":e.level,children:e.text});return a!==null&&e.level===1?(0,i.jsxs)(i.Fragment,{children:[c,a]}):c}case"number":return(0,i.jsxs)("span",{className:"graview-spec-number",...e.emphasis?{"data-emphasis":e.emphasis}:{},children:[(0,i.jsx)("span",{className:"graview-spec-number-value",children:e.text}),e.label?(0,i.jsx)("span",{className:"graview-spec-label",children:e.label}):null]});case"list":return(0,i.jsx)(cn,{list:e})}}function sn(){let e=(0,v.useContext)(Be)?.figure;return e?(0,i.jsx)("span",{className:"graview-spec-figure","aria-hidden":"true",children:e()}):null}function Ee({blocks:e}){let n=[];for(let t=0;t<e.length;t++){let a=t;for(;e[a]?.t==="badge"&&e[a+1]?.t==="badge";)a++;if(a===t){n.push((0,i.jsx)(Lt,{block:e[t]},t));continue}n.push((0,i.jsx)("span",{className:"graview-spec-badges",children:e.slice(t,a+1).map((o,g)=>(0,i.jsx)(Lt,{block:o},g))},t)),t=a}return n}function Dt({blocks:e,ctx:n,view:t}){let a=(0,v.useContext)(rn)?.[t];return(0,i.jsx)(Be.Provider,{value:{figure:n.figure,slots:a,node:n.node},children:(0,i.jsx)(Ee,{blocks:e})})}function Ge({blocks:e,ctx:n,view:t}){return(0,i.jsx)(Dt,{blocks:J(e,n),ctx:n,view:t})}var Le=3,Bt=(0,v.createContext)(0),Gt=(0,v.createContext)(null),ln=(0,v.createContext)(0),Te=(0,v.createContext)(null);function dn({node:e,as:n,depth:t,said:a=null}){let{store:o,views:g}=V(),c=$(o.schema.tryDefinition(e.kind),e),u=g.lookup(e.kind,{cardinality:"one",fidelity:n==="card"?"summary":"glyph"});return n==="row"&&t<=Le&&(!u||pe(u))?(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(De,{node:e,label:c}),(0,i.jsx)("div",{className:"graview-spec graview-spec-row","data-graview-spec":"row","data-graview-kind":e.kind,"aria-hidden":"true",children:(0,i.jsx)("strong",{className:"graview-spec-title",children:c})})]}):(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":e.id,"data-as":n,children:[(0,i.jsx)(De,{node:e,label:c}),t<=Le&&u?(0,i.jsx)(Ye,{mode:"scene",children:(0,i.jsx)(Bt.Provider,{value:t,children:(0,i.jsx)(Tt.Provider,{value:a,children:(0,i.jsx)(Pe.Provider,{value:c,children:(0,i.jsx)(u,{node:e,cardinality:"one",fidelity:n==="card"?"summary":"glyph",mode:"scene",selected:!1})})})})}):(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:c})]})}function De({node:e,label:n}){let t=(0,v.useContext)(Gt),a=(0,v.useRef)(null);return bt(a),t?(0,i.jsx)("a",{ref:a,className:"graview-spec-item-link",href:t.href(e),"aria-label":n,onClick:o=>{o.metaKey||o.ctrlKey||o.shiftKey||o.button!==0||(o.preventDefault(),o.stopPropagation(),t.go(e))}}):(0,i.jsx)("button",{ref:a,type:"button",className:"graview-spec-item-link","data-graview-pick":e.id,"aria-label":n})}function cn({list:e}){let n=(0,v.useContext)(Bt)+1,{store:t}=V(),a=(0,v.useContext)(Gt),[o,g]=(0,v.useState)(e.members.length);if(e.failed)return(0,i.jsx)("p",{className:"graview-spec-text",children:"\u2014"});if(e.members.length===0)return e.empty?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-empty",children:e.empty}):null;let c=(b,N=null)=>n>Le?(0,i.jsx)("ul",{className:"graview-spec-list","data-as":"names",children:b.map(C=>(0,i.jsxs)("li",{className:"graview-spec-item","data-graview-listed":C.id,"data-as":"name",children:[(0,i.jsx)(De,{node:C,label:$(t.schema.tryDefinition(C.kind),C)}),(0,i.jsx)("span",{className:"graview-spec-item-name","aria-hidden":"true",children:$(t.schema.tryDefinition(C.kind),C)})]},C.id))}):(0,i.jsx)("ul",{className:"graview-spec-list","data-as":e.as,children:b.map(C=>(0,i.jsx)(dn,{node:C,as:e.as,depth:n,said:N},C.id))}),u=e.rest??[],m=Math.min(o,e.members.length+u.length),d=m>e.members.length?[...e.members,...u].slice(0,m):e.members,f=e.members.length+u.length-m,r=Math.max(1,e.members.length),l=f>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,i.jsx)("button",{type:"button",className:"graview-spec-show-more","data-graview-show-more":f,onClick:()=>g(m+r),children:`Show ${Math.min(r,f)} more`})}):null,y=e.total??e.members.length+e.more,k=e.more-u.length,h=l??(a?.more&&y>d.length?a.more({members:d,total:y}):k>0?(0,i.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${k} more`}):null);if(!e.groups)return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[c(d),h]});let w=`h${e.headingLevel}`,S=m,x=m>e.members.length&&e.everyGroup?e.everyGroup.flatMap(b=>{if(S<=0)return[];let N=b.members.slice(0,S);return S-=N.length,[{...b,members:N}]}):e.groups;return(0,i.jsxs)("div",{className:"graview-spec-listing",children:[x.map(b=>(0,i.jsxs)("section",{className:"graview-spec-list-group","data-graview-group":b.value??"",children:[b.heading?(0,i.jsx)(w,{className:"graview-spec-list-heading",children:b.heading}):null,c(b.members,b.value!==null?{values:[b.value,...b.heading?[b.heading]:[]]}:null)]},b.value??"")),h]})}function sa({blocks:e,heading:n=2,firstHeading:t,slot:a,view:o=a}){let{store:g,brand:c}=V();ue();let u=re(g,null,null,{heading:n,firstHeading:t,money:c}),m=(0,v.useContext)(Te),d=e.some(f=>f.t==="headline");return(0,i.jsxs)("div",{className:`graview-spec graview-spec-${a}`,"data-graview-spec":a,children:[m!==null&&!d?m:null,(0,i.jsx)(Te.Provider,{value:d?m:null,children:(0,i.jsx)(Ge,{blocks:e,ctx:u,view:o})})]})}function Oe(e,n="card"){let{store:t,brand:a}=V(),o=t.schema;return{...re(t,null,e,{slot:n,money:a}),figure:()=>(0,i.jsx)(ae,{kind:e.kind,schema:o,...a?{brand:a}:{},size:22})}}function gn({slot:e,blocks:n,node:t,selected:a}){let o=Oe(t,e);return(0,i.jsx)("div",{className:`graview-spec graview-spec-${e}`,"data-graview-spec":e,"data-graview-kind":t.kind,...e==="row"&&n.some(st)?{"data-graview-tall":""}:{},...a?{"data-selected":""}:{},children:(0,i.jsx)(Ge,{blocks:n,ctx:o,view:`${t.kind}.${e}`})})}function un({blocks:e,node:n,selected:t,flagged:a}){let o=Oe(n),[g,...c]=e,u=g?.t==="title";return(0,i.jsx)(U,{...u?{title:J([g],o)[0].text}:{},selected:t,tone:a?"warning":"muted",fit:!0,children:(0,i.jsx)("div",{className:"graview-spec graview-spec-card","data-graview-spec":"card","data-graview-kind":n.kind,children:(0,i.jsx)(Ge,{blocks:u?c:e,ctx:o,view:`${n.kind}.card`})})})}function pn({blocks:e,props:n}){let t=n.node,a=Oe(t,"page"),o=Vt(),g=J(e,a),c=ye(e,g),u=c.title!==void 0&&(!o||c.title===$(a.schema?.tryDefinition(t.kind),t)),m=(0,i.jsx)("div",{className:"graview-spec graview-spec-page","data-graview-spec":"page","data-graview-kind":t.kind,children:(0,i.jsx)(Dt,{blocks:u?g.slice(1):g,ctx:a,view:`${t.kind}.page`})});return o?m:(0,i.jsx)(oe.Provider,{value:{nodeId:t.id,...c.title!==void 0?{title:c.title}:{},body:m,fields:c.fields,records:c.records},children:(0,i.jsx)(Mt,{...n})})}function la(e,n,t){return typeof e=="function"?e.says?.(n,t):void 0}function mn({blocks:e,node:n,selected:t}){let{store:a}=V();return(0,i.jsx)("div",{title:$(a.schema.tryDefinition(n.kind),n),style:{minWidth:0,maxWidth:"100%"},children:(0,i.jsx)(gn,{slot:"row",blocks:e,node:n,selected:t})})}function da(e,n,t){if(!t)return e;let a=new Set(n.kinds);for(let[o,g]of Object.entries(t)){if(!a.has(o)||!g)continue;let c=o;if(g.card){let u=ie(g.card),m=d=>d.node?(0,i.jsx)(un,{blocks:u,node:d.node,selected:d.selected,flagged:d.flagged?.includes(d.node.id)??!1}):null;e.register(c,{cardinality:"one",fidelity:"summary"},m)}if(g.row){let u=ie(g.row),m=d=>d.node?(0,i.jsx)(mn,{blocks:u,node:d.node,selected:d.selected}):null;m.says=(d,f)=>ye(u,J(u,re({graph:f,schema:n},null,d,{slot:"row"}))),e.register(c,{cardinality:"one",fidelity:"glyph"},m)}if(g.page){let u=ie(g.page),m=d=>d.node?(0,i.jsx)(pn,{blocks:u,props:d}):null;m.says=(d,f)=>ye(u,J(u,re({graph:f,schema:n},null,d))),e.register(c,{cardinality:"one",fidelity:"full"},m)}}return e}export{bt as a,jn as b,Tt as c,Gt as d,ln as e,Te as f,De as g,sa as h,la as i,da as j,At as k};
@@ -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{a as y}from"./chunk.5UL7YDUD.js";import{E as v,F as I,Q as h,Y as w}from"./chunk.6QWV5MVH.js";import{La as g}from"./chunk.MNP4JI33.js";import{b as d}from"./chunk.AJZBJBMO.js";var k=d(I(),1);var t=d(h(),1),r={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function E({shows:e,onShows:i,mine:a,onMine:l}){let o={all:"All",changes:"Changes",ai:"AI"};return(0,t.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(s=>(0,t.jsx)("button",{type:"button","data-shows":s,"aria-pressed":e===s,onClick:()=>i(s),style:{...r,...e===s?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:o[s]},s)),(0,t.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>l(!a),style:{...r,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var x=e=>e.ask.kind==="suggest"?"suggest":e.ask.kind==="fill"?"fill in":e.ask.kind==="record"?"add one":e.ask.kind==="panel"?"draw a panel":`answer \u201C${e.ask.said}\u201D`;function $(e){let i=e.offered.filter(a=>e.accepted?.includes(a.id)).map(a=>a.label);switch(e.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${e.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return e.panel?`Drew \u201C${e.panel.title}\u201D`:"Drew a panel";case"failed":return e.failed??"Failed";default:return"Offered, not yet taken"}}function C(e){let i=[...new Set((e.usage??[]).map(o=>o.model))];if(i.length===0)return null;let a=(e.usage??[]).flatMap(o=>o.costUsd===void 0?[]:[o.costUsd]),l=a.length>0?a.reduce((o,s)=>o+s,0):void 0;return`${i.join(", ")}${l!==void 0?` \xB7 $${l<.01?l.toPrecision(2):l.toFixed(2)}`:""}`}function F({entry:e,undo:i}){let{store:a,principal:l,seats:o,people:s,ai:b}=w(),c=y(),[p,u]=(0,k.useState)(!1),A=e.by.kind==="human"&&e.by.onBehalfOf===void 0&&(e.by.id===void 0||l.id===void 0||e.by.id===l.id)?"you":g(e.by,{graph:a.graph,schema:a.schema,seats:o,people:s}),f=C(e),S=v(b),m=n=>{u(!0),(__graviewPreload(import.meta.url,["./chunk.AKFKM4SW.js","./chunk.XANVHJQ4.js","./chunk.OKRNJXTV.js","./chunk.CAVBSL27.js","./chunk.5UL7YDUD.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.PBSMLINK.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.KSES5U5B.js")).then(n).finally(()=>u(!1))};return(0,t.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":e.id,"data-outcome":e.outcome,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:(0,t.jsxs)("span",{style:{minWidth:0},children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:A})," ",(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["asked AI to ",x(e)]}),(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.targetLabel]})]})}),e.offered.length>0&&e.outcome!=="accepted"&&e.outcome!=="partly"?(0,t.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",e.offered.map(n=>n.label).join(", ")]}):null,(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{"data-testid":"interaction-outcome",style:{color:e.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:$(e)}),(e.batches??[]).map(n=>(0,t.jsx)("span",{"data-interaction-batch":n,style:{marginLeft:"auto"},children:i(n)},n))]}),f?(0,t.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,S?(0,t.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.panel?(0,t.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:p,onClick:()=>m(n=>n.drawPanel(c,e.panel)),style:r,children:"Show the panel"}):null,(0,t.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:p,onClick:()=>m(n=>n.askAgain(c,e)),style:r,children:"Ask again"})]}):null]})}export{E as a,F as b};
@@ -1 +1 @@
1
- import{b as dt}from"./chunk.6T2Q6NLO.js";import{a as ct}from"./chunk.AK3IHFCF.js";import{f as ft}from"./chunk.HHPGWJDO.js";import{a as C,f as q}from"./chunk.42YX6NOY.js";import{D as Q,E as X,G as k,J as G,K as tt,M as nt,Ra as ot,Ta as st,W as _,Wa as it,Y as M,_ as et,ba as rt,da as at,rb as lt,rc as ut}from"./chunk.6V2RG5JG.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 wt(t){return D(t,!1)}function Ot(t){return D(t,!0)}function pt(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:a,space:o})=>({...a,space:o})),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 Et(t,e=!1){return t.line?pt(t.line,e):t.message}var mt=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={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},Pt={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},gt=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 ht(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},a=(l,m)=>r(l,m)?M(m).toLowerCase():I(rt(n(l),m)),o=l=>I(et(e,l)),d=l=>I(ft(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),Z=l.nodes.length-A.length;return L(Z>0?`${A.join(", ")} and ${Z} 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"?lt(l,{...t.money,...g}):nt(l,h));if(Q.test(l)||g?.format==="date")return L(G(l.slice(0,10),h));if(X.test(l))return L(tt(l,h));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>mt?`${l.slice(0,mt-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:a,plural:o,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(yt(n))!==JSON.stringify(yt(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var yt=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,a,o=e)=>j(u)<a?[v,...f(u,o,n),w]:f(u,o,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"),a=E(t.object,e,n);if(u&&a)return e!==null&&n.fieldName(e,t.name)===n.fieldName(a,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(a)}'s ${n.fieldName(a,t.name)}`)]:[O(n.fieldName(a,t.name))];let o=f(t.object,e,n),d=o[o.length-1];return o.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(a,t.name)}`)]:[...o,c("'s"),O(n.fieldName(a,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),a=f(t.filter,u,n),o=a.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...o?[]:[c("with")],...j(t.filter)<=2?[v,...a,w]:a]}case"binary":return bt(t,e,n);case"call":return Lt(t,e,n)}}function T(t,e,n){return gt(t)?bt({...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 bt(t,e,n){let r=(a,o)=>j(a)<o?[v,...f(a,e,n),w]:f(a,e,n);if(t.op==="&&"||t.op==="||"){let a=U(t);if(a){let d=P(a.subject,e,n);return[...f(a.subject,e,n),R("\u2208","is one of"),n.valueWords(a.values.map(x=>x.value),d)]}let o=t.op==="&&"?2:1;return[...r(t.left,o),c(t.op==="&&"?"and":"or"),...r(t.right,o+.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[a,o]=V[t.op],d=P(t.left,e,n),x=P(t.right,e,n);return[...S(t.left,e,n,x),R(a,o),...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=Pt[t.op];if(s){let a=j(t);return[...r(t.left,a),R(s[0],s[1]),...r(t.right,a+.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 Lt(t,e,n){let r=a=>t.args[a],s=a=>{let o=t.args[a];return o?.t==="lit"&&typeof o.value=="string"?o.value:void 0},u=a=>{let o=r(a);return j(o)<9&&o.t!=="where"?[v,...f(o,e,n),w]:f(o,e,n)};switch(t.fn){case"out":{let a=s(t.args.length-1)??"",o=O(M(a).toLowerCase());return t.args.length===2?[o,c("of"),...u(0)]:[o]}case"in":{let a=s(t.args.length-1)??"",o=t.args.length===2?n.nearOf(E(r(0),e,n),a):n.nearOf(e,a),d=O(o?n.plural(o):M(a).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let a=s(0),o=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=o===!0?[c("archived")]:o==="all"?[c("archived or not")]:[];return o===!0?[...d,O(a?n.plural(a):"everything")]:[O(a?n.plural(a):"everything"),...d]}case"fact":{let a=s(0);return[O(a?n.factName(a):"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 a=E(r(0),e,n),o=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(o)<=2?[v,...f(o,a,n),w]:f(o,a,n)]}case"sum":case"min":case"max":{let a=E(r(0),e,n),o=r(1),d=o.t==="lit"&&typeof o.value=="string"?[O(n.fieldName(a,o.value))]:j(o)<9?[v,...f(o,a,n),w]:f(o,a,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let a=r(0);if(b(a,"all")){let o=a.args[0]?.value;if(typeof o=="string")return[O(`the ${n.noun(o)}`)]}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 a=t.fn,[o,d]=[r(0),r(1)];return b(d,"today")||b(d,"now")?[c(`${a} since`),...f(o,e,n)]:b(o,"today")||b(o,"now")?[c(`${a} until`),...f(d,e,n)]:[c(`${a} from`),...f(o,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((a,o)=>o===0?f(a,e,n):[c(","),c("else"),...f(a,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((a,o)=>o===0?f(a,e,n):[c(","),...f(a,e,n)]),w]}}function H(t,e){let n=ht(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 Y(t,e,n){let r=ht(e),s=t.over==="graph"?null:t.over,u=n.subject,a=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},o=(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=a(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=>a(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[...o(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):o(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):o(i.left,m),R(h,y),...g?S(i.right,s,r,l):o(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...o(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 gt(p)?d({...p,op:B[p.op]}):b(p,"present")||b(p,"exists")?[...o(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=a(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 xt(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 At(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 vt(t,e){return{schema:e,said:xt(t.says),...t.declared?{formatOf:At(t.declared)}:{},...t.money?{money:t.money}:{}}}function Yt(t,e){return t.shape?H(t.shape,vt(t.shape,e)):void 0}var Rt=new WeakMap;function jt(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=Wt(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let a=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!a)return s;let o=u.kinds;o||(o=Rt.get(t.schema),o||Rt.set(t.schema,o=ct(t.schema)));try{let d=t.today?.()??u.today?.()??k(),x=Y(u,vt(u,t.schema),{graph:t.graph,subject:a??null,kinds:o,today:d});return{...s,line:x,...u.says?{}:{message:`${s.message} \u2014 ${x.text}`}}}catch{return s}})}function St(){it((t,e,n,r)=>jt({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),dt(Nt)}function Nt(t,e,n,r){let s=e.graph,u=st.from(t.schema,s.snapshot(),{validate:!1});for(let x of n?[...r].reverse().map(ot):r)try{u.applyPrimitives([x],{restoring:!0})}catch{}let a=x=>t.violations(void 0,x),o=a(n?u:s),d=a(n?s:u);return{...ut(t.allInvariants(),o,d),violationsAfter:d}}function Wt(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}St();export{Y as brokenLineOf,St as judgeWithLines,Nt as judgedForASeat,Et as problemWords,Yt as ruleLine,H as ruleLineOf,pt as ruleLineWords,J as ruleSpacing,Ot as ruleSpoken,wt as ruleText,Wt as unlined,jt as withLines};
1
+ import{b as dt}from"./chunk.G5NZVPJU.js";import{a as ct}from"./chunk.D75KC3LL.js";import{f as ft}from"./chunk.FWTIUYXH.js";import{a as C,f as q}from"./chunk.MAF7C3VM.js";import{$ as et,E as Q,F as X,H as k,K as G,L as tt,N as nt,Sa as ot,Ua as st,X as _,Xa as it,Z as M,ca as rt,ea as at,sb as lt,uc as ut}from"./chunk.MNP4JI33.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 wt(t){return D(t,!1)}function Ot(t){return D(t,!0)}function pt(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:a,space:o})=>({...a,space:o})),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 Et(t,e=!1){return t.line?pt(t.line,e):t.message}var mt=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={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},Pt={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},gt=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 ht(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},a=(l,m)=>r(l,m)?M(m).toLowerCase():I(rt(n(l),m)),o=l=>I(et(e,l)),d=l=>I(ft(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),Z=l.nodes.length-A.length;return L(Z>0?`${A.join(", ")} and ${Z} 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"?lt(l,{...t.money,...g}):nt(l,h));if(Q.test(l)||g?.format==="date")return L(G(l.slice(0,10),h));if(X.test(l))return L(tt(l,h));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>mt?`${l.slice(0,mt-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:a,plural:o,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(yt(n))!==JSON.stringify(yt(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var yt=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,a,o=e)=>j(u)<a?[v,...f(u,o,n),w]:f(u,o,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"),a=E(t.object,e,n);if(u&&a)return e!==null&&n.fieldName(e,t.name)===n.fieldName(a,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(a)}'s ${n.fieldName(a,t.name)}`)]:[O(n.fieldName(a,t.name))];let o=f(t.object,e,n),d=o[o.length-1];return o.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(a,t.name)}`)]:[...o,c("'s"),O(n.fieldName(a,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),a=f(t.filter,u,n),o=a.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...o?[]:[c("with")],...j(t.filter)<=2?[v,...a,w]:a]}case"binary":return bt(t,e,n);case"call":return Lt(t,e,n)}}function T(t,e,n){return gt(t)?bt({...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 bt(t,e,n){let r=(a,o)=>j(a)<o?[v,...f(a,e,n),w]:f(a,e,n);if(t.op==="&&"||t.op==="||"){let a=U(t);if(a){let d=P(a.subject,e,n);return[...f(a.subject,e,n),R("\u2208","is one of"),n.valueWords(a.values.map(x=>x.value),d)]}let o=t.op==="&&"?2:1;return[...r(t.left,o),c(t.op==="&&"?"and":"or"),...r(t.right,o+.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[a,o]=V[t.op],d=P(t.left,e,n),x=P(t.right,e,n);return[...S(t.left,e,n,x),R(a,o),...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=Pt[t.op];if(s){let a=j(t);return[...r(t.left,a),R(s[0],s[1]),...r(t.right,a+.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 Lt(t,e,n){let r=a=>t.args[a],s=a=>{let o=t.args[a];return o?.t==="lit"&&typeof o.value=="string"?o.value:void 0},u=a=>{let o=r(a);return j(o)<9&&o.t!=="where"?[v,...f(o,e,n),w]:f(o,e,n)};switch(t.fn){case"out":{let a=s(t.args.length-1)??"",o=O(M(a).toLowerCase());return t.args.length===2?[o,c("of"),...u(0)]:[o]}case"in":{let a=s(t.args.length-1)??"",o=t.args.length===2?n.nearOf(E(r(0),e,n),a):n.nearOf(e,a),d=O(o?n.plural(o):M(a).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let a=s(0),o=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=o===!0?[c("archived")]:o==="all"?[c("archived or not")]:[];return o===!0?[...d,O(a?n.plural(a):"everything")]:[O(a?n.plural(a):"everything"),...d]}case"fact":{let a=s(0);return[O(a?n.factName(a):"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 a=E(r(0),e,n),o=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(o)<=2?[v,...f(o,a,n),w]:f(o,a,n)]}case"sum":case"min":case"max":{let a=E(r(0),e,n),o=r(1),d=o.t==="lit"&&typeof o.value=="string"?[O(n.fieldName(a,o.value))]:j(o)<9?[v,...f(o,a,n),w]:f(o,a,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let a=r(0);if(b(a,"all")){let o=a.args[0]?.value;if(typeof o=="string")return[O(`the ${n.noun(o)}`)]}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 a=t.fn,[o,d]=[r(0),r(1)];return b(d,"today")||b(d,"now")?[c(`${a} since`),...f(o,e,n)]:b(o,"today")||b(o,"now")?[c(`${a} until`),...f(d,e,n)]:[c(`${a} from`),...f(o,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((a,o)=>o===0?f(a,e,n):[c(","),c("else"),...f(a,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((a,o)=>o===0?f(a,e,n):[c(","),...f(a,e,n)]),w]}}function H(t,e){let n=ht(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 Y(t,e,n){let r=ht(e),s=t.over==="graph"?null:t.over,u=n.subject,a=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},o=(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=a(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=>a(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[...o(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):o(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):o(i.left,m),R(h,y),...g?S(i.right,s,r,l):o(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...o(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 gt(p)?d({...p,op:B[p.op]}):b(p,"present")||b(p,"exists")?[...o(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=a(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 xt(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 At(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 vt(t,e){return{schema:e,said:xt(t.says),...t.declared?{formatOf:At(t.declared)}:{},...t.money?{money:t.money}:{}}}function Yt(t,e){return t.shape?H(t.shape,vt(t.shape,e)):void 0}var Rt=new WeakMap;function jt(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=Wt(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let a=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!a)return s;let o=u.kinds;o||(o=Rt.get(t.schema),o||Rt.set(t.schema,o=ct(t.schema)));try{let d=t.today?.()??u.today?.()??k(),x=Y(u,vt(u,t.schema),{graph:t.graph,subject:a??null,kinds:o,today:d});return{...s,line:x,...u.says?{}:{message:`${s.message} \u2014 ${x.text}`}}}catch{return s}})}function St(){it((t,e,n,r)=>jt({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),dt(Nt)}function Nt(t,e,n,r){let s=e.graph,u=st.from(t.schema,s.snapshot(),{validate:!1});for(let x of n?[...r].reverse().map(ot):r)try{u.applyPrimitives([x],{restoring:!0})}catch{}let a=x=>t.violations(void 0,x),o=a(n?u:s),d=a(n?s:u);return{...ut(t.allInvariants(),o,d),violationsAfter:d}}function Wt(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}St();export{Y as brokenLineOf,St as judgeWithLines,Nt as judgedForASeat,Et as problemWords,Yt as ruleLine,H as ruleLineOf,pt as ruleLineWords,J as ruleSpacing,Ot as ruleSpoken,wt as ruleText,Wt as unlined,jt as withLines};
@@ -0,0 +1 @@
1
+ function q(e){return e[3]===0&&e[7]===0&&e[11]===0&&e[15]===1}var Q=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function v(e,n,t){return[e,0,0,0,0,e,0,0,0,0,1,0,n,t,0,1]}function $(e=800){return[1,0,0,0,0,1,0,0,0,0,1,-1/e,0,0,0,1]}function z(e){if(typeof DOMMatrix>"u")throw new Error("DOMMatrix is unavailable outside a browser");return e instanceof DOMMatrix?e:new DOMMatrix([...e])}var C=["solid","dashed","dotted","double","tapered"],R=["arrow","none","dot","bar"];function V(e){let n=2166136261;for(let t=0;t<e.length;t++)n^=e.charCodeAt(t),n=Math.imul(n,16777619);return n>>>0}function T(e,n={}){let t=V(e);return{...{pattern:C[t%C.length],width:1.5+(t>>>3)%3*.75,cap:R[(t>>>7)%R.length],hue:(t>>>11)%360,opacity:.85},...n[e]}}var ee={solid:void 0,dashed:"7 5",dotted:"1 5",double:"12 3",tapered:"10 3 3 3"},ne="2 6",te=.6;function re(e){return e.color??`hsl(${Math.round(e.hue)} 55% 62%)`}function oe(e,n){return n?Math.max(1.6,e.width):Math.min(1.4,e.width)}var F={0:{scale:1,blur:0,falloff:0,shadow:.16,fidelity:"full"},1:{scale:.95,blur:.3,falloff:.26,shadow:.12,fidelity:"summary"},2:{scale:.9,blur:.3,falloff:.34,shadow:.07,fidelity:"glyph"}},Y={0:{scale:1,blur:0,falloff:0,shadow:.34,fidelity:"full"},1:{scale:.95,blur:.45,falloff:.18,shadow:.24,fidelity:"summary"},2:{scale:.9,blur:.45,falloff:.26,shadow:.14,fidelity:"glyph"}};function y(e,n="dark"){let t=Math.max(0,Math.min(2,Math.round(e)));return(n==="light"?F:Y)[t]}function N(e,n,t){let o=Math.max(0,Math.min(1,t)),r=(l,d)=>l+(d-l)*o;return{scale:r(e.scale,n.scale),blur:r(e.blur,n.blur),falloff:r(e.falloff,n.falloff),shadow:r(e.shadow,n.shadow),fidelity:o<.5?e.fidelity:n.fidelity}}function I(e,n,t,o,r){return v(e.scale,n,t)}function E(e,n="dark"){let t=e.onPlot?0:e.plane-(1-(e.depth??1))*.55,o=Math.max(0,Math.min(2,Math.floor(t))),r=Math.max(0,Math.min(2,Math.ceil(t)));return{style:o===r?y(o,n):N(y(o,n),y(r,n),t-o),blur:y(Math.max(0,Math.min(2,Math.round(t))),n).blur}}function de(e){return 1-e.falloff*.55}var ye=32;function pe(e,n,t){let o=t.capturedAt??{},r=[],l=[],d=[],c=[],h=[],b=[],p=new Map,O=[...e].sort((a,i)=>i.plane-a.plane);for(let a of O){let{style:i,blur:u}=E(a,t.scheme),s=I(i,a.x,a.y,t.canvasWidth,t.canvasHeight),m=a.width*i.scale,f=a.height*i.scale;p.set(a.id,{x:s[12]+m/2,y:s[13]+f/2});let w=s[12],M=s[13];if(w>=t.canvasWidth||M>=t.canvasHeight||w+m<=0||M+f<=0){l.push(a.id),a.dom||d.push({viewId:a.id,transform:s});continue}if(b.push({viewId:a.id,transform:s,width:a.width,height:a.height,depth:a.plane}),a.dom)continue;let S=_(a,i,o[a.id],t.changed);S&&r.push({viewId:a.id,reason:S,plane:a.plane}),c.push({viewId:a.id,transform:s,style:i,blur:u,width:m,height:f,opacity:a.opacity??1}),h.push({viewId:a.id,transform:s})}let D=t.captureBudget??Number.POSITIVE_INFINITY,H=new Set(r.filter(a=>a.reason!=="first").sort((a,i)=>a.plane-i.plane).slice(0,Math.max(0,D)).map(a=>a.viewId)),g=a=>a.reason==="first"||H.has(a.viewId),x=r.filter(g).map(({viewId:a,reason:i})=>({viewId:a,reason:i})),A=r.filter(a=>!g(a)),P=[];for(let a of n){let i=p.get(a.from),u=p.get(a.to);!i||!u||P.push({id:a.id,kind:a.kind,style:T(a.kind,t.connectorOverrides??{}),x1:i.x,y1:i.y,x2:u.x,y2:u.y,opacity:a.opacity??1})}return{captures:x,draws:c,connectors:P,geometry:h,placements:b,captureCount:x.length,deferred:A.map(a=>a.viewId),culled:l,offCanvas:d}}function _(e,n,t,o){if(t===void 0)return"first";if(e.opacity!==void 0&&e.opacity<1)return"changed";switch(n.fidelity){case"full":return o?e.dirty||o.has(e.id)?"live":null:"live";case"summary":case"glyph":return e.dirty||o?.has(e.id)?"changed":null}}function fe(e,n=new Set){let t=e.nodes.map(r=>({id:r.id,plane:r.plane,x:r.x,y:r.y,width:Math.round(r.width),height:Math.round(r.height),dirty:n.has(r.id)||"opacity"in r&&r.opacity<1,opacity:"opacity"in r?r.opacity:1,...r.depth!==void 0?{depth:r.depth}:{},...r.plot&&e.city&&Math.round(r.plane)===2?{onPlot:!0}:{}})),o=e.connectors.map(r=>({id:r.id,kind:r.kind,from:r.from,to:r.to,opacity:"opacity"in r?r.opacity:1}));return{views:t,connectors:o}}function B(e){let n=e[0],t=e[5];return n===0||t===0?null:{scaleX:1/n,scaleY:1/t,translateX:e[12],translateY:e[13]}}function G(e,n,t){let o=B(e.transform);if(!o)return null;let r=(n-o.translateX)*o.scaleX,l=(t-o.translateY)*o.scaleY;return r<0||l<0||r>e.width||l>e.height?null:{placement:e,x:r,y:l}}function K(e,n,t){let o=null;for(let r of e){let l=G(r,n,t);l&&(!o||r.depth<o.placement.depth)&&(o=l)}return o}var X=["pointerdown","pointerup","click","dblclick","contextmenu"],L=class{constructor(n,t={}){this.canvas=n;this.options=t}placements=[];detachers=[];replaying=!1;setPlacements(n){this.placements=n}attach(){if(this.options.platformHandlesHitTesting)return()=>{};for(let n of this.options.events??X){let t=o=>this.route(o);this.canvas.addEventListener(n,t,!0),this.detachers.push(()=>this.canvas.removeEventListener(n,t,!0))}return()=>this.detach()}detach(){for(let n of this.detachers.splice(0))n()}deepestAt(n){let t=n.placement.element,o=t.getBoundingClientRect(),r=o.left+n.x,l=o.top+n.y,d=typeof document.elementsFromPoint=="function"?document.elementsFromPoint(r,l):[document.elementFromPoint(r,l)].filter(c=>c!==null);for(let c of d)if(c===t||t.contains(c))return c;return t}route(n){if(this.replaying)return;let t=this.canvas.getBoundingClientRect(),o=K(this.placements,n.clientX-t.left,n.clientY-t.top);if(!o)return;let l=o.placement.element.getBoundingClientRect(),d=this.deepestAt(o);n.preventDefault(),n.stopPropagation(),this.replaying=!0;try{d.dispatchEvent(new PointerEvent(n.type,{bubbles:!0,cancelable:!0,composed:!0,clientX:l.left+o.x,clientY:l.top+o.y,pointerId:n.pointerId,pointerType:n.pointerType,button:n.button,buttons:n.buttons,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,altKey:n.altKey,metaKey:n.metaKey})),n.type==="pointerdown"&&d instanceof HTMLElement&&d.focus({preventScroll:!0})}finally{this.replaying=!1}}};var j=16.666666666666668,k=e=>e==="gpu"||e==="dom"?e:null;function ge(e=globalThis){let n=k(e.graviewRenderer);if(n)return n;let t=e.location?.search;return t?k(new URLSearchParams(t).get("renderer")):null}function xe(e=globalThis){if(!e.navigator||!("gpu"in e.navigator))return!1;let n=e.GPUQueue?.prototype;if(!n)return!1;let t=typeof n.drawElementImageToTexture=="function"||typeof n.copyElementImageToTexture=="function",o=e.HTMLCanvasElement?.prototype;return!t||!o||typeof o.requestPaint!="function"?!1:U(o)}function U(e){return typeof e.captureElementImage=="function"&&!("layoutSubtree"in e)}function Pe(e,{operator:n=null,present:t}){return(e==="auto"?n??"gpu":e)==="gpu"&&t?"gpu":"dom"}function we({off:e=!1,reducedMotion:n=!1,reducedTransparency:t=!1}){return!e&&!n&&!t}function W(e,n){if(e.length===0)return 0;let t=[...e].sort((o,r)=>o-r);return t[Math.min(t.length-1,Math.floor(n*t.length))]}function Me(e,n=j){return W(e,.95)<=n}export{q as a,Q as b,v as c,$ as d,z as e,Y as f,y as g,N as h,I as i,E as j,de as k,T as l,ee as m,ne as n,te as o,re as p,oe as q,ye as r,pe as s,fe as t,L as u,j as v,ge as w,xe as x,Pe as y,we as z,Me as A};
@@ -0,0 +1 @@
1
+ import{a as f}from"./chunk.CAVBSL27.js";import{X as d}from"./chunk.MNP4JI33.js";function w(n){let o=n.indexOf("{"),r=n.indexOf("["),t=r!==-1&&(o===-1||r<o)?r:o;if(t===-1)return;let e=n[t],a=e==="["?"]":"}",i=0,c=!1,l=!1;for(let s=t;s<n.length;s++){let u=n[s];if(c){l?l=!1:u==="\\"?l=!0:u==='"'&&(c=!1);continue}if(u==='"')c=!0;else if(u===e)i+=1;else if(u===a&&(i-=1,i===0))try{return JSON.parse(n.slice(t,s+1))}catch{return}}}function v(n,o){let r;try{r=n.mutation(o.mutation)}catch{return o}let t={...o.args},e=!1;for(let a of f(r.input)){if(a.control!=="node")continue;let i=t[a.name];if(typeof i!="string"||i.length===0||n.graph.getNode(i))continue;let c=i.trim().toLowerCase(),l=[...n.graph.allNodes()].filter(s=>(a.kinds.includes("*")||a.kinds.includes(s.kind))&&d(n.schema.tryDefinition(s.kind),s).trim().toLowerCase()===c);l.length===1&&(t[a.name]=l[0].id,e=!0)}return e?{...o,args:t}:o}function P(n,o,r){let t=r===void 0?null:new Set(r),e=[];for(let a of o){if(typeof a.mutation!="string")continue;let i=!0;try{n.mutation(a.mutation)}catch{i=!1}i?t&&!t.has(a.mutation)&&e.push({proposal:a,why:"not-allowed"}):e.push({proposal:a,why:"unknown"})}return e}function x(n,o,r){let t=r===void 0?null:new Set(r);return o.filter(e=>{if(typeof e.mutation!="string"||t&&!t.has(e.mutation))return!1;try{n.mutation(e.mutation)}catch{return!1}return e.args!==null&&typeof e.args=="object"})}export{w as a,v as b,P as c,x as d};
@@ -0,0 +1 @@
1
+ import{a as g}from"./chunk.UGFJKSHU.js";import{C as m,G as y,ja as a,ma as k,tb as w}from"./chunk.MNP4JI33.js";var p=i=>i?._zod?.def,h=/^\^\\d\{4\}-\\d\{2\}-\\d\{2\}\$$/;function b(i){let t=p(i),d=!0,f;for(let e=0;t&&e<4;e++){if(t.type==="optional"||t.type==="nullable")d=!1;else if(t.type==="default")d=!1,f=t.defaultValue;else break;t=p(t.innerType)}if(!t)return{why:"it is not a zod field"};let u=m(i),r={...d?{required:!0}:{},...f!==void 0?{default:f}:{},...u?{description:u}:{}},s=(t.checks??[]).map(e=>p(e)),c=a(i);if(c)return{spec:{type:c,...r}};if(k(i))return{spec:{type:"app-link",...r}};if(g(i))return{spec:{type:"text",format:"markdown",...r}};let l=w(i);if(l)return{spec:{type:l,...r}};switch(t.type){case"string":{let e=t.format;return e==="email"?{spec:{type:"email",...r}}:e==="url"?{spec:{type:"url",...r}}:e==="date"?{spec:{type:"date",...r}}:e==="datetime"||s.some(n=>n?.fn===y)?{spec:{type:"datetime",...r}}:s.some(n=>n?.format==="regex"&&h.test(String(n?.pattern?.source??"")))?{spec:{type:"date",...r}}:{spec:{type:"string",...r}}}case"number":{let e={};for(let n of s){let o=n?.value;typeof o=="number"&&(n?.check==="greater_than"&&n.inclusive?e.min=Math.max(e.min??o,o):n?.check==="less_than"&&n.inclusive?e.max=Math.min(e.max??o,o):n?.check==="multiple_of"&&(e.step=o))}return{spec:{type:s.some(n=>n?.format==="safeint"||n?.format==="int")?"integer":"number",...e,...r}}}case"boolean":return{spec:{type:"boolean",...r}};case"enum":{let e=Object.keys(t.entries??{});return e.length>0?{spec:{type:"enum",options:e,...r}}:{why:"it is an enum with no options"}}case"array":{let e=p(t.element),n=a(t.element)??(e?.type==="number"?"number":e?.type==="string"?"string":void 0);return n?{spec:{type:"list",of:n,...r}}:{why:`it is a list of ${String(e?.type??"something")}, and a document lists words, numbers, dates, images or files`}}default:return{why:`it is a ${String(t.type)}, which a document has no field type for`}}}function L(i){let t=b(i);return"spec"in t?t.spec:void 0}export{L as a};
@@ -0,0 +1 @@
1
+ import{h as n}from"./chunk.NRAYZY3X.js";import"./chunk.RIJUCHP4.js";import"./chunk.TAQ764IQ.js";import"./chunk.YIR7PPF3.js";import"./chunk.3HXN4BOY.js";import"./chunk.GYICGZMG.js";import"./chunk.47STJVRV.js";import"./chunk.EBGAYL32.js";import"./chunk.DAZ2VSRD.js";import"./chunk.CWHRDBOF.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.WVUJXDXZ.js";import{d as p}from"./chunk.ULRW47RP.js";import"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import"./chunk.GZHZLJBF.js";import"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import{Q as m}from"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function s(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{s as homeView};
@@ -1 +1 @@
1
- import"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import{b as m}from"./chunk.WAFDCOOG.js";import"./chunk.L4DECHXR.js";import{R as p}from"./chunk.GFF2FB2J.js";import{M as l}from"./chunk.6V2RG5JG.js";import{b as f}from"./chunk.AJZBJBMO.js";var a=f(p(),1);function N({states:e,definition:v}){let s=e.values.reduce((t,n)=>t+n.count,0),u=t=>t===null?"with none":m(v,e.field,t).toLowerCase(),c=e.values.filter(t=>t.count>0).map(t=>`${l(t.count)} ${u(t.value)}`).join(", ");return s===0?null:(0,a.jsx)("div",{className:"graview-district-states",role:"img","aria-label":c,title:c,children:e.values.map((t,n)=>{if(t.count===0)return null;let y=e.values.filter(r=>r.count>0).length,w=t.count/s*(168-(y-1)),o=l(t.count),i=`${o} ${u(t.value)}`,d=r=>r.length*6.2+8<=w;return(0,a.jsx)("span",{"data-graview-tier":t.tier,style:{flexGrow:t.count},title:i,children:d(i)?i:d(o)?o:""},n)})})}export{N as StatesBar};
1
+ import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import{b as m}from"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import{Q as p}from"./chunk.6QWV5MVH.js";import{N as l}from"./chunk.MNP4JI33.js";import{b as f}from"./chunk.AJZBJBMO.js";var a=f(p(),1);function N({states:e,definition:v}){let s=e.values.reduce((t,n)=>t+n.count,0),u=t=>t===null?"with none":m(v,e.field,t).toLowerCase(),c=e.values.filter(t=>t.count>0).map(t=>`${l(t.count)} ${u(t.value)}`).join(", ");return s===0?null:(0,a.jsx)("div",{className:"graview-district-states",role:"img","aria-label":c,title:c,children:e.values.map((t,n)=>{if(t.count===0)return null;let y=e.values.filter(r=>r.count>0).length,w=t.count/s*(168-(y-1)),o=l(t.count),i=`${o} ${u(t.value)}`,d=r=>r.length*6.2+8<=w;return(0,a.jsx)("span",{"data-graview-tier":t.tier,style:{flexGrow:t.count},title:i,children:d(i)?i:d(o)?o:""},n)})})}export{N as StatesBar};
@@ -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{l as k,n as M,o as I,p as B,s as P}from"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import{F as te,Q as W,a as L,xa as q}from"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import{b as h}from"./chunk.AJZBJBMO.js";var r=h(te(),1);var A=h(W(),1),U=q(L(()=>(__graviewPreload(import.meta.url,["./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.T5VG5A6V.js")))),v={Part:U.part((n,t)=>(0,A.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>U.prefetch()};var o=h(W(),1),z="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function K(n,t,d,p=!1){let S=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),g={weekday:p?"long":"short",year:"numeric",month:p?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},m;try{m=new Intl.DateTimeFormat(d??"en-US",g)}catch{m=new Intl.DateTimeFormat("en-US",g)}return m.format(S).replace(/ /g," ")}function ce({value:n,time:t,instant:d=!1,label:p,name:S,required:g,autoFocus:m,autoSelect:H,locale:s,onChange:j,onLeave:_,onCancel:V,inputRef:w,boxStyle:Z}){let x=(0,r.useId)(),u=(0,r.useRef)(null),D=(0,r.useRef)(null),b=e=>{let a=M(e);return a?K(a,t,s):e??""},[T,C]=(0,r.useState)(()=>b(n)),[F,y]=(0,r.useState)(!1),[G,E]=(0,r.useState)(n),[J,Q]=(0,r.useState)(n);n!==J&&(Q(n),n!==G&&(E(n),C(b(n)))),(0,r.useEffect)(()=>{H&&(u.current?.focus(),u.current?.select())},[H]);let i=t&&d?B(s):void 0,N=T===b(n),l=M(n),c=N?l:P(T,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}}),X=N?n:c?I(c,{time:t,instant:d}):void 0,$=T.trim()==="",f=!$&&c===void 0;(0,r.useEffect)(()=>{u.current?.setCustomValidity(f?`Not a date this reads \u2014 ${z}`:"")},[f]);let O=e=>{E(e),j(e)},Y=e=>{C(e);let a=e.trim()===""?void 0:P(e,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}});O(a?I(a,{time:t,instant:d}):void 0)},ee=e=>{let a=t?{day:e,minutes:c?.minutes??l?.minutes??540}:{day:e},R=I(a,{time:t,instant:d});C(b(R)),O(R),y(!1),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},ne=$?`Type a date, or pick one \u2014 ${z}`:f?`Not a date this reads \u2014 ${z}`:c?`${K(c,t,s,!0)}${i?` ${i.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?d?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(y(!1),_?.(X))},children:[(0,o.jsx)("input",{ref:e=>{u.current=e,typeof w=="function"?w(e):w&&(w.current=e)},type:"text",name:S,required:g,autoFocus:m,"aria-label":p,"aria-describedby":`${x}-said`,"aria-invalid":f||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:T,"data-graview-part":"control",onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),V?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),y(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Z}}),(0,o.jsx)("button",{ref:D,type:"button","aria-label":`Pick a date for ${p}`,"aria-expanded":F,"aria-controls":`${x}-month`,"data-graview-part":"when-pick",onClick:()=>y(e=>!e),onPointerEnter:()=>v.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${x}-said`,"aria-live":"polite","data-graview-part":"when-said",...i?{"data-graview-zone":i.zone,title:`Times are in ${i.zone.replace(/_/g," ")} (${i.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:f?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ne,i&&!f&&!$?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(i.zone.split("/").at(-1)??i.zone).replace(/_/g," ")} time`}):null]}),F?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(v.Part,{id:`${x}-month`,label:p,selected:c?.day??l?.day,today:k().day,locale:s,onPick:ee,onClose:()=>{y(!1),D.current?.focus()}})}):null]})}export{ce as WhenInput,K as wallAsRead};
@@ -1,4 +1,4 @@
1
- import"./chunk.L4DECHXR.js";import{R as o,Z as n}from"./chunk.GFF2FB2J.js";import"./chunk.6V2RG5JG.js";import{b as t}from"./chunk.AJZBJBMO.js";var a=t(o(),1),d=[["waiting","Waiting"],["active","Under way: darker and taller"],["done","Done: flat and pale"],["flagged","A problem, or past its due date"],["recent","Changed since you were last here"],["own","Yours"]],g=i=>{let e=r=>`color-mix(in oklab,var(--graview-ink) ${r}%,var(--graview-panel))`;return`.graview-map-key{display:grid;gap:4px;padding:2px 4px 8px;margin-bottom:6px;border-bottom:1px solid var(--graview-edge);font-size:.8125rem;color:var(--graview-ink-muted)}
1
+ import"./chunk.JOOQUWLT.js";import{Q as o,Y as n}from"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import{b as t}from"./chunk.AJZBJBMO.js";var a=t(o(),1),d=[["waiting","Waiting"],["active","Under way: darker and taller"],["done","Done: flat and pale"],["flagged","A problem, or past its due date"],["recent","Changed since you were last here"],["own","Yours"]],g=i=>{let e=r=>`color-mix(in oklab,var(--graview-ink) ${r}%,var(--graview-panel))`;return`.graview-map-key{display:grid;gap:4px;padding:2px 4px 8px;margin-bottom:6px;border-bottom:1px solid var(--graview-edge);font-size:.8125rem;color:var(--graview-ink-muted)}
2
2
  .graview-map-key>div{display:flex;align-items:center;gap:8px}
3
3
  .graview-map-key>div:first-child{color:var(--graview-ink)}
4
4
  .graview-map-key i{flex:none;width:14px;height:10px;border-radius:2px;background:${e(i?34:42)}}
@@ -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{q as Te}from"./chunk.DAZ2VSRD.js";import{a as xe}from"./chunk.XANVHJQ4.js";import{f as V}from"./chunk.CAVBSL27.js";import{c as Oe,d as Re,e as _e}from"./chunk.COQKECUH.js";import{a as P}from"./chunk.G5NZVPJU.js";import{a as ve,b as U,d as Ae}from"./chunk.B2GLDIAS.js";import{a as me}from"./chunk.UGFJKSHU.js";import{Ba as ue,Ca as fe,Fa as pe,La as H,Oa as he,Y as W,a as se,jb as ye,ma as de,mb as ge,nb as be,pa as B,qb as we,ra as ce,sc as ke,ta as le,tb as Se,ua as C,wb as L}from"./chunk.MNP4JI33.js";var $=(t,n,e)=>{(t[n]===void 0||e>t[n])&&(t[n]=e)},J=(t,n,e)=>{(t[n]===void 0||e<t[n])&&(t[n]=e)},G=(t,n)=>{t.format=n,n.includes("int")&&(t.isInt=!0)},Me=(t,n)=>{t.mime=t.mime?t.mime.filter(e=>n.includes(e)):[...n]},Ne=(t,n)=>{t.multipleOf??=[],t.multipleOf.includes(n)||t.multipleOf.push(n)},$e=(t,n)=>(t.patterns??=new Set).add(n),Ke={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function D(t){let n={},{def:e,bag:r}=t._zod,i=t._zod.traits.has("$ZodCheck")?[t,...e.checks??[]]:e.checks??[];for(let o of i){let a=o._zod.def;switch(a.check){case"greater_than":$(n,a.inclusive?"minimum":"exclusiveMinimum",a.value);break;case"less_than":J(n,a.inclusive?"maximum":"exclusiveMaximum",a.value);break;case"multiple_of":Ne(n,a.value);break;case"number_format":{G(n,a.format);let l=Ke[a.format];l&&($(n,"minimum",l[0]),J(n,"maximum",l[1]));break}case"bigint_format":G(n,a.format);break;case"min_length":case"min_size":$(n,"minimum",a.minimum);break;case"max_length":case"max_size":J(n,"maximum",a.maximum);break;case"length_equals":$(n,"minimum",a.length),J(n,"maximum",a.length);break;case"size_equals":$(n,"minimum",a.size),J(n,"maximum",a.size);break;case"string_format":G(n,a.format),a.pattern&&$e(n,a.pattern),(a.format==="base64"||a.format==="base64url")&&(n.contentEncoding=a.format),(a.local||a.precision===-1)&&(n.laxFormat=!0);break;case"mime_type":Me(n,a.mime);break}}r.minimum!==void 0&&$(n,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&$(n,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&J(n,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&J(n,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&Ne(n,r.multipleOf),r.format!==void 0&&(n.format??=r.format,r.format.includes("int")&&(n.isInt=!0)),r.mime&&Me(n,r.mime);for(let o of r.patterns??[])$e(n,o);return n}var Ze={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function z(t){let n=t._zod.def;return n.type==="pipe"&&n.in._zod.traits.has("$ZodTransform")?z(n.out):n.type==="catch"?z(n.innerType):t._zod.optin}var Ye=new Set(["promise","optional","nonoptional","nullable","readonly","default","prefault","catch"]);function A(t,n=new Set){if(n.has(t))return!1;n.add(t);let e=t._zod.def,r=e.type;return r==="transform"?!0:r==="array"?A(e.element,n):r==="set"?A(e.valueType,n):r==="lazy"?A(e.getter(),n):Ye.has(r)?A(e.innerType,n):r==="intersection"?A(e.left,n)||A(e.right,n):r==="record"||r==="map"?A(e.keyType,n)||A(e.valueType,n):r==="pipe"?t._zod.traits.has("$ZodCodec")||A(e.in,n)||A(e.out,n):r==="object"?Object.values(e.shape).some(i=>A(i,n)):r==="union"?e.options.some(i=>A(i,n)):r==="tuple"?e.items.some(i=>A(i,n))||(e.rest?A(e.rest,n):!1):!1}function Xe(t){let n=Object.values(t).filter(e=>typeof e=="number");return Object.entries(t).filter(([e])=>n.indexOf(+e)===-1).map(([,e])=>e)}function De(t){let n=t.anyOf;if(!Array.isArray(n)||n.length===0||t.type!==void 0)return;let e=[];for(let r of n){if(!r||typeof r!="object")return;De(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;for(let o of[r.type].flat()){if(typeof o!="string")return;e.includes(o)||e.push(o)}}delete t.anyOf,t.type=e.length===1?e[0]:e}var Ee=new Set(["type","properties","required","additionalProperties"]),Je=t=>{let n=t.additionalProperties;return n&&typeof n=="object"&&Object.keys(n).length?n:null},Pe=(t,n)=>JSON.stringify(t)===JSON.stringify(n);function K(t){for(let i of t){if(typeof i!="object"||i.type!=="object")return null;for(let o in i)if(!Ee.has(o))return null}let n={},e=new Set;for(let i of t){for(let o in i.properties){if(Object.prototype.hasOwnProperty.call(n,o))continue;let a=[];for(let l of t){let s=l.properties?.[o]??Je(l);s&&!a.some(b=>Pe(b,s))&&a.push(s)}n[o]=a.length===1?a[0]:K(a)??{allOf:a}}for(let o of i.required??[])e.add(o)}let r={type:"object",properties:n};if(e.size&&(r.required=[...e]),t.every(i=>i.additionalProperties===!1))r.additionalProperties=!1;else{let i=[];for(let o of t){let a=Je(o);a&&!i.some(l=>Pe(l,a))&&i.push(a)}i.length===1?r.additionalProperties=i[0]:i.length>1&&(r.additionalProperties={allOf:i})}return r}function Qe(t){let n=t.allOf;if(!Array.isArray(n)||n.length<2)return;for(let i of Ee)if(i in t)return;let e=n.filter(i=>Array.isArray(i.oneOf)||Array.isArray(i.anyOf)),r;if(!e.length)r=K(n);else{let i=e[0],o=Array.isArray(i.oneOf)?"oneOf":"anyOf";if(Object.keys(i).length!==1)return;let a=n.filter(s=>s!==i),l=i[o].map(s=>K([...a,s]));if(l.some(s=>!s))return;r={[o]:l}}r&&(delete t.allOf,Object.assign(t,r))}function ze(t){let n=t;for(let u of["anyOf","oneOf"]){let f=n[u];if(!Array.isArray(f))continue;let w=f.map(ze);w.some((y,d)=>y!==f[d])&&(n={...n,[u]:w})}let e=[n.type].flat(),r=!e.includes("string")&&e.some(u=>u==="number"||u==="integer"),i=n.enum??(n.const!==void 0?[n.const]:void 0);if(!r&&!i?.some(u=>typeof u=="number"))return n;let{minimum:o,maximum:a,exclusiveMinimum:l,exclusiveMaximum:s,multipleOf:b,format:p,id:S,...h}=n;return h.enum?h.enum=h.enum.map(u=>typeof u=="number"?String(u):u):typeof h.const=="number"&&(h.const=String(h.const)),r&&(h.type="string",i||(h.pattern=e.includes("number")?"^-?\\d+(?:\\.\\d+)?$":"^-?\\d+$")),h}var q=class{constructor(n,e){this.override=n;this.refs=e}done=new Map;path=[];cyclic=new Map;write(n,e=!1){let r=this.refs.get(n);if(r!==void 0&&!e)return{$ref:r};if(this.path.includes(n))return this.cyclic.has(n)||this.cyclic.set(n,""),{};let i=this.done.get(n);if(i)return i;this.path.push(n);try{let o=this.written(n);return this.done.set(n,o),o}finally{this.path.pop()}}written(n){let e={},r,i=n._zod.toJSONSchema?.();i?Object.assign(e,i):r=this.process(n,e);let o=se.get(n);if(o)for(let l of Object.keys(o))e[l]=o[l];A(n)&&(delete e.examples,delete e.default),"_prefault"in e&&(e.default??=e._prefault,delete e._prefault);let a=e;if(r){let l=this.write(r);a={...e};for(let s of Object.keys(l))s in e||(a[s]=l[s])}return this.override({zodSchema:n,jsonSchema:a}),De(a),n._zod.def.type==="intersection"&&Qe(a),a}process(n,e){let r=n._zod.def;switch(r.type){case"string":{e.type="string";let{minimum:i,maximum:o,format:a,patterns:l,contentEncoding:s,laxFormat:b}=D(n);if(typeof i=="number"&&(e.minLength=i),typeof o=="number"&&(e.maxLength=o),a&&(e.format=Ze[a]??a,(e.format===""||a==="time"||b)&&delete e.format),s&&(e.contentEncoding=s),l&&l.size>0){let p=[...l];p.length===1?e.pattern=p[0].source:e.allOf=p.map(S=>({pattern:S.source}))}return}case"number":{let{minimum:i,maximum:o,multipleOf:a,exclusiveMinimum:l,exclusiveMaximum:s,isInt:b}=D(n);if(e.type=b?"integer":"number",typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY)?e.exclusiveMinimum=l:typeof i=="number"&&(e.minimum=i),typeof s=="number"&&s<=(o??Number.POSITIVE_INFINITY)?e.exclusiveMaximum=s:typeof o=="number"&&(e.maximum=o),a){let[p,...S]=new Set(a.filter(h=>Number.isFinite(h)&&h!==0).map(Math.abs));p!==void 0&&(e.multipleOf=p),S.length&&(e.allOf=[...e.allOf??[],...S.map(h=>({multipleOf:h}))])}return}case"boolean":case"success":e.type="boolean";return;case"null":e.type="null";return;case"never":e.not={};return;case"enum":{let i=Xe(r.entries);i.length===0?e.not={}:(i.every(o=>typeof o=="number")&&(e.type="number"),i.every(o=>typeof o=="string")&&(e.type="string"),e.enum=i);return}case"literal":{let i=r.values.filter(o=>o!==void 0).map(o=>typeof o=="bigint"?Number(o):o);if(r.values.length===0)e.not={};else if(i.length===1)e.type=i[0]===null?"null":typeof i[0],e.const=i[0];else if(i.length>1){for(let o of["number","string","boolean"])i.every(a=>typeof a===o)&&(e.type=o);i.every(o=>o===null)&&(e.type="null"),e.enum=i}return}case"template_literal":e.type="string",e.pattern=n._zod.pattern.source;return;case"file":{e.type="string",e.format="binary",e.contentEncoding="binary";let{minimum:i,maximum:o,mime:a}=D(n);i!==void 0&&(e.minLength=i),o!==void 0&&(e.maxLength=o),a&&(a.length===0?e.not={}:a.length===1?e.contentMediaType=a[0]:e.anyOf=a.map(l=>({contentMediaType:l})));return}case"array":{let{minimum:i,maximum:o}=D(n);typeof i=="number"&&(e.minItems=i),typeof o=="number"&&(e.maxItems=o),e.type="array",e.items=this.write(r.element);return}case"object":{let i=r.shape;e.type="object";let o={};e.properties=o;for(let l in i)Object.defineProperty(o,l,{value:this.write(i[l]),writable:!0,enumerable:!0,configurable:!0});let a=Object.keys(i).filter(l=>z(i[l])===void 0);a.length>0&&(e.required=a),r.catchall?._zod.def.type==="never"?e.additionalProperties=!1:r.catchall&&(e.additionalProperties=this.write(r.catchall));return}case"union":e[r.inclusive===!1?"oneOf":"anyOf"]=r.options.map(i=>this.write(i));return;case"intersection":{let i=l=>"allOf"in l&&Object.keys(l).length===1,o=this.write(r.left),a=this.write(r.right);e.allOf=[...i(o)?o.allOf:[o],...i(a)?a.allOf:[a]];return}case"tuple":{let i=r.items;e.type="array",e.prefixItems=i.map(s=>this.write(s)),r.rest?e.items=this.write(r.rest):e.items=!1;let o=i.length;for(;o>0&&z(i[o-1])!==void 0;)o-=1;o>0&&(e.minItems=o),r.rest||(e.maxItems=i.length);let{minimum:a,maximum:l}=D(n);typeof a=="number"&&(e.minItems=a),typeof l=="number"&&(e.maxItems=l);return}case"record":{let i=r.keyType;e.type="object";let o=D(i).patterns;if(r.mode==="loose"&&o&&o.size>0){let l=this.write(r.valueType),s={};for(let b of o)s[b.source]=l;e.patternProperties=s}else e.propertyNames=ze(this.write(i)),e.additionalProperties=this.write(r.valueType);let a=i._zod.values;if(a&&!r.partial&&z(r.valueType)===void 0){let l=[...a].filter(s=>typeof s=="string"||typeof s=="number");l.length>0&&(e.required=l.map(String))}return}case"nullable":e.anyOf=[this.write(r.innerType),{type:"null"}];return;case"default":case"prefault":{let i=r.defaultValue,o,a=!1,l=JSON.stringify(i,(s,b)=>typeof b=="bigint"?(a=!0,null):b);return!a&&l!==void 0&&(o=JSON.parse(l)),a||(e[r.type==="default"?"default":"_prefault"]=o),r.innerType}case"catch":{try{e.default=r.catchValue(void 0)}catch{}return r.innerType}case"readonly":return e.readOnly=!0,r.innerType;case"pipe":return r.in._zod.traits.has("$ZodTransform")?r.out:r.in;case"lazy":return n._zod.innerType;case"optional":case"nonoptional":case"promise":return r.innerType;default:return}}};function Ie(t,n=()=>{}){let e=t,r=new q(n,new Map),i=r.write(e,!0);if(r.cyclic.size>0){let o=new Map,a=0,l=[];for(let b of r.cyclic.keys())if(b===e)o.set(b,"#");else{let p=`__schema${a++}`;o.set(b,`#/$defs/${p}`),l.push([b,p])}r=new q(n,o),i=r.write(e,!0);let s={};for(let[b,p]of l)s[p]=r.write(b,!0);l.length>0&&(i={...i,$defs:s})}return JSON.parse(JSON.stringify({$schema:"https://json-schema.org/draft/2020-12/schema",...i}))}function je(t){return Ie(t,tn)}var en={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"},nn={phone:"A phone number as it is written, like +1 555 123 4567 or 020 7946 0958 ext. 12.",place:"An address or a place's name, as a person would search a map for it.",duration:"A length of time in whole minutes: 90 is 1 h 30 min."};function tn(t){de(t.zodSchema)&&(t.jsonSchema["x-graview-app-link"]=!0);let n=le(t.zodSchema);if(n&&(t.jsonSchema.type==="string"||t.jsonSchema.type==="array")){t.jsonSchema["x-graview-linked"]={address:n.address,kinds:[...n.kinds],cardinality:n.cardinality};let s=n.kinds.join(" or "),b=`${n.cardinality==="many"?"Records":"A record"}: a ${s} in the app ${n.address}, as "${n.kinds[0]}:<id>" \u2014 an id found there with find_linked. Linking never changes that app.`,p=t.jsonSchema.description;typeof p=="string"&&p.includes(b)||(t.jsonSchema.description=`${typeof p=="string"&&p?`${p.replace(/\.?$/,".")} `:""}${b}`)}if(pe(t.zodSchema)&&(t.jsonSchema["x-graview-repeat"]=!0,!t.jsonSchema.type&&!t.jsonSchema.anyOf&&!t.jsonSchema.oneOf&&Object.assign(t.jsonSchema,rn())),me(t.zodSchema)){t.jsonSchema.contentMediaType="text/markdown";let s=t.jsonSchema.description;typeof s=="string"&&s.endsWith("Written in Markdown.")||(t.jsonSchema.description=`${typeof s=="string"&&s?`${s.replace(/\.?$/,".")} `:""}Written in Markdown.`)}let e=Se(t.zodSchema);if(e){let s=t.jsonSchema;s["x-graview-type"]=e,e==="duration"&&(s["x-graview-unit"]="minutes"),s.description??=nn[e]}let r=we(t.zodSchema,!1);if(r){let s=ve(r);t.jsonSchema["x-graview-format"]=s.format??"unit",s.currency&&(t.jsonSchema["x-graview-currency"]=s.currency),s.unit&&s.format!=="money"&&(t.jsonSchema["x-graview-unit"]=s.unit);let b=t.jsonSchema.description;t.jsonSchema.description=typeof b=="string"&&b.length>0?`${b} ${U(s)}`:U(s)}let i=t.zodSchema._zod?.def;if(!i||i.type!=="string"||typeof i.format!="string"||i.format==="regex")return;let o=t.jsonSchema,a=(i.checks??[]).map(s=>s._zod?.def).filter(s=>s?.format==="regex"&&s.pattern instanceof RegExp).map(s=>s.pattern.source);delete o.pattern;let l=o.allOf;Array.isArray(l)&&l.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete o.allOf,o.format=en[i.format]??i.format,a.length===1?o.pattern=a[0]:a.length>1&&(o.allOf=a.map(s=>({pattern:s})))}function Z(t){let n=L(t.input),e=je(t.input),r=e.properties??{};if(ge(t)){let i=t.creates.join(" | ");r.id={type:"string",minLength:1,description:`Optional: the id for the ${i} this makes. Refused if the graph already has it; left out, one is minted from the label.`},e.properties=r}be(t)&&(e.additionalProperties=!1);for(let i of n){let o=r[i.name];if(!o)continue;let a=i.kinds.includes("*")?"any node kind":i.kinds.join(" | ");o.description=[o.description,`Id of a node (${a}).`].filter(Boolean).join(" ")}return{name:t.name,...t.title===void 0?{}:{title:t.title},description:t.description??t.title??t.name,inputSchema:e,nodeRefs:n}}function rn(){let t={type:"string",pattern:"^\\d{4}-\\d{2}-\\d{2}$"},n=(e,r)=>({type:"integer",minimum:e,maximum:r});return{type:"object",description:'How the date beside it repeats; the date is the first occurrence. "on" is weekdays for "week", days of the month (-1 the last) for "month".',properties:{every:{type:"string",enum:[...fe]},interval:n(1,99),on:{type:"array",minItems:1,maxItems:31,items:{anyOf:[{type:"string",enum:[...ue]},n(-1,31)]}},until:t,count:n(1,1e3),except:{type:"array",maxItems:500,items:t},continues:{type:"string",maxLength:200}},required:["every"],additionalProperties:!1}}function He(t){let n=new Set;for(let e=t;e;e=e.onBehalfOf)e.id!==void 0&&n.add(`${e.kind}:${e.id}`);return n}function F(t,n){let e=He(n),r=p=>{if(p.kind==="rule")return!1;let S=He(p);if(S.size===0)return!1;for(let h of S)if(e.has(h))return!1;return!0},i,o=()=>{if(i)return i;i=new Map;for(let p of t.log.live()){if(p.undoes!==void 0)continue;let S=r(p.author)?p.author:void 0;for(let h of p.primitives){h.op==="remove-node"&&i.delete(h.node.id);let u=h.op==="add-node"?h.node.id:h.op==="patch-node"?h.id:void 0;if(u===void 0)continue;let f=h.op==="add-node"?Object.keys(h.node):Object.keys(h.after),w=i.get(u);(h.op==="add-node"||!w)&&i.set(u,w=new Map);for(let y of f)y==="id"||y==="kind"||(S?w.set(y,S):w.delete(y))}}return i},a=t.schema,l=new Map,s=(p,S)=>{let h=`${p}\0${S}`,u=l.get(h);if(u===void 0){let f=a.tryDefinition(p)?.fields?.shape;u=f!==void 0&&S in f&&Ae(f[S]).type==="text",l.set(h,u)}return u},b=p=>t.graph.getNode(p)?.kind;return{prose:s,say:p=>H(p,{graph:t.graph,schema:a}),fieldBy(p,S){let h=b(p);if(!(h===void 0||!s(h,S)))return o().get(p)?.get(S)},recordBy(p){let S=b(p),h=o().get(p);if(S===void 0||!h)return;let u;for(let[f,w]of h)s(S,f)&&(u=w);return u}}}var Y=(t,n,e)=>({untrusted:!0,authoredBy:e.say(n),text:t}),on="the host's ranker";function Le(t,n){return{...t,hits:t.hits.map(e=>{if(e.about!=="node")return e;e.why.by==="meaning"&&e.why.matched!==void 0&&(e={...e,why:{...e.why,matched:{untrusted:!0,authoredBy:on,text:e.why.matched}}});let r=n.recordBy(e.id);if(!r)return e;let i=n.prose(e.kind,e.why.field)?n.fieldBy(e.id,e.why.field):r;return{...e,label:Y(e.label,r,n),...e.apart!==void 0?{apart:Y(e.apart,r,n)}:{},why:i?{...e.why,fragment:Y(e.why.fragment,i,n)}:e.why}})}}var X=(t,n,e)=>({title:t,readOnlyHint:n,destructiveHint:!1,idempotentHint:e,openWorldHint:!1}),an={name:"subscribe",title:"Notify me when something happens",description:`Subscribe the person you act for to be told when something happens in this app \u2014 their host delivers it (an email, a push). on is one of: "act" (an act runs; give act, its declared name, and/or record), "created" (a record of kind is added), "changed" (a record of kind, or the one record, changes), "reaches" (a record of kind, or the one record, comes to satisfy condition, an expression in the app's rule language such as done == true or amount > 100). They are told only of changes someone else made, unless alsoMine is true, and only of records they may see. Returns the subscription and its sentence. Changes nothing in the app.`,inputSchema:{type:"object",properties:{on:{type:"string",enum:["act","created","changed","reaches"],description:"What to be told of."},act:{type:"string",description:"An act's declared name, for on: act."},kind:{type:"string",description:"A kind, for created, changed and reaches."},record:{type:"string",description:"One record, by id or name: for act, changed and reaches."},condition:{type:"string",description:"For reaches: what the record should come to satisfy, in the rule language (done == true)."},alsoMine:{type:"boolean",description:"Also when the person themselves made the change; false when unsaid."}},required:["on"],additionalProperties:!1},mutating:!1,annotations:X("Notify me when something happens",!1,!1)},sn={name:"unsubscribe",title:"Stop notifying me",description:"Take away one of the person's subscriptions, by the id list_subscriptions or subscribe answered. Changes nothing in the app.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The subscription's id."}},required:["id"],additionalProperties:!1},mutating:!1,annotations:X("Stop notifying me",!1,!0)},dn={name:"list_subscriptions",title:"What I am notified of",description:`List what the person you act for is told of in this app: each subscription's id and its sentence ("When someone else adds a task").`,inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:X("What I am notified of",!0,!0)},Q=[an,sn,dn];var j=t=>{let n;return()=>n??=t().catch(e=>{throw n=void 0,e})},cn=j(()=>(__graviewPreload(import.meta.url,["./chunk.SYAEBGDC.js","./chunk.UZGRRDHD.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.IDVAR5HM.js"))),ln=()=>(__graviewPreload(import.meta.url,["./chunk.G5NZVPJU.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.OC6IWRQ3.js")).catch(()=>{}),un=async()=>{(await ln())?.judgeWithLines()},I=j(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.UGFJKSHU.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.EF3XNU4O.js"))),fn=j(()=>(__graviewPreload(import.meta.url,["./chunk.UBFNZMUX.js","./chunk.G4JJXA63.js","./chunk.HAIG6NVX.js","./chunk.UZGRRDHD.js","./chunk.OKRNJXTV.js","./chunk.CAVBSL27.js","./chunk.Q5WEOX3Q.js","./chunk.GV2CQVKV.js","./chunk.4HZ7QTXZ.js","./chunk.G5NZVPJU.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.XKABS745.js"))),pn=j(()=>(__graviewPreload(import.meta.url,["./chunk.3AGY4QVS.js","./chunk.SYAEBGDC.js","./chunk.UZGRRDHD.js","./chunk.XANVHJQ4.js","./chunk.UT6642FC.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.52W7WYME.js"))),mn=j(()=>(__graviewPreload(import.meta.url,["./chunk.E2YEOMPH.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.EKPRNDUV.js"))),hn=t=>t.definitions.some(n=>C(n).size>0),qe=t=>({value:B(t),label:t.label,...t.describe?{describe:t.describe}:{},...t.card?{card:t.card}:{},fields:t.fields,...t.app?{app:t.app}:{}});async function yn(t,n,e,r){let i=String(e.relation??""),[o,a]=i.includes(".")?i.split(".",2):[void 0,i],l=t.schema.definitions.flatMap(y=>[...C(y)].map(([d,c])=>({kind:y.kind,name:d,relation:c}))),s=l.filter(y=>y.name===a&&(o===void 0||y.kind===o));if(s.length!==1){let y=l.map(d=>`${d.kind}.${d.name}`).join(", ")||"none";return{ok:!1,error:`${s.length===0?`No relation to another app is called "${i}"`:`"${i}" names a relation of several kinds`}. The relations to other apps are: ${y}.`}}let{kind:b,name:p,relation:S}=s[0];if(!r)return{ok:!1,error:`This seat cannot read ${S.address}: its host reads no other app's records. Nothing was changed.`};let h={kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u=typeof e.of=="string"?e.of:void 0;if(u!==void 0){let y=t.graph.getNode(u);if(!y||y.kind!==b)return{ok:!1,error:`No ${b} "${u}".`};let d=ce(y[p],S),c=await Promise.all(d.map(m=>Promise.resolve().then(()=>r.resolve(m,h)).catch(()=>null)));return{ok:!0,data:{relation:`${b}.${p}`,app:S.address,records:c.map((m,g)=>m===null?{value:B(d[g]),missing:!0}:"denied"in m?{denied:!0,said:"linked record (no access)"}:qe(m))},reads:[u]}}let f=typeof e.limit=="number"&&e.limit>0?Math.min(e.limit,20):20,w=await Promise.resolve().then(()=>r.find({address:S.address,kinds:S.kinds,query:String(e.query??""),limit:f},h)).catch(()=>[]);return Array.isArray(w)?{ok:!0,data:{relation:`${b}.${p}`,app:S.address,records:w.map(qe),link:`edit-${b} with ${p} set to a record's value`}}:{ok:!0,data:{relation:`${b}.${p}`,app:S.address,denied:!0,said:"linked record (no access)"}}}var R=t=>({title:t,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),Fe={description:'Which records: false (the default) the live ones, true only the archived ones, "all" both. An archived record is set aside, not gone: unarchive-<kind> brings it back.',anyOf:[{type:"boolean"},{type:"string",enum:["all"]}]},ee={type:"number",description:"Where the page starts; 0 when unsaid."},ie=[{name:"search_graph",title:"Find by name",description:"Find things by name: records whose name or readable fields carry the words, and the kinds, places and rules the words name \u2014 each with why it matched. Reach for this before get_graph when you know what something is called. Words match the start of words, case and accents aside; key:value tokens narrow as a list's filter does (done:false, is:any for past records, kind:<kind>). Pass subject (a node id) to get the acts you may run on it as hits too. When few records match exactly, records with a near word follow \u2014 a typo, another form of the word, a meaning \u2014 each with near: true and why.matched, the record's own word that answered.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Words, with optional key:value conditions."},limit:{type:"number",description:"Most hits to return; at most 20."},subject:{type:"string",description:"A node id whose acts to include."},archived:Fe},required:["query"],additionalProperties:!1},mutating:!1,annotations:R("Find by name")},{name:"get_graph",title:"Read the graph",description:"Read the graph, 25 nodes a page: their fields, the edges out of them, and how many more. Start here when you need the shape of the domain rather than one thing in it.",inputSchema:{type:"object",properties:{offset:ee,archived:Fe},additionalProperties:!1},mutating:!1,annotations:R("Read the graph")},{name:"get_node",title:"Read one node",description:"Read one node: its fields, its links (id, kind and label, 20 each way a page), the violations that implicate it, and its computed values: read-only fields worked out from what you can see, which no act sets. Use this to check a thing before you change it.",inputSchema:{type:"object",properties:{id:{type:"string",description:"A node's id, or its name."},offset:ee},required:["id"],additionalProperties:!1},mutating:!1,annotations:R("Read one node")},{name:"get_violations",title:"List the problems",description:"List the invariant violations the graph currently has, 20 a page, with the repairs that would resolve each one. Read this before proposing work: a rule that is already broken is more urgent than anything you could add.",inputSchema:{type:"object",properties:{offset:ee,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:R("List the problems")},{name:"get_affordances",title:"Ask what can be done",description:"Ask what can legally be done with a selection, ranked. Prefer these over composing a mutation by hand: they are derived from the schema, the invariants and the shape of the graph, so they cannot name an action that does not exist.",inputSchema:{type:"object",properties:{selection:{type:"array",items:{type:"string"},description:"Node ids."},context:{type:"object"}},required:["selection"],additionalProperties:!1},mutating:!1,annotations:R("Ask what can be done")},{name:"describe_place",title:"Say what a place shows",description:`Say what one place of the app shows you, as a person in your seat would see it: its headings, its figures as drawn, its lists with each record's title and what its card or row says, the headings a list is grouped under, what an empty list says, and any block that could not be worked out. Pass a place's slug ("home", a lens's address like "the-offers", a kind's like "offers") or a record's id, and width 390 for a phone. Use it after a change to check what somebody now sees, instead of guessing.`,inputSchema:{type:"object",properties:{place:{type:"string",description:`"home", a place's slug, or a record's id.`},width:{type:"number",description:"The screen's width in CSS pixels; 390 is a phone, 1440 when unsaid."}},required:["place"],additionalProperties:!1},mutating:!1,annotations:R("Say what a place shows")},{name:"preview_mutation",title:"Try an act without applying it",description:"Try a mutation without applying it: get back the diff it would produce and any invariant it would break. Do this when you are unsure, rather than applying and undoing.",inputSchema:{type:"object",properties:{mutation:{type:"string"},args:{type:"object"}},required:["mutation","args"],additionalProperties:!1},mutating:!1,annotations:R("Try an act without applying it")},{name:"undo_batch",title:"Undo a batch",description:"Undo one batch of operations. Fails, naming the blocking operation, when a later operation read what it wrote.",inputSchema:{type:"object",properties:{batch:{type:"string"},include:{type:"array",items:{type:"string"}}},required:["batch"],additionalProperties:!1},mutating:!0,annotations:{title:"Undo a batch",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},{name:"list_suggestions",title:"List what is suggested",description:"List the suggestions waiting for a person: changes the app's own actor proposed and did not make, each with its id, what it would do, who suggested it, what it was based on and how sure (0 to 1). Nothing changes until one is accepted (accept_suggestion) or declined (decline_suggestion); a declined one is never suggested again.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:R("List what is suggested")},{name:"accept_suggestion",title:"Accept a suggestion",description:"Make a waiting suggestion's change, as this seat, carrying what it was based on. Returns the batch (undo_batch takes it back).",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Accept a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}},{name:"decline_suggestion",title:"Decline a suggestion",description:"Decline a waiting suggestion: nothing changes, the decline is kept in the log, and the same change is never suggested or made by the app's own actor again.",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Decline a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}],Be={name:"act_on_several",title:"Do one act to several records",description:`Run one act on several records at once, as one change with one undo. act is the act (its tool name or its declared name), records the records it runs on (ids or names; each goes in the act's subject), args what every call shares ("Set stage to Declined" is args { stage: "declined" }). Each record is judged on its own: one this seat may not change is named with why, and the rest still apply. Returns the batch (undo_batch takes it all back), the records changed, those already so, and those refused.`,inputSchema:{type:"object",properties:{act:{type:"string",description:"The act to run on each record."},records:{type:"array",items:{type:"string"},minItems:1,maxItems:200,description:"Ids or names of the records."},args:{type:"object",description:"Arguments every call shares, besides the record."}},required:["act","records"],additionalProperties:!1},mutating:!0,annotations:{title:"Do one act to several records",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},re={type:"object",description:"A lens, as draft_view returns one.",properties:{title:{type:"string"},lens:{type:"string"},on:{type:"string"},bindings:{type:"object"},options:{type:"object"}},required:["title","lens","on"]},oe={name:"draft_view",title:"Draw a view",description:'Draw a view of the data from words ("a board of tasks by status", "who covers what") as a lens the app could keep; or check a lens you wrote (lens); or change the one on screen (current, with ask: "only this month"). Returns the lens and its add-lens edit, or one sentence saying why not. Writes nothing.',inputSchema:{type:"object",properties:{ask:{type:"string",description:"What to see, in words."},lens:re,current:re},additionalProperties:!1},mutating:!1,annotations:R("Draw a view")},Ce={name:"keep_lens",title:"Keep a view as a lens",description:"Keep a lens draft_view drew as one of the app's places: checked again, then written as the add-lens edit. Returns the remove-lens edit that takes it back.",inputSchema:{...re,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},Ue={name:"find_linked",title:"Find a record in another app",description:`A relation may go to a kind in another app (describe_app lists them under "Linked from other apps"). With relation and words, list the records there this seat may link \u2014 each with the value to link it by ("house:h1"), its name and its describe line. With of (a record id here), read the records that record links, as this seat may see them there. Linking one is the record's edit (edit-<kind>) with the relation set to the value. Another app this seat may not open answers denied, and nothing of it. Writes nothing; never changes the other app.`,inputSchema:{type:"object",properties:{relation:{type:"string",description:"The relation, by name (forHouse) or as <kind>.<relation> (scenario.forHouse)."},query:{type:"string",description:"Words to find by, in the other app's names; empty for the first few."},of:{type:"string",description:"A record here whose linked records to read, instead of finding."},limit:{type:"number",description:"Most records to return; at most 20."}},required:["relation"],additionalProperties:!1},mutating:!1,annotations:R("Find a record in another app")};function gn(t,n){return t===void 0?[]:t==="keep"&&!n?[oe,Ce]:[oe]}var bn="An argument that names a record takes its id or its name.",Ve=[...ie.map(t=>t.name),Be.name,oe.name,Ce.name,Ue.name,...Q.map(t=>t.name)],Ge=64;function _(t){let{line:n,...e}=t;return e}function We(t){return{...t,...t.introduces?{introduces:t.introduces.map(_)}:{},...t.resolves?{resolves:t.resolves.map(_)}:{},...t.violationsAfter?{violationsAfter:t.violationsAfter.map(_)}:{}}}function wn(t){let n=t.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return n.length===0&&(n="act"),/^[A-Za-z_]/.test(n)||(n=`act_${n}`),n.slice(0,Ge)}function Sn(t){let n=new Set(Ve),e=new Map;for(let r of t){let i=wn(r),o=i;for(let a=2;n.has(o);a+=1)o=`${i.slice(0,Ge-`_${a}`.length)}_${a}`;n.add(o),e.set(r,o)}return e}function kn(t,n){if(n.size===0)return t;let e=Object.fromEntries(Object.entries(t.properties??{}).filter(([i])=>!n.has(i))),r=(t.required??[]).filter(i=>!n.has(i));return{...t,properties:e,...t.required?{required:r}:{}}}function vn(t,n,e){let r=Z(t),i=W(t),o=r.nodeRefs.length>0?`${r.description}${/[.!?]$/.test(r.description)?"":"."} ${bn}`:r.description;return{name:n,title:i,description:o,inputSchema:kn(r.inputSchema,e),mutating:!0,annotations:{title:i,readOnlyHint:!1,destructiveHint:t.destructive===!0||(t.severs?.length??0)>0,idempotentHint:t.idempotent===!0,openWorldHint:!1},act:t.name}}function ae(t){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(Array.isArray(t))return`[${t.map(ae).join(",")}]`;let n=t;return`{${Object.keys(n).filter(e=>n[e]!==void 0).sort().map(e=>`${JSON.stringify(e)}:${ae(n[e])}`).join(",")}}`}function An(t){return`sha256:${ke(ae(t))}`}function On(t,n,e,r,i,o=!1,a=!1){let l=Sn(t.map(p=>p.name)),s=[...gn(r,e),...o?[Ue]:[],...a?Q:[]];return{definitions:e?[...ie.filter(p=>!p.mutating),...s]:[...ie,Be,...s,...t.filter(p=>n.has(p.name)).map(p=>vn(p,l.get(p.name),i(p)))],names:l}}function st(t,n={}){let e=n.author??{kind:"agent"},r=t.allMutations(),i=new Set(t.permittedMutations(e).map(u=>u.name)),{definitions:o,names:a}=On(r,i,n.readOnly===!0,n.drafts?n.drafts.keep?"keep":"draw":void 0,u=>V(t.schema,t.policy,e,u),hn(t.schema),n.subscriptions!==void 0),l=An(o),s=u=>{if(!Ve.includes(u)){for(let[f,w]of a)if(w===u)return f;return a.has(u)?u:void 0}},b=(u,f)=>{let w=r.find(c=>c.name===u);if(!w)return{args:f,resolved:[]};let y={...f},d=[];for(let c of L(w.input)){let m=y[c.name];if(typeof m!="string"||m.trim()==="")continue;let g=t.resolveRef(c,m,e);if(!g.ok){let k=g.reason==="none"?` Nothing was changed. Use search_graph to look it up, then pass its id as ${c.name}.`:" Nothing was changed.";return{ok:!1,error:`${g.message}${k}`,argument:c.name,candidates:g.candidates}}g.by!=="id"&&(y[c.name]=g.id,d.push({argument:c.name,given:m,id:g.id,label:g.label}))}return{args:y,resolved:d}},p=async(u,f)=>{try{await un();let w=o.find(d=>d.name===u)??o.find(d=>d.act===u);if(!w){let d=s(u);if(d){let c=t.permits({name:d,args:f},e);if(!c.ok)return{ok:!1,error:c.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${u}". Available: ${o.map(c=>c.name).join(", ")}`}}if(w.mutating&&n.readOnly)return{ok:!1,error:`"${u}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(w.act!==void 0){let d=b(w.act,f);if("ok"in d)return d;let c=P(t,e,t.apply({name:w.act,args:d.args},{...n.author?{author:n.author}:{},...ne(n.via)}));return{ok:!0,data:{batch:c.batch,intent:c.intent,introduces:c.introduces.map(_),resolves:c.resolves.map(_),...d.resolved.length>0?{resolved:d.resolved}:{}},diff:c.diff}}let y=t.seenBy(e);switch(w.name){case"search_graph":{let d=typeof n.places=="function"?n.places():n.places,c=typeof f.subject=="string"?f.subject:void 0,m=Te(y,String(f.query??""),{principal:e,rank:n.near,archived:he(f.archived),limit:typeof f.limit=="number"&&f.limit>0?Math.min(f.limit,20):20,...d?{places:d}:{},...c?{subject:c,from:[c]}:{}}),g=m.later?await m.later:m;return{ok:!0,data:(await I()).searchRead(g,Le(g,F(y,e))),reads:g.hits.flatMap(k=>k.about==="node"?[k.id]:[])}}case"get_graph":return{ok:!0,...(await I()).graphRead(y,F(y,e),f)};case"get_node":{let d=String(f.id??""),c=d,m;if(!y.graph.getNode(d)){let k=d.trim()===""?void 0:t.resolveRef({name:"id",kinds:["*"]},d,e);if(k?.ok)c=k.id,m={argument:"id",given:d,id:c,label:k.label};else return k?.reason==="ambiguous"?{ok:!1,error:k.message,argument:"id",candidates:k.candidates}:{ok:!1,error:`No node "${d}".`}}let g=(await I()).nodeRead(y,F(y,e),c,f);return{ok:!0,data:m?{...g.data,resolved:[m]}:g.data,reads:g.reads}}case"describe_place":{let d=n.app??{name:"",schema:t.schema},c=typeof f.width=="number"&&Number.isFinite(f.width)&&f.width>0?f.width:1440,{describePlace:m}=await cn(),g=m(t,e,String(f.place??""),{app:d,width:c});if(!g.ok)return{ok:!1,error:`${g.error} The places are: ${g.places.join(", ")}.`};let k=new Set,x=E=>{for(let M of E)for(let O of M.groups??[])for(let T of O.items)k.add(T.id),x(T.parts)};return x(g.description.parts),{ok:!0,data:g.description,reads:[...k]}}case"find_linked":return yn(y,e,f,n.linked);case"draft_view":case"keep_lens":{let d=n.app??{name:"",schema:t.schema};return(await fn()).runDraftTool(w.name,f,{app:d,principal:e,...n.drafts?{drafts:n.drafts}:{}})}case"get_violations":{let d=y.violations(f.context);return{ok:!0,...(await I()).violationsRead(d,f)}}case"get_affordances":{let d=f.selection??[];return{ok:!0,data:xe(y,d,{...typeof n.derive=="function"?n.derive():n.derive,...n.author?{principal:n.author}:{},...f.context?{context:f.context}:{}}),reads:d.filter(m=>y.graph.has(m))}}case"preview_mutation":{let d=String(f.mutation),c=s(d)??d,m=b(c,f.args??{});if("ok"in m)return m;let g=t.missingFor({name:c,args:m.args},e);if(g)return{ok:!1,error:g.message,reason:"missing"};let k=P(t,e,t.preview({name:c,args:m.args},void 0,{author:e})),x=We(k);return{ok:!0,data:m.resolved.length>0?{...x,resolved:m.resolved}:x}}case"act_on_several":{let d=String(f.act??""),c=s(d)??d,m=r.find(v=>v.name===c);if(!m||!i.has(c)){let v=m?t.permits({name:c,args:{}},e):void 0;return v&&!v.ok?{ok:!1,error:v.refusal.message,reason:"forbidden"}:{ok:!1,error:`There is no act "${d}" this seat may run. Nothing was changed.`,reason:"invalid"}}let g=m.subject;if(!g)return{ok:!1,error:`"${W(m)}" does not act on a record, so it cannot be run on several. Nothing was changed.`,reason:"invalid"};let k=Array.isArray(f.records)?f.records.filter(v=>typeof v=="string"&&v.trim()!==""):[];if(k.length===0)return{ok:!1,error:"Name at least one record. Nothing was changed.",reason:"invalid"};let x=[],E=[];for(let v of k.slice(0,200)){let N=t.resolveRef({name:g.arg,kinds:g.kinds},v,e);if(!N.ok)return{ok:!1,error:`${N.message} Nothing was changed.`,argument:"records",candidates:N.candidates};x.push(N.id),N.by!=="id"&&E.push({argument:"records",given:v,id:N.id,label:N.label})}let M=b(c,{...f.args??{}});if("ok"in M)return M;let O=(await pn()).actOnSeveral(t,{mutation:c,subject:g.arg,args:M.args},x,{author:e,...ne(n.via)}),T=O.result?P(t,e,O.result):void 0;return{ok:!0,data:{...O.batch?{batch:O.batch,intent:O.intent}:{},applied:O.applied,unchanged:O.unchanged,refused:O.refused.map(v=>({record:v.id,label:v.label,error:v.message,reason:v.reason})),...O.allOrNothing?{keptNone:!0}:{},...T?{introduces:T.introduces.map(_),resolves:T.resolves.map(_)}:{},...E.length>0||M.resolved.length>0?{resolved:[...E,...M.resolved]}:{}},...T?{diff:T.diff}:{}}}case"subscribe":case"unsubscribe":case"list_subscriptions":{let d=await(await mn()).runSubscriptionTool(w.name,f,{store:t,principal:n.subscriber??e,app:n.app?.name??"app",subscriptions:n.subscriptions});return d.ok?{ok:!0,data:d.data}:{ok:!1,error:d.error}}case"list_suggestions":{let d=Oe(t,e).map(c=>{let m=H(c.author,{graph:y.graph,schema:t.schema});return{id:c.id,intent:c.intent,by:m,at:c.at,about:c.about,...c.lineage?{basis:{untrusted:!0,authoredBy:m,text:c.lineage.basis},...c.lineage.confidence!==void 0?{confidence:c.lineage.confidence}:{}}:{}}});return{ok:!0,data:{suggestions:d},reads:[...new Set(d.flatMap(c=>c.about))]}}case"accept_suggestion":case"decline_suggestion":{let d=String(f.suggestion??""),c={author:e,...ne(n.via)},m=w.name==="accept_suggestion"?Re(t,d,c):_e(t,d,c),g=P(t,e,m);return{ok:!0,data:{batch:g.batch,intent:g.intent,introduces:g.introduces.map(_),resolves:g.resolves.map(_)},diff:g.diff}}case"undo_batch":{let d=String(f.batch),c=f.include??[],m=y.canUndo([d,...c]);if(!m.ok)return{ok:!1,error:m.message};let g=P(t,e,t.undo([d,...c],{...n.author?{author:n.author}:{}}));return{ok:!0,data:We(g),diff:g.diff}}default:return{ok:!1,error:`Unknown tool "${u}".`}}}catch(w){let{reason:y,wouldNeed:d}=ye(w);return{ok:!1,error:w instanceof Error?w.message:String(w),reason:y,...d?{wouldNeed:d}:{}}}},S=new Set,h=u=>{for(let f of S)f(u)};return{definitions:o,hash:l,...n.author?{author:n.author}:{},onDiff(u){return t.subscribe(u)},onCall(u){return S.add(u),()=>S.delete(u)},async call(u,f){let w=(o.find(m=>m.name===u)??o.find(m=>m.act===u))?.mutating??!1,y={name:u,args:f,mutating:w,at:new Date().toISOString()};h({...y,phase:"running"});let d=m=>(h(m.ok?{...y,phase:"ok",...!w&&m.reads?{reads:m.reads}:{}}:{...y,phase:"failed",error:m.error}),m),c=await p(u,f);return d(c.ok&&!w?{...c,data:(await I()).withinReadChars(u,c.data)}:c)}}}function ne(t){let n=typeof t=="function"?t():t;return n?{via:n}:{}}export{ae as a,st as b};
@@ -1 +1 @@
1
- import{a as I,c as x}from"./chunk.T3VPD7JQ.js";import"./chunk.L4DECHXR.js";import{c as b,d as A,k as v,r as w,t as O,w as G}from"./chunk.GFF2FB2J.js";import{Mc as E,Sc as S,Tc as W,xc as k}from"./chunk.6V2RG5JG.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>k(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==E&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=W(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:S(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
1
+ import{a as I,c as x}from"./chunk.7T7NZZTC.js";import"./chunk.JOOQUWLT.js";import{c as b,d as A,k as v,r as w,t as O,w as G}from"./chunk.6QWV5MVH.js";import{Ac as k,Pc as E,Vc as S,Wc as W}from"./chunk.MNP4JI33.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>k(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==E&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=W(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:S(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
@@ -1 +1 @@
1
- import{R as w,k as c,m as h,n as b,oa as y,qa as k,s as f}from"./chunk.GFF2FB2J.js";import{M as i}from"./chunk.6V2RG5JG.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=null,a=new Set,v=e=>{s={kind:e,n:(s?.n??0)+1};for(let t of a)t()},A=()=>s,C=e=>(a.add(e),()=>a.delete(e)),V=()=>{s=null};var d=g(w(),1);function T(e,t){if(e.length===0||t.length===0)return[];let o=new Set(t.map(n=>n.id));return e.filter(n=>n.nodeIds.some(l=>o.has(l)))}var x=(e,t)=>`${i(e)} ${e===1?"problem":"problems"} in ${t}`;function q({kind:e,plural:t,problems:o,flag:n,listed:l=!1}){let{view:p,go:P}=k(),{set:$}=y();if(o.length===0)return null;let u=x(o.length,t),m=o.length===1?"it":"them";return(0,d.jsx)("button",{type:"button",className:"graview-district-problems","data-testid":`district-problems-${e}`,"data-graview-problems":o.length,"aria-expanded":l,"aria-label":u,title:`${u} \u2014 ${o[0].message}${o.length>1?` (and ${i(o.length-1)} more)`:""}. Press to see ${m} and how to fix ${m}.`,onClick:r=>{r.stopPropagation(),p.overview||P(h(c(b(p,!0),null),"view",null)),$([f(e)]),v(e)},onDoubleClick:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:(0,d.jsx)("span",{"aria-hidden":"true",children:`${n} ${i(o.length)}`})})}export{A as a,C as b,V as c,T as d,x as e,q as f};
1
+ import{Q as w,k as c,m as h,n as b,na as y,pa as k,s as f}from"./chunk.6QWV5MVH.js";import{N as i}from"./chunk.MNP4JI33.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=null,a=new Set,v=e=>{s={kind:e,n:(s?.n??0)+1};for(let t of a)t()},A=()=>s,C=e=>(a.add(e),()=>a.delete(e)),V=()=>{s=null};var d=g(w(),1);function T(e,t){if(e.length===0||t.length===0)return[];let o=new Set(t.map(n=>n.id));return e.filter(n=>n.nodeIds.some(l=>o.has(l)))}var x=(e,t)=>`${i(e)} ${e===1?"problem":"problems"} in ${t}`;function q({kind:e,plural:t,problems:o,flag:n,listed:l=!1}){let{view:p,go:P}=k(),{set:$}=y();if(o.length===0)return null;let u=x(o.length,t),m=o.length===1?"it":"them";return(0,d.jsx)("button",{type:"button",className:"graview-district-problems","data-testid":`district-problems-${e}`,"data-graview-problems":o.length,"aria-expanded":l,"aria-label":u,title:`${u} \u2014 ${o[0].message}${o.length>1?` (and ${i(o.length-1)} more)`:""}. Press to see ${m} and how to fix ${m}.`,onClick:r=>{r.stopPropagation(),p.overview||P(h(c(b(p,!0),null),"view",null)),$([f(e)]),v(e)},onDoubleClick:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:(0,d.jsx)("span",{"aria-hidden":"true",children:`${n} ${i(o.length)}`})})}export{A as a,C as b,V as c,T as d,x as e,q as f};
@@ -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{F as k,Q as n,a as t,xa as o}from"./chunk.6QWV5MVH.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.CIPS2OGR.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.LXBOVRFI.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.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.4MERAWS2.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.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.QVVJRSRM.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};
@@ -1,2 +1,2 @@
1
- import{a as $e}from"./chunk.OAF7TUMI.js";import{e as be,f as we,i as xe,j as Y,k as ke}from"./chunk.OZNW5W4Z.js";import{f as fe}from"./chunk.HHPGWJDO.js";import{d as L,e as he}from"./chunk.JH6MU6TX.js";import{b as ge,e as ye}from"./chunk.WAFDCOOG.js";import{B as q,G as te,Hc as pe,Pc as me,Qb as ae,Sb as le,V as E,W as F,Y as re,Yb as H,Z as J,Zb as de,_ as oe,ba as z,nb as se,nc as ce,yb as Q,yc as ue,zb as ie}from"./chunk.6V2RG5JG.js";function je(t,o,n){let s=t.tryDefinition(o)?.fields.shape,e=q(s?.[n]),a=!1,i=!1;for(;e&&(e.type==="optional"||e.type==="default"||e.type==="nullable"||e.type==="prefault");)(e.type==="optional"||e.type==="nullable")&&(a=!0),(e.type==="default"||e.type==="prefault")&&(i=!0),e=q(e.innerType);if(e?.type!=="enum")return;let g=(e.entries?Object.values(e.entries):e.values??[]).filter(p=>typeof p=="string");return g.length>0?{values:g,empty:a&&!i}:void 0}function V(t,o,n){let s=je(t,o,n);if(!s)return[];let e=t.tryDefinition(o),a=s.values.map(i=>({value:i,label:ge(e,n,i)}));return s.empty&&a.push({value:null,label:`No ${z(e,n).toLowerCase()}`}),a}function X(t,o,n){let s=t[o];return typeof s=="string"&&n.some(e=>e.value===s)?s:null}function Z(t,o,n,s,e=V(t.schema,n.kind,s)){let a=ve(t.schema,t.allMutations(),n.kind,s,e),i=X(n,s,e),g=[];for(let{value:p,by:R,acts:B}of a)if(p!==i)for(let P of B){let M=R==="step"?{[P.subject.arg]:n.id}:{[P.subject.arg]:n.id,[s]:p},S={name:P.name,args:M};if(P.input.safeParse(M).success&&t.permits(S,o).ok){try{se(t.graph,P,M)}catch{continue}g.push({to:p,call:S,title:P.title??P.name});break}}return g}function ve(t,o,n,s,e=V(t,n,s)){let a=Se(t,o,n,s),i=De(t,o,n,s);return e.flatMap(g=>{if(g.value===null)return[];let p=a.filter(R=>R.sets?.[s]===g.value);return[{value:g.value,label:g.label,by:p.length>0?"step":i.length>0?"value":"none",acts:p.length>0?p:i}]})}function Se(t,o,n,s){return o.filter(e=>e.subject!==void 0&&e.derived===void 0&&typeof e.sets?.[s]=="string"&&Q(t,e).includes(n))}function De(t,o,n,s){let e=t.tryDefinition(n);return e?o.filter(a=>{if(!a.subject||!Q(t,a).includes(n)||!ie(a,e).includes(s))return!1;let i=a.input.shape;return i!==void 0&&s in i}).sort((a,i)=>+(a.derived!==void 0)-+(i.derived!==void 0)):[]}var ee=(t,o)=>o&&t[o]!==void 0?String(t[o]):"";function Me(t,o,n){let s=c=>t.tryDefinition(c)?o.nodesOfKind(c).filter(y=>E(t.tryDefinition(c),y)):[],e=s(n.rows),a=s(n.columns),i=new Set(e.map(c=>c.id)),g=new Set(a.map(c=>c.id)),p=o.allEdges(),R=[],B=n.link;if(typeof B=="string"){let c=d=>t.tryDefinition(d)?.edges?.[B]?.to,y=(c(n.columns)??[]).some(d=>d===n.rows||d==="*"),k=(c(n.rows)??[]).some(d=>d===n.columns||d==="*"),$=y||!k;for(let d of p){if(d.kind!==B)continue;let j=$?d.to:d.from,r=$?d.from:d.to;i.has(j)&&g.has(r)&&R.push({rowId:j,columnId:r,via:[]})}}else{let c=new Map(B.path.map(k=>[k,new Map]));for(let k of p){let $=c.get(k.kind);if(!$)continue;let d=$.get(k.from);d?d.push(k.to):$.set(k.from,[k.to]);let j=$.get(k.to);j?j.push(k.from):$.set(k.to,[k.from])}let y=new Set;for(let k of a){let $=[{id:k.id,via:[]}];for(let d of B.path){let j=[],r=new Set;for(let b of $)for(let A of c.get(d).get(b.id)??[])r.has(`${b.id}|${A}`)||(r.add(`${b.id}|${A}`),j.push({id:A,via:[...b.via,b.id]}));$=j}for(let d of $){let j=`${d.id}|${k.id}`;!i.has(d.id)||y.has(j)||(y.add(j),R.push({rowId:d.id,columnId:k.id,via:d.via.slice(1)}))}}}let P=n.groupOrder??[],M=c=>P.indexOf(c)===-1?P.length:P.indexOf(c),S=(c,y)=>y==="label"?F(t.tryDefinition(c.kind),c):c[y],T=H(e,n.sort,S).map(c=>{let y=c;return{node:c,label:F(t.tryDefinition(c.kind),c),group:ee(y,n.rowGroup),ref:ee(y,n.rowRef)}}).sort((c,y)=>M(c.group)-M(y.group)||(n.sort!==void 0?0:c.ref<y.ref?-1:c.ref>y.ref?1:0)),K=H(a,n.columnSort,S).map(c=>({node:c,label:F(t.tryDefinition(c.kind),c),group:ee(c,n.columnGroup)})).sort((c,y)=>c.group<y.group?-1:c.group>y.group?1:n.columnSort!==void 0?0:c.node.id<y.node.id?-1:c.node.id>y.node.id?1:0);return{rows:T,columns:K,cells:R}}function Pe(t,o,n){let{rows:s,columns:e,cells:a}=Me(t,o,n),i=(r,b)=>J(t,r,b),g=r=>J(t,r,1).replace(/^1 /,""),p=r=>({id:r.id,kind:r.kind,title:F(t.tryDefinition(r.kind),r),parts:[]}),R=r=>{let b=o.getNode(r);if(!b)return null;let A=t.tryDefinition(b.kind),O=F(A,b),N=L(b,A,{limit:3,said:[O],glance:!0}).map(G=>G.alone.startsWith(G.label)?`${G.label.toLowerCase()}${G.alone.slice(G.label.length)}`:G.alone);return[O,...N].join(", ")},B=typeof n.link=="string"?[]:n.link.path.slice(0,-1).flatMap((r,b,A)=>{let O=ce(t,n.columns,A.slice(0,b+1));return O.ok?[...O.reached]:[]}),P=de(t,n,{rows:s.length,columns:e.length,cells:a.length});if(P)return[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}.`},{t:"text",text:P}];let M=[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}${B.length>0?`, through ${[...new Set(B)].map(r=>i(r,2).replace(/^2 /,"")).join(" and ")}`:""}${e.length>0?`: ${e.map(r=>r.label).join(", ")}`:""}.`}],S=new Map(e.map(r=>[r.node.id,r.label])),T=new Map(e.map((r,b)=>[r.node.id,b])),K=new Map,c=new Map;for(let r of a){let b=K.get(r.rowId);b?b.push(r):K.set(r.rowId,[r]);let A=c.get(r.columnId);A?A.add(r.rowId):c.set(r.columnId,new Set([r.rowId]))}for(let r of s){let A=[...K.get(r.node.id)??[]].sort((O,N)=>T.get(O.columnId)-T.get(N.columnId)).map(O=>{let N=O.via.map(R).filter(G=>G!==null);return`${S.get(O.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:r.label,text:A.length>0?A.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:e.map(r=>{let b=c.get(r.node.id)??new Set,A=s.filter(O=>b.has(O.node.id)).map(O=>p(O.node));return{heading:`${r.label} (${A.length})`,items:A}})});let y=new Set(a.map(r=>r.rowId)),k=new Set(a.map(r=>r.columnId)),$=s.filter(r=>!y.has(r.node.id)),d=e.filter(r=>!k.has(r.node.id)),j=n.rows===n.columns;return $.length>0&&M.push({t:"text",text:`${j?`${$.length} with none across`:`${i(n.rows,$.length)} with no ${g(n.columns)}`}: ${$.map(r=>r.label).join(", ")}.`}),d.length>0&&M.push({t:"text",text:`${j?`${d.length} with none down`:`${i(n.columns,d.length)} on no ${g(n.rows)}`}: ${d.map(r=>r.label).join(", ")}.`}),M}function ne(t,o,n,s={}){let{app:e,blocks:a=n?e?.viewSpecs?.[n.kind]?.[s.slot??"page"]:e?.home}=s;if(!a?.length)return[];let i=s.firstHeading??(n||s.blocks?void 0:1),g=ke(t,o,n,{...s,money:s.money??e?.brand,firstHeading:i});return n&&!g.node?[]:we(typeof a[0]?.t=="string"?a:be(a),g)}var Oe=240,Re=10,Be=1160,Ie=40,Ge=640,Fe=3,Ne=t=>Math.max(1,Math.floor((Math.min(t,Be)-Ie+Re)/(Oe+Re)));function Ke(t,o,n,s){let{app:e}=s,a=s.width??1440,i=s.today??t.today()??te(),g=t.seenBy(o),p=g.schema,R=g.graph,B=$e(e),P=typeof n=="string"?n.trim():n.slug,M=typeof n=="string"?B.find(l=>l.slug===P||l.title===P||l.address===P):B.find(l=>l.slug===n.slug&&l.kind===n.kind)??n,S=!M&&typeof n=="string"?R.getNode(P):void 0;if(!M&&!S)return{ok:!1,error:`"${P}" is not a place this app has, nor a record this seat can see.`,places:B.map(l=>l.slug)};let T=[],K=e.viewSpecs??{},c=Ne(a),y=(l,h)=>ne(g,null,l,{app:e,today:i,...h}),k=(l,h,w)=>{let m=p.tryDefinition(l.kind),v=F(m,l);if(h==="name")return{id:l.id,kind:l.kind,title:v,parts:[]};if(K[l.kind]?.[h]){let C=y(l,{slot:h}),[I,...f]=C,D=I?.t==="title";return{id:l.id,kind:l.kind,title:D?I.text:v,parts:$(D?f:C,w,`views.${l.kind}.${h}`,` (${l.id})`,D?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:v,parts:[]};let u=m?.computed?Y(p,R,l):l,W=L(u,m,{limit:3,said:[v],glance:!0,locale:e.brand?.locale});return{id:l.id,kind:l.kind,title:v,parts:W.map(C=>({t:"text",text:C.alone}))}};function $(l,h,w,m="",v=0){let x=[];return l.forEach((u,W)=>{let C=`${w}.${W+v}`;switch("problem"in u&&u.problem&&T.push({at:`${C}${m}`,says:u.problem}),u.t){case"title":x.push({t:"heading",level:3,text:u.text});return;case"text":x.push({t:"text",text:u.markdown?ye(u.text):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":x.push({t:"badge",text:u.text});return;case"field":case"image":x.push({t:"field",label:u.label,text:u.text});return;case"progress":x.push({t:"progress",label:u.label,text:u.text});return;case"group":x.push(...$(u.blocks,h,`${C}.group`,m));return;case"when":x.push(...$(u.blocks,h,`${C}.show`,m));return;case"divider":case"figure":return;case"headline":x.push({t:"heading",level:u.level,text:u.text});return;case"number":x.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){x.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&x.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let I=h+1,f=I>Fe?"name":u.as,D=(u.groups??[{value:null,members:u.members}]).map(_=>({..."heading"in _&&_.heading?{heading:_.heading}:{},items:_.members.map(Ce=>k(Ce,f,I))}));x.push({t:"list",as:f,columns:f==="card"?c:1,groups:D,...u.more>0?{more:u.more}:{}});return}}}),x}let d=[],j,r,b;if(S){r="record";let l=p.tryDefinition(S.kind),h=F(l,S);b={slug:S.id,title:h,kind:S.kind,address:ue(p,S.kind,S.id)},K[S.kind]?.page&&d.push(...$(y(S,{slot:"page"}),1,`views.${S.kind}.page`));let m=l?.computed?Y(p,R,S):S;for(let v of he(l,L(m,l,{said:[h],locale:e.brand?.locale}))){v.title&&d.push({t:"heading",level:2,text:v.title});for(let x of v.fields)d.push({t:"field",label:x.label,text:x.value,...x.long?{long:!0}:{},...x.markdown?{markdown:!0}:{}})}}else{let l=M;b={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?pe(e).drawn.find(w=>w.as===l.slug&&(l.kind===null||w.kinds.includes(l.kind))):void 0;if(l.kind===null){let w=e.brand,m=w?.name??e.name,v=w?.logo&&le(w.logo)?w.logo:void 0;if(j={name:m,...w?.subtitle?{subtitle:w.subtitle}:{},...v?{logo:{alt:w?.logoAlt??m,...ae(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},e.home)r="blocks",d=$(y(null,{}),0,"views.home");else{r="derived";let x=t.kindsKeptFrom(o),u=new Set([...e.pages?.hide??[],...x,...t.modules.disabledKinds]),W=me(p.kinds,e.pages?.order).filter(C=>!u.has(C));d.push({t:"heading",level:1,text:e.name??"Home"});for(let C of W){let I=R.nodesOfKind(C).filter(f=>E(p.tryDefinition(C),f)).length;I>0&&d.push({t:"text",text:`${I} ${U(p,C,I)}`})}}}else if(h?.lens==="blocks")r="lens:blocks",d=$(y(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){r="lens:columns";let w=h.options.bindings??{};for(let m of Object.keys(w)){let v=w[m]?.column;if(!v)continue;let x=V(p,m,v),u=H(R.nodesOfKind(m).filter(f=>E(p.tryDefinition(m),f)),h.options.sort,(f,D)=>D==="label"?F(p.tryDefinition(f.kind),f):f[D]);Object.keys(w).length>1&&d.push({t:"heading",level:2,text:U(p,m,2).replace(/^./,f=>f.toUpperCase())}),d.push({t:"text",text:`${u.length} ${U(p,m,u.length)} in columns by ${z(p.tryDefinition(m),v).toLowerCase()}.`});let W=x.map(f=>({column:f,items:u.filter(D=>X(D,v,x)===f.value).map(D=>k(D,"card",1))})).filter(({column:f,items:D})=>f.value!==null||D.length>0).map(({column:f,items:D})=>({heading:`${f.label} (${D.length})`,items:D}));d.push({t:"list",as:"card",columns:1,groups:W});let C=new Map;for(let f of u)for(let D of Z(t,o,f,v,x))C.set(D.to,(C.get(D.to)??new Set).add(`"${D.title}"`));let I=x.filter(f=>f.value!==null&&C.has(f.value)).map(f=>`to ${f.label} by ${[...C.get(f.value)].join(" or ")}`);d.push({t:"text",text:I.length>0?`Moves: ${I.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")r="lens:coverage",d=Pe(p,R,h.options);else if(h){r=`lens:${h.lens}`;let w=h.kinds.flatMap(m=>R.nodesOfKind(m).filter(v=>E(p.tryDefinition(m),v)));d.push({t:"text",text:`A ${h.lens} of ${w.length} ${h.kinds.map(m=>U(p,m,w.length)).join(" and ")}.`}),d.push({t:"list",as:"name",columns:1,groups:[{items:w.map(m=>k(m,"name",1))}]})}else{r="derived";let w=R.nodesOfKind(l.kind).filter(m=>E(p.tryDefinition(l.kind),m));d.push({t:"heading",level:1,text:l.title}),w.length===0?d.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${U(p,l.kind,0)} yet.`}):d.push({t:"list",as:"row",columns:1,groups:[{items:w.map(m=>k(m,"row",1))}]})}}let A=o.kind==="system"?"the system":(o.roles??[]).length>0?(o.roles??[]).join(", "):o.kind,O=a<Ge?"phone":"wide",N=b.kind===null?Te(p,R):[],G={...j?{masthead:j}:{},...N.length>0?{facts:N}:{},place:b,seat:A,width:a,variant:O,drawnBy:r,parts:d,problems:T};return{ok:!0,description:{...G,text:Ae(G)}}}function Te(t,o){let n=xe(t,o,null),s=e=>Array.isArray(e)?e.map(s).join(", "):e===null?"nothing":typeof e=="boolean"?e?"yes":"no":typeof e=="object"?e.label:String(e);return[...fe(t)].map(([e,a])=>{let i=a.label??re(e);return Object.hasOwn(n.values,e)?{name:e,label:i,value:s(n.values[e])}:{name:e,label:i,refused:n.refused[e]??"it could not be worked out"}})}function U(t,o,n){let s=t.tryDefinition(o);if(n===1)return s?.noun??o;let e=oe(t,o);return e.charAt(0).toLowerCase()+e.slice(1)}function Ae(t){let o=[`${t.place.title} (${t.place.address}) \u2014 as ${t.seat}, ${t.width} wide (${t.variant}).`],n=t.masthead;n&&o.push(`Masthead: ${n.logo?`the logo ("${n.logo.alt}", ${n.logo.drawn==="image"?n.logo.src:"inline SVG"}), `:""}${n.name}${n.subtitle?` \u2014 ${n.subtitle}`:""}`);let s=(e,a)=>{for(let i of e)switch(i.t){case"heading":o.push(`${a}${"#".repeat(i.level)} ${i.text}`);break;case"text":o.push(`${a}${i.text}`);break;case"badge":o.push(`${a}[${i.text}]`);break;case"field":case"progress":o.push(`${a}${i.label}: ${i.text}`);break;case"figure":o.push(`${a}${i.text}${i.label?` \u2014 ${i.label}`:""}`);break;case"list":if(i.groups.length===0){i.empty&&o.push(`${a}(${i.empty})`);break}for(let g of i.groups){g.heading&&o.push(`${a}${g.heading}:`);for(let p of g.items)o.push(`${a}${g.heading?" ":""}- ${p.title}`),s(p.parts,`${a}${g.heading?" ":" "}`)}i.as==="card"&&i.columns>1&&o.push(`${a}(cards, ${i.columns} across)`),i.more&&o.push(`${a}and ${i.more} more`);break}};if(s(t.parts,""),t.facts){o.push("Facts of the whole graph (what fact('<name>') reads):");for(let e of t.facts)o.push(`- ${e.label} (${e.name}): ${e.value??`not worked out \u2014 ${e.refused}`}`)}if(t.problems.length>0){o.push("Problems:");for(let e of t.problems)o.push(`- ${e.at}: ${e.says}`)}return o.join(`
1
+ import{a as $e}from"./chunk.UZGRRDHD.js";import{d as be,e as we,h as xe,i as Y,j as ke}from"./chunk.ULRW47RP.js";import{f as fe}from"./chunk.FWTIUYXH.js";import{d as L,e as he}from"./chunk.6YCBYL2Y.js";import{b as ge,e as ye}from"./chunk.UGFJKSHU.js";import{$ as oe,Ab as ie,B as q,Bc as ue,H as te,Kc as pe,Rb as ae,Sc as me,Tb as le,W as E,X as F,Z as re,Zb as H,_ as J,_b as de,ca as z,ob as se,qc as ce,zb as Q}from"./chunk.MNP4JI33.js";function je(t,o,n){let s=t.tryDefinition(o)?.fields.shape,e=q(s?.[n]),a=!1,i=!1;for(;e&&(e.type==="optional"||e.type==="default"||e.type==="nullable"||e.type==="prefault");)(e.type==="optional"||e.type==="nullable")&&(a=!0),(e.type==="default"||e.type==="prefault")&&(i=!0),e=q(e.innerType);if(e?.type!=="enum")return;let g=(e.entries?Object.values(e.entries):e.values??[]).filter(p=>typeof p=="string");return g.length>0?{values:g,empty:a&&!i}:void 0}function V(t,o,n){let s=je(t,o,n);if(!s)return[];let e=t.tryDefinition(o),a=s.values.map(i=>({value:i,label:ge(e,n,i)}));return s.empty&&a.push({value:null,label:`No ${z(e,n).toLowerCase()}`}),a}function X(t,o,n){let s=t[o];return typeof s=="string"&&n.some(e=>e.value===s)?s:null}function Z(t,o,n,s,e=V(t.schema,n.kind,s)){let a=ve(t.schema,t.allMutations(),n.kind,s,e),i=X(n,s,e),g=[];for(let{value:p,by:R,acts:B}of a)if(p!==i)for(let P of B){let M=R==="step"?{[P.subject.arg]:n.id}:{[P.subject.arg]:n.id,[s]:p},S={name:P.name,args:M};if(P.input.safeParse(M).success&&t.permits(S,o).ok){try{se(t.graph,P,M)}catch{continue}g.push({to:p,call:S,title:P.title??P.name});break}}return g}function ve(t,o,n,s,e=V(t,n,s)){let a=Se(t,o,n,s),i=De(t,o,n,s);return e.flatMap(g=>{if(g.value===null)return[];let p=a.filter(R=>R.sets?.[s]===g.value);return[{value:g.value,label:g.label,by:p.length>0?"step":i.length>0?"value":"none",acts:p.length>0?p:i}]})}function Se(t,o,n,s){return o.filter(e=>e.subject!==void 0&&e.derived===void 0&&typeof e.sets?.[s]=="string"&&Q(t,e).includes(n))}function De(t,o,n,s){let e=t.tryDefinition(n);return e?o.filter(a=>{if(!a.subject||!Q(t,a).includes(n)||!ie(a,e).includes(s))return!1;let i=a.input.shape;return i!==void 0&&s in i}).sort((a,i)=>+(a.derived!==void 0)-+(i.derived!==void 0)):[]}var ee=(t,o)=>o&&t[o]!==void 0?String(t[o]):"";function Me(t,o,n){let s=c=>t.tryDefinition(c)?o.nodesOfKind(c).filter(y=>E(t.tryDefinition(c),y)):[],e=s(n.rows),a=s(n.columns),i=new Set(e.map(c=>c.id)),g=new Set(a.map(c=>c.id)),p=o.allEdges(),R=[],B=n.link;if(typeof B=="string"){let c=d=>t.tryDefinition(d)?.edges?.[B]?.to,y=(c(n.columns)??[]).some(d=>d===n.rows||d==="*"),k=(c(n.rows)??[]).some(d=>d===n.columns||d==="*"),$=y||!k;for(let d of p){if(d.kind!==B)continue;let j=$?d.to:d.from,r=$?d.from:d.to;i.has(j)&&g.has(r)&&R.push({rowId:j,columnId:r,via:[]})}}else{let c=new Map(B.path.map(k=>[k,new Map]));for(let k of p){let $=c.get(k.kind);if(!$)continue;let d=$.get(k.from);d?d.push(k.to):$.set(k.from,[k.to]);let j=$.get(k.to);j?j.push(k.from):$.set(k.to,[k.from])}let y=new Set;for(let k of a){let $=[{id:k.id,via:[]}];for(let d of B.path){let j=[],r=new Set;for(let b of $)for(let A of c.get(d).get(b.id)??[])r.has(`${b.id}|${A}`)||(r.add(`${b.id}|${A}`),j.push({id:A,via:[...b.via,b.id]}));$=j}for(let d of $){let j=`${d.id}|${k.id}`;!i.has(d.id)||y.has(j)||(y.add(j),R.push({rowId:d.id,columnId:k.id,via:d.via.slice(1)}))}}}let P=n.groupOrder??[],M=c=>P.indexOf(c)===-1?P.length:P.indexOf(c),S=(c,y)=>y==="label"?F(t.tryDefinition(c.kind),c):c[y],T=H(e,n.sort,S).map(c=>{let y=c;return{node:c,label:F(t.tryDefinition(c.kind),c),group:ee(y,n.rowGroup),ref:ee(y,n.rowRef)}}).sort((c,y)=>M(c.group)-M(y.group)||(n.sort!==void 0?0:c.ref<y.ref?-1:c.ref>y.ref?1:0)),K=H(a,n.columnSort,S).map(c=>({node:c,label:F(t.tryDefinition(c.kind),c),group:ee(c,n.columnGroup)})).sort((c,y)=>c.group<y.group?-1:c.group>y.group?1:n.columnSort!==void 0?0:c.node.id<y.node.id?-1:c.node.id>y.node.id?1:0);return{rows:T,columns:K,cells:R}}function Pe(t,o,n){let{rows:s,columns:e,cells:a}=Me(t,o,n),i=(r,b)=>J(t,r,b),g=r=>J(t,r,1).replace(/^1 /,""),p=r=>({id:r.id,kind:r.kind,title:F(t.tryDefinition(r.kind),r),parts:[]}),R=r=>{let b=o.getNode(r);if(!b)return null;let A=t.tryDefinition(b.kind),O=F(A,b),N=L(b,A,{limit:3,said:[O],glance:!0}).map(G=>G.alone.startsWith(G.label)?`${G.label.toLowerCase()}${G.alone.slice(G.label.length)}`:G.alone);return[O,...N].join(", ")},B=typeof n.link=="string"?[]:n.link.path.slice(0,-1).flatMap((r,b,A)=>{let O=ce(t,n.columns,A.slice(0,b+1));return O.ok?[...O.reached]:[]}),P=de(t,n,{rows:s.length,columns:e.length,cells:a.length});if(P)return[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}.`},{t:"text",text:P}];let M=[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}${B.length>0?`, through ${[...new Set(B)].map(r=>i(r,2).replace(/^2 /,"")).join(" and ")}`:""}${e.length>0?`: ${e.map(r=>r.label).join(", ")}`:""}.`}],S=new Map(e.map(r=>[r.node.id,r.label])),T=new Map(e.map((r,b)=>[r.node.id,b])),K=new Map,c=new Map;for(let r of a){let b=K.get(r.rowId);b?b.push(r):K.set(r.rowId,[r]);let A=c.get(r.columnId);A?A.add(r.rowId):c.set(r.columnId,new Set([r.rowId]))}for(let r of s){let A=[...K.get(r.node.id)??[]].sort((O,N)=>T.get(O.columnId)-T.get(N.columnId)).map(O=>{let N=O.via.map(R).filter(G=>G!==null);return`${S.get(O.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:r.label,text:A.length>0?A.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:e.map(r=>{let b=c.get(r.node.id)??new Set,A=s.filter(O=>b.has(O.node.id)).map(O=>p(O.node));return{heading:`${r.label} (${A.length})`,items:A}})});let y=new Set(a.map(r=>r.rowId)),k=new Set(a.map(r=>r.columnId)),$=s.filter(r=>!y.has(r.node.id)),d=e.filter(r=>!k.has(r.node.id)),j=n.rows===n.columns;return $.length>0&&M.push({t:"text",text:`${j?`${$.length} with none across`:`${i(n.rows,$.length)} with no ${g(n.columns)}`}: ${$.map(r=>r.label).join(", ")}.`}),d.length>0&&M.push({t:"text",text:`${j?`${d.length} with none down`:`${i(n.columns,d.length)} on no ${g(n.rows)}`}: ${d.map(r=>r.label).join(", ")}.`}),M}function ne(t,o,n,s={}){let{app:e,blocks:a=n?e?.viewSpecs?.[n.kind]?.[s.slot??"page"]:e?.home}=s;if(!a?.length)return[];let i=s.firstHeading??(n||s.blocks?void 0:1),g=ke(t,o,n,{...s,money:s.money??e?.brand,firstHeading:i});return n&&!g.node?[]:we(typeof a[0]?.t=="string"?a:be(a),g)}var Oe=240,Re=10,Be=1160,Ie=40,Ge=640,Fe=3,Ne=t=>Math.max(1,Math.floor((Math.min(t,Be)-Ie+Re)/(Oe+Re)));function Ke(t,o,n,s){let{app:e}=s,a=s.width??1440,i=s.today??t.today()??te(),g=t.seenBy(o),p=g.schema,R=g.graph,B=$e(e),P=typeof n=="string"?n.trim():n.slug,M=typeof n=="string"?B.find(l=>l.slug===P||l.title===P||l.address===P):B.find(l=>l.slug===n.slug&&l.kind===n.kind)??n,S=!M&&typeof n=="string"?R.getNode(P):void 0;if(!M&&!S)return{ok:!1,error:`"${P}" is not a place this app has, nor a record this seat can see.`,places:B.map(l=>l.slug)};let T=[],K=e.viewSpecs??{},c=Ne(a),y=(l,h)=>ne(g,null,l,{app:e,today:i,...h}),k=(l,h,w)=>{let m=p.tryDefinition(l.kind),v=F(m,l);if(h==="name")return{id:l.id,kind:l.kind,title:v,parts:[]};if(K[l.kind]?.[h]){let C=y(l,{slot:h}),[I,...f]=C,D=I?.t==="title";return{id:l.id,kind:l.kind,title:D?I.text:v,parts:$(D?f:C,w,`views.${l.kind}.${h}`,` (${l.id})`,D?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:v,parts:[]};let u=m?.computed?Y(p,R,l):l,W=L(u,m,{limit:3,said:[v],glance:!0,locale:e.brand?.locale});return{id:l.id,kind:l.kind,title:v,parts:W.map(C=>({t:"text",text:C.alone}))}};function $(l,h,w,m="",v=0){let x=[];return l.forEach((u,W)=>{let C=`${w}.${W+v}`;switch("problem"in u&&u.problem&&T.push({at:`${C}${m}`,says:u.problem}),u.t){case"title":x.push({t:"heading",level:3,text:u.text});return;case"text":x.push({t:"text",text:u.markdown?ye(u.text):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":x.push({t:"badge",text:u.text});return;case"field":case"image":x.push({t:"field",label:u.label,text:u.text});return;case"progress":x.push({t:"progress",label:u.label,text:u.text});return;case"group":x.push(...$(u.blocks,h,`${C}.group`,m));return;case"when":x.push(...$(u.blocks,h,`${C}.show`,m));return;case"divider":case"figure":return;case"headline":x.push({t:"heading",level:u.level,text:u.text});return;case"number":x.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){x.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&x.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let I=h+1,f=I>Fe?"name":u.as,D=(u.groups??[{value:null,members:u.members}]).map(_=>({..."heading"in _&&_.heading?{heading:_.heading}:{},items:_.members.map(Ce=>k(Ce,f,I))}));x.push({t:"list",as:f,columns:f==="card"?c:1,groups:D,...u.more>0?{more:u.more}:{}});return}}}),x}let d=[],j,r,b;if(S){r="record";let l=p.tryDefinition(S.kind),h=F(l,S);b={slug:S.id,title:h,kind:S.kind,address:ue(p,S.kind,S.id)},K[S.kind]?.page&&d.push(...$(y(S,{slot:"page"}),1,`views.${S.kind}.page`));let m=l?.computed?Y(p,R,S):S;for(let v of he(l,L(m,l,{said:[h],locale:e.brand?.locale}))){v.title&&d.push({t:"heading",level:2,text:v.title});for(let x of v.fields)d.push({t:"field",label:x.label,text:x.value,...x.long?{long:!0}:{},...x.markdown?{markdown:!0}:{}})}}else{let l=M;b={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?pe(e).drawn.find(w=>w.as===l.slug&&(l.kind===null||w.kinds.includes(l.kind))):void 0;if(l.kind===null){let w=e.brand,m=w?.name??e.name,v=w?.logo&&le(w.logo)?w.logo:void 0;if(j={name:m,...w?.subtitle?{subtitle:w.subtitle}:{},...v?{logo:{alt:w?.logoAlt??m,...ae(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},e.home)r="blocks",d=$(y(null,{}),0,"views.home");else{r="derived";let x=t.kindsKeptFrom(o),u=new Set([...e.pages?.hide??[],...x,...t.modules.disabledKinds]),W=me(p.kinds,e.pages?.order).filter(C=>!u.has(C));d.push({t:"heading",level:1,text:e.name??"Home"});for(let C of W){let I=R.nodesOfKind(C).filter(f=>E(p.tryDefinition(C),f)).length;I>0&&d.push({t:"text",text:`${I} ${U(p,C,I)}`})}}}else if(h?.lens==="blocks")r="lens:blocks",d=$(y(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){r="lens:columns";let w=h.options.bindings??{};for(let m of Object.keys(w)){let v=w[m]?.column;if(!v)continue;let x=V(p,m,v),u=H(R.nodesOfKind(m).filter(f=>E(p.tryDefinition(m),f)),h.options.sort,(f,D)=>D==="label"?F(p.tryDefinition(f.kind),f):f[D]);Object.keys(w).length>1&&d.push({t:"heading",level:2,text:U(p,m,2).replace(/^./,f=>f.toUpperCase())}),d.push({t:"text",text:`${u.length} ${U(p,m,u.length)} in columns by ${z(p.tryDefinition(m),v).toLowerCase()}.`});let W=x.map(f=>({column:f,items:u.filter(D=>X(D,v,x)===f.value).map(D=>k(D,"card",1))})).filter(({column:f,items:D})=>f.value!==null||D.length>0).map(({column:f,items:D})=>({heading:`${f.label} (${D.length})`,items:D}));d.push({t:"list",as:"card",columns:1,groups:W});let C=new Map;for(let f of u)for(let D of Z(t,o,f,v,x))C.set(D.to,(C.get(D.to)??new Set).add(`"${D.title}"`));let I=x.filter(f=>f.value!==null&&C.has(f.value)).map(f=>`to ${f.label} by ${[...C.get(f.value)].join(" or ")}`);d.push({t:"text",text:I.length>0?`Moves: ${I.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")r="lens:coverage",d=Pe(p,R,h.options);else if(h){r=`lens:${h.lens}`;let w=h.kinds.flatMap(m=>R.nodesOfKind(m).filter(v=>E(p.tryDefinition(m),v)));d.push({t:"text",text:`A ${h.lens} of ${w.length} ${h.kinds.map(m=>U(p,m,w.length)).join(" and ")}.`}),d.push({t:"list",as:"name",columns:1,groups:[{items:w.map(m=>k(m,"name",1))}]})}else{r="derived";let w=R.nodesOfKind(l.kind).filter(m=>E(p.tryDefinition(l.kind),m));d.push({t:"heading",level:1,text:l.title}),w.length===0?d.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${U(p,l.kind,0)} yet.`}):d.push({t:"list",as:"row",columns:1,groups:[{items:w.map(m=>k(m,"row",1))}]})}}let A=o.kind==="system"?"the system":(o.roles??[]).length>0?(o.roles??[]).join(", "):o.kind,O=a<Ge?"phone":"wide",N=b.kind===null?Te(p,R):[],G={...j?{masthead:j}:{},...N.length>0?{facts:N}:{},place:b,seat:A,width:a,variant:O,drawnBy:r,parts:d,problems:T};return{ok:!0,description:{...G,text:Ae(G)}}}function Te(t,o){let n=xe(t,o,null),s=e=>Array.isArray(e)?e.map(s).join(", "):e===null?"nothing":typeof e=="boolean"?e?"yes":"no":typeof e=="object"?e.label:String(e);return[...fe(t)].map(([e,a])=>{let i=a.label??re(e);return Object.hasOwn(n.values,e)?{name:e,label:i,value:s(n.values[e])}:{name:e,label:i,refused:n.refused[e]??"it could not be worked out"}})}function U(t,o,n){let s=t.tryDefinition(o);if(n===1)return s?.noun??o;let e=oe(t,o);return e.charAt(0).toLowerCase()+e.slice(1)}function Ae(t){let o=[`${t.place.title} (${t.place.address}) \u2014 as ${t.seat}, ${t.width} wide (${t.variant}).`],n=t.masthead;n&&o.push(`Masthead: ${n.logo?`the logo ("${n.logo.alt}", ${n.logo.drawn==="image"?n.logo.src:"inline SVG"}), `:""}${n.name}${n.subtitle?` \u2014 ${n.subtitle}`:""}`);let s=(e,a)=>{for(let i of e)switch(i.t){case"heading":o.push(`${a}${"#".repeat(i.level)} ${i.text}`);break;case"text":o.push(`${a}${i.text}`);break;case"badge":o.push(`${a}[${i.text}]`);break;case"field":case"progress":o.push(`${a}${i.label}: ${i.text}`);break;case"figure":o.push(`${a}${i.text}${i.label?` \u2014 ${i.label}`:""}`);break;case"list":if(i.groups.length===0){i.empty&&o.push(`${a}(${i.empty})`);break}for(let g of i.groups){g.heading&&o.push(`${a}${g.heading}:`);for(let p of g.items)o.push(`${a}${g.heading?" ":""}- ${p.title}`),s(p.parts,`${a}${g.heading?" ":" "}`)}i.as==="card"&&i.columns>1&&o.push(`${a}(cards, ${i.columns} across)`),i.more&&o.push(`${a}and ${i.more} more`);break}};if(s(t.parts,""),t.facts){o.push("Facts of the whole graph (what fact('<name>') reads):");for(let e of t.facts)o.push(`- ${e.label} (${e.name}): ${e.value??`not worked out \u2014 ${e.refused}`}`)}if(t.problems.length>0){o.push("Problems:");for(let e of t.problems)o.push(`- ${e.at}: ${e.says}`)}return o.join(`
2
2
  `)}export{V as a,X as b,Z as c,ve as d,Se as e,De as f,ne as g,Ke as h,Ae as i};
@@ -0,0 +1 @@
1
+ import"./chunk.JOOQUWLT.js";import{F as W,Q as x}from"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function L({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{L as WhenMonth};
@@ -1,4 +1,4 @@
1
- import{cc as e}from"./chunk.6V2RG5JG.js";var a=`
1
+ import{dc as e}from"./chunk.MNP4JI33.js";var a=`
2
2
  .graview-spec{display:flex;flex-direction:column;gap:6px;min-width:0;color:var(--graview-ink)}
3
3
 
4
4
  .graview-spec-row{flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px 10px;box-sizing:border-box;max-width:100%;padding:5px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius-sm,8px);background:var(--graview-panel);font-size:.875rem}