graview 0.1.66 → 0.1.67

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 (197) hide show
  1. package/dist/preview/{chunk.LSN2IPAI.js → chunk.25QFDTCU.js} +1 -1
  2. package/dist/preview/{chunk.BFAFCVL4.js → chunk.264PB572.js} +1 -1
  3. package/dist/preview/chunk.2FHIINXG.js +2 -0
  4. package/dist/preview/{chunk.HSSIMVVM.js → chunk.2VUX54XH.js} +1 -1
  5. package/dist/preview/{chunk.CTASTRQN.js → chunk.35KMZHB7.js} +1 -1
  6. package/dist/preview/{chunk.OWFS2YDQ.js → chunk.37RFCHSS.js} +1 -1
  7. package/dist/preview/chunk.3ENPWZBG.js +1 -0
  8. package/dist/preview/{chunk.XMQG2PSM.js → chunk.3GNT5MKP.js} +1 -1
  9. package/dist/preview/{chunk.BXBEGMPO.js → chunk.3NSV3WKM.js} +2 -2
  10. package/dist/preview/chunk.3ZODN6BW.js +1 -0
  11. package/dist/preview/{chunk.OPTYYIGC.js → chunk.47XEJZ3O.js} +1 -1
  12. package/dist/preview/{chunk.5FNFRVTL.js → chunk.4EMKCKDB.js} +1 -1
  13. package/dist/preview/{chunk.B6JRTW3A.js → chunk.4UUJHLHR.js} +1 -1
  14. package/dist/preview/{chunk.FBILPNGH.js → chunk.4W57E7AX.js} +1 -1
  15. package/dist/preview/chunk.55G4IPOO.js +1 -0
  16. package/dist/preview/{chunk.72XP2ARZ.js → chunk.5AKZROMR.js} +1 -1
  17. package/dist/preview/chunk.5J6DVR7S.js +1 -0
  18. package/dist/preview/{chunk.FXT5CN32.js → chunk.5R744JGZ.js} +1 -1
  19. package/dist/preview/{chunk.NJRLJEJY.js → chunk.6KJGRM7A.js} +1 -1
  20. package/dist/preview/{chunk.4AC2QM7T.js → chunk.6N4PE3U5.js} +1 -1
  21. package/dist/preview/{chunk.LGRVEHXT.js → chunk.6NG76MDA.js} +2 -2
  22. package/dist/preview/{chunk.4FCFNAA4.js → chunk.6SJEZWH3.js} +1 -1
  23. package/dist/preview/{chunk.7VADSNPZ.js → chunk.6UQFV53C.js} +1 -1
  24. package/dist/preview/{chunk.WAB3L3ZI.js → chunk.6W6XMLSF.js} +1 -1
  25. package/dist/preview/{chunk.4JULYKGD.js → chunk.77C556NM.js} +1 -1
  26. package/dist/preview/{chunk.IGK7EZCX.js → chunk.7ARRVNUR.js} +1 -1
  27. package/dist/preview/{chunk.CBXS23YH.js → chunk.7BJRHPE3.js} +2 -2
  28. package/dist/preview/{chunk.ZQR2SN65.js → chunk.7S6ZRMW4.js} +1 -1
  29. package/dist/preview/{chunk.IAEHUSQQ.js → chunk.7UHPHEH5.js} +1 -1
  30. package/dist/preview/chunk.7WHQWLL6.js +1 -0
  31. package/dist/preview/{chunk.KACSYPEV.js → chunk.A4EZAGG7.js} +1 -1
  32. package/dist/preview/chunk.A5PSEU3W.js +25 -0
  33. package/dist/preview/{chunk.VKZIEZ5C.js → chunk.A7GVTE5Y.js} +2 -2
  34. package/dist/preview/{chunk.45JP6VGJ.js → chunk.AJMVRFYX.js} +2 -2
  35. package/dist/preview/{chunk.6P6NGZ6D.js → chunk.AKJS2NUM.js} +1 -1
  36. package/dist/preview/{chunk.CU2WCYMK.js → chunk.ARWO4WOV.js} +1 -1
  37. package/dist/preview/chunk.B5SJMCTT.js +7 -0
  38. package/dist/preview/{chunk.JXNVNFV4.js → chunk.B7KZBT27.js} +1 -1
  39. package/dist/preview/{chunk.E3UL4MCD.js → chunk.BDNQMKDG.js} +1 -1
  40. package/dist/preview/{chunk.YNEHJWJV.js → chunk.BKYZSV2Y.js} +1 -1
  41. package/dist/preview/{chunk.5BX66FBP.js → chunk.CKDCTFLU.js} +1 -1
  42. package/dist/preview/chunk.CTUJZ3IV.js +1 -0
  43. package/dist/preview/chunk.CY7FFKEZ.js +1 -0
  44. package/dist/preview/{chunk.3PBTN7RO.js → chunk.D4WJ7OM5.js} +1 -1
  45. package/dist/preview/{chunk.C2C3AXGI.js → chunk.D7NWMXSX.js} +3 -3
  46. package/dist/preview/chunk.DEKRFTRN.js +4 -0
  47. package/dist/preview/{chunk.E7EWNWAN.js → chunk.DKEIEH2D.js} +1 -1
  48. package/dist/preview/{chunk.I2737CPF.js → chunk.DWM7AR5Y.js} +1 -1
  49. package/dist/preview/{chunk.ANS2IEEV.js → chunk.DZMIYEHQ.js} +1 -1
  50. package/dist/preview/{chunk.BMENTGDC.js → chunk.E5PYNAYT.js} +2 -2
  51. package/dist/preview/chunk.EBKH3ILT.js +1 -0
  52. package/dist/preview/{chunk.DTCAUPLC.js → chunk.EFVSZKB5.js} +1 -1
  53. package/dist/preview/{chunk.QOS5T46W.js → chunk.EGPCVMDU.js} +1 -1
  54. package/dist/preview/{chunk.7ZKBYXUM.js → chunk.EJ2EZL2G.js} +1 -1
  55. package/dist/preview/{chunk.7VP6Y6D2.js → chunk.EP6Q32WT.js} +1 -1
  56. package/dist/preview/{chunk.OOSIKCOS.js → chunk.F464JKHZ.js} +1 -1
  57. package/dist/preview/{chunk.VGHO3VCB.js → chunk.FLJXYESX.js} +1 -1
  58. package/dist/preview/chunk.FOUBDGL3.js +1 -0
  59. package/dist/preview/chunk.FPHRAO3R.js +1 -0
  60. package/dist/preview/{chunk.4FDVINRJ.js → chunk.FRQSLWP4.js} +1 -1
  61. package/dist/preview/{chunk.2MHNPBHC.js → chunk.FVQKSN33.js} +1 -1
  62. package/dist/preview/{chunk.PDDIQ6PK.js → chunk.G3GFDVO2.js} +1 -1
  63. package/dist/preview/{chunk.ZD7T234N.js → chunk.G5GVT6JY.js} +1 -1
  64. package/dist/preview/{chunk.3L4JMM3P.js → chunk.GFLH7RCI.js} +1 -1
  65. package/dist/preview/{chunk.OO2OP76C.js → chunk.GMLONS5L.js} +1 -1
  66. package/dist/preview/{chunk.FK722SHI.js → chunk.GRFD42WM.js} +1 -1
  67. package/dist/preview/{chunk.2VR7YEJ6.js → chunk.GVT4UUQA.js} +1 -1
  68. package/dist/preview/{chunk.GME63ZHI.js → chunk.H3EGBDW2.js} +1 -1
  69. package/dist/preview/{chunk.DQFHIJFN.js → chunk.H6KIEDZN.js} +1 -1
  70. package/dist/preview/{chunk.5B5SRTUK.js → chunk.HAOB6O72.js} +1 -1
  71. package/dist/preview/chunk.HB5NWHFP.js +3 -0
  72. package/dist/preview/{chunk.6EHHMWPP.js → chunk.HJUZMOW2.js} +1 -1
  73. package/dist/preview/{chunk.6MQ5NT7S.js → chunk.HN4ZJ4B4.js} +1 -1
  74. package/dist/preview/chunk.HVBKI5ZO.js +1 -0
  75. package/dist/preview/chunk.I3SDKMQS.js +1 -0
  76. package/dist/preview/{chunk.QQAZQDRW.js → chunk.IAEGJDF3.js} +1 -1
  77. package/dist/preview/{chunk.QWNSHISU.js → chunk.IDALEKIW.js} +1 -1
  78. package/dist/preview/{chunk.QFHWG4LN.js → chunk.ILJDLBPJ.js} +1 -1
  79. package/dist/preview/{chunk.ZR2TP3BF.js → chunk.J2OPIS3H.js} +1 -1
  80. package/dist/preview/chunk.J5OLYVZ4.js +1 -0
  81. package/dist/preview/{chunk.LETAQTLJ.js → chunk.J6HF7IRQ.js} +1 -1
  82. package/dist/preview/{chunk.RWIN3POV.js → chunk.JEC5FDKX.js} +1 -1
  83. package/dist/preview/chunk.JKFVNQY7.js +1 -0
  84. package/dist/preview/{chunk.LLIURXFP.js → chunk.JQ2WNKDW.js} +1 -1
  85. package/dist/preview/{chunk.Z7Y3R3YR.js → chunk.JQ63N4MZ.js} +1 -1
  86. package/dist/preview/{chunk.DZFM6GSY.js → chunk.JU6UFWS3.js} +1 -1
  87. package/dist/preview/{chunk.INHS3KTK.js → chunk.JVB5KDSG.js} +1 -1
  88. package/dist/preview/{chunk.4U4D7WOI.js → chunk.KFT7JIEH.js} +1 -1
  89. package/dist/preview/chunk.KGMSSXZL.js +1 -0
  90. package/dist/preview/{chunk.5CXIEYHY.js → chunk.KX5ZBHMA.js} +2 -2
  91. package/dist/preview/{chunk.V7W5AQKL.js → chunk.LP2ZMAT2.js} +1 -1
  92. package/dist/preview/{chunk.BUVTUAB5.js → chunk.LRNFE3UK.js} +1 -1
  93. package/dist/preview/{chunk.PAGEGBUD.js → chunk.LVOTLGJB.js} +1 -1
  94. package/dist/preview/{chunk.QHMHUL6B.js → chunk.LYEGRY77.js} +1 -1
  95. package/dist/preview/{chunk.PPSYUOH7.js → chunk.M7KXQGQL.js} +1 -1
  96. package/dist/preview/{chunk.7BIPZTJB.js → chunk.MAKCZ6B6.js} +1 -1
  97. package/dist/preview/{chunk.EQ4OODGO.js → chunk.MJY4SLWA.js} +1 -1
  98. package/dist/preview/{chunk.EMFOMSMI.js → chunk.MSAYU25L.js} +1 -1
  99. package/dist/preview/{chunk.F4VB6Q2W.js → chunk.MUSMNKE4.js} +1 -1
  100. package/dist/preview/{chunk.BGAC3B7X.js → chunk.MW7R5G3C.js} +1 -1
  101. package/dist/preview/{chunk.AK7NGFEX.js → chunk.N4ZKZ4GM.js} +1 -1
  102. package/dist/preview/{chunk.TXHYGFIZ.js → chunk.NAXOXBOF.js} +1 -1
  103. package/dist/preview/{chunk.IWYMKGZZ.js → chunk.NKLPL7QD.js} +1 -1
  104. package/dist/preview/{chunk.QU52E5RG.js → chunk.NKYWIGC7.js} +1 -1
  105. package/dist/preview/{chunk.KSIEO5W7.js → chunk.NRURQGXV.js} +1 -1
  106. package/dist/preview/{chunk.FV72U33M.js → chunk.NSOPYIT4.js} +1 -1
  107. package/dist/preview/chunk.NXZL5CA2.js +1 -0
  108. package/dist/preview/{chunk.WVLEGCRI.js → chunk.O2OL6RQQ.js} +1 -1
  109. package/dist/preview/{chunk.TGEL6EUA.js → chunk.O5VFKVZS.js} +1 -1
  110. package/dist/preview/{chunk.CEVGND3Y.js → chunk.OCXY5DCD.js} +3 -3
  111. package/dist/preview/chunk.OHAO6KKH.js +1 -0
  112. package/dist/preview/{chunk.DSYP43NN.js → chunk.P2EKKKK2.js} +1 -1
  113. package/dist/preview/chunk.PSNMZBVS.js +1 -0
  114. package/dist/preview/{chunk.W53YNBSM.js → chunk.PZ7KY6XH.js} +1 -1
  115. package/dist/preview/{chunk.WSO7JOW5.js → chunk.QAM76AXV.js} +1 -1
  116. package/dist/preview/{chunk.PSQYDCVM.js → chunk.QF5QB5YR.js} +1 -1
  117. package/dist/preview/chunk.QNP5OR3P.js +93 -0
  118. package/dist/preview/{chunk.5LJVOLKR.js → chunk.QRQ5WPZI.js} +1 -1
  119. package/dist/preview/chunk.QWGWOEBZ.js +90 -0
  120. package/dist/preview/{chunk.OMT4QUZY.js → chunk.QXLJGHMC.js} +4 -4
  121. package/dist/preview/{chunk.J2MM6BUW.js → chunk.QZQCQWQG.js} +1 -1
  122. package/dist/preview/{chunk.6FQW6FNL.js → chunk.R6JBA7UK.js} +1 -1
  123. package/dist/preview/chunk.R7CRBRD4.js +1 -0
  124. package/dist/preview/chunk.RD2FSSLV.js +1 -0
  125. package/dist/preview/{chunk.OEIWIZCP.js → chunk.RG5G6YQD.js} +1 -1
  126. package/dist/preview/{chunk.PFQBCHQA.js → chunk.RJY7VJBH.js} +1 -1
  127. package/dist/preview/chunk.RR25BGWP.js +1 -0
  128. package/dist/preview/{chunk.BZ7QWHAE.js → chunk.RSQ432QN.js} +1 -1
  129. package/dist/preview/{chunk.MWGZKZD6.js → chunk.SFBHPYRD.js} +1 -1
  130. package/dist/preview/{chunk.FFOD5B4B.js → chunk.SJQPTDAT.js} +1 -1
  131. package/dist/preview/{chunk.OTV5XTBB.js → chunk.SNHKYH72.js} +1 -1
  132. package/dist/preview/{chunk.WSDJPXJD.js → chunk.SO6NT5K7.js} +1 -1
  133. package/dist/preview/{chunk.FDZE5LTJ.js → chunk.STPA7HBK.js} +2 -2
  134. package/dist/preview/{chunk.ONYBW45K.js → chunk.SY5ID44D.js} +1 -1
  135. package/dist/preview/chunk.T27QKVKP.js +1 -0
  136. package/dist/preview/{chunk.U6TEW6YD.js → chunk.T2OUHRAA.js} +1 -1
  137. package/dist/preview/chunk.T3WCRS6M.js +1 -0
  138. package/dist/preview/{chunk.QGIM2WAY.js → chunk.TI5FR2QQ.js} +1 -1
  139. package/dist/preview/{chunk.HOCD7KIR.js → chunk.TTSGCNPT.js} +1 -1
  140. package/dist/preview/{chunk.ES63XSIM.js → chunk.TXZQEJ5T.js} +1 -1
  141. package/dist/preview/{chunk.6LXIEM6B.js → chunk.UDHPMVC4.js} +1 -1
  142. package/dist/preview/{chunk.KBPJ7X7W.js → chunk.UGQYMN4J.js} +1 -1
  143. package/dist/preview/{chunk.M6ZN2KUO.js → chunk.UQIPEMJ5.js} +1 -1
  144. package/dist/preview/{chunk.FIFUMX5X.js → chunk.URQTF5SY.js} +1 -1
  145. package/dist/preview/{chunk.J7W2OFHY.js → chunk.UW52CMGJ.js} +1 -1
  146. package/dist/preview/{chunk.LINSO5PN.js → chunk.UWS4RMM3.js} +1 -1
  147. package/dist/preview/{chunk.QPF4KSAW.js → chunk.V7H4BUEB.js} +1 -1
  148. package/dist/preview/{chunk.KHRS2SKB.js → chunk.VBHV4TLG.js} +1 -1
  149. package/dist/preview/{chunk.U3ED7W2U.js → chunk.VBLQJVQ5.js} +1 -1
  150. package/dist/preview/{chunk.CVPMSPCH.js → chunk.WALVW3KJ.js} +1 -1
  151. package/dist/preview/{chunk.2KFZHUAC.js → chunk.WEMUKZKH.js} +1 -1
  152. package/dist/preview/{chunk.YIPXZUTT.js → chunk.X226YATK.js} +1 -1
  153. package/dist/preview/{chunk.GNEOSHQ6.js → chunk.XFLGSUYO.js} +1 -1
  154. package/dist/preview/{chunk.W4YDPHCQ.js → chunk.XSWSBTUO.js} +1 -1
  155. package/dist/preview/{chunk.OJY7VJ7D.js → chunk.YCD4JSXD.js} +1 -1
  156. package/dist/preview/{chunk.72ZCLEQC.js → chunk.YZPESGCP.js} +1 -1
  157. package/dist/preview/{chunk.XOE4KNP2.js → chunk.Z27NSSYL.js} +2 -2
  158. package/dist/preview/{chunk.DEHIR4EG.js → chunk.Z2XUVJAL.js} +1 -1
  159. package/dist/preview/{chunk.YXEO3Y65.js → chunk.Z3O2VZAJ.js} +1 -1
  160. package/dist/preview/{chunk.M2JCFNHJ.js → chunk.Z4TY44CD.js} +1 -1
  161. package/dist/preview/{chunk.EXYCN4WI.js → chunk.ZAPS4J6G.js} +1 -1
  162. package/dist/preview/{chunk.6TLXFMX2.js → chunk.ZAQ4IDX6.js} +1 -1
  163. package/dist/preview/{chunk.6HY6ZGEE.js → chunk.ZEZUKRC6.js} +1 -1
  164. package/dist/preview/{chunk.GEFXU4VO.js → chunk.ZG5VGP5U.js} +1 -1
  165. package/dist/preview/index.html +56 -56
  166. package/dist/preview/page.js +2 -2
  167. package/package.json +6 -6
  168. package/dist/preview/chunk.4WGYUYWU.js +0 -2
  169. package/dist/preview/chunk.5EMIWORS.js +0 -1
  170. package/dist/preview/chunk.6EVMXBNB.js +0 -1
  171. package/dist/preview/chunk.BCQWAFGD.js +0 -1
  172. package/dist/preview/chunk.BOCVLC7X.js +0 -1
  173. package/dist/preview/chunk.DPJNGFEZ.js +0 -4
  174. package/dist/preview/chunk.E4VRRWFP.js +0 -1
  175. package/dist/preview/chunk.EUAO4QNV.js +0 -1
  176. package/dist/preview/chunk.F7672TKJ.js +0 -1
  177. package/dist/preview/chunk.FA42HCPW.js +0 -1
  178. package/dist/preview/chunk.FBJAQPZ6.js +0 -1
  179. package/dist/preview/chunk.GAFMWOME.js +0 -1
  180. package/dist/preview/chunk.I4Z7HVRT.js +0 -1
  181. package/dist/preview/chunk.JMXXA4YG.js +0 -1
  182. package/dist/preview/chunk.JMYUQNXN.js +0 -6
  183. package/dist/preview/chunk.K6DFXDPZ.js +0 -1
  184. package/dist/preview/chunk.KF27ME27.js +0 -1
  185. package/dist/preview/chunk.L25DCT5S.js +0 -1
  186. package/dist/preview/chunk.MODLZJD4.js +0 -25
  187. package/dist/preview/chunk.OJGHDWI6.js +0 -1
  188. package/dist/preview/chunk.SSF47GUY.js +0 -1
  189. package/dist/preview/chunk.T6DPWW2K.js +0 -3
  190. package/dist/preview/chunk.TA36WBHK.js +0 -1
  191. package/dist/preview/chunk.TTGKX7LT.js +0 -1
  192. package/dist/preview/chunk.U3HERHAI.js +0 -88
  193. package/dist/preview/chunk.V5I4GZEY.js +0 -1
  194. package/dist/preview/chunk.VT2YGDK2.js +0 -1
  195. package/dist/preview/chunk.XK65Y2KX.js +0 -1
  196. package/dist/preview/chunk.Z274CL7J.js +0 -1
  197. package/dist/preview/chunk.ZBVYD4OX.js +0 -90
@@ -1 +1 @@
1
- import{d as K}from"./chunk.B6JRTW3A.js";import{Fb as h,Gb as v,Hc as $,Ic as N,Nb as V,h as P,k as R,pc as Y,q as I,qb as G,qc as X,tc as B,ua as q,x as _}from"./chunk.6HY6ZGEE.js";import{a as T,c as C,h as L}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var te=Symbol.for("@graview/core:markdown"),ne=500;function ie(e){let n=e;for(let i=0;i<6;i++){let t=N(n);if(!t)return!1;if(t[$]!==void 0)return t[$]===1;if(t[te]===1)return!0;if(t.type==="string")return(t.checks??[]).some(s=>{let f=N(s);return f?.check==="max_length"&&(f.maximum??0)>ne});if(t.innerType===void 0)return!1;n=t.innerType}return!1}function O(e,n,i){if(n===void 0||i==="id"||i==="kind")return!1;let t=e.tryDefinition(n)?.fields?.shape;return!!t&&Object.prototype.hasOwnProperty.call(t,i)&&ie(t[i])}var re=e=>e>=55296&&e<=56319,oe=e=>e>=56320&&e<=57343;function S(e,n){let i=Math.min(e.length,n.length),t=0;for(;t<i&&e.charCodeAt(t)===n.charCodeAt(t);)t++;t>0&&re(e.charCodeAt(t-1))&&t--;let s=0;for(;s<i-t&&e.charCodeAt(e.length-1-s)===n.charCodeAt(n.length-1-s);)s++;return s>0&&oe(e.charCodeAt(e.length-s))&&s--,{at:t,removed:e.slice(t,e.length-s),inserted:n.slice(t,n.length-s)}}var w=e=>e.at+e.removed.length;function H(e){let n=S(e.removed,e.inserted);return{...n,at:e.at+n.at}}function U(e,n,i){if(w(e)<n.at)return e;if(e.at>w(n))return{...e,at:e.at+n.inserted.length-n.removed.length};let t=Math.min(e.at,n.at),s=w(e)-w(n),f=e.removed.slice(0,n.at-t)+n.inserted+(s>0?e.removed.slice(e.removed.length-s):""),r=n.at<e.at||n.at===e.at&&i;return H({at:t,removed:f,inserted:r?n.inserted+e.inserted:e.inserted+n.inserted})}function b(e,n){return[U(e,n,!1),U(n,e,!0)]}function D(e,n){let i=e.at+e.inserted.length;if(w(n)<e.at||n.at>i)return;let t=Math.min(e.at,n.at),s=w(n)-i,f=n.removed.slice(0,e.at-t),r=s>0?n.removed.slice(n.removed.length-s):"",l=T(f+e.inserted+r,{...n,at:n.at-t});return H({at:t,removed:f+e.removed+r,inserted:l})}function M(e,n,i){switch(e.op){case"patch-node":return e.id===n&&Object.prototype.hasOwnProperty.call(e.after,i);case"add-node":case"remove-node":return e.node.id===n;default:return!1}}function j(e,n,i){if(e.op!=="patch-node"||e.id!==n||!Object.prototype.hasOwnProperty.call(e.after,i))return;let t=e.before[i],s=e.after[i];return typeof s=="string"&&(t===void 0||t===""||C(t))?{at:0,removed:"",inserted:s}:void 0}var J=(e,n,i)=>e.flatMap(t=>t.op==="splice-text"&&t.id===n&&t.field===i?[t]:[]);function E(e,n,i,t,s,f){if(typeof f!="string"||s<n-1)return;let r=[];for(let o of e)if(!(o.seq<=s))for(let p of o.primitives){let a=j(p,i,t);if(a){r.push(a);continue}if(M(p,i,t))return;p.op==="splice-text"&&p.id===i&&p.field===t&&r.push(p)}let l=f;try{for(let o=r.length-1;o>=0;o--){let p=r[o];l=T(l,{at:p.at,removed:p.inserted,inserted:p.removed})}}catch{return}return{then:l,since:r}}function A(e,n){let i=e;for(let t of n)i=b(t,i)[1];return{at:i.at,removed:i.removed,inserted:i.inserted}}function Q(e,n,i){let t=i?A(S(i.then,n),i.since):S(e,n);return t.removed===""&&t.inserted===""?void 0:t}function Z(e){let n=e.schema,i=t=>{throw new V(t,"invalid")};return{name:h,title:"Type text",input:I({node:P(),field:P(),at:R(),remove:R(),insert:P(),rev:_(R())}),subject:{kinds:"*",arg:"node"},writes:[],describe:(t,s)=>{let{node:f,field:r,insert:l,remove:o}=t;return K({node:f,field:r,inserted:[...String(l??"")].length,removed:Number(o)||0},n,s)},apply(t,s){let{node:f,field:r,at:l,remove:o,insert:p,rev:a}=s;(![l,o,a??0].every(k=>Number.isInteger(k)&&k>=-1)||l<0||o<0)&&i("at and remove are whole numbers, none below 0, and rev a revision");let d=t.graph.getNode(f);if(!d)throw new G(f,"\u201CType text\u201D names a record that is not there.");if(O(n,d.kind,r)||i(`${q(n.tryDefinition(d.kind),d.kind)}'s "${r}" is not text typed together: write it whole, as its edit does`),o===0&&p==="")return;let c=d[r];if(typeof c!="string"||c===""){t.patchNode(f,{[r]:p});return}let g=e.graph.getNode(f)?.[r],m=a===void 0?{then:c,since:[]}:E(e.log.all(),e.log.horizon,f,r,Math.max(a,-1),g);m||i(`${r} was written whole since revision ${a}: read it again and type over what it holds now`);let{then:u,since:y}=m;l+o>u.length&&i(`${r} held ${u.length} characters at revision ${a??"now"}, so there is nothing at ${l}${o>0?`\u2013${l+o}`:""} to type over`);let x=A({at:l,removed:u.slice(l,l+o),inserted:p},y);x.removed===""&&x.inserted===""||t.emit({op:"splice-text",id:f,field:r,...x})}}}function ee(e,n,i,t,s=()=>!0){let f=i===void 0?void 0:e.tryDefinition(i);if(!f||typeof t!="string")return[];let r=new Set;for(let l of n)if(!(l.name===h||!Y(e,l).includes(i)||!X(l,f).includes(t))&&s(l)){r.add(l.name);for(let o of B(e,n,l)??[])r.add(o)}return[...r]}function se(e,n,i){if(!n.some(r=>r.op==="patch-node"))return[...n];let t=new Set,s=new Set,f=[];for(let r of n){if(r.op==="add-node"&&t.add(r.node.id),r.op!=="patch-node"||t.has(r.id)){r.op==="splice-text"&&s.add(`${r.id}\0${r.field}`),f.push(r);continue}let l=e.graph.getNode(r.id),o={},p={},a=[];for(let[d,c]of Object.entries(r.after)){let g=l?.[d],m=`${r.id}\0${d}`;if(typeof c=="string"&&typeof g=="string"&&g!==""&&!s.has(m)&&O(e.schema,l?.kind,d)){let u=i?.find(x=>x.node===r.id&&x.field===d),y=Q(g,c,u?E(e.log.all(),e.log.horizon,r.id,d,u.rev,g):void 0);if(y){a.push({op:"splice-text",id:r.id,field:d,...y}),s.add(m);continue}}o[d]=r.before[d],p[d]=c,s.add(m)}Object.keys(p).length>0&&f.push(a.length>0?{op:"patch-node",id:r.id,before:o,after:p}:r),f.push(...a)}return f}function de(e,n){let i=[];return[...n].sort((t,s)=>s.seq-t.seq).map(t=>{let s=L(t);if(!s.some(o=>o.op==="splice-text"))return i.push(...s),{op:t,primitives:s};let f=e.filter(o=>o.seq>t.seq).flatMap(o=>o.primitives),r=t.primitives.length,l=[];return s.forEach((o,p)=>{if(o.op!=="splice-text")return void l.push(o);let a=A(o,J([...t.primitives.slice(r-p),...f,...i,...l],o.id,o.field));(a.removed!==""||a.inserted!=="")&&l.push({op:"splice-text",id:o.id,field:o.field,...a})}),i.push(...l),{op:t,primitives:l}})}function ae(e,n){let i=(t,s)=>e.some(f=>M(f,t,s));return n.undoes!==void 0&&n.primitives.length===0&&e.some(t=>t.op==="splice-text")||n.primitives.length>0&&n.primitives.every(t=>t.op==="splice-text"&&!i(t.id,t.field))?!0:e.flatMap(t=>t.op==="splice-text"&&n.primitives.some(s=>M(s,t.id,t.field))?[t.id]:[])}function le(e,n,i){let t=new Map,s=[],f=new Set;for(let a of e){let d=a.primitives[0],c=a.mutation?.args,g=a.mutation?.name!==h||a.primitives.length!==1||!d?void 0:d.op==="splice-text"?d:j(d,String(c?.node),String(c?.field));g?s.push({batch:a.batch,node:String(c?.node),field:String(c?.field),splice:g}):f.add(a.batch)}if(s.length===0)return t;let r=a=>`${a.node}\0${a.field}`,l=new Set,o=new Set(e.map(a=>a.batch).filter(a=>!i.includes(a))),p=s;for(let a of n){if(o.has(a.batch)){p=p.filter(d=>d.batch!==a.batch);continue}for(let d of a.primitives){if(d.op==="add-edge"||d.op==="remove-edge")continue;let c=d.op==="add-node"||d.op==="remove-node"?d.node.id:d.id;for(let g of new Set(p.filter(m=>m.node===c).map(m=>m.field))){let m=d.op==="splice-text"?d.field===g?d:void 0:j(d,c,g);for(let u of p)u.node!==c||u.field!==g||(m?[m,u.splice]=b(m,u.splice):M(d,u.node,u.field)&&l.add(r(u)))}}}p.forEach((a,d)=>{if(!o.has(a.batch))return;let c={at:a.splice.at,removed:a.splice.inserted,inserted:a.splice.removed};for(let g of p.slice(d+1))r(g)===r(a)&&([c,g.splice]=b(c,g.splice))});for(let a of i){let d=p.filter(c=>c.batch===a);d.length===0||f.has(a)||d.some(c=>l.has(r(c)))||t.set(a,d.map(c=>({name:h,args:{node:c.node,field:c.field,at:c.splice.at,remove:c.splice.removed.length,insert:c.splice.inserted}})))}return t}v.typeText=Z;v.via=ee;v.collaborative=O;v.asSplices=se;v.undone=de;v.aside=ae;v.carried=le;function Ye(e){let{store:n,author:i,pending:t,provisional:s,asked:f}=e,r=new Map,l=(o,p)=>{r.get(o)?.(p),r.delete(o)};return{store:n,apply:(o,p)=>e.appliedAll(o,{...i?{author:i}:{},...p!==void 0?{batch:p}:{}}),hold(o){t.push(o),s.add(o),e.answers.set(o,new Promise(p=>r.set(o,p)))},ask:(o,p)=>void f.set(o,{calls:p}),send(o,p){f.set(o,{calls:p});let a=e.sent(o,p),d=()=>l(o,a);return a.then(c=>{Array.isArray(c?.ops)&&c.ops.length===0&&e.letGo.add(o),d()},d),a},drop(o){e.letGo.add(o),e.settle(o),f.delete(o),e.land([],[o]),l(o)},seen:e.seen,gone:e.gone,ahead(o,p,a){let d=t.indexOf(o),c=n.log.all(),g=m=>c.some(u=>u.batch===m&&u.primitives.some(y=>y.op==="splice-text"&&y.id===p&&y.field===a||y.op==="patch-node"&&y.id===p&&a in y.after));return t.slice(0,Math.max(0,d)).flatMap(m=>{let u=e.answers.get(m);return u&&g(m)?[{batch:m,answer:u}]:[]})}}}var ce=400,pe=/[\s.,;:!?)\]}]$/u,W=e=>typeof e=="string"?e:"";function z(e,n,i,t){let s=e.log.all(),f=s.findIndex(o=>o.batch===n);if(f<0)return;let r=W(e.graph.getNode(i)?.[t]),l;for(let o=s.length-1;o>=f;o--){let p=s[o];p.batch===n&&l===void 0&&(l=r);for(let a=p.primitives.length-1;a>=0;a--){let d=p.primitives[a];d.op==="splice-text"&&d.id===i&&d.field===t?r=T(r,{at:d.at,removed:d.inserted,inserted:d.removed}):d.op==="patch-node"&&d.id===i&&t in d.after&&(r=C(d.before[t])?"":W(d.before[t]))}}if(!(l===void 0||l===r))return S(r,l)}function Xe(e,n,i){let t,s=[],f,r,l=!1,o=new Set,p=c=>({name:h,args:{node:e,field:n,at:c.at,remove:c.removed.length,insert:c.inserted,rev:i.seen()}}),a=()=>{r&&clearTimeout(r),r=void 0,t!==void 0&&s.push(t),t=void 0,d()},d=()=>{if(f!==void 0||l||i.gone())return;let c=s.shift();if(c===void 0)return;let g=i.ahead(c,e,n).filter(u=>!o.has(u.batch));if(g.length>0){s.unshift(c),l=!0,Promise.allSettled(g.map(u=>u.answer)).then(()=>{for(let u of g)o.add(u.batch);l=!1,d()});return}let m=z(i.store,c,e,n);if(!m)return i.drop(c),d();f=c,i.send(c,[p(m)]).finally(()=>{f=void 0,d()})};return{splice(c,g,m){if(i.gone())return;let u=W(i.store.graph.getNode(e)?.[n]),y={at:c,removed:u.slice(c,c+g),inserted:m};if(t!==void 0){let F=z(i.store,t,e,n);(!F||!D(F,y))&&a()}let x=i.apply([{name:h,args:{node:e,field:n,at:c,remove:g,insert:m}}],t);if(x.ops.length===0)return;t===void 0&&(t=x.batch,i.hold(t));let k=z(i.store,t,e,n);if(k&&i.ask(t,[p(k)]),pe.test(m))return a();r&&clearTimeout(r),r=setTimeout(a,ce),r.unref?.()},flush:a,waiting:()=>s.length+(t!==void 0?1:0)+(f!==void 0?1:0)}}function Be(e,n){let i=n.find(l=>l.name===h)?.args;if(typeof i?.node!="string"||typeof i.field!="string")return;let{node:t,field:s}=i,f=()=>e.graph.getNode(t)?.[s],r=f();return{node:t,field:s,yours:r,over:l=>{let o=f();return{name:h,args:{node:t,field:s,at:0,remove:typeof o=="string"?o.length:0,insert:typeof r=="string"?r:"",rev:l}}}}}export{ce as TYPING_IDLE_MS,z as runSplice,Xe as typingOf,Ye as wireOf,Be as yoursOf};
1
+ import{d as K}from"./chunk.4UUJHLHR.js";import{Fb as h,Gb as v,Hc as $,Ic as N,Nb as V,h as P,k as R,pc as Y,q as I,qb as G,qc as X,tc as B,ua as q,x as _}from"./chunk.ZEZUKRC6.js";import{a as T,c as C,h as L}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var te=Symbol.for("@graview/core:markdown"),ne=500;function ie(e){let n=e;for(let i=0;i<6;i++){let t=N(n);if(!t)return!1;if(t[$]!==void 0)return t[$]===1;if(t[te]===1)return!0;if(t.type==="string")return(t.checks??[]).some(s=>{let f=N(s);return f?.check==="max_length"&&(f.maximum??0)>ne});if(t.innerType===void 0)return!1;n=t.innerType}return!1}function O(e,n,i){if(n===void 0||i==="id"||i==="kind")return!1;let t=e.tryDefinition(n)?.fields?.shape;return!!t&&Object.prototype.hasOwnProperty.call(t,i)&&ie(t[i])}var re=e=>e>=55296&&e<=56319,oe=e=>e>=56320&&e<=57343;function S(e,n){let i=Math.min(e.length,n.length),t=0;for(;t<i&&e.charCodeAt(t)===n.charCodeAt(t);)t++;t>0&&re(e.charCodeAt(t-1))&&t--;let s=0;for(;s<i-t&&e.charCodeAt(e.length-1-s)===n.charCodeAt(n.length-1-s);)s++;return s>0&&oe(e.charCodeAt(e.length-s))&&s--,{at:t,removed:e.slice(t,e.length-s),inserted:n.slice(t,n.length-s)}}var w=e=>e.at+e.removed.length;function H(e){let n=S(e.removed,e.inserted);return{...n,at:e.at+n.at}}function U(e,n,i){if(w(e)<n.at)return e;if(e.at>w(n))return{...e,at:e.at+n.inserted.length-n.removed.length};let t=Math.min(e.at,n.at),s=w(e)-w(n),f=e.removed.slice(0,n.at-t)+n.inserted+(s>0?e.removed.slice(e.removed.length-s):""),r=n.at<e.at||n.at===e.at&&i;return H({at:t,removed:f,inserted:r?n.inserted+e.inserted:e.inserted+n.inserted})}function b(e,n){return[U(e,n,!1),U(n,e,!0)]}function D(e,n){let i=e.at+e.inserted.length;if(w(n)<e.at||n.at>i)return;let t=Math.min(e.at,n.at),s=w(n)-i,f=n.removed.slice(0,e.at-t),r=s>0?n.removed.slice(n.removed.length-s):"",l=T(f+e.inserted+r,{...n,at:n.at-t});return H({at:t,removed:f+e.removed+r,inserted:l})}function M(e,n,i){switch(e.op){case"patch-node":return e.id===n&&Object.prototype.hasOwnProperty.call(e.after,i);case"add-node":case"remove-node":return e.node.id===n;default:return!1}}function j(e,n,i){if(e.op!=="patch-node"||e.id!==n||!Object.prototype.hasOwnProperty.call(e.after,i))return;let t=e.before[i],s=e.after[i];return typeof s=="string"&&(t===void 0||t===""||C(t))?{at:0,removed:"",inserted:s}:void 0}var J=(e,n,i)=>e.flatMap(t=>t.op==="splice-text"&&t.id===n&&t.field===i?[t]:[]);function E(e,n,i,t,s,f){if(typeof f!="string"||s<n-1)return;let r=[];for(let o of e)if(!(o.seq<=s))for(let p of o.primitives){let a=j(p,i,t);if(a){r.push(a);continue}if(M(p,i,t))return;p.op==="splice-text"&&p.id===i&&p.field===t&&r.push(p)}let l=f;try{for(let o=r.length-1;o>=0;o--){let p=r[o];l=T(l,{at:p.at,removed:p.inserted,inserted:p.removed})}}catch{return}return{then:l,since:r}}function A(e,n){let i=e;for(let t of n)i=b(t,i)[1];return{at:i.at,removed:i.removed,inserted:i.inserted}}function Q(e,n,i){let t=i?A(S(i.then,n),i.since):S(e,n);return t.removed===""&&t.inserted===""?void 0:t}function Z(e){let n=e.schema,i=t=>{throw new V(t,"invalid")};return{name:h,title:"Type text",input:I({node:P(),field:P(),at:R(),remove:R(),insert:P(),rev:_(R())}),subject:{kinds:"*",arg:"node"},writes:[],describe:(t,s)=>{let{node:f,field:r,insert:l,remove:o}=t;return K({node:f,field:r,inserted:[...String(l??"")].length,removed:Number(o)||0},n,s)},apply(t,s){let{node:f,field:r,at:l,remove:o,insert:p,rev:a}=s;(![l,o,a??0].every(k=>Number.isInteger(k)&&k>=-1)||l<0||o<0)&&i("at and remove are whole numbers, none below 0, and rev a revision");let d=t.graph.getNode(f);if(!d)throw new G(f,"\u201CType text\u201D names a record that is not there.");if(O(n,d.kind,r)||i(`${q(n.tryDefinition(d.kind),d.kind)}'s "${r}" is not text typed together: write it whole, as its edit does`),o===0&&p==="")return;let c=d[r];if(typeof c!="string"||c===""){t.patchNode(f,{[r]:p});return}let g=e.graph.getNode(f)?.[r],m=a===void 0?{then:c,since:[]}:E(e.log.all(),e.log.horizon,f,r,Math.max(a,-1),g);m||i(`${r} was written whole since revision ${a}: read it again and type over what it holds now`);let{then:u,since:y}=m;l+o>u.length&&i(`${r} held ${u.length} characters at revision ${a??"now"}, so there is nothing at ${l}${o>0?`\u2013${l+o}`:""} to type over`);let x=A({at:l,removed:u.slice(l,l+o),inserted:p},y);x.removed===""&&x.inserted===""||t.emit({op:"splice-text",id:f,field:r,...x})}}}function ee(e,n,i,t,s=()=>!0){let f=i===void 0?void 0:e.tryDefinition(i);if(!f||typeof t!="string")return[];let r=new Set;for(let l of n)if(!(l.name===h||!Y(e,l).includes(i)||!X(l,f).includes(t))&&s(l)){r.add(l.name);for(let o of B(e,n,l)??[])r.add(o)}return[...r]}function se(e,n,i){if(!n.some(r=>r.op==="patch-node"))return[...n];let t=new Set,s=new Set,f=[];for(let r of n){if(r.op==="add-node"&&t.add(r.node.id),r.op!=="patch-node"||t.has(r.id)){r.op==="splice-text"&&s.add(`${r.id}\0${r.field}`),f.push(r);continue}let l=e.graph.getNode(r.id),o={},p={},a=[];for(let[d,c]of Object.entries(r.after)){let g=l?.[d],m=`${r.id}\0${d}`;if(typeof c=="string"&&typeof g=="string"&&g!==""&&!s.has(m)&&O(e.schema,l?.kind,d)){let u=i?.find(x=>x.node===r.id&&x.field===d),y=Q(g,c,u?E(e.log.all(),e.log.horizon,r.id,d,u.rev,g):void 0);if(y){a.push({op:"splice-text",id:r.id,field:d,...y}),s.add(m);continue}}o[d]=r.before[d],p[d]=c,s.add(m)}Object.keys(p).length>0&&f.push(a.length>0?{op:"patch-node",id:r.id,before:o,after:p}:r),f.push(...a)}return f}function de(e,n){let i=[];return[...n].sort((t,s)=>s.seq-t.seq).map(t=>{let s=L(t);if(!s.some(o=>o.op==="splice-text"))return i.push(...s),{op:t,primitives:s};let f=e.filter(o=>o.seq>t.seq).flatMap(o=>o.primitives),r=t.primitives.length,l=[];return s.forEach((o,p)=>{if(o.op!=="splice-text")return void l.push(o);let a=A(o,J([...t.primitives.slice(r-p),...f,...i,...l],o.id,o.field));(a.removed!==""||a.inserted!=="")&&l.push({op:"splice-text",id:o.id,field:o.field,...a})}),i.push(...l),{op:t,primitives:l}})}function ae(e,n){let i=(t,s)=>e.some(f=>M(f,t,s));return n.undoes!==void 0&&n.primitives.length===0&&e.some(t=>t.op==="splice-text")||n.primitives.length>0&&n.primitives.every(t=>t.op==="splice-text"&&!i(t.id,t.field))?!0:e.flatMap(t=>t.op==="splice-text"&&n.primitives.some(s=>M(s,t.id,t.field))?[t.id]:[])}function le(e,n,i){let t=new Map,s=[],f=new Set;for(let a of e){let d=a.primitives[0],c=a.mutation?.args,g=a.mutation?.name!==h||a.primitives.length!==1||!d?void 0:d.op==="splice-text"?d:j(d,String(c?.node),String(c?.field));g?s.push({batch:a.batch,node:String(c?.node),field:String(c?.field),splice:g}):f.add(a.batch)}if(s.length===0)return t;let r=a=>`${a.node}\0${a.field}`,l=new Set,o=new Set(e.map(a=>a.batch).filter(a=>!i.includes(a))),p=s;for(let a of n){if(o.has(a.batch)){p=p.filter(d=>d.batch!==a.batch);continue}for(let d of a.primitives){if(d.op==="add-edge"||d.op==="remove-edge")continue;let c=d.op==="add-node"||d.op==="remove-node"?d.node.id:d.id;for(let g of new Set(p.filter(m=>m.node===c).map(m=>m.field))){let m=d.op==="splice-text"?d.field===g?d:void 0:j(d,c,g);for(let u of p)u.node!==c||u.field!==g||(m?[m,u.splice]=b(m,u.splice):M(d,u.node,u.field)&&l.add(r(u)))}}}p.forEach((a,d)=>{if(!o.has(a.batch))return;let c={at:a.splice.at,removed:a.splice.inserted,inserted:a.splice.removed};for(let g of p.slice(d+1))r(g)===r(a)&&([c,g.splice]=b(c,g.splice))});for(let a of i){let d=p.filter(c=>c.batch===a);d.length===0||f.has(a)||d.some(c=>l.has(r(c)))||t.set(a,d.map(c=>({name:h,args:{node:c.node,field:c.field,at:c.splice.at,remove:c.splice.removed.length,insert:c.splice.inserted}})))}return t}v.typeText=Z;v.via=ee;v.collaborative=O;v.asSplices=se;v.undone=de;v.aside=ae;v.carried=le;function Ye(e){let{store:n,author:i,pending:t,provisional:s,asked:f}=e,r=new Map,l=(o,p)=>{r.get(o)?.(p),r.delete(o)};return{store:n,apply:(o,p)=>e.appliedAll(o,{...i?{author:i}:{},...p!==void 0?{batch:p}:{}}),hold(o){t.push(o),s.add(o),e.answers.set(o,new Promise(p=>r.set(o,p)))},ask:(o,p)=>void f.set(o,{calls:p}),send(o,p){f.set(o,{calls:p});let a=e.sent(o,p),d=()=>l(o,a);return a.then(c=>{Array.isArray(c?.ops)&&c.ops.length===0&&e.letGo.add(o),d()},d),a},drop(o){e.letGo.add(o),e.settle(o),f.delete(o),e.land([],[o]),l(o)},seen:e.seen,gone:e.gone,ahead(o,p,a){let d=t.indexOf(o),c=n.log.all(),g=m=>c.some(u=>u.batch===m&&u.primitives.some(y=>y.op==="splice-text"&&y.id===p&&y.field===a||y.op==="patch-node"&&y.id===p&&a in y.after));return t.slice(0,Math.max(0,d)).flatMap(m=>{let u=e.answers.get(m);return u&&g(m)?[{batch:m,answer:u}]:[]})}}}var ce=400,pe=/[\s.,;:!?)\]}]$/u,W=e=>typeof e=="string"?e:"";function z(e,n,i,t){let s=e.log.all(),f=s.findIndex(o=>o.batch===n);if(f<0)return;let r=W(e.graph.getNode(i)?.[t]),l;for(let o=s.length-1;o>=f;o--){let p=s[o];p.batch===n&&l===void 0&&(l=r);for(let a=p.primitives.length-1;a>=0;a--){let d=p.primitives[a];d.op==="splice-text"&&d.id===i&&d.field===t?r=T(r,{at:d.at,removed:d.inserted,inserted:d.removed}):d.op==="patch-node"&&d.id===i&&t in d.after&&(r=C(d.before[t])?"":W(d.before[t]))}}if(!(l===void 0||l===r))return S(r,l)}function Xe(e,n,i){let t,s=[],f,r,l=!1,o=new Set,p=c=>({name:h,args:{node:e,field:n,at:c.at,remove:c.removed.length,insert:c.inserted,rev:i.seen()}}),a=()=>{r&&clearTimeout(r),r=void 0,t!==void 0&&s.push(t),t=void 0,d()},d=()=>{if(f!==void 0||l||i.gone())return;let c=s.shift();if(c===void 0)return;let g=i.ahead(c,e,n).filter(u=>!o.has(u.batch));if(g.length>0){s.unshift(c),l=!0,Promise.allSettled(g.map(u=>u.answer)).then(()=>{for(let u of g)o.add(u.batch);l=!1,d()});return}let m=z(i.store,c,e,n);if(!m)return i.drop(c),d();f=c,i.send(c,[p(m)]).finally(()=>{f=void 0,d()})};return{splice(c,g,m){if(i.gone())return;let u=W(i.store.graph.getNode(e)?.[n]),y={at:c,removed:u.slice(c,c+g),inserted:m};if(t!==void 0){let F=z(i.store,t,e,n);(!F||!D(F,y))&&a()}let x=i.apply([{name:h,args:{node:e,field:n,at:c,remove:g,insert:m}}],t);if(x.ops.length===0)return;t===void 0&&(t=x.batch,i.hold(t));let k=z(i.store,t,e,n);if(k&&i.ask(t,[p(k)]),pe.test(m))return a();r&&clearTimeout(r),r=setTimeout(a,ce),r.unref?.()},flush:a,waiting:()=>s.length+(t!==void 0?1:0)+(f!==void 0?1:0)}}function Be(e,n){let i=n.find(l=>l.name===h)?.args;if(typeof i?.node!="string"||typeof i.field!="string")return;let{node:t,field:s}=i,f=()=>e.graph.getNode(t)?.[s],r=f();return{node:t,field:s,yours:r,over:l=>{let o=f();return{name:h,args:{node:t,field:s,at:0,remove:typeof o=="string"?o.length:0,insert:typeof r=="string"?r:"",rev:l}}}}}export{ce as TYPING_IDLE_MS,z as runSplice,Xe as typingOf,Ye as wireOf,Be as yoursOf};
@@ -1 +1 @@
1
- import{c as l}from"./chunk.V7W5AQKL.js";import{me as i}from"./chunk.6HY6ZGEE.js";function c(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function p(e,n={}){let[t="/",a=""]=e.split("#")[0].split("?"),r=new URLSearchParams(a);n.filter&&r.set("filter",n.filter);let s=r.toString(),o=n.section?c(n.section):"";return`${t}${s?`?${s}`:""}${o?`#${o}`:""}`}var m=e=>({as:e.slug,title:e.title,kind:e.kind,is:e.kind===null?e.slug===i?"home":"overview":e.address.startsWith("/places/")?"place":"list",...e.hidden?{hidden:!0}:{}});function d(e,n){let t=[];for(let a of e)a.kind!==null&&n.has(a.kind)||a.over?.some(r=>n.has(r))||t.some(r=>r.as===a.slug)||t.push(m(a));return t}function y(e,n,t={}){return d(l(e,n,t.pages?{pages:t.pages}:{}),t.kept??new Set)}export{c as a,p as b,y as c};
1
+ import{c as l}from"./chunk.LP2ZMAT2.js";import{me as i}from"./chunk.ZEZUKRC6.js";function c(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function p(e,n={}){let[t="/",a=""]=e.split("#")[0].split("?"),r=new URLSearchParams(a);n.filter&&r.set("filter",n.filter);let s=r.toString(),o=n.section?c(n.section):"";return`${t}${s?`?${s}`:""}${o?`#${o}`:""}`}var m=e=>({as:e.slug,title:e.title,kind:e.kind,is:e.kind===null?e.slug===i?"home":"overview":e.address.startsWith("/places/")?"place":"list",...e.hidden?{hidden:!0}:{}});function d(e,n){let t=[];for(let a of e)a.kind!==null&&n.has(a.kind)||a.over?.some(r=>n.has(r))||t.some(r=>r.as===a.slug)||t.push(m(a));return t}function y(e,n,t={}){return d(l(e,n,t.pages?{pages:t.pages}:{}),t.kept??new Set)}export{c as a,p as b,y as c};
@@ -0,0 +1,2 @@
1
+ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Q,b as Ge,c as He,f as pe,i as Ve}from"./chunk.HB5NWHFP.js";import"./chunk.OCXY5DCD.js";import{b as Ee,c as je,d as Me,f as ae,g as qe,h as ie,i as de,j as Be,k as ce,m as Fe,n as Ie,o as Ne,p as Le,q as le}from"./chunk.B5SJMCTT.js";import"./chunk.NYLKG25K.js";import{a as xe}from"./chunk.TBY5IR7C.js";import{d as De}from"./chunk.ILJDLBPJ.js";import"./chunk.X226YATK.js";import"./chunk.BJUUSIQY.js";import"./chunk.M7KXQGQL.js";import"./chunk.XOZU4OFA.js";import"./chunk.H3EGBDW2.js";import"./chunk.6KJGRM7A.js";import"./chunk.MIE4TJRW.js";import{x as Ce}from"./chunk.QRQ5WPZI.js";import"./chunk.RD2FSSLV.js";import"./chunk.37RFCHSS.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{G as it,W as $e,ea as Re}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import{la as Oe}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as se}from"./chunk.AJZBJBMO.js";var g=se(it(),1);var I=se($e(),1),$=n=>(n??"").replace(/\s+/g," ").trim(),ue=()=>new Promise(n=>requestAnimationFrame(()=>n())),dt=n=>new Promise(s=>setTimeout(s,n));function ct(n){let s=n.cloneNode(!0);for(let o of s.querySelectorAll("span"))o.remove();return $(s.textContent).replace(/^[▸▾]\s*/,"")}function Ke(n){if(!n||!n.isConnected)return"";let s=n.innerText??n.textContent??"";return`${n.querySelectorAll("*").length}|${$(s)}`}function lt(n,s=80){if(!n)return"";let o=[],d=new Set,l="li, tr, article, [data-graview-listed], [data-graview-record], [data-graview-field]";for(let i of n.querySelectorAll(`h1, h2, h3, h4, ${l}`)){if(o.length>=s)break;if([...d].some(u=>u.contains(i))||i.closest("[data-graview-popover], [hidden], nav, [aria-hidden='true']"))continue;let c=/^h([1-4])$/i.exec(i.localName),a=(c?ct(i):$(i.innerText??i.textContent)).slice(0,140);if(a)if(c)o.push(`${"#".repeat(Number(c[1]))} ${a}`);else{let u=i.getAttribute("data-graview-field");o.push(u?`${u}: ${a}`:`- ${a}`),d.add(i)}}return o.join(`
2
+ `)}function pt(n,s){let{store:o}=n,d=i=>Object.fromEntries(Object.entries(i).filter(([,c])=>c!==void 0&&typeof c!="object").map(([c,a])=>[c,typeof a=="string"?a.slice(0,80):a]));return{kinds:(s.kind?[s.kind]:o.schema.kinds.slice(0,6)).map(i=>{let c=o.graph.nodesOfKind(i),a=o.schema.tryDefinition(i);return{kind:i,count:c.length,fields:Object.keys(a?.fields?.shape??{}),relations:Object.keys(a?.edges??{}),some:(s.record?c.filter(u=>u.id===s.record):c.slice(0,3)).map(d)}})}}function ut(n,s){let o=n.store.schema,d=new Set,l=new Set;for(let i of o.definitions)for(let[c,a]of Object.entries(i.edges??{})){let u=Array.isArray(a?.to)?a.to:[];if(s.kind===void 0||i.kind===s.kind||u.includes(s.kind)){l.add(c);for(let S of[i.kind,...u])S!==s.kind&&o.tryDefinition(S)&&d.add(S)}}if(s.kind===void 0)for(let i of o.kinds)d.add(i);return{kinds:[...d],edges:[...l]}}var _e={manifest:"The view could not start: what it reads is not this app's.",source:"The script is too long: make it shorter.",start:"The script did not start: it must be one plain script, with no syntax errors, that calls graview.onProps and graview.render.",error:"The script threw while drawing: read only what props gives (props.nodes for a list, props.node for one record), guard each value that may be missing, and call no function that does not exist."};async function Ue(n,s,o=15e3){let d=Date.now()+o;for(;Date.now()<d;){for(let i of document.querySelectorAll("[data-worker-view-place]")){let c=Ce(i),a=c?.name===n?c.drawing().root:void 0;if(c&&i.isConnected&&a?.isConnected&&a.childElementCount>0&&(s===void 0||await c.source()===s))return{element:i,handle:c}}let l=document.querySelector(`[data-worker-view-fell-back="${CSS.escape(n)}"]`);if(l)return{failed:_e[l.getAttribute("data-worker-view-failed")??""]??_e.error};await dt(80)}return{failed:"The view did not draw in time: keep it simple and quick to draw."}}var fe=new Map,ft=(n,s)=>{let o=fe.get(n);return o||fe.set(n,o={phase:s(),steps:[],before:!1,putBack:null,began:!1,original:null,markup:null,talk:[],events:[],since:Date.now(),stop:null,covering:!1,pointed:null,about:null,kept:null,pressed:null,version:0,heard:new Set}),o};function Xe(n,s){return s.record?[n.graph.getNode(s.record)].filter(o=>o!==void 0):s.kind?n.graph.nodesOfKind(s.kind):n.schema.kinds.flatMap(o=>n.graph.nodesOfKind(o))}var Y=(n,s)=>s?Oe(n.schema.tryDefinition(s.kind),s):"";function gt(n,s,o){let d=$(o).toLowerCase();return Xe(n,s).map(l=>Y(n,l)).filter(l=>l.length>1&&d.includes($(l).toLowerCase())).slice(0,40)}function We(n,s){return(s.kind?[s.kind]:n.store.schema.kinds).flatMap(d=>Object.keys(n.store.schema.tryDefinition(d)?.fields?.shape??{}))}function Ct({ask:n,close:s}){let o=Re(),{ai:d,aiDesk:l,aiHere:i,session:c,principal:a,keptViews:u,store:x,onProposeChange:S,composeChange:w,onDraftChange:T,app:M}=o,r=n.part,e=(0,g.useMemo)(()=>ft(n.at,()=>n.mode==="highlight"?{at:"highlighting"}:{at:"open"}),[n]),G=(0,g.useCallback)(t=>(e.heard.add(t),()=>void e.heard.delete(t)),[e]),P=(0,g.useSyncExternalStore)(G,()=>e.phase,()=>e.phase),Ye=(0,g.useSyncExternalStore)(G,()=>e.version,()=>e.version),A=(0,g.useCallback)(()=>{e.version+=1,e.heard.forEach(t=>t())},[e]),k=(0,g.useCallback)(t=>{e.phase=t,A()},[e,A]),R=(0,g.useCallback)(async()=>{let t=e.putBack;e.putBack=null,t&&await t()},[e]),Z=(0,g.useCallback)(()=>{e.stop?.abort(),e.stop=null,R(),fe.delete(n.at),s()},[R,n.at,s,e]),b=(0,g.useCallback)(()=>r.main?.isConnected?r.main:yt(),[r]),H={name:r.name,slot:r.slot,...r.kind?{kind:r.kind}:{},...r.group?{group:r.group}:{}},he=r.place??(r.kind?`${r.kind}-${r.slot}`:"home"),Ze=n.fromScene?`From the scene: Better UI changes how \u201C${r.name}\u201D looks on its page here, for everyone in this app.`:`This changes how ${r.name} looks for everyone in this app.`,q=(0,g.useCallback)((t,p,f,h={})=>({id:De(),at:new Date().toISOString(),by:a,target:{on:"place",place:he},targetLabel:r.name,ask:{kind:"section",said:t},offered:[],outcome:p,stages:f.map(m=>({stage:m.stage,ms:m.ms,model:m.model})),usage:f.flatMap(m=>m.usage?[{tier:m.stage==="light"?"fast":"thinking",model:m.model,inputTokens:m.usage.inputTokens,outputTokens:m.usage.outputTokens}]:[]),...h}),[a,he,r.name]),me=S!==void 0&&w!==void 0&&xe(x,a),B=(0,g.useMemo)(()=>kt(o,r),[o,r]),C=Ne(H,ut(o,r),B.map(t=>t.act)),we=C!==void 0&&typeof u?.fork=="function"&&typeof u.draftFork=="function"&&u.current().may.views===!0,ke=r.slot==="record"?{page:"record",kind:r.kind}:r.slot==="home"?{page:"home"}:{page:"list",kind:r.kind??""},V=(0,g.useCallback)(t=>({manifest:C,source:t,from:ke,said:""}),[C,ke]),ye=P.at==="working";(0,g.useEffect)(()=>{if(!ye)return;let t=r.record??(r.kind?`kind:${r.kind}`:null);return i({participant:`agent:graview-for-${a.id??"anyone"}:${c}`,kind:"agent",name:"Graview",...a.id?{onBehalfOf:a.id}:{},over:t,robot:{at:t,mode:"thinking"}}),()=>i(null)},[ye]);let D=(0,g.useCallback)(()=>{if(e.original)return e.original;let t=b(),p=t?.innerText??"";return e.original=Q(X(t),gt(o.store,r,p||(t?.textContent??""))),e.original},[e,b,o,r]),N=(0,g.useCallback)(()=>Q(X(b()),D().records.map(t=>t.label)),[b,D]),K=(0,g.useCallback)(async t=>{if(await R(),t.kind==="spec"){let p=await T(ze(t.edits,t.said,d.name));e.putBack=p.undo}else u.draftFork(V(t.source)),e.putBack=()=>u.draftFork(null)},[R,T,e,u,V,d.name]),L=(0,g.useCallback)(async()=>{let t=e.steps.at(-1);e.before=!1,t?await K(t):await R()},[e,K,R]),v=(0,g.useCallback)((t,p)=>{e.talk.push({who:t,said:p}),A()},[e,A]),F=(0,g.useCallback)(t=>{e.events.at(-1)?.kind==="streaming"&&e.events.pop(),e.events.push(t),A()},[e,A]),U=()=>e.talk.filter(t=>t.who==="person").map(t=>t.said).join(" "),ve=(0,g.useCallback)(async t=>{if(!me||!T)return!1;let f=(await (__graviewPreload(import.meta.url,["./chunk.XSWSBTUO.js","./chunk.TBY5IR7C.js","./chunk.BIDL7GQD.js","./chunk.Q5WEOX3Q.js","./chunk.6SJEZWH3.js","./chunk.6N4PE3U5.js","./chunk.WALVW3KJ.js","./chunk.SNHKYH72.js","./chunk.UGQYMN4J.js","./chunk.RG5G6YQD.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HVBKI5ZO.js"))).documentOfApp(M??{});if(!f)return!1;let h=e.steps.at(-1);if(h&&h.kind!=="spec")return!1;let m=h?.edits??[],y=m.length>0?w({document:f,edits:m}):void 0,j=y?.ok?y.document:f;if(!(t.mode==="just"?{can:!0}:await Fe(d,t.words,H)).can)return!1;F({kind:"look",text:`Looking at how ${r.name} is set up`});let E=[],ne=await Ie({ai:d,document:j,part:H,mode:t.mode==="choose"?"just":t.mode,...t.words?{words:t.words}:{},...t.pointed?{highlighted:[t.pointed.name,...t.pointed.lines]}:{},shows:lt(b(),30),judge:async W=>{let _=w({document:f,edits:[...m,...W]});return _.ok?(E=_.said,[]):[_.refused]}});if(!ne.ok)return!1;let st=[...m,...ne.edits],Te=q(`Make \u201C${r.name}\u201D better: ${t.words}`,"offered",ne.stages),oe=Ke(b()),re={kind:"spec",edits:st,said:E[E.length-1]??E[0]??`${r.name} changed.`,entry:Te};e.covering=!0,A();try{await K(re);let W=oe;for(let at=Date.now()+1500;Date.now()<at&&W===oe;)await ue(),W=Ke(b());let _=W===oe?["nothing changed"]:ae(D(),N(),{fields:We(o,r),asked:U()});if(_.length>0)return await L(),l.record({...Te,outcome:"failed",failed:_.join(" ")}),!1}catch{return await L(),!1}finally{e.covering=!1,A()}return e.steps.push(re),e.before=!1,F({kind:"passed",text:"Changed its settings \u2014 it's on the page"}),v("graview",`Done: ${re.said.replace(/\.$/,"")}.`),!0},[d,l,M,w,q,e,o,b,T,D,N,r,H,K,L,me,F,v,A]),be=(0,g.useCallback)(async t=>{if(!C||!u?.draftFork)return{findings:["This page cannot be drawn anew here."],drew:void 0};let p=D();e.covering=!0,A();try{u.draftFork(V(t)),e.putBack=()=>u.draftFork(null);let f=await Ue(C.name,t),h;if("failed"in f)h=[f.failed];else{let y=[...await f.handle.check(t),...f.handle.refused().filter(j=>!/^Refused a rule of the stylesheet\b/.test(j))];if(y.length>0)h=y;else{await ue(),await ue();let j=f.element.closest("[data-graview-page-main], main")??X(b());h=ae(p,Q(j,p.records.map(E=>E.label)),{fields:We(o,r),asked:U()});let O=f.handle.presses?await f.handle.presses(t).catch(()=>{}):void 0;O&&(e.pressed=O,h=[...h,...ie(O,Qe(p,ge(o,r,p)),B.filter(E=>E.toggle).map(E=>E.act),z(r))])}}let m=le(N());if(h.length===0){let y=q(`Draw \u201C${r.name}\u201D anew: ${U()}`,"offered",[]);e.steps.push({kind:"view",source:t,said:qe(r.name,p,N())??`${r.name} has a new design. Compare Before and After.`,entry:y}),e.before=!1}else await L();return{findings:h,drew:m}}finally{e.covering=!1,A()}},[C,u,D,e,A,V,N,o,r,q,L]),Pe=(0,g.useCallback)(async(t=[])=>{if(!C||!we){v("graview","Its settings can't do that, and a new design can't be drawn for it here.");return}let p=new AbortController;e.stop=p,e.markup??=Je(b());let f=e.steps.length,h=[...e.steps].reverse().find(y=>y.kind==="view"),m=await Le({ai:d,part:H,manifest:C,talk:e.talk,keep:ht(D(),b(),r.name,o,r),...e.markup?{markup:e.markup}:{},...h?{current:h.source}:e.kept?{current:e.kept}:{},host:{look:()=>le(N()),read:()=>pt(o,r),draft:be},onEvent:y=>F(y),...e.about?{about:e.about}:{},acts:B,...t.length>0?{pressed:t}:{},noun:z(r),signal:p.signal});if(e.stop===p){if(e.stop=null,e.events.at(-1)?.kind==="streaming"&&e.events.pop(),l.record(q(`Draw \u201C${r.name}\u201D anew: ${U()}`,e.steps.length>f?"offered":"failed",m.stages,e.steps.length>f?{}:{failed:m.last?.findings.join(" ")??m.said})),m.passed){let y=e.pressed?de(e.pressed,B,z(r)):void 0,j=Be.test(m.said)?void 0:m.said;v("graview",[j??(y?void 0:"Here it is on the page."),y].filter(Boolean).join(" "))}else v("graview",m.said);m.ended==="stuck"&&k({at:"stuck",...m.keepable&&m.last?{source:m.last.source}:{}})}},[d,l,B,N,q,we,e,o,be,b,C,D,r,H,v,k,F]),Se=(0,g.useCallback)(async()=>{let p=[...e.steps].reverse().find(O=>O.kind==="view")?.source??e.kept;if(!p||!C)return[];F({kind:"look",text:"Pressing every control on the page"});let f=await Ue(C.name);if("failed"in f||!f.handle.presses)return[];let h=await f.handle.presses(p).catch(()=>{});if(!h)return[];e.pressed=h;let m=D(),y=ie(h,Qe(m,ge(o,r,m)),B.filter(O=>O.toggle).map(O=>O.act),z(r)),j=y.length>0?y:h.controls.slice(0,8).map(O=>`${O.control}: ${O.says}`);return F(y.length>0?{kind:"check",text:`Check: ${y.length} ${y.length===1?"control doesn't":"controls don't"} work \u2014 fixing`}:{kind:"passed",text:"Check: every control works"}),v("graview",y.length>0?`I pressed every control: ${y.join(" ")}`:`I pressed every control. ${de(h,B,z(r))??"Each one did what it says."}`),j},[B,e,o,C,D,r,v,F]),J=(0,g.useCallback)(async(t,p="describe")=>{if(e.phase.at==="working")return;let f=e.pointed;e.pointed=null;let h={mode:p,words:t,...f?{pointed:f}:{}};e.about=f??e.about,v("person",t),e.events=[],e.since=Date.now(),k({at:"working"}),D(),e.markup??=Je(b());let m=ce.test(t)?await Se().catch(()=>[]):[];!ce.test(t)&&await ve(h).catch(()=>!1)||await Pe(m),e.phase.at==="working"&&k(e.steps.length>0?{at:"draft"}:{at:"open"})},[Pe,ve,e,b,D,Se,v,k]),ee=(0,g.useCallback)(()=>{if(e.phase.at!=="working")return;let t=e.stop;e.stop=null,t?.abort(),e.covering=!1,e.steps=e.steps.filter(p=>p.entry.at<new Date(e.since).toISOString()),L(),v("graview","Stopped. The page is as it was."),k(e.steps.length>0?{at:"draft"}:{at:"open"})},[e,v,k,L]),et=(0,g.useCallback)(async t=>{let p=e.steps.at(-1);!p||t===e.before||(e.before=t,A(),t?await R():await K(p))},[e,R,K,A]),te=(0,g.useCallback)(async()=>{let t=e.steps.at(-1);if(!(!t||e.phase.at!=="draft")){k({at:"keeping"});try{let p,f;if(t.kind==="spec"){await R();let h=await S(ze(t.edits,t.said,d.name));if(h==="declined")return v("graview","It wasn't kept."),k({at:"draft"});typeof h=="object"&&([p,f]=[h.undo,h.note])}else{let h=await u.fork(V(t.source));e.putBack=null,u.draftFork?.(null),e.kept=t.source,h&&([p,f]=[h.undo,h.note])}l.record({...t.entry,outcome:"accepted"}),e.steps=[],e.before=!1,k({at:"kept",...p?{undo:p}:{},...f?{note:f}:{}})}catch{v("graview","It couldn't be kept."),k({at:"draft"})}}},[e,k,R,S,d.name,u,V,l,v]),tt=(0,g.useCallback)(async t=>{if(e.phase.at!=="stuck")return;let p={kind:"view",source:t,said:`${r.name} kept as it was last drafted.`,entry:q(`Draw \u201C${r.name}\u201D anew: ${U()}`,"offered",[])};e.steps.push(p),e.phase={at:"draft"},await te(),e.steps.at(-1)===p&&(e.steps.pop(),k(e.steps.length>0?{at:"draft"}:{at:"open"}))},[e,r.name,q,te,k]),nt=(0,g.useCallback)(()=>{v("graview","Stopped. The page is as it was."),k(e.steps.length>0?{at:"draft"}:{at:"open"})},[e,v,k]),ot=(0,g.useCallback)(()=>{let t=e.steps.at(-1);t&&l.record({...t.entry,outcome:"dismissed"}),e.steps=[],e.before=!1,R(),v("graview","Put back as it was."),k({at:"open"})},[e,l,R,v,k]),rt=(0,g.useCallback)(async()=>{if(!(e.phase.at!=="kept"||!e.phase.undo))try{await e.phase.undo(),e.kept=null,v("graview","Undone. The page is as it was."),k({at:"undone"})}catch{v("graview","It couldn't be put back.")}},[e,v,k]);if((0,g.useEffect)(()=>{e.began||!(n.mode==="just"||n.mode==="describe"&&n.words)||(e.began=!0,J(n.mode==="just"?"Make it easier to read at a glance":n.words,n.mode))},[e,n.mode,n.words,J]),(0,g.useEffect)(()=>{let t=p=>{if(p.key!=="Escape"||e.phase.at==="highlighting")return;if(p.preventDefault(),e.phase.at==="working")return ee();Z();let f=n.returnTo?.isConnected?n.returnTo:document.querySelector("[data-graview-page-title], main h1");f&&!f.hasAttribute("tabindex")&&!f.matches("a[href], button, input, select, textarea")&&f.setAttribute("tabindex","-1"),f?.focus?.()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,Z,ee,n.returnTo]),P.at==="highlighting")return(0,I.jsx)(Ve,{box:b(),root:b(),whole:r.elements,wholeSaid:"The whole page",cancel:()=>k({at:"open"}),chose:t=>{e.pointed={name:Me(t)??Ee(t.map(pe)),lines:je(t.map(pe))},k({at:"open"})}});let Ae=e.steps.at(-1);return(0,I.jsxs)(I.Fragment,{children:[e.covering?(0,I.jsx)(Ge,{over:b(),name:r.name,said:`Graview is drafting \u201C${r.name}\u201D\u2026`}):null,(0,I.jsx)(He,{name:r.name,scope:Ze,phase:P.at,talk:e.talk,steps:e.events,since:e.since,working:P.at==="working"||P.at==="keeping",...Ae&&P.at==="draft"?{draft:{said:Ae.said,before:e.before}}:{},...P.at==="kept"?{kept:{...P.note?{note:P.note}:{},...P.undo?{undo:()=>void rt()}:{}}}:{},...P.at==="stuck"?{stuck:{...P.source!==void 0?{keepAnyway:()=>void tt(P.source)}:{},stop:nt}}:{},about:(e.pointed??e.about)?.name??r.name,ask:t=>void J(t),just:()=>void J("Make it easier to read at a glance","just"),point:()=>k({at:"highlighting"}),stop:ee,compare:t=>void et(t),keep:()=>void te(),discard:ot,close:Z})]})}function ze(n,s,o){return{said:s,add:[],drop:[],card:{said:s,adds:[],keeps:[],drops:[],breaking:[]},edits:n,via:`ai:${o??"model"}`}}function ht(n,s,o,d,l){let i=X(s),c=l.slot==="home"?[...s?.querySelectorAll("h1")??[]].find(w=>i!==s&&!i?.contains(w)):void 0,a=$(c?.textContent)||$(i?.querySelector("[data-graview-page-title]")?.textContent)||(l.slot==="home"?"":$(i?.querySelector("h1")?.textContent))||(l.record?$(Y(d.store,d.store.graph.getNode(l.record))):"")||o,u=ge(d,l,n),x=Object.fromEntries(n.records.flatMap(w=>w.facts?.length||w.under&&w.under!==a?[[w.label,{...u[w.label]?{id:u[w.label]}:{},...w.facts?.length?{shows:w.facts}:{},...w.under&&w.under!==a?{under:w.under}:{}}]]:[])),S=wt(d,n,u,a);return{title:a,headings:n.headings.filter(w=>w!==a),records:n.records.map(w=>w.label),...Object.keys(x).length>0?{says:x}:{},...S?{grouping:S}:{}}}function mt(n,s,o){let d=Xe(n,s),l={};for(let i of o.records){let c=d.find(a=>$(Y(n,a))===$(i.label));c&&(l[i.label]=c.id)}return l}var ge=(n,s,o)=>mt(n.store,s,o);function wt(n,s,o,d){let{store:l}=n,i=s.records.filter(T=>T.under&&T.under!==d&&o[T.label]);if(i.length<2)return;let c=l.graph.allEdges(),a=new Map;for(let T of i){let M=o[T.label];for(let r of c){let e=r.from===M?r.to:r.to===M?r.from:void 0,G=e!==void 0?l.graph.getNode(e):void 0;if(!G||$(Y(l,G))!==$(T.under))continue;let P=`${r.kind}\0${G.kind}\0${r.from===M?"from":"to"}`;a.set(P,(a.get(P)??0)+1)}}let u=[...a].sort((T,M)=>M[1]-T[1])[0];if(!u||u[1]<i.length/2)return;let[x,S,w]=u[0].split("\0");return{edge:x,kind:S,record:w}}var X=n=>n?.querySelector("main")??n;function Je(n){if(!n?.isConnected)return null;let s=(n.querySelector("main")??n).cloneNode(!0);for(let d of s.querySelectorAll("script, style, svg, button, input, select, textarea, [hidden], [aria-hidden='true'], [data-graview-popover]"))d.remove();for(let d of[s,...s.querySelectorAll("*")])for(let l of[...d.getAttributeNames()])d.removeAttribute(l);let o=s.outerHTML.replace(/\s+/g," ").replace(/<(div|span)>\s*<\/\1>/g,"").trim();return o.length>6e3?o.slice(0,6e3):o}var z=n=>n.slot==="list"||n.slot==="group"?n.name.toLowerCase():n.slot==="record"?"parts":"records";function Qe(n,s){return n.records.flatMap(o=>s[o.label]?[{label:o.label,id:s[o.label],...o.presses?{presses:!0}:{},...o.opens?{opens:!0}:{}}]:[])}function kt(n,s){let{store:o}=n,d=s.kind?[s.kind]:o.schema.kinds,l=c=>o.schema.tryDefinition(c)?.fields?.shape??{},i=c=>{let a=c?._zod?.def;for(let u=0;u<6&&a&&a.type!=="boolean"&&a.innerType!==void 0;u++)a=a.innerType._zod?.def;return a?.type==="boolean"};return o.allMutations().flatMap(c=>{let a=c.subject;if(!a||c.creates?.length)return[];let u=d.find(w=>a.kinds==="*"||a.kinds.includes(w));if(!u)return[];let x=c.writes??[],S=x.length===1&&i(l(u)[x[0]])?x[0]:void 0;return[{act:c.name,title:String(c.title??c.name),record:a.arg,...S?{toggle:S}:{}}]}).slice(0,24)}function yt(){return document.querySelector("[data-graview-page-main], main")??document.querySelector("[data-graview-face]")}export{Ct as PageCard,Ke as drawnSignature,gt as labelsShown,lt as outlineOf,mt as recordIdsOf};
@@ -1 +1 @@
1
- import{c as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h}from"./chunk.DQFHIJFN.js";import"./chunk.BFAFCVL4.js";import"./chunk.M5FP4Y4Q.js";import"./chunk.V7W5AQKL.js";import"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{h as createLinks,g as judgeDestination,e as listsOf,c as nowhere,f as placeVocabulary,a as placesSaid,b as quoted,d as whereOfWords};
1
+ import{c as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h}from"./chunk.H6KIEDZN.js";import"./chunk.264PB572.js";import"./chunk.M5FP4Y4Q.js";import"./chunk.LP2ZMAT2.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{h as createLinks,g as judgeDestination,e as listsOf,c as nowhere,f as placeVocabulary,a as placesSaid,b as quoted,d as whereOfWords};
@@ -1 +1 @@
1
- import{t as a}from"./chunk.5LJVOLKR.js";import{G as f,W as s,ea as l}from"./chunk.MODLZJD4.js";import{b as i}from"./chunk.AJZBJBMO.js";var d=i(f(),1),p=i(s(),1),c=new Set;function B(e){return c.add(e),()=>void c.delete(e)}function S(){let{store:e,principal:o}=l();return(0,d.useMemo)(()=>n=>{let t=n.on===void 0?void 0:e.graph.getNode(n.on);if(!t)return null;let u=[...c].filter(r=>r.store===e&&r.kind===t.kind);return(n.element?u.find(r=>r.root()?.contains(n.element)??!1):u[0])?.section(t.id,o)??null},[e,o])}function v({children:e}){let o=S(),n=(0,d.useMemo)(()=>[o],[o]);return(0,p.jsx)(a,{sections:n,children:e})}export{B as a,S as b,v as c};
1
+ import{t as a}from"./chunk.QRQ5WPZI.js";import{G as f,W as s,ea as l}from"./chunk.A5PSEU3W.js";import{b as i}from"./chunk.AJZBJBMO.js";var d=i(f(),1),p=i(s(),1),c=new Set;function B(e){return c.add(e),()=>void c.delete(e)}function S(){let{store:e,principal:o}=l();return(0,d.useMemo)(()=>n=>{let t=n.on===void 0?void 0:e.graph.getNode(n.on);if(!t)return null;let u=[...c].filter(r=>r.store===e&&r.kind===t.kind);return(n.element?u.find(r=>r.root()?.contains(n.element)??!1):u[0])?.section(t.id,o)??null},[e,o])}function v({children:e}){let o=S(),n=(0,d.useMemo)(()=>[o],[o]);return(0,p.jsx)(a,{sections:n,children:e})}export{B as a,S as b,v as c};
@@ -1,2 +1,2 @@
1
- import{G as w,Qa as c,da as f,ea as h,ga as g}from"./chunk.MODLZJD4.js";import{b as m}from"./chunk.AJZBJBMO.js";var d=m(w(),1);function j(){let e=c();return(0,d.useMemo)(()=>[...new Set(e.flatMap(n=>n.nodeIds))],[e])}function x(){let e=I(),n=f();return(0,d.useMemo)(()=>{if(!n)return e;let t=n.matched;return t.length===0&&e.length===0?[k]:[...new Set([...e,...t])]},[n,e])}function I(){let{store:e,selection:n}=h(),t=g(),r=c();return(0,d.useMemo)(()=>{if(n.length===0)return v;let u=n.join(`
1
+ import{G as w,Qa as c,da as f,ea as h,ga as g}from"./chunk.A5PSEU3W.js";import{b as m}from"./chunk.AJZBJBMO.js";var d=m(w(),1);function j(){let e=c();return(0,d.useMemo)(()=>[...new Set(e.flatMap(n=>n.nodeIds))],[e])}function x(){let e=I(),n=f();return(0,d.useMemo)(()=>{if(!n)return e;let t=n.matched;return t.length===0&&e.length===0?[k]:[...new Set([...e,...t])]},[n,e])}function I(){let{store:e,selection:n}=h(),t=g(),r=c();return(0,d.useMemo)(()=>{if(n.length===0)return v;let u=n.join(`
2
2
  `),s=y.get(e);if(s&&s.violations===r&&s.key===u)return s.reached;let a=new Set(n),i=new Set(a);for(let o of e.graph.allEdges())a.has(o.from)&&i.add(o.to),a.has(o.to)&&i.add(o.from);for(let o of r)if(o.subjectId!==void 0&&a.has(o.subjectId))for(let p of o.nodeIds)i.add(p);let l=[...i];return y.set(e,{violations:r,key:u,reached:l}),l},[e,n,t,r])}var v=[],y=new WeakMap,k="search:nothing";export{j as a,x as b,I as c};
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk.7UHPHEH5.js";import"./chunk.U5P23GO7.js";import"./chunk.QF5QB5YR.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
@@ -1,4 +1,4 @@
1
- import{a as Ct,b as Lt,c as Ce,d as Dt,h as kt,i as ae,j as Ft,k as Tt}from"./chunk.45JP6VGJ.js";import{a as yt}from"./chunk.7VP6Y6D2.js";import{d as vt}from"./chunk.FFOD5B4B.js";import{c as gt}from"./chunk.Z7Y3R3YR.js";import{B as Et,I as xt,J as Pt,i as mt,j as pt,u as wt,v as Rt,y as St,z as bt}from"./chunk.U3HERHAI.js";import{c as Mr}from"./chunk.FBILPNGH.js";import{G as M,P as dt,R as ft,W as Z,fa as ht}from"./chunk.MODLZJD4.js";import{$c as rt,$d as lt,Zd as ot,_d as it,dd as at,eb as tt,pa as de,pe as st,qe as ut,re as ct,sd as nt}from"./chunk.6HY6ZGEE.js";import{b as D}from"./chunk.AJZBJBMO.js";function Or(e,t){return ot(e,t).slice(1)}function fe(e,t){return e.kinds.find(r=>Or(e,r)===t)}function Nn(e,t,r){return it(e,t,r)}function Mn(e,t){return lt(e,t)}var _=D(M(),1),g=D(M(),1),x=D(M(),1),Ye=D(M(),1),hr=D(M(),1),S=D(M(),1),rn=D(M(),1),an=D(M(),1),nn=D(M(),1),v=D(M(),1),Pr=D(M(),1);var Oe=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ut=/^[\\/]{2}/;function Ar(e,t){return t+e.replace(/\\/g,"/")}var Nt="popstate";function ge(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jt(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((h,y)=>c(h,typeof h=="string"?null:h.state,y===0?"default":void 0,typeof h=="string"?void 0:h.mask));let o=s(r??n.length-1),i="POP",l=null;function s(h){return Math.min(Math.max(h,0),n.length-1)}function u(){return n[o]}function c(h,y=null,p,f){let w=ve(n?u().pathname:"/",h,y,p,f);return O(w.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),w}function d(h){return typeof h=="string"?h:B(h)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let y=typeof h=="string"?Y(h):h;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(h,y){i="PUSH";let p=ge(h)?h:c(h,y);o+=1,n.splice(o,n.length,p),a&&l&&l({action:i,location:p,delta:1})},replace(h,y){i="REPLACE";let p=ge(h)?h:c(h,y);n[o]=p,a&&l&&l({action:i,location:p,delta:0})},go(h){i="POP";let y=s(o+h),p=n[y];o=y,l&&l({action:i,location:p,delta:h})},listen(h){return l=h,()=>{l=null}}}}function zt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return ve("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:B(n)}return $r(t,r,null,e)}function L(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _r(){return Math.random().toString(36).substring(2,10)}function Mt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ve(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Y(t):t,state:r,key:t&&t.key||a||_r(),mask:n}}function B({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Y(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function $r(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let f=c(),w=f==null?null:f-u;u=f,s&&s({action:l,location:p.location,delta:w})}function m(f,w){l="PUSH";let R=ge(f)?f:ve(p.location,f,w);r&&r(R,f),u=c()+1;let b=Mt(R,u),P=p.createHref(R.mask||R);try{i.pushState(b,"",P)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;n.location.assign(P)}o&&s&&s({action:l,location:p.location,delta:1})}function h(f,w){l="REPLACE";let R=ge(f)?f:ve(p.location,f,w);r&&r(R,f),u=c();let b=Mt(R,u),P=p.createHref(R.mask||R);i.replaceState(b,"",P),o&&s&&s({action:l,location:p.location,delta:0})}function y(f){return Ir(n,f)}let p={get action(){return l},get location(){return e(n,i)},listen(f){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(Nt,d),s=f,()=>{n.removeEventListener(Nt,d),s=null}},createHref(f){return t(n,f)},createURL:y,encodeLocation(f){let w=y(f);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:h,go(f){return i.go(f)}};return p}function Ir(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),L(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:B(t);return n=n.replace(/ $/,"%20"),!r&&Ut.test(n)&&(n=a+n),new URL(n,a)}var Hr;Hr=new WeakMap;function Ae(e,t,r="/"){return Ur(e,t,r,!1)}function Ur(e,t,r,a,n){let o=typeof t=="string"?Y(t):t,i=U(o.pathname||"/",r);if(i==null)return null;let l=n??zr(e),s=null,u=Zr(i);for(let c=0;s==null&&c<l.length;++c)s=qr(l[c],u,a);return s}function jr(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function zr(e){let t=Bt(e);return Br(t),t}function Bt(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;L(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=H([a,c.relativePath]),m=r.concat(c);i.children&&i.children.length>0&&(L(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Bt(i.children,t,m,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Xr(d,i.index),routesMeta:m.map((h,y)=>{let[p,f]=Vt(h.relativePath,h.caseSensitive,y===m.length-1);return{...h,matcher:p,compiledParams:f}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Wt(i.path))o(i,l,!0,s)}),t}function Wt(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Wt(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function Br(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Qr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Wr=/^:[\w-]+$/,Yr=3,Vr=2,Jr=1,Kr=10,Gr=-2,Ot=e=>e==="*";function Xr(e,t){let r=e.split("/"),a=r.length;return r.some(Ot)&&(a+=Gr),t&&(a+=Vr),r.filter(n=>!Ot(n)).reduce((n,o)=>n+(Wr.test(o)?Yr:o===""?Jr:Kr),a)}function Qr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function qr(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},m=s.matcher&&s.compiledParams?Yt(d,c,s.matcher,s.compiledParams):oe(d,c),h=s.route;if(!m&&u&&r&&!a[a.length-1].route.index&&(m=oe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!m)return null;Object.assign(n,m.params),i.push({params:n,pathname:H([o,m.pathname]),pathnameBase:ta(H([o,m.pathnameBase])),route:h}),m.pathnameBase!=="/"&&(o=H([o,m.pathnameBase]))}return i}function oe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Vt(e.path,e.caseSensitive,e.end);return Yt(e,t,r,a)}function Yt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=ee(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},m)=>{if(c==="*"){let y=l[m]||"";i=ee(o.slice(0,o.length-y.length),1)}let h=l[m];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Vt(e,t=!1,r=!0){O(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Zr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function U(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Jt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Y(e):e,o;return r?(r=Kt(r),r.startsWith("/")||r.startsWith("\\")?o=At(r.substring(1),"/"):o=At(r,t)):o=t,{pathname:o,search:ra(a),hash:aa(n)}}function At(e,t){let r=ee(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Le(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ea(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function _e(e){let t=ea(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Se(e,t,r,a=!1){let n;typeof e=="string"?n=Y(e):(n={...e},L(!n.pathname||!n.pathname.includes("?"),Le("?","pathname","search",n)),L(!n.pathname||!n.pathname.includes("#"),Le("#","pathname","hash",n)),L(!n.search||!n.search.includes("#"),Le("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),d-=1;n.pathname=m.join("/")}l=d>=0?t[d]:"/"}let s=Jt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Kt=e=>e.replace(/[\\/]{2,}/g,"/"),H=e=>Kt(e.join("/"));function ee(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var ta=e=>ee(e).replace(/^\/*/,"/"),ra=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,aa=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Gt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Xt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function na(e){let t=e.map(r=>r.route.path).filter(Boolean);return H(t)||"/"}var Qt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qt(e,t){let r=e;if(typeof r!="string"||!Oe.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Qt)try{let o=new URL(window.location.href),i=Ut.test(r)?new URL(Ar(r,o.protocol)):new URL(r),l=U(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{O(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var An=Symbol("Uninstrumented");var _n=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _t=new URL("http://localhost");function $e(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),_t)}catch{return _t}}function De(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function oa(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function Ie(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!De(n,r),l=!De(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!oa(e,n)||!De(n,o)))throw new Error("External navigation is not allowed")}var Zt=["POST","PUT","PATCH","DELETE"],$n=new Set(Zt),ia=["GET",...Zt],In=new Set(ia);var Hn=Symbol("ResetLoaderData"),la,sa,ua,ca;la=new WeakMap;sa=new WeakMap;ua=new WeakMap;ca=new WeakMap;var da=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function fa(e){try{return da.includes(new URL(e).protocol)}catch{return!1}}var K=_.createContext(null);K.displayName="DataRouter";var te=_.createContext(null);te.displayName="DataRouterState";var er=_.createContext(!1);function ha(){return _.useContext(er)}var He=_.createContext({isTransitioning:!1});He.displayName="ViewTransition";var tr=_.createContext(new Map);tr.displayName="Fetchers";var ma=_.createContext(null);ma.displayName="Await";var N=_.createContext(null);N.displayName="Navigation";var G=_.createContext(null);G.displayName="Location";var I=_.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName="Route";var Ue=_.createContext(null);Ue.displayName="RouteError";var Te=!0,rr="REACT_ROUTER_ERROR",pa="REDIRECT",ya="ROUTE_ERROR_RESPONSE";function ga(e){if(e.startsWith(`${rr}:${pa}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function va(e){if(e.startsWith(`${rr}:${ya}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Gt(t.status,t.statusText,t.data)}catch{}}function be(e,{relative:t}={}){L(X(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(N),{hash:n,pathname:o,search:i}=re(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:H([r,o])),a.createHref({pathname:l,search:i,hash:n})}function X(){return g.useContext(G)!=null}function T(){return L(X(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(G).location}function wa(){return g.useContext(G).navigationType}var ar="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nr(e){g.useContext(N).static||g.useLayoutEffect(e)}function Q(){let{isDataRoute:e}=g.useContext(I);return e?Fa():Ra()}function Ra(){L(X(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(K),{basename:t,navigator:r}=g.useContext(N),{matches:a}=g.useContext(I),{pathname:n}=T(),o=JSON.stringify(_e(a)),i=g.useRef(!1);return nr(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(O(i.current,ar),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=Se(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:H([t,c.pathname])),Ie(typeof s=="string"?s:B(s),r.createHref(c),$e(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Un=g.createContext(null);function Sa(){let{matches:e}=g.useContext(I);return e[e.length-1]?.params??{}}function re(e,{relative:t}={}){let{matches:r}=g.useContext(I),{pathname:a}=T(),n=JSON.stringify(_e(r));return g.useMemo(()=>Se(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function or(e,t){return ir(e,t)}function ir(e,t,r){L(X(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(N),{matches:n}=g.useContext(I),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Te){let f=u&&u.path||"";cr(l,!u||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
1
+ import{a as Ct,b as Lt,c as Ce,d as Dt,h as kt,i as ae,j as Ft,k as Tt}from"./chunk.AJMVRFYX.js";import{a as yt}from"./chunk.EP6Q32WT.js";import{d as vt}from"./chunk.SJQPTDAT.js";import{c as gt}from"./chunk.JQ63N4MZ.js";import{B as Et,I as xt,J as Pt,i as mt,j as pt,u as wt,v as Rt,y as St,z as bt}from"./chunk.QNP5OR3P.js";import{c as Mr}from"./chunk.4W57E7AX.js";import{G as M,P as dt,R as ft,W as Z,fa as ht}from"./chunk.A5PSEU3W.js";import{$c as rt,$d as lt,Zd as ot,_d as it,dd as at,eb as tt,pa as de,pe as st,qe as ut,re as ct,sd as nt}from"./chunk.ZEZUKRC6.js";import{b as D}from"./chunk.AJZBJBMO.js";function Or(e,t){return ot(e,t).slice(1)}function fe(e,t){return e.kinds.find(r=>Or(e,r)===t)}function Nn(e,t,r){return it(e,t,r)}function Mn(e,t){return lt(e,t)}var _=D(M(),1),g=D(M(),1),x=D(M(),1),Ye=D(M(),1),hr=D(M(),1),S=D(M(),1),rn=D(M(),1),an=D(M(),1),nn=D(M(),1),v=D(M(),1),Pr=D(M(),1);var Oe=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ut=/^[\\/]{2}/;function Ar(e,t){return t+e.replace(/\\/g,"/")}var Nt="popstate";function ge(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jt(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((h,y)=>c(h,typeof h=="string"?null:h.state,y===0?"default":void 0,typeof h=="string"?void 0:h.mask));let o=s(r??n.length-1),i="POP",l=null;function s(h){return Math.min(Math.max(h,0),n.length-1)}function u(){return n[o]}function c(h,y=null,p,f){let w=ve(n?u().pathname:"/",h,y,p,f);return O(w.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),w}function d(h){return typeof h=="string"?h:B(h)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let y=typeof h=="string"?Y(h):h;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(h,y){i="PUSH";let p=ge(h)?h:c(h,y);o+=1,n.splice(o,n.length,p),a&&l&&l({action:i,location:p,delta:1})},replace(h,y){i="REPLACE";let p=ge(h)?h:c(h,y);n[o]=p,a&&l&&l({action:i,location:p,delta:0})},go(h){i="POP";let y=s(o+h),p=n[y];o=y,l&&l({action:i,location:p,delta:h})},listen(h){return l=h,()=>{l=null}}}}function zt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return ve("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:B(n)}return $r(t,r,null,e)}function L(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _r(){return Math.random().toString(36).substring(2,10)}function Mt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ve(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Y(t):t,state:r,key:t&&t.key||a||_r(),mask:n}}function B({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Y(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function $r(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let f=c(),w=f==null?null:f-u;u=f,s&&s({action:l,location:p.location,delta:w})}function m(f,w){l="PUSH";let R=ge(f)?f:ve(p.location,f,w);r&&r(R,f),u=c()+1;let b=Mt(R,u),P=p.createHref(R.mask||R);try{i.pushState(b,"",P)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;n.location.assign(P)}o&&s&&s({action:l,location:p.location,delta:1})}function h(f,w){l="REPLACE";let R=ge(f)?f:ve(p.location,f,w);r&&r(R,f),u=c();let b=Mt(R,u),P=p.createHref(R.mask||R);i.replaceState(b,"",P),o&&s&&s({action:l,location:p.location,delta:0})}function y(f){return Ir(n,f)}let p={get action(){return l},get location(){return e(n,i)},listen(f){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(Nt,d),s=f,()=>{n.removeEventListener(Nt,d),s=null}},createHref(f){return t(n,f)},createURL:y,encodeLocation(f){let w=y(f);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:h,go(f){return i.go(f)}};return p}function Ir(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),L(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:B(t);return n=n.replace(/ $/,"%20"),!r&&Ut.test(n)&&(n=a+n),new URL(n,a)}var Hr;Hr=new WeakMap;function Ae(e,t,r="/"){return Ur(e,t,r,!1)}function Ur(e,t,r,a,n){let o=typeof t=="string"?Y(t):t,i=U(o.pathname||"/",r);if(i==null)return null;let l=n??zr(e),s=null,u=Zr(i);for(let c=0;s==null&&c<l.length;++c)s=qr(l[c],u,a);return s}function jr(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function zr(e){let t=Bt(e);return Br(t),t}function Bt(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;L(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=H([a,c.relativePath]),m=r.concat(c);i.children&&i.children.length>0&&(L(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Bt(i.children,t,m,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Xr(d,i.index),routesMeta:m.map((h,y)=>{let[p,f]=Vt(h.relativePath,h.caseSensitive,y===m.length-1);return{...h,matcher:p,compiledParams:f}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Wt(i.path))o(i,l,!0,s)}),t}function Wt(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Wt(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function Br(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Qr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Wr=/^:[\w-]+$/,Yr=3,Vr=2,Jr=1,Kr=10,Gr=-2,Ot=e=>e==="*";function Xr(e,t){let r=e.split("/"),a=r.length;return r.some(Ot)&&(a+=Gr),t&&(a+=Vr),r.filter(n=>!Ot(n)).reduce((n,o)=>n+(Wr.test(o)?Yr:o===""?Jr:Kr),a)}function Qr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function qr(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},m=s.matcher&&s.compiledParams?Yt(d,c,s.matcher,s.compiledParams):oe(d,c),h=s.route;if(!m&&u&&r&&!a[a.length-1].route.index&&(m=oe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!m)return null;Object.assign(n,m.params),i.push({params:n,pathname:H([o,m.pathname]),pathnameBase:ta(H([o,m.pathnameBase])),route:h}),m.pathnameBase!=="/"&&(o=H([o,m.pathnameBase]))}return i}function oe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Vt(e.path,e.caseSensitive,e.end);return Yt(e,t,r,a)}function Yt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=ee(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},m)=>{if(c==="*"){let y=l[m]||"";i=ee(o.slice(0,o.length-y.length),1)}let h=l[m];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Vt(e,t=!1,r=!0){O(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Zr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function U(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Jt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Y(e):e,o;return r?(r=Kt(r),r.startsWith("/")||r.startsWith("\\")?o=At(r.substring(1),"/"):o=At(r,t)):o=t,{pathname:o,search:ra(a),hash:aa(n)}}function At(e,t){let r=ee(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Le(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ea(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function _e(e){let t=ea(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Se(e,t,r,a=!1){let n;typeof e=="string"?n=Y(e):(n={...e},L(!n.pathname||!n.pathname.includes("?"),Le("?","pathname","search",n)),L(!n.pathname||!n.pathname.includes("#"),Le("#","pathname","hash",n)),L(!n.search||!n.search.includes("#"),Le("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),d-=1;n.pathname=m.join("/")}l=d>=0?t[d]:"/"}let s=Jt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Kt=e=>e.replace(/[\\/]{2,}/g,"/"),H=e=>Kt(e.join("/"));function ee(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var ta=e=>ee(e).replace(/^\/*/,"/"),ra=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,aa=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Gt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Xt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function na(e){let t=e.map(r=>r.route.path).filter(Boolean);return H(t)||"/"}var Qt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qt(e,t){let r=e;if(typeof r!="string"||!Oe.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Qt)try{let o=new URL(window.location.href),i=Ut.test(r)?new URL(Ar(r,o.protocol)):new URL(r),l=U(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{O(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var An=Symbol("Uninstrumented");var _n=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _t=new URL("http://localhost");function $e(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),_t)}catch{return _t}}function De(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function oa(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function Ie(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!De(n,r),l=!De(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!oa(e,n)||!De(n,o)))throw new Error("External navigation is not allowed")}var Zt=["POST","PUT","PATCH","DELETE"],$n=new Set(Zt),ia=["GET",...Zt],In=new Set(ia);var Hn=Symbol("ResetLoaderData"),la,sa,ua,ca;la=new WeakMap;sa=new WeakMap;ua=new WeakMap;ca=new WeakMap;var da=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function fa(e){try{return da.includes(new URL(e).protocol)}catch{return!1}}var K=_.createContext(null);K.displayName="DataRouter";var te=_.createContext(null);te.displayName="DataRouterState";var er=_.createContext(!1);function ha(){return _.useContext(er)}var He=_.createContext({isTransitioning:!1});He.displayName="ViewTransition";var tr=_.createContext(new Map);tr.displayName="Fetchers";var ma=_.createContext(null);ma.displayName="Await";var N=_.createContext(null);N.displayName="Navigation";var G=_.createContext(null);G.displayName="Location";var I=_.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName="Route";var Ue=_.createContext(null);Ue.displayName="RouteError";var Te=!0,rr="REACT_ROUTER_ERROR",pa="REDIRECT",ya="ROUTE_ERROR_RESPONSE";function ga(e){if(e.startsWith(`${rr}:${pa}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function va(e){if(e.startsWith(`${rr}:${ya}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Gt(t.status,t.statusText,t.data)}catch{}}function be(e,{relative:t}={}){L(X(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(N),{hash:n,pathname:o,search:i}=re(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:H([r,o])),a.createHref({pathname:l,search:i,hash:n})}function X(){return g.useContext(G)!=null}function T(){return L(X(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(G).location}function wa(){return g.useContext(G).navigationType}var ar="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nr(e){g.useContext(N).static||g.useLayoutEffect(e)}function Q(){let{isDataRoute:e}=g.useContext(I);return e?Fa():Ra()}function Ra(){L(X(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(K),{basename:t,navigator:r}=g.useContext(N),{matches:a}=g.useContext(I),{pathname:n}=T(),o=JSON.stringify(_e(a)),i=g.useRef(!1);return nr(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(O(i.current,ar),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=Se(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:H([t,c.pathname])),Ie(typeof s=="string"?s:B(s),r.createHref(c),$e(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Un=g.createContext(null);function Sa(){let{matches:e}=g.useContext(I);return e[e.length-1]?.params??{}}function re(e,{relative:t}={}){let{matches:r}=g.useContext(I),{pathname:a}=T(),n=JSON.stringify(_e(r));return g.useMemo(()=>Se(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function or(e,t){return ir(e,t)}function ir(e,t,r){L(X(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(N),{matches:n}=g.useContext(I),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Te){let f=u&&u.path||"";cr(l,!u||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
2
 
3
3
  Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let c=T(),d;if(t){let f=typeof t=="string"?Y(t):t;L(s==="/"||f.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${f.pathname}" was given in the \`location\` prop.`),d=f}else d=c;let m=d.pathname||"/",h=m;if(s!=="/"){let f=s.replace(/^\//,"").split("/");h="/"+m.replace(/^\//,"").split("/").slice(f.length).join("/")}let y=r&&r.state.matches.length?r.state.matches.map(f=>Object.assign(f,{route:r.manifest[f.route.id]||f.route})):Ae(e,{pathname:h});Te&&(O(u||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let p=Ca(y&&y.map(f=>Object.assign({},f,{params:Object.assign({},i,f.params),pathname:H([s,a.encodeLocation?a.encodeLocation(f.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?s:H([s,a.encodeLocation?a.encodeLocation(f.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),n,r);return t&&p?g.createElement(G.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},p):p}function ba(){let e=ur(),t=Xt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return Te&&(console.error("Error handled by React Router default ErrorBoundary:",e),i=g.createElement(g.Fragment,null,g.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route."))),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:n},r):null,i)}var Ea=g.createElement(ba,null),lr=class extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=va(e.digest);r&&(e=r)}let t=e!==void 0?g.createElement(I.Provider,{value:this.props.routeContext},g.createElement(Ue.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(xa,{error:e},t):t}};lr.contextType=er;var ke=new WeakMap;function xa({children:e,error:t}){let{basename:r,navigator:a}=g.useContext(N);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=ga(t.digest);if(n){let o=ke.get(t);if(o)throw o;let i=qt(n.location,r),l=i.absoluteURL||i.to;if(Ie(n.location,l,$e(a),"allow-explicit"),fa(l))throw new Error("Invalid redirect location");if(Qt&&!ke.get(t))if(i.isExternal||n.reloadDocument)window.location.href=l;else{let s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw ke.set(t,s),s}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function Pa({routeContext:e,match:t,children:r}){let a=g.useContext(K);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(I.Provider,{value:e},r)}function Ca(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a?.errors;if(o!=null){let c=n.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);L(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,c+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let c=0;c<n.length;c++){let d=n[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:m,errors:h}=a,y=d.route.loader&&!m.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||y){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r?.onError,u=a&&s?(c,d)=>{s(c,{location:a.location,params:a.matches?.[0]?.params??{},pattern:na(a.matches),errorInfo:d})}:void 0;return n.reduceRight((c,d,m)=>{let h,y=!1,p=null,f=null;a&&(h=o&&d.route.id?o[d.route.id]:void 0,p=d.route.errorElement||Ea,i&&(l<0&&m===0?(cr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,f=null):l===m&&(y=!0,f=d.route.hydrateFallbackElement||null)));let w=t.concat(n.slice(0,m+1)),R=()=>{let b;return h?b=p:y?b=f:d.route.Component?b=g.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=c,g.createElement(Pa,{match:d,routeContext:{outlet:c,matches:w,isDataRoute:a!=null},children:b})};return a&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?g.createElement(lr,{location:a.location,revalidation:a.revalidation,component:p,error:h,children:R(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:u}):R()},null)}function je(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function La(e){let t=g.useContext(K);return L(t,je(e)),t}function ze(e){let t=g.useContext(te);return L(t,je(e)),t}function Da(e){let t=g.useContext(I);return L(t,je(e)),t}function Be(e){let t=Da(e),r=t.matches[t.matches.length-1];return L(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ka(){return Be("useRouteId")}function sr(){let e=ze("useNavigation");return g.useMemo(()=>{let{matches:t,historyAction:r,...a}=e.navigation;return a},[e.navigation])}function We(){let{matches:e,loaderData:t}=ze("useMatches");return g.useMemo(()=>e.map(r=>jr(r,t)),[e,t])}function ur(){let e=g.useContext(Ue),t=ze("useRouteError"),r=Be("useRouteError");return e!==void 0?e:t.errors?.[r]}function Fa(){let{router:e}=La("useNavigate"),t=Be("useNavigate"),r=g.useRef(!1);return nr(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{O(r.current,ar),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var $t={};function cr(e,t,r){!t&&!$t[e]&&($t[e]=!0,O(!1,r))}var Ta="useOptimistic",jn=x[Ta];var zn=x.memo(Na);function Na({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return ir(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function Ma({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=x.useRef();o.current==null&&(o.current=jt({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=x.useState({action:i.action,location:i.location}),u=x.useCallback(c=>{n===!1?s(c):x.startTransition(()=>s(c))},[n]);return x.useLayoutEffect(()=>i.listen(u),[i,u]),x.createElement(Ee,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function Oa({to:e,replace:t,state:r,relative:a}){L(X(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=x.useContext(N);O(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=x.useContext(I),{pathname:l}=T(),s=Q(),u=Se(e,_e(i),l,a==="path");Ie(typeof e=="string"?e:B(e),o.createHref(u),$e(o),"reject");let c=JSON.stringify(u);return x.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function dr(e){L(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ee({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){L(!X(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=x.useMemo(()=>({basename:l,navigator:n,static:o,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=Y(r));let{pathname:u="/",search:c="",hash:d="",state:m=null,key:h="default",mask:y}=r,p=x.useMemo(()=>{let f=U(u,l);return f==null?null:{location:{pathname:f,search:c,hash:d,state:m,key:h,mask:y},navigationType:a}},[l,u,c,d,m,h,a,y]);return O(p!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),p==null?null:x.createElement(N.Provider,{value:s},x.createElement(G.Provider,{children:t,value:p}))}function Aa({children:e,location:t}){return or(we(e),t)}function we(e,t=[]){let r=[];return x.Children.forEach(e,(a,n)=>{if(!x.isValidElement(a))return;let o=[...t,n];if(a.type===x.Fragment){r.push.apply(r,we(a.props.children,o));return}L(a.type===dr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),L(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=we(a.props.children,o)),r.push(i)}),r}var pe="get",ye="application/x-www-form-urlencoded";function xe(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function _a(e){return xe(e)&&e.tagName.toLowerCase()==="button"}function $a(e){return xe(e)&&e.tagName.toLowerCase()==="form"}function Ia(e){return xe(e)&&e.tagName.toLowerCase()==="input"}function Ha(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ua(e,t){return e.button===0&&(!t||t==="_self")&&!Ha(e)}function Re(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function ja(e,t){let r=Re(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var he=null;function za(){if(he===null)try{new FormData(document.createElement("form"),0),he=!1}catch{he=!0}return he}var Ba=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fe(e){return e!=null&&!Ba.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ye}"`),null):e}function Wa(e,t){let r,a,n,o,i;if($a(e)){let l=e.getAttribute("action");a=l?U(l,t):null,r=e.getAttribute("method")||pe,n=Fe(e.getAttribute("enctype"))||ye,o=new FormData(e)}else if(_a(e)||Ia(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?U(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||pe,n=Fe(e.getAttribute("formenctype"))||Fe(l.getAttribute("enctype"))||ye,o=new FormData(l,e),!za()){let{name:u,type:c,value:d}=e;if(c==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,d)}}else{if(xe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=pe,a=null,n=ye,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var Bn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ya={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Va=/[&><\u2028\u2029]/g;function It(e){return e.replace(Va,t=>Ya[t])}function Ve(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Ja=Symbol("SingleFetchRedirect");function fr(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&U(n.pathname,t)==="/"?n.pathname=`${ee(t)}/_root.${a}`:n.pathname=`${ee(n.pathname)}.${a}`,n}async function Ka(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function Ga(e){return e!=null&&typeof e.page=="string"}function Xa(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Qa(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await Ka(o,r);return i.links?i.links():[]}return[]}));return tn(a.flat(1).filter(Xa).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Ht(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>r[u].pathname!==s.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let c=a.routes[s.route.id];if(!c||!c.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function qa(e,t,{includeHydrateFallback:r}={}){return Za(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function Za(e){return[...new Set(e)]}function en(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function tn(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Ga(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(en(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function Je(){let e=S.useContext(K);return Ve(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function on(){let e=S.useContext(te);return Ve(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ie=S.createContext(void 0);ie.displayName="FrameworkContext";function Pe(){let e=S.useContext(ie);return Ve(e,"You must render this element inside a <HydratedRouter> element"),e}function ln(e,t){let r=S.useContext(ie),[a,n]=S.useState(!1),[o,i]=S.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,m=S.useRef(null);S.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let p=w=>{w.forEach(R=>{i(R.isIntersecting)})},f=new IntersectionObserver(p,{threshold:.5});return m.current&&f.observe(m.current),()=>{f.disconnect()}}},[e]),S.useEffect(()=>{if(a){let p=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(p)}}},[a]);let h=()=>{n(!0)},y=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:ne(l,h),onBlur:ne(s,y),onMouseEnter:ne(u,h),onMouseLeave:ne(c,y),onTouchStart:ne(d,h)}]:[!1,m,{}]}function ne(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function mr({page:e,...t}){let r=ha(),{nonce:a}=Pe(),{router:n}=Je(),o=S.useMemo(()=>Ae(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?S.createElement(un,{page:e,matches:o,...t}):S.createElement(cn,{page:e,matches:o,...t})):null}function sn(e){let{manifest:t,routeModules:r}=Pe(),[a,n]=S.useState([]);return S.useEffect(()=>{let o=!1;return Qa(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function un({page:e,matches:t,...r}){let a=T(),{future:n}=Pe(),{basename:o}=Je(),i=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=fr(e,o,n.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let c of t)typeof c.route.shouldRevalidate=="function"?s=!0:u.push(c.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,n.v8_trailingSlashAwareDataRequests,e,a,t]);return S.createElement(S.Fragment,null,i.map(l=>S.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function cn({page:e,matches:t,...r}){let a=T(),{future:n,manifest:o,routeModules:i}=Pe(),{basename:l}=Je(),{loaderData:s,matches:u}=on(),c=S.useMemo(()=>Ht(e,t,u,o,a,"data"),[e,t,u,o,a]),d=S.useMemo(()=>Ht(e,t,u,o,a,"assets"),[e,t,u,o,a]),m=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let p=new Set,f=!1;if(t.forEach(R=>{let b=o.routes[R.route.id];!b||!b.hasLoader||(!c.some(P=>P.route.id===R.route.id)&&R.route.id in s&&i[R.route.id]?.shouldRevalidate||b.hasClientLoader?f=!0:p.add(R.route.id))}),p.size===0)return[];let w=fr(e,l,n.v8_trailingSlashAwareDataRequests,"data");return f&&p.size>0&&w.searchParams.set("_routes",t.filter(R=>p.has(R.route.id)).map(R=>R.route.id).join(",")),[w.pathname+w.search]},[l,n.v8_trailingSlashAwareDataRequests,s,a,o,c,t,e,i]),h=S.useMemo(()=>qa(d,o),[d,o]),y=sn(d);return S.createElement(S.Fragment,null,m.map(p=>S.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...r})),h.map(p=>S.createElement("link",{key:p,rel:"modulepreload",href:p,...r})),y.map(({key:p,link:f})=>S.createElement("link",{key:p,nonce:r.nonce,...f,crossOrigin:f.crossOrigin??r.crossOrigin})))}function dn(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var fn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{fn&&(window.__reactRouterVersion="7.18.3")}catch{}function hn({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=zt({window:a,v5Compat:!0}));let o=n.current,[i,l]=v.useState({action:o.action,location:o.location}),s=v.useCallback(u=>{r===!1?l(u):v.startTransition(()=>l(u))},[r]);return v.useLayoutEffect(()=>o.listen(s),[o,s]),v.createElement(Ee,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:r})}function pr({basename:e,children:t,history:r,useTransitions:a}){let[n,o]=v.useState({action:r.action,location:r.location}),i=v.useCallback(l=>{a===!1?o(l):v.startTransition(()=>o(l))},[a]);return v.useLayoutEffect(()=>r.listen(i),[r,i]),v.createElement(Ee,{basename:e,children:t,location:n.location,navigationType:n.action,navigator:r,useTransitions:a})}pr.displayName="unstable_HistoryRouter";var le=v.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:s,target:u,to:c,preventScrollReset:d,viewTransition:m,defaultShouldRevalidate:h,...y},p){let{basename:f,navigator:w,useTransitions:R}=v.useContext(N),b=typeof c=="string"&&Oe.test(c),P=qt(c,f);c=P.to;let E=be(c,{relative:n}),F=T(),k=null;if(l){let W=Se(l,[],F.mask?F.mask.pathname:"/",!0);f!=="/"&&(W.pathname=W.pathname==="/"?f:H([f,W.pathname])),k=w.createHref(W)}let[$,J,z]=ln(a,y),ue=Rr(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:m,defaultShouldRevalidate:h,useTransitions:R});function q(W){t&&t(W),W.defaultPrevented||ue(W)}let ce=!(P.isExternal||o),et=v.createElement("a",{...y,...z,href:(ce?k:void 0)||P.absoluteURL||E,onClick:ce?q:t,ref:dn(p,J),target:u,"data-discover":!b&&r==="render"?"true":void 0});return $&&!b?v.createElement(v.Fragment,null,et,v.createElement(mr,{page:E})):et});le.displayName="Link";var yr=v.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},c){let d=re(i,{relative:u.relative}),m=T(),h=v.useContext(te),{navigator:y,basename:p}=v.useContext(N),f=h!=null&&xr(d)&&l===!0,w=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,R=m.pathname,b=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(R=R.toLowerCase(),b=b?b.toLowerCase():null,w=w.toLowerCase()),b&&p&&(b=U(b,p)||b);let P=w!=="/"&&w.endsWith("/")?w.length-1:w.length,E=R===w||!n&&R.startsWith(w)&&R.charAt(P)==="/",F=b!=null&&(b===w||!n&&b.startsWith(w)&&b.charAt(w.length)==="/"),k={isActive:E,isPending:F,isTransitioning:f},$=E?t:void 0,J;typeof a=="function"?J=a(k):J=[a,E?"active":null,F?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let z=typeof o=="function"?o(k):o;return v.createElement(le,{...u,"aria-current":$,className:J,ref:c,style:z,to:i,viewTransition:l},typeof s=="function"?s(k):s)});yr.displayName="NavLink";var gr=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=pe,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:m,...h},y)=>{let{useTransitions:p}=v.useContext(N),f=Sr(),w=br(l,{relative:u}),R=i.toLowerCase()==="get"?"get":"post",b=typeof l=="string"&&Oe.test(l);return v.createElement("form",{ref:y,method:R,action:w,onSubmit:a?s:E=>{if(s&&s(E),E.defaultPrevented)return;E.preventDefault();let F=E.nativeEvent.submitter,k=F?.getAttribute("formmethod")||i,$=()=>f(F||E.currentTarget,{fetcherKey:t,method:k,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:m});p&&r!==!1?v.startTransition(()=>$()):$()},...h,"data-discover":!b&&e==="render"?"true":void 0})});gr.displayName="Form";function vr({getKey:e,storageKey:t,...r}){let a=v.useContext(ie),{basename:n}=v.useContext(N),o=T(),i=We();Er({getKey:e,storageKey:t});let l=v.useMemo(()=>{if(!a||!e)return null;let u=Me(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let s=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&a?.nonce&&(r.nonce=a.nonce),v.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${It(JSON.stringify(t||Ne))}, ${It(JSON.stringify(l))})`}})}vr.displayName="ScrollRestoration";function wr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ke(e){let t=v.useContext(K);return L(t,wr(e)),t}function mn(e){let t=v.useContext(te);return L(t,wr(e)),t}function Rr(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=Q(),d=T(),m=re(e,{relative:i});return v.useCallback(h=>{if(Ua(h,t)){h.preventDefault();let y=r!==void 0?r:B(d)===B(m),p=()=>c(e,{replace:y,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?v.startTransition(()=>p()):p()}},[d,c,m,r,a,n,t,e,o,i,l,s,u])}function Ge(e){O(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(Re(e)),r=v.useRef(!1),a=T(),n=v.useMemo(()=>ja(a.search,r.current?null:t.current),[a.search]),o=Q(),i=v.useCallback((l,s)=>{let u=Re(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var pn=0,yn=()=>`__${String(++pn)}__`;function Sr(){let{router:e}=Ke("useSubmit"),{basename:t}=v.useContext(N),r=ka(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=Wa(o,t);if(i.navigate===!1){let m=i.fetcherKey||yn();await a(m,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await n(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function br(e,{relative:t}={}){let{basename:r}=v.useContext(N),a=v.useContext(I);L(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...re(e||".",{relative:t})},i=T();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(c=>c==="")){l.delete("index"),s.filter(d=>d).forEach(d=>l.append("index",d));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:H([r,o.pathname])),B(o)}var Ne="react-router-scroll-positions",me={};function Me(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:U(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function Er({getKey:e,storageKey:t}={}){let{router:r}=Ke("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=mn("useScrollRestoration"),{basename:o}=v.useContext(N),i=T(),l=We(),s=sr();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),gn(v.useCallback(()=>{if(s.state==="idle"){let u=Me(i,l,o,e);me[u]=window.scrollY}try{sessionStorage.setItem(t||Ne,JSON.stringify(me))}catch(u){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||Ne);u&&(me=JSON.parse(u))}catch{}},[t]),v.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(me,()=>window.scrollY,e?(c,d)=>Me(c,d,o,e):void 0);return()=>u&&u()},[r,o,e]),v.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{O(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function gn(e,t){let{capture:r}=t||{};v.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function xr(e,{relative:t}={}){let r=v.useContext(He);L(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ke("useViewTransitionState"),n=re(e,{relative:t});if(!r.isTransitioning)return!1;let o=U(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=U(r.nextLocation.pathname,a)||r.nextLocation.pathname;return oe(n.pathname,i)!=null||oe(n.pathname,o)!=null}var Cr=D(M(),1),Lr=D(Mr(),1);var se=D(Z(),1);function Dr({context:e,own:t}){return ae(e.store),ht()?(0,se.jsx)(vn,{context:e,...t?{own:t}:{}}):null}function vn({context:e,own:t}){let r=ft()?.live??e.store;if(ae(r),!Ct(r.batches().length))return null;let n=(0,se.jsx)(Cr.Suspense,{fallback:null,children:(0,se.jsx)(Lt,{remembers:!1})});return t?(0,Lr.createPortal)(n,t):(0,se.jsx)("div",{className:"graview-bar-own",children:n})}var A=D(M(),1);var V=D(M(),1),wn=(0,V.createContext)(null);function si(){let e=new Map,t=new Set,r=()=>{for(let a of t)a()};return{count:a=>e.get(a)??0,place(a){return e.set(a,(e.get(a)??0)+1),r(),()=>{e.set(a,(e.get(a)??1)-1),r()}},subscribe(a){return t.add(a),()=>t.delete(a)}}}function kr(e){let t=(0,V.useContext)(wn);(0,V.useLayoutEffect)(()=>t?.place(e),[t,e])}function ui(e,t){return(0,V.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var Fr=D(M(),1),j=D(Z(),1),Xe="var(--graview-text-small)",Qe="var(--graview-text-body)",gi="var(--graview-font-display, var(--graview-font-body, system-ui))",qe={maxWidth:760,margin:"0 auto",padding:"40px var(--graview-page-gutter, 20px) max(96px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},Ze=1160,vi={...qe,maxWidth:Ze},Tr={margin:0,fontSize:"var(--graview-text-title)",lineHeight:1.2,letterSpacing:"-0.012em",overflowWrap:"anywhere",textWrap:"balance"},wi={margin:0,fontSize:"var(--graview-text-heading)",lineHeight:1.3,textWrap:"balance"},Ri={margin:0,fontSize:Xe,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Si={margin:0,fontSize:Qe,color:"var(--graview-ink-muted)",maxWidth:"60ch"},Nr={color:"var(--graview-ink-muted)",fontSize:Xe},bi={borderTop:"1px solid var(--graview-edge)",paddingTop:24},Rn={color:"var(--graview-accent)",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em",display:"inline-flex",alignItems:"center",columnGap:"0.3em",minHeight:24},Ei={...Rn,textDecoration:"none"},xi={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},Pi=`.graview-list{container-type:inline-size}
4
4
  .graview-rows{display:grid;grid-template-columns:minmax(0,1fr);column-gap:1.5rem;margin:0;padding:0;list-style:none;border-top:1px solid var(--graview-edge)}
@@ -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{b as st}from"./chunk.CEVGND3Y.js";import{a as Ye}from"./chunk.CEQQIW7Z.js";import{a as B,b as He,c as G,d as q,e as ae,g as me,h as Se,i as Fe,j as X}from"./chunk.DQFHIJFN.js";import"./chunk.BFAFCVL4.js";import{a as Ke,b as Je,c as Xe,d as Qe}from"./chunk.32SHA3EY.js";import{h as Be}from"./chunk.GG47EIKO.js";import{a as Me,b as Le}from"./chunk.NYLKG25K.js";import{h as J,i as et,k as tt}from"./chunk.DTCAUPLC.js";import{e as Ze}from"./chunk.PDDIQ6PK.js";import{b as ye,c as We,f as Ge,g as qe}from"./chunk.3PBTN7RO.js";import{d as ze}from"./chunk.QDVGHI7R.js";import{f as _e,g as Ve}from"./chunk.6P6NGZ6D.js";import{a as ie,c as ne,d as he,e as Ue,h as le,j as ge}from"./chunk.M5FP4Y4Q.js";import{d as rt,k as nt}from"./chunk.RSMCTI2N.js";import"./chunk.FIFUMX5X.js";import{a as xe,b as je,c as De}from"./chunk.V7W5AQKL.js";import"./chunk.JXNVNFV4.js";import"./chunk.F4VB6Q2W.js";import{Mb as pe,Pb as fe,Qd as Pe,la as Ie,me as Ce,ne as Re}from"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var It="http://www.w3.org/1999/xhtml",se=class{constructor(t){this.ownerDocument=t}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof F?this.parentNode:null}get textContent(){return this.childNodes.map(t=>t.textContent).join("")}insertBefore(t,n){t.parentNode&&t.parentNode.removeChild(t);let s=n?this.childNodes.indexOf(n):-1;return s<0?this.childNodes.push(t):this.childNodes.splice(s,0,t),t.parentNode=this,t}appendChild(t){return this.insertBefore(t,null)}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}},Q=class extends se{constructor(n,s){super(n);this.data=s}nodeType=3;get textContent(){return this.data}},$e=class extends se{nodeType=8;get textContent(){return""}},F=class extends se{constructor(n,s,a){super(n);this.namespaceURI=s;this.localName=a}nodeType=1;attributes=new Map;value="";checked=!1;selected=!1;setAttribute(n,s){this.attributes.set(n,String(s))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.get(n)??null}hasAttribute(n){return this.attributes.has(n)}closest(n){for(let s=this;s;s=s.parentElement)if(s.localName===n)return s;return null}},Ae=class extends se{nodeType=9;constructor(){super(null)}createElementNS(t,n){return new F(this,t,n)}createElement(t){return new F(this,It,t)}createTextNode(t){return new Q(this,t)}createComment(t){return new $e(this)}};function ot(){let e=new Ae,t=e.createElement("div");return t.setAttribute("data-graview-view-root",""),e.appendChild(t),{document:e,root:t}}var de=function*(e){for(let t of e.childNodes)t instanceof F&&(yield t,yield*de(t))},be=(e,t,n)=>{for(let s=e;s&&s!==t;s=s.parentElement)if(n(s))return s},at=e=>{let t=["id","class","data-record","data-place","data-act","role","name"].flatMap(n=>e.getAttribute(n)===null?[]:[` ${n}="${e.getAttribute(n).slice(0,80)}"`]);return`<${e.localName}${t.join("")}>`},it=e=>e.childNodes.map(t=>t instanceof F?it(t):t.nodeType===3?t.textContent:"").join("");function Te(e,t,n){let s=n.typed??{},a=[],l=[...de(e)].filter(u=>u.getAttribute("data-act")!==null).map(u=>u.getAttribute("data-act"));for(let u of de(e)){let i=u.getAttribute("name");if(!i||!["input","select","textarea"].includes(u.localName))continue;let f=(u.getAttribute("type")??"text").toLowerCase(),m=Object.hasOwn(s,i);if(f==="radio"){let b=u.getAttribute("value")??"on";if(m?String(s[i])!==b:!u.checked)continue;a.push({name:i,value:b,typed:m,empty:!1,chosen:!0})}else if(u.localName==="select"){let b=[...de(u)].filter(T=>T.localName==="option"),o=b.find(T=>T.selected||T.getAttribute("selected")!==null)??b[0],N=m?String(s[i]):o?o.getAttribute("value")??it(o).trim():"";a.push({name:i,value:N,typed:m,empty:N===""&&!m,chosen:!0})}else if(f==="checkbox"){let b=m?s[i]===!0||s[i]==="true"||s[i]==="on":u.checked;a.push({name:i,value:b,typed:m,empty:!b&&!m})}else{let b=be(u,e,k=>k.getAttribute("data-record")!==null)?.getAttribute("data-record")??t,o=u.value===""&&u.getAttribute("data-prefill")===i&&b?tt(n.store,n.principal,n.manifest,n.shown,{record:b,field:i,acts:l}):void 0,N=o!==void 0?{record:b,field:i,value:o}:void 0,T=m?s[i]:o??u.value,y=(f==="number"||f==="range")&&T!==""&&Number.isFinite(Number(T))?Number(T):typeof T=="boolean"?String(T):T;a.push({name:i,value:y,typed:m||N!==void 0,empty:y===""&&!m&&!N,...N?{from:N}:{}})}}return a}function lt(e,t,n,s){let a=n.asked.slice(e.asked),l=n.went.slice(e.went),u=n.renders.length>e.renders,i=e.target!==void 0?t.elementOf(e.target):void 0,f=[...a.map(y=>`its code asked for "${y.name}"`),...l.map(y=>`its code asked to go to "${"record"in y?y.record:y.place}"`),...u?["it drew again"]:[]],m=f.length>0?` When the view heard the click, ${f.join(", ")}.`:"";if(!i)return{selector:e.selector,asked:a,went:l,redrew:u,says:`"${e.selector}" matches nothing the view drew: there is nothing there to press.`};let b=t.root,o={},N=[],T=ge(i,b,y=>le(y,[...de(y)].some(ie)));if(T){let y=T.getAttribute("data-filter"),k=T.getAttribute("data-section"),v=T.getAttribute("data-record"),$={...y?{where:me(y)}:{},...k?{section:k}:{}},c=v?{record:v,...$}:{place:T.getAttribute("data-place")??"",...$},h=X(c,{sees:r=>s.shown.has(r),places:s.places,lists:s.lists,schema:s.store.schema});if(h.ok){o.opens=h.arrival;let r=h.arrival,d="filter"in r&&r.filter?`, narrowed to ${r.filter}`:"";N.push(`It opens ${"record"in r?`the record "${r.record}"`:"place"in r?`the place "${r.place}"`:`the list of ${r.list}`}${d}${r.section?`, at "${r.section}"`:""}.`)}else{let r="place"in c?c.place:c.record,d=!("record"in c&&s.shown.has(c.record))&&!B(s.places,r)&&!s.lists.some(g=>g.slug===r||g.kind===r);o.lost=s.placesUnsure&&d?`${h.says}${q}`:h.says,N.push(`It lands in a link that goes nowhere: ${o.lost}`)}}let p=be(i,b,y=>y.getAttribute("data-act")!==null);if(p){let y=p.getAttribute("data-act"),k=ne(p);if(k)N.push(`It is bound to "${y}", and is never pressed: ${k}`);else if(he(p)){let v=be(p,b,d=>d.getAttribute("data-record")!==null)?.getAttribute("data-record")??void 0,$=be(p,b,d=>d.localName==="fieldset"||d.getAttribute("role")==="group")??b,c={as:y,...v!==void 0?{record:v}:{},fields:Te($,v,s)},h=J(s.store,s.manifest,s.shown,c);if(!h.ok)o.act={as:y,ok:!1,reason:h.reason,message:h.message};else try{let d=s.store.previewAll([{name:h.name,args:h.args}],{author:s.principal,via:`view:${s.manifest.name}`});o.act={as:y,ok:!0,name:h.name,args:h.args,intent:d.intent,changes:d.ops.length>0}}catch(d){o.act=d instanceof pe?{as:y,ok:!1,reason:"refused",message:d.refusal.message}:d instanceof fe?{as:y,ok:!1,reason:"failed",message:_e(d)}:{as:y,ok:!1,reason:"failed",message:"The act could not be applied."}}let r=o.act;N.push(r.ok?`It asks for "${r.name}" with ${JSON.stringify(r.args)}: ${r.changes?`\u201C${r.intent}\u201D, applied for this seat, were it pressed.`:"applied for this seat, it would change nothing."}`:`It asks for "${y}", which the host refuses (${r.reason}): ${r.message}`)}}return N.length===0&&N.push(`It is bound to no act and lands in no link: the host does nothing there${f.length>0?"":", and the view's code does nothing either"}.`),{selector:e.selector,element:at(i),...o,asked:a,went:l,redrew:u,says:`A press on ${at(i)}: ${N.join(" ")}${m}`}}var ce=function*(e){for(let t of e.childNodes)t instanceof F&&(yield t,yield*ce(t))},we=(e,t,n)=>{for(let s=e;s&&s!==t;s=s.parentElement)if(n(s))return s},pt=e=>e.childNodes.map(t=>t instanceof F?t.getAttribute("aria-hidden")==="true"?"":pt(t):t.nodeType===3?t.textContent:"").join(""),ft=e=>{let t=["id","class","data-record","data-place","data-act","data-file","href","role","name"].flatMap(n=>e.getAttribute(n)===null?[]:[` ${n}="${e.getAttribute(n).slice(0,80)}"`]);return`<${e.localName}${t.join("")}>`},P=e=>{let t=(e.getAttribute("aria-label")??pt(e)).replace(/\s+/g," ").trim()||e.getAttribute("title")||e.getAttribute("name")||"";return t?`\u201C${t.length>60?`${t.slice(0,59)}\u2026`:t}\u201D`:ft(e)},dt={number:"1",range:"1",date:"2026-01-15","datetime-local":"2026-01-15T09:00",time:"09:00",month:"2026-01",week:"2026-W03",email:"someone@example.com",url:"https://example.com",tel:"+1 555 0100",text:"A test",search:"A test",textarea:"A test"},ct=e=>e.localName==="textarea"?dt.textarea:dt[(e.getAttribute("type")??"text").toLowerCase()],ut=new Set(["input","textarea","select"]),Pt=e=>e.localName==="button"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"||Ue(e)||["link","menuitem","menuitemcheckbox","menuitemradio","option"].includes(e.getAttribute("role")??"")||e.localName==="a"&&!e.hasAttribute("href")&&!e.hasAttribute("data-record")&&!e.hasAttribute("data-place")&&!e.hasAttribute("data-file"),Ct=e=>e.localName==="summary"||e.hasAttribute("data-lightbox")||e.hasAttribute("data-drop")||e.localName==="graview-video";async function mt(e){let{drawn:t,store:n,principal:s,manifest:a}=e,l=t.root,u=[...ce(l)],i=new Set(e.clicks),f=r=>we(r,l,d=>i.has(t.idOf(d)??""))!==void 0,m=new Set(u.flatMap(r=>r.getAttribute("id")?[r.getAttribute("id")]:[])),b=[],o=(r,d,g,w)=>b.push({control:P(r),element:ft(r),does:d,ok:g,says:w}),N=`view:${a.name}`,T=(r,d)=>{try{return{ok:!0,intent:n.previewAll([{name:r,args:d}],{author:s,via:N}).intent}}catch(g){return g instanceof pe?{ok:!1,message:`this seat may not: ${g.refusal.message}`,missing:!1}:g instanceof fe?{ok:!1,message:Ve(g),missing:g.issues.some(w=>/required|received undefined/i.test(w.message))}:{ok:!1,message:`the act threw: ${g instanceof Error?g.message.slice(0,200):String(g)}`,missing:!1}}},p=(r,d)=>{let g=we(r,l,O=>O.getAttribute("data-record")!==null)?.getAttribute("data-record")??void 0,w=we(r,l,O=>O.localName==="fieldset"||O.getAttribute("role")==="group")??l;return{as:r.getAttribute("data-act"),...g!==void 0?{record:g}:{},fields:Te(w,g,{store:n,principal:s,manifest:a,shown:e.shown,places:e.places,lists:e.lists,typed:d})}},y=(r,d)=>{let g=p(r,d),w=J(n,a,e.shown,g);if(!w.ok)return{ok:!1,message:w.message,missing:!1,press:g};let O=T(w.name,w.args);return O.ok?{ok:!0,intent:O.intent,args:w.args,press:g}:{...O,press:g}},k=(r,d)=>{let g=P(r),w=r.getAttribute("data-act"),O=we(r,l,x=>x.localName==="fieldset"||x.getAttribute("role")==="group")??l,Y=[...ce(O)].filter(x=>ut.has(x.localName)&&x.getAttribute("name")),E=y(r,{}),K=!1,H=Y.filter(x=>x.value===""&&!E.press.fields.find(M=>M.name===x.getAttribute("name"))?.from&&ct(x)!==void 0),A=Object.fromEntries(H.map(x=>[x.getAttribute("name"),ct(x)]));if(H.length>0){let x=y(r,A);x.ok?[E,K]=[x,!E.ok]:(E.ok||E.missing)&&(E=x)}if(!E.ok)return o(r,d,!1,`${g} is refused: ${E.message.replace(/\.$/,"")}.`);let D=n.allMutations().find(x=>x.name===J(n,a,e.shown,E.press).name)?.input?.shape??{},V=E.press.fields.filter(x=>x.from&&Object.hasOwn(D,x.name)&&et(D[x.name],void 0)).map(x=>x.name);if(V.length>0){let x={...K?A:{},...Object.fromEntries(V.map(j=>[j,""]))},M=y(r,x);if(!M.ok)return o(r,d,!1,`${g} is refused when ${V.map(j=>`\u201C${j}\u201D`).join(" and ")} ${V.length===1?"is":"are"} emptied: ${M.message.replace(/\.$/,"")}.`)}return o(r,d,!0,`${g} asks for \u201C${w}\u201D${K?" once its fields are filled":""}${E.intent?`: \u201C${E.intent}\u201D`:", which changes nothing as it is drawn"}.`)},v=0,$=e.maxRuns??24;for(let r of u){if(Ct(r))continue;if(r.hasAttribute("data-act")){let A=ne(r);if(ut.has(r.localName)&&r.hasAttribute("data-save")){let I=r.getAttribute("data-save");I!=="input"&&I!=="change"?o(r,"save",!1,`${P(r)} saves nothing: data-save is "input" or "change", not "${I}".`):k(r,"save")}else A?o(r,"act",!1,`${P(r)} is bound to \u201C${r.getAttribute("data-act")}\u201D and is never pressed: ${A}`):he(r)&&k(r,"act");continue}if(r.localName==="a"&&(r.getAttribute("href")??"").startsWith("#")){let A=r.getAttribute("href").slice(1);o(r,"jump",m.has(A),m.has(A)?`${P(r)} jumps to #${A}.`:`${P(r)} jumps to #${A}, and the view drew no element with that id.`);continue}if(r.hasAttribute("data-file")){let A=r.getAttribute("data-file")??"",I=r.getAttribute("data-field")??"",D=e.shown.has(A)?n.seenBy(s).graph.getNode(A):void 0,V=D&&I?ze(D[I]):[],x=Number(r.getAttribute("data-index")??"0"),M=V[Number.isInteger(x)&&x>=0?x:0];r.localName!=="a"?o(r,"file",!1,`${P(r)} is a file link on a <${r.localName}>: a file link is an <a data-file>.`):D?M?o(r,"file",!0,`${P(r)} ${r.hasAttribute("data-download")?"downloads":"opens"} \u201C${M.name??"the file"}\u201D.`):o(r,"file",!1,`${P(r)} links to the file in "${I||"(no data-field)"}" of "${A}", which holds none.`):o(r,"file",!1,`${P(r)} links to a file of "${A}", which is no record this view was shown.`);continue}if(le(r,[...ce(r)].some(ie))){let A=r.getAttribute("data-filter"),I=r.getAttribute("data-section"),D=r.getAttribute("data-record"),V={...A?{where:me(A)}:{},...I?{section:I}:{}},x=D?{record:D,...V}:{place:r.getAttribute("data-place")??"",...V},M=X(x,{sees:j=>e.shown.has(j),places:e.places,lists:e.lists,schema:n.schema});if(M.ok){let j=M.arrival;o(r,"link",!0,`${P(r)} opens ${"record"in j?`the record "${j.record}"`:"place"in j?`the place "${j.place}"`:`the list of ${j.list}`}.`)}else{let j="place"in x?x.place:x.record,oe="place"in x&&!B(e.places,j)&&!e.lists.some(re=>re.slug===j||re.kind===j);e.placesUnsure&&oe?o(r,"link",!0,`${P(r)} may go nowhere: ${M.says}${q}`):o(r,"link",!1,`${P(r)} goes nowhere: ${M.says}`)}continue}let d=t.idOf(r),g=i.has(d??"");if(!Pt(r)&&!g||!g&&ge(r,l,A=>le(A,[...ce(A)].some(ie))))continue;if(!f(r)){o(r,"nothing",!1,`${P(r)} does nothing: it is bound to no act (data-act), goes nowhere (data-record, data-place), and the view hears no click on it.`);continue}if(d===void 0)continue;if(v>=$){o(r,"code",!0,`${P(r)} was not pressed: the check presses ${$} controls the view's code hears, and this is past them.`);continue}v+=1;let w=await e.rerun(d);if(!w.ok){o(r,"code",!1,w.reason==="error"?`${P(r)} throws when pressed: ${w.detail.replace(/^It threw: /,"")}`:`${P(r)}, pressed, stopped the view (${w.reason}): ${w.detail}`);continue}let O=w.transcript.pressed;if(!O||O.target===void 0){o(r,"code",!1,`${P(r)} could not be pressed in a run of its own: it was not drawn there the same way.`);continue}let Y=w.transcript.asked.slice(O.asked),E=w.transcript.went.slice(O.went),K=w.transcript.renders.length>O.renders,H=[];for(let A of Y){let I=Ze(n,a,A.name,A.args??{},{shown:e.shown,file:()=>{},dropped:()=>{}});if(!I.ok)H.push(`it asks for \u201C${A.name}\u201D from its code, which is refused: ${I.message}${I.reason==="press-only"?` Bind the button to it instead: data-act="${A.name}".`:""}`);else{let D=T(I.name,I.args);D.ok||H.push(`it asks for \u201C${A.name}\u201D, which is refused: ${D.message}`)}}for(let A of E){let I=X(A,{sees:D=>e.shown.has(D),places:e.places,lists:e.lists,schema:n.schema});I.ok||H.push(`it asks to go nowhere: ${I.says}`)}H.length>0?o(r,"code",!1,`${P(r)}, pressed: ${H.join("; ")}`):Y.length===0&&E.length===0&&!K?o(r,"code",!1,`${P(r)} does nothing when pressed: the view hears the click, and asks for no act, goes nowhere and draws nothing new.`):o(r,"code",!0,`${P(r)}, pressed, ${[...Y.length>0?[`asks for ${Y.map(A=>`\u201C${A.name}\u201D`).join(", ")}`]:[],...E.length>0?["goes where it says"]:[],...K?["draws again"]:[]].join(" and ")}.`)}let c=b.filter(r=>!r.ok),h=[`Presses: ${b.length} control${b.length===1?"":"s"} pressed, ${c.length===0?"every one does what it says":`${c.length} ${c.length===1?"fails":"fail"}`}.`];for(let r of b)h.push(` ${r.ok?"ok ":"FAILS"} ${r.says}`);return{ok:c.length===0,controls:b,problems:c,text:`${h.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{c as st}from"./chunk.OCXY5DCD.js";import{a as Ye}from"./chunk.CEQQIW7Z.js";import{a as B,b as He,c as G,d as q,e as ae,g as me,h as Se,i as Fe,j as X}from"./chunk.H6KIEDZN.js";import"./chunk.264PB572.js";import{a as Ke,b as Je,c as Xe,d as Qe}from"./chunk.32SHA3EY.js";import{h as Be}from"./chunk.GG47EIKO.js";import{a as Me,b as Le}from"./chunk.NYLKG25K.js";import{h as J,i as et,k as tt}from"./chunk.EFVSZKB5.js";import{e as Ze}from"./chunk.G3GFDVO2.js";import{b as ye,c as We,f as Ge,g as qe}from"./chunk.D4WJ7OM5.js";import{d as ze}from"./chunk.QDVGHI7R.js";import{f as _e,g as Ve}from"./chunk.AKJS2NUM.js";import{a as ie,c as ne,d as he,e as Ue,h as le,j as ge}from"./chunk.M5FP4Y4Q.js";import{d as rt,k as nt}from"./chunk.RSMCTI2N.js";import"./chunk.URQTF5SY.js";import{a as xe,b as je,c as De}from"./chunk.LP2ZMAT2.js";import"./chunk.B7KZBT27.js";import"./chunk.MUSMNKE4.js";import{Mb as pe,Pb as fe,Qd as Pe,la as Ie,me as Ce,ne as Re}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var It="http://www.w3.org/1999/xhtml",se=class{constructor(t){this.ownerDocument=t}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof F?this.parentNode:null}get textContent(){return this.childNodes.map(t=>t.textContent).join("")}insertBefore(t,n){t.parentNode&&t.parentNode.removeChild(t);let s=n?this.childNodes.indexOf(n):-1;return s<0?this.childNodes.push(t):this.childNodes.splice(s,0,t),t.parentNode=this,t}appendChild(t){return this.insertBefore(t,null)}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}},Q=class extends se{constructor(n,s){super(n);this.data=s}nodeType=3;get textContent(){return this.data}},$e=class extends se{nodeType=8;get textContent(){return""}},F=class extends se{constructor(n,s,a){super(n);this.namespaceURI=s;this.localName=a}nodeType=1;attributes=new Map;value="";checked=!1;selected=!1;setAttribute(n,s){this.attributes.set(n,String(s))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.get(n)??null}hasAttribute(n){return this.attributes.has(n)}closest(n){for(let s=this;s;s=s.parentElement)if(s.localName===n)return s;return null}},Ae=class extends se{nodeType=9;constructor(){super(null)}createElementNS(t,n){return new F(this,t,n)}createElement(t){return new F(this,It,t)}createTextNode(t){return new Q(this,t)}createComment(t){return new $e(this)}};function ot(){let e=new Ae,t=e.createElement("div");return t.setAttribute("data-graview-view-root",""),e.appendChild(t),{document:e,root:t}}var de=function*(e){for(let t of e.childNodes)t instanceof F&&(yield t,yield*de(t))},be=(e,t,n)=>{for(let s=e;s&&s!==t;s=s.parentElement)if(n(s))return s},at=e=>{let t=["id","class","data-record","data-place","data-act","role","name"].flatMap(n=>e.getAttribute(n)===null?[]:[` ${n}="${e.getAttribute(n).slice(0,80)}"`]);return`<${e.localName}${t.join("")}>`},it=e=>e.childNodes.map(t=>t instanceof F?it(t):t.nodeType===3?t.textContent:"").join("");function Te(e,t,n){let s=n.typed??{},a=[],l=[...de(e)].filter(u=>u.getAttribute("data-act")!==null).map(u=>u.getAttribute("data-act"));for(let u of de(e)){let i=u.getAttribute("name");if(!i||!["input","select","textarea"].includes(u.localName))continue;let f=(u.getAttribute("type")??"text").toLowerCase(),m=Object.hasOwn(s,i);if(f==="radio"){let b=u.getAttribute("value")??"on";if(m?String(s[i])!==b:!u.checked)continue;a.push({name:i,value:b,typed:m,empty:!1,chosen:!0})}else if(u.localName==="select"){let b=[...de(u)].filter(T=>T.localName==="option"),o=b.find(T=>T.selected||T.getAttribute("selected")!==null)??b[0],N=m?String(s[i]):o?o.getAttribute("value")??it(o).trim():"";a.push({name:i,value:N,typed:m,empty:N===""&&!m,chosen:!0})}else if(f==="checkbox"){let b=m?s[i]===!0||s[i]==="true"||s[i]==="on":u.checked;a.push({name:i,value:b,typed:m,empty:!b&&!m})}else{let b=be(u,e,k=>k.getAttribute("data-record")!==null)?.getAttribute("data-record")??t,o=u.value===""&&u.getAttribute("data-prefill")===i&&b?tt(n.store,n.principal,n.manifest,n.shown,{record:b,field:i,acts:l}):void 0,N=o!==void 0?{record:b,field:i,value:o}:void 0,T=m?s[i]:o??u.value,y=(f==="number"||f==="range")&&T!==""&&Number.isFinite(Number(T))?Number(T):typeof T=="boolean"?String(T):T;a.push({name:i,value:y,typed:m||N!==void 0,empty:y===""&&!m&&!N,...N?{from:N}:{}})}}return a}function lt(e,t,n,s){let a=n.asked.slice(e.asked),l=n.went.slice(e.went),u=n.renders.length>e.renders,i=e.target!==void 0?t.elementOf(e.target):void 0,f=[...a.map(y=>`its code asked for "${y.name}"`),...l.map(y=>`its code asked to go to "${"record"in y?y.record:y.place}"`),...u?["it drew again"]:[]],m=f.length>0?` When the view heard the click, ${f.join(", ")}.`:"";if(!i)return{selector:e.selector,asked:a,went:l,redrew:u,says:`"${e.selector}" matches nothing the view drew: there is nothing there to press.`};let b=t.root,o={},N=[],T=ge(i,b,y=>le(y,[...de(y)].some(ie)));if(T){let y=T.getAttribute("data-filter"),k=T.getAttribute("data-section"),v=T.getAttribute("data-record"),$={...y?{where:me(y)}:{},...k?{section:k}:{}},c=v?{record:v,...$}:{place:T.getAttribute("data-place")??"",...$},h=X(c,{sees:r=>s.shown.has(r),places:s.places,lists:s.lists,schema:s.store.schema});if(h.ok){o.opens=h.arrival;let r=h.arrival,d="filter"in r&&r.filter?`, narrowed to ${r.filter}`:"";N.push(`It opens ${"record"in r?`the record "${r.record}"`:"place"in r?`the place "${r.place}"`:`the list of ${r.list}`}${d}${r.section?`, at "${r.section}"`:""}.`)}else{let r="place"in c?c.place:c.record,d=!("record"in c&&s.shown.has(c.record))&&!B(s.places,r)&&!s.lists.some(g=>g.slug===r||g.kind===r);o.lost=s.placesUnsure&&d?`${h.says}${q}`:h.says,N.push(`It lands in a link that goes nowhere: ${o.lost}`)}}let p=be(i,b,y=>y.getAttribute("data-act")!==null);if(p){let y=p.getAttribute("data-act"),k=ne(p);if(k)N.push(`It is bound to "${y}", and is never pressed: ${k}`);else if(he(p)){let v=be(p,b,d=>d.getAttribute("data-record")!==null)?.getAttribute("data-record")??void 0,$=be(p,b,d=>d.localName==="fieldset"||d.getAttribute("role")==="group")??b,c={as:y,...v!==void 0?{record:v}:{},fields:Te($,v,s)},h=J(s.store,s.manifest,s.shown,c);if(!h.ok)o.act={as:y,ok:!1,reason:h.reason,message:h.message};else try{let d=s.store.previewAll([{name:h.name,args:h.args}],{author:s.principal,via:`view:${s.manifest.name}`});o.act={as:y,ok:!0,name:h.name,args:h.args,intent:d.intent,changes:d.ops.length>0}}catch(d){o.act=d instanceof pe?{as:y,ok:!1,reason:"refused",message:d.refusal.message}:d instanceof fe?{as:y,ok:!1,reason:"failed",message:_e(d)}:{as:y,ok:!1,reason:"failed",message:"The act could not be applied."}}let r=o.act;N.push(r.ok?`It asks for "${r.name}" with ${JSON.stringify(r.args)}: ${r.changes?`\u201C${r.intent}\u201D, applied for this seat, were it pressed.`:"applied for this seat, it would change nothing."}`:`It asks for "${y}", which the host refuses (${r.reason}): ${r.message}`)}}return N.length===0&&N.push(`It is bound to no act and lands in no link: the host does nothing there${f.length>0?"":", and the view's code does nothing either"}.`),{selector:e.selector,element:at(i),...o,asked:a,went:l,redrew:u,says:`A press on ${at(i)}: ${N.join(" ")}${m}`}}var ce=function*(e){for(let t of e.childNodes)t instanceof F&&(yield t,yield*ce(t))},we=(e,t,n)=>{for(let s=e;s&&s!==t;s=s.parentElement)if(n(s))return s},pt=e=>e.childNodes.map(t=>t instanceof F?t.getAttribute("aria-hidden")==="true"?"":pt(t):t.nodeType===3?t.textContent:"").join(""),ft=e=>{let t=["id","class","data-record","data-place","data-act","data-file","href","role","name"].flatMap(n=>e.getAttribute(n)===null?[]:[` ${n}="${e.getAttribute(n).slice(0,80)}"`]);return`<${e.localName}${t.join("")}>`},P=e=>{let t=(e.getAttribute("aria-label")??pt(e)).replace(/\s+/g," ").trim()||e.getAttribute("title")||e.getAttribute("name")||"";return t?`\u201C${t.length>60?`${t.slice(0,59)}\u2026`:t}\u201D`:ft(e)},dt={number:"1",range:"1",date:"2026-01-15","datetime-local":"2026-01-15T09:00",time:"09:00",month:"2026-01",week:"2026-W03",email:"someone@example.com",url:"https://example.com",tel:"+1 555 0100",text:"A test",search:"A test",textarea:"A test"},ct=e=>e.localName==="textarea"?dt.textarea:dt[(e.getAttribute("type")??"text").toLowerCase()],ut=new Set(["input","textarea","select"]),Pt=e=>e.localName==="button"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"||Ue(e)||["link","menuitem","menuitemcheckbox","menuitemradio","option"].includes(e.getAttribute("role")??"")||e.localName==="a"&&!e.hasAttribute("href")&&!e.hasAttribute("data-record")&&!e.hasAttribute("data-place")&&!e.hasAttribute("data-file"),Ct=e=>e.localName==="summary"||e.hasAttribute("data-lightbox")||e.hasAttribute("data-drop")||e.localName==="graview-video";async function mt(e){let{drawn:t,store:n,principal:s,manifest:a}=e,l=t.root,u=[...ce(l)],i=new Set(e.clicks),f=r=>we(r,l,d=>i.has(t.idOf(d)??""))!==void 0,m=new Set(u.flatMap(r=>r.getAttribute("id")?[r.getAttribute("id")]:[])),b=[],o=(r,d,g,w)=>b.push({control:P(r),element:ft(r),does:d,ok:g,says:w}),N=`view:${a.name}`,T=(r,d)=>{try{return{ok:!0,intent:n.previewAll([{name:r,args:d}],{author:s,via:N}).intent}}catch(g){return g instanceof pe?{ok:!1,message:`this seat may not: ${g.refusal.message}`,missing:!1}:g instanceof fe?{ok:!1,message:Ve(g),missing:g.issues.some(w=>/required|received undefined/i.test(w.message))}:{ok:!1,message:`the act threw: ${g instanceof Error?g.message.slice(0,200):String(g)}`,missing:!1}}},p=(r,d)=>{let g=we(r,l,O=>O.getAttribute("data-record")!==null)?.getAttribute("data-record")??void 0,w=we(r,l,O=>O.localName==="fieldset"||O.getAttribute("role")==="group")??l;return{as:r.getAttribute("data-act"),...g!==void 0?{record:g}:{},fields:Te(w,g,{store:n,principal:s,manifest:a,shown:e.shown,places:e.places,lists:e.lists,typed:d})}},y=(r,d)=>{let g=p(r,d),w=J(n,a,e.shown,g);if(!w.ok)return{ok:!1,message:w.message,missing:!1,press:g};let O=T(w.name,w.args);return O.ok?{ok:!0,intent:O.intent,args:w.args,press:g}:{...O,press:g}},k=(r,d)=>{let g=P(r),w=r.getAttribute("data-act"),O=we(r,l,x=>x.localName==="fieldset"||x.getAttribute("role")==="group")??l,Y=[...ce(O)].filter(x=>ut.has(x.localName)&&x.getAttribute("name")),E=y(r,{}),K=!1,H=Y.filter(x=>x.value===""&&!E.press.fields.find(M=>M.name===x.getAttribute("name"))?.from&&ct(x)!==void 0),A=Object.fromEntries(H.map(x=>[x.getAttribute("name"),ct(x)]));if(H.length>0){let x=y(r,A);x.ok?[E,K]=[x,!E.ok]:(E.ok||E.missing)&&(E=x)}if(!E.ok)return o(r,d,!1,`${g} is refused: ${E.message.replace(/\.$/,"")}.`);let D=n.allMutations().find(x=>x.name===J(n,a,e.shown,E.press).name)?.input?.shape??{},V=E.press.fields.filter(x=>x.from&&Object.hasOwn(D,x.name)&&et(D[x.name],void 0)).map(x=>x.name);if(V.length>0){let x={...K?A:{},...Object.fromEntries(V.map(j=>[j,""]))},M=y(r,x);if(!M.ok)return o(r,d,!1,`${g} is refused when ${V.map(j=>`\u201C${j}\u201D`).join(" and ")} ${V.length===1?"is":"are"} emptied: ${M.message.replace(/\.$/,"")}.`)}return o(r,d,!0,`${g} asks for \u201C${w}\u201D${K?" once its fields are filled":""}${E.intent?`: \u201C${E.intent}\u201D`:", which changes nothing as it is drawn"}.`)},v=0,$=e.maxRuns??24;for(let r of u){if(Ct(r))continue;if(r.hasAttribute("data-act")){let A=ne(r);if(ut.has(r.localName)&&r.hasAttribute("data-save")){let I=r.getAttribute("data-save");I!=="input"&&I!=="change"?o(r,"save",!1,`${P(r)} saves nothing: data-save is "input" or "change", not "${I}".`):k(r,"save")}else A?o(r,"act",!1,`${P(r)} is bound to \u201C${r.getAttribute("data-act")}\u201D and is never pressed: ${A}`):he(r)&&k(r,"act");continue}if(r.localName==="a"&&(r.getAttribute("href")??"").startsWith("#")){let A=r.getAttribute("href").slice(1);o(r,"jump",m.has(A),m.has(A)?`${P(r)} jumps to #${A}.`:`${P(r)} jumps to #${A}, and the view drew no element with that id.`);continue}if(r.hasAttribute("data-file")){let A=r.getAttribute("data-file")??"",I=r.getAttribute("data-field")??"",D=e.shown.has(A)?n.seenBy(s).graph.getNode(A):void 0,V=D&&I?ze(D[I]):[],x=Number(r.getAttribute("data-index")??"0"),M=V[Number.isInteger(x)&&x>=0?x:0];r.localName!=="a"?o(r,"file",!1,`${P(r)} is a file link on a <${r.localName}>: a file link is an <a data-file>.`):D?M?o(r,"file",!0,`${P(r)} ${r.hasAttribute("data-download")?"downloads":"opens"} \u201C${M.name??"the file"}\u201D.`):o(r,"file",!1,`${P(r)} links to the file in "${I||"(no data-field)"}" of "${A}", which holds none.`):o(r,"file",!1,`${P(r)} links to a file of "${A}", which is no record this view was shown.`);continue}if(le(r,[...ce(r)].some(ie))){let A=r.getAttribute("data-filter"),I=r.getAttribute("data-section"),D=r.getAttribute("data-record"),V={...A?{where:me(A)}:{},...I?{section:I}:{}},x=D?{record:D,...V}:{place:r.getAttribute("data-place")??"",...V},M=X(x,{sees:j=>e.shown.has(j),places:e.places,lists:e.lists,schema:n.schema});if(M.ok){let j=M.arrival;o(r,"link",!0,`${P(r)} opens ${"record"in j?`the record "${j.record}"`:"place"in j?`the place "${j.place}"`:`the list of ${j.list}`}.`)}else{let j="place"in x?x.place:x.record,oe="place"in x&&!B(e.places,j)&&!e.lists.some(re=>re.slug===j||re.kind===j);e.placesUnsure&&oe?o(r,"link",!0,`${P(r)} may go nowhere: ${M.says}${q}`):o(r,"link",!1,`${P(r)} goes nowhere: ${M.says}`)}continue}let d=t.idOf(r),g=i.has(d??"");if(!Pt(r)&&!g||!g&&ge(r,l,A=>le(A,[...ce(A)].some(ie))))continue;if(!f(r)){o(r,"nothing",!1,`${P(r)} does nothing: it is bound to no act (data-act), goes nowhere (data-record, data-place), and the view hears no click on it.`);continue}if(d===void 0)continue;if(v>=$){o(r,"code",!0,`${P(r)} was not pressed: the check presses ${$} controls the view's code hears, and this is past them.`);continue}v+=1;let w=await e.rerun(d);if(!w.ok){o(r,"code",!1,w.reason==="error"?`${P(r)} throws when pressed: ${w.detail.replace(/^It threw: /,"")}`:`${P(r)}, pressed, stopped the view (${w.reason}): ${w.detail}`);continue}let O=w.transcript.pressed;if(!O||O.target===void 0){o(r,"code",!1,`${P(r)} could not be pressed in a run of its own: it was not drawn there the same way.`);continue}let Y=w.transcript.asked.slice(O.asked),E=w.transcript.went.slice(O.went),K=w.transcript.renders.length>O.renders,H=[];for(let A of Y){let I=Ze(n,a,A.name,A.args??{},{shown:e.shown,file:()=>{},dropped:()=>{}});if(!I.ok)H.push(`it asks for \u201C${A.name}\u201D from its code, which is refused: ${I.message}${I.reason==="press-only"?` Bind the button to it instead: data-act="${A.name}".`:""}`);else{let D=T(I.name,I.args);D.ok||H.push(`it asks for \u201C${A.name}\u201D, which is refused: ${D.message}`)}}for(let A of E){let I=X(A,{sees:D=>e.shown.has(D),places:e.places,lists:e.lists,schema:n.schema});I.ok||H.push(`it asks to go nowhere: ${I.says}`)}H.length>0?o(r,"code",!1,`${P(r)}, pressed: ${H.join("; ")}`):Y.length===0&&E.length===0&&!K?o(r,"code",!1,`${P(r)} does nothing when pressed: the view hears the click, and asks for no act, goes nowhere and draws nothing new.`):o(r,"code",!0,`${P(r)}, pressed, ${[...Y.length>0?[`asks for ${Y.map(A=>`\u201C${A.name}\u201D`).join(", ")}`]:[],...E.length>0?["goes where it says"]:[],...K?["draws again"]:[]].join(" and ")}.`)}let c=b.filter(r=>!r.ok),h=[`Presses: ${b.length} control${b.length===1?"":"s"} pressed, ${c.length===0?"every one does what it says":`${c.length} ${c.length===1?"fails":"fail"}`}.`];for(let r of b)h.push(` ${r.ok?"ok ":"FAILS"} ${r.says}`);return{ok:c.length===0,controls:b,problems:c,text:`${h.join(`
2
2
  `)}
3
3
  `}}var Rt=e=>`
4
4
  ;(function () {
@@ -18,5 +18,5 @@ ${i}`:f||i;return{root:s,refused:u,size:l.size,over:a,css:m,elementOf:b=>l.eleme
18
18
  "use strict";
19
19
  ${e}
20
20
  });
21
- `}var Bt={scheme:"light",accent:"#2f7d8c",ground:"#f6f8f9",panel:"#ffffff",ink:"#14212b",inkMuted:"#4f6470",edge:"rgba(20, 33, 43, 0.14)",fontBody:"system-ui, sans-serif",fontDisplay:"system-ui, sans-serif",fontMono:"ui-monospace, monospace",radius:"12px"},z=(e,t,n)=>({ok:!1,reason:e,detail:t,...n?{transcript:n}:{}}),te=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),zt=["manifest","source","refused","error","silent","nodes","flood","slow","act","isolate"];function Wt(e){if(!te(e))return;let{renders:t,sheets:n,asked:s,went:a,ms:l,logs:u,messages:i,gestures:f,pressed:m,clicks:b}=e;if(!(!Array.isArray(t)||!t.every(Array.isArray)||!Array.isArray(s)||!Array.isArray(a)||!Array.isArray(u))&&!(typeof l!="number"||typeof i!="number"||n!==void 0&&!(Array.isArray(n)&&n.every(o=>typeof o=="string"))))return{renders:t,...Array.isArray(n)?{sheets:n}:{},asked:s.filter(te).map(o=>({name:String(o.name),args:o.args})),went:a.filter(te).flatMap(o=>{let N=typeof o.section=="string"?{section:o.section}:{},T=o.where!==void 0?{where:o.where}:{};return typeof o.record=="string"?[{record:o.record,...T,...N}]:typeof o.place=="string"?[{place:o.place,...T,...N}]:[]}),ms:l,logs:u.map(String).slice(0,50),messages:i,...Array.isArray(b)?{clicks:b.filter(o=>typeof o=="string").slice(0,2e3)}:{},...Array.isArray(f)?{gestures:f.filter(te).slice(0,32).map(o=>({event:String(o.event),selector:String(o.selector)}))}:{},...te(m)&&typeof m.selector=="string"&&[m.asked,m.went,m.renders].every(o=>typeof o=="number")?{pressed:{selector:m.selector,...typeof m.target=="string"?{target:m.target}:{},asked:m.asked,went:m.went,renders:m.renders}}:{}}}function Gt(e,t){let n=t.gestures??[];return n.length>0&&e.gestures!==!0?[{at:"gestures",says:`It listens for ${n.map(a=>`${a.event} on "${a.selector}"`).join(", ")}, and its manifest does not say "gestures": true: the host forwards no wheel, drag or pinch, and the page scrolls under it. Say "gestures": true in the manifest.`}]:n.length===0&&e.gestures===!0?[{at:"gestures",says:'Its manifest says "gestures": true, and it listens for no wheel, drag or pinch: graview.on("wheel" | "drag" | "pinch", selector, \u2026) is where the host sends one.'}]:[]}var qt=e=>e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,Zt=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");async function Yt(e,t){let n=f=>typeof f=="object"&&f!==null&&!(typeof f.kind=="string"&&f.kind.length>0),s=f=>{let{as:m,slug:b}=f;return typeof m=="string"&&m.length>0?m:typeof b=="string"&&b.length>0?b:void 0},a=e.filter(f=>n(f)&&![void 0,Ce,Re].includes(s(f)));if(a.length===0)return e;let l=t.app?je(t.app,{views:t.views}):De(t.schema,t.views.flatMap(f=>xe(f)??[])),u=f=>l.find(m=>m.slug===s(f)&&m.kind!==null),i=a.filter(f=>!u(f)).map(f=>`"${s(f)}"`);if(i.length>0){let f=i.length===1?"that slug":"those slugs",m=t.app?`the app declares no place by ${f}`:`no kind's list or view the run holds is at ${f}, and the app, which would say its lenses, was not handed (\`app\`)`;throw new TypeError(`runWorkerViewHeadless was handed the place${i.length===1?"":"s"} ${i.join(", ")} without ${i.length===1?"its kind":"their kinds"}, and ${m}: hand each place's \`kind\` as \`placesOf(app)\` lists it, or the app.`)}return e.map(f=>{if(!a.includes(f))return f;let m=u(f);return{...f,kind:m.kind,...m.over?{over:m.over}:{}}})}async function Oe(e){if(typeof e.run!="function")throw new TypeError("runWorkerViewHeadless runs a view only in an isolate the host supplies (`run`); it never runs one in the host's own context.");let{manifest:t,source:n,store:s,principal:a}=e,l={maxSourceBytes:e.limits?.maxSourceBytes??256e3,maxNodes:e.limits?.maxNodes??5e3,messages:e.limits?.messages??120,pushMs:e.limits?.pushMs??1e3,runMs:e.limits?.runMs??5e3},u=We(t,s);if(u.length>0)return z("manifest",u.join(" "));if(typeof n!="string")return z("source","A view's source is text.");if(new TextEncoder().encode(n).length>l.maxSourceBytes)return z("source",`Its code is longer than the ${l.maxSourceBytes.toLocaleString("en-US")} bytes a view may be.`);let i=Ye(n);if(i.length>0)return z("source",i.join(" "));let f=[...e.views??[],t].flatMap(S=>xe(S)??[]).map(S=>({as:S.as,title:S.title,kind:S.kind})),m=new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds]),b=await Yt(e.places??[],{schema:s.schema,...e.app?{app:e.app}:{},views:[...e.views??[],t]}),o=Fe(s.schema,[...b,...f],{kept:m}),N=e.views===void 0,T=Ge(s,t)?(await (__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.I2737CPF.js","./chunk.NJRLJEJY.js","./chunk.CVPMSPCH.js","./chunk.OTV5XTBB.js","./chunk.KBPJ7X7W.js","./chunk.OEIWIZCP.js","./chunk.Z7Y3R3YR.js","./chunk.YXEO3Y65.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.5EMIWORS.js"))).computedOn(s.schema):void 0,p=qe(s,a,{manifest:t,...e.input?{input:e.input}:{},theme:e.theme??Bt,places:He(o),...T?{computed:T}:{}}),y=t.pictures?nt(p,{view:`"${t.title??t.name}"`,pictures:t.pictures,standIn:rt,limits:{...e.limits?.pictureBytes!==void 0?{pictureBytes:e.limits.pictureBytes}:{},...e.limits?.picturesBytes!==void 0?{picturesBytes:e.limits.picturesBytes}:{}}}):{props:p,left:[]},k=y.props,v={props:k,acts:ye(t).map(S=>S.as??S.act),...t.accepts?{accepts:t.accepts.map(({kind:S,field:U})=>({kind:S,field:U}))}:{},places:o.map(S=>({as:S.as,title:S.title})),...N?{placesUnsure:!0}:{},...e.images?{imageOrigins:[...e.images.origins]}:{},...e.links?{linkOrigins:[...e.links.origins]}:{},...e.asset?{assets:!0}:{},...e.origin?{origin:e.origin}:{},lists:Se(s.schema,new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds])).flatMap(S=>[S.slug,S.kind]),limits:{maxNodes:l.maxNodes,messages:l.messages,pushMs:l.pushMs},...e.press!==void 0?{press:{selector:typeof e.press=="string"?e.press:e.press.selector}}:{}},$=async S=>{let U,W;try{let Z=e.run({script:Vt(n),entry:xt,input:JSON.stringify(S),timeoutMs:l.runMs}),Et=new Promise((tr,Ot)=>{W=setTimeout(()=>Ot(Object.assign(new Error("past runMs"),{reason:"slow"})),l.runMs+1e3)});U=await Promise.race([Z,Et])}catch(Z){return te(Z)&&Z.reason==="slow"?z("slow",`It ran longer than the ${l.runMs.toLocaleString("en-US")} ms a headless run may take.`):z("isolate",`The isolate could not run it: ${Z instanceof Error?Z.message:String(Z)}`)}finally{W!==void 0&&clearTimeout(W)}let L;try{L=JSON.parse(String(U))}catch{return z("isolate","The isolate answered with something that is not an outcome.")}if(!te(L))return z("isolate","The isolate answered with something that is not an outcome.");let Ne=Wt(L.transcript);if(L.ok!==!0){let Z=zt.includes(L.reason)?L.reason:"isolate";return z(Z,typeof L.detail=="string"?L.detail.slice(0,2e3):"It failed, and the isolate did not say why.",Ne)}return Ne?{ok:!0,transcript:Ne}:z("isolate","The isolate answered without what the view sent.")},c=await $(v);if(!c.ok)return c;let h=c.transcript,r=e.press!==void 0?h.pressed:void 0,d=Nt(r?{...h,renders:h.renders.slice(0,r.renders)}:h,v,e.brand?.views?.css?{theme:e.brand.views.css}:{});if(!d.ok)return z(d.reason,d.detail,h);let g=new Set([...k.node?[k.node.id]:[],...(k.nodes??[]).map(S=>S.id)]),w=Se(s.schema,new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds])),O=[];for(let S of h.went){if(!("where"in S)&&!("section"in S))continue;let U=X(S,{sees:L=>g.has(L),places:o,lists:w,schema:s.schema}),W="place"in S?B(v.places,S.place)!==void 0||(v.lists??[]).includes(S.place):!0;!U.ok&&W&&O.push({at:"navigate",says:U.says})}let Y=typeof e.press=="object"&&e.press.typed?{typed:e.press.typed}:{},E=r?lt(r,d.drawn,h,{store:s,principal:a,manifest:t,shown:g,places:o,lists:w,...N?{placesUnsure:!0}:{},...Y}):void 0,K=E&&(!E.element||E.lost)?[{at:`press "${E.selector}"`,says:E.lost??E.says}]:[],H;if(e.presses){let S=d.drawn;H=await(typeof e.presses=="function"?e.presses:e.presses.check)({store:s,principal:a,manifest:t,shown:g,places:o,lists:w,...N?{placesUnsure:!0}:{},drawn:S,clicks:h.clicks??[],...typeof e.presses=="object"&&e.presses.maxRuns!==void 0?{maxRuns:e.presses.maxRuns}:{},rerun:async W=>{let L=await $({...v,press:{selector:`[data-graview-check="${W}"]`,target:W}});return L.ok?L:{ok:!1,reason:L.reason,detail:L.detail}}})}let A=t.title??t.name,I=k.today?st(n,{today:k.today,title:t.attach==="home"?"Home":A,...k.locale?{locale:k.locale}:{}}):[],D=[...y.left.map(S=>({at:"pictures",says:S})),...d.problems,...O,...Gt(t,h),...K,...(H?.problems??[]).map(S=>({at:`press ${S.control}`,says:S.says})),...I.map(({at:S,says:U})=>({at:S,says:U}))],V=t.title?Zt(t.title):t.name,x=t.attach==="home"?null:t.attach,M={place:{slug:t.attach==="home"?"home":V,title:A,kind:x,address:t.attach==="home"?"/":`/places/${encodeURIComponent(V)}`},seat:qt(a),width:e.width??1440,variant:(e.width??1440)<640?"phone":"wide",drawnBy:`view:${t.name}`,parts:d.parts,...d.videos.length>0?{videos:d.videos}:{},problems:D},{placeText:j}=await (__graviewPreload(import.meta.url,["./chunk.YNEHJWJV.js","./chunk.V7W5AQKL.js","./chunk.GME63ZHI.js","./chunk.I2737CPF.js","./chunk.NJRLJEJY.js","./chunk.CVPMSPCH.js","./chunk.OTV5XTBB.js","./chunk.KBPJ7X7W.js","./chunk.OEIWIZCP.js","./chunk.FFOD5B4B.js","./chunk.Z7Y3R3YR.js","./chunk.YXEO3Y65.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FBJAQPZ6.js")),oe,re;if(e.audit===!0){let{auditView:S}=await (__graviewPreload(import.meta.url,["./chunk.JO2X52D4.js","./chunk.M5FP4Y4Q.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.LINSO5PN.js")),U=(h.clicks??[]).flatMap(W=>d.drawn.elementOf(W)??[]);oe=S(d.drawn.root,{host:"pending",clicked:U}),e.drawing===!0&&(re={root:d.drawn.root,clicked:U})}return{ok:!0,description:{...M,text:j(M)},props:k,transcript:h,css:d.drawn.css,...E?{pressed:E}:{},...oe?{audit:oe}:{},...re?{drawing:re}:{},...H?{presses:H}:{}}}var Kt=6,ke=function*(e){for(let t of e.childNodes)t.nodeType===1&&(yield t,yield*ke(t))},Jt=(e,t)=>{for(let n=t;n;n=n.parentElement)if(n===e)return!0;return!1};function At(e,t){let n=[...ke(e)].filter(i=>i.getAttribute("data-record")===t);if(n.length===0)return null;let s=n[0];for(;s&&!n.every(i=>Jt(s,i));)s=s.parentElement;let a=s??e,l=[a,...ke(a)].flatMap(i=>i.getAttribute("data-act")?[i.getAttribute("data-act")]:[]),u=[a,...ke(a)].flatMap(i=>i.getAttribute("aria-pressed")||i.getAttribute("aria-checked")?[`${i.getAttribute("aria-pressed")??""}${i.getAttribute("aria-checked")??""}`]:[]);return`${a.textContent.replace(/\s+/g," ").trim()}|${l.join(",")}|${u.join(",")}`}var Tt=(e,t)=>new RegExp(`\\s${t}="([^"]*)"`).exec(e)?.[1];function Xt(e){return new Pe({schema:e.schema,mutations:e.allMutations(),invariants:e.allInvariants(),...e.policy?{policy:e.policy}:{},snapshot:e.graph.snapshot()})}var Qt=e=>JSON.stringify(Object.entries(e??{}).filter(([,t])=>typeof t=="boolean").sort(([t],[n])=>t.localeCompare(n)));async function sn(e){let t=ht(),n=await Oe({...e,run:t,presses:mt,audit:!0,drawing:!0});if(!n.ok||!n.presses||!n.drawing)return n;let s=await er(e,n.presses,n.drawing.root,t);if(s.length===0)return n;let a=[...n.presses.problems,...s];return{...n,presses:{...n.presses,ok:!1,controls:[...n.presses.controls,...s],problems:a,text:`${n.presses.text}${s.map(l=>` FAILS ${l.says}
21
+ `}var Bt={scheme:"light",accent:"#2f7d8c",ground:"#f6f8f9",panel:"#ffffff",ink:"#14212b",inkMuted:"#4f6470",edge:"rgba(20, 33, 43, 0.14)",fontBody:"system-ui, sans-serif",fontDisplay:"system-ui, sans-serif",fontMono:"ui-monospace, monospace",radius:"12px"},z=(e,t,n)=>({ok:!1,reason:e,detail:t,...n?{transcript:n}:{}}),te=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),zt=["manifest","source","refused","error","silent","nodes","flood","slow","act","isolate"];function Wt(e){if(!te(e))return;let{renders:t,sheets:n,asked:s,went:a,ms:l,logs:u,messages:i,gestures:f,pressed:m,clicks:b}=e;if(!(!Array.isArray(t)||!t.every(Array.isArray)||!Array.isArray(s)||!Array.isArray(a)||!Array.isArray(u))&&!(typeof l!="number"||typeof i!="number"||n!==void 0&&!(Array.isArray(n)&&n.every(o=>typeof o=="string"))))return{renders:t,...Array.isArray(n)?{sheets:n}:{},asked:s.filter(te).map(o=>({name:String(o.name),args:o.args})),went:a.filter(te).flatMap(o=>{let N=typeof o.section=="string"?{section:o.section}:{},T=o.where!==void 0?{where:o.where}:{};return typeof o.record=="string"?[{record:o.record,...T,...N}]:typeof o.place=="string"?[{place:o.place,...T,...N}]:[]}),ms:l,logs:u.map(String).slice(0,50),messages:i,...Array.isArray(b)?{clicks:b.filter(o=>typeof o=="string").slice(0,2e3)}:{},...Array.isArray(f)?{gestures:f.filter(te).slice(0,32).map(o=>({event:String(o.event),selector:String(o.selector)}))}:{},...te(m)&&typeof m.selector=="string"&&[m.asked,m.went,m.renders].every(o=>typeof o=="number")?{pressed:{selector:m.selector,...typeof m.target=="string"?{target:m.target}:{},asked:m.asked,went:m.went,renders:m.renders}}:{}}}function Gt(e,t){let n=t.gestures??[];return n.length>0&&e.gestures!==!0?[{at:"gestures",says:`It listens for ${n.map(a=>`${a.event} on "${a.selector}"`).join(", ")}, and its manifest does not say "gestures": true: the host forwards no wheel, drag or pinch, and the page scrolls under it. Say "gestures": true in the manifest.`}]:n.length===0&&e.gestures===!0?[{at:"gestures",says:'Its manifest says "gestures": true, and it listens for no wheel, drag or pinch: graview.on("wheel" | "drag" | "pinch", selector, \u2026) is where the host sends one.'}]:[]}var qt=e=>e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,Zt=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");async function Yt(e,t){let n=f=>typeof f=="object"&&f!==null&&!(typeof f.kind=="string"&&f.kind.length>0),s=f=>{let{as:m,slug:b}=f;return typeof m=="string"&&m.length>0?m:typeof b=="string"&&b.length>0?b:void 0},a=e.filter(f=>n(f)&&![void 0,Ce,Re].includes(s(f)));if(a.length===0)return e;let l=t.app?je(t.app,{views:t.views}):De(t.schema,t.views.flatMap(f=>xe(f)??[])),u=f=>l.find(m=>m.slug===s(f)&&m.kind!==null),i=a.filter(f=>!u(f)).map(f=>`"${s(f)}"`);if(i.length>0){let f=i.length===1?"that slug":"those slugs",m=t.app?`the app declares no place by ${f}`:`no kind's list or view the run holds is at ${f}, and the app, which would say its lenses, was not handed (\`app\`)`;throw new TypeError(`runWorkerViewHeadless was handed the place${i.length===1?"":"s"} ${i.join(", ")} without ${i.length===1?"its kind":"their kinds"}, and ${m}: hand each place's \`kind\` as \`placesOf(app)\` lists it, or the app.`)}return e.map(f=>{if(!a.includes(f))return f;let m=u(f);return{...f,kind:m.kind,...m.over?{over:m.over}:{}}})}async function Oe(e){if(typeof e.run!="function")throw new TypeError("runWorkerViewHeadless runs a view only in an isolate the host supplies (`run`); it never runs one in the host's own context.");let{manifest:t,source:n,store:s,principal:a}=e,l={maxSourceBytes:e.limits?.maxSourceBytes??256e3,maxNodes:e.limits?.maxNodes??5e3,messages:e.limits?.messages??120,pushMs:e.limits?.pushMs??1e3,runMs:e.limits?.runMs??5e3},u=We(t,s);if(u.length>0)return z("manifest",u.join(" "));if(typeof n!="string")return z("source","A view's source is text.");if(new TextEncoder().encode(n).length>l.maxSourceBytes)return z("source",`Its code is longer than the ${l.maxSourceBytes.toLocaleString("en-US")} bytes a view may be.`);let i=Ye(n);if(i.length>0)return z("source",i.join(" "));let f=[...e.views??[],t].flatMap(S=>xe(S)??[]).map(S=>({as:S.as,title:S.title,kind:S.kind})),m=new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds]),b=await Yt(e.places??[],{schema:s.schema,...e.app?{app:e.app}:{},views:[...e.views??[],t]}),o=Fe(s.schema,[...b,...f],{kept:m}),N=e.views===void 0,T=Ge(s,t)?(await (__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.DWM7AR5Y.js","./chunk.6KJGRM7A.js","./chunk.WALVW3KJ.js","./chunk.SNHKYH72.js","./chunk.UGQYMN4J.js","./chunk.RG5G6YQD.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.7WHQWLL6.js"))).computedOn(s.schema):void 0,p=qe(s,a,{manifest:t,...e.input?{input:e.input}:{},theme:e.theme??Bt,places:He(o),...T?{computed:T}:{}}),y=t.pictures?nt(p,{view:`"${t.title??t.name}"`,pictures:t.pictures,standIn:rt,limits:{...e.limits?.pictureBytes!==void 0?{pictureBytes:e.limits.pictureBytes}:{},...e.limits?.picturesBytes!==void 0?{picturesBytes:e.limits.picturesBytes}:{}}}):{props:p,left:[]},k=y.props,v={props:k,acts:ye(t).map(S=>S.as??S.act),...t.accepts?{accepts:t.accepts.map(({kind:S,field:U})=>({kind:S,field:U}))}:{},places:o.map(S=>({as:S.as,title:S.title})),...N?{placesUnsure:!0}:{},...e.images?{imageOrigins:[...e.images.origins]}:{},...e.links?{linkOrigins:[...e.links.origins]}:{},...e.asset?{assets:!0}:{},...e.origin?{origin:e.origin}:{},lists:Se(s.schema,new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds])).flatMap(S=>[S.slug,S.kind]),limits:{maxNodes:l.maxNodes,messages:l.messages,pushMs:l.pushMs},...e.press!==void 0?{press:{selector:typeof e.press=="string"?e.press:e.press.selector}}:{}},$=async S=>{let U,W;try{let Z=e.run({script:Vt(n),entry:xt,input:JSON.stringify(S),timeoutMs:l.runMs}),Et=new Promise((tr,Ot)=>{W=setTimeout(()=>Ot(Object.assign(new Error("past runMs"),{reason:"slow"})),l.runMs+1e3)});U=await Promise.race([Z,Et])}catch(Z){return te(Z)&&Z.reason==="slow"?z("slow",`It ran longer than the ${l.runMs.toLocaleString("en-US")} ms a headless run may take.`):z("isolate",`The isolate could not run it: ${Z instanceof Error?Z.message:String(Z)}`)}finally{W!==void 0&&clearTimeout(W)}let L;try{L=JSON.parse(String(U))}catch{return z("isolate","The isolate answered with something that is not an outcome.")}if(!te(L))return z("isolate","The isolate answered with something that is not an outcome.");let Ne=Wt(L.transcript);if(L.ok!==!0){let Z=zt.includes(L.reason)?L.reason:"isolate";return z(Z,typeof L.detail=="string"?L.detail.slice(0,2e3):"It failed, and the isolate did not say why.",Ne)}return Ne?{ok:!0,transcript:Ne}:z("isolate","The isolate answered without what the view sent.")},c=await $(v);if(!c.ok)return c;let h=c.transcript,r=e.press!==void 0?h.pressed:void 0,d=Nt(r?{...h,renders:h.renders.slice(0,r.renders)}:h,v,e.brand?.views?.css?{theme:e.brand.views.css}:{});if(!d.ok)return z(d.reason,d.detail,h);let g=new Set([...k.node?[k.node.id]:[],...(k.nodes??[]).map(S=>S.id)]),w=Se(s.schema,new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds])),O=[];for(let S of h.went){if(!("where"in S)&&!("section"in S))continue;let U=X(S,{sees:L=>g.has(L),places:o,lists:w,schema:s.schema}),W="place"in S?B(v.places,S.place)!==void 0||(v.lists??[]).includes(S.place):!0;!U.ok&&W&&O.push({at:"navigate",says:U.says})}let Y=typeof e.press=="object"&&e.press.typed?{typed:e.press.typed}:{},E=r?lt(r,d.drawn,h,{store:s,principal:a,manifest:t,shown:g,places:o,lists:w,...N?{placesUnsure:!0}:{},...Y}):void 0,K=E&&(!E.element||E.lost)?[{at:`press "${E.selector}"`,says:E.lost??E.says}]:[],H;if(e.presses){let S=d.drawn;H=await(typeof e.presses=="function"?e.presses:e.presses.check)({store:s,principal:a,manifest:t,shown:g,places:o,lists:w,...N?{placesUnsure:!0}:{},drawn:S,clicks:h.clicks??[],...typeof e.presses=="object"&&e.presses.maxRuns!==void 0?{maxRuns:e.presses.maxRuns}:{},rerun:async W=>{let L=await $({...v,press:{selector:`[data-graview-check="${W}"]`,target:W}});return L.ok?L:{ok:!1,reason:L.reason,detail:L.detail}}})}let A=t.title??t.name,I=k.today?st(n,{today:k.today,title:t.attach==="home"?"Home":A,...k.locale?{locale:k.locale}:{}}):[],D=[...y.left.map(S=>({at:"pictures",says:S})),...d.problems,...O,...Gt(t,h),...K,...(H?.problems??[]).map(S=>({at:`press ${S.control}`,says:S.says})),...I.map(({at:S,says:U})=>({at:S,says:U}))],V=t.title?Zt(t.title):t.name,x=t.attach==="home"?null:t.attach,M={place:{slug:t.attach==="home"?"home":V,title:A,kind:x,address:t.attach==="home"?"/":`/places/${encodeURIComponent(V)}`},seat:qt(a),width:e.width??1440,variant:(e.width??1440)<640?"phone":"wide",drawnBy:`view:${t.name}`,parts:d.parts,...d.videos.length>0?{videos:d.videos}:{},problems:D},{placeText:j}=await (__graviewPreload(import.meta.url,["./chunk.BKYZSV2Y.js","./chunk.LP2ZMAT2.js","./chunk.H3EGBDW2.js","./chunk.DWM7AR5Y.js","./chunk.6KJGRM7A.js","./chunk.WALVW3KJ.js","./chunk.SNHKYH72.js","./chunk.UGQYMN4J.js","./chunk.RG5G6YQD.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.R7CRBRD4.js")),oe,re;if(e.audit===!0){let{auditView:S}=await (__graviewPreload(import.meta.url,["./chunk.JO2X52D4.js","./chunk.M5FP4Y4Q.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UWS4RMM3.js")),U=(h.clicks??[]).flatMap(W=>d.drawn.elementOf(W)??[]);oe=S(d.drawn.root,{host:"pending",clicked:U}),e.drawing===!0&&(re={root:d.drawn.root,clicked:U})}return{ok:!0,description:{...M,text:j(M)},props:k,transcript:h,css:d.drawn.css,...E?{pressed:E}:{},...oe?{audit:oe}:{},...re?{drawing:re}:{},...H?{presses:H}:{}}}var Kt=6,ke=function*(e){for(let t of e.childNodes)t.nodeType===1&&(yield t,yield*ke(t))},Jt=(e,t)=>{for(let n=t;n;n=n.parentElement)if(n===e)return!0;return!1};function At(e,t){let n=[...ke(e)].filter(i=>i.getAttribute("data-record")===t);if(n.length===0)return null;let s=n[0];for(;s&&!n.every(i=>Jt(s,i));)s=s.parentElement;let a=s??e,l=[a,...ke(a)].flatMap(i=>i.getAttribute("data-act")?[i.getAttribute("data-act")]:[]),u=[a,...ke(a)].flatMap(i=>i.getAttribute("aria-pressed")||i.getAttribute("aria-checked")?[`${i.getAttribute("aria-pressed")??""}${i.getAttribute("aria-checked")??""}`]:[]);return`${a.textContent.replace(/\s+/g," ").trim()}|${l.join(",")}|${u.join(",")}`}var Tt=(e,t)=>new RegExp(`\\s${t}="([^"]*)"`).exec(e)?.[1];function Xt(e){return new Pe({schema:e.schema,mutations:e.allMutations(),invariants:e.allInvariants(),...e.policy?{policy:e.policy}:{},snapshot:e.graph.snapshot()})}var Qt=e=>JSON.stringify(Object.entries(e??{}).filter(([,t])=>typeof t=="boolean").sort(([t],[n])=>t.localeCompare(n)));async function sn(e){let t=ht(),n=await Oe({...e,run:t,presses:mt,audit:!0,drawing:!0});if(!n.ok||!n.presses||!n.drawing)return n;let s=await er(e,n.presses,n.drawing.root,t);if(s.length===0)return n;let a=[...n.presses.problems,...s];return{...n,presses:{...n.presses,ok:!1,controls:[...n.presses.controls,...s],problems:a,text:`${n.presses.text}${s.map(l=>` FAILS ${l.says}
22
22
  `).join("")}`}}}async function er(e,t,n,s){let{store:a,principal:l,manifest:u}=e,i=new Set(a.graph.allNodes().map(b=>b.id)),f=new Set,m=[];for(let b of t.controls){if(f.size>=Kt)break;if(b.does!=="act"||!b.ok)continue;let o=Tt(b.element,"data-act"),N=Tt(b.element,"data-record");if(!o||!N)continue;let T=a.graph.getNode(N),p=`${o}|${Qt(T)}`;if(f.has(p))continue;f.add(p);let y=J(a,u,i,{as:o,record:N,fields:[]});if(!y.ok)continue;let k={name:y.name,args:y.args},v=T?`\u201C${Ie(a.schema.tryDefinition(T.kind),T)}\u201D`:`\u201C${N}\u201D`;if(!a.wouldChange(k,l)){let h=g=>new Set(a.allMutations().find(w=>w.name===g)?.writes??[]),r=h(y.name),d=ye(u).filter(g=>g.act!==y.name&&r.size>0&&[...h(g.act)].some(w=>r.has(w))).filter(g=>{let w=J(a,u,i,{as:g.as??g.act,record:N,fields:[]});return w.ok&&a.wouldChange({name:w.name,args:w.args},l)}).map(g=>`\u201C${g.as??g.act}\u201D`);m.push({control:b.control,element:b.element,does:"act",ok:!1,says:`On ${v} it asks for \u201C${o}\u201D, which changes nothing there: it is so already.${d.length>0?` Bind its press there to ${d.join(" or ")} instead, as the page did, so a person can take it back.`:""}`});continue}let $=Xt(a);try{$.apply(k,{author:l})}catch{continue}let c=await Oe({...e,store:$,run:s,audit:!0,drawing:!0});!c.ok||!c.drawing||At(c.drawing.root,N)===At(n,N)&&m.push({control:b.control,element:b.element,does:"act",ok:!1,says:`Pressed on ${v}, it lands, and the design draws ${v} just as before it: show what it changed \u2014 its words or its control (a finished task says so and offers the act that takes it back).`})}return m}export{At as drawnRecord,sn as pressedHere};
@@ -0,0 +1 @@
1
+ import{i}from"./chunk.IAEGJDF3.js";import"./chunk.YZPESGCP.js";import"./chunk.SY5ID44D.js";import"./chunk.GVT4UUQA.js";import"./chunk.O2OL6RQQ.js";import"./chunk.J6HF7IRQ.js";import"./chunk.LRNFE3UK.js";import"./chunk.EP6Q32WT.js";import"./chunk.QAM76AXV.js";import"./chunk.Z27NSSYL.js";import"./chunk.WEMUKZKH.js";import"./chunk.T27QKVKP.js";import"./chunk.WVUJXDXZ.js";import{e as l}from"./chunk.DWM7AR5Y.js";import"./chunk.6KJGRM7A.js";import"./chunk.WALVW3KJ.js";import"./chunk.SNHKYH72.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import"./chunk.MIE4TJRW.js";import"./chunk.QRQ5WPZI.js";import"./chunk.RD2FSSLV.js";import"./chunk.37RFCHSS.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{W as m}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as g}from"./chunk.AJZBJBMO.js";var a=g(m(),1),r=new WeakMap;function c(n){let o=r.get(n);if(!o){let t=l(n);o=e=>e.mode==="fullscreen"?(0,a.jsx)(i,{blocks:t,slot:"home",heading:2,firstHeading:1,...e.flagged?{flagged:e.flagged}:{}}):(0,a.jsx)(i,{blocks:t,slot:"home",heading:3,firstHeading:2,...e.flagged?{flagged:e.flagged}:{}}),r.set(n,o)}return o}export{c as homeView};
@@ -1 +1 @@
1
- import{e as $}from"./chunk.YNEHJWJV.js";import{a as C}from"./chunk.EMFOMSMI.js";import{l as M}from"./chunk.FFOD5B4B.js";import{Ob as x,la as k,ma as v,na as j}from"./chunk.6HY6ZGEE.js";function N(a,s){let c=a.tryDefinition(s),r=Object.keys(c?.fields?.shape??{}),m=[c?.lifecycle?.field,...r.filter(l=>/^(status|stage|state|phase)$/i.test(l))].filter(l=>l!==void 0&&r.includes(l));return[...new Set(m)].slice(0,1)}function P(a,s){return a.tryDefinition(s)?.fieldRoles?.title??"label"}function V(a,s,c={}){let r=s.map(e=>a.graph.getNode(e)).filter(e=>e!==void 0);if(r.length===0)return{acts:[],withheld:[]};let u=c.principal??{kind:"human"},m=C(a,r.map(e=>e.id),{...c.derive,principal:u,...c.context?{context:c.context}:{}}),l=new Map(a.allMutations().map(e=>[e.name,e])),g=[...new Set(r.map(e=>e.kind))],p=new Set(g.map(e=>P(a.schema,e))),h=new Set(m.affordances.filter(e=>e.provider==="schema").map(e=>e.mutation)),o=e=>{let n=l.get(e.mutation);if(!n?.subject)return;let t=r.length===1&&e.provider==="invariant"&&!h.has(e.mutation)&&e.args[n.subject.arg]===r[0].id;if(!(e.provider!=="schema"&&!t)&&!(r.length>1&&e.batch?.length!==r.length)&&n.derived?.act!=="edit"&&!e.open.some(i=>p.has(i.name)))return n},y=[],b=new Set;for(let e of m.affordances){let n=o(e);if(!n||b.has(n.name))continue;b.add(n.name);let{[n.subject.arg]:t,...i}=e.args;y.push({id:e.id,label:v(n),mutation:n.name,subject:n.subject.arg,args:i,open:e.open,...e.destructive||e.setsAside?{more:!0}:{},...e.destructive?{destructive:!0}:{},affordance:{...e,label:v(n)}})}if(g.length===1){let e=g[0];for(let n of N(a.schema,e))for(let t of $(a.schema,[...l.values()],e,n)){if(t.by==="none"||r.every(d=>d[n]===t.value))continue;let i=r.find(d=>d[n]!==t.value),f=t.acts.find(d=>{let D=t.by==="step"?{[d.subject.arg]:i.id}:{[d.subject.arg]:i.id,[n]:t.value};return a.permits({name:d.name,args:D},u).ok});if(!f)continue;let w=t.by==="step"?{}:{[n]:t.value};if(t.by==="step"&&y.some(d=>d.mutation===f.name))continue;let R=t.by==="step"?v(f):`Move to ${t.label}`,O=`set:${n}:${t.value}`;y.push({id:O,label:R,mutation:f.name,subject:f.subject.arg,args:w,open:[],affordance:{id:O,label:R,provider:"schema",mutation:f.name,args:{[f.subject.arg]:i.id,...w},open:[],score:0,why:`every one is ${e}`,nodeIds:r.map(d=>d.id)}})}}let S=[...y.filter(e=>!e.more),...y.filter(e=>e.more)],A=m.withheld.filter(e=>{let n=l.get(e.mutation);return n?.subject!==void 0&&n.derived?.act!=="edit"&&(r.length===1||e.batch?.length===r.length)}).map(e=>({label:v(l.get(e.mutation)),message:e.refusal.message}));return{acts:S,withheld:A}}function _(a,s,c,r={}){let u=r.author,m=a.allMutations().find(e=>e.name===s.mutation),l=e=>M(a.schema,a.allMutations(),e),g=e=>{let n=a.graph.getNode(e);return n?k(a.schema.tryDefinition(n.kind),n):e},p=[],h=[],o=[];for(let e of[...new Set(c)]){let n={name:s.mutation,args:{...s.args,[s.subject]:e}};if(!m){p.push({id:e,label:g(e),message:`There is no act \u201C${s.mutation}\u201D.`,reason:"invalid"});continue}let t=a.permits(n,u);if(!t.ok){p.push({id:e,label:g(e),message:t.refusal.message,reason:"forbidden"});continue}if(!a.wouldChange(n,u)){h.push(e);continue}o.push({id:e,call:n})}let y=e=>a.previewAll(e,{...u?{author:u}:{},...r.context?{context:r.context}:{}});for(let e=0;o.length>0;e+=1)try{y(o.map(n=>n.call));break}catch(n){let t=[];for(let i of o)try{y([i.call]),t.push(i)}catch(f){p.push({id:i.id,label:g(i.id),message:l(f),reason:x(f).reason})}if(t.length===o.length||e>o.length){for(let i of t)p.push({id:i.id,label:g(i.id),message:l(n),reason:x(n).reason});o=[];break}o=t}if(o.length===0)return{applied:[],unchanged:h,refused:p};let b=s.label??(m?v(m):s.mutation),S=[...new Set(o.map(e=>a.graph.getNode(e.id)?.kind))],A=`${b} \u2014 ${S.length===1&&S[0]?j(a.schema,S[0],o.length):`${o.length} records`}`;try{let e=a.applyAll(o.map(n=>n.call),{intent:A,...u?{author:u}:{},...r.via?{via:r.via}:{}});return{batch:e.batch,intent:A,applied:o.map(n=>n.id),unchanged:h,refused:p,result:e}}catch(e){let n=l(e),t=x(e).reason;return{applied:[],unchanged:h,refused:[...p,...o.map(i=>({id:i.id,label:g(i.id),message:n,reason:t}))],allOrNothing:!0}}}export{V as a,_ as b};
1
+ import{e as $}from"./chunk.BKYZSV2Y.js";import{a as C}from"./chunk.MSAYU25L.js";import{l as M}from"./chunk.SJQPTDAT.js";import{Ob as x,la as k,ma as v,na as j}from"./chunk.ZEZUKRC6.js";function N(a,s){let c=a.tryDefinition(s),r=Object.keys(c?.fields?.shape??{}),m=[c?.lifecycle?.field,...r.filter(l=>/^(status|stage|state|phase)$/i.test(l))].filter(l=>l!==void 0&&r.includes(l));return[...new Set(m)].slice(0,1)}function P(a,s){return a.tryDefinition(s)?.fieldRoles?.title??"label"}function V(a,s,c={}){let r=s.map(e=>a.graph.getNode(e)).filter(e=>e!==void 0);if(r.length===0)return{acts:[],withheld:[]};let u=c.principal??{kind:"human"},m=C(a,r.map(e=>e.id),{...c.derive,principal:u,...c.context?{context:c.context}:{}}),l=new Map(a.allMutations().map(e=>[e.name,e])),g=[...new Set(r.map(e=>e.kind))],p=new Set(g.map(e=>P(a.schema,e))),h=new Set(m.affordances.filter(e=>e.provider==="schema").map(e=>e.mutation)),o=e=>{let n=l.get(e.mutation);if(!n?.subject)return;let t=r.length===1&&e.provider==="invariant"&&!h.has(e.mutation)&&e.args[n.subject.arg]===r[0].id;if(!(e.provider!=="schema"&&!t)&&!(r.length>1&&e.batch?.length!==r.length)&&n.derived?.act!=="edit"&&!e.open.some(i=>p.has(i.name)))return n},y=[],b=new Set;for(let e of m.affordances){let n=o(e);if(!n||b.has(n.name))continue;b.add(n.name);let{[n.subject.arg]:t,...i}=e.args;y.push({id:e.id,label:v(n),mutation:n.name,subject:n.subject.arg,args:i,open:e.open,...e.destructive||e.setsAside?{more:!0}:{},...e.destructive?{destructive:!0}:{},affordance:{...e,label:v(n)}})}if(g.length===1){let e=g[0];for(let n of N(a.schema,e))for(let t of $(a.schema,[...l.values()],e,n)){if(t.by==="none"||r.every(d=>d[n]===t.value))continue;let i=r.find(d=>d[n]!==t.value),f=t.acts.find(d=>{let D=t.by==="step"?{[d.subject.arg]:i.id}:{[d.subject.arg]:i.id,[n]:t.value};return a.permits({name:d.name,args:D},u).ok});if(!f)continue;let w=t.by==="step"?{}:{[n]:t.value};if(t.by==="step"&&y.some(d=>d.mutation===f.name))continue;let R=t.by==="step"?v(f):`Move to ${t.label}`,O=`set:${n}:${t.value}`;y.push({id:O,label:R,mutation:f.name,subject:f.subject.arg,args:w,open:[],affordance:{id:O,label:R,provider:"schema",mutation:f.name,args:{[f.subject.arg]:i.id,...w},open:[],score:0,why:`every one is ${e}`,nodeIds:r.map(d=>d.id)}})}}let S=[...y.filter(e=>!e.more),...y.filter(e=>e.more)],A=m.withheld.filter(e=>{let n=l.get(e.mutation);return n?.subject!==void 0&&n.derived?.act!=="edit"&&(r.length===1||e.batch?.length===r.length)}).map(e=>({label:v(l.get(e.mutation)),message:e.refusal.message}));return{acts:S,withheld:A}}function _(a,s,c,r={}){let u=r.author,m=a.allMutations().find(e=>e.name===s.mutation),l=e=>M(a.schema,a.allMutations(),e),g=e=>{let n=a.graph.getNode(e);return n?k(a.schema.tryDefinition(n.kind),n):e},p=[],h=[],o=[];for(let e of[...new Set(c)]){let n={name:s.mutation,args:{...s.args,[s.subject]:e}};if(!m){p.push({id:e,label:g(e),message:`There is no act \u201C${s.mutation}\u201D.`,reason:"invalid"});continue}let t=a.permits(n,u);if(!t.ok){p.push({id:e,label:g(e),message:t.refusal.message,reason:"forbidden"});continue}if(!a.wouldChange(n,u)){h.push(e);continue}o.push({id:e,call:n})}let y=e=>a.previewAll(e,{...u?{author:u}:{},...r.context?{context:r.context}:{}});for(let e=0;o.length>0;e+=1)try{y(o.map(n=>n.call));break}catch(n){let t=[];for(let i of o)try{y([i.call]),t.push(i)}catch(f){p.push({id:i.id,label:g(i.id),message:l(f),reason:x(f).reason})}if(t.length===o.length||e>o.length){for(let i of t)p.push({id:i.id,label:g(i.id),message:l(n),reason:x(n).reason});o=[];break}o=t}if(o.length===0)return{applied:[],unchanged:h,refused:p};let b=s.label??(m?v(m):s.mutation),S=[...new Set(o.map(e=>a.graph.getNode(e.id)?.kind))],A=`${b} \u2014 ${S.length===1&&S[0]?j(a.schema,S[0],o.length):`${o.length} records`}`;try{let e=a.applyAll(o.map(n=>n.call),{intent:A,...u?{author:u}:{},...r.via?{via:r.via}:{}});return{batch:e.batch,intent:A,applied:o.map(n=>n.id),unchanged:h,refused:p,result:e}}catch(e){let n=l(e),t=x(e).reason;return{applied:[],unchanged:h,refused:[...p,...o.map(i=>({id:i.id,label:g(i.id),message:n,reason:t}))],allOrNothing:!0}}}export{V as a,_ as b};
@@ -1,3 +1,3 @@
1
- import{b as te}from"./chunk.OJY7VJ7D.js";import"./chunk.WSDJPXJD.js";import"./chunk.F4VB6Q2W.js";import"./chunk.FFOD5B4B.js";import{b as ne}from"./chunk.Z7Y3R3YR.js";import"./chunk.YXEO3Y65.js";import{G as ge,W as ee}from"./chunk.MODLZJD4.js";import"./chunk.SDO3U72B.js";import{la as X,na as Z,rd as q}from"./chunk.6HY6ZGEE.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
1
+ import{b as te}from"./chunk.YCD4JSXD.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import{b as ne}from"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import{G as ge,W as ee}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import{la as X,na as Z,rd as q}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
2
2
  `),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
3
3
  `)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
@@ -1 +1 @@
1
- import{Fb as a,la as l,ra as p}from"./chunk.6HY6ZGEE.js";import{c}from"./chunk.FQLNBIQ5.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{Fb as a,la as l,ra as p}from"./chunk.ZEZUKRC6.js";import{c}from"./chunk.FQLNBIQ5.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};