graview 0.1.35 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/{chunk.3C4RJIJU.js → chunk.272ZJXQP.js} +1 -1
- package/dist/preview/{chunk.H243UV3Z.js → chunk.27TLAVRR.js} +1 -1
- package/dist/preview/{chunk.GF7LA4QG.js → chunk.2A2DLMT3.js} +1 -1
- package/dist/preview/{chunk.FBY5IUGU.js → chunk.2B4WVCVV.js} +1 -1
- package/dist/preview/{chunk.ZE4CTZQ3.js → chunk.3PT55HXT.js} +1 -1
- package/dist/preview/{chunk.DPP7ITTU.js → chunk.3SM2CHKF.js} +1 -1
- package/dist/preview/{chunk.VWHMYPLL.js → chunk.3ZIOAPI5.js} +1 -1
- package/dist/preview/{chunk.5B7NWF7C.js → chunk.42WJ6VJZ.js} +1 -1
- package/dist/preview/{chunk.RIW7SQH4.js → chunk.4B73P2WA.js} +1 -1
- package/dist/preview/{chunk.JMQ6YLQX.js → chunk.4GXXD4NG.js} +1 -1
- package/dist/preview/chunk.4Q56V7GS.js +1 -0
- package/dist/preview/{chunk.SBBNIYVB.js → chunk.4STIUIT6.js} +1 -1
- package/dist/preview/chunk.53IKY7UP.js +1 -0
- package/dist/preview/chunk.56BPXB6E.js +1 -0
- package/dist/preview/{chunk.LRRVBM4F.js → chunk.5PU3RWYY.js} +2 -2
- package/dist/preview/chunk.64MJ5FRL.js +1 -0
- package/dist/preview/{chunk.UWIYKGYK.js → chunk.6II4BONS.js} +1 -1
- package/dist/preview/{chunk.VMGWYCXU.js → chunk.6KMXLUOS.js} +1 -1
- package/dist/preview/{chunk.AINNENYD.js → chunk.6QDFBCV4.js} +2 -2
- package/dist/preview/{chunk.IHFNLKXV.js → chunk.6W7J76TK.js} +1 -1
- package/dist/preview/{chunk.5VB7DJTL.js → chunk.6ZZZBDEG.js} +1 -1
- package/dist/preview/{chunk.CHJZ7LST.js → chunk.7CO7S6QM.js} +1 -1
- package/dist/preview/chunk.7G3B5QPH.js +1 -0
- package/dist/preview/chunk.7TBSVQSH.js +1 -0
- package/dist/preview/{chunk.QVKKXMNK.js → chunk.7YQYWOZR.js} +1 -1
- package/dist/preview/{chunk.4K5QCJFH.js → chunk.AAZFVCSP.js} +1 -1
- package/dist/preview/{chunk.ZSW74NVJ.js → chunk.ACEYGWMO.js} +1 -1
- package/dist/preview/{chunk.TIBZZ2WY.js → chunk.ACXA55GW.js} +1 -1
- package/dist/preview/{chunk.Y5Z4ZDTO.js → chunk.BZ5VLPKB.js} +2 -2
- package/dist/preview/chunk.CE3NOADH.js +1 -0
- package/dist/preview/chunk.CNJENUPC.js +1 -0
- package/dist/preview/{chunk.DMNXYMLC.js → chunk.CRPT3ZT3.js} +1 -1
- package/dist/preview/{chunk.2OBIO5Y6.js → chunk.CUCNT7MG.js} +1 -1
- package/dist/preview/{chunk.6J7DR7XQ.js → chunk.D6RDTUX3.js} +1 -1
- package/dist/preview/{chunk.UHQD3NTK.js → chunk.DANDYIB5.js} +1 -1
- package/dist/preview/{chunk.OEDCAHII.js → chunk.DSP62QYK.js} +1 -1
- package/dist/preview/chunk.E77K6KBX.js +1 -0
- package/dist/preview/{chunk.HPD5ZDZH.js → chunk.EBLKEQ7O.js} +1 -1
- package/dist/preview/{chunk.EQWOQOFJ.js → chunk.EDSPYKR4.js} +1 -1
- package/dist/preview/chunk.EQIGKXIG.js +1 -0
- package/dist/preview/{chunk.ZHXX22AT.js → chunk.ER5ILWKY.js} +2 -2
- package/dist/preview/{chunk.KYH4QIVI.js → chunk.ET76FISZ.js} +1 -1
- package/dist/preview/{chunk.X7W27IRI.js → chunk.F5BCCGFK.js} +5 -5
- package/dist/preview/{chunk.OZ5KJLA2.js → chunk.FERBNBDE.js} +1 -1
- package/dist/preview/{chunk.FUQVNXLB.js → chunk.FQKH67BP.js} +1 -1
- package/dist/preview/{chunk.577PGFUT.js → chunk.FUR4IHWG.js} +1 -1
- package/dist/preview/chunk.FWBQVPMI.js +1 -0
- package/dist/preview/{chunk.3QXHII5W.js → chunk.GOCUBIRW.js} +1 -1
- package/dist/preview/{chunk.A3F7MFDR.js → chunk.GUDKPK42.js} +1 -1
- package/dist/preview/{chunk.QVUL2FSI.js → chunk.GXLAZGYT.js} +1 -1
- package/dist/preview/{chunk.Z7ZCR4LN.js → chunk.GZLYTPE7.js} +1 -1
- package/dist/preview/{chunk.EAM4NAQH.js → chunk.H4T56OXM.js} +1 -1
- package/dist/preview/{chunk.SECORXDP.js → chunk.HPX3F7XX.js} +1 -1
- package/dist/preview/{chunk.PJ2DF6C7.js → chunk.HZPTBPJY.js} +1 -1
- package/dist/preview/{chunk.PW7YH6JV.js → chunk.IB32NOV5.js} +1 -1
- package/dist/preview/{chunk.FSAHO3LV.js → chunk.IMRCAU4T.js} +1 -1
- package/dist/preview/{chunk.FX6GH57T.js → chunk.ITXIFDQ7.js} +1 -1
- package/dist/preview/{chunk.LWSTEZIP.js → chunk.J3TEJBI5.js} +1 -1
- package/dist/preview/{chunk.B2KITMSD.js → chunk.JLXQ6ZLI.js} +1 -1
- package/dist/preview/{chunk.ZZTDQKM2.js → chunk.JZMA2AV7.js} +1 -1
- package/dist/preview/{chunk.FIVLFXFB.js → chunk.K5NJTE3F.js} +1 -1
- package/dist/preview/{chunk.3P4IIXIT.js → chunk.KBJG5SI2.js} +1 -1
- package/dist/preview/{chunk.3H4NVUWV.js → chunk.KU6NIMQX.js} +1 -1
- package/dist/preview/{chunk.LAF6GTBN.js → chunk.LA7535VO.js} +1 -1
- package/dist/preview/{chunk.D4WQEBWV.js → chunk.LMVCWYYG.js} +1 -1
- package/dist/preview/{chunk.2YGQVI6T.js → chunk.LNNFNJKN.js} +1 -1
- package/dist/preview/{chunk.BL6VDLAW.js → chunk.M4FQ7SSM.js} +1 -1
- package/dist/preview/{chunk.BGW7XTMH.js → chunk.MXJS67W4.js} +1 -1
- package/dist/preview/{chunk.LIIC25G6.js → chunk.NJ62C2GU.js} +1 -1
- package/dist/preview/{chunk.VZHV25JE.js → chunk.NNCTJSD3.js} +1 -1
- package/dist/preview/{chunk.GO4QBFED.js → chunk.NWYOLGQ3.js} +1 -1
- package/dist/preview/{chunk.DNDHDDM6.js → chunk.O3OALXCI.js} +2 -2
- package/dist/preview/{chunk.JLMLKDVX.js → chunk.O6ROFVFD.js} +1 -1
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.OF34OZ4V.js} +1 -1
- package/dist/preview/{chunk.GCVO6N26.js → chunk.OFJH7LDC.js} +1 -1
- package/dist/preview/{chunk.Q7TP4RFE.js → chunk.OH5BBE2B.js} +1 -1
- package/dist/preview/{chunk.PKKA6JWA.js → chunk.OREMUXB5.js} +1 -1
- package/dist/preview/{chunk.CDMV6L5I.js → chunk.OXZRGP53.js} +1 -1
- package/dist/preview/chunk.OZR5NI4J.js +1 -0
- package/dist/preview/{chunk.PPUAPAWR.js → chunk.P75TPZWT.js} +1 -1
- package/dist/preview/{chunk.QRMWFEEH.js → chunk.PWOVXARZ.js} +1 -1
- package/dist/preview/chunk.Q63RPNUS.js +1 -0
- package/dist/preview/{chunk.KWCML3BF.js → chunk.QDHUDLJB.js} +1 -1
- package/dist/preview/{chunk.4NZBMZC7.js → chunk.QEALNWWL.js} +3 -3
- package/dist/preview/{chunk.APNN6BKF.js → chunk.QLMUGC7R.js} +1 -1
- package/dist/preview/{chunk.DQ5HAB3N.js → chunk.QTITRX5Q.js} +1 -1
- package/dist/preview/{chunk.GMOTRAKJ.js → chunk.R45BF6JV.js} +1 -1
- package/dist/preview/{chunk.U5EJSTST.js → chunk.R7LRJS6B.js} +2 -2
- package/dist/preview/{chunk.2QQAOJET.js → chunk.RKHEZ6KZ.js} +1 -1
- package/dist/preview/{chunk.G2ZPQUXM.js → chunk.S6GJGTJE.js} +1 -1
- package/dist/preview/{chunk.MVN6H65Q.js → chunk.SG23JC6D.js} +1 -1
- package/dist/preview/chunk.SSRP5SBR.js +1 -0
- package/dist/preview/{chunk.FVPOSGNG.js → chunk.T2CN7UTZ.js} +2 -2
- package/dist/preview/{chunk.5FZQI2US.js → chunk.T47DLH5Z.js} +1 -1
- package/dist/preview/{chunk.RTB4MMF6.js → chunk.TGEF6TMM.js} +1 -1
- package/dist/preview/{chunk.JAPYJ53U.js → chunk.UJR3Y7MP.js} +1 -1
- package/dist/preview/{chunk.52QAIGCD.js → chunk.VHWUGSFW.js} +1 -1
- package/dist/preview/{chunk.6K2HASOH.js → chunk.W42P7NOL.js} +1 -1
- package/dist/preview/{chunk.SD33BD7A.js → chunk.WGI5G6NM.js} +1 -1
- package/dist/preview/{chunk.IX6RNGAT.js → chunk.WHTQHU3M.js} +1 -1
- package/dist/preview/{chunk.TWWFWHK3.js → chunk.WJ2TWU2I.js} +1 -1
- package/dist/preview/{chunk.GCGITEON.js → chunk.XBTZXWJX.js} +1 -1
- package/dist/preview/{chunk.747GGBPR.js → chunk.XRCGADKC.js} +1 -1
- package/dist/preview/{chunk.XSYBNUXF.js → chunk.Y3IJDWNS.js} +1 -1
- package/dist/preview/{chunk.5MCC54VM.js → chunk.YNE5QR7Q.js} +1 -1
- package/dist/preview/{chunk.5EAQDBBE.js → chunk.ZDNJK2SX.js} +1 -1
- package/dist/preview/{chunk.QU356VB2.js → chunk.ZEW2OOZ5.js} +1 -1
- package/dist/preview/chunk.ZNS3LYJU.js +1 -0
- package/dist/preview/{chunk.YT2CYCVT.js → chunk.ZSSOTIFL.js} +1 -1
- package/dist/preview/{chunk.DLT3EE4D.js → chunk.ZVMIHXVK.js} +1 -1
- package/dist/preview/{chunk.DUUARGPE.js → chunk.ZWZ5SEXT.js} +1 -1
- package/dist/preview/index.html +42 -42
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.4J75WRDG.js +0 -1
- package/dist/preview/chunk.656N5BHG.js +0 -1
- package/dist/preview/chunk.6P7P2AW7.js +0 -1
- package/dist/preview/chunk.AEHPDVLQ.js +0 -1
- package/dist/preview/chunk.DTR5I4BI.js +0 -1
- package/dist/preview/chunk.FHXXYWL3.js +0 -1
- package/dist/preview/chunk.M5HADQPP.js +0 -1
- package/dist/preview/chunk.O36ZDLWC.js +0 -1
- package/dist/preview/chunk.PQPTYNW2.js +0 -1
- package/dist/preview/chunk.RHYA742Q.js +0 -1
- package/dist/preview/chunk.TPX6AVJL.js +0 -1
- package/dist/preview/chunk.U2PYW5MS.js +0 -1
- package/dist/preview/chunk.ZFWV4JAJ.js +0 -1
- package/dist/preview/chunk.ZKXK22AH.js +0 -1
- package/dist/preview/chunk.ZQNLC33L.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as o,m as u}from"./chunk.
|
|
1
|
+
import{h as o,m as u}from"./chunk.6II4BONS.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
|
|
@@ -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{n as v}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{n as v}from"./chunk.BZ5VLPKB.js";import{F as P,I as w,Q as p,Y as R,a as A,xa as b}from"./chunk.6II4BONS.js";import{Sc as h}from"./chunk.F5BCCGFK.js";import{b as a}from"./chunk.AJZBJBMO.js";var L=a(p(),1),B=v.part(e=>(0,L.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var l=a(P(),1),S=a(p(),1),C=b(A(()=>(__graviewPreload(import.meta.url,["./chunk.TGEF6TMM.js","./chunk.D6RDTUX3.js","./chunk.3ZIOAPI5.js","./chunk.ZVMIHXVK.js","./chunk.272ZJXQP.js","./chunk.3SM2CHKF.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.PWOVXARZ.js","./chunk.SG23JC6D.js","./chunk.OJGHDWI6.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.ACXA55GW.js")))),F=C.part((e,r)=>{let t=e.RecordInteractions;return(0,S.jsx)(t,{...r})},{quiet:!0});function I(e,r,t){let o=e.target;return(o.on==="record"||o.on==="field"?o.id===r:o.on==="selection"?o.ids.includes(r):o.on==="act"?o.id===r:!1)||e.offered.some(n=>n.id===`record:${r}`||n.id.startsWith(`fill:${r}:`))||(e.batches??[]).some(n=>t(n).includes(r))}function T({id:e,style:r,headingStyle:t,className:o}){let{ai:d,aiDesk:n,store:f}=R(),{entries:y}=w(n),s=d.off===!0;(0,l.useEffect)(()=>{s||n.load()},[n,s]);let g=f.log.length,m=(0,l.useMemo)(()=>{let x=u=>f.log.all().flatMap(k=>k.batch===u?k.writes:[]);return y.filter(u=>I(u,e,x))},[y,e,f,g]);return s||m.length===0?null:(0,S.jsx)(l.Suspense,{fallback:null,children:(0,S.jsx)(F,{entries:m,...r?{style:r}:{},...t?{headingStyle:t}:{},...o?{className:o}:{}})})}var c=a(P(),1),i=a(p(),1);function ro({context:e,stop:r,title:t,label:o,style:d,className:n,children:f,...y}){let s=h(e.views?.arrangement?.()),g=f??(0,i.jsxs)(i.Fragment,{children:["In ",s==="Scene"?"the scene":s.replace(/^The /,"the ")," ",(0,i.jsx)("span",{"aria-hidden":"true",children:"\u2197"})]}),m=o?{"aria-label":o}:{};if(e.overview){let x=e.overview;return(0,i.jsx)("a",{href:r,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},onClick:u=>{u.preventDefault(),x(r)},children:g})}return e.embedded?null:(0,i.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},children:g})}function oo(){return(0,i.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function to(e){let r=(0,c.useRef)(0),t=(0,c.useCallback)(o=>e.subscribe(()=>{r.current+=1,o()}),[e]);return(0,c.useSyncExternalStore)(t,()=>r.current,()=>0)}export{B as a,T as b,ro as c,oo as d,to as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as H,b as I,c as j,e as R,h as V,i as D,j as A,k,l as x,n as Y,o as Z}from"./chunk.
|
|
1
|
+
import{a as H,b as I,c as j,e as R,h as V,i as D,j as A,k,l as x,n as Y,o as Z}from"./chunk.ZSSOTIFL.js";import{b as U}from"./chunk.4B73P2WA.js";import{H as C,K as G,La as T,Oa as B,Q as M,X as W,Z as F}from"./chunk.F5BCCGFK.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(l=>l.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??{})?T(D(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))),l=(a.getUTCDay()+6)%7;return a.setUTCDate(a.getUTCDate()-l),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 l=u.get(a);return l||(l=new Set(R(e.schema,a).filters.map(d=>d.key)),u.set(a,l)),l};return a=>{let l=c(a.kind),d=s.filter(i=>l.has(i.key));return d.every(i=>x(e,a,i))?n.length>0?Z(e.schema.tryDefinition(a.kind),A(a),n)!==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(f=>x(n,t,f))):[...c],l=[];for(let t=r.sort;t&&l.length<4;t=t.then)l.push(t);let d=l.length>0?a.map((t,f)=>({node:t,index:f,values:l.map(o=>ie(n,t,o.by))})).sort((t,f)=>{for(let[o,p]of l.entries()){let[h,K]=[t.values[o],f.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-f.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,f,o)=>{let p=y.get(t)??{label:f,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?H(m,i.by):F(i.by),$=i.by in O,b=$?I(O[i.by]):void 0,X=j(n.schema,N?.kind??"").find(t=>t.key===i.by)?.label,L=$?`No ${J.toLowerCase()}`:`Without ${(X??F(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=T(D(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 f=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));f.length===0?g("",L,t):g(f.map(o=>o.id).join(","),f.map(o=>o.label).join(", "),t)}let w=b==="choice"?V(O[i.by]):void 0,ee=[...y.entries()].sort(([t,f],[o,p])=>t===""?1:o===""?-1:w?w.indexOf(t)-w.indexOf(o):b==="boolean"?o.localeCompare(t):b==="date"?t.localeCompare(o):f.label.localeCompare(p.label)).map(([t,f])=>({key:t,label:f.label,nodes:f.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 le(e){let r=P(e?.sort),n=Q(e?.group);if(!(!r&&!n))return{...r?{sort:r}:{},...n?{group:{by:n.by}}:{}}}var fe=(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??[],l=d=>{if(d.key==="")return[1,0];let i=fe(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:l(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,le as b,ce as c,re as d,te as e,ne as f,ue as g,ae as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ac as y,Cc as d,Ec as u,Fc as k,Mc as f,Qc as w,Rc as $,Sc as v,Uc as b,Vc as S,aa as g}from"./chunk.F5BCCGFK.js";function A(s){let i=[];for(let n of f(s).drawn)for(let t of n.kinds)i.push({kind:t,title:n.title,as:n.as,...n.across?{across:n.across}:{},...n.kinds.length>1?{over:n.kinds}:{},...n.hidden?{hidden:!0}:{}});for(let n of s.views?.places?.()??[])i.some(t=>t.kind===n.kind&&t.as===n.as)||i.push(n);return i}function F(s){return L(s.schema,A(s),{...s.pages?{pages:s.pages}:{},lenses:f(s).drawn,home:(s.home?.length??0)>0})}function L(s,i,n={}){let{pages:t}=n,l=s.kinds,h=i.filter(e=>l.includes(e.kind)),a=S(t?.first,s,h),P=new Set(t?.hide??[]),c=b(l,t?.order),p=[{slug:"home",title:"Home",kind:null,cardinality:"many",address:"/",stop:"#",...a?.to==="home"||a===void 0&&n.home?{first:!0}:{}},{slug:w,title:v(t),kind:null,cardinality:"many",address:$,stop:"#"}],x=y([...h].sort((e,o)=>c.indexOf(e.kind)-c.indexOf(o.kind)));for(let e of x){let o=n.lenses?.find(r=>r.as===e.as&&r.kinds.includes(e.kind)),m=k(e,h);p.push({slug:e.as,title:e.title,kind:e.kind,...e.over?{over:e.over.filter(r=>l.includes(r))}:{},cardinality:"many",address:u(e.as,m?d(s,e.kind).slice(1):void 0),stop:m?`#focus=aggregate:${e.kind}&in.view=${encodeURIComponent(e.as)}`:`#view=${encodeURIComponent(e.as)}`,...o?{lens:o.lens}:{},...e.hidden?{hidden:!0}:{},...a?.to==="place"&&a.place.as===e.as&&(a.place.kind===e.kind||e.over?.includes(a.place.kind))?{first:!0}:{}})}for(let e of c)p.push({slug:d(s,e).slice(1),title:g(s,e),kind:e,cardinality:"many",address:d(s,e),stop:`#focus=aggregate:${e}`,...P.has(e)?{hidden:!0}:{},...a?.to==="kind"&&a.kind===e?{first:!0}:{}});return p}export{F as a,L as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.7CO7S6QM.js";import"./chunk.6QDFBCV4.js";import"./chunk.R7LRJS6B.js";import"./chunk.IB32NOV5.js";import"./chunk.4STIUIT6.js";import"./chunk.WHTQHU3M.js";import"./chunk.KU6NIMQX.js";import"./chunk.Y3IJDWNS.js";import"./chunk.OFJH7LDC.js";import"./chunk.5PU3RWYY.js";import"./chunk.27TLAVRR.js";import"./chunk.OREMUXB5.js";import"./chunk.ZDNJK2SX.js";import"./chunk.ZSSOTIFL.js";import"./chunk.HJCQ6I3S.js";import"./chunk.ZWZ5SEXT.js";import"./chunk.FQKH67BP.js";import"./chunk.LA7535VO.js";import"./chunk.ZEW2OOZ5.js";import"./chunk.7YQYWOZR.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.UT6642FC.js";import"./chunk.EBLKEQ7O.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import"./chunk.6II4BONS.js";import"./chunk.F5BCCGFK.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as ae}from"./chunk.Z7ZCR4LN.js";import{b as Ce,d as $e}from"./chunk.RIW7SQH4.js";import{e as Te}from"./chunk.FSAHO3LV.js";import{$ as we,Bc as De,Dc as We,Ec as Me,H as ke,Ib as ie,Ka as Se,Ma as H,T as R,U as xe,W as E,Wc as je,X as K,Y as Ae,Z as v,aa as Ne,hc as oe,lc as ve,mc as Oe,zc as Re}from"./chunk.X7W27IRI.js";function se(n,e){return n.display?.labels?.[e]??v(e)}function de(n){let e=ae(n);switch(e.type){case"text":case"date":case"number":case"boolean":case"choice":return e.type;default:return}}function Je(n,e){let t=new Map,r=n.tryDefinition(e);for(let[a,i]of Object.entries(r?.edges??{}))t.set(a,{key:a,label:i.description?R(i.description):v(a),about:"edge",far:i.to==="*"?[...n.kinds]:[...i.to]});for(let a of n.definitions)if(a.kind!==e)for(let[i,d]of Object.entries(a.edges??{}))t.has(i)||d.to!=="*"&&!d.to.includes(e)||t.set(i,{key:i,label:d.inverse?R(d.inverse):v(i),about:"edge",far:[a.kind]});return[...t.values()]}var Ze=["current","past","any","flagged","clear"];function Fe(n,e){let t=n?.lifecycle;if(!t||t.retired==="date")return!1;let r=t.retired.map(String);return e.some(a=>a.key===t.field&&r.includes(a.value))}function Be(n,e){let t=n.tryDefinition(e);if(!t)return{kind:e,sorts:[],filters:[],groups:[]};let r=new Set(t.display?.hide??[]),a=t.fields.shape??{},i=[{key:"label",label:"Name",about:"label",type:"text"}],d=[],f=[];for(let[g,p]of Object.entries(a)){if(g==="id"||g==="kind"||g==="label"||r.has(g))continue;let A=de(p);if(!A)continue;let O=se(t,g),w=A==="choice"?Le(p):A==="boolean"?["true","false"]:void 0,N={key:g,label:O,about:"field",type:A,...w?{options:w}:{}};i.push(N),d.push(N),(A==="boolean"||A==="choice")&&f.push(N),A==="date"&&f.push({...N,buckets:["day","week","month","year","decade"]})}for(let g of Je(n,e))i.push(g),d.push(g),f.push(g);let l={key:"is",label:t.lifecycle?"Standing and currency":"Standing",about:"is",type:"choice",options:t.lifecycle?[...Ze]:["flagged","clear"]};d.push(l);let y=t.fieldRoles?.order,u=y&&(y in a||y==="label")?{by:y,direction:"asc"}:void 0;return{kind:e,sorts:i,filters:d,groups:f,...u?{natural:u}:{}}}function On(n,e){let t=[];for(let a of e.filters){let i=a.about==="edge"&&a.far?.length===1?n.tryDefinition(a.far[0]):void 0;if(!(!i||i.kind===e.kind))for(let[d,f]of Object.entries(i.fields.shape??{}))de(f)!=="choice"||i.display?.hide?.includes(d)||t.push({key:`${a.key}.${d}`,label:`${a.label} \xB7 ${se(i,d)}`,about:"via",type:"choice",options:Le(f),far:[i.kind]})}if(t.length===0)return e;let r=e.filters.filter(a=>a.about!=="is");return{...e,filters:[...r,...t,...e.filters.filter(a=>a.about==="is")]}}function Rn(n,e){let t=n.tryDefinition(e.kind),r=Object.entries(t?.computed??{});if(!t||r.length===0)return e;let a=r.filter(([i])=>!e.sorts.some(d=>d.key===i)).map(([i,d])=>({key:i,label:(typeof d=="object"?d.label:void 0)??se(t,i),about:"field",type:"number"}));return{...e,sorts:[...e.sorts,...a]}}function Le(n){let e=ae(n);return e.type==="choice"?e.options:[]}var Ie=n=>n,Pe=n=>n;function en(n,e,t){let r=new Map;for(let a of[...n.out(e,t),...n.in(e,t)])r.set(a.id,a);return[...r.values()]}function le(n,e,t){let r=n.schema.tryDefinition(e.kind);if(t.key==="is")switch(t.value){case"current":return E(r,Pe(e),n.today);case"past":return!E(r,Pe(e),n.today);case"any":return!0;case"flagged":return n.flagged?.has(e.id)??!1;case"clear":return!(n.flagged?.has(e.id)??!1);default:return!0}let a=r?.fields.shape??{};if(t.key in a){let l=Se(Ie(e),t.key,n.today??ke()),y=de(a[t.key]);if(y==="date"){let[u,g]=t.value.split(":");if(typeof l!="string"||!g)return!1;let p=l.slice(0,10);return u==="before"?p<g:u==="after"?p>g:p===g}if(y==="boolean")return String(l)===t.value;if(y==="number"){let u=t.value.lastIndexOf(":"),g=u>0?t.value.slice(0,u):"",p=Number(t.value.slice(u+1));if(g==="at-most"||g==="at-least")return typeof l!="number"||!Number.isFinite(p)?!1:g==="at-most"?l<=p:l>=p}return String(l)===t.value}let[i,d]=t.key.split("."),f=en(n.graph,e.id,i);return d?f.some(l=>String(Ie(l)[d])===t.value):t.value==="*"?f.length>0:t.value==="none"?f.length===0:f.some(l=>l.id===t.value)}var nn=5;function ze(n){return n.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function ce(n){return ze(n).replace(/ /g,"")}var z=new Map,tn=5e4;function _(n){let e=z.get(n);if(e===void 0){z.size>=tn&&z.clear();let t=ze(n);e={tokens:t.split(" ").filter(Boolean),whole:t.replace(/ /g,"")},z.set(n,e)}return e}var D=n=>[..._(n).tokens];function j(n,e){if(e.length===0)return;let{whole:t,tokens:r}=_(n),a=e.join("");if(t.length===0)return;if(t===a)return"exact";if(e.every(d=>r.some(f=>f.startsWith(d))))return t.startsWith(a)?"prefix":e.every(d=>r.includes(d))?"word":"part"}function Q(n,e,t=48){let r=n.replace(/\s+/g," ").trim();if(r.length<=t)return r;let a=e[0],i=r.normalize("NFD").replace(/\p{M}/gu,"").toLowerCase(),d=a?i.search(new RegExp(`(^|[^\\p{L}\\p{N}])${rn(a)}`,"u")):-1,f=d<0?0:d+(i[d]&&/[\p{L}\p{N}]/u.test(i[d])?0:1),l=Math.max(0,f-Math.floor(t/3));if(l>0){let u=r.lastIndexOf(" ",l);l=u<0?0:u+1}let y=Math.min(r.length,l+t);if(y<r.length){let u=r.indexOf(" ",y);y=u<0||u-y>16?y:u}return`${l>0?"\u2026":""}${r.slice(l,y).trim()}${y<r.length?"\u2026":""}`}var rn=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),on=/^([\p{L}][\p{L}\p{N}_-]*):(\S+)$/u;function an(n){let e=[],t=[];for(let r of n.trim().split(/\s+/).filter(Boolean)){let a=on.exec(r);a?t.push({key:a[1],value:a[2]}):e.push(r)}return{words:e.join(" "),conditions:t}}var Ee=new WeakMap;function q(n,e){let t=Ee.get(e);if(t&&t.definition===n)return t.texts;let r=sn(n,e);return Ee.set(e,{definition:n,texts:r}),r}function sn(n,e){let t=K(n,e),r=[{field:"label",reading:"Name",text:t}];for(let a of $e(e,n,{limit:Number.POSITIVE_INFINITY}))a.key==="label"||a.value===t||typeof e[a.key]!="boolean"&&r.push({field:a.key,reading:a.label,text:a.markdown?Te(a.value):a.value});return r}var T={exact:0,prefix:1,word:2,part:3,field:4,near:5},Ge=new Set(["a","an","the","of","and","or","for","to","in","on","at","by","with","my","our","is"]);function Ke(n){let e=n;e.length>4&&e.endsWith("ies")?e=`${e.slice(0,-3)}y`:e.length>4&&/(ss|x|ch|sh|z)es$/.test(e)?e=e.slice(0,-2):e.length>3&&e.endsWith("s")&&!/(ss|us|is)$/.test(e)&&(e=e.slice(0,-1));for(let t of["ing","ed"])if(e.length>t.length+2&&e.endsWith(t)){e=e.slice(0,-t.length),/([b-df-hj-km-np-rtv-z])\1$/.test(e)&&(e=e.slice(0,-1));break}return e.length>3&&e.endsWith("e")?e.slice(0,-1):e}function He(n,e,t){if(Math.abs(n.length-e.length)>t)return t+1;let r=[],a=Array.from({length:e.length+1},(i,d)=>d);for(let i=1;i<=n.length;i++){let d=[i],f=i;for(let l=1;l<=e.length;l++){let y=Math.min(a[l]+1,d[l-1]+1,a[l-1]+(n[i-1]===e[l-1]?0:1));i>1&&l>1&&n[i-1]===e[l-2]&&n[i-2]===e[l-1]&&(y=Math.min(y,r[l-2]+1)),d[l]=y,y<f&&(f=y)}if(f>t)return t+1;r=a,a=d}return a[e.length]}var G=new Map;function dn(n,e){let t=G.get(n);t||(G.size>=64&&G.clear(),G.set(n,t=new Map));let r=t.get(e);return r===void 0&&(r=ln(n,e)??null,t.set(e,r)),r??void 0}function ln(n,e){if(/\d/.test(n))return;let t=Ke(n);if(t.length>=3&&(Ke(e)===t||t.length>=4&&e.startsWith(t)))return"stem";let r=n.length<4?0:n.length<=7?1:2;if(r!==0){if(He(n,e,r)<=r)return"spelling";if(n.length>=5){for(let a=n.length-r;a<=n.length+r;a++)if(a<e.length&&He(n,e.slice(0,a),r)<=r)return"spelling"}}}function cn(n,e){let t=e.length>1?e.filter(a=>!Ge.has(a)):e;if(t.length===0)return;let r;for(let a of t){let i;for(let d of n){for(let f of _(d.text).tokens){if(f.startsWith(a)){i={text:d,matched:f};break}let l=i?void 0:dn(a,f);l&&(i={text:d,matched:f,by:l})}if(i&&!i.by)break}if(!i)return;i.by&&!r&&(r={text:i.text,asked:a,matched:i.matched,by:i.by})}if(r)return{field:r.text.field,reading:r.text.reading,fragment:Q(r.text.text,[r.matched]),strength:"near",asked:r.asked,matched:r.matched,by:r.by}}var fn=80;function un(n,e,t){let r=D(e).filter(d=>!Ge.has(d)).join(" ")||e,a=t===void 0?[]:D(t),i=a.length>0&&n.find(d=>a.every(f=>_(d.text).tokens.some(l=>l.startsWith(f))))||n[0];return{field:i.field,reading:i.reading,fragment:Q(i.text,a),strength:"near",asked:r,matched:(t??i.text).slice(0,fn),by:"meaning"}}function _e(n,e,t){let r=D(t);if(r.length===0)return;let a=q(n,e),[i,...d]=a,f=j(i.text,r);if(f)return{field:"label",reading:i.reading,fragment:Q(i.text,r),strength:f};let l=p=>A=>_(A.text).tokens.some(O=>O.startsWith(p));if(!r.every(p=>a.some(l(p))))return;let y=D(i.text),u=r.find(p=>!y.some(A=>A.startsWith(p)))??r[0],g=d.find(l(u));return{field:g.field,reading:g.reading,fragment:Q(g.text,[u]),strength:"field"}}var gn=512,yn=64;function hn(n){let e=new Map;if(n.length===0)return e;let t=n.slice(-gn),r=n[n.length-1].seq;for(let a of t){let i=Math.pow(.5,(r-a.seq)/yn);for(let d of a.writes)e.set(d,(e.get(d)??0)+i)}return e}var ue=(n,e)=>we({tryDefinition:()=>n},e),fe=(n,e)=>De({tryDefinition:()=>n},e);function pn(n,e,t){let r=n.tryDefinition(e),a=[{field:"plural",text:ue(r,e)},{field:"kind",text:v(e)},...r?.noun?[{field:"noun",text:r.noun}]:[]],i;for(let d of a){let f=j(d.text,t);f&&(!i||T[f]<T[i.strength])&&(i={strength:f,...d})}return i}var mn,bn=(n,e)=>(mn??=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0})).compare(n,e),qe=(n,e)=>(n.nearly??0)-(e.nearly??0)||(n.archived??0)-(e.archived??0)||n.tier-e.tier||n.inKind-e.inKind||n.near-e.near||n.past-e.past||n.touched-e.touched||n.flagged-e.flagged||bn(n.name,e.name)||(n.id<e.id?-1:n.id>e.id?1:0);function Kn(n,e,t={}){let r=n.schema,a=an(e),i=D(a.words),d=t.principal??{kind:"human"},f=n.kindsKeptFrom(d),l=n.modules.disabledKinds,y=a.conditions.filter(o=>o.key==="kind").map(o=>o.value),u=a.conditions.filter(o=>o.key==="is").map(o=>o.value),g=u.includes("any")||u.includes("past"),p=u.includes("past")&&!u.includes("any")&&!u.includes("current"),A=u.includes("archived")?!0:t.archived??"all",O=(o,s)=>{let c=ce(s),h=r.tryDefinition(o);return ce(o)===c||ce(ue(h,o))===c},w=r.kinds.filter(o=>!f.has(o)&&!l.has(o)&&(t.kinds===void 0||t.kinds.includes(o))&&(y.length===0||y.some(s=>O(o,s)))),W=a.conditions.filter(o=>o.key!=="kind").map(o=>({...o,admittedBy:w.filter(s=>Be(r,s).filters.some(c=>c.key===o.key))})),U=W.filter(o=>o.key!=="is"),C=u.filter(o=>o==="flagged"||o==="clear"||o==="past"||o==="archived"),V={kinds:w,past:g},Qe={hits:[],words:a.words,conditions:W,searched:V,byKind:{},total:0,matched:[]};if(i.length===0&&U.length===0&&C.length===0)return Qe;let X=t.today,$=t.flagged??new Set(n.violations().flatMap(o=>o.nodeIds)),Ue=t.touched??hn(n.log.all()),Y=new Set;for(let o of t.from??[]){Y.add(o);for(let s of n.graph.neighbors(o))Y.add(s.id)}let ge=ve(n,d)?Oe(n,d):void 0,J=oe.keptFrom?.(n,d)&&n.seenBy(d).graph,Z=o=>je(o,t.basePath===void 0?{}:{basePath:t.basePath}),ye={schema:r,graph:n.graph,flagged:$,...X?{today:X}:{}},S=[],I={},P=[],F=[],B=(o,s,c,h,m,b)=>{let x=K(c,o);I[s]=(I[s]??0)+1,S.push({hit:{about:"node",id:o.id,kind:s,label:x,why:m,current:h,flagged:$.has(o.id),address:Z(`${fe(c,s)}/${encodeURIComponent(o.id)}`),...b===void 0?{}:{near:!0},...H(o)?{archived:!0}:{}},...b===void 0?{}:{nearly:2-b},tier:T[m.strength],inKind:s===t.inKind?0:1,near:Y.has(o.id)?0:1,past:h?0:1,archived:H(o)?1:0,touched:-(Ue.get(o.id)??0),flagged:$.has(o.id)?0:1,name:x,id:o.id})};for(let o of w){let s=r.tryDefinition(o),c=W.filter(m=>m.key!=="is"&&m.admittedBy.includes(o));if(i.length===0&&c.length===0&&C.length===0)continue;let h=Fe(s,c);for(let m of n.graph.nodesOfKind(o,{archived:A})){if(ge&&!ge(m.id))continue;let b=J?J.getNode(m.id):m;if(!b)continue;let x=E(s,b,X);if(!g&&!h&&!x){if(i.length>0&&u.length===0&&c.every(k=>le(ye,b,k))){let k=_e(s,b,a.words);k&&F.push({node:b,kind:o,definition:s,why:k})}continue}if(p&&x||!c.every(k=>le(ye,b,k))||u.includes("flagged")&&!$.has(b.id)||u.includes("clear")&&$.has(b.id))continue;let M=i.length>0?_e(s,b,a.words):c[0]?{field:c[0].key,reading:v(c[0].key),fragment:`${c[0].key}:${c[0].value}`,strength:"field"}:{field:"is",reading:"Is",fragment:`is:${C[0]}`,strength:"field"};M?B(b,o,s,x,M):i.length>0&&P.push({node:b,kind:o,definition:s,current:x})}}let ee=o=>o.strength!=="field",ne=!1;if(F.length>0&&S.length===0){ne=!0;for(let o of F)B(o.node,o.kind,o.definition,!1,o.why)}else if(F.some(o=>ee(o.why))&&!S.some(o=>ee(o.hit.why))){ne=!0;for(let o of F)ee(o.why)&&B(o.node,o.kind,o.definition,!1,o.why)}let he=t.near!==!1&&i.length>0&&S.length<nn&&P.length>0,te=new Set;if(he)for(let o of P){let s=cn(q(o.definition,o.node),i);s&&(te.add(o.node.id),B(o.node,o.kind,o.definition,o.current,s,s.by==="stem"?.9:.8))}let Ve=o=>o==="exact"||o==="prefix"?-1:T[o],re=(o,s,c,h)=>({hit:o,tier:Ve(s),inKind:1,near:1,past:0,touched:0,flagged:1,name:c,id:h});if(i.length>0){for(let s of w){let c=pn(r,s,i);if(!c)continue;let h=Ne(r,s),m={field:c.field,reading:c.field==="plural"?"Plural":"Kind",fragment:c.text,strength:c.strength};S.push(re({about:"kind",kind:s,label:h,why:m,count:I[s]??0,address:Z(fe(r.tryDefinition(s),s))},c.strength,h,`kind:${s}`))}let o=t.places??[];for(let s of Re(o.filter(c=>w.includes(c.kind)))){if(s.across&&f.has(s.across))continue;let c=j(s.title,i);if(!c)continue;let h={field:"title",reading:"Title",fragment:s.title,strength:c},m=Me(s,o)?fe(r.tryDefinition(s.kind),s.kind).slice(1):void 0,b=Z(We(s.as,m));S.push(re({about:"place",kind:s.kind,title:s.title,as:s.as,why:h,address:b},c,s.title,`place:${s.kind}:${s.as}`))}for(let s of n.allInvariants()){let c=s.scope==="graph"?void 0:s.scope.kind;if(c&&!w.includes(c))continue;let h=s.label??v(s.name),m=j(h,i),b=m?void 0:j(v(s.name),i),x=m??b;if(!x)continue;let M={field:m?"label":"name",reading:m?"Rule":"Name",fragment:m?h:s.name,strength:x};S.push(re({about:"rule",name:s.name,label:h,...c?{kind:c}:{},why:M},x,h,`rule:${s.name}`))}}let pe=()=>{S.sort(qe);let o=t.limit??50,s=S.slice(0,o).map(k=>k.hit),c=s.flatMap(k=>k.about==="node"?[(J||n.graph).getNode(k.id)]:[]).filter(Boolean),h=Ce(c,k=>r.tryDefinition(k)),m=s.map(k=>k.about==="node"&&h.has(k.id)?{...k,apart:h.get(k.id)}:k),b=Object.values(I).reduce((k,Ye)=>k+Ye,0),x=S.flatMap(k=>k.hit.about==="node"?[k.hit.id]:[]),M=t.subject&&w.includes(String(n.graph.getNode(t.subject)?.kind))?kn(n,t.subject,a.words,{principal:d}):[];return{hits:[...m,...M],words:a.words,conditions:W,searched:ne?{...V,past:!0}:V,byKind:{...I},total:b,matched:x}},L=pe(),me=t.rank;if(!he||!me)return L;let be=P.filter(o=>!te.has(o.node.id)).map(({node:o,kind:s,definition:c})=>({id:o.id,kind:s,label:K(c,o),texts:q(c,o)}));if(be.length===0)return L;let Xe=(async()=>{let o;try{o=await me(a.words,be)}catch{return L}let s=new Map(P.filter(h=>!te.has(h.node.id)).map(h=>[h.node.id,h])),c=!1;for(let{id:h,score:m,matched:b}of Array.isArray(o)?o:[]){let x=s.get(h);!x||!(m>0)||(s.delete(h),c=!0,B(x.node,x.kind,x.definition,x.current,un(q(x.definition,x.node),a.words,typeof b=="string"?b:void 0),Math.min(1,m)))}return c?pe():L})();return{...L,later:Xe}}function kn(n,e,t,r={}){let a=r.principal??{kind:"human"},i=(oe.keptFrom?.(n,a)?n.seenBy(a):n).graph.getNode(e);if(!i)return[];if(n.kindsKeptFrom(a).has(i.kind))return[];let d=D(t),f=K(n.schema.tryDefinition(i.kind),i),l=[];for(let u of n.allMutations()){let g=u.subject;if(!g||g.kinds!=="*"&&!g.kinds.includes(i.kind))continue;let p=u.derived?.act;if((p==="archive"||p==="merge")&&H(i)||p==="unarchive"&&!H(i)||p==="leave-alone"&&ie(i)||p==="allow-tidying"&&!ie(i)||!n.permits({name:u.name,args:{[g.arg]:i.id}},a).ok)continue;let A=Ae(u),O=D(A),w=d.filter(U=>O.some(C=>C.startsWith(U))),N=w.length>0?j(A,w):void 0,W=N?{field:"title",reading:"Act",fragment:A,strength:N}:{field:"subject",reading:"On",fragment:f,strength:"field"};l.push({hit:{about:"act",name:u.name,title:A,subject:i.id,why:W,destructive:u.destructive===!0},tier:N?T[N]:T.field+1,inKind:0,near:0,past:u.destructive?1:0,touched:0,flagged:u.pinned?0:1,name:A,id:`act:${u.name}`})}l.sort(qe);let y=l.map(u=>u.hit);return r.limit===void 0?y:y.slice(0,r.limit)}function Hn(n,e){let t=e.kinds.map((i,d)=>{let f=ue(n.tryDefinition(i),i);return d===0?f:f.toLowerCase()}),r=xe(t)||"Nothing";return e.kinds.some(i=>n.tryDefinition(i)?.lifecycle)?e.past?`${R(r)}, past ones included.`:`${R(r)}, current ones; add is:any for past ones.`:`${R(r)}.`}export{se as a,de as b,Je as c,Fe as d,Be as e,On as f,Rn as g,Le as h,Ie as i,Pe as j,en as k,le as l,ce as m,an as n,_e as o,hn as p,Kn as q,kn as r,Hn as s};
|
|
1
|
+
import{d as ae}from"./chunk.GZLYTPE7.js";import{b as Ce,d as $e}from"./chunk.4B73P2WA.js";import{e as Te}from"./chunk.IMRCAU4T.js";import{$ as we,Ac as Re,Cc as De,Ec as We,Fc as Me,H as ke,Jb as ie,La as Se,Na as H,T as R,U as xe,W as E,X as K,Xc as je,Y as Ae,Z as v,aa as Ne,ic as oe,mc as ve,nc as Oe}from"./chunk.F5BCCGFK.js";function se(n,e){return n.display?.labels?.[e]??v(e)}function de(n){let e=ae(n);switch(e.type){case"text":case"date":case"number":case"boolean":case"choice":return e.type;default:return}}function Je(n,e){let t=new Map,r=n.tryDefinition(e);for(let[a,i]of Object.entries(r?.edges??{}))t.set(a,{key:a,label:i.description?R(i.description):v(a),about:"edge",far:i.to==="*"?[...n.kinds]:[...i.to]});for(let a of n.definitions)if(a.kind!==e)for(let[i,d]of Object.entries(a.edges??{}))t.has(i)||d.to!=="*"&&!d.to.includes(e)||t.set(i,{key:i,label:d.inverse?R(d.inverse):v(i),about:"edge",far:[a.kind]});return[...t.values()]}var Ze=["current","past","any","flagged","clear"];function Fe(n,e){let t=n?.lifecycle;if(!t||t.retired==="date")return!1;let r=t.retired.map(String);return e.some(a=>a.key===t.field&&r.includes(a.value))}function Be(n,e){let t=n.tryDefinition(e);if(!t)return{kind:e,sorts:[],filters:[],groups:[]};let r=new Set(t.display?.hide??[]),a=t.fields.shape??{},i=[{key:"label",label:"Name",about:"label",type:"text"}],d=[],f=[];for(let[g,p]of Object.entries(a)){if(g==="id"||g==="kind"||g==="label"||r.has(g))continue;let A=de(p);if(!A)continue;let O=se(t,g),w=A==="choice"?Le(p):A==="boolean"?["true","false"]:void 0,N={key:g,label:O,about:"field",type:A,...w?{options:w}:{}};i.push(N),d.push(N),(A==="boolean"||A==="choice")&&f.push(N),A==="date"&&f.push({...N,buckets:["day","week","month","year","decade"]})}for(let g of Je(n,e))i.push(g),d.push(g),f.push(g);let l={key:"is",label:t.lifecycle?"Standing and currency":"Standing",about:"is",type:"choice",options:t.lifecycle?[...Ze]:["flagged","clear"]};d.push(l);let y=t.fieldRoles?.order,u=y&&(y in a||y==="label")?{by:y,direction:"asc"}:void 0;return{kind:e,sorts:i,filters:d,groups:f,...u?{natural:u}:{}}}function On(n,e){let t=[];for(let a of e.filters){let i=a.about==="edge"&&a.far?.length===1?n.tryDefinition(a.far[0]):void 0;if(!(!i||i.kind===e.kind))for(let[d,f]of Object.entries(i.fields.shape??{}))de(f)!=="choice"||i.display?.hide?.includes(d)||t.push({key:`${a.key}.${d}`,label:`${a.label} \xB7 ${se(i,d)}`,about:"via",type:"choice",options:Le(f),far:[i.kind]})}if(t.length===0)return e;let r=e.filters.filter(a=>a.about!=="is");return{...e,filters:[...r,...t,...e.filters.filter(a=>a.about==="is")]}}function Rn(n,e){let t=n.tryDefinition(e.kind),r=Object.entries(t?.computed??{});if(!t||r.length===0)return e;let a=r.filter(([i])=>!e.sorts.some(d=>d.key===i)).map(([i,d])=>({key:i,label:(typeof d=="object"?d.label:void 0)??se(t,i),about:"field",type:"number"}));return{...e,sorts:[...e.sorts,...a]}}function Le(n){let e=ae(n);return e.type==="choice"?e.options:[]}var Ie=n=>n,Pe=n=>n;function en(n,e,t){let r=new Map;for(let a of[...n.out(e,t),...n.in(e,t)])r.set(a.id,a);return[...r.values()]}function le(n,e,t){let r=n.schema.tryDefinition(e.kind);if(t.key==="is")switch(t.value){case"current":return E(r,Pe(e),n.today);case"past":return!E(r,Pe(e),n.today);case"any":return!0;case"flagged":return n.flagged?.has(e.id)??!1;case"clear":return!(n.flagged?.has(e.id)??!1);default:return!0}let a=r?.fields.shape??{};if(t.key in a){let l=Se(Ie(e),t.key,n.today??ke()),y=de(a[t.key]);if(y==="date"){let[u,g]=t.value.split(":");if(typeof l!="string"||!g)return!1;let p=l.slice(0,10);return u==="before"?p<g:u==="after"?p>g:p===g}if(y==="boolean")return String(l)===t.value;if(y==="number"){let u=t.value.lastIndexOf(":"),g=u>0?t.value.slice(0,u):"",p=Number(t.value.slice(u+1));if(g==="at-most"||g==="at-least")return typeof l!="number"||!Number.isFinite(p)?!1:g==="at-most"?l<=p:l>=p}return String(l)===t.value}let[i,d]=t.key.split("."),f=en(n.graph,e.id,i);return d?f.some(l=>String(Ie(l)[d])===t.value):t.value==="*"?f.length>0:t.value==="none"?f.length===0:f.some(l=>l.id===t.value)}var nn=5;function ze(n){return n.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function ce(n){return ze(n).replace(/ /g,"")}var z=new Map,tn=5e4;function _(n){let e=z.get(n);if(e===void 0){z.size>=tn&&z.clear();let t=ze(n);e={tokens:t.split(" ").filter(Boolean),whole:t.replace(/ /g,"")},z.set(n,e)}return e}var D=n=>[..._(n).tokens];function j(n,e){if(e.length===0)return;let{whole:t,tokens:r}=_(n),a=e.join("");if(t.length===0)return;if(t===a)return"exact";if(e.every(d=>r.some(f=>f.startsWith(d))))return t.startsWith(a)?"prefix":e.every(d=>r.includes(d))?"word":"part"}function Q(n,e,t=48){let r=n.replace(/\s+/g," ").trim();if(r.length<=t)return r;let a=e[0],i=r.normalize("NFD").replace(/\p{M}/gu,"").toLowerCase(),d=a?i.search(new RegExp(`(^|[^\\p{L}\\p{N}])${rn(a)}`,"u")):-1,f=d<0?0:d+(i[d]&&/[\p{L}\p{N}]/u.test(i[d])?0:1),l=Math.max(0,f-Math.floor(t/3));if(l>0){let u=r.lastIndexOf(" ",l);l=u<0?0:u+1}let y=Math.min(r.length,l+t);if(y<r.length){let u=r.indexOf(" ",y);y=u<0||u-y>16?y:u}return`${l>0?"\u2026":""}${r.slice(l,y).trim()}${y<r.length?"\u2026":""}`}var rn=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),on=/^([\p{L}][\p{L}\p{N}_-]*):(\S+)$/u;function an(n){let e=[],t=[];for(let r of n.trim().split(/\s+/).filter(Boolean)){let a=on.exec(r);a?t.push({key:a[1],value:a[2]}):e.push(r)}return{words:e.join(" "),conditions:t}}var Ee=new WeakMap;function q(n,e){let t=Ee.get(e);if(t&&t.definition===n)return t.texts;let r=sn(n,e);return Ee.set(e,{definition:n,texts:r}),r}function sn(n,e){let t=K(n,e),r=[{field:"label",reading:"Name",text:t}];for(let a of $e(e,n,{limit:Number.POSITIVE_INFINITY}))a.key==="label"||a.value===t||typeof e[a.key]!="boolean"&&r.push({field:a.key,reading:a.label,text:a.markdown?Te(a.value):a.value});return r}var T={exact:0,prefix:1,word:2,part:3,field:4,near:5},Ge=new Set(["a","an","the","of","and","or","for","to","in","on","at","by","with","my","our","is"]);function Ke(n){let e=n;e.length>4&&e.endsWith("ies")?e=`${e.slice(0,-3)}y`:e.length>4&&/(ss|x|ch|sh|z)es$/.test(e)?e=e.slice(0,-2):e.length>3&&e.endsWith("s")&&!/(ss|us|is)$/.test(e)&&(e=e.slice(0,-1));for(let t of["ing","ed"])if(e.length>t.length+2&&e.endsWith(t)){e=e.slice(0,-t.length),/([b-df-hj-km-np-rtv-z])\1$/.test(e)&&(e=e.slice(0,-1));break}return e.length>3&&e.endsWith("e")?e.slice(0,-1):e}function He(n,e,t){if(Math.abs(n.length-e.length)>t)return t+1;let r=[],a=Array.from({length:e.length+1},(i,d)=>d);for(let i=1;i<=n.length;i++){let d=[i],f=i;for(let l=1;l<=e.length;l++){let y=Math.min(a[l]+1,d[l-1]+1,a[l-1]+(n[i-1]===e[l-1]?0:1));i>1&&l>1&&n[i-1]===e[l-2]&&n[i-2]===e[l-1]&&(y=Math.min(y,r[l-2]+1)),d[l]=y,y<f&&(f=y)}if(f>t)return t+1;r=a,a=d}return a[e.length]}var G=new Map;function dn(n,e){let t=G.get(n);t||(G.size>=64&&G.clear(),G.set(n,t=new Map));let r=t.get(e);return r===void 0&&(r=ln(n,e)??null,t.set(e,r)),r??void 0}function ln(n,e){if(/\d/.test(n))return;let t=Ke(n);if(t.length>=3&&(Ke(e)===t||t.length>=4&&e.startsWith(t)))return"stem";let r=n.length<4?0:n.length<=7?1:2;if(r!==0){if(He(n,e,r)<=r)return"spelling";if(n.length>=5){for(let a=n.length-r;a<=n.length+r;a++)if(a<e.length&&He(n,e.slice(0,a),r)<=r)return"spelling"}}}function cn(n,e){let t=e.length>1?e.filter(a=>!Ge.has(a)):e;if(t.length===0)return;let r;for(let a of t){let i;for(let d of n){for(let f of _(d.text).tokens){if(f.startsWith(a)){i={text:d,matched:f};break}let l=i?void 0:dn(a,f);l&&(i={text:d,matched:f,by:l})}if(i&&!i.by)break}if(!i)return;i.by&&!r&&(r={text:i.text,asked:a,matched:i.matched,by:i.by})}if(r)return{field:r.text.field,reading:r.text.reading,fragment:Q(r.text.text,[r.matched]),strength:"near",asked:r.asked,matched:r.matched,by:r.by}}var fn=80;function un(n,e,t){let r=D(e).filter(d=>!Ge.has(d)).join(" ")||e,a=t===void 0?[]:D(t),i=a.length>0&&n.find(d=>a.every(f=>_(d.text).tokens.some(l=>l.startsWith(f))))||n[0];return{field:i.field,reading:i.reading,fragment:Q(i.text,a),strength:"near",asked:r,matched:(t??i.text).slice(0,fn),by:"meaning"}}function _e(n,e,t){let r=D(t);if(r.length===0)return;let a=q(n,e),[i,...d]=a,f=j(i.text,r);if(f)return{field:"label",reading:i.reading,fragment:Q(i.text,r),strength:f};let l=p=>A=>_(A.text).tokens.some(O=>O.startsWith(p));if(!r.every(p=>a.some(l(p))))return;let y=D(i.text),u=r.find(p=>!y.some(A=>A.startsWith(p)))??r[0],g=d.find(l(u));return{field:g.field,reading:g.reading,fragment:Q(g.text,[u]),strength:"field"}}var gn=512,yn=64;function hn(n){let e=new Map;if(n.length===0)return e;let t=n.slice(-gn),r=n[n.length-1].seq;for(let a of t){let i=Math.pow(.5,(r-a.seq)/yn);for(let d of a.writes)e.set(d,(e.get(d)??0)+i)}return e}var ue=(n,e)=>we({tryDefinition:()=>n},e),fe=(n,e)=>De({tryDefinition:()=>n},e);function pn(n,e,t){let r=n.tryDefinition(e),a=[{field:"plural",text:ue(r,e)},{field:"kind",text:v(e)},...r?.noun?[{field:"noun",text:r.noun}]:[]],i;for(let d of a){let f=j(d.text,t);f&&(!i||T[f]<T[i.strength])&&(i={strength:f,...d})}return i}var mn,bn=(n,e)=>(mn??=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0})).compare(n,e),qe=(n,e)=>(n.nearly??0)-(e.nearly??0)||(n.archived??0)-(e.archived??0)||n.tier-e.tier||n.inKind-e.inKind||n.near-e.near||n.past-e.past||n.touched-e.touched||n.flagged-e.flagged||bn(n.name,e.name)||(n.id<e.id?-1:n.id>e.id?1:0);function Kn(n,e,t={}){let r=n.schema,a=an(e),i=D(a.words),d=t.principal??{kind:"human"},f=n.kindsKeptFrom(d),l=n.modules.disabledKinds,y=a.conditions.filter(o=>o.key==="kind").map(o=>o.value),u=a.conditions.filter(o=>o.key==="is").map(o=>o.value),g=u.includes("any")||u.includes("past"),p=u.includes("past")&&!u.includes("any")&&!u.includes("current"),A=u.includes("archived")?!0:t.archived??"all",O=(o,s)=>{let c=ce(s),h=r.tryDefinition(o);return ce(o)===c||ce(ue(h,o))===c},w=r.kinds.filter(o=>!f.has(o)&&!l.has(o)&&(t.kinds===void 0||t.kinds.includes(o))&&(y.length===0||y.some(s=>O(o,s)))),W=a.conditions.filter(o=>o.key!=="kind").map(o=>({...o,admittedBy:w.filter(s=>Be(r,s).filters.some(c=>c.key===o.key))})),U=W.filter(o=>o.key!=="is"),C=u.filter(o=>o==="flagged"||o==="clear"||o==="past"||o==="archived"),V={kinds:w,past:g},Qe={hits:[],words:a.words,conditions:W,searched:V,byKind:{},total:0,matched:[]};if(i.length===0&&U.length===0&&C.length===0)return Qe;let X=t.today,$=t.flagged??new Set(n.violations().flatMap(o=>o.nodeIds)),Ue=t.touched??hn(n.log.all()),Y=new Set;for(let o of t.from??[]){Y.add(o);for(let s of n.graph.neighbors(o))Y.add(s.id)}let ge=ve(n,d)?Oe(n,d):void 0,J=oe.keptFrom?.(n,d)&&n.seenBy(d).graph,Z=o=>je(o,t.basePath===void 0?{}:{basePath:t.basePath}),ye={schema:r,graph:n.graph,flagged:$,...X?{today:X}:{}},S=[],I={},P=[],F=[],B=(o,s,c,h,m,b)=>{let x=K(c,o);I[s]=(I[s]??0)+1,S.push({hit:{about:"node",id:o.id,kind:s,label:x,why:m,current:h,flagged:$.has(o.id),address:Z(`${fe(c,s)}/${encodeURIComponent(o.id)}`),...b===void 0?{}:{near:!0},...H(o)?{archived:!0}:{}},...b===void 0?{}:{nearly:2-b},tier:T[m.strength],inKind:s===t.inKind?0:1,near:Y.has(o.id)?0:1,past:h?0:1,archived:H(o)?1:0,touched:-(Ue.get(o.id)??0),flagged:$.has(o.id)?0:1,name:x,id:o.id})};for(let o of w){let s=r.tryDefinition(o),c=W.filter(m=>m.key!=="is"&&m.admittedBy.includes(o));if(i.length===0&&c.length===0&&C.length===0)continue;let h=Fe(s,c);for(let m of n.graph.nodesOfKind(o,{archived:A})){if(ge&&!ge(m.id))continue;let b=J?J.getNode(m.id):m;if(!b)continue;let x=E(s,b,X);if(!g&&!h&&!x){if(i.length>0&&u.length===0&&c.every(k=>le(ye,b,k))){let k=_e(s,b,a.words);k&&F.push({node:b,kind:o,definition:s,why:k})}continue}if(p&&x||!c.every(k=>le(ye,b,k))||u.includes("flagged")&&!$.has(b.id)||u.includes("clear")&&$.has(b.id))continue;let M=i.length>0?_e(s,b,a.words):c[0]?{field:c[0].key,reading:v(c[0].key),fragment:`${c[0].key}:${c[0].value}`,strength:"field"}:{field:"is",reading:"Is",fragment:`is:${C[0]}`,strength:"field"};M?B(b,o,s,x,M):i.length>0&&P.push({node:b,kind:o,definition:s,current:x})}}let ee=o=>o.strength!=="field",ne=!1;if(F.length>0&&S.length===0){ne=!0;for(let o of F)B(o.node,o.kind,o.definition,!1,o.why)}else if(F.some(o=>ee(o.why))&&!S.some(o=>ee(o.hit.why))){ne=!0;for(let o of F)ee(o.why)&&B(o.node,o.kind,o.definition,!1,o.why)}let he=t.near!==!1&&i.length>0&&S.length<nn&&P.length>0,te=new Set;if(he)for(let o of P){let s=cn(q(o.definition,o.node),i);s&&(te.add(o.node.id),B(o.node,o.kind,o.definition,o.current,s,s.by==="stem"?.9:.8))}let Ve=o=>o==="exact"||o==="prefix"?-1:T[o],re=(o,s,c,h)=>({hit:o,tier:Ve(s),inKind:1,near:1,past:0,touched:0,flagged:1,name:c,id:h});if(i.length>0){for(let s of w){let c=pn(r,s,i);if(!c)continue;let h=Ne(r,s),m={field:c.field,reading:c.field==="plural"?"Plural":"Kind",fragment:c.text,strength:c.strength};S.push(re({about:"kind",kind:s,label:h,why:m,count:I[s]??0,address:Z(fe(r.tryDefinition(s),s))},c.strength,h,`kind:${s}`))}let o=t.places??[];for(let s of Re(o.filter(c=>w.includes(c.kind)))){if(s.across&&f.has(s.across))continue;let c=j(s.title,i);if(!c)continue;let h={field:"title",reading:"Title",fragment:s.title,strength:c},m=Me(s,o)?fe(r.tryDefinition(s.kind),s.kind).slice(1):void 0,b=Z(We(s.as,m));S.push(re({about:"place",kind:s.kind,title:s.title,as:s.as,why:h,address:b},c,s.title,`place:${s.kind}:${s.as}`))}for(let s of n.allInvariants()){let c=s.scope==="graph"?void 0:s.scope.kind;if(c&&!w.includes(c))continue;let h=s.label??v(s.name),m=j(h,i),b=m?void 0:j(v(s.name),i),x=m??b;if(!x)continue;let M={field:m?"label":"name",reading:m?"Rule":"Name",fragment:m?h:s.name,strength:x};S.push(re({about:"rule",name:s.name,label:h,...c?{kind:c}:{},why:M},x,h,`rule:${s.name}`))}}let pe=()=>{S.sort(qe);let o=t.limit??50,s=S.slice(0,o).map(k=>k.hit),c=s.flatMap(k=>k.about==="node"?[(J||n.graph).getNode(k.id)]:[]).filter(Boolean),h=Ce(c,k=>r.tryDefinition(k)),m=s.map(k=>k.about==="node"&&h.has(k.id)?{...k,apart:h.get(k.id)}:k),b=Object.values(I).reduce((k,Ye)=>k+Ye,0),x=S.flatMap(k=>k.hit.about==="node"?[k.hit.id]:[]),M=t.subject&&w.includes(String(n.graph.getNode(t.subject)?.kind))?kn(n,t.subject,a.words,{principal:d}):[];return{hits:[...m,...M],words:a.words,conditions:W,searched:ne?{...V,past:!0}:V,byKind:{...I},total:b,matched:x}},L=pe(),me=t.rank;if(!he||!me)return L;let be=P.filter(o=>!te.has(o.node.id)).map(({node:o,kind:s,definition:c})=>({id:o.id,kind:s,label:K(c,o),texts:q(c,o)}));if(be.length===0)return L;let Xe=(async()=>{let o;try{o=await me(a.words,be)}catch{return L}let s=new Map(P.filter(h=>!te.has(h.node.id)).map(h=>[h.node.id,h])),c=!1;for(let{id:h,score:m,matched:b}of Array.isArray(o)?o:[]){let x=s.get(h);!x||!(m>0)||(s.delete(h),c=!0,B(x.node,x.kind,x.definition,x.current,un(q(x.definition,x.node),a.words,typeof b=="string"?b:void 0),Math.min(1,m)))}return c?pe():L})();return{...L,later:Xe}}function kn(n,e,t,r={}){let a=r.principal??{kind:"human"},i=(oe.keptFrom?.(n,a)?n.seenBy(a):n).graph.getNode(e);if(!i)return[];if(n.kindsKeptFrom(a).has(i.kind))return[];let d=D(t),f=K(n.schema.tryDefinition(i.kind),i),l=[];for(let u of n.allMutations()){let g=u.subject;if(!g||g.kinds!=="*"&&!g.kinds.includes(i.kind))continue;let p=u.derived?.act;if((p==="archive"||p==="merge")&&H(i)||p==="unarchive"&&!H(i)||p==="leave-alone"&&ie(i)||p==="allow-tidying"&&!ie(i)||!n.permits({name:u.name,args:{[g.arg]:i.id}},a).ok)continue;let A=Ae(u),O=D(A),w=d.filter(U=>O.some(C=>C.startsWith(U))),N=w.length>0?j(A,w):void 0,W=N?{field:"title",reading:"Act",fragment:A,strength:N}:{field:"subject",reading:"On",fragment:f,strength:"field"};l.push({hit:{about:"act",name:u.name,title:A,subject:i.id,why:W,destructive:u.destructive===!0},tier:N?T[N]:T.field+1,inKind:0,near:0,past:u.destructive?1:0,touched:0,flagged:u.pinned?0:1,name:A,id:`act:${u.name}`})}l.sort(qe);let y=l.map(u=>u.hit);return r.limit===void 0?y:y.slice(0,r.limit)}function Hn(n,e){let t=e.kinds.map((i,d)=>{let f=ue(n.tryDefinition(i),i);return d===0?f:f.toLowerCase()}),r=xe(t)||"Nothing";return e.kinds.some(i=>n.tryDefinition(i)?.lifecycle)?e.past?`${R(r)}, past ones included.`:`${R(r)}, current ones; add is:any for past ones.`:`${R(r)}.`}export{se as a,de as b,Je as c,Fe as d,Be as e,On as f,Rn as g,Le as h,Ie as i,Pe as j,en as k,le as l,ce as m,an as n,_e as o,hn as p,Kn as q,kn as r,Hn as s};
|
|
@@ -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{s as P}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{s as P}from"./chunk.PWOVXARZ.js";import{F as M,N as w,Q as y,Y as m,Z as I,a as p,t as b,x as T,xa as S,y as A}from"./chunk.6II4BONS.js";import{b as f}from"./chunk.AJZBJBMO.js";var x=f(M(),1),h=f(y(),1),C=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.NWYOLGQ3.js")))),O=C.part((e,n)=>(0,h.jsx)(e.Timeline,{...n}),{what:"The timeline"}),q=()=>C.prefetch();function H({face:e}){return w()?.open?(0,h.jsx)(x.Suspense,{fallback:null,children:(0,h.jsx)(O,{face:e})}):null}var i=f(M(),1),u=f(y(),1),v=new WeakMap,E=e=>{let n=v.get(e);return n||v.set(e,n={ask:null,doors:[],listeners:new Set}),n},k=e=>{for(let n of e.listeners)n()};function g(e,n){let t=E(e);t.ask=n,k(t)}var N=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.NJ62C2GU.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.LMVCWYYG.js")))),B=N.part((e,n)=>{let t=e.NotifySheet;return(0,u.jsx)(t,{...n})},{what:"Notify me"}),W=N.part((e,n)=>{let t=e.NotifiedList;return(0,u.jsx)(t,{...n})},{quiet:!0}),D=(e,n)=>n===void 0&&(e.onBehalfOf??e).id!==void 0;function L(e,n,t){let c=d=>t.tryDefinition(d)?.noun??d.replace(/[-_]+/g," "),o=e.on!==void 0?e.on:e.about.length===1?e.about[0]:void 0;if(e.act!==void 0){let d=o!==void 0&&n(o)!==void 0?o:void 0;return{label:"Notify me when someone does this\u2026",choices:[{on:"act",act:e.act,...d!==void 0?{record:d}:{}},...d!==void 0?[{on:"act",act:e.act}]:[]]}}if(o===void 0)return null;let s=n(o);if(s!==void 0)return{label:"Notify me when this changes\u2026",choices:[{on:"changed",record:o},{on:"act",record:o},{on:"reaches",kind:s,condition:"",record:o}]};let r=b(o)!==null?[b(o)]:T(o)?A(o):[];if(r.length!==1||!t.kinds.includes(r[0]))return null;let l=r[0],a=c(l);return{label:`Notify me when ${/^[aeiou]/i.test(a)?"an":"a"} ${a} is added\u2026`,choices:[{on:"created",kind:l},{on:"changed",kind:l},{on:"reaches",kind:l,condition:""}]}}function F(){let{store:e,principal:n,subscriptions:t,signIn:c}=m(),o=D(n,c);return(0,i.useMemo)(()=>o?s=>{let r=L(s,a=>e.graph.getNode(a)?.kind,e.schema);return r?{id:"notify",items:[{id:"notify-me",label:r.label,run:()=>g(t,{choices:r.choices,returnTo:s.element??null})}],prepare:()=>N.prefetch()}:null}:null,[o,e,t])}var z=[];function U({children:e}){let n=F(),t=(0,i.useMemo)(()=>n?[n]:z,[n]);return(0,u.jsx)(P,{sections:t,children:e})}function V(){let{subscriptions:e}=m(),n=(0,i.useId)(),t=E(e);(0,i.useEffect)(()=>(t.doors.push(n),k(t),()=>{t.doors.splice(t.doors.indexOf(n),1),k(t)}),[t,n]);let c=(0,i.useMemo)(()=>r=>(t.listeners.add(r),()=>void t.listeners.delete(r)),[t]),o=(0,i.useSyncExternalStore)(c,()=>t.ask,()=>null),s=(0,i.useSyncExternalStore)(c,()=>t.doors[0]===n,()=>!1);return!o||!s?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(B,{ask:o,close:()=>g(e,null)})})}function X({choices:e,label:n="Notify me",style:t,className:c,testId:o="notify-me"}){let{principal:s,subscriptions:r,signIn:l}=m();return D(s,l)?(0,u.jsx)("button",{type:"button","data-testid":o,className:c,onClick:a=>g(r,{choices:e,returnTo:a.currentTarget}),style:t,children:n}):null}function G(){let e=I(),n=e?.subscriptions,t=e?(e.principal.onBehalfOf??e.principal).id:void 0,[c,o]=(0,i.useState)(0);return(0,i.useEffect)(()=>{if(t===void 0||!n)return;let s=!0,r=()=>void Promise.resolve(n.list(t)).then(a=>s&&o(a.length),()=>s&&o(0));r();let l=n.onChange?.(r);return()=>{s=!1,l?.()}},[n,t]),c}function Y({style:e}){return G()===0?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(W,{...e?{style:e}:{}})})}export{q as a,H as b,F as c,U as d,V as e,X as f,G as g,Y as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as O}from"./chunk.
|
|
1
|
+
import{B as O}from"./chunk.F5BCCGFK.js";var k=3,A=k+1,P=A+1,z=(o,r)=>o<r?-1:o>r?1:0;function L(o){return(o??0)>4?k:2}function N(o,r,a){let n=[];for(let d of Object.values(o.tryDefinition(r)?.edges??{}))if(d.to!=="*")for(let i of d.to)i!==r&&a.includes(i)&&!n.includes(i)&&n.push(i);return n}function W(o,r={}){let a=[...o.kinds],n=[...(r.order??[]).filter(e=>a.includes(e)),...a.filter(e=>!(r.order??[]).includes(e)).sort(z)].filter((e,t,s)=>s.indexOf(e)===t),d=e=>n.indexOf(e),i=new Map,g=[],h=(e,t,s)=>{i.set(e,{col:t,row:s,side:L(r.counts?.[e])}),g.push({col:t,row:s})};for(let e of n){let t=o.tryDefinition(e)?.plot??r.plots?.[e];t&&h(e,t.col,t.row)}let l=new Map(n.map(e=>[e,N(o,e,a)])),b=new Set(n.filter(e=>l.get(e).length>0||n.some(t=>l.get(t).includes(e)))),v=new Map,C=new Set,D=e=>{let t=v.get(e);if(t!==void 0)return t;if(C.has(e))return-1;C.add(e);let s=0;for(let c of l.get(e))s=Math.max(s,D(c)+1);return C.delete(e),v.set(e,s),s};for(let e of n)b.has(e)&&D(e);let f=[];for(let e of n)b.has(e)&&(f[v.get(e)]??=[]).push(e);let I=new Map,T=Math.max(1,Math.ceil(Math.sqrt(f.length))),H=Math.max(1,...f.map(e=>e?.length??0)),w=Math.max(P,Math.round(r.pitch??P)),R=(e,t)=>r.upright?{col:e%T*w,row:(Math.floor(e/T)*(H+1)+t)*w}:{col:t*w,row:e===0?0:-e*w},$=e=>!g.some(t=>V(t,e)),S=(e,t,s)=>{let c=s;for(;!$(R(t,c))&&c<s+64;)c++;return i.has(e)||h(e,R(t,c).col,R(t,c).row),c},x=0;f.forEach((e=[],t)=>{let s=u=>{let m=l.get(u).map(p=>I.get(p)).filter(p=>p!==void 0);return m.length>0?m.reduce((p,q)=>p+q,0)/m.length:1/0},c=[...e].sort((u,m)=>s(u)-s(m)||d(u)-d(m)),y=0;for(let u of c)i.has(u)||(y=S(u,t,y),I.set(u,y),x=Math.max(x,y+1),y++)});let j=n.filter(e=>!b.has(e)&&!i.has(e)),M=Math.max(r.upright?x:f.length,Math.ceil(Math.sqrt(j.length*2)),1),E=b.size>0?1:0;return j.forEach((e,t)=>{r.upright?S(e,f.length+E+Math.floor(t/M),t%M):S(e,t%M,x+E+Math.floor(t/M))}),i}function V(o,r){return Math.abs(o.col-r.col)<A&&Math.abs(o.row-r.row)<A}function X(o,r,a,n=.5){return{x:(o-r)*a/2,y:(o+r)*a*n/2}}var G=1,B=/^(done|completed?|closed|finished|shipped|sent|won|lost|passed|declined|dropped|answered|resolved|fixed|archived|cancell?ed|retired|released|published|delivered|paid|merged|rejected|written[-_ ]?up|out)$/i,F=/^(doing|in[-_ ]?progress|active|building|started|working|in[-_ ]?review|review(ing)?|fixing|ongoing|underway|testing|drafting|writing|running)$/i;function _(o,r,a){let n=O(o.tryDefinition(r)?.fields.shape?.[a]);for(;n&&n.innerType!==void 0&&n.type!=="enum";)n=O(n.innerType);if(n?.type!=="enum")return;let d=(n.entries?Object.values(n.entries):n.values??[]).filter(i=>typeof i=="string");return d.length>0?d:void 0}function J(o,r){let a=o.tryDefinition(r);if(!a)return;let n=a.lifecycle,d=Object.keys(a.fields.shape??{}),i=[n?.field,...d.filter(l=>/^(status|stage|state|phase)$/i.test(l))].find(l=>l!==void 0&&_(o,r,l)!==void 0);if(!i)return;let g=_(o,r,i),h=n?.field===i&&Array.isArray(n.retired)?n.retired:[];return{field:i,values:g,tiers:g.map(l=>h.includes(l)||B.test(l)?"done":F.test(l)?"active":"waiting")}}export{P as a,W as b,X as c,G as d,J as e};
|
package/dist/preview/index.html
CHANGED
|
@@ -5,56 +5,56 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>Graview preview</title>
|
|
7
7
|
<link rel="preload" href="/graview/document" as="fetch" crossorigin="anonymous">
|
|
8
|
-
<link rel="modulepreload" href="/chunk.
|
|
9
|
-
<link rel="modulepreload" href="/chunk.
|
|
8
|
+
<link rel="modulepreload" href="/chunk.JZMA2AV7.js">
|
|
9
|
+
<link rel="modulepreload" href="/chunk.JLXQ6ZLI.js">
|
|
10
10
|
<link rel="modulepreload" href="/chunk.Q5WEOX3Q.js">
|
|
11
|
-
<link rel="modulepreload" href="/chunk.
|
|
12
|
-
<link rel="modulepreload" href="/chunk.
|
|
13
|
-
<link rel="modulepreload" href="/chunk.
|
|
14
|
-
<link rel="modulepreload" href="/chunk.
|
|
15
|
-
<link rel="modulepreload" href="/chunk.
|
|
11
|
+
<link rel="modulepreload" href="/chunk.LNNFNJKN.js">
|
|
12
|
+
<link rel="modulepreload" href="/chunk.AAZFVCSP.js">
|
|
13
|
+
<link rel="modulepreload" href="/chunk.BZ5VLPKB.js">
|
|
14
|
+
<link rel="modulepreload" href="/chunk.6II4BONS.js">
|
|
15
|
+
<link rel="modulepreload" href="/chunk.F5BCCGFK.js">
|
|
16
16
|
<link rel="modulepreload" href="/chunk.AJZBJBMO.js">
|
|
17
|
-
<link rel="modulepreload" href="/chunk.
|
|
18
|
-
<link rel="modulepreload" href="/chunk.
|
|
19
|
-
<link rel="modulepreload" href="/chunk.
|
|
20
|
-
<link rel="modulepreload" href="/chunk.
|
|
17
|
+
<link rel="modulepreload" href="/chunk.53IKY7UP.js">
|
|
18
|
+
<link rel="modulepreload" href="/chunk.QEALNWWL.js">
|
|
19
|
+
<link rel="modulepreload" href="/chunk.FERBNBDE.js">
|
|
20
|
+
<link rel="modulepreload" href="/chunk.YNE5QR7Q.js">
|
|
21
21
|
<link rel="modulepreload" href="/chunk.UGFDSE37.js">
|
|
22
|
-
<link rel="modulepreload" href="/chunk.
|
|
23
|
-
<link rel="modulepreload" href="/chunk.
|
|
24
|
-
<link rel="modulepreload" href="/chunk.
|
|
25
|
-
<link rel="modulepreload" href="/chunk.
|
|
26
|
-
<link rel="modulepreload" href="/chunk.
|
|
27
|
-
<link rel="modulepreload" href="/chunk.
|
|
28
|
-
<link rel="modulepreload" href="/chunk.
|
|
29
|
-
<link rel="modulepreload" href="/chunk.
|
|
30
|
-
<link rel="modulepreload" href="/chunk.
|
|
31
|
-
<link rel="modulepreload" href="/chunk.
|
|
32
|
-
<link rel="modulepreload" href="/chunk.
|
|
33
|
-
<link rel="modulepreload" href="/chunk.
|
|
34
|
-
<link rel="modulepreload" href="/chunk.
|
|
35
|
-
<link rel="modulepreload" href="/chunk.
|
|
36
|
-
<link rel="modulepreload" href="/chunk.
|
|
37
|
-
<link rel="modulepreload" href="/chunk.
|
|
38
|
-
<link rel="modulepreload" href="/chunk.
|
|
39
|
-
<link rel="modulepreload" href="/chunk.
|
|
40
|
-
<link rel="modulepreload" href="/chunk.
|
|
22
|
+
<link rel="modulepreload" href="/chunk.GOCUBIRW.js">
|
|
23
|
+
<link rel="modulepreload" href="/chunk.6QDFBCV4.js">
|
|
24
|
+
<link rel="modulepreload" href="/chunk.4STIUIT6.js">
|
|
25
|
+
<link rel="modulepreload" href="/chunk.WHTQHU3M.js">
|
|
26
|
+
<link rel="modulepreload" href="/chunk.KU6NIMQX.js">
|
|
27
|
+
<link rel="modulepreload" href="/chunk.Y3IJDWNS.js">
|
|
28
|
+
<link rel="modulepreload" href="/chunk.OFJH7LDC.js">
|
|
29
|
+
<link rel="modulepreload" href="/chunk.5PU3RWYY.js">
|
|
30
|
+
<link rel="modulepreload" href="/chunk.27TLAVRR.js">
|
|
31
|
+
<link rel="modulepreload" href="/chunk.OREMUXB5.js">
|
|
32
|
+
<link rel="modulepreload" href="/chunk.ZDNJK2SX.js">
|
|
33
|
+
<link rel="modulepreload" href="/chunk.ZSSOTIFL.js">
|
|
34
|
+
<link rel="modulepreload" href="/chunk.7YQYWOZR.js">
|
|
35
|
+
<link rel="modulepreload" href="/chunk.3PT55HXT.js">
|
|
36
|
+
<link rel="modulepreload" href="/chunk.QDHUDLJB.js">
|
|
37
|
+
<link rel="modulepreload" href="/chunk.ZVMIHXVK.js">
|
|
38
|
+
<link rel="modulepreload" href="/chunk.CUCNT7MG.js">
|
|
39
|
+
<link rel="modulepreload" href="/chunk.2A2DLMT3.js">
|
|
40
|
+
<link rel="modulepreload" href="/chunk.E77K6KBX.js">
|
|
41
41
|
<link rel="modulepreload" href="/chunk.UT6642FC.js">
|
|
42
42
|
<link rel="modulepreload" href="/chunk.MB7LKKUD.js">
|
|
43
43
|
<link rel="modulepreload" href="/chunk.WVUJXDXZ.js">
|
|
44
|
-
<link rel="modulepreload" href="/chunk.
|
|
45
|
-
<link rel="modulepreload" href="/chunk.
|
|
46
|
-
<link rel="modulepreload" href="/chunk.
|
|
47
|
-
<link rel="modulepreload" href="/chunk.
|
|
48
|
-
<link rel="modulepreload" href="/chunk.
|
|
44
|
+
<link rel="modulepreload" href="/chunk.VHWUGSFW.js">
|
|
45
|
+
<link rel="modulepreload" href="/chunk.P75TPZWT.js">
|
|
46
|
+
<link rel="modulepreload" href="/chunk.6W7J76TK.js">
|
|
47
|
+
<link rel="modulepreload" href="/chunk.FUR4IHWG.js">
|
|
48
|
+
<link rel="modulepreload" href="/chunk.2B4WVCVV.js">
|
|
49
49
|
<link rel="modulepreload" href="/chunk.GZHZLJBF.js">
|
|
50
|
-
<link rel="modulepreload" href="/chunk.
|
|
51
|
-
<link rel="modulepreload" href="/chunk.
|
|
50
|
+
<link rel="modulepreload" href="/chunk.PWOVXARZ.js">
|
|
51
|
+
<link rel="modulepreload" href="/chunk.SG23JC6D.js">
|
|
52
52
|
<link rel="modulepreload" href="/chunk.OJGHDWI6.js">
|
|
53
|
-
<link rel="modulepreload" href="/chunk.
|
|
54
|
-
<link rel="modulepreload" href="/chunk.
|
|
55
|
-
<link rel="modulepreload" href="/chunk.
|
|
56
|
-
<link rel="modulepreload" href="/chunk.
|
|
57
|
-
<link rel="modulepreload" href="/chunk.
|
|
53
|
+
<link rel="modulepreload" href="/chunk.GZLYTPE7.js">
|
|
54
|
+
<link rel="modulepreload" href="/chunk.4B73P2WA.js">
|
|
55
|
+
<link rel="modulepreload" href="/chunk.IMRCAU4T.js">
|
|
56
|
+
<link rel="modulepreload" href="/chunk.CNJENUPC.js">
|
|
57
|
+
<link rel="modulepreload" href="/chunk.MXJS67W4.js">
|
|
58
58
|
<style>html,body{margin:0;height:100%}#graview-app{min-height:100dvh}</style>
|
|
59
59
|
</head>
|
|
60
60
|
<body>
|