graview 0.1.66 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/{chunk.LSN2IPAI.js → chunk.25QFDTCU.js} +1 -1
- package/dist/preview/{chunk.BFAFCVL4.js → chunk.264PB572.js} +1 -1
- package/dist/preview/chunk.2FHIINXG.js +2 -0
- package/dist/preview/{chunk.HSSIMVVM.js → chunk.2VUX54XH.js} +1 -1
- package/dist/preview/{chunk.CTASTRQN.js → chunk.35KMZHB7.js} +1 -1
- package/dist/preview/{chunk.OWFS2YDQ.js → chunk.37RFCHSS.js} +1 -1
- package/dist/preview/chunk.3ENPWZBG.js +1 -0
- package/dist/preview/{chunk.XMQG2PSM.js → chunk.3GNT5MKP.js} +1 -1
- package/dist/preview/{chunk.BXBEGMPO.js → chunk.3NSV3WKM.js} +2 -2
- package/dist/preview/chunk.3ZODN6BW.js +1 -0
- package/dist/preview/{chunk.OPTYYIGC.js → chunk.47XEJZ3O.js} +1 -1
- package/dist/preview/{chunk.5FNFRVTL.js → chunk.4EMKCKDB.js} +1 -1
- package/dist/preview/{chunk.B6JRTW3A.js → chunk.4UUJHLHR.js} +1 -1
- package/dist/preview/{chunk.FBILPNGH.js → chunk.4W57E7AX.js} +1 -1
- package/dist/preview/chunk.55G4IPOO.js +1 -0
- package/dist/preview/{chunk.72XP2ARZ.js → chunk.5AKZROMR.js} +1 -1
- package/dist/preview/chunk.5J6DVR7S.js +1 -0
- package/dist/preview/{chunk.FXT5CN32.js → chunk.5R744JGZ.js} +1 -1
- package/dist/preview/{chunk.NJRLJEJY.js → chunk.6KJGRM7A.js} +1 -1
- package/dist/preview/{chunk.4AC2QM7T.js → chunk.6N4PE3U5.js} +1 -1
- package/dist/preview/{chunk.LGRVEHXT.js → chunk.6NG76MDA.js} +2 -2
- package/dist/preview/{chunk.4FCFNAA4.js → chunk.6SJEZWH3.js} +1 -1
- package/dist/preview/{chunk.7VADSNPZ.js → chunk.6UQFV53C.js} +1 -1
- package/dist/preview/{chunk.WAB3L3ZI.js → chunk.6W6XMLSF.js} +1 -1
- package/dist/preview/{chunk.4JULYKGD.js → chunk.77C556NM.js} +1 -1
- package/dist/preview/{chunk.IGK7EZCX.js → chunk.7ARRVNUR.js} +1 -1
- package/dist/preview/{chunk.CBXS23YH.js → chunk.7BJRHPE3.js} +2 -2
- package/dist/preview/{chunk.ZQR2SN65.js → chunk.7S6ZRMW4.js} +1 -1
- package/dist/preview/{chunk.IAEHUSQQ.js → chunk.7UHPHEH5.js} +1 -1
- package/dist/preview/chunk.7WHQWLL6.js +1 -0
- package/dist/preview/{chunk.KACSYPEV.js → chunk.A4EZAGG7.js} +1 -1
- package/dist/preview/chunk.A5PSEU3W.js +25 -0
- package/dist/preview/{chunk.VKZIEZ5C.js → chunk.A7GVTE5Y.js} +2 -2
- package/dist/preview/{chunk.45JP6VGJ.js → chunk.AJMVRFYX.js} +2 -2
- package/dist/preview/{chunk.6P6NGZ6D.js → chunk.AKJS2NUM.js} +1 -1
- package/dist/preview/{chunk.CU2WCYMK.js → chunk.ARWO4WOV.js} +1 -1
- package/dist/preview/chunk.B5SJMCTT.js +7 -0
- package/dist/preview/{chunk.JXNVNFV4.js → chunk.B7KZBT27.js} +1 -1
- package/dist/preview/{chunk.E3UL4MCD.js → chunk.BDNQMKDG.js} +1 -1
- package/dist/preview/{chunk.YNEHJWJV.js → chunk.BKYZSV2Y.js} +1 -1
- package/dist/preview/{chunk.5BX66FBP.js → chunk.CKDCTFLU.js} +1 -1
- package/dist/preview/chunk.CTUJZ3IV.js +1 -0
- package/dist/preview/chunk.CY7FFKEZ.js +1 -0
- package/dist/preview/{chunk.3PBTN7RO.js → chunk.D4WJ7OM5.js} +1 -1
- package/dist/preview/{chunk.C2C3AXGI.js → chunk.D7NWMXSX.js} +3 -3
- package/dist/preview/chunk.DEKRFTRN.js +4 -0
- package/dist/preview/{chunk.E7EWNWAN.js → chunk.DKEIEH2D.js} +1 -1
- package/dist/preview/{chunk.I2737CPF.js → chunk.DWM7AR5Y.js} +1 -1
- package/dist/preview/{chunk.ANS2IEEV.js → chunk.DZMIYEHQ.js} +1 -1
- package/dist/preview/{chunk.BMENTGDC.js → chunk.E5PYNAYT.js} +2 -2
- package/dist/preview/chunk.EBKH3ILT.js +1 -0
- package/dist/preview/{chunk.DTCAUPLC.js → chunk.EFVSZKB5.js} +1 -1
- package/dist/preview/{chunk.QOS5T46W.js → chunk.EGPCVMDU.js} +1 -1
- package/dist/preview/{chunk.7ZKBYXUM.js → chunk.EJ2EZL2G.js} +1 -1
- package/dist/preview/{chunk.7VP6Y6D2.js → chunk.EP6Q32WT.js} +1 -1
- package/dist/preview/{chunk.OOSIKCOS.js → chunk.F464JKHZ.js} +1 -1
- package/dist/preview/{chunk.VGHO3VCB.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.4FDVINRJ.js → chunk.FRQSLWP4.js} +1 -1
- package/dist/preview/{chunk.2MHNPBHC.js → chunk.FVQKSN33.js} +1 -1
- package/dist/preview/{chunk.PDDIQ6PK.js → chunk.G3GFDVO2.js} +1 -1
- package/dist/preview/{chunk.ZD7T234N.js → chunk.G5GVT6JY.js} +1 -1
- package/dist/preview/{chunk.3L4JMM3P.js → chunk.GFLH7RCI.js} +1 -1
- package/dist/preview/{chunk.OO2OP76C.js → chunk.GMLONS5L.js} +1 -1
- package/dist/preview/{chunk.FK722SHI.js → chunk.GRFD42WM.js} +1 -1
- package/dist/preview/{chunk.2VR7YEJ6.js → chunk.GVT4UUQA.js} +1 -1
- package/dist/preview/{chunk.GME63ZHI.js → chunk.H3EGBDW2.js} +1 -1
- package/dist/preview/{chunk.DQFHIJFN.js → chunk.H6KIEDZN.js} +1 -1
- package/dist/preview/{chunk.5B5SRTUK.js → chunk.HAOB6O72.js} +1 -1
- package/dist/preview/chunk.HB5NWHFP.js +3 -0
- package/dist/preview/{chunk.6EHHMWPP.js → chunk.HJUZMOW2.js} +1 -1
- package/dist/preview/{chunk.6MQ5NT7S.js → chunk.HN4ZJ4B4.js} +1 -1
- package/dist/preview/chunk.HVBKI5ZO.js +1 -0
- package/dist/preview/chunk.I3SDKMQS.js +1 -0
- package/dist/preview/{chunk.QQAZQDRW.js → chunk.IAEGJDF3.js} +1 -1
- package/dist/preview/{chunk.QWNSHISU.js → chunk.IDALEKIW.js} +1 -1
- package/dist/preview/{chunk.QFHWG4LN.js → chunk.ILJDLBPJ.js} +1 -1
- package/dist/preview/{chunk.ZR2TP3BF.js → chunk.J2OPIS3H.js} +1 -1
- package/dist/preview/chunk.J5OLYVZ4.js +1 -0
- package/dist/preview/{chunk.LETAQTLJ.js → chunk.J6HF7IRQ.js} +1 -1
- package/dist/preview/{chunk.RWIN3POV.js → chunk.JEC5FDKX.js} +1 -1
- package/dist/preview/chunk.JKFVNQY7.js +1 -0
- package/dist/preview/{chunk.LLIURXFP.js → chunk.JQ2WNKDW.js} +1 -1
- package/dist/preview/{chunk.Z7Y3R3YR.js → chunk.JQ63N4MZ.js} +1 -1
- package/dist/preview/{chunk.DZFM6GSY.js → chunk.JU6UFWS3.js} +1 -1
- package/dist/preview/{chunk.INHS3KTK.js → chunk.JVB5KDSG.js} +1 -1
- package/dist/preview/{chunk.4U4D7WOI.js → chunk.KFT7JIEH.js} +1 -1
- package/dist/preview/chunk.KGMSSXZL.js +1 -0
- package/dist/preview/{chunk.5CXIEYHY.js → chunk.KX5ZBHMA.js} +2 -2
- package/dist/preview/{chunk.V7W5AQKL.js → chunk.LP2ZMAT2.js} +1 -1
- package/dist/preview/{chunk.BUVTUAB5.js → chunk.LRNFE3UK.js} +1 -1
- package/dist/preview/{chunk.PAGEGBUD.js → chunk.LVOTLGJB.js} +1 -1
- package/dist/preview/{chunk.QHMHUL6B.js → chunk.LYEGRY77.js} +1 -1
- package/dist/preview/{chunk.PPSYUOH7.js → chunk.M7KXQGQL.js} +1 -1
- package/dist/preview/{chunk.7BIPZTJB.js → chunk.MAKCZ6B6.js} +1 -1
- package/dist/preview/{chunk.EQ4OODGO.js → chunk.MJY4SLWA.js} +1 -1
- package/dist/preview/{chunk.EMFOMSMI.js → chunk.MSAYU25L.js} +1 -1
- package/dist/preview/{chunk.F4VB6Q2W.js → chunk.MUSMNKE4.js} +1 -1
- package/dist/preview/{chunk.BGAC3B7X.js → chunk.MW7R5G3C.js} +1 -1
- package/dist/preview/{chunk.AK7NGFEX.js → chunk.N4ZKZ4GM.js} +1 -1
- package/dist/preview/{chunk.TXHYGFIZ.js → chunk.NAXOXBOF.js} +1 -1
- package/dist/preview/{chunk.IWYMKGZZ.js → chunk.NKLPL7QD.js} +1 -1
- package/dist/preview/{chunk.QU52E5RG.js → chunk.NKYWIGC7.js} +1 -1
- package/dist/preview/{chunk.KSIEO5W7.js → chunk.NRURQGXV.js} +1 -1
- package/dist/preview/{chunk.FV72U33M.js → chunk.NSOPYIT4.js} +1 -1
- package/dist/preview/chunk.NXZL5CA2.js +1 -0
- package/dist/preview/{chunk.WVLEGCRI.js → chunk.O2OL6RQQ.js} +1 -1
- package/dist/preview/{chunk.TGEL6EUA.js → chunk.O5VFKVZS.js} +1 -1
- package/dist/preview/{chunk.CEVGND3Y.js → chunk.OCXY5DCD.js} +3 -3
- package/dist/preview/chunk.OHAO6KKH.js +1 -0
- package/dist/preview/{chunk.DSYP43NN.js → chunk.P2EKKKK2.js} +1 -1
- package/dist/preview/chunk.PSNMZBVS.js +1 -0
- package/dist/preview/{chunk.W53YNBSM.js → chunk.PZ7KY6XH.js} +1 -1
- package/dist/preview/{chunk.WSO7JOW5.js → chunk.QAM76AXV.js} +1 -1
- package/dist/preview/{chunk.PSQYDCVM.js → chunk.QF5QB5YR.js} +1 -1
- package/dist/preview/chunk.QNP5OR3P.js +93 -0
- package/dist/preview/{chunk.5LJVOLKR.js → chunk.QRQ5WPZI.js} +1 -1
- package/dist/preview/chunk.QWGWOEBZ.js +90 -0
- package/dist/preview/{chunk.OMT4QUZY.js → chunk.QXLJGHMC.js} +4 -4
- package/dist/preview/{chunk.J2MM6BUW.js → chunk.QZQCQWQG.js} +1 -1
- package/dist/preview/{chunk.6FQW6FNL.js → chunk.R6JBA7UK.js} +1 -1
- package/dist/preview/chunk.R7CRBRD4.js +1 -0
- package/dist/preview/chunk.RD2FSSLV.js +1 -0
- package/dist/preview/{chunk.OEIWIZCP.js → chunk.RG5G6YQD.js} +1 -1
- package/dist/preview/{chunk.PFQBCHQA.js → chunk.RJY7VJBH.js} +1 -1
- package/dist/preview/chunk.RR25BGWP.js +1 -0
- package/dist/preview/{chunk.BZ7QWHAE.js → chunk.RSQ432QN.js} +1 -1
- package/dist/preview/{chunk.MWGZKZD6.js → chunk.SFBHPYRD.js} +1 -1
- package/dist/preview/{chunk.FFOD5B4B.js → chunk.SJQPTDAT.js} +1 -1
- package/dist/preview/{chunk.OTV5XTBB.js → chunk.SNHKYH72.js} +1 -1
- package/dist/preview/{chunk.WSDJPXJD.js → chunk.SO6NT5K7.js} +1 -1
- package/dist/preview/{chunk.FDZE5LTJ.js → chunk.STPA7HBK.js} +2 -2
- package/dist/preview/{chunk.ONYBW45K.js → chunk.SY5ID44D.js} +1 -1
- package/dist/preview/chunk.T27QKVKP.js +1 -0
- package/dist/preview/{chunk.U6TEW6YD.js → chunk.T2OUHRAA.js} +1 -1
- package/dist/preview/chunk.T3WCRS6M.js +1 -0
- package/dist/preview/{chunk.QGIM2WAY.js → chunk.TI5FR2QQ.js} +1 -1
- package/dist/preview/{chunk.HOCD7KIR.js → chunk.TTSGCNPT.js} +1 -1
- package/dist/preview/{chunk.ES63XSIM.js → chunk.TXZQEJ5T.js} +1 -1
- package/dist/preview/{chunk.6LXIEM6B.js → chunk.UDHPMVC4.js} +1 -1
- package/dist/preview/{chunk.KBPJ7X7W.js → chunk.UGQYMN4J.js} +1 -1
- package/dist/preview/{chunk.M6ZN2KUO.js → chunk.UQIPEMJ5.js} +1 -1
- package/dist/preview/{chunk.FIFUMX5X.js → chunk.URQTF5SY.js} +1 -1
- package/dist/preview/{chunk.J7W2OFHY.js → chunk.UW52CMGJ.js} +1 -1
- package/dist/preview/{chunk.LINSO5PN.js → chunk.UWS4RMM3.js} +1 -1
- package/dist/preview/{chunk.QPF4KSAW.js → chunk.V7H4BUEB.js} +1 -1
- package/dist/preview/{chunk.KHRS2SKB.js → chunk.VBHV4TLG.js} +1 -1
- package/dist/preview/{chunk.U3ED7W2U.js → chunk.VBLQJVQ5.js} +1 -1
- package/dist/preview/{chunk.CVPMSPCH.js → chunk.WALVW3KJ.js} +1 -1
- package/dist/preview/{chunk.2KFZHUAC.js → chunk.WEMUKZKH.js} +1 -1
- package/dist/preview/{chunk.YIPXZUTT.js → chunk.X226YATK.js} +1 -1
- package/dist/preview/{chunk.GNEOSHQ6.js → chunk.XFLGSUYO.js} +1 -1
- package/dist/preview/{chunk.W4YDPHCQ.js → chunk.XSWSBTUO.js} +1 -1
- package/dist/preview/{chunk.OJY7VJ7D.js → chunk.YCD4JSXD.js} +1 -1
- package/dist/preview/{chunk.72ZCLEQC.js → chunk.YZPESGCP.js} +1 -1
- package/dist/preview/{chunk.XOE4KNP2.js → chunk.Z27NSSYL.js} +2 -2
- package/dist/preview/{chunk.DEHIR4EG.js → chunk.Z2XUVJAL.js} +1 -1
- package/dist/preview/{chunk.YXEO3Y65.js → chunk.Z3O2VZAJ.js} +1 -1
- package/dist/preview/{chunk.M2JCFNHJ.js → chunk.Z4TY44CD.js} +1 -1
- package/dist/preview/{chunk.EXYCN4WI.js → chunk.ZAPS4J6G.js} +1 -1
- package/dist/preview/{chunk.6TLXFMX2.js → chunk.ZAQ4IDX6.js} +1 -1
- package/dist/preview/{chunk.6HY6ZGEE.js → chunk.ZEZUKRC6.js} +1 -1
- package/dist/preview/{chunk.GEFXU4VO.js → chunk.ZG5VGP5U.js} +1 -1
- package/dist/preview/index.html +56 -56
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.4WGYUYWU.js +0 -2
- package/dist/preview/chunk.5EMIWORS.js +0 -1
- package/dist/preview/chunk.6EVMXBNB.js +0 -1
- package/dist/preview/chunk.BCQWAFGD.js +0 -1
- package/dist/preview/chunk.BOCVLC7X.js +0 -1
- package/dist/preview/chunk.DPJNGFEZ.js +0 -4
- package/dist/preview/chunk.E4VRRWFP.js +0 -1
- package/dist/preview/chunk.EUAO4QNV.js +0 -1
- package/dist/preview/chunk.F7672TKJ.js +0 -1
- package/dist/preview/chunk.FA42HCPW.js +0 -1
- package/dist/preview/chunk.FBJAQPZ6.js +0 -1
- package/dist/preview/chunk.GAFMWOME.js +0 -1
- package/dist/preview/chunk.I4Z7HVRT.js +0 -1
- package/dist/preview/chunk.JMXXA4YG.js +0 -1
- package/dist/preview/chunk.JMYUQNXN.js +0 -6
- package/dist/preview/chunk.K6DFXDPZ.js +0 -1
- package/dist/preview/chunk.KF27ME27.js +0 -1
- package/dist/preview/chunk.L25DCT5S.js +0 -1
- package/dist/preview/chunk.MODLZJD4.js +0 -25
- package/dist/preview/chunk.OJGHDWI6.js +0 -1
- package/dist/preview/chunk.SSF47GUY.js +0 -1
- package/dist/preview/chunk.T6DPWW2K.js +0 -3
- package/dist/preview/chunk.TA36WBHK.js +0 -1
- package/dist/preview/chunk.TTGKX7LT.js +0 -1
- package/dist/preview/chunk.U3HERHAI.js +0 -88
- package/dist/preview/chunk.V5I4GZEY.js +0 -1
- package/dist/preview/chunk.VT2YGDK2.js +0 -1
- package/dist/preview/chunk.XK65Y2KX.js +0 -1
- package/dist/preview/chunk.Z274CL7J.js +0 -1
- package/dist/preview/chunk.ZBVYD4OX.js +0 -90
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as le,b as ce}from"./chunk.25VJPUDH.js";import{a as ue}from"./chunk.HJUZMOW2.js";import{e as oe,f as ie,g as re,h as O,i as ae,j as de,k as P}from"./chunk.NAXOXBOF.js";import{b as ge}from"./chunk.6W6XMLSF.js";import"./chunk.PZ7KY6XH.js";import"./chunk.WEMUKZKH.js";import"./chunk.T27QKVKP.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import{m as M}from"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{G as te,W as H,ea as I,ga as ne,oa as se}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import{Dc as ee,eb as J,fc as X,ha as Y,la as _,na as F,oa as Q,sa as Z,yb as K}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as R}from"./chunk.AJZBJBMO.js";function pe(e){let n=e.basis.trim(),r=/^[^:]{1,40}: (?:\d(?:\.\d+)?|none|no)\b/i.test(n)?/\(([^()]+)\)\s*$/.exec(n)?.[1]??"":n;if(!r||/^[\d.\s%]+$/.test(r))return"No reason was kept.";let o=r.charAt(0).toUpperCase()+r.slice(1);return/[.!?]$/.test(o)?o:`${o}.`}var ke=new Set(["in","into","on","onto","under","at","within","inside","near","beside","behind","over","after","before"]),$e=new Set(["for","to","on","in","with","by","from","of","after","before","into","about","under"]),xe=e=>/ies$/.test(e)?e.replace(/ies$/,"y"):/(ch|sh|x|ss|o)es$/.test(e)?e.replace(/es$/,""):e.replace(/s$/,""),We=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function U(e,n){let a=e.schema,r=s=>typeof s=="string"?e.graph.getNode(s):void 0,o=(s,y=!1)=>({record:s.id,label:_(a.tryDefinition(s.kind),s),...y?{quoted:!0}:{}}),i=(s,y,w)=>({parts:s,text:s.map(S=>typeof S=="string"?S:S.quoted?`\u201C${S.label}\u201D`:S.label).join(""),group:y,many:w}),c=i([n.intent],`intent:${n.intent}`,s=>`${s} suggestions`);if(n.calls.length!==1)return c;let m=n.calls[0],$=m.args,u=e.allMutations().find(s=>s.name===m.name),f=u?.subject?.arg,d=f?r($[f]):void 0;if(!u||!d)return c;let v=s=>F(a,d.kind,s),b=s=>`${m.name}:${s}`,k=()=>{let s=X(u.input).filter(y=>y.name!==f&&$[y.name]!==void 0);return s.length===1?r($[s[0].name]):void 0},x=r($.into);if(m.name===`merge-${d.kind}`&&x)return i(["Merge ",o(d,!0)," into ",o(x),"?"],b("merge"),s=>`${v(s)} to merge`);if(m.name===`archive-${d.kind}`)return i(["Set ",o(d,!0)," aside?"],b("archive"),s=>`${v(s)} to set aside`);let h=k(),p=u.connects?.find(s=>a.tryDefinition(d.kind)?.edges?.[s]!==void 0);if(h&&p){let s=a.tryDefinition(d.kind).edges[p],y=Z(a.tryDefinition(d.kind),p).split(" "),[w,S]=y,C=We(Q(a,h.kind));if(w&&ke.has(w))return i(["Put ",o(d,!0),` ${w} `,o(h),"?"],b(`put:${w}`),W=>`${v(W)} to put ${w} ${C}`);if(w&&S&&$e.has(S)&&/[^s]s$/.test(w))return i(["Should ",o(d,!0),` ${[xe(w),...y.slice(1)].join(" ")} `,o(h),"?"],b("verb"),W=>`${v(W)} to link`);let z=y.join(" ");return s.cardinality==="one"?i(["Make ",o(h),` the ${z} of `,o(d,!0),"?"],b("one"),W=>`${v(W)} to give ${/^[aeiou]/i.test(z)?"an":"a"} ${z}`):i(["Add ",o(h),` to the ${z} of `,o(d,!0),"?"],b("many"),W=>`${v(W)} to link`)}let T=Object.entries($).filter(([s,y])=>s!==f&&typeof y=="string"&&!r(y));return n.lineage?.actor==="categorize"&&T.length===1?i(["Mark ",o(d,!0),` as ${Y(String(T[0][1]))}?`],b("mark"),s=>`${v(s)} to mark`):c}function me(e,n){let a=new Map;for(let r of n){let o=U(e,r),i=r.calls.length===1?o.group:`one:${a.size}`,c=a.get(i);c?c.suggestions.push(r):a.set(i,{sentence:o,suggestions:[r]})}return[...a.values()].map(({sentence:r,suggestions:o})=>o.length>1?{words:r.many(o.length),suggestions:o}:{suggestions:o})}var g=R(te(),1);var fe=R(te(),1),A=R(H(),1),ye={minWidth:0,overflowWrap:"anywhere"};function he({suggestion:e,decides:n,heard:a}){let{store:r,principal:o}=I(),[i,c]=(0,fe.useState)(null),m=e.items;if(m.length<2)return null;let $=(u,f)=>{c(null);try{O(r,e.id,{author:o,items:[u]}),a("Accepted that change; the rest still wait."),requestAnimationFrame(()=>{let d=document.querySelector(`[data-suggestion="${CSS.escape(e.id)}"]`);(d?.querySelectorAll('[data-testid="suggestion-item-accept"]')[f]??d?.querySelectorAll('[data-testid="suggestion-item-accept"]')[f-1]??d?.querySelector('[data-testid="suggestion-accept"]'))?.focus()})}catch(d){c(d instanceof Error?d.message:String(d))}};return(0,A.jsxs)("details",{"data-testid":"suggestion-items",style:{minWidth:0},children:[(0,A.jsx)("summary",{style:{cursor:"pointer",fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:`Show the ${m.length} changes`}),(0,A.jsx)("ol",{style:{margin:"6px 0 0",padding:0,listStyle:"none",display:"grid",gap:4,minWidth:0},children:m.map((u,f)=>(0,A.jsxs)("li",{"data-testid":"suggestion-item","data-item":u.at,style:{display:"flex",alignItems:"baseline",gap:6,minWidth:0,fontSize:"0.75rem"},children:[(0,A.jsx)("span",{style:{...ye,flex:"1 1 auto"},children:u.intent}),n?(0,A.jsx)("button",{type:"button","data-testid":"suggestion-item-accept","aria-label":`Accept: ${u.intent}`,onClick:()=>$(u.at,f),style:{minHeight:24,padding:"1px 8px",fontSize:"0.75rem",flex:"0 0 auto"},children:"Accept"}):null]},u.at))}),i?(0,A.jsx)("span",{"data-testid":"suggestion-item-refused",role:"alert",style:{...ye,display:"block",fontSize:"0.75rem",color:"var(--graview-warn)"},children:i}):null]})}var t=R(H(),1);function Ae(e,n,a=0){let r=[e>0?`${e===1?"one suggestion":`${e} suggestions`} waiting`:"",e>0&&a>0?`${a===1?"a reader agrees":`${a} readers agree`} with one that waits`:"",n>0?`tidied ${n===1?"one thing":`${n} things`} while you were away`:""].filter(Boolean);return r.length>0?r.join(" \xB7 ").replace(/^./,o=>o.toUpperCase()):void 0}function Se(){let{store:e,principal:n,dismissals:a,app:r}=I(),o=ne(),i=(0,g.useMemo)(()=>ce(a,r?.name??"app",n),[a,r?.name,n]),[c,m]=(0,g.useReducer)(u=>u+1,0);return(0,g.useEffect)(()=>i.onChange?.(m),[i]),(0,g.useEffect)(()=>e.subscribe((u,f)=>f.some(d=>d.vote!==void 0)&&m()),[e]),{waiting:(0,g.useMemo)(()=>oe(e,n,{dismissed:i.list()}),[e,n,o,i,c]),notNow:i}}function Ye({onCount:e}){let{waiting:n}=Se();return(0,g.useEffect)(()=>e(n.length),[e,n.length]),null}function _e({close:e,done:n}){let{store:a,whileAway:r}=I(),{waiting:o,notNow:i}=Se(),[c,m]=(0,g.useState)(""),$=se(),u=k=>a.graph.has(k)?x=>{e(),$.record(x)}:null,f=r?.tidied??0,d=r?Ae(o.length,f,r.agreed):void 0,v=k=>{if(m(k),o.length>1){requestAnimationFrame(()=>document.querySelector('[data-testid="suggested"] [data-testid="suggestion-accept"]')?.focus());return}n()},b=(0,t.jsx)("span",{role:"status","data-testid":"suggestion-heard",style:M,children:c});return o.length===0&&!d?b:(0,t.jsxs)("div",{"data-testid":"suggested",style:{display:"flex",flexDirection:"column",gap:9,minWidth:0},children:[d?(0,t.jsxs)("p",{"data-testid":"while-away",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[d,"."]}):null,o.length===0?(0,t.jsx)("p",{style:{margin:0,fontSize:"0.75rem",lineHeight:1.45,color:"var(--graview-ink-faint)"},children:"What it did is in Activity."}):null,[o.filter(P),o.filter(k=>!P(k))].map((k,x)=>k.length===0?null:(0,t.jsxs)("div",{style:{display:"grid",gap:6,minWidth:0},children:[o.some(P)?(0,t.jsx)("h3",{style:{margin:0,fontSize:"0.75rem",fontWeight:600,color:"var(--graview-ink-muted)"},children:x===0?"Proposed":"Suggested by the app"}):null,(0,t.jsx)("ol",{"data-testid":x===0?"proposals":"suggestions",style:we,children:me(a,k).map(h=>h.words?(0,t.jsxs)("li",{"data-testid":"suggestion-group",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:6,minWidth:0},children:[(0,t.jsx)("span",{style:{...N,fontSize:"0.75rem",fontWeight:600,color:"var(--graview-ink-muted)"},children:h.words}),(0,t.jsx)("ol",{style:we,children:h.suggestions.map(p=>(0,t.jsx)(ve,{suggestion:p,notNow:i,settled:v,heard:m,goes:u},p.id))})]},h.suggestions[0].id):h.suggestions.map(p=>(0,t.jsx)(ve,{suggestion:p,notNow:i,settled:v,heard:m,goes:u},p.id)))})]},x)),b]})}var N={minWidth:0,overflowWrap:"anywhere"},we={margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:10,fontSize:"0.8125rem",minWidth:0},E={minHeight:24,padding:"1px 10px",fontSize:"0.75rem"},j={...E,border:"1px solid transparent",background:"transparent",boxShadow:"none",color:"var(--graview-ink-muted)"};function Te({part:e,go:n}){let a={display:"inline-block",maxWidth:"min(24ch, 100%)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"bottom"},r=n?(0,t.jsx)("button",{type:"button","data-testid":"suggestion-record","data-record":e.record,title:`Go to ${e.label}`,onClick:()=>n(e.record),className:"graview-activity-record",style:{all:"unset",...a,cursor:"pointer",fontWeight:600,color:"var(--graview-ink)",textDecoration:"underline",textDecorationColor:"color-mix(in srgb, var(--graview-ink) 35%, transparent)",textUnderlineOffset:2},children:e.label}):(0,t.jsx)("span",{title:e.label,style:{...a,fontWeight:600},children:e.label});return e.quoted?(0,t.jsxs)(t.Fragment,{children:["\u201C",r,"\u201D"]}):r}var Ce={accept:"Accepted.",decline:"Declined: it will not be suggested again.",later:"Hidden from you until tomorrow.",withdraw:"Withdrawn."},G={recorded:"Your vote was recorded.",withdrawn:"Your vote was withdrawn."},ze=(e,n)=>n.startsWith(`${e}: `)?n.slice(e.length+2):n,De=e=>{let n=`${e.for} for, ${e.against} against`,a=Re(e.advisory);return a?`${n} \xB7 ${a}`:n};function Re(e){if(!e)return"";let n=e.for===0?"":e.for===1?"a visitor agrees":`${e.for} visitors agree`,a=e.against===0?"":e.against===1?`${n?"one":"a visitor"} disagrees`:`${e.against}${n?"":" visitors"} disagree`;return[n,a].filter(Boolean).join(", ")}function ve({suggestion:e,notNow:n,settled:a,heard:r,goes:o}){let{store:i,principal:c,seats:m,people:$,signIn:u}=I(),[f,d]=(0,g.useState)(null),[v,b]=(0,g.useState)(null),k=(0,g.useId)(),x=(0,g.useId)(),h=J(e.author,{graph:i.graph,schema:i.schema,seats:m,people:$}),p=(0,g.useMemo)(()=>ie(i,e,c),[i,e,c]),T=(0,g.useMemo)(()=>p||i.permits({name:ee,args:{suggestion:e.id,vote:"for"}},c).ok,[p,i,e.id,c]),{tally:s}=e,y=P(e),w=y&&c!==void 0&&!p&&K(c).id===e.lineage.proposedBy,S=async l=>{d(null);try{if(l==="withdraw")de(i,e.id,{author:c});else if(l==="accept"||l==="decline"){if((l==="accept"?O(i,e.id,{author:c}):ae(i,e.id,{author:c})).voted!==void 0){b(G.recorded),r(G.recorded);return}}else if(l==="unvote"){re(i,e.id,null,{author:c}),b(G.withdrawn),r(G.withdrawn);return}else await n.dismiss({suggestion:e.id,at:new Date().toISOString(),until:le()});a(Ce[l])}catch(D){d(D instanceof Error?D.message:String(D))}},C=e.items.length>1,z=(0,g.useMemo)(()=>U(i,e),[i,e]),W=new Set(z.parts.flatMap(l=>typeof l=="string"?[]:[l.record])),L=e.lineage&&!(y&&e.lineage.basis.startsWith("Proposed by "))?pe(e.lineage):void 0,[V,be]=(0,g.useState)(!1),q=(0,g.useId)(),B=(0,g.useId)();return(0,t.jsxs)("li",{"data-testid":"suggestion","data-suggestion":e.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,lineHeight:1.45,minWidth:0},children:[(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",columnGap:10,rowGap:4,minWidth:0},children:[(0,t.jsxs)("span",{id:q,"data-graview-suggestion-words":"",style:{...N,flex:"1 1 14em"},children:[y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{"data-testid":"proposed-by",style:{color:"var(--graview-ink-muted)"},children:["Proposed by ",(0,t.jsx)("strong",{style:{fontWeight:600,color:"var(--graview-ink)"},children:w?"you":h}),":"]})," "]}):C?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:h})," ",(0,t.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:"suggests"})," "]}):null,C?ze(h,e.headline??e.intent):z.parts.map((l,D)=>typeof l=="string"?l:(0,t.jsx)(Te,{part:l,go:o(l.record)},D))]}),(0,t.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4,marginInlineStart:"auto",minWidth:0},children:[L?(0,t.jsx)("button",{type:"button","data-testid":"suggestion-why","aria-expanded":V,"aria-controls":B,onClick:()=>be(l=>!l),style:{...j,padding:"1px 6px"},children:"Why?"}):null,w?(0,t.jsx)("button",{type:"button","data-testid":"proposal-withdraw",onClick:()=>void S("withdraw"),style:E,children:"Withdraw"}):T?(0,t.jsx)("button",{type:"button","data-testid":"suggestion-accept",onClick:()=>void S("accept"),...p?{"aria-describedby":q}:{"aria-pressed":s.mine==="for","aria-describedby":x},style:E,children:p&&C?"Accept all":"Yes"}):u?(0,t.jsx)("button",{type:"button","data-testid":"suggestion-sign-in",onClick:()=>u.run(),style:E,children:"Sign in to vote"}):null,T&&!w?(0,t.jsx)("button",{type:"button","data-testid":"suggestion-decline",onClick:()=>void S("decline"),...p?{"aria-describedby":q}:{"aria-pressed":s.mine==="against","aria-describedby":x},style:E,children:"No"}):null,!p&&T&&!w&&s.mine!==void 0?(0,t.jsx)("button",{type:"button","data-testid":"suggestion-withdraw-vote",onClick:()=>void S("unvote"),style:j,children:"Withdraw vote"}):null,(0,t.jsx)("button",{type:"button","data-testid":"suggestion-not-now",onClick:()=>void S("later"),title:"Hide it from you until tomorrow. It still waits for everyone else.","aria-describedby":k,style:j,children:"Later"})]})]}),(0,t.jsx)("span",{id:k,style:M,children:"Hides it from you until tomorrow; it still waits for everyone else."}),!p&&T&&!w?(0,t.jsx)("span",{id:x,style:M,children:"Counts as your vote; somebody who may make it decides."}):null,L?(0,t.jsx)("span",{id:B,"data-graview-lineage":"",hidden:!V,style:{...N,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:L}):null,C?(0,t.jsx)(he,{suggestion:e,decides:p,heard:r}):null,e.about.some(l=>!W.has(l))&&(C||W.size===0)?(0,t.jsx)("div",{"data-graview-suggestion-records":"",style:{display:"flex",flexWrap:"wrap",gap:4,minWidth:0},children:e.about.filter(l=>!W.has(l)).slice(0,4).map(l=>(0,t.jsx)(ue,{id:l,label:ge(i,l),go:o(l),testId:"suggestion-record"},l))}):null,p&&s.for+s.against+(s.advisory?s.advisory.for+s.advisory.against:0)>0?(0,t.jsx)("span",{"data-testid":"suggestion-tally",style:{...N,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:De(s)}):null,v?(0,t.jsx)("span",{"data-testid":"suggestion-voted",role:"status",style:{...N,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:v}):null,f?(0,t.jsx)("span",{"data-testid":"suggestion-refused",role:"alert",style:{...N,fontSize:"0.75rem",color:"var(--graview-warn)"},children:f}):null]})}export{Ye as SuggestedCount,_e as SuggestedList,Re as advisoryWords,Ae as awayWords,De as tallyWords};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A}from"./chunk.QDVGHI7R.js";import{a as x,c as T,d as w}from"./chunk.
|
|
1
|
+
import{a as A}from"./chunk.QDVGHI7R.js";import{a as x,c as T,d as w}from"./chunk.AKJS2NUM.js";import{L as S,P as v,S as $}from"./chunk.ZEZUKRC6.js";function M(e,t,n){let r=e.schema.tryDefinition(t)?.fields?.shape?.[n];return r===void 0?void 0:A(r)}function I(e,t){if(e===void 0)return[];if(!Array.isArray(e))return[`The view's accepts is a list of { "kind": <a kind>, "field": <its image, video or file field> }.`];let n=[],i=new Set(t.schema.kinds);for(let r of e){let{kind:c,field:o}=r??{};typeof c!="string"||typeof o!="string"?n.push(`Each of the view's accepts is { "kind": <a kind>, "field": <its image, video or file field> }.`):i.has(c)?M(t,c,o)?t.allMutations().some(a=>(a.creates??[]).includes(c)&&Object.hasOwn(a.input?.shape??{},o))||n.push(`No act of this app makes a "${c}" with its "${o}", so a file dropped could become nothing.`):n.push(`The view accepts files into ${c}'s "${o}", which holds no picture, video or file.`):n.push(`The view accepts files for "${c}", which is no kind of this app.`)}return n}function E(e,t,n){if(e===void 0||e===!0)return[];let i=`The view's pictures is true; the kinds whose pictures it draws, ["circuit"]; or { "width": <the widest it draws a picture, in pixels> } with the fields it draws them from, by kind, { "circuit": "photo" }.`;if(typeof e!="object"||e===null)return[i];let r=new Set([...n.attach==="home"?[]:[n.attach],...n.reads?.kinds??[]]),c=new Set(t.schema.kinds),o=[],a=d=>{if(!c.has(d))return void o.push(`The view's pictures chooses "${d}", which is no kind of this app.`);r.has(d)||o.push(`The view's pictures chooses "${d}", whose records it is not handed: add "${d}" to its reads.kinds.`)};if(Array.isArray(e)){if(e.length===0||!e.every(d=>typeof d=="string"))return[i];for(let d of e)a(d);return o}for(let[d,l]of Object.entries(e)){if(d==="width"&&typeof l!="string"&&!Array.isArray(l)){Number.isInteger(l)&&l>=16&&l<=4096||o.push("The view's pictures width is a whole number of pixels from 16 to 4096.");continue}let f=typeof l=="string"?[l]:Array.isArray(l)&&l.length>0&&l.every(u=>typeof u=="string")?l:void 0;if(!f){o.push(`The view's pictures says "${d}": beside "width", it names a kind and the field it draws pictures from, "circuit": "photo", or its fields, "circuit": ["photo", "map"].`);continue}let y=o.length;if(a(d),!(o.length>y))for(let u of f){let p=M(t,d,u);p?p.as==="video"&&o.push(`The view's pictures chooses ${d}'s "${u}", which holds videos: the host plays a video where the view places it, and hands no picture of it.`):o.push(`The view's pictures chooses ${d}'s "${u}", which holds no picture.`)}}return o}function F(e){if(e===void 0)return[];if(typeof e!="object"||e===null||Array.isArray(e))return[`The view's scene is { "maxHeight": <the tallest its preview on the Scene is drawn, in pixels> }.`];let{maxHeight:t,...n}=e,i=[];return Object.keys(n).length>0&&i.push(`The view's scene says ${Object.keys(n).map(r=>`"${r}"`).join(", ")}: only "maxHeight" is read.`),t!==void 0&&!(Number.isInteger(t)&&t>=80&&t<=4e3)&&i.push("The view's scene maxHeight is a whole number of pixels from 80 to 4000."),i}function j(e){return(e.acts??[]).map(t=>typeof t=="string"?{act:t}:t)}function C(e,t){let n=[],i=new Set(t.schema.kinds),r=new Set(t.schema.edgeKinds),c=new Set(t.allMutations().map(a=>a.name));(typeof e.name!="string"||!/^[a-z0-9][a-z0-9-]{0,62}$/.test(e.name))&&n.push(`The view's name "${String(e.name)}" is not lower-case letters, digits and hyphens.`),e.title!==void 0&&(typeof e.title!="string"||e.title.trim()===""||e.title.length>80)&&n.push("The view's title is empty or longer than 80 characters."),e.attach!=="home"&&!i.has(e.attach)&&n.push(`The view attaches to "${e.attach}", which is no kind of this app.`),e.cardinality!=="one"&&e.cardinality!=="many"&&n.push(`The view's cardinality is "${String(e.cardinality)}", not one or many.`),e.attach==="home"&&e.cardinality!=="many"&&n.push("A view of the home draws many records: its cardinality is many."),e.replaces!==void 0&&e.replaces!=="page"?n.push(`The view's replaces is "${String(e.replaces)}": the one thing a view replaces is "page", or leave it out to draw the view above the record's own fields.`):e.replaces==="page"&&e.attach==="home"&&n.push(`The home's view is the home already: replaces "page" is for a view of a kind, of one record (its page) or of many (its list).`),e.gestures!==void 0&&typeof e.gestures!="boolean"&&n.push(`The view's gestures is "${String(e.gestures)}": it is true, or left out.`),e.bleed!==void 0&&typeof e.bleed!="boolean"&&n.push(`The view's bleed is "${String(e.bleed)}": it is true, or left out.`),e.heading!==void 0&&(e.heading!=="own"||e.attach==="home"||e.cardinality!=="many"||e.title===void 0)&&n.push(`The view's heading is "${String(e.heading)}": it is "own" on a view that is a place (a title, cardinality many), or left out.`),e.flows!==void 0&&typeof e.flows!="boolean"?n.push(`The view's flows is "${String(e.flows)}": it is false for a view that keeps its place's frame, or left out.`):e.flows===!1&&(e.attach==="home"||e.cardinality!=="many"||e.title===void 0)&&n.push("Only a view that is a place keeps a frame: flows false needs a title and cardinality many on a kind."),n.push(...F(e.scene)),e.scene!==void 0&&(e.attach==="home"||e.cardinality!=="many")&&n.push("Only a view of a kind's members is drawn on the Scene as a card: scene needs cardinality many on a kind."),n.push(...E(e.pictures,t,e)),n.push(...I(e.accepts,t));for(let a of e.reads?.kinds??[])i.has(a)||n.push(`The view reads "${a}", which is no kind of this app.`);for(let a of e.reads?.edges??[])r.has(a)||n.push(`The view reads the edge "${a}", which no kind of this app declares.`);let o=new Set;for(let a of j(e)){c.has(a.act)||n.push(`The view asks for the act "${a.act}", which this app does not declare.`);let d=a.as??a.act;o.has(d)&&n.push(`Two of the view's acts are called "${d}".`),o.add(d)}return n}function H(e,t,n){let i=[...new Set([...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]])];if(i.length<2)return[];let r=new Set(t.reads?.edges??[]),c=o=>new RegExp(`(["'\`])${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\1`).test(n);return e.schema.edgeKinds.filter(o=>{let a=e.schema.edge(o);return!r.has(o)&&a!==void 0&&a.from.some(d=>i.includes(d))&&(a.to==="*"||a.to.some(d=>i.includes(d)))&&c(o)})}function z(e,t,n){let i=H(e,t,n);if(i.length===0)return;let r=(c,o)=>c.length<2?c[0]??"":`${c.slice(0,-1).join(", ")} ${o} ${c[c.length-1]}`;return`"${t.name}" names ${r(i,"and")} but does not read ${i.length>1?"them":"it"}, so the view is handed no such links: add ${r(i.map(c=>`"${c}"`),"and")} to its manifest's reads.edges.`}function D(e,t){return[...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]].some(i=>Object.keys(e.schema.tryDefinition(i)?.computed??{}).length>0)}function Z(e,t,n){let{manifest:i}=n,r=n.input??{},o=e.seenBy(t).graph,a=i.attach==="home"?void 0:i.attach,d=a&&i.cardinality==="one"&&r.node?o.getNode(r.node.id):void 0,l=d&&d.kind===a?[d]:[],f=a&&i.cardinality==="many"?r.nodes?r.nodes.flatMap(s=>{let h=o.getNode(s.id);return h&&h.kind===a?[h]:[]}):o.nodesOfKind(a):[],y=new Set([...l,...f].map(s=>s.id)),u=x(o,y,{kinds:(i.reads?.kinds??[]).filter(s=>s!==a||i.cardinality==="one"),edges:i.reads?.edges??[]}),p=new Map;for(let s of[...f,...u.nodes])l.some(h=>h.id===s.id)||p.set(s.id,s);let P=new Set([...l.map(s=>s.id),...p.keys()]),G=[...u.edges],O=new Set(j(i).map(s=>s.act)),V=e.permittedMutations(t).filter(s=>O.has(s.name)).map(s=>({name:s.name,title:s.title??s.name,...s.description!==void 0?{description:s.description}:{},...s.subject?{subject:{kinds:s.subject.kinds,arg:s.subject.arg}}:{}})),m=s=>s?.filter(h=>P.has(h)),k=n.computed,b=s=>k?{...w(e,s),...k(o,s)}:w(e,s);return{view:i.name,...l[0]?{node:b(l[0])}:{},nodes:[...p.values()].map(b),edges:G,...i.title!==void 0?{label:i.title}:r.label!==void 0?{label:r.label}:{},cardinality:i.cardinality,...r.fidelity!==void 0?{fidelity:r.fidelity}:{},...r.mode!==void 0?{mode:r.mode}:{},...r.selected!==void 0?{selected:r.selected}:{},...r.implicated?{implicated:m(r.implicated)}:{},...r.flagged?{flagged:m(r.flagged)}:{},acts:V,...n.theme?{theme:n.theme}:{},locale:v(),timeZone:$(),today:e.today()??S(),...T(e.schema,[...l,...p.values()]),...n.places?{places:n.places.filter((s,h,g)=>g.findIndex(W=>W.as===s.as)===h).map(({as:s,title:h,kind:g})=>({as:s,title:h,kind:g}))}:{}}}export{M as a,j as b,C as c,H as d,z as e,D as f,Z as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Qe,b as Xe,c as Je,d as rt,e as it,h as Ze,i as ea,k as aa,m as ta,n as ra,o as ia}from"./chunk.
|
|
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 Qe,b as Xe,c as Je,d as rt,e as it,h as Ze,i as ea,k as aa,m as ta,n as ra,o as ia}from"./chunk.GMLONS5L.js";import{c as je}from"./chunk.35KMZHB7.js";import{g as Ja,h as et,i as at}from"./chunk.DEKRFTRN.js";import"./chunk.YZPESGCP.js";import{b as Ya,c as ja,d as Ye,e as Qa}from"./chunk.GVT4UUQA.js";import"./chunk.J6HF7IRQ.js";import{m as Ee,q as _a,r as Ua,s as Va}from"./chunk.LRNFE3UK.js";import{a as Za}from"./chunk.HJCQ6I3S.js";import{b as Xa}from"./chunk.YCD4JSXD.js";import"./chunk.ZG5VGP5U.js";import{b as Ka}from"./chunk.NKYWIGC7.js";import"./chunk.6UQFV53C.js";import{b as _e,d as Ue,e as Ve}from"./chunk.GRFD42WM.js";import"./chunk.U5P23GO7.js";import"./chunk.HJUZMOW2.js";import"./chunk.NAXOXBOF.js";import{b as Ge}from"./chunk.6W6XMLSF.js";import"./chunk.PZ7KY6XH.js";import"./chunk.WEMUKZKH.js";import"./chunk.T27QKVKP.js";import"./chunk.URQTF5SY.js";import"./chunk.BIDL7GQD.js";import"./chunk.LP2ZMAT2.js";import"./chunk.MSAYU25L.js";import"./chunk.EGPCVMDU.js";import{i as tt}from"./chunk.FPHRAO3R.js";import"./chunk.LVOTLGJB.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.6SJEZWH3.js";import"./chunk.6N4PE3U5.js";import"./chunk.B7KZBT27.js";import"./chunk.WALVW3KJ.js";import"./chunk.SNHKYH72.js";import"./chunk.UGQYMN4J.js";import"./chunk.RG5G6YQD.js";import"./chunk.MIE4TJRW.js";import{c as Ba,d as Da,e as ue,p as Wa}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{K as Ga,e as Ha,f as Oa,m as qe,q as Fa,x as qa}from"./chunk.QNP5OR3P.js";import{b as Ta,c as Ct}from"./chunk.4W57E7AX.js";import{G as _,La as Ae,Qa as Pa,Ra as U,Ua as Na,W as A,Ya as Ia,ba as za,da as Ma,ea as T,ga as Ce,i as Ke,j as Se,m as ee,n as $e,o as Fe,pa as La,r as ge,x as Ea,y as ve,z as Ra}from"./chunk.A5PSEU3W.js";import{a as ie}from"./chunk.SDO3U72B.js";import{Rc as Aa,Z as re,na as $a,oa as ke,pa as G,rd as H,td as B,ua as Ca}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as f}from"./chunk.AJZBJBMO.js";function At(e){return`
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
.graview-altitude-control {
|
|
@@ -1136,6 +1136,6 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
|
|
|
1136
1136
|
}
|
|
1137
1137
|
[data-graview-connector][data-graview-activity] {
|
|
1138
1138
|
animation: graview-relation 1200ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
1139
|
-
}`}function na(e="dark",o={}){let d=At(e);return o.scope===void 0?d:Ta(d,o.scope)}var I=f(_(),1);var V=f(A(),1),Et=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.U3HERHAI.js","./chunk.FBILPNGH.js","./chunk.MODLZJD4.js","./chunk.SDO3U72B.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ES63XSIM.js")))).part(e=>(0,V.jsx)(e.MapKey,{}),{quiet:!0});function oa(){let{store:e}=T(),{view:o}=U(),d=Ce(),s=(0,I.useMemo)(()=>e.graph.allEdges().length>0,[e,d]),[n,m]=(0,I.useState)(!1),v=(0,I.useId)(),g=(0,I.useRef)(null),y=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!n)return;let b=k=>{let w=k.target;w&&(y.current?.contains(w)||g.current?.contains(w))||m(!1)};return document.addEventListener("pointerdown",b,!0),()=>document.removeEventListener("pointerdown",b,!0)},[n]);let[S,c]=(0,I.useState)(null);return(0,I.useEffect)(()=>{let b=g.current?.parentElement?.parentElement?.querySelector('[data-testid="overview"]');if(!b||typeof ResizeObserver>"u")return;let k=()=>c(Math.ceil(b.getBoundingClientRect().width));k();let w=new ResizeObserver(k);return w.observe(b),()=>w.disconnect()},[s]),s?(0,V.jsxs)("div",{style:{display:"contents"},onKeyDown:b=>{b.key!=="Escape"||!n||(b.preventDefault(),b.stopPropagation(),m(!1),g.current?.focus({preventScroll:!0}))},children:[(0,V.jsx)("button",{ref:g,type:"button","data-testid":"lines-key",className:"graview-lines-key","data-graview-up-row":o.overview?void 0:"","aria-expanded":n,"aria-controls":v,title:"What the lines mean",onClick:()=>m(b=>!b),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",...S!==null?{"--graview-up-room":`${S}px`}:{}},children:"Key"}),n?(0,V.jsxs)("div",{ref:y,id:v,"data-testid":"lines-key-pane",className:"graview-lines-key-pane","data-graview-up-row":o.overview?void 0:"","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("rail"),width:it,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[o.overview?(0,V.jsx)(Et,{}):null,(0,V.jsx)(rt,{inside:!0,widthOf:Za})]}):null]}):null}var Te=f(_(),1),Re=f(A(),1);function nt(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Rt=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.DPJNGFEZ.js","./chunk.ONYBW45K.js","./chunk.2VR7YEJ6.js","./chunk.LETAQTLJ.js","./chunk.BUVTUAB5.js","./chunk.HJCQ6I3S.js","./chunk.OJY7VJ7D.js","./chunk.GEFXU4VO.js","./chunk.WSO7JOW5.js","./chunk.XOE4KNP2.js","./chunk.2KFZHUAC.js","./chunk.V5I4GZEY.js","./chunk.FIFUMX5X.js","./chunk.BIDL7GQD.js","./chunk.V7W5AQKL.js","./chunk.EMFOMSMI.js","./chunk.QOS5T46W.js","./chunk.Q5WEOX3Q.js","./chunk.4FCFNAA4.js","./chunk.4AC2QM7T.js","./chunk.JXNVNFV4.js","./chunk.WVUJXDXZ.js","./chunk.I2737CPF.js","./chunk.NJRLJEJY.js","./chunk.CVPMSPCH.js","./chunk.OTV5XTBB.js","./chunk.KBPJ7X7W.js","./chunk.OEIWIZCP.js","./chunk.MIE4TJRW.js","./chunk.5LJVOLKR.js","./chunk.OJGHDWI6.js","./chunk.OWFS2YDQ.js","./chunk.WSDJPXJD.js","./chunk.F4VB6Q2W.js","./chunk.FFOD5B4B.js","./chunk.Z7Y3R3YR.js","./chunk.YXEO3Y65.js","./chunk.U3HERHAI.js","./chunk.FBILPNGH.js","./chunk.MODLZJD4.js","./chunk.SDO3U72B.js","./chunk.6HY6ZGEE.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QHMHUL6B.js")))),Tt=Rt.part((e,o)=>(0,Re.jsx)(e.MapPanelFor,{showing:o.showing}),{what:"This panel",quiet:!0});function sa(){let{store:e,view:o,selection:d,hiddenKinds:s,seatTalk:n}=T();Ce();let m=(0,Te.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1);if(!o.overview||m)return null;let v=nt(Xa(d,{...o,beside:!0},g=>e.graph.getNode(g)?.kind));return!v||v.what!=="record"&&(s.has(v.kind)||!e.schema.kinds.includes(v.kind))?null:(0,Re.jsx)(Te.Suspense,{fallback:null,children:(0,Re.jsx)(Tt,{showing:v})})}var zt=f(_(),1);var D=f(A(),1);function da(){let{view:e,go:o}=U(),{store:d,views:s,hiddenKinds:n}=T(),m=e.overview??!1,v=s.places().map(k=>k.kind).filter(k=>!n.has(k)),g=Ga(e,d.schema.kinds,v),y=()=>{o(Se(ee(e,!1),g))},S=(()=>{if(!g)return null;let k=Ea(g)[0],w=e.within?.view,R=(w?s.places().find(P=>P.as===w):void 0)??(k?s.places().filter(P=>P.kind===k).at(-1):void 0);return R?R.title:k?G(d.schema,k):d.graph.getNode(g)?.label??null})(),c=m?"Close the map":"Up",b=m&&S?`Close the map, down to ${S}`:c;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":m,"aria-label":b,title:m?b:"Up \u2014 everything, from above",onClick:()=>m?y():o(ee(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":m?1:0,...m?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:c})]})}var la=f(A(),1);function ca(){let{administered:e}=T(),{view:o,go:d}=U(),s=e.filter(n=>n.canShow);return s.length===0?null:(0,la.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(n=>(0,la.jsx)("button",{type:"button","aria-pressed":n.shown,"data-testid":`show-${n.name}`,title:n.shown?`Hide the ${n.name}'s own districts again`:n.description??`Show the ${n.name}'s own districts beside the domain`,onClick:()=>d(Ya(o,n.name,!n.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:n.shown?"var(--graview-accent)":"var(--graview-edge)",color:n.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:n.shown?"var(--graview-panel)":"transparent"},children:n.shown?`Hide the ${n.name}`:`Show the ${n.name}`},n.name))})}var u=f(_(),1);var t=f(A(),1);za({search:Ua,touchWeights:_a});var ne=e=>e!==void 0&&"act"in e,ze=e=>e!==void 0&&"hit"in e&&e.hit.about==="node"?e:void 0,Mt=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Lt(e){let o=()=>typeof window>"u"||window.innerWidth>=qt,[d,s]=(0,u.useState)(o);return(0,u.useEffect)(()=>{let n=()=>s(o());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),d&&!e}function lt({compact:e=!1}){let{store:o,view:d,setView:s,principal:n,setMenuAt:m,brand:v,aiDesk:g,selection:y}=T(),S=Oa(g),c=Ma(),b=Pa(),k=Wa().marks.flag,w=Lt(e),R=(0,u.useRef)(null),P=(0,u.useRef)(null),z=(0,u.useRef)(null),W=(0,u.useId)(),[Le,N]=(0,u.useState)(!1),[K,oe]=(0,u.useState)(null),[ht,fe]=(0,u.useState)(null),[Pe,he]=(0,u.useState)([]),M=d.q??"";(0,u.useEffect)(()=>{let a=r=>{if(r.defaultPrevented)return;let i=r.key.toLowerCase()==="k"&&(r.metaKey||r.ctrlKey)&&!r.altKey&&!r.shiftKey,l=r.key==="/"&&!r.metaKey&&!r.ctrlKey&&!r.altKey;if(!i&&!l)return;let p=R.current;if(!p)return;let h=p.closest("[data-graview-embed]"),C=r.target,J=C===document.body||C===document.documentElement||C===window;if(h&&!(i&&J||C instanceof Node&&h.contains(C)))return;let Z=document.activeElement,pe=Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLSelectElement||Z instanceof HTMLElement&&Z.isContentEditable;l&&pe||(r.preventDefault(),p.getClientRects().length===0&&p.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),p.focus({preventScroll:!0}),p.select(),N(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Ne=(0,u.useMemo)(()=>{let a=new Map;for(let[i,l]of(c?.hits??[]).entries()){if(l.about==="act")continue;let p=Mt(l),h=a.get(p)??[];h.push({id:`${W}-${i}`,hit:l}),a.set(p,h)}let r=[...a.values()].filter(i=>i.some(l=>l.hit.about==="node")).length>1;return[...a.entries()].map(([i,l])=>{let p=0,h=l.filter(pe=>pe.hit.about!=="node"||!r||++p<=Wt),C=h.filter(pe=>pe.hit.about==="node").length,J=i.endsWith(":")?l.length:c?.byKind[i]??C,Z=!i.endsWith(":")&&C>0&&J>C?{id:`${W}-all-${i}`,all:i,count:J}:null;return{key:i,rows:h,count:J,more:Z}})},[c,W]),ae=S&&M.trim()?{id:`${W}-ask`,ask:M.trim()}:null,$=(0,u.useMemo)(()=>[...Ne.flatMap(a=>a.more?[...a.rows,a.more]:a.rows),...ae?[ae]:[]],[Ne,ae?.ask]),fa=(c?.hits??[]).filter(a=>a.about==="node").length,be=c?.words??M,Ie=(0,u.useMemo)(()=>Ee(be).split(" ").filter(Boolean),[be]),F=(0,u.useCallback)(a=>a.hit.about==="node"?Va(o,a.hit.id,be,{principal:n,limit:Kt}).map((r,i)=>({id:`${a.id}-act-${i}`,act:r,of:a.id})):[],[o,be,n]),He=$.find(a=>a.id===K),q=$.find(a=>a.id===ht)??He??$[0],se=(0,u.useMemo)(()=>w&&ze(q)?F(q):[],[w,q?.id,F]),xe=(0,u.useMemo)(()=>w?new Map:new Map(Pe.flatMap(a=>{let r=ze($.find(i=>i.id===a));return r?[[a,F(r)]]:[]})),[w,Pe,$,F]),bt=(0,u.useMemo)(()=>w?new Set:new Set($.flatMap(a=>ze(a)&&F(a).length>0?[a.id]:[])),[w,$,F]),Oe=(0,u.useMemo)(()=>w?se:[...xe.values()].flat(),[w,se,xe]),L=He??Oe.find(a=>a.id===K)??$[0];(0,u.useEffect)(()=>{oe(null),fe(null),he([])},[M]);let de=(0,u.useRef)(null);(0,u.useEffect)(()=>{let a=de.current;if(!a)return;de.current=null;let r=0,i=()=>{let l=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),p=document.activeElement;if(!(!p||p===document.body||p===document.documentElement||p===R.current||p===z.current||p===l))return;let C=[...l?.querySelectorAll('[role="group"][aria-label="Arrange"] :is(button, input)')??[]].find(J=>J.checkVisibility?.()??!0);if(C)return C.focus({preventScroll:!0});l&&l.tabIndex>=0&&p!==l&&l.focus({preventScroll:!0}),++r<240?requestAnimationFrame(i):document.activeElement===z.current&&z.current?.blur()};requestAnimationFrame(i)},[d]);let Be=(a,r)=>{let i=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`);if(i&&i.tabIndex>=0)return i.focus({preventScroll:!0});let l=z.current;if(!l)return R.current?.blur();l.setAttribute("aria-label",r),l.focus({preventScroll:!0})},ha=(0,u.useRef)({x:Number.NaN,y:Number.NaN,moved:!1});(0,u.useEffect)(()=>{let a=r=>{let i=ha.current;i.moved=r.clientX!==i.x||r.clientY!==i.y,i.x=r.clientX,i.y=r.clientY};return window.addEventListener("mousemove",a,{capture:!0,passive:!0}),()=>window.removeEventListener("mousemove",a,{capture:!0})},[]);let le=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>clearTimeout(le.current),[]);let te=a=>{a&&(clearTimeout(le.current),oe(a.id),ne(a)||fe(a.id))},ba=a=>{if(!ha.current.moved)return;let r=a.target.closest?.('[role="option"]')?.id;if(!r||r===K)return;let i=$.find(l=>l.id===r)??Oe.find(l=>l.id===r);i&&(oe(i.id),!ne(i)&&(clearTimeout(le.current),le.current=setTimeout(()=>fe(i.id),Ft)))},xt=()=>{clearTimeout(le.current),q&&!ne(L)&&oe(q.id)},yt=a=>he(r=>r.includes(a.id)?r.filter(i=>i!==a.id):[...r,a.id]),xa=a=>{let r=P.current,i=r?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,l=r?.clientHeight??0;return Math.min(a,i>0&&l>0?Math.max(1,Math.floor(l/i)-1):Bt)};(0,u.useEffect)(()=>{K&&document.getElementById(K)?.scrollIntoView?.({block:"nearest"})},[K]);let De=a=>{if(!a)return;if("ask"in a){Ha(g,{pointed:{...y[0]!==void 0?{on:y[0]}:{},about:y},asked:a.ask}),s(i=>Ye(i)),N(!1);return}if("all"in a)return s(i=>ve(ee(i,!1),ge(a.all),{ownPicture:!0,...i.q?{carry:i.q}:{}})),de.current=a.all,N(!1),Be(a.all,`Opening ${G(o.schema,a.all)} matching \u201C${M.trim()}\u201D\u2026`);if(ne(a)){let i=a.act.subject;s(p=>$e(p,[i]));let l=R.current?.getBoundingClientRect();m({x:l?.left??0,y:(l?.bottom??0)+6,on:i}),N(!1),R.current?.blur();return}let r=a.hit;switch(r.about){case"node":s(i=>$e(Se(ee(i,!1),r.id),[r.id]));break;case"kind":return s(i=>ve(ee(i,!1),ge(r.kind),{ownPicture:!0})),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.label}\u2026`);case"place":return s(i=>Ra(i,r.kind,r.as)),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.title}\u2026`);case"rule":{let i=b.filter(l=>l.invariant===r.name).flatMap(l=>l.nodeIds);s(l=>$e(l,[...new Set(i)]));break}case"act":break}N(!1),R.current?.blur()},kt=c?Ot(c.byKind,c.hits,o.schema):"",ce=Le&&M.trim().length>0,St=(0,u.useCallback)(()=>{let a=R.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Vt};let r=R.current?.getBoundingClientRect();return r?{x:r.right,y:r.bottom}:null},[]),ya=Ia("find",{open:ce,onOpenChange:a=>{a||N(!1)},...e?{at:St}:{}}),ye=$.every(a=>"ask"in a),ka=a=>ne(a)?Oe.filter(r=>r.of===a.of):[],$t=a=>{let r=ne(L)&&K!==null,i=r?$.find(p=>p.id===L.of):K!==null?He:void 0,l=i?$.indexOf(i):-1;if(a.key==="ArrowDown"){if(a.preventDefault(),N(!0),r){let p=ka(L),h=p.indexOf(L)+1;if(h<p.length)return te(p[h]);if(w)return}te($[Math.min($.length-1,l+1)])}else if(a.key==="ArrowUp"){if(a.preventDefault(),r){let p=ka(L),h=p.indexOf(L)-1;return te(h>=0?p[h]:i)}te($[Math.max(0,l-1)])}else if((a.key==="PageDown"||a.key==="PageUp")&&$.length>0){a.preventDefault(),N(!0);let p=a.key==="PageDown"?xa($.length):-xa($.length);te($[Math.min($.length-1,Math.max(0,(l<0?-1:l)+p))])}else if(a.key==="ArrowRight"&&!r&&ze(L)){let p=L,h=w?p.id===q?.id?se:F(p):xe.get(p.id)??F(p);if(h.length===0)return;a.preventDefault(),!w&&!Pe.includes(p.id)&&he(C=>[...C,p.id]),fe(p.id),oe(h[0].id)}else if(a.key==="ArrowLeft"&&r){a.preventDefault();let p=L.of;w||he(h=>h.filter(C=>C!==p)),te($.find(h=>h.id===p))}else a.key==="Enter"?(a.preventDefault(),De(L)):a.key==="Escape"&&(a.preventDefault(),M?s(p=>Ye(p)):R.current?.blur())},We=(a,r,i={},l={})=>{let p=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":p,onClick:()=>De(a),style:{...er,...p?ar:null,...i},...l,children:r},a.id)},Sa=(a,r)=>{let i=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":i,"data-testid":"find-act","data-about":"act",onClick:()=>De(a),style:{...r?nr:pt,...i?or:null,...a.act.destructive?{color:"var(--graview-warn)"}:null},children:a.act.title},a.id)};return(0,t.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,t.jsx)("input",{ref:a=>{R.current=a,ya.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":ce,"aria-controls":W,"aria-autocomplete":"list",...ce&&L?{"aria-activedescendant":L.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:M,onChange:a=>{let r=a.target.value;N(!0),s(i=>ja(i,r.length>0?r:null))},onFocus:()=>N(!0),onBlur:()=>N(!1),onKeyDown:$t,style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${M?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,t.jsx)("span",{role:"status","aria-live":"polite",style:qe,"data-testid":"find-count",children:M.trim()?kt:""}),(0,t.jsx)("span",{ref:z,tabIndex:-1,role:"status",style:qe,"data-testid":"find-landing"}),(0,t.jsxs)("div",{...ya.pane,id:W,role:"listbox","aria-label":M?`What \u201C${M}\u201D finds`:"What the words find","data-testid":"find-strip","data-graview-find":w?"panel":"narrow",hidden:!ce,onMouseDown:a=>a.preventDefault(),style:{..._t,...e?Yt:w&&!ye?Ut:null,...ce?{display:"flex"}:null},children:[(0,t.jsxs)("div",{style:{...jt,gridTemplateColumns:w&&!ye?`minmax(0, 1fr) ${Gt}`:"minmax(0, 1fr)"},children:[(0,t.jsxs)("div",{ref:P,role:"presentation","data-testid":"find-list",onMouseMove:ba,style:Qt,children:[ye?(0,t.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",c?.words||M,"\u201D."]}):Ne.map(a=>(0,t.jsxs)("div",{role:"group","aria-label":st(a.key,o.schema),children:[(0,t.jsxs)("div",{role:"presentation",style:pa,children:[a.key!=="rule:"&&a.key!=="act:"?(0,t.jsx)(ct,{kind:a.key,accents:v?.accents}):null,(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:st(a.key,o.schema)}),(0,t.jsx)("span",{"aria-hidden":"true",style:Zt,"data-testid":"find-group-count",children:re(a.count)})]}),a.rows.map(r=>{let i=r.hit,l=i.about==="node"?i:null,p=!w&&l!==null&&bt.has(r.id),h=xe.get(r.id);return(0,t.jsxs)(u.Fragment,{children:[We(r,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Nt,{hit:i,flag:k,words:l?.near&&l.why.matched?[...Ie,Ee(l.why.matched)]:Ie}),p?(0,t.jsx)("span",{"aria-hidden":"true","data-testid":"find-acts-open","data-open":h?"":void 0,title:h?"Put its actions away":"Actions",onClick:C=>{C.stopPropagation(),yt(r)},style:{...dr,...h?lr:null},children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"3.5",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"12.5",cy:"8",r:"1.4",fill:"currentColor"})]})}):null]}),p?{paddingRight:48}:{},{"data-testid":"find-hit","data-about":i.about,...l?.near?{"data-near":""}:{},title:Ht(i)}),h?(0,t.jsx)("div",{role:"group","aria-label":`What can be done about ${l?.label??"it"}`,style:sr,children:h.map(C=>Sa(C,!0))}):null]},r.id)}),a.more?We(a.more,(0,t.jsxs)("span",{style:Q,children:["All ",re(a.more.count)," ",ke(o.schema,a.more.all).toLowerCase()," matching \u201C",M.trim(),"\u201D"]}),tr,{"data-testid":"find-all","data-about":"all"}):null]},a.key)),ae?We(ae,(0,t.jsxs)("span",{style:Q,children:["Tell Graview: ",(0,t.jsxs)("span",{style:{fontWeight:600},children:["\u2018",ae.ask,"\u2019"]})]}),{borderTop:"1px solid var(--graview-edge)",marginTop:4},{"data-testid":"find-ask"}):null,fa>Dt?(0,t.jsxs)("p",{role:"presentation",style:dt,"data-testid":"find-more-words",children:[re(fa)," found: another word of the name narrows them."]}):null,c&&c.searched.past===!1&&c.searched.kinds.some(a=>o.schema.tryDefinition(a)?.lifecycle)?(0,t.jsx)("p",{role:"presentation",style:dt,children:"Current ones; add is:any for the past."}):null]}),w&&!ye&&q?(0,t.jsxs)("div",{role:"group","aria-label":"The one lit","data-testid":"find-panel",onMouseEnter:xt,onMouseMove:ba,style:Xt,children:[(0,t.jsx)(Pt,{row:q,schema:o.schema,accents:v?.accents,marking:Ie,q:M.trim(),flag:k}),se.length>0?(0,t.jsxs)("div",{role:"group","aria-label":"Actions",style:{display:"grid",gap:4},children:[(0,t.jsx)("div",{role:"presentation",style:{...pa,padding:"10px 0 4px"},children:"Actions"}),se.map(a=>Sa(a,!1))]}):null]}):null]}),e?null:(0,t.jsxs)("div",{"aria-hidden":"true",style:cr,"data-testid":"find-keys",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2191"}),(0,t.jsx)("kbd",{style:me,children:"\u2193"})," move"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u21B5"})," open"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2192"})," actions"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"esc"})," close"]})]})]})]})}function Pt({row:e,schema:o,accents:d,marking:s,q:n,flag:m}){let v=null,g="",y,S=null;if("ask"in e)g="Tell Graview",y=`\u2018${e.ask}\u2019`,S=(0,t.jsx)("p",{style:Y,children:"Says it to Graview about what is selected; the answer comes on a card beside it."});else if("all"in e)v=e.all,g=G(o,e.all),y=`All ${re(e.count)} matching \u201C${n}\u201D`,S=(0,t.jsxs)("p",{style:Y,children:["Opens the ",ke(o,e.all).toLowerCase(),", narrowed by these words."]});else{let c=e.hit;switch(c.about){case"node":{v=c.kind,g=ot(Ca(o.tryDefinition(c.kind),c.kind)),y=(0,t.jsxs)(t.Fragment,{children:[c.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[m," "]}):null,(0,t.jsx)(j,{text:c.label,words:s})]});let b=[c.apart,c.current?null:"past",c.archived?"set aside":null].filter(Boolean).join(" \xB7 ");S=(0,t.jsxs)(t.Fragment,{children:[b?(0,t.jsx)("p",{style:Y,children:ot(b)}):null,c.near?(0,t.jsxs)("p",{style:Y,children:["Near \u201C",c.why.asked,"\u201D",c.why.field!=="label"?` \u2014 ${c.why.reading.toLowerCase()}: ${c.why.fragment}`:""]}):c.why.field!=="label"?(0,t.jsxs)("p",{style:Y,children:[(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:c.why.reading}),(0,t.jsx)("br",{}),(0,t.jsx)(j,{text:c.why.fragment,words:s})]}):null]});break}case"kind":v=c.kind,g="Kind",y=c.label,S=(0,t.jsxs)("p",{style:Y,children:["Goes into the ",c.label.toLowerCase(),", all of them",c.count>0?`; ${re(c.count)} match these words`:"","."]});break;case"place":v=c.kind,g="Place",y=c.title,S=(0,t.jsxs)("p",{style:Y,children:["A picture of the ",ke(o,c.kind).toLowerCase(),"."]});break;case"rule":g="Rule",y=c.label,S=(0,t.jsx)("p",{style:Y,children:"Selects what it flags."});break;case"act":g="Act",y=c.title;break}}return(0,t.jsxs)("div",{role:"presentation","data-testid":"find-said",style:{display:"grid",gap:6},children:[(0,t.jsxs)("div",{style:{...pa,padding:0},children:[v?(0,t.jsx)(ct,{kind:v,accents:d}):null,g]}),(0,t.jsx)("div",{style:Jt,children:y}),S]})}function Nt({hit:e,flag:o,words:d}){switch(e.about){case"node":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:rr,children:[e.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[o," "]}):null,(0,t.jsx)(j,{text:e.label,words:d}),e.apart?(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,t.jsx)("span",{style:we,children:" \xB7 past"})]}),e.near?(0,t.jsxs)("span",{style:{...Q,...we},"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: `:"",e.why.field!=="label"?(0,t.jsx)(j,{text:e.why.fragment,words:d}):null]}):e.why.field!=="label"?(0,t.jsxs)("span",{style:{...Q,...we},children:[e.why.reading.toLowerCase(),": ",(0,t.jsx)(j,{text:e.why.fragment,words:d})]}):null]});case"kind":return(0,t.jsxs)("span",{style:Q,children:[(0,t.jsx)(j,{text:e.label,words:d}),(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,t.jsxs)("span",{style:Q,children:["Go to ",(0,t.jsx)(j,{text:e.title,words:d})]});case"rule":return(0,t.jsxs)("span",{style:Q,children:["The rule \u201C",(0,t.jsx)(j,{text:e.label,words:d}),"\u201D"]});case"act":return(0,t.jsx)("span",{style:Q,children:e.title})}}function It(e,o){if(o.length===0)return[{text:e}];let d=[],s=0;for(let n of e.matchAll(/[\p{L}\p{N}]+/gu)){let m=n[0],v=Ee(m).replace(/ /g,""),g=o.filter(c=>v.startsWith(c)).sort((c,b)=>b.length-c.length)[0];if(!g)continue;let y=v.length===m.length?g.length:m.length,S=n.index??0;S>s&&d.push({text:e.slice(s,S)}),d.push({text:m.slice(0,y),marked:!0}),s=S+y}return s<e.length&&d.push({text:e.slice(s)}),d}function j({text:e,words:o}){return(0,t.jsx)(t.Fragment,{children:It(e,o).map((d,s)=>d.marked?(0,t.jsx)("mark",{style:ir,children:d.text},s):(0,t.jsx)(u.Fragment,{children:d.text},s))})}function Ht(e){if(e.about!=="node")return"";let o=e.near?`Near \u201C${e.why.asked}\u201D`:e.why.field!=="label"?`${e.why.reading}: ${e.why.fragment}`:"";return o?`${e.label}
|
|
1140
|
-
${o}`:e.label}var ot=e=>e&&e[0].toUpperCase()+e.slice(1);function ct({kind:e,accents:o}){let d=Math.round(Aa(e,o));return(0,t.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${d} 55% 52%)`}})}function st(e,o){return e==="rule:"?"Rules":e==="act:"?"Acts":G(o,e)}function Ot(e,o,d){let s=Object.entries(e).map(([v,g])=>$a(d,v,g)),n=o.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;n>0&&s.push(`${n} ${n===1?"place or rule":"places and rules"}`);let m=o.filter(v=>v.about==="node"&&v.near).length;return s.length===0?"Nothing found":`${s.join(", ")} found${m>0?`, ${m} of them near`:""}`}var Bt=10,Dt=12,Wt=5,Kt=6,Ft=140,qt=760,Gt="15.5rem",_t={...Na,flexDirection:"column",width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(64vh, 30rem)",overflow:"hidden",boxSizing:"border-box",background:"linear-gradient(var(--graview-panel), var(--graview-panel)) var(--graview-ground, var(--graview-panel))",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:0},Ut={width:"min(42rem, calc(100vw - 24px))"},Vt=6,Yt={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},jt={display:"grid",gridTemplateRows:"minmax(0, 1fr)",flex:"1 1 auto",minHeight:0},Qt={overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"4px 0",overscrollBehavior:"contain"},Xt={overflowY:"auto",minHeight:0,padding:"12px 14px",borderLeft:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",display:"flex",flexDirection:"column",gap:4},Jt={fontWeight:600,fontSize:"0.9375rem",lineHeight:1.35,color:"var(--graview-ink)",overflowWrap:"anywhere"},Y={margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},pa={display:"flex",alignItems:"center",gap:6,padding:"10px 12px 4px",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Zt={marginLeft:"auto",fontWeight:400,letterSpacing:0,fontVariantNumeric:"tabular-nums",color:"var(--graview-ink-faint)"},er={position:"relative",display:"grid",gap:1,minHeight:34,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)",minWidth:0},ar={background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))",boxShadow:"inset 3px 0 0 var(--graview-accent)"},tr={color:"var(--graview-accent)",fontSize:"0.8125rem",minHeight:30},Q={display:"block",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},rr={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,minWidth:0,overflow:"hidden",overflowWrap:"anywhere",fontWeight:600},we={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400},ir={background:"color-mix(in srgb, var(--graview-accent) 24%, transparent)",color:"inherit",borderRadius:2,padding:0,boxShadow:"0 1px 0 color-mix(in srgb, var(--graview-accent) 70%, transparent)"},pt={display:"flex",alignItems:"center",minHeight:32,padding:"4px 10px",boxSizing:"border-box",borderWidth:1,borderStyle:"solid",borderColor:"var(--graview-edge)",borderRadius:6,background:"var(--graview-panel)",color:"var(--graview-ink)",fontSize:"0.8125rem",lineHeight:1.3,cursor:"pointer",overflowWrap:"anywhere"},nr={...pt,minHeight:32,margin:"0 12px 4px 24px"},or={borderColor:"var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))"},sr={display:"grid",padding:"2px 0 6px"},dr={position:"absolute",top:"50%",right:6,transform:"translateY(-50%)",width:36,height:32,display:"grid",placeItems:"center",borderRadius:6,color:"var(--graview-ink-muted)",borderWidth:1,borderStyle:"solid",borderColor:"transparent"},lr={color:"var(--graview-accent)",borderColor:"var(--graview-edge)",background:"var(--graview-panel)"},dt={margin:0,padding:"6px 12px 4px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},cr={display:"flex",flexWrap:"wrap",gap:"4px 14px",padding:"7px 12px",borderTop:"1px solid var(--graview-edge)",color:"var(--graview-ink-faint)",fontSize:"0.75rem",flex:"0 0 auto"},me={display:"inline-block",minWidth:16,padding:"0 4px",marginRight:3,border:"1px solid var(--graview-edge)",borderRadius:4,font:"inherit",fontSize:"0.6875rem",lineHeight:"16px",textAlign:"center",color:"var(--graview-ink-muted)",background:"var(--graview-panel)"};var Me=f(_(),1),ga=f(Ct(),1);var vt=f(A(),1);function gt(){let{following:e,follow:o}=T();return e?(0,vt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>o(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var ut=f(_(),1);var E=f(A(),1);function wt({home:e,homeLabel:o,children:d,onPicture:s=!1}){let{view:n,focus:m,show:v,go:g}=U(),{store:y}=T(),{movedByHand:S}=T(),c=S&&(n.pan!==void 0||Object.keys(n.pins).length>0),b=n.focusId&&n.focusId!==e?y.graph.getNode(n.focusId):void 0,k=z=>G(y.schema,z),w={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},R=o!==void 0&&b!==void 0,P=[];if(b&&!s&&P.push({key:"focused",node:(0,E.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>g(Fe({...n,focusId:e},!1)),title:Ge(y,b.id),style:{...w,maxWidth:"min(14rem, 15vw)"},children:[(0,E.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Ge(y,b.id)}),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.past&&P.push({key:"past",node:(0,E.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>g(Qa(n,!1)),title:"Back to now \u2014 retired things leave the picture again",style:w,children:["the past",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.zoom&&P.push({key:"zoomed",node:(0,E.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>g(Fe(n,!1)),title:"Zoom back out",style:w,children:["zoomed in",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),c&&P.push({key:"moved",node:(0,E.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>g(Ke(n)),title:"Put the camera and everything you dragged back where the layout wanted them",style:w,children:"Reset view"})}),n.relation){let z=n.relation;P.push({key:"raised",node:(0,E.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,E.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>g(ve(n,ge(z),{ownPicture:!0})),title:`Go into the ${k(z).toLowerCase()}`,"aria-label":`Go into the ${k(z).toLowerCase()}`,style:{...w,color:"var(--graview-ink)"},children:[k(z),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,E.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>v(null),title:`Stop showing ${k(z).toLowerCase()}`,"aria-label":`Stop showing ${k(z).toLowerCase()}`,style:{...w,minWidth:26,justifyContent:"center"},children:(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return s&&!R&&P.length===0&&d===void 0?null:(0,E.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[R?(0,E.jsx)("button",{type:"button",onClick:()=>m(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:o}):null,P.map(({key:z,node:W},Le)=>(0,E.jsxs)(ut.Fragment,{children:[R||Le>0?(0,E.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,W]},z)),d]})}var O=f(A(),1);function va(){let[e,o]=(0,Me.useState)([]),d=(0,Me.useCallback)(s=>{o(n=>{let m=s.phase!=="running"&&n[0]?.name===s.name&&n[0]?.at===s.at;return[s,...m?n.slice(1):n].slice(0,12)})},[]);return[e,d]}function ua({find:e,calls:o,seat:d,remembers:s=!1}){return e?(0,O.jsxs)(O.Fragment,{children:[(0,ga.createPortal)((0,O.jsx)(lt,{compact:e.compact}),e.slot),e.own?(0,ga.createPortal)((0,O.jsx)(Ka,{calls:o,remembers:s,...d!==void 0?{seat:d}:{}}),e.own):null]}):null}function wa({home:e=null}){return(0,O.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:B("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,O.jsx)(wt,{home:e,onPicture:!0}),(0,O.jsx)("span",{style:{pointerEvents:"auto"},children:(0,O.jsx)(gt,{})})]})}var X=f(_(),1);var mt=f(A(),1),pr=ie(()=>(__graviewPreload(import.meta.url,["./chunk.Q355UPFG.js","./chunk.
|
|
1139
|
+
}`}function na(e="dark",o={}){let d=At(e);return o.scope===void 0?d:Ta(d,o.scope)}var I=f(_(),1);var V=f(A(),1),Et=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TXZQEJ5T.js")))).part(e=>(0,V.jsx)(e.MapKey,{}),{quiet:!0});function oa(){let{store:e}=T(),{view:o}=U(),d=Ce(),s=(0,I.useMemo)(()=>e.graph.allEdges().length>0,[e,d]),[n,m]=(0,I.useState)(!1),v=(0,I.useId)(),g=(0,I.useRef)(null),y=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!n)return;let b=k=>{let w=k.target;w&&(y.current?.contains(w)||g.current?.contains(w))||m(!1)};return document.addEventListener("pointerdown",b,!0),()=>document.removeEventListener("pointerdown",b,!0)},[n]);let[S,c]=(0,I.useState)(null);return(0,I.useEffect)(()=>{let b=g.current?.parentElement?.parentElement?.querySelector('[data-testid="overview"]');if(!b||typeof ResizeObserver>"u")return;let k=()=>c(Math.ceil(b.getBoundingClientRect().width));k();let w=new ResizeObserver(k);return w.observe(b),()=>w.disconnect()},[s]),s?(0,V.jsxs)("div",{style:{display:"contents"},onKeyDown:b=>{b.key!=="Escape"||!n||(b.preventDefault(),b.stopPropagation(),m(!1),g.current?.focus({preventScroll:!0}))},children:[(0,V.jsx)("button",{ref:g,type:"button","data-testid":"lines-key",className:"graview-lines-key","data-graview-up-row":o.overview?void 0:"","aria-expanded":n,"aria-controls":v,title:"What the lines mean",onClick:()=>m(b=>!b),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",...S!==null?{"--graview-up-room":`${S}px`}:{}},children:"Key"}),n?(0,V.jsxs)("div",{ref:y,id:v,"data-testid":"lines-key-pane",className:"graview-lines-key-pane","data-graview-up-row":o.overview?void 0:"","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("rail"),width:it,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[o.overview?(0,V.jsx)(Et,{}):null,(0,V.jsx)(rt,{inside:!0,widthOf:Za})]}):null]}):null}var Te=f(_(),1),Re=f(A(),1);function nt(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Rt=Ae(ie(()=>(__graviewPreload(import.meta.url,["./chunk.DEKRFTRN.js","./chunk.SY5ID44D.js","./chunk.GVT4UUQA.js","./chunk.J6HF7IRQ.js","./chunk.LRNFE3UK.js","./chunk.HJCQ6I3S.js","./chunk.YCD4JSXD.js","./chunk.ZG5VGP5U.js","./chunk.QAM76AXV.js","./chunk.Z27NSSYL.js","./chunk.WEMUKZKH.js","./chunk.T27QKVKP.js","./chunk.URQTF5SY.js","./chunk.BIDL7GQD.js","./chunk.LP2ZMAT2.js","./chunk.MSAYU25L.js","./chunk.EGPCVMDU.js","./chunk.Q5WEOX3Q.js","./chunk.6SJEZWH3.js","./chunk.6N4PE3U5.js","./chunk.B7KZBT27.js","./chunk.WVUJXDXZ.js","./chunk.DWM7AR5Y.js","./chunk.6KJGRM7A.js","./chunk.WALVW3KJ.js","./chunk.SNHKYH72.js","./chunk.UGQYMN4J.js","./chunk.RG5G6YQD.js","./chunk.MIE4TJRW.js","./chunk.QRQ5WPZI.js","./chunk.RD2FSSLV.js","./chunk.37RFCHSS.js","./chunk.SO6NT5K7.js","./chunk.MUSMNKE4.js","./chunk.SJQPTDAT.js","./chunk.JQ63N4MZ.js","./chunk.Z3O2VZAJ.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.LYEGRY77.js")))),Tt=Rt.part((e,o)=>(0,Re.jsx)(e.MapPanelFor,{showing:o.showing}),{what:"This panel",quiet:!0});function sa(){let{store:e,view:o,selection:d,hiddenKinds:s,seatTalk:n}=T();Ce();let m=(0,Te.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1);if(!o.overview||m)return null;let v=nt(Xa(d,{...o,beside:!0},g=>e.graph.getNode(g)?.kind));return!v||v.what!=="record"&&(s.has(v.kind)||!e.schema.kinds.includes(v.kind))?null:(0,Re.jsx)(Te.Suspense,{fallback:null,children:(0,Re.jsx)(Tt,{showing:v})})}var zt=f(_(),1);var D=f(A(),1);function da(){let{view:e,go:o}=U(),{store:d,views:s,hiddenKinds:n}=T(),m=e.overview??!1,v=s.places().map(k=>k.kind).filter(k=>!n.has(k)),g=Ga(e,d.schema.kinds,v),y=()=>{o(Se(ee(e,!1),g))},S=(()=>{if(!g)return null;let k=Ea(g)[0],w=e.within?.view,R=(w?s.places().find(P=>P.as===w):void 0)??(k?s.places().filter(P=>P.kind===k).at(-1):void 0);return R?R.title:k?G(d.schema,k):d.graph.getNode(g)?.label??null})(),c=m?"Close the map":"Up",b=m&&S?`Close the map, down to ${S}`:c;return(0,D.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":m,"aria-label":b,title:m?b:"Up \u2014 everything, from above",onClick:()=>m?y():o(ee(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:B("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":m?1:0,...m?{color:"var(--graview-accent)"}:{}},children:[(0,D.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,D.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,D.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,D.jsx)("span",{className:"graview-altitude-label",children:c})]})}var la=f(A(),1);function ca(){let{administered:e}=T(),{view:o,go:d}=U(),s=e.filter(n=>n.canShow);return s.length===0?null:(0,la.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(n=>(0,la.jsx)("button",{type:"button","aria-pressed":n.shown,"data-testid":`show-${n.name}`,title:n.shown?`Hide the ${n.name}'s own districts again`:n.description??`Show the ${n.name}'s own districts beside the domain`,onClick:()=>d(Ya(o,n.name,!n.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:n.shown?"var(--graview-accent)":"var(--graview-edge)",color:n.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:n.shown?"var(--graview-panel)":"transparent"},children:n.shown?`Hide the ${n.name}`:`Show the ${n.name}`},n.name))})}var u=f(_(),1);var t=f(A(),1);za({search:Ua,touchWeights:_a});var ne=e=>e!==void 0&&"act"in e,ze=e=>e!==void 0&&"hit"in e&&e.hit.about==="node"?e:void 0,Mt=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Lt(e){let o=()=>typeof window>"u"||window.innerWidth>=qt,[d,s]=(0,u.useState)(o);return(0,u.useEffect)(()=>{let n=()=>s(o());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),d&&!e}function lt({compact:e=!1}){let{store:o,view:d,setView:s,principal:n,setMenuAt:m,brand:v,aiDesk:g,selection:y}=T(),S=Oa(g),c=Ma(),b=Pa(),k=Wa().marks.flag,w=Lt(e),R=(0,u.useRef)(null),P=(0,u.useRef)(null),z=(0,u.useRef)(null),W=(0,u.useId)(),[Le,N]=(0,u.useState)(!1),[K,oe]=(0,u.useState)(null),[ht,fe]=(0,u.useState)(null),[Pe,he]=(0,u.useState)([]),M=d.q??"";(0,u.useEffect)(()=>{let a=r=>{if(r.defaultPrevented)return;let i=r.key.toLowerCase()==="k"&&(r.metaKey||r.ctrlKey)&&!r.altKey&&!r.shiftKey,l=r.key==="/"&&!r.metaKey&&!r.ctrlKey&&!r.altKey;if(!i&&!l)return;let p=R.current;if(!p)return;let h=p.closest("[data-graview-embed]"),C=r.target,J=C===document.body||C===document.documentElement||C===window;if(h&&!(i&&J||C instanceof Node&&h.contains(C)))return;let Z=document.activeElement,pe=Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLSelectElement||Z instanceof HTMLElement&&Z.isContentEditable;l&&pe||(r.preventDefault(),p.getClientRects().length===0&&p.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),p.focus({preventScroll:!0}),p.select(),N(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Ne=(0,u.useMemo)(()=>{let a=new Map;for(let[i,l]of(c?.hits??[]).entries()){if(l.about==="act")continue;let p=Mt(l),h=a.get(p)??[];h.push({id:`${W}-${i}`,hit:l}),a.set(p,h)}let r=[...a.values()].filter(i=>i.some(l=>l.hit.about==="node")).length>1;return[...a.entries()].map(([i,l])=>{let p=0,h=l.filter(pe=>pe.hit.about!=="node"||!r||++p<=Wt),C=h.filter(pe=>pe.hit.about==="node").length,J=i.endsWith(":")?l.length:c?.byKind[i]??C,Z=!i.endsWith(":")&&C>0&&J>C?{id:`${W}-all-${i}`,all:i,count:J}:null;return{key:i,rows:h,count:J,more:Z}})},[c,W]),ae=S&&M.trim()?{id:`${W}-ask`,ask:M.trim()}:null,$=(0,u.useMemo)(()=>[...Ne.flatMap(a=>a.more?[...a.rows,a.more]:a.rows),...ae?[ae]:[]],[Ne,ae?.ask]),fa=(c?.hits??[]).filter(a=>a.about==="node").length,be=c?.words??M,Ie=(0,u.useMemo)(()=>Ee(be).split(" ").filter(Boolean),[be]),F=(0,u.useCallback)(a=>a.hit.about==="node"?Va(o,a.hit.id,be,{principal:n,limit:Kt}).map((r,i)=>({id:`${a.id}-act-${i}`,act:r,of:a.id})):[],[o,be,n]),He=$.find(a=>a.id===K),q=$.find(a=>a.id===ht)??He??$[0],se=(0,u.useMemo)(()=>w&&ze(q)?F(q):[],[w,q?.id,F]),xe=(0,u.useMemo)(()=>w?new Map:new Map(Pe.flatMap(a=>{let r=ze($.find(i=>i.id===a));return r?[[a,F(r)]]:[]})),[w,Pe,$,F]),bt=(0,u.useMemo)(()=>w?new Set:new Set($.flatMap(a=>ze(a)&&F(a).length>0?[a.id]:[])),[w,$,F]),Oe=(0,u.useMemo)(()=>w?se:[...xe.values()].flat(),[w,se,xe]),L=He??Oe.find(a=>a.id===K)??$[0];(0,u.useEffect)(()=>{oe(null),fe(null),he([])},[M]);let de=(0,u.useRef)(null);(0,u.useEffect)(()=>{let a=de.current;if(!a)return;de.current=null;let r=0,i=()=>{let l=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),p=document.activeElement;if(!(!p||p===document.body||p===document.documentElement||p===R.current||p===z.current||p===l))return;let C=[...l?.querySelectorAll('[role="group"][aria-label="Arrange"] :is(button, input)')??[]].find(J=>J.checkVisibility?.()??!0);if(C)return C.focus({preventScroll:!0});l&&l.tabIndex>=0&&p!==l&&l.focus({preventScroll:!0}),++r<240?requestAnimationFrame(i):document.activeElement===z.current&&z.current?.blur()};requestAnimationFrame(i)},[d]);let Be=(a,r)=>{let i=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`);if(i&&i.tabIndex>=0)return i.focus({preventScroll:!0});let l=z.current;if(!l)return R.current?.blur();l.setAttribute("aria-label",r),l.focus({preventScroll:!0})},ha=(0,u.useRef)({x:Number.NaN,y:Number.NaN,moved:!1});(0,u.useEffect)(()=>{let a=r=>{let i=ha.current;i.moved=r.clientX!==i.x||r.clientY!==i.y,i.x=r.clientX,i.y=r.clientY};return window.addEventListener("mousemove",a,{capture:!0,passive:!0}),()=>window.removeEventListener("mousemove",a,{capture:!0})},[]);let le=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>clearTimeout(le.current),[]);let te=a=>{a&&(clearTimeout(le.current),oe(a.id),ne(a)||fe(a.id))},ba=a=>{if(!ha.current.moved)return;let r=a.target.closest?.('[role="option"]')?.id;if(!r||r===K)return;let i=$.find(l=>l.id===r)??Oe.find(l=>l.id===r);i&&(oe(i.id),!ne(i)&&(clearTimeout(le.current),le.current=setTimeout(()=>fe(i.id),Ft)))},xt=()=>{clearTimeout(le.current),q&&!ne(L)&&oe(q.id)},yt=a=>he(r=>r.includes(a.id)?r.filter(i=>i!==a.id):[...r,a.id]),xa=a=>{let r=P.current,i=r?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,l=r?.clientHeight??0;return Math.min(a,i>0&&l>0?Math.max(1,Math.floor(l/i)-1):Bt)};(0,u.useEffect)(()=>{K&&document.getElementById(K)?.scrollIntoView?.({block:"nearest"})},[K]);let De=a=>{if(!a)return;if("ask"in a){Ha(g,{pointed:{...y[0]!==void 0?{on:y[0]}:{},about:y},asked:a.ask}),s(i=>Ye(i)),N(!1);return}if("all"in a)return s(i=>ve(ee(i,!1),ge(a.all),{ownPicture:!0,...i.q?{carry:i.q}:{}})),de.current=a.all,N(!1),Be(a.all,`Opening ${G(o.schema,a.all)} matching \u201C${M.trim()}\u201D\u2026`);if(ne(a)){let i=a.act.subject;s(p=>$e(p,[i]));let l=R.current?.getBoundingClientRect();m({x:l?.left??0,y:(l?.bottom??0)+6,on:i}),N(!1),R.current?.blur();return}let r=a.hit;switch(r.about){case"node":s(i=>$e(Se(ee(i,!1),r.id),[r.id]));break;case"kind":return s(i=>ve(ee(i,!1),ge(r.kind),{ownPicture:!0})),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.label}\u2026`);case"place":return s(i=>Ra(i,r.kind,r.as)),de.current=r.kind,N(!1),Be(r.kind,`Opening ${r.title}\u2026`);case"rule":{let i=b.filter(l=>l.invariant===r.name).flatMap(l=>l.nodeIds);s(l=>$e(l,[...new Set(i)]));break}case"act":break}N(!1),R.current?.blur()},kt=c?Ot(c.byKind,c.hits,o.schema):"",ce=Le&&M.trim().length>0,St=(0,u.useCallback)(()=>{let a=R.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Vt};let r=R.current?.getBoundingClientRect();return r?{x:r.right,y:r.bottom}:null},[]),ya=Ia("find",{open:ce,onOpenChange:a=>{a||N(!1)},...e?{at:St}:{}}),ye=$.every(a=>"ask"in a),ka=a=>ne(a)?Oe.filter(r=>r.of===a.of):[],$t=a=>{let r=ne(L)&&K!==null,i=r?$.find(p=>p.id===L.of):K!==null?He:void 0,l=i?$.indexOf(i):-1;if(a.key==="ArrowDown"){if(a.preventDefault(),N(!0),r){let p=ka(L),h=p.indexOf(L)+1;if(h<p.length)return te(p[h]);if(w)return}te($[Math.min($.length-1,l+1)])}else if(a.key==="ArrowUp"){if(a.preventDefault(),r){let p=ka(L),h=p.indexOf(L)-1;return te(h>=0?p[h]:i)}te($[Math.max(0,l-1)])}else if((a.key==="PageDown"||a.key==="PageUp")&&$.length>0){a.preventDefault(),N(!0);let p=a.key==="PageDown"?xa($.length):-xa($.length);te($[Math.min($.length-1,Math.max(0,(l<0?-1:l)+p))])}else if(a.key==="ArrowRight"&&!r&&ze(L)){let p=L,h=w?p.id===q?.id?se:F(p):xe.get(p.id)??F(p);if(h.length===0)return;a.preventDefault(),!w&&!Pe.includes(p.id)&&he(C=>[...C,p.id]),fe(p.id),oe(h[0].id)}else if(a.key==="ArrowLeft"&&r){a.preventDefault();let p=L.of;w||he(h=>h.filter(C=>C!==p)),te($.find(h=>h.id===p))}else a.key==="Enter"?(a.preventDefault(),De(L)):a.key==="Escape"&&(a.preventDefault(),M?s(p=>Ye(p)):R.current?.blur())},We=(a,r,i={},l={})=>{let p=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":p,onClick:()=>De(a),style:{...er,...p?ar:null,...i},...l,children:r},a.id)},Sa=(a,r)=>{let i=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":i,"data-testid":"find-act","data-about":"act",onClick:()=>De(a),style:{...r?nr:pt,...i?or:null,...a.act.destructive?{color:"var(--graview-warn)"}:null},children:a.act.title},a.id)};return(0,t.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,t.jsx)("input",{ref:a=>{R.current=a,ya.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":ce,"aria-controls":W,"aria-autocomplete":"list",...ce&&L?{"aria-activedescendant":L.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:M,onChange:a=>{let r=a.target.value;N(!0),s(i=>ja(i,r.length>0?r:null))},onFocus:()=>N(!0),onBlur:()=>N(!1),onKeyDown:$t,style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${M?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,t.jsx)("span",{role:"status","aria-live":"polite",style:qe,"data-testid":"find-count",children:M.trim()?kt:""}),(0,t.jsx)("span",{ref:z,tabIndex:-1,role:"status",style:qe,"data-testid":"find-landing"}),(0,t.jsxs)("div",{...ya.pane,id:W,role:"listbox","aria-label":M?`What \u201C${M}\u201D finds`:"What the words find","data-testid":"find-strip","data-graview-find":w?"panel":"narrow",hidden:!ce,onMouseDown:a=>a.preventDefault(),style:{..._t,...e?Yt:w&&!ye?Ut:null,...ce?{display:"flex"}:null},children:[(0,t.jsxs)("div",{style:{...jt,gridTemplateColumns:w&&!ye?`minmax(0, 1fr) ${Gt}`:"minmax(0, 1fr)"},children:[(0,t.jsxs)("div",{ref:P,role:"presentation","data-testid":"find-list",onMouseMove:ba,style:Qt,children:[ye?(0,t.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",c?.words||M,"\u201D."]}):Ne.map(a=>(0,t.jsxs)("div",{role:"group","aria-label":st(a.key,o.schema),children:[(0,t.jsxs)("div",{role:"presentation",style:pa,children:[a.key!=="rule:"&&a.key!=="act:"?(0,t.jsx)(ct,{kind:a.key,accents:v?.accents}):null,(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:st(a.key,o.schema)}),(0,t.jsx)("span",{"aria-hidden":"true",style:Zt,"data-testid":"find-group-count",children:re(a.count)})]}),a.rows.map(r=>{let i=r.hit,l=i.about==="node"?i:null,p=!w&&l!==null&&bt.has(r.id),h=xe.get(r.id);return(0,t.jsxs)(u.Fragment,{children:[We(r,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Nt,{hit:i,flag:k,words:l?.near&&l.why.matched?[...Ie,Ee(l.why.matched)]:Ie}),p?(0,t.jsx)("span",{"aria-hidden":"true","data-testid":"find-acts-open","data-open":h?"":void 0,title:h?"Put its actions away":"Actions",onClick:C=>{C.stopPropagation(),yt(r)},style:{...dr,...h?lr:null},children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"3.5",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"12.5",cy:"8",r:"1.4",fill:"currentColor"})]})}):null]}),p?{paddingRight:48}:{},{"data-testid":"find-hit","data-about":i.about,...l?.near?{"data-near":""}:{},title:Ht(i)}),h?(0,t.jsx)("div",{role:"group","aria-label":`What can be done about ${l?.label??"it"}`,style:sr,children:h.map(C=>Sa(C,!0))}):null]},r.id)}),a.more?We(a.more,(0,t.jsxs)("span",{style:Q,children:["All ",re(a.more.count)," ",ke(o.schema,a.more.all).toLowerCase()," matching \u201C",M.trim(),"\u201D"]}),tr,{"data-testid":"find-all","data-about":"all"}):null]},a.key)),ae?We(ae,(0,t.jsxs)("span",{style:Q,children:["Tell Graview: ",(0,t.jsxs)("span",{style:{fontWeight:600},children:["\u2018",ae.ask,"\u2019"]})]}),{borderTop:"1px solid var(--graview-edge)",marginTop:4},{"data-testid":"find-ask"}):null,fa>Dt?(0,t.jsxs)("p",{role:"presentation",style:dt,"data-testid":"find-more-words",children:[re(fa)," found: another word of the name narrows them."]}):null,c&&c.searched.past===!1&&c.searched.kinds.some(a=>o.schema.tryDefinition(a)?.lifecycle)?(0,t.jsx)("p",{role:"presentation",style:dt,children:"Current ones; add is:any for the past."}):null]}),w&&!ye&&q?(0,t.jsxs)("div",{role:"group","aria-label":"The one lit","data-testid":"find-panel",onMouseEnter:xt,onMouseMove:ba,style:Xt,children:[(0,t.jsx)(Pt,{row:q,schema:o.schema,accents:v?.accents,marking:Ie,q:M.trim(),flag:k}),se.length>0?(0,t.jsxs)("div",{role:"group","aria-label":"Actions",style:{display:"grid",gap:4},children:[(0,t.jsx)("div",{role:"presentation",style:{...pa,padding:"10px 0 4px"},children:"Actions"}),se.map(a=>Sa(a,!1))]}):null]}):null]}),e?null:(0,t.jsxs)("div",{"aria-hidden":"true",style:cr,"data-testid":"find-keys",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2191"}),(0,t.jsx)("kbd",{style:me,children:"\u2193"})," move"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u21B5"})," open"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"\u2192"})," actions"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:me,children:"esc"})," close"]})]})]})]})}function Pt({row:e,schema:o,accents:d,marking:s,q:n,flag:m}){let v=null,g="",y,S=null;if("ask"in e)g="Tell Graview",y=`\u2018${e.ask}\u2019`,S=(0,t.jsx)("p",{style:Y,children:"Says it to Graview about what is selected; the answer comes on a card beside it."});else if("all"in e)v=e.all,g=G(o,e.all),y=`All ${re(e.count)} matching \u201C${n}\u201D`,S=(0,t.jsxs)("p",{style:Y,children:["Opens the ",ke(o,e.all).toLowerCase(),", narrowed by these words."]});else{let c=e.hit;switch(c.about){case"node":{v=c.kind,g=ot(Ca(o.tryDefinition(c.kind),c.kind)),y=(0,t.jsxs)(t.Fragment,{children:[c.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[m," "]}):null,(0,t.jsx)(j,{text:c.label,words:s})]});let b=[c.apart,c.current?null:"past",c.archived?"set aside":null].filter(Boolean).join(" \xB7 ");S=(0,t.jsxs)(t.Fragment,{children:[b?(0,t.jsx)("p",{style:Y,children:ot(b)}):null,c.near?(0,t.jsxs)("p",{style:Y,children:["Near \u201C",c.why.asked,"\u201D",c.why.field!=="label"?` \u2014 ${c.why.reading.toLowerCase()}: ${c.why.fragment}`:""]}):c.why.field!=="label"?(0,t.jsxs)("p",{style:Y,children:[(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:c.why.reading}),(0,t.jsx)("br",{}),(0,t.jsx)(j,{text:c.why.fragment,words:s})]}):null]});break}case"kind":v=c.kind,g="Kind",y=c.label,S=(0,t.jsxs)("p",{style:Y,children:["Goes into the ",c.label.toLowerCase(),", all of them",c.count>0?`; ${re(c.count)} match these words`:"","."]});break;case"place":v=c.kind,g="Place",y=c.title,S=(0,t.jsxs)("p",{style:Y,children:["A picture of the ",ke(o,c.kind).toLowerCase(),"."]});break;case"rule":g="Rule",y=c.label,S=(0,t.jsx)("p",{style:Y,children:"Selects what it flags."});break;case"act":g="Act",y=c.title;break}}return(0,t.jsxs)("div",{role:"presentation","data-testid":"find-said",style:{display:"grid",gap:6},children:[(0,t.jsxs)("div",{style:{...pa,padding:0},children:[v?(0,t.jsx)(ct,{kind:v,accents:d}):null,g]}),(0,t.jsx)("div",{style:Jt,children:y}),S]})}function Nt({hit:e,flag:o,words:d}){switch(e.about){case"node":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:rr,children:[e.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[o," "]}):null,(0,t.jsx)(j,{text:e.label,words:d}),e.apart?(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,t.jsx)("span",{style:we,children:" \xB7 past"})]}),e.near?(0,t.jsxs)("span",{style:{...Q,...we},"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: `:"",e.why.field!=="label"?(0,t.jsx)(j,{text:e.why.fragment,words:d}):null]}):e.why.field!=="label"?(0,t.jsxs)("span",{style:{...Q,...we},children:[e.why.reading.toLowerCase(),": ",(0,t.jsx)(j,{text:e.why.fragment,words:d})]}):null]});case"kind":return(0,t.jsxs)("span",{style:Q,children:[(0,t.jsx)(j,{text:e.label,words:d}),(0,t.jsxs)("span",{style:we,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,t.jsxs)("span",{style:Q,children:["Go to ",(0,t.jsx)(j,{text:e.title,words:d})]});case"rule":return(0,t.jsxs)("span",{style:Q,children:["The rule \u201C",(0,t.jsx)(j,{text:e.label,words:d}),"\u201D"]});case"act":return(0,t.jsx)("span",{style:Q,children:e.title})}}function It(e,o){if(o.length===0)return[{text:e}];let d=[],s=0;for(let n of e.matchAll(/[\p{L}\p{N}]+/gu)){let m=n[0],v=Ee(m).replace(/ /g,""),g=o.filter(c=>v.startsWith(c)).sort((c,b)=>b.length-c.length)[0];if(!g)continue;let y=v.length===m.length?g.length:m.length,S=n.index??0;S>s&&d.push({text:e.slice(s,S)}),d.push({text:m.slice(0,y),marked:!0}),s=S+y}return s<e.length&&d.push({text:e.slice(s)}),d}function j({text:e,words:o}){return(0,t.jsx)(t.Fragment,{children:It(e,o).map((d,s)=>d.marked?(0,t.jsx)("mark",{style:ir,children:d.text},s):(0,t.jsx)(u.Fragment,{children:d.text},s))})}function Ht(e){if(e.about!=="node")return"";let o=e.near?`Near \u201C${e.why.asked}\u201D`:e.why.field!=="label"?`${e.why.reading}: ${e.why.fragment}`:"";return o?`${e.label}
|
|
1140
|
+
${o}`:e.label}var ot=e=>e&&e[0].toUpperCase()+e.slice(1);function ct({kind:e,accents:o}){let d=Math.round(Aa(e,o));return(0,t.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${d} 55% 52%)`}})}function st(e,o){return e==="rule:"?"Rules":e==="act:"?"Acts":G(o,e)}function Ot(e,o,d){let s=Object.entries(e).map(([v,g])=>$a(d,v,g)),n=o.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;n>0&&s.push(`${n} ${n===1?"place or rule":"places and rules"}`);let m=o.filter(v=>v.about==="node"&&v.near).length;return s.length===0?"Nothing found":`${s.join(", ")} found${m>0?`, ${m} of them near`:""}`}var Bt=10,Dt=12,Wt=5,Kt=6,Ft=140,qt=760,Gt="15.5rem",_t={...Na,flexDirection:"column",width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(64vh, 30rem)",overflow:"hidden",boxSizing:"border-box",background:"linear-gradient(var(--graview-panel), var(--graview-panel)) var(--graview-ground, var(--graview-panel))",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:0},Ut={width:"min(42rem, calc(100vw - 24px))"},Vt=6,Yt={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},jt={display:"grid",gridTemplateRows:"minmax(0, 1fr)",flex:"1 1 auto",minHeight:0},Qt={overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"4px 0",overscrollBehavior:"contain"},Xt={overflowY:"auto",minHeight:0,padding:"12px 14px",borderLeft:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",display:"flex",flexDirection:"column",gap:4},Jt={fontWeight:600,fontSize:"0.9375rem",lineHeight:1.35,color:"var(--graview-ink)",overflowWrap:"anywhere"},Y={margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},pa={display:"flex",alignItems:"center",gap:6,padding:"10px 12px 4px",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Zt={marginLeft:"auto",fontWeight:400,letterSpacing:0,fontVariantNumeric:"tabular-nums",color:"var(--graview-ink-faint)"},er={position:"relative",display:"grid",gap:1,minHeight:34,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)",minWidth:0},ar={background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))",boxShadow:"inset 3px 0 0 var(--graview-accent)"},tr={color:"var(--graview-accent)",fontSize:"0.8125rem",minHeight:30},Q={display:"block",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},rr={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,minWidth:0,overflow:"hidden",overflowWrap:"anywhere",fontWeight:600},we={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400},ir={background:"color-mix(in srgb, var(--graview-accent) 24%, transparent)",color:"inherit",borderRadius:2,padding:0,boxShadow:"0 1px 0 color-mix(in srgb, var(--graview-accent) 70%, transparent)"},pt={display:"flex",alignItems:"center",minHeight:32,padding:"4px 10px",boxSizing:"border-box",borderWidth:1,borderStyle:"solid",borderColor:"var(--graview-edge)",borderRadius:6,background:"var(--graview-panel)",color:"var(--graview-ink)",fontSize:"0.8125rem",lineHeight:1.3,cursor:"pointer",overflowWrap:"anywhere"},nr={...pt,minHeight:32,margin:"0 12px 4px 24px"},or={borderColor:"var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))"},sr={display:"grid",padding:"2px 0 6px"},dr={position:"absolute",top:"50%",right:6,transform:"translateY(-50%)",width:36,height:32,display:"grid",placeItems:"center",borderRadius:6,color:"var(--graview-ink-muted)",borderWidth:1,borderStyle:"solid",borderColor:"transparent"},lr={color:"var(--graview-accent)",borderColor:"var(--graview-edge)",background:"var(--graview-panel)"},dt={margin:0,padding:"6px 12px 4px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},cr={display:"flex",flexWrap:"wrap",gap:"4px 14px",padding:"7px 12px",borderTop:"1px solid var(--graview-edge)",color:"var(--graview-ink-faint)",fontSize:"0.75rem",flex:"0 0 auto"},me={display:"inline-block",minWidth:16,padding:"0 4px",marginRight:3,border:"1px solid var(--graview-edge)",borderRadius:4,font:"inherit",fontSize:"0.6875rem",lineHeight:"16px",textAlign:"center",color:"var(--graview-ink-muted)",background:"var(--graview-panel)"};var Me=f(_(),1),ga=f(Ct(),1);var vt=f(A(),1);function gt(){let{following:e,follow:o}=T();return e?(0,vt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>o(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var ut=f(_(),1);var E=f(A(),1);function wt({home:e,homeLabel:o,children:d,onPicture:s=!1}){let{view:n,focus:m,show:v,go:g}=U(),{store:y}=T(),{movedByHand:S}=T(),c=S&&(n.pan!==void 0||Object.keys(n.pins).length>0),b=n.focusId&&n.focusId!==e?y.graph.getNode(n.focusId):void 0,k=z=>G(y.schema,z),w={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},R=o!==void 0&&b!==void 0,P=[];if(b&&!s&&P.push({key:"focused",node:(0,E.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>g(Fe({...n,focusId:e},!1)),title:Ge(y,b.id),style:{...w,maxWidth:"min(14rem, 15vw)"},children:[(0,E.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Ge(y,b.id)}),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.past&&P.push({key:"past",node:(0,E.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>g(Qa(n,!1)),title:"Back to now \u2014 retired things leave the picture again",style:w,children:["the past",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.zoom&&P.push({key:"zoomed",node:(0,E.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>g(Fe(n,!1)),title:"Zoom back out",style:w,children:["zoomed in",(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),c&&P.push({key:"moved",node:(0,E.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>g(Ke(n)),title:"Put the camera and everything you dragged back where the layout wanted them",style:w,children:"Reset view"})}),n.relation){let z=n.relation;P.push({key:"raised",node:(0,E.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,E.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>g(ve(n,ge(z),{ownPicture:!0})),title:`Go into the ${k(z).toLowerCase()}`,"aria-label":`Go into the ${k(z).toLowerCase()}`,style:{...w,color:"var(--graview-ink)"},children:[k(z),(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,E.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>v(null),title:`Stop showing ${k(z).toLowerCase()}`,"aria-label":`Stop showing ${k(z).toLowerCase()}`,style:{...w,minWidth:26,justifyContent:"center"},children:(0,E.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return s&&!R&&P.length===0&&d===void 0?null:(0,E.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[R?(0,E.jsx)("button",{type:"button",onClick:()=>m(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:o}):null,P.map(({key:z,node:W},Le)=>(0,E.jsxs)(ut.Fragment,{children:[R||Le>0?(0,E.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,W]},z)),d]})}var O=f(A(),1);function va(){let[e,o]=(0,Me.useState)([]),d=(0,Me.useCallback)(s=>{o(n=>{let m=s.phase!=="running"&&n[0]?.name===s.name&&n[0]?.at===s.at;return[s,...m?n.slice(1):n].slice(0,12)})},[]);return[e,d]}function ua({find:e,calls:o,seat:d,remembers:s=!1}){return e?(0,O.jsxs)(O.Fragment,{children:[(0,ga.createPortal)((0,O.jsx)(lt,{compact:e.compact}),e.slot),e.own?(0,ga.createPortal)((0,O.jsx)(Ka,{calls:o,remembers:s,...d!==void 0?{seat:d}:{}}),e.own):null]}):null}function wa({home:e=null}){return(0,O.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:B("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,O.jsx)(wt,{home:e,onPicture:!0}),(0,O.jsx)("span",{style:{pointerEvents:"auto"},children:(0,O.jsx)(gt,{})})]})}var X=f(_(),1);var mt=f(A(),1),pr=ie(()=>(__graviewPreload(import.meta.url,["./chunk.Q355UPFG.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.XFLGSUYO.js")));function ma(){let{store:e,principal:o}=T(),d=(0,X.useContext)(Fa),s=(0,X.useRef)(null),n=(0,X.useRef)(!1);return(0,X.useEffect)(()=>()=>void(n.current=!0),[]),(0,X.useEffect)(()=>{let m=e.batches().length,v=pr().then(g=>g.sceneWay(e,o,d,m,s.current),()=>{});return()=>void v.then(g=>g?.(n.current))},[e,o,d]),(0,mt.jsx)("span",{ref:s,hidden:!0})}var ft=f(_(),1);var x=f(A(),1);function _i({address:e=!1,auto:o,quickAsk:d=!0,scheme:s,scope:n}){let m=(0,ft.useMemo)(()=>`${ia({scope:`.${n}`})}
|
|
1141
1141
|
${na(s,{scope:`.${n}`})}`,[s,n]),v=qa(),[g]=va();return(0,x.jsx)(La.Provider,{value:!0,children:(0,x.jsxs)("div",{"data-embed-content":"",style:{position:"relative",flex:o?`0 0 ${tt}px`:"1 1 auto",minHeight:0,containerType:"size"},children:[(0,x.jsx)("style",{children:m}),e?(0,x.jsx)(at,{}):null,(0,x.jsx)(et,{}),(0,x.jsx)(wa,{}),(0,x.jsx)(da,{}),(0,x.jsx)(oa,{}),(0,x.jsxs)(Ja,{children:[(0,x.jsx)(Xe,{}),(0,x.jsx)(Je,{face:"scene",on:d}),(0,x.jsx)(sa,{}),(0,x.jsx)(Ue,{children:(0,x.jsx)(je,{children:(0,x.jsx)(Ze,{children:(0,x.jsx)(aa,{children:(0,x.jsx)(ta,{children:(0,x.jsx)(Qe,{placement:"menu"})})})})})}),(0,x.jsx)(Ve,{}),(0,x.jsx)(ra,{}),(0,x.jsx)(ea,{}),(0,x.jsx)(ua,{find:v,calls:g}),(0,x.jsx)(ma,{}),(0,x.jsx)(_e,{face:"scene"})]})]})})}function Ui(){return(0,x.jsx)(ca,{})}export{_i as SceneFace,Ui as SceneKeeping};
|