graview 0.1.68 → 0.1.69
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.ODYJEDIW.js → chunk.26RYER7Y.js} +1 -1
- package/dist/preview/{chunk.TRNJKHIA.js → chunk.2AL26ZPJ.js} +1 -1
- package/dist/preview/chunk.2WFOKJB4.js +1 -0
- package/dist/preview/chunk.3D37E2G5.js +1 -0
- package/dist/preview/chunk.3PT3BU6K.js +1 -0
- package/dist/preview/{chunk.7ZTGB4O7.js → chunk.3TKIZGC7.js} +1 -1
- package/dist/preview/{chunk.AQ2PI6MR.js → chunk.3VNOTHA5.js} +1 -1
- package/dist/preview/{chunk.QWLK3GKG.js → chunk.3XTIYX6M.js} +1 -1
- package/dist/preview/{chunk.GF3ZCX46.js → chunk.447RWLS7.js} +2 -2
- package/dist/preview/{chunk.E423JCOS.js → chunk.47VEV4BX.js} +1 -1
- package/dist/preview/{chunk.NRCWMYLH.js → chunk.4FJ4OPSJ.js} +1 -1
- package/dist/preview/{chunk.XFH6GHBQ.js → chunk.4O7WYLCK.js} +1 -1
- package/dist/preview/{chunk.MSUZAJ2K.js → chunk.4R7H3GIL.js} +2 -2
- package/dist/preview/{chunk.EB7PZJEO.js → chunk.4RPKCW4J.js} +1 -1
- package/dist/preview/{chunk.YM6SWEUI.js → chunk.523EFGHU.js} +1 -1
- package/dist/preview/chunk.5DU6FA5R.js +1 -0
- package/dist/preview/{chunk.LFFJB6D3.js → chunk.5MOXQUZH.js} +1 -1
- package/dist/preview/chunk.5TWRTGP6.js +1 -0
- package/dist/preview/{chunk.AWV57UBJ.js → chunk.66TRDXYR.js} +1 -1
- package/dist/preview/{chunk.AYZL3LCR.js → chunk.6BNSDPZE.js} +3 -3
- package/dist/preview/chunk.6BR2SUAE.js +1 -0
- package/dist/preview/{chunk.32JE2WS7.js → chunk.6TDVNWFU.js} +1 -1
- package/dist/preview/{chunk.UAMPR4MD.js → chunk.6XBQDXT6.js} +1 -1
- package/dist/preview/{chunk.TVWK3SGD.js → chunk.6ZFYFT5A.js} +1 -1
- package/dist/preview/{chunk.N5Z34V7U.js → chunk.7L3I776Z.js} +1 -1
- package/dist/preview/chunk.7OLKVOS6.js +1 -0
- package/dist/preview/{chunk.MKL4THIV.js → chunk.7T2P42VW.js} +1 -1
- package/dist/preview/{chunk.QM54TGU6.js → chunk.AG7WJYM5.js} +2 -2
- package/dist/preview/{chunk.ECNGVD25.js → chunk.AHYMIVBX.js} +1 -1
- package/dist/preview/chunk.AMAOZVEO.js +1 -0
- package/dist/preview/chunk.AMV2ILR6.js +1 -0
- package/dist/preview/{chunk.RQG672MJ.js → chunk.AUNQNTKY.js} +1 -1
- package/dist/preview/{chunk.HXTKBISQ.js → chunk.AZRICZKT.js} +1 -1
- package/dist/preview/{chunk.L7XKYGV7.js → chunk.B422DSYN.js} +1 -1
- package/dist/preview/{chunk.XDZDNZ7B.js → chunk.B5EFNTDA.js} +1 -1
- package/dist/preview/{chunk.F5GNNVSQ.js → chunk.BO32A3W5.js} +1 -1
- package/dist/preview/{chunk.ZLEBOR5T.js → chunk.BQORHDAH.js} +1 -1
- package/dist/preview/{chunk.4GVKKBQL.js → chunk.BSQI3KM2.js} +1 -1
- package/dist/preview/{chunk.BPNW5KCP.js → chunk.C6CT6F4C.js} +1 -1
- package/dist/preview/{chunk.JV432T4Q.js → chunk.CA2SYEYE.js} +1 -1
- package/dist/preview/{chunk.64LCHHZB.js → chunk.CCCONK73.js} +1 -1
- package/dist/preview/{chunk.GONZB3J3.js → chunk.CDSHUWSK.js} +1 -1
- package/dist/preview/{chunk.NFTPJAMJ.js → chunk.CKSRW3LA.js} +1 -1
- package/dist/preview/{chunk.LOKGUALC.js → chunk.CLIC2QBA.js} +1 -1
- package/dist/preview/{chunk.PLIV3IQK.js → chunk.CLZYNFFH.js} +1 -1
- package/dist/preview/{chunk.GKTQ5CZA.js → chunk.CSVDBDRZ.js} +2 -2
- package/dist/preview/{chunk.GJTEV6CK.js → chunk.CUEIGKFG.js} +1 -1
- package/dist/preview/{chunk.IPGLITWA.js → chunk.CYEPHT7V.js} +1 -1
- package/dist/preview/{chunk.BQAFFEOA.js → chunk.D3SWJ7OS.js} +1 -1
- package/dist/preview/{chunk.ACNOP2IU.js → chunk.D5JZQZ74.js} +1 -1
- package/dist/preview/{chunk.6AANHELP.js → chunk.DHPXRDT5.js} +5 -5
- package/dist/preview/{chunk.R3GE37OI.js → chunk.DKUEZPGR.js} +1 -1
- package/dist/preview/{chunk.2TUEBU7X.js → chunk.DO3FQM6R.js} +1 -1
- package/dist/preview/{chunk.G2BDEWJC.js → chunk.DRAPVGQZ.js} +1 -1
- package/dist/preview/{chunk.6WB2TYK7.js → chunk.DU76ASS4.js} +1 -1
- package/dist/preview/{chunk.AENP662H.js → chunk.EEUCRZA3.js} +1 -1
- package/dist/preview/{chunk.WC5WE34A.js → chunk.EK3JXEZL.js} +1 -1
- package/dist/preview/{chunk.2BMZPALF.js → chunk.EL7XXGQY.js} +1 -1
- package/dist/preview/{chunk.2KCDLCB2.js → chunk.EP7YT7LT.js} +1 -1
- package/dist/preview/{chunk.SS6KL5NT.js → chunk.EQZPEOIW.js} +1 -1
- package/dist/preview/{chunk.VW632VNJ.js → chunk.F4CDJBDS.js} +1 -1
- package/dist/preview/{chunk.O5FTWXA2.js → chunk.FE3SINPK.js} +1 -1
- package/dist/preview/{chunk.JULD4XFB.js → chunk.FIY4RUK5.js} +1 -1
- package/dist/preview/{chunk.3VEZ5MOC.js → chunk.FWXW4T4I.js} +1 -1
- package/dist/preview/{chunk.FSW535EA.js → chunk.G43YUGNW.js} +1 -1
- package/dist/preview/{chunk.QYPU444Y.js → chunk.GF5CZPZ7.js} +1 -1
- package/dist/preview/{chunk.4TT3ZHSJ.js → chunk.GPBHUIZQ.js} +1 -1
- package/dist/preview/{chunk.YL2RBZFE.js → chunk.GTF6EMVE.js} +1 -1
- package/dist/preview/chunk.GVFGS2HY.js +1 -0
- package/dist/preview/{chunk.EGSOHTZZ.js → chunk.HCX6KPRF.js} +1 -1
- package/dist/preview/{chunk.4YAO3A5Q.js → chunk.HGH27XZG.js} +3 -3
- package/dist/preview/{chunk.7WPVLEX2.js → chunk.HMJXB6KC.js} +2 -2
- package/dist/preview/chunk.HTEQCRVP.js +1 -0
- package/dist/preview/{chunk.VTDOWXCP.js → chunk.HU3KEWFO.js} +1 -1
- package/dist/preview/{chunk.DZ6UDZOB.js → chunk.I4H2GS4O.js} +2 -2
- package/dist/preview/{chunk.UD7VLXPM.js → chunk.I7KN732Z.js} +1 -1
- package/dist/preview/{chunk.YBQ5GVAX.js → chunk.I7OFRF6N.js} +2 -2
- package/dist/preview/{chunk.ZKXIZBCN.js → chunk.IAVIYJTL.js} +1 -1
- package/dist/preview/{chunk.CNN32262.js → chunk.IO5VFTXC.js} +1 -1
- package/dist/preview/{chunk.PIMAG4WT.js → chunk.IPKESOIU.js} +2 -2
- package/dist/preview/{chunk.42KHFGN6.js → chunk.IRNEWNUB.js} +1 -1
- package/dist/preview/{chunk.XRE7SHLD.js → chunk.ISZFRLNJ.js} +1 -1
- package/dist/preview/{chunk.GRTBEA7O.js → chunk.IY3DV52G.js} +1 -1
- package/dist/preview/{chunk.VES4XMZX.js → chunk.IYHY4VEC.js} +1 -1
- package/dist/preview/{chunk.HWFJQ42Y.js → chunk.J2N7EKMX.js} +1 -1
- package/dist/preview/{chunk.IT5DVKXY.js → chunk.J7O23NKZ.js} +2 -2
- package/dist/preview/chunk.JDUA5PH2.js +1 -0
- package/dist/preview/{chunk.DCLF4WWZ.js → chunk.JHAMSDAI.js} +1 -1
- package/dist/preview/{chunk.IKKKHHRN.js → chunk.JN3WZGJY.js} +1 -1
- package/dist/preview/{chunk.H4VNIAHN.js → chunk.JPAE6K4E.js} +1 -1
- package/dist/preview/{chunk.DGDW54KE.js → chunk.JQEXH23N.js} +1 -1
- package/dist/preview/{chunk.MPWLDQOG.js → chunk.KEGL6NBD.js} +1 -1
- package/dist/preview/{chunk.EGVM24ND.js → chunk.KHKCTVHD.js} +1 -1
- package/dist/preview/{chunk.VV5JAM5W.js → chunk.KKFKSJUN.js} +1 -1
- package/dist/preview/{chunk.Q6H5HESF.js → chunk.KLEKC4ZX.js} +1 -1
- package/dist/preview/chunk.KVQYOFDV.js +1 -0
- package/dist/preview/{chunk.ZLNUZ6LR.js → chunk.KW7PHJYX.js} +1 -1
- package/dist/preview/{chunk.PPCDPYYU.js → chunk.LAVLPYSC.js} +1 -1
- package/dist/preview/{chunk.FZELUSK5.js → chunk.LGNGFG5V.js} +1 -1
- package/dist/preview/{chunk.SADR3MQI.js → chunk.LKM2R5UF.js} +1 -1
- package/dist/preview/{chunk.42C3FIKK.js → chunk.LMZ2WMGH.js} +1 -1
- package/dist/preview/{chunk.KAM73WVF.js → chunk.MATUPDZ3.js} +1 -1
- package/dist/preview/{chunk.Z2X7BFCB.js → chunk.MD3N26BC.js} +2 -2
- package/dist/preview/{chunk.TFJA4QV4.js → chunk.MH3AQO2R.js} +1 -1
- package/dist/preview/chunk.MHHNO3O2.js +1 -0
- package/dist/preview/{chunk.DMZRFXH7.js → chunk.MKN7ADJB.js} +1 -1
- package/dist/preview/{chunk.ND3DEDWB.js → chunk.ML5EHDZG.js} +1 -1
- package/dist/preview/{chunk.Q4VFLLUT.js → chunk.MUWI54IP.js} +1 -1
- package/dist/preview/{chunk.PZQ5P6WK.js → chunk.MV27WMNW.js} +1 -1
- package/dist/preview/{chunk.6DMCEBSO.js → chunk.N7A3T5QU.js} +1 -1
- package/dist/preview/{chunk.H3IGXHZR.js → chunk.NLZHNPDU.js} +2 -2
- package/dist/preview/{chunk.4DXPPM6T.js → chunk.NRECR3NQ.js} +1 -1
- package/dist/preview/{chunk.LZ6MSQ5O.js → chunk.NSAGOOJW.js} +1 -1
- package/dist/preview/{chunk.LMTG5NPG.js → chunk.O7NYSO6F.js} +1 -1
- package/dist/preview/{chunk.2ME4DVBI.js → chunk.OD5QZHRC.js} +1 -1
- package/dist/preview/{chunk.QUETLFBJ.js → chunk.P26ATAAI.js} +1 -1
- package/dist/preview/{chunk.3JMQKANL.js → chunk.PJL3I2IW.js} +1 -1
- package/dist/preview/{chunk.6IR5LBJU.js → chunk.POKGLN4T.js} +1 -1
- package/dist/preview/{chunk.IXMIU4D4.js → chunk.PZ3KM3TY.js} +1 -1
- package/dist/preview/{chunk.MIOLBZBS.js → chunk.QEBD7SC4.js} +1 -1
- package/dist/preview/{chunk.DPHH5ZVL.js → chunk.QK7EUIPL.js} +1 -1
- package/dist/preview/{chunk.7TDML5YU.js → chunk.QNC2OKLF.js} +1 -1
- package/dist/preview/{chunk.QOQ26NXM.js → chunk.QRNKGPAD.js} +1 -1
- package/dist/preview/{chunk.QZP3ARLH.js → chunk.QVCKTDG3.js} +1 -1
- package/dist/preview/{chunk.2U6HB4XU.js → chunk.R7POSVUK.js} +1 -1
- package/dist/preview/{chunk.UFURYU4R.js → chunk.RNAL35ID.js} +1 -1
- package/dist/preview/{chunk.KUCBNMIY.js → chunk.ROYCJXPE.js} +1 -1
- package/dist/preview/chunk.RZ73YG5K.js +1 -0
- package/dist/preview/{chunk.JLDJZET2.js → chunk.S2NQRD6W.js} +1 -1
- package/dist/preview/{chunk.O32F6LGK.js → chunk.SAWASNDO.js} +1 -1
- package/dist/preview/{chunk.CFE3MHWZ.js → chunk.SCVKHGO3.js} +1 -1
- package/dist/preview/chunk.SM37MNS2.js +1 -0
- package/dist/preview/{chunk.DLSS56EU.js → chunk.T2BZBR7S.js} +1 -1
- package/dist/preview/{chunk.OQ4ZO3YY.js → chunk.T3PELB6I.js} +1 -1
- package/dist/preview/{chunk.TR4YFVZN.js → chunk.TAJBXG5U.js} +1 -1
- package/dist/preview/{chunk.3DEWQDP7.js → chunk.TLPCYKLW.js} +1 -1
- package/dist/preview/{chunk.7K2V5FUB.js → chunk.TQQDUJLX.js} +1 -1
- package/dist/preview/{chunk.CGBOPPNL.js → chunk.TQRC5VAM.js} +1 -1
- package/dist/preview/chunk.U563J5IM.js +1 -0
- package/dist/preview/{chunk.GRBWXTST.js → chunk.UAEOCWSG.js} +1 -1
- package/dist/preview/{chunk.Y7OGJOPA.js → chunk.UHJSZ2XZ.js} +1 -1
- package/dist/preview/{chunk.JGRSUTPJ.js → chunk.UPOYRCKI.js} +1 -1
- package/dist/preview/{chunk.I63462I3.js → chunk.VBBH5R5T.js} +1 -1
- package/dist/preview/chunk.VBYJBW32.js +1 -0
- package/dist/preview/{chunk.HH4D3JEI.js → chunk.VEQIH7HR.js} +1 -1
- package/dist/preview/chunk.VHLL6VC6.js +1 -0
- package/dist/preview/{chunk.VLXLBGMY.js → chunk.VQDL4EEP.js} +1 -1
- package/dist/preview/{chunk.UODTUBQ7.js → chunk.VQOYFBEV.js} +1 -1
- package/dist/preview/{chunk.H3W5C3XQ.js → chunk.VR553M6J.js} +1 -1
- package/dist/preview/{chunk.ENLIIZF2.js → chunk.VXPEXUQF.js} +1 -1
- package/dist/preview/{chunk.Z67LBSQO.js → chunk.W3WXI5B3.js} +1 -1
- package/dist/preview/{chunk.5JKUT2OM.js → chunk.W43XWQRC.js} +1 -1
- package/dist/preview/{chunk.BHJRT57H.js → chunk.WFJCC6G3.js} +1 -1
- package/dist/preview/{chunk.I34BWUB4.js → chunk.WJHLE73Y.js} +1 -1
- package/dist/preview/{chunk.MK5RPEB2.js → chunk.WQ7K5O2I.js} +1 -1
- package/dist/preview/{chunk.EP5JS7ZH.js → chunk.WV6SP6IJ.js} +1 -1
- package/dist/preview/{chunk.XXCHO2A5.js → chunk.YJ4PFOPC.js} +1 -1
- package/dist/preview/{chunk.JCETQQ7J.js → chunk.YZKHTBTC.js} +1 -1
- package/dist/preview/{chunk.CE3NKAF7.js → chunk.ZE5RSKXF.js} +1 -1
- package/dist/preview/{chunk.WV45KLXC.js → chunk.ZQYHNFRZ.js} +1 -1
- package/dist/preview/{chunk.TOUSIUJF.js → chunk.ZT3ZG52B.js} +1 -1
- package/dist/preview/{chunk.O2VXTYUJ.js → chunk.ZU3RPI34.js} +1 -1
- package/dist/preview/index.html +55 -55
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.3WPCS6KP.js +0 -1
- package/dist/preview/chunk.5L4ADKTW.js +0 -1
- package/dist/preview/chunk.6ZENHSTQ.js +0 -1
- package/dist/preview/chunk.7OL6H4LF.js +0 -1
- package/dist/preview/chunk.ARS4HJD2.js +0 -1
- package/dist/preview/chunk.C2QKA6XY.js +0 -1
- package/dist/preview/chunk.FHQ25SWY.js +0 -1
- package/dist/preview/chunk.MBTEOF4R.js +0 -1
- package/dist/preview/chunk.N64RVSH3.js +0 -1
- package/dist/preview/chunk.PI4RFOBU.js +0 -1
- package/dist/preview/chunk.Q42R2KW4.js +0 -1
- package/dist/preview/chunk.R66ZVMWB.js +0 -1
- package/dist/preview/chunk.RYA7A4NA.js +0 -1
- package/dist/preview/chunk.SUG6LIOX.js +0 -1
- package/dist/preview/chunk.U7PAFLUM.js +0 -1
- package/dist/preview/chunk.WN7SAAH6.js +0 -1
- package/dist/preview/chunk.ZMADWPJO.js +0 -1
- package/dist/preview/chunk.ZO6VMEPP.js +0 -1
- package/dist/preview/chunk.ZUG7U7AT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ot}from"./chunk.T6PU3NKP.js";import"./chunk.XXCHO2A5.js";import{e as V,l as ue,n as G,r as st}from"./chunk.SADR3MQI.js";import{a as ee}from"./chunk.G4JJXA63.js";import"./chunk.BHJRT57H.js";import{c as nt}from"./chunk.CNN32262.js";import{d as tt}from"./chunk.JGRSUTPJ.js";import"./chunk.XOZU4OFA.js";import"./chunk.EP5JS7ZH.js";import"./chunk.EGSOHTZZ.js";import"./chunk.TFJA4QV4.js";import"./chunk.HWFJQ42Y.js";import{d as et}from"./chunk.QUETLFBJ.js";import{b as Ze}from"./chunk.JULD4XFB.js";import"./chunk.GRTBEA7O.js";import{L as ze,Zd as Ne,_ as Je,_d as Xe,la as Ye,oa as qe,ta as Ae,ua as F,vb as Ve,wb as Qe}from"./chunk.6AANHELP.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var At="Nothing by that name here.",$=o=>o.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[’']/g,"'").replace(/[^\p{L}\p{N}' ]+/gu," ").replace(/\s+/g," ").trim(),Nt=/^(?:(?:can you |could you |please )?(?:go|take me|bring me|head|jump|navigate|switch|get me)(?: back)? to|(?:please )?(?:open|show(?: me)?|bring up|let me see|view)) (.+)$/,St=/^(?:(?:can you |could you |please )?tell me (?:about|of)|what(?: is|'s| are) (?:in |on )?|describe|explain|who(?: is|'s)) (.+)$/,Ot=/^(?:what(?: is|'s| am i looking at| do i see)(?: (?:here|this|on (?:this|the) (?:page|screen)|in view|this place|this page))?|where am i|describe (?:this|here|this place|this page)|tell me about (?:this|here|this place|this page))$/,rt=new Set(["here","this","this place","this page","on this page","on the page","on this screen","in view"]),Ct=/^(?:date|day|when|on|at|the date|the day)$/,jt=/^(?:what(?: is|'s) (?:wrong|broken|the (?:problem|matter|trouble))|what needs (?:fixing|attention|doing)|any (?:problems|issues|trouble)|(?:show(?: me)? |go to |open )?(?:the )?(?:problems|issues|trouble|standing|what's wrong)|is (?:anything|something) (?:wrong|broken)|are there (?:any )?(?:problems|issues))(?: (?:with|about|on|in) (.+))?$/,z=o=>o.replace(/^(?:the|a|an|my|our) /,""),te=new Set(["the","a","an","my","our","all","any","of","that","which","who","are","is","be","what","whats","what's","with","me","show","list","every","there","do","i","have","we","due","for","please","were","was","by","from","in","on"]),ft=864e5,he=o=>Date.UTC(Number(o.slice(0,4)),Number(o.slice(5,7))-1,Number(o.slice(8,10))),xe=o=>new Date(o).toISOString().slice(0,10),C=(o,i)=>xe(he(o)+i*ft),xt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Mt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wt="(monday|tuesday|tues|wednesday|thursday|thurs|friday|saturday|sunday)",it="(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sept|sep|oct|nov|dec)",at="(\\d{1,2})(?:st|nd|rd|th)?",Dt=o=>xt.findIndex(i=>i.startsWith(o.slice(0,3))),dt=o=>Mt.findIndex(i=>o.startsWith(i.toLowerCase()));function Rt(o,i){return Je(o,{year:o.slice(0,4)!==i.slice(0,4)})}function Se(o,i,y){if(o<0||i<1||i>31)return;let f=Number(y.slice(0,4)),c=k=>{let j=Date.UTC(k,o,i);return new Date(j).getUTCMonth()===o?xe(j):void 0},p=c(f);if(p)return he(p)<he(y)-183*ft?c(f+1):p}function Oe(o,i,y){let f=new Date(he(i)).getUTCDay(),c=u=>{let S=(f-y+7)%7,w=C(i,-S+u*7);return{from:w,to:C(w,6)}},p=()=>{let u=`${i.slice(0,8)}01`,S=new Date(Date.UTC(Number(i.slice(0,4)),Number(i.slice(5,7)),1));return{from:u,to:C(xe(S.getTime()),-1)}},k=u=>u?{from:u,to:u,day:Rt(u,i)}:void 0,j=(u,S)=>{let w=Dt(S);return k(u==="this"||u==="next"?C(c(u==="next"?1:0).from,(w-y+7)%7):u==="last"?C(i,-((f-w+6)%7+1)):C(i,(w-f+7)%7))},J=u=>{let S=C(i,f===0?-1:6-f);return{from:C(S,u*7),to:C(S,u*7+1)}},B="\\b(?:(?:due |for |on |by )(?:the )?)?",P=[[/\b(?:overdue|past due|late)\b/,()=>({overdue:!0,to:C(i,-1)})],[/\b(?:due |for |on )?today\b/,()=>({from:i,to:i})],[/\b(?:due |for |on )?tomorrow\b/,()=>k(C(i,1))],[/\b(?:due |for |on )?yesterday\b/,()=>k(C(i,-1))],[/\b(?:due |for |on )?this week\b/,()=>c(0)],[/\b(?:due |for |on )?next week\b/,()=>c(1)],[/\b(?:due |for |on )?(?:last|previous) week\b/,()=>c(-1)],[/\b(?:due |for |on )?next weekend\b/,()=>J(1)],[/\b(?:due |for |on )?(?:this |the )?weekend\b/,()=>J(0)],[/\b(?:due |for |on )?this month\b/,()=>p()],[new RegExp(`${B}(\\d{4}) (\\d{2}) (\\d{2})\\b`),u=>k(Se(Number(u[2])-1,Number(u[3]),`${u[1]}-01-01`))],[new RegExp(`${B}${at} (?:of )?${it}\\b`),u=>k(Se(dt(u[2]),Number(u[1]),i))],[new RegExp(`${B}${it} (?:the )?${at}\\b`),u=>k(Se(dt(u[1]),Number(u[2]),i))],[new RegExp(`${B}(?:(this|next|last|coming) )?${Wt}\\b`),u=>j(u[1],u[2])]];for(let[u,S]of P){let w=o.match(u);if(!w)continue;let N=S(w);if(N)return{ask:{words:w[0],...N},rest:o.replace(w[0]," ").replace(/\s+/g," ").trim()}}}function ht(o,i,y={}){let f=y.principal??{kind:"human"},c=o.seenBy(f),p=c.schema,k=y.today??o.today?.()??ze(),j=y.weekStartsOn??1,J=o.kindsKeptFrom(f),B=o.modules.disabledKinds,P=p.kinds.filter(e=>!J.has(e)&&!B.has(e)),u=new Set(P),S=(y.places??[]).filter(e=>e.kind===null||u.has(e.kind)),w=c.graph,N=$(i).replace(/[?.!]+$/,"").trim();if(N.length===0)return{unresolved:!0};let M=e=>p.tryDefinition(e),H=e=>Ye(M(e.kind),e),I=e=>qe(p,e),se=e=>S.find(t=>t.kind===e&&t.address===Ne(p,e))?.address??Ne(p,e),ge=e=>Xe(p,e.kind,e.id),Me=e=>({to:"record",id:e.id,kind:e.kind,label:H(e),address:ge(e),said:`Went to ${H(e)}.`}),We=e=>{let t=`Went to ${e.title}.`;return e.kind===null?{to:"place",slug:e.slug,title:e.title,address:e.address,...e.slug==="overview"?{face:"scene"}:{},said:t}:e.lens||e.address.startsWith("/places/")?{to:"picture",kind:e.kind,as:e.slug,title:e.title,address:e.address,said:t}:{to:"kind",kind:e.kind,title:e.title,address:e.address,said:t}},De=()=>({unresolved:!0,say:At}),oe=e=>{let t=M(e.kind),s=et(e,t,{limit:3,excerpt:!0}).map(r=>r.alone.startsWith(r.label)?r.alone:`${r.label.toLowerCase()} ${r.alone}`).join(", "),n=c.violations().filter(r=>r.nodeIds.includes(e.id));return[`${H(e)} \u2014 ${Ae(F(t,e.kind))}${s?` (${s})`:""}.`,n.length>0?`Trouble: ${n.map(r=>r.message).join("; ")}.`:""].filter(Boolean).join(" ")},re=e=>{let t=new Set([G(e),G(z(e))]);for(let n of[" page"," view"," lens"," place"," picture"," list"])e.endsWith(n)&&(t.add(G(e.slice(0,-n.length))),t.add(G(z(e.slice(0,-n.length)))));t.delete("");let s=n=>t.has(G(n.title))||t.has(G(z($(n.title))))||t.has(G(n.slug));return S.find(n=>n.kind!==null&&n.address.startsWith("/places/")&&s(n))??S.find(s)},pe=e=>{let t=st(o,e,{principal:f,today:k,limit:6,near:!1,...y.selection?{from:y.selection}:{}}),s=t.hits.filter(r=>r.about==="node"&&u.has(r.kind)&&w.getNode(r.id)!==void 0),n=s.filter(r=>r.why.field==="label"&&r.why.strength==="exact");return n.length===1?{one:w.getNode(n[0].id),picks:s}:n.length>1?{picks:n}:s.length===1&&t.total===1?{one:w.getNode(s[0].id),picks:s}:{picks:s}},Re=e=>{let t=e.map(s=>`${s.label} (${F(M(s.kind),s.kind)})`);return`${e.length===1?"One thing matches":`${e.length} things match`}: ${t.join("; ")}.`},Ee=(e,t)=>{if(rt.has(e))return Le();let s=t?pe(z(e)||e):void 0,n=s?.one&&$(H(s.one))===$(z(e)||e)?void 0:re(e);if(n){let l=We(n);return{about:"place",say:t?`${l.said} ${me(n)}`:l.said,moves:[l],subject:n.slug}}let r=pe(z(e)||e);if(r.one){let l=Me(r.one);return{about:t?"describe":"record",say:t?`${l.said} ${oe(r.one)}`:l.said,moves:[l],subject:r.one.id}}if(r.picks.length>0)return{about:"picks",say:Re(r.picks),moves:[],picks:r.picks};let h=ae(e);if(h)return h;let d=Pe(e);if(d){if(d.rest.split(" ").every(l=>l===""||te.has(l))){let l=I(d.kind),v={to:"kind",kind:d.kind,title:l,address:se(d.kind),said:`Went to the ${l.toLowerCase()}.`};return{about:"kind",say:v.said,moves:[v]}}return{unresolved:!0}}return De()},me=e=>{if(e.kind===null){let h=P.map(l=>({kind:l,count:w.nodesOfKind(l).length})).filter(l=>l.count>0).map(l=>`${l.count} ${(l.count===1?F(M(l.kind),l.kind):I(l.kind)).toLowerCase()}`),d=c.violations().length;return[h.length>0?`It holds ${fe(h)}.`:"It holds nothing yet.",d>0?`${d===1?"One problem":`${d} problems`} to see to.`:""].filter(Boolean).join(" ")}let t=w.nodesOfKind(e.kind).length,s=I(e.kind).toLowerCase(),n=new Set(c.violations().flatMap(h=>h.nodeIds)),r=w.nodesOfKind(e.kind).filter(h=>n.has(h.id)).length;return[e.lens?`It draws the ${s} as ${Ae(e.lens)}${t>0?` \u2014 ${t} of them`:""}.`:`${t===0?"No":t} ${t===1?F(M(e.kind),e.kind):s} ${t===1?"is":"are"} here.`,r>0?`${r} ${r===1?"has":"have"} a problem.`:""].filter(Boolean).join(" ")},Le=()=>{let e=(y.selection??[]).map(s=>w.getNode(s)).find(s=>s!==void 0);if(e)return{about:"here",say:oe(e),moves:[],subject:e.id};let t=S.find(s=>s.slug===y.place)??S.find(s=>s.slug==="home");return t?{about:"here",say:`${t.title}. ${me(t)}`,moves:[],subject:t.slug}:{about:"here",say:me({slug:"home",title:"Home",kind:null,cardinality:"many",address:"/",stop:"#"}),moves:[]}},Pe=e=>{let t=P.flatMap(s=>[I(s),F(M(s),s),s].map(n=>({kind:s,name:$(n)}))).filter(s=>s.name.length>0).sort((s,n)=>n.name.length-s.name.length);for(let{kind:s,name:n}of t)if(!(` ${e} `.indexOf(` ${n} `)<0))return{kind:s,rest:` ${e} `.replace(` ${n} `," ").replace(/\s+/g," ").trim()}},ie=(e,t)=>{let s=V(p,e).filters.filter(d=>d.about==="field"&&d.type==="date");if(s.length===0)return;let n=s.find(d=>t.some(l=>$(d.key)===l||$(d.label)===l));if(n)return n;let r=M(e)?.fieldRoles??{};for(let d of["due","deadline","date","when","start","end"]){let l=r[d],v=l?s.find(x=>x.key===l):void 0;if(v)return v}return s.find(d=>["due","deadline","date","when","on","at"].includes(d.key.toLowerCase()))??(s.length===1?s[0]:void 0)},He=e=>{let t=M(e),s=V(p,e).filters;if(t?.lifecycle)return{conditions:[{key:"is",value:"current"}],holds:d=>ue(be,d,{key:"is",value:"current"})};let r=s.find(d=>d.about==="field"&&d.type==="boolean"&&ne.has($(d.key)));if(r)return{conditions:[{key:r.key,value:"false"}],holds:d=>d[r.key]!==!0};let h=s.find(d=>d.about==="field"&&d.type==="choice"&&(d.options??[]).some(l=>ne.has($(l))));if(h){let d=new Set((h.options??[]).filter(v=>ne.has($(v)))),l=(h.options??[]).filter(v=>!d.has(v));return l.length===1?{conditions:[{key:h.key,value:l[0]}],holds:v=>v[h.key]===l[0]}:"unsayable"}return{conditions:[],holds:()=>!0}},Ie=(e,t)=>{let s=e.words.startsWith("due")||$(t.key)==="due",n=Ct.test($(t.label));if(e.day)return s?`due ${e.day}`:n?`on ${e.day}`:`${t.label.toLowerCase()} on ${e.day}`;let r=e.words.replace(/^(?:due|for|on|by) (?:the )?/,"");return s?`due ${r}`:n?r:`${t.label.toLowerCase()} ${r}`},ye=new Set(c.violations().flatMap(e=>e.nodeIds)),be={schema:p,graph:c.graph,flagged:ye,today:k},ae=e=>{let t=Oe(e,k,j),s=Pe(t?.rest??e),n=s?.kind,r=(s?.rest??t?.rest??e).split(" ").filter(Boolean);if(!n&&t){let g=e.split(" "),m=P.filter(L=>ie(L,g)!==void 0),E=m.filter(L=>{let b=ie(L,g);return g.some(O=>$(b.key)===O||$(b.label)===O)}),U=m.length===1?m:E;if(U.length!==1)return;n=U[0]}if(!n)return;let h=V(p,n).filters,d=[],l=[],v=[],x=[],q=!1,de=[];for(let g=0;g<r.length;g++){let m=r[g],E=g>0&&(r[g-1]==="not"||r[g-1]==="un"),U=h.find(b=>b.about==="field"&&b.type==="choice"&&(b.options??[]).some(O=>$(O)===m));if(U&&!E){let b=(U.options??[]).find(O=>$(O)===m);d.push({key:U.key,value:b}),l.push(b);continue}let L=h.find(b=>b.about==="field"&&b.type==="boolean"&&[$(b.key),$(b.label)].some(O=>O===m||O===m.replace(/^un/,"")));if(L){let b=!E&&!(m.startsWith("un")&&!$(L.key).startsWith("un"));d.push({key:L.key,value:String(b)}),l.push(b?m:`not ${m.replace(/^un/,"")}`);continue}if(Pt.has(m)&&!E){let b=He(n);b==="unsayable"?(q=!0,x.push(O=>!ut(p,O))):(d.push(...b.conditions),x.push(b.holds)),l.push(m);continue}m==="not"||m==="un"||t&&h.some(b=>b.type==="date"&&($(b.key)===m||$(b.label)===m))||de.push(m)}if(r=de,r.some(g=>!te.has(g))||!t&&d.length===0&&x.length===0)return;let T=I(n).toLowerCase(),Q=I(n);if(t){let g=ie(n,e.split(" "));if(!g){let m={to:"kind",kind:n,title:Q,address:se(n),said:`Went to the ${T}.`};return{about:"kind",say:`${ee(Q)} carry no date, so I can't tell which are ${/^(?:due|for|on|overdue|past due|late)\b/.test(t.ask.words)?t.ask.words:`due ${t.ask.words}`}. ${m.said}`,moves:[m]}}if(t.ask.from&&d.push({key:g.key,value:`after:${C(t.ask.from,-1)}`}),t.ask.to&&d.push({key:g.key,value:`before:${C(t.ask.to,1)}`}),t.ask.overdue){let m=He(n);m==="unsayable"?(q=!0,x.push(E=>!ut(p,E))):(d.push(...m.conditions),x.push(m.holds))}t.ask.overdue?l.push("overdue"):v.push(Ie(t.ask,g))}let R=w.nodesOfKind(n).filter(g=>d.every(m=>ue(be,g,m))&&x.every(m=>m(g))),K=[...l,...v].join(" and "),Y=[...l,T,...v].join(" "),W=R.slice(0,6).map(g=>({about:"node",id:g.id,kind:n,label:H(g),why:{field:d[0]?.key??"label",reading:d[0]?.key??"Name",fragment:K,strength:"field"},current:!0,flagged:ye.has(g.id),address:ge(g)})),X=R.length===0?`No ${T} are ${K}.`:`${R.length===1?`One ${F(M(n),n)} is`:`${R.length} ${T} are`} ${K}: ${fe(R.slice(0,6).map(H))}${R.length>6?`, and ${R.length-6} more`:""}.`;if(q)return{about:"kind",say:X,moves:[],picks:W,offer:{draft:Y,label:"Show as a view"}};let Z=d.map(g=>`${g.key}:${g.value}`).join(","),we=`${se(n)}?${new URLSearchParams({filter:Z}).toString()}`,_={to:"kind",kind:n,title:ee(Y),filter:Z,address:we,said:`Went to the ${Y}.`};return{about:"kind",say:`${_.said} ${X}`,moves:[_],picks:W}},Te=e=>M(e)?.figure==="person"?!0:[e,F(M(e),e),I(e)].some(s=>$(s).split(" ").some(n=>Et.has(n))),pt=e=>{let t=[],s=n=>M(n)?.edges??{};for(let[n,r]of Object.entries(s(e)))for(let h of r.to??[])u.has(h)&&t.push({key:n,direction:"out",far:h,words:ct(`${r.description??""} ${n}`)});for(let n of P)for(let[r,h]of Object.entries(s(n)))(h.to??[]).includes(e)&&t.push({key:r,direction:"in",far:n,words:ct(`${h.inverse??""} ${r}`)});return t},mt=e=>{let t=e.match(/^(who|which|what)\b/)?.[1];if(!t)return;let s=Oe(e,k,j);if(!s||s.ask.overdue)return;let n=s.rest.split(" ").filter(Boolean),r=P.flatMap(a=>[I(a),F(M(a),a),a].map(A=>({kind:a,name:$(A)}))).filter(a=>a.name.length>0).sort((a,A)=>A.name.length-a.name.length),h=` ${n.join(" ")} `,d=[];for(let{kind:a,name:A}of r)h.includes(` ${A} `)&&(h=h.replace(` ${A} `," "),d.includes(a)||d.push(a));let l=h.match(/\b(?:is|are|was|were)\b|'s\b/)?.[0],v=h.replace(/'s\b/g," ").split(" ").filter(a=>a.length>0&&!te.has(a)&&!Ce.has(a)),x=t==="who"?d.find(Te):d[0];if(!x&&t!=="who")return;let q=d.find(a=>a!==x),de=v.flatMap(a=>[je(a),...lt.has(je(a))?[...lt]:[]]),T=P.filter(a=>q?a===q:a!==x).flatMap(a=>{let A=ie(a,e.split(" "))??V(p,a).filters.find(D=>D.about==="field"&&D.type==="date");return A?pt(a).filter(D=>(x?D.far===x:Te(D.far))&&D.far!==a).map(D=>({kind:a,field:A,relation:D,said:v.length===0||de.some(ve=>D.words.some(vt=>Lt(vt,ve)))})):[]}).filter(a=>a.said);if(T.length===0)return;let Q=T.filter(a=>n.some(A=>$(a.field.key)===A||$(a.field.label)===A)),R=T.length===1?T[0]:Q.length===1?Q[0]:void 0;if(!R)return;let{kind:K,field:Y,relation:W}=R,X=[...s.ask.from?[{key:Y.key,value:`after:${C(s.ask.from,-1)}`}]:[],...s.ask.to?[{key:Y.key,value:`before:${C(s.ask.to,1)}`}]:[]],Z=w.nodesOfKind(K).filter(a=>X.every(A=>ue(be,a,A))),we=a=>(W.direction==="out"?c.graph.out(a.id,W.key):c.graph.in(a.id,W.key)).filter(A=>A.kind===W.far&&u.has(W.far)),_=[],g=[];for(let a of Z){let A=we(a);A.length===0&&g.push(a);for(let D of A)_.some(ve=>ve.id===D.id)||_.push(D)}let m=Ie(s.ask,Y),E=s.ask.day?`On ${s.ask.day}`:ee(s.ask.words.replace(/^(?:due|for|on|by) (?:the )?/,"")),U=I(K).toLowerCase(),L=X.map(a=>`${a.key}:${a.value}`).join(","),b=`${U} ${m}`,O={to:"kind",kind:K,title:ee(b),filter:L,address:`${se(K)}?${new URLSearchParams({filter:L}).toString()}`,said:`Went to the ${b}.`};if(Z.length===0)return{about:"related",say:`No ${b}. ${O.said}`,moves:[O]};let le=v.join(" "),yt=l==="was"||l==="were",Ge=a=>yt?a===1?"was":"were":a===1?"is":"are",ce=_.map(H),bt=ce.length>8?[...ce.slice(0,8),`${ce.length-8} more`]:ce,kt=_.length===0?`${E}: nobody ${Ge(1)}${le?` ${le}`:""}.`:`${E}: ${fe(bt)}${le?` ${Ge(_.length)} ${le}`:""}.`,$t=t==="who"&&g.length>0?`${fe(g.slice(0,4).map(H))}${g.length>4?` and ${g.length-4} more`:""} ${g.length===1?"has":"have"} nobody.`:"",wt=_.slice(0,8).map(a=>({about:"node",id:a.id,kind:a.kind,label:H(a),why:{field:W.key,reading:Ze(p,W.direction==="out"?K:W.far,W.key,W.direction==="out"?"out":"in"),fragment:m,strength:"field"},current:!0,flagged:ye.has(a.id),address:ge(a)}));return{about:"related",say:[kt,$t,O.said].filter(Boolean).join(" "),moves:[O],picks:wt}},Ke=N.match(jt);if(Ke){let e=Ke[1];if(e&&!rt.has(e)&&!/^(?:it|this|that)$/.test(e)){let n=re(e),r=n?void 0:pe(z(e)||e);if(r?.one){let h=Me(r.one);return{about:"describe",say:`${h.said} ${oe(r.one)}`,moves:[h],subject:r.one.id}}if(!n)return r&&r.picks.length>0?{about:"picks",say:Re(r.picks),moves:[],picks:r.picks}:De()}if(e&&/^(?:it|this|that)$|^(?:here|this place|this page)$/.test(e)){let n=(y.selection??[]).map(r=>w.getNode(r)).find(r=>r!==void 0);if(n)return{about:"describe",say:oe(n),moves:[],subject:n.id}}let t=c.violations();if(t.length===0)return{about:"problems",say:"Nothing is wrong \u2014 every rule holds.",moves:[]};let s={to:"problems",address:"/problems",said:"Went to the problems."};return{about:"problems",say:`${s.said} ${Qe(t)}: ${t.slice(0,4).map(n=>n.message).join("; ")}${t.length>4?"\u2026":"."}`,moves:[s]}}if(Ot.test(N))return Le();let _e=mt(N);if(_e)return _e;let ke=Oe(N,k,j);if(ke&&!re(z(ke.ask.words))&&ke.rest.replace(/'s\b/g,"").split(" ").every(e=>e===""||te.has(e)||Ce.has(e))){let e=ae(N);if(e)return e}if(/^open /.test(N)){let e=ae(N);if(e)return e}let Fe=N.match(Nt)??N.match(/^(?:go|take me|head|get me)(?: back)? (home)$/);if(Fe)return Ee(Fe[1].trim(),!1);let Be=N.match(St);if(Be){let e=Ee(Be[1].trim(),!0);return"unresolved"in e&&e.unresolved&&!/^tell me|^describe/.test(N)?{unresolved:!0}:e}let $e=re(N);if($e){let e=We($e);return{about:"place",say:e.said,moves:[e],subject:$e.slug}}let Ue=ae(N);return Ue||{unresolved:!0}}var Ce=new Set(["who","whom","whose","which","what","whats","what's","who's"]),Et=new Set(["person","people","user","users","member","members","volunteer","volunteers","gardener","gardeners","player","players","staff","worker","workers","employee","employees","owner","owners","assignee","assignees","helper","helpers","student","students","teacher","teachers","customer","customers","client","clients","contact","contacts","author","authors"]),lt=new Set(["work","cover","staff","assign","do","run","schedul","roster","book","duty","serv","help"]);function je(o){let i=o.toLowerCase().replace(/'s$/,"");for(let y of["ing","ed","es","s"])if(i.length>y.length+2&&i.endsWith(y)){let f=i.slice(0,-y.length);return f.length>3&&f[f.length-1]===f[f.length-2]?f.slice(0,-1):f}return i}function ct(o){return o.toLowerCase().split(/[^a-z']+/).filter(i=>i.length>1&&!te.has(i)&&!Ce.has(i)&&!["it","they","them","their","its","this","here","to","at"].includes(i)).map(je)}var Lt=(o,i)=>o===i||o.length>=4&&i.length>=4&&(o.startsWith(i)||i.startsWith(o)),ne=new Set(["done","finished","complete","completed","closed","resolved","agreed","canceled","archived","shipped","delivered"]),Pt=new Set(["open","unfinished","outstanding","pending","remaining","undone","incomplete"]);function ut(o,i){return V(o,i.kind).filters.some(f=>f.about==="field"&&(f.type==="boolean"&&ne.has(f.key.toLowerCase())&&i[f.key]===!0||f.type==="choice"&&typeof i[f.key]=="string"&&ne.has(String(i[f.key]).toLowerCase())))}function fe(o){return o.length<=1?o[0]??"":`${o.slice(0,-1).join(", ")} and ${o[o.length-1]}`}function zt(o,i,y={}){let f=y.scene!==void 0?{...y.pages,scene:y.scene}:y.pages;return[...nt(o,i,f?{pages:f}:{})].map(({first:c,hidden:p,lens:k,...j})=>j)}function gt(o,i){return{...o.principal?{principal:o.principal}:{},...o.places?{places:o.places}:{},...o.selection?{selection:o.selection}:{},...o.place?{place:o.place}:{},...i??o.today?{today:i??o.today}:{},...o.weekStartsOn!==void 0?{weekStartsOn:o.weekStartsOn}:{}}}function Jt(o,i,y,f){let c=ht(o,i,gt(y,f));if(c.unresolved)return c.say?{reply:{say:c.say,proposals:[],grounded:!0}}:{};if(c.about==="picks")return{};let p=c.moves.length>0?{moves:c.moves}:{},k=c.subject?o.graph.getNode(c.subject):void 0;if(c.about==="problems")return{...p,problems:!0};if(k&&(c.about==="describe"||c.about==="here"))return{...p,told:k.id};let j=k?tt(o,ot(Ve(o.violations(),[k.id])).slice(0,3)):[];return{reply:{say:c.say,proposals:j,grounded:!0,...p,...c.picks&&c.picks.length>0?{picks:c.picks}:{},...c.offer?{offer:c.offer}:{}}}}function Yt(o,i,y={}){let f=gt(y),c=[];for(let p of i){let k=typeof p=="string"?p:typeof p=="object"&&p!==null&&typeof p.to=="string"?p.to:void 0;if(!k||k.trim().length===0)continue;let j=ht(o,/^(?:go|take me|open|show)\b/i.test(k.trim())?k:`go to ${k}`,f);if("moves"in j)for(let J of j.moves)c.some(B=>B.address===J.address)||c.push(J)}return c}export{At as NOTHING_BY_THAT_NAME,gt as askContextOf,Jt as goingFrom,Yt as movesFromNames,zt as placesFromViews,ht as resolveAsk};
|
|
1
|
+
import{a as ot}from"./chunk.T6PU3NKP.js";import"./chunk.YJ4PFOPC.js";import{e as V,l as ue,n as G,r as st}from"./chunk.LKM2R5UF.js";import{a as ee}from"./chunk.G4JJXA63.js";import"./chunk.WFJCC6G3.js";import{c as nt}from"./chunk.IO5VFTXC.js";import{d as tt}from"./chunk.UPOYRCKI.js";import"./chunk.XOZU4OFA.js";import"./chunk.WV6SP6IJ.js";import"./chunk.HCX6KPRF.js";import"./chunk.MH3AQO2R.js";import"./chunk.J2N7EKMX.js";import{d as et}from"./chunk.P26ATAAI.js";import{b as Ze}from"./chunk.FIY4RUK5.js";import"./chunk.IY3DV52G.js";import{L as ze,Zd as Ne,_ as Je,_d as Xe,la as Ye,oa as qe,ta as Ae,ua as F,vb as Ve,wb as Qe}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var At="Nothing by that name here.",$=o=>o.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[’']/g,"'").replace(/[^\p{L}\p{N}' ]+/gu," ").replace(/\s+/g," ").trim(),Nt=/^(?:(?:can you |could you |please )?(?:go|take me|bring me|head|jump|navigate|switch|get me)(?: back)? to|(?:please )?(?:open|show(?: me)?|bring up|let me see|view)) (.+)$/,St=/^(?:(?:can you |could you |please )?tell me (?:about|of)|what(?: is|'s| are) (?:in |on )?|describe|explain|who(?: is|'s)) (.+)$/,Ot=/^(?:what(?: is|'s| am i looking at| do i see)(?: (?:here|this|on (?:this|the) (?:page|screen)|in view|this place|this page))?|where am i|describe (?:this|here|this place|this page)|tell me about (?:this|here|this place|this page))$/,rt=new Set(["here","this","this place","this page","on this page","on the page","on this screen","in view"]),Ct=/^(?:date|day|when|on|at|the date|the day)$/,jt=/^(?:what(?: is|'s) (?:wrong|broken|the (?:problem|matter|trouble))|what needs (?:fixing|attention|doing)|any (?:problems|issues|trouble)|(?:show(?: me)? |go to |open )?(?:the )?(?:problems|issues|trouble|standing|what's wrong)|is (?:anything|something) (?:wrong|broken)|are there (?:any )?(?:problems|issues))(?: (?:with|about|on|in) (.+))?$/,z=o=>o.replace(/^(?:the|a|an|my|our) /,""),te=new Set(["the","a","an","my","our","all","any","of","that","which","who","are","is","be","what","whats","what's","with","me","show","list","every","there","do","i","have","we","due","for","please","were","was","by","from","in","on"]),ft=864e5,he=o=>Date.UTC(Number(o.slice(0,4)),Number(o.slice(5,7))-1,Number(o.slice(8,10))),xe=o=>new Date(o).toISOString().slice(0,10),C=(o,i)=>xe(he(o)+i*ft),xt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Mt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wt="(monday|tuesday|tues|wednesday|thursday|thurs|friday|saturday|sunday)",it="(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sept|sep|oct|nov|dec)",at="(\\d{1,2})(?:st|nd|rd|th)?",Dt=o=>xt.findIndex(i=>i.startsWith(o.slice(0,3))),dt=o=>Mt.findIndex(i=>o.startsWith(i.toLowerCase()));function Rt(o,i){return Je(o,{year:o.slice(0,4)!==i.slice(0,4)})}function Se(o,i,y){if(o<0||i<1||i>31)return;let f=Number(y.slice(0,4)),c=k=>{let j=Date.UTC(k,o,i);return new Date(j).getUTCMonth()===o?xe(j):void 0},p=c(f);if(p)return he(p)<he(y)-183*ft?c(f+1):p}function Oe(o,i,y){let f=new Date(he(i)).getUTCDay(),c=u=>{let S=(f-y+7)%7,w=C(i,-S+u*7);return{from:w,to:C(w,6)}},p=()=>{let u=`${i.slice(0,8)}01`,S=new Date(Date.UTC(Number(i.slice(0,4)),Number(i.slice(5,7)),1));return{from:u,to:C(xe(S.getTime()),-1)}},k=u=>u?{from:u,to:u,day:Rt(u,i)}:void 0,j=(u,S)=>{let w=Dt(S);return k(u==="this"||u==="next"?C(c(u==="next"?1:0).from,(w-y+7)%7):u==="last"?C(i,-((f-w+6)%7+1)):C(i,(w-f+7)%7))},J=u=>{let S=C(i,f===0?-1:6-f);return{from:C(S,u*7),to:C(S,u*7+1)}},B="\\b(?:(?:due |for |on |by )(?:the )?)?",P=[[/\b(?:overdue|past due|late)\b/,()=>({overdue:!0,to:C(i,-1)})],[/\b(?:due |for |on )?today\b/,()=>({from:i,to:i})],[/\b(?:due |for |on )?tomorrow\b/,()=>k(C(i,1))],[/\b(?:due |for |on )?yesterday\b/,()=>k(C(i,-1))],[/\b(?:due |for |on )?this week\b/,()=>c(0)],[/\b(?:due |for |on )?next week\b/,()=>c(1)],[/\b(?:due |for |on )?(?:last|previous) week\b/,()=>c(-1)],[/\b(?:due |for |on )?next weekend\b/,()=>J(1)],[/\b(?:due |for |on )?(?:this |the )?weekend\b/,()=>J(0)],[/\b(?:due |for |on )?this month\b/,()=>p()],[new RegExp(`${B}(\\d{4}) (\\d{2}) (\\d{2})\\b`),u=>k(Se(Number(u[2])-1,Number(u[3]),`${u[1]}-01-01`))],[new RegExp(`${B}${at} (?:of )?${it}\\b`),u=>k(Se(dt(u[2]),Number(u[1]),i))],[new RegExp(`${B}${it} (?:the )?${at}\\b`),u=>k(Se(dt(u[1]),Number(u[2]),i))],[new RegExp(`${B}(?:(this|next|last|coming) )?${Wt}\\b`),u=>j(u[1],u[2])]];for(let[u,S]of P){let w=o.match(u);if(!w)continue;let N=S(w);if(N)return{ask:{words:w[0],...N},rest:o.replace(w[0]," ").replace(/\s+/g," ").trim()}}}function ht(o,i,y={}){let f=y.principal??{kind:"human"},c=o.seenBy(f),p=c.schema,k=y.today??o.today?.()??ze(),j=y.weekStartsOn??1,J=o.kindsKeptFrom(f),B=o.modules.disabledKinds,P=p.kinds.filter(e=>!J.has(e)&&!B.has(e)),u=new Set(P),S=(y.places??[]).filter(e=>e.kind===null||u.has(e.kind)),w=c.graph,N=$(i).replace(/[?.!]+$/,"").trim();if(N.length===0)return{unresolved:!0};let M=e=>p.tryDefinition(e),H=e=>Ye(M(e.kind),e),I=e=>qe(p,e),se=e=>S.find(t=>t.kind===e&&t.address===Ne(p,e))?.address??Ne(p,e),ge=e=>Xe(p,e.kind,e.id),Me=e=>({to:"record",id:e.id,kind:e.kind,label:H(e),address:ge(e),said:`Went to ${H(e)}.`}),We=e=>{let t=`Went to ${e.title}.`;return e.kind===null?{to:"place",slug:e.slug,title:e.title,address:e.address,...e.slug==="overview"?{face:"scene"}:{},said:t}:e.lens||e.address.startsWith("/places/")?{to:"picture",kind:e.kind,as:e.slug,title:e.title,address:e.address,said:t}:{to:"kind",kind:e.kind,title:e.title,address:e.address,said:t}},De=()=>({unresolved:!0,say:At}),oe=e=>{let t=M(e.kind),s=et(e,t,{limit:3,excerpt:!0}).map(r=>r.alone.startsWith(r.label)?r.alone:`${r.label.toLowerCase()} ${r.alone}`).join(", "),n=c.violations().filter(r=>r.nodeIds.includes(e.id));return[`${H(e)} \u2014 ${Ae(F(t,e.kind))}${s?` (${s})`:""}.`,n.length>0?`Trouble: ${n.map(r=>r.message).join("; ")}.`:""].filter(Boolean).join(" ")},re=e=>{let t=new Set([G(e),G(z(e))]);for(let n of[" page"," view"," lens"," place"," picture"," list"])e.endsWith(n)&&(t.add(G(e.slice(0,-n.length))),t.add(G(z(e.slice(0,-n.length)))));t.delete("");let s=n=>t.has(G(n.title))||t.has(G(z($(n.title))))||t.has(G(n.slug));return S.find(n=>n.kind!==null&&n.address.startsWith("/places/")&&s(n))??S.find(s)},pe=e=>{let t=st(o,e,{principal:f,today:k,limit:6,near:!1,...y.selection?{from:y.selection}:{}}),s=t.hits.filter(r=>r.about==="node"&&u.has(r.kind)&&w.getNode(r.id)!==void 0),n=s.filter(r=>r.why.field==="label"&&r.why.strength==="exact");return n.length===1?{one:w.getNode(n[0].id),picks:s}:n.length>1?{picks:n}:s.length===1&&t.total===1?{one:w.getNode(s[0].id),picks:s}:{picks:s}},Re=e=>{let t=e.map(s=>`${s.label} (${F(M(s.kind),s.kind)})`);return`${e.length===1?"One thing matches":`${e.length} things match`}: ${t.join("; ")}.`},Ee=(e,t)=>{if(rt.has(e))return Le();let s=t?pe(z(e)||e):void 0,n=s?.one&&$(H(s.one))===$(z(e)||e)?void 0:re(e);if(n){let l=We(n);return{about:"place",say:t?`${l.said} ${me(n)}`:l.said,moves:[l],subject:n.slug}}let r=pe(z(e)||e);if(r.one){let l=Me(r.one);return{about:t?"describe":"record",say:t?`${l.said} ${oe(r.one)}`:l.said,moves:[l],subject:r.one.id}}if(r.picks.length>0)return{about:"picks",say:Re(r.picks),moves:[],picks:r.picks};let h=ae(e);if(h)return h;let d=Pe(e);if(d){if(d.rest.split(" ").every(l=>l===""||te.has(l))){let l=I(d.kind),v={to:"kind",kind:d.kind,title:l,address:se(d.kind),said:`Went to the ${l.toLowerCase()}.`};return{about:"kind",say:v.said,moves:[v]}}return{unresolved:!0}}return De()},me=e=>{if(e.kind===null){let h=P.map(l=>({kind:l,count:w.nodesOfKind(l).length})).filter(l=>l.count>0).map(l=>`${l.count} ${(l.count===1?F(M(l.kind),l.kind):I(l.kind)).toLowerCase()}`),d=c.violations().length;return[h.length>0?`It holds ${fe(h)}.`:"It holds nothing yet.",d>0?`${d===1?"One problem":`${d} problems`} to see to.`:""].filter(Boolean).join(" ")}let t=w.nodesOfKind(e.kind).length,s=I(e.kind).toLowerCase(),n=new Set(c.violations().flatMap(h=>h.nodeIds)),r=w.nodesOfKind(e.kind).filter(h=>n.has(h.id)).length;return[e.lens?`It draws the ${s} as ${Ae(e.lens)}${t>0?` \u2014 ${t} of them`:""}.`:`${t===0?"No":t} ${t===1?F(M(e.kind),e.kind):s} ${t===1?"is":"are"} here.`,r>0?`${r} ${r===1?"has":"have"} a problem.`:""].filter(Boolean).join(" ")},Le=()=>{let e=(y.selection??[]).map(s=>w.getNode(s)).find(s=>s!==void 0);if(e)return{about:"here",say:oe(e),moves:[],subject:e.id};let t=S.find(s=>s.slug===y.place)??S.find(s=>s.slug==="home");return t?{about:"here",say:`${t.title}. ${me(t)}`,moves:[],subject:t.slug}:{about:"here",say:me({slug:"home",title:"Home",kind:null,cardinality:"many",address:"/",stop:"#"}),moves:[]}},Pe=e=>{let t=P.flatMap(s=>[I(s),F(M(s),s),s].map(n=>({kind:s,name:$(n)}))).filter(s=>s.name.length>0).sort((s,n)=>n.name.length-s.name.length);for(let{kind:s,name:n}of t)if(!(` ${e} `.indexOf(` ${n} `)<0))return{kind:s,rest:` ${e} `.replace(` ${n} `," ").replace(/\s+/g," ").trim()}},ie=(e,t)=>{let s=V(p,e).filters.filter(d=>d.about==="field"&&d.type==="date");if(s.length===0)return;let n=s.find(d=>t.some(l=>$(d.key)===l||$(d.label)===l));if(n)return n;let r=M(e)?.fieldRoles??{};for(let d of["due","deadline","date","when","start","end"]){let l=r[d],v=l?s.find(x=>x.key===l):void 0;if(v)return v}return s.find(d=>["due","deadline","date","when","on","at"].includes(d.key.toLowerCase()))??(s.length===1?s[0]:void 0)},He=e=>{let t=M(e),s=V(p,e).filters;if(t?.lifecycle)return{conditions:[{key:"is",value:"current"}],holds:d=>ue(be,d,{key:"is",value:"current"})};let r=s.find(d=>d.about==="field"&&d.type==="boolean"&&ne.has($(d.key)));if(r)return{conditions:[{key:r.key,value:"false"}],holds:d=>d[r.key]!==!0};let h=s.find(d=>d.about==="field"&&d.type==="choice"&&(d.options??[]).some(l=>ne.has($(l))));if(h){let d=new Set((h.options??[]).filter(v=>ne.has($(v)))),l=(h.options??[]).filter(v=>!d.has(v));return l.length===1?{conditions:[{key:h.key,value:l[0]}],holds:v=>v[h.key]===l[0]}:"unsayable"}return{conditions:[],holds:()=>!0}},Ie=(e,t)=>{let s=e.words.startsWith("due")||$(t.key)==="due",n=Ct.test($(t.label));if(e.day)return s?`due ${e.day}`:n?`on ${e.day}`:`${t.label.toLowerCase()} on ${e.day}`;let r=e.words.replace(/^(?:due|for|on|by) (?:the )?/,"");return s?`due ${r}`:n?r:`${t.label.toLowerCase()} ${r}`},ye=new Set(c.violations().flatMap(e=>e.nodeIds)),be={schema:p,graph:c.graph,flagged:ye,today:k},ae=e=>{let t=Oe(e,k,j),s=Pe(t?.rest??e),n=s?.kind,r=(s?.rest??t?.rest??e).split(" ").filter(Boolean);if(!n&&t){let g=e.split(" "),m=P.filter(L=>ie(L,g)!==void 0),E=m.filter(L=>{let b=ie(L,g);return g.some(O=>$(b.key)===O||$(b.label)===O)}),U=m.length===1?m:E;if(U.length!==1)return;n=U[0]}if(!n)return;let h=V(p,n).filters,d=[],l=[],v=[],x=[],q=!1,de=[];for(let g=0;g<r.length;g++){let m=r[g],E=g>0&&(r[g-1]==="not"||r[g-1]==="un"),U=h.find(b=>b.about==="field"&&b.type==="choice"&&(b.options??[]).some(O=>$(O)===m));if(U&&!E){let b=(U.options??[]).find(O=>$(O)===m);d.push({key:U.key,value:b}),l.push(b);continue}let L=h.find(b=>b.about==="field"&&b.type==="boolean"&&[$(b.key),$(b.label)].some(O=>O===m||O===m.replace(/^un/,"")));if(L){let b=!E&&!(m.startsWith("un")&&!$(L.key).startsWith("un"));d.push({key:L.key,value:String(b)}),l.push(b?m:`not ${m.replace(/^un/,"")}`);continue}if(Pt.has(m)&&!E){let b=He(n);b==="unsayable"?(q=!0,x.push(O=>!ut(p,O))):(d.push(...b.conditions),x.push(b.holds)),l.push(m);continue}m==="not"||m==="un"||t&&h.some(b=>b.type==="date"&&($(b.key)===m||$(b.label)===m))||de.push(m)}if(r=de,r.some(g=>!te.has(g))||!t&&d.length===0&&x.length===0)return;let T=I(n).toLowerCase(),Q=I(n);if(t){let g=ie(n,e.split(" "));if(!g){let m={to:"kind",kind:n,title:Q,address:se(n),said:`Went to the ${T}.`};return{about:"kind",say:`${ee(Q)} carry no date, so I can't tell which are ${/^(?:due|for|on|overdue|past due|late)\b/.test(t.ask.words)?t.ask.words:`due ${t.ask.words}`}. ${m.said}`,moves:[m]}}if(t.ask.from&&d.push({key:g.key,value:`after:${C(t.ask.from,-1)}`}),t.ask.to&&d.push({key:g.key,value:`before:${C(t.ask.to,1)}`}),t.ask.overdue){let m=He(n);m==="unsayable"?(q=!0,x.push(E=>!ut(p,E))):(d.push(...m.conditions),x.push(m.holds))}t.ask.overdue?l.push("overdue"):v.push(Ie(t.ask,g))}let R=w.nodesOfKind(n).filter(g=>d.every(m=>ue(be,g,m))&&x.every(m=>m(g))),K=[...l,...v].join(" and "),Y=[...l,T,...v].join(" "),W=R.slice(0,6).map(g=>({about:"node",id:g.id,kind:n,label:H(g),why:{field:d[0]?.key??"label",reading:d[0]?.key??"Name",fragment:K,strength:"field"},current:!0,flagged:ye.has(g.id),address:ge(g)})),X=R.length===0?`No ${T} are ${K}.`:`${R.length===1?`One ${F(M(n),n)} is`:`${R.length} ${T} are`} ${K}: ${fe(R.slice(0,6).map(H))}${R.length>6?`, and ${R.length-6} more`:""}.`;if(q)return{about:"kind",say:X,moves:[],picks:W,offer:{draft:Y,label:"Show as a view"}};let Z=d.map(g=>`${g.key}:${g.value}`).join(","),we=`${se(n)}?${new URLSearchParams({filter:Z}).toString()}`,_={to:"kind",kind:n,title:ee(Y),filter:Z,address:we,said:`Went to the ${Y}.`};return{about:"kind",say:`${_.said} ${X}`,moves:[_],picks:W}},Te=e=>M(e)?.figure==="person"?!0:[e,F(M(e),e),I(e)].some(s=>$(s).split(" ").some(n=>Et.has(n))),pt=e=>{let t=[],s=n=>M(n)?.edges??{};for(let[n,r]of Object.entries(s(e)))for(let h of r.to??[])u.has(h)&&t.push({key:n,direction:"out",far:h,words:ct(`${r.description??""} ${n}`)});for(let n of P)for(let[r,h]of Object.entries(s(n)))(h.to??[]).includes(e)&&t.push({key:r,direction:"in",far:n,words:ct(`${h.inverse??""} ${r}`)});return t},mt=e=>{let t=e.match(/^(who|which|what)\b/)?.[1];if(!t)return;let s=Oe(e,k,j);if(!s||s.ask.overdue)return;let n=s.rest.split(" ").filter(Boolean),r=P.flatMap(a=>[I(a),F(M(a),a),a].map(A=>({kind:a,name:$(A)}))).filter(a=>a.name.length>0).sort((a,A)=>A.name.length-a.name.length),h=` ${n.join(" ")} `,d=[];for(let{kind:a,name:A}of r)h.includes(` ${A} `)&&(h=h.replace(` ${A} `," "),d.includes(a)||d.push(a));let l=h.match(/\b(?:is|are|was|were)\b|'s\b/)?.[0],v=h.replace(/'s\b/g," ").split(" ").filter(a=>a.length>0&&!te.has(a)&&!Ce.has(a)),x=t==="who"?d.find(Te):d[0];if(!x&&t!=="who")return;let q=d.find(a=>a!==x),de=v.flatMap(a=>[je(a),...lt.has(je(a))?[...lt]:[]]),T=P.filter(a=>q?a===q:a!==x).flatMap(a=>{let A=ie(a,e.split(" "))??V(p,a).filters.find(D=>D.about==="field"&&D.type==="date");return A?pt(a).filter(D=>(x?D.far===x:Te(D.far))&&D.far!==a).map(D=>({kind:a,field:A,relation:D,said:v.length===0||de.some(ve=>D.words.some(vt=>Lt(vt,ve)))})):[]}).filter(a=>a.said);if(T.length===0)return;let Q=T.filter(a=>n.some(A=>$(a.field.key)===A||$(a.field.label)===A)),R=T.length===1?T[0]:Q.length===1?Q[0]:void 0;if(!R)return;let{kind:K,field:Y,relation:W}=R,X=[...s.ask.from?[{key:Y.key,value:`after:${C(s.ask.from,-1)}`}]:[],...s.ask.to?[{key:Y.key,value:`before:${C(s.ask.to,1)}`}]:[]],Z=w.nodesOfKind(K).filter(a=>X.every(A=>ue(be,a,A))),we=a=>(W.direction==="out"?c.graph.out(a.id,W.key):c.graph.in(a.id,W.key)).filter(A=>A.kind===W.far&&u.has(W.far)),_=[],g=[];for(let a of Z){let A=we(a);A.length===0&&g.push(a);for(let D of A)_.some(ve=>ve.id===D.id)||_.push(D)}let m=Ie(s.ask,Y),E=s.ask.day?`On ${s.ask.day}`:ee(s.ask.words.replace(/^(?:due|for|on|by) (?:the )?/,"")),U=I(K).toLowerCase(),L=X.map(a=>`${a.key}:${a.value}`).join(","),b=`${U} ${m}`,O={to:"kind",kind:K,title:ee(b),filter:L,address:`${se(K)}?${new URLSearchParams({filter:L}).toString()}`,said:`Went to the ${b}.`};if(Z.length===0)return{about:"related",say:`No ${b}. ${O.said}`,moves:[O]};let le=v.join(" "),yt=l==="was"||l==="were",Ge=a=>yt?a===1?"was":"were":a===1?"is":"are",ce=_.map(H),bt=ce.length>8?[...ce.slice(0,8),`${ce.length-8} more`]:ce,kt=_.length===0?`${E}: nobody ${Ge(1)}${le?` ${le}`:""}.`:`${E}: ${fe(bt)}${le?` ${Ge(_.length)} ${le}`:""}.`,$t=t==="who"&&g.length>0?`${fe(g.slice(0,4).map(H))}${g.length>4?` and ${g.length-4} more`:""} ${g.length===1?"has":"have"} nobody.`:"",wt=_.slice(0,8).map(a=>({about:"node",id:a.id,kind:a.kind,label:H(a),why:{field:W.key,reading:Ze(p,W.direction==="out"?K:W.far,W.key,W.direction==="out"?"out":"in"),fragment:m,strength:"field"},current:!0,flagged:ye.has(a.id),address:ge(a)}));return{about:"related",say:[kt,$t,O.said].filter(Boolean).join(" "),moves:[O],picks:wt}},Ke=N.match(jt);if(Ke){let e=Ke[1];if(e&&!rt.has(e)&&!/^(?:it|this|that)$/.test(e)){let n=re(e),r=n?void 0:pe(z(e)||e);if(r?.one){let h=Me(r.one);return{about:"describe",say:`${h.said} ${oe(r.one)}`,moves:[h],subject:r.one.id}}if(!n)return r&&r.picks.length>0?{about:"picks",say:Re(r.picks),moves:[],picks:r.picks}:De()}if(e&&/^(?:it|this|that)$|^(?:here|this place|this page)$/.test(e)){let n=(y.selection??[]).map(r=>w.getNode(r)).find(r=>r!==void 0);if(n)return{about:"describe",say:oe(n),moves:[],subject:n.id}}let t=c.violations();if(t.length===0)return{about:"problems",say:"Nothing is wrong \u2014 every rule holds.",moves:[]};let s={to:"problems",address:"/problems",said:"Went to the problems."};return{about:"problems",say:`${s.said} ${Qe(t)}: ${t.slice(0,4).map(n=>n.message).join("; ")}${t.length>4?"\u2026":"."}`,moves:[s]}}if(Ot.test(N))return Le();let _e=mt(N);if(_e)return _e;let ke=Oe(N,k,j);if(ke&&!re(z(ke.ask.words))&&ke.rest.replace(/'s\b/g,"").split(" ").every(e=>e===""||te.has(e)||Ce.has(e))){let e=ae(N);if(e)return e}if(/^open /.test(N)){let e=ae(N);if(e)return e}let Fe=N.match(Nt)??N.match(/^(?:go|take me|head|get me)(?: back)? (home)$/);if(Fe)return Ee(Fe[1].trim(),!1);let Be=N.match(St);if(Be){let e=Ee(Be[1].trim(),!0);return"unresolved"in e&&e.unresolved&&!/^tell me|^describe/.test(N)?{unresolved:!0}:e}let $e=re(N);if($e){let e=We($e);return{about:"place",say:e.said,moves:[e],subject:$e.slug}}let Ue=ae(N);return Ue||{unresolved:!0}}var Ce=new Set(["who","whom","whose","which","what","whats","what's","who's"]),Et=new Set(["person","people","user","users","member","members","volunteer","volunteers","gardener","gardeners","player","players","staff","worker","workers","employee","employees","owner","owners","assignee","assignees","helper","helpers","student","students","teacher","teachers","customer","customers","client","clients","contact","contacts","author","authors"]),lt=new Set(["work","cover","staff","assign","do","run","schedul","roster","book","duty","serv","help"]);function je(o){let i=o.toLowerCase().replace(/'s$/,"");for(let y of["ing","ed","es","s"])if(i.length>y.length+2&&i.endsWith(y)){let f=i.slice(0,-y.length);return f.length>3&&f[f.length-1]===f[f.length-2]?f.slice(0,-1):f}return i}function ct(o){return o.toLowerCase().split(/[^a-z']+/).filter(i=>i.length>1&&!te.has(i)&&!Ce.has(i)&&!["it","they","them","their","its","this","here","to","at"].includes(i)).map(je)}var Lt=(o,i)=>o===i||o.length>=4&&i.length>=4&&(o.startsWith(i)||i.startsWith(o)),ne=new Set(["done","finished","complete","completed","closed","resolved","agreed","canceled","archived","shipped","delivered"]),Pt=new Set(["open","unfinished","outstanding","pending","remaining","undone","incomplete"]);function ut(o,i){return V(o,i.kind).filters.some(f=>f.about==="field"&&(f.type==="boolean"&&ne.has(f.key.toLowerCase())&&i[f.key]===!0||f.type==="choice"&&typeof i[f.key]=="string"&&ne.has(String(i[f.key]).toLowerCase())))}function fe(o){return o.length<=1?o[0]??"":`${o.slice(0,-1).join(", ")} and ${o[o.length-1]}`}function zt(o,i,y={}){let f=y.scene!==void 0?{...y.pages,scene:y.scene}:y.pages;return[...nt(o,i,f?{pages:f}:{})].map(({first:c,hidden:p,lens:k,...j})=>j)}function gt(o,i){return{...o.principal?{principal:o.principal}:{},...o.places?{places:o.places}:{},...o.selection?{selection:o.selection}:{},...o.place?{place:o.place}:{},...i??o.today?{today:i??o.today}:{},...o.weekStartsOn!==void 0?{weekStartsOn:o.weekStartsOn}:{}}}function Jt(o,i,y,f){let c=ht(o,i,gt(y,f));if(c.unresolved)return c.say?{reply:{say:c.say,proposals:[],grounded:!0}}:{};if(c.about==="picks")return{};let p=c.moves.length>0?{moves:c.moves}:{},k=c.subject?o.graph.getNode(c.subject):void 0;if(c.about==="problems")return{...p,problems:!0};if(k&&(c.about==="describe"||c.about==="here"))return{...p,told:k.id};let j=k?tt(o,ot(Ve(o.violations(),[k.id])).slice(0,3)):[];return{reply:{say:c.say,proposals:j,grounded:!0,...p,...c.picks&&c.picks.length>0?{picks:c.picks}:{},...c.offer?{offer:c.offer}:{}}}}function Yt(o,i,y={}){let f=gt(y),c=[];for(let p of i){let k=typeof p=="string"?p:typeof p=="object"&&p!==null&&typeof p.to=="string"?p.to:void 0;if(!k||k.trim().length===0)continue;let j=ht(o,/^(?:go|take me|open|show)\b/i.test(k.trim())?k:`go to ${k}`,f);if("moves"in j)for(let J of j.moves)c.some(B=>B.address===J.address)||c.push(J)}return c}export{At as NOTHING_BY_THAT_NAME,gt as askContextOf,Jt as goingFrom,Yt as movesFromNames,zt as placesFromViews,ht as resolveAsk};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as ne}from"./chunk.RQG672MJ.js";import{p as Te,q as te,t as H,u as xe,y as Ie}from"./chunk.CFE3MHWZ.js";import{m as X,n as Me,o as Ae,p as Z,q as ee}from"./chunk.RD2FSSLV.js";import{b as Ee}from"./chunk.JULD4XFB.js";import{b as Se,d as U,e as J,g as be,q as De}from"./chunk.H3IGXHZR.js";import{b as he}from"./chunk.7TDML5YU.js";import{D as W,F as j,G as N,J as ve,Ja as we,Ka as ke,La as I,Pa as V,R as ge,Ra as $,W as M,ea as A,fa as q,ga as ye,m as pe,v as fe,z as me}from"./chunk.3VEZ5MOC.js";import{a as x}from"./chunk.SDO3U72B.js";import{Td as de,od as le,pa as _,td as ue}from"./chunk.6AANHELP.js";import{b as w}from"./chunk.AJZBJBMO.js";var T=w(N(),1),D=w(M(),1),oe=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.3VEZ5MOC.js","./chunk.SDO3U72B.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UFURYU4R.js")))),Ne=oe.part(e=>(0,D.jsx)(e.HoverChipDoor,{}),{quiet:!0}),Re="A",Q=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.VBHV4TLG.js","./chunk.T6PU3NKP.js","./chunk.Z67LBSQO.js","./chunk.O2VXTYUJ.js","./chunk.MSUZAJ2K.js","./chunk.64LCHHZB.js","./chunk.3JMQKANL.js","./chunk.XXCHO2A5.js","./chunk.SADR3MQI.js","./chunk.HJCQ6I3S.js","./chunk.2BMZPALF.js","./chunk.GONZB3J3.js","./chunk.XDZDNZ7B.js","./chunk.E423JCOS.js","./chunk.O5FTWXA2.js","./chunk.Q4VFLLUT.js","./chunk.6ZENHSTQ.js","./chunk.TBY5IR7C.js","./chunk.BHJRT57H.js","./chunk.BIDL7GQD.js","./chunk.CNN32262.js","./chunk.N5Z34V7U.js","./chunk.LOKGUALC.js","./chunk.JGRSUTPJ.js","./chunk.XOZU4OFA.js","./chunk.EP5JS7ZH.js","./chunk.Q5WEOX3Q.js","./chunk.KAM73WVF.js","./chunk.O32F6LGK.js","./chunk.YFVJUHAK.js","./chunk.EGSOHTZZ.js","./chunk.L7XKYGV7.js","./chunk.CE3NKAF7.js","./chunk.R3GE37OI.js","./chunk.2KCDLCB2.js","./chunk.UD7VLXPM.js","./chunk.3DEWQDP7.js","./chunk.CFE3MHWZ.js","./chunk.RD2FSSLV.js","./chunk.HXTKBISQ.js","./chunk.TFJA4QV4.js","./chunk.HWFJQ42Y.js","./chunk.QUETLFBJ.js","./chunk.JULD4XFB.js","./chunk.GRTBEA7O.js","./chunk.H3IGXHZR.js","./chunk.7TDML5YU.js","./chunk.3VEZ5MOC.js","./chunk.SDO3U72B.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4TT3ZHSJ.js"))));var We=Q.part((e,t)=>(0,D.jsx)(e.InspectorPane,{...t}),{what:"This card's acts"});function He(e){let t=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},n=globalThis;if(n.requestIdleCallback){let d=n.requestIdleCallback(t,{timeout:5e3});return()=>n.cancelIdleCallback?.(d)}let i=setTimeout(t,2500);return()=>clearTimeout(i)}var Ge=150,Be="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function ze(e){if(e.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let t=e.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??e.closest("[data-graview-view]")?.getAttribute("data-graview-view");return t?{face:"scene",on:t,about:[t]}:null}function Fe(e){let{store:t,principal:n,providers:i,ai:d}=A(),u=xe(),v=j(d),o=(0,T.useRef)({aimAt:e,store:t,principal:n,providers:i,prepareSections:u,chipsOn:v});o.current={aimAt:e,store:t,principal:n,providers:i,prepareSections:u,chipsOn:v},(0,T.useEffect)(()=>{if(typeof document>"u")return;let c=null,h=null,k=null,l=g=>{let f=o.current,b=f.chipsOn?f.aimAt(g):null;b&&(k=g,oe.load().then(F=>{k===g&&F.restOn(b,g)},()=>{}))},m=()=>{c&&clearTimeout(c.timer),c=null},a=g=>{let f=o.current,b=f.aimAt(g);if(!b)return;let F=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,f.store.log.length]);F!==h&&(h=F,f.prepareSections(b),Q.load().then(Oe=>Oe.prepareActs(f.store,b,{principal:f.principal,providers:f.providers}),()=>{}))},r=g=>g.target instanceof Element?g.target.closest(Be):null,p=g=>{if(g.pointerType==="touch")return;let f=r(g);f!==null&&f===c?.element||(m(),f!==null&&(c={element:f,timer:setTimeout(()=>{c=null,a(f),l(f)},Ge)}))},y=g=>{let f=g.relatedTarget;k!==null&&!(f instanceof Node&&k.contains(f))&&(k=null,oe.current?.leaveRest()),c!==null&&(f instanceof Node&&c.element.contains(f)||m())},S=g=>{if(g.pointerType==="mouse")return;let f=r(g);f&&a(f)},E=g=>{if(!we())return;let f=r(g);f&&a(f)};return document.addEventListener("pointerover",p,{passive:!0}),document.addEventListener("pointerout",y,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",E),()=>{m(),document.removeEventListener("pointerover",p),document.removeEventListener("pointerout",y),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",E)}},[])}function ut({placement:e="float",openActs:t,aimAt:n}={}){let{menuAt:i,setMenuAt:d,registerActsDoor:u,ai:v}=A(),{selection:o}=V();Fe(n??ze),(0,T.useEffect)(()=>{if(Q.current)return;let m=()=>{y(),Q.prefetch()},a=()=>{},r=ke(()=>void(a=He(m))),p=["pointerdown","keydown"];for(let S of p)document.addEventListener(S,m,{capture:!0,passive:!0});function y(){r(),a();for(let S of p)document.removeEventListener(S,m,{capture:!0})}return y},[]),(0,T.useEffect)(()=>{if(e==="menu")return u({key:Re,open:t??(m=>{let a=m.getBoundingClientRect(),r=m.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??m.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;d({x:Math.round(a.left+Math.min(16,a.width/2)),y:Math.round(Math.min(a.bottom,a.top+36)),...r?{on:r}:{}})})}),()=>u(null)},[e,u,d,t]);let c=i!==null||o.length>0&&t===void 0,[h,k]=(0,T.useState)(c);(0,T.useEffect)(()=>{c&&k(!0)},[c]);let l=j(v)?(0,D.jsx)(T.Suspense,{fallback:null,children:(0,D.jsx)(Ne,{})}):null;return!h&&!c?l:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(T.Suspense,{fallback:null,children:(0,D.jsx)(We,{placement:e,chosen:t===void 0})}),l]})}var Y=w(N(),1),K=w(M(),1),_e=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.VBHV4TLG.js","./chunk.T6PU3NKP.js","./chunk.Z67LBSQO.js","./chunk.O2VXTYUJ.js","./chunk.BQAFFEOA.js","./chunk.AWV57UBJ.js","./chunk.YBQ5GVAX.js","./chunk.EB7PZJEO.js","./chunk.MSUZAJ2K.js","./chunk.64LCHHZB.js","./chunk.42KHFGN6.js","./chunk.RQG672MJ.js","./chunk.Q6H5HESF.js","./chunk.3JMQKANL.js","./chunk.42C3FIKK.js","./chunk.2ME4DVBI.js","./chunk.XXCHO2A5.js","./chunk.SADR3MQI.js","./chunk.HJCQ6I3S.js","./chunk.2BMZPALF.js","./chunk.GONZB3J3.js","./chunk.LFFJB6D3.js","./chunk.DMZRFXH7.js","./chunk.DZ6UDZOB.js","./chunk.25VJPUDH.js","./chunk.XDZDNZ7B.js","./chunk.E423JCOS.js","./chunk.O5FTWXA2.js","./chunk.Q4VFLLUT.js","./chunk.6ZENHSTQ.js","./chunk.TBY5IR7C.js","./chunk.BHJRT57H.js","./chunk.BIDL7GQD.js","./chunk.CNN32262.js","./chunk.N5Z34V7U.js","./chunk.LOKGUALC.js","./chunk.JGRSUTPJ.js","./chunk.XOZU4OFA.js","./chunk.EP5JS7ZH.js","./chunk.Q5WEOX3Q.js","./chunk.KAM73WVF.js","./chunk.O32F6LGK.js","./chunk.YFVJUHAK.js","./chunk.EGSOHTZZ.js","./chunk.WVUJXDXZ.js","./chunk.L7XKYGV7.js","./chunk.CE3NKAF7.js","./chunk.R3GE37OI.js","./chunk.2KCDLCB2.js","./chunk.UD7VLXPM.js","./chunk.3DEWQDP7.js","./chunk.MIE4TJRW.js","./chunk.CFE3MHWZ.js","./chunk.RD2FSSLV.js","./chunk.HXTKBISQ.js","./chunk.TFJA4QV4.js","./chunk.HWFJQ42Y.js","./chunk.QUETLFBJ.js","./chunk.JULD4XFB.js","./chunk.GRTBEA7O.js","./chunk.H3IGXHZR.js","./chunk.7TDML5YU.js","./chunk.3VEZ5MOC.js","./chunk.SDO3U72B.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.PPCDPYYU.js")))),qe=_e.part((e,t)=>{let n=e.DraftFrame;return(0,K.jsx)(n,{...t})},{what:"The view"});function mt(e){let{seatTalk:t}=A();return(0,Y.useSyncExternalStore)(t.subscribe,()=>t.get().draft!==null,()=>!1)?(0,K.jsx)(Y.Suspense,{fallback:null,children:(0,K.jsx)(qe,{...e})}):null}var L=w(N(),1),C=w(M(),1),re=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.SADR3MQI.js","./chunk.AQ2PI6MR.js","./chunk.H3W5C3XQ.js","./chunk.6WB2TYK7.js","./chunk.BJUUSIQY.js","./chunk.N5Z34V7U.js","./chunk.YL2RBZFE.js","./chunk.LOKGUALC.js","./chunk.JGRSUTPJ.js","./chunk.XOZU4OFA.js","./chunk.EP5JS7ZH.js","./chunk.CE3NKAF7.js","./chunk.TFJA4QV4.js","./chunk.HWFJQ42Y.js","./chunk.QUETLFBJ.js","./chunk.JULD4XFB.js","./chunk.GRTBEA7O.js","./chunk.H3IGXHZR.js","./chunk.7TDML5YU.js","./chunk.3VEZ5MOC.js","./chunk.SDO3U72B.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.MKL4THIV.js")))),Ve=re.part((e,t)=>{let n=e.QuickAskCard;return(0,C.jsx)(n,{...t})},{what:"The quick ask"});function kt({face:e,on:t=!0}){let{ai:n,aiDesk:i,selection:d,view:u}=A(),v=ge()?.open??!1,o=t&&W(n)&&!v,c=be(i),h=(0,L.useRef)(null),k=(0,L.useRef)({selection:d,place:u.within?.view});return k.current={selection:d,place:u.within?.view},(0,L.useEffect)(()=>{if(!o)return;let l=Se(i);return l.drawn+=1,l.preload=()=>{re.load().catch(()=>{}),(__graviewPreload(import.meta.url,["./chunk.6WB2TYK7.js","./chunk.BJUUSIQY.js","./chunk.CE3NKAF7.js","./chunk.GRTBEA7O.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HH4D3JEI.js")).catch(()=>{})},U(l),()=>{l.drawn=Math.max(0,l.drawn-1),l.drawn===0&&(l.open=null),U(l)}},[o,i]),(0,L.useEffect)(()=>{if(!o)return;let l=m=>{if(m.defaultPrevented||m.key.toLowerCase()!=="k"||!(m.metaKey||m.ctrlKey)||m.altKey||m.shiftKey)return;let a=h.current?.closest("[data-graview-embed]"),r=m.target,p=!(r instanceof Node)||r===document.body||r===document.documentElement;if(a&&!(p||r instanceof Node&&a.contains(r)))return;m.preventDefault(),re.prefetch();let y=document.activeElement,{selection:S,place:E}=k.current;J(i,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...E?{place:E}:{}},returnTo:y instanceof HTMLElement&&y!==document.body?y:null})};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[o,i]),o?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{ref:h,hidden:!0,"data-graview-quick-ask":e}),c?(0,C.jsx)(L.Suspense,{fallback:null,children:(0,C.jsx)(Ve,{face:e,opening:c,close:()=>J(i,null)},c.at)}):null]}):null}var G=w(N(),1),O=w(M(),1),ie=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.AQ2PI6MR.js","./chunk.H3W5C3XQ.js","./chunk.6WB2TYK7.js","./chunk.BJUUSIQY.js","./chunk.N5Z34V7U.js","./chunk.YL2RBZFE.js","./chunk.LOKGUALC.js","./chunk.JGRSUTPJ.js","./chunk.XOZU4OFA.js","./chunk.EP5JS7ZH.js","./chunk.CE3NKAF7.js","./chunk.TFJA4QV4.js","./chunk.HWFJQ42Y.js","./chunk.QUETLFBJ.js","./chunk.JULD4XFB.js","./chunk.GRTBEA7O.js","./chunk.H3IGXHZR.js","./chunk.7TDML5YU.js","./chunk.3VEZ5MOC.js","./chunk.SDO3U72B.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.RYA7A4NA.js")))),$e=ie.part((e,t)=>{let n=e.InlineAiMenu;return(0,O.jsx)(n,{...t})},{what:"The AI's suggestions"}),Qe=ie.part((e,t)=>{let n=e.GhostTray;return(0,O.jsx)(n,{...t})},{quiet:!0});function Ke(){let{ai:e}=A(),t=W(e);return(0,G.useMemo)(()=>t?n=>({id:"inline-ai",heading:"AI",render:i=>(0,O.jsx)(G.Suspense,{fallback:null,children:(0,O.jsx)($e,{target:n,close:i})}),prepare:()=>ie.prefetch()}):null,[t])}var Ye=[];function Tt({children:e}){let t=Ke(),n=(0,G.useMemo)(()=>t?[t]:Ye,[t]);return(0,O.jsx)(H,{sections:n,children:e})}function xt(e){let{ai:t,aiDesk:n}=A(),{ghost:i}=ve(n);return i===null||i.onCard||t.off?null:(0,O.jsx)(G.Suspense,{fallback:null,children:(0,O.jsx)(Qe,{...e})})}var R=w(N(),1);var Ce=w(M(),1),Ue=e=>globalThis[Symbol.for("graview.shown-lists")]?.get(e),Pe=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.H3IGXHZR.js","./chunk.7TDML5YU.js","./chunk.3VEZ5MOC.js","./chunk.SDO3U72B.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FSW535EA.js"))));function Je(e){let t=e.about[0];if(e.about.length!==1||!t?.startsWith("aggregate:"))return;let n=t.slice(10).split("+");return n.length===1?n[0]:void 0}function Xe(e,t){return e.filter(n=>n.as!==t.as&&!n.hidden&&(n.kind===t.kind||n.over?.includes(t.kind)===!0)).at(-1)}function Ze(e){let t=q(),n=t?.keptViews,i=t?.views,d=(0,R.useContext)(De);return(0,R.useMemo)(()=>i?u=>{let v=n?.current(),o=Je(u),c=a=>a.length>0?{id:"tidy-view",items:a,prepare:()=>Pe.prefetch()}:null,h=(a,...r)=>Pe.load().then(p=>p[a](...r),()=>!1),k=(a,r)=>Ue(a)?.().menu(r,n,d)??[];if(u.place===void 0){if(u.face!=="pages"||o===void 0||u.on!==void 0)return null;let a=v?.may.lenses===!0&&n?.lens!==void 0,r=_(t.store.schema,o),p=i.arrangement?.()?.hide?.includes(o)===!0;return c([...a?[{id:p?"show-list":"hide-list",label:p?"Show":"Hide",hint:p?"Back in the places, for everyone":"Off the places, for everyone; still at its address",run:()=>void h("setListHidden",o,r,n,!p,d)}]:[],...k(`list:${o}`,a)])}let l=i.places().find(a=>a.as===u.place&&(o===void 0||a.kind===o||a.over?.includes(o)===!0));if(!l)return null;let m=n&&v?de(l,v,n):null;return c([...m?[l.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>void h("setHidden",l,m,n,!1,d)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>void h("setHidden",l,m,n,!0,d)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let a=Xe(i.places(),l);h("remove",l,m,n,d).then(r=>r&&e?.(l,a))}}]:[],...k(`place:${l.as}`,m==="lens")])}:null,[n,i,d,e])}var et=[];function Rt({children:e}){let{view:t,go:n}=$(),i=(0,R.useCallback)((v,o)=>{let c=t.within?.view;t.focusId===fe(v.kind)&&(c===void 0||c===v.as)&&n(o?me(t,o.kind,o.as):pe(t,!0))},[t,n]),d=Ze(i),u=(0,R.useMemo)(()=>d?[d]:et,[d]);return(0,Ce.jsx)(H,{sections:u,children:e})}var P=w(N(),1),ce=w(M(),1),B,se=new Set,Le=e=>(se.add(e),()=>void se.delete(e)),ae=()=>(__graviewPreload(import.meta.url,["./chunk.2TUEBU7X.js","./chunk.NYLKG25K.js","./chunk.TBY5IR7C.js","./chunk.H3W5C3XQ.js","./chunk.6WB2TYK7.js","./chunk.BJUUSIQY.js","./chunk.JGRSUTPJ.js","./chunk.XOZU4OFA.js","./chunk.EP5JS7ZH.js","./chunk.CE3NKAF7.js","./chunk.MIE4TJRW.js","./chunk.CFE3MHWZ.js","./chunk.RD2FSSLV.js","./chunk.HXTKBISQ.js","./chunk.TFJA4QV4.js","./chunk.HWFJQ42Y.js","./chunk.QUETLFBJ.js","./chunk.JULD4XFB.js","./chunk.GRTBEA7O.js","./chunk.H3IGXHZR.js","./chunk.7TDML5YU.js","./chunk.3VEZ5MOC.js","./chunk.SDO3U72B.js","./chunk.6AANHELP.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZKXIZBCN.js")).then(e=>{B=e,se.forEach(t=>t())});function tt(){let e=A(),{ai:t,keptViews:n,onProposeChange:i,composeChange:d}=e,u=(0,P.useRef)(e);u.current=e;let v=i!==void 0&&d!==void 0||typeof n?.fork=="function",o=W(t)&&(typeof n?.revise=="function"||v);o&&Ie(ae);let c=(0,P.useSyncExternalStore)(Le,()=>B!==void 0,()=>!1);return(0,P.useMemo)(()=>o?h=>h.section||h.page||h.face==="scene"&&v&&(h.on!==void 0||h.place!==void 0||h.about.length===1)?B?B.sectionFor(h,u.current):(ae(),null):null:null,[o,v,c])}var nt=[];function zt({children:e}){let t=tt(),n=(0,P.useMemo)(()=>t?[t]:nt,[t]);return(0,ce.jsx)(H,{sections:n,children:e})}function Ft(){let e=(0,P.useSyncExternalStore)(Le,()=>B?.SectionDoor,()=>{});return(0,P.useEffect)(()=>{try{sessionStorage.getItem("graview.better.from-scene")&&ae()}catch{}},[]),e?(0,ce.jsx)(e,{}):null}function $t(e={}){return e.scope===void 0?ne:he(ne,e.scope)}var z=w(N(),1),s=w(M(),1);function Xt({inside:e=!1,widthOf:t}={}){let{store:n,view:i,emphasis:d,setEmphasis:u}=A(),v=Te(),{selection:o,set:c}=V(),{show:h}=$(),k=ye(),l=(0,z.useMemo)(()=>{let r=new Map;for(let p of n.graph.allEdges()){let y=r.get(p.kind)??{count:0,ends:new Set};y.count+=1;for(let S of[p.from,p.to]){let E=n.graph.getNode(S);E&&y.ends.add(`kind:${E.kind}`)}r.set(p.kind,y)}return[...r.entries()].sort(([p],[y])=>p.localeCompare(y)).map(([p,y])=>({kind:p,count:y.count,ends:[...y.ends]}))},[n,k]),m=Math.max(0,...l.map(r=>r.count));if((0,z.useEffect)(()=>()=>u(null),[u]),!i.overview&&!e||l.length===0)return null;let a=new Set;for(let r of o){if(r.startsWith("kind:")){a.add(r);continue}let p=n.graph.getNode(r);p&&a.add(`kind:${p.kind}`)}return(0,s.jsxs)("section",{"aria-label":"What the lines mean",role:e?"group":void 0,"data-testid":"relation-key",style:e?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:ue("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:ot,animation:"graview-settle 380ms 280ms ease backwards"},children:[e?null:(0,s.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:l.length===1?"1 relation":`${l.length} relations`}),t?(0,s.jsx)(it,{aloft:i.overview===!0}):null,l.map(({kind:r,count:p,ends:y})=>{let{connector:S,style:E}=te(v,r),g=rt(n.schema,r),f=d!==null?d===r:a.size===0||y.some(b=>a.has(b));return(0,s.jsxs)("button",{type:"button",title:n.schema.edge(r)?.description===void 0?`${p} of these`:g.words,onMouseEnter:()=>u(r),onMouseLeave:()=>u(null),onFocus:()=>u(r),onBlur:()=>u(null),onClick:()=>{c(y),h(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:f?1:.4},children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:i.overview&&t?(0,s.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:t(p,m)}):(0,s.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:Z(E),strokeWidth:ee(E,!0),strokeDasharray:X[E.pattern],strokeLinecap:"round"})}),(0,s.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":r,children:[(0,s.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,s.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,s.jsx)("span",{"data-graview-quiet":r,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:p})]},r)})]})}var ot="min(280px, calc(100% - 28px))";function rt(e,t,n){let i=e.edge(t)?.from??[],d=new Map;for(let o of n!==void 0&&i.includes(n)?[n]:i.length>0?i:[""]){let c=Ee(e,o,t,"out");d.set(c,[...d.get(c)??[],o])}let u=o=>o==="*"?"anything":_(e,o),v=[...d].map(([o,c])=>{let h=c.flatMap(l=>e.tryDefinition(l)?.edges[t]?.to??[]),k=c[0]&&h.length>0?`${c.map(u).join(", ")} \u2192 ${(h.includes("*")?["*"]:[...new Set(h)]).map(u).join(", ")}`:"";return[o.charAt(0).toUpperCase()+o.slice(1),k]});return{words:v.map(([o])=>o).join(" \xB7 "),ends:v.flatMap(([,o])=>o?[o]:[]).join(" \xB7 ")}}function Zt({edgeKind:e,kit:t,width:n=30}){let i=q(),d=(0,z.useMemo)(()=>le(t??i?.brand?.kit),[t,i?.brand?.kit]),{connector:u,style:v}=te(d,e);return(0,s.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":e,style:{display:"inline-block",verticalAlign:"middle",opacity:u.visible?1:.35},children:(0,s.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:Z(v),strokeWidth:ee(v,!0),strokeDasharray:X[v.pattern],strokeLinecap:"round"})})}function it({aloft:e}){let t={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,s.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:t,"data-graview-manner":"ribbon",children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,s.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,s.jsxs)("div",{style:t,"data-graview-manner":"record",children:[(0,s.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,s.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,s.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,s.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,s.jsxs)("div",{style:t,"data-graview-manner":"district",children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,s.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,s.jsxs)("div",{style:t,"data-graview-manner":"unsure",children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:Ae,strokeWidth:1.8,strokeDasharray:Me,strokeLinecap:"round"})}),(0,s.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}export{ut as a,mt as b,kt as c,Xt as d,ot as e,Zt as f,Ke as g,Tt as h,xt as i,Ze as j,Rt as k,tt as l,zt as m,Ft as n,$t as o};
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as ne}from"./chunk.AUNQNTKY.js";import{p as Te,q as te,t as H,u as xe,y as Ie}from"./chunk.SCVKHGO3.js";import{m as X,n as Me,o as Ae,p as Z,q as ee}from"./chunk.RD2FSSLV.js";import{b as Ee}from"./chunk.FIY4RUK5.js";import{b as Se,d as U,e as J,g as be,q as De}from"./chunk.NLZHNPDU.js";import{b as he}from"./chunk.QNC2OKLF.js";import{D as W,F as j,G as N,J as ve,Ja as we,Ka as ke,La as I,Pa as V,R as ge,Ra as $,W as M,ea as A,fa as q,ga as ye,m as pe,v as fe,z as me}from"./chunk.FWXW4T4I.js";import{a as x}from"./chunk.SDO3U72B.js";import{Td as de,od as le,pa as _,td as ue}from"./chunk.DHPXRDT5.js";import{b as w}from"./chunk.AJZBJBMO.js";var T=w(N(),1),D=w(M(),1),oe=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.RNAL35ID.js")))),Ne=oe.part(e=>(0,D.jsx)(e.HoverChipDoor,{}),{quiet:!0}),Re="A",Q=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.VBHV4TLG.js","./chunk.T6PU3NKP.js","./chunk.W3WXI5B3.js","./chunk.ZU3RPI34.js","./chunk.4R7H3GIL.js","./chunk.CCCONK73.js","./chunk.PJL3I2IW.js","./chunk.YJ4PFOPC.js","./chunk.LKM2R5UF.js","./chunk.HJCQ6I3S.js","./chunk.EL7XXGQY.js","./chunk.CDSHUWSK.js","./chunk.B5EFNTDA.js","./chunk.47VEV4BX.js","./chunk.FE3SINPK.js","./chunk.MUWI54IP.js","./chunk.3D37E2G5.js","./chunk.TBY5IR7C.js","./chunk.WFJCC6G3.js","./chunk.BIDL7GQD.js","./chunk.IO5VFTXC.js","./chunk.7L3I776Z.js","./chunk.CLIC2QBA.js","./chunk.UPOYRCKI.js","./chunk.XOZU4OFA.js","./chunk.WV6SP6IJ.js","./chunk.Q5WEOX3Q.js","./chunk.MATUPDZ3.js","./chunk.SAWASNDO.js","./chunk.YFVJUHAK.js","./chunk.HCX6KPRF.js","./chunk.B422DSYN.js","./chunk.ZE5RSKXF.js","./chunk.DKUEZPGR.js","./chunk.EP7YT7LT.js","./chunk.I7KN732Z.js","./chunk.TLPCYKLW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.GPBHUIZQ.js"))));var We=Q.part((e,t)=>(0,D.jsx)(e.InspectorPane,{...t}),{what:"This card's acts"});function He(e){let t=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},n=globalThis;if(n.requestIdleCallback){let d=n.requestIdleCallback(t,{timeout:5e3});return()=>n.cancelIdleCallback?.(d)}let i=setTimeout(t,2500);return()=>clearTimeout(i)}var Ge=150,Be="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function ze(e){if(e.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let t=e.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??e.closest("[data-graview-view]")?.getAttribute("data-graview-view");return t?{face:"scene",on:t,about:[t]}:null}function Fe(e){let{store:t,principal:n,providers:i,ai:d}=A(),u=xe(),v=j(d),o=(0,T.useRef)({aimAt:e,store:t,principal:n,providers:i,prepareSections:u,chipsOn:v});o.current={aimAt:e,store:t,principal:n,providers:i,prepareSections:u,chipsOn:v},(0,T.useEffect)(()=>{if(typeof document>"u")return;let c=null,h=null,k=null,l=g=>{let f=o.current,b=f.chipsOn?f.aimAt(g):null;b&&(k=g,oe.load().then(F=>{k===g&&F.restOn(b,g)},()=>{}))},m=()=>{c&&clearTimeout(c.timer),c=null},a=g=>{let f=o.current,b=f.aimAt(g);if(!b)return;let F=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,f.store.log.length]);F!==h&&(h=F,f.prepareSections(b),Q.load().then(Oe=>Oe.prepareActs(f.store,b,{principal:f.principal,providers:f.providers}),()=>{}))},r=g=>g.target instanceof Element?g.target.closest(Be):null,p=g=>{if(g.pointerType==="touch")return;let f=r(g);f!==null&&f===c?.element||(m(),f!==null&&(c={element:f,timer:setTimeout(()=>{c=null,a(f),l(f)},Ge)}))},y=g=>{let f=g.relatedTarget;k!==null&&!(f instanceof Node&&k.contains(f))&&(k=null,oe.current?.leaveRest()),c!==null&&(f instanceof Node&&c.element.contains(f)||m())},S=g=>{if(g.pointerType==="mouse")return;let f=r(g);f&&a(f)},E=g=>{if(!we())return;let f=r(g);f&&a(f)};return document.addEventListener("pointerover",p,{passive:!0}),document.addEventListener("pointerout",y,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",E),()=>{m(),document.removeEventListener("pointerover",p),document.removeEventListener("pointerout",y),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",E)}},[])}function ut({placement:e="float",openActs:t,aimAt:n}={}){let{menuAt:i,setMenuAt:d,registerActsDoor:u,ai:v}=A(),{selection:o}=V();Fe(n??ze),(0,T.useEffect)(()=>{if(Q.current)return;let m=()=>{y(),Q.prefetch()},a=()=>{},r=ke(()=>void(a=He(m))),p=["pointerdown","keydown"];for(let S of p)document.addEventListener(S,m,{capture:!0,passive:!0});function y(){r(),a();for(let S of p)document.removeEventListener(S,m,{capture:!0})}return y},[]),(0,T.useEffect)(()=>{if(e==="menu")return u({key:Re,open:t??(m=>{let a=m.getBoundingClientRect(),r=m.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??m.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;d({x:Math.round(a.left+Math.min(16,a.width/2)),y:Math.round(Math.min(a.bottom,a.top+36)),...r?{on:r}:{}})})}),()=>u(null)},[e,u,d,t]);let c=i!==null||o.length>0&&t===void 0,[h,k]=(0,T.useState)(c);(0,T.useEffect)(()=>{c&&k(!0)},[c]);let l=j(v)?(0,D.jsx)(T.Suspense,{fallback:null,children:(0,D.jsx)(Ne,{})}):null;return!h&&!c?l:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(T.Suspense,{fallback:null,children:(0,D.jsx)(We,{placement:e,chosen:t===void 0})}),l]})}var Y=w(N(),1),K=w(M(),1),_e=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.VBHV4TLG.js","./chunk.T6PU3NKP.js","./chunk.W3WXI5B3.js","./chunk.ZU3RPI34.js","./chunk.D3SWJ7OS.js","./chunk.66TRDXYR.js","./chunk.I7OFRF6N.js","./chunk.4RPKCW4J.js","./chunk.4R7H3GIL.js","./chunk.CCCONK73.js","./chunk.IRNEWNUB.js","./chunk.AUNQNTKY.js","./chunk.KLEKC4ZX.js","./chunk.PJL3I2IW.js","./chunk.LMZ2WMGH.js","./chunk.OD5QZHRC.js","./chunk.YJ4PFOPC.js","./chunk.LKM2R5UF.js","./chunk.HJCQ6I3S.js","./chunk.EL7XXGQY.js","./chunk.CDSHUWSK.js","./chunk.5MOXQUZH.js","./chunk.MKN7ADJB.js","./chunk.I4H2GS4O.js","./chunk.25VJPUDH.js","./chunk.B5EFNTDA.js","./chunk.47VEV4BX.js","./chunk.FE3SINPK.js","./chunk.MUWI54IP.js","./chunk.3D37E2G5.js","./chunk.TBY5IR7C.js","./chunk.WFJCC6G3.js","./chunk.BIDL7GQD.js","./chunk.IO5VFTXC.js","./chunk.7L3I776Z.js","./chunk.CLIC2QBA.js","./chunk.UPOYRCKI.js","./chunk.XOZU4OFA.js","./chunk.WV6SP6IJ.js","./chunk.Q5WEOX3Q.js","./chunk.MATUPDZ3.js","./chunk.SAWASNDO.js","./chunk.YFVJUHAK.js","./chunk.HCX6KPRF.js","./chunk.WVUJXDXZ.js","./chunk.B422DSYN.js","./chunk.ZE5RSKXF.js","./chunk.DKUEZPGR.js","./chunk.EP7YT7LT.js","./chunk.I7KN732Z.js","./chunk.TLPCYKLW.js","./chunk.MIE4TJRW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.LAVLPYSC.js")))),qe=_e.part((e,t)=>{let n=e.DraftFrame;return(0,K.jsx)(n,{...t})},{what:"The view"});function mt(e){let{seatTalk:t}=A();return(0,Y.useSyncExternalStore)(t.subscribe,()=>t.get().draft!==null,()=>!1)?(0,K.jsx)(Y.Suspense,{fallback:null,children:(0,K.jsx)(qe,{...e})}):null}var L=w(N(),1),C=w(M(),1),re=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.LKM2R5UF.js","./chunk.3VNOTHA5.js","./chunk.VR553M6J.js","./chunk.DU76ASS4.js","./chunk.BJUUSIQY.js","./chunk.7L3I776Z.js","./chunk.GTF6EMVE.js","./chunk.CLIC2QBA.js","./chunk.UPOYRCKI.js","./chunk.XOZU4OFA.js","./chunk.WV6SP6IJ.js","./chunk.ZE5RSKXF.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.7T2P42VW.js")))),Ve=re.part((e,t)=>{let n=e.QuickAskCard;return(0,C.jsx)(n,{...t})},{what:"The quick ask"});function kt({face:e,on:t=!0}){let{ai:n,aiDesk:i,selection:d,view:u}=A(),v=ge()?.open??!1,o=t&&W(n)&&!v,c=be(i),h=(0,L.useRef)(null),k=(0,L.useRef)({selection:d,place:u.within?.view});return k.current={selection:d,place:u.within?.view},(0,L.useEffect)(()=>{if(!o)return;let l=Se(i);return l.drawn+=1,l.preload=()=>{re.load().catch(()=>{}),(__graviewPreload(import.meta.url,["./chunk.DU76ASS4.js","./chunk.BJUUSIQY.js","./chunk.ZE5RSKXF.js","./chunk.IY3DV52G.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VEQIH7HR.js")).catch(()=>{})},U(l),()=>{l.drawn=Math.max(0,l.drawn-1),l.drawn===0&&(l.open=null),U(l)}},[o,i]),(0,L.useEffect)(()=>{if(!o)return;let l=m=>{if(m.defaultPrevented||m.key.toLowerCase()!=="k"||!(m.metaKey||m.ctrlKey)||m.altKey||m.shiftKey)return;let a=h.current?.closest("[data-graview-embed]"),r=m.target,p=!(r instanceof Node)||r===document.body||r===document.documentElement;if(a&&!(p||r instanceof Node&&a.contains(r)))return;m.preventDefault(),re.prefetch();let y=document.activeElement,{selection:S,place:E}=k.current;J(i,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...E?{place:E}:{}},returnTo:y instanceof HTMLElement&&y!==document.body?y:null})};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[o,i]),o?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{ref:h,hidden:!0,"data-graview-quick-ask":e}),c?(0,C.jsx)(L.Suspense,{fallback:null,children:(0,C.jsx)(Ve,{face:e,opening:c,close:()=>J(i,null)},c.at)}):null]}):null}var G=w(N(),1),O=w(M(),1),ie=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.3VNOTHA5.js","./chunk.VR553M6J.js","./chunk.DU76ASS4.js","./chunk.BJUUSIQY.js","./chunk.7L3I776Z.js","./chunk.GTF6EMVE.js","./chunk.CLIC2QBA.js","./chunk.UPOYRCKI.js","./chunk.XOZU4OFA.js","./chunk.WV6SP6IJ.js","./chunk.ZE5RSKXF.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VHLL6VC6.js")))),$e=ie.part((e,t)=>{let n=e.InlineAiMenu;return(0,O.jsx)(n,{...t})},{what:"The AI's suggestions"}),Qe=ie.part((e,t)=>{let n=e.GhostTray;return(0,O.jsx)(n,{...t})},{quiet:!0});function Ke(){let{ai:e}=A(),t=W(e);return(0,G.useMemo)(()=>t?n=>({id:"inline-ai",heading:"AI",render:i=>(0,O.jsx)(G.Suspense,{fallback:null,children:(0,O.jsx)($e,{target:n,close:i})}),prepare:()=>ie.prefetch()}):null,[t])}var Ye=[];function Tt({children:e}){let t=Ke(),n=(0,G.useMemo)(()=>t?[t]:Ye,[t]);return(0,O.jsx)(H,{sections:n,children:e})}function xt(e){let{ai:t,aiDesk:n}=A(),{ghost:i}=ve(n);return i===null||i.onCard||t.off?null:(0,O.jsx)(G.Suspense,{fallback:null,children:(0,O.jsx)(Qe,{...e})})}var R=w(N(),1);var Ce=w(M(),1),Ue=e=>globalThis[Symbol.for("graview.shown-lists")]?.get(e),Pe=I(x(()=>(__graviewPreload(import.meta.url,["./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.G43YUGNW.js"))));function Je(e){let t=e.about[0];if(e.about.length!==1||!t?.startsWith("aggregate:"))return;let n=t.slice(10).split("+");return n.length===1?n[0]:void 0}function Xe(e,t){return e.filter(n=>n.as!==t.as&&!n.hidden&&(n.kind===t.kind||n.over?.includes(t.kind)===!0)).at(-1)}function Ze(e){let t=q(),n=t?.keptViews,i=t?.views,d=(0,R.useContext)(De);return(0,R.useMemo)(()=>i?u=>{let v=n?.current(),o=Je(u),c=a=>a.length>0?{id:"tidy-view",items:a,prepare:()=>Pe.prefetch()}:null,h=(a,...r)=>Pe.load().then(p=>p[a](...r),()=>!1),k=(a,r)=>Ue(a)?.().menu(r,n,d)??[];if(u.place===void 0){if(u.face!=="pages"||o===void 0||u.on!==void 0)return null;let a=v?.may.lenses===!0&&n?.lens!==void 0,r=_(t.store.schema,o),p=i.arrangement?.()?.hide?.includes(o)===!0;return c([...a?[{id:p?"show-list":"hide-list",label:p?"Show":"Hide",hint:p?"Back in the places, for everyone":"Off the places, for everyone; still at its address",run:()=>void h("setListHidden",o,r,n,!p,d)}]:[],...k(`list:${o}`,a)])}let l=i.places().find(a=>a.as===u.place&&(o===void 0||a.kind===o||a.over?.includes(o)===!0));if(!l)return null;let m=n&&v?de(l,v,n):null;return c([...m?[l.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>void h("setHidden",l,m,n,!1,d)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>void h("setHidden",l,m,n,!0,d)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let a=Xe(i.places(),l);h("remove",l,m,n,d).then(r=>r&&e?.(l,a))}}]:[],...k(`place:${l.as}`,m==="lens")])}:null,[n,i,d,e])}var et=[];function Rt({children:e}){let{view:t,go:n}=$(),i=(0,R.useCallback)((v,o)=>{let c=t.within?.view;t.focusId===fe(v.kind)&&(c===void 0||c===v.as)&&n(o?me(t,o.kind,o.as):pe(t,!0))},[t,n]),d=Ze(i),u=(0,R.useMemo)(()=>d?[d]:et,[d]);return(0,Ce.jsx)(H,{sections:u,children:e})}var P=w(N(),1),ce=w(M(),1),B,se=new Set,Le=e=>(se.add(e),()=>void se.delete(e)),ae=()=>(__graviewPreload(import.meta.url,["./chunk.DO3FQM6R.js","./chunk.NYLKG25K.js","./chunk.TBY5IR7C.js","./chunk.VR553M6J.js","./chunk.DU76ASS4.js","./chunk.BJUUSIQY.js","./chunk.UPOYRCKI.js","./chunk.XOZU4OFA.js","./chunk.WV6SP6IJ.js","./chunk.ZE5RSKXF.js","./chunk.MIE4TJRW.js","./chunk.SCVKHGO3.js","./chunk.RD2FSSLV.js","./chunk.AZRICZKT.js","./chunk.MH3AQO2R.js","./chunk.J2N7EKMX.js","./chunk.P26ATAAI.js","./chunk.FIY4RUK5.js","./chunk.IY3DV52G.js","./chunk.NLZHNPDU.js","./chunk.QNC2OKLF.js","./chunk.FWXW4T4I.js","./chunk.SDO3U72B.js","./chunk.DHPXRDT5.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.IAVIYJTL.js")).then(e=>{B=e,se.forEach(t=>t())});function tt(){let e=A(),{ai:t,keptViews:n,onProposeChange:i,composeChange:d}=e,u=(0,P.useRef)(e);u.current=e;let v=i!==void 0&&d!==void 0||typeof n?.fork=="function",o=W(t)&&(typeof n?.revise=="function"||v);o&&Ie(ae);let c=(0,P.useSyncExternalStore)(Le,()=>B!==void 0,()=>!1);return(0,P.useMemo)(()=>o?h=>h.section||h.page||h.face==="scene"&&v&&(h.on!==void 0||h.place!==void 0||h.about.length===1)?B?B.sectionFor(h,u.current):(ae(),null):null:null,[o,v,c])}var nt=[];function zt({children:e}){let t=tt(),n=(0,P.useMemo)(()=>t?[t]:nt,[t]);return(0,ce.jsx)(H,{sections:n,children:e})}function Ft(){let e=(0,P.useSyncExternalStore)(Le,()=>B?.SectionDoor,()=>{});return(0,P.useEffect)(()=>{try{sessionStorage.getItem("graview.better.from-scene")&&ae()}catch{}},[]),e?(0,ce.jsx)(e,{}):null}function $t(e={}){return e.scope===void 0?ne:he(ne,e.scope)}var z=w(N(),1),s=w(M(),1);function Xt({inside:e=!1,widthOf:t}={}){let{store:n,view:i,emphasis:d,setEmphasis:u}=A(),v=Te(),{selection:o,set:c}=V(),{show:h}=$(),k=ye(),l=(0,z.useMemo)(()=>{let r=new Map;for(let p of n.graph.allEdges()){let y=r.get(p.kind)??{count:0,ends:new Set};y.count+=1;for(let S of[p.from,p.to]){let E=n.graph.getNode(S);E&&y.ends.add(`kind:${E.kind}`)}r.set(p.kind,y)}return[...r.entries()].sort(([p],[y])=>p.localeCompare(y)).map(([p,y])=>({kind:p,count:y.count,ends:[...y.ends]}))},[n,k]),m=Math.max(0,...l.map(r=>r.count));if((0,z.useEffect)(()=>()=>u(null),[u]),!i.overview&&!e||l.length===0)return null;let a=new Set;for(let r of o){if(r.startsWith("kind:")){a.add(r);continue}let p=n.graph.getNode(r);p&&a.add(`kind:${p.kind}`)}return(0,s.jsxs)("section",{"aria-label":"What the lines mean",role:e?"group":void 0,"data-testid":"relation-key",style:e?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:ue("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:ot,animation:"graview-settle 380ms 280ms ease backwards"},children:[e?null:(0,s.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:l.length===1?"1 relation":`${l.length} relations`}),t?(0,s.jsx)(it,{aloft:i.overview===!0}):null,l.map(({kind:r,count:p,ends:y})=>{let{connector:S,style:E}=te(v,r),g=rt(n.schema,r),f=d!==null?d===r:a.size===0||y.some(b=>a.has(b));return(0,s.jsxs)("button",{type:"button",title:n.schema.edge(r)?.description===void 0?`${p} of these`:g.words,onMouseEnter:()=>u(r),onMouseLeave:()=>u(null),onFocus:()=>u(r),onBlur:()=>u(null),onClick:()=>{c(y),h(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:f?1:.4},children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:i.overview&&t?(0,s.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:t(p,m)}):(0,s.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:Z(E),strokeWidth:ee(E,!0),strokeDasharray:X[E.pattern],strokeLinecap:"round"})}),(0,s.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":r,children:[(0,s.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,s.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,s.jsx)("span",{"data-graview-quiet":r,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:p})]},r)})]})}var ot="min(280px, calc(100% - 28px))";function rt(e,t,n){let i=e.edge(t)?.from??[],d=new Map;for(let o of n!==void 0&&i.includes(n)?[n]:i.length>0?i:[""]){let c=Ee(e,o,t,"out");d.set(c,[...d.get(c)??[],o])}let u=o=>o==="*"?"anything":_(e,o),v=[...d].map(([o,c])=>{let h=c.flatMap(l=>e.tryDefinition(l)?.edges[t]?.to??[]),k=c[0]&&h.length>0?`${c.map(u).join(", ")} \u2192 ${(h.includes("*")?["*"]:[...new Set(h)]).map(u).join(", ")}`:"";return[o.charAt(0).toUpperCase()+o.slice(1),k]});return{words:v.map(([o])=>o).join(" \xB7 "),ends:v.flatMap(([,o])=>o?[o]:[]).join(" \xB7 ")}}function Zt({edgeKind:e,kit:t,width:n=30}){let i=q(),d=(0,z.useMemo)(()=>le(t??i?.brand?.kit),[t,i?.brand?.kit]),{connector:u,style:v}=te(d,e);return(0,s.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":e,style:{display:"inline-block",verticalAlign:"middle",opacity:u.visible?1:.35},children:(0,s.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:Z(v),strokeWidth:ee(v,!0),strokeDasharray:X[v.pattern],strokeLinecap:"round"})})}function it({aloft:e}){let t={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,s.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:t,"data-graview-manner":"ribbon",children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,s.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,s.jsxs)("div",{style:t,"data-graview-manner":"record",children:[(0,s.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,s.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,s.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,s.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,s.jsxs)("div",{style:t,"data-graview-manner":"district",children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,s.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,s.jsxs)("div",{style:t,"data-graview-manner":"unsure",children:[(0,s.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:Ae,strokeWidth:1.8,strokeDasharray:Me,strokeLinecap:"round"})}),(0,s.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}export{ut as a,mt as b,kt as c,Xt as d,ot as e,Zt as f,Ke as g,Tt as h,xt as i,Ze as j,Rt as k,tt as l,zt as m,Ft as n,$t as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V}from"./chunk.
|
|
1
|
+
import{a as V}from"./chunk.NRECR3NQ.js";import"./chunk.3D37E2G5.js";import"./chunk.XOZU4OFA.js";import{f as C,g as x,h as R}from"./chunk.WV6SP6IJ.js";import{a as D}from"./chunk.PZ3KM3TY.js";import{a as T,b as A,c as M}from"./chunk.CA2SYEYE.js";import"./chunk.MH3AQO2R.js";import"./chunk.J2N7EKMX.js";import"./chunk.P26ATAAI.js";import"./chunk.FIY4RUK5.js";import"./chunk.IY3DV52G.js";import{a as F,c as $}from"./chunk.QNC2OKLF.js";import{G as k,O as E,T as H,W as g}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as l}from"./chunk.AJZBJBMO.js";var m=l(k());var n=l(g()),B={maxWidth:560,margin:"0 auto",padding:"40px 20px 64px",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:16};function G({app:r,store:e,form:o,principal:i,heading:f=1,onSubmitted:a}){let t=(0,m.useMemo)(()=>C(r,o,e.allMutations()),[r,o,e]),d=H(e),v=(0,m.useMemo)(()=>d?e.seenBy(i):e,[d,e,i]),[p,b]=(0,m.useState)(!1),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{p&&u.current?.focus()},[p]);let y=`h${f}`;if(!d)return null;if(!t)return(0,n.jsx)("main",{"data-graview-visitor-form":o,style:B,children:(0,n.jsx)("p",{role:"alert",children:"There is no form here."})});let S=R(t);return(0,n.jsxs)("main",{"data-graview-visitor-form":o,"aria-labelledby":"graview-visitor-form-title",style:B,children:[(0,n.jsx)(y,{id:"graview-visitor-form-title",style:{margin:0,fontSize:"var(--graview-text-title)"},children:t.title}),p?(0,n.jsxs)("div",{ref:u,role:"status",tabIndex:-1,"data-graview-part":"received",style:{display:"grid",gap:8,outline:"none"},children:[(0,n.jsx)("p",{style:{margin:0,fontWeight:600},children:S.said}),S.next?(0,n.jsx)("p",{style:{margin:0},children:S.next}):null]}):(0,n.jsxs)(n.Fragment,{children:[t.intro?(0,n.jsx)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:t.intro}):null,(0,n.jsx)(V,{store:v,mutation:t.act,principal:i,only:t.fields.map(h=>h.name),label:t.submit,onDone:()=>{b(!0),a?.(o)}})]})]})}var s=l(k()),P=l($()),O=l(D());var c=l(g());function L(r){let{app:e,form:o,principal:i,scheme:f="auto",brand:a=e.brand,fonts:t=!0,height:d}=r,v=(0,s.useMemo)(()=>typeof i!="string"?i:e.forms?.[o]?x(e,o,i):{kind:"human",id:i,roles:[]},[e,o,i]),p=(0,s.useMemo)(()=>r.store??r.remote?.store??A(e,r.seed),[r.store,r.remote,e,r.seed]),b=M(f==="auto",a?.scheme),u=f==="auto"?b:f,y=`graview-form-${(0,s.useId)().replace(/[^a-zA-Z0-9_-]/g,"")}`,S=(0,s.useMemo)(()=>F(u,a,{scope:`.${y}`}),[u,a,y]);return(0,s.useEffect)(()=>{if(!t||typeof document>"u")return;let h=T(a);if(!h||document.querySelector(`link[href="${h}"]`))return;let w=document.createElement("link");w.rel="stylesheet",w.href=h,document.head.appendChild(w)},[a,t]),(0,c.jsxs)("section",{className:y,"aria-label":r.label??e.forms?.[o]?.title??e.name,"data-graview-embed":"form","data-graview-scheme":u,style:{position:"relative",isolation:"isolate",...d===void 0?{}:{minHeight:d},background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,c.jsx)("style",{children:S}),(0,c.jsx)(E.Provider,{value:r.assetsAt,children:(0,c.jsx)(G,{app:e,store:p,form:o,principal:v,heading:r.heading??1,...r.onSubmitted?{onSubmitted:r.onSubmitted}:{}})})]})}function U(r,e){e.app.forms?.[e.form]||x(e.app,e.form,"form:");let o=e.store??e.remote?.store??A(e.app,e.seed),i=null;function f(){let[t,d]=(0,s.useState)(e.scheme??"auto");return i=d,(0,c.jsx)(L,{...e,store:o,scheme:t})}let a=(0,O.createRoot)(r);return(0,P.flushSync)(()=>a.render((0,c.jsx)(f,{}))),{store:o,setScheme:t=>(0,P.flushSync)(()=>i?.(t)),unmount:()=>a.unmount()}}export{L as FormEmbed,U as mount};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as O}from"./chunk.
|
|
1
|
+
import{c as O}from"./chunk.J2N7EKMX.js";import{_ as N}from"./chunk.DHPXRDT5.js";var H=/^h([1-6])$/,D={section:null,article:null,form:null,region:null,nav:"navigation",navigation:"navigation",main:"main content",header:"header",banner:"header",footer:"footer",contentinfo:"footer",aside:"aside",complementary:"aside",search:"search"},G=e=>typeof e=="object"&&e!==null&&typeof e.getAttribute=="function"&&(e.nodeType===void 0||e.nodeType===1),$=e=>(e??"").replace(/\s+/g," ").trim();function*x(e){yield e;for(let r of Array.from(e.childNodes))G(r)&&(yield*x(r))}var P=e=>(e.getAttribute("data-graview-as")??e.localName??"").toLowerCase();function C(e){let r=H.exec(P(e));return r?Number(r[1]):e.getAttribute("role")==="heading"?Number(e.getAttribute("aria-level")??2):void 0}function R(e){let r=[...x(e)],i=new Map;for(let n of r){let d=n.getAttribute("id");d&&i.set(d,n)}let t=[],g=new Set,a=(n,d)=>{let s=n.toLowerCase();!n||g.has(s)||(g.add(s),t.push({name:n.length>80?`${n.slice(0,79)}\u2026`:n,as:d}))};for(let n of r){if(n.getAttribute("aria-hidden")==="true"||n.getAttribute("hidden")!==null)continue;if(C(n)!==void 0){a($(n.textContent),"heading");continue}let s=P(n),f=(n.getAttribute("role")??"").toLowerCase(),l=f in D?f:s in D?s:void 0;if(!l)continue;let m=(n.getAttribute("aria-labelledby")??"").split(/\s+/).flatMap(u=>i.get(u)?[$(i.get(u).textContent)]:[]).join(" "),c=[...x(n)].find(u=>u!==n&&C(u)!==void 0),o=$(n.getAttribute("aria-label"))||m||(c?$(c.textContent):"")||D[l]||"";a(o,l==="region"?"section":l)}return t}var v="\0";function _(e){let r=[],i=e.length,t=0,g="",a=l=>l.replace(/\\(u\{[0-9a-fA-F]+\}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}|.)/gs,(m,c)=>c==="n"?`
|
|
2
2
|
`:c==="t"?" ":c[0]==="u"||c[0]==="x"?String.fromCodePoint(parseInt(c.replace(/[ux{}]/g,""),16)):c),n=l=>{let m=++t;for(;t<i&&e[t]!==l&&e[t]!==`
|
|
3
3
|
`;)t+=e[t]==="\\"?2:1;let c=e.slice(m,t);return t++,a(c)},d=()=>{t++;let l=!1;for(;t<i&&e[t]!==`
|
|
4
4
|
`;){let m=e[t];if(m==="\\")t+=2;else if(m==="[")l=!0,t++;else if(m==="]")l=!1,t++;else{if(m==="/"&&!l)break;t++}}for(t++;t<i&&/[a-z]/i.test(e[t]);)t++},s=()=>{t++;let l="";for(;t<i;){let m=e[t];if(m==="\\")l+=a(e.slice(t,t+2)),t+=2;else{if(m==="`")return t++,l;m==="$"&&e[t+1]==="{"?(t+=2,f(!0),l+=v):(l+=m,t++)}}return l};function f(l){let m=0;for(;t<i;){let c=e[t];if(c==="/"&&e[t+1]==="/"){let o=e.indexOf(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as te}from"./chunk.
|
|
1
|
+
import{b as te}from"./chunk.EL7XXGQY.js";import"./chunk.MH3AQO2R.js";import"./chunk.J2N7EKMX.js";import"./chunk.P26ATAAI.js";import{b as ne}from"./chunk.FIY4RUK5.js";import"./chunk.IY3DV52G.js";import{G as ge,W as ee}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import{la as X,na as Z,rd as q}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
|
|
2
2
|
`),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
|
|
3
3
|
`)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Pa as y,Ra as k,W as w,j as c,l as h,m as b,r as f}from"./chunk.
|
|
1
|
+
import{Pa as y,Ra as k,W as w,j as c,l as h,m as b,r as f}from"./chunk.FWXW4T4I.js";import{Z as i}from"./chunk.DHPXRDT5.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=null,a=new Set,v=e=>{s={kind:e,n:(s?.n??0)+1};for(let t of a)t()},A=()=>s,C=e=>(a.add(e),()=>a.delete(e)),V=()=>{s=null};var d=g(w(),1);function T(e,t){if(e.length===0||t.length===0)return[];let o=new Set(t.map(n=>n.id));return e.filter(n=>n.nodeIds.some(l=>o.has(l)))}var x=(e,t)=>`${i(e)} ${e===1?"problem":"problems"} in ${t}`;function q({kind:e,plural:t,problems:o,flag:n,listed:l=!1}){let{view:p,go:P}=k(),{set:$}=y();if(o.length===0)return null;let u=x(o.length,t),m=o.length===1?"it":"them";return(0,d.jsx)("button",{type:"button",className:"graview-district-problems","data-testid":`district-problems-${e}`,"data-graview-problems":o.length,"aria-expanded":l,"aria-label":u,title:`${u} \u2014 ${o[0].message}${o.length>1?` (and ${i(o.length-1)} more)`:""}. Press to see ${m} and how to fix ${m}.`,onClick:r=>{r.stopPropagation(),p.overview||P(h(c(b(p,!0),null),"view",null)),$([f(e)]),v(e)},onDoubleClick:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:(0,d.jsx)("span",{"aria-hidden":"true",children:`${n} ${i(o.length)}`})})}export{A as a,C as b,V as c,T as d,x as e,q as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as f}from"./chunk.HGH27XZG.js";import"./chunk.NRECR3NQ.js";import"./chunk.T2BZBR7S.js";import"./chunk.HMJXB6KC.js";import"./chunk.Q355UPFG.js";import{o as g}from"./chunk.JQEXH23N.js";import"./chunk.O7NYSO6F.js";import"./chunk.I7OFRF6N.js";import"./chunk.4RPKCW4J.js";import"./chunk.IRNEWNUB.js";import"./chunk.AUNQNTKY.js";import"./chunk.KLEKC4ZX.js";import"./chunk.PJL3I2IW.js";import"./chunk.LMZ2WMGH.js";import"./chunk.OD5QZHRC.js";import"./chunk.YJ4PFOPC.js";import"./chunk.LKM2R5UF.js";import"./chunk.MB7LKKUD.js";import"./chunk.26RYER7Y.js";import"./chunk.CYEPHT7V.js";import"./chunk.5MOXQUZH.js";import"./chunk.MKN7ADJB.js";import"./chunk.I4H2GS4O.js";import"./chunk.FE3SINPK.js";import"./chunk.MUWI54IP.js";import"./chunk.3D37E2G5.js";import"./chunk.IO5VFTXC.js";import"./chunk.BJUUSIQY.js";import"./chunk.7L3I776Z.js";import"./chunk.CLIC2QBA.js";import"./chunk.XOZU4OFA.js";import"./chunk.WV6SP6IJ.js";import"./chunk.WVUJXDXZ.js";import"./chunk.B422DSYN.js";import"./chunk.ZE5RSKXF.js";import"./chunk.DKUEZPGR.js";import"./chunk.EP7YT7LT.js";import"./chunk.I7KN732Z.js";import"./chunk.TLPCYKLW.js";import"./chunk.MIE4TJRW.js";import"./chunk.SCVKHGO3.js";import"./chunk.RD2FSSLV.js";import"./chunk.AZRICZKT.js";import"./chunk.MH3AQO2R.js";import"./chunk.J2N7EKMX.js";import"./chunk.P26ATAAI.js";import"./chunk.FIY4RUK5.js";import"./chunk.IY3DV52G.js";import"./chunk.NLZHNPDU.js";import"./chunk.QNC2OKLF.js";import{G as b,W as h}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import{ue as n}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var m=t(b(),1),a=t(h(),1);function P({store:c,auto:y,brand:i,views:u,presence:s,steering:r,overview:o,scope:d,titleLevel:w=2,quickAsk:l,props:e}){let v=(0,m.useMemo)(()=>g({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:y?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:v}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(f,{context:{store:c,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...o?{overview:o}:{},titleLevel:w,views:u,settings:e.app.settings??[],app:e.app,...s?{presence:s}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},dismissals:e.dismissals,whileAway:e.whileAway,...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.hrefOf?{hrefOf:e.hrefOf}:e.routing==="address"?{}:{hrefOf:!1},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{P as PagesContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as te}from"./chunk.6WB2TYK7.js";import"./chunk.BJUUSIQY.js";import"./chunk.CE3NKAF7.js";import"./chunk.GRTBEA7O.js";import"./chunk.H3IGXHZR.js";import"./chunk.7TDML5YU.js";import{G as ne,W as N}from"./chunk.3VEZ5MOC.js";import"./chunk.SDO3U72B.js";import{eb as Z,la as Q,oa as X,td as ee,xd as $}from"./chunk.6AANHELP.js";import"./chunk.FQLNBIQ5.js";import{b as P}from"./chunk.AJZBJBMO.js";var D=new WeakMap,we=5e3;function I(n){let e=D.get(n);if(e&&Date.now()-e.at<we)return e.list;let t={at:Date.now(),list:Promise.resolve([])};return t.list=Promise.resolve().then(()=>n.list()).catch(()=>[]).then(o=>t.value=[...o,...(t.value??[]).filter(i=>!o.some(l=>l.id===i.id))]),e?.value&&(t.value=e.value),D.set(n,t),t.list}var oe=n=>D.get(n)?.value;function re(n,e){let t=D.get(n);if(!t)return;let o=i=>[...i.filter(l=>l.id!==e.id),e];t.value&&(t.value=o(t.value)),D.set(n,{at:t.at,list:t.list.then(o),...t.value?{value:t.value}:{}})}function A(n,e){let t=$(n,e);return o=>n.graph.getNode(o)!==void 0&&t(o)}var z=["previewed","accepted","declined","undone","abandoned"],ve=["graph","light","full"],S={words:300,should:300,name:80,records:200,people:20,stages:8,examples:5},Se=365,xe=5e3,be=new RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2066-\\u2069]","g");function ie(n,e){if(typeof n!="string")return;let t=n.replace(be," ").replace(/\s+/g," ").trim();return t.length===0?void 0:t.slice(0,e).trimEnd()}function h(n){return typeof n=="string"&&n.length>0&&n.length<=S.name&&/^[\p{L}\p{N}_][\p{L}\p{N}_.:/-]*$/u.test(n)?n:void 0}var W=(n,e)=>Array.isArray(n)?[...new Set(n.flatMap(t=>h(t)??[]))].slice(0,e):[];function ae(n){let e=typeof n.id=="string"?n.id.slice(0,S.name):void 0;return{kind:n.kind,...e!==void 0?{id:e}:{},...n.onBehalfOf?{onBehalfOf:ae(n.onBehalfOf)}:{}}}var le=n=>n?.kind==="visitor"||n?.onBehalfOf?.kind==="visitor",ke=()=>`tl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Oe=new Set(["record","field","selection","list","lens","place","act"]);function Pe(n){let e=n,t=o=>typeof o=="number"&&Number.isFinite(o)&&o>=0?Math.min(1e4,Math.round(o)):0;switch(e?.type){case"act":{let o=h(e.act);return o?{type:"act",act:o,records:t(e.records)}:void 0}case"plan":return{type:"plan",edits:t(e.edits)};case"answer":return{type:"answer"};case"refusal":return{type:"refusal"};case"view":{let o=typeof e.section=="string"?e.section.replace(/\s+/g," ").trim().slice(0,S.name):"";return o?{type:"view",section:o}:void 0}default:return}}function se(n,e,t={}){if(!n||typeof n!="object"||!e||le(e))return;let o=n,i=ie(o.words,S.words),l=Pe(o.decided),d=o.target;if(!i||!l||!d||!Oe.has(String(d.on)))return;let s={on:d.on,...h(d.kind)?{kind:h(d.kind)}:{},...h(d.id)?{id:h(d.id)}:{},...h(d.place)?{place:h(d.place)}:{}},c=o.reading,a=c&&(c.which==="itself"||c.which==="held")&&h(c.kind)?{which:c.which,kind:h(c.kind),records:W(c.records,S.records)}:void 0,g=W(o.people,S.people),f=Array.isArray(o.stages)?o.stages.flatMap(Te=>{let L=Te,V=h(L?.stage),E=L?.ms;return V&&typeof E=="number"&&Number.isFinite(E)&&E>=0?[{stage:V,ms:Math.round(E),...h(L.model)?{model:h(L.model)}:{}}]:[]}).slice(0,S.stages):[],w=z.includes(o.outcome)?o.outcome:"previewed",y=ve.includes(o.slot)?o.slot:void 0,b=o.rating==="up"||o.rating==="down"?o.rating:void 0,k=b==="down"?ie(o.should,S.should):void 0,O=typeof o.ms=="number"&&Number.isFinite(o.ms)&&o.ms>=0?Math.round(o.ms):void 0,r=t.id??h(o.id)??ke(),p=h(o.conversation)??r,m=h(o.follows),Y=h(o.interaction),J=W(o.examples,S.examples);return{id:r,at:t.at??new Date().toISOString(),by:ae(e),words:i,target:s,...a?{reading:a}:{},...g.length>0?{people:g}:{},decided:l,...y?{slot:y}:{},...f.length>0?{stages:f}:{},...O!==void 0?{ms:O}:{},outcome:w,...b?{rating:b}:{},...k?{should:k}:{},conversation:p,...m?{follows:m}:{},...Y?{interaction:Y}:{},...J.length>0?{examples:J}:{}}}function Ae(n,e){let t=e.outcome===void 0||e.outcome==="previewed"||n.outcome==="accepted"&&e.outcome!=="undone"||n.outcome==="undone"||(n.outcome==="declined"||n.outcome==="abandoned")&&e.outcome==="abandoned"?n.outcome:e.outcome,o=e.rating===void 0?n.rating:e.rating??void 0,i=o!=="down"?void 0:e.should===void 0?n.should:e.should??void 0,{rating:l,should:d,...s}=n;return{...s,outcome:t,...o?{rating:o}:{},...i?{should:i}:{},...e.examples?{examples:e.examples}:{},...e.pinned!==void 0?{pinned:e.pinned}:{},...e.excluded!==void 0?{excluded:e.excluded}:{}}}function Ce(n,e={}){let t=(e.now??Date.now())-(e.retentionDays??Se)*864e5,o=new Map;for(let d of n){let s=Date.parse(d.at);Number.isFinite(s)&&s>=t&&!le(d.by)&&o.set(d.id,d)}let i=[...o.values()],l=e.most??xe;return i.length>l?i.slice(i.length-l):i}function H(n,e,t={}){return"add"in e?Ce([...n,e.add],t):"remove"in e?n.filter(o=>o.id!==e.remove):n.map(o=>o.id===e.change?Ae(o,e.with):o)}var C=n=>n.onBehalfOf?C(n.onBehalfOf):n.id!==void 0?`${n.kind}:${n.id}`:`${n.kind}:?`,Re=n=>[...new Set([...n.target.id?[n.target.id]:[],...n.reading?.records??[],...n.people??[]])];function R(n,e){return n.filter(t=>Re(t).every(e))}var B=n=>!n.excluded&&n.rating!=="down"&&n.outcome!=="undone"&&(n.outcome==="accepted"||n.rating==="up"),U=n=>{let e=n.reading?.kind??n.target.kind??"";return n.decided.type==="act"?`act:${n.decided.act}:${e}:${n.reading?.which??""}`:n.decided.type==="plan"?`plan:${e}`:void 0};function De(n,e={}){let t=Math.max(1,e.minPeople??2),o=e.reader?C(e.reader):void 0,i=new Map;for(let l of n){let d=U(l);!d||!B(l)||C(l.by)===o||i.set(d,(i.get(d)??new Set).add(C(l.by)))}return new Set([...i].filter(([,l])=>l.size>=t).map(([l])=>l))}function ce(n,e){return n.filter(t=>(e.rating===void 0||(e.rating==="none"?t.rating===void 0:t.rating===e.rating))&&(e.outcome===void 0||t.outcome===e.outcome)&&(e.kind===void 0||(t.reading?.kind??t.target.kind)===e.kind))}var Le=n=>n.filter(e=>B(e)&&U(e)!==void 0);function ue(n){let e=Le(n).length;return e===0?"Nothing told here teaches suggestions yet: a telling that is accepted or rated \u{1F44D} will.":`Suggestions come from ${e} rated ${e===1?"telling":"tellings"} in this app.`}function ge(n,e=t=>t){switch(n.decided.type){case"act":return`${e(n.decided.act)}, over ${n.decided.records} ${n.decided.records===1?"record":"records"}`;case"plan":return`A plan of ${n.decided.edits} ${n.decided.edits===1?"change":"changes"} to the app`;case"answer":return"An open answer";case"refusal":return"Nothing it could do";case"view":return`A revision of \u201C${n.decided.section}\u201D`}}var G={previewed:"Previewed",accepted:"Accepted",declined:"Declined",undone:"Undone",abandoned:"Closed with nothing done"},Ee=new Set("a an and are as at be by can do does for from has have how i in is it its me my of on or our please the their them these they this those to was we what when where which who why will with you your all each every".split(" "));function de(n){return[...new Set(n.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").split(/[^\p{L}\p{N}]+/u).filter(e=>e.length>1&&!Ee.has(e)).map(e=>e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e))]}function M(n,e,t={}){let o=de(e.words);if(o.length===0)return[];let i=t.reader?C(t.reader):void 0,l=De(n,{...t.reader?{reader:t.reader}:{},...t.minPeople!==void 0?{minPeople:t.minPeople}:{}}),d=n.flatMap(a=>{let g=U(a);if(!g||!B(a)||t.rated&&a.rating!=="up")return[];if(!(i!==void 0&&C(a.by)===i)&&!l.has(g))return[];let w=de(a.words),y=o.filter(p=>w.some(m=>m===p||p.length>=3&&m.startsWith(p))).length;if(y===0)return[];let b=y/new Set([...o,...w]).size,k=e.kind!==void 0&&(a.target.kind===e.kind||a.reading?.kind===e.kind)?.25:e.kind!==void 0?-.25:0,O=e.act!==void 0&&a.decided.type==="act"&&a.decided.act===e.act?.15:0,r=Math.max(0,Math.min(1,b*.6+.25+k+O+(a.pinned?.1:0)));return r>=(t.floor??.35)?[{telling:a,score:r,lesson:g}]:[]});d.sort((a,g)=>g.score-a.score||Number(g.telling.pinned??!1)-Number(a.telling.pinned??!1)||(a.telling.at<g.telling.at?1:-1));let s=new Set,c=[];for(let a of d)if(!s.has(a.lesson)&&(s.add(a.lesson),c.push({telling:a.telling,score:a.score}),c.length>=(t.most??2)))break;return c}function pe(n){return n.map(({telling:e})=>({said:e.words,did:e.decided.type==="act"?`act ${e.decided.act} over ${e.reading?.which==="itself"?"the record itself":"each record it holds"}`:e.decided.type==="plan"?"a plan that changes the app":e.decided.type==="view"?"a revision of a view's section":e.decided.type,...e.reading?{reading:e.reading.which}:{}}))}var x=P(ne(),1),T=P(N(),1);function ye(n,e){if(e.on==="list"||e.on==="lens")return e.kind;let t=te(e)[0];return t?n.graph.getNode(t)?.kind:void 0}function $e(n,e,t,o,i){let l=n?oe(n):void 0;if(!l)return{examples:[],ids:[]};let d=ye(e,i),s=M(R(l,A(e,t)),{words:o,...d?{kind:d}:{}},{reader:t,rated:!0,most:3});return{examples:pe(s),ids:s.map(c=>c.telling.id)}}function Ne(n){let e=new Set((n.stages??[]).map(t=>t.stage));return e.has("thinking")?"full":e.has("light")?"light":e.has("fast")?"graph":(n.usage??[]).some(t=>t.tier==="thinking")?"full":void 0}function Ie(n,e){if(n.interaction.outcome==="failed"||e&&"refused"in e)return{type:"refusal"};if(e&&"question"in e)return e.proposal?{type:"plan",edits:e.parts.length}:{type:"refusal"};let t=n.ghost?.proposals??[];return t.length>0?{type:"act",act:t[0].call.name,records:new Set(t.map(i=>i.record??i.id)).size}:{type:"answer"}}function Me(n,e){let t=new Set;for(let o of e.ghost?.proposals??[])for(let i of Object.values(o.call.args))typeof i=="string"&&i!==o.record&&n.graph.getNode(i)&&t.add(i);return[...t]}function _e(n,e){let{target:t,result:o}=e,i=ye(n,t),l=t.on==="record"||t.on==="field"?t.id:void 0,d=t.on==="lens"||t.on==="place"?t.place:void 0,s=o.reading?{which:o.reading.which,kind:o.reading.kind,records:o.reading.records}:void 0,c=Me(n,o),a=Ne(o.interaction),g=Ie(o,e.plan);return{words:e.words,target:{on:t.on,...i?{kind:i}:{},...l?{id:l}:{},...d?{place:d}:{}},...s?{reading:s}:{},...c.length>0?{people:c}:{},decided:g,...a?{slot:a}:{},...o.interaction.stages?{stages:o.interaction.stages}:{},ms:e.ms,outcome:"previewed",...e.conversation?{conversation:e.conversation}:{},...e.follows?{follows:e.follows}:{},interaction:o.interaction.id,...e.examples&&e.examples.length>0?{examples:e.examples}:{}}}function Fe(n,e,t){if(!n)return;let o=se(e,t);if(o)return re(n,o),Promise.resolve().then(()=>n.add(o)).catch(()=>{}),o}function _(n,e,t){n&&Promise.resolve().then(()=>n.change(e,t)).catch(()=>{})}var We={accepted:"accepted",partly:"accepted",drawn:"accepted",dismissed:"declined"};function ze(n,e,t){let o,i=()=>{let c=n.get().entries.find(g=>g.id===t.interaction);if(!c)return;let a=c.undone?"undone":We[c.outcome];!a||a===o||(o=a,_(e,t.id,{outcome:a}),a==="undone"&&s())},l=n.subscribe(i),d=setTimeout(()=>s(),30*6e4),s=()=>{l(),clearTimeout(d)};return s}function He({told:n,telling:e}){let[t,o]=(0,x.useState)(e.rating),[i,l]=(0,x.useState)(""),[d,s]=(0,x.useState)(!1),c=(0,x.useId)();(0,x.useEffect)(()=>{o(e.rating),l(""),s(!1)},[e.id,e.rating]);let a=f=>{let w=t===f?void 0:f;o(w),s(!1),_(n,e.id,{rating:w??null})},g=()=>{let f=i.trim();!f||t!=="down"||(_(n,e.id,{should:f}),s(!0))};return(0,T.jsxs)("div",{"data-testid":"quick-ask-rating","data-rating":t??"",style:{display:"grid",gap:6},children:[(0,T.jsxs)("div",{role:"group","aria-label":"Was this right?",style:{display:"flex",gap:4,justifyContent:"flex-end"},children:[(0,T.jsx)("button",{type:"button","data-testid":"quick-ask-right","aria-label":"This was right",title:"This was right","aria-pressed":t==="up",onClick:()=>a("up"),style:t==="up"?fe:K,children:(0,T.jsx)("span",{"aria-hidden":"true",children:"\u{1F44D}"})}),(0,T.jsx)("button",{type:"button","data-testid":"quick-ask-wrong","aria-label":"This was wrong",title:"This was wrong","aria-pressed":t==="down",onClick:()=>a("down"),style:t==="down"?fe:K,children:(0,T.jsx)("span",{"aria-hidden":"true",children:"\u{1F44E}"})})]}),t==="down"?(0,T.jsxs)("div",{style:{display:"grid",gap:2},children:[(0,T.jsxs)("label",{htmlFor:c,style:{fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:["What should it have done? ",(0,T.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"(optional)"})]}),(0,T.jsx)("input",{id:c,type:"text","data-testid":"quick-ask-should",value:i,maxLength:300,autoComplete:"off",enterKeyHint:"done",onChange:f=>{l(f.target.value),s(!1)},onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),g())},onBlur:g,style:Be}),d?(0,T.jsx)("span",{role:"status","data-testid":"quick-ask-should-kept",style:{fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:n.keptSays?.trim()||"Kept, to learn from."}):null]}):null]})}var K={display:"inline-grid",placeItems:"center",width:30,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer",opacity:.7},fe={...K,opacity:1,borderColor:"var(--graview-accent)",background:"var(--graview-panel)"},Be={boxSizing:"border-box",width:"100%",height:32,padding:"0 8px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8};var j=n=>n.charAt(0).toUpperCase()+n.slice(1);function me(n,e){if(!e)return;let t=n.graph.getNode(e);if(t)return t.kind;let o=/^(?:kind|aggregate):(.+)$/.exec(e)?.[1];return o&&n.schema.tryDefinition(o)?o:void 0}function he(n,e,t){let o=n.schema;if(e.decided.type==="plan")return j(e.words);if(e.decided.type!=="act")return;let i=e.decided.act,l=n.allMutations().find(y=>y.name===i);if(!l)return;let d=l.title??l.name,s=y=>/\b(?:it|this|them)\b/i.test(d)?d.replace(/\b(?:it|this|them)\b/i,y):`${d} ${y}`,c=t?n.graph.getNode(t):void 0,a=c?Q(o.tryDefinition(c.kind),c):void 0,g=e.reading?.kind??e.target.kind;if(!g||!o.tryDefinition(g))return;if(e.reading?.which==="itself"||!e.reading&&c?.kind===g)return c&&c.kind===g&&a?j(s(a)):void 0;let f=c?new Set([...n.graph.in(c.id),...n.graph.out(c.id)].filter(y=>y.kind===g).map(y=>y.id)).size:me(n,t)===g?n.graph.allNodes().filter(y=>y.kind===g).length:0;if(f===0)return;let w=f===1?(o.tryDefinition(g)?.noun??g).toLowerCase():X(o,g).toLowerCase();return j(s(`the ${f} ${w}${a?` in ${a}`:""}`))}async function Ue(n,e,t){return R(await I(n),A(e,t))}function Ge(n,e,t,o,i,l=4){if(o.trim()==="")return[];let d=me(e,i);return M(n,{words:o,...d?{kind:d}:{}},{reader:t,most:l}).flatMap(({telling:s})=>{let c=he(e,s,i);return c?[{key:`told:${s.id}`,telling:s,label:c}]:[]})}function Ke(n,e,t,o,i=3){let l=new Set,d=[];for(let s of[...n].reverse()){if(d.length>=i)break;if(!(s.rating==="up"||s.outcome==="accepted")||s.by!==void 0&&t.id!==void 0&&s.by.id!==void 0&&s.by.id!==t.id)continue;let c=he(e,s,o);!c||l.has(c.toLowerCase())||(l.add(c.toLowerCase()),d.push({key:`told:${s.id}`,telling:s,label:c}))}return d}var v=P(ne(),1),u=P(N(),1);function je({told:n,store:e,principal:t,onClose:o}){let[i,l]=(0,v.useState)(null),[d,s]=(0,v.useState)({}),c=(0,v.useRef)(null);(0,v.useEffect)(()=>{let r=!0;return Promise.resolve().then(()=>n.list()).then(p=>r&&l(p),()=>r&&l([])),c.current?.focus({preventScroll:!0}),()=>{r=!1}},[n]);let a=(0,v.useMemo)(()=>i?R(i,$(e,t)):[],[i,e,t]),g=(0,v.useMemo)(()=>[...ce(a,d)].sort((r,p)=>r.at<p.at?1:-1),[a,d]),f=(0,v.useMemo)(()=>[...new Set(a.flatMap(r=>r.reading?.kind??r.target.kind??[]))].sort(),[a]),w=r=>e.allMutations().find(p=>p.name===r)?.title??r,y=r=>e.schema.tryDefinition(r)?.plural??r,b=r=>{try{return Z(r.by,{graph:e.graph,schema:e.schema})}catch{return r.by.id??r.by.kind}},k=(r,p)=>{l(m=>m&&H(m,{change:r,with:p})),Promise.resolve().then(()=>n.change(r,p)).catch(()=>{})},O=r=>{l(p=>p&&H(p,{remove:r})),Promise.resolve().then(()=>n.remove(r)).catch(()=>{})};return(0,u.jsxs)("section",{ref:c,tabIndex:-1,"data-testid":"told-panel","data-graview-overlay":"","aria-label":"What Graview has been told",onKeyDown:r=>{r.key==="Escape"&&(r.stopPropagation(),o())},style:qe,children:[(0,u.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,u.jsx)("h2",{style:{margin:0,fontSize:"1rem",fontWeight:600,flex:"1 1 auto"},children:"What Graview has been told"}),(0,u.jsx)("button",{type:"button","data-testid":"told-close",onClick:o,style:F,children:"Close"})]}),(0,u.jsx)("p",{"data-testid":"told-teaching",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:i===null?"Reading what was told\u2026":ue(a)}),(0,u.jsxs)("div",{role:"group","aria-label":"Show only",style:{display:"flex",flexWrap:"wrap",gap:8,fontSize:"0.8125rem"},children:[(0,u.jsxs)("label",{style:q,children:["Rating",(0,u.jsxs)("select",{"data-testid":"told-filter-rating",value:d.rating??"",onChange:r=>s(({rating:p,...m})=>r.target.value?{...m,rating:r.target.value}:m),children:[(0,u.jsx)("option",{value:"",children:"Any"}),(0,u.jsx)("option",{value:"up",children:"\u{1F44D} Right"}),(0,u.jsx)("option",{value:"down",children:"\u{1F44E} Wrong"}),(0,u.jsx)("option",{value:"none",children:"Not rated"})]})]}),(0,u.jsxs)("label",{style:q,children:["Outcome",(0,u.jsxs)("select",{"data-testid":"told-filter-outcome",value:d.outcome??"",onChange:r=>s(({outcome:p,...m})=>r.target.value?{...m,outcome:r.target.value}:m),children:[(0,u.jsx)("option",{value:"",children:"Any"}),z.map(r=>(0,u.jsx)("option",{value:r,children:G[r]},r))]})]}),(0,u.jsxs)("label",{style:q,children:["Kind",(0,u.jsxs)("select",{"data-testid":"told-filter-kind",value:d.kind??"",onChange:r=>s(({kind:p,...m})=>r.target.value?{...m,kind:r.target.value}:m),children:[(0,u.jsx)("option",{value:"",children:"Any"}),f.map(r=>(0,u.jsx)("option",{value:r,children:y(r)},r))]})]})]}),i!==null&&g.length===0?(0,u.jsx)("p",{"data-testid":"told-none",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:a.length===0?"Nothing has been told here yet.":"Nothing told here fits these."}):null,(0,u.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,overflowY:"auto"},children:g.map(r=>(0,u.jsxs)("li",{"data-testid":"told-entry","data-telling":r.id,"data-outcome":r.outcome,"data-rating":r.rating??"","data-excluded":r.excluded?"":void 0,"data-pinned":r.pinned?"":void 0,style:Ye,children:[(0,u.jsxs)("p",{style:{margin:0,fontWeight:550,overflowWrap:"anywhere"},children:["\u201C",r.words,"\u201D"]}),(0,u.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem"},children:[ge(r,w)," \xB7 ",G[r.outcome],r.rating?` \xB7 ${r.rating==="up"?"\u{1F44D} right":"\u{1F44E} wrong"}`:"",r.pinned?" \xB7 a good example":"",r.excluded?" \xB7 excluded from suggestions":""]}),r.should?(0,u.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",fontStyle:"italic"},children:["Should have: ",r.should]}):null,(0,u.jsxs)("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:[b(r)," \xB7 ",(0,u.jsx)("time",{dateTime:r.at,children:new Date(r.at).toLocaleString()}),r.ms!==void 0?` \xB7 ${r.ms<1e3?`${r.ms} ms`:`${(r.ms/1e3).toFixed(1)} s`}`:""]}),(0,u.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[(0,u.jsx)("button",{type:"button","data-testid":"told-pin","aria-pressed":r.pinned===!0,onClick:()=>k(r.id,{pinned:!r.pinned}),style:F,children:r.pinned?"Not a good example":"A good example"}),(0,u.jsx)("button",{type:"button","data-testid":"told-exclude","aria-pressed":r.excluded===!0,onClick:()=>k(r.id,{excluded:!r.excluded}),style:F,children:r.excluded?"Suggest it again":"Exclude from suggestions"}),(0,u.jsx)("button",{type:"button","data-testid":"told-delete",onClick:()=>O(r.id),style:F,children:"Delete"})]})]},r.id))})]})}var qe={position:"absolute",insetBlock:"60px 12px",insetInlineEnd:12,width:"min(440px, calc(100% - 24px))",boxSizing:"border-box",display:"flex",flexDirection:"column",gap:10,padding:14,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",zIndex:ee("popover"),overflow:"hidden"},Ye={display:"grid",gap:4,padding:10,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},F={padding:"2px 10px",minHeight:28,font:"inherit",fontSize:"0.8125rem",borderRadius:8},q={display:"inline-flex",alignItems:"center",gap:4};export{He as RateTelling,je as ToldPanel,_ as changeTelling,$e as examplesHere,Fe as keepTelling,Ue as readToldHere,A as seenOnThisPage,_e as tellingDraftOf,Ke as toldForHere,I as toldListed,Ge as toldSuggestionsFrom,ze as watchTelling};
|
|
1
|
+
import{c as te}from"./chunk.DU76ASS4.js";import"./chunk.BJUUSIQY.js";import"./chunk.ZE5RSKXF.js";import"./chunk.IY3DV52G.js";import"./chunk.NLZHNPDU.js";import"./chunk.QNC2OKLF.js";import{G as ne,W as N}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import{eb as Z,la as Q,oa as X,td as ee,xd as $}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as P}from"./chunk.AJZBJBMO.js";var D=new WeakMap,we=5e3;function I(n){let e=D.get(n);if(e&&Date.now()-e.at<we)return e.list;let t={at:Date.now(),list:Promise.resolve([])};return t.list=Promise.resolve().then(()=>n.list()).catch(()=>[]).then(o=>t.value=[...o,...(t.value??[]).filter(i=>!o.some(l=>l.id===i.id))]),e?.value&&(t.value=e.value),D.set(n,t),t.list}var oe=n=>D.get(n)?.value;function re(n,e){let t=D.get(n);if(!t)return;let o=i=>[...i.filter(l=>l.id!==e.id),e];t.value&&(t.value=o(t.value)),D.set(n,{at:t.at,list:t.list.then(o),...t.value?{value:t.value}:{}})}function A(n,e){let t=$(n,e);return o=>n.graph.getNode(o)!==void 0&&t(o)}var z=["previewed","accepted","declined","undone","abandoned"],ve=["graph","light","full"],S={words:300,should:300,name:80,records:200,people:20,stages:8,examples:5},Se=365,xe=5e3,be=new RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2066-\\u2069]","g");function ie(n,e){if(typeof n!="string")return;let t=n.replace(be," ").replace(/\s+/g," ").trim();return t.length===0?void 0:t.slice(0,e).trimEnd()}function h(n){return typeof n=="string"&&n.length>0&&n.length<=S.name&&/^[\p{L}\p{N}_][\p{L}\p{N}_.:/-]*$/u.test(n)?n:void 0}var W=(n,e)=>Array.isArray(n)?[...new Set(n.flatMap(t=>h(t)??[]))].slice(0,e):[];function ae(n){let e=typeof n.id=="string"?n.id.slice(0,S.name):void 0;return{kind:n.kind,...e!==void 0?{id:e}:{},...n.onBehalfOf?{onBehalfOf:ae(n.onBehalfOf)}:{}}}var le=n=>n?.kind==="visitor"||n?.onBehalfOf?.kind==="visitor",ke=()=>`tl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Oe=new Set(["record","field","selection","list","lens","place","act"]);function Pe(n){let e=n,t=o=>typeof o=="number"&&Number.isFinite(o)&&o>=0?Math.min(1e4,Math.round(o)):0;switch(e?.type){case"act":{let o=h(e.act);return o?{type:"act",act:o,records:t(e.records)}:void 0}case"plan":return{type:"plan",edits:t(e.edits)};case"answer":return{type:"answer"};case"refusal":return{type:"refusal"};case"view":{let o=typeof e.section=="string"?e.section.replace(/\s+/g," ").trim().slice(0,S.name):"";return o?{type:"view",section:o}:void 0}default:return}}function se(n,e,t={}){if(!n||typeof n!="object"||!e||le(e))return;let o=n,i=ie(o.words,S.words),l=Pe(o.decided),d=o.target;if(!i||!l||!d||!Oe.has(String(d.on)))return;let s={on:d.on,...h(d.kind)?{kind:h(d.kind)}:{},...h(d.id)?{id:h(d.id)}:{},...h(d.place)?{place:h(d.place)}:{}},c=o.reading,a=c&&(c.which==="itself"||c.which==="held")&&h(c.kind)?{which:c.which,kind:h(c.kind),records:W(c.records,S.records)}:void 0,g=W(o.people,S.people),f=Array.isArray(o.stages)?o.stages.flatMap(Te=>{let L=Te,V=h(L?.stage),E=L?.ms;return V&&typeof E=="number"&&Number.isFinite(E)&&E>=0?[{stage:V,ms:Math.round(E),...h(L.model)?{model:h(L.model)}:{}}]:[]}).slice(0,S.stages):[],w=z.includes(o.outcome)?o.outcome:"previewed",y=ve.includes(o.slot)?o.slot:void 0,b=o.rating==="up"||o.rating==="down"?o.rating:void 0,k=b==="down"?ie(o.should,S.should):void 0,O=typeof o.ms=="number"&&Number.isFinite(o.ms)&&o.ms>=0?Math.round(o.ms):void 0,r=t.id??h(o.id)??ke(),p=h(o.conversation)??r,m=h(o.follows),Y=h(o.interaction),J=W(o.examples,S.examples);return{id:r,at:t.at??new Date().toISOString(),by:ae(e),words:i,target:s,...a?{reading:a}:{},...g.length>0?{people:g}:{},decided:l,...y?{slot:y}:{},...f.length>0?{stages:f}:{},...O!==void 0?{ms:O}:{},outcome:w,...b?{rating:b}:{},...k?{should:k}:{},conversation:p,...m?{follows:m}:{},...Y?{interaction:Y}:{},...J.length>0?{examples:J}:{}}}function Ae(n,e){let t=e.outcome===void 0||e.outcome==="previewed"||n.outcome==="accepted"&&e.outcome!=="undone"||n.outcome==="undone"||(n.outcome==="declined"||n.outcome==="abandoned")&&e.outcome==="abandoned"?n.outcome:e.outcome,o=e.rating===void 0?n.rating:e.rating??void 0,i=o!=="down"?void 0:e.should===void 0?n.should:e.should??void 0,{rating:l,should:d,...s}=n;return{...s,outcome:t,...o?{rating:o}:{},...i?{should:i}:{},...e.examples?{examples:e.examples}:{},...e.pinned!==void 0?{pinned:e.pinned}:{},...e.excluded!==void 0?{excluded:e.excluded}:{}}}function Ce(n,e={}){let t=(e.now??Date.now())-(e.retentionDays??Se)*864e5,o=new Map;for(let d of n){let s=Date.parse(d.at);Number.isFinite(s)&&s>=t&&!le(d.by)&&o.set(d.id,d)}let i=[...o.values()],l=e.most??xe;return i.length>l?i.slice(i.length-l):i}function H(n,e,t={}){return"add"in e?Ce([...n,e.add],t):"remove"in e?n.filter(o=>o.id!==e.remove):n.map(o=>o.id===e.change?Ae(o,e.with):o)}var C=n=>n.onBehalfOf?C(n.onBehalfOf):n.id!==void 0?`${n.kind}:${n.id}`:`${n.kind}:?`,Re=n=>[...new Set([...n.target.id?[n.target.id]:[],...n.reading?.records??[],...n.people??[]])];function R(n,e){return n.filter(t=>Re(t).every(e))}var B=n=>!n.excluded&&n.rating!=="down"&&n.outcome!=="undone"&&(n.outcome==="accepted"||n.rating==="up"),U=n=>{let e=n.reading?.kind??n.target.kind??"";return n.decided.type==="act"?`act:${n.decided.act}:${e}:${n.reading?.which??""}`:n.decided.type==="plan"?`plan:${e}`:void 0};function De(n,e={}){let t=Math.max(1,e.minPeople??2),o=e.reader?C(e.reader):void 0,i=new Map;for(let l of n){let d=U(l);!d||!B(l)||C(l.by)===o||i.set(d,(i.get(d)??new Set).add(C(l.by)))}return new Set([...i].filter(([,l])=>l.size>=t).map(([l])=>l))}function ce(n,e){return n.filter(t=>(e.rating===void 0||(e.rating==="none"?t.rating===void 0:t.rating===e.rating))&&(e.outcome===void 0||t.outcome===e.outcome)&&(e.kind===void 0||(t.reading?.kind??t.target.kind)===e.kind))}var Le=n=>n.filter(e=>B(e)&&U(e)!==void 0);function ue(n){let e=Le(n).length;return e===0?"Nothing told here teaches suggestions yet: a telling that is accepted or rated \u{1F44D} will.":`Suggestions come from ${e} rated ${e===1?"telling":"tellings"} in this app.`}function ge(n,e=t=>t){switch(n.decided.type){case"act":return`${e(n.decided.act)}, over ${n.decided.records} ${n.decided.records===1?"record":"records"}`;case"plan":return`A plan of ${n.decided.edits} ${n.decided.edits===1?"change":"changes"} to the app`;case"answer":return"An open answer";case"refusal":return"Nothing it could do";case"view":return`A revision of \u201C${n.decided.section}\u201D`}}var G={previewed:"Previewed",accepted:"Accepted",declined:"Declined",undone:"Undone",abandoned:"Closed with nothing done"},Ee=new Set("a an and are as at be by can do does for from has have how i in is it its me my of on or our please the their them these they this those to was we what when where which who why will with you your all each every".split(" "));function de(n){return[...new Set(n.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").split(/[^\p{L}\p{N}]+/u).filter(e=>e.length>1&&!Ee.has(e)).map(e=>e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e))]}function M(n,e,t={}){let o=de(e.words);if(o.length===0)return[];let i=t.reader?C(t.reader):void 0,l=De(n,{...t.reader?{reader:t.reader}:{},...t.minPeople!==void 0?{minPeople:t.minPeople}:{}}),d=n.flatMap(a=>{let g=U(a);if(!g||!B(a)||t.rated&&a.rating!=="up")return[];if(!(i!==void 0&&C(a.by)===i)&&!l.has(g))return[];let w=de(a.words),y=o.filter(p=>w.some(m=>m===p||p.length>=3&&m.startsWith(p))).length;if(y===0)return[];let b=y/new Set([...o,...w]).size,k=e.kind!==void 0&&(a.target.kind===e.kind||a.reading?.kind===e.kind)?.25:e.kind!==void 0?-.25:0,O=e.act!==void 0&&a.decided.type==="act"&&a.decided.act===e.act?.15:0,r=Math.max(0,Math.min(1,b*.6+.25+k+O+(a.pinned?.1:0)));return r>=(t.floor??.35)?[{telling:a,score:r,lesson:g}]:[]});d.sort((a,g)=>g.score-a.score||Number(g.telling.pinned??!1)-Number(a.telling.pinned??!1)||(a.telling.at<g.telling.at?1:-1));let s=new Set,c=[];for(let a of d)if(!s.has(a.lesson)&&(s.add(a.lesson),c.push({telling:a.telling,score:a.score}),c.length>=(t.most??2)))break;return c}function pe(n){return n.map(({telling:e})=>({said:e.words,did:e.decided.type==="act"?`act ${e.decided.act} over ${e.reading?.which==="itself"?"the record itself":"each record it holds"}`:e.decided.type==="plan"?"a plan that changes the app":e.decided.type==="view"?"a revision of a view's section":e.decided.type,...e.reading?{reading:e.reading.which}:{}}))}var x=P(ne(),1),T=P(N(),1);function ye(n,e){if(e.on==="list"||e.on==="lens")return e.kind;let t=te(e)[0];return t?n.graph.getNode(t)?.kind:void 0}function $e(n,e,t,o,i){let l=n?oe(n):void 0;if(!l)return{examples:[],ids:[]};let d=ye(e,i),s=M(R(l,A(e,t)),{words:o,...d?{kind:d}:{}},{reader:t,rated:!0,most:3});return{examples:pe(s),ids:s.map(c=>c.telling.id)}}function Ne(n){let e=new Set((n.stages??[]).map(t=>t.stage));return e.has("thinking")?"full":e.has("light")?"light":e.has("fast")?"graph":(n.usage??[]).some(t=>t.tier==="thinking")?"full":void 0}function Ie(n,e){if(n.interaction.outcome==="failed"||e&&"refused"in e)return{type:"refusal"};if(e&&"question"in e)return e.proposal?{type:"plan",edits:e.parts.length}:{type:"refusal"};let t=n.ghost?.proposals??[];return t.length>0?{type:"act",act:t[0].call.name,records:new Set(t.map(i=>i.record??i.id)).size}:{type:"answer"}}function Me(n,e){let t=new Set;for(let o of e.ghost?.proposals??[])for(let i of Object.values(o.call.args))typeof i=="string"&&i!==o.record&&n.graph.getNode(i)&&t.add(i);return[...t]}function _e(n,e){let{target:t,result:o}=e,i=ye(n,t),l=t.on==="record"||t.on==="field"?t.id:void 0,d=t.on==="lens"||t.on==="place"?t.place:void 0,s=o.reading?{which:o.reading.which,kind:o.reading.kind,records:o.reading.records}:void 0,c=Me(n,o),a=Ne(o.interaction),g=Ie(o,e.plan);return{words:e.words,target:{on:t.on,...i?{kind:i}:{},...l?{id:l}:{},...d?{place:d}:{}},...s?{reading:s}:{},...c.length>0?{people:c}:{},decided:g,...a?{slot:a}:{},...o.interaction.stages?{stages:o.interaction.stages}:{},ms:e.ms,outcome:"previewed",...e.conversation?{conversation:e.conversation}:{},...e.follows?{follows:e.follows}:{},interaction:o.interaction.id,...e.examples&&e.examples.length>0?{examples:e.examples}:{}}}function Fe(n,e,t){if(!n)return;let o=se(e,t);if(o)return re(n,o),Promise.resolve().then(()=>n.add(o)).catch(()=>{}),o}function _(n,e,t){n&&Promise.resolve().then(()=>n.change(e,t)).catch(()=>{})}var We={accepted:"accepted",partly:"accepted",drawn:"accepted",dismissed:"declined"};function ze(n,e,t){let o,i=()=>{let c=n.get().entries.find(g=>g.id===t.interaction);if(!c)return;let a=c.undone?"undone":We[c.outcome];!a||a===o||(o=a,_(e,t.id,{outcome:a}),a==="undone"&&s())},l=n.subscribe(i),d=setTimeout(()=>s(),30*6e4),s=()=>{l(),clearTimeout(d)};return s}function He({told:n,telling:e}){let[t,o]=(0,x.useState)(e.rating),[i,l]=(0,x.useState)(""),[d,s]=(0,x.useState)(!1),c=(0,x.useId)();(0,x.useEffect)(()=>{o(e.rating),l(""),s(!1)},[e.id,e.rating]);let a=f=>{let w=t===f?void 0:f;o(w),s(!1),_(n,e.id,{rating:w??null})},g=()=>{let f=i.trim();!f||t!=="down"||(_(n,e.id,{should:f}),s(!0))};return(0,T.jsxs)("div",{"data-testid":"quick-ask-rating","data-rating":t??"",style:{display:"grid",gap:6},children:[(0,T.jsxs)("div",{role:"group","aria-label":"Was this right?",style:{display:"flex",gap:4,justifyContent:"flex-end"},children:[(0,T.jsx)("button",{type:"button","data-testid":"quick-ask-right","aria-label":"This was right",title:"This was right","aria-pressed":t==="up",onClick:()=>a("up"),style:t==="up"?fe:K,children:(0,T.jsx)("span",{"aria-hidden":"true",children:"\u{1F44D}"})}),(0,T.jsx)("button",{type:"button","data-testid":"quick-ask-wrong","aria-label":"This was wrong",title:"This was wrong","aria-pressed":t==="down",onClick:()=>a("down"),style:t==="down"?fe:K,children:(0,T.jsx)("span",{"aria-hidden":"true",children:"\u{1F44E}"})})]}),t==="down"?(0,T.jsxs)("div",{style:{display:"grid",gap:2},children:[(0,T.jsxs)("label",{htmlFor:c,style:{fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:["What should it have done? ",(0,T.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"(optional)"})]}),(0,T.jsx)("input",{id:c,type:"text","data-testid":"quick-ask-should",value:i,maxLength:300,autoComplete:"off",enterKeyHint:"done",onChange:f=>{l(f.target.value),s(!1)},onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),g())},onBlur:g,style:Be}),d?(0,T.jsx)("span",{role:"status","data-testid":"quick-ask-should-kept",style:{fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:n.keptSays?.trim()||"Kept, to learn from."}):null]}):null]})}var K={display:"inline-grid",placeItems:"center",width:30,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer",opacity:.7},fe={...K,opacity:1,borderColor:"var(--graview-accent)",background:"var(--graview-panel)"},Be={boxSizing:"border-box",width:"100%",height:32,padding:"0 8px",font:"inherit",fontSize:"max(1rem,16px)",color:"var(--graview-ink)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:8};var j=n=>n.charAt(0).toUpperCase()+n.slice(1);function me(n,e){if(!e)return;let t=n.graph.getNode(e);if(t)return t.kind;let o=/^(?:kind|aggregate):(.+)$/.exec(e)?.[1];return o&&n.schema.tryDefinition(o)?o:void 0}function he(n,e,t){let o=n.schema;if(e.decided.type==="plan")return j(e.words);if(e.decided.type!=="act")return;let i=e.decided.act,l=n.allMutations().find(y=>y.name===i);if(!l)return;let d=l.title??l.name,s=y=>/\b(?:it|this|them)\b/i.test(d)?d.replace(/\b(?:it|this|them)\b/i,y):`${d} ${y}`,c=t?n.graph.getNode(t):void 0,a=c?Q(o.tryDefinition(c.kind),c):void 0,g=e.reading?.kind??e.target.kind;if(!g||!o.tryDefinition(g))return;if(e.reading?.which==="itself"||!e.reading&&c?.kind===g)return c&&c.kind===g&&a?j(s(a)):void 0;let f=c?new Set([...n.graph.in(c.id),...n.graph.out(c.id)].filter(y=>y.kind===g).map(y=>y.id)).size:me(n,t)===g?n.graph.allNodes().filter(y=>y.kind===g).length:0;if(f===0)return;let w=f===1?(o.tryDefinition(g)?.noun??g).toLowerCase():X(o,g).toLowerCase();return j(s(`the ${f} ${w}${a?` in ${a}`:""}`))}async function Ue(n,e,t){return R(await I(n),A(e,t))}function Ge(n,e,t,o,i,l=4){if(o.trim()==="")return[];let d=me(e,i);return M(n,{words:o,...d?{kind:d}:{}},{reader:t,most:l}).flatMap(({telling:s})=>{let c=he(e,s,i);return c?[{key:`told:${s.id}`,telling:s,label:c}]:[]})}function Ke(n,e,t,o,i=3){let l=new Set,d=[];for(let s of[...n].reverse()){if(d.length>=i)break;if(!(s.rating==="up"||s.outcome==="accepted")||s.by!==void 0&&t.id!==void 0&&s.by.id!==void 0&&s.by.id!==t.id)continue;let c=he(e,s,o);!c||l.has(c.toLowerCase())||(l.add(c.toLowerCase()),d.push({key:`told:${s.id}`,telling:s,label:c}))}return d}var v=P(ne(),1),u=P(N(),1);function je({told:n,store:e,principal:t,onClose:o}){let[i,l]=(0,v.useState)(null),[d,s]=(0,v.useState)({}),c=(0,v.useRef)(null);(0,v.useEffect)(()=>{let r=!0;return Promise.resolve().then(()=>n.list()).then(p=>r&&l(p),()=>r&&l([])),c.current?.focus({preventScroll:!0}),()=>{r=!1}},[n]);let a=(0,v.useMemo)(()=>i?R(i,$(e,t)):[],[i,e,t]),g=(0,v.useMemo)(()=>[...ce(a,d)].sort((r,p)=>r.at<p.at?1:-1),[a,d]),f=(0,v.useMemo)(()=>[...new Set(a.flatMap(r=>r.reading?.kind??r.target.kind??[]))].sort(),[a]),w=r=>e.allMutations().find(p=>p.name===r)?.title??r,y=r=>e.schema.tryDefinition(r)?.plural??r,b=r=>{try{return Z(r.by,{graph:e.graph,schema:e.schema})}catch{return r.by.id??r.by.kind}},k=(r,p)=>{l(m=>m&&H(m,{change:r,with:p})),Promise.resolve().then(()=>n.change(r,p)).catch(()=>{})},O=r=>{l(p=>p&&H(p,{remove:r})),Promise.resolve().then(()=>n.remove(r)).catch(()=>{})};return(0,u.jsxs)("section",{ref:c,tabIndex:-1,"data-testid":"told-panel","data-graview-overlay":"","aria-label":"What Graview has been told",onKeyDown:r=>{r.key==="Escape"&&(r.stopPropagation(),o())},style:qe,children:[(0,u.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,u.jsx)("h2",{style:{margin:0,fontSize:"1rem",fontWeight:600,flex:"1 1 auto"},children:"What Graview has been told"}),(0,u.jsx)("button",{type:"button","data-testid":"told-close",onClick:o,style:F,children:"Close"})]}),(0,u.jsx)("p",{"data-testid":"told-teaching",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:i===null?"Reading what was told\u2026":ue(a)}),(0,u.jsxs)("div",{role:"group","aria-label":"Show only",style:{display:"flex",flexWrap:"wrap",gap:8,fontSize:"0.8125rem"},children:[(0,u.jsxs)("label",{style:q,children:["Rating",(0,u.jsxs)("select",{"data-testid":"told-filter-rating",value:d.rating??"",onChange:r=>s(({rating:p,...m})=>r.target.value?{...m,rating:r.target.value}:m),children:[(0,u.jsx)("option",{value:"",children:"Any"}),(0,u.jsx)("option",{value:"up",children:"\u{1F44D} Right"}),(0,u.jsx)("option",{value:"down",children:"\u{1F44E} Wrong"}),(0,u.jsx)("option",{value:"none",children:"Not rated"})]})]}),(0,u.jsxs)("label",{style:q,children:["Outcome",(0,u.jsxs)("select",{"data-testid":"told-filter-outcome",value:d.outcome??"",onChange:r=>s(({outcome:p,...m})=>r.target.value?{...m,outcome:r.target.value}:m),children:[(0,u.jsx)("option",{value:"",children:"Any"}),z.map(r=>(0,u.jsx)("option",{value:r,children:G[r]},r))]})]}),(0,u.jsxs)("label",{style:q,children:["Kind",(0,u.jsxs)("select",{"data-testid":"told-filter-kind",value:d.kind??"",onChange:r=>s(({kind:p,...m})=>r.target.value?{...m,kind:r.target.value}:m),children:[(0,u.jsx)("option",{value:"",children:"Any"}),f.map(r=>(0,u.jsx)("option",{value:r,children:y(r)},r))]})]})]}),i!==null&&g.length===0?(0,u.jsx)("p",{"data-testid":"told-none",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:a.length===0?"Nothing has been told here yet.":"Nothing told here fits these."}):null,(0,u.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,overflowY:"auto"},children:g.map(r=>(0,u.jsxs)("li",{"data-testid":"told-entry","data-telling":r.id,"data-outcome":r.outcome,"data-rating":r.rating??"","data-excluded":r.excluded?"":void 0,"data-pinned":r.pinned?"":void 0,style:Ye,children:[(0,u.jsxs)("p",{style:{margin:0,fontWeight:550,overflowWrap:"anywhere"},children:["\u201C",r.words,"\u201D"]}),(0,u.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem"},children:[ge(r,w)," \xB7 ",G[r.outcome],r.rating?` \xB7 ${r.rating==="up"?"\u{1F44D} right":"\u{1F44E} wrong"}`:"",r.pinned?" \xB7 a good example":"",r.excluded?" \xB7 excluded from suggestions":""]}),r.should?(0,u.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",fontStyle:"italic"},children:["Should have: ",r.should]}):null,(0,u.jsxs)("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:[b(r)," \xB7 ",(0,u.jsx)("time",{dateTime:r.at,children:new Date(r.at).toLocaleString()}),r.ms!==void 0?` \xB7 ${r.ms<1e3?`${r.ms} ms`:`${(r.ms/1e3).toFixed(1)} s`}`:""]}),(0,u.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[(0,u.jsx)("button",{type:"button","data-testid":"told-pin","aria-pressed":r.pinned===!0,onClick:()=>k(r.id,{pinned:!r.pinned}),style:F,children:r.pinned?"Not a good example":"A good example"}),(0,u.jsx)("button",{type:"button","data-testid":"told-exclude","aria-pressed":r.excluded===!0,onClick:()=>k(r.id,{excluded:!r.excluded}),style:F,children:r.excluded?"Suggest it again":"Exclude from suggestions"}),(0,u.jsx)("button",{type:"button","data-testid":"told-delete",onClick:()=>O(r.id),style:F,children:"Delete"})]})]},r.id))})]})}var qe={position:"absolute",insetBlock:"60px 12px",insetInlineEnd:12,width:"min(440px, calc(100% - 24px))",boxSizing:"border-box",display:"flex",flexDirection:"column",gap:10,padding:14,borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",zIndex:ee("popover"),overflow:"hidden"},Ye={display:"grid",gap:4,padding:10,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},F={padding:"2px 10px",minHeight:28,font:"inherit",fontSize:"0.8125rem",borderRadius:8},q={display:"inline-flex",alignItems:"center",gap:4};export{He as RateTelling,je as ToldPanel,_ as changeTelling,$e as examplesHere,Fe as keepTelling,Ue as readToldHere,A as seenOnThisPage,_e as tellingDraftOf,Ke as toldForHere,I as toldListed,Ge as toldSuggestionsFrom,ze as watchTelling};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.VBHV4TLG.js";import"./chunk.T6PU3NKP.js";import"./chunk.
|
|
1
|
+
import"./chunk.VBHV4TLG.js";import"./chunk.T6PU3NKP.js";import"./chunk.W3WXI5B3.js";import"./chunk.ZU3RPI34.js";import{a as x,b as P,c as L}from"./chunk.D3SWJ7OS.js";import{b as R}from"./chunk.66TRDXYR.js";import"./chunk.I7OFRF6N.js";import"./chunk.4RPKCW4J.js";import"./chunk.4R7H3GIL.js";import"./chunk.CCCONK73.js";import"./chunk.IRNEWNUB.js";import"./chunk.AUNQNTKY.js";import"./chunk.KLEKC4ZX.js";import"./chunk.PJL3I2IW.js";import"./chunk.LMZ2WMGH.js";import"./chunk.OD5QZHRC.js";import"./chunk.YJ4PFOPC.js";import"./chunk.LKM2R5UF.js";import"./chunk.HJCQ6I3S.js";import"./chunk.EL7XXGQY.js";import"./chunk.CDSHUWSK.js";import"./chunk.5MOXQUZH.js";import"./chunk.MKN7ADJB.js";import"./chunk.I4H2GS4O.js";import"./chunk.25VJPUDH.js";import"./chunk.B5EFNTDA.js";import"./chunk.47VEV4BX.js";import"./chunk.FE3SINPK.js";import"./chunk.MUWI54IP.js";import"./chunk.3D37E2G5.js";import"./chunk.TBY5IR7C.js";import"./chunk.WFJCC6G3.js";import"./chunk.BIDL7GQD.js";import"./chunk.IO5VFTXC.js";import"./chunk.7L3I776Z.js";import"./chunk.CLIC2QBA.js";import"./chunk.UPOYRCKI.js";import"./chunk.XOZU4OFA.js";import"./chunk.WV6SP6IJ.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.MATUPDZ3.js";import"./chunk.SAWASNDO.js";import"./chunk.YFVJUHAK.js";import"./chunk.HCX6KPRF.js";import"./chunk.WVUJXDXZ.js";import"./chunk.B422DSYN.js";import"./chunk.ZE5RSKXF.js";import"./chunk.DKUEZPGR.js";import"./chunk.EP7YT7LT.js";import"./chunk.I7KN732Z.js";import"./chunk.TLPCYKLW.js";import"./chunk.MIE4TJRW.js";import{s as T}from"./chunk.SCVKHGO3.js";import"./chunk.RD2FSSLV.js";import"./chunk.AZRICZKT.js";import"./chunk.MH3AQO2R.js";import"./chunk.J2N7EKMX.js";import"./chunk.P26ATAAI.js";import"./chunk.FIY4RUK5.js";import"./chunk.IY3DV52G.js";import"./chunk.NLZHNPDU.js";import"./chunk.QNC2OKLF.js";import{G as S,I as $,W as p,ea as C,ga as A}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import{ka as v,td as k}from"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as i}from"./chunk.AJZBJBMO.js";var r=i(S(),1);var l=i(S(),1);var g=i(p(),1);var m={font:"inherit",fontSize:"0.875rem",minHeight:24,padding:0,border:0,borderRadius:2,background:"transparent",boxShadow:"none",color:"var(--graview-accent)",textDecoration:"underline",textUnderlineOffset:3,textAlign:"start",cursor:"pointer"};var e=i(p(),1);function Q({page:n=!1,go:E,onPick:y,onDiscard:N}){let{store:d,seatTalk:c}=C(),u=$(c),D=L(),h=E??D,{keep:M}=x(h),[H,f]=(0,r.useState)(!1);A();let t=u.draft;(0,r.useEffect)(()=>f(!1),[t]),(0,r.useEffect)(()=>{n||P(!1)},[n]);let w=(0,r.useRef)(null),b=t!==null&&!n;if((0,r.useLayoutEffect)(()=>{let s=w.current;if(!b||!s?.parentElement)return;let o=[];for(let a=s.previousElementSibling;a;a=a.previousElementSibling)a instanceof HTMLElement&&!a.inert&&a.tagName!=="STYLE"&&(a.inert=!0,o.push(a));return()=>{for(let a of o)a.inert=!1}},[b]),!t)return null;let G=R(t.drawn),F=d.schema.tryDefinition(t.kind),O=d.graph.nodesOfKind(t.kind).filter(s=>v(F,s)),q=()=>{c.setDraft(null),N?.()};return(0,e.jsxs)("section",{ref:w,"data-testid":"draft-frame","data-graview-draft-frame":n?"page":"scene","aria-label":`Draft: ${t.title}`,style:n?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:12,zIndex:k("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:12,boxShadow:"var(--graview-lift-high)",overflow:"hidden",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...z,...n?{}:{padding:"10px 16px"}},children:[n?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:H,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{f(!0),M(t).finally(()=>f(!1))},style:m,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:q,style:m,children:"Discard"})]}),u.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:n?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:u.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,role:"group","aria-label":t.title,tabIndex:0,style:n?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:s=>{let o=s.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!o||!d.graph.getNode(o))return;s.preventDefault();let a=d.graph.getNode(o);y?(c.setDraft(null),y(o)):h({to:"record",id:o,kind:a.kind,label:o,address:"",said:""})},children:(0,e.jsx)(T,{kind:t.kind,view:t.title,children:(0,e.jsx)(G,{nodes:O,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var z={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{Q as DraftFrame};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.NLZHNPDU.js";import"./chunk.QNC2OKLF.js";import{G as W,W as x}from"./chunk.FWXW4T4I.js";import"./chunk.SDO3U72B.js";import"./chunk.DHPXRDT5.js";import"./chunk.FQLNBIQ5.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function H({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{H as WhenMonth};
|