graview 0.1.49 → 0.1.50
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.24MUPV4Y.js +1 -0
- package/dist/preview/chunk.25VJPUDH.js +1 -0
- package/dist/preview/{chunk.PCVU3LY3.js → chunk.2P66HH5Y.js} +1 -1
- package/dist/preview/chunk.2VZSC2MB.js +1 -0
- package/dist/preview/chunk.3L5USMQD.js +1 -0
- package/dist/preview/chunk.3O3H37WD.js +1 -0
- package/dist/preview/{chunk.VSWEKNKS.js → chunk.3SY6WWWQ.js} +2 -2
- package/dist/preview/{chunk.ZILULTJJ.js → chunk.4BQNG3W3.js} +1 -1
- package/dist/preview/chunk.4SHSEIHT.js +1 -0
- package/dist/preview/{chunk.Q4KNNJFL.js → chunk.4VJARLJ5.js} +1 -1
- package/dist/preview/{chunk.FUMQLGNM.js → chunk.4XOSDCCE.js} +1 -1
- package/dist/preview/{chunk.TSHBXCMU.js → chunk.53BGPCM6.js} +1 -1
- package/dist/preview/{chunk.AOEXSQDG.js → chunk.5DZR46YG.js} +1 -1
- package/dist/preview/{chunk.BH365UJ5.js → chunk.5RNB6IC5.js} +1 -1
- package/dist/preview/{chunk.NQ7SRWXA.js → chunk.64TFAR5Z.js} +1 -1
- package/dist/preview/chunk.6BMCZPT6.js +1 -0
- package/dist/preview/{chunk.NQDGUIUQ.js → chunk.6SHF6IL5.js} +1 -1
- package/dist/preview/{chunk.YXOJKGRC.js → chunk.6VA5XFRR.js} +1 -1
- package/dist/preview/{chunk.AP22NNIM.js → chunk.73BJYIYS.js} +1 -1
- package/dist/preview/chunk.7PJVMADH.js +2 -0
- package/dist/preview/{chunk.REANMQ6K.js → chunk.7QW6JYGP.js} +1 -1
- package/dist/preview/{chunk.SIVMZNHZ.js → chunk.7VX6TBNY.js} +1 -1
- package/dist/preview/{chunk.XMOIMPUC.js → chunk.A53G42QO.js} +1 -1
- package/dist/preview/chunk.ATWNWPME.js +1 -0
- package/dist/preview/chunk.AVCW7C6V.js +1 -0
- package/dist/preview/{chunk.YECMUK4X.js → chunk.AXCRFJDL.js} +1 -1
- package/dist/preview/{chunk.EYSQPXVE.js → chunk.AXMC6XVT.js} +1 -1
- package/dist/preview/{chunk.FIS27KW4.js → chunk.BBNF52IB.js} +1 -1
- package/dist/preview/chunk.BJAQRV2R.js +1 -0
- package/dist/preview/chunk.BLS2G3CD.js +5 -0
- package/dist/preview/chunk.BNQL37AC.js +88 -0
- package/dist/preview/{chunk.OFBESPHJ.js → chunk.BORCUDGS.js} +1 -1
- package/dist/preview/{chunk.QQRLUBWQ.js → chunk.CBJHYNNT.js} +1 -1
- package/dist/preview/{chunk.7MJGZHTS.js → chunk.CDZVUCEK.js} +1 -1
- package/dist/preview/{chunk.35FUGOSG.js → chunk.CR5MQMOL.js} +1 -1
- package/dist/preview/{chunk.MJ4XTNTL.js → chunk.DUIKIJKC.js} +1 -1
- package/dist/preview/{chunk.BNU3KXKL.js → chunk.DUJUJN35.js} +1 -1
- package/dist/preview/chunk.ECSWXLBI.js +9 -0
- package/dist/preview/{chunk.7MWLDDFL.js → chunk.EF3UB7US.js} +1 -1
- package/dist/preview/chunk.EJUZGIQ5.js +1 -0
- package/dist/preview/{chunk.N2S3TMBC.js → chunk.ETWREHXF.js} +1 -1
- package/dist/preview/{chunk.6RLFO5GA.js → chunk.ETX4QMM2.js} +1 -1
- package/dist/preview/{chunk.C75I24Z5.js → chunk.F5FJHKWV.js} +1 -1
- package/dist/preview/{chunk.2N6RQ427.js → chunk.F7AFJRPP.js} +1 -1
- package/dist/preview/{chunk.2CO2EJQA.js → chunk.FDFVGHQE.js} +1 -1
- package/dist/preview/{chunk.4SEY7VWZ.js → chunk.FFPG4PHX.js} +1 -1
- package/dist/preview/{chunk.MU5WUTVF.js → chunk.FKUVIG6D.js} +1 -1
- package/dist/preview/chunk.GDYI5QDS.js +1 -0
- package/dist/preview/{chunk.QQE7N7LB.js → chunk.GPJFNLEJ.js} +1 -1
- package/dist/preview/chunk.GQI53L5P.js +1 -0
- package/dist/preview/{chunk.3EW6L5DY.js → chunk.GQX57JIE.js} +1 -1
- package/dist/preview/{chunk.D53IGR45.js → chunk.GTUBIJTP.js} +1 -1
- package/dist/preview/{chunk.2OXXGN7C.js → chunk.GZEZMU2T.js} +2 -2
- package/dist/preview/{chunk.OTF3NNTI.js → chunk.HG34MT7C.js} +1 -1
- package/dist/preview/{chunk.N2S45SSL.js → chunk.HGP3Q7QX.js} +1 -1
- package/dist/preview/chunk.IATLUWAD.js +1 -0
- package/dist/preview/chunk.IDQHSAAQ.js +1 -0
- package/dist/preview/{chunk.KJBXNMIU.js → chunk.IMFAPZ6J.js} +2 -2
- package/dist/preview/{chunk.QBHVBL42.js → chunk.JC5NXMG3.js} +1 -1
- package/dist/preview/chunk.JJP5OL5E.js +1 -0
- package/dist/preview/{chunk.BVXOLZQ3.js → chunk.JLPBXG4P.js} +1 -1
- package/dist/preview/chunk.JLR74UFP.js +1 -0
- package/dist/preview/{chunk.G3Q5CYEM.js → chunk.JYJNRCK5.js} +1 -1
- package/dist/preview/chunk.K4ITS63T.js +1 -0
- package/dist/preview/{chunk.TABIRLQS.js → chunk.KFHXTHIY.js} +1 -1
- package/dist/preview/{chunk.NUUT37ER.js → chunk.KGGWFL54.js} +1 -1
- package/dist/preview/{chunk.4Q5KWYVY.js → chunk.KOPRZLJH.js} +2 -2
- package/dist/preview/{chunk.LUL6PFIQ.js → chunk.KT2LXHSI.js} +1 -1
- package/dist/preview/{chunk.GEY4MA4D.js → chunk.KZ3UPV2L.js} +1 -1
- package/dist/preview/{chunk.UL43GFVC.js → chunk.L2AV6JRA.js} +1 -1
- package/dist/preview/{chunk.3NEALGMI.js → chunk.L5MDUZLQ.js} +1 -1
- package/dist/preview/chunk.LDE5HLTM.js +1 -0
- package/dist/preview/{chunk.7SGQ3HFG.js → chunk.LGHMUUTG.js} +1 -1
- package/dist/preview/{chunk.AVDXG57A.js → chunk.LJXAZ5TF.js} +1 -1
- package/dist/preview/{chunk.4OTESF7W.js → chunk.M55U47A6.js} +1 -1
- package/dist/preview/chunk.M5RHVUZ6.js +1 -0
- package/dist/preview/chunk.MBZ6N5SO.js +1 -0
- package/dist/preview/{chunk.RI624PFK.js → chunk.MCPLU2U4.js} +1 -1
- package/dist/preview/chunk.MQISKON2.js +1 -0
- package/dist/preview/{chunk.RSR2M7ZO.js → chunk.MRUDTYOL.js} +2 -2
- package/dist/preview/chunk.N7FIUTVY.js +1 -0
- package/dist/preview/chunk.NPU4WYRB.js +1 -0
- package/dist/preview/{chunk.EJAVIZ7Y.js → chunk.O6SKKF4V.js} +1 -1
- package/dist/preview/{chunk.D25QV6DK.js → chunk.OB7XLVK6.js} +1 -1
- package/dist/preview/{chunk.MUHFZXPS.js → chunk.ODHCSYXX.js} +1 -1
- package/dist/preview/chunk.OHAWUOUN.js +1 -0
- package/dist/preview/chunk.OKQ4JXTW.js +1 -0
- package/dist/preview/{chunk.EM5CGFNB.js → chunk.OUNLAMBA.js} +1 -1
- package/dist/preview/chunk.OYQ6ZA6T.js +1 -0
- package/dist/preview/{chunk.PBCT33FF.js → chunk.Q7RI4SI4.js} +1 -1
- package/dist/preview/chunk.Q7UQ5OXA.js +1 -0
- package/dist/preview/{chunk.BJR6E2CT.js → chunk.QAUZDLDA.js} +1 -1
- package/dist/preview/{chunk.LD6S2FL5.js → chunk.QFI4L2HK.js} +1 -1
- package/dist/preview/{chunk.AGVFW6WC.js → chunk.QSZLY62B.js} +1 -1
- package/dist/preview/{chunk.O3ONLQUF.js → chunk.QZMBEG4E.js} +1 -1
- package/dist/preview/{chunk.IQHVVQEA.js → chunk.RK6BK5FD.js} +1 -1
- package/dist/preview/{chunk.BU6V76EF.js → chunk.ROJZLOKZ.js} +1 -1
- package/dist/preview/chunk.RXJBYP7B.js +1 -0
- package/dist/preview/chunk.S64LCR23.js +1 -0
- package/dist/preview/{chunk.D4IKO5YA.js → chunk.S7OFTGBQ.js} +4 -4
- package/dist/preview/chunk.SGMVLKZO.js +25 -0
- package/dist/preview/{chunk.ST4JHXPS.js → chunk.SJRXBTGP.js} +1 -1
- package/dist/preview/{chunk.BTORFVKO.js → chunk.SRU2YDTJ.js} +1 -1
- package/dist/preview/chunk.SVH3OMU2.js +1 -0
- package/dist/preview/{chunk.TBA4GF34.js → chunk.SWLDDQJS.js} +1 -1
- package/dist/preview/{chunk.ON35FJ5H.js → chunk.T4UYLB3Y.js} +1 -1
- package/dist/preview/chunk.THTHNY4N.js +1 -0
- package/dist/preview/{chunk.WQN7EFW3.js → chunk.TL7UGUY4.js} +2 -2
- package/dist/preview/{chunk.A7HMVWMG.js → chunk.TT6QBWRA.js} +1 -1
- package/dist/preview/{chunk.XN7PIWVC.js → chunk.TY6VILZB.js} +1 -1
- package/dist/preview/{chunk.KDTNKKOY.js → chunk.U2M4SGUU.js} +1 -1
- package/dist/preview/chunk.U6FGWVGB.js +1 -0
- package/dist/preview/{chunk.GRLPNTUW.js → chunk.UCS3CBT4.js} +1 -1
- package/dist/preview/{chunk.QWX2N2VD.js → chunk.UDTBFAS5.js} +1 -1
- package/dist/preview/chunk.UEL7FLL7.js +1 -0
- package/dist/preview/{chunk.X4MTZKL3.js → chunk.UGJ32SEL.js} +1 -1
- package/dist/preview/{chunk.4D26JY5U.js → chunk.UJTRKSCK.js} +1 -1
- package/dist/preview/{chunk.2QKSWK4U.js → chunk.UN2OB6OD.js} +1 -1
- package/dist/preview/chunk.UOC3SIYT.js +1 -0
- package/dist/preview/{chunk.THENABJU.js → chunk.V5IWJ3ZV.js} +1 -1
- package/dist/preview/{chunk.OL5D7YTW.js → chunk.VM43YREJ.js} +1 -1
- package/dist/preview/chunk.VVRI7DNK.js +1 -0
- package/dist/preview/{chunk.7JLYEZW4.js → chunk.WGRF6EHC.js} +1 -1
- package/dist/preview/{chunk.DFGXNFFE.js → chunk.XWLGHTH6.js} +1 -1
- package/dist/preview/chunk.YAS6LXQ7.js +1 -0
- package/dist/preview/{chunk.B2BLZDBD.js → chunk.YCJ74LZS.js} +1 -1
- package/dist/preview/{chunk.RMWLV3PR.js → chunk.YEKHDZ45.js} +2 -2
- package/dist/preview/chunk.YEMNR4WU.js +1 -0
- package/dist/preview/{chunk.ERWBI2NK.js → chunk.YG3BLY67.js} +1 -1
- package/dist/preview/{chunk.CXIIRL67.js → chunk.YUV7HZYG.js} +1 -1
- package/dist/preview/{chunk.UTRIPGW6.js → chunk.YYS45ZGQ.js} +1 -1
- package/dist/preview/{chunk.7JW5SHRR.js → chunk.YZ6UKKEL.js} +1 -1
- package/dist/preview/{chunk.OS75HEZP.js → chunk.ZBBCUK2K.js} +1 -1
- package/dist/preview/chunk.ZI66HRES.js +1 -0
- package/dist/preview/{chunk.6EHE26ZS.js → chunk.ZITDUHX3.js} +1 -1
- package/dist/preview/{chunk.423SZS7C.js → chunk.ZK446PSX.js} +3 -3
- package/dist/preview/{chunk.H42WBU5C.js → chunk.ZKDJQDKX.js} +1 -1
- package/dist/preview/{chunk.DSNHE4MZ.js → chunk.ZOQ3OKKI.js} +1 -1
- package/dist/preview/chunk.ZVETGRUM.js +1 -0
- package/dist/preview/{chunk.QPNFWP4Z.js → chunk.ZVOP2HHI.js} +1 -1
- package/dist/preview/index.html +51 -51
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2AZTW66C.js +0 -1
- package/dist/preview/chunk.2OLZ6BYI.js +0 -1
- package/dist/preview/chunk.4K7I7WYF.js +0 -1
- package/dist/preview/chunk.4QINLTDZ.js +0 -1
- package/dist/preview/chunk.4XKACWLT.js +0 -1
- package/dist/preview/chunk.52QB4YW2.js +0 -1
- package/dist/preview/chunk.54PZWX23.js +0 -1
- package/dist/preview/chunk.5YFO6D7J.js +0 -1
- package/dist/preview/chunk.6EGHJCEM.js +0 -1
- package/dist/preview/chunk.6WRA3Y7D.js +0 -1
- package/dist/preview/chunk.7C4IR4S7.js +0 -1
- package/dist/preview/chunk.B445DZOY.js +0 -1
- package/dist/preview/chunk.D4K23FUB.js +0 -1
- package/dist/preview/chunk.D66RI4QS.js +0 -1
- package/dist/preview/chunk.DTRNDSMS.js +0 -1
- package/dist/preview/chunk.DV4GSLGX.js +0 -9
- package/dist/preview/chunk.E2AJ7U5Z.js +0 -1
- package/dist/preview/chunk.EPTUOPPC.js +0 -1
- package/dist/preview/chunk.FNK2ZZ5E.js +0 -1
- package/dist/preview/chunk.FOYVTN5B.js +0 -1
- package/dist/preview/chunk.G25JEYCC.js +0 -1
- package/dist/preview/chunk.IVHPJUFM.js +0 -1
- package/dist/preview/chunk.IWEPDTVG.js +0 -1
- package/dist/preview/chunk.IYLOA3MV.js +0 -1
- package/dist/preview/chunk.JBG5UQLM.js +0 -1
- package/dist/preview/chunk.KLAEKRCA.js +0 -1
- package/dist/preview/chunk.NBJ4C33P.js +0 -1
- package/dist/preview/chunk.OKHEZJBX.js +0 -1
- package/dist/preview/chunk.P2AC6JRL.js +0 -88
- package/dist/preview/chunk.PFEKS3KO.js +0 -5
- package/dist/preview/chunk.PFR3FQBR.js +0 -1
- package/dist/preview/chunk.R5IRHCLZ.js +0 -1
- package/dist/preview/chunk.SGJSJGSR.js +0 -1
- package/dist/preview/chunk.SPZVEQC5.js +0 -1
- package/dist/preview/chunk.SR2345SW.js +0 -1
- package/dist/preview/chunk.TM6JVVGW.js +0 -25
- package/dist/preview/chunk.UT6642FC.js +0 -1
- package/dist/preview/chunk.VV3PNZPI.js +0 -1
- package/dist/preview/chunk.W6CGAPNQ.js +0 -1
- package/dist/preview/chunk.XJ7YGW6Y.js +0 -1
- package/dist/preview/chunk.XXZFWZ4C.js +0 -1
- package/dist/preview/chunk.YSFNPYCD.js +0 -2
- package/dist/preview/chunk.ZBL47SFK.js +0 -1
- /package/dist/preview/{chunk.4HUB3N7I.js → chunk.KHRS2SKB.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
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 _,b as pe,e as ue,f as me,g as ce}from"./chunk.FNK2ZZ5E.js";import{b as G}from"./chunk.RSR2M7ZO.js";import{c as de}from"./chunk.NQDGUIUQ.js";import{n as P}from"./chunk.FOYVTN5B.js";import{b as x,c as ie,d as oe,j as se,k as le}from"./chunk.A7HMVWMG.js";import{d as ae,e as re}from"./chunk.GRLPNTUW.js";import{b as te,f as ne}from"./chunk.EJAVIZ7Y.js";import{$ as Y,Ca as Z,Da as ee,G as he,R as X,_ as O,ba as U}from"./chunk.TM6JVVGW.js";import{a as Q}from"./chunk.SDO3U72B.js";import{fa as W,ka as J}from"./chunk.PFEKS3KO.js";import{b as D}from"./chunk.AJZBJBMO.js";var p=D(he(),1);var ve=ee(Q(()=>(__graviewPreload(import.meta.url,["./chunk.SPZVEQC5.js","./chunk.FNK2ZZ5E.js","./chunk.RSR2M7ZO.js","./chunk.WVUJXDXZ.js","./chunk.NQDGUIUQ.js","./chunk.DTRNDSMS.js","./chunk.3EW6L5DY.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.GZHZLJBF.js","./chunk.FOYVTN5B.js","./chunk.OJGHDWI6.js","./chunk.OTF3NNTI.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZBL47SFK.js")))),ye=ve.part((i,a)=>i.drawAppLink(a),{quiet:!0});var e=D(X(),1);function K({nodeId:i,field:a,value:l,stored:s=l,said:c}){let{fields:m,commit:o}=P(i),t=m.find(r=>r.field===a),{store:y,principal:I}=O(),u=y.graph.getNode(i)?.kind,g=y.schema.definitions.find(r=>r.kind===u),v=J(g,a),k=v.toLowerCase(),n=c??`${v.charAt(0).toUpperCase()}${v.slice(1)}: ${l}`,[w,E]=(0,p.useState)(!1),d=t?.shape.type==="number"?t.shape.amount:void 0,f=d&&s!==""&&Number.isFinite(Number(s))?ie(Number(s),d):s,[b,M]=(0,p.useState)(f),C=(0,p.useRef)(null),j=(0,p.useRef)(null),z=(0,p.useRef)(!1),S=r=>{z.current=r,E(!1)};(0,p.useEffect)(()=>M(f),[f,w]);let q=t?.shape.type==="date";if((0,p.useEffect)(()=>{if(q)return Z(()=>void ce())},[q]),(0,p.useEffect)(()=>{w?C.current?.focus():z.current&&(z.current=!1,j.current?.focus())},[w]),!t)return(0,e.jsx)("span",{"data-graview-field":a,"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${k}`,style:{color:"var(--graview-ink)",cursor:"default",overflowWrap:"anywhere"},children:l});if(!w)return(0,e.jsx)("button",{ref:j,type:"button","data-graview-field":a,"data-graview-editable":t.mutation,...n===l?{}:{"aria-label":n},title:`${t.title} \u2014 changes the ${k}, and can be undone`,onClick:()=>E(!0),style:{all:"unset",cursor:"text",display:"inline-flex",alignItems:"flex-end",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",paddingBottom:1,borderBottom:"1px dashed var(--graview-edge-bright)",color:"var(--graview-ink)"},children:l});let R=(r,{left:h=!1}={})=>{S(!h),!(r===s||r===""||r===void 0)&&(t.shape.type==="date"&&typeof r=="string"&&fe(r)||o(t,r))},fe=r=>{if(t.shape.type!=="date")return!1;let h=m.filter(L=>L.shape.type==="date"&&L.takesValue),T=le(h.map(L=>L.field),g?.fieldRoles??{}),A=T?.start===a?h.find(L=>L.field===T.end):void 0,F=y.graph.getNode(i)?.[T?.end??""];if(!A||typeof F!="string")return!1;let N=se(s===""?void 0:s,r,F,{time:t.shape.time===!0,instant:t.shape.instant===!0});if(N===void 0||N===F)return!1;let $=t.call(r),V=A.call(N);return y.applyAll($.name===V.name?[{name:$.name,args:{...$.args,...V.args}}]:[$,V],{author:I}),!0};if(!t.takesValue){let r=[t,...t.alternatives];return(0,e.jsx)("span",{role:"group","aria-label":`Change ${W(a).toLowerCase()}`,"data-graview-field":a,style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},onKeyDown:h=>{h.key==="Escape"&&S(!0)},children:r.map((h,T)=>(0,e.jsx)("button",{type:"button",ref:T===0?C:void 0,"data-graview-act":h.mutation,onClick:()=>{S(!0),o(h,void 0)},onBlur:A=>{let H=A.relatedTarget;(!H||!A.currentTarget.parentElement?.contains(H))&&S(!1)},style:{padding:"2px 9px",fontSize:"0.8125rem",borderRadius:999},children:h.title},h.mutation))})}return(0,e.jsxs)("form",{style:{display:"inline-flex",flexWrap:"wrap",gap:4,maxWidth:"100%"},onSubmit:r=>{r.preventDefault(),R(ge(t,b))},children:[t.shape.type==="choice"?(0,e.jsx)("select",{ref:C,"aria-label":W(a),"data-graview-field":a,value:b,onChange:r=>R(r.target.value),onBlur:()=>S(!1),style:{font:"inherit",fontSize:"inherit"},children:t.shape.options.map(r=>(0,e.jsx)("option",{value:r,children:te(g,a,r)},r))}):t.shape.type==="date"?(0,e.jsx)(me,{inputRef:C,label:W(a),value:b===""?void 0:b,time:t.shape.time===!0,instant:t.shape.instant===!0,onChange:r=>M(r??""),onLeave:r=>R(r,{left:!0}),onCancel:()=>S(!0),autoSelect:!0,boxStyle:{fontSize:"inherit",minHeight:24,padding:"0 3px"}}):(0,e.jsxs)(e.Fragment,{children:[d&&x(d).prefix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).prefix}):null,(0,e.jsx)("input",{ref:C,"aria-label":d?`${W(a)}, ${x(d).hint}`:W(a),"data-graview-field":a,...d?{inputMode:"decimal",placeholder:x(d).placeholder,"data-graview-amount":d.format??"unit"}:{},type:d?"text":t.shape.type==="number"&&!t.shape.duration?"number":"text",...t.shape.type==="number"&&t.shape.duration?{placeholder:"1h 30m"}:{},...t.shape.type==="text"&&t.shape.holds==="phone"?{inputMode:"tel",autoComplete:"tel"}:{},...t.shape.type==="number"&&t.shape.min!==void 0&&!d?{min:t.shape.min}:{},...t.shape.type==="number"&&t.shape.max!==void 0&&!d?{max:t.shape.max}:{},...t.shape.type==="number"&&t.shape.step!==void 0&&!d?{step:t.shape.step}:{},value:b,onChange:r=>M(r.target.value),onBlur:()=>R(ge(t,b),{left:!0}),onKeyDown:r=>{r.key==="Escape"&&S(!0)},style:{font:"inherit",fontSize:"inherit",width:`min(${Math.max(6,b.length+1)}ch, 100%)`,maxWidth:"100%",minWidth:0,boxSizing:"border-box",minHeight:24,display:"inline-flex",alignItems:"center",padding:"0 3px"}}),d&&x(d).suffix?(0,e.jsx)("span",{"aria-hidden":"true",children:x(d).suffix}):null]}),t.open.length>0?(0,e.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["also needs ",t.open.map(r=>r.name).join(", ")]}):null]})}function ge(i,a){return i.shape.type==="number"&&i.shape.amount?oe(a,i.shape.amount):i.shape.type==="number"?i.shape.duration?ne(a)??a:Number(a):i.shape.type==="text"&&i.shape.holds?a.trim():a}function be({href:i,field:a,value:l,stored:s,nodeId:c}){let m=i.startsWith("tel:"),o=(t,y)=>(0,e.jsx)("a",{href:i,"data-graview-link":a,...y?{"aria-label":y}:{},...m?{}:{target:"_blank",rel:"noopener noreferrer"},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",color:"var(--graview-accent)"},children:t});return c===void 0?o(l):(0,e.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"center",gap:"0 10px",maxWidth:"100%"},children:[(0,e.jsx)(K,{nodeId:c,field:a,value:l,...s===void 0?{}:{stored:s}}),o(m?"Call":"Map",m?`Call ${l}`:`Open ${l} in maps`)]})}function De({id:i,hide:a=[],limit:l=10,labels:s={},shown:c=[]}){let{store:m}=O(),o=U(i);if(!o)return null;let t=m.schema.tryDefinition(o.kind),y=ae(o,t,{limit:l,said:c}).filter(u=>!a.includes(u.key)),I=de(t).length>0;return y.length===0&&!I?null:(0,e.jsxs)("div",{"data-graview-fields":o.id,style:{display:"grid",gap:14,alignContent:"start",minWidth:0,fontSize:"0.875rem"},children:[re(t,y).map((u,g)=>{let v=(0,e.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"auto 1fr",gap:"5px 16px",alignContent:"start",minWidth:0},children:u.fields.map(n=>n.files?(0,e.jsx)(_,{as:"field",nodeId:o.id,field:n.key,label:s[n.key]??n.label,files:n.files,labelStyle:B,style:{marginTop:6}},n.key):n.long?(0,e.jsx)(we,{nodeId:o.id,field:n.key,label:s[n.key]??n.label,value:n.value,markdown:n.markdown,labelStyle:B,style:{gridColumn:"1 / -1",marginTop:6}},n.key):(0,e.jsxs)("div",{style:{display:"contents"},children:[(0,e.jsx)("dt",{style:{...B,whiteSpace:"nowrap"},children:s[n.key]??n.label}),(0,e.jsxs)("dd",{style:{margin:0,minWidth:0},children:[n.linked?(0,e.jsx)(pe,{relation:n.linked.relation,refs:n.linked.refs,nodeId:o.id,field:n.key}):n.app?(0,e.jsx)(ye,{address:n.app,as:"record",nodeId:o.id,field:n.key}):n.href?(0,e.jsx)(be,{href:n.href,field:n.key,value:n.value,stored:n.stored,nodeId:o.id}):(0,e.jsx)(K,{nodeId:o.id,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,e.jsx)(ue,{nodeId:o.id,field:n.key,start:o[n.key],value:o[`${n.key}Repeat`],label:`${s[n.key]??n.label} repeats`}):null]})]},n.key))});if(!u.title)return(0,e.jsx)("div",{children:v},g);let k=`graview-field-group-${o.id}-${g}`;return(0,e.jsxs)("div",{role:"group","aria-labelledby":k,style:{display:"grid",gap:6,minWidth:0},children:[(0,e.jsx)("p",{id:k,"data-graview-field-group":u.title,style:ke,children:u.title}),v]},g)}),I?(0,e.jsx)(_,{as:"unfilled",nodeId:o.id,skip:a,labels:s,labelStyle:B}):null]})}var B={color:"var(--graview-ink-faint)",fontSize:"0.8125rem"},ke={margin:0,fontSize:"0.75rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)",fontWeight:560};function we(i){return Y()?(0,e.jsx)(xe,{...i}):(0,e.jsx)(Se,{...i})}function Se({field:i,label:a,value:l,labelStyle:s,valueStyle:c,style:m,markdown:o}){return(0,e.jsxs)("div",{"data-graview-long":i,style:{display:"grid",gap:6,minWidth:0,...m},children:[(0,e.jsx)("dt",{style:s,children:a}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...c},children:(0,e.jsx)("div",{"data-graview-field":i,children:(0,e.jsx)(G,{text:l,markdown:o})})})]})}function xe({nodeId:i,field:a,label:l,value:s,labelStyle:c,valueStyle:m,style:o,markdown:t}){let{fields:y,commit:I}=P(i),u=y.find(f=>f.field===a&&f.takesValue),[g,v]=(0,p.useState)(!1),k=(0,p.useRef)(null),n=(0,p.useRef)(!1);(0,p.useEffect)(()=>{!g&&n.current&&(n.current=!1,k.current?.focus())},[g]);let w=f=>{n.current=f,v(!1)},E=l.toLowerCase(),d=(0,e.jsx)(G,{text:s,markdown:t});return(0,e.jsxs)("div",{"data-graview-long":a,style:{display:"grid",gap:6,minWidth:0,...o},children:[(0,e.jsxs)("dt",{style:{display:"flex",alignItems:"baseline",gap:10,...c},children:[(0,e.jsx)("span",{children:l}),u&&!g?(0,e.jsx)("button",{ref:k,type:"button","data-graview-editable":u.mutation,"aria-label":`Edit the ${E}`,title:`${u.title} \u2014 changes the ${E}, and can be undone`,onClick:()=>v(!0),style:Ee,children:"Edit"}):null]}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...m},children:g&&u?(0,e.jsx)(p.Suspense,{fallback:d,children:(0,e.jsx)(Ie,{field:a,label:l,value:s,...t?{markdown:!0}:{},onCancel:()=>w(!0),onSave:(f,b)=>{w(!b),f!==s&&I(u,f)}})}):(0,e.jsx)("div",{"data-graview-field":a,...u?{}:{"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${E}`},...u?{onClick:()=>v(!0)}:{},style:{cursor:u?"text":"default",minWidth:0},children:d})})]})}var Ie=(0,p.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.RSR2M7ZO.js","./chunk.423SZS7C.js","./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.7MWLDDFL.js"))),Ee={all:"unset",cursor:"pointer",fontSize:"0.75rem",letterSpacing:"normal",textTransform:"none",color:"var(--graview-accent)",borderBottom:"1px dashed currentColor",minHeight:24,minWidth:24,display:"inline-flex",alignItems:"flex-end"};function Oe({nodeId:i,children:a}){let{fields:l}=P(i),s=U(i);if(!s)return(0,e.jsx)(e.Fragment,{children:a});let c=l.find(m=>{let o=s[m.field];return typeof o=="string"&&o===a});return c?(0,e.jsx)(K,{nodeId:i,field:c.field,value:a,said:a}):(0,e.jsx)(e.Fragment,{children:a})}export{ye as a,K as b,be as c,De as d,we as e,Oe as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{c as Pe,d as Ee,e as ze,f as je}from"./chunk.W6CGAPNQ.js";import{q as He}from"./chunk.SIVMZNHZ.js";import{a as Ie}from"./chunk.3NEALGMI.js";import{e as X}from"./chunk.35FUGOSG.js";import{a as j}from"./chunk.D4K23FUB.js";import{f as De,g as Y,i as Je}from"./chunk.GRLPNTUW.js";import{a as Se}from"./chunk.EJAVIZ7Y.js";import{Ab as Ae,Ba as K,Bb as Oe,Da as he,Eb as Re,Fa as ye,Ga as Z,Hb as Te,K as pe,Kb as C,Na as ge,Oa as be,Ra as we,Sb as _e,Wc as $e,Xa as W,_a as ke,a as fe,dc as xe,ea as G,ec as Me,fc as Ne,xb as ve,ya as me}from"./chunk.PFEKS3KO.js";var E=(n,e,t)=>{(n[e]===void 0||t>n[e])&&(n[e]=t)},z=(n,e,t)=>{(n[e]===void 0||t<n[e])&&(n[e]=t)},Q=(n,e)=>{n.format=e,e.includes("int")&&(n.isInt=!0)},Le=(n,e)=>{n.mime=n.mime?n.mime.filter(t=>e.includes(t)):[...e]},qe=(n,e)=>{n.multipleOf??=[],n.multipleOf.includes(e)||n.multipleOf.push(e)},Fe=(n,e)=>(n.patterns??=new Set).add(e),at={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]};function I(n){let e={},{def:t,bag:r}=n._zod,i=n._zod.traits.has("$ZodCheck")?[n,...t.checks??[]]:t.checks??[];for(let o of i){let a=o._zod.def;switch(a.check){case"greater_than":E(e,a.inclusive?"minimum":"exclusiveMinimum",a.value);break;case"less_than":z(e,a.inclusive?"maximum":"exclusiveMaximum",a.value);break;case"multiple_of":qe(e,a.value);break;case"number_format":{Q(e,a.format);let d=at[a.format];d&&(E(e,"minimum",d[0]),z(e,"maximum",d[1]));break}case"bigint_format":Q(e,a.format);break;case"min_length":case"min_size":E(e,"minimum",a.minimum);break;case"max_length":case"max_size":z(e,"maximum",a.maximum);break;case"length_equals":E(e,"minimum",a.length),z(e,"maximum",a.length);break;case"size_equals":E(e,"minimum",a.size),z(e,"maximum",a.size);break;case"string_format":Q(e,a.format),a.pattern&&Fe(e,a.pattern),(a.format==="base64"||a.format==="base64url")&&(e.contentEncoding=a.format),(a.local||a.precision===-1)&&(e.laxFormat=!0);break;case"mime_type":Le(e,a.mime);break}}r.minimum!==void 0&&E(e,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&E(e,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&z(e,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&z(e,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&qe(e,r.multipleOf),r.format!==void 0&&(e.format??=r.format,r.format.includes("int")&&(e.isInt=!0)),r.mime&&Le(e,r.mime);for(let o of r.patterns??[])Fe(e,o);return e}var st={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function L(n){let e=n._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?L(e.out):e.type==="catch"?L(e.innerType):n._zod.optin}var dt=new Set(["promise","optional","nonoptional","nullable","readonly","default","prefault","catch"]);function _(n,e=new Set){if(e.has(n))return!1;e.add(n);let t=n._zod.def,r=t.type;return r==="transform"?!0:r==="array"?_(t.element,e):r==="set"?_(t.valueType,e):r==="lazy"?_(t.getter(),e):dt.has(r)?_(t.innerType,e):r==="intersection"?_(t.left,e)||_(t.right,e):r==="record"||r==="map"?_(t.keyType,e)||_(t.valueType,e):r==="pipe"?n._zod.traits.has("$ZodCodec")||_(t.in,e)||_(t.out,e):r==="object"?Object.values(t.shape).some(i=>_(i,e)):r==="union"?t.options.some(i=>_(i,e)):r==="tuple"?t.items.some(i=>_(i,e))||(t.rest?_(t.rest,e):!1):!1}function ct(n){let e=Object.values(n).filter(t=>typeof t=="number");return Object.entries(n).filter(([t])=>e.indexOf(+t)===-1).map(([,t])=>t)}function Be(n){let e=n.anyOf;if(!Array.isArray(e)||e.length===0||n.type!==void 0)return;let t=[];for(let r of e){if(!r||typeof r!="object")return;Be(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;for(let o of[r.type].flat()){if(typeof o!="string")return;t.includes(o)||t.push(o)}}delete n.anyOf,n.type=t.length===1?t[0]:t}var Ve=new Set(["type","properties","required","additionalProperties"]),We=n=>{let e=n.additionalProperties;return e&&typeof e=="object"&&Object.keys(e).length?e:null},Ce=(n,e)=>JSON.stringify(n)===JSON.stringify(e);function ee(n){for(let i of n){if(typeof i!="object"||i.type!=="object")return null;for(let o in i)if(!Ve.has(o))return null}let e={},t=new Set;for(let i of n){for(let o in i.properties){if(Object.prototype.hasOwnProperty.call(e,o))continue;let a=[];for(let d of n){let s=d.properties?.[o]??We(d);s&&!a.some(y=>Ce(y,s))&&a.push(s)}e[o]=a.length===1?a[0]:ee(a)??{allOf:a}}for(let o of i.required??[])t.add(o)}let r={type:"object",properties:e};if(t.size&&(r.required=[...t]),n.every(i=>i.additionalProperties===!1))r.additionalProperties=!1;else{let i=[];for(let o of n){let a=We(o);a&&!i.some(d=>Ce(d,a))&&i.push(a)}i.length===1?r.additionalProperties=i[0]:i.length>1&&(r.additionalProperties={allOf:i})}return r}function lt(n){let e=n.allOf;if(!Array.isArray(e)||e.length<2)return;for(let i of Ve)if(i in n)return;let t=e.filter(i=>Array.isArray(i.oneOf)||Array.isArray(i.anyOf)),r;if(!t.length)r=ee(e);else{let i=t[0],o=Array.isArray(i.oneOf)?"oneOf":"anyOf";if(Object.keys(i).length!==1)return;let a=e.filter(s=>s!==i),d=i[o].map(s=>ee([...a,s]));if(d.some(s=>!s))return;r={[o]:d}}r&&(delete n.allOf,Object.assign(n,r))}function Ue(n){let e=n;for(let S of["anyOf","oneOf"]){let T=e[S];if(!Array.isArray(T))continue;let O=T.map(Ue);O.some((v,h)=>v!==T[h])&&(e={...e,[S]:O})}let t=[e.type].flat(),r=!t.includes("string")&&t.some(S=>S==="number"||S==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!r&&!i?.some(S=>typeof S=="number"))return e;let{minimum:o,maximum:a,exclusiveMinimum:d,exclusiveMaximum:s,multipleOf:y,format:f,id:b,...p}=e;return p.enum?p.enum=p.enum.map(S=>typeof S=="number"?String(S):S):typeof p.const=="number"&&(p.const=String(p.const)),r&&(p.type="string",i||(p.pattern=t.includes("number")?"^-?\\d+(?:\\.\\d+)?$":"^-?\\d+$")),p}var B=class{constructor(e,t){this.override=e;this.refs=t}done=new Map;path=[];cyclic=new Map;write(e,t=!1){let r=this.refs.get(e);if(r!==void 0&&!t)return{$ref:r};if(this.path.includes(e))return this.cyclic.has(e)||this.cyclic.set(e,""),{};let i=this.done.get(e);if(i)return i;this.path.push(e);try{let o=this.written(e);return this.done.set(e,o),o}finally{this.path.pop()}}written(e){let t={},r,i=e._zod.toJSONSchema?.();i?Object.assign(t,i):r=this.process(e,t);let o=fe.get(e);if(o)for(let d of Object.keys(o))t[d]=o[d];_(e)&&(delete t.examples,delete t.default),"_prefault"in t&&(t.default??=t._prefault,delete t._prefault);let a=t;if(r){let d=this.write(r);a={...t};for(let s of Object.keys(d))s in t||(a[s]=d[s])}return this.override({zodSchema:e,jsonSchema:a}),Be(a),e._zod.def.type==="intersection"&<(a),a}process(e,t){let r=e._zod.def;switch(r.type){case"string":{t.type="string";let{minimum:i,maximum:o,format:a,patterns:d,contentEncoding:s,laxFormat:y}=I(e);if(typeof i=="number"&&(t.minLength=i),typeof o=="number"&&(t.maxLength=o),a&&(t.format=st[a]??a,(t.format===""||a==="time"||y)&&delete t.format),s&&(t.contentEncoding=s),d&&d.size>0){let f=[...d];f.length===1?t.pattern=f[0].source:t.allOf=f.map(b=>({pattern:b.source}))}return}case"number":{let{minimum:i,maximum:o,multipleOf:a,exclusiveMinimum:d,exclusiveMaximum:s,isInt:y}=I(e);if(t.type=y?"integer":"number",typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY)?t.exclusiveMinimum=d:typeof i=="number"&&(t.minimum=i),typeof s=="number"&&s<=(o??Number.POSITIVE_INFINITY)?t.exclusiveMaximum=s:typeof o=="number"&&(t.maximum=o),a){let[f,...b]=new Set(a.filter(p=>Number.isFinite(p)&&p!==0).map(Math.abs));f!==void 0&&(t.multipleOf=f),b.length&&(t.allOf=[...t.allOf??[],...b.map(p=>({multipleOf:p}))])}return}case"boolean":case"success":t.type="boolean";return;case"null":t.type="null";return;case"never":t.not={};return;case"enum":{let i=ct(r.entries);i.length===0?t.not={}:(i.every(o=>typeof o=="number")&&(t.type="number"),i.every(o=>typeof o=="string")&&(t.type="string"),t.enum=i);return}case"literal":{let i=r.values.filter(o=>o!==void 0).map(o=>typeof o=="bigint"?Number(o):o);if(r.values.length===0)t.not={};else if(i.length===1)t.type=i[0]===null?"null":typeof i[0],t.const=i[0];else if(i.length>1){for(let o of["number","string","boolean"])i.every(a=>typeof a===o)&&(t.type=o);i.every(o=>o===null)&&(t.type="null"),t.enum=i}return}case"template_literal":t.type="string",t.pattern=e._zod.pattern.source;return;case"file":{t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:i,maximum:o,mime:a}=I(e);i!==void 0&&(t.minLength=i),o!==void 0&&(t.maxLength=o),a&&(a.length===0?t.not={}:a.length===1?t.contentMediaType=a[0]:t.anyOf=a.map(d=>({contentMediaType:d})));return}case"array":{let{minimum:i,maximum:o}=I(e);typeof i=="number"&&(t.minItems=i),typeof o=="number"&&(t.maxItems=o),t.type="array",t.items=this.write(r.element);return}case"object":{let i=r.shape;t.type="object";let o={};t.properties=o;for(let d in i)Object.defineProperty(o,d,{value:this.write(i[d]),writable:!0,enumerable:!0,configurable:!0});let a=Object.keys(i).filter(d=>L(i[d])===void 0);a.length>0&&(t.required=a),r.catchall?._zod.def.type==="never"?t.additionalProperties=!1:r.catchall&&(t.additionalProperties=this.write(r.catchall));return}case"union":t[r.inclusive===!1?"oneOf":"anyOf"]=r.options.map(i=>this.write(i));return;case"intersection":{let i=d=>"allOf"in d&&Object.keys(d).length===1,o=this.write(r.left),a=this.write(r.right);t.allOf=[...i(o)?o.allOf:[o],...i(a)?a.allOf:[a]];return}case"tuple":{let i=r.items;t.type="array",t.prefixItems=i.map(s=>this.write(s)),r.rest?t.items=this.write(r.rest):t.items=!1;let o=i.length;for(;o>0&&L(i[o-1])!==void 0;)o-=1;o>0&&(t.minItems=o),r.rest||(t.maxItems=i.length);let{minimum:a,maximum:d}=I(e);typeof a=="number"&&(t.minItems=a),typeof d=="number"&&(t.maxItems=d);return}case"record":{let i=r.keyType;t.type="object";let o=I(i).patterns;if(r.mode==="loose"&&o&&o.size>0){let d=this.write(r.valueType),s={};for(let y of o)s[y.source]=d;t.patternProperties=s}else t.propertyNames=Ue(this.write(i)),t.additionalProperties=this.write(r.valueType);let a=i._zod.values;if(a&&!r.partial&&L(r.valueType)===void 0){let d=[...a].filter(s=>typeof s=="string"||typeof s=="number");d.length>0&&(t.required=d.map(String))}return}case"nullable":t.anyOf=[this.write(r.innerType),{type:"null"}];return;case"default":case"prefault":{let i=r.defaultValue,o,a=!1,d=JSON.stringify(i,(s,y)=>typeof y=="bigint"?(a=!0,null):y);return!a&&d!==void 0&&(o=JSON.parse(d)),a||(t[r.type==="default"?"default":"_prefault"]=o),r.innerType}case"catch":{try{t.default=r.catchValue(void 0)}catch{}return r.innerType}case"readonly":return t.readOnly=!0,r.innerType;case"pipe":return r.in._zod.traits.has("$ZodTransform")?r.out:r.in;case"lazy":return e._zod.innerType;case"optional":case"nonoptional":case"promise":return r.innerType;default:return}}};function Ge(n,e=()=>{}){let t=n,r=new B(e,new Map),i=r.write(t,!0);if(r.cyclic.size>0){let o=new Map,a=0,d=[];for(let y of r.cyclic.keys())if(y===t)o.set(y,"#");else{let f=`__schema${a++}`;o.set(y,`#/$defs/${f}`),d.push([y,f])}r=new B(e,o),i=r.write(t,!0);let s={};for(let[y,f]of d)s[f]=r.write(y,!0);d.length>0&&(i={...i,$defs:s})}return JSON.parse(JSON.stringify({$schema:"https://json-schema.org/draft/2020-12/schema",...i}))}function Ke(n){return Ge(n,pt)}var ut={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"},ft={phone:"A phone number as it is written, like +1 555 123 4567 or 020 7946 0958 ext. 12.",place:"An address or a place's name, as a person would search a map for it.",duration:"A length of time in whole minutes: 90 is 1 h 30 min."};function pt(n){me(n.zodSchema)&&(n.jsonSchema["x-graview-app-link"]=!0);let e=ye(n.zodSchema);if(e&&(n.jsonSchema.type==="string"||n.jsonSchema.type==="array")){n.jsonSchema["x-graview-linked"]={address:e.address,kinds:[...e.kinds],cardinality:e.cardinality};let s=e.kinds.join(" or "),y=`${e.cardinality==="many"?"Records":"A record"}: a ${s} in the app ${e.address}, as "${e.kinds[0]}:<id>" \u2014 an id found there with find_linked. Linking never changes that app.`,f=n.jsonSchema.description;typeof f=="string"&&f.includes(y)||(n.jsonSchema.description=`${typeof f=="string"&&f?`${f.replace(/\.?$/,".")} `:""}${y}`)}if(we(n.zodSchema)&&(n.jsonSchema["x-graview-repeat"]=!0,!n.jsonSchema.type&&!n.jsonSchema.anyOf&&!n.jsonSchema.oneOf&&Object.assign(n.jsonSchema,mt())),Se(n.zodSchema)){n.jsonSchema.contentMediaType="text/markdown";let s=n.jsonSchema.description;typeof s=="string"&&s.endsWith("Written in Markdown.")||(n.jsonSchema.description=`${typeof s=="string"&&s?`${s.replace(/\.?$/,".")} `:""}Written in Markdown.`)}let t=Te(n.zodSchema);if(t){let s=n.jsonSchema;s["x-graview-type"]=t,t==="duration"&&(s["x-graview-unit"]="minutes"),s.description??=ft[t]}let r=Re(n.zodSchema,!1);if(r){let s=De(r);n.jsonSchema["x-graview-format"]=s.format??"unit",s.currency&&(n.jsonSchema["x-graview-currency"]=s.currency),s.unit&&s.format!=="money"&&(n.jsonSchema["x-graview-unit"]=s.unit);let y=n.jsonSchema.description;n.jsonSchema.description=typeof y=="string"&&y.length>0?`${y} ${Y(s)}`:Y(s)}let i=n.zodSchema._zod?.def;if(!i||i.type!=="string"||typeof i.format!="string"||i.format==="regex")return;let o=n.jsonSchema,a=(i.checks??[]).map(s=>s._zod?.def).filter(s=>s?.format==="regex"&&s.pattern instanceof RegExp).map(s=>s.pattern.source);delete o.pattern;let d=o.allOf;Array.isArray(d)&&d.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete o.allOf,o.format=ut[i.format]??i.format,a.length===1?o.pattern=a[0]:a.length>1&&(o.allOf=a.map(s=>({pattern:s})))}function te(n,e){let t=C(n.input),r=Ke(n.input);if(e&&r.properties){let o=a=>e.includes(a)?e.indexOf(a):e.length;r.properties=Object.fromEntries(Object.entries(r.properties).sort(([a],[d])=>o(a)-o(d)))}let i=r.properties??{};if(Ae(n)){let o=n.creates.join(" | ");i.id={type:"string",minLength:1,description:`Optional: the id for the ${o} this makes. Refused if the graph already has it; left out, one is minted from the label.`},r.properties=i}Oe(n)&&(r.additionalProperties=!1);for(let o of t){let a=i[o.name];if(!a)continue;let d=o.kinds.includes("*")?"any node kind":o.kinds.join(" | ");a.description=[a.description,`Id of a node (${d}).`].filter(Boolean).join(" ")}return{name:n.name,...n.title===void 0?{}:{title:n.title},description:n.description??n.title??n.name,inputSchema:r,nodeRefs:t}}function mt(){let n={type:"string",pattern:"^\\d{4}-\\d{2}-\\d{2}$"},e=(t,r)=>({type:"integer",minimum:t,maximum:r});return{type:"object",description:'How the date beside it repeats; the date is the first occurrence. "on" is weekdays for "week", days of the month (-1 the last) for "month".',properties:{every:{type:"string",enum:[...be]},interval:e(1,99),on:{type:"array",minItems:1,maxItems:31,items:{anyOf:[{type:"string",enum:[...ge]},e(-1,31)]}},until:n,count:e(1,1e3),except:{type:"array",maxItems:500,items:n},continues:{type:"string",maxLength:200}},required:["every"],additionalProperties:!1}}function Ze(n){let e=new Set;for(let t=n;t;t=t.onBehalfOf)t.id!==void 0&&e.add(`${t.kind}:${t.id}`);return e}function V(n,e){let t=Ze(e),r=f=>{if(f.kind==="rule")return!1;let b=Ze(f);if(b.size===0)return!1;for(let p of b)if(t.has(p))return!1;return!0},i,o=()=>{if(i)return i;i=new Map;for(let f of n.log.live()){if(f.undoes!==void 0)continue;let b=r(f.author)?f.author:void 0;for(let p of f.primitives){p.op==="remove-node"&&i.delete(p.node.id);let S=p.op==="add-node"?p.node.id:p.op==="patch-node"?p.id:void 0;if(S===void 0)continue;let T=p.op==="add-node"?Object.keys(p.node):Object.keys(p.after),O=i.get(S);(p.op==="add-node"||!O)&&i.set(S,O=new Map);for(let v of T)v==="id"||v==="kind"||(b?O.set(v,b):O.delete(v))}}return i},a=n.schema,d=new Map,s=(f,b)=>{let p=`${f}\0${b}`,S=d.get(p);if(S===void 0){let T=a.tryDefinition(f)?.fields?.shape;S=T!==void 0&&b in T&&Je(T[b]).type==="text",d.set(p,S)}return S},y=f=>n.graph.getNode(f)?.kind;return{prose:s,say:f=>W(f,{graph:n.graph,schema:a}),fieldBy(f,b){let p=y(f);if(!(p===void 0||!s(p,b)))return o().get(f)?.get(b)},recordBy(f){let b=y(f),p=o().get(f);if(b===void 0||!p)return;let S;for(let[T,O]of p)s(b,T)&&(S=O);return S}}}var ne=(n,e,t)=>({untrusted:!0,authoredBy:t.say(e),text:n}),ht="the host's ranker";function Ye(n,e){return{...n,hits:n.hits.map(t=>{if(t.about!=="node")return t;t.why.by==="meaning"&&t.why.matched!==void 0&&(t={...t,why:{...t.why,matched:{untrusted:!0,authoredBy:ht,text:t.why.matched}}});let r=e.recordBy(t.id);if(!r)return t;let i=e.prose(t.kind,t.why.field)?e.fieldBy(t.id,t.why.field):r;return{...t,label:ne(t.label,r,e),...t.apart!==void 0?{apart:ne(t.apart,r,e)}:{},why:i?{...t.why,fragment:ne(t.why.fragment,i,e)}:t.why}})}}var ie=(n,e,t)=>({title:n,readOnlyHint:e,destructiveHint:!1,idempotentHint:t,openWorldHint:!1}),yt={name:"subscribe",title:"Notify me when something happens",description:`Subscribe the person you act for to be told when something happens in this app \u2014 their host delivers it (an email, a push). on is one of: "act" (an act runs; give act, its declared name, and/or record), "created" (a record of kind is added), "changed" (a record of kind, or the one record, changes), "reaches" (a record of kind, or the one record, comes to satisfy condition, an expression in the app's rule language such as done == true or amount > 100). They are told only of changes someone else made, unless alsoMine is true, and only of records they may see. Returns the subscription and its sentence. Changes nothing in the app.`,inputSchema:{type:"object",properties:{on:{type:"string",enum:["act","created","changed","reaches"],description:"What to be told of."},act:{type:"string",description:"An act's declared name, for on: act."},kind:{type:"string",description:"A kind, for created, changed and reaches."},record:{type:"string",description:"One record, by id or name: for act, changed and reaches."},condition:{type:"string",description:"For reaches: what the record should come to satisfy, in the rule language (done == true)."},alsoMine:{type:"boolean",description:"Also when the person themselves made the change; false when unsaid."}},required:["on"],additionalProperties:!1},mutating:!1,annotations:ie("Notify me when something happens",!1,!1)},gt={name:"unsubscribe",title:"Stop notifying me",description:"Take away one of the person's subscriptions, by the id list_subscriptions or subscribe answered. Changes nothing in the app.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The subscription's id."}},required:["id"],additionalProperties:!1},mutating:!1,annotations:ie("Stop notifying me",!1,!0)},bt={name:"list_subscriptions",title:"What I am notified of",description:`List what the person you act for is told of in this app: each subscription's id and its sentence ("When someone else adds a task").`,inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:ie("What I am notified of",!0,!0)},re=[yt,gt,bt];var F=n=>{let e;return()=>e??=n().catch(t=>{throw e=void 0,t})},wt=F(()=>(__graviewPreload(import.meta.url,["./chunk.EYSQPXVE.js","./chunk.AOEXSQDG.js","./chunk.35FUGOSG.js","./chunk.NQDGUIUQ.js","./chunk.DTRNDSMS.js","./chunk.3EW6L5DY.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.52QB4YW2.js"))),St=()=>(__graviewPreload(import.meta.url,["./chunk.D4K23FUB.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.QBHVBL42.js")).catch(()=>{}),kt=async()=>{(await St())?.judgeWithLines()},q=F(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.NQDGUIUQ.js","./chunk.DTRNDSMS.js","./chunk.3EW6L5DY.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.EJAVIZ7Y.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.X4MTZKL3.js"))),vt=F(()=>(__graviewPreload(import.meta.url,["./chunk.GEY4MA4D.js","./chunk.G4JJXA63.js","./chunk.NQ7SRWXA.js","./chunk.AOEXSQDG.js","./chunk.PBCT33FF.js","./chunk.XOZU4OFA.js","./chunk.35FUGOSG.js","./chunk.Q5WEOX3Q.js","./chunk.JBG5UQLM.js","./chunk.54PZWX23.js","./chunk.D4K23FUB.js","./chunk.WVUJXDXZ.js","./chunk.NQDGUIUQ.js","./chunk.DTRNDSMS.js","./chunk.3EW6L5DY.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.G25JEYCC.js"))),At=F(()=>(__graviewPreload(import.meta.url,["./chunk.FIS27KW4.js","./chunk.EYSQPXVE.js","./chunk.AOEXSQDG.js","./chunk.3NEALGMI.js","./chunk.UT6642FC.js","./chunk.35FUGOSG.js","./chunk.NQDGUIUQ.js","./chunk.DTRNDSMS.js","./chunk.3EW6L5DY.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.A7HMVWMG.js","./chunk.GRLPNTUW.js","./chunk.EJAVIZ7Y.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.D66RI4QS.js"))),Ot=F(()=>(__graviewPreload(import.meta.url,["./chunk.2QKSWK4U.js","./chunk.AVDXG57A.js","./chunk.LD6S2FL5.js","./chunk.TABIRLQS.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.LUL6PFIQ.js"))),Rt=n=>n.definitions.some(e=>Z(e).size>0),Xe=n=>({value:K(n),label:n.label,...n.describe?{describe:n.describe}:{},...n.card?{card:n.card}:{},fields:n.fields,...n.app?{app:n.app}:{}});async function Tt(n,e,t,r){let i=String(t.relation??""),[o,a]=i.includes(".")?i.split(".",2):[void 0,i],d=n.schema.definitions.flatMap(v=>[...Z(v)].map(([h,u])=>({kind:v.kind,name:h,relation:u}))),s=d.filter(v=>v.name===a&&(o===void 0||v.kind===o));if(s.length!==1){let v=d.map(h=>`${h.kind}.${h.name}`).join(", ")||"none";return{ok:!1,error:`${s.length===0?`No relation to another app is called "${i}"`:`"${i}" names a relation of several kinds`}. The relations to other apps are: ${v}.`}}let{kind:y,name:f,relation:b}=s[0];if(!r)return{ok:!1,error:`This seat cannot read ${b.address}: its host reads no other app's records. Nothing was changed.`};let p={kind:e.kind,...e.id===void 0?{}:{id:e.id},...e.roles?{roles:e.roles}:{}},S=typeof t.of=="string"?t.of:void 0;if(S!==void 0){let v=n.graph.getNode(S);if(!v||v.kind!==y)return{ok:!1,error:`No ${y} "${S}".`};let h=he(v[f],b),u=await Promise.all(h.map(w=>Promise.resolve().then(()=>r.resolve(w,p)).catch(()=>null)));return{ok:!0,data:{relation:`${y}.${f}`,app:b.address,records:u.map((w,k)=>w===null?{value:K(h[k]),missing:!0}:"denied"in w?{denied:!0,said:"linked record (no access)"}:Xe(w))},reads:[S]}}let T=typeof t.limit=="number"&&t.limit>0?Math.min(t.limit,20):20,O=await Promise.resolve().then(()=>r.find({address:b.address,kinds:b.kinds,query:String(t.query??""),limit:T},p)).catch(()=>[]);return Array.isArray(O)?{ok:!0,data:{relation:`${y}.${f}`,app:b.address,records:O.map(Xe),link:`edit-${y} with ${f} set to a record's value`}}:{ok:!0,data:{relation:`${y}.${f}`,app:b.address,denied:!0,said:"linked record (no access)"}}}var M=n=>({title:n,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),Qe={description:'Which records: false (the default) the live ones, true only the archived ones, "all" both. An archived record is set aside, not gone: unarchive-<kind> brings it back.',anyOf:[{type:"boolean"},{type:"string",enum:["all"]}]},oe={type:"number",description:"Where the page starts; 0 when unsaid."},se=[{name:"search_graph",title:"Find by name",description:"Find things by name: records whose name or readable fields carry the words, and the kinds, places and rules the words name \u2014 each with why it matched. Reach for this before get_graph when you know what something is called. Words match the start of words, case and accents aside; key:value tokens narrow as a list's filter does (done:false, is:any for past records, kind:<kind>). Pass subject (a node id) to get the acts you may run on it as hits too. When few records match exactly, records with a near word follow \u2014 a typo, another form of the word, a meaning \u2014 each with near: true and why.matched, the record's own word that answered.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Words, with optional key:value conditions."},limit:{type:"number",description:"Most hits to return; at most 20."},subject:{type:"string",description:"A node id whose acts to include."},archived:Qe},required:["query"],additionalProperties:!1},mutating:!1,annotations:M("Find by name")},{name:"get_graph",title:"Read the graph",description:"Read the graph, 25 nodes a page: their fields, the edges out of them, and how many more. Start here when you need the shape of the domain rather than one thing in it.",inputSchema:{type:"object",properties:{offset:oe,archived:Qe},additionalProperties:!1},mutating:!1,annotations:M("Read the graph")},{name:"get_node",title:"Read one node",description:"Read one node: its fields, its links (id, kind and label, 20 each way a page), the violations that implicate it, and its computed values: read-only fields worked out from what you can see, which no act sets. Use this to check a thing before you change it.",inputSchema:{type:"object",properties:{id:{type:"string",description:"A node's id, or its name."},offset:oe},required:["id"],additionalProperties:!1},mutating:!1,annotations:M("Read one node")},{name:"get_violations",title:"List the problems",description:"List the invariant violations the graph currently has, 20 a page, with the repairs that would resolve each one. Read this before proposing work: a rule that is already broken is more urgent than anything you could add.",inputSchema:{type:"object",properties:{offset:oe,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:M("List the problems")},{name:"get_affordances",title:"Ask what can be done",description:"Ask what can legally be done with a selection, ranked. Prefer these over composing a mutation by hand: they are derived from the schema, the invariants and the shape of the graph, so they cannot name an action that does not exist.",inputSchema:{type:"object",properties:{selection:{type:"array",items:{type:"string"},description:"Node ids."},context:{type:"object"}},required:["selection"],additionalProperties:!1},mutating:!1,annotations:M("Ask what can be done")},{name:"describe_place",title:"Say what a place shows",description:`Say what one place of the app shows you, as a person in your seat would see it: its headings, its figures as drawn, its lists with each record's title and what its card or row says, the headings a list is grouped under, what an empty list says, the forms it offers (each field in the order asked, its label, whether it must be answered, what it takes and its choices), and any block that could not be worked out. Pass a place's slug ("home", a lens's address like "the-offers", a kind's like "offers"), a record's id, or a visitor form's "forms/<name>", and width 390 for a phone. Use it after a change to check what somebody now sees, instead of guessing.`,inputSchema:{type:"object",properties:{place:{type:"string",description:`"home", a place's slug, a record's id, or "forms/<name>" for a visitor form.`},width:{type:"number",description:"The screen's width in CSS pixels; 390 is a phone, 1440 when unsaid."}},required:["place"],additionalProperties:!1},mutating:!1,annotations:M("Say what a place shows")},{name:"preview_mutation",title:"Try an act without applying it",description:"Try a mutation without applying it: get back the diff it would produce and any invariant it would break. Do this when you are unsure, rather than applying and undoing.",inputSchema:{type:"object",properties:{mutation:{type:"string"},args:{type:"object"}},required:["mutation","args"],additionalProperties:!1},mutating:!1,annotations:M("Try an act without applying it")},{name:"undo_batch",title:"Undo a batch",description:"Undo one batch of operations. Fails, naming the blocking operation, when a later operation read what it wrote.",inputSchema:{type:"object",properties:{batch:{type:"string"},include:{type:"array",items:{type:"string"}}},required:["batch"],additionalProperties:!1},mutating:!0,annotations:{title:"Undo a batch",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},{name:"list_suggestions",title:"List what is suggested",description:"List the suggestions waiting for a person: changes the app's own actor proposed and did not make, each with its id, what it would do, who suggested it, what it was based on and how sure (0 to 1). Nothing changes until one is accepted (accept_suggestion) or declined (decline_suggestion); a declined one is never suggested again.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:M("List what is suggested")},{name:"accept_suggestion",title:"Accept a suggestion",description:"Make a waiting suggestion's change, as this seat, carrying what it was based on. Returns the batch (undo_batch takes it back).",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Accept a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}},{name:"decline_suggestion",title:"Decline a suggestion",description:"Decline a waiting suggestion: nothing changes, the decline is kept in the log, and the same change is never suggested or made by the app's own actor again.",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Decline a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}],tt={name:"act_on_several",title:"Do one act to several records",description:`Run one act on several records at once, as one change with one undo. act is the act (its tool name or its declared name), records the records it runs on (ids or names; each goes in the act's subject), args what every call shares ("Set stage to Declined" is args { stage: "declined" }). Each record is judged on its own: one this seat may not change is named with why, and the rest still apply. Returns the batch (undo_batch takes it all back), the records changed, those already so, and those refused.`,inputSchema:{type:"object",properties:{act:{type:"string",description:"The act to run on each record."},records:{type:"array",items:{type:"string"},minItems:1,maxItems:200,description:"Ids or names of the records."},args:{type:"object",description:"Arguments every call shares, besides the record."}},required:["act","records"],additionalProperties:!1},mutating:!0,annotations:{title:"Do one act to several records",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},ue={name:"suggest_changes",title:"Suggest changes",description:"Keep calls ({ act, args }) as one suggestion a person accepts or declines, with its basis and confidence (0 to 1). Changes nothing; a declined change is refused.",inputSchema:{type:"object",properties:{calls:{type:"array",items:{type:"object"}},basis:{type:"string"},confidence:{type:"number"}},required:["calls","basis"]},mutating:!0,annotations:{title:"Suggest changes",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},de={type:"object",description:"A lens, as draft_view returns one.",properties:{title:{type:"string"},lens:{type:"string"},on:{type:"string"},bindings:{type:"object"},options:{type:"object"}},required:["title","lens","on"]},ce={name:"draft_view",title:"Draw a view",description:'Draw a view of the data from words ("a board of tasks by status", "who covers what") as a lens the app could keep; or check a lens you wrote (lens); or change the one on screen (current, with ask: "only this month"). Returns the lens and its add-lens edit, or one sentence saying why not. Writes nothing.',inputSchema:{type:"object",properties:{ask:{type:"string",description:"What to see, in words."},lens:de,current:de},additionalProperties:!1},mutating:!1,annotations:M("Draw a view")},nt={name:"keep_lens",title:"Keep a view as a lens",description:"Keep a lens draft_view drew as one of the app's places: checked again, then written as the add-lens edit. Returns the remove-lens edit that takes it back.",inputSchema:{...de,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},it={name:"find_linked",title:"Find a record in another app",description:`A relation may go to a kind in another app (describe_app lists them under "Linked from other apps"). With relation and words, list the records there this seat may link \u2014 each with the value to link it by ("house:h1"), its name and its describe line. With of (a record id here), read the records that record links, as this seat may see them there. Linking one is the record's edit (edit-<kind>) with the relation set to the value. Another app this seat may not open answers denied, and nothing of it. Writes nothing; never changes the other app.`,inputSchema:{type:"object",properties:{relation:{type:"string",description:"The relation, by name (forHouse) or as <kind>.<relation> (scenario.forHouse)."},query:{type:"string",description:"Words to find by, in the other app's names; empty for the first few."},of:{type:"string",description:"A record here whose linked records to read, instead of finding."},limit:{type:"number",description:"Most records to return; at most 20."}},required:["relation"],additionalProperties:!1},mutating:!1,annotations:M("Find a record in another app")};function _t(n,e){return n===void 0?[]:n==="keep"&&!e?[ce,nt]:[ce]}var xt="An argument that names a record takes its id or its name.",rt=[...se.map(n=>n.name),tt.name,ue.name,ce.name,nt.name,it.name,...re.map(n=>n.name)],ot=64;function N(n){let{line:e,...t}=n;return t}function et(n){return{...n,...n.introduces?{introduces:n.introduces.map(N)}:{},...n.resolves?{resolves:n.resolves.map(N)}:{},...n.violationsAfter?{violationsAfter:n.violationsAfter.map(N)}:{}}}function Mt(n){let e=n.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return e.length===0&&(e="act"),/^[A-Za-z_]/.test(e)||(e=`act_${e}`),e.slice(0,ot)}function Nt(n){let e=new Set(rt),t=new Map;for(let r of n){let i=Mt(r),o=i;for(let a=2;e.has(o);a+=1)o=`${i.slice(0,ot-`_${a}`.length)}_${a}`;e.add(o),t.set(r,o)}return t}function $t(n,e){if(e.size===0)return n;let t=Object.fromEntries(Object.entries(n.properties??{}).filter(([i])=>!e.has(i))),r=(n.required??[]).filter(i=>!e.has(i));return{...n,properties:t,...n.required?{required:r}:{}}}function Dt(n,e,t,r){let i=te(n,_e(r,n)),o=G(n),a=i.nodeRefs.length>0?`${i.description}${/[.!?]$/.test(i.description)?"":"."} ${xt}`:i.description;return{name:e,title:o,description:a,inputSchema:$t(i.inputSchema,t),mutating:!0,annotations:{title:o,readOnlyHint:!1,destructiveHint:n.destructive===!0||(n.severs?.length??0)>0,idempotentHint:n.idempotent===!0,openWorldHint:!1},act:n.name}}function le(n){if(n===null||typeof n!="object")return JSON.stringify(n)??"null";if(Array.isArray(n))return`[${n.map(le).join(",")}]`;let e=n;return`{${Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${JSON.stringify(t)}:${le(e[t])}`).join(",")}}`}function Jt(n){return`sha256:${$e(le(n))}`}function Pt(n,e,t,r,i,o=!1,a=!1,d=!1,s){let y=Nt(n.map(p=>p.name)),f=[..._t(r,t),...o?[it]:[],...a?re:[]];return{definitions:t?[...se.filter(p=>!p.mutating),...f]:[...se,tt,...d?[ue]:[],...f,...n.filter(p=>e.has(p.name)).map(p=>Dt(p,y.get(p.name),i(p),s))],names:y}}function bn(n,e={}){let t=e.author??{kind:"agent"},r=n.allMutations(),i=new Set(n.permittedMutations(t).map(h=>h.name)),{definitions:o,names:a}=Pt(r,i,e.readOnly===!0,e.drafts?e.drafts.keep?"keep":"draw":void 0,h=>X(n.schema,n.policy,t,h),Rt(n.schema),e.subscriptions!==void 0,Ne(t),n.schema),d=Jt(o),s={app:e.app?.brand?.locale,appTimeZone:e.app?.brand?.timeZone},y=h=>pe(s,h),f=h=>{if(!rt.includes(h)){for(let[u,w]of a)if(w===h)return u;return a.has(h)?h:xe(h,a.keys())}},b=h=>{let u=Me(h,a.keys());return u?` Did you mean "${u}"?`:""},p=h=>{let u=o.find(k=>k.name===h)??o.find(k=>k.act===h);if(u)return u;let w=f(h);return w===void 0?void 0:o.find(k=>k.act===w)},S=(h,u)=>{let w=r.find(c=>c.name===h);if(!w)return{args:u,resolved:[]};let k={...u},l=[];for(let c of C(w.input)){let m=k[c.name];if(typeof m!="string"||m.trim()==="")continue;let g=n.resolveRef(c,m,t);if(!g.ok){let A=g.reason==="none"?` Nothing was changed. Use search_graph to look it up, then pass its id as ${c.name}.`:" Nothing was changed.";return{ok:!1,error:`${g.message}${A}`,argument:c.name,candidates:g.candidates}}g.by!=="id"&&(k[c.name]=g.id,l.push({argument:c.name,given:m,id:g.id,label:g.label}))}return{args:k,resolved:l}},T=async(h,u)=>{try{await kt();let w=p(h);if(!w&&h===ue.name)return{ok:!1,error:"Only the app's own actor (automated: true) suggests changes.",reason:"forbidden"};if(!w){let l=f(h);if(l){let c=n.permits({name:l,args:u},t);if(!c.ok)return{ok:!1,error:c.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${h}".${b(h)} Available: ${o.map(c=>c.name).join(", ")}`}}if(w.mutating&&e.readOnly)return{ok:!1,error:`"${h}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(w.act!==void 0){let l=S(w.act,u);if("ok"in l)return l;let c=w.act,m=y(()=>j(n,t,n.apply({name:c,args:l.args},{...e.author?{author:e.author}:{},...U(e.via)})));return{ok:!0,data:{batch:m.batch,intent:m.intent,introduces:m.introduces.map(N),resolves:m.resolves.map(N),...l.resolved.length>0?{resolved:l.resolved}:{}},diff:m.diff}}let k=n.seenBy(t);switch(w.name){case"search_graph":{let l=typeof e.places=="function"?e.places():e.places,c=typeof u.subject=="string"?u.subject:void 0,m=He(k,String(u.query??""),{principal:t,rank:e.near,archived:ke(u.archived),limit:typeof u.limit=="number"&&u.limit>0?Math.min(u.limit,20):20,...l?{places:l}:{},...c?{subject:c,from:[c]}:{}}),g=m.later?await m.later:m;return{ok:!0,data:(await q()).searchRead(g,Ye(g,V(k,t))),reads:g.hits.flatMap(A=>A.about==="node"?[A.id]:[])}}case"get_graph":return{ok:!0,...(await q()).graphRead(k,V(k,t),u)};case"get_node":{let l=String(u.id??""),c=l,m;if(!k.graph.getNode(l)){let A=l.trim()===""?void 0:n.resolveRef({name:"id",kinds:["*"]},l,t);if(A?.ok)c=A.id,m={argument:"id",given:l,id:c,label:A.label};else return A?.reason==="ambiguous"?{ok:!1,error:A.message,argument:"id",candidates:A.candidates}:{ok:!1,error:`No node "${l}".`}}let g=(await q()).nodeRead(k,V(k,t),c,u);return{ok:!0,data:m?{...g.data,resolved:[m]}:g.data,reads:g.reads}}case"describe_place":{let l=e.app??{name:"",schema:n.schema},c=typeof u.width=="number"&&Number.isFinite(u.width)&&u.width>0?u.width:1440,{describePlace:m}=await wt(),g=m(n,t,String(u.place??""),{app:l,width:c});if(!g.ok)return{ok:!1,error:`${g.error} The places are: ${g.places.join(", ")}.`};let A=new Set,$=H=>{for(let J of H)for(let x of J.groups??[])for(let D of x.items)A.add(D.id),$(D.parts)};return $(g.description.parts),{ok:!0,data:g.description,reads:[...A]}}case"find_linked":return Tt(k,t,u,e.linked);case"draft_view":case"keep_lens":{let l=e.app??{name:"",schema:n.schema};return(await vt()).runDraftTool(w.name,u,{app:l,principal:t,...e.drafts?{drafts:e.drafts}:{}})}case"get_violations":{let l=k.violations(u.context);return{ok:!0,...(await q()).violationsRead(l,u)}}case"get_affordances":{let l=u.selection??[];return{ok:!0,data:Ie(k,l,{...typeof e.derive=="function"?e.derive():e.derive,...e.author?{principal:e.author}:{},...u.context?{context:u.context}:{}}),reads:l.filter(m=>k.graph.has(m))}}case"preview_mutation":{let l=String(u.mutation),c=f(l)??l,m=S(c,u.args??{});if("ok"in m)return m;let g=n.missingFor({name:c,args:m.args},t);if(g)return{ok:!1,error:g.message,reason:"missing"};let A=j(n,t,n.preview({name:c,args:m.args},void 0,{author:t})),$=et(A);return{ok:!0,data:m.resolved.length>0?{...$,resolved:m.resolved}:$}}case"act_on_several":{let l=String(u.act??""),c=f(l)??l,m=r.find(R=>R.name===c);if(!m||!i.has(c)){let R=m?n.permits({name:c,args:{}},t):void 0;return R&&!R.ok?{ok:!1,error:R.refusal.message,reason:"forbidden"}:{ok:!1,error:`There is no act "${l}" this seat may run.${b(l)} Nothing was changed.`,reason:"invalid"}}let g=m.subject;if(!g)return{ok:!1,error:`"${G(m)}" does not act on a record, so it cannot be run on several. Nothing was changed.`,reason:"invalid"};let A=Array.isArray(u.records)?u.records.filter(R=>typeof R=="string"&&R.trim()!==""):[];if(A.length===0)return{ok:!1,error:"Name at least one record. Nothing was changed.",reason:"invalid"};let $=[],H=[];for(let R of A.slice(0,200)){let P=n.resolveRef({name:g.arg,kinds:g.kinds},R,t);if(!P.ok)return{ok:!1,error:`${P.message} Nothing was changed.`,argument:"records",candidates:P.candidates};$.push(P.id),P.by!=="id"&&H.push({argument:"records",given:R,id:P.id,label:P.label})}let J=S(c,{...u.args??{}});if("ok"in J)return J;let x=(await At()).actOnSeveral(n,{mutation:c,subject:g.arg,args:J.args},$,{author:t,...U(e.via)}),D=x.result?j(n,t,x.result):void 0;return{ok:!0,data:{...x.batch?{batch:x.batch,intent:x.intent}:{},applied:x.applied,unchanged:x.unchanged,refused:x.refused.map(R=>({record:R.id,label:R.label,error:R.message,reason:R.reason})),...x.allOrNothing?{keptNone:!0}:{},...D?{introduces:D.introduces.map(N),resolves:D.resolves.map(N)}:{},...H.length>0||J.resolved.length>0?{resolved:[...H,...J.resolved]}:{}},...D?{diff:D.diff}:{}}}case"subscribe":case"unsubscribe":case"list_subscriptions":{let l=await(await Ot()).runSubscriptionTool(w.name,u,{store:n,principal:e.subscriber??t,app:e.app?.name??"app",subscriptions:e.subscriptions});return l.ok?{ok:!0,data:l.data}:{ok:!1,error:l.error}}case"list_suggestions":{let l=Ee(n,t).map(c=>{let m=W(c.author,{graph:k.graph,schema:n.schema});return{id:c.id,intent:c.intent,by:m,at:c.at,about:c.about,...c.lineage?{basis:{untrusted:!0,authoredBy:m,text:c.lineage.basis},...c.lineage.confidence!==void 0?{confidence:c.lineage.confidence}:{}}:{}}});return{ok:!0,data:{suggestions:l},reads:[...new Set(l.flatMap(c=>c.about))]}}case"suggest_changes":{let l=u.calls.map(m=>({name:f(m.act)??m.act,args:m.args}));return{ok:!0,data:{suggestion:Pe(n,l,{author:t,lineage:{basis:u.basis,confidence:u.confidence},...U(e.via)})?.id??null}}}case"accept_suggestion":case"decline_suggestion":{let l=String(u.suggestion??""),c={author:t,...U(e.via)},m=w.name==="accept_suggestion"?ze(n,l,c):je(n,l,c),g=j(n,t,m);return{ok:!0,data:{batch:g.batch,intent:g.intent,introduces:g.introduces.map(N),resolves:g.resolves.map(N)},diff:g.diff}}case"undo_batch":{let l=String(u.batch),c=u.include??[],m=k.canUndo([l,...c]);if(!m.ok)return{ok:!1,error:m.message};let g=j(n,t,n.undo([l,...c],{...e.author?{author:e.author}:{}}));return{ok:!0,data:et(g),diff:g.diff}}default:return{ok:!1,error:`Unknown tool "${h}".`}}}catch(w){let{reason:k,wouldNeed:l}=ve(w);return{ok:!1,error:w instanceof Error?w.message:String(w),reason:k,...l?{wouldNeed:l}:{}}}},O=new Set,v=h=>{for(let u of O)u(h)};return{definitions:o,hash:d,...e.author?{author:e.author}:{},onDiff(h){return n.subscribe(h)},onCall(h){return O.add(h),()=>O.delete(h)},async call(h,u){let w=p(h)?.mutating??!1,k={name:h,args:u,mutating:w,at:new Date().toISOString()};v({...k,phase:"running"});let l=m=>(v(m.ok?{...k,phase:"ok",...!w&&m.reads?{reads:m.reads}:{}}:{...k,phase:"failed",error:m.error}),m),c=await T(h,u);return l(c.ok&&!w?{...c,data:(await q()).withinReadChars(h,c.data)}:c)}}}function U(n){let e=typeof n=="function"?n():n;return e?{via:e}:{}}export{le as a,bn as b};
|
|
@@ -1,25 +0,0 @@
|
|
|
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 Ke}from"./chunk.SDO3U72B.js";import{Bd as Un,Ga as Wn,Gd as Fe,Hc as Kn,Hd as wt,J as Nn,Ka as St,Ma as jn,Sc as Bn,Vc as qn,Xa as Gn,Yc as zn,kc as Fn,ld as $n}from"./chunk.PFEKS3KO.js";import{a as Ge,b as _}from"./chunk.AJZBJBMO.js";var yo=Ge(w=>{"use strict";var Rt=Symbol.for("react.transitional.element"),Nr=Symbol.for("react.portal"),Wr=Symbol.for("react.fragment"),jr=Symbol.for("react.strict_mode"),Gr=Symbol.for("react.profiler"),Fr=Symbol.for("react.consumer"),Kr=Symbol.for("react.context"),Br=Symbol.for("react.forward_ref"),qr=Symbol.for("react.suspense"),zr=Symbol.for("react.memo"),so=Symbol.for("react.lazy"),$r=Symbol.for("react.activity"),oo=Symbol.iterator;function Ur(e){return e===null||typeof e!="object"?null:(e=oo&&e[oo]||e["@@iterator"],typeof e=="function"?e:null)}var lo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},uo=Object.assign,co={};function ge(e,t,n){this.props=e,this.context=t,this.refs=co,this.updater=n||lo}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 fo(){}fo.prototype=ge.prototype;function Tt(e,t,n){this.props=e,this.context=t,this.refs=co,this.updater=n||lo}var Mt=Tt.prototype=new fo;Mt.constructor=Tt;uo(Mt,ge.prototype);Mt.isPureReactComponent=!0;var ro=Array.isArray;function kt(){}var O={H:null,A:null,T:null,S:null},po=Object.prototype.hasOwnProperty;function Ot(e,t,n){var o=n.ref;return{$$typeof:Rt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Yr(e,t){return Ot(e.type,t,e.props)}function Vt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rt}function Zr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var io=/\/+/g;function At(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Zr(""+e.key):t.toString(36)}function Xr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(kt,kt):(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 Rt:case Nr:a=!0;break;case so:return a=e._init,me(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+At(e,0):o,ro(r)?(n="",a!=null&&(n=a.replace(io,"$&/")+"/"),me(r,t,n,"",function(u){return u})):r!=null&&(Vt(r)&&(r=Yr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(io,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=o===""?".":o+":";if(ro(e))for(var s=0;s<e.length;s++)o=e[s],i=l+At(o,s),a+=me(o,t,n,i,r);else if(s=Ur(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=l+At(o,s++),a+=me(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return me(Xr(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 Xe(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 Jr(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 ao=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)},Qr={map:Xe,forEach:function(e,t,n){Xe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xe(e,function(){t++}),t},toArray:function(e){return Xe(e,function(t){return t})||[]},only:function(e){if(!Vt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=$r;w.Children=Qr;w.Component=ge;w.Fragment=Wr;w.Profiler=Gr;w.PureComponent=Tt;w.StrictMode=jr;w.Suspense=qr;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=uo({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!po.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),l=0;l<i;l++)a[l]=arguments[l+2];o.children=a}return Ot(e.type,r,o)};w.createContext=function(e){return e={$$typeof:Kr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Fr,_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)po.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 l=Array(a),s=0;s<a;s++)l[s]=arguments[s+2];r.children=l}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Ot(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:Br,render:e}};w.isValidElement=Vt;w.lazy=function(e){return{$$typeof:so,_payload:{_status:-1,_result:e},_init:Jr}};w.memo=function(e,t){return{$$typeof:zr,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(kt,ao)}catch(i){ao(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 W=Ge((Na,mo)=>{"use strict";mo.exports=yo()});var Po=Ge(et=>{"use strict";var ui=Symbol.for("react.transitional.element"),ci=Symbol.for("react.fragment");function Eo(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:ui,type:e,key:o,ref:t!==void 0?t:null,props:n}}et.Fragment=ci;et.jsx=Eo;et.jsxs=Eo});var Ie=Ge((za,Ao)=>{"use strict";Ao.exports=Po()});var fe={focusId:null,relation:null,expanded:[],pins:{}},Be=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function te(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}`,`${qe(r.x)},${qe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${qe(e.pan.x)},${qe(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 Cr(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,p]of n){if(!m.startsWith("pin."))continue;let[g,v]=p.split(","),T=g===void 0?null:Be(g),y=v===void 0?null:Be(v);T===null||y===null||(o[m.slice(4)]={x:T,y})}let r=Object.create(null);for(let[m,p]of n)!m.startsWith("in.")||p.length===0||(r[m.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],l=a[0]===void 0?null:Be(a[0]),s=a[1]===void 0?null:Be(a[1]),u=(n.get("sel")??"").split(",").filter(m=>m.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{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()}:{},...l!==null&&s!==null?{pan:{x:l,y:s}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:Cr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(m=>m.length>0&&(f||!m.startsWith("kind:"))).sort(),pins:o}}function ba(e){let t=ze(e);return te(t)==="#"?{...t,overview:!0}:t}function xa(e){let t=te(e);return t==="#overview=1"?"":t}function qe(e){return Math.round(e*100)/100}function Zn(e,t){return te(e)===te(t)}var Yn="edge:";function Xn(e){if(!e.startsWith(Yn))return null;let t=e.slice(Yn.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 vt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function q(e,t){if(t===e.focusId)return{...e,focusId:t};let n=vt(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function Jn(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 pe(e,t){if(t!==e.overview&&(e=vt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function $e(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Ve(e,t){if(t!==(e.zoom===!0)&&(e=vt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Ue(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Ze="aggregate:",Ye="kind:";function bt(e){return`${Ye}${e}`}function ye(e){return e.startsWith(Ye)?e.slice(Ye.length):null}var Aa="kinds:beyond";function Ir(e){let t=ye(e);return t?[t]:se(e)}function ne(...e){return`${Ze}${[...e].sort().join("+")}`}function Qn(e){return e.startsWith(Ze)}function se(e){return!Qn(e)||e.includes("|")?[]:e.slice(Ze.length).split("+").filter(Boolean)}function eo(e,t,n={}){let o=ye(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Ue(e,t);let r=o!==null?ne(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Ve(e,!1);if(o!==null&&n.carry){let i=pe({...q(e,r),relation:null},!1);return ae(Ve(i,!0),"q",n.carry)}return Ve({...q(e,r),relation:null},!0)}function _r(e,t,n){return ae(pe(q(e,ne(t)),!1),"view",n)}function ka(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var to="aggregate:";function xt(e){return e.startsWith(to)&&e.includes("|")}var Et=e=>e?.off===!0,Lr=e=>e!==void 0&&!Et(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),no=e=>e!==void 0&&!Et(e)&&(e.fast!==void 0||e.decide!==void 0),Hr=e=>e?.suggestOnOpen!==!1&&no(e),Dr=e=>e?.hoverChips===!0&&no(e);var Pt={};var go=_(W(),1),ei={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},ho=e=>`graview:seat:${e}`;function ti(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 ni(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Ct(e){let t=e===null?null:ho(e),n={...ei,...ti(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&ni(t,n);for(let l of[...o])l()};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 oi(e){return(0,go.useSyncExternalStore)(e.subscribe,e.get,e.get)}var wo=_(W(),1),ri={entries:[],ghost:null,loaded:!1};function So(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 It(e){let t=ri,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:So(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:So(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function ii(e){return(0,wo.useSyncExternalStore)(e.subscribe,e.get,e.get)}function vo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Je=_(W(),1),Qe=(0,Je.createContext)(void 0),ai=()=>(0,Je.useContext)(Qe);var A=_(W(),1),Ce=(0,A.createContext)(null);function xo(){return(0,A.useContext)(Ce)}function si(e,t){let n=xo(),o=(0,A.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,A.useRef)(0),i=(0,A.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,A.useSyncExternalStore)(i,()=>r.current,()=>0),o}var li=Ke(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.E2AJ7U5Z.js"))),bo,di=400;function _t(e,t,n){let o=(0,A.useContext)(Ce),r=o!==null&&o.owns(e,t),[i,a]=(0,A.useState)(null),[l,s]=(0,A.useState)(bo);(0,A.useEffect)(()=>{if(l||r||i===null)return;let x=!0;return li().then(C=>{bo=C,x&&s(C)},()=>{}),()=>{x=!1}},[l,r,i]);let[u,f]=(0,A.useState)(0),m=(0,A.useMemo)(()=>r||i===null||i>=e.log.length||!l?void 0:l.askArchived(e,i,n)??l.askDeclaration(n,i),[r,e,i,n,l,u]),p=m&&"waiting"in m?m.waiting:void 0,g=m&&"seq"in m?m:null,[v,T]=(0,A.useState)(void 0);(0,A.useEffect)(()=>{if(!p)return;let x=!0,C=setTimeout(()=>x&&T(p),di);return p.then(()=>x&&f(V=>V+1)),()=>{x=!1,clearTimeout(C)}},[p]);let y=p!==void 0&&v!==p||g!==null,b=(0,A.useMemo)(()=>{if(r||i===null||i>=e.log.length||!l||y)return null;try{let x=l.pastAt(e,i,n);return{seq:i,at:x.past?.at,store:x}}catch{return null}},[r,e,i,n,l,y,u]),h=(0,A.useRef)(null),E=y?h.current:b;(0,A.useEffect)(()=>{h.current=E},[E]);let P=(0,A.useCallback)(x=>a(x===null?null:x>=e.log.length?Number.POSITIVE_INFINITY:x),[e]),j=(0,A.useCallback)((x,C)=>[e,E?.store].some(V=>V!==void 0&&(V===x||V.seenBy(C)===x)),[e,E]),N=i!==null,H=(0,A.useMemo)(()=>({past:E,open:N,show:P,live:e,host:n,owns:j,archive:g}),[E,N,P,e,n,j,g]);return r?o:H}var ko=e=>`graview:setting:${e}`;function Ro(){return localStorage}function To(e,t){try{let n=(t??Ro()).getItem(ko(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function Mo(e,t,n){try{(n??Ro()).setItem(ko(e.name),t)}catch{}}function Oo(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=_(W(),1);function Lt(e){return Fe(e)}var fi=12,pi=4;function yi(e,t,n){let o=Lt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var tt=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-fi);function Vo(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=pi)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?bt([...o][0]):n[0]}function Ht(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,l]of e)l.mode!=="asking"&&l.mode!=="docked"&&t.at-l.since>=t.holdMs&&o.set(a,{...l,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=yi(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=Vo(t.ids,n);return i({at:a,mode:"reading",trail:tt(r.trail,a)}),o}case"about-to-write":case"write":{let a=Vo(t.ids,n);return i({at:a,mode:"writing",trail:tt(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:tt(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:tt(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 Co="graview:session";function Io(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(Co);if(o)return o;let r=t();return n.setItem(Co,r),r}catch{return t()}}var Dt={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"},Nt={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"},_o=[Dt,Nt],gi=800;function Lo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:l,settingValues:s,setView:u,ttlMs:f=1e4,people:m,seats:p}=e,[g,v]=(0,L.useState)(()=>new Map),[T,y]=(0,L.useState)(null),[b,h]=(0,L.useState)(null),[E,P]=(0,L.useState)(null),j=typeof r.id=="string"&&r.id.length>0,N=j&&(s[Dt.name]??Dt.initial)==="shared",H=N&&(s[Nt.name]??Nt.initial)==="shared",x=Lt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),C=j?Gn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...m?{people:m}:{}}):"",V=l?a.get(`agent:${l}:${i}`):void 0,F=(0,L.useMemo)(()=>!t||!N?null:{participant:x,kind:r.kind,name:C,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:Fn(r.id??"nobody"),stop:E??te(o),...H?{over:T}:{},...V?{robot:{at:V.at,mode:V.mode}}:{},at:new Date().toISOString()},[t,N,H,x,C,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,T,V?.at,V?.mode]);(0,L.useEffect)(()=>{if(!t||!F)return;t.here(F);let I=setInterval(()=>t.here({...F,at:new Date().toISOString()}),gi);return()=>clearInterval(I)},[t,F]),(0,L.useEffect)(()=>t?t.onWho(K=>v(wt(new Map,K,Date.now(),f))):void 0,[t,f]);let Z=g.size>0;(0,L.useEffect)(()=>{if(!Z)return;let I=setInterval(()=>{v(K=>{let Q=wt(K,[],Date.now(),f);return Q.size===K.size?K:Q})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(I)},[Z,f]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let I=()=>t.leave();return window.addEventListener("pagehide",I),()=>window.removeEventListener("pagehide",I)},[t]),(0,L.useEffect)(()=>{if(!H||typeof document>"u")return;let I=null,K=Q=>{let Ee=vo(Q.target);Ee!==I&&(I=Ee,y(Ee))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[H]);let X=(0,L.useRef)(null),z=b?g.get(b)??null:null,de=(0,L.useCallback)(I=>{X.current=null,h(I)},[]);return(0,L.useEffect)(()=>{if(b){if(!z){h(null);return}z.stop!==X.current?.stop&&(X.current={stop:z.stop,at:Date.now()},u(ze(z.stop)))}},[b,z,u]),(0,L.useEffect)(()=>{let I=X.current;!b||I===null||Date.now()-I.at<400||Zn(o,ze(I.stop))||h(null)},[o,b]),(0,L.useEffect)(()=>{if(!b||typeof document>"u")return;let I=K=>{K.key==="Escape"&&h(null)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[b]),(0,L.useMemo)(()=>({who:g,sharing:F?{participant:x,name:C}:null,following:z,follow:de,sayWhere:P}),[g,F,x,C,z,de])}var U=_(W(),1);function Ho(e){return Fe(e.author)}function hi(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Do(e,t,n,o,r){let i=new Map;for(let[s,u]of e)o-u.at<r&&i.set(s,u);let a=new Set(n.flatMap(s=>s.nodeIds)),l=(s,u,f)=>{let m=i.get(s),p=m?.participants.includes(Ho(u))?m.participants:[...m?.participants??[],Ho(u)];i.set(s,{at:o,manner:hi(p,u.author.kind),intent:u.intent,wrote:(m?.wrote??!1)||(f.wrote??!1),read:(m?.read??!1)||(f.read??!1),broke:(m?.broke??!1)||a.has(s),participants:p})};for(let s of t){for(let u of s.writes)l(u,s,{wrote:!0});for(let u of s.reads)s.writes.includes(u)||l(u,s,{read:!0})}for(let s of n)for(let u of s.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??s.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var Si=2600;function No(e,t=Si){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)(s=>{r.current=s,o(s),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,m)=>{let p=e.violations(),g=zn(e.allInvariants(),s,p).introduces;s=p,a(Do(r.current,m,g.map(v=>({nodeIds:v.nodeIds,message:v.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let l=(0,U.useCallback)(s=>{s.reads.length!==0&&a(Do(r.current,[wi(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:l}}function wi(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=_(W(),1);function Wo(){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 nt=_(W(),1),vi=e=>e.definitions.some(t=>Wn(t).size>0);function jo(e,t,n){let[o,r]=(0,nt.useState)(void 0),i=(n.roles??[]).join("\0");return(0,nt.useEffect)(()=>{if(!t||!vi(e.schema)){r(void 0);return}let a=!0,l=!1,s=e.graph,u=()=>{l||(l=!0,queueMicrotask(()=>{l=!1,a&&e.reread()}))},f=jn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return St(s,f.read),r(f),e.reread(),()=>{a=!1,St(s,void 0)}},[e,t,n.kind,n.id,i]),o}function Go(){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 le=_(Ie(),1),bi="graview:place-menu",_e=(0,d.createContext)(null),qo=(0,d.createContext)("scene");function xi({mode:e,children:t}){return(0,le.jsx)(qo.Provider,{value:e,children:t})}function Ei(){return(0,d.useContext)(qo)}var zo={kind:"human"},Pi=[],Ai=[],ki=[],Wt=[];function $o(e,t){let n=(0,d.useId)();(0,d.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??zo,r=()=>qn(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 Ri={off:!0};function Ti({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=Pi,onSeat:l,people:s=Ai,memory:u,presenceTtlMs:f,app:m,settings:p=m?.settings??ki,presence:g,brand:v,locale:T,timeZone:y,onKeepLens:b,providers:h,ai:E,files:P,resolveApp:j,history:N,linkedRecords:H,menuSections:x,keptViews:C,subscriptions:V,signIn:F,view:Z,onViewChange:X,children:z}){let de=(0,d.useContext)(_e),I=x??de?.menuSections,K=F??de?.signIn,Q=C??de?.keptViews,[Ee,wr]=(0,d.useState)(null),ue=Ee??i??a[0]?.principal??zo,He=_t(e,ue,N),nn=He.past&&He.live===e?He.past.store:e,D=(0,d.useMemo)(()=>nn.seenBy(ue),[nn,ue]);$o(e,ue);let[re]=(0,d.useState)(()=>Io(u)),[on,vr]=(0,d.useState)(!1),rn=(0,d.useCallback)(()=>vr(!0),[]),ie=(0,d.useMemo)(()=>g?[...p,..._o]:p,[p,g]),[pt]=(0,d.useState)(()=>n??Kt(t,e.schema)),[br,an]=(0,d.useState)(()=>$e(pt??fe,r??pt?.selection??[])),Pe=(0,d.useRef)(pt??fe).current,[sn,xr]=(0,d.useState)(null),[ln,Er]=(0,d.useState)(null),J=(0,d.useContext)(_e),[dn]=(0,d.useState)(()=>J?.seatTalk??Ct(v?.name??e.schema.kinds.join(","))),yt=E??J?.ai??Pt,De=(0,d.useMemo)(()=>yt.off?Ri:yt,[yt]),un=(0,d.useRef)(De.interactions);un.current=De.interactions;let[cn]=(0,d.useState)(()=>J?.aiDesk??It(()=>un.current)),[Pr]=(0,d.useState)(()=>J?.subscriptions??Bn()),fn=V??J?.subscriptions??Pr,mt=b??J?.onKeepLens,Ne=m??J?.app,We=T??J?.locale,Ar=v?.locale??Ne?.brand?.locale,je=y??J?.timeZone;Nn({reader:We,app:Ar,readerTimeZone:je,appTimeZone:v?.timeZone??Ne?.brand?.timeZone});let pn=(0,d.useRef)(null),yn=(0,d.useCallback)(c=>{pn.current=c},[]),mn=(0,d.useCallback)(c=>pn.current?.whereIs(c)??null,[]),[gn]=(0,d.useState)(()=>Wo()),[hn]=(0,d.useState)(()=>Go()),[gt,kr]=(0,d.useState)(null),[Ae,Sn]=(0,d.useState)(()=>new Map),ke=(0,d.useRef)(Ae);ke.current=Ae;let Re=(0,d.useRef)(null),ht=(0,d.useCallback)(c=>D.graph.getNode(c)?.kind,[D]),ee=(0,d.useCallback)(c=>{let S=Ht(ke.current,c,ht);ke.current=S,Sn(S),Re.current&&clearTimeout(Re.current),[...S.values()].some(M=>M.mode!=="docked"&&M.mode!=="asking")&&(Re.current=setTimeout(()=>{let M=Ht(ke.current,{type:"rest",at:Date.now(),holdMs:Ft},ht);ke.current=M,Sn(M)},Ft+20))},[ht]),wn=(0,d.useCallback)(c=>ee({...c,at:c.at??Date.now()}),[ee]),vn=(0,d.useCallback)(c=>{kr(c),c&&ee({type:"home",author:{kind:"agent",id:c,session:re},at:Date.now()})},[ee,re]);(0,d.useEffect)(()=>D.subscribe((c,S)=>{for(let k of S)k.author.kind==="agent"&&ee({type:"write",author:k.author,ids:k.writes,at:Date.now()})}),[D,ee]),(0,d.useEffect)(()=>()=>{Re.current&&clearTimeout(Re.current)},[]);let $=(0,d.useMemo)(()=>({...ue,session:re}),[ue,re]),bn=jo(D,H,$),xn=(0,d.useCallback)(c=>{wr(c),l?.(c)},[l]),[Te,Rr]=(0,d.useState)(()=>Object.fromEntries(ie.map(c=>[c.name,To(c,u)])));(0,d.useEffect)(()=>{for(let c of ie)Oo(c,Te[c.name]??c.initial)},[ie,Te]);let En=(0,d.useCallback)((c,S)=>{let k=ie.find(M=>M.name===c);!k||!k.options.some(M=>M.value===S)||(Mo(k,S,u),Rr(M=>({...M,[c]:S})))},[ie,u]),[Pn,Tr]=(0,d.useState)(null),{activity:An,noteAttention:kn}=No(D),Rn=(0,d.useCallback)(c=>{kn(c),ee({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[kn,ee]),ce=(0,d.useCallback)(c=>{if(ye(c)!==null||se(c).length>0||xt(c))return!0;let S=Xn(c);return S?D.graph.allEdges().some(k=>k.kind===S.kind&&k.from===S.from&&k.to===S.to):D.graph.getNode(c)!==void 0},[D]),Tn=(0,d.useCallback)(c=>{let S=c.selection??Wt,k=S.filter(ce),M=k.length===S.length?c:$e(c,k);return M.focusId!==null&&!ce(M.focusId)&&(M=q(M,null)),M},[ce]),Me=(0,d.useCallback)(c=>{let S=Tn(c),k=Bo(D,$,S.shown);if(S.focusId!==null&&k.size>0){let M=se(S.focusId),Dn=D.graph.getNode(S.focusId);(M.length>0?M.every(Vr=>k.has(Vr)):Dn?k.has(Dn.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let M=Pe.focusId!==null&&!ce(Pe.focusId)?Kt(t,e.schema)??{...fe,overview:!0}:Pe;M.focusId!==null&&ce(M.focusId)?S={...S,focusId:M.focusId}:M.overview===!0&&(S={...S,overview:!0})}return S},[Tn,ce,D,Pe,$,t,e.schema]),B=Me(Z??br),Mn=(0,d.useMemo)(()=>Bo(D,$,B.shown),[D,$,B.shown]),On=(0,d.useMemo)(()=>[...D.modules.administered.entries()].map(([c,S])=>{let k=D.mayAdminister(c,$);return{name:c,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:k,shown:k&&(B.shown??[]).includes(c)}}),[D,$,B.shown]),Oe=(0,d.useCallback)(c=>{let S=k=>Me(typeof c=="function"?c(k):c);if(Z!==void 0){X?.(S(Z));return}X&&X(S(B)),an(k=>S(k))},[B,X,Z,Me]);(0,d.useEffect)(()=>{Z===void 0&&an(c=>{let S=Me(c);return S===c?c:S})},[B,Z,Me]);let Vn=B.selection??Wt,Cn=(0,d.useCallback)(c=>{Oe(S=>$e(S,typeof c=="function"?c(S.selection??Wt):c))},[Oe]),{who:In,following:_n,follow:Ln,sayWhere:Mr,sharing:Hn}=Lo({channel:g,store:D,view:B,principal:$,session:re,robots:Ae,seatWho:gt,settingValues:Te,setView:Oe,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),Or=(0,d.useMemo)(()=>({store:D,scheme:o,views:t,view:B,setView:Oe,homeView:Pe,selection:Vn,setSelection:Cn,menuAt:sn,setMenuAt:xr,whereIs:mn,pointer:gn,motion:hn,registerScene:yn,robots:Ae,noteSeat:wn,seatWho:gt,registerSeatWho:vn,actsDoor:ln,registerActsDoor:Er,seatTalk:dn,aiDesk:cn,...u?{memory:u}:{},who:In,following:_n,follow:Ln,sayWhere:Mr,sharing:Hn,session:re,ai:De,resolveApp:j,linkedRecords:H,menuSections:I,...Q?{keptViews:Q}:{},subscriptions:fn,signIn:K,linkedReads:bn,movedByHand:on,noteMoved:rn,emphasis:Pn,setEmphasis:Tr,activity:An,noteAttention:Rn,principal:$,seats:a,people:s,takeSeat:xn,settings:ie,settingValues:Te,chooseSetting:En,hiddenKinds:Mn,administered:On,...h?{providers:h}:{},...v?{brand:v}:{},...mt?{onKeepLens:mt}:{},app:Ne,...We?{locale:We}:{},...je?{timeZone:je}:{}}),[D,o,t,B,Oe,Vn,Cn,sn,mn,gn,hn,yn,Ae,wn,gt,vn,ln,dn,cn,u,In,_n,Ln,Hn,re,De,j,H,I,Q,fn,K,bn,on,rn,Pn,An,Rn,$,a,s,xn,ie,Te,En,Mn,On,h,v,mt,Ne,We,je]);return(0,le.jsx)(_e.Provider,{value:Or,children:(0,le.jsx)(Ce.Provider,{value:He,children:(0,le.jsx)(Ii,{children:P?(0,le.jsx)(Qe.Provider,{value:P,children:z}):z})})})}var Uo=(0,d.createContext)(null),jt,Gt=new Set,Mi=e=>(Gt.add(e),()=>void Gt.delete(e)),Fo=()=>jt;function Oi(e){if(!jt){jt=e;for(let t of[...Gt])t()}}var Vi=300;function Ci(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,Vi)),r===t?e(n,o):[]}}function Ii({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:l}=oe(),s=ot(),u=n.q,f=n.focusId,m=!!(u&&u.trim().length>0),p=(0,d.useSyncExternalStore)(Mi,Fo,Fo),g=(0,d.useMemo)(()=>m&&p?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,m,p]),v=f?t.graph.getNode(f)?.kind??ye(f)??(se(f).length===1?se(f)[0]:void 0):void 0,T=(0,d.useMemo)(()=>l.near&&Ci(l.near),[l.near]),y=(0,d.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...v?{inKind:v}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:T}),[t,u,r,o,i,a,f,v,g,T]),[b,h]=(0,d.useState)();return(0,d.useEffect)(()=>void y?.later?.then(E=>h([y,E])),[y]),(0,le.jsx)(Uo.Provider,{value:b?.[0]===y?b[1]:y,children:e})}var Ko=new WeakMap;function xs(e){let t=Ko.get(e);return t||Ko.set(e,t=new Set(e.matched)),t}function _i(){return(0,d.useContext)(Uo)}function oe(){let e=(0,d.useContext)(_e);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Bt(){return(0,d.useContext)(_e)??null}function ot(){let{store:e}=oe(),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 Li(e){let{store:t}=oe(),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 Bo(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 Ft=2600;var Yo=new WeakSet,Hi=e=>Yo.has(e),Di=e=>void Yo.add(e);function Kt(e,t){let n=Un(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...fe,focusId:ne(n.place.kind),within:{view:n.place.as}}:{...fe,focusId:ne(n.kind)}}var Zo=_(W(),1),Ni=(0,Zo.createContext)(!1);var rt=Symbol.for("graview.default-view");function Xo(e){return Object.defineProperty(e,rt,{value:!0,enumerable:!1}),e}function Jo(e){return typeof e=="function"&&e[rt]===!0}var it=Symbol.for("graview.replaces-page");function Qo(e){return Object.defineProperty(e,it,{value:!0,enumerable:!1}),e}function er(e){return typeof e=="function"&&e[it]===!0}var at=Symbol.for("graview.bleeds");function tr(e){return Object.defineProperty(e,at,{value:!0,enumerable:!1}),e}function nr(e){return typeof e=="function"&&e[at]===!0}var st=Symbol.for("graview.previews");function or(e,t={}){return Object.defineProperty(e,st,{value:t,enumerable:!1}),e}function rr(e){return typeof e=="function"?e[st]:void 0}function Wi(e){return $n(e)}function ji(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 R=_(W(),1),Y=_(Ie(),1),qt=new Set,lt=0;function zt(e){return()=>{lt+=1;let t=e();return t.then(()=>void(lt-=1),()=>void(lt-=1)),t}}var Gi=()=>lt,ut=(0,R.createContext)(null);function Fi(){return{waiting:new Map,at:0}}function Ki(e){for(let[t,n]of e.waiting)n<e.at&&e.waiting.delete(t);e.at+=1}var Bi=e=>e?.waiting.size??0;function sr(e,t){e?.waiting.set(t,e.at)}function lr(e){let t=(0,R.useContext)(ut);(0,R.useLayoutEffect)(()=>{t?.waiting.delete(e)},[t,e])}function qi(e){let t={},n=!1,o=new Set,r=(0,R.lazy)(zt(()=>e().then(a=>{n=!0;let l=a.default;function s(u){return lr(t),(0,R.createElement)(l,u)}return{default:s}},a=>{for(let l of o)l.waiting.delete(t);throw a})));function i(a){let l=(0,R.useContext)(ut);return!n&&l&&(o.add(l),sr(l,t)),(0,R.createElement)(r,a)}return i}var dr=!1,ur=!1,dt=new Set;function zi(){dr=!0}function $i(){ur=!0;for(let e of[...dt])e();dt.clear()}var cr=()=>ur||!dr;function Ui(e){return cr()?(e(),()=>{}):(dt.add(e),()=>void dt.delete(e))}var ir=!1;function $t(){for(let e of[...qt])e()}function Yi(){ir||typeof window>"u"||(ir=!0,window.addEventListener("online",$t))}function Ut(e){let t,n=!1,o=!1,r,i=0,a=new Set,l=()=>{i+=1;for(let p of[...a])p()},s=p=>(a.add(p),()=>void a.delete(p)),u=()=>i,f=()=>void m().catch(()=>{});function m(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,qt.delete(f),l(),g),g=>{throw r=void 0,o=!0,qt.add(f),Yi(),l(),g});return p.catch(()=>{}),r=p,p}return{load:m,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let v=g.what??"This part",T={};function y(E){(0,R.useSyncExternalStore)(s,u,u),lr(T);let P=(0,R.useRef)(null),j=(0,R.useRef)(null),N=(0,R.useRef)(!1);return(0,R.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&P.current!==null&&document.activeElement===P.current&&(N.current=!0),(0,R.useLayoutEffect)(()=>{if(!(!n||!N.current)){N.current=!1;for(let H=j.current?.nextElementSibling??null;H!==null;H=H.nextElementSibling){let x=H.matches(ar)?H:H.querySelector(ar);if(x instanceof HTMLElement){x.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[N.current?(0,Y.jsx)("span",{ref:j,hidden:!0}):null,p(t,E)]}):g.quiet?null:(0,Y.jsx)(Zi,{what:v,button:P,...g.as?{as:g.as}:{}})}let b=(0,R.lazy)(zt(()=>m().then(()=>({default:y}),()=>({default:y}))));function h(E){let P=(0,R.useContext)(ut),[j]=(0,R.useState)(()=>n||o);return!n&&!o&&sr(P,T),(0,R.createElement)(j?y:b,E)}return h}}}var ar="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Zi({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:$t,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=_(W(),1);function Xi(){let{selection:e,setSelection:t}=oe();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 Ji(){let{store:e}=oe(),t=ot();return(0,Se.useMemo)(()=>Qi(e),[e,t])}var fr=new WeakMap;function Qi(e){let t=fr.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),fr.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function ea(){let{view:e,setView:t}=oe();return(0,Se.useMemo)(()=>({view:e,url:te(e),focus:n=>t(o=>q(o,n)),show:n=>t(o=>Jn(o,n)),toggle:n=>t(o=>Ue(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=_(W(),1),Zt={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"]}},ta={position:"fixed",inset:"auto",margin:0,zIndex:Kn("popover"),boxSizing:"border-box"},ct=6,we=8,na=e=>typeof e.showPopover=="function";function ft(e){try{return e.matches(":popover-open")}catch{return!1}}function oa(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 Xt(e,t,n={}){let o=oa(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(),l=r.height-o.bottom-ct-we,s=o.top-ct-we,u=a.height<=l||l>=s,f=Math.max(96,Math.floor(u?l:s)),m=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,v=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();v&&p<=v.right-v.left&&(g<v.left?g=o.left+p<=v.right?o.left:v.left:g+p>v.right&&(g=o.right-p>=v.left?o.right-p:v.right-p));let T=p>=r.width-2*we?Math.max(0,(r.width-p)/2):Math.max(we,Math.min(g,r.width-we-p)),y=u?o.bottom+ct:Math.max(we,o.top-ct-m);e.style.left=`${Math.round(T)}px`,e.style.top=`${Math.round(y)}px`}function pr(e,t,n,o={}){let r=o.align??"end";(0,G.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(na(i)&&!ft(i))try{i.showPopover(),ia()}catch{}let a=0,l=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>Xt(i,n,{align:r})))};Xt(i,n,{align:r}),addEventListener("resize",l),addEventListener("scroll",l,!0);let s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>l());return s?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",l),removeEventListener("scroll",l,!0),s?.disconnect(),i.isConnected&&ft(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Jt=new Set;function ra(e){return Jt.add(e),()=>Jt.delete(e)}function ia(){for(let e of Jt)if(!(!e.isConnected||!ft(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ve=null,aa='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function sa(e){for(let t of e.querySelectorAll(aa))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Yt=()=>{let e=document.activeElement;return e===null||e===document.body};function la(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,l]=(0,G.useState)(!1),s=t.open??a,u=(0,G.useRef)(null),f=(0,G.useRef)(null),m=(0,G.useCallback)(h=>{u.current=h},[]),p=(0,G.useCallback)(h=>{f.current=h},[]),g=`graview-popover-${(0,G.useId)().replace(/:/g,"")}`,v=(0,G.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});v.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let T=(0,G.useCallback)(h=>{v.current.controlled||l(h),v.current.onOpenChange?.(h)},[]),y=(0,G.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??v.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),b=(0,G.useCallback)(h=>{let E=f.current,P=typeof document>"u"?null:document.activeElement,j=P===null||P===document.body||E!==null&&E.contains(P);T(!1),!(!h||!j)&&(y(),requestAnimationFrame(()=>{Yt()&&y()}))},[T,y]);return pr(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,G.useEffect)(()=>{if(!i||!s)return;let h={name:e,close:()=>b(!1)};if(ve&&ve.close!==h.close&&ve.close(),ve=h,Zt[e].focus==="into"){let x=f.current;x&&!x.contains(document.activeElement)&&sa(x).focus({preventScroll:!0})}let E=x=>{x.key==="Escape"&&b(!0)},P=x=>{let C=x.target;if(!(C instanceof Node))return;let V=f.current;if(V?.contains(C)||u.current?.contains(C))return;let F=C instanceof Element?C.closest('[role="dialog"], [role="alertdialog"]'):null;F&&!(V&&F.contains(V))||(b(!1),Zt[e].focus==="into"&&requestAnimationFrame(()=>{(Yt()||V!==null&&V.contains(document.activeElement))&&y()}))},j=null,N=null,H=x=>{let C=x.target;if(!(C instanceof Element))return;let V=f.current,F=C.closest('[role="dialog"], [role="alertdialog"]');!F||V&&(V.contains(F)||F.contains(V))||(j=F,b(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",P,!0),document.addEventListener("focusin",H),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",P,!0),document.removeEventListener("focusin",H);let x=j;x&&typeof MutationObserver<"u"&&(N?.disconnect(),N=new MutationObserver(()=>{x.isConnected||(N?.disconnect(),requestAnimationFrame(()=>{(Yt()||document.activeElement.closest("[hidden]")!==null)&&y()}))}),N.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>N?.disconnect(),10*6e4)),ve?.close===h.close&&(ve=null)}},[i,s,e,b,y]),{open:s,setOpen:h=>h?T(!0):b(!0),toggle:()=>s?b(!0):T(!0),trigger:{ref:m,"aria-expanded":s,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var be=_(W(),1);var yr=(0,be.createContext)(null);function da(){let e=(0,be.useContext)(yr),t=Bt(),n=(o,r,i)=>t?.setView(a=>ae(ae(pe(q(a,ne(o)),!1),"view",r),"filter",i?.filter??null));return(0,be.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>q(pe(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=_(W(),1);var ua=Ut(Ke(()=>(__graviewPreload(import.meta.url,["./chunk.TM6JVVGW.js","./chunk.SDO3U72B.js","./chunk.PFEKS3KO.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.MUHFZXPS.js"))));function ca(e,t,n){let o,r=!1,i=()=>{let{hidden:l,removed:s}=t.current();o||r||l.length+s.length===0||(o=()=>{},ua.load().then(u=>{r||(o=u.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function fa(e,t){let[n,o]=(0,xe.useState)();return(0,xe.useEffect)(()=>t?ca(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var mr=_(W(),1),pa=(0,mr.createContext)(!1);var Qt=_(W(),1),ya=(0,Qt.createContext)(null),ma=(0,Qt.createContext)(null);var gr=_(W(),1),ga=(0,gr.createContext)(null);var hr=_(W(),1),en='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',tn=e=>e instanceof HTMLElement&&(e.matches(en)||e.hasAttribute("tabindex")),Le=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function ha(e,t){let n=s=>s.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 l=e.querySelector(a);return l&&tn(l)&&Le(l)?l:null}var Sa=e=>e.isConnected&&tn(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Le(e);function Sr(e,t){let n=t?ha(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Le(o))return o;for(let r of e.querySelectorAll(en))if(Le(r))return r;return tn(e)&&Le(e)?e:null}function wa(e){(0,hr.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=y=>{let b=y.target;if(b instanceof Element){n=[];for(let h=b;h&&h!==t.parentElement;h=h.parentElement)n.push(h)}},r=!1,i=!1,a=t.ownerDocument,l=()=>!i&&a.defaultView!==null,s=(y,b)=>void setTimeout(()=>l()&&b(),y),u=y=>void requestAnimationFrame(()=>l()&&y()),f=y=>{if(r=!1,i)return;let b=a.activeElement;if(!(!(b===null||b===a.body||b===a.documentElement)||n.length===0)){if(Sa(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 P=Sr(E,n[0]);if(P){P.focus({preventScroll:!0}),n=[];return}}}},m=(y,b=Date.now()+2500)=>{s(100,()=>{f(y);let h=a.activeElement;(h===null||h===a.body||h===a.documentElement)&&n.length>0&&Date.now()<b&&m(y,b)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),m(!1)})))},g=y=>{if(!(y instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(y.key))){if(!(y instanceof KeyboardEvent)){let b=y.target instanceof Element?y.target.closest(en):null,h=a.activeElement,E=h===null||h===a.body||h===a.documentElement;if(b&&E&&t.contains(b)){n=[];for(let P=b;P&&P!==t.parentElement;P=P.parentElement)n.push(P);s(150,()=>u(()=>{f(!1),m(!1)}));return}}!(y instanceof KeyboardEvent)&&!(y.target instanceof Node&&n[0]?.contains(y.target))||s(150,()=>u(()=>{f(!0),m(!0)}))}},v=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),T=y=>{y.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",T),t.addEventListener("click",g),t.addEventListener("keydown",g),v.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",T),t.removeEventListener("click",g),t.removeEventListener("keydown",g),v.disconnect()}},[e])}export{fe as a,te as b,ze as c,ba as d,xa as e,Zn as f,Yn as g,Xn as h,vt as i,q as j,Jn as k,ae as l,pe as m,$e as n,Ve as o,Ue as p,Ze as q,bt as r,ye as s,Aa as t,Ir as u,ne as v,Qn as w,se as x,eo as y,_r as z,ka as A,to as B,xt as C,Lr as D,Hr as E,Dr as F,W as G,Ct as H,oi as I,ii as J,vo as K,Qe as L,ai as M,Ce as N,xo as O,si as P,_t as Q,Ie as R,bi as S,xi as T,Ei as U,$o as V,Ti as W,Oi as X,xs as Y,_i as Z,oe as _,Bt as $,ot as aa,Li as ba,Hi as ca,Di as da,Kt as ea,yr as fa,da as ga,Ni as ha,Xo as ia,Jo as ja,Qo as ka,er as la,tr as ma,nr as na,or as oa,rr as pa,Wi as qa,ji as ra,zt as sa,Gi as ta,ut as ua,Fi as va,Ki as wa,Bi as xa,qi as ya,zi as za,$i as Aa,cr as Ba,Ui as Ca,Ut as Da,fa as Ea,pa as Fa,ya as Ga,ma as Ha,ga as Ia,Xi as Ja,Ji as Ka,ea as La,he as Ma,wa as Na,ta as Oa,ft as Pa,pr as Qa,ra as Ra,la as Sa};
|
|
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 +0,0 @@
|
|
|
1
|
-
function g(e){return[`based on \u201C${e.basis}\u201D`,...e.confidence!==void 0?[`${Math.round(e.confidence*100)}% sure`]:[],...e.model?[e.model]:[]].join(" \xB7 ")}var k=e=>`Not yet kept by a person. ${e.by.name??e.by.id??"Something"} made it${e.lineage?`, ${g(e.lineage)}`:""}.`,p=e=>`${e.kind}\0${e.from}\0${e.to}`;function y(e,o){let r=new Map;for(let n of e){if(n.undoes!==void 0||o.has(n.id)||n.withheld)continue;let s=n.author.kind==="human",l=new Map;for(let t of n.primitives){if(t.op!=="add-edge"&&t.op!=="remove-edge")continue;let i=p(t.edge),a=r.get(i)??l.get(i);if(r.delete(i),t.op==="remove-edge")a&&l.set(i,a);else if(a&&(s||!n.lineage))r.set(i,s?{...a,provisional:!1,keptBy:n.id}:a);else{let d=n.lineage;r.set(i,{edge:t.edge,made:n.id,by:n.author,...d?{lineage:d}:{},provisional:!s&&(d?.confidence??1)<1})}}}return r}var c=new WeakMap;function f({log:e}){let o=e.all(),r=`${e.horizon}:${o.length}:${o.at(-1)?.id}`,n=c.get(e);return n?.at!==r&&c.set(e,n={at:r,links:y(o,e.undoneIds())}),n.links}var v=(e,o)=>f(e).get(p(o));var u=e=>[...f(e).values()].filter(o=>o.provisional);export{g as a,k as b,v as c,u as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f}from"./chunk.JBG5UQLM.js";import"./chunk.54PZWX23.js";import"./chunk.3EW6L5DY.js";import"./chunk.LD6S2FL5.js";import"./chunk.TABIRLQS.js";import{wb as a}from"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.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 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk.TI4OSTQV.js";import{I as D,T as x,W as M,_b as j,bc as P,cb as I,db as l,fc as k,ic as w}from"./chunk.PFEKS3KO.js";var O=(e,i)=>e.expiresAt!==void 0&&Date.parse(e.expiresAt)<=Date.parse(i),L=(e,i,t)=>(e??[]).some(n=>n.suggestion===i&&(n.until===void 0||Date.parse(n.until)>Date.parse(t)));function B(e,i=()=>!0,t={}){let n=j(e),s=new Set(e.map(r=>r.lineage?.suggestion)),o=t.now??new Date().toISOString();return e.filter(r=>r.suggests&&!r.withheld&&!n.has(r.id)&&!s.has(r.id)&&!O(r,o)&&!L(t.dismissed,r.id,o)).map(({id:r,batch:d,suggests:y,intent:h,author:f,lineage:g,at:m,expiresAt:p})=>{let a=new Set;return JSON.stringify(y.map(b=>b.args),(b,S)=>(typeof S=="string"&&i(S)&&a.add(S),S)),{id:r,batch:d,calls:y,intent:h,author:f,...g?{lineage:g}:{},at:m,expiresAt:p,about:[...a]}})}function R(e,i){return e.ops.length>0&&e.ops.every(t=>t.suggests!==void 0||t.undoes!==void 0&&i(t.undoes)?.suggests!==void 0)}var K=e=>JSON.stringify([e.kind,e.id??"",e.name??""]);function N(e,i=()=>{}){let t=[];for(let n of e){if(R(n,i))continue;let s=t.at(-1);if(!k(n.author)){t.push({batch:n});continue}if(s&&"digest"in s&&K(s.digest.author)===K(n.author)){let o=[...s.digest.batches,n];t[t.length-1]={digest:{author:s.digest.author,batches:o,things:v(o),at:n.at}}}else t.push({digest:{author:n.author,batches:[n],things:v([n]),at:n.at}})}return t}var v=e=>e.reduce((i,t)=>i+(t.undone?0:t.ops.length),0);function $(e,i=x(new Date().toISOString())??D()){let t=x(e.at)??e.at.slice(0,10),n=t===i?"today":`on ${M(t)}`;return`Tidied ${e.things===1?"one thing":`${e.things} things`} ${n}`}var c=e=>e,A=(e,i)=>i===void 0?{}:{[e]:i};function Q(e,i,t){let n=u(e)?.store??e,s=c(n),o=P(t.lineage);if(o===void 0)throw new l("A suggestion says what it is based on: { basis, confidence? }");let r=t.author??s.by;if(t.expiresAt!==void 0&&Number.isNaN(Date.parse(t.expiresAt)))throw new l(`A suggestion expires at a time: "${t.expiresAt}" is not one (an ISO time, like 2026-10-23T06:00:00Z).`);let d=s.actMeanings(),y=w(i,d),h=C(n).find(a=>w(a.calls,d)===y);if(h)return n.log.get(h.id);s.refuseDeclined(i,r);let f=s.rehearsal();f.suggesting=!0;let g=f.applying(i,{author:r,lineage:o,...A("via",t.via)});if(g.ops.length===0)return;let m=[...new Set(g.ops.flatMap(a=>a.described??[]))],p={id:s.nextId(),seq:n.log.length,batch:s.mintBatch("batch"),author:r,intent:g.ops.map(a=>a.intent).join("; "),...A("batchIntent",t.intent),mutation:null,primitives:[],reads:[],writes:[],...m.length>0?{described:m}:{},at:s.now(),...A("via",t.via),lineage:o,suggests:i,...A("expiresAt",t.expiresAt)};return n.log.append(p),n.notify(I,[p]),p}function C(e,i,t={}){let n=u(e),s=n?.store??e,o=i??n?.principal,r=(o!==void 0?s.seenBy(o):s).log.all();return B(r,d=>s.graph.has(d),{now:c(s).now(),dismissed:t.dismissed})}function T(e,i,t){let n=C(e,t).find(o=>o.id===i),s=n?void 0:e.log.get(i);if(s?.suggests&&O(s,c(e).now()))throw new l(`That suggestion expired on ${s.expiresAt.slice(0,10)}.`);if(!n)throw new l("That suggestion is no longer waiting: it was accepted or declined, or it is not one you can see.");return n}function U(e,i,t={}){let n=u(e)?.store??e,s=t.author??c(n).by,o=T(n,i,s);return n.applyAll(o.calls,{...t,author:s,lineage:{...o.lineage,suggestion:i}})}function X(e,i,t={}){let n=u(e)?.store??e,s=t.author??c(n).by,o=T(n,i,s);return n.undo(o.batch,{...t,author:s})}export{N as a,$ as b,Q as c,C as d,U as e,X as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.GZHZLJBF.js";import{n as P}from"./chunk.FOYVTN5B.js";import"./chunk.OJGHDWI6.js";import"./chunk.OTF3NNTI.js";import"./chunk.A7HMVWMG.js";import"./chunk.GRLPNTUW.js";import"./chunk.EJAVIZ7Y.js";import"./chunk.423SZS7C.js";import{$ as b,G as A,R as S}from"./chunk.TM6JVVGW.js";import"./chunk.SDO3U72B.js";import{Ba as w,Gc as x,oa as L}from"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import{b as R}from"./chunk.AJZBJBMO.js";var u=R(A(),1);var n=R(S(),1),C={kind:"human"},p={color:"var(--graview-ink-muted)"};function I(e){if(e){if(/^https?:\/\//i.test(e))try{return new URL(e).href}catch{return}return L(e)?e:void 0}}function z(e){let o=b(),t=o?.linkedReads,[i,a]=(0,u.useState)(()=>t?t.answered(e)??"asking":null);return(0,u.useEffect)(()=>{if(!t){a(o?.linkedRecords?"asking":null);return}let d=t.answered(e);if(a(d===void 0?"asking":d),d!==void 0)return;let s=!0;return t.ask(e).then(l=>s&&a(l)),()=>{s=!1}},[t,o?.linkedRecords,e.address,e.kind,e.id]),i}function V({reference:e,as:o}){let t=b(),i=z(e),a={position:"relative",zIndex:x.raised,overflowWrap:"anywhere",minWidth:0,maxWidth:"100%"};if(i==="asking")return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"asking","aria-busy":"true",style:{...p,...a},children:"Linked record"});if(i&&"denied"in i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"denied",style:{...p,fontStyle:"italic",...a},children:"linked record (no access)"});if(!i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"missing",style:{...p,fontStyle:"italic",...a},children:"linked record (not found)"});let d=I(i.href),s=t?.linkedRecords,l=t?.principal??C,g=s?.open?c=>{c.metaKey||c.ctrlKey||(c.preventDefault(),s.open(e,l))}:void 0,k=(0,n.jsx)("a",{"data-graview-linked-title":"",...d?{href:d}:{role:"link",tabIndex:0},...g?{onClick:g,onKeyDown:c=>!d&&(c.key==="Enter"||c.key===" ")?g(c):void 0}:{},style:{fontWeight:600,color:"inherit",textUnderlineOffset:3,cursor:d||g?"pointer":"default"},children:i.label});return o==="chip"?(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"found",title:i.describe,style:{display:"inline-flex",alignItems:"center",minHeight:24,...a},children:k}):(0,n.jsx)(D,{record:i,title:k,base:a})}function D({record:e,title:o,base:t}){return(0,n.jsxs)("span",{"data-graview-linked":"","data-graview-linked-state":"found",style:{display:"grid",gap:2,padding:"8px 10px",border:"1px solid var(--graview-line)",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-surface)",...t},children:[(0,n.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"2px 8px"},children:[o,e.app?(0,n.jsxs)("span",{"data-graview-linked-app":"",style:{...p,fontSize:"0.75rem"},children:["in ",e.app]}):null]}),e.describe?(0,n.jsx)("span",{"data-graview-linked-describe":"",style:{...p,fontSize:"0.8125rem"},children:e.describe}):null,e.card&&e.card.length>0?(0,n.jsx)("span",{"data-graview-linked-card":"",style:{display:"flex",flexWrap:"wrap",gap:"2px 12px",fontSize:"0.8125rem"},children:e.card.map(i=>(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{style:p,children:i.label})," ",i.text]},i.label))}):null]})}function H({relation:e,refs:o,as:t="record",nodeId:i,field:a,style:d}){let s=(0,n.jsx)("span",{"data-graview-linked-list":"",style:{display:"grid",gap:6,minWidth:0,...d},children:o.map(l=>(0,n.jsx)(V,{reference:l,as:t},w(l)))});return i&&a?(0,n.jsx)(K,{nodeId:i,field:a,relation:e,refs:o,drawn:s}):s}function K({nodeId:e,field:o,relation:t,refs:i,drawn:a}){let{fields:d,commit:s}=P(e),l=d.find(f=>f.field===o),[g,k]=(0,u.useState)(!1);if(!l)return a;let c=t.cardinality==="one"?i[0]?w(i[0]):void 0:i.map(w);return(0,n.jsxs)("span",{style:{display:"grid",gap:6,minWidth:0},children:[a,g?(0,n.jsx)(N,{relation:t,value:c,label:"Link another record",onChange:f=>{s(l,f),k(!1)},onCancel:()=>k(!1)}):(0,n.jsx)("button",{type:"button","data-graview-linked-change":"",onClick:()=>k(!0),style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-accent)",cursor:"pointer",minHeight:24},children:"Change"})]})}function N({relation:e,value:o,onChange:t,onCancel:i,label:a}){let d=b(),s=d?.linkedRecords,l=d?.principal??C,g=(0,u.useId)(),[k,c]=(0,u.useState)(""),[f,m]=(0,u.useState)("asking");(0,u.useEffect)(()=>{if(!s)return;let r=!0;m("asking");let y=setTimeout(()=>{Promise.resolve().then(()=>s.find({address:e.address,kinds:e.kinds,query:k,limit:20},l)).then(h=>r&&m(Array.isArray(h)?h:"denied"),()=>r&&m([]))},150);return()=>{r=!1,clearTimeout(y)}},[s,e.address,e.kinds.join(","),k,l.kind,l.id]);let v=new Set([o].flat().filter(r=>typeof r=="string")),W=r=>{let y=w(r);if(e.cardinality==="one")return t(y);t(v.has(y)?[...v].filter(h=>h!==y):[...v,y])};return s?(0,n.jsxs)("span",{"data-graview-linked-picker":"",style:{display:"grid",gap:6,minWidth:0},children:[(0,n.jsx)("label",{htmlFor:g,style:{...p,fontSize:"0.8125rem"},children:a}),(0,n.jsx)("input",{id:g,type:"search",value:k,placeholder:`Find one in ${e.address}`,onChange:r=>c(r.target.value),style:{font:"inherit",minHeight:32,padding:"4px 8px",border:"1px solid var(--graview-line)",borderRadius:6,background:"var(--graview-surface)",color:"inherit",minWidth:0}}),f==="asking"?(0,n.jsx)("span",{"aria-busy":"true",style:p,children:"Looking\u2026"}):f==="denied"?(0,n.jsx)("span",{"data-graview-linked-state":"denied",style:{...p,fontStyle:"italic"},children:"linked record (no access)"}):f.length===0?(0,n.jsx)("span",{style:p,children:"Nothing there matches."}):(0,n.jsx)("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:4},children:f.map(r=>{let y=v.has(w(r));return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-graview-linked-candidate":w(r),"aria-pressed":y,onClick:()=>W(r),style:{display:"grid",gap:2,width:"100%",textAlign:"start",font:"inherit",padding:"6px 8px",minHeight:32,border:"1px solid var(--graview-line)",borderRadius:6,background:y?"var(--graview-accent-soft, var(--graview-surface))":"var(--graview-surface)",color:"inherit",cursor:"pointer"},children:[(0,n.jsx)("span",{style:{fontWeight:600},children:r.label}),r.describe?(0,n.jsx)("span",{style:{...p,fontSize:"0.8125rem"},children:r.describe}):null]})},w(r))})}),i?(0,n.jsx)("button",{type:"button",onClick:i,style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-ink-muted)",cursor:"pointer",minHeight:24},children:"Keep it as it is"}):null]}):(0,n.jsxs)("span",{"data-graview-linked-picker":"","data-graview-linked-state":"no-host",style:p,children:["This page cannot read ",e.address,", so nothing there can be linked here."]})}var U=e=>(0,n.jsx)(H,{...e}),j=e=>(0,n.jsx)(N,{...e});export{N as LinkedPicker,H as LinkedRecordView,j as drawLinkedPicker,U as drawLinkedRecord};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.423SZS7C.js";import{$ as H,G as U,O as N,P as I,R as B}from"./chunk.TM6JVVGW.js";import"./chunk.SDO3U72B.js";import{Hc as $,R as W,Xa as z}from"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import{b as O}from"./chunk.AJZBJBMO.js";function x(n,t){return n.kind==="agent"?"agent":n.kind!=="human"?"app":n.onBehalfOf!==void 0?"person":n.id===void 0||t?.id===void 0||n.id===t.id?"you":"person"}var X=n=>n.ops.filter(t=>t.withheld!==!0);function L(n,t={}){let r=n.batches().map(e=>{let o=e.ops[0],l=e.ops.at(-1),c=X(e).length===0;return{seq:l.seq+1,from:o.seq,at:l.at,batch:e.id,maker:c?"person":x(e.author,t.me),author:c?void 0:e.author,said:e.intent,declaration:!1,withheld:c}}),s=[...n.log.epochs().filter(e=>e.change!==void 0).map(e=>({seq:e.seq,sentence:e.change,...e.at?{at:e.at}:{}})),...t.declarations??[]];for(let e of s){if(e.seq<n.log.horizon||e.seq>n.log.length)continue;let o=r.findIndex(l=>l.seq===e.seq);if(o>=0&&!r[o].withheld){r[o]={...r[o],declaration:!0,said:e.sentence};continue}r.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?x(e.author,t.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return r.sort((e,o)=>e.seq-o.seq||+(e.batch!==void 0)-+(o.batch!==void 0))}function V(n,t){let r=n.log.all(),s=new Map(r.map(e=>[e.id,e.seq]));return n.batches().filter(e=>!e.undone&&e.ops[0].seq>=t).filter(e=>!e.ops.every(o=>o.undoes!==void 0&&(s.get(o.undoes)??-1)>=t)).map(e=>e.id)}function _(n,t){return n.withheld?"Someone":n.maker==="you"?"you":n.author?z(n.author,t):"the app"}var d=O(U(),1);var i=O(B(),1),J={kind:"human"},Q=[1,2,4,8],Z=900,T={you:"You",person:"A person",agent:"An agent",app:"The app"},F={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function ee(n,t,r){let s=r?Array.from({length:t},(e,o)=>o):[];return[...new Set([...s,t,...n.map(e=>e.seq)])].sort((e,o)=>e-o)}function te(n,t){let r=n.withheld===!0;return{seq:n.seq+1,from:n.seq,at:n.at,batch:n.batch,maker:r?"person":x(n.author,t),author:r?void 0:n.author,said:n.batchIntent??n.intent,declaration:!1,withheld:r}}function ne(n,t){let r=0;for(let s=0;s<n.length;s++)n[s]<=t&&(r=s);return r}function ae(n,t,r){let s=V(n,t);if(s.length===0)return null;let e=n.canUndo(s);if(!e.ok)return null;let o=new Set(n.permittedMutations(r).map(l=>l.name));return e.ops.every(l=>l.mutation!==null&&o.has(l.mutation.name))?s:null}function ce({face:n}){let t=N(),r=H(),s=r?.principal??J,e=I(t.live,s),o=e.log.length,l=(0,d.useMemo)(()=>L(e,{me:s,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[e,s,t.host,o]),c=e.log.horizon,b=c>0&&t.host?.archived!==void 0,h=(0,d.useMemo)(()=>ee(l,c,b),[l,c,b]),f=t.archive,p=f?.seq??t.past?.seq??o,v=ne(h,p),m=h.length-1,D=p<c&&t.past?.seq===p?t.past.store.log.all().at(-1):void 0,w=D?te(D,s):p<c?void 0:[...l].reverse().find(a=>a.seq<=p&&a.seq>(h[v-1]??-1))??[...l].reverse().find(a=>a.seq<=p),[k,P]=(0,d.useState)(!1),[q,K]=(0,d.useState)(1),[R,M]=(0,d.useState)(null);(0,d.useEffect)(()=>{if(!k)return;if(v>=m){P(!1);return}let a=setTimeout(()=>t.show(h[v+1]),Z/q);return()=>clearTimeout(a)},[k,v,m,q,h,t]);let E=(0,d.useMemo)(()=>t.past&&!f&&p>=c?ae(e,p,s):null,[t.past,f,e,p,c,s,o]),j=a=>_(a,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),y=t.past?t.past.at?W(t.past.at,r?.locale):"the start":null,A=f?f.refused?"The archive could not be read":"Reading the older changes from the archive\u2026":w?`${j(w)==="you"?"You":j(w)}: ${w.said}`:"Nothing had happened yet",C=(0,d.useRef)(null);(0,d.useLayoutEffect)(()=>{let a=C.current,g=a?.parentElement;if(n!=="scene"||!a||!g)return;let u=()=>g.style.setProperty("--graview-sheet",`${Math.ceil(a.getBoundingClientRect().height)+24}px`);u();let S=typeof ResizeObserver>"u"?null:new ResizeObserver(u);return S?.observe(a),()=>{S?.disconnect(),g.style.removeProperty("--graview-sheet")}},[n]);let Y=n==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:$("rail")}:{position:"sticky",top:0,zIndex:$("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,i.jsxs)("section",{ref:C,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...Y,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,i.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,i.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:f?"Archived changes":y?`As of ${y}`:"Now"}),(0,i.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:A}),y?(0,i.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,i.jsxs)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:[b?(0,i.jsx)("span",{"data-testid":"timeline-archived",title:"Changes read from the archive as you scrub back",style:{position:"absolute",left:0,bottom:0,height:6,width:`${m===0?0:h.indexOf(c)/m*100}%`,borderRadius:2,background:"var(--graview-edge)"}}):null,h.slice(1).map((a,g)=>{let u=[...l].reverse().find(G=>G.seq===a);if(!u)return null;let S=m===0?0:(g+1)/m*100;return(0,i.jsx)("span",{"data-graview-tick":a,"data-maker":u.maker,...u.declaration?{"data-declaration":""}:{},title:`${T[u.maker]}: ${u.said}`,style:{position:"absolute",left:`calc(${S}% - 1px)`,bottom:0,width:u.declaration?4:2,height:u.declaration?22:12,borderRadius:2,background:u.declaration?"var(--graview-ink)":F[u.maker],opacity:a<=p?1:.45}},`${a}:${u.batch??"declaration"}`)})]}),(0,i.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:m,step:1,value:v,"aria-valuetext":y?`As of ${y}. ${A}`:`Now. ${A}`,onChange:a=>{P(!1),t.show(h[Number(a.currentTarget.value)]??o)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,i.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,i.jsx)("button",{type:"button","data-testid":"play","aria-pressed":k,onClick:()=>{!k&&v>=m&&t.show(h[0]),P(!k)},style:{minHeight:28,minWidth:64},children:k?"Pause":"Play"}),(0,i.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,i.jsx)("select",{"data-testid":"speed",value:q,onChange:a=>K(Number(a.currentTarget.value)),style:{minHeight:28},children:Q.map(a=>(0,i.jsxs)("option",{value:a,children:[a,"\xD7"]},a))})]}),(0,i.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(T).filter(a=>l.some(g=>g.maker===a)).map(a=>(0,i.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,i.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:F[a]}}),T[a]]},a))}),(0,i.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[E?(0,i.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{M(null);try{e.undo([...E],{author:s,intent:y?`Restore to ${y}`:"Restore"}),t.show(null)}catch(a){M(a instanceof Error?a.message:String(a))}},style:{minHeight:28},children:"Restore to here"}):null,(0,i.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>t.show(null),style:{minHeight:28},children:"Back to now"})]})]}),R?(0,i.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:R}):null,f?.refused?(0,i.jsx)("span",{role:"alert","data-testid":"archive-refused",style:{color:"var(--graview-warn)"},children:f.refused}):null,c>0&&!b?(0,i.jsx)("span",{"data-testid":"timeline-horizon",style:{color:"var(--graview-ink-faint)"},children:"The changes before the timeline's start were archived."}):null]})}export{ce as Timeline};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Z,b as qe}from"./chunk.4HUB3N7I.js";import"./chunk.NB6WN4DO.js";import"./chunk.SR2345SW.js";import{i as De,j as Ne,k as Oe}from"./chunk.WQN7EFW3.js";import"./chunk.7JW5SHRR.js";import"./chunk.HJCQ6I3S.js";import"./chunk.DFGXNFFE.js";import"./chunk.XN7PIWVC.js";import"./chunk.FIS27KW4.js";import"./chunk.EYSQPXVE.js";import"./chunk.W6CGAPNQ.js";import{a as We,b as S}from"./chunk.7C4IR4S7.js";import{a as X,b as $e}from"./chunk.D53IGR45.js";import"./chunk.AP22NNIM.js";import"./chunk.FNK2ZZ5E.js";import"./chunk.AGVFW6WC.js";import"./chunk.SIVMZNHZ.js";import"./chunk.NQ7SRWXA.js";import"./chunk.AOEXSQDG.js";import"./chunk.3NEALGMI.js";import{b as Pe,c as Le}from"./chunk.UT6642FC.js";import"./chunk.PBCT33FF.js";import"./chunk.XOZU4OFA.js";import"./chunk.35FUGOSG.js";import"./chunk.TI4OSTQV.js";import"./chunk.D4K23FUB.js";import"./chunk.NQDGUIUQ.js";import"./chunk.DTRNDSMS.js";import"./chunk.3EW6L5DY.js";import"./chunk.AVDXG57A.js";import"./chunk.LD6S2FL5.js";import"./chunk.TABIRLQS.js";import{u as Re}from"./chunk.FOYVTN5B.js";import"./chunk.OJGHDWI6.js";import"./chunk.OTF3NNTI.js";import"./chunk.A7HMVWMG.js";import{l as ze}from"./chunk.GRLPNTUW.js";import{c as Ce}from"./chunk.EJAVIZ7Y.js";import{m as Ie}from"./chunk.423SZS7C.js";import{G as ot,Ja as J,Oa as He,R as Me,Sa as Ee,_ as O,h as Ae,u as Te}from"./chunk.TM6JVVGW.js";import"./chunk.SDO3U72B.js";import{Hc as Se,hc as xe,jc as ke,la as Q,ma as N,yb as be}from"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import{b as Y}from"./chunk.AJZBJBMO.js";var a=Y(ot(),1);var t=Y(Me(),1);function bt(u,r,o){let c=r.on??r.about[r.about.length-1];De(u,r.about,{...o,pins:Z(),...c===void 0?{}:{focus:c}})}function xt({placement:u="float",chosen:r=!0}={}){let{menuAt:o}=O();return u==="menu"&&o===null?r?(0,t.jsx)(at,{}):null:(0,t.jsx)(lt,{placement:u})}function at(){let{store:u,setMenuAt:r,view:o}=O(),{selection:c}=J(),h=(0,a.useRef)(null),[E,y]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let b=h.current?.offsetParent??h.current?.parentElement;if(!b)return;let m=Math.round(b.getBoundingClientRect().width);m!==E&&y(m)});let v=c.length===1&&!o.overview?u.graph.getNode(c[0]):void 0;return!v||E===null||E>=Be?(0,t.jsx)("span",{ref:h,hidden:!0}):(0,t.jsx)("button",{type:"button",ref:h,"data-testid":"chosen-acts","aria-label":`What can be done with ${S(u,v.id)}`,"aria-haspopup":"menu",onClick:b=>{let m=b.currentTarget.getBoundingClientRect();r({x:Math.round(m.right),y:Math.round(m.bottom+4),on:v.id})},style:{position:"absolute",right:"calc(14px + var(--graview-dock, 0px))",top:98,zIndex:"var(--graview-layer-overview, 10)",minHeight:30,padding:"0 12px",borderRadius:8,fontSize:"0.8125rem",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Acts\u2026"})}var Be=564;function lt({placement:u}){let{store:r,menuAt:o,setMenuAt:c,view:h,signIn:E}=O(),y=(0,a.useRef)(null),v=(0,a.useRef)(null),b=(0,a.useRef)(null),m=(0,a.useRef)(null);o?.returnTo&&(m.current=o.returnTo);let Ke=e=>{let i=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),n=e.getAttribute("data-pin-for"),d=i??e.getAttribute("data-affordance")??(n===null?null:`pin:${n}`)??e.getAttribute("data-menu-item");v.current=d===null?null:{key:d,element:e}};(0,a.useEffect)(()=>{let e=y.current,i=v.current;if(i===null||document.activeElement!==document.body||i.element.isConnected)return;let n=i.key;if(!e){v.current=null;let k=m.current;m.current=null,(k?.isConnected?k:b.current)?.focus();return}((n.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(n.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(n)}"]:not([disabled])`)??e).focus()});let[_e,je]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let e=y.current?.offsetParent??y.current?.parentElement;if(e instanceof HTMLElement&&(b.current=e),!e)return;let i=e.getBoundingClientRect();je(n=>n&&n.left===i.left&&n.top===i.top&&n.width===i.width&&n.height===i.height?n:{left:i.left,top:i.top,width:i.width,height:i.height})});let{selection:Ue,set:Ve,clear:Ge}=J(),s=o?.about??Ue,[q,Ye]=(0,a.useState)(()=>Z()),F=o?.on??s[s.length-1],B=o?.about,Qe=(0,a.useMemo)(()=>({pins:q,...F===void 0?{}:{focus:F},...B?{about:B}:{}}),[q,F,B]),Je=(0,a.useMemo)(()=>new Set(r.allMutations().filter(e=>e.pinned).map(e=>e.name)),[r]),{affordances:g,withheld:ee,observations:te}=Ne(Qe),I=ke(ee,E),f=I?st:ee,Xe=o===null?null:{face:o.face??"scene",on:o.on,about:s,field:o.field,place:o.place,href:o.href,act:o.act,element:o.returnTo},ne=Re(Xe),ie=te.some(e=>e.id.startsWith("schema:waits:")),{apply:Ze,preview:et}=Oe(),[C,z]=(0,a.useState)(null),[tt,re]=(0,a.useState)(!1),[oe,ae]=(0,a.useState)(!1),[L,R]=(0,a.useState)(""),nt=$e({letters:!0}),[le,K]=(0,a.useState)(null),_=(0,a.useRef)([]),j=(e,i)=>{try{return et(e,i),Ze(e,i),K(null),c(null),_.current=[],!0}catch(n){return K(ze(r.schema,r.allMutations(),n)),_.current=n instanceof be?n.issues.map(d=>String(d.path[0]??"")).filter(Boolean):[],!1}},$=[...new Set(s.flatMap(e=>{let i=r.graph.getNode(e);return i?[i.kind]:[]}))],x=$.length>0?$:[...new Set(s.flatMap(e=>Te(e)))],p=s.length===1?Ae(s[0]):null,U=p?{from:r.graph.getNode(p.from),to:r.graph.getNode(p.to)}:null,se=p?Le(r,p):void 0,de=se?.provisional?se:void 0,ue=p?(()=>{let e=r.schema.tryDefinition(r.graph.getNode(p.from)?.kind??"")?.edges?.[p.kind],i=r.graph.getNode(p.to);return e?.inverse&&i?`From ${S(r,i.id)}: ${e.inverse}`:null})():null;(0,a.useEffect)(()=>{z(null),re(!1),ae(!1),K(null),R("")},[s,o?.about]);let l=o!==null,it=u==="menu"&&!l,A=(0,a.useRef)(o);A.current=o;let pe=Ee("acts",{open:l&&u==="menu",onOpenChange:e=>{e||c(null)},at:()=>A.current?{x:A.current.x,y:A.current.y}:null,returnTo:()=>{let e=A.current?.returnTo;if(e?.isConnected)return e;let i=A.current?.on;return i?document.querySelector(`[data-graview-view="${CSS.escape(i)}"]`):null},align:"start"}),ce=(_e?.width??Number.POSITIVE_INFINITY)<Be;if((0,a.useLayoutEffect)(()=>{let e=y.current?.offsetParent;if(!e||!ce||l)return;let i=y.current?.getBoundingClientRect().height??0,n=`${Math.round(i)+20}px`;if(e.style.paddingBottom===n)return;let d=e.style.paddingBottom;return e.style.paddingBottom=n,()=>{e.style.paddingBottom=d}}),s.length===0&&!l)return null;let ge=o?.title!==void 0||s.length>0&&!(s.length===1&&s[0]===h.focusId),he=Math.max(1,Math.min(9,g.length)),T=[...g.filter(e=>e.provider==="invariant"&&!e.destructive),...g.filter(e=>e.pinned&&e.provider!=="invariant"&&!e.destructive),...g.filter(e=>!e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...g.filter(e=>e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...g.filter(e=>e.destructive)],me=T.length>he&&!l,fe=L.trim().toLowerCase(),w=me&&fe.length>0?T.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(fe)):null,V=w??(tt||l?T:T.slice(0,he)),ye=w?0:T.length-V.length,W=[];for(let e of V){let i=!l&&e.provider==="invariant",n=!l&&!i&&e.pinned!==void 0&&!e.destructive,d=!l&&!i&&!n&&e.ties===!0&&!e.destructive,k=i?e.why:n?"pinned":d?"its ties":null,D=i?"violation":n||d?"ties":null,H=W[W.length-1];H&&H.heading===k?H.items.push(e):W.push({heading:k,tone:D,items:[e]})}let G=g.find(e=>e.id===C),P=s.length===1?S(r,s[0]):null,ve=e=>{if(!P)return e;let i=e.startsWith(`"${P}"`)?e.slice(P.length+2):e.startsWith(P)?e.slice(P.length):null;if(i===null)return e;let n=i.trimStart();return n.length===0?e:n[0].toUpperCase()+n.slice(1)},rt=new Set(l?[]:V.filter(e=>e.provider==="invariant").map(e=>e.why)),M=te.filter(e=>!rt.has(e.text)).map(e=>({...e,text:ve(e.text)}));return it?null:(0,t.jsxs)("section",{...l?pe.pane:{},ref:e=>{y.current=e,l&&pe.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":l?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>Ke(e.target),onBlur:e=>{e.relatedTarget!==null&&(v.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...l?He:{position:"absolute",zIndex:Se("rail")},boxSizing:"border-box",display:"flex",flexDirection:"column",gap:7,padding:"9px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",...l?{width:300,maxHeight:"min(52cqh, 420px)",overflow:"auto"}:ce?{left:10,right:10,width:"auto",bottom:10,maxHeight:"min(42cqh, 300px)",overflow:"auto"}:{left:14,top:h.overview?"min(296px, 38cqh)":44,width:236,maxHeight:h.overview?"calc(100cqh - min(296px, 38cqh) - 20px)":"calc(68cqh - 94px)",overflow:"auto"}},children:[(0,t.jsx)("h2",{style:{...Ie,margin:0},children:"Inspector"}),(0,t.jsxs)("div",{style:{display:ge||!l?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:l?0:24},children:[ge?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:o?.title??(s.length===1?S(r,s[0]):`${s.length} selected`)}),$.length>0||p?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:p?"relation":$.map(e=>N(r.schema.tryDefinition(e),e)).join(" \xB7 ")}):null,s.length===1&&!p&&o?.face!=="pages"?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:h.expanded.includes(s[0])?"\xB7 double-click closes":"\xB7 double-click opens"}):null]}):null,(0,t.jsx)("span",{style:{flex:"1 1 auto"}})]}),l?null:(0,t.jsx)("button",{type:"button",onClick:()=>{c(null),Ge()},"aria-label":"Clear selection",title:"Clear selection",style:{position:"absolute",top:6,right:6,flex:"0 0 auto",width:24,height:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.875rem",lineHeight:1,borderRadius:7},children:"\xD7"}),p&&U?(0,t.jsxs)("div",{style:{display:"grid",gap:6},children:[ue?(0,t.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:ue}):null,de?(0,t.jsx)("p",{"data-testid":"edge-provisional",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:Pe(de)}):null,(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",U.from],["to",U.to]].map(([e,i],n)=>(0,t.jsxs)(a.Fragment,{children:[n===1?(0,t.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,i?(0,t.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>Ve([i.id]),title:`Select ${S(r,i.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:S(r,i.id)}):(0,t.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,!p&&s.length===1&&xe(r,s[0])?(0,t.jsx)("p",{"data-testid":"left-alone",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:"Left alone: nothing automated changes it."}):null,M.length>0?(0,t.jsx)("div",{"data-testid":"observations",title:M.map(e=>e.text).join(`
|
|
2
|
-
`),style:{display:"grid",gap:3},children:M.slice(0,2).map(e=>(0,t.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===M[1]&&M.length>2?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",M.length-2]}):null]},e.id))}):null,l?ne.start.map(e=>(0,t.jsx)(Fe,{section:e,close:()=>c(null)},e.id)):null,le?(0,t.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:le}):null,me?(0,t.jsx)("input",{"data-testid":"action-filter",value:L,onChange:e=>R(e.target.value),placeholder:`Filter ${T.length} actions\u2026`,"aria-label":"Filter actions",onKeyDown:e=>{if(e.key==="Escape"){e.stopPropagation(),L.length>0?R(""):e.currentTarget.blur();return}if(e.key==="Enter"&&w?.length===1){let i=w[0];if(i.destructive)return;i.open.length>0?z(i.id):j(i)&&R("")}},style:{font:"inherit",fontSize:"0.875rem",padding:"5px 9px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):null,w!==null&&w.length===0?(0,t.jsxs)("p",{"data-testid":"no-matches",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:["Nothing offered here matches \u201C",L.trim(),"\u201D."]}):null,I&&g.length===0||g.length===0&&!ie&&s.length===0?null:g.length===0&&!ie?(0,t.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:f.length>0?`Nothing you may do with ${p?"this relation":x.length===1?Q(N(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} \u2014 ${f.length} action${f.length===1?"":"s"} withheld.`:p?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${Ce(r.schema,r.graph.getNode(p.from)?.kind??"",p.kind,"out")}\u201D.`:`Nothing can be done with ${x.length===1?Q(N(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${x.length===1?"it":"them"}.`}):(0,t.jsxs)("ol",{...nt,"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[W.map((e,i)=>(0,t.jsxs)(a.Fragment,{children:[e.heading?(0,t.jsxs)("li",{"data-graview-heading":e.tone,style:{fontSize:"0.75rem",lineHeight:1.4,color:e.tone==="violation"?"var(--graview-warn)":"var(--graview-ink-faint)",...e.tone!=="violation"?{letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"}:{},padding:"2px 2px 1px",marginTop:i>0?6:0},children:[e.tone==="violation"?"\u26A0 ":"",e.tone==="violation"?ve(e.heading):e.heading]}):i>0?(0,t.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},onKeyDown:d=>{if(d.metaKey||d.ctrlKey||d.altKey)return;let k=d.currentTarget.querySelector("[data-affordance]"),D=d.currentTarget.querySelector("[data-pin-for]"),H=d.target===D,we=d.key==="ArrowRight"&&!H?D:H&&["ArrowLeft","ArrowUp","ArrowDown"].includes(d.key)?k:null;we&&(d.preventDefault(),d.stopPropagation(),we.focus())},children:[(0,t.jsxs)("button",{type:"button",[X]:"","data-affordance":n.id,"data-rank":n.rank,"data-graview-destructive":n.destructive||void 0,"aria-pressed":C===n.id,title:n.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:C===n.id?"var(--graview-accent)":l?"transparent":"var(--graview-edge)",background:l?"none":"var(--graview-panel)",boxShadow:"none",...n.destructive?{color:"var(--graview-warn)"}:{},...C===n.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(n.open.length>0){z(C===n.id?null:n.id);return}j(n)},children:[n.label,n.open.length>0?(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,w?.length===1&&w[0]?.id===n.id&&!n.destructive?(0,t.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,t.jsx)("button",{type:"button","data-testid":"pin-toggle",tabIndex:-1,"data-pin-for":n.mutation,"aria-pressed":n.pinned!==void 0,"aria-label":n.pinned!==void 0?`Unpin ${n.label}`:`Pin ${n.label}`,title:n.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":n.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>Ye(qe(q,n.mutation,Je.has(n.mutation))),style:{flex:"0 0 auto",width:24,minHeight:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.75rem",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7,color:n.pinned==="user"?"var(--graview-accent)":n.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:n.pinned!==void 0?"\u2605":"\u2606"})]},n.id))]},`${e.heading??"plain"}-${i}`)),ye>0?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",[X]:"",onClick:()=>re(!0),title:`Show all ${g.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",ye," more"]})}):null]}),I?(0,t.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>{c(null),I.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left"},children:I.label}):null,f.length>0?(0,t.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[f.slice(0,l||oe?f.length:3).map(e=>(0,t.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,t.jsx)("button",{type:"button",disabled:!0,"data-affordance":e.id,"data-rank":e.rank,"data-withheld":e.refusal.wouldNeed.join(",")||"nobody",style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8,borderStyle:"dashed",width:"100%",textAlign:"left",background:"none"},children:(0,t.jsx)("s",{children:e.label})}),(0,t.jsx)("span",{"data-testid":"withheld-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:e.refusal.message})]},e.id)),!l&&!oe&&f.length>3?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>ae(!0),title:`Show all ${f.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",f.length-3," more withheld"]})}):null]}):null,l?ne.end.map(e=>(0,t.jsx)(Fe,{section:e,close:()=>c(null)},e.id)):null,G?(0,t.jsx)(We,{affordance:G,onApply:e=>{if(j(G,e))z(null);else return _.current},onCancel:()=>z(null)}):null]})}var st=[];function Fe({section:u,close:r}){return(0,t.jsxs)("div",{"data-menu-section":u.id,...u.heading?{role:"group","aria-label":u.heading}:{},style:{display:"grid",gap:2,borderTop:"1px solid var(--graview-edge)",paddingTop:5},children:[u.heading?(0,t.jsx)("p",{"aria-hidden":"true",style:{margin:0,padding:"2px 2px 1px",fontSize:"0.75rem",lineHeight:1.4,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:u.heading}):null,u.items&&u.items.length>0?(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:u.items.map(o=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-menu-item":o.id,onClick:()=>{r(),o.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"},children:[o.label,o.hint?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",o.hint]}):null]})},o.id))}):null,u.render?.(r)]})}export{xt as InspectorPane,bt as prepareActs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as x}from"./chunk.SPZVEQC5.js";import"./chunk.FNK2ZZ5E.js";import"./chunk.RSR2M7ZO.js";import"./chunk.WVUJXDXZ.js";import"./chunk.NQDGUIUQ.js";import"./chunk.DTRNDSMS.js";import"./chunk.3EW6L5DY.js";import"./chunk.AVDXG57A.js";import"./chunk.LD6S2FL5.js";import"./chunk.TABIRLQS.js";import"./chunk.GZHZLJBF.js";import{n as R}from"./chunk.FOYVTN5B.js";import"./chunk.OJGHDWI6.js";import"./chunk.OTF3NNTI.js";import"./chunk.A7HMVWMG.js";import"./chunk.GRLPNTUW.js";import"./chunk.EJAVIZ7Y.js";import"./chunk.423SZS7C.js";import{$ as g,G as A,R as v}from"./chunk.TM6JVVGW.js";import"./chunk.SDO3U72B.js";import{Gc as k,ka as y,oa as c}from"./chunk.PFEKS3KO.js";import"./chunk.2AZTW66C.js";import{b as u}from"./chunk.AJZBJBMO.js";var f=u(A(),1);var L=u(A(),1),S=(0,L.createContext)(void 0);var i=u(v(),1),W=new WeakMap,m=new WeakMap,P=(e,n)=>`${n.kind}\0${n.id??""}\0${e}`;function b(e,n,a){let p=P(n,a),o=W.get(e);o||W.set(e,o=new Map);let t=o.get(p);return t||(t=Promise.resolve().then(()=>e(n,a)).then(r=>C(r)?r:null,()=>null).then(r=>{let s=m.get(e);return s||m.set(e,s=new Map),s.set(p,r),r}),o.set(p,t)),t}function C(e){if(e===null)return!0;if(typeof e!="object"||e===void 0)return!1;if(e.denied===!0)return!0;let n=e;return typeof n.name=="string"&&n.name.trim()!==""&&typeof n.href=="string"}function h(e){if(/^https?:\/\//i.test(e))try{return new URL(e).href}catch{return}}var N=e=>h(e)??(c(e)?e:void 0),E=e=>h(e)??(e.startsWith("/")&&c(e)?e:void 0),I={kind:"human"},w={color:"var(--graview-ink-muted)"};function M({icon:e}){if(!e)return null;let n=E(e);if(n)return(0,i.jsx)("img",{src:n,alt:"",width:20,height:20,"data-graview-app-icon":"",style:{width:20,height:20,borderRadius:5,objectFit:"cover",flex:"0 0 auto"}});let a=[...e.trim()].slice(0,2).join("");return a?(0,i.jsx)("span",{"aria-hidden":"true","data-graview-app-icon":"",style:{flex:"0 0 auto",lineHeight:"20px"},children:a}):null}function V(e){let n=g(),a=(0,f.useContext)(S)??n?.resolveApp,p=n?.principal??I,o=()=>a?m.get(a)?.get(P(e,p))??"asking":null,[t,r]=(0,f.useState)(o);return(0,f.useEffect)(()=>{let s=o();if(r(s),s!=="asking"||!a)return;let l=!0;return b(a,e,p).then(d=>l&&r(d)),()=>{l=!1}},[a,e,p.kind,p.id]),t}function D({address:e,as:n="chip",nodeId:a,field:p,style:o}){let t=V(e),r={position:"relative",zIndex:k.raised,overflowWrap:"anywhere",minWidth:0,maxWidth:"100%",...o},s;if(t==="asking")s=(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"asking","aria-busy":"true",style:{...w,...r},children:"Linked app"});else if(t&&"denied"in t)s=(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"denied",style:{...w,fontStyle:"italic",...r},children:"linked app (no access)"});else if(t){let l=N(t.href),d=n==="record"?t.headline?.trim():void 0;s=(0,i.jsxs)(l?"a":"span",{"data-graview-app-link":"","data-graview-app-state":"found",...l?{href:l}:{},...!d&&t.headline?{title:t.headline}:{},style:{display:"inline-flex",alignItems:d?"flex-start":"center",minHeight:24,gap:8,color:"inherit",textUnderlineOffset:3,...r},children:[(0,i.jsx)(M,{icon:t.icon}),(0,i.jsxs)("span",{style:{display:"grid",minWidth:0},children:[(0,i.jsx)("span",{"data-graview-app-name":"",style:{fontWeight:600},children:t.name}),d?(0,i.jsx)("span",{"data-graview-app-headline":"",style:{...w,fontSize:"0.8125em",fontWeight:400},children:d}):null]})]})}else{let l=h(e);s=l?(0,i.jsx)("a",{"data-graview-app-link":"","data-graview-app-state":"plain",href:l,rel:"noopener noreferrer",target:"_blank",style:{color:"var(--graview-accent)",display:"inline-flex",alignItems:"center",minHeight:24,...r},children:e}):(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"plain",style:r,children:e})}return a&&p?(0,i.jsx)(H,{nodeId:a,field:p,address:e,drawn:s}):s}function H({nodeId:e,field:n,address:a,drawn:p}){let o=R(e).fields.some(s=>s.field===n),t=g()?.store;if(!o)return p;let r=y(t?t.schema.tryDefinition(String(t.graph.getNode(e)?.kind)):void 0,n).toLowerCase();return(0,i.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px",maxWidth:"100%",minWidth:0},children:[p,(0,i.jsx)("span",{style:{fontSize:"0.8125rem"},children:(0,i.jsx)(x,{nodeId:e,field:n,value:"Change",stored:a,said:`Change the ${r}`})})]})}var _=e=>(0,i.jsx)(D,{...e});export{D as AppLink,_ as drawAppLink};
|
|
File without changes
|