graview 0.1.65 → 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.
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/preview/{chunk.3IZEZPJB.js → chunk.25QFDTCU.js} +1 -1
- package/dist/preview/{chunk.SOMRYDDH.js → chunk.264PB572.js} +1 -1
- package/dist/preview/chunk.2FHIINXG.js +2 -0
- package/dist/preview/chunk.2VUX54XH.js +1 -0
- package/dist/preview/chunk.32SHA3EY.js +1 -0
- package/dist/preview/{chunk.ZDUTEM3Z.js → chunk.35KMZHB7.js} +1 -1
- package/dist/preview/{chunk.74B6KQF4.js → chunk.37RFCHSS.js} +1 -1
- package/dist/preview/chunk.3ENPWZBG.js +1 -0
- package/dist/preview/chunk.3GNT5MKP.js +50 -0
- package/dist/preview/chunk.3NSV3WKM.js +22 -0
- package/dist/preview/chunk.3ZODN6BW.js +1 -0
- package/dist/preview/{chunk.7VQ3C7F4.js → chunk.47XEJZ3O.js} +1 -1
- package/dist/preview/{chunk.KIQXTQDU.js → chunk.4EMKCKDB.js} +1 -1
- package/dist/preview/{chunk.LKK5YF2H.js → chunk.4UUJHLHR.js} +1 -1
- package/dist/preview/{chunk.L6FGKJ5H.js → chunk.4W57E7AX.js} +1 -1
- package/dist/preview/chunk.55G4IPOO.js +1 -0
- package/dist/preview/chunk.5AKZROMR.js +1 -0
- package/dist/preview/chunk.5J6DVR7S.js +1 -0
- package/dist/preview/chunk.5R744JGZ.js +19 -0
- package/dist/preview/{chunk.64FCAUAJ.js → chunk.6KJGRM7A.js} +1 -1
- package/dist/preview/{chunk.INTJD5WG.js → chunk.6N4PE3U5.js} +1 -1
- package/dist/preview/{chunk.44ZHHPPJ.js → chunk.6NG76MDA.js} +2 -2
- package/dist/preview/chunk.6SJEZWH3.js +1 -0
- package/dist/preview/chunk.6UQFV53C.js +1 -0
- package/dist/preview/chunk.6W6XMLSF.js +1 -0
- package/dist/preview/chunk.77C556NM.js +1 -0
- package/dist/preview/{chunk.7E4CSXBT.js → chunk.7ARRVNUR.js} +1 -1
- package/dist/preview/chunk.7BJRHPE3.js +23 -0
- package/dist/preview/{chunk.TY74U3EI.js → chunk.7S6ZRMW4.js} +1 -1
- package/dist/preview/{chunk.F5VEHAP2.js → chunk.7UHPHEH5.js} +1 -1
- package/dist/preview/chunk.7WHQWLL6.js +1 -0
- package/dist/preview/{chunk.NSO6RUKW.js → chunk.A4EZAGG7.js} +1 -1
- package/dist/preview/chunk.A5PSEU3W.js +25 -0
- package/dist/preview/{chunk.2TZSLREX.js → chunk.A7GVTE5Y.js} +2 -2
- package/dist/preview/chunk.AJMVRFYX.js +5 -0
- package/dist/preview/chunk.AKJS2NUM.js +1 -0
- package/dist/preview/chunk.ARWO4WOV.js +1 -0
- package/dist/preview/chunk.B5SJMCTT.js +7 -0
- package/dist/preview/{chunk.2QQ37RCZ.js → chunk.B7KZBT27.js} +1 -1
- package/dist/preview/chunk.BDNQMKDG.js +35 -0
- package/dist/preview/chunk.BKYZSV2Y.js +2 -0
- package/dist/preview/chunk.CEQQIW7Z.js +1 -0
- package/dist/preview/chunk.CKDCTFLU.js +1 -0
- package/dist/preview/chunk.CTUJZ3IV.js +1 -0
- package/dist/preview/chunk.CY7FFKEZ.js +1 -0
- package/dist/preview/chunk.D4WJ7OM5.js +1 -0
- package/dist/preview/{chunk.AB4RZSYW.js → chunk.D7NWMXSX.js} +16 -16
- package/dist/preview/chunk.DEKRFTRN.js +4 -0
- package/dist/preview/{chunk.6YDC6IDA.js → chunk.DKEIEH2D.js} +1 -1
- package/dist/preview/{chunk.S2DOVJRL.js → chunk.DWM7AR5Y.js} +1 -1
- package/dist/preview/{chunk.FHHVW2WB.js → chunk.DZMIYEHQ.js} +1 -1
- package/dist/preview/chunk.E5PYNAYT.js +21 -0
- package/dist/preview/chunk.EBKH3ILT.js +1 -0
- package/dist/preview/chunk.EFVSZKB5.js +1 -0
- package/dist/preview/chunk.EG7OOJH5.js +1 -0
- package/dist/preview/chunk.EGPCVMDU.js +1 -0
- package/dist/preview/{chunk.C437FVD7.js → chunk.EJ2EZL2G.js} +1 -1
- package/dist/preview/{chunk.IR4OW67N.js → chunk.EP6Q32WT.js} +1 -1
- package/dist/preview/{chunk.G3Q5IMM3.js → chunk.F464JKHZ.js} +1 -1
- package/dist/preview/{chunk.IFBGYFS4.js → chunk.FLJXYESX.js} +1 -1
- package/dist/preview/chunk.FOUBDGL3.js +1 -0
- package/dist/preview/chunk.FPHRAO3R.js +1 -0
- package/dist/preview/chunk.FRQSLWP4.js +1 -0
- package/dist/preview/chunk.FVQKSN33.js +1 -0
- package/dist/preview/{chunk.CGQ6KXVK.js → chunk.G3GFDVO2.js} +1 -1
- package/dist/preview/{chunk.4O3C2LJF.js → chunk.G5GVT6JY.js} +1 -1
- package/dist/preview/chunk.GFLH7RCI.js +1 -0
- package/dist/preview/chunk.GG47EIKO.js +1 -0
- package/dist/preview/chunk.GMLONS5L.js +1 -0
- package/dist/preview/{chunk.RFVOXX3P.js → chunk.GRFD42WM.js} +1 -1
- package/dist/preview/{chunk.2PK335JQ.js → chunk.GVT4UUQA.js} +1 -1
- package/dist/preview/{chunk.5M34BJIQ.js → chunk.H3EGBDW2.js} +1 -1
- package/dist/preview/chunk.H6KIEDZN.js +1 -0
- package/dist/preview/chunk.HAOB6O72.js +1 -0
- package/dist/preview/chunk.HB5NWHFP.js +3 -0
- package/dist/preview/{chunk.GPCKOYSF.js → chunk.HJUZMOW2.js} +1 -1
- package/dist/preview/chunk.HN4ZJ4B4.js +1 -0
- package/dist/preview/chunk.HVBKI5ZO.js +1 -0
- package/dist/preview/chunk.I3SDKMQS.js +1 -0
- package/dist/preview/chunk.IAEGJDF3.js +1 -0
- package/dist/preview/{chunk.CS72MISN.js → chunk.IDALEKIW.js} +1 -1
- package/dist/preview/chunk.ILJDLBPJ.js +1 -0
- package/dist/preview/chunk.J2OPIS3H.js +111 -0
- package/dist/preview/chunk.J5OLYVZ4.js +1 -0
- package/dist/preview/{chunk.3KUYB5ZT.js → chunk.J6HF7IRQ.js} +1 -1
- package/dist/preview/chunk.JEC5FDKX.js +1 -0
- package/dist/preview/chunk.JKFVNQY7.js +1 -0
- package/dist/preview/chunk.JO2X52D4.js +1 -0
- package/dist/preview/{chunk.LVD3V77M.js → chunk.JQ2WNKDW.js} +1 -1
- package/dist/preview/{chunk.NBVPWLRY.js → chunk.JQ63N4MZ.js} +1 -1
- package/dist/preview/{chunk.7Q43N5JS.js → chunk.JU6UFWS3.js} +1 -1
- package/dist/preview/chunk.JVB5KDSG.js +1 -0
- package/dist/preview/chunk.KFT7JIEH.js +1 -0
- package/dist/preview/chunk.KGMSSXZL.js +1 -0
- package/dist/preview/chunk.KX5ZBHMA.js +2 -0
- package/dist/preview/{chunk.XTTESA7X.js → chunk.LP2ZMAT2.js} +1 -1
- package/dist/preview/{chunk.IMKD6QQG.js → chunk.LRNFE3UK.js} +1 -1
- package/dist/preview/{chunk.BUQKRXI6.js → chunk.LVOTLGJB.js} +1 -1
- package/dist/preview/chunk.LYEGRY77.js +3 -0
- package/dist/preview/{chunk.B3WVCSW5.js → chunk.M5FP4Y4Q.js} +1 -1
- package/dist/preview/{chunk.MH46V556.js → chunk.M7KXQGQL.js} +1 -1
- package/dist/preview/{chunk.LY5CY7GE.js → chunk.MAKCZ6B6.js} +1 -1
- package/dist/preview/{chunk.5THLLSS4.js → chunk.MJY4SLWA.js} +1 -1
- package/dist/preview/{chunk.J6KNEI5R.js → chunk.MSAYU25L.js} +1 -1
- package/dist/preview/chunk.MUSMNKE4.js +1 -0
- package/dist/preview/chunk.MW7R5G3C.js +1 -0
- package/dist/preview/chunk.N4ZKZ4GM.js +6 -0
- package/dist/preview/chunk.NAXOXBOF.js +1 -0
- package/dist/preview/{chunk.LGRQDILY.js → chunk.NKLPL7QD.js} +1 -1
- package/dist/preview/chunk.NKYWIGC7.js +3 -0
- package/dist/preview/{chunk.35E75QJ7.js → chunk.NRURQGXV.js} +1 -1
- package/dist/preview/chunk.NSOPYIT4.js +1 -0
- package/dist/preview/chunk.NXZL5CA2.js +1 -0
- package/dist/preview/chunk.NYLKG25K.js +4 -0
- package/dist/preview/{chunk.BU5PVRX7.js → chunk.O2OL6RQQ.js} +1 -1
- package/dist/preview/chunk.O5VFKVZS.js +1 -0
- package/dist/preview/chunk.OCXY5DCD.js +6 -0
- package/dist/preview/chunk.OHAO6KKH.js +1 -0
- package/dist/preview/{chunk.CXDGE5ZS.js → chunk.OWO3OV62.js} +1 -1
- package/dist/preview/chunk.P2EKKKK2.js +1 -0
- package/dist/preview/chunk.PSNMZBVS.js +1 -0
- package/dist/preview/{chunk.NKYYDFIX.js → chunk.PZ7KY6XH.js} +1 -1
- package/dist/preview/chunk.QAM76AXV.js +1 -0
- package/dist/preview/chunk.QDVGHI7R.js +1 -0
- package/dist/preview/{chunk.HJS3LTSR.js → chunk.QF5QB5YR.js} +1 -1
- package/dist/preview/chunk.QNP5OR3P.js +93 -0
- package/dist/preview/chunk.QRQ5WPZI.js +1 -0
- package/dist/preview/chunk.QWGWOEBZ.js +90 -0
- package/dist/preview/chunk.QXLJGHMC.js +23 -0
- package/dist/preview/{chunk.3RFAUIGT.js → chunk.QZQCQWQG.js} +1 -1
- package/dist/preview/chunk.R6JBA7UK.js +1 -0
- package/dist/preview/chunk.R7CRBRD4.js +1 -0
- package/dist/preview/chunk.RD2FSSLV.js +1 -0
- package/dist/preview/{chunk.CD6YWH6T.js → chunk.RG5G6YQD.js} +1 -1
- package/dist/preview/{chunk.T3KNLP7C.js → chunk.RJY7VJBH.js} +1 -1
- package/dist/preview/chunk.RR25BGWP.js +1 -0
- package/dist/preview/chunk.RSMCTI2N.js +1 -0
- package/dist/preview/{chunk.ZYNC73DJ.js → chunk.RSQ432QN.js} +1 -1
- package/dist/preview/chunk.SFBHPYRD.js +1 -0
- package/dist/preview/{chunk.FOSY7MZF.js → chunk.SJQPTDAT.js} +1 -1
- package/dist/preview/{chunk.TUCSUZNO.js → chunk.SNHKYH72.js} +1 -1
- package/dist/preview/chunk.SO6NT5K7.js +1 -0
- package/dist/preview/{chunk.FDWRH5P2.js → chunk.STPA7HBK.js} +3 -3
- package/dist/preview/{chunk.R2TSTDS3.js → chunk.SY5ID44D.js} +1 -1
- package/dist/preview/chunk.T27QKVKP.js +1 -0
- package/dist/preview/{chunk.FXG5AJF6.js → chunk.T2OUHRAA.js} +1 -1
- package/dist/preview/chunk.T3WCRS6M.js +1 -0
- package/dist/preview/chunk.TI5FR2QQ.js +1 -0
- package/dist/preview/{chunk.N2FNHRI2.js → chunk.TTSGCNPT.js} +1 -1
- package/dist/preview/{chunk.P6TZGR3A.js → chunk.TXZQEJ5T.js} +1 -1
- package/dist/preview/chunk.U6QXLNHF.js +15 -0
- package/dist/preview/{chunk.DICM56FT.js → chunk.UDHPMVC4.js} +1 -1
- package/dist/preview/{chunk.ZMWAZACO.js → chunk.UGQYMN4J.js} +1 -1
- package/dist/preview/chunk.UJPX3BUV.js +1 -0
- package/dist/preview/{chunk.CPYBJNHP.js → chunk.UQIPEMJ5.js} +1 -1
- package/dist/preview/{chunk.XSWR5LI4.js → chunk.URQTF5SY.js} +1 -1
- package/dist/preview/{chunk.7IGD2K4M.js → chunk.UW52CMGJ.js} +1 -1
- package/dist/preview/chunk.UWS4RMM3.js +1 -0
- package/dist/preview/{chunk.KHAVEYT7.js → chunk.V7H4BUEB.js} +1 -1
- package/dist/preview/{chunk.KHRS2SKB.js → chunk.VBHV4TLG.js} +1 -1
- package/dist/preview/chunk.VBLQJVQ5.js +1 -0
- package/dist/preview/{chunk.SPCAMQJE.js → chunk.WALVW3KJ.js} +1 -1
- package/dist/preview/{chunk.6RZHKQP3.js → chunk.WEMUKZKH.js} +1 -1
- package/dist/preview/chunk.X226YATK.js +2 -0
- package/dist/preview/{chunk.IJ3YDBWI.js → chunk.XFLGSUYO.js} +1 -1
- package/dist/preview/{chunk.ZTN7BS5O.js → chunk.XSWSBTUO.js} +1 -1
- package/dist/preview/{chunk.ZJFXM3LE.js → chunk.YCD4JSXD.js} +1 -1
- package/dist/preview/{chunk.QSDBF7VL.js → chunk.YZPESGCP.js} +1 -1
- package/dist/preview/{chunk.QO5RXOCS.js → chunk.Z27NSSYL.js} +2 -2
- package/dist/preview/chunk.Z2XUVJAL.js +1 -0
- package/dist/preview/{chunk.S3EEY7T3.js → chunk.Z3O2VZAJ.js} +1 -1
- package/dist/preview/chunk.Z4TY44CD.js +1 -0
- package/dist/preview/{chunk.O2W5JTWA.js → chunk.ZAPS4J6G.js} +1 -1
- package/dist/preview/{chunk.F2TWV4TX.js → chunk.ZAQ4IDX6.js} +1 -1
- package/dist/preview/chunk.ZEZUKRC6.js +5 -0
- package/dist/preview/{chunk.PTQPS2FJ.js → chunk.ZG5VGP5U.js} +1 -1
- package/dist/preview/chunk.ZRBGYXAO.js +6 -0
- package/dist/preview/index.html +57 -55
- package/dist/preview/page.js +2 -2
- package/dist/preview/splash.js +17 -14
- package/package.json +6 -6
- package/dist/preview/chunk.2P34ML3O.js +0 -111
- package/dist/preview/chunk.2UW5CRHF.js +0 -1
- package/dist/preview/chunk.2YMO7ZVX.js +0 -1
- package/dist/preview/chunk.33ULA3CG.js +0 -1
- package/dist/preview/chunk.3CJLAJXP.js +0 -25
- package/dist/preview/chunk.3IJSB5ET.js +0 -1
- package/dist/preview/chunk.3KO35VN4.js +0 -1
- package/dist/preview/chunk.3L37FY3G.js +0 -4
- package/dist/preview/chunk.3WP66LB5.js +0 -1
- package/dist/preview/chunk.4GJ7F4SP.js +0 -35
- package/dist/preview/chunk.4IJTPV5X.js +0 -1
- package/dist/preview/chunk.4JFBLVXJ.js +0 -1
- package/dist/preview/chunk.4PCVQEVI.js +0 -1
- package/dist/preview/chunk.5FQSYMAE.js +0 -1
- package/dist/preview/chunk.5NCLZ4NZ.js +0 -1
- package/dist/preview/chunk.5YNLFOBJ.js +0 -5
- package/dist/preview/chunk.77XQEDT5.js +0 -1
- package/dist/preview/chunk.7HPQI5SY.js +0 -1
- package/dist/preview/chunk.A4VA3DU5.js +0 -1
- package/dist/preview/chunk.ABSY3UZF.js +0 -1
- package/dist/preview/chunk.ARHAD5IS.js +0 -1
- package/dist/preview/chunk.BOC2EOGB.js +0 -9
- package/dist/preview/chunk.BR6TINGU.js +0 -1
- package/dist/preview/chunk.CDEAAWPS.js +0 -1
- package/dist/preview/chunk.CXJJB3MK.js +0 -1
- package/dist/preview/chunk.CXLQPE4J.js +0 -1
- package/dist/preview/chunk.DA4RSHLW.js +0 -1
- package/dist/preview/chunk.DJMSXXP4.js +0 -90
- package/dist/preview/chunk.DJPNVXBQ.js +0 -6
- package/dist/preview/chunk.DJVHKBEI.js +0 -1
- package/dist/preview/chunk.DVSTLVIH.js +0 -15
- package/dist/preview/chunk.E5WJSTOV.js +0 -1
- package/dist/preview/chunk.FEGSYSA7.js +0 -1
- package/dist/preview/chunk.HJUXC5GM.js +0 -1
- package/dist/preview/chunk.HNMSYQRA.js +0 -1
- package/dist/preview/chunk.HWLRKOI3.js +0 -1
- package/dist/preview/chunk.IHUMKFYH.js +0 -10
- package/dist/preview/chunk.IQ54QTA5.js +0 -1
- package/dist/preview/chunk.IQC3GOXO.js +0 -1
- package/dist/preview/chunk.ISN2QTVL.js +0 -2
- package/dist/preview/chunk.J24YPQ5I.js +0 -5
- package/dist/preview/chunk.J545NAMY.js +0 -1
- package/dist/preview/chunk.K2HDEL7I.js +0 -1
- package/dist/preview/chunk.K3JARAWU.js +0 -1
- package/dist/preview/chunk.KROR65KD.js +0 -2
- package/dist/preview/chunk.KV7GZBJ6.js +0 -50
- package/dist/preview/chunk.L7NJLZWV.js +0 -1
- package/dist/preview/chunk.LON75VHP.js +0 -1
- package/dist/preview/chunk.LQWVJQ5X.js +0 -18
- package/dist/preview/chunk.M5W2RHC6.js +0 -1
- package/dist/preview/chunk.M6BTLH24.js +0 -1
- package/dist/preview/chunk.MAGKI4PD.js +0 -1
- package/dist/preview/chunk.MD36ZSM5.js +0 -74
- package/dist/preview/chunk.MFZJVHWP.js +0 -1
- package/dist/preview/chunk.MHTA4HYB.js +0 -19
- package/dist/preview/chunk.N2YM247R.js +0 -1
- package/dist/preview/chunk.N35SJWAM.js +0 -1
- package/dist/preview/chunk.NJSK3UO2.js +0 -6
- package/dist/preview/chunk.OHMHPTEW.js +0 -1
- package/dist/preview/chunk.OJGHDWI6.js +0 -1
- package/dist/preview/chunk.PV2I4UPH.js +0 -1
- package/dist/preview/chunk.QFQSSZN7.js +0 -1
- package/dist/preview/chunk.RSS6OHXG.js +0 -1
- package/dist/preview/chunk.SBCAYTMT.js +0 -1
- package/dist/preview/chunk.SMTGRCMG.js +0 -3
- package/dist/preview/chunk.TCZIZ2PU.js +0 -1
- package/dist/preview/chunk.U74PTRHJ.js +0 -1
- package/dist/preview/chunk.UAORKZLO.js +0 -1
- package/dist/preview/chunk.UDVTPI2W.js +0 -1
- package/dist/preview/chunk.UETLP5KC.js +0 -1
- package/dist/preview/chunk.UHI3X2YD.js +0 -1
- package/dist/preview/chunk.UL62ELNR.js +0 -1
- package/dist/preview/chunk.VRYSZYAD.js +0 -1
- package/dist/preview/chunk.VUZFLDOX.js +0 -1
- package/dist/preview/chunk.X2NGFOAF.js +0 -1
- package/dist/preview/chunk.XE762VL2.js +0 -2
- package/dist/preview/chunk.Y2RZ5B4U.js +0 -1
- package/dist/preview/chunk.YKMBXMZE.js +0 -1
- package/dist/preview/chunk.Z34KASY7.js +0 -1
- package/dist/preview/chunk.ZMGKWMID.js +0 -1
- package/dist/preview/chunk.ZT5YQSSP.js +0 -21
- package/dist/preview/chunk.ZZM75ZTN.js +0 -4
package/dist/index.js
CHANGED
|
@@ -31,11 +31,11 @@ export async function main(given) {
|
|
|
31
31
|
// The page they serve is built into this package (`dist/preview/`, by scripts/build-preview-page.mjs): it is the tool's to carry, not a product's dependency's.
|
|
32
32
|
const { preview, shots } = await import("@graview/ship/cli");
|
|
33
33
|
const page = fileURLToPath(new URL("./preview/", import.meta.url));
|
|
34
|
-
if (command === "shots")
|
|
35
|
-
return shots(rest, { page });
|
|
36
34
|
// The opening screen's renderer rides beside the page (`@graview/pages/splash`, bundled there), so the tool depends on no face to draw it.
|
|
37
|
-
const { splashHtml } = (await import(new URL("./preview/splash.js", import.meta.url).href));
|
|
38
|
-
|
|
35
|
+
const { splashHtml, splashPage } = (await import(new URL("./preview/splash.js", import.meta.url).href));
|
|
36
|
+
if (command === "shots")
|
|
37
|
+
return shots(rest, { page, splash: splashHtml, splashPage });
|
|
38
|
+
return preview(rest, { page, splash: splashHtml, splashPage });
|
|
39
39
|
}
|
|
40
40
|
if (command === "sync-seed") {
|
|
41
41
|
const { syncSeed } = await import("@graview/ship/cli");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,KAAwB;IACjD,iGAAiG;IACjG,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACpD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACjD,gKAAgK;QAChK,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,KAAwB;IACjD,iGAAiG;IACjG,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACpD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACjD,gKAAgK;QAChK,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,2IAA2I;QAC3I,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAA+I,CAAC;QACtP,IAAI,OAAO,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;QACtF,OAAO,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QAC5B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACvD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QACrH,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QAClF,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvK,CAAC;IACD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;QACvD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC/E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;QACpC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,wEAAwE;AACxE,KAAK,UAAU,KAAK;IAClB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACnG,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAC7D,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC1D,OAAO,GAAG,UAAU,KAAK,WAAW,KAAK,SAAS,KAAK,WAAW,KAAK,cAAc,KAAK,WAAW,KAAK,YAAY,KAAK,UAAU,EAAE,CAAC;AAC1I,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as K}from"./chunk.LKK5YF2H.js";import{Eb as h,Fb as v,Gc as $,Hc as N,Mb as V,h as P,k as R,oc as Y,pb as G,pc as X,q as I,sc as B,ta as q,x as _}from"./chunk.J24YPQ5I.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{
|
|
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};
|
|
@@ -0,0 +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.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _,b as C,c as D,d as I,e as j,f as P,g as x,i as N}from"./chunk.GG47EIKO.js";var Y=0,Z=1,K=2,q=3,F=1,Q=2,U=3,ee=1,ne=3,te=8,H="~",v=o=>typeof o=="object"&&o!==null&&!Array.isArray(o),$=new Set(["input","select","textarea","option"]),re=new Set(["value","checked","selected"]),z=["aria-label","aria-labelledby","title"],se=o=>z.some(d=>(o.getAttribute(d)??"").trim()!=="");function de(o,d){let c=o.ownerDocument??o,h=d.maxNodes??5e3,p=[],g=new Map,T=new WeakMap,E={dom:o,name:"div",namespace:"html",children:[],id:H};g.set(H,E);let k=0,S=!1,b=new WeakMap,w=new Map,A=new Map,l=e=>{p.push(e),p.length>200&&p.shift(),d.onRefused?.(e)},y=()=>({dom:c.createComment(""),children:[],refused:!0}),X=(e,i)=>{if(e.namespace==="html"&&e.name&&$.has(e.name))return e.dom;if(i?.namespace==="html"&&i.name==="textarea")return i.dom},R=(e,i)=>{let s=e.dom,r=b.get(s)??s.getAttribute("role");if(r===null||!r.split(/\s+/).some(t=>_.includes(t.toLowerCase())))return void b.delete(s);if(se(s)){b.delete(s),s.getAttribute("role")!==r&&s.setAttribute("role",r);return}b.set(s,r),s.removeAttribute("role"),i&&l({reason:"value",element:e.name,name:"role"})},J=()=>{if(A.size===0)return;let e=new Set,i=s=>{for(let r of s.children){if(r.refused||r.text)continue;let t=r.dom.getAttribute("id");t&&e.add(t),i(r)}};i(E);for(let[s,r]of A){if(s.id===void 0||g.get(s.id)!==s){A.delete(s);continue}let t=s.dom;for(let[n,u]of r){let a=u.value.split(/\s+/).filter(m=>m!==""),f=a.filter(m=>!e.has(m));if(a.length>0&&f.length===0){if(u.drawn)continue;u.drawn=!0,t.setAttribute(n,u.value),R(s,!1)}else u.drawn&&(u.drawn=!1,t.removeAttribute(n),l({reason:"reference",element:s.name,name:n,ids:f.length>0?f:a}),R(s,!0))}}},L=(e,i,s,r=!0)=>{let t=e.dom;if(s!=null&&typeof s!="string")return l({reason:"value",element:e.name,name:i});let n=N(e.namespace,e.name,i,s??null,d);if("refused"in n){let m=N(e.namespace,e.name,i,null,d);return"refused"in m||t.removeAttribute(m.name),!("refused"in m)&&m.name==="role"&&b.delete(t),l(n.refused)}for(let m of n.dropped??[])l(m);let u=e.namespace==="html"&&re.has(n.name)&&$.has(e.name),a=t,f=u?n.name==="value"?a.value:n.name==="checked"?a.checked:a.selected:void 0;if(n.name==="role"&&b.delete(t),C.includes(n.name)){let m=A.get(e)??new Map;n.value===null?m.delete(n.name):m.set(n.name,{value:n.value,drawn:!0}),m.size>0?A.set(e,m):A.delete(e)}n.value===null?t.removeAttribute(n.name):t.setAttribute(n.name,n.value),r&&(n.name==="role"||z.includes(n.name))&&R(e,n.name==="role"),d.onAttribute?.(t,n.name),u&&(n.name==="value"&&"value"in a?(a.value=n.value??"",f!==a.value&&d.onFieldSet?.(t)):n.name==="checked"&&"checked"in a?(a.checked=n.value!==null,f!==a.checked&&d.onFieldSet?.(t)):n.name==="selected"&&"selected"in a&&(a.selected=n.value!==null,f!==a.selected&&d.onFieldSet?.(t.parentElement?.closest("select")??t)))},O=e=>{if(!e.refused){k-=1,e.id!==void 0&&g.delete(e.id);for(let i of e.children)O(i)}},M=(e,i)=>{if(!v(e)||typeof e.id!="string"||g.has(e.id))return l({reason:"record"}),y();if(k>=h)return l({reason:"budget"}),S||(S=!0,d.onOverBudget?.()),y();let s=e.id;if(e.type===te)return y();if(e.type===ne){if(x(i.namespace,i.name))return l({reason:"child",element:i.name}),y();let a=c.createTextNode(String(e.data??"").slice(0,D)),f={dom:a,children:[],text:!0,id:s,parent:i};return g.set(s,f),T.set(a,s),k+=1,f}if(e.type!==ee)return l({reason:"record"}),y();let r=String(e.element);if(x(i.namespace,i.name))return l({reason:"child",element:r}),y();let t=P(r,i.namespace);if("refused"in t)return l(t.refused),y();let n=c.createElementNS(t.namespace==="svg"?j:I,t.name);t.as&&n.setAttribute("data-graview-as",t.as),t.namespace==="html"&&t.name==="img"&&n.setAttribute("referrerpolicy","no-referrer"),t.namespace==="html"&&t.name==="a"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("referrerpolicy","no-referrer"));let u={dom:n,name:t.name,namespace:t.namespace,children:[],id:s,parent:i};if(g.set(s,u),T.set(n,s),k+=1,v(e.attributes)){for(let[a,f]of Object.entries(e.attributes))L(u,a,f,!1);R(u,!0)}if(d.decorate?.(n,t.name,t.namespace),v(e.properties))for(let a of Object.keys(e.properties))l({reason:"attribute",element:t.name,name:a});if(v(e.eventListeners))for(let a of Object.keys(e.eventListeners))e.eventListeners[a]!=null&&l({reason:"attribute",element:t.name,name:`on${a}`});if(Array.isArray(e.children))for(let a of e.children){let f=M(a,u);u.children.push(f),n.appendChild(f.dom)}return u},V=e=>{if(!Array.isArray(e))return l({reason:"record"});let[i,s]=e,r=typeof s=="string"?g.get(s):void 0;if(!r)return l({reason:"record"});switch(i){case Y:{if(r.text)return l({reason:"record"});let t=Number(e[3]),n=Number.isInteger(t)&&t>=0&&t<=r.children.length?t:r.children.length,u=e[2],a=v(u)&&typeof u.id=="string"?w.get(u.id):void 0,f;a&&a.parent?.namespace===r.namespace&&!x(r.namespace,r.name)?(w.delete(u.id),a.parent=r,f=a):f=M(u,r),r.dom.insertBefore(f.dom,r.children[n]?.dom??null),r.children.splice(n,0,f),r.namespace==="html"&&r.name==="textarea"&&d.onFieldSet?.(r.dom);return}case Z:{let t=Number(e[2]),n=r.children[t];if(!n)return l({reason:"record"});r.children.splice(t,1),n.dom.parentNode?.removeChild(n.dom),n.id!==void 0&&!n.refused?w.set(n.id,n):O(n);return}case K:{if(!r.text)return l({reason:"record"});r.dom.data=String(e[2]??"").slice(0,D);let t=X(r,r.parent);t&&d.onFieldSet?.(t);return}case q:{if(r===E||r.text)return l({reason:"record"});let t=String(e[2]),n=e[4]??F;return n===Q?L(r,t,e[3]):l(n===F||n===U?{reason:"attribute",element:r.name,name:n===U?`on${t}`:t}:{reason:"record"})}default:return l({reason:"record"})}};return{apply(e,i){if(!Array.isArray(e))return l({reason:"record"}),!0;try{for(let s=0;s<e.length;s+=1){if(i&&s%32===0&&i())return!1;V(e[s])}return!0}finally{for(let s of w.values())O(s);w.clear(),J()}},get refused(){return p},get size(){return k},idOf:e=>T.get(e),elementOf(e){let i=g.get(e);return i&&!i.text&&i!==E?i.dom:void 0},dispose(){for(let e of E.children)O(e);for(E.children.length=0;o.firstChild;)o.removeChild(o.firstChild)}}}var oe=o=>typeof o=="string"&&/^#[A-Za-z_][A-Za-z0-9_.:-]{0,199}$/.test(o),B=["https:","mailto:","tel:"];function G(o){if(!(typeof o!="string"||o.length>2e3||/[\s<>"]/.test(o.trim())||o.trim()!==o))try{let d=new URL(o);return!B.includes(d.protocol)||d.protocol==="https:"&&(d.hostname===""||d.username!==""||d.password!=="")?void 0:d.href}catch{return}}function ce(o){let d=new Set,c=h=>{if(typeof h!="string"||!/^(https|mailto|tel):/i.test(h))return;let p=G(h);p&&d.add(p)};for(let h of[...o?.node?[o.node]:[],...o?.nodes??[]])for(let[p,g]of Object.entries(h))p==="id"||p==="kind"||(Array.isArray(g)?g.forEach(c):c(g));return d}function W(o){return(o??[]).flatMap(d=>{try{let c=new URL(d);return c.protocol==="https:"&&c.hostname!==""&&c.username===""&&c.password===""?[c.origin]:[]}catch{return[]}})}function ue(o,d){if(oe(o))return o;let c=G(o);if(c&&(d.handed.has(c)||c.startsWith("https:")&&W(d.origins).includes(new URL(c).origin)))return c}function fe(o,d){let c=o.length>120?`${o.slice(0,119)}\u2026`:o,h="";try{h=new URL(o).protocol}catch{h=""}if(!B.includes(h))return`The link "${c}" was not drawn: a view links only to an https:, mailto: or tel: address.`;let p=W(d);return`The link "${c}" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${p.length>0?`, or an https: address on ${p.join(", ")}`:""}; a record or a place of this app is <a data-record> or <a data-place>.`}export{de as a,ce as b,ue as c,fe as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as a}from"./chunk.
|
|
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,
|
|
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};
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
|
|
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
|
+
.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)}
|
|
5
|
+
.graview-row{grid-column:1/-1;display:grid;grid-template-columns:subgrid;align-items:baseline;align-content:center;position:relative;box-sizing:border-box;min-height:2.75rem;padding:.5rem 0;border-bottom:1px solid var(--graview-edge);overflow-wrap:anywhere}
|
|
6
|
+
.graview-row-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:24px;color:inherit;text-decoration:none;font-size:var(--graview-text-body);font-weight:500;line-height:1.3;text-wrap:pretty;hyphens:manual}
|
|
7
|
+
.graview-row-title::after{content:"";position:absolute;inset:0}
|
|
8
|
+
.graview-row-title:focus-visible{outline:0}
|
|
9
|
+
.graview-row-title:focus-visible::after{outline:2px solid var(--graview-accent);outline-offset:-2px;border-radius:var(--graview-radius-sm)}
|
|
10
|
+
.graview-row:hover .graview-row-title{text-decoration:underline 1px color-mix(in srgb,currentColor 50%,transparent);text-underline-offset:.2em}
|
|
11
|
+
.graview-row:active .graview-row-title{color:var(--graview-accent)}
|
|
12
|
+
.graview-row :is(a,button):not(.graview-row-title){position:relative}
|
|
13
|
+
.graview-row-glance,.graview-row>[data-testid=search-why]{font-size:var(--graview-text-small);line-height:1.5;color:var(--graview-ink-muted)}
|
|
14
|
+
.graview-row>[data-testid=search-why]{grid-column:1/-1}
|
|
15
|
+
.graview-row-glance{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
|
|
16
|
+
.graview-chip{display:inline-block;padding:0 .5em;border-radius:var(--graview-radius-sm);background:color-mix(in srgb,var(--graview-ink) 7%,transparent);color:var(--graview-ink);font-weight:500;line-height:1.6;white-space:nowrap}
|
|
17
|
+
.graview-group-head{display:flex;gap:.5em;align-items:baseline;margin:0;padding:.375rem 0;font-family:var(--graview-font-body);font-size:var(--graview-text-small);font-weight:var(--graview-weight-label);line-height:1.3;letter-spacing:.02em;scroll-margin-top:4rem}
|
|
18
|
+
.graview-group-head>span{color:var(--graview-ink-muted);font-weight:var(--graview-weight-body)}
|
|
19
|
+
.graview-group-toggle{display:inline-flex;gap:.5em;align-items:center;min-height:2.75rem;margin:-.375rem 0;padding:0 .5rem 0 0;border:0;background:none;color:inherit;font:inherit;letter-spacing:inherit;text-align:start;cursor:pointer;border-radius:var(--graview-radius-sm)}
|
|
20
|
+
.graview-group-toggle:focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
|
|
21
|
+
.graview-group-toggle>span{color:var(--graview-ink-muted);font-weight:var(--graview-weight-body)}
|
|
22
|
+
@container (min-width:36rem){.graview-rows{grid-template-columns:minmax(0,1fr) fit-content(40%)}.graview-group-head:has(+.graview-rows){position:sticky;top:0;z-index:${nt.raised};background:var(--graview-ground)}}`,Ci={font:"inherit",fontSize:Xe,padding:"8px 14px",borderRadius:"var(--graview-radius-sm, 8px)",border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)",color:"var(--graview-ink)",cursor:"pointer"};function Li({kind:e,brand:t,size:r=10,schema:a}){return(0,j.jsx)(yt,{kind:e,...a?{schema:a}:{},...t?{brand:t}:{},size:Math.round(r*1.6)})}function Di(e,t,r){return e.author.kind==="human"&&(e.author.id===void 0||t?.id===void 0||e.author.id===t.id)?"you":r?tt(e.author,r):e.author.kind==="agent"?e.author.id??"an agent":e.author.id??e.author.kind}function ki(e,t,r){return Sn(e,t,r).map(a=>a.text).join(" \xB7 ")}function Sn(e,t,r,a=()=>!1){return vt(e,t,{limit:3,said:[r],glance:!0}).map(n=>n.long?{text:gt(n.stored,{markdown:n.markdown,most:100})}:a(n.key)?{text:n.alone,choice:n.key}:{text:n.alone})}function Fi({runs:e}){return(0,j.jsx)(j.Fragment,{children:e.map((t,r)=>{let a=r===0?"":t.choice===void 0&&e[r-1].choice===void 0?" \xB7 ":" ";return(0,j.jsx)(Fr.Fragment,{children:t.choice!==void 0?(0,j.jsxs)(j.Fragment,{children:[a,(0,j.jsx)("span",{className:"graview-chip","data-graview-field":t.choice,children:t.text})]}):`${a}${t.text}`},r)})})}var Ti=(e,t)=>de(e.schema,t),bn=(e,t)=>{let r=e.kindsKeptFrom(t);return e.schema.kinds.filter(a=>!e.modules.disabledKinds.has(a)&&!r.has(a))},En=e=>ct(bn(e.store,e.principal),e.views?.arrangement?.()?.order),Ni=e=>{let t=new Set(e.views?.arrangement?.()?.hide??[]);return En(e).filter(r=>!t.has(r))},Mi=e=>e.charAt(0).toUpperCase()+e.slice(1);var C=D(Z(),1);function Vi({context:e,children:t}){let{store:r,brand:a}=e;ae(r);let n=dt();return mt(e.embedded?void 0:at(e.assetsAt??n,rt(a))),pt(e.embedded?void 0:a),(0,C.jsxs)("div",{style:{...e.embedded?{}:{minHeight:"100vh"},display:"flex",flexDirection:"column",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)",fontSize:Qe,lineHeight:1.5},children:[e.embedded?null:(0,C.jsx)(Pn,{context:e}),(0,C.jsx)("div",{style:{flex:1},children:t}),e.remembers?(0,C.jsx)("footer",{style:{borderTop:"1px solid var(--graview-edge)",padding:"14px 20px max(20px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",...Nr},children:(0,C.jsx)("div",{style:{maxWidth:Ze,margin:"0 auto",display:"flex",gap:14,flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end"},children:(0,C.jsxs)("span",{"data-testid":"remembered",children:["Remembered in this browser \xB7 ",(0,C.jsx)(kt,{})]})})}):null]})}var xn=(0,A.createContext)(null);function Pn({context:e}){let{store:t,brand:r,sceneHref:a="/",invariantContext:n}=e,o=T(),i=Q(),l=be("/").replace(/\/$/,""),s=(0,A.useContext)(xn),u=s?.places===!1?[]:wt({store:t,principal:e.principal,views:e.views}),c=e.views?.arrangement?.(),d=`${o.pathname}${o.search}`,m=t.violations(n),h=m.length,y=xt(m,"All rules hold"),p=o.pathname.split("/").filter(Boolean),f=p.length===2&&fe(t.schema,p[0])!==void 0&&t.graph.getNode(decodeURIComponent(p[1]))!==void 0;return(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(bt,{brand:r,name:r?.name??"Graview",description:r?.subtitle,home:{href:`${l}/`,go:()=>i("/"),current:o.pathname==="/"},faces:{scene:{label:st(c),current:!1,go:()=>window.location.assign(a)},pages:{label:ut(c),current:!0,go:()=>{}}},places:u,current:Rt(u,d),reach:{href:w=>`${l}${w}`,go:w=>i(w.path)},...s?{onFind:s.onFind,find:s.find}:{findBox:(0,C.jsx)(kn,{context:e})},skips:(0,C.jsx)(Dt,{to:[{label:"Skip to the content",testid:"content",go:()=>{let w=document.querySelector("[data-graview-skip-target]");Ce(w?.querySelector('[data-graview-choose-box][tabindex="0"]')??w??document.querySelector("main"))}},...f?[{label:"Skip to what can be done",testid:"acts",go:()=>void Ce(document.querySelector("main [data-affordance]:not([disabled]):not([tabindex='-1'])")??document.querySelector("main [data-affordance]:not([disabled])")??document.querySelector("main"))}]:[]]}),tools:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(le,{to:"/problems","data-testid":"standing-link","aria-label":y,title:y,style:{...St,position:"relative",textDecoration:"none",color:h===0?"var(--graview-ink-muted)":"var(--graview-warn)"},children:[(0,C.jsx)(Pt,{tone:h===0?"var(--graview-good)":"var(--graview-warn)"}),h>0?(0,C.jsx)("span",{className:"graview-bar-badge","data-tone":"warn","data-testid":"standing-count","aria-hidden":"true",children:h>99?"99+":h}):null]}),s?null:(0,C.jsx)(Dr,{context:e}),e.views?(0,C.jsx)(Et,{...e.signature?{signature:!0}:{}}):null]})})})}function Ji({context:e,style:t,bleedTop:r,children:a,...n}){let o=e.embedded||e.framed?"section":"main";return(0,C.jsxs)(o,{style:{...qe,...t},"data-graview-page-main":"",...r?{"data-graview-bleed-top":""}:{},...n,children:[r?(0,C.jsx)("style",{children:Cn}):null,a]})}var Cn="@media (max-width:680px){[data-graview-bleed-top]:not(:has([data-graview-bleed]>[data-worker-view-fallback])){padding-top:0 !important}}";function Ki({when:e,children:t}){return e?(0,C.jsxs)("div",{"data-graview-bleed":"",style:{display:"grid",minWidth:0},children:[(0,C.jsx)("style",{children:Ln}),t]}):(0,C.jsx)(C.Fragment,{children:t})}var Ln="@media (max-width:680px){[data-graview-bleed]:not(:has(>[data-worker-view-fallback])){margin-inline:min(0px,calc(env(safe-area-inset-left,0px) - var(--graview-page-gutter,20px))) min(0px,calc(env(safe-area-inset-right,0px) - var(--graview-page-gutter,20px)))}}",Dn={position:"absolute",width:1,height:1,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"};function Gi({context:e,unseen:t,children:r,...a}){let n=`h${e.titleLevel??(e.framed&&!e.barAbove?1:2)}`;return(0,C.jsx)(n,{style:t?Dn:Tr,"data-graview-page-title":"",...a,children:r})}function kn({context:e,narrowsLists:t=!0,className:r,size:a}){kr("find");let n=T(),o=Q(),[i,l]=Ge(),s=n.pathname.split("/").filter(Boolean),u=t&&s.length===1&&fe(e.store.schema,s[0])!==void 0,c=n.pathname==="/search",d=u||c?i.get("q")??"":"",m=u?`Narrow ${de(e.store.schema,fe(e.store.schema,s[0])).toLowerCase()}\u2026`:"",[h,y]=(0,A.useState)(!0);(0,A.useLayoutEffect)(()=>{let P=w.current;if(!P||!m||typeof ResizeObserver>"u")return;let E=()=>{let k=getComputedStyle(P),$=document.createElement("canvas").getContext("2d");$&&($.font=`${k.fontWeight} ${k.fontSize} ${k.fontFamily}`,y($.measureText(m).width<=P.clientWidth-parseFloat(k.paddingLeft)-parseFloat(k.paddingRight)))};E();let F=new ResizeObserver(E);return F.observe(P),()=>F.disconnect()},[m]);let[p,f]=(0,A.useState)(d),w=(0,A.useRef)(null);(0,A.useEffect)(()=>{let P=E=>{if(E.defaultPrevented||E.altKey)return;let F=!E.shiftKey&&(E.metaKey||E.ctrlKey)&&E.key.toLowerCase()==="k",k=document.activeElement,$=k instanceof HTMLInputElement||k instanceof HTMLTextAreaElement||k instanceof HTMLSelectElement||k instanceof HTMLElement&&k.isContentEditable,J=E.key==="/"&&!E.metaKey&&!E.ctrlKey&&!$;if(!F&&!J)return;let z=w.current,ue=z?.closest("[data-graview-embed]"),q=E.target,ce=q===document.body||q===document.documentElement;!z||!(ce||!ue||q instanceof Node&&ue.contains(q))||(E.preventDefault(),z.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),requestAnimationFrame(()=>{z.focus(),z.select()}))};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[]);let R=(0,A.useRef)(new Set([d]));(0,A.useEffect)(()=>{R.current.has(d)||(R.current=new Set([d]),f(d))},[d]);let b=P=>{if(f(P),R.current.add(P),u){let F=new URLSearchParams(i);P.trim()?F.set("q",P):F.delete("q"),l(F,{replace:!0});return}let E=P.trim()?`/search?${new URLSearchParams({q:P}).toString()}`:"/search";o(E,{replace:c})};return(0,C.jsxs)("form",{role:"search","aria-label":u?"Narrow this list":"Find anything",className:Tt("graview-find",r),...Ft(a),onSubmit:P=>{P.preventDefault(),u&&p.trim()&&o(`/search?${new URLSearchParams({q:p}).toString()}`)},children:[(0,C.jsx)("input",{ref:w,type:"search","data-testid":"nav-find",value:p,onChange:P=>b(P.target.value),placeholder:u?h?m:"Narrow\u2026":"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K","aria-label":u?"Narrow this list":"Find anything",className:"graview-find-box"}),(0,C.jsx)("style",{children:Fn})]})}var Fn=`:where(.graview-find){display:flex;min-width:0;flex:1 1 auto}
|
|
23
|
+
:where(.graview-find[data-size=md]){--graview-control-height:36px}
|
|
24
|
+
:where(.graview-find-box){box-sizing:border-box;width:100%;min-width:0;height:var(--graview-control-height,30px);padding:0 var(--graview-bar-find-end,10px) 0 10px;font:inherit;font-size:.875rem;color:var(--graview-ink);background:var(--graview-ground);border:1px solid var(--graview-edge);border-radius:8px}`;export{Or as a,fe as b,Nn as c,Mn as d,be as e,T as f,wa as g,Q as h,Sa as i,Ma as j,Oa as k,dr as l,Aa as m,hn as n,le as o,Ge as p,Xe as q,gi as r,vi as s,wi as t,Ri as u,Si as v,Nr as w,bi as x,Rn as y,Ei as z,xi as A,Pi as B,Ci as C,Li as D,Di as E,ki as F,Sn as G,Fi as H,Ti as I,bn as J,En as K,Ni as L,Mi as M,Dr as N,wn as O,si as P,ui as Q,Vi as R,xn as S,Ji as T,Ki as U,Gi as V,kn as W};
|
|
25
|
+
/*! Bundled license information:
|
|
26
|
+
|
|
27
|
+
react-router/dist/development/chunk-BV7QT456.mjs:
|
|
28
|
+
(**
|
|
29
|
+
* react-router v7.18.3
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Remix Software Inc.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
35
|
+
*
|
|
36
|
+
* @license MIT
|
|
37
|
+
*)
|
|
38
|
+
|
|
39
|
+
react-router/dist/development/index.mjs:
|
|
40
|
+
(**
|
|
41
|
+
* react-router v7.18.3
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*)
|
|
50
|
+
*/
|