graview 0.1.47 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/preview/{chunk.S5IQFZ5Z.js → chunk.2CO2EJQA.js} +1 -1
- package/dist/preview/{chunk.VAFSSSSI.js → chunk.2N6RQ427.js} +1 -1
- package/dist/preview/{chunk.C44MC5X3.js → chunk.2OLZ6BYI.js} +1 -1
- package/dist/preview/{chunk.GCKZ2YRJ.js → chunk.2OXXGN7C.js} +2 -2
- package/dist/preview/{chunk.Z6TMIAAB.js → chunk.2QKSWK4U.js} +1 -1
- package/dist/preview/chunk.35FUGOSG.js +1 -0
- package/dist/preview/{chunk.IKX4VDTW.js → chunk.3EW6L5DY.js} +1 -1
- package/dist/preview/chunk.3NEALGMI.js +1 -0
- package/dist/preview/{chunk.O4WEJ47H.js → chunk.423SZS7C.js} +3 -3
- package/dist/preview/{chunk.MBETS27C.js → chunk.4D26JY5U.js} +1 -1
- package/dist/preview/{chunk.5A4AOFOA.js → chunk.4HUB3N7I.js} +1 -1
- package/dist/preview/chunk.4K7I7WYF.js +1 -0
- package/dist/preview/{chunk.RUPRZDN3.js → chunk.4OTESF7W.js} +1 -1
- package/dist/preview/{chunk.TJEV5ZAM.js → chunk.4Q5KWYVY.js} +18 -18
- package/dist/preview/{chunk.VXVWUIGO.js → chunk.4QINLTDZ.js} +1 -1
- package/dist/preview/{chunk.EUPSAYEI.js → chunk.4SEY7VWZ.js} +1 -1
- package/dist/preview/chunk.4XKACWLT.js +1 -0
- package/dist/preview/chunk.52QB4YW2.js +1 -0
- package/dist/preview/{chunk.6YD2DLIC.js → chunk.54PZWX23.js} +1 -1
- package/dist/preview/chunk.5YFO6D7J.js +1 -0
- package/dist/preview/chunk.6EGHJCEM.js +1 -0
- package/dist/preview/{chunk.O2WWYZI7.js → chunk.6EHE26ZS.js} +1 -1
- package/dist/preview/{chunk.RG6WNOBW.js → chunk.6RLFO5GA.js} +1 -1
- package/dist/preview/chunk.6WRA3Y7D.js +1 -0
- package/dist/preview/{chunk.IQ2HKGJS.js → chunk.7C4IR4S7.js} +1 -1
- package/dist/preview/{chunk.4YXJPKXD.js → chunk.7JLYEZW4.js} +1 -1
- package/dist/preview/{chunk.VSNHCGKC.js → chunk.7JW5SHRR.js} +1 -1
- package/dist/preview/{chunk.76GF5US2.js → chunk.7MJGZHTS.js} +1 -1
- package/dist/preview/{chunk.F67F6QZ6.js → chunk.7MWLDDFL.js} +1 -1
- package/dist/preview/{chunk.QZEZHCOI.js → chunk.7SGQ3HFG.js} +1 -1
- package/dist/preview/chunk.A7HMVWMG.js +1 -0
- package/dist/preview/{chunk.PKUDIWIF.js → chunk.AGVFW6WC.js} +1 -1
- package/dist/preview/{chunk.FOQ27RAR.js → chunk.AOEXSQDG.js} +1 -1
- package/dist/preview/{chunk.IROYMLER.js → chunk.AP22NNIM.js} +1 -1
- package/dist/preview/{chunk.RNEJYIQ7.js → chunk.AVDXG57A.js} +1 -1
- package/dist/preview/{chunk.N7JT6MG2.js → chunk.B2BLZDBD.js} +1 -1
- package/dist/preview/chunk.B445DZOY.js +1 -0
- package/dist/preview/chunk.BH365UJ5.js +1 -0
- package/dist/preview/{chunk.IPAZOKMQ.js → chunk.BJR6E2CT.js} +1 -1
- package/dist/preview/{chunk.KSM6NVAT.js → chunk.BNU3KXKL.js} +1 -1
- package/dist/preview/chunk.BTORFVKO.js +1 -0
- package/dist/preview/{chunk.OONCUAOH.js → chunk.BU6V76EF.js} +1 -1
- package/dist/preview/{chunk.F2VMMCVK.js → chunk.BVXOLZQ3.js} +1 -1
- package/dist/preview/{chunk.CTQULC5F.js → chunk.C75I24Z5.js} +1 -1
- package/dist/preview/{chunk.WHEUTAXA.js → chunk.CXIIRL67.js} +1 -1
- package/dist/preview/{chunk.4YS7547F.js → chunk.D25QV6DK.js} +1 -1
- package/dist/preview/chunk.D4IKO5YA.js +18 -0
- package/dist/preview/{chunk.Q7RQC3F7.js → chunk.D4K23FUB.js} +1 -1
- package/dist/preview/{chunk.R6V37SR7.js → chunk.D53IGR45.js} +1 -1
- package/dist/preview/chunk.D66RI4QS.js +1 -0
- package/dist/preview/{chunk.BNPQUI3F.js → chunk.DFGXNFFE.js} +1 -1
- package/dist/preview/{chunk.RVJXO5GG.js → chunk.DSNHE4MZ.js} +1 -1
- package/dist/preview/{chunk.UHX4WTM7.js → chunk.DTRNDSMS.js} +1 -1
- package/dist/preview/{chunk.QGG6ZRJ5.js → chunk.DV4GSLGX.js} +2 -2
- package/dist/preview/{chunk.H7KCWCB4.js → chunk.EJAVIZ7Y.js} +1 -1
- package/dist/preview/{chunk.MF73YBJL.js → chunk.EM5CGFNB.js} +1 -1
- package/dist/preview/chunk.EPTUOPPC.js +1 -0
- package/dist/preview/{chunk.L4YNDNX7.js → chunk.ERWBI2NK.js} +1 -1
- package/dist/preview/chunk.EYSQPXVE.js +2 -0
- package/dist/preview/{chunk.47RTA6M3.js → chunk.FIS27KW4.js} +1 -1
- package/dist/preview/chunk.FNK2ZZ5E.js +1 -0
- package/dist/preview/{chunk.5AGW4NRZ.js → chunk.FOYVTN5B.js} +1 -1
- package/dist/preview/{chunk.7ELB37JU.js → chunk.FUMQLGNM.js} +1 -1
- package/dist/preview/chunk.G25JEYCC.js +1 -0
- package/dist/preview/{chunk.IXOQQBJE.js → chunk.G3Q5CYEM.js} +1 -1
- package/dist/preview/chunk.GEY4MA4D.js +6 -0
- package/dist/preview/chunk.GRLPNTUW.js +2 -0
- package/dist/preview/{chunk.2MCZ4CU5.js → chunk.H42WBU5C.js} +1 -1
- package/dist/preview/{chunk.WJS6P7GI.js → chunk.IQHVVQEA.js} +1 -1
- package/dist/preview/{chunk.TCXKPILZ.js → chunk.IVHPJUFM.js} +1 -1
- package/dist/preview/{chunk.FOJDVK2Q.js → chunk.IWEPDTVG.js} +1 -1
- package/dist/preview/{chunk.P4KCZRIG.js → chunk.IYLOA3MV.js} +1 -1
- package/dist/preview/chunk.JBG5UQLM.js +1 -0
- package/dist/preview/{chunk.NFIGGSMJ.js → chunk.KDTNKKOY.js} +1 -1
- package/dist/preview/chunk.KJBXNMIU.js +21 -0
- package/dist/preview/chunk.KLAEKRCA.js +1 -0
- package/dist/preview/{chunk.Z4UM4CMT.js → chunk.KQSD5MLY.js} +1 -1
- package/dist/preview/{chunk.ETR6AV47.js → chunk.KVEDMKUN.js} +1 -1
- package/dist/preview/{chunk.TBQOSI4J.js → chunk.LD6S2FL5.js} +1 -1
- package/dist/preview/{chunk.63JLXGYX.js → chunk.LUL6PFIQ.js} +1 -1
- package/dist/preview/chunk.MCFLCC42.js +12 -0
- package/dist/preview/{chunk.SWWAEOZ7.js → chunk.MJ4XTNTL.js} +1 -1
- package/dist/preview/{chunk.RZF3QM4E.js → chunk.MU5WUTVF.js} +1 -1
- package/dist/preview/{chunk.ZCYGUP3I.js → chunk.MUHFZXPS.js} +1 -1
- package/dist/preview/{chunk.AGIO2GRV.js → chunk.N2S3TMBC.js} +1 -1
- package/dist/preview/{chunk.63MS2LOP.js → chunk.N2S45SSL.js} +1 -1
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.NB6WN4DO.js} +1 -1
- package/dist/preview/{chunk.5M4TMZXC.js → chunk.NBJ4C33P.js} +1 -1
- package/dist/preview/{chunk.WBHM5I3I.js → chunk.NQ7SRWXA.js} +1 -1
- package/dist/preview/chunk.NQDGUIUQ.js +1 -0
- package/dist/preview/{chunk.KRGM25HF.js → chunk.NUUT37ER.js} +1 -1
- package/dist/preview/{chunk.SZR3Z43B.js → chunk.O3ONLQUF.js} +1 -1
- package/dist/preview/chunk.OFBESPHJ.js +1 -0
- package/dist/preview/chunk.OKHEZJBX.js +1 -0
- package/dist/preview/{chunk.2W22AWSL.js → chunk.OL5D7YTW.js} +1 -1
- package/dist/preview/{chunk.SD6N4DGF.js → chunk.ON35FJ5H.js} +1 -1
- package/dist/preview/{chunk.3LDYUO77.js → chunk.OS75HEZP.js} +1 -1
- package/dist/preview/{chunk.DQS7D2W2.js → chunk.OTF3NNTI.js} +1 -1
- package/dist/preview/chunk.P2AC6JRL.js +88 -0
- package/dist/preview/chunk.PBCT33FF.js +1 -0
- package/dist/preview/{chunk.NEEOVRB7.js → chunk.PCVU3LY3.js} +1 -1
- package/dist/preview/chunk.PFEKS3KO.js +5 -0
- package/dist/preview/chunk.PFR3FQBR.js +1 -0
- package/dist/preview/{chunk.VC3UGFHY.js → chunk.Q4KNNJFL.js} +1 -1
- package/dist/preview/chunk.QBHVBL42.js +1 -0
- package/dist/preview/chunk.QPNFWP4Z.js +1 -0
- package/dist/preview/{chunk.24OZGU7J.js → chunk.QQE7N7LB.js} +1 -1
- package/dist/preview/{chunk.DNROW6LX.js → chunk.QQRLUBWQ.js} +1 -1
- package/dist/preview/{chunk.ETPKXUAN.js → chunk.QWX2N2VD.js} +2 -2
- package/dist/preview/chunk.R5IRHCLZ.js +1 -0
- package/dist/preview/{chunk.UV3YU64Z.js → chunk.REANMQ6K.js} +1 -1
- package/dist/preview/{chunk.5TM5VA2H.js → chunk.RI624PFK.js} +1 -1
- package/dist/preview/chunk.RMWLV3PR.js +20 -0
- package/dist/preview/{chunk.7N2GXZYI.js → chunk.RSR2M7ZO.js} +2 -2
- package/dist/preview/chunk.SGJSJGSR.js +1 -0
- package/dist/preview/chunk.SIVMZNHZ.js +1 -0
- package/dist/preview/{chunk.FWSCBHZ5.js → chunk.SPZVEQC5.js} +1 -1
- package/dist/preview/chunk.SR2345SW.js +1 -0
- package/dist/preview/chunk.ST4JHXPS.js +1 -0
- package/dist/preview/chunk.TABIRLQS.js +2 -0
- package/dist/preview/{chunk.52VGZBO3.js → chunk.TBA4GF34.js} +1 -1
- package/dist/preview/{chunk.6TIEX67B.js → chunk.THENABJU.js} +1 -1
- package/dist/preview/{chunk.Y4ZUJUUT.js → chunk.TM6JVVGW.js} +1 -1
- package/dist/preview/{chunk.57ZSMK3R.js → chunk.TSHBXCMU.js} +1 -1
- package/dist/preview/{chunk.PYE3WZM7.js → chunk.UL43GFVC.js} +1 -1
- package/dist/preview/{chunk.RBJAPOZ3.js → chunk.UTRIPGW6.js} +1 -1
- package/dist/preview/{chunk.V7XHNRQM.js → chunk.VSWEKNKS.js} +2 -2
- package/dist/preview/chunk.VV3PNZPI.js +1 -0
- package/dist/preview/chunk.W6CGAPNQ.js +1 -0
- package/dist/preview/{chunk.IJNOT4S4.js → chunk.WQN7EFW3.js} +2 -2
- package/dist/preview/{chunk.PC6PID5X.js → chunk.X4MTZKL3.js} +1 -1
- package/dist/preview/{chunk.C3NHNYA6.js → chunk.XJ7YGW6Y.js} +1 -1
- package/dist/preview/{chunk.MCB26YCQ.js → chunk.XMOIMPUC.js} +1 -1
- package/dist/preview/{chunk.6RY6OSE6.js → chunk.XN7PIWVC.js} +1 -1
- package/dist/preview/chunk.XOZU4OFA.js +1 -0
- package/dist/preview/{chunk.T42S2WMB.js → chunk.XXZFWZ4C.js} +1 -1
- package/dist/preview/{chunk.ZQY6ODXC.js → chunk.YECMUK4X.js} +1 -1
- package/dist/preview/chunk.YSFNPYCD.js +2 -0
- package/dist/preview/{chunk.ZWVN75EY.js → chunk.YXOJKGRC.js} +1 -1
- package/dist/preview/{chunk.CMOXKRWT.js → chunk.ZBL47SFK.js} +1 -1
- package/dist/preview/{chunk.EYI3Y2DY.js → chunk.ZILULTJJ.js} +1 -1
- package/dist/preview/index.html +50 -49
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2CLANQHZ.js +0 -1
- package/dist/preview/chunk.2L3VFGHX.js +0 -1
- package/dist/preview/chunk.4OGOTHRD.js +0 -1
- package/dist/preview/chunk.5G53VDOC.js +0 -1
- package/dist/preview/chunk.64WM4IBI.js +0 -1
- package/dist/preview/chunk.6QVXXQCW.js +0 -2
- package/dist/preview/chunk.7NNI7YH4.js +0 -1
- package/dist/preview/chunk.A3RNSSUQ.js +0 -1
- package/dist/preview/chunk.A7RKTSOH.js +0 -20
- package/dist/preview/chunk.AS4CQBOQ.js +0 -5
- package/dist/preview/chunk.AWXDZUKH.js +0 -1
- package/dist/preview/chunk.AYA7SYIU.js +0 -1
- package/dist/preview/chunk.BBS5C2BY.js +0 -1
- package/dist/preview/chunk.COYLGLTI.js +0 -1
- package/dist/preview/chunk.DX357TZ3.js +0 -2
- package/dist/preview/chunk.GQHAAKJG.js +0 -1
- package/dist/preview/chunk.HDRD33II.js +0 -1
- package/dist/preview/chunk.I6JLOEJU.js +0 -1
- package/dist/preview/chunk.ISNEX772.js +0 -1
- package/dist/preview/chunk.IW7YFPGG.js +0 -1
- package/dist/preview/chunk.IYIN6VSN.js +0 -1
- package/dist/preview/chunk.JUWWRRHA.js +0 -1
- package/dist/preview/chunk.K2NCGPCL.js +0 -1
- package/dist/preview/chunk.KWQ7QOHD.js +0 -2
- package/dist/preview/chunk.MCCUVGTE.js +0 -1
- package/dist/preview/chunk.NDWW5EER.js +0 -1
- package/dist/preview/chunk.OCTOGZVJ.js +0 -3
- package/dist/preview/chunk.OJGUIWDD.js +0 -88
- package/dist/preview/chunk.PBKO5CKD.js +0 -1
- package/dist/preview/chunk.QGVLJTZS.js +0 -1
- package/dist/preview/chunk.RX2M4C5W.js +0 -2
- package/dist/preview/chunk.SGKK4UKP.js +0 -1
- package/dist/preview/chunk.T7RJCEJB.js +0 -18
- package/dist/preview/chunk.UKAPFIPJ.js +0 -1
- package/dist/preview/chunk.VW2VCPJX.js +0 -1
- package/dist/preview/chunk.W6COSBO2.js +0 -21
- package/dist/preview/chunk.WAB7UDHU.js +0 -1
- package/dist/preview/chunk.X5G7FOPY.js +0 -12
- package/dist/preview/chunk.XYEFZ2OO.js +0 -1
- package/dist/preview/chunk.YHH4TWZ2.js +0 -1
- package/dist/preview/chunk.YVONXFKE.js +0 -6
- package/dist/preview/chunk.ZIEHF67C.js +0 -1
- package/dist/preview/chunk.ZL7ZBJUU.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as b,R as d}from"./chunk.
|
|
1
|
+
import{G as b,R as d}from"./chunk.TM6JVVGW.js";import{xd as f}from"./chunk.PFEKS3KO.js";import{b as i}from"./chunk.AJZBJBMO.js";var a=i(b(),1);var t=i(d(),1),w={textDecorationLine:"underline",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em"};function g({children:e,mark:r="\u2192"}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{style:w,children:e}),(0,t.jsx)("span",{"aria-hidden":"true",children:r})]})}var n=i(d(),1);function P({context:e,stop:r,title:o,label:s,style:p,className:l,children:m,...y}){let c=f(e.views?.arrangement?.()),S=m??(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(g,{mark:"\u2197",children:["In ",c==="Scene"?"the scene":c.replace(/^The /,"the ")]})}),u=s?{"aria-label":s}:{};if(e.overview){let h=e.overview;return(0,n.jsx)("a",{href:r,...y,...u,...o?{title:o}:{},style:p,...l?{className:l}:{},onClick:v=>{v.preventDefault(),h(r)},children:S})}return e.embedded?null:(0,n.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...y,...u,...o?{title:o}:{},style:p,...l?{className:l}:{},children:S})}function k(){return(0,n.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function A(e){let r=(0,a.useRef)(0),o=(0,a.useCallback)(s=>e.subscribe(()=>{r.current+=1,s()}),[e]);return(0,a.useSyncExternalStore)(o,()=>r.current,()=>0)}function L(e){return e===void 0?{}:e==="sm"||e==="md"?{"data-size":e}:{style:{"--graview-control-height":typeof e=="number"?`${e}px`:e}}}var D=(e,r)=>r?`${e} ${r}`:e;export{g as a,P as b,k as c,A as d,L as e,D as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as he,b as xe,c as be,d as ie,e as I}from"./chunk.TKUNRFDE.js";import{c as A,e as re}from"./chunk.
|
|
1
|
+
import{a as he,b as xe,c as be,d as ie,e as I}from"./chunk.TKUNRFDE.js";import{c as A,e as re}from"./chunk.XN7PIWVC.js";import{a as te}from"./chunk.OTF3NNTI.js";import{G as U,R as Z,_ as ee,aa as ne}from"./chunk.TM6JVVGW.js";import"./chunk.SDO3U72B.js";import{Fc as Q,U as j,da as J}from"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import{b as C}from"./chunk.AJZBJBMO.js";var w=C(U(),1);var P=C(U(),1),ke=(e,n)=>`graview:last-visit:${n??"anyone"}:${e.join(",")}`;function Pe(e,n,r){let t=new Set;for(let i of e)if(!(i.author.id!==void 0&&i.author.id===r)&&Date.parse(i.at)>n)for(let o of i.writes)t.add(o);return t}function oe(e,n,r){let t=ke(n,r?.id),[i]=(0,P.useState)(()=>{try{let o=globalThis.localStorage?.getItem(t);return o?Number(o):null}catch{return null}});return(0,P.useEffect)(()=>{let o=()=>{if(document.visibilityState==="hidden")try{globalThis.localStorage?.setItem(t,String(Date.now()))}catch{}};return document.addEventListener("visibilitychange",o),window.addEventListener("pagehide",o),()=>{document.removeEventListener("visibilitychange",o),window.removeEventListener("pagehide",o)}},[t]),(0,P.useMemo)(()=>i===null?new Set:Pe(e,i,r?.id),[e,i,r?.id])}function ae(e,n,r){let t=new Set;if(r===void 0)return t;t.add(r);for(let i of[...e.out(r),...e.in(r)])t.add(i.id);for(let i of n)if(i.author.id===r)for(let o of i.primitives)o.op==="add-node"&&t.add(o.node.id);return t}var g=C(Z(),1);function Se(e,n,r={x:0,y:0}){let t=(i,o)=>{let c=A(i,o,n.cell,n.tilt);return{x:n.originX+r.x+c.x,y:n.originY+r.y+c.y}};return[t(e.col,e.row),t(e.col+e.side,e.row),t(e.col+e.side,e.row+e.side),t(e.col,e.row+e.side)]}var B=e=>e.map(n=>`${n.x.toFixed(1)},${n.y.toFixed(1)}`).join(" ");function Ie({frame:e,width:n,height:r,pan:t,pinned:i,close:o,today:c,swallowed:y,chosen:p=[],onFocus:f}){let{selection:u,store:d,scheme:S,principal:x}=ee(),b=ne(),a=(0,w.useMemo)(()=>d.log.all(),[d,b]),m=oe(a,d.schema.kinds,x),$=(0,w.useMemo)(()=>ae(d.graph,a,x?.id),[d,a,x?.id]),se=te(),E=e.city,D=e.nodes.filter(l=>l.plot!==void 0&&Math.round(l.plane)===2),R=E?.cell??0,F=E?.tilt??.5,K=(0,w.useRef)(f);K.current=f;let le=(0,w.useCallback)(l=>!K.current||y?.current?!1:(K.current(l),!0),[y]),X=(0,w.useRef)(new Map),M=new Map;for(let l of D){let O=l.aggregate?.memberIds??[],v=re(d.schema,l.kind),z=s=>v?d.graph.getNode(s)?.[v.field]:void 0,L=O.filter(s=>p.includes(s)),G=`${R}|${F}|${l.plot.col},${l.plot.row},${l.plot.side}|${L.join(",")}|${O.map(s=>`${s}=${String(z(s))}`).join(",")}`,T=X.current.get(l.id);if(T&&T.key===G){M.set(l.id,T);continue}let V={cell:R,originX:0,originY:0,tilt:F},q={x:0,y:0},we=d.schema.tryDefinition(l.kind),ye=s=>{let h=d.graph.getNode(s);return h?J(we,h):s},k=v?v.values.map(()=>[]):[[]],N=v?[...v.tiers]:["waiting"];for(let s of L.length>0?[...L,...O.filter(h=>!L.includes(h))]:O){let h=v?v.values.indexOf(z(s)):0;h>=0?k[h].push(s):(k.length===N.length&&(k.push([]),N.push("waiting")),k[k.length-1].push(s))}let{blocks:pe,rests:ve}=I(l.plot,k,N.map(s=>ie[s])),me=Se(l.plot,V,q),H=v?Le(d.schema,l.kind):void 0;M.set(l.id,{key:G,tile:B(me),rests:ve.map(s=>({count:s.count,rows:s.rows,at:A(s.col,s.row,R,F)})),buildings:pe.map(s=>{let W=(H?d.graph.getNode(s.id):void 0)?.[H];return{id:s.id,tier:N[s.lane],overdue:typeof W=="string"&&N[s.lane]!=="done"&&W.slice(0,10)<(c??new Date().toISOString().slice(0,10)),name:ye(s.id),width:s.footprint*R,...Ce(s,V,q)}})})}if(X.current=M,!E)return null;let de={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},ge=u.join(`
|
|
2
2
|
`),ce=se.join(`
|
|
3
3
|
`),ue=m?[...m].join(`
|
|
4
4
|
`):"",fe=$?[...$].join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C,e as L,n as H,o as R,p as k}from"./chunk.ST4JHXPS.js";import"./chunk.3NEALGMI.js";import"./chunk.UT6642FC.js";import"./chunk.PBCT33FF.js";import"./chunk.XOZU4OFA.js";import"./chunk.35FUGOSG.js";import{a as S}from"./chunk.OL5D7YTW.js";import"./chunk.TI4OSTQV.js";import"./chunk.DTRNDSMS.js";import"./chunk.A7HMVWMG.js";import"./chunk.GRLPNTUW.js";import"./chunk.EJAVIZ7Y.js";import"./chunk.423SZS7C.js";import{G as T,Pa as E,R as b}from"./chunk.TM6JVVGW.js";import"./chunk.SDO3U72B.js";import{Hc as x}from"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import{b as g}from"./chunk.AJZBJBMO.js";var t=g(T(),1);var c=g(b(),1);function N(n){if(!n||n.interaction.outcome==="failed")return null;let s=n.offers[0],o=s?n.interaction.offered.find(i=>i.id===s.id)?.confidence:void 0;return s&&o!==void 0&&o>=.6?{offer:s,confidence:o}:null}function j({rest:n,hold:s,leave:o}){let i=S(),u=(0,t.useMemo)(()=>C(n.target,e=>i.store.graph.has(e)),[n.target,i.store]),l=u.on==="record"&&L(i.ai)!==void 0,m=l?H(i,u):void 0,p=JSON.stringify(u),[y,I]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!l||m!==void 0)return;let e=!0;return R(i,u).then(r=>{e&&I({key:p,result:r})}),()=>{e=!1}},[p,l]);let w=m??(y?.key===p?y.result:void 0),f=l?N(w):null,v=f?.offer.id??null,h=(0,t.useRef)(null);if((0,t.useEffect)(()=>{if(v===null)return;let e=r=>{r.target instanceof Node&&h.current?.contains(r.target)||o(!0)};return document.addEventListener("pointerdown",e,{capture:!0,passive:!0}),document.addEventListener("contextmenu",e,{capture:!0,passive:!0}),addEventListener("scroll",e,{capture:!0,passive:!0}),addEventListener("resize",e,{passive:!0}),()=>{document.removeEventListener("pointerdown",e,{capture:!0}),document.removeEventListener("contextmenu",e,{capture:!0}),removeEventListener("scroll",e,{capture:!0}),removeEventListener("resize",e)}},[v,o]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!E(e))try{e.showPopover()}catch{}let r=n.element.getBoundingClientRect(),d=e.getBoundingClientRect(),O=r.top-d.height-4>=4?r.top-d.height-4:Math.min(innerHeight-d.height-4,r.top+4),A=Math.max(4,Math.min(innerWidth-d.width-4,r.right-d.width));e.style.top=`${Math.round(O)}px`,e.style.left=`${Math.round(A)}px`},[v,n.element]),!f)return null;let{offer:a,confidence:P}=f,M=a.type==="panel"?"a panel":a.type==="place"?"go there":a.type==="record"?"open it":"suggested";return(0,c.jsxs)("button",{ref:h,type:"button",popover:"manual","data-testid":"hover-chip","data-ai-offer":a.id,"data-ai-offer-type":a.type,"data-graview-overlay":"","data-graview-popover":"","aria-label":`Suggested by AI: ${a.label}`,title:`Suggested by AI, ${Math.round(P*100)}% sure`,onPointerEnter:s,onPointerLeave:()=>o(),onClick:()=>{n.element.closest("[tabindex], a[href], button")?.focus({preventScroll:!0}),o(!0),k(i,w,a)},style:$,children:[(0,c.jsxs)("span",{"aria-hidden":"true",style:{color:"var(--graview-accent)"},children:["\u2726"," "]}),a.label,(0,c.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",M]})]})}var $={position:"fixed",inset:"auto",top:0,left:0,margin:0,zIndex:x("toast"),boxSizing:"border-box",width:"max-content",maxWidth:"min(320px, calc(100vw - 8px))",height:"auto",minHeight:24,padding:"2px 10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",font:"inherit",fontSize:"0.75rem",cursor:"pointer"};export{j as HoverChip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.OL5D7YTW.js";import{D as v,G as I,R as h,_ as w}from"./chunk.TM6JVVGW.js";import{Xa as g}from"./chunk.PFEKS3KO.js";import{b as d}from"./chunk.AJZBJBMO.js";var k=d(I(),1);var t=d(h(),1),r={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function E({shows:e,onShows:i,mine:a,onMine:l}){let o={all:"All",changes:"Changes",ai:"AI"};return(0,t.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(s=>(0,t.jsx)("button",{type:"button","data-shows":s,"aria-pressed":e===s,onClick:()=>i(s),style:{...r,...e===s?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:o[s]},s)),(0,t.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>l(!a),style:{...r,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var x=e=>e.ask.kind==="suggest"?"suggest":e.ask.kind==="fill"?"fill in":e.ask.kind==="record"?"add one":e.ask.kind==="panel"?"draw a panel":`answer \u201C${e.ask.said}\u201D`;function $(e){let i=e.offered.filter(a=>e.accepted?.includes(a.id)).map(a=>a.label);switch(e.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${e.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return e.panel?`Drew \u201C${e.panel.title}\u201D`:"Drew a panel";case"failed":return e.failed??"Failed";default:return"Offered, not yet taken"}}function C(e){let i=[...new Set((e.usage??[]).map(o=>o.model))];if(i.length===0)return null;let a=(e.usage??[]).flatMap(o=>o.costUsd===void 0?[]:[o.costUsd]),l=a.length>0?a.reduce((o,s)=>o+s,0):void 0;return`${i.join(", ")}${l!==void 0?` \xB7 $${l<.01?l.toPrecision(2):l.toFixed(2)}`:""}`}function F({entry:e,undo:i}){let{store:a,principal:l,seats:o,people:s,ai:b}=w(),c=y(),[p,u]=(0,k.useState)(!1),A=e.by.kind==="human"&&e.by.onBehalfOf===void 0&&(e.by.id===void 0||l.id===void 0||e.by.id===l.id)?"you":g(e.by,{graph:a.graph,schema:a.schema,seats:o,people:s}),f=C(e),S=v(b),m=n=>{u(!0),(__graviewPreload(import.meta.url,["./chunk.ST4JHXPS.js","./chunk.3NEALGMI.js","./chunk.UT6642FC.js","./chunk.PBCT33FF.js","./chunk.XOZU4OFA.js","./chunk.35FUGOSG.js","./chunk.OL5D7YTW.js","./chunk.TI4OSTQV.js","./chunk.DTRNDSMS.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.KLAEKRCA.js")).then(n).finally(()=>u(!1))};return(0,t.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":e.id,"data-outcome":e.outcome,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:(0,t.jsxs)("span",{style:{minWidth:0},children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:A})," ",(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["asked AI to ",x(e)]}),(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.targetLabel]})]})}),e.offered.length>0&&e.outcome!=="accepted"&&e.outcome!=="partly"?(0,t.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",e.offered.map(n=>n.label).join(", ")]}):null,(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{"data-testid":"interaction-outcome",style:{color:e.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:$(e)}),(e.batches??[]).map(n=>(0,t.jsx)("span",{"data-interaction-batch":n,style:{marginLeft:"auto"},children:i(n)},n))]}),f?(0,t.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,S?(0,t.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.panel?(0,t.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:p,onClick:()=>m(n=>n.drawPanel(c,e.panel)),style:r,children:"Show the panel"}):null,(0,t.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:p,onClick:()=>m(n=>n.askAgain(c,e)),style:r,children:"Ask again"})]}):null]})}export{E as a,F as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,c as h}from"./chunk.
|
|
1
|
+
import{a as v,c as h}from"./chunk.KDTNKKOY.js";import{L as b,N as S}from"./chunk.PFEKS3KO.js";var P=Symbol.for("@graview/core:file"),T=Symbol.for("@graview/core:node-ref"),p=e=>typeof e=="object"&&e!==null?e._zod?.def:void 0;function w(e){let i=p(e);return i?.[P]??(i?.innerType?w(i.innerType):void 0)}function x(e){let i=w(e);if(i)return{as:i,list:!1};let n=p(e);for(;n?.innerType;)n=p(n.innerType);let s=n?.type==="array"?w(n.element):void 0;return s?{as:s,list:!0}:void 0}function A(e){if(typeof e!="object"||e===null)return;let i=e[T];if(i)return i;let n=p(e);return n?.[T]??(n?.innerType?A(n.innerType):void 0)}function H(e){let i=e?.shape??{};return Object.entries(i).flatMap(([n,s])=>{let r=A(s);return r?[{name:n,kinds:r}]:[]})}var K=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.href=="string"&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.bytes=="number",W=e=>(Array.isArray(e)?e:[e]).filter(K);function I(e,i,n){let r=e.schema.tryDefinition(i)?.fields?.shape?.[n];return r===void 0?void 0:x(r)}function N(e,i){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=[],s=new Set(i.schema.kinds);for(let r of e){let{kind:l,field:a}=r??{};typeof l!="string"||typeof a!="string"?n.push(`Each of the view's accepts is { "kind": <a kind>, "field": <its image, video or file field> }.`):s.has(l)?I(i,l,a)?i.allMutations().some(o=>(o.creates??[]).includes(l)&&Object.hasOwn(o.input?.shape??{},a))||n.push(`No act of this app makes a "${l}" with its "${a}", so a file dropped could become nothing.`):n.push(`The view accepts files into ${l}'s "${a}", which holds no picture, video or file.`):n.push(`The view accepts files for "${l}", which is no kind of this app.`)}return n}function D(e){if(e===void 0||e===!0)return[];if(typeof e!="object"||e===null||Array.isArray(e))return[`The view's pictures is true, or { "width": <the widest it draws a picture, in pixels> }.`];let{width:i,...n}=e,s=[];return Object.keys(n).length>0&&s.push(`The view's pictures says ${Object.keys(n).map(r=>`"${r}"`).join(", ")}: only "width" is read.`),i!==void 0&&!(Number.isInteger(i)&&i>=16&&i<=4096)&&s.push("The view's pictures width is a whole number of pixels from 16 to 4096."),s}function E(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:i,...n}=e,s=[];return Object.keys(n).length>0&&s.push(`The view's scene says ${Object.keys(n).map(r=>`"${r}"`).join(", ")}: only "maxHeight" is read.`),i!==void 0&&!(Number.isInteger(i)&&i>=80&&i<=4e3)&&s.push("The view's scene maxHeight is a whole number of pixels from 80 to 4000."),s}function F(e){return(e.acts??[]).map(i=>typeof i=="string"?{act:i}:i)}function B(e,i){let n=[],s=new Set(i.schema.kinds),r=new Set(i.schema.edgeKinds),l=new Set(i.allMutations().map(o=>o.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"&&!s.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"||e.cardinality!=="one")&&n.push('Only a view of one record replaces its page: replaces "page" needs cardinality one on a kind.'),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.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(...E(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(...D(e.pictures)),n.push(...N(e.accepts,i));for(let o of e.reads?.kinds??[])s.has(o)||n.push(`The view reads "${o}", which is no kind of this app.`);for(let o of e.reads?.edges??[])r.has(o)||n.push(`The view reads the edge "${o}", which no kind of this app declares.`);let a=new Set;for(let o of F(e)){l.has(o.act)||n.push(`The view asks for the act "${o.act}", which this app does not declare.`);let c=o.as??o.act;a.has(c)&&n.push(`Two of the view's acts are called "${c}".`),a.add(c)}return n}function L(e,i,n){let{manifest:s}=n,r=n.input??{},a=e.seenBy(i).graph,o=s.attach==="home"?void 0:s.attach,c=o&&s.cardinality==="one"&&r.node?a.getNode(r.node.id):void 0,f=c&&c.kind===o?[c]:[],g=o&&s.cardinality==="many"?r.nodes?r.nodes.flatMap(t=>{let d=a.getNode(t.id);return d&&d.kind===o?[d]:[]}):a.nodesOfKind(o):[],$=new Set([...f,...g].map(t=>t.id)),m=v(a,$,{kinds:(s.reads?.kinds??[]).filter(t=>t!==o||s.cardinality==="one"),edges:s.reads?.edges??[]}),u=new Map;for(let t of[...g,...m.nodes])f.some(d=>d.id===t.id)||u.set(t.id,t);let j=new Set([...f.map(t=>t.id),...u.keys()]),O=[...m.edges],M=new Set(F(s).map(t=>t.act)),V=e.permittedMutations(i).filter(t=>M.has(t.name)).map(t=>({name:t.name,title:t.title??t.name,...t.description!==void 0?{description:t.description}:{},...t.subject?{subject:{kinds:t.subject.kinds,arg:t.subject.arg}}:{}})),k=t=>t?.filter(d=>j.has(d));return{view:s.name,...f[0]?{node:h(e,f[0])}:{},nodes:[...u.values()].map(t=>h(e,t)),edges:O,...s.title!==void 0?{label:s.title}:r.label!==void 0?{label:r.label}:{},cardinality:s.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:k(r.implicated)}:{},...r.flagged?{flagged:k(r.flagged)}:{},acts:V,...n.theme?{theme:n.theme}:{},locale:b(),timeZone:S(),...n.places?{places:n.places.filter((t,d,y)=>y.findIndex(G=>G.as===t.as)===d).map(({as:t,title:d,kind:y})=>({as:t,title:d,kind:y}))}:{}}}export{H as a,K as b,W as c,I as d,F as e,B as f,L as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as z,g as Z,h as ee}from"./chunk.TCXKPILZ.js";import{a as Q,b as X}from"./chunk.64WM4IBI.js";import{b}from"./chunk.IQ2HKGJS.js";import{d as q}from"./chunk.IROYMLER.js";import{a as K}from"./chunk.UT6642FC.js";import{h as I}from"./chunk.HDRD33II.js";import{m as J}from"./chunk.O4WEJ47H.js";import{Da as V,G as F,J as P,O as L,Oa as Y,P as T,R as U,Sa as _,_ as v,ga as G}from"./chunk.Y4ZUJUUT.js";import{a as $}from"./chunk.SDO3U72B.js";import{Wa as H,ca as j,ea as E,qb as A}from"./chunk.AS4CQBOQ.js";import{b as W}from"./chunk.AJZBJBMO.js";var c=W(F(),1);var te=W(F(),1);function ne(){let{ai:i,aiDesk:n}=v(),{entries:r}=P(n),a=i.off===!0;return(0,te.useEffect)(()=>{a||n.load()},[n,a]),a?[]:r}var e=W(U(),1),ae=V($(()=>(__graviewPreload(import.meta.url,["./chunk.OONCUAOH.js","./chunk.2W22AWSL.js","./chunk.O4WEJ47H.js","./chunk.Y4ZUJUUT.js","./chunk.SDO3U72B.js","./chunk.AS4CQBOQ.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.PBKO5CKD.js")))),ge=ae.part((i,n)=>(0,e.jsx)(i.InteractionRow,{...n}),{quiet:!0,as:"li"}),ue=ae.part((i,n)=>(0,e.jsx)(i.ActivityFilter,{...n}),{quiet:!0,as:"div"}),ie=(i,n,r=re(i,[n]))=>({intent:n.intent,author:n.author.kind,...n.author.id?{authorId:n.author.id}:{},by:n.author,...n.ops[0]?.via?{via:n.ops[0].via}:{},...n.lineage?{basis:K(n.lineage)}:{},touched:[...new Set(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes))],...ce(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes),r),batch:n.id,at:n.at,...n.lineage?.interaction?{interaction:n.lineage.interaction}:{},seq:n.ops.at(-1).seq+1,...n.ops.every(A)?{withheld:!0}:{}});function he(i=4){let{store:n,principal:r}=v(),a=T(n,r),d=a.log.length;return(0,c.useMemo)(()=>{let s=a.batches(),l=re(a,s);return Q(s,o=>a.log.get(o)).reverse().slice(0,i).map(o=>{if("batch"in o)return ie(a,o.batch,l);let g=[...o.digest.batches].reverse().map(u=>ie(a,u,l));return{intent:X(o.digest),author:o.digest.author.kind,...o.digest.author.id?{authorId:o.digest.author.id}:{},by:o.digest.author,touched:[...new Set(g.flatMap(u=>u.touched))],batch:"",...g[0]?.at?{at:g[0].at}:{},seq:g[0]?.seq??0,digest:g}})},[a,d,i])}function re(i,n){let r=new Map;for(let a of n)for(let d of a.ops)if(!A(d))for(let s of d.primitives)(s.op==="add-node"||s.op==="remove-node")&&s.node&&r.set(s.node.id,j(i.schema.tryDefinition(s.node.kind),s.node));return r}function ce(i,n){let r={};for(let a of i){let d=n.get(a);d!==void 0&&(r[a]=d)}return Object.keys(r).length>0?{named:r}:{}}function ye({change:i}){let{store:n,principal:r,seats:a,people:d}=v();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[i.author==="human"&&i.by?.onBehalfOf===void 0&&(i.authorId===void 0||r.id===void 0||i.authorId===r.id)?"you":H(i.by??{kind:i.author,id:i.authorId},{graph:n.graph,schema:n.schema,seats:a,people:d}),I(i.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(i.via)]}):null]})}function fe({change:i,goes:n}){let{store:r}=v(),[a,d]=(0,c.useState)(!1),s=i.digest??[];return(0,e.jsxs)("li",{"data-testid":"activity-digest",style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)(ye,{change:i})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:i.intent})]}),(0,e.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":a,onClick:()=>d(l=>!l),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:a?"Hide":"Show each"})]}),a?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:s.map(l=>(0,e.jsxs)("li",{"data-testid":"digest-change",style:{display:"grid",gap:3},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:l.intent}),l.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",l.basis]}):null]}),l.withheld?null:(0,e.jsx)(B,{batch:l.batch})]}),l.touched.length>0?(0,e.jsx)("div",{"data-touched":l.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:l.touched.slice(0,4).map(o=>(0,e.jsx)(M,{id:o,label:r.graph.has(o)?b(r,o):l.named?.[o]??b(r,o),go:n(o)},o))}):null]},l.batch))}):null]})}function B({batch:i}){let{store:n,principal:r,noteSeat:a}=v(),d=T(n,r),s=L()?.open??!1,l=d.log.length,[o,g]=(0,c.useState)(null),u=(0,c.useMemo)(()=>d.canUndo(i),[d,i,l]);if(s||!u.ok&&u.ops.length===0)return null;let w=!u.ok,k=w?u.includeBatches:[];return(0,e.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,e.jsx)("button",{type:"button","data-testid":"undo-turn",title:w?`${u.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{g(null);try{let m=d.log.all().find(x=>x.batch===i&&x.author.kind==="agent");d.undo(w?[i,...k]:i,{author:r}),m&&a({type:"home",author:m.author})}catch(m){g(m instanceof Error?m.message:String(m))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...w?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:w?`undo +${k.length}`:"undo"}),o?(0,e.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:o}):null]})}function me({seq:i,intent:n}){let r=L();if(!r)return null;let a=r.past?.seq===i;return(0,e.jsx)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${n}\u201D`,title:"Show the app as it was here","aria-pressed":a,onPointerEnter:z,onFocus:z,onClick:()=>r.show(i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",flex:"0 0 auto"},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,e.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}function ve(){let i=()=>{let n=new URL(window.location.href);return n.searchParams.set("fresh","1"),n.toString()};return(0,e.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:n=>{n.preventDefault(),window.location.assign(i())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function M({id:i,label:n,go:r}){return r?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":i,title:`Go to ${n}`,onClick:()=>r(i),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(q,{label:n})}):(0,e.jsx)(q,{label:n})}function Oe({calls:i,seat:n,remembers:r=!1}){let a=he(),{store:d,principal:s,seats:l,people:o}=v(),g=ne(),[u,w]=(0,c.useState)("all"),[k,m]=(0,c.useState)(!1),x=t=>t!==void 0&&(t.id===s.id||t.onBehalfOf?.id===s.id)&&s.id!==void 0,oe=new Set(g.map(t=>t.id)),se=a.filter(t=>!(t.interaction!==void 0&&oe.has(t.interaction))&&(!k||x(t.by))),de=g.filter(t=>!k||x(t.by)).slice(0,4),C=[...u==="ai"?[]:se.map(t=>({at:t.at??"",change:t})),...u==="changes"?[]:de.map(t=>({at:t.at,entry:t}))].sort((t,y)=>t.at<y.at?1:t.at>y.at?-1:0),f=T(d,s),O=i.some(t=>t.phase==="running"),le=Z(),S=_("activity"),D=S.open,pe=G(),N=L(),R=t=>f.graph.has(t)?y=>{S.setOpen(!1),N?.past&&N.show(null),pe.record(y)}:null;return n===void 0&&i.length===0&&a.length===0&&g.length===0&&!r&&le===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"activity-button",...S.trigger,onClick:S.toggle,title:O?"An agent is working":"What has happened",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:O?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[O?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,a.length>0?a.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!D&&n!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,D?(0,e.jsxs)("section",{...S.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...Y,width:300,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...J,margin:0},children:"Activity"}),n!==void 0?(0,e.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:i.length>0||C.length>0?9:0,...i.length>0||C.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,e.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),n]}):null,i.length>0?(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:i.slice(0,6).map((t,y)=>(0,e.jsxs)("li",{style:{display:"grid",gap:2,fontSize:"0.8125rem",lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:t.phase==="running"?"var(--graview-accent)":t.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,e.jsxs)("span",{style:{color:"var(--graview-ink)"},children:[t.mutating?"changed":"read"," \xB7"," ",f.allMutations().find(p=>p.name===t.name)?.title??E(t.name)]})]}),!t.mutating&&t.reads&&t.reads.length>0?(0,e.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(t.reads)].slice(0,3).map(p=>(0,e.jsx)(M,{id:p,label:b(f,p),go:R(p)},p)),new Set(t.reads).size>3?(0,e.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(t.reads).size-3]}):null]}):Object.values(t.args).some(p=>typeof p=="string")?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(t.args).filter(p=>typeof p[1]=="string").slice(0,3).map(([p,h])=>(0,e.jsx)(M,{id:h,label:b(f,h),go:R(h)},p))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${y}`))}):null,g.length>0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ue,{shows:u,onShows:w,mine:k,onMine:m})}):null,C.length>0?(0,e.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:C.map(({change:t,entry:y},p)=>y!==void 0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ge,{entry:y,undo:h=>(0,e.jsx)(B,{batch:h})})},`ai:${y.id}`):t.digest?(0,e.jsx)(fe,{change:t,goes:R},`digest:${t.digest[0]?.batch??p}`):t.withheld?(0,e.jsx)("li",{"data-testid":"withheld-change",style:{display:"grid",gap:3,lineHeight:1.45},children:(0,e.jsx)("span",{"data-touched":"",style:{color:"var(--graview-ink-muted)",fontStyle:"italic"},children:t.intent})},`change:${p}`):(0,e.jsxs)("li",{"data-batch":t.batch,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsxs)("strong",{style:{fontWeight:600},children:[t.author==="human"&&t.by?.onBehalfOf===void 0&&(t.authorId===void 0||s.id===void 0||t.authorId===s.id)?"you":H(t.by??{kind:t.author,id:t.authorId},{graph:f.graph,schema:f.schema,seats:l,people:o}),I(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(me,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(B,{batch:t.batch}):null]}),(0,e.jsx)("div",{"data-touched":t.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:t.touched.slice(0,4).map(h=>(0,e.jsx)(M,{id:h,label:f.graph.has(h)?b(f,h):t.named?.[h]??b(f,h),go:R(h)},h))})]},`change:${p}`))}):null,(0,e.jsx)(ee,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),r?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(ve,{})]}):null]}):null]})}export{B as a,Oe as b};
|
|
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 z,g as Z,h as ee}from"./chunk.IVHPJUFM.js";import{a as Q,b as X}from"./chunk.W6CGAPNQ.js";import{b}from"./chunk.7C4IR4S7.js";import{d as q}from"./chunk.AP22NNIM.js";import{a as K}from"./chunk.UT6642FC.js";import{a as I}from"./chunk.A7HMVWMG.js";import{m as J}from"./chunk.423SZS7C.js";import{Da as V,G as F,J as P,O as L,Oa as Y,P as T,R as U,Sa as _,_ as v,ga as G}from"./chunk.TM6JVVGW.js";import{a as $}from"./chunk.SDO3U72B.js";import{Xa as H,da as j,fa as E,sb as A}from"./chunk.PFEKS3KO.js";import{b as W}from"./chunk.AJZBJBMO.js";var c=W(F(),1);var te=W(F(),1);function ne(){let{ai:i,aiDesk:n}=v(),{entries:r}=P(n),a=i.off===!0;return(0,te.useEffect)(()=>{a||n.load()},[n,a]),a?[]:r}var e=W(U(),1),ae=V($(()=>(__graviewPreload(import.meta.url,["./chunk.BU6V76EF.js","./chunk.OL5D7YTW.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.EPTUOPPC.js")))),ge=ae.part((i,n)=>(0,e.jsx)(i.InteractionRow,{...n}),{quiet:!0,as:"li"}),ue=ae.part((i,n)=>(0,e.jsx)(i.ActivityFilter,{...n}),{quiet:!0,as:"div"}),ie=(i,n,r=re(i,[n]))=>({intent:n.intent,author:n.author.kind,...n.author.id?{authorId:n.author.id}:{},by:n.author,...n.ops[0]?.via?{via:n.ops[0].via}:{},...n.lineage?{basis:K(n.lineage)}:{},touched:[...new Set(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes))],...ce(n.ops.filter(a=>!A(a)).flatMap(a=>a.writes),r),batch:n.id,at:n.at,...n.lineage?.interaction?{interaction:n.lineage.interaction}:{},seq:n.ops.at(-1).seq+1,...n.ops.every(A)?{withheld:!0}:{}});function he(i=4){let{store:n,principal:r}=v(),a=T(n,r),d=a.log.length;return(0,c.useMemo)(()=>{let s=a.batches(),l=re(a,s);return Q(s,o=>a.log.get(o)).reverse().slice(0,i).map(o=>{if("batch"in o)return ie(a,o.batch,l);let g=[...o.digest.batches].reverse().map(u=>ie(a,u,l));return{intent:X(o.digest),author:o.digest.author.kind,...o.digest.author.id?{authorId:o.digest.author.id}:{},by:o.digest.author,touched:[...new Set(g.flatMap(u=>u.touched))],batch:"",...g[0]?.at?{at:g[0].at}:{},seq:g[0]?.seq??0,digest:g}})},[a,d,i])}function re(i,n){let r=new Map;for(let a of n)for(let d of a.ops)if(!A(d))for(let s of d.primitives)(s.op==="add-node"||s.op==="remove-node")&&s.node&&r.set(s.node.id,j(i.schema.tryDefinition(s.node.kind),s.node));return r}function ce(i,n){let r={};for(let a of i){let d=n.get(a);d!==void 0&&(r[a]=d)}return Object.keys(r).length>0?{named:r}:{}}function ye({change:i}){let{store:n,principal:r,seats:a,people:d}=v();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[i.author==="human"&&i.by?.onBehalfOf===void 0&&(i.authorId===void 0||r.id===void 0||i.authorId===r.id)?"you":H(i.by??{kind:i.author,id:i.authorId},{graph:n.graph,schema:n.schema,seats:a,people:d}),I(i.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(i.via)]}):null]})}function fe({change:i,goes:n}){let{store:r}=v(),[a,d]=(0,c.useState)(!1),s=i.digest??[];return(0,e.jsxs)("li",{"data-testid":"activity-digest",style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)(ye,{change:i})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:i.intent})]}),(0,e.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":a,onClick:()=>d(l=>!l),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:a?"Hide":"Show each"})]}),a?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:s.map(l=>(0,e.jsxs)("li",{"data-testid":"digest-change",style:{display:"grid",gap:3},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:l.intent}),l.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",l.basis]}):null]}),l.withheld?null:(0,e.jsx)(B,{batch:l.batch})]}),l.touched.length>0?(0,e.jsx)("div",{"data-touched":l.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:l.touched.slice(0,4).map(o=>(0,e.jsx)(M,{id:o,label:r.graph.has(o)?b(r,o):l.named?.[o]??b(r,o),go:n(o)},o))}):null]},l.batch))}):null]})}function B({batch:i}){let{store:n,principal:r,noteSeat:a}=v(),d=T(n,r),s=L()?.open??!1,l=d.log.length,[o,g]=(0,c.useState)(null),u=(0,c.useMemo)(()=>d.canUndo(i),[d,i,l]);if(s||!u.ok&&u.ops.length===0)return null;let w=!u.ok,k=w?u.includeBatches:[];return(0,e.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,e.jsx)("button",{type:"button","data-testid":"undo-turn",title:w?`${u.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{g(null);try{let m=d.log.all().find(x=>x.batch===i&&x.author.kind==="agent");d.undo(w?[i,...k]:i,{author:r}),m&&a({type:"home",author:m.author})}catch(m){g(m instanceof Error?m.message:String(m))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...w?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:w?`undo +${k.length}`:"undo"}),o?(0,e.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:o}):null]})}function me({seq:i,intent:n}){let r=L();if(!r)return null;let a=r.past?.seq===i;return(0,e.jsx)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${n}\u201D`,title:"Show the app as it was here","aria-pressed":a,onPointerEnter:z,onFocus:z,onClick:()=>r.show(i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",flex:"0 0 auto"},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,e.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}function ve(){let i=()=>{let n=new URL(window.location.href);return n.searchParams.set("fresh","1"),n.toString()};return(0,e.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:n=>{n.preventDefault(),window.location.assign(i())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function M({id:i,label:n,go:r}){return r?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":i,title:`Go to ${n}`,onClick:()=>r(i),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(q,{label:n})}):(0,e.jsx)(q,{label:n})}function Oe({calls:i,seat:n,remembers:r=!1}){let a=he(),{store:d,principal:s,seats:l,people:o}=v(),g=ne(),[u,w]=(0,c.useState)("all"),[k,m]=(0,c.useState)(!1),x=t=>t!==void 0&&(t.id===s.id||t.onBehalfOf?.id===s.id)&&s.id!==void 0,oe=new Set(g.map(t=>t.id)),se=a.filter(t=>!(t.interaction!==void 0&&oe.has(t.interaction))&&(!k||x(t.by))),de=g.filter(t=>!k||x(t.by)).slice(0,4),C=[...u==="ai"?[]:se.map(t=>({at:t.at??"",change:t})),...u==="changes"?[]:de.map(t=>({at:t.at,entry:t}))].sort((t,y)=>t.at<y.at?1:t.at>y.at?-1:0),f=T(d,s),O=i.some(t=>t.phase==="running"),le=Z(),S=_("activity"),D=S.open,pe=G(),N=L(),R=t=>f.graph.has(t)?y=>{S.setOpen(!1),N?.past&&N.show(null),pe.record(y)}:null;return n===void 0&&i.length===0&&a.length===0&&g.length===0&&!r&&le===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"activity-button",...S.trigger,onClick:S.toggle,title:O?"An agent is working":"What has happened",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:O?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[O?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,a.length>0?a.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!D&&n!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,D?(0,e.jsxs)("section",{...S.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...Y,width:300,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...J,margin:0},children:"Activity"}),n!==void 0?(0,e.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:i.length>0||C.length>0?9:0,...i.length>0||C.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,e.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),n]}):null,i.length>0?(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:i.slice(0,6).map((t,y)=>(0,e.jsxs)("li",{style:{display:"grid",gap:2,fontSize:"0.8125rem",lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:t.phase==="running"?"var(--graview-accent)":t.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,e.jsxs)("span",{style:{color:"var(--graview-ink)"},children:[t.mutating?"changed":"read"," \xB7"," ",f.allMutations().find(p=>p.name===t.name)?.title??E(t.name)]})]}),!t.mutating&&t.reads&&t.reads.length>0?(0,e.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(t.reads)].slice(0,3).map(p=>(0,e.jsx)(M,{id:p,label:b(f,p),go:R(p)},p)),new Set(t.reads).size>3?(0,e.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(t.reads).size-3]}):null]}):Object.values(t.args).some(p=>typeof p=="string")?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(t.args).filter(p=>typeof p[1]=="string").slice(0,3).map(([p,h])=>(0,e.jsx)(M,{id:h,label:b(f,h),go:R(h)},p))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${y}`))}):null,g.length>0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ue,{shows:u,onShows:w,mine:k,onMine:m})}):null,C.length>0?(0,e.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:C.map(({change:t,entry:y},p)=>y!==void 0?(0,e.jsx)(c.Suspense,{fallback:null,children:(0,e.jsx)(ge,{entry:y,undo:h=>(0,e.jsx)(B,{batch:h})})},`ai:${y.id}`):t.digest?(0,e.jsx)(fe,{change:t,goes:R},`digest:${t.digest[0]?.batch??p}`):t.withheld?(0,e.jsx)("li",{"data-testid":"withheld-change",style:{display:"grid",gap:3,lineHeight:1.45},children:(0,e.jsx)("span",{"data-touched":"",style:{color:"var(--graview-ink-muted)",fontStyle:"italic"},children:t.intent})},`change:${p}`):(0,e.jsxs)("li",{"data-batch":t.batch,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsxs)("strong",{style:{fontWeight:600},children:[t.author==="human"&&t.by?.onBehalfOf===void 0&&(t.authorId===void 0||s.id===void 0||t.authorId===s.id)?"you":H(t.by??{kind:t.author,id:t.authorId},{graph:f.graph,schema:f.schema,seats:l,people:o}),I(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",I(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(me,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(B,{batch:t.batch}):null]}),(0,e.jsx)("div",{"data-touched":t.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:t.touched.slice(0,4).map(h=>(0,e.jsx)(M,{id:h,label:f.graph.has(h)?b(f,h):t.named?.[h]??b(f,h),go:R(h)},h))})]},`change:${p}`))}):null,(0,e.jsx)(ee,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),r?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(ve,{})]}):null]}):null]})}export{B as a,Oe as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as $}from"./chunk.
|
|
1
|
+
import{H as $}from"./chunk.423SZS7C.js";import{G as L,La as U,a as I,b as R,c as E,d as f,e as k,j as W,m as F,v as j}from"./chunk.TM6JVVGW.js";import{Dd as b,Ed as r,wd as s}from"./chunk.PFEKS3KO.js";import{b as H}from"./chunk.AJZBJBMO.js";var u=H(L(),1),_=e=>typeof e=="object"&&e!==null&&"idx"in e;function S(e){let n=r(window.location.pathname,e);return n===null?null:n!==s&&n!=="/"?"pages":n===s||window.location.href.includes("#")?f(window.location.hash).overview?"graview":"scene":_(window.history.state)?"pages":null}function K(e){let n=e.face??(e.stop&&E(e.stop).overview?"graview":"scene");return e.routing!=="address"||typeof window>"u"?n:S(e.basePath)??n}function Q(e){return e.routing!=="address"||typeof window>"u"?!1:r(window.location.pathname,e.basePath)==="/"&&S(e.basePath)===null}function X(e){if(typeof window>"u")return;let n=r(window.location.pathname,e);return n===s||n==="/"&&window.location.href.includes("#")?R(f(window.location.hash)):void 0}function Z({basePath:e,pagesWere:n,shown:t,onFace:i,toggle:l,kinds:N,places:w,opens:B,landed:V}){let{view:O,go:p}=U(),g=(0,u.useRef)({shown:t,view:O,onFace:i,landed:V});g.current={shown:t,view:O,onFace:i,landed:V};let m=(0,u.useRef)(n??"/"),P=()=>{m.current=`${r(window.location.pathname,e)??"/"}${window.location.search}`};return l.current=(o,c,a)=>{let{shown:d,view:h,onFace:A}=g.current;if(o==="pages"&&d!=="pages")window.history.pushState(null,"",b(c??m.current,{basePath:e}));else if(o!=="pages"&&d==="pages"){P();let y=a===void 0?h:M(E(a),w),v=q(y)?z(B):y,T=v!==y&&v.overview?"graview":o,x=Y(T,v,N);p(x),window.history.pushState(null,"",`${b(s,{basePath:e})}${k(x)}`),A?.(T);return}A?.(o)},(0,u.useEffect)(()=>{let o=()=>{if(r(window.location.pathname,e)===null)return;let c=S(e)??"pages",{shown:a,onFace:d,landed:h}=g.current;if(c==="pages"){P(),h?.(m.current),a!=="pages"&&d?.("pages");return}a==="pages"&&(p(M(f(window.location.hash),w)),d?.(c))};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[e,p,w]),null}function M(e,n){let t=e.within?.view,i=t!==void 0&&!e.focusId?n.find(l=>l.as===t):void 0;return i?{...e,focusId:j(i.kind)}:e}function Y(e,n,t){return e==="graview"?F(n,!0):n.overview?W(F(n,!1),$(n,t)):n}function q(e){return e.focusId===null&&e.overview!==!0}function z(e){return e??{...I,overview:!0}}export{K as a,Q as b,X as c,Z as d,M as e,Y as f,q as g,z as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.423SZS7C.js";import{G as W,R as x}from"./chunk.TM6JVVGW.js";import"./chunk.SDO3U72B.js";import"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function L({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{L as WhenMonth};
|
|
@@ -0,0 +1,18 @@
|
|
|
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 zt,B as Re,C as ro,D as Ze,E as me,F as Wn,G as De,H as Ue,I as oo,J as Kn,K as Le,L as io,M as so,N as O,O as pt,P as wt,Q as lo,R as vt,S as Qt,T as co,U as te,V as Zt,W as oe,X as Bn,a as U,b as ve,c as _,d as jt,e as Hn,f as In,g as ct,h as X,i as we,j as re,k as C,l as ee,m as G,n as qe,o as Se,p as _t,q as ke,r as ce,s as to,t as ht,u as no,v as Fn,w as Dn,x as Y,y as Fe,z as ao}from"./chunk.7MJGZHTS.js";import{a as Ie}from"./chunk.QWX2N2VD.js";import{a as Qe,b as Yt,d as Q}from"./chunk.BJR6E2CT.js";import{b as Nn,c as Jr,d as eo}from"./chunk.VSWEKNKS.js";import{a as Qr,d as Zr,e as Xr}from"./chunk.UGFDSE37.js";import{a as Ur,c as Vr,f as jr,g as _r,i as zr,j as Yr}from"./chunk.SGJSJGSR.js";import{a as Nr,b as Hr,c as Ir,d as On}from"./chunk.2OXXGN7C.js";import{b as Or}from"./chunk.Q4KNNJFL.js";import{a as Fr,b as Dr,d as Gt,e as Wr,f as Kr,g as Br,j as qt}from"./chunk.BH365UJ5.js";import{a as Ut,b as Vt}from"./chunk.PXQVXBNG.js";import{a as Ht,b as za,c as Ya,d as It,e as Qa}from"./chunk.4SEY7VWZ.js";import{b as ar,c as mr,e as fr,f as Tn}from"./chunk.IVHPJUFM.js";import{a as Ln,b as gr}from"./chunk.D53IGR45.js";import{a as Kt,b as Bt,c as Mr,e as Er}from"./chunk.SPZVEQC5.js";import{a as dt,b as pr,e as ur}from"./chunk.FNK2ZZ5E.js";import{m as $r}from"./chunk.EM5CGFNB.js";import{a as hr,b as wr,c as vr,e as Tr,f as $n,h as Wt}from"./chunk.AGVFW6WC.js";import{d as br,e as xr,f as Pr,g as Cr,n as Ar,o as Rr,q as Lr,s as Dt}from"./chunk.SIVMZNHZ.js";import{a as Mn}from"./chunk.3NEALGMI.js";import{a as An,b as tr,c as nr}from"./chunk.UT6642FC.js";import{a as yr}from"./chunk.35FUGOSG.js";import{c as or,d as ir,e as sr,f as lr,k as yt,l as dr}from"./chunk.NQDGUIUQ.js";import{a as rr}from"./chunk.DTRNDSMS.js";import{r as Rn,s as cr}from"./chunk.FOYVTN5B.js";import{b as Za,c as Xa,d as Ja,e as er,l as Ft}from"./chunk.GRLPNTUW.js";import{C as En,K as Gr,N as qr,e as ja,f as _a,j as Xo,u as Sr,v as kr}from"./chunk.423SZS7C.js";import{$ as de,G as He,L as Ha,N as Ia,Na as Va,Q as Fa,R as B,S as Cn,V as Da,W as Wa,_ as Ka,ca as Ba,da as Ga,fa as qa,ja as lt,la as Ua,na as Ot,r as Na,v as Ne,ya as Nt}from"./chunk.TM6JVVGW.js";import{a as Oa}from"./chunk.SDO3U72B.js";import{Bd as $a,Gc as Ta,J as wa,U as ft,Ya as xa,_a as Pa,ca as st,cc as Aa,da as ge,ed as xn,fa as ze,ga as Tt,hc as Ra,ia as Ge,ib as bn,jb as Ca,jc as La,jd as Et,ka as va,kd as Ma,la as Sa,ma as Ye,md as $t,sb as Mt,vd as Pn,wd as Ea,xa as ka,ya as ba}from"./chunk.PFEKS3KO.js";import{b as H}from"./chunk.AJZBJBMO.js";function po(e,t,n={}){let a=e.graph.getNode(t);if(!a)return;let r=e.schema.tryDefinition(a.kind),o=l=>ge(e.schema.tryDefinition(l.kind),l),d=new Map;for(let l of e.graph.allEdges()){let s=l.from===t?"out":l.to===t?"in":null;if(!s)continue;let c=s==="out"?l.to:l.from,m=e.graph.getNode(c);if(!m)continue;let w=(s==="out"?r:e.schema.tryDefinition(m.kind))?.edges?.[l.kind],g=s==="in"?w?.inverse??w?.description:w?.description,x=`${l.kind}|${s}|${g??""}`;(d.get(x)??(()=>{let q={edgeKind:l.kind,direction:s,...g?{description:g}:{},targets:[]};return d.set(x,q),q})()).targets.push({id:m.id,kind:m.kind,label:o(m)})}return{id:t,kind:a.kind,label:o(a),fields:Ja(yt(e.schema,e.graph,a),r),violations:bn(e.violations(n.context),[t]),actions:Mn(e,[t],{focus:t,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...d.values()].map(l=>{let s=Za(l.targets.flatMap(c=>{let m=e.graph.getNode(c.id);return m?[m]:[]}),c=>e.schema.tryDefinition(c));return{...l,targets:[...l.targets].map(c=>s.has(c.id)?{...c,apart:s.get(c.id)}:c).sort((c,m)=>c.label.localeCompare(m.label))}})}}function Xe(e,t,n={}){return{kind:t,members:e.graph.nodesOfKind(t),actions:Mn(e,[],{kindSelection:[t],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function uo(e,t){let n=(o,d)=>`${o}|${JSON.stringify(d)}`,a=new Map;for(let o of[...e.affordances,...e.withheld]){if(o.provider!=="invariant")continue;let d=n(o.mutation,o.args);a.has(d)||a.set(d,o.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...t].map((o,d)=>({repair:o,declared:d})).sort((o,d)=>(a.get(n(o.repair.mutation,o.repair.args??{}))??r)-(a.get(n(d.repair.mutation,d.repair.args??{}))??r)||o.declared-d.declared).map(o=>o.repair)}function Je(e){let t=e.schema.kinds.map(r=>({kind:r,plural:Ge(e.schema,r),count:e.graph.nodesOfKind(r).length})),n=new Map;for(let r of e.graph.allEdges()){let o=e.graph.getNode(r.from),d=e.graph.getNode(r.to);if(!o||!d)continue;let l=`${r.kind}|${o.kind}|${d.kind}`;n.set(l,(n.get(l)??0)+1)}let a=[];for(let{kind:r}of t){let o=e.schema.tryDefinition(r)?.edges??{};for(let[d,l]of Object.entries(o)){let s=l.to==="*"||l.to===void 0?(()=>{let c=[...n.keys()].filter(m=>m.startsWith(`${d}|${r}|`)).map(m=>m.split("|")[2]);return c.length>0?c:["*"]})():l.to;for(let c of s)a.push({edgeKind:d,from:r,to:c,...l.description?{description:l.description}:{},...l.inverse?{inverse:l.inverse}:{},count:n.get(`${d}|${r}|${c}`)??0})}}return{kinds:t,relations:a}}var We=H(He(),1);var St=H(He(),1);var Te=H(B(),1),ei={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},ti=e=>{try{return decodeURIComponent(e)}catch{return e}};function ni(e,t,n={}){let{store:a}=e,r=a.schema,o=(n.base??"").replace(/\/$/,""),[d="/",l=""]=t.split("#")[0].split("?"),s=(u,M,j)=>({label:u,href:`${o}${M}`,path:M,...j?{current:j}:{}}),c=u=>{let M=n.registry?.sectionOf(u);return M?[M.path===void 0?{label:M.label}:s(M.label,M.path)]:[]},m=u=>n.registry?.sectionOf(u)?.label,v=u=>{let M=m(u);return M===void 0?{}:{section:M}},[w,g,...x]=d.split("/").filter(Boolean).map(ti);if(w===void 0)return{as:"home",label:"Home",trail:[s("Home","/",!0)]};if(w==="places"&&g!==void 0&&x.length===0){let u=new URLSearchParams(l).get("of"),M=new Set(Fe(a,e.principal)),j=e.views?.places()??[],P=j.find(D=>M.has(D.kind)&&D.as===g&&(!u||U(r,D.kind)===u));if(P){let D=jt(P.as,Et(P,j)?U(r,P.kind):void 0);return{as:"place",kind:P.kind,label:P.title,...v(P.kind),trail:[...c(P.kind),s(P.title,D,!0)]}}}let N=x.length===0?ve(r,w):void 0;if(N!==void 0){let u=s(Ge(r,N),`/${U(r,N)}`);if(g===void 0)return{as:"list",kind:N,label:u.label,...v(N),trail:[...c(N),{...u,current:!0}]};let M=a.graph.getNode(g),j=M&&M.kind===N?ge(r.tryDefinition(N),M):"Nothing lives here";return{as:"record",kind:N,id:g,label:j,...v(N),trail:[...c(N),u,s(j,_(r,N,g),!0)]}}let q=ei[w]??ai((x.at(-1)??g??w).replace(/[-_]+/g," "));return{as:"page",label:q,trail:[s(q,d,!0)]}}var ai=e=>e.charAt(0).toUpperCase()+e.slice(1),Gn=(0,St.createContext)(null);function ri(e){let t=me(),n=Ze("/");return Q(e.context.store),ni(e.context,`${t.pathname}${t.search}`,{registry:e.registry,base:n})}var oi={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},go={display:"flex",alignItems:"center",gap:6,minWidth:0},mo={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function ut({context:e,style:t}){let n=(0,St.useContext)(Gn),a=(0,St.useContext)(wt);return vt(a??si,"trail")||n?.registry?.without().has("trail")?null:(0,Te.jsx)(ii,{root:n??{context:e,registry:void 0},context:e,...t?{style:t}:{}})}function ii({root:e,context:t,style:n}){let a=ri(e);return a.trail.length<2?null:(0,Te.jsx)(li,{here:a,mark:a.as==="record"?{kind:a.kind,context:t}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var si={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function li({here:e,mark:t,style:n,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,Te.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Te.jsx)("ol",{style:{...we,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:e.trail.map((o,d)=>(0,Te.jsxs)("li",{style:o.current?oi:{...go,flexShrink:d===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[d>0&&!o.current?(0,Te.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,Te.jsxs)(O,{to:o.path,style:{...Se,...go},...d===r?{"data-testid":"trail-list"}:{},children:[d===r&&t?(0,Te.jsx)(ce,{kind:t.kind,brand:t.context.brand,schema:t.context.store.schema,size:8}):null,(0,Te.jsx)("span",{style:mo,children:o.label})]}):(0,Te.jsx)("span",{style:mo,children:o.label})]},`${d}:${o.label}`))})})}var A=H(B(),1);function $e(e){let t=e.views;if(!t)return[];let n=new Set(Fe(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}function Xt(e,t){if(!t.over)return[t.kind];let n=new Set(Fe(e.store,e.principal));return t.over.filter(a=>a===t.kind||n.has(a))}var et=e=>`place:${e.kind}:${e.as}`;function fe(e,t){return jt(t.as,Et(t,e.views?.places()??[])?U(e.store.schema,t.kind):void 0)}function kt(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>st(n,a))}function qn(e,t,n){let a=(o,d)=>Tt(e.schema,d,o),r=(typeof t=="string"?[t]:t).map(o=>a(kt(e,o).length,o)).join(" and ");return n?`${r} across ${a(kt(e,n).length,n)}`:r}function Un({context:e,place:t,chosen:n,filter:a}){let{store:r,views:o,invariantContext:d}=e,s=o?.resolve(t.kind,{cardinality:"many",fidelity:"full"},t.as)?.view,c=[...new Set(r.violations(d).flatMap(w=>w.nodeIds))],m=Xt(e,t).flatMap(w=>kt(r,w));if(!s)return null;let v=di(r,m,a,c);return(0,A.jsx)(Rn,{kind:t.kind,view:t.title,children:(0,A.jsx)(s,{nodes:v,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})}function di(e,t,n,a){let r=n?$t({filter:n}).filter??[]:[];return r.length===0?t:Wt(t,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function ci({store:e,views:t,as:n,invariantContext:a}){Q(e);let r={store:e,views:t,...a?{invariantContext:a}:{}},o=t.places().find(d=>d.as===n);return o?(0,A.jsx)(Un,{context:r,place:o}):null}function pi({context:e,kind:t}){let{store:n,views:a,invariantContext:r}=e,o=kt(n,t),d=n.schema.tryDefinition(t),l=Y(n,t),c=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,m=[...new Set(n.violations(r).flatMap(x=>x.nodeIds))];if(c&&!lt(c))return(0,A.jsx)(Rn,{kind:t,children:(0,A.jsx)(c,{nodes:o,label:l,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...m.length>0?{flagged:m}:{}})});let v=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,w=8,g=o.slice(0,w);return(0,A.jsxs)("div",{"data-testid":"kind-sheet",style:v?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[g.map(x=>v?(0,A.jsx)(v,{node:x,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...m.includes(x.id)?{flagged:[x.id]}:{}},x.id):(0,A.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:ge(d,x)},x.id)),o.length>w?(0,A.jsxs)("span",{style:{...C,alignSelf:"center",padding:"0 6px"},children:["+",o.length-w," more ",l.toLowerCase()]}):null]})}function Vn(e){let{store:t}=e,n=ao(e),a=$e(e),r=e.views?.arrangement?.()?.order??[],o=s=>{let c=s.name===void 0?-1:r.indexOf(`view:${s.name}`);return c>=0?c-r.length:n.indexOf(s.kind)},d=xn([...a].sort((s,c)=>o(s)-o(c))).filter(s=>!s.hidden),l=new Set(d.flatMap(s=>s.over??[s.kind]));return[...d.map(s=>({key:et(s),kind:s.kind,title:Ma(s,a,t.schema),to:fe(e,s),place:s})),...zt(e).filter(s=>!l.has(s)).map(s=>({key:`kind:${s}`,kind:s,title:Y(t,s),to:`/${U(t.schema,s)}`}))]}var fo=.72,ui=540,yo=16/10;function gi(e){let t=(0,We.useRef)(null),[n,a]=(0,We.useState)(e);return(0,We.useLayoutEffect)(()=>{let r=t.current;if(!r||typeof ResizeObserver>"u")return;let o=()=>{let l=r.getBoundingClientRect().width;l>0&&a(s=>Math.abs(s-l)<.5?s:l)};o();let d=new ResizeObserver(o);return d.observe(r),()=>d.disconnect()},[]),{ref:t,width:n}}function mi(e){for(let t=e.parentElement;t;t=t.parentElement)if(/(auto|scroll)/.test(getComputedStyle(t).overflowY))return t;return null}function fi(e){let[t,n]=(0,We.useState)(()=>typeof IntersectionObserver>"u");return(0,We.useLayoutEffect)(()=>{let a=e.current;if(t||!a)return;let r=new IntersectionObserver(o=>{o.some(d=>d.isIntersecting)&&(r.disconnect(),n(!0))},{root:mi(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[t,e]),t}function jn({context:e,entry:t}){let{store:n,brand:a,principal:r}=e,{ref:o,width:d}=gi(ui),l=fi(o),s=d/fo,c=kt(n,t.kind),m=n.schema.tryDefinition(t.kind),v=c.length===0?Xe(n,t.kind,{...r?{principal:r}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,w=t.place!==void 0;return(0,A.jsxs)(O,{to:t.to,"data-testid":w?"place-card":"kind-card",className:"graview-gallery-card",style:{...Se,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,A.jsxs)("span",{ref:o,"data-testid":w?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${yo}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,A.jsx)("span",{style:{position:"absolute",left:0,top:0,width:s,height:s/yo,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${fo})`,transformOrigin:"0 0"},children:l?(0,A.jsx)(Gt.Provider,{value:null,children:t.place?(0,A.jsx)(Un,{context:e,place:t.place}):(0,A.jsx)(pi,{context:e,kind:t.kind})}):null}),c.length===0?(0,A.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,A.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,A.jsxs)("span",{style:{fontFamily:In,fontWeight:"var(--graview-weight-display)"},children:["No ",Y(n,t.kind).toLowerCase()," yet"]}),v?(0,A.jsxs)("span",{style:C,children:["Begin with \u201C",v.label,"\u201D"]}):null]})}):null]}),(0,A.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,A.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[w?null:(0,A.jsx)(ce,{kind:t.kind,brand:a,schema:n.schema,size:8}),(0,A.jsx)("span",{style:{fontFamily:In,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:t.title})]}),(0,A.jsxs)("span",{style:C,children:[t.place?qn(n,Xt(e,t.place),t.place.across):qn(n,t.kind),!w&&m?.description?` \xB7 ${m.description}`:null]})]})]})}var ho={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},yi=`
|
|
2
|
+
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
3
|
+
.graview-gallery-card:hover > span:first-child,
|
|
4
|
+
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
5
|
+
`;function _n({context:e}){Q(e.store);let t=Vn(e);return t.length===0?null:(0,A.jsxs)("section",{style:ho,"data-testid":"gallery",children:[(0,A.jsx)("style",{children:yi}),t.map(n=>(0,A.jsx)(jn,{context:e,entry:n},n.key))]})}function zn({context:e}){let{store:t}=e;Q(t);let n=xn($e(e)).filter(r=>!r.hidden),a=Vn(e);return(0,A.jsxs)(te,{context:e,style:ct,children:[(0,A.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,A.jsx)("p",{style:we,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,A.jsx)(oe,{context:e,children:"Pictures"}),(0,A.jsx)("p",{style:re,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,A.jsx)("div",{style:ho,"data-testid":"places",children:a.map(r=>(0,A.jsx)(jn,{context:e,entry:r},r.key))}):null]})}var hi={lede:!0},wi={lede:!1},vi={...re,textWrap:"pretty"};function Si(e,t){if(t===void 0)return;let[n]=lr(sr([t]),dr(e.store,null,null,e.brand?{money:e.brand}:{}));return n?.t==="headline"&&!n.problem&&n.text.trim()!==""?n.text:void 0}function Yn({context:e}){let{store:t,principal:n}=e;Q(t);let a=Ue(),r=De(),[o]=pt(),d=decodeURIComponent(a.as??""),[l,s]=(0,We.useState)(null),c=o.get("of"),m=o.get("filter"),w=$e(e).find(P=>P.as===d&&(!c||U(t.schema,P.kind)===c));if(!w)return(0,A.jsxs)(te,{context:e,children:[(0,A.jsx)(oe,{context:e,children:"No picture is called that."}),(0,A.jsx)("p",{style:re,children:(0,A.jsx)(O,{to:"/places",style:qe,children:(0,A.jsx)(Qe,{children:"The pictures there are"})})})]});let g=Y(t,w.kind),x=e.views?.resolve(w.kind,{cardinality:"many",fidelity:"full"},w.as)?.view,N=x?.flows===!0,q=x?.creates!==!1,u=Si(e,x?.lede),M=Xe(t,w.kind,{...n?{principal:n}:{},...e.invariantContext?{context:e.invariantContext}:{}}),j=q?M.actions.affordances.map(P=>({affordance:P,mutation:t.allMutations().find(D=>D.name===P.mutation)})).filter(P=>P.mutation!==void 0):[];return(0,A.jsxs)(te,{context:e,style:{...ct,gap:"var(--graview-space-6, 32px)"},children:[(0,A.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,A.jsx)(ut,{context:e}),(0,A.jsx)(oe,{context:e,children:w.title}),(0,A.jsx)("p",{style:vi,"data-testid":"place-lede",...u!==void 0?{"data-graview-lede":"headline"}:{},children:u??`${qn(t,Xt(e,w),w.across)}.`}),m&&!N?(0,A.jsxs)("p",{style:{...C,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${m.split(",").map(P=>P.replace(":"," is ")).join(" and ")}. `,(0,A.jsx)(O,{to:`?${(()=>{let P=new URLSearchParams(o);return P.delete("filter"),P.toString()})()}`,style:{...G,...C},children:"Show all"})]}):null,(0,A.jsx)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:Xt(e,w).map((P,D)=>(0,A.jsx)(O,{to:`/${U(t.schema,P)}`,style:{...qe,...C},...D===0?{"data-testid":"place-as-list"}:{},children:(0,A.jsxs)(Qe,{children:["All ",(P===w.kind?g:Y(t,P)).toLowerCase()," as a list"]})},P))})]}),(0,A.jsx)("div",{"data-testid":"place-lens","data-flows":N?"":void 0,...N?{}:{role:"group","aria-label":w.title,tabIndex:0},style:N?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:P=>{let D=P.target?.closest("[data-graview-pick]"),ae=D?.getAttribute("data-graview-pick"),ie=D?.getAttribute("data-graview-joins");if(ie)try{let J=JSON.parse(ie);if(Array.isArray(J)&&J.every(ue=>typeof ue=="string")){P.preventDefault(),s({at:et(w),ids:J});return}}catch{}if(!ae)return;let he=t.graph.getNode(ae);he&&(P.preventDefault(),r(_(t.schema,he.kind,ae)))},children:(0,A.jsx)(Br.Provider,{value:u!==void 0?hi:wi,children:(0,A.jsx)(Un,{context:e,place:w,filter:m,...l?.at===et(w)?{chosen:l.ids}:{}})})}),j.length>0?(0,A.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:j.map(({affordance:P,mutation:D})=>(0,A.jsxs)("section",{style:{...ee,display:"grid",gap:14},children:[(0,A.jsx)("h2",{style:X,children:D.title??D.name}),D.description?(0,A.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:D.description}):null,(0,A.jsx)(Ie,{store:t,mutation:D,prefilled:P.args,open:P.open,label:P.label,...n?{principal:n}:{}})]},P.id))}):null]})}function ki(e,t=document){let n=Ut(e);if(!n)return null;let a=[t,...[...t.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let o of r.querySelectorAll("[id], [data-section]")){let d=o.getAttribute("data-section")??o.id;if(d===e||Ut(d)===n)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(Ut(o.textContent??"")===n)return o;return null}function wo(e,t={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=t.frames??120,a=0,r=()=>{let o=ki(e,t.root??document);if(o){o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.scrollIntoView?.({block:"start"}),o.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var K=H(He(),1);var Jt=H(He(),1);var tt=H(B(),1);function vo({context:e}){return de()?(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(bi,{context:e}),(0,tt.jsx)(Vr,{face:"pages",on:e.quickAsk??!0})]}):null}function bi({context:e}){let{store:t}=e,n=de(),{pathname:a}=me(),r=(0,Jt.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,Jt.useEffect)(()=>{let o=r.current;if(!o)return;let[,d,l]=a.split("/"),s=(()=>{if(d==="places"){let m=e.views?.places().find(v=>v.as===decodeURIComponent(l??""));return m?[Ne(m.kind)]:[]}let c=d?ve(t.schema,d):void 0;return c&&l?[decodeURIComponent(l)]:c?[Na(c)]:[]})();o(c=>c.length===s.length&&c.every((m,v)=>m===s[v])?c:s)},[a]),null}var be=H(He(),1);var ko=H(Xo(),1);var pe=H(B(),1);var xi=Nt(Oa(()=>(__graviewPreload(import.meta.url,["./chunk.BJR6E2CT.js","./chunk.VSWEKNKS.js","./chunk.UGFDSE37.js","./chunk.SGJSJGSR.js","./chunk.2OXXGN7C.js","./chunk.Q4KNNJFL.js","./chunk.BH365UJ5.js","./chunk.6EHE26ZS.js","./chunk.N2S3TMBC.js","./chunk.7JW5SHRR.js","./chunk.4SEY7VWZ.js","./chunk.IVHPJUFM.js","./chunk.D53IGR45.js","./chunk.MJ4XTNTL.js","./chunk.AP22NNIM.js","./chunk.SPZVEQC5.js","./chunk.FNK2ZZ5E.js","./chunk.RSR2M7ZO.js","./chunk.EM5CGFNB.js","./chunk.N2S45SSL.js","./chunk.AGVFW6WC.js","./chunk.SIVMZNHZ.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.NQDGUIUQ.js","./chunk.DTRNDSMS.js","./chunk.3EW6L5DY.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.GZHZLJBF.js","./chunk.FOYVTN5B.js","./chunk.OJGHDWI6.js","./chunk.OTF3NNTI.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.IQHVVQEA.js")).then(e=>({default:e.TakeBack}))));function Pi({context:e,docked:t,at:n,...a}){let{store:r}=e,o=Q(r),[d]=(0,be.useState)(()=>r.batches().length),l=(0,be.useRef)(!1);return l.current||=o>0||!t&&d>0,l.current?(0,pe.jsx)(be.Suspense,{fallback:null,children:(0,pe.jsx)(xi,{context:e,docked:t,at:n,since:d,...a})}):null}function Ci(e,t,n){let{store:a,principal:r,embedded:o}=e;(0,be.useEffect)(()=>{if(!n)return;let d=l=>{if(!Xr(l))return;let s=l.target,c=s instanceof Node&&t.current?.contains(s),m=s===document.body||s===document.documentElement||s===document;if(!(!c&&!(m&&!o))&&Qr(a,r)){l.preventDefault();try{Zr(a,r)}catch{}}};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[a,r,o,t,n])}function bo({context:e,registry:t,root:n,children:a}){let r=(0,be.useMemo)(lo,[]),o=t?.without()??new Set;return Ci(e,n,!o.has("undo")),(0,pe.jsxs)(wt.Provider,{value:r,children:[(0,pe.jsx)(Ai,{context:e,placed:r,without:o}),a]})}function Ai({context:e,placed:t,without:n}){let[a,r]=(0,be.useState)(!1);(0,be.useLayoutEffect)(()=>r(!0),[]);let o=vt(t,"find"),d=vt(t,"undo"),l=me(),s=kr();if(!a)return null;let c=l.pathname.split("/").filter(Boolean),v=(c.length===1?ve(e.store.schema,c[0]):void 0)!==void 0;return(0,pe.jsxs)(pe.Fragment,{children:[!o&&!n.has("find")&&s?(0,ko.createPortal)((0,pe.jsx)(So,{context:e,narrowsLists:v}),s.slot):null,!o&&!n.has("find")&&!s?(0,pe.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,pe.jsx)(So,{context:e,narrowsLists:v})}):null,!d&&!n.has("undo")?(0,pe.jsx)(Pi,{context:e,docked:!0,at:l.pathname+l.search}):null,s?.own&&!n.has("undo")?(0,pe.jsx)(ro,{context:e,own:s.own}):null]})}function So({context:e,narrowsLists:t}){return(0,pe.jsx)(wt.Provider,{value:null,children:(0,pe.jsx)(Bn,{context:e,narrowsLists:t})})}var Z=H(He(),1);var xe=H(B(),1),Ri=500,Li=10;function en(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Ti(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function xo(e){let t=e.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(t)return t;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Po({context:e,root:t,children:n}){return de()===null?(0,xe.jsx)(xe.Fragment,{children:n}):(0,xe.jsx)(Mi,{context:e,root:t,children:n})}function Mi({context:e,root:t,children:n}){let{setMenuAt:a}=Ka(),{store:r}=e,o=r.schema,d=De(),{pathname:l,search:s}=me(),c=Ze("/").replace(/\/$/,""),m=(0,Z.useCallback)((S,f)=>e.views?.places().find(R=>R.as===S&&(f===null||R.kind===f)),[e.views]),v=(0,Z.useCallback)((S,f)=>{let[R="",E,ne]=S.split("/").filter(Boolean).map(p=>{try{return decodeURIComponent(p)}catch{return p}});if(ne!==void 0)return null;if(R==="places"&&E!==void 0){let p=m(E,new URLSearchParams(f).get("of"));return p?{face:"pages",place:p.as,about:[Ne(p.kind)],title:p.title}:null}let z=ve(o,R);return z?E===void 0?{face:"pages",about:[Ne(z)],title:Ge(o,z)}:r.graph.getNode(E)?{face:"pages",on:E,about:[E]}:null:null},[o,r,m]),w=(0,Z.useCallback)(S=>{let f=S.href;try{let R=new URL(f,location.href);if(R.origin===location.origin&&(c===""||R.pathname===c||R.pathname.startsWith(`${c}/`))){let E=v(R.pathname.slice(c.length),R.search);if(E)return{...E,href:f}}}catch{}return{face:"pages",about:[],href:f}},[c,v]),g=(0,Z.useCallback)(()=>v(l,s)??{face:"pages",about:[]},[v,l,s]),x=(0,Z.useCallback)(S=>{let f=g(),R=S.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(R&&f.on!==void 0&&S.closest("[data-graview-pick], a[href]")===null)return{...f,field:R};let E=S.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(E)return{...f,act:E};let ne=S.closest("a[href]"),z=S.closest("[data-graview-listed]"),p=[S.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),z&&(!ne||z.contains(ne)&&ne.classList.contains("graview-spec-item-link"))?z.getAttribute("data-graview-listed"):null].map(V=>V?r.graph.getNode(V):void 0).find(Boolean);if(p)return{face:"pages",on:p.id,about:[p.id],href:`${c}${_(o,p.kind,p.id)}`};if(ne)return w(ne);let L=S.closest("[data-graview-record]")?.getAttribute("data-graview-record");return L&&r.graph.getNode(L)?{face:"pages",on:L,about:[L]}:f},[g,w,r,o,c]),N=(0,Z.useCallback)(S=>{let f=t.current;if(f===null||!f.contains(S)||en(S)||S.closest("[data-graview-popover]"))return null;let R=x(S);return{face:"pages",on:R.on,about:R.about??[],field:R.field,place:R.place,href:R.href,act:R.act,element:xo(S)}},[x,t]),q=(0,Z.useCallback)((S,f,R)=>{let E=x(S);a({...E,x:Math.round(f),y:Math.round(R),returnTo:xo(S)})},[x,a]),u=(0,Z.useCallback)(S=>{let f=S.getBoundingClientRect();q(S,f.left+Math.min(16,f.width/2),Math.min(f.bottom,f.top+36))},[q]),M=(0,Z.useRef)(0),j=(0,Z.useRef)(null),P=(0,Z.useRef)(!1),D=()=>{j.current&&clearTimeout(j.current.timer),j.current=null};(0,Z.useEffect)(()=>D,[]),(0,Z.useEffect)(()=>{let S=f=>{if(f.defaultPrevented||!(f.key==="ContextMenu"||f.key==="F10"&&f.shiftKey))return;let R=t.current,E=f.target instanceof Element?f.target:null,ne=E===null||E===document.body||E===document.documentElement,z=R!==null&&E!==null&&R.contains(E);if(!z&&!(ne&&document.querySelector("[data-graview-face='pages']")===R)||en(E)||E?.closest("[data-graview-popover]"))return;f.preventDefault(),M.current=Date.now();let p=z&&E instanceof HTMLElement?E:R?.querySelector("[data-graview-page-title], main h1, main")??null;p&&u(p)};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[t,u]),(0,Z.useEffect)(()=>{let S=t.current;if(!S)return;let f=R=>{let E=R.detail;E&&a({...E,face:"pages"})};return S.addEventListener(Cn,f),()=>S.removeEventListener(Cn,f)},[t,a]);let ae=(0,Z.useMemo)(()=>S=>{if(S.face!=="pages")return null;let f=[],R=S.on===void 0?void 0:r.graph.getNode(S.on),E=S.place===void 0?void 0:e.views?.places().find(se=>se.as===S.place),ne=R?void 0:S.about.length===1&&S.about[0].startsWith("aggregate:")&&!E?Ei(S.about[0]):void 0,z=R?_(o,R.kind,R.id):E?fe(e,E):ne?`/${U(o,ne)}`:void 0,p=z!==void 0&&l===z.split("?")[0];z!==void 0&&!p&&f.push({id:"open",label:"Open",run:()=>d(z)});let L=z!==void 0?`${c}${z}`:S.href;L!==void 0&&f.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(L,"_blank","noopener")});let V=R?`#focus=${encodeURIComponent(R.id)}`:E?`#focus=${encodeURIComponent(Ne(E.kind))}&view=${encodeURIComponent(E.as)}`:ne?`#focus=${encodeURIComponent(Ne(ne))}`:void 0;if(V!==void 0&&(e.overview||!e.embedded)){let se=e.overview;f.push({id:"in-the-scene",label:"Show in the scene",run:()=>se?se(V):location.assign(`${e.sceneHref??"/"}${V}`)})}return R===void 0&&S.href===void 0&&f.push({id:"find",label:"Find\u2026",run:()=>{let se=t.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');se&&se.offsetParent!==null?se.focus():d("/search")}}),f.length>0?{id:"pages",items:f}:null},[r,o,e,l,c,d,t]),ie=(0,Z.useMemo)(()=>S=>{if(S.face!=="pages"||S.field===void 0||S.on===void 0)return null;let f=r.graph.getNode(S.on),R=S.element?.closest("[data-graview-field]")??t.current?.querySelector(`[data-graview-field="${CSS.escape(S.field)}"]`);return!f||!(R instanceof HTMLElement)||!R.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${va(o.tryDefinition(f.kind),S.field)}\u201D`,run:()=>R.click()}]}},[r,o,t]),he=_r(),J=mr(),ue=Or(),Ke=(0,Z.useCallback)((S,f)=>{l===fe(e,S).split("?")[0]&&d(f?fe(e,f):"/")},[l,e,d]),Pe=Yr(Ke),Ce=(0,Z.useMemo)(()=>[ie,ue,ae,...Pe?[Pe]:[],...J?[J]:[],...he?[he]:[]],[ie,ue,ae,Pe,J,he]);return(0,xe.jsxs)(cr,{sections:Ce,children:[(0,xe.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:S=>{let f=S.target;S.shiftKey||en(f)||Ti(f)||(S.preventDefault(),!f.closest("[data-graview-popover]")&&(Date.now()-M.current<700||(S.clientX===0&&S.clientY===0&&f instanceof HTMLElement?u(f):q(f,S.clientX,S.clientY))))},onPointerDown:S=>{if(P.current=!1,S.pointerType==="mouse"||!S.isPrimary)return;let f=S.target;if(en(f)||f.closest("[data-graview-choose], [data-graview-popover]"))return;D();let{clientX:R,clientY:E}=S;j.current={x:R,y:E,timer:setTimeout(()=>{j.current=null,P.current=!0,M.current=Date.now(),q(f,R,E)},Ri)}},onPointerMove:S=>{let f=j.current;f&&Math.hypot(S.clientX-f.x,S.clientY-f.y)>Li&&D()},onPointerUp:D,onPointerCancel:D,onClickCapture:S=>{P.current&&(P.current=!1,S.preventDefault(),S.stopPropagation())},children:n}),(0,xe.jsx)($i,{openAt:u,readyAt:N}),(0,xe.jsx)(zr,{placement:"page"}),(0,xe.jsx)(fr,{})]})}function Ei(e){let t=e.slice(10).split("+");return t.length===1&&t[0]?t[0]:void 0}function $i({openAt:e,readyAt:t}){return(0,xe.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,xe.jsx)(Ur,{placement:"menu",openActs:e,aimAt:t})})}var F=H(B(),1);function Co(e,t){return t==="*"?{label:"anything",path:null}:{label:Y(e,t),path:`/${U(e.schema,t)}`}}function Oi({context:e,relation:t}){let{store:n}=e,a=Co(n,t.from),r=Co(n,t.to),o=d=>d.path?(0,F.jsx)(O,{to:d.path,style:{...Se,fontWeight:550},children:d.label}):(0,F.jsx)("span",{children:d.label});return(0,F.jsxs)("li",{"data-testid":"relation","data-relation":t.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,F.jsx)(jr,{edgeKind:t.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,F.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,F.jsxs)("span",{children:[o(a)," ",(0,F.jsxs)("span",{style:C,"data-graview-speaks-ids":"",children:[ze(t.edgeKind)," \u2192"]})," ",o(r)]}),t.description||t.inverse?(0,F.jsxs)("span",{style:C,children:[t.description?Re(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),r.path?(0,F.jsx)(O,{to:`${r.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{...G,...C,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:t.count}):(0,F.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function Ao({context:e,heading:t=!0}){let{store:n}=e,a=new Set(Fe(n,e.principal)),r=Je(n).relations.filter(o=>a.has(o.from)&&(o.to==="*"||a.has(o.to)));return r.length===0?null:(0,F.jsxs)("section",{style:{...ee,display:"grid",gap:12},"data-testid":"kind-map",children:[t?(0,F.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,F.jsx)("h2",{style:X,children:(0,F.jsx)(O,{to:"/map",style:Se,children:"Connections"})}),(0,F.jsx)("span",{style:C,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,F.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(o=>(0,F.jsx)(Oi,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function Qn({context:e}){let{store:t}=e;Q(t);let n=new Set(Fe(t,e.principal)),a=Je(t),r=a.relations.filter(o=>n.has(o.from));return(0,F.jsxs)(te,{context:e,children:[(0,F.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,F.jsx)("p",{style:we,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,F.jsx)(oe,{context:e,children:"Connections"}),(0,F.jsx)("p",{style:re,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,F.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(o=>n.has(o.kind)).map(o=>(0,F.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,F.jsx)(ce,{kind:o.kind,brand:e.brand,schema:t.schema,size:7}),(0,F.jsx)(O,{to:`/${U(t.schema,o.kind)}`,style:G,children:o.plural}),(0,F.jsx)("span",{style:C,children:o.count})]},o.kind))}),(0,F.jsx)(Ao,{context:e,heading:!1})]})}function Ro({context:e}){let n=[...de()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=e;return(0,F.jsxs)("section",{style:{...ee,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,F.jsx)("h2",{style:X,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,F.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let o=r.at?a.graph.getNode(r.at):void 0;return(0,F.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,F.jsx)("span",{children:r.say}),o?(0,F.jsxs)(O,{to:_(a.schema,o.kind,o.id),style:{...G,...C},children:[ge(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}var W=H(B(),1);function Zn({context:e}){let{principal:t}=e,{store:n,brand:a,invariantContext:r}=e;Q(n);let o=n.violations(r),d=`${o.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,l=[...n.log.all()].slice(-5).reverse(),c=zt(e).map(u=>({kind:u,members:n.graph.nodesOfKind(u).filter(M=>st(n.schema.tryDefinition(u),M))})),m=c.filter(u=>u.members.length>0),v=c.map(u=>({entry:u,creator:n.allMutations().find(M=>(M.creates??[]).includes(u.kind)&&n.permits({name:M.name,args:{}},e.principal).ok)})).find(u=>u.creator!==void 0),w=m.length===0?"Nothing here yet.":`${m.map(u=>Tt(n.schema,u.kind,u.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,g=e.views?.homeView?.(),x=n.schema.kinds.some(u=>n.graph.nodesOfKind(u).length>0);if(g&&x){let u=a?.subtitle&&a.subtitleDrawn!==!1?(0,W.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,M=g[Symbol.for("graview.home-blocks")]===!0;return(0,W.jsx)(te,{context:e,style:ct,children:(0,W.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[M?null:u,o.length>0?(0,W.jsx)(O,{to:"/problems",style:{...G,color:"var(--graview-warn)"},children:d}):null,(0,W.jsx)(Kr.Provider,{value:M?u:null,children:(0,W.jsx)(Zt,{when:Ot(g),children:(0,W.jsx)(g,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})})]})})}let N=new Set(Fe(n,e.principal)),q=Je(n).relations.filter(u=>N.has(u.from)&&(u.to==="*"||N.has(u.to)));return(0,W.jsxs)(te,{context:e,style:ct,children:[(0,W.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,W.jsx)("p",{style:{...C,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,W.jsx)(oe,{context:e,"data-testid":"standing",children:w}),(0,W.jsxs)("p",{style:{...re,display:"grid",gap:4},"data-testid":"standing-card",children:[m.length===0&&v?(0,W.jsxs)("span",{children:["Begin with \u201C",v.creator?.title??v.creator?.name,"\u201D, under"," ",(0,W.jsx)(O,{to:`/${U(n.schema,v.entry.kind)}`,style:G,children:Y(n,v.entry.kind)}),"."]}):null,o.length===0?(0,W.jsx)("span",{children:"All rules hold."}):(0,W.jsx)(O,{to:"/problems",style:{...G,color:"var(--graview-warn)"},children:d})]})]}),(0,W.jsx)(_n,{context:e}),(0,W.jsxs)("section",{style:{...ee,display:"grid",gap:14},"data-testid":"kinds",children:[(0,W.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,W.jsx)("h2",{style:X,children:"What is here"}),q.length>0?(0,W.jsx)(O,{to:"/map",style:{...qe,...C,marginLeft:"auto"},"data-testid":"map-link",children:(0,W.jsxs)(Qe,{children:["Connections \xB7 ",q.length===1?"1 relation":`${q.length} relations`]})}):null]}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:u,members:M})=>(0,W.jsx)("li",{style:{maxWidth:"100%"},children:(0,W.jsxs)(O,{to:`/${U(n.schema,u)}`,style:{...Se,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,W.jsx)(ce,{kind:u,brand:a,schema:n.schema,size:7}),(0,W.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:Y(n,u)}),(0,W.jsx)("span",{style:{...C,fontVariantNumeric:"tabular-nums"},children:M.length===0?"none yet":ft(M.length)})]})},u))})]}),l.length>0?(0,W.jsxs)("section",{style:{...ee,display:"grid",gap:10},children:[(0,W.jsx)("h2",{style:X,children:"Recently"}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(u=>(0,W.jsxs)("li",{style:C,children:[(0,W.jsx)("span",{style:{color:"var(--graview-ink)"},children:u.intent})," \u2014 ",ht(u,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},u.id))})]}):null]})}var Me=H(He(),1);var nt=H(B(),1);function tn({context:e,withheld:t,style:n,testId:a}){let r=de(),o=La(t,e.signIn??r?.signIn);return o?(0,nt.jsx)("p",{style:{...n,margin:0},children:(0,nt.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:ke,children:o.label})}):t.length===0?null:(0,nt.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:t.map(d=>(0,nt.jsxs)("li",{style:C,children:[(0,nt.jsx)("s",{children:d.label})," \u2014 ",d.refusal.message]},d.id))})}var T=H(B(),1);function Xn({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;Q(t);let[o]=pt(),d=o.get("q")??"",l=typeof r?.today=="string"?r.today:void 0,s=Lr(t,d,{...a?{principal:a}:{},places:$e(e),flagged:new Set(t.violations(r).flatMap(g=>g.nodeIds)),...l?{today:l}:{},limit:200}),c=s.hits.filter(g=>g.about==="node"),m=s.hits.filter(g=>g.about==="kind"||g.about==="place"||g.about==="rule"),v=[...new Set(c.map(g=>g.kind))],w=d.trim();return(0,T.jsxs)(te,{context:e,children:[(0,T.jsx)("style",{children:_t}),(0,T.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,T.jsx)("p",{style:we,children:"Search"}),(0,T.jsx)(oe,{context:e,"data-testid":"search-heading",children:w.length===0?"Find anything by its name":s.hits.length===0?(0,T.jsxs)(T.Fragment,{children:["Nothing here is called \u201C",w,"\u201D."]}):(0,T.jsxs)(T.Fragment,{children:[Ni(t,s.byKind)," for \u201C",w,"\u201D"]})}),w.length>0?(0,T.jsxs)("p",{style:{...C,margin:0},"data-testid":"search-searched",children:[Dt(t.schema,s.searched),s.conditions.filter(g=>g.key!=="is"&&g.admittedBy.length<s.searched.kinds.length).map(g=>(0,T.jsxs)("span",{children:[" ",g.key,":",g.value," narrows"," ",g.admittedBy.length===0?"nothing here":g.admittedBy.map(x=>Y(t,x).toLowerCase()).join(" and "),"."]},`${g.key}:${g.value}`))]}):(0,T.jsxs)("p",{style:re,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,T.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,T.jsx)("code",{children:"is:any"})," includes what is past."]})]}),m.length>0?(0,T.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:m.map(g=>(0,T.jsx)("li",{"data-testid":"search-hit","data-about":g.about,children:g.about==="kind"?(0,T.jsxs)(O,{to:`/${U(t.schema,g.kind)}`,style:G,children:[g.label,g.count>0?(0,T.jsxs)("span",{style:C,children:[" \xB7 ",g.count," match"]}):null]}):g.about==="place"?(0,T.jsxs)(O,{to:fe(e,g),style:G,children:["Go to ",g.title]}):g.about==="rule"?(0,T.jsxs)(O,{to:"/problems",style:G,children:["The rule \u201C",g.label,"\u201D"]}):null},`${g.about}:${g.about==="rule"?g.name:g.about==="place"?g.as:g.kind}`))}):null,v.map(g=>(0,T.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":g,children:[(0,T.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,T.jsx)(ce,{kind:g,brand:n,schema:t.schema,size:8}),(0,T.jsx)(O,{to:`/${U(t.schema,g)}?${new URLSearchParams({q:w}).toString()}`,style:G,"data-testid":"search-kind-link",children:Y(t,g)}),(0,T.jsx)("span",{children:s.byKind[g]})]}),(0,T.jsx)("ul",{className:"graview-rows",children:c.filter(x=>x.kind===g).map(x=>(0,T.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,T.jsxs)(O,{to:_(t.schema,g,x.id),className:"graview-row-title",...x.label.length>60?{title:x.label}:{},children:[x.flagged?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,x.label]}),x.apart||!x.current?(0,T.jsx)("span",{className:"graview-row-glance",children:[x.apart,x.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,T.jsx)(nn,{why:x.why})]},x.id))})]},g)),w.length>0?(0,T.jsx)(Hi,{asked:w}):null,w.length>0&&s.hits.length===0?(0,T.jsx)(To,{store:t,kinds:s.searched.kinds,words:s.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}function nn({why:e}){return e.strength==="near"?(0,T.jsxs)("span",{style:C,"data-testid":"search-why","data-near":"",children:["Near \u201C",e.asked,"\u201D",e.field==="label"?"":` \u2014 ${e.reading}: ${e.fragment}`]}):e.field==="label"?null:(0,T.jsxs)("span",{style:C,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function Ni(e,t){let n=Object.entries(t).map(([a,r])=>`${r} ${r===1?Ye(e.schema.tryDefinition(a),a):Y(e,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Re(n[0]):Re(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function Lo(e,t,n={}){let a=[];for(let r of t){let o=Xe(e,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let d of an(e,r,o.actions.affordances))a.some(l=>l.mutation.name===d.mutation.name)||a.push(d)}return a}function an(e,t,n){let a=e.schema.tryDefinition(t)?.fieldRoles?.label,r=[];for(let o of n){let d=e.allMutations().find(c=>c.name===o.mutation);if(!d||!d.creates?.includes(t)||r.some(c=>c.mutation.name===d.name))continue;let l=yr(d.input).map(c=>c.name),s=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!s||o.args[s]!==void 0||r.push({kind:t,affordance:o,mutation:d,arg:s})}return r}function To({store:e,kinds:t,words:n,principal:a,invariantContext:r}){let o=Lo(e,t,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||n.trim().length===0?null:(0,T.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:d,affordance:l,mutation:s,arg:c})=>(0,T.jsxs)("section",{style:{...ee,display:"grid",gap:14},children:[(0,T.jsxs)("h2",{style:X,children:[Re(Sa(Ye(e.schema.tryDefinition(d),d)))," called \u201C",n,"\u201D"]}),(0,T.jsx)(Ie,{store:e,mutation:s,prefilled:l.args,open:l.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function Hi({asked:e}){let t=de();return t?(0,T.jsx)(Ii,{asked:e,desk:t.aiDesk}):null}function Ii({asked:e,desk:t}){return _a(t)?(0,T.jsx)("p",{style:{margin:0},children:(0,T.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>ja(t,{pointed:{about:[]},asked:e,returnTo:a.currentTarget}),style:{...G,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})}):null}var h=H(B(),1),Eo=8,$o=40;function Fi(e,t){let n=t?.fields?.shape??{},a=Object.keys(n).find(r=>ba(n[r])&&ka(e[r]));return a===void 0?void 0:e[a]}function Jn({context:e}){let t=Ue(),n=ve(e.store.schema,t.slug??"");return n?(0,h.jsx)(Oo,{context:e,kind:n}):(0,h.jsx)(te,{context:e,children:(0,h.jsx)(oe,{context:e,children:"No such kind of thing here."})})}function Oo({context:e,kind:t,opening:n,row:a,layout:r="list",description:o,bare:d}){let{store:l,brand:s,invariantContext:c}=e;Q(l);let[m,v]=pt(),w=`list-${(0,Me.useId)().replace(/:/g,"")}`,g=l.schema.tryDefinition(t),x=Pa(m.get("archived")),N=l.graph.nodesOfKind(t,{archived:x}),q=Je(l).relations.filter(i=>i.from===t||i.to===t),u=new Set(l.violations(c).flatMap(i=>i.nodeIds)),M=Cr(l.schema,Pr(l.schema,xr(l.schema,t))),j=q.map(i=>i.edgeKind),P=qi(m,M,j),D=["sort","filter","group","q","by","with","past","archived",...j].some(i=>m.has(i)),ae=N.length>=$o,ie=g?.fieldRoles?.when,he=e.views?.arrangement?.()?.lists?.[t],J=wr(he),ue=hr(he?.group),Ke=Gi(ae,ie),Pe=n??(J?{...Ke,...J}:Ke),Ce=D?P.arrangement:$n(Pe,M).arrangement,S=J?.sort,f=Ce.sort&&S?.then&&Ce.sort.by===S.by&&Ce.sort.direction===S.direction?{...Ce,sort:S}:Ce,R=Ar(f.query??""),E=[...f.filter??[],...R.conditions].some(i=>i.key==="is"&&(i.value==="past"||i.value==="any"))||br(g,[...f.filter??[],...R.conditions]),ne=E||!g?.lifecycle?f:{...f,filter:[...f.filter??[],{key:"is",value:"current"}]},z=new Map,p=Wt(N,ne,{schema:l.schema,graph:l.graph,flagged:u,...typeof c?.today=="string"?{today:c.today}:{},read:(i,y)=>{let $=z.get(i.id);return $||z.set(i.id,$=yt(l.schema,l.graph,i)),$[y]}}),L=ue&&f.group?.by===ue.by&&!f.group.bucket?M.groups.find(i=>i.key===ue.by):void 0,V=ue&&L&&(L.type==="choice"||L.type==="boolean")?vr(p.groups,ue,{type:L.type,...L.options?{options:L.options}:{}}):p.groups.map(i=>({...i,closed:!1})),se=new Set((m.get("open")??"").split(",").filter(Boolean)),Ko=!!f.query||(f.filter??[]).some(i=>i.key===ue?.by),aa=i=>L?.type==="boolean"?i==="1"?"true":"false":i,ra=i=>i.closed&&!Ko&&!se.has(aa(i.key)),Bo=i=>{let y=new URLSearchParams(m),$=new Set(se);$.has(i)?$.delete(i):$.add(i),$.size>0?y.set("open",[...$].join(",")):y.delete("open"),v(y,{replace:!0})},Ae=p.nodes,rt=g?.lifecycle&&!E?N.filter(i=>st(g,i)):N,oa=N.length-rt.length,sn=f.group?.by??null,Go=i=>{let y=new URLSearchParams(m);for(let le of["sort","filter","group","q","by","with","past","archived",...q.map(Rt=>Rt.edgeKind)])y.delete(le);let $=Tr(i);for(let le of["sort","filter","group","q","archived"])$[le]&&y.set(le,$[le]);![...y.keys()].some(le=>["sort","filter","group","q"].includes(le))&&(n||J||ae||ie)&&y.set("sort",""),v(y)},{principal:ot}=e,ln=Xe(l,t,{...ot?{principal:ot}:{},...e.invariantContext?{context:e.invariantContext}:{}}),Be=ln.actions.affordances.map(i=>({affordance:i,mutation:l.allMutations().find(y=>y.name===i.mutation)})).filter(i=>i.mutation!==void 0),qo=ln.actions.withheld,dn=()=>new Set(Ae.length===0?Be.map(({mutation:i})=>i.name):[]),[cn,ia]=(0,Me.useState)(()=>({kind:t,open:dn()}));cn.kind!==t&&ia({kind:t,open:dn()});let sa=i=>(cn.kind===t?cn.open:dn()).has(i),la=(i,y)=>ia($=>{let le=new Set($.open);return y?le.add(i):le.delete(i),{kind:$.kind,open:le}}),da=`begin-${(0,Me.useId)().replace(/:/g,"")}`,ca=R.words&&Ae.length===0?Object.fromEntries(an(l,t,ln.actions.affordances).map(i=>[i.mutation.name,i.arg])):{},je=Y(l,t),xt=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),pn=xt!==void 0&&!lt(xt)?xt:void 0,un=(f.group?.bucket??"day")==="day"?f.group?.by:void 0,gn=(f.filter??[]).map(i=>i.key),Uo=gn.filter(i=>gn.indexOf(i)===gn.lastIndexOf(i)&&/choice|boolean/.test(M.filters.find(y=>y.key===i)?.type??"")),mn=i=>{let y={...g?.computed?yt(l.schema,l.graph,i):i};un&&!String(y[un]).includes("T")&&delete y[un];for(let $ of Uo)delete y[$];return y},pa=i=>rr(g?.fields?.shape?.[i])?.type==="enum",Pt=i=>{let y=ge(g,i);if(a)return(0,h.jsxs)("li",{"data-testid":"record-row","data-graview-record":i.id,style:{minWidth:0},...Sn(i.id),children:[vn(i,y),a(i,{label:y,href:_(l.schema,t,i.id),flagged:u.has(i.id),glance:no(mn(i),g,y)})]},i.id);if(pn){let kn=qt(xt,i,l.graph),Qo=Object.fromEntries(Object.entries(mn(i)).filter(([Zo])=>!kn?.fields.has(Zo))),ha=kn?Fn(Qo,g,kn.title??y,pa):[];return(0,h.jsxs)("li",{"data-testid":"record-row","data-graview-record":i.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...Sn(i.id),children:[vn(i,y),(0,h.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,h.jsx)(pn,{node:i,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...u.has(i.id)?{flagged:[i.id]}:{}})}),ha.length>0?(0,h.jsx)("span",{style:{...C,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,h.jsx)(Dn,{runs:ha})}):null,(0,h.jsx)(ji,{to:_(l.schema,t,i.id),label:u.has(i.id)?`${y} \u2014 implicated in a problem`:y})]},i.id)}let $=Fn(mn(i),g,y,pa),le=$.length>0,Rt=R.words?Rr(g,i,R.words):void 0,fa=ae?void 0:ir(i,g),Lt=Fi(i,g),ya=(0,h.jsxs)(O,{to:_(l.schema,t,i.id),className:"graview-row-title",...y.length>60?{title:y}:{},children:[u.has(i.id)?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,y]});return(0,h.jsxs)("li",{className:"graview-row","data-graview-record":i.id,...Sn(i.id),children:[vn(i,y),fa?(0,h.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,h.jsx)(dt,{as:"thumb",file:fa}),ya]}):ya,le||Lt?(0,h.jsxs)("span",{className:"graview-row-glance",children:[(0,h.jsx)(Dn,{runs:$}),le&&Lt?" \xB7 ":null,Lt?(0,h.jsx)(Kt,{address:Lt}):null]}):null,Rt?(0,h.jsx)(nn,{why:Rt}):null]},i.id)},fn=$e(e).filter(i=>i.kind===t&&!i.hidden),ua=he?.filters,Vo=(f.filter??[]).some(i=>i.key!=="is"||i.value!=="any"),jo=!!(f.sort||f.group||f.query||Vo),_o=rt.length>=Eo||D&&jo,Oe=f.sort?M.sorts.find(i=>i.key===f.sort.by):void 0,yn=Oe?.type==="date"||Oe!==void 0&&Oe.key===ie,ga=ae&&!p.grouped&&Oe&&(Oe.about==="label"||Oe.type==="text"||yn)?i=>{let y=Oe.about==="label"?ge(g,i):i[Oe.key];if(typeof y!="string"||y.length===0)return yn?"No date":"#";if(yn)return y.slice(0,4);let $=y.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test($)?$:"#"}:void 0,_e=ga?Ae.reduce((i,y)=>{let $=ga(y);return i.at(-1)?.key===$?i.at(-1).nodes.push(y):i.push({key:$,nodes:[y]}),i},[]):void 0,ma=p.grouped&&sn?V.flatMap(i=>ra(i)?[]:i.nodes):_e&&_e.length>1?_e.flatMap(i=>i.nodes):Ae,hn=(0,Me.useMemo)(()=>ma.map(i=>i.id),[ma.map(i=>i.id).join(`
|
|
6
|
+
`)]),Ee=Nr(hn),wn=(0,Me.useId)(),gt=(ot?l.permittedMutations(ot):l.permittedMutations()).some(i=>{let y=i.subject?.kinds;return y!==void 0&&(y==="*"||y.includes(t))}),vn=(i,y)=>gt?(0,h.jsx)("span",{className:"graview-choose-at",children:(0,h.jsx)("input",{...Ee.boxProps(i.id,y),onPointerEnter:On,onFocus:On})}):null,Sn=i=>gt?{"data-graview-choose":i}:{},zo=(0,Me.useCallback)(i=>{Ee.choose(i),requestAnimationFrame(()=>{let y=Ee.list.current;((i[0]===void 0?null:y?.querySelector(`[data-graview-choose-box="${CSS.escape(i[0])}"]`))??y)?.focus({preventScroll:!0})})},[Ee]),it=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||pn?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,Ct=it?void 0:"graview-rows",mt=i=>`list-at-${i.replace(/[^\p{L}\p{N}]/gu,"_")}`,At=q.map(i=>{let y=i.from===t?i.to:i.from,$=i.from===t?i.description:i.inverse??i.description;return{relation:i,far:y,words:$}}),Yo=new Set(At.map(i=>(i.words??"").toLowerCase()).filter((i,y,$)=>i&&$.indexOf(i)!==y));return(0,h.jsxs)(d?Bi:te,{context:e,children:[(0,h.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,h.jsxs)("header",{style:{display:"grid",gap:4},children:[d?null:(0,h.jsx)(ut,{context:e}),(0,h.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,h.jsx)(ce,{kind:t,brand:s,schema:l.schema,size:8}),(0,h.jsx)(oe,{context:e,children:je}),Be.length>0?(0,h.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:Be.map(({affordance:i,mutation:y})=>(0,h.jsx)(Ui,{name:y.name,title:y.title??y.name,panel:`${da}-${y.name}`,open:sa(y.name),onOpen:$=>la(y.name,$)},i.id))}):null]}),Ae.length>0?(0,h.jsx)(Jr,{place:"here",to:[{label:`Skip to the ${Ae.length===1?Ye(g,t):`${Ae.length} ${je.toLowerCase()}`}`,testid:"records",go:()=>{let i=document.querySelector(`[data-graview-skip-target="${CSS.escape(wn)}"]`);Nn(i?.querySelector('[data-graview-choose-box][tabindex="0"]')??i)}},...rt.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let i=document.querySelector(`[data-graview-skip-target="${CSS.escape(wn)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');Nn(i?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??i)}}]:[]]}):null,o??g?.description?(0,h.jsx)("p",{style:re,children:o??g?.description}):null,At.length>0||fn.length>0?(0,h.jsxs)("p",{style:{...C,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[At.length>0?(0,h.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",At.map(({relation:i,far:y,words:$},le)=>(0,h.jsxs)("span",{"data-relation":i.edgeKind,children:[le>0?(0,h.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,y==="*"?Re($??ze(i.edgeKind)):(0,h.jsx)(O,{to:`/${U(l.schema,y)}`,style:G,title:Y(l,y),children:$&&Yo.has($.toLowerCase())?`${Re($)}: ${Y(l,y).toLowerCase()}`:Re($??Y(l,y))})]},`${i.edgeKind}|${i.from}|${i.to}`))]}):null,fn.length>0?(0,h.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",fn.map((i,y)=>(0,h.jsxs)("span",{children:[y>0?(0,h.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,h.jsx)(O,{to:fe(e,i),style:G,children:i.title})]},et(i)))]}):null]}):null]}),Be.length>0?(0,h.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:Be.map(({affordance:i,mutation:y})=>{let $=!!(ca[y.name]&&Ae.length===0);return(0,h.jsx)(Vi,{name:y.name,id:`${da}-${y.name}`,description:y.description,open:sa(y.name),onClose:()=>la(y.name,!1),children:(0,h.jsx)(Ie,{store:l,mutation:y,prefilled:i.args,open:i.open,...$?{initial:{[ca[y.name]]:R.words}}:{},...e.principal?{principal:e.principal}:{}},$?`${y.name}|${R.words}`:y.name)},i.id)})}):null,P.dropped.length>0?(0,h.jsxs)("p",{style:{...C,margin:0},"data-testid":"list-dropped",children:["This link asked for ",P.dropped.join(", "),", which ",je.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,rt.length>0?(0,h.jsx)($r,{schema:l.schema,graph:l.graph,kind:t,arrangement:f,onChange:Go,kept:{shown:Ae.length,of:rt.length},noun:{one:Ye(g,t),many:je.toLowerCase()},..._o?{}:{allow:!1},...ua?{filters:ua}:{},offers:M,chips:{nodes:rt,flagged:u,...typeof c?.today=="string"?{today:c.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,h.jsx)("style",{children:_t}),gt?(0,h.jsx)("style",{children:Hr+Ki}):null,(0,h.jsx)("div",{className:"graview-list","data-graview-skip-target":wn,...gt?{...Ee.listProps,ref:Ee.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Ee.chosen.length>0?`${je}, ${Ee.chosen.length} chosen`:je,role:"group"}:{},children:Ae.length===0&&R.words?(0,h.jsxs)("p",{style:re,"data-testid":"none-yet",children:["Nothing here is called \u201C",R.words,"\u201D."," ",(0,h.jsx)("span",{style:C,"data-testid":"list-searched",children:Dt(l.schema,{kinds:[t],past:E})})," ",(0,h.jsx)(O,{to:"?",style:G,children:"Show every one"})]}):Ae.length===0?(0,h.jsxs)("p",{style:re,"data-testid":"none-yet",children:[f.filter?.length||f.query?"None of them.":"None yet",!f.filter?.length&&!f.query&&Be.length>0?` \u2014 the first one starts above, with \u201C${Be[0]?.mutation.title??Be[0]?.mutation.name}\u201D.`:!f.filter?.length&&!f.query?".":"",f.filter?.length||f.query?(0,h.jsxs)(h.Fragment,{children:[" ",(0,h.jsx)(O,{to:"?",style:G,children:"Show every one"})]}):null]}):p.grouped&&sn?(0,h.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":sn,children:V.map(i=>{if(!i.closed)return(0,h.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,h.jsxs)("h2",{className:"graview-group-head",children:[i.label," ",(0,h.jsx)("span",{children:i.nodes.length})]}),(0,h.jsx)("ul",{style:it,className:Ct,"data-graview-rows":"",children:i.nodes.map(Pt)})]},i.key||"-");let y=ra(i),$=`${w}-${mt(i.key||"none")}`;return(0,h.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":y?"shut":"open",children:[(0,h.jsx)("h2",{className:"graview-group-head",children:(0,h.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!y,"aria-controls":$,"data-testid":"list-group-toggle",onClick:()=>Bo(aa(i.key)),children:[(0,h.jsx)("span",{"aria-hidden":"true",children:y?"\u25B8":"\u25BE"}),i.label," ",(0,h.jsxs)("span",{children:["\xB7 ",i.nodes.length]}),(0,h.jsxs)("span",{style:Di,children:[" ",i.nodes.length===1?Ye(g,t):je.toLowerCase()]})]})}),(0,h.jsx)("ul",{id:$,style:y?{...it,display:"none"}:it,className:Ct,"data-graview-rows":"",hidden:y,children:y?null:i.nodes.map(Pt)})]},i.key||"-")})}):_e&&_e.length>1?(0,h.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Oe?.type==="date"?"year":"letter",children:[(0,h.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...C,display:"flex",flexWrap:"wrap",gap:Oe?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:_e.map(i=>(0,h.jsx)("a",{href:`#${mt(i.key)}`,onClick:y=>{y.preventDefault(),document.getElementById(mt(i.key))?.scrollIntoView({block:"start"})},style:{...Se,minWidth:24,justifyContent:"center"},children:i.key},i.key))}),_e.map(i=>(0,h.jsxs)("section",{"data-testid":"list-section","aria-labelledby":mt(i.key),style:{display:"grid",gap:0},children:[(0,h.jsx)("h2",{id:mt(i.key),className:"graview-group-head",children:i.key}),(0,h.jsx)("ul",{style:it,className:Ct,"data-graview-rows":"",children:i.nodes.map(Pt)})]},i.key))]}):(0,h.jsx)("ul",{style:it,className:Ct,"data-testid":"records","data-graview-rows":"",children:Ae.map(Pt)})}),gt?(0,h.jsx)(Ir,{store:l,chosen:Ee.chosen,...ot?{principal:ot}:{},...c?{context:c}:{},anchor:Wi,of:hn.length,onChooseAll:()=>Ee.choose(hn),onClear:Ee.clear,onActed:zo}):null,oa>0?(0,h.jsxs)(O,{to:Mo(m,"filter","is:any"),style:{...G,...C,justifySelf:"start"},"data-testid":"past-link",children:["+",oa," past"]}):null,x===!1&&l.graph.count(t,{archived:!0})>0?(0,h.jsxs)(O,{to:Mo(m,"archived","true"),style:{...G,...C,justifySelf:"start"},"data-testid":"archived-link",children:["+",l.graph.count(t,{archived:!0})," archived"]}):null]}),(0,h.jsx)(tn,{context:e,withheld:qo,style:ee,testId:"withheld"})]})}var Di={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Wi=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,Ki=`
|
|
7
|
+
.graview-list[data-graview-choosable]{outline:none}
|
|
8
|
+
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
9
|
+
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${Ta.raised};display:flex;align-items:center}
|
|
10
|
+
@media (min-width: 900px) and (pointer: fine){
|
|
11
|
+
.graview-list [data-graview-choose]{padding-left:0}
|
|
12
|
+
.graview-choose-at{left:-34px}
|
|
13
|
+
}
|
|
14
|
+
@media (pointer: coarse){
|
|
15
|
+
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
16
|
+
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
17
|
+
}
|
|
18
|
+
`;function Bi({children:e}){return(0,h.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var Gi=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function qi(e,t,n){let a=$t({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{},...e.get("archived")?{archived:e.get("archived")}:{}}),r=[...a.filter??[]],o=e.get("by"),d=a.group??(o?{by:o}:void 0);for(let s of n){let c=e.get(s);c&&r.push({key:s,value:c})}let l=e.get("with");return l&&r.push({key:l,value:"*"}),e.get("past")==="1"&&!r.some(s=>s.key==="is")&&r.push({key:"is",value:"any"}),$n({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...d?{group:d}:{},...a.archived!==void 0?{archived:a.archived}:{}},t)}function Mo(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function Ui({name:e,title:t,panel:n,open:a,onOpen:r}){return(0,h.jsxs)("button",{type:"button","data-testid":`act-open-${e}`,"data-graview-act":e,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...Se,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,h.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),t]})}function Vi({name:e,id:t,description:n,open:a,onClose:r,children:o}){return(0,h.jsxs)("div",{"data-testid":`act-${e}`,id:t,hidden:!a,onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),r(),document.querySelector(`[aria-controls="${t}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,h.jsx)("p",{style:{...C,margin:0,maxWidth:"58ch"},children:n}):null,o]})}function ji({to:e,label:t}){let n=(0,Me.useRef)(null);return Fr(n),(0,h.jsx)(O,{ref:n,to:e,"aria-label":t,style:{position:"absolute",inset:0,borderRadius:6}})}var at=H(He(),1);var bt=H(He(),1);var I=H(B(),1);function ea({context:e}){let{store:t,brand:n,invariantContext:a,principal:r}=e;Q(t);let o=t.violations(a),d=t.allInvariants(),l=Ht(t,o),s=za(t.schema,d);return(0,I.jsxs)(te,{context:e,children:[(0,I.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,I.jsx)(oe,{context:e,children:o.length===0?"All rules hold":"What is broken"}),(0,I.jsx)("p",{style:re,"data-testid":"problems-count",children:o.length===0?"Every declared rule is satisfied by what is here.":Ca(o)})]}),(0,I.jsx)(Ro,{context:e}),l.map((c,m)=>{let v=c.nodeIds[0],w=v?t.graph.getNode(v):void 0;return(0,I.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:[c.line?null:(0,I.jsx)(rn,{violation:c,schema:t.schema,...n?{brand:n}:{}}),w?(0,I.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,I.jsx)(ce,{kind:w.kind,brand:n,schema:t.schema,size:7}),(0,I.jsx)(O,{to:_(t.schema,w.kind,w.id),style:G,children:ge(t.schema.tryDefinition(w.kind),w)})]}):null,c.line?(0,I.jsx)(rn,{violation:c,schema:t.schema,...n?{brand:n}:{}}):null,(0,I.jsx)(on,{store:t,repairs:c.repairs,...r?{principal:r}:{}})]},m)}),d.length>0?(0,I.jsxs)("section",{style:{...ee,display:"grid",gap:12},"data-testid":"rules",children:[(0,I.jsx)("h2",{style:X,children:"The rules"}),(0,I.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:d.map(c=>{let m=o.filter(g=>g.invariant===c.name).length,v=s.get(c.name),w=c.label??c.name;return(0,I.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,I.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[v?(0,I.jsx)(It,{line:v,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,I.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:w}),(0,I.jsx)("span",{style:{...C,color:m>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:m===0?"holds":`broken in ${m} ${m===1?"place":"places"}`})]}),v&&w.trim().length>0?(0,I.jsx)("span",{style:C,children:w}):null]},c.name)})})]}):null]})}function rn({violation:e,schema:t,brand:n}){if(!e.line)return(0,I.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=Qa(e),r=Ya(e);return r?(0,I.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,I.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,I.jsx)("span",{style:C,children:a}):null,(0,I.jsxs)("details",{"data-testid":"problem-judged",style:C,children:[(0,I.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,I.jsx)(It,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none"})]})]}):(0,I.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,I.jsx)(It,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,I.jsx)("span",{style:C,children:a}):null]})}function on({store:e,repairs:t,principal:n}){let[a,r]=(0,bt.useState)(null),[o,d]=(0,bt.useState)(null),l=(0,bt.useRef)([]);if(t.length===0)return null;let s=a===null?null:t[a],c=s&&(s.missing??[]).length>0?e.allMutations().find(m=>m.name===s.mutation):void 0;return(0,I.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,I.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:t.map((m,v)=>{let w=(m.missing??[]).length>0,g=e.permits({name:m.mutation,args:{...m.args}},n);return g.ok?(0,I.jsx)("button",{ref:x=>{l.current[v]=x},type:"button","data-graview-repair":m.mutation,"data-graview-asks":w||void 0,"aria-expanded":w?a===v:void 0,onClick:()=>{if(d(null),w){r(a===v?null:v);return}r(null);try{e.apply({name:m.mutation,args:{...m.args}},n?{author:n}:{})}catch(x){d(Ft(e.schema,e.allMutations(),x))}},style:ke,children:w?`${m.label} \u2026`:m.label},v):(0,I.jsxs)("p",{"data-testid":"withheld","data-withheld":g.refusal.wouldNeed.join(",")||"nobody",style:{...C,margin:0},children:[(0,I.jsx)("s",{children:m.label})," \u2014 ",g.refusal.message]},v)})}),c&&s?(0,I.jsx)(Ie,{store:e,mutation:c,prefilled:{...s.args},only:s.missing??[],label:s.label,autoFocus:!0,onDone:()=>{let m=a;r(null),requestAnimationFrame(()=>{let v=m===null?null:l.current[m];if(v?.isConnected){v.focus();return}let w=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");w&&(w.hasAttribute("tabindex")||(w.tabIndex=-1),w.focus())})},...n?{principal:n}:{}}):null,s&&!c&&(s.missing??[]).length>0?(0,I.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Hn},children:["\u201C",s.label,"\u201D names ",s.mutation,", which this app does not declare."]}):null,o?(0,I.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Hn},children:o}):null]})}var ta=H(He(),1);var Ve=H(B(),1);function No({store:e,link:t,principal:n}){let[a,r]=(0,ta.useState)(!1),[o,d]=(0,ta.useState)(null),l=tr(t);return(0,Ve.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Ve.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,Ve.jsxs)("span",{style:{...C,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Ve.jsx)("span",{children:l}),(0,Ve.jsx)("button",{type:"button",style:{...ke,padding:"4px 10px"},onClick:()=>{try{e.apply({name:Aa,args:{kind:t.edge.kind,from:t.edge.from,to:t.edge.to}},n?{author:n}:{}),r(!1)}catch(s){d(Ft(e.schema,e.allMutations(),s))}},children:"Keep this link"}),o?(0,Ve.jsx)("span",{role:"alert",children:o}):null]}):null]})}var ye=H(B(),1);function Ho({nodeId:e,node:t,field:n,inPlace:a,labelStyle:r=we}){return n.files?(0,ye.jsx)(dt,{as:"field",read:!a,nodeId:e,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,ye.jsx)(Er,{nodeId:e,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,ye.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,ye.jsx)("dt",{style:r,children:n.label}),(0,ye.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,ye.jsx)(pr,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:e,field:n.key}:{}}):n.app?(0,ye.jsx)(Kt,{address:n.app,as:"record",...a?{nodeId:e,field:n.key}:{}}):n.href?(0,ye.jsx)(Mr,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:e}:{}}):a?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Bt,{nodeId:e,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,ye.jsx)(ur,{nodeId:e,field:n.key,start:t?.[n.key],value:t?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var k=H(B(),1),_i=[];function na({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;Q(t);let o=de()!==null,d=Ue(),l=decodeURIComponent(d.id??""),s=po(t,l,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Ht(t,s?.violations??_i),[m,v]=(0,at.useState)(null),[w,g]=(0,at.useState)(!1),[x,N]=(0,at.useState)(null),q=(0,at.useRef)(null),u=(0,at.useRef)(null),M=gr({flow:"both",letters:!0}),j=p=>{(q.current?.parentElement?.querySelector(`[data-affordance="${p.replace(/["\\]/g,"\\$&")}"]`)??q.current)?.focus()};if(!s)return(0,k.jsx)(te,{context:e,children:(0,k.jsx)(oe,{context:e,children:"Nothing lives at this address."})});let P=t.graph.getNode(l),D=t.schema.tryDefinition(s.kind),ae=D?.describe&&P?Xa(D,P):null,ie=[...t.log.all()].filter(p=>!Mt(p)&&(p.writes.includes(l)||p.reads.includes(l))).slice(-8).reverse(),he=t.log.all().find(p=>!Mt(p)&&p.undoes===void 0&&p.primitives.some(L=>L.op==="add-node"&&L.node.id===l)),J=s.actions.affordances.filter(p=>p.provider!=="invariant"),ue=J.filter(p=>p.destructive||p.setsAside),Ke=w||ue.length<2?J:J.filter(p=>!ue.includes(p)),Pe=e.views?.lookup(s.kind,{cardinality:"one",fidelity:"full"}),Ce=Pe!==void 0&&!lt(Pe)?Pe:void 0,S=Ce&&P?qt(Pe,P,t.graph):void 0,f=S?s.fields.filter(p=>!S.fields.has(p.key)):s.fields,R=S?s.links.flatMap(p=>{let L=p.targets.filter(V=>!S.records.has(V.id));return L.length>0?[{...p,targets:L}]:[]}):s.links,E=Ce!==void 0&&Ua(Pe),ne=o&&or(D).length>0,z=$e(e).filter(p=>!p.hidden&&(p.kind===s.kind||p.across===s.kind));return(0,k.jsxs)(te,{context:e,children:[(0,k.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,k.jsx)(ut,{context:e}),(0,k.jsx)(oe,{context:e,children:o&&P?.label===s.label?(0,k.jsx)(Bt,{nodeId:l,field:"label",value:s.label,said:s.label}):s.label}),ae&&ae!==s.label?(0,k.jsx)("p",{style:re,children:ae}):null,he?.lineage?(0,k.jsxs)("p",{style:{...C,margin:0},"data-testid":"record-lineage",children:["Made by ",ht(he,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}}),", ",An(he.lineage)]}):null,(0,k.jsx)(Yt,{context:e,stop:`#focus=${encodeURIComponent(l)}`,style:{...qe,...C},"data-testid":"spatial-link"}),o&&P?(0,k.jsx)(Tn,{choices:[{on:"changed",record:l},{on:"act",record:l},{on:"reaches",kind:s.kind,condition:"",record:l}],label:"Notify me when this changes",testId:"record-notify",style:{...ke,...C,justifySelf:"start"}}):null,z.length>0?(0,k.jsxs)("p",{style:{...C,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",z.map((p,L)=>(0,k.jsxs)("span",{children:[L>0?(0,k.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,k.jsx)(O,{to:fe(e,p),style:G,children:p.title})," ",(0,k.jsx)(Yt,{context:e,stop:`#view=${encodeURIComponent(p.as)}`,style:{...G,...C,display:"inline-block",minWidth:24,textAlign:"center"},title:`${p.title}, in the scene`,label:`${p.title}, in the scene`,children:(0,k.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},et(p)))]}):null]}),P&&xa(P)?(0,k.jsx)(Yi,{context:e,id:l,kind:s.kind}):null,P&&Ra(t,l)?(0,k.jsx)(zi,{context:e,id:l,kind:s.kind}):null,Ce&&P?(0,k.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,k.jsx)(Dr,{children:(0,k.jsx)(Zt,{when:Ot(Pe),children:(0,k.jsx)(Ce,{node:P,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...s.violations.length>0?{flagged:[l]}:{}})})})}):null,s.violations.length>0?(0,k.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((p,L)=>(0,k.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,k.jsx)(rn,{violation:p,schema:t.schema,...n?{brand:n}:{}}),(0,k.jsx)(on,{store:t,repairs:uo(s.actions,p.repairs),...a?{principal:a}:{}})]},L))}):null,!E&&(f.length>0||ne)?(0,k.jsxs)("section",{style:{...ee,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,k.jsx)("h2",{style:X,children:"The facts"}),er(D,f).map((p,L)=>{let V=(0,k.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:p.fields.map(se=>(0,k.jsx)(Ho,{nodeId:l,node:P,field:se,inPlace:o},se.key))});return p.title?(0,k.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,k.jsx)("h3",{"data-graview-field-group":p.title,style:{...X,fontSize:"inherit"},children:p.title}),V]},L):(0,k.jsx)("div",{children:V},L)}),ne?(0,k.jsx)(dt,{as:"unfilled",nodeId:l,skip:[...S?.fields??[]],labelStyle:we,style:{gap:4}}):null]}):null,(E?[]:R).map(p=>(0,k.jsxs)("section",{style:{...ee,display:"grid",gap:10},children:[(0,k.jsx)("p",{style:we,children:to(t,p)}),p.description?(0,k.jsx)("h2",{style:X,children:Re(p.description)}):(0,k.jsxs)("h2",{style:X,"aria-label":ze(p.edgeKind),children:[p.direction==="in"?"\u2190 ":"\u2192 ",ze(p.edgeKind)]}),(0,k.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:p.targets.map(L=>{let V=nr(t,p.direction==="in"?{kind:p.edgeKind,from:L.id,to:l}:{kind:p.edgeKind,from:l,to:L.id});return(0,k.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,k.jsx)(ce,{kind:L.kind,brand:n,schema:t.schema,size:7}),(0,k.jsxs)(O,{to:_(t.schema,L.kind,L.id),style:G,children:[L.label,L.apart?(0,k.jsxs)("span",{style:C,children:[" \xB7 ",L.apart]}):null]}),V?.provisional?(0,k.jsx)(No,{store:t,link:V,...a?{principal:a}:{}}):null]},L.id)})}),(p.direction==="out"&&t.schema.edge(p.edgeKind)?.cardinality==="one"?[]:[...new Set(p.targets.map(L=>L.kind))]).map(L=>(0,k.jsx)(O,{to:`/${U(t.schema,L)}?${encodeURIComponent(p.edgeKind)}=${encodeURIComponent(l)}`,style:{...qe,...C},"data-testid":"related-all",children:(0,k.jsxs)(Qe,{children:["Sort and filter ",p.description??`these ${Y(t,L).toLowerCase()}`,p.targets.some(V=>V.kind!==L)?` (${Y(t,L).toLowerCase()})`:""]})},L))]},`${p.edgeKind}|${p.direction}|${p.description??""}`)),!E&&(J.length>0||s.actions.withheld.length>0)?(0,k.jsxs)("section",{style:{...ee,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,k.jsx)("h2",{style:X,ref:q,tabIndex:-1,children:"What can be done"}),(0,k.jsxs)("div",{role:"toolbar","aria-label":"What can be done",...M,style:{display:"flex",flexWrap:"wrap",gap:8},children:[Ke.map(p=>{let L=m===p.id;return(0,k.jsx)("button",{type:"button","data-affordance":p.id,"data-rank":p.rank,"data-graview-act":p.mutation,[Ln]:"",autoFocus:w&&p===ue[0],"aria-expanded":L,onClick:()=>v(L?null:p.id),style:{...ke,...L?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:p.label},p.id)}),Ke.length<J.length?(0,k.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>g(!0),style:{...ke,...C},"data-testid":"record-actions-more",[Ln]:"",children:["Show ",J.length-Ke.length," more"]}):null]}),J.map(p=>{if(m!==p.id)return null;let L=t.allMutations().find(V=>V.name===p.mutation);return L?(0,k.jsxs)("div",{ref:u,onKeyDown:V=>{if(V.key!=="Escape"||V.defaultPrevented)return;V.preventDefault(),v(null);let se=p.id;requestAnimationFrame(()=>j(se))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,k.jsx)("h3",{style:X,children:p.label}),L.description?(0,k.jsx)("p",{style:{...C,margin:0},children:L.description}):null,(0,k.jsx)(Ie,{store:t,mutation:L,prefilled:p.args,open:p.open,label:p.label,autoFocus:!0,onDone:()=>{v(null),N(p.mutation);let V=p.id;requestAnimationFrame(()=>j(V))},...a?{principal:a}:{}})]},p.id):null}),o&&x!==null&&m===null?(0,k.jsx)(Tn,{choices:[{on:"act",act:x,record:l},{on:"act",act:x}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...ke,...C,justifySelf:"start"}}):null,(0,k.jsx)(tn,{context:e,withheld:s.actions.withheld})]}):null,o?(0,k.jsx)(eo,{id:l,style:ee,headingStyle:X}):null,ie.length>0?(0,k.jsxs)("section",{style:{...ee,display:"grid",gap:10},"data-testid":"record-history",children:[(0,k.jsx)("h2",{style:X,children:"What has happened"}),(0,k.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:ie.map(p=>(0,k.jsxs)("li",{style:C,children:[(0,k.jsx)("span",{style:{color:"var(--graview-ink)"},children:p.intent}),p.lineage?(0,k.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",An(p.lineage)]}):null," \u2014 ",ht(p,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},p.id))})]}):null]})}function zi({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`allow-tidying-${n}`,args:{id:t}},d=a.allMutations().some(l=>l.name===o.name)&&a.permits(o,r).ok;return(0,k.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,k.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,k.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),d?(0,k.jsx)("button",{type:"button",style:ke,"data-testid":"allow-tidying",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Yi({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`unarchive-${n}`,args:{id:t}},d=a.allMutations().some(c=>c.name===o.name)&&a.permits(o,r).ok,l=[...a.log.all()].reverse().find(c=>!Mt(c)&&c.mergedInto!==void 0&&c.writes.includes(t)),s=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,k.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,k.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,k.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",s?(0,k.jsxs)(k.Fragment,{children:[" ","Merged into ",(0,k.jsx)(O,{to:_(a.schema,s.kind,s.id),style:G,children:ge(a.schema.tryDefinition(s.kind),s)}),"."]}):null]}),d?(0,k.jsx)("button",{type:"button",style:ke,"data-testid":"bring-it-back",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Bring it back"}):null]})}var b=H(B(),1),Qi=Nt(()=>(__graviewPreload(import.meta.url,["./chunk.7MJGZHTS.js","./chunk.BJR6E2CT.js","./chunk.VSWEKNKS.js","./chunk.UGFDSE37.js","./chunk.SGJSJGSR.js","./chunk.2OXXGN7C.js","./chunk.Q4KNNJFL.js","./chunk.BH365UJ5.js","./chunk.6EHE26ZS.js","./chunk.N2S3TMBC.js","./chunk.7JW5SHRR.js","./chunk.4SEY7VWZ.js","./chunk.IVHPJUFM.js","./chunk.D53IGR45.js","./chunk.MJ4XTNTL.js","./chunk.AP22NNIM.js","./chunk.SPZVEQC5.js","./chunk.FNK2ZZ5E.js","./chunk.RSR2M7ZO.js","./chunk.EM5CGFNB.js","./chunk.N2S45SSL.js","./chunk.AGVFW6WC.js","./chunk.SIVMZNHZ.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.NQDGUIUQ.js","./chunk.DTRNDSMS.js","./chunk.3EW6L5DY.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.GZHZLJBF.js","./chunk.FOYVTN5B.js","./chunk.OJGHDWI6.js","./chunk.OTF3NNTI.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.4K7I7WYF.js")).then(e=>({default:e.DraftPage}))),Zi={kind:"human"};function Xi({list:e,store:t}){let n=new Set(e.members.map(d=>d.kind)),a=e.total-e.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,b.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=Ge(t.schema,r).toLowerCase();return(0,b.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,b.jsx)(O,{to:`/${U(t.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:e.total===t.graph.nodesOfKind(r).length?`See all ${ft(e.total)} ${o}`:`${ft(a)} more \xB7 all ${o}`})})}function Ji({context:e,children:t}){let n=De(),a=e.store.schema,r=Ze("/").replace(/\/$/,""),o=(0,K.useMemo)(()=>({href:d=>`${r}${_(a,d.kind,d.id)}`,go:d=>n(_(a,d.kind,d.id)),more:d=>(0,b.jsx)(Xi,{list:d,store:e.store})}),[r,a,n,e.store]);return(0,b.jsx)(Gt.Provider,{value:o,children:(0,b.jsx)(Wr.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}var Fo=(0,K.createContext)(void 0);function es({steering:e}){let t=me(),n=De(),a=`${t.pathname}${t.search}`;return(0,K.useLayoutEffect)(()=>e.at(a),[a,e]),(0,K.useLayoutEffect)(()=>{let r=d=>{d!==a&&n(d)};e.go.current=r;let o=e.pending?.current;return o!==void 0&&(e.pending.current=void 0,r(o)),()=>{e.go.current===r&&(e.go.current=void 0)}},[a,n,e]),null}function ts({context:e,to:t}){let{pathname:n}=me(),a=de(),r=(t??a)?.sayWhere,o=ns(e,n);return(0,K.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function ns(e,t){let[n="",a,r]=t.split("/").filter(Boolean).map(d=>{try{return decodeURIComponent(d)}catch{return d}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===Pn)return"#overview=1";let d=e.views?.places().find(l=>l.as===a);return d?`#focus=${encodeURIComponent(Ne(d.kind))}&view=${encodeURIComponent(d.as)}`:"#"}let o=ve(e.store.schema,n);return o?`#focus=${encodeURIComponent(a??Ne(o))}`:"#"}function as({onNavigate:e,path:t}){let n=me(),a=Wn(),r=De(),o=n.hash&&!n.hash.includes("=")?n.hash:"",d=`${n.pathname}${n.search}${o}`,l=(0,K.useRef)(e);l.current=e;let s=(0,K.useRef)(null);(0,K.useEffect)(()=>{let m=s.current;s.current=d,m!==null&&(d===m&&a!=="PUSH"||l.current?.(d,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,K.useRef)(t);return(0,K.useEffect)(()=>{t===void 0||t===c.current||(c.current=t,t!==d&&r(t))},[t]),null}function Io({context:e,registry:t,page:n}){let a=Ue(),r=ve(e.store.schema,a.slug??""),o=n==="list"?Jn:na,l=(r?t?.lookup(r,n):void 0)??o;return(0,b.jsx)(l,{context:e})}function rs({context:e,registry:t,children:n}){let a=(0,K.useRef)(null);return Va(a),(0,b.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,b.jsx)(bo,{context:e,registry:t,root:a,children:(0,b.jsx)(Po,{context:e,root:a,children:n})})})}function os(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function is(){let{pathname:e}=me(),t=Wn(),n=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{if(t!=="POP"){for(let o=n.current?.parentElement;o;o=o.parentElement){let{overflowY:d}=getComputedStyle(o);if((d==="auto"||d==="scroll")&&o.scrollHeight>o.clientHeight){o.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,K.useRef)(e),r=(0,K.useRef)(!1);return(0,K.useEffect)(()=>{if(!r.current&&e===a.current)return;r.current=!0;let o=document.activeElement;if(os(o))return;let d=n.current?.closest("main")??document.querySelector("main"),s=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??d?.querySelector("h1, h2")??null??d??null;s&&(s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus({preventScroll:!0}))},[e]),(0,b.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function Do({context:e,children:t}){let n=De(),a=Ze("/").replace(/\/$/,""),r=(0,K.useContext)(Fo),o=(0,K.useMemo)(()=>{let d=(s,c)=>{if("record"in s){let m=e.store.graph.getNode(s.record);return m?Vt(_(e.store.schema,m.kind,s.record),{section:c?.section}):void 0}if("place"in s){let m=e.views?.places().find(v=>v.as===s.place);return m?Vt(fe(e,m),c):void 0}return e.store.schema.tryDefinition(s.list)?Vt(`/${U(e.store.schema,s.list)}`,c):void 0},l=s=>{s!==void 0&&n(s)};return{record:(s,c)=>l(d({record:s},c)),place:(s,c)=>l(d({place:s},c)),list:(s,c)=>l(d({list:s},c)),draft:()=>n("/~draft"),href:(s,c)=>{let m=r===!1?void 0:d(s,c);if(m!==void 0)return r?r(m):`${a}${m}`}}},[e,n,a,r]);return(0,b.jsx)(qa.Provider,{value:o,children:t})}function ss(){let{pathname:e,search:t,hash:n}=me();return(0,K.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return wo(a)},[e,t,n]),null}function ls({context:e,Home:t}){let n=me(),a=e.views,r=n.key==="default"&&!(a&&Ba(a));(0,K.useEffect)(()=>{a&&Ga(a)},[a]);let o=r?$a(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,d=o?.to==="place"?fe(e,o.place):o?.to==="kind"?`/${U(e.store.schema,o.kind)}`:void 0;return d?(0,b.jsx)(Kn,{to:d,replace:!0}):(0,b.jsx)(t,{context:e})}function Wo({context:e,registry:t}){let n=t?.lookupSurface("shell"),a=n!==void 0,r=a&&(t?.without().has("bar")??!1),o=a&&!r&&!e.embedded?{...e,barAbove:!0}:e,d=N=>n===void 0?(0,b.jsx)(Qt,{context:e,children:N}):r?(0,b.jsx)(n,{context:e,children:N}):(0,b.jsx)(Qt,{context:e,children:(0,b.jsx)(n,{context:o,children:N})}),l=t?.lookupSurface("home")??Zn,s=t?.lookupSurface("problems")??ea,c=a?{...o,framed:!0}:e,[m,v]=(0,K.useState)(null),w=(0,K.useMemo)(()=>({context:c,registry:t}),[c,t]),g=(0,K.useMemo)(()=>({onFind:v,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),x=(0,b.jsx)(Gn.Provider,{value:w,children:(0,b.jsx)(Do,{context:e,children:(0,b.jsx)(rs,{context:e,registry:t,children:d((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ar,{face:"pages"}),(0,b.jsxs)(Ji,{context:c,children:[(0,b.jsx)(is,{}),(0,b.jsx)(ss,{}),(0,b.jsxs)(io,{children:[(t?.routes()??[]).map(({path:N,component:q})=>(0,b.jsx)(Le,{path:N,element:(0,b.jsx)(q,{context:c})},N)),(0,b.jsx)(Le,{path:"/",element:(0,b.jsx)(ls,{context:c,Home:l})}),(0,b.jsx)(Le,{path:"/problems",element:(0,b.jsx)(s,{context:c})}),(0,b.jsx)(Le,{path:"/~draft",element:(0,b.jsx)(K.Suspense,{fallback:null,children:(0,b.jsx)(Qi,{context:c})})}),(0,b.jsx)(Le,{path:"/search",element:(0,b.jsx)(Xn,{context:c})}),(0,b.jsx)(Le,{path:"/map",element:(0,b.jsx)(Qn,{context:c})}),(0,b.jsx)(Le,{path:"/places",element:(0,b.jsx)(zn,{context:c})}),$e(c).some(N=>N.as===Pn)?null:(0,b.jsx)(Le,{path:Ea,element:(0,b.jsx)(Kn,{to:"/",replace:!0})}),(0,b.jsx)(Le,{path:"/places/:as",element:(0,b.jsx)(Yn,{context:c})}),(0,b.jsx)(Le,{path:"/:slug",element:(0,b.jsx)(Io,{context:c,registry:t,page:"list"})}),(0,b.jsx)(Le,{path:"/:slug/:id",element:(0,b.jsx)(Io,{context:c,registry:t,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?x:(0,b.jsx)(co.Provider,{value:g,children:(0,b.jsx)(Sr.Provider,{value:m,children:x})})}var ds=()=>typeof document>"u"?null:document.body;function cs({context:e,registry:t,basename:n,initialPath:a,onNavigate:r,path:o,steering:d,firstLook:l,hrefOf:s}){let[c,m]=(0,K.useState)(void 0),v=c!==void 0&&c.from===e.principal?{...e,principal:c.seat}:e;(0,K.useState)(()=>v.views?Gr(v.views,v.store.schema,En(v.brand,v.store.schema)):void 0);let w=de();wa({reader:v.locale??w?.locale,app:v.brand?.locale??v.app?.brand?.locale,readerTimeZone:v.timeZone??w?.timeZone,appTimeZone:v.brand?.timeZone??v.app?.brand?.timeZone});let g=v.principal??Zi,x=Fa(v.store,g,v.history),q=(x.past&&x.live===v.store?x.past.store:v.store).seenBy(g),u=q===v.store?v:{...v,store:q};Da(v.store,v.principal);let M=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(as,{onNavigate:r,path:o}),d?(0,b.jsx)(es,{steering:d}):null,u.presence||w?(0,b.jsx)(ts,{context:u,to:w}):null,(0,b.jsx)(Wo,{context:u,...t?{registry:t}:{}}),l?(0,b.jsx)(qr,{firstLook:l,root:ds,app:En(v.brand,v.store.schema)}):null]}),j=u.views?(0,b.jsxs)(Wa,{store:u.store,views:u.views,...u.principal?{principal:u.principal}:{},...u.brand?{brand:u.brand}:{},...u.locale?{locale:u.locale}:{},...u.timeZone?{timeZone:u.timeZone}:{},...u.settings?{settings:u.settings}:{},...u.presence&&!w?{presence:u.presence}:{},...u.people?{people:u.people}:{},...u.seats?{seats:u.seats}:{},onSeat:ie=>w?w.takeSeat(ie):m({from:e.principal,seat:ie}),...u.onKeepLens?{onKeepLens:u.onKeepLens}:{},...u.ai?{ai:u.ai}:{},...u.subscriptions?{subscriptions:u.subscriptions}:{},...u.signIn?{signIn:u.signIn}:{},resolveApp:u.resolveApp??w?.resolveApp,linkedRecords:u.linkedRecords??w?.linkedRecords,...u.app?{app:u.app}:{},...u.menuSections?{menuSections:u.menuSections}:{},children:[M,(0,b.jsx)(Do,{context:u,children:(0,b.jsx)(vo,{context:u})})]}):M,P=(0,b.jsx)(Ia.Provider,{value:x,children:j}),D=u.files?(0,b.jsx)(Ha.Provider,{value:u.files,children:P}):P,ae=s===void 0?D:(0,b.jsx)(Fo.Provider,{value:s,children:D});if(a!==void 0){let ie=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,b.jsx)(oo,{initialEntries:[ie],...n===void 0?{}:{basename:n},children:ae})}return(0,b.jsx)(so,{...n===void 0?{}:{basename:n},children:ae})}export{ci as a,cs as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Lc as E,Mc as G,Nc as F,Pc as J,Qc as W,mb as k,qb as O,rb as P,tb as h,ub as j}from"./chunk.PFEKS3KO.js";var I=(o,a)=>{let t=o.kindOf(a);return t===void 0?void 0:o.kept?.({id:a,kind:t})};function w(o,a){return o.flatMap(t=>{if(t.op!=="patch-node")return[t];let i=I(a,t.id);if(!i||!Object.keys(t.after).some(i))return[t];let c=r=>Object.fromEntries(Object.entries(r).filter(([f])=>!i(f))),s=c(t.after);return Object.keys(s).length===0?[]:[{op:"patch-node",id:t.id,before:c(t.before),after:s}]})}function _(o,a,t){if(!F(o,a))return t;let i=J(o,a),c=r=>o.graph.getNode(r)!==void 0||E(o.log).kindOf(r)!==void 0,s={...t};if(t.diff){let r=t.diff,f=G(o.log),l=o.log.length??o.log.all().length,u=t.ops?.[0]?.seq??l,x=k(a).id,y=(e,n)=>d=>f.writerAt(e,d,n),m=(e,n)=>i.shows(e.id)?i.servedWith(e,n):void 0,b=(e,n)=>e.flatMap(d=>m(d,n(d.id))??[]),S=e=>i.shows(e.from)&&i.shows(e.to)&&!h(e,i.sees),v=(e,n)=>t.ops?y(e,l):d=>n===void 0||n.includes(d)?x:f.writerAt(e,d,l),M=r.changedNodes.flatMap(e=>{let n=m(e.before,y(e.before.id,u)),d=m(e.after,v(e.after.id,e.fields));return n&&d?[{before:n,after:d,fields:e.fields.filter(p=>p in n||p in d)}]:[]}),D=new Set(r.changedNodes.map(e=>e.after.id)),g=new Map;for(let e of t.ops?.flatMap(n=>n.primitives)??t.primitives??[])e.op!=="patch-node"||D.has(e.id)||g.set(e.id,[...g.get(e.id)??[],...Object.keys(e.after)]);let B=[...g].flatMap(([e,n])=>{let d=o.graph.getNode(e);if(!d)return[];let p=m(d,y(e,u)),N=m(d,v(e,n));return p&&N&&JSON.stringify(p)!==JSON.stringify(N)?[{before:p,after:N,fields:n}]:[]});s.diff={addedNodes:b(r.addedNodes,e=>v(e)),removedNodes:b(r.removedNodes,e=>y(e,u)),changedNodes:[...M,...B],addedEdges:r.addedEdges.filter(S),removedEdges:r.removedEdges.filter(S),touched:[...r.touched.filter(i.shows),...[...g.keys()].filter(e=>i.shows(e)&&!r.touched.includes(e))]}}if(t.ops&&(s.ops=j(t.ops,i)),t.primitives){let r=s.ops;s.primitives=r?r.flatMap(f=>f.primitives):i.timeline?O(t.primitives,i.timeline,{served:(f,l)=>i.servedWith(f,l),edgeClean:f=>!h(f,i.sees),sees:i.sees},k(a).id):j([{id:"",seq:0,batch:"",author:{kind:"system"},intent:"",mutation:null,primitives:t.primitives,reads:[],writes:[],at:""}],i)[0].primitives}return i.kept&&s.primitives&&(s.primitives=w(s.primitives,i)),t.reads&&(s.reads=t.reads.filter(r=>i.shows(r)&&c(r))),t.writes&&(s.writes=t.writes.filter(i.shows)),t.intent!==void 0&&h(t.intent,i.sees)&&(s.intent=P),t.violationsAfter&&Object.assign(s,A?A(o,W(o,a),!!t.ops,s.primitives??[]):{introduces:[],resolves:[],violationsAfter:[]}),s}var A,z=o=>void(A=o);export{_ as a,z as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as T}from"./chunk.
|
|
1
|
+
import{G as T}from"./chunk.TM6JVVGW.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=g(T(),1),m="data-graview-roving",E="data-graview-roving-item",L={ArrowDown:{column:1,both:1},ArrowUp:{column:-1,both:-1},ArrowRight:{column:0,both:1},ArrowLeft:{column:0,both:-1}},w=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&!["button","checkbox","radio","submit"].includes(e.type));function p(e){return[...e.querySelectorAll(`[${E}]`)].filter(c=>c.closest(`[${m}]`)===e&&!c.disabled&&c.getAttribute("aria-hidden")!=="true")}var M=e=>(e.textContent?.trim()||e.getAttribute("aria-label")||"").toLowerCase();function H({flow:e="column",letters:c=!1}={}){let a=(0,s.useRef)(null),i=(0,s.useRef)(null),f=(0,s.useCallback)(()=>{let t=a.current;if(!t)return;let n=p(t);if(n.length===0)return;let o=typeof document>"u"?null:document.activeElement,u=n.find(r=>r===o)??(i.current&&n.includes(i.current)?i.current:n[0]);for(let r of n){let l=r===u?"0":"-1";r.getAttribute("tabindex")!==l&&r.setAttribute("tabindex",l)}},[]);(0,s.useLayoutEffect)(f);let d=t=>{t&&(i.current=t,t.focus(),f())};return{ref:a,[m]:c?"letters":"",onFocus:t=>{let n=t.target.closest?.(`[${E}]`);n&&n.closest(`[${m}]`)===a.current&&i.current!==n&&(i.current=n,f())},onKeyDown:t=>{let n=a.current;if(!n||t.metaKey||t.ctrlKey||t.altKey||w(t.target))return;let o=p(n),u=o.findIndex(l=>l===t.target||l.contains(t.target));if(u<0)return;let r=L[t.key]?.[e];if(r){t.preventDefault(),t.stopPropagation(),d(o[Math.max(0,Math.min(o.length-1,u+r))]);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),t.stopPropagation(),d(t.key==="Home"?o[0]:o[o.length-1]);return}if(c&&t.key.length===1&&t.key.trim()!==""){let l=t.key.toLowerCase(),y=[...o.slice(u+1),...o.slice(0,u+1)].find(b=>M(b).startsWith(l));if(!y)return;t.preventDefault(),t.stopPropagation(),d(y)}}}}export{E as a,H as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.FIS27KW4.js";import"./chunk.EYSQPXVE.js";import"./chunk.AOEXSQDG.js";import"./chunk.3NEALGMI.js";import"./chunk.UT6642FC.js";import"./chunk.35FUGOSG.js";import"./chunk.NQDGUIUQ.js";import"./chunk.DTRNDSMS.js";import"./chunk.3EW6L5DY.js";import"./chunk.AVDXG57A.js";import"./chunk.LD6S2FL5.js";import"./chunk.TABIRLQS.js";import"./chunk.A7HMVWMG.js";import"./chunk.GRLPNTUW.js";import"./chunk.EJAVIZ7Y.js";import"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u}from"./chunk.
|
|
1
|
+
import{c as u}from"./chunk.EJAVIZ7Y.js";import{ga as l}from"./chunk.PFEKS3KO.js";function a(e,n){let s=new Map;for(let o of e){let t=n(o.from),i=n(o.to);if(t===void 0||i===void 0)continue;let d=`${o.kind}|${t}|${i}`,r=s.get(d);r||s.set(d,r={edge:o.kind,from:t,to:i,links:0,froms:new Set,tos:new Set}),r.links+=1,r.froms.add(o.from),r.tos.add(o.to)}return[...s.entries()].sort(([o],[t])=>o<t?-1:o>t?1:0).map(([o,t])=>({key:o,edge:t.edge,from:t.from,to:t.to,links:t.links,fromCount:t.froms.size,toCount:t.tos.size}))}function m(e,n,s){let o=[],t=[];for(let d of e){let r=f(d);if(r!==null){o.includes(r)||o.push(r);continue}s(d)!==void 0&&t.push(d)}let i=n.overview&&n.focusId!==null?f(n.focusId):null;return n.beside&&n.overview&&i===null&&n.focusId!==null&&t.length===0&&o.length===0&&s(n.focusId)!==void 0&&t.push(n.focusId),{districts:o,records:t,lens:i}}function f(e){return e.startsWith("kind:")?e.slice(5)||null:e.startsWith("aggregate:")&&!e.includes("|")&&e.slice(10)||null}function y(e,n){let s=u(e,n.from,n.edge,"out"),o=n.from===n.to?" of their own":"";return`${l(e,n.from,n.fromCount)} \u2192 ${l(e,n.to,n.toCount)}${o}, ${s}`}export{a,m as b,f as c,y as d};
|