graview 0.1.34 → 0.1.36
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.3C4RJIJU.js → chunk.272ZJXQP.js} +1 -1
- package/dist/preview/{chunk.ETWVQ3A2.js → chunk.27TLAVRR.js} +1 -1
- package/dist/preview/{chunk.34CYK2DF.js → chunk.2A2DLMT3.js} +1 -1
- package/dist/preview/{chunk.FBY5IUGU.js → chunk.2B4WVCVV.js} +1 -1
- package/dist/preview/{chunk.ZE4CTZQ3.js → chunk.3PT55HXT.js} +1 -1
- package/dist/preview/{chunk.YJCT3DV2.js → chunk.3SM2CHKF.js} +1 -1
- package/dist/preview/{chunk.G64AREGA.js → chunk.3ZIOAPI5.js} +1 -1
- package/dist/preview/{chunk.HCDKSDIS.js → chunk.42WJ6VJZ.js} +1 -1
- package/dist/preview/{chunk.RIW7SQH4.js → chunk.4B73P2WA.js} +1 -1
- package/dist/preview/{chunk.CPW465TM.js → chunk.4GXXD4NG.js} +1 -1
- package/dist/preview/chunk.4Q56V7GS.js +1 -0
- package/dist/preview/{chunk.T2L4NPSB.js → chunk.4STIUIT6.js} +1 -1
- package/dist/preview/chunk.53IKY7UP.js +1 -0
- package/dist/preview/chunk.56BPXB6E.js +1 -0
- package/dist/preview/{chunk.7HPPJVIV.js → chunk.5PU3RWYY.js} +2 -2
- package/dist/preview/chunk.64MJ5FRL.js +1 -0
- package/dist/preview/chunk.6II4BONS.js +25 -0
- package/dist/preview/{chunk.VMGWYCXU.js → chunk.6KMXLUOS.js} +1 -1
- package/dist/preview/{chunk.MWJUZG3C.js → chunk.6QDFBCV4.js} +2 -2
- package/dist/preview/{chunk.IHFNLKXV.js → chunk.6W7J76TK.js} +1 -1
- package/dist/preview/{chunk.ZTFW7RKP.js → chunk.6ZZZBDEG.js} +1 -1
- package/dist/preview/{chunk.VOFUIWAX.js → chunk.7CO7S6QM.js} +1 -1
- package/dist/preview/chunk.7G3B5QPH.js +1 -0
- package/dist/preview/chunk.7TBSVQSH.js +1 -0
- package/dist/preview/{chunk.QVKKXMNK.js → chunk.7YQYWOZR.js} +1 -1
- package/dist/preview/{chunk.4K5QCJFH.js → chunk.AAZFVCSP.js} +1 -1
- package/dist/preview/{chunk.ZSW74NVJ.js → chunk.ACEYGWMO.js} +1 -1
- package/dist/preview/{chunk.HJ56Q6WB.js → chunk.ACXA55GW.js} +1 -1
- package/dist/preview/{chunk.PNVR3CXR.js → chunk.BZ5VLPKB.js} +2 -2
- package/dist/preview/chunk.CE3NOADH.js +1 -0
- package/dist/preview/chunk.CNJENUPC.js +1 -0
- package/dist/preview/{chunk.DMNXYMLC.js → chunk.CRPT3ZT3.js} +1 -1
- package/dist/preview/{chunk.XXMYKBLT.js → chunk.CUCNT7MG.js} +1 -1
- package/dist/preview/{chunk.U5ACEYAN.js → chunk.D6RDTUX3.js} +1 -1
- package/dist/preview/{chunk.UHQD3NTK.js → chunk.DANDYIB5.js} +1 -1
- package/dist/preview/{chunk.UCIQIPBQ.js → chunk.DSP62QYK.js} +1 -1
- package/dist/preview/chunk.E77K6KBX.js +1 -0
- package/dist/preview/{chunk.HPD5ZDZH.js → chunk.EBLKEQ7O.js} +1 -1
- package/dist/preview/{chunk.VSOB2QEK.js → chunk.EDSPYKR4.js} +1 -1
- package/dist/preview/chunk.EQIGKXIG.js +1 -0
- package/dist/preview/{chunk.HWITWOP3.js → chunk.ER5ILWKY.js} +2 -2
- package/dist/preview/{chunk.7VUPKOKC.js → chunk.ET76FISZ.js} +1 -1
- package/dist/preview/{chunk.X7W27IRI.js → chunk.F5BCCGFK.js} +5 -5
- package/dist/preview/{chunk.7X2ZO5BD.js → chunk.FERBNBDE.js} +1 -1
- package/dist/preview/{chunk.FUQVNXLB.js → chunk.FQKH67BP.js} +1 -1
- package/dist/preview/{chunk.577PGFUT.js → chunk.FUR4IHWG.js} +1 -1
- package/dist/preview/chunk.FWBQVPMI.js +1 -0
- package/dist/preview/{chunk.FRS3S7DN.js → chunk.GOCUBIRW.js} +1 -1
- package/dist/preview/{chunk.CNMITOKP.js → chunk.GUDKPK42.js} +1 -1
- package/dist/preview/{chunk.QVUL2FSI.js → chunk.GXLAZGYT.js} +1 -1
- package/dist/preview/{chunk.Z7ZCR4LN.js → chunk.GZLYTPE7.js} +1 -1
- package/dist/preview/{chunk.35KI7XYV.js → chunk.H4T56OXM.js} +1 -1
- package/dist/preview/{chunk.JQDYGI6G.js → chunk.HPX3F7XX.js} +1 -1
- package/dist/preview/{chunk.WYEYYCBH.js → chunk.HZPTBPJY.js} +1 -1
- package/dist/preview/{chunk.PW7YH6JV.js → chunk.IB32NOV5.js} +1 -1
- package/dist/preview/{chunk.FSAHO3LV.js → chunk.IMRCAU4T.js} +1 -1
- package/dist/preview/{chunk.6A62UVAE.js → chunk.ITXIFDQ7.js} +1 -1
- package/dist/preview/{chunk.2YCFK5HU.js → chunk.J3TEJBI5.js} +1 -1
- package/dist/preview/{chunk.7WHWD5YJ.js → chunk.JLXQ6ZLI.js} +1 -1
- package/dist/preview/{chunk.6FBQP336.js → chunk.JZMA2AV7.js} +1 -1
- package/dist/preview/{chunk.B6VI576I.js → chunk.K5NJTE3F.js} +1 -1
- package/dist/preview/{chunk.FCRFQ7ZW.js → chunk.KBJG5SI2.js} +1 -1
- package/dist/preview/{chunk.3H4NVUWV.js → chunk.KU6NIMQX.js} +1 -1
- package/dist/preview/{chunk.LAF6GTBN.js → chunk.LA7535VO.js} +1 -1
- package/dist/preview/{chunk.RN3EZVV4.js → chunk.LMVCWYYG.js} +1 -1
- package/dist/preview/{chunk.2YGQVI6T.js → chunk.LNNFNJKN.js} +1 -1
- package/dist/preview/{chunk.RH45AW2W.js → chunk.M4FQ7SSM.js} +1 -1
- package/dist/preview/{chunk.UA5UYINM.js → chunk.MXJS67W4.js} +1 -1
- package/dist/preview/{chunk.LIIC25G6.js → chunk.NJ62C2GU.js} +1 -1
- package/dist/preview/{chunk.VZHV25JE.js → chunk.NNCTJSD3.js} +1 -1
- package/dist/preview/{chunk.LCFDM7XY.js → chunk.NWYOLGQ3.js} +1 -1
- package/dist/preview/{chunk.DNDHDDM6.js → chunk.O3OALXCI.js} +2 -2
- package/dist/preview/{chunk.ZJX6ZKKM.js → chunk.O6ROFVFD.js} +1 -1
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.OF34OZ4V.js} +1 -1
- package/dist/preview/{chunk.RYEAMM73.js → chunk.OFJH7LDC.js} +1 -1
- package/dist/preview/{chunk.Q7TP4RFE.js → chunk.OH5BBE2B.js} +1 -1
- package/dist/preview/{chunk.CZRX2FDI.js → chunk.OREMUXB5.js} +1 -1
- package/dist/preview/{chunk.AHCI7ZDO.js → chunk.OXZRGP53.js} +1 -1
- package/dist/preview/chunk.OZR5NI4J.js +1 -0
- package/dist/preview/{chunk.PPUAPAWR.js → chunk.P75TPZWT.js} +1 -1
- package/dist/preview/{chunk.WLBXBNNH.js → chunk.PWOVXARZ.js} +1 -1
- package/dist/preview/chunk.Q63RPNUS.js +1 -0
- package/dist/preview/{chunk.XK4FVT2X.js → chunk.QDHUDLJB.js} +1 -1
- package/dist/preview/{chunk.HP3ZEDCD.js → chunk.QEALNWWL.js} +3 -3
- package/dist/preview/{chunk.APNN6BKF.js → chunk.QLMUGC7R.js} +1 -1
- package/dist/preview/{chunk.6VRJII5M.js → chunk.QTITRX5Q.js} +1 -1
- package/dist/preview/{chunk.GMOTRAKJ.js → chunk.R45BF6JV.js} +1 -1
- package/dist/preview/{chunk.F6WYSDSI.js → chunk.R7LRJS6B.js} +2 -2
- package/dist/preview/{chunk.3MWBWSYF.js → chunk.RKHEZ6KZ.js} +1 -1
- package/dist/preview/{chunk.XZYJRNRY.js → chunk.S6GJGTJE.js} +1 -1
- package/dist/preview/{chunk.7MTX33WD.js → chunk.SG23JC6D.js} +1 -1
- package/dist/preview/chunk.SSRP5SBR.js +1 -0
- package/dist/preview/{chunk.T3M4FALL.js → chunk.T2CN7UTZ.js} +2 -2
- package/dist/preview/{chunk.B2WRXGFI.js → chunk.T47DLH5Z.js} +1 -1
- package/dist/preview/{chunk.BU2DSZ2L.js → chunk.TGEF6TMM.js} +1 -1
- package/dist/preview/{chunk.7JNDZWD6.js → chunk.UJR3Y7MP.js} +1 -1
- package/dist/preview/{chunk.52QAIGCD.js → chunk.VHWUGSFW.js} +1 -1
- package/dist/preview/{chunk.6K2HASOH.js → chunk.W42P7NOL.js} +1 -1
- package/dist/preview/{chunk.2UPGH6FT.js → chunk.WGI5G6NM.js} +1 -1
- package/dist/preview/{chunk.VKH3ZPPQ.js → chunk.WHTQHU3M.js} +1 -1
- package/dist/preview/{chunk.6XO4PECH.js → chunk.WJ2TWU2I.js} +1 -1
- package/dist/preview/chunk.WQBDTLPZ.js +1 -0
- package/dist/preview/{chunk.TCSZZAYB.js → chunk.XBTZXWJX.js} +1 -1
- package/dist/preview/{chunk.OMMKD2NU.js → chunk.XRCGADKC.js} +1 -1
- package/dist/preview/{chunk.SIH6RCAI.js → chunk.Y3IJDWNS.js} +1 -1
- package/dist/preview/{chunk.HUKAVTMX.js → chunk.YNE5QR7Q.js} +1 -1
- package/dist/preview/{chunk.5EAQDBBE.js → chunk.ZDNJK2SX.js} +1 -1
- package/dist/preview/{chunk.QU356VB2.js → chunk.ZEW2OOZ5.js} +1 -1
- package/dist/preview/chunk.ZNS3LYJU.js +1 -0
- package/dist/preview/{chunk.YT2CYCVT.js → chunk.ZSSOTIFL.js} +1 -1
- package/dist/preview/{chunk.WAB6ZS2V.js → chunk.ZVMIHXVK.js} +1 -1
- package/dist/preview/{chunk.DUUARGPE.js → chunk.ZWZ5SEXT.js} +1 -1
- package/dist/preview/index.html +42 -42
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.6P7P2AW7.js +0 -1
- package/dist/preview/chunk.E7EQ2VTE.js +0 -1
- package/dist/preview/chunk.GNSAKLP2.js +0 -1
- package/dist/preview/chunk.HH6P4BLT.js +0 -1
- package/dist/preview/chunk.HPEGQN6E.js +0 -1
- package/dist/preview/chunk.JZBBGY4B.js +0 -1
- package/dist/preview/chunk.KA3KI4UA.js +0 -1
- package/dist/preview/chunk.M5HADQPP.js +0 -1
- package/dist/preview/chunk.QPAUQJON.js +0 -1
- package/dist/preview/chunk.SHPXD6FC.js +0 -1
- package/dist/preview/chunk.TPX6AVJL.js +0 -1
- package/dist/preview/chunk.WPCGHGDA.js +0 -1
- package/dist/preview/chunk.YCIX53AR.js +0 -1
- package/dist/preview/chunk.YEYY273R.js +0 -1
- package/dist/preview/chunk.ZFWV4JAJ.js +0 -1
- package/dist/preview/chunk.ZPQKAJRI.js +0 -1
- package/dist/preview/chunk.ZTD2CNC3.js +0 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{A as kr,F as O,Q as b,Y as le,Z as de,a as H,b as Pe,f as Le,ga as Sr,ja as Pr,m as hr,n as br,na as Lr,oa as Tr,pa as Ar,sa as G,t as xr,w as Z,wa as q,xa as N}from"./chunk.ZTD2CNC3.js";import{Bc as ke,Dc as pr,Ec as ur,Fc as X,La as Qe,Lb as Ze,Lc as gr,Mc as fr,Nb as Je,Nc as mr,Ob as se,Oc as wr,Pb as xe,Pc as vr,Qb as er,Qc as Se,Rb as rr,Sb as tr,Tb as nr,Tc as yr,Ub as ar,Wb as ir,X as je,Za as Xe,aa as Ye,ac as or,ba as Ue,cc as sr,fc as lr,gc as dr,yc as cr,zc as Q}from"./chunk.X7W27IRI.js";import{a as qe,b as y}from"./chunk.AJZBJBMO.js";var Nr=qe(S=>{"use strict";var At=O();function Hr(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function V(){}var k={d:{f:V,r:function(){throw Error(Hr(522))},D:V,C:V,L:V,m:V,X:V,S:V,M:V},p:0,findDOMNode:null},Et=Symbol.for("react.portal");function $t(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Et,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}var J=At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function pe(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}S.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k;S.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Hr(299));return $t(r,e,null,t)};S.flushSync=function(r){var e=J.T,t=k.p;try{if(J.T=null,k.p=2,r)return r()}finally{J.T=e,k.p=t,k.d.f()}};S.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,k.d.C(r,e))};S.prefetchDNS=function(r){typeof r=="string"&&k.d.D(r)};S.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=pe(t,e.crossOrigin),i=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?k.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:a}):t==="script"&&k.d.X(r,{crossOrigin:n,integrity:i,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};S.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=pe(e.as,e.crossOrigin);k.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&k.d.M(r)};S.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=pe(t,e.crossOrigin);k.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};S.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=pe(e.as,e.crossOrigin);k.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else k.d.m(r)};S.requestFormReset=function(r){k.d.r(r)};S.unstable_batchedUpdates=function(r,e){return r(e)};S.useFormState=function(r,e,t){return J.H.useFormState(r,e,t)};S.useFormStatus=function(){return J.H.useHostTransitionStatus()};S.version="19.2.8"});var Cr=qe((Qn,Rr)=>{"use strict";function Br(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Br)}catch(r){console.error(r)}}Br(),Rr.exports=Nr()});var Te=y(O(),1),Er=new WeakMap,ce=r=>{let e=Er.get(r);return e||Er.set(r,e={open:null,drawn:0,listeners:new Set}),e},Pt=r=>{for(let e of[...r.listeners])e()},Lt=0;function qn(r,e){let t=ce(r);t.open=e?{...e,at:++Lt}:null,Pt(t)}var $r=r=>e=>{let t=ce(r);return t.listeners.add(e),()=>void t.listeners.delete(e)};function Or(r){let e=()=>r?ce(r).drawn>0:!1;return(0,Te.useSyncExternalStore)(r?$r(r):Tt,e,e)}var Tt=()=>()=>{};function jn(r){let e=()=>ce(r).open;return(0,Te.useSyncExternalStore)($r(r),e,e)}var _=y(O(),1),_r=y(Cr(),1);function Ot(r){let[e,t]=(0,_.useState)(null),[n,i]=(0,_.useState)(null);return(0,_.useLayoutEffect)(()=>{r.current!==n&&i(r.current)}),(0,_.useLayoutEffect)(()=>{if(!n||typeof ResizeObserver>"u")return;let a=()=>Math.round(n.getBoundingClientRect().width);t(a());let o=new ResizeObserver(()=>{let d=a();(0,_r.flushSync)(()=>t(d))});return o.observe(n),()=>o.disconnect()},[n]),e}function Ht(r=!0){let[e,t]=(0,_.useState)();return(0,_.useEffect)(()=>{if(!r)return t(void 0);let n=0,i=()=>t(innerHeight),a=()=>{i(),clearTimeout(n),n=window.setTimeout(i,300)},o=d=>{for(let[p,s]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])p?.[d](s,a)};return o("addEventListener"),i(),()=>{clearTimeout(n),o("removeEventListener")}},[r]),e}var ue={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var C=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.G64AREGA.js","./chunk.XK4FVT2X.js","./chunk.WAB6ZS2V.js","./chunk.3C4RJIJU.js","./chunk.YJCT3DV2.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.UCIQIPBQ.js"))));var w=y(O(),1);var Vr=y(O(),1);var Mr=y(O(),1);function Dr(r){return(0,Mr.useMemo)(()=>r===void 0||r===""?void 0:{__html:r},[r])}var ee=y(b(),1);function Ae({brand:r,size:e=22}){let t=r?.logo,n=t!==void 0&&tr(t)&&nr(t)===null?t:void 0,i=Dr(n),a={display:"inline-flex",flex:"0 0 auto",height:e,color:"var(--graview-accent)"},o=ir(r);if(o)return(0,ee.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...a,alignItems:"center",fontSize:`${e*.86/16}rem`,lineHeight:1},children:o});if(!t||!ar(t))return null;let d=r?.logoAlt??r?.name??"",p=d!==""&&d!==r?.name;return n?(0,ee.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:a,...p?{role:"img","aria-label":d}:{"aria-hidden":!0},dangerouslySetInnerHTML:i}):(0,ee.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:t,alt:p?d:"",style:{...a,width:"auto"}})}function Nt(r){(0,Vr.useEffect)(()=>{if(!r||typeof document>"u")return;let e=[...document.querySelectorAll('link[rel~="icon"]')],t=e.map(i=>i.getAttribute("href")),n;e.length===0&&(n=document.createElement("link"),n.rel="icon",n.setAttribute("data-graview-favicon",""),document.head.appendChild(n),e.push(n));for(let i of e)i.href=r;return()=>{n&&n.remove(),e.forEach((i,a)=>{i!==n&&t[a]!==null&&t[a]!==void 0&&i.setAttribute("href",t[a])})}},[r])}var l=y(b(),1),Bt=C.part((r,e)=>(0,l.jsx)(r.Here,{...e}),{quiet:!0});function Rt(){let r=de(),[e,t]=(0,w.useState)("");return(0,w.useEffect)(()=>r?.store.subscribe((n,i)=>{i.some(a=>a.author.id!==r.principal.id)&&C.load().then(a=>a.sayTheirChange(i,r,t),String)}),[r]),(0,l.jsx)("span",{role:"status",className:"graview-bar-said",children:e})}var Fr="home",Ir="/",z="scene:whole";function Ct(r){let{store:e,principal:t,views:n}=r,i=e.kindsKeptFrom(t),a=e.schema.kinds.filter(g=>!e.modules.disabledKinds.has(g)&&!i.has(g)),o=n?.arrangement?.(),d=n?.places()??[],p=wr(o,e.schema,d),s=mr(e.schema,o,[...e.modules.administered.values()].flatMap(g=>g.kinds??[])),c=(g,P)=>(!e.graph.size.nodes||e.graph.count(g)>0)&&(p?P?p.places.has(`${g}|${P}`):p.kinds.has(g):!s.has(g)),u=[{key:Fr,label:"Home",path:Ir,group:"home",primary:!0}],f=d.filter(g=>a.includes(g.kind)&&g.as!==vr&&!g.hidden),v=new Set(Q(f).map(g=>X(g,d,e.schema).toLowerCase()));for(let g of yr(a,o?.order)){let P=Ye(e.schema,g),R=v.has(P.toLowerCase());u.push({key:`kind:${g}`,label:R?Ue(e.schema,g):P,path:ke(e.schema,g),group:"lists",kind:g,primary:R?!1:c(g)})}for(let g of Q(f)){let P=pr(g.as,ur(g,d)?ke(e.schema,g.kind).slice(1):void 0),R=[g.kind,...g.over??[]].some(K=>a.includes(K)&&c(K,g.as));u.some(K=>K.path===P)||u.push({key:`place:${g.kind}:${g.as}`,label:X(g,d,e.schema),path:P,group:"pictures",kind:g.kind,primary:R})}return a.some(g=>Object.keys(e.schema.tryDefinition(g)?.edges??{}).length>0)&&u.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),u}function _t(r,e){let[t="/",n=""]=e.split("?"),i=r.find(o=>o.path===(n?`${t}?${n}`:t))??r.find(o=>o.path===t);if(i)return i.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return r.find(o=>o.group==="lists"&&o.path===a)?.key??null}var Wr=(0,w.createContext)(null),Mt=()=>(0,w.useContext)(Wr),j=30,zr=48,re=640,Oe=4,Ee=2;function Kr(r){let{widths:e,current:t,room:n,more:i,gap:a=Oe,primary:o,most:d=fr}=r;if(e.length===0||!(n>0)||!(i>0)||e.some(u=>!(u>0)))return null;let p=(u,f)=>u.reduce((v,x)=>v+e[x],0)+a*Math.max(0,u.length-1)+(f?a+i:0),s=(u,f)=>t<0||!u.includes(t)||u.slice(0,f).includes(t)?u.slice(0,f):[...u.filter(v=>v!==t).slice(0,f-1),t].sort((v,x)=>v-x),c=s(e.map((u,f)=>f).filter(u=>o?.[u]!==!1||u===t),d);if(p(c,c.length<e.length)<=n)return c.length>=Ee?c:null;for(let u=c.length-1;u>=Ee;u--){let f=s(c,u);if(p(f,!0)<=n)return f}return null}var Dt=`
|
|
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 kr,F as O,Q as b,Y as le,Z as de,a as H,b as Pe,f as Le,ga as Sr,ja as Pr,m as hr,n as br,na as Lr,oa as Tr,pa as Ar,sa as G,t as xr,w as Z,wa as q,xa as N}from"./chunk.6II4BONS.js";import{Ac as Q,Cc as ke,Ec as pr,Fc as ur,Gc as X,Ma as Qe,Mb as Ze,Mc as gr,Nc as fr,Ob as Je,Oc as mr,Pb as se,Pc as wr,Qb as xe,Qc as vr,Rb as er,Rc as Se,Sb as rr,Tb as tr,Ub as nr,Uc as yr,Vb as ar,X as je,Xb as ir,_a as Xe,aa as Ye,ba as Ue,bc as or,dc as sr,gc as lr,hc as dr,zc as cr}from"./chunk.F5BCCGFK.js";import{a as qe,b as y}from"./chunk.AJZBJBMO.js";var Nr=qe(S=>{"use strict";var At=O();function Hr(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function V(){}var k={d:{f:V,r:function(){throw Error(Hr(522))},D:V,C:V,L:V,m:V,X:V,S:V,M:V},p:0,findDOMNode:null},Et=Symbol.for("react.portal");function $t(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Et,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}var J=At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function pe(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}S.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k;S.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Hr(299));return $t(r,e,null,t)};S.flushSync=function(r){var e=J.T,t=k.p;try{if(J.T=null,k.p=2,r)return r()}finally{J.T=e,k.p=t,k.d.f()}};S.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,k.d.C(r,e))};S.prefetchDNS=function(r){typeof r=="string"&&k.d.D(r)};S.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=pe(t,e.crossOrigin),i=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?k.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:a}):t==="script"&&k.d.X(r,{crossOrigin:n,integrity:i,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};S.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=pe(e.as,e.crossOrigin);k.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&k.d.M(r)};S.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=pe(t,e.crossOrigin);k.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};S.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=pe(e.as,e.crossOrigin);k.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else k.d.m(r)};S.requestFormReset=function(r){k.d.r(r)};S.unstable_batchedUpdates=function(r,e){return r(e)};S.useFormState=function(r,e,t){return J.H.useFormState(r,e,t)};S.useFormStatus=function(){return J.H.useHostTransitionStatus()};S.version="19.2.8"});var Cr=qe((Qn,Rr)=>{"use strict";function Br(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Br)}catch(r){console.error(r)}}Br(),Rr.exports=Nr()});var Te=y(O(),1),Er=new WeakMap,ce=r=>{let e=Er.get(r);return e||Er.set(r,e={open:null,drawn:0,listeners:new Set}),e},Pt=r=>{for(let e of[...r.listeners])e()},Lt=0;function qn(r,e){let t=ce(r);t.open=e?{...e,at:++Lt}:null,Pt(t)}var $r=r=>e=>{let t=ce(r);return t.listeners.add(e),()=>void t.listeners.delete(e)};function Or(r){let e=()=>r?ce(r).drawn>0:!1;return(0,Te.useSyncExternalStore)(r?$r(r):Tt,e,e)}var Tt=()=>()=>{};function jn(r){let e=()=>ce(r).open;return(0,Te.useSyncExternalStore)($r(r),e,e)}var _=y(O(),1),_r=y(Cr(),1);function Ot(r){let[e,t]=(0,_.useState)(null),[n,i]=(0,_.useState)(null);return(0,_.useLayoutEffect)(()=>{r.current!==n&&i(r.current)}),(0,_.useLayoutEffect)(()=>{if(!n||typeof ResizeObserver>"u")return;let a=()=>Math.round(n.getBoundingClientRect().width);t(a());let o=new ResizeObserver(()=>{let d=a();(0,_r.flushSync)(()=>t(d))});return o.observe(n),()=>o.disconnect()},[n]),e}function Ht(r=!0){let[e,t]=(0,_.useState)();return(0,_.useEffect)(()=>{if(!r)return t(void 0);let n=0,i=()=>t(innerHeight),a=()=>{i(),clearTimeout(n),n=window.setTimeout(i,300)},o=d=>{for(let[p,s]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])p?.[d](s,a)};return o("addEventListener"),i(),()=>{clearTimeout(n),o("removeEventListener")}},[r]),e}var ue={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var C=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.3ZIOAPI5.js","./chunk.QDHUDLJB.js","./chunk.ZVMIHXVK.js","./chunk.272ZJXQP.js","./chunk.3SM2CHKF.js","./chunk.CUCNT7MG.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.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.DSP62QYK.js"))));var w=y(O(),1);var Vr=y(O(),1);var Mr=y(O(),1);function Dr(r){return(0,Mr.useMemo)(()=>r===void 0||r===""?void 0:{__html:r},[r])}var ee=y(b(),1);function Ae({brand:r,size:e=22}){let t=r?.logo,n=t!==void 0&&tr(t)&&nr(t)===null?t:void 0,i=Dr(n),a={display:"inline-flex",flex:"0 0 auto",height:e,color:"var(--graview-accent)"},o=ir(r);if(o)return(0,ee.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...a,alignItems:"center",fontSize:`${e*.86/16}rem`,lineHeight:1},children:o});if(!t||!ar(t))return null;let d=r?.logoAlt??r?.name??"",p=d!==""&&d!==r?.name;return n?(0,ee.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:a,...p?{role:"img","aria-label":d}:{"aria-hidden":!0},dangerouslySetInnerHTML:i}):(0,ee.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:t,alt:p?d:"",style:{...a,width:"auto"}})}function Nt(r){(0,Vr.useEffect)(()=>{if(!r||typeof document>"u")return;let e=[...document.querySelectorAll('link[rel~="icon"]')],t=e.map(i=>i.getAttribute("href")),n;e.length===0&&(n=document.createElement("link"),n.rel="icon",n.setAttribute("data-graview-favicon",""),document.head.appendChild(n),e.push(n));for(let i of e)i.href=r;return()=>{n&&n.remove(),e.forEach((i,a)=>{i!==n&&t[a]!==null&&t[a]!==void 0&&i.setAttribute("href",t[a])})}},[r])}var l=y(b(),1),Bt=C.part((r,e)=>(0,l.jsx)(r.Here,{...e}),{quiet:!0});function Rt(){let r=de(),[e,t]=(0,w.useState)("");return(0,w.useEffect)(()=>r?.store.subscribe((n,i)=>{i.some(a=>a.author.id!==r.principal.id)&&C.load().then(a=>a.sayTheirChange(i,r,t),String)}),[r]),(0,l.jsx)("span",{role:"status",className:"graview-bar-said",children:e})}var Fr="home",Ir="/",z="scene:whole";function Ct(r){let{store:e,principal:t,views:n}=r,i=e.kindsKeptFrom(t),a=e.schema.kinds.filter(g=>!e.modules.disabledKinds.has(g)&&!i.has(g)),o=n?.arrangement?.(),d=n?.places()??[],p=wr(o,e.schema,d),s=mr(e.schema,o,[...e.modules.administered.values()].flatMap(g=>g.kinds??[])),c=(g,P)=>(!e.graph.size.nodes||e.graph.count(g)>0)&&(p?P?p.places.has(`${g}|${P}`):p.kinds.has(g):!s.has(g)),u=[{key:Fr,label:"Home",path:Ir,group:"home",primary:!0}],f=d.filter(g=>a.includes(g.kind)&&g.as!==vr&&!g.hidden),v=new Set(Q(f).map(g=>X(g,d,e.schema).toLowerCase()));for(let g of yr(a,o?.order)){let P=Ye(e.schema,g),R=v.has(P.toLowerCase());u.push({key:`kind:${g}`,label:R?Ue(e.schema,g):P,path:ke(e.schema,g),group:"lists",kind:g,primary:R?!1:c(g)})}for(let g of Q(f)){let P=pr(g.as,ur(g,d)?ke(e.schema,g.kind).slice(1):void 0),R=[g.kind,...g.over??[]].some(K=>a.includes(K)&&c(K,g.as));u.some(K=>K.path===P)||u.push({key:`place:${g.kind}:${g.as}`,label:X(g,d,e.schema),path:P,group:"pictures",kind:g.kind,primary:R})}return a.some(g=>Object.keys(e.schema.tryDefinition(g)?.edges??{}).length>0)&&u.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),u}function _t(r,e){let[t="/",n=""]=e.split("?"),i=r.find(o=>o.path===(n?`${t}?${n}`:t))??r.find(o=>o.path===t);if(i)return i.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return r.find(o=>o.group==="lists"&&o.path===a)?.key??null}var Wr=(0,w.createContext)(null),Mt=()=>(0,w.useContext)(Wr),j=30,zr=48,re=640,Oe=4,Ee=2;function Kr(r){let{widths:e,current:t,room:n,more:i,gap:a=Oe,primary:o,most:d=fr}=r;if(e.length===0||!(n>0)||!(i>0)||e.some(u=>!(u>0)))return null;let p=(u,f)=>u.reduce((v,x)=>v+e[x],0)+a*Math.max(0,u.length-1)+(f?a+i:0),s=(u,f)=>t<0||!u.includes(t)||u.slice(0,f).includes(t)?u.slice(0,f):[...u.filter(v=>v!==t).slice(0,f-1),t].sort((v,x)=>v-x),c=s(e.map((u,f)=>f).filter(u=>o?.[u]!==!1||u===t),d);if(p(c,c.length<e.length)<=n)return c.length>=Ee?c:null;for(let u=c.length-1;u>=Ee;u--){let f=s(c,u);if(p(f,!0)<=n)return f}return null}var Dt=`
|
|
2
2
|
.graview-bar{display:block;margin:0;padding:0;container:graview-bar/inline-size;flex:0 0 auto;position:relative;background:var(--graview-bar);border-bottom:1px solid var(--graview-edge);color:var(--graview-ink);font-family:var(--graview-font-body,system-ui)}
|
|
3
3
|
.graview-bar-row{display:flex;flex-wrap:nowrap;align-items:center;gap:16px;height:${zr-1}px;margin:0;padding:0 16px}
|
|
4
4
|
.graview-bar-home,.graview-bar-face,.graview-bar-place,.graview-bar-item,.graview-bar-at{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;margin:0;border:0;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-decoration:none;color:var(--graview-ink);cursor:pointer;text-align:left}
|
|
@@ -325,7 +325,7 @@ code { color: var(--graview-ink-muted); font-size: 0.8125rem; letter-spacing: 0.
|
|
|
325
325
|
@media (prefers-reduced-motion: reduce) {
|
|
326
326
|
${Zr(`${d}:not([data-graview-motion='full'])`,o)}
|
|
327
327
|
}
|
|
328
|
-
${Zr(`${d}[data-graview-motion='reduce']`,o)}`}var F=y(O(),1);var L=y(b(),1);function sn({scheme:r,onScheme:e,profileHref:t,keeping:n,hostActions:i=ln,signature:a=!1}){let{store:o,principal:d,seats:p,people:s}=le(),c=q("profile"),u=c.open,[f,v]=(0,F.useState)(!1);(0,F.useEffect)(()=>pn(ge),[]),u&&!f&&v(!0),(0,F.useEffect)(()=>{u&&ge()},[u]);let x=d.id===void 0?void 0:o.graph.getNode(d.id),g=x===void 0?d.id===void 0?"Nobody in particular":Qe(d,{graph:o.graph,schema:o.schema,seats:p,people:s}):je(o.schema.tryDefinition(x.kind),x);return(0,L.jsxs)("div",{style:{position:"relative"},children:[(0,L.jsx)("button",{type:"button","data-testid":"profile-button",...c.trigger,onClick:c.toggle,onPointerEnter:ge,onFocus:ge,"aria-label":`${g} \u2014 you, your seat and your settings`,title:`${g} \u2014 you, your seat and your settings`,style:{...Y,borderRadius:999},children:(0,L.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:j-4,height:j-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:un(g)})}),(0,L.jsxs)("section",{...c.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!u,style:{...G,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:u?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[f?(0,L.jsx)(F.Suspense,{fallback:null,children:(0,L.jsx)(dn,{part:"top",name:g,me:x,profileHref:t,hostActions:i,close:()=>c.setOpen(!1)})}):null,(0,L.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:fn,children:[(0,L.jsx)("span",{style:gn,children:"Keeping this app"}),n]}),f?(0,L.jsx)(F.Suspense,{fallback:null,children:(0,L.jsx)(cn,{part:"rest",name:g,me:x,scheme:r,onScheme:e,hostActions:i,signature:a,close:()=>c.setOpen(!1)})}):null]})]})}var ln=[],ge=()=>C.prefetch(),dn=C.part((r,e)=>(0,L.jsx)(r.ProfilePane,{...e}),{what:"The rest of your menu"}),cn=C.part((r,e)=>(0,L.jsx)(r.ProfilePane,{...e}),{quiet:!0});function pn(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}function un(r){return(r.trim()[0]??"?").toUpperCase()}var gn={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},fn={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function mn(r){return!(r==="hidden"||r===!1)}var Ne=y(O(),1);var rt="The whole thing",fe=r=>`scene:${r.kind}:${r.as}`;function tt(r){let{view:e}=r,t=r.places.filter(c=>!r.hidden.has(c.kind)),n=Q(t),i=(c,u)=>{if(c===z)return hr(br(u,!0),"view",null);let f=n.find(v=>fe(v)===c);return f?kr(u,f.over?.find(v=>u.focusId===Z(v))??f.kind,f.as):null},a=[{key:z,label:rt,path:`${Se}${Le(i(z,Pe))}`,group:"home"},...n.map(c=>({key:fe(c),label:X(c,t,r.schema),path:`${Se}${Le(i(fe(c),Pe))}`,group:"pictures",kind:c.kind}))],o=e.within?.view,d=c=>e.focusId===Z(c.kind)&&(o===void 0?t.filter(u=>u.kind===c.kind).at(-1)===c:o===c.as),p=t.find(c=>d(c)&&(o!==void 0||!e.overview)),s=p?n.find(c=>cr(c,p)):void 0;return{places:a,current:s?fe(s):z,to:i}}function wn(){let{store:r,views:e,hiddenKinds:t}=le(),{view:n,go:i}=Ar(),a=e.places(),o=(0,Ne.useMemo)(()=>tt({places:a,hidden:t,view:n,schema:r.schema}),[a,t,n,r.schema]),d=(0,Ne.useMemo)(()=>({go:p=>{let s=o.to(p.key,n);s&&i(s)}}),[o,n,i]);return{places:o.places,current:o.current,reach:d}}var T=y(O(),1);var E=y(b(),1),nt=6e3;function vn(){let r=[],e=0,t=new Set,n=new Map,i,a=()=>{for(let s of[...t])s()},o=s=>{if(clearTimeout(n.get(s.id)),n.delete(s.id),s.kind!=="toast")return;let c=(s.actions?.length??0)+(s.action?1:0),u=s.timeout??(c>0?!1:nt);u!==!1&&n.set(s.id,setTimeout(()=>i?.()?o(s):d(s.id),u))},d=s=>{clearTimeout(n.get(s)),n.delete(s),r.some(c=>c.id===s)&&(r=r.filter(c=>c.id!==s),a())},p=s=>{r=r.some(c=>c.id===s.id)?r.map(c=>c.id===s.id?s:c):[...r,s],o(s),a()};return{notify(s){let c=s.id??`notice-${++e}`;return p({...s,id:c,said:++e}),{id:c,dismiss:()=>d(c),update:u=>{let f=r.find(v=>v.id===c);f&&p({...f,...u,id:c,kind:f.kind,said:u.sentence!==void 0&&u.sentence!==f.sentence?++e:f.said})}}},dismiss:d,hold(s){i=s},list:()=>r,subscribe(s){return t.add(s),()=>t.delete(s)}}}function yn({notices:r}){let e=r.reduce((d,p)=>!d||p.said>d.said?p:d,void 0),[t,n]=(0,T.useState)(""),[i,a]=(0,T.useState)(""),o=(0,T.useRef)(0);return(0,T.useEffect)(()=>{if(!e||e.said===o.current)return;o.current=e.said;let d=e.tone==="bad";(d?a:n)("");let p=setTimeout(()=>(d?a:n)(e.sentence),50);return()=>clearTimeout(p)},[e]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ue,children:t}),(0,E.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ue,children:i})]})}var hn=(0,T.createContext)(null);function bn({board:r,anchor:e}){let t=(0,T.useSyncExternalStore)(r.subscribe,r.list,r.list);return(0,T.useEffect)(()=>Sn(Be.prefetch),[]),(0,E.jsxs)(E.Fragment,{children:[t.length>0?(0,E.jsx)(T.Suspense,{fallback:null,children:(0,E.jsx)(kn,{notices:t,anchor:e,board:r})}):null,(0,E.jsx)(yn,{notices:t})]})}var Be=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.UA5UYINM.js")))),xn=()=>Be.load().then(()=>{},()=>{}),kn=Be.part((r,e)=>(0,E.jsx)(r.NoticeStacks,{...e}),{quiet:!0});function Sn(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}var U=y(O(),1);var B=y(b(),1),Pn=C.part((r,e)=>(0,B.jsx)(r.ProblemRows,{...e}),{what:"The problems",as:"li"}),Re=()=>C.prefetch();function Ln({clean:r="All rules hold"}){let e=Tr(),{set:t}=Lr(),n=e.length,[i,a]=(0,U.useState)(!1),o=q("problems",{open:i&&n>0,onOpenChange:a}),d=o.open,p=it(e,r);return(0,U.useEffect)(()=>{if(n===0)return;let s=setTimeout(Re,1500);return()=>clearTimeout(s)},[n>0]),(0,B.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,B.jsxs)("button",{type:"button","data-testid":"standing",...o.trigger,"aria-disabled":n===0?!0:void 0,"aria-label":p,onClick:n===0?void 0:o.toggle,onPointerEnter:n===0?void 0:Re,onFocus:n===0?void 0:Re,title:p,style:{...Y,padding:n===0?0:"0 8px",cursor:n===0?"default":"pointer",color:n===0?"var(--graview-ink-muted)":at(e),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,B.jsx)(ot,{tone:n===0?"var(--graview-good)":at(e)}),n>0?(0,B.jsx)("span",{"aria-hidden":"true",children:n}):null]}),d?(0,B.jsx)("ol",{...o.pane,"data-testid":"problems",style:{...G,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,B.jsx)(U.Suspense,{fallback:null,children:(0,B.jsx)(Pn,{violations:e,pick:s=>{t(s.nodeIds),o.setOpen(!1)}})})}):null]})}function it(r,e){return r.length===0?e:`${Xe(r)} \u2014 open what is broken, and what would fix it`}var at=r=>r.some(e=>e.status==="could-not-judge"||e.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function ot({tone:r}){return(0,B.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:r}})}function Tn(r,e,t=[]){if(r.focusId)return r.focusId;let i=(r.selection??[]).map(xr).find(a=>a!==null)??t.find(a=>e.includes(a))??e[0]??null;return i===null?null:Z(i)}var we=y(b(),1),me=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.T2L4NPSB.js","./chunk.VKH3ZPPQ.js","./chunk.3H4NVUWV.js","./chunk.SIH6RCAI.js","./chunk.RYEAMM73.js","./chunk.7HPPJVIV.js","./chunk.CZRX2FDI.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.YEYY273R.js"))));function An(){return me.load().then(()=>{})}var En=[{cardinality:"one",fidelity:"full",slot:"page"},{cardinality:"one",fidelity:"summary",slot:"card"},{cardinality:"one",fidelity:"glyph",slot:"row"},{cardinality:"many",fidelity:"full"},{cardinality:"many",fidelity:"summary"},{cardinality:"many",fidelity:"glyph"}];function $n({schema:r,specs:e,kind:t,view:n}){let i=me.current.frameworkViews(r,e).lookup(t,{cardinality:n.cardinality,fidelity:n.fidelity});return i?(0,we.jsx)(i,{...n}):null}var On=me.part((r,e)=>(0,we.jsx)($n,{...e}),{what:"This view"});function st(r,e,t){for(let n of e.kinds){let i=t?.[n];for(let a of En){let o=p=>(0,we.jsx)(On,{schema:e,specs:t,kind:n,view:p}),d=a.slot!==void 0&&i?.[a.slot]!==void 0;d&&(o.says=(p,s)=>me.current?.frameworkViews(e,t).lookup(n,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(p,s)),r.register(n,{cardinality:a.cardinality,fidelity:a.fidelity},d?o:Sr(o))}}return r}function Hn(r,e){return st(Pr(r),r,e)}var Ce=y(O(),1);var M=y(b(),1),lt=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.VOFUIWAX.js","./chunk.MWJUZG3C.js","./chunk.F6WYSDSI.js","./chunk.PW7YH6JV.js","./chunk.T2L4NPSB.js","./chunk.VKH3ZPPQ.js","./chunk.3H4NVUWV.js","./chunk.SIH6RCAI.js","./chunk.RYEAMM73.js","./chunk.7HPPJVIV.js","./chunk.ETWVQ3A2.js","./chunk.CZRX2FDI.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.HJCQ6I3S.js","./chunk.DUUARGPE.js","./chunk.FUQVNXLB.js","./chunk.LAF6GTBN.js","./chunk.QU356VB2.js","./chunk.QVKKXMNK.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.UT6642FC.js","./chunk.HPD5ZDZH.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.KA3KI4UA.js"))));function Nn({lens:r,view:e}){let t=lt.current.declaredLensView(r);return(0,M.jsx)(t,{...e})}var Bn=lt.part((r,e)=>(0,M.jsx)(Nn,{...e}),{what:"This picture"});function Rn(r){let e=t=>(0,M.jsx)(Ce.Suspense,{fallback:null,children:(0,M.jsx)(Bn,{lens:r,view:t})});return r.lens==="blocks"&&(e.flows=!0),r.create===!1&&(e.creates=!1),e}var dt=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.T2L4NPSB.js","./chunk.VKH3ZPPQ.js","./chunk.3H4NVUWV.js","./chunk.SIH6RCAI.js","./chunk.RYEAMM73.js","./chunk.7HPPJVIV.js","./chunk.CZRX2FDI.js","./chunk.5EAQDBBE.js","./chunk.YT2CYCVT.js","./chunk.XXMYKBLT.js","./chunk.34CYK2DF.js","./chunk.JZBBGY4B.js","./chunk.WVUJXDXZ.js","./chunk.52QAIGCD.js","./chunk.PPUAPAWR.js","./chunk.IHFNLKXV.js","./chunk.577PGFUT.js","./chunk.FBY5IUGU.js","./chunk.4K5QCJFH.js","./chunk.GZHZLJBF.js","./chunk.WLBXBNNH.js","./chunk.7MTX33WD.js","./chunk.OJGHDWI6.js","./chunk.Z7ZCR4LN.js","./chunk.RIW7SQH4.js","./chunk.FSAHO3LV.js","./chunk.PNVR3CXR.js","./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.GNSAKLP2.js"))));function Cn({blocks:r,view:e}){let t=dt.current.homeView(r);return(0,M.jsx)(t,{...e})}var _n=dt.part((r,e)=>(0,M.jsx)(Cn,{...e}),{what:"The home"});function Mn(r){let e=t=>(0,M.jsx)(Ce.Suspense,{fallback:null,children:(0,M.jsx)(_n,{blocks:r,view:t})});return Object.defineProperty(e,Symbol.for("graview.home-blocks"),{value:!0}),e}function Dn(r,e){return e.home&&e.home.length>0&&r.home?.(Mn(e.home)),ct(r,e),r.arrange?.(e.pages),r}function ct(r,e,t){for(let n of gr(e).drawn){if(t&&r.places().some(o=>o.title===n.title))continue;let i=Rn(n),a={title:n.title,...n.across?{across:n.across}:{},...t?{beside:t}:{},...n.hidden?{hidden:!0}:{},over:n.kinds};for(let o of n.kinds)r.register(o,{cardinality:"many",fidelity:"full"},i,a),r.register(o,{cardinality:"many",fidelity:"summary"},i,a)}}function Vn(r,e,t){t.length>0&&ct(r,{schema:e,lenses:t.map(({lens:n,...i})=>({...i,name:n}))},!0)}function Fn(r,e,t){Vn(r,e,He(t))}var I=y(O(),1),ve=y(b(),1);var _e=r=>`graview:first-look:${r}`;function In(r,e){if(r.seen!==void 0)try{return typeof r.seen=="function"?r.seen():r.seen}catch{return!0}try{return window.localStorage.getItem(_e(e))!==null}catch{return!1}}function Wn(r,e){if(r.seen===void 0)try{window.localStorage.setItem(_e(e),"seen")}catch{}}var zn=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.ZTD2CNC3.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.3MWBWSYF.js")))),Kn=zn.part((r,e)=>{let t=r.FirstLookHints;return(0,ve.jsx)(t,{...e})},{quiet:!0});function Gn({firstLook:r,root:e,app:t}){let n=(0,I.useRef)(null);n.current=r===!0?{}:r||null;let[i,a]=(0,I.useState)(()=>n.current!==null&&typeof window<"u"&&!In(n.current,t)),o=(0,I.useCallback)(d=>{if(a(!1),d===null)return;let p=n.current??{};Wn(p,t),p.onDone?.(d)},[t]);return!i||n.current===null?null:(0,ve.jsx)(I.Suspense,{fallback:null,children:(0,ve.jsx)(Kn,{root:e,steps:n.current.steps??[],onEnd:o})})}export{rn as a,tn as b,ce as c,Pt as d,qn as e,Or as f,jn as g,Dr as h,Nt as i,Cr as j,Ot as k,Ht as l,ue as m,C as n,Ct as o,_t as p,Wr as q,Mt as r,Y as s,Vt as t,sn as u,mn as v,wn as w,vn as x,hn as y,bn as z,xn as A,Xt as B,Zt as C,He as D,Ln as E,it as F,ot as G,Tn as H,Dn as I,Vn as J,Fn as K,An as L,Hn as M,Gn as N};
|
|
328
|
+
${Zr(`${d}[data-graview-motion='reduce']`,o)}`}var F=y(O(),1);var L=y(b(),1);function sn({scheme:r,onScheme:e,profileHref:t,keeping:n,hostActions:i=ln,signature:a=!1}){let{store:o,principal:d,seats:p,people:s}=le(),c=q("profile"),u=c.open,[f,v]=(0,F.useState)(!1);(0,F.useEffect)(()=>pn(ge),[]),u&&!f&&v(!0),(0,F.useEffect)(()=>{u&&ge()},[u]);let x=d.id===void 0?void 0:o.graph.getNode(d.id),g=x===void 0?d.id===void 0?"Nobody in particular":Qe(d,{graph:o.graph,schema:o.schema,seats:p,people:s}):je(o.schema.tryDefinition(x.kind),x);return(0,L.jsxs)("div",{style:{position:"relative"},children:[(0,L.jsx)("button",{type:"button","data-testid":"profile-button",...c.trigger,onClick:c.toggle,onPointerEnter:ge,onFocus:ge,"aria-label":`${g} \u2014 you, your seat and your settings`,title:`${g} \u2014 you, your seat and your settings`,style:{...Y,borderRadius:999},children:(0,L.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:j-4,height:j-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:un(g)})}),(0,L.jsxs)("section",{...c.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!u,style:{...G,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:u?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[f?(0,L.jsx)(F.Suspense,{fallback:null,children:(0,L.jsx)(dn,{part:"top",name:g,me:x,profileHref:t,hostActions:i,close:()=>c.setOpen(!1)})}):null,(0,L.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:fn,children:[(0,L.jsx)("span",{style:gn,children:"Keeping this app"}),n]}),f?(0,L.jsx)(F.Suspense,{fallback:null,children:(0,L.jsx)(cn,{part:"rest",name:g,me:x,scheme:r,onScheme:e,hostActions:i,signature:a,close:()=>c.setOpen(!1)})}):null]})]})}var ln=[],ge=()=>C.prefetch(),dn=C.part((r,e)=>(0,L.jsx)(r.ProfilePane,{...e}),{what:"The rest of your menu"}),cn=C.part((r,e)=>(0,L.jsx)(r.ProfilePane,{...e}),{quiet:!0});function pn(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}function un(r){return(r.trim()[0]??"?").toUpperCase()}var gn={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},fn={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function mn(r){return!(r==="hidden"||r===!1)}var Ne=y(O(),1);var rt="The whole thing",fe=r=>`scene:${r.kind}:${r.as}`;function tt(r){let{view:e}=r,t=r.places.filter(c=>!r.hidden.has(c.kind)),n=Q(t),i=(c,u)=>{if(c===z)return hr(br(u,!0),"view",null);let f=n.find(v=>fe(v)===c);return f?kr(u,f.over?.find(v=>u.focusId===Z(v))??f.kind,f.as):null},a=[{key:z,label:rt,path:`${Se}${Le(i(z,Pe))}`,group:"home"},...n.map(c=>({key:fe(c),label:X(c,t,r.schema),path:`${Se}${Le(i(fe(c),Pe))}`,group:"pictures",kind:c.kind}))],o=e.within?.view,d=c=>e.focusId===Z(c.kind)&&(o===void 0?t.filter(u=>u.kind===c.kind).at(-1)===c:o===c.as),p=t.find(c=>d(c)&&(o!==void 0||!e.overview)),s=p?n.find(c=>cr(c,p)):void 0;return{places:a,current:s?fe(s):z,to:i}}function wn(){let{store:r,views:e,hiddenKinds:t}=le(),{view:n,go:i}=Ar(),a=e.places(),o=(0,Ne.useMemo)(()=>tt({places:a,hidden:t,view:n,schema:r.schema}),[a,t,n,r.schema]),d=(0,Ne.useMemo)(()=>({go:p=>{let s=o.to(p.key,n);s&&i(s)}}),[o,n,i]);return{places:o.places,current:o.current,reach:d}}var T=y(O(),1);var E=y(b(),1),nt=6e3;function vn(){let r=[],e=0,t=new Set,n=new Map,i,a=()=>{for(let s of[...t])s()},o=s=>{if(clearTimeout(n.get(s.id)),n.delete(s.id),s.kind!=="toast")return;let c=(s.actions?.length??0)+(s.action?1:0),u=s.timeout??(c>0?!1:nt);u!==!1&&n.set(s.id,setTimeout(()=>i?.()?o(s):d(s.id),u))},d=s=>{clearTimeout(n.get(s)),n.delete(s),r.some(c=>c.id===s)&&(r=r.filter(c=>c.id!==s),a())},p=s=>{r=r.some(c=>c.id===s.id)?r.map(c=>c.id===s.id?s:c):[...r,s],o(s),a()};return{notify(s){let c=s.id??`notice-${++e}`;return p({...s,id:c,said:++e}),{id:c,dismiss:()=>d(c),update:u=>{let f=r.find(v=>v.id===c);f&&p({...f,...u,id:c,kind:f.kind,said:u.sentence!==void 0&&u.sentence!==f.sentence?++e:f.said})}}},dismiss:d,hold(s){i=s},list:()=>r,subscribe(s){return t.add(s),()=>t.delete(s)}}}function yn({notices:r}){let e=r.reduce((d,p)=>!d||p.said>d.said?p:d,void 0),[t,n]=(0,T.useState)(""),[i,a]=(0,T.useState)(""),o=(0,T.useRef)(0);return(0,T.useEffect)(()=>{if(!e||e.said===o.current)return;o.current=e.said;let d=e.tone==="bad";(d?a:n)("");let p=setTimeout(()=>(d?a:n)(e.sentence),50);return()=>clearTimeout(p)},[e]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ue,children:t}),(0,E.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ue,children:i})]})}var hn=(0,T.createContext)(null);function bn({board:r,anchor:e}){let t=(0,T.useSyncExternalStore)(r.subscribe,r.list,r.list);return(0,T.useEffect)(()=>Sn(Be.prefetch),[]),(0,E.jsxs)(E.Fragment,{children:[t.length>0?(0,E.jsx)(T.Suspense,{fallback:null,children:(0,E.jsx)(kn,{notices:t,anchor:e,board:r})}):null,(0,E.jsx)(yn,{notices:t})]})}var Be=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.MXJS67W4.js")))),xn=()=>Be.load().then(()=>{},()=>{}),kn=Be.part((r,e)=>(0,E.jsx)(r.NoticeStacks,{...e}),{quiet:!0});function Sn(r){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&r()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(e,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let n=setTimeout(e,2500);return()=>clearTimeout(n)}var U=y(O(),1);var B=y(b(),1),Pn=C.part((r,e)=>(0,B.jsx)(r.ProblemRows,{...e}),{what:"The problems",as:"li"}),Re=()=>C.prefetch();function Ln({clean:r="All rules hold"}){let e=Tr(),{set:t}=Lr(),n=e.length,[i,a]=(0,U.useState)(!1),o=q("problems",{open:i&&n>0,onOpenChange:a}),d=o.open,p=it(e,r);return(0,U.useEffect)(()=>{if(n===0)return;let s=setTimeout(Re,1500);return()=>clearTimeout(s)},[n>0]),(0,B.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,B.jsxs)("button",{type:"button","data-testid":"standing",...o.trigger,"aria-disabled":n===0?!0:void 0,"aria-label":p,onClick:n===0?void 0:o.toggle,onPointerEnter:n===0?void 0:Re,onFocus:n===0?void 0:Re,title:p,style:{...Y,padding:n===0?0:"0 8px",cursor:n===0?"default":"pointer",color:n===0?"var(--graview-ink-muted)":at(e),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,B.jsx)(ot,{tone:n===0?"var(--graview-good)":at(e)}),n>0?(0,B.jsx)("span",{"aria-hidden":"true",children:n}):null]}),d?(0,B.jsx)("ol",{...o.pane,"data-testid":"problems",style:{...G,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,B.jsx)(U.Suspense,{fallback:null,children:(0,B.jsx)(Pn,{violations:e,pick:s=>{t(s.nodeIds),o.setOpen(!1)}})})}):null]})}function it(r,e){return r.length===0?e:`${Xe(r)} \u2014 open what is broken, and what would fix it`}var at=r=>r.some(e=>e.status==="could-not-judge"||e.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function ot({tone:r}){return(0,B.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:r}})}function Tn(r,e,t=[]){if(r.focusId)return r.focusId;let i=(r.selection??[]).map(xr).find(a=>a!==null)??t.find(a=>e.includes(a))??e[0]??null;return i===null?null:Z(i)}var we=y(b(),1),me=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.4STIUIT6.js","./chunk.WHTQHU3M.js","./chunk.KU6NIMQX.js","./chunk.Y3IJDWNS.js","./chunk.OFJH7LDC.js","./chunk.5PU3RWYY.js","./chunk.OREMUXB5.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.CUCNT7MG.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.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.CNJENUPC.js"))));function An(){return me.load().then(()=>{})}var En=[{cardinality:"one",fidelity:"full",slot:"page"},{cardinality:"one",fidelity:"summary",slot:"card"},{cardinality:"one",fidelity:"glyph",slot:"row"},{cardinality:"many",fidelity:"full"},{cardinality:"many",fidelity:"summary"},{cardinality:"many",fidelity:"glyph"}];function $n({schema:r,specs:e,kind:t,view:n}){let i=me.current.frameworkViews(r,e).lookup(t,{cardinality:n.cardinality,fidelity:n.fidelity});return i?(0,we.jsx)(i,{...n}):null}var On=me.part((r,e)=>(0,we.jsx)($n,{...e}),{what:"This view"});function st(r,e,t){for(let n of e.kinds){let i=t?.[n];for(let a of En){let o=p=>(0,we.jsx)(On,{schema:e,specs:t,kind:n,view:p}),d=a.slot!==void 0&&i?.[a.slot]!==void 0;d&&(o.says=(p,s)=>me.current?.frameworkViews(e,t).lookup(n,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(p,s)),r.register(n,{cardinality:a.cardinality,fidelity:a.fidelity},d?o:Sr(o))}}return r}function Hn(r,e){return st(Pr(r),r,e)}var Ce=y(O(),1);var M=y(b(),1),lt=N(H(()=>(__graviewPreload(import.meta.url,["./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.CUCNT7MG.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.js","./chunk.UT6642FC.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.ZNS3LYJU.js"))));function Nn({lens:r,view:e}){let t=lt.current.declaredLensView(r);return(0,M.jsx)(t,{...e})}var Bn=lt.part((r,e)=>(0,M.jsx)(Nn,{...e}),{what:"This picture"});function Rn(r){let e=t=>(0,M.jsx)(Ce.Suspense,{fallback:null,children:(0,M.jsx)(Bn,{lens:r,view:t})});return r.lens==="blocks"&&(e.flows=!0),r.create===!1&&(e.creates=!1),e}var dt=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.4STIUIT6.js","./chunk.WHTQHU3M.js","./chunk.KU6NIMQX.js","./chunk.Y3IJDWNS.js","./chunk.OFJH7LDC.js","./chunk.5PU3RWYY.js","./chunk.OREMUXB5.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.CUCNT7MG.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.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.SSRP5SBR.js"))));function Cn({blocks:r,view:e}){let t=dt.current.homeView(r);return(0,M.jsx)(t,{...e})}var _n=dt.part((r,e)=>(0,M.jsx)(Cn,{...e}),{what:"The home"});function Mn(r){let e=t=>(0,M.jsx)(Ce.Suspense,{fallback:null,children:(0,M.jsx)(_n,{blocks:r,view:t})});return Object.defineProperty(e,Symbol.for("graview.home-blocks"),{value:!0}),e}function Dn(r,e){return e.home&&e.home.length>0&&r.home?.(Mn(e.home)),ct(r,e),r.arrange?.(e.pages),r}function ct(r,e,t){for(let n of gr(e).drawn){if(t&&r.places().some(o=>o.title===n.title))continue;let i=Rn(n),a={title:n.title,...n.across?{across:n.across}:{},...t?{beside:t}:{},...n.hidden?{hidden:!0}:{},over:n.kinds};for(let o of n.kinds)r.register(o,{cardinality:"many",fidelity:"full"},i,a),r.register(o,{cardinality:"many",fidelity:"summary"},i,a)}}function Vn(r,e,t){t.length>0&&ct(r,{schema:e,lenses:t.map(({lens:n,...i})=>({...i,name:n}))},!0)}function Fn(r,e,t){Vn(r,e,He(t))}var I=y(O(),1),ve=y(b(),1);var _e=r=>`graview:first-look:${r}`;function In(r,e){if(r.seen!==void 0)try{return typeof r.seen=="function"?r.seen():r.seen}catch{return!0}try{return window.localStorage.getItem(_e(e))!==null}catch{return!1}}function Wn(r,e){if(r.seen===void 0)try{window.localStorage.setItem(_e(e),"seen")}catch{}}var zn=N(H(()=>(__graviewPreload(import.meta.url,["./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.RKHEZ6KZ.js")))),Kn=zn.part((r,e)=>{let t=r.FirstLookHints;return(0,ve.jsx)(t,{...e})},{quiet:!0});function Gn({firstLook:r,root:e,app:t}){let n=(0,I.useRef)(null);n.current=r===!0?{}:r||null;let[i,a]=(0,I.useState)(()=>n.current!==null&&typeof window<"u"&&!In(n.current,t)),o=(0,I.useCallback)(d=>{if(a(!1),d===null)return;let p=n.current??{};Wn(p,t),p.onDone?.(d)},[t]);return!i||n.current===null?null:(0,ve.jsx)(I.Suspense,{fallback:null,children:(0,ve.jsx)(Kn,{root:e,steps:n.current.steps??[],onEnd:o})})}export{rn as a,tn as b,ce as c,Pt as d,qn as e,Or as f,jn as g,Dr as h,Nt as i,Cr as j,Ot as k,Ht as l,ue as m,C as n,Ct as o,_t as p,Wr as q,Mt as r,Y as s,Vt as t,sn as u,mn as v,wn as w,vn as x,hn as y,bn as z,xn as A,Xt as B,Zt as C,He as D,Ln as E,it as F,ot as G,Tn as H,Dn as I,Vn as J,Fn as K,An as L,Hn as M,Gn as N};
|
|
329
329
|
/*! Bundled license information:
|
|
330
330
|
|
|
331
331
|
react-dom/cjs/react-dom.production.js:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"./chunk.ER5ILWKY.js";import"./chunk.7YQYWOZR.js";import"./chunk.ACEYGWMO.js";import"./chunk.3PT55HXT.js";import"./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"./chunk.BZ5VLPKB.js";import"./chunk.6II4BONS.js";import"./chunk.F5BCCGFK.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,k as o}from"./chunk.4STIUIT6.js";import"./chunk.WHTQHU3M.js";import"./chunk.KU6NIMQX.js";import"./chunk.Y3IJDWNS.js";import"./chunk.OFJH7LDC.js";import"./chunk.5PU3RWYY.js";import"./chunk.OREMUXB5.js";import"./chunk.ZDNJK2SX.js";import"./chunk.ZSSOTIFL.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{ja as n}from"./chunk.6II4BONS.js";import"./chunk.F5BCCGFK.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function s(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{s as frameworkViews};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Se,b as Me,c as Ke,d as me,e as D,f as Pe,h as Ce}from"./chunk.2YGQVI6T.js";import{h as Ne,i as _e,j as Ie}from"./chunk.IHFNLKXV.js";import{a as oe,b as se,c as Z,d as Ge,e as Y,g as ee,h as qe}from"./chunk.FBY5IUGU.js";import{c as Re,h as g,i as Te,j as ue}from"./chunk.4K5QCJFH.js";import{b as L,c as q,e as Oe,f as xe,g as G,h as v,k as K,l as X,m as C,n as Ee,o as V,oa as Fe,p as T,r as k,s as Q,t as x,u as F,v as I,va as De,w as P,wa as pe,x as n,xa as fe,y as U,z as Ae}from"./chunk.X7W27IRI.js";function ge(e){let o=/^(edit|remove|archive|unarchive|merge|leave-alone|allow-tidying|skip|detach|split)-(.+)$/.exec(e);return o?{act:o[1],kind:o[2]}:void 0}var he="graview-document",ye=1,be=256*1024,ze=64*1024,ke=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,$e=/^[a-z][A-Za-z0-9]*$/,cn=new Set(["id","kind"]),dn=e=>e in Object.prototype,Ue=U(e=>!dn(e),"every object already has this name \u2014 choose another"),We=(e,o)=>[...e===void 0?[]:[xe(e)],...o===void 0?[]:[Oe(o)]],h=(e,o)=>v().check(...We(e,o)),E=(e,o,r)=>T(e).check(...We(o,r)),R=e=>v().check(G(ke,`${e} names are kebab-case, lower-case words joined by hyphens like "tool-note" (field and relation names are camelCase, like "supersededBy")`)),ln=/^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$/,W=v().check(G(ln,'relation names are one camelCase word, like "supersededBy" (kind names are kebab-case, like "tool-note")'),Ue),N=v().check(G($e,'field names are one word or camelCase, like "dueDate", so rules say them bare (kind names are kebab-case, like "tool-note")'),U(e=>!cn.has(e),'a field cannot be called "id" or "kind" \u2014 the framework keeps those; try "type" or "category"'),Ue),B=h(1,500),H=h(1,2e3),ie=h(1,300),pn=["string","text","number","integer","boolean","date","datetime","enum","list","url","email","image","file","app-link","phone","place","duration"],Ze=k({type:I(pn),required:n(C()),description:n(B),label:n(h(1,60)),options:n(E(h(1,80),1,100)),of:n(I(["string","number","date","image","file"])),default:n(V()),unit:n(h(void 0,12)),format:n(I(["money","percent","duration","markdown"])),min:n(K()),max:n(K()),step:n(K()),renamedFrom:n(v().check(G($e))),repeats:n(C())}).check(Ae((e,o)=>{e.type==="enum"&&!e.options&&o.addIssue({code:"custom",message:'an enum field lists its "options"',path:["options"]}),e.type!=="enum"&&e.options&&o.addIssue({code:"custom",message:'"options" belongs only on an enum field',path:["options"]}),e.type!=="list"&&e.of&&o.addIssue({code:"custom",message:'"of" belongs only on a list field',path:["of"]}),e.repeats&&e.type!=="date"&&e.type!=="datetime"&&o.addIssue({code:"custom",message:'"repeats" belongs only on a date or datetime field',path:["repeats"]})})),fn=v().check(G(new RegExp(`${ke.source}|${Fe.source}`),'a relation goes to a kind of this document, like "house", or of another app, like "@nick/house/house"')),un=k({to:x([E(fn,1),P("*")]),cardinality:n(I(["one","many"])),description:n(B),inverse:n(h(1,80)),appendOnly:n(C()),renamedFrom:n(v()),tidying:n(P("never"))}),Ye=x([H,k({expr:H,label:n(h(1,60)),description:n(B)})]),mn=k({noun:n(h(1,40)),plural:n(h(1,40)),description:n(B),fields:F(N,Ze).check(U(e=>Object.keys(e).length>0,"a kind has at least one field")),label:n(ie),describe:n(ie),lifecycle:n(k({field:N,retired:E(x([v(),K(),C()]),1)})),figure:n(h(void 0,2e4)),glance:n(E(N,1,20)),page:n(k({fields:n(E(N,1,40)),groups:n(E(k({title:h(1,60),fields:E(N,1,40)}),1,12))})),edges:n(F(W,un)),computed:n(F(v(),Ye).check(U(e=>Object.keys(e).length<=20,"a kind works out at most 20 computed fields"))),fieldRoles:n(F(v(),v())),renamedFrom:n(v().check(G(ke))),people:n(C()),archives:n(P(!1)),tidying:n(I(["never","no-links"]))}),ne=x([v(),K(),C(),Ee(),T(V()),k({expr:H})]),J=v().check(G(/^\$[A-Za-z][A-Za-z0-9]*$/,'a reference is "$" and a name, like "$subject" or "$new"')),gn=x([k({create:R("kind"),as:n(v().check(G($e))),set:n(F(N,ne))}),k({set:F(N,ne),target:n(J)}),k({connect:W,from:J,to:J}),k({sever:W,from:J,to:J}),k({remove:J})]),zn=k({title:n(h(1,80)),description:n(B),fromTheOtherEnd:n(h(1,80)),on:n(x([R("kind"),E(R("kind"),1)])),creates:n(R("kind")),sets:n(F(N,ne)),writes:n(E(N,1)),connects:n(W),severs:n(W),setsOther:n(F(N,ne)),replaces:n(x([P(!0),E(W,1,10)])),removes:n(P(!0)),args:n(F(N,Ze)),effects:n(E(gn,1,20)),allowedWhen:n(H),refusal:n(ie),destructive:n(C())}),hn=k({act:R("act"),label:n(h(1,80)),args:n(F(v(),ne))}),yn=k({title:n(h(1,120)),description:n(B),over:x([P("graph"),R("kind")]),when:n(H),require:H,says:n(ie),repairs:n(E(hn,void 0,10))}),bn=k({roles:x([E(R("role"),1),P("*")]),mutations:x([E(R("act"),1),P("*")]),kinds:n(x([T(R("kind")),P("*")])),describe:n(B),self:n(C()),ownEnd:n(C())}),Ve=n(E(R("field"),1)),kn=k({roles:x([E(R("role"),1),P("*")]),kinds:E(R("kind"),1),own:n(C()),via:n(W),fields:Ve,hide:Ve}),$n=k({grants:T(bn),sees:n(T(kn))}),wn=k({accent:n(v().check(G(/^#[0-9a-fA-F]{6}$/,'an accent is a color like "#c2577a"'))),name:n(h(1,60)),currency:n(v().check(G(/^[A-Z]{3}$/,'a currency is its three-letter code, like "USD" or "EUR"'))),locale:n(h(2,35)),logo:n(x([h(1,ze),k({src:h(1,ze),alt:n(h(1,120))})])),favicon:n(x([h(1,ze),k({emoji:v()})])),typography:n(k({display:n(h(1,200)),body:n(h(1,200)),mono:n(h(1,200))})),shape:n(k({radius:n(K().check(q(0),L(32))),density:n(K().check(q(.75),L(1.5)))})),accents:n(F(v(),K().check(q(0),L(360)))),scheme:n(I(["light","dark","auto"]))}),re=F(v(),V()),Be=x([h(1,120),k({by:h(1,120),direction:n(I(["asc","desc"]))})]),Le=K().check(X(),q(1),L(9999)),vn=Q({create:n(C()),options:n(Q({sort:n(Be),columnSort:n(Be),horizon:n(x([K().check(X(),q(1),L(200)),Q({years:K().check(X(),q(1),L(200)),title:h(1,80),from:n(Le),to:n(Le)})]))}))}),jn=k({card:n(T(V())),row:n(T(V())),page:n(T(V()))}),Sn=()=>{let e=n(I(["asc","desc"]));return x([h(1,120),k({by:h(1,120),direction:e,then:n(x([h(1,120),k({by:h(1,120),direction:e})]))})])},On=()=>x([h(1,120),k({by:h(1,120),order:n(E(h(1,80),void 0,40)),closed:n(E(h(1,80),void 0,40))})]),xn=Q({order:n(T(v())),hide:n(T(v())),first:n(v()),primary:n(E(h(1,80),void 0,40)),scene:n(h(1,40)),pages:n(h(1,40)),lists:n(F(v(),k({filters:n(E(h(1,120),void 0,40)),sort:n(Sn()),group:n(On())})))}),Je=k({$schema:n(v()),format:P(he),formatVersion:P(ye),name:h(1,80),description:n(B),version:n(K().check(X(),q(1))),kinds:F(R("kind"),mn).check(U(e=>Object.keys(e).length>0,"a document declares at least one kind"),U(e=>Object.keys(e).length<=40,"a document declares at most 40 kinds")),computed:n(F(v(),Ye)),acts:n(F(R("act"),zn)),rules:n(F(R("rule"),yn)),roles:n(T(R("role"))),policy:n($n),modules:n(re),lenses:n(T(vn)),pages:n(xn),views:n(F(v(),x([jn,T(V())]))),brand:n(wn),settings:n(T(re)),migrations:n(T(re)),connections:n(F(R("connection"),re))});var En={};function He(e,o=En,r=ye){let{document:a,respelled:l}=Se(e),p=l.length>0?{respelled:l}:{};if(!a||typeof a!="object"||Array.isArray(a))return{document:a};let u=a;if(u.format!==he||typeof u.formatVersion!="number"||u.formatVersion>=r)return{document:a,...p};let z=u.formatVersion,$=structuredClone(u);for(let s=z;s<r;s++){let t=o[s];if(!t)throw new Error(`there is no upgrade from format ${s} to ${s+1}`);$={...t($),formatVersion:s+1}}return{document:$,from:z,...p}}function Xe(e,o,r){let a=Object.keys(e).filter(z=>e[z].edges?.[o]!==void 0);if(a.length===0)return;let l=a.map(z=>e[z].edges[o].to),p=l.some(z=>z==="*")?"*":[...new Set(l.flatMap(z=>z))];if(r.length===0||r.some(z=>a.includes(z)))return{reversed:!1,kinds:p};let u=a.filter(z=>{let $=e[z].edges[o].to;return $==="*"||r.every(s=>$.includes(s))});return u.length>0?{reversed:!0,kinds:u}:{reversed:!1,kinds:p}}var nn=(e,o)=>{let r=e?.fields[o];return r!==void 0&&(r.type==="duration"||(r.type==="number"||r.type==="integer")&&r.format==="duration")};function Qe(e,o,r,a){if(a==="out"){let l=e[o]?.edges?.[r]?.to;return l===void 0?[]:l==="*"?Object.keys(e):l}return Object.entries(e).filter(([,l])=>{let p=l.edges?.[r]?.to;return p!==void 0&&(p==="*"||p.includes(o))}).map(([l])=>l)}function we(e,o,r){if(r.t==="ident")return e[o]?.edges?.[r.name]?Qe(e,o,r.name,"out"):void 0;if(r.t==="where")return we(e,o,r.set);if(r.t==="call"&&(r.fn==="out"||r.fn==="in")&&r.args[0]?.t==="lit"&&typeof r.args[0].value=="string")return Qe(e,o,r.args[0].value,r.fn)}var en=(e,o,r)=>{let a=o.filter(l=>e[l]?.fields[r]!==void 0);return a.length>0&&a.every(l=>nn(e[l],r))};function tn(e,o,r){let a=e.kinds,l=a[o],p=new Map(r),u=new Map,z=(s,t)=>{if(t>8)return!1;switch(s.t){case"ident":return nn(l,s.name)||$(s.name,t+1);case"member":{let d=we(a,o,s.object);return d!==void 0&&en(a,d,s.name)}case"call":{if(s.fn!=="sum"&&s.fn!=="min"&&s.fn!=="max")return!1;let[d,w]=s.args,f=d&&we(a,o,d);return f!==void 0&&w?.t==="ident"&&en(a,f,w.name)}case"binary":return(s.op==="+"||s.op==="-")&&z(s.left,t)&&z(s.right,t);case"unary":return s.op==="-"&&z(s.operand,t);default:return!1}},$=(s,t)=>{if(l?.computed?.[s]===void 0)return!1;if(u.has(s))return u.get(s);u.set(s,!1);let d=p.get(s),w=d!==void 0&&z(d,t);return u.set(s,w),w};return r.map(([s])=>s).filter(s=>$(s,0))}function on(e,o,r=`kinds.${e}.page`){let a=o.page;if(!a)return[];let l=[],p=[...Object.keys(o.fields),...Object.keys(o.computed??{})],u=new Set,z=(s,t)=>{p.includes(s)?u.has(s)&&l.push(g("page-field-twice",t,`"${s}" is on ${e}'s page twice; name each field once`)):l.push(g("page-field",t,`${e}'s page is to show "${s}", and ${e} has no field or computed field called that`,`use one of: ${p.join(", ")}`)),u.add(s)};(a.fields??[]).forEach((s,t)=>z(s,`${r}.fields.${t}`));let $=new Set;return(a.groups??[]).forEach((s,t)=>{let d=s.title.trim().toLowerCase();$.has(d)&&l.push(g("page-group-twice",`${r}.groups.${t}.title`,`${e}'s page has two groups called "${s.title}"; give each its own title`)),$.add(d),s.fields.forEach((w,f)=>z(w,`${r}.groups.${t}.fields.${f}`))}),l}var An=new Set(["subject","now","today","me"]);function Fn(e){if((typeof e=="string"?e:JSON.stringify(e??null)).length>be)return{findings:[g("too-large","",`a document may be at most ${be/1024} KB`)]};if(typeof e=="string")try{e=JSON.parse(e)}catch(a){return{findings:[g("not-json","",`this is not JSON: ${a.message}`)]}}try{e=He(e).document}catch(a){return{findings:[g("format","formatVersion",a.message)]}}let o=Je.safeParse(e);if(!o.success)return{findings:o.error.issues.map(a=>{let l=a.path.map(String).join(".");if(a.code==="unrecognized_keys")return g("unknown-key",l,`${a.keys.map(p=>`"${p}"`).join(", ")} ${a.keys.length===1?"is":"are"} not part of a Graview document here`,"check the spelling against docs/declaration-document.md");if(a.code==="invalid_union"&&/\.effects\.\d+$/.test(l))return g("effect-shape",l,"this effect is not one Graview knows",'an effect is one of {"create": kind, "as"?: name, "set"?: {field: value}}, {"set": {field: value, \u2026}, "target"?: "$ref"}, {"connect"|"sever": relation, "from": "$ref", "to": "$ref"}, {"remove": "$ref"}');if(a.code==="invalid_key"){let p=a.issues?.[0]?.message;return g("shape",l,`the name "${String(a.path.at(-1))}" is not allowed here${p?`: ${p}`:""}`)}return g("shape",l,a.message)})};let r=o.data;return{document:r,findings:Dn(r)}}var ce=e=>[e??[]].flat();function sn(e){let o=new Map;for(let[r,a]of Object.entries(e.kinds))for(let[l,p]of Object.entries(pe(a.edges))){let u=o.get(l);o.set(l,{name:l,from:[...u?.from??[],r],to:p.to==="*"||u?.to==="*"?"*":[...new Set([...u?.to??[],...p.to])],cardinality:p.cardinality??"many"})}return o}function lt(e){let o=new Map;for(let[a,l]of Object.entries(e.kinds)){let p=ee(l),u=fe(l.edges);o.set(a,{fields:new Set([...Object.keys(l.fields),...u.keys()]),edges:new Map(Object.entries(pe(l.edges)).map(([z,$])=>[z,$.cardinality??"many"])),...p?{computed:p}:{},...u.size>0?{linked:u}:{}})}let r=ee(e);return r&&o.set(Re,{computed:r}),o}function rn(e,o){let r=[],a=ce(e.on),l=(p,u)=>{let z=Xe(o.kinds,p,a)?.reversed===!0,[$,s]=z?["$to","$subject"]:["$subject","$to"];return u==="connect"?{connect:p,from:$,to:s}:{sever:p,from:$,to:s}};if(e.creates){let p=o.kinds[e.creates],u={};for(let z of Object.keys(p?.fields??{}))u[z]=`$${z}`;for(let z of e.effects??[])"set"in z&&!("create"in z)&&D(z.target)==="new"&&Object.assign(u,z.set);r.push({create:e.creates,as:"new",set:u})}return e.sets&&r.push({set:e.sets}),e.writes&&!(e.creates&&e.on===void 0)&&r.push({set:Object.fromEntries(e.writes.map(p=>[p,`$${p}`]))}),e.connects&&(e.replaces&&r.push({replace:e.replaces===!0?[e.connects]:[...e.replaces],keep:e.connects}),r.push(l(e.connects,"connect"))),e.severs&&r.push(l(e.severs,"sever")),e.setsOther&&(e.connects||e.severs)&&r.push({set:e.setsOther,target:"$to"}),e.removes&&r.push({remove:"$subject"}),e.effects&&r.push(...e.effects.filter(p=>!(e.creates&&"set"in p&&!("create"in p)&&D(p.target)==="new"))),r}function ve(e,o,r){try{let a=Z(e),l=oe(a);for(let p of l.unknownFunctions)r.push(g("unknown-function",o,`"${p}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));return a}catch(a){if(a instanceof se){r.push(g("expression",o,a.sentence+` (at character ${a.at+1})`));return}throw a}}function je(e,o,r){try{return Y(e)}catch(a){if(a instanceof Ge||a instanceof se){r.push(g("template",o,(a instanceof se,a.sentence)));return}throw a}}function Dn(e){let o=[],r=new Set(Object.keys(e.kinds)),a=sn(e),l=e.acts??{},p=new Set(e.roles??[]),u=(s,t)=>fe(e.kinds[s]?.edges).has(t),z=s=>Object.keys(e.kinds).some(t=>u(t,s));for(let[s,t]of Object.entries(e.kinds)){let d=`kinds.${s}`;for(let[f,c]of Object.entries(t.edges??{})){if(!De(c)&&c.to!=="*")for(let i of c.to)r.has(i)||o.push(g("edge-target",`${d}.edges.${f}.to`,`"${i}" is not a kind this document declares`));t.fields[f]&&o.push(g("edge-field-clash",`${d}.edges.${f}`,`"${f}" is both a field and a relation of ${s}`,"rename one of them"))}t.lifecycle&&!t.fields[t.lifecycle.field]&&o.push(g("lifecycle-field",`${d}.lifecycle.field`,`${s} has no field "${t.lifecycle.field}"`));let w=f=>t.computed!==void 0&&Object.hasOwn(t.computed,f);for(let f of t.glance??[])!t.fields[f]&&!w(f)&&o.push(g("glance-field",`${d}.glance`,`a glance at ${s} is to say "${f}", and ${s} has no field or computed field called that`,`use one of: ${[...Object.keys(t.fields),...Object.keys(t.computed??{})].join(", ")}`));o.push(...on(s,t));for(let f of["label","describe"]){let c=t[f];if(!c)continue;let i=je(c,`${d}.${f}`,o);for(let A of i??[])if(A.expr){for(let y of oe(A.expr).names)if(!t.fields[y]){if(w(y)){qe(t,y)||o.push(g("template-field",`${d}.${f}`,`${s}'s ${y} is worked out from beyond the record, and a ${f} is said with no graph to read`,`show it in a view instead, or name a computed field worked out from ${s}'s own fields`));continue}o.push(g("template-field",`${d}.${f}`,`${s} has no field "${y}" for its ${f} to show`,f==="label"?"a label can only show the record's own fields and what they work out":void 0))}}}for(let[f,c]of Object.entries(t.fields)){c.default!==void 0&&c.type==="enum"&&!c.options?.includes(String(c.default))&&o.push(g("default-option",`${d}.fields.${f}.default`,`"${String(c.default)}" is not one of ${f}'s options`));let i=`${f}Repeat`;c.repeats&&(t.fields[i]||t.edges?.[i]||t.computed?.[i])&&o.push(g("repeat-clash",`${d}.fields.${f}.repeats`,`${s} already has "${i}", where how ${f} repeats is kept`))}}for(let[s,t]of Object.entries(l)){let d=`acts.${s}`;for(let i of ce(t.on))r.has(i)||o.push(g("act-kind",`${d}.on`,`"${i}" is not a kind this document declares`));let w=ce(t.on),f=rn(t,e);if(t.creates&&t.on===void 0&&t.writes&&r.has(t.creates)){for(let i of t.writes)if(!e.kinds[t.creates].fields[i])if(e.kinds[t.creates].computed?.[i]!==void 0)o.push(g("computed-written",`${d}.writes`,`${t.creates}'s ${i} is worked out, not written: no act can set it`,"write the stored fields it is worked out from"));else{if(u(t.creates,i))continue;o.push(g("act-field",`${d}.writes`,`${t.creates} has no field "${i}"`))}}f.length===0&&o.push(g("act-empty",d,`"${s}" does nothing`,"give it effects or a shorthand such as sets or creates"));let c=new Map;f.forEach((i,A)=>{let y=f.length-(t.effects?.length??0),j=t.effects&&A>=y?`${d}.effects.${A-y}`:d;if("create"in i){if(!r.has(i.create))o.push(g("act-kind",`${j}.create`,`"${i.create}" is not a kind this document declares`));else for(let b of Object.keys(i.set??{}))e.kinds[i.create].fields[b]||(e.kinds[i.create].computed?.[b]!==void 0?o.push(g("computed-written",`${j}.set.${b}`,`${i.create}'s ${b} is worked out, not written: no act can set it`,"set the stored fields it is worked out from")):o.push(g("act-field",`${j}.set.${b}`,`${i.create} has no field "${b}"`)));i.as&&c.set(i.as,i.create)}else if("connect"in i||"sever"in i){let b="connect"in i?i.connect:i.sever;!a.has(b)&&!z(b)&&o.push(g("act-edge",`${j}.${"connect"in i?"connect":"sever"}`,`"${b}" is not a relation any kind declares`)),D(i.from)==="subject"&&w.length===0&&o.push(g("act-subject",`${d}.on`,`"${s}" acts on "$subject" but does not say which kinds it is "on"`))}else if("set"in i){let b=D(i.target??"$subject"),de=b==="subject"?w:c.has(b??"")?[c.get(b)]:[];b==="subject"&&w.length===0&&o.push(g("act-subject",`${d}.on`,`"${s}" changes "$subject" but does not say which kinds it is "on"`));for(let _ of Object.keys(i.set))for(let m of de)if(!(!r.has(m)||e.kinds[m].fields[_]))if(e.kinds[m].computed?.[_]!==void 0)o.push(g("computed-written",`${j}.set.${_}`,`${m}'s ${_} is worked out, not written: no act can set it`,"set the stored fields it is worked out from"));else{if(u(m,_))continue;o.push(g("act-field",`${j}.set.${_}`,`${m} has no field "${_}"`))}}else"remove"in i&&D(i.remove)==="subject"&&w.length===0&&o.push(g("act-subject",`${d}.on`,`"${s}" removes "$subject" but does not say which kinds it is "on"`));("set"in i&&i.set?Object.values(i.set):[]).forEach(b=>{b&&typeof b=="object"&&!Array.isArray(b)&&"expr"in b&&ve(b.expr,`${j}.set`,o)})}),t.allowedWhen&&ve(t.allowedWhen,`${d}.allowedWhen`,o),t.refusal&&je(t.refusal,`${d}.refusal`,o)}for(let[s,t]of Object.entries(e.rules??{})){let d=`rules.${s}`;t.over!=="graph"&&!r.has(t.over)&&o.push(g("rule-kind",`${d}.over`,`"${t.over}" is not a kind this document declares`));let w=t.over==="graph"?void 0:e.kinds[t.over];for(let f of["when","require"]){let c=t[f];if(!c)continue;let i=ve(c,`${d}.${f}`,o);if(!i)continue;let A=oe(i);for(let y of A.names)if(t.over==="graph")o.push(g("rule-name",`${d}.${f}`,`"${y}" means nothing in a rule over the whole graph`,`name a kind in "over", or use all('kind')`));else if(w&&!w.fields[y]&&!w.edges?.[y]&&w.computed?.[y]===void 0){let j=Object.keys(w.edges??{}).find(S=>S.includes("-")&&S.split("-").includes(y));o.push(g("rule-name",`${d}.${f}`,`${t.over} has no field or relation called "${y}"`,j?`"${j}" reads as a subtraction in a rule; rename the relation to one camelCase word, like "${j.replace(/-([a-z0-9])/g,(S,b)=>b.toUpperCase())}"`:void 0))}for(let y of A.edges)!a.has(y)&&!z(y)&&o.push(g("rule-edge",`${d}.${f}`,`"${y}" is not a relation any kind declares`));for(let y of A.sweeps)r.has(y)?t.over!=="graph"&&o.push(Te("rule-cost",`${d}.${f}`,`this rule looks at every ${y} for every ${t.over}, which grows slowly as the app grows`,"walk a relation with out()/in() instead of all() where you can")):o.push(g("rule-kind",`${d}.${f}`,`"${y}" is not a kind this document declares`))}t.says&&je(t.says,`${d}.says`,o),(t.repairs??[]).forEach((f,c)=>{!l[f.act]&&!ge(f.act)&&o.push(g("repair-act",`${d}.repairs.${c}.act`,`"${f.act}" is not an act this document declares`))})}let $=e.policy;return $&&($.grants.forEach((s,t)=>{if(s.roles!=="*"&&p.size>0)for(let d of s.roles)p.has(d)||o.push(g("grant-role",`policy.grants.${t}.roles`,`"${d}" is not one of the document's roles`));if(s.mutations!=="*")for(let d of s.mutations)!l[d]&&!ge(d)&&o.push(g("grant-act",`policy.grants.${t}.mutations`,`"${d}" is not an act this document declares`))}),($.sees??[]).forEach((s,t)=>{for(let d of s.kinds)r.has(d)||o.push(g("sight-kind",`policy.sees.${t}.kinds`,`"${d}" is not a kind this document declares`));if(s.roles!=="*"&&p.size>0)for(let d of s.roles)p.has(d)||o.push(g("sight-role",`policy.sees.${t}.roles`,`"${d}" is not one of the document's roles`))})),o.push(...Ie(e)),o}function Rn(e,o,r,a){let l=new Map,p=ce(e.on),u=new Map,z=new Map;(p.length>0||o.some(c=>"remove"in c&&D(c.remove)==="subject"||"from"in c&&(D(c.from)==="subject"||D(c.to)==="subject")||"set"in c&&!("create"in c)&&D(c.target??"$subject")==="subject"))&&l.set(me,{ref:p.length>0?p:"*",required:!0});let s=e.args??{},t=e.writes?.length===1,d=(c,i)=>i&&c.type===i.type&&c.min===void 0&&c.max===void 0&&c.step===void 0?{...c,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step}}:c,w=(c,i)=>i&&c.type===i.type&&c.format===void 0&&c.unit===void 0?{...d(c,i),...i.format?{format:i.format}:{},...i.unit?{unit:i.unit}:{}}:d(c,i),f=(c,i,A)=>{if(c===me||An.has(c)||u.has(c)||l.has(c))return;let y=s[c]?w(s[c],A):void 0;l.set(c,y?{field:y,optional:!y.required,required:!!y.required}:i())};for(let c of o)if("create"in c){let i=r.kinds[c.create];for(let[A,y]of Object.entries(c.set??{})){let j=D(y),S=i?.fields[A];if(j&&S){let b=!!S.required&&S.default===void 0;f(j,()=>({field:S,optional:!b,required:b}),S)}}c.as&&u.set(c.as,c.create)}else if("connect"in c||"sever"in c){let i=a.get("connect"in c?c.connect:c.sever);for(let[A,y]of[["from",c.from],["to",c.to]]){let j=D(y);if(!j)continue;let S=A==="to"?i?.to??"*":i?.from??"*";S!=="*"&&!z.has(j)&&z.set(j,S),f(j,()=>({ref:S,required:!0}))}}else if("set"in c){let i=D(c.target??"$subject"),A=i==="subject"?p[0]:u.get(i??"")??z.get(i??"")?.[0];i&&i!=="subject"&&!u.has(i)&&f(i,()=>({ref:"*",required:!0}));for(let[y,j]of Object.entries(c.set)){let S=D(j);if(!S)continue;let b=A?r.kinds[A]?.fields[y]:void 0;f(S,()=>b?{field:b,optional:!t,required:t}:{any:!0,required:!1},b)}}else if("remove"in c){let i=D(c.remove);i&&f(i,()=>({ref:"*",required:!0}))}for(let[c,i]of Object.entries(s))l.has(c)||l.set(c,{field:i,optional:!i.required,required:!!i.required});return l}function pt(e,o={}){let r=Fn(e);if(!r.document||ue(r.findings))return{ok:!1,findings:r.findings};let a=r.document,l=[...r.findings];o.previous&&l.push(...Mn(a,o.previous));let p=Tn(a,l);return ue(p.findings)?{ok:!1,findings:p.findings}:Ce(p,o)}function ae(e,o){return e.map(r=>{let a=!r.format&&r.expr?.t==="ident"?o?.[r.expr.name]?.format:void 0;return a==="money"||a==="percent"?{...r,format:a}:r})}function Tn(e,o){let r=sn(e),a={};for(let[s,t]of Object.entries(e.kinds)){let d=Pe(t),w=t.label??(d?`{${d}}`:void 0),f=ee(t),c=f?tn(e,s,[...f]):[];a[s]={...w?{label:ae(Y(w),t.fields)}:{},...t.describe?{describe:ae(Y(t.describe),t.fields)}:{},...f?{computed:[...f]}:{},...c.length>0?{durations:c}:{}}}let l={};for(let[s,t]of Object.entries(e.acts??{})){let d=rn(t,e),w=Rn(t,d,e,r),f=t.destructive??d.some(m=>"remove"in m||"sever"in m||"replace"in m),c=[...new Set(d.flatMap(m=>"create"in m?[m.create]:[]))],i=[...new Set(d.flatMap(m=>"connect"in m?[m.connect]:[]))],A=[...new Set(d.flatMap(m=>"sever"in m?[m.sever]:"replace"in m?m.replace:[]))],y=[...new Set(d.flatMap(m=>"set"in m&&!("create"in m)&&D(m.target??"$subject")==="subject"?Object.keys(m.set):[]))],j=new Map;for(let m of d){if(!("connect"in m)&&!("sever"in m))continue;let O=r.get("connect"in m?m.connect:m.sever);for(let[M,an]of[["from",m.from],["to",m.to]]){let te=D(an),le=M==="to"?O?.to:O?.from;te&&te!=="subject"&&le&&le!=="*"&&j.set(te,[...new Set([...j.get(te)??[],...le])])}}let S={};for(let m of d){if(!("set"in m)||"create"in m)continue;let O=D(m.target??"$subject");for(let M of O&&O!=="subject"&&j.get(O)||[])S[M]=[...new Set([...S[M]??[],...Object.keys(m.set)])]}let b={};for(let m of d)if(!(!("set"in m)||"create"in m||D(m.target??"$subject")!=="subject"))for(let[O,M]of Object.entries(m.set??{}))typeof M=="string"&&D(M)===void 0||typeof M=="number"||typeof M=="boolean"?b[O]=typeof M=="string"&&M.startsWith("$$")?M.slice(1):M:delete b[O];let de=c.length===0&&d.every(m=>!("set"in m)||!m.set||Object.values(m.set).every(O=>!(O&&typeof O=="object"&&!Array.isArray(O)&&"expr"in O))),_=new Map;for(let m of d)if(!(!("set"in m)||!m.set))for(let O of Object.values(m.set))O&&typeof O=="object"&&!Array.isArray(O)&&"expr"in O&&_.set(O.expr,Z(O.expr));l[s]={title:t.title??s.replace(/-/g," "),effects:d,args:[...w],...t.allowedWhen?{guard:Z(t.allowedWhen)}:{},...t.refusal?{refusal:ae(Y(t.refusal),e.kinds[[t.on??[]].flat()[0]??""]?.fields)}:{},exprs:[..._],destructive:f,idempotent:de,creates:c,connects:i,severs:A,writes:y,writesOther:S,sets:b}}let p={};for(let[s,t]of Object.entries(e.rules??{}))p[s]={title:t.title??s.replace(/-/g," "),require:Z(t.require),...t.when?{when:Z(t.when)}:{},...t.says?{says:ae(Y(t.says),e.kinds[t.over]?.fields)}:{}};let u=Me(e,o),z=Ne(e),$=_e(e);return{format:Ke,document:e,findings:o,kinds:a,...e.computed?{facts:[...ee(e)??[]]}:{},edges:[...r].map(([s,{from:t,to:d,cardinality:w}])=>[s,{from:t,to:d,cardinality:w}]),acts:l,rules:p,brand:u,...Object.keys(z).length>0?{viewSpecs:z}:{},...$?{home:$}:{}}}function ft(e,o,r){let a=/^defineNode\("([^"]+)"\)/.exec(o)?.[1],l=a?r.kinds[a]:void 0;if(!a||!l)return e;let p=Object.keys(l.fields).filter(u=>u!=="label").slice(0,3);return{...e,path:`kinds.${a}.glance`,fix:`Say which: "glance": [${p.map(u=>`"${u}"`).join(", ")}] on kinds.${a} \u2014 the facts a person compares one by, at a glance.`}}function Mn(e,o){let r=[],a=new Set(Object.values(o.kinds).flatMap(l=>Object.keys(l.edges??{})));for(let[l,p]of Object.entries(e.kinds)){let u=p.renamedFrom;u&&!o.kinds[u]&&r.push(g("renamed-from-nothing",`kinds.${l}.renamedFrom`,`${l} says it was ${u}, and the previous version has no kind called ${u}`,"name the kind it was, or drop renamedFrom"));let z=o.kinds[u??l];for(let[$,s]of Object.entries(p.fields)){let t=s.renamedFrom;t&&!z?.fields[t]&&r.push(g("renamed-from-nothing",`kinds.${l}.fields.${$}.renamedFrom`,`${$} says it was ${t}, and the previous ${u??l} has no field called ${t}`,"name the field it was, or drop renamedFrom"))}for(let[$,s]of Object.entries(p.edges??{})){let t=s.renamedFrom;t&&!a.has(t)&&r.push(g("renamed-from-nothing",`kinds.${l}.edges.${$}.renamedFrom`,`${$} says it was ${t}, and the previous version has no relation called ${t}`,"name the relation it was, or drop renamedFrom"))}}return r}export{Fn as a,lt as b,rn as c,pt as d,ft as e};
|
|
1
|
+
import{a as Se,b as Me,c as Ke,d as me,e as D,f as Pe,h as Ce}from"./chunk.LNNFNJKN.js";import{h as Ne,i as _e,j as Ie}from"./chunk.6W7J76TK.js";import{a as oe,b as se,c as Z,d as Ge,e as Y,g as ee,h as qe}from"./chunk.2B4WVCVV.js";import{c as Re,h as g,i as Te,j as ue}from"./chunk.AAZFVCSP.js";import{b as L,c as q,e as Oe,f as xe,g as G,h as v,k as K,l as X,m as C,n as Ee,o as V,p as T,pa as Fe,r as k,s as Q,t as x,u as F,v as I,w as P,wa as De,x as n,xa as pe,y as U,ya as fe,z as Ae}from"./chunk.F5BCCGFK.js";function ge(e){let o=/^(edit|remove|archive|unarchive|merge|leave-alone|allow-tidying|skip|detach|split)-(.+)$/.exec(e);return o?{act:o[1],kind:o[2]}:void 0}var he="graview-document",ye=1,be=256*1024,ze=64*1024,ke=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,$e=/^[a-z][A-Za-z0-9]*$/,cn=new Set(["id","kind"]),dn=e=>e in Object.prototype,Ue=U(e=>!dn(e),"every object already has this name \u2014 choose another"),We=(e,o)=>[...e===void 0?[]:[xe(e)],...o===void 0?[]:[Oe(o)]],h=(e,o)=>v().check(...We(e,o)),E=(e,o,r)=>T(e).check(...We(o,r)),R=e=>v().check(G(ke,`${e} names are kebab-case, lower-case words joined by hyphens like "tool-note" (field and relation names are camelCase, like "supersededBy")`)),ln=/^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$/,W=v().check(G(ln,'relation names are one camelCase word, like "supersededBy" (kind names are kebab-case, like "tool-note")'),Ue),N=v().check(G($e,'field names are one word or camelCase, like "dueDate", so rules say them bare (kind names are kebab-case, like "tool-note")'),U(e=>!cn.has(e),'a field cannot be called "id" or "kind" \u2014 the framework keeps those; try "type" or "category"'),Ue),B=h(1,500),H=h(1,2e3),ie=h(1,300),pn=["string","text","number","integer","boolean","date","datetime","enum","list","url","email","image","file","app-link","phone","place","duration"],Ze=k({type:I(pn),required:n(C()),description:n(B),label:n(h(1,60)),options:n(E(h(1,80),1,100)),of:n(I(["string","number","date","image","file"])),default:n(V()),unit:n(h(void 0,12)),format:n(I(["money","percent","duration","markdown"])),min:n(K()),max:n(K()),step:n(K()),renamedFrom:n(v().check(G($e))),repeats:n(C())}).check(Ae((e,o)=>{e.type==="enum"&&!e.options&&o.addIssue({code:"custom",message:'an enum field lists its "options"',path:["options"]}),e.type!=="enum"&&e.options&&o.addIssue({code:"custom",message:'"options" belongs only on an enum field',path:["options"]}),e.type!=="list"&&e.of&&o.addIssue({code:"custom",message:'"of" belongs only on a list field',path:["of"]}),e.repeats&&e.type!=="date"&&e.type!=="datetime"&&o.addIssue({code:"custom",message:'"repeats" belongs only on a date or datetime field',path:["repeats"]})})),fn=v().check(G(new RegExp(`${ke.source}|${Fe.source}`),'a relation goes to a kind of this document, like "house", or of another app, like "@nick/house/house"')),un=k({to:x([E(fn,1),P("*")]),cardinality:n(I(["one","many"])),description:n(B),inverse:n(h(1,80)),appendOnly:n(C()),renamedFrom:n(v()),tidying:n(P("never"))}),Ye=x([H,k({expr:H,label:n(h(1,60)),description:n(B)})]),mn=k({noun:n(h(1,40)),plural:n(h(1,40)),description:n(B),fields:F(N,Ze).check(U(e=>Object.keys(e).length>0,"a kind has at least one field")),label:n(ie),describe:n(ie),lifecycle:n(k({field:N,retired:E(x([v(),K(),C()]),1)})),figure:n(h(void 0,2e4)),glance:n(E(N,1,20)),page:n(k({fields:n(E(N,1,40)),groups:n(E(k({title:h(1,60),fields:E(N,1,40)}),1,12))})),edges:n(F(W,un)),computed:n(F(v(),Ye).check(U(e=>Object.keys(e).length<=20,"a kind works out at most 20 computed fields"))),fieldRoles:n(F(v(),v())),renamedFrom:n(v().check(G(ke))),people:n(C()),archives:n(P(!1)),tidying:n(I(["never","no-links"]))}),ne=x([v(),K(),C(),Ee(),T(V()),k({expr:H})]),J=v().check(G(/^\$[A-Za-z][A-Za-z0-9]*$/,'a reference is "$" and a name, like "$subject" or "$new"')),gn=x([k({create:R("kind"),as:n(v().check(G($e))),set:n(F(N,ne))}),k({set:F(N,ne),target:n(J)}),k({connect:W,from:J,to:J}),k({sever:W,from:J,to:J}),k({remove:J})]),zn=k({title:n(h(1,80)),description:n(B),fromTheOtherEnd:n(h(1,80)),on:n(x([R("kind"),E(R("kind"),1)])),creates:n(R("kind")),sets:n(F(N,ne)),writes:n(E(N,1)),connects:n(W),severs:n(W),setsOther:n(F(N,ne)),replaces:n(x([P(!0),E(W,1,10)])),removes:n(P(!0)),args:n(F(N,Ze)),effects:n(E(gn,1,20)),allowedWhen:n(H),refusal:n(ie),destructive:n(C())}),hn=k({act:R("act"),label:n(h(1,80)),args:n(F(v(),ne))}),yn=k({title:n(h(1,120)),description:n(B),over:x([P("graph"),R("kind")]),when:n(H),require:H,says:n(ie),repairs:n(E(hn,void 0,10))}),bn=k({roles:x([E(R("role"),1),P("*")]),mutations:x([E(R("act"),1),P("*")]),kinds:n(x([T(R("kind")),P("*")])),describe:n(B),self:n(C()),ownEnd:n(C())}),Ve=n(E(R("field"),1)),kn=k({roles:x([E(R("role"),1),P("*")]),kinds:E(R("kind"),1),own:n(C()),via:n(W),fields:Ve,hide:Ve}),$n=k({grants:T(bn),sees:n(T(kn))}),wn=k({accent:n(v().check(G(/^#[0-9a-fA-F]{6}$/,'an accent is a color like "#c2577a"'))),name:n(h(1,60)),currency:n(v().check(G(/^[A-Z]{3}$/,'a currency is its three-letter code, like "USD" or "EUR"'))),locale:n(h(2,35)),logo:n(x([h(1,ze),k({src:h(1,ze),alt:n(h(1,120))})])),favicon:n(x([h(1,ze),k({emoji:v()})])),typography:n(k({display:n(h(1,200)),body:n(h(1,200)),mono:n(h(1,200))})),shape:n(k({radius:n(K().check(q(0),L(32))),density:n(K().check(q(.75),L(1.5)))})),accents:n(F(v(),K().check(q(0),L(360)))),scheme:n(I(["light","dark","auto"]))}),re=F(v(),V()),Be=x([h(1,120),k({by:h(1,120),direction:n(I(["asc","desc"]))})]),Le=K().check(X(),q(1),L(9999)),vn=Q({create:n(C()),options:n(Q({sort:n(Be),columnSort:n(Be),horizon:n(x([K().check(X(),q(1),L(200)),Q({years:K().check(X(),q(1),L(200)),title:h(1,80),from:n(Le),to:n(Le)})]))}))}),jn=k({card:n(T(V())),row:n(T(V())),page:n(T(V()))}),Sn=()=>{let e=n(I(["asc","desc"]));return x([h(1,120),k({by:h(1,120),direction:e,then:n(x([h(1,120),k({by:h(1,120),direction:e})]))})])},On=()=>x([h(1,120),k({by:h(1,120),order:n(E(h(1,80),void 0,40)),closed:n(E(h(1,80),void 0,40))})]),xn=Q({order:n(T(v())),hide:n(T(v())),first:n(v()),primary:n(E(h(1,80),void 0,40)),scene:n(h(1,40)),pages:n(h(1,40)),lists:n(F(v(),k({filters:n(E(h(1,120),void 0,40)),sort:n(Sn()),group:n(On())})))}),Je=k({$schema:n(v()),format:P(he),formatVersion:P(ye),name:h(1,80),description:n(B),version:n(K().check(X(),q(1))),kinds:F(R("kind"),mn).check(U(e=>Object.keys(e).length>0,"a document declares at least one kind"),U(e=>Object.keys(e).length<=40,"a document declares at most 40 kinds")),computed:n(F(v(),Ye)),acts:n(F(R("act"),zn)),rules:n(F(R("rule"),yn)),roles:n(T(R("role"))),policy:n($n),modules:n(re),lenses:n(T(vn)),pages:n(xn),views:n(F(v(),x([jn,T(V())]))),brand:n(wn),settings:n(T(re)),migrations:n(T(re)),connections:n(F(R("connection"),re))});var En={};function He(e,o=En,r=ye){let{document:a,respelled:l}=Se(e),p=l.length>0?{respelled:l}:{};if(!a||typeof a!="object"||Array.isArray(a))return{document:a};let u=a;if(u.format!==he||typeof u.formatVersion!="number"||u.formatVersion>=r)return{document:a,...p};let z=u.formatVersion,$=structuredClone(u);for(let s=z;s<r;s++){let t=o[s];if(!t)throw new Error(`there is no upgrade from format ${s} to ${s+1}`);$={...t($),formatVersion:s+1}}return{document:$,from:z,...p}}function Xe(e,o,r){let a=Object.keys(e).filter(z=>e[z].edges?.[o]!==void 0);if(a.length===0)return;let l=a.map(z=>e[z].edges[o].to),p=l.some(z=>z==="*")?"*":[...new Set(l.flatMap(z=>z))];if(r.length===0||r.some(z=>a.includes(z)))return{reversed:!1,kinds:p};let u=a.filter(z=>{let $=e[z].edges[o].to;return $==="*"||r.every(s=>$.includes(s))});return u.length>0?{reversed:!0,kinds:u}:{reversed:!1,kinds:p}}var nn=(e,o)=>{let r=e?.fields[o];return r!==void 0&&(r.type==="duration"||(r.type==="number"||r.type==="integer")&&r.format==="duration")};function Qe(e,o,r,a){if(a==="out"){let l=e[o]?.edges?.[r]?.to;return l===void 0?[]:l==="*"?Object.keys(e):l}return Object.entries(e).filter(([,l])=>{let p=l.edges?.[r]?.to;return p!==void 0&&(p==="*"||p.includes(o))}).map(([l])=>l)}function we(e,o,r){if(r.t==="ident")return e[o]?.edges?.[r.name]?Qe(e,o,r.name,"out"):void 0;if(r.t==="where")return we(e,o,r.set);if(r.t==="call"&&(r.fn==="out"||r.fn==="in")&&r.args[0]?.t==="lit"&&typeof r.args[0].value=="string")return Qe(e,o,r.args[0].value,r.fn)}var en=(e,o,r)=>{let a=o.filter(l=>e[l]?.fields[r]!==void 0);return a.length>0&&a.every(l=>nn(e[l],r))};function tn(e,o,r){let a=e.kinds,l=a[o],p=new Map(r),u=new Map,z=(s,t)=>{if(t>8)return!1;switch(s.t){case"ident":return nn(l,s.name)||$(s.name,t+1);case"member":{let d=we(a,o,s.object);return d!==void 0&&en(a,d,s.name)}case"call":{if(s.fn!=="sum"&&s.fn!=="min"&&s.fn!=="max")return!1;let[d,w]=s.args,f=d&&we(a,o,d);return f!==void 0&&w?.t==="ident"&&en(a,f,w.name)}case"binary":return(s.op==="+"||s.op==="-")&&z(s.left,t)&&z(s.right,t);case"unary":return s.op==="-"&&z(s.operand,t);default:return!1}},$=(s,t)=>{if(l?.computed?.[s]===void 0)return!1;if(u.has(s))return u.get(s);u.set(s,!1);let d=p.get(s),w=d!==void 0&&z(d,t);return u.set(s,w),w};return r.map(([s])=>s).filter(s=>$(s,0))}function on(e,o,r=`kinds.${e}.page`){let a=o.page;if(!a)return[];let l=[],p=[...Object.keys(o.fields),...Object.keys(o.computed??{})],u=new Set,z=(s,t)=>{p.includes(s)?u.has(s)&&l.push(g("page-field-twice",t,`"${s}" is on ${e}'s page twice; name each field once`)):l.push(g("page-field",t,`${e}'s page is to show "${s}", and ${e} has no field or computed field called that`,`use one of: ${p.join(", ")}`)),u.add(s)};(a.fields??[]).forEach((s,t)=>z(s,`${r}.fields.${t}`));let $=new Set;return(a.groups??[]).forEach((s,t)=>{let d=s.title.trim().toLowerCase();$.has(d)&&l.push(g("page-group-twice",`${r}.groups.${t}.title`,`${e}'s page has two groups called "${s.title}"; give each its own title`)),$.add(d),s.fields.forEach((w,f)=>z(w,`${r}.groups.${t}.fields.${f}`))}),l}var An=new Set(["subject","now","today","me"]);function Fn(e){if((typeof e=="string"?e:JSON.stringify(e??null)).length>be)return{findings:[g("too-large","",`a document may be at most ${be/1024} KB`)]};if(typeof e=="string")try{e=JSON.parse(e)}catch(a){return{findings:[g("not-json","",`this is not JSON: ${a.message}`)]}}try{e=He(e).document}catch(a){return{findings:[g("format","formatVersion",a.message)]}}let o=Je.safeParse(e);if(!o.success)return{findings:o.error.issues.map(a=>{let l=a.path.map(String).join(".");if(a.code==="unrecognized_keys")return g("unknown-key",l,`${a.keys.map(p=>`"${p}"`).join(", ")} ${a.keys.length===1?"is":"are"} not part of a Graview document here`,"check the spelling against docs/declaration-document.md");if(a.code==="invalid_union"&&/\.effects\.\d+$/.test(l))return g("effect-shape",l,"this effect is not one Graview knows",'an effect is one of {"create": kind, "as"?: name, "set"?: {field: value}}, {"set": {field: value, \u2026}, "target"?: "$ref"}, {"connect"|"sever": relation, "from": "$ref", "to": "$ref"}, {"remove": "$ref"}');if(a.code==="invalid_key"){let p=a.issues?.[0]?.message;return g("shape",l,`the name "${String(a.path.at(-1))}" is not allowed here${p?`: ${p}`:""}`)}return g("shape",l,a.message)})};let r=o.data;return{document:r,findings:Dn(r)}}var ce=e=>[e??[]].flat();function sn(e){let o=new Map;for(let[r,a]of Object.entries(e.kinds))for(let[l,p]of Object.entries(pe(a.edges))){let u=o.get(l);o.set(l,{name:l,from:[...u?.from??[],r],to:p.to==="*"||u?.to==="*"?"*":[...new Set([...u?.to??[],...p.to])],cardinality:p.cardinality??"many"})}return o}function lt(e){let o=new Map;for(let[a,l]of Object.entries(e.kinds)){let p=ee(l),u=fe(l.edges);o.set(a,{fields:new Set([...Object.keys(l.fields),...u.keys()]),edges:new Map(Object.entries(pe(l.edges)).map(([z,$])=>[z,$.cardinality??"many"])),...p?{computed:p}:{},...u.size>0?{linked:u}:{}})}let r=ee(e);return r&&o.set(Re,{computed:r}),o}function rn(e,o){let r=[],a=ce(e.on),l=(p,u)=>{let z=Xe(o.kinds,p,a)?.reversed===!0,[$,s]=z?["$to","$subject"]:["$subject","$to"];return u==="connect"?{connect:p,from:$,to:s}:{sever:p,from:$,to:s}};if(e.creates){let p=o.kinds[e.creates],u={};for(let z of Object.keys(p?.fields??{}))u[z]=`$${z}`;for(let z of e.effects??[])"set"in z&&!("create"in z)&&D(z.target)==="new"&&Object.assign(u,z.set);r.push({create:e.creates,as:"new",set:u})}return e.sets&&r.push({set:e.sets}),e.writes&&!(e.creates&&e.on===void 0)&&r.push({set:Object.fromEntries(e.writes.map(p=>[p,`$${p}`]))}),e.connects&&(e.replaces&&r.push({replace:e.replaces===!0?[e.connects]:[...e.replaces],keep:e.connects}),r.push(l(e.connects,"connect"))),e.severs&&r.push(l(e.severs,"sever")),e.setsOther&&(e.connects||e.severs)&&r.push({set:e.setsOther,target:"$to"}),e.removes&&r.push({remove:"$subject"}),e.effects&&r.push(...e.effects.filter(p=>!(e.creates&&"set"in p&&!("create"in p)&&D(p.target)==="new"))),r}function ve(e,o,r){try{let a=Z(e),l=oe(a);for(let p of l.unknownFunctions)r.push(g("unknown-function",o,`"${p}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));return a}catch(a){if(a instanceof se){r.push(g("expression",o,a.sentence+` (at character ${a.at+1})`));return}throw a}}function je(e,o,r){try{return Y(e)}catch(a){if(a instanceof Ge||a instanceof se){r.push(g("template",o,(a instanceof se,a.sentence)));return}throw a}}function Dn(e){let o=[],r=new Set(Object.keys(e.kinds)),a=sn(e),l=e.acts??{},p=new Set(e.roles??[]),u=(s,t)=>fe(e.kinds[s]?.edges).has(t),z=s=>Object.keys(e.kinds).some(t=>u(t,s));for(let[s,t]of Object.entries(e.kinds)){let d=`kinds.${s}`;for(let[f,c]of Object.entries(t.edges??{})){if(!De(c)&&c.to!=="*")for(let i of c.to)r.has(i)||o.push(g("edge-target",`${d}.edges.${f}.to`,`"${i}" is not a kind this document declares`));t.fields[f]&&o.push(g("edge-field-clash",`${d}.edges.${f}`,`"${f}" is both a field and a relation of ${s}`,"rename one of them"))}t.lifecycle&&!t.fields[t.lifecycle.field]&&o.push(g("lifecycle-field",`${d}.lifecycle.field`,`${s} has no field "${t.lifecycle.field}"`));let w=f=>t.computed!==void 0&&Object.hasOwn(t.computed,f);for(let f of t.glance??[])!t.fields[f]&&!w(f)&&o.push(g("glance-field",`${d}.glance`,`a glance at ${s} is to say "${f}", and ${s} has no field or computed field called that`,`use one of: ${[...Object.keys(t.fields),...Object.keys(t.computed??{})].join(", ")}`));o.push(...on(s,t));for(let f of["label","describe"]){let c=t[f];if(!c)continue;let i=je(c,`${d}.${f}`,o);for(let A of i??[])if(A.expr){for(let y of oe(A.expr).names)if(!t.fields[y]){if(w(y)){qe(t,y)||o.push(g("template-field",`${d}.${f}`,`${s}'s ${y} is worked out from beyond the record, and a ${f} is said with no graph to read`,`show it in a view instead, or name a computed field worked out from ${s}'s own fields`));continue}o.push(g("template-field",`${d}.${f}`,`${s} has no field "${y}" for its ${f} to show`,f==="label"?"a label can only show the record's own fields and what they work out":void 0))}}}for(let[f,c]of Object.entries(t.fields)){c.default!==void 0&&c.type==="enum"&&!c.options?.includes(String(c.default))&&o.push(g("default-option",`${d}.fields.${f}.default`,`"${String(c.default)}" is not one of ${f}'s options`));let i=`${f}Repeat`;c.repeats&&(t.fields[i]||t.edges?.[i]||t.computed?.[i])&&o.push(g("repeat-clash",`${d}.fields.${f}.repeats`,`${s} already has "${i}", where how ${f} repeats is kept`))}}for(let[s,t]of Object.entries(l)){let d=`acts.${s}`;for(let i of ce(t.on))r.has(i)||o.push(g("act-kind",`${d}.on`,`"${i}" is not a kind this document declares`));let w=ce(t.on),f=rn(t,e);if(t.creates&&t.on===void 0&&t.writes&&r.has(t.creates)){for(let i of t.writes)if(!e.kinds[t.creates].fields[i])if(e.kinds[t.creates].computed?.[i]!==void 0)o.push(g("computed-written",`${d}.writes`,`${t.creates}'s ${i} is worked out, not written: no act can set it`,"write the stored fields it is worked out from"));else{if(u(t.creates,i))continue;o.push(g("act-field",`${d}.writes`,`${t.creates} has no field "${i}"`))}}f.length===0&&o.push(g("act-empty",d,`"${s}" does nothing`,"give it effects or a shorthand such as sets or creates"));let c=new Map;f.forEach((i,A)=>{let y=f.length-(t.effects?.length??0),j=t.effects&&A>=y?`${d}.effects.${A-y}`:d;if("create"in i){if(!r.has(i.create))o.push(g("act-kind",`${j}.create`,`"${i.create}" is not a kind this document declares`));else for(let b of Object.keys(i.set??{}))e.kinds[i.create].fields[b]||(e.kinds[i.create].computed?.[b]!==void 0?o.push(g("computed-written",`${j}.set.${b}`,`${i.create}'s ${b} is worked out, not written: no act can set it`,"set the stored fields it is worked out from")):o.push(g("act-field",`${j}.set.${b}`,`${i.create} has no field "${b}"`)));i.as&&c.set(i.as,i.create)}else if("connect"in i||"sever"in i){let b="connect"in i?i.connect:i.sever;!a.has(b)&&!z(b)&&o.push(g("act-edge",`${j}.${"connect"in i?"connect":"sever"}`,`"${b}" is not a relation any kind declares`)),D(i.from)==="subject"&&w.length===0&&o.push(g("act-subject",`${d}.on`,`"${s}" acts on "$subject" but does not say which kinds it is "on"`))}else if("set"in i){let b=D(i.target??"$subject"),de=b==="subject"?w:c.has(b??"")?[c.get(b)]:[];b==="subject"&&w.length===0&&o.push(g("act-subject",`${d}.on`,`"${s}" changes "$subject" but does not say which kinds it is "on"`));for(let _ of Object.keys(i.set))for(let m of de)if(!(!r.has(m)||e.kinds[m].fields[_]))if(e.kinds[m].computed?.[_]!==void 0)o.push(g("computed-written",`${j}.set.${_}`,`${m}'s ${_} is worked out, not written: no act can set it`,"set the stored fields it is worked out from"));else{if(u(m,_))continue;o.push(g("act-field",`${j}.set.${_}`,`${m} has no field "${_}"`))}}else"remove"in i&&D(i.remove)==="subject"&&w.length===0&&o.push(g("act-subject",`${d}.on`,`"${s}" removes "$subject" but does not say which kinds it is "on"`));("set"in i&&i.set?Object.values(i.set):[]).forEach(b=>{b&&typeof b=="object"&&!Array.isArray(b)&&"expr"in b&&ve(b.expr,`${j}.set`,o)})}),t.allowedWhen&&ve(t.allowedWhen,`${d}.allowedWhen`,o),t.refusal&&je(t.refusal,`${d}.refusal`,o)}for(let[s,t]of Object.entries(e.rules??{})){let d=`rules.${s}`;t.over!=="graph"&&!r.has(t.over)&&o.push(g("rule-kind",`${d}.over`,`"${t.over}" is not a kind this document declares`));let w=t.over==="graph"?void 0:e.kinds[t.over];for(let f of["when","require"]){let c=t[f];if(!c)continue;let i=ve(c,`${d}.${f}`,o);if(!i)continue;let A=oe(i);for(let y of A.names)if(t.over==="graph")o.push(g("rule-name",`${d}.${f}`,`"${y}" means nothing in a rule over the whole graph`,`name a kind in "over", or use all('kind')`));else if(w&&!w.fields[y]&&!w.edges?.[y]&&w.computed?.[y]===void 0){let j=Object.keys(w.edges??{}).find(S=>S.includes("-")&&S.split("-").includes(y));o.push(g("rule-name",`${d}.${f}`,`${t.over} has no field or relation called "${y}"`,j?`"${j}" reads as a subtraction in a rule; rename the relation to one camelCase word, like "${j.replace(/-([a-z0-9])/g,(S,b)=>b.toUpperCase())}"`:void 0))}for(let y of A.edges)!a.has(y)&&!z(y)&&o.push(g("rule-edge",`${d}.${f}`,`"${y}" is not a relation any kind declares`));for(let y of A.sweeps)r.has(y)?t.over!=="graph"&&o.push(Te("rule-cost",`${d}.${f}`,`this rule looks at every ${y} for every ${t.over}, which grows slowly as the app grows`,"walk a relation with out()/in() instead of all() where you can")):o.push(g("rule-kind",`${d}.${f}`,`"${y}" is not a kind this document declares`))}t.says&&je(t.says,`${d}.says`,o),(t.repairs??[]).forEach((f,c)=>{!l[f.act]&&!ge(f.act)&&o.push(g("repair-act",`${d}.repairs.${c}.act`,`"${f.act}" is not an act this document declares`))})}let $=e.policy;return $&&($.grants.forEach((s,t)=>{if(s.roles!=="*"&&p.size>0)for(let d of s.roles)p.has(d)||o.push(g("grant-role",`policy.grants.${t}.roles`,`"${d}" is not one of the document's roles`));if(s.mutations!=="*")for(let d of s.mutations)!l[d]&&!ge(d)&&o.push(g("grant-act",`policy.grants.${t}.mutations`,`"${d}" is not an act this document declares`))}),($.sees??[]).forEach((s,t)=>{for(let d of s.kinds)r.has(d)||o.push(g("sight-kind",`policy.sees.${t}.kinds`,`"${d}" is not a kind this document declares`));if(s.roles!=="*"&&p.size>0)for(let d of s.roles)p.has(d)||o.push(g("sight-role",`policy.sees.${t}.roles`,`"${d}" is not one of the document's roles`))})),o.push(...Ie(e)),o}function Rn(e,o,r,a){let l=new Map,p=ce(e.on),u=new Map,z=new Map;(p.length>0||o.some(c=>"remove"in c&&D(c.remove)==="subject"||"from"in c&&(D(c.from)==="subject"||D(c.to)==="subject")||"set"in c&&!("create"in c)&&D(c.target??"$subject")==="subject"))&&l.set(me,{ref:p.length>0?p:"*",required:!0});let s=e.args??{},t=e.writes?.length===1,d=(c,i)=>i&&c.type===i.type&&c.min===void 0&&c.max===void 0&&c.step===void 0?{...c,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step}}:c,w=(c,i)=>i&&c.type===i.type&&c.format===void 0&&c.unit===void 0?{...d(c,i),...i.format?{format:i.format}:{},...i.unit?{unit:i.unit}:{}}:d(c,i),f=(c,i,A)=>{if(c===me||An.has(c)||u.has(c)||l.has(c))return;let y=s[c]?w(s[c],A):void 0;l.set(c,y?{field:y,optional:!y.required,required:!!y.required}:i())};for(let c of o)if("create"in c){let i=r.kinds[c.create];for(let[A,y]of Object.entries(c.set??{})){let j=D(y),S=i?.fields[A];if(j&&S){let b=!!S.required&&S.default===void 0;f(j,()=>({field:S,optional:!b,required:b}),S)}}c.as&&u.set(c.as,c.create)}else if("connect"in c||"sever"in c){let i=a.get("connect"in c?c.connect:c.sever);for(let[A,y]of[["from",c.from],["to",c.to]]){let j=D(y);if(!j)continue;let S=A==="to"?i?.to??"*":i?.from??"*";S!=="*"&&!z.has(j)&&z.set(j,S),f(j,()=>({ref:S,required:!0}))}}else if("set"in c){let i=D(c.target??"$subject"),A=i==="subject"?p[0]:u.get(i??"")??z.get(i??"")?.[0];i&&i!=="subject"&&!u.has(i)&&f(i,()=>({ref:"*",required:!0}));for(let[y,j]of Object.entries(c.set)){let S=D(j);if(!S)continue;let b=A?r.kinds[A]?.fields[y]:void 0;f(S,()=>b?{field:b,optional:!t,required:t}:{any:!0,required:!1},b)}}else if("remove"in c){let i=D(c.remove);i&&f(i,()=>({ref:"*",required:!0}))}for(let[c,i]of Object.entries(s))l.has(c)||l.set(c,{field:i,optional:!i.required,required:!!i.required});return l}function pt(e,o={}){let r=Fn(e);if(!r.document||ue(r.findings))return{ok:!1,findings:r.findings};let a=r.document,l=[...r.findings];o.previous&&l.push(...Mn(a,o.previous));let p=Tn(a,l);return ue(p.findings)?{ok:!1,findings:p.findings}:Ce(p,o)}function ae(e,o){return e.map(r=>{let a=!r.format&&r.expr?.t==="ident"?o?.[r.expr.name]?.format:void 0;return a==="money"||a==="percent"?{...r,format:a}:r})}function Tn(e,o){let r=sn(e),a={};for(let[s,t]of Object.entries(e.kinds)){let d=Pe(t),w=t.label??(d?`{${d}}`:void 0),f=ee(t),c=f?tn(e,s,[...f]):[];a[s]={...w?{label:ae(Y(w),t.fields)}:{},...t.describe?{describe:ae(Y(t.describe),t.fields)}:{},...f?{computed:[...f]}:{},...c.length>0?{durations:c}:{}}}let l={};for(let[s,t]of Object.entries(e.acts??{})){let d=rn(t,e),w=Rn(t,d,e,r),f=t.destructive??d.some(m=>"remove"in m||"sever"in m||"replace"in m),c=[...new Set(d.flatMap(m=>"create"in m?[m.create]:[]))],i=[...new Set(d.flatMap(m=>"connect"in m?[m.connect]:[]))],A=[...new Set(d.flatMap(m=>"sever"in m?[m.sever]:"replace"in m?m.replace:[]))],y=[...new Set(d.flatMap(m=>"set"in m&&!("create"in m)&&D(m.target??"$subject")==="subject"?Object.keys(m.set):[]))],j=new Map;for(let m of d){if(!("connect"in m)&&!("sever"in m))continue;let O=r.get("connect"in m?m.connect:m.sever);for(let[M,an]of[["from",m.from],["to",m.to]]){let te=D(an),le=M==="to"?O?.to:O?.from;te&&te!=="subject"&&le&&le!=="*"&&j.set(te,[...new Set([...j.get(te)??[],...le])])}}let S={};for(let m of d){if(!("set"in m)||"create"in m)continue;let O=D(m.target??"$subject");for(let M of O&&O!=="subject"&&j.get(O)||[])S[M]=[...new Set([...S[M]??[],...Object.keys(m.set)])]}let b={};for(let m of d)if(!(!("set"in m)||"create"in m||D(m.target??"$subject")!=="subject"))for(let[O,M]of Object.entries(m.set??{}))typeof M=="string"&&D(M)===void 0||typeof M=="number"||typeof M=="boolean"?b[O]=typeof M=="string"&&M.startsWith("$$")?M.slice(1):M:delete b[O];let de=c.length===0&&d.every(m=>!("set"in m)||!m.set||Object.values(m.set).every(O=>!(O&&typeof O=="object"&&!Array.isArray(O)&&"expr"in O))),_=new Map;for(let m of d)if(!(!("set"in m)||!m.set))for(let O of Object.values(m.set))O&&typeof O=="object"&&!Array.isArray(O)&&"expr"in O&&_.set(O.expr,Z(O.expr));l[s]={title:t.title??s.replace(/-/g," "),effects:d,args:[...w],...t.allowedWhen?{guard:Z(t.allowedWhen)}:{},...t.refusal?{refusal:ae(Y(t.refusal),e.kinds[[t.on??[]].flat()[0]??""]?.fields)}:{},exprs:[..._],destructive:f,idempotent:de,creates:c,connects:i,severs:A,writes:y,writesOther:S,sets:b}}let p={};for(let[s,t]of Object.entries(e.rules??{}))p[s]={title:t.title??s.replace(/-/g," "),require:Z(t.require),...t.when?{when:Z(t.when)}:{},...t.says?{says:ae(Y(t.says),e.kinds[t.over]?.fields)}:{}};let u=Me(e,o),z=Ne(e),$=_e(e);return{format:Ke,document:e,findings:o,kinds:a,...e.computed?{facts:[...ee(e)??[]]}:{},edges:[...r].map(([s,{from:t,to:d,cardinality:w}])=>[s,{from:t,to:d,cardinality:w}]),acts:l,rules:p,brand:u,...Object.keys(z).length>0?{viewSpecs:z}:{},...$?{home:$}:{}}}function ft(e,o,r){let a=/^defineNode\("([^"]+)"\)/.exec(o)?.[1],l=a?r.kinds[a]:void 0;if(!a||!l)return e;let p=Object.keys(l.fields).filter(u=>u!=="label").slice(0,3);return{...e,path:`kinds.${a}.glance`,fix:`Say which: "glance": [${p.map(u=>`"${u}"`).join(", ")}] on kinds.${a} \u2014 the facts a person compares one by, at a glance.`}}function Mn(e,o){let r=[],a=new Set(Object.values(o.kinds).flatMap(l=>Object.keys(l.edges??{})));for(let[l,p]of Object.entries(e.kinds)){let u=p.renamedFrom;u&&!o.kinds[u]&&r.push(g("renamed-from-nothing",`kinds.${l}.renamedFrom`,`${l} says it was ${u}, and the previous version has no kind called ${u}`,"name the kind it was, or drop renamedFrom"));let z=o.kinds[u??l];for(let[$,s]of Object.entries(p.fields)){let t=s.renamedFrom;t&&!z?.fields[t]&&r.push(g("renamed-from-nothing",`kinds.${l}.fields.${$}.renamedFrom`,`${$} says it was ${t}, and the previous ${u??l} has no field called ${t}`,"name the field it was, or drop renamedFrom"))}for(let[$,s]of Object.entries(p.edges??{})){let t=s.renamedFrom;t&&!a.has(t)&&r.push(g("renamed-from-nothing",`kinds.${l}.edges.${$}.renamedFrom`,`${$} says it was ${t}, and the previous version has no relation called ${t}`,"name the relation it was, or drop renamedFrom"))}}return r}export{Fn as a,lt as b,rn as c,pt as d,ft as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as p}from"./chunk.
|
|
1
|
+
import{h as p}from"./chunk.BZ5VLPKB.js";import{Q as c}from"./chunk.6II4BONS.js";import{Mb as u}from"./chunk.F5BCCGFK.js";import{b as h}from"./chunk.AJZBJBMO.js";var s={person:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><circle cx="11.6" cy="5.4" r="2.5"/><path d="M7.9 12.4c0-2.1 1.7-3.8 3.7-3.8s3.7 1.7 3.7 3.8v3.2H7.9z"/><path d="M8 12.6 6.4 17.2"/><path d="M15.2 12.6 16.8 17.2"/><path d="M9.8 15.6v5"/><path d="M13.4 15.6v5"/></svg>',plot:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M2.6 9.4 12 4.6l9.4 4.8-9.4 4.8z"/><path d="M2.6 9.4v4.4l9.4 4.8 9.4-4.8V9.4"/><path d="M12 14.2v4.4"/><path d="M7 11.9v3"/><path d="M17 11.9v3"/></svg>',box:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M3.4 7.9 12 3.6l8.6 4.3-8.6 4.3z"/><path d="M3.4 7.9v8.2L12 20.4l8.6-4.3V7.9"/><path d="M12 12.2v8.2"/></svg>',task:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4.4 6.6 12 2.9l7.6 3.7v9.5L12 19.8 4.4 16.1z"/><path d="M12 12.4v7.4"/><path d="M4.4 6.6 12 10.3l7.6-3.7"/><path d="M8 9.6l2.4 2.4L16 8.4"/></svg>',shift:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M3.2 8.2 12 4l8.8 4.2-8.8 4.2z"/><path d="M3.2 8.2v7.2L12 19.6l8.8-4.2V8.2"/><path d="M12 12.4v7.2"/><path d="M6.6 10.8v3.4"/><path d="M9.3 12v3.4"/></svg>',list:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M2.8 10.4 12 6l9.2 4.4-9.2 4.4z"/><path d="M2.8 10.4v3.2L12 18l9.2-4.4v-3.2"/><path d="M6.6 8.6 15.8 13"/><path d="M9.4 7.2 18.6 11.6"/></svg>',vehicle:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M2.8 14.2 5 9.4l8.6-1.6 5.4 3-1 3.6z"/><path d="M2.8 14.2v2.2h2.4"/><path d="M18 16.4h1.9l.1-2.2"/><circle cx="7.6" cy="16.6" r="1.9"/><circle cx="16.1" cy="16.6" r="1.9"/><path d="M8.6 8.2 9.8 12l7.2-1"/></svg>',rule:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5.4 19.4V6.6l12 12.8z"/><path d="M5.4 6.6 7.6 5.5l12 12.8-2.2 1.1"/><path d="M5.4 19.4 7.6 18.3h12"/><path d="M5.4 10.1h1.7"/><path d="M5.4 13.3h1.7"/><path d="M5.4 16.5h1.7"/></svg>',note:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M6.2 6.2 14.8 10.5v9L6.2 15.2z"/><path d="M12.4 9.3 14.8 10.5l-.6 2.3"/><path d="M8.2 10.6 12.8 12.9"/><path d="M8.2 13.2 11.4 14.8"/></svg>'},v=Object.keys(s);function i(e){if(e)return s[e]??(e.trimStart().startsWith("<svg")?e:void 0)}var a=h(c(),1);function A({kind:e,schema:o,brand:n,size:r=16,title:t}){let f=o?.tryDefinition?.(e)?.figure,d=i(n?.figures?.[e]??f),l=Math.round(u(e,n?.accents)),g=p(d);return d?(0,a.jsx)("span",{"aria-hidden":t===void 0?"true":void 0,...t===void 0?{}:{role:"img","aria-label":t},"data-graview-figure":e,"data-graview-figure-kind":"figure",dangerouslySetInnerHTML:g,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:r,height:r,flex:"0 0 auto",color:`hsl(${l} 55% 52%)`,"--graview-figure-size":`${r}px`}}):(0,a.jsx)("span",{"aria-hidden":t===void 0?"true":void 0,...t===void 0?{}:{role:"img","aria-label":t},"data-graview-figure":e,"data-graview-figure-kind":"dot",style:{display:"inline-block",width:Math.round(r*.8),height:Math.round(r*.5),flex:"0 0 auto",background:`hsl(${l} 55% 52%)`,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)"}})}function C(e,o,n){return i(n?.figures?.[e]??o?.tryDefinition?.(e)?.figure)!==void 0}export{A as a,C as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as g,O as m,Y as d,ea as v}from"./chunk.
|
|
1
|
+
import{F as g,O as m,Y as d,ea as v}from"./chunk.6II4BONS.js";import{b as S}from"./chunk.AJZBJBMO.js";var w=S(g(),1);function f(){let{store:A,principal:a,ai:i,aiDesk:r,seatTalk:t,views:p,app:l,brand:s,view:k,selection:c}=d(),e=m(A,a),y=v(),o=k.within?.view;return(0,w.useMemo)(()=>({store:e,principal:a,ai:i,desk:r,seatTalk:t,goTo:y,places:p.places().map(n=>({as:n.as,title:n.title,kind:n.kind})),app:l??{name:s?.name??"app",schema:e.schema,...e.policy?{policy:e.policy}:{}},...o?{place:o}:{},selection:c}),[e,a,i,r,t,y,p,l,s,o,c])}export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y,b as h}from"./chunk.
|
|
1
|
+
import{a as y,b as h}from"./chunk.NJ62C2GU.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import{qc as b}from"./chunk.F5BCCGFK.js";import"./chunk.AJZBJBMO.js";var k=(d,i)=>({id:i.id,said:h(d,i),when:i.when,...i.alsoMine?{alsoMine:!0}:{}});async function A(d,i,t){let a=b(t.principal);if(a.id===void 0)return{ok:!1,error:"This seat acts for nobody the app knows by id, so there is nobody to tell. Nothing was kept."};let r=t.store.seenBy(a),p=async()=>(await t.subscriptions.list(a.id)).filter(n=>n.app===t.app);if(d==="list_subscriptions")return{ok:!0,data:{subscriptions:(await p()).map(n=>k(r,n))}};if(d==="unsubscribe"){let n=String(i.id??"");return(await p()).some(g=>g.id===n)?(await t.subscriptions.remove(n),{ok:!0,data:{removed:n}}):{ok:!1,error:`No subscription "${n}" of yours. list_subscriptions says which there are.`}}let o=String(i.on??""),c=n=>typeof i[n]=="string"&&i[n].trim()!==""?i[n].trim():void 0,e=c("record");if(e!==void 0&&!r.graph.getNode(e)){let n=t.store.resolveRef({name:"record",kinds:["*"]},e,a);if(!n.ok)return{ok:!1,error:`${n.message} Nothing was kept.`};e=n.id}let s=c("kind")??(e!==void 0&&o!=="act"?r.graph.getNode(e)?.kind:void 0),f=c("act"),m=c("condition"),u=o==="act"?{on:o,...f!==void 0?{act:f}:{},...e!==void 0?{record:e}:{}}:o==="created"&&s!==void 0?{on:o,kind:s}:o==="changed"?{on:o,...s!==void 0&&e===void 0?{kind:s}:{},...e!==void 0?{record:e}:{}}:o==="reaches"&&s!==void 0?{on:o,kind:s,condition:m??"",...e!==void 0?{record:e}:{}}:void 0;if(!u)return{ok:!1,error:'Say what to be told of: on is "act", "created", "changed" or "reaches", with a kind (or a record) for all but act. Nothing was kept.'};let l=y({schema:r.schema,allMutations:()=>t.store.allMutations(),graph:r.graph},u);if(l)return{ok:!1,error:`${l} Nothing was kept.`};let S=await t.subscriptions.add({who:a,app:t.app,when:u,...i.alsoMine===!0?{alsoMine:!0}:{}});return{ok:!0,data:{subscription:k(r,S)}}}export{A as runSubscriptionTool};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as J}from"./chunk.
|
|
1
|
+
import{b as J}from"./chunk.3ZIOAPI5.js";import{a as V,c as T,d as _,e as D}from"./chunk.QDHUDLJB.js";import"./chunk.ZVMIHXVK.js";import"./chunk.272ZJXQP.js";import"./chunk.3SM2CHKF.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as q,Q as k,Y as w,d as B,sa as j,wa as E,y as G}from"./chunk.6II4BONS.js";import{Ma as M,X as H,Z as I,aa as L,gb as W}from"./chunk.F5BCCGFK.js";import{b as f}from"./chunk.AJZBJBMO.js";function P(e){return{minHeight:24,padding:"3px 10px",borderRadius:6,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:e?"transparent":"var(--graview-edge)",color:e?"var(--graview-ink)":"var(--graview-ink-muted)",fontWeight:e?600:400,background:e?"color-mix(in srgb, var(--graview-accent) 16%, transparent)":"transparent"}}var A=f(k(),1);function K(){let{seats:e,principal:n,takeSeat:i}=w();return e.length<2?null:(0,A.jsxs)("div",{role:"group","aria-label":"Seat","data-testid":"seats",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,rowGap:4},children:[(0,A.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"As"}),e.map(r=>{let d=Q(n,r.principal);return(0,A.jsx)("button",{type:"button","aria-pressed":d,"data-testid":`seat-${r.principal.id??r.label}`,title:`Sit down as ${r.label}: the acts, the kinds and the pages narrow to what this seat may do`,onClick:()=>i(r.principal),style:{...P(d),whiteSpace:"nowrap"},children:r.label},r.principal.id??r.label)})]})}function Q(e,n){return e.kind===n.kind&&e.id===n.id}var C=f(q(),1),l=f(k(),1),X=`
|
|
2
2
|
.graview-here{display:flex;flex:none}
|
|
3
3
|
.graview-here>button{display:inline-flex;align-items:center;gap:4px;height:30px;margin:0;padding:0 4px;border:1px solid transparent;border-radius:8px;background:none;box-shadow:none;font:inherit;font-size:.75rem;color:var(--graview-ink-muted);cursor:pointer}
|
|
4
4
|
.graview-here-mark{display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;width:24px;height:24px;border-radius:50%;border:1.5px solid hsl(var(--graview-hue) 50% 48%);background:var(--graview-panel-muted);color:var(--graview-ink);font-size:.75rem;font-weight:600;box-shadow:0 0 0 2px var(--graview-bar)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{F as k,Q as n,a as t,xa as o}from"./chunk.6II4BONS.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__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.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.56BPXB6E.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./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.QTITRX5Q.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./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.ITXIFDQ7.js")))),E=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),W=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.6ZZZBDEG.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,E as d,W as e,M as f,N as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ab as k,eb as O,fb as P,hb as h,ib as A,kc as E,lc as G,mc as F,oc as J,pc as W}from"./chunk.F5BCCGFK.js";var I=(o,a)=>{let t=o.kindOf(a);return t===void 0?void 0:o.kept?.({id:a,kind:t})};function w(o,a){return o.flatMap(t=>{if(t.op!=="patch-node")return[t];let i=I(a,t.id);if(!i||!Object.keys(t.after).some(i))return[t];let c=r=>Object.fromEntries(Object.entries(r).filter(([f])=>!i(f))),s=c(t.after);return Object.keys(s).length===0?[]:[{op:"patch-node",id:t.id,before:c(t.before),after:s}]})}function _(o,a,t){if(!F(o,a))return t;let i=J(o,a),c=r=>o.graph.getNode(r)!==void 0||E(o.log).kindOf(r)!==void 0,s={...t};if(t.diff){let r=t.diff,f=G(o.log),l=o.log.length??o.log.all().length,u=t.ops?.[0]?.seq??l,x=k(a).id,y=(e,n)=>d=>f.writerAt(e,d,n),m=(e,n)=>i.shows(e.id)?i.servedWith(e,n):void 0,j=(e,n)=>e.flatMap(d=>m(d,n(d.id))??[]),S=e=>i.shows(e.from)&&i.shows(e.to)&&!h(e,i.sees),v=(e,n)=>t.ops?y(e,l):d=>n===void 0||n.includes(d)?x:f.writerAt(e,d,l),M=r.changedNodes.flatMap(e=>{let n=m(e.before,y(e.before.id,u)),d=m(e.after,v(e.after.id,e.fields));return n&&d?[{before:n,after:d,fields:e.fields.filter(p=>p in n||p in d)}]:[]}),D=new Set(r.changedNodes.map(e=>e.after.id)),g=new Map;for(let e of t.ops?.flatMap(n=>n.primitives)??t.primitives??[])e.op!=="patch-node"||D.has(e.id)||g.set(e.id,[...g.get(e.id)??[],...Object.keys(e.after)]);let B=[...g].flatMap(([e,n])=>{let d=o.graph.getNode(e);if(!d)return[];let p=m(d,y(e,u)),N=m(d,v(e,n));return p&&N&&JSON.stringify(p)!==JSON.stringify(N)?[{before:p,after:N,fields:n}]:[]});s.diff={addedNodes:j(r.addedNodes,e=>v(e)),removedNodes:j(r.removedNodes,e=>y(e,u)),changedNodes:[...M,...B],addedEdges:r.addedEdges.filter(S),removedEdges:r.removedEdges.filter(S),touched:[...r.touched.filter(i.shows),...[...g.keys()].filter(e=>i.shows(e)&&!r.touched.includes(e))]}}if(t.ops&&(s.ops=A(t.ops,i)),t.primitives){let r=s.ops;s.primitives=r?r.flatMap(f=>f.primitives):i.timeline?O(t.primitives,i.timeline,{served:(f,l)=>i.servedWith(f,l),edgeClean:f=>!h(f,i.sees),sees:i.sees},k(a).id):A([{id:"",seq:0,batch:"",author:{kind:"system"},intent:"",mutation:null,primitives:t.primitives,inverse:[],reads:[],writes:[],at:""}],i)[0].primitives}return i.kept&&s.primitives&&(s.primitives=w(s.primitives,i)),t.reads&&(s.reads=t.reads.filter(r=>i.shows(r)&&c(r))),t.writes&&(s.writes=t.writes.filter(i.shows)),t.intent!==void 0&&h(t.intent,i.sees)&&(s.intent=P),t.violationsAfter&&Object.assign(s,b?b(o,W(o,a),!!t.ops,s.primitives??[]):{introduces:[],resolves:[],violationsAfter:[]}),s}var b,z=o=>void(b=o);export{_ as a,z as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as he,b as xe,c as be,d as ie,e as I}from"./chunk.XDYAG276.js";import{c as A,e as re}from"./chunk.
|
|
1
|
+
import{a as he,b as xe,c as be,d as ie,e as I}from"./chunk.XDYAG276.js";import{c as A,e as re}from"./chunk.ZWZ5SEXT.js";import{a as te}from"./chunk.SG23JC6D.js";import{F as U,Q as Z,Y as ee,_ as ne}from"./chunk.6II4BONS.js";import{N as j,X as J,ec as Q}from"./chunk.F5BCCGFK.js";import{b as C}from"./chunk.AJZBJBMO.js";var w=C(U(),1);var P=C(U(),1),ke=(e,n)=>`graview:last-visit:${n??"anyone"}:${e.join(",")}`;function Pe(e,n,r){let t=new Set;for(let i of e)if(!(i.author.id!==void 0&&i.author.id===r)&&Date.parse(i.at)>n)for(let o of i.writes)t.add(o);return t}function oe(e,n,r){let t=ke(n,r?.id),[i]=(0,P.useState)(()=>{try{let o=globalThis.localStorage?.getItem(t);return o?Number(o):null}catch{return null}});return(0,P.useEffect)(()=>{let o=()=>{if(document.visibilityState==="hidden")try{globalThis.localStorage?.setItem(t,String(Date.now()))}catch{}};return document.addEventListener("visibilitychange",o),window.addEventListener("pagehide",o),()=>{document.removeEventListener("visibilitychange",o),window.removeEventListener("pagehide",o)}},[t]),(0,P.useMemo)(()=>i===null?new Set:Pe(e,i,r?.id),[e,i,r?.id])}function ae(e,n,r){let t=new Set;if(r===void 0)return t;t.add(r);for(let i of[...e.out(r),...e.in(r)])t.add(i.id);for(let i of n)if(i.author.id===r)for(let o of i.primitives)o.op==="add-node"&&t.add(o.node.id);return t}var g=C(Z(),1);function Se(e,n,r={x:0,y:0}){let t=(i,o)=>{let c=A(i,o,n.cell,n.tilt);return{x:n.originX+r.x+c.x,y:n.originY+r.y+c.y}};return[t(e.col,e.row),t(e.col+e.side,e.row),t(e.col+e.side,e.row+e.side),t(e.col,e.row+e.side)]}var B=e=>e.map(n=>`${n.x.toFixed(1)},${n.y.toFixed(1)}`).join(" ");function Ie({frame:e,width:n,height:r,pan:t,pinned:i,close:o,today:c,swallowed:y,chosen:p=[],onFocus:f}){let{selection:u,store:d,scheme:S,principal:x}=ee(),b=ne(),a=(0,w.useMemo)(()=>d.log.all(),[d,b]),m=oe(a,d.schema.kinds,x),$=(0,w.useMemo)(()=>ae(d.graph,a,x?.id),[d,a,x?.id]),se=te(),E=e.city,D=e.nodes.filter(l=>l.plot!==void 0&&Math.round(l.plane)===2),R=E?.cell??0,F=E?.tilt??.5,K=(0,w.useRef)(f);K.current=f;let le=(0,w.useCallback)(l=>!K.current||y?.current?!1:(K.current(l),!0),[y]),X=(0,w.useRef)(new Map),M=new Map;for(let l of D){let O=l.aggregate?.memberIds??[],v=re(d.schema,l.kind),z=s=>v?d.graph.getNode(s)?.[v.field]:void 0,L=O.filter(s=>p.includes(s)),G=`${R}|${F}|${l.plot.col},${l.plot.row},${l.plot.side}|${L.join(",")}|${O.map(s=>`${s}=${String(z(s))}`).join(",")}`,T=X.current.get(l.id);if(T&&T.key===G){M.set(l.id,T);continue}let V={cell:R,originX:0,originY:0,tilt:F},q={x:0,y:0},we=d.schema.tryDefinition(l.kind),ye=s=>{let h=d.graph.getNode(s);return h?J(we,h):s},k=v?v.values.map(()=>[]):[[]],N=v?[...v.tiers]:["waiting"];for(let s of L.length>0?[...L,...O.filter(h=>!L.includes(h))]:O){let h=v?v.values.indexOf(z(s)):0;h>=0?k[h].push(s):(k.length===N.length&&(k.push([]),N.push("waiting")),k[k.length-1].push(s))}let{blocks:pe,rests:ve}=I(l.plot,k,N.map(s=>ie[s])),me=Se(l.plot,V,q),H=v?Le(d.schema,l.kind):void 0;M.set(l.id,{key:G,tile:B(me),rests:ve.map(s=>({count:s.count,at:A(s.col,s.row,R,F)})),buildings:pe.map(s=>{let W=(H?d.graph.getNode(s.id):void 0)?.[H];return{id:s.id,tier:N[s.lane],overdue:typeof W=="string"&&N[s.lane]!=="done"&&W.slice(0,10)<(c??new Date().toISOString().slice(0,10)),name:ye(s.id),width:s.footprint*R,...Ce(s,V,q)}})})}if(X.current=M,!E)return null;let de={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},ge=u.join(`
|
|
2
2
|
`),ce=se.join(`
|
|
3
3
|
`),ue=m?[...m].join(`
|
|
4
4
|
`):"",fe=$?[...$].join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.TGEF6TMM.js";import"./chunk.D6RDTUX3.js";import"./chunk.BZ5VLPKB.js";import"./chunk.6II4BONS.js";import"./chunk.F5BCCGFK.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
|