graview 0.1.51 → 0.1.53

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 (214) hide show
  1. package/dist/preview/chunk.2IKVO743.js +1 -0
  2. package/dist/preview/{chunk.UK5F3S2N.js → chunk.2LQ37DC2.js} +1 -1
  3. package/dist/preview/{chunk.ALCH5H7U.js → chunk.3377DLPA.js} +1 -1
  4. package/dist/preview/chunk.34Q7OKK3.js +1 -0
  5. package/dist/preview/{chunk.5ZAK57JA.js → chunk.36XV4ZMC.js} +2 -2
  6. package/dist/preview/chunk.3FRVG6JW.js +32 -0
  7. package/dist/preview/{chunk.3MU37W5D.js → chunk.3FUFVVR4.js} +1 -1
  8. package/dist/preview/chunk.3Y7BDRP3.js +1 -0
  9. package/dist/preview/{chunk.3TVAE7LE.js → chunk.4DCPB67O.js} +1 -1
  10. package/dist/preview/chunk.4DFO43VM.js +1 -0
  11. package/dist/preview/chunk.4QVZXCV5.js +1 -0
  12. package/dist/preview/chunk.4SVAHPJA.js +1 -0
  13. package/dist/preview/chunk.52Y37IAD.js +1 -0
  14. package/dist/preview/chunk.56UFDIX5.js +1 -0
  15. package/dist/preview/chunk.5E4UGVAD.js +1 -0
  16. package/dist/preview/chunk.5H3VCAPN.js +1 -0
  17. package/dist/preview/chunk.5K5D4IMM.js +1 -0
  18. package/dist/preview/{chunk.DQNN5FE5.js → chunk.5XFRWXYQ.js} +1 -1
  19. package/dist/preview/{chunk.PYRJDTVS.js → chunk.65F3DF5Q.js} +1 -1
  20. package/dist/preview/{chunk.CMEETACI.js → chunk.6CVW53WA.js} +1 -1
  21. package/dist/preview/chunk.6ESAZJBN.js +1 -0
  22. package/dist/preview/chunk.6S3B4XC4.js +1 -0
  23. package/dist/preview/{chunk.P4CLT32V.js → chunk.6W2DUW5S.js} +5 -5
  24. package/dist/preview/chunk.6YGRRXJB.js +2 -0
  25. package/dist/preview/{chunk.CQPNDJAC.js → chunk.72Q4R7N6.js} +1 -1
  26. package/dist/preview/chunk.7BXOQEUP.js +1 -0
  27. package/dist/preview/{chunk.OJ64WTLW.js → chunk.7NFCI4LH.js} +2 -2
  28. package/dist/preview/{chunk.EA2NMVRE.js → chunk.7R6GXJS4.js} +1 -1
  29. package/dist/preview/chunk.A2RQFAZ6.js +1 -0
  30. package/dist/preview/{chunk.TNL2BVCH.js → chunk.AQJD23AN.js} +1 -1
  31. package/dist/preview/{chunk.NQ26KMSQ.js → chunk.ASCTAUFD.js} +1 -1
  32. package/dist/preview/chunk.B3T4N2XM.js +25 -0
  33. package/dist/preview/chunk.B3WVCSW5.js +1 -0
  34. package/dist/preview/{chunk.AL7LFNOS.js → chunk.BB5XKTVC.js} +1 -1
  35. package/dist/preview/{chunk.LYIHPVDZ.js → chunk.BG2SC77J.js} +1 -1
  36. package/dist/preview/{chunk.353CGK6C.js → chunk.BPPDBPTL.js} +1 -1
  37. package/dist/preview/chunk.BQHRZJ5Z.js +1 -0
  38. package/dist/preview/{chunk.W2DKFQ6R.js → chunk.CANTHIRO.js} +1 -1
  39. package/dist/preview/chunk.CIUQWCU4.js +1 -0
  40. package/dist/preview/chunk.CSA6SWTI.js +1 -0
  41. package/dist/preview/{chunk.GJQF7I22.js → chunk.CWPRQSED.js} +1 -1
  42. package/dist/preview/{chunk.4EZFOZBA.js → chunk.CYP5KXIQ.js} +1 -1
  43. package/dist/preview/chunk.D3A24PQ6.js +1 -0
  44. package/dist/preview/{chunk.7RIFDWDF.js → chunk.DQPEVPKQ.js} +1 -1
  45. package/dist/preview/{chunk.XWXYC3BJ.js → chunk.DUZS52WX.js} +1 -1
  46. package/dist/preview/chunk.E52UTLQ2.js +1 -0
  47. package/dist/preview/{chunk.2534FLZZ.js → chunk.E647LWH5.js} +1 -1
  48. package/dist/preview/chunk.EG2N5F6L.js +1 -0
  49. package/dist/preview/{chunk.SPU3BVAO.js → chunk.EZXGVTT2.js} +1 -1
  50. package/dist/preview/chunk.F5RN6YXG.js +4 -0
  51. package/dist/preview/chunk.FBRARPGR.js +4 -0
  52. package/dist/preview/{chunk.XCCBUWMC.js → chunk.FCAKLO5U.js} +1 -1
  53. package/dist/preview/{chunk.ACB4TD4W.js → chunk.FGJM4LJO.js} +1 -1
  54. package/dist/preview/{chunk.WESWDXRW.js → chunk.FJN4OGAS.js} +1 -1
  55. package/dist/preview/chunk.FXNUR5JI.js +88 -0
  56. package/dist/preview/chunk.G226CUJQ.js +1 -0
  57. package/dist/preview/chunk.G6DISMVT.js +67 -0
  58. package/dist/preview/{chunk.SRFZKDQ6.js → chunk.GANAZIRD.js} +1 -1
  59. package/dist/preview/{chunk.SJKHVIHA.js → chunk.GBIVIHGD.js} +19 -14
  60. package/dist/preview/chunk.GGHZEAAT.js +1 -0
  61. package/dist/preview/chunk.GPYZR6HE.js +1 -0
  62. package/dist/preview/{chunk.JI2UVZUU.js → chunk.GYO57LKD.js} +1 -1
  63. package/dist/preview/{chunk.MN6WHE4B.js → chunk.GZBODS7Z.js} +1 -1
  64. package/dist/preview/chunk.GZWC72HS.js +1 -0
  65. package/dist/preview/{chunk.2W2YVB6X.js → chunk.H2B3SEI7.js} +1 -1
  66. package/dist/preview/{chunk.ESK3UZRC.js → chunk.H6EMDQP5.js} +1 -1
  67. package/dist/preview/chunk.HAIHXBVX.js +1 -0
  68. package/dist/preview/{chunk.ESSENNHM.js → chunk.HBVURYWY.js} +2 -2
  69. package/dist/preview/{chunk.ZZODDJYK.js → chunk.HDXDYS4C.js} +1 -1
  70. package/dist/preview/chunk.HE545Z6I.js +1 -0
  71. package/dist/preview/chunk.HIDLE6BN.js +18 -0
  72. package/dist/preview/chunk.HIFLBWQJ.js +9 -0
  73. package/dist/preview/chunk.I62MCBQM.js +1 -0
  74. package/dist/preview/chunk.I6SUHXJF.js +1 -0
  75. package/dist/preview/chunk.I6W3IQ4W.js +1 -0
  76. package/dist/preview/chunk.ICYJ7QJG.js +2 -0
  77. package/dist/preview/{chunk.Z7N3MJ36.js → chunk.IYVBJDR7.js} +1 -1
  78. package/dist/preview/{chunk.FFCUZPTC.js → chunk.J6OT74RM.js} +1 -1
  79. package/dist/preview/{chunk.K7RKWB2K.js → chunk.JCJ7NTW4.js} +1 -1
  80. package/dist/preview/{chunk.4T67XS2D.js → chunk.JKCLYLT4.js} +1 -1
  81. package/dist/preview/chunk.JQTO52Q7.js +1 -0
  82. package/dist/preview/chunk.JRU5BT7K.js +5 -0
  83. package/dist/preview/{chunk.XCQ7ZPR5.js → chunk.K7WME4P4.js} +1 -1
  84. package/dist/preview/{chunk.APFRPN5S.js → chunk.KAKJYAHM.js} +1 -1
  85. package/dist/preview/chunk.KCM2VOC7.js +1 -0
  86. package/dist/preview/{chunk.CTOBNZLM.js → chunk.KWMBRB6O.js} +1 -1
  87. package/dist/preview/{chunk.KVEDMKUN.js → chunk.KY7QD22S.js} +1 -1
  88. package/dist/preview/{chunk.S32AGJ3W.js → chunk.LAOZEYYQ.js} +1 -1
  89. package/dist/preview/{chunk.7GAC7U34.js → chunk.LCG3VLCB.js} +1 -1
  90. package/dist/preview/{chunk.IUIDDNN3.js → chunk.LDLWYAHK.js} +1 -1
  91. package/dist/preview/chunk.LEKML4S4.js +1 -0
  92. package/dist/preview/{chunk.MY5OXSS7.js → chunk.MDIAWTNK.js} +1 -1
  93. package/dist/preview/chunk.MKWVNW4Q.js +35 -0
  94. package/dist/preview/{chunk.3H7YIKKC.js → chunk.MSPRCR3Q.js} +1 -1
  95. package/dist/preview/{chunk.VICCAWAN.js → chunk.MT45H2T5.js} +1 -1
  96. package/dist/preview/chunk.MXTDQXVW.js +1 -0
  97. package/dist/preview/{chunk.WQLAIEWJ.js → chunk.N6A3DIOY.js} +1 -1
  98. package/dist/preview/{chunk.FU4YSVWX.js → chunk.NAEEPUWJ.js} +1 -1
  99. package/dist/preview/{chunk.KK46XLGU.js → chunk.NCTTPW7A.js} +1 -1
  100. package/dist/preview/chunk.OCWZJNZF.js +1 -0
  101. package/dist/preview/chunk.OP3ZUI4W.js +1 -0
  102. package/dist/preview/{chunk.U7SNDY3F.js → chunk.OPKXCL5R.js} +1 -1
  103. package/dist/preview/chunk.OXLYDXQV.js +1 -0
  104. package/dist/preview/{chunk.6KYWJXZR.js → chunk.OZYZBRWO.js} +1 -1
  105. package/dist/preview/chunk.P2W727C7.js +1 -0
  106. package/dist/preview/{chunk.T3RTFTOZ.js → chunk.P7FN3SFB.js} +1 -1
  107. package/dist/preview/{chunk.NVRK6A7T.js → chunk.PEA4D66Y.js} +1 -1
  108. package/dist/preview/chunk.Q5JVKSEN.js +1 -0
  109. package/dist/preview/chunk.QATG5HNV.js +1 -0
  110. package/dist/preview/{chunk.NZDHXREL.js → chunk.R3DWF35R.js} +1 -1
  111. package/dist/preview/{chunk.BYY7YXBI.js → chunk.RIS3OKAI.js} +1 -1
  112. package/dist/preview/{chunk.GMAXA5GV.js → chunk.RUTZEEBR.js} +1 -1
  113. package/dist/preview/{chunk.OU5TRY4N.js → chunk.S2ATSY6P.js} +1 -1
  114. package/dist/preview/{chunk.MX3Y3LPH.js → chunk.S6TN3MLY.js} +1 -1
  115. package/dist/preview/{chunk.IE4ZJQV3.js → chunk.T56SOSIR.js} +4 -4
  116. package/dist/preview/chunk.THL67D77.js +1 -0
  117. package/dist/preview/{chunk.SSAY4ITS.js → chunk.TLQTDKOL.js} +2 -2
  118. package/dist/preview/{chunk.FKJ3HIA5.js → chunk.TRPPN2GD.js} +1 -1
  119. package/dist/preview/{chunk.OW72XZF4.js → chunk.TTFYXKLI.js} +1 -1
  120. package/dist/preview/{chunk.HVX7LFWR.js → chunk.TXEWSZGO.js} +1 -1
  121. package/dist/preview/chunk.U4T4Y2MT.js +1 -0
  122. package/dist/preview/chunk.ULTYDYTS.js +19 -0
  123. package/dist/preview/chunk.UQ4CASST.js +1 -0
  124. package/dist/preview/chunk.UQENE3VE.js +1 -0
  125. package/dist/preview/chunk.USAGE5C6.js +28 -0
  126. package/dist/preview/{chunk.RMMJQYJJ.js → chunk.UVMLX4US.js} +1 -1
  127. package/dist/preview/{chunk.2VJ52LGS.js → chunk.UXNZPPWR.js} +1 -1
  128. package/dist/preview/chunk.UYCPQ6IW.js +1 -0
  129. package/dist/preview/chunk.V6X3U3JF.js +1 -0
  130. package/dist/preview/{chunk.K7ECYKZL.js → chunk.VOHDRH3P.js} +1 -1
  131. package/dist/preview/{chunk.HFKGND5Q.js → chunk.VRJ4TULC.js} +1 -1
  132. package/dist/preview/{chunk.GLTWLQ6L.js → chunk.VTCPA4V4.js} +1 -1
  133. package/dist/preview/chunk.VTRI2MT2.js +2 -0
  134. package/dist/preview/chunk.W54NXXC5.js +293 -0
  135. package/dist/preview/{chunk.MG3DMURZ.js → chunk.WDEMPWS4.js} +1 -1
  136. package/dist/preview/chunk.XBNASVTY.js +1 -0
  137. package/dist/preview/{chunk.B4PUI3GO.js → chunk.XDEKL6TJ.js} +1 -1
  138. package/dist/preview/chunk.XE72DFBV.js +13 -0
  139. package/dist/preview/{chunk.UWFEXEY3.js → chunk.XFIZLWYA.js} +1 -1
  140. package/dist/preview/{chunk.76QSPWSJ.js → chunk.XXCT6DLX.js} +1 -1
  141. package/dist/preview/{chunk.JX2C3HVD.js → chunk.Y4VOCJ7R.js} +1 -1
  142. package/dist/preview/chunk.YA7ZMGOL.js +1 -0
  143. package/dist/preview/{chunk.B7LBG4UP.js → chunk.YI7WHBAD.js} +2 -2
  144. package/dist/preview/{chunk.WFHFWJ6E.js → chunk.Z4YSCHZT.js} +1 -1
  145. package/dist/preview/{chunk.B6LKLV32.js → chunk.ZQWKS6K5.js} +1 -1
  146. package/dist/preview/{chunk.R5R7CLOU.js → chunk.ZYYM52N5.js} +1 -1
  147. package/dist/preview/index.html +50 -50
  148. package/dist/preview/page.js +2 -2
  149. package/package.json +6 -6
  150. package/dist/preview/chunk.2W45NM7Q.js +0 -9
  151. package/dist/preview/chunk.32BOL7OL.js +0 -1
  152. package/dist/preview/chunk.34HGT7HQ.js +0 -1
  153. package/dist/preview/chunk.3SBTQ66X.js +0 -1
  154. package/dist/preview/chunk.4N5R4K6O.js +0 -1
  155. package/dist/preview/chunk.5ON3JSAK.js +0 -1
  156. package/dist/preview/chunk.7G4M2PX3.js +0 -5
  157. package/dist/preview/chunk.7NQROWHU.js +0 -1
  158. package/dist/preview/chunk.AJAMTRZ3.js +0 -1
  159. package/dist/preview/chunk.AL45OI4A.js +0 -1
  160. package/dist/preview/chunk.AZOW57MT.js +0 -1
  161. package/dist/preview/chunk.BRDAO2OF.js +0 -4
  162. package/dist/preview/chunk.BV6HKTHK.js +0 -1
  163. package/dist/preview/chunk.CI4DEKPX.js +0 -1
  164. package/dist/preview/chunk.CUB4IAUJ.js +0 -1
  165. package/dist/preview/chunk.CUN4VN42.js +0 -1
  166. package/dist/preview/chunk.CV55N3Y6.js +0 -1
  167. package/dist/preview/chunk.CXC5FOIO.js +0 -1
  168. package/dist/preview/chunk.DEH6O3K4.js +0 -28
  169. package/dist/preview/chunk.DUY27OJV.js +0 -1
  170. package/dist/preview/chunk.E2R6VFZX.js +0 -1
  171. package/dist/preview/chunk.ET3XJDPX.js +0 -1
  172. package/dist/preview/chunk.FEIJ7ETK.js +0 -1
  173. package/dist/preview/chunk.FG5ZFYYL.js +0 -1
  174. package/dist/preview/chunk.FTBH7CPZ.js +0 -1
  175. package/dist/preview/chunk.FYDDFOSD.js +0 -35
  176. package/dist/preview/chunk.G446PWV6.js +0 -1
  177. package/dist/preview/chunk.GRYS6VSF.js +0 -1
  178. package/dist/preview/chunk.GYTVL6GR.js +0 -359
  179. package/dist/preview/chunk.HASVT7IC.js +0 -1
  180. package/dist/preview/chunk.IBJBCZKG.js +0 -1
  181. package/dist/preview/chunk.IFL2MYTQ.js +0 -1
  182. package/dist/preview/chunk.JBR66TUP.js +0 -1
  183. package/dist/preview/chunk.JG2FGZF2.js +0 -18
  184. package/dist/preview/chunk.JMDKAP23.js +0 -1
  185. package/dist/preview/chunk.KOBCLWPC.js +0 -1
  186. package/dist/preview/chunk.KQSD5MLY.js +0 -1
  187. package/dist/preview/chunk.KRODTMGR.js +0 -1
  188. package/dist/preview/chunk.KYKHZZT7.js +0 -1
  189. package/dist/preview/chunk.MCFLCC42.js +0 -12
  190. package/dist/preview/chunk.MMVCZOEX.js +0 -32
  191. package/dist/preview/chunk.MRXQBEPQ.js +0 -1
  192. package/dist/preview/chunk.N5XONWU2.js +0 -1
  193. package/dist/preview/chunk.NNUUD26E.js +0 -1
  194. package/dist/preview/chunk.OHDJYGH7.js +0 -2
  195. package/dist/preview/chunk.OPCBZNKF.js +0 -19
  196. package/dist/preview/chunk.PMV6XVVZ.js +0 -1
  197. package/dist/preview/chunk.PPZ2TOB5.js +0 -1
  198. package/dist/preview/chunk.QEQQXWYU.js +0 -1
  199. package/dist/preview/chunk.QPAJCRFB.js +0 -1
  200. package/dist/preview/chunk.RNOBACJ6.js +0 -1
  201. package/dist/preview/chunk.S4CKKT3C.js +0 -1
  202. package/dist/preview/chunk.SJYQ72EC.js +0 -1
  203. package/dist/preview/chunk.SKG4IHT5.js +0 -88
  204. package/dist/preview/chunk.TBSPEO2L.js +0 -1
  205. package/dist/preview/chunk.TMYGLXR6.js +0 -25
  206. package/dist/preview/chunk.TVWN5I4M.js +0 -1
  207. package/dist/preview/chunk.UCUWEYKM.js +0 -1
  208. package/dist/preview/chunk.UIWI4GKW.js +0 -1
  209. package/dist/preview/chunk.UVAWWCFW.js +0 -1
  210. package/dist/preview/chunk.V4GAOZAW.js +0 -1
  211. package/dist/preview/chunk.XZVPVAIS.js +0 -1
  212. package/dist/preview/chunk.Y2ZBVWII.js +0 -1
  213. package/dist/preview/chunk.Y3LTHEN7.js +0 -1
  214. package/dist/preview/chunk.Y5AMZBHA.js +0 -4
@@ -1,2 +1,2 @@
1
- import{a as Ge}from"./chunk.ET3XJDPX.js";import{c as Me,d as Oe,f as Be}from"./chunk.Z7N3MJ36.js";import{e as Pe,f as Ce,j as Re,k as re,l as Fe}from"./chunk.GLTWLQ6L.js";import{f as Se}from"./chunk.NVRK6A7T.js";import{d as _,e as je,k as ne}from"./chunk.OU5TRY4N.js";import{b as De,e as Ae}from"./chunk.CQPNDJAC.js";import{$ as ue,$c as ve,Ac as ye,C as Q,Cc as we,Gb as fe,Hc as U,Hd as xe,I as de,Ic as be,Yb as te,Zb as ge,ca as T,da as K,ea as me,fa as Z,ga as ee,ha as pe,ka as q,ma as z,pd as $e,yc as he,zd as ke}from"./chunk.P4CLT32V.js";function ze(r,e,t){let s=r.tryDefinition(e)?.fields.shape,n=Q(s?.[t]),a=!1,o=!1;for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)(n.type==="optional"||n.type==="nullable")&&(a=!0),(n.type==="default"||n.type==="prefault")&&(o=!0),n=Q(n.innerType);if(n?.type!=="enum")return;let p=(n.entries?Object.values(n.entries):n.values??[]).filter(u=>typeof u=="string");return p.length>0?{values:p,empty:a&&!o}:void 0}function E(r,e,t){let s=ze(r,e,t);if(!s)return[];let n=r.tryDefinition(e),a=s.values.map(o=>({value:o,label:De(n,t,o)}));return s.empty&&a.push({value:null,label:`No ${q(n,t).toLowerCase()}`}),a}function X(r,e,t){let s=r[e];return typeof s=="string"&&t.some(n=>n.value===s)?s:null}function oe(r,e,t,s,n=E(r.schema,t.kind,s)){return Ie(r,e,t,s,n).flatMap(a=>a.move?[a.move]:[])}function Ie(r,e,t,s,n=E(r.schema,t.kind,s)){let a=Ne(r.schema,r.allMutations(),t.kind,s,n),o=X(t,s,n),p=z(r.schema.tryDefinition(t.kind),t.kind),u=[];for(let{value:A,label:R,by:F,acts:M}of a){if(A===o)continue;let x,G,I;for(let l of M){let w=F==="step"?{[l.subject.arg]:t.id}:{[l.subject.arg]:t.id,[s]:A},S={name:l.name,args:w};if(!l.input.safeParse(w).success){I??=`${l.title??l.name} asks for more than the ${p} itself.`;continue}let k=r.permits(S,e);if(!k.ok){G??=k.refusal?.message??`You may not ${l.title??l.name}.`;continue}try{fe(r.graph,l,w)}catch(f){G??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:l.title??l.name};break}u.push(x?{to:A,label:R,move:x}:{to:A,label:R,why:G??I??`Nothing in this app moves a ${p} to ${R}.`})}return u}function Ne(r,e,t,s,n=E(r,t,s)){let a=Ve(r,e,t,s),o=Ke(r,e,t,s);return n.flatMap(p=>{if(p.value===null)return[];let u=a.filter(A=>A.sets?.[s]===p.value);return[{value:p.value,label:p.label,by:u.length>0?"step":o.length>0?"value":"none",acts:u.length>0?u:o}]})}function Ve(r,e,t,s){return e.filter(n=>n.subject!==void 0&&n.derived===void 0&&typeof n.sets?.[s]=="string"&&te(r,n).includes(t))}function Ke(r,e,t,s){let n=r.tryDefinition(t);return n?e.filter(a=>{if(!a.subject||!te(r,a).includes(t)||!ge(a,n).includes(s))return!1;let o=a.input.shape;return o!==void 0&&s in o}).sort((a,o)=>+(a.derived!==void 0)-+(o.derived!==void 0)):[]}var se=(r,e)=>e&&r[e]!==void 0?String(r[e]):"";function Xe(r,e,t){let s=l=>r.tryDefinition(l)?e.nodesOfKind(l).filter(w=>T(r.tryDefinition(l),w)):[],n=s(t.rows),a=s(t.columns),o=new Set(n.map(l=>l.id)),p=new Set(a.map(l=>l.id)),u=e.allEdges(),A=[],R=t.link;if(typeof R=="string"){let l=f=>r.tryDefinition(f)?.edges?.[R]?.to,w=(l(t.columns)??[]).some(f=>f===t.rows||f==="*"),S=(l(t.rows)??[]).some(f=>f===t.columns||f==="*"),k=w||!S;for(let f of u){if(f.kind!==R)continue;let P=k?f.to:f.from,i=k?f.from:f.to;o.has(P)&&p.has(i)&&A.push({rowId:P,columnId:i,via:[]})}}else{let l=new Map(R.path.map(S=>[S,new Map]));for(let S of u){let k=l.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let P=k.get(S.to);P?P.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of R.path){let P=[],i=new Set;for(let $ of k)for(let b of l.get(f).get($.id)??[])i.has(`${$.id}|${b}`)||(i.add(`${$.id}|${b}`),P.push({id:b,via:[...$.via,$.id]}));k=P}for(let f of k){let P=`${f.id}|${S.id}`;!o.has(f.id)||w.has(P)||(w.add(P),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let F=t.groupOrder??[],M=l=>F.indexOf(l)===-1?F.length:F.indexOf(l),x=(l,w)=>w==="label"?K(r.tryDefinition(l.kind),l):l[w],G=U(n,t.sort,x).map(l=>{let w=l;return{node:l,label:K(r.tryDefinition(l.kind),l),group:se(w,t.rowGroup),ref:se(w,t.rowRef)}}).sort((l,w)=>M(l.group)-M(w.group)||(t.sort!==void 0?0:l.ref<w.ref?-1:l.ref>w.ref?1:0)),I=U(a,t.columnSort,x).map(l=>({node:l,label:K(r.tryDefinition(l.kind),l),group:se(l,t.columnGroup)})).sort((l,w)=>l.group<w.group?-1:l.group>w.group?1:t.columnSort!==void 0?0:l.node.id<w.node.id?-1:l.node.id>w.node.id?1:0);return{rows:G,columns:I,cells:A}}function We(r,e,t){let{rows:s,columns:n,cells:a}=Xe(r,e,t),o=(i,$)=>ee(r,i,$),p=i=>ee(r,i,1).replace(/^1 /,""),u=i=>({id:i.id,kind:i.kind,title:K(r.tryDefinition(i.kind),i),parts:[]}),A=i=>{let $=e.getNode(i);if(!$)return null;let b=r.tryDefinition($.kind),C=K(b,$),N=_($,b,{limit:3,said:[C],glance:!0}).map(V=>V.alone.startsWith(V.label)?`${V.label.toLowerCase()}${V.alone.slice(V.label.length)}`:V.alone);return[C,...N].join(", ")},R=typeof t.link=="string"?[]:t.link.path.slice(0,-1).flatMap((i,$,b)=>{let C=ve(r,t.columns,b.slice(0,$+1));return C.ok?[...C.reached]:[]}),F=be(r,t,{rows:s.length,columns:n.length,cells:a.length});if(F)return[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}.`},{t:"text",text:F}];let M=[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}${R.length>0?`, through ${[...new Set(R)].map(i=>o(i,2).replace(/^2 /,"")).join(" and ")}`:""}${n.length>0?`: ${n.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(n.map(i=>[i.node.id,i.label])),G=new Map(n.map((i,$)=>[i.node.id,$])),I=new Map,l=new Map;for(let i of a){let $=I.get(i.rowId);$?$.push(i):I.set(i.rowId,[i]);let b=l.get(i.columnId);b?b.add(i.rowId):l.set(i.columnId,new Set([i.rowId]))}for(let i of s){let b=[...I.get(i.node.id)??[]].sort((C,N)=>G.get(C.columnId)-G.get(N.columnId)).map(C=>{let N=C.via.map(A).filter(V=>V!==null);return`${x.get(C.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:n.map(i=>{let $=l.get(i.node.id)??new Set,b=s.filter(C=>$.has(C.node.id)).map(C=>u(C.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=s.filter(i=>!w.has(i.node.id)),f=n.filter(i=>!S.has(i.node.id)),P=t.rows===t.columns;return k.length>0&&M.push({t:"text",text:`${P?`${k.length} with none across`:`${o(t.rows,k.length)} with no ${p(t.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&M.push({t:"text",text:`${P?`${f.length} with none down`:`${o(t.columns,f.length)} on no ${p(t.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),M}function ie(r,e,t,s={}){let{app:n,blocks:a=t?n?.viewSpecs?.[t.kind]?.[s.slot??"page"]:n?.home}=s;if(!a?.length)return[];let o=s.firstHeading??(t||s.blocks?void 0:1),p=Fe(r,e,t,{...s,money:s.money??n?.brand,firstHeading:o});return t&&!p.node?[]:Ce(typeof a[0]?.t=="string"?a:Pe(a),p)}function Y(r,e,t){let s=!(e.optional||e.control==="boolean"),n=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(o=>Z(z(r.tryDefinition(o),o))).join(" or "):t(e.name).label,a={name:e.name,label:n,required:s};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(o=>t(e.name).option(o))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(r,e.item,t).input}`};case"group":return{...a,input:"group",fields:e.fields.map(o=>Y(r,o,t))};case"variant":return{...a,input:"one of",choices:e.options.map(o=>Z(o.value))};default:return{...a,input:"answer"}}}function Te(r,e,t){let s=Oe(r,e,t),n=r.schema,a=Me(n,t).filter(p=>p.name!==t.subject?.arg&&!s.has(p.name)),o=me(t);return{act:t.name,title:o,submit:o,fields:a.map(p=>Y(n,p,u=>ne(n,t,u)))}}function He(r,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(t=>Y(r,t,s=>ne(r,e.act,s)))}}function Ee(r,e,t){return r.permittedMutations(e).filter(s=>!s.derived&&!s.subject&&(s.creates??[]).includes(t))}function Le(r,e=""){let t=[`${e}Form "${r.title}" (${r.visitor?`the visitor form ${r.visitor}, running `:""}act ${r.act}), button "${r.submit}":`],s=(n,a)=>{for(let o of n){let p=o.choices?`${o.input}: ${o.choices.join(", ")}`:o.kinds?`${o.input} (${o.kinds.join(" or ")})`:o.input,u=o.min!==void 0||o.max!==void 0?`, ${o.min??"\u2026"} to ${o.max??"\u2026"}`:"";t.push(`${a}- ${o.label}${o.required?" *":""} (${o.name}) \u2014 ${p}${u}`),o.fields&&s(o.fields,`${a} `)}};return s(r.fields,`${e} `),r.fields.length===0&&t.push(`${e} (asks nothing)`),t}function Ue(r,e){let t=r.viewSpecs??{};return e.filter(s=>s.cardinality==="one"&&s.replaces==="page"&&(t[s.attach]?.page?.length??0)>0).map(s=>{let n=L(r.schema,s.attach,1);return{at:`views.${s.attach}.page`,says:`The view "${s.name}" replaces ${Ye(n)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Ye=r=>`${/^[aeiou]/i.test(r)?"an":"a"} ${r}`,Je=240,Ze=10,Qe=1160,et=40,_e=640,tt=3,nt=r=>Math.max(1,Math.floor((Math.min(r,Qe)-et+Ze)/(Je+Ze)));function rt(r,e,t,s){let{app:n}=s,a=s.width??1440,o=s.today??r.today()??de(n.brand?.timeZone),p=r.seenBy(e),u=p.schema,A=p.graph,R=Ge(n,s.views?{views:s.views}:{}),F=typeof t=="string"?t.trim():t.slug,M=typeof t=="string"?R.find(c=>c.slug===F||c.title===F||c.address===F):R.find(c=>c.slug===t.slug&&c.kind===t.kind)??t,x=!M&&typeof t=="string"?A.getNode(F):void 0,G=!M&&!x?/^\/?forms\/(.+)$/.exec(F)?.[1]:void 0,I=G!==void 0?Be(n,G):void 0;if(I)return{ok:!0,description:ot(u,I,a)};if(!M&&!x)return{ok:!1,error:`"${F}" is not a place this app has, nor a record this seat can see.`,places:[...R.map(c=>c.slug),...Object.keys(n.forms??{}).map(c=>`forms/${c}`)]};let l=[],w=n.viewSpecs??{},S=nt(a),k=(c,y)=>ie(p,null,c,{app:n,today:o,...y}),f=(c,y,g)=>{let m=u.tryDefinition(c.kind),D=K(m,c);if(y==="name")return{id:c.id,kind:c.kind,title:D,parts:[]};if(w[c.kind]?.[y]){let O=k(c,{slot:y}),[B,...h]=O,j=B?.t==="title"||y==="row"&&B?.t==="headline";return{id:c.id,kind:c.kind,title:j?B.text:D,parts:P(j?h:O,g,`views.${c.kind}.${y}`,` (${c.id})`,j?1:0)}}if(y==="row")return{id:c.id,kind:c.kind,title:D,parts:[]};let d=m?.computed?re(u,A,c):c,W=_(d,m,{limit:3,said:[D],glance:!0,locale:n.brand?.locale,timeZone:n.brand?.timeZone});return{id:c.id,kind:c.kind,title:D,parts:W.map(O=>({t:"text",text:O.alone}))}};function P(c,y,g,m="",D=0){let v=[];return c.forEach((d,W)=>{let O=`${g}.${W+D}`;switch("problem"in d&&d.problem&&l.push({at:`${O}${m}`,says:d.problem}),d.t){case"title":v.push({t:"heading",level:3,text:d.text});return;case"text":v.push({t:"text",text:d.markdown?Ae(d.text):d.runs?it(d.runs):d.text,...d.tone?{tone:d.tone}:{}});return;case"badge":v.push({t:"badge",text:d.text});return;case"field":case"image":v.push({t:"field",label:d.label,text:d.text});return;case"progress":v.push({t:"progress",label:d.label,text:d.text});return;case"group":v.push(...P(d.blocks,y,`${O}.group`,m));return;case"when":v.push(...P(d.blocks,y,`${O}.show`,m));return;case"divider":case"figure":return;case"headline":v.push({t:"heading",level:d.level,text:d.text});return;case"number":v.push({t:"figure",text:d.text,...d.label?{label:d.label}:{}});return;case"list":{if(d.failed){v.push({t:"text",text:"\u2014"});return}if(d.members.length===0){d.empty&&v.push({t:"list",as:d.as,columns:1,groups:[],empty:d.empty});return}let B=y+1,h=B>tt?"name":d.as,j=(d.groups??[{value:null,members:d.members}]).map(H=>({..."heading"in H&&H.heading?{heading:H.heading,count:(d.everyGroup?.find(J=>J.value===H.value)??H).members.length}:{},items:H.members.map(J=>f(J,h,B))}));v.push({t:"list",as:h,columns:h==="card"?S:1,groups:j,...d.more>0?{more:d.more}:{}});return}}}),v}let i=[],$,b,C,N=[];if(x){b="record";let c=u.tryDefinition(x.kind),y=K(c,x);C={slug:x.id,title:y,kind:x.kind,address:$e(u,x.kind,x.id)};let g=w[x.kind]?.page,m=s.views?.find(D=>D.attach===x.kind&&D.cardinality==="one");if(m&&i.push({t:"view",name:m.name,...m.title?{title:m.title}:{},...m.replaces==="page"?{replaces:!0}:{},...m.parts?{parts:m.parts}:{}}),m?.replaces==="page")b=`view:${m.name}`,l.push(...Ue(n,[m]));else{g&&i.push(...P(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let D=c?.computed?re(u,A,x):x;for(let v of je(c,_(D,c,{said:[y],locale:n.brand?.locale,timeZone:n.brand?.timeZone}))){v.title&&i.push({t:"heading",level:2,text:v.title});for(let d of v.fields)i.push({t:"field",label:d.label,text:d.value,...d.long?{long:!0}:{},...d.markdown?{markdown:!0}:{}})}}}else{let c=M;C={slug:c.slug,title:c.title,kind:c.kind,address:c.address};let y=c.lens?ke(n).drawn.find(g=>g.as===c.slug&&(c.kind===null||g.kinds.includes(c.kind))):void 0;if(c.kind!==null&&y?.create!==!1&&c.view===void 0&&(N=Ee(r,e,c.kind).map(g=>Te(r,e,g))),c.view!==void 0&&!y){let g=s.views?.find(m=>m.name===c.view);b=`view:${c.view}`,i.push({t:"view",name:c.view,title:g?.title??c.title,...typeof g?.flows=="boolean"?{flows:g.flows}:{},...g?.parts?{parts:g.parts}:{}})}else if(c.kind===null){let g=n.brand,m=g?.name??n.name,D=we(g)?.light,v=D&&ye(D)?D:void 0;if($={name:m,...g?.subtitle&&g.subtitleDrawn!==!1?{subtitle:g.subtitle}:{},...v?{logo:{alt:g?.logoAlt??m,...he(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},n.home)b="blocks",i=P(k(null,{}),0,"views.home");else{b="derived";let d=r.kindsKeptFrom(e),W=new Set([...n.pages?.hide??[],...d,...r.modules.disabledKinds]),O=xe(u.kinds,n.pages?.order).filter(B=>!W.has(B));i.push({t:"heading",level:1,text:n.name??"Home"});for(let B of O){let h=A.nodesOfKind(B).filter(j=>T(u.tryDefinition(B),j)).length;h>0&&i.push({t:"text",text:`${h} ${L(u,B,h)}`})}}}else if(y?.lens==="blocks")b="lens:blocks",i=P(k(null,{blocks:y.options.blocks??[]}),0,`lenses.${y.index}.options.blocks`);else if(y?.lens==="columns"){b="lens:columns";let g=y.options.bindings??{};for(let m of Object.keys(g)){let D=g[m]?.column;if(!D)continue;let v=E(u,m,D),d=U(A.nodesOfKind(m).filter(h=>T(u.tryDefinition(m),h)),y.options.sort,(h,j)=>j==="label"?K(u.tryDefinition(h.kind),h):h[j]);Object.keys(g).length>1&&i.push({t:"heading",level:2,text:L(u,m,2).replace(/^./,h=>h.toUpperCase())}),i.push({t:"text",text:`${d.length} ${L(u,m,d.length)} in columns by ${q(u.tryDefinition(m),D).toLowerCase()}.`});let W=v.map(h=>({column:h,items:d.filter(j=>X(j,D,v)===h.value).map(j=>f(j,"card",1))})).filter(({column:h,items:j})=>h.value!==null||j.length>0).map(({column:h,items:j})=>({heading:`${h.label} (${j.length})`,items:j}));i.push({t:"list",as:"card",columns:1,groups:W});let O=new Map;for(let h of d)for(let j of oe(r,e,h,D,v))O.set(j.to,(O.get(j.to)??new Set).add(`"${j.title}"`));let B=v.filter(h=>h.value!==null&&O.has(h.value)).map(h=>`to ${h.label} by ${[...O.get(h.value)].join(" or ")}`);i.push({t:"text",text:B.length>0?`Moves: ${B.join("; ")}.`:"Moves: none for this seat."})}}else if(y?.lens==="coverage")b="lens:coverage",i=We(u,A,y.options);else if(y){b=`lens:${y.lens}`;let g=y.kinds.flatMap(m=>A.nodesOfKind(m).filter(D=>T(u.tryDefinition(m),D)));i.push({t:"text",text:`A ${y.lens} of ${g.length} ${y.kinds.map(m=>L(u,m,g.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:g.map(m=>f(m,"name",1))}]})}else{b="derived";let g=A.nodesOfKind(c.kind).filter(m=>T(u.tryDefinition(c.kind),m));i.push({t:"heading",level:1,text:c.title}),g.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${L(u,c.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:g.map(m=>f(m,"row",1))}]})}}let V=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=C.kind===null?st(u,A):[],ce={...$?{masthead:$}:{},...le.length>0?{facts:le}:{},place:C,seat:V,width:a,variant:qe,drawnBy:b,parts:i,...N.length>0?{forms:N}:{},problems:l};return{ok:!0,description:{...ce,text:ae(ce)}}}function ot(r,e,t){let s=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],n={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:t,variant:t<_e?"phone":"wide",drawnBy:"form",parts:s,forms:[He(r,e)],problems:[]};return{...n,text:ae(n)}}function st(r,e){let t=Re(r,e,null),s=n=>Array.isArray(n)?n.map(s).join(", "):n===null?"nothing":typeof n=="boolean"?n?"yes":"no":typeof n=="object"?n.label:String(n);return[...Se(r)].map(([n,a])=>{let o=a.label??Z(n);return Object.hasOwn(t.values,n)?{name:n,label:o,value:s(t.values[n])}:{name:n,label:o,refused:t.refused[n]??"it could not be worked out"}})}function L(r,e,t){let s=r.tryDefinition(e);if(t===1)return s?.noun??e;let n=pe(r,e);return ue(n)}function ae(r){let e=[`${r.place.title} (${r.place.address}) \u2014 as ${r.seat}, ${r.width} wide (${r.variant}).`],t=r.masthead;t&&e.push(`Masthead: ${t.logo?`the logo ("${t.logo.alt}", ${t.logo.drawn==="image"?t.logo.src:"inline SVG"}), `:""}${t.name}${t.subtitle?` \u2014 ${t.subtitle}`:""}`);let s=(n,a)=>{for(let o of n)switch(o.t){case"heading":e.push(`${a}${"#".repeat(o.level)} ${o.text}`);break;case"text":e.push(`${a}${o.text}`);break;case"badge":e.push(`${a}[${o.text}]`);break;case"field":case"progress":e.push(`${a}${o.label}: ${o.text}`);break;case"figure":e.push(`${a}${o.text}${o.label?` \u2014 ${o.label}`:""}`);break;case"list":if(o.groups.length===0){o.empty&&e.push(`${a}(${o.empty})`);break}for(let p of o.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let u of p.items)e.push(`${a}${p.heading?" ":""}- ${u.title}`),s(u.parts,`${a}${p.heading?" ":" "}`)}o.as==="card"&&o.columns>1&&e.push(`${a}(cards, ${o.columns} across)`),o.more&&e.push(`${a}and ${o.more} more`);break;case"view":e.push(`${a}[the view "${o.title??o.name}"${o.replaces?", in place of the page":""}${o.flows===!0?", flowing with the page":o.flows===!1?", in a frame of its own":""}]`),o.parts&&s(o.parts,`${a} `);break}};s(r.parts,"");for(let n of r.forms??[])e.push(...Le(n));if(r.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let n of r.facts)e.push(`- ${n.label} (${n.name}): ${n.value??`not worked out \u2014 ${n.refused}`}`)}if(r.problems.length>0){e.push("Problems:");for(let n of r.problems)e.push(`- ${n.at}: ${n.says}`)}return e.join(`
1
+ import{a as Ge}from"./chunk.CSA6SWTI.js";import{c as Me,d as Oe,f as Be}from"./chunk.IYVBJDR7.js";import{e as Pe,f as Ce,j as Re,k as re,l as Fe}from"./chunk.VTCPA4V4.js";import{f as Se}from"./chunk.PEA4D66Y.js";import{d as _,e as je,k as ne}from"./chunk.S2ATSY6P.js";import{b as De,e as Ae}from"./chunk.72Q4R7N6.js";import{$ as ue,$c as ve,Ac as ye,Ad as ke,C as Q,Cc as we,Gb as fe,Hc as U,I as de,Ic as be,Id as xe,Yb as te,Zb as ge,ca as T,da as K,ea as me,fa as Z,ga as ee,ha as pe,ka as q,ma as z,qd as $e,yc as he}from"./chunk.6W2DUW5S.js";function ze(r,e,t){let s=r.tryDefinition(e)?.fields.shape,n=Q(s?.[t]),a=!1,o=!1;for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)(n.type==="optional"||n.type==="nullable")&&(a=!0),(n.type==="default"||n.type==="prefault")&&(o=!0),n=Q(n.innerType);if(n?.type!=="enum")return;let p=(n.entries?Object.values(n.entries):n.values??[]).filter(u=>typeof u=="string");return p.length>0?{values:p,empty:a&&!o}:void 0}function E(r,e,t){let s=ze(r,e,t);if(!s)return[];let n=r.tryDefinition(e),a=s.values.map(o=>({value:o,label:De(n,t,o)}));return s.empty&&a.push({value:null,label:`No ${q(n,t).toLowerCase()}`}),a}function X(r,e,t){let s=r[e];return typeof s=="string"&&t.some(n=>n.value===s)?s:null}function oe(r,e,t,s,n=E(r.schema,t.kind,s)){return Ie(r,e,t,s,n).flatMap(a=>a.move?[a.move]:[])}function Ie(r,e,t,s,n=E(r.schema,t.kind,s)){let a=Ne(r.schema,r.allMutations(),t.kind,s,n),o=X(t,s,n),p=z(r.schema.tryDefinition(t.kind),t.kind),u=[];for(let{value:A,label:R,by:F,acts:M}of a){if(A===o)continue;let x,G,I;for(let l of M){let w=F==="step"?{[l.subject.arg]:t.id}:{[l.subject.arg]:t.id,[s]:A},S={name:l.name,args:w};if(!l.input.safeParse(w).success){I??=`${l.title??l.name} asks for more than the ${p} itself.`;continue}let k=r.permits(S,e);if(!k.ok){G??=k.refusal?.message??`You may not ${l.title??l.name}.`;continue}try{fe(r.graph,l,w)}catch(f){G??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:l.title??l.name};break}u.push(x?{to:A,label:R,move:x}:{to:A,label:R,why:G??I??`Nothing in this app moves a ${p} to ${R}.`})}return u}function Ne(r,e,t,s,n=E(r,t,s)){let a=Ve(r,e,t,s),o=Ke(r,e,t,s);return n.flatMap(p=>{if(p.value===null)return[];let u=a.filter(A=>A.sets?.[s]===p.value);return[{value:p.value,label:p.label,by:u.length>0?"step":o.length>0?"value":"none",acts:u.length>0?u:o}]})}function Ve(r,e,t,s){return e.filter(n=>n.subject!==void 0&&n.derived===void 0&&typeof n.sets?.[s]=="string"&&te(r,n).includes(t))}function Ke(r,e,t,s){let n=r.tryDefinition(t);return n?e.filter(a=>{if(!a.subject||!te(r,a).includes(t)||!ge(a,n).includes(s))return!1;let o=a.input.shape;return o!==void 0&&s in o}).sort((a,o)=>+(a.derived!==void 0)-+(o.derived!==void 0)):[]}var se=(r,e)=>e&&r[e]!==void 0?String(r[e]):"";function Xe(r,e,t){let s=l=>r.tryDefinition(l)?e.nodesOfKind(l).filter(w=>T(r.tryDefinition(l),w)):[],n=s(t.rows),a=s(t.columns),o=new Set(n.map(l=>l.id)),p=new Set(a.map(l=>l.id)),u=e.allEdges(),A=[],R=t.link;if(typeof R=="string"){let l=f=>r.tryDefinition(f)?.edges?.[R]?.to,w=(l(t.columns)??[]).some(f=>f===t.rows||f==="*"),S=(l(t.rows)??[]).some(f=>f===t.columns||f==="*"),k=w||!S;for(let f of u){if(f.kind!==R)continue;let P=k?f.to:f.from,i=k?f.from:f.to;o.has(P)&&p.has(i)&&A.push({rowId:P,columnId:i,via:[]})}}else{let l=new Map(R.path.map(S=>[S,new Map]));for(let S of u){let k=l.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let P=k.get(S.to);P?P.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of R.path){let P=[],i=new Set;for(let $ of k)for(let b of l.get(f).get($.id)??[])i.has(`${$.id}|${b}`)||(i.add(`${$.id}|${b}`),P.push({id:b,via:[...$.via,$.id]}));k=P}for(let f of k){let P=`${f.id}|${S.id}`;!o.has(f.id)||w.has(P)||(w.add(P),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let F=t.groupOrder??[],M=l=>F.indexOf(l)===-1?F.length:F.indexOf(l),x=(l,w)=>w==="label"?K(r.tryDefinition(l.kind),l):l[w],G=U(n,t.sort,x).map(l=>{let w=l;return{node:l,label:K(r.tryDefinition(l.kind),l),group:se(w,t.rowGroup),ref:se(w,t.rowRef)}}).sort((l,w)=>M(l.group)-M(w.group)||(t.sort!==void 0?0:l.ref<w.ref?-1:l.ref>w.ref?1:0)),I=U(a,t.columnSort,x).map(l=>({node:l,label:K(r.tryDefinition(l.kind),l),group:se(l,t.columnGroup)})).sort((l,w)=>l.group<w.group?-1:l.group>w.group?1:t.columnSort!==void 0?0:l.node.id<w.node.id?-1:l.node.id>w.node.id?1:0);return{rows:G,columns:I,cells:A}}function We(r,e,t){let{rows:s,columns:n,cells:a}=Xe(r,e,t),o=(i,$)=>ee(r,i,$),p=i=>ee(r,i,1).replace(/^1 /,""),u=i=>({id:i.id,kind:i.kind,title:K(r.tryDefinition(i.kind),i),parts:[]}),A=i=>{let $=e.getNode(i);if(!$)return null;let b=r.tryDefinition($.kind),C=K(b,$),N=_($,b,{limit:3,said:[C],glance:!0}).map(V=>V.alone.startsWith(V.label)?`${V.label.toLowerCase()}${V.alone.slice(V.label.length)}`:V.alone);return[C,...N].join(", ")},R=typeof t.link=="string"?[]:t.link.path.slice(0,-1).flatMap((i,$,b)=>{let C=ve(r,t.columns,b.slice(0,$+1));return C.ok?[...C.reached]:[]}),F=be(r,t,{rows:s.length,columns:n.length,cells:a.length});if(F)return[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}.`},{t:"text",text:F}];let M=[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}${R.length>0?`, through ${[...new Set(R)].map(i=>o(i,2).replace(/^2 /,"")).join(" and ")}`:""}${n.length>0?`: ${n.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(n.map(i=>[i.node.id,i.label])),G=new Map(n.map((i,$)=>[i.node.id,$])),I=new Map,l=new Map;for(let i of a){let $=I.get(i.rowId);$?$.push(i):I.set(i.rowId,[i]);let b=l.get(i.columnId);b?b.add(i.rowId):l.set(i.columnId,new Set([i.rowId]))}for(let i of s){let b=[...I.get(i.node.id)??[]].sort((C,N)=>G.get(C.columnId)-G.get(N.columnId)).map(C=>{let N=C.via.map(A).filter(V=>V!==null);return`${x.get(C.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:n.map(i=>{let $=l.get(i.node.id)??new Set,b=s.filter(C=>$.has(C.node.id)).map(C=>u(C.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=s.filter(i=>!w.has(i.node.id)),f=n.filter(i=>!S.has(i.node.id)),P=t.rows===t.columns;return k.length>0&&M.push({t:"text",text:`${P?`${k.length} with none across`:`${o(t.rows,k.length)} with no ${p(t.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&M.push({t:"text",text:`${P?`${f.length} with none down`:`${o(t.columns,f.length)} on no ${p(t.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),M}function ie(r,e,t,s={}){let{app:n,blocks:a=t?n?.viewSpecs?.[t.kind]?.[s.slot??"page"]:n?.home}=s;if(!a?.length)return[];let o=s.firstHeading??(t||s.blocks?void 0:1),p=Fe(r,e,t,{...s,money:s.money??n?.brand,firstHeading:o});return t&&!p.node?[]:Ce(typeof a[0]?.t=="string"?a:Pe(a),p)}function Y(r,e,t){let s=!(e.optional||e.control==="boolean"),n=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(o=>Z(z(r.tryDefinition(o),o))).join(" or "):t(e.name).label,a={name:e.name,label:n,required:s};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(o=>t(e.name).option(o))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(r,e.item,t).input}`};case"group":return{...a,input:"group",fields:e.fields.map(o=>Y(r,o,t))};case"variant":return{...a,input:"one of",choices:e.options.map(o=>Z(o.value))};default:return{...a,input:"answer"}}}function Te(r,e,t){let s=Oe(r,e,t),n=r.schema,a=Me(n,t).filter(p=>p.name!==t.subject?.arg&&!s.has(p.name)),o=me(t);return{act:t.name,title:o,submit:o,fields:a.map(p=>Y(n,p,u=>ne(n,t,u)))}}function He(r,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(t=>Y(r,t,s=>ne(r,e.act,s)))}}function Ee(r,e,t){return r.permittedMutations(e).filter(s=>!s.derived&&!s.subject&&(s.creates??[]).includes(t))}function Le(r,e=""){let t=[`${e}Form "${r.title}" (${r.visitor?`the visitor form ${r.visitor}, running `:""}act ${r.act}), button "${r.submit}":`],s=(n,a)=>{for(let o of n){let p=o.choices?`${o.input}: ${o.choices.join(", ")}`:o.kinds?`${o.input} (${o.kinds.join(" or ")})`:o.input,u=o.min!==void 0||o.max!==void 0?`, ${o.min??"\u2026"} to ${o.max??"\u2026"}`:"";t.push(`${a}- ${o.label}${o.required?" *":""} (${o.name}) \u2014 ${p}${u}`),o.fields&&s(o.fields,`${a} `)}};return s(r.fields,`${e} `),r.fields.length===0&&t.push(`${e} (asks nothing)`),t}function Ue(r,e){let t=r.viewSpecs??{};return e.filter(s=>s.cardinality==="one"&&s.replaces==="page"&&(t[s.attach]?.page?.length??0)>0).map(s=>{let n=L(r.schema,s.attach,1);return{at:`views.${s.attach}.page`,says:`The view "${s.name}" replaces ${Ye(n)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Ye=r=>`${/^[aeiou]/i.test(r)?"an":"a"} ${r}`,Je=240,Ze=10,Qe=1160,et=40,_e=640,tt=3,nt=r=>Math.max(1,Math.floor((Math.min(r,Qe)-et+Ze)/(Je+Ze)));function rt(r,e,t,s){let{app:n}=s,a=s.width??1440,o=s.today??r.today()??de(n.brand?.timeZone),p=r.seenBy(e),u=p.schema,A=p.graph,R=Ge(n,s.views?{views:s.views}:{}),F=typeof t=="string"?t.trim():t.slug,M=typeof t=="string"?R.find(c=>c.slug===F||c.title===F||c.address===F):R.find(c=>c.slug===t.slug&&c.kind===t.kind)??t,x=!M&&typeof t=="string"?A.getNode(F):void 0,G=!M&&!x?/^\/?forms\/(.+)$/.exec(F)?.[1]:void 0,I=G!==void 0?Be(n,G):void 0;if(I)return{ok:!0,description:ot(u,I,a)};if(!M&&!x)return{ok:!1,error:`"${F}" is not a place this app has, nor a record this seat can see.`,places:[...R.map(c=>c.slug),...Object.keys(n.forms??{}).map(c=>`forms/${c}`)]};let l=[],w=n.viewSpecs??{},S=nt(a),k=(c,y)=>ie(p,null,c,{app:n,today:o,...y}),f=(c,y,g)=>{let m=u.tryDefinition(c.kind),D=K(m,c);if(y==="name")return{id:c.id,kind:c.kind,title:D,parts:[]};if(w[c.kind]?.[y]){let O=k(c,{slot:y}),[B,...h]=O,j=B?.t==="title"||y==="row"&&B?.t==="headline";return{id:c.id,kind:c.kind,title:j?B.text:D,parts:P(j?h:O,g,`views.${c.kind}.${y}`,` (${c.id})`,j?1:0)}}if(y==="row")return{id:c.id,kind:c.kind,title:D,parts:[]};let d=m?.computed?re(u,A,c):c,W=_(d,m,{limit:3,said:[D],glance:!0,locale:n.brand?.locale,timeZone:n.brand?.timeZone});return{id:c.id,kind:c.kind,title:D,parts:W.map(O=>({t:"text",text:O.alone}))}};function P(c,y,g,m="",D=0){let v=[];return c.forEach((d,W)=>{let O=`${g}.${W+D}`;switch("problem"in d&&d.problem&&l.push({at:`${O}${m}`,says:d.problem}),d.t){case"title":v.push({t:"heading",level:3,text:d.text});return;case"text":v.push({t:"text",text:d.markdown?Ae(d.text):d.runs?it(d.runs):d.text,...d.tone?{tone:d.tone}:{}});return;case"badge":v.push({t:"badge",text:d.text});return;case"field":case"image":v.push({t:"field",label:d.label,text:d.text});return;case"progress":v.push({t:"progress",label:d.label,text:d.text});return;case"group":v.push(...P(d.blocks,y,`${O}.group`,m));return;case"when":v.push(...P(d.blocks,y,`${O}.show`,m));return;case"divider":case"figure":return;case"headline":v.push({t:"heading",level:d.level,text:d.text});return;case"number":v.push({t:"figure",text:d.text,...d.label?{label:d.label}:{}});return;case"list":{if(d.failed){v.push({t:"text",text:"\u2014"});return}if(d.members.length===0){d.empty&&v.push({t:"list",as:d.as,columns:1,groups:[],empty:d.empty});return}let B=y+1,h=B>tt?"name":d.as,j=(d.groups??[{value:null,members:d.members}]).map(H=>({..."heading"in H&&H.heading?{heading:H.heading,count:(d.everyGroup?.find(J=>J.value===H.value)??H).members.length}:{},items:H.members.map(J=>f(J,h,B))}));v.push({t:"list",as:h,columns:h==="card"?S:1,groups:j,...d.more>0?{more:d.more}:{}});return}}}),v}let i=[],$,b,C,N=[];if(x){b="record";let c=u.tryDefinition(x.kind),y=K(c,x);C={slug:x.id,title:y,kind:x.kind,address:$e(u,x.kind,x.id)};let g=w[x.kind]?.page,m=s.views?.find(D=>D.attach===x.kind&&D.cardinality==="one");if(m&&i.push({t:"view",name:m.name,...m.title?{title:m.title}:{},...m.replaces==="page"?{replaces:!0}:{},...m.parts?{parts:m.parts}:{}}),m?.replaces==="page")b=`view:${m.name}`,l.push(...Ue(n,[m]));else{g&&i.push(...P(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let D=c?.computed?re(u,A,x):x;for(let v of je(c,_(D,c,{said:[y],locale:n.brand?.locale,timeZone:n.brand?.timeZone}))){v.title&&i.push({t:"heading",level:2,text:v.title});for(let d of v.fields)i.push({t:"field",label:d.label,text:d.value,...d.long?{long:!0}:{},...d.markdown?{markdown:!0}:{}})}}}else{let c=M;C={slug:c.slug,title:c.title,kind:c.kind,address:c.address};let y=c.lens?ke(n).drawn.find(g=>g.as===c.slug&&(c.kind===null||g.kinds.includes(c.kind))):void 0;if(c.kind!==null&&y?.create!==!1&&c.view===void 0&&(N=Ee(r,e,c.kind).map(g=>Te(r,e,g))),c.view!==void 0&&!y){let g=s.views?.find(m=>m.name===c.view);b=`view:${c.view}`,i.push({t:"view",name:c.view,title:g?.title??c.title,...typeof g?.flows=="boolean"?{flows:g.flows}:{},...g?.parts?{parts:g.parts}:{}})}else if(c.kind===null){let g=n.brand,m=g?.name??n.name,D=we(g)?.light,v=D&&ye(D)?D:void 0;if($={name:m,...g?.subtitle&&g.subtitleDrawn!==!1?{subtitle:g.subtitle}:{},...v?{logo:{alt:g?.logoAlt??m,...he(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},n.home)b="blocks",i=P(k(null,{}),0,"views.home");else{b="derived";let d=r.kindsKeptFrom(e),W=new Set([...n.pages?.hide??[],...d,...r.modules.disabledKinds]),O=xe(u.kinds,n.pages?.order).filter(B=>!W.has(B));i.push({t:"heading",level:1,text:n.name??"Home"});for(let B of O){let h=A.nodesOfKind(B).filter(j=>T(u.tryDefinition(B),j)).length;h>0&&i.push({t:"text",text:`${h} ${L(u,B,h)}`})}}}else if(y?.lens==="blocks")b="lens:blocks",i=P(k(null,{blocks:y.options.blocks??[]}),0,`lenses.${y.index}.options.blocks`);else if(y?.lens==="columns"){b="lens:columns";let g=y.options.bindings??{};for(let m of Object.keys(g)){let D=g[m]?.column;if(!D)continue;let v=E(u,m,D),d=U(A.nodesOfKind(m).filter(h=>T(u.tryDefinition(m),h)),y.options.sort,(h,j)=>j==="label"?K(u.tryDefinition(h.kind),h):h[j]);Object.keys(g).length>1&&i.push({t:"heading",level:2,text:L(u,m,2).replace(/^./,h=>h.toUpperCase())}),i.push({t:"text",text:`${d.length} ${L(u,m,d.length)} in columns by ${q(u.tryDefinition(m),D).toLowerCase()}.`});let W=v.map(h=>({column:h,items:d.filter(j=>X(j,D,v)===h.value).map(j=>f(j,"card",1))})).filter(({column:h,items:j})=>h.value!==null||j.length>0).map(({column:h,items:j})=>({heading:`${h.label} (${j.length})`,items:j}));i.push({t:"list",as:"card",columns:1,groups:W});let O=new Map;for(let h of d)for(let j of oe(r,e,h,D,v))O.set(j.to,(O.get(j.to)??new Set).add(`"${j.title}"`));let B=v.filter(h=>h.value!==null&&O.has(h.value)).map(h=>`to ${h.label} by ${[...O.get(h.value)].join(" or ")}`);i.push({t:"text",text:B.length>0?`Moves: ${B.join("; ")}.`:"Moves: none for this seat."})}}else if(y?.lens==="coverage")b="lens:coverage",i=We(u,A,y.options);else if(y){b=`lens:${y.lens}`;let g=y.kinds.flatMap(m=>A.nodesOfKind(m).filter(D=>T(u.tryDefinition(m),D)));i.push({t:"text",text:`A ${y.lens} of ${g.length} ${y.kinds.map(m=>L(u,m,g.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:g.map(m=>f(m,"name",1))}]})}else{b="derived";let g=A.nodesOfKind(c.kind).filter(m=>T(u.tryDefinition(c.kind),m));i.push({t:"heading",level:1,text:c.title}),g.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${L(u,c.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:g.map(m=>f(m,"row",1))}]})}}let V=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=C.kind===null?st(u,A):[],ce={...$?{masthead:$}:{},...le.length>0?{facts:le}:{},place:C,seat:V,width:a,variant:qe,drawnBy:b,parts:i,...N.length>0?{forms:N}:{},problems:l};return{ok:!0,description:{...ce,text:ae(ce)}}}function ot(r,e,t){let s=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],n={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:t,variant:t<_e?"phone":"wide",drawnBy:"form",parts:s,forms:[He(r,e)],problems:[]};return{...n,text:ae(n)}}function st(r,e){let t=Re(r,e,null),s=n=>Array.isArray(n)?n.map(s).join(", "):n===null?"nothing":typeof n=="boolean"?n?"yes":"no":typeof n=="object"?n.label:String(n);return[...Se(r)].map(([n,a])=>{let o=a.label??Z(n);return Object.hasOwn(t.values,n)?{name:n,label:o,value:s(t.values[n])}:{name:n,label:o,refused:t.refused[n]??"it could not be worked out"}})}function L(r,e,t){let s=r.tryDefinition(e);if(t===1)return s?.noun??e;let n=pe(r,e);return ue(n)}function ae(r){let e=[`${r.place.title} (${r.place.address}) \u2014 as ${r.seat}, ${r.width} wide (${r.variant}).`],t=r.masthead;t&&e.push(`Masthead: ${t.logo?`the logo ("${t.logo.alt}", ${t.logo.drawn==="image"?t.logo.src:"inline SVG"}), `:""}${t.name}${t.subtitle?` \u2014 ${t.subtitle}`:""}`);let s=(n,a)=>{for(let o of n)switch(o.t){case"heading":e.push(`${a}${"#".repeat(o.level)} ${o.text}`);break;case"text":e.push(`${a}${o.text}`);break;case"badge":e.push(`${a}[${o.text}]`);break;case"field":case"progress":e.push(`${a}${o.label}: ${o.text}`);break;case"figure":e.push(`${a}${o.text}${o.label?` \u2014 ${o.label}`:""}`);break;case"list":if(o.groups.length===0){o.empty&&e.push(`${a}(${o.empty})`);break}for(let p of o.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let u of p.items)e.push(`${a}${p.heading?" ":""}- ${u.title}`),s(u.parts,`${a}${p.heading?" ":" "}`)}o.as==="card"&&o.columns>1&&e.push(`${a}(cards, ${o.columns} across)`),o.more&&e.push(`${a}and ${o.more} more`);break;case"view":e.push(`${a}[the view "${o.title??o.name}"${o.replaces?", in place of the page":""}${o.flows===!0?", flowing with the page":o.flows===!1?", in a frame of its own":""}]`),o.parts&&s(o.parts,`${a} `);break}};s(r.parts,"");for(let n of r.forms??[])e.push(...Le(n));if(r.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let n of r.facts)e.push(`- ${n.label} (${n.name}): ${n.value??`not worked out \u2014 ${n.refused}`}`)}if(r.problems.length>0){e.push("Problems:");for(let n of r.problems)e.push(`- ${n.at}: ${n.says}`)}return e.join(`
2
2
  `)}function it(r){return r.map((e,t)=>(t===0?"":e.field===void 0&&r[t-1].field===void 0?" \xB7 ":" ")+e.text).join("")}export{E as a,X as b,oe as c,Ie as d,Ne as e,Ve as f,Ke as g,ie as h,Ue as i,rt as j,ae as k};
@@ -0,0 +1 @@
1
+ import{a as C,e as L,n as H,o as R,p as k}from"./chunk.ZYYM52N5.js";import"./chunk.4DCPB67O.js";import"./chunk.Y4VOCJ7R.js";import"./chunk.3FUFVVR4.js";import"./chunk.XOZU4OFA.js";import"./chunk.IYVBJDR7.js";import{a as S}from"./chunk.OZYZBRWO.js";import"./chunk.TI4OSTQV.js";import"./chunk.FGJM4LJO.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{G as T,Sa as E,T as b}from"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import{Oc as x}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as g}from"./chunk.AJZBJBMO.js";var t=g(T(),1);var c=g(b(),1);function N(n){if(!n||n.interaction.outcome==="failed")return null;let s=n.offers[0],o=s?n.interaction.offered.find(i=>i.id===s.id)?.confidence:void 0;return s&&o!==void 0&&o>=.6?{offer:s,confidence:o}:null}function j({rest:n,hold:s,leave:o}){let i=S(),u=(0,t.useMemo)(()=>C(n.target,e=>i.store.graph.has(e)),[n.target,i.store]),l=u.on==="record"&&L(i.ai)!==void 0,m=l?H(i,u):void 0,p=JSON.stringify(u),[y,I]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!l||m!==void 0)return;let e=!0;return R(i,u).then(r=>{e&&I({key:p,result:r})}),()=>{e=!1}},[p,l]);let w=m??(y?.key===p?y.result:void 0),f=l?N(w):null,v=f?.offer.id??null,h=(0,t.useRef)(null);if((0,t.useEffect)(()=>{if(v===null)return;let e=r=>{r.target instanceof Node&&h.current?.contains(r.target)||o(!0)};return document.addEventListener("pointerdown",e,{capture:!0,passive:!0}),document.addEventListener("contextmenu",e,{capture:!0,passive:!0}),addEventListener("scroll",e,{capture:!0,passive:!0}),addEventListener("resize",e,{passive:!0}),()=>{document.removeEventListener("pointerdown",e,{capture:!0}),document.removeEventListener("contextmenu",e,{capture:!0}),removeEventListener("scroll",e,{capture:!0}),removeEventListener("resize",e)}},[v,o]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!E(e))try{e.showPopover()}catch{}let r=n.element.getBoundingClientRect(),d=e.getBoundingClientRect(),O=r.top-d.height-4>=4?r.top-d.height-4:Math.min(innerHeight-d.height-4,r.top+4),A=Math.max(4,Math.min(innerWidth-d.width-4,r.right-d.width));e.style.top=`${Math.round(O)}px`,e.style.left=`${Math.round(A)}px`},[v,n.element]),!f)return null;let{offer:a,confidence:P}=f,M=a.type==="panel"?"a panel":a.type==="place"?"go there":a.type==="record"?"open it":"suggested";return(0,c.jsxs)("button",{ref:h,type:"button",popover:"manual","data-testid":"hover-chip","data-ai-offer":a.id,"data-ai-offer-type":a.type,"data-graview-overlay":"","data-graview-popover":"","aria-label":`Suggested by AI: ${a.label}`,title:`Suggested by AI, ${Math.round(P*100)}% sure`,onPointerEnter:s,onPointerLeave:()=>o(),onClick:()=>{n.element.closest("[tabindex], a[href], button")?.focus({preventScroll:!0}),o(!0),k(i,w,a)},style:$,children:[(0,c.jsxs)("span",{"aria-hidden":"true",style:{color:"var(--graview-accent)"},children:["\u2726"," "]}),a.label,(0,c.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",M]})]})}var $={position:"fixed",inset:"auto",top:0,left:0,margin:0,zIndex:x("toast"),boxSizing:"border-box",width:"max-content",maxWidth:"min(320px, calc(100vw - 8px))",height:"auto",minHeight:24,padding:"2px 10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",font:"inherit",fontSize:"0.75rem",cursor:"pointer"};export{j as HoverChip};
@@ -0,0 +1 @@
1
+ import{Ad as f,Ed as b,Fd as S,Gd as P,Jd as A,Kd as L,ia as u,ld as w,md as v,od as $,pd as c,rd as k,sd as x}from"./chunk.6W2DUW5S.js";function T(s){if(!(s.attach==="home"||s.cardinality==="one"||!s.title))return{kind:s.attach,title:s.title,as:$(s.title),name:s.name,lens:"view",...s.hidden?{hidden:!0}:{}}}function H(s,r=[]){let a=[];for(let n of f(s).drawn)for(let i of n.kinds)a.push({kind:i,title:n.title,as:n.as,...n.across?{across:n.across}:{},...n.kinds.length>1?{over:n.kinds}:{},...n.hidden?{hidden:!0}:{}});for(let n of[...s.views?.places?.()??[],...r.flatMap(i=>T(i)??[])])a.some(i=>i.kind===n.kind&&i.as===n.as)||a.push(n);return a}function U(s,r={}){return V(s.schema,H(s,r.views),{...s.pages?{pages:s.pages}:{},lenses:f(s).drawn,home:(s.home?.length??0)>0})}function V(s,r,a={}){let{pages:n}=a,i=s.kinds,d=r.filter(e=>i.includes(e.kind)),o=L(n?.first,s,d),N=new Set(n?.hide??[]),p=A(i,n?.order,d),m=p.flatMap(e=>e.view?[]:[e.kind]),O=p.flatMap(e=>e.view?[e.view]:[]),h=[{slug:"home",title:"Home",kind:null,cardinality:"many",address:"/",stop:"#",...o?.to==="home"||o===void 0&&a.home?{first:!0}:{}},{slug:b,title:P(n),kind:null,cardinality:"many",address:S,stop:"#"}],E=v([...d].sort((e,t)=>m.indexOf(e.kind)-m.indexOf(t.kind))),g=e=>{let t=a.lenses?.find(l=>l.as===e.as&&l.kinds.includes(e.kind)),y=x(e,d);return{slug:e.as,title:e.title,kind:e.kind,...e.over?{over:e.over.filter(l=>i.includes(l))}:{},cardinality:"many",address:k(e.as,y?c(s,e.kind).slice(1):void 0),stop:y?`#focus=aggregate:${e.kind}&in.view=${encodeURIComponent(e.as)}`:`#view=${encodeURIComponent(e.as)}`,...t?{lens:t.lens}:{},...e.name!==void 0?{view:e.name}:{},...e.hidden?{hidden:!0}:{},...o?.to==="place"&&o.place.as===e.as&&(o.place.kind===e.kind||e.over?.includes(o.place.kind))?{first:!0}:{}}};for(let e of E)O.some(t=>w(t,e))||h.push(g(e));for(let e of p){if(e.view){h.push(g(e.view));continue}let t=e.kind;h.push({slug:c(s,t).slice(1),title:u(s,t),kind:t,cardinality:"many",address:c(s,t),stop:`#focus=aggregate:${t}`,...N.has(t)?{hidden:!0}:{},...o?.to==="kind"&&o.kind===t?{first:!0}:{}})}return h}export{U as a,V as b};
@@ -1,4 +1,4 @@
1
- import{Nc as e}from"./chunk.P4CLT32V.js";var i=`
1
+ import{Nc as e}from"./chunk.6W2DUW5S.js";var i=`
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}
@@ -1,4 +1,4 @@
1
- import"./chunk.GYTVL6GR.js";import{T}from"./chunk.TMYGLXR6.js";import"./chunk.SDO3U72B.js";import"./chunk.P4CLT32V.js";import"./chunk.SLBWPVIY.js";import{b as A}from"./chunk.AJZBJBMO.js";var F=/^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)/,D=/^ {0,3}(#{1,6})(?:[ \t]+|$)/,R=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,v=/^ {0,3}>[ \t]?/,_=/^([ \t]*)([-*+]|(\d{1,9})[.)])(?:[ \t]+|$)/,K=/^\|?\s*:?-+:?\s*(?:\|\s*:?-+:?\s*)+\|?$|^\|\s*:?-+:?\s*\|$/,w=/^[ \t]*$/;function O(t){let n=F.exec(t);if(!(!n||n[1][0]==="`"&&t.indexOf("`",n[0].length)>=0))return{mark:n[1],lang:n[2]}}function U(t,n){let r=t.trim().slice(n).trim(),e=r.length;for(;e>0&&r[e-1]==="#";)e--;return(e===0||r[e-1]===" "||r[e-1]===" ")&&(r=r.slice(0,e).trim()),r}var $=t=>O(t)!==void 0||D.test(t)||R.test(t)||v.test(t)||_.test(t),b=t=>[...t].reduce((n,r)=>r===" "?n+4-n%4:n+1,0);function E(t){let n=t.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,""),r=[],e="",l=!1;for(let c=0;c<n.length;c++){let h=n[c];h==="\\"&&n[c+1]==="|"?(e+="|",c++):h==="`"?(l=!l,e+=h):h==="|"&&!l?(r.push(e.trim()),e=""):e+=h}return r.push(e.trim()),r}function W(t){return B(t.replace(/\r\n?/g,`
1
+ import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{T}from"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as A}from"./chunk.AJZBJBMO.js";var F=/^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)/,D=/^ {0,3}(#{1,6})(?:[ \t]+|$)/,R=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,v=/^ {0,3}>[ \t]?/,_=/^([ \t]*)([-*+]|(\d{1,9})[.)])(?:[ \t]+|$)/,K=/^\|?\s*:?-+:?\s*(?:\|\s*:?-+:?\s*)+\|?$|^\|\s*:?-+:?\s*\|$/,w=/^[ \t]*$/;function O(t){let n=F.exec(t);if(!(!n||n[1][0]==="`"&&t.indexOf("`",n[0].length)>=0))return{mark:n[1],lang:n[2]}}function U(t,n){let r=t.trim().slice(n).trim(),e=r.length;for(;e>0&&r[e-1]==="#";)e--;return(e===0||r[e-1]===" "||r[e-1]===" ")&&(r=r.slice(0,e).trim()),r}var $=t=>O(t)!==void 0||D.test(t)||R.test(t)||v.test(t)||_.test(t),b=t=>[...t].reduce((n,r)=>r===" "?n+4-n%4:n+1,0);function E(t){let n=t.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,""),r=[],e="",l=!1;for(let c=0;c<n.length;c++){let h=n[c];h==="\\"&&n[c+1]==="|"?(e+="|",c++):h==="`"?(l=!l,e+=h):h==="|"&&!l?(r.push(e.trim()),e=""):e+=h}return r.push(e.trim()),r}function W(t){return B(t.replace(/\r\n?/g,`
2
2
  `).replace(/\0/g,"\uFFFD").split(`
3
3
  `),0)}function B(t,n){let r=[],e=0;for(;e<t.length;){let l=t[e];if(w.test(l)){e++;continue}let c=O(l);if(c){let o=new RegExp(`^ {0,3}${c.mark[0]==="`"?"`":"~"}{${c.mark.length},}[ \\t]*$`),a=[];for(e++;e<t.length&&!o.test(t[e]);)a.push(t[e++]);e++,r.push({t:"code",text:a.join(`
4
4
  `),...c.lang?{lang:c.lang}:{}});continue}let h=D.exec(l);if(h){r.push({t:"heading",level:h[1].length,children:k(U(l,h[1].length),0)}),e++;continue}if(R.test(l)){r.push({t:"rule"}),e++;continue}if(v.test(l)){let o=[];for(;e<t.length&&(v.test(t[e])||o.length>0&&!w.test(t[e])&&!$(t[e])&&!w.test(o[o.length-1]));)o.push(t[e++].replace(v,""));r.push(n<8?{t:"quote",blocks:B(o,n+1)}:{t:"p",children:k(o.join(`
@@ -0,0 +1 @@
1
+ import{a as b,b as c,c as d,d as e,e as f}from"./chunk.P2W727C7.js";import"./chunk.XXCT6DLX.js";import"./chunk.K7WME4P4.js";import"./chunk.PEA4D66Y.js";import"./chunk.TRPPN2GD.js";import{Ab as a}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{a as ActRefusal,e as compileDocumentWithoutCheck,d as effectsOf,f as inDocumentWords,c as kindShapes,b as readDocument};
@@ -1,4 +1,4 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as G,b as J}from"./chunk.MN6WHE4B.js";import"./chunk.W2DKFQ6R.js";import{a as K}from"./chunk.FU4YSVWX.js";import"./chunk.TNL2BVCH.js";import"./chunk.3SBTQ66X.js";import"./chunk.ET3XJDPX.js";import"./chunk.3TVAE7LE.js";import"./chunk.JX2C3HVD.js";import"./chunk.Z7N3MJ36.js";import{a as S,b as W}from"./chunk.MB7LKKUD.js";import"./chunk.GLTWLQ6L.js";import"./chunk.ACB4TD4W.js";import"./chunk.XCQ7ZPR5.js";import"./chunk.MY5OXSS7.js";import"./chunk.NVRK6A7T.js";import"./chunk.FKJ3HIA5.js";import"./chunk.VICCAWAN.js";import"./chunk.OU5TRY4N.js";import"./chunk.CQPNDJAC.js";import"./chunk.GYTVL6GR.js";import{D as H,E as V,Fa as _,G as ee,Ra as x,T as D,ba as F}from"./chunk.TMYGLXR6.js";import{a as j}from"./chunk.SDO3U72B.js";import{Oc as B,ga as q}from"./chunk.P4CLT32V.js";import"./chunk.SLBWPVIY.js";import{b}from"./chunk.AJZBJBMO.js";var t=b(ee(),1);var a=b(D(),1);function ae(n){let r=[];return n.applied.length>0&&n.intent&&r.push(`${n.intent}.`),n.unchanged.length>0&&r.push(`${n.unchanged.length} already so.`),n.allOrNothing&&r.push("None of it was kept."),r.join(" ")}var re=_(j(()=>(__graviewPreload(import.meta.url,["./chunk.R5R7CLOU.js","./chunk.3TVAE7LE.js","./chunk.JX2C3HVD.js","./chunk.3MU37W5D.js","./chunk.XOZU4OFA.js","./chunk.Z7N3MJ36.js","./chunk.6KYWJXZR.js","./chunk.TI4OSTQV.js","./chunk.ACB4TD4W.js","./chunk.VICCAWAN.js","./chunk.OU5TRY4N.js","./chunk.CQPNDJAC.js","./chunk.GYTVL6GR.js","./chunk.TMYGLXR6.js","./chunk.SDO3U72B.js","./chunk.P4CLT32V.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.2534FLZZ.js")))),te=re.part((n,r)=>(0,a.jsx)(n.SeveralAi,{...r}),{quiet:!0});function ne(n){let r=F()?.ai;return!H(r)||!V(r)?null:(0,a.jsx)(t.Suspense,{fallback:null,children:(0,a.jsx)(te,{...n})})}function me({store:n,chosen:r,principal:d,context:v,via:k,anchor:A,of:g,onChooseAll:E,onClear:m,onActed:Q}){let[U,X]=(0,t.useState)(0);(0,t.useEffect)(()=>n.subscribe(()=>X(e=>e+1)),[n]);let f=r.join(`
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 G,b as J}from"./chunk.GZBODS7Z.js";import"./chunk.CANTHIRO.js";import{a as K}from"./chunk.NAEEPUWJ.js";import"./chunk.AQJD23AN.js";import"./chunk.52Y37IAD.js";import"./chunk.CSA6SWTI.js";import"./chunk.4DCPB67O.js";import"./chunk.Y4VOCJ7R.js";import"./chunk.IYVBJDR7.js";import{a as S,b as W}from"./chunk.MB7LKKUD.js";import"./chunk.VTCPA4V4.js";import"./chunk.FGJM4LJO.js";import"./chunk.K7WME4P4.js";import"./chunk.MDIAWTNK.js";import"./chunk.PEA4D66Y.js";import"./chunk.TRPPN2GD.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{D as H,E as V,G as ee,Ga as _,Sa as x,T as D,ca as F}from"./chunk.B3T4N2XM.js";import{a as j}from"./chunk.SDO3U72B.js";import{Oc as B,ga as q}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b}from"./chunk.AJZBJBMO.js";var t=b(ee(),1);var a=b(D(),1);function ae(n){let r=[];return n.applied.length>0&&n.intent&&r.push(`${n.intent}.`),n.unchanged.length>0&&r.push(`${n.unchanged.length} already so.`),n.allOrNothing&&r.push("None of it was kept."),r.join(" ")}var re=_(j(()=>(__graviewPreload(import.meta.url,["./chunk.ZYYM52N5.js","./chunk.4DCPB67O.js","./chunk.Y4VOCJ7R.js","./chunk.3FUFVVR4.js","./chunk.XOZU4OFA.js","./chunk.IYVBJDR7.js","./chunk.OZYZBRWO.js","./chunk.TI4OSTQV.js","./chunk.FGJM4LJO.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.E647LWH5.js")))),te=re.part((n,r)=>(0,a.jsx)(n.SeveralAi,{...r}),{quiet:!0});function ne(n){let r=F()?.ai;return!H(r)||!V(r)?null:(0,a.jsx)(t.Suspense,{fallback:null,children:(0,a.jsx)(te,{...n})})}function me({store:n,chosen:r,principal:d,context:v,via:k,anchor:A,of:g,onChooseAll:E,onClear:m,onActed:Q}){let[U,X]=(0,t.useState)(0);(0,t.useEffect)(()=>n.subscribe(()=>X(e=>e+1)),[n]);let f=r.join(`
2
2
  `),{acts:c,withheld:N}=(0,t.useMemo)(()=>G(n,r,{...d?{principal:d}:{},...v?{context:v}:{}}),[n,f,d,v,U]),[O,p]=(0,t.useState)(!1),[l,u]=(0,t.useState)(null),[s,P]=(0,t.useState)(null),h=(0,t.useRef)(null),L=(0,t.useId)(),w=(0,t.useMemo)(()=>[...new Set(r.map(e=>n.graph.getNode(e)?.kind))],[n,f]),Y=w.length===1&&w[0]?`${q(n.schema,w[0],r.length)} chosen`:`${r.length} chosen`,M=typeof matchMedia=="function"&&matchMedia("(pointer: coarse), (max-width: 599px)").matches?2:3,C=c.filter(e=>!e.more),Z=C.slice(0,M),R=[...C.slice(M),...c.filter(e=>e.more)];(0,t.useEffect)(()=>{u(null),p(!1)},[f]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!x(e))try{e.showPopover()}catch{}let i=()=>{W(e,A?.()??null),dispatchEvent(new Event(S))};i(),addEventListener("resize",i),addEventListener("scroll",i,!0);let o=typeof ResizeObserver=="function"?new ResizeObserver(i):null;return o?.observe(e),()=>{if(o?.disconnect(),removeEventListener("resize",i),removeEventListener("scroll",i,!0),e.isConnected&&x(e))try{e.hidePopover()}catch{}dispatchEvent(new Event(S))}},[A]);let y=(0,t.useRef)({asking:l,onClear:m});y.current={asking:l,onClear:m},(0,t.useEffect)(()=>{let e=i=>{if(i.key!=="Escape"||i.defaultPrevented)return;let o=document.activeElement;if(!(!(h.current?.contains(o)??!1)&&(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement&&o.type!=="checkbox"||o instanceof HTMLSelectElement))){if(i.preventDefault(),i.stopPropagation(),y.current.asking){u(null);return}y.current.onClear()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let T=(e,i={})=>{let o=J(n,{mutation:e.mutation,subject:e.subject,args:{...e.args,...i},label:e.label},r,{...d?{author:d}:{},...k?{via:k}:{},...v?{context:v}:{}});u(null),p(!1),P(o.refused.length>0||o.applied.length===0?o:null),Q(o.refused.map(I=>I.id))},$=e=>{P(null),p(!1),e.open.length>0?u(e):T(e)},z=e=>(0,a.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-act","data-act":e.id,"data-mutation":e.mutation,...e.destructive?{"data-tone":"warn"}:{},"aria-pressed":l?.id===e.id?!0:void 0,onClick:()=>$(e),children:[e.label,e.open.length>0?"\u2026":""]},e.id);return(0,a.jsxs)("div",{ref:h,popover:"manual",role:"region","aria-label":"The chosen records",className:"graview-several-bar","data-testid":"several-bar","data-graview-foot":"","data-graview-overlay":"","data-graview-popover":"","data-graview-offstage":"",style:ie,children:[(0,a.jsx)("style",{children:oe}),(0,a.jsxs)("div",{className:"graview-several-line",children:[(0,a.jsx)("span",{role:"status","aria-live":"polite",className:"graview-several-count","data-testid":"several-count",children:Y}),(0,a.jsxs)("div",{role:"group","aria-label":`What to do with the ${r.length} chosen`,className:"graview-several-acts",children:[Z.map(z),R.length>0?(0,a.jsx)("button",{type:"button",className:"graview-several-act","data-testid":"several-more","aria-expanded":O,"aria-controls":L,onClick:()=>p(e=>!e),children:"More"}):null,E&&g!==void 0&&g>r.length?(0,a.jsxs)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-all",onClick:E,children:["Choose all ",g]}):null,(0,a.jsx)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-clear","aria-keyshortcuts":"Escape",title:"Put the choice down \u2014 Escape",onClick:m,children:"Clear"})]})]}),c.length>0&&r.length>1?(0,a.jsx)(ne,{chosen:r,acts:c,onAct:$}):null,O?(0,a.jsx)("div",{id:L,role:"group","aria-label":"More",className:"graview-several-acts","data-testid":"several-more-acts",children:R.map(z)}):null,c.length===0?(0,a.jsx)("p",{className:"graview-several-said","data-testid":"several-none",children:N.length>0?`Nothing here can be done to all of them by you: ${N[0].message}`:"Nothing can be done to all of these at once."}):null,l?(0,a.jsx)("div",{className:"graview-several-ask",role:"group","aria-label":`${l.label}, for all ${r.length}`,"data-testid":"several-ask",children:(0,a.jsx)(K,{store:n,affordance:l.affordance,onApply:e=>T(l,e),onCancel:()=>u(null)})}):null,s?(0,a.jsxs)("div",{role:"alert",className:"graview-several-said","data-testid":"several-outcome",children:[ae(s),s.refused.length>0?(0,a.jsxs)(a.Fragment,{children:[" ",s.refused.length===1?"One was not changed, and is still chosen:":`${s.refused.length} were not changed, and are still chosen:`,(0,a.jsx)("ul",{"data-testid":"several-refused",children:s.refused.map(e=>(0,a.jsxs)("li",{"data-record":e.id,children:["\u201C",e.label,"\u201D \u2014 ",e.message]},e.id))})]}):null]}):null]})}var ie={position:"fixed",inset:"auto",margin:0,zIndex:B("toast"),boxSizing:"border-box",width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,overflow:"visible"},oe=`
3
3
  .graview-several-bar{display:grid;gap:8px;padding:8px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-float);color:var(--graview-ink);box-shadow:var(--graview-lift-high);font-size:.875rem;line-height:1.4;max-height:70vh;overflow:auto}
4
4
  .graview-several-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;min-width:0}
@@ -1 +1 @@
1
- import{da as l,ka as p,ob as a}from"./chunk.P4CLT32V.js";import{c}from"./chunk.SLBWPVIY.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};
1
+ import{da as l,ka as p,ob as a}from"./chunk.6W2DUW5S.js";import{c}from"./chunk.SLBWPVIY.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};
@@ -0,0 +1 @@
1
+ import{a as ee,b as H,c as ne}from"./chunk.NCTTPW7A.js";import{B as J,F as Q,H as X,K as Y,g as K,i as G,m as q,p as z,q as W,u as j,v as Z,x as _,z as U}from"./chunk.G6DISMVT.js";import{a as O}from"./chunk.W54NXXC5.js";import{G as ae,Ha as D,Qa as $,T as M,ba as T,da as N,ua as I}from"./chunk.B3T4N2XM.js";import{Bc as C}from"./chunk.6W2DUW5S.js";import{b as k}from"./chunk.AJZBJBMO.js";var o=k(ae(),1);var y=k(M(),1),fe=e=>typeof e=="object"?e:{};function he({rootRef:e,firstLook:r,app:n}){let t=(0,o.useCallback)(()=>e.current,[e]);return r?(0,y.jsx)(Y,{firstLook:r,root:t,app:n}):null}function ge(e,r,n){let{app:t}=e,a=(0,o.useMemo)(()=>{let i=Q(r(t.schema,t.viewSpecs),t),d=n?ie(i,n):i,s=e.views?e.views(t.schema,d):i,c=s===d?i:I(i,s);return X(c,t.schema,U(e.brand??t.brand,t.schema)),n?n.register(c):c},[e.views,t.schema,t.viewSpecs,t.lenses,t.pages,t.home,n]);return D(a,e.keptViews)}function ie(e,r){let n={...e,register(t,a,i,d){return d?.name!==r.name&&e.register(t,a,i,d),n},...e.home?{home:(t,a)=>(r.home||e.home(t,a),n)}:{}};return n}var F=e=>e?e.getBoundingClientRect().height:0;function be(e,r,n){let t=(0,o.useRef)(n);t.current=n;let a=n!==void 0;(0,o.useLayoutEffect)(()=>{let i=e.current;if(!i||!a)return;let d=()=>{let m=[...i.children],h=m.find(b=>b.hasAttribute("data-graview-app-bar")),p=m.find(b=>b.hasAttribute("data-embed-content")),g=p?.querySelector("[data-embed-measure]")??null,l=m.find(b=>b.hasAttribute("data-graview-place-line"));return{strip:h,line:l,content:p,measure:g}},s=-1,c=()=>{let{strip:m,line:h,content:p,measure:g}=d(),l=Math.ceil(F(m)+F(h)+F(g||p));l!==s&&(s=l,t.current?.(l))};if(c(),typeof ResizeObserver>"u")return;let u=new ResizeObserver(c),E=()=>{u.disconnect();let{strip:m,line:h,content:p,measure:g}=d();for(let l of[i,m,h,p,g])l&&u.observe(l)};E();let w=new MutationObserver(()=>{E(),c()});return w.observe(i,{childList:!0}),()=>{u.disconnect(),w.disconnect()}},[e,r,a])}var we=480,se=0;function Se(e){let{app:r,seed:n,scheme:t="auto",brand:a=r.brand,fonts:i=!0,height:d="100%",label:s}=e,c=(0,o.useRef)(null);$(c);let u=d==="viewport"?"100dvh":d,E=G(typeof u=="string"&&/vh\b/.test(u)),w=(0,o.useMemo)(()=>`graview-embed-${++se}`,[]),m=(0,o.useMemo)(()=>e.store??e.remote?.store??H(r,n),[e.store,e.remote,r,n]),h=e.presence??e.remote?.presence,p=e.hostContext?.theme,g=ne(t==="auto"&&p===void 0,a?.scheme),l=t==="auto"?p??g:t,b=(0,o.useMemo)(()=>O(l,a,{scope:`.${w}`}),[l,a,w]);K(e.favicon?C(a):void 0),(0,o.useEffect)(()=>{if(!i||typeof document>"u")return;let v=ee(a);if(!v||document.querySelector(`link[href="${v}"]`))return;let f=document.createElement("link");f.rel="stylesheet",f.href=v,document.head.appendChild(f)},[a,i]);let A=(0,o.useRef)(void 0);(0,o.useLayoutEffect)(()=>{let v=c.current,f=A.current;if(A.current=s,!v||!s)return;let oe=S=>{let R=S.getAttribute("aria-label")??"",x=f&&f!==s?R.startsWith(`${f} \xB7 `)?R.slice(f.length+3):R===f?"":R:R;x===s&&(S.getAttribute("role")==="region"||S.tagName==="SECTION"&&!S.hasAttribute("role"))&&S.setAttribute("role","group");let V=x.startsWith(`${s} \xB7 `)||x===s?x:x?`${s} \xB7 ${x}`:s;V!==R&&S.setAttribute("aria-label",V)},B=()=>v.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(S=>{S.hasAttribute("data-graview-named-by-lens")||oe(S)});B();let P=new MutationObserver(B);return P.observe(v,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>P.disconnect()},[s]);let re=E?`${u}`.replace(/([\d.]+)[sdl]?vh\b/g,(v,f)=>`${+f*E/100}px`):u;return{rootRef:c,scope:w,css:b,scheme:l,store:m,presence:h,brand:a,auto:d==="auto",height:re}}function ve({rootRef:e,board:r}){let n=(0,o.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]);return(0,y.jsx)(q,{board:r,anchor:n})}function Ee(e,r,n){return{brand:n,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:r,typing:e.remote?.typing,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,ai:e.ai,files:e.files,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,dismissals:e.dismissals,whileAway:e.whileAway,keptViews:e.keptViews,onExport:e.onExport,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function Re({name:e,heading:r,faces:n,at:t,without:a,home:i,reach:d,standing:s,hostActions:c,keeping:u,onFind:E,switch:w,named:m=!0}){let{brand:h,store:p,principal:g,views:l}=T();N();let b=a?.has("places")?[]:z({store:p,principal:g,views:l}),A=_();return(0,y.jsx)(j,{brand:h,name:e,named:m,description:h?.subtitle,heading:r,faces:n,home:i,places:b,current:t===null?null:W(b,t),reach:d,onFind:E,...w?{switch:w}:{},...n||t===null?{scenePlaces:A}:{},tools:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(J,{clean:s}),(0,y.jsx)(Z,{...c?{hostActions:c}:{},...u?{keeping:u}:{}})]})})}var xe=e=>e===!1?2:Math.min(e+1,6);function Ae(e){let[r,n]=(0,o.useState)(e),t=(0,o.useRef)(void 0),a=(0,o.useRef)(void 0),i=(0,o.useMemo)(()=>({go:t,at:n,pending:a}),[]),d=(0,o.useCallback)(s=>{if(t.current){t.current(s);return}a.current=s,n(s)},[]);return{at:r,setAt:n,steering:i,steer:d}}function de(e){let r=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof r=="string"&&r.length>0?r:typeof e=="object"?"Error":typeof e}}var L=()=>typeof performance<"u"?performance.now():Date.now();function Fe(e,r){let n=(0,o.useRef)({onError:e,face:r});return n.current={onError:e,face:r},(0,o.useCallback)((t,a)=>n.current.onError?.(de(t),{module:a.module,face:n.current.face}),[])}function ke(e,r){let n=(0,o.useRef)(null);n.current===null&&(n.current=L());let t=(0,o.useRef)({onReady:e,face:r});t.current={onReady:e,face:r};let a=(0,o.useRef)(!1);return(0,o.useCallback)(i=>{a.current||(a.current=!0,t.current.onReady?.({ms:Math.max(0,L()-(n.current??L())),face:i}))},[])}var te=class extends o.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(r,n){console.error(`[graview] ${this.props.module} threw while rendering`,r,n.componentStack),this.props.report(r,{module:this.props.module})}render(){return this.state.failed?(0,y.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,y.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,y.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{fe as a,he as b,ge as c,be as d,we as e,Se as f,ve as g,Ee as h,Re as i,xe as j,Ae as k,Fe as l,ke as m,te as n};
@@ -1,2 +1,2 @@
1
- import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.R5R7CLOU.js";import"./chunk.3TVAE7LE.js";import"./chunk.JX2C3HVD.js";import"./chunk.3MU37W5D.js";import"./chunk.XOZU4OFA.js";import"./chunk.Z7N3MJ36.js";import{a as A}from"./chunk.6KYWJXZR.js";import"./chunk.TI4OSTQV.js";import"./chunk.ACB4TD4W.js";import"./chunk.VICCAWAN.js";import"./chunk.OU5TRY4N.js";import"./chunk.CQPNDJAC.js";import"./chunk.GYTVL6GR.js";import{G as M,T as f}from"./chunk.TMYGLXR6.js";import"./chunk.SDO3U72B.js";import"./chunk.P4CLT32V.js";import"./chunk.SLBWPVIY.js";import{b as d}from"./chunk.AJZBJBMO.js";var n=d(M(),1);var r=d(f(),1),C="several";function q({chosen:c,acts:p,onAct:N}){let t=A(),u=(0,n.useMemo)(()=>[...c].sort(),[c]),i=u.join(`
1
+ import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.ZYYM52N5.js";import"./chunk.4DCPB67O.js";import"./chunk.Y4VOCJ7R.js";import"./chunk.3FUFVVR4.js";import"./chunk.XOZU4OFA.js";import"./chunk.IYVBJDR7.js";import{a as A}from"./chunk.OZYZBRWO.js";import"./chunk.TI4OSTQV.js";import"./chunk.FGJM4LJO.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{G as M,T as f}from"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as d}from"./chunk.AJZBJBMO.js";var n=d(M(),1);var r=d(f(),1),C="several";function q({chosen:c,acts:p,onAct:N}){let t=A(),u=(0,n.useMemo)(()=>[...c].sort(),[c]),i=u.join(`
2
2
  `),o=(0,n.useMemo)(()=>({on:"selection",ids:u}),[i]),l=(0,n.useMemo)(()=>p.filter(e=>e.open.length===0&&!e.more&&!e.destructive),[p]),g=(0,n.useMemo)(()=>new Map(l.map(e=>[h(e.id),e])),[l]),v=S(t,o,C),[y,x]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(v!==void 0)return;let e=!0;return w(t,o,{by:C,ask:()=>b(t.ai,{store:t.store,target:o,principal:t.principal,interaction:k(),places:t.places,selection:t.selection,...t.place?{place:t.place}:{},shared:l.map(a=>({id:a.id,label:a.label,mutation:a.mutation,args:a.args}))})}).then(a=>{e&&x({key:i,result:a})}),()=>{e=!1}},[i]);let s=v??(y?.key===i?y.result:void 0);if(s===void 0)return(0,r.jsx)("span",{role:"status",className:"graview-several-quiet","data-testid":"several-ai-thinking",style:{textDecoration:"none"},children:"AI: thinking\u2026"});let m=s.offers.filter(e=>e.type!=="act"||g.has(e.id));if(m.length===0)return null;let E=e=>{let a=g.get(e.id);if(a){t.desk.record({...s.interaction,outcome:"accepted",accepted:[e.id]}),N(a);return}I(t,s,e)};return(0,r.jsx)("div",{role:"group","aria-label":"Suggested by AI",className:"graview-several-acts","data-testid":"several-ai",children:m.map(e=>(0,r.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-ai-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>E(e),children:[e.label,(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \xB7 suggested"})]},e.id))})}export{q as SeveralAi};
@@ -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 te}from"./chunk.CWPRQSED.js";import{o as Se,p as ee,s as $,t as be}from"./chunk.TTFYXKLI.js";import{m as J,n as ye,o as we,p as X,q as Z}from"./chunk.OJGHDWI6.js";import{c as ke}from"./chunk.72Q4R7N6.js";import{a as he,b as U,c as j,e as ve,l as Me}from"./chunk.G6DISMVT.js";import{b as de}from"./chunk.W54NXXC5.js";import{D as z,Ea as fe,F as Y,Fa as ge,G as O,Ga as T,J as pe,Ma as _,O as me,Oa as F,T as M,ba as A,ca as q,da as B,m as le,v as ce,z as ue}from"./chunk.B3T4N2XM.js";import{a as E}from"./chunk.SDO3U72B.js";import{Jc as ie,Oc as ae,ia as H,jd as se}from"./chunk.6W2DUW5S.js";import{b as y}from"./chunk.AJZBJBMO.js";var P=y(O(),1),x=y(M(),1),ne=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.GANAZIRD.js")))),xe=ne.part(t=>(0,x.jsx)(t.HoverChipDoor,{}),{quiet:!0}),De="A",Q=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.S6TN3MLY.js","./chunk.ZQWKS6K5.js","./chunk.GZBODS7Z.js","./chunk.FBRARPGR.js","./chunk.EZXGVTT2.js","./chunk.UXNZPPWR.js","./chunk.GYO57LKD.js","./chunk.HJCQ6I3S.js","./chunk.LCG3VLCB.js","./chunk.P7FN3SFB.js","./chunk.CANTHIRO.js","./chunk.BG2SC77J.js","./chunk.NAEEPUWJ.js","./chunk.AQJD23AN.js","./chunk.XBNASVTY.js","./chunk.52Y37IAD.js","./chunk.MSPRCR3Q.js","./chunk.CSA6SWTI.js","./chunk.4DCPB67O.js","./chunk.Y4VOCJ7R.js","./chunk.3FUFVVR4.js","./chunk.XOZU4OFA.js","./chunk.IYVBJDR7.js","./chunk.ZJXUWOG3.js","./chunk.TI4OSTQV.js","./chunk.TXEWSZGO.js","./chunk.VTCPA4V4.js","./chunk.FGJM4LJO.js","./chunk.K7WME4P4.js","./chunk.MDIAWTNK.js","./chunk.PEA4D66Y.js","./chunk.TRPPN2GD.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.VTRI2MT2.js"))));var Ce=Q.part((t,e)=>(0,x.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let c=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(c)}let i=setTimeout(e,2500);return()=>clearTimeout(i)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:i,ai:c}=A(),p=be(),h=Y(c),r=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h});r.current={aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h},(0,P.useEffect)(()=>{if(typeof document>"u")return;let u=null,w=null,k=null,l=g=>{let m=r.current,b=m.chipsOn?m.aimAt(g):null;b&&(k=g,ne.load().then(G=>{k===g&&G.restOn(b,g)},()=>{}))},f=()=>{u&&clearTimeout(u.timer),u=null},s=g=>{let m=r.current,b=m.aimAt(g);if(!b)return;let G=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,m.store.log.length]);G!==w&&(w=G,m.prepareSections(b),Q.load().then(Pe=>Pe.prepareActs(m.store,b,{principal:m.principal,providers:m.providers}),()=>{}))},o=g=>g.target instanceof Element?g.target.closest(Ne):null,d=g=>{if(g.pointerType==="touch")return;let m=o(g);m!==null&&m===u?.element||(f(),m!==null&&(u={element:m,timer:setTimeout(()=>{u=null,s(m),l(m)},Oe)}))},v=g=>{let m=g.relatedTarget;k!==null&&!(m instanceof Node&&k.contains(m))&&(k=null,ne.current?.leaveRest()),u!==null&&(m instanceof Node&&u.element.contains(m)||f())},S=g=>{if(g.pointerType==="mouse")return;let m=o(g);m&&s(m)},I=g=>{if(!fe())return;let m=o(g);m&&s(m)};return document.addEventListener("pointerover",d,{passive:!0}),document.addEventListener("pointerout",v,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{f(),document.removeEventListener("pointerover",d),document.removeEventListener("pointerout",v),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function it({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:i,setMenuAt:c,registerActsDoor:p,ai:h}=A(),{selection:r}=_();We(n??Re),(0,P.useEffect)(()=>{if(Q.current)return;let f=()=>{v(),Q.prefetch()},s=()=>{},o=ge(()=>void(s=Le(f))),d=["pointerdown","keydown"];for(let S of d)document.addEventListener(S,f,{capture:!0,passive:!0});function v(){o(),s();for(let S of d)document.removeEventListener(S,f,{capture:!0})}return v},[]),(0,P.useEffect)(()=>{if(t==="menu")return p({key:De,open:e??(f=>{let s=f.getBoundingClientRect(),o=f.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??f.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;c({x:Math.round(s.left+Math.min(16,s.width/2)),y:Math.round(Math.min(s.bottom,s.top+36)),...o?{on:o}:{}})})}),()=>p(null)},[t,p,c,e]);let u=i!==null||r.length>0&&e===void 0,[w,k]=(0,P.useState)(u);(0,P.useEffect)(()=>{u&&k(!0)},[u]);let l=Y(h)?(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(xe,{})}):null;return!w&&!u?l:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(Ce,{placement:t,chosen:e===void 0})}),l]})}var K=y(O(),1),V=y(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.25VJPUDH.js","./chunk.S6TN3MLY.js","./chunk.ZQWKS6K5.js","./chunk.GZBODS7Z.js","./chunk.H6EMDQP5.js","./chunk.3FRVG6JW.js","./chunk.7NFCI4LH.js","./chunk.RUTZEEBR.js","./chunk.FBRARPGR.js","./chunk.GZWC72HS.js","./chunk.ASCTAUFD.js","./chunk.CWPRQSED.js","./chunk.EZXGVTT2.js","./chunk.ULTYDYTS.js","./chunk.2LQ37DC2.js","./chunk.UXNZPPWR.js","./chunk.GYO57LKD.js","./chunk.HJCQ6I3S.js","./chunk.LCG3VLCB.js","./chunk.P7FN3SFB.js","./chunk.CANTHIRO.js","./chunk.BG2SC77J.js","./chunk.NAEEPUWJ.js","./chunk.AQJD23AN.js","./chunk.R3DWF35R.js","./chunk.XBNASVTY.js","./chunk.6S3B4XC4.js","./chunk.52Y37IAD.js","./chunk.TLQTDKOL.js","./chunk.MSPRCR3Q.js","./chunk.CSA6SWTI.js","./chunk.4DCPB67O.js","./chunk.Y4VOCJ7R.js","./chunk.3FUFVVR4.js","./chunk.XOZU4OFA.js","./chunk.IYVBJDR7.js","./chunk.ZJXUWOG3.js","./chunk.TI4OSTQV.js","./chunk.TXEWSZGO.js","./chunk.WVUJXDXZ.js","./chunk.VTCPA4V4.js","./chunk.FGJM4LJO.js","./chunk.K7WME4P4.js","./chunk.MDIAWTNK.js","./chunk.PEA4D66Y.js","./chunk.TRPPN2GD.js","./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.34Q7OKK3.js")))),He=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,V.jsx)(n,{...e})},{what:"The view"});function ct(t){let{seatTalk:e}=A();return(0,K.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,V.jsx)(K.Suspense,{fallback:null,children:(0,V.jsx)(He,{...t})}):null}var C=y(O(),1),D=y(M(),1),Ae=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.GYO57LKD.js","./chunk.ZYYM52N5.js","./chunk.4DCPB67O.js","./chunk.Y4VOCJ7R.js","./chunk.3FUFVVR4.js","./chunk.XOZU4OFA.js","./chunk.IYVBJDR7.js","./chunk.OZYZBRWO.js","./chunk.TI4OSTQV.js","./chunk.FGJM4LJO.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.4SVAHPJA.js")))),ze=Ae.part((t,e)=>{let n=t.QuickAskCard;return(0,D.jsx)(n,{...e})},{what:"The quick ask"});function gt({face:t,on:e=!0}){let{ai:n,aiDesk:i,selection:c,view:p}=A(),h=me()?.open??!1,r=e&&z(n)&&!h,u=ve(i),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:c,place:p.within?.view});return k.current={selection:c,place:p.within?.view},(0,C.useEffect)(()=>{if(!r)return;let l=he(i);return l.drawn+=1,U(l),()=>{l.drawn=Math.max(0,l.drawn-1),l.drawn===0&&(l.open=null),U(l)}},[r,i]),(0,C.useEffect)(()=>{if(!r)return;let l=f=>{if(f.defaultPrevented||f.key.toLowerCase()!=="k"||!(f.metaKey||f.ctrlKey)||f.altKey||f.shiftKey)return;let s=w.current?.closest("[data-graview-embed]"),o=f.target,d=!(o instanceof Node)||o===document.body||o===document.documentElement;if(s&&!(d||o instanceof Node&&s.contains(o)))return;f.preventDefault(),Ae.prefetch();let v=document.activeElement,{selection:S,place:I}=k.current;j(i,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:v instanceof HTMLElement&&v!==document.body?v:null})};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[r,i]),r?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),u?(0,D.jsx)(C.Suspense,{fallback:null,children:(0,D.jsx)(ze,{face:t,opening:u,close:()=>j(i,null)},u.at)}):null]}):null}var R=y(O(),1),L=y(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.ZYYM52N5.js","./chunk.4DCPB67O.js","./chunk.Y4VOCJ7R.js","./chunk.3FUFVVR4.js","./chunk.XOZU4OFA.js","./chunk.IYVBJDR7.js","./chunk.OZYZBRWO.js","./chunk.TI4OSTQV.js","./chunk.FGJM4LJO.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.I62MCBQM.js")))),qe=oe.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),Be=oe.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function _e(){let{ai:t}=A(),e=z(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:i=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(qe,{target:n,close:i})}),prepare:()=>oe.prefetch()}):null,[e])}var Fe=[];function St({children:t}){let e=_e(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)($,{sections:n,children:t})}function bt(t){let{ai:e,aiDesk:n}=A(),{ghost:i}=pe(n);return i===null||i.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(Be,{...t})})}var N=y(O(),1);var Te=y(M(),1),Qe=t=>globalThis[Symbol.for("graview.shown-lists")]?.get(t),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.FJN4OGAS.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function Ke(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=q(),n=e?.keptViews,i=e?.views,c=(0,N.useContext)(Me);return(0,N.useMemo)(()=>i?p=>{let h=n?.current(),r=Ve(p),u=s=>s.length>0?{id:"tidy-view",items:s,prepare:()=>Ee.prefetch()}:null,w=(s,...o)=>Ee.load().then(d=>d[s](...o),()=>!1),k=(s,o)=>Qe(s)?.().menu(o,n,c)??[];if(p.place===void 0){if(p.face!=="pages"||r===void 0||p.on!==void 0)return null;let s=h?.may.lenses===!0&&n?.lens!==void 0,o=H(e.store.schema,r),d=i.arrangement?.()?.hide?.includes(r)===!0;return u([...s?[{id:d?"show-list":"hide-list",label:d?"Show":"Hide",hint:d?"Back in the places, for everyone":"Off the places, for everyone; still at its address",run:()=>void w("setListHidden",r,o,n,!d,c)}]:[],...k(`list:${r}`,s)])}let l=i.places().find(s=>s.as===p.place&&(r===void 0||s.kind===r||s.over?.includes(r)===!0));if(!l)return null;let f=n&&h?se(l,h,n):null;return u([...f?[l.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>void w("setHidden",l,f,n,!1,c)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>void w("setHidden",l,f,n,!0,c)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let s=Ke(i.places(),l);w("remove",l,f,n,c).then(o=>o&&t?.(l,s))}}]:[],...k(`place:${l.as}`,f==="lens")])}:null,[n,i,c,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=F(),i=(0,N.useCallback)((h,r)=>{let u=e.within?.view;e.focusId===ce(h.kind)&&(u===void 0||u===h.as)&&n(r?ue(e,r.kind,r.as):le(e,!0))},[e,n]),c=Ye(i),p=(0,N.useMemo)(()=>c?[c]:Ue,[c]);return(0,Te.jsx)($,{sections:p,children:t})}function Nt(t={}){return t.scope===void 0?te:de(te,t.scope)}var W=y(O(),1),a=y(M(),1);function Bt({inside:t=!1,widthOf:e}={}){let{store:n,view:i,emphasis:c,setEmphasis:p}=A(),h=Se(),{selection:r,set:u}=_(),{show:w}=F(),k=B(),l=(0,W.useMemo)(()=>{let o=new Map;for(let d of n.graph.allEdges()){let v=o.get(d.kind)??{count:0,ends:new Set};v.count+=1;for(let S of[d.from,d.to]){let I=n.graph.getNode(S);I&&v.ends.add(`kind:${I.kind}`)}o.set(d.kind,v)}return[...o.entries()].sort(([d],[v])=>d.localeCompare(v)).map(([d,v])=>({kind:d,count:v.count,ends:[...v.ends]}))},[n,k]),f=Math.max(0,...l.map(o=>o.count));if((0,W.useEffect)(()=>()=>p(null),[p]),!i.overview&&!t||l.length===0)return null;let s=new Set;for(let o of r){if(o.startsWith("kind:")){s.add(o);continue}let d=n.graph.getNode(o);d&&s.add(`kind:${d.kind}`)}return(0,a.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:ae("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:je,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,a.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:l.length===1?"1 relation":`${l.length} relations`}),e?(0,a.jsx)(Xe,{aloft:i.overview===!0}):null,l.map(({kind:o,count:d,ends:v})=>{let{connector:S,style:I}=ee(h,o),g=Je(n.schema,o),m=c!==null?c===o:s.size===0||v.some(b=>s.has(b));return(0,a.jsxs)("button",{type:"button",title:n.schema.edge(o)?.description===void 0?`${d} of these`:g.words,onMouseEnter:()=>p(o),onMouseLeave:()=>p(null),onFocus:()=>p(o),onBlur:()=>p(null),onClick:()=>{u(v),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:m?1:.4},children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:i.overview&&e?(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(d,f)}):(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:X(I),strokeWidth:Z(I,!0),strokeDasharray:J[I.pattern],strokeLinecap:"round"})}),(0,a.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":o,children:[(0,a.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,a.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,a.jsx)("span",{"data-graview-quiet":o,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,a.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:d})]},o)})]})}var je="min(280px, calc(100% - 28px))";function Je(t,e,n){let i=t.edge(e)?.from??[],c=new Map;for(let r of n!==void 0&&i.includes(n)?[n]:i.length>0?i:[""]){let u=ke(t,r,e,"out");c.set(u,[...c.get(u)??[],r])}let p=r=>r==="*"?"anything":H(t,r),h=[...c].map(([r,u])=>{let w=u.flatMap(l=>t.tryDefinition(l)?.edges[e]?.to??[]),k=u[0]&&w.length>0?`${u.map(p).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(p).join(", ")}`:"";return[r.charAt(0).toUpperCase()+r.slice(1),k]});return{words:h.map(([r])=>r).join(" \xB7 "),ends:h.flatMap(([,r])=>r?[r]:[]).join(" \xB7 ")}}function _t({edgeKind:t,kit:e,width:n=30}){let i=q(),c=(0,W.useMemo)(()=>ie(e??i?.brand?.kit),[e,i?.brand?.kit]),{connector:p,style:h}=ee(c,t);return(0,a.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:p.visible?1:.35},children:(0,a.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:X(h),strokeWidth:Z(h,!0),strokeDasharray:J[h.pattern],strokeLinecap:"round"})})}function Xe({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,a.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,a.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,a.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,a.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,a.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,a.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:we,strokeWidth:1.8,strokeDasharray:ye,strokeLinecap:"round"})}),(0,a.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=y(O(),1),re=y(M(),1),Ze=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.25VJPUDH.js","./chunk.BG2SC77J.js","./chunk.NAEEPUWJ.js","./chunk.AQJD23AN.js","./chunk.XBNASVTY.js","./chunk.52Y37IAD.js","./chunk.Y4VOCJ7R.js","./chunk.TI4OSTQV.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.5H3VCAPN.js")))),et=Ze.part(t=>(0,re.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t,whileAway:e}=A(),n=B();return(0,Ie.useMemo)(()=>t.log.all().some(c=>c.suggests!==void 0&&!c.withheld),[t,n])||e?.tidied?(0,re.jsx)(et,{}):null}export{it as a,ct as b,gt as c,Bt as d,je as e,_t as f,_e as g,St as h,bt as i,Ye as j,Dt as k,Nt as l,Vt as m};
@@ -1 +1 @@
1
- import{g as o,l as u}from"./chunk.TMYGLXR6.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
1
+ import{g as o,l as u}from"./chunk.B3T4N2XM.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
@@ -0,0 +1,4 @@
1
+ var l={},R={empty:!0},Re={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},T={div:l,section:l,article:l,aside:l,header:l,footer:l,nav:l,hgroup:l,search:l,address:l,figure:l,figcaption:l,blockquote:l,p:l,pre:l,hr:R,br:R,wbr:R,h1:l,h2:l,h3:l,h4:l,h5:l,h6:l,span:l,strong:l,em:l,b:l,i:l,u:l,s:l,small:l,mark:l,abbr:l,cite:l,q:l,code:l,kbd:l,samp:l,var:l,sub:l,sup:l,dfn:l,bdi:l,bdo:l,ruby:l,rt:l,rp:l,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:l,menu:l,dl:l,dt:l,dd:l,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:l,caption:l,thead:l,tbody:l,tfoot:l,tr:l,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:l,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:l,output:l,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":R},Ae=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],Te={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Ae.map(e=>[e,"css"]))},x={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},A={viewBox:"geometry",preserveAspectRatio:"geometry"},q={oneOf:["userSpaceOnUse","objectBoundingBox"]},Y={oneOf:["R","G","B","A"]},y={...x,in:"text",result:"text"},K={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},_={svg:{attributes:{...x,...A}},g:l,defs:l,symbol:{attributes:{...x,...A,refX:"geometry",refY:"geometry"}},use:{attributes:{...x,href:"fragment"}},title:l,desc:l,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...x,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...K}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...K}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...x,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...x,...A,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...A,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:l,filter:{attributes:{...x,filterUnits:q,primitiveUnits:q}},feBlend:{attributes:{...y,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...y,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:y},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(e=>[e,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...y,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...y,in2:"text",scale:"number",xChannelSelector:Y,yChannelSelector:Y}},feDropShadow:{attributes:{...y,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:y},feGaussianBlur:{attributes:{...y,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:y},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...y,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...y,dx:"number",dy:"number"}},feTurbulence:{attributes:{...x,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var Z=["alert","alertdialog","dialog","banner","main","navigation","contentinfo","complementary","search","form","application","status","log","marquee","timer"],tt=["region"],S={nav:"div",header:"div",footer:"div",aside:"div",search:"div",output:"span"},J={section:["aria-label","aria-labelledby","title"]};function _e(e){return/^aria-[a-z]+$/.test(e)}function Pe(e){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(e)}var Q=["all","display","position","top","right","bottom","left","inset","inset-block","inset-inline","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","width","height","min-width","min-height","max-width","max-height","inline-size","block-size","min-inline-size","min-block-size","max-inline-size","max-block-size","margin","margin-top","margin-right","margin-bottom","margin-left","margin-block","margin-inline","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end","padding","padding-top","padding-right","padding-bottom","padding-left","padding-block","padding-inline","padding-block-start","padding-block-end","padding-inline-start","padding-inline-end","box-sizing","overflow","overflow-x","overflow-y","overflow-wrap","float","clear","z-index","aspect-ratio","object-fit","object-position","vertical-align","isolation","contain","container","container-type","container-name","content-visibility","flex","flex-direction","flex-wrap","flex-flow","flex-grow","flex-shrink","flex-basis","order","grid","grid-template","grid-template-columns","grid-template-rows","grid-template-areas","grid-auto-columns","grid-auto-rows","grid-auto-flow","grid-area","grid-column","grid-row","grid-column-start","grid-column-end","grid-row-start","grid-row-end","gap","row-gap","column-gap","align-items","align-content","align-self","justify-items","justify-content","justify-self","place-items","place-content","place-self","columns","column-count","column-width","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-fill","color","background","background-color","background-image","background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode","border","border-top","border-right","border-bottom","border-left","border-block","border-inline","border-block-start","border-block-end","border-inline-start","border-inline-end","border-width","border-style","border-color","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-start-start-radius","border-start-end-radius","border-end-start-radius","border-end-end-radius","border-collapse","border-spacing","outline","outline-width","outline-style","outline-color","outline-offset","box-shadow","opacity","visibility","mix-blend-mode","filter","backdrop-filter","clip-path","accent-color","caret-color","color-scheme","appearance","-webkit-appearance","mask-image","mask-size","mask-position","mask-repeat","mask-origin","mask-clip","mask-composite","mask-mode","mask-type","-webkit-mask","-webkit-mask-image","-webkit-mask-size","-webkit-mask-position","-webkit-mask-repeat","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-composite","font","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-variant-numeric","font-variant-caps","font-variant-ligatures","font-feature-settings","font-variation-settings","font-kerning","font-optical-sizing","font-size-adjust","font-synthesis","line-height","letter-spacing","word-spacing","text-align","text-align-last","text-indent","text-transform","text-decoration","text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-underline-position","text-shadow","text-overflow","text-wrap","text-wrap-mode","text-wrap-style","white-space","white-space-collapse","word-break","line-break","hyphens","tab-size","direction","unicode-bidi","writing-mode","text-orientation","text-rendering","-webkit-font-smoothing","-webkit-line-clamp","-webkit-box-orient","line-clamp","-webkit-text-fill-color","-webkit-background-clip","-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","list-style","list-style-type","list-style-position","content","quotes","counter-reset","counter-increment","counter-set","table-layout","caption-side","empty-cells","transform","transform-origin","transform-box","transform-style","translate","rotate","scale","perspective","perspective-origin","backface-visibility","transition","transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior","animation","animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-composition","will-change","animation-timeline","animation-range","animation-range-start","animation-range-end","scroll-timeline","scroll-timeline-name","scroll-timeline-axis","view-timeline","view-timeline-name","view-timeline-axis","view-timeline-inset","timeline-scope","cursor","pointer-events","user-select","-webkit-user-select","touch-action","resize","scroll-behavior","overscroll-behavior","overscroll-behavior-x","overscroll-behavior-y","scroll-snap-type","scroll-snap-align","scroll-snap-stop","scroll-margin","scroll-padding","scrollbar-width","scrollbar-color","scrollbar-gutter","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","stop-color","stop-opacity","clip-rule","marker","marker-start","marker-mid","marker-end","paint-order","vector-effect","shape-rendering","text-anchor","dominant-baseline","alignment-baseline","r","cx","cy","rx","ry","x","y","d","mask","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],ee=["var","env","calc","min","max","clamp","round","mod","rem","abs","sign","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","light-dark","linear-gradient","radial-gradient","conic-gradient","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","translate","translatex","translatey","translatez","translate3d","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","matrix","matrix3d","perspective","cubic-bezier","steps","linear","repeat","minmax","fit-content","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","saturate","sepia","opacity","circle","ellipse","inset","polygon","path","xywh","rect","counter","counters","scroll","view"],te=["fill","stroke","clip-path","mask","marker","marker-start","marker-mid","marker-end","filter"],ne=["media","supports","container","keyframes"],re={position:["static","relative","absolute","sticky"],all:[],appearance:["auto","none","menulist-button","textfield"],"-webkit-appearance":["auto","none","menulist-button","textfield"]},oe=["host","host-context","slotted","part","backdrop","picker","view-transition","view-transition-group","view-transition-image-pair","view-transition-old","view-transition-new"],P=64e3,D=4e3,ie=1e5,E=512e3,nt=1e4,rt="http://www.w3.org/1999/xhtml",ot="http://www.w3.org/2000/svg",$e=new Map(Object.keys(_).map(e=>[e.toLowerCase(),e]));function ae(e){return $e.get(e.toLowerCase())}function se(e,r,n){let t=n.toLowerCase(),i=e==="html"?[T[r]?.attributes,Re]:[_[r]?.attributes,Te],o=e==="svg"&&t==="xlink:href"?"href":t;for(let a of i)if(a){for(let[u,c]of Object.entries(a))if(u.toLowerCase()===o)return{name:u,kind:c}}if(_e(t)||Pe(t))return{name:t,kind:"text"}}var f=e=>e>=48&&e<=57,le=e=>f(e)||e>=65&&e<=70||e>=97&&e<=102,F=e=>e>=65&&e<=90||e>=97&&e<=122,H=e=>e>=128,$=e=>F(e)||H(e)||e===95,ue=e=>$(e)||f(e)||e===45,de=e=>e===10,k=e=>e===10||e===9||e===32,Ne=e=>e>=0&&e<=8||e===11||e>=14&&e<=31||e===127,b=-1;function Le(e){let r=[];for(let n=0;n<e.length;n+=1){let t=e.codePointAt(n);t>65535&&(n+=1),t===13?(e.charCodeAt(n+1)===10&&(n+=1),t=10):t===12?t=10:(t===0||t>=55296&&t<=57343)&&(t=65533),r.push(t)}return r}function ze(e){let r=Le(e),n=0,t=(s=0)=>n+s<r.length?r[n+s]:b,i=[],o=(s,d)=>s===92&&d!==10&&d!==b,a=(s,d,g)=>s===45?$(d)||d===45||o(d,g):$(s)?!0:o(s,d),u=(s,d,g)=>s===43||s===45?f(d)||d===46&&f(g):f(s===46?d:s),c=()=>{let s=t();if(n+=1,s===b)return 65533;if(le(s)){let d=String.fromCodePoint(s);for(;d.length<6&&le(t());)d+=String.fromCodePoint(t()),n+=1;k(t())&&(n+=1);let g=parseInt(d,16);return g===0||g>=55296&&g<=57343||g>1114111?65533:g}return s},p=()=>{let s="";for(;;){let d=t();if(ue(d))s+=String.fromCodePoint(d),n+=1;else if(o(d,t(1)))n+=1,s+=String.fromCodePoint(c());else return s}},m=()=>{let s="";for((t()===43||t()===45)&&(s+=String.fromCodePoint(r[n++]));f(t());)s+=String.fromCodePoint(r[n++]);if(t()===46&&f(t(1)))for(s+=String.fromCodePoint(r[n++],r[n++]);f(t());)s+=String.fromCodePoint(r[n++]);if((t()===69||t()===101)&&(f(t(1))||(t(1)===43||t(1)===45)&&f(t(2))))for(s+=String.fromCodePoint(r[n++]),f(t())||(s+=String.fromCodePoint(r[n++]));f(t());)s+=String.fromCodePoint(r[n++]);return s},C=()=>{let s=m();return a(t(),t(1),t(2))?{type:"dimension",repr:s,unit:p()}:t()===37?(n+=1,{type:"percentage",repr:s}):{type:"number",repr:s}},h=()=>{for(;;){let s=t();if(n+=1,s===41||s===b)return;o(s,t())&&c()}},Se=()=>{let s="";for(;k(t());)n+=1;for(;;){let d=t();if(n+=1,d===41)return{type:"url",value:s};if(d===b)return{type:"url",value:s};if(k(d)){for(;k(t());)n+=1;return t()===41||t()===b?(t()===41&&(n+=1),{type:"url",value:s}):(h(),{type:"bad-url"})}if(d===34||d===39||d===40||Ne(d))return h(),{type:"bad-url"};if(d===92){if(o(d,t()))s+=String.fromCodePoint(c());else return h(),{type:"bad-url"};continue}s+=String.fromCodePoint(d)}},j=()=>{let s=p();if(s.toLowerCase()==="url"&&t()===40){for(n+=1;k(t())&&k(t(1));)n+=1;let d=k(t())?t(1):t();return d===34||d===39?{type:"function",value:s}:Se()}return t()===40?(n+=1,{type:"function",value:s}):{type:"ident",value:s}},Ee=s=>{let d="";for(;;){let g=t();if(n+=1,g===s||g===b)return{type:"string",value:d};if(de(g))return n-=1,{type:"bad-string"};if(g===92){if(t()===b)continue;if(de(t())){n+=1;continue}d+=String.fromCodePoint(c());continue}d+=String.fromCodePoint(g)}};for(;;){for(;t()===47&&t(1)===42;){for(n+=2;t()!==b&&!(t()===42&&t(1)===47);)n+=1;t()!==b&&(n+=2)}let s=t();if(s===b)return i;if(k(s)){for(;k(t());)n+=1;i.push({type:"whitespace"});continue}switch(n+=1,s){case 34:case 39:i.push(Ee(s));continue;case 35:if(ue(t())||o(t(),t(1))){let d=a(t(),t(1),t(2));i.push({type:"hash",value:p(),id:d})}else i.push({type:"delim",value:"#"});continue;case 40:i.push({type:"("});continue;case 41:i.push({type:")"});continue;case 43:case 46:u(s,t(),t(1))?(n-=1,i.push(C())):i.push({type:"delim",value:String.fromCodePoint(s)});continue;case 44:i.push({type:","});continue;case 45:u(s,t(),t(1))?(n-=1,i.push(C())):t()===45&&t(1)===62?(n+=2,i.push({type:"CDC"})):a(s,t(),t(1))?(n-=1,i.push(j())):i.push({type:"delim",value:"-"});continue;case 58:i.push({type:":"});continue;case 59:i.push({type:";"});continue;case 60:t()===33&&t(1)===45&&t(2)===45?(n+=3,i.push({type:"CDO"})):i.push({type:"delim",value:"<"});continue;case 64:a(t(),t(1),t(2))?i.push({type:"at-keyword",value:p()}):i.push({type:"delim",value:"@"});continue;case 91:i.push({type:"["});continue;case 92:o(s,t())?(n-=1,i.push(j())):i.push({type:"delim",value:"\\"});continue;case 93:i.push({type:"]"});continue;case 123:i.push({type:"{"});continue;case 125:i.push({type:"}"});continue;default:f(s)?(n-=1,i.push(C())):$(s)?(n-=1,i.push(j())):i.push({type:"delim",value:String.fromCodePoint(s)})}}}var ge={"{":"}","[":"]","(":")"},ye=32,U=class{constructor(r){this.tokens=r}i=0;peek(){return this.tokens[this.i]}next(){return this.tokens[this.i++]}};function be(e,r){let n=e.next();return n.type==="{"||n.type==="["||n.type==="("?{type:"block",open:n.type,value:ce(e,ge[n.type],r+1)}:n.type==="function"?{type:"func",name:n.value,value:ce(e,")",r+1)}:n}function ce(e,r,n){let t=[];for(;;){let i=e.peek();if(!i)return t;if(i.type===r)return e.next(),t;if(n>ye){e.next(),t.push({type:"bad-string"});continue}t.push(be(e,n))}}function v(e,r){let n=[],t=0;for(;t<e.length;){let i=e[t];if(i.type==="whitespace"||r&&(i.type==="CDO"||i.type==="CDC")){t+=1;continue}if(i.type==="at-keyword"){let u=[];t+=1;let c;for(;t<e.length;){let p=e[t];if(t+=1,p.type===";")break;if(p.type==="block"&&p.open==="{"){c=p.value;break}u.push(p)}n.push({type:"at-rule",name:i.value,prelude:u,...c?{block:c}:{}});continue}let o=[],a;for(;t<e.length;){let u=e[t];if(t+=1,u.type==="block"&&u.open==="{"){a=u.value;break}o.push(u)}a&&n.push({type:"qualified",prelude:o,block:a})}return n}function W(e){let r=[],n=0;for(;n<e.length;){let t=e[n];if(t.type==="whitespace"||t.type===";"){n+=1;continue}if(t.type==="at-keyword"){let o=(()=>{for(let a=n+1;a<e.length;a+=1){let u=e[a];if(u.type===";"||u.type==="block"&&u.open==="{")return a+1}return e.length})();r.push(...v(e.slice(n,o),!1)),n=o;continue}if(t.type==="ident"){let o=n+1;for(;e[o]?.type==="whitespace";)o+=1;if(e[o]?.type===":"){let a=o+1;for(;a<e.length&&e[a].type!==";";)a+=1;let u=he(t.value,e.slice(o+1,a));if(u.value.some(c=>c.type==="block"&&c.open==="{")){let c=e.findIndex((p,m)=>m>n&&p.type==="block"&&p.open==="{");r.push(...v(e.slice(n,c+1),!1)),n=c+1;continue}r.push(u),n=a+1;continue}}let i=n;for(;i<e.length&&!(e[i].type==="block"&&e[i].open==="{")&&e[i].type!==";";)i+=1;i<e.length&&e[i].type==="block"&&r.push(...v(e.slice(n,i+1),!1)),n=i+1}return r}function he(e,r){let n=[...r];for(;n[0]?.type==="whitespace";)n.shift();for(;n.at(-1)?.type==="whitespace";)n.pop();let t=!1,o=n.length-1;if(n[o]?.type==="ident"&&n[o].value.toLowerCase()==="important"){for(o-=1;n[o]?.type==="whitespace";)o-=1;let a=n[o];if(a?.type==="delim"&&a.value==="!")for(t=!0,n.length=o;n.at(-1)?.type==="whitespace";)n.pop()}return{type:"declaration",name:e,value:n,important:t}}function X(e){let r=new U(ze(e)),n=[];for(;r.peek();)n.push(be(r,0));return n}function N(e){let r="",n=[...e].map(t=>t.codePointAt(0));return n.forEach((t,i)=>{t===0?r+="\uFFFD":t>=1&&t<=31||t===127||i===0&&f(t)||i===1&&f(t)&&n[0]===45?r+=`\\${t.toString(16)} `:i===0&&t===45&&n.length===1?r+="\\-":H(t)||t===45||t===95||f(t)||F(t)?r+=String.fromCodePoint(t):r+=`\\${String.fromCodePoint(t)}`}),r}function L(e){let r="";for(let n of e){let t=n.codePointAt(0);H(t)||t===45||t===95||f(t)||F(t)?r+=n:t>=1&&t<=31||t===127?r+=`\\${t.toString(16)} `:r+=`\\${n}`}return r}function I(e){let r='"';for(let n of e){let t=n.codePointAt(0);t===0?r+="\uFFFD":t>=1&&t<=31||t===127||t===60||t===62?r+=`\\${t.toString(16)} `:t===34||t===92?r+=`\\${n}`:r+=n}return`${r}"`}function Me(e){let r=L(e);return/^[eE]([0-9]|[+-][0-9])/.test(e)?`\\${e.codePointAt(0).toString(16)} ${L(e.slice(1))}`:r}var pe=e=>{switch(e.type){case"ident":case"url":case"bad-url":case"number":case"percentage":case"dimension":case"CDC":case"hash":case"at-keyword":return e.type;case"func":case"function":return"function";case"block":return e.open==="("?"(":"other";case"(":return"(";case"delim":return`delim${e.value}`;default:return"other"}};function je(e,r){let n=["ident","function","url","bad-url","delim-","number","percentage","dimension","CDC"];return e==="ident"?[...n,"("].includes(r):e==="at-keyword"||e==="hash"||e==="dimension"||e==="delim#"||e==="delim-"?n.includes(r):e==="number"?["ident","function","url","bad-url","number","percentage","dimension","delim%"].includes(r):e==="delim@"?["ident","function","url","bad-url","delim-","CDC"].includes(r):e==="delim."||e==="delim+"?["number","percentage","dimension"].includes(r):e==="delim/"?r==="delim*":!1}function De(e){switch(e.type){case"whitespace":return" ";case"ident":return N(e.value);case"at-keyword":return`@${N(e.value)}`;case"hash":return`#${L(e.value)}`;case"string":return I(e.value);case"url":return`url(${I(e.value)})`;case"delim":return e.value==="\\"?`\\
2
+ `:e.value;case"CDO":return"<!--";case"CDC":return"-->";case"number":return e.repr;case"percentage":return`${e.repr}%`;case"dimension":return`${e.repr}${Me(e.unit)}`;case"func":return`${N(e.name)}(${O(e.value)})`;case"block":return`${e.open}${O(e.value)}${ge[e.open]}`;case":":case";":case",":case"[":case"]":case"(":case")":case"{":case"}":return e.type;default:return""}}function O(e){let r="",n;for(let t of e)t.type==="whitespace"&&n?.type==="whitespace"||(n&&je(pe(n),pe(t))&&(r+="/**/"),r+=De(t),n=t);return r}var Ve=new Set(Q),xe=new Set(ee),fe=new Set(te),Ue=new Set(ne),Ie=new Set(oe),me=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,w=e=>e.replace(/[A-Z]/g,r=>r.toLowerCase()),Be=e=>w(e);function B(e,r,n){let t=[];for(let i of r){if(i.type==="bad-url"||i.type==="bad-string"){n({reason:"unreadable",...e?{name:e}:{}});return}if(i.type==="url"){if(e&&fe.has(e)&&me.test(i.value)){t.push({type:"func",name:"url",value:[{type:"string",value:i.value}]});continue}n({reason:"url",...e?{name:e}:{}});return}if(i.type==="func"){let o=w(i.name);if(o==="url"||o==="src"){let u=i.value.filter(p=>p.type!=="whitespace"),c=u[0];if(o==="url"&&u.length===1&&c?.type==="string"&&e&&fe.has(e)&&me.test(c.value)){t.push({type:"func",name:"url",value:[{type:"string",value:c.value}]});continue}n({reason:"url",...e?{name:e}:{}});return}if(!xe.has(o)){n({reason:"function",name:o});return}let a=B(e,i.value,n);if(!a)return;o==="var"?t.push({type:"whitespace"},{type:"func",name:o,value:a},{type:"whitespace"}):t.push({type:"func",name:o,value:a});continue}if(i.type==="block"){if(i.open==="{"||i.open==="("&&t.at(-1)?.type==="ident"){n({reason:"unreadable",...e?{name:e}:{}});return}let o=B(e,i.value,n);if(!o)return;t.push({type:"block",open:i.open,value:o});continue}if(i.type==="at-keyword"||i.type==="CDO"||i.type==="CDC"||i.type==="{"||i.type==="}"||i.type===";"||i.type==="delim"&&i.value==="\\"){n({reason:"unreadable",...e?{name:e}:{}});return}t.push(i)}return t}var Ge=/^(animation|transition|scroll-behavior)/;function M(e,r,n=!1){let t=e.name.startsWith("--"),i=t?e.name:Be(e.name);if(!t&&!Ve.has(i)){r({reason:"property",name:i});return}let o=re[i];if(o){let c=e.value.filter(C=>C.type!=="whitespace"),p=c[0],m=c.length===1&&p?.type==="ident"?w(p.value):void 0;if(!m||![...o,"inherit","initial","unset","revert"].includes(m)){r({reason:"value",name:i});return}return`${i}: ${m}${e.important?" !important":""}`}let a=B(t?void 0:i,e.value,r);if(!a)return;let u=O(a).trim();return`${t?`--${L(e.name.slice(2))}`:i}: ${u}${e.important&&!(n&&Ge.test(i))?" !important":""}`}function ke(e,r){let n=t=>{for(let i=0;i<t.length;i+=1){let o=t[i];if(i>0&&t[i-1].type===":"&&(o.type==="ident"||o.type==="func")){let u=w(o.type==="ident"?o.value:o.name);if(Ie.has(u)||u.startsWith("-webkit-")||u.startsWith("-moz-"))return r({reason:"selector",name:u}),!1}if(o.type==="url"||o.type==="bad-url"||o.type==="bad-string"||o.type==="at-keyword"||o.type==="CDO"||o.type==="CDC"||o.type==="block"&&o.open==="{")return r({reason:"unreadable",name:"selector"}),!1;if(o.type==="func"&&!n(o.value)||o.type==="block"&&!n(o.value))return!1}return!0};return n(e)}function V(e,r,n){let t=[];for(let i of W(e))if(i.type==="declaration"){let o=M(i,r);o&&t.push(`${o};`)}else{let o=z(i,r,n+1,"style");o&&t.push(o)}return t.join(" ")}function Fe(e,r,n){let t=i=>i.every(o=>{if(o.type==="url"||o.type==="bad-url"||o.type==="bad-string"||o.type==="block"&&o.open==="{")return n({reason:o.type==="url"?"url":"unreadable",name:`@${r}`}),!1;if(o.type==="func"){let a=w(o.name);return r==="supports"&&a==="selector"?ke(o.value,n):xe.has(a)?t(o.value):(n({reason:"function",name:a}),!1)}if(o.type==="block"){if(r==="supports"){let a=W(o.value);if(a.length===1&&a[0].type==="declaration")return M(a[0],n)!==void 0}return t(o.value)}return!0});return t(e)?O(e).trim():void 0}function G(e){return e.map((r,n)=>{let t=e[n-1],i=t?.type===":"||t?.type==="delim"&&(t.value==="."||t.value==="|");return r.type==="ident"&&!i&&Object.prototype.hasOwnProperty.call(S,w(r.value))?{type:"block",open:"[",value:[{type:"ident",value:"data-graview-as"},{type:"delim",value:"="},{type:"string",value:w(r.value)}]}:r.type==="func"?{type:"func",name:r.name,value:G(r.value)}:r.type==="block"&&r.open==="("?{type:"block",open:"(",value:G(r.value)}:r})}function z(e,r,n,t){if(n>ye){r({reason:"unreadable",name:"nesting"});return}if(e.type==="qualified"){if(t==="keyframes"){if(!e.prelude.every(m=>m.type==="whitespace"||m.type===","||m.type==="percentage"||m.type==="ident"&&["from","to"].includes(w(m.value)))){r({reason:"unreadable",name:"keyframe"});return}return`${O(e.prelude).trim()} { ${V(e.block,r,n)} }`}if(!ke(e.prelude,r))return;let c=O(G(e.prelude)).trim();if(c===""){r({reason:"unreadable",name:"selector"});return}return`${c} { ${V(e.block,r,n)} }`}let i=w(e.name),o=i==="-webkit-keyframes"?"keyframes":i;if(!Ue.has(o)||t==="keyframes"){r({reason:"at-rule",name:`@${i}`});return}if(!e.block){r({reason:"unreadable",name:`@${i}`});return}if(o==="keyframes"){if(t!=="sheet"){r({reason:"at-rule",name:"@keyframes"});return}let c=e.prelude.filter(h=>h.type!=="whitespace"),p=c[0];if(c.length!==1||!p||p.type!=="ident"&&p.type!=="string"){r({reason:"unreadable",name:"@keyframes"});return}let m=v(e.block,!1).map(h=>z(h,r,n+1,"keyframes")).filter(h=>h!==void 0);return`@keyframes ${p.type==="ident"?N(p.value):I(p.value)} { ${m.join(" ")} }`}let a=Fe(e.prelude,o,r);if(a===void 0)return;let u=t==="style"?V(e.block,r,n):v(e.block,!1).map(c=>z(c,r,n+1,"sheet")).filter(c=>c!==void 0).join(" ");return`@${o} ${a} { ${u} }`}function He(e,r=P){let n=[];if(e.length>r)return{css:"",refused:[{reason:"size"}]};let t=o=>void n.push(o);return{css:v(X(e),!0).map(o=>z(o,t,0,"sheet")).filter(o=>o!==void 0).join(`
3
+ `),refused:n}}function st(e,r=P){let n=[],t=[],i=0;for(let o of e){if(i+o.length>r){t.push({reason:"size"});continue}i+=o.length;let a=He(o,r);a.css&&n.push(a.css),t.push(...a.refused)}return{css:n.join(`
4
+ `),refused:t}}function we(e,r=P){let n=[];if(e.length>r)return{css:"",refused:[{reason:"size"}]};let t=o=>void n.push(o),i=[];for(let o of W(X(e))){if(o.type!=="declaration"){t({reason:"unreadable",name:"a rule in a style attribute"});continue}let a=M(o,t,!0);a&&i.push(a)}return{css:i.join("; "),refused:n}}function Ce(e,r){let n,t=M(he(e,X(r)),i=>n??=i);return t===void 0||n?{refused:n??{reason:"unreadable",name:e}}:{value:t.slice(t.indexOf(":")+1).trim()}}function ct(e,r){if(r==="svg"){let t=ae(e);return t?{namespace:"svg",name:t}:{refused:{reason:"element",element:e}}}let n=e.toLowerCase();return n==="svg"?{namespace:"svg",name:"svg"}:Object.prototype.hasOwnProperty.call(T,n)?Object.prototype.hasOwnProperty.call(S,n)?{namespace:"html",name:S[n],as:n}:{namespace:"html",name:n}:{refused:{reason:"element",element:e}}}function pt(e,r){return(e==="html"?T[r]:_[r])?.empty===!0}var We=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/,Xe=/^[0-9A-Za-z\s.,+\-%()]*$/,qe=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,Ye=/^data:image\/(png|gif|jpeg|webp|avif|bmp|svg\+xml)(;[A-Za-z0-9=._+-]+)*,/i,Ke=/^\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,ve=/\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,Ze=/^\/(?!\/)(?!(?:.*\/)?\.\.?(?:\/|$))(?!.*%(?:2e|2f|5c))[^\\\s?#"'<>]*$/i;function Je(e,r){if(Ke.test(e))return e;let n=e;if(/^https?:\/\//i.test(e))try{let t=new URL(e);if(r==="null"||t.origin!==r||t.username!==""||t.password!==""||t.search!==""||t.hash!=="")return;n=e.slice(t.origin.length)}catch{return}if(Ze.test(n))return ve.exec(n)?.[0]}function ft(e,r={},n){let t=e.length>120?`${e.slice(0,119)}\u2026`:e,i=Oe(r.origins),o=ve.exec(e.split(/[?#]/)[0])?.[0],a=n!==void 0&&n>E?` It is a data: image of ${n.toLocaleString("en-US")} characters, more than the ${E.toLocaleString("en-US")} a view's own data: image may be. A picture on a record is drawn at any size by the src the host hands the view (pictures in its manifest), used as it was handed.`:o?r.assets?` It is the app's own image only by its path, or under the app's base on this page's origin: write it as its path, ${o}.`:" This host has not said where the app's own images live (asset, on the view's definition), so a view here cannot draw one by its path.":/^https:\/\//i.test(e)?i.length>0?` Its origin is not one the host lists for images (${i.join(", ")}).`:" The host lists no origin a view's images may come from (images.origins, on the view's definition).":"",u=["a data: image",...r.assets?["the app's own image by the path add_image answered (/graview/assets/<sha256>.<ext>)"]:[],"a picture on a record (pictures in its manifest)",...i.length>0?[`an https: image from ${i.join(", ")}`]:[]];return`The image "${t}" was not drawn.${a} A view here shows ${u.slice(0,-1).join(", ")} or ${u[u.length-1]}.`}function Oe(e){return(e??[]).flatMap(r=>{try{let n=new URL(r);return n.protocol==="https:"&&n.hostname!==""&&n.username===""&&n.password===""?[n.origin]:[]}catch{return[]}})}function Qe(e,r){if(!(!r||r.length===0||!/^https:\/\//i.test(e)))try{let n=new URL(e);return n.protocol!=="https:"||n.username!==""||n.password!==""?void 0:Oe(r).includes(n.origin)?n.href:void 0}catch{return}}function mt(e,r,n,t,i){let o=se(e,r,n);if(!o)return{refused:{reason:"attribute",element:r,name:n}};if(e==="html"&&J[r]?.includes(o.name))return{refused:{reason:"attribute",element:r,name:n}};if(t===null)return{name:o.name,value:null};let a=et(o.name,o.kind,t,i);return"refused"in a?{refused:{...a.refused,element:r,...o.kind==="image"&&a.refused.reason==="url"?{address:t.slice(0,200),...t.length>E?{length:t.length}:{}}:{},...o.kind==="link"?{address:t.slice(0,200)}:{}}}:o.name==="role"&&a.value.split(/\s+/).some(u=>Z.includes(u.toLowerCase()))?{refused:{reason:"value",element:r,name:n}}:o.name==="aria-live"&&!["polite","off"].includes(a.value.toLowerCase())?{refused:{reason:"value",element:r,name:n}}:{name:o.name,value:a.value,...a.dropped?{dropped:a.dropped.map(u=>({reason:u.reason==="url"?"url":"css",element:r,name:o.name,css:u}))}:{}}}function et(e,r,n,t){let i=(o,a)=>({refused:{reason:o,name:e,...a?{css:a}:{}}});if(r==="geometry")return n.length>ie||!Xe.test(n)||/url/i.test(n)?i("value"):{value:n};if(r==="image"){let o=t.picture?.(n);if(o!==void 0)return{value:o};if(n.length>E)return i("url");if(Ye.test(n))return{value:n};if(n.startsWith(`blob:${t.origin}/`)&&/^blob:[^\s"'<>]+$/.test(n))return{value:n};let a=t.asset?Je(n,t.origin):void 0;if(a!==void 0){let c=t.asset(a);if(c)return{value:c}}let u=Qe(n,t.imageOrigins);return u?{value:u}:i("url")}if(r==="link"){let o=t.link?.(n);return o===void 0?i("url"):{value:o}}if(n.length>D)return i("value");if(typeof r=="object"){let o=r.oneOf.find(a=>a.toLowerCase()===n.toLowerCase());return o===void 0?i("value"):{value:o}}switch(r){case"text":return{value:n};case"number":return We.test(n.trim())&&Number.isFinite(Number(n))?{value:n.trim()}:i("value");case"boolean":return{value:""};case"fragment":return qe.test(n)?{value:n}:i("url");case"style":{let o=we(n,D);return o.refused.length>0&&o.css===""?i(o.refused[0].reason==="url"?"url":"css",o.refused[0]):{value:o.css,...o.refused.length>0?{dropped:o.refused}:{}}}case"css":{let o=Ce(e,n);return"refused"in o?i(o.refused.reason==="url"?"url":"css",o.refused):{value:o.value}}}}export{tt as a,nt as b,rt as c,ot as d,st as e,ct as f,pt as g,ft as h,mt as i};