graview 0.1.61 → 0.1.62
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/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/preview/{chunk.SAYAFOF6.js → chunk.22BZU7ME.js} +1 -1
- package/dist/preview/chunk.2AT3GRXM.js +1 -0
- package/dist/preview/chunk.2B6P4GPS.js +1 -0
- package/dist/preview/{chunk.XZUHFXME.js → chunk.2GEJNG2U.js} +1 -1
- package/dist/preview/{chunk.R3N73BJO.js → chunk.2N4Z5K5S.js} +1 -1
- package/dist/preview/{chunk.3HFUO3DC.js → chunk.3FON2Y72.js} +1 -1
- package/dist/preview/chunk.3L37FY3G.js +4 -0
- package/dist/preview/{chunk.CRCJ3TAG.js → chunk.4HEFUOLV.js} +1 -1
- package/dist/preview/chunk.4HRYB7HF.js +1 -0
- package/dist/preview/{chunk.GQNSNJTJ.js → chunk.4TX6VCBT.js} +1 -1
- package/dist/preview/{chunk.4LG34OC2.js → chunk.5HGD6OWL.js} +2 -2
- package/dist/preview/{chunk.6VLCMBRE.js → chunk.5J3O2FVG.js} +1 -1
- package/dist/preview/{chunk.DP5DUV6F.js → chunk.5MZYCELA.js} +1 -1
- package/dist/preview/{chunk.F4VHCQNP.js → chunk.5ODHHH35.js} +1 -1
- package/dist/preview/{chunk.D5Q64GA4.js → chunk.5STU3KYG.js} +1 -1
- package/dist/preview/{chunk.PYVWGTQS.js → chunk.5YAOKOGV.js} +1 -1
- package/dist/preview/{chunk.E6RNMWFN.js → chunk.66P5IDTH.js} +1 -1
- package/dist/preview/{chunk.EN2ABVIP.js → chunk.6AKW7TXM.js} +1 -1
- package/dist/preview/{chunk.GI6XQF5X.js → chunk.6JO5HQDR.js} +1 -1
- package/dist/preview/{chunk.SIYBHZDD.js → chunk.75GVFX7L.js} +1 -1
- package/dist/preview/{chunk.E7UDVC4V.js → chunk.7KVUUEZA.js} +1 -1
- package/dist/preview/{chunk.W5TVQYAI.js → chunk.7M4HNKDR.js} +1 -1
- package/dist/preview/chunk.7OBIBPYH.js +1 -0
- package/dist/preview/chunk.7V56P2A7.js +1 -0
- package/dist/preview/{chunk.A2ZQASQV.js → chunk.7XLS6XTY.js} +1 -1
- package/dist/preview/chunk.7YOAW7ED.js +1 -0
- package/dist/preview/{chunk.3SMNWZ3M.js → chunk.A3OL2BI2.js} +1 -1
- package/dist/preview/{chunk.WS7LAT4Z.js → chunk.A3ZC2JBO.js} +1 -1
- package/dist/preview/{chunk.HZHNM2KI.js → chunk.ACTXR2MI.js} +1 -1
- package/dist/preview/chunk.AFNSAQEQ.js +1 -0
- package/dist/preview/{chunk.AVFOTYZR.js → chunk.AI34V6WV.js} +4 -4
- package/dist/preview/{chunk.VN7I7XIO.js → chunk.AJSUHPBE.js} +1 -1
- package/dist/preview/chunk.AQRB7LDA.js +1 -0
- package/dist/preview/{chunk.3FUUYYR5.js → chunk.B23WZQXQ.js} +1 -1
- package/dist/preview/chunk.BIDL7GQD.js +0 -0
- package/dist/preview/chunk.BLUKSGI4.js +1 -0
- package/dist/preview/chunk.BZMQDEIY.js +1 -0
- package/dist/preview/chunk.CAKFNKN5.js +1 -0
- package/dist/preview/chunk.CGALLZ54.js +1 -0
- package/dist/preview/{chunk.65KFZV3A.js → chunk.CHHYIMB7.js} +1 -1
- package/dist/preview/chunk.CXDGE5ZS.js +1 -0
- package/dist/preview/{chunk.KRFRREEW.js → chunk.CY3ELWCM.js} +1 -1
- package/dist/preview/chunk.DC35FJAB.js +1 -0
- package/dist/preview/{chunk.ZJCM62GH.js → chunk.DD2NKFDX.js} +1 -1
- package/dist/preview/{chunk.DHY7KOBV.js → chunk.DDO3GLEJ.js} +1 -1
- package/dist/preview/{chunk.6HZY5NRX.js → chunk.DDUCIUVW.js} +1 -1
- package/dist/preview/chunk.DEAP3H2L.js +1 -0
- package/dist/preview/chunk.DHJ3FQTR.js +1 -0
- package/dist/preview/{chunk.R5547CJ7.js → chunk.DNVWSWL2.js} +1 -1
- package/dist/preview/chunk.DPEIT3TW.js +1 -0
- package/dist/preview/chunk.DVSTLVIH.js +15 -0
- package/dist/preview/chunk.DZZL5IDD.js +5 -0
- package/dist/preview/{chunk.U2ISOUM2.js → chunk.ELOFPE25.js} +1 -1
- package/dist/preview/{chunk.7LZ6JDJA.js → chunk.ELTV44HU.js} +2 -2
- package/dist/preview/chunk.EVBCEEQ4.js +1 -0
- package/dist/preview/{chunk.HQNE4I4M.js → chunk.F7YXLYLX.js} +1 -1
- package/dist/preview/{chunk.MK72IRIY.js → chunk.FULEUL34.js} +1 -1
- package/dist/preview/{chunk.HOQMD6WQ.js → chunk.G4ULQK64.js} +14 -14
- package/dist/preview/{chunk.UXOBUK3C.js → chunk.GX4G4BX3.js} +1 -1
- package/dist/preview/chunk.H24OC6OE.js +1 -0
- package/dist/preview/chunk.H5S7OL2U.js +1 -0
- package/dist/preview/chunk.H73ZPYUX.js +1 -0
- package/dist/preview/{chunk.FJIXSGYU.js → chunk.H7N7WN4U.js} +1 -1
- package/dist/preview/chunk.HANJZ6FA.js +1 -0
- package/dist/preview/chunk.HIMQ65QT.js +1 -0
- package/dist/preview/chunk.I77ZGIFE.js +1 -0
- package/dist/preview/{chunk.ZC3FRCJQ.js → chunk.ILIIBSGA.js} +1 -1
- package/dist/preview/{chunk.66IKLMYX.js → chunk.IQ3PRWGO.js} +1 -1
- package/dist/preview/{chunk.DLDP6OWD.js → chunk.IQMD7DG3.js} +1 -1
- package/dist/preview/chunk.IQPILSV3.js +18 -0
- package/dist/preview/chunk.IYBEXENQ.js +1 -0
- package/dist/preview/{chunk.5S7IGASX.js → chunk.J7Q2WAF4.js} +1 -1
- package/dist/preview/{chunk.PJ5AO7CK.js → chunk.JT3MFPRD.js} +1 -1
- package/dist/preview/chunk.JYFZCJ4N.js +2 -0
- package/dist/preview/chunk.K2HDEL7I.js +1 -0
- package/dist/preview/chunk.KDXU5DT3.js +1 -0
- package/dist/preview/chunk.KL7E4YHJ.js +1 -0
- package/dist/preview/{chunk.SBLYBRDU.js → chunk.KMV6PJFL.js} +1 -1
- package/dist/preview/{chunk.DHJI7LIW.js → chunk.L3WTKQQL.js} +1 -1
- package/dist/preview/{chunk.REH6RXNH.js → chunk.LAYQ5PFS.js} +1 -1
- package/dist/preview/{chunk.UACSX64H.js → chunk.LGRLVJGS.js} +3 -3
- package/dist/preview/chunk.LTZUF5VG.js +1 -0
- package/dist/preview/{chunk.WD4VPMEE.js → chunk.M4AYA2PL.js} +1 -1
- package/dist/preview/chunk.M7RESZB6.js +25 -0
- package/dist/preview/{chunk.CUTLO6DA.js → chunk.MAKODQO3.js} +1 -1
- package/dist/preview/{chunk.SKQO467Y.js → chunk.MDEX6ZVE.js} +1 -1
- package/dist/preview/chunk.MGALQLRW.js +1 -0
- package/dist/preview/{chunk.PZXTSWDH.js → chunk.MYNMBOLD.js} +1 -1
- package/dist/preview/{chunk.YGIJDHAV.js → chunk.N6EJXXQK.js} +2 -2
- package/dist/preview/chunk.NAD7ZXYP.js +1 -0
- package/dist/preview/chunk.NHTGAP3G.js +3 -0
- package/dist/preview/{chunk.5IEFTFKQ.js → chunk.NJSK3UO2.js} +1 -1
- package/dist/preview/{chunk.ISRQQVS4.js → chunk.NOGGSLVG.js} +1 -1
- package/dist/preview/chunk.NUWDMH47.js +1 -0
- package/dist/preview/chunk.NUYA4BWI.js +1 -0
- package/dist/preview/{chunk.BDTT4ENI.js → chunk.O2BHPYA4.js} +2 -2
- package/dist/preview/chunk.O75HWF3F.js +1 -0
- package/dist/preview/chunk.OFWNMTGB.js +21 -0
- package/dist/preview/chunk.OKZT2QBM.js +2 -0
- package/dist/preview/{chunk.MBPOYZ3J.js → chunk.OUDATENL.js} +1 -1
- package/dist/preview/chunk.OUPURRDE.js +1 -0
- package/dist/preview/{chunk.GIW657OR.js → chunk.OWOOKLIU.js} +2 -1
- package/dist/preview/{chunk.7R727IKU.js → chunk.OWT3VVOT.js} +1 -1
- package/dist/preview/{chunk.VYFMUCBT.js → chunk.PCDUV3WP.js} +1 -1
- package/dist/preview/chunk.PD2DECOP.js +1 -0
- package/dist/preview/{chunk.2WZAFKJ2.js → chunk.PKWQKFPE.js} +1 -1
- package/dist/preview/{chunk.747OH3EE.js → chunk.PLTH2LW5.js} +1 -1
- package/dist/preview/{chunk.5POG3G2C.js → chunk.PZQNR4KZ.js} +1 -1
- package/dist/preview/chunk.Q5WEOX3Q.js +1 -0
- package/dist/preview/chunk.QDWSU47A.js +1 -0
- package/dist/preview/{chunk.U3JK2DNC.js → chunk.QGU5QTR6.js} +1 -1
- package/dist/preview/{chunk.6DOOLVT4.js → chunk.QHY5NVYH.js} +1 -1
- package/dist/preview/{chunk.BI6DS3PZ.js → chunk.QIPASE42.js} +1 -1
- package/dist/preview/{chunk.EVEHSENK.js → chunk.RD2X25XB.js} +1 -1
- package/dist/preview/{chunk.D4TA5XDC.js → chunk.RMR24LFJ.js} +3 -3
- package/dist/preview/chunk.ROZTJ6IY.js +6 -0
- package/dist/preview/{chunk.6SO64TUI.js → chunk.RPDH32XV.js} +1 -1
- package/dist/preview/chunk.RRKI24WY.js +1 -0
- package/dist/preview/{chunk.FWUG7Y6C.js → chunk.RYRQ66JN.js} +1 -1
- package/dist/preview/chunk.SEHRPTNA.js +7 -0
- package/dist/preview/{chunk.MBU7UH6J.js → chunk.SGCW2XRC.js} +1 -1
- package/dist/preview/{chunk.4G32374Q.js → chunk.SS7234R6.js} +1 -1
- package/dist/preview/{chunk.WICFQROI.js → chunk.SVPKUWZU.js} +1 -1
- package/dist/preview/{chunk.2LNSENPV.js → chunk.SWMDFXUX.js} +1 -1
- package/dist/preview/{chunk.XFSGB6EU.js → chunk.T3UQ7ZQK.js} +1 -1
- package/dist/preview/chunk.T6PU3NKP.js +1 -0
- package/dist/preview/{chunk.ZVG3DR5G.js → chunk.T6WHGKWR.js} +1 -1
- package/dist/preview/{chunk.JEQO24GS.js → chunk.THVC2BEC.js} +1 -1
- package/dist/preview/{chunk.SJALH7IX.js → chunk.TIALD6SC.js} +1 -1
- package/dist/preview/{chunk.ULHB3RYK.js → chunk.TM4EPUNO.js} +1 -1
- package/dist/preview/chunk.U6ZRJKVM.js +1 -0
- package/dist/preview/chunk.UFDJXQQQ.js +32 -0
- package/dist/preview/{chunk.Y7H5O2SL.js → chunk.UKQUUPKE.js} +1 -1
- package/dist/preview/{chunk.IA5ZBMRD.js → chunk.UQQKDBIH.js} +1 -1
- package/dist/preview/{chunk.NUEPFPRA.js → chunk.UVA7AALY.js} +1 -1
- package/dist/preview/chunk.UXMPFPFH.js +20 -0
- package/dist/preview/chunk.VACKSKGJ.js +1 -0
- package/dist/preview/{chunk.ZQHCNFJK.js → chunk.VC3V7HLL.js} +1 -1
- package/dist/preview/{chunk.N5WDQAIM.js → chunk.VIH5AX7S.js} +2 -2
- package/dist/preview/{chunk.ZKAZA6UJ.js → chunk.VJBBVLGZ.js} +1 -1
- package/dist/preview/chunk.VN23AGIY.js +1 -0
- package/dist/preview/{chunk.2XSIJH5J.js → chunk.W4BKYSZX.js} +1 -1
- package/dist/preview/{chunk.XZWXDQ3N.js → chunk.WEOVK2T4.js} +1 -1
- package/dist/preview/chunk.WKI5INH7.js +1 -0
- package/dist/preview/chunk.WPXPVD33.js +88 -0
- package/dist/preview/chunk.X6KYRBL6.js +1 -0
- package/dist/preview/{chunk.LA2DMHZC.js → chunk.Y2YYH3JN.js} +1 -1
- package/dist/preview/{chunk.MU3XII7I.js → chunk.Y4FZKUOK.js} +1 -1
- package/dist/preview/chunk.Y4S7CDRB.js +1 -0
- package/dist/preview/{chunk.C634A6ZC.js → chunk.YP2QSPXU.js} +1 -1
- package/dist/preview/{chunk.JHAFQNGC.js → chunk.Z2TDZSMN.js} +1 -1
- package/dist/preview/{chunk.2QFKNTAZ.js → chunk.ZN3PUM2I.js} +1 -1
- package/dist/preview/index.html +53 -51
- package/dist/preview/page.js +2 -2
- package/dist/preview/splash.js +57 -0
- package/package.json +6 -6
- package/dist/preview/chunk.2AWVQ5SW.js +0 -1
- package/dist/preview/chunk.3ICWPRRJ.js +0 -1
- package/dist/preview/chunk.3RW677X6.js +0 -1
- package/dist/preview/chunk.4OEWFPH3.js +0 -1
- package/dist/preview/chunk.4STDIZVI.js +0 -2
- package/dist/preview/chunk.5T53SF2K.js +0 -1
- package/dist/preview/chunk.5X22RKB3.js +0 -1
- package/dist/preview/chunk.644FUGSX.js +0 -1
- package/dist/preview/chunk.7CETF4A6.js +0 -1
- package/dist/preview/chunk.BFDJTWGX.js +0 -88
- package/dist/preview/chunk.BJI2C3IZ.js +0 -1
- package/dist/preview/chunk.DKXVEVDG.js +0 -1
- package/dist/preview/chunk.DXWTM4SH.js +0 -1
- package/dist/preview/chunk.F7IQ4B6A.js +0 -1
- package/dist/preview/chunk.F7PIW2EM.js +0 -5
- package/dist/preview/chunk.G4VMRYS4.js +0 -1
- package/dist/preview/chunk.GPWYWALF.js +0 -1
- package/dist/preview/chunk.HGVBGSRS.js +0 -6
- package/dist/preview/chunk.ISXNAFRC.js +0 -20
- package/dist/preview/chunk.JU3BCCQM.js +0 -1
- package/dist/preview/chunk.K2AC536Q.js +0 -21
- package/dist/preview/chunk.K3UOXAZS.js +0 -1
- package/dist/preview/chunk.KNYLY7MH.js +0 -1
- package/dist/preview/chunk.LQAT7FA6.js +0 -3
- package/dist/preview/chunk.LTI5PKTS.js +0 -1
- package/dist/preview/chunk.MBP7VDYM.js +0 -1
- package/dist/preview/chunk.MH6CCHEX.js +0 -1
- package/dist/preview/chunk.MNRTA2CB.js +0 -1
- package/dist/preview/chunk.MYVED5LU.js +0 -1
- package/dist/preview/chunk.N7T7VB77.js +0 -25
- package/dist/preview/chunk.ODVRO2BJ.js +0 -1
- package/dist/preview/chunk.OVPFROL3.js +0 -1
- package/dist/preview/chunk.PGA5TUSN.js +0 -1
- package/dist/preview/chunk.PHC2MI4C.js +0 -1
- package/dist/preview/chunk.PXQVXBNG.js +0 -1
- package/dist/preview/chunk.Q5I5M3FR.js +0 -1
- package/dist/preview/chunk.QATUGE34.js +0 -1
- package/dist/preview/chunk.QL77K3D4.js +0 -1
- package/dist/preview/chunk.QUJS63OJ.js +0 -13
- package/dist/preview/chunk.RZ5PPQBV.js +0 -1
- package/dist/preview/chunk.SCGF4ZPP.js +0 -1
- package/dist/preview/chunk.SLAZFFCQ.js +0 -1
- package/dist/preview/chunk.SLPJWOKC.js +0 -1
- package/dist/preview/chunk.TKLYUVMR.js +0 -32
- package/dist/preview/chunk.TMAZNDA6.js +0 -1
- package/dist/preview/chunk.UDCDK7XJ.js +0 -4
- package/dist/preview/chunk.UO544PZH.js +0 -1
- package/dist/preview/chunk.VKHAAH32.js +0 -1
- package/dist/preview/chunk.VOOOIECX.js +0 -1
- package/dist/preview/chunk.VS6NT5C4.js +0 -1
- package/dist/preview/chunk.VUAOCYG2.js +0 -1
- package/dist/preview/chunk.VX65S2FA.js +0 -1
- package/dist/preview/chunk.X2I3XH2E.js +0 -2
- package/dist/preview/chunk.XWWSW3ZV.js +0 -7
- package/dist/preview/chunk.YOT7ESDG.js +0 -18
- package/dist/preview/chunk.ZYNUMVEC.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as yt}from"./chunk.NOGGSLVG.js";import{a as mt}from"./chunk.EVBCEEQ4.js";import{f as pt}from"./chunk.OWT3VVOT.js";import{a as C,f as J}from"./chunk.NHTGAP3G.js";import{Ad as dt,F as X,J as k,L as tt,T as q,W as nt,Xb as ct,Y as et,Z as rt,ea as ot,ga as V,ja as F,ma as at,ob as ut,pa as st,ra as it,rb as ft}from"./chunk.DZZL5IDD.js";import{e as lt}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function z(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let o=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!o}),n=r.as==="open"}return e}function D(t,e){return z(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Pt(t){return D(t,!1)}function Lt(t){return D(t,!0)}function gt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function G(t){let e=l=>z(l).map(({part:a,space:s})=>({...a,space:s})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,o=l=>`${D(n,l)}${r?`, when ${D(r,l)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:o(!1),said:o(!0)}}function jt(t,e=!1){return t.line?gt(t.line,e):t.message}var ht=60,b=t=>({text:t,as:"name"}),f=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},P=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},v=(t,e)=>({text:t,as:"op",said:e}),R={text:"(",as:"open"},w={text:")",as:"close"},W={text:"\u2014",as:"value",said:"empty"},M={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},At={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},bt=t=>t.t==="binary"&&t.op in M;function T(t){return ot(t)}function vt(t){let{schema:e}=t,n=i=>i===null?void 0:e.tryDefinition(i),r=(i,d)=>{let y=n(i)?.edges;return y&&Object.hasOwn(y,d)?y[d]:void 0},o=(i,d)=>{let y=r(i,d)?.to;return Array.isArray(y)&&y.length===1?y[0]:null},l=(i,d)=>{let y=(e.edge(d)?.from??[]).filter(j=>{let $=r(j,d)?.to;return i===null||$==="*"||Array.isArray($)&&$.includes(i)});return y.length===1?y[0]:null},a=(i,d)=>r(i,d)?V(d).toLowerCase():T(st(n(i),d)),s=i=>T(at(e,i)),m=i=>T(pt(e).get(i)?.label??V(i)),g=i=>T(it(n(i),i)),S=(i,d)=>{let y=i===null?void 0:t.formatOf?.(i,d);if(y?.format)return y;let j=t.said?.get(d);return j?{...y,format:j}:y},u=i=>F(e.tryDefinition(i.kind),i),p=t.money?.locale,h=(i,d)=>{if(i==null)return W;if(i instanceof C){if(i.nodes.length===0)return W;let L=i.nodes.slice(0,3).map(u),Q=i.nodes.length-L.length;return P(Q>0?`${L.join(", ")} and ${Q} more`:L.length>1?`${L.slice(0,-1).join(", ")} and ${L[L.length-1]}`:L[0])}if(Array.isArray(i))return P(`{${i.map(L=>h(L,d).text).join(", ")}}`,i.map(L=>h(L,d).text).join(" or "));if(typeof i=="object")return P(u(i));if(typeof i=="boolean")return P(i?"yes":"no");let y=d?.format??(d?S(d.kind,d.key):void 0);if(typeof i=="number")return P(y&&y.format!=="date"?ct(i,{...t.money,...y}):rt(i,p));if(X.test(i)||y?.format==="date")return P(q(et(i,t.money?.timeZone)??i.slice(0,10),p));if(k.test(i))return P(nt(i,p,t.money?.timeZone));let j=d&&d.kind!==null?n(d.kind)?.display?.format?.[d.key]:void 0;if(j)return P(j(i));let $=i.length>ht?`${i.slice(0,ht-1).trimEnd()}\u2026`:i;return P(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test($)?$.replace(/[-_]+/g," "):$)};return{definition:n,relation:r,farOf:o,nearOf:l,fieldName:a,plural:s,noun:g,factName:m,formatOf:S,valueWords:h,locale:p}}function E(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:O(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=O(t.args[0],e,n),o=t.args[1];if(o.t==="ident")return{kind:r,key:o.name};if(o.t==="lit"&&typeof o.value=="string")return{kind:r,key:o.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return E(t.left,e,n)??E(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return E(t.args[1],e,n)??E(t.args[2],e,n)}function O(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(O(t.object,e,n),t.name);case"where":return O(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?O(t.left,e,n):null;case"call":{let r=o=>{let l=t.args[o];return l?.t==="lit"&&typeof l.value=="string"?l.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(O(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(O(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?O(t.args[0],e,n):null}default:return null}}function A(t){return t.t==="binary"?t.op==="||"?U(t)?4:1:t.op==="&&"?2:t.op in M||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var K=t=>t.t==="lit",x=(t,e)=>t.t==="call"&&t.fn===e;function I(t,e){return t.t==="binary"&&t.op===e?[...I(t.left,e),...I(t.right,e)]:[t]}function U(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...I(t,"||"));let n,r=[];for(let o of e){if(o.t!=="binary"||o.op!=="=="||!K(o.right)||typeof o.right.value!="string"||n&&JSON.stringify(xt(n))!==JSON.stringify(xt(o.left)))return;n=o.left,r.push(o.right)}return n?{subject:n,values:r}:void 0}var xt=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function c(t,e,n,r){let o=(l,a,s=e)=>A(l)<a?[R,...c(l,s,n),w]:c(l,s,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(l=>l.t==="lit"?l.value:null),r)];case"ident":return[b(n.fieldName(e,t.name))];case"member":{let l=x(t.object,"first")&&t.object.args[0]&&x(t.object.args[0],"all"),a=O(t.object,e,n);if(l&&a)return e!==null&&n.fieldName(e,t.name)===n.fieldName(a,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[b(`${n.noun(a)}'s ${n.fieldName(a,t.name)}`)]:[b(n.fieldName(a,t.name))];let s=c(t.object,e,n),m=s[s.length-1];return s.length===1&&m?.as==="name"?[b(`${m.text}'s ${n.fieldName(a,t.name)}`)]:[...s,f("'s"),b(n.fieldName(a,t.name))]}case"unary":return t.op==="-"?[v("\u2212","minus"),...o(t.operand,7)]:_(t.operand,e,n);case"where":{let l=O(t.set,e,n),a=c(t.filter,l,n),s=a.every(m=>m.as==="name"||m.as==="word"&&m.text==="not");return[...o(t.set,4),...s?[]:[f("with")],...A(t.filter)<=2?[R,...a,w]:a]}case"binary":return Rt(t,e,n);case"call":return St(t,e,n)}}function _(t,e,n){return bt(t)?Rt({...t,op:B[t.op]},e,n):x(t,"present")||x(t,"exists")?[...c(t.args[0],e,n),v("=","is"),W]:t.t==="ident"?[f("not"),b(n.fieldName(e,t.name))]:[f("not"),R,...c(t,e,n),w]}function Rt(t,e,n){let r=(a,s)=>A(a)<s?[R,...c(a,e,n),w]:c(a,e,n);if(t.op==="&&"||t.op==="||"){let a=U(t);if(a){let m=E(a.subject,e,n);return[...c(a.subject,e,n),v("\u2208","is one of"),n.valueWords(a.values.map(g=>g.value),m)]}let s=t.op==="&&"?2:1;return[...r(t.left,s),f(t.op==="&&"?"and":"or"),...r(t.right,s+.5)]}if(t.op in M){if(K(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?c(t.left,e,n):_(t.left,e,n);let[a,s]=M[t.op],m=E(t.left,e,n),g=E(t.right,e,n);return[...N(t.left,e,n,g),v(a,s),...N(t.right,e,n,m)]}if(t.op==="in")return[...r(t.left,5),v("\u2208","is one of"),...N(t.right,e,n,E(t.left,e,n))];let o=At[t.op];if(o){let a=A(t);return[...r(t.left,a),v(o[0],o[1]),...r(t.right,a+.5)]}let l={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),f(l[t.op]??t.op),...r(t.right,5)]}function N(t,e,n,r){return t.t==="lit"||t.t==="list"?c(t,e,n,r):A(t)<5?[R,...c(t,e,n),w]:c(t,e,n)}function St(t,e,n){let r=a=>t.args[a],o=a=>{let s=t.args[a];return s?.t==="lit"&&typeof s.value=="string"?s.value:void 0},l=a=>{let s=r(a);return A(s)<9&&s.t!=="where"?[R,...c(s,e,n),w]:c(s,e,n)};switch(t.fn){case"out":{let a=o(t.args.length-1)??"",s=b(V(a).toLowerCase());return t.args.length===2?[s,f("of"),...l(0)]:[s]}case"in":{let a=o(t.args.length-1)??"",s=t.args.length===2?n.nearOf(O(r(0),e,n),a):n.nearOf(e,a),m=b(s?n.plural(s):V(a).toLowerCase());return t.args.length===2?[m,f("of"),...l(0)]:[m]}case"all":{let a=o(0),s=t.args[1]?.t==="lit"?t.args[1].value:void 0,m=s===!0?[f("archived")]:s==="all"?[f("archived or not")]:[];return s===!0?[...m,b(a?n.plural(a):"everything")]:[b(a?n.plural(a):"everything"),...m]}case"fact":{let a=o(0);return[b(a?n.factName(a):"fact")]}case"count":return[f("number of"),...l(0)];case"exists":return[...l(0),v("\u2260","is not"),W];case"present":return[...c(r(0),e,n),v("\u2260","is not"),W];case"some":case"every":{let a=O(r(0),e,n),s=r(1);return[...t.fn==="some"?[f("some")]:[],...l(0),f(t.fn==="some"?"with":"all with"),...A(s)<=2?[R,...c(s,a,n),w]:c(s,a,n)]}case"sum":case"min":case"max":{let a=O(r(0),e,n),s=r(1),m=s.t==="lit"&&typeof s.value=="string"?[b(n.fieldName(a,s.value))]:A(s)<9?[R,...c(s,a,n),w]:c(s,a,n);return[f(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...m,f("of"),...l(0)]}case"first":{let a=r(0);if(x(a,"all")){let s=a.args[0]?.value;if(typeof s=="string")return[b(`the ${n.noun(s)}`)]}return[f("first of"),...l(0)]}case"sort":return[...l(0),f("by"),...c(r(1),O(r(0),e,n),n)];case"len":return[f("length of"),...c(r(0),e,n)];case"lower":return c(r(0),e,n);case"round":return[...c(r(0),e,n),f(t.args.length===2&&K(r(1))?`rounded to ${String(r(1).value)} places`:"rounded")];case"contains":case"startsWith":return[...c(r(0),e,n),f(t.fn==="contains"?"contains":"starts with"),...N(r(1),e,n,E(r(0),e,n))];case"today":return[P("today")];case"now":return[P("now")];case"date":return K(r(0))&&typeof r(0).value=="string"?[P(q(String(r(0).value),n.locale))]:c(r(0),e,n);case"days":case"hours":{let a=t.fn,[s,m]=[r(0),r(1)];return x(m,"today")||x(m,"now")?[f(`${a} since`),...c(s,e,n)]:x(s,"today")||x(s,"now")?[f(`${a} until`),...c(m,e,n)]:[f(`${a} from`),...c(s,e,n),f("to"),...c(m,e,n)]}case"if":return[R,...c(r(1),e,n),f("if"),...c(r(0),e,n),f(","),f("else"),...c(r(2),e,n),w];case"either":return t.args.flatMap((a,s)=>s===0?c(a,e,n):[f(","),f("else"),...c(a,e,n)]);default:return[f(t.fn),R,...t.args.flatMap((a,s)=>s===0?c(a,e,n):[f(","),...c(a,e,n)]),w]}}function H(t){let e=n=>b(V(n).toLowerCase());return[f("through"),e(t.through.relation),...t.via?[f(","),f("then"),e(t.via.relation)]:[]]}function Z(t,e){let n=vt(e),r=t.over==="graph"?null:t.over,o=t.covers?[f("reaches every"),b(n.noun(t.covers.every)),...H(t.covers)]:c(t.require,r,n);return G({...r===null?{}:{kind:r},parts:o,...t.when?{when:c(t.when,r,n)}:{}})}function Y(t,e,n,r){let o=vt(e),l=t.over==="graph"?null:t.over,a=n.subject;if(t.covers)return G({...l===null?{}:{kind:l},parts:r?[f("does not reach"),o.valueWords(r),...H(t.covers)]:[f("does not reach every"),b(o.noun(t.covers.every)),...H(t.covers)],...a?{record:F(e.schema.tryDefinition(a.kind),a)}:{}});let s=u=>{try{return J(u,{...n,budget:2e3})}catch{return}},m=(u,p)=>{let h=N(u,l,o,p);if(u.t==="lit"||u.t==="list"||x(u,"today")||x(u,"now")||x(u,"date"))return h;let i=s(u);if(i===void 0)return h;let d=E(u,l,o),y=o.valueWords(i,d?{...d,format:o.formatOf(d.kind,d.key)??(p?o.formatOf(p.kind,p.key):void 0)}:p);return i instanceof C?[...h,f(":"),y]:[...h,y]},g=u=>{if(u.t==="binary"&&u.op==="&&"){let p=[];p.push(...I(u,"&&"));let h=p.filter(i=>s(i)!==!0);return(h.length>0?h:p).flatMap((i,d)=>[...d>0?[f("and")]:[],...A(i)<=2?[R,...g(i),w]:g(i)])}if(u.t==="binary"&&u.op==="||"){let p=U(u);if(p){let i=E(p.subject,l,o);return[...m(p.subject),v("\u2209","is not one of"),o.valueWords(p.values.map(d=>d.value),i)]}let h=[];return h.push(...I(u,"||")),h.flatMap((i,d)=>[...d>0?[f("and")]:[],...A(i)<=2?[R,...g(i),w]:g(i)])}if(u.t==="binary"&&u.op in M){if(K(u.right)&&typeof u.right.value=="boolean"&&(u.op==="=="||u.op==="!="))return u.op==="=="===u.right.value?_(u.left,l,o):c(u.left,l,o);let p=B[u.op],[h,i]=M[p],d=E(u.left,l,o),y=E(u.right,l,o);if(K(u.right)&&u.right.value===null)return[...p==="=="?N(u.left,l,o,y):m(u.left,y),v(h,i),W];let j=p==="=="&&(K(u.right)||K(u.left));return[...j?N(u.left,l,o,y):m(u.left,y),v(h,i),...j?N(u.right,l,o,d):m(u.right,d)]}if(u.t==="binary"&&u.op==="in")return[...m(u.left),v("\u2209","is not one of"),...N(u.right,l,o,E(u.left,l,o))];if(u.t==="unary"&&u.op==="!"){let p=u.operand;return bt(p)?g({...p,op:B[p.op]}):x(p,"present")||x(p,"exists")?[...m(p.args[0]),v("\u2260","is not"),W]:p.t==="ident"?c(p,l,o):[f("not"),R,..._(p,l,o),w]}if(x(u,"present")||x(u,"exists"))return[...c(u.args[0],l,o),v("=","is"),W];if(x(u,"some"))return[...c(u,l,o).slice(1),v("=","is"),W];if(x(u,"every")&&u.args.length===2){let p=s(u.args[0]);if(p instanceof C){let h=p.nodes.filter(i=>{try{return J(u.args[1],{...n,subject:i,budget:2e3})!==!0}catch{return!0}});return[...c(u,l,o),f(","),f("not"),o.valueWords(new C(h))]}}return u.t==="ident"?[f("not"),b(o.fieldName(l,u.name))]:[f("not"),R,...c(u,l,o),w]},S;try{S=g(t.require)}catch{S=[f("not"),R,...c(t.require,l,o),w]}return G({...l===null?{}:{kind:l},parts:S,...a?{record:F(e.schema.tryDefinition(a.kind),a)}:{}})}function wt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function Nt(t){return(e,n)=>{let r=t[e]?.fields?.[n],o=r?.format??(r?.type==="date"?"date":void 0);return o||r?.unit?{...o?{format:o}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function Et(t,e){return{schema:e,said:wt(t.says),...t.declared?{formatOf:Nt(t.declared)}:{},...t.money?{money:t.money}:{}}}function Xt(t,e){return t.shape?Z(t.shape,Et(t.shape,e)):void 0}var Ot=new WeakMap;function Wt(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let o=Vt(r),l=n.get(o.invariant)?.shape;if(!l||o.status&&o.status!=="violated")return o;let a=o.subjectId?t.graph.getNode(o.subjectId):void 0;if(l.over!=="graph"&&!a)return o;let s=l.kinds;s||(s=Ot.get(t.schema),s||Ot.set(t.schema,s=mt(t.schema)));try{let m=t.today?.()??l.today?.()??tt(),g=l.covers?o.nodeIds.find(p=>p!==o.subjectId):void 0,S=g?t.graph.getNode(g):void 0,u=Y(l,Et(l,t.schema),{graph:t.graph,subject:a??null,kinds:s,today:m},S);return{...o,line:u,...l.says||l.covers?{}:{message:`${o.message} \u2014 ${u.text}`}}}catch{return o}})}function $t(){ft((t,e,n,r)=>Wt({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),yt(Kt)}function Kt(t,e,n,r){let o=e.graph,l=ut.from(t.schema,o.snapshot(),{validate:!1});for(let g of n?[...r].reverse().map(lt):r)try{l.applyPrimitives([g],{restoring:!0})}catch{}let a=g=>t.violations(void 0,g),s=a(n?l:o),m=a(n?o:l);return{...dt(t.allInvariants(),s,m),violationsAfter:m}}function Vt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}$t();export{Y as brokenLineOf,$t as judgeWithLines,Kt as judgedForASeat,jt as problemWords,Xt as ruleLine,Z as ruleLineOf,gt as ruleLineWords,z as ruleSpacing,Lt as ruleSpoken,Pt as ruleText,Vt as unlined,Wt as withLines};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{c as ur}from"./chunk.HOQMD6WQ.js";import{G as R,Ga as O,Ma as hn,Na as vn,Oa as bn,Ra as q,T as P,Va as j,a as Ae,ba as ue,ca as Z,e as Te,l as un,la as yn,m as fn,s as gn,ta as wn,v as oe,z as mn}from"./chunk.N7T7VB77.js";import{a as C}from"./chunk.SDO3U72B.js";import{Ac as Ze,Ad as ae,Bd as rn,Dd as Le,Fd as tn,Gd as an,Hc as $,Hd as Q,Ic as Je,Jc as Xe,Lc as en,Mc as nn,Od as on,Pd as sn,Qd as ln,Rd as dn,Sd as cn,Td as Ee,Xd as pn,_a as Ue,ga as qe,ka as je,la as Ye,pb as Qe,zd as pe}from"./chunk.F7PIW2EM.js";import{b as v}from"./chunk.AJZBJBMO.js";var He=v(R(),1),kn=new WeakMap,fe=e=>{let n=kn.get(e);return n||kn.set(e,n={open:null,drawn:0,listeners:new Set}),n},fr=e=>{for(let n of[...e.listeners])n()},gr=0;function At(e,n){let t=fe(e);t.open=n?{...n,at:++gr}:null,fr(t)}var xn=e=>n=>{let t=fe(e);return t.listeners.add(n),()=>void t.listeners.delete(n)};function Sn(e){let n=()=>e?fe(e).drawn>0:!1;return(0,He.useSyncExternalStore)(e?xn(e):mr,n,n)}var mr=()=>()=>{};function Tt(e){let n=()=>fe(e).open;return(0,He.useSyncExternalStore)(xn(e),n,n)}var V=v(R(),1),Pn=v(ur(),1);function yr(e){let[n,t]=(0,V.useState)(null),[r,i]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{e.current!==r&&i(e.current)}),(0,V.useLayoutEffect)(()=>{if(!r||typeof ResizeObserver>"u")return;let a=()=>Math.round(r.getBoundingClientRect().width),s=a();t(s);let p=new ResizeObserver(()=>{let c=a();c!==s&&(s=c,(0,Pn.flushSync)(()=>t(c)))});return p.observe(r),()=>p.disconnect()},[r]),n}function wr(e=!0){let[n,t]=(0,V.useState)();return(0,V.useEffect)(()=>{if(!e)return t(void 0);let r=0,i=()=>t(innerHeight),a=()=>{i(),clearTimeout(r),r=window.setTimeout(i,300)},s=p=>{for(let[c,d]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])c?.[p](d,a)};return s("addEventListener"),i(),()=>{clearTimeout(r),s("removeEventListener")}},[e]),n}var ge={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var A=v(R(),1);var N=v(P(),1),Ln=6e3;function hr(){let e=[],n=0,t=new Set,r=new Map,i,a=()=>{for(let d of[...t])d()},s=d=>{if(clearTimeout(r.get(d.id)),r.delete(d.id),d.kind!=="toast")return;let u=(d.actions?.length??0)+(d.action?1:0),l=d.timeout??(u>0?!1:Ln);l!==!1&&r.set(d.id,setTimeout(()=>i?.()?s(d):p(d.id),l))},p=d=>{clearTimeout(r.get(d)),r.delete(d),e.some(u=>u.id===d)&&(e=e.filter(u=>u.id!==d),a())},c=d=>{e=e.some(u=>u.id===d.id)?e.map(u=>u.id===d.id?d:u):[...e,d],s(d),a()};return{notify(d){let u=d.id??`notice-${++n}`;return c({...d,id:u,said:++n}),{id:u,dismiss:()=>p(u),update:l=>{let m=e.find(w=>w.id===u);m&&c({...m,...l,id:u,kind:m.kind,said:l.sentence!==void 0&&l.sentence!==m.sentence?++n:m.said})}}},dismiss:p,hold(d){i=d},list:()=>e,subscribe(d){return t.add(d),()=>t.delete(d)}}}function vr({notices:e}){let n=e.reduce((p,c)=>!p||c.said>p.said?c:p,void 0),[t,r]=(0,A.useState)(""),[i,a]=(0,A.useState)(""),s=(0,A.useRef)(0);return(0,A.useEffect)(()=>{if(!n||n.said===s.current)return;s.current=n.said;let p=n.tone==="bad";(p?a:r)("");let c=setTimeout(()=>(p?a:r)(n.sentence),50);return()=>clearTimeout(c)},[n]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ge,children:t}),(0,N.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ge,children:i})]})}var br=(0,A.createContext)(null);function kr({board:e,anchor:n}){let t=(0,A.useSyncExternalStore)(e.subscribe,e.list,e.list);return(0,A.useEffect)(()=>Pr(Ne.prefetch),[]),(0,N.jsxs)(N.Fragment,{children:[t.length>0?(0,N.jsx)(A.Suspense,{fallback:null,children:(0,N.jsx)(Sr,{notices:t,anchor:n,board:e})}):null,(0,N.jsx)(vr,{notices:t})]})}var Ne=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.BJI2C3IZ.js")))),xr=()=>Ne.load().then(()=>{},()=>{}),Sr=Ne.part((e,n)=>(0,N.jsx)(e.NoticeStacks,{...n}),{quiet:!0});function Pr(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}var M=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.MU3XII7I.js","./chunk.GQNSNJTJ.js","./chunk.SJALH7IX.js","./chunk.6DOOLVT4.js","./chunk.VX65S2FA.js","./chunk.747OH3EE.js","./chunk.E6RNMWFN.js","./chunk.IA5ZBMRD.js","./chunk.VN7I7XIO.js","./chunk.MBP7VDYM.js","./chunk.2XSIJH5J.js","./chunk.U5P23GO7.js","./chunk.GZHZLJBF.js","./chunk.Y7H5O2SL.js","./chunk.OJGHDWI6.js","./chunk.6HZY5NRX.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4LG34OC2.js"))));var y=v(R(),1);var Tn=v(R(),1);var En=v(R(),1);function ie(e){return(0,En.useMemo)(()=>e===void 0||e===""?void 0:{__html:e},[e])}var _=v(P(),1);function Be({brand:e,size:n=22}){let t=en(e),r=An(t?.light),i=r?An(t?.dark):void 0,a=ie(r!==void 0&&$(r)?r:void 0),s=ie(i!==void 0&&$(i)?i:void 0),p={display:"inline-flex",flex:"0 0 auto",height:n,color:"var(--graview-accent)"},c=nn(e);if(c)return(0,_.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...p,alignItems:"center",fontSize:`${n*.86/16}rem`,lineHeight:1},children:c});if(!r)return null;let d=e?.logoAlt??e?.name??"",u=d!==""&&d!==e?.name,l=u?{role:"img","aria-label":d}:{"aria-hidden":!0};if(i){let w=(h,S,b)=>$(h)?(0,_.jsx)("span",{className:"graview-logo-face","data-graview-scheme-only":b,dangerouslySetInnerHTML:S}):(0,_.jsx)("img",{className:"graview-logo-face","data-graview-scheme-only":b,src:h,alt:""});return(0,_.jsxs)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...l,children:[w(r,a,"light"),w(i,s,"dark")]})}let m=t?.darkFallback==="invert"?{"data-graview-logo-fallback":"invert"}:{};return $(r)?(0,_.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...m,...l,dangerouslySetInnerHTML:a}):(0,_.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:r,alt:u?d:"",...m,style:{...p,width:"auto"}})}function An(e){if(!(!e||!Xe(e)))return $(e)&&Je(e)!==null?void 0:e}function Lr(e){(0,Tn.useEffect)(()=>{if(!e||typeof document>"u")return;let n=[...document.querySelectorAll('link[rel~="icon"]')],t=n.map(i=>i.getAttribute("href")),r;n.length===0&&(r=document.createElement("link"),r.rel="icon",r.setAttribute("data-graview-favicon",""),document.head.appendChild(r),n.push(r));for(let i of n)i.href=e;return()=>{r&&r.remove(),n.forEach((i,a)=>{i!==r&&t[a]!==null&&t[a]!==void 0&&i.setAttribute("href",t[a])})}},[e])}var o=v(P(),1),Er=M.part((e,n)=>(0,o.jsx)(e.TidyFoot,{...n}),{quiet:!0}),Ar=M.part((e,n)=>(0,o.jsx)(e.Here,{...n}),{quiet:!0});function Tr(){let e=Z(),[n,t]=(0,y.useState)("");return(0,y.useEffect)(()=>e?.store.subscribe((r,i)=>{i.some(a=>a.author.id!==e.principal.id)&&M.load().then(a=>a.sayTheirChange(i,e,t),String)}),[e]),(0,o.jsx)("span",{role:"status",className:"graview-bar-said",children:n})}var Hn="home",Nn="/",Y="scene:whole";function Hr(e){let{store:n,principal:t,views:r}=e,i=n.kindsKeptFrom(t),a=n.schema.kinds.filter(f=>!n.modules.disabledKinds.has(f)&&!i.has(f)),s=r?.arrangement?.(),p=r?.places()??[],c=dn(s,n.schema,p),d=ln(n.schema,s,[...n.modules.administered.values()].flatMap(f=>f.kinds??[])),u=(f,x)=>(!n.graph.size.nodes||n.graph.count(f)>0)&&(c?x?c.places.has(`${f}|${x}`):c.kinds.has(f):!d.has(f)),l=[{key:Hn,label:"Home",path:Nn,group:"home",primary:!0}],m=p.filter(f=>a.includes(f.kind)&&f.as!==cn),w=m.filter(f=>!f.hidden),h=new Set(ae(w).map(f=>Q(f,p,n.schema).toLowerCase())),S=f=>tn(f.as,an(f,p)?Le(n.schema,f.kind).slice(1):void 0),b=new Set(s?.hide??[]),L=pn(a,s?.order,w);for(let{kind:f,view:x}of L){if(x){l.push({key:`place:${x.kind}:${x.as}`,label:Q(x,p,n.schema),path:S(x),group:"lists",kind:f,primary:c?c.places.has(`${f}|${x.as}`):!0});continue}let U=je(n.schema,f),H=h.has(U.toLowerCase());l.push({key:`kind:${f}`,label:H?Ye(n.schema,f):U,path:Le(n.schema,f),group:"lists",kind:f,primary:H||b.has(f)?!1:u(f),...b.has(f)?{hidden:!0}:{}})}for(let f of ae(m)){if(L.some(H=>H.view&&pe(H.view,f)))continue;let x=S(f),U=[f.kind,...f.over??[]].some(H=>a.includes(H)&&u(H,f.as));l.some(H=>H.path===x)||l.push({key:`place:${f.kind}:${f.as}`,label:Q(f,p,n.schema),path:x,group:"pictures",kind:f.kind,primary:U,hidden:f.hidden})}return a.some(f=>Object.keys(n.schema.tryDefinition(f)?.edges??{}).length>0)&&l.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),l}function Nr(e,n){let[t="/",r=""]=n.split("?"),i=e.find(s=>s.path===(r?`${t}?${r}`:t))??e.find(s=>s.path===t);if(i)return i.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return e.find(s=>s.group==="lists"&&s.path===a)?.key??null}var Bn=(0,y.createContext)(null),Br=()=>(0,y.useContext)(Bn),K=30,Mn=48,J=640,Ce=4,Me=2;function Cn(e){let{widths:n,current:t,room:r,more:i,gap:a=Ce,primary:s,most:p=sn}=e;if(n.length===0||!(r>0)||!(i>0)||n.some(l=>!(l>0)))return null;let c=(l,m)=>l.reduce((w,h)=>w+n[h],0)+a*Math.max(0,l.length-1)+(m?a+i:0),d=(l,m)=>t<0||!l.includes(t)||l.slice(0,m).includes(t)?l.slice(0,m):[...l.filter(w=>w!==t).slice(0,m-1),t].sort((w,h)=>w-h),u=d(n.map((l,m)=>m).filter(l=>s?.[l]!==!1||l===t),p);if(c(u,u.length<n.length)<=r)return u.length>=Me?u:null;for(let l=u.length-1;l>=Me;l--){let m=d(u,l);if(c(m,!0)<=r)return m}return null}var Mr=`
|
|
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{c as ur}from"./chunk.G4ULQK64.js";import{G as R,Ia as O,Ma as hn,Na as vn,Oa as bn,Ra as q,T as P,Va as j,a as Ae,ba as ue,ca as Z,e as Ne,l as un,m as fn,na as yn,s as gn,v as oe,va as wn,z as mn}from"./chunk.M7RESZB6.js";import{a as C}from"./chunk.SDO3U72B.js";import{$d as cn,Hc as Ze,Hd as pe,Id as ae,Jd as rn,Ld as Le,Nd as tn,Oc as $,Od as an,Pc as Je,Pd as Q,Qc as Xe,Sc as en,Uc as nn,Wd as on,Xd as sn,Yd as ln,Zd as dn,ae as Ee,bb as Ue,ee as pn,ja as qe,na as je,oa as Ye,tb as Qe}from"./chunk.DZZL5IDD.js";import{b as v}from"./chunk.AJZBJBMO.js";var Te=v(R(),1),kn=new WeakMap,fe=e=>{let n=kn.get(e);return n||kn.set(e,n={open:null,drawn:0,listeners:new Set}),n},fr=e=>{for(let n of[...e.listeners])n()},gr=0;function Tt(e,n){let t=fe(e);t.open=n?{...n,at:++gr}:null,fr(t)}var xn=e=>n=>{let t=fe(e);return t.listeners.add(n),()=>void t.listeners.delete(n)};function Sn(e){let n=()=>e?fe(e).drawn>0:!1;return(0,Te.useSyncExternalStore)(e?xn(e):mr,n,n)}var mr=()=>()=>{};function Ht(e){let n=()=>fe(e).open;return(0,Te.useSyncExternalStore)(xn(e),n,n)}var V=v(R(),1),Pn=v(ur(),1);function yr(e){let[n,t]=(0,V.useState)(null),[r,i]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{e.current!==r&&i(e.current)}),(0,V.useLayoutEffect)(()=>{if(!r||typeof ResizeObserver>"u")return;let a=()=>Math.round(r.getBoundingClientRect().width),s=a();t(s);let p=new ResizeObserver(()=>{let c=a();c!==s&&(s=c,(0,Pn.flushSync)(()=>t(c)))});return p.observe(r),()=>p.disconnect()},[r]),n}function wr(e=!0){let[n,t]=(0,V.useState)();return(0,V.useEffect)(()=>{if(!e)return t(void 0);let r=0,i=()=>t(innerHeight),a=()=>{i(),clearTimeout(r),r=window.setTimeout(i,300)},s=p=>{for(let[c,d]of[[window,"resize"],[window,"orientationchange"],[window.visualViewport,"resize"]])c?.[p](d,a)};return s("addEventListener"),i(),()=>{clearTimeout(r),s("removeEventListener")}},[e]),n}var ge={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"};var A=v(R(),1);var H=v(P(),1),Ln=6e3;function hr(e){return{...e,notify:n=>e.notify({...n,from:"framework"})}}var vr=e=>({place:"overview",...e&&!/^(aggregate|kind):/.test(e)?{record:e}:{}});function br(){let e=[],n=0,t=new Set,r=new Map,i,a=()=>{for(let d of[...t])d()},s=d=>{if(clearTimeout(r.get(d.id)),r.delete(d.id),d.kind!=="toast")return;let u=(d.actions?.length??0)+(d.action?1:0),l=d.timeout??(u>0?!1:Ln);l!==!1&&r.set(d.id,setTimeout(()=>i?.()?s(d):p(d.id),l))},p=d=>{clearTimeout(r.get(d)),r.delete(d),e.some(u=>u.id===d)&&(e=e.filter(u=>u.id!==d),a())},c=d=>{e=e.some(u=>u.id===d.id)?e.map(u=>u.id===d.id?d:u):[...e,d],s(d),a()};return{notify(d){let u=d.id??`notice-${++n}`;return c({...d,id:u,said:++n}),{id:u,dismiss:()=>p(u),update:l=>{let m=e.find(w=>w.id===u);m&&c({...m,...l,id:u,kind:m.kind,said:l.sentence!==void 0&&l.sentence!==m.sentence?++n:m.said})}}},dismiss:p,hold(d){i=d},list:()=>e,subscribe(d){return t.add(d),()=>t.delete(d)}}}function kr({notices:e}){let n=e.reduce((p,c)=>!p||c.said>p.said?c:p,void 0),[t,r]=(0,A.useState)(""),[i,a]=(0,A.useState)(""),s=(0,A.useRef)(0);return(0,A.useEffect)(()=>{if(!n||n.said===s.current)return;s.current=n.said;let p=n.tone==="bad";(p?a:r)("");let c=setTimeout(()=>(p?a:r)(n.sentence),50);return()=>clearTimeout(c)},[n]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:ge,children:t}),(0,H.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:ge,children:i})]})}var xr=(0,A.createContext)(null);function Sr({board:e,anchor:n,report:t}){let r=(0,A.useSyncExternalStore)(e.subscribe,e.list,e.list);return(0,A.useEffect)(()=>Er(He.prefetch),[]),(0,H.jsxs)(H.Fragment,{children:[r.length>0?(0,H.jsx)(A.Suspense,{fallback:null,children:(0,H.jsx)(Lr,{notices:r,anchor:n,board:e,...t?{report:t}:{}})}):null,(0,H.jsx)(kr,{notices:r})]})}var He=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.MB7LKKUD.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DPEIT3TW.js")))),Pr=()=>He.load().then(()=>{},()=>{}),Lr=He.part((e,n)=>(0,H.jsx)(e.NoticeStacks,{...n}),{quiet:!0});function Er(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}var M=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.Y4FZKUOK.js","./chunk.4TX6VCBT.js","./chunk.TIALD6SC.js","./chunk.QHY5NVYH.js","./chunk.U6ZRJKVM.js","./chunk.PLTH2LW5.js","./chunk.66P5IDTH.js","./chunk.UQQKDBIH.js","./chunk.AJSUHPBE.js","./chunk.KDXU5DT3.js","./chunk.W4BKYSZX.js","./chunk.U5P23GO7.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.5HGD6OWL.js"))));var y=v(R(),1);var Nn=v(R(),1);var En=v(R(),1);function ie(e){return(0,En.useMemo)(()=>e===void 0||e===""?void 0:{__html:e},[e])}var _=v(P(),1);function Be({brand:e,size:n=22}){let t=en(e),r=An(t?.light),i=r?An(t?.dark):void 0,a=ie(r!==void 0&&$(r)?r:void 0),s=ie(i!==void 0&&$(i)?i:void 0),p={display:"inline-flex",flex:"0 0 auto",height:n,color:"var(--graview-accent)"},c=nn(e);if(c)return(0,_.jsx)("span",{className:"graview-logo graview-emoji-mark","data-testid":"app-mark","aria-hidden":!0,style:{...p,alignItems:"center",fontSize:`${n*.86/16}rem`,lineHeight:1},children:c});if(!r)return null;let d=e?.logoAlt??e?.name??"",u=d!==""&&d!==e?.name,l=u?{role:"img","aria-label":d}:{"aria-hidden":!0};if(i){let w=(h,S,b)=>$(h)?(0,_.jsx)("span",{className:"graview-logo-face","data-graview-scheme-only":b,dangerouslySetInnerHTML:S}):(0,_.jsx)("img",{className:"graview-logo-face","data-graview-scheme-only":b,src:h,alt:""});return(0,_.jsxs)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...l,children:[w(r,a,"light"),w(i,s,"dark")]})}let m=t?.darkFallback==="invert"?{"data-graview-logo-fallback":"invert"}:{};return $(r)?(0,_.jsx)("span",{className:"graview-logo","data-testid":"app-mark",style:p,...m,...l,dangerouslySetInnerHTML:a}):(0,_.jsx)("img",{className:"graview-logo","data-testid":"app-mark",src:r,alt:u?d:"",...m,style:{...p,width:"auto"}})}function An(e){if(!(!e||!Xe(e)))return $(e)&&Je(e)!==null?void 0:e}function Ar(e){(0,Nn.useEffect)(()=>{if(!e||typeof document>"u")return;let n=[...document.querySelectorAll('link[rel~="icon"]')],t=n.map(i=>i.getAttribute("href")),r;n.length===0&&(r=document.createElement("link"),r.rel="icon",r.setAttribute("data-graview-favicon",""),document.head.appendChild(r),n.push(r));for(let i of n)i.href=e;return()=>{r&&r.remove(),n.forEach((i,a)=>{i!==r&&t[a]!==null&&t[a]!==void 0&&i.setAttribute("href",t[a])})}},[e])}var o=v(P(),1),Nr=M.part((e,n)=>(0,o.jsx)(e.TidyFoot,{...n}),{quiet:!0}),Tr=M.part((e,n)=>(0,o.jsx)(e.Here,{...n}),{quiet:!0});function Hr(){let e=Z(),[n,t]=(0,y.useState)("");return(0,y.useEffect)(()=>e?.store.subscribe((r,i)=>{i.some(a=>a.author.id!==e.principal.id)&&M.load().then(a=>a.sayTheirChange(i,e,t),String)}),[e]),(0,o.jsx)("span",{role:"status",className:"graview-bar-said",children:n})}var Tn="home",Hn="/",Y="scene:whole";function Br(e){let{store:n,principal:t,views:r}=e,i=n.kindsKeptFrom(t),a=n.schema.kinds.filter(f=>!n.modules.disabledKinds.has(f)&&!i.has(f)),s=r?.arrangement?.(),p=r?.places()??[],c=dn(s,n.schema,p),d=ln(n.schema,s,[...n.modules.administered.values()].flatMap(f=>f.kinds??[])),u=(f,x)=>(!n.graph.size.nodes||n.graph.count(f)>0)&&(c?x?c.places.has(`${f}|${x}`):c.kinds.has(f):!d.has(f)),l=[{key:Tn,label:"Home",path:Hn,group:"home",primary:!0}],m=p.filter(f=>a.includes(f.kind)&&f.as!==cn),w=m.filter(f=>!f.hidden),h=new Set(ae(w).map(f=>Q(f,p,n.schema).toLowerCase())),S=f=>tn(f.as,an(f,p)?Le(n.schema,f.kind).slice(1):void 0),b=new Set(s?.hide??[]),L=pn(a,s?.order,w);for(let{kind:f,view:x}of L){if(x){l.push({key:`place:${x.kind}:${x.as}`,label:Q(x,p,n.schema),path:S(x),group:"lists",kind:f,primary:c?c.places.has(`${f}|${x.as}`):!0});continue}let U=je(n.schema,f),T=h.has(U.toLowerCase());l.push({key:`kind:${f}`,label:T?Ye(n.schema,f):U,path:Le(n.schema,f),group:"lists",kind:f,primary:T||b.has(f)?!1:u(f),...b.has(f)?{hidden:!0}:{}})}for(let f of ae(m)){if(L.some(T=>T.view&&pe(T.view,f)))continue;let x=S(f),U=[f.kind,...f.over??[]].some(T=>a.includes(T)&&u(T,f.as));l.some(T=>T.path===x)||l.push({key:`place:${f.kind}:${f.as}`,label:Q(f,p,n.schema),path:x,group:"pictures",kind:f.kind,primary:U,hidden:f.hidden})}return a.some(f=>Object.keys(n.schema.tryDefinition(f)?.edges??{}).length>0)&&l.push({key:"connections",label:"Connections",path:"/map",group:"pictures",primary:!1}),l}function Mr(e,n){let[t="/",r=""]=n.split("?"),i=e.find(s=>s.path===(r?`${t}?${r}`:t))??e.find(s=>s.path===t);if(i)return i.key;let a=`/${t.split("/").filter(Boolean)[0]??""}`;return e.find(s=>s.group==="lists"&&s.path===a)?.key??null}var Bn=(0,y.createContext)(null),Cr=()=>(0,y.useContext)(Bn),W=30,Mn=48,J=640,Ce=4,Me=2;function Cn(e){let{widths:n,current:t,room:r,more:i,gap:a=Ce,primary:s,most:p=sn}=e;if(n.length===0||!(r>0)||!(i>0)||n.some(l=>!(l>0)))return null;let c=(l,m)=>l.reduce((w,h)=>w+n[h],0)+a*Math.max(0,l.length-1)+(m?a+i:0),d=(l,m)=>t<0||!l.includes(t)||l.slice(0,m).includes(t)?l.slice(0,m):[...l.filter(w=>w!==t).slice(0,m-1),t].sort((w,h)=>w-h),u=d(n.map((l,m)=>m).filter(l=>s?.[l]!==!1||l===t),p);if(c(u,u.length<n.length)<=r)return u.length>=Me?u:null;for(let l=u.length-1;l>=Me;l--){let m=d(u,l);if(c(m,!0)<=r)return m}return null}var Rr=`
|
|
2
2
|
.graview-bar{display:block;margin:0;padding:0;container:graview-bar/inline-size;flex:0 0 auto;position:relative;background:var(--graview-bar);border-bottom:1px solid var(--graview-edge);color:var(--graview-ink);font-family:var(--graview-font-body,system-ui)}
|
|
3
3
|
.graview-bar-row{display:flex;flex-wrap:nowrap;align-items:center;gap:16px;height:${Mn-1}px;margin:0;padding:0 16px}
|
|
4
4
|
.graview-bar-home,.graview-bar-face,.graview-bar-place,.graview-bar-item,.graview-bar-at{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;margin:0;border:0;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-decoration:none;color:var(--graview-ink);cursor:pointer;text-align:left}
|
|
@@ -42,7 +42,7 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
|
|
|
42
42
|
.graview-bar-own{display:flex;align-items:center;flex:0 0 auto}
|
|
43
43
|
.graview-bar-own:empty{display:none}
|
|
44
44
|
.graview-bar-host{display:flex;align-items:center;gap:2px;flex:0 0 auto}
|
|
45
|
-
.graview-bar-host-action{display:inline-flex;align-items:center;gap:6px;box-sizing:border-box;min-width:${
|
|
45
|
+
.graview-bar-host-action{display:inline-flex;align-items:center;gap:6px;box-sizing:border-box;min-width:${W}px;height:${W}px;margin:0;padding:0 10px;border-radius:8px;border:1px solid transparent;background:none;box-shadow:none;font:inherit;font-size:.875rem;font-weight:500;letter-spacing:normal;text-transform:none;white-space:nowrap;color:var(--graview-ink-muted);cursor:pointer}
|
|
46
46
|
.graview-bar-host-action:is(:hover,[aria-expanded=true]){border-color:var(--graview-edge);color:var(--graview-ink)}
|
|
47
47
|
.graview-bar-host-action[data-folded]{padding:0}
|
|
48
48
|
.graview-bar-host-mark{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:16px;height:16px;font-size:.9375rem;line-height:1}
|
|
@@ -70,5 +70,5 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
|
|
|
70
70
|
}
|
|
71
71
|
@container graview-bar (max-width: 300px){
|
|
72
72
|
.graview-bar-row{gap:4px;padding:0 10px}
|
|
73
|
-
}`,X={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,minWidth:
|
|
74
|
-
`):"";(0,y.useLayoutEffect)(I,[I,n,e,dr,k?.current,le,E,w,d]);let cr=w==="icons"||!Xn||E?"icons":"words";return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("header",{ref:se,className:"graview-bar","data-testid":"app-bar","data-graview-app-bar":"",...Jn&&E?{"data-finding":""}:{},children:[(0,o.jsx)("style",{children:Mr}),S,(0,o.jsxs)("div",{className:"graview-bar-row",children:[b?(0,o.jsx)("div",{className:"graview-bar-app",children:(0,o.jsx)(or,{className:"graview-bar-name",children:(0,o.jsxs)(ir,{...r.href!==void 0?{href:r.href,onClick:sr(r.go)}:{type:"button",onClick:r.go},"data-testid":"app-home",...r.current?{"aria-current":"page"}:{},title:u?`${n} \u2014 ${u}`:`${n} \u2014 home`,className:"graview-bar-home",children:[(0,o.jsx)(Be,{brand:e,size:20}),(0,o.jsx)("span",{className:"graview-bar-app-name","data-testid":"app-name",children:n})]})})}):null,i?(0,o.jsx)(Rr,{faces:i,form:w,drawn:cr}):null,(0,o.jsx)("div",{className:"graview-bar-mid",...Ge?{"data-places":"standing"}:!E&&ce?{"data-place":""}:{},children:E?null:ce}),!E&&k&&k.places.length>1?(0,o.jsxs)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-ruler":"",children:[k.places.map(g=>(0,o.jsx)("span",{className:"graview-bar-at",children:g.label},g.key)),(0,o.jsxs)("span",{className:"graview-bar-at",children:[me,(0,o.jsx)(Vn,{})]})]}):null,L&&L.length>0?(0,o.jsx)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-host-ruler":"",children:(0,o.jsx)("span",{className:"graview-bar-host",children:L.map(g=>(0,o.jsxs)("span",{className:"graview-bar-host-action",children:[g.icon?(0,o.jsx)(Dn,{icon:g.icon}):null,(0,o.jsx)("span",{children:g.label})]},g.label))})}):null,b?(0,o.jsx)("span",{className:"graview-bar-ruler","aria-hidden":"true",children:(0,o.jsx)("span",{className:"graview-bar-name",children:n})}):null,(0,o.jsxs)("div",{className:"graview-bar-tools",children:[d?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{type:"button",className:"graview-bar-find-open",ref:We,"data-testid":"app-find-open","aria-label":"Find",title:"Find",onClick:ar,style:{...X,display:void 0},children:(0,o.jsx)(Ir,{})}),(0,o.jsxs)("div",{className:"graview-bar-find","data-testid":"app-find",onBlur:g=>{let B=g.relatedTarget;B instanceof Node&&g.currentTarget.contains(B)||g.currentTarget.querySelector("input")?.value||ze()},onKeyDownCapture:g=>{g.key==="Escape"&&E&&(de.current=!0)},onKeyDown:g=>{g.key!=="Escape"||!E||(!g.defaultPrevented||!g.currentTarget.querySelector("input")?.value?ze():de.current=!1)},children:[(0,o.jsx)("div",{ref:U,className:"graview-bar-find-slot",children:l}),(0,o.jsx)(Vr,{})]})]}):null,(0,o.jsx)("div",{ref:Qn,className:"graview-bar-own","data-graview-bar-own":""}),f?(0,o.jsx)(y.Suspense,{fallback:null,children:(0,o.jsx)(Ar,{scene:!le,compact:E})}):null,(0,o.jsx)(Tr,{}),L&&L.length>0?(0,o.jsx)(Kr,{actions:L,folded:E||!rr}):null,c]})]})]}),E&&ce?(0,o.jsx)("div",{className:"graview-bar-line","data-graview-place-line":"","data-testid":"app-place-line",children:ce}):null]})}function Rr({faces:e,form:n,drawn:t}){let r=i=>{let a=e[i];return(0,o.jsxs)("button",{type:"button",className:"graview-bar-face","data-testid":`app-face-${i}`,"aria-pressed":a.current,title:a.label,...a.reach&&!a.current?{onPointerEnter:a.reach,onPointerDown:a.reach,onFocus:a.reach}:{},onClick:()=>{a.current||a.go()},children:[i==="scene"?(0,o.jsx)(Fn,{}):(0,o.jsx)(Dr,{}),(0,o.jsx)("span",{children:a.label})]})};return(0,o.jsxs)("div",{className:"graview-bar-faces",role:"group","aria-label":`${e.scene.label} or ${e.pages.label}`,"data-testid":"app-faces","data-switch":n,"data-switch-drawn":t,children:[r("scene"),r("pages")]})}function Or(e){let n=e.querySelector(".graview-bar-faces"),t=e.querySelector(".graview-bar-mid"),r=e.querySelector(".graview-bar-find");if(!n||!t||r?.matches(":focus-within")||e.getBoundingClientRect().width<J)return null;let a=$n(n),s=t.querySelector(".graview-bar-place-words"),p=s?parseFloat(getComputedStyle(s).fontSize)||14:0,c=s?Math.min(s.scrollWidth+34,14*p):0,d=Rn(e);if(d===null)return!1;let u=t.getBoundingClientRect().width-c-d;if(r&&r.getBoundingClientRect().width>0){let l=parseFloat(getComputedStyle(r).flexBasis);isFinite(l)&&(u-=Math.max(0,l-r.getBoundingClientRect().width))}return n.getAttribute("data-switch-drawn")==="icons"?u>=a+2:u>=-1}function Rn(e){let n=e.querySelector(".graview-bar-app"),t=e.querySelector(".graview-bar-ruler>.graview-bar-name");if(!n||!t)return 0;let r=s=>s?.getBoundingClientRect().width??0,i=r(n.firstElementChild)-r(e.querySelector(".graview-bar-app-name"))+r(t)+2,a=parseFloat(getComputedStyle(n).maxWidth)/100*(n.parentElement.clientWidth-2*n.offsetLeft)||1/0;return i>a+.5?null:Math.max(0,i-r(n))}var On=e=>e.button===0&&!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey);function Fr(){let e=globalThis.navigator?.platform??"";return/Mac|iPhone|iPad|iPod/.test(e)?"\u2318K":"Ctrl K"}function Vr(){let e=Sn(Z()?.aiDesk);return(0,o.jsx)("span",{className:"graview-bar-find-keys","data-testid":"app-find-keys","aria-hidden":"true",children:e?"/":Fr()})}function ee({size:e,box:n=e,children:t}){return(0,o.jsx)("svg",{width:e,height:e,viewBox:`0 0 ${n} ${n}`,"aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:t})}function Fn(){return(0,o.jsxs)(ee,{size:14,children:[(0,o.jsx)("path",{d:"M7 1.5 L12.5 4.5 L7 7.5 L1.5 4.5 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M1.5 7.5 L7 10.5 L12.5 7.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",strokeLinecap:"round"})]})}function Dr(){return(0,o.jsxs)(ee,{size:14,children:[(0,o.jsx)("rect",{x:"2.25",y:"1.75",width:"9.5",height:"10.5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,o.jsx)("path",{d:"M4.5 5 H9.5 M4.5 7.25 H9.5 M4.5 9.5 H7.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Vn(){return(0,o.jsx)(ee,{size:10,children:(0,o.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ir(){return(0,o.jsxs)(ee,{size:16,children:[(0,o.jsx)("circle",{cx:"7",cy:"7",r:"4.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,o.jsx)("path",{d:"M10.5 10.5 L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function $r({place:e}){if(e.key===Y)return(0,o.jsx)(Fn,{});if(e.group==="home")return(0,o.jsx)(ee,{size:13,box:14,children:(0,o.jsx)("path",{d:"M2 6.5 L7 2 L12 6.5 V12 H2 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})});let n=e.kind?`hsl(${Math.round(Ze(e.kind))} 55% 52%`:"rgb(128 128 128";return(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:12,height:8,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",background:e.group==="lists"?`${n})`:`linear-gradient(${n}), ${n})) center / 6px 4px no-repeat, ${n} / 0.35)`}})}var _r=[{group:"home"},{group:"lists",heading:"Lists"},{group:"pictures",heading:"Pictures"}],me="More";function Kr({actions:e,folded:n}){let t=j("host-actions",{popover:n}),r=e.map(a=>a.label).join(", "),i=a=>e.map(s=>(0,o.jsxs)("button",{type:"button",className:n?"graview-bar-host-action graview-bar-item":"graview-bar-host-action","data-testid":"host-bar-action",onClick:()=>{a(),s.onSelect()},children:[s.icon?(0,o.jsx)(Dn,{icon:s.icon}):null,(0,o.jsx)("span",{children:s.label})]},s.label));return n?(0,o.jsxs)("div",{className:"graview-bar-host",children:[(0,o.jsx)("button",{type:"button",className:"graview-bar-host-action","data-testid":"host-bar-actions-open","data-folded":"",...t.trigger,onClick:t.toggle,"aria-label":`${me} \u2014 ${r}`,title:r,children:(0,o.jsxs)(ee,{size:16,children:[(0,o.jsx)("circle",{cx:"3",cy:"8",r:"1.4",fill:"currentColor"}),(0,o.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,o.jsx)("circle",{cx:"13",cy:"8",r:"1.4",fill:"currentColor"})]})}),(0,o.jsx)("div",{...t.pane,"data-testid":"host-bar-actions",hidden:!t.open,className:"graview-bar-list",style:q,"aria-label":"From the host",children:i(()=>t.setOpen(!1))})]}):(0,o.jsx)("div",{className:"graview-bar-host","data-testid":"host-bar-actions-standing",role:"group","aria-label":"From the host",children:i(()=>{})})}function Dn({icon:e}){let n=ie($(e)?e:void 0);return n?(0,o.jsx)("span",{className:"graview-bar-host-mark","aria-hidden":"true",dangerouslySetInnerHTML:n}):(0,o.jsx)("span",{className:"graview-bar-host-mark","aria-hidden":"true",children:e})}function In({place:e,current:n,reach:t,standing:r,done:i}){let a=e.key===n,s=t.href?.(e.path);return(0,o.jsxs)(s!==void 0?"a":"button",{className:r?"graview-bar-at":"graview-bar-item","data-testid":`app-place-${e.key}`,"data-place-path":e.path,...a?{"aria-current":"page"}:{},...s!==void 0?{href:s}:{type:"button"},onClick:c=>{i(),t.go&&(s!==void 0&&!On(c)||(c.preventDefault(),t.go(e)))},children:[r?null:(0,o.jsx)("span",{className:"graview-bar-mark",children:(0,o.jsx)($r,{place:e})}),r&&a?(0,o.jsx)("span",{"data-testid":"app-place-current",children:e.label}):(0,o.jsx)("span",{children:e.label})]})}function Wr({places:e,current:n,reach:t,id:r,done:i}){return(0,o.jsx)(o.Fragment,{children:_r.map(({group:a,heading:s})=>{let p=e.filter(d=>d.group===a);if(p.length===0)return null;let c=`${r}-${a}`;return(0,o.jsxs)("div",{role:"group",...s?{"aria-labelledby":c}:{"aria-label":p[0].label},"data-place-group":a,children:[s?(0,o.jsx)("p",{id:c,children:s}):null,(0,o.jsx)("ul",{children:p.map(d=>(0,o.jsx)("li",{children:(0,o.jsx)(In,{place:d,current:n,reach:t,standing:!1,done:i})},d.key))})]},a)})})}function zr({places:e,current:n,here:t,reach:r,scene:i,stands:a}){let s=j("places"),p=(0,y.useRef)(a);s.open||(p.current=a);let c=p.current,u=e.find(b=>b.key===n)?.label??t??"Places",l=c?e.filter((b,L)=>!c.includes(L)):e,m=Gr(e,n,i),w=Z(),h=w?.keptViews?.current(),S=!!(h&&(h.removed.length>0||w.views.places().some(b=>b.hidden)||h.may.lenses&&(w.views.arrangement?.()?.hide?.length??0)>0));return(0,o.jsxs)("nav",{className:c?"graview-bar-places":"graview-bar-place-at","aria-label":i?"What the scene shows":"The app\u2019s places",...c?{"data-testid":"app-places-standing"}:{},...m,children:[c?.map(b=>(0,o.jsx)(In,{place:e[b],current:n,reach:r,standing:!0,done:()=>{}},e[b].key)),l.length>0||S?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("button",{type:"button",className:c?"graview-bar-at":"graview-bar-place","data-testid":"app-places-open",...s.trigger,onClick:s.toggle,"aria-label":c?`${me} \u2014 ${l.length} more ${i?"pictures":"places"}`:`${u} \u2014 ${i?"everything the scene shows":"every place"}`,title:c?l.map(b=>b.label).join(", "):u,children:[c?me:(0,o.jsx)("span",{className:"graview-bar-place-words","data-testid":"app-place-current",children:u}),(0,o.jsx)(Vn,{})]}),(0,o.jsxs)("div",{...s.pane,"data-testid":"app-places",hidden:!s.open,className:"graview-bar-list",style:q,children:[(0,o.jsx)(Wr,{places:l,current:n,reach:r,id:s.pane.id,done:()=>s.setOpen(!1)}),S&&s.open?(0,o.jsx)(y.Suspense,{fallback:null,children:(0,o.jsx)(Er,{id:s.pane.id,scene:i,reach:r,done:()=>s.setOpen(!1)})}):null]})]}):null]})}function Gr(e,n,t){let r=Z()?.setMenuAt,i=a=>{let s=a.target.closest?.("[data-place-path],[data-testid=app-places-open]");if(!s||!r)return;let p={at:0};a.type==="pointerdown"?document.addEventListener("pointerup",()=>p.at||=Date.now(),{once:!0}):a.preventDefault();let c=a.nativeEvent;M.load().then(d=>d.placeGesture(c,s,e,n,t,r,p),String)};return{onContextMenu:a=>a.shiftKey||i(a),onKeyDown:a=>(a.key==="ContextMenu"||a.key==="F10"&&a.shiftKey)&&i(a),onPointerDown:a=>a.pointerType!=="mouse"&&a.isPrimary&&i(a)}}function qr(e,n,t,r){let i=e.querySelector("[data-graview-bar-ruler]"),a=e.querySelector(".graview-bar-mid");if(!i||!a)return null;let s=e.querySelector(".graview-bar-find");if(s?.matches(":focus-within"))return;if(e.getBoundingClientRect().width<J)return null;let p=Rn(e);if(p===null)return null;let c=[...i.children].map(L=>L.getBoundingClientRect().width),d=c.pop()??0,u=e.querySelector(".graview-bar-faces"),l=u&&t?$n(u):0,m=u?.getAttribute("data-switch-drawn")==="words"?l:0,w=a.getBoundingClientRect().left+p,h=s?.getBoundingClientRect(),S=h&&h.width>0?h.right-w-(parseFloat(getComputedStyle(s).minWidth)||0)-16:a.getBoundingClientRect().width-p,b=[...r].map(L=>L!=="0");return Cn({widths:c,current:n,room:Math.floor(S+m-l),more:d,primary:b})?.join(",")??null}function $n(e){return[...e.querySelectorAll(".graview-bar-face span")].reduce((n,t)=>n+t.scrollWidth+10,0)}var jr=e=>`graview:lenses:${e}`,Yr=(e,n)=>e?.name??n.kinds.join(",");function Re(e){try{let n=JSON.parse(localStorage.getItem(jr(e))??"[]");return Array.isArray(n)?n.filter(t=>typeof t?.title=="string"&&typeof t.lens=="string"):[]}catch{return[]}}var W=v(R(),1);var T=v(P(),1);function Ur({scheme:e,onScheme:n,profileHref:t,keeping:r,hostActions:i=Qr,signature:a=!1}){let{store:s,principal:p,seats:c,people:d}=ue(),u=j("profile"),l=u.open,[m,w]=(0,W.useState)(!1);(0,W.useEffect)(()=>Xr(ye),[]),l&&!m&&w(!0),(0,W.useEffect)(()=>{l&&ye()},[l]);let h=p.id===void 0?void 0:s.graph.getNode(p.id),S=h===void 0?p.id===void 0?"Nobody in particular":Ue(p,{graph:s.graph,schema:s.schema,seats:c,people:d}):qe(s.schema.tryDefinition(h.kind),h);return(0,T.jsxs)("div",{style:{position:"relative"},children:[(0,T.jsx)("button",{type:"button","data-testid":"profile-button",...u.trigger,onClick:u.toggle,onPointerEnter:ye,onFocus:ye,"aria-label":`${S} \u2014 you, your seat and your settings`,title:`${S} \u2014 you, your seat and your settings`,style:{...X,borderRadius:999},children:(0,T.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:K-4,height:K-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:et(S)})}),(0,T.jsxs)("section",{...u.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!l,style:{...q,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:l?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[m?(0,T.jsx)(W.Suspense,{fallback:null,children:(0,T.jsx)(Zr,{part:"top",name:S,me:h,profileHref:t,hostActions:i,close:()=>u.setOpen(!1)})}):null,(0,T.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:rt,children:[(0,T.jsx)("span",{style:nt,children:"Keeping this app"}),r]}),m?(0,T.jsx)(W.Suspense,{fallback:null,children:(0,T.jsx)(Jr,{part:"rest",name:S,me:h,scheme:e,onScheme:n,hostActions:i,signature:a,close:()=>u.setOpen(!1)})}):null]})]})}var Qr=[],ye=()=>M.prefetch(),Zr=M.part((e,n)=>(0,T.jsx)(e.ProfilePane,{...n}),{what:"The rest of your menu"}),Jr=M.part((e,n)=>(0,T.jsx)(e.ProfilePane,{...n}),{quiet:!0});function Xr(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}function et(e){return(e.trim()[0]??"?").toUpperCase()}var nt={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},rt={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function tt(e){return!(e==="hidden"||e===!1)}var Oe=v(R(),1);var _n="The whole thing",we=e=>`scene:${e.kind}:${e.as}`;function Kn(e){let{view:n}=e,t=e.places.filter(l=>!e.hidden.has(l.kind)),r=ae(t),i=(l,m)=>{if(l===Y)return un(fn(m,!0),"view",null);let w=r.find(h=>we(h)===l);return w?mn(m,w.over?.find(h=>m.focusId===oe(h))??w.kind,w.as):null},a=n.within?.view,s=l=>n.focusId===oe(l.kind)&&(a===void 0?t.filter(m=>m.kind===l.kind).at(-1)===l:a===l.as),p=t.find(l=>s(l)&&(a!==void 0||!n.overview)),c=p?r.find(l=>pe(l,p)):void 0,d=r.filter(l=>!l.hidden||l===c);return{places:[{key:Y,label:_n,path:`${Ee}${Te(i(Y,Ae))}`,group:"home"},...d.map(l=>({key:we(l),label:Q(l,t,e.schema),path:`${Ee}${Te(i(we(l),Ae))}`,group:"pictures",kind:l.kind,hidden:l.hidden}))],current:c?we(c):Y,to:i}}function at(){let{store:e,views:n,hiddenKinds:t}=ue(),{view:r,go:i}=bn(),a=n.places(),s=(0,Oe.useMemo)(()=>Kn({places:a,hidden:t,view:r,schema:e.schema}),[a,t,r,e.schema]),p=(0,Oe.useMemo)(()=>({go:c=>{let d=s.to(c.key,r);d&&i(d)}}),[s,r,i]);return{places:s.places,current:s.current,reach:p}}var ne=v(R(),1);var F=v(P(),1),ot=M.part((e,n)=>(0,F.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"}),Fe=()=>M.prefetch();function it({clean:e="All rules hold"}){let n=vn(),{set:t}=hn(),r=n.length,[i,a]=(0,ne.useState)(!1),s=j("problems",{open:i&&r>0,onOpenChange:a}),p=s.open,c=zn(n,e);return(0,ne.useEffect)(()=>{if(r===0)return;let d=setTimeout(Fe,1500);return()=>clearTimeout(d)},[r>0]),(0,F.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,F.jsxs)("button",{type:"button","data-testid":"standing",...s.trigger,"aria-disabled":r===0?!0:void 0,"aria-label":c,onClick:r===0?void 0:s.toggle,onPointerEnter:r===0?void 0:Fe,onFocus:r===0?void 0:Fe,title:c,style:{...X,padding:r===0?0:"0 8px",cursor:r===0?"default":"pointer",color:r===0?"var(--graview-ink-muted)":Wn(n),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,F.jsx)(Gn,{tone:r===0?"var(--graview-good)":Wn(n)}),r>0?(0,F.jsx)("span",{"aria-hidden":"true",children:r}):null]}),p?(0,F.jsx)("ol",{...s.pane,"data-testid":"problems",style:{...q,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,F.jsx)(ne.Suspense,{fallback:null,children:(0,F.jsx)(ot,{violations:n,pick:d=>{t(d.nodeIds),s.setOpen(!1)}})})}):null]})}function zn(e,n){return e.length===0?n:`${Qe(e)} \u2014 open what is broken, and what would fix it`}var Wn=e=>e.some(n=>n.status==="could-not-judge"||n.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function Gn({tone:e}){return(0,F.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:e}})}function st(e,n,t=[]){if(e.focusId)return e.focusId;let i=(e.selection??[]).map(gn).find(a=>a!==null)??t.find(a=>n.includes(a))??n[0]??null;return i===null?null:oe(i)}var ve=v(P(),1),he=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.VOOOIECX.js","./chunk.GIW657OR.js","./chunk.EVEHSENK.js","./chunk.SBLYBRDU.js","./chunk.WS7LAT4Z.js","./chunk.5X22RKB3.js","./chunk.XZUHFXME.js","./chunk.IA5ZBMRD.js","./chunk.VN7I7XIO.js","./chunk.REH6RXNH.js","./chunk.MBP7VDYM.js","./chunk.BDTT4ENI.js","./chunk.WVUJXDXZ.js","./chunk.MBU7UH6J.js","./chunk.2QFKNTAZ.js","./chunk.BI6DS3PZ.js","./chunk.PGA5TUSN.js","./chunk.7R727IKU.js","./chunk.LQAT7FA6.js","./chunk.GZHZLJBF.js","./chunk.Y7H5O2SL.js","./chunk.OJGHDWI6.js","./chunk.6HZY5NRX.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JU3BCCQM.js"))));function lt(){return he.load().then(()=>{})}var dt=[{cardinality:"one",fidelity:"full",slot:"page"},{cardinality:"one",fidelity:"summary",slot:"card"},{cardinality:"one",fidelity:"glyph",slot:"row"},{cardinality:"many",fidelity:"full"},{cardinality:"many",fidelity:"summary"},{cardinality:"many",fidelity:"glyph"}];function ct({schema:e,specs:n,kind:t,view:r}){let i=he.current.frameworkViews(e,n).lookup(t,{cardinality:r.cardinality,fidelity:r.fidelity});return i?(0,ve.jsx)(i,{...r}):null}var pt=he.part((e,n)=>(0,ve.jsx)(ct,{...n}),{what:"This view"});function qn(e,n,t){for(let r of n.kinds){let i=t?.[r];for(let a of dt){let s=c=>(0,ve.jsx)(pt,{schema:n,specs:t,kind:r,view:c}),p=a.slot!==void 0&&i?.[a.slot]!==void 0;p&&(s.says=(c,d)=>he.current?.frameworkViews(n,t).lookup(r,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(c,d)),e.register(r,{cardinality:a.cardinality,fidelity:a.fidelity},p?s:yn(s))}}return e}function ut(e,n){return qn(wn(e),e,n)}var Ve=v(R(),1);var D=v(P(),1),jn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.TKLYUVMR.js","./chunk.7LZ6JDJA.js","./chunk.KRFRREEW.js","./chunk.D4TA5XDC.js","./chunk.VOOOIECX.js","./chunk.GIW657OR.js","./chunk.EVEHSENK.js","./chunk.SBLYBRDU.js","./chunk.2LNSENPV.js","./chunk.WS7LAT4Z.js","./chunk.5X22RKB3.js","./chunk.XZUHFXME.js","./chunk.HJCQ6I3S.js","./chunk.SAYAFOF6.js","./chunk.R3N73BJO.js","./chunk.X2I3XH2E.js","./chunk.IA5ZBMRD.js","./chunk.VN7I7XIO.js","./chunk.REH6RXNH.js","./chunk.MBP7VDYM.js","./chunk.BDTT4ENI.js","./chunk.WD4VPMEE.js","./chunk.VUAOCYG2.js","./chunk.5POG3G2C.js","./chunk.2XSIJH5J.js","./chunk.LA2DMHZC.js","./chunk.ISRQQVS4.js","./chunk.WVUJXDXZ.js","./chunk.MBU7UH6J.js","./chunk.2QFKNTAZ.js","./chunk.BI6DS3PZ.js","./chunk.PGA5TUSN.js","./chunk.7R727IKU.js","./chunk.LQAT7FA6.js","./chunk.GZHZLJBF.js","./chunk.Y7H5O2SL.js","./chunk.OJGHDWI6.js","./chunk.6HZY5NRX.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.SLPJWOKC.js"))));function ft({lens:e,view:n}){let t=jn.current.declaredLensView(e);return(0,D.jsx)(t,{...n})}var gt=jn.part((e,n)=>(0,D.jsx)(ft,{...n}),{what:"This picture"});function mt(e){let n=r=>(0,D.jsx)(Ve.Suspense,{fallback:null,children:(0,D.jsx)(gt,{lens:e,view:r})});e.lens==="blocks"&&(n.flows=!0);let t=e.lens==="blocks"?e.options.blocks?.[0]:void 0;return typeof t?.headline=="string"&&(n.lede=t),e.create===!1&&(n.creates=!1),n}var Yn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.VOOOIECX.js","./chunk.GIW657OR.js","./chunk.EVEHSENK.js","./chunk.SBLYBRDU.js","./chunk.WS7LAT4Z.js","./chunk.5X22RKB3.js","./chunk.XZUHFXME.js","./chunk.IA5ZBMRD.js","./chunk.VN7I7XIO.js","./chunk.REH6RXNH.js","./chunk.MBP7VDYM.js","./chunk.BDTT4ENI.js","./chunk.WVUJXDXZ.js","./chunk.MBU7UH6J.js","./chunk.2QFKNTAZ.js","./chunk.BI6DS3PZ.js","./chunk.PGA5TUSN.js","./chunk.7R727IKU.js","./chunk.LQAT7FA6.js","./chunk.GZHZLJBF.js","./chunk.Y7H5O2SL.js","./chunk.OJGHDWI6.js","./chunk.6HZY5NRX.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.7CETF4A6.js"))));function yt({blocks:e,view:n}){let t=Yn.current.homeView(e);return(0,D.jsx)(t,{...n})}var wt=Yn.part((e,n)=>(0,D.jsx)(yt,{...n}),{what:"The home"});function ht(e){let n=t=>(0,D.jsx)(Ve.Suspense,{fallback:null,children:(0,D.jsx)(wt,{blocks:e,view:t})});return Object.defineProperty(n,Symbol.for("graview.home-blocks"),{value:!0}),n}function vt(e,n){return n.home&&n.home.length>0&&e.home?.(ht(n.home)),Un(e,n),e.arrange?.(n.pages),e}function Un(e,n,t){for(let r of on(n).drawn){if(t&&e.places().some(s=>s.title===r.title))continue;let i=mt(r),a={title:r.title,lens:r.lens,...r.across?{across:r.across}:{},...t?{beside:t}:{},...r.hidden?{hidden:!0}:{},over:r.kinds,...t?{}:{declared:!0}};for(let s of r.kinds)e.register(s,{cardinality:"many",fidelity:"full"},i,a),e.register(s,{cardinality:"many",fidelity:"summary"},i,a)}}function bt(e,n,t){t.length>0&&Un(e,{schema:n,lenses:t.map(({lens:r,...i})=>({...i,name:r}))},!0)}function kt(e,n,t){bt(e,n,Re(t))}var z=v(R(),1),be=v(P(),1);var De=e=>`graview:first-look:${e}`;function xt(e,n){if(e.seen!==void 0)try{return typeof e.seen=="function"?e.seen():e.seen}catch{return!0}try{return window.localStorage.getItem(De(n))!==null}catch{return!1}}function St(e,n){if(e.seen===void 0)try{window.localStorage.setItem(De(n),"seen")}catch{}}var Pt=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.U3JK2DNC.js")))),Lt=Pt.part((e,n)=>{let t=e.FirstLookHints;return(0,be.jsx)(t,{...n})},{quiet:!0});function Et({firstLook:e,root:n,app:t}){let r=(0,z.useRef)(null);r.current=e===!0?{}:e||null;let[i,a]=(0,z.useState)(()=>r.current!==null&&typeof window<"u"&&!xt(r.current,t)),s=(0,z.useCallback)(p=>{if(a(!1),p===null)return;let c=r.current??{};St(c,t),c.onDone?.(p)},[t]);return!i||r.current===null?null:(0,be.jsx)(z.Suspense,{fallback:null,children:(0,be.jsx)(Lt,{root:n,steps:r.current.steps??[],onEnd:s})})}export{fe as a,fr as b,At as c,Sn as d,Tt as e,ie as f,Lr as g,yr as h,wr as i,ge as j,hr as k,br as l,kr as m,xr as n,M as o,Hr as p,Nr as q,Bn as r,Br as s,X as t,Cr as u,Ur as v,tt as w,at as x,jr as y,Yr as z,Re as A,it as B,zn as C,Gn as D,st as E,vt as F,bt as G,kt as H,lt as I,ut as J,Et as K};
|
|
73
|
+
}`,X={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,minWidth:W,height:W,padding:0,borderRadius:8,border:"1px solid transparent",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.875rem",cursor:"pointer",flex:"0 0 auto"};function Or({brand:e,name:n,heading:t=1,home:r,faces:i,places:a,current:s,reach:p,tools:c,find:d=!0,description:u,findBox:l,onFind:m,switch:w="words",scenePlaces:h,skips:S,named:b=!0,actions:L}){let se=(0,y.useRef)(null),f=Z()?.who.size,[x,U]=(0,y.useState)(null),[T,Qn]=(0,y.useState)(null),[E,Zn]=(0,y.useState)(!1),[Jn,Ie]=(0,y.useState)(!1),[Xn,er]=(0,y.useState)(!0),[$e,nr]=(0,y.useState)(null),[rr,tr]=(0,y.useState)(!0),le=i?i.pages.current:!h,re=le?{places:a,current:s,reach:p}:h,ke=re&&{...re,places:rn(re.places),here:re.places.find(g=>g.key===re.current)?.label},k=ke&&ke.places.length>0?ke:null,xe=k?k.places.findIndex(g=>g.key===k.current):-1,_e=!!i&&w==="words",We=k?k.places.map(g=>g.primary===!1?"0":"1").join(""):"",I=(0,y.useCallback)(()=>{let g=se.current;if(!g)return;let B=Yr(g,xe,_e,We);B!==void 0&&nr(B);let G=B?!0:Vr(g);G!==null&&er(G)},[xe,_e,We]);(0,y.useLayoutEffect)(()=>{let g=se.current;if(!g)return;let B=()=>{let te=g.getBoundingClientRect().width;Zn(te<J);let pr=g.querySelector("[data-graview-bar-host-ruler]");tr(te>=J+(pr?.getBoundingClientRect().width??0)),g.style.setProperty("--graview-bar-width",`${Math.round(te)}px`),I()};B();let G=typeof document>"u"?void 0:document.fonts;if(G?.ready.then(I),G?.addEventListener?.("loadingdone",I),typeof ResizeObserver>"u")return()=>G?.removeEventListener?.("loadingdone",I);let Pe=new ResizeObserver(B);Pe.observe(g);for(let te of g.querySelectorAll(".graview-bar-tools > *"))Pe.observe(te);return()=>{Pe.disconnect(),G?.removeEventListener?.("loadingdone",I)}},[I]);let Se=(0,y.useRef)(m);Se.current=m,(0,y.useLayoutEffect)(()=>{Se.current?.(d&&x?{slot:x,compact:E,own:T}:null)},[d,x,E,T]),(0,y.useLayoutEffect)(()=>()=>Se.current?.(null),[]);let ar=(0,y.useCallback)(()=>{Ie(!0),requestAnimationFrame(()=>x?.querySelector("input")?.focus())},[x]),Ke=(0,y.useRef)(null),de=(0,y.useRef)(!1),ze=(0,y.useCallback)(()=>{Ie(!1),de.current&&(de.current=!1,requestAnimationFrame(()=>Ke.current?.focus()))},[]),or=t===!1?"span":`h${t}`,ir=r.href!==void 0?"a":"button",sr=g=>B=>{!g||!On(B)||(B.preventDefault(),g())},lr=!le,Ge=k&&!E&&$e!==null&&!(xe<0&&k.here)?$e.split(",").map(Number).filter(g=>g<k.places.length):null,ce=k?(0,o.jsx)(qr,{places:k.places,current:k.current,here:k.here,reach:k.reach,scene:lr,stands:Ge}):null,dr=k?k.places.map(g=>g.label).join(`
|
|
74
|
+
`):"";(0,y.useLayoutEffect)(I,[I,n,e,dr,k?.current,le,E,w,d]);let cr=w==="icons"||!Xn||E?"icons":"words";return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("header",{ref:se,className:"graview-bar","data-testid":"app-bar","data-graview-app-bar":"",...Jn&&E?{"data-finding":""}:{},children:[(0,o.jsx)("style",{children:Rr}),S,(0,o.jsxs)("div",{className:"graview-bar-row",children:[b?(0,o.jsx)("div",{className:"graview-bar-app",children:(0,o.jsx)(or,{className:"graview-bar-name",children:(0,o.jsxs)(ir,{...r.href!==void 0?{href:r.href,onClick:sr(r.go)}:{type:"button",onClick:r.go},"data-testid":"app-home",...r.current?{"aria-current":"page"}:{},title:u?`${n} \u2014 ${u}`:`${n} \u2014 home`,className:"graview-bar-home",children:[(0,o.jsx)(Be,{brand:e,size:20}),(0,o.jsx)("span",{className:"graview-bar-app-name","data-testid":"app-name",children:n})]})})}):null,i?(0,o.jsx)(Fr,{faces:i,form:w,drawn:cr}):null,(0,o.jsx)("div",{className:"graview-bar-mid",...Ge?{"data-places":"standing"}:!E&&ce?{"data-place":""}:{},children:E?null:ce}),!E&&k&&k.places.length>1?(0,o.jsxs)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-ruler":"",children:[k.places.map(g=>(0,o.jsx)("span",{className:"graview-bar-at",children:g.label},g.key)),(0,o.jsxs)("span",{className:"graview-bar-at",children:[me,(0,o.jsx)(Vn,{})]})]}):null,L&&L.length>0?(0,o.jsx)("span",{className:"graview-bar-ruler","aria-hidden":"true","data-graview-bar-host-ruler":"",children:(0,o.jsx)("span",{className:"graview-bar-host",children:L.map(g=>(0,o.jsxs)("span",{className:"graview-bar-host-action",children:[g.icon?(0,o.jsx)(Dn,{icon:g.icon}):null,(0,o.jsx)("span",{children:g.label})]},g.label))})}):null,b?(0,o.jsx)("span",{className:"graview-bar-ruler","aria-hidden":"true",children:(0,o.jsx)("span",{className:"graview-bar-name",children:n})}):null,(0,o.jsxs)("div",{className:"graview-bar-tools",children:[d?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{type:"button",className:"graview-bar-find-open",ref:Ke,"data-testid":"app-find-open","aria-label":"Find",title:"Find",onClick:ar,style:{...X,display:void 0},children:(0,o.jsx)(_r,{})}),(0,o.jsxs)("div",{className:"graview-bar-find","data-testid":"app-find",onBlur:g=>{let B=g.relatedTarget;B instanceof Node&&g.currentTarget.contains(B)||g.currentTarget.querySelector("input")?.value||ze()},onKeyDownCapture:g=>{g.key==="Escape"&&E&&(de.current=!0)},onKeyDown:g=>{g.key!=="Escape"||!E||(!g.defaultPrevented||!g.currentTarget.querySelector("input")?.value?ze():de.current=!1)},children:[(0,o.jsx)("div",{ref:U,className:"graview-bar-find-slot",children:l}),(0,o.jsx)(Ir,{})]})]}):null,(0,o.jsx)("div",{ref:Qn,className:"graview-bar-own","data-graview-bar-own":""}),f?(0,o.jsx)(y.Suspense,{fallback:null,children:(0,o.jsx)(Tr,{scene:!le,compact:E})}):null,(0,o.jsx)(Hr,{}),L&&L.length>0?(0,o.jsx)(zr,{actions:L,folded:E||!rr}):null,c]})]})]}),E&&ce?(0,o.jsx)("div",{className:"graview-bar-line","data-graview-place-line":"","data-testid":"app-place-line",children:ce}):null]})}function Fr({faces:e,form:n,drawn:t}){let r=i=>{let a=e[i];return(0,o.jsxs)("button",{type:"button",className:"graview-bar-face","data-testid":`app-face-${i}`,"aria-pressed":a.current,title:a.label,...a.reach&&!a.current?{onPointerEnter:a.reach,onPointerDown:a.reach,onFocus:a.reach}:{},onClick:()=>{a.current||a.go()},children:[i==="scene"?(0,o.jsx)(Fn,{}):(0,o.jsx)($r,{}),(0,o.jsx)("span",{children:a.label})]})};return(0,o.jsxs)("div",{className:"graview-bar-faces",role:"group","aria-label":`${e.scene.label} or ${e.pages.label}`,"data-testid":"app-faces","data-switch":n,"data-switch-drawn":t,children:[r("scene"),r("pages")]})}function Vr(e){let n=e.querySelector(".graview-bar-faces"),t=e.querySelector(".graview-bar-mid"),r=e.querySelector(".graview-bar-find");if(!n||!t||r?.matches(":focus-within")||e.getBoundingClientRect().width<J)return null;let a=$n(n),s=t.querySelector(".graview-bar-place-words"),p=s?parseFloat(getComputedStyle(s).fontSize)||14:0,c=s?Math.min(s.scrollWidth+34,14*p):0,d=Rn(e);if(d===null)return!1;let u=t.getBoundingClientRect().width-c-d;if(r&&r.getBoundingClientRect().width>0){let l=parseFloat(getComputedStyle(r).flexBasis);isFinite(l)&&(u-=Math.max(0,l-r.getBoundingClientRect().width))}return n.getAttribute("data-switch-drawn")==="icons"?u>=a+2:u>=-1}function Rn(e){let n=e.querySelector(".graview-bar-app"),t=e.querySelector(".graview-bar-ruler>.graview-bar-name");if(!n||!t)return 0;let r=s=>s?.getBoundingClientRect().width??0,i=r(n.firstElementChild)-r(e.querySelector(".graview-bar-app-name"))+r(t)+2,a=parseFloat(getComputedStyle(n).maxWidth)/100*(n.parentElement.clientWidth-2*n.offsetLeft)||1/0;return i>a+.5?null:Math.max(0,i-r(n))}var On=e=>e.button===0&&!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey);function Dr(){let e=globalThis.navigator?.platform??"";return/Mac|iPhone|iPad|iPod/.test(e)?"\u2318K":"Ctrl K"}function Ir(){let e=Sn(Z()?.aiDesk);return(0,o.jsx)("span",{className:"graview-bar-find-keys","data-testid":"app-find-keys","aria-hidden":"true",children:e?"/":Dr()})}function ee({size:e,box:n=e,children:t}){return(0,o.jsx)("svg",{width:e,height:e,viewBox:`0 0 ${n} ${n}`,"aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto"},children:t})}function Fn(){return(0,o.jsxs)(ee,{size:14,children:[(0,o.jsx)("path",{d:"M7 1.5 L12.5 4.5 L7 7.5 L1.5 4.5 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M1.5 7.5 L7 10.5 L12.5 7.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",strokeLinecap:"round"})]})}function $r(){return(0,o.jsxs)(ee,{size:14,children:[(0,o.jsx)("rect",{x:"2.25",y:"1.75",width:"9.5",height:"10.5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,o.jsx)("path",{d:"M4.5 5 H9.5 M4.5 7.25 H9.5 M4.5 9.5 H7.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Vn(){return(0,o.jsx)(ee,{size:10,children:(0,o.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function _r(){return(0,o.jsxs)(ee,{size:16,children:[(0,o.jsx)("circle",{cx:"7",cy:"7",r:"4.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,o.jsx)("path",{d:"M10.5 10.5 L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Wr({place:e}){if(e.key===Y)return(0,o.jsx)(Fn,{});if(e.group==="home")return(0,o.jsx)(ee,{size:13,box:14,children:(0,o.jsx)("path",{d:"M2 6.5 L7 2 L12 6.5 V12 H2 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})});let n=e.kind?`hsl(${Math.round(Ze(e.kind))} 55% 52%`:"rgb(128 128 128";return(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:12,height:8,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",background:e.group==="lists"?`${n})`:`linear-gradient(${n}), ${n})) center / 6px 4px no-repeat, ${n} / 0.35)`}})}var Kr=[{group:"home"},{group:"lists",heading:"Lists"},{group:"pictures",heading:"Pictures"}],me="More";function zr({actions:e,folded:n}){let t=j("host-actions",{popover:n}),r=e.map(a=>a.label).join(", "),i=a=>e.map(s=>(0,o.jsxs)("button",{type:"button",className:n?"graview-bar-host-action graview-bar-item":"graview-bar-host-action","data-testid":"host-bar-action",onClick:()=>{a(),s.onSelect()},children:[s.icon?(0,o.jsx)(Dn,{icon:s.icon}):null,(0,o.jsx)("span",{children:s.label})]},s.label));return n?(0,o.jsxs)("div",{className:"graview-bar-host",children:[(0,o.jsx)("button",{type:"button",className:"graview-bar-host-action","data-testid":"host-bar-actions-open","data-folded":"",...t.trigger,onClick:t.toggle,"aria-label":`${me} \u2014 ${r}`,title:r,children:(0,o.jsxs)(ee,{size:16,children:[(0,o.jsx)("circle",{cx:"3",cy:"8",r:"1.4",fill:"currentColor"}),(0,o.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,o.jsx)("circle",{cx:"13",cy:"8",r:"1.4",fill:"currentColor"})]})}),(0,o.jsx)("div",{...t.pane,"data-testid":"host-bar-actions",hidden:!t.open,className:"graview-bar-list",style:q,"aria-label":"From the host",children:i(()=>t.setOpen(!1))})]}):(0,o.jsx)("div",{className:"graview-bar-host","data-testid":"host-bar-actions-standing",role:"group","aria-label":"From the host",children:i(()=>{})})}function Dn({icon:e}){let n=ie($(e)?e:void 0);return n?(0,o.jsx)("span",{className:"graview-bar-host-mark","aria-hidden":"true",dangerouslySetInnerHTML:n}):(0,o.jsx)("span",{className:"graview-bar-host-mark","aria-hidden":"true",children:e})}function In({place:e,current:n,reach:t,standing:r,done:i}){let a=e.key===n,s=t.href?.(e.path);return(0,o.jsxs)(s!==void 0?"a":"button",{className:r?"graview-bar-at":"graview-bar-item","data-testid":`app-place-${e.key}`,"data-place-path":e.path,...a?{"aria-current":"page"}:{},...s!==void 0?{href:s}:{type:"button"},onClick:c=>{i(),t.go&&(s!==void 0&&!On(c)||(c.preventDefault(),t.go(e)))},children:[r?null:(0,o.jsx)("span",{className:"graview-bar-mark",children:(0,o.jsx)(Wr,{place:e})}),r&&a?(0,o.jsx)("span",{"data-testid":"app-place-current",children:e.label}):(0,o.jsx)("span",{children:e.label})]})}function Gr({places:e,current:n,reach:t,id:r,done:i}){return(0,o.jsx)(o.Fragment,{children:Kr.map(({group:a,heading:s})=>{let p=e.filter(d=>d.group===a);if(p.length===0)return null;let c=`${r}-${a}`;return(0,o.jsxs)("div",{role:"group",...s?{"aria-labelledby":c}:{"aria-label":p[0].label},"data-place-group":a,children:[s?(0,o.jsx)("p",{id:c,children:s}):null,(0,o.jsx)("ul",{children:p.map(d=>(0,o.jsx)("li",{children:(0,o.jsx)(In,{place:d,current:n,reach:t,standing:!1,done:i})},d.key))})]},a)})})}function qr({places:e,current:n,here:t,reach:r,scene:i,stands:a}){let s=j("places"),p=(0,y.useRef)(a);s.open||(p.current=a);let c=p.current,u=e.find(b=>b.key===n)?.label??t??"Places",l=c?e.filter((b,L)=>!c.includes(L)):e,m=jr(e,n,i),w=Z(),h=w?.keptViews?.current(),S=!!(h&&(h.removed.length>0||w.views.places().some(b=>b.hidden)||h.may.lenses&&(w.views.arrangement?.()?.hide?.length??0)>0));return(0,o.jsxs)("nav",{className:c?"graview-bar-places":"graview-bar-place-at","aria-label":i?"What the scene shows":"The app\u2019s places",...c?{"data-testid":"app-places-standing"}:{},...m,children:[c?.map(b=>(0,o.jsx)(In,{place:e[b],current:n,reach:r,standing:!0,done:()=>{}},e[b].key)),l.length>0||S?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("button",{type:"button",className:c?"graview-bar-at":"graview-bar-place","data-testid":"app-places-open",...s.trigger,onClick:s.toggle,"aria-label":c?`${me} \u2014 ${l.length} more ${i?"pictures":"places"}`:`${u} \u2014 ${i?"everything the scene shows":"every place"}`,title:c?l.map(b=>b.label).join(", "):u,children:[c?me:(0,o.jsx)("span",{className:"graview-bar-place-words","data-testid":"app-place-current",children:u}),(0,o.jsx)(Vn,{})]}),(0,o.jsxs)("div",{...s.pane,"data-testid":"app-places",hidden:!s.open,className:"graview-bar-list",style:q,children:[(0,o.jsx)(Gr,{places:l,current:n,reach:r,id:s.pane.id,done:()=>s.setOpen(!1)}),S&&s.open?(0,o.jsx)(y.Suspense,{fallback:null,children:(0,o.jsx)(Nr,{id:s.pane.id,scene:i,reach:r,done:()=>s.setOpen(!1)})}):null]})]}):null]})}function jr(e,n,t){let r=Z()?.setMenuAt,i=a=>{let s=a.target.closest?.("[data-place-path],[data-testid=app-places-open]");if(!s||!r)return;let p={at:0};a.type==="pointerdown"?document.addEventListener("pointerup",()=>p.at||=Date.now(),{once:!0}):a.preventDefault();let c=a.nativeEvent;M.load().then(d=>d.placeGesture(c,s,e,n,t,r,p),String)};return{onContextMenu:a=>a.shiftKey||i(a),onKeyDown:a=>(a.key==="ContextMenu"||a.key==="F10"&&a.shiftKey)&&i(a),onPointerDown:a=>a.pointerType!=="mouse"&&a.isPrimary&&i(a)}}function Yr(e,n,t,r){let i=e.querySelector("[data-graview-bar-ruler]"),a=e.querySelector(".graview-bar-mid");if(!i||!a)return null;let s=e.querySelector(".graview-bar-find");if(s?.matches(":focus-within"))return;if(e.getBoundingClientRect().width<J)return null;let p=Rn(e);if(p===null)return null;let c=[...i.children].map(L=>L.getBoundingClientRect().width),d=c.pop()??0,u=e.querySelector(".graview-bar-faces"),l=u&&t?$n(u):0,m=u?.getAttribute("data-switch-drawn")==="words"?l:0,w=a.getBoundingClientRect().left+p,h=s?.getBoundingClientRect(),S=h&&h.width>0?h.right-w-(parseFloat(getComputedStyle(s).minWidth)||0)-16:a.getBoundingClientRect().width-p,b=[...r].map(L=>L!=="0");return Cn({widths:c,current:n,room:Math.floor(S+m-l),more:d,primary:b})?.join(",")??null}function $n(e){return[...e.querySelectorAll(".graview-bar-face span")].reduce((n,t)=>n+t.scrollWidth+10,0)}var Ur=e=>`graview:lenses:${e}`,Qr=(e,n)=>e?.name??n.kinds.join(",");function Re(e){try{let n=JSON.parse(localStorage.getItem(Ur(e))??"[]");return Array.isArray(n)?n.filter(t=>typeof t?.title=="string"&&typeof t.lens=="string"):[]}catch{return[]}}var K=v(R(),1);var N=v(P(),1);function Zr({scheme:e,onScheme:n,profileHref:t,keeping:r,hostActions:i=Jr,signature:a=!1}){let{store:s,principal:p,seats:c,people:d}=ue(),u=j("profile"),l=u.open,[m,w]=(0,K.useState)(!1);(0,K.useEffect)(()=>nt(ye),[]),l&&!m&&w(!0),(0,K.useEffect)(()=>{l&&ye()},[l]);let h=p.id===void 0?void 0:s.graph.getNode(p.id),S=h===void 0?p.id===void 0?"Nobody in particular":Ue(p,{graph:s.graph,schema:s.schema,seats:c,people:d}):qe(s.schema.tryDefinition(h.kind),h);return(0,N.jsxs)("div",{style:{position:"relative"},children:[(0,N.jsx)("button",{type:"button","data-testid":"profile-button",...u.trigger,onClick:u.toggle,onPointerEnter:ye,onFocus:ye,"aria-label":`${S} \u2014 you, your seat and your settings`,title:`${S} \u2014 you, your seat and your settings`,style:{...X,borderRadius:999},children:(0,N.jsx)("span",{"aria-hidden":"true","data-testid":"profile-mark",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:W-4,height:W-4,borderRadius:999,fontSize:"0.8125rem",fontWeight:600,background:"var(--graview-panel-muted)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)"},children:rt(S)})}),(0,N.jsxs)("section",{...u.pane,"aria-label":"Profile","data-testid":"profile","data-graview-offstage":"",hidden:!l,style:{...q,width:280,maxWidth:"calc(100vw - 32px)",maxHeight:"min(62cqh, 520px)",overflowY:"auto",overflowX:"hidden",display:l?"grid":"none",gap:12,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[m?(0,N.jsx)(K.Suspense,{fallback:null,children:(0,N.jsx)(Xr,{part:"top",name:S,me:h,profileHref:t,hostActions:i,close:()=>u.setOpen(!1)})}):null,(0,N.jsxs)("div",{className:"graview-profile-keeping","data-testid":"profile-keeping",style:at,children:[(0,N.jsx)("span",{style:tt,children:"Keeping this app"}),r]}),m?(0,N.jsx)(K.Suspense,{fallback:null,children:(0,N.jsx)(et,{part:"rest",name:S,me:h,scheme:e,onScheme:n,hostActions:i,signature:a,close:()=>u.setOpen(!1)})}):null]})]})}var Jr=[],ye=()=>M.prefetch(),Xr=M.part((e,n)=>(0,N.jsx)(e.ProfilePane,{...n}),{what:"The rest of your menu"}),et=M.part((e,n)=>(0,N.jsx)(e.ProfilePane,{...n}),{quiet:!0});function nt(e){let n=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},t=globalThis;if(t.requestIdleCallback){let i=t.requestIdleCallback(n,{timeout:5e3});return()=>t.cancelIdleCallback?.(i)}let r=setTimeout(n,2500);return()=>clearTimeout(r)}function rt(e){return(e.trim()[0]??"?").toUpperCase()}var tt={fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},at={paddingTop:10,borderTop:"1px solid var(--graview-edge)"};function ot(e){return!(e==="hidden"||e===!1)}var Oe=v(R(),1);var _n="The whole thing",we=e=>`scene:${e.kind}:${e.as}`;function Wn(e){let{view:n}=e,t=e.places.filter(l=>!e.hidden.has(l.kind)),r=ae(t),i=(l,m)=>{if(l===Y)return un(fn(m,!0),"view",null);let w=r.find(h=>we(h)===l);return w?mn(m,w.over?.find(h=>m.focusId===oe(h))??w.kind,w.as):null},a=n.within?.view,s=l=>n.focusId===oe(l.kind)&&(a===void 0?t.filter(m=>m.kind===l.kind).at(-1)===l:a===l.as),p=t.find(l=>s(l)&&(a!==void 0||!n.overview)),c=p?r.find(l=>pe(l,p)):void 0,d=r.filter(l=>!l.hidden||l===c);return{places:[{key:Y,label:_n,path:`${Ee}${Ne(i(Y,Ae))}`,group:"home"},...d.map(l=>({key:we(l),label:Q(l,t,e.schema),path:`${Ee}${Ne(i(we(l),Ae))}`,group:"pictures",kind:l.kind,hidden:l.hidden}))],current:c?we(c):Y,to:i}}function it(){let{store:e,views:n,hiddenKinds:t}=ue(),{view:r,go:i}=bn(),a=n.places(),s=(0,Oe.useMemo)(()=>Wn({places:a,hidden:t,view:r,schema:e.schema}),[a,t,r,e.schema]),p=(0,Oe.useMemo)(()=>({go:c=>{let d=s.to(c.key,r);d&&i(d)}}),[s,r,i]);return{places:s.places,current:s.current,reach:p}}var ne=v(R(),1);var F=v(P(),1),st=M.part((e,n)=>(0,F.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"}),Fe=()=>M.prefetch();function lt({clean:e="All rules hold"}){let n=vn(),{set:t}=hn(),r=n.length,[i,a]=(0,ne.useState)(!1),s=j("problems",{open:i&&r>0,onOpenChange:a}),p=s.open,c=zn(n,e);return(0,ne.useEffect)(()=>{if(r===0)return;let d=setTimeout(Fe,1500);return()=>clearTimeout(d)},[r>0]),(0,F.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[(0,F.jsxs)("button",{type:"button","data-testid":"standing",...s.trigger,"aria-disabled":r===0?!0:void 0,"aria-label":c,onClick:r===0?void 0:s.toggle,onPointerEnter:r===0?void 0:Fe,onFocus:r===0?void 0:Fe,title:c,style:{...X,padding:r===0?0:"0 8px",cursor:r===0?"default":"pointer",color:r===0?"var(--graview-ink-muted)":Kn(n),fontVariantNumeric:"tabular-nums",fontWeight:600},children:[(0,F.jsx)(Gn,{tone:r===0?"var(--graview-good)":Kn(n)}),r>0?(0,F.jsx)("span",{"aria-hidden":"true",children:r}):null]}),p?(0,F.jsx)("ol",{...s.pane,"data-testid":"problems",style:{...q,width:300,maxHeight:"min(48cqh, 420px)",overflow:"auto",margin:0,padding:4,listStyle:"none",display:"grid",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,F.jsx)(ne.Suspense,{fallback:null,children:(0,F.jsx)(st,{violations:n,pick:d=>{t(d.nodeIds),s.setOpen(!1)}})})}):null]})}function zn(e,n){return e.length===0?n:`${Qe(e)} \u2014 open what is broken, and what would fix it`}var Kn=e=>e.some(n=>n.status==="could-not-judge"||n.status==="over-budget")?"var(--graview-bad)":"var(--graview-warn)";function Gn({tone:e}){return(0,F.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:999,flex:"0 0 auto",background:e}})}function dt(e,n,t=[]){if(e.focusId)return e.focusId;let i=(e.selection??[]).map(gn).find(a=>a!==null)??t.find(a=>n.includes(a))??n[0]??null;return i===null?null:oe(i)}var ve=v(P(),1),he=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.I77ZGIFE.js","./chunk.OWOOKLIU.js","./chunk.RD2X25XB.js","./chunk.KMV6PJFL.js","./chunk.A3ZC2JBO.js","./chunk.NAD7ZXYP.js","./chunk.2GEJNG2U.js","./chunk.UQQKDBIH.js","./chunk.AJSUHPBE.js","./chunk.LAYQ5PFS.js","./chunk.KDXU5DT3.js","./chunk.O2BHPYA4.js","./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HANJZ6FA.js"))));function ct(){return he.load().then(()=>{})}var pt=[{cardinality:"one",fidelity:"full",slot:"page"},{cardinality:"one",fidelity:"summary",slot:"card"},{cardinality:"one",fidelity:"glyph",slot:"row"},{cardinality:"many",fidelity:"full"},{cardinality:"many",fidelity:"summary"},{cardinality:"many",fidelity:"glyph"}];function ut({schema:e,specs:n,kind:t,view:r}){let i=he.current.frameworkViews(e,n).lookup(t,{cardinality:r.cardinality,fidelity:r.fidelity});return i?(0,ve.jsx)(i,{...r}):null}var ft=he.part((e,n)=>(0,ve.jsx)(ut,{...n}),{what:"This view"});function qn(e,n,t){for(let r of n.kinds){let i=t?.[r];for(let a of pt){let s=c=>(0,ve.jsx)(ft,{schema:n,specs:t,kind:r,view:c}),p=a.slot!==void 0&&i?.[a.slot]!==void 0;p&&(s.says=(c,d)=>he.current?.frameworkViews(n,t).lookup(r,{cardinality:a.cardinality,fidelity:a.fidelity})?.says?.(c,d)),e.register(r,{cardinality:a.cardinality,fidelity:a.fidelity},p?s:yn(s))}}return e}function gt(e,n){return qn(wn(e),e,n)}var Ve=v(R(),1);var D=v(P(),1),jn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.UFDJXQQQ.js","./chunk.ELTV44HU.js","./chunk.CY3ELWCM.js","./chunk.RMR24LFJ.js","./chunk.I77ZGIFE.js","./chunk.OWOOKLIU.js","./chunk.RD2X25XB.js","./chunk.KMV6PJFL.js","./chunk.SWMDFXUX.js","./chunk.A3ZC2JBO.js","./chunk.NAD7ZXYP.js","./chunk.2GEJNG2U.js","./chunk.HJCQ6I3S.js","./chunk.22BZU7ME.js","./chunk.2N4Z5K5S.js","./chunk.JYFZCJ4N.js","./chunk.UQQKDBIH.js","./chunk.AJSUHPBE.js","./chunk.LAYQ5PFS.js","./chunk.KDXU5DT3.js","./chunk.O2BHPYA4.js","./chunk.M4AYA2PL.js","./chunk.H5S7OL2U.js","./chunk.PZQNR4KZ.js","./chunk.W4BKYSZX.js","./chunk.Y2YYH3JN.js","./chunk.NOGGSLVG.js","./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.KL7E4YHJ.js"))));function mt({lens:e,view:n}){let t=jn.current.declaredLensView(e);return(0,D.jsx)(t,{...n})}var yt=jn.part((e,n)=>(0,D.jsx)(mt,{...n}),{what:"This picture"});function wt(e){let n=r=>(0,D.jsx)(Ve.Suspense,{fallback:null,children:(0,D.jsx)(yt,{lens:e,view:r})});e.lens==="blocks"&&(n.flows=!0);let t=e.lens==="blocks"?e.options.blocks?.[0]:void 0;return typeof t?.headline=="string"&&(n.lede=t),e.create===!1&&(n.creates=!1),n}var Yn=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.I77ZGIFE.js","./chunk.OWOOKLIU.js","./chunk.RD2X25XB.js","./chunk.KMV6PJFL.js","./chunk.A3ZC2JBO.js","./chunk.NAD7ZXYP.js","./chunk.2GEJNG2U.js","./chunk.UQQKDBIH.js","./chunk.AJSUHPBE.js","./chunk.LAYQ5PFS.js","./chunk.KDXU5DT3.js","./chunk.O2BHPYA4.js","./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.7YOAW7ED.js"))));function ht({blocks:e,view:n}){let t=Yn.current.homeView(e);return(0,D.jsx)(t,{...n})}var vt=Yn.part((e,n)=>(0,D.jsx)(ht,{...n}),{what:"The home"});function bt(e){let n=t=>(0,D.jsx)(Ve.Suspense,{fallback:null,children:(0,D.jsx)(vt,{blocks:e,view:t})});return Object.defineProperty(n,Symbol.for("graview.home-blocks"),{value:!0}),n}function kt(e,n){return n.home&&n.home.length>0&&e.home?.(bt(n.home)),Un(e,n),e.arrange?.(n.pages),e}function Un(e,n,t){for(let r of on(n).drawn){if(t&&e.places().some(s=>s.title===r.title))continue;let i=wt(r),a={title:r.title,lens:r.lens,...r.across?{across:r.across}:{},...t?{beside:t}:{},...r.hidden?{hidden:!0}:{},over:r.kinds,...t?{}:{declared:!0}};for(let s of r.kinds)e.register(s,{cardinality:"many",fidelity:"full"},i,a),e.register(s,{cardinality:"many",fidelity:"summary"},i,a)}}function xt(e,n,t){t.length>0&&Un(e,{schema:n,lenses:t.map(({lens:r,...i})=>({...i,name:r}))},!0)}function St(e,n,t){xt(e,n,Re(t))}var z=v(R(),1),be=v(P(),1);var De=e=>`graview:first-look:${e}`;function Pt(e,n){if(e.seen!==void 0)try{return typeof e.seen=="function"?e.seen():e.seen}catch{return!0}try{return window.localStorage.getItem(De(n))!==null}catch{return!1}}function Lt(e,n){if(e.seen===void 0)try{window.localStorage.setItem(De(n),"seen")}catch{}}var Et=O(C(()=>(__graviewPreload(import.meta.url,["./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.QGU5QTR6.js")))),At=Et.part((e,n)=>{let t=e.FirstLookHints;return(0,be.jsx)(t,{...n})},{quiet:!0});function Nt({firstLook:e,root:n,app:t}){let r=(0,z.useRef)(null);r.current=e===!0?{}:e||null;let[i,a]=(0,z.useState)(()=>r.current!==null&&typeof window<"u"&&!Pt(r.current,t)),s=(0,z.useCallback)(p=>{if(a(!1),p===null)return;let c=r.current??{};Lt(c,t),c.onDone?.(p)},[t]);return!i||r.current===null?null:(0,be.jsx)(z.Suspense,{fallback:null,children:(0,be.jsx)(At,{root:n,steps:r.current.steps??[],onEnd:s})})}export{fe as a,fr as b,Tt as c,Sn as d,Ht as e,ie as f,Ar as g,yr as h,wr as i,ge as j,hr as k,vr as l,br as m,xr as n,Sr as o,Pr as p,M as q,Br as r,Mr as s,Bn as t,Cr as u,X as v,Or as w,Zr as x,ot as y,it as z,Ur as A,Qr as B,Re as C,lt as D,zn as E,Gn as F,dt as G,kt as H,xt as I,St as J,ct as K,gt as L,Nt as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./chunk.
|
|
1
|
+
import{j as m}from"./chunk.AI34V6WV.js";import{G as N,T as f,X as y}from"./chunk.M7RESZB6.js";import{b as g}from"./chunk.AJZBJBMO.js";var p=g(N(),1);var a=g(f(),1);var R={default:{background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)"},muted:{background:"var(--graview-panel-muted, #f7f5f1)",color:"var(--graview-ink, #1a1a1a)"},warning:{background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)"}},T={color:"var(--graview-ink-muted, #55514a)"},C={color:"var(--graview-ink-faint, #625d55)"};function H(e){let[l,o]=(0,p.useState)(z);return(0,p.useEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let t=()=>{let i=W(r,parseFloat(getComputedStyle(r).paddingBottom)||0);o(s=>s.overflowing===i.overflowing&&s.above===i.above&&s.below===i.below?s:i)};t();let d=new ResizeObserver(t);d.observe(r);for(let i of r.children)d.observe(i);return r.addEventListener("scroll",t,{passive:!0}),()=>{d.disconnect(),r.removeEventListener("scroll",t)}}),l}var z={overflowing:!1,above:!1,below:!1};function W(e,l=0){let o=e.scrollHeight>e.clientHeight+1,r=e.scrollWidth>e.clientWidth+1;return{overflowing:o||r,above:o&&e.scrollTop>1,below:o&&e.scrollTop+e.clientHeight<e.scrollHeight-l-1}}var A=(0,p.createContext)(null),I=(0,p.createContext)(null);function O({level:e,said:l=!0,style:o,children:r}){if(e===void 0)return(0,a.jsx)("strong",{style:o,...l?{}:{"aria-hidden":!0},children:r});let t=`h${e}`;return(0,a.jsx)(t,{style:{margin:0,...o},children:r})}function E({title:e,subtitle:l,meta:o,selected:r,tone:t="default",children:d,style:i,fit:s=!1,variant:w,heading:b}){let c=(0,p.useRef)(null),{overflowing:v,above:x,below:S}=H(c),P=y(),n=(w??(P==="fullscreen"?"page":"card"))==="page",k=(0,p.useContext)(A),u=(0,p.useContext)(I);return(0,a.jsxs)("div",{"data-graview-primitive":"panel","data-graview-variant":n?"page":"card","data-selected":r||void 0,style:{display:"flex",flexDirection:"column",gap:n?12:"var(--graview-gap, 7px)",height:n||s?"auto":"100%",maxHeight:n?"none":"100%",padding:n?0:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:n?0:"var(--graview-radius, 12px)",border:n?"none":`1px solid ${r?"var(--graview-accent, #2f6f5e)":"var(--graview-edge, #e4e0d8)"}`,boxShadow:n?"none":r?"0 0 0 1px var(--graview-accent-dim), var(--graview-lift-low)":"var(--graview-lift-low)",overflow:n?"visible":"hidden",...R[t],...n?{background:"transparent"}:{},...i},children:[t==="warning"?(0,a.jsx)("span",{"data-graview-broken":"",style:m,children:"Implicated in a problem."}):null,e===void 0||e===k?null:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0},children:[t==="warning"?(0,a.jsx)("span",{"aria-hidden":"true",title:"Implicated in a problem",style:{color:"var(--graview-warn)",flex:"0 0 auto"},children:"\u26A0"}):null,(0,a.jsx)(O,{level:b,said:u===null||e!==u,style:{fontFamily:"var(--graview-font-display, inherit)",fontSize:n?"1.5625rem":"0.9375rem",lineHeight:n?1.15:1.25,fontWeight:n?600:560,letterSpacing:n?"-0.012em":"0.005em",minWidth:0,overflowWrap:"anywhere"},children:e}),o===void 0?null:(0,a.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",letterSpacing:"0.08em",textTransform:"uppercase",minWidth:0,overflowWrap:"anywhere",...C},children:o})]}),l===void 0?null:(0,a.jsx)("div",{style:{fontSize:n?"0.90625rem":"0.8125rem",lineHeight:1.5,...T},children:l}),(0,a.jsx)("div",{ref:c,className:n?void 0:"graview-scroll",...v&&!n?{tabIndex:0,role:"region",...typeof e=="string"?{"aria-label":e}:{}}:{},style:{display:"flex",flexDirection:"column",gap:n?22:"var(--graview-gap, 7px)",flex:"1 1 auto",...n?{overflow:"visible"}:{marginBottom:"calc(-1 * var(--graview-pad, 15px))",paddingBottom:"var(--graview-pad, 15px)"},...!n&&!v?{overflow:"hidden"}:{}},"data-graview-more-above":x&&!n?"":void 0,"data-graview-more-below":S&&!n?"":void 0,children:d})]})}function h({label:e,hue:l,selected:o,title:r,pickId:t,emphasis:d}){let i=typeof e=="string"?e:void 0,s=l===void 0?void 0:Math.round(l);return(0,a.jsxs)("span",{"data-graview-primitive":"chip","data-selected":o||void 0,"data-graview-pick":t,"data-graview-emphasis":d,title:r??i,style:{cursor:t?"pointer":void 0,display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",maxWidth:"min(28ch, 100%)",overflow:"hidden",letterSpacing:"0.01em",border:`1px solid ${o?"var(--graview-accent)":s===void 0?"var(--graview-edge)":`hsl(${s} 55% var(--graview-tint-lightness) / 0.45)`}`,background:s===void 0?"var(--graview-panel-muted)":`hsl(${s} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * 0.65))`,color:"var(--graview-ink, #1a1a1a)",boxShadow:o?"0 0 14px -4px var(--graview-accent)":void 0},children:[s===void 0?null:(0,a.jsx)("span",{"aria-hidden":"true",style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",marginRight:6,background:`hsl(${s} 55% var(--graview-tint-lightness) / 0.9)`}}),(0,a.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]})}function L({items:e,max:l=8,selectedIds:o=[],pick:r=!1}){let t=e.slice(0,l),d=e.length-t.length;return(0,a.jsxs)("div",{"data-graview-primitive":"roster",style:{display:"flex",flexWrap:"wrap",gap:6,alignContent:"flex-start"},children:[t.map(i=>(0,a.jsx)(h,{label:i.label,...i.hue===void 0?{}:{hue:i.hue},...r?{pickId:i.id}:{},...i.emphasis===void 0?{}:{emphasis:i.emphasis},selected:o.includes(i.id)},i.id)),d>0?(0,a.jsx)(h,{label:`+${d} more`}):null]})}function F({label:e,count:l,items:o,onExpand:r,flagged:t,problems:d}){return(0,a.jsx)(E,{title:e,meta:d?(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[d,(0,a.jsx)("span",{children:l})]}):l,tone:t?"warning":"muted",style:r?{cursor:"zoom-in"}:void 0,children:o&&o.length>0?(0,a.jsx)(L,{items:o,max:6,pick:!0}):null})}export{A as a,I as b,E as c,h as d,L as e,F as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as U}from"./chunk.WKI5INH7.js";import{ga as $}from"./chunk.DZZL5IDD.js";var w=["owners","status","schedule","budget","places","sources","stock","votes","private","history","publishing","roster","routines","comparison"],y={owners:"people who own things",status:"a status that moves",schedule:"dates it is due by, or a schedule",budget:"money against a budget",places:"places",sources:"sources behind claims",stock:"counts in stock",votes:"votes or picks",private:"private to its owner",history:"a history, a record book",publishing:"content to publish",roster:"a roster of people",routines:"repeating routines",comparison:"a comparison to pick one from"},J={owners:"a person kind (or the people the app has), an owner link, Give it to someone, a rule that every one has somebody on it, and Who has what",status:"a status with named steps (or the one the app has), an act for each step, and a board",schedule:"a due date, Set the date, the on-time rule, and a calendar",budget:"a cost beside the money the app keeps, a budget on the kind it is grouped under, Set the budget, and the over-budget rule",places:"a place kind, a link to one, and a map of where things are",sources:"a source kind, a link from each claim to its source, and the rule that a claim names one",stock:"what is on hand and the reorder level, Count the stock, and the running-low rule",votes:"a vote on each, Vote for it, and a tally",private:"a sight that keeps each person's own records to them",history:"the record book: an era or season each belongs to, and a timeline",publishing:"a published status, Publish it, and what the public sees",roster:"a person kind with the fields a roster keeps, and the list of who is here",routines:"how often each repeats and when it was last done, Mark it done, and the overdue rule",comparison:"a side-by-side of the candidates, one chosen, and Choose it"},M=new Set(["person","people","member","user","player","guest","candidate","participant","traveler","volunteer","interviewer","interviewee","contact","trade","staff","student","employee","teammate","crew","attendee","friend","customer","client","driver","speaker","host","teacher","parent","kid","child","coach","patient","tenant","resident","neighbor","applicant","recruit","contributor","assignee","worker","collaborator","runner"]),K=new Set(["place","venue","location","room","site","building","store","warehouse","city","country","region","address","hall","stadium","office","shelf"]),z=new Set(["source","reference","citation","evidence"]),W=new Set(["season","era","period","epoch","edition","generation","age","campaign","tournament"]),ae=/owner|owned|assign|^lead$|responsible|^by$|^by-|done-?by|interviewer|reviewer|maker|author|keeper|givenby|^for-?person$/i,oe=/due|deadline|until|needed|needby|target|expires|^ends?(on|at)?$|^by$/i,de=/^(date|day|when|at|start|starts|startsat|startson|startdate|scheduled|scheduledfor|scheduledon|happens|happenson|held|heldon|from|time|exchangedate|.*date|.*day)$/i,ce=/released|fixed|published|applied|checked|created|added|done|last|first|updated|seen|born|birth|founded|finished|completed|closed/i,X=/status|stage|state|phase|progress/i,H=/budget|limit|cap$|allowance/i,le=/budget|cost|price|quote|amount|salary|fee|spend|total|paid|owed/i,pe=/^(place|location|venue|address|where|city|town)$/i,B=/reorder|onhand|instock|^stock|quantity|^qty/i,he=/^votes?$|votecount|upvotes|^score$|^points$/i,fe=/^(votes?|votesfor|votedby|voters|picks?|chooses|choices|favorites|likes)$/i,ge=/often|frequency|cadence|^every$|repeat|interval/i,ue=/^last/i,Q=/^(published|live|public)$/i,ye=/count\(.*\bwhere\b.*\)\s*<=\s*1\b/,g=e=>e.toLowerCase(),k=(e,t)=>g(e.kinds[t]?.noun??$(t)),b=(e,t)=>g(e.kinds[t]?.plural??`${k(e,t)}s`),me=e=>e.charAt(0).toUpperCase()+e.slice(1),p=(e,t)=>me(b(e,t)),ke=e=>/^[aeiou]/i.test(e)?"an":"a",j=(e,t="and")=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} ${t} ${e[e.length-1]}`,N=e=>new Set((e??"").split(/[^A-Za-z0-9_-]+/).filter(Boolean)),O=e=>Object.entries(e.kinds),m=(e,t)=>Object.entries(e.acts??{}).filter(([,s])=>[s.on??[]].flat().includes(t)),_=e=>Array.isArray(e.lenses)?e.lenses:[],I=e=>typeof e.title=="string"?e.title:void 0,A=e=>e.bindings&&typeof e.bindings=="object"?e.bindings:{},R=(e,t)=>Array.isArray(t)&&t.length===1&&typeof t[0]=="string"&&e.kinds[t[0]]?t[0]:void 0;function V(e,t){let s=e.kinds[t];if(!s)return!1;let r=n=>g(n).replace(/ll/g,"l");return s.people===!0||M.has(r(t))||M.has(r(k(e,t)))}var Y=(e,t)=>K.has(g(t))||K.has(k(e,t)),we=(e,t)=>z.has(g(t))||z.has(k(e,t)),$e=(e,t)=>W.has(g(t))||W.has(k(e,t)),be=(e,t)=>(t.type==="number"||t.type==="integer")&&(t.format==="money"||le.test(e)),x=e=>e.type==="date"||e.type==="datetime";function P(e,t,s,r,n){return _(e).filter(d=>d.name===t&&A(d)[s]?.[r]===n).map(I).filter(d=>d!==void 0)}function D(e,t,s,r){return _(e).filter(n=>n.name==="coverage"&&A(n)[s]?.kind===t&&(r===void 0||A(n).link?.edge===r)).map(I).filter(n=>n!==void 0)}function f(e,t,s){let r=new Set(t);return Object.entries(e.rules??{}).filter(([,n])=>(s===void 0||n.over==="graph"||s.includes(n.over))&&[...N(`${n.when??""} ${n.require??""} ${n.says??""}`)].some(d=>r.has(d))).map(([n])=>n)}var E=class{kinds=new Set;fields=new Set;relations=new Set;rules=new Set;lenses=new Set;acts=new Set;said;add=(t,...s)=>{for(let r of s)this[t].add(r)};say=t=>{this.said??=t};any=()=>this.kinds.size+this.fields.size+this.relations.size+this.rules.size+this.lenses.size+this.acts.size>0;asTrait=t=>({trait:t,words:y[t],said:this.said??y[t],kinds:[...this.kinds],fields:[...this.fields],relations:[...this.relations],rules:[...this.rules],lenses:[...this.lenses],acts:[...this.acts]})};function Oe(e){let t;for(let[s,r]of O(e)){let n=Object.keys(r.fields).length+Object.keys(r.edges??{}).length;(!t||n>t.fields)&&(t={kind:s,fields:n})}return t?.kind}function u(e){let t=Oe(e);return O(e).sort(([s],[r])=>+(r===t)-+(s===t))}function Z(e,t){let s=e.kinds[t];if(!s)return[];let r=[];for(let[n,d]of Object.entries(s.fields)){if(d.type!=="enum"||!Array.isArray(d.options)||d.options.length<2)continue;let i=m(e,t).filter(([,a])=>typeof a.sets?.[n]=="string"&&d.options.includes(a.sets[n])).map(([a])=>a);((X.test(n)||s.lifecycle?.field===n)&&i.length>=1||i.length>=2)&&r.push({field:n,options:d.options,steps:i})}return r}var ee={owners(e,t){for(let[s,r]of u(e))for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);d.cardinality!=="one"||!i||!V(e,i)||!ae.test(n)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n],[s,i])),t.add("lenses",...D(e,s,"rows",n)),t.add("acts",...m(e,s).filter(([,o])=>o.connects===n||o.severs===n).map(([o])=>o)),t.say(`Each ${k(e,s)} has one of the ${b(e,i)} on it (${n}).`))}},status(e,t){for(let[s]of u(e))for(let{field:r,options:n,steps:d}of Z(e,s))t.add("kinds",s),t.add("fields",`${s}.${r}`),t.add("acts",...d),t.add("rules",...f(e,[r],[s])),t.add("lenses",...P(e,"columns",s,"column",r)),t.say(`${p(e,s)} move through ${j(n.map(g))}.`)},schedule(e,t){for(let[s,r]of u(e))for(let[n,d]of Object.entries(r.fields)){if(!x(d)||ce.test(n))continue;let i=P(e,"calendar",s,"start",n),o=oe.test(n);if(!o&&!de.test(n)&&i.length===0)continue;t.add("kinds",s),t.add("fields",`${s}.${n}`),t.add("lenses",...i),t.add("rules",...f(e,[n],[s])),t.add("acts",...m(e,s).filter(([,c])=>(c.writes??[]).includes(n)||c.sets?.[n]!==void 0).map(([c])=>c));let a=/date|day|when|time/i.test(n)?g($(n)):`date (${n})`;t.say(o?`${p(e,s)} are due by a date (${n}).`:`${p(e,s)} have ${ke(a)} ${a}${i.length>0?", on a calendar":""}.`)}},budget(e,t){let s=O(e).flatMap(([o,a])=>Object.entries(a.fields).filter(([c,h])=>(h.type==="number"||h.type==="integer")&&H.test(c)).map(([c])=>({kind:o,name:c})));if(s.length===0)return;let r=u(e).flatMap(([o,a])=>Object.entries(a.fields).filter(([c,h])=>be(c,h)&&!H.test(c)).map(([c])=>({kind:o,name:c})));if(r.length===0)return;let n=[...s,...r].map(o=>o.name);for(let o of[...s,...r])t.add("kinds",o.kind),t.add("fields",`${o.kind}.${o.name}`),t.add("acts",...m(e,o.kind).filter(([,a])=>(a.writes??[]).includes(o.name)||a.sets?.[o.name]!==void 0).map(([a])=>a));t.add("rules",...f(e,n).filter(o=>s.some(a=>N(e.rules[o].require??"").has(a.name))));let d=r[0],i=s.find(o=>o.kind===d.kind)??s[0];t.say(`${p(e,d.kind)}' ${g($(d.name))} against ${i.kind===d.kind?"each one's":`each ${k(e,i.kind)}'s`} ${g($(i.name))}.`)},places(e,t){for(let[s,r]of u(e)){Y(e,s)&&(t.add("kinds",s),t.add("lenses",...D(e,s,"columns")));for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);!i||!Y(e,i)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n],[s,i])),t.say(`${p(e,s)} are at ${b(e,i)} (${n}).`))}for(let[n,d]of Object.entries(r.fields))d.type!=="place"&&!(d.type==="string"&&pe.test(n))||(t.add("kinds",s),t.add("fields",`${s}.${n}`),t.say(`${p(e,s)} say where (${n}).`))}t.any()&&!t.said&&t.say(`${j([...t.kinds].map(s=>p(e,s)))} are places.`)},sources(e,t){for(let[s,r]of u(e)){for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);!i||!we(e,i)&&!/^cite/i.test(n)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n,i],[s,i])),t.add("acts",...m(e,s).filter(([,o])=>o.connects===n||o.severs===n).map(([o])=>o)),t.say(`${p(e,s)} cite ${b(e,i)} (${n}).`))}for(let[n,d]of Object.entries(r.fields))d.type!=="url"||!/^source/i.test(n)||(t.add("kinds",s),t.add("fields",`${s}.${n}`),t.add("rules",...f(e,[n],[s])),t.say(`${p(e,s)} link to their source (${n}).`))}},stock(e,t){for(let[s,r]of u(e)){let n=Object.entries(r.fields).filter(([a,c])=>(c.type==="number"||c.type==="integer")&&B.test(a)).map(([a])=>a),d=Object.keys(r.computed??{}).filter(a=>B.test(a)),i=n.some(a=>/reorder/i.test(a)),o=O(e).some(([,a])=>Object.entries(a.fields).some(([c,h])=>/^(change|delta|moved)$/i.test(c)&&(h.type==="number"||h.type==="integer")));!i&&!(d.length+n.length>0&&o)||(t.add("kinds",s),t.add("fields",...n.map(a=>`${s}.${a}`),...d.map(a=>`${s}.${a}`)),t.add("rules",...f(e,[...n,...d],[s])),t.add("acts",...m(e,s).filter(([,a])=>n.some(c=>(a.writes??[]).includes(c)||a.sets?.[c]!==void 0)).map(([a])=>a)),t.say(`${p(e,s)} have a count in stock${i?" and a reorder point":""}.`))}},votes(e,t){for(let[s,r]of u(e)){for(let[n,d]of Object.entries(r.fields)){if(d.type!=="number"&&d.type!=="integer"||!he.test(n))continue;let i=m(e,s).filter(([,o])=>o.sets?.[n]!==void 0).map(([o])=>o);i.length!==0&&(t.add("kinds",s),t.add("fields",`${s}.${n}`),t.add("acts",...i),t.add("rules",...f(e,[n],[s])),t.say(`${p(e,s)} collect votes (${n}).`))}for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);!i||!fe.test(n)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n],[s,i])),t.add("acts",...m(e,s).filter(([,o])=>o.connects===n||o.severs===n).map(([o])=>o)),t.say(`${p(e,s)} pick ${b(e,i)} (${n}).`))}}},private(e,t){let s=[];for(let r of e.policy?.sees??[])if(!(!r.own&&!r.via)){for(let n of r.kinds)if(e.kinds[n]&&(t.add("kinds",n),s.includes(n)||s.push(n),r.via))for(let[d,i]of O(e))i.edges?.[r.via]&&t.add("relations",`${d}.${r.via}`)}s.length>0&&t.say(`${j(s.map(r=>p(e,r)))} are seen only by whose they are.`)},history(e,t){for(let[s,r]of u(e))for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);d.cardinality!=="one"||!i||!$e(e,i)||!Object.entries(r.fields).some(([a,c])=>x(c)||/year|result|outcome|score|finish/i.test(a))||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n,i],[s,i])),t.add("lenses",...D(e,s,"rows",n),..._(e).filter(a=>a.name==="timeline"&&A(a)[s]!==void 0).map(I).filter(a=>a!==void 0)),t.say(`${p(e,s)} grouped into ${b(e,i)}, a record book.`))}},publishing(e,t){for(let[s,r]of u(e)){let n=Object.entries(r.fields).filter(([,i])=>i.type==="text").map(([i])=>i);if(n.length===0)continue;let d=Z(e,s).map(i=>i.field);for(let[i,o]of Object.entries(r.fields)){if(o.type!=="enum"||!(X.test(i)||d.includes(i))||!(o.options??[]).some(c=>Q.test(c)))continue;let a=(o.options??[]).find(c=>Q.test(c));t.add("kinds",s),t.add("fields",`${s}.${i}`,...n.map(c=>`${s}.${c}`)),t.add("acts",...m(e,s).filter(([,c])=>c.sets?.[i]===a).map(([c])=>c)),t.add("rules",...f(e,[i,...n],[s]).filter(c=>N(`${e.rules[c].when??""} ${e.rules[c].require??""}`).has(a)||n.some(h=>N(e.rules[c].require??"").has(h)))),t.say(`${p(e,s)} go from ${g(o.options[0])} to ${g(a)}, with their words.`)}}},roster(e,t){for(let[s,r]of u(e)){if(!V(e,s))continue;let n=Object.keys(r.fields);n.length<2||(t.add("kinds",s),t.add("fields",...n.map(d=>`${s}.${d}`)),t.add("lenses",...D(e,s,"columns"),...D(e,s,"rows")),t.say(`${p(e,s)}, with ${j(n.slice(1).map(d=>g($(d))))}.`))}},routines(e,t){for(let[s,r]of u(e)){let n=Object.entries(r.fields).filter(([,a])=>x(a)&&a.repeats===!0).map(([a])=>a),d=Object.entries(r.fields).filter(([a,c])=>(c.type==="enum"||c.type==="string"||c.type==="integer"||c.type==="number")&&ge.test(a)).map(([a])=>a),i=Object.entries(r.fields).filter(([a,c])=>x(c)&&ue.test(a)).map(([a])=>a);if(n.length===0&&!(d.length>0&&i.length>0))continue;let o=[...n,...d,...i];t.add("kinds",s),t.add("fields",...o.map(a=>`${s}.${a}`)),t.add("rules",...f(e,o,[s])),t.add("lenses",...o.flatMap(a=>P(e,"calendar",s,"start",a))),t.add("acts",...m(e,s).filter(([,a])=>o.some(c=>(a.writes??[]).includes(c)||a.sets?.[c]!==void 0)).map(([a])=>a)),t.say(n.length>0?`${p(e,s)} repeat (${n[0]}).`:`${p(e,s)} come round again, each with when it was last done.`)}},comparison(e,t){for(let[s,r]of Object.entries(e.rules??{})){if(!r.require||!ye.test(r.require))continue;let n=r.over==="graph"?void 0:r.over,d=/in\('([^']+)'\)/.exec(r.require)?.[1],i=/all\('([^']+)'/.exec(r.require)?.[1],o=n?d?O(e).find(([,c])=>c.edges?.[d])?.[0]:void 0:i&&e.kinds[i]?i:void 0;if(!o&&!n)continue;let a=/==\s*'([^']+)'/.exec(r.require)?.[1];t.add("kinds",...o?[o]:[],...n?[n]:[]),t.add("rules",s),o&&a&&t.add("acts",...m(e,o).filter(([,c])=>Object.values(c.sets??{}).includes(a)).map(([c])=>c)),t.say(o&&n?`${p(e,o)} compared within each ${k(e,n)}, one ${a??"chosen"}.`:o?`${p(e,o)} compared, one ${a??"chosen"}.`:`One ${a??"chosen"} per ${k(e,n)}.`)}}};function G(e){let t=[];for(let s of w){let r=new E;ee[s](e,r),r.any()&&t.push(r.asTrait(s))}return t}function L(e,t){let s=new E;return ee[t](e,s),s.any()}var ve=e=>Math.round(Math.max(0,Math.min(1,e))*100)/100;function q(e){return e?.type==="noul"&&Number.isFinite(e.noul)?ve(e.noul):void 0}var Re={add:.7,drop:.7},qe="propose_change";function Fe(e){return U(e)}var De=e=>e.toLowerCase(),Te=e=>e.charAt(0).toUpperCase()+e.slice(1),v=(e,t="and")=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} ${t} ${e[e.length-1]}`,Se=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase(),T=(e,t)=>{let s=e.kinds[t];return De(s?.plural??(s?.noun?`${s.noun}s`:`${Se(t)}s`))},je=e=>w.includes(e),se=(e,t)=>w.indexOf(e)-w.indexOf(t);function xe(e){let t=G(e),s=new Set(t.map(r=>r.trait));return{name:e.name,keeps:Object.keys(e.kinds).map(r=>T(e,r)),"made of":t.map(r=>r.said),lacks:w.filter(r=>!s.has(r)).map(r=>y[r])}}function Ne(e,t){let s=new Set(G(t).map(n=>n.trait)),r={};for(let n of w)s.has(n)||(r[`need:${n}`]={type:"noul",instructions:`Does what they asked for need ${y[n]}, which ${t.name} has no part for yet?`,criteria:{true:`It needs ${y[n]}: they asked for it, or what they asked for cannot be kept without it.`,false:"Not asked for, and not needed to keep what they asked for."}});for(let n of Object.keys(t.kinds)){let d=T(t,n);r[`drop:kind:${n}`]={type:"noul",instructions:`Did they ask ${t.name} to stop keeping ${d}?`,criteria:{true:`They said the ${d} go: to drop them, remove them or stop tracking them.`,false:`${Te(d)} stay: nothing they said asks for them to go.`}}}for(let n of w)s.has(n)&&(r[`drop:trait:${n}`]={type:"noul",instructions:`Did they ask ${t.name} to stop having ${y[n]}?`,criteria:{true:`They said it goes: to drop or stop ${y[n]}.`,false:"It stays: nothing they said asks for it to go."}});return{state:{said:e,app:xe(t)},questions:r}}var te=/^drop:(kind|trait):(.+)$/s;function Ae(e,t={}){let s={...Re,...t},r=Object.keys(e);if(r.length===0)throw new Error("readReshape was handed no answers.");let n=r.filter(o=>!/^need:/.test(o)&&!te.test(o));if(n.length>0)throw new Error(`readReshape does not know the question ${n.map(o=>`"${o}"`).join(", ")}: it reads need:<trait>, drop:kind:<name> and drop:trait:<name>.`);let d={},i={};for(let[o,a]of Object.entries(e)){let c=te.exec(o);if(c){i[`${c[1]}:${c[2]}`]=q(a)??0;continue}let h=o.slice(5);je(h)&&(d[h]=q(a)??0)}return{add:Object.keys(d).filter(o=>d[o]>=s.add).sort(se),drop:Object.entries(i).filter(([,o])=>o>=s.drop).map(([o])=>o.slice(o.indexOf(":")+1)),needs:d,drops:i}}function Ee(e){let{said:t,document:s}=e,r=[...new Set(e.add)].sort(se),n=[...new Set(e.drop)],d=G(s),i=r.filter(l=>!L(s,l)).map(l=>({what:"trait",name:l,words:y[l],brings:J[l]})),o=r.filter(l=>L(s,l)),a=Object.keys(s.kinds).filter(l=>n.includes(l)),c=d.filter(l=>n.includes(l.trait)&&!Object.hasOwn(s.kinds,l.trait)),h=[...a.map(l=>({what:"kind",name:l,words:T(s,l)})),...c.map(l=>({what:"trait",name:l.trait,words:y[l.trait]}))],C=Object.keys(s.kinds).filter(l=>!a.includes(l)).map(l=>({what:"kind",name:l,words:T(s,l)})),ne=[...a.map(l=>`All ${T(s,l)} records go, with their links.`),...c.flatMap(l=>{let F=[...l.fields,...l.relations];return F.length>0?[`What carries ${y[l.trait]} goes: ${v(F)}, with its values and links.`]:[]})],S=[];i.length>0&&S.push(`adds ${v(i.map(l=>l.words))}`),h.length>0&&S.push(`drops ${v(h.map(l=>l.words))}`),C.length>0&&S.push(`keeps ${v(C.map(l=>l.words))}`);let re=i.length+h.length===0?`Nothing in ${s.name} changes for that.`:`This ${v(S)}.`,ie=o.length>0?` ${s.name} already has ${v(o.map(l=>y[l]))}.`:"";return{said:t,add:i.map(l=>l.name),drop:h.map(l=>l.name),card:{said:`${re}${ie}`,adds:i,keeps:C,drops:h,breaking:ne}}}async function Ue(e){let{state:t,questions:s}=Ne(e.said,e.document),{answers:r,usage:n}=await e.decide(t,s),d=Ae(r,e.thresholds??{}),i=d.add.length+d.drop.length===0?null:Ee({said:e.said,document:e.document,add:d.add,drop:d.drop});return{proposal:i&&i.add.length+i.drop.length===0?null:i,reading:d,answers:r,usage:n}}export{qe as a,Fe as b,Ne as c,Ae as d,Ee as e,Ue as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as P,c as m,d as k}from"./chunk.
|
|
1
|
+
import{b as P,c as m,d as k}from"./chunk.FULEUL34.js";import{b as v,c as w,d as S,e as x,f as M}from"./chunk.B3WVCSW5.js";import"./chunk.L3WTKQQL.js";import"./chunk.QDWSU47A.js";import"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var O=new Set(["input","select","textarea"]),g=r=>r.namespaceURI==="http://www.w3.org/1999/xhtml"&&O.has(r.localName),N=r=>r.localName==="select"||r.type==="checkbox"||r.type==="radio",E=r=>r.type==="checkbox"||r.type==="radio"?!r.checked:r.localName!=="select"&&r.value==="";function h(r){return r.type==="checkbox"||r.type==="radio"?`checked:${r.checked}`:r.localName==="select"&&r.multiple?`selected:${[...r.selectedOptions].map(n=>n.value).join("\0")}`:`value:${r.value}`}function F(r=n=>n.isTrusted){let n=new WeakMap,d=new WeakSet,o=new WeakMap,i={heard(e,t){if(!(!g(t)||!r(e))&&(e.type==="input"||e.type==="change"&&N(t))&&((N(t)||E(t))&&d.delete(t),E(t)&&o.delete(t),n.set(t,h(t)),t.type==="radio"&&t.name)){let c=t.getRootNode();for(let u of c.querySelectorAll?.('input[type="radio"]')??[])u.name===t.name&&n.set(u,h(u))}},filled(e){n.delete(e),o.delete(e),g(e)&&!E(e)?d.add(e):d.delete(e)},press(e,t,c){if(!r(e))return;let u=t.closest("[data-act]");if(!u||!w(u))return;let l=e.type==="keydown"?e.key:void 0;if(!(e.type!=="click"&&!((l==="Enter"||l===" ")&&t===u&&!v(u))))return i.collect(u,c)},collect(e,t){if(!e.hasAttribute("data-act")||!t.contains(e))return;let c=e.closest("[data-record]"),u=e.closest("fieldset, [role='group']")??t,l=[];for(let a of u.querySelectorAll("input[name], select[name], textarea[name]")){let s=a,f=!d.has(s)&&n.get(s)===h(s);if(s.type==="radio"){if(!s.checked)continue;l.push({name:s.name,value:s.value,typed:f,empty:!1,chosen:!0});continue}if(s.localName==="select"){l.push({name:s.name,value:s.value,typed:f,empty:s.value===""&&!f,chosen:!0});continue}if(s.type==="checkbox"){l.push({name:s.name,value:s.checked,typed:f,empty:!s.checked&&!d.has(s)&&!f});continue}let R=(s.type==="number"||s.type==="range")&&s.value!==""&&Number.isFinite(s.valueAsNumber)?s.valueAsNumber:s.value,A=f?o.get(s):void 0;l.push({name:s.name,value:R,typed:f,empty:s.value===""&&!f,...A?{from:A}:{}})}return{as:e.getAttribute("data-act")??"",...c&&t.contains(c)?{record:c.getAttribute("data-record")}:{},fields:l}},prefilled(e,t){d.delete(e),o.set(e,t),n.set(e,h(e))}};return i}var b=new WeakMap,L=(r,n)=>{n.tab&&r.removeAttribute("tabindex"),n.role&&r.getAttribute("role")==="button"&&r.removeAttribute("role"),r.removeAttribute("data-graview-press"),b.delete(r)};function W(r){for(let n of r.querySelectorAll("[data-act], [data-graview-press], [role], [aria-pressed], [aria-expanded]")){let d=b.get(n),o=w(n)&&!v(n)&&!g(n),i=!o&&S(n,d?.role?null:n.getAttribute("role"));if(d&&(d.bound!==o||!(o||i))&&L(n,d),(o||i)&&!b.has(n)){let e=!x(n),t=o&&M(n);e&&n.setAttribute("tabindex","0"),t&&n.setAttribute("role","button"),n.setAttribute("data-graview-press",""),b.set(n,{tab:e,role:t,bound:o})}}}var y=new WeakSet;function V(r){for(let n of r.querySelectorAll("svg")){let d=n.hasAttribute("role")||n.hasAttribute("aria-label")||n.hasAttribute("aria-labelledby")||[...n.children].some(e=>e.localName==="title"),o=n.hasAttribute("tabindex")||n.hasAttribute("data-graview-link")||n.hasAttribute("data-graview-press")||n.querySelector("[tabindex], [data-graview-link], [data-graview-press], a")!==null,i=!d&&!o;i&&!y.has(n)&&!n.hasAttribute("aria-hidden")?(n.setAttribute("aria-hidden","true"),y.add(n)):!i&&y.has(n)&&(n.removeAttribute("aria-hidden"),y.delete(n))}}var j=1e3;function I(r){let n=r.getAttribute("data-debounce")?.trim(),d=n?Number(n):Number.NaN;return Number.isFinite(d)?Math.min(1e4,Math.max(250,Math.round(d))):j}function B(r){let n=r.trusted??(e=>e.isTrusted),d=r.timers??{set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)},o=new Map,i=(e,t)=>{let c=o.get(e);c&&d.clear(c.handle),o.delete(e);let u=r.reader.collect(e,t);u&&r.save(u,e)};return{heard(e,t,c){if(!g(t)||!n(e)||!t.hasAttribute("data-act"))return;let u=t.getAttribute("data-save");if(e.type==="input"&&u==="input"){let l=o.get(t);l&&d.clear(l.handle),o.set(t,{root:c,handle:d.set(()=>i(t,c),I(t))})}else e.type==="change"&&(u==="change"||u==="input"&&o.has(t))&&i(t,c)},flush(){for(let[e,{root:t}]of[...o])i(e,t)},get waiting(){return o.size}}}var H=new Set(["text","search","email","url","tel","number"]);function D(r,n,d,o){for(let i of r.querySelectorAll("input[data-prefill], textarea[data-prefill]")){let e=i;if(d.has(e))continue;let t=e.getAttribute("data-prefill")??"";if(t===""||e.getAttribute("name")!==t||e.localName==="input"&&!H.has(e.type))continue;if(e.value!==""){d.add(e);continue}let u=[...(e.closest("fieldset, [role='group']")??r).querySelectorAll("[data-act]")],l=e.closest("[data-record]"),a=new Set(u.map(p=>p.closest("[data-record]")?.getAttribute("data-record")).filter(p=>typeof p=="string")),s=l&&r.contains(l)?l.getAttribute("data-record"):a.size===1?[...a][0]:void 0;if(!s)continue;let f=o({record:s,field:t,acts:u.map(p=>p.getAttribute("data-act")??"")});if(f!==void 0){if(e.value=f,d.add(e),e.value!==f){e.value="";continue}n.prefilled(e,{record:s,field:t,value:f})}}}function _(r,n,d,o){let i=k(n,o.as);if(!i)return m("undeclared",`This view may not ask for \u201C${o.as}\u201D: its manifest does not name it.`);let e=r.allMutations().find(a=>a.name===i.act);if(!e)return m("unknown-act","There is no act by that name here.");let t={};if(o.record!==void 0){let a=i.record??e.subject?.arg;if(!a)return m("unbound",`\u201C${o.as}\u201D is not done to a record.`);if(!d.has(o.record))return m("unbound","That press is bound to a record this view was not shown.");t[a]=o.record}for(let[a,s]of Object.entries(i.constants??{})){if(a in t)return m("malformed",`\u201C${a}\u201D is both the bound record and a constant.`);t[a]=s}let c=e.input?.shape??{},u=new Set(Object.keys(c)),l=new Set;for(let a of o.fields)if(!(!u.has(a.name)||a.name in t)){if(l.has(a.name))return m("malformed",`Two fields here are called \u201C${a.name}\u201D.`);if(l.add(a.name),a.typed&&a.chosen){let s=P(c[a.name])?.find(f=>String(f)===String(a.value));if(s!==void 0)t[a.name]=s;else if(typeof a.value=="string"&&d.has(a.value))t[a.name]=a.value;else return m("untyped",`\u201C${a.name}\u201D was a choice among the view's own words, not one this app declares, so it was not sent.`)}else{if(a.typed&&a.from&&!(o.record===a.from.record&&a.name===a.from.field&&T(r,i,a.from.record,a.from.field)))return m("untyped",`\u201C${a.name}\u201D was filled in from a record for an act that writes it back there, not for this one, so it was not sent.`);if(a.typed&&a.from&&String(a.value)===a.from.value)t[a.name]=r.graph.getNode(a.from.record)?.[a.name]??a.value;else if(a.typed)t[a.name]=a.value;else if(!a.empty)return m("untyped",`\u201C${a.name}\u201D was filled in by the view, not typed by you, so it was not sent.`)}}return{ok:!0,name:i.act,args:t}}function T(r,n,d,o){let i=r.allMutations().find(u=>u.name===n.act),e=i?.subject;if(!i||!e||(n.record??e.arg)!==e.arg||o===e.arg||Object.hasOwn(n.constants??{},o)||!Object.hasOwn(i.input.shape??{},o)||Object.keys(i.writesOther??{}).length>0)return!1;let t=r.graph.getNode(d)?.kind,c=t===void 0?void 0:r.schema.tryDefinition(t);return!c||e.kinds!=="*"&&!e.kinds.includes(t)||!Object.hasOwn(c.fields.shape??{},o)?!1:i.writes?.includes(o)??!1}function C(r,n,d,o,i){if(!o.has(i.record))return;let e=r.seenBy(n).graph.getNode(i.record);if(!e||!i.acts.some(u=>{let l=k(d,u);if(!l||!T(r,l,i.record,i.field))return!1;let a=r.allMutations().find(s=>s.name===l.act).subject;return r.permits({name:l.act,args:{[a.arg]:i.record}},n).ok}))return;let c=e[i.field];return typeof c=="string"?c:typeof c=="number"&&Number.isFinite(c)?String(c):void 0}export{j as SAVE_DEBOUNCE_MS,F as createPressReader,B as createSaver,D as fillPrefills,_ as judgePress,W as markPresses,C as prefillOf,V as quietPictures,I as saveDebounceOf,T as writesBack};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as v,B as C,C as S,I as G,n as O}from"./chunk.AI34V6WV.js";import{G as I,ba as m,c as V,j as y,l as p,m as g,n as u,o as D,v as B,z as E}from"./chunk.M7RESZB6.js";import{Kd as P,Ld as k,Nd as R,Od as T,na as M}from"./chunk.DZZL5IDD.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as l}from"./chunk.H5S7OL2U.js";import{_d as i}from"./chunk.DZZL5IDD.js";function c(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function p(e,n={}){let[t="/",a=""]=e.split("#")[0].split("?"),r=new URLSearchParams(a);n.filter&&r.set("filter",n.filter);let s=r.toString(),o=n.section?c(n.section):"";return`${t}${s?`?${s}`:""}${o?`#${o}`:""}`}var m=e=>({as:e.slug,title:e.title,kind:e.kind,is:e.kind===null?e.slug===i?"home":"overview":e.address.startsWith("/places/")?"place":"list",...e.hidden?{hidden:!0}:{}});function d(e,n){let t=[];for(let a of e)a.kind!==null&&n.has(a.kind)||a.over?.some(r=>n.has(r))||t.some(r=>r.as===a.slug)||t.push(m(a));return t}function y(e,n,t={}){return d(l(e,n,t.pages?{pages:t.pages}:{}),t.kept??new Set)}export{c as a,p as b,y as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as l,N as p,U as k,W as y,c}from"./chunk.YP2QSPXU.js";import"./chunk.VIH5AX7S.js";import"./chunk.Q355UPFG.js";import{b as m}from"./chunk.VC3V7HLL.js";import"./chunk.ELTV44HU.js";import"./chunk.CY3ELWCM.js";import"./chunk.I77ZGIFE.js";import"./chunk.OWOOKLIU.js";import"./chunk.RD2X25XB.js";import"./chunk.KMV6PJFL.js";import"./chunk.SWMDFXUX.js";import"./chunk.A3ZC2JBO.js";import"./chunk.NAD7ZXYP.js";import"./chunk.2GEJNG2U.js";import"./chunk.4TX6VCBT.js";import"./chunk.TIALD6SC.js";import"./chunk.66P5IDTH.js";import"./chunk.UQQKDBIH.js";import"./chunk.AJSUHPBE.js";import"./chunk.LAYQ5PFS.js";import"./chunk.KDXU5DT3.js";import"./chunk.O2BHPYA4.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.SGCW2XRC.js";import"./chunk.ZN3PUM2I.js";import"./chunk.QIPASE42.js";import"./chunk.EVBCEEQ4.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import"./chunk.GZHZLJBF.js";import"./chunk.UKQUUPKE.js";import"./chunk.OJGHDWI6.js";import"./chunk.DDUCIUVW.js";import"./chunk.NUYA4BWI.js";import"./chunk.OKZT2QBM.js";import"./chunk.ACTXR2MI.js";import"./chunk.AI34V6WV.js";import"./chunk.G4ULQK64.js";import{G as S,H as s,I as d,T as f,ca as g}from"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import{b as n}from"./chunk.AJZBJBMO.js";var u=n(S(),1);var t=n(f(),1);function D({context:a}){let r=l(),h=g(),[w]=(0,u.useState)(()=>s(null)),o=d(h?.seatTalk??w),P=()=>{(window.history.state?.idx??0)>0?r(-1):r("/")};return(0,t.jsxs)(k,{context:a,"data-testid":"draft-page",children:[(0,t.jsx)(y,{context:a,...o.draft?{"data-testid":"draft-title"}:{},children:o.draft?o.draft.title:"Nothing drawn"}),o.draft?(0,t.jsx)(m,{page:!0,go:e=>r(e.address),onPick:e=>{let i=a.store.graph.getNode(e);i&&r(c(a.store.schema,i.kind,e))},onDiscard:P}):(0,t.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:["Ask for a way of seeing \u2014 \u201Ca board of tasks by status\u201D \u2014 and it is drawn here."," ",(0,t.jsx)(p,{to:"/",style:{color:"var(--graview-accent)"},children:"Home \u2192"})]})]})}export{D as DraftPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Te,c as Ue,d as He,e as ze,f as F,g as ye,i as Ze}from"./chunk.WKI5INH7.js";import{h as We,i as Je,j as Xe}from"./chunk.QIPASE42.js";import{a as re,b as ae,c as X,d as Ye,e as Q,g as se,h as Qe}from"./chunk.OWT3VVOT.js";import{c as Ve,h as y,i as Be,j as me,s as ge}from"./chunk.NHTGAP3G.js";import{A as pe,Ac as Ge,Bc as qe,Fa as Me,Ma as Ie,Na as oe,Oa as fe,b as H,c as U,cc as Ke,dc as ue,e as de,ec as Pe,f as Ne,fc as Le,g as K,gc as Ce,h as v,k as L,l as J,m as _,n as _e,o as Z,p as M,r as $,s as te,t as R,u as A,v as G,w as P,x as n,y as T,z as W}from"./chunk.DZZL5IDD.js";var he=e=>Object.entries(e).map(([o,s])=>[o,Object.keys(oe(s?.edges))]),ke=(e,o)=>Pe(e,he(o));function en(e){return[...Object.keys(e.acts??{}),...Object.keys(e.kinds).flatMap(o=>Ke(o)),...Le(he(e.kinds))]}var q=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function nn(e){if(!q(e)||!q(e.kinds))return e;let o;try{let f=Object.fromEntries(Object.entries(e.kinds).map(([z,c])=>[z,q(c)&&q(c.edges)?{edges:c.edges}:{}]));o=en({acts:q(e.acts)?e.acts:{},kinds:f})}catch{return e}let s=new Set(o),t=!1,r=f=>{if(typeof f!="string"||s.has(f))return f;let z=Ge(f,o);return z===void 0?f:(t=!0,z)},p=q(e.policy)&&Array.isArray(e.policy.grants)?{...e.policy,grants:e.policy.grants.map(f=>q(f)&&Array.isArray(f.mutations)?{...f,mutations:f.mutations.map(r)}:f)}:void 0,u=q(e.rules)?Object.fromEntries(Object.entries(e.rules).map(([f,z])=>[f,q(z)&&Array.isArray(z.repairs)?{...z,repairs:z.repairs.map(c=>q(c)?{...c,act:r(c.act)}:c)}:z])):void 0;return t?{...e,...p?{policy:p}:{},...u?{rules:u}:{}}:e}function be(e,o){let s=qe(e,en(o));return s&&s!==e?`did you mean "${s}"?`:void 0}var Se="graview-document",ve=1,Oe=256*1024,ee=64*1024,wn=["plain","editorial","shader","ascii"];var $e=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,we=/^[a-z][A-Za-z0-9]*$/,Sn=/^[a-z0-9\u00df-\u00ff'-]+( [a-z0-9\u00df-\u00ff'-]+){0,2}$/,tn=12,vn=new Set(["id","kind"]),On=/^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$/,jn=["string","text","number","integer","boolean","date","datetime","enum","list","url","email","image","video","file","app-link","phone","place","duration"];function xn(){let e=b=>b in Object.prototype,o=W(b=>!e(b),"every object already has this name \u2014 choose another"),s=(b,D)=>[...b===void 0?[]:[Ne(b)],...D===void 0?[]:[de(D)]],t=(b,D)=>v().check(...s(b,D)),r=(b,D,ne)=>M(b).check(...s(D,ne)),p=b=>v().check(K($e,`${b} names are kebab-case, lower-case words joined by hyphens like "tool-note" (field and relation names are camelCase, like "supersededBy")`)),u=v().check(K(On,'relation names are one camelCase word, like "supersededBy" (kind names are kebab-case, like "tool-note")'),o),f=v().check(K(we,'field names are one word or camelCase, like "dueDate", so rules say them bare (kind names are kebab-case, like "tool-note")'),W(b=>!vn.has(b),'a field cannot be called "id" or "kind" \u2014 the framework keeps those; try "type" or "category"'),o),z=t(1,500),c=v().check(de(40),K(Sn,'an alias is up to three lower-case words, like "supplier"')),i=t(1,2e3),l=t(1,300),h=$({type:G(jn),required:n(_()),description:n(z),label:n(t(1,60)),aliases:n(r(c,1,tn)),options:n(r(t(1,80),1,100)),multiple:n(_()),optionLabels:n(A(t(1,80),t(1,80))),of:n(G(["string","number","date","image","video","file"])),default:n(Z()),unit:n(t(void 0,12)),format:n(G(["money","percent","duration","markdown"])),min:n(L()),max:n(L()),step:n(L()),renamedFrom:n(v().check(K(we))),repeats:n(_()),collaborative:n(_())}).check(pe((b,D)=>{b.type==="enum"&&!b.options&&D.addIssue({code:"custom",message:'an enum field lists its "options"',path:["options"]}),b.type!=="enum"&&b.options&&D.addIssue({code:"custom",message:'"options" belongs only on an enum field',path:["options"]}),b.type!=="enum"&&b.multiple!==void 0&&D.addIssue({code:"custom",message:'"multiple" belongs only on an enum field: a choice that takes several of its options',path:["multiple"]});for(let ne of Object.keys(b.optionLabels??{}))b.options?.includes(ne)||D.addIssue({code:"custom",message:`"${ne}" is labeled, and is none of the field's options`,path:["optionLabels",ne]});b.type!=="list"&&b.of&&D.addIssue({code:"custom",message:'"of" belongs only on a list field',path:["of"]}),b.repeats&&b.type!=="date"&&b.type!=="datetime"&&D.addIssue({code:"custom",message:'"repeats" belongs only on a date or datetime field',path:["repeats"]})})),m=v().check(K(new RegExp(`${$e.source}|${Me.source}`),'a relation goes to a kind of this document, like "house", or of another app, like "@nick/house/house"')),d=$({to:R([r(m,1),P("*")]),cardinality:n(G(["one","many"])),description:n(z),inverse:n(t(1,80)),appendOnly:n(_()),renamedFrom:n(v()),tidying:n(P("never"))}),a=R([i,$({expr:i,label:n(t(1,60)),description:n(z),format:n(G(["money","percent","duration"])),unit:n(t(1,12)),hidden:n(_())})]),O=$({noun:n(t(1,40)),plural:n(t(1,40)),aliases:n(r(c,1,tn)),description:n(z),fields:A(f,h).check(W(b=>Object.keys(b).length>0,"a kind has at least one field")),label:n(l),describe:n(l),lifecycle:n($({field:f,retired:r(R([v(),L(),_()]),1)})),figure:n(t(void 0,2e4)),glance:n(r(f,1,20)),page:n($({fields:n(r(f,1,40)),groups:n(r($({title:t(1,60),fields:r(f,1,40)}),1,12))})),edges:n(A(u,d)),computed:n(A(v(),a).check(W(b=>Object.keys(b).length<=20,"a kind works out at most 20 computed fields"))),fieldRoles:n(A(v(),v())),renamedFrom:n(v().check(K($e))),people:n(_()),archives:n(P(!1)),tidying:n(G(["never","no-links"]))}),k=R([v(),L(),_(),_e(),M(Z()),$({expr:i})]),w=v().check(K(/^\$[A-Za-z][A-Za-z0-9]*$/,'a reference is "$" and a name, like "$subject" or "$new"')),j=R([$({create:p("kind"),as:n(v().check(K(we))),set:n(A(f,k))}),$({set:A(f,k),target:n(w)}),$({connect:u,from:w,to:w}),$({sever:u,from:w,to:w}),$({remove:w})]),E=$({title:n(t(1,80)),description:n(z),fromTheOtherEnd:n(t(1,80)),on:n(R([p("kind"),r(p("kind"),1)])),creates:n(p("kind")),sets:n(A(f,k)),writes:n(r(f,1)),connects:n(u),severs:n(u),setsOther:n(A(f,k)),setsLinked:n(A(u,A(f,k))),replaces:n(R([P(!0),r(u,1,10)])),removes:n(P(!0)),args:n(A(f,h)),effects:n(r(j,1,20)),allowedWhen:n(i),refusal:n(l),destructive:n(_())}),S=$({act:p("act"),label:n(t(1,80)),args:n(A(v(),k))}),V=$({every:p("kind"),through:u,via:n(u)}),C=$({title:n(t(1,120)),description:n(z),over:R([P("graph"),p("kind")]),when:n(i),require:n(i),covers:n(V),says:n(l),repairs:n(r(S,void 0,10))}).check(pe((b,D)=>{!b.require&&!b.covers&&D.addIssue({code:"custom",message:'a rule says what must hold in "require", or what each record must be linked to in "covers"',path:["require"]}),b.require&&b.covers&&D.addIssue({code:"custom",message:'a rule is judged by "require" or by "covers", not both',path:["covers"]}),b.covers&&b.over==="graph"&&D.addIssue({code:"custom",message:'a coverage rule is over a kind, whose records it follows through their links; name the kind in "over"',path:["over"]})})),g=$({roles:R([r(p("role"),1),P("*")]),mutations:R([r(p("act"),1),P("*")]),kinds:n(R([M(p("kind")),P("*")])),describe:n(z),self:n(_()),ownEnd:n(_())}),x=n(r(f,1)),N=$({roles:R([r(p("role"),1),P("*")]),kinds:r(p("kind"),1),own:n(_()),via:n(u),fields:x,hide:x}),ie=$({grants:M(g),sees:n(M(N))}),Y=$({accent:n(v().check(K(/^#[0-9a-fA-F]{6}$/,'an accent is a color like "#c2577a"'))),ground:n(R([v().check(K(/^#[0-9a-fA-F]{6}$/,'a ground is a color like "#eef3f8"')),$({light:n(v().check(K(/^#[0-9a-fA-F]{6}$/,'a ground is a color like "#eef3f8"'))),dark:n(v().check(K(/^#[0-9a-fA-F]{6}$/,'a ground is a color like "#101826"')))})])),name:n(t(1,60)),currency:n(v().check(K(/^[A-Z]{3}$/,'a currency is its three-letter code, like "USD" or "EUR"'))),locale:n(t(2,35)),timeZone:n(t(1,64)),logo:n(R([t(1,ee),$({src:t(1,ee),alt:n(t(1,120))}),$({light:t(1,ee),dark:n(t(1,ee)),alt:n(t(1,120)),darkFallback:n(P("invert"))})])),favicon:n(R([t(1,ee),$({emoji:v()})])),typography:n($({display:n(t(1,200)),body:n(t(1,200)),mono:n(t(1,200))})),shape:n($({radius:n(L().check(U(0),H(32))),density:n(L().check(U(.75),H(1.5)))})),accents:n(A(v(),L().check(U(0),H(360)))),scheme:n(G(["light","dark","auto"])),subtitle:n(P(!1)),splash:n($({style:G(wn),image:n(t(1,ee)),title:n(t(1,80)),kicker:n(t(1,80)),shader:n(t(1,40))})),views:n($({css:n(t(1)),motion:n(G(["none","fade"]))}))}),B=A(v(),Z()),Re=R([t(1,120),$({by:t(1,120),direction:n(G(["asc","desc"]))})]),Fe=L().check(J(),U(1),H(9999)),zn=te({create:n(_()),options:n(te({sort:n(Re),columnSort:n(Re),search:n(r(t(1,120),void 0,40)),filters:n(r(t(1,120),void 0,40)),horizon:n(R([L().check(J(),U(1),H(200)),te({years:L().check(J(),U(1),H(200)),title:t(1,80),from:n(Fe),to:n(Fe)})]))}))}),yn=$({card:n(M(Z())),row:n(M(Z())),page:n(M(Z()))}),hn=()=>{let b=n(G(["asc","desc"]));return R([t(1,120),$({by:t(1,120),direction:b,then:n(R([t(1,120),$({by:t(1,120),direction:b})]))})])},kn=()=>R([t(1,120),$({by:t(1,120),order:n(r(t(1,80),void 0,40)),closed:n(r(t(1,80),void 0,40))})]),De=te({order:n(M(v())),hide:n(M(v())),first:n(v()),primary:n(r(t(1,80),void 0,40)),scene:n(t(1,40)),pages:n(t(1,40)),lists:n(A(v(),$({filters:n(r(t(1,120),void 0,40)),sort:n(hn()),group:n(kn()),export:n(_())})))}),bn=$({act:p("act"),title:n(t(1,80)),intro:n(z),fields:n(r(f,1,40)),say:n(z),submit:n(t(1,80)),role:n(p("role"))}),$n=$({$schema:n(v()),format:P(Se),formatVersion:P(ve),name:t(1,80),description:n(z),version:n(L().check(J(),U(1))),kinds:A(p("kind"),O).check(W(b=>Object.keys(b).length>0,"a document declares at least one kind"),W(b=>Object.keys(b).length<=40,"a document declares at most 40 kinds")),computed:n(A(v(),a)),acts:n(A(p("act"),E)),rules:n(A(p("rule"),C)),roles:n(M(p("role"))),policy:n(ie),modules:n(B),lenses:n(M(zn)),pages:n(De),views:n(A(v(),R([yn,M(Z())]))),brand:n(Y),settings:n(M(B)),migrations:n(M(B)),connections:n(A(p("connection"),B)),purpose:n(B),forms:n(A(p("form"),bn)),publishing:n($({mode:G(["live","on-publish"]),working:r(p("role"),void 0,40),publishers:n(r(p("role"),1,40))})),tidying:n($({autoAcceptAt:n(L().check(J(),U(1),H(1e4)))}))});return{FieldSpec:h,EdgeSpec:d,ComputedSpec:a,KindSpec:O,ValueSpec:k,EffectSpec:j,ActSpec:E,RepairSpec:S,CoverSpec:V,RuleSpec:C,GrantSpec:g,SightSpec:N,PolicySpec:ie,BrandSpec:Y,PagesSpec:De,DocumentSpec:$n}}var An,I=()=>An??=xn(),Yn=T(()=>I().FieldSpec),Wn=T(()=>I().EdgeSpec),Jn=T(()=>I().ComputedSpec),Xn=T(()=>I().KindSpec),Qn=T(()=>I().ValueSpec),et=T(()=>I().EffectSpec),nt=T(()=>I().ActSpec),tt=T(()=>I().RepairSpec),ot=T(()=>I().CoverSpec),st=T(()=>I().RuleSpec),it=T(()=>I().GrantSpec),rt=T(()=>I().SightSpec),at=T(()=>I().PolicySpec),ct=T(()=>I().BrandSpec),lt=T(()=>I().PagesSpec),on=T(()=>I().DocumentSpec);var En={};function sn(e,o=En,s=ve){let{document:t,respelled:r}=Te(e),p=r.length>0?{respelled:r}:{};if(!t||typeof t!="object"||Array.isArray(t))return{document:t};let u=t;if(u.format!==Se||typeof u.formatVersion!="number"||u.formatVersion>=s)return{document:t,...p};let f=u.formatVersion,z=structuredClone(u);for(let c=f;c<s;c++){let i=o[c];if(!i)throw new Error(`there is no upgrade from format ${c} to ${c+1}`);z={...i(z),formatVersion:c+1}}return{document:z,from:f,...p}}function je(e,o,s){let t=Object.keys(e).filter(f=>e[f].edges?.[o]!==void 0);if(t.length===0)return;let r=t.map(f=>e[f].edges[o].to),p=r.some(f=>f==="*")?"*":[...new Set(r.flatMap(f=>f))];if(s.length===0||s.some(f=>t.includes(f)))return{reversed:!1,kinds:p};let u=t.filter(f=>{let z=e[f].edges[o].to;return z==="*"||s.every(c=>z.includes(c))});return u.length>0?{reversed:!0,kinds:u}:{reversed:!1,kinds:p}}var cn=(e,o)=>{let s=e?.fields[o];return s!==void 0&&(s.type==="duration"||(s.type==="number"||s.type==="integer")&&s.format==="duration")};function rn(e,o,s,t){if(t==="out"){let r=e[o]?.edges?.[s]?.to;return r===void 0?[]:r==="*"?Object.keys(e):r}return Object.entries(e).filter(([,r])=>{let p=r.edges?.[s]?.to;return p!==void 0&&(p==="*"||p.includes(o))}).map(([r])=>r)}function xe(e,o,s){if(s.t==="ident")return e[o]?.edges?.[s.name]?rn(e,o,s.name,"out"):void 0;if(s.t==="where")return xe(e,o,s.set);if(s.t==="call"&&(s.fn==="out"||s.fn==="in")&&s.args[0]?.t==="lit"&&typeof s.args[0].value=="string")return rn(e,o,s.args[0].value,s.fn)}var an=(e,o,s)=>{let t=o.filter(r=>e[r]?.fields[s]!==void 0);return t.length>0&&t.every(r=>cn(e[r],s))};function ln(e,o,s){let t=e.kinds,r=t[o],p=new Map(s),u=new Map,f=(c,i)=>{if(i>8)return!1;switch(c.t){case"ident":return cn(r,c.name)||z(c.name,i+1);case"member":{let l=xe(t,o,c.object);return l!==void 0&&an(t,l,c.name)}case"call":{if(c.fn!=="sum"&&c.fn!=="min"&&c.fn!=="max")return!1;let[l,h]=c.args,m=l&&xe(t,o,l);return m!==void 0&&h?.t==="ident"&&an(t,m,h.name)}case"binary":return(c.op==="+"||c.op==="-")&&f(c.left,i)&&f(c.right,i);case"unary":return c.op==="-"&&f(c.operand,i);default:return!1}},z=(c,i)=>{if(r?.computed?.[c]===void 0)return!1;if(u.has(c))return u.get(c);u.set(c,!1);let l=p.get(c),h=l!==void 0&&f(l,i);return u.set(c,h),h};return s.map(([c])=>c).filter(c=>z(c,0))}var Rn="several choices";var Fn={title:["string","text"],rich_text:["string","text"],number:["number","integer"],select:["enum","string"],status:["enum","string"],multi_select:["list",Rn],date:["date","datetime"],checkbox:["boolean"],url:["url","string"],email:["email","string"],phone_number:["phone","string"],people:["string","text","list"]};var dn=new Set(Object.values(Fn).flat());function pn(e,o){let s=new Map;if(!e||typeof e!="object")return new Map;for(let t of Object.values(e)){if(!t||typeof t!="object"||typeof t.kind!="string")continue;let r=o[t.kind]?.fields;if(!r)continue;let p=[];t.system==="google-calendar"&&t.fields&&typeof t.fields=="object"?p=Object.values(t.fields).filter(f=>typeof f=="string"):t.system==="notion"&&(p=t.properties&&typeof t.properties=="object"?Object.keys(t.properties):Object.keys(r).filter(f=>dn.has(r[f].type)));let u=s.get(t.kind)??new Set;for(let f of p)Object.hasOwn(r,f)&&u.add(f);s.set(t.kind,u)}return new Map([...s].filter(([,t])=>t.size>0).map(([t,r])=>[t,Object.keys(o[t].fields).filter(p=>r.has(p))]))}function fn(e,o,s=`kinds.${e}.page`){let t=o.page;if(!t)return[];let r=[],p=[...Object.keys(o.fields),...Object.keys(o.computed??{})],u=new Set,f=(c,i)=>{p.includes(c)?u.has(c)&&r.push(y("page-field-twice",i,`"${c}" is on ${e}'s page twice; name each field once`)):r.push(y("page-field",i,`${e}'s page is to show "${c}", and ${e} has no field or computed field called that`,`use one of: ${p.join(", ")}`)),u.add(c)};(t.fields??[]).forEach((c,i)=>f(c,`${s}.fields.${i}`));let z=new Set;return(t.groups??[]).forEach((c,i)=>{let l=c.title.trim().toLowerCase();z.has(l)&&r.push(y("page-group-twice",`${s}.groups.${i}.title`,`${e}'s page has two groups called "${c.title}"; give each its own title`)),z.add(l),c.fields.forEach((h,m)=>f(h,`${s}.groups.${i}.fields.${m}`))}),r}function un(e,o=[]){return Ce({declared:Object.keys(e.fields),paged:[...e.page?.fields??[],...(e.page?.groups??[]).flatMap(s=>s.fields)],must:s=>!!e.fields[s].required&&e.fields[s].default===void 0,naming:o})}var Dn=new Set(["subject","now","today","me"]);function Tn(e){if((typeof e=="string"?e:JSON.stringify(e??null)).length>Oe)return{findings:[y("too-large","",`a document may be at most ${Oe/1024} KB`)]};if(typeof e=="string")try{e=JSON.parse(e)}catch(t){return{findings:[y("not-json","",`this is not JSON: ${t.message}`)]}}try{e=sn(e).document}catch(t){return{findings:[y("format","formatVersion",t.message)]}}e=nn(e);let o=on.safeParse(e);if(!o.success)return{findings:o.error.issues.map(t=>{let r=t.path.map(String).join(".");if(t.code==="unrecognized_keys")return y("unknown-key",r,`${t.keys.map(p=>`"${p}"`).join(", ")} ${t.keys.length===1?"is":"are"} not part of a Graview document here`,"check the spelling against docs/declaration-document.md");if(t.code==="invalid_union"&&/\.effects\.\d+$/.test(r))return y("effect-shape",r,"this effect is not one Graview knows",'an effect is one of {"create": kind, "as"?: name, "set"?: {field: value}}, {"set": {field: value, \u2026}, "target"?: "$ref"}, {"connect"|"sever": relation, "from": "$ref", "to": "$ref"}, {"remove": "$ref"}');if(t.code==="invalid_key"){let p=t.issues?.[0]?.message;return y("shape",r,`the name "${String(t.path.at(-1))}" is not allowed here${p?`: ${p}`:""}`)}return y("shape",r,t.message)})};let s=o.data;return{document:s,findings:Nn(s)}}var le=e=>[e??[]].flat();function mn(e){let o=new Map;for(let[s,t]of Object.entries(e.kinds))for(let[r,p]of Object.entries(oe(t.edges))){let u=o.get(r);o.set(r,{name:r,from:[...u?.from??[],s],to:p.to==="*"||u?.to==="*"?"*":[...new Set([...u?.to??[],...p.to])],cardinality:p.cardinality??"many"})}return o}function Vt(e){let o=new Map;for(let[t,r]of Object.entries(e.kinds)){let p=se(r),u=fe(r.edges);o.set(t,{fields:new Set([...Object.keys(r.fields),...u.keys()]),edges:new Map(Object.entries(oe(r.edges)).map(([f,z])=>[f,z.cardinality??"many"])),...p?{computed:p}:{},...u.size>0?{linked:u}:{}})}let s=se(e);return s&&o.set(Ve,{computed:s}),o}function gn(e,o){let s=[],t=le(e.on),r=(p,u)=>{let f=je(o.kinds,p,t)?.reversed===!0,[z,c]=f?["$to","$subject"]:["$subject","$to"];return u==="connect"?{connect:p,from:z,to:c}:{sever:p,from:z,to:c}};if(e.creates){let p=o.kinds[e.creates],u={};for(let f of Object.keys(p?.fields??{}))u[f]=`$${f}`;for(let f of e.effects??[])"set"in f&&!("create"in f)&&F(f.target)==="new"&&Object.assign(u,f.set);s.push({create:e.creates,as:"new",set:u})}if(e.sets&&s.push({set:e.sets}),e.writes&&!(e.creates&&e.on===void 0)&&s.push({set:Object.fromEntries(e.writes.map(p=>[p,`$${p}`]))}),e.connects&&(e.replaces&&s.push({replace:e.replaces===!0?[e.connects]:[...e.replaces],keep:e.connects}),s.push(r(e.connects,"connect"))),e.severs&&s.push(r(e.severs,"sever")),e.setsOther&&(e.connects||e.severs)&&s.push({set:e.setsOther,target:"$to"}),e.setsLinked&&t.length>0)for(let[p,u]of Object.entries(e.setsLinked))s.push({set:u,through:p});return e.removes&&s.push({remove:"$subject"}),e.effects&&s.push(...e.effects.filter(p=>!(e.creates&&"set"in p&&!("create"in p)&&F(p.target)==="new"))),s}function Ae(e,o,s){try{let t=X(e),r=re(t);for(let p of r.unknownFunctions)s.push(y("unknown-function",o,`"${p}" is not a function the rule language knows`,"see the rule language in the graview-invariant skill"));return t}catch(t){if(t instanceof ae){s.push(y("expression",o,t.sentence+` (at character ${t.at+1})`));return}throw t}}function Ee(e,o,s){try{return Q(e)}catch(t){if(t instanceof Ye||t instanceof ae){s.push(y("template",o,(t instanceof ae,t.sentence)));return}throw t}}function Nn(e){let o=[],s=new Set(Object.keys(e.kinds)),t=mn(e),r=e.acts??{},p=new Set(e.roles??[]),u=(c,i)=>fe(e.kinds[c]?.edges).has(i),f=c=>Object.keys(e.kinds).some(i=>u(i,c));for(let[c,i]of Object.entries(e.kinds)){let l=`kinds.${c}`;for(let[m,d]of Object.entries(i.edges??{})){if(!Ie(d)&&d.to!=="*")for(let a of d.to)s.has(a)||o.push(y("edge-target",`${l}.edges.${m}.to`,`"${a}" is not a kind this document declares`));i.fields[m]&&o.push(y("edge-field-clash",`${l}.edges.${m}`,`"${m}" is both a field and a relation of ${c}`,"rename one of them"))}i.lifecycle&&!i.fields[i.lifecycle.field]&&o.push(y("lifecycle-field",`${l}.lifecycle.field`,`${c} has no field "${i.lifecycle.field}"`));let h=m=>i.computed!==void 0&&Object.hasOwn(i.computed,m);for(let m of i.glance??[])!i.fields[m]&&!h(m)&&o.push(y("glance-field",`${l}.glance`,`a glance at ${c} is to say "${m}", and ${c} has no field or computed field called that`,`use one of: ${[...Object.keys(i.fields),...Object.keys(i.computed??{})].join(", ")}`));o.push(...fn(c,i));for(let m of["label","describe"]){let d=i[m];if(!d)continue;let a=Ee(d,`${l}.${m}`,o);for(let O of a??[])if(O.expr){for(let k of re(O.expr).names)if(!i.fields[k]){if(h(k)){Qe(i,k)||o.push(y("template-field",`${l}.${m}`,`${c}'s ${k} is worked out from beyond the record, and a ${m} is said with no graph to read`,`show it in a view instead, or name a computed field worked out from ${c}'s own fields`));continue}o.push(y("template-field",`${l}.${m}`,`${c} has no field "${k}" for its ${m} to show`,m==="label"?"a label can only show the record's own fields and what they work out":void 0))}}}for(let[m,d]of Object.entries(i.fields)){if(d.default!==void 0&&d.type==="enum"){let k=(d.multiple?Array.isArray(d.default)?d.default:[d.default]:[d.default]).find(w=>!d.options?.includes(String(w)));(k!==void 0||!d.multiple&&Array.isArray(d.default))&&o.push(y("default-option",`${l}.fields.${m}.default`,`"${String(k??d.default)}" is not one of ${m}'s options`))}let a=`${m}Repeat`;d.repeats&&(i.fields[a]||i.edges?.[a]||i.computed?.[a])&&o.push(y("repeat-clash",`${l}.fields.${m}.repeats`,`${c} already has "${a}", where how ${m} repeats is kept`))}}for(let[c,i]of Object.entries(r)){let l=`acts.${c}`;for(let a of le(i.on))s.has(a)||o.push(y("act-kind",`${l}.on`,`"${a}" is not a kind this document declares`));let h=le(i.on),m=gn(i,e);if(i.creates&&i.on===void 0&&i.writes&&s.has(i.creates)){for(let a of i.writes)if(!e.kinds[i.creates].fields[a])if(e.kinds[i.creates].computed?.[a]!==void 0)o.push(y("computed-written",`${l}.writes`,`${i.creates}'s ${a} is worked out, not written: no act can set it`,"write the stored fields it is worked out from"));else{if(u(i.creates,a))continue;o.push(y("act-field",`${l}.writes`,`${i.creates} has no field "${a}"`))}}m.length===0&&o.push(y("act-empty",l,`"${c}" does nothing`,"give it effects or a shorthand such as sets or creates"));let d=new Map;m.forEach((a,O)=>{let k=m.length-(i.effects?.length??0),w=i.effects&&O>=k?`${l}.effects.${O-k}`:l;if("create"in a){if(!s.has(a.create))o.push(y("act-kind",`${w}.create`,`"${a.create}" is not a kind this document declares`));else for(let S of Object.keys(a.set??{}))e.kinds[a.create].fields[S]||(e.kinds[a.create].computed?.[S]!==void 0?o.push(y("computed-written",`${w}.set.${S}`,`${a.create}'s ${S} is worked out, not written: no act can set it`,"set the stored fields it is worked out from")):o.push(y("act-field",`${w}.set.${S}`,`${a.create} has no field "${S}"`)));a.as&&d.set(a.as,a.create)}else if("connect"in a||"sever"in a){let S="connect"in a?a.connect:a.sever;!t.has(S)&&!f(S)&&o.push(y("act-edge",`${w}.${"connect"in a?"connect":"sever"}`,`"${S}" is not a relation any kind declares`)),F(a.from)==="subject"&&h.length===0&&o.push(y("act-subject",`${l}.on`,`"${c}" acts on "$subject" but does not say which kinds it is "on"`))}else if(!("through"in a))if("set"in a){let S=F(a.target??"$subject"),V=S==="subject"?h:d.has(S??"")?[d.get(S)]:[];S==="subject"&&h.length===0&&o.push(y("act-subject",`${l}.on`,`"${c}" changes "$subject" but does not say which kinds it is "on"`));for(let C of Object.keys(a.set))for(let g of V)if(!(!s.has(g)||e.kinds[g].fields[C]))if(e.kinds[g].computed?.[C]!==void 0)o.push(y("computed-written",`${w}.set.${C}`,`${g}'s ${C} is worked out, not written: no act can set it`,"set the stored fields it is worked out from"));else{if(u(g,C))continue;o.push(y("act-field",`${w}.set.${C}`,`${g} has no field "${C}"`))}}else"remove"in a&&F(a.remove)==="subject"&&h.length===0&&o.push(y("act-subject",`${l}.on`,`"${c}" removes "$subject" but does not say which kinds it is "on"`));let j="set"in a&&a.set?Object.values(a.set):[],E="through"in a?`${l}.setsLinked.${a.through}`:`${w}.set`;j.forEach(S=>{S&&typeof S=="object"&&!Array.isArray(S)&&"expr"in S&&Ae(S.expr,E,o)})}),i.allowedWhen&&Ae(i.allowedWhen,`${l}.allowedWhen`,o),i.refusal&&Ee(i.refusal,`${l}.refusal`,o)}for(let[c,i]of Object.entries(e.rules??{})){let l=`rules.${c}`;i.over!=="graph"&&!s.has(i.over)&&o.push(y("rule-kind",`${l}.over`,`"${i.over}" is not a kind this document declares`));let h=i.over==="graph"?void 0:e.kinds[i.over];if(i.covers&&h){let m=ge(i.over,i.covers,d=>t.get(d),d=>s.has(d));if("problem"in m){let{key:d,message:a,fix:O}=m.problem;d==="every"?o.push(y("rule-kind",`${l}.covers.every`,a,O)):o.push(y("rule-covers-relation",`${l}.covers.${d}`,a,O))}}for(let m of["when","require"]){let d=i[m];if(!d)continue;let a=Ae(d,`${l}.${m}`,o);if(!a)continue;let O=re(a);for(let k of O.names)if(i.over==="graph")o.push(y("rule-name",`${l}.${m}`,`"${k}" means nothing in a rule over the whole graph`,`name a kind in "over", or use all('kind')`));else if(h&&!h.fields[k]&&!h.edges?.[k]&&h.computed?.[k]===void 0){let w=Object.keys(h.edges??{}).find(j=>j.includes("-")&&j.split("-").includes(k));o.push(y("rule-name",`${l}.${m}`,`${i.over} has no field or relation called "${k}"`,w?`"${w}" reads as a subtraction in a rule; rename the relation to one camelCase word, like "${w.replace(/-([a-z0-9])/g,(j,E)=>E.toUpperCase())}"`:void 0))}for(let k of O.edges)!t.has(k)&&!f(k)&&o.push(y("rule-edge",`${l}.${m}`,`"${k}" is not a relation any kind declares`));for(let k of O.sweeps)s.has(k)?i.over!=="graph"&&o.push(Be("rule-cost",`${l}.${m}`,`this rule looks at every ${k} for every ${i.over}, which grows slowly as the app grows`,"walk a relation with out()/in() instead of all() where you can")):o.push(y("rule-kind",`${l}.${m}`,`"${k}" is not a kind this document declares`))}i.says&&Ee(i.says,`${l}.says`,o),(i.repairs??[]).forEach((m,d)=>{!r[m.act]&&!ue(m.act)&&!ke(m.act,e.kinds)&&o.push(y("repair-act",`${l}.repairs.${d}.act`,`"${m.act}" is not an act this document declares`,be(m.act,e)))})}let z=e.policy;return z&&(z.grants.forEach((c,i)=>{if(c.roles!=="*"&&p.size>0)for(let l of c.roles)p.has(l)||o.push(y("grant-role",`policy.grants.${i}.roles`,`"${l}" is not one of the document's roles`));if(c.mutations!=="*")for(let l of c.mutations)!r[l]&&!ue(l)&&!ke(l,e.kinds)&&o.push(y("grant-act",`policy.grants.${i}.mutations`,`"${l}" is not an act this document declares`,be(l,e)))}),(z.sees??[]).forEach((c,i)=>{for(let l of c.kinds)s.has(l)||o.push(y("sight-kind",`policy.sees.${i}.kinds`,`"${l}" is not a kind this document declares`));if(c.roles!=="*"&&p.size>0)for(let l of c.roles)p.has(l)||o.push(y("sight-role",`policy.sees.${i}.roles`,`"${l}" is not one of the document's roles`))})),o.push(...Xe(e)),o}function _n(e){return e.label?[...e.label.matchAll(/\{\s*([A-Za-z_][A-Za-z0-9_]*)/g)].map(o=>o[1]):[ye(e)??[]].flat()}function Mn(e,o,s,t){let r=new Map,p=le(e.on),u=new Map,f=new Map;(p.length>0||o.some(d=>"remove"in d&&F(d.remove)==="subject"||"from"in d&&(F(d.from)==="subject"||F(d.to)==="subject")||"set"in d&&!("create"in d)&&!("through"in d)&&F(d.target??"$subject")==="subject"||"through"in d))&&r.set(ze,{ref:p.length>0?p:"*",required:!0});let c=e.args??{},i=e.writes?.length===1,l=(d,a)=>a&&d.type===a.type&&d.min===void 0&&d.max===void 0&&d.step===void 0?{...d,...a.min===void 0?{}:{min:a.min},...a.max===void 0?{}:{max:a.max},...a.step===void 0?{}:{step:a.step}}:d,h=(d,a)=>a&&d.type===a.type&&d.format===void 0&&d.unit===void 0?{...l(d,a),...a.format?{format:a.format}:{},...a.unit?{unit:a.unit}:{}}:l(d,a),m=(d,a,O)=>{if(d===ze||Dn.has(d)||u.has(d)||r.has(d))return;let k=c[d]?h(c[d],O):void 0;r.set(d,k?{field:k,optional:!k.required,required:!!k.required}:a())};for(let d of o)if("create"in d){let a=s.kinds[d.create],O=a?un(a,_n(a)):[],k=w=>O.includes(w)?O.indexOf(w):O.length;for(let[w,j]of Object.entries(d.set??{}).sort(([E],[S])=>k(E)-k(S))){let E=F(j),S=a?.fields[w];if(E&&S){let V=!!S.required&&S.default===void 0;m(E,()=>({field:S,optional:!V,required:V}),S)}}d.as&&u.set(d.as,d.create)}else if("connect"in d||"sever"in d){let a=t.get("connect"in d?d.connect:d.sever);for(let[O,k]of[["from",d.from],["to",d.to]]){let w=F(k);if(!w)continue;let j=O==="to"?a?.to??"*":a?.from??"*";j!=="*"&&!f.has(w)&&f.set(w,j),m(w,()=>({ref:j,required:!0}))}}else if("through"in d){let a=je(s.kinds,d.through,p),O=a&&a.kinds!=="*"?a.kinds[0]:void 0;for(let[k,w]of Object.entries(d.set)){let j=F(w);if(!j||j==="to")continue;let E=O?s.kinds[O]?.fields[k]:void 0;m(j,()=>E?{field:E,optional:!0,required:!1}:{any:!0,required:!1},E)}}else if("set"in d){let a=F(d.target??"$subject"),O=a==="subject"?p[0]:u.get(a??"")??f.get(a??"")?.[0];a&&a!=="subject"&&!u.has(a)&&m(a,()=>({ref:"*",required:!0}));for(let[k,w]of Object.entries(d.set)){let j=F(w);if(!j)continue;let E=O?s.kinds[O]?.fields[k]:void 0;m(j,()=>E?{field:E,optional:!i,required:i}:{any:!0,required:!1},E)}}else if("remove"in d){let a=F(d.remove);a&&m(a,()=>({ref:"*",required:!0}))}for(let[d,a]of Object.entries(c))r.has(d)||r.set(d,{field:a,optional:!a.required,required:!!a.required});return r}function Bt(e,o={}){let s=Tn(e);if(!s.document||me(s.findings))return{ok:!1,findings:s.findings};let t=s.document,r=[...s.findings];o.previous&&r.push(...Kn(t,o.previous));let p=In(t,r);return me(p.findings)?{ok:!1,findings:p.findings}:Ze(p,o)}function ce(e,o){return e.map(s=>{let t=!s.format&&s.expr?.t==="ident"?o?.[s.expr.name]?.format:void 0;return t==="money"||t==="percent"?{...s,format:t}:s})}function In(e,o){let s=mn(e),t={},r=pn(e.connections,e.kinds);for(let[i,l]of Object.entries(e.kinds)){let h=ye(l),m=l.label??(h?`{${h}}`:void 0),d=se(l),a=d?ln(e,i,[...d]):[];t[i]={...m?{label:ce(Q(m),l.fields)}:{},...l.describe?{describe:ce(Q(l.describe),l.fields)}:{},...d?{computed:[...d]}:{},...a.length>0?{durations:a}:{},...r.has(i)?{keptInStep:r.get(i)}:{}}}let p={};for(let[i,l]of Object.entries(e.acts??{})){let h=gn(l,e),m=Mn(l,h,e,s),d=l.destructive??h.some(g=>"remove"in g||"sever"in g||"replace"in g),a=[...new Set(h.flatMap(g=>"create"in g?[g.create]:[]))],O=[...new Set(h.flatMap(g=>"connect"in g?[g.connect]:[]))],k=[...new Set(h.flatMap(g=>"sever"in g?[g.sever]:"replace"in g?g.replace:[]))],w=[...new Set(h.flatMap(g=>"set"in g&&!("create"in g)&&!("through"in g)&&F(g.target??"$subject")==="subject"?Object.keys(g.set):[]))],j=new Map;for(let g of h){if(!("connect"in g)&&!("sever"in g))continue;let x=s.get("connect"in g?g.connect:g.sever);for(let[N,ie]of[["from",g.from],["to",g.to]]){let Y=F(ie),B=N==="to"?x?.to:x?.from;Y&&Y!=="subject"&&B&&B!=="*"&&j.set(Y,[...new Set([...j.get(Y)??[],...B])])}}let E={};for(let g of h){if(!("set"in g)||"create"in g||"through"in g)continue;let x=F(g.target??"$subject");for(let N of x&&x!=="subject"&&j.get(x)||[])E[N]=[...new Set([...E[N]??[],...Object.keys(g.set)])]}let S={};for(let g of h)if(!(!("set"in g)||"create"in g||"through"in g||F(g.target??"$subject")!=="subject"))for(let[x,N]of Object.entries(g.set??{}))typeof N=="string"&&F(N)===void 0||typeof N=="number"||typeof N=="boolean"?S[x]=typeof N=="string"&&N.startsWith("$$")?N.slice(1):N:delete S[x];let V=a.length===0&&h.every(g=>!("set"in g)||!g.set||Object.values(g.set).every(x=>!(x&&typeof x=="object"&&!Array.isArray(x)&&"expr"in x))),C=new Map;for(let g of h)if(!(!("set"in g)||!g.set))for(let x of Object.values(g.set))x&&typeof x=="object"&&!Array.isArray(x)&&"expr"in x&&C.set(x.expr,X(x.expr));p[i]={title:l.title??i.replace(/-/g," "),effects:h,args:[...m],...l.allowedWhen?{guard:X(l.allowedWhen)}:{},...l.refusal?{refusal:ce(Q(l.refusal),e.kinds[[l.on??[]].flat()[0]??""]?.fields)}:{},exprs:[...C],destructive:d,idempotent:V,creates:a,connects:O,severs:k,writes:w,writesOther:E,sets:S}}let u={};for(let[i,l]of Object.entries(e.rules??{})){let h=l.covers&&l.over!=="graph"?ge(l.over,l.covers,m=>s.get(m),m=>m in e.kinds):void 0;u[i]={title:l.title??i.replace(/-/g," "),...l.require?{require:X(l.require)}:{},...h&&"plan"in h?{covers:h.plan}:{},...l.when?{when:X(l.when)}:{},...l.says?{says:ce(Q(l.says),e.kinds[l.over]?.fields)}:{}}}let f=Ue(e,o),z=We(e),c=Je(e);return{format:He,document:e,findings:o,kinds:t,...e.computed?{facts:[...se(e)??[]]}:{},edges:[...s].map(([i,{from:l,to:h,cardinality:m}])=>[i,{from:l,to:h,cardinality:m}]),acts:p,rules:u,brand:f,...Object.keys(z).length>0?{viewSpecs:z}:{},...c?{home:c}:{}}}function Ut(e,o,s){let t=/^defineNode\("([^"]+)"\)/.exec(o)?.[1],r=t?s.kinds[t]:void 0;if(!t||!r)return e;let p=Object.keys(r.fields).filter(u=>u!=="label").slice(0,3);return{...e,path:`kinds.${t}.glance`,fix:`Say which: "glance": [${p.map(u=>`"${u}"`).join(", ")}] on kinds.${t} \u2014 the facts a person compares one by, at a glance.`}}function Kn(e,o){let s=[],t=new Set(Object.values(o.kinds).flatMap(r=>Object.keys(r.edges??{})));for(let[r,p]of Object.entries(e.kinds)){let u=p.renamedFrom;u&&!o.kinds[u]&&s.push(y("renamed-from-nothing",`kinds.${r}.renamedFrom`,`${r} says it was ${u}, and the previous version has no kind called ${u}`,"name the kind it was, or drop renamedFrom"));let f=o.kinds[u??r];for(let[z,c]of Object.entries(p.fields)){let i=c.renamedFrom;i&&!f?.fields[i]&&s.push(y("renamed-from-nothing",`kinds.${r}.fields.${z}.renamedFrom`,`${z} says it was ${i}, and the previous ${u??r} has no field called ${i}`,"name the field it was, or drop renamedFrom"))}for(let[z,c]of Object.entries(p.edges??{})){let i=c.renamedFrom;i&&!t.has(i)&&s.push(y("renamed-from-nothing",`kinds.${r}.edges.${z}.renamedFrom`,`${z} says it was ${i}, and the previous version has no relation called ${i}`,"name the relation it was, or drop renamedFrom"))}}return s}export{Tn as a,Vt as b,gn as c,Bt as d,Ut as e};
|