graview 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/{chunk.3C4RJIJU.js → chunk.272ZJXQP.js} +1 -1
- package/dist/preview/{chunk.ETWVQ3A2.js → chunk.27TLAVRR.js} +1 -1
- package/dist/preview/{chunk.34CYK2DF.js → chunk.2A2DLMT3.js} +1 -1
- package/dist/preview/{chunk.FBY5IUGU.js → chunk.2B4WVCVV.js} +1 -1
- package/dist/preview/{chunk.ZE4CTZQ3.js → chunk.3PT55HXT.js} +1 -1
- package/dist/preview/{chunk.YJCT3DV2.js → chunk.3SM2CHKF.js} +1 -1
- package/dist/preview/{chunk.G64AREGA.js → chunk.3ZIOAPI5.js} +1 -1
- package/dist/preview/{chunk.HCDKSDIS.js → chunk.42WJ6VJZ.js} +1 -1
- package/dist/preview/{chunk.RIW7SQH4.js → chunk.4B73P2WA.js} +1 -1
- package/dist/preview/{chunk.CPW465TM.js → chunk.4GXXD4NG.js} +1 -1
- package/dist/preview/chunk.4Q56V7GS.js +1 -0
- package/dist/preview/{chunk.T2L4NPSB.js → chunk.4STIUIT6.js} +1 -1
- package/dist/preview/chunk.53IKY7UP.js +1 -0
- package/dist/preview/chunk.56BPXB6E.js +1 -0
- package/dist/preview/{chunk.7HPPJVIV.js → chunk.5PU3RWYY.js} +2 -2
- package/dist/preview/chunk.64MJ5FRL.js +1 -0
- package/dist/preview/chunk.6II4BONS.js +25 -0
- package/dist/preview/{chunk.VMGWYCXU.js → chunk.6KMXLUOS.js} +1 -1
- package/dist/preview/{chunk.MWJUZG3C.js → chunk.6QDFBCV4.js} +2 -2
- package/dist/preview/{chunk.IHFNLKXV.js → chunk.6W7J76TK.js} +1 -1
- package/dist/preview/{chunk.ZTFW7RKP.js → chunk.6ZZZBDEG.js} +1 -1
- package/dist/preview/{chunk.VOFUIWAX.js → chunk.7CO7S6QM.js} +1 -1
- package/dist/preview/chunk.7G3B5QPH.js +1 -0
- package/dist/preview/chunk.7TBSVQSH.js +1 -0
- package/dist/preview/{chunk.QVKKXMNK.js → chunk.7YQYWOZR.js} +1 -1
- package/dist/preview/{chunk.4K5QCJFH.js → chunk.AAZFVCSP.js} +1 -1
- package/dist/preview/{chunk.ZSW74NVJ.js → chunk.ACEYGWMO.js} +1 -1
- package/dist/preview/{chunk.HJ56Q6WB.js → chunk.ACXA55GW.js} +1 -1
- package/dist/preview/{chunk.PNVR3CXR.js → chunk.BZ5VLPKB.js} +2 -2
- package/dist/preview/chunk.CE3NOADH.js +1 -0
- package/dist/preview/chunk.CNJENUPC.js +1 -0
- package/dist/preview/{chunk.DMNXYMLC.js → chunk.CRPT3ZT3.js} +1 -1
- package/dist/preview/{chunk.XXMYKBLT.js → chunk.CUCNT7MG.js} +1 -1
- package/dist/preview/{chunk.U5ACEYAN.js → chunk.D6RDTUX3.js} +1 -1
- package/dist/preview/{chunk.UHQD3NTK.js → chunk.DANDYIB5.js} +1 -1
- package/dist/preview/{chunk.UCIQIPBQ.js → chunk.DSP62QYK.js} +1 -1
- package/dist/preview/chunk.E77K6KBX.js +1 -0
- package/dist/preview/{chunk.HPD5ZDZH.js → chunk.EBLKEQ7O.js} +1 -1
- package/dist/preview/{chunk.VSOB2QEK.js → chunk.EDSPYKR4.js} +1 -1
- package/dist/preview/chunk.EQIGKXIG.js +1 -0
- package/dist/preview/{chunk.HWITWOP3.js → chunk.ER5ILWKY.js} +2 -2
- package/dist/preview/{chunk.7VUPKOKC.js → chunk.ET76FISZ.js} +1 -1
- package/dist/preview/{chunk.X7W27IRI.js → chunk.F5BCCGFK.js} +5 -5
- package/dist/preview/{chunk.7X2ZO5BD.js → chunk.FERBNBDE.js} +1 -1
- package/dist/preview/{chunk.FUQVNXLB.js → chunk.FQKH67BP.js} +1 -1
- package/dist/preview/{chunk.577PGFUT.js → chunk.FUR4IHWG.js} +1 -1
- package/dist/preview/chunk.FWBQVPMI.js +1 -0
- package/dist/preview/{chunk.FRS3S7DN.js → chunk.GOCUBIRW.js} +1 -1
- package/dist/preview/{chunk.CNMITOKP.js → chunk.GUDKPK42.js} +1 -1
- package/dist/preview/{chunk.QVUL2FSI.js → chunk.GXLAZGYT.js} +1 -1
- package/dist/preview/{chunk.Z7ZCR4LN.js → chunk.GZLYTPE7.js} +1 -1
- package/dist/preview/{chunk.35KI7XYV.js → chunk.H4T56OXM.js} +1 -1
- package/dist/preview/{chunk.JQDYGI6G.js → chunk.HPX3F7XX.js} +1 -1
- package/dist/preview/{chunk.WYEYYCBH.js → chunk.HZPTBPJY.js} +1 -1
- package/dist/preview/{chunk.PW7YH6JV.js → chunk.IB32NOV5.js} +1 -1
- package/dist/preview/{chunk.FSAHO3LV.js → chunk.IMRCAU4T.js} +1 -1
- package/dist/preview/{chunk.6A62UVAE.js → chunk.ITXIFDQ7.js} +1 -1
- package/dist/preview/{chunk.2YCFK5HU.js → chunk.J3TEJBI5.js} +1 -1
- package/dist/preview/{chunk.7WHWD5YJ.js → chunk.JLXQ6ZLI.js} +1 -1
- package/dist/preview/{chunk.6FBQP336.js → chunk.JZMA2AV7.js} +1 -1
- package/dist/preview/{chunk.B6VI576I.js → chunk.K5NJTE3F.js} +1 -1
- package/dist/preview/{chunk.FCRFQ7ZW.js → chunk.KBJG5SI2.js} +1 -1
- package/dist/preview/{chunk.3H4NVUWV.js → chunk.KU6NIMQX.js} +1 -1
- package/dist/preview/{chunk.LAF6GTBN.js → chunk.LA7535VO.js} +1 -1
- package/dist/preview/{chunk.RN3EZVV4.js → chunk.LMVCWYYG.js} +1 -1
- package/dist/preview/{chunk.2YGQVI6T.js → chunk.LNNFNJKN.js} +1 -1
- package/dist/preview/{chunk.RH45AW2W.js → chunk.M4FQ7SSM.js} +1 -1
- package/dist/preview/{chunk.UA5UYINM.js → chunk.MXJS67W4.js} +1 -1
- package/dist/preview/{chunk.LIIC25G6.js → chunk.NJ62C2GU.js} +1 -1
- package/dist/preview/{chunk.VZHV25JE.js → chunk.NNCTJSD3.js} +1 -1
- package/dist/preview/{chunk.LCFDM7XY.js → chunk.NWYOLGQ3.js} +1 -1
- package/dist/preview/{chunk.DNDHDDM6.js → chunk.O3OALXCI.js} +2 -2
- package/dist/preview/{chunk.ZJX6ZKKM.js → chunk.O6ROFVFD.js} +1 -1
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.OF34OZ4V.js} +1 -1
- package/dist/preview/{chunk.RYEAMM73.js → chunk.OFJH7LDC.js} +1 -1
- package/dist/preview/{chunk.Q7TP4RFE.js → chunk.OH5BBE2B.js} +1 -1
- package/dist/preview/{chunk.CZRX2FDI.js → chunk.OREMUXB5.js} +1 -1
- package/dist/preview/{chunk.AHCI7ZDO.js → chunk.OXZRGP53.js} +1 -1
- package/dist/preview/chunk.OZR5NI4J.js +1 -0
- package/dist/preview/{chunk.PPUAPAWR.js → chunk.P75TPZWT.js} +1 -1
- package/dist/preview/{chunk.WLBXBNNH.js → chunk.PWOVXARZ.js} +1 -1
- package/dist/preview/chunk.Q63RPNUS.js +1 -0
- package/dist/preview/{chunk.XK4FVT2X.js → chunk.QDHUDLJB.js} +1 -1
- package/dist/preview/{chunk.HP3ZEDCD.js → chunk.QEALNWWL.js} +3 -3
- package/dist/preview/{chunk.APNN6BKF.js → chunk.QLMUGC7R.js} +1 -1
- package/dist/preview/{chunk.6VRJII5M.js → chunk.QTITRX5Q.js} +1 -1
- package/dist/preview/{chunk.GMOTRAKJ.js → chunk.R45BF6JV.js} +1 -1
- package/dist/preview/{chunk.F6WYSDSI.js → chunk.R7LRJS6B.js} +2 -2
- package/dist/preview/{chunk.3MWBWSYF.js → chunk.RKHEZ6KZ.js} +1 -1
- package/dist/preview/{chunk.XZYJRNRY.js → chunk.S6GJGTJE.js} +1 -1
- package/dist/preview/{chunk.7MTX33WD.js → chunk.SG23JC6D.js} +1 -1
- package/dist/preview/chunk.SSRP5SBR.js +1 -0
- package/dist/preview/{chunk.T3M4FALL.js → chunk.T2CN7UTZ.js} +2 -2
- package/dist/preview/{chunk.B2WRXGFI.js → chunk.T47DLH5Z.js} +1 -1
- package/dist/preview/{chunk.BU2DSZ2L.js → chunk.TGEF6TMM.js} +1 -1
- package/dist/preview/{chunk.7JNDZWD6.js → chunk.UJR3Y7MP.js} +1 -1
- package/dist/preview/{chunk.52QAIGCD.js → chunk.VHWUGSFW.js} +1 -1
- package/dist/preview/{chunk.6K2HASOH.js → chunk.W42P7NOL.js} +1 -1
- package/dist/preview/{chunk.2UPGH6FT.js → chunk.WGI5G6NM.js} +1 -1
- package/dist/preview/{chunk.VKH3ZPPQ.js → chunk.WHTQHU3M.js} +1 -1
- package/dist/preview/{chunk.6XO4PECH.js → chunk.WJ2TWU2I.js} +1 -1
- package/dist/preview/chunk.WQBDTLPZ.js +1 -0
- package/dist/preview/{chunk.TCSZZAYB.js → chunk.XBTZXWJX.js} +1 -1
- package/dist/preview/{chunk.OMMKD2NU.js → chunk.XRCGADKC.js} +1 -1
- package/dist/preview/{chunk.SIH6RCAI.js → chunk.Y3IJDWNS.js} +1 -1
- package/dist/preview/{chunk.HUKAVTMX.js → chunk.YNE5QR7Q.js} +1 -1
- package/dist/preview/{chunk.5EAQDBBE.js → chunk.ZDNJK2SX.js} +1 -1
- package/dist/preview/{chunk.QU356VB2.js → chunk.ZEW2OOZ5.js} +1 -1
- package/dist/preview/chunk.ZNS3LYJU.js +1 -0
- package/dist/preview/{chunk.YT2CYCVT.js → chunk.ZSSOTIFL.js} +1 -1
- package/dist/preview/{chunk.WAB6ZS2V.js → chunk.ZVMIHXVK.js} +1 -1
- package/dist/preview/{chunk.DUUARGPE.js → chunk.ZWZ5SEXT.js} +1 -1
- package/dist/preview/index.html +42 -42
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.6P7P2AW7.js +0 -1
- package/dist/preview/chunk.E7EQ2VTE.js +0 -1
- package/dist/preview/chunk.GNSAKLP2.js +0 -1
- package/dist/preview/chunk.HH6P4BLT.js +0 -1
- package/dist/preview/chunk.HPEGQN6E.js +0 -1
- package/dist/preview/chunk.JZBBGY4B.js +0 -1
- package/dist/preview/chunk.KA3KI4UA.js +0 -1
- package/dist/preview/chunk.M5HADQPP.js +0 -1
- package/dist/preview/chunk.QPAUQJON.js +0 -1
- package/dist/preview/chunk.SHPXD6FC.js +0 -1
- package/dist/preview/chunk.TPX6AVJL.js +0 -1
- package/dist/preview/chunk.WPCGHGDA.js +0 -1
- package/dist/preview/chunk.YCIX53AR.js +0 -1
- package/dist/preview/chunk.YEYY273R.js +0 -1
- package/dist/preview/chunk.ZFWV4JAJ.js +0 -1
- package/dist/preview/chunk.ZPQKAJRI.js +0 -1
- package/dist/preview/chunk.ZTD2CNC3.js +0 -25
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as J,b as We}from"./chunk.5A4AOFOA.js";import"./chunk.KSXB4LDF.js";import"./chunk.VZHV25JE.js";import"./chunk.QVUL2FSI.js";import{i as $e,j as Re,k as Le}from"./chunk.F6WYSDSI.js";import"./chunk.PW7YH6JV.js";import"./chunk.SIH6RCAI.js";import"./chunk.5EAQDBBE.js";import"./chunk.YT2CYCVT.js";import"./chunk.HJCQ6I3S.js";import"./chunk.DUUARGPE.js";import"./chunk.FUQVNXLB.js";import"./chunk.LAF6GTBN.js";import"./chunk.QU356VB2.js";import"./chunk.QVKKXMNK.js";import"./chunk.ZSW74NVJ.js";import"./chunk.ZE4CTZQ3.js";import"./chunk.3C4RJIJU.js";import{a as Pe,b as k}from"./chunk.YJCT3DV2.js";import"./chunk.34CYK2DF.js";import"./chunk.JZBBGY4B.js";import{b as ze,c as Ee}from"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.HPD5ZDZH.js";import"./chunk.52QAIGCD.js";import"./chunk.PPUAPAWR.js";import"./chunk.IHFNLKXV.js";import"./chunk.577PGFUT.js";import"./chunk.FBY5IUGU.js";import"./chunk.4K5QCJFH.js";import{u as Ie}from"./chunk.WLBXBNNH.js";import"./chunk.7MTX33WD.js";import"./chunk.OJGHDWI6.js";import{g as Ce}from"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import{c as Me}from"./chunk.FSAHO3LV.js";import{m as He}from"./chunk.PNVR3CXR.js";import{F as tt,Q as Se,Y as N,i as xe,na as Q,sa as Ae,v as ke,wa as Te}from"./chunk.ZTD2CNC3.js";import{Jb as ye,Kb as we,da as K,ea as W,fc as be,kb as ve}from"./chunk.X7W27IRI.js";import{b as G}from"./chunk.AJZBJBMO.js";var o=G(tt(),1);var t=G(Se(),1);function mt(d,r,a){let p=r.on??r.about[r.about.length-1];$e(d,r.about,{...a,pins:J(),...p===void 0?{}:{focus:p}})}function ft({placement:d="float",chosen:r=!0}={}){let{menuAt:a}=N();return d==="menu"&&a===null?r?(0,t.jsx)(nt,{}):null:(0,t.jsx)(it,{placement:d})}function nt(){let{store:d,setMenuAt:r,view:a}=N(),{selection:p}=Q(),h=(0,o.useRef)(null),[H,v]=(0,o.useState)(null);(0,o.useLayoutEffect)(()=>{let b=h.current?.offsetParent??h.current?.parentElement;if(!b)return;let m=Math.round(b.getBoundingClientRect().width);m!==H&&v(m)});let y=p.length===1&&!a.overview?d.graph.getNode(p[0]):void 0;return!y||H===null||H>=De?(0,t.jsx)("span",{ref:h,hidden:!0}):(0,t.jsx)("button",{type:"button",ref:h,"data-testid":"chosen-acts","aria-label":`What can be done with ${k(d,y.id)}`,"aria-haspopup":"menu",onClick:b=>{let m=b.currentTarget.getBoundingClientRect();r({x:Math.round(m.right),y:Math.round(m.bottom+4),on:y.id})},style:{position:"absolute",right:"calc(14px + var(--graview-dock, 0px))",top:98,zIndex:"var(--graview-layer-overview, 10)",minHeight:30,padding:"0 12px",borderRadius:8,fontSize:"0.8125rem",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Acts\u2026"})}var De=564;function it({placement:d}){let{store:r,menuAt:a,setMenuAt:p,view:h,signIn:H}=N(),v=(0,o.useRef)(null),y=(0,o.useRef)(null),b=(0,o.useRef)(null),m=(0,o.useRef)(null);a?.returnTo&&(m.current=a.returnTo);let Oe=e=>{let i=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),n=e.getAttribute("data-pin-for"),g=i??e.getAttribute("data-affordance")??(n===null?null:`pin:${n}`)??e.getAttribute("data-menu-item");y.current=g===null?null:{key:g,element:e}};(0,o.useEffect)(()=>{let e=v.current,i=y.current;if(i===null||document.activeElement!==document.body||i.element.isConnected)return;let n=i.key;if(!e){y.current=null;let I=m.current;m.current=null,(I?.isConnected?I:b.current)?.focus();return}((n.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(n.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(n)}"]:not([disabled])`)??e).focus()});let[Fe,qe]=(0,o.useState)(null);(0,o.useLayoutEffect)(()=>{let e=v.current?.offsetParent??v.current?.parentElement;if(e instanceof HTMLElement&&(b.current=e),!e)return;let i=e.getBoundingClientRect();qe(n=>n&&n.left===i.left&&n.top===i.top&&n.width===i.width&&n.height===i.height?n:{left:i.left,top:i.top,width:i.width,height:i.height})});let{selection:Be,set:je,clear:_e}=Q(),s=a?.about??Be,[D,Ue]=(0,o.useState)(()=>J()),O=a?.on??s[s.length-1],F=a?.about,Ve=(0,o.useMemo)(()=>({pins:D,...O===void 0?{}:{focus:O},...F?{about:F}:{}}),[D,O,F]),Ye=(0,o.useMemo)(()=>new Set(r.allMutations().filter(e=>e.pinned).map(e=>e.name)),[r]),{affordances:c,withheld:X,observations:Z}=Re(Ve),M=we(X,H),f=M?rt:X,Ge=a===null?null:{face:a.face??"scene",on:a.on,about:s,field:a.field,place:a.place,href:a.href,act:a.act,element:a.returnTo},ee=Ie(Ge),te=Z.some(e=>e.id.startsWith("schema:waits:")),{apply:Ke,preview:Qe}=Le(),[C,z]=(0,o.useState)(null),[Je,ne]=(0,o.useState)(!1),[ie,re]=(0,o.useState)(!1),[P,$]=(0,o.useState)(""),[ae,q]=(0,o.useState)(null),B=(0,o.useRef)([]),j=(e,i)=>{try{return Qe(e,i),Ke(e,i),q(null),p(null),B.current=[],!0}catch(n){return q(Ce(r.schema,r.allMutations(),n)),B.current=n instanceof ve?n.issues.map(g=>String(g.path[0]??"")).filter(Boolean):[],!1}},R=[...new Set(s.flatMap(e=>{let i=r.graph.getNode(e);return i?[i.kind]:[]}))],x=R.length>0?R:[...new Set(s.flatMap(e=>ke(e)))],u=s.length===1?xe(s[0]):null,_=u?{from:r.graph.getNode(u.from),to:r.graph.getNode(u.to)}:null,oe=u?Ee(r,u):void 0,le=oe?.provisional?oe:void 0,se=u?(()=>{let e=r.schema.tryDefinition(r.graph.getNode(u.from)?.kind??"")?.edges?.[u.kind],i=r.graph.getNode(u.to);return e?.inverse&&i?`From ${k(r,i.id)}: ${e.inverse}`:null})():null;(0,o.useEffect)(()=>{z(null),ne(!1),re(!1),q(null),$("")},[s,a?.about]);let l=a!==null,Xe=d==="menu"&&!l,S=(0,o.useRef)(a);S.current=a;let de=Te("acts",{open:l&&d==="menu",onOpenChange:e=>{e||p(null)},at:()=>S.current?{x:S.current.x,y:S.current.y}:null,returnTo:()=>{let e=S.current?.returnTo;if(e?.isConnected)return e;let i=S.current?.on;return i?document.querySelector(`[data-graview-view="${CSS.escape(i)}"]`):null},align:"start"}),ue=(Fe?.width??Number.POSITIVE_INFINITY)<De;if((0,o.useLayoutEffect)(()=>{let e=v.current?.offsetParent;if(!e||!ue||l)return;let i=v.current?.getBoundingClientRect().height??0,n=`${Math.round(i)+20}px`;if(e.style.paddingBottom===n)return;let g=e.style.paddingBottom;return e.style.paddingBottom=n,()=>{e.style.paddingBottom=g}}),s.length===0&&!l)return null;let pe=a?.title!==void 0||s.length>0&&!(s.length===1&&s[0]===h.focusId),ce=Math.max(1,Math.min(9,c.length)),A=[...c.filter(e=>e.provider==="invariant"&&!e.destructive),...c.filter(e=>e.pinned&&e.provider!=="invariant"&&!e.destructive),...c.filter(e=>!e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.destructive)],ge=A.length>ce&&!l,he=P.trim().toLowerCase(),w=ge&&he.length>0?A.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(he)):null,U=w??(Je||l?A:A.slice(0,ce)),me=w?0:A.length-U.length,L=[];for(let e of U){let i=!l&&e.provider==="invariant",n=!l&&!i&&e.pinned!==void 0&&!e.destructive,g=!l&&!i&&!n&&e.ties===!0&&!e.destructive,I=i?e.why:n?"pinned":g?"its ties":null,et=i?"violation":n||g?"ties":null,Y=L[L.length-1];Y&&Y.heading===I?Y.items.push(e):L.push({heading:I,tone:et,items:[e]})}let V=c.find(e=>e.id===C),E=s.length===1?k(r,s[0]):null,fe=e=>{if(!E)return e;let i=e.startsWith(`"${E}"`)?e.slice(E.length+2):e.startsWith(E)?e.slice(E.length):null;if(i===null)return e;let n=i.trimStart();return n.length===0?e:n[0].toUpperCase()+n.slice(1)},Ze=new Set(l?[]:U.filter(e=>e.provider==="invariant").map(e=>e.why)),T=Z.filter(e=>!Ze.has(e.text)).map(e=>({...e,text:fe(e.text)}));return Xe?null:(0,t.jsxs)("section",{...l?de.pane:{},ref:e=>{v.current=e,l&&de.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":l?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>Oe(e.target),onBlur:e=>{e.relatedTarget!==null&&(y.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...l?Ae:{position:"absolute",zIndex:be("rail")},boxSizing:"border-box",display:"flex",flexDirection:"column",gap:7,padding:"9px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",...l?{width:300,maxHeight:"min(52cqh, 420px)",overflow:"auto"}:ue?{left:10,right:10,width:"auto",bottom:10,maxHeight:"min(42cqh, 300px)",overflow:"auto"}:{left:14,top:h.overview?"min(296px, 38cqh)":44,width:236,maxHeight:h.overview?"calc(100cqh - min(296px, 38cqh) - 20px)":"calc(68cqh - 94px)",overflow:"auto"}},children:[(0,t.jsx)("h2",{style:{...He,margin:0},children:"Inspector"}),(0,t.jsxs)("div",{style:{display:pe||!l?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:l?0:24},children:[pe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:a?.title??(s.length===1?k(r,s[0]):`${s.length} selected`)}),R.length>0||u?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:u?"relation":R.map(e=>W(r.schema.tryDefinition(e),e)).join(" \xB7 ")}):null,s.length===1&&!u&&a?.face!=="pages"?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:h.expanded.includes(s[0])?"\xB7 double-click closes":"\xB7 double-click opens"}):null]}):null,(0,t.jsx)("span",{style:{flex:"1 1 auto"}})]}),l?null:(0,t.jsx)("button",{type:"button",onClick:()=>{p(null),_e()},"aria-label":"Clear selection",title:"Clear selection",style:{position:"absolute",top:6,right:6,flex:"0 0 auto",width:24,height:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.875rem",lineHeight:1,borderRadius:7},children:"\xD7"}),u&&_?(0,t.jsxs)("div",{style:{display:"grid",gap:6},children:[se?(0,t.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:se}):null,le?(0,t.jsx)("p",{"data-testid":"edge-provisional",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:ze(le)}):null,(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",_.from],["to",_.to]].map(([e,i],n)=>(0,t.jsxs)(o.Fragment,{children:[n===1?(0,t.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,i?(0,t.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>je([i.id]),title:`Select ${k(r,i.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:k(r,i.id)}):(0,t.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,!u&&s.length===1&&ye(r,s[0])?(0,t.jsx)("p",{"data-testid":"left-alone",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:"Left alone: nothing automated changes it."}):null,T.length>0?(0,t.jsx)("div",{"data-testid":"observations",title:T.map(e=>e.text).join(`
|
|
1
|
+
import{a as J,b as We}from"./chunk.5A4AOFOA.js";import"./chunk.OF34OZ4V.js";import"./chunk.NNCTJSD3.js";import"./chunk.GXLAZGYT.js";import{i as $e,j as Re,k as Le}from"./chunk.R7LRJS6B.js";import"./chunk.IB32NOV5.js";import"./chunk.Y3IJDWNS.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.ACEYGWMO.js";import"./chunk.3PT55HXT.js";import"./chunk.272ZJXQP.js";import{a as Pe,b as k}from"./chunk.3SM2CHKF.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import{b as ze,c as Ee}from"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.EBLKEQ7O.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{u as Ie}from"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import{g as Ce}from"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import{c as Me}from"./chunk.IMRCAU4T.js";import{m as He}from"./chunk.BZ5VLPKB.js";import{F as tt,Q as Se,Y as N,i as xe,na as Q,sa as Ae,v as ke,wa as Te}from"./chunk.6II4BONS.js";import{Kb as ye,Lb as we,da as K,ea as W,gc as be,lb as ve}from"./chunk.F5BCCGFK.js";import{b as G}from"./chunk.AJZBJBMO.js";var o=G(tt(),1);var t=G(Se(),1);function mt(d,r,a){let p=r.on??r.about[r.about.length-1];$e(d,r.about,{...a,pins:J(),...p===void 0?{}:{focus:p}})}function ft({placement:d="float",chosen:r=!0}={}){let{menuAt:a}=N();return d==="menu"&&a===null?r?(0,t.jsx)(nt,{}):null:(0,t.jsx)(it,{placement:d})}function nt(){let{store:d,setMenuAt:r,view:a}=N(),{selection:p}=Q(),h=(0,o.useRef)(null),[H,v]=(0,o.useState)(null);(0,o.useLayoutEffect)(()=>{let b=h.current?.offsetParent??h.current?.parentElement;if(!b)return;let m=Math.round(b.getBoundingClientRect().width);m!==H&&v(m)});let y=p.length===1&&!a.overview?d.graph.getNode(p[0]):void 0;return!y||H===null||H>=De?(0,t.jsx)("span",{ref:h,hidden:!0}):(0,t.jsx)("button",{type:"button",ref:h,"data-testid":"chosen-acts","aria-label":`What can be done with ${k(d,y.id)}`,"aria-haspopup":"menu",onClick:b=>{let m=b.currentTarget.getBoundingClientRect();r({x:Math.round(m.right),y:Math.round(m.bottom+4),on:y.id})},style:{position:"absolute",right:"calc(14px + var(--graview-dock, 0px))",top:98,zIndex:"var(--graview-layer-overview, 10)",minHeight:30,padding:"0 12px",borderRadius:8,fontSize:"0.8125rem",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Acts\u2026"})}var De=564;function it({placement:d}){let{store:r,menuAt:a,setMenuAt:p,view:h,signIn:H}=N(),v=(0,o.useRef)(null),y=(0,o.useRef)(null),b=(0,o.useRef)(null),m=(0,o.useRef)(null);a?.returnTo&&(m.current=a.returnTo);let Oe=e=>{let i=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),n=e.getAttribute("data-pin-for"),g=i??e.getAttribute("data-affordance")??(n===null?null:`pin:${n}`)??e.getAttribute("data-menu-item");y.current=g===null?null:{key:g,element:e}};(0,o.useEffect)(()=>{let e=v.current,i=y.current;if(i===null||document.activeElement!==document.body||i.element.isConnected)return;let n=i.key;if(!e){y.current=null;let I=m.current;m.current=null,(I?.isConnected?I:b.current)?.focus();return}((n.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(n.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(n)}"]:not([disabled])`)??e).focus()});let[Fe,qe]=(0,o.useState)(null);(0,o.useLayoutEffect)(()=>{let e=v.current?.offsetParent??v.current?.parentElement;if(e instanceof HTMLElement&&(b.current=e),!e)return;let i=e.getBoundingClientRect();qe(n=>n&&n.left===i.left&&n.top===i.top&&n.width===i.width&&n.height===i.height?n:{left:i.left,top:i.top,width:i.width,height:i.height})});let{selection:Be,set:je,clear:_e}=Q(),s=a?.about??Be,[D,Ue]=(0,o.useState)(()=>J()),O=a?.on??s[s.length-1],F=a?.about,Ve=(0,o.useMemo)(()=>({pins:D,...O===void 0?{}:{focus:O},...F?{about:F}:{}}),[D,O,F]),Ye=(0,o.useMemo)(()=>new Set(r.allMutations().filter(e=>e.pinned).map(e=>e.name)),[r]),{affordances:c,withheld:X,observations:Z}=Re(Ve),M=we(X,H),f=M?rt:X,Ge=a===null?null:{face:a.face??"scene",on:a.on,about:s,field:a.field,place:a.place,href:a.href,act:a.act,element:a.returnTo},ee=Ie(Ge),te=Z.some(e=>e.id.startsWith("schema:waits:")),{apply:Ke,preview:Qe}=Le(),[C,z]=(0,o.useState)(null),[Je,ne]=(0,o.useState)(!1),[ie,re]=(0,o.useState)(!1),[P,$]=(0,o.useState)(""),[ae,q]=(0,o.useState)(null),B=(0,o.useRef)([]),j=(e,i)=>{try{return Qe(e,i),Ke(e,i),q(null),p(null),B.current=[],!0}catch(n){return q(Ce(r.schema,r.allMutations(),n)),B.current=n instanceof ve?n.issues.map(g=>String(g.path[0]??"")).filter(Boolean):[],!1}},R=[...new Set(s.flatMap(e=>{let i=r.graph.getNode(e);return i?[i.kind]:[]}))],x=R.length>0?R:[...new Set(s.flatMap(e=>ke(e)))],u=s.length===1?xe(s[0]):null,_=u?{from:r.graph.getNode(u.from),to:r.graph.getNode(u.to)}:null,oe=u?Ee(r,u):void 0,le=oe?.provisional?oe:void 0,se=u?(()=>{let e=r.schema.tryDefinition(r.graph.getNode(u.from)?.kind??"")?.edges?.[u.kind],i=r.graph.getNode(u.to);return e?.inverse&&i?`From ${k(r,i.id)}: ${e.inverse}`:null})():null;(0,o.useEffect)(()=>{z(null),ne(!1),re(!1),q(null),$("")},[s,a?.about]);let l=a!==null,Xe=d==="menu"&&!l,S=(0,o.useRef)(a);S.current=a;let de=Te("acts",{open:l&&d==="menu",onOpenChange:e=>{e||p(null)},at:()=>S.current?{x:S.current.x,y:S.current.y}:null,returnTo:()=>{let e=S.current?.returnTo;if(e?.isConnected)return e;let i=S.current?.on;return i?document.querySelector(`[data-graview-view="${CSS.escape(i)}"]`):null},align:"start"}),ue=(Fe?.width??Number.POSITIVE_INFINITY)<De;if((0,o.useLayoutEffect)(()=>{let e=v.current?.offsetParent;if(!e||!ue||l)return;let i=v.current?.getBoundingClientRect().height??0,n=`${Math.round(i)+20}px`;if(e.style.paddingBottom===n)return;let g=e.style.paddingBottom;return e.style.paddingBottom=n,()=>{e.style.paddingBottom=g}}),s.length===0&&!l)return null;let pe=a?.title!==void 0||s.length>0&&!(s.length===1&&s[0]===h.focusId),ce=Math.max(1,Math.min(9,c.length)),A=[...c.filter(e=>e.provider==="invariant"&&!e.destructive),...c.filter(e=>e.pinned&&e.provider!=="invariant"&&!e.destructive),...c.filter(e=>!e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.destructive)],ge=A.length>ce&&!l,he=P.trim().toLowerCase(),w=ge&&he.length>0?A.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(he)):null,U=w??(Je||l?A:A.slice(0,ce)),me=w?0:A.length-U.length,L=[];for(let e of U){let i=!l&&e.provider==="invariant",n=!l&&!i&&e.pinned!==void 0&&!e.destructive,g=!l&&!i&&!n&&e.ties===!0&&!e.destructive,I=i?e.why:n?"pinned":g?"its ties":null,et=i?"violation":n||g?"ties":null,Y=L[L.length-1];Y&&Y.heading===I?Y.items.push(e):L.push({heading:I,tone:et,items:[e]})}let V=c.find(e=>e.id===C),E=s.length===1?k(r,s[0]):null,fe=e=>{if(!E)return e;let i=e.startsWith(`"${E}"`)?e.slice(E.length+2):e.startsWith(E)?e.slice(E.length):null;if(i===null)return e;let n=i.trimStart();return n.length===0?e:n[0].toUpperCase()+n.slice(1)},Ze=new Set(l?[]:U.filter(e=>e.provider==="invariant").map(e=>e.why)),T=Z.filter(e=>!Ze.has(e.text)).map(e=>({...e,text:fe(e.text)}));return Xe?null:(0,t.jsxs)("section",{...l?de.pane:{},ref:e=>{v.current=e,l&&de.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":l?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>Oe(e.target),onBlur:e=>{e.relatedTarget!==null&&(y.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...l?Ae:{position:"absolute",zIndex:be("rail")},boxSizing:"border-box",display:"flex",flexDirection:"column",gap:7,padding:"9px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",...l?{width:300,maxHeight:"min(52cqh, 420px)",overflow:"auto"}:ue?{left:10,right:10,width:"auto",bottom:10,maxHeight:"min(42cqh, 300px)",overflow:"auto"}:{left:14,top:h.overview?"min(296px, 38cqh)":44,width:236,maxHeight:h.overview?"calc(100cqh - min(296px, 38cqh) - 20px)":"calc(68cqh - 94px)",overflow:"auto"}},children:[(0,t.jsx)("h2",{style:{...He,margin:0},children:"Inspector"}),(0,t.jsxs)("div",{style:{display:pe||!l?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:l?0:24},children:[pe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:a?.title??(s.length===1?k(r,s[0]):`${s.length} selected`)}),R.length>0||u?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:u?"relation":R.map(e=>W(r.schema.tryDefinition(e),e)).join(" \xB7 ")}):null,s.length===1&&!u&&a?.face!=="pages"?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:h.expanded.includes(s[0])?"\xB7 double-click closes":"\xB7 double-click opens"}):null]}):null,(0,t.jsx)("span",{style:{flex:"1 1 auto"}})]}),l?null:(0,t.jsx)("button",{type:"button",onClick:()=>{p(null),_e()},"aria-label":"Clear selection",title:"Clear selection",style:{position:"absolute",top:6,right:6,flex:"0 0 auto",width:24,height:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.875rem",lineHeight:1,borderRadius:7},children:"\xD7"}),u&&_?(0,t.jsxs)("div",{style:{display:"grid",gap:6},children:[se?(0,t.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:se}):null,le?(0,t.jsx)("p",{"data-testid":"edge-provisional",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:ze(le)}):null,(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",_.from],["to",_.to]].map(([e,i],n)=>(0,t.jsxs)(o.Fragment,{children:[n===1?(0,t.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,i?(0,t.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>je([i.id]),title:`Select ${k(r,i.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:k(r,i.id)}):(0,t.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,!u&&s.length===1&&ye(r,s[0])?(0,t.jsx)("p",{"data-testid":"left-alone",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:"Left alone: nothing automated changes it."}):null,T.length>0?(0,t.jsx)("div",{"data-testid":"observations",title:T.map(e=>e.text).join(`
|
|
2
2
|
`),style:{display:"grid",gap:3},children:T.slice(0,2).map(e=>(0,t.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===T[1]&&T.length>2?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",T.length-2]}):null]},e.id))}):null,l?ee.start.map(e=>(0,t.jsx)(Ne,{section:e,close:()=>p(null)},e.id)):null,ae?(0,t.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:ae}):null,ge?(0,t.jsx)("input",{"data-testid":"action-filter",value:P,onChange:e=>$(e.target.value),placeholder:`Filter ${A.length} actions\u2026`,"aria-label":"Filter actions",onKeyDown:e=>{if(e.key==="Escape"){e.stopPropagation(),P.length>0?$(""):e.currentTarget.blur();return}if(e.key==="Enter"&&w?.length===1){let i=w[0];if(i.destructive)return;i.open.length>0?z(i.id):j(i)&&$("")}},style:{font:"inherit",fontSize:"0.875rem",padding:"5px 9px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):null,w!==null&&w.length===0?(0,t.jsxs)("p",{"data-testid":"no-matches",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:["Nothing offered here matches \u201C",P.trim(),"\u201D."]}):null,M&&c.length===0||c.length===0&&!te&&s.length===0?null:c.length===0&&!te?(0,t.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:f.length>0?`Nothing you may do with ${u?"this relation":x.length===1?K(W(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} \u2014 ${f.length} action${f.length===1?"":"s"} withheld.`:u?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${Me(r.schema,r.graph.getNode(u.from)?.kind??"",u.kind,"out")}\u201D.`:`Nothing can be done with ${x.length===1?K(W(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${x.length===1?"it":"them"}.`}):(0,t.jsxs)("ol",{"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[L.map((e,i)=>(0,t.jsxs)(o.Fragment,{children:[e.heading?(0,t.jsxs)("li",{"data-graview-heading":e.tone,style:{fontSize:"0.75rem",lineHeight:1.4,color:e.tone==="violation"?"var(--graview-warn)":"var(--graview-ink-faint)",...e.tone!=="violation"?{letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"}:{},padding:"2px 2px 1px",marginTop:i>0?6:0},children:[e.tone==="violation"?"\u26A0 ":"",e.tone==="violation"?fe(e.heading):e.heading]}):i>0?(0,t.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},children:[(0,t.jsxs)("button",{type:"button","data-affordance":n.id,"data-rank":n.rank,"data-graview-destructive":n.destructive||void 0,"aria-pressed":C===n.id,title:n.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:C===n.id?"var(--graview-accent)":l?"transparent":"var(--graview-edge)",background:l?"none":"var(--graview-panel)",boxShadow:"none",...n.destructive?{color:"var(--graview-warn)"}:{},...C===n.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(n.open.length>0){z(C===n.id?null:n.id);return}j(n)},children:[n.label,n.open.length>0?(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,w?.length===1&&w[0]?.id===n.id&&!n.destructive?(0,t.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,t.jsx)("button",{type:"button","data-testid":"pin-toggle","data-pin-for":n.mutation,"aria-pressed":n.pinned!==void 0,"aria-label":n.pinned!==void 0?`Unpin ${n.label}`:`Pin ${n.label}`,title:n.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":n.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>Ue(We(D,n.mutation,Ye.has(n.mutation))),style:{flex:"0 0 auto",width:24,minHeight:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.75rem",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7,color:n.pinned==="user"?"var(--graview-accent)":n.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:n.pinned!==void 0?"\u2605":"\u2606"})]},n.id))]},`${e.heading??"plain"}-${i}`)),me>0?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>ne(!0),title:`Show all ${c.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",me," more"]})}):null]}),M?(0,t.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>{p(null),M.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left"},children:M.label}):null,f.length>0?(0,t.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[f.slice(0,l||ie?f.length:3).map(e=>(0,t.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,t.jsx)("button",{type:"button",disabled:!0,"data-affordance":e.id,"data-rank":e.rank,"data-withheld":e.refusal.wouldNeed.join(",")||"nobody",style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8,borderStyle:"dashed",width:"100%",textAlign:"left",background:"none"},children:(0,t.jsx)("s",{children:e.label})}),(0,t.jsx)("span",{"data-testid":"withheld-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:e.refusal.message})]},e.id)),!l&&!ie&&f.length>3?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>re(!0),title:`Show all ${f.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",f.length-3," more withheld"]})}):null]}):null,l?ee.end.map(e=>(0,t.jsx)(Ne,{section:e,close:()=>p(null)},e.id)):null,V?(0,t.jsx)(Pe,{affordance:V,onApply:e=>{if(j(V,e))z(null);else return B.current},onCancel:()=>z(null)}):null]})}var rt=[];function Ne({section:d,close:r}){return(0,t.jsxs)("div",{"data-menu-section":d.id,...d.heading?{role:"group","aria-label":d.heading}:{},style:{display:"grid",gap:2,borderTop:"1px solid var(--graview-edge)",paddingTop:5},children:[d.heading?(0,t.jsx)("p",{"aria-hidden":"true",style:{margin:0,padding:"2px 2px 1px",fontSize:"0.75rem",lineHeight:1.4,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:d.heading}):null,d.items&&d.items.length>0?(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:d.items.map(a=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-menu-item":a.id,onClick:()=>{r(),a.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"},children:[a.label,a.hint?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",a.hint]}):null]})},a.id))}):null,d.render?.(r)]})}export{ft as InspectorPane,mt as prepareActs};
|
|
@@ -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>
|