graview 0.1.51 → 0.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/chunk.2EB7COX5.js +1 -0
- package/dist/preview/{chunk.K7ECYKZL.js → chunk.2K3YQJW3.js} +1 -1
- package/dist/preview/{chunk.PPZ2TOB5.js → chunk.2X3UZJWI.js} +1 -1
- package/dist/preview/{chunk.KRODTMGR.js → chunk.337JMOTL.js} +1 -1
- package/dist/preview/{chunk.5ZAK57JA.js → chunk.3FKP32RG.js} +2 -2
- package/dist/preview/{chunk.ACB4TD4W.js → chunk.3TME4BG3.js} +1 -1
- package/dist/preview/chunk.3ZQAPPJ5.js +18 -0
- package/dist/preview/{chunk.EA2NMVRE.js → chunk.4LI73QOY.js} +1 -1
- package/dist/preview/{chunk.UIWI4GKW.js → chunk.4VI3EYDL.js} +1 -1
- package/dist/preview/{chunk.OHDJYGH7.js → chunk.4ZLCMATU.js} +1 -1
- package/dist/preview/{chunk.GJQF7I22.js → chunk.52J42KR5.js} +1 -1
- package/dist/preview/{chunk.4EZFOZBA.js → chunk.5DDHFNZM.js} +1 -1
- package/dist/preview/chunk.5LWPNOJA.js +1 -0
- package/dist/preview/{chunk.FKJ3HIA5.js → chunk.5WU2UTP7.js} +1 -1
- package/dist/preview/{chunk.OPCBZNKF.js → chunk.63SRVTG2.js} +2 -2
- package/dist/preview/{chunk.CV55N3Y6.js → chunk.6BA6RUK7.js} +1 -1
- package/dist/preview/{chunk.WFHFWJ6E.js → chunk.6CY3EA6U.js} +1 -1
- package/dist/preview/{chunk.IBJBCZKG.js → chunk.6JERQFZI.js} +1 -1
- package/dist/preview/{chunk.IFL2MYTQ.js → chunk.6NIE3ILA.js} +1 -1
- package/dist/preview/{chunk.JMDKAP23.js → chunk.6QNBUBGD.js} +1 -1
- package/dist/preview/chunk.6YGRRXJB.js +2 -0
- package/dist/preview/{chunk.JX2C3HVD.js → chunk.7354O67H.js} +1 -1
- package/dist/preview/{chunk.MY5OXSS7.js → chunk.73EKJ4JN.js} +1 -1
- package/dist/preview/{chunk.CQPNDJAC.js → chunk.7EA7THSM.js} +1 -1
- package/dist/preview/{chunk.IUIDDNN3.js → chunk.7FMS57QO.js} +1 -1
- package/dist/preview/{chunk.3TVAE7LE.js → chunk.7FZY5E2U.js} +1 -1
- package/dist/preview/{chunk.R5R7CLOU.js → chunk.7IOC6U3C.js} +1 -1
- package/dist/preview/{chunk.JI2UVZUU.js → chunk.7KZ44FEU.js} +1 -1
- package/dist/preview/chunk.7OAXW7QF.js +1 -0
- package/dist/preview/chunk.7SNIX56B.js +1 -0
- package/dist/preview/{chunk.OJ64WTLW.js → chunk.7UJZP3YK.js} +2 -2
- package/dist/preview/{chunk.353CGK6C.js → chunk.7UXDIEPK.js} +1 -1
- package/dist/preview/{chunk.NQ26KMSQ.js → chunk.7XJ3XQZD.js} +1 -1
- package/dist/preview/chunk.AI2HBKVP.js +359 -0
- package/dist/preview/{chunk.KOBCLWPC.js → chunk.BDQ4FUKO.js} +1 -1
- package/dist/preview/{chunk.ESSENNHM.js → chunk.BHPZK4WJ.js} +2 -2
- package/dist/preview/{chunk.W2DKFQ6R.js → chunk.BJL6EL6B.js} +1 -1
- package/dist/preview/{chunk.UK5F3S2N.js → chunk.C4EPMV7O.js} +1 -1
- package/dist/preview/{chunk.DQNN5FE5.js → chunk.C4UNAJWC.js} +1 -1
- package/dist/preview/{chunk.Z7N3MJ36.js → chunk.C7EEYSAM.js} +1 -1
- package/dist/preview/{chunk.7RIFDWDF.js → chunk.CBGKWYGI.js} +1 -1
- package/dist/preview/chunk.CC7E6NUQ.js +1 -0
- package/dist/preview/chunk.CHMUL36A.js +1 -0
- package/dist/preview/{chunk.VICCAWAN.js → chunk.CV4QA4ZF.js} +1 -1
- package/dist/preview/{chunk.5ON3JSAK.js → chunk.D2T563AA.js} +1 -1
- package/dist/preview/{chunk.B7LBG4UP.js → chunk.D62V3TBW.js} +1 -1
- package/dist/preview/{chunk.2W45NM7Q.js → chunk.DC7M56NM.js} +2 -2
- package/dist/preview/{chunk.6KYWJXZR.js → chunk.DGWNVDZB.js} +1 -1
- package/dist/preview/{chunk.TBSPEO2L.js → chunk.DIS7JS7X.js} +1 -1
- package/dist/preview/{chunk.FYDDFOSD.js → chunk.DVLWSCIC.js} +1 -1
- package/dist/preview/{chunk.FU4YSVWX.js → chunk.DXZ5VYCQ.js} +1 -1
- package/dist/preview/{chunk.PMV6XVVZ.js → chunk.EHOEMVQP.js} +1 -1
- package/dist/preview/{chunk.B4PUI3GO.js → chunk.EIWTZC4A.js} +1 -1
- package/dist/preview/chunk.EME5HQ3H.js +1 -0
- package/dist/preview/{chunk.HVX7LFWR.js → chunk.FEBCIEI3.js} +1 -1
- package/dist/preview/{chunk.IE4ZJQV3.js → chunk.FJC6PMOG.js} +1 -1
- package/dist/preview/{chunk.2W2YVB6X.js → chunk.FJEXINFF.js} +1 -1
- package/dist/preview/{chunk.APFRPN5S.js → chunk.FLNYLE6S.js} +1 -1
- package/dist/preview/{chunk.2VJ52LGS.js → chunk.G7XKQNOL.js} +1 -1
- package/dist/preview/{chunk.SSAY4ITS.js → chunk.GL3YVGAP.js} +2 -2
- package/dist/preview/{chunk.K7RKWB2K.js → chunk.GZHEGKPF.js} +1 -1
- package/dist/preview/{chunk.KK46XLGU.js → chunk.HSGUXMAO.js} +1 -1
- package/dist/preview/{chunk.AZOW57MT.js → chunk.HST7BYFW.js} +1 -1
- package/dist/preview/{chunk.T3RTFTOZ.js → chunk.I2W7HSBU.js} +1 -1
- package/dist/preview/{chunk.XCQ7ZPR5.js → chunk.I43ONAEL.js} +1 -1
- package/dist/preview/{chunk.NVRK6A7T.js → chunk.INL4OZI7.js} +1 -1
- package/dist/preview/{chunk.ALCH5H7U.js → chunk.IVI3HRSF.js} +1 -1
- package/dist/preview/{chunk.XCCBUWMC.js → chunk.J263VQF5.js} +1 -1
- package/dist/preview/{chunk.TNL2BVCH.js → chunk.J2R55TM7.js} +1 -1
- package/dist/preview/{chunk.U7SNDY3F.js → chunk.J6IB2HUZ.js} +1 -1
- package/dist/preview/{chunk.Y5AMZBHA.js → chunk.JOWJNIWH.js} +2 -2
- package/dist/preview/{chunk.7GAC7U34.js → chunk.JQBP6QWQ.js} +1 -1
- package/dist/preview/chunk.JV7FLVUV.js +1 -0
- package/dist/preview/{chunk.SJKHVIHA.js → chunk.KFTZLNHY.js} +2 -2
- package/dist/preview/{chunk.NZDHXREL.js → chunk.KPUX27ZT.js} +1 -1
- package/dist/preview/chunk.KSJ3J5UN.js +1 -0
- package/dist/preview/chunk.LESRQN3Y.js +32 -0
- package/dist/preview/{chunk.CTOBNZLM.js → chunk.LSL25VXW.js} +1 -1
- package/dist/preview/{chunk.SRFZKDQ6.js → chunk.LTJYKQJG.js} +1 -1
- package/dist/preview/{chunk.32BOL7OL.js → chunk.LXJW2Z2M.js} +1 -1
- package/dist/preview/{chunk.WQLAIEWJ.js → chunk.M33LUF3Q.js} +1 -1
- package/dist/preview/{chunk.B6LKLV32.js → chunk.MBNZ2HK7.js} +1 -1
- package/dist/preview/{chunk.SJYQ72EC.js → chunk.MYKRJ4SV.js} +1 -1
- package/dist/preview/{chunk.UWFEXEY3.js → chunk.N7D5LKBI.js} +1 -1
- package/dist/preview/{chunk.AL7LFNOS.js → chunk.NAPTE3S6.js} +1 -1
- package/dist/preview/{chunk.MX3Y3LPH.js → chunk.NB6WN4DO.js} +1 -1
- package/dist/preview/{chunk.MN6WHE4B.js → chunk.NHIPVAGR.js} +1 -1
- package/dist/preview/chunk.NICCIJV4.js +1 -0
- package/dist/preview/{chunk.MRXQBEPQ.js → chunk.NQPNK6I5.js} +1 -1
- package/dist/preview/{chunk.MG3DMURZ.js → chunk.NVNQSZ43.js} +1 -1
- package/dist/preview/{chunk.CI4DEKPX.js → chunk.NWK4E7TJ.js} +1 -1
- package/dist/preview/{chunk.HASVT7IC.js → chunk.NZB5S5UO.js} +1 -1
- package/dist/preview/{chunk.WESWDXRW.js → chunk.OS3WZV6C.js} +1 -1
- package/dist/preview/{chunk.OU5TRY4N.js → chunk.OYRZ2DEI.js} +1 -1
- package/dist/preview/{chunk.4T67XS2D.js → chunk.P5PXWOHI.js} +1 -1
- package/dist/preview/{chunk.KYKHZZT7.js → chunk.PRCWGE7A.js} +1 -1
- package/dist/preview/{chunk.DUY27OJV.js → chunk.PXHBPLTQ.js} +1 -1
- package/dist/preview/chunk.PXVJBL2C.js +1 -0
- package/dist/preview/{chunk.V4GAOZAW.js → chunk.Q3XKNZQW.js} +1 -1
- package/dist/preview/chunk.Q5IAXTF5.js +25 -0
- package/dist/preview/{chunk.2534FLZZ.js → chunk.QPP3OJVR.js} +1 -1
- package/dist/preview/{chunk.GLTWLQ6L.js → chunk.QRCTTDDQ.js} +1 -1
- package/dist/preview/{chunk.CMEETACI.js → chunk.QWQBPJ4U.js} +1 -1
- package/dist/preview/chunk.QXCYAFRT.js +1 -0
- package/dist/preview/{chunk.ESK3UZRC.js → chunk.R6FHEEJ7.js} +1 -1
- package/dist/preview/{chunk.GMAXA5GV.js → chunk.R77TACXU.js} +1 -1
- package/dist/preview/{chunk.HFKGND5Q.js → chunk.R7CRV2FE.js} +1 -1
- package/dist/preview/{chunk.XWXYC3BJ.js → chunk.R7ZZJOJW.js} +1 -1
- package/dist/preview/{chunk.S32AGJ3W.js → chunk.RBWYXVUW.js} +1 -1
- package/dist/preview/{chunk.N5XONWU2.js → chunk.RMRO5JZX.js} +1 -1
- package/dist/preview/{chunk.FFCUZPTC.js → chunk.RWCWRJJC.js} +1 -1
- package/dist/preview/{chunk.CXC5FOIO.js → chunk.S4ZWBCYC.js} +1 -1
- package/dist/preview/{chunk.UVAWWCFW.js → chunk.SELLAVIQ.js} +1 -1
- package/dist/preview/{chunk.7NQROWHU.js → chunk.SM6HTPYF.js} +1 -1
- package/dist/preview/chunk.SZCZD2GM.js +1 -0
- package/dist/preview/{chunk.SPU3BVAO.js → chunk.T2Q3AAQI.js} +1 -1
- package/dist/preview/{chunk.BV6HKTHK.js → chunk.T6KKNWZT.js} +1 -1
- package/dist/preview/{chunk.76QSPWSJ.js → chunk.U6PCKJ26.js} +1 -1
- package/dist/preview/{chunk.FEIJ7ETK.js → chunk.UEPVA6IS.js} +1 -1
- package/dist/preview/{chunk.PYRJDTVS.js → chunk.ULAMIQ52.js} +1 -1
- package/dist/preview/chunk.UMS7XRPO.js +1 -0
- package/dist/preview/{chunk.RNOBACJ6.js → chunk.VGIWQNJB.js} +1 -1
- package/dist/preview/{chunk.3H7YIKKC.js → chunk.VGTEEANA.js} +1 -1
- package/dist/preview/{chunk.ZZODDJYK.js → chunk.VKOCD5CL.js} +1 -1
- package/dist/preview/{chunk.P4CLT32V.js → chunk.VOHRQXCF.js} +5 -5
- package/dist/preview/chunk.W5UJLKIT.js +1 -0
- package/dist/preview/{chunk.E2R6VFZX.js → chunk.WUEU3QBL.js} +1 -1
- package/dist/preview/{chunk.34HGT7HQ.js → chunk.WWUMSCYC.js} +1 -1
- package/dist/preview/{chunk.3MU37W5D.js → chunk.XLM4ONUB.js} +1 -1
- package/dist/preview/{chunk.TVWN5I4M.js → chunk.XPR3QFF4.js} +1 -1
- package/dist/preview/{chunk.BYY7YXBI.js → chunk.XZLKTOJE.js} +1 -1
- package/dist/preview/{chunk.LYIHPVDZ.js → chunk.Y37DXEHG.js} +1 -1
- package/dist/preview/{chunk.OW72XZF4.js → chunk.YKACMLLU.js} +1 -1
- package/dist/preview/{chunk.DEH6O3K4.js → chunk.YKXUDACI.js} +1 -1
- package/dist/preview/{chunk.7G4M2PX3.js → chunk.YUEOUV7G.js} +2 -2
- package/dist/preview/chunk.YYWLYVAW.js +1 -0
- package/dist/preview/chunk.Z2JMTRF4.js +1 -0
- package/dist/preview/{chunk.SKG4IHT5.js → chunk.Z2UFPOAN.js} +1 -1
- package/dist/preview/chunk.ZEKKIMKI.js +1 -0
- package/dist/preview/{chunk.RMMJQYJJ.js → chunk.ZK42LPF5.js} +1 -1
- package/dist/preview/{chunk.GRYS6VSF.js → chunk.ZZGXVYW2.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.3SBTQ66X.js +0 -1
- package/dist/preview/chunk.4N5R4K6O.js +0 -1
- package/dist/preview/chunk.AJAMTRZ3.js +0 -1
- package/dist/preview/chunk.AL45OI4A.js +0 -1
- package/dist/preview/chunk.CUB4IAUJ.js +0 -1
- package/dist/preview/chunk.CUN4VN42.js +0 -1
- package/dist/preview/chunk.ET3XJDPX.js +0 -1
- package/dist/preview/chunk.FG5ZFYYL.js +0 -1
- package/dist/preview/chunk.FTBH7CPZ.js +0 -1
- package/dist/preview/chunk.GYTVL6GR.js +0 -359
- package/dist/preview/chunk.JBR66TUP.js +0 -1
- package/dist/preview/chunk.JG2FGZF2.js +0 -18
- package/dist/preview/chunk.MMVCZOEX.js +0 -32
- package/dist/preview/chunk.NNUUD26E.js +0 -1
- package/dist/preview/chunk.QEQQXWYU.js +0 -1
- package/dist/preview/chunk.QPAJCRFB.js +0 -1
- package/dist/preview/chunk.S4CKKT3C.js +0 -1
- package/dist/preview/chunk.TMYGLXR6.js +0 -25
- package/dist/preview/chunk.UCUWEYKM.js +0 -1
- package/dist/preview/chunk.XZVPVAIS.js +0 -1
- package/dist/preview/chunk.Y2ZBVWII.js +0 -1
- package/dist/preview/chunk.Y3LTHEN7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.25VJPUDH.js";import"./chunk.
|
|
1
|
+
import"./chunk.KHRS2SKB.js";import"./chunk.25VJPUDH.js";import"./chunk.NB6WN4DO.js";import"./chunk.MBNZ2HK7.js";import"./chunk.NHIPVAGR.js";import{a as L,b as R,c as N}from"./chunk.R6FHEEJ7.js";import{b as T}from"./chunk.LESRQN3Y.js";import"./chunk.7UJZP3YK.js";import"./chunk.R77TACXU.js";import"./chunk.JOWJNIWH.js";import"./chunk.6JERQFZI.js";import"./chunk.7XJ3XQZD.js";import"./chunk.52J42KR5.js";import"./chunk.T2Q3AAQI.js";import"./chunk.63SRVTG2.js";import"./chunk.C4EPMV7O.js";import"./chunk.G7XKQNOL.js";import"./chunk.7KZ44FEU.js";import"./chunk.HJCQ6I3S.js";import"./chunk.JQBP6QWQ.js";import"./chunk.I2W7HSBU.js";import"./chunk.BJL6EL6B.js";import"./chunk.Y37DXEHG.js";import"./chunk.DXZ5VYCQ.js";import"./chunk.J2R55TM7.js";import"./chunk.KPUX27ZT.js";import"./chunk.DIS7JS7X.js";import"./chunk.D2T563AA.js";import"./chunk.JV7FLVUV.js";import"./chunk.GL3YVGAP.js";import"./chunk.VGTEEANA.js";import"./chunk.SZCZD2GM.js";import"./chunk.7FZY5E2U.js";import"./chunk.7354O67H.js";import"./chunk.XLM4ONUB.js";import"./chunk.XOZU4OFA.js";import"./chunk.C7EEYSAM.js";import"./chunk.ZJXUWOG3.js";import"./chunk.TI4OSTQV.js";import"./chunk.FEBCIEI3.js";import"./chunk.WVUJXDXZ.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.GZHZLJBF.js";import{r as C}from"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{G as S,I as $,T as p,aa as x,ca as A}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Oc as k,ca as h}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as i}from"./chunk.AJZBJBMO.js";var r=i(S(),1);var l=i(S(),1);var g=i(p(),1);var m={font:"inherit",fontSize:"0.875rem",minHeight:24,padding:0,border:0,borderRadius:2,background:"transparent",boxShadow:"none",color:"var(--graview-accent)",textDecoration:"underline",textUnderlineOffset:3,textAlign:"start",cursor:"pointer"};var e=i(p(),1);function Y({page:n=!1,go:E,onPick:y,onDiscard:D}){let{store:d,seatTalk:c}=x(),u=$(c),M=N(),b=E??M,{keep:P}=L(b),[H,f]=(0,r.useState)(!1);A();let t=u.draft;(0,r.useEffect)(()=>f(!1),[t]),(0,r.useEffect)(()=>{n||R(!1)},[n]);let v=(0,r.useRef)(null),w=t!==null&&!n;if((0,r.useLayoutEffect)(()=>{let s=v.current;if(!w||!s?.parentElement)return;let o=[];for(let a=s.previousElementSibling;a;a=a.previousElementSibling)a instanceof HTMLElement&&!a.inert&&a.tagName!=="STYLE"&&(a.inert=!0,o.push(a));return()=>{for(let a of o)a.inert=!1}},[w]),!t)return null;let G=T(t.drawn),F=d.schema.tryDefinition(t.kind),q=d.graph.nodesOfKind(t.kind).filter(s=>h(F,s)),z=()=>{c.setDraft(null),D?.()};return(0,e.jsxs)("section",{ref:v,"data-testid":"draft-frame","data-graview-draft-frame":n?"page":"scene","aria-label":`Draft: ${t.title}`,style:n?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:12,zIndex:k("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:12,boxShadow:"var(--graview-lift-high)",overflow:"hidden",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...K,...n?{}:{padding:"10px 16px"}},children:[n?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:H,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{f(!0),P(t).finally(()=>f(!1))},style:m,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:z,style:m,children:"Discard"})]}),u.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:n?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:u.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,role:"group","aria-label":t.title,tabIndex:0,style:n?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:s=>{let o=s.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!o||!d.graph.getNode(o))return;s.preventDefault();let a=d.graph.getNode(o);y?(c.setDraft(null),y(o)):b({to:"record",id:o,kind:a.kind,label:o,address:"",said:""})},children:(0,e.jsx)(C,{kind:t.kind,view:t.title,children:(0,e.jsx)(G,{nodes:q,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var K={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{Y as DraftFrame};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as K}from"./chunk.
|
|
1
|
+
import{o as K}from"./chunk.AI2HBKVP.js";import{G as R,T as x,aa as N,ba as $}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{hd as g,ia as w,id as b,jd as f,pd as h,rd as k}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as v}from"./chunk.AJZBJBMO.js";var u=v(R(),1);var o=v(x(),1),E=()=>()=>{};function C(e){let n=(0,u.useMemo)(()=>e?.onChange?i=>e.onChange(i):E,[e]),t=()=>e?.current()??b;return(0,u.useSyncExternalStore)(n,t,t)}var D=(e,n)=>e.lens?n.may.lenses:n.may.views;async function p(e,n,t){try{return await n(),!0}catch(i){return e?.notify({kind:"toast",tone:"bad",sentence:i instanceof Error&&i.message?i.message:t}),!1}}function H(e,n,t,i,r){let s=e.name;return p(r,()=>n==="view"&&s!==void 0?i?t.hide(s):t.show(s):t.lens?.({op:"set-lens-hidden",title:e.title,on:e.kind,hidden:i}),i?`\u201C${e.title}\u201D could not be hidden.`:`\u201C${e.title}\u201D could not be shown.`)}function L(e,n,t,i,r){return p(r,()=>t.lens?.({op:"set-lens-hidden",title:e,hidden:i}),i?`\u201C${n}\u201D could not be hidden.`:`\u201C${n}\u201D could not be shown.`)}function V(e,n,t){return p(t,()=>n.restore(e.name),`\u201C${e.title}\u201D could not be restored.`)}async function M(e,n,t,i){let r=n==="view"&&e.name!==void 0?e.name:g(e.title),s=await p(i,()=>n==="view"&&e.name!==void 0?t.remove(e.name,{title:e.title,kind:e.kind}):t.lens?.({op:"remove-lens",title:e.title,on:e.kind}),`\u201C${e.title}\u201D could not be deleted.`);return s&&i?.notify({kind:"toast",id:`deleted-view-${r}`,sentence:`Deleted \u201C${e.title}\u201D. It is under Recently deleted in the places for ${30} days.`,action:{label:"Restore",onSelect:()=>void V({name:r,title:e.title},t,i)}}),s}function G(){let e=$(),n=e?.keptViews,t=C(n),i=e?.views;return(0,u.useMemo)(()=>{if(!n||!i)return null;let r=d=>f(d,t,n),s=new Set,m=i.places().filter(d=>{if(!d.hidden||r(d)===null)return!1;let c=`${d.name??""}|${d.title}`;return s.has(c)?!1:(s.add(c),!0)}),l=e?.store.schema,y=t.may.lenses&&n.lens&&l?(i.arrangement?.()?.hide??[]).filter(d=>l.tryDefinition(d)!==void 0).map(d=>({kind:d,title:w(l,d),path:h(l,d)})):[];return{keeper:n,hidden:m,lists:y,removed:t.removed.filter(d=>D(d,t)),how:r}},[n,t,i,e?.store.schema])}function T(e,n){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(n??"en-US",{month:"short",day:"numeric"})}var I=`.graview-bar-list li.graview-bar-tidied{display:flex;align-items:flex-start;gap:8px;padding:0 0 0 2px}
|
|
2
2
|
.graview-bar-tidied>.graview-bar-item,.graview-bar-gone{flex:1 1 auto;min-width:0}
|
|
3
3
|
.graview-bar-gone{display:grid;gap:1px;padding:7px 8px;font-size:.875rem;line-height:1.3;overflow-wrap:anywhere;color:var(--graview-ink-muted)}
|
|
4
4
|
.graview-bar-gone small{font-size:.75rem}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as le,b as I,d as ue,g as ye,h as me,i as pe}from"./chunk.
|
|
1
|
+
import{a as le,b as I,d as ue,g as ye,h as me,i as pe}from"./chunk.7EA7THSM.js";import{$ as q,C as T,Cb as fe,Da as re,F as Z,Fa as ie,G as O,H as B,I as V,Ib as v,Kb as ce,Lb as C,Na as W,O as x,R as X,Ra as se,S as Y,Ta as de,Va as ae,W as j,Y as H,da as M,fa as L,ka as _,ma as J,sa as Q,ta as ee,ua as ne,va as te,ya as oe}from"./chunk.VOHRQXCF.js";var $e=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,Re={day:"day",week:"week",month:"month",year:"year"},F=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function xe(t,e,n){let o=e.interval??1,i=Re[e.every],s=t.slice(0,10),l=o===1?`Every ${i}`:o===2?`Every other ${i}`:`Every ${o} ${i}s`,d;if(e.every==="week"){let y=(e.on?.length?e.on:[W[new Date(`${s}T00:00:00Z`).getUTCDay()]]).map(r=>H(W.indexOf(r),"long",n));d=o===1?`Every ${F(y)}`:o===2?`Every other ${F(y)}`:`${l} on ${F(y)}`}else if(e.every==="month"){let y=(e.on?.length?e.on:[+s.slice(8,10)]).map(r=>r===-1?"the last day":`the ${$e(Number(r))}`);d=`${l} on ${F(y)}`}else e.every==="year"?d=`${l} on ${j(s,n)}`:d=l;return O.test(t)&&(d+=` at ${Y(t,n)}`),e.until&&(d+=`, until ${x(e.until,n)}`),e.count&&(d+=`, ${e.count===1?"once":`${e.count} times`}`),d}function ge(t,e,n={}){if(!de(e)||typeof t!="string")return;let o=n.today??V(),i=ae(t,e,o),s=xe(t,e,n.locale),l=i.slice(0,4)===o.slice(0,4)?j(i.slice(0,10),n.locale):x(i.slice(0,10),n.locale);return i.slice(0,10)<o?`${s}, last ${l}`:`${s}, next ${l}`}function on(t,e){let n=new Map,o=new Map;for(let i of t){let s=M(e(i.kind),i).trim().toLowerCase();o.set(s,[...o.get(s)??[],i])}for(let i of o.values()){if(i.length<2)continue;let s=new Map;for(let l of i)s.set(l.kind,[...s.get(l.kind)??[],l]);for(let[l,d]of s){if(d.length===1){n.set(d[0].id,J(e(l),l));continue}let y=d.map(f=>new Map(Se(f,e(f.kind)).map(m=>[m.key,m.alone]))),r=[...new Set(y.flatMap(f=>[...f.keys()]))],u=f=>y.every(m=>!/\d/.test(m.get(f)??"")),h=[...r.filter(u),...r.filter(f=>!u(f))],b=(f,m)=>m.map(p=>y[f].get(p)??"").filter(Boolean).join(" \xB7 "),S=f=>new Set(d.map((m,p)=>b(p,f))).size===d.length&&d.every((m,p)=>b(p,f)!==""),c=h.find(f=>S([f])),a=c?void 0:h.flatMap((f,m)=>h.slice(m+1).map(p=>[f,p])).find(f=>S(f));d.forEach((f,m)=>{if(c||a)return void n.set(f.id,b(m,c?[c]:a));let p=h.find($=>{let w=y[m].get($);return w!==void 0&&w!==""&&y.every((R,k)=>k===m||R.get($)!==w)});n.set(f.id,p?y[m].get(p):`${m+1} of ${d.length}`)})}}return n}function rn(t,e){return t?.describe?t.describe(e):`${e.kind} ${M(t,e)}`}var _e=new Set(["id","kind","label"]);function ve(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function Se(t,e,n={}){let o=e?.display,i=new Set([..._e,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!M(e,t).includes(t.label)&&i.delete("label");let s=(n.said??[]).filter(c=>!!c),l=s.filter(c=>c.endsWith("\u2026")).map(c=>c.replace(/…$/,"").trim()).filter(c=>c.length>12),d=[],y=e?.fields?.shape,r=e?.fieldRoles,u=n.glance?o?.glance??[r?.who,r?.when].filter(c=>!!c):he(o?.page),h=n.glance&&o?.glance!==void 0,S=[...new Set(h?u:[...u,...Ne(e),...Object.keys(t)])].filter(c=>Object.hasOwn(t,c)).map(c=>[c,t[c]]);for(let[c,a]of S){if(i.has(c)||a===void 0||a===null)continue;let f=o?.format?.[c],m=f?[]:ne(a);if(m[0]&&n.glance)continue;let p=e?.fields?.shape?.[c],$=!f&&typeof a=="string"&&oe(p)?a:void 0,w=!f&&typeof a=="string"&&le(p);if($&&n.glance)continue;let R=f?void 0:ie(p),k=R?{relation:R,refs:re(a,R)}:void 0;if(k&&(n.glance||k.refs.length===0)||!m[0]&&typeof a=="object"&&(!Array.isArray(a)||a.some(g=>typeof g=="object"&&g!==null))&&f===void 0)continue;let U=typeof a=="string"&&!f?ge(a,t[`${c}Repeat`],{locale:n.locale}):void 0,N=m[0]?m.map(g=>`${g.caption?`${g.name} \u2014 ${g.caption}`:g.name}${Q(g)?` (${ee(g)})`:""}`).join(", "):Array.isArray(a)?a.join(", "):typeof a=="boolean"?a?"Yes":"No":String(a),E=f?void 0:ye(e,c),G=pe(E,a),K=!f&&!E&&typeof a=="number"?v(e?.fields?.shape?.[c]):void 0,z=k?k.refs.length>1?`${k.refs.length} linked records`:"linked record":f?f(a):K?ce(a,K):me(E,a,n.locale)??(Array.isArray(a)||typeof a=="boolean"?N:typeof a=="string"&&U!==void 0?U:typeof a=="string"&&Z.test(a)?x(a,n.locale):typeof a=="string"&&O.test(a)?X(a,n.locale,n.timeZone):typeof a=="string"&&Fe(e,c)?I(e,c,a):N),P=typeof a=="string"&&Te(e,c,z),A=(n.glance||n.excerpt)&&!f&&(P||w)?ue(z,{markdown:w}):z;if(s.includes(A)||l.some(g=>A.startsWith(g))||n.glance&&(typeof a=="string"||typeof a=="number")&&s.some(g=>ve(g,A)))continue;let D=_(e,c),Ae=typeof a=="number"?`${D} ${A}`:typeof a=="boolean"&&!f?`${D}: ${A.toLowerCase()}`:A;if(d.push({key:c,label:D,value:A,stored:N,alone:Ae,long:P,...w?{markdown:!0}:{},...m[0]?{files:m}:{},...$?{app:$}:{},...k?{linked:k}:{},...G?{href:G}:{},...se(y?.[`${c}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&d.length>=n.limit)break}return Oe(d,e)}function Oe(t,e){let n=new Map;for(let o of t){let i=Me(e,o.key);i&&n.set(o.key,new Set(i.map(s=>I(e,o.key,s).toLowerCase())))}return n.size<2?t:t.map(o=>{let i=n.get(o.key);return i!==void 0&&[...n].some(([l,d])=>l!==o.key&&[...i].some(y=>d.has(y)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function Me(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function Fe(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function Ne(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function he(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var Ee=500,ze=160;function De(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function Te(t,e,n){return De(t?.fields?.shape?.[e])?.checks?.some(i=>i._zod?.def?.check==="max_length"&&(i._zod.def.maximum??0)>Ee)?!0:typeof n=="string"&&(n.includes(`
|
|
2
2
|
`)||n.length>ze)}function sn(t,e){let n=t?.display?.page,o=n?.groups??[],i=new Map(e.map(r=>[r.key,r])),s=new Set(he(n)),l=r=>r.flatMap(u=>i.has(u)?[i.get(u)]:[]),d=e.filter(r=>!s.has(r.key));return[{fields:[...l(n?.fields??[]),...o.length>0?[]:d]},...o.map(r=>({title:r.title,fields:l(r.fields)})),...o.length>0?[{title:"Details",fields:d}]:[]].filter(r=>r.fields.length>0)}function je(t,e,n){let o=[...e?.creates??[],...e?.subject&&e.subject.kinds!=="*"?e.subject.kinds:[]];for(let i of o){let s=t.tryDefinition(i),l=s?.fields?.shape??{};if(!s||!(n in l))continue;let d=s.display?.format?.[n];return{label:s.display?.labels?.[n]??_(s,n),option:r=>d?d(r):L(r)}}return{label:_(void 0,n),option:i=>L(i)}}function cn(t,e,n){if(n instanceof fe){let o=e.find(s=>s.name===n.mutation);return`Not yet: ${n.issues.map(s=>{let l=s.path.length>0?je(t,o,String(s.path[0])).label:void 0;return l?`${l} \u2014 ${q(s.message)}`:s.message}).join("; ")}.`}return n instanceof Error?n.message:String(n)}var Le=t=>/^[A-Z]{3}$/.test(t??"");function ke(t){let{format:e,unit:n,currency:o,locale:i}=t,s=Le(n),l=e==="money"||!e&&s,d=l?s?n:o:void 0;return{...l?{format:"money"}:e?{format:e}:{},...n&&!(l&&s)?{unit:n}:{},...d?{currency:d}:{},...i?{locale:i}:{}}}function yn(t){switch(t.format){case"money":return t.currency?`An amount of money in ${t.currency}: a plain number, 1250.5 for 1,250.50 ${t.currency}.`:"An amount of money, in no named currency: a plain number.";case"percent":return"A fraction said as a percent: 0.15 is 15%.";default:return t.unit?`A number of ${t.unit}.`:"A number."}}function be(t){let e=T(t)?.innerType;return e===void 0?t:be(e)}var We={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ce=t=>(t?._zod?.def?.checks??[]).map(e=>e._zod?.def).filter(e=>e!==void 0);function we(t){let e=be(t),n=T(e),o=n?.type,i=Ce(e);if(o==="enum")return{type:"choice",options:Object.keys(n?.entries??{})};let s=te(e);if(s)return s==="image"?{type:"file",image:!0}:s==="video"?{type:"file",video:!0}:{type:"file"};if(o==="boolean")return{type:"boolean"};if(o==="array"){let l=we(n?.element);return l.type==="unknown"?{type:"unknown"}:{type:"several",of:l}}if(o==="number"){let l,d,y;for(let r of i){r.check==="multiple_of"&&typeof r.value=="number"?y=r.value:r.check==="number_format"&&(r.format==="safeint"||r.format==="int32"||r.format==="uint32")&&(y??=1);let u=r.check==="number_format"&&r.format?We[r.format]:void 0,h=u?u[0]:r.check==="greater_than"&&r.inclusive&&typeof r.value=="number"?r.value:void 0,b=u?u[1]:r.check==="less_than"&&r.inclusive&&typeof r.value=="number"?r.value:void 0;h!==void 0&&(l=l===void 0?h:Math.max(l,h)),b!==void 0&&(d=d===void 0?b:Math.min(d,b))}return{type:"number",...l===void 0?{}:{min:l},...d===void 0?{}:{max:d},...y===void 0?{}:{step:y},...C(e)==="duration"?{duration:!0}:{},...v(t)?{amount:ke(v(t))}:{}}}if(o==="string"){if(i.some(u=>u.fn===B||u.format==="datetime")||n?.format==="datetime")return{type:"date",time:!0,instant:!0};let d=[n?.pattern,...i.map(u=>u.pattern)].filter(u=>u instanceof RegExp).map(u=>u.source);if(d.some(u=>u.includes("\\d{4}")))return d.some(u=>u.includes("\\d{2}:\\d{2}"))?{type:"date",time:!0}:{type:"date"};let y=i.some(u=>u.check==="max_length"&&typeof u.maximum=="number"&&u.maximum>500),r=C(e);return y?{type:"text",long:!0}:r==="phone"||r==="place"?{type:"text",holds:r}:{type:"text"}}return{type:"unknown"}}function An(t,e){let n=t?.shape;return!n||!(e in n)?{type:"unknown"}:we(n[e])}export{xe as a,on as b,rn as c,Se as d,sn as e,ke as f,yn as g,be as h,we as i,An as j,je as k,cn as l};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k,b as A,c as L,d as _,e as E,r as B,s as V,t as H,u as N,v as q}from"./chunk.OJGHDWI6.js";import"./chunk.
|
|
1
|
+
import{a as k,b as A,c as L,d as _,e as E,r as B,s as V,t as H,u as N,v as q}from"./chunk.OJGHDWI6.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";var W=["drawElementImageToTexture","copyElementImageToTexture"],S=null,P=(r,e)=>r==="texture"?{texture:e}:{destination:{texture:e}};function Z(){return typeof globalThis>"u"?void 0:globalThis}function v(r,e){let t=[],n=Z(),o=!!(n?.navigator&&"gpu"in n.navigator);o||t.push("navigator.gpu is absent \u2014 WebGPU is unavailable.");let i=r??n?.GPUQueue?.prototype??void 0,a=null;if(i){for(let d of W)if(typeof i[d]=="function"){a=d;break}}a||t.push("No element-capture method on GPUQueue. Run Chromium 147+ with --enable-blink-features=CanvasDrawElement.");let c=e??n?.HTMLCanvasElement?.prototype??void 0,l=typeof c?.updateElementGeometry=="function";l||t.push("canvas.updateElementGeometry is absent \u2014 geometry cannot be reported.");let p=typeof c?.requestPaint=="function";p||t.push("canvas.requestPaint is absent \u2014 there is no capture-safe moment to hook.");let w=!1,h="unknown";if(typeof document<"u"){let d=document.createElement("canvas");w="layoutSubtree"in d||typeof d.captureElementImage=="function","layoutSubtree"in d?h="no":typeof d.captureElementImage=="function"&&(h="yes")}return{available:a!==null,captureMethod:a,geometrySync:l,hitTestFollowsGeometry:l?h:"no",layoutSubtree:w,paintEvents:p,webgpu:o,usable:o&&a!==null,notes:t}}var g=class extends Error{constructor(t){super(`HTML-in-Canvas is unavailable:
|
|
2
2
|
${t.notes.join(`
|
|
3
3
|
`)}`);this.capabilities=t;this.name="PlatformUnavailableError"}};function G(r,e,t){let n=r;for(let o of W){let i=n[o];if(typeof i=="function"){if(S){i.call(n,{source:e},P(S,t));return}try{i.call(n,{source:e},P("texture",t)),S="texture"}catch(a){if(!(a instanceof TypeError)||!/texture/i.test(a.message))throw a;i.call(n,{source:e},P("destination",t)),S="destination"}return}}throw new g(v(r))}function M(r,e=!0){e?r.setAttribute("drawable",""):r.removeAttribute("drawable")}function F(r){let e=r.changedElements;return e?new Set(Array.from(e)):null}function ee(r,e){let t=r;if(typeof t.captureElementImage!="function")throw new g(v(void 0,r));return t.captureElementImage(e)}function O(r,e,t){let n=r;if(typeof n.updateElementGeometry!="function")throw new g(v(void 0,r));n.updateElementGeometry(e,t)}function te(r,e){r.clearElementGeometry?.(e)}function m(r){r.requestPaint?.()}function D(r,e=!0){let t=r;e?t.setAttribute("content","drawable"):t.removeAttribute("content"),"layoutSubtree"in t?t.layoutSubtree=e:e?t.setAttribute("layoutsubtree",""):t.removeAttribute("layoutsubtree")}var I=`
|
|
4
4
|
struct Plane {
|
|
@@ -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.DGWNVDZB.js";import{D as v,G as I,T as h,aa as w}from"./chunk.Q5IAXTF5.js";import{Ya as g}from"./chunk.VOHRQXCF.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.7IOC6U3C.js","./chunk.7FZY5E2U.js","./chunk.7354O67H.js","./chunk.XLM4ONUB.js","./chunk.XOZU4OFA.js","./chunk.C7EEYSAM.js","./chunk.DGWNVDZB.js","./chunk.TI4OSTQV.js","./chunk.3TME4BG3.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.2EB7COX5.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 U,b as X,c as L}from"./chunk.KVEDMKUN.js";import{a as O,b as R}from"./chunk.
|
|
1
|
+
import{a as U,b as X,c as L}from"./chunk.KVEDMKUN.js";import{a as O,b as R}from"./chunk.J263VQF5.js";import{a as _,e as Q}from"./chunk.RWCWRJJC.js";import{e as q,f as z,g as J}from"./chunk.NVNQSZ43.js";import"./chunk.FJEXINFF.js";import{G as K,Ha as I,Ia as M,M as T,O as G,T as D,ba as x,ia as v,la as V,ma as H,oa as C,qa as j}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b}from"./chunk.AJZBJBMO.js";var a=b(K(),1);var s=b(D(),1),Y=e=>({...e.node?{node:{id:e.node.id}}:{},...e.nodes?{nodes:e.nodes.map(t=>({id:t.id}))}:{},...e.label!==void 0?{label:e.label}:{},fidelity:e.fidelity,cardinality:e.cardinality,mode:e.mode,selected:e.selected,...e.implicated?{implicated:e.implicated}:{},...e.flagged?{flagged:e.flagged}:{}});function B(e){let t=G(),r=t?.past?.seq,i=t?.host?.viewAt,n=(0,a.useMemo)(()=>r===void 0||!i||e.draft?void 0:i(e.manifest.name,r),[i,r,e]);return(0,a.useMemo)(()=>n===null?null:n===void 0?e:{...e,worker:n},[n,e])}function E({definition:e,store:t,principal:r,input:i,goTo:n,places:o,scheme:c,brand:l,onFailure:u,drawsItsOwn:m,tick:f}){let p=(0,a.useRef)(null),w=(0,a.useRef)(null),y=T(),k=(0,a.useContext)(M),d=(0,a.useRef)({input:i,goTo:n,places:o,onFailure:u,brand:l,hostFiles:y,told:k});d.current={input:i,goTo:n,places:o,onFailure:u,brand:l,hostFiles:y,told:k},(0,a.useEffect)(()=>{let P=p.current;if(!P)return;let A=e.file??(d.current.hostFiles?.src?g=>d.current.hostFiles?.src?.(g)??g:void 0);typeof e.worker=="function"&&L(e.worker).catch(()=>{});let N=R(O,({mountWorkerView:g})=>{w.current=g(P,{manifest:e.manifest,worker:e.worker,store:t,principal:r,input:()=>d.current.input?.()??{},goTo:()=>d.current.goTo,places:()=>d.current.places?.()??[],brand:()=>d.current.brand,onFailure:(W,$)=>d.current.onFailure(W,$),...m?{fallback:!1}:{},...e.limits?{limits:e.limits}:{},...e.author?{author:e.author}:{},...e.onProblem?{onProblem:e.onProblem}:{},...e.asset?{asset:e.asset}:{},...A?{file:A}:{},...e.images?{images:e.images}:{},...e.links?{links:e.links}:{},files:()=>d.current.hostFiles,onContentHeight:W=>d.current.told?.(W)})});return()=>{N(),w.current?.dispose(),w.current=null}},[e,t,r]),(0,a.useEffect)(()=>w.current?.update(),[c,l,f]);let h=(0,s.jsx)("div",{ref:p,"data-worker-view-place":e.manifest.name});if(!e.draft)return h;let F=e.manifest.title??e.manifest.name;return(0,s.jsxs)("div",{role:"group","aria-label":`Draft: ${F}`,"data-graview-draft-view":e.manifest.name,style:{display:"grid",gap:8,alignContent:"start",minWidth:0},children:[(0,s.jsxs)("p",{"data-testid":"draft-view-line",style:Z,children:[(0,s.jsxs)("span",{children:["Draft \u2014 ",(0,s.jsx)("span",{style:{color:"var(--graview-ink)",fontWeight:600},children:F})]}),(0,s.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,s.jsx)("span",{children:"Not kept"})]}),h]})}var Z={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};function S(e,t={}){let r=t.fallback,i=e.manifest.replaces==="page";function n(o){let c=x(),l=v(),u=(0,a.useContext)(I),[m,f]=(0,a.useState)(null),p=(0,a.useRef)(o);p.current=o;let w=B(e);if(!c)return null;if(w===null)return r&&!(u&&V(r)&&!i)?(0,s.jsx)(r,{...o}):null;if(m&&r)return u&&V(r)&&!i?null:(0,s.jsx)(r,{...o});let y=t.beside&&!(u&&V(t.beside))?t.beside:void 0,k=(0,s.jsx)(E,{definition:w,store:c.store,principal:c.principal,input:()=>Y(p.current),goTo:l,places:()=>c.views.places(),scheme:c.scheme,brand:c.brand,tick:o,drawsItsOwn:r!==void 0,onFailure:(d,h)=>{f(d),e.onFailure?.(d,h)}});return y?(0,s.jsxs)("div",{"data-worker-view-beside":e.manifest.name,style:{display:"grid",gap:12,minWidth:0},children:[k,(0,s.jsx)(y,{...o})]}):k}return n.displayName=`WorkerView(${e.manifest.name})`,n}function ee(e,t){let{manifest:r}=t;if(r.attach==="home"){if(!e.home)throw new Error(`The worker view "${r.name}" is the home's body: draw it with workerHome, on the home.`);let m=t.draft?void 0:e.homeView?.(),f=S(t,m?{fallback:m}:{});return e.home(r.bleed===!0?C(f):f),e}let i={cardinality:r.cardinality,fidelity:"full"},n=e.lookup(r.attach,i)??e.resolve(r.attach,i)?.view,o=r.cardinality==="one",c=t.draft===!0,l=S(t,{...n&&!c?{fallback:n}:{},...o&&r.replaces!=="page"&&n?{beside:n}:{}});o&&r.replaces==="page"&&H(l);let u=n?.says;return o&&r.replaces!=="page"&&typeof u=="function"&&(l.says=u),r.bleed===!0&&C(l),l.flows=r.flows!==!1,j(l,r.scene?.maxHeight!==void 0?{maxHeight:r.scene.maxHeight}:{}),e.register(r.attach,i,l,r.title?{title:r.title,...c?{}:{name:r.name},lens:"view",...r.reads?.kinds?.length?{reads:r.reads.kinds}:{}}:void 0),e}function re(e,t={}){let r=t.fallback;function i({context:n}){let o=x(),c=v(),[l,u]=(0,a.useState)(null),m=B(e);return(l||m===null)&&r?(0,s.jsx)(r,{context:n}):m===null?null:(0,s.jsx)(E,{definition:m,store:n.store,principal:n.principal??o?.principal??{kind:"human"},goTo:c,...o?{places:()=>o.views.places(),scheme:o.scheme,brand:o.brand}:{},drawsItsOwn:r!==void 0,onFailure:(f,p)=>{u(f),e.onFailure?.(f,p)}})}return i.displayName=`WorkerHome(${e.manifest.name})`,i}export{z as checkManifest,U as checkViewSource,Q as judgeCodeAct,q as manifestActs,ee as registerWorkerView,_ as sightIsTotal,X as viewScript,re as workerHome,S as workerView,J as workerViewProps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b,b as c,c as d,d as e,e as f}from"./chunk.CHMUL36A.js";import"./chunk.U6PCKJ26.js";import"./chunk.I43ONAEL.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import{Ab as a}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{a as ActRefusal,e as compileDocumentWithoutCheck,d as effectsOf,f as inDocumentWords,c as kindShapes,b as readDocument};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as U}from"./chunk.
|
|
1
|
+
import{b as U}from"./chunk.GL3YVGAP.js";import"./chunk.AI2HBKVP.js";import{G as ne,T as z,aa as R,da as $}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Pd as K,ob as W}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as L}from"./chunk.AJZBJBMO.js";var p=L(ne(),1);function b(e,t,a=!1){if(e<t.at||e===t.at&&a)return e;let o=t.at+t.removed.length;return e>=o?e+t.inserted.length-t.removed.length:a?t.at:t.at+t.inserted.length}var F=e=>e>=55296&&e<=56319,_=e=>e>=56320&&e<=57343;function X(e,t,a){let o=Math.min(e.length,t.length),n=0,l=Math.max(0,Math.min(o,t.length-a));for(;n<l&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;let r=0;for(;r<o-n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return r>0&&F(e.charCodeAt(r-1))&&r--,n>0&&_(e.charCodeAt(e.length-n))&&n--,{at:r,removed:e.slice(r,e.length-n),inserted:t.slice(r,t.length-n)}}function A(e,t){let a=Math.min(e.length,t.length),o=0;for(;o<a&&e.charCodeAt(o)===t.charCodeAt(o);)o++;o>0&&F(e.charCodeAt(o-1))&&o--;let n=0;for(;n<a-o&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;return n>0&&_(e.charCodeAt(e.length-n))&&n--,{at:o,removed:e.slice(o,e.length-n),inserted:t.slice(o,t.length-n)}}function Y(e,t){let a=s=>s.at+s.removed.length;if(a(e)<t.at)return e;if(e.at>a(t))return{...e,at:e.at+t.inserted.length-t.removed.length};let o=Math.min(e.at,t.at),n=a(e)-a(t),l=e.removed.slice(0,t.at-o)+t.inserted+(n>0?e.removed.slice(e.removed.length-n):""),r=t.at<=e.at?t.inserted+e.inserted:e.inserted+t.inserted,d=A(l,r);return{...d,at:o+d.at}}function V(e,t){let a=b(e.start,t,!0),o=e.end===e.start?a:b(e.end,t);return{start:a,end:Math.max(a,o)}}function re(e,t){let{kind:a,id:o,session:n}=e.author,l=`${a}:${o??""}:`;return t.startsWith(l)&&(!n||t.slice(l.length)===n)}function q(e,t,a,o){let n=e.anchor,l=e.head;for(let d of a)if(!(d.seq<e.rev||re(d,t)))for(let s of d.primitives)s.op!=="splice-text"||s.id!==e.node||s.field!==e.field||(n=b(n,s),l=b(l,s));let r=d=>Math.max(0,Math.min(o,d));return{start:r(n),end:r(l)}}var M=(e,t,a)=>e.ops.length>0&&e.ops.every(o=>{let n=o.mutation?.args;return o.mutation?.name===W&&n?.node===t&&n.field===a}),oe=(e,t,a,o)=>t.ops.length>0&&t.ops.every(n=>n.undoes!==void 0)&&e.batches().some(n=>t.ops.some(l=>l.undoes===n.id||l.undoes===n.ops[0]?.id)&&M(n,a,o)),G=(e,t)=>e.author.kind==="human"&&(t?.id===void 0||e.author.id===void 0||e.author.id===t.id);function I(e,t,a,o){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(!(!G(r,t)||r.undone||!M(r,a,o))&&e.canUndo(r.id).ok)return r.id}}function Z(e,t,a,o){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(G(r,t)){if(M(r,a,o))return;if(oe(e,r,a,o))return r.undone?void 0:r.id}}}var u=L(z(),1);function ie(e){let{store:t}=R(),{live:a,nodeId:o,field:n}=e,[l,r]=(0,p.useState)(null);return(0,p.useEffect)(()=>{let d=!0;return a.typing(o,n).then(s=>d&&r(s)),()=>{d=!1}},[o,n]),l&&!t.collaborative(o,n)?(0,u.jsx)(u.Fragment,{children:e.writtenWhole}):(0,u.jsx)(ae,{...e,typing:l})}function ae({nodeId:e,field:t,label:a,markdown:o,live:n,onDone:l,typing:r}){let{store:d,principal:s}=R(),f=$(e),h=J(f?.[t]),[v,ee]=(0,p.useState)(!1),y=(0,p.useRef)(null),E=(0,p.useRef)(h),w=(0,p.useRef)(!1),P=(0,p.useRef)(n);P.current=n;let B=()=>J(d.graph.getNode(e)?.[t]);(0,p.useEffect)(()=>y.current?.focus(),[v,r]);let x=(0,p.useRef)(void 0),T=()=>{x.current===void 0&&(x.current=setTimeout(()=>{x.current=void 0;let i=y.current;if(!i||i.ownerDocument.activeElement!==i)return;let c=i.selectionDirection==="backward";P.current.sayCaret({node:e,field:t,anchor:c?i.selectionEnd:i.selectionStart,head:c?i.selectionStart:i.selectionEnd,rev:d.log.length})},le))};(0,p.useEffect)(()=>()=>{clearTimeout(x.current),P.current.sayCaret(null)},[]);let D=i=>{let c=y.current;if(c){if(c.value!==i){let g=V({start:c.selectionStart,end:c.selectionEnd},A(c.value,i)),m=c.selectionDirection??"none";c.value=i,c.setSelectionRange(g.start,g.end,m)}E.current=i}},H=()=>{let i=y.current;if(!i||!r||w.current)return;let c=E.current,g=B(),m=X(c,i.value,i.selectionEnd);if(m.removed===""&&m.inserted==="")return D(g);let S=c===g?m:Y(m,A(c,g));try{r.splice(S.at,S.removed.length,S.inserted)}catch{}let k=B();if(i.value!==k){i.value=k;let N=Math.min(k.length,S.at+S.inserted.length);i.setSelectionRange(N,N)}E.current=k,T()};(0,p.useLayoutEffect)(()=>{w.current||D(h)},[h]);let te=async i=>{if(!r)return;r.flush();for(let g=0;r.waiting()>0&&g<100;g++)await new Promise(m=>setTimeout(m,30));let c=i?Z(d,s,e,t):I(d,s,e,t);if(c)try{i?d.redo(c,{author:s}):d.undo(c,{author:s})}catch{}},C=i=>{r?.flush(),n.sayCaret(null),l(i)},O=[...n.who.values()].filter(i=>i.caret?.node===e&&i.caret.field===t);return(0,u.jsxs)("div",{style:{display:"grid",gap:8,minWidth:0},"data-graview-live":t,children:[v?(0,u.jsx)("div",{"data-graview-preview":t,"aria-label":`${a}, as it will read`,role:"region",style:de,children:(0,u.jsx)(U,{text:h,markdown:!0})}):(0,u.jsxs)("div",{style:{position:"relative",minWidth:0},children:[(0,u.jsx)("textarea",{ref:y,"aria-label":a,"data-graview-field":t,defaultValue:h,readOnly:!r,rows:3,onInput:H,onCompositionStart:()=>{w.current=!0},onCompositionEnd:()=>{w.current=!1,H()},onSelect:T,onFocus:T,onPointerDown:()=>r?.flush(),onKeyDown:i=>{let c=i.key;c==="Escape"?(i.preventDefault(),C(!1)):(i.metaKey||i.ctrlKey)&&!i.altKey&&c.toLowerCase()==="z"?(i.preventDefault(),te(i.shiftKey)):(i.metaKey||i.ctrlKey)&&c==="Enter"?(i.preventDefault(),C(!1)):(c==="Enter"||ce.has(c))&&r?.flush()},onKeyUp:T,onBlur:i=>{r?.flush(),n.sayCaret(null);let c=i.relatedTarget;c instanceof Node&&i.currentTarget.closest("[data-graview-live]")?.contains(c)||C(!0)},style:ue}),O.length>0?(0,u.jsx)(se,{text:h,others:O,area:y,log:d.log.all()}):null]}),(0,u.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,u.jsx)("button",{type:"button",onClick:()=>C(!1),style:Q,children:"Done"}),o?(0,u.jsx)("button",{type:"button","aria-pressed":v,onClick:()=>ee(!v),style:Q,children:v?"Write":"Preview"}):null,(0,u.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Saved as you type \xB7 Ctrl or \u2318 Z takes back your typing"})]})]})}function se({text:e,others:t,area:a,log:o}){let n=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{let s=a.current,f=n.current;if(!s||!f)return;let h=()=>{f.scrollTop=s.scrollTop};return h(),s.addEventListener("scroll",h),()=>s.removeEventListener("scroll",h)});let l=t.map(s=>({one:s,at:q(s.caret,s.participant,o,e.length).end})).sort((s,f)=>s.at-f.at),r=[],d=0;for(let{one:s,at:f}of l){r.push(e.slice(d,f)),d=f;let h=K(s)||"Somebody";r.push((0,u.jsx)("span",{"data-graview-caret":s.participant,title:`${h} is typing here`,style:{borderLeft:`2px solid hsl(${Math.round(s.hue)} 55% 52%)`,marginLeft:-1,marginRight:-1,pointerEvents:"auto"}},s.participant))}return r.push(`${e.slice(d)}\u200B`),(0,u.jsx)("div",{ref:n,"aria-hidden":"true",style:pe,children:r})}var le=120,J=e=>typeof e=="string"?e:"",ce=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]),de={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},Q={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},j={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",borderRadius:6},ue={...j,resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)"},pe={...j,position:"absolute",inset:0,height:"100%",border:"1px solid transparent",color:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word",overflow:"hidden",pointerEvents:"none"};export{ie as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
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 $e}from"./chunk.SDO3U72B.js";import{Ga as Xn,J as Zn,Ka as kt,Kd as so,Ma as Jn,Oc as to,Od as lo,Qd as ze,Rd as Rt,Ya as Qn,Yc as no,_c as oo,bd as ro,ed as io,rc as eo,ud as ao}from"./chunk.VOHRQXCF.js";import{a as qe,b as L}from"./chunk.AJZBJBMO.js";var To=qe(w=>{"use strict";var _t=Symbol.for("react.transitional.element"),ti=Symbol.for("react.portal"),ni=Symbol.for("react.fragment"),oi=Symbol.for("react.strict_mode"),ri=Symbol.for("react.profiler"),ii=Symbol.for("react.consumer"),ai=Symbol.for("react.context"),si=Symbol.for("react.forward_ref"),li=Symbol.for("react.suspense"),di=Symbol.for("react.memo"),xo=Symbol.for("react.lazy"),ui=Symbol.for("react.activity"),So=Symbol.iterator;function ci(e){return e===null||typeof e!="object"?null:(e=So&&e[So]||e["@@iterator"],typeof e=="function"?e:null)}var Eo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Po=Object.assign,Ao={};function ge(e,t,n){this.props=e,this.context=t,this.refs=Ao,this.updater=n||Eo}ge.prototype.isReactComponent={};ge.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ge.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ko(){}ko.prototype=ge.prototype;function Ht(e,t,n){this.props=e,this.context=t,this.refs=Ao,this.updater=n||Eo}var Dt=Ht.prototype=new ko;Dt.constructor=Ht;Po(Dt,ge.prototype);Dt.isPureReactComponent=!0;var wo=Array.isArray;function Lt(){}var O={H:null,A:null,T:null,S:null},Ro=Object.prototype.hasOwnProperty;function Nt(e,t,n){var o=n.ref;return{$$typeof:_t,type:e,key:t,ref:o!==void 0?o:null,props:n}}function pi(e,t){return Nt(e.type,t,e.props)}function jt(e){return typeof e=="object"&&e!==null&&e.$$typeof===_t}function fi(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var vo=/\/+/g;function It(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fi(""+e.key):t.toString(36)}function yi(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Lt,Lt):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function me(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case _t:case ti:a=!0;break;case xo:return a=e._init,me(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+It(e,0):o,wo(r)?(n="",a!=null&&(n=a.replace(vo,"$&/")+"/"),me(r,t,n,"",function(c){return c})):r!=null&&(jt(r)&&(r=pi(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(vo,"$&/")+"/")+a)),t.push(r)),1;a=0;var s=o===""?".":o+":";if(wo(e))for(var l=0;l<e.length;l++)o=e[l],i=s+It(o,l),a+=me(o,t,n,i,r);else if(l=ci(e),typeof l=="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,i=s+It(o,l++),a+=me(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return me(yi(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function tt(e,t,n){if(e==null)return e;var o=[],r=0;return me(e,o,"","",function(i){return t.call(n,i,r++)}),o}function mi(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var bo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},gi={map:tt,forEach:function(e,t,n){tt(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return tt(e,function(){t++}),t},toArray:function(e){return tt(e,function(t){return t})||[]},only:function(e){if(!jt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=ui;w.Children=gi;w.Component=ge;w.Fragment=ni;w.Profiler=ri;w.PureComponent=Ht;w.StrictMode=oi;w.Suspense=li;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return O.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Po({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Ro.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];o.children=a}return Nt(e.type,r,o)};w.createContext=function(e){return e={$$typeof:ai,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:ii,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Ro.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Nt(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:si,render:e}};w.isValidElement=jt;w.lazy=function(e){return{$$typeof:xo,_payload:{_status:-1,_result:e},_init:mi}};w.memo=function(e,t){return{$$typeof:di,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=O.T,n={};O.T=n;try{var o=e(),r=O.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Lt,bo)}catch(i){bo(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),O.T=t}};w.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()};w.use=function(e){return O.H.use(e)};w.useActionState=function(e,t,n){return O.H.useActionState(e,t,n)};w.useCallback=function(e,t){return O.H.useCallback(e,t)};w.useContext=function(e){return O.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return O.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return O.H.useEffect(e,t)};w.useEffectEvent=function(e){return O.H.useEffectEvent(e)};w.useId=function(){return O.H.useId()};w.useImperativeHandle=function(e,t,n){return O.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return O.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return O.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return O.H.useMemo(e,t)};w.useOptimistic=function(e,t){return O.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return O.H.useReducer(e,t,n)};w.useRef=function(e){return O.H.useRef(e)};w.useState=function(e){return O.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return O.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return O.H.useTransition()};w.version="19.2.8"});var N=qe((es,Mo)=>{"use strict";Mo.exports=To()});var Wo=qe(rt=>{"use strict";var ki=Symbol.for("react.transitional.element"),Ri=Symbol.for("react.fragment");function jo(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:ki,type:e,key:o,ref:t!==void 0?t:null,props:n}}rt.Fragment=Ri;rt.jsx=jo;rt.jsxs=jo});var _e=qe((us,Go)=>{"use strict";Go.exports=Wo()});var pe={focusId:null,relation:null,expanded:[],pins:{}},Ue=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function J(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${Ye(r.x)},${Ye(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Ye(e.pan.x)},${Ye(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function Yr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Ze(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[m,f]of n){if(!m.startsWith("pin."))continue;let[g,x]=f.split(","),k=g===void 0?null:Ue(g),y=x===void 0?null:Ue(x);k===null||y===null||(o[m.slice(4)]={x:k,y})}let r=Object.create(null);for(let[m,f]of n)!m.startsWith("in.")||f.length===0||(r[m.slice(3)]=f);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],s=a[0]===void 0?null:Ue(a[0]),l=a[1]===void 0?null:Ue(a[1]),c=(n.get("sel")??"").split(",").filter(m=>m.length>0).sort(),u=n.get("overview")==="1";return{...c.length>0?{selection:c}:{},...u?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...s!==null&&l!==null?{pan:{x:s,y:l}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:Yr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(m=>m.length>0&&(u||!m.startsWith("kind:"))).sort(),pins:o}}function Da(e){let t=Ze(e);return J(t)==="#"?{...t,overview:!0}:t}function Na(e){let t=J(e);return t==="#overview=1"?"":t}function Ye(e){return Math.round(e*100)/100}function co(e,t){return J(e)===J(t)}var uo="edge:";function po(e){if(!e.startsWith(uo))return null;let t=e.slice(uo.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function Tt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function z(e,t){if(t===e.focusId)return{...e,focusId:t};let n=Tt(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function fo(e,t){return{...e,relation:t}}function ae(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function fe(e,t){if(t!==e.overview&&(e=Tt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function Xe(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Ie(e,t){if(t!==(e.zoom===!0)&&(e=Tt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Je(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var et="aggregate:",Qe="kind:";function Mt(e){return`${Qe}${e}`}function ye(e){return e.startsWith(Qe)?e.slice(Qe.length):null}var Ga="kinds:beyond";function Zr(e){let t=ye(e);return t?[t]:se(e)}function Q(...e){return`${et}${[...e].sort().join("+")}`}function yo(e){return e.startsWith(et)}function se(e){return!yo(e)||e.includes("|")?[]:e.slice(et.length).split("+").filter(Boolean)}function mo(e,t,n={}){let o=ye(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Je(e,t);let r=o!==null?Q(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Ie(e,!1);if(o!==null&&n.carry){let i=fe({...z(e,r),relation:null},!1);return ae(Ie(i,!0),"q",n.carry)}return Ie({...z(e,r),relation:null},!0)}function Xr(e,t,n){return ae(fe(z(e,Q(t)),!1),"view",n)}function Fa(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var go="aggregate:";function Ct(e){return e.startsWith(go)&&e.includes("|")}var Ot=e=>e?.off===!0,Jr=e=>e!==void 0&&!Ot(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),ho=e=>e!==void 0&&!Ot(e)&&(e.fast!==void 0||e.decide!==void 0),Qr=e=>e?.suggestOnOpen!==!1&&ho(e),ei=e=>e?.hoverChips===!0&&ho(e);var Vt={};var Co=L(N(),1),hi={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},Oo=e=>`graview:seat:${e}`;function Si(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function wi(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Wt(e){let t=e===null?null:Oo(e),n={...hi,...Si(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&wi(t,n);for(let s of[...o])s()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function vi(e){return(0,Co.useSyncExternalStore)(e.subscribe,e.get,e.get)}var Io=L(N(),1),bi={entries:[],ghost:null,loaded:!1};function Vo(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function Gt(e){let t=bi,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:Vo(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:Vo(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function xi(e){return(0,Io.useSyncExternalStore)(e.subscribe,e.get,e.get)}function Lo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var nt=L(N(),1),ot=(0,nt.createContext)(void 0),Ei=()=>(0,nt.useContext)(ot);var P=L(N(),1),Le=(0,P.createContext)(null);function Ho(){return(0,P.useContext)(Le)}function Pi(e,t){let n=Ho(),o=(0,P.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,P.useRef)(0),i=(0,P.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,P.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Do=$e(()=>(__graviewPreload(import.meta.url,["./chunk.ZJXUWOG3.js","./chunk.TI4OSTQV.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.PFXGWY3P.js")));function Ft(e){let[,t]=(0,P.useReducer)(o=>o+1,0),n=e.publishing?.mode==="on-publish"&&!no();return(0,P.useEffect)(()=>{n&&Do().then(t,()=>{})},[n]),!n}var _o,Ai=400;function Kt(e,t,n){let o=(0,P.useContext)(Le),r=o!==null&&o.owns(e,t),[i,a]=(0,P.useState)(null),[s,l]=(0,P.useState)(_o);(0,P.useEffect)(()=>{if(s||r||i===null)return;let b=!0;return Do().then(V=>{_o=V,b&&l(V)},()=>{}),()=>{b=!1}},[s,r,i]);let[c,u]=(0,P.useState)(0),m=(0,P.useMemo)(()=>r||i===null||i>=e.log.length||!s?void 0:s.askArchived(e,i,n)??s.askDeclaration(n,i),[r,e,i,n,s,c]),f=m&&"waiting"in m?m.waiting:void 0,g=m&&"seq"in m?m:null,[x,k]=(0,P.useState)(void 0);(0,P.useEffect)(()=>{if(!f)return;let b=!0,V=setTimeout(()=>b&&k(f),Ai);return f.then(()=>b&&u(I=>I+1)),()=>{b=!1,clearTimeout(V)}},[f]);let y=f!==void 0&&x!==f||g!==null,v=(0,P.useMemo)(()=>{if(r||i===null||i>=e.log.length||!s||y)return null;try{let b=s.pastAt(e,i,n);return{seq:i,at:b.past?.at,store:b}}catch{return null}},[r,e,i,n,s,y,c]),S=(0,P.useRef)(null),E=y?S.current:v;(0,P.useEffect)(()=>{S.current=E},[E]);let A=(0,P.useCallback)(b=>a(b===null?null:b>=e.log.length?Number.POSITIVE_INFINITY:b),[e]),F=(0,P.useCallback)((b,V)=>[e,E?.store].some(I=>I!==void 0&&(I===b||I.seenBy(V)===b)),[e,E]),H=i!==null,j=(0,P.useMemo)(()=>({past:E,open:H,show:A,live:e,host:n,owns:F,archive:g}),[E,H,A,e,n,F,g]);return r?o:j}var No=L(N(),1),Bt=(0,No.createContext)(null);var Fo=e=>`graview:setting:${e}`;function Ko(){return localStorage}function Bo(e,t){try{let n=(t??Ko()).getItem(Fo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function qo(e,t,n){try{(n??Ko()).setItem(Fo(e.name),t)}catch{}}function zo(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var _=L(N(),1);function qt(e){return ze(e)}var Ti=12,Mi=4;function Ci(e,t,n){let o=qt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var it=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Ti);function $o(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Mi)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?Mt([...o][0]):n[0]}function zt(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,s]of e)s.mode!=="asking"&&s.mode!=="docked"&&t.at-s.since>=t.holdMs&&o.set(a,{...s,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=Ci(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=$o(t.ids,n);return i({at:a,mode:"reading",trail:it(r.trail,a)}),o}case"about-to-write":case"write":{let a=$o(t.ids,n);return i({at:a,mode:"writing",trail:it(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:it(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:it(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var Uo="graview:session";function Yo(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(Uo);if(o)return o;let r=t();return n.setItem(Uo,r),r}catch{return t()}}var $t={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},Ut={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},Zo=[$t,Ut],Oi=800;function Xo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:s,settingValues:l,setView:c,ttlMs:u=lo,people:m,seats:f}=e,[g,x]=(0,_.useState)(()=>new Map),[k,y]=(0,_.useState)(null),[v,S]=(0,_.useState)(null),[E,A]=(0,_.useState)(null),F=typeof r.id=="string"&&r.id.length>0,H=F&&(l[$t.name]??$t.initial)==="shared",j=H&&(l[Ut.name]??Ut.initial)==="shared",b=qt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),V=F?Qn(r,{graph:n.graph,schema:n.schema,...f?{seats:f}:{},...m?{people:m}:{}}):"",I=s?a.get(`agent:${s}:${i}`):void 0,W=(0,_.useMemo)(()=>!t||!H?null:{participant:b,kind:r.kind,name:V,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:eo(r.id??"nobody"),stop:E??J(o),...j?{over:k}:{},...I?{robot:{at:I.at,mode:I.mode}}:{},at:new Date().toISOString()},[t,H,j,b,V,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,k,I?.at,I?.mode]),Ne=(0,_.useRef)(null),Ee=R=>R&&t?.here({...R,caret:Ne.current??void 0,at:new Date().toISOString()}),Pe=(0,_.useCallback)(R=>{Ne.current=R,Ee(W)},[t,W]);(0,_.useEffect)(()=>{if(!W)return;Ee(W);let R=setInterval(()=>Ee(W),Oi);return()=>clearInterval(R)},[t,W]),(0,_.useEffect)(()=>t?t.onWho(K=>x(Rt(new Map,K,Date.now(),u))):void 0,[t,u]);let Ae=g.size>0;(0,_.useEffect)(()=>{if(!Ae)return;let R=setInterval(()=>{x(K=>{let oe=Rt(K,[],Date.now(),u);return oe.size===K.size?K:oe})},Math.max(250,Math.min(1e3,u/4)));return()=>clearInterval(R)},[Ae,u]),(0,_.useEffect)(()=>{if(!t||typeof window>"u")return;let R=()=>t.leave();return window.addEventListener("pagehide",R),()=>window.removeEventListener("pagehide",R)},[t]),(0,_.useEffect)(()=>{if(!j||typeof document>"u")return;let R=null,K=oe=>{let de=Lo(oe.target);de!==R&&(R=de,y(de))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[j]);let le=(0,_.useRef)(null),B=v?g.get(v)??null:null,ne=(0,_.useCallback)(R=>{le.current=null,S(R)},[]);return(0,_.useEffect)(()=>{if(v){if(!B){S(null);return}B.stop!==le.current?.stop&&(le.current={stop:B.stop,at:Date.now()},c(Ze(B.stop)))}},[v,B,c]),(0,_.useEffect)(()=>{let R=le.current;!v||R===null||Date.now()-R.at<400||co(o,Ze(R.stop))||S(null)},[o,v]),(0,_.useEffect)(()=>{if(!v||typeof document>"u")return;let R=K=>{K.key==="Escape"&&S(null)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[v]),(0,_.useMemo)(()=>({who:g,sharing:W?{participant:b,name:V}:null,following:B,follow:ne,sayWhere:A,sayCaret:Pe}),[g,W,b,V,B,ne,Pe])}var U=L(N(),1);function Jo(e){return ze(e.author)}function Vi(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Qo(e,t,n,o,r){let i=new Map;for(let[l,c]of e)o-c.at<r&&i.set(l,c);let a=new Set(n.flatMap(l=>l.nodeIds)),s=(l,c,u)=>{let m=i.get(l),f=m?.participants.includes(Jo(c))?m.participants:[...m?.participants??[],Jo(c)];i.set(l,{at:o,manner:Vi(f,c.author.kind),intent:c.intent,wrote:(m?.wrote??!1)||(u.wrote??!1),read:(m?.read??!1)||(u.read??!1),broke:(m?.broke??!1)||a.has(l),participants:f})};for(let l of t){for(let c of l.writes)s(c,l,{wrote:!0});for(let c of l.reads)l.writes.includes(c)||s(c,l,{read:!0})}for(let l of n)for(let c of l.nodeIds){let u=i.get(c);i.set(c,{at:o,manner:u?.manner??"rule",intent:u?.intent??l.message,wrote:u?.wrote??!1,read:u?.read??!1,broke:!0,participants:u?.participants??["rule::"]})}return i}var Ii=2600;function er(e,t=Ii){let[n,o]=(0,U.useState)(()=>new Map),r=(0,U.useRef)(n);r.current=n;let i=(0,U.useRef)(null),a=(0,U.useCallback)(l=>{r.current=l,o(l),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let l=e.violations(),c=e.subscribe((u,m)=>{let f=e.violations(),g=io(e.allInvariants(),l,f).introduces;l=f,a(Qo(r.current,m,g.map(x=>({nodeIds:x.nodeIds,message:x.message})),Date.now(),t))});return()=>{c(),i.current&&clearTimeout(i.current)}},[e,t,a]);let s=(0,U.useCallback)(l=>{l.reads.length!==0&&a(Qo(r.current,[Li(l)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:s}}function Li(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var d=L(N(),1);function tr(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var at=L(N(),1),_i=e=>e.definitions.some(t=>Xn(t).size>0);function nr(e,t,n){let[o,r]=(0,at.useState)(void 0),i=(n.roles??[]).join("\0");return(0,at.useEffect)(()=>{if(!t||!_i(e.schema)){r(void 0);return}let a=!0,s=!1,l=e.graph,c=()=>{s||(s=!0,queueMicrotask(()=>{s=!1,a&&e.reread()}))},u=Jn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},c);return kt(l,u.read),r(u),e.reread(),()=>{a=!1,kt(l,void 0)}},[e,t,n.kind,n.id,i]),o}function or(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var ee=L(_e(),1),Hi="graview:place-menu",He=(0,d.createContext)(null),sr=(0,d.createContext)("scene");function Di({mode:e,children:t}){return(0,ee.jsx)(sr.Provider,{value:e,children:t})}function Ni(){return(0,d.useContext)(sr)}var lr={kind:"human"},ji=[],Wi=[],Gi=[],Yt=[];function dr(e,t){let n=(0,d.useId)();(0,d.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??lr,r=()=>ro(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var Fi=()=>{try{return typeof location<"u"&&new URLSearchParams(location.search).get("as")==="published"?"published":void 0}catch{return}},Ki={off:!0};function Bi({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,as:a,seats:s=ji,onSeat:l,people:c=Wi,memory:u,presenceTtlMs:m,app:f,settings:g=f?.settings??Gi,presence:x,typing:k,brand:y,locale:v,timeZone:S,onKeepLens:E,providers:A,ai:F,files:H,resolveApp:j,history:b,linkedRecords:V,menuSections:I,keptViews:W,onExport:Ne,subscriptions:Ee,dismissals:Pe,whileAway:Ae,signIn:le,view:B,onViewChange:ne,children:R}){let K=(0,d.useContext)(He),oe=I??K?.menuSections,de=le??K?.signIn,ht=W??K?.keptViews,St=Ne??K?.onExport,[_r,Hr]=(0,d.useState)(null),ue=_r??i??s[0]?.principal??lr,je=Kt(e,ue,b),fn=je.past&&je.live===e?je.past.store:e,wt=a??Fi(),vt=!Ft(e),D=(0,d.useMemo)(()=>vt?e:fn.seenBy(ue,wt?{as:wt}:void 0),[vt,e,fn,ue,wt]);dr(e,ue);let[re]=(0,d.useState)(()=>Yo(u)),[yn,Dr]=(0,d.useState)(!1),mn=(0,d.useCallback)(()=>Dr(!0),[]),ie=(0,d.useMemo)(()=>x?[...g,...Zo]:g,[g,x]),[bt]=(0,d.useState)(()=>n??Qt(t,e.schema)),[Nr,gn]=(0,d.useState)(()=>Xe(bt??pe,r??bt?.selection??[])),ke=(0,d.useRef)(bt??pe).current,[hn,jr]=(0,d.useState)(null),[Sn,Wr]=(0,d.useState)(null),Z=(0,d.useContext)(He),[wn]=(0,d.useState)(()=>Z?.seatTalk??Wt(y?.name??e.schema.kinds.join(","))),xt=F??Z?.ai??Vt,We=(0,d.useMemo)(()=>xt.off?Ki:xt,[xt]),vn=(0,d.useRef)(We.interactions);vn.current=We.interactions;let[bn]=(0,d.useState)(()=>Z?.aiDesk??Gt(()=>vn.current)),[Gr]=(0,d.useState)(()=>Z?.subscriptions??oo()),xn=Ee??Z?.subscriptions??Gr,Et=E??Z?.onKeepLens,Ge=f??Z?.app,Fe=v??Z?.locale,Fr=y?.locale??Ge?.brand?.locale,Ke=S??Z?.timeZone;Zn({reader:Fe,app:Fr,readerTimeZone:Ke,appTimeZone:y?.timeZone??Ge?.brand?.timeZone});let En=(0,d.useRef)(null),Pn=(0,d.useCallback)(p=>{En.current=p},[]),An=(0,d.useCallback)(p=>En.current?.whereIs(p)??null,[]),[kn]=(0,d.useState)(()=>tr()),[Rn]=(0,d.useState)(()=>or()),[Pt,Kr]=(0,d.useState)(null),[Re,Tn]=(0,d.useState)(()=>new Map),Te=(0,d.useRef)(Re);Te.current=Re;let Me=(0,d.useRef)(null),At=(0,d.useCallback)(p=>D.graph.getNode(p)?.kind,[D]),X=(0,d.useCallback)(p=>{let h=zt(Te.current,p,At);Te.current=h,Tn(h),Me.current&&clearTimeout(Me.current),[...h.values()].some(C=>C.mode!=="docked"&&C.mode!=="asking")&&(Me.current=setTimeout(()=>{let C=zt(Te.current,{type:"rest",at:Date.now(),holdMs:Jt},At);Te.current=C,Tn(C)},Jt+20))},[At]),Mn=(0,d.useCallback)(p=>X({...p,at:p.at??Date.now()}),[X]),Cn=(0,d.useCallback)(p=>{Kr(p),p&&X({type:"home",author:{kind:"agent",id:p,session:re},at:Date.now()})},[X,re]);(0,d.useEffect)(()=>D.subscribe((p,h)=>{for(let T of h)T.author.kind==="agent"&&X({type:"write",author:T.author,ids:T.writes,at:Date.now()})}),[D,X]),(0,d.useEffect)(()=>()=>{Me.current&&clearTimeout(Me.current)},[]);let $=(0,d.useMemo)(()=>({...ue,session:re}),[ue,re]),On=nr(D,V,$),Vn=(0,d.useCallback)(p=>{Hr(p),l?.(p)},[l]),[Ce,Br]=(0,d.useState)(()=>Object.fromEntries(ie.map(p=>[p.name,Bo(p,u)])));(0,d.useEffect)(()=>{for(let p of ie)zo(p,Ce[p.name]??p.initial)},[ie,Ce]);let In=(0,d.useCallback)((p,h)=>{let T=ie.find(C=>C.name===p);!T||!T.options.some(C=>C.value===h)||(qo(T,h,u),Br(C=>({...C,[p]:h})))},[ie,u]),[Ln,qr]=(0,d.useState)(null),{activity:_n,noteAttention:Hn}=er(D),Dn=(0,d.useCallback)(p=>{Hn(p),X({type:"read",author:p.author,ids:p.reads,at:Date.now()})},[Hn,X]),ce=(0,d.useCallback)(p=>{if(ye(p)!==null||se(p).length>0||Ct(p))return!0;let h=po(p);return h?D.graph.allEdges().some(T=>T.kind===h.kind&&T.from===h.from&&T.to===h.to):D.graph.getNode(p)!==void 0},[D]),Nn=(0,d.useCallback)(p=>{let h=p.selection??Yt,T=h.filter(ce),C=T.length===h.length?p:Xe(p,T);return C.focusId!==null&&!ce(C.focusId)&&(C=z(C,null)),C},[ce]),Oe=(0,d.useCallback)(p=>{let h=Nn(p),T=ar(D,$,h.shown);if(h.focusId!==null&&T.size>0){let C=se(h.focusId),Yn=D.graph.getNode(h.focusId);(C.length>0?C.every(Ur=>T.has(Ur)):Yn?T.has(Yn.kind):!1)&&(h={...h,focusId:null})}if(!h.overview&&h.focusId===null){let C=ke.focusId!==null&&!ce(ke.focusId)?Qt(t,e.schema)??{...pe,overview:!0}:ke;C.focusId!==null&&ce(C.focusId)?h={...h,focusId:C.focusId}:C.overview===!0&&(h={...h,overview:!0})}return h},[Nn,ce,D,ke,$,t,e.schema]),q=Oe(B??Nr),jn=(0,d.useMemo)(()=>ar(D,$,q.shown),[D,$,q.shown]),Wn=(0,d.useMemo)(()=>[...D.modules.administered.entries()].map(([p,h])=>{let T=D.mayAdminister(p,$);return{name:p,...h.description?{description:h.description}:{},kinds:h.kinds??[],canShow:T,shown:T&&(q.shown??[]).includes(p)}}),[D,$,q.shown]),Ve=(0,d.useCallback)(p=>{let h=T=>Oe(typeof p=="function"?p(T):p);if(B!==void 0){ne?.(h(B));return}ne&&ne(h(q)),gn(T=>h(T))},[q,ne,B,Oe]);(0,d.useEffect)(()=>{B===void 0&&gn(p=>{let h=Oe(p);return h===p?p:h})},[q,B,Oe]);let Gn=q.selection??Yt,Fn=(0,d.useCallback)(p=>{Ve(h=>Xe(h,typeof p=="function"?p(h.selection??Yt):p))},[Ve]),{who:Be,following:Kn,follow:Bn,sayWhere:zr,sayCaret:qn,sharing:zn}=Xo({channel:x,store:D,view:q,principal:$,session:re,robots:Re,seatWho:Pt,settingValues:Ce,setView:Ve,seats:s,people:c,...m!==void 0?{ttlMs:m}:{}}),$r=(0,d.useMemo)(()=>({store:D,scheme:o,views:t,view:q,setView:Ve,homeView:ke,selection:Gn,setSelection:Fn,menuAt:hn,setMenuAt:jr,whereIs:An,pointer:kn,motion:Rn,registerScene:Pn,robots:Re,noteSeat:Mn,seatWho:Pt,registerSeatWho:Cn,actsDoor:Sn,registerActsDoor:Wr,seatTalk:wn,aiDesk:bn,...u?{memory:u}:{},who:Be,following:Kn,follow:Bn,sayWhere:zr,sharing:zn,session:re,ai:We,resolveApp:j,linkedRecords:V,menuSections:oe,...ht?{keptViews:ht}:{},...St?{onExport:St}:{},subscriptions:xn,dismissals:Pe,whileAway:Ae,signIn:de,linkedReads:On,movedByHand:yn,noteMoved:mn,emphasis:Ln,setEmphasis:qr,activity:_n,noteAttention:Dn,principal:$,seats:s,people:c,takeSeat:Vn,settings:ie,settingValues:Ce,chooseSetting:In,hiddenKinds:jn,administered:Wn,...A?{providers:A}:{},...y?{brand:y}:{},...Et?{onKeepLens:Et}:{},app:Ge,...Fe?{locale:Fe}:{},...Ke?{timeZone:Ke}:{}}),[D,o,t,q,Ve,Gn,Fn,hn,An,kn,Rn,Pn,Re,Mn,Pt,Cn,Sn,wn,bn,u,Be,Kn,Bn,zn,re,We,j,V,oe,ht,St,xn,Pe,Ae,de,On,yn,mn,Ln,_n,Dn,$,s,c,Vn,ie,Ce,In,jn,Wn,A,y,Et,Ge,Fe,Ke]),$n=(0,d.useMemo)(()=>k?{typing:k,sayCaret:qn,who:Be}:null,[k,qn,Be]),Un=H?(0,ee.jsx)(ot.Provider,{value:H,children:R}):R;return(0,ee.jsx)(He.Provider,{value:$r,children:(0,ee.jsx)(Le.Provider,{value:je,children:(0,ee.jsx)(Yi,{children:vt?null:$n?(0,ee.jsx)(Bt.Provider,{value:$n,children:Un}):Un})})})}var ur=(0,d.createContext)(null),Zt,Xt=new Set,qi=e=>(Xt.add(e),()=>void Xt.delete(e)),rr=()=>Zt;function zi(e){if(!Zt){Zt=e;for(let t of[...Xt])t()}}var $i=300;function Ui(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,$i)),r===t?e(n,o):[]}}function Yi({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:s}=te(),l=st(),c=n.q,u=n.focusId,m=!!(c&&c.trim().length>0),f=(0,d.useSyncExternalStore)(qi,rr,rr),g=(0,d.useMemo)(()=>m&&f?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:f.touchWeights(t.log.all())}:null,[t,l,m,f]),x=u?t.graph.getNode(u)?.kind??ye(u)??(se(u).length===1?se(u)[0]:void 0):void 0,k=(0,d.useMemo)(()=>s.near&&Ui(s.near),[s.near]),y=(0,d.useMemo)(()=>!c||!g||!f?null:f.search(t,c,{...x?{inKind:x}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...u&&t.graph.has(u)?[u]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:k}),[t,c,r,o,i,a,u,x,g,k]),[v,S]=(0,d.useState)();return(0,d.useEffect)(()=>void y?.later?.then(E=>S([y,E])),[y]),(0,ee.jsx)(ur.Provider,{value:v?.[0]===y?v[1]:y,children:e})}var ir=new WeakMap;function Gs(e){let t=ir.get(e);return t||ir.set(e,t=new Set(e.matched)),t}function Zi(){return(0,d.useContext)(ur)}function te(){let e=(0,d.useContext)(He);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function en(){return(0,d.useContext)(He)??null}function st(){let{store:e}=te(),t=(0,d.useRef)(null),n=(0,d.useRef)(null),o=(0,d.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,d.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,d.useSyncExternalStore)(r,o,o)}function Xi(e){let{store:t}=te(),n=(0,d.useCallback)(r=>t.subscribe(r),[t]),o=(0,d.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,d.useSyncExternalStore)(n,o,o)}function ar(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var Jt=2600;var cr=new WeakSet,Ji=e=>cr.has(e),Qi=e=>void cr.add(e);function Qt(e,t){let n=so(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...pe,focusId:Q(n.place.kind),within:{view:n.place.as}}:{...pe,focusId:Q(n.kind)}}var pr=L(N(),1),ea=(0,pr.createContext)(!1);var lt=Symbol.for("graview.default-view");function fr(e){return Object.defineProperty(e,lt,{value:!0,enumerable:!1}),e}function yr(e){return typeof e=="function"&&e[lt]===!0}var dt=Symbol.for("graview.replaces-page");function mr(e){return Object.defineProperty(e,dt,{value:!0,enumerable:!1}),e}function gr(e){return typeof e=="function"&&e[dt]===!0}var ut=Symbol.for("graview.bleeds");function hr(e){return Object.defineProperty(e,ut,{value:!0,enumerable:!1}),e}function Sr(e){return typeof e=="function"&&e[ut]===!0}var ct=Symbol.for("graview.previews");function wr(e,t={}){return Object.defineProperty(e,ct,{value:t,enumerable:!1}),e}function vr(e){return typeof e=="function"?e[ct]:void 0}function ta(e){return ao(e)}function na(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var M=L(N(),1),Y=L(_e(),1),tn=new Set,pt=0;function nn(e){return()=>{pt+=1;let t=e();return t.then(()=>void(pt-=1),()=>void(pt-=1)),t}}var oa=()=>pt,yt=(0,M.createContext)(null);function ra(){return{waiting:new Map,at:0}}function ia(e){for(let[t,n]of e.waiting)n<e.at&&e.waiting.delete(t);e.at+=1}var aa=e=>e?.waiting.size??0;function Er(e,t){e?.waiting.set(t,e.at)}function Pr(e){let t=(0,M.useContext)(yt);(0,M.useLayoutEffect)(()=>{t?.waiting.delete(e)},[t,e])}function sa(e){let t={},n=!1,o=new Set,r=(0,M.lazy)(nn(()=>e().then(a=>{n=!0;let s=a.default;function l(c){return Pr(t),(0,M.createElement)(s,c)}return{default:l}},a=>{for(let s of o)s.waiting.delete(t);throw a})));function i(a){let s=(0,M.useContext)(yt);return!n&&s&&(o.add(s),Er(s,t)),(0,M.createElement)(r,a)}return i}var Ar=!1,kr=!1,ft=new Set;function la(){Ar=!0}function da(){kr=!0;for(let e of[...ft])e();ft.clear()}var Rr=()=>kr||!Ar;function ua(e){return Rr()?(e(),()=>{}):(ft.add(e),()=>void ft.delete(e))}var br=!1;function on(){for(let e of[...tn])e()}function ca(){br||typeof window>"u"||(br=!0,window.addEventListener("online",on))}function rn(e){let t,n=!1,o=!1,r,i=0,a=new Set,s=()=>{i+=1;for(let f of[...a])f()},l=f=>(a.add(f),()=>void a.delete(f)),c=()=>i,u=()=>void m().catch(()=>{});function m(){if(n)return Promise.resolve(t);if(r)return r;let f=e().then(g=>(t=g,n=!0,o=!1,r=void 0,tn.delete(u),s(),g),g=>{throw r=void 0,o=!0,tn.add(u),ca(),s(),g});return f.catch(()=>{}),r=f,f}return{load:m,prefetch:u,get current(){return t},get failed(){return o},part(f,g={}){let x=g.what??"This part",k={};function y(E){(0,M.useSyncExternalStore)(l,c,c),Pr(k);let A=(0,M.useRef)(null),F=(0,M.useRef)(null),H=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{o&&r===void 0&&u()},[]),n&&typeof document<"u"&&A.current!==null&&document.activeElement===A.current&&(H.current=!0),(0,M.useLayoutEffect)(()=>{if(!(!n||!H.current)){H.current=!1;for(let j=F.current?.nextElementSibling??null;j!==null;j=j.nextElementSibling){let b=j.matches(xr)?j:j.querySelector(xr);if(b instanceof HTMLElement){b.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[H.current?(0,Y.jsx)("span",{ref:F,hidden:!0}):null,f(t,E)]}):g.quiet?null:(0,Y.jsx)(pa,{what:x,button:A,...g.as?{as:g.as}:{}})}let v=(0,M.lazy)(nn(()=>m().then(()=>({default:y}),()=>({default:y}))));function S(E){let A=(0,M.useContext)(yt),[F]=(0,M.useState)(()=>n||o);return!n&&!o&&Er(A,k),(0,M.createElement)(F?y:v,E)}return S}}}var xr="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function pa({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,Y.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,Y.jsx)("span",{role:"status",children:r})," ",(0,Y.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:on,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var Se=L(N(),1);function fa(){let{selection:e,setSelection:t}=te();return(0,Se.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function ya(){let{store:e}=te(),t=st();return(0,Se.useMemo)(()=>ma(e),[e,t])}var Tr=new WeakMap;function ma(e){let t=Tr.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Tr.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function ga(){let{view:e,setView:t}=te();return(0,Se.useMemo)(()=>({view:e,url:J(e),focus:n=>t(o=>z(o,n)),show:n=>t(o=>fo(o,n)),toggle:n=>t(o=>Je(o,n)),go:n=>t(n)}),[e,t])}var he={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;he.at=typeof t?.graview=="number"?t.graview:0,he.at>he.depth&&(he.depth=he.at),he.tell()});var G=L(N(),1),sn={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},ha={position:"fixed",inset:"auto",margin:0,zIndex:to("popover"),boxSizing:"border-box"},mt=6,we=8,Sa=e=>typeof e.showPopover=="function";function gt(e){try{return e.matches(":popover-open")}catch{return!1}}function wa(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function ln(e,t,n={}){let o=wa(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),s=r.height-o.bottom-mt-we,l=o.top-mt-we,c=a.height<=s||s>=l,u=Math.max(96,Math.floor(c?s:l)),m=Math.min(a.height,u);a.height>u&&(e.style.maxHeight=i?`min(${i}, ${u}px)`:`${u}px`);let f=a.width,g=n.align==="start"?o.left:o.right-f,x=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();x&&f<=x.right-x.left&&(g<x.left?g=o.left+f<=x.right?o.left:x.left:g+f>x.right&&(g=o.right-f>=x.left?o.right-f:x.right-f));let k=f>=r.width-2*we?Math.max(0,(r.width-f)/2):Math.max(we,Math.min(g,r.width-we-f)),y=c?o.bottom+mt:Math.max(we,o.top-mt-m);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(y)}px`}function Mr(e,t,n,o={}){let r=o.align??"end";(0,G.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Sa(i)&&!gt(i))try{i.showPopover(),ba()}catch{}let a=0,s=c=>{c?.target instanceof Node&&i.contains(c.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>ln(i,n,{align:r})))};ln(i,n,{align:r}),addEventListener("resize",s),addEventListener("scroll",s,!0);let l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>s());return l?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",s),removeEventListener("scroll",s,!0),l?.disconnect(),i.isConnected&>(i))try{i.hidePopover()}catch{}}},[t,e,r])}var dn=new Set;function va(e){return dn.add(e),()=>dn.delete(e)}function ba(){for(let e of dn)if(!(!e.isConnected||!gt(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ve=null,xa='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Ea(e){for(let t of e.querySelectorAll(xa))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var an=()=>{let e=document.activeElement;return e===null||e===document.body};function Pa(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,s]=(0,G.useState)(!1),l=t.open??a,c=(0,G.useRef)(null),u=(0,G.useRef)(null),m=(0,G.useCallback)(S=>{c.current=S},[]),f=(0,G.useCallback)(S=>{u.current=S},[]),g=`graview-popover-${(0,G.useId)().replace(/:/g,"")}`,x=(0,G.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});x.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,G.useCallback)(S=>{x.current.controlled||s(S),x.current.onOpenChange?.(S)},[]),y=(0,G.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??c.current??x.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),v=(0,G.useCallback)(S=>{let E=u.current,A=typeof document>"u"?null:document.activeElement,F=A===null||A===document.body||E!==null&&E.contains(A);k(!1),!(!S||!F)&&(y(),requestAnimationFrame(()=>{an()&&y()}))},[k,y]);return Mr(u,i&&l,n??c,t.align?{align:t.align}:{}),(0,G.useEffect)(()=>{if(!i||!l)return;let S={name:e,close:()=>v(!1)};if(ve&&ve.close!==S.close&&ve.close(),ve=S,sn[e].focus==="into"){let b=u.current;b&&!b.contains(document.activeElement)&&Ea(b).focus({preventScroll:!0})}let E=b=>{b.key==="Escape"&&v(!0)},A=b=>{let V=b.target;if(!(V instanceof Node))return;let I=u.current;if(I?.contains(V)||c.current?.contains(V))return;let W=V instanceof Element?V.closest('[role="dialog"], [role="alertdialog"]'):null;W&&!(I&&W.contains(I))||(v(!1),sn[e].focus==="into"&&requestAnimationFrame(()=>{(an()||I!==null&&I.contains(document.activeElement))&&y()}))},F=null,H=null,j=b=>{let V=b.target;if(!(V instanceof Element))return;let I=u.current,W=V.closest('[role="dialog"], [role="alertdialog"]');!W||I&&(I.contains(W)||W.contains(I))||(F=W,v(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",A,!0),document.addEventListener("focusin",j),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",A,!0),document.removeEventListener("focusin",j);let b=F;b&&typeof MutationObserver<"u"&&(H?.disconnect(),H=new MutationObserver(()=>{b.isConnected||(H?.disconnect(),requestAnimationFrame(()=>{(an()||document.activeElement.closest("[hidden]")!==null)&&y()}))}),H.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>H?.disconnect(),10*6e4)),ve?.close===S.close&&(ve=null)}},[i,l,e,v,y]),{open:l,setOpen:S=>S?k(!0):v(!0),toggle:()=>l?v(!0):k(!0),trigger:{ref:m,"aria-expanded":l,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:f,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var be=L(N(),1);var Cr=(0,be.createContext)(null);function Aa(){let e=(0,be.useContext)(Cr),t=en(),n=(o,r,i)=>t?.setView(a=>ae(ae(fe(z(a,Q(o)),!1),"view",r),"filter",i?.filter??null));return(0,be.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>z(fe(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var xe=L(N(),1);var ka=rn($e(()=>(__graviewPreload(import.meta.url,["./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.HST7BYFW.js"))));function Ra(e,t,n){let o,r=!1,i=()=>{let{hidden:s,removed:l}=t.current();o||r||s.length+l.length===0||(o=()=>{},ka.load().then(c=>{r||(o=c.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function Ta(e,t){let[n,o]=(0,xe.useState)();return(0,xe.useEffect)(()=>t?Ra(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var Or=L(N(),1),Ma=(0,Or.createContext)(!1);var un=L(N(),1),Ca=(0,un.createContext)(null),Oa=(0,un.createContext)(null);var Vr=L(N(),1),Va=(0,Vr.createContext)(null);var Ir=L(N(),1),cn='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',pn=e=>e instanceof HTMLElement&&(e.matches(cn)||e.hasAttribute("tabindex")),De=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function Ia(e,t){let n=l=>l.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let s=e.querySelector(a);return s&&pn(s)&&De(s)?s:null}var La=e=>e.isConnected&&pn(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&De(e);function Lr(e,t){let n=t?Ia(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&De(o))return o;for(let r of e.querySelectorAll(cn))if(De(r))return r;return pn(e)&&De(e)?e:null}function _a(e){(0,Ir.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=y=>{let v=y.target;if(v instanceof Element){n=[];for(let S=v;S&&S!==t.parentElement;S=S.parentElement)n.push(S)}},r=!1,i=!1,a=t.ownerDocument,s=()=>!i&&a.defaultView!==null,l=(y,v)=>void setTimeout(()=>s()&&v(),y),c=y=>void requestAnimationFrame(()=>s()&&y()),u=y=>{if(r=!1,i)return;let v=a.activeElement;if(!(!(v===null||v===a.body||v===a.documentElement)||n.length===0)){if(La(n[0])){y&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let A=Lr(E,n[0]);if(A){A.focus({preventScroll:!0}),n=[];return}}}},m=(y,v=Date.now()+2500)=>{l(100,()=>{u(y);let S=a.activeElement;(S===null||S===a.body||S===a.documentElement)&&n.length>0&&Date.now()<v&&m(y,v)})},f=()=>{r||n.length===0||(r=!0,l(60,()=>c(()=>{u(!1),m(!1)})))},g=y=>{if(!(y instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(y.key))){if(!(y instanceof KeyboardEvent)){let v=y.target instanceof Element?y.target.closest(cn):null,S=a.activeElement,E=S===null||S===a.body||S===a.documentElement;if(v&&E&&t.contains(v)){n=[];for(let A=v;A&&A!==t.parentElement;A=A.parentElement)n.push(A);l(150,()=>c(()=>{u(!1),m(!1)}));return}}!(y instanceof KeyboardEvent)&&!(y.target instanceof Node&&n[0]?.contains(y.target))||l(150,()=>c(()=>{u(!0),m(!0)}))}},x=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&f()}),k=y=>{y.relatedTarget===null&&f()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",g),t.addEventListener("keydown",g),x.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",g),t.removeEventListener("keydown",g),x.disconnect()}},[e])}export{pe as a,J as b,Ze as c,Da as d,Na as e,co as f,uo as g,po as h,Tt as i,z as j,fo as k,ae as l,fe as m,Xe as n,Ie as o,Je as p,et as q,Mt as r,ye as s,Ga as t,Zr as u,Q as v,yo as w,se as x,mo as y,Xr as z,Fa as A,go as B,Ct as C,Jr as D,Qr as E,ei as F,N as G,Wt as H,vi as I,xi as J,Lo as K,ot as L,Ei as M,Le as N,Ho as O,Pi as P,Ft as Q,Kt as R,Bt as S,_e as T,Hi as U,Di as V,Ni as W,dr as X,Bi as Y,zi as Z,Gs as _,Zi as $,te as aa,en as ba,st as ca,Xi as da,Ji as ea,Qi as fa,Qt as ga,Cr as ha,Aa as ia,ea as ja,fr as ka,yr as la,mr as ma,gr as na,hr as oa,Sr as pa,wr as qa,vr as ra,ta as sa,na as ta,nn as ua,oa as va,yt as wa,ra as xa,ia as ya,aa as za,sa as Aa,la as Ba,da as Ca,Rr as Da,ua as Ea,rn as Fa,Ta as Ga,Ma as Ha,Ca as Ia,Oa as Ja,Va as Ka,fa as La,ya as Ma,ga as Na,he as Oa,_a as Pa,ha as Qa,gt as Ra,Mr as Sa,va as Ta,Pa as Ua};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
react/cjs/react.production.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license React
|
|
7
|
+
* react.production.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
+
(**
|
|
17
|
+
* @license React
|
|
18
|
+
* react-jsx-runtime.production.js
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*)
|
|
25
|
+
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.
|
|
1
|
+
import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.7IOC6U3C.js";import"./chunk.7FZY5E2U.js";import"./chunk.7354O67H.js";import"./chunk.XLM4ONUB.js";import"./chunk.XOZU4OFA.js";import"./chunk.C7EEYSAM.js";import{a as A}from"./chunk.DGWNVDZB.js";import"./chunk.TI4OSTQV.js";import"./chunk.3TME4BG3.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{G as M,T as f}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as d}from"./chunk.AJZBJBMO.js";var n=d(M(),1);var r=d(f(),1),C="several";function q({chosen:c,acts:p,onAct:N}){let t=A(),u=(0,n.useMemo)(()=>[...c].sort(),[c]),i=u.join(`
|
|
2
2
|
`),o=(0,n.useMemo)(()=>({on:"selection",ids:u}),[i]),l=(0,n.useMemo)(()=>p.filter(e=>e.open.length===0&&!e.more&&!e.destructive),[p]),g=(0,n.useMemo)(()=>new Map(l.map(e=>[h(e.id),e])),[l]),v=S(t,o,C),[y,x]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(v!==void 0)return;let e=!0;return w(t,o,{by:C,ask:()=>b(t.ai,{store:t.store,target:o,principal:t.principal,interaction:k(),places:t.places,selection:t.selection,...t.place?{place:t.place}:{},shared:l.map(a=>({id:a.id,label:a.label,mutation:a.mutation,args:a.args}))})}).then(a=>{e&&x({key:i,result:a})}),()=>{e=!1}},[i]);let s=v??(y?.key===i?y.result:void 0);if(s===void 0)return(0,r.jsx)("span",{role:"status",className:"graview-several-quiet","data-testid":"several-ai-thinking",style:{textDecoration:"none"},children:"AI: thinking\u2026"});let m=s.offers.filter(e=>e.type!=="act"||g.has(e.id));if(m.length===0)return null;let E=e=>{let a=g.get(e.id);if(a){t.desk.record({...s.interaction,outcome:"accepted",accepted:[e.id]}),N(a);return}I(t,s,e)};return(0,r.jsx)("div",{role:"group","aria-label":"Suggested by AI",className:"graview-several-acts","data-testid":"several-ai",children:m.map(e=>(0,r.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-ai-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>E(e),children:[e.label,(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \xB7 suggested"})]},e.id))})}export{q as SeveralAi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk.ACB4TD4W.js";import{a as ie,b as de,c as se,d as le,e as V,f as L,g as ue}from"./chunk.XCQ7ZPR5.js";import{a as fe}from"./chunk.MY5OXSS7.js";import{c as T,e as ae}from"./chunk.NVRK6A7T.js";import{a as j,b as ee,c as ne,d as re,f as E,m as te,n as b,o as oe,p as B,q as P}from"./chunk.FKJ3HIA5.js";import{b as x,d as ye,e as pe,g as me,h as ce,i as ge}from"./chunk.CQPNDJAC.js";import{C as v,Da as Y,I as H,Ib as q,Jb as Q,Kb as C,R as K,U as F,_ as J,da as X,ka as N,ma as Z,ra as G,sa as A,ta as z,ua as O,va as M}from"./chunk.P4CLT32V.js";var he=e=>e.caption?.trim()||e.name,I=e=>A(e)?`${he(e)}, ${z(e)}`:he(e);function nn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Be(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=v(n[t]);for(;r?.innerType;)r=v(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function rn(e,n){for(let t of Be(n)){let r=O(e[t]).find(o=>G(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Oe=e=>typeof e=="string"&&ie.includes(e);function Pe(e){if(e!==void 0)return Oe(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var ve=4;function Fe(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,V):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function be(e,n=1,t=""){if(!Array.isArray(e)||n>ve)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>ae(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Pe(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Ne.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Fe(a);case"number":{let p=se.includes(a.as)?a.as:void 0,W=le.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...W?{emphasis:W}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=de.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:be(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:be(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Ne=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Me=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:E(e,{graph:n.graph??te,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Me})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}var Ce=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(Ce(d,n,l.value))return n.glance?ye(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):pe(l.value);let i=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Te(n,d.expr.name):void 0;return oe(d,i?C(l.value,i):b(l.value,d.format,n.today,d.formatArgs,n.money,P(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var Ve=" \xB7 ";function Le(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split(Ve).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function we(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Oe(t.value)?t.value:"neutral"}function _e(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var je=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:me(e.definition,n)},Te=(e,n)=>q(e.definition?.fields?.shape?.[n]);function Ie(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=ce(je(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return K(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&typeof n=="string")return x(t.definition,e,n);let l=typeof n=="number"?Te(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(I).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function De(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?Q(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Se(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function $e(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=we(e.tone,n),a=n.glance&&!r.problem?Le(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:we(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Y(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,P(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?_e(d):ge(je(n,e.field),d),s=k(()=>Ie(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>G(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(I).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:Re(e.blocks,Se(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?Re(e.show,Se(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:De(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return We(e,n)}}function Re(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...$e(r,n,o===t),key:r.key}))}function ke(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return ke(r.blocks,n);case"when":return r.shown&&ke(r.blocks,n);default:return!1}})}var Ue=new Set(["every","some","sum","min","max","sort"]);function An(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Ue.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function We(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=He(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??V),i=l.slice(0,L),s=l.slice(L),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ke(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function D(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var $=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function He(e,n,t){let r=o=>{let a=D(t,o.kind,n).indexOf(String($(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ke(e,n,t,r){let o=e.some(i=>D(t,i.kind,n.by).length>0)?void 0:ue(n.by);if(o&&r)return Je(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of D(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>$(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String($(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function Je(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=P(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Z(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function Ae(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(Ae):e.t==="when"?e.show.some(Ae):!1}function xe(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Ge=new WeakMap;function U(e){let n=Ge.get(e);return n||Ge.set(e,n=fe(e)),n}function Xe(e,n,t,r={}){let o=U(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:X(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:ne)?.computed??[])try{let f=[],y=E(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=ee(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof re))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Gn(e,n,t){let{values:r}=Xe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}var Ze=500,ze=2e4,Ee=new WeakMap;function Ye(e,n){let t=Ee.get(e);t||Ee.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=xe(e,n)),r}function Fn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:U(d),fields:a?Ye(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??H(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?ze:Ze),...i?{}:{glance:!0}}}export{he as a,nn as b,Be as c,rn as d,be as e,Re as f,ke as g,An as h,Ae as i,Xe as j,Gn as k,Fn as l};
|
|
1
|
+
import{a as _}from"./chunk.3TME4BG3.js";import{a as ie,b as de,c as se,d as le,e as V,f as L,g as ue}from"./chunk.I43ONAEL.js";import{a as fe}from"./chunk.73EKJ4JN.js";import{c as T,e as ae}from"./chunk.INL4OZI7.js";import{a as j,b as ee,c as ne,d as re,f as E,m as te,n as b,o as oe,p as B,q as P}from"./chunk.5WU2UTP7.js";import{b as x,d as ye,e as pe,g as me,h as ce,i as ge}from"./chunk.7EA7THSM.js";import{C as v,Da as Y,I as H,Ib as q,Jb as Q,Kb as C,R as K,U as F,_ as J,da as X,ka as N,ma as Z,ra as G,sa as A,ta as z,ua as O,va as M}from"./chunk.VOHRQXCF.js";var he=e=>e.caption?.trim()||e.name,I=e=>A(e)?`${he(e)}, ${z(e)}`:he(e);function nn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Be(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=v(n[t]);for(;r?.innerType;)r=v(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function rn(e,n){for(let t of Be(n)){let r=O(e[t]).find(o=>G(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Oe=e=>typeof e=="string"&&ie.includes(e);function Pe(e){if(e!==void 0)return Oe(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var ve=4;function Fe(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,V):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function be(e,n=1,t=""){if(!Array.isArray(e)||n>ve)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>ae(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Pe(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Ne.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Fe(a);case"number":{let p=se.includes(a.as)?a.as:void 0,W=le.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...W?{emphasis:W}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=de.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:be(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:be(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Ne=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Me=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:E(e,{graph:n.graph??te,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Me})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}var Ce=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(Ce(d,n,l.value))return n.glance?ye(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):pe(l.value);let i=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Te(n,d.expr.name):void 0;return oe(d,i?C(l.value,i):b(l.value,d.format,n.today,d.formatArgs,n.money,P(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var Ve=" \xB7 ";function Le(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split(Ve).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function we(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Oe(t.value)?t.value:"neutral"}function _e(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var je=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:me(e.definition,n)},Te=(e,n)=>q(e.definition?.fields?.shape?.[n]);function Ie(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=ce(je(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return K(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&typeof n=="string")return x(t.definition,e,n);let l=typeof n=="number"?Te(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(I).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function De(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?Q(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Se(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function $e(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=we(e.tone,n),a=n.glance&&!r.problem?Le(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:we(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Y(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,P(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?_e(d):ge(je(n,e.field),d),s=k(()=>Ie(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>G(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(I).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:Re(e.blocks,Se(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?Re(e.show,Se(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:De(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return We(e,n)}}function Re(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...$e(r,n,o===t),key:r.key}))}function ke(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return ke(r.blocks,n);case"when":return r.shown&&ke(r.blocks,n);default:return!1}})}var Ue=new Set(["every","some","sum","min","max","sort"]);function An(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Ue.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function We(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=He(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??V),i=l.slice(0,L),s=l.slice(L),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ke(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function D(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var $=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function He(e,n,t){let r=o=>{let a=D(t,o.kind,n).indexOf(String($(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ke(e,n,t,r){let o=e.some(i=>D(t,i.kind,n.by).length>0)?void 0:ue(n.by);if(o&&r)return Je(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of D(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>$(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String($(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function Je(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=P(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Z(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function Ae(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(Ae):e.t==="when"?e.show.some(Ae):!1}function xe(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Ge=new WeakMap;function U(e){let n=Ge.get(e);return n||Ge.set(e,n=fe(e)),n}function Xe(e,n,t,r={}){let o=U(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:X(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:ne)?.computed??[])try{let f=[],y=E(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=ee(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof re))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Gn(e,n,t){let{values:r}=Xe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}var Ze=500,ze=2e4,Ee=new WeakMap;function Ye(e,n){let t=Ee.get(e);t||Ee.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=xe(e,n)),r}function Fn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:U(d),fields:a?Ye(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??H(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?ze:Ze),...i?{}:{glance:!0}}}export{he as a,nn as b,Be as c,rn as d,be as e,Re as f,ke as g,An as h,Ae as i,Xe as j,Gn as k,Fn as l};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as te}from"./chunk.
|
|
1
|
+
import{b as te}from"./chunk.JQBP6QWQ.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import{c as ne}from"./chunk.7EA7THSM.js";import{G as ge,T as ee}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Mc as q,da as X,ga as Z}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
|
|
2
2
|
`),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
|
|
3
3
|
`)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.LESRQN3Y.js";import"./chunk.7UJZP3YK.js";import"./chunk.R77TACXU.js";import"./chunk.JOWJNIWH.js";import"./chunk.6JERQFZI.js";import"./chunk.7XJ3XQZD.js";import"./chunk.52J42KR5.js";import"./chunk.T2Q3AAQI.js";import"./chunk.63SRVTG2.js";import"./chunk.C4EPMV7O.js";import"./chunk.G7XKQNOL.js";import"./chunk.7KZ44FEU.js";import"./chunk.HJCQ6I3S.js";import"./chunk.JQBP6QWQ.js";import"./chunk.I2W7HSBU.js";import"./chunk.BJL6EL6B.js";import"./chunk.KPUX27ZT.js";import"./chunk.DIS7JS7X.js";import"./chunk.D2T563AA.js";import"./chunk.JV7FLVUV.js";import"./chunk.GL3YVGAP.js";import"./chunk.VGTEEANA.js";import"./chunk.SZCZD2GM.js";import"./chunk.7FZY5E2U.js";import"./chunk.7354O67H.js";import"./chunk.C7EEYSAM.js";import"./chunk.FEBCIEI3.js";import"./chunk.WVUJXDXZ.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.GZHZLJBF.js";import"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as v,C,D as S,J as G,o as O}from"./chunk.
|
|
1
|
+
import{B as v,C,D as S,J as G,o as O}from"./chunk.AI2HBKVP.js";import{G as I,aa as m,c as V,j as y,l as p,m as g,n as u,o as D,v as B,z as E}from"./chunk.Q5IAXTF5.js";import{ia as M,od as P,pd as k,rd as R,sd as T}from"./chunk.VOHRQXCF.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a}from"./chunk.
|
|
1
|
+
import{s as a}from"./chunk.YKACMLLU.js";import{G as f,T as s,aa as l}from"./chunk.Q5IAXTF5.js";import{b as i}from"./chunk.AJZBJBMO.js";var d=i(f(),1),p=i(s(),1),c=new Set;function B(e){return c.add(e),()=>void c.delete(e)}function S(){let{store:e,principal:o}=l();return(0,d.useMemo)(()=>n=>{let t=n.on===void 0?void 0:e.graph.getNode(n.on);if(!t)return null;let u=[...c].filter(r=>r.store===e&&r.kind===t.kind);return(n.element?u.find(r=>r.root()?.contains(n.element)??!1):u[0])?.section(t.id,o)??null},[e,o])}function v({children:e}){let o=S(),n=(0,d.useMemo)(()=>[o],[o]);return(0,p.jsx)(a,{sections:n,children:e})}export{B as a,S as b,v as c};
|