graview 0.1.70 → 0.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/chunk.2IOJNFCR.js +1 -0
- package/dist/preview/{chunk.I7CSRZC2.js → chunk.2Q4ZXP7P.js} +1 -1
- package/dist/preview/{chunk.O2XPLDMM.js → chunk.2TTKQAWQ.js} +1 -1
- package/dist/preview/chunk.2YSE3SQN.js +23 -0
- package/dist/preview/{chunk.NZFO6BM3.js → chunk.2ZPR6FRI.js} +1 -1
- package/dist/preview/chunk.3BE4SHZD.js +1 -0
- package/dist/preview/{chunk.QODVFVWE.js → chunk.43HWCHBN.js} +1 -1
- package/dist/preview/{chunk.QILGAV7H.js → chunk.45OLF6BK.js} +1 -1
- package/dist/preview/{chunk.NTAC5NNE.js → chunk.47QWCVZD.js} +1 -1
- package/dist/preview/{chunk.7HNMG6LG.js → chunk.4A7BRBEA.js} +1 -1
- package/dist/preview/chunk.4EPCI6VY.js +1 -0
- package/dist/preview/{chunk.OXXZGPJZ.js → chunk.4PB5UFUJ.js} +1 -1
- package/dist/preview/{chunk.SWY6DIE4.js → chunk.4TDYDIIM.js} +3 -3
- package/dist/preview/{chunk.6VG2LCES.js → chunk.4VX7GPFS.js} +1 -1
- package/dist/preview/{chunk.TUVPQLFL.js → chunk.523X2YEQ.js} +1 -1
- package/dist/preview/{chunk.CHG522KL.js → chunk.53GQQETN.js} +1 -1
- package/dist/preview/{chunk.NBB5ALVJ.js → chunk.5MKZTHU2.js} +1 -1
- package/dist/preview/chunk.5OS4SYHE.js +1 -0
- package/dist/preview/{chunk.ZTHZHBVN.js → chunk.5ZT4R227.js} +1 -1
- package/dist/preview/{chunk.RIP2SAQ5.js → chunk.65SI77M7.js} +1 -1
- package/dist/preview/chunk.6ESAFTWB.js +1 -0
- package/dist/preview/chunk.6GUIFP2A.js +1 -0
- package/dist/preview/{chunk.M3HLZX6Q.js → chunk.6GZYKHEN.js} +1 -1
- package/dist/preview/{chunk.UVMHC6VM.js → chunk.6YKKZI4H.js} +1 -1
- package/dist/preview/{chunk.BBLA4PSP.js → chunk.73RMM4W7.js} +1 -1
- package/dist/preview/chunk.7DCBIMOI.js +1 -0
- package/dist/preview/chunk.7JE3J7H4.js +1 -0
- package/dist/preview/{chunk.YTRUZ56A.js → chunk.7QGDWAHH.js} +1 -1
- package/dist/preview/{chunk.JEQ6CA5M.js → chunk.7VCYVCYM.js} +2 -2
- package/dist/preview/{chunk.X7HMTN3Z.js → chunk.A4TBVXHQ.js} +1 -1
- package/dist/preview/{chunk.J4NY2K2A.js → chunk.A6LJPXJ3.js} +1 -1
- package/dist/preview/chunk.AAPXF6NP.js +1 -0
- package/dist/preview/chunk.APUICV5Z.js +1 -0
- package/dist/preview/chunk.ASNVH2G4.js +25 -0
- package/dist/preview/{chunk.CM7EDQ4E.js → chunk.CJHCUHVN.js} +1 -1
- package/dist/preview/chunk.CUEPNS3Z.js +1 -0
- package/dist/preview/{chunk.U3CV227I.js → chunk.CUJRWBPX.js} +1 -1
- package/dist/preview/{chunk.7TZXDPPO.js → chunk.D5PW6YWF.js} +3 -3
- package/dist/preview/chunk.DCIYOZYP.js +1 -0
- package/dist/preview/chunk.DEBW4FH6.js +1 -0
- package/dist/preview/{chunk.MR776WQ2.js → chunk.DYPSFTRP.js} +1 -1
- package/dist/preview/{chunk.BBMX3IIO.js → chunk.E6QZUT4L.js} +1 -1
- package/dist/preview/chunk.E7QZZRAQ.js +17 -0
- package/dist/preview/chunk.EHCMBAZO.js +3 -0
- package/dist/preview/chunk.EXTD5JWD.js +1 -0
- package/dist/preview/{chunk.KOVTQCHX.js → chunk.EZF2T3XQ.js} +1 -1
- package/dist/preview/chunk.EZSST3IU.js +1 -0
- package/dist/preview/{chunk.DIVANC3G.js → chunk.F2BZ4SC4.js} +1 -1
- package/dist/preview/chunk.F2I7ERGM.js +1 -0
- package/dist/preview/{chunk.UWEFODVV.js → chunk.FCV3NX6L.js} +1 -1
- package/dist/preview/{chunk.NZ5TJKPT.js → chunk.FFTBUXKX.js} +2 -2
- package/dist/preview/chunk.FILBI7XA.js +1 -0
- package/dist/preview/{chunk.MGG5DH2S.js → chunk.FKSI5522.js} +1 -1
- package/dist/preview/{chunk.I3ADXJQW.js → chunk.FQ2QUDZS.js} +1 -1
- package/dist/preview/{chunk.A5ENJJZN.js → chunk.G2ZDDO3C.js} +1 -1
- package/dist/preview/{chunk.IPKODEOZ.js → chunk.GAVEWSXU.js} +1 -1
- package/dist/preview/chunk.GH6QX7JR.js +87 -0
- package/dist/preview/chunk.GMHBAS45.js +1 -0
- package/dist/preview/{chunk.YCMMATFK.js → chunk.GOVRX2YX.js} +1 -1
- package/dist/preview/chunk.GXK5PI7I.js +1 -0
- package/dist/preview/{chunk.RECTEAG4.js → chunk.GYP3EF6Z.js} +1 -1
- package/dist/preview/chunk.H2RVMT4Y.js +111 -0
- package/dist/preview/chunk.HCHGKI64.js +1 -0
- package/dist/preview/chunk.HE7SAJKZ.js +1 -0
- package/dist/preview/{chunk.WAIIXXVI.js → chunk.HIIYDKFC.js} +2 -2
- package/dist/preview/chunk.HPDUGKEF.js +32 -0
- package/dist/preview/{chunk.DGDOZHYK.js → chunk.HQRPOGTS.js} +1 -1
- package/dist/preview/chunk.HUJLELZ3.js +1 -0
- package/dist/preview/chunk.HVRUHRXR.js +1 -0
- package/dist/preview/{chunk.6KYTCEIH.js → chunk.I46VNAMS.js} +1 -1
- package/dist/preview/{chunk.QAERSZVB.js → chunk.ID4GOKT6.js} +1 -1
- package/dist/preview/{chunk.RJ7UV3XI.js → chunk.IZKCTF2R.js} +1 -1
- package/dist/preview/chunk.IZUAZ6EV.js +1 -0
- package/dist/preview/{chunk.ZIGW5VOT.js → chunk.J3CUBMUZ.js} +1 -1
- package/dist/preview/{chunk.3HFBHLXC.js → chunk.J4D4BIB4.js} +1 -1
- package/dist/preview/{chunk.IRPMGHZN.js → chunk.J7GH2CGV.js} +1 -1
- package/dist/preview/{chunk.SSHEFQ4R.js → chunk.JE4RBRKH.js} +1 -1
- package/dist/preview/{chunk.4BSEYZMS.js → chunk.JJSZLCNU.js} +1 -1
- package/dist/preview/{chunk.KV3N6VRG.js → chunk.JKX4J3KG.js} +1 -1
- package/dist/preview/{chunk.FUTSLXWN.js → chunk.JMXBMLKH.js} +1 -1
- package/dist/preview/chunk.JOB3EKS6.js +1 -0
- package/dist/preview/{chunk.5IM2X3VT.js → chunk.JP33TNCH.js} +1 -1
- package/dist/preview/{chunk.BZXJKWNI.js → chunk.K6EN2YR4.js} +1 -1
- package/dist/preview/chunk.K6YKXTKC.js +1 -0
- package/dist/preview/{chunk.A7JORJJL.js → chunk.KAIZDIRK.js} +1 -1
- package/dist/preview/{chunk.7LAXSQQY.js → chunk.KAQGSLC6.js} +3 -3
- package/dist/preview/{chunk.QG3LV4RH.js → chunk.KFYSKZC4.js} +1 -1
- package/dist/preview/{chunk.VBHV4TLG.js → chunk.KHRS2SKB.js} +1 -1
- package/dist/preview/chunk.KHVW6Q3T.js +1 -0
- package/dist/preview/chunk.KMFH26SS.js +1 -0
- package/dist/preview/{chunk.2T24FYAO.js → chunk.L3ST2YKI.js} +1 -1
- package/dist/preview/{chunk.HIJ72QX6.js → chunk.L6BLZJ6K.js} +1 -1
- package/dist/preview/{chunk.NCBUECIW.js → chunk.LG2BQ5LB.js} +1 -1
- package/dist/preview/{chunk.LZ3HO3HM.js → chunk.LLYHHG67.js} +1 -1
- package/dist/preview/{chunk.VKQONZKR.js → chunk.LPWANRBL.js} +1 -1
- package/dist/preview/{chunk.3MPLUSVY.js → chunk.LSS64NAA.js} +1 -1
- package/dist/preview/{chunk.SUYYDJGZ.js → chunk.MFNWHXGL.js} +1 -1
- package/dist/preview/{chunk.UJF6YTEO.js → chunk.MNH3WUAB.js} +1 -1
- package/dist/preview/chunk.MQ7AB5N4.js +1 -0
- package/dist/preview/{chunk.CZUUFO6A.js → chunk.MU5JK5TK.js} +1 -1
- package/dist/preview/{chunk.RXUL6P7Y.js → chunk.N5CACZ5F.js} +1 -1
- package/dist/preview/{chunk.S6IKR6RD.js → chunk.NFC2TYA6.js} +1 -1
- package/dist/preview/{chunk.TD2V74XU.js → chunk.NKRDVOLJ.js} +1 -1
- package/dist/preview/{chunk.SGYZM6ZU.js → chunk.NNK2E2EP.js} +1 -1
- package/dist/preview/{chunk.J65CZJIC.js → chunk.NVPKYWMF.js} +1 -1
- package/dist/preview/{chunk.DWMFLLJO.js → chunk.NWJ7ELHN.js} +1 -1
- package/dist/preview/{chunk.NKUNCQB3.js → chunk.O5P6LXHF.js} +1 -1
- package/dist/preview/{chunk.2MWEYNVH.js → chunk.OFK6673S.js} +1 -1
- package/dist/preview/{chunk.C4LC2UEU.js → chunk.OG6FEP3K.js} +1 -1
- package/dist/preview/{chunk.CZI6J5CE.js → chunk.OHGAZ3D5.js} +1 -1
- package/dist/preview/{chunk.XJ4JYROM.js → chunk.ONVYKLRX.js} +1 -1
- package/dist/preview/chunk.OQ3FKUP2.js +1 -0
- package/dist/preview/chunk.OUJV4CYS.js +1 -0
- package/dist/preview/{chunk.T552MHMU.js → chunk.OWHH7JDV.js} +1 -1
- package/dist/preview/{chunk.SCN6IYDG.js → chunk.OXDCGGZV.js} +1 -1
- package/dist/preview/{chunk.YIDNZTON.js → chunk.P3Z4ZCL3.js} +1 -1
- package/dist/preview/chunk.PF7XQ5R5.js +1 -0
- package/dist/preview/{chunk.FSZQTX3K.js → chunk.PGT4ZQDG.js} +4 -4
- package/dist/preview/chunk.PH547SON.js +1 -0
- package/dist/preview/chunk.PS765ODQ.js +3 -0
- package/dist/preview/{chunk.MZSWWMX6.js → chunk.PVAYYFT2.js} +1 -1
- package/dist/preview/{chunk.F5STM4DX.js → chunk.Q6WOIE5I.js} +1 -1
- package/dist/preview/{chunk.55C7WO4X.js → chunk.QE257AXE.js} +1 -1
- package/dist/preview/chunk.QKNC5OUC.js +1 -0
- package/dist/preview/chunk.QMGBAKX6.js +2 -0
- package/dist/preview/{chunk.4QBW46XV.js → chunk.QNFX5VHW.js} +1 -1
- package/dist/preview/chunk.QPCDAQTW.js +1 -0
- package/dist/preview/{chunk.TS5APXWC.js → chunk.QPTQIGLX.js} +1 -1
- package/dist/preview/{chunk.LZNHTROY.js → chunk.R5YGW5ZX.js} +1 -1
- package/dist/preview/{chunk.4VTUC5TF.js → chunk.RJ6KEVZC.js} +1 -1
- package/dist/preview/{chunk.6QMRDSTD.js → chunk.RKVMRP7B.js} +1 -1
- package/dist/preview/{chunk.YBQUP3KE.js → chunk.S7U2CHHG.js} +1 -1
- package/dist/preview/{chunk.CLJKQLK2.js → chunk.SD2UYSV6.js} +2 -2
- package/dist/preview/chunk.SI5GGFQR.js +1 -0
- package/dist/preview/{chunk.7QWGIGHM.js → chunk.SMF5S4DQ.js} +1 -1
- package/dist/preview/{chunk.LEZGBHPZ.js → chunk.SNDFIJVX.js} +1 -1
- package/dist/preview/{chunk.F5756PXX.js → chunk.STHWM422.js} +2 -2
- package/dist/preview/{chunk.JIEBGUCA.js → chunk.SV75TRCH.js} +1 -1
- package/dist/preview/{chunk.U2DZE7A5.js → chunk.SXGPRFA4.js} +1 -1
- package/dist/preview/{chunk.ZGJUCVT5.js → chunk.T3RFZ66S.js} +1 -1
- package/dist/preview/{chunk.I6HIVTXU.js → chunk.T6ISUVUP.js} +1 -1
- package/dist/preview/{chunk.R65YX332.js → chunk.TBLOBXZ2.js} +1 -1
- package/dist/preview/{chunk.CVVNHQPO.js → chunk.TDWJU6GW.js} +1 -1
- package/dist/preview/{chunk.2QALBEWP.js → chunk.THLT6NVO.js} +1 -1
- package/dist/preview/{chunk.7FTATAH2.js → chunk.TQCVEKPH.js} +1 -1
- package/dist/preview/{chunk.PAIBRJVZ.js → chunk.TQF5XCUS.js} +1 -1
- package/dist/preview/{chunk.F5XWYO5W.js → chunk.TRP66PHK.js} +1 -1
- package/dist/preview/chunk.TWXYI5AP.js +2 -0
- package/dist/preview/{chunk.IQCMV5WD.js → chunk.UOUQZYVD.js} +1 -1
- package/dist/preview/{chunk.FJXKQZZS.js → chunk.UPL3D3ZO.js} +1 -1
- package/dist/preview/{chunk.U5Q7EVZQ.js → chunk.UXW43HNW.js} +1 -1
- package/dist/preview/{chunk.ZOSTOVXR.js → chunk.V4GSVXSV.js} +1 -1
- package/dist/preview/chunk.VCEDSOAK.js +1 -0
- package/dist/preview/{chunk.4O3STSC4.js → chunk.VE4AQFLW.js} +1 -1
- package/dist/preview/{chunk.HMV4ILAC.js → chunk.VGQDPEB5.js} +1 -1
- package/dist/preview/{chunk.5A5DI36V.js → chunk.VMYXBFPE.js} +1 -1
- package/dist/preview/{chunk.BQWMHHAZ.js → chunk.VNI6HZEF.js} +2 -2
- package/dist/preview/chunk.VQRY2NQ6.js +1 -0
- package/dist/preview/{chunk.K6EKSURO.js → chunk.VUE6ILQV.js} +1 -1
- package/dist/preview/{chunk.3KF5RYPW.js → chunk.W2VSEEKX.js} +1 -1
- package/dist/preview/{chunk.KP7HUXH5.js → chunk.WAPY4RCS.js} +1 -1
- package/dist/preview/chunk.WFRSGGU5.js +1 -0
- package/dist/preview/{chunk.XAN7QXMQ.js → chunk.WIVNFOQR.js} +1 -1
- package/dist/preview/chunk.WRIBFLVG.js +1 -0
- package/dist/preview/{chunk.TVNY7F64.js → chunk.WWD2TS47.js} +1 -1
- package/dist/preview/{chunk.5W7EGQCQ.js → chunk.WWFOQDPR.js} +2 -2
- package/dist/preview/{chunk.FBDCHJS2.js → chunk.X45EITTK.js} +1 -1
- package/dist/preview/{chunk.5FQHZVE3.js → chunk.X5MCAUFX.js} +1 -1
- package/dist/preview/{chunk.IJVR7ZL7.js → chunk.XBWFQ54R.js} +1 -1
- package/dist/preview/{chunk.JPJHM62B.js → chunk.XMBGT6UT.js} +1 -1
- package/dist/preview/chunk.XP4IVKKR.js +1 -0
- package/dist/preview/chunk.XYBWBMNU.js +1 -0
- package/dist/preview/{chunk.MYR36HW4.js → chunk.YC2IDHQX.js} +1 -1
- package/dist/preview/{chunk.ZQSV5XVB.js → chunk.YCYJHPWS.js} +1 -1
- package/dist/preview/{chunk.BJ3G7J2Z.js → chunk.YF5GCOSZ.js} +3 -2
- package/dist/preview/{chunk.3I2SGKKF.js → chunk.YGGBGHZU.js} +1 -1
- package/dist/preview/chunk.YRC6PKXP.js +1 -0
- package/dist/preview/{chunk.6NYSB6OZ.js → chunk.YRN67Z5K.js} +1 -1
- package/dist/preview/chunk.ZDUKVXBI.js +5 -0
- package/dist/preview/index.html +55 -55
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2QOB62XU.js +0 -1
- package/dist/preview/chunk.36FKQJFM.js +0 -2
- package/dist/preview/chunk.3A3DCALP.js +0 -1
- package/dist/preview/chunk.3GPYKWAD.js +0 -1
- package/dist/preview/chunk.3QPMFUMV.js +0 -1
- package/dist/preview/chunk.3ZP6IDUC.js +0 -1
- package/dist/preview/chunk.53HW224Y.js +0 -1
- package/dist/preview/chunk.AW74DZ5V.js +0 -17
- package/dist/preview/chunk.C67TMA4U.js +0 -111
- package/dist/preview/chunk.CCCSZRKU.js +0 -1
- package/dist/preview/chunk.CUA7F3YJ.js +0 -25
- package/dist/preview/chunk.DBSSCJQM.js +0 -1
- package/dist/preview/chunk.DW6KXAUM.js +0 -1
- package/dist/preview/chunk.DWPM7AWA.js +0 -1
- package/dist/preview/chunk.FXCKKVT5.js +0 -1
- package/dist/preview/chunk.HHQUCFN4.js +0 -1
- package/dist/preview/chunk.HPWMCS3H.js +0 -23
- package/dist/preview/chunk.HRLCDBMO.js +0 -1
- package/dist/preview/chunk.I7ODVOO5.js +0 -1
- package/dist/preview/chunk.IANOWT3Z.js +0 -1
- package/dist/preview/chunk.IFPJPJ4M.js +0 -1
- package/dist/preview/chunk.IUVRJDL3.js +0 -5
- package/dist/preview/chunk.J4CSY2D5.js +0 -2
- package/dist/preview/chunk.JJIKTTXB.js +0 -1
- package/dist/preview/chunk.KDOJC4FX.js +0 -1
- package/dist/preview/chunk.KJAOJTZZ.js +0 -1
- package/dist/preview/chunk.KLZPUTMU.js +0 -1
- package/dist/preview/chunk.LQ2PDW2M.js +0 -32
- package/dist/preview/chunk.M7DJJRFH.js +0 -1
- package/dist/preview/chunk.MNWP3TPN.js +0 -1
- package/dist/preview/chunk.MSWOETXN.js +0 -1
- package/dist/preview/chunk.NILR2BWR.js +0 -1
- package/dist/preview/chunk.NNYKLENL.js +0 -1
- package/dist/preview/chunk.PYGNO2AV.js +0 -87
- package/dist/preview/chunk.PZHCWMKT.js +0 -1
- package/dist/preview/chunk.QQUZ5RTQ.js +0 -1
- package/dist/preview/chunk.QVID5WHS.js +0 -1
- package/dist/preview/chunk.RHV73CBA.js +0 -3
- package/dist/preview/chunk.RP6C2IUM.js +0 -1
- package/dist/preview/chunk.RPHZY7N4.js +0 -1
- package/dist/preview/chunk.RSMCTI2N.js +0 -1
- package/dist/preview/chunk.S4QSZRKH.js +0 -1
- package/dist/preview/chunk.T4QRIJE4.js +0 -1
- package/dist/preview/chunk.UJM5EZDM.js +0 -3
- package/dist/preview/chunk.UJPX3BUV.js +0 -1
- package/dist/preview/chunk.UYBSVE2W.js +0 -1
- package/dist/preview/chunk.WMZ2BINI.js +0 -1
- package/dist/preview/chunk.X2RHBTJI.js +0 -1
- package/dist/preview/chunk.X3FPVFFB.js +0 -1
- package/dist/preview/chunk.X4PFLIXB.js +0 -1
- package/dist/preview/chunk.YR7DKU5T.js +0 -1
- package/dist/preview/chunk.ZBK3FCVE.js +0 -1
- package/dist/preview/chunk.ZH5L746C.js +0 -1
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as $e}from"./chunk.F5STM4DX.js";import{A as Te,B as Ht,C as Oe,D as Se,E as zt,F as ei,G as Jt,H as Yt,I as ne,J as Ye,K as ti,L as Mn,M as Qe,N as ni,O as Qt,P as ai,Q as Xt,R as Nn,S as ri,T as ue,U as it,V as ce,W as Aa,a as Y,b as Ee,c as te,d as En,e as vt,f as Ce,g as va,h as rt,i as pt,j as Jo,k as ba,l as Ne,m as Yo,n as Qo,o as $,p as We,q as ka,r as xa,s as Ft,t as pe,u as Be,v as ge,w as L,x as me,y as Q,z as Ke}from"./chunk.SWY6DIE4.js";import{c as Sa,d as Xo,e as Zo,f as ot,g as Pa,i as le}from"./chunk.F5756PXX.js";import{a as Vo,d as _o,e as zo}from"./chunk.Q355UPFG.js";import{a as Io,c as Do,f as Wo,g as Bo,i as Ko,j as Go,l as qo,m as jo,o as Uo}from"./chunk.3ZP6IDUC.js";import{a as Tn,b as wt}from"./chunk.QG3LV4RH.js";import{a as Ro,b as Lo,c as To,d as wa}from"./chunk.BQWMHHAZ.js";import{b as Co}from"./chunk.2QALBEWP.js";import{a as Eo,b as Mo,d as Rn,e as No,f as Oo,g as $o,j as Ln}from"./chunk.QQUZ5RTQ.js";import{m as Ao}from"./chunk.4BSEYZMS.js";import{a as go,b as fo,c as mo,e as Pn,f as ha,h as An}from"./chunk.FUTSLXWN.js";import{d as yo,e as Sn,f as ho,g as wo,o as kn,p as So,r as ko,t as xn}from"./chunk.MZSWWMX6.js";import{a as yn,b as Wr,c as Br,d as hn,e as Kr}from"./chunk.6KYTCEIH.js";import{b as so,c as lo,e as co,f as fa}from"./chunk.FXCKKVT5.js";import{a as Cn,b as _t,c as xo,e as Po}from"./chunk.2T24FYAO.js";import{a as ua,b as ro}from"./chunk.CM7EDQ4E.js";import{a as $t,b as no,e as ao}from"./chunk.YR7DKU5T.js";import{a as po}from"./chunk.BJUUSIQY.js";import{a as ma}from"./chunk.HMV4ILAC.js";import{a as ga,b as oo,c as io}from"./chunk.XAN7QXMQ.js";import{a as uo}from"./chunk.CHG522KL.js";import{c as bn,d as Vr,e as _r,f as zr,j as Jr,l as ht,n as Yr}from"./chunk.IRPMGHZN.js";import{a as Ur}from"./chunk.7QWGIGHM.js";import{b as Sr,c as kr}from"./chunk.36FKQJFM.js";import{a as da,d as ca,f as br}from"./chunk.RHV73CBA.js";import{A as Zr,B as eo,C as to,n as Ut,s as Vt,t as Qr,z as Xr}from"./chunk.RP6C2IUM.js";import{g as jr}from"./chunk.ZGJUCVT5.js";import{b as wn,c as Gr,d as vn,e as qr,l as Ot}from"./chunk.YIDNZTON.js";import{G as ya,O as Fo,R as Ho,e as Ir,f as Dr,w as vo,x as bo}from"./chunk.PYGNO2AV.js";import{c as us}from"./chunk.3HFBHLXC.js";import{G as Ae,Ja as mn,M as Ar,O as Cr,Q as Rr,S as Lr,W as Tr,Wa as Hr,Y as j,Z as pa,ba as Er,ca as Mr,ga as Nr,ha as we,ka as Or,la as $r,pa as Fr,r as Pr,ta as Nt,v as Je,va as yt,xa as nt,ya as at}from"./chunk.CUA7F3YJ.js";import{a as xr}from"./chunk.SDO3U72B.js";import{Ac as ia,C as un,Ga as ar,Gb as oa,Ha as rr,Hb as sr,Lc as cr,Ld as mr,N as er,Qb as lr,Tb as Et,Tc as pr,Z as Lt,ae as la,ce as yr,fc as dr,ge as fn,ha as dt,he as hr,je as qt,la as mt,ma as se,oa as Tt,pa as tr,qa as ct,qd as sa,rb as or,rd as ur,sa as nr,se as wr,tb as ir,te as Mt,ua as gn,ue as jt,va as tt,yd as gr,zd as fr,ze as vr}from"./chunk.IUVRJDL3.js";import{b as O}from"./chunk.AJZBJBMO.js";var gs=new Set(["text","date","number","choice","several"]);function oi(e,t,n){let a=e.graph.getNode(t);if(!a)return[];let r=n??e.seenFor,o=e.schema.tryDefinition(a.kind),i=new Set(bn(o)),l=o?.fields?.shape;return Ut(e,t,...r?[{principal:r}]:[]).filter(s=>{let d=a[s.field],c=d==null||d===""||Array.isArray(d)&&d.length===0,y=s.shape.type==="several"?s.shape.of.type==="choice"?"several":"":s.shape.type,g=s.open.length===0&&(s.takesValue?y==="boolean":ii(l?.[s.field]));return o?.display?.format?.[s.field]!==void 0?!1:c&&!i.has(s.field)&&(g||s.takesValue&&s.open.length===0&&gs.has(y))}).map(s=>s.field)}function ii(e){let t=un(e);return t?t.type==="optional"||t.type==="nullable"||t.type==="default"?ii(t.innerType):t.type==="boolean":!1}function On(e,t,n={}){let a=e.graph.getNode(t);if(!a)return;let r=e.schema.tryDefinition(a.kind),o=l=>se(e.schema.tryDefinition(l.kind),l),i=new Map;for(let l of e.graph.allEdges()){let s=l.from===t?"out":l.to===t?"in":null;if(!s)continue;let d=s==="out"?l.to:l.from,c=e.graph.getNode(d);if(!c)continue;let g=(s==="out"?r:e.schema.tryDefinition(c.kind))?.edges?.[l.kind],u=s==="in"?g?.inverse??g?.description:g?.description,P=`${l.kind}|${s}|${u??""}`;(i.get(P)??(()=>{let S={edgeKind:l.kind,direction:s,...u?{description:u}:{},targets:[]};return i.set(P,S),S})()).targets.push({id:c.id,kind:c.kind,label:o(c)})}return{id:t,kind:a.kind,label:o(a),fields:vn(ht(e.schema,e.graph,a),r,n.blanks?{blanks:n.blanks}:{}),violations:oa(e.violations(n.context),[t]),actions:ma(e,[t],{focus:t,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...i.values()].map(l=>{let s=wn(l.targets.flatMap(d=>{let c=e.graph.getNode(d.id);return c?[c]:[]}),d=>e.schema.tryDefinition(d));return{...l,targets:[...l.targets].map(d=>s.has(d.id)?{...d,apart:s.get(d.id)}:d).sort((d,c)=>d.label.localeCompare(c.label))}})}}function bt(e,t,n={}){return{kind:t,members:e.graph.nodesOfKind(t),actions:ma(e,[],{kindSelection:[t],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function si(e,t){let n=(o,i)=>`${o}|${JSON.stringify(i)}`,a=new Map;for(let o of[...e.affordances,...e.withheld]){if(o.provider!=="invariant")continue;let i=n(o.mutation,o.args);a.has(i)||a.set(i,o.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...t].map((o,i)=>({repair:o,declared:i})).sort((o,i)=>(a.get(n(o.repair.mutation,o.repair.args??{}))??r)-(a.get(n(i.repair.mutation,i.repair.args??{}))??r)||o.declared-i.declared).map(o=>o.repair)}function Xe(e){let t=e.schema.kinds.map(r=>({kind:r,plural:ct(e.schema,r),count:e.graph.nodesOfKind(r).length})),n=new Map;for(let r of e.graph.allEdges()){let o=e.graph.getNode(r.from),i=e.graph.getNode(r.to);if(!o||!i)continue;let l=`${r.kind}|${o.kind}|${i.kind}`;n.set(l,(n.get(l)??0)+1)}let a=[];for(let{kind:r}of t){let o=e.schema.tryDefinition(r)?.edges??{};for(let[i,l]of Object.entries(o)){let s=l.to==="*"||l.to===void 0?(()=>{let d=[...n.keys()].filter(c=>c.startsWith(`${i}|${r}|`)).map(c=>c.split("|")[2]);return d.length>0?d:["*"]})():l.to;for(let d of s)a.push({edgeKind:i,from:r,to:d,...l.description?{description:l.description}:{},...l.inverse?{inverse:l.inverse}:{},count:n.get(`${i}|${r}|${d}`)??0})}}return{kinds:t,relations:a}}var st=O(Ae(),1);var Zt=O(Ae(),1);var Fe=O(j(),1),ms={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},ys=e=>{try{return decodeURIComponent(e)}catch{return e}};function hs(e,t,n={}){let{store:a}=e,r=a.schema,o=(n.base??"").replace(/\/$/,""),[i="/",l=""]=t.split("#")[0].split("?"),s=(T,x,b)=>({label:T,href:`${o}${x}`,path:x,...b?{current:b}:{}}),d=T=>{let x=n.registry?.sectionOf(T);return x?[x.path===void 0?{label:x.label}:s(x.label,x.path)]:[]},c=T=>n.registry?.sectionOf(T)?.label,y=T=>{let x=c(T);return x===void 0?{}:{section:x}},[g,u,...P]=i.split("/").filter(Boolean).map(ys);if(g===void 0)return{as:"home",label:"Home",trail:[s("Home","/",!0)]};if(g==="places"&&u!==void 0&&P.length===0){let T=new URLSearchParams(l).get("of"),x=new Set(Ye(a,e.principal)),b=e.views?.places()??[],K=b.find(q=>x.has(q.kind)&&q.as===u&&(!T||Y(r,q.kind)===T));if(K){let q=En(K.as,fn(K,b)?Y(r,K.kind):void 0);return{as:"place",kind:K.kind,label:K.title,...y(K.kind),trail:[...d(K.kind),s(K.title,q,!0)]}}}let f=P.length===0?Ee(r,g):void 0;if(f!==void 0){let T=s(ct(r,f),`/${Y(r,f)}`);if(u===void 0)return{as:"list",kind:f,label:T.label,...y(f),trail:[...d(f),{...T,current:!0}]};let x=a.graph.getNode(u),b=x&&x.kind===f?se(r.tryDefinition(f),x):"Nothing lives here";return{as:"record",kind:f,id:u,label:b,...y(f),trail:[...d(f),T,s(b,te(r,f,u),!0)]}}let S=ms[g]??ws((P.at(-1)??u??g).replace(/[-_]+/g," "));return{as:"page",label:S,trail:[s(S,i,!0)]}}var ws=e=>e.charAt(0).toUpperCase()+e.slice(1),Ca=(0,Zt.createContext)(null);function vs(e){let t=Ce(),n=vt("/");return le(e.context.store),hs(e.context,`${t.pathname}${t.search}`,{registry:e.registry,base:n})}var bs={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},li={display:"flex",alignItems:"center",gap:6,minWidth:0},di={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function St({context:e,style:t}){let n=(0,Zt.useContext)(Ca),a=(0,Zt.useContext)(Qt);return Xt(a??ks,"trail")||n?.registry?.without().has("trail")?null:(0,Fe.jsx)(Ss,{root:n??{context:e,registry:void 0},context:e,...t?{style:t}:{}})}function Ss({root:e,context:t,style:n}){let a=vs(e);return a.trail.length<2?null:(0,Fe.jsx)(xs,{here:a,mark:a.as==="record"?{kind:a.kind,context:t}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var ks={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function xs({here:e,mark:t,style:n,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,Fe.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Fe.jsx)("ol",{style:{...Be,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:e.trail.map((o,i)=>(0,Fe.jsxs)("li",{style:o.current?bs:{...li,flexShrink:i===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[i>0&&!o.current?(0,Fe.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,Fe.jsxs)($,{to:o.path,style:{...Te,...li},...i===r?{"data-testid":"trail-list"}:{},children:[i===r&&t?(0,Fe.jsx)(Se,{kind:t.kind,brand:t.context.brand,schema:t.context.store.schema,size:8}):null,(0,Fe.jsx)("span",{style:di,children:o.label})]}):(0,Fe.jsx)("span",{style:di,children:o.label})]},`${i}:${o.label}`))})})}var E=O(j(),1),Wt="built-in";function $n(e,t,n){return["q","archived","by","with","past","sort","group",...t].some(a=>e.has(a))||n&&e.has("filter")}function He(e){let t=e.views;if(!t)return[];let n=new Set(Ye(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}function Fn(e,t){let n=e.views?.arrangement?.()?.lists?.[t]?.opens,a=n===void 0?void 0:He(e).find(r=>r.kind===t&&r.as===yr(n));if(a)return{place:a,flows:e.views?.resolve(a.kind,{cardinality:"many",fidelity:"full"},a.as)?.view?.flows===!0}}function It(e,t){if(!t.over)return[t.kind];let n=new Set(Ye(e.store,e.principal));return t.over.filter(a=>a===t.kind||n.has(a))}var kt=e=>`place:${e.kind}:${e.as}`;function ke(e,t){return En(t.as,fn(t,e.views?.places()??[])?Y(e.store.schema,t.kind):void 0)}function Dt(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>mt(n,a))}function Ra(e,t,n){let a=(o,i)=>Tt(e.schema,i,o),r=(typeof t=="string"?[t]:t).map(o=>a(Dt(e,o).length,o)).join(" and ");return n?`${r} across ${a(Dt(e,n).length,n)}`:r}function La({context:e,place:t,chosen:n,filter:a,bled:r}){let{store:o,views:i,invariantContext:l}=e,d=i?.resolve(t.kind,{cardinality:"many",fidelity:"full"},t.as)?.view,c=[...new Set(o.violations(l).flatMap(u=>u.nodeIds))],y=It(e,t).flatMap(u=>Dt(o,u));if(!d)return null;let g=As(o,y,a,c);return(0,E.jsx)(Vt,{kind:t.kind,view:t.title,children:(0,E.jsx)(it,{when:nt(d)&&!r,children:(0,E.jsx)(d,{nodes:g,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})})}function Ps(e,t,n){let a=n?qt({filter:n}).filter??[]:[];if(a.length===0)return{filter:null,said:[],dropped:[]};let r=t.map(s=>Sn(e.schema,s)),o=a.filter(s=>r.some(d=>d.filters.some(c=>c.key===s.key))),i=a.filter(s=>!o.includes(s)).map(s=>`filter ${s.key}`),l=o.filter(s=>!(s.key==="is"&&s.value==="any")).map(s=>s.key==="is"?`that are ${s.value}`:`where ${s.key} is ${s.value}`);return{filter:o.length>0?Pn({filter:o}).filter??null:null,said:l,dropped:i}}function As(e,t,n,a){let r=n?qt({filter:n}).filter??[]:[];return r.length===0?t:An(t,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function Cs({store:e,views:t,as:n,invariantContext:a}){le(e);let r={store:e,views:t,...a?{invariantContext:a}:{}},o=t.places().find(i=>i.as===n);return o?(0,E.jsx)(La,{context:r,place:o}):null}function Rs({context:e,kind:t}){let{store:n,views:a,invariantContext:r}=e,o=Dt(n,t),i=n.schema.tryDefinition(t),l=ne(n,t),d=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,c=[...new Set(n.violations(r).flatMap(P=>P.nodeIds))];if(d&&!Nt(d))return(0,E.jsx)(Vt,{kind:t,children:(0,E.jsx)(d,{nodes:o,label:l,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...c.length>0?{flagged:c}:{}})});let y=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,g=8,u=o.slice(0,g);return(0,E.jsxs)("div",{"data-testid":"kind-sheet",style:y?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[u.map(P=>y?(0,E.jsx)(y,{node:P,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...c.includes(P.id)?{flagged:[P.id]}:{}},P.id):(0,E.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:se(i,P)},P.id)),o.length>g?(0,E.jsxs)("span",{style:{...L,alignSelf:"center",padding:"0 6px"},children:["+",o.length-g," more ",l.toLowerCase()]}):null]})}function Hn(e){let{store:t}=e,n=ti(e),a=He(e),r=e.views?.arrangement?.()?.order??[],o=s=>{let d=s.name===void 0?-1:r.indexOf(`view:${s.name}`);return d>=0?d-r.length:n.indexOf(s.kind)},i=la([...a].sort((s,d)=>o(s)-o(d))).filter(s=>!s.hidden),l=new Set(i.flatMap(s=>s.over??[s.kind]));return[...i.map(s=>({key:kt(s),kind:s.kind,title:hr(s,a,t.schema),to:ke(e,s),place:s})),...Mn(e).filter(s=>!l.has(s)).map(s=>({key:`kind:${s}`,kind:s,title:ne(t,s),to:`/${Y(t.schema,s)}`}))]}function ui(e){let t=new Set(Hn(e).flatMap(n=>n.place?It(e,n.place):[n.kind]));return new Set([...t].flatMap(n=>Dt(e.store,n).map(a=>a.id)))}var ci=.72,Ls=540,pi=16/10;function Ts(e){let t=(0,st.useRef)(null),[n,a]=(0,st.useState)(e);return(0,st.useLayoutEffect)(()=>{let r=t.current;if(!r||typeof ResizeObserver>"u")return;let o=()=>{let l=r.getBoundingClientRect().width;l>0&&a(s=>Math.abs(s-l)<.5?s:l)};o();let i=new ResizeObserver(o);return i.observe(r),()=>i.disconnect()},[]),{ref:t,width:n}}function Es(e){for(let t=e.parentElement;t;t=t.parentElement)if(/(auto|scroll)/.test(getComputedStyle(t).overflowY))return t;return null}function Ms(e){let[t,n]=(0,st.useState)(()=>typeof IntersectionObserver>"u");return(0,st.useLayoutEffect)(()=>{let a=e.current;if(t||!a)return;let r=new IntersectionObserver(o=>{o.some(i=>i.isIntersecting)&&(r.disconnect(),n(!0))},{root:Es(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[t,e]),t}function Ta({context:e,entry:t,small:n=!1}){let{store:a,brand:r,principal:o}=e,{ref:i,width:l}=Ts(Ls),s=Ms(i),d=l/ci,c=Dt(a,t.kind),y=a.schema.tryDefinition(t.kind),g=c.length===0?bt(a,t.kind,{...o?{principal:o}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,u=t.place!==void 0;return(0,E.jsxs)($,{to:t.to,"data-testid":u?"place-card":"kind-card",className:"graview-gallery-card",style:{...Te,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,E.jsxs)("span",{ref:i,"data-testid":u?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${pi}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,E.jsx)("span",{style:{position:"absolute",left:0,top:0,width:d,height:d/pi,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${ci})`,transformOrigin:"0 0"},children:s?(0,E.jsx)(Rn.Provider,{value:null,children:t.place?(0,E.jsx)(La,{context:e,place:t.place}):(0,E.jsx)(Rs,{context:e,kind:t.kind})}):null}),c.length===0?(0,E.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,E.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,E.jsxs)("span",{style:{fontFamily:xa,fontWeight:"var(--graview-weight-display)"},children:["No ",ne(a,t.kind).toLowerCase()," yet"]}),g?(0,E.jsxs)("span",{style:L,children:["Begin with \u201C",g.label,"\u201D"]}):null]})}):null]}),(0,E.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,E.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[u?null:(0,E.jsx)(Se,{kind:t.kind,brand:r,schema:a.schema,size:8}),(0,E.jsx)("span",{style:{fontFamily:xa,fontSize:n?"var(--graview-text-body)":"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:t.title})]}),(0,E.jsxs)("span",{style:L,children:[t.place?Ra(a,It(e,t.place),t.place.across):Ra(a,t.kind),!u&&y?.description?` \xB7 ${y.description}`:null]})]})]})}var gi={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},Ns={display:"grid",gap:"20px 16px",gridTemplateColumns:"repeat(auto-fill, minmax(clamp(140px, 22%, 260px), 1fr))"},Os=`
|
|
2
|
-
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
3
|
-
.graview-gallery-card:hover > span:first-child,
|
|
4
|
-
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
5
|
-
`;function In({context:e,small:t=!1}){le(e.store);let n=Hn(e);return n.length===0?null:(0,E.jsxs)("section",{style:t?Ns:gi,"data-testid":"gallery",...t?{"data-small":""}:{},children:[(0,E.jsx)("style",{children:Os}),n.map(a=>(0,E.jsx)(Ta,{context:e,entry:a,small:t},a.key))]})}function Ea({context:e}){let{store:t}=e;le(t);let n=la(He(e)).filter(r=>!r.hidden),a=Hn(e);return(0,E.jsxs)(ue,{context:e,style:Ft,children:[(0,E.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,E.jsx)("p",{style:Be,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,E.jsx)(ce,{context:e,children:"Pictures"}),(0,E.jsx)("p",{style:ge,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,E.jsx)("div",{style:gi,"data-testid":"places",children:a.map(r=>(0,E.jsx)(Ta,{context:e,entry:r},r.key))}):null]})}var $s={lede:!0},Fs={lede:!1},Hs={...ge,textWrap:"pretty"};function Is(e,t){if(t===void 0)return;let[n]=zr(_r([t]),Yr(e.store,null,null,e.brand?{money:e.brand}:{}));return n?.t==="headline"&&!n.problem&&n.text.trim()!==""?n.text:void 0}function en({context:e,asList:t}){let{store:n,principal:a}=e;le(n);let r=pt(),o=rt(),[i]=We(),l=decodeURIComponent(r.as??""),[s,d]=(0,st.useState)(null),c=i.get("of"),y=i.get("filter"),g=He(e),u=t??g.find(M=>M.as===l&&(!c||Y(n.schema,M.kind)===c));if(!u)return(0,E.jsxs)(ue,{context:e,children:[(0,E.jsx)(ce,{context:e,children:"No picture is called that."}),(0,E.jsx)("p",{style:ge,children:(0,E.jsx)($,{to:"/places",style:Ke,children:(0,E.jsx)(ot,{children:"The pictures there are"})})})]});let P=ne(n,u.kind),f=Ps(n,It(e,u),y),S=f.filter,T=e.views?.resolve(u.kind,{cardinality:"many",fidelity:"full"},u.as)?.view,x=T?.flows===!0,b=T?.ownHeading===!0,K=at(T),q=T?.creates!==!1,I=Is(e,T?.lede),re=yt(T)&&e.views?.lookup(u.kind,{cardinality:"many",fidelity:"full"})===T,oe=bt(n,u.kind,{...a?{principal:a}:{},...e.invariantContext?{context:e.invariantContext}:{}}),N=q?oe.actions.affordances.map(M=>({affordance:M,mutation:n.allMutations().find(ee=>ee.name===M.mutation)})).filter(M=>M.mutation!==void 0):[];return(0,E.jsxs)(ue,{context:e,style:{...Ft,gap:"var(--graview-space-6, 32px)"},spans:K,...K&&b?{bleedTop:"full"}:{},children:[(0,E.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,E.jsx)(St,{context:e}),(0,E.jsx)(ce,{context:e,unseen:b,children:t?P:u.title}),b?null:(0,E.jsx)("p",{style:Hs,"data-testid":"place-lede",...I!==void 0?{"data-graview-lede":"headline"}:{},children:I??`${Ra(n,It(e,u),u.across)}.`}),y&&!x&&f.dropped.length>0?(0,E.jsxs)("p",{style:{...L,margin:0},"data-testid":"place-dropped",children:["This link asked for ",f.dropped.join(", "),", which ",P.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,f.said.length>0&&!x?(0,E.jsxs)("p",{style:{...L,margin:0},"data-testid":"place-narrowed",children:[`Only those ${f.said.join(" and ")}. `,(0,E.jsx)($,{to:`?${(()=>{let M=new URLSearchParams(i);return M.delete("filter"),M.toString()})()}`,style:{...Q,...L},children:"Show all"})]}):null,b?null:(0,E.jsx)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:It(e,u).filter(M=>!(re&&M===u.kind)).map((M,ee)=>(0,E.jsx)($,{to:`/${Y(n.schema,M)}${e.views?.arrangement?.()?.lists?.[M]?.opens!==void 0?`?drawn=${Wt}${S&&M===u.kind?`&filter=${encodeURIComponent(S)}`:""}`:S&&M===u.kind?`?filter=${encodeURIComponent(S)}`:""}`,style:{...Ke,...L},...ee===0?{"data-testid":"place-as-list"}:{},children:(0,E.jsxs)(ot,{children:["All ",(M===u.kind?P:ne(n,M)).toLowerCase()," as a list"]})},M))})]}),(0,E.jsx)(it,{when:K,full:K,children:(0,E.jsx)("div",{"data-testid":"place-lens","data-flows":x?"":void 0,...x?{}:{role:"group","aria-label":u.title,tabIndex:0},style:x?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:M=>{let ee=M.target?.closest("[data-graview-pick]"),ie=ee?.getAttribute("data-graview-pick"),de=ee?.getAttribute("data-graview-joins");if(de)try{let V=JSON.parse(de);if(Array.isArray(V)&&V.every(ve=>typeof ve=="string")){M.preventDefault(),d({at:kt(u),ids:V});return}}catch{}if(!ie)return;let Pe=n.graph.getNode(ie);Pe&&(M.preventDefault(),o(te(n.schema,Pe.kind,ie)))},children:(0,E.jsx)($o.Provider,{value:I!==void 0?$s:Fs,children:(0,E.jsx)(La,{context:e,place:u,filter:S,bled:K,...s?.at===kt(u)?{chosen:s.ids}:{}})})})}),N.length>0?(0,E.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:N.map(({affordance:M,mutation:ee})=>(0,E.jsxs)("section",{style:{...me,display:"grid",gap:14},children:[(0,E.jsx)("h2",{style:pe,children:ee.title??ee.name}),ee.description?(0,E.jsx)("p",{style:{...L,margin:0,maxWidth:"58ch"},children:ee.description}):null,(0,E.jsx)($e,{store:n,mutation:ee,prefilled:M.args,open:M.open,label:M.label,...a?{principal:a}:{}})]},M.id))}):null]})}function Ds(e,t=document){let n=Tn(e);if(!n)return null;let a=[t,...[...t.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let o of r.querySelectorAll("[id], [data-section]")){let i=o.getAttribute("data-section")??o.id;if(i===e||Tn(i)===n)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(Tn(o.textContent??"")===n)return o;return null}function fi(e,t={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=t.frames??120,a=0,r=()=>{let o=Ds(e,t.root??document);if(o){o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.scrollIntoView?.({block:"start"}),o.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var _=O(Ae(),1);var Dn=O(Ae(),1);var xt=O(j(),1);function mi({context:e}){return we()?(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)(Ws,{context:e}),(0,xt.jsx)(Do,{face:"pages",on:e.quickAsk??!0})]}):null}function Ws({context:e}){let{store:t}=e,n=we(),{pathname:a}=Ce(),r=(0,Dn.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,Dn.useEffect)(()=>{let o=r.current;if(!o)return;let[,i,l]=a.split("/"),s=(()=>{if(i==="places"){let c=e.views?.places().find(y=>y.as===decodeURIComponent(l??""));return c?[Je(c.kind)]:[]}let d=i?Ee(t.schema,i):void 0;return d&&l?[decodeURIComponent(l)]:d?[Pr(d)]:[]})();o(d=>d.length===s.length&&d.every((c,y)=>c===s[y])?d:s)},[a]),null}var Me=O(Ae(),1);var hi=O(us(),1);var xe=O(j(),1);var Bs=mn(xr(()=>(__graviewPreload(import.meta.url,["./chunk.F5756PXX.js","./chunk.Q355UPFG.js","./chunk.3ZP6IDUC.js","./chunk.BQWMHHAZ.js","./chunk.2QALBEWP.js","./chunk.QQUZ5RTQ.js","./chunk.BJ3G7J2Z.js","./chunk.DIVANC3G.js","./chunk.KP7HUXH5.js","./chunk.4BSEYZMS.js","./chunk.KV3N6VRG.js","./chunk.FUTSLXWN.js","./chunk.MZSWWMX6.js","./chunk.MB7LKKUD.js","./chunk.6KYTCEIH.js","./chunk.FXCKKVT5.js","./chunk.NCBUECIW.js","./chunk.2T24FYAO.js","./chunk.JEQ6CA5M.js","./chunk.CM7EDQ4E.js","./chunk.SUYYDJGZ.js","./chunk.YR7DKU5T.js","./chunk.WVUJXDXZ.js","./chunk.IRPMGHZN.js","./chunk.7QWGIGHM.js","./chunk.HRLCDBMO.js","./chunk.LZNHTROY.js","./chunk.36FKQJFM.js","./chunk.RHV73CBA.js","./chunk.MIE4TJRW.js","./chunk.RP6C2IUM.js","./chunk.RD2FSSLV.js","./chunk.T552MHMU.js","./chunk.ZGJUCVT5.js","./chunk.CVVNHQPO.js","./chunk.YIDNZTON.js","./chunk.QILGAV7H.js","./chunk.I6HIVTXU.js","./chunk.PYGNO2AV.js","./chunk.3HFBHLXC.js","./chunk.CUA7F3YJ.js","./chunk.SDO3U72B.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FJXKQZZS.js")).then(e=>({default:e.TakeBack}))));function Ks({context:e,docked:t,at:n,...a}){let{store:r}=e,o=le(r),[i]=(0,Me.useState)(()=>r.batches().length),l=(0,Me.useRef)(!1);return l.current||=o>0||!t&&i>0,l.current?(0,xe.jsx)(Me.Suspense,{fallback:null,children:(0,xe.jsx)(Bs,{context:e,docked:t,at:n,since:i,...a})}):null}function Gs(e,t,n){let{store:a,principal:r,embedded:o}=e;(0,Me.useEffect)(()=>{if(!n)return;let i=l=>{if(!zo(l))return;let s=l.target,d=s instanceof Node&&t.current?.contains(s),c=s===document.body||s===document.documentElement||s===document;if(!(!d&&!(c&&!o))&&Vo(a,r)){l.preventDefault();try{_o(a,r)}catch{}}};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[a,r,o,t,n])}function wi({context:e,registry:t,root:n,children:a}){let r=(0,Me.useMemo)(ai,[]),o=t?.without()??new Set;return Gs(e,n,!o.has("undo")),(0,xe.jsxs)(Qt.Provider,{value:r,children:[(0,xe.jsx)(qs,{context:e,placed:r,without:o}),a]})}function qs({context:e,placed:t,without:n}){let[a,r]=(0,Me.useState)(!1);(0,Me.useLayoutEffect)(()=>r(!0),[]);let o=Xt(t,"find"),i=Xt(t,"undo"),l=Ce(),s=bo();if(!a)return null;let d=l.pathname.split("/").filter(Boolean),y=(d.length===1?Ee(e.store.schema,d[0]):void 0)!==void 0;return(0,xe.jsxs)(xe.Fragment,{children:[!o&&!n.has("find")&&s?(0,hi.createPortal)((0,xe.jsx)(yi,{context:e,narrowsLists:y}),s.slot):null,!o&&!n.has("find")&&!s?(0,xe.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,xe.jsx)(yi,{context:e,narrowsLists:y})}):null,!i&&!n.has("undo")?(0,xe.jsx)(Ks,{context:e,docked:!0,at:l.pathname+l.search}):null,s?.own&&!n.has("undo")?(0,xe.jsx)(ni,{context:e,own:s.own}):null]})}function yi({context:e,narrowsLists:t}){return(0,xe.jsx)(Qt.Provider,{value:null,children:(0,xe.jsx)(Aa,{context:e,narrowsLists:t})})}var X=O(Ae(),1);var Re=O(j(),1),js=500,Us=10;function tn(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Vs(e){let t=typeof getSelection=="function"?getSelection():null;if(t===null||t.isCollapsed)return!1;for(let n=0;n<t.rangeCount;n++)if(t.getRangeAt(n).intersectsNode(e))return!0;return!1}function vi(e){let t=e.nativeEvent.composedPath?.()[0];return t instanceof Element?t:e.target}function Pi(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}function bi(e,t){for(let n=e;n;n=Pi(n))if(n.hasAttribute(t))return n;return null}var _s='a[href], button, summary, label, input, select, [role="button"], [draggable="true"], [data-graview-pick], [data-graview-listed], [data-graview-record], [data-graview-act], [data-graview-editable], [data-record], [data-act], [data-column]';function zs(e,t,n){for(let a=e;a;a=Pi(a))if(a.matches(_s))return!1;if(typeof getComputedStyle=="function"&&getComputedStyle(e).userSelect==="none")return!1;for(let a of e.childNodes){if(a.nodeType!==Node.TEXT_NODE||!a.nodeValue?.trim())continue;let r=document.createRange();if(r.selectNodeContents(a),typeof r.getClientRects!="function")return!1;for(let o of r.getClientRects())if(t>=o.left&&t<=o.right&&n>=o.top&&n<=o.bottom)return!0}return!1}function Js(e){let t=typeof getSelection=="function"?getSelection():null;if(!t||t.isCollapsed||!e||!t.anchorNode||!e.contains(t.anchorNode))return null;let n=t.toString();return n.trim()?n:null}function Si(e,t,n){let a=navigator.clipboard?.writeText?.(e);if(!a)return t(`${n} could not be copied here`);a.then(()=>t(`${n} copied`),()=>t(`${n} could not be copied here`))}function ki(e){let t=e.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(t)return t;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Ai({context:e,root:t,registry:n,children:a}){return we()===null?(0,Re.jsx)(Re.Fragment,{children:a}):(0,Re.jsx)(Qs,{context:e,root:t,registry:n,children:a})}var Ys=(e,t,n=()=>[],a=()=>!0)=>r=>{let o=new URLSearchParams(t);return o.get("drawn")===Wt||$n(o,n(r),a(r))||e?.lookup(r,"list")!==void 0};function Qs({context:e,root:t,registry:n,children:a}){let{setMenuAt:r}=Nr(),{store:o}=e,i=o.schema,l=rt(),{pathname:s,search:d}=Ce(),c=vt("/").replace(/\/$/,""),y=(0,X.useCallback)((h,v)=>e.views?.places().find(A=>A.as===h&&(v===null||A.kind===v)),[e.views]),g=(0,X.useCallback)((h,v)=>{let[A="",m,F]=h.split("/").filter(Boolean).map(z=>{try{return decodeURIComponent(z)}catch{return z}});if(F!==void 0)return null;if(A==="places"&&m!==void 0){let z=y(m,new URLSearchParams(v).get("of"));return z?{face:"pages",place:z.as,about:[Je(z.kind)],title:z.title}:null}let G=Ee(i,A);return G?m===void 0?{face:"pages",about:[Je(G)],title:ct(i,G)}:o.graph.getNode(m)?{face:"pages",on:m,about:[m]}:null:null},[i,o,y]),u=(0,X.useCallback)(h=>{let v=h.href;try{let A=new URL(v,location.href);if(A.origin===location.origin&&(c===""||A.pathname===c||A.pathname.startsWith(`${c}/`))){let m=g(A.pathname.slice(c.length),A.search);if(m)return{...m,href:v}}}catch{}return{face:"pages",about:[],href:v}},[c,g]),P=(0,X.useCallback)(()=>g(s,d)??{face:"pages",about:[]},[g,s,d]),f=(0,X.useCallback)(h=>{let v=P(),A=h.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(A&&v.on!==void 0&&h.closest("[data-graview-pick], a[href]")===null)return{...v,field:A};let m=h.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(m)return{...v,act:m};let F=h.closest("a[href]"),G=h.closest("[data-graview-listed]"),z=[h.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),G&&(!F||G.contains(F)&&F.classList.contains("graview-spec-item-link"))?G.getAttribute("data-graview-listed"):null].map(J=>J?o.graph.getNode(J):void 0).find(Boolean);if(z)return{face:"pages",on:z.id,about:[z.id],href:`${c}${te(i,z.kind,z.id)}`};if(F)return u(F);let ye=h.closest("[data-graview-record]")?.getAttribute("data-graview-record");return ye&&o.graph.getNode(ye)?{face:"pages",on:ye,about:[ye]}:v},[P,u,o,i,c]),S=(0,X.useCallback)((h,v)=>{let A=bi(h,"data-column"),m=A?.getAttribute("data-column")??"",F=m.indexOf(":");if(!A||F<=0||F===m.length-1)return;let G=m.slice(0,F),z=m.slice(F+1),ye=v.place===void 0?void 0:e.views?.places().find(_e=>_e.as===v.place),J=bi(A,"data-column-kind")?.getAttribute("data-column-kind")??ye?.kind??(v.about?.length===1&&v.about[0].startsWith("aggregate:")?xi(v.about[0]):void 0);if(!(J===void 0||!i.tryDefinition(J)))return{kind:J,field:G,value:z,label:A.getAttribute("data-column-label")??dt(z)}},[e.views,i]),T=(0,X.useCallback)(h=>{let v=t.current;if(v===null||!v.contains(h)||tn(h)||h.closest("[data-graview-popover]"))return null;let A=f(h);return{face:"pages",on:A.on,about:A.about??[],field:A.field,place:A.place,href:A.href,act:A.act,column:S(h,A),element:ki(h)}},[f,S,t]),x=(0,X.useRef)(null),b=(0,X.useRef)(null),K=(0,X.useCallback)((h,v,A,m=h,F=!1)=>{if(!F&&(to(m)||eo())){let he=()=>K(h,v,A,m,!0);Xr().then(he,he);return}let G=f(h),z=S(m,G),ye=Zr(m);b.current=Js(t.current);let J=P(),_e={...G,...z?{column:z}:{},...ye?{section:ye,title:ye.name}:{page:{on:J.on,about:J.about,place:J.place,home:s==="/",at:m}},x:Math.round(v),y:Math.round(A),returnTo:ki(h)};x.current=_e,r(_e)},[f,P,S,r,t,s]),[q,I]=(0,X.useState)(null);(0,X.useEffect)(()=>{if(!q)return;let h=setTimeout(()=>I(null),2400);return()=>clearTimeout(h)},[q]);let re=(0,X.useCallback)(h=>I({sentence:h,at:Date.now()}),[]),oe=(0,X.useCallback)(h=>{let v=h.getBoundingClientRect();K(h,v.left+Math.min(16,v.width/2),Math.min(v.bottom,v.top+36))},[K]),N=(0,X.useRef)(0),M=(0,X.useRef)(null),ee=(0,X.useRef)(null),ie=(0,X.useRef)(!1),de=()=>{M.current&&clearTimeout(M.current.timer),M.current=null};(0,X.useEffect)(()=>de,[]),(0,X.useEffect)(()=>{let h=v=>{if(v.defaultPrevented||!(v.key==="ContextMenu"||v.key==="F10"&&v.shiftKey))return;let A=t.current,m=v.target instanceof Element?v.target:null,F=m===null||m===document.body||m===document.documentElement,G=A!==null&&m!==null&&A.contains(m);if(!G&&!(F&&document.querySelector("[data-graview-face='pages']")===A)||tn(m)||m?.closest("[data-graview-popover]"))return;v.preventDefault(),N.current=Date.now();let z=G&&m instanceof HTMLElement?m:A?.querySelector("[data-graview-page-title], main h1, main")??null;z&&oe(z)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[t,oe]),(0,X.useEffect)(()=>{let h=t.current;if(!h)return;let v=A=>{let m=A.detail;m&&r({...m,face:"pages"})};return h.addEventListener(pa,v),()=>h.removeEventListener(pa,v)},[t,r]);let Pe=(0,X.useMemo)(()=>h=>{if(h.face!=="pages")return null;let v=[],A=h.on===void 0?void 0:o.graph.getNode(h.on),m=h.place===void 0?void 0:e.views?.places().find(he=>he.as===h.place),F=A?void 0:h.about.length===1&&h.about[0].startsWith("aggregate:")&&!m?xi(h.about[0]):void 0,G=A?te(i,A.kind,A.id):m?ke(e,m):F?`/${Y(i,F)}`:void 0,z=G!==void 0&&s===G.split("?")[0];G!==void 0&&!z&&v.push({id:"open",label:"Open",run:()=>l(G)});let ye=G!==void 0?`${c}${G}`:h.href;ye!==void 0&&(v.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(ye,"_blank","noopener")}),v.push({id:"copy-link",label:"Copy link",run:()=>Si(new URL(ye,location.href).href,re,"Link")}));let J=h.on===void 0?h.column:void 0;if(J){let he=o.allMutations().find(gt=>gt.creates?.includes(J.kind)&&(dr(gt)?.includes(J.field)??!1));if(he&&x.current){let gt=x.current;v.push({id:"add-in-column",label:`Add ${gn(tt(i.tryDefinition(J.kind),J.kind))} in ${J.label}`,run:()=>r({...gt,begin:{act:he.name,given:{[J.field]:J.value}}})})}let Bt=m?ke(e,m):`/${Y(i,J.kind)}`;v.push({id:"show-only-column",label:`Show only ${J.label}`,run:()=>l(wt(Bt,{filter:`${J.field}:${J.value}`}))})}let _e=A?`#focus=${encodeURIComponent(A.id)}`:m?`#focus=${encodeURIComponent(Je(m.kind))}&view=${encodeURIComponent(m.as)}`:F?`#focus=${encodeURIComponent(Je(F))}`:void 0;if(_e!==void 0&&(e.overview||!e.embedded)){let he=e.overview;v.push({id:"in-the-scene",label:"Show in the scene",run:()=>he?he(_e):location.assign(`${e.sceneHref??"/"}${_e}`)})}return A===void 0&&h.href===void 0&&v.push({id:"find",label:"Find\u2026",run:()=>{let he=t.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');he&&he.offsetParent!==null?he.focus():l("/search")}}),v.length>0?{id:"pages",items:v}:null},[o,i,e,s,c,l,t,re,r]),V=(0,X.useMemo)(()=>h=>{let v=b.current;return h.face!=="pages"||v===null?null:{id:"selection",at:"start",items:[{id:"copy-selection",label:"Copy",run:()=>Si(v,re,"Text")}]}},[re]),ve=(0,X.useMemo)(()=>h=>{if(h.face!=="pages"||h.field===void 0||h.on===void 0)return null;let v=o.graph.getNode(h.on),A=h.element?.closest("[data-graview-field]")??t.current?.querySelector(`[data-graview-field="${CSS.escape(h.field)}"]`);if(!v||!(A instanceof HTMLElement)||!A.hasAttribute("data-graview-editable"))return null;let m=nr(i.tryDefinition(v.kind),h.field),F=()=>{let G=A.matches("select")?A:A.getAttribute("role")==="group"?A.querySelector('button[aria-pressed="true"], button'):null;if(G)return G.focus();A.click(),A.getAttribute("role")==="switch"&&A.focus()};return{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${m}\u201D`,run:F}]}},[o,i,t]),qe=Bo(),je=lo(),Le=Co(),Ue=(0,X.useCallback)((h,v)=>{s===ke(e,h).split("?")[0]&&l(v?ke(e,v):"/")},[s,e,l]),Ze=Go(Ue),Ve=qo(),et=jo(Ys(n,d,h=>Xe(o).relations.filter(v=>v.from===h||v.to===h).map(v=>v.edgeKind),h=>Fn(e,h)?.flows??!0)),Ct=(0,X.useMemo)(()=>[V,ve,Le,Pe,...Ze?[Ze]:[],...je?[je]:[],...Ve?[Ve]:[],...et?[et]:[],...qe?[qe]:[]],[V,ve,Le,Pe,Ze,je,Ve,qe]);return(0,Re.jsxs)(Qr,{sections:Ct,children:[(0,Re.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:h=>{let v=h.target,A=ee.current;ee.current=null,A!==null&&!A.had&&Date.now()-A.at<2e3&&!h.shiftKey&&!h.altKey&&!tn(v)&&getSelection()?.removeAllRanges(),!(h.shiftKey||h.altKey||tn(v)||Vs(v))&&(h.preventDefault(),!v.closest("[data-graview-popover]")&&(Date.now()-N.current<700||(h.clientX===0&&h.clientY===0&&v instanceof HTMLElement?oe(v):K(v,h.clientX,h.clientY,vi(h)))))},onMouseDownCapture:h=>{if(h.button!==2)return;let v=typeof getSelection=="function"?getSelection():null;ee.current={at:Date.now(),had:v!==null&&!v.isCollapsed}},onPointerDown:h=>{if(ie.current=!1,h.pointerType==="mouse"||!h.isPrimary)return;let v=h.target,A=vi(h);if(tn(v)||v.closest("[data-graview-choose], [data-graview-popover]"))return;let{clientX:m,clientY:F}=h;zs(A,m,F)||(de(),M.current={x:m,y:F,timer:setTimeout(()=>{M.current=null,ie.current=!0,N.current=Date.now(),K(v,m,F,A)},js)})},onPointerMove:h=>{let v=M.current;v&&Math.hypot(h.clientX-v.x,h.clientY-v.y)>Us&&de()},onPointerUp:de,onPointerCancel:de,onClickCapture:h=>{ie.current&&(ie.current=!1,h.preventDefault(),h.stopPropagation())},children:a}),(0,Re.jsx)(el,{openAt:oe,readyAt:T}),(0,Re.jsx)(Ko,{placement:"page"}),(0,Re.jsx)(co,{}),(0,Re.jsx)(Uo,{}),(0,Re.jsx)("p",{role:"status","data-testid":"menu-said",style:q?Xs:Zs,children:q?.sentence??""})]})}var Xs={position:"fixed",left:"50%",bottom:24,transform:"translateX(-50%)",margin:0,padding:"6px 12px",borderRadius:8,fontSize:"0.875rem",background:"var(--graview-panel)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)",boxShadow:"var(--graview-lift-low)",zIndex:fr("toast"),pointerEvents:"none"},Zs={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function xi(e){let t=e.slice(10).split("+");return t.length===1&&t[0]?t[0]:void 0}function el({openAt:e,readyAt:t}){return(0,Re.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Re.jsx)(Io,{placement:"menu",openActs:e,aimAt:t})})}var U=O(j(),1);function Ci(e,t){return t==="*"?{label:"anything",path:null}:{label:ne(e,t),path:`/${Y(e.schema,t)}`}}function tl({context:e,relation:t}){let{store:n}=e,a=Ci(n,t.from),r=Ci(n,t.to),o=i=>i.path?(0,U.jsx)($,{to:i.path,style:{...Te,fontWeight:550},children:i.label}):(0,U.jsx)("span",{children:i.label});return(0,U.jsxs)("li",{"data-testid":"relation","data-relation":t.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,U.jsx)(Wo,{edgeKind:t.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,U.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,U.jsxs)("span",{children:[o(a)," ",(0,U.jsxs)("span",{style:L,"data-graview-speaks-ids":"",children:[dt(t.edgeKind)," \u2192"]})," ",o(r)]}),t.description||t.inverse?(0,U.jsxs)("span",{style:L,children:[t.description?Qe(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),r.path?(0,U.jsx)($,{to:`${r.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{...Q,...L,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:t.count}):(0,U.jsx)("span",{style:{...L,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function Ri({context:e,heading:t=!0}){let{store:n}=e,a=new Set(Ye(n,e.principal)),r=Xe(n).relations.filter(o=>a.has(o.from)&&(o.to==="*"||a.has(o.to)));return r.length===0?null:(0,U.jsxs)("section",{style:{...me,display:"grid",gap:12},"data-testid":"kind-map",children:[t?(0,U.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,U.jsx)("h2",{style:pe,children:(0,U.jsx)($,{to:"/map",style:Te,children:"Connections"})}),(0,U.jsx)("span",{style:L,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,U.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(o=>(0,U.jsx)(tl,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function Ma({context:e}){let{store:t}=e;le(t);let n=new Set(Ye(t,e.principal)),a=Xe(t),r=a.relations.filter(o=>n.has(o.from));return(0,U.jsxs)(ue,{context:e,children:[(0,U.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,U.jsx)("p",{style:Be,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,U.jsx)(ce,{context:e,children:"Connections"}),(0,U.jsx)("p",{style:ge,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,U.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(o=>n.has(o.kind)).map(o=>(0,U.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,U.jsx)(Se,{kind:o.kind,brand:e.brand,schema:t.schema,size:7}),(0,U.jsx)($,{to:`/${Y(t.schema,o.kind)}`,style:Q,children:o.plural}),(0,U.jsx)("span",{style:L,children:o.count})]},o.kind))}),(0,U.jsx)(Ri,{context:e,heading:!1})]})}function Li({context:e}){let n=[...we()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=e;return(0,U.jsxs)("section",{style:{...me,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,U.jsx)("h2",{style:pe,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,U.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let o=r.at?a.graph.getNode(r.at):void 0;return(0,U.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,U.jsx)("span",{children:r.say}),o?(0,U.jsxs)($,{to:te(a.schema,o.kind,o.id),style:{...Q,...L},children:[se(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}function Ei(e){let t=new Set(e.schema.kinds);return(Array.isArray(e.purpose?.jobs)?e.purpose.jobs:[]).flatMap(a=>{if(typeof a!="object"||a===null||typeof a.name!="string"||typeof a.ask!="string"||!t.has(a.kind))return[];let r=sa(a.sort);return[{name:a.name,ask:a.ask,kind:a.kind,plural:tr(e.schema,a.kind),...a.where!==void 0?{where:a.where}:{},...r?{sort:r}:{},...a.act!==void 0?{act:a.act}:{},...a.roles&&a.roles.length>0?{roles:[...a.roles]}:{}}]})}function Mi(e,t){return e.filter(n=>po(n,t.roles))}var Wn=new Map;function Ti(e){if(!Wn.has(e))try{Wn.set(e,kr(e))}catch(t){if(!(t instanceof Sr))throw t;Wn.set(e,null)}return Wn.get(e)}var nl=e=>e instanceof da?e.nodes.length>0:Array.isArray(e)?e.length>0:!!e,al=(e,t)=>t instanceof da?t.nodes.length:t!==null&&typeof t=="object"&&!Array.isArray(t)?se(e.tryDefinition(t.kind),t):t;function Ni(e,t,n){let a=e;if(a.kindsKeptFrom(n).has(t.kind)||!a.schema.tryDefinition(t.kind))return{count:0,ids:[]};let r=a.seenBy(n),o=r.graph,i=r.schema,l=Jr(i),s=r.today?.(),d=(S,T)=>br(S,{graph:o,subject:T,kinds:l,...s?{today:s}:{}}),c=t.where===void 0?void 0:Ti(t.where);if(c===null)return{count:0,ids:[]};let y=o.nodesOfKind(t.kind).filter(S=>{if(!c)return!0;try{return nl(d(c,S))}catch(T){if(!(T instanceof ca))throw T;return!1}}),g=sa(t.sort),u=g&&g.by!=="label"?Ti(g.by):void 0,f=(g?ur(y,g,S=>{if(g.by==="label")return se(i.tryDefinition(S.kind),S);if(u)try{return al(i,d(u,S))}catch(T){if(!(T instanceof ca))throw T;return}}):y).map(S=>S.id);return{count:f.length,ids:f}}var Bn=O(Ae(),1);var ae=O(j(),1),rl=5,ol=3,$i={kind:"human"};function Fi(e){if(!e.app)return[];let t=e.principal??$i;return Mi(Ei(e.app),t).map(n=>({job:n,...Ni(e.store,n,t)}))}function Hi({context:e,answered:t}){let n=t.filter(i=>i.count>0),a=t.filter(i=>i.count===0),[r,...o]=n;return(0,ae.jsxs)("div",{style:{display:"grid",gap:40,maxWidth:"46rem",outline:"none"},"data-testid":"jobs",tabIndex:-1,children:[(0,ae.jsx)("style",{children:Ht}),r?(0,ae.jsx)(Oi,{context:e,answered:r,leads:!0}):null,o.map(i=>(0,ae.jsx)(Oi,{context:e,answered:i},i.job.name)),a.length>0?(0,ae.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"jobs-quiet",children:a.map(({job:i})=>(0,ae.jsxs)("li",{"data-testid":"job-quiet","data-job":i.name,style:{overflowWrap:"anywhere"},children:[i.ask," ",(0,ae.jsxs)("span",{style:L,children:["No ",ne(e.store,i.kind).toLowerCase()," right now."]})]},i.name))}):null]})}function Oi({context:e,answered:t,leads:n=!1}){let{store:a}=e,{job:r,count:o,ids:i}=t,l=i.slice(0,n?rl:ol),s=ne(a,r.kind),d=n?(0,ae.jsx)(ce,{context:e,"data-testid":"job-ask",children:r.ask}):(0,ae.jsx)("h2",{style:pe,"data-testid":"job-ask",children:r.ask});return(0,ae.jsxs)("section",{className:"graview-list",style:{display:"grid",gap:n?12:8,minWidth:0},"data-testid":"job","data-job":r.name,...n?{"data-leads":""}:{},children:[(0,ae.jsxs)("header",{style:{display:"grid",gap:4},children:[d,(0,ae.jsx)("p",{style:{...n?ge:L,margin:0},"data-testid":"job-count",children:Tt(a.schema,r.kind,o)})]}),(0,ae.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",borderBottom:"1px solid var(--graview-edge)"},"data-testid":"job-rows",children:l.map(c=>(0,ae.jsx)(il,{context:e,job:r,id:c},c))}),(0,ae.jsxs)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",gap:"0 12px",alignItems:"baseline"},children:[o>l.length?(0,ae.jsxs)("span",{"data-testid":"job-more",children:[o-l.length," more"]}):null,(0,ae.jsx)($,{to:`/${Y(a.schema,r.kind)}`,style:Ke,"data-testid":"job-all",children:(0,ae.jsxs)(ot,{children:["All ",s.toLowerCase()]})})]})]})}function il({context:e,job:t,id:n}){let{store:a,principal:r,invariantContext:o}=e,[i,l]=(0,Bn.useState)(!1),s=(0,Bn.useRef)(null),d=a.seenBy(r??$i).graph.getNode(n);if(!d)return null;let c=a.schema.tryDefinition(d.kind),y=se(c,d),g=Jt(d,c,y),u=t.act?On(a,n,{...r?{principal:r}:{},...o?{context:o}:{}})?.actions.affordances.find(S=>S.mutation===t.act&&S.provider!=="invariant"):void 0,P=u?a.allMutations().find(S=>S.name===u.mutation):void 0,f=`job-${t.name}-${n}`;return(0,ae.jsxs)("li",{ref:s,"data-testid":"job-row","data-graview-record":n,style:{position:"relative",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"center",gap:"8px 12px",minHeight:"2.75rem",padding:"8px 0",borderTop:"1px solid var(--graview-edge)"},children:[(0,ae.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,ae.jsx)($,{to:te(a.schema,d.kind,n),className:"graview-row-title",...y.length>60?{title:y}:{},children:y}),g.length>0?(0,ae.jsx)("span",{className:"graview-row-glance",children:(0,ae.jsx)(Yt,{runs:g})}):null]}),u&&P?(0,ae.jsx)("button",{type:"button","data-testid":"job-act","data-graview-act":u.mutation,"aria-expanded":i,"aria-controls":f,"aria-label":`${u.label}: ${y}`,onClick:()=>l(!i),style:{...Oe,position:"relative",...i?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:u.label}):null,i&&u&&P?(0,ae.jsx)("div",{id:f,style:{gridColumn:"1 / -1",position:"relative",display:"grid",gap:10,padding:"4px 0 8px"},children:(0,ae.jsx)($e,{store:a,mutation:P,prefilled:u.args,open:u.open,label:u.label,autoFocus:!0,onDone:()=>{let S=s.current?.closest('[data-testid="jobs"]');l(!1),requestAnimationFrame(()=>{((s.current?.isConnected?s.current.querySelector('[data-testid="job-act"]'):null)??S?.querySelector('[data-testid="job-act"]')??S)?.focus()})},...r?{principal:r}:{}})}):null]})}var D=O(j(),1);function sl({violations:e}){let t=e.some(n=>n.status==="could-not-judge"||n.status==="over-budget");return(0,D.jsxs)($,{to:"/problems","data-testid":"problems-here","data-graview-problems-tone":t?"error":"rule",style:{...Q,color:t?"var(--graview-warn)":"var(--graview-ink-muted)"},children:[e.length===1?"A rule is broken":"Rules are broken"," \u2014 see what, and what would fix it"]})}function ll(e,t=5){let n=[],a=0;for(let r=e.length-1;r>=0;r--){let o=e[r];if(Et(o))a++;else if(n.length<t)n.push(o);else break}return{recent:n,kept:a}}function Na({context:e}){let{principal:t}=e,{store:n,brand:a,invariantContext:r}=e;le(n);let o=We()[0].get("drawn")==="built-in",i=n.violations(r),{recent:l,kept:s}=ll(n.log.all()),c=Mn(e).map(N=>({kind:N,members:n.graph.nodesOfKind(N).filter(M=>mt(n.schema.tryDefinition(N),M))})),y=c.filter(N=>N.members.length>0),g=c.map(N=>({entry:N,creator:n.allMutations().find(M=>(M.creates??[]).includes(N.kind)&&n.permits({name:M.name,args:{}},e.principal).ok)})).find(N=>N.creator!==void 0),u=y.length===0?"Nothing here yet.":`${y.map(N=>Tt(n.schema,N.kind,N.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,P=e.views?.homes?.().at(-1)?.name!==void 0,f=o&&P?void 0:e.views?.homeView?.(),S=n.schema.kinds.some(N=>n.graph.nodesOfKind(N).length>0);if(f&&S){let N=[...new Set(i.flatMap(de=>de.nodeIds))],M=at(f),ee=a?.subtitle&&a.subtitleDrawn!==!1?(0,D.jsx)("p",{style:{...L,margin:0},"data-testid":"app-subtitle",...M?{"data-graview-line-over-view":""}:{},children:a.subtitle}):null,ie=f[Symbol.for("graview.home-blocks")]===!0;return(0,D.jsx)(ue,{context:e,style:Ft,bleedTop:M?"full":nt(f),spans:M,children:(0,D.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[ie?null:ee,(0,D.jsx)(Oo.Provider,{value:ie?ee:null,children:(0,D.jsx)(it,{when:nt(f),full:M,children:(0,D.jsx)(f,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1,...N.length>0?{flagged:N}:{}})})}),P?(0,D.jsx)("p",{style:{...L,margin:0},"data-testid":"home-original",children:(0,D.jsx)($,{to:"/?drawn=built-in",style:{color:"inherit"},"data-testid":"built-in-home","aria-label":"The original home page",children:"Original"})}):null]})})}let T=new Set(Ye(n,e.principal)),x=Xe(n).relations.filter(N=>T.has(N.from)&&(N.to==="*"||T.has(N.to))),b=Fi(e),K=b.some(N=>N.count>0),q=new Set([...ui(e),...b.flatMap(N=>N.ids)]),I=i.filter(N=>N.nodeIds.some(M=>q.has(M))),oe=y.length===0&&g!==void 0||I.length>0||i.length===0&&!K;return(0,D.jsxs)(ue,{context:e,style:Ft,children:[(0,D.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,D.jsx)("p",{style:{...L,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,K?null:(0,D.jsx)(ce,{context:e,"data-testid":"standing",children:u}),oe?(0,D.jsxs)("p",{style:{...ge,display:"grid",gap:4},"data-testid":"standing-card",children:[y.length===0&&g?(0,D.jsxs)("span",{children:["Begin with \u201C",g.creator?.title??g.creator?.name,"\u201D, under"," ",(0,D.jsx)($,{to:`/${Y(n.schema,g.entry.kind)}`,style:Q,children:ne(n,g.entry.kind)}),"."]}):null,i.length===0?(0,D.jsx)("span",{children:"All rules hold."}):I.length>0?(0,D.jsx)(sl,{violations:I}):null]}):null]}),b.length>0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Hi,{context:e,answered:b}),(0,D.jsxs)("section",{style:{display:"grid",gap:20},"data-testid":"after-the-jobs",children:[K?(0,D.jsxs)("p",{style:{...L,margin:0},"data-testid":"standing",children:[u,i.length===0?" All rules hold.":""]}):null,(0,D.jsx)(In,{context:e,small:!0})]})]}):(0,D.jsx)(In,{context:e}),(0,D.jsxs)("section",{style:{...me,display:"grid",gap:14},"data-testid":"kinds",children:[(0,D.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,D.jsx)("h2",{style:pe,children:"What is here"}),x.length>0?(0,D.jsx)($,{to:"/map",style:{...Ke,...L,marginLeft:"auto"},"data-testid":"map-link",children:(0,D.jsxs)(ot,{children:["Connections \xB7 ",x.length===1?"1 relation":`${x.length} relations`]})}):null]}),(0,D.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:N,members:M})=>(0,D.jsx)("li",{style:{maxWidth:"100%"},children:(0,D.jsxs)($,{to:`/${Y(n.schema,N)}`,style:{...Te,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,D.jsx)(Se,{kind:N,brand:a,schema:n.schema,size:7}),(0,D.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:ne(n,N)}),(0,D.jsx)("span",{style:{...L,fontVariantNumeric:"tabular-nums"},children:M.length===0?"none yet":Lt(M.length)})]})},N))})]}),l.length>0||s>0?(0,D.jsxs)("section",{style:{...me,display:"grid",gap:10},"data-testid":"recently",children:[(0,D.jsx)("h2",{style:pe,children:"Recently"}),l.length>0?(0,D.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(N=>(0,D.jsxs)("li",{style:L,"data-testid":"recently-row",children:[(0,D.jsx)("span",{style:{color:"var(--graview-ink)"},children:N.intent})," \u2014 ",zt(N,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},N.id))}):null,s>0?(0,D.jsxs)("p",{style:{...L,margin:0},"data-testid":"recently-kept",children:[l.length>0?"and ":"",s===1?"1 change":`${Lt(s)} changes`," kept from you"]}):null]}):null]})}var Ii=O(Ae(),1);function Di(e,t){(0,Ii.useEffect)(()=>{let n=globalThis[Symbol.for("graview.shown-lists")]??=new Map;return n.set(e,()=>t),()=>void n.delete(e)})}var Oa=e=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(t=>t.saveShownList(e.read()));function Wi(e,t,n){let a={off:e,about:t,read:n,menu:(r,o,i)=>[...e?[]:[{id:"export-csv",label:"Export CSV",run:()=>void Oa(a)}],...r&&o?[{id:e?"export-on":"export-off",label:e?"Turn on export":"Turn off export",run:()=>void (__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(l=>l.switchExport(a,o,e,i))}]:[]]};return a}function $a(e){let{schema:t,graph:n,kind:a,nodes:r,arrangement:o,offers:i,declaredGroup:l}=e,s=t.tryDefinition(a),d=kn(o.query??""),c=[...o.filter??[],...d.conditions],y=c.some(I=>I.key==="is"&&(I.value==="past"||I.value==="any"))||yo(s,c),g=y||!s?.lifecycle?o:{...o,filter:[...o.filter??[],{key:"is",value:"current"}]},u=new Map,P=An(r,g,{schema:t,graph:n,...e.flagged?{flagged:e.flagged}:{},...e.today!==void 0?{today:e.today}:{},read:(I,re)=>{let oe=u.get(I.id);return oe||u.set(I.id,oe=ht(t,n,I)),oe[re]}}),f=P.grouped&&!!o.group?.by,S=l&&o.group?.by===l.by&&!o.group.bucket?i.groups.find(I=>I.key===l.by):void 0,T=l&&S&&(S.type==="choice"||S.type==="boolean")?mo(P.groups,l,{type:S.type,...S.options?{options:S.options}:{}}):P.groups.map(I=>({...I,closed:!1})),x=!!o.query||(o.filter??[]).some(I=>I.key===l?.by),b=I=>S?.type==="boolean"?I==="1"?"true":"false":I,K=e.opened??new Set,q=T.map(I=>{let re=b(I.key);return{...I,value:re,shut:I.closed&&!x&&!K.has(re)}});return{arrangement:g,showingPast:y,arranged:P,grouped:f,groups:q,nodes:f?q.flatMap(I=>I.shut?[]:I.nodes):P.nodes}}var Ie=O(Ae(),1);var Pt=O(j(),1);function Kn({context:e,withheld:t,style:n,testId:a}){let r=we(),o=pr(t,e.signIn??r?.signIn);return o?(0,Pt.jsx)("p",{style:{...n,margin:0},children:(0,Pt.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:Oe,children:o.label})}):t.length===0?null:(0,Pt.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:t.map(i=>(0,Pt.jsxs)("li",{style:L,children:[(0,Pt.jsx)("s",{children:i.label})," \u2014 ",i.refusal.message]},i.id))})}var Bi=O(Ae(),1);var H=O(j(),1);function Fa({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;le(t);let[o]=We(),i=o.get("q")??"",l=typeof r?.today=="string"?r.today:void 0,s=ko(t,i,{...a?{principal:a}:{},places:He(e).filter(f=>!f.hidden),flagged:new Set(t.violations(r).flatMap(f=>f.nodeIds)),...l?{today:l}:{},limit:200}),d=s.hits.filter(f=>f.about==="node"),c=s.hits.filter(f=>f.about==="kind"||f.about==="place"||f.about==="rule"),y=[...new Set(d.map(f=>f.kind))],g=i.trim(),u=g.length>=2&&s.hits.length===0,P=s.searched.kinds.length===1?s.searched.kinds[0]:void 0;return(0,Bi.useEffect)(()=>{if(!u)return;let f=setTimeout(()=>mr(t,{type:"search-miss",words:g,...P?{kind:P}:{}},a),dl);return()=>clearTimeout(f)},[t,g,u,P,a]),(0,H.jsxs)(ue,{context:e,children:[(0,H.jsx)("style",{children:Ht}),(0,H.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,H.jsx)("p",{style:Be,children:"Search"}),(0,H.jsx)(ce,{context:e,"data-testid":"search-heading",children:g.length===0?"Find anything by its name":s.hits.length===0?(0,H.jsxs)(H.Fragment,{children:["Nothing here is called \u201C",g,"\u201D."]}):(0,H.jsxs)(H.Fragment,{children:[cl(t,s.byKind)," for \u201C",g,"\u201D"]})}),g.length>0?(0,H.jsxs)("p",{style:{...L,margin:0},"data-testid":"search-searched",children:[xn(t.schema,s.searched),s.conditions.filter(f=>f.key!=="is"&&f.admittedBy.length<s.searched.kinds.length).map(f=>(0,H.jsxs)("span",{children:[" ",f.key,":",f.value," narrows"," ",f.admittedBy.length===0?"nothing here":f.admittedBy.map(S=>ne(t,S).toLowerCase()).join(" and "),"."]},`${f.key}:${f.value}`))]}):(0,H.jsxs)("p",{style:ge,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,H.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,H.jsx)("code",{children:"is:any"})," includes what is past."]})]}),c.length>0?(0,H.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:c.map(f=>(0,H.jsx)("li",{"data-testid":"search-hit","data-about":f.about,children:f.about==="kind"?(0,H.jsxs)($,{to:`/${Y(t.schema,f.kind)}`,style:Q,children:[f.label,f.count>0?(0,H.jsxs)("span",{style:L,children:[" \xB7 ",f.count," match"]}):null]}):f.about==="place"?(0,H.jsxs)($,{to:ke(e,f),style:Q,children:["Go to ",f.title]}):f.about==="rule"?(0,H.jsxs)($,{to:"/problems",style:Q,children:["The rule \u201C",f.label,"\u201D"]}):null},`${f.about}:${f.about==="rule"?f.name:f.about==="place"?f.as:f.kind}`))}):null,y.map(f=>(0,H.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":f,children:[(0,H.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,H.jsx)(Se,{kind:f,brand:n,schema:t.schema,size:8}),(0,H.jsx)($,{to:`/${Y(t.schema,f)}?${new URLSearchParams({q:g}).toString()}`,style:Q,"data-testid":"search-kind-link",children:ne(t,f)}),(0,H.jsx)("span",{children:s.byKind[f]})]}),(0,H.jsx)("ul",{className:"graview-rows",children:d.filter(S=>S.kind===f).map(S=>(0,H.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,H.jsxs)($,{to:te(t.schema,f,S.id),className:"graview-row-title",...S.label.length>60?{title:S.label}:{},children:[S.flagged?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,S.label]}),S.apart||!S.current?(0,H.jsx)("span",{className:"graview-row-glance",children:[S.apart,S.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,H.jsx)(Gn,{why:S.why})]},S.id))})]},f)),g.length>0?(0,H.jsx)(pl,{asked:g}):null,g.length>0&&s.hits.length===0?(0,H.jsx)(Gi,{store:t,kinds:s.searched.kinds,words:s.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}var dl=1500;function Gn({why:e}){return e.strength==="near"?(0,H.jsxs)("span",{style:L,"data-testid":"search-why","data-near":"",children:["Near \u201C",e.asked,"\u201D",e.field==="label"?"":` \u2014 ${e.reading}: ${e.fragment}`]}):e.field==="label"?null:(0,H.jsxs)("span",{style:L,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function cl(e,t){let n=Object.entries(t).map(([a,r])=>`${r} ${r===1?tt(e.schema.tryDefinition(a),a):ne(e,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Qe(n[0]):Qe(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function Ki(e,t,n={}){let a=[];for(let r of t){let o=bt(e,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let i of qn(e,r,o.actions.affordances))a.some(l=>l.mutation.name===i.mutation.name)||a.push(i)}return a}function qn(e,t,n){let a=e.schema.tryDefinition(t)?.fieldRoles?.label,r=[];for(let o of n){let i=e.allMutations().find(d=>d.name===o.mutation);if(!i||!i.creates?.includes(t)||r.some(d=>d.mutation.name===i.name))continue;let l=uo(i.input).map(d=>d.name),s=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!s||o.args[s]!==void 0||r.push({kind:t,affordance:o,mutation:i,arg:s})}return r}function Gi({store:e,kinds:t,words:n,principal:a,invariantContext:r}){let o=Ki(e,t,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||n.trim().length===0?null:(0,H.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:i,affordance:l,mutation:s,arg:d})=>(0,H.jsxs)("section",{style:{...me,display:"grid",gap:14},children:[(0,H.jsxs)("h2",{style:pe,children:[Qe(gn(tt(e.schema.tryDefinition(i),i)))," called \u201C",n,"\u201D"]}),(0,H.jsx)($e,{store:e,mutation:s,prefilled:l.args,open:l.open,initial:{[d]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function pl({asked:e}){let t=we();return t?(0,H.jsx)(ul,{asked:e,desk:t.aiDesk}):null}function ul({asked:e,desk:t}){return Dr(t)?(0,H.jsx)("p",{style:{margin:0},children:(0,H.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>Ir(t,{pointed:{about:[]},asked:e,returnTo:a.currentTarget}),style:{...Q,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})}):null}var w=O(j(),1),ji=8,Ui=40;function gl(e,t){let n=t?.fields?.shape??{},a=Object.keys(n).find(r=>rr(n[r])&&ar(e[r]));return a===void 0?void 0:e[a]}function Ia({context:e}){let t=pt(),[n]=We(),a=n.get("drawn")===Wt,r=Ee(e.store.schema,t.slug??"");if(!r)return(0,w.jsx)(ue,{context:e,children:(0,w.jsx)(ce,{context:e,children:"No such kind of thing here."})});let o=e.views?.lookup(r,{cardinality:"many",fidelity:"full"}),i=a?void 0:Fn(e,r);if(i){let{place:l,flows:s}=i,d=Xe(e.store).relations.filter(c=>c.from===r||c.to===r).map(c=>c.edgeKind);return $n(n,d,s)?(0,w.jsx)(Ha,{context:e,kind:r}):(0,w.jsx)(en,{context:e,asList:l})}return o!==void 0&&yt(o)&&!a?(0,w.jsx)(fl,{context:e,kind:r,view:o}):(0,w.jsx)(Ha,{context:e,kind:r})}function fl({context:e,kind:t,view:n}){let{store:a,invariantContext:r}=e;le(a);let o=a.schema.tryDefinition(t),i=ne(a,t),l=a.graph.nodesOfKind(t).filter(d=>mt(o,d)),s=[...new Set(a.violations(r).flatMap(d=>d.nodeIds))];return(0,w.jsxs)(ue,{context:e,spans:at(n),children:[(0,w.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,w.jsx)(St,{context:e}),(0,w.jsx)(ce,{context:e,children:i}),(0,w.jsx)("p",{style:{margin:0,color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"kind-original",children:(0,w.jsx)($,{to:`/${Y(a.schema,t)}?drawn=${Wt}`,style:{color:"inherit"},"data-testid":"built-in-list","aria-label":`The original ${i} page`,children:"Original"})})]}),(0,w.jsx)("section",{"data-testid":"list-view",style:{display:"grid",minWidth:0},children:(0,w.jsx)(Vt,{kind:t,view:i,children:(0,w.jsx)(it,{when:nt(n),full:at(n),children:(0,w.jsx)(n,{nodes:l,label:i,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...s.length>0?{flagged:s}:{}})})})})]})}function Ha({context:e,kind:t,opening:n,row:a,layout:r="list",description:o,bare:i}){let{store:l,brand:s,invariantContext:d}=e;le(l);let[c,y]=We(),g=`list-${(0,Ie.useId)().replace(/:/g,"")}`,u=l.schema.tryDefinition(t),P=ir(c.get("archived")),f=l.graph.nodesOfKind(t,{archived:P}),S=Xe(l).relations.filter(p=>p.from===t||p.to===t),T=new Set(l.violations(d).flatMap(p=>p.nodeIds)),x=wo(l.schema,ho(l.schema,Sn(l.schema,t))),b=S.map(p=>p.edgeKind),K=bl(c,x,b),q=["sort","filter","group","q","by","with","past","archived",...b].some(p=>c.has(p)),I=f.length>=Ui,re=u?.fieldRoles?.when,oe=e.views?.arrangement?.()?.lists?.[t],N=fo(oe),M=go(oe?.group),ee=vl(I,re),ie=n??(N?{...ee,...N}:ee),de=q?K.arrangement:ha(ie,x).arrangement,Pe=N?.sort,V=de.sort&&Pe?.then&&de.sort.by===Pe.by&&de.sort.direction===Pe.direction?{...de,sort:Pe}:de,ve=kn(V.query??""),qe=new Set((c.get("open")??"").split(",").filter(Boolean)),je=$a({schema:l.schema,graph:l.graph,kind:t,nodes:f,arrangement:V,offers:x,declaredGroup:M,flagged:T,...typeof d?.today=="string"?{today:d.today}:{},opened:qe}),{showingPast:Le,arranged:Ue}=je,Ze=je.groups,Ve=we(),et=Wi(oe?.export===!1,{kind:t},()=>({title:ne(l,t),schema:l.schema,graph:l.graph,kind:t,groups:je.groups,grouped:je.grouped,onExport:e.onExport??Ve?.onExport,words:{labelOf:se,readableFields:vn,withComputed:ht}}));Di(`list:${t}`,et);let Ct=p=>p.shut,h=p=>{let k=new URLSearchParams(c),W=new Set(qe);W.has(p)?W.delete(p):W.add(p),W.size>0?k.set("open",[...W].join(",")):k.delete("open"),y(k,{replace:!0})},v=Ue.nodes,A=u?.lifecycle&&!Le?f.filter(p=>mt(u,p)):f,m=f.length-A.length,F=V.group?.by??null,G=p=>{let k=new URLSearchParams(c);for(let be of["sort","filter","group","q","by","with","past","archived",...S.map(cn=>cn.edgeKind)])k.delete(be);let W=Pn(p);for(let be of["sort","filter","group","q","archived"])W[be]&&k.set(be,W[be]);![...k.keys()].some(be=>["sort","filter","group","q"].includes(be))&&(n||N||I||re)&&k.set("sort",""),y(k)},{principal:z}=e,ye=bt(l,t,{...z?{principal:z}:{},...e.invariantContext?{context:e.invariantContext}:{}}),J=ye.actions.affordances.map(p=>({affordance:p,mutation:l.allMutations().find(k=>k.name===p.mutation)})).filter(p=>p.mutation!==void 0),_e=ye.actions.withheld,he=()=>new Set(v.length===0?J.map(({mutation:p})=>p.name):[]),[Bt,gt]=(0,Ie.useState)(()=>({kind:t,open:he()}));Bt.kind!==t&>({kind:t,open:he()});let qa=p=>(Bt.kind===t?Bt.open:he()).has(p),ja=(p,k)=>gt(W=>{let be=new Set(W.open);return k?be.add(p):be.delete(p),{kind:W.kind,open:be}}),Ua=`begin-${(0,Ie.useId)().replace(/:/g,"")}`,Va=ve.words&&v.length===0?Object.fromEntries(qn(l,t,ye.actions.affordances).map(p=>[p.mutation.name,p.arg])):{},ft=ne(l,t),rn=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),zn=rn!==void 0&&!Nt(rn)?rn:void 0,Jn=(V.group?.bucket??"day")==="day"?V.group?.by:void 0,Yn=(V.filter??[]).map(p=>p.key),rs=Yn.filter(p=>Yn.indexOf(p)===Yn.lastIndexOf(p)&&/choice|boolean/.test(x.filters.find(k=>k.key===p)?.type??"")),Qn=p=>{let k={...u?.computed?ht(l.schema,l.graph,p):p};Jn&&!String(k[Jn]).includes("T")&&delete k[Jn];for(let W of rs)delete k[W];return k},_a=p=>Ur(u?.fields?.shape?.[p])?.type==="enum",on=p=>{let k=se(u,p);if(a)return(0,w.jsxs)("li",{"data-testid":"record-row","data-graview-record":p.id,style:{minWidth:0},...aa(p.id),children:[na(p,k),a(p,{label:k,href:te(l.schema,t,p.id),flagged:T.has(p.id),glance:ei(Qn(p),u,k)})]},p.id);if(zn){let ra=Ln(rn,p,l.graph),cs=Object.fromEntries(Object.entries(Qn(p)).filter(([ps])=>!ra?.fields.has(ps))),Za=ra?Jt(cs,u,ra.title??k,_a):[];return(0,w.jsxs)("li",{"data-testid":"record-row","data-graview-record":p.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...aa(p.id),children:[na(p,k),(0,w.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,w.jsx)(zn,{node:p,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...T.has(p.id)?{flagged:[p.id]}:{}})}),Za.length>0?(0,w.jsx)("span",{style:{...L,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,w.jsx)(Yt,{runs:Za})}):null,(0,w.jsx)(xl,{to:te(l.schema,t,p.id),label:T.has(p.id)?`${k} \u2014 implicated in a problem`:k})]},p.id)}let W=Jt(Qn(p),u,k,_a),be=W.length>0,cn=ve.words?So(u,p,ve.words):void 0,Qa=I?void 0:Vr(p,u),pn=gl(p,u),Xa=(0,w.jsxs)($,{to:te(l.schema,t,p.id),className:"graview-row-title",...k.length>60?{title:k}:{},children:[T.has(p.id)?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,k]});return(0,w.jsxs)("li",{className:"graview-row","data-graview-record":p.id,...aa(p.id),children:[na(p,k),Qa?(0,w.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,w.jsx)($t,{as:"thumb",file:Qa}),Xa]}):Xa,be||pn?(0,w.jsxs)("span",{className:"graview-row-glance",children:[(0,w.jsx)(Yt,{runs:W}),be&&pn?" \xB7 ":null,pn?(0,w.jsx)(Cn,{address:pn}):null]}):null,cn?(0,w.jsx)(Gn,{why:cn}):null]},p.id)},Xn=He(e).filter(p=>p.kind===t&&!p.hidden),za=oe?.filters,os=(V.filter??[]).some(p=>p.key!=="is"||p.value!=="any"),is=!!(V.sort||V.group||V.query||os),ss=A.length>=ji||q&&is,ze=V.sort?x.sorts.find(p=>p.key===V.sort.by):void 0,Zn=ze?.type==="date"||ze!==void 0&&ze.key===re,Ja=I&&!Ue.grouped&&ze&&(ze.about==="label"||ze.type==="text"||Zn)?p=>{let k=ze.about==="label"?se(u,p):p[ze.key];if(typeof k!="string"||k.length===0)return Zn?"No date":"#";if(Zn)return k.slice(0,4);let W=k.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(W)?W:"#"}:void 0,sn=Ja?v.reduce((p,k)=>{let W=Ja(k);return p.at(-1)?.key===W?p.at(-1).nodes.push(k):p.push({key:W,nodes:[k]}),p},[]):void 0,Ya=je.nodes,ea=(0,Ie.useMemo)(()=>Ya.map(p=>p.id),[Ya.map(p=>p.id).join(`
|
|
6
|
-
`)]),De=Ro(ea),ta=(0,Ie.useId)(),Kt=(z?l.permittedMutations(z):l.permittedMutations()).some(p=>{let k=p.subject?.kinds;return k!==void 0&&(k==="*"||k.includes(t))}),na=(p,k)=>Kt?(0,w.jsx)("span",{className:"graview-choose-at",children:(0,w.jsx)("input",{...De.boxProps(p.id,k),onPointerEnter:wa,onFocus:wa})}):null,aa=p=>Kt?{"data-graview-choose":p}:{},ls=(0,Ie.useCallback)(p=>{De.choose(p),requestAnimationFrame(()=>{let k=De.list.current;((p[0]===void 0?null:k?.querySelector(`[data-graview-choose-box="${CSS.escape(p[0])}"]`))??k)?.focus({preventScroll:!0})})},[De]),Rt=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||zn?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,ln=Rt?void 0:"graview-rows",Gt=p=>`list-at-${p.replace(/[^\p{L}\p{N}]/gu,"_")}`,dn=S.map(p=>{let k=p.from===t?p.to:p.from,W=p.from===t?p.description:p.inverse??p.description;return{relation:p,far:k,words:W}}),ds=new Set(dn.map(p=>(p.words??"").toLowerCase()).filter((p,k,W)=>p&&W.indexOf(p)!==k));return(0,w.jsxs)(i?wl:ue,{context:e,children:[(0,w.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,w.jsxs)("header",{style:{display:"grid",gap:4},children:[i?null:(0,w.jsx)(St,{context:e}),(0,w.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,w.jsx)(Se,{kind:t,brand:s,schema:l.schema,size:8}),(0,w.jsx)(ce,{context:e,children:ft}),J.length>0?(0,w.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:J.map(({affordance:p,mutation:k})=>(0,w.jsx)(Sl,{name:k.name,title:k.title??k.name,panel:`${Ua}-${k.name}`,open:qa(k.name),onOpen:W=>ja(k.name,W)},p.id))}):null,!et.off&&A.length>0?(0,w.jsxs)("button",{type:"button","data-testid":"list-export","aria-label":"Export CSV",title:"Export CSV",onClick:()=>void Oa(et),style:{...Te,minHeight:28,margin:"-4px 0",...J.length>0?{}:{marginLeft:"auto"},padding:"0 2px",border:0,background:"none",font:"inherit",color:"var(--graview-ink-muted)",cursor:"pointer"},children:[(0,w.jsx)("span",{"aria-hidden":"true",style:{marginRight:4},children:"\u2193"}),"CSV"]}):null]}),v.length>0?(0,w.jsx)(Xo,{place:"here",to:[{label:`Skip to the ${v.length===1?tt(u,t):`${v.length} ${ft.toLowerCase()}`}`,testid:"records",go:()=>{let p=document.querySelector(`[data-graview-skip-target="${CSS.escape(ta)}"]`);Sa(p?.querySelector('[data-graview-choose-box][tabindex="0"]')??p)}},...A.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let p=document.querySelector(`[data-graview-skip-target="${CSS.escape(ta)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');Sa(p?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??p)}}]:[]]}):null,o??u?.description?(0,w.jsx)("p",{style:ge,children:o??u?.description}):null,dn.length>0||Xn.length>0?(0,w.jsxs)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[dn.length>0?(0,w.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",dn.map(({relation:p,far:k,words:W},be)=>(0,w.jsxs)("span",{"data-relation":p.edgeKind,children:[be>0?(0,w.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,k==="*"?Qe(W??dt(p.edgeKind)):(0,w.jsx)($,{to:`/${Y(l.schema,k)}`,style:Q,title:ne(l,k),children:W&&ds.has(W.toLowerCase())?`${Qe(W)}: ${ne(l,k).toLowerCase()}`:Qe(W??ne(l,k))})]},`${p.edgeKind}|${p.from}|${p.to}`))]}):null,Xn.length>0?(0,w.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",Xn.map((p,k)=>(0,w.jsxs)("span",{children:[k>0?(0,w.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,w.jsx)($,{to:ke(e,p),style:Q,children:p.title})]},kt(p)))]}):null]}):null]}),J.length>0?(0,w.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:J.map(({affordance:p,mutation:k})=>{let W=!!(Va[k.name]&&v.length===0);return(0,w.jsx)(kl,{name:k.name,id:`${Ua}-${k.name}`,description:k.description,open:qa(k.name),onClose:()=>ja(k.name,!1),children:(0,w.jsx)($e,{store:l,mutation:k,prefilled:p.args,open:p.open,...W?{initial:{[Va[k.name]]:ve.words}}:{},...e.principal?{principal:e.principal}:{}},W?`${k.name}|${ve.words}`:k.name)},p.id)})}):null,K.dropped.length>0?(0,w.jsxs)("p",{style:{...L,margin:0},"data-testid":"list-dropped",children:["This link asked for ",K.dropped.join(", "),", which ",ft.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,A.length>0?(0,w.jsx)(Ao,{schema:l.schema,graph:l.graph,kind:t,arrangement:V,onChange:G,kept:{shown:v.length,of:A.length},noun:{one:tt(u,t),many:ft.toLowerCase()},...ss?{}:{allow:!1},...za?{filters:za}:{},offers:x,chips:{nodes:A,flagged:T,...typeof d?.today=="string"?{today:d.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,w.jsx)("style",{children:Ht}),Kt?(0,w.jsx)("style",{children:Lo+hl}):null,(0,w.jsx)("div",{className:"graview-list","data-graview-skip-target":ta,...Kt?{...De.listProps,ref:De.list,tabIndex:-1,"data-graview-choosable":"","aria-label":De.chosen.length>0?`${ft}, ${De.chosen.length} chosen`:ft,role:"group"}:{},children:v.length===0&&ve.words?(0,w.jsxs)("p",{style:ge,"data-testid":"none-yet",children:["Nothing here is called \u201C",ve.words,"\u201D."," ",(0,w.jsx)("span",{style:L,"data-testid":"list-searched",children:xn(l.schema,{kinds:[t],past:Le})})," ",(0,w.jsx)($,{to:"?",style:Q,children:"Show every one"})]}):v.length===0?(0,w.jsxs)("p",{style:ge,"data-testid":"none-yet",children:[V.filter?.length||V.query?"None of them.":"None yet",!V.filter?.length&&!V.query&&J.length>0?` \u2014 the first one starts above, with \u201C${J[0]?.mutation.title??J[0]?.mutation.name}\u201D.`:!V.filter?.length&&!V.query?".":"",V.filter?.length||V.query?(0,w.jsxs)(w.Fragment,{children:[" ",(0,w.jsx)($,{to:"?",style:Q,children:"Show every one"})]}):null]}):Ue.grouped&&F?(0,w.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":F,children:Ze.map(p=>{if(!p.closed)return(0,w.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,w.jsxs)("h2",{className:"graview-group-head",children:[p.label," ",(0,w.jsx)("span",{children:p.nodes.length})]}),(0,w.jsx)("ul",{style:Rt,className:ln,"data-graview-rows":"",children:p.nodes.map(on)})]},p.key||"-");let k=Ct(p),W=`${g}-${Gt(p.key||"none")}`;return(0,w.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":k?"shut":"open",children:[(0,w.jsx)("h2",{className:"graview-group-head",children:(0,w.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!k,"aria-controls":W,"data-testid":"list-group-toggle",onClick:()=>h(p.value),children:[(0,w.jsx)("span",{"aria-hidden":"true",children:k?"\u25B8":"\u25BE"}),p.label," ",(0,w.jsxs)("span",{children:["\xB7 ",p.nodes.length]}),(0,w.jsxs)("span",{style:ml,children:[" ",p.nodes.length===1?tt(u,t):ft.toLowerCase()]})]})}),(0,w.jsx)("ul",{id:W,style:k?{...Rt,display:"none"}:Rt,className:ln,"data-graview-rows":"",hidden:k,children:k?null:p.nodes.map(on)})]},p.key||"-")})}):sn&&sn.length>1?(0,w.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":ze?.type==="date"?"year":"letter",children:[(0,w.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...L,display:"flex",flexWrap:"wrap",gap:ze?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:sn.map(p=>(0,w.jsx)("a",{href:`#${Gt(p.key)}`,onClick:k=>{k.preventDefault(),document.getElementById(Gt(p.key))?.scrollIntoView({block:"start"})},style:{...Te,minWidth:24,justifyContent:"center"},children:p.key},p.key))}),sn.map(p=>(0,w.jsxs)("section",{"data-testid":"list-section","aria-labelledby":Gt(p.key),style:{display:"grid",gap:0},children:[(0,w.jsx)("h2",{id:Gt(p.key),className:"graview-group-head",children:p.key}),(0,w.jsx)("ul",{style:Rt,className:ln,"data-graview-rows":"",children:p.nodes.map(on)})]},p.key))]}):(0,w.jsx)("ul",{style:Rt,className:ln,"data-testid":"records","data-graview-rows":"",children:v.map(on)})}),Kt?(0,w.jsx)(To,{store:l,chosen:De.chosen,...z?{principal:z}:{},...d?{context:d}:{},anchor:yl,of:ea.length,onChooseAll:()=>De.choose(ea),onClear:De.clear,onActed:ls}):null,m>0?(0,w.jsxs)($,{to:qi(c,"filter","is:any"),style:{...Q,...L,justifySelf:"start"},"data-testid":"past-link",children:["+",m," past"]}):null,P===!1&&l.graph.count(t,{archived:!0})>0?(0,w.jsxs)($,{to:qi(c,"archived","true"),style:{...Q,...L,justifySelf:"start"},"data-testid":"archived-link",children:["+",l.graph.count(t,{archived:!0})," archived"]}):null]}),(0,w.jsx)(Kn,{context:e,withheld:_e,style:me,testId:"withheld"})]})}var ml={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},yl=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,hl=`
|
|
7
|
-
.graview-list[data-graview-choosable]{outline:none}
|
|
8
|
-
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
9
|
-
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${gr.raised};display:flex;align-items:center}
|
|
10
|
-
@media (min-width: 900px) and (pointer: fine){
|
|
11
|
-
.graview-list [data-graview-choose]{padding-left:0}
|
|
12
|
-
.graview-choose-at{left:-34px}
|
|
13
|
-
}
|
|
14
|
-
@media (pointer: coarse){
|
|
15
|
-
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
16
|
-
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
17
|
-
}
|
|
18
|
-
`;function wl({children:e}){return(0,w.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var vl=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function bl(e,t,n){let a=qt({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{},...e.get("archived")?{archived:e.get("archived")}:{}}),r=[...a.filter??[]],o=e.get("by"),i=a.group??(o?{by:o}:void 0);for(let s of n){let d=e.get(s);d&&r.push({key:s,value:d})}let l=e.get("with");return l&&r.push({key:l,value:"*"}),e.get("past")==="1"&&!r.some(s=>s.key==="is")&&r.push({key:"is",value:"any"}),ha({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...i?{group:i}:{},...a.archived!==void 0?{archived:a.archived}:{}},t)}function qi(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function Sl({name:e,title:t,panel:n,open:a,onOpen:r}){return(0,w.jsxs)("button",{type:"button","data-testid":`act-open-${e}`,"data-graview-act":e,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...Te,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,w.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),t]})}function kl({name:e,id:t,description:n,open:a,onClose:r,children:o}){return(0,w.jsxs)("div",{"data-testid":`act-${e}`,id:t,hidden:!a,onKeyDown:i=>{i.key==="Escape"&&(i.preventDefault(),r(),document.querySelector(`[aria-controls="${t}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,w.jsx)("p",{style:{...L,margin:0,maxWidth:"58ch"},children:n}):null,o]})}function xl({to:e,label:t}){let n=(0,Ie.useRef)(null);return Eo(n),(0,w.jsx)($,{ref:n,to:e,"aria-label":t,style:{position:"absolute",inset:0,borderRadius:6}})}var lt=O(Ae(),1);var nn=O(Ae(),1);var B=O(j(),1);function Da({context:e}){let{store:t,brand:n,invariantContext:a,principal:r}=e;le(t);let o=t.violations(a),i=t.allInvariants(),l=yn(t,o),s=Wr(t.schema,i);return(0,B.jsxs)(ue,{context:e,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,B.jsx)(ce,{context:e,children:o.length===0?"All rules hold":"What is broken"}),(0,B.jsx)("p",{style:ge,"data-testid":"problems-count",children:o.length===0?"Every declared rule is satisfied by what is here.":sr(o)})]}),(0,B.jsx)(Li,{context:e}),l.map((d,c)=>{let y=d.nodeIds[0],g=y?t.graph.getNode(y):void 0;return(0,B.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",border:"1px solid var(--graview-edge)",background:"var(--graview-panel-warning)",borderRadius:"var(--graview-radius, 12px)"},children:[d.line?null:(0,B.jsx)(jn,{violation:d,schema:t.schema,...n?{brand:n}:{}}),g?(0,B.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,B.jsx)(Se,{kind:g.kind,brand:n,schema:t.schema,size:7}),(0,B.jsx)($,{to:te(t.schema,g.kind,g.id),style:Q,children:se(t.schema.tryDefinition(g.kind),g)})]}):null,d.line?(0,B.jsx)(jn,{violation:d,schema:t.schema,...n?{brand:n}:{}}):null,(0,B.jsx)(Un,{store:t,repairs:d.repairs,...r?{principal:r}:{}})]},c)}),i.length>0?(0,B.jsxs)("section",{style:{...me,display:"grid",gap:12},"data-testid":"rules",children:[(0,B.jsx)("h2",{style:pe,children:"The rules"}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(d=>{let c=o.filter(u=>u.invariant===d.name).length,y=s.get(d.name),g=d.label??d.name;return(0,B.jsxs)("li",{"data-graview-rule":d.name,style:{display:"grid",gap:2},children:[(0,B.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[y?(0,B.jsx)(hn,{line:y,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,B.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:g}),(0,B.jsx)("span",{style:{...L,color:c>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:c===0?"holds":`broken in ${c} ${c===1?"place":"places"}`})]}),y&&g.trim().length>0?(0,B.jsx)("span",{style:L,children:g}):null]},d.name)})})]}):null]})}function jn({violation:e,schema:t,brand:n}){if(!e.line)return(0,B.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=Kr(e),r=Br(e);return r?(0,B.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,B.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,B.jsx)("span",{style:L,children:a}):null,(0,B.jsxs)("details",{"data-testid":"problem-judged",style:L,children:[(0,B.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,B.jsx)(hn,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none"})]})]}):(0,B.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,B.jsx)(hn,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,B.jsx)("span",{style:L,children:a}):null]})}function Un({store:e,repairs:t,principal:n}){let[a,r]=(0,nn.useState)(null),[o,i]=(0,nn.useState)(null),l=(0,nn.useRef)([]);if(t.length===0)return null;let s=a===null?null:t[a],d=s&&(s.missing??[]).length>0?e.allMutations().find(c=>c.name===s.mutation):void 0;return(0,B.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,B.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:t.map((c,y)=>{let g=(c.missing??[]).length>0,u=e.permits({name:c.mutation,args:{...c.args}},n);return u.ok?(0,B.jsx)("button",{ref:P=>{l.current[y]=P},type:"button","data-graview-repair":c.mutation,"data-graview-asks":g||void 0,"aria-expanded":g?a===y:void 0,onClick:()=>{if(i(null),g){r(a===y?null:y);return}r(null);try{e.apply({name:c.mutation,args:{...c.args}},n?{author:n}:{})}catch(P){i(Ot(e.schema,e.allMutations(),P))}},style:Oe,children:g?`${c.label} \u2026`:c.label},y):(0,B.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...L,margin:0},children:[(0,B.jsx)("s",{children:c.label})," \u2014 ",u.refusal.message]},y)})}),d&&s?(0,B.jsx)($e,{store:e,mutation:d,prefilled:{...s.args},only:s.missing??[],label:s.label,autoFocus:!0,onDone:()=>{let c=a;r(null),requestAnimationFrame(()=>{let y=c===null?null:l.current[c];if(y?.isConnected){y.focus();return}let g=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");g&&(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus())})},...n?{principal:n}:{}}):null,s&&!d&&(s.missing??[]).length>0?(0,B.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:ka},children:["\u201C",s.label,"\u201D names ",s.mutation,", which this app does not declare."]}):null,o?(0,B.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:ka},children:o}):null]})}var an=O(Ae(),1);var Wa=O(Ae(),1);var ut=O(j(),1);function Vi({store:e,link:t,principal:n}){let[a,r]=(0,Wa.useState)(!1),[o,i]=(0,Wa.useState)(null),l=oo(t);return(0,ut.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,ut.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,ut.jsxs)("span",{style:{...L,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,ut.jsx)("span",{children:l}),(0,ut.jsx)("button",{type:"button",style:{...Oe,padding:"4px 10px"},onClick:()=>{try{e.apply({name:cr,args:{kind:t.edge.kind,from:t.edge.from,to:t.edge.to}},n?{author:n}:{}),r(!1)}catch(s){i(Ot(e.schema,e.allMutations(),s))}},children:"Keep this link"}),o?(0,ut.jsx)("span",{role:"alert",children:o}):null]}):null]})}var fe=O(j(),1);function _i({nodeId:e,node:t,field:n,inPlace:a,labelStyle:r=Be,late:o=!1,required:i=!1}){return n.blank?(0,fe.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},"data-graview-blank-fact":n.key,"data-graview-fact":n.key,children:[(0,fe.jsx)("dt",{style:r,children:n.label}),(0,fe.jsxs)("dd",{style:{margin:0,minWidth:0},children:[a?(0,fe.jsx)(_t,{nodeId:e,field:n.key,value:"",said:`${n.label}: add`,blank:!0}):null,i?(0,fe.jsx)("span",{"data-graview-needed":n.key,style:{marginLeft:8,fontSize:"0.75rem",color:"var(--graview-warn)"},children:"Needed"}):null]})]}):n.files?(0,fe.jsx)($t,{as:"field",read:!a,nodeId:e,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,fe.jsx)(Po,{nodeId:e,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,fe.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},"data-graview-fact":n.key,children:[(0,fe.jsx)("dt",{style:r,children:n.label}),(0,fe.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,fe.jsx)(no,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:e,field:n.key}:{}}):n.app?(0,fe.jsx)(Cn,{address:n.app,as:"record",...a?{nodeId:e,field:n.key}:{}}):n.href?(0,fe.jsx)(xo,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:e}:{}}):a?(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(_t,{nodeId:e,field:n.key,value:n.value,stored:n.stored,late:o}),n.repeats?(0,fe.jsx)(ao,{nodeId:e,field:n.key,start:t?.[n.key],value:t?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var At=O(Ae(),1),Ge=O(j(),1),Pl=7,Al=40;function Ba({label:e,offered:t,onPick:n,onClose:a}){let[r,o]=(0,At.useState)(""),i=(0,At.useRef)(null),l=(0,At.useRef)(null),s=t.length>Pl,d=r.trim().toLowerCase(),c=d===""?t:t.filter(u=>`${u.label} ${u.apart??""}`.toLowerCase().includes(d)),y=c.slice(0,Al);(0,At.useEffect)(()=>{(l.current??i.current?.querySelector("button[data-graview-candidate]"))?.focus()},[]);let g=(u,P)=>{let f=[...i.current?.querySelectorAll("input, button[data-graview-candidate]")??[]],S=f.indexOf(u);f[Math.max(0,Math.min(f.length-1,S+P))]?.focus()};return(0,Ge.jsxs)("div",{ref:i,role:"group","aria-label":e,"data-graview-relation-picker":"",onKeyDown:u=>{u.key==="Escape"?(u.preventDefault(),u.stopPropagation(),a()):(u.key==="ArrowDown"||u.key==="ArrowUp")&&(u.preventDefault(),g(u.target,u.key==="ArrowDown"?1:-1))},onBlur:u=>{let P=u.relatedTarget;P&&!u.currentTarget.contains(P)&&a()},style:{display:"grid",gap:6,marginTop:8,padding:"8px 0",maxWidth:420,minWidth:0},children:[s?(0,Ge.jsx)("input",{ref:l,type:"search","aria-label":`${e}: find one`,placeholder:"Find one\u2026",value:r,onChange:u=>o(u.target.value),onKeyDown:u=>{u.key==="Enter"&&y[0]&&(u.preventDefault(),n(y[0].id))},style:{font:"inherit",fontSize:"inherit",minHeight:32,padding:"0 10px",borderRadius:"var(--graview-radius-sm, 8px)",border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)",minWidth:0}}):null,y.length>0?(0,Ge.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",maxHeight:280,overflowY:"auto"},children:y.map(u=>(0,Ge.jsx)("li",{children:(0,Ge.jsxs)("button",{type:"button","data-graview-candidate":u.id,onClick:()=>n(u.id),style:{all:"unset",cursor:"pointer",boxSizing:"border-box",display:"flex",gap:8,alignItems:"baseline",width:"100%",minHeight:32,padding:"4px 8px",borderRadius:"var(--graview-radius-sm, 8px)",color:"var(--graview-ink)",overflowWrap:"anywhere"},className:"graview-candidate",children:[u.label,u.apart?(0,Ge.jsx)("span",{style:{color:"var(--graview-ink-muted)",fontSize:"0.875em"},children:u.apart}):null]})},u.id))}):(0,Ge.jsx)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:t.length===0?"Nothing else to choose.":"Nothing matches."}),c.length>y.length?(0,Ge.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)",fontSize:"0.875em"},children:[c.length-y.length," more \u2014 type to narrow them."]}):null,(0,Ge.jsx)("style",{children:".graview-candidate:hover,.graview-candidate:focus-visible{background:var(--graview-panel)}.graview-candidate:focus-visible{outline:2px solid var(--graview-accent);outline-offset:-2px}"})]})}var Z=O(j(),1);function Ji({context:e,id:t,facts:n,fields:a,relations:r,inPlace:o,heading:i,className:l,style:s,children:d}){let{store:c}=e,y=c.graph.getNode(t),g=c.schema.tryDefinition(n.kind),u=g?.fields?.shape??{},P=new Set(n.violations.flatMap(f=>f.repairs.filter(S=>Object.values(S.args??{}).includes(t)).flatMap(S=>S.missing??[])));return a.length===0&&r.length===0&&!d?null:(0,Z.jsxs)("section",{"data-testid":"record-fields","data-graview-fact-sheet":"",className:l,style:{display:"grid",gap:16,minWidth:0,...s},children:[(0,Z.jsx)("style",{children:Ol}),i??(0,Z.jsx)("h2",{style:pe,children:"The facts"}),qr(g,a).map((f,S)=>(0,Z.jsxs)("div",{style:{display:"grid",gap:8,minWidth:0},children:[f.title?(0,Z.jsx)("h3",{"data-graview-field-group":f.title,style:Tl,children:f.title}):null,(0,Z.jsx)("dl",{"data-graview-sheet":"",children:f.fields.map(T=>(0,Z.jsx)(_i,{nodeId:t,node:y,field:T,inPlace:o,labelStyle:Vn,late:P.has(T.key),required:T.blank===!0&&Rl(u[T.key])},T.key))})]},S)),d?(0,Z.jsx)("dl",{"data-graview-sheet":"",children:d}):null,r.length>0?(0,Z.jsx)("dl",{"data-graview-sheet":"","data-graview-relations":"",children:r.map(f=>(0,Z.jsx)(Ll,{context:e,id:t,relation:f,inPlace:o},f.key))}):null]})}function Cl(e,t,n){let a=t.filter(o=>!n.includes(o)).flatMap(o=>{let i=e.graph.getNode(o);return i?[i]:[]}),r=wn(a,o=>e.schema.tryDefinition(o));return a.map(o=>({id:o.id,label:se(e.schema.tryDefinition(o.kind),o),apart:r.get(o.id)})).sort((o,i)=>o.label.localeCompare(i.label))}function Rl(e){let t=un(e)?.type;return t!==void 0&&t!=="optional"&&t!=="nullable"&&t!=="default"}function Ll({context:e,id:t,relation:n,inPlace:a}){let{store:r,brand:o,principal:i}=e,[l,s]=(0,an.useState)(!1),[d,c]=(0,an.useState)(void 0),y=(0,an.useRef)(null),g=a?n.set:void 0,u=a?n.remove:void 0,P=()=>requestAnimationFrame(()=>{let x=document.activeElement;if(x&&x!==document.body&&x.isConnected)return;let b=y.current;(b?.querySelector("[data-graview-relation-set]")??b?.querySelector("a, button"))?.focus()}),f=x=>{try{r.apply(x,i?{author:i}:{}),c(void 0)}catch(b){c(Ot(r.schema,r.allMutations(),b))}},S=n.targets.length===0,T=x=>(0,Z.jsx)("button",{type:"button","data-graview-relation-set":g.affordance.mutation,"aria-expanded":l,title:`${g.affordance.label} \u2014 an act, so it is in the history and can be taken back`,onClick:()=>{c(void 0),s(!l)},style:Nl,children:x});return(0,Z.jsxs)("div",{ref:y,"data-graview-relation":n.edgeKind,"data-graview-direction":n.direction,...n.one?{"data-graview-one":""}:{},children:[(0,Z.jsx)("dt",{style:Vn,children:n.label}),(0,Z.jsxs)("dd",{style:{margin:0,minWidth:0},children:[(0,Z.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:6},children:[n.targets.map(x=>{let b=io(r,n.direction==="in"?{kind:n.edgeKind,from:x.id,to:t}:{kind:n.edgeKind,from:t,to:x.id});return(0,Z.jsxs)("span",{"data-graview-chip":x.id,style:El,children:[(0,Z.jsx)(Se,{kind:x.kind,...o?{brand:o}:{},schema:r.schema,size:6}),(0,Z.jsxs)($,{to:te(r.schema,x.kind,x.id),style:Ml,children:[x.label,x.apart?(0,Z.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:[" \xB7 ",x.apart]}):null]}),b?.provisional?(0,Z.jsx)(Vi,{store:r,link:b,...i?{principal:i}:{}}):null,n.one&&g?(0,Z.jsx)("button",{type:"button","data-graview-relation-set":g.affordance.mutation,"aria-label":g.affordance.label,"aria-expanded":l,title:`${g.affordance.label} \u2014 an act, so it is in the history and can be taken back`,onClick:()=>{c(void 0),s(!l)},style:zi,children:(0,Z.jsx)("span",{"aria-hidden":"true",children:"\u25BE"})}):null,!n.one&&u?(0,Z.jsx)("button",{type:"button","data-graview-relation-remove":u.affordance.mutation,"aria-label":`${u.affordance.label}: ${x.label}`,title:`${u.affordance.label} \u2014 an act, so it is in the history and can be taken back`,onClick:()=>{f({name:u.affordance.mutation,args:{...u.affordance.args,[u.arg]:x.id}}),P()},style:zi,children:(0,Z.jsx)("span",{"aria-hidden":"true",children:"\xD7"})}):null]},x.id)}),g&&(S||!n.one)?T(g.affordance.label):null,S&&!g?(0,Z.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"None"}):null,d?(0,Z.jsx)("span",{role:"status","data-graview-refused":n.edgeKind,style:{fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:d}):null]}),l&&g?(0,Z.jsx)(Ba,{label:g.affordance.label,offered:Cl(r,g.candidates,n.targets.map(x=>x.id)),onPick:x=>{s(!1),f({name:g.affordance.mutation,args:{...g.affordance.args,[g.arg]:x}}),P()},onClose:()=>{s(!1),P()}}):null,!n.one&&n.targets.length>0?[...new Set(n.targets.map(x=>x.kind))].map(x=>(0,Z.jsx)($,{to:`/${Y(r.schema,x)}?${encodeURIComponent(n.edgeKind)}=${encodeURIComponent(t)}`,style:{...Ke,...L,display:"inline-flex",marginTop:4},"data-testid":"related-all",children:(0,Z.jsxs)(ot,{children:["Sort and filter ",n.description??`these ${ne(r,x).toLowerCase()}`,n.targets.some(b=>b.kind!==x)?` (${ne(r,x).toLowerCase()})`:""]})},x)):null]})]})}var Vn={margin:0,color:"var(--graview-ink-muted)",fontSize:"var(--graview-text-small)",lineHeight:1.5,paddingTop:2},Tl={margin:0,fontSize:"var(--graview-text-small)",color:"var(--graview-ink)",fontWeight:"var(--graview-weight-label)"},El={display:"inline-flex",alignItems:"center",gap:6,maxWidth:"100%",minHeight:28,padding:"0 4px 0 10px",borderRadius:999,background:"var(--graview-panel)",color:"var(--graview-ink)"},Ml={...Q,color:"var(--graview-ink)",textDecoration:"none",overflowWrap:"anywhere",minHeight:24,display:"inline-flex",alignItems:"center",paddingRight:6},zi={all:"unset",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:24,minHeight:24,borderRadius:999,color:"var(--graview-ink-muted)"},Nl={all:"unset",cursor:"pointer",display:"inline-flex",alignItems:"center",minHeight:28,padding:0,color:"var(--graview-ink-muted)",borderBottom:"1px dashed var(--graview-edge-bright)"},Yi={font:"inherit",fontSize:"inherit",color:"inherit",background:"none",border:0,padding:0,minHeight:24,cursor:"pointer",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:"0.2em"},Ka={font:"inherit",fontSize:"var(--graview-text-body)",color:"var(--graview-ink)",background:"none",border:0,borderRadius:"var(--graview-radius-sm, 8px)",padding:"4px 0",minHeight:32,cursor:"pointer",textAlign:"start",textDecoration:"underline",textDecorationColor:"var(--graview-edge)",textUnderlineOffset:"0.25em"},Ol=`[data-graview-sheet]{margin:0;display:grid;grid-template-columns:minmax(0,10rem) minmax(0,1fr);column-gap:28px;row-gap:12px;align-items:baseline;min-width:0}
|
|
19
|
-
[data-graview-sheet]>*{display:grid!important;grid-column:1/-1!important;grid-template-columns:subgrid;column-gap:28px!important;row-gap:4px!important;align-items:baseline;min-width:0}
|
|
20
|
-
[data-graview-sheet]>*>dt{grid-column:1}[data-graview-sheet]>*>dd{grid-column:2;margin:0}
|
|
21
|
-
[data-graview-sheet]>[data-graview-long]>dt,[data-graview-sheet]>[data-graview-long]>dd,[data-graview-sheet]>[data-graview-files]>dt,[data-graview-sheet]>[data-graview-files]>dd{grid-column:1/-1}
|
|
22
|
-
[data-graview-chip] a:hover{text-decoration:underline}[data-graview-chip] button:hover,[data-graview-relation-set]:hover{color:var(--graview-ink)}
|
|
23
|
-
@media (max-width:560px){[data-graview-sheet]{grid-template-columns:minmax(0,1fr)}[data-graview-sheet]>*>dt,[data-graview-sheet]>*>dd{grid-column:1}}`;var $l=e=>e.charAt(0).toUpperCase()+e.slice(1);function Fl(e,t,n){if(n.provider==="invariant"||n.batch)return;let a=e.allMutations().find(S=>S.name===n.mutation);if(!a?.subject||a.creates?.length)return;let r=a.connects??[],o=a.severs??[],i=new Set([...r,...o]);if(i.size!==1)return;let l=[...i][0],s=n.open.filter(S=>!S.optional);if(s.length!==1||!s[0].kinds?.length)return;let d=s[0],c=Object.entries(n.args).find(([,S])=>S===t)?.[0];if(c===void 0)return;let y=e.graph.getNode(t);if(!y)return;let g=c===a.subject.arg,u=g?[y.kind]:d.kinds;for(let S of u){let T=e.schema.tryDefinition(S);if(T&&ia(a,T).length>0)return}let P=u.some(S=>!!e.schema.tryDefinition(S)?.edges?.[l]);return{relation:l,direction:g===P?"out":"in",verb:r.includes(l)?"set":"remove",moves:r.includes(l)&&o.includes(l)&&g,act:{affordance:n,arg:d.name,candidates:d.candidates??[]},farKinds:d.kinds}}function Hl(e,t,n,a,r){if(a==="out")return e.schema.tryDefinition(t)?.edges?.[n]?.description;for(let o of r){let i=e.schema.tryDefinition(o)?.edges?.[n];if(i)return i.inverse??i.description}}function Qi(e,t,n){let a=n.actions.affordances.flatMap(i=>{let l=Fl(e,t,i);return l?[l]:[]}),r=n.links.map(i=>({group:i,set:void 0,remove:void 0,moves:!1})),o=(i,l)=>i.group.edgeKind===l.relation&&i.group.direction===l.direction&&(i.group.targets.length===0||i.group.targets.some(s=>l.farKinds.includes(s.kind)||l.farKinds.includes("*")));for(let i of a){let l=r.find(s=>o(s,i));if(!l&&i.verb==="set"){let s=Hl(e,n.kind,i.relation,i.direction,i.farKinds);l={group:{edgeKind:i.relation,direction:i.direction,...s?{description:s}:{},targets:[]},set:void 0,remove:void 0,moves:!1},r.push(l)}l&&(i.verb==="set"&&!l.set&&(l.set=i.act,l.moves=i.moves),i.verb==="remove"&&!l.remove&&(l.remove=i.act))}return r.map(({group:i,set:l,remove:s,moves:d})=>({...i,key:`${i.edgeKind}|${i.direction}|${i.description??""}`,label:i.description?$l(i.description):`${i.direction==="in"?"\u2190 ":"\u2192 "}${dt(i.edgeKind)}`,one:i.direction==="out"&&e.schema.edge(i.edgeKind)?.cardinality==="one"||d,...l?{set:l}:{},...s?{remove:s}:{}}))}function Il(e,t,n,a){let r=e.graph.getNode(t);if(!r)return new Set;let o=e.schema.tryDefinition(r.kind),i=new Set(a.fields),l=new Map;for(let c of Ut(e,t,a.principal?{principal:a.principal}:{}))i.has(c.field)&&l.set(c.field,new Set([c.mutation,...c.alternatives.map(y=>y.mutation)]));let s=new Set(a.relations.flatMap(c=>[c.set?.affordance.id,c.remove?.affordance.id]).filter(c=>c!==void 0)),d=new Set;for(let c of n.affordances){if(c.provider==="invariant"||c.batch)continue;if(s.has(c.id)){d.add(c.id);continue}let y=e.allMutations().find(P=>P.name===c.mutation);if(!y?.subject||!o||y.creates?.length||y.connects?.length||y.severs?.length||c.args[y.subject.arg]!==t)continue;let g=ia(y,o);if(g.length!==1)continue;let u=g[0];l.get(u)?.has(y.name)&&(c.open.some(P=>!P.optional&&P.name!==u)||d.add(c.id))}return d}function Xi(e,t,n,a){let r=Il(e,t,n,a);return r.size===0?n:{...n,affordances:n.affordances.filter(o=>!r.has(o.id))}}function Zi(e,t,n,a){let r=e.graph.getNode(t);if(r)return Ut(e,t,a?{principal:a}:{}).find(o=>o.takesValue&&o.open.length===0&&o.shape.type==="text"&&r[o.field]===n)?.field}var C=O(j(),1),Dl=[];function Ga({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;le(t);let o=we()!==null,i=pt(),l=We()[0].get("drawn")==="built-in",s=decodeURIComponent(i.id??""),d=On(t,s,{...a?{principal:a}:{},...r?{context:r}:{},...o?{blanks:oi(t,s,a)}:{}}),c=yn(t,d?.violations??Dl),[y,g]=(0,lt.useState)(null),[u,P]=(0,lt.useState)(!1),[f,S]=(0,lt.useState)(null),T=(0,lt.useRef)(null),x=(0,lt.useRef)(null),b=ro({flow:"both",letters:!0}),K=m=>{(T.current?.parentElement?.querySelector(`[data-affordance="${m.replace(/["\\]/g,"\\$&")}"]`)??T.current)?.focus()};if(!d)return(0,C.jsx)(ue,{context:e,children:(0,C.jsx)(ce,{context:e,children:"Nothing lives at this address."})});let q=t.graph.getNode(s),I=t.schema.tryDefinition(d.kind),re=I?.describe&&q?Gr(I,q):null,oe=[...t.log.all()].filter(m=>!Et(m)&&(m.writes.includes(s)||m.reads.includes(s))).slice(-8).reverse(),N=t.log.all().find(m=>!Et(m)&&m.undoes===void 0&&m.primitives.some(F=>F.op==="add-node"&&F.node.id===s)),M=a??t.seenFor,ee=M?d.actions.withheld.filter(m=>m.provider!=="invariant"&&t.mayPropose({name:m.mutation,args:{...m.args}},M)):[],ie=e.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),de=ie!==void 0&&!Nt(ie)&&!(l&&yt(ie))?ie:void 0,Pe=de&&q?Ln(ie,q,t.graph):void 0,V=o?Zi(t,s,d.label,a):void 0,ve=d.fields.filter(m=>!Pe?.fields.has(m.key)&&m.key!==V),qe=Qi(t,s,d).flatMap(m=>{if(!Pe)return[m];let F=m.targets.filter(G=>!Pe.records.has(G.id));return F.length>0||m.targets.length===0&&m.set?[{...m,targets:F}]:[]}),Le=[...(o?Xi(t,s,d.actions,{fields:[...ve.map(m=>m.key),...V?[V]:[]],relations:qe,...a?{principal:a}:{}}):d.actions).affordances.filter(m=>m.provider!=="invariant"),...ee],Ue=Le.filter(m=>m.destructive||m.setsAside),Ze=u||Ue.length<2||Ue.length===Le.length?Le:Le.filter(m=>!Ue.includes(m)),Ve=de!==void 0&&yt(ie),et=Ve&&q!==void 0&&ie.ownHeading===!0,Ct=o&&bn(I).length>0,h=q?jr(e.app?.connections,d.kind,s):void 0,v=He(e).filter(m=>!m.hidden&&(m.kind===d.kind||m.across===d.kind)),A=de!==void 0&&q!==void 0&&at(ie);return(0,C.jsxs)(ue,{context:e,spans:A,...A&&et?{bleedTop:"full"}:{},children:[(0,C.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,C.jsx)(St,{context:e}),et?(0,C.jsx)(ce,{context:e,unseen:!0,children:d.label}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ce,{context:e,children:V?(0,C.jsx)(_t,{nodeId:s,field:V,value:d.label,said:d.label}):d.label}),re&&re!==d.label?(0,C.jsx)("p",{style:ge,children:re}):null,N?.lineage?(0,C.jsxs)("p",{style:{...L,margin:0},"data-testid":"record-lineage",children:["Made by ",zt(N,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}}),", ",ga(N.lineage)]}):null,(0,C.jsxs)("div",{style:{...L,display:"flex",flexWrap:"wrap",alignItems:"center",gap:"4px 20px"},"data-graview-record-asides":"",children:[(0,C.jsx)(Pa,{context:e,stop:`#focus=${encodeURIComponent(s)}`,style:{...Ke,...L},"data-testid":"spatial-link"}),o&&q?(0,C.jsx)(fa,{choices:[{on:"changed",record:s},{on:"act",record:s},{on:"reaches",kind:d.kind,condition:"",record:s}],label:"Notify me when this changes",testId:"record-notify",style:Yi}):null]}),v.length>0?(0,C.jsx)(Wl,{context:e,places:v}):null,h?(0,C.jsxs)("p",{style:{...L,margin:0},"data-testid":"record-kept-in-step","data-graview-system":h.system,children:["Kept in step with ",h.words,h.href?(0,C.jsxs)(C.Fragment,{children:[" \xB7 ",(0,C.jsxs)("a",{href:h.href,target:"_blank",rel:"noopener noreferrer",style:Q,children:["Open in ",h.system==="notion"?"Notion":"Google Calendar"]})]}):null]}):null]})]}),q&&or(q)?(0,C.jsx)(Gl,{context:e,id:s,kind:d.kind}):null,q&&lr(t,s)?(0,C.jsx)(Kl,{context:e,id:s,kind:d.kind}):null,de&&q?(0,C.jsxs)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:[(0,C.jsx)(Mo,{children:(0,C.jsx)(it,{when:nt(ie),full:A,children:(0,C.jsx)(de,{node:q,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[s]}:{}})})}),Ve?(0,C.jsx)("p",{style:{margin:"8px 0 0",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"record-original",children:(0,C.jsx)($,{to:`${te(t.schema,d.kind,s)}?drawn=built-in`,style:{color:"inherit"},"data-testid":"built-in-page","aria-label":"The original page",children:"Original"})}):null]}):null,d.violations.length>0?(0,C.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",border:"1px solid var(--graview-edge)",background:"var(--graview-panel-warning)",borderRadius:"var(--graview-radius, 12px)"},children:c.map((m,F)=>(0,C.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,C.jsx)(jn,{violation:m,schema:t.schema,...n?{brand:n}:{}}),(0,C.jsx)(Un,{store:t,repairs:si(d.actions,m.repairs),...a?{principal:a}:{}})]},F))}):null,!Ve&&(ve.length>0||Ct||qe.length>0)?(0,C.jsx)(Ji,{context:e,id:s,facts:d,fields:ve,relations:qe,inPlace:o,style:me,children:Ct?(0,C.jsx)($t,{as:"unfilled",nodeId:s,skip:[...Pe?.fields??[]],labelStyle:Vn,style:{gap:4}}):null}):null,!Ve&&(Le.length>0||d.actions.withheld.length>0)?(0,C.jsxs)("section",{style:{...me,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,C.jsx)("h2",{style:pe,ref:T,tabIndex:-1,children:"What can be done"}),(0,C.jsxs)("div",{role:"toolbar","aria-label":"What can be done","aria-orientation":"vertical",...b,style:{display:"grid",justifyItems:"start",gap:2},children:[Ze.map(m=>{let F=y===m.id;return(0,C.jsx)("button",{type:"button","data-affordance":m.id,"data-rank":m.rank,"data-graview-act":m.mutation,[ua]:"",autoFocus:u&&m===Ue[0],"aria-expanded":F,onClick:()=>g(F?null:m.id),style:{...Ka,...F?{color:"var(--graview-accent)"}:{}},children:m.label},m.id)}),Ze.length<Le.length?(0,C.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>P(!0),style:{...Ka,...L},"data-testid":"record-actions-more",[ua]:"",children:["Show ",Le.length-Ze.length," more"]}):null]}),Le.map(m=>{if(y!==m.id)return null;let F=t.allMutations().find(G=>G.name===m.mutation);return F?(0,C.jsxs)("div",{ref:x,onKeyDown:G=>{if(G.key!=="Escape"||G.defaultPrevented)return;G.preventDefault(),g(null);let z=m.id;requestAnimationFrame(()=>K(z))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,C.jsx)("h3",{style:pe,children:m.label}),F.description?(0,C.jsx)("p",{style:{...L,margin:0},children:F.description}):null,(0,C.jsx)($e,{store:t,mutation:F,prefilled:m.args,open:m.open,label:m.label,autoFocus:!0,onDone:()=>{g(null),S(m.mutation);let G=m.id;requestAnimationFrame(()=>K(G))},...a?{principal:a}:{}})]},m.id):null}),o&&f!==null&&y===null?(0,C.jsx)(fa,{choices:[{on:"act",act:f,record:s},{on:"act",act:f}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...Oe,...L,justifySelf:"start"}}):null,(0,C.jsx)(Kn,{context:e,withheld:d.actions.withheld.filter(m=>!ee.includes(m))})]}):null,o?(0,C.jsx)(Zo,{id:s,style:me,headingStyle:pe}):null,oe.length>0?(0,C.jsxs)("section",{style:{...me,display:"grid",gap:10},"data-testid":"record-history",children:[(0,C.jsx)("h2",{style:pe,children:"What has happened"}),(0,C.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:oe.map(m=>(0,C.jsxs)("li",{style:L,children:[(0,C.jsx)("span",{style:{color:"var(--graview-ink)"},children:m.intent}),m.lineage?(0,C.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",ga(m.lineage)]}):null," \u2014 ",zt(m,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},m.id))})]}):null]})}function Wl({context:e,places:t}){let[n,a]=(0,lt.useState)(!1),r=(0,lt.useRef)(null),o=n||t.length<=_n+1?0:t.length-_n;return(0,C.jsxs)("p",{ref:r,style:{...L,margin:0},"data-testid":"seen-in",...n?{"data-open":""}:{},children:["Seen in:"," ",t.map((i,l)=>(0,C.jsxs)("span",{...o>0&&l>=_n?{"data-graview-later":""}:{},children:[l>0?(0,C.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,C.jsx)($,{to:ke(e,i),style:Q,children:i.title})]},kt(i))),o>0?(0,C.jsxs)(C.Fragment,{children:[" ",(0,C.jsxs)("button",{type:"button","data-graview-seen-more":"","aria-expanded":"false",style:{...Q,...L,font:"inherit",background:"none",border:0,padding:0,cursor:"pointer"},onClick:()=>{a(!0),requestAnimationFrame(()=>r.current?.querySelectorAll("a")[_n]?.focus())},children:[o," more"]}),(0,C.jsx)("style",{children:Bl})]}):null]})}var _n=3,Bl="[data-graview-seen-more]{display:none!important}@media (max-width:680px){[data-graview-seen-more]{display:inline!important}[data-testid=seen-in] [data-graview-later]{display:none}}";function Kl({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`allow-tidying-${n}`,args:{id:t}},i=a.allMutations().some(l=>l.name===o.name)&&a.permits(o,r).ok;return(0,C.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,C.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,C.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),i?(0,C.jsx)("button",{type:"button",style:Oe,"data-testid":"allow-tidying",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Gl({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`unarchive-${n}`,args:{id:t}},i=a.allMutations().some(d=>d.name===o.name)&&a.permits(o,r).ok,l=[...a.log.all()].reverse().find(d=>!Et(d)&&d.mergedInto!==void 0&&d.writes.includes(t)),s=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,C.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,C.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,C.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",s?(0,C.jsxs)(C.Fragment,{children:[" ","Merged into ",(0,C.jsx)($,{to:te(a.schema,s.kind,s.id),style:Q,children:se(a.schema.tryDefinition(s.kind),s)}),"."]}):null]}),i?(0,C.jsx)("button",{type:"button",style:Oe,"data-testid":"bring-it-back",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Bring it back"}):null]})}var R=O(j(),1),ql=mn(()=>(__graviewPreload(import.meta.url,["./chunk.SWY6DIE4.js","./chunk.F5756PXX.js","./chunk.Q355UPFG.js","./chunk.3ZP6IDUC.js","./chunk.BQWMHHAZ.js","./chunk.2QALBEWP.js","./chunk.QQUZ5RTQ.js","./chunk.BJ3G7J2Z.js","./chunk.DIVANC3G.js","./chunk.KP7HUXH5.js","./chunk.4BSEYZMS.js","./chunk.KV3N6VRG.js","./chunk.FUTSLXWN.js","./chunk.MZSWWMX6.js","./chunk.MB7LKKUD.js","./chunk.6KYTCEIH.js","./chunk.FXCKKVT5.js","./chunk.NCBUECIW.js","./chunk.2T24FYAO.js","./chunk.JEQ6CA5M.js","./chunk.CM7EDQ4E.js","./chunk.SUYYDJGZ.js","./chunk.YR7DKU5T.js","./chunk.WVUJXDXZ.js","./chunk.IRPMGHZN.js","./chunk.7QWGIGHM.js","./chunk.HRLCDBMO.js","./chunk.LZNHTROY.js","./chunk.36FKQJFM.js","./chunk.RHV73CBA.js","./chunk.MIE4TJRW.js","./chunk.RP6C2IUM.js","./chunk.RD2FSSLV.js","./chunk.T552MHMU.js","./chunk.ZGJUCVT5.js","./chunk.CVVNHQPO.js","./chunk.YIDNZTON.js","./chunk.QILGAV7H.js","./chunk.I6HIVTXU.js","./chunk.PYGNO2AV.js","./chunk.3HFBHLXC.js","./chunk.CUA7F3YJ.js","./chunk.SDO3U72B.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.WMZ2BINI.js")).then(e=>({default:e.DraftPage}))),jl={kind:"human"};function Ul({list:e,store:t}){let n=new Set(e.members.map(i=>i.kind)),a=e.total-e.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,R.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=ct(t.schema,r).toLowerCase();return(0,R.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,R.jsx)($,{to:`/${Y(t.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:e.total===t.graph.nodesOfKind(r).length?`See all ${Lt(e.total)} ${o}`:`${Lt(a)} more \xB7 all ${o}`})})}function Vl({context:e,children:t}){let n=rt(),a=e.store.schema,r=vt("/").replace(/\/$/,""),o=(0,_.useMemo)(()=>({href:i=>`${r}${te(a,i.kind,i.id)}`,go:i=>n(te(a,i.kind,i.id)),more:i=>(0,R.jsx)(Ul,{list:i,store:e.store})}),[r,a,n,e.store]);return(0,R.jsx)(Rn.Provider,{value:o,children:(0,R.jsx)(No.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}var ts=(0,_.createContext)(void 0);function _l({steering:e}){let t=Ce(),n=rt(),a=`${t.pathname}${t.search}`;return(0,_.useLayoutEffect)(()=>e.at(a),[a,e]),(0,_.useLayoutEffect)(()=>{let r=i=>{i!==a&&n(i)};e.go.current=r;let o=e.pending?.current;return o!==void 0&&(e.pending.current=void 0,r(o)),()=>{e.go.current===r&&(e.go.current=void 0)}},[a,n,e]),null}function zl({context:e,to:t}){let{pathname:n}=Ce(),a=we(),r=(t??a)?.sayWhere,o=Jl(e,n);return(0,_.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function Jl(e,t){let[n="",a,r]=t.split("/").filter(Boolean).map(i=>{try{return decodeURIComponent(i)}catch{return i}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===Mt)return"#overview=1";let i=e.views?.places().find(l=>l.as===a);return i?`#focus=${encodeURIComponent(Je(i.kind))}&view=${encodeURIComponent(i.as)}`:"#"}let o=Ee(e.store.schema,n);return o?`#focus=${encodeURIComponent(a??Je(o))}`:"#"}function Yl({onNavigate:e,path:t}){let n=Ce(),a=va(),r=rt(),o=n.hash&&!n.hash.includes("=")?n.hash:"",i=`${n.pathname}${n.search}${o}`,l=(0,_.useRef)(e);l.current=e;let s=(0,_.useRef)(null);(0,_.useEffect)(()=>{let c=s.current;s.current=i,c!==null&&(i===c&&a!=="PUSH"||l.current?.(i,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let d=(0,_.useRef)(t);return(0,_.useEffect)(()=>{t===void 0||t===d.current||(d.current=t,t!==i&&r(t))},[t]),null}function es({context:e,registry:t,page:n}){let a=pt(),r=Ee(e.store.schema,a.slug??""),o=n==="list"?Ia:Ga,l=(r?t?.lookup(r,n):void 0)??o;return(0,R.jsx)(l,{context:e})}function Ql({context:e,registry:t,children:n}){let a=(0,_.useRef)(null);return Hr(a),(0,R.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,R.jsx)(wi,{context:e,registry:t,root:a,children:(0,R.jsx)(Ai,{context:e,root:a,registry:t,children:n})})})}function Xl(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Zl(){let{pathname:e}=Ce(),t=va(),n=(0,_.useRef)(null);(0,_.useLayoutEffect)(()=>{if(t!=="POP"){for(let o=n.current?.parentElement;o;o=o.parentElement){let{overflowY:i}=getComputedStyle(o);if((i==="auto"||i==="scroll")&&o.scrollHeight>o.clientHeight){o.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,_.useRef)(e),r=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{if(!r.current&&e===a.current)return;r.current=!0;let o=document.activeElement;if(Xl(o))return;let i=n.current?.closest("main")??document.querySelector("main"),s=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??i?.querySelector("h1, h2")??null??i??null;s&&(s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus({preventScroll:!0}))},[e]),(0,R.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function ns({context:e,children:t}){let n=rt(),a=vt("/").replace(/\/$/,""),r=(0,_.useContext)(ts),o=(0,_.useMemo)(()=>{let i=(c,y)=>{if("record"in c){let g=e.store.graph.getNode(c.record);return g?wt(te(e.store.schema,g.kind,c.record),{section:y?.section}):void 0}if("place"in c){if(c.place===wr)return wt("/",{section:y?.section});if(c.place===Mt)return jt;let g=e.views?.places().find(u=>u.as===c.place);return g?wt(ke(e,g),y):void 0}return e.store.schema.tryDefinition(c.list)?wt(`/${Y(e.store.schema,c.list)}`,y):void 0},l=c=>{c!==void 0&&n(c)},s=()=>{if(e.overview)return e.overview();e.embedded||window.location.assign(e.sceneHref??"/")},d=()=>e.overview?r===!1?void 0:r?r(jt):`${a}${jt}`:e.embedded?void 0:e.sceneHref??"/";return{record:(c,y)=>l(i({record:c},y)),place:(c,y)=>c===Mt?s():l(i({place:c},y)),list:(c,y)=>l(i({list:c},y)),draft:()=>n("/~draft"),href:(c,y)=>{if("place"in c&&c.place===Mt)return d();let g=r===!1?void 0:i(c,y);if(g!==void 0)return r?r(g):`${a}${g}`}}},[e,n,a,r]);return(0,R.jsx)(Fr.Provider,{value:o,children:t})}function ed(){let{pathname:e,search:t,hash:n}=Ce();return(0,_.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return fi(a)},[e,t,n]),null}function td({context:e,Home:t}){let n=Ce(),a=e.views,r=n.key==="default"&&!(a&&Or(a));(0,_.useEffect)(()=>{a&&$r(a)},[a]);let o=r?vr(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,i=o?.to==="place"?ke(e,o.place):o?.to==="kind"?`/${Y(e.store.schema,o.kind)}`:void 0;return i?(0,R.jsx)(ba,{to:i,replace:!0}):(0,R.jsx)(t,{context:e})}function as({context:e,registry:t}){let n=t?.lookupSurface("shell"),a=n!==void 0,r=a&&(t?.without().has("bar")??!1),o=a&&!r&&!e.embedded?{...e,barAbove:!0}:e,i=f=>n===void 0?(0,R.jsx)(Nn,{context:e,children:f}):r?(0,R.jsx)(n,{context:e,children:f}):(0,R.jsx)(Nn,{context:e,children:(0,R.jsx)(n,{context:o,children:f})}),l=t?.lookupSurface("home")??Na,s=t?.lookupSurface("problems")??Da,d=a?{...o,framed:!0}:e,[c,y]=(0,_.useState)(null),g=(0,_.useMemo)(()=>({context:d,registry:t}),[d,t]),u=(0,_.useMemo)(()=>({onFind:y,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),P=(0,R.jsx)(Ca.Provider,{value:g,children:(0,R.jsx)(ns,{context:e,children:(0,R.jsx)(Ql,{context:e,registry:t,children:i((0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(so,{face:"pages"}),(0,R.jsxs)(Vl,{context:d,children:[(0,R.jsx)(Zl,{}),(0,R.jsx)(ed,{}),(0,R.jsxs)(Yo,{children:[(t?.routes()??[]).map(({path:f,component:S})=>(0,R.jsx)(Ne,{path:f,element:(0,R.jsx)(S,{context:d})},f)),(0,R.jsx)(Ne,{path:"/",element:(0,R.jsx)(td,{context:d,Home:l})}),(0,R.jsx)(Ne,{path:"/problems",element:(0,R.jsx)(s,{context:d})}),(0,R.jsx)(Ne,{path:"/~draft",element:(0,R.jsx)(_.Suspense,{fallback:null,children:(0,R.jsx)(ql,{context:d})})}),(0,R.jsx)(Ne,{path:"/search",element:(0,R.jsx)(Fa,{context:d})}),(0,R.jsx)(Ne,{path:"/map",element:(0,R.jsx)(Ma,{context:d})}),(0,R.jsx)(Ne,{path:"/places",element:(0,R.jsx)(Ea,{context:d})}),He(d).some(f=>f.as===Mt)?null:(0,R.jsx)(Ne,{path:jt,element:(0,R.jsx)(ba,{to:"/",replace:!0})}),(0,R.jsx)(Ne,{path:"/places/:as",element:(0,R.jsx)(en,{context:d})}),(0,R.jsx)(Ne,{path:"/:slug",element:(0,R.jsx)(es,{context:d,registry:t,page:"list"})}),(0,R.jsx)(Ne,{path:"/:slug/:id",element:(0,R.jsx)(es,{context:d,registry:t,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?P:(0,R.jsx)(ri.Provider,{value:u,children:(0,R.jsx)(vo.Provider,{value:c,children:P})})}var nd=()=>typeof document>"u"?null:document.body;function ad({context:e,registry:t,basename:n,initialPath:a,onNavigate:r,path:o,steering:i,firstLook:l,hrefOf:s,typing:d}){let[c,y]=(0,_.useState)(void 0),g=c!==void 0&&c.from===e.principal?{...e,principal:c.seat}:e;(0,_.useState)(()=>g.views?Fo(g.views,g.store.schema,ya(g.brand,g.store.schema)):void 0);let u=we(),P=d??g.typing;er({reader:g.locale??u?.locale,app:g.brand?.locale??g.app?.brand?.locale,readerTimeZone:g.timeZone??u?.timeZone,appTimeZone:g.brand?.timeZone??g.app?.brand?.timeZone});let f=g.principal??jl,S=Tr(g.store,f,g.history),x=(S.past&&S.live===g.store?S.past.store:g.store).seenBy(f),b=x===g.store?g:{...g,store:x};Er(g.store,g.principal);let K=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Yl,{onNavigate:r,path:o}),i?(0,R.jsx)(_l,{steering:i}):null,b.presence||u?(0,R.jsx)(zl,{context:b,to:u}):null,(0,R.jsx)(as,{context:b,...t?{registry:t}:{}}),l?(0,R.jsx)(Ho,{firstLook:l,root:nd,app:ya(g.brand,g.store.schema)}):null]}),q=b.views?(0,R.jsxs)(Mr,{store:b.store,views:b.views,...b.principal?{principal:b.principal}:{},...b.brand?{brand:b.brand}:{},...b.locale?{locale:b.locale}:{},...b.timeZone?{timeZone:b.timeZone}:{},...b.settings?{settings:b.settings}:{},...b.presence&&!u?{presence:b.presence}:{},...P?{typing:P}:{},...b.people?{people:b.people}:{},...b.seats?{seats:b.seats}:{},onSeat:ee=>u?u.takeSeat(ee):y({from:e.principal,seat:ee}),...b.onKeepLens?{onKeepLens:b.onKeepLens}:{},...b.onProposeChange?{onProposeChange:b.onProposeChange}:{},...b.composeChange?{composeChange:b.composeChange}:{},...b.onDraftChange?{onDraftChange:b.onDraftChange}:{},...b.displayOptions?{displayOptions:b.displayOptions}:{},...b.keptViews?{keptViews:b.keptViews}:{},...b.onExport?{onExport:b.onExport}:{},...b.ai?{ai:b.ai}:{},...b.subscriptions?{subscriptions:b.subscriptions}:{},dismissals:b.dismissals,whileAway:b.whileAway,...b.signIn?{signIn:b.signIn}:{},resolveApp:b.resolveApp??u?.resolveApp,linkedRecords:b.linkedRecords??u?.linkedRecords,...b.app?{app:b.app}:{},...b.menuSections?{menuSections:b.menuSections}:{},children:[K,(0,R.jsx)(ns,{context:b,children:(0,R.jsx)(mi,{context:b})})]}):K,I=(0,R.jsx)(Lr.Provider,{value:S,children:q}),re=b.assetsAt?(0,R.jsx)(Cr.Provider,{value:b.assetsAt,children:I}):I,oe=b.files?(0,R.jsx)(Ar.Provider,{value:b.files,children:re}):re,N=b.viewerState?(0,R.jsx)(Rr.Provider,{value:b.viewerState,children:oe}):oe,M=s===void 0?N:(0,R.jsx)(ts.Provider,{value:s,children:N});if(a!==void 0){let ee=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,R.jsx)(Jo,{initialEntries:[ee],...n===void 0?{}:{basename:n},children:M})}return(0,R.jsx)(Qo,{...n===void 0?{}:{basename:n},children:M})}export{Cs as a,ad as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as O,b,c as w,d as R,e as V}from"./chunk.36FKQJFM.js";import{h as d,i as S}from"./chunk.RHV73CBA.js";import{Ra as $,Sa as F}from"./chunk.IUVRJDL3.js";var E=["card","row","page"],j=["good","warn","bad","neutral","accent"],U=["money","percent","date","time","datetime","relative","count"],_=4,T=40,I=120,L=["number","money","percent"],B=["large"],C=["card","row"],M=1e3,ce=100;function X(e){let n=/^\s*(out|in)\(\s*['"]([A-Za-z][A-Za-z0-9_-]*)['"]\s*\)\s*$/.exec(e);return n?{edge:n[2],way:n[1]}:/^[A-Za-z][A-Za-z0-9_-]*$/.test(e)?{edge:e}:void 0}var v={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone","lines"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label","emphasis"]},Z=Object.keys(v),G=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?, "emphasis"?: "large"}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?, "lines"?: 0-12}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,Y=e=>/^(image|video|file)$/.test(e?.of??e?.type??"");function ge(e){return Object.fromEntries(Object.entries(e.views??{}).filter(([,n])=>!Array.isArray(n)))}function ye(e){let n=e.views?.home;return Array.isArray(n)?n:void 0}var q={field:()=>!1,relation:()=>!1,figure:!1},z=e=>e.kind??"the home",m=(e,n)=>e!==void 0&&Object.hasOwn(e,n),g=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function W(e,n,t){let s=O(e);for(let a of s.unknownFunctions)t.findings.push(d("unknown-function",n,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of s.names){if(t.kind===null){t.findings.push(d("view-name",n,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||t.spec.field(a)||t.spec.relation(a)||t.findings.push(d("view-name",n,`${t.kind} has no field or relation called "${a}"`))}for(let a of s.edges)t.edges.has(a)||t.findings.push(d("view-edge",n,`"${a}" is not a relation any kind declares`));for(let a of s.sweeps)t.kinds.has(a)||t.findings.push(d("view-kind",n,`"${a}" is not a kind this document declares`))}function k(e,n,t){if(typeof e!="string"||e.length===0||e.length>2e3){t.findings.push(d("view-expression",n,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{W(w(e),n,t)}catch(s){if(!(s instanceof b))throw s;t.findings.push(d("expression",n,`${s.sentence} (at character ${s.at+1})`))}}function A(e,n,t,s,a=!1){let l=s==="text";if(typeof e!="string"||e.length===0||e.length>300){t.findings.push(d("view-template",n,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let r;try{r=V(e)}catch(i){if(i instanceof R||i instanceof b){t.findings.push(d("template",n,i.sentence));return}throw i}for(let i of r)if(i.expr){if(W(i.expr,n,t),l&&!a&&!i.format&&i.expr.t==="ident"&&(t.slot==="card"||t.slot==="row")&&t.spec.prose?.(i.expr.name)){let o=i.expr.name;t.findings.push(S("view-whole-text",n,`${t.kind} ${t.slot} shows ${o} whole; it will be clamped. Use {${o}|excerpt} or move it to the page.`,`write {${o}|excerpt}, or {${o}|excerpt: 80} for fewer characters`))}if(s==="headline"&&!i.format&&i.expr.t==="ident"&&t.spec.prose?.(i.expr.name)){let o=i.expr.name;t.findings.push(S("view-headline-long",n,`${z(t)}${t.slot?` ${t.slot}`:""} heads it with ${o}, a long text, drawn at a headline's size; a headline is a few words.`,`say it in a text block, {"text": "{${o}}"}, or head it with {${o}|excerpt: 60}`))}}}var K=12;function J(e,n,t){typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=K||t.findings.push(d("view-lines",n,`lines is ${JSON.stringify(e)}, and a text block's lines is a whole number from 1 to ${K}, or 0 to show it whole`,'{"text": "{awards}", "lines": 6}, or "lines": 0 for no cut at all'))}function Q(e,n,t){if(typeof e=="string"){j.includes(e)||t.findings.push(d("view-tone",n,`"${e}" is not a tone`,`use one of ${j.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(g(e)&&Object.keys(e).length===1&&"expr"in e){k(e.expr,`${n}.expr`,t);return}t.findings.push(d("view-tone",n,'a tone is a word or {"expr": \u2026}',`one of ${j.join(", ")}`))}function x(e,n,t,s){if(!Array.isArray(e)){s.findings.push(d("view-shape",n,"a view is a list of blocks"));return}if(t>_){s.findings.push(d("view-depth",n,`blocks nest at most ${_} deep`,"flatten a group or a condition"));return}e.forEach((a,l)=>ee(a,`${n}.${l}`,t,s))}function ee(e,n,t,s){if(t===1&&s.count++,s.all++,!g(e)){s.findings.push(d("view-block",n,"a block is an object naming what it shows",`one of ${G}`));return}let a=Object.keys(e),l=a.filter(o=>Z.includes(o)&&!(o==="group"&&a.includes("list")));if(l.length===0){s.findings.push(d("view-block",n,`${a.length>0?a.map(o=>`"${o}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${G}`));return}if(l.length>1){s.findings.push(d("view-block",n,`a block is one thing, and this says ${l.map(o=>`"${o}"`).join(" and ")}`,"split it into two blocks"));return}let r=l[0];for(let o of a)o!==r&&o!="key"&&!v[r].includes(o)&&s.findings.push(d("unknown-key",`${n}.${o}`,`"${o}" is not part of a ${r} block`,v[r].length>0?`a ${r} block may also say ${v[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=e[r];switch(r){case"title":case"headline":case"text":case"badge":A(i,`${n}.${r}`,s,r==="text"||r==="headline"?r:void 0,r==="text"&&"lines"in e),"tone"in e&&Q(e.tone,`${n}.tone`,s),r==="text"&&"lines"in e&&J(e.lines,`${n}.lines`,s);return;case"image":case"field":{let o=r==="image";if(typeof i!="string"||!(o?s.spec.files?.(i):s.spec.field(i))){let u=typeof i=="string"&&s.spec.relation(i);s.findings.push(d(`view-${r}`,`${n}.${r}`,`${s.kind} has no ${o?"image, video or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=o?["thumb","gallery"]:U;"as"in e&&!f.includes(e.as)&&s.findings.push(d("view-format",`${n}.as`,`"${String(e.as)}" is not a way to show ${o?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),o||D(e,n,s,"field"),"label"in e&&oe(e.label,`${n}.label`,s);return}case"progress":{!g(i)||Object.keys(i).some(o=>o!=="value"&&o!=="max")||!("value"in i)||!("max"in i)?s.findings.push(d("view-progress",`${n}.progress`,'progress is {"value": expression, "max": expression}')):(k(i.value,`${n}.progress.value`,s),k(i.max,`${n}.progress.max`,s)),"label"in e&&A(e.label,`${n}.label`,s);return}case"group":"direction"in e&&e.direction!=="row"&&e.direction!=="column"&&s.findings.push(d("view-direction",`${n}.direction`,`a group runs "row" or "column", not "${String(e.direction)}"`)),x(i,`${n}.group`,t+1,s);return;case"when":k(i,`${n}.when`,s),"show"in e?x(e.show,`${n}.show`,t+1,s):s.findings.push(d("view-when",n,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return ne(e,n,s);for(let o of["as","currency","label","emphasis"])o in e&&s.findings.push(d("unknown-key",`${n}.${o}`,`"${o}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?s.findings.push(d("view-block",`${n}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):s.spec.figure||s.findings.push(d("view-figure",`${n}.figure`,`${z(s)} has no figure to show`,s.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return te(e,n,s);case"divider":i!==!0&&s.findings.push(d("view-block",`${n}.${r}`,`write {"${r}": true}`));return}}function ne(e,n,t){k(e.figure,`${n}.figure`,t),"as"in e&&!L.includes(e.as)&&t.findings.push(d("view-format",`${n}.as`,`"${String(e.as)}" is not a way to say a figure`,`use one of ${L.join(", ")}`)),D(e,n,t,"figure"),"label"in e&&A(e.label,`${n}.label`,t),"emphasis"in e&&!B.includes(e.emphasis)&&t.findings.push(d("view-emphasis",`${n}.emphasis`,`"${String(e.emphasis)}" is not how loudly a figure is said`,`use ${B.map(s=>`"${s}"`).join(", ")}, or leave it out for the figure's own size`))}function D(e,n,t,s){"currency"in e&&(typeof e.currency!="string"||!/^[A-Z]{3}$/.test(e.currency)?t.findings.push(d("view-currency",`${n}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):e.as!=="money"&&t.findings.push(d("view-currency",`${n}.currency`,`a currency belongs on a ${s} shown as money`,'add "as": "money"')))}function ie(e,n){let t=[...n.kinds],s=(l,r)=>{let i=new Set;for(let o of l){let f=n.vocabulary.namesOf(o)?.targets?.(r);if(f==="*")return t;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=l=>{switch(l.t){case"ident":return n.kind!==null&&n.spec.relation(l.name)?s([n.kind],l.name):void 0;case"member":{let r=a(l.object);return r?s(r,l.name):void 0}case"where":return a(l.set);case"call":{let r=l.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(l.fn==="all")return i!==void 0&&n.kinds.has(i)?[i]:void 0;let o=l.args.length===2&&l.args[1]?.t==="lit"&&typeof l.args[1].value=="string"?l.args[1].value:void 0;if(l.fn==="out"&&o!==void 0){let f=a(r);return f?s(f,o):void 0}if(l.fn==="out")return i!==void 0&&n.kind!==null?s([n.kind],i):void 0;if(l.fn==="in"){let f=o??i,u=o!==void 0?a(r):n.kind!==null?[n.kind]:void 0,c=f!==void 0?n.vocabulary.sources(f).filter(p=>{let y=n.vocabulary.namesOf(p)?.targets?.(f);return!u||y==="*"||u.some(h=>y?.includes(h))}):[];return c.length>0?c:void 0}if((l.fn==="sort"||l.fn==="first")&&r)return a(r);if(l.fn==="either"){let f=l.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(e)}function N(e,n,t,s){let a;try{a=w(e)}catch(r){if(!(r instanceof b))throw r;s.findings.push(d("expression",n,`${r.sentence} (at character ${r.at+1})`));return}let l=O(a);for(let r of l.unknownFunctions)s.findings.push(d("unknown-function",n,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of l.edges)s.edges.has(r)||s.findings.push(d("view-edge",n,`"${r}" is not a relation any kind declares`));if(t)for(let r of l.names)r==="id"||t.some(i=>s.vocabulary.namesOf(i)?.field(r)||s.vocabulary.namesOf(i)?.relation(r))||s.findings.push(d("view-name",n,`${t.join(" and ")} ${t.length===1?"has":"have"} no field or relation called "${r}"`))}function te(e,n,t){let s=e.list;k(s,`${n}.list`,t);let a;if(typeof s=="string")try{a=ie(w(s),t)}catch{a=void 0}let l=i=>{if(!a)return[...t.kinds].map(f=>t.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let o=a.map(f=>t.vocabulary.namesOf(f)?.choices?.(i));return o.every(f=>f!==void 0)?[...new Set(o.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in e){let i=e.sort;if(typeof i=="string")N(i,`${n}.sort`,a,t);else if(g(i)&&typeof i.by=="string"&&Object.keys(i).every(o=>o==="by"||o==="direction")){let o=i.direction;o!==void 0&&o!=="asc"&&o!=="desc"&&o!=="choices"?t.findings.push(d("list-sort",`${n}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(o)}"`,'"choices" puts a choice field in the order its choices are declared')):o==="choices"?l(i.by)===void 0&&t.findings.push(d("list-sort",`${n}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):N(i.by,`${n}.sort.by`,a,t)}else t.findings.push(d("list-sort",`${n}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in e){let i=e.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>M)&&t.findings.push(d("list-limit",`${n}.limit`,`a limit is a whole number from 1 to ${M}`))}if("group"in e){let i=e.group,o=typeof i=="string"?i:g(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||g(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||o===void 0)t.findings.push(d("list-group",`${n}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}} \u2014 or a relation, like "inGenre", a heading per linked record'));else{let u=l(o),c=u===void 0?X(o):void 0,p=c!==void 0&&(c.way!==void 0?t.edges.has(c.edge):a?a.every(y=>t.vocabulary.namesOf(y)?.relation(c.edge)):t.edges.has(c.edge));if(u===void 0&&!p&&t.findings.push(d("list-group",`${n}.group`,`"${o}" is not a choice field or a relation of ${r}, so it has nothing to group by`,'group by a field whose type is enum, or by a relation of the kind listed, like "inGenre"')),g(i)&&"headings"in i){let y=i.headings;if(!g(y)||Object.values(y).some(h=>typeof h!="string"||h.length===0||h.length>80))t.findings.push(d("list-group",`${n}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let h of Object.keys(y))u.includes(h)||t.findings.push(d("list-group",`${n}.group.headings.${h}`,`"${h}" is not one of ${o}'s choices`,`use ${u.join(", ")}`))}}}"empty"in e&&(typeof e.empty!="string"||e.empty.length===0||e.empty.length>200)&&t.findings.push(d("list-empty",`${n}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in e&&!C.includes(e.as)&&t.findings.push(d("list-as",`${n}.as`,`a list draws each record as its "card" or its "row", not "${String(e.as)}"`))}function oe(e,n,t){(typeof e!="string"||e.length===0||e.length>60)&&t.findings.push(d("view-label",n,"a label is a few words, at most 60 characters"))}function P(e,n,t,s,a,l,r){let i={kind:null,spec:q,kinds:s,edges:a,vocabulary:t,findings:l,count:0,all:0};Array.isArray(e)&&e.length===0&&l.push(d("view-shape",n,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),x(e,n,1,i),H(i,n,r,"show less")}function H(e,n,t,s){e.count>T?e.findings.push(d("view-size",n,`${t} has ${e.count} blocks at its top; a view has at most ${T} there, a group or a condition counting as one`,`${s}, or gather some into a group`)):e.all>I&&e.findings.push(d("view-size",n,`${t} has ${e.all} blocks counting the ones inside its groups and conditions; a view has at most ${I} in all`,s))}function se(e,n,t,s,a){Array.isArray(e)&&e.forEach((l,r)=>{if(!g(l)||l.name!=="blocks"||!g(l.options)||!("blocks"in l.options))return;let i=[];P(l.options.blocks,`lenses.${r}.options.blocks`,n,t,s,i,`the lens "${String(l.title??r)}"`);for(let o of i)a.push({...o,severity:"warning"})})}function re(e,n,t,s,a,l,r){let i=[];if(e===void 0)return i;if(!g(e))return i.push(d("view-shape",n,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[o,f]of Object.entries(e)){if(o==="home"&&Array.isArray(f)){P(f,`${n}.home`,r,s,a,i,"the home");continue}let u=t(o);if(!u){i.push(d("view-kind",`${n}.${o}`,`"${o}" is not a kind this ${l} declares`));continue}if(!g(f)){i.push(d("view-shape",`${n}.${o}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))E.includes(c)||i.push(d("view-slot",`${n}.${o}.${c}`,`"${c}" is not a place a view is drawn`,`use ${E.map(p=>`"${p}"`).join(", ")}`));for(let c of E){let p=f[c];if(p===void 0)continue;let y={kind:o,spec:u,kinds:s,edges:a,vocabulary:r,findings:i,count:0,all:0,slot:c};x(p,`${n}.${o}.${c}`,1,y),H(y,`${n}.${o}.${c}`,`this ${c}`,"show less, or move detail to the page")}}return i}function he(e){let n=new Set(Object.keys(e.kinds)),t=new Set(Object.values(e.kinds).flatMap(r=>Object.keys($(r.edges)))),s=r=>{let i=m(e.kinds,r)?e.kinds[r]:void 0;return i?{field:o=>m(i.fields,o)||m(i.computed,o)||F(i.edges).has(o),relation:o=>m($(i.edges),o),figure:i.figure!==void 0,files:o=>m(i.fields,o)&&Y(i.fields[o]),choices:o=>m(i.fields,o)&&i.fields[o].type==="enum"?i.fields[o].options:void 0,targets:o=>m($(i.edges),o)?i.edges[o].to:void 0,prose:o=>m(i.fields,o)&&i.fields[o].type==="text"}:void 0},a={namesOf:s,sources:r=>Object.keys(e.kinds).filter(i=>m(e.kinds[i].edges,r))},l=re(e.views,"views",s,n,t,"document",a);return se(e.lenses,a,n,t,l),l}export{j as a,U as b,L as c,B as d,M as e,ce as f,X as g,ge as h,ye as i,he as j};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f,f as g}from"./chunk.3I2SGKKF.js";import{a}from"./chunk.TBY5IR7C.js";import"./chunk.BIDL7GQD.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.ZBK3FCVE.js";import"./chunk.DW6KXAUM.js";import"./chunk.HRLCDBMO.js";import"./chunk.LZNHTROY.js";import"./chunk.36FKQJFM.js";import"./chunk.RHV73CBA.js";import"./chunk.IUVRJDL3.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as PROPOSE_CHANGE,c as documentOfApp,a as mayChangeDeclaration,g as proposeReshape,e as readReshape,f as reshapeCard,d as reshapeQuestions};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as f}from"./chunk.HPWMCS3H.js";import"./chunk.F5STM4DX.js";import"./chunk.SWY6DIE4.js";import"./chunk.F5756PXX.js";import"./chunk.Q355UPFG.js";import{p as g}from"./chunk.3ZP6IDUC.js";import"./chunk.QG3LV4RH.js";import"./chunk.BQWMHHAZ.js";import"./chunk.2QALBEWP.js";import"./chunk.QQUZ5RTQ.js";import"./chunk.BJ3G7J2Z.js";import"./chunk.DIVANC3G.js";import"./chunk.KP7HUXH5.js";import"./chunk.4BSEYZMS.js";import"./chunk.KV3N6VRG.js";import"./chunk.FUTSLXWN.js";import"./chunk.MZSWWMX6.js";import"./chunk.MB7LKKUD.js";import"./chunk.6KYTCEIH.js";import"./chunk.FXCKKVT5.js";import"./chunk.NCBUECIW.js";import"./chunk.2T24FYAO.js";import"./chunk.JEQ6CA5M.js";import"./chunk.CM7EDQ4E.js";import"./chunk.SUYYDJGZ.js";import"./chunk.YR7DKU5T.js";import"./chunk.NKUNCQB3.js";import"./chunk.BJUUSIQY.js";import"./chunk.HMV4ILAC.js";import"./chunk.XAN7QXMQ.js";import"./chunk.XOZU4OFA.js";import"./chunk.CHG522KL.js";import"./chunk.WVUJXDXZ.js";import"./chunk.IRPMGHZN.js";import"./chunk.7QWGIGHM.js";import"./chunk.HRLCDBMO.js";import"./chunk.LZNHTROY.js";import"./chunk.36FKQJFM.js";import"./chunk.RHV73CBA.js";import"./chunk.MIE4TJRW.js";import"./chunk.RP6C2IUM.js";import"./chunk.RD2FSSLV.js";import"./chunk.T552MHMU.js";import"./chunk.ZGJUCVT5.js";import"./chunk.CVVNHQPO.js";import"./chunk.YIDNZTON.js";import"./chunk.QILGAV7H.js";import"./chunk.I6HIVTXU.js";import"./chunk.PYGNO2AV.js";import"./chunk.3HFBHLXC.js";import{G as b,Y as h}from"./chunk.CUA7F3YJ.js";import"./chunk.SDO3U72B.js";import{Ae as n}from"./chunk.IUVRJDL3.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var m=t(b(),1),a=t(h(),1);function P({store:c,auto:y,brand:i,views:u,presence:s,steering:r,overview:o,scope:d,titleLevel:w=2,quickAsk:l,props:e}){let v=(0,m.useMemo)(()=>g({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:y?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:v}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(f,{context:{store:c,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...o?{overview:o}:{},titleLevel:w,views:u,settings:e.app.settings??[],app:e.app,...s?{presence:s}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},dismissals:e.dismissals,whileAway:e.whileAway,...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.hrefOf?{hrefOf:e.hrefOf}:e.routing==="address"?{}:{hrefOf:!1},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{P as PagesContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ge,b as U}from"./chunk.SGYZM6ZU.js";import{a as ke}from"./chunk.CEQQIW7Z.js";import{a as pe,e as ye}from"./chunk.K6EKSURO.js";import{b as ie,c as se,d as le,e as de,f as ce,g as ue,h as me,i as fe,j as we}from"./chunk.KJAOJTZZ.js";import"./chunk.S4QSZRKH.js";import"./chunk.QDVGHI7R.js";import{a as Q,b as X,d as Y}from"./chunk.R65YX332.js";import"./chunk.MIE4TJRW.js";import{w as D}from"./chunk.RP6C2IUM.js";import"./chunk.RD2FSSLV.js";import"./chunk.T552MHMU.js";import"./chunk.ZGJUCVT5.js";import"./chunk.CVVNHQPO.js";import"./chunk.YIDNZTON.js";import"./chunk.QILGAV7H.js";import"./chunk.I6HIVTXU.js";import{G as ae,N as O,P as E,Qa as J,R as L,T as K,Y as $,ha as A,na as _,qa as P,ta as S,ua as q,wa as F,za as z}from"./chunk.CUA7F3YJ.js";import"./chunk.SDO3U72B.js";import"./chunk.IUVRJDL3.js";import"./chunk.FQLNBIQ5.js";import{b as C}from"./chunk.AJZBJBMO.js";var i=C(ae(),1);var a=C($(),1);function he(e,r){let n=e?.logo;if(!r||!n)return e;let s=o=>o.startsWith("/graview/assets/")?r(o):o;return{...e,logo:typeof n=="string"?s(n):{...n,light:s(n.light),...n.dark?{dark:s(n.dark)}:{}}}}var Ve=e=>({...e.node?{node:{id:e.node.id}}:{},...e.nodes?{nodes:e.nodes.map(r=>({id:r.id}))}:{},...e.label!==void 0?{label:e.label}:{},fidelity:e.fidelity,cardinality:e.cardinality,mode:e.mode,selected:e.selected,...e.implicated?{implicated:e.implicated}:{},...e.flagged?{flagged:e.flagged}:{}});function ne(e){let r=K(),n=r?.past?.seq,s=r?.host?.viewAt,o=(0,i.useMemo)(()=>n===void 0||!s||e.draft||e.keepsNothing?void 0:s(e.manifest.name,n),[s,n,e]);return(0,i.useMemo)(()=>o===null?null:o===void 0?e:{...e,worker:o},[o,e])}var T=new WeakMap,H=new Set,We=e=>(H.add(e),()=>void H.delete(e));function ve(e,r){r===void 0?T.delete(e):T.set(e,r);for(let n of[...H])n()}function re({definition:e,store:r,principal:n,input:s,goTo:o,places:l,arrangement:d,scheme:c,brand:f,onFailure:m,drawsItsOwn:w,tick:p}){let y=(0,i.useSyncExternalStore)(We,()=>T.get(e),()=>{}),t=(0,i.useMemo)(()=>y===void 0?e:{...e,worker:{source:y}},[e,y]),V=(0,i.useRef)(null),k=(0,i.useRef)(null),v=O(),b=E(),I=L(),R=(0,i.useContext)(_),x=(0,i.useMemo)(()=>he(f,b),[f,b]),u=(0,i.useRef)({input:s,goTo:o,places:l,arrangement:d,onFailure:m,brand:x,hostFiles:v,hostAssets:b,viewerState:I,told:R});u.current={input:s,goTo:o,places:l,arrangement:d,onFailure:m,brand:x,hostFiles:v,hostAssets:b,viewerState:I,told:R},(0,i.useEffect)(()=>{let W=V.current;if(!W)return;let j=t.file??(u.current.hostFiles?.src?g=>u.current.hostFiles?.src?.(g)??g:void 0);typeof t.worker=="function"&&U(t.worker).catch(()=>{});let B=g=>({manifest:t.manifest,worker:g,store:r,principal:n,input:()=>u.current.input?.()??{},goTo:()=>u.current.goTo,places:()=>u.current.places?.()??[],arrangement:()=>u.current.arrangement?.(),brand:()=>u.current.brand,onFailure:(h,oe)=>u.current.onFailure(h,oe),...w?{fallback:!1}:{},...t.limits?{limits:t.limits}:{},...t.author?{author:t.author}:{},...t.onProblem?{onProblem:t.onProblem}:{},...t.asset?{asset:t.asset}:u.current.hostAssets?{asset:h=>u.current.hostAssets?.(h)??h}:{},...j?{file:j}:{},...t.images?{images:t.images}:{},...t.links?{links:t.links}:{},files:()=>u.current.hostFiles,...t.draft||t.keepsNothing?{draft:!0}:{viewerState:()=>u.current.viewerState},onContentHeight:h=>u.current.told?.(h)}),te=X(Q,g=>{k.current=g.mountWorkerView(W,B(t.worker)),D(W,g.viewPlaceHandle({element:W,definition:t,mounted:()=>k.current,optionsFor:B,draw:h=>ve(e,h),mount:g.mountWorkerView,pressing:Y}))});return()=>{te(),D(W,null),k.current?.dispose(),k.current=null}},[t,r,n]),(0,i.useEffect)(()=>k.current?.update(),[c,x,p]);let N=(0,a.jsx)("div",{ref:V,"data-worker-view-place":t.manifest.name,style:{minWidth:0}});if(!t.draft)return N;let M=t.manifest.title??t.manifest.name;return(0,a.jsxs)("div",{role:"group","aria-label":`Draft: ${M}`,"data-graview-draft-view":t.manifest.name,style:{display:"grid",gap:8,alignContent:"start",minWidth:0},children:[(0,a.jsxs)("p",{"data-testid":"draft-view-line",style:be,children:[(0,a.jsxs)("span",{children:["Draft \u2014 ",(0,a.jsx)("span",{style:{color:"var(--graview-ink)",fontWeight:600},children:M})]}),(0,a.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,a.jsx)("span",{children:"Not kept"})]}),N]})}var be={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};function Z({view:e,props:r,fellBack:n}){return(0,a.jsx)("div",{"data-worker-view-fallback":"",...n?{"data-worker-view-fell-back":n.name,"data-worker-view-failed":n.reason}:{},style:{display:"contents"},children:(0,a.jsx)(e,{...r})})}var ee=(0,a.jsx)("div",{"data-worker-view-fallback":"",style:{display:"contents"}});function Se({name:e,reason:r,children:n}){return(0,a.jsx)("div",{"data-worker-view-fell-back":e,"data-worker-view-failed":r,style:{display:"contents"},children:n})}function G(e,r={}){let n=r.fallback,s=e.manifest.replaces==="page";function o(l){let d=A(),c=P(),f=(0,i.useContext)(J),[m,w]=(0,i.useState)(null),p=(0,i.useRef)(l);p.current=l;let y=ne(e);if(!d)return null;if(y===null)return n&&!(f&&S(n)&&!s)?(0,a.jsx)(Z,{view:n,props:l}):ee;if(m&&n)return f&&S(n)&&!s?ee:(0,a.jsx)(Z,{view:n,props:l,fellBack:{name:e.manifest.name,reason:m}});let t=r.beside&&!(f&&S(r.beside))?r.beside:void 0,V=(0,a.jsx)(re,{definition:y,store:d.store,principal:d.principal,input:()=>Ve(p.current),goTo:c,places:()=>d.views.places(),arrangement:()=>d.views.arrangement?.(),scheme:d.scheme,brand:d.brand,tick:l,drawsItsOwn:n!==void 0,onFailure:(k,v)=>{w(k),e.onFailure?.(k,v)}});return t?(0,a.jsxs)("div",{"data-worker-view-beside":e.manifest.name,style:{display:"grid",gap:12,minWidth:0},children:[V,e.manifest.bleed==="full"?(0,a.jsx)("div",{"data-worker-view-beside-under":"",style:{minWidth:0},children:(0,a.jsx)(t,{...l})}):(0,a.jsx)(t,{...l})]}):V}return o.displayName=`WorkerView(${e.manifest.name})`,o}function xe(e,r){let{manifest:n}=r;if(n.attach==="home"){if(!e.home)throw new Error(`The worker view "${n.name}" is the home's body: draw it with workerHome, on the home.`);let m=e.homes?.(),w=r.draft?void 0:m?m.filter(y=>y.name===void 0).at(-1)?.view:e.homeView?.(),p=G(r,w?{fallback:w}:{});return e.home(n.bleed===!0||n.bleed==="full"?F(p,n.bleed):p,r.draft?void 0:{name:n.name}),e}let s={cardinality:n.cardinality,fidelity:"full"},o=e.lookup(n.attach,s)??e.resolve(n.attach,s)?.view,l=n.cardinality==="one",d=r.draft===!0,c=G(r,{...o&&!d?{fallback:o}:{},...l&&n.replaces!=="page"&&o?{beside:o}:{}});n.replaces==="page"&&q(c);let f=o?.says;return l&&n.replaces!=="page"&&typeof f=="function"&&(c.says=f),(n.bleed===!0||n.bleed==="full")&&F(c,n.bleed),c.flows=n.flows!==!1,n.heading==="own"&&(c.ownHeading=!0),z(c,n.scene?.maxHeight!==void 0?{maxHeight:n.scene.maxHeight}:{}),e.register(n.attach,s,c,n.title?{title:n.title,...d?{}:{name:n.name},lens:"view",...n.reads?.kinds?.length?{reads:n.reads.kinds}:{}}:d?void 0:{name:n.name}),e}function Ce(e,r={}){let n=r.fallback;function s({context:o}){let l=A(),d=P(),[c,f]=(0,i.useState)(null),m=ne(e);return c&&n?(0,a.jsx)(Se,{name:e.manifest.name,reason:c,children:(0,a.jsx)(n,{context:o})}):m===null&&n?(0,a.jsx)(n,{context:o}):m===null?null:(0,a.jsx)(re,{definition:m,store:o.store,principal:o.principal??l?.principal??{kind:"human"},goTo:d,...l?{places:()=>l.views.places(),arrangement:()=>l.views.arrangement?.(),scheme:l.scheme,brand:l.brand}:{},drawsItsOwn:n!==void 0,onFailure:(w,p)=>{f(w),e.onFailure?.(w,p)}})}return s.displayName=`WorkerHome(${e.manifest.name})`,s}export{se as checkManifest,ke as checkViewSource,ue as edgesReadWithoutTheirKinds,me as edgesReadWithoutTheirKindsSaid,ye as judgeCodeAct,ie as manifestActs,ce as ownKindRelations,fe as readsComputed,xe as registerWorkerView,pe as sightIsTotal,le as unreadEdges,de as unreadEdgesSentence,ge as viewScript,Ce as workerHome,G as workerView,we as workerViewProps};
|