graview 0.1.43 → 0.1.44
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.R2B2ZAWI.js → chunk.27ZVVPRZ.js} +1 -1
- package/dist/preview/{chunk.ONSG3OIL.js → chunk.2CPC3HQI.js} +1 -1
- package/dist/preview/{chunk.4HAGPMY6.js → chunk.2EXY4AHX.js} +4 -4
- package/dist/preview/{chunk.6AYTF53S.js → chunk.2O2THM2R.js} +1 -1
- package/dist/preview/{chunk.MI2HL3LQ.js → chunk.3IUJ4GW7.js} +1 -1
- package/dist/preview/{chunk.XBV4WO7D.js → chunk.3L7OEBJH.js} +1 -1
- package/dist/preview/{chunk.T4QT5SZY.js → chunk.3M4VCAA3.js} +1 -1
- package/dist/preview/{chunk.OUN2H3TR.js → chunk.3OKJ4GOA.js} +1 -1
- package/dist/preview/chunk.3PNDXNX6.js +1 -0
- package/dist/preview/{chunk.SGRKCQ2X.js → chunk.3TBH2FMZ.js} +1 -1
- package/dist/preview/{chunk.S6BZXNMV.js → chunk.4B4DKCS4.js} +1 -1
- package/dist/preview/{chunk.DYW4D74X.js → chunk.4EPT2CQG.js} +1 -1
- package/dist/preview/{chunk.7L6LYXCV.js → chunk.4JWT6LIS.js} +1 -1
- package/dist/preview/{chunk.FCPH4YZN.js → chunk.4WCQWILK.js} +1 -1
- package/dist/preview/{chunk.ZE6LJVVN.js → chunk.56DR42FA.js} +1 -1
- package/dist/preview/{chunk.3B47UX2J.js → chunk.5JPELFMA.js} +1 -1
- package/dist/preview/{chunk.OIJP6PQV.js → chunk.5WEEZ7WD.js} +1 -1
- package/dist/preview/{chunk.OH2N3SX7.js → chunk.64QDUERE.js} +1 -1
- package/dist/preview/{chunk.C5NOO4CC.js → chunk.6BIRNR5P.js} +1 -1
- package/dist/preview/{chunk.7MXQRSNR.js → chunk.6NFR2LYQ.js} +1 -1
- package/dist/preview/{chunk.5BJW4IPW.js → chunk.6VIZGLDK.js} +1 -1
- package/dist/preview/{chunk.5J2HETUO.js → chunk.7AEE3VHC.js} +1 -1
- package/dist/preview/{chunk.RDXDEFOC.js → chunk.7B5BZZBG.js} +1 -1
- package/dist/preview/chunk.7HL7CFXJ.js +1 -0
- package/dist/preview/{chunk.ZHRW2UF4.js → chunk.7JVBVB4A.js} +1 -1
- package/dist/preview/{chunk.XGRMQUFB.js → chunk.7PUFYK3B.js} +1 -1
- package/dist/preview/{chunk.CTSPNTDX.js → chunk.7UV7ODXU.js} +1 -1
- package/dist/preview/{chunk.6BU3GCHK.js → chunk.ALFW4ZJQ.js} +1 -1
- package/dist/preview/{chunk.EBTYR5CZ.js → chunk.ATKKTPJS.js} +1 -1
- package/dist/preview/chunk.AW2T3KFV.js +5 -0
- package/dist/preview/{chunk.DQR45N7V.js → chunk.B2CIQ66N.js} +1 -1
- package/dist/preview/{chunk.A3WOUDOG.js → chunk.B7FZLIAO.js} +1 -1
- package/dist/preview/{chunk.F6CPM7SL.js → chunk.BA4KQR5H.js} +1 -1
- package/dist/preview/{chunk.PEXPTDX7.js → chunk.CDFVEL2Y.js} +1 -1
- package/dist/preview/chunk.CSQNDAEK.js +1 -0
- package/dist/preview/{chunk.26SI4K3P.js → chunk.D2RK2KJD.js} +1 -1
- package/dist/preview/chunk.DAZEFSWI.js +1 -0
- package/dist/preview/{chunk.ZE4U4JBF.js → chunk.DGXWL4GC.js} +2 -2
- package/dist/preview/{chunk.XAXZCOZK.js → chunk.DLVNW4HU.js} +1 -1
- package/dist/preview/{chunk.IJ2AF3AW.js → chunk.EJAWDI2V.js} +1 -1
- package/dist/preview/{chunk.ZUJZVK2X.js → chunk.EJOTTZWZ.js} +1 -1
- package/dist/preview/{chunk.QWY54AVN.js → chunk.ESU2DD3J.js} +1 -1
- package/dist/preview/{chunk.C3X3R7LP.js → chunk.EW364363.js} +2 -2
- package/dist/preview/{chunk.25VAWLKJ.js → chunk.EYEIDL3T.js} +1 -1
- package/dist/preview/chunk.EZRGGPAN.js +1 -0
- package/dist/preview/{chunk.4P3LS2OE.js → chunk.F4DWRBO7.js} +1 -1
- package/dist/preview/{chunk.CW6IPHRR.js → chunk.FBIK4LTM.js} +2 -2
- package/dist/preview/{chunk.LDU25CCL.js → chunk.FIJNKSMQ.js} +1 -1
- package/dist/preview/{chunk.QXTLZSBL.js → chunk.FNF6XQI5.js} +1 -1
- package/dist/preview/chunk.FNXW46U4.js +349 -0
- package/dist/preview/chunk.FUYMLDNJ.js +7 -0
- package/dist/preview/{chunk.DZN26GKS.js → chunk.FVHECT47.js} +1 -1
- package/dist/preview/{chunk.N3FONYEP.js → chunk.GAN77YDU.js} +2 -2
- package/dist/preview/{chunk.XVWJD2DG.js → chunk.GBCWI2LF.js} +1 -1
- package/dist/preview/{chunk.7TU2PDYW.js → chunk.H4GHKBMH.js} +1 -1
- package/dist/preview/{chunk.HMABYAZR.js → chunk.HB34VQKQ.js} +1 -1
- package/dist/preview/chunk.HKA27VJO.js +1 -0
- package/dist/preview/{chunk.RQBX7M7Q.js → chunk.HKD5SR45.js} +2 -2
- package/dist/preview/{chunk.4YLBGGWT.js → chunk.HP72LB3B.js} +1 -1
- package/dist/preview/{chunk.DJ3BD7AZ.js → chunk.IBWPRK2R.js} +1 -1
- package/dist/preview/{chunk.BT6FUNQI.js → chunk.IIB22IIP.js} +1 -1
- package/dist/preview/{chunk.7XCBIID7.js → chunk.IN4PKQO5.js} +1 -1
- package/dist/preview/{chunk.KBMVUIWR.js → chunk.IPHWGBZE.js} +1 -1
- package/dist/preview/{chunk.JNCSGUO3.js → chunk.IQWKEGWG.js} +1 -1
- package/dist/preview/{chunk.FLMNHV6A.js → chunk.JEMQ66FT.js} +1 -1
- package/dist/preview/chunk.JGYGSNQY.js +1 -0
- package/dist/preview/{chunk.CO2ZPX3D.js → chunk.JLOSQ5UY.js} +2 -2
- package/dist/preview/{chunk.GZA5ZNLJ.js → chunk.JQ7WY2VZ.js} +1 -1
- package/dist/preview/chunk.JUT2VCFW.js +1 -0
- package/dist/preview/{chunk.R7F6UJVG.js → chunk.KERLVJ6I.js} +1 -1
- package/dist/preview/{chunk.6PF5LWRK.js → chunk.KSXB4LDF.js} +1 -1
- package/dist/preview/chunk.L6FWIQXS.js +1 -0
- package/dist/preview/{chunk.5TBK44MK.js → chunk.LKF4BBCW.js} +1 -1
- package/dist/preview/{chunk.NH6D6TWY.js → chunk.LKXYZK5H.js} +1 -1
- package/dist/preview/{chunk.KWQ67UK2.js → chunk.LULTKYE3.js} +1 -1
- package/dist/preview/{chunk.4ZHUGSJL.js → chunk.LUPBT6YM.js} +1 -1
- package/dist/preview/{chunk.AXJJUCWT.js → chunk.LYSHLKAX.js} +1 -1
- package/dist/preview/chunk.LYUPJ4VV.js +1 -0
- package/dist/preview/{chunk.Z56L6V6Z.js → chunk.MFLJIFZD.js} +1 -1
- package/dist/preview/{chunk.LBIDNJ6G.js → chunk.MOF2D6DV.js} +1 -1
- package/dist/preview/{chunk.MBOOUJOE.js → chunk.MWUP5X47.js} +1 -1
- package/dist/preview/{chunk.RSYFIL2Z.js → chunk.MZOIPCDA.js} +1 -1
- package/dist/preview/{chunk.WH2RYGXR.js → chunk.N5ULWKR4.js} +1 -1
- package/dist/preview/{chunk.6ROYIMQ2.js → chunk.NBOZPPSM.js} +1 -1
- package/dist/preview/{chunk.27QYTMXP.js → chunk.NPS2WN7T.js} +1 -1
- package/dist/preview/chunk.NTFCZYOR.js +1 -0
- package/dist/preview/{chunk.B2KDYES6.js → chunk.O4VSQ2ER.js} +1 -1
- package/dist/preview/{chunk.C3DX4LWD.js → chunk.OAWAUB4P.js} +1 -1
- package/dist/preview/{chunk.63DI7XNE.js → chunk.OG6GNGTX.js} +2 -2
- package/dist/preview/{chunk.Q5XICUDZ.js → chunk.OGF6UORU.js} +1 -1
- package/dist/preview/chunk.OK4FSBHI.js +1 -0
- package/dist/preview/{chunk.7IXLH7PR.js → chunk.P546VMA5.js} +1 -1
- package/dist/preview/{chunk.X5WB4GJ4.js → chunk.P5K7EYDK.js} +1 -1
- package/dist/preview/{chunk.T4Q6OLZU.js → chunk.PL2P2OON.js} +1 -1
- package/dist/preview/{chunk.EPPAFWP7.js → chunk.PSTE3LZL.js} +2 -2
- package/dist/preview/chunk.PX6VAZFJ.js +1 -0
- package/dist/preview/{chunk.6IEDQHKI.js → chunk.QJJKITXF.js} +1 -1
- package/dist/preview/{chunk.ZEC64CK6.js → chunk.QNJYXB3U.js} +1 -1
- package/dist/preview/{chunk.GSZYT6GF.js → chunk.RDGFZPKN.js} +1 -1
- package/dist/preview/{chunk.YKN2VWWQ.js → chunk.REEDZSCG.js} +2 -2
- package/dist/preview/{chunk.PWYMZWAN.js → chunk.REOYQTFP.js} +1 -1
- package/dist/preview/{chunk.4ZSHTUNK.js → chunk.RLMW7DU6.js} +1 -1
- package/dist/preview/{chunk.S2MP53RO.js → chunk.RNUGQRJI.js} +1 -1
- package/dist/preview/{chunk.YPEZZLOY.js → chunk.RVQYXPCM.js} +1 -1
- package/dist/preview/{chunk.4IDXQVSW.js → chunk.RYNCEZ6Q.js} +1 -1
- package/dist/preview/{chunk.RPDTWQKA.js → chunk.T6S3CEW7.js} +3 -3
- package/dist/preview/{chunk.FKLEIR4Y.js → chunk.TDCO7LEA.js} +1 -1
- package/dist/preview/{chunk.XFQUVMRI.js → chunk.TJO5Y2OJ.js} +1 -1
- package/dist/preview/{chunk.3HLNRVFY.js → chunk.TTSNHX3F.js} +1 -1
- package/dist/preview/{chunk.6XEATXZC.js → chunk.U3CV5CCL.js} +1 -1
- package/dist/preview/{chunk.TMBFLZNH.js → chunk.UG23RICT.js} +1 -1
- package/dist/preview/{chunk.U3ETEQDO.js → chunk.URCC626R.js} +1 -1
- package/dist/preview/{chunk.3GQL4K3Q.js → chunk.UXLJZIYX.js} +1 -1
- package/dist/preview/{chunk.OWL5GZ6U.js → chunk.UZSZPMRC.js} +1 -1
- package/dist/preview/{chunk.TX65ZO27.js → chunk.V4DR25S4.js} +1 -1
- package/dist/preview/{chunk.I4HUBO22.js → chunk.VAUG5TGZ.js} +1 -1
- package/dist/preview/{chunk.KG5R4GTK.js → chunk.WE5SA6TP.js} +1 -1
- package/dist/preview/chunk.WNYPP52L.js +1 -0
- package/dist/preview/{chunk.KR3J27IA.js → chunk.WPLKHIO5.js} +1 -1
- package/dist/preview/{chunk.ZRICIE6T.js → chunk.XPIDPZKS.js} +1 -1
- package/dist/preview/{chunk.WWR7Y2KE.js → chunk.Y2MIG2C2.js} +1 -1
- package/dist/preview/chunk.YE4GZVOX.js +1 -0
- package/dist/preview/{chunk.BYVE2NQY.js → chunk.YERDP6YF.js} +1 -1
- package/dist/preview/{chunk.7ROWZZN5.js → chunk.YGX2AE36.js} +1 -1
- package/dist/preview/{chunk.FTF67QE2.js → chunk.YTXEPWVW.js} +1 -1
- package/dist/preview/{chunk.T4M4MLOS.js → chunk.YTZDCIX2.js} +1 -1
- package/dist/preview/chunk.YYPK7IDM.js +1 -0
- package/dist/preview/{chunk.BYVLGDVJ.js → chunk.ZKBSEUK4.js} +1 -1
- package/dist/preview/{chunk.SKB4XSDG.js → chunk.ZN77U6SU.js} +1 -1
- package/dist/preview/{chunk.IJU322EP.js → chunk.ZP6PS5Z4.js} +1 -1
- package/dist/preview/chunk.ZZ5F5I3O.js +1 -0
- package/dist/preview/index.html +45 -45
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.22E4GKYU.js +0 -1
- package/dist/preview/chunk.2JMJTREH.js +0 -1
- package/dist/preview/chunk.4C65DXZB.js +0 -1
- package/dist/preview/chunk.64MP7636.js +0 -1
- package/dist/preview/chunk.6K4JBLOP.js +0 -1
- package/dist/preview/chunk.7MQ7UWVW.js +0 -5
- package/dist/preview/chunk.CXJXVBGF.js +0 -1
- package/dist/preview/chunk.E5PHLNXR.js +0 -1
- package/dist/preview/chunk.GNPYSMHA.js +0 -1
- package/dist/preview/chunk.IWUSCCZN.js +0 -1
- package/dist/preview/chunk.K6SPN4D6.js +0 -7
- package/dist/preview/chunk.MXU3VQSQ.js +0 -1
- package/dist/preview/chunk.NQTCOBOQ.js +0 -1
- package/dist/preview/chunk.O4X5WJIC.js +0 -1
- package/dist/preview/chunk.ORKXXLWD.js +0 -1
- package/dist/preview/chunk.QJUFVEAU.js +0 -1
- package/dist/preview/chunk.RY4E4JRI.js +0 -1
- package/dist/preview/chunk.VCOIFBUE.js +0 -1
- package/dist/preview/chunk.VP35BUUZ.js +0 -349
- package/dist/preview/chunk.YQDIVHCH.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I,b as H,c as T,e as D,h as V,i as R,j as A,k,l as x,n as Y,o as Z}from"./chunk.
|
|
1
|
+
import{a as I,b as H,c as T,e as D,h as V,i as R,j as A,k,l as x,n as Y,o as Z}from"./chunk.MWUP5X47.js";import{b as U}from"./chunk.KERLVJ6I.js";import{I as C,O as G,Va as F,X as M,Ya as B,ca as W,ea as j}from"./chunk.AW2T3KFV.js";function re(e,r){return e===void 0||e===!0?!0:e===!1?!1:e[r]!==!1}function te(e){let r={};return e.query&&e.query.trim().length>0&&(r.q=e.query),e.archived!==void 0&&e.archived!==!1&&(r.archived=String(e.archived)),e.sort&&(r.sort=e.sort.direction==="desc"?`${e.sort.by}:desc`:e.sort.by),e.filter?.length&&(r.filter=e.filter.map(n=>`${n.key}:${n.value}`).join(",")),e.group&&(r.group=e.group.bucket?`${e.group.by}:${e.group.bucket}`:e.group.by),r}function ne(e,r){let n=[],s={};if(e.query&&(s.query=e.query),e.archived!==void 0&&e.archived!==!1&&(s.archived=e.archived),e.sort&&(r.sorts.some(u=>u.key===e.sort.by)?s.sort=e.sort:n.push(`sort ${e.sort.by}`)),e.filter){let u=e.filter.filter(c=>r.filters.find(f=>f.key===c.key)?!0:(n.push(`filter ${c.key}`),!1));u.length>0&&(s.filter=u)}return e.group&&(r.groups.some(u=>u.key===e.group.by)?s.group=e.group:n.push(`group ${e.group.by}`)),{arrangement:s,dropped:n}}function S(e,r){return W(e.schema.tryDefinition(r.kind),A(r))}var oe=(e,r)=>e==null?r==null?0:1:r==null?-1:typeof e=="number"&&typeof r=="number"?e-r:typeof e=="boolean"&&typeof r=="boolean"?e===r?0:e?1:-1:String(e).localeCompare(String(r),void 0,{numeric:!0,sensitivity:"base"});function ie(e,r,n){if(n==="label")return S(e,r);let s=e.schema.tryDefinition(r.kind);return s&&n in(s.fields.shape??{})?F(R(r),n,e.today??C()):s?.computed?.[n]!==void 0?e.read?.(r,n):k(e.graph,r.id,n).map(c=>S(e,c)).sort()[0]}var se=/^(\d{4})-(\d{2})-(\d{2})/;function _(e,r){let n=se.exec(e);if(!n)return;let[,s,u,c]=n;if(r==="day")return`${s}-${u}-${c}`;if(r==="month")return`${s}-${u}-01`;if(r==="year")return`${s}-01-01`;if(r==="decade")return`${String(Number(s)-Number(s)%10).padStart(4,"0")}-01-01`;let a=new Date(Date.UTC(Number(s),Number(u)-1,Number(c))),f=(a.getUTCDay()+6)%7;return a.setUTCDate(a.getUTCDate()-f),a.toISOString().slice(0,10)}function de(e,r){return r==="month"?M(e):r==="week"?`Week of ${G(e)}`:r==="year"?e.slice(0,4):r==="decade"?`The ${e.slice(0,4)}s`:G(e)}function ue(e,r,n){return z(e,n)(r)}function z(e,r){let{words:n,conditions:s}=Y(r);if(n.length===0&&s.length===0)return()=>!0;let u=new Map,c=a=>{let f=u.get(a);return f||(f=new Set(D(e.schema,a).filters.map(d=>d.key)),u.set(a,f)),f};return a=>{let f=c(a.kind),d=s.filter(i=>f.has(i.key));return d.every(i=>x(e,a,i))?n.length>0?Z(e.schema.tryDefinition(a.kind),A(a),n,e.searchIn)!==void 0:d.length>0:!1}}function ae(e,r,n){let s=r.query?.trim(),u=r.archived===void 0?e:e.filter(t=>B(t,r.archived)),c=s?u.filter(z(n,s)):u,a=r.filter?.length?c.filter(t=>r.filter.every(l=>x(n,t,l))):[...c],f=[];for(let t=r.sort;t&&f.length<4;t=t.then)f.push(t);let d=f.length>0?a.map((t,l)=>({node:t,index:l,values:f.map(o=>ie(n,t,o.by))})).sort((t,l)=>{for(let[o,p]of f.entries()){let[h,K]=[t.values[o],l.values[o]],v=oe(h,K),E=p.direction==="desc"&&v!==0&&h!==void 0&&K!==void 0?-v:v;if(E!==0)return E}return t.index-l.index}).map(t=>t.node):a,i=r.group;if(!i)return{nodes:d,groups:[{key:"",label:"",nodes:d}],grouped:!1};let y=new Map,g=(t,l,o)=>{let p=y.get(t)??{label:l,nodes:[]};p.nodes.push(o),y.set(t,p)},N=d[0],m=N?n.schema.tryDefinition(N.kind):void 0,O=m?.fields.shape??{},J=m?I(m,i.by):j(i.by),$=i.by in O,b=$?H(O[i.by]):void 0,X=T(n.schema,N?.kind??"").find(t=>t.key===i.by)?.label,L=$?`No ${J.toLowerCase()}`:`Without ${(X??j(i.by)).toLowerCase()}`,q=$?new Map:U([...new Map(d.flatMap(t=>k(n.graph,t.id,i.by)).map(t=>[t.id,t])).values()].map(A),t=>n.schema.tryDefinition(t));for(let t of d){if($){let o=F(R(t),i.by,n.today??C());if(o==null||o==="")g("",L,t);else if(b==="date"){let p=i.bucket??"day",h=_(String(o),p);h?g(h,de(h,p),t):g("",L,t)}else if(b==="boolean")g(o?"1":"0",o?"Yes":"No",t);else{let p=m?.display?.format?.[i.by];g(String(o),p?p(o):String(o),t)}continue}let l=k(n.graph,t.id,i.by).map(o=>({id:o.id,label:q.has(o.id)?`${S(n,o)} \xB7 ${q.get(o.id)}`:S(n,o)})).sort((o,p)=>o.label.localeCompare(p.label));l.length===0?g("",L,t):g(l.map(o=>o.id).join(","),l.map(o=>o.label).join(", "),t)}let w=b==="choice"?V(O[i.by]):void 0,ee=[...y.entries()].sort(([t,l],[o,p])=>t===""?1:o===""?-1:w?w.indexOf(t)-w.indexOf(o):b==="boolean"?o.localeCompare(t):b==="date"?t.localeCompare(o):l.label.localeCompare(p.label)).map(([t,l])=>({key:t,label:l.label,nodes:l.nodes}));return{nodes:d,groups:ee,grouped:!0}}function P(e){if(e===void 0)return;if(typeof e=="string")return{by:e,direction:"asc"};let r=e.then===void 0?void 0:typeof e.then=="string"?{by:e.then,direction:"asc"}:{by:e.then.by,direction:e.then.direction??"asc"};return{by:e.by,direction:e.direction??"asc",...r?{then:r}:{}}}function Q(e){if(e!==void 0)return typeof e=="string"?{by:e}:e}function fe(e){let r=P(e?.sort),n=Q(e?.group);if(!(!r&&!n))return{...r?{sort:r}:{},...n?{group:{by:n.by}}:{}}}var le=(e,r)=>r?e==="1"?"true":"false":e;function ce(e,r,n){let s=n.type==="boolean",u=s?["true","false"]:n.options??[],c=[...new Set([...(r.order??[]).filter(d=>u.includes(d)),...u])],a=r.closed??[],f=d=>{if(d.key==="")return[1,0];let i=le(d.key,s);if(a.includes(i))return[2,a.indexOf(i)];let y=c.indexOf(i);return[0,y<0?c.length:y]};return e.map((d,i)=>({group:d,at:i,rank:f(d)})).sort((d,i)=>d.rank[0]-i.rank[0]||d.rank[1]-i.rank[1]||d.at-i.at).map(({group:d,rank:i})=>({...d,closed:i[0]===2}))}export{Q as a,fe as b,ce as c,re as d,te as e,ne as f,ue as g,ae as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as a}from"./chunk.
|
|
1
|
+
import{g as a}from"./chunk.3IUJ4GW7.js";import{c as p}from"./chunk.UG23RICT.js";import{Fa as d}from"./chunk.AW2T3KFV.js";function v(n){let r=new Map;for(let i of n.kinds){let e=n.tryDefinition(i),o=a(e),s=d(e);r.set(i,{fields:new Set(Object.keys(e?.fields?.shape??{})),edges:new Map(Object.entries(e?.edges??{}).map(([l,h])=>[l,h.cardinality??"many"])),...o?{computed:o}:{},...s.size>0?{linked:s}:{}})}let t=a(n);return t&&r.set(p,{computed:t}),r}export{v as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as z,h as D,i as H}from"./chunk.
|
|
1
|
+
import{g as z,h as D,i as H}from"./chunk.PSTE3LZL.js";import{a as P,b as A,c as p,d as W}from"./chunk.UGFDSE37.js";import"./chunk.JGYGSNQY.js";import"./chunk.JLOSQ5UY.js";import"./chunk.FNF6XQI5.js";import"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.YERDP6YF.js";import"./chunk.P5K7EYDK.js";import"./chunk.7AEE3VHC.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.JEMQ66FT.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import{a as C,b as O}from"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{Ea as k,G as B,R as L}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import{wc as R}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as E}from"./chunk.AJZBJBMO.js";var r=E(B(),1);var s=E(L(),1);function M(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let n=c??document,o=n.querySelector("main")??n.querySelector("[data-graview-page]")??null,t=n.querySelector("[data-graview-page-title]")??o?.querySelector("h1, h2")??o;t instanceof HTMLElement&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}))}var I=1500;function N(c,e,n){let{store:o,principal:t}=c,l=z(o),g=(0,r.useMemo)(()=>P(o,t),[o,t,l]),w=(0,r.useRef)(n),[b,d]=(0,r.useState)(),[y,u]=(0,r.useState)("");(0,r.useEffect)(()=>{let a=A(o,t,w.current);w.current=o.batches().length,a&&(d({batch:a.batch,at:e,when:Date.now()}),u(""))},[o,t,l]),(0,r.useEffect)(()=>{d(a=>!a||a.at===e?a:Date.now()-a.when<I?{...a,at:e}:void 0)},[e]);let[x,i]=(0,r.useState)(null),v=(0,r.useCallback)(()=>{d(void 0),i(null)},[]),f=(0,r.useCallback)(()=>{i(null);try{let a=W(o,t);a&&u(`Took back \u201C${a.intent}\u201D`)}catch(a){i(a instanceof Error?a.message:String(a))}},[o,t]),S=g&&b?.batch===g.batch&&b.at===e?g:void 0;return{change:g,offered:S,close:v,takeBack:f,refused:x,said:y}}function ee({context:c,docked:e,at:n,since:o,compact:t=!1,className:l,size:g}){let{change:w,offered:b,close:d,takeBack:y,refused:u,said:x}=N(c,n,o),i=e?b:w,v=(0,r.useRef)(null),f=e&&(i!==void 0||u!==null);j(v,f),(0,r.useEffect)(()=>{if(!f)return;let m,h=()=>m=setTimeout(()=>v.current?.matches(":hover, :focus-within")?h():d(),1e4);return h(),()=>clearTimeout(m)},[f,i?.batch,u,d]);let S=x||(e&&i?p(i):""),a=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:R("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...f?{}:{display:"none"}}:{},T=i?(0,s.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${p(i)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");y(),requestAnimationFrame(()=>M(h))},...e?{style:U}:{className:H("graview-undo",l),...D(g),...t?{"data-compact":"","aria-label":p(i)}:{}},children:[(0,s.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),e?(0,s.jsx)("span",{style:K,children:p(i)}):(0,s.jsx)("span",{className:"graview-undo-words",children:t?"Undo":p(i)})]}):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{role:"status","aria-live":"polite",style:V,children:S}),(0,s.jsxs)("div",{ref:v,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",...e?{style:{...F,...a}}:{className:"graview-undo-place"},children:[e?null:(0,s.jsx)("style",{children:q}),e&&i?(0,s.jsxs)("div",{"data-testid":"page-undo-notice",style:Z,children:[T,(0,s.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${p(i)}`,title:"Dismiss",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");d(),requestAnimationFrame(()=>M(h))},style:$,children:"\xD7"})]}):T,u?(0,s.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",className:"graview-undo-refused",...e?{style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",borderRadius:6,background:"var(--graview-float)",padding:"4px 8px"}}:{},children:u}):null]})]})}function j(c,e){(0,r.useLayoutEffect)(()=>{let n=c.current;if(!n||!e)return;if(typeof n.showPopover=="function"&&!k(n))try{n.showPopover()}catch{}let o=()=>n.parentElement?.closest("[data-embed-content]")??null,t=()=>{O(n,o()),dispatchEvent(new Event(C))};t(),addEventListener("resize",t),addEventListener("scroll",t,!0);let l=typeof ResizeObserver=="function"?new ResizeObserver(t):null;return l?.observe(n),()=>{if(l?.disconnect(),removeEventListener("resize",t),removeEventListener("scroll",t,!0),n.isConnected&&k(n))try{n.hidePopover()}catch{}dispatchEvent(new Event(C))}},[c,e])}var q=`:where(.graview-undo-place){display:grid;justify-items:end;gap:4px;max-width:100%;min-width:0}
|
|
2
2
|
:where(.graview-undo){box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;min-height:var(--graview-control-height,36px);max-width:min(100%,var(--graview-undo-widest,18rem));min-width:0;padding:0 14px;border-radius:999px;border:1px solid var(--graview-edge);background:var(--graview-float);color:var(--graview-ink);font:inherit;font-size:.875rem;cursor:pointer}
|
|
3
3
|
:where(.graview-undo[data-size=sm]){--graview-control-height:30px}
|
|
4
4
|
:where(.graview-undo[data-compact]){padding:0 10px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.QNJYXB3U.js";import{D as v,G as I,R as h,_ as w}from"./chunk.4JWT6LIS.js";import{Wa as g}from"./chunk.AW2T3KFV.js";import{b as d}from"./chunk.AJZBJBMO.js";var k=d(I(),1);var t=d(h(),1),r={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function E({shows:e,onShows:i,mine:a,onMine:l}){let o={all:"All",changes:"Changes",ai:"AI"};return(0,t.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(s=>(0,t.jsx)("button",{type:"button","data-shows":s,"aria-pressed":e===s,onClick:()=>i(s),style:{...r,...e===s?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:o[s]},s)),(0,t.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>l(!a),style:{...r,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var x=e=>e.ask.kind==="suggest"?"suggest":e.ask.kind==="fill"?"fill in":e.ask.kind==="record"?"add one":e.ask.kind==="panel"?"draw a panel":`answer \u201C${e.ask.said}\u201D`;function $(e){let i=e.offered.filter(a=>e.accepted?.includes(a.id)).map(a=>a.label);switch(e.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${e.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return e.panel?`Drew \u201C${e.panel.title}\u201D`:"Drew a panel";case"failed":return e.failed??"Failed";default:return"Offered, not yet taken"}}function C(e){let i=[...new Set((e.usage??[]).map(o=>o.model))];if(i.length===0)return null;let a=(e.usage??[]).flatMap(o=>o.costUsd===void 0?[]:[o.costUsd]),l=a.length>0?a.reduce((o,s)=>o+s,0):void 0;return`${i.join(", ")}${l!==void 0?` \xB7 $${l<.01?l.toPrecision(2):l.toFixed(2)}`:""}`}function F({entry:e,undo:i}){let{store:a,principal:l,seats:o,people:s,ai:b}=w(),c=y(),[p,u]=(0,k.useState)(!1),A=e.by.kind==="human"&&e.by.onBehalfOf===void 0&&(e.by.id===void 0||l.id===void 0||e.by.id===l.id)?"you":g(e.by,{graph:a.graph,schema:a.schema,seats:o,people:s}),f=C(e),S=v(b),m=n=>{u(!0),(__graviewPreload(import.meta.url,["./chunk.REEDZSCG.js","./chunk.OGF6UORU.js","./chunk.UT6642FC.js","./chunk.3TBH2FMZ.js","./chunk.WE5SA6TP.js","./chunk.QNJYXB3U.js","./chunk.TI4OSTQV.js","./chunk.PL2P2OON.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.WNYPP52L.js")).then(n).finally(()=>u(!1))};return(0,t.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":e.id,"data-outcome":e.outcome,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:(0,t.jsxs)("span",{style:{minWidth:0},children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:A})," ",(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["asked AI to ",x(e)]}),(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.targetLabel]})]})}),e.offered.length>0&&e.outcome!=="accepted"&&e.outcome!=="partly"?(0,t.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",e.offered.map(n=>n.label).join(", ")]}):null,(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{"data-testid":"interaction-outcome",style:{color:e.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:$(e)}),(e.batches??[]).map(n=>(0,t.jsx)("span",{"data-interaction-batch":n,style:{marginLeft:"auto"},children:i(n)},n))]}),f?(0,t.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,S?(0,t.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.panel?(0,t.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:p,onClick:()=>m(n=>n.drawPanel(c,e.panel)),style:r,children:"Show the panel"}):null,(0,t.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:p,onClick:()=>m(n=>n.askAgain(c,e)),style:r,children:"Ask again"})]}):null]})}export{E as a,F as b};
|
|
@@ -1,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{d as C,e as re}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as C,e as re}from"./chunk.IIB22IIP.js";import{e as ee}from"./chunk.MWUP5X47.js";import{b as S}from"./chunk.4EPT2CQG.js";import{m as X}from"./chunk.FNXW46U4.js";import{Da as J,G as se,Ha as Q,R as Z,ua as V}from"./chunk.4JWT6LIS.js";import{a as K}from"./chunk.SDO3U72B.js";import{O as Y,U as M,ca as U}from"./chunk.AW2T3KFV.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Re=9,le=40,ge=2;function de(e){let r=new Map;for(let i of e.allNodes())r.set(i.kind,(r.get(i.kind)??0)+1);return r}var ue=(e,r)=>(e.far??[]).reduce((i,a)=>i+(r.get(a)??0),0);function ce(e,r,i){if(i)return i.flatMap(s=>e.filters.filter(u=>u.key===s));let a=de(r),o=new Set(e.filters.filter(s=>s.about==="edge"&&ue(s,a)>le).map(s=>s.key));return e.filters.filter(s=>s.about==="edge"?!o.has(s.key):s.about==="via"?o.has(s.key.split(".")[0]):!0)}function pe(e,r){let i=e.filter(a=>a.about==="field"&&a.type==="choice"&&(a.options?.length??0)>0);return r?i:i.slice(0,ge)}var fe=520;function ye(e,r,i,a){let o=i.filters.find(s=>s.key===a.key);if(!o)return`${a.key}: ${a.value}`;if(o.about==="is")return a.value.charAt(0).toUpperCase()+a.value.slice(1);if(o.about==="via")return`${o.label}: ${S(e.tryDefinition(o.far?.[0]??""),o.key.split(".")[1],a.value)}`;if(o.about==="edge"){if(a.value==="*")return`${o.label}: anything`;if(a.value==="none")return`${o.label}: nothing`;let s=r.getNode(a.value);return`${o.label}: ${s?U(e.tryDefinition(s.kind),s):a.value}`}if(o.type==="date"){let[s,u]=a.value.split(":");return`${o.label} ${s} ${u?Y(u):""}`.trim()}if(o.type==="boolean")return`${o.label}: ${a.value==="true"?"yes":"no"}`;if(o.type==="number"){let s=a.value.lastIndexOf(":"),u=a.value.slice(0,Math.max(0,s));if(u==="at-most"||u==="at-least")return`${o.label}: ${u==="at-most"?"at most":"at least"} ${S(e.tryDefinition(i.kind),o.key,Number(a.value.slice(s+1)))}`}return o.type==="text"?`${o.label}: ${a.value}`:`${o.label}: ${S(e.tryDefinition(i.kind),o.key,a.value)}`}var P=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function me(e){return e?.type==="date"?{asc:"Earliest first",desc:"Latest first"}:e?.type==="number"?{asc:"Lowest first",desc:"Highest first"}:e?.type==="boolean"?{asc:"No first",desc:"Yes first"}:e?.type==="choice"?{asc:"In their order",desc:"In reverse order"}:{asc:"A to Z",desc:"Z to A"}}var x=V(K(()=>(__graviewPreload(import.meta.url,["./chunk.JEMQ66FT.js","./chunk.7UV7ODXU.js","./chunk.IIB22IIP.js","./chunk.MWUP5X47.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.D2RK2KJD.js")))),N=x.part((e,r)=>(0,n.jsx)(e.ArrangeLists,{...r}),{what:"This list",quiet:!0}),he=x.part((e,r)=>(0,n.jsx)(e.ArrangeChips,{...r}),{what:"This list",quiet:!0}),Te=()=>x.load(),q=new Map;function Ie(e){let{schema:r,graph:i,kind:a,arrangement:o,onChange:s}=e,u=e.offers??ee(r,a),g=e.testId??"arrange",y=C(e.allow,"sort")&&u.sorts.length>1,m=C(e.allow,"group")&&u.groups.length>0,F=C(e.allow,"filter")?ce(u,i,e.filters):[],L=e.chips?pe(F,e.filters):[],H=F.filter(t=>!L.includes(t)),G=H.length>0,_=e.query!==!1&&e.allow!==!1,w=we(e.noun,e.kept),v=e.past&&e.past.count>0?e.past:null;if(!y&&!m&&!G&&!_&&!w&&!v)return null;let z=t=>JSON.stringify(re(t)),O=`${g}|${a}`,p={current:q.get(O)??{words:new Set,latest:null,at:0}};q.set(O,p.current),p.current.latest&&Date.now()-p.current.at>1500&&!p.current.words.has(z(o))&&(p.current={words:new Set,latest:null,at:0},q.set(O,p.current));let d=p.current.latest??o,b=t=>{let l={...p.current.latest??o,...t};for(let c of Object.keys(l))l[c]===void 0&&delete l[c];p.current.latest=l,p.current.at=Date.now(),p.current.words.add(z(l)),s(l)},f=d.filter??[],R=t=>{let l=f.filter((c,I)=>I!==t);b({filter:l.length>0?l:void 0})},A=t=>f.some(l=>l.key===t.key&&l.value===t.value),te=t=>A(t)?R(f.findIndex(l=>l.key===t.key&&l.value===t.value)):b({filter:[...f,t]}),T=d.sort?u.sorts.find(t=>t.key===d.sort.by):void 0,j=d.group?u.groups.find(t=>t.key===d.group.by):void 0,ne=me(T),k={schema:r,graph:i,offers:{...u,filters:H},arrangement:d,set:b,toggle:te,has:A,testId:g},ae=(t,l)=>A({key:t,value:l})?R(f.findIndex(c=>c.key===t&&c.value===l)):b({filter:[...f.filter(c=>c.key!==t),{key:t,value:l}]}),oe=d.sort?(0,n.jsxs)(n.Fragment,{children:["Sorted by ",P(T?.label??d.sort.by),(0,n.jsx)("span",{"aria-hidden":"true",children:d.sort.direction==="desc"?" \u2193":" \u2191"})]}):"Sort",ie=d.group?.bucket&&j?.buckets?`, a ${d.group.bucket} each`:"",B=d.group?`Grouped by ${P(j?.label??d.group.by)}${ie}`:"Group";return(0,n.jsxs)("div",{"data-testid":`${g}-bar`,role:"group","aria-label":"Arrange",className:"graview-arrange",style:e.style,onPointerEnter:x.prefetch,onFocus:x.prefetch,children:[(0,n.jsx)("style",{children:xe}),(0,n.jsxs)("div",{className:"graview-arrange-line",children:[w?(0,n.jsxs)("span",{className:"graview-arrange-count","data-testid":`${g}-count`,children:[w.kept?(0,n.jsx)("span",{"data-testid":`${g}-kept`,children:w.kept}):null,w.words]}):null,v?(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":`${g}-past`,title:`${M(v.count)} more behind the horizon \u2014 press to widen the view to the past`,onClick:t=>{let l=t.currentTarget.closest("[data-graview-view]"),c=t.currentTarget;v.widen();let I=0,W=()=>{if(document.activeElement!==c&&document.activeElement!==document.body&&c.isConnected)return;let $=l?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if($&&$!==c&&$.isConnected)return $.focus({preventScroll:!0});++I<120&&requestAnimationFrame(W)};requestAnimationFrame(W)},children:["+",M(v.count)," past"]}):null,f.map((t,l)=>{let c=ye(r,i,u,t);return(0,n.jsxs)("span",{className:"graview-arrange-token","data-testid":`${g}-condition`,children:[c,(0,n.jsx)("button",{type:"button","aria-label":`Remove: ${c}`,title:"Remove",onClick:()=>R(l),children:"\xD7"})]},`${t.key}:${t.value}`)}),y?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-sort`,value:d.sort?.by??"",set:d.sort!==void 0,label:"Sort",name:d.sort?`Sorted by ${P(T?.label??d.sort.by)}, ${ne[d.sort.direction].toLowerCase()}`:"Sort",list:t=>(0,n.jsx)(N,{which:"sort",done:t,...k}),children:oe})}):null,m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-group`,value:d.group?.by??"",set:d.group!==void 0,label:"Group",name:B,list:t=>(0,n.jsx)(N,{which:"group",done:t,...k}),children:B})}):null,G?(0,n.jsx)("span",{className:"graview-arrange-part",children:(0,n.jsx)(E,{testId:`${g}-add`,value:"",set:!1,label:"Filter",name:f.length>0?`Filter \u2014 ${f.length} on`:"Filter",list:t=>(0,n.jsx)(N,{which:"filter",done:t,...k}),children:"Filter"})}):null,y||m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-all",children:(0,n.jsx)(E,{testId:`${g}-all`,value:"",set:!1,label:"Arrange",name:"Arrange: sort and group",list:t=>(0,n.jsx)(N,{which:"all",done:t,parts:{sort:y,group:m,filter:!1},...k}),children:"Arrange"})}):null,_?(0,n.jsxs)("label",{className:"graview-arrange-words-at",children:[(0,n.jsx)("span",{style:X,children:"Find"}),(0,n.jsx)("input",{type:"search",className:"graview-arrange-words","data-testid":`${g}-query`,value:d.query??"",placeholder:"Find\u2026",onChange:t=>b({query:t.target.value.length>0?t.target.value:void 0})})]}):null,L.length>0&&e.chips?(0,n.jsx)(h.Suspense,{fallback:null,children:(0,n.jsx)(he,{offers:L,chips:e.chips,schema:r,graph:i,kind:a,arrangement:d,has:A,choose:ae,testId:g})}):null]})]})}function we(e,r){if(!r)return null;let i=r.shown!==r.of;if(!e)return i?{words:"",kept:`${r.shown} of ${r.of}`}:null;let a=r.of===1?e.one:e.many;return i?{words:` ${a}`,kept:`${r.shown} of ${r.of}`}:{words:`${r.of} ${a}`}}function E({testId:e,value:r,set:i,label:a,name:o,list:s,children:u}){let g=Q("arrange",{align:"start"}),y=(0,h.useRef)(null);return(0,h.useEffect)(()=>{g.open&&y.current?.querySelector('[aria-pressed="true"]')?.focus({preventScroll:!0})},[g.open]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":e,"data-set":i?"":void 0,value:r,"aria-label":o,...g.trigger,onClick:g.toggle,children:[u,(0,n.jsx)(be,{})]}),g.open?(0,n.jsx)("div",{...g.pane,ref:m=>{g.pane.ref(m),y.current=m},role:"group","aria-label":a,"data-testid":"arrange-list","data-arrange":e,className:"graview-arrange-list",style:J,onKeyDown:ve,children:s(()=>g.setOpen(!1))}):null]})}function ve(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let r=[...e.currentTarget.querySelectorAll("button:not([disabled]), input")];if(r.length===0)return;let i=r.indexOf(document.activeElement);if(document.activeElement instanceof HTMLInputElement&&document.activeElement.type==="date"&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return;e.preventDefault();let a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowDown"?(i+1)%r.length:(i-1+r.length)%r.length;r[a].focus()}function be(){return(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto",opacity:.7},children:(0,n.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var xe=`
|
|
2
2
|
.graview-arrange{container-type:inline-size;box-sizing:border-box;width:100%;min-width:0;max-width:100%}
|
|
3
3
|
.graview-arrange-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;font-size:.875rem;line-height:1.35;color:var(--graview-ink-muted)}
|
|
4
4
|
.graview-arrange-count{margin-right:2px;color:var(--graview-ink-muted)}
|
|
@@ -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{a as ne}from"./chunk.RNUGQRJI.js";import{o as be,p as te,s as V,t as Me}from"./chunk.ATKKTPJS.js";import{m as X,n as we,o as ke,p as Z,q as ee}from"./chunk.OJGHDWI6.js";import{c as Se}from"./chunk.4EPT2CQG.js";import{b as pe,c as ve,d as j,e as J,g as ye,o as Ae}from"./chunk.FNXW46U4.js";import{$ as B,Aa as Q,D as q,F as K,G as O,J as me,O as fe,R as M,_ as A,aa as _,m as ce,sa as ge,ta as he,ua as T,v as ue,ya as F,z as de}from"./chunk.4JWT6LIS.js";import{a as E}from"./chunk.SDO3U72B.js";import{Sc as le,ha as z,rc as ae,wc as se}from"./chunk.AW2T3KFV.js";import{b as y}from"./chunk.AJZBJBMO.js";var P=y(O(),1),D=y(M(),1),re=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.5WEEZ7WD.js")))),De=re.part(t=>(0,D.jsx)(t.HoverChipDoor,{}),{quiet:!0}),xe="A",$=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.KSXB4LDF.js","./chunk.CDFVEL2Y.js","./chunk.T6S3CEW7.js","./chunk.6NFR2LYQ.js","./chunk.HJCQ6I3S.js","./chunk.B7FZLIAO.js","./chunk.N5ULWKR4.js","./chunk.6BIRNR5P.js","./chunk.GBCWI2LF.js","./chunk.7PUFYK3B.js","./chunk.QJJKITXF.js","./chunk.7AEE3VHC.js","./chunk.LKF4BBCW.js","./chunk.JUT2VCFW.js","./chunk.IIB22IIP.js","./chunk.MWUP5X47.js","./chunk.OK4FSBHI.js","./chunk.DAZEFSWI.js","./chunk.OGF6UORU.js","./chunk.UT6642FC.js","./chunk.3TBH2FMZ.js","./chunk.WE5SA6TP.js","./chunk.TI4OSTQV.js","./chunk.TDCO7LEA.js","./chunk.ESU2DD3J.js","./chunk.PL2P2OON.js","./chunk.27ZVVPRZ.js","./chunk.IN4PKQO5.js","./chunk.3IUJ4GW7.js","./chunk.UG23RICT.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.5JPELFMA.js"))));var Ce=$.part((t,e)=>(0,D.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let d=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(d)}let r=setTimeout(e,2500);return()=>clearTimeout(r)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:r,ai:d}=A(),c=Me(),v=K(d),o=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:r,prepareSections:c,chipsOn:v});o.current={aimAt:t,store:e,principal:n,providers:r,prepareSections:c,chipsOn:v},(0,P.useEffect)(()=>{if(typeof document>"u")return;let i=null,w=null,k=null,f=h=>{let u=o.current,b=u.chipsOn?u.aimAt(h):null;b&&(k=h,re.load().then(H=>{k===h&&H.restOn(b,h)},()=>{}))},l=()=>{i&&clearTimeout(i.timer),i=null},p=h=>{let u=o.current,b=u.aimAt(h);if(!b)return;let H=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,u.store.log.length]);H!==w&&(w=H,u.prepareSections(b),$.load().then(Pe=>Pe.prepareActs(u.store,b,{principal:u.principal,providers:u.providers}),()=>{}))},a=h=>h.target instanceof Element?h.target.closest(Ne):null,m=h=>{if(h.pointerType==="touch")return;let u=a(h);u!==null&&u===i?.element||(l(),u!==null&&(i={element:u,timer:setTimeout(()=>{i=null,p(u),f(u)},Oe)}))},g=h=>{let u=h.relatedTarget;k!==null&&!(u instanceof Node&&k.contains(u))&&(k=null,re.current?.leaveRest()),i!==null&&(u instanceof Node&&i.element.contains(u)||l())},S=h=>{if(h.pointerType==="mouse")return;let u=a(h);u&&p(u)},I=h=>{if(!ge())return;let u=a(h);u&&p(u)};return document.addEventListener("pointerover",m,{passive:!0}),document.addEventListener("pointerout",g,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{l(),document.removeEventListener("pointerover",m),document.removeEventListener("pointerout",g),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function ot({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:r,setMenuAt:d,registerActsDoor:c,ai:v}=A(),{selection:o}=F();We(n??Re),(0,P.useEffect)(()=>{if($.current)return;let l=()=>{g(),$.prefetch()},p=()=>{},a=he(()=>void(p=Le(l))),m=["pointerdown","keydown"];for(let S of m)document.addEventListener(S,l,{capture:!0,passive:!0});function g(){a(),p();for(let S of m)document.removeEventListener(S,l,{capture:!0})}return g},[]),(0,P.useEffect)(()=>{if(t==="menu")return c({key:xe,open:e??(l=>{let p=l.getBoundingClientRect(),a=l.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??l.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;d({x:Math.round(p.left+Math.min(16,p.width/2)),y:Math.round(Math.min(p.bottom,p.top+36)),...a?{on:a}:{}})})}),()=>c(null)},[t,c,d,e]);let i=r!==null||o.length>0&&e===void 0,[w,k]=(0,P.useState)(i);(0,P.useEffect)(()=>{i&&k(!0)},[i]);let f=K(v)?(0,D.jsx)(P.Suspense,{fallback:null,children:(0,D.jsx)(De,{})}):null;return!w&&!i?f:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(P.Suspense,{fallback:null,children:(0,D.jsx)(Ce,{placement:t,chosen:e===void 0})}),f]})}var U=y(O(),1),Y=y(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.KSXB4LDF.js","./chunk.CDFVEL2Y.js","./chunk.FIJNKSMQ.js","./chunk.GAN77YDU.js","./chunk.JLOSQ5UY.js","./chunk.FNF6XQI5.js","./chunk.T6S3CEW7.js","./chunk.LUPBT6YM.js","./chunk.IBWPRK2R.js","./chunk.RNUGQRJI.js","./chunk.6NFR2LYQ.js","./chunk.HJCQ6I3S.js","./chunk.B7FZLIAO.js","./chunk.N5ULWKR4.js","./chunk.6BIRNR5P.js","./chunk.GBCWI2LF.js","./chunk.7PUFYK3B.js","./chunk.QJJKITXF.js","./chunk.7AEE3VHC.js","./chunk.U3CV5CCL.js","./chunk.LKF4BBCW.js","./chunk.NPS2WN7T.js","./chunk.JUT2VCFW.js","./chunk.HKD5SR45.js","./chunk.JEMQ66FT.js","./chunk.7UV7ODXU.js","./chunk.IIB22IIP.js","./chunk.MWUP5X47.js","./chunk.OK4FSBHI.js","./chunk.DAZEFSWI.js","./chunk.OGF6UORU.js","./chunk.UT6642FC.js","./chunk.3TBH2FMZ.js","./chunk.WE5SA6TP.js","./chunk.TI4OSTQV.js","./chunk.TDCO7LEA.js","./chunk.WVUJXDXZ.js","./chunk.ESU2DD3J.js","./chunk.PL2P2OON.js","./chunk.27ZVVPRZ.js","./chunk.IN4PKQO5.js","./chunk.3IUJ4GW7.js","./chunk.UG23RICT.js","./chunk.GZHZLJBF.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.EYEIDL3T.js")))),He=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,Y.jsx)(n,{...e})},{what:"The view"});function lt(t){let{seatTalk:e}=A();return(0,U.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,Y.jsx)(U.Suspense,{fallback:null,children:(0,Y.jsx)(He,{...t})}):null}var C=y(O(),1),x=y(M(),1),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.MWUP5X47.js","./chunk.REEDZSCG.js","./chunk.OGF6UORU.js","./chunk.UT6642FC.js","./chunk.3TBH2FMZ.js","./chunk.WE5SA6TP.js","./chunk.QNJYXB3U.js","./chunk.TI4OSTQV.js","./chunk.PL2P2OON.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.RDGFZPKN.js")))),ze=Ee.part((t,e)=>{let n=t.QuickAskCard;return(0,x.jsx)(n,{...e})},{what:"The quick ask"});function ft({face:t,on:e=!0}){let{ai:n,aiDesk:r,selection:d,view:c}=A(),v=fe()?.open??!1,o=e&&q(n)&&!v,i=ye(r),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:d,place:c.within?.view});return k.current={selection:d,place:c.within?.view},(0,C.useEffect)(()=>{if(!o)return;let f=ve(r);return f.drawn+=1,j(f),()=>{f.drawn=Math.max(0,f.drawn-1),f.drawn===0&&(f.open=null),j(f)}},[o,r]),(0,C.useEffect)(()=>{if(!o)return;let f=l=>{if(l.defaultPrevented||l.key.toLowerCase()!=="k"||!(l.metaKey||l.ctrlKey)||l.altKey||l.shiftKey)return;let p=w.current?.closest("[data-graview-embed]"),a=l.target,m=!(a instanceof Node)||a===document.body||a===document.documentElement;if(p&&!(m||a instanceof Node&&p.contains(a)))return;l.preventDefault(),Ee.prefetch();let g=document.activeElement,{selection:S,place:I}=k.current;J(r,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:g instanceof HTMLElement&&g!==document.body?g:null})};return window.addEventListener("keydown",f,!0),()=>window.removeEventListener("keydown",f,!0)},[o,r]),o?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),i?(0,x.jsx)(C.Suspense,{fallback:null,children:(0,x.jsx)(ze,{face:t,opening:i,close:()=>J(r,null)},i.at)}):null]}):null}var R=y(O(),1),L=y(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.REEDZSCG.js","./chunk.OGF6UORU.js","./chunk.UT6642FC.js","./chunk.3TBH2FMZ.js","./chunk.WE5SA6TP.js","./chunk.QNJYXB3U.js","./chunk.TI4OSTQV.js","./chunk.PL2P2OON.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.WNYPP52L.js")))),qe=oe.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),Be=oe.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function _e(){let{ai:t}=A(),e=q(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:r=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(qe,{target:n,close:r})}),prepare:()=>oe.prefetch()}):null,[e])}var Fe=[];function kt({children:t}){let e=_e(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)(V,{sections:n,children:t})}function St(t){let{ai:e,aiDesk:n}=A(),{ghost:r}=me(n);return r===null||r.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(Be,{...t})})}var N=y(O(),1);var Te=y(M(),1),W=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.FUYMLDNJ.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function $e(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=B(),n=e?.keptViews,r=e?.views,d=(0,N.useContext)(Ae);return(0,N.useMemo)(()=>!n||!r?null:c=>{let v=n.current(),o=Ve(c);if(c.place===void 0){if(c.face!=="pages"||o===void 0||c.on!==void 0||!v.may.lenses||!n.lens)return null;let l=r.arrangement?.()?.hide?.includes(o)===!0,p=m=>void W.load().then(g=>g.setListHidden(o,z(e.store.schema,o),n,m,d),String);return{id:"tidy-view",items:[l?{id:"show-list",label:"Show",hint:"Back in the places, for everyone",run:()=>p(!1)}:{id:"hide-list",label:"Hide",hint:"Off the places, for everyone; still at its address",run:()=>p(!0)}],prepare:()=>W.prefetch()}}let i=r.places().find(l=>l.as===c.place&&(o===void 0||l.kind===o||l.over?.includes(o)===!0));if(!i)return null;let w=le(i,v,n);if(!w)return null;let k=l=>void W.load().then(p=>p.setHidden(i,w,n,l,d),String);return{id:"tidy-view",items:[i.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>k(!1)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>k(!0)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let l=$e(r.places(),i);W.load().then(p=>p.remove(i,w,n,d).then(a=>a&&t?.(i,l)),String)}}],prepare:()=>W.prefetch()}},[n,r,d,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=Q(),r=(0,N.useCallback)((v,o)=>{let i=e.within?.view;e.focusId===ue(v.kind)&&(i===void 0||i===v.as)&&n(o?de(e,o.kind,o.as):ce(e,!0))},[e,n]),d=Ye(r),c=(0,N.useMemo)(()=>d?[d]:Ue,[d]);return(0,Te.jsx)(V,{sections:c,children:t})}function Ot(t={}){return t.scope===void 0?ne:pe(ne,t.scope)}var G=y(O(),1),s=y(M(),1);function qt({inside:t=!1,widthOf:e}={}){let{store:n,view:r,emphasis:d,setEmphasis:c}=A(),v=be(),{selection:o,set:i}=F(),{show:w}=Q(),k=_(),f=(0,G.useMemo)(()=>{let a=new Map;for(let m of n.graph.allEdges()){let g=a.get(m.kind)??{count:0,ends:new Set};g.count+=1;for(let S of[m.from,m.to]){let I=n.graph.getNode(S);I&&g.ends.add(`kind:${I.kind}`)}a.set(m.kind,g)}return[...a.entries()].sort(([m],[g])=>m.localeCompare(g)).map(([m,g])=>({kind:m,count:g.count,ends:[...g.ends]}))},[n,k]),l=Math.max(0,...f.map(a=>a.count));if((0,G.useEffect)(()=>()=>c(null),[c]),!r.overview&&!t||f.length===0)return null;let p=new Set;for(let a of o){if(a.startsWith("kind:")){p.add(a);continue}let m=n.graph.getNode(a);m&&p.add(`kind:${m.kind}`)}return(0,s.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:se("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:Ke,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,s.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:f.length===1?"1 relation":`${f.length} relations`}),e?(0,s.jsx)(Je,{aloft:r.overview===!0}):null,f.map(({kind:a,count:m,ends:g})=>{let{connector:S,style:I}=te(v,a),h=je(n.schema,a),u=d!==null?d===a:p.size===0||g.some(b=>p.has(b));return(0,s.jsxs)("button",{type:"button",title:n.schema.edge(a)?.description===void 0?`${m} of these`:h.words,onMouseEnter:()=>c(a),onMouseLeave:()=>c(null),onFocus:()=>c(a),onBlur:()=>c(null),onClick:()=>{i(g),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:u?1:.4},children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:r.overview&&e?(0,s.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(m,l)}):(0,s.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:Z(I),strokeWidth:ee(I,!0),strokeDasharray:X[I.pattern],strokeLinecap:"round"})}),(0,s.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":a,children:[(0,s.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:h.words}),(0,s.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:h.ends})]}),S.visible?null:(0,s.jsx)("span",{"data-graview-quiet":a,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:m})]},a)})]})}var Ke="min(280px, calc(100% - 28px))";function je(t,e,n){let r=t.edge(e)?.from??[],d=new Map;for(let o of n!==void 0&&r.includes(n)?[n]:r.length>0?r:[""]){let i=Se(t,o,e,"out");d.set(i,[...d.get(i)??[],o])}let c=o=>o==="*"?"anything":z(t,o),v=[...d].map(([o,i])=>{let w=i.flatMap(f=>t.tryDefinition(f)?.edges[e]?.to??[]),k=i[0]&&w.length>0?`${i.map(c).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(c).join(", ")}`:"";return[o.charAt(0).toUpperCase()+o.slice(1),k]});return{words:v.map(([o])=>o).join(" \xB7 "),ends:v.flatMap(([,o])=>o?[o]:[]).join(" \xB7 ")}}function Bt({edgeKind:t,kit:e,width:n=30}){let r=B(),d=(0,G.useMemo)(()=>ae(e??r?.brand?.kit),[e,r?.brand?.kit]),{connector:c,style:v}=te(d,t);return(0,s.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:c.visible?1:.35},children:(0,s.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:Z(v),strokeWidth:ee(v,!0),strokeDasharray:X[v.pattern],strokeLinecap:"round"})})}function Je({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,s.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,s.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,s.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,s.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,s.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,s.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,s.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,s.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,s.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,s.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:ke,strokeWidth:1.8,strokeDasharray:we,strokeLinecap:"round"})}),(0,s.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=y(O(),1),ie=y(M(),1),Xe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.7PUFYK3B.js","./chunk.QJJKITXF.js","./chunk.7AEE3VHC.js","./chunk.LKF4BBCW.js","./chunk.JUT2VCFW.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.TJO5Y2OJ.js")))),Ze=Xe.part(t=>(0,ie.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t}=A(),e=_();return(0,Ie.useMemo)(()=>t.log.all().some(r=>r.suggests!==void 0&&!r.withheld),[t,e])?(0,ie.jsx)(Ze,{}):null}export{ot as a,lt as b,ft as c,qt as d,Ke as e,Bt as f,_e as g,kt as h,St as i,Ye as j,Dt as k,Ot as l,Vt as m};
|
|
@@ -1,6 +1,6 @@
|
|
|
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{G as C,R as k,ua as K}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{G as C,R as k,ua as K}from"./chunk.4JWT6LIS.js";import{a as H}from"./chunk.SDO3U72B.js";import{b}from"./chunk.AJZBJBMO.js";var n=b(C(),1),N=450,_=10,O=t=>t instanceof HTMLInputElement?t.dataset.graviewChooseBox??void 0:void 0,q={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:-1/0,End:1/0},S=t=>t instanceof Element?t.closest("[data-graview-choose]"):null,G=t=>t instanceof HTMLElement&&(t.isContentEditable||t instanceof HTMLInputElement&&t.type!=="checkbox"||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement);function Y(t){let[i,d]=(0,n.useState)(()=>new Set),l=(0,n.useRef)(null),x=(0,n.useRef)(null),[E,P]=(0,n.useState)(null),R=E!==null&&t.includes(E)?E:t[0],L=(0,n.useMemo)(()=>t.filter(e=>i.has(e)),[t,i]),M=(0,n.useMemo)(()=>new Set(t),[t]);(0,n.useEffect)(()=>{[...i].some(e=>!M.has(e))&&d(e=>new Set([...e].filter(o=>M.has(o))))},[M,i]);let u=(0,n.useCallback)((e,o=!1)=>{let a=l.current;d(s=>{let r=new Set(s),f=a===null?-1:t.indexOf(a),y=t.indexOf(e);if(o&&f>=0&&y>=0){let T=s.has(a);for(let p of t.slice(Math.min(f,y),Math.max(f,y)+1))T?r.add(p):r.delete(p)}else r.has(e)?r.delete(e):r.add(e);return r}),l.current=e},[t]),v=(0,n.useCallback)(e=>d(new Set(e)),[]),A=(0,n.useCallback)(()=>{l.current=null,d(new Set)},[]),c=(0,n.useRef)(null),g=(0,n.useRef)(!1),m=L.length>0,h=()=>{c.current&&clearTimeout(c.current.timer),c.current=null};(0,n.useEffect)(()=>h,[]);let B={ref:x,onKeyDown:e=>{if(G(e.target))return;let o=O(e.target);if(e.key==="Tab"&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&o!==void 0&&m){let s=document.querySelector('[data-testid="several-bar"]'),r=s?.querySelector("[data-mutation]:not([disabled])")??s?.querySelector("button:not([disabled])");if(r){e.preventDefault(),e.stopPropagation(),r.focus();return}}let a=q[e.key];if(o!==void 0&&a!==void 0&&!e.metaKey&&!e.ctrlKey&&!e.altKey){let s=t.indexOf(o),r=t[Math.max(0,Math.min(t.length-1,s+(Number.isFinite(a)?a:a>0?t.length:-t.length)))];if(e.preventDefault(),e.stopPropagation(),r===void 0||r===o)return;if(e.shiftKey){let f=l.current!==null&&t.includes(l.current)?l.current:o,[y,T]=[t.indexOf(f),t.indexOf(r)].sort((p,F)=>p-F);d(p=>new Set([...p,...t.slice(y,T+1)])),l.current=f}P(r),x.current?.querySelector(`[data-graview-choose-box="${CSS.escape(r)}"]`)?.focus();return}if((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()==="a"){e.preventDefault(),e.stopPropagation(),v(t);return}if(e.key===" "&&!e.metaKey&&!e.ctrlKey){let s=S(e.target),r=e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement&&e.target.type==="checkbox";if(!s||r)return;e.preventDefault(),u(s.dataset.graviewChoose,e.shiftKey)}},onFocus:e=>{let o=O(e.target);o!==void 0&&P(o)},onPointerDown:e=>{if(g.current=!1,e.pointerType==="mouse"||e.button>0)return;let o=S(e.target);if(!o||e.target instanceof HTMLInputElement&&e.target.type==="checkbox")return;let a=o.dataset.graviewChoose;h(),c.current={id:a,x:e.clientX,y:e.clientY,timer:setTimeout(()=>{c.current=null,g.current=!0,u(a)},N)}},onPointerMove:e=>{let o=c.current;o&&Math.hypot(e.clientX-o.x,e.clientY-o.y)>_&&h()},onPointerUp:h,onPointerCancel:h,onClickCapture:e=>{let o=S(e.target);if(!o||e.target instanceof HTMLInputElement&&e.target.type==="checkbox"&&e.target.hasAttribute("data-graview-choose-box"))return;if(g.current){g.current=!1,e.preventDefault(),e.stopPropagation();return}let s=o.dataset.graviewChoose;if(e.shiftKey&&(m||l.current!==null)){e.preventDefault(),e.stopPropagation(),u(s,!0);return}m&&matchMedia?.("(pointer: coarse)").matches&&(e.preventDefault(),e.stopPropagation(),u(s))},onContextMenu:e=>{(g.current||c.current)&&(e.preventDefault(),e.stopPropagation())},...m?{"data-graview-choosing":""}:{}},j=(0,n.useCallback)(e=>i.has(e),[i]);return{chosen:L,has:j,toggle:u,choose:v,clear:A,listProps:B,boxProps:(e,o)=>({type:"checkbox",className:"graview-choose-box","data-graview-choose-box":e,"aria-label":`Choose ${o}`,tabIndex:e===R?0:-1,checked:i.has(e),onChange:()=>{},onClick:a=>{a.stopPropagation(),u(e,a.shiftKey)}}),list:x}}var $=`
|
|
2
2
|
.graview-choose-box{width:24px;height:24px;margin:0;accent-color:var(--graview-accent);cursor:pointer;opacity:0}
|
|
3
3
|
[data-graview-choose]:hover .graview-choose-box,[data-graview-choose]:focus-within .graview-choose-box,.graview-choose-box:focus-visible,.graview-choose-box:checked,[data-graview-choosing] .graview-choose-box{opacity:1}
|
|
4
4
|
[data-graview-choose]{-webkit-touch-callout:none}
|
|
5
5
|
[data-graview-choosing] [data-graview-choose]{-webkit-user-select:none;user-select:none}
|
|
6
|
-
`;var D=b(C(),1),w=b(k(),1),I=K(H(()=>(__graviewPreload(import.meta.url,["./chunk.
|
|
6
|
+
`;var D=b(C(),1),w=b(k(),1),I=K(H(()=>(__graviewPreload(import.meta.url,["./chunk.6BIRNR5P.js","./chunk.GBCWI2LF.js","./chunk.QJJKITXF.js","./chunk.7AEE3VHC.js","./chunk.JUT2VCFW.js","./chunk.DAZEFSWI.js","./chunk.OGF6UORU.js","./chunk.UT6642FC.js","./chunk.MB7LKKUD.js","./chunk.ESU2DD3J.js","./chunk.PL2P2OON.js","./chunk.27ZVVPRZ.js","./chunk.IN4PKQO5.js","./chunk.3IUJ4GW7.js","./chunk.UG23RICT.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZP6PS5Z4.js")))),U=I.part((t,i)=>(0,w.jsx)(t.SeveralBar,{...i}),{what:"The selection bar"});function Q(t){return t.chosen.length===0?null:(0,w.jsx)(D.Suspense,{fallback:null,children:(0,w.jsx)(U,{...t})})}var W=()=>I.prefetch();export{Y as a,$ as b,Q as c,W as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as on,c as an,d as te,e as sn,f as re,h as Re,i as dn,n as cn,q as oe}from"./chunk.TMBFLZNH.js";import{$a as We,B as pe,Ba as Be,Bb as Xe,C as me,Da as _e,F as ke,Gb as en,H as Ce,Ha as be,I as Ze,Ia as ve,Oa as He,Ra as Ue,aa as Ke,ab as Je,b as Te,c as De,cc as nn,d as $e,db as xe,e as K,ea as Ve,eb as Ye,g as de,h as M,i as Pe,j as Ge,k as ce,ka as Ie,l as Me,m as Le,nc as tn,o as Fe,oc as rn,p as le,q as he,ub as U,v as Ne,va as we,x as ne,xb as Qe,ya as qe,z as fe}from"./chunk.7MQ7UWVW.js";function ln(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let s=e,n=w=>typeof s[w]=="string"?s[w]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,u,m]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...u!==void 0?{alt:u}:{},...m!==void 0?{darkFallback:m}:{}}}function Gn(e,s){let n=e.brand??{},t=n.accent?rn(n.accent):void 0;t&&!t.ok&&s.push(dn("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${t.why}`,"pick a color further from orange-red, or a darker one"));let o=ln(n.logo),u=n.name??e.name,m=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,w])=>typeof w=="string"&&!/url\(|@import|[;{}<>\\]/i.test(w)).map(([w,L])=>[w,tn(L)])):void 0;return{name:u,schemes:t?.ok?t.schemes:nn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...o?{logo:o.dark||o.darkFallback==="invert"?{light:o.light,...o.dark?{dark:o.dark}:{darkFallback:"invert"}}:o.light,logoAlt:o.alt??u}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...m?{typography:m}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function fn(e){let{currency:s,locale:n,timeZone:t}=e.brand??{};return{...s?{currency:s}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var bn=Symbol.for("@graview/core:typed-field"),pn=(e,s)=>(/^(phone|place|duration)$/.test(s)&&(me(e)[bn]=s),e),mn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function un(e){let s=M().check(K(300),fe(t=>Be(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?s:le(s).check(K(200));return _e(e.description?n.check(pe(e.description)):n,e)}var xn=new WeakMap;function gn(e,s){xn.set(e,s)}var Rn=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function yn(e,s=Rn){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of s)t=Oe(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Oe(e,s,n,t,o){if(s.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:D,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:D}}if(!V(e))return e;let[u,...m]=s,w=u.endsWith("[]"),L=w?u.slice(0,-2):u,F=e[L],B=F;if(!w)B=Oe(F,m,n,`${t}${L}.`,o);else if(Array.isArray(F)){let D=F.map((N,W)=>Oe(N,m,n,`${t}${L}.${W}.`,o));B=D.some((N,W)=>N!==F[W])?D:F}return B===F?e:{...e,[L]:B}}var hn="graview-compiled@1";function On(e,s){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(s)))?.[0]}var q="id",ue=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function kn(e){let s=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([u])=>u===o))??t[0]?.[0];return n(s.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(s.filter(([,t])=>t.type==="string"))}function wn(e,s,n){let t;switch(e.type){case"string":case"place":t=M().check(K(500));break;case"phone":t=M().check(K(40),de(mn,"a phone number"));break;case"text":t=M().check(K(2e4)),e.format&&(me(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let u=e.min??(e.type==="duration"?0:void 0),m=[...e.type==="number"?[]:[Me()],...u===void 0?[]:[De(u)],...e.max===void 0?[]:[Te(e.max)],...e.step===void 0?[]:[$e(e.step)]];t=m.length>0?ce().check(...m):ce();break}case"boolean":t=Le();break;case"date":t=M().check(de(ke,"a date like 2026-10-02"));break;case"datetime":t=M().check(fe(Ce,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ne(e.options);break;case"list":t=le(e.of==="number"?ce():e.of==="date"?M().check(de(ke)):e.of==="image"||e.of==="video"||e.of==="file"?we(e.of):M().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=we(e.type);break;case"app-link":t=qe();break;case"url":t=Ge();break;case"email":t=Pe();break}let o=e.type==="number"||e.type==="integer";return pn(t,o&&e.format==="duration"?"duration":e.type),e.description&&(t=t.check(pe(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&Xe(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),s?ne(t):t}var ie=e=>{throw new U(`there is no record "${e}"`,"invalid")},zn=(e,s)=>"field"in e?wn(e.field,e.optional,s):"ref"in e?en(e.ref):ne(Fe()),An=new WeakMap;var ze=(e,s)=>V(s)&&Object.keys(e??{}).length===Object.keys(s).length&&Object.keys(e??{}).every(n=>Object.hasOwn(s,n));function it(e,s={}){let n=V(e)?e.format:void 0;if(n!==hn)return{ok:!1,findings:[Re("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${hn}`,"compile the document instead")]};let t=e,o=yn(t.document).document,u=o===t.document?t:{...t,document:o},m=V(o)&&typeof o.name=="string"&&V(o.kinds)&&ze(o.kinds,u.kinds)&&ze(o.acts,u.acts)&&ze(o.rules,u.rules)&&Array.isArray(u.edges)&&Array.isArray(u.findings),w={ok:!1,findings:[Re("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!m)return w;try{return Sn(u,s)}catch{return w}}function Sn(e,s={}){let{document:n}=e,t=n.brand?.timeZone,o=s.today??(()=>Ze(t)),u=new Map(e.edges.map(([h,r])=>[h,r])),m=new Map;for(let[h,r]of Object.entries(n.kinds)){let z=e.kinds[h]?.computed,O=ve(r.edges);m.set(h,{fields:new Set([...Object.keys(r.fields),...O.keys()]),edges:new Map(Object.entries(be(r.edges)).map(([j,$])=>[j,$.cardinality??"many"])),...z?{computed:new Map(z)}:{},...O.size>0?{linked:O}:{}})}e.facts&&m.set(an,{computed:new Map(e.facts)});let w=fn(n),L=new Map,F=Object.entries(n.kinds).map(([h,r])=>{let z={};for(let[i,g]of Object.entries(r.fields))z[i]=wn(g,!g.required,w),g.repeats&&(z[He(i)]=ne(Ue()));for(let[i,g]of ve(r.edges))z[i]=ne(un(g));let{label:O,describe:j,durations:$}=e.kinds[h]??{},P=Object.entries(r.computed??{}).map(([i,g])=>[i,typeof g=="string"?{expr:g}:g]),J=Object.hasOwn(r.fields,"label")&&!r.fields.label.label&&!/\{\s*label\b/.test(r.label??`{${kn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,g])=>[i,g.label]),...P.filter(([,i])=>i.label).map(([i,g])=>[i,g.label])]),A=Object.keys(_).length>0,l=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,g])=>[i,g.default]));L.set(h,l);let T=Object.fromEntries(Object.entries(be(r.edges)).map(([i,{renamedFrom:g,...I}])=>[i,I])),S=i=>r[i]?{[i]:r[i]}:{};return Ke(h,{fields:he(z),edges:T,...S("plural"),...S("noun"),...S("description"),...O?{label:i=>oe(O,{node:i,kinds:m,today:o(),money:w})||i.id}:{},...j?{describe:i=>oe(j,{node:i,kinds:m,today:o(),money:w})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([i,g])=>[i,$?.includes(i)?{...g,as:"duration"}:r.computed[i]]))}:{},...A||r.glance||r.page?{display:{...A?{labels:_}:{},...r.glance?{glance:[...r.glance]}:{},...r.page?{page:r.page}:{}}}:{},...Object.keys(l).length>0?{defaults:l}:{}})}),B=We(F,n.computed);function D(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...L.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let z=e.acts[h],{title:O,effects:j,guard:$,refusal:P,destructive:J,idempotent:_,creates:A,connects:l,severs:T,writes:S,writesOther:i,sets:g}=z,I=new Map(z.args),ae={};for(let[d,x]of I)ae[d]=zn(x,w);let b=[r.on??[]].flat(),C=new Map(z.exprs),G=j.find(d=>"create"in d),Y=(d,x,f,v=null)=>{if(V(d)&&"expr"in d)return re(C.get(d.expr),{graph:f,subject:v,kinds:m,bindings:x,today:o()});let k=ue(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Ee=(d,x)=>{if(!G)return"";let f=n.kinds[G.create].fields,v=N(G.create),k=[];for(let[R,ee]of Object.entries(G.set??{})){try{v[R]=Y(ee,d,x)??v[R]}catch{}let Q=ue(ee);Q&&d[Q]!==void 0&&k.push(R)}let Z=D(v).trim(),H=k.filter(R=>v[R]!==!1&&f[R].type!=="text"&&!(/[^]{41}/.test(v[R])||/ .*[.!?]$/.test(v[R])&&!/[ .][A-Z]\w{0,3}\.$/.test(v[R]))&&D({...v,[R]:void 0}).trim()===Z).map(R=>v[R]===!0?f[R].label??Ve(R):cn(v[R],f[R].format,o(),[],w));return Z&&H.length>0?`${Z} (${H.join(", ")})`:Z};W.push(Qe(h,{input:he(ae),title:O,...r.description?{description:r.description}:{},...r.fromTheOtherEnd?{fromTheOtherEnd:r.fromTheOtherEnd}:{},...I.has(q)?{subject:{kinds:b.length>0?b:"*",arg:q}}:{},...J?{destructive:!0}:{},..._?{idempotent:!0}:{},...A.length>0?{creates:A}:{},...l.length>0?{connects:l}:{},...T.length>0?{severs:T}:{},writes:S,...Object.keys(i).length>0?{writesOther:i}:{},...Object.keys(g).length>0?{sets:g}:{},describe:(d,x)=>{let f=typeof d[q]=="string"?x.getNode(d[q]):void 0,v=f?D(f):Ee(d,x);return v?`${O}: ${v}`:O},apply(d,x){let f=d.graph,v=typeof x[q]=="string"?x[q]:void 0,k=v?f.getNode(v):void 0;if(v&&!k&&ie(v),k&&b.length>0&&!b.includes(k.kind))throw new U(`"${O}" acts on ${b.join(" or ")}, not on ${Ie(k.kind)}`,"invalid");let Z={};for(let[a,c]of Object.entries(x))c!==void 0&&(Z[a]=c);if($&&k){let a;try{a=re($,{graph:f,subject:k,kinds:m,bindings:Z,today:o()})}catch(c){throw c instanceof te?new U(`"${O}" could not be judged: ${c.sentence}`):c}if(a!==!0)throw new U(P?oe(P,{node:k,kinds:m,graph:f,bindings:Z,today:o(),money:w}):`"${O}" is not allowed for ${D(k)} right now`)}let H=new Map,R=a=>f.has(a)||[...H.values()].includes(a),ee=new Set,Q=a=>{let c=Je(a);ee.has(c)||(ee.add(c),d.removeEdge(a))},X=(a,c)=>{let p=ue(a);if(p==="subject")return v;if(p==="me"){let y=d.me;if(y&&n.kinds[f.getNode(y)?.kind]?.people)return y;throw new U(`"${O}" is done as you, and you have no record here`)}if(H.has(p))return H.get(p);try{return Y(a,Z,f,c??k??null)}catch(y){throw y instanceof te?new U(`"${O}" could not work out a value: ${y.sentence}`):y}};for(let a of j)if("create"in a){let c=n.kinds[a.create],p=N(a.create);for(let[ye,se]of Object.entries(a.set??{})){let je=X(se,void 0);je!==void 0&&(p[ye]=je)}let y=kn(c),E=d.freshId(String((y&&p[y])??a.create),a.create);d.addNode({...p,id:E}),a.as&&H.set(a.as,E)}else if("connect"in a||"sever"in a){let c="connect"in a?a.connect:a.sever,p=String(X(a.from,void 0)??""),y=String(X(a.to,void 0)??"");if(R(p)||ie(p),R(y)||ie(y),"connect"in a){if(u.get(c)?.cardinality==="one")for(let E of f.out(p,c))E.id!==y&&Q({kind:c,from:p,to:E.id});f.out(p,c).some(E=>E.id===y)||d.addEdge({kind:c,from:p,to:y})}else Q({kind:c,from:p,to:y})}else if("set"in a){let c=String(X(a.target??"$subject",void 0)??""),p=f.getNode(c);!p&&!R(c)&&ie(c);let y={};for(let[E,ye]of Object.entries(a.set)){let se=X(ye,p);se!==void 0&&(y[E]=se)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in a){let c=String(X(a.remove,void 0)??"");f.has(c)||ie(c),d.removeNode(c)}else if("replace"in a&&k){let c=x.to;for(let p of a.replace){let y=u.get(p)?.from.includes(k.kind)??!0;for(let E of y?f.out(k.id,p):f.in(k.id,p))p===a.keep&&E.id===c||Q(y?{kind:p,from:k.id,to:E.id}:{kind:p,from:E.id,to:k.id})}}}}))}let Ae=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:z,require:O,when:j,says:$}=e.rules[h],P=r.repairs??[],J=(A,l,T=o(),S)=>{let i=[],g={graph:A,subject:l,kinds:m,today:T,...S?{linked:S}:{},onUnread:b=>i.push(b)},I;try{if(j&&re(j,g)!==!0)return[];if(I=re(O,g)===!0,!I&&i.length>0)throw new te(`it reads ${on(i[0])}`,0)}catch(b){throw b instanceof sn?new Ye(b.sentence):b instanceof te?new Error(b.sentence):b}if(I)return[];let ae=P.flatMap(b=>{let C=n.acts?.[b.act],G={},Y=l&&C?.on&&C.fromTheOtherEnd&&![C.on].flat().includes(l.kind)?On(e.acts[b.act].args,l.kind):void 0;Y?G[Y]=l.id:l&&(C?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(b.act))&&(G[q]=l.id);for(let[x,f]of Object.entries(b.args??{}))G[x]=ue(f)==="subject"?l?.id:f;let d=(C?e.acts[b.act].args:[]).filter(([x,f])=>f.required&&G[x]===void 0).map(([x])=>x);return[{mutation:b.act,label:b.label??(Y?C.fromTheOtherEnd:C?.title)??b.act.replace(/-/g," "),args:G,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...l?{subjectId:l.id}:{},label:z,message:$?oe($,{node:l,kinds:m,graph:A,today:T,money:w}):l?`${D(l)}: ${z}`:z,nodeIds:l?[l.id]:[],repairs:ae}]},_={label:z,shape:{over:r.over,require:O,when:j,says:$,declared:n.kinds,money:w,kinds:m,today:o},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...P.length>0?{repairs:P.map(A=>A.act)}:{}};Ae.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:A,today:l,context:T})=>J(A,null,l,T?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:l,today:T,context:S})=>J(A,l,T,S?.linked)}))}let Se=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:Ae,...Se?{policy:Se}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return gn(ge,n),An.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:m}}export{yn as a,Gn as b,hn as c,q as d,ue as e,kn as f,it as g,Sn as h};
|
|
1
|
+
import{b as on,c as an,d as te,e as sn,f as re,h as Oe,i as dn,n as cn,q as oe}from"./chunk.UG23RICT.js";import{$a as We,B as pe,Ba as Be,Bb as Xe,C as me,Da as _e,F as ke,Gb as en,H as Ce,Ha as be,I as Ze,Ia as ve,Oa as He,Ra as Ue,aa as Ke,ab as Je,b as De,c as Te,cc as nn,d as $e,db as xe,e as K,ea as Ve,eb as Ye,g as de,h as M,i as Pe,j as Ge,k as ce,ka as Ie,l as Me,m as Le,nc as tn,o as Fe,oc as rn,p as le,q as he,ub as U,v as Ne,va as we,x as ne,xb as Qe,ya as qe,z as fe}from"./chunk.AW2T3KFV.js";function ln(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let s=e,n=w=>typeof s[w]=="string"?s[w]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,u,m]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...u!==void 0?{alt:u}:{},...m!==void 0?{darkFallback:m}:{}}}function Gn(e,s){let n=e.brand??{},t=n.accent?rn(n.accent):void 0;t&&!t.ok&&s.push(dn("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${t.why}`,"pick a color further from orange-red, or a darker one"));let o=ln(n.logo),u=n.name??e.name,m=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,w])=>typeof w=="string"&&!/url\(|@import|[;{}<>\\]/i.test(w)).map(([w,L])=>[w,tn(L)])):void 0;return{name:u,schemes:t?.ok?t.schemes:nn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...o?{logo:o.dark||o.darkFallback==="invert"?{light:o.light,...o.dark?{dark:o.dark}:{darkFallback:"invert"}}:o.light,logoAlt:o.alt??u}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...m?{typography:m}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function fn(e){let{currency:s,locale:n,timeZone:t}=e.brand??{};return{...s?{currency:s}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var bn=Symbol.for("@graview/core:typed-field"),pn=(e,s)=>(/^(phone|place|duration)$/.test(s)&&(me(e)[bn]=s),e),mn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function un(e){let s=M().check(K(300),fe(t=>Be(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?s:le(s).check(K(200));return _e(e.description?n.check(pe(e.description)):n,e)}var xn=new WeakMap;function gn(e,s){xn.set(e,s)}var On=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function yn(e,s=On){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of s)t=Re(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Re(e,s,n,t,o){if(s.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:T,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:T}}if(!V(e))return e;let[u,...m]=s,w=u.endsWith("[]"),L=w?u.slice(0,-2):u,F=e[L],B=F;if(!w)B=Re(F,m,n,`${t}${L}.`,o);else if(Array.isArray(F)){let T=F.map((N,W)=>Re(N,m,n,`${t}${L}.${W}.`,o));B=T.some((N,W)=>N!==F[W])?T:F}return B===F?e:{...e,[L]:B}}var hn="graview-compiled@1";function Rn(e,s){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(s)))?.[0]}var q="id",ue=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function kn(e){let s=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([u])=>u===o))??t[0]?.[0];return n(s.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(s.filter(([,t])=>t.type==="string"))}function wn(e,s,n){let t;switch(e.type){case"string":case"place":t=M().check(K(500));break;case"phone":t=M().check(K(40),de(mn,"a phone number"));break;case"text":t=M().check(K(2e4)),e.format&&(me(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let u=e.min??(e.type==="duration"?0:void 0),m=[...e.type==="number"?[]:[Me()],...u===void 0?[]:[Te(u)],...e.max===void 0?[]:[De(e.max)],...e.step===void 0?[]:[$e(e.step)]];t=m.length>0?ce().check(...m):ce();break}case"boolean":t=Le();break;case"date":t=M().check(de(ke,"a date like 2026-10-02"));break;case"datetime":t=M().check(fe(Ce,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ne(e.options);break;case"list":t=le(e.of==="number"?ce():e.of==="date"?M().check(de(ke)):e.of==="image"||e.of==="video"||e.of==="file"?we(e.of):M().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=we(e.type);break;case"app-link":t=qe();break;case"url":t=Ge();break;case"email":t=Pe();break}let o=e.type==="number"||e.type==="integer";return pn(t,o&&e.format==="duration"?"duration":e.type),e.description&&(t=t.check(pe(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&Xe(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),s?ne(t):t}var ie=e=>{throw new U(`there is no record "${e}"`,"invalid")},zn=(e,s)=>"field"in e?wn(e.field,e.optional,s):"ref"in e?en(e.ref):ne(Fe()),An=new WeakMap;var ze=(e,s)=>V(s)&&Object.keys(e??{}).length===Object.keys(s).length&&Object.keys(e??{}).every(n=>Object.hasOwn(s,n));function it(e,s={}){let n=V(e)?e.format:void 0;if(n!==hn)return{ok:!1,findings:[Oe("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${hn}`,"compile the document instead")]};let t=e,o=yn(t.document).document,u=o===t.document?t:{...t,document:o},m=V(o)&&typeof o.name=="string"&&V(o.kinds)&&ze(o.kinds,u.kinds)&&ze(o.acts,u.acts)&&ze(o.rules,u.rules)&&Array.isArray(u.edges)&&Array.isArray(u.findings),w={ok:!1,findings:[Oe("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!m)return w;try{return Sn(u,s)}catch{return w}}function Sn(e,s={}){let{document:n}=e,t=n.brand?.timeZone,o=s.today??(()=>Ze(t)),u=new Map(e.edges.map(([h,r])=>[h,r])),m=new Map;for(let[h,r]of Object.entries(n.kinds)){let z=e.kinds[h]?.computed,R=ve(r.edges);m.set(h,{fields:new Set([...Object.keys(r.fields),...R.keys()]),edges:new Map(Object.entries(be(r.edges)).map(([j,$])=>[j,$.cardinality??"many"])),...z?{computed:new Map(z)}:{},...R.size>0?{linked:R}:{}})}e.facts&&m.set(an,{computed:new Map(e.facts)});let w=fn(n),L=new Map,F=Object.entries(n.kinds).map(([h,r])=>{let z={};for(let[i,g]of Object.entries(r.fields))z[i]=wn(g,!g.required,w),g.repeats&&(z[He(i)]=ne(Ue()));for(let[i,g]of ve(r.edges))z[i]=ne(un(g));let{label:R,describe:j,durations:$}=e.kinds[h]??{},P=Object.entries(r.computed??{}).map(([i,g])=>[i,typeof g=="string"?{expr:g}:g]),J=Object.hasOwn(r.fields,"label")&&!r.fields.label.label&&!/\{\s*label\b/.test(r.label??`{${kn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,g])=>[i,g.label]),...P.filter(([,i])=>i.label).map(([i,g])=>[i,g.label])]),A=Object.keys(_).length>0,l=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,g])=>[i,g.default]));L.set(h,l);let D=Object.fromEntries(Object.entries(be(r.edges)).map(([i,{renamedFrom:g,...I}])=>[i,I])),S=i=>r[i]?{[i]:r[i]}:{};return Ke(h,{fields:he(z),edges:D,...S("plural"),...S("noun"),...S("description"),...R?{label:i=>oe(R,{node:i,kinds:m,today:o(),money:w})||i.id}:{},...j?{describe:i=>oe(j,{node:i,kinds:m,today:o(),money:w})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([i,g])=>[i,$?.includes(i)?{...g,as:"duration"}:r.computed[i]]))}:{},...A||r.glance||r.page?{display:{...A?{labels:_}:{},...r.glance?{glance:[...r.glance]}:{},...r.page?{page:r.page}:{}}}:{},...Object.keys(l).length>0?{defaults:l}:{}})}),B=We(F,n.computed);function T(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...L.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let z=e.acts[h],{title:R,effects:j,guard:$,refusal:P,destructive:J,idempotent:_,creates:A,connects:l,severs:D,writes:S,writesOther:i,sets:g}=z,I=new Map(z.args),ae={};for(let[d,x]of I)ae[d]=zn(x,w);let b=[r.on??[]].flat(),C=new Map(z.exprs),G=j.find(d=>"create"in d),Y=(d,x,f,v=null)=>{if(V(d)&&"expr"in d)return re(C.get(d.expr),{graph:f,subject:v,kinds:m,bindings:x,today:o()});let k=ue(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Ee=(d,x)=>{if(!G)return"";let f=n.kinds[G.create].fields,v=N(G.create),k=[];for(let[O,ee]of Object.entries(G.set??{})){try{v[O]=Y(ee,d,x)??v[O]}catch{}let Q=ue(ee);Q&&d[Q]!==void 0&&k.push(O)}let Z=T(v).trim(),H=k.filter(O=>v[O]!==!1&&f[O].type!=="text"&&!(/[^]{41}/.test(v[O])||/ .*[.!?]$/.test(v[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(v[O]))&&T({...v,[O]:void 0}).trim()===Z).map(O=>v[O]===!0?f[O].label??Ve(O):cn(v[O],f[O].format,o(),[],w));return Z&&H.length>0?`${Z} (${H.join(", ")})`:Z};W.push(Qe(h,{input:he(ae),title:R,...r.description?{description:r.description}:{},...r.fromTheOtherEnd?{fromTheOtherEnd:r.fromTheOtherEnd}:{},...I.has(q)?{subject:{kinds:b.length>0?b:"*",arg:q}}:{},...J?{destructive:!0}:{},..._?{idempotent:!0}:{},...A.length>0?{creates:A}:{},...l.length>0?{connects:l}:{},...D.length>0?{severs:D}:{},writes:S,...Object.keys(i).length>0?{writesOther:i}:{},...Object.keys(g).length>0?{sets:g}:{},describe:(d,x)=>{let f=typeof d[q]=="string"?x.getNode(d[q]):void 0,v=f?T(f):Ee(d,x);return v?`${R}: ${v}`:R},apply(d,x){let f=d.graph,v=typeof x[q]=="string"?x[q]:void 0,k=v?f.getNode(v):void 0;if(v&&!k&&ie(v),k&&b.length>0&&!b.includes(k.kind))throw new U(`"${R}" acts on ${b.join(" or ")}, not on ${Ie(k.kind)}`,"invalid");let Z={};for(let[a,c]of Object.entries(x))c!==void 0&&(Z[a]=c);if($&&k){let a;try{a=re($,{graph:f,subject:k,kinds:m,bindings:Z,today:o()})}catch(c){throw c instanceof te?new U(`"${R}" could not be judged: ${c.sentence}`):c}if(a!==!0)throw new U(P?oe(P,{node:k,kinds:m,graph:f,bindings:Z,today:o(),money:w}):`"${R}" is not allowed for ${T(k)} right now`)}let H=new Map,O=a=>f.has(a)||[...H.values()].includes(a),ee=new Set,Q=a=>{let c=Je(a);ee.has(c)||(ee.add(c),d.removeEdge(a))},X=(a,c)=>{let p=ue(a);if(p==="subject")return v;if(p==="me"){let y=d.me;if(y&&n.kinds[f.getNode(y)?.kind]?.people)return y;throw new U(`"${R}" is done as you, and you have no record here`)}if(H.has(p))return H.get(p);try{return Y(a,Z,f,c??k??null)}catch(y){throw y instanceof te?new U(`"${R}" could not work out a value: ${y.sentence}`):y}};for(let a of j)if("create"in a){let c=n.kinds[a.create],p=N(a.create);for(let[ye,se]of Object.entries(a.set??{})){let je=X(se,void 0);je!==void 0&&(p[ye]=je)}let y=kn(c),E=d.freshId(String((y&&p[y])??a.create),a.create);d.addNode({...p,id:E}),a.as&&H.set(a.as,E)}else if("connect"in a||"sever"in a){let c="connect"in a?a.connect:a.sever,p=String(X(a.from,void 0)??""),y=String(X(a.to,void 0)??"");if(O(p)||ie(p),O(y)||ie(y),"connect"in a){if(u.get(c)?.cardinality==="one")for(let E of f.out(p,c))E.id!==y&&Q({kind:c,from:p,to:E.id});f.out(p,c).some(E=>E.id===y)||d.addEdge({kind:c,from:p,to:y})}else Q({kind:c,from:p,to:y})}else if("set"in a){let c=String(X(a.target??"$subject",void 0)??""),p=f.getNode(c);!p&&!O(c)&&ie(c);let y={};for(let[E,ye]of Object.entries(a.set)){let se=X(ye,p);se!==void 0&&(y[E]=se)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in a){let c=String(X(a.remove,void 0)??"");f.has(c)||ie(c),d.removeNode(c)}else if("replace"in a&&k){let c=x.to;for(let p of a.replace){let y=u.get(p)?.from.includes(k.kind)??!0;for(let E of y?f.out(k.id,p):f.in(k.id,p))p===a.keep&&E.id===c||Q(y?{kind:p,from:k.id,to:E.id}:{kind:p,from:E.id,to:k.id})}}}}))}let Ae=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:z,require:R,when:j,says:$}=e.rules[h],P=r.repairs??[],J=(A,l,D=o(),S)=>{let i=[],g={graph:A,subject:l,kinds:m,today:D,...S?{linked:S}:{},onUnread:b=>i.push(b)},I;try{if(j&&re(j,g)!==!0)return[];if(I=re(R,g)===!0,!I&&i.length>0)throw new te(`it reads ${on(i[0])}`,0)}catch(b){throw b instanceof sn?new Ye(b.sentence):b instanceof te?new Error(b.sentence):b}if(I)return[];let ae=P.flatMap(b=>{let C=n.acts?.[b.act],G={},Y=l&&C?.on&&C.fromTheOtherEnd&&![C.on].flat().includes(l.kind)?Rn(e.acts[b.act].args,l.kind):void 0;Y?G[Y]=l.id:l&&(C?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(b.act))&&(G[q]=l.id);for(let[x,f]of Object.entries(b.args??{}))G[x]=ue(f)==="subject"?l?.id:f;let d=(C?e.acts[b.act].args:[]).filter(([x,f])=>f.required&&G[x]===void 0).map(([x])=>x);return[{mutation:b.act,label:b.label??(Y?C.fromTheOtherEnd:C?.title)??b.act.replace(/-/g," "),args:G,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...l?{subjectId:l.id}:{},label:z,message:$?oe($,{node:l,kinds:m,graph:A,today:D,money:w}):l?`${T(l)}: ${z}`:z,nodeIds:l?[l.id]:[],repairs:ae}]},_={label:z,shape:{over:r.over,require:R,when:j,says:$,declared:n.kinds,money:w,kinds:m,today:o},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...P.length>0?{repairs:P.map(A=>A.act)}:{}};Ae.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:A,today:l,context:D})=>J(A,null,l,D?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:l,today:D,context:S})=>J(A,l,D,S?.linked)}))}let Se=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:Ae,...Se?{policy:Se}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return gn(ge,n),An.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:m}}export{yn as a,Gn as b,hn as c,q as d,ue as e,kn as f,it as g,Sn as h};
|
|
@@ -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{G as k,R as n,ua as o}from"./chunk.4JWT6LIS.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.ESU2DD3J.js","./chunk.PL2P2OON.js","./chunk.27ZVVPRZ.js","./chunk.IN4PKQO5.js","./chunk.3IUJ4GW7.js","./chunk.UG23RICT.js","./chunk.GZHZLJBF.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.YTZDCIX2.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.LKXYZK5H.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.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.V4DR25S4.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.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.4WCQWILK.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,2 +1,2 @@
|
|
|
1
|
-
import{a as te,b as E,d as re,g as ie,h as de,i as ae}from"./chunk.
|
|
1
|
+
import{a as te,b as E,d as re,g as ie,h as de,i as ae}from"./chunk.4EPT2CQG.js";import{Ca as J,Cb as oe,Ea as Q,Eb as se,F as I,G as x,I as P,Ma as M,O as A,Qa as X,R as K,S as Y,Sa as ee,Ua as ne,W as T,Y as Z,ca as v,ja as B,la as H,ra as U,sa as G,ta as V,xa as q}from"./chunk.AW2T3KFV.js";var ye=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,ue={day:"day",week:"week",month:"month",year:"year"},S=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function ge(t,e,n){let o=e.interval??1,d=ue[e.every],c=t.slice(0,10),y=o===1?`Every ${d}`:o===2?`Every other ${d}`:`Every ${o} ${d}s`,a;if(e.every==="week"){let u=(e.on?.length?e.on:[M[new Date(`${c}T00:00:00Z`).getUTCDay()]]).map(f=>Z(M.indexOf(f),"long",n));a=o===1?`Every ${S(u)}`:o===2?`Every other ${S(u)}`:`${y} on ${S(u)}`}else if(e.every==="month"){let u=(e.on?.length?e.on:[+c.slice(8,10)]).map(f=>f===-1?"the last day":`the ${ye(Number(f))}`);a=`${y} on ${S(u)}`}else e.every==="year"?a=`${y} on ${T(c,n)}`:a=y;return x.test(t)&&(a+=` at ${Y(t,n)}`),e.until&&(a+=`, until ${A(e.until,n)}`),e.count&&(a+=`, ${e.count===1?"once":`${e.count} times`}`),a}function le(t,e,n={}){if(!ee(e)||typeof t!="string")return;let o=n.today??P(),d=ne(t,e,o),c=ge(t,e,n.locale),y=d.slice(0,4)===o.slice(0,4)?T(d.slice(0,10),n.locale):A(d.slice(0,10),n.locale);return d.slice(0,10)<o?`${c}, last ${y}`:`${c}, next ${y}`}function Ye(t,e){let n=new Map,o=new Map;for(let d of t){let c=v(e(d.kind),d).trim().toLowerCase();o.set(c,[...o.get(c)??[],d])}for(let d of o.values()){if(d.length<2)continue;let c=new Map;for(let y of d)c.set(y.kind,[...c.get(y.kind)??[],y]);for(let[y,a]of c){if(a.length===1){n.set(a[0].id,H(e(y),y));continue}let u=a.map(r=>new Map(he(r,e(r.kind)).map(l=>[l.key,l.alone]))),f=[...new Set(u.flatMap(r=>[...r.keys()]))],h=r=>u.every(l=>!/\d/.test(l.get(r)??"")),$=[...f.filter(h),...f.filter(r=>!h(r))],O=(r,l)=>l.map(g=>u[r].get(g)??"").filter(Boolean).join(" \xB7 "),_=r=>new Set(a.map((l,g)=>O(g,r))).size===a.length&&a.every((l,g)=>O(g,r)!==""),i=$.find(r=>_([r])),s=i?void 0:$.flatMap((r,l)=>$.slice(l+1).map(g=>[r,g])).find(r=>_(r));a.forEach((r,l)=>{if(i||s)return void n.set(r.id,O(l,i?[i]:s));let g=$.find(b=>{let k=u[l].get(b);return k!==void 0&&k!==""&&u.every((R,m)=>m===l||R.get(b)!==k)});n.set(r.id,g?u[l].get(g):`${l+1} of ${a.length}`)})}}return n}function Ze(t,e){return t?.describe?t.describe(e):`${e.kind} ${v(t,e)}`}var pe=new Set(["id","kind","label"]);function me(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function he(t,e,n={}){let o=e?.display,d=new Set([...pe,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!v(e,t).includes(t.label)&&d.delete("label");let c=(n.said??[]).filter(i=>!!i),y=c.filter(i=>i.endsWith("\u2026")).map(i=>i.replace(/…$/,"").trim()).filter(i=>i.length>12),a=[],u=e?.fields?.shape,f=e?.fieldRoles,h=n.glance?o?.glance??[f?.who,f?.when].filter(i=>!!i):ce(o?.page),$=n.glance&&o?.glance!==void 0,_=[...new Set($?h:[...h,...be(e),...Object.keys(t)])].filter(i=>Object.hasOwn(t,i)).map(i=>[i,t[i]]);for(let[i,s]of _){if(d.has(i)||s===void 0||s===null)continue;let r=o?.format?.[i],l=r?[]:V(s);if(l[0]&&n.glance)continue;let g=e?.fields?.shape?.[i],b=!r&&typeof s=="string"&&q(g)?s:void 0,k=!r&&typeof s=="string"&&te(g);if(b&&n.glance)continue;let R=r?void 0:Q(g),m=R?{relation:R,refs:J(s,R)}:void 0;if(m&&(n.glance||m.refs.length===0)||!l[0]&&typeof s=="object"&&(!Array.isArray(s)||s.some(p=>typeof p=="object"&&p!==null))&&r===void 0)continue;let j=typeof s=="string"&&!r?le(s,t[`${i}Repeat`],{locale:n.locale}):void 0,F=l[0]?l.map(p=>`${p.caption?`${p.name} \u2014 ${p.caption}`:p.name}${U(p)?` (${G(p)})`:""}`).join(", "):Array.isArray(s)?s.join(", "):typeof s=="boolean"?s?"Yes":"No":String(s),N=r?void 0:ie(e,i),L=ae(N,s),W=!r&&!N&&typeof s=="number"?oe(e?.fields?.shape?.[i]):void 0,z=m?m.refs.length>1?`${m.refs.length} linked records`:"linked record":r?r(s):W?se(s,W):de(N,s,n.locale)??(Array.isArray(s)||typeof s=="boolean"?F:typeof s=="string"&&j!==void 0?j:typeof s=="string"&&I.test(s)?A(s,n.locale):typeof s=="string"&&x.test(s)?K(s,n.locale,n.timeZone):typeof s=="string"&&$e(e,i)?E(e,i,s):F),C=typeof s=="string"&&_e(e,i,z),w=(n.glance||n.excerpt)&&!r&&(C||k)?re(z,{markdown:k}):z;if(c.includes(w)||y.some(p=>w.startsWith(p))||n.glance&&(typeof s=="string"||typeof s=="number")&&c.some(p=>me(p,w)))continue;let D=B(e,i),fe=typeof s=="number"?`${D} ${w}`:typeof s=="boolean"&&!r?`${D}: ${w.toLowerCase()}`:w;if(a.push({key:i,label:D,value:w,stored:F,alone:fe,long:C,...k?{markdown:!0}:{},...l[0]?{files:l}:{},...b?{app:b}:{},...m?{linked:m}:{},...L?{href:L}:{},...X(u?.[`${i}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&a.length>=n.limit)break}return ke(a,e)}function ke(t,e){let n=new Map;for(let o of t){let d=we(e,o.key);d&&n.set(o.key,new Set(d.map(c=>E(e,o.key,c).toLowerCase())))}return n.size<2?t:t.map(o=>{let d=n.get(o.key);return d!==void 0&&[...n].some(([y,a])=>y!==o.key&&[...d].some(u=>a.has(u)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function we(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function $e(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function be(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function ce(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var Re=500,Ae=160;function Oe(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function _e(t,e,n){return Oe(t?.fields?.shape?.[e])?.checks?.some(d=>d._zod?.def?.check==="max_length"&&(d._zod.def.maximum??0)>Re)?!0:typeof n=="string"&&(n.includes(`
|
|
2
2
|
`)||n.length>Ae)}function Be(t,e){let n=t?.display?.page,o=n?.groups??[],d=new Map(e.map(f=>[f.key,f])),c=new Set(ce(n)),y=f=>f.flatMap(h=>d.has(h)?[d.get(h)]:[]),a=e.filter(f=>!c.has(f.key));return[{fields:[...y(n?.fields??[]),...o.length>0?[]:a]},...o.map(f=>({title:f.title,fields:y(f.fields)})),...o.length>0?[{title:"Details",fields:a}]:[]].filter(f=>f.fields.length>0)}export{ge as a,Ye as b,Ze as c,he as d,Be as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=new Set(["tell","me","about","what","how","show","describe","the","a","an","and","please"])
|
|
1
|
+
var o=new Set(["tell","me","about","what","how","show","describe","the","a","an","and","please"]),$=new Set([...o,"where","is","are","was","find","any","anything","something","things","called","named","which","who","of","for","with","to","in","on","i","my","do","does","have","has","can","you","it","that","this","there","we","our","got","be"]);function k(t){return t.flatMap(e=>{let n=e.repairs.find(s=>!s.missing?.length);return n?[{mutation:n.mutation,args:{...n.args},why:e.message}]:[]})}export{k as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c}from"./chunk.2EXY4AHX.js";import"./chunk.OAWAUB4P.js";import"./chunk.PSTE3LZL.js";import"./chunk.UGFDSE37.js";import{l as m}from"./chunk.JGYGSNQY.js";import"./chunk.JLOSQ5UY.js";import"./chunk.FNF6XQI5.js";import"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.PXQVXBNG.js";import"./chunk.YERDP6YF.js";import"./chunk.P5K7EYDK.js";import"./chunk.7AEE3VHC.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.JEMQ66FT.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import"./chunk.OGF6UORU.js";import"./chunk.UT6642FC.js";import"./chunk.WE5SA6TP.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{G as S,R as g}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import{rd as n}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as t}from"./chunk.AJZBJBMO.js";var y=t(S(),1),a=t(g(),1);function E({store:h,auto:f,brand:i,views:u,presence:o,steering:r,overview:s,scope:d,titleLevel:v=2,quickAsk:l,props:e}){let b=(0,y.useMemo)(()=>m({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:f?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:b}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(c,{context:{store:h,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...s?{overview:s}:{},titleLevel:v,views:u,settings:e.app.settings??[],...o?{presence:o}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{E as PagesContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m}from"./chunk.
|
|
1
|
+
import{m}from"./chunk.FNXW46U4.js";import{G as N,R as f,U as y}from"./chunk.4JWT6LIS.js";import{b as g}from"./chunk.AJZBJBMO.js";var p=g(N(),1);var a=g(f(),1);var R={default:{background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)"},muted:{background:"var(--graview-panel-muted, #f7f5f1)",color:"var(--graview-ink, #1a1a1a)"},warning:{background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)"}},T={color:"var(--graview-ink-muted, #55514a)"},C={color:"var(--graview-ink-faint, #625d55)"};function H(e){let[l,o]=(0,p.useState)(z);return(0,p.useEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let t=()=>{let i=W(r,parseFloat(getComputedStyle(r).paddingBottom)||0);o(s=>s.overflowing===i.overflowing&&s.above===i.above&&s.below===i.below?s:i)};t();let d=new ResizeObserver(t);d.observe(r);for(let i of r.children)d.observe(i);return r.addEventListener("scroll",t,{passive:!0}),()=>{d.disconnect(),r.removeEventListener("scroll",t)}}),l}var z={overflowing:!1,above:!1,below:!1};function W(e,l=0){let o=e.scrollHeight>e.clientHeight+1,r=e.scrollWidth>e.clientWidth+1;return{overflowing:o||r,above:o&&e.scrollTop>1,below:o&&e.scrollTop+e.clientHeight<e.scrollHeight-l-1}}var A=(0,p.createContext)(null),I=(0,p.createContext)(null);function O({level:e,said:l=!0,style:o,children:r}){if(e===void 0)return(0,a.jsx)("strong",{style:o,...l?{}:{"aria-hidden":!0},children:r});let t=`h${e}`;return(0,a.jsx)(t,{style:{margin:0,...o},children:r})}function E({title:e,subtitle:l,meta:o,selected:r,tone:t="default",children:d,style:i,fit:s=!1,variant:w,heading:b}){let c=(0,p.useRef)(null),{overflowing:v,above:x,below:S}=H(c),P=y(),n=(w??(P==="fullscreen"?"page":"card"))==="page",k=(0,p.useContext)(A),u=(0,p.useContext)(I);return(0,a.jsxs)("div",{"data-graview-primitive":"panel","data-graview-variant":n?"page":"card","data-selected":r||void 0,style:{display:"flex",flexDirection:"column",gap:n?12:"var(--graview-gap, 7px)",height:n||s?"auto":"100%",maxHeight:n?"none":"100%",padding:n?0:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:n?0:"var(--graview-radius, 12px)",border:n?"none":`1px solid ${r?"var(--graview-accent, #2f6f5e)":"var(--graview-edge, #e4e0d8)"}`,boxShadow:n?"none":r?"0 0 0 1px var(--graview-accent-dim), var(--graview-lift-low)":"var(--graview-lift-low)",overflow:n?"visible":"hidden",...R[t],...n?{background:"transparent"}:{},...i},children:[t==="warning"?(0,a.jsx)("span",{"data-graview-broken":"",style:m,children:"Implicated in a problem."}):null,e===void 0||e===k?null:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0},children:[t==="warning"?(0,a.jsx)("span",{"aria-hidden":"true",title:"Implicated in a problem",style:{color:"var(--graview-warn)",flex:"0 0 auto"},children:"\u26A0"}):null,(0,a.jsx)(O,{level:b,said:u===null||e!==u,style:{fontFamily:"var(--graview-font-display, inherit)",fontSize:n?"1.5625rem":"0.9375rem",lineHeight:n?1.15:1.25,fontWeight:n?600:560,letterSpacing:n?"-0.012em":"0.005em",minWidth:0,overflowWrap:"anywhere"},children:e}),o===void 0?null:(0,a.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",letterSpacing:"0.08em",textTransform:"uppercase",minWidth:0,overflowWrap:"anywhere",...C},children:o})]}),l===void 0?null:(0,a.jsx)("div",{style:{fontSize:n?"0.90625rem":"0.8125rem",lineHeight:1.5,...T},children:l}),(0,a.jsx)("div",{ref:c,className:n?void 0:"graview-scroll",...v&&!n?{tabIndex:0,role:"region",...typeof e=="string"?{"aria-label":e}:{}}:{},style:{display:"flex",flexDirection:"column",gap:n?22:"var(--graview-gap, 7px)",flex:"1 1 auto",...n?{overflow:"visible"}:{marginBottom:"calc(-1 * var(--graview-pad, 15px))",paddingBottom:"var(--graview-pad, 15px)"},...!n&&!v?{overflow:"hidden"}:{}},"data-graview-more-above":x&&!n?"":void 0,"data-graview-more-below":S&&!n?"":void 0,children:d})]})}function h({label:e,hue:l,selected:o,title:r,pickId:t,emphasis:d}){let i=typeof e=="string"?e:void 0,s=l===void 0?void 0:Math.round(l);return(0,a.jsxs)("span",{"data-graview-primitive":"chip","data-selected":o||void 0,"data-graview-pick":t,"data-graview-emphasis":d,title:r??i,style:{cursor:t?"pointer":void 0,display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",maxWidth:"min(28ch, 100%)",overflow:"hidden",letterSpacing:"0.01em",border:`1px solid ${o?"var(--graview-accent)":s===void 0?"var(--graview-edge)":`hsl(${s} 55% var(--graview-tint-lightness) / 0.45)`}`,background:s===void 0?"var(--graview-panel-muted)":`hsl(${s} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * 0.65))`,color:"var(--graview-ink, #1a1a1a)",boxShadow:o?"0 0 14px -4px var(--graview-accent)":void 0},children:[s===void 0?null:(0,a.jsx)("span",{"aria-hidden":"true",style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",marginRight:6,background:`hsl(${s} 55% var(--graview-tint-lightness) / 0.9)`}}),(0,a.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]})}function L({items:e,max:l=8,selectedIds:o=[],pick:r=!1}){let t=e.slice(0,l),d=e.length-t.length;return(0,a.jsxs)("div",{"data-graview-primitive":"roster",style:{display:"flex",flexWrap:"wrap",gap:6,alignContent:"flex-start"},children:[t.map(i=>(0,a.jsx)(h,{label:i.label,...i.hue===void 0?{}:{hue:i.hue},...r?{pickId:i.id}:{},...i.emphasis===void 0?{}:{emphasis:i.emphasis},selected:o.includes(i.id)},i.id)),d>0?(0,a.jsx)(h,{label:`+${d} more`}):null]})}function F({label:e,count:l,items:o,onExpand:r,flagged:t,problems:d}){return(0,a.jsx)(E,{title:e,meta:d?(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[d,(0,a.jsx)("span",{children:l})]}):l,tone:t?"warning":"muted",style:r?{cursor:"zoom-in"}:void 0,children:o&&o.length>0?(0,a.jsx)(L,{items:o,max:6,pick:!0}):null})}export{A as a,I as b,E as c,h as d,L as e,F as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.GZHZLJBF.js";import{n as P}from"./chunk.
|
|
1
|
+
import"./chunk.GZHZLJBF.js";import{n as P}from"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{$ as b,G as A,R as S}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import{Aa as w,na as L,vc as x}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as R}from"./chunk.AJZBJBMO.js";var u=R(A(),1);var n=R(S(),1),C={kind:"human"},p={color:"var(--graview-ink-muted)"};function I(e){if(e){if(/^https?:\/\//i.test(e))try{return new URL(e).href}catch{return}return L(e)?e:void 0}}function z(e){let o=b(),t=o?.linkedReads,[i,a]=(0,u.useState)(()=>t?t.answered(e)??"asking":null);return(0,u.useEffect)(()=>{if(!t){a(o?.linkedRecords?"asking":null);return}let d=t.answered(e);if(a(d===void 0?"asking":d),d!==void 0)return;let s=!0;return t.ask(e).then(l=>s&&a(l)),()=>{s=!1}},[t,o?.linkedRecords,e.address,e.kind,e.id]),i}function V({reference:e,as:o}){let t=b(),i=z(e),a={position:"relative",zIndex:x.raised,overflowWrap:"anywhere",minWidth:0,maxWidth:"100%"};if(i==="asking")return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"asking","aria-busy":"true",style:{...p,...a},children:"Linked record"});if(i&&"denied"in i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"denied",style:{...p,fontStyle:"italic",...a},children:"linked record (no access)"});if(!i)return(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"missing",style:{...p,fontStyle:"italic",...a},children:"linked record (not found)"});let d=I(i.href),s=t?.linkedRecords,l=t?.principal??C,g=s?.open?c=>{c.metaKey||c.ctrlKey||(c.preventDefault(),s.open(e,l))}:void 0,k=(0,n.jsx)("a",{"data-graview-linked-title":"",...d?{href:d}:{role:"link",tabIndex:0},...g?{onClick:g,onKeyDown:c=>!d&&(c.key==="Enter"||c.key===" ")?g(c):void 0}:{},style:{fontWeight:600,color:"inherit",textUnderlineOffset:3,cursor:d||g?"pointer":"default"},children:i.label});return o==="chip"?(0,n.jsx)("span",{"data-graview-linked":"","data-graview-linked-state":"found",title:i.describe,style:{display:"inline-flex",alignItems:"center",minHeight:24,...a},children:k}):(0,n.jsx)(D,{record:i,title:k,base:a})}function D({record:e,title:o,base:t}){return(0,n.jsxs)("span",{"data-graview-linked":"","data-graview-linked-state":"found",style:{display:"grid",gap:2,padding:"8px 10px",border:"1px solid var(--graview-line)",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-surface)",...t},children:[(0,n.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"2px 8px"},children:[o,e.app?(0,n.jsxs)("span",{"data-graview-linked-app":"",style:{...p,fontSize:"0.75rem"},children:["in ",e.app]}):null]}),e.describe?(0,n.jsx)("span",{"data-graview-linked-describe":"",style:{...p,fontSize:"0.8125rem"},children:e.describe}):null,e.card&&e.card.length>0?(0,n.jsx)("span",{"data-graview-linked-card":"",style:{display:"flex",flexWrap:"wrap",gap:"2px 12px",fontSize:"0.8125rem"},children:e.card.map(i=>(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{style:p,children:i.label})," ",i.text]},i.label))}):null]})}function H({relation:e,refs:o,as:t="record",nodeId:i,field:a,style:d}){let s=(0,n.jsx)("span",{"data-graview-linked-list":"",style:{display:"grid",gap:6,minWidth:0,...d},children:o.map(l=>(0,n.jsx)(V,{reference:l,as:t},w(l)))});return i&&a?(0,n.jsx)(K,{nodeId:i,field:a,relation:e,refs:o,drawn:s}):s}function K({nodeId:e,field:o,relation:t,refs:i,drawn:a}){let{fields:d,commit:s}=P(e),l=d.find(f=>f.field===o),[g,k]=(0,u.useState)(!1);if(!l)return a;let c=t.cardinality==="one"?i[0]?w(i[0]):void 0:i.map(w);return(0,n.jsxs)("span",{style:{display:"grid",gap:6,minWidth:0},children:[a,g?(0,n.jsx)(N,{relation:t,value:c,label:"Link another record",onChange:f=>{s(l,f),k(!1)},onCancel:()=>k(!1)}):(0,n.jsx)("button",{type:"button","data-graview-linked-change":"",onClick:()=>k(!0),style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-accent)",cursor:"pointer",minHeight:24},children:"Change"})]})}function N({relation:e,value:o,onChange:t,onCancel:i,label:a}){let d=b(),s=d?.linkedRecords,l=d?.principal??C,g=(0,u.useId)(),[k,c]=(0,u.useState)(""),[f,m]=(0,u.useState)("asking");(0,u.useEffect)(()=>{if(!s)return;let r=!0;m("asking");let y=setTimeout(()=>{Promise.resolve().then(()=>s.find({address:e.address,kinds:e.kinds,query:k,limit:20},l)).then(h=>r&&m(Array.isArray(h)?h:"denied"),()=>r&&m([]))},150);return()=>{r=!1,clearTimeout(y)}},[s,e.address,e.kinds.join(","),k,l.kind,l.id]);let v=new Set([o].flat().filter(r=>typeof r=="string")),W=r=>{let y=w(r);if(e.cardinality==="one")return t(y);t(v.has(y)?[...v].filter(h=>h!==y):[...v,y])};return s?(0,n.jsxs)("span",{"data-graview-linked-picker":"",style:{display:"grid",gap:6,minWidth:0},children:[(0,n.jsx)("label",{htmlFor:g,style:{...p,fontSize:"0.8125rem"},children:a}),(0,n.jsx)("input",{id:g,type:"search",value:k,placeholder:`Find one in ${e.address}`,onChange:r=>c(r.target.value),style:{font:"inherit",minHeight:32,padding:"4px 8px",border:"1px solid var(--graview-line)",borderRadius:6,background:"var(--graview-surface)",color:"inherit",minWidth:0}}),f==="asking"?(0,n.jsx)("span",{"aria-busy":"true",style:p,children:"Looking\u2026"}):f==="denied"?(0,n.jsx)("span",{"data-graview-linked-state":"denied",style:{...p,fontStyle:"italic"},children:"linked record (no access)"}):f.length===0?(0,n.jsx)("span",{style:p,children:"Nothing there matches."}):(0,n.jsx)("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:4},children:f.map(r=>{let y=v.has(w(r));return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-graview-linked-candidate":w(r),"aria-pressed":y,onClick:()=>W(r),style:{display:"grid",gap:2,width:"100%",textAlign:"start",font:"inherit",padding:"6px 8px",minHeight:32,border:"1px solid var(--graview-line)",borderRadius:6,background:y?"var(--graview-accent-soft, var(--graview-surface))":"var(--graview-surface)",color:"inherit",cursor:"pointer"},children:[(0,n.jsx)("span",{style:{fontWeight:600},children:r.label}),r.describe?(0,n.jsx)("span",{style:{...p,fontSize:"0.8125rem"},children:r.describe}):null]})},w(r))})}),i?(0,n.jsx)("button",{type:"button",onClick:i,style:{justifySelf:"start",font:"inherit",fontSize:"0.8125rem",background:"none",border:0,padding:"4px 0",color:"var(--graview-ink-muted)",cursor:"pointer",minHeight:24},children:"Keep it as it is"}):null]}):(0,n.jsxs)("span",{"data-graview-linked-picker":"","data-graview-linked-state":"no-host",style:p,children:["This page cannot read ",e.address,", so nothing there can be linked here."]})}var U=e=>(0,n.jsx)(H,{...e}),j=e=>(0,n.jsx)(N,{...e});export{N as LinkedPicker,H as LinkedRecordView,j as drawLinkedPicker,U as drawLinkedRecord};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.WVUJXDXZ.js";import{i as x}from"./chunk.
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{i as x}from"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.4EPT2CQG.js";import{Xa as f,Za as N,ca as S}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var k=(n,r,t)=>({untrusted:!0,authoredBy:t.say(r),text:n});function O(n,r){let t;for(let[a,e]of Object.entries(n)){if(typeof e!="string"||a==="id"||a==="kind")continue;let o=r.fieldBy(n.id,a);o&&(t??={...n},t[a]=k(e,o,r))}return t??n}function L(n,r,t){let a=e=>{if(Array.isArray(e))return e.map(a);if(e!==null&&typeof e=="object"&&"id"in e&&"label"in e){let o=e,i=t.recordBy(o.id);return i?{...o,label:k(o.label,i,t)}:o}if(typeof e=="string"){let o=t.recordBy(n);return o?k(e,o,t):e}return e};return Object.fromEntries(Object.entries(r).map(([e,o])=>[e,a(o)]))}function $(n,r){return n.map(t=>{let a=r.recordBy(t.id);return a?{...t,label:k(t.label,a,r)}:t})}function D(n,r){return{...n,nodes:n.nodes.map(t=>O(t,r))}}var E=n=>(JSON.stringify(n)??"null").length,R=n=>typeof n=="number"&&Number.isFinite(n)&&n>0?Math.floor(n):0;function w(n,r,t,a,e,o=""){let i=n-r-t;return i>0?`and ${i} more ${e}: call ${a} with ${o}offset ${r+t} for the next page.`:void 0}var j=({line:n,...r})=>r;function T(n){let r;for(let[t,a]of Object.entries(n))typeof a!="string"||a.length<=600||(r??={...n},r[t]=`${a.slice(0,600)}\u2026 (cut at ${600} of ${a.length} characters)`);return r??n}function B(n,r,t,a){let e=Math.min(t,Math.max(0,n.length-r)),o=n.slice(r,r+e),i=a(o);for(;e>1&&E(i)>8e3;)e=Math.max(1,Math.floor(e*.75)),o=n.slice(r,r+e),i=a(o);return{page:o,answer:i}}function C(n,r){let t=JSON.stringify(r)??"null";if(t.length<=8e3)return r;let a=`This answer was ${t.length} characters, more than the ${8e3} one read answers, so it is cut. Ask ${n} for less, or use search_graph and get_node to read one thing.`;for(let e=8e3-a.length-40;;){let o={cut:a,partial:t.slice(0,e)},i=E(o)-8e3;if(i<=0)return o;e=Math.max(0,e-i-8)}}function I(n,r){let{matched:t,later:a,...e}=r,o=n.hits.filter(i=>i.about==="node").length;return n.total>o?{...e,more:`and ${n.total-o} more records match: narrow the words, or add kind:<kind>.`}:e}function P(n,r,t){let a=N(t.archived),e={nodes:n.graph.allNodes({archived:a}),edges:n.graph.allEdges({archived:"all"})},o=R(t.offset),i=e.nodes.length,{page:h,answer:u}=B(e.nodes,o,25,d=>{let g=new Set(d.map(s=>s.id)),l=new Set(d.map(s=>s.id)),c=w(i,o,d.length,"get_graph","nodes"),p=s=>l.has(s)||(a==="all"?n.graph.has(s):n.graph.has(s)&&f(n.graph.getNode(s))===a);return{...D({nodes:d.map(T),edges:e.edges.filter(s=>g.has(s.from)&&p(s.to))},r),total:i,...c?{more:c}:{}}});return{data:u,reads:h.map(d=>d.id)}}function U(n,r,t,a){let e=n.graph.getNode(t),o=R(a.offset),i=n.graph.outEdges(t),h=n.graph.inEdges(t),u=i.slice(o,o+20),d=h.slice(o,o+20),g=(s,A)=>{let m=n.graph.getNode(A);return{kind:s,id:A,label:m?S(n.schema.tryDefinition(m.kind),m):A,...f(m)?{archived:!0}:{}}},l=x(n.schema,n.graph,e),c=n.violations().filter(s=>s.nodeIds.includes(t)),p=[w(i.length,o,u.length,"get_node","links out",`id "${t}" and `),w(h.length,o,d.length,"get_node","links in",`id "${t}" and `),c.length>20?`and ${c.length-20} more problems: get_violations lists them.`:void 0].filter(Boolean);return{data:{node:O(T(e),r),...f(e)?{archived:!0}:{},...Object.keys(l.values).length>0?{computed:L(t,l.values,r)}:{},...Object.keys(l.refused).length>0?{uncomputed:l.refused}:{},out:$(u.map(s=>g(s.kind,s.to)),r),in:$(d.map(s=>g(s.kind,s.from)),r),violations:c.slice(0,20).map(j),...p.length>0?{more:p.join(" ")}:{}},reads:[t,...u.map(s=>s.to),...d.map(s=>s.from)]}}function F(n,r){let t=R(r.offset),{page:a,answer:e}=B(n,t,20,o=>{let i=w(n.length,t,o.length,"get_violations","problems");return{violations:o.map(j),total:n.length,...i?{more:i}:{}}});return{data:e,reads:[...new Set(a.flatMap(o=>o.nodeIds))]}}export{P as graphRead,U as nodeRead,I as searchRead,F as violationsRead,C as withinReadChars};
|