graview 0.1.36 → 0.1.38
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.2EJAIT33.js +1 -0
- package/dist/preview/chunk.2HFRVWWM.js +1 -0
- package/dist/preview/chunk.2VIGF4FO.js +1 -0
- package/dist/preview/chunk.33GN2NUT.js +1 -0
- package/dist/preview/chunk.36SQJMEE.js +1 -0
- package/dist/preview/chunk.3D5T3XIE.js +2 -0
- package/dist/preview/chunk.3FW4QNGV.js +1 -0
- package/dist/preview/chunk.3RT2GUZ5.js +1 -0
- package/dist/preview/chunk.3ZRHHB7X.js +1 -0
- package/dist/preview/{chunk.6QDFBCV4.js → chunk.4DEUD66C.js} +2 -2
- package/dist/preview/{chunk.S6GJGTJE.js → chunk.4EQSP7I3.js} +1 -1
- package/dist/preview/chunk.4Y6BCHV2.js +1 -0
- package/dist/preview/{chunk.LA7535VO.js → chunk.5MSO3KRO.js} +1 -1
- package/dist/preview/chunk.5VBBQ6Z3.js +1 -0
- package/dist/preview/chunk.5XJEGXDO.js +3 -0
- package/dist/preview/{chunk.6KMXLUOS.js → chunk.67WL7BGF.js} +1 -1
- package/dist/preview/{chunk.RKHEZ6KZ.js → chunk.6CKBIY7L.js} +1 -1
- package/dist/preview/chunk.6IHXTT6Z.js +1 -0
- package/dist/preview/{chunk.Y3IJDWNS.js → chunk.6ONRWFA6.js} +1 -1
- package/dist/preview/chunk.6UCRL4OF.js +1 -0
- package/dist/preview/chunk.6XJP7F3I.js +1 -0
- package/dist/preview/chunk.74RMHUCX.js +2 -0
- package/dist/preview/{chunk.OXZRGP53.js → chunk.7H5KVW2F.js} +1 -1
- package/dist/preview/chunk.7RSZMIAL.js +1 -0
- package/dist/preview/{chunk.QDHUDLJB.js → chunk.AFY35RJP.js} +1 -1
- package/dist/preview/{chunk.HPX3F7XX.js → chunk.AZCFXPEL.js} +1 -1
- package/dist/preview/{chunk.R45BF6JV.js → chunk.B5ILKGEF.js} +1 -1
- package/dist/preview/{chunk.5PU3RWYY.js → chunk.BRHRAVU2.js} +2 -2
- package/dist/preview/chunk.BUVAMSOZ.js +3 -0
- package/dist/preview/{chunk.6ZZZBDEG.js → chunk.DFVVS6C5.js} +1 -1
- package/dist/preview/chunk.DL637Q3W.js +1 -0
- package/dist/preview/chunk.DQJAEU4V.js +1 -0
- package/dist/preview/chunk.ESSQAMPM.js +1 -0
- package/dist/preview/{chunk.P75TPZWT.js → chunk.EUGWV3S6.js} +1 -1
- package/dist/preview/chunk.EV553KRT.js +1 -0
- package/dist/preview/chunk.EZP4FHDX.js +35 -0
- package/dist/preview/chunk.F6PIK2J2.js +1 -0
- package/dist/preview/{chunk.ZWZ5SEXT.js → chunk.FMVWXSQ7.js} +1 -1
- package/dist/preview/chunk.FTJBW25J.js +1 -0
- package/dist/preview/chunk.FUJM7GDV.js +1 -0
- package/dist/preview/{chunk.H4T56OXM.js → chunk.FYIQZMVF.js} +1 -1
- package/dist/preview/{chunk.IMRCAU4T.js → chunk.GR5Q4HTW.js} +1 -1
- package/dist/preview/chunk.GZ3IXNA4.js +1 -0
- package/dist/preview/chunk.HUSFMFXH.js +1 -0
- package/dist/preview/chunk.HVTGPEVW.js +1 -0
- package/dist/preview/chunk.I3SQJ2L2.js +1 -0
- package/dist/preview/chunk.IEDXW36H.js +1 -0
- package/dist/preview/chunk.IM7LXLIB.js +2 -0
- package/dist/preview/chunk.IU6ISXXC.js +1 -0
- package/dist/preview/{chunk.WQBDTLPZ.js → chunk.J2CR4RRH.js} +1 -1
- package/dist/preview/{chunk.J3TEJBI5.js → chunk.JWJQ2VXS.js} +1 -1
- package/dist/preview/chunk.K5KEECHL.js +88 -0
- package/dist/preview/{chunk.DANDYIB5.js → chunk.KNJZ2YNJ.js} +1 -1
- package/dist/preview/{chunk.OF34OZ4V.js → chunk.KSXB4LDF.js} +1 -1
- package/dist/preview/chunk.L34FY7QQ.js +1 -0
- package/dist/preview/chunk.L73VUBXN.js +4 -0
- package/dist/preview/{chunk.LMVCWYYG.js → chunk.L7JKEEMM.js} +1 -1
- package/dist/preview/chunk.LAW5PQEM.js +1 -0
- package/dist/preview/chunk.LDD3QX7G.js +1 -0
- package/dist/preview/chunk.LF7PU77M.js +7 -0
- package/dist/preview/chunk.LHO7L3CS.js +1 -0
- package/dist/preview/chunk.LU5LSXSW.js +1 -0
- package/dist/preview/chunk.MCVY6RRS.js +1 -0
- package/dist/preview/chunk.MQ7FNHXG.js +25 -0
- package/dist/preview/chunk.MVNUWK5Y.js +1 -0
- package/dist/preview/chunk.MWZK3HVG.js +1 -0
- package/dist/preview/{chunk.GUDKPK42.js → chunk.NH5TDAB2.js} +1 -1
- package/dist/preview/{chunk.MXJS67W4.js → chunk.NORRCKGN.js} +1 -1
- package/dist/preview/{chunk.FUR4IHWG.js → chunk.NPX7SPXM.js} +1 -1
- package/dist/preview/chunk.NQQHOSOK.js +1 -0
- package/dist/preview/chunk.NWWMUOZM.js +1 -0
- package/dist/preview/{chunk.2B4WVCVV.js → chunk.OE4QOBJF.js} +1 -1
- package/dist/preview/chunk.OEF3GPRM.js +1 -0
- package/dist/preview/{chunk.XRCGADKC.js → chunk.OS3L4ZOF.js} +1 -1
- package/dist/preview/chunk.OTL3Z345.js +1 -0
- package/dist/preview/{chunk.WJ2TWU2I.js → chunk.P3UPCI23.js} +1 -1
- package/dist/preview/chunk.PGKIEDYV.js +9 -0
- package/dist/preview/{chunk.42WJ6VJZ.js → chunk.PKUWET2F.js} +1 -1
- package/dist/preview/chunk.POHEWJKZ.js +1 -0
- package/dist/preview/chunk.PUBG2L6F.js +117 -0
- package/dist/preview/chunk.QT4XGC5Z.js +344 -0
- package/dist/preview/chunk.QTTBZJ6W.js +1 -0
- package/dist/preview/{chunk.ZEW2OOZ5.js → chunk.QYRPELLU.js} +1 -1
- package/dist/preview/chunk.RJDZOF2L.js +1 -0
- package/dist/preview/{chunk.CUCNT7MG.js → chunk.ROGYDMES.js} +1 -1
- package/dist/preview/chunk.RVJYEOFN.js +1 -0
- package/dist/preview/chunk.RZVZG2BQ.js +1 -0
- package/dist/preview/chunk.SGB6IMWN.js +1 -0
- package/dist/preview/chunk.SGLJTSTD.js +1 -0
- package/dist/preview/{chunk.ITXIFDQ7.js → chunk.SITFEJES.js} +1 -1
- package/dist/preview/{chunk.T2CN7UTZ.js → chunk.SZWX56WR.js} +6 -6
- package/dist/preview/chunk.TKSGC6XH.js +1 -0
- package/dist/preview/chunk.TOWYHWPB.js +17 -0
- package/dist/preview/{chunk.UJR3Y7MP.js → chunk.UF3L6FJO.js} +1 -1
- package/dist/preview/chunk.UXIFQIHA.js +2 -0
- package/dist/preview/{chunk.EBLKEQ7O.js → chunk.V2NBJDAX.js} +1 -1
- package/dist/preview/chunk.V5ZT5NSJ.js +1 -0
- package/dist/preview/chunk.VKHKYK5L.js +1 -0
- package/dist/preview/{chunk.KU6NIMQX.js → chunk.VNBR4DHD.js} +1 -1
- package/dist/preview/chunk.VSYHU5MA.js +1 -0
- package/dist/preview/chunk.VTWFVPKD.js +19 -0
- package/dist/preview/chunk.VV4BPOIK.js +1 -0
- package/dist/preview/chunk.W2HCJQVK.js +32 -0
- package/dist/preview/{chunk.HZPTBPJY.js → chunk.WERYQENC.js} +1 -1
- package/dist/preview/{chunk.FERBNBDE.js → chunk.WG5NIR23.js} +1 -1
- package/dist/preview/chunk.WLPTY4BF.js +5 -0
- package/dist/preview/chunk.XHWL7QBF.js +1 -0
- package/dist/preview/chunk.XM3NPZLP.js +1 -0
- package/dist/preview/chunk.YAXZNQY6.js +1 -0
- package/dist/preview/chunk.YG423NEB.js +1 -0
- package/dist/preview/{chunk.TGEF6TMM.js → chunk.YPY5BOEI.js} +1 -1
- package/dist/preview/{chunk.EDSPYKR4.js → chunk.YUJG5SN5.js} +1 -1
- package/dist/preview/chunk.YVR3ZMTV.js +1 -0
- package/dist/preview/chunk.YXH3IWNR.js +1 -0
- package/dist/preview/{chunk.WHTQHU3M.js → chunk.Z3ZKYSPN.js} +1 -1
- package/dist/preview/{chunk.O3OALXCI.js → chunk.ZLXPIEUC.js} +2 -2
- package/dist/preview/{chunk.OREMUXB5.js → chunk.ZRQI5VJF.js} +1 -1
- package/dist/preview/chunk.ZYCNEOAQ.js +1 -0
- package/dist/preview/index.html +43 -42
- package/dist/preview/page.js +7 -7
- package/package.json +6 -6
- package/dist/preview/chunk.272ZJXQP.js +0 -1
- package/dist/preview/chunk.27TLAVRR.js +0 -19
- package/dist/preview/chunk.2A2DLMT3.js +0 -1
- package/dist/preview/chunk.3PT55HXT.js +0 -1
- package/dist/preview/chunk.3SM2CHKF.js +0 -1
- package/dist/preview/chunk.3ZIOAPI5.js +0 -1
- package/dist/preview/chunk.4B73P2WA.js +0 -2
- package/dist/preview/chunk.4GXXD4NG.js +0 -1
- package/dist/preview/chunk.4Q56V7GS.js +0 -1
- package/dist/preview/chunk.4STIUIT6.js +0 -1
- package/dist/preview/chunk.53IKY7UP.js +0 -1
- package/dist/preview/chunk.56BPXB6E.js +0 -1
- package/dist/preview/chunk.64MJ5FRL.js +0 -1
- package/dist/preview/chunk.6II4BONS.js +0 -25
- package/dist/preview/chunk.6W7J76TK.js +0 -1
- package/dist/preview/chunk.7CO7S6QM.js +0 -27
- package/dist/preview/chunk.7G3B5QPH.js +0 -1
- package/dist/preview/chunk.7TBSVQSH.js +0 -1
- package/dist/preview/chunk.7YQYWOZR.js +0 -1
- package/dist/preview/chunk.AAZFVCSP.js +0 -2
- package/dist/preview/chunk.ACEYGWMO.js +0 -1
- package/dist/preview/chunk.ACXA55GW.js +0 -1
- package/dist/preview/chunk.BZ5VLPKB.js +0 -341
- package/dist/preview/chunk.CE3NOADH.js +0 -1
- package/dist/preview/chunk.CNJENUPC.js +0 -1
- package/dist/preview/chunk.CRPT3ZT3.js +0 -1
- package/dist/preview/chunk.D6RDTUX3.js +0 -1
- package/dist/preview/chunk.DSP62QYK.js +0 -9
- package/dist/preview/chunk.E77K6KBX.js +0 -1
- package/dist/preview/chunk.EQIGKXIG.js +0 -1
- package/dist/preview/chunk.ER5ILWKY.js +0 -3
- package/dist/preview/chunk.ET76FISZ.js +0 -17
- package/dist/preview/chunk.F5BCCGFK.js +0 -5
- package/dist/preview/chunk.FQKH67BP.js +0 -1
- package/dist/preview/chunk.FWBQVPMI.js +0 -1
- package/dist/preview/chunk.GOCUBIRW.js +0 -1
- package/dist/preview/chunk.GXLAZGYT.js +0 -1
- package/dist/preview/chunk.GZLYTPE7.js +0 -1
- package/dist/preview/chunk.IB32NOV5.js +0 -2
- package/dist/preview/chunk.JLXQ6ZLI.js +0 -1
- package/dist/preview/chunk.JZMA2AV7.js +0 -1
- package/dist/preview/chunk.K5NJTE3F.js +0 -35
- package/dist/preview/chunk.KBJG5SI2.js +0 -3
- package/dist/preview/chunk.LNNFNJKN.js +0 -1
- package/dist/preview/chunk.M4FQ7SSM.js +0 -1
- package/dist/preview/chunk.NJ62C2GU.js +0 -1
- package/dist/preview/chunk.NNCTJSD3.js +0 -1
- package/dist/preview/chunk.NWYOLGQ3.js +0 -1
- package/dist/preview/chunk.O6ROFVFD.js +0 -88
- package/dist/preview/chunk.OFJH7LDC.js +0 -1
- package/dist/preview/chunk.OH5BBE2B.js +0 -1
- package/dist/preview/chunk.OZR5NI4J.js +0 -1
- package/dist/preview/chunk.PWOVXARZ.js +0 -1
- package/dist/preview/chunk.Q63RPNUS.js +0 -1
- package/dist/preview/chunk.QEALNWWL.js +0 -117
- package/dist/preview/chunk.QLMUGC7R.js +0 -1
- package/dist/preview/chunk.QTITRX5Q.js +0 -1
- package/dist/preview/chunk.R7LRJS6B.js +0 -4
- package/dist/preview/chunk.SG23JC6D.js +0 -1
- package/dist/preview/chunk.SSRP5SBR.js +0 -1
- package/dist/preview/chunk.T47DLH5Z.js +0 -1
- package/dist/preview/chunk.VHWUGSFW.js +0 -1
- package/dist/preview/chunk.W42P7NOL.js +0 -1
- package/dist/preview/chunk.WGI5G6NM.js +0 -1
- package/dist/preview/chunk.XBTZXWJX.js +0 -1
- package/dist/preview/chunk.YNE5QR7Q.js +0 -1
- package/dist/preview/chunk.ZDNJK2SX.js +0 -1
- package/dist/preview/chunk.ZNS3LYJU.js +0 -1
- package/dist/preview/chunk.ZSSOTIFL.js +0 -1
- package/dist/preview/chunk.ZVMIHXVK.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as u}from"./chunk.IMRCAU4T.js";import{_ as l}from"./chunk.F5BCCGFK.js";function a(e,n){let s=new Map;for(let o of e){let t=n(o.from),i=n(o.to);if(t===void 0||i===void 0)continue;let d=`${o.kind}|${t}|${i}`,r=s.get(d);r||s.set(d,r={edge:o.kind,from:t,to:i,links:0,froms:new Set,tos:new Set}),r.links+=1,r.froms.add(o.from),r.tos.add(o.to)}return[...s.entries()].sort(([o],[t])=>o<t?-1:o>t?1:0).map(([o,t])=>({key:o,edge:t.edge,from:t.from,to:t.to,links:t.links,fromCount:t.froms.size,toCount:t.tos.size}))}function m(e,n,s){let o=[],t=[];for(let d of e){let r=f(d);if(r!==null){o.includes(r)||o.push(r);continue}s(d)!==void 0&&t.push(d)}let i=n.overview&&n.focusId!==null?f(n.focusId):null;return n.beside&&n.overview&&i===null&&n.focusId!==null&&t.length===0&&o.length===0&&s(n.focusId)!==void 0&&t.push(n.focusId),{districts:o,records:t,lens:i}}function f(e){return e.startsWith("kind:")?e.slice(5)||null:e.startsWith("aggregate:")&&!e.includes("|")&&e.slice(10)||null}function y(e,n){let s=u(e,n.from,n.edge,"out"),o=n.from===n.to?" of their own":"";return`${l(e,n.from,n.fromCount)} \u2192 ${l(e,n.to,n.toCount)}${o}, ${s}`}export{a,m as b,f as c,y as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f}from"./chunk.CRPT3ZT3.js";import"./chunk.LNNFNJKN.js";import"./chunk.6W7J76TK.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import{jb as a}from"./chunk.F5BCCGFK.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
|
-
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 V}from"./chunk.KU6NIMQX.js";import{o as le,p as $,s as ce,t as ue}from"./chunk.PWOVXARZ.js";import{m as B,n as ae,o as ie,p as Q,q as H}from"./chunk.OJGHDWI6.js";import{c as se}from"./chunk.IMRCAU4T.js";import{b as X,c as re,d as F,e as _,g as oe}from"./chunk.BZ5VLPKB.js";import{E as N,F as D,I as Z,N as ee,Q as S,Y as w,Z as te,_ as O,a as A,na as R,pa as ne,xa as E}from"./chunk.6II4BONS.js";import{aa as j,bc as J,gc as K}from"./chunk.F5BCCGFK.js";import{b as h}from"./chunk.AJZBJBMO.js";var M=h(D(),1),G=h(S(),1),ge="A",W=E(A(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.OF34OZ4V.js","./chunk.NNCTJSD3.js","./chunk.GXLAZGYT.js","./chunk.R7LRJS6B.js","./chunk.IB32NOV5.js","./chunk.Y3IJDWNS.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.HJCQ6I3S.js","./chunk.ZWZ5SEXT.js","./chunk.FQKH67BP.js","./chunk.LA7535VO.js","./chunk.ZEW2OOZ5.js","./chunk.7YQYWOZR.js","./chunk.ACEYGWMO.js","./chunk.3PT55HXT.js","./chunk.272ZJXQP.js","./chunk.3SM2CHKF.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.EBLKEQ7O.js","./chunk.VHWUGSFW.js","./chunk.P75TPZWT.js","./chunk.6W7J76TK.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.PWOVXARZ.js","./chunk.SG23JC6D.js","./chunk.OJGHDWI6.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.XRCGADKC.js"))));var ve=W.part((e,t)=>(0,G.jsx)(e.InspectorPane,{...t}),{what:"This card's acts"});function he(e){let t=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},n=globalThis;if(n.requestIdleCallback){let p=n.requestIdleCallback(t,{timeout:5e3});return()=>n.cancelIdleCallback?.(p)}let a=setTimeout(t,2500);return()=>clearTimeout(a)}var ye=150,we="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function ke(e){if(e.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let t=e.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??e.closest("[data-graview-view]")?.getAttribute("data-graview-view");return t?{face:"scene",on:t,about:[t]}:null}function be(e){let{store:t,principal:n,providers:a}=w(),p=ue(),u=(0,M.useRef)({aimAt:e,store:t,principal:n,providers:a,prepareSections:p});u.current={aimAt:e,store:t,principal:n,providers:a,prepareSections:p},(0,M.useEffect)(()=>{if(typeof document>"u")return;let d=null,l=null,f=()=>{d&&clearTimeout(d.timer),d=null},y=s=>{let r=u.current,v=r.aimAt(s);if(!v)return;let b=JSON.stringify([v.face,v.on,v.about,v.field,v.place,v.act,r.store.log.length]);b!==l&&(l=b,r.prepareSections(v),W.load().then(L=>L.prepareActs(r.store,v,{principal:r.principal,providers:r.providers}),()=>{}))},g=s=>s.target instanceof Element?s.target.closest(we):null,c=s=>{if(s.pointerType==="touch")return;let r=g(s);r!==null&&r===d?.element||(f(),r!==null&&(d={element:r,timer:setTimeout(()=>{d=null,y(r)},ye)}))},m=s=>{if(d===null)return;let r=s.relatedTarget;r instanceof Node&&d.element.contains(r)||f()},k=s=>{if(s.pointerType==="mouse")return;let r=g(s);r&&y(r)},i=s=>{let r=g(s);r&&y(r)};return document.addEventListener("pointerover",c,{passive:!0}),document.addEventListener("pointerout",m,{passive:!0}),document.addEventListener("pointerdown",k,{capture:!0,passive:!0}),document.addEventListener("focusin",i),()=>{f(),document.removeEventListener("pointerover",c),document.removeEventListener("pointerout",m),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("focusin",i)}},[])}function Ge({placement:e="float",openActs:t,aimAt:n}={}){let{menuAt:a,setMenuAt:p,registerActsDoor:u}=w(),{selection:d}=R();be(n??ke),(0,M.useEffect)(()=>{if(W.current)return;let g=()=>{k(),W.prefetch()},c=he(g),m=["pointerdown","keydown"];for(let i of m)document.addEventListener(i,g,{capture:!0,passive:!0});function k(){c();for(let i of m)document.removeEventListener(i,g,{capture:!0})}return k},[]),(0,M.useEffect)(()=>{if(e==="menu")return u({key:ge,open:t??(g=>{let c=g.getBoundingClientRect(),m=g.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??g.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;p({x:Math.round(c.left+Math.min(16,c.width/2)),y:Math.round(Math.min(c.bottom,c.top+36)),...m?{on:m}:{}})})}),()=>u(null)},[e,u,p,t]);let l=a!==null||d.length>0,[f,y]=(0,M.useState)(l);return(0,M.useEffect)(()=>{l&&y(!0)},[l]),!f&&!l?null:(0,G.jsx)(M.Suspense,{fallback:null,children:(0,G.jsx)(ve,{placement:e,chosen:t===void 0})})}var q=h(D(),1),z=h(S(),1),Se=E(A(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.OF34OZ4V.js","./chunk.NNCTJSD3.js","./chunk.GXLAZGYT.js","./chunk.HPX3F7XX.js","./chunk.7CO7S6QM.js","./chunk.6QDFBCV4.js","./chunk.R7LRJS6B.js","./chunk.IB32NOV5.js","./chunk.4STIUIT6.js","./chunk.WHTQHU3M.js","./chunk.KU6NIMQX.js","./chunk.Y3IJDWNS.js","./chunk.OFJH7LDC.js","./chunk.5PU3RWYY.js","./chunk.27TLAVRR.js","./chunk.OREMUXB5.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.HJCQ6I3S.js","./chunk.ZWZ5SEXT.js","./chunk.FQKH67BP.js","./chunk.LA7535VO.js","./chunk.ZEW2OOZ5.js","./chunk.7YQYWOZR.js","./chunk.ACEYGWMO.js","./chunk.3PT55HXT.js","./chunk.272ZJXQP.js","./chunk.3SM2CHKF.js","./chunk.CUCNT7MG.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.EBLKEQ7O.js","./chunk.WVUJXDXZ.js","./chunk.VHWUGSFW.js","./chunk.P75TPZWT.js","./chunk.6W7J76TK.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.GZHZLJBF.js","./chunk.PWOVXARZ.js","./chunk.SG23JC6D.js","./chunk.OJGHDWI6.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.4GXXD4NG.js")))),Me=Se.part((e,t)=>{let n=e.DraftFrame;return(0,z.jsx)(n,{...t})},{what:"The view"});function _e(e){let{seatTalk:t}=w();return(0,q.useSyncExternalStore)(t.subscribe,()=>t.get().draft!==null,()=>!1)?(0,z.jsx)(q.Suspense,{fallback:null,children:(0,z.jsx)(Me,{...e})}):null}var I=h(D(),1),T=h(S(),1),de=E(A(()=>(__graviewPreload(import.meta.url,["./chunk.ZSSOTIFL.js","./chunk.ER5ILWKY.js","./chunk.7YQYWOZR.js","./chunk.ACEYGWMO.js","./chunk.3PT55HXT.js","./chunk.D6RDTUX3.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.P75TPZWT.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.M4FQ7SSM.js")))),Ae=de.part((e,t)=>{let n=e.QuickAskCard;return(0,T.jsx)(n,{...t})},{what:"The quick ask"});function Ue({face:e,on:t=!0}){let{ai:n,aiDesk:a,selection:p,view:u}=w(),d=ee()?.open??!1,l=t&&N(n)&&!d,f=oe(a),y=(0,I.useRef)(null),g=(0,I.useRef)({selection:p,place:u.within?.view});return g.current={selection:p,place:u.within?.view},(0,I.useEffect)(()=>{if(!l)return;let c=re(a);return c.drawn+=1,F(c),()=>{c.drawn=Math.max(0,c.drawn-1),c.drawn===0&&(c.open=null),F(c)}},[l,a]),(0,I.useEffect)(()=>{if(!l)return;let c=m=>{if(m.defaultPrevented||m.key.toLowerCase()!=="k"||!(m.metaKey||m.ctrlKey)||m.altKey||m.shiftKey)return;let k=y.current?.closest("[data-graview-embed]"),i=m.target,s=!(i instanceof Node)||i===document.body||i===document.documentElement;if(k&&!(s||i instanceof Node&&k.contains(i)))return;m.preventDefault(),de.prefetch();let r=document.activeElement,{selection:v,place:b}=g.current;_(a,{pointed:{...v[0]!==void 0?{on:v[0]}:{},about:v,...b?{place:b}:{}},returnTo:r instanceof HTMLElement&&r!==document.body?r:null})};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[l,a]),l?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("span",{ref:y,hidden:!0,"data-graview-quick-ask":e}),f?(0,T.jsx)(I.Suspense,{fallback:null,children:(0,T.jsx)(Ae,{face:e,opening:f,close:()=>_(a,null)},f.at)}):null]}):null}var C=h(D(),1),x=h(S(),1),U=E(A(()=>(__graviewPreload(import.meta.url,["./chunk.ER5ILWKY.js","./chunk.7YQYWOZR.js","./chunk.ACEYGWMO.js","./chunk.3PT55HXT.js","./chunk.D6RDTUX3.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.P75TPZWT.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.CE3NOADH.js")))),Ee=U.part((e,t)=>{let n=e.InlineAiMenu;return(0,x.jsx)(n,{...t})},{what:"The AI's suggestions"}),Te=U.part((e,t)=>{let n=e.GhostTray;return(0,x.jsx)(n,{...t})},{quiet:!0});function Ie(){let{ai:e}=w(),t=N(e);return(0,C.useMemo)(()=>t?n=>({id:"inline-ai",heading:"AI",render:a=>(0,x.jsx)(C.Suspense,{fallback:null,children:(0,x.jsx)(Ee,{target:n,close:a})}),prepare:()=>U.prefetch()}):null,[t])}var xe=[];function Ze({children:e}){let t=Ie(),n=(0,C.useMemo)(()=>t?[t]:xe,[t]);return(0,x.jsx)(ce,{sections:n,children:e})}function et(e){let{ai:t,aiDesk:n}=w(),{ghost:a}=Z(n);return a===null||a.onCard||t.off?null:(0,x.jsx)(C.Suspense,{fallback:null,children:(0,x.jsx)(Te,{...e})})}function ot(e={}){return e.scope===void 0?V:X(V,e.scope)}var P=h(D(),1),o=h(S(),1);function dt({inside:e=!1,widthOf:t}={}){let{store:n,view:a,emphasis:p,setEmphasis:u}=w(),d=le(),{selection:l,set:f}=R(),{show:y}=ne(),g=O(),c=(0,P.useMemo)(()=>{let i=new Map;for(let s of n.graph.allEdges()){let r=i.get(s.kind)??{count:0,ends:new Set};r.count+=1;for(let v of[s.from,s.to]){let b=n.graph.getNode(v);b&&r.ends.add(`kind:${b.kind}`)}i.set(s.kind,r)}return[...i.entries()].sort(([s],[r])=>s.localeCompare(r)).map(([s,r])=>({kind:s,count:r.count,ends:[...r.ends]}))},[n,g]),m=Math.max(0,...c.map(i=>i.count));if((0,P.useEffect)(()=>()=>u(null),[u]),!a.overview&&!e||c.length===0)return null;let k=new Set;for(let i of l){if(i.startsWith("kind:")){k.add(i);continue}let s=n.graph.getNode(i);s&&k.add(`kind:${s.kind}`)}return(0,o.jsxs)("section",{"aria-label":"What the lines mean",role:e?"group":void 0,"data-testid":"relation-key",style:e?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:K("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:De,animation:"graview-settle 380ms 280ms ease backwards"},children:[e?null:(0,o.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:c.length===1?"1 relation":`${c.length} relations`}),t?(0,o.jsx)(Le,{aloft:a.overview===!0}):null,c.map(({kind:i,count:s,ends:r})=>{let{connector:v,style:b}=$(d,i),L=Ce(n.schema,i),me=p!==null?p===i:k.size===0||r.some(fe=>k.has(fe));return(0,o.jsxs)("button",{type:"button",title:n.schema.edge(i)?.description===void 0?`${s} of these`:L.words,onMouseEnter:()=>u(i),onMouseLeave:()=>u(null),onFocus:()=>u(i),onBlur:()=>u(null),onClick:()=>{f(r),y(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:me?1:.4},children:[(0,o.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:v.visible?1:.35},children:a.overview&&t?(0,o.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:t(s,m)}):(0,o.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:Q(b),strokeWidth:H(b,!0),strokeDasharray:B[b.pattern],strokeLinecap:"round"})}),(0,o.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":i,children:[(0,o.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:L.words}),(0,o.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:L.ends})]}),v.visible?null:(0,o.jsx)("span",{"data-graview-quiet":i,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,o.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:s})]},i)})]})}var De="min(280px, calc(100% - 28px))";function Ce(e,t,n){let a=e.edge(t)?.from??[],p=new Map;for(let l of n!==void 0&&a.includes(n)?[n]:a.length>0?a:[""]){let f=se(e,l,t,"out");p.set(f,[...p.get(f)??[],l])}let u=l=>l==="*"?"anything":j(e,l),d=[...p].map(([l,f])=>{let y=f.flatMap(c=>e.tryDefinition(c)?.edges[t]?.to??[]),g=f[0]&&y.length>0?`${f.map(u).join(", ")} \u2192 ${(y.includes("*")?["*"]:[...new Set(y)]).map(u).join(", ")}`:"";return[l.charAt(0).toUpperCase()+l.slice(1),g]});return{words:d.map(([l])=>l).join(" \xB7 "),ends:d.flatMap(([,l])=>l?[l]:[]).join(" \xB7 ")}}function pt({edgeKind:e,kit:t,width:n=30}){let a=te(),p=(0,P.useMemo)(()=>J(t??a?.brand?.kit),[t,a?.brand?.kit]),{connector:u,style:d}=$(p,e);return(0,o.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":e,style:{display:"inline-block",verticalAlign:"middle",opacity:u.visible?1:.35},children:(0,o.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:Q(d),strokeWidth:H(d,!0),strokeDasharray:B[d.pattern],strokeLinecap:"round"})})}function Le({aloft:e}){let t={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,o.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{style:t,"data-graview-manner":"ribbon",children:[(0,o.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,o.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,o.jsxs)("div",{style:t,"data-graview-manner":"record",children:[(0,o.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,o.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,o.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,o.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,o.jsxs)("div",{style:t,"data-graview-manner":"district",children:[(0,o.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,o.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,o.jsxs)("div",{style:t,"data-graview-manner":"unsure",children:[(0,o.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:ie,strokeWidth:1.8,strokeDasharray:ae,strokeLinecap:"round"})}),(0,o.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var pe=h(D(),1),Y=h(S(),1),Pe=E(A(()=>(__graviewPreload(import.meta.url,["./chunk.272ZJXQP.js","./chunk.3SM2CHKF.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.WGI5G6NM.js")))),Ne=Pe.part(e=>(0,Y.jsx)(e.SuggestedTray,{}),{quiet:!0});function vt(){let{store:e}=w(),t=O();return(0,pe.useMemo)(()=>e.log.all().some(a=>a.suggests!==void 0&&!a.withheld),[e,t])?(0,Y.jsx)(Ne,{}):null}export{Ge as a,_e as b,Ue as c,dt as d,De as e,pt as f,Ie as g,Ze as h,et as i,ot as j,vt as k};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as $}from"./chunk.IB32NOV5.js";import{a as C}from"./chunk.7YQYWOZR.js";import{g as M}from"./chunk.GZLYTPE7.js";import{X as k,Y as v,_ as j,kb as x}from"./chunk.F5BCCGFK.js";function N(a,s){let c=a.tryDefinition(s),r=Object.keys(c?.fields?.shape??{}),m=[c?.lifecycle?.field,...r.filter(l=>/^(status|stage|state|phase)$/i.test(l))].filter(l=>l!==void 0&&r.includes(l));return[...new Set(m)].slice(0,1)}function P(a,s){return a.tryDefinition(s)?.fieldRoles?.title??"label"}function V(a,s,c={}){let r=s.map(e=>a.graph.getNode(e)).filter(e=>e!==void 0);if(r.length===0)return{acts:[],withheld:[]};let u=c.principal??{kind:"human"},m=C(a,r.map(e=>e.id),{...c.derive,principal:u,...c.context?{context:c.context}:{}}),l=new Map(a.allMutations().map(e=>[e.name,e])),g=[...new Set(r.map(e=>e.kind))],p=new Set(g.map(e=>P(a.schema,e))),h=new Set(m.affordances.filter(e=>e.provider==="schema").map(e=>e.mutation)),o=e=>{let n=l.get(e.mutation);if(!n?.subject)return;let t=r.length===1&&e.provider==="invariant"&&!h.has(e.mutation)&&e.args[n.subject.arg]===r[0].id;if(!(e.provider!=="schema"&&!t)&&!(r.length>1&&e.batch?.length!==r.length)&&n.derived?.act!=="edit"&&!e.open.some(i=>p.has(i.name)))return n},y=[],b=new Set;for(let e of m.affordances){let n=o(e);if(!n||b.has(n.name))continue;b.add(n.name);let{[n.subject.arg]:t,...i}=e.args;y.push({id:e.id,label:v(n),mutation:n.name,subject:n.subject.arg,args:i,open:e.open,...e.destructive||e.setsAside?{more:!0}:{},...e.destructive?{destructive:!0}:{},affordance:{...e,label:v(n)}})}if(g.length===1){let e=g[0];for(let n of N(a.schema,e))for(let t of $(a.schema,[...l.values()],e,n)){if(t.by==="none"||r.every(d=>d[n]===t.value))continue;let i=r.find(d=>d[n]!==t.value),f=t.acts.find(d=>{let D=t.by==="step"?{[d.subject.arg]:i.id}:{[d.subject.arg]:i.id,[n]:t.value};return a.permits({name:d.name,args:D},u).ok});if(!f)continue;let w=t.by==="step"?{}:{[n]:t.value};if(t.by==="step"&&y.some(d=>d.mutation===f.name))continue;let R=t.by==="step"?v(f):`Move to ${t.label}`,O=`set:${n}:${t.value}`;y.push({id:O,label:R,mutation:f.name,subject:f.subject.arg,args:w,open:[],affordance:{id:O,label:R,provider:"schema",mutation:f.name,args:{[f.subject.arg]:i.id,...w},open:[],score:0,why:`every one is ${e}`,nodeIds:r.map(d=>d.id)}})}}let S=[...y.filter(e=>!e.more),...y.filter(e=>e.more)],A=m.withheld.filter(e=>{let n=l.get(e.mutation);return n?.subject!==void 0&&n.derived?.act!=="edit"&&(r.length===1||e.batch?.length===r.length)}).map(e=>({label:v(l.get(e.mutation)),message:e.refusal.message}));return{acts:S,withheld:A}}function _(a,s,c,r={}){let u=r.author,m=a.allMutations().find(e=>e.name===s.mutation),l=e=>M(a.schema,a.allMutations(),e),g=e=>{let n=a.graph.getNode(e);return n?k(a.schema.tryDefinition(n.kind),n):e},p=[],h=[],o=[];for(let e of[...new Set(c)]){let n={name:s.mutation,args:{...s.args,[s.subject]:e}};if(!m){p.push({id:e,label:g(e),message:`There is no act \u201C${s.mutation}\u201D.`,reason:"invalid"});continue}let t=a.permits(n,u);if(!t.ok){p.push({id:e,label:g(e),message:t.refusal.message,reason:"forbidden"});continue}if(!a.wouldChange(n,u)){h.push(e);continue}o.push({id:e,call:n})}let y=e=>a.previewAll(e,{...u?{author:u}:{},...r.context?{context:r.context}:{}});for(let e=0;o.length>0;e+=1)try{y(o.map(n=>n.call));break}catch(n){let t=[];for(let i of o)try{y([i.call]),t.push(i)}catch(f){p.push({id:i.id,label:g(i.id),message:l(f),reason:x(f).reason})}if(t.length===o.length||e>o.length){for(let i of t)p.push({id:i.id,label:g(i.id),message:l(n),reason:x(n).reason});o=[];break}o=t}if(o.length===0)return{applied:[],unchanged:h,refused:p};let b=s.label??(m?v(m):s.mutation),S=[...new Set(o.map(e=>a.graph.getNode(e.id)?.kind))],A=`${b} \u2014 ${S.length===1&&S[0]?j(a.schema,S[0],o.length):`${o.length} records`}`;try{let e=a.applyAll(o.map(n=>n.call),{intent:A,...u?{author:u}:{},...r.via?{via:r.via}:{}});return{batch:e.batch,intent:A,applied:o.map(n=>n.id),unchanged:h,refused:p,result:e}}catch(e){let n=l(e),t=x(e).reason;return{applied:[],unchanged:h,refused:[...p,...o.map(i=>({id:i.id,label:g(i.id),message:n,reason:t}))],allOrNothing:!0}}}export{V as a,_ as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as w,D as b,G as k,J as $,N as p,Z as N,ca as D,ka as E,lb as F,rb as S,ub as T}from"./chunk.F5BCCGFK.js";function W(e,n,r){let o=[...n?.creates??[],...n?.subject&&n.subject.kinds!=="*"?n.subject.kinds:[]];for(let t of o){let i=e.tryDefinition(t),a=i?.fields?.shape??{};if(!i||!(r in a))continue;let d=i.display?.format?.[r];return{label:i.display?.labels?.[r]??D(i,r),option:u=>d?d(u):N(u)}}return{label:D(void 0,r),option:t=>N(t)}}function P(e,n,r){if(r instanceof F){let o=n.find(i=>i.name===r.mutation);return`Not yet: ${r.issues.map(i=>{let a=i.path.length>0?W(e,o,String(i.path[0])).label:void 0;return a?`${a} \u2014 ${i.message.replace(/^./,d=>d.toLowerCase())}`:i.message}).join("; ")}.`}return r instanceof Error?r.message:String(r)}var x=864e5,Z=/^(\d{4})-(\d{2})-(\d{2})/,y=e=>String(e).padStart(2,"0"),M=e=>new Date(e).toISOString().slice(0,10),m=e=>Date.UTC(+e.slice(0,4),+e.slice(5,7)-1,+e.slice(8,10)),g=(e,n)=>M(m(e)+n*x),R=e=>new Date(m(e)).getUTCDay();function l(e,n,r){if(!(n>=1&&n<=12&&r>=1&&r<=31))return;let o=`${String(e).padStart(4,"0")}-${y(n)}-${y(r)}`;return M(m(o))===o?o:void 0}function I(e=new Date){return{day:`${e.getFullYear()}-${y(e.getMonth()+1)}-${y(e.getDate())}`,minutes:e.getHours()*60+e.getMinutes()}}var j=e=>/T\d\d:\d\d(:[\d.]+)?(Z|[+-]\d\d:?\d\d)$/.test(e);function h(e){if(typeof e!="string")return;if(j(e)){let o=new Date(e);return Number.isNaN(o.getTime())?void 0:I(o)}let n=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2}))?/.exec(e);if(!n||!l(Number(n[1]),Number(n[2]),Number(n[3])))return;let r=e.slice(0,10);return n[4]===void 0?{day:r}:{day:r,minutes:Number(n[4])*60+Number(n[5])}}function O(e,n){if(!n.time)return e.day;let r=e.minutes??9*60;if(!n.instant)return`${e.day}T${y(Math.floor(r/60))}:${y(r%60)}`;let[,o,t,i]=Z.exec(e.day);return new Date(Number(o),Number(t)-1,Number(i),Math.floor(r/60),r%60).toISOString().replace(/\.\d{3}Z$/,"Z")}function H(e,n=new Date){let r=Intl.DateTimeFormat().resolvedOptions().timeZone??"UTC",o=r;try{o=new Intl.DateTimeFormat(e??b,{timeZoneName:"short"}).formatToParts(n).find(t=>t.type==="timeZoneName")?.value??r}catch{o=r}return{zone:r,short:o}}function G(e,n,r,o){let t=h(n);if(!t)return r;let i=e===void 0?void 0:h(e),a=r===void 0?void 0:h(r),d=u=>m(u.day)+(u.minutes??0)*6e4,c=(u,s)=>{let f=d(u)+s;return{day:M(f),...o.time?{minutes:Math.round(f%x/6e4)}:{}}};return i&&a?O(c(a,d(t)-d(i)),o):a&&d(a)>=d(t)?r:o.time?O(c(t,36e5),o):r}var K=/^(start|starts|startsAt|startsOn|startAt|begins|from|opens|checkIn)$/i,X=/^(end|ends|endsAt|endsOn|endAt|until|to|finish|finishes|closes|through|checkOut)$/i;function V(e,n={}){let r=(n.start&&e.includes(n.start)?n.start:void 0)??e.find(t=>K.test(t)),o=(n.end&&e.includes(n.end)?n.end:void 0)??e.find(t=>t!==r&&X.test(t));return r&&o?{start:r,end:o}:void 0}var q=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],J=["sun","mon","tue","wed","thu","fri","sat"],v="(jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|june?|july?|aug(?:ust)?|sept?(?:ember)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)",C="(sun(?:day)?|mon(?:day)?|tue(?:s|sday)?|wed(?:nesday)?|thu(?:r|rs|rsday)?|fri(?:day)?|sat(?:urday)?)",Q=e=>q.indexOf(e.slice(0,3))+1,L=e=>e===void 0?void 0:e.length===2?2e3+Number(e):Number(e);function ee(e){try{let n=new Intl.DateTimeFormat(e,{month:"numeric",day:"numeric"}).formatToParts(0).map(r=>r.type);return n.indexOf("month")<n.indexOf("day")}catch{return!0}}function ne(e){let n=(t,i)=>({minutes:i,rest:`${e.slice(0,t.index)} ${e.slice(t.index+t[0].length)}`}),r=/\b(noon|midday)\b/.exec(e);if(r)return n(r,12*60);if(r=/\bmidnight\b/.exec(e),r)return n(r,0);if(r=/\b(\d{1,2})(?::(\d{2}))?\s*([ap])\.?m?\.?(?=\s|$)/.exec(e),r){let t=Number(r[1]),i=Number(r[2]??0);return t<1||t>12||i>59?{rest:e,bad:!0}:n(r,(t%12+(r[3]==="p"?12:0))*60+i)}if(r=/\b(\d{1,2}):(\d{2})\b/.exec(e),r){let t=Number(r[1]),i=Number(r[2]);return t>23||i>59?{rest:e,bad:!0}:n(r,t*60+i)}if(r=/\bat\s+(\d{1,2})\b/.exec(e),r){let t=Number(r[1]);return t>23?{rest:e,bad:!0}:n(r,(t>=1&&t<=7?t+12:t)*60)}let o=/\b(morning|afternoon|evening|tonight)\b/.exec(e);return o?{minutes:{morning:9,afternoon:15,evening:18,tonight:20}[o[1]]*60,rest:o[1]==="tonight"?`${e.slice(0,o.index)} today ${e.slice(o.index+o[0].length)}`:`${e.slice(0,o.index)} ${e.slice(o.index+o[0].length)}`}:{rest:e}}function te(e,n,r){let o=e.replace(/\b(on|at|the|of|this)\b/g," ").replace(/\s+/g," ").trim();if(o==="")return null;if(o==="today"||o==="now")return n;if(o==="tomorrow"||o==="tmrw"||o==="tmr")return g(n,1);if(o==="yesterday")return g(n,-1);if(o==="next week")return g(n,7);let t=/^in (\d{1,3}) (day|days|week|weeks)$/.exec(o);if(t)return g(n,Number(t[1])*(t[2].startsWith("week")?7:1));if(t=new RegExp(`^(next )?${C}$`).exec(o),t){let u=(J.indexOf(t[2].slice(0,3))-R(n)+7)%7;return g(n,t[1]&&u===0?7:u)}if(t=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(o),t)return l(Number(t[1]),Number(t[2]),Number(t[3]));let i=o.replace(new RegExp(`^${C} `),"");t=new RegExp(`^(\\d{1,2})(?:st|nd|rd|th)? ${v}(?: (\\d{4}))?$`).exec(i);let a=t?{date:t[1],month:t[2],year:t[3]}:void 0;t=new RegExp(`^${v} (\\d{1,2})(?:st|nd|rd|th)?(?: (\\d{4}))?$`).exec(i);let d=a??(t?{date:t[2],month:t[1],year:t[3]}:void 0);if(d)return z(n,L(d.year),Q(d.month),Number(d.date));if(t=/^(\d{1,2})[/.-](\d{1,2})(?:[/.-](\d{2}|\d{4}))?$/.exec(i),t){let[c,u]=[Number(t[1]),Number(t[2])],[s,f]=ee(r)?[c,u]:[u,c];return z(n,L(t[3]),s,f)}}function z(e,n,r,o){if(n!==void 0)return l(n,r,o);let t=Number(e.slice(0,4)),i=l(t,r,o);return i===void 0?l(t+1,r,o):m(e)-m(i)>183*x?l(t+1,r,o):i}function re(e,n){let r=e.toLowerCase().replace(/,/g," ").replace(/(\d{4}-\d{2}-\d{2})t(?=\d)/,"$1 ").replace(/\s+/g," ").trim();if(r==="")return;let o=ne(r);if(o.bad)return;let t=te(o.rest,n.today,n.locale??b);if(t===void 0||t===null&&o.minutes===void 0)return;let i=t??n.base?.day??n.today;return n.time?{day:i,minutes:o.minutes??n.base?.minutes??9*60}:{day:i}}var oe=e=>/^[A-Z]{3}$/.test(e??"");function U(e){let{format:n,unit:r,currency:o,locale:t}=e,i=oe(r),a=n==="money"||!n&&i,d=a?i?r:o:void 0;return{...a?{format:"money"}:n?{format:n}:{},...r&&!(a&&i)?{unit:r}:{},...d?{currency:d}:{},...t?{locale:t}:{}}}function $e(e){switch(e.format){case"money":return e.currency?`An amount of money in ${e.currency}: a plain number, 1250.5 for 1,250.50 ${e.currency}.`:"An amount of money, in no named currency: a plain number.";case"percent":return"A fraction said as a percent: 0.15 is 15%.";default:return e.unit?`A number of ${e.unit}.`:"A number."}}function B(e){let n=w(e)?.innerType;return n===void 0?e:B(n)}var ie={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]},ue=e=>(e?._zod?.def?.checks??[]).map(n=>n._zod?.def).filter(n=>n!==void 0);function _(e){let n=B(e),r=w(n),o=r?.type,t=ue(n);if(o==="enum")return{type:"choice",options:Object.keys(r?.entries??{})};let i=E(n);if(i)return i==="image"?{type:"file",image:!0}:{type:"file"};if(o==="boolean")return{type:"boolean"};if(o==="array"){let a=_(r?.element);return a.type==="unknown"?{type:"unknown"}:{type:"several",of:a}}if(o==="number"){let a,d,c;for(let u of t){u.check==="multiple_of"&&typeof u.value=="number"?c=u.value:u.check==="number_format"&&(u.format==="safeint"||u.format==="int32"||u.format==="uint32")&&(c??=1);let s=u.check==="number_format"&&u.format?ie[u.format]:void 0,f=s?s[0]:u.check==="greater_than"&&u.inclusive&&typeof u.value=="number"?u.value:void 0,A=s?s[1]:u.check==="less_than"&&u.inclusive&&typeof u.value=="number"?u.value:void 0;f!==void 0&&(a=a===void 0?f:Math.max(a,f)),A!==void 0&&(d=d===void 0?A:Math.min(d,A))}return{type:"number",...a===void 0?{}:{min:a},...d===void 0?{}:{max:d},...c===void 0?{}:{step:c},...T(n)==="duration"?{duration:!0}:{},...S(e)?{amount:U(S(e))}:{}}}if(o==="string"){if(t.some(s=>s.fn===k||s.format==="datetime")||r?.format==="datetime")return{type:"date",time:!0,instant:!0};let d=[r?.pattern,...t.map(s=>s.pattern)].filter(s=>s instanceof RegExp).map(s=>s.source);if(d.some(s=>s.includes("\\d{4}")))return d.some(s=>s.includes("\\d{2}:\\d{2}"))?{type:"date",time:!0}:{type:"date"};let c=t.some(s=>s.check==="max_length"&&typeof s.maximum=="number"&&s.maximum>500),u=T(n);return c?{type:"text",long:!0}:u==="phone"||u==="place"?{type:"text",holds:u}:{type:"text"}}return{type:"unknown"}}function ae(e,n){let r=e?.shape;return!r||!(n in r)?{type:"unknown"}:_(r[n])}function de(e){if(e===void 0||e==="web"||e.startsWith("ai:")||e.startsWith("app:"))return;if(e==="api")return"via the API";if(e==="cli")return"via the command line";let[n,...r]=e.split(":"),o=r.join(":");return(n==="mcp"||n==="view")&&o?`via ${o}`:n==="mcp"?"via an agent's tools":`via ${e}`}var Y=e=>{if(!e.currency)return{before:!0};try{let n=$(e.locale),r=new Intl.NumberFormat(n,{style:"currency",currency:e.currency}).formatToParts(1),o=r.findIndex(a=>a.type==="currency"),t=r.findIndex(a=>a.type==="integer"),i;try{i=new Intl.DisplayNames([n],{type:"currency"}).of(e.currency)}catch{}return{...o>=0?{symbol:r[o].value}:{},before:o<t,...i?{name:i}:{}}}catch{return{symbol:e.currency,before:!0}}};function se(e){let n=e.locale;if(e.format==="money"){let{symbol:r,before:o,name:t}=Y(e),i=p(1250,n,{minimumFractionDigits:2,maximumFractionDigits:2});return{...r?o?{prefix:r}:{suffix:r}:{},placeholder:i,hint:t?`in ${t}`:e.currency?`in ${e.currency}`:"an amount of money"}}return e.format==="percent"?{suffix:"%",placeholder:p(15,n),hint:"as a percent"}:{...e.unit?{suffix:e.unit}:{},placeholder:"",hint:e.unit?`in ${e.unit}`:"a number"}}function ce(e,n){return e===void 0||!Number.isFinite(e)?"":n.format==="money"?p(e,n.locale,Number.isInteger(e)?{maximumFractionDigits:0}:{minimumFractionDigits:2,maximumFractionDigits:2}):n.format==="percent"?p(e*100,n.locale,{maximumFractionDigits:4}):p(e,n.locale,{maximumFractionDigits:6})}function fe(e){try{let n=new Intl.NumberFormat($(e)).formatToParts(12345.6);return{group:n.find(r=>r.type==="group")?.value??",",decimal:n.find(r=>r.type==="decimal")?.value??"."}}catch{return{group:",",decimal:"."}}}function me(e,n){let{group:r,decimal:o}=fe(n),t=e.replace(/[\s ']/g,"").replace(/[−–]/g,"-");if(o!=="."&&!t.includes(o)&&/^-?\d+\.\d{1,2}$/.test(t))return Number(t);if(r&&(t=t.split(r).join("")),o!=="."&&(t=t.replace(o,".")),!/^-?(\d+\.?\d*|\.\d+)$/.test(t))return;let i=Number(t);return Number.isFinite(i)?i:void 0}function le(e,n){let r=e.trim();if(r==="")return;let o=n?.format==="money"&&n.currency?Y(n).symbol:void 0,t=r;o&&(t=t.split(o).join("")),n?.currency&&(t=t.replace(new RegExp(n.currency,"gi"),"")),t=t.replace(/^[$€£¥₹]|[$€£¥₹]$/g,""),/%\s*$/.test(t)&&(t=t.replace(/%\s*$/,"")),n?.unit&&n.format!=="money"&&(t=t.replace(new RegExp(`\\s*${n.unit.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*$`),""));let a=me(t,n?.locale);if(a!==void 0)return n?.format==="percent"?a/100:a}export{U as a,$e as b,B as c,_ as d,ae as e,W as f,P as g,de as h,se as i,ce as j,le as k,I as l,j as m,h as n,O as o,H as p,G as q,V as r,re as s};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as $e}from"./chunk.ZEW2OOZ5.js";import{d as be,e as we,h as xe,i as Y,j as ke}from"./chunk.VHWUGSFW.js";import{f as fe}from"./chunk.2B4WVCVV.js";import{d as L,e as he}from"./chunk.4B73P2WA.js";import{b as ge,e as ye}from"./chunk.IMRCAU4T.js";import{$ as oe,$b as H,Ab as Q,B as q,Bb as ie,Dc as ue,H as te,Mc as pe,Tb as ae,Uc as me,Vb as le,W as E,X as F,Z as re,_ as J,ac as de,ca as z,pb as se,sc as ce}from"./chunk.F5BCCGFK.js";function je(t,o,n){let s=t.tryDefinition(o)?.fields.shape,e=q(s?.[n]),a=!1,i=!1;for(;e&&(e.type==="optional"||e.type==="default"||e.type==="nullable"||e.type==="prefault");)(e.type==="optional"||e.type==="nullable")&&(a=!0),(e.type==="default"||e.type==="prefault")&&(i=!0),e=q(e.innerType);if(e?.type!=="enum")return;let g=(e.entries?Object.values(e.entries):e.values??[]).filter(p=>typeof p=="string");return g.length>0?{values:g,empty:a&&!i}:void 0}function V(t,o,n){let s=je(t,o,n);if(!s)return[];let e=t.tryDefinition(o),a=s.values.map(i=>({value:i,label:ge(e,n,i)}));return s.empty&&a.push({value:null,label:`No ${z(e,n).toLowerCase()}`}),a}function X(t,o,n){let s=t[o];return typeof s=="string"&&n.some(e=>e.value===s)?s:null}function Z(t,o,n,s,e=V(t.schema,n.kind,s)){let a=ve(t.schema,t.allMutations(),n.kind,s,e),i=X(n,s,e),g=[];for(let{value:p,by:R,acts:B}of a)if(p!==i)for(let P of B){let M=R==="step"?{[P.subject.arg]:n.id}:{[P.subject.arg]:n.id,[s]:p},S={name:P.name,args:M};if(P.input.safeParse(M).success&&t.permits(S,o).ok){try{se(t.graph,P,M)}catch{continue}g.push({to:p,call:S,title:P.title??P.name});break}}return g}function ve(t,o,n,s,e=V(t,n,s)){let a=Se(t,o,n,s),i=De(t,o,n,s);return e.flatMap(g=>{if(g.value===null)return[];let p=a.filter(R=>R.sets?.[s]===g.value);return[{value:g.value,label:g.label,by:p.length>0?"step":i.length>0?"value":"none",acts:p.length>0?p:i}]})}function Se(t,o,n,s){return o.filter(e=>e.subject!==void 0&&e.derived===void 0&&typeof e.sets?.[s]=="string"&&Q(t,e).includes(n))}function De(t,o,n,s){let e=t.tryDefinition(n);return e?o.filter(a=>{if(!a.subject||!Q(t,a).includes(n)||!ie(a,e).includes(s))return!1;let i=a.input.shape;return i!==void 0&&s in i}).sort((a,i)=>+(a.derived!==void 0)-+(i.derived!==void 0)):[]}var ee=(t,o)=>o&&t[o]!==void 0?String(t[o]):"";function Me(t,o,n){let s=c=>t.tryDefinition(c)?o.nodesOfKind(c).filter(y=>E(t.tryDefinition(c),y)):[],e=s(n.rows),a=s(n.columns),i=new Set(e.map(c=>c.id)),g=new Set(a.map(c=>c.id)),p=o.allEdges(),R=[],B=n.link;if(typeof B=="string"){let c=d=>t.tryDefinition(d)?.edges?.[B]?.to,y=(c(n.columns)??[]).some(d=>d===n.rows||d==="*"),k=(c(n.rows)??[]).some(d=>d===n.columns||d==="*"),$=y||!k;for(let d of p){if(d.kind!==B)continue;let j=$?d.to:d.from,r=$?d.from:d.to;i.has(j)&&g.has(r)&&R.push({rowId:j,columnId:r,via:[]})}}else{let c=new Map(B.path.map(k=>[k,new Map]));for(let k of p){let $=c.get(k.kind);if(!$)continue;let d=$.get(k.from);d?d.push(k.to):$.set(k.from,[k.to]);let j=$.get(k.to);j?j.push(k.from):$.set(k.to,[k.from])}let y=new Set;for(let k of a){let $=[{id:k.id,via:[]}];for(let d of B.path){let j=[],r=new Set;for(let b of $)for(let A of c.get(d).get(b.id)??[])r.has(`${b.id}|${A}`)||(r.add(`${b.id}|${A}`),j.push({id:A,via:[...b.via,b.id]}));$=j}for(let d of $){let j=`${d.id}|${k.id}`;!i.has(d.id)||y.has(j)||(y.add(j),R.push({rowId:d.id,columnId:k.id,via:d.via.slice(1)}))}}}let P=n.groupOrder??[],M=c=>P.indexOf(c)===-1?P.length:P.indexOf(c),S=(c,y)=>y==="label"?F(t.tryDefinition(c.kind),c):c[y],T=H(e,n.sort,S).map(c=>{let y=c;return{node:c,label:F(t.tryDefinition(c.kind),c),group:ee(y,n.rowGroup),ref:ee(y,n.rowRef)}}).sort((c,y)=>M(c.group)-M(y.group)||(n.sort!==void 0?0:c.ref<y.ref?-1:c.ref>y.ref?1:0)),K=H(a,n.columnSort,S).map(c=>({node:c,label:F(t.tryDefinition(c.kind),c),group:ee(c,n.columnGroup)})).sort((c,y)=>c.group<y.group?-1:c.group>y.group?1:n.columnSort!==void 0?0:c.node.id<y.node.id?-1:c.node.id>y.node.id?1:0);return{rows:T,columns:K,cells:R}}function Pe(t,o,n){let{rows:s,columns:e,cells:a}=Me(t,o,n),i=(r,b)=>J(t,r,b),g=r=>J(t,r,1).replace(/^1 /,""),p=r=>({id:r.id,kind:r.kind,title:F(t.tryDefinition(r.kind),r),parts:[]}),R=r=>{let b=o.getNode(r);if(!b)return null;let A=t.tryDefinition(b.kind),O=F(A,b),N=L(b,A,{limit:3,said:[O],glance:!0}).map(G=>G.alone.startsWith(G.label)?`${G.label.toLowerCase()}${G.alone.slice(G.label.length)}`:G.alone);return[O,...N].join(", ")},B=typeof n.link=="string"?[]:n.link.path.slice(0,-1).flatMap((r,b,A)=>{let O=ce(t,n.columns,A.slice(0,b+1));return O.ok?[...O.reached]:[]}),P=de(t,n,{rows:s.length,columns:e.length,cells:a.length});if(P)return[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}.`},{t:"text",text:P}];let M=[{t:"text",text:`${i(n.rows,s.length)} against ${i(n.columns,e.length)}${B.length>0?`, through ${[...new Set(B)].map(r=>i(r,2).replace(/^2 /,"")).join(" and ")}`:""}${e.length>0?`: ${e.map(r=>r.label).join(", ")}`:""}.`}],S=new Map(e.map(r=>[r.node.id,r.label])),T=new Map(e.map((r,b)=>[r.node.id,b])),K=new Map,c=new Map;for(let r of a){let b=K.get(r.rowId);b?b.push(r):K.set(r.rowId,[r]);let A=c.get(r.columnId);A?A.add(r.rowId):c.set(r.columnId,new Set([r.rowId]))}for(let r of s){let A=[...K.get(r.node.id)??[]].sort((O,N)=>T.get(O.columnId)-T.get(N.columnId)).map(O=>{let N=O.via.map(R).filter(G=>G!==null);return`${S.get(O.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:r.label,text:A.length>0?A.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:e.map(r=>{let b=c.get(r.node.id)??new Set,A=s.filter(O=>b.has(O.node.id)).map(O=>p(O.node));return{heading:`${r.label} (${A.length})`,items:A}})});let y=new Set(a.map(r=>r.rowId)),k=new Set(a.map(r=>r.columnId)),$=s.filter(r=>!y.has(r.node.id)),d=e.filter(r=>!k.has(r.node.id)),j=n.rows===n.columns;return $.length>0&&M.push({t:"text",text:`${j?`${$.length} with none across`:`${i(n.rows,$.length)} with no ${g(n.columns)}`}: ${$.map(r=>r.label).join(", ")}.`}),d.length>0&&M.push({t:"text",text:`${j?`${d.length} with none down`:`${i(n.columns,d.length)} on no ${g(n.rows)}`}: ${d.map(r=>r.label).join(", ")}.`}),M}function ne(t,o,n,s={}){let{app:e,blocks:a=n?e?.viewSpecs?.[n.kind]?.[s.slot??"page"]:e?.home}=s;if(!a?.length)return[];let i=s.firstHeading??(n||s.blocks?void 0:1),g=ke(t,o,n,{...s,money:s.money??e?.brand,firstHeading:i});return n&&!g.node?[]:we(typeof a[0]?.t=="string"?a:be(a),g)}var Oe=240,Re=10,Be=1160,Ie=40,Ge=640,Fe=3,Ne=t=>Math.max(1,Math.floor((Math.min(t,Be)-Ie+Re)/(Oe+Re)));function Ke(t,o,n,s){let{app:e}=s,a=s.width??1440,i=s.today??t.today()??te(),g=t.seenBy(o),p=g.schema,R=g.graph,B=$e(e),P=typeof n=="string"?n.trim():n.slug,M=typeof n=="string"?B.find(l=>l.slug===P||l.title===P||l.address===P):B.find(l=>l.slug===n.slug&&l.kind===n.kind)??n,S=!M&&typeof n=="string"?R.getNode(P):void 0;if(!M&&!S)return{ok:!1,error:`"${P}" is not a place this app has, nor a record this seat can see.`,places:B.map(l=>l.slug)};let T=[],K=e.viewSpecs??{},c=Ne(a),y=(l,h)=>ne(g,null,l,{app:e,today:i,...h}),k=(l,h,w)=>{let m=p.tryDefinition(l.kind),v=F(m,l);if(h==="name")return{id:l.id,kind:l.kind,title:v,parts:[]};if(K[l.kind]?.[h]){let C=y(l,{slot:h}),[I,...f]=C,D=I?.t==="title";return{id:l.id,kind:l.kind,title:D?I.text:v,parts:$(D?f:C,w,`views.${l.kind}.${h}`,` (${l.id})`,D?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:v,parts:[]};let u=m?.computed?Y(p,R,l):l,W=L(u,m,{limit:3,said:[v],glance:!0,locale:e.brand?.locale});return{id:l.id,kind:l.kind,title:v,parts:W.map(C=>({t:"text",text:C.alone}))}};function $(l,h,w,m="",v=0){let x=[];return l.forEach((u,W)=>{let C=`${w}.${W+v}`;switch("problem"in u&&u.problem&&T.push({at:`${C}${m}`,says:u.problem}),u.t){case"title":x.push({t:"heading",level:3,text:u.text});return;case"text":x.push({t:"text",text:u.markdown?ye(u.text):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":x.push({t:"badge",text:u.text});return;case"field":case"image":x.push({t:"field",label:u.label,text:u.text});return;case"progress":x.push({t:"progress",label:u.label,text:u.text});return;case"group":x.push(...$(u.blocks,h,`${C}.group`,m));return;case"when":x.push(...$(u.blocks,h,`${C}.show`,m));return;case"divider":case"figure":return;case"headline":x.push({t:"heading",level:u.level,text:u.text});return;case"number":x.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){x.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&x.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let I=h+1,f=I>Fe?"name":u.as,D=(u.groups??[{value:null,members:u.members}]).map(_=>({..."heading"in _&&_.heading?{heading:_.heading}:{},items:_.members.map(Ce=>k(Ce,f,I))}));x.push({t:"list",as:f,columns:f==="card"?c:1,groups:D,...u.more>0?{more:u.more}:{}});return}}}),x}let d=[],j,r,b;if(S){r="record";let l=p.tryDefinition(S.kind),h=F(l,S);b={slug:S.id,title:h,kind:S.kind,address:ue(p,S.kind,S.id)},K[S.kind]?.page&&d.push(...$(y(S,{slot:"page"}),1,`views.${S.kind}.page`));let m=l?.computed?Y(p,R,S):S;for(let v of he(l,L(m,l,{said:[h],locale:e.brand?.locale}))){v.title&&d.push({t:"heading",level:2,text:v.title});for(let x of v.fields)d.push({t:"field",label:x.label,text:x.value,...x.long?{long:!0}:{},...x.markdown?{markdown:!0}:{}})}}else{let l=M;b={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?pe(e).drawn.find(w=>w.as===l.slug&&(l.kind===null||w.kinds.includes(l.kind))):void 0;if(l.kind===null){let w=e.brand,m=w?.name??e.name,v=w?.logo&&le(w.logo)?w.logo:void 0;if(j={name:m,...w?.subtitle?{subtitle:w.subtitle}:{},...v?{logo:{alt:w?.logoAlt??m,...ae(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},e.home)r="blocks",d=$(y(null,{}),0,"views.home");else{r="derived";let x=t.kindsKeptFrom(o),u=new Set([...e.pages?.hide??[],...x,...t.modules.disabledKinds]),W=me(p.kinds,e.pages?.order).filter(C=>!u.has(C));d.push({t:"heading",level:1,text:e.name??"Home"});for(let C of W){let I=R.nodesOfKind(C).filter(f=>E(p.tryDefinition(C),f)).length;I>0&&d.push({t:"text",text:`${I} ${U(p,C,I)}`})}}}else if(h?.lens==="blocks")r="lens:blocks",d=$(y(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){r="lens:columns";let w=h.options.bindings??{};for(let m of Object.keys(w)){let v=w[m]?.column;if(!v)continue;let x=V(p,m,v),u=H(R.nodesOfKind(m).filter(f=>E(p.tryDefinition(m),f)),h.options.sort,(f,D)=>D==="label"?F(p.tryDefinition(f.kind),f):f[D]);Object.keys(w).length>1&&d.push({t:"heading",level:2,text:U(p,m,2).replace(/^./,f=>f.toUpperCase())}),d.push({t:"text",text:`${u.length} ${U(p,m,u.length)} in columns by ${z(p.tryDefinition(m),v).toLowerCase()}.`});let W=x.map(f=>({column:f,items:u.filter(D=>X(D,v,x)===f.value).map(D=>k(D,"card",1))})).filter(({column:f,items:D})=>f.value!==null||D.length>0).map(({column:f,items:D})=>({heading:`${f.label} (${D.length})`,items:D}));d.push({t:"list",as:"card",columns:1,groups:W});let C=new Map;for(let f of u)for(let D of Z(t,o,f,v,x))C.set(D.to,(C.get(D.to)??new Set).add(`"${D.title}"`));let I=x.filter(f=>f.value!==null&&C.has(f.value)).map(f=>`to ${f.label} by ${[...C.get(f.value)].join(" or ")}`);d.push({t:"text",text:I.length>0?`Moves: ${I.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")r="lens:coverage",d=Pe(p,R,h.options);else if(h){r=`lens:${h.lens}`;let w=h.kinds.flatMap(m=>R.nodesOfKind(m).filter(v=>E(p.tryDefinition(m),v)));d.push({t:"text",text:`A ${h.lens} of ${w.length} ${h.kinds.map(m=>U(p,m,w.length)).join(" and ")}.`}),d.push({t:"list",as:"name",columns:1,groups:[{items:w.map(m=>k(m,"name",1))}]})}else{r="derived";let w=R.nodesOfKind(l.kind).filter(m=>E(p.tryDefinition(l.kind),m));d.push({t:"heading",level:1,text:l.title}),w.length===0?d.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${U(p,l.kind,0)} yet.`}):d.push({t:"list",as:"row",columns:1,groups:[{items:w.map(m=>k(m,"row",1))}]})}}let A=o.kind==="system"?"the system":(o.roles??[]).length>0?(o.roles??[]).join(", "):o.kind,O=a<Ge?"phone":"wide",N=b.kind===null?Te(p,R):[],G={...j?{masthead:j}:{},...N.length>0?{facts:N}:{},place:b,seat:A,width:a,variant:O,drawnBy:r,parts:d,problems:T};return{ok:!0,description:{...G,text:Ae(G)}}}function Te(t,o){let n=xe(t,o,null),s=e=>Array.isArray(e)?e.map(s).join(", "):e===null?"nothing":typeof e=="boolean"?e?"yes":"no":typeof e=="object"?e.label:String(e);return[...fe(t)].map(([e,a])=>{let i=a.label??re(e);return Object.hasOwn(n.values,e)?{name:e,label:i,value:s(n.values[e])}:{name:e,label:i,refused:n.refused[e]??"it could not be worked out"}})}function U(t,o,n){let s=t.tryDefinition(o);if(n===1)return s?.noun??o;let e=oe(t,o);return e.charAt(0).toLowerCase()+e.slice(1)}function Ae(t){let o=[`${t.place.title} (${t.place.address}) \u2014 as ${t.seat}, ${t.width} wide (${t.variant}).`],n=t.masthead;n&&o.push(`Masthead: ${n.logo?`the logo ("${n.logo.alt}", ${n.logo.drawn==="image"?n.logo.src:"inline SVG"}), `:""}${n.name}${n.subtitle?` \u2014 ${n.subtitle}`:""}`);let s=(e,a)=>{for(let i of e)switch(i.t){case"heading":o.push(`${a}${"#".repeat(i.level)} ${i.text}`);break;case"text":o.push(`${a}${i.text}`);break;case"badge":o.push(`${a}[${i.text}]`);break;case"field":case"progress":o.push(`${a}${i.label}: ${i.text}`);break;case"figure":o.push(`${a}${i.text}${i.label?` \u2014 ${i.label}`:""}`);break;case"list":if(i.groups.length===0){i.empty&&o.push(`${a}(${i.empty})`);break}for(let g of i.groups){g.heading&&o.push(`${a}${g.heading}:`);for(let p of g.items)o.push(`${a}${g.heading?" ":""}- ${p.title}`),s(p.parts,`${a}${g.heading?" ":" "}`)}i.as==="card"&&i.columns>1&&o.push(`${a}(cards, ${i.columns} across)`),i.more&&o.push(`${a}and ${i.more} more`);break}};if(s(t.parts,""),t.facts){o.push("Facts of the whole graph (what fact('<name>') reads):");for(let e of t.facts)o.push(`- ${e.label} (${e.name}): ${e.value??`not worked out \u2014 ${e.refused}`}`)}if(t.problems.length>0){o.push("Problems:");for(let e of t.problems)o.push(`- ${e.at}: ${e.says}`)}return o.join(`
|
|
2
|
-
`)}export{V as a,X as b,Z as c,ve as d,Se as e,De as f,ne as g,Ke as h,Ae as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as Q,E as X,I as Y,K as Z,N as ee,a as N,i as K,l as z,o as D,p as W,t as _,u as j,w as U,z as J}from"./chunk.BZ5VLPKB.js";import{F as se,Q as T,Y as $,_ as G,ka as V,ra as q}from"./chunk.6II4BONS.js";import{Nb as M,Wb as P,Yb as O,yc as I}from"./chunk.F5BCCGFK.js";import{b as k}from"./chunk.AJZBJBMO.js";var o=k(se(),1);function ie(e){let t=[e?.typography?.body,e?.typography?.display,e?.typography?.mono],n=[];for(let a of t){let r=a?.split(",")[0]?.trim().replace(/^["']|["']$/g,"");!r||O(r)||r.toLowerCase()!==M.toLowerCase()&&(n.includes(r)||n.push(r))}return n}function ne(e){let t=ie(e);return t.length===0?null:`https://fonts.googleapis.com/css2?${t.map(a=>`family=${encodeURIComponent(a).replace(/%20/g,"+")}:wght@400;500;600;700`).join("&")}&display=swap`}var l=k(T(),1);function be({rootRef:e,firstLook:t,app:n}){let a=(0,o.useCallback)(()=>e.current,[e]);return t?(0,l.jsx)(ee,{firstLook:t,root:a,app:n}):null}function Se(e,t){let{app:n}=e;return(0,o.useMemo)(()=>{let a=Y(t(n.schema,n.viewSpecs),n),r=e.views?V(a,e.views(n.schema,a)):a;return Z(r,n.schema,Q(e.brand??n.brand,n.schema)),r},[e.views,n.schema,n.viewSpecs,n.lenses,n.pages,n.home])}function ce(e,t){return new I({schema:e.schema,mutations:e.mutations??[],invariants:e.invariants??[],...t?{snapshot:t}:{},...e.policy?{policy:e.policy}:{},...e.intelligence?{intelligence:e.intelligence}:{}})}function te(e){if(typeof document>"u")return e==="dark"?"dark":"light";let t=document.documentElement.dataset.theme;return t==="dark"||t==="light"?t:e==="dark"||e==="light"?e:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function de(e,t){let[n,a]=(0,o.useState)(()=>te(t));return(0,o.useEffect)(()=>{if(!e||typeof document>"u")return;let r=()=>a(te(t));r();let i=new MutationObserver(r);i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let d=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null;return d?.addEventListener?.("change",r),()=>{i.disconnect(),d?.removeEventListener?.("change",r)}},[e,t]),n}var A=e=>e?e.getBoundingClientRect().height:0;function ve(e,t,n){let a=(0,o.useRef)(n);a.current=n;let r=n!==void 0;(0,o.useLayoutEffect)(()=>{let i=e.current;if(!i||!r)return;let d=()=>{let u=[...i.children],b=u.find(S=>S.hasAttribute("data-graview-app-bar")),y=u.find(S=>S.hasAttribute("data-embed-content")),h=y?.querySelector("[data-embed-measure]")??null,c=u.find(S=>S.hasAttribute("data-graview-place-line"));return{strip:b,line:c,content:y,measure:h}},s=-1,f=()=>{let{strip:u,line:b,content:y,measure:h}=d(),c=Math.ceil(A(u)+A(b)+A(h||y));c!==s&&(s=c,a.current?.(c))};if(f(),typeof ResizeObserver>"u")return;let m=new ResizeObserver(f),E=()=>{m.disconnect();let{strip:u,line:b,content:y,measure:h}=d();for(let c of[i,u,b,y,h])c&&m.observe(c)};E();let g=new MutationObserver(()=>{E(),f()});return g.observe(i,{childList:!0}),()=>{m.disconnect(),g.disconnect()}},[e,t,r])}var we=480,le=0;function Ee(e){let{app:t,seed:n,scheme:a="auto",brand:r=t.brand,fonts:i=!0,height:d="100%",label:s}=e,f=(0,o.useRef)(null);q(f);let m=d==="viewport"?"100dvh":d,E=z(typeof m=="string"&&/vh\b/.test(m)),g=(0,o.useMemo)(()=>`graview-embed-${++le}`,[]),u=(0,o.useMemo)(()=>e.store??e.remote?.store??ce(t,n),[e.store,e.remote,t,n]),b=e.presence??e.remote?.presence,y=e.hostContext?.theme,h=de(a==="auto"&&y===void 0,r?.scheme),c=a==="auto"?y??h:a,S=(0,o.useMemo)(()=>N(c,r,{scope:`.${g}`}),[c,r,g]);K(e.favicon?P(r):void 0),(0,o.useEffect)(()=>{if(!i||typeof document>"u")return;let w=ne(r);if(!w||document.querySelector(`link[href="${w}"]`))return;let p=document.createElement("link");p.rel="stylesheet",p.href=w,document.head.appendChild(p)},[r,i]);let L=(0,o.useRef)(void 0);(0,o.useLayoutEffect)(()=>{let w=f.current,p=L.current;if(L.current=s,!w||!s)return;let ae=v=>{let R=v.getAttribute("aria-label")??"",x=p&&p!==s?R.startsWith(`${p} \xB7 `)?R.slice(p.length+3):R===p?"":R:R;x===s&&(v.getAttribute("role")==="region"||v.tagName==="SECTION"&&!v.hasAttribute("role"))&&v.setAttribute("role","group");let B=x.startsWith(`${s} \xB7 `)||x===s?x:x?`${s} \xB7 ${x}`:s;B!==R&&v.setAttribute("aria-label",B)},H=()=>w.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(v=>{v.hasAttribute("data-graview-named-by-lens")||ae(v)});H();let C=new MutationObserver(H);return C.observe(w,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>C.disconnect()},[s]);let oe=E?`${m}`.replace(/([\d.]+)[sdl]?vh\b/g,(w,p)=>`${+p*E/100}px`):m;return{rootRef:f,scope:g,css:S,scheme:c,store:u,presence:b,brand:r,auto:d==="auto",height:oe}}function Re({rootRef:e,board:t}){let n=(0,o.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]);return(0,l.jsx)(J,{board:t,anchor:n})}function xe(e,t,n){return{brand:n,locale:e.locale,principal:e.principal,seats:e.seats,presence:t,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,ai:e.ai,files:e.files,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function Ae({name:e,heading:t,faces:n,at:a,without:r,home:i,reach:d,standing:s,hostActions:f,keeping:m,onFind:E,switch:g}){let{brand:u,store:b,principal:y,views:h}=$();G();let c=r?.has("places")?[]:D({store:b,principal:y,views:h}),S=U();return(0,l.jsx)(_,{brand:u,name:e,description:u?.subtitle,heading:t,faces:n,home:i,places:c,current:a===null?null:W(c,a),reach:d,onFind:E,...g?{switch:g}:{},...n?{scenePlaces:S}:{},tools:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X,{clean:s}),(0,l.jsx)(j,{...f?{hostActions:f}:{},...m?{keeping:m}:{}})]})})}var ke=e=>e===!1?2:Math.min(e+1,6);function Fe(e){let[t,n]=(0,o.useState)(e),a=(0,o.useRef)(void 0),r=(0,o.useRef)(void 0),i=(0,o.useMemo)(()=>({go:a,at:n,pending:r}),[]),d=(0,o.useCallback)(s=>{if(a.current){a.current(s);return}r.current=s,n(s)},[]);return{at:t,setAt:n,steering:i,steer:d}}function ue(e){let t=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof t=="string"&&t.length>0?t:typeof e=="object"?"Error":typeof e}}var F=()=>typeof performance<"u"?performance.now():Date.now();function Le(e,t){let n=(0,o.useRef)({onError:e,face:t});return n.current={onError:e,face:t},(0,o.useCallback)((a,r)=>n.current.onError?.(ue(a),{module:r.module,face:n.current.face}),[])}function He(e,t){let n=(0,o.useRef)(null);n.current===null&&(n.current=F());let a=(0,o.useRef)({onReady:e,face:t});a.current={onReady:e,face:t};let r=(0,o.useRef)(!1);return(0,o.useCallback)(i=>{r.current||(r.current=!0,a.current.onReady?.({ms:Math.max(0,F()-(n.current??F())),face:i}))},[])}var re=class extends o.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(t,n){console.error(`[graview] ${this.props.module} threw while rendering`,t,n.componentStack),this.props.report(t,{module:this.props.module})}render(){return this.state.failed?(0,l.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,l.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,l.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{be as a,Se as b,ce as c,ve as d,we as e,Ee as f,Re as g,xe as h,Ae as i,ke as j,Fe as k,Le as l,He as m,re as n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as W}from"./chunk.BZ5VLPKB.js";import{F as H,b as A,c as T,d as v,e as f,f as x,k as I,n as b,pa as k,w as R}from"./chunk.6II4BONS.js";import{Rc as s,Xc as y,Yc as r}from"./chunk.F5BCCGFK.js";import{b as B}from"./chunk.AJZBJBMO.js";var u=B(H(),1),L=e=>typeof e=="object"&&e!==null&&"idx"in e;function E(e){let n=r(window.location.pathname,e);return n===null?null:n!==s&&n!=="/"?"pages":n===s||window.location.href.includes("#")?f(window.location.hash).overview?"graview":"scene":L(window.history.state)?"pages":null}function J(e){let n=e.face??(e.stop&&v(e.stop).overview?"graview":"scene");return e.routing!=="address"||typeof window>"u"?n:E(e.basePath)??n}function K(e){return e.routing!=="address"||typeof window>"u"?!1:r(window.location.pathname,e.basePath)==="/"&&E(e.basePath)===null}function Q(e){if(typeof window>"u")return;let n=r(window.location.pathname,e);return n===s||n==="/"&&window.location.href.includes("#")?T(f(window.location.hash)):void 0}function X({basePath:e,pagesWere:n,shown:t,onFace:i,toggle:l,kinds:U,places:w,opens:$}){let{view:F,go:p}=k(),g=(0,u.useRef)({shown:t,view:F,onFace:i});g.current={shown:t,view:F,onFace:i};let S=(0,u.useRef)(n??"/"),M=()=>{S.current=`${r(window.location.pathname,e)??"/"}${window.location.search}`};return l.current=(o,c,a)=>{let{shown:d,view:N,onFace:V}=g.current;if(o==="pages"&&d!=="pages")window.history.pushState(null,"",y(c??S.current,{basePath:e}));else if(o!=="pages"&&d==="pages"){M();let m=a===void 0?N:j(v(a),w),h=Y(m)?q($):m,O=h!==m&&h.overview?"graview":o,P=_(O,h,U);p(P),window.history.pushState(null,"",`${y(s,{basePath:e})}${x(P)}`),V?.(O);return}V?.(o)},(0,u.useEffect)(()=>{let o=()=>{if(r(window.location.pathname,e)===null)return;let c=E(e)??"pages",{shown:a,onFace:d}=g.current;if(c==="pages"){a!=="pages"&&d?.("pages");return}a==="pages"&&(p(j(f(window.location.hash),w)),d?.(c))};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[e,p,w]),null}function j(e,n){let t=e.within?.view,i=t!==void 0&&!e.focusId?n.find(l=>l.as===t):void 0;return i?{...e,focusId:R(i.kind)}:e}function _(e,n,t){return e==="graview"?b(n,!0):n.overview?I(b(n,!1),W(n,t)):n}function Y(e){return e.focusId===null&&e.overview!==!0}function q(e){return e??{...A,overview:!0}}export{J as a,K as b,Q as c,X as d,j as e,_ as f,Y as g,q as h};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{a as I,j as M,k as O}from"./chunk.27TLAVRR.js";import"./chunk.OREMUXB5.js";import{g as P}from"./chunk.ZDNJK2SX.js";import{l as D}from"./chunk.ZSSOTIFL.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import{b as C}from"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as q,Q as F}from"./chunk.6II4BONS.js";import{X as L,fc as E}from"./chunk.F5BCCGFK.js";import{b as N}from"./chunk.AJZBJBMO.js";var f=N(q(),1);var n=N(F(),1),R=40,B=60;function T(l,o,s){return l.allNodes().filter(i=>i.kind===o).map(i=>i[s])}function Y(l){if(l.length<2)return[];let o=[...l].sort((a,d)=>a-d),s=o[o.length-1]-o[0];if(s<=0)return[];let i=Math.max(1,10**Math.floor(Math.log10(s/4))),e=s/4>=i*5?i*5:i,t=a=>Math.round(a/e)*e;return[...new Set([.2,.4,.6,.8].map(a=>t(o[Math.floor(a*(o.length-1))])))].filter(a=>a>0)}function _(l,o,s){let i=new Set(s.far??[]),e=new Map;for(let t of o.allNodes())i.has(t.kind)&&e.set(t.id,L(l.tryDefinition(t.kind),t));return[...e.entries()].map(([t,a])=>({id:t,label:a}))}function K(l,o,s){let i=_(l,o,s);return(i.length<=R?i:i.map(t=>({end:t,ties:o.out(t.id).length+o.in(t.id).length})).sort((t,a)=>a.ties-t.ties||t.end.label.localeCompare(a.end.label)).slice(0,R).map(t=>t.end)).sort((t,a)=>t.label.localeCompare(a.label))}function U(l,o,s){let i=[];for(let e of s.filters){let t=i.length;if(e.about==="is")for(let a of e.options??[])i.push({value:`is:${a}`,label:a,group:e.label,condition:{key:"is",value:a}});else if(e.about==="edge"){i.push({value:`${e.key}:*`,label:"anything",group:e.label,condition:{key:e.key,value:"*"}}),i.push({value:`${e.key}:none`,label:"nothing",group:e.label,condition:{key:e.key,value:"none"}});for(let a of K(l,o,e))i.push({value:`${e.key}:${a.id}`,label:a.label,group:e.label,condition:{key:e.key,value:a.id}})}else if(e.type==="date")for(let a of["before","after","on"])i.push({value:`${e.key}:${a}`,label:`${a}\u2026`,group:e.label,ask:{key:e.key,op:a,label:e.label}});else if(e.type==="number"){let a=l.tryDefinition(s.kind),d=Y(T(o,s.kind,e.key).filter(p=>typeof p=="number"));for(let p of["at-most","at-least"])for(let v of p==="at-most"?d:[...d].reverse())i.push({value:`${e.key}:${p}:${v}`,label:`${p==="at-most"?"at most":"at least"} ${C(a,e.key,v)}`,group:e.label,condition:{key:e.key,value:`${p}:${v}`}})}else if(e.type==="text"){let a=[...new Set(T(o,s.kind,e.key).filter(d=>typeof d=="string"&&d.length>0&&!d.includes(",")))].sort((d,p)=>d.localeCompare(p));if(a.length>=2&&a.length<=B)for(let d of a)i.push({value:`${e.key}:${d}`,label:d,group:e.label,condition:{key:e.key,value:d}})}else if(e.type==="boolean")i.push({value:`${e.key}:true`,label:"yes",group:e.label,condition:{key:e.key,value:"true"}}),i.push({value:`${e.key}:false`,label:"no",group:e.label,condition:{key:e.key,value:"false"}});else if(e.about==="via"){let a=l.tryDefinition(e.far?.[0]??"");for(let d of e.options??[])i.push({value:`${e.key}:${d}`,label:C(a,e.key.split(".")[1],d),group:e.label,condition:{key:e.key,value:d}})}else for(let a of e.options??[])i.push({value:`${e.key}:${a}`,label:C(l.tryDefinition(s.kind),e.key,a),group:e.label,condition:{key:e.key,value:a}});for(let a=t;a<i.length;a++)i[a]={...i[a],key:e.key}}return i}function V(l,o,s,i){let e=l.tryDefinition(o);return["at-most","at-least"].map(t=>({value:`${s.key}:${t}:${i}`,label:`${t==="at-most"?"at most":"at least"} ${C(e,s.key,i)}`,group:s.label,key:s.key,condition:{key:s.key,value:`${t}:${i}`}}))}function G(l){let o=l.trim().replace(/(?<=\d),(?=\d{3}\b)/g,"");return/^-?\d+(\.\d+)?$/.test(o)?Number(o):null}function j(l,o,s){let i=U(l,o,s);return s.filters.flatMap(e=>{let t=i.filter(d=>d.key===e.key);if(e.type==="number"&&e.about!=="edge")return[{key:e.key,label:e.label,entries:t,atNumber:d=>V(l,s.kind,e,d)}];if(t.length===0)return[];if(e.about!=="edge")return[{key:e.key,label:e.label,entries:t}];let a=_(l,o,e);return a.length<I?[{key:e.key,label:e.label,entries:t}]:[{key:e.key,label:e.label,entries:t.filter(d=>d.value===`${e.key}:*`||d.value===`${e.key}:none`),typed:[...a].sort((d,p)=>d.label.localeCompare(p.label))}]})}var z=8;function H(l,o){let s=o.trim().toLocaleLowerCase();if(!s)return{shown:[],more:0};let e=[...l.filter(t=>t.label.toLocaleLowerCase().includes(s))].sort((t,a)=>+!t.label.toLocaleLowerCase().startsWith(s)-+!a.label.toLocaleLowerCase().startsWith(s));return{shown:e.slice(0,z),more:Math.max(0,e.length-z)}}var J=["day","week","month","year","decade"];function le(l){let{which:o,schema:s,graph:i,offers:e,arrangement:t,set:a,toggle:d,has:p,done:v}=l,m=l.testId,A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let u=A.current?.closest("[data-graview-popover]");!u||document.activeElement!==u||(u.querySelector('[aria-pressed="true"]')??u.querySelector("button, input"))?.focus({preventScroll:!0})},[]);let y=t.sort?e.sorts.find(u=>u.key===t.sort.by):void 0,S=t.group?e.groups.find(u=>u.key===t.group.by):void 0,b=O(y),r=e.natural?e.sorts.find(u=>u.key===e.natural.by):void 0,k=o==="filter"||o==="all"&&l.parts?.filter?j(s,i,e):[],w=u=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:"Sort by"}),(0,n.jsx)($,{testId:`${m}-sort-default`,value:"",on:!t.sort,onPress:()=>(a({sort:void 0}),u()),children:r?`As declared (${M(r.label)})`:"As they were added"}),e.sorts.map(g=>(0,n.jsx)($,{value:g.key,on:t.sort?.by===g.key,onPress:()=>(a({sort:{by:g.key,direction:t.sort?.direction??"asc"}}),u()),children:g.label},g.key)),t.sort?(0,n.jsxs)("div",{role:"group","aria-label":"Order","data-testid":`${m}-direction`,children:[(0,n.jsx)("p",{"aria-hidden":"true",children:"Order"}),["asc","desc"].map(g=>(0,n.jsx)($,{testId:`${m}-direction-${g}`,value:g,on:t.sort.direction===g,onPress:()=>(a({sort:{by:t.sort.by,direction:g}}),u()),children:b[g]},g))]}):null]}),c=u=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:"Group by"}),(0,n.jsx)($,{testId:`${m}-group-none`,value:"",on:!t.group,onPress:()=>(a({group:void 0}),u()),children:"Not grouped"}),e.groups.map(g=>(0,n.jsx)($,{value:g.key,on:t.group?.by===g.key,onPress:()=>(a({group:{by:g.key}}),u()),children:g.label},g.key)),t.group&&S?.buckets?(0,n.jsxs)("div",{role:"group","aria-label":"How wide a group is","data-testid":`${m}-bucket`,children:[(0,n.jsx)("p",{"aria-hidden":"true",children:"Each group"}),J.map(g=>(0,n.jsx)($,{testId:`${m}-bucket-${g}`,value:g,on:(t.group.bucket??"day")===g,onPress:()=>(a({group:{by:t.group.by,bucket:g}}),u()),children:`A ${g}`},g))]}):null]}),x=u=>(0,n.jsx)(Q,{sections:k,has:p,testId:m,onToggle:g=>(d(g),u())}),h=l.parts??{sort:!0,group:!0,filter:!0};return(0,n.jsxs)("div",{ref:A,style:{display:"contents"},children:[(0,n.jsx)("style",{children:Z}),o==="sort"?w(v):o==="group"?c(v):o==="filter"?x(v):(0,n.jsxs)(n.Fragment,{children:[h.sort?(0,n.jsx)("div",{role:"group","aria-label":"Sort",children:w(v)}):null,h.group?(0,n.jsx)("div",{role:"group","aria-label":"Group",children:c(v)}):null,h.filter?(0,n.jsx)("div",{role:"group","aria-label":"Filter",children:x(v)}):null]})]})}function $({value:l,on:o,onPress:s,testId:i,children:e}){return(0,n.jsx)("button",{type:"button",className:"graview-arrange-item",value:l,"data-value":l,"aria-pressed":o,onClick:s,...i?{"data-testid":i}:{},children:e})}function Q({sections:l,has:o,testId:s,onToggle:i}){let[e,t]=(0,f.useState)(null),[a,d]=(0,f.useState)(""),[p,v]=(0,f.useState)(()=>new Set(l.length===1?[l[0].key]:[])),[m,A]=(0,f.useState)({});if(e)return(0,n.jsx)(X,{ask:e,testId:s,onDay:r=>i({key:e.key,value:`${e.op}:${r}`}),onCancel:()=>t(null)});let y=r=>(0,n.jsx)($,{value:r.value,on:r.condition?o(r.condition):!1,onPress:()=>r.condition?i(r.condition):t(r.ask),children:r.label},r.value),S=(r,k)=>{let w=(r.typed??[]).filter(h=>o({key:r.key,value:h.id})),c=H(r.typed??[],k),x=[...w,...c.shown.filter(h=>!w.includes(h))];return(0,n.jsxs)(n.Fragment,{children:[x.map(h=>y({value:`${r.key}:${h.id}`,label:h.label,group:r.label,key:r.key,condition:{key:r.key,value:h.id}})),k.trim()&&c.shown.length===0?(0,n.jsx)("span",{className:"graview-arrange-none",children:"None is called that."}):null,c.more>0?(0,n.jsx)("span",{className:"graview-arrange-none",children:`${c.more} more \u2014 type more of the name`}):null]})},b=a.trim().toLocaleLowerCase();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{className:"graview-arrange-find",children:[(0,n.jsx)("span",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:"Find a filter"}),(0,n.jsx)("input",{type:"search","data-testid":`${s}-filter-find`,value:a,placeholder:"Find a filter, a name or a number\u2026",onChange:r=>d(r.target.value)})]}),l.map(r=>{let k=r.entries.filter(c=>c.condition&&o(c.condition)).length+(r.typed??[]).filter(c=>o({key:r.key,value:c.id})).length;if(b){let c=r.label.toLocaleLowerCase().includes(b),x=r.atNumber&&G(b)!==null?r.atNumber(G(b)):[],h=[...x,...c?r.entries:r.entries.filter(g=>g.label.toLocaleLowerCase().includes(b)&&!x.some(W=>W.value===g.value))],u=r.typed?H(r.typed,b):{shown:[],more:0};return h.length===0&&u.shown.length===0?null:(0,n.jsxs)("div",{role:"group","aria-label":r.label,"data-section":r.key,children:[(0,n.jsx)("p",{"aria-hidden":"true",children:r.label}),h.map(y),r.typed?S(r,b):null]},r.key)}if(r.entries.length===0&&!r.typed)return null;let w=p.has(r.key);return(0,n.jsxs)("div",{role:"group","aria-label":r.label,"data-section":r.key,children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-section","data-testid":`${s}-section`,"data-key":r.key,"aria-expanded":w,onClick:()=>v(c=>c.has(r.key)?new Set([...c].filter(x=>x!==r.key)):new Set([...c,r.key])),children:[(0,n.jsx)("span",{children:r.label}),k>0?(0,n.jsx)("span",{className:"graview-arrange-on",children:`${k} on`}):null]}),w?(0,n.jsxs)(n.Fragment,{children:[r.typed?(0,n.jsx)("input",{type:"search",className:"graview-arrange-far","data-testid":`${s}-far-find`,"data-key":r.key,"aria-label":`${r.label}: type a name`,placeholder:`Type a name (${r.typed.length})\u2026`,autoFocus:!0,value:m[r.key]??"",onChange:c=>A({...m,[r.key]:c.target.value})}):null,r.entries.map(y),r.typed?S(r,m[r.key]??""):null]}):null]},r.key)})]})}function X({ask:l,testId:o,onDay:s,onCancel:i}){let[e,t]=(0,f.useState)(""),a=/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number(e.slice(0,4))>=1e3,d=()=>{a&&s(e)};return(0,n.jsxs)("div",{role:"group","aria-label":`${l.label} ${l.op} which day`,"data-testid":`${o}-ask-day`,className:"graview-arrange-ask",children:[(0,n.jsx)("p",{"aria-hidden":"true",children:`${l.label} ${l.op}`}),(0,n.jsx)("input",{type:"date","data-testid":`${o}-day`,"aria-label":`${l.label} ${l.op} which day`,autoFocus:!0,value:e,onChange:p=>t(p.target.value),onKeyDown:p=>{p.key==="Enter"?(p.preventDefault(),d()):p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),p.nativeEvent.stopImmediatePropagation(),i())}}),(0,n.jsxs)("span",{children:[(0,n.jsx)("button",{type:"button","data-testid":`${o}-day-add`,disabled:!a,onClick:d,children:"Add"}),(0,n.jsx)("button",{type:"button",onClick:i,children:"Never mind"})]})]})}var Z=`
|
|
2
|
-
.graview-arrange-list{display:grid;align-content:start;width:min(300px,calc(100vw - 24px));height:auto;max-height:min(70vh,520px);overflow:auto;overscroll-behavior:contain;margin:0;padding:0 6px 6px;border-radius:10px;border:1px solid var(--graview-edge);background:linear-gradient(var(--graview-float),var(--graview-float)),var(--graview-panel);box-shadow:var(--graview-lift-high);color:var(--graview-ink);font-size:.875rem;line-height:1.3}
|
|
3
|
-
.graview-arrange-list>*:first-child:not(.graview-arrange-find){margin-top:6px}
|
|
4
|
-
@media (max-width:519px){.graview-arrange-list{left:0!important;right:0!important;top:auto!important;bottom:0!important;width:100%!important;max-height:min(80dvh,560px)!important;border-radius:14px 14px 0 0;padding-bottom:calc(10px + env(safe-area-inset-bottom))}}
|
|
5
|
-
.graview-arrange-find{position:sticky;top:0;z-index:${E.raised};display:block;margin:0 -6px 2px;padding:6px;background:linear-gradient(var(--graview-float),var(--graview-float)),var(--graview-panel);border-bottom:1px solid var(--graview-edge)}
|
|
6
|
-
.graview-arrange-find input,.graview-arrange-far{box-sizing:border-box;width:100%;min-height:32px;margin:0;padding:0 8px;border:1px solid var(--graview-edge);border-radius:7px;background:var(--graview-panel);font:inherit;color:var(--graview-ink)}
|
|
7
|
-
.graview-arrange-far{width:calc(100% - 16px);margin:2px 8px 4px}
|
|
8
|
-
.graview-arrange-section{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:32px;margin:0;padding:6px 8px;border:0;border-radius:7px;background:none;font:inherit;font-weight:600;text-align:left;color:var(--graview-ink);cursor:pointer}
|
|
9
|
-
.graview-arrange-section::after{content:"";flex:0 0 7px;height:7px;margin-left:auto;border:solid var(--graview-ink-muted);border-width:0 1.5px 1.5px 0;transform:rotate(-45deg)}
|
|
10
|
-
.graview-arrange-section[aria-expanded=true]::after{transform:rotate(45deg)}
|
|
11
|
-
.graview-arrange-section:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
12
|
-
.graview-arrange-on{font-weight:400;color:var(--graview-accent)}
|
|
13
|
-
.graview-arrange-none{display:block;padding:4px 8px 6px 28px;color:var(--graview-ink-muted)}
|
|
14
|
-
.graview-arrange-list [role=group]{display:grid}
|
|
15
|
-
.graview-arrange-list p{margin:8px 8px 2px;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--graview-ink-muted)}
|
|
16
|
-
.graview-arrange-item{display:flex;align-items:flex-start;gap:8px;width:100%;min-height:30px;margin:0;padding:6px 8px;border:0;border-radius:7px;background:none;font:inherit;text-align:left;color:var(--graview-ink);cursor:pointer;overflow-wrap:anywhere}
|
|
17
|
-
.graview-arrange-item::before{content:"";flex:0 0 12px}
|
|
18
|
-
.graview-arrange-item[aria-pressed=true]{font-weight:600}
|
|
19
|
-
.graview-arrange-item[aria-pressed=true]::before{content:"\u2713";color:var(--graview-accent)}
|
|
20
|
-
.graview-arrange-item:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
21
|
-
.graview-arrange-ask{display:grid;gap:8px;padding:0 8px 8px}
|
|
22
|
-
.graview-arrange-ask p{margin:8px 0 0}
|
|
23
|
-
.graview-arrange-ask input{box-sizing:border-box;width:100%;min-height:32px;padding:0 8px;border:1px solid var(--graview-edge);border-radius:7px;background:var(--graview-panel);font:inherit;color:var(--graview-ink)}
|
|
24
|
-
.graview-arrange-ask span{display:flex;gap:8px}
|
|
25
|
-
.graview-arrange-ask button{min-height:30px;padding:0 12px;border:1px solid var(--graview-edge);border-radius:7px;background:var(--graview-panel);font:inherit;color:var(--graview-ink);cursor:pointer}
|
|
26
|
-
.graview-arrange-ask button:disabled{opacity:.5;cursor:default}
|
|
27
|
-
`;function se({offers:l,chips:o,schema:s,graph:i,kind:e,arrangement:t,has:a,choose:d,testId:p}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("style",{children:re}),(0,n.jsx)(ee,{offers:l,chips:o,schema:s,graph:i,kind:e,arrangement:t,has:a,choose:d,testId:p})]})}function ee({offers:l,chips:o,schema:s,graph:i,kind:e,arrangement:t,has:a,choose:d,testId:p}){let v={schema:s,graph:i,...o.flagged?{flagged:o.flagged}:{},...o.today?{today:o.today}:{}},m=s.tryDefinition(e),A=o.nodes.filter(y=>!t.query||P(v,y,t.query));return(0,n.jsx)("div",{className:"graview-arrange-chips","data-testid":`${p}-chips`,children:l.map(y=>{let S=(t.filter??[]).filter(r=>r.key!==y.key),b=new Map;for(let r of A){if(!S.every(w=>D(v,r,w)))continue;let k=String(r[y.key]);b.set(k,(b.get(k)??0)+1)}return(0,n.jsxs)("div",{role:"group","aria-label":y.label,className:"graview-arrange-chip-row","data-field":y.key,children:[(0,n.jsx)("span",{className:"graview-arrange-chip-label","aria-hidden":"true",children:y.label}),(y.options??[]).filter(r=>(b.get(r)??0)>0||a({key:y.key,value:r})).map(r=>{let k=C(m,y.key,r),w=b.get(r)??0;return(0,n.jsxs)("button",{type:"button",className:"graview-arrange-chip","data-testid":`${p}-chip`,"data-value":`${y.key}:${r}`,"aria-pressed":a({key:y.key,value:r}),"aria-label":`${y.label}: ${k}, ${w}`,onClick:()=>d(y.key,r),children:[k,(0,n.jsx)("span",{className:"graview-arrange-chip-count","aria-hidden":"true",children:w})]},r)})]},y.key)})})}var re=`
|
|
28
|
-
.graview-arrange-chips,.graview-arrange-chip-row{display:contents}
|
|
29
|
-
@container (max-width:519px){.graview-arrange-chips{display:flex;flex:1 1 10rem;align-items:center;gap:6px;min-width:0;overflow-x:auto;scrollbar-width:none}.graview-arrange-chip-label{margin:0}.graview-arrange-chip{flex:0 0 auto;white-space:nowrap}}
|
|
30
|
-
.graview-arrange-chip-label{margin:0 0 0 8px;font-size:.8125rem;color:var(--graview-ink-muted)}
|
|
31
|
-
.graview-arrange-chip{display:inline-flex;align-items:center;gap:6px;min-height:28px;max-width:100%;box-sizing:border-box;margin:0;padding:0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:var(--graview-panel);font:inherit;font-size:.8125rem;line-height:1.2;color:var(--graview-ink);cursor:pointer;overflow-wrap:anywhere;text-align:left}
|
|
32
|
-
.graview-arrange-chip:hover{border-color:var(--graview-edge-bright,var(--graview-edge))}
|
|
33
|
-
.graview-arrange-chip[aria-pressed=true]{border-color:var(--graview-accent);background:color-mix(in srgb,var(--graview-accent) 12%,var(--graview-panel));font-weight:600}
|
|
34
|
-
.graview-arrange-chip-count{color:var(--graview-ink-muted);font-variant-numeric:tabular-nums;font-weight:400}
|
|
35
|
-
`;export{se as ArrangeChips,le as ArrangeLists,R as FAR_ENDS,z as TYPED_MATCHES,U as filterEntries,j as filterSections,Y as roundSteps,H as typedMatches,G as typedNumber};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as ee}from"./chunk.FQKH67BP.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import{c as Z}from"./chunk.IMRCAU4T.js";import{F as ce,Q as X}from"./chunk.6II4BONS.js";import{X as J,_ as U,ec as j}from"./chunk.F5BCCGFK.js";import{b as _}from"./chunk.AJZBJBMO.js";var B=_(ce(),1);var ue=6;function ne(v,b,h,f,L){let t=new Set(v),o=new Map;for(let r of b)for(let[u,a,S]of[[r.from,r.to,"out"],[r.to,r.from,"in"]]){if(!t.has(u)||t.has(a))continue;let p=h(a);if(p===void 0)continue;let m=`${u}|${r.kind}|${S}|${p}`,k=o.get(m);k?k.others.includes(a)||k.others.push(a):o.set(m,{self:u,edge:r.kind,direction:S,kind:p,others:[a]})}let d=[];for(let r of o.values()){let u=h(r.self)??"",a=Z(L,r.direction==="out"?u:r.kind,r.edge,r.direction),S=r.others.filter(f),p=r.others.filter(m=>!f(m));if(r.others.length>ue){d.push({...r,others:r.others,lands:"district",words:a});continue}for(let m of S)d.push({...r,others:[m],lands:"record",words:a});p.length>0&&d.push({...r,others:p,lands:"district",words:a})}return d}function te(v,b=[]){let h=[...b],f=new Map,L=t=>h.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...v].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&L(o);d++)o.y+=t.height+2;h.push(o),f.set(t.key,{x:o.x,y:o.y})}return f}var s=_(X(),1),ge=4;function we({frame:v,width:b,height:h,stageRef:f,tick:L,store:t,graphVersion:o,selection:d,view:r,rulers:{visibleRect:u,clipQuadratic:a,unsureOf:S,unsureDash:p,unsureOpacity:m}}){let k=n=>t.graph.getNode(n)?.kind,C=ee(d,r,k),$=C.lens===null&&C.records.length<=ge?C.records:[],re=$.join(`
|
|
2
|
-
`),[c,q]=(0,B.useState)(null);(0,B.useLayoutEffect)(()=>{let n=f.current;if(!r.overview||$.length===0||!n||typeof document>"u"||v.t<1){q(null);return}let g=n.getBoundingClientRect(),R=e=>({x:e.left-g.left,y:e.top-g.top,width:e.width,height:e.height}),N=new Map,oe=$.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),D=e=>{if(N.has(e))return N.get(e);let i=null;for(let y of n.querySelectorAll(`[data-graview-pick="${CSS.escape(e)}"], [data-graview-view="${CSS.escape(e)}"]`))if(!y.closest("[data-graview-offstage], [data-graview-screen]")&&!(!$.includes(e)&&y.closest(oe))&&(i=u(y,n),i))break;if(!i){let y=n.querySelector(`[data-graview-building="${CSS.escape(e)}"]`);y&&(i=R(y.getBoundingClientRect()))}return N.set(e,i),i},T=e=>{let i=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return i?R(i.getBoundingClientRect()):null},ie=ne($,t.graph.allEdges(),k,e=>D(e)!==null,t.schema),K=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let i=u(e,n);i&&K.push(i)}let H=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),E=[],W=new Set($),A=new Set;for(let e of ie){let i=k(e.self),y=D(e.self)??(i?T(i):null),Q=e.lands==="record"?D(e.others[0]):T(e.kind);if(!y||!Q)continue;for(let l of e.others)W.add(l);A.add(e.kind),i&&A.add(i);let x=H(y),w=H(Q),O=Math.hypot(w.x-x.x,w.y-x.y);if(O<6)continue;let V=Math.min(40,O*.12)*(E.length%2===0?1:-1),de={x:(x.x+w.x)/2-(w.y-x.y)/O*V,y:(x.y+w.y)/2+(w.x-x.x)/O*V},Y=a({p0:x,c:de,p1:w},K);if(Y.length===0)continue;let ae=Y.map(l=>`M ${l.p0.x.toFixed(1)} ${l.p0.y.toFixed(1)} Q ${l.c.x.toFixed(1)} ${l.c.y.toFixed(1)} ${l.p1.x.toFixed(1)} ${l.p1.y.toFixed(1)}`).join(" "),le=l=>{let F=t.graph.getNode(l);return F?J(t.schema.tryDefinition(F.kind),F):l},G=e.lands==="record"?`${e.words}: ${le(e.others[0])}`:`${e.words}: ${U(t.schema,e.kind,e.others.length)}`,P=e.others[0],I=e.lands==="record"?S?.(e.edge,e.direction==="out"?e.self:P,e.direction==="out"?P:e.self):void 0;E.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${P}`,link:e,d:ae,end:w,said:I!==void 0?`${G} \xB7 unsure`:G,...I!==void 0?{unsure:I}:{}})}let z=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let i=u(e,n);i&&z.push(i)}let se=te(E.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),z);q({lines:E,labels:se,reached:[...W],districts:[...A]})},[re,r.overview,v,o,L,b,h,f,t]);let M=(0,B.useMemo)(()=>{if(!c)return"";let n=c.reached.map(R=>`[data-graview-building="${CSS.escape(R)}"]`).join(","),g=c.districts.map(R=>`[data-graview-plot="kind:${CSS.escape(R)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",g?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${g})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
|
|
3
|
-
`)},[c]);return!c||c.lines.length===0?M?(0,s.jsx)("style",{children:M}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:M}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":c.lines.length,"aria-hidden":"true",width:b,height:h,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:j.lines},children:c.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:p,strokeOpacity:m}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:j.tieLabels},children:c.lines.map(n=>{let g=c.labels.get(n.key);return g?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:g.x,top:g.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{we as RecordLinks};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as rn,c as on,d as te,e as an,f as re,h as Oe,i as sn,n as dn,q as oe}from"./chunk.AAZFVCSP.js";import{A as pe,B as me,E as ke,Ea as _e,G as Ne,H as Ce,Ha as He,Pb as en,Ra as Ue,Sa as We,V as Ke,Wa as xe,Xa as Je,Z as Ve,Zb as nn,_b as tn,b as je,c as De,d as $e,da as Ie,e as K,g as de,h as L,i as Te,j as Ge,jb as U,k as ce,l as Me,la as we,m as Pe,mb as Ye,o as Le,oa as Ze,p as le,q as he,qb as Qe,ra as qe,ta as Be,v as Fe,vb as Xe,x as ne,xa as be,y as fe,ya as ve}from"./chunk.F5BCCGFK.js";function Dn(e,a){let n=e.brand??{},t=n.accent?tn(n.accent):void 0;t&&!t.ok&&a.push(sn("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${t.why}`,"pick a color further from orange-red, or a darker one"));let l=typeof n.logo=="string"?{src:n.logo}:n.logo,c=n.name??e.name,x=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,S])=>typeof S=="string"&&!/url\(|@import|[;{}<>\\]/i.test(S)).map(([S,I])=>[S,nn(I)])):void 0;return{name:c,schemes:t?.ok?t.schemes:en,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...l?{logo:l.src,logoAlt:l.alt??c}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...x?{typography:x}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function cn(e){let{currency:a,locale:n}=e.brand??{};return{...a?{currency:a}:{},...n?{locale:n}:{}}}var kn=Symbol.for("@graview/core:typed-field"),ln=(e,a)=>(/^(phone|place|duration)$/.test(a)&&(me(e)[kn]=a),e),fn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function pn(e){let a=L().check(K(300),fe(t=>qe(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?a:le(a).check(K(200));return Be(e.description?n.check(pe(e.description)):n,e)}var bn=new WeakMap;function mn(e,a){bn.set(e,a)}var vn=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function un(e,a=vn){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let l of a)t=Re(t,l.where.split("."),l,"",n);return{document:t,respelled:n}}function Re(e,a,n,t,l){if(a.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;l.push(`${t}${n.was}`);let{[n.was]:B,...F}=e;return Object.hasOwn(e,n.now)?F:{...F,[n.now]:B}}if(!V(e))return e;let[c,...x]=a,S=c.endsWith("[]"),I=S?c.slice(0,-2):c,$=e[I],T=$;if(!S)T=Re($,x,n,`${t}${I}.`,l);else if(Array.isArray($)){let B=$.map((F,W)=>Re(F,x,n,`${t}${I}.${W}.`,l));T=B.some((F,W)=>F!==$[W])?B:$}return T===$?e:{...e,[I]:T}}var yn="graview-compiled@1";function xn(e,a){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(a)))?.[0]}var q="id",ue=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function gn(e){let a=Object.entries(e.fields),n=t=>["name","title","label"].find(l=>t.some(([c])=>c===l))??t[0]?.[0];return n(a.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(a.filter(([,t])=>t.type==="string"))}function hn(e,a,n){let t;switch(e.type){case"string":case"place":t=L().check(K(500));break;case"phone":t=L().check(K(40),de(fn,"a phone number"));break;case"text":t=L().check(K(2e4)),e.format&&(me(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let c=e.min??(e.type==="duration"?0:void 0),x=[...e.type==="number"?[]:[Me()],...c===void 0?[]:[De(c)],...e.max===void 0?[]:[je(e.max)],...e.step===void 0?[]:[$e(e.step)]];t=x.length>0?ce().check(...x):ce();break}case"boolean":t=Pe();break;case"date":t=L().check(de(ke,"a date like 2026-10-02"));break;case"datetime":t=L().check(fe(Ne,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Fe(e.options);break;case"list":t=le(e.of==="number"?ce():e.of==="date"?L().check(de(ke)):e.of==="image"||e.of==="file"?we(e.of):L().check(K(500))).check(K(200));break;case"image":case"file":t=we(e.type);break;case"app-link":t=Ze();break;case"url":t=Ge();break;case"email":t=Te();break}let l=e.type==="number"||e.type==="integer";return ln(t,l&&e.format==="duration"?"duration":e.type),e.description&&(t=t.check(pe(e.description))),l&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&Qe(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),a?ne(t):t}var ie=e=>{throw new U(`there is no record "${e}"`,"invalid")},On=(e,a)=>"field"in e?hn(e.field,e.optional,a):"ref"in e?Xe(e.ref):ne(Le()),Rn=new WeakMap;var Ae=(e,a)=>V(a)&&Object.keys(e??{}).length===Object.keys(a).length&&Object.keys(e??{}).every(n=>Object.hasOwn(a,n));function nt(e,a={}){let n=V(e)?e.format:void 0;if(n!==yn)return{ok:!1,findings:[Oe("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${yn}`,"compile the document instead")]};let t=e,l=un(t.document).document,c=l===t.document?t:{...t,document:l},x=V(l)&&typeof l.name=="string"&&V(l.kinds)&&Ae(l.kinds,c.kinds)&&Ae(l.acts,c.acts)&&Ae(l.rules,c.rules)&&Array.isArray(c.edges)&&Array.isArray(c.findings),S={ok:!1,findings:[Oe("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!x)return S;try{return An(c,a)}catch{return S}}function An(e,a={}){let{document:n}=e,t=a.today??Ce,l=new Map(e.edges.map(([g,r])=>[g,r])),c=new Map;for(let[g,r]of Object.entries(n.kinds)){let R=e.kinds[g]?.computed,O=ve(r.edges);c.set(g,{fields:new Set([...Object.keys(r.fields),...O.keys()]),edges:new Map(Object.entries(be(r.edges)).map(([j,G])=>[j,G.cardinality??"many"])),...R?{computed:new Map(R)}:{},...O.size>0?{linked:O}:{}})}e.facts&&c.set(on,{computed:new Map(e.facts)});let x=cn(n),S=new Map,I=Object.entries(n.kinds).map(([g,r])=>{let R={};for(let[o,u]of Object.entries(r.fields))R[o]=hn(u,!u.required,x),u.repeats&&(R[_e(o)]=ne(He()));for(let[o,u]of ve(r.edges))R[o]=ne(pn(u));let{label:O,describe:j,durations:G}=e.kinds[g]??{},M=Object.entries(r.computed??{}).map(([o,u])=>[o,typeof u=="string"?{expr:u}:u]),J=Object.hasOwn(r.fields,"label")&&!r.fields.label.label&&!/\{\s*label\b/.test(r.label??`{${gn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,o])=>o.label).map(([o,u])=>[o,u.label]),...M.filter(([,o])=>o.label).map(([o,u])=>[o,u.label])]),A=Object.keys(_).length>0,f=Object.fromEntries(Object.entries(r.fields).filter(([,o])=>o.default!==void 0).map(([o,u])=>[o,u.default]));S.set(g,f);let D=Object.fromEntries(Object.entries(be(r.edges)).map(([o,{renamedFrom:u,...Z}])=>[o,Z])),z=o=>r[o]?{[o]:r[o]}:{};return Ke(g,{fields:he(R),edges:D,...z("plural"),...z("noun"),...z("description"),...O?{label:o=>oe(O,{node:o,kinds:c,today:t(),money:x})||o.id}:{},...j?{describe:o=>oe(j,{node:o,kinds:c,today:t(),money:x})}:{},...z("lifecycle"),...z("figure"),...z("fieldRoles"),...z("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...M.length>0?{computed:Object.fromEntries(M.map(([o,u])=>[o,G?.includes(o)?{...u,as:"duration"}:r.computed[o]]))}:{},...A||r.glance||r.page?{display:{...A?{labels:_}:{},...r.glance?{glance:[...r.glance]}:{},...r.page?{page:r.page}:{}}}:{},...Object.keys(f).length>0?{defaults:f}:{}})}),$=Ue(I,n.computed);function T(g){return $.tryDefinition(g.kind)?.label?.(g)??g.id}let B=g=>({id:"",kind:g,...S.get(g)}),F=[];for(let[g,r]of Object.entries(n.acts??{})){let R=e.acts[g],{title:O,effects:j,guard:G,refusal:M,destructive:J,idempotent:_,creates:A,connects:f,severs:D,writes:z,writesOther:o,sets:u}=R,Z=new Map(R.args),ae={};for(let[s,b]of Z)ae[s]=On(b,x);let k=[r.on??[]].flat(),N=new Map(R.exprs),P=j.find(s=>"create"in s),Y=(s,b,p,w=null)=>{if(V(s)&&"expr"in s)return re(N.get(s.expr),{graph:p,subject:w,kinds:c,bindings:b,today:t()});let h=ue(s);return h===void 0?typeof s=="string"&&s.startsWith("$$")?s.slice(1):s:h==="now"?new Date().toISOString():h==="today"?t():b[h]},Se=(s,b)=>{if(!P)return"";let p=n.kinds[P.create].fields,w=B(P.create),h=[];for(let[v,ee]of Object.entries(P.set??{})){try{w[v]=Y(ee,s,b)??w[v]}catch{}let Q=ue(ee);Q&&s[Q]!==void 0&&h.push(v)}let C=T(w).trim(),H=h.filter(v=>w[v]!==!1&&p[v].type!=="text"&&!(/[^]{41}/.test(w[v])||/ .*[.!?]$/.test(w[v])&&!/[ .][A-Z]\w{0,3}\.$/.test(w[v]))&&T({...w,[v]:void 0}).trim()===C).map(v=>w[v]===!0?p[v].label??Ve(v):dn(w[v],p[v].format,t(),[],x));return C&&H.length>0?`${C} (${H.join(", ")})`:C};F.push(Ye(g,{input:he(ae),title:O,...r.description?{description:r.description}:{},...r.fromTheOtherEnd?{fromTheOtherEnd:r.fromTheOtherEnd}:{},...Z.has(q)?{subject:{kinds:k.length>0?k:"*",arg:q}}:{},...J?{destructive:!0}:{},..._?{idempotent:!0}:{},...A.length>0?{creates:A}:{},...f.length>0?{connects:f}:{},...D.length>0?{severs:D}:{},writes:z,...Object.keys(o).length>0?{writesOther:o}:{},...Object.keys(u).length>0?{sets:u}:{},describe:(s,b)=>{let p=typeof s[q]=="string"?b.getNode(s[q]):void 0,w=p?T(p):Se(s,b);return w?`${O}: ${w}`:O},apply(s,b){let p=s.graph,w=typeof b[q]=="string"?b[q]:void 0,h=w?p.getNode(w):void 0;if(w&&!h&&ie(w),h&&k.length>0&&!k.includes(h.kind))throw new U(`"${O}" acts on ${k.join(" or ")}, not on ${Ie(h.kind)}`,"invalid");let C={};for(let[i,d]of Object.entries(b))d!==void 0&&(C[i]=d);if(G&&h){let i;try{i=re(G,{graph:p,subject:h,kinds:c,bindings:C,today:t()})}catch(d){throw d instanceof te?new U(`"${O}" could not be judged: ${d.sentence}`):d}if(i!==!0)throw new U(M?oe(M,{node:h,kinds:c,graph:p,bindings:C,today:t(),money:x}):`"${O}" is not allowed for ${T(h)} right now`)}let H=new Map,v=i=>p.has(i)||[...H.values()].includes(i),ee=new Set,Q=i=>{let d=We(i);ee.has(d)||(ee.add(d),s.removeEdge(i))},X=(i,d)=>{let m=ue(i);if(m==="subject")return w;if(m==="me"){let y=s.me;if(y&&n.kinds[p.getNode(y)?.kind]?.people)return y;throw new U(`"${O}" is done as you, and you have no record here`)}if(H.has(m))return H.get(m);try{return Y(i,C,p,d??h??null)}catch(y){throw y instanceof te?new U(`"${O}" could not work out a value: ${y.sentence}`):y}};for(let i of j)if("create"in i){let d=n.kinds[i.create],m=B(i.create);for(let[ge,se]of Object.entries(i.set??{})){let Ee=X(se,void 0);Ee!==void 0&&(m[ge]=Ee)}let y=gn(d),E=s.freshId(String((y&&m[y])??i.create),i.create);s.addNode({...m,id:E}),i.as&&H.set(i.as,E)}else if("connect"in i||"sever"in i){let d="connect"in i?i.connect:i.sever,m=String(X(i.from,void 0)??""),y=String(X(i.to,void 0)??"");if(v(m)||ie(m),v(y)||ie(y),"connect"in i){if(l.get(d)?.cardinality==="one")for(let E of p.out(m,d))E.id!==y&&Q({kind:d,from:m,to:E.id});p.out(m,d).some(E=>E.id===y)||s.addEdge({kind:d,from:m,to:y})}else Q({kind:d,from:m,to:y})}else if("set"in i){let d=String(X(i.target??"$subject",void 0)??""),m=p.getNode(d);!m&&!v(d)&&ie(d);let y={};for(let[E,ge]of Object.entries(i.set)){let se=X(ge,m);se!==void 0&&(y[E]=se)}Object.keys(y).length>0&&s.patchNode(d,y)}else if("remove"in i){let d=String(X(i.remove,void 0)??"");p.has(d)||ie(d),s.removeNode(d)}else if("replace"in i&&h){let d=b.to;for(let m of i.replace){let y=l.get(m)?.from.includes(h.kind)??!0;for(let E of y?p.out(h.id,m):p.in(h.id,m))m===i.keep&&E.id===d||Q(y?{kind:m,from:h.id,to:E.id}:{kind:m,from:E.id,to:h.id})}}}}))}let W=[];for(let[g,r]of Object.entries(n.rules??{})){let{title:R,require:O,when:j,says:G}=e.rules[g],M=r.repairs??[],J=(A,f,D=t(),z)=>{let o=[],u={graph:A,subject:f,kinds:c,today:D,...z?{linked:z}:{},onUnread:k=>o.push(k)},Z;try{if(j&&re(j,u)!==!0)return[];if(Z=re(O,u)===!0,!Z&&o.length>0)throw new te(`it reads ${rn(o[0])}`,0)}catch(k){throw k instanceof an?new Je(k.sentence):k instanceof te?new Error(k.sentence):k}if(Z)return[];let ae=M.flatMap(k=>{let N=n.acts?.[k.act],P={},Y=f&&N?.on&&N.fromTheOtherEnd&&![N.on].flat().includes(f.kind)?xn(e.acts[k.act].args,f.kind):void 0;Y?P[Y]=f.id:f&&(N?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(k.act))&&(P[q]=f.id);for(let[b,p]of Object.entries(k.args??{}))P[b]=ue(p)==="subject"?f?.id:p;let s=(N?e.acts[k.act].args:[]).filter(([b,p])=>p.required&&P[b]===void 0).map(([b])=>b);return[{mutation:k.act,label:k.label??(Y?N.fromTheOtherEnd:N?.title)??k.act.replace(/-/g," "),args:P,...s.length>0?{missing:s}:{}}]});return[{invariant:g,...f?{subjectId:f.id}:{},label:R,message:G?oe(G,{node:f,kinds:c,graph:A,today:D,money:x}):f?`${T(f)}: ${R}`:R,nodeIds:f?[f.id]:[],repairs:ae}]},_={label:R,shape:{over:r.over,require:O,when:j,says:G,declared:n.kinds,money:x,kinds:c,today:t},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...M.length>0?{repairs:M.map(A=>A.act)}:{}};W.push(r.over==="graph"?xe(g,{scope:"graph",..._,evaluate:({graph:A,today:f,context:D})=>J(A,null,f,D?.linked)}):xe(g,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:f,today:D,context:z})=>J(A,f,D,z?.linked)}))}let ze=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ye={name:n.name,schema:$,mutations:F,invariants:W,...ze?{policy:ze}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return mn(ye,n),Rn.set(ye,e),{ok:!0,app:ye,document:n,findings:e.findings,sights:n.policy?.sees,kinds:c}}export{un as a,Dn as b,yn as c,q as d,ue as e,gn as f,nt as g,An as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as re}from"./chunk.ZSSOTIFL.js";import{a as j,b as C,c as J,d as te,e as ne,f as P,g as ie,k as ae,n as oe}from"./chunk.ER5ILWKY.js";import{a as X,b as Z,c as ee}from"./chunk.7YQYWOZR.js";import"./chunk.ACEYGWMO.js";import"./chunk.3PT55HXT.js";import{a as _}from"./chunk.D6RDTUX3.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.P75TPZWT.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import{m as V}from"./chunk.BZ5VLPKB.js";import{F as ge,I as Q,Q as Y,Y as U}from"./chunk.6II4BONS.js";import{$ as N,gc as B}from"./chunk.F5BCCGFK.js";import{b as D}from"./chunk.AJZBJBMO.js";var a=D(ge(),1);var l=D(Y(),1),fe=new Set(["show","go","to","open","the","a","an","me"]),de=o=>o.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,""),O=(o,c)=>{let r=de(o);return c.every(t=>r.includes(t))},se=o=>o&&`${o[0].toLowerCase()}${o.slice(1)}`,I={act:4,show:3,place:3,record:4},he=360,h=12;function Ie({face:o,opening:c,close:r}){let t=_(),{setMenuAt:y}=U(),i=(0,a.useMemo)(()=>c.target??j(c.pointed??{about:[]},e=>t.store.graph.has(e)),[c,t.store]),g=(0,a.useMemo)(()=>te(t.store,i,t.places),[t.store,i,t.places]),[p,v]=(0,a.useState)(""),[b,m]=(0,a.useState)(-1),[s,E]=(0,a.useState)(null),[A,L]=(0,a.useState)(null),T=(0,a.useRef)(null),W=(0,a.useRef)(null),M=(0,a.useId)(),R=(0,a.useRef)(!0),{ghost:z}=Q(t.desk);(0,a.useEffect)(()=>()=>{R.current=!1;let e=t.desk.get().ghost;e?.onCard&&t.desk.setGhost({...e,onCard:!1})},[t.desk]);let $=(0,a.useMemo)(()=>{let e=P(t,i);return J(t.store,i,{principal:t.principal,places:t.places,...e.acts?{acts:e.acts}:{}})},[t,i]),G=(0,a.useMemo)(()=>{let e=C(i);if(e.length===0)return[];let n=new Set($.candidates.flatMap(d=>d.type==="act"?[d.mutation]:[]));return X(t.store,e,{principal:t.principal,...e.length===1?{focus:e[0]}:{}}).affordances.filter(d=>!d.destructive&&n.has(d.mutation))},[t.store,t.principal,i,$]),q=(0,a.useCallback)(()=>{let e=c.returnTo,n=le(T.current,i,o);r(),requestAnimationFrame(()=>{if(e?.isConnected&&!e.closest("[inert]"))return e.focus({preventScroll:!0});let d=(n&&n.tabIndex>=0?n:null)??document.querySelector("[data-graview-page-title]")??document.querySelector("main");d&&d.tabIndex<0&&!d.hasAttribute("tabindex")&&d.setAttribute("tabindex","-1"),d?.focus({preventScroll:!0})})},[c.returnTo,i,o,r]),K=(0,a.useCallback)(e=>{if(e.open.length>0){let n=T.current?.getBoundingClientRect();r(),y({x:n?.left??0,y:n?.top??0,on:e.args.id??C(i)[0],about:C(i)});return}try{ee(t.store,e,{}),Z(t.store,e,{},{author:t.principal}),q()}catch(n){L(n instanceof Error?n.message:String(n))}},[t.store,t.principal,r,q,y,i]),H=(0,a.useCallback)(async e=>{let n=e.trim();if(!n)return;let d=s?.result?.answer?{said:s.said,answer:s.result.answer}:void 0;v(""),m(-1),L(null),E({said:n,result:null});let S=await ne(t.ai,{...P(t,i,n),said:n,...d?{follows:d}:{}});t.desk.record(S.interaction),S.ghost&&S.ghost.proposals.length>0&&t.desk.setGhost({ghost:S.ghost,onCard:!0}),R.current&&E({said:n,result:S})},[s,t,i]),F=(0,a.useRef)(c.asked);(0,a.useEffect)(()=>{let e=F.current;F.current=void 0,e&&H(e)},[]);let k=(0,a.useMemo)(()=>{let e=p.trim();if(!e&&s)return[];let n=de(e).split(/\s+/).filter(f=>f&&!fe.has(f)),d=/^show\b/i.test(e),S=/^(go|open)\b/i.test(e),x=[];if(!d&&!S)for(let f of G.filter(u=>O(u.label,n)).slice(0,I.act))x.push({id:`act:${f.id}`,kind:"act",label:f.label,hint:f.open.length>0?"asks more":"do it",take:()=>K(f)});if(!S){let f=$.candidates.filter(u=>u.type==="panel");for(let u of f.filter(ue=>O(`show ${ue.label}`,n)).slice(0,I.show))x.push({id:u.id,kind:"show",label:`Show ${se(u.label)}`,hint:"a panel",take:()=>{r(),ie(t,{title:u.label,recipe:{...u.panel,title:u.label}})}})}if(!d){for(let f of t.places.filter(u=>O(u.title,n)).slice(0,I.place))x.push({id:`place:${f.as}`,kind:"place",label:`Go to ${f.title}`,take:()=>(r(),t.goTo.place(f.as))});if(n.length>0){let f=re(t.store,e.replace(/^(go to|open)\s+/i,""),{principal:t.principal,from:C(i),limit:I.record}).hits;for(let u of f)u.about==="node"&&x.push({id:`record:${u.id}`,kind:"record",label:u.label,hint:N(t.store.schema,u.kind),take:()=>(r(),t.goTo.record(u.id))})}}return e&&x.push({id:"ask",kind:"ask",label:e,take:()=>void H(e)}),x},[p,G,$,t,i,K,H,r,s]);(0,a.useEffect)(()=>m(p.trim()?0:-1),[p]),(0,a.useLayoutEffect)(()=>{let e=T.current;if(!e)return;if(typeof e.showPopover=="function")try{e.showPopover()}catch{}W.current?.focus({preventScroll:!0});let n=0,d=()=>{me(e,le(e,i,o)),n=requestAnimationFrame(d)};return d(),()=>cancelAnimationFrame(n)},[i,o]),(0,a.useEffect)(()=>{if(s)return;let e=n=>{n.target instanceof Node&&T.current?.contains(n.target)||r()};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[s,r]);let ce=e=>{if(e.key==="ArrowDown"&&k.length>0)e.preventDefault(),m(n=>Math.min(k.length-1,n+1));else if(e.key==="ArrowUp"&&k.length>0)e.preventDefault(),m(n=>Math.max(0,n-1));else if(e.key==="Enter"){e.preventDefault();let n=k[b];n?n.take():p.trim()&&H(p)}},w=s?.result??null,pe=k[b];return(0,l.jsxs)("section",{ref:T,popover:"manual",role:"region","aria-label":s?`Answer about ${g}`:`Ask about ${g}`,"data-testid":"quick-ask","data-quick-ask":s?"answer":"bar","data-quick-ask-face":o,"data-graview-offstage":"","data-graview-overlay":"",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),q())},onMouseDown:e=>e.stopPropagation(),style:ke,children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,l.jsxs)("p",{"data-testid":"quick-ask-about",style:{margin:0,flex:"1 1 auto",minWidth:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},children:["About ",g]}),(0,l.jsx)("button",{type:"button","data-testid":"quick-ask-close","aria-label":"Close",title:"Close",onClick:q,style:we,children:(0,l.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]}),s?(0,l.jsxs)("div",{"data-testid":"quick-answer",style:{display:"grid",gap:8},children:[(0,l.jsxs)("p",{"data-testid":"quick-answer-asked",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",fontStyle:"italic",overflowWrap:"anywhere"},children:["\u201C",s.said,"\u201D"]}),(0,l.jsx)("p",{"data-testid":"quick-answer-text","aria-live":"polite",style:{margin:0,fontSize:"0.9375rem",lineHeight:1.45,color:w?.interaction.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)",overflowWrap:"anywhere"},children:w===null?"Thinking\u2026":w.interaction.outcome==="failed"?w.interaction.failed??"The AI could not answer that here.":w.answer??""}),w&&w.offers.length>0?(0,l.jsx)("ul",{"aria-label":"What acts on it",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:6},children:w.offers.map(e=>(0,l.jsx)("li",{children:(0,l.jsx)("button",{type:"button","data-testid":"quick-answer-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>{ae(t,w,e,r).then(n=>{n&&R.current&&L(n)})},style:ve,children:e.type==="panel"?`Show ${se(e.label)}`:e.type==="place"?`Go to ${e.label}`:e.label})},e.id))}):null,z?.onCard&&z.ghost.interaction===w?.interaction.id?(0,l.jsx)(oe,{placement:"card"}):null]}):null,(0,l.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,l.jsx)("input",{ref:W,type:"text",role:"combobox","data-testid":"quick-ask-input","aria-label":s?`Ask a follow-up about ${g}`:`Ask about ${g}, or go somewhere`,"aria-expanded":k.length>0,"aria-controls":M,"aria-autocomplete":"list",...pe?{"aria-activedescendant":`${M}-${b}`}:{},autoComplete:"off",enterKeyHint:"go",placeholder:s?"Ask a follow-up\u2026":"Ask, or go to\u2026",value:p,readOnly:s!==null&&w===null,"aria-busy":s!==null&&w===null,onChange:e=>v(e.target.value),onKeyDown:ce,style:be}),(0,l.jsx)("div",{id:M,role:"listbox","aria-label":p.trim()?`What \u201C${p.trim()}\u201D finds here`:"What can be done here",hidden:k.length===0,style:{display:k.length===0?"none":"grid",gap:1,maxHeight:280,overflowY:"auto"},children:k.map((e,n)=>(0,l.jsx)("div",{id:`${M}-${n}`,role:"option","aria-selected":n===b,"data-testid":"quick-ask-option","data-quick-ask-kind":e.kind,"data-quick-ask-row":e.id,onMouseEnter:()=>m(n),onMouseDown:d=>d.preventDefault(),onClick:e.take,style:{...ye,background:n===b?"var(--graview-panel-muted)":"transparent",...e.kind==="ask"?{borderTop:"1px solid var(--graview-edge)",marginTop:2}:{}},children:e.kind==="ask"?(0,l.jsxs)("span",{children:["Ask: ",(0,l.jsxs)("span",{style:{fontWeight:600},children:["\u2018",e.label,"\u2019"]})]}):(0,l.jsxs)("span",{children:[e.label,e.hint?(0,l.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.hint]}):null]})},e.id))})]}),A?(0,l.jsx)("p",{role:"alert","data-testid":"quick-ask-refused",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-warn)"},children:A}):null,(0,l.jsx)("span",{style:V,"aria-live":"polite",children:k.length>0&&p.trim()?`${k.length} ${k.length===1?"way":"ways"} to go on`:""})]})}function le(o,c,r){let t=o?.closest("[data-graview-embed]")??document,y=c.on==="list"?[`aggregate:${c.kind}`,`kind:${c.kind}`]:c.on==="lens"&&c.kind?[`aggregate:${c.kind}`]:C(c);for(let i of y)for(let g of t.querySelectorAll(`[data-graview-view="${CSS.escape(i)}"], [data-graview-pick="${CSS.escape(i)}"]`)){if(o?.contains(g))continue;let p=g.getBoundingClientRect();if(p.width>0&&p.height>0)return g}return r==="pages"?t.querySelector("main [data-graview-page-title]")??t.querySelector("main h1"):null}function me(o,c){let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},t=Math.min(he,r.width-2*h),y=o.getBoundingClientRect().height,i=c?.getBoundingClientRect(),g,p,v,b=A=>Math.max(h,Math.min(A,r.height-y-h));if(i&&i.width>0&&i.bottom>0&&i.top<r.height)if(i.right+h+t<=r.width-h)g=i.right+h,p=b(i.top),v="right";else if(i.left-h-t>=h)g=i.left-h-t,p=b(i.top),v="left";else{g=Math.max(h,Math.min(i.left,r.width-t-h));let A=i.bottom+h;p=A+y<=r.height-h?A:b(i.top-h-y),v=A+y<=r.height-h?"below":"above"}else g=(r.width-t)/2,p=b(72),v="top";let m=o.style,s={left:`${Math.round(g)}px`,top:`${Math.round(p)}px`,width:`${Math.round(t)}px`};m.left!==s.left&&(m.left=s.left),m.top!==s.top&&(m.top=s.top),m.width!==s.width&&(m.width=s.width);let E=c?.getAttribute("data-graview-view")??c?.getAttribute("data-graview-pick")??(c?"page":"");o.getAttribute("data-quick-ask-beside")!==E&&o.setAttribute("data-quick-ask-beside",E),o.getAttribute("data-quick-ask-side")!==v&&o.setAttribute("data-quick-ask-side",v)}var ke={position:"fixed",inset:"auto",margin:0,zIndex:B("popover"),boxSizing:"border-box",display:"grid",gap:10,padding:12,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",maxHeight:"calc(100dvh - 24px)",overflowY:"auto",fontSize:"0.875rem"},we={display:"inline-grid",placeItems:"center",width:28,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,color:"var(--graview-ink-muted)",background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer"},be={boxSizing:"border-box",width:"100%",height:36,padding:"0 10px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8},ye={display:"flex",alignItems:"center",minHeight:30,padding:"4px 8px",borderRadius:6,cursor:"pointer",overflowWrap:"anywhere"},ve={display:"inline-flex",alignItems:"center",minHeight:30,padding:"2px 10px",font:"inherit",fontSize:"0.8125rem",borderRadius:8};export{Ie as QuickAskCard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as m}from"./chunk.2B4WVCVV.js";import{$ as p,X as c,Y as u,Z as f,da as h,ea as l}from"./chunk.F5BCCGFK.js";function A(t,e){let n=t.schema.kinds,r="kind"in e?e.kind:void 0;if(r!==void 0&&!n.includes(r))return`There is no kind "${r}" in this app. Its kinds are: ${n.join(", ")}.`;if(e.on==="act"&&e.act!==void 0&&t.allMutations&&!t.allMutations().some(i=>i.name===e.act))return`There is no act "${e.act}" in this app.`;let o="record"in e?e.record:void 0;if(o!==void 0&&t.graph&&!t.graph.getNode(o))return`No record "${o}" is here to be told about.`;if(o!==void 0&&r!==void 0&&t.graph&&t.graph.getNode(o)?.kind!==r)return`\u201C${o}\u201D is not ${h(r)}.`;if(e.on==="changed"&&e.kind===void 0&&e.record===void 0)return"Say which kind, or which record, to be told about.";if(e.on==="reaches"){if(e.condition.trim()==="")return"Say what it should reach: a condition like done == true.";try{m(e.condition)}catch(i){return`The condition does not read: ${i instanceof Error?i.message:String(i)}.`}}}function a(t,e){let n=t.graph?.getNode(e);return n?c(t.schema.tryDefinition(n.kind),n):e}function g(t,e){let n=t.allMutations?.().find(r=>r.name===e);return n?u(n):f(e)}function M(t,e){let{when:n}=e,r=e.alsoMine?"anyone":"someone else",o=d=>l(t.schema.tryDefinition(d),d),i=d=>{let s=o(d);return`${/^[aeiou]/i.test(s)?"an":"a"} ${s}`};switch(n.on){case"act":{let d=n.act!==void 0?`\u201C${g(t,n.act)}\u201D`:"an act";return`When ${r} runs ${d}${n.record!==void 0?` on \u201C${a(t,n.record)}\u201D`:""}`}case"created":return`When ${r} adds ${i(n.kind)}`;case"changed":return n.record!==void 0?`When ${r} changes \u201C${a(t,n.record)}\u201D`:`When ${r} changes any of the ${p(t.schema,n.kind)}`;case"reaches":return`When ${n.record!==void 0?`\u201C${a(t,n.record)}\u201D`:i(n.kind)} reaches ${n.condition}${e.alsoMine?"":" (by someone else)"}`}}export{A as a,M as b};
|
|
@@ -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{q as Te}from"./chunk.ZSSOTIFL.js";import{a as xe}from"./chunk.7YQYWOZR.js";import{f as V}from"./chunk.3PT55HXT.js";import{c as Oe,d as Re,e as _e}from"./chunk.272ZJXQP.js";import{a as P}from"./chunk.EBLKEQ7O.js";import{a as ve,b as U,d as Ae}from"./chunk.GZLYTPE7.js";import{a as me}from"./chunk.IMRCAU4T.js";import{Ca as ue,Da as fe,Ga as pe,Ma as H,Pa as he,Y as W,a as se,kb as ye,na as de,nb as ge,ob as be,qa as B,rb as we,sa as ce,ua as le,ub as Se,uc as ke,va as C,xb as L}from"./chunk.F5BCCGFK.js";var $=(t,n,e)=>{(t[n]===void 0||e>t[n])&&(t[n]=e)},J=(t,n,e)=>{(t[n]===void 0||e<t[n])&&(t[n]=e)},G=(t,n)=>{t.format=n,n.includes("int")&&(t.isInt=!0)},Me=(t,n)=>{t.mime=t.mime?t.mime.filter(e=>n.includes(e)):[...n]},Ne=(t,n)=>{t.multipleOf??=[],t.multipleOf.includes(n)||t.multipleOf.push(n)},$e=(t,n)=>(t.patterns??=new Set).add(n),Ke={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 D(t){let n={},{def:e,bag:r}=t._zod,i=t._zod.traits.has("$ZodCheck")?[t,...e.checks??[]]:e.checks??[];for(let o of i){let a=o._zod.def;switch(a.check){case"greater_than":$(n,a.inclusive?"minimum":"exclusiveMinimum",a.value);break;case"less_than":J(n,a.inclusive?"maximum":"exclusiveMaximum",a.value);break;case"multiple_of":Ne(n,a.value);break;case"number_format":{G(n,a.format);let l=Ke[a.format];l&&($(n,"minimum",l[0]),J(n,"maximum",l[1]));break}case"bigint_format":G(n,a.format);break;case"min_length":case"min_size":$(n,"minimum",a.minimum);break;case"max_length":case"max_size":J(n,"maximum",a.maximum);break;case"length_equals":$(n,"minimum",a.length),J(n,"maximum",a.length);break;case"size_equals":$(n,"minimum",a.size),J(n,"maximum",a.size);break;case"string_format":G(n,a.format),a.pattern&&$e(n,a.pattern),(a.format==="base64"||a.format==="base64url")&&(n.contentEncoding=a.format),(a.local||a.precision===-1)&&(n.laxFormat=!0);break;case"mime_type":Me(n,a.mime);break}}r.minimum!==void 0&&$(n,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&$(n,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&J(n,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&J(n,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&Ne(n,r.multipleOf),r.format!==void 0&&(n.format??=r.format,r.format.includes("int")&&(n.isInt=!0)),r.mime&&Me(n,r.mime);for(let o of r.patterns??[])$e(n,o);return n}var Ze={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function z(t){let n=t._zod.def;return n.type==="pipe"&&n.in._zod.traits.has("$ZodTransform")?z(n.out):n.type==="catch"?z(n.innerType):t._zod.optin}var Ye=new Set(["promise","optional","nonoptional","nullable","readonly","default","prefault","catch"]);function A(t,n=new Set){if(n.has(t))return!1;n.add(t);let e=t._zod.def,r=e.type;return r==="transform"?!0:r==="array"?A(e.element,n):r==="set"?A(e.valueType,n):r==="lazy"?A(e.getter(),n):Ye.has(r)?A(e.innerType,n):r==="intersection"?A(e.left,n)||A(e.right,n):r==="record"||r==="map"?A(e.keyType,n)||A(e.valueType,n):r==="pipe"?t._zod.traits.has("$ZodCodec")||A(e.in,n)||A(e.out,n):r==="object"?Object.values(e.shape).some(i=>A(i,n)):r==="union"?e.options.some(i=>A(i,n)):r==="tuple"?e.items.some(i=>A(i,n))||(e.rest?A(e.rest,n):!1):!1}function Xe(t){let n=Object.values(t).filter(e=>typeof e=="number");return Object.entries(t).filter(([e])=>n.indexOf(+e)===-1).map(([,e])=>e)}function De(t){let n=t.anyOf;if(!Array.isArray(n)||n.length===0||t.type!==void 0)return;let e=[];for(let r of n){if(!r||typeof r!="object")return;De(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;e.includes(o)||e.push(o)}}delete t.anyOf,t.type=e.length===1?e[0]:e}var Ee=new Set(["type","properties","required","additionalProperties"]),Je=t=>{let n=t.additionalProperties;return n&&typeof n=="object"&&Object.keys(n).length?n:null},Pe=(t,n)=>JSON.stringify(t)===JSON.stringify(n);function K(t){for(let i of t){if(typeof i!="object"||i.type!=="object")return null;for(let o in i)if(!Ee.has(o))return null}let n={},e=new Set;for(let i of t){for(let o in i.properties){if(Object.prototype.hasOwnProperty.call(n,o))continue;let a=[];for(let l of t){let s=l.properties?.[o]??Je(l);s&&!a.some(b=>Pe(b,s))&&a.push(s)}n[o]=a.length===1?a[0]:K(a)??{allOf:a}}for(let o of i.required??[])e.add(o)}let r={type:"object",properties:n};if(e.size&&(r.required=[...e]),t.every(i=>i.additionalProperties===!1))r.additionalProperties=!1;else{let i=[];for(let o of t){let a=Je(o);a&&!i.some(l=>Pe(l,a))&&i.push(a)}i.length===1?r.additionalProperties=i[0]:i.length>1&&(r.additionalProperties={allOf:i})}return r}function Qe(t){let n=t.allOf;if(!Array.isArray(n)||n.length<2)return;for(let i of Ee)if(i in t)return;let e=n.filter(i=>Array.isArray(i.oneOf)||Array.isArray(i.anyOf)),r;if(!e.length)r=K(n);else{let i=e[0],o=Array.isArray(i.oneOf)?"oneOf":"anyOf";if(Object.keys(i).length!==1)return;let a=n.filter(s=>s!==i),l=i[o].map(s=>K([...a,s]));if(l.some(s=>!s))return;r={[o]:l}}r&&(delete t.allOf,Object.assign(t,r))}function ze(t){let n=t;for(let u of["anyOf","oneOf"]){let f=n[u];if(!Array.isArray(f))continue;let w=f.map(ze);w.some((y,d)=>y!==f[d])&&(n={...n,[u]:w})}let e=[n.type].flat(),r=!e.includes("string")&&e.some(u=>u==="number"||u==="integer"),i=n.enum??(n.const!==void 0?[n.const]:void 0);if(!r&&!i?.some(u=>typeof u=="number"))return n;let{minimum:o,maximum:a,exclusiveMinimum:l,exclusiveMaximum:s,multipleOf:b,format:p,id:S,...h}=n;return h.enum?h.enum=h.enum.map(u=>typeof u=="number"?String(u):u):typeof h.const=="number"&&(h.const=String(h.const)),r&&(h.type="string",i||(h.pattern=e.includes("number")?"^-?\\d+(?:\\.\\d+)?$":"^-?\\d+$")),h}var q=class{constructor(n,e){this.override=n;this.refs=e}done=new Map;path=[];cyclic=new Map;write(n,e=!1){let r=this.refs.get(n);if(r!==void 0&&!e)return{$ref:r};if(this.path.includes(n))return this.cyclic.has(n)||this.cyclic.set(n,""),{};let i=this.done.get(n);if(i)return i;this.path.push(n);try{let o=this.written(n);return this.done.set(n,o),o}finally{this.path.pop()}}written(n){let e={},r,i=n._zod.toJSONSchema?.();i?Object.assign(e,i):r=this.process(n,e);let o=se.get(n);if(o)for(let l of Object.keys(o))e[l]=o[l];A(n)&&(delete e.examples,delete e.default),"_prefault"in e&&(e.default??=e._prefault,delete e._prefault);let a=e;if(r){let l=this.write(r);a={...e};for(let s of Object.keys(l))s in e||(a[s]=l[s])}return this.override({zodSchema:n,jsonSchema:a}),De(a),n._zod.def.type==="intersection"&&Qe(a),a}process(n,e){let r=n._zod.def;switch(r.type){case"string":{e.type="string";let{minimum:i,maximum:o,format:a,patterns:l,contentEncoding:s,laxFormat:b}=D(n);if(typeof i=="number"&&(e.minLength=i),typeof o=="number"&&(e.maxLength=o),a&&(e.format=Ze[a]??a,(e.format===""||a==="time"||b)&&delete e.format),s&&(e.contentEncoding=s),l&&l.size>0){let p=[...l];p.length===1?e.pattern=p[0].source:e.allOf=p.map(S=>({pattern:S.source}))}return}case"number":{let{minimum:i,maximum:o,multipleOf:a,exclusiveMinimum:l,exclusiveMaximum:s,isInt:b}=D(n);if(e.type=b?"integer":"number",typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY)?e.exclusiveMinimum=l:typeof i=="number"&&(e.minimum=i),typeof s=="number"&&s<=(o??Number.POSITIVE_INFINITY)?e.exclusiveMaximum=s:typeof o=="number"&&(e.maximum=o),a){let[p,...S]=new Set(a.filter(h=>Number.isFinite(h)&&h!==0).map(Math.abs));p!==void 0&&(e.multipleOf=p),S.length&&(e.allOf=[...e.allOf??[],...S.map(h=>({multipleOf:h}))])}return}case"boolean":case"success":e.type="boolean";return;case"null":e.type="null";return;case"never":e.not={};return;case"enum":{let i=Xe(r.entries);i.length===0?e.not={}:(i.every(o=>typeof o=="number")&&(e.type="number"),i.every(o=>typeof o=="string")&&(e.type="string"),e.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)e.not={};else if(i.length===1)e.type=i[0]===null?"null":typeof i[0],e.const=i[0];else if(i.length>1){for(let o of["number","string","boolean"])i.every(a=>typeof a===o)&&(e.type=o);i.every(o=>o===null)&&(e.type="null"),e.enum=i}return}case"template_literal":e.type="string",e.pattern=n._zod.pattern.source;return;case"file":{e.type="string",e.format="binary",e.contentEncoding="binary";let{minimum:i,maximum:o,mime:a}=D(n);i!==void 0&&(e.minLength=i),o!==void 0&&(e.maxLength=o),a&&(a.length===0?e.not={}:a.length===1?e.contentMediaType=a[0]:e.anyOf=a.map(l=>({contentMediaType:l})));return}case"array":{let{minimum:i,maximum:o}=D(n);typeof i=="number"&&(e.minItems=i),typeof o=="number"&&(e.maxItems=o),e.type="array",e.items=this.write(r.element);return}case"object":{let i=r.shape;e.type="object";let o={};e.properties=o;for(let l in i)Object.defineProperty(o,l,{value:this.write(i[l]),writable:!0,enumerable:!0,configurable:!0});let a=Object.keys(i).filter(l=>z(i[l])===void 0);a.length>0&&(e.required=a),r.catchall?._zod.def.type==="never"?e.additionalProperties=!1:r.catchall&&(e.additionalProperties=this.write(r.catchall));return}case"union":e[r.inclusive===!1?"oneOf":"anyOf"]=r.options.map(i=>this.write(i));return;case"intersection":{let i=l=>"allOf"in l&&Object.keys(l).length===1,o=this.write(r.left),a=this.write(r.right);e.allOf=[...i(o)?o.allOf:[o],...i(a)?a.allOf:[a]];return}case"tuple":{let i=r.items;e.type="array",e.prefixItems=i.map(s=>this.write(s)),r.rest?e.items=this.write(r.rest):e.items=!1;let o=i.length;for(;o>0&&z(i[o-1])!==void 0;)o-=1;o>0&&(e.minItems=o),r.rest||(e.maxItems=i.length);let{minimum:a,maximum:l}=D(n);typeof a=="number"&&(e.minItems=a),typeof l=="number"&&(e.maxItems=l);return}case"record":{let i=r.keyType;e.type="object";let o=D(i).patterns;if(r.mode==="loose"&&o&&o.size>0){let l=this.write(r.valueType),s={};for(let b of o)s[b.source]=l;e.patternProperties=s}else e.propertyNames=ze(this.write(i)),e.additionalProperties=this.write(r.valueType);let a=i._zod.values;if(a&&!r.partial&&z(r.valueType)===void 0){let l=[...a].filter(s=>typeof s=="string"||typeof s=="number");l.length>0&&(e.required=l.map(String))}return}case"nullable":e.anyOf=[this.write(r.innerType),{type:"null"}];return;case"default":case"prefault":{let i=r.defaultValue,o,a=!1,l=JSON.stringify(i,(s,b)=>typeof b=="bigint"?(a=!0,null):b);return!a&&l!==void 0&&(o=JSON.parse(l)),a||(e[r.type==="default"?"default":"_prefault"]=o),r.innerType}case"catch":{try{e.default=r.catchValue(void 0)}catch{}return r.innerType}case"readonly":return e.readOnly=!0,r.innerType;case"pipe":return r.in._zod.traits.has("$ZodTransform")?r.out:r.in;case"lazy":return n._zod.innerType;case"optional":case"nonoptional":case"promise":return r.innerType;default:return}}};function Ie(t,n=()=>{}){let e=t,r=new q(n,new Map),i=r.write(e,!0);if(r.cyclic.size>0){let o=new Map,a=0,l=[];for(let b of r.cyclic.keys())if(b===e)o.set(b,"#");else{let p=`__schema${a++}`;o.set(b,`#/$defs/${p}`),l.push([b,p])}r=new q(n,o),i=r.write(e,!0);let s={};for(let[b,p]of l)s[p]=r.write(b,!0);l.length>0&&(i={...i,$defs:s})}return JSON.parse(JSON.stringify({$schema:"https://json-schema.org/draft/2020-12/schema",...i}))}function je(t){return Ie(t,tn)}var en={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"},nn={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 tn(t){de(t.zodSchema)&&(t.jsonSchema["x-graview-app-link"]=!0);let n=le(t.zodSchema);if(n&&(t.jsonSchema.type==="string"||t.jsonSchema.type==="array")){t.jsonSchema["x-graview-linked"]={address:n.address,kinds:[...n.kinds],cardinality:n.cardinality};let s=n.kinds.join(" or "),b=`${n.cardinality==="many"?"Records":"A record"}: a ${s} in the app ${n.address}, as "${n.kinds[0]}:<id>" \u2014 an id found there with find_linked. Linking never changes that app.`,p=t.jsonSchema.description;typeof p=="string"&&p.includes(b)||(t.jsonSchema.description=`${typeof p=="string"&&p?`${p.replace(/\.?$/,".")} `:""}${b}`)}if(pe(t.zodSchema)&&(t.jsonSchema["x-graview-repeat"]=!0,!t.jsonSchema.type&&!t.jsonSchema.anyOf&&!t.jsonSchema.oneOf&&Object.assign(t.jsonSchema,rn())),me(t.zodSchema)){t.jsonSchema.contentMediaType="text/markdown";let s=t.jsonSchema.description;typeof s=="string"&&s.endsWith("Written in Markdown.")||(t.jsonSchema.description=`${typeof s=="string"&&s?`${s.replace(/\.?$/,".")} `:""}Written in Markdown.`)}let e=Se(t.zodSchema);if(e){let s=t.jsonSchema;s["x-graview-type"]=e,e==="duration"&&(s["x-graview-unit"]="minutes"),s.description??=nn[e]}let r=we(t.zodSchema,!1);if(r){let s=ve(r);t.jsonSchema["x-graview-format"]=s.format??"unit",s.currency&&(t.jsonSchema["x-graview-currency"]=s.currency),s.unit&&s.format!=="money"&&(t.jsonSchema["x-graview-unit"]=s.unit);let b=t.jsonSchema.description;t.jsonSchema.description=typeof b=="string"&&b.length>0?`${b} ${U(s)}`:U(s)}let i=t.zodSchema._zod?.def;if(!i||i.type!=="string"||typeof i.format!="string"||i.format==="regex")return;let o=t.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 l=o.allOf;Array.isArray(l)&&l.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete o.allOf,o.format=en[i.format]??i.format,a.length===1?o.pattern=a[0]:a.length>1&&(o.allOf=a.map(s=>({pattern:s})))}function Z(t){let n=L(t.input),e=je(t.input),r=e.properties??{};if(ge(t)){let i=t.creates.join(" | ");r.id={type:"string",minLength:1,description:`Optional: the id for the ${i} this makes. Refused if the graph already has it; left out, one is minted from the label.`},e.properties=r}be(t)&&(e.additionalProperties=!1);for(let i of n){let o=r[i.name];if(!o)continue;let a=i.kinds.includes("*")?"any node kind":i.kinds.join(" | ");o.description=[o.description,`Id of a node (${a}).`].filter(Boolean).join(" ")}return{name:t.name,...t.title===void 0?{}:{title:t.title},description:t.description??t.title??t.name,inputSchema:e,nodeRefs:n}}function rn(){let t={type:"string",pattern:"^\\d{4}-\\d{2}-\\d{2}$"},n=(e,r)=>({type:"integer",minimum:e,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:[...fe]},interval:n(1,99),on:{type:"array",minItems:1,maxItems:31,items:{anyOf:[{type:"string",enum:[...ue]},n(-1,31)]}},until:t,count:n(1,1e3),except:{type:"array",maxItems:500,items:t},continues:{type:"string",maxLength:200}},required:["every"],additionalProperties:!1}}function He(t){let n=new Set;for(let e=t;e;e=e.onBehalfOf)e.id!==void 0&&n.add(`${e.kind}:${e.id}`);return n}function F(t,n){let e=He(n),r=p=>{if(p.kind==="rule")return!1;let S=He(p);if(S.size===0)return!1;for(let h of S)if(e.has(h))return!1;return!0},i,o=()=>{if(i)return i;i=new Map;for(let p of t.log.live()){if(p.undoes!==void 0)continue;let S=r(p.author)?p.author:void 0;for(let h of p.primitives){h.op==="remove-node"&&i.delete(h.node.id);let u=h.op==="add-node"?h.node.id:h.op==="patch-node"?h.id:void 0;if(u===void 0)continue;let f=h.op==="add-node"?Object.keys(h.node):Object.keys(h.after),w=i.get(u);(h.op==="add-node"||!w)&&i.set(u,w=new Map);for(let y of f)y==="id"||y==="kind"||(S?w.set(y,S):w.delete(y))}}return i},a=t.schema,l=new Map,s=(p,S)=>{let h=`${p}\0${S}`,u=l.get(h);if(u===void 0){let f=a.tryDefinition(p)?.fields?.shape;u=f!==void 0&&S in f&&Ae(f[S]).type==="text",l.set(h,u)}return u},b=p=>t.graph.getNode(p)?.kind;return{prose:s,say:p=>H(p,{graph:t.graph,schema:a}),fieldBy(p,S){let h=b(p);if(!(h===void 0||!s(h,S)))return o().get(p)?.get(S)},recordBy(p){let S=b(p),h=o().get(p);if(S===void 0||!h)return;let u;for(let[f,w]of h)s(S,f)&&(u=w);return u}}}var Y=(t,n,e)=>({untrusted:!0,authoredBy:e.say(n),text:t}),on="the host's ranker";function Le(t,n){return{...t,hits:t.hits.map(e=>{if(e.about!=="node")return e;e.why.by==="meaning"&&e.why.matched!==void 0&&(e={...e,why:{...e.why,matched:{untrusted:!0,authoredBy:on,text:e.why.matched}}});let r=n.recordBy(e.id);if(!r)return e;let i=n.prose(e.kind,e.why.field)?n.fieldBy(e.id,e.why.field):r;return{...e,label:Y(e.label,r,n),...e.apart!==void 0?{apart:Y(e.apart,r,n)}:{},why:i?{...e.why,fragment:Y(e.why.fragment,i,n)}:e.why}})}}var X=(t,n,e)=>({title:t,readOnlyHint:n,destructiveHint:!1,idempotentHint:e,openWorldHint:!1}),an={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:X("Notify me when something happens",!1,!1)},sn={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:X("Stop notifying me",!1,!0)},dn={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:X("What I am notified of",!0,!0)},Q=[an,sn,dn];var j=t=>{let n;return()=>n??=t().catch(e=>{throw n=void 0,e})},cn=j(()=>(__graviewPreload(import.meta.url,["./chunk.IB32NOV5.js","./chunk.ZEW2OOZ5.js","./chunk.VHWUGSFW.js","./chunk.P75TPZWT.js","./chunk.6W7J76TK.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.4Q56V7GS.js"))),ln=()=>(__graviewPreload(import.meta.url,["./chunk.EBLKEQ7O.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.OH5BBE2B.js")).catch(()=>{}),un=async()=>{(await ln())?.judgeWithLines()},I=j(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.VHWUGSFW.js","./chunk.P75TPZWT.js","./chunk.6W7J76TK.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.IMRCAU4T.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.W42P7NOL.js"))),fn=j(()=>(__graviewPreload(import.meta.url,["./chunk.6KMXLUOS.js","./chunk.G4JJXA63.js","./chunk.LA7535VO.js","./chunk.ZEW2OOZ5.js","./chunk.ACEYGWMO.js","./chunk.3PT55HXT.js","./chunk.Q5WEOX3Q.js","./chunk.CRPT3ZT3.js","./chunk.LNNFNJKN.js","./chunk.EBLKEQ7O.js","./chunk.WVUJXDXZ.js","./chunk.VHWUGSFW.js","./chunk.P75TPZWT.js","./chunk.6W7J76TK.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.7G3B5QPH.js"))),pn=j(()=>(__graviewPreload(import.meta.url,["./chunk.GXLAZGYT.js","./chunk.IB32NOV5.js","./chunk.ZEW2OOZ5.js","./chunk.7YQYWOZR.js","./chunk.UT6642FC.js","./chunk.VHWUGSFW.js","./chunk.P75TPZWT.js","./chunk.6W7J76TK.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.OZR5NI4J.js"))),mn=j(()=>(__graviewPreload(import.meta.url,["./chunk.NJ62C2GU.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.DANDYIB5.js"))),hn=t=>t.definitions.some(n=>C(n).size>0),qe=t=>({value:B(t),label:t.label,...t.describe?{describe:t.describe}:{},...t.card?{card:t.card}:{},fields:t.fields,...t.app?{app:t.app}:{}});async function yn(t,n,e,r){let i=String(e.relation??""),[o,a]=i.includes(".")?i.split(".",2):[void 0,i],l=t.schema.definitions.flatMap(y=>[...C(y)].map(([d,c])=>({kind:y.kind,name:d,relation:c}))),s=l.filter(y=>y.name===a&&(o===void 0||y.kind===o));if(s.length!==1){let y=l.map(d=>`${d.kind}.${d.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: ${y}.`}}let{kind:b,name:p,relation:S}=s[0];if(!r)return{ok:!1,error:`This seat cannot read ${S.address}: its host reads no other app's records. Nothing was changed.`};let h={kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u=typeof e.of=="string"?e.of:void 0;if(u!==void 0){let y=t.graph.getNode(u);if(!y||y.kind!==b)return{ok:!1,error:`No ${b} "${u}".`};let d=ce(y[p],S),c=await Promise.all(d.map(m=>Promise.resolve().then(()=>r.resolve(m,h)).catch(()=>null)));return{ok:!0,data:{relation:`${b}.${p}`,app:S.address,records:c.map((m,g)=>m===null?{value:B(d[g]),missing:!0}:"denied"in m?{denied:!0,said:"linked record (no access)"}:qe(m))},reads:[u]}}let f=typeof e.limit=="number"&&e.limit>0?Math.min(e.limit,20):20,w=await Promise.resolve().then(()=>r.find({address:S.address,kinds:S.kinds,query:String(e.query??""),limit:f},h)).catch(()=>[]);return Array.isArray(w)?{ok:!0,data:{relation:`${b}.${p}`,app:S.address,records:w.map(qe),link:`edit-${b} with ${p} set to a record's value`}}:{ok:!0,data:{relation:`${b}.${p}`,app:S.address,denied:!0,said:"linked record (no access)"}}}var R=t=>({title:t,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),Fe={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"]}]},ee={type:"number",description:"Where the page starts; 0 when unsaid."},ie=[{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:Fe},required:["query"],additionalProperties:!1},mutating:!1,annotations:R("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:ee,archived:Fe},additionalProperties:!1},mutating:!1,annotations:R("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:ee},required:["id"],additionalProperties:!1},mutating:!1,annotations:R("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:ee,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:R("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:R("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, 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") or a record's id, 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, or a record's id.`},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:R("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:R("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:R("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}}],Be={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}},re={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"]},oe={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:re,current:re},additionalProperties:!1},mutating:!1,annotations:R("Draw a view")},Ce={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:{...re,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},Ue={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:R("Find a record in another app")};function gn(t,n){return t===void 0?[]:t==="keep"&&!n?[oe,Ce]:[oe]}var bn="An argument that names a record takes its id or its name.",Ve=[...ie.map(t=>t.name),Be.name,oe.name,Ce.name,Ue.name,...Q.map(t=>t.name)],Ge=64;function _(t){let{line:n,...e}=t;return e}function We(t){return{...t,...t.introduces?{introduces:t.introduces.map(_)}:{},...t.resolves?{resolves:t.resolves.map(_)}:{},...t.violationsAfter?{violationsAfter:t.violationsAfter.map(_)}:{}}}function wn(t){let n=t.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return n.length===0&&(n="act"),/^[A-Za-z_]/.test(n)||(n=`act_${n}`),n.slice(0,Ge)}function Sn(t){let n=new Set(Ve),e=new Map;for(let r of t){let i=wn(r),o=i;for(let a=2;n.has(o);a+=1)o=`${i.slice(0,Ge-`_${a}`.length)}_${a}`;n.add(o),e.set(r,o)}return e}function kn(t,n){if(n.size===0)return t;let e=Object.fromEntries(Object.entries(t.properties??{}).filter(([i])=>!n.has(i))),r=(t.required??[]).filter(i=>!n.has(i));return{...t,properties:e,...t.required?{required:r}:{}}}function vn(t,n,e){let r=Z(t),i=W(t),o=r.nodeRefs.length>0?`${r.description}${/[.!?]$/.test(r.description)?"":"."} ${bn}`:r.description;return{name:n,title:i,description:o,inputSchema:kn(r.inputSchema,e),mutating:!0,annotations:{title:i,readOnlyHint:!1,destructiveHint:t.destructive===!0||(t.severs?.length??0)>0,idempotentHint:t.idempotent===!0,openWorldHint:!1},act:t.name}}function ae(t){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(Array.isArray(t))return`[${t.map(ae).join(",")}]`;let n=t;return`{${Object.keys(n).filter(e=>n[e]!==void 0).sort().map(e=>`${JSON.stringify(e)}:${ae(n[e])}`).join(",")}}`}function An(t){return`sha256:${ke(ae(t))}`}function On(t,n,e,r,i,o=!1,a=!1){let l=Sn(t.map(p=>p.name)),s=[...gn(r,e),...o?[Ue]:[],...a?Q:[]];return{definitions:e?[...ie.filter(p=>!p.mutating),...s]:[...ie,Be,...s,...t.filter(p=>n.has(p.name)).map(p=>vn(p,l.get(p.name),i(p)))],names:l}}function st(t,n={}){let e=n.author??{kind:"agent"},r=t.allMutations(),i=new Set(t.permittedMutations(e).map(u=>u.name)),{definitions:o,names:a}=On(r,i,n.readOnly===!0,n.drafts?n.drafts.keep?"keep":"draw":void 0,u=>V(t.schema,t.policy,e,u),hn(t.schema),n.subscriptions!==void 0),l=An(o),s=u=>{if(!Ve.includes(u)){for(let[f,w]of a)if(w===u)return f;return a.has(u)?u:void 0}},b=(u,f)=>{let w=r.find(c=>c.name===u);if(!w)return{args:f,resolved:[]};let y={...f},d=[];for(let c of L(w.input)){let m=y[c.name];if(typeof m!="string"||m.trim()==="")continue;let g=t.resolveRef(c,m,e);if(!g.ok){let k=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}${k}`,argument:c.name,candidates:g.candidates}}g.by!=="id"&&(y[c.name]=g.id,d.push({argument:c.name,given:m,id:g.id,label:g.label}))}return{args:y,resolved:d}},p=async(u,f)=>{try{await un();let w=o.find(d=>d.name===u)??o.find(d=>d.act===u);if(!w){let d=s(u);if(d){let c=t.permits({name:d,args:f},e);if(!c.ok)return{ok:!1,error:c.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${u}". Available: ${o.map(c=>c.name).join(", ")}`}}if(w.mutating&&n.readOnly)return{ok:!1,error:`"${u}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(w.act!==void 0){let d=b(w.act,f);if("ok"in d)return d;let c=P(t,e,t.apply({name:w.act,args:d.args},{...n.author?{author:n.author}:{},...ne(n.via)}));return{ok:!0,data:{batch:c.batch,intent:c.intent,introduces:c.introduces.map(_),resolves:c.resolves.map(_),...d.resolved.length>0?{resolved:d.resolved}:{}},diff:c.diff}}let y=t.seenBy(e);switch(w.name){case"search_graph":{let d=typeof n.places=="function"?n.places():n.places,c=typeof f.subject=="string"?f.subject:void 0,m=Te(y,String(f.query??""),{principal:e,rank:n.near,archived:he(f.archived),limit:typeof f.limit=="number"&&f.limit>0?Math.min(f.limit,20):20,...d?{places:d}:{},...c?{subject:c,from:[c]}:{}}),g=m.later?await m.later:m;return{ok:!0,data:(await I()).searchRead(g,Le(g,F(y,e))),reads:g.hits.flatMap(k=>k.about==="node"?[k.id]:[])}}case"get_graph":return{ok:!0,...(await I()).graphRead(y,F(y,e),f)};case"get_node":{let d=String(f.id??""),c=d,m;if(!y.graph.getNode(d)){let k=d.trim()===""?void 0:t.resolveRef({name:"id",kinds:["*"]},d,e);if(k?.ok)c=k.id,m={argument:"id",given:d,id:c,label:k.label};else return k?.reason==="ambiguous"?{ok:!1,error:k.message,argument:"id",candidates:k.candidates}:{ok:!1,error:`No node "${d}".`}}let g=(await I()).nodeRead(y,F(y,e),c,f);return{ok:!0,data:m?{...g.data,resolved:[m]}:g.data,reads:g.reads}}case"describe_place":{let d=n.app??{name:"",schema:t.schema},c=typeof f.width=="number"&&Number.isFinite(f.width)&&f.width>0?f.width:1440,{describePlace:m}=await cn(),g=m(t,e,String(f.place??""),{app:d,width:c});if(!g.ok)return{ok:!1,error:`${g.error} The places are: ${g.places.join(", ")}.`};let k=new Set,x=E=>{for(let M of E)for(let O of M.groups??[])for(let T of O.items)k.add(T.id),x(T.parts)};return x(g.description.parts),{ok:!0,data:g.description,reads:[...k]}}case"find_linked":return yn(y,e,f,n.linked);case"draft_view":case"keep_lens":{let d=n.app??{name:"",schema:t.schema};return(await fn()).runDraftTool(w.name,f,{app:d,principal:e,...n.drafts?{drafts:n.drafts}:{}})}case"get_violations":{let d=y.violations(f.context);return{ok:!0,...(await I()).violationsRead(d,f)}}case"get_affordances":{let d=f.selection??[];return{ok:!0,data:xe(y,d,{...typeof n.derive=="function"?n.derive():n.derive,...n.author?{principal:n.author}:{},...f.context?{context:f.context}:{}}),reads:d.filter(m=>y.graph.has(m))}}case"preview_mutation":{let d=String(f.mutation),c=s(d)??d,m=b(c,f.args??{});if("ok"in m)return m;let g=t.missingFor({name:c,args:m.args},e);if(g)return{ok:!1,error:g.message,reason:"missing"};let k=P(t,e,t.preview({name:c,args:m.args},void 0,{author:e})),x=We(k);return{ok:!0,data:m.resolved.length>0?{...x,resolved:m.resolved}:x}}case"act_on_several":{let d=String(f.act??""),c=s(d)??d,m=r.find(v=>v.name===c);if(!m||!i.has(c)){let v=m?t.permits({name:c,args:{}},e):void 0;return v&&!v.ok?{ok:!1,error:v.refusal.message,reason:"forbidden"}:{ok:!1,error:`There is no act "${d}" this seat may run. Nothing was changed.`,reason:"invalid"}}let g=m.subject;if(!g)return{ok:!1,error:`"${W(m)}" does not act on a record, so it cannot be run on several. Nothing was changed.`,reason:"invalid"};let k=Array.isArray(f.records)?f.records.filter(v=>typeof v=="string"&&v.trim()!==""):[];if(k.length===0)return{ok:!1,error:"Name at least one record. Nothing was changed.",reason:"invalid"};let x=[],E=[];for(let v of k.slice(0,200)){let N=t.resolveRef({name:g.arg,kinds:g.kinds},v,e);if(!N.ok)return{ok:!1,error:`${N.message} Nothing was changed.`,argument:"records",candidates:N.candidates};x.push(N.id),N.by!=="id"&&E.push({argument:"records",given:v,id:N.id,label:N.label})}let M=b(c,{...f.args??{}});if("ok"in M)return M;let O=(await pn()).actOnSeveral(t,{mutation:c,subject:g.arg,args:M.args},x,{author:e,...ne(n.via)}),T=O.result?P(t,e,O.result):void 0;return{ok:!0,data:{...O.batch?{batch:O.batch,intent:O.intent}:{},applied:O.applied,unchanged:O.unchanged,refused:O.refused.map(v=>({record:v.id,label:v.label,error:v.message,reason:v.reason})),...O.allOrNothing?{keptNone:!0}:{},...T?{introduces:T.introduces.map(_),resolves:T.resolves.map(_)}:{},...E.length>0||M.resolved.length>0?{resolved:[...E,...M.resolved]}:{}},...T?{diff:T.diff}:{}}}case"subscribe":case"unsubscribe":case"list_subscriptions":{let d=await(await mn()).runSubscriptionTool(w.name,f,{store:t,principal:n.subscriber??e,app:n.app?.name??"app",subscriptions:n.subscriptions});return d.ok?{ok:!0,data:d.data}:{ok:!1,error:d.error}}case"list_suggestions":{let d=Oe(t,e).map(c=>{let m=H(c.author,{graph:y.graph,schema:t.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:d},reads:[...new Set(d.flatMap(c=>c.about))]}}case"accept_suggestion":case"decline_suggestion":{let d=String(f.suggestion??""),c={author:e,...ne(n.via)},m=w.name==="accept_suggestion"?Re(t,d,c):_e(t,d,c),g=P(t,e,m);return{ok:!0,data:{batch:g.batch,intent:g.intent,introduces:g.introduces.map(_),resolves:g.resolves.map(_)},diff:g.diff}}case"undo_batch":{let d=String(f.batch),c=f.include??[],m=y.canUndo([d,...c]);if(!m.ok)return{ok:!1,error:m.message};let g=P(t,e,t.undo([d,...c],{...n.author?{author:n.author}:{}}));return{ok:!0,data:We(g),diff:g.diff}}default:return{ok:!1,error:`Unknown tool "${u}".`}}}catch(w){let{reason:y,wouldNeed:d}=ye(w);return{ok:!1,error:w instanceof Error?w.message:String(w),reason:y,...d?{wouldNeed:d}:{}}}},S=new Set,h=u=>{for(let f of S)f(u)};return{definitions:o,hash:l,...n.author?{author:n.author}:{},onDiff(u){return t.subscribe(u)},onCall(u){return S.add(u),()=>S.delete(u)},async call(u,f){let w=(o.find(m=>m.name===u)??o.find(m=>m.act===u))?.mutating??!1,y={name:u,args:f,mutating:w,at:new Date().toISOString()};h({...y,phase:"running"});let d=m=>(h(m.ok?{...y,phase:"ok",...!w&&m.reads?{reads:m.reads}:{}}:{...y,phase:"failed",error:m.error}),m),c=await p(u,f);return d(c.ok&&!w?{...c,data:(await I()).withinReadChars(u,c.data)}:c)}}}function ne(t){let n=typeof t=="function"?t():t;return n?{via:n}:{}}export{ae as a,st as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.BZ5VLPKB.js";import{F as K,N as E,O as j,Q as C,Z as W}from"./chunk.6II4BONS.js";import{L as R,Ma as T,gc as P}from"./chunk.F5BCCGFK.js";import{b as x}from"./chunk.AJZBJBMO.js";function N(a,t){return a.kind==="agent"?"agent":a.kind!=="human"?"app":a.onBehalfOf!==void 0?"person":a.id===void 0||t?.id===void 0||a.id===t.id?"you":"person"}var Y=a=>a.ops.filter(t=>t.withheld!==!0);function z(a,t={}){let r=a.batches().map(e=>{let s=e.ops[0],l=e.ops.at(-1),c=Y(e).length===0;return{seq:l.seq+1,from:s.seq,at:l.at,batch:e.id,maker:c?"person":N(e.author,t.me),author:c?void 0:e.author,said:e.intent,declaration:!1,withheld:c}}),i=[...a.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 i){if(e.seq<a.log.horizon||e.seq>a.log.length)continue;let s=r.findIndex(l=>l.seq===e.seq);if(s>=0&&!r[s].withheld){r[s]={...r[s],declaration:!0,said:e.sentence};continue}r.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?N(e.author,t.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return r.sort((e,s)=>e.seq-s.seq||+(e.batch!==void 0)-+(s.batch!==void 0))}function I(a,t){let r=a.log.all(),i=new Map(r.map(e=>[e.id,e.seq]));return a.batches().filter(e=>!e.undone&&e.ops[0].seq>=t).filter(e=>!e.ops.every(s=>s.undoes!==void 0&&(i.get(s.undoes)??-1)>=t)).map(e=>e.id)}function B(a,t){return a.withheld?"Someone":a.maker==="you"?"you":a.author?T(a.author,t):"the app"}var d=x(K(),1);var o=x(C(),1),_={kind:"human"},G=[1,2,4,8],U=900,q={you:"You",person:"A person",agent:"An agent",app:"The app"},H={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function X(a,t){return[...new Set([t,...a.map(r=>r.seq)])].sort((r,i)=>r-i)}function J(a,t){let r=0;for(let i=0;i<a.length;i++)a[i]<=t&&(r=i);return r}function Q(a,t,r){let i=I(a,t);if(i.length===0)return null;let e=a.canUndo(i);if(!e.ok)return null;let s=new Set(a.permittedMutations(r).map(l=>l.name));return e.ops.every(l=>l.mutation!==null&&s.has(l.mutation.name))?i:null}function oe({face:a}){let t=E(),r=W(),i=r?.principal??_,e=j(t.live,i),s=e.log.length,l=(0,d.useMemo)(()=>z(e,{me:i,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[e,i,t.host,s]),c=(0,d.useMemo)(()=>X(l,e.log.horizon),[l,e]),f=t.past?.seq??s,h=J(c,f),y=c.length-1,k=[...l].reverse().find(n=>n.seq<=f&&n.seq>(c[h-1]??-1))??[...l].reverse().find(n=>n.seq<=f),[g,v]=(0,d.useState)(!1),[w,L]=(0,d.useState)(1),[A,$]=(0,d.useState)(null);(0,d.useEffect)(()=>{if(!g)return;if(h>=y){v(!1);return}let n=setTimeout(()=>t.show(c[h+1]),U/w);return()=>clearTimeout(n)},[g,h,y,w,c,t]);let D=(0,d.useMemo)(()=>t.past?Q(e,f,i):null,[t.past,e,f,i,s]),M=n=>B(n,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),u=t.past?t.past.at?R(t.past.at,r?.locale):"the start":null,S=k?`${M(k)==="you"?"You":M(k)}: ${k.said}`:"Nothing had happened yet",O=(0,d.useRef)(null);(0,d.useLayoutEffect)(()=>{let n=O.current,m=n?.parentElement;if(a!=="scene"||!n||!m)return;let p=()=>m.style.setProperty("--graview-sheet",`${Math.ceil(n.getBoundingClientRect().height)+24}px`);p();let b=typeof ResizeObserver>"u"?null:new ResizeObserver(p);return b?.observe(n),()=>{b?.disconnect(),m.style.removeProperty("--graview-sheet")}},[a]);let V=a==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:P("rail")}:{position:"sticky",top:0,zIndex:P("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,o.jsxs)("section",{ref:O,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...V,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,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,o.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:u?`As of ${u}`:"Now"}),(0,o.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:S}),u?(0,o.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,o.jsx)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:c.slice(1).map((n,m)=>{let p=[...l].reverse().find(F=>F.seq===n),b=y===0?0:(m+1)/y*100;return(0,o.jsx)("span",{"data-graview-tick":n,"data-maker":p.maker,...p.declaration?{"data-declaration":""}:{},title:`${q[p.maker]}: ${p.said}`,style:{position:"absolute",left:`calc(${b}% - 1px)`,bottom:0,width:p.declaration?4:2,height:p.declaration?22:12,borderRadius:2,background:p.declaration?"var(--graview-ink)":H[p.maker],opacity:n<=f?1:.45}},`${n}:${p.batch??"declaration"}`)})}),(0,o.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:y,step:1,value:h,"aria-valuetext":u?`As of ${u}. ${S}`:`Now. ${S}`,onChange:n=>{v(!1),t.show(c[Number(n.currentTarget.value)]??s)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,o.jsx)("button",{type:"button","data-testid":"play","aria-pressed":g,onClick:()=>{!g&&h>=y&&t.show(c[0]),v(!g)},style:{minHeight:28,minWidth:64},children:g?"Pause":"Play"}),(0,o.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,o.jsx)("select",{"data-testid":"speed",value:w,onChange:n=>L(Number(n.currentTarget.value)),style:{minHeight:28},children:G.map(n=>(0,o.jsxs)("option",{value:n,children:[n,"\xD7"]},n))})]}),(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(q).filter(n=>l.some(m=>m.maker===n)).map(n=>(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,o.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:H[n]}}),q[n]]},n))}),(0,o.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[D?(0,o.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{$(null);try{e.undo([...D],{author:i,intent:u?`Restore to ${u}`:"Restore"}),t.show(null)}catch(n){$(n instanceof Error?n.message:String(n))}},style:{minHeight:28},children:"Restore to here"}):null,(0,o.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>t.show(null),style:{minHeight:28},children:"Back to now"})]})]}),A?(0,o.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:A}):null]})}export{oe as Timeline};
|