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,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{c as lt}from"./chunk.U2DZE7A5.js";import{a as Xe}from"./chunk.CEQQIW7Z.js";import{a as W,b as Ue,c as q,d as J,e as le,g as he,h as $e,i as Ve,j as Q}from"./chunk.BBLA4PSP.js";import"./chunk.QG3LV4RH.js";import{a as Qe,d as et,e as tt,f as rt,g as nt}from"./chunk.YCMMATFK.js";import{h as We}from"./chunk.F5XWYO5W.js";import{b as He,c as Fe}from"./chunk.FSZQTX3K.js";import{h as X,i as st,k as at}from"./chunk.OXXZGPJZ.js";import{e as Ke}from"./chunk.K6EKSURO.js";import{b as be,c as qe,h as Je,i as Ye,j as Ze}from"./chunk.KJAOJTZZ.js";import{f as Be,g as ze}from"./chunk.S4QSZRKH.js";import{d as Ge}from"./chunk.QDVGHI7R.js";import{a as de,c as se,d as ge,e as _e,h as ce,j as ye}from"./chunk.M5FP4Y4Q.js";import{d as ot,k as it}from"./chunk.RSMCTI2N.js";import"./chunk.5IM2X3VT.js";import{a as Ae,b as Me,c as Le}from"./chunk.NKUNCQB3.js";import"./chunk.MR776WQ2.js";import"./chunk.CVVNHQPO.js";import{Wb as fe,Wd as Re,Zb as me,ma as Ce,se as je,te as De}from"./chunk.IUVRJDL3.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var Ct="http://www.w3.org/1999/xhtml",ae=class{constructor(t){this.ownerDocument=t}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof U?this.parentNode:null}get textContent(){return this.childNodes.map(t=>t.textContent).join("")}insertBefore(t,r){t.parentNode&&t.parentNode.removeChild(t);let s=r?this.childNodes.indexOf(r):-1;return s<0?this.childNodes.push(t):this.childNodes.splice(s,0,t),t.parentNode=this,t}appendChild(t){return this.insertBefore(t,null)}removeChild(t){let r=this.childNodes.indexOf(t);return r>=0&&this.childNodes.splice(r,1),t.parentNode=null,t}},ee=class extends ae{constructor(r,s){super(r);this.data=s}nodeType=3;get textContent(){return this.data}},Te=class extends ae{nodeType=8;get textContent(){return""}},U=class extends ae{constructor(r,s,a){super(r);this.namespaceURI=s;this.localName=a}nodeType=1;attributes=new Map;value="";checked=!1;selected=!1;setAttribute(r,s){this.attributes.set(r,String(s))}removeAttribute(r){this.attributes.delete(r)}getAttribute(r){return this.attributes.get(r)??null}hasAttribute(r){return this.attributes.has(r)}closest(r){for(let s=this;s;s=s.parentElement)if(s.localName===r)return s;return null}},Ee=class extends ae{nodeType=9;constructor(){super(null)}createElementNS(t,r){return new U(this,t,r)}createElement(t){return new U(this,Ct,t)}createTextNode(t){return new ee(this,t)}createComment(t){return new Te(this)}};function dt(){let e=new Ee,t=e.createElement("div");return t.setAttribute("data-graview-view-root",""),e.appendChild(t),{document:e,root:t}}function we(e,t,r){let{root:s}=dt(),a=!1,i=Qe(s,{origin:r.origin??"null",...r.imageOrigins?{imageOrigins:r.imageOrigins}:{},...r.asset?{asset:r.asset}:{},...r.link?{link:r.link}:{},maxNodes:r.maxNodes,onOverBudget:()=>a=!0});for(let b of e)i.apply(b);let p=[...i.refused],l="";if(t){let b=Fe(t);l=b.css;for(let o of b.refused)p.push({reason:"css",name:"stylesheet",css:o})}let d=r.theme?He(r.theme).css:"",f=et(d,l);return{root:s,refused:p,size:i.size,over:a,css:f,elementOf:b=>i.elementOf(b),idOf:b=>i.idOf(b)}}var ue=function*(e){for(let t of e.childNodes)t instanceof U&&(yield t,yield*ue(t))},ve=(e,t,r)=>{for(let s=e;s&&s!==t;s=s.parentElement)if(r(s))return s},ct=e=>{let t=["id","class","data-record","data-place","data-act","role","name"].flatMap(r=>e.getAttribute(r)===null?[]:[` ${r}="${e.getAttribute(r).slice(0,80)}"`]);return`<${e.localName}${t.join("")}>`},ut=e=>e.childNodes.map(t=>t instanceof U?ut(t):t.nodeType===3?t.textContent:"").join("");function Oe(e,t,r){let s=r.typed??{},a=[],i=[...ue(e)].filter(p=>p.getAttribute("data-act")!==null).map(p=>p.getAttribute("data-act"));for(let p of ue(e)){let l=p.getAttribute("name");if(!l||!["input","select","textarea"].includes(p.localName))continue;let d=(p.getAttribute("type")??"text").toLowerCase(),f=Object.hasOwn(s,l);if(d==="radio"){let b=p.getAttribute("value")??"on";if(f?String(s[l])!==b:!p.checked)continue;a.push({name:l,value:b,typed:f,empty:!1,chosen:!0})}else if(p.localName==="select"){let b=[...ue(p)].filter(T=>T.localName==="option"),o=b.find(T=>T.selected||T.getAttribute("selected")!==null)??b[0],A=f?String(s[l]):o?o.getAttribute("value")??ut(o).trim():"";a.push({name:l,value:A,typed:f,empty:A===""&&!f,chosen:!0})}else if(d==="checkbox"){let b=f?s[l]===!0||s[l]==="true"||s[l]==="on":p.checked;a.push({name:l,value:b,typed:f,empty:!b&&!f})}else{let b=ve(p,e,N=>N.getAttribute("data-record")!==null)?.getAttribute("data-record")??t,o=p.value===""&&p.getAttribute("data-prefill")===l&&b?at(r.store,r.principal,r.manifest,r.shown,{record:b,field:l,acts:i}):void 0,A=o!==void 0?{record:b,field:l,value:o}:void 0,T=f?s[l]:o??p.value,y=(d==="number"||d==="range")&&T!==""&&Number.isFinite(Number(T))?Number(T):typeof T=="boolean"?String(T):T;a.push({name:l,value:y,typed:f||A!==void 0,empty:y===""&&!f&&!A,...A?{from:A}:{}})}}return a}function pt(e,t,r,s){let a=r.asked.slice(e.asked),i=r.went.slice(e.went),p=r.renders.length>e.renders,l=e.target!==void 0?t.elementOf(e.target):void 0,d=[...a.map(y=>`its code asked for "${y.name}"`),...i.map(y=>`its code asked to go to "${"record"in y?y.record:y.place}"`),...p?["it drew again"]:[]],f=d.length>0?` When the view heard the click, ${d.join(", ")}.`:"";if(!l)return{selector:e.selector,asked:a,went:i,redrew:p,says:`"${e.selector}" matches nothing the view drew: there is nothing there to press.`};let b=t.root,o={},A=[],T=ye(l,b,y=>ce(y,[...ue(y)].some(de)));if(T){let y=T.getAttribute("data-filter"),N=T.getAttribute("data-section"),k=T.getAttribute("data-record"),$={...y?{where:he(y)}:{},...N?{section:N}:{}},u=k?{record:k,...$}:{place:T.getAttribute("data-place")??"",...$},h=Q(u,{sees:n=>s.shown.has(n),places:s.places,lists:s.lists,schema:s.store.schema});if(h.ok){o.opens=h.arrival;let n=h.arrival,c="filter"in n&&n.filter?`, narrowed to ${n.filter}`:"";A.push(`It opens ${"record"in n?`the record "${n.record}"`:"place"in n?`the place "${n.place}"`:`the list of ${n.list}`}${c}${n.section?`, at "${n.section}"`:""}.`)}else{let n="place"in u?u.place:u.record,c=!("record"in u&&s.shown.has(u.record))&&!W(s.places,n)&&!s.lists.some(g=>g.slug===n||g.kind===n);o.lost=s.placesUnsure&&c?`${h.says}${J}`:h.says,A.push(`It lands in a link that goes nowhere: ${o.lost}`)}}let m=ve(l,b,y=>y.getAttribute("data-act")!==null);if(m){let y=m.getAttribute("data-act"),N=se(m);if(N)A.push(`It is bound to "${y}", and is never pressed: ${N}`);else if(ge(m)){let k=ve(m,b,c=>c.getAttribute("data-record")!==null)?.getAttribute("data-record")??void 0,$=ve(m,b,c=>c.localName==="fieldset"||c.getAttribute("role")==="group")??b,u={as:y,...k!==void 0?{record:k}:{},fields:Oe($,k,s)},h=X(s.store,s.manifest,s.shown,u);if(!h.ok)o.act={as:y,ok:!1,reason:h.reason,message:h.message};else try{let c=s.store.previewAll([{name:h.name,args:h.args}],{author:s.principal,via:`view:${s.manifest.name}`});o.act={as:y,ok:!0,name:h.name,args:h.args,intent:c.intent,changes:c.ops.length>0}}catch(c){o.act=c instanceof fe?{as:y,ok:!1,reason:"refused",message:c.refusal.message}:c instanceof me?{as:y,ok:!1,reason:"failed",message:Be(c)}:{as:y,ok:!1,reason:"failed",message:"The act could not be applied."}}let n=o.act;A.push(n.ok?`It asks for "${n.name}" with ${JSON.stringify(n.args)}: ${n.changes?`\u201C${n.intent}\u201D, applied for this seat, were it pressed.`:"applied for this seat, it would change nothing."}`:`It asks for "${y}", which the host refuses (${n.reason}): ${n.message}`)}}return A.length===0&&A.push(`It is bound to no act and lands in no link: the host does nothing there${d.length>0?"":", and the view's code does nothing either"}.`),{selector:e.selector,element:ct(l),...o,asked:a,went:i,redrew:p,says:`A press on ${ct(l)}: ${A.join(" ")}${f}`}}var te=function*(e){for(let t of e.childNodes)t instanceof U&&(yield t,yield*te(t))},oe=(e,t,r)=>{for(let s=e;s&&s!==t;s=s.parentElement)if(r(s))return s},ke=e=>e.childNodes.map(t=>t instanceof U?t.getAttribute("aria-hidden")==="true"?"":ke(t):t.nodeType===3?t.textContent:"").join(""),gt=e=>{let t=["id","class","data-record","data-place","data-act","data-file","href","role","name"].flatMap(r=>e.getAttribute(r)===null?[]:[` ${r}="${e.getAttribute(r).slice(0,80)}"`]);return`<${e.localName}${t.join("")}>`},Rt=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.localName==="label")return t.childNodes.map(r=>r===e?"":r instanceof U?ke(r):r.nodeType===3?r.textContent:"").join("");return""},I=e=>{let t=(e.getAttribute("aria-label")??(e.localName==="select"?Rt(e):ke(e))).replace(/\s+/g," ").trim()||e.getAttribute("title")||e.getAttribute("name")||"";return t?`\u201C${t.length>60?`${t.slice(0,59)}\u2026`:t}\u201D`:gt(e)},ft={number:"1",range:"1",date:"2026-01-15","datetime-local":"2026-01-15T09:00",time:"09:00",month:"2026-01",week:"2026-W03",email:"someone@example.com",url:"https://example.com",tel:"+1 555 0100",text:"A test",search:"A test",textarea:"A test"},mt=e=>e.localName==="select"?void 0:e.localName==="textarea"?ft.textarea:ft[(e.getAttribute("type")??"text").toLowerCase()],jt=e=>{let t=[...te(e)].filter(i=>i.localName==="option"),r=i=>i.getAttribute("value")??ke(i).trim(),s=t.find(i=>i.selected||i.getAttribute("selected")!==null)??t[0],a=t.find(i=>i!==s&&i.getAttribute("disabled")===null&&r(i)!==""&&(!s||r(i)!==r(s)));return a?r(a):s?r(s):""},ht=new Set(["input","textarea","select"]),Dt=e=>e.localName==="button"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"||_e(e)||["link","menuitem","menuitemcheckbox","menuitemradio","option"].includes(e.getAttribute("role")??"")||e.localName==="a"&&!e.hasAttribute("href")&&!e.hasAttribute("data-record")&&!e.hasAttribute("data-place")&&!e.hasAttribute("data-file"),Mt=new Set(["tab","option","gridcell"]),Lt=new Set(["checkbox","menuitemcheckbox","menuitemradio","option","radio","switch","treeitem"]),Ht=new Set(["group","radiogroup","tablist","listbox","menu","menubar","toolbar","grid","tree"]),Ft=new Set(["","undefined","false"]),Ut=new Set(["link","tab","menuitem","treeitem","option"]),_t=e=>{let t=e.getAttribute("role");return t===null?e.localName==="a":Ut.has(t)},Vt=e=>{let t=e.getAttribute("role")??"";if(e.getAttribute("aria-pressed")==="true")return{name:"aria-pressed",value:"true"};if(e.getAttribute("aria-selected")==="true"&&Mt.has(t))return{name:"aria-selected",value:"true"};if(e.getAttribute("aria-checked")==="true"&&Lt.has(t))return{name:"aria-checked",value:"true"};let r=e.getAttribute("aria-current");return r!==null&&!Ft.has(r)&&_t(e)?{name:"aria-current",value:r}:void 0},Bt=(e,t)=>oe(e,t,r=>r.hasAttribute("hidden")||r.getAttribute("aria-hidden")==="true"||/(?:^|;)\s*(?:display\s*:\s*none|visibility\s*:\s*hidden)/i.test(r.getAttribute("style")??""))!==void 0,zt=(e,t,r)=>{let s=e.getAttribute("role"),a=e.parentElement,i=a?a.childNodes.filter(d=>d instanceof U):[],l=(a?.localName==="li"&&t==="aria-current"?a.parentElement??void 0:void 0)??(a?oe(a,r,d=>Ht.has(d.getAttribute("role")??"")):void 0);return[...new Set([...i,...l?te(l):[]])].filter(d=>{if(d===e||d.localName!==e.localName||d.getAttribute("role")!==s||Bt(d,r))return!1;let f=d.getAttribute(t);return f==="false"||t==="aria-current"&&f===null})},Wt=e=>e.localName==="summary"||e.hasAttribute("data-lightbox")||e.hasAttribute("data-drop")||e.localName==="graview-video";async function yt(e){let{drawn:t,store:r,principal:s,manifest:a}=e,i=t.root,p=[...te(i)],l=new Set(e.clicks),d=n=>oe(n,i,c=>l.has(t.idOf(c)??""))!==void 0,f=new Set(p.flatMap(n=>n.getAttribute("id")?[n.getAttribute("id")]:[])),b=[],o=(n,c,g,w)=>b.push({control:I(n),element:gt(n),does:c,ok:g,says:w}),A=`view:${a.name}`,T=(n,c)=>{try{return{ok:!0,intent:r.previewAll([{name:n,args:c}],{author:s,via:A}).intent}}catch(g){return g instanceof fe?{ok:!1,message:`this seat may not: ${g.refusal.message}`,missing:!1}:g instanceof me?{ok:!1,message:ze(g),missing:g.issues.some(w=>/required|received undefined/i.test(w.message))}:{ok:!1,message:`the act threw: ${g instanceof Error?g.message.slice(0,200):String(g)}`,missing:!1}}},m=(n,c)=>{let g=oe(n,i,O=>O.getAttribute("data-record")!==null)?.getAttribute("data-record")??void 0,w=oe(n,i,O=>O.localName==="fieldset"||O.getAttribute("role")==="group")??i;return{as:n.getAttribute("data-act"),...g!==void 0?{record:g}:{},fields:Oe(w,g,{store:r,principal:s,manifest:a,shown:e.shown,places:e.places,lists:e.lists,typed:c})}},y=(n,c)=>{let g=m(n,c),w=X(r,a,e.shown,g);if(!w.ok)return{ok:!1,message:w.message,missing:!1,press:g};let O=T(w.name,w.args);return O.ok?{ok:!0,intent:O.intent,args:w.args,press:g}:{...O,press:g}},N=(n,c)=>{let g=I(n),w=n.getAttribute("data-act"),O=oe(n,i,x=>x.localName==="fieldset"||x.getAttribute("role")==="group")??i,Y=[...te(O)].filter(x=>ht.has(x.localName)&&x.getAttribute("name")),L=c==="save"&&n.localName==="select"&&n.getAttribute("name")?{[n.getAttribute("name")]:jt(n)}:{},R=y(n,L),_=!1,j=Y.filter(x=>x.value===""&&!R.press.fields.find(D=>D.name===x.getAttribute("name"))?.from&&mt(x)!==void 0),K=Object.fromEntries(j.map(x=>[x.getAttribute("name"),mt(x)]));if(j.length>0){let x=y(n,{...L,...K});x.ok?[R,_]=[x,!R.ok]:(R.ok||R.missing)&&(R=x)}if(!R.ok)return o(n,c,!1,`${g} is refused: ${R.message.replace(/\.$/,"")}.`);let S=r.allMutations().find(x=>x.name===X(r,a,e.shown,R.press).name)?.input?.shape??{},E=R.press.fields.filter(x=>x.from&&Object.hasOwn(S,x.name)&&st(S[x.name],void 0)).map(x=>x.name);if(E.length>0){let x={...L,..._?K:{},...Object.fromEntries(E.map(P=>[P,""]))},D=y(n,x);if(!D.ok)return o(n,c,!1,`${g} is refused when ${E.map(P=>`\u201C${P}\u201D`).join(" and ")} ${E.length===1?"is":"are"} emptied: ${D.message.replace(/\.$/,"")}.`)}return o(n,c,!0,`${g} asks for \u201C${w}\u201D${_?" once its fields are filled":""}${R.intent?`: \u201C${R.intent}\u201D`:", which changes nothing as it is drawn"}.`)},k=0,$=e.maxRuns??24;for(let n of p){if(Wt(n))continue;if(n.hasAttribute("data-act")){let S=se(n);if(ht.has(n.localName)&&n.hasAttribute("data-save")){let E=n.getAttribute("data-save");E!=="input"&&E!=="change"?o(n,"save",!1,`${I(n)} saves nothing: data-save is "input" or "change", not "${E}".`):N(n,"save")}else S?o(n,"act",!1,`${I(n)} is bound to \u201C${n.getAttribute("data-act")}\u201D and is never pressed: ${S}`):ge(n)&&N(n,"act");continue}if(n.localName==="a"&&(n.getAttribute("href")??"").startsWith("#")){let S=n.getAttribute("href").slice(1);o(n,"jump",f.has(S),f.has(S)?`${I(n)} jumps to #${S}.`:`${I(n)} jumps to #${S}, and the view drew no element with that id.`);continue}if(n.hasAttribute("data-file")){let S=n.getAttribute("data-file")??"",E=n.getAttribute("data-field")??"",x=e.shown.has(S)?r.seenBy(s).graph.getNode(S):void 0,D=x&&E?Ge(x[E]):[],P=Number(n.getAttribute("data-index")??"0"),V=D[Number.isInteger(P)&&P>=0?P:0];n.localName!=="a"?o(n,"file",!1,`${I(n)} is a file link on a <${n.localName}>: a file link is an <a data-file>.`):x?V?o(n,"file",!0,`${I(n)} ${n.hasAttribute("data-download")?"downloads":"opens"} \u201C${V.name??"the file"}\u201D.`):o(n,"file",!1,`${I(n)} links to the file in "${E||"(no data-field)"}" of "${S}", which holds none.`):o(n,"file",!1,`${I(n)} links to a file of "${S}", which is no record this view was shown.`);continue}if(ce(n,[...te(n)].some(de))){let S=n.getAttribute("data-filter"),E=n.getAttribute("data-section"),x=n.getAttribute("data-record"),D={...S?{where:he(S)}:{},...E?{section:E}:{}},P=x?{record:x,...D}:{place:n.getAttribute("data-place")??"",...D},V=Q(P,{sees:v=>e.shown.has(v),places:e.places,lists:e.lists,schema:r.schema});if(V.ok){let v=V.arrival;o(n,"link",!0,`${I(n)} opens ${"record"in v?`the record "${v.record}"`:"place"in v?`the place "${v.place}"`:`the list of ${v.list}`}.`)}else{let v="place"in P?P.place:P.record,H="place"in P&&!W(e.places,v)&&!e.lists.some(B=>B.slug===v||B.kind===v);e.placesUnsure&&H?o(n,"link",!0,`${I(n)} may go nowhere: ${V.says}${J}`):o(n,"link",!1,`${I(n)} goes nowhere: ${V.says}`)}continue}let c=t.idOf(n),g=l.has(c??"");if(!Dt(n)&&!g||!g&&ye(n,i,S=>ce(S,[...te(S)].some(de))))continue;if(!d(n)){o(n,"nothing",!1,`${I(n)} does nothing: it is bound to no act (data-act), goes nowhere (data-record, data-place), and the view hears no click on it.`);continue}if(c===void 0)continue;if(k>=$){o(n,"code",!0,`${I(n)} was not pressed: the check presses ${$} controls the view's code hears, and this is past them.`);continue}k+=1;let w=await e.rerun(c);if(!w.ok){o(n,"code",!1,w.reason==="error"?`${I(n)} throws when pressed: ${w.detail.replace(/^It threw: /,"")}`:`${I(n)}, pressed, stopped the view (${w.reason}): ${w.detail}`);continue}let O=w.transcript.pressed;if(!O||O.target===void 0){o(n,"code",!1,`${I(n)} could not be pressed in a run of its own: it was not drawn there the same way.`);continue}let Y=w.transcript.asked.slice(O.asked),L=w.transcript.went.slice(O.went),R=w.transcript.renders.length>O.renders,_=[];for(let S of Y){let E=Ke(r,a,S.name,S.args??{},{shown:e.shown,file:()=>{},dropped:()=>{}});if(!E.ok)_.push(`it asks for \u201C${S.name}\u201D from its code, which is refused: ${E.message}${E.reason==="press-only"?` Bind the button to it instead: data-act="${S.name}".`:""}`);else{let x=T(E.name,E.args);x.ok||_.push(`it asks for \u201C${S.name}\u201D, which is refused: ${x.message}`)}}for(let S of L){let E=Q(S,{sees:x=>e.shown.has(x),places:e.places,lists:e.lists,schema:r.schema});E.ok||_.push(`it asks to go nowhere: ${E.says}`)}let j=Y.length===0&&L.length===0&&!R?Vt(n):void 0,K=!1,ie=!1;if(j)for(let S of zt(n,j.name,i)){let E=j.name==="aria-current";if(S.hasAttribute("data-act")||E&&(S.hasAttribute("data-record")||S.hasAttribute("data-place")||S.hasAttribute("href"))){K=!0;break}let x=t.idOf(S);if(x===void 0||!d(S))continue;if(k>=$){ie=!0;break}k+=1;let D=await e.rerun(x),P=D.ok?D.transcript.pressed:void 0;if(!D.ok||!P||P.target===void 0)continue;let V=we(D.transcript.renders,void 0,{maxNodes:1e5}).elementOf(c);if(D.transcript.asked.length>P.asked||E&&D.transcript.went.length>P.went||V?.getAttribute(j.name)!==j.value){K=!0;break}}_.length>0?o(n,"code",!1,`${I(n)}, pressed: ${_.join("; ")}`):j&&K?o(n,"code",!0,`${I(n)} is already in the state it shows (${j.name}="${j.value}"): pressed, it leaves the view as it is.`):j&&ie?o(n,"code",!0,`${I(n)} was not pressed: the check presses ${$} controls the view's code hears, and this is past them.`):j?o(n,"code",!1,`${I(n)} does nothing when pressed: it says ${j.name}="${j.value}", and no press on this view takes that from it.`):Y.length===0&&L.length===0&&!R?o(n,"code",!1,`${I(n)} does nothing when pressed: the view hears the click, and asks for no act, goes nowhere and draws nothing new.`):o(n,"code",!0,`${I(n)}, pressed, ${[...Y.length>0?[`asks for ${Y.map(S=>`\u201C${S.name}\u201D`).join(", ")}`]:[],...L.length>0?["goes where it says"]:[],...R?["draws again"]:[]].join(" and ")}.`)}let u=b.filter(n=>!n.ok),h=[`Presses: ${b.length} control${b.length===1?"":"s"} pressed, ${u.length===0?"every one does what it says":`${u.length} ${u.length===1?"fails":"fail"}`}.`];for(let n of b)h.push(` ${n.ok?"ok ":"FAILS"} ${n.says}`);return{ok:u.length===0,controls:b,problems:u,text:`${h.join(`
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{c as lt}from"./chunk.SXGPRFA4.js";import{a as Xe}from"./chunk.CEQQIW7Z.js";import{a as W,b as Ue,c as q,d as J,e as le,g as he,h as $e,i as Ve,j as Q}from"./chunk.73RMM4W7.js";import"./chunk.KFYSKZC4.js";import{a as Qe,d as et,e as tt,f as rt,g as nt}from"./chunk.GOVRX2YX.js";import{h as We}from"./chunk.TRP66PHK.js";import{b as He,c as Fe}from"./chunk.PGT4ZQDG.js";import{h as X,i as st,k as at}from"./chunk.4PB5UFUJ.js";import{e as Ke}from"./chunk.VUE6ILQV.js";import{b as be,c as qe,h as Je,i as Ye,j as Ze}from"./chunk.2IOJNFCR.js";import{f as Be,g as ze}from"./chunk.AAPXF6NP.js";import{d as Ge}from"./chunk.QDVGHI7R.js";import{a as de,c as se,d as ge,e as _e,h as ce,j as ye}from"./chunk.M5FP4Y4Q.js";import{f as ot,m as it}from"./chunk.OQ3FKUP2.js";import"./chunk.JP33TNCH.js";import{a as Ae,b as Me,c as Le}from"./chunk.O5P6LXHF.js";import"./chunk.DYPSFTRP.js";import"./chunk.TDWJU6GW.js";import{Wb as fe,Wd as Re,Zb as me,ma as Ce,se as je,te as De}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var Ct="http://www.w3.org/1999/xhtml",ae=class{constructor(t){this.ownerDocument=t}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof U?this.parentNode:null}get textContent(){return this.childNodes.map(t=>t.textContent).join("")}insertBefore(t,r){t.parentNode&&t.parentNode.removeChild(t);let s=r?this.childNodes.indexOf(r):-1;return s<0?this.childNodes.push(t):this.childNodes.splice(s,0,t),t.parentNode=this,t}appendChild(t){return this.insertBefore(t,null)}removeChild(t){let r=this.childNodes.indexOf(t);return r>=0&&this.childNodes.splice(r,1),t.parentNode=null,t}},ee=class extends ae{constructor(r,s){super(r);this.data=s}nodeType=3;get textContent(){return this.data}},Te=class extends ae{nodeType=8;get textContent(){return""}},U=class extends ae{constructor(r,s,a){super(r);this.namespaceURI=s;this.localName=a}nodeType=1;attributes=new Map;value="";checked=!1;selected=!1;setAttribute(r,s){this.attributes.set(r,String(s))}removeAttribute(r){this.attributes.delete(r)}getAttribute(r){return this.attributes.get(r)??null}hasAttribute(r){return this.attributes.has(r)}closest(r){for(let s=this;s;s=s.parentElement)if(s.localName===r)return s;return null}},Ee=class extends ae{nodeType=9;constructor(){super(null)}createElementNS(t,r){return new U(this,t,r)}createElement(t){return new U(this,Ct,t)}createTextNode(t){return new ee(this,t)}createComment(t){return new Te(this)}};function dt(){let e=new Ee,t=e.createElement("div");return t.setAttribute("data-graview-view-root",""),e.appendChild(t),{document:e,root:t}}function we(e,t,r){let{root:s}=dt(),a=!1,i=Qe(s,{origin:r.origin??"null",...r.imageOrigins?{imageOrigins:r.imageOrigins}:{},...r.asset?{asset:r.asset}:{},...r.link?{link:r.link}:{},maxNodes:r.maxNodes,onOverBudget:()=>a=!0});for(let b of e)i.apply(b);let p=[...i.refused],l="";if(t){let b=Fe(t);l=b.css;for(let o of b.refused)p.push({reason:"css",name:"stylesheet",css:o})}let d=r.theme?He(r.theme).css:"",f=et(d,l);return{root:s,refused:p,size:i.size,over:a,css:f,elementOf:b=>i.elementOf(b),idOf:b=>i.idOf(b)}}var ue=function*(e){for(let t of e.childNodes)t instanceof U&&(yield t,yield*ue(t))},ve=(e,t,r)=>{for(let s=e;s&&s!==t;s=s.parentElement)if(r(s))return s},ct=e=>{let t=["id","class","data-record","data-place","data-act","role","name"].flatMap(r=>e.getAttribute(r)===null?[]:[` ${r}="${e.getAttribute(r).slice(0,80)}"`]);return`<${e.localName}${t.join("")}>`},ut=e=>e.childNodes.map(t=>t instanceof U?ut(t):t.nodeType===3?t.textContent:"").join("");function Oe(e,t,r){let s=r.typed??{},a=[],i=[...ue(e)].filter(p=>p.getAttribute("data-act")!==null).map(p=>p.getAttribute("data-act"));for(let p of ue(e)){let l=p.getAttribute("name");if(!l||!["input","select","textarea"].includes(p.localName))continue;let d=(p.getAttribute("type")??"text").toLowerCase(),f=Object.hasOwn(s,l);if(d==="radio"){let b=p.getAttribute("value")??"on";if(f?String(s[l])!==b:!p.checked)continue;a.push({name:l,value:b,typed:f,empty:!1,chosen:!0})}else if(p.localName==="select"){let b=[...ue(p)].filter(T=>T.localName==="option"),o=b.find(T=>T.selected||T.getAttribute("selected")!==null)??b[0],A=f?String(s[l]):o?o.getAttribute("value")??ut(o).trim():"";a.push({name:l,value:A,typed:f,empty:A===""&&!f,chosen:!0})}else if(d==="checkbox"){let b=f?s[l]===!0||s[l]==="true"||s[l]==="on":p.checked;a.push({name:l,value:b,typed:f,empty:!b&&!f})}else{let b=ve(p,e,N=>N.getAttribute("data-record")!==null)?.getAttribute("data-record")??t,o=p.value===""&&p.getAttribute("data-prefill")===l&&b?at(r.store,r.principal,r.manifest,r.shown,{record:b,field:l,acts:i}):void 0,A=o!==void 0?{record:b,field:l,value:o}:void 0,T=f?s[l]:o??p.value,y=(d==="number"||d==="range")&&T!==""&&Number.isFinite(Number(T))?Number(T):typeof T=="boolean"?String(T):T;a.push({name:l,value:y,typed:f||A!==void 0,empty:y===""&&!f&&!A,...A?{from:A}:{}})}}return a}function pt(e,t,r,s){let a=r.asked.slice(e.asked),i=r.went.slice(e.went),p=r.renders.length>e.renders,l=e.target!==void 0?t.elementOf(e.target):void 0,d=[...a.map(y=>`its code asked for "${y.name}"`),...i.map(y=>`its code asked to go to "${"record"in y?y.record:y.place}"`),...p?["it drew again"]:[]],f=d.length>0?` When the view heard the click, ${d.join(", ")}.`:"";if(!l)return{selector:e.selector,asked:a,went:i,redrew:p,says:`"${e.selector}" matches nothing the view drew: there is nothing there to press.`};let b=t.root,o={},A=[],T=ye(l,b,y=>ce(y,[...ue(y)].some(de)));if(T){let y=T.getAttribute("data-filter"),N=T.getAttribute("data-section"),k=T.getAttribute("data-record"),$={...y?{where:he(y)}:{},...N?{section:N}:{}},u=k?{record:k,...$}:{place:T.getAttribute("data-place")??"",...$},h=Q(u,{sees:n=>s.shown.has(n),places:s.places,lists:s.lists,schema:s.store.schema});if(h.ok){o.opens=h.arrival;let n=h.arrival,c="filter"in n&&n.filter?`, narrowed to ${n.filter}`:"";A.push(`It opens ${"record"in n?`the record "${n.record}"`:"place"in n?`the place "${n.place}"`:`the list of ${n.list}`}${c}${n.section?`, at "${n.section}"`:""}.`)}else{let n="place"in u?u.place:u.record,c=!("record"in u&&s.shown.has(u.record))&&!W(s.places,n)&&!s.lists.some(g=>g.slug===n||g.kind===n);o.lost=s.placesUnsure&&c?`${h.says}${J}`:h.says,A.push(`It lands in a link that goes nowhere: ${o.lost}`)}}let m=ve(l,b,y=>y.getAttribute("data-act")!==null);if(m){let y=m.getAttribute("data-act"),N=se(m);if(N)A.push(`It is bound to "${y}", and is never pressed: ${N}`);else if(ge(m)){let k=ve(m,b,c=>c.getAttribute("data-record")!==null)?.getAttribute("data-record")??void 0,$=ve(m,b,c=>c.localName==="fieldset"||c.getAttribute("role")==="group")??b,u={as:y,...k!==void 0?{record:k}:{},fields:Oe($,k,s)},h=X(s.store,s.manifest,s.shown,u);if(!h.ok)o.act={as:y,ok:!1,reason:h.reason,message:h.message};else try{let c=s.store.previewAll([{name:h.name,args:h.args}],{author:s.principal,via:`view:${s.manifest.name}`});o.act={as:y,ok:!0,name:h.name,args:h.args,intent:c.intent,changes:c.ops.length>0}}catch(c){o.act=c instanceof fe?{as:y,ok:!1,reason:"refused",message:c.refusal.message}:c instanceof me?{as:y,ok:!1,reason:"failed",message:Be(c)}:{as:y,ok:!1,reason:"failed",message:"The act could not be applied."}}let n=o.act;A.push(n.ok?`It asks for "${n.name}" with ${JSON.stringify(n.args)}: ${n.changes?`\u201C${n.intent}\u201D, applied for this seat, were it pressed.`:"applied for this seat, it would change nothing."}`:`It asks for "${y}", which the host refuses (${n.reason}): ${n.message}`)}}return A.length===0&&A.push(`It is bound to no act and lands in no link: the host does nothing there${d.length>0?"":", and the view's code does nothing either"}.`),{selector:e.selector,element:ct(l),...o,asked:a,went:i,redrew:p,says:`A press on ${ct(l)}: ${A.join(" ")}${f}`}}var te=function*(e){for(let t of e.childNodes)t instanceof U&&(yield t,yield*te(t))},oe=(e,t,r)=>{for(let s=e;s&&s!==t;s=s.parentElement)if(r(s))return s},ke=e=>e.childNodes.map(t=>t instanceof U?t.getAttribute("aria-hidden")==="true"?"":ke(t):t.nodeType===3?t.textContent:"").join(""),gt=e=>{let t=["id","class","data-record","data-place","data-act","data-file","href","role","name"].flatMap(r=>e.getAttribute(r)===null?[]:[` ${r}="${e.getAttribute(r).slice(0,80)}"`]);return`<${e.localName}${t.join("")}>`},Rt=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.localName==="label")return t.childNodes.map(r=>r===e?"":r instanceof U?ke(r):r.nodeType===3?r.textContent:"").join("");return""},I=e=>{let t=(e.getAttribute("aria-label")??(e.localName==="select"?Rt(e):ke(e))).replace(/\s+/g," ").trim()||e.getAttribute("title")||e.getAttribute("name")||"";return t?`\u201C${t.length>60?`${t.slice(0,59)}\u2026`:t}\u201D`:gt(e)},ft={number:"1",range:"1",date:"2026-01-15","datetime-local":"2026-01-15T09:00",time:"09:00",month:"2026-01",week:"2026-W03",email:"someone@example.com",url:"https://example.com",tel:"+1 555 0100",text:"A test",search:"A test",textarea:"A test"},mt=e=>e.localName==="select"?void 0:e.localName==="textarea"?ft.textarea:ft[(e.getAttribute("type")??"text").toLowerCase()],jt=e=>{let t=[...te(e)].filter(i=>i.localName==="option"),r=i=>i.getAttribute("value")??ke(i).trim(),s=t.find(i=>i.selected||i.getAttribute("selected")!==null)??t[0],a=t.find(i=>i!==s&&i.getAttribute("disabled")===null&&r(i)!==""&&(!s||r(i)!==r(s)));return a?r(a):s?r(s):""},ht=new Set(["input","textarea","select"]),Dt=e=>e.localName==="button"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"||_e(e)||["link","menuitem","menuitemcheckbox","menuitemradio","option"].includes(e.getAttribute("role")??"")||e.localName==="a"&&!e.hasAttribute("href")&&!e.hasAttribute("data-record")&&!e.hasAttribute("data-place")&&!e.hasAttribute("data-file"),Mt=new Set(["tab","option","gridcell"]),Lt=new Set(["checkbox","menuitemcheckbox","menuitemradio","option","radio","switch","treeitem"]),Ht=new Set(["group","radiogroup","tablist","listbox","menu","menubar","toolbar","grid","tree"]),Ft=new Set(["","undefined","false"]),Ut=new Set(["link","tab","menuitem","treeitem","option"]),_t=e=>{let t=e.getAttribute("role");return t===null?e.localName==="a":Ut.has(t)},Vt=e=>{let t=e.getAttribute("role")??"";if(e.getAttribute("aria-pressed")==="true")return{name:"aria-pressed",value:"true"};if(e.getAttribute("aria-selected")==="true"&&Mt.has(t))return{name:"aria-selected",value:"true"};if(e.getAttribute("aria-checked")==="true"&&Lt.has(t))return{name:"aria-checked",value:"true"};let r=e.getAttribute("aria-current");return r!==null&&!Ft.has(r)&&_t(e)?{name:"aria-current",value:r}:void 0},Bt=(e,t)=>oe(e,t,r=>r.hasAttribute("hidden")||r.getAttribute("aria-hidden")==="true"||/(?:^|;)\s*(?:display\s*:\s*none|visibility\s*:\s*hidden)/i.test(r.getAttribute("style")??""))!==void 0,zt=(e,t,r)=>{let s=e.getAttribute("role"),a=e.parentElement,i=a?a.childNodes.filter(d=>d instanceof U):[],l=(a?.localName==="li"&&t==="aria-current"?a.parentElement??void 0:void 0)??(a?oe(a,r,d=>Ht.has(d.getAttribute("role")??"")):void 0);return[...new Set([...i,...l?te(l):[]])].filter(d=>{if(d===e||d.localName!==e.localName||d.getAttribute("role")!==s||Bt(d,r))return!1;let f=d.getAttribute(t);return f==="false"||t==="aria-current"&&f===null})},Wt=e=>e.localName==="summary"||e.hasAttribute("data-lightbox")||e.hasAttribute("data-drop")||e.localName==="graview-video";async function yt(e){let{drawn:t,store:r,principal:s,manifest:a}=e,i=t.root,p=[...te(i)],l=new Set(e.clicks),d=n=>oe(n,i,c=>l.has(t.idOf(c)??""))!==void 0,f=new Set(p.flatMap(n=>n.getAttribute("id")?[n.getAttribute("id")]:[])),b=[],o=(n,c,g,w)=>b.push({control:I(n),element:gt(n),does:c,ok:g,says:w}),A=`view:${a.name}`,T=(n,c)=>{try{return{ok:!0,intent:r.previewAll([{name:n,args:c}],{author:s,via:A}).intent}}catch(g){return g instanceof fe?{ok:!1,message:`this seat may not: ${g.refusal.message}`,missing:!1}:g instanceof me?{ok:!1,message:ze(g),missing:g.issues.some(w=>/required|received undefined/i.test(w.message))}:{ok:!1,message:`the act threw: ${g instanceof Error?g.message.slice(0,200):String(g)}`,missing:!1}}},m=(n,c)=>{let g=oe(n,i,O=>O.getAttribute("data-record")!==null)?.getAttribute("data-record")??void 0,w=oe(n,i,O=>O.localName==="fieldset"||O.getAttribute("role")==="group")??i;return{as:n.getAttribute("data-act"),...g!==void 0?{record:g}:{},fields:Oe(w,g,{store:r,principal:s,manifest:a,shown:e.shown,places:e.places,lists:e.lists,typed:c})}},y=(n,c)=>{let g=m(n,c),w=X(r,a,e.shown,g);if(!w.ok)return{ok:!1,message:w.message,missing:!1,press:g};let O=T(w.name,w.args);return O.ok?{ok:!0,intent:O.intent,args:w.args,press:g}:{...O,press:g}},N=(n,c)=>{let g=I(n),w=n.getAttribute("data-act"),O=oe(n,i,x=>x.localName==="fieldset"||x.getAttribute("role")==="group")??i,Y=[...te(O)].filter(x=>ht.has(x.localName)&&x.getAttribute("name")),L=c==="save"&&n.localName==="select"&&n.getAttribute("name")?{[n.getAttribute("name")]:jt(n)}:{},R=y(n,L),_=!1,j=Y.filter(x=>x.value===""&&!R.press.fields.find(D=>D.name===x.getAttribute("name"))?.from&&mt(x)!==void 0),K=Object.fromEntries(j.map(x=>[x.getAttribute("name"),mt(x)]));if(j.length>0){let x=y(n,{...L,...K});x.ok?[R,_]=[x,!R.ok]:(R.ok||R.missing)&&(R=x)}if(!R.ok)return o(n,c,!1,`${g} is refused: ${R.message.replace(/\.$/,"")}.`);let S=r.allMutations().find(x=>x.name===X(r,a,e.shown,R.press).name)?.input?.shape??{},E=R.press.fields.filter(x=>x.from&&Object.hasOwn(S,x.name)&&st(S[x.name],void 0)).map(x=>x.name);if(E.length>0){let x={...L,..._?K:{},...Object.fromEntries(E.map(P=>[P,""]))},D=y(n,x);if(!D.ok)return o(n,c,!1,`${g} is refused when ${E.map(P=>`\u201C${P}\u201D`).join(" and ")} ${E.length===1?"is":"are"} emptied: ${D.message.replace(/\.$/,"")}.`)}return o(n,c,!0,`${g} asks for \u201C${w}\u201D${_?" once its fields are filled":""}${R.intent?`: \u201C${R.intent}\u201D`:", which changes nothing as it is drawn"}.`)},k=0,$=e.maxRuns??24;for(let n of p){if(Wt(n))continue;if(n.hasAttribute("data-act")){let S=se(n);if(ht.has(n.localName)&&n.hasAttribute("data-save")){let E=n.getAttribute("data-save");E!=="input"&&E!=="change"?o(n,"save",!1,`${I(n)} saves nothing: data-save is "input" or "change", not "${E}".`):N(n,"save")}else S?o(n,"act",!1,`${I(n)} is bound to \u201C${n.getAttribute("data-act")}\u201D and is never pressed: ${S}`):ge(n)&&N(n,"act");continue}if(n.localName==="a"&&(n.getAttribute("href")??"").startsWith("#")){let S=n.getAttribute("href").slice(1);o(n,"jump",f.has(S),f.has(S)?`${I(n)} jumps to #${S}.`:`${I(n)} jumps to #${S}, and the view drew no element with that id.`);continue}if(n.hasAttribute("data-file")){let S=n.getAttribute("data-file")??"",E=n.getAttribute("data-field")??"",x=e.shown.has(S)?r.seenBy(s).graph.getNode(S):void 0,D=x&&E?Ge(x[E]):[],P=Number(n.getAttribute("data-index")??"0"),V=D[Number.isInteger(P)&&P>=0?P:0];n.localName!=="a"?o(n,"file",!1,`${I(n)} is a file link on a <${n.localName}>: a file link is an <a data-file>.`):x?V?o(n,"file",!0,`${I(n)} ${n.hasAttribute("data-download")?"downloads":"opens"} \u201C${V.name??"the file"}\u201D.`):o(n,"file",!1,`${I(n)} links to the file in "${E||"(no data-field)"}" of "${S}", which holds none.`):o(n,"file",!1,`${I(n)} links to a file of "${S}", which is no record this view was shown.`);continue}if(ce(n,[...te(n)].some(de))){let S=n.getAttribute("data-filter"),E=n.getAttribute("data-section"),x=n.getAttribute("data-record"),D={...S?{where:he(S)}:{},...E?{section:E}:{}},P=x?{record:x,...D}:{place:n.getAttribute("data-place")??"",...D},V=Q(P,{sees:v=>e.shown.has(v),places:e.places,lists:e.lists,schema:r.schema});if(V.ok){let v=V.arrival;o(n,"link",!0,`${I(n)} opens ${"record"in v?`the record "${v.record}"`:"place"in v?`the place "${v.place}"`:`the list of ${v.list}`}.`)}else{let v="place"in P?P.place:P.record,H="place"in P&&!W(e.places,v)&&!e.lists.some(B=>B.slug===v||B.kind===v);e.placesUnsure&&H?o(n,"link",!0,`${I(n)} may go nowhere: ${V.says}${J}`):o(n,"link",!1,`${I(n)} goes nowhere: ${V.says}`)}continue}let c=t.idOf(n),g=l.has(c??"");if(!Dt(n)&&!g||!g&&ye(n,i,S=>ce(S,[...te(S)].some(de))))continue;if(!d(n)){o(n,"nothing",!1,`${I(n)} does nothing: it is bound to no act (data-act), goes nowhere (data-record, data-place), and the view hears no click on it.`);continue}if(c===void 0)continue;if(k>=$){o(n,"code",!0,`${I(n)} was not pressed: the check presses ${$} controls the view's code hears, and this is past them.`);continue}k+=1;let w=await e.rerun(c);if(!w.ok){o(n,"code",!1,w.reason==="error"?`${I(n)} throws when pressed: ${w.detail.replace(/^It threw: /,"")}`:`${I(n)}, pressed, stopped the view (${w.reason}): ${w.detail}`);continue}let O=w.transcript.pressed;if(!O||O.target===void 0){o(n,"code",!1,`${I(n)} could not be pressed in a run of its own: it was not drawn there the same way.`);continue}let Y=w.transcript.asked.slice(O.asked),L=w.transcript.went.slice(O.went),R=w.transcript.renders.length>O.renders,_=[];for(let S of Y){let E=Ke(r,a,S.name,S.args??{},{shown:e.shown,file:()=>{},dropped:()=>{}});if(!E.ok)_.push(`it asks for \u201C${S.name}\u201D from its code, which is refused: ${E.message}${E.reason==="press-only"?` Bind the button to it instead: data-act="${S.name}".`:""}`);else{let x=T(E.name,E.args);x.ok||_.push(`it asks for \u201C${S.name}\u201D, which is refused: ${x.message}`)}}for(let S of L){let E=Q(S,{sees:x=>e.shown.has(x),places:e.places,lists:e.lists,schema:r.schema});E.ok||_.push(`it asks to go nowhere: ${E.says}`)}let j=Y.length===0&&L.length===0&&!R?Vt(n):void 0,K=!1,ie=!1;if(j)for(let S of zt(n,j.name,i)){let E=j.name==="aria-current";if(S.hasAttribute("data-act")||E&&(S.hasAttribute("data-record")||S.hasAttribute("data-place")||S.hasAttribute("href"))){K=!0;break}let x=t.idOf(S);if(x===void 0||!d(S))continue;if(k>=$){ie=!0;break}k+=1;let D=await e.rerun(x),P=D.ok?D.transcript.pressed:void 0;if(!D.ok||!P||P.target===void 0)continue;let V=we(D.transcript.renders,void 0,{maxNodes:1e5}).elementOf(c);if(D.transcript.asked.length>P.asked||E&&D.transcript.went.length>P.went||V?.getAttribute(j.name)!==j.value){K=!0;break}}_.length>0?o(n,"code",!1,`${I(n)}, pressed: ${_.join("; ")}`):j&&K?o(n,"code",!0,`${I(n)} is already in the state it shows (${j.name}="${j.value}"): pressed, it leaves the view as it is.`):j&&ie?o(n,"code",!0,`${I(n)} was not pressed: the check presses ${$} controls the view's code hears, and this is past them.`):j?o(n,"code",!1,`${I(n)} does nothing when pressed: it says ${j.name}="${j.value}", and no press on this view takes that from it.`):Y.length===0&&L.length===0&&!R?o(n,"code",!1,`${I(n)} does nothing when pressed: the view hears the click, and asks for no act, goes nowhere and draws nothing new.`):o(n,"code",!0,`${I(n)}, pressed, ${[...Y.length>0?[`asks for ${Y.map(S=>`\u201C${S.name}\u201D`).join(", ")}`]:[],...L.length>0?["goes where it says"]:[],...R?["draws again"]:[]].join(" and ")}.`)}let u=b.filter(n=>!n.ok),h=[`Presses: ${b.length} control${b.length===1?"":"s"} pressed, ${u.length===0?"every one does what it says":`${u.length} ${u.length===1?"fails":"fail"}`}.`];for(let n of b)h.push(` ${n.ok?"ok ":"FAILS"} ${n.says}`);return{ok:u.length===0,controls:b,problems:u,text:`${h.join(`
|
|
2
2
|
`)}
|
|
3
3
|
`}}var Gt=e=>`
|
|
4
4
|
;(function () {
|
|
@@ -12,10 +12,10 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
|
|
|
12
12
|
);
|
|
13
13
|
});
|
|
14
14
|
})();
|
|
15
|
-
`;function bt(){return e=>new Promise((t,r)=>{let s=URL.createObjectURL(new Blob([Gt(e.entry),e.script],{type:"text/javascript"})),a;try{a=new Worker(s)}catch(d){URL.revokeObjectURL(s),r(Object.assign(new Error(d instanceof Error?d.message:"The isolate could not start."),{reason:"isolate"}));return}let i=!1,p=d=>{i||(i=!0,clearTimeout(l),a.terminate(),URL.revokeObjectURL(s),d())},l=setTimeout(()=>p(()=>r(Object.assign(new Error("It ran past its deadline."),{reason:"slow"}))),e.timeoutMs+500);a.onmessage=d=>{let f=d.data;f.ok&&typeof f.text=="string"?p(()=>t(f.text)):p(()=>r(Object.assign(new Error(f.error??"The isolate could not run it."),{reason:"isolate"})))},a.onerror=d=>p(()=>r(Object.assign(new Error(d.message||"The isolate could not run it."),{reason:"isolate"}))),a.postMessage(e.input)})}var qt=new Set(["video/mp4","video/webm","video/ogg"]);function Jt(e,t){let r=e.poster===!0||typeof e.poster=="string"&&e.poster.length>0,s=qt.has(e.type.toLowerCase()),a=!s&&!r?`its source is ${e.type}, which not every browser plays, and it has no poster`:s?r?void 0:"it has no poster, so nothing stands before it plays or where a person asked for less motion":`its source is ${e.type}, which not every browser plays`;return{record:t.record,field:t.field,text:typeof e.caption=="string"&&e.caption.trim()?e.caption.trim():e.name,name:e.name,source:e.type,...typeof e.duration=="number"?{duration:e.duration}:{},poster:r,autoplay:t.autoplay,cover:t.cover,playable:s&&r,...a?{why:a}:{}}}var Ie={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},wt=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr","label"]),vt=new Set(["style","template","datalist","option"]),C=e=>e.replace(/\s+/g," ").trim();function Yt(e){let t=e.duration===void 0?0:Math.round(e.duration);if(t<1)return"a video";if(t<60)return`a ${t}-second video`;let r=Math.round(t/60);return r<60?`a ${r}-minute video`:`a ${Math.floor(r/60)}-hour${r%60>0?` ${r%60}-minute`:""} video`}var z=e=>e instanceof U,pe=e=>e.hasAttribute("hidden")||e.getAttribute("aria-hidden")==="true";function M(e){return e instanceof ee?e.data:!z(e)||pe(e)||vt.has(e.localName)?"":e.localName==="br"?" ":e.localName==="img"?e.getAttribute("alt")??"":e.childNodes.map(M).join(e.localName==="td"||e.localName==="th"?" ":"")}var Zt=/(\s+[·•|—–-]\s+)/;function Kt(e,t){if(!t||!e.includes(t))return e;let r=i=>i.length>0&&i.split(" ").length<=3,s=C(e).split(Zt),a=[];for(let i=0;i<s.length;i+=2){let p=s[i],l=p.startsWith(`${t} `)?p.slice(t.length+1):void 0,d=p.endsWith(` ${t}`)?p.slice(0,-t.length-1):void 0,f=p===t?"":l!==void 0&&r(l)?l:d!==void 0&&r(d)?d:p;f&&a.push(...a.length>0?[s[i-1]]:[],f)}return a.join("")}function kt(e,t,r){let s=[];for(let a of e){if(a.t==="list"&&a.groups.every(i=>i.items.every(p=>p.id===t&&p.title===r))){s.push(...kt(a.groups.flatMap(i=>i.items.flatMap(p=>p.parts)),t,r));continue}if(a.t==="text"){let i=Kt(a.text,r);i&&s.push(i===a.text?a:{...a,text:i});continue}s.push(a)}return s}function*re(e){for(let t of e.childNodes)z(t)&&(yield t,yield*re(t))}function Xt(e){let t=e.getAttribute("data-save"),r=e.getAttribute("data-debounce");if(t===null&&r===null)return[];let s=`drawing <${e.localName}${t!==null?` data-save="${t}"`:` data-debounce="${r}"`}>`,a=[];if(t===null)return[{at:s,says:'data-debounce is read only on a field that saves as it is typed (data-save="input").'}];if(!["input","textarea","select"].includes(e.localName))a.push({at:s,says:"Only a field saves as it is typed: an input, a textarea or a select. A button is pressed (data-act alone)."});else if(t!=="input"&&t!=="change")a.push({at:s,says:`data-save is "input" (saved as the person types, once they pause, and when they leave it) or "change" (saved when they leave it or pick), not "${t}".`});else if(e.getAttribute("data-act")===null)a.push({at:s,says:'It saves through no act: a field saved as it is typed names its act itself, data-act="\u2026", one in the manifest.'});else if(!e.getAttribute("name"))a.push({at:s,says:"It has no name: the host sends a field as the act's argument its name says."});else{let i=!1,p=!1;for(let l=e;l;l=l.parentElement)l.getAttribute("data-record")!==null&&(p=!0),l!==e&&(l.localName==="fieldset"||l.getAttribute("role")==="group")&&(i=!0);(!i||!p)&&a.push({at:s,says:'It is in no fieldset bound to a record: the host saves a field inside <fieldset data-record="\u2026">, with the fields beside it, to the record the fieldset names.'})}return r!==null&&t!=="input"?a.push({at:s,says:'data-debounce is read only with data-save="input": a "change" saves at once.'}):r!==null&&!(r.trim()!==""&&Number.isFinite(Number(r))&&Number(r)>=250&&Number(r)<=1e4)&&a.push({at:s,says:`data-debounce is how long the host waits for the person to pause, in milliseconds from 250 to 10 000, not "${r}"; left out, it waits 1 000.`}),a}function Qt(e,t,r){let s=e.getAttribute("data-drop");if(s===null)return[];let a=`drawing <${e.localName} data-drop="${s}">`,i=[],p=(t.accepts??[]).filter(f=>f.kind===s),l=e.getAttribute("data-drop-field");p.length===0?i.push({at:a,says:`The view's accepts names no field of "${s}", so the host offers no drop target here: say the field files go in, accepts: [{ "kind": "${s}", "field": "<its image, video or file field>" }].`}):l!==null&&!p.some(f=>f.field===l)&&i.push({at:a,says:`data-drop-field names "${l}", which the view's accepts does not name for "${s}" (${p.map(f=>`"${f.field}"`).join(", ")}): the host offers no drop target here.`});let d=e.getAttribute("data-drop-connect");if(d!==null){let f=d.indexOf(":"),b=f>0?d.slice(f+1):"";f<=0||b===""||r.has(d)?i.push({at:a,says:`data-drop-connect is "<relation>:<record id>" \u2014 "takenOn:day:saturday" \u2014 not "${d}"${r.has(d)?", which names a record and no relation":""}.`}):r.has(b)||i.push({at:a,says:`data-drop-connect names "${b}", which this seat was not shown: the host offers no drop target here.`})}return i}function Nt(e,t){let r=[],s=new Set,a=new Set,i=[],p=new Map;for(let m of[...t.props.node?[t.props.node]:[],...t.props.nodes??[]])p.set(m.id,m);let l=m=>W(t.places,m)!==void 0;for(let m of re(e)){let y=m.getAttribute("data-act");y!==null&&s.add(y);let N=y!==null&&m.getAttribute("data-debounce")===null?se(m):void 0;N&&r.push({at:`drawing <${m.localName} data-act="${y}">`,says:N});let k=m.getAttribute("data-record");k!==null&&(a.add(k),!p.has(k)&&!l(k)&&r.push({at:`drawing <${m.localName} data-record="${k}">`,says:t.placesUnsure?`It names "${k}", which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${q(t.places)}${J}`:`It names "${k}", which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${q(t.places)}`}));let $=m.getAttribute("data-place");$!==null&&!l($)&&r.push({at:`drawing <${m.localName} data-place="${$}">`,says:t.placesUnsure?`It names the place "${$}", which is none of the places this run was told of.${q(t.places)}${J}`:`It names the place "${$}", which this app does not have.${q(t.places)}`}),r.push(...Xt(m)),r.push(...Qt(m,t,p))}let d=m=>{if(m.localName==="graview-video")return;let y=m.getAttribute("data-record");if(y!==null)return y;let N=m.getAttribute("data-key")??m.getAttribute("id");if(N!==null&&p.has(N))return N;let k=new Set;for(let $ of re(m)){let u=$.getAttribute("data-record");u!==null&&$.localName!=="graview-video"&&k.add(u)}return k.size===1?[...k][0]:void 0},f=(m,y)=>{let N=p.get(y),k=N?.kind??(y.includes(":")?y.slice(0,y.indexOf(":")):""),$=[...re(m)],u=$.find(n=>n.localName in Ie)??$.find(n=>n.localName==="a"&&n.getAttribute("data-record")===y)??$.find(n=>n.localName==="strong"||n.localName==="b"),h=C(u?M(u):"")||N?.label||y;return{id:y,kind:k,title:h,parts:kt(o(m,u),y,h)}},b=m=>{let y=[...re(m)].filter(u=>u.localName==="tr"&&!pe(u)),N=y.find(u=>u.parentElement?.localName==="thead"||u.childNodes.every(h=>!z(h)||h.localName==="th")),k=N?N.childNodes.filter(z).map(u=>C(M(u))):[];return{t:"list",as:"row",columns:1,groups:[{items:y.filter(u=>u!==N).map(u=>{let h=u.childNodes.filter(z),n=d(u),c=n?p.get(n):void 0;return{id:n??"",kind:c?.kind??"",title:C(M(h[0]??u)),parts:h.slice(1).map((g,w)=>({t:"field",label:k[w+1]??"",text:C(M(g))}))}})}]}};function o(m,y){let N=[],k="",$=()=>{let h=C(k);k="",h&&N.push({t:"text",text:h})},u=m.childNodes;for(let h=0;h<u.length;h+=1){let n=u[h];if(n===y)continue;if(n instanceof ee){k+=n.data;continue}if(!z(n)||pe(n)||vt.has(n.localName))continue;if(y&&[...re(n)].includes(y)){$(),N.push(...o(n,y));continue}let c=[];for(let g=h;g<u.length;g+=1){let w=u[g];if(w instanceof ee&&C(w.data)==="")continue;if(!z(w)||pe(w)||wt.has(w.localName)||w.localName in Ie)break;let O=d(w);if(!O)break;c.push({element:w,id:O}),h=g}if(c.length>0){$();let g=c.every(w=>w.element.localName==="li"||w.element.localName==="tr");N.push({t:"list",as:g?"row":"card",columns:1,groups:[{items:c.map(w=>f(w.element,w.id))}]});continue}N.push(...A(n,g=>k+=g,$))}return $(),N}function A(m,y,N){let k=m.localName;if(wt.has(k)&&k!=="label")return y(M(m)),[];if(k==="mark"){N();let u=C(M(m));return u?[{t:"badge",text:u}]:[]}N();let $=Ie[k]??(m.getAttribute("role")==="heading"?Number(m.getAttribute("aria-level")??2):void 0);if($!==void 0){let u=C(M(m));return u?[{t:"heading",level:$,text:u}]:[]}switch(k){case"ul":case"ol":case"menu":return[{t:"list",as:"row",columns:1,groups:[{items:m.childNodes.filter(h=>z(h)&&h.localName==="li"&&!pe(h)).map(h=>{let n=d(h);if(n)return f(h,n);let c=o(h),g=c[0],w=g&&(g.t==="text"||g.t==="heading")?g.text:"";return{id:"",kind:"",title:w,parts:w?c.slice(1):c}})}]}];case"table":return[b(m)];case"dl":{let u=[],h="";for(let n of m.childNodes.filter(z))if(n.localName==="dt")h=C(M(n));else if(n.localName==="dd")u.push({t:"field",label:h,text:C(M(n))});else if(n.localName==="div")for(let c of n.childNodes.filter(z))c.localName==="dt"?h=C(M(c)):c.localName==="dd"&&u.push({t:"field",label:h,text:C(M(c))});return u}case"figure":{let u=m.childNodes.find(c=>z(c)&&c.localName==="figcaption"),h=C(m.childNodes.filter(c=>c!==u).map(M).join(" ")),n=u?C(M(u)):"";return h?[{t:"figure",text:h,...n?{label:n}:{}}]:n?[{t:"text",text:n}]:[]}case"meter":case"progress":{let u=Number(m.getAttribute("value")??0),h=Number(m.getAttribute("max")??1)||1;return[{t:"progress",label:m.getAttribute("aria-label")??m.getAttribute("title")??"",text:`${Math.round(u/h*100)}%`}]}case"svg":{let u=m.childNodes.find(c=>z(c)&&c.localName==="title"),h=C(m.getAttribute("aria-label")??(u?M(u):""));if(h)return[{t:"text",text:h,tone:"picture"}];let n=[...re(m)].filter(c=>c.localName==="text").map(c=>C(M(c))).filter(Boolean);return n.length>0?[{t:"text",text:n.join(" \xB7 "),tone:"picture"}]:[]}case"img":{let u=C(m.getAttribute("alt")??"");return u?[{t:"text",text:u,tone:"picture"}]:[]}case"graview-video":{let u=m.getAttribute("data-field")??"",h=m.getAttribute("data-record")??"",n=p.get(h),c=n&&u&&Object.hasOwn(n,u)?n[u]:void 0,g=(Array.isArray(c)?c:[c])[Number(m.getAttribute("data-index")??"0")];if(!g||typeof g.name!="string"||typeof g.type!="string"||!g.type.startsWith("video/"))return r.push({at:`drawing <graview-video data-field="${u}">`,says:"It names no video on a record this seat was shown: the host draws no player there. A <graview-video> names a record the view was shown (data-record) and its video field (data-field)."}),[];let w=Jt(g,{record:h,field:u,autoplay:m.getAttribute("autoplay")!==null,cover:m.getAttribute("cover")!==null});i.push(w);let O=w.autoplay?`, playing as a background, muted and looping${w.cover?", filling its box":""}`:"";return[{t:"text",text:`${w.text}, ${Yt(w.duration!==void 0?{duration:w.duration}:{})}${O}`,tone:"picture"}]}case"button":{let u=C(M(m));return u?[{t:"text",text:u,tone:"button"}]:[]}case"input":case"textarea":case"select":{let u=C(m.getAttribute("aria-label")??m.getAttribute("placeholder")??m.getAttribute("name")??""),h=k==="select"?C(M(m.childNodes.find(n=>z(n)&&n.localName==="option"&&n.selected)??m)):m.value;return[{t:"field",label:u,text:h}]}case"label":return o(m);default:return o(m)}}return{parts:o(e),problems:r,acts:[...s],records:[...a],videos:i}}var Ne=" SMIL can set an attribute after the host judged it, and runs past a person's reduced-motion setting: animate with CSS @keyframes, which is held to it.",xt={animate:Ne,animateTransform:Ne,animateMotion:Ne,set:Ne,feImage:" It loads an image: a filter here is made of the view's own pixels.","@property":" It registers a property for the whole page, the app's own --graview-* among them: animate a transform, an opacity or a color in @keyframes.","a href":" An <a> in SVG goes to a record or a place (data-record, data-place); a link out is an HTML <a href>.",role:` A role of the app's chrome or notices is the app's; role="region" is drawn while it has a name (aria-label).`};function er(e,t={}){let r="element"in e&&e.element?`<${e.element}>`:"",s=e.name?` ${e.name}`:"",a=i=>i&&Object.prototype.hasOwnProperty.call(xt,i)?xt[i]:"";switch(e.reason){case"element":return{at:`drawing ${r}`,says:`Not drawn: ${r} is not in the open kit.${a("element"in e?e.element:void 0)}`};case"attribute":return{at:`drawing ${r}${s}`,says:`Not drawn: ${r||"an element"} does not take${s}.${a(`${"element"in e?e.element:""}${s}`)}`};case"value":return{at:`drawing ${r}${s}`,says:`Not drawn: the value of${s} is not one the open kit takes.${a(e.name)}`};case"url":return"element"in e&&e.element==="a"&&e.address!==void 0?{at:`drawing ${r}${s}`,says:`Not drawn: ${nt(e.address,t.linkOrigins)}`}:{at:`drawing ${r}${s}`,says:e.address!==void 0&&"element"in e&&e.element==="img"?`Not drawn: ${We(e.address,t,"length"in e?e.length:void 0)}`:"Not drawn: an address. A view loads nothing; an image is a data: image."};case"child":return{at:`drawing ${r}`,says:`Not drawn: ${r} holds nothing.`};case"record":return{at:"drawing",says:"Not drawn: a record the drawing's format does not know."};case"budget":return{at:"drawing",says:"Not drawn: more nodes than a view may draw."};case"reference":{let i="ids"in e&&e.ids?e.ids:[],p=i.length>0?i.map(l=>`"${l}"`).join(", "):"no id";return{at:`drawing ${r}${s}`,says:`Not drawn: ${r||"an element"}${s} names ${p}, ${i.length===1?"which is":"which are"} no element of this view. It names elements the view draws itself, by their id (<h2 id="\u2026">), drawn once each is there.`}}case"css":return{at:`stylesheet${s===" stylesheet"?"":s}`,says:`Not drawn: CSS the open kit leaves out${e.css?` (${e.css.reason}${e.css.name?` ${e.css.name}`:""})`:""}.${a(e.css?.name)}`}}}function St(e,t,r={}){let{limits:s}=t;if(e.messages>s.messages)return{ok:!1,reason:"flood",detail:`It sent ${e.messages} messages, more than the ${s.messages} a view may send in a second.`};let a=new Set(t.acts);for(let o of e.asked)if(!a.has(o.name))return{ok:!1,reason:"act",detail:`It asks for the act "${o.name}", which its manifest does not name.`};let i=tt(t.props),p=we(e.renders,e.sheets,{maxNodes:s.maxNodes,...t.origin?{origin:t.origin}:{},...t.imageOrigins?{imageOrigins:t.imageOrigins}:{},...t.assets?{asset:o=>o}:{},...r.theme?{theme:r.theme}:{},link:o=>rt(o,{handed:i,...t.linkOrigins?{origins:t.linkOrigins}:{}})});if(p.over)return{ok:!1,reason:"nodes",detail:`It drew more than the ${s.maxNodes.toLocaleString("en-US")} things a view may draw.`};let l=[...t.places,...(t.lists??[]).filter(o=>!t.places.some(A=>A.as===o)).map(o=>({as:o}))],d=t.placesUnsure===!0,f=Nt(p.root,{props:t.props,places:l,...d?{placesUnsure:!0}:{},...t.accepts?{accepts:t.accepts}:{}});for(let o of f.acts)if(!a.has(o))return{ok:!1,reason:"act",detail:`It binds a press to the act "${o}" (data-act), which its manifest does not name.`};let b=[...p.refused.map(o=>er(o,{...t.imageOrigins?{origins:t.imageOrigins}:{},assets:t.assets===!0,...t.linkOrigins?{linkOrigins:t.linkOrigins}:{}})),...f.problems];for(let o of e.went)"record"in o&&!(t.props.node?.id===o.record||(t.props.nodes??[]).some(A=>A.id===o.record)||W(l,o.record))&&b.push({at:"navigate",says:d?`It goes to ${le(o.record)}, which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${q(l)}${J}`:`It goes to ${le(o.record)}, which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${q(l)}`}),"place"in o&&!W(l,o.place)&&b.push({at:"navigate",says:d?`It goes to the place ${le(o.place)}, which is none of the places this run was told of.${q(l)}${J}`:`It goes to the place ${le(o.place)}, which this app does not have.${q(l)}`});return{ok:!0,parts:f.parts,problems:b,drawn:p,videos:f.videos}}var At="graviewHeadless",$t="graviewHeadlessView";var Tt='"use strict";\n/*! @remote-dom/core and @remote-dom/polyfill \u2014 Copyright 2020-present, Shopify Inc. \u2014 MIT License.\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * @graview/guest\'s worker runtime \u2014 Elastic License 2.0. */\n"use strict";(()=>{var M=Symbol("name"),Ce=Symbol("prefix"),Ie=Symbol("value"),L=Symbol("ns"),se=Symbol("owner"),B=Symbol("owner_document"),we=Symbol("attributes"),Y=Symbol("prev"),A=Symbol("next"),U=Symbol("child"),ie=Symbol("parent"),De=Symbol("host"),fe=Symbol("data"),ze=Symbol("listeners"),pr=Symbol("isTrusted"),tt=Symbol("path"),nt=Symbol("stop_immediate_propagation"),rt=Symbol("dispatching"),ve=Symbol("content"),W=Symbol("hooks"),tn=Symbol("extensions"),Ve=Symbol("hooks_dispatch"),Q=Symbol("is_connected"),ot=Symbol("create_element"),ho=0,le=1,st=2,it=3,at=8,Fe=9,go=10,Me=11,G="http://www.w3.org/1999/xhtml",pe="http://www.w3.org/2000/svg",yo="http://www.w3.org/XML/1998/namespace",kt="http://www.w3.org/2000/xmlns/";function nn(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function K(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function bo(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function z(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var Eo=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,wo=/[\\0\\t\\n\\f\\r />=]/u,Si=/[\\0\\t\\n\\f\\r />]/u;function ke(t){if(t==null)return null;let e=String(t);return e===""?null:e}function No(t){Eo.test(t)||hr(t)}function mr(t){(t===""||wo.test(t))&&hr(t)}function rn(t,e,n){let r=ke(t),o=String(e),s=o.indexOf(":"),i=s<0?null:o.slice(0,s),a=s<0?o:o.slice(s+1);if((i!=null&&(i===""||Si.test(i))||(n==="element"?!Eo.test(a):a===""||wo.test(a)))&&hr(o),i!=null&&r==null)throw z(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(i==="xml"&&r!==yo)throw z("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||i==="xmlns")&&r!==kt)throw z("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===kt&&o!=="xmlns"&&i!=="xmlns")throw z("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:i,localName:a}}function hr(t){throw z(`Invalid name: "${t}"`,"InvalidCharacterError")}var on=0,sn=1,To=2,gr=3,vi=typeof performance>"u"?Date.now:performance.now.bind(performance),ee=class{static NONE=on;static CAPTURING_PHASE=sn;static AT_TARGET=To;static BUBBLING_PHASE=gr;timeStamp=vi();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=on;[tt]=[];[nt]=!1;[rt]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,pr,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[pr]}composedPath(){return[...this[tt]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[nt]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function yr(t,e,n){if(t.cancelBubble)return;let o=e[ze]?.get(t.type)?.[n===sn?"capture":"bubble"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?To:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i=="object"?i.handleEvent(t):i.call(e,t)}catch(a){setTimeout(ki,0,a)}if(t[nt])break}}function ki(t){throw t}var Ot=[],an=new WeakMap;function ln(t,e){let n=an.get(t);n?n.push(e):an.set(t,[e]),Ot[Ot.length-1].push(t)}function te(t){let e=[];Ot.push(e);let n;try{n=t()}catch(r){Ot.pop();try{xo(e)}catch{}throw r}return Ot.pop(),xo(e),n}function xo(t){let e,n=!1;for(let r of t){let o=an.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}an.delete(r)}}if(n)throw e}var cn=[],At=[],br=!1;function Be(t){for(let e of t)cn.push(e),e[1]&&At.push(e[1]);if(!br){br=!0;try{let e,n=!1;for(let r=0;r<cn.length;r++){let[o,s]=cn[r];s&&At.splice(At.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{cn.length=0,At.length=0,br=!1}}}function Rt(t){let e=t;for(;e;){if(At.includes(e))return!0;e=e[ie]??e[De]}return!1}var _t=Symbol("listenerRegistrations"),Le=class{[ze]=void 0;[_t]=void 0;[B]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,s=typeof r=="object"&&r.once===!0,i=typeof r=="object"?r.signal:void 0;if(i?.aborted)return;let a=Er(o),l=this[_t];l||(l=new Map,this[_t]=l);let c=l.get(e);c||(c={},l.set(e,c));let h=c[a];if(h||(h=new Map,c[a]=h),h.has(n))return;let g=this,w={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(w.normalizedListener=function(...y){if(w.signal?.aborted){dn(g,w);return}return w.once&&dn(g,w),typeof w.listener=="object"?w.listener.handleEvent(...y):w.listener.call(this,...y)});let b=this[ze];b||(b=new Map,this[ze]=b);let f=b.get(e);f||(f={},b.set(e,f));let R=f[a];if(R||(R=new Set,f[a]=R),h.set(n,w),R.add(w),i){let u=()=>{dn(g,w)};w.abortListener=u,i.addEventListener("abort",u,{once:!0})}this[B]?.defaultView[Ve].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return Oi.call(this,e,n,r)}dispatchEvent(e){if(e[rt])throw z("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[rt]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[tt]=n;for(let s=n.length;s--;)if(yr(e,n[s],sn),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(yr(e,o[s],gr),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[rt]=!1,e.cancelBubble=!1,e[nt]=!1,e.eventPhase=on,e.currentTarget=null,e[tt]=[]}}};function Oi(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=Er(!!r),s=this[_t]?.get(t)?.[o]?.get(e);s&&dn(this,s)}function Er(t){return t?"capture":"bubble"}function dn(t,e){let n=Er(e.capture),r=t[_t],o=r?.get(e.type);if(!o)return;let s=o[n];if(!s||s.get(e.listener)!==e)return;s.delete(e.listener),s.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let i=t[ze],a=i?.get(e.type);if(!a)return;let l=a[n];l?.delete(e)&&(l.size===0&&delete a[n],!a.bubble&&!a.capture&&i?.delete(e.type),t[B]?.defaultView[Ve].removeEventListener?.(t,e.type,e.listener,e.capture))}var me=class extends Array{item(e){return this[e]??null}};var Ct=0,So=1,Tr=2,xr=3,It=4,vo=0,ko=1,pn=2,mn=3,Oo=4,Nr=5,Ao=6,Ro=7,un=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function Ai(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let s=t[o];if(r){s==="\\\\"?o++:s===r&&(r=null);continue}if(s===\'"\'||s==="\'")r=s;else if(s==="(")n++;else if(s===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function ae(t){throw z(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function hn(t,e){let n=typeof e=="string"?Dt(e):[{combinator:It,matchers:e}],r=null,o=t[U];return o&&n[0].matchers.length&&Sr(o,n,s=>(r=s,!1)),r}function gn(t,e){let n=typeof e=="string"?Dt(e):[{combinator:It,matchers:e}],r=new me,o=t[U];return o&&n[0].matchers.length&&Sr(o,n,s=>{r.push(s)}),r}function Dt(t,e=!1,n=!1){let r={combinator:It,matchers:[]},o=[r],s=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,i=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");i===""&&ae(t);let a=0,l;for(;l=s.exec(i);){l.index!==a&&ae(t),l[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&ae(t),l[1]===">"?r.combinator=So:l[1]==="+"?r.combinator=xr:l[1]==="~"?r.combinator=Tr:r.combinator=Ct,r={combinator:It,matchers:[]},o.push(r));let c=l[8]?K(l[8]):l[2]||l[7];l[7]!=null&&!l[6]&&r.matchers.length>0&&ae(t);let g,w=l[4]??l[5]??l[7];if(l[2]){un.test(c)||ae(t);let b=l[5],f=b?.[0];if(l[3]==null&&(f===\'"\'||f==="\'")){let R=l[0].lastIndexOf(b);w=i.slice(l.index+R+1),s.lastIndex=i.length}else b!=null&&!un.test(b)&&ae(t);g=Oo}else l[6]?(un.test(c)||ae(t),g=l[6]==="#"?pn:mn):l[8]?g=l[9]==null?Nr:Ao:l[7]==="*"?g=vo:l[7]&&un.test(l[7])?g=ko:ae(t);l[9]?([w,s.lastIndex]=Ai(i,s.lastIndex),c!=="has"&&c!=="not"&&ae(t),c==="has"&&e&&ae(t),Dt(w,e||c==="has",c==="has")):g===Nr&&ae(t),r.matchers.push({type:g,name:c,value:w}),a=s.lastIndex}return(a!==i.length||r.matchers.length===0)&&ae(t),o}function Ri(t,e){let n=Dt(e);return n[0]?.matchers.length?Pt(t,n):!1}function _i(t,e){let n=Dt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=Ct,s={type:Ro,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:Ct,matchers:[s]}),n.some(({matchers:l})=>l.length===0))return!1;let i=o===xr||o===Tr?t[A]:t[U];if(!i)return!1;let a=!1;return Sr(i,n,()=>(a=!0,!1),t),a}function Sr(t,e,n,r){let o=[],s=t;for(;s;){if(oe(s)){if(Pt(s,e,r)&&n(s)===!1)return!1;let i=s[U];if(i){let a=s[A];a&&o.push(a),s=i;continue}}s=s[A]??o.pop()??null}return!0}function Pt(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===It){if(!fn(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Pt(t,a,n)}let s=r===So||r===Ct?ie:Y,i=t[s];if(!i)return!1;if(r===Ct||r===Tr){for(;i;){if(oe(i)&&fn(i,o,n)){let a=e.slice(0,-1);if(a.length===0||Pt(i,a,n))return!0}i=i[s]}return!1}else{if(r===xr&&!oe(i)){for(;i&&!oe(i);)i=i[s];if(!i)return!1}if(!oe(i)||!fn(i,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Pt(i,a,n)}}function wr(t,e){return t.getAttributeNS(null,t.namespaceURI===G?K(e):e)}function fn(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(fn(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case vo:return o==="*";case ko:return t.namespaceURI===G?t.localName===K(o):t.localName===o;case pn:return wr(t,"id")===o;case mn:let i=wr(t,"class");return i?nn(i).includes(o):!1;case Oo:let a=wr(t,o);return s==null?a!=null:a===s;case Ro:return t===n;case Nr:ae(`:${o}`);case Ao:switch(o){case"has":return _i(t,s||"");case"not":return!Ri(t,s||"");default:ae(`:${o}(${s})`)}}return!1}function Pi(t){return t.nodeType===st}function Mt(t){return fe in t}function kr(t){return t.nodeType===it}function Ci(t){return t.nodeType===at}function oe(t){return t.nodeType===le}function vr(t){return t.nodeType===Me}function Io(t){return"appendChild"in t}function yn(t){let e=[],n=[t],r=new Set(n),o=new Set,s;for(;n.length>0;){let i=n.pop();if(r.delete(i),o.has(i))continue;let a=[];for(let l of $t(i)){if(o.has(l)||(o.add(l),e.push(l),a.push(l),!oe(l)))continue;let c=l[we];if(c)for(let g of c)o.has(g)||(o.add(g),e.push(g));let h=l[ve];h&&!o.has(h)&&!r.has(h)&&(r.add(h),n.push(h))}s??=a}return{nodes:e,treeNodes:s}}function Lt(t,e){for(let n of t)n[B]=e}function _o(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[B]=e,r}function Po(t,e){if(kr(t))return e.createTextNode(t.data);if(Ci(t))return e.createComment(t.data);if(Pi(t))return _o(t,e);if(oe(t)){let n=e[ot](t[M],t.namespaceURI,t[Ce],t.localName);if(t[we])for(let r=0;r<t[we].length;r++){let o=t[we].item(r);n.attributes.setNamedItem(_o(o,e))}return n}else{if(vr(t))return e.createDocumentFragment();{let n=new t.constructor;return n[B]=e,n}}}function bn(t,e,n=t.ownerDocument){if(t.nodeType===Fe)throw z("Cannot clone a document node","NotSupportedError");let r=Po(t,n);if(!e||!oe(t)&&!vr(t))return r;let o=new Set([t]),s=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;s.length>0;){let i=s[s.length-1],a,l;if(i.cloningContent)if(i.contentSource&&i.contentDestination)a=i.contentSource.childNodes[i.childIndex++],l=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(a=i.source.childNodes[i.childIndex++],l=i.destination,!a){if(i.cloningContent=!0,i.childIndex=0,oe(i.source)&&i.source.namespaceURI===G&&i.source.localName==="template"){let h=i.source[ve];h&&(o.has(h)&&Co(),o.add(h),i.contentSource=h,i.contentDestination=i.destination.content)}continue}if(!a){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(a)&&Co(),o.add(a);let c=Po(a,n);oe(a)||vr(a)?s.push({source:a,destination:c,appendTo:l,childIndex:0,cloningContent:!1}):l.appendChild(c)}return r}function Co(){throw new Error("Cannot clone a cyclic or repeated node graph")}function En(t,e){let n=String(e);return n===""?null:hn(t,[{type:pn,name:n}])}function wn(t,e){let n=[...new Set(nn(String(e)))];return gn(t,n.map(r=>({type:mn,name:r})))}function Nn(t,e){let n=String(e),r=K(n),o=[];for(let s of Tn(t))oe(s)&&(n==="*"||(s.namespaceURI===G?s[M]===r:s[M]===n))&&o.push(s);return o}function Tn(t){let e=[],n=[],r=t[U];for(;r;){e.push(r);let o=r[U],s=r[A];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function $t(t){let e=Tn(t);return e.unshift(t),e}var he=class extends Le{nodeType=ho;[M]="";[ie]=null;[De]=null;[U]=null;[Y]=null;[A]=null;[Q]=!1;get[W](){return this[B].defaultView[Ve]}get localName(){return this[M]}get nodeName(){return this[M]}get ownerDocument(){return this[B]}get isConnected(){return this[Q]}isDefaultNamespace(e){let n=ke(e);return Ii(this)===n}get parentNode(){return this[ie]}set parentNode(e){}get parentElement(){let e=this[ie];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[Y]}set previousSibling(e){}get nextSibling(){return this[A]}set nextSibling(e){}get previousElementSibling(){let e=this[Y];for(;e&&e.nodeType!==1;)e=e[Y];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[A];for(;e&&e.nodeType!==1;)e=e[A];return e}set nextElementSibling(e){}get firstChild(){return this[U]}set firstChild(e){}get lastChild(){let e=this[U];for(;e;){let n=e[A];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return Mt(this)?this.data:null}set nodeValue(e){Mt(this)&&(this.data=e)}get textContent(){if(Mt(this))return this.data;let e="";for(let n of Tn(this))kr(n)&&(e+=n.data);return e}set textContent(e){if(Mt(this))this.data=e;else if(Io(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return bn(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function Ii(t){let e=t;for(;e;)switch(e.nodeType){case le:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS(kt,"xmlns");if(r!=null&&r.prefix==null)return ke(r.value);e=n.parentElement;break}case Fe:e=e.documentElement;break;case go:case Me:return null;case st:e=e.ownerElement;break;default:e=e.parentElement}return null}var ge=Symbol("insertNode"),Rr=Symbol("preflightInsertions"),xn=Symbol("replaceNode"),$e=class extends he{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Ye(e),r=this.parentNode;if(r)return Or(o=>{Oe(r,n);let s=this[A];for(;s&&n.includes(s);)s=s[A];let i=Ar(r,n,o);this.parentNode===r?r[xn](i,this,o):r[ge](i,s,o)})}before(...e){let n=Ye(e),r=this.parentNode;if(r)return Or(o=>{Oe(r,n);let s=this[Y];for(;s&&n.includes(s);)s=s[Y];let i=Ar(r,n,o);r[ge](i,s?s[A]:r.firstChild,o)})}after(...e){let n=Ye(e),r=this.parentNode;if(r)return Or(o=>{Oe(r,n);let s=this[A];for(;s&&n.includes(s);)s=s[A];let i=Ar(r,n,o);r[ge](i,s,o)})}};function Or(t){return te(()=>{let e=[];try{t(e)}catch(n){try{Be(e)}catch{}throw n}Be(e)})}function Ye(t){return t.map(e=>e instanceof he?e:String(e))}function Ht(t,e){return e instanceof he?e:t.ownerDocument.createTextNode(String(e))}function Oe(t,e){for(let n of e){if(!(n instanceof he))continue;let r=t;for(;r;){if(r===n)throw z("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[ie]??r[De]}}}function Ar(t,e,n){let r=[];for(let s of e)r.push(Ht(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[Rr](r);for(let s of r)o[ge](s,null,n);return o}var Sn,_r=0,Do=0,Mo=0,Lo=0,lt=!1,Cr=!1,Ut=!1,vn=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=Di(n),o=Sn??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?_r++:Pr(i,-1),s.set(this,r),Pr(r,1),this.#e.add(e)}disconnect(){let e=Sn;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),_r--,Pr(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,_r===0&&(Sn=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function ye(t){let e=Sn;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[s,i]of o){if(r!==t.target&&!i.subtree)continue;let a=!1;if(t.type==="attributes"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??""))continue;a=i.attributeOldValue}else if(t.type==="characterData"){if(!i.characterData)continue;a=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||a)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new me,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:s?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new me,target:t.target,type:t.type})}function kn(...t){let e=new me;return e.push(...t),e}function Di(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError("attributeOldValue and attributeFilter require attributes to be enabled");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError("characterDataOldValue requires characterData to be enabled");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError("MutationObserver options must enable childList, attributes, or characterData");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function Pr(t,e){t.attributes&&(Do+=e),t.characterData&&(Mo+=e),t.childList&&(Lo+=e),lt=Do>0,Cr=Mo>0,Ut=Lo>0}var Ne=class extends $e{childNodes=new me;children=new me;appendChild(e){return te(()=>this[ge](e,null))}insertBefore(e,n){return te(()=>this[ge](e,n||null))}append(...e){return te(()=>{let n=Ye(e.filter(r=>r!=null));n.length>1&&Oe(this,n);for(let r of n)this[ge](Ht(this,r),null)})}prepend(...e){return te(()=>{let n=Ye(e.filter(o=>o!=null));n.length>1&&Oe(this,n);let r=this.firstChild;for(let o of n)this[ge](Ht(this,o),r)})}replaceChildren(...e){return te(()=>{let n=Ye(e.filter(o=>o!=null));Oe(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ge](Ht(this,o),null)})}removeChild(e){return te(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw z("The node is not a child of this node","NotFoundError");let n=this[Q]?$t(e):void 0,r=e[Y],o=e[A],s=On(this,e);if(n)for(let i of n)i[Q]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),Be(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return te(()=>this[xn](e,n))}[xn](e,n,r){if(Oe(this,[e]),n.parentNode!==this)throw z("The reference node is not a child of this parent","NotFoundError");let o=n[Y],s=n[A],i=this.prepareInsertion(e),a=this[Q]?$t(n):void 0,l=new Set(i.map(({node:w})=>w)),c=s;for(;c&&l.has(c);)c=c[A];let h=On(this,n);if(a){for(let b of a)b[Q]=!1;let w=new Set(a);for(let b of i)w.has(b.node)&&(b.shouldDisconnect=!1)}this.commitInsertion(i,c);let g=this[Q];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),a&&this.enqueueTreeReactions(a,"disconnectedCallback"),this.enqueueInsertionReactions(i,g),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,h),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return gn(this,e)}querySelector(e){return hn(this,e)}[ge](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[Rr](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(Oe(this,[e]),n&&n.parentNode!==this)throw z("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[A]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[Q];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):Be(e)}prepareInsertion(e){let n=[];if(e.nodeType===Me){let i=e[U];for(;i;)n.push(i),i=i[A]}else n.push(e);let r=this[Q],o=this[B],s=[];for(let i of n){let a=i[Q],l=a||r,c,h;if(i[B]===o)l&&(c=$t(i));else{let g=yn(i);h=g.nodes,l&&(c=g.treeNodes)}s.push({node:i,nodes:c,adoption:h,shouldDisconnect:a})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[ie];if(i){let a=s.node[Y],l=s.node[A];s.source={parent:i,index:On(i,s.node),previousSibling:a,nextSibling:l}}}for(let s of e){let i=this.attachChild(s.node,n);s.insertIndex=i.index,s.previousSibling=i.previousSibling,s.nextSibling=i.nextSibling}let r=this[B];for(let{adoption:s}of e)s&&Lt(s,r);let o=this[Q];for(let{nodes:s}of e)if(s)for(let i of s)i[Q]=o}attachChild(e,n){if(n){let s=n[Y];e[A]=n,e[Y]=s,s?s[A]=e:this[U]=e,n[Y]=e}else{e[A]=null;let s=this[U];if(s){let i;for(;i=s[A];)s=i;s[A]=e,e[Y]=s}else this[U]=e,e[Y]=null}let r=oe(e);e[ie]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!oe(s);)s=s[A];s?this.children.splice(this.children.indexOf(s),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[Y],nextSibling:e[A]}}queueRemovalMutationRecord(e,n,r,o){Ut&&ye({type:"childList",target:e,removedNodes:kn(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(Ut)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),ye({type:"childList",target:this,addedNodes:kn(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==le||Rt(this)?[]:[[()=>this[W].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===le&&!Rt(s.parent)&&n.push([()=>s.parent[W].removeChild?.(s.parent,o,s.index)]),this.nodeType===le&&!Rt(this)&&n.push([()=>this[W].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){Ho(e,n)}};function $o(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[Q]?n.treeNodes:void 0,s=e[Y],i=e[A],a=On(t,e);if(o)for(let c of o)c[Q]=!1;Lt(n.nodes,r),Ut&&ye({type:"childList",target:t,removedNodes:kn(e),previousSibling:s,nextSibling:i}),o&&Ho(o,"disconnectedCallback");let l=[];t.nodeType===le&&!Rt(t)&&l.push([()=>t[W].removeChild?.(t,e,a)]),Be(l)}function On(t,e){let n=e[Y],r=e[A];n?n[A]=r:t[U]=r,r&&(r[Y]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),oe(e)&&t.children.splice(t.children.indexOf(e),1),e[ie]=null,e[A]=null,e[Y]=null,o}function Ho(t,e){for(let n of t){let r=n[e];typeof r=="function"&&ln(n,()=>r.call(n))}}function Gt(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||ln(t,()=>i.call(t,e,n,r,o))}var An=class{[U]=null;constructor(e){this[se]=e}getNamedItem(e){let n=String(e),r=this[se][L]===G?K(n):n,o=this[U];for(;o;){if(o.name===r)return o;o=o[A]}return null}getNamedItemNS(e,n){let r=ke(e),o=String(n),s=this[U];for(;s;){if(s.localName===o&&s[L]===r)return s;s=s[A]}return null}item(e){let n=this[U],r=0;for(;n;){if(r++===e)return n;n=n[A]}return null}get length(){let e=0,n=this[U];for(;n;)e++,n=n[A];return e}removeNamedItem(e){let n=String(e),r=this[se][L]===G?K(n):n;return te(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ke(e),o=String(n);return te(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[L]===r))}removeNamedItemImmediately(e){let n=this[se],r=this[U],o=null;for(;r!=null;){if(e(r)){o&&(o[A]=r[A]),this[U]===r&&(this[U]=r[A]);let s=r.value;return r[A]=null,r[se]=null,lt&&ye({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[L],oldValue:s}),n[W].removeAttribute?.(n,r.name,r[L]),Gt(n,r.localName,s,null,r[L]),r}o=r,r=r[A]}return null}setNamedItem(e){return te(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[se],r=e[se];if(r!=null&&r!==n)throw z("The attribute is already in use by another element.","InUseAttributeError");let o=null,s=this[U],i=null;for(;s;){if(s.localName===e.localName&&s[L]===e[L]){if(s===e)return s;i?i[A]=e:this[U]=e,e[A]=s[A],s[A]=null,o=s;break}i=s,s=s[A]}o==null&&(i?i[A]=e:this[U]=e),e[se]=n,e[B]=n[B],o&&(o[se]=null);let a=o==null||o.value!==e.value,l=o!=null&&o.name!==e.name;return a&<&&ye({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[L],oldValue:o?.value??null}),l&&n[W].removeAttribute?.(n,o.name,o[L]),(a||l)&&n[W].setAttribute?.(n,e.name,e.value,e[L]),a&&Gt(n,e.localName,o?.value??null,e.value,e[L]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[U];for(;e;)yield e,e=e[A]}};var We=class extends he{nodeType=st;[L]=null;[A]=null;[se]=null;constructor(e,n,r){super(),this[M]=e,this[Ie]=n,r&&(this[L]=r)}get nodeName(){return this[M]}set nodeName(e){}get name(){return this[M]}set name(e){}get localName(){if(this[L]==null)return this[M];let e=this[M].indexOf(":");return e<0?this[M]:this[M].slice(e+1)}get prefix(){if(this[L]==null)return null;let e=this[M].indexOf(":");return e<0?null:this[M].slice(0,e)}get value(){return this[Ie]}set value(e){let n=String(e),r=this[se];if(!r){this[Ie]=n;return}te(()=>{let o=this[Ie];this[Ie]=n,lt&&o!==n&&ye({type:"attributes",target:r,attributeName:this[M],attributeNamespace:this[L],oldValue:o}),this[W].setAttribute?.(r,this[M],n,this[L]),Gt(r,this.localName,o,n,this[L])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[se]}get namespaceURI(){return this[L]}get specified(){return!0}};var Mi={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},Li=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),$i=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,jo=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,Hi="|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|",Ui=/^(?:color|face|size)$/i;function Uo(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return Mi[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function zo(t){return t.namespaceURI===G&&Li.has(t.localName)}function Go(t){let e=t.localName;return t[L]===pe&&(e==="foreignObject"||e==="desc"||e==="title")}function Gi(t,e){if(Hi.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(jo))if(Ui.test(n[1]))return!0;return!1}function Rn(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll($i)){let a=i[1];if(a){let l=i[2],c=K(a),h=o[o.length-1]?.element??e,g=h[L]===pe?pe:G;if(c==="svg")g=pe;else if(g===pe){if(Go(h))g=G;else if(Gi(c,l)){for(;o.length>0;){let f=o[o.length-1];if(f.element[L]!==pe||Go(f.element))break;o.pop(),s=f.target}g=G}}let w=g===G?c:a,b=n[ot](w,g,null,w);for(let f of l.matchAll(jo))b.setAttribute(f[1],Uo(f[3]||f[4]||""));if(s.append(b),zo(b)||g!==G&&i[4])continue;o.push({element:b,target:s}),s=g===G&&c==="template"?b.content:b}else if(i[5]){let l=K(i[5]);for(let c=o.length-1;c>=0;c--){let h=o[c],g=K(h.element[M]);if(g===l){s=h.target,o.length=c;break}if(h.element[L]===G&&g==="template")break}}else i[6]?s.append(n.createComment(i[6])):s.append(Uo(i[7]))}return r}function _n(t){return Fo([{type:"content",child:t[U]}])}function Vo(t){return Fo([{type:"opening",node:t}])}function Fo(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case le:{let o=r;e.push(`<${o[M]}`);let s=o[we]?.[U];for(;s;){e.push(` ${s[M]}`);let a=s[Ie];a!==""&&(a=String(a).replace(/&/g,"&").replace(/"/g,"""),e.push(`="${a}"`)),s=s[A]}if(e.push(">"),zo(o))break;let i=o.namespaceURI===G&&o.localName==="template"?o[ve]:o;t.push({type:"closing",name:o[M]}),t.push({type:"content",child:i?.[U]??null});break}case it:{let o=r;e.push(o[fe].replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"));break}case at:{let o=r;e.push(`<!--${o[fe]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[A]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var Z=class extends Ne{nodeType=le;[L]=G;[Ce]=null;get namespaceURI(){return this[L]}get prefix(){return this[Ce]}get localName(){let e=this[Ce];return e==null?this[M]:this[M].slice(e.length+1)}get nodeName(){return this[L]===G?bo(this[M]):this[M]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new We("slot",n))}get attributes(){let e=this[we];return e||(e=new An(this),this[we]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Nn(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return wn(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);mr(r);let s=this[L]===G?K(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new We(s,o))}setAttributeNS(e,n,r){let o=ke(e),s=String(n),i=String(r),a=rn(o,s,"attribute"),l=this.attributes.getNamedItemNS(a.namespace,a.localName);l?l.value=i:this.attributes.setNamedItemNS(new We(a.qualifiedName,i,a.namespace))}toggleAttribute(e,n){let r=String(e);mr(r);let o=this[L]===G?K(r):r,s=this.attributes.getNamedItemNS(null,o),i=n===void 0?void 0:!!n;return s==null?i===!1?!1:(this.attributes.setNamedItem(new We(o,"")),!0):i===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[L]===G?K(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return Vo(this)}get innerHTML(){return _n(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Rn(String(e),this);this.replaceChildren(n)}}};var ct=class t extends Z{[L]=pe;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var He=class extends $e{[fe]="";constructor(e){super(),this[fe]=e==null?"":String(e)}setData(e){let n=Cr,r=n?this[fe]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[fe]=o,n&&r!==o&&ye({type:"characterData",target:this,oldValue:r}),this[W].setText?.(this,o)}get data(){return this[fe]}set data(e){this.setData(e)}};var dt=class extends He{nodeType=it;[M]="#text"};var ut=class extends He{nodeType=at;[M]="#comment"};var ft=class extends Ne{nodeType=Me;[M]="#document-fragment";[B]=typeof window<"u"?window.document:null;getElementById(e){return En(this,e)}};var pt=class extends Z{get content(){let e=this[ve];return e||(e=this.ownerDocument.createDocumentFragment(),e[De]=this,this[ve]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Rn(String(e),this))}get innerHTML(){let e=this[ve];return e?_n(e):""}};var Pn=class extends Z{};var Cn=class extends Z{};var In=class extends Z{};var jt=class extends Ne{nodeType=Fe;[M]="#document";[Q]=!0;constructor(e){super(),this.defaultView=e,this[B]=this,this.documentElement=Mn(new In,this,"html"),this.body=Mn(new Pn,this,"body"),this.head=Mn(new Cn,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return wn(this,e)}createElement(e){let n=String(e);return No(n),Ir(this,K(n))}createElementNS(e,n){let r=rn(e,n,"element");return Ir(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[ot](e,n,r,o){return Ir(this,e,n,r,o)}createTextNode(e){let n=Dn(new dt(e),this);return this[W].createText?.(n,n.data),n}createComment(e){return Dn(new ut(e),this)}createDocumentFragment(){return Dn(new ft,this)}createEvent(){return new ee("")}getElementById(e){return En(this,e)}getElementsByTagName(e){return Nn(this,e)}importNode(e,n){if(e.nodeType===Fe)throw z("Cannot import a document node","NotSupportedError");return bn(e,n,this)}adoptNode(e){if(e[B]===this)return e;let n=yn(e);return te(()=>{let r=e.parentNode;return r?$o(r,e,n,this):Lt(n.nodes,this),e})}};function Dn(t,e){return Object.defineProperty(t,B,{value:e,writable:!0,enumerable:!1}),t}function Ir(t,e,n=G,r=null,o=e){let s;if(n===pe)s=new ct;else if(n===G&&o==="template")s=new pt;else if(n===G){let i=t.defaultView.customElements.get(o);s=i?new i:new Z}else s=new Z;return Mn(s,t,e,n,r)}function Mn(t,e,n,r=G,o=null){return Dn(t,e),Object.defineProperties(t,{[M]:{value:n},[L]:{value:r},[Ce]:{value:o}}),e[W].createElement?.(t,r),t}var Ln=class extends ee{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var $n=class extends ee{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var Hn=class extends ee{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Un=class extends ee{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Gn=class extends ee{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var jn=class extends ee{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var zn=class extends Z{};var ji=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,zi=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Bo(t){return ji.test(t)&&!zi.has(t)}function Yo(t){return z(`Invalid custom element name: "${t}"`,"SyntaxError")}var Vn=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Bo(e))throw Yo(e);if(this.registry.has(e))throw z(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw z("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let s of o)s(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Bo(e))return Promise.reject(Yo(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var Vi=["onerror","onunhandledrejection"],Xo=Symbol.for("@remote-dom/polyfill/global-property");function qo(t){return Object.getOwnPropertyDescriptors(t)}function Ko(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(Le.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=Dr(r.value.bind(t)),e[n]=r);return e}function Zo(t){let e={};for(let n of Vi)e[n]={configurable:!0,enumerable:!0,get:Dr(()=>t[n]),set:Dr(r=>{t[n]=r})};return e}function Fi(t){return Object.assign(qo(t),Ko(t),Zo(t))}function Dr(t){return Object.defineProperty(t,Xo,{value:!0}),t}function Wo(t,e){for(let n of Reflect.ownKeys(e)){let r=Bi(t,n);(r==null||Yi(r))&&Object.defineProperty(t,n,e[n])}}function Bi(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Yi(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[Xo]===!0)}var Xe=class extends Le{[W]={};[tn]=[];[Ve]=Xi(this);name="";window=this;parent=this;self=this;top=this;document=new jt(this);customElements=new Vn;location=globalThis.location;navigator=globalThis.navigator;Event=ee;ErrorEvent=$n;PromiseRejectionEvent=Hn;ToggleEvent=Un;FocusEvent=Gn;ClipboardEvent=jn;EventTarget=Le;CustomEvent=Ln;Node=he;ParentNode=Ne;ChildNode=$e;DocumentFragment=ft;Document=jt;CharacterData=He;Comment=ut;Text=dt;Element=Z;HTMLElement=zn;SVGElement=ct;HTMLTemplateElement=pt;MutationObserver=vn;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Wi(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener("error",this.#t),e&&typeof e=="function"?(this.#n=e,this.#t=n=>{e(n.message??"Error",n.filename,n.lineno,n.colno,n.error)},this.addEventListener("error",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener("unhandledrejection",this.#e),e&&typeof e=="function"?(this.#e=e,this.addEventListener("unhandledrejection",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=qo(e),s=Object.assign(Ko(e),Zo(e));delete o.self,Object.defineProperties(globalThis,o),Wo(globalThis,s),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),Wo(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Fi(e))}};function Wi(t,e){t[tn].push(e(t)??{})}function Xi(t){return{createElement:Ae.bind(null,t,"createElement"),setAttribute:Ae.bind(null,t,"setAttribute"),removeAttribute:Ae.bind(null,t,"removeAttribute"),createText:Ae.bind(null,t,"createText"),setText:Ae.bind(null,t,"setText"),insertChild:Ae.bind(null,t,"insertChild"),removeChild:Ae.bind(null,t,"removeChild"),addEventListener:Ae.bind(null,t,"addEventListener"),removeEventListener:Ae.bind(null,t,"removeEventListener")}}function Ae(t,e,...n){for(let s of t[tn])s[e]?.apply(s,n);let r=t[W];r[e]?.apply(r,n)}var Fn=new Xe;var Mr="~";var Ue=new WeakMap;function mt(t){return Ue.get(t)}var Ur=new WeakMap,Ki=0;function ce(t){let e=Ur.get(t);return e==null&&(e=String(Ki++),Bn(t,e)),e}function Bn(t,e){Ur.set(t,e)}var $r=new WeakMap;function Zi(t){return $r.get(t)}var Hr=new WeakMap;function Ji(t){let e=Hr.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Qi=new WeakMap;function ea(t){return Qi.get(t)}function Gr(t,e,n){let r=$r.get(t);if(r==null&&(r={},$r.set(t,r)),r[e]===n)return;r[e]=n;let o=Ue.get(t);o?.mutate([[3,ce(t),e,n,1]])}function Ge(t,e,n){let r=Hr.get(t);if(r==null&&(r={},Hr.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=Ue.get(t);o?.mutate([[3,ce(t),e,n,2]])}function ht(t,e){if(Ue.get(t)!==e&&(Ue.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)ht(t.childNodes[r],e)}function Yn(t){if(Ue.get(t)!=null&&(Ue.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)Yn(t.childNodes[n])}function gt(t){let{nodeType:e}=t;switch(e){case 1:return{id:ce(t),type:e,element:t.localName,properties:Lr(Zi(t)),attributes:Lr(Ji(t)),eventListeners:Lr(ea(t)),children:Array.from(t.childNodes).map(gt)};case 3:case 8:return{id:ce(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Lr(t){return t?{...t}:void 0}function jr(t,e,...n){let r=Ur.get(t),o=Ue.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var yt=Fn[W];yt.insertChild=(t,e,n)=>{let r=mt(t);r!=null&&(ht(e,r),r.mutate([[0,ce(t),gt(e),n]]))};yt.removeChild=(t,e,n)=>{let r=mt(t);r!=null&&(Yn(e),r.mutate([[1,ce(t),n]]))};yt.setText=(t,e)=>{let n=mt(t);n?.mutate([[2,ce(t),e]])};yt.setAttribute=(t,e,n)=>{t.tagName.includes("-")||Ge(t,e,n)};yt.removeAttribute=(t,e)=>{t.tagName.includes("-")||Ge(t,e)};Xe.setGlobal(Fn);function Qo(t,e){if(typeof t!="string"||t.length===0||t.length>200)return"A kept value\'s key is a string of 1 to 200 characters, so this one was not kept.";if(e!==null){if(typeof e!="string")return"A view keeps a string or null; JSON.stringify anything else, so this one was not kept.";if(e.length>4096||new TextEncoder().encode(e).length>4096)return"A kept value is at most 4 KB, and this one is longer, so it was not kept."}}function es(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},s={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...s}:typeof n=="string"?{type:"navigate",to:n,...s}:void 0}var ts=["wheel","drag","pinch"];var rs=["globalThis","Infinity","NaN","undefined","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape","Object","Function","Array","Number","Boolean","String","Symbol","BigInt","Date","Promise","RegExp","Math","JSON","Reflect","Proxy","Intl","Error","AggregateError","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","SuppressedError","Map","Set","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Iterator","AsyncIterator","DisposableStack","AsyncDisposableStack","ArrayBuffer","SharedArrayBuffer","DataView","Atomics","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],os=["window","parent","top","document","customElements","Event","ErrorEvent","PromiseRejectionEvent","ToggleEvent","FocusEvent","ClipboardEvent","CustomEvent","EventTarget","Node","ParentNode","ChildNode","DocumentFragment","Document","CharacterData","Comment","Text","Element","HTMLElement","SVGElement","HTMLTemplateElement","MutationObserver"],ss=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],is=["TEMPORARY","PERSISTENT"],Mu=Object.freeze([...rs,...os,...ss,...is]),Lu=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),ns=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function as(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...rs,...os,...ss,...e,"constructor",Symbol.toStringTag]),i=(p,E)=>{let x=Reflect.getOwnPropertyDescriptor(p,E);return x===void 0||!("value"in x)||x.writable||x.configurable?!1:n.primitivesStay&&typeof E=="symbol"&&(typeof x.value!="object"||x.value===null)&&typeof x.value!="function"?!0:is.includes(E)&&typeof x.value=="number"},a=t,l=a.setTimeout,c=a.setInterval,h=a.crypto,g=(p,E)=>function(x,m,...k){if(typeof x!="function")throw new TypeError(`${E} takes a function: a guest view cannot run code from text`);return p.call(t,x,m,...k)},w=h?Object.freeze({getRandomValues:p=>h.getRandomValues(p)}):void 0,b=a.document?.defaultView;if(b&&b!==a)for(let p of Reflect.ownKeys(b))typeof p=="symbol"||s.has(p)||Reflect.deleteProperty(b,p)||o.push(`window.${p}`);let f=[];for(let p=t;p&&p!==Object.prototype;p=Object.getPrototypeOf(p))f.push(p);for(let p of f)for(let E of Reflect.ownKeys(p))s.has(E)||(Reflect.deleteProperty(p,E)?r.push(ns(E)):i(p,E)||o.push(ns(E)));let R=()=>function(){throw new EvalError("A guest view cannot make code from text.")},u=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let p of u){let E=R();Object.defineProperty(E,"prototype",{value:p,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(p,"constructor",{value:E,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),p===Function.prototype&&Reflect.defineProperty(t,"Function",{value:E,writable:!0,enumerable:!1,configurable:!0})}let y=(p,E)=>{Reflect.defineProperty(t,p,{value:E,writable:!0,enumerable:!0,configurable:!0})||o.push(p)};y("setTimeout",g(l,"setTimeout")),y("setInterval",g(c,"setInterval")),w&&y("crypto",w);for(let p of f.slice(1))Object.freeze(p);for(let p of Reflect.ownKeys(t)){let E=Reflect.getOwnPropertyDescriptor(t,p);Reflect.defineProperty(t,p,"value"in E?{...E,writable:!1,configurable:!1}:{...E,configurable:!1})}let O;try{O=Reflect.preventExtensions(t)}catch{O=!1}return{removed:r,stuck:o,sealed:O}}var zt=class extends HTMLElement{constructor(){super(),Bn(this,Mr)}connect(e){if(mt(this)===e||(ht(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,Mr,gt(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Gr(this,e,n)}callRemoteMethod(e,...n){return jr(this,e,...n)}};var S={},zr={empty:!0},ta={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},bt={div:S,section:S,article:S,aside:S,header:S,footer:S,nav:S,hgroup:S,search:S,address:S,figure:S,figcaption:S,blockquote:S,p:S,pre:S,hr:zr,br:zr,wbr:zr,h1:S,h2:S,h3:S,h4:S,h5:S,h6:S,span:S,strong:S,em:S,b:S,i:S,u:S,s:S,small:S,mark:S,abbr:S,cite:S,q:S,code:S,kbd:S,samp:S,var:S,sub:S,sup:S,dfn:S,bdi:S,bdo:S,ruby:S,rt:S,rp:S,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:S,menu:S,dl:S,dt:S,dd:S,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:S,caption:S,thead:S,tbody:S,tfoot:S,tr:S,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:S,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:S,output:S,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":{empty:!0,attributes:{autoplay:"boolean",cover:"boolean"}}},na=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],ra={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(na.map(t=>[t,"css"]))},Re={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},Wn={viewBox:"geometry",preserveAspectRatio:"geometry"},ls={oneOf:["userSpaceOnUse","objectBoundingBox"]},cs={oneOf:["R","G","B","A"]},be={...Re,in:"text",result:"text"},ds={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Xn={svg:{attributes:{...Re,...Wn}},g:S,defs:S,symbol:{attributes:{...Re,...Wn,refX:"geometry",refY:"geometry"}},use:{attributes:{...Re,href:"fragment"}},title:S,desc:S,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...Re,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...ds}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...ds}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...Re,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...Re,...Wn,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...Wn,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:S,filter:{attributes:{...Re,filterUnits:ls,primitiveUnits:ls}},feBlend:{attributes:{...be,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...be,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:be},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(t=>[t,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...be,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...be,in2:"text",scale:"number",xChannelSelector:cs,yChannelSelector:cs}},feDropShadow:{attributes:{...be,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:be},feGaussianBlur:{attributes:{...be,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:be},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...be,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...be,dx:"number",dy:"number"}},feTurbulence:{attributes:{...Re,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var us=["alert","alertdialog","dialog","banner","main","navigation","contentinfo","complementary","search","form","application","status","log","marquee","timer"],fs=["region"],Vr={nav:"div",header:"div",footer:"div",aside:"div",search:"div",output:"span"},qn={section:["aria-label","title"]},ps=["aria-labelledby","aria-describedby"];function oa(t){return/^aria-[a-z]+$/.test(t)}function sa(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Fr=4e3,ms=1e5,Vt=512e3,Br=1e4,hs="http://www.w3.org/1999/xhtml",gs="http://www.w3.org/2000/svg",ia=new Map(Object.keys(Xn).map(t=>[t.toLowerCase(),t]));function Kn(t){return ia.get(t.toLowerCase())}function Zn(t,e,n){let r=n.toLowerCase(),o=t==="html"?[bt[e]?.attributes,ta]:[Xn[e]?.attributes,ra],s=t==="svg"&&r==="xlink:href"?"href":r;for(let i of o)if(i){for(let[a,l]of Object.entries(i))if(a.toLowerCase()===s)return{name:a,kind:l}}if(oa(r)||sa(r))return{name:r,kind:"text"}}var Jn=/^\\d{4}-\\d{2}-\\d{2}$/;function aa(t,e){if(typeof t!="string"||typeof e!="string"||!Jn.test(t)||!Jn.test(e))return;let n=Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/864e5);return Number.isFinite(n)?n:void 0}function ys(t,e,n={}){let r=aa(t,e);if(r===void 0)return"";if(r===0)return"today";if(r===1)return"tomorrow";if(r<0&&n.due===!0)return"overdue";if(r===-1)return"yesterday";let o=Math.abs(r),[s,i]=o<14?[o,"day"]:o<60?[Math.round(o/7),"week"]:o<730?[Math.round(o/30.44),"month"]:[Math.round(o/365.25),"year"],a=`${s} ${i}${s===1?"":"s"}`;return r>0?`in ${a}`:`${a} ago`}function bs(t,e){if(typeof t!="string")return;if(Jn.test(t))return t;let n=Date.parse(t);if(Number.isFinite(n)){if(!/(Z|[+-]\\d\\d:?\\d\\d)$/.test(t))return Jn.test(t.slice(0,10))?t.slice(0,10):void 0;try{let r=new Intl.DateTimeFormat("en-CA",{timeZone:e||"UTC",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(n),o=s=>r.find(i=>i.type===s)?.value??"";return`${o("year")}-${o("month")}-${o("day")}`}catch{return new Date(n).toISOString().slice(0,10)}}}var Es="~",Qn=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Te=(t,e=0)=>{if(t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===void 0)return t;if(!(e>64||typeof t!="object"))return Array.isArray(t)?t.map(n=>Te(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,Te(r,e+1)]))};function ws(){let t=new Map,e=new Map,n=new Map([[Es,{children:[],listeners:new Map}]]),r=0,o=c=>{let h=e.get(c);return h===void 0&&(h=r+=1,e.set(c,h),t.set(h,{listener:c,count:0})),t.get(h).count+=1,h},s=c=>{let h=t.get(c);h&&(h.count-=1,!(h.count>0)&&(t.delete(c),e.delete(h.listener)))},i=c=>{let h=n.get(c);if(h){n.delete(c);for(let g of h.listeners.values())s(g);for(let g of h.children)i(g)}},a=(c,h,g=0)=>{if(!Qn(c)||g>64)return Te(c);let w=typeof c.id=="string"?c.id:void 0,b=h&&w!==void 0&&w!==Es;b&&i(w);let f={children:[],listeners:new Map};b&&n.set(w,f);let R={};for(let[u,y]of Object.entries(c))u==="children"&&Array.isArray(y)?R[u]=y.map(O=>{let p=a(O,b,g+1);return b&&Qn(O)&&typeof O.id=="string"&&f.children.push(O.id),p}):u==="eventListeners"&&Qn(y)?R[u]=Object.fromEntries(Object.entries(y).map(([O,p])=>{if(typeof p!="function"||!b)return[O,void 0];let E=o(p);return f.listeners.set(O,E),[O,{listener:E}]})):R[u]=Te(y,g+1);return R},l=c=>{if(!Array.isArray(c))return Te(c);let[h,g]=c,w=typeof g=="string"?n.get(g):void 0;if(h===0){let b=a(c[2],w!==void 0),f=Qn(c[2])?c[2].id:void 0;if(w&&typeof f=="string"&&n.has(f)){let R=Number(c[3]);w.children.splice(Number.isInteger(R)&&R>=0&&R<=w.children.length?R:w.children.length,0,f)}return[h,Te(g),b,Te(c[3])]}if(h===1){let b=Number(c[2]);return w&&Number.isInteger(b)&&b>=0&&b<w.children.length&&i(w.children.splice(b,1)[0]),Te(c)}if(h===3&&c[4]===3){let b=String(c[2]),f=c[3],R=w&&typeof f=="function"?o(f):void 0,u=w?.listeners.get(b);return u!==void 0&&s(u),R===void 0?w?.listeners.delete(b):w.listeners.set(b,R),[h,Te(g),b,R===void 0?void 0:{listener:R},3]}return Te(c)};return{encode:c=>c.map(l),listener:c=>t.get(c)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var Yr="graview-view-root",la=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],ca=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\'/g,"'"),da=t=>Object.freeze({html:t,toString:()=>t}),Ns=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),Ts=t=>t==null||t===!1?"":Array.isArray(t)?t.map(Ts).join(""):Ns(t)?t.html:ca(String(t));function xs(t){customElements.get(Yr)||customElements.define(Yr,zt);let e=Event,n=ws(),r=new Set,o=new Set,s,i=[],a=new Set;for(let d of["closest","matches","dataset"]){let T=()=>{throw new TypeError(`A view\'s element has no ${d}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};d in Element.prototype||Object.defineProperty(Element.prototype,d,d==="dataset"?{get:T}:{value:T})}let l=document.createElement(Yr),c=d=>{let T=_=>{for(let D of Array.from(_.childNodes)){if(D.nodeType!==1)continue;if(ce(D)===d)return D;let I=T(D);if(I)return I}};return T(l)},h=d=>{let T=c(d.target);if(!T)return;let _=new e(d.event,{bubbles:!0}),D={};for(let I of la)d[I]!==void 0&&(D[I]=d[I]);for(let I of Object.keys(D))Object.defineProperty(_,I,{value:D[I],enumerable:!0});T.dispatchEvent(_);for(let I of o){if(I.type!==d.event)continue;let H;try{H=new Set(Array.from(l.querySelectorAll(I.selector)))}catch{continue}for(let q=T;q&&q!==l;q=q.parentNode)if(H.has(q)){I.listener(Object.freeze({type:d.event,target:T,element:q,...D}));break}}},g=Error,w=new Map,b=0,f=(d,T,_)=>new Promise((D,I)=>{let H=++b;w.set(H,q=>q.ok?D(q):I(new g(q.sentence??"This value was not kept."))),t.send({type:"mine",id:H,op:d,key:T,...d==="set"?{value:_}:{}})}),R=d=>(d.catch(()=>{}),d),u=Object.freeze({get(d){return R(f("get",d).then(T=>typeof T.value=="string"?T.value:null))},set(d,T){return R(f("set",d,T).then(()=>{}))}}),y=d=>{if(d.type==="mine-answer"){let I=w.get(d.id);return w.delete(d.id),I?.(d)}if(d.type==="dom-event"&&typeof d.target=="string")return h(d);if(d.type==="notice")return t.warn(d.text);if(d.type!=="props")return;s=d.props;let T=t.now();for(let I of r)try{I(d.props)}catch(H){t.threw(H)}let _=t.now()-T,D=d.push;typeof D=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:D,ms:_})))},O;l.connect({mutate(d){O||(O=[],t.microtask(()=>{let T=O??[];O=void 0,t.send({type:"render",records:n.encode(T)})})),O.push(...d)},call:()=>{}});let p=d=>d.nodeType===1?d.getAttribute("data-key")??d.getAttribute("id"):null,E=(d,T)=>d.nodeType===T.nodeType&&(d.nodeType!==1||d.localName===T.localName&&d.namespaceURI===T.namespaceURI&&p(d)===p(T));function x(d,T){let _=Array.from(T.childNodes),D=0;for(let I of _){let H=d.childNodes[D]??null;if(H&&E(H,I)){m(H,I),D+=1;continue}if(p(I)!==null){let Pe=Array.from(d.childNodes).slice(D+1).find(vt=>E(vt,I));if(Pe){d.insertBefore(Pe,H),m(Pe,I),D+=1;continue}}d.insertBefore(I,H),D+=1}for(;d.childNodes.length>D;)d.removeChild(d.lastChild)}function m(d,T){if(d.nodeType!==1){d.data!==T.data&&(d.data=T.data);return}let _=d,D=T,I=k(_);for(let H of _.getAttributeNames())D.hasAttribute(H)||(_.removeAttribute(H),I&&Ge(_,H,void 0));for(let H of D.getAttributeNames()){let q=D.getAttribute(H);_.getAttribute(H)!==q&&_.setAttribute(H,q),I&&Ge(_,H,q)}x(_,D)}let k=d=>d.localName.includes("-");function N(d){for(let T of Array.from(d.childNodes)){if(T.nodeType!==1)continue;let _=T;if(k(_))for(let D of _.getAttributeNames())Ge(_,D,_.getAttribute(D)??void 0);N(_)}}function C(d,T,_){for(let D of Array.from(d.childNodes)){if(D.nodeType!==1)continue;let I=D,H=I.localName,q=T||H.toLowerCase()==="svg",Pe=q?Kn(H):Object.prototype.hasOwnProperty.call(bt,H.toLowerCase())?H.toLowerCase():void 0;if(!Pe){_.add(`<${H}>`);continue}for(let vt of I.getAttributeNames())(!Zn(q?"svg":"html",Pe,vt)||!q&&qn[Pe]?.includes(vt.toLowerCase()))&&_.add(`${Pe} ${vt}`);C(I,q,_)}}function P(d){let T=document.createElement("div"),_=Array.isArray(d)?d:[d];for(let I of _)if(I!=null)if(typeof I=="string"||Ns(I)){let H=document.createElement("div");H.innerHTML=typeof I=="string"?I:I.html,T.append(...Array.from(H.childNodes))}else T.append(I);let D=new Set;C(T,!1,D),i=[...D],i.length>0&&t.warn(`The host will not draw: ${i.join(", ")}`),N(T),x(l,T)}let v=[],j=new Set(ts),$="[]",F=!1,J=()=>{F||(F=!0,t.microtask(()=>{F=!1;let d=[...new Map([...o].filter(_=>j.has(_.type)).map(_=>[`${_.type} ${_.selector}`,{event:_.type,selector:_.selector}])).entries()].sort(([_],[D])=>_<D?-1:_>D?1:0).map(([,_])=>_),T=JSON.stringify(d);T!==$&&($=T,t.send({type:"gestures",bound:d}))}))},fo="[[],[]]",fr=!1,po=()=>{fr||(fr=!0,t.microtask(()=>{fr=!1;let d=I=>[...new Set([...o].filter(H=>H.type===I&&typeof H.selector=="string").map(H=>H.selector))].sort().slice(0,200),T=d("click"),_=d("acted"),D=JSON.stringify([T,_]);D!==fo&&(fo=D,t.send({type:"clicks",selectors:T,..._.length>0?{acted:_}:{}}))}))},mo=Object.freeze({get props(){return s},onProps(d){return r.add(d),s&&d(s),()=>void r.delete(d)},render:P,style(d){typeof d!="string"||v.includes(d)||(v.push(d),t.send({type:"style",sheets:[...v]}))},on(d,T,_){let D={type:d,selector:T,listener:_};return o.add(D),typeof d=="string"&&!a.has(d)&&(a.add(d),t.send({type:"hears",events:[d]})),j.has(d)&&J(),(d==="click"||d==="acted")&&po(),()=>{o.delete(D),j.has(d)&&J(),(d==="click"||d==="acted")&&po()}},act:(d,T={})=>t.act(d,T),mine:u,navigate(d){if(typeof d=="string")return t.navigate(d);let T=es(d);T&&t.send(T)},html(d,...T){return da(d.reduce((_,D,I)=>_+D+(I<T.length?Ts(T[I]):""),""))},get today(){return s?.today??new Date().toISOString().slice(0,10)},fromToday(d,T){let _=bs(d,s?.timeZone);return _===void 0?"":ys(_,mo.today,T)},get refused(){return i},get hardening(){return t.hardening()}});return{view:mo,hear:y,find:d=>{try{let T=l.querySelectorAll(d)[0];return T?ce(T):void 0}catch{return}},listened:d=>{let T=new Set;for(let _ of o)if(_.type===d)try{for(let D of Array.from(l.querySelectorAll(_.selector))){let I=ce(D);I&&T.add(I)}}catch{}return[...T]}}}var Ss=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function Ft(t,e){let n=t.find(s=>s.as===e);if(n)return n;let r=e.trim().toLowerCase(),o=Ss(e);return t.find(s=>s.title!==void 0&&s.title.trim().toLowerCase()===r)??(o?t.find(s=>s.as===o||s.title!==void 0&&Ss(s.title)===o):void 0)}var xe=t=>` Its places: ${t.map(e=>typeof e=="string"?`"${e}"`:e.title&&e.title!==e.as?`"${e.as}" (${e.title})`:`"${e.as}"`).join(", ")||"none"}.`,Et=" This run was not handed the views the host keeps, so a titled view\'s place is not among these: if it names one, the link goes there.",Bt=t=>`"${t.length>80?`${t.slice(0,79)}\\u2026`:t}"`;var ua=t=>typeof t=="string"&&/^#[A-Za-z_][A-Za-z0-9_.:-]{0,199}$/.test(t),vs=["https:","mailto:","tel:"];function ks(t){if(!(typeof t!="string"||t.length>2e3||/[\\s<>"]/.test(t.trim())||t.trim()!==t))try{let e=new URL(t);return!vs.includes(e.protocol)||e.protocol==="https:"&&(e.hostname===""||e.username!==""||e.password!=="")?void 0:e.href}catch{return}}function Os(t){let e=new Set,n=r=>{if(typeof r!="string"||!/^(https|mailto|tel):/i.test(r))return;let o=ks(r);o&&e.add(o)};for(let r of[...t?.node?[t.node]:[],...t?.nodes??[]])for(let[o,s]of Object.entries(r))o==="id"||o==="kind"||(Array.isArray(s)?s.forEach(n):n(s));return e}function As(t){return(t??[]).flatMap(e=>{try{let n=new URL(e);return n.protocol==="https:"&&n.hostname!==""&&n.username===""&&n.password===""?[n.origin]:[]}catch{return[]}})}function Rs(t,e){if(ua(t))return t;let n=ks(t);if(n&&(e.handed.has(n)||n.startsWith("https:")&&As(e.origins).includes(new URL(n).origin)))return n}function _s(t,e){let n=t.length>120?`${t.slice(0,119)}\\u2026`:t,r="";try{r=new URL(t).protocol}catch{r=""}if(!vs.includes(r))return`The link "${n}" was not drawn: a view links only to an https:, mailto: or tel: address.`;let o=As(e);return`The link "${n}" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${o.length>0?`, or an https: address on ${o.join(", ")}`:""}; a record or a place of this app is <a data-record> or <a data-place>.`}var Wr={nav:"div",header:"div",footer:"div",aside:"div",search:"div",output:"span"},Ps=["all","display","position","top","right","bottom","left","inset","inset-block","inset-inline","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","width","height","min-width","min-height","max-width","max-height","inline-size","block-size","min-inline-size","min-block-size","max-inline-size","max-block-size","margin","margin-top","margin-right","margin-bottom","margin-left","margin-block","margin-inline","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end","padding","padding-top","padding-right","padding-bottom","padding-left","padding-block","padding-inline","padding-block-start","padding-block-end","padding-inline-start","padding-inline-end","box-sizing","overflow","overflow-x","overflow-y","overflow-wrap","float","clear","z-index","aspect-ratio","object-fit","object-position","vertical-align","isolation","contain","container","container-type","container-name","content-visibility","flex","flex-direction","flex-wrap","flex-flow","flex-grow","flex-shrink","flex-basis","order","grid","grid-template","grid-template-columns","grid-template-rows","grid-template-areas","grid-auto-columns","grid-auto-rows","grid-auto-flow","grid-area","grid-column","grid-row","grid-column-start","grid-column-end","grid-row-start","grid-row-end","gap","row-gap","column-gap","align-items","align-content","align-self","justify-items","justify-content","justify-self","place-items","place-content","place-self","columns","column-count","column-width","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-fill","break-inside","break-before","break-after","page-break-inside","page-break-before","page-break-after","orphans","widows","box-decoration-break","-webkit-box-decoration-break","color","background","background-color","background-image","background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode","border","border-top","border-right","border-bottom","border-left","border-block","border-inline","border-block-start","border-block-end","border-inline-start","border-inline-end","border-width","border-style","border-color","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-start-start-radius","border-start-end-radius","border-end-start-radius","border-end-end-radius","border-collapse","border-spacing","outline","outline-width","outline-style","outline-color","outline-offset","box-shadow","opacity","visibility","mix-blend-mode","filter","backdrop-filter","clip-path","accent-color","caret-color","color-scheme","appearance","-webkit-appearance","mask-image","mask-size","mask-position","mask-repeat","mask-origin","mask-clip","mask-composite","mask-mode","mask-type","-webkit-mask","-webkit-mask-image","-webkit-mask-size","-webkit-mask-position","-webkit-mask-repeat","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-composite","font","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-variant-numeric","font-variant-caps","font-variant-ligatures","font-feature-settings","font-variation-settings","font-kerning","font-optical-sizing","font-size-adjust","font-synthesis","line-height","letter-spacing","word-spacing","text-align","text-align-last","text-indent","text-transform","text-decoration","text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-underline-position","text-shadow","text-overflow","text-wrap","text-wrap-mode","text-wrap-style","white-space","white-space-collapse","word-break","line-break","hyphens","tab-size","direction","unicode-bidi","writing-mode","text-orientation","text-rendering","-webkit-font-smoothing","-webkit-line-clamp","-webkit-box-orient","line-clamp","-webkit-text-fill-color","-webkit-background-clip","-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","list-style","list-style-type","list-style-position","content","quotes","counter-reset","counter-increment","counter-set","table-layout","caption-side","empty-cells","transform","transform-origin","transform-box","transform-style","translate","rotate","scale","perspective","perspective-origin","backface-visibility","transition","transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior","animation","animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-composition","will-change","animation-timeline","animation-range","animation-range-start","animation-range-end","scroll-timeline","scroll-timeline-name","scroll-timeline-axis","view-timeline","view-timeline-name","view-timeline-axis","view-timeline-inset","timeline-scope","cursor","pointer-events","user-select","-webkit-user-select","touch-action","resize","scroll-behavior","overscroll-behavior","overscroll-behavior-x","overscroll-behavior-y","scroll-snap-type","scroll-snap-align","scroll-snap-stop","scroll-margin","scroll-padding","scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left","scroll-margin-block","scroll-margin-block-start","scroll-margin-block-end","scroll-margin-inline","scroll-margin-inline-start","scroll-margin-inline-end","scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left","scroll-padding-block","scroll-padding-block-start","scroll-padding-block-end","scroll-padding-inline","scroll-padding-inline-start","scroll-padding-inline-end","scrollbar-width","scrollbar-color","scrollbar-gutter","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","stop-color","stop-opacity","clip-rule","marker","marker-start","marker-mid","marker-end","paint-order","vector-effect","shape-rendering","text-anchor","dominant-baseline","alignment-baseline","r","cx","cy","rx","ry","x","y","d","mask","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],Cs=["var","env","calc","min","max","clamp","round","mod","rem","abs","sign","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","light-dark","linear-gradient","radial-gradient","conic-gradient","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","translate","translatex","translatey","translatez","translate3d","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","matrix","matrix3d","perspective","cubic-bezier","steps","linear","repeat","minmax","fit-content","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","saturate","sepia","opacity","circle","ellipse","inset","polygon","path","xywh","rect","counter","counters","scroll","view"],Is=["fill","stroke","clip-path","mask","marker","marker-start","marker-mid","marker-end","filter"],Ds=["media","supports","container","keyframes"],Ms={position:["static","relative","absolute","sticky"],all:[],appearance:["auto","none","menulist-button","textfield"],"-webkit-appearance":["auto","none","menulist-button","textfield"]},Ls=["host","host-context","slotted","part","backdrop","picker","view-transition","view-transition-group","view-transition-image-pair","view-transition-old","view-transition-new"],$s=["-webkit-details-marker"],Yt=64e3;var ne=t=>t>=48&&t<=57,Hs=t=>ne(t)||t>=65&&t<=70||t>=97&&t<=102,Jr=t=>t>=65&&t<=90||t>=97&&t<=122,Qr=t=>t>=128,er=t=>Jr(t)||Qr(t)||t===95,Us=t=>er(t)||ne(t)||t===45,Gs=t=>t===10,_e=t=>t===10||t===9||t===32,fa=t=>t>=0&&t<=8||t===11||t>=14&&t<=31||t===127,Ee=-1;function pa(t){let e=[];for(let n=0;n<t.length;n+=1){let r=t.codePointAt(n);r>65535&&(n+=1),r===13?(t.charCodeAt(n+1)===10&&(n+=1),r=10):r===12?r=10:(r===0||r>=55296&&r<=57343)&&(r=65533),e.push(r)}return e}function Xt(t){let e=pa(t),n=0,r=(u=0)=>n+u<e.length?e[n+u]:Ee,o=[],s=(u,y)=>u===92&&y!==10&&y!==Ee,i=(u,y,O)=>u===45?er(y)||y===45||s(y,O):er(u)?!0:s(u,y),a=(u,y,O)=>u===43||u===45?ne(y)||y===46&&ne(O):ne(u===46?y:u),l=()=>{let u=r();if(n+=1,u===Ee)return 65533;if(Hs(u)){let y=String.fromCodePoint(u);for(;y.length<6&&Hs(r());)y+=String.fromCodePoint(r()),n+=1;_e(r())&&(n+=1);let O=parseInt(y,16);return O===0||O>=55296&&O<=57343||O>1114111?65533:O}return u},c=()=>{let u="";for(;;){let y=r();if(Us(y))u+=String.fromCodePoint(y),n+=1;else if(s(y,r(1)))n+=1,u+=String.fromCodePoint(l());else return u}},h=()=>{let u="";for((r()===43||r()===45)&&(u+=String.fromCodePoint(e[n++]));ne(r());)u+=String.fromCodePoint(e[n++]);if(r()===46&&ne(r(1)))for(u+=String.fromCodePoint(e[n++],e[n++]);ne(r());)u+=String.fromCodePoint(e[n++]);if((r()===69||r()===101)&&(ne(r(1))||(r(1)===43||r(1)===45)&&ne(r(2))))for(u+=String.fromCodePoint(e[n++]),ne(r())||(u+=String.fromCodePoint(e[n++]));ne(r());)u+=String.fromCodePoint(e[n++]);return u},g=()=>{let u=h();return i(r(),r(1),r(2))?{type:"dimension",repr:u,unit:c()}:r()===37?(n+=1,{type:"percentage",repr:u}):{type:"number",repr:u}},w=()=>{for(;;){let u=r();if(n+=1,u===41||u===Ee)return;s(u,r())&&l()}},b=()=>{let u="";for(;_e(r());)n+=1;for(;;){let y=r();if(n+=1,y===41)return{type:"url",value:u};if(y===Ee)return{type:"url",value:u};if(_e(y)){for(;_e(r());)n+=1;return r()===41||r()===Ee?(r()===41&&(n+=1),{type:"url",value:u}):(w(),{type:"bad-url"})}if(y===34||y===39||y===40||fa(y))return w(),{type:"bad-url"};if(y===92){if(s(y,r()))u+=String.fromCodePoint(l());else return w(),{type:"bad-url"};continue}u+=String.fromCodePoint(y)}},f=()=>{let u=c();if(u.toLowerCase()==="url"&&r()===40){for(n+=1;_e(r())&&_e(r(1));)n+=1;let y=_e(r())?r(1):r();return y===34||y===39?{type:"function",value:u}:b()}return r()===40?(n+=1,{type:"function",value:u}):{type:"ident",value:u}},R=u=>{let y="";for(;;){let O=r();if(n+=1,O===u||O===Ee)return{type:"string",value:y};if(Gs(O))return n-=1,{type:"bad-string"};if(O===92){if(r()===Ee)continue;if(Gs(r())){n+=1;continue}y+=String.fromCodePoint(l());continue}y+=String.fromCodePoint(O)}};for(;;){for(;r()===47&&r(1)===42;){for(n+=2;r()!==Ee&&!(r()===42&&r(1)===47);)n+=1;r()!==Ee&&(n+=2)}let u=r();if(u===Ee)return o;if(_e(u)){for(;_e(r());)n+=1;o.push({type:"whitespace"});continue}switch(n+=1,u){case 34:case 39:o.push(R(u));continue;case 35:if(Us(r())||s(r(),r(1))){let y=i(r(),r(1),r(2));o.push({type:"hash",value:c(),id:y})}else o.push({type:"delim",value:"#"});continue;case 40:o.push({type:"("});continue;case 41:o.push({type:")"});continue;case 43:case 46:a(u,r(),r(1))?(n-=1,o.push(g())):o.push({type:"delim",value:String.fromCodePoint(u)});continue;case 44:o.push({type:","});continue;case 45:a(u,r(),r(1))?(n-=1,o.push(g())):r()===45&&r(1)===62?(n+=2,o.push({type:"CDC"})):i(u,r(),r(1))?(n-=1,o.push(f())):o.push({type:"delim",value:"-"});continue;case 58:o.push({type:":"});continue;case 59:o.push({type:";"});continue;case 60:r()===33&&r(1)===45&&r(2)===45?(n+=3,o.push({type:"CDO"})):o.push({type:"delim",value:"<"});continue;case 64:i(r(),r(1),r(2))?o.push({type:"at-keyword",value:c()}):o.push({type:"delim",value:"@"});continue;case 91:o.push({type:"["});continue;case 92:s(u,r())?(n-=1,o.push(f())):o.push({type:"delim",value:"\\\\"});continue;case 93:o.push({type:"]"});continue;case 123:o.push({type:"{"});continue;case 125:o.push({type:"}"});continue;default:ne(u)?(n-=1,o.push(g())):er(u)?(n-=1,o.push(f())):o.push({type:"delim",value:String.fromCodePoint(u)})}}}var Bs={"{":"}","[":"]","(":")"},Ys=32,qr=class{tokens;i=0;constructor(e){this.tokens=e}peek(){return this.tokens[this.i]}next(){return this.tokens[this.i++]}};function Ws(t,e){let n=t.next();return n.type==="{"||n.type==="["||n.type==="("?{type:"block",open:n.type,value:js(t,Bs[n.type],e+1)}:n.type==="function"?{type:"func",name:n.value,value:js(t,")",e+1)}:n}function js(t,e,n){let r=[];for(;;){let o=t.peek();if(!o)return r;if(o.type===e)return t.next(),r;if(n>Ys){t.next(),r.push({type:"bad-string"});continue}r.push(Ws(t,n))}}function wt(t,e){let n=[],r=0;for(;r<t.length;){let o=t[r];if(o.type==="whitespace"||e&&(o.type==="CDO"||o.type==="CDC")){r+=1;continue}if(o.type==="at-keyword"){let a=[];r+=1;let l;for(;r<t.length;){let c=t[r];if(r+=1,c.type===";")break;if(c.type==="block"&&c.open==="{"){l=c.value;break}a.push(c)}n.push({type:"at-rule",name:o.value,prelude:a,...l?{block:l}:{}});continue}let s=[],i;for(;r<t.length;){let a=t[r];if(r+=1,a.type==="block"&&a.open==="{"){i=a.value;break}s.push(a)}i&&n.push({type:"qualified",prelude:s,block:i})}return n}function eo(t){let e=[],n=0;for(;n<t.length;){let r=t[n];if(r.type==="whitespace"||r.type===";"){n+=1;continue}if(r.type==="at-keyword"){let s=(()=>{for(let i=n+1;i<t.length;i+=1){let a=t[i];if(a.type===";"||a.type==="block"&&a.open==="{")return i+1}return t.length})();e.push(...wt(t.slice(n,s),!1)),n=s;continue}if(r.type==="ident"){let s=n+1;for(;t[s]?.type==="whitespace";)s+=1;if(t[s]?.type===":"){let i=s+1;for(;i<t.length&&t[i].type!==";";)i+=1;let a=Xs(r.value,t.slice(s+1,i));if(a.value.some(l=>l.type==="block"&&l.open==="{")){let l=t.findIndex((c,h)=>h>n&&c.type==="block"&&c.open==="{");e.push(...wt(t.slice(n,l+1),!1)),n=l+1;continue}e.push(a),n=i+1;continue}}let o=n;for(;o<t.length&&!(t[o].type==="block"&&t[o].open==="{")&&t[o].type!==";";)o+=1;o<t.length&&t[o].type==="block"&&e.push(...wt(t.slice(n,o+1),!1)),n=o+1}return e}function Xs(t,e){let n=[...e];for(;n[0]?.type==="whitespace";)n.shift();for(;n.at(-1)?.type==="whitespace";)n.pop();let r=!1,s=n.length-1;if(n[s]?.type==="ident"&&n[s].value.toLowerCase()==="important"){for(s-=1;n[s]?.type==="whitespace";)s-=1;let i=n[s];if(i?.type==="delim"&&i.value==="!")for(r=!0,n.length=s;n.at(-1)?.type==="whitespace";)n.pop()}return{type:"declaration",name:t,value:n,important:r}}function to(t){let e=new qr(Xt(t)),n=[];for(;e.peek();)n.push(Ws(e,0));return n}function Nt(t){let e="",n=[...t].map(r=>r.codePointAt(0));return n.forEach((r,o)=>{r===0?e+="\\uFFFD":r>=1&&r<=31||r===127||o===0&&ne(r)||o===1&&ne(r)&&n[0]===45?e+=`\\\\${r.toString(16)} `:o===0&&r===45&&n.length===1?e+="\\\\-":Qr(r)||r===45||r===95||ne(r)||Jr(r)?e+=String.fromCodePoint(r):e+=`\\\\${String.fromCodePoint(r)}`}),e}function tr(t){let e="";for(let n of t){let r=n.codePointAt(0);Qr(r)||r===45||r===95||ne(r)||Jr(r)?e+=n:r>=1&&r<=31||r===127?e+=`\\\\${r.toString(16)} `:e+=`\\\\${n}`}return e}function Wt(t){let e=\'"\';for(let n of t){let r=n.codePointAt(0);r===0?e+="\\uFFFD":r>=1&&r<=31||r===127||r===60||r===62?e+=`\\\\${r.toString(16)} `:r===34||r===92?e+=`\\\\${n}`:e+=n}return`${e}"`}function ma(t){let e=tr(t);return/^[eE]([0-9]|[+-][0-9])/.test(t)?`\\\\${t.codePointAt(0).toString(16)} ${tr(t.slice(1))}`:e}var zs=t=>{switch(t.type){case"ident":case"url":case"bad-url":case"number":case"percentage":case"dimension":case"CDC":case"hash":case"at-keyword":return t.type;case"func":case"function":return"function";case"block":return t.open==="("?"(":"other";case"(":return"(";case"delim":return`delim${t.value}`;default:return"other"}};function ha(t,e){let n=["ident","function","url","bad-url","delim-","number","percentage","dimension","CDC"];return t==="ident"?[...n,"("].includes(e):t==="at-keyword"||t==="hash"||t==="dimension"||t==="delim#"||t==="delim-"?n.includes(e):t==="number"?["ident","function","url","bad-url","number","percentage","dimension","delim%"].includes(e):t==="delim@"?["ident","function","url","bad-url","delim-","CDC"].includes(e):t==="delim."||t==="delim+"?["number","percentage","dimension"].includes(e):t==="delim/"?e==="delim*":!1}function ga(t){switch(t.type){case"whitespace":return" ";case"ident":return Nt(t.value);case"at-keyword":return`@${Nt(t.value)}`;case"hash":return`#${tr(t.value)}`;case"string":return Wt(t.value);case"url":return`url(${Wt(t.value)})`;case"delim":return t.value==="\\\\"?`\\\\\n`:t.value;case"CDO":return"<!--";case"CDC":return"-->";case"number":return t.repr;case"percentage":return`${t.repr}%`;case"dimension":return`${t.repr}${ma(t.unit)}`;case"func":return`${Nt(t.name)}(${je(t.value)})`;case"block":return`${t.open}${je(t.value)}${Bs[t.open]}`;case":":case";":case",":case"[":case"]":case"(":case")":case"{":case"}":return t.type;default:return""}}function je(t){let e="",n;for(let r of t)r.type==="whitespace"&&n?.type==="whitespace"||(n&&ha(zs(n),zs(r))&&(e+="/**/"),e+=ga(r),n=r);return e}var ya=new Set(Ps),qs=new Set(Cs),Vs=new Set(Is),ba=new Set(Ds),Ea=new Set(Ls),wa=new Set($s),Fs=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,ue=t=>t.replace(/[A-Z]/g,e=>e.toLowerCase()),Na=t=>ue(t);function Kr(t,e,n){let r=[];for(let o of e){if(o.type==="bad-url"||o.type==="bad-string"){n({reason:"unreadable",...t?{name:t}:{}});return}if(o.type==="url"){if(t&&Vs.has(t)&&Fs.test(o.value)){r.push({type:"func",name:"url",value:[{type:"string",value:o.value}]});continue}n({reason:"url",...t?{name:t}:{}});return}if(o.type==="func"){let s=ue(o.name);if(s==="url"||s==="src"){let a=o.value.filter(c=>c.type!=="whitespace"),l=a[0];if(s==="url"&&a.length===1&&l?.type==="string"&&t&&Vs.has(t)&&Fs.test(l.value)){r.push({type:"func",name:"url",value:[{type:"string",value:l.value}]});continue}n({reason:"url",...t?{name:t}:{}});return}if(!qs.has(s)){n({reason:"function",name:s});return}let i=Kr(t,o.value,n);if(!i)return;s==="var"?r.push({type:"whitespace"},{type:"func",name:s,value:i},{type:"whitespace"}):r.push({type:"func",name:s,value:i});continue}if(o.type==="block"){if(o.open==="{"||o.open==="("&&r.at(-1)?.type==="ident"){n({reason:"unreadable",...t?{name:t}:{}});return}let s=Kr(t,o.value,n);if(!s)return;r.push({type:"block",open:o.open,value:s});continue}if(o.type==="at-keyword"||o.type==="CDO"||o.type==="CDC"||o.type==="{"||o.type==="}"||o.type===";"||o.type===")"||o.type==="]"||o.type==="delim"&&o.value==="\\\\"){n({reason:"unreadable",...t?{name:t}:{}});return}r.push(o)}return r}var Ta=/^(animation|transition|scroll-behavior|outline)/,xa="--graview-ring-color",Sa="--graview-focus-color",va=t=>{let e=t.filter(r=>r.type!=="whitespace"),n=e[0];return e.length!==1||!n?!1:n.type==="hash"?/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(n.value):n.type==="ident"&&!["transparent","currentcolor"].includes(ue(n.value))},ka=new Set(["url","src","image-set","-webkit-image-set"]),Ks=t=>{for(let e of t){if(e.type==="func"&&ka.has(ue(e.name)))return ue(e.name);if(e.type==="func"||e.type==="block"){let n=Ks(e.value);if(n)return n}}};function rr(t,e,n=!1){let r=t.name.startsWith("--"),o=r?t.name:Na(t.name);if(o===xa||!r&&!ya.has(o)){e({reason:"property",name:o});return}if(o===Sa&&!va(t.value)){e({reason:"value",name:o});return}let s=Ms[o];if(s){let l=t.value.filter(g=>g.type!=="whitespace"),c=l[0],h=l.length===1&&c?.type==="ident"?ue(c.value):void 0;if(!h||![...s,"inherit","initial","unset","revert"].includes(h)){e({reason:"value",name:o});return}return`${o}: ${h}${t.important&&!(n&&o==="all")?" !important":""}`}let i=Kr(r?void 0:o,t.value,e);if(!i)return;let a=je(i).trim();return`${r?`--${tr(t.name.slice(2))}`:o}: ${a}${t.important&&!(n&&Ta.test(o))?" !important":""}`}var no=t=>t.some(e=>e.type==="}"||e.type===";"||e.type===")"||e.type==="]"||e.type==="at-keyword"||e.type==="CDO"||e.type==="CDC"||e.type==="delim"&&e.value==="\\\\"||(e.type==="func"||e.type==="block")&&no(e.value));function Zs(t,e){if(no(t))return e({reason:"unreadable",name:"selector"}),!1;let n=Ks(t);if(n)return e({reason:"url",name:n}),!1;let r=o=>{for(let s=0;s<o.length;s+=1){let i=o[s];if(s>0&&o[s-1].type===":"&&(i.type==="ident"||i.type==="func")){let l=ue(i.type==="ident"?i.value:i.name);if(Ea.has(l)||(l.startsWith("-webkit-")||l.startsWith("-moz-"))&&!wa.has(l))return e({reason:"selector",name:l}),!1}if(i.type==="url"||i.type==="bad-url"||i.type==="bad-string"||i.type==="at-keyword"||i.type==="CDO"||i.type==="CDC"||i.type==="block"&&i.open==="{")return e({reason:"unreadable",name:"selector"}),!1;if(i.type==="func"&&!r(i.value)||i.type==="block"&&!r(i.value))return!1}return!0};return r(t)}function Xr(t,e,n){let r=[];for(let o of eo(t))if(o.type==="declaration"){let s=rr(o,e);s&&r.push(`${s};`)}else{let s=nr(o,e,n+1,"style");s&&r.push(s)}return r.join(" ")}function Oa(t,e,n){if(no(t)){n({reason:"unreadable",name:`@${e}`});return}let r=o=>o.every(s=>{if(s.type==="url"||s.type==="bad-url"||s.type==="bad-string"||s.type==="block"&&s.open==="{")return n({reason:s.type==="url"?"url":"unreadable",name:`@${e}`}),!1;if(s.type==="func"){let i=ue(s.name);return e==="supports"&&i==="selector"?Zs(s.value,n):qs.has(i)?r(s.value):(n({reason:"function",name:i}),!1)}if(s.type==="block"){if(e==="supports"){let i=eo(s.value);if(i.length===1&&i[0].type==="declaration")return rr(i[0],n)!==void 0}return r(s.value)}return!0});return r(t)?je(t).trim():void 0}function Zr(t){return t.map((e,n)=>{let r=t[n-1],o=r?.type===":"||r?.type==="delim"&&(r.value==="."||r.value==="|");return e.type==="ident"&&!o&&Object.prototype.hasOwnProperty.call(Wr,ue(e.value))?{type:"block",open:"[",value:[{type:"ident",value:"data-graview-as"},{type:"delim",value:"="},{type:"string",value:ue(e.value)}]}:e.type==="func"?{type:"func",name:e.name,value:Zr(e.value)}:e.type==="block"&&e.open==="("?{type:"block",open:"(",value:Zr(e.value)}:e})}function nr(t,e,n,r){if(n>Ys){e({reason:"unreadable",name:"nesting"});return}if(t.type==="qualified"){if(r==="keyframes"){if(!t.prelude.every(h=>h.type==="whitespace"||h.type===","||h.type==="percentage"||h.type==="ident"&&["from","to"].includes(ue(h.value)))){e({reason:"unreadable",name:"keyframe"});return}return`${je(t.prelude).trim()} { ${Xr(t.block,e,n)} }`}if(!Zs(t.prelude,e))return;let l=je(Zr(t.prelude)).trim();if(l===""){e({reason:"unreadable",name:"selector"});return}return`${l} { ${Xr(t.block,e,n)} }`}let o=ue(t.name),s=o==="-webkit-keyframes"?"keyframes":o;if(!ba.has(s)||r==="keyframes"){e({reason:"at-rule",name:`@${o}`});return}if(!t.block){e({reason:"unreadable",name:`@${o}`});return}if(s==="keyframes"){if(r!=="sheet"){e({reason:"at-rule",name:"@keyframes"});return}let l=t.prelude.filter(w=>w.type!=="whitespace"),c=l[0];if(l.length!==1||!c||c.type!=="ident"&&c.type!=="string"){e({reason:"unreadable",name:"@keyframes"});return}let h=wt(t.block,!1).map(w=>nr(w,e,n+1,"keyframes")).filter(w=>w!==void 0);return`@keyframes ${c.type==="ident"?Nt(c.value):Wt(c.value)} { ${h.join(" ")} }`}let i=Oa(t.prelude,s,e);if(i===void 0)return;let a=r==="style"?Xr(t.block,e,n):wt(t.block,!1).map(l=>nr(l,e,n+1,"sheet")).filter(l=>l!==void 0).join(" ");return`@${s} ${i} { ${a} }`}function qt(t,e=Yt){let n=[];if(t.length>e)return{css:"",refused:[{reason:"size"}]};let r=s=>void n.push(s);return{css:wt(to(t),!0).map(s=>nr(s,r,0,"sheet")).filter(s=>s!==void 0).join(`\n`),refused:n}}function or(t,e=Yt){let n=[],r=[],o=0;for(let s of t){if(o+s.length>e){r.push({reason:"size"});continue}o+=s.length;let i=qt(s,e);i.css&&n.push(i.css),r.push(...i.refused)}return{css:n.join(`\n`),refused:r}}function sr(t,e=Yt){let n=[];if(t.length>e)return{css:"",refused:[{reason:"size"}]};let r=s=>void n.push(s),o=[];for(let s of eo(to(t))){if(s.type!=="declaration"){r({reason:"unreadable",name:"a rule in a style attribute"});continue}let i=rr(s,r,!0);i&&o.push(i)}return{css:o.join("; "),refused:n}}function ir(t,e){let n,r=rr(Xs(t,to(e)),o=>n??=o);return r===void 0||n?{refused:n??{reason:"unreadable",name:t}}:{value:r.slice(r.indexOf(":")+1).trim()}}function Js(t,e){if(e==="svg"){let r=Kn(t);return r?{namespace:"svg",name:r}:{refused:{reason:"element",element:t}}}let n=t.toLowerCase();return n==="svg"?{namespace:"svg",name:"svg"}:Object.prototype.hasOwnProperty.call(bt,n)?Object.prototype.hasOwnProperty.call(Vr,n)?{namespace:"html",name:Vr[n],as:n}:{namespace:"html",name:n}:{refused:{reason:"element",element:t}}}function ar(t,e){return(t==="html"?bt[e]:Xn[e])?.empty===!0}var Aa=/^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/,Ra=/^[0-9A-Za-z\\s.,+\\-%()]*$/,_a=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,Pa=/^data:image\\/(png|gif|jpeg|webp|avif|bmp|svg\\+xml)(;[A-Za-z0-9=._+-]+)*,/i,Ca=/^\\/graview\\/assets\\/[0-9a-f]{64}\\.(png|gif|jpe?g|webp|avif|svg|ico)$/,Qs=/\\/graview\\/assets\\/[0-9a-f]{64}\\.(png|gif|jpe?g|webp|avif|svg|ico)$/,Ia=/^\\/(?!\\/)(?!(?:.*\\/)?\\.\\.?(?:\\/|$))(?!.*%(?:2e|2f|5c))[^\\\\\\s?#"\'<>]*$/i;function Da(t,e){if(Ca.test(t))return t;let n=t;if(/^https?:\\/\\//i.test(t))try{let r=new URL(t);if(e==="null"||r.origin!==e||r.username!==""||r.password!==""||r.search!==""||r.hash!=="")return;n=t.slice(r.origin.length)}catch{return}if(Ia.test(n))return Qs.exec(n)?.[0]}function ei(t,e={},n){let r=t.length>120?`${t.slice(0,119)}\\u2026`:t,o=ti(e.origins),s=Qs.exec(t.split(/[?#]/)[0])?.[0],i=n!==void 0&&n>Vt?` It is a data: image of ${n.toLocaleString("en-US")} characters, more than the ${Vt.toLocaleString("en-US")} a view\'s own data: image may be. A picture on a record is drawn at any size by the src the host hands the view (pictures in its manifest), used as it was handed.`:s?e.assets?` It is the app\'s own image only by its path, or under the app\'s base on this page\'s origin: write it as its path, ${s}.`:" This host has not said where the app\'s own images live (asset, on the view\'s definition), so a view here cannot draw one by its path.":/^https:\\/\\//i.test(t)?o.length>0?` Its origin is not one the host lists for images (${o.join(", ")}).`:" The host lists no origin a view\'s images may come from (images.origins, on the view\'s definition).":"",a=["a data: image",...e.assets?["the app\'s own image by the path add_image answered (/graview/assets/<sha256>.<ext>)"]:[],"a picture on a record (pictures in its manifest)",...o.length>0?[`an https: image from ${o.join(", ")}`]:[]];return`The image "${r}" was not drawn.${i} A view here shows ${a.slice(0,-1).join(", ")} or ${a[a.length-1]}.`}function ti(t){return(t??[]).flatMap(e=>{try{let n=new URL(e);return n.protocol==="https:"&&n.hostname!==""&&n.username===""&&n.password===""?[n.origin]:[]}catch{return[]}})}function Ma(t,e){if(!(!e||e.length===0||!/^https:\\/\\//i.test(t)))try{let n=new URL(t);return n.protocol!=="https:"||n.username!==""||n.password!==""?void 0:ti(e).includes(n.origin)?n.href:void 0}catch{return}}function ro(t,e,n,r,o){let s=Zn(t,e,n);if(!s)return{refused:{reason:"attribute",element:e,name:n}};if(t==="html"&&qn[e]?.includes(s.name))return{refused:{reason:"attribute",element:e,name:n}};if(r===null)return{name:s.name,value:null};let i=La(s.name,s.kind,r,o);return"refused"in i?{refused:{...i.refused,element:e,...s.kind==="image"&&i.refused.reason==="url"?{address:r.slice(0,200),...r.length>Vt?{length:r.length}:{}}:{},...s.kind==="link"?{address:r.slice(0,200)}:{}}}:s.name==="role"&&i.value.split(/\\s+/).some(a=>us.includes(a.toLowerCase()))?{refused:{reason:"value",element:e,name:n}}:s.name==="aria-live"&&!["polite","off"].includes(i.value.toLowerCase())?{refused:{reason:"value",element:e,name:n}}:{name:s.name,value:i.value,...i.dropped?{dropped:i.dropped.map(a=>({reason:a.reason==="url"?"url":"css",element:e,name:s.name,css:a}))}:{}}}function La(t,e,n,r){let o=(s,i)=>({refused:{reason:s,name:t,...i?{css:i}:{}}});if(e==="geometry")return n.length>ms||!Ra.test(n)||/url/i.test(n)?o("value"):{value:n};if(e==="image"){let s=r.picture?.(n);if(s!==void 0)return{value:s};if(n.length>Vt)return o("url");if(Pa.test(n))return{value:n};if(n.startsWith(`blob:${r.origin}/`)&&/^blob:[^\\s"\'<>]+$/.test(n))return{value:n};let i=r.asset?Da(n,r.origin):void 0;if(i!==void 0){let l=r.asset(i);if(l)return{value:l}}let a=Ma(n,r.imageOrigins);return a?{value:a}:o("url")}if(e==="link"){let s=r.link?.(n);return s===void 0?o("url"):{value:s}}if(n.length>Fr)return o("value");if(typeof e=="object"){let s=e.oneOf.find(i=>i.toLowerCase()===n.toLowerCase());return s===void 0?o("value"):{value:s}}switch(e){case"text":return{value:n};case"number":return Aa.test(n.trim())&&Number.isFinite(Number(n))?{value:n.trim()}:o("value");case"boolean":return{value:""};case"fragment":return _a.test(n)?{value:n}:o("url");case"style":{let s=sr(n,Fr);return s.refused.length>0&&s.css===""?o(s.refused[0].reason==="url"?"url":"css",s.refused[0]):{value:s.css,...s.refused.length>0?{dropped:s.refused}:{}}}case"css":{let s=ir(t,n);return"refused"in s?o(s.refused.reason==="url"?"url":"css",s.refused):{value:s.value}}}}var $a="http://www.w3.org/1999/xhtml",Ha=new Set(["button","submit","reset","checkbox","radio","image"]);var lr=(t,...e)=>t.namespaceURI===$a&&e.includes(t.localName),Ua=t=>(t.getAttribute("type")??"text").toLowerCase(),Ga=t=>lr(t,"textarea","select")||lr(t,"input")&&!Ha.has(Ua(t));function ni(t){if(lr(t,"option","optgroup","datalist"))return\'An option is never pressed by itself: put data-act on its select, with data-save="change", or on a button.\';if(lr(t,"label"))return"A press on a label presses its field too, and would ask for the act twice: put data-act on a button, or on the field.";if(Ga(t)&&!t.hasAttribute("data-save"))return\'A click into a field to type or to pick is not a press: give it data-save ("input" or "change") to save it as it is typed, or put data-act on a button beside it.\'}var ja="http://www.w3.org/1999/xhtml",Tt=class{constructor(e){this.ownerDocument=e}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof Ke?this.parentNode:null}get textContent(){return this.childNodes.map(e=>e.textContent).join("")}insertBefore(e,n){e.parentNode&&e.parentNode.removeChild(e);let r=n?this.childNodes.indexOf(n):-1;return r<0?this.childNodes.push(e):this.childNodes.splice(r,0,e),e.parentNode=this,e}appendChild(e){return this.insertBefore(e,null)}removeChild(e){let n=this.childNodes.indexOf(e);return n>=0&&this.childNodes.splice(n,1),e.parentNode=null,e}},qe=class extends Tt{constructor(n,r){super(n);this.data=r}nodeType=3;get textContent(){return this.data}},oo=class extends Tt{nodeType=8;get textContent(){return""}},Ke=class extends Tt{constructor(n,r,o){super(n);this.namespaceURI=r;this.localName=o}nodeType=1;attributes=new Map;value="";checked=!1;selected=!1;setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.get(n)??null}hasAttribute(n){return this.attributes.has(n)}closest(n){for(let r=this;r;r=r.parentElement)if(r.localName===n)return r;return null}},so=class extends Tt{nodeType=9;constructor(){super(null)}createElementNS(e,n){return new Ke(this,e,n)}createElement(e){return new Ke(this,ja,e)}createTextNode(e){return new qe(this,e)}createComment(e){return new oo(this)}};function ri(){let t=new so,e=t.createElement("div");return e.setAttribute("data-graview-view-root",""),t.appendChild(e),{document:t,root:e}}var za=new Set(["video/mp4","video/webm","video/ogg"]);function Va(t,e){let n=t.poster===!0||typeof t.poster=="string"&&t.poster.length>0,r=za.has(t.type.toLowerCase()),o=!r&&!n?`its source is ${t.type}, which not every browser plays, and it has no poster`:r?n?void 0:"it has no poster, so nothing stands before it plays or where a person asked for less motion":`its source is ${t.type}, which not every browser plays`;return{record:e.record,field:e.field,text:typeof t.caption=="string"&&t.caption.trim()?t.caption.trim():t.name,name:t.name,source:t.type,...typeof t.duration=="number"?{duration:t.duration}:{},poster:n,autoplay:e.autoplay,cover:e.cover,playable:r&&n,...o?{why:o}:{}}}var io={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},oi=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr","label"]),si=new Set(["style","template","datalist","option"]),X=t=>t.replace(/\\s+/g," ").trim();function Fa(t){let e=t.duration===void 0?0:Math.round(t.duration);if(e<1)return"a video";if(e<60)return`a ${e}-second video`;let n=Math.round(e/60);return n<60?`a ${n}-minute video`:`a ${Math.floor(n/60)}-hour${n%60>0?` ${n%60}-minute`:""} video`}var de=t=>t instanceof Ke,Kt=t=>t.hasAttribute("hidden")||t.getAttribute("aria-hidden")==="true";function re(t){return t instanceof qe?t.data:!de(t)||Kt(t)||si.has(t.localName)?"":t.localName==="br"?" ":t.localName==="img"?t.getAttribute("alt")??"":t.childNodes.map(re).join(t.localName==="td"||t.localName==="th"?" ":"")}var Ba=/(\\s+[\xB7\u2022|\u2014\u2013-]\\s+)/;function Ya(t,e){if(!e||!t.includes(e))return t;let n=s=>s.length>0&&s.split(" ").length<=3,r=X(t).split(Ba),o=[];for(let s=0;s<r.length;s+=2){let i=r[s],a=i.startsWith(`${e} `)?i.slice(e.length+1):void 0,l=i.endsWith(` ${e}`)?i.slice(0,-e.length-1):void 0,c=i===e?"":a!==void 0&&n(a)?a:l!==void 0&&n(l)?l:i;c&&o.push(...o.length>0?[r[s-1]]:[],c)}return o.join("")}function ii(t,e,n){let r=[];for(let o of t){if(o.t==="list"&&o.groups.every(s=>s.items.every(i=>i.id===e&&i.title===n))){r.push(...ii(o.groups.flatMap(s=>s.items.flatMap(i=>i.parts)),e,n));continue}if(o.t==="text"){let s=Ya(o.text,n);s&&r.push(s===o.text?o:{...o,text:s});continue}r.push(o)}return r}function*Ze(t){for(let e of t.childNodes)de(e)&&(yield e,yield*Ze(e))}function Wa(t){let e=t.getAttribute("data-save"),n=t.getAttribute("data-debounce");if(e===null&&n===null)return[];let r=`drawing <${t.localName}${e!==null?` data-save="${e}"`:` data-debounce="${n}"`}>`,o=[];if(e===null)return[{at:r,says:\'data-debounce is read only on a field that saves as it is typed (data-save="input").\'}];if(!["input","textarea","select"].includes(t.localName))o.push({at:r,says:"Only a field saves as it is typed: an input, a textarea or a select. A button is pressed (data-act alone)."});else if(e!=="input"&&e!=="change")o.push({at:r,says:`data-save is "input" (saved as the person types, once they pause, and when they leave it) or "change" (saved when they leave it or pick), not "${e}".`});else if(t.getAttribute("data-act")===null)o.push({at:r,says:\'It saves through no act: a field saved as it is typed names its act itself, data-act="\\u2026", one in the manifest.\'});else if(!t.getAttribute("name"))o.push({at:r,says:"It has no name: the host sends a field as the act\'s argument its name says."});else{let s=!1,i=!1;for(let a=t;a;a=a.parentElement)a.getAttribute("data-record")!==null&&(i=!0),a!==t&&(a.localName==="fieldset"||a.getAttribute("role")==="group")&&(s=!0);(!s||!i)&&o.push({at:r,says:\'It is in no fieldset bound to a record: the host saves a field inside <fieldset data-record="\\u2026">, with the fields beside it, to the record the fieldset names.\'})}return n!==null&&e!=="input"?o.push({at:r,says:\'data-debounce is read only with data-save="input": a "change" saves at once.\'}):n!==null&&!(n.trim()!==""&&Number.isFinite(Number(n))&&Number(n)>=250&&Number(n)<=1e4)&&o.push({at:r,says:`data-debounce is how long the host waits for the person to pause, in milliseconds from 250 to 10 000, not "${n}"; left out, it waits 1 000.`}),o}function Xa(t,e,n){let r=t.getAttribute("data-drop");if(r===null)return[];let o=`drawing <${t.localName} data-drop="${r}">`,s=[],i=(e.accepts??[]).filter(c=>c.kind===r),a=t.getAttribute("data-drop-field");i.length===0?s.push({at:o,says:`The view\'s accepts names no field of "${r}", so the host offers no drop target here: say the field files go in, accepts: [{ "kind": "${r}", "field": "<its image, video or file field>" }].`}):a!==null&&!i.some(c=>c.field===a)&&s.push({at:o,says:`data-drop-field names "${a}", which the view\'s accepts does not name for "${r}" (${i.map(c=>`"${c.field}"`).join(", ")}): the host offers no drop target here.`});let l=t.getAttribute("data-drop-connect");if(l!==null){let c=l.indexOf(":"),h=c>0?l.slice(c+1):"";c<=0||h===""||n.has(l)?s.push({at:o,says:`data-drop-connect is "<relation>:<record id>" \\u2014 "takenOn:day:saturday" \\u2014 not "${l}"${n.has(l)?", which names a record and no relation":""}.`}):n.has(h)||s.push({at:o,says:`data-drop-connect names "${h}", which this seat was not shown: the host offers no drop target here.`})}return s}function ai(t,e){let n=[],r=new Set,o=new Set,s=[],i=new Map;for(let f of[...e.props.node?[e.props.node]:[],...e.props.nodes??[]])i.set(f.id,f);let a=f=>Ft(e.places,f)!==void 0;for(let f of Ze(t)){let R=f.getAttribute("data-act");R!==null&&r.add(R);let u=R!==null&&f.getAttribute("data-debounce")===null?ni(f):void 0;u&&n.push({at:`drawing <${f.localName} data-act="${R}">`,says:u});let y=f.getAttribute("data-record");y!==null&&(o.add(y),!i.has(y)&&!a(y)&&n.push({at:`drawing <${f.localName} data-record="${y}">`,says:e.placesUnsure?`It names "${y}", which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${xe(e.places)}${Et}`:`It names "${y}", which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${xe(e.places)}`}));let O=f.getAttribute("data-place");O!==null&&!a(O)&&n.push({at:`drawing <${f.localName} data-place="${O}">`,says:e.placesUnsure?`It names the place "${O}", which is none of the places this run was told of.${xe(e.places)}${Et}`:`It names the place "${O}", which this app does not have.${xe(e.places)}`}),n.push(...Wa(f)),n.push(...Xa(f,e,i))}let l=f=>{if(f.localName==="graview-video")return;let R=f.getAttribute("data-record");if(R!==null)return R;let u=f.getAttribute("data-key")??f.getAttribute("id");if(u!==null&&i.has(u))return u;let y=new Set;for(let O of Ze(f)){let p=O.getAttribute("data-record");p!==null&&O.localName!=="graview-video"&&y.add(p)}return y.size===1?[...y][0]:void 0},c=(f,R)=>{let u=i.get(R),y=u?.kind??(R.includes(":")?R.slice(0,R.indexOf(":")):""),O=[...Ze(f)],p=O.find(x=>x.localName in io)??O.find(x=>x.localName==="a"&&x.getAttribute("data-record")===R)??O.find(x=>x.localName==="strong"||x.localName==="b"),E=X(p?re(p):"")||u?.label||R;return{id:R,kind:y,title:E,parts:ii(g(f,p),R,E)}},h=f=>{let R=[...Ze(f)].filter(p=>p.localName==="tr"&&!Kt(p)),u=R.find(p=>p.parentElement?.localName==="thead"||p.childNodes.every(E=>!de(E)||E.localName==="th")),y=u?u.childNodes.filter(de).map(p=>X(re(p))):[];return{t:"list",as:"row",columns:1,groups:[{items:R.filter(p=>p!==u).map(p=>{let E=p.childNodes.filter(de),x=l(p),m=x?i.get(x):void 0;return{id:x??"",kind:m?.kind??"",title:X(re(E[0]??p)),parts:E.slice(1).map((k,N)=>({t:"field",label:y[N+1]??"",text:X(re(k))}))}})}]}};function g(f,R){let u=[],y="",O=()=>{let E=X(y);y="",E&&u.push({t:"text",text:E})},p=f.childNodes;for(let E=0;E<p.length;E+=1){let x=p[E];if(x===R)continue;if(x instanceof qe){y+=x.data;continue}if(!de(x)||Kt(x)||si.has(x.localName))continue;if(R&&[...Ze(x)].includes(R)){O(),u.push(...g(x,R));continue}let m=[];for(let k=E;k<p.length;k+=1){let N=p[k];if(N instanceof qe&&X(N.data)==="")continue;if(!de(N)||Kt(N)||oi.has(N.localName)||N.localName in io)break;let C=l(N);if(!C)break;m.push({element:N,id:C}),E=k}if(m.length>0){O();let k=m.every(N=>N.element.localName==="li"||N.element.localName==="tr");u.push({t:"list",as:k?"row":"card",columns:1,groups:[{items:m.map(N=>c(N.element,N.id))}]});continue}u.push(...w(x,k=>y+=k,O))}return O(),u}function w(f,R,u){let y=f.localName;if(oi.has(y)&&y!=="label")return R(re(f)),[];if(y==="mark"){u();let p=X(re(f));return p?[{t:"badge",text:p}]:[]}u();let O=io[y]??(f.getAttribute("role")==="heading"?Number(f.getAttribute("aria-level")??2):void 0);if(O!==void 0){let p=X(re(f));return p?[{t:"heading",level:O,text:p}]:[]}switch(y){case"ul":case"ol":case"menu":return[{t:"list",as:"row",columns:1,groups:[{items:f.childNodes.filter(E=>de(E)&&E.localName==="li"&&!Kt(E)).map(E=>{let x=l(E);if(x)return c(E,x);let m=g(E),k=m[0],N=k&&(k.t==="text"||k.t==="heading")?k.text:"";return{id:"",kind:"",title:N,parts:N?m.slice(1):m}})}]}];case"table":return[h(f)];case"dl":{let p=[],E="";for(let x of f.childNodes.filter(de))if(x.localName==="dt")E=X(re(x));else if(x.localName==="dd")p.push({t:"field",label:E,text:X(re(x))});else if(x.localName==="div")for(let m of x.childNodes.filter(de))m.localName==="dt"?E=X(re(m)):m.localName==="dd"&&p.push({t:"field",label:E,text:X(re(m))});return p}case"figure":{let p=f.childNodes.find(m=>de(m)&&m.localName==="figcaption"),E=X(f.childNodes.filter(m=>m!==p).map(re).join(" ")),x=p?X(re(p)):"";return E?[{t:"figure",text:E,...x?{label:x}:{}}]:x?[{t:"text",text:x}]:[]}case"meter":case"progress":{let p=Number(f.getAttribute("value")??0),E=Number(f.getAttribute("max")??1)||1;return[{t:"progress",label:f.getAttribute("aria-label")??f.getAttribute("title")??"",text:`${Math.round(p/E*100)}%`}]}case"svg":{let p=f.childNodes.find(m=>de(m)&&m.localName==="title"),E=X(f.getAttribute("aria-label")??(p?re(p):""));if(E)return[{t:"text",text:E,tone:"picture"}];let x=[...Ze(f)].filter(m=>m.localName==="text").map(m=>X(re(m))).filter(Boolean);return x.length>0?[{t:"text",text:x.join(" \\xB7 "),tone:"picture"}]:[]}case"img":{let p=X(f.getAttribute("alt")??"");return p?[{t:"text",text:p,tone:"picture"}]:[]}case"graview-video":{let p=f.getAttribute("data-field")??"",E=f.getAttribute("data-record")??"",x=i.get(E),m=x&&p&&Object.hasOwn(x,p)?x[p]:void 0,k=(Array.isArray(m)?m:[m])[Number(f.getAttribute("data-index")??"0")];if(!k||typeof k.name!="string"||typeof k.type!="string"||!k.type.startsWith("video/"))return n.push({at:`drawing <graview-video data-field="${p}">`,says:"It names no video on a record this seat was shown: the host draws no player there. A <graview-video> names a record the view was shown (data-record) and its video field (data-field)."}),[];let N=Va(k,{record:E,field:p,autoplay:f.getAttribute("autoplay")!==null,cover:f.getAttribute("cover")!==null});s.push(N);let C=N.autoplay?`, playing as a background, muted and looping${N.cover?", filling its box":""}`:"";return[{t:"text",text:`${N.text}, ${Fa(N.duration!==void 0?{duration:N.duration}:{})}${C}`,tone:"picture"}]}case"button":{let p=X(re(f));return p?[{t:"text",text:p,tone:"button"}]:[]}case"input":case"textarea":case"select":{let p=X(f.getAttribute("aria-label")??f.getAttribute("placeholder")??f.getAttribute("name")??""),E=y==="select"?X(re(f.childNodes.find(x=>de(x)&&x.localName==="option"&&x.selected)??f)):f.value;return[{t:"field",label:p,text:E}]}case"label":return g(f);default:return g(f)}}return{parts:g(t),problems:n,acts:[...r],records:[...o],videos:s}}var qa=0,Ka=1,Za=2,Ja=3,li=1,Qa=2,ci=3,el=1,tl=3,nl=8,di="~",Zt=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),ui=new Set(["input","select","textarea","option"]),rl=new Set(["value","checked","selected"]),fi=["aria-label","aria-labelledby","title"],ol=t=>fi.some(e=>(t.getAttribute(e)??"").trim()!=="");function pi(t,e){let n=t.ownerDocument??t,r=e.maxNodes??5e3,o=[],s=new Map,i=new WeakMap,a={dom:t,name:"div",namespace:"html",children:[],id:di};s.set(di,a);let l=0,c=!1,h=new WeakMap,g=new Map,w=new Map,b=m=>{o.push(m),o.length>200&&o.shift(),e.onRefused?.(m)},f=()=>({dom:n.createComment(""),children:[],refused:!0}),R=(m,k)=>{if(m.namespace==="html"&&m.name&&ui.has(m.name))return m.dom;if(k?.namespace==="html"&&k.name==="textarea")return k.dom},u=(m,k)=>{let N=m.dom,C=h.get(N)??N.getAttribute("role");if(C===null||!C.split(/\\s+/).some(P=>fs.includes(P.toLowerCase())))return void h.delete(N);if(ol(N)){h.delete(N),N.getAttribute("role")!==C&&N.setAttribute("role",C);return}h.set(N,C),N.removeAttribute("role"),k&&b({reason:"value",element:m.name,name:"role"})},y=()=>{if(w.size===0)return;let m=new Set,k=N=>{for(let C of N.children){if(C.refused||C.text)continue;let P=C.dom.getAttribute("id");P&&m.add(P),k(C)}};k(a);for(let[N,C]of w){if(N.id===void 0||s.get(N.id)!==N){w.delete(N);continue}let P=N.dom;for(let[v,j]of C){let $=j.value.split(/\\s+/).filter(J=>J!==""),F=$.filter(J=>!m.has(J));if($.length>0&&F.length===0){if(j.drawn)continue;j.drawn=!0,P.setAttribute(v,j.value),u(N,!1)}else j.drawn&&(j.drawn=!1,P.removeAttribute(v),b({reason:"reference",element:N.name,name:v,ids:F.length>0?F:$}),u(N,!0))}}},O=(m,k,N,C=!0)=>{let P=m.dom;if(N!=null&&typeof N!="string")return b({reason:"value",element:m.name,name:k});let v=ro(m.namespace,m.name,k,N??null,e);if("refused"in v){let J=ro(m.namespace,m.name,k,null,e);return"refused"in J||P.removeAttribute(J.name),!("refused"in J)&&J.name==="role"&&h.delete(P),b(v.refused)}for(let J of v.dropped??[])b(J);let j=m.namespace==="html"&&rl.has(v.name)&&ui.has(m.name),$=P,F=j?v.name==="value"?$.value:v.name==="checked"?$.checked:$.selected:void 0;if(v.name==="role"&&h.delete(P),ps.includes(v.name)){let J=w.get(m)??new Map;v.value===null?J.delete(v.name):J.set(v.name,{value:v.value,drawn:!0}),J.size>0?w.set(m,J):w.delete(m)}v.value===null?P.removeAttribute(v.name):P.setAttribute(v.name,v.value),C&&(v.name==="role"||fi.includes(v.name))&&u(m,v.name==="role"),e.onAttribute?.(P,v.name),j&&(v.name==="value"&&"value"in $?($.value=v.value??"",F!==$.value&&e.onFieldSet?.(P)):v.name==="checked"&&"checked"in $?($.checked=v.value!==null,F!==$.checked&&e.onFieldSet?.(P)):v.name==="selected"&&"selected"in $&&($.selected=v.value!==null,F!==$.selected&&e.onFieldSet?.(P.parentElement?.closest("select")??P)))},p=m=>{if(!m.refused){l-=1,m.id!==void 0&&s.delete(m.id);for(let k of m.children)p(k)}},E=(m,k)=>{if(!Zt(m)||typeof m.id!="string"||s.has(m.id))return b({reason:"record"}),f();if(l>=r)return b({reason:"budget"}),c||(c=!0,e.onOverBudget?.()),f();let N=m.id;if(m.type===nl)return f();if(m.type===tl){if(ar(k.namespace,k.name))return b({reason:"child",element:k.name}),f();let $=n.createTextNode(String(m.data??"").slice(0,Br)),F={dom:$,children:[],text:!0,id:N,parent:k};return s.set(N,F),i.set($,N),l+=1,F}if(m.type!==el)return b({reason:"record"}),f();let C=String(m.element);if(ar(k.namespace,k.name))return b({reason:"child",element:C}),f();let P=Js(C,k.namespace);if("refused"in P)return b(P.refused),f();let v=n.createElementNS(P.namespace==="svg"?gs:hs,P.name);P.as&&v.setAttribute("data-graview-as",P.as),P.namespace==="html"&&P.name==="img"&&v.setAttribute("referrerpolicy","no-referrer"),P.namespace==="html"&&P.name==="a"&&(v.setAttribute("target","_blank"),v.setAttribute("rel","noopener noreferrer"),v.setAttribute("referrerpolicy","no-referrer"));let j={dom:v,name:P.name,namespace:P.namespace,children:[],id:N,parent:k};if(s.set(N,j),i.set(v,N),l+=1,Zt(m.attributes)){for(let[$,F]of Object.entries(m.attributes))O(j,$,F,!1);u(j,!0)}if(e.decorate?.(v,P.name,P.namespace),Zt(m.properties))for(let $ of Object.keys(m.properties))b({reason:"attribute",element:P.name,name:$});if(Zt(m.eventListeners))for(let $ of Object.keys(m.eventListeners))m.eventListeners[$]!=null&&b({reason:"attribute",element:P.name,name:`on${$}`});if(Array.isArray(m.children))for(let $ of m.children){let F=E($,j);j.children.push(F),v.appendChild(F.dom)}return j},x=m=>{if(!Array.isArray(m))return b({reason:"record"});let[k,N]=m,C=typeof N=="string"?s.get(N):void 0;if(!C)return b({reason:"record"});switch(k){case qa:{if(C.text)return b({reason:"record"});let P=Number(m[3]),v=Number.isInteger(P)&&P>=0&&P<=C.children.length?P:C.children.length,j=m[2],$=Zt(j)&&typeof j.id=="string"?g.get(j.id):void 0,F;$&&$.parent?.namespace===C.namespace&&!ar(C.namespace,C.name)?(g.delete(j.id),$.parent=C,F=$):F=E(j,C),C.dom.insertBefore(F.dom,C.children[v]?.dom??null),C.children.splice(v,0,F),C.namespace==="html"&&C.name==="textarea"&&e.onFieldSet?.(C.dom);return}case Ka:{let P=Number(m[2]),v=C.children[P];if(!v)return b({reason:"record"});C.children.splice(P,1),v.dom.parentNode?.removeChild(v.dom),v.id!==void 0&&!v.refused?g.set(v.id,v):p(v);return}case Za:{if(!C.text)return b({reason:"record"});C.dom.data=String(m[2]??"").slice(0,Br);let P=R(C,C.parent);P&&e.onFieldSet?.(P);return}case Ja:{if(C===a||C.text)return b({reason:"record"});let P=String(m[2]),v=m[4]??li;return v===Qa?O(C,P,m[3]):b(v===li||v===ci?{reason:"attribute",element:C.name,name:v===ci?`on${P}`:P}:{reason:"record"})}default:return b({reason:"record"})}};return{apply(m,k){if(!Array.isArray(m))return b({reason:"record"}),!0;try{for(let N=0;N<m.length;N+=1){if(k&&N%32===0&&k())return!1;x(m[N])}return!0}finally{for(let N of g.values())p(N);g.clear(),y()}},get refused(){return o},get size(){return l},idOf:m=>i.get(m),elementOf(m){let k=s.get(m);return k&&!k.text&&k!==a?k.dom:void 0},dispose(){for(let m of a.children)p(m);for(a.children.length=0;t.firstChild;)t.removeChild(t.firstChild)}}}var sl="@layer graview-motion, graview-region, graview-view, graview-theme;",il=new Set(["media","supports","container","keyframes","-webkit-keyframes"]),al=new Set(["src","image-set","-webkit-image-set"]),ll={"}":"{",")":"(","]":"["};function hi(t){let e=[],n=Xt(t);for(let[r,o]of n.entries())switch(o.type){case"bad-string":case"bad-url":case"url":case"CDO":case"CDC":return!1;case"delim":if(o.value==="\\\\")return!1;break;case"at-keyword":if(!il.has(o.value.toLowerCase()))return!1;break;case";":if(e.length===0)return!1;break;case"function":{let s=o.value.toLowerCase();if(al.has(s))return!1;if(s==="url"){let i=n[r+1];if(i?.type!=="string"||!i.value.startsWith("#"))return!1}e.push("(");break}case"{":case"(":case"[":e.push(o.type);break;case"}":case")":case"]":if(e.pop()!==ll[o.type])return!1;break;default:}return e.length===0}function mi(t,e){return e.trim()===""||!hi(e)?"":`@layer ${t} {\n${e}\n}`}function gi(t,e){return t.trim()===""?hi(e)?e:"":[sl,mi("graview-theme",t),mi("graview-view",e)].filter(n=>n!=="").join(`\n`)}function yi(t,e,n){let{root:r}=ri(),o=!1,s=pi(r,{origin:n.origin??"null",...n.imageOrigins?{imageOrigins:n.imageOrigins}:{},...n.asset?{asset:n.asset}:{},...n.link?{link:n.link}:{},maxNodes:n.maxNodes,onOverBudget:()=>o=!0});for(let h of t)s.apply(h);let i=[...s.refused],a="";if(e){let h=or(e);a=h.css;for(let g of h.refused)i.push({reason:"css",name:"stylesheet",css:g})}let l=n.theme?qt(n.theme).css:"",c=gi(l,a);return{root:r,refused:i,size:s.size,over:o,css:c,elementOf:h=>s.elementOf(h),idOf:h=>s.idOf(h)}}var cr=" SMIL can set an attribute after the host judged it, and runs past a person\'s reduced-motion setting: animate with CSS @keyframes, which is held to it.",bi={animate:cr,animateTransform:cr,animateMotion:cr,set:cr,feImage:" It loads an image: a filter here is made of the view\'s own pixels.","@property":" It registers a property for the whole page, the app\'s own --graview-* among them: animate a transform, an opacity or a color in @keyframes.","a href":" An <a> in SVG goes to a record or a place (data-record, data-place); a link out is an HTML <a href>.",role:` A role of the app\'s chrome or notices is the app\'s; role="region" is drawn while it has a name (aria-label).`};function cl(t,e={}){let n="element"in t&&t.element?`<${t.element}>`:"",r=t.name?` ${t.name}`:"",o=s=>s&&Object.prototype.hasOwnProperty.call(bi,s)?bi[s]:"";switch(t.reason){case"element":return{at:`drawing ${n}`,says:`Not drawn: ${n} is not in the open kit.${o("element"in t?t.element:void 0)}`};case"attribute":return{at:`drawing ${n}${r}`,says:`Not drawn: ${n||"an element"} does not take${r}.${o(`${"element"in t?t.element:""}${r}`)}`};case"value":return{at:`drawing ${n}${r}`,says:`Not drawn: the value of${r} is not one the open kit takes.${o(t.name)}`};case"url":return"element"in t&&t.element==="a"&&t.address!==void 0?{at:`drawing ${n}${r}`,says:`Not drawn: ${_s(t.address,e.linkOrigins)}`}:{at:`drawing ${n}${r}`,says:t.address!==void 0&&"element"in t&&t.element==="img"?`Not drawn: ${ei(t.address,e,"length"in t?t.length:void 0)}`:"Not drawn: an address. A view loads nothing; an image is a data: image."};case"child":return{at:`drawing ${n}`,says:`Not drawn: ${n} holds nothing.`};case"record":return{at:"drawing",says:"Not drawn: a record the drawing\'s format does not know."};case"budget":return{at:"drawing",says:"Not drawn: more nodes than a view may draw."};case"reference":{let s="ids"in t&&t.ids?t.ids:[],i=s.length>0?s.map(a=>`"${a}"`).join(", "):"no id";return{at:`drawing ${n}${r}`,says:`Not drawn: ${n||"an element"}${r} names ${i}, ${s.length===1?"which is":"which are"} no element of this view. It names elements the view draws itself, by their id (<h2 id="\\u2026">), drawn once each is there.`}}case"css":return{at:`stylesheet${r===" stylesheet"?"":r}`,says:`Not drawn: CSS the open kit leaves out${t.css?` (${t.css.reason}${t.css.name?` ${t.css.name}`:""})`:""}.${o(t.css?.name)}`}}}function Ei(t,e,n={}){let{limits:r}=e;if(t.messages>r.messages)return{ok:!1,reason:"flood",detail:`It sent ${t.messages} messages, more than the ${r.messages} a view may send in a second.`};let o=new Set(e.acts);for(let g of t.asked)if(!o.has(g.name))return{ok:!1,reason:"act",detail:`It asks for the act "${g.name}", which its manifest does not name.`};let s=Os(e.props),i=yi(t.renders,t.sheets,{maxNodes:r.maxNodes,...e.origin?{origin:e.origin}:{},...e.imageOrigins?{imageOrigins:e.imageOrigins}:{},...e.assets?{asset:g=>g}:{},...n.theme?{theme:n.theme}:{},link:g=>Rs(g,{handed:s,...e.linkOrigins?{origins:e.linkOrigins}:{}})});if(i.over)return{ok:!1,reason:"nodes",detail:`It drew more than the ${r.maxNodes.toLocaleString("en-US")} things a view may draw.`};let a=[...e.places,...(e.lists??[]).filter(g=>!e.places.some(w=>w.as===g)).map(g=>({as:g}))],l=e.placesUnsure===!0,c=ai(i.root,{props:e.props,places:a,...l?{placesUnsure:!0}:{},...e.accepts?{accepts:e.accepts}:{}});for(let g of c.acts)if(!o.has(g))return{ok:!1,reason:"act",detail:`It binds a press to the act "${g}" (data-act), which its manifest does not name.`};let h=[...i.refused.map(g=>cl(g,{...e.imageOrigins?{origins:e.imageOrigins}:{},assets:e.assets===!0,...e.linkOrigins?{linkOrigins:e.linkOrigins}:{}})),...c.problems];for(let g of t.went)"record"in g&&!(e.props.node?.id===g.record||(e.props.nodes??[]).some(w=>w.id===g.record)||Ft(a,g.record))&&h.push({at:"navigate",says:l?`It goes to ${Bt(g.record)}, which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${xe(a)}${Et}`:`It goes to ${Bt(g.record)}, which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${xe(a)}`}),"place"in g&&!Ft(a,g.place)&&h.push({at:"navigate",says:l?`It goes to the place ${Bt(g.place)}, which is none of the places this run was told of.${xe(a)}${Et}`:`It goes to the place ${Bt(g.place)}, which this app does not have.${xe(a)}`});return{ok:!0,parts:c.parts,problems:h,drawn:i,videos:c.videos}}var ao="graviewHeadless",lo="graviewHeadlessView";var Ti=globalThis,dl=Promise.prototype.then,ul=Promise.resolve(),Jt=t=>void dl.call(ul,t),dr=Ti.performance,Qt=dr&&typeof dr.now=="function"?dr.now.bind(dr):Date.now,Je=JSON.stringify,xi=JSON.parse,fl=Object.defineProperty,ur=t=>(t instanceof Error?`${t.name}: ${t.message}`:String(t)).slice(0,500),xt=t=>{try{return xi(Je(t??null))}catch{return null}},V={renders:[],asked:[],went:[],ms:0,logs:[],messages:0},Se,en=(t,e)=>{Se??={reason:t,detail:e}},Qe=t=>{V.logs.length<50&&V.logs.push(t.slice(0,500))},St={removed:[],stuck:[],sealed:!1},co=new Map,et=xs({send(t){if(V.messages+=1,t.type==="mine"){let e=t.id,n=t.op==="set"?Qo(t.key,t.value):void 0;n?Qe(n):t.op==="set"&&t.value===null?co.delete(t.key):t.op==="set"&&co.set(t.key,t.value),Jt(()=>et.hear(n?{type:"mine-answer",id:e,ok:!1,sentence:n}:{type:"mine-answer",id:e,ok:!0,...t.op==="get"?{value:co.get(t.key)??null}:{}}))}else t.type==="render"?V.renders.push(xt(t.records)):t.type==="style"?V.sheets=(xt(t.sheets)??[]).map(String):t.type==="gestures"?V.gestures=xt(t.bound):t.type==="navigate"&&"place"in t?V.went.push({place:String(t.place),...t.where!==void 0?{where:xt(t.where)}:{},...t.section!==void 0?{section:String(t.section)}:{}}):t.type==="navigate"&&"to"in t&&V.went.push({record:String(t.to),...t.where!==void 0?{where:xt(t.where)}:{},...t.section!==void 0?{section:String(t.section)}:{}})},act(t,e){return V.messages+=1,V.asked.push({name:String(t),args:xt(e)}),Promise.resolve({type:"answer",id:V.asked.length,ok:!1,reason:"refused",message:"Nothing is applied in a headless run."})},navigate(t){V.messages+=1,V.went.push({record:String(t)})},microtask:Jt,now:Qt,threw:t=>en("error",`It threw: ${ur(t)}`),warn:Qe,hardening:()=>St}),wi=!1,uo=!1;function pl(t){if(uo||typeof t!="function"||(uo=!0,Se))return;let e=Qt();try{t.call(void 0,et.view)}catch(n){en("error",`It threw: ${ur(n)}`)}V.ms+=Qt()-e}async function ml(t){if(wi)return Je({ok:!1,reason:"refused",detail:"A headless script runs one view, once: something called its entry before the host did."});wi=!0;let e;try{e=xi(String(t))}catch{return Je({ok:!1,reason:"isolate",detail:"The run was not handed its input as JSON."})}if(!uo&&!Se)return Je({ok:!1,reason:"isolate",detail:"The script held no view."});let n=Qt();Se||et.hear({type:"props",props:e.props,push:1}),V.ms+=Qt()-n,V.ms>=e.limits.pushMs&&en("slow",`It took longer than ${e.limits.pushMs.toLocaleString("en-US")} ms to draw what it was shown.`);for(let o=0;o<64&&!Se;o+=1)await new Promise(s=>Jt(s));if(Se||(V.clicks=et.listened("click").slice(0,2e3)),e.press&&typeof e.press.selector=="string"&&!Se){let o=typeof e.press.target=="string"?e.press.target:et.find(e.press.selector);if(V.pressed={selector:e.press.selector.slice(0,200),...o!==void 0?{target:o}:{},asked:V.asked.length,went:V.went.length,renders:V.renders.length},o!==void 0){try{et.hear({type:"dom-event",target:o,event:"click"})}catch(s){en("error",`It threw: ${ur(s)}`)}for(let s=0;s<64&&!Se;s+=1)await new Promise(i=>Jt(i))}}if(Se)return Je({ok:!1,...Se,transcript:V});let r=Ei(V,e);return r.ok?Je({ok:!0,transcript:V,drawn:{parts:r.parts,problems:r.problems},hardening:{removed:St.removed.length,sealed:St.sealed}}):Je({ok:!1,reason:r.reason,detail:r.detail,transcript:V})}var hl=Object.freeze({log:(...t)=>Qe(t.map(String).join(" ")),info:(...t)=>Qe(t.map(String).join(" ")),debug:(...t)=>Qe(t.map(String).join(" ")),warn:(...t)=>Qe(t.map(String).join(" ")),error:(...t)=>Qe(t.map(ur).join(" "))}),gl=0,Ni=()=>gl+=1,yl=[["console",hl],["setTimeout",Ni],["setInterval",Ni],["clearTimeout",()=>{}],["clearInterval",()=>{}],["queueMicrotask",Jt],["graview",et.view],[lo,pl],[ao,t=>ml(t)]];for(let[t,e]of yl)fl(Ti,t,{value:e,writable:!0,enumerable:!1,configurable:!0});St=as(globalThis,["graview",lo,ao],{primitivesStay:!0});St.stuck.length>0&&en("refused",`This isolate could not be hardened: ${St.stuck.join(", ")} would not go.`);})();\n';function tr(e){return`${Tt}
|
|
15
|
+
`;function bt(){return e=>new Promise((t,r)=>{let s=URL.createObjectURL(new Blob([Gt(e.entry),e.script],{type:"text/javascript"})),a;try{a=new Worker(s)}catch(d){URL.revokeObjectURL(s),r(Object.assign(new Error(d instanceof Error?d.message:"The isolate could not start."),{reason:"isolate"}));return}let i=!1,p=d=>{i||(i=!0,clearTimeout(l),a.terminate(),URL.revokeObjectURL(s),d())},l=setTimeout(()=>p(()=>r(Object.assign(new Error("It ran past its deadline."),{reason:"slow"}))),e.timeoutMs+500);a.onmessage=d=>{let f=d.data;f.ok&&typeof f.text=="string"?p(()=>t(f.text)):p(()=>r(Object.assign(new Error(f.error??"The isolate could not run it."),{reason:"isolate"})))},a.onerror=d=>p(()=>r(Object.assign(new Error(d.message||"The isolate could not run it."),{reason:"isolate"}))),a.postMessage(e.input)})}var qt=new Set(["video/mp4","video/webm","video/ogg"]);function Jt(e,t){let r=e.poster===!0||typeof e.poster=="string"&&e.poster.length>0,s=qt.has(e.type.toLowerCase()),a=!s&&!r?`its source is ${e.type}, which not every browser plays, and it has no poster`:s?r?void 0:"it has no poster, so nothing stands before it plays or where a person asked for less motion":`its source is ${e.type}, which not every browser plays`;return{record:t.record,field:t.field,text:typeof e.caption=="string"&&e.caption.trim()?e.caption.trim():e.name,name:e.name,source:e.type,...typeof e.duration=="number"?{duration:e.duration}:{},poster:r,autoplay:t.autoplay,cover:t.cover,playable:s&&r,...a?{why:a}:{}}}var Ie={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},wt=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr","label"]),vt=new Set(["style","template","datalist","option"]),C=e=>e.replace(/\s+/g," ").trim();function Yt(e){let t=e.duration===void 0?0:Math.round(e.duration);if(t<1)return"a video";if(t<60)return`a ${t}-second video`;let r=Math.round(t/60);return r<60?`a ${r}-minute video`:`a ${Math.floor(r/60)}-hour${r%60>0?` ${r%60}-minute`:""} video`}var z=e=>e instanceof U,pe=e=>e.hasAttribute("hidden")||e.getAttribute("aria-hidden")==="true";function M(e){return e instanceof ee?e.data:!z(e)||pe(e)||vt.has(e.localName)?"":e.localName==="br"?" ":e.localName==="img"?e.getAttribute("alt")??"":e.childNodes.map(M).join(e.localName==="td"||e.localName==="th"?" ":"")}var Zt=/(\s+[·•|—–-]\s+)/;function Kt(e,t){if(!t||!e.includes(t))return e;let r=i=>i.length>0&&i.split(" ").length<=3,s=C(e).split(Zt),a=[];for(let i=0;i<s.length;i+=2){let p=s[i],l=p.startsWith(`${t} `)?p.slice(t.length+1):void 0,d=p.endsWith(` ${t}`)?p.slice(0,-t.length-1):void 0,f=p===t?"":l!==void 0&&r(l)?l:d!==void 0&&r(d)?d:p;f&&a.push(...a.length>0?[s[i-1]]:[],f)}return a.join("")}function kt(e,t,r){let s=[];for(let a of e){if(a.t==="list"&&a.groups.every(i=>i.items.every(p=>p.id===t&&p.title===r))){s.push(...kt(a.groups.flatMap(i=>i.items.flatMap(p=>p.parts)),t,r));continue}if(a.t==="text"){let i=Kt(a.text,r);i&&s.push(i===a.text?a:{...a,text:i});continue}s.push(a)}return s}function*re(e){for(let t of e.childNodes)z(t)&&(yield t,yield*re(t))}function Xt(e){let t=e.getAttribute("data-save"),r=e.getAttribute("data-debounce");if(t===null&&r===null)return[];let s=`drawing <${e.localName}${t!==null?` data-save="${t}"`:` data-debounce="${r}"`}>`,a=[];if(t===null)return[{at:s,says:'data-debounce is read only on a field that saves as it is typed (data-save="input").'}];if(!["input","textarea","select"].includes(e.localName))a.push({at:s,says:"Only a field saves as it is typed: an input, a textarea or a select. A button is pressed (data-act alone)."});else if(t!=="input"&&t!=="change")a.push({at:s,says:`data-save is "input" (saved as the person types, once they pause, and when they leave it) or "change" (saved when they leave it or pick), not "${t}".`});else if(e.getAttribute("data-act")===null)a.push({at:s,says:'It saves through no act: a field saved as it is typed names its act itself, data-act="\u2026", one in the manifest.'});else if(!e.getAttribute("name"))a.push({at:s,says:"It has no name: the host sends a field as the act's argument its name says."});else{let i=!1,p=!1;for(let l=e;l;l=l.parentElement)l.getAttribute("data-record")!==null&&(p=!0),l!==e&&(l.localName==="fieldset"||l.getAttribute("role")==="group")&&(i=!0);(!i||!p)&&a.push({at:s,says:'It is in no fieldset bound to a record: the host saves a field inside <fieldset data-record="\u2026">, with the fields beside it, to the record the fieldset names.'})}return r!==null&&t!=="input"?a.push({at:s,says:'data-debounce is read only with data-save="input": a "change" saves at once.'}):r!==null&&!(r.trim()!==""&&Number.isFinite(Number(r))&&Number(r)>=250&&Number(r)<=1e4)&&a.push({at:s,says:`data-debounce is how long the host waits for the person to pause, in milliseconds from 250 to 10 000, not "${r}"; left out, it waits 1 000.`}),a}function Qt(e,t,r){let s=e.getAttribute("data-drop");if(s===null)return[];let a=`drawing <${e.localName} data-drop="${s}">`,i=[],p=(t.accepts??[]).filter(f=>f.kind===s),l=e.getAttribute("data-drop-field");p.length===0?i.push({at:a,says:`The view's accepts names no field of "${s}", so the host offers no drop target here: say the field files go in, accepts: [{ "kind": "${s}", "field": "<its image, video or file field>" }].`}):l!==null&&!p.some(f=>f.field===l)&&i.push({at:a,says:`data-drop-field names "${l}", which the view's accepts does not name for "${s}" (${p.map(f=>`"${f.field}"`).join(", ")}): the host offers no drop target here.`});let d=e.getAttribute("data-drop-connect");if(d!==null){let f=d.indexOf(":"),b=f>0?d.slice(f+1):"";f<=0||b===""||r.has(d)?i.push({at:a,says:`data-drop-connect is "<relation>:<record id>" \u2014 "takenOn:day:saturday" \u2014 not "${d}"${r.has(d)?", which names a record and no relation":""}.`}):r.has(b)||i.push({at:a,says:`data-drop-connect names "${b}", which this seat was not shown: the host offers no drop target here.`})}return i}function Nt(e,t){let r=[],s=new Set,a=new Set,i=[],p=new Map;for(let m of[...t.props.node?[t.props.node]:[],...t.props.nodes??[]])p.set(m.id,m);let l=m=>W(t.places,m)!==void 0;for(let m of re(e)){let y=m.getAttribute("data-act");y!==null&&s.add(y);let N=y!==null&&m.getAttribute("data-debounce")===null?se(m):void 0;N&&r.push({at:`drawing <${m.localName} data-act="${y}">`,says:N});let k=m.getAttribute("data-record");k!==null&&(a.add(k),!p.has(k)&&!l(k)&&r.push({at:`drawing <${m.localName} data-record="${k}">`,says:t.placesUnsure?`It names "${k}", which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${q(t.places)}${J}`:`It names "${k}", which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${q(t.places)}`}));let $=m.getAttribute("data-place");$!==null&&!l($)&&r.push({at:`drawing <${m.localName} data-place="${$}">`,says:t.placesUnsure?`It names the place "${$}", which is none of the places this run was told of.${q(t.places)}${J}`:`It names the place "${$}", which this app does not have.${q(t.places)}`}),r.push(...Xt(m)),r.push(...Qt(m,t,p))}let d=m=>{if(m.localName==="graview-video")return;let y=m.getAttribute("data-record");if(y!==null)return y;let N=m.getAttribute("data-key")??m.getAttribute("id");if(N!==null&&p.has(N))return N;let k=new Set;for(let $ of re(m)){let u=$.getAttribute("data-record");u!==null&&$.localName!=="graview-video"&&k.add(u)}return k.size===1?[...k][0]:void 0},f=(m,y)=>{let N=p.get(y),k=N?.kind??(y.includes(":")?y.slice(0,y.indexOf(":")):""),$=[...re(m)],u=$.find(n=>n.localName in Ie)??$.find(n=>n.localName==="a"&&n.getAttribute("data-record")===y)??$.find(n=>n.localName==="strong"||n.localName==="b"),h=C(u?M(u):"")||N?.label||y;return{id:y,kind:k,title:h,parts:kt(o(m,u),y,h)}},b=m=>{let y=[...re(m)].filter(u=>u.localName==="tr"&&!pe(u)),N=y.find(u=>u.parentElement?.localName==="thead"||u.childNodes.every(h=>!z(h)||h.localName==="th")),k=N?N.childNodes.filter(z).map(u=>C(M(u))):[];return{t:"list",as:"row",columns:1,groups:[{items:y.filter(u=>u!==N).map(u=>{let h=u.childNodes.filter(z),n=d(u),c=n?p.get(n):void 0;return{id:n??"",kind:c?.kind??"",title:C(M(h[0]??u)),parts:h.slice(1).map((g,w)=>({t:"field",label:k[w+1]??"",text:C(M(g))}))}})}]}};function o(m,y){let N=[],k="",$=()=>{let h=C(k);k="",h&&N.push({t:"text",text:h})},u=m.childNodes;for(let h=0;h<u.length;h+=1){let n=u[h];if(n===y)continue;if(n instanceof ee){k+=n.data;continue}if(!z(n)||pe(n)||vt.has(n.localName))continue;if(y&&[...re(n)].includes(y)){$(),N.push(...o(n,y));continue}let c=[];for(let g=h;g<u.length;g+=1){let w=u[g];if(w instanceof ee&&C(w.data)==="")continue;if(!z(w)||pe(w)||wt.has(w.localName)||w.localName in Ie)break;let O=d(w);if(!O)break;c.push({element:w,id:O}),h=g}if(c.length>0){$();let g=c.every(w=>w.element.localName==="li"||w.element.localName==="tr");N.push({t:"list",as:g?"row":"card",columns:1,groups:[{items:c.map(w=>f(w.element,w.id))}]});continue}N.push(...A(n,g=>k+=g,$))}return $(),N}function A(m,y,N){let k=m.localName;if(wt.has(k)&&k!=="label")return y(M(m)),[];if(k==="mark"){N();let u=C(M(m));return u?[{t:"badge",text:u}]:[]}N();let $=Ie[k]??(m.getAttribute("role")==="heading"?Number(m.getAttribute("aria-level")??2):void 0);if($!==void 0){let u=C(M(m));return u?[{t:"heading",level:$,text:u}]:[]}switch(k){case"ul":case"ol":case"menu":return[{t:"list",as:"row",columns:1,groups:[{items:m.childNodes.filter(h=>z(h)&&h.localName==="li"&&!pe(h)).map(h=>{let n=d(h);if(n)return f(h,n);let c=o(h),g=c[0],w=g&&(g.t==="text"||g.t==="heading")?g.text:"";return{id:"",kind:"",title:w,parts:w?c.slice(1):c}})}]}];case"table":return[b(m)];case"dl":{let u=[],h="";for(let n of m.childNodes.filter(z))if(n.localName==="dt")h=C(M(n));else if(n.localName==="dd")u.push({t:"field",label:h,text:C(M(n))});else if(n.localName==="div")for(let c of n.childNodes.filter(z))c.localName==="dt"?h=C(M(c)):c.localName==="dd"&&u.push({t:"field",label:h,text:C(M(c))});return u}case"figure":{let u=m.childNodes.find(c=>z(c)&&c.localName==="figcaption"),h=C(m.childNodes.filter(c=>c!==u).map(M).join(" ")),n=u?C(M(u)):"";return h?[{t:"figure",text:h,...n?{label:n}:{}}]:n?[{t:"text",text:n}]:[]}case"meter":case"progress":{let u=Number(m.getAttribute("value")??0),h=Number(m.getAttribute("max")??1)||1;return[{t:"progress",label:m.getAttribute("aria-label")??m.getAttribute("title")??"",text:`${Math.round(u/h*100)}%`}]}case"svg":{let u=m.childNodes.find(c=>z(c)&&c.localName==="title"),h=C(m.getAttribute("aria-label")??(u?M(u):""));if(h)return[{t:"text",text:h,tone:"picture"}];let n=[...re(m)].filter(c=>c.localName==="text").map(c=>C(M(c))).filter(Boolean);return n.length>0?[{t:"text",text:n.join(" \xB7 "),tone:"picture"}]:[]}case"img":{let u=C(m.getAttribute("alt")??"");return u?[{t:"text",text:u,tone:"picture"}]:[]}case"graview-video":{let u=m.getAttribute("data-field")??"",h=m.getAttribute("data-record")??"",n=p.get(h),c=n&&u&&Object.hasOwn(n,u)?n[u]:void 0,g=(Array.isArray(c)?c:[c])[Number(m.getAttribute("data-index")??"0")];if(!g||typeof g.name!="string"||typeof g.type!="string"||!g.type.startsWith("video/"))return r.push({at:`drawing <graview-video data-field="${u}">`,says:"It names no video on a record this seat was shown: the host draws no player there. A <graview-video> names a record the view was shown (data-record) and its video field (data-field)."}),[];let w=Jt(g,{record:h,field:u,autoplay:m.getAttribute("autoplay")!==null,cover:m.getAttribute("cover")!==null});i.push(w);let O=w.autoplay?`, playing as a background, muted and looping${w.cover?", filling its box":""}`:"";return[{t:"text",text:`${w.text}, ${Yt(w.duration!==void 0?{duration:w.duration}:{})}${O}`,tone:"picture"}]}case"button":{let u=C(M(m));return u?[{t:"text",text:u,tone:"button"}]:[]}case"input":case"textarea":case"select":{let u=C(m.getAttribute("aria-label")??m.getAttribute("placeholder")??m.getAttribute("name")??""),h=k==="select"?C(M(m.childNodes.find(n=>z(n)&&n.localName==="option"&&n.selected)??m)):m.value;return[{t:"field",label:u,text:h}]}case"label":return o(m);default:return o(m)}}return{parts:o(e),problems:r,acts:[...s],records:[...a],videos:i}}var Ne=" SMIL can set an attribute after the host judged it, and runs past a person's reduced-motion setting: animate with CSS @keyframes, which is held to it.",xt={animate:Ne,animateTransform:Ne,animateMotion:Ne,set:Ne,feImage:" It loads an image: a filter here is made of the view's own pixels.","@property":" It registers a property for the whole page, the app's own --graview-* among them: animate a transform, an opacity or a color in @keyframes.","a href":" An <a> in SVG goes to a record or a place (data-record, data-place); a link out is an HTML <a href>.",role:` A role of the app's chrome or notices is the app's; role="region" is drawn while it has a name (aria-label).`};function er(e,t={}){let r="element"in e&&e.element?`<${e.element}>`:"",s=e.name?` ${e.name}`:"",a=i=>i&&Object.prototype.hasOwnProperty.call(xt,i)?xt[i]:"";switch(e.reason){case"element":return{at:`drawing ${r}`,says:`Not drawn: ${r} is not in the open kit.${a("element"in e?e.element:void 0)}`};case"attribute":return{at:`drawing ${r}${s}`,says:`Not drawn: ${r||"an element"} does not take${s}.${a(`${"element"in e?e.element:""}${s}`)}`};case"value":return{at:`drawing ${r}${s}`,says:`Not drawn: the value of${s} is not one the open kit takes.${a(e.name)}`};case"url":return"element"in e&&e.element==="a"&&e.address!==void 0?{at:`drawing ${r}${s}`,says:`Not drawn: ${nt(e.address,t.linkOrigins)}`}:{at:`drawing ${r}${s}`,says:e.address!==void 0&&"element"in e&&e.element==="img"?`Not drawn: ${We(e.address,t,"length"in e?e.length:void 0)}`:"Not drawn: an address. A view loads nothing; an image is a data: image."};case"child":return{at:`drawing ${r}`,says:`Not drawn: ${r} holds nothing.`};case"record":return{at:"drawing",says:"Not drawn: a record the drawing's format does not know."};case"budget":return{at:"drawing",says:"Not drawn: more nodes than a view may draw."};case"reference":{let i="ids"in e&&e.ids?e.ids:[],p=i.length>0?i.map(l=>`"${l}"`).join(", "):"no id";return{at:`drawing ${r}${s}`,says:`Not drawn: ${r||"an element"}${s} names ${p}, ${i.length===1?"which is":"which are"} no element of this view. It names elements the view draws itself, by their id (<h2 id="\u2026">), drawn once each is there.`}}case"css":return{at:`stylesheet${s===" stylesheet"?"":s}`,says:`Not drawn: CSS the open kit leaves out${e.css?` (${e.css.reason}${e.css.name?` ${e.css.name}`:""})`:""}.${a(e.css?.name)}`}}}function St(e,t,r={}){let{limits:s}=t;if(e.messages>s.messages)return{ok:!1,reason:"flood",detail:`It sent ${e.messages} messages, more than the ${s.messages} a view may send in a second.`};let a=new Set(t.acts);for(let o of e.asked)if(!a.has(o.name))return{ok:!1,reason:"act",detail:`It asks for the act "${o.name}", which its manifest does not name.`};let i=tt(t.props),p=we(e.renders,e.sheets,{maxNodes:s.maxNodes,...t.origin?{origin:t.origin}:{},...t.imageOrigins?{imageOrigins:t.imageOrigins}:{},...t.assets?{asset:o=>o}:{},...r.theme?{theme:r.theme}:{},link:o=>rt(o,{handed:i,...t.linkOrigins?{origins:t.linkOrigins}:{}})});if(p.over)return{ok:!1,reason:"nodes",detail:`It drew more than the ${s.maxNodes.toLocaleString("en-US")} things a view may draw.`};let l=[...t.places,...(t.lists??[]).filter(o=>!t.places.some(A=>A.as===o)).map(o=>({as:o}))],d=t.placesUnsure===!0,f=Nt(p.root,{props:t.props,places:l,...d?{placesUnsure:!0}:{},...t.accepts?{accepts:t.accepts}:{}});for(let o of f.acts)if(!a.has(o))return{ok:!1,reason:"act",detail:`It binds a press to the act "${o}" (data-act), which its manifest does not name.`};let b=[...p.refused.map(o=>er(o,{...t.imageOrigins?{origins:t.imageOrigins}:{},assets:t.assets===!0,...t.linkOrigins?{linkOrigins:t.linkOrigins}:{}})),...f.problems];for(let o of e.went)"record"in o&&!(t.props.node?.id===o.record||(t.props.nodes??[]).some(A=>A.id===o.record)||W(l,o.record))&&b.push({at:"navigate",says:d?`It goes to ${le(o.record)}, which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${q(l)}${J}`:`It goes to ${le(o.record)}, which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${q(l)}`}),"place"in o&&!W(l,o.place)&&b.push({at:"navigate",says:d?`It goes to the place ${le(o.place)}, which is none of the places this run was told of.${q(l)}${J}`:`It goes to the place ${le(o.place)}, which this app does not have.${q(l)}`});return{ok:!0,parts:f.parts,problems:b,drawn:p,videos:f.videos}}var At="graviewHeadless",$t="graviewHeadlessView";var Tt='"use strict";\n/*! @remote-dom/core and @remote-dom/polyfill \u2014 Copyright 2020-present, Shopify Inc. \u2014 MIT License.\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * @graview/guest\'s worker runtime \u2014 Elastic License 2.0. */\n"use strict";(()=>{var M=Symbol("name"),Ce=Symbol("prefix"),Ie=Symbol("value"),L=Symbol("ns"),se=Symbol("owner"),B=Symbol("owner_document"),we=Symbol("attributes"),Y=Symbol("prev"),A=Symbol("next"),U=Symbol("child"),ie=Symbol("parent"),De=Symbol("host"),fe=Symbol("data"),ze=Symbol("listeners"),pr=Symbol("isTrusted"),tt=Symbol("path"),nt=Symbol("stop_immediate_propagation"),rt=Symbol("dispatching"),ve=Symbol("content"),W=Symbol("hooks"),tn=Symbol("extensions"),Fe=Symbol("hooks_dispatch"),Q=Symbol("is_connected"),ot=Symbol("create_element"),go=0,le=1,st=2,it=3,at=8,Ve=9,ho=10,Me=11,G="http://www.w3.org/1999/xhtml",pe="http://www.w3.org/2000/svg",yo="http://www.w3.org/XML/1998/namespace",kt="http://www.w3.org/2000/xmlns/";function nn(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function K(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function bo(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function z(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var Eo=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,wo=/[\\0\\t\\n\\f\\r />=]/u,Si=/[\\0\\t\\n\\f\\r />]/u;function ke(t){if(t==null)return null;let e=String(t);return e===""?null:e}function No(t){Eo.test(t)||gr(t)}function mr(t){(t===""||wo.test(t))&&gr(t)}function rn(t,e,n){let r=ke(t),o=String(e),s=o.indexOf(":"),i=s<0?null:o.slice(0,s),a=s<0?o:o.slice(s+1);if((i!=null&&(i===""||Si.test(i))||(n==="element"?!Eo.test(a):a===""||wo.test(a)))&&gr(o),i!=null&&r==null)throw z(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(i==="xml"&&r!==yo)throw z("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||i==="xmlns")&&r!==kt)throw z("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===kt&&o!=="xmlns"&&i!=="xmlns")throw z("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:i,localName:a}}function gr(t){throw z(`Invalid name: "${t}"`,"InvalidCharacterError")}var on=0,sn=1,To=2,hr=3,vi=typeof performance>"u"?Date.now:performance.now.bind(performance),ee=class{static NONE=on;static CAPTURING_PHASE=sn;static AT_TARGET=To;static BUBBLING_PHASE=hr;timeStamp=vi();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=on;[tt]=[];[nt]=!1;[rt]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,pr,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[pr]}composedPath(){return[...this[tt]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[nt]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function yr(t,e,n){if(t.cancelBubble)return;let o=e[ze]?.get(t.type)?.[n===sn?"capture":"bubble"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?To:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i=="object"?i.handleEvent(t):i.call(e,t)}catch(a){setTimeout(ki,0,a)}if(t[nt])break}}function ki(t){throw t}var Ot=[],an=new WeakMap;function ln(t,e){let n=an.get(t);n?n.push(e):an.set(t,[e]),Ot[Ot.length-1].push(t)}function te(t){let e=[];Ot.push(e);let n;try{n=t()}catch(r){Ot.pop();try{xo(e)}catch{}throw r}return Ot.pop(),xo(e),n}function xo(t){let e,n=!1;for(let r of t){let o=an.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}an.delete(r)}}if(n)throw e}var cn=[],At=[],br=!1;function Be(t){for(let e of t)cn.push(e),e[1]&&At.push(e[1]);if(!br){br=!0;try{let e,n=!1;for(let r=0;r<cn.length;r++){let[o,s]=cn[r];s&&At.splice(At.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{cn.length=0,At.length=0,br=!1}}}function Rt(t){let e=t;for(;e;){if(At.includes(e))return!0;e=e[ie]??e[De]}return!1}var _t=Symbol("listenerRegistrations"),Le=class{[ze]=void 0;[_t]=void 0;[B]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,s=typeof r=="object"&&r.once===!0,i=typeof r=="object"?r.signal:void 0;if(i?.aborted)return;let a=Er(o),l=this[_t];l||(l=new Map,this[_t]=l);let c=l.get(e);c||(c={},l.set(e,c));let g=c[a];if(g||(g=new Map,c[a]=g),g.has(n))return;let h=this,w={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(w.normalizedListener=function(...y){if(w.signal?.aborted){dn(h,w);return}return w.once&&dn(h,w),typeof w.listener=="object"?w.listener.handleEvent(...y):w.listener.call(this,...y)});let b=this[ze];b||(b=new Map,this[ze]=b);let f=b.get(e);f||(f={},b.set(e,f));let R=f[a];if(R||(R=new Set,f[a]=R),g.set(n,w),R.add(w),i){let u=()=>{dn(h,w)};w.abortListener=u,i.addEventListener("abort",u,{once:!0})}this[B]?.defaultView[Fe].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return Oi.call(this,e,n,r)}dispatchEvent(e){if(e[rt])throw z("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[rt]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[tt]=n;for(let s=n.length;s--;)if(yr(e,n[s],sn),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(yr(e,o[s],hr),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[rt]=!1,e.cancelBubble=!1,e[nt]=!1,e.eventPhase=on,e.currentTarget=null,e[tt]=[]}}};function Oi(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=Er(!!r),s=this[_t]?.get(t)?.[o]?.get(e);s&&dn(this,s)}function Er(t){return t?"capture":"bubble"}function dn(t,e){let n=Er(e.capture),r=t[_t],o=r?.get(e.type);if(!o)return;let s=o[n];if(!s||s.get(e.listener)!==e)return;s.delete(e.listener),s.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let i=t[ze],a=i?.get(e.type);if(!a)return;let l=a[n];l?.delete(e)&&(l.size===0&&delete a[n],!a.bubble&&!a.capture&&i?.delete(e.type),t[B]?.defaultView[Fe].removeEventListener?.(t,e.type,e.listener,e.capture))}var me=class extends Array{item(e){return this[e]??null}};var Ct=0,So=1,Tr=2,xr=3,It=4,vo=0,ko=1,pn=2,mn=3,Oo=4,Nr=5,Ao=6,Ro=7,un=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function Ai(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let s=t[o];if(r){s==="\\\\"?o++:s===r&&(r=null);continue}if(s===\'"\'||s==="\'")r=s;else if(s==="(")n++;else if(s===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function ae(t){throw z(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function gn(t,e){let n=typeof e=="string"?Dt(e):[{combinator:It,matchers:e}],r=null,o=t[U];return o&&n[0].matchers.length&&Sr(o,n,s=>(r=s,!1)),r}function hn(t,e){let n=typeof e=="string"?Dt(e):[{combinator:It,matchers:e}],r=new me,o=t[U];return o&&n[0].matchers.length&&Sr(o,n,s=>{r.push(s)}),r}function Dt(t,e=!1,n=!1){let r={combinator:It,matchers:[]},o=[r],s=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,i=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");i===""&&ae(t);let a=0,l;for(;l=s.exec(i);){l.index!==a&&ae(t),l[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&ae(t),l[1]===">"?r.combinator=So:l[1]==="+"?r.combinator=xr:l[1]==="~"?r.combinator=Tr:r.combinator=Ct,r={combinator:It,matchers:[]},o.push(r));let c=l[8]?K(l[8]):l[2]||l[7];l[7]!=null&&!l[6]&&r.matchers.length>0&&ae(t);let h,w=l[4]??l[5]??l[7];if(l[2]){un.test(c)||ae(t);let b=l[5],f=b?.[0];if(l[3]==null&&(f===\'"\'||f==="\'")){let R=l[0].lastIndexOf(b);w=i.slice(l.index+R+1),s.lastIndex=i.length}else b!=null&&!un.test(b)&&ae(t);h=Oo}else l[6]?(un.test(c)||ae(t),h=l[6]==="#"?pn:mn):l[8]?h=l[9]==null?Nr:Ao:l[7]==="*"?h=vo:l[7]&&un.test(l[7])?h=ko:ae(t);l[9]?([w,s.lastIndex]=Ai(i,s.lastIndex),c!=="has"&&c!=="not"&&ae(t),c==="has"&&e&&ae(t),Dt(w,e||c==="has",c==="has")):h===Nr&&ae(t),r.matchers.push({type:h,name:c,value:w}),a=s.lastIndex}return(a!==i.length||r.matchers.length===0)&&ae(t),o}function Ri(t,e){let n=Dt(e);return n[0]?.matchers.length?Pt(t,n):!1}function _i(t,e){let n=Dt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=Ct,s={type:Ro,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:Ct,matchers:[s]}),n.some(({matchers:l})=>l.length===0))return!1;let i=o===xr||o===Tr?t[A]:t[U];if(!i)return!1;let a=!1;return Sr(i,n,()=>(a=!0,!1),t),a}function Sr(t,e,n,r){let o=[],s=t;for(;s;){if(oe(s)){if(Pt(s,e,r)&&n(s)===!1)return!1;let i=s[U];if(i){let a=s[A];a&&o.push(a),s=i;continue}}s=s[A]??o.pop()??null}return!0}function Pt(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===It){if(!fn(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Pt(t,a,n)}let s=r===So||r===Ct?ie:Y,i=t[s];if(!i)return!1;if(r===Ct||r===Tr){for(;i;){if(oe(i)&&fn(i,o,n)){let a=e.slice(0,-1);if(a.length===0||Pt(i,a,n))return!0}i=i[s]}return!1}else{if(r===xr&&!oe(i)){for(;i&&!oe(i);)i=i[s];if(!i)return!1}if(!oe(i)||!fn(i,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Pt(i,a,n)}}function wr(t,e){return t.getAttributeNS(null,t.namespaceURI===G?K(e):e)}function fn(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(fn(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case vo:return o==="*";case ko:return t.namespaceURI===G?t.localName===K(o):t.localName===o;case pn:return wr(t,"id")===o;case mn:let i=wr(t,"class");return i?nn(i).includes(o):!1;case Oo:let a=wr(t,o);return s==null?a!=null:a===s;case Ro:return t===n;case Nr:ae(`:${o}`);case Ao:switch(o){case"has":return _i(t,s||"");case"not":return!Ri(t,s||"");default:ae(`:${o}(${s})`)}}return!1}function Pi(t){return t.nodeType===st}function Mt(t){return fe in t}function kr(t){return t.nodeType===it}function Ci(t){return t.nodeType===at}function oe(t){return t.nodeType===le}function vr(t){return t.nodeType===Me}function Io(t){return"appendChild"in t}function yn(t){let e=[],n=[t],r=new Set(n),o=new Set,s;for(;n.length>0;){let i=n.pop();if(r.delete(i),o.has(i))continue;let a=[];for(let l of $t(i)){if(o.has(l)||(o.add(l),e.push(l),a.push(l),!oe(l)))continue;let c=l[we];if(c)for(let h of c)o.has(h)||(o.add(h),e.push(h));let g=l[ve];g&&!o.has(g)&&!r.has(g)&&(r.add(g),n.push(g))}s??=a}return{nodes:e,treeNodes:s}}function Lt(t,e){for(let n of t)n[B]=e}function _o(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[B]=e,r}function Po(t,e){if(kr(t))return e.createTextNode(t.data);if(Ci(t))return e.createComment(t.data);if(Pi(t))return _o(t,e);if(oe(t)){let n=e[ot](t[M],t.namespaceURI,t[Ce],t.localName);if(t[we])for(let r=0;r<t[we].length;r++){let o=t[we].item(r);n.attributes.setNamedItem(_o(o,e))}return n}else{if(vr(t))return e.createDocumentFragment();{let n=new t.constructor;return n[B]=e,n}}}function bn(t,e,n=t.ownerDocument){if(t.nodeType===Ve)throw z("Cannot clone a document node","NotSupportedError");let r=Po(t,n);if(!e||!oe(t)&&!vr(t))return r;let o=new Set([t]),s=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;s.length>0;){let i=s[s.length-1],a,l;if(i.cloningContent)if(i.contentSource&&i.contentDestination)a=i.contentSource.childNodes[i.childIndex++],l=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(a=i.source.childNodes[i.childIndex++],l=i.destination,!a){if(i.cloningContent=!0,i.childIndex=0,oe(i.source)&&i.source.namespaceURI===G&&i.source.localName==="template"){let g=i.source[ve];g&&(o.has(g)&&Co(),o.add(g),i.contentSource=g,i.contentDestination=i.destination.content)}continue}if(!a){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(a)&&Co(),o.add(a);let c=Po(a,n);oe(a)||vr(a)?s.push({source:a,destination:c,appendTo:l,childIndex:0,cloningContent:!1}):l.appendChild(c)}return r}function Co(){throw new Error("Cannot clone a cyclic or repeated node graph")}function En(t,e){let n=String(e);return n===""?null:gn(t,[{type:pn,name:n}])}function wn(t,e){let n=[...new Set(nn(String(e)))];return hn(t,n.map(r=>({type:mn,name:r})))}function Nn(t,e){let n=String(e),r=K(n),o=[];for(let s of Tn(t))oe(s)&&(n==="*"||(s.namespaceURI===G?s[M]===r:s[M]===n))&&o.push(s);return o}function Tn(t){let e=[],n=[],r=t[U];for(;r;){e.push(r);let o=r[U],s=r[A];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function $t(t){let e=Tn(t);return e.unshift(t),e}var ge=class extends Le{nodeType=go;[M]="";[ie]=null;[De]=null;[U]=null;[Y]=null;[A]=null;[Q]=!1;get[W](){return this[B].defaultView[Fe]}get localName(){return this[M]}get nodeName(){return this[M]}get ownerDocument(){return this[B]}get isConnected(){return this[Q]}isDefaultNamespace(e){let n=ke(e);return Ii(this)===n}get parentNode(){return this[ie]}set parentNode(e){}get parentElement(){let e=this[ie];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[Y]}set previousSibling(e){}get nextSibling(){return this[A]}set nextSibling(e){}get previousElementSibling(){let e=this[Y];for(;e&&e.nodeType!==1;)e=e[Y];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[A];for(;e&&e.nodeType!==1;)e=e[A];return e}set nextElementSibling(e){}get firstChild(){return this[U]}set firstChild(e){}get lastChild(){let e=this[U];for(;e;){let n=e[A];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return Mt(this)?this.data:null}set nodeValue(e){Mt(this)&&(this.data=e)}get textContent(){if(Mt(this))return this.data;let e="";for(let n of Tn(this))kr(n)&&(e+=n.data);return e}set textContent(e){if(Mt(this))this.data=e;else if(Io(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return bn(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function Ii(t){let e=t;for(;e;)switch(e.nodeType){case le:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS(kt,"xmlns");if(r!=null&&r.prefix==null)return ke(r.value);e=n.parentElement;break}case Ve:e=e.documentElement;break;case ho:case Me:return null;case st:e=e.ownerElement;break;default:e=e.parentElement}return null}var he=Symbol("insertNode"),Rr=Symbol("preflightInsertions"),xn=Symbol("replaceNode"),$e=class extends ge{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Ye(e),r=this.parentNode;if(r)return Or(o=>{Oe(r,n);let s=this[A];for(;s&&n.includes(s);)s=s[A];let i=Ar(r,n,o);this.parentNode===r?r[xn](i,this,o):r[he](i,s,o)})}before(...e){let n=Ye(e),r=this.parentNode;if(r)return Or(o=>{Oe(r,n);let s=this[Y];for(;s&&n.includes(s);)s=s[Y];let i=Ar(r,n,o);r[he](i,s?s[A]:r.firstChild,o)})}after(...e){let n=Ye(e),r=this.parentNode;if(r)return Or(o=>{Oe(r,n);let s=this[A];for(;s&&n.includes(s);)s=s[A];let i=Ar(r,n,o);r[he](i,s,o)})}};function Or(t){return te(()=>{let e=[];try{t(e)}catch(n){try{Be(e)}catch{}throw n}Be(e)})}function Ye(t){return t.map(e=>e instanceof ge?e:String(e))}function Ht(t,e){return e instanceof ge?e:t.ownerDocument.createTextNode(String(e))}function Oe(t,e){for(let n of e){if(!(n instanceof ge))continue;let r=t;for(;r;){if(r===n)throw z("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[ie]??r[De]}}}function Ar(t,e,n){let r=[];for(let s of e)r.push(Ht(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[Rr](r);for(let s of r)o[he](s,null,n);return o}var Sn,_r=0,Do=0,Mo=0,Lo=0,lt=!1,Cr=!1,Ut=!1,vn=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=Di(n),o=Sn??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?_r++:Pr(i,-1),s.set(this,r),Pr(r,1),this.#e.add(e)}disconnect(){let e=Sn;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),_r--,Pr(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,_r===0&&(Sn=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function ye(t){let e=Sn;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[s,i]of o){if(r!==t.target&&!i.subtree)continue;let a=!1;if(t.type==="attributes"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??""))continue;a=i.attributeOldValue}else if(t.type==="characterData"){if(!i.characterData)continue;a=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||a)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new me,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:s?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new me,target:t.target,type:t.type})}function kn(...t){let e=new me;return e.push(...t),e}function Di(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError("attributeOldValue and attributeFilter require attributes to be enabled");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError("characterDataOldValue requires characterData to be enabled");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError("MutationObserver options must enable childList, attributes, or characterData");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function Pr(t,e){t.attributes&&(Do+=e),t.characterData&&(Mo+=e),t.childList&&(Lo+=e),lt=Do>0,Cr=Mo>0,Ut=Lo>0}var Ne=class extends $e{childNodes=new me;children=new me;appendChild(e){return te(()=>this[he](e,null))}insertBefore(e,n){return te(()=>this[he](e,n||null))}append(...e){return te(()=>{let n=Ye(e.filter(r=>r!=null));n.length>1&&Oe(this,n);for(let r of n)this[he](Ht(this,r),null)})}prepend(...e){return te(()=>{let n=Ye(e.filter(o=>o!=null));n.length>1&&Oe(this,n);let r=this.firstChild;for(let o of n)this[he](Ht(this,o),r)})}replaceChildren(...e){return te(()=>{let n=Ye(e.filter(o=>o!=null));Oe(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[he](Ht(this,o),null)})}removeChild(e){return te(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw z("The node is not a child of this node","NotFoundError");let n=this[Q]?$t(e):void 0,r=e[Y],o=e[A],s=On(this,e);if(n)for(let i of n)i[Q]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),Be(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return te(()=>this[xn](e,n))}[xn](e,n,r){if(Oe(this,[e]),n.parentNode!==this)throw z("The reference node is not a child of this parent","NotFoundError");let o=n[Y],s=n[A],i=this.prepareInsertion(e),a=this[Q]?$t(n):void 0,l=new Set(i.map(({node:w})=>w)),c=s;for(;c&&l.has(c);)c=c[A];let g=On(this,n);if(a){for(let b of a)b[Q]=!1;let w=new Set(a);for(let b of i)w.has(b.node)&&(b.shouldDisconnect=!1)}this.commitInsertion(i,c);let h=this[Q];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),a&&this.enqueueTreeReactions(a,"disconnectedCallback"),this.enqueueInsertionReactions(i,h),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,g),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return hn(this,e)}querySelector(e){return gn(this,e)}[he](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[Rr](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(Oe(this,[e]),n&&n.parentNode!==this)throw z("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[A]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[Q];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):Be(e)}prepareInsertion(e){let n=[];if(e.nodeType===Me){let i=e[U];for(;i;)n.push(i),i=i[A]}else n.push(e);let r=this[Q],o=this[B],s=[];for(let i of n){let a=i[Q],l=a||r,c,g;if(i[B]===o)l&&(c=$t(i));else{let h=yn(i);g=h.nodes,l&&(c=h.treeNodes)}s.push({node:i,nodes:c,adoption:g,shouldDisconnect:a})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[ie];if(i){let a=s.node[Y],l=s.node[A];s.source={parent:i,index:On(i,s.node),previousSibling:a,nextSibling:l}}}for(let s of e){let i=this.attachChild(s.node,n);s.insertIndex=i.index,s.previousSibling=i.previousSibling,s.nextSibling=i.nextSibling}let r=this[B];for(let{adoption:s}of e)s&&Lt(s,r);let o=this[Q];for(let{nodes:s}of e)if(s)for(let i of s)i[Q]=o}attachChild(e,n){if(n){let s=n[Y];e[A]=n,e[Y]=s,s?s[A]=e:this[U]=e,n[Y]=e}else{e[A]=null;let s=this[U];if(s){let i;for(;i=s[A];)s=i;s[A]=e,e[Y]=s}else this[U]=e,e[Y]=null}let r=oe(e);e[ie]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!oe(s);)s=s[A];s?this.children.splice(this.children.indexOf(s),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[Y],nextSibling:e[A]}}queueRemovalMutationRecord(e,n,r,o){Ut&&ye({type:"childList",target:e,removedNodes:kn(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(Ut)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),ye({type:"childList",target:this,addedNodes:kn(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==le||Rt(this)?[]:[[()=>this[W].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===le&&!Rt(s.parent)&&n.push([()=>s.parent[W].removeChild?.(s.parent,o,s.index)]),this.nodeType===le&&!Rt(this)&&n.push([()=>this[W].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){Ho(e,n)}};function $o(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[Q]?n.treeNodes:void 0,s=e[Y],i=e[A],a=On(t,e);if(o)for(let c of o)c[Q]=!1;Lt(n.nodes,r),Ut&&ye({type:"childList",target:t,removedNodes:kn(e),previousSibling:s,nextSibling:i}),o&&Ho(o,"disconnectedCallback");let l=[];t.nodeType===le&&!Rt(t)&&l.push([()=>t[W].removeChild?.(t,e,a)]),Be(l)}function On(t,e){let n=e[Y],r=e[A];n?n[A]=r:t[U]=r,r&&(r[Y]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),oe(e)&&t.children.splice(t.children.indexOf(e),1),e[ie]=null,e[A]=null,e[Y]=null,o}function Ho(t,e){for(let n of t){let r=n[e];typeof r=="function"&&ln(n,()=>r.call(n))}}function Gt(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||ln(t,()=>i.call(t,e,n,r,o))}var An=class{[U]=null;constructor(e){this[se]=e}getNamedItem(e){let n=String(e),r=this[se][L]===G?K(n):n,o=this[U];for(;o;){if(o.name===r)return o;o=o[A]}return null}getNamedItemNS(e,n){let r=ke(e),o=String(n),s=this[U];for(;s;){if(s.localName===o&&s[L]===r)return s;s=s[A]}return null}item(e){let n=this[U],r=0;for(;n;){if(r++===e)return n;n=n[A]}return null}get length(){let e=0,n=this[U];for(;n;)e++,n=n[A];return e}removeNamedItem(e){let n=String(e),r=this[se][L]===G?K(n):n;return te(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ke(e),o=String(n);return te(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[L]===r))}removeNamedItemImmediately(e){let n=this[se],r=this[U],o=null;for(;r!=null;){if(e(r)){o&&(o[A]=r[A]),this[U]===r&&(this[U]=r[A]);let s=r.value;return r[A]=null,r[se]=null,lt&&ye({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[L],oldValue:s}),n[W].removeAttribute?.(n,r.name,r[L]),Gt(n,r.localName,s,null,r[L]),r}o=r,r=r[A]}return null}setNamedItem(e){return te(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[se],r=e[se];if(r!=null&&r!==n)throw z("The attribute is already in use by another element.","InUseAttributeError");let o=null,s=this[U],i=null;for(;s;){if(s.localName===e.localName&&s[L]===e[L]){if(s===e)return s;i?i[A]=e:this[U]=e,e[A]=s[A],s[A]=null,o=s;break}i=s,s=s[A]}o==null&&(i?i[A]=e:this[U]=e),e[se]=n,e[B]=n[B],o&&(o[se]=null);let a=o==null||o.value!==e.value,l=o!=null&&o.name!==e.name;return a&<&&ye({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[L],oldValue:o?.value??null}),l&&n[W].removeAttribute?.(n,o.name,o[L]),(a||l)&&n[W].setAttribute?.(n,e.name,e.value,e[L]),a&&Gt(n,e.localName,o?.value??null,e.value,e[L]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[U];for(;e;)yield e,e=e[A]}};var We=class extends ge{nodeType=st;[L]=null;[A]=null;[se]=null;constructor(e,n,r){super(),this[M]=e,this[Ie]=n,r&&(this[L]=r)}get nodeName(){return this[M]}set nodeName(e){}get name(){return this[M]}set name(e){}get localName(){if(this[L]==null)return this[M];let e=this[M].indexOf(":");return e<0?this[M]:this[M].slice(e+1)}get prefix(){if(this[L]==null)return null;let e=this[M].indexOf(":");return e<0?null:this[M].slice(0,e)}get value(){return this[Ie]}set value(e){let n=String(e),r=this[se];if(!r){this[Ie]=n;return}te(()=>{let o=this[Ie];this[Ie]=n,lt&&o!==n&&ye({type:"attributes",target:r,attributeName:this[M],attributeNamespace:this[L],oldValue:o}),this[W].setAttribute?.(r,this[M],n,this[L]),Gt(r,this.localName,o,n,this[L])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[se]}get namespaceURI(){return this[L]}get specified(){return!0}};var Mi={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},Li=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),$i=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,jo=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,Hi="|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|",Ui=/^(?:color|face|size)$/i;function Uo(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return Mi[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function zo(t){return t.namespaceURI===G&&Li.has(t.localName)}function Go(t){let e=t.localName;return t[L]===pe&&(e==="foreignObject"||e==="desc"||e==="title")}function Gi(t,e){if(Hi.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(jo))if(Ui.test(n[1]))return!0;return!1}function Rn(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll($i)){let a=i[1];if(a){let l=i[2],c=K(a),g=o[o.length-1]?.element??e,h=g[L]===pe?pe:G;if(c==="svg")h=pe;else if(h===pe){if(Go(g))h=G;else if(Gi(c,l)){for(;o.length>0;){let f=o[o.length-1];if(f.element[L]!==pe||Go(f.element))break;o.pop(),s=f.target}h=G}}let w=h===G?c:a,b=n[ot](w,h,null,w);for(let f of l.matchAll(jo))b.setAttribute(f[1],Uo(f[3]||f[4]||""));if(s.append(b),zo(b)||h!==G&&i[4])continue;o.push({element:b,target:s}),s=h===G&&c==="template"?b.content:b}else if(i[5]){let l=K(i[5]);for(let c=o.length-1;c>=0;c--){let g=o[c],h=K(g.element[M]);if(h===l){s=g.target,o.length=c;break}if(g.element[L]===G&&h==="template")break}}else i[6]?s.append(n.createComment(i[6])):s.append(Uo(i[7]))}return r}function _n(t){return Vo([{type:"content",child:t[U]}])}function Fo(t){return Vo([{type:"opening",node:t}])}function Vo(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case le:{let o=r;e.push(`<${o[M]}`);let s=o[we]?.[U];for(;s;){e.push(` ${s[M]}`);let a=s[Ie];a!==""&&(a=String(a).replace(/&/g,"&").replace(/"/g,"""),e.push(`="${a}"`)),s=s[A]}if(e.push(">"),zo(o))break;let i=o.namespaceURI===G&&o.localName==="template"?o[ve]:o;t.push({type:"closing",name:o[M]}),t.push({type:"content",child:i?.[U]??null});break}case it:{let o=r;e.push(o[fe].replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"));break}case at:{let o=r;e.push(`<!--${o[fe]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[A]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var Z=class extends Ne{nodeType=le;[L]=G;[Ce]=null;get namespaceURI(){return this[L]}get prefix(){return this[Ce]}get localName(){let e=this[Ce];return e==null?this[M]:this[M].slice(e.length+1)}get nodeName(){return this[L]===G?bo(this[M]):this[M]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new We("slot",n))}get attributes(){let e=this[we];return e||(e=new An(this),this[we]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Nn(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return wn(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);mr(r);let s=this[L]===G?K(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new We(s,o))}setAttributeNS(e,n,r){let o=ke(e),s=String(n),i=String(r),a=rn(o,s,"attribute"),l=this.attributes.getNamedItemNS(a.namespace,a.localName);l?l.value=i:this.attributes.setNamedItemNS(new We(a.qualifiedName,i,a.namespace))}toggleAttribute(e,n){let r=String(e);mr(r);let o=this[L]===G?K(r):r,s=this.attributes.getNamedItemNS(null,o),i=n===void 0?void 0:!!n;return s==null?i===!1?!1:(this.attributes.setNamedItem(new We(o,"")),!0):i===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[L]===G?K(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return Fo(this)}get innerHTML(){return _n(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Rn(String(e),this);this.replaceChildren(n)}}};var ct=class t extends Z{[L]=pe;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var He=class extends $e{[fe]="";constructor(e){super(),this[fe]=e==null?"":String(e)}setData(e){let n=Cr,r=n?this[fe]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[fe]=o,n&&r!==o&&ye({type:"characterData",target:this,oldValue:r}),this[W].setText?.(this,o)}get data(){return this[fe]}set data(e){this.setData(e)}};var dt=class extends He{nodeType=it;[M]="#text"};var ut=class extends He{nodeType=at;[M]="#comment"};var ft=class extends Ne{nodeType=Me;[M]="#document-fragment";[B]=typeof window<"u"?window.document:null;getElementById(e){return En(this,e)}};var pt=class extends Z{get content(){let e=this[ve];return e||(e=this.ownerDocument.createDocumentFragment(),e[De]=this,this[ve]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Rn(String(e),this))}get innerHTML(){let e=this[ve];return e?_n(e):""}};var Pn=class extends Z{};var Cn=class extends Z{};var In=class extends Z{};var jt=class extends Ne{nodeType=Ve;[M]="#document";[Q]=!0;constructor(e){super(),this.defaultView=e,this[B]=this,this.documentElement=Mn(new In,this,"html"),this.body=Mn(new Pn,this,"body"),this.head=Mn(new Cn,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return wn(this,e)}createElement(e){let n=String(e);return No(n),Ir(this,K(n))}createElementNS(e,n){let r=rn(e,n,"element");return Ir(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[ot](e,n,r,o){return Ir(this,e,n,r,o)}createTextNode(e){let n=Dn(new dt(e),this);return this[W].createText?.(n,n.data),n}createComment(e){return Dn(new ut(e),this)}createDocumentFragment(){return Dn(new ft,this)}createEvent(){return new ee("")}getElementById(e){return En(this,e)}getElementsByTagName(e){return Nn(this,e)}importNode(e,n){if(e.nodeType===Ve)throw z("Cannot import a document node","NotSupportedError");return bn(e,n,this)}adoptNode(e){if(e[B]===this)return e;let n=yn(e);return te(()=>{let r=e.parentNode;return r?$o(r,e,n,this):Lt(n.nodes,this),e})}};function Dn(t,e){return Object.defineProperty(t,B,{value:e,writable:!0,enumerable:!1}),t}function Ir(t,e,n=G,r=null,o=e){let s;if(n===pe)s=new ct;else if(n===G&&o==="template")s=new pt;else if(n===G){let i=t.defaultView.customElements.get(o);s=i?new i:new Z}else s=new Z;return Mn(s,t,e,n,r)}function Mn(t,e,n,r=G,o=null){return Dn(t,e),Object.defineProperties(t,{[M]:{value:n},[L]:{value:r},[Ce]:{value:o}}),e[W].createElement?.(t,r),t}var Ln=class extends ee{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var $n=class extends ee{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var Hn=class extends ee{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Un=class extends ee{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Gn=class extends ee{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var jn=class extends ee{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var zn=class extends Z{};var ji=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,zi=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Bo(t){return ji.test(t)&&!zi.has(t)}function Yo(t){return z(`Invalid custom element name: "${t}"`,"SyntaxError")}var Fn=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Bo(e))throw Yo(e);if(this.registry.has(e))throw z(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw z("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let s of o)s(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Bo(e))return Promise.reject(Yo(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var Fi=["onerror","onunhandledrejection"],Xo=Symbol.for("@remote-dom/polyfill/global-property");function qo(t){return Object.getOwnPropertyDescriptors(t)}function Ko(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(Le.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=Dr(r.value.bind(t)),e[n]=r);return e}function Zo(t){let e={};for(let n of Fi)e[n]={configurable:!0,enumerable:!0,get:Dr(()=>t[n]),set:Dr(r=>{t[n]=r})};return e}function Vi(t){return Object.assign(qo(t),Ko(t),Zo(t))}function Dr(t){return Object.defineProperty(t,Xo,{value:!0}),t}function Wo(t,e){for(let n of Reflect.ownKeys(e)){let r=Bi(t,n);(r==null||Yi(r))&&Object.defineProperty(t,n,e[n])}}function Bi(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Yi(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[Xo]===!0)}var Xe=class extends Le{[W]={};[tn]=[];[Fe]=Xi(this);name="";window=this;parent=this;self=this;top=this;document=new jt(this);customElements=new Fn;location=globalThis.location;navigator=globalThis.navigator;Event=ee;ErrorEvent=$n;PromiseRejectionEvent=Hn;ToggleEvent=Un;FocusEvent=Gn;ClipboardEvent=jn;EventTarget=Le;CustomEvent=Ln;Node=ge;ParentNode=Ne;ChildNode=$e;DocumentFragment=ft;Document=jt;CharacterData=He;Comment=ut;Text=dt;Element=Z;HTMLElement=zn;SVGElement=ct;HTMLTemplateElement=pt;MutationObserver=vn;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Wi(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener("error",this.#t),e&&typeof e=="function"?(this.#n=e,this.#t=n=>{e(n.message??"Error",n.filename,n.lineno,n.colno,n.error)},this.addEventListener("error",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener("unhandledrejection",this.#e),e&&typeof e=="function"?(this.#e=e,this.addEventListener("unhandledrejection",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=qo(e),s=Object.assign(Ko(e),Zo(e));delete o.self,Object.defineProperties(globalThis,o),Wo(globalThis,s),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),Wo(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Vi(e))}};function Wi(t,e){t[tn].push(e(t)??{})}function Xi(t){return{createElement:Ae.bind(null,t,"createElement"),setAttribute:Ae.bind(null,t,"setAttribute"),removeAttribute:Ae.bind(null,t,"removeAttribute"),createText:Ae.bind(null,t,"createText"),setText:Ae.bind(null,t,"setText"),insertChild:Ae.bind(null,t,"insertChild"),removeChild:Ae.bind(null,t,"removeChild"),addEventListener:Ae.bind(null,t,"addEventListener"),removeEventListener:Ae.bind(null,t,"removeEventListener")}}function Ae(t,e,...n){for(let s of t[tn])s[e]?.apply(s,n);let r=t[W];r[e]?.apply(r,n)}var Vn=new Xe;var Mr="~";var Ue=new WeakMap;function mt(t){return Ue.get(t)}var Ur=new WeakMap,Ki=0;function ce(t){let e=Ur.get(t);return e==null&&(e=String(Ki++),Bn(t,e)),e}function Bn(t,e){Ur.set(t,e)}var $r=new WeakMap;function Zi(t){return $r.get(t)}var Hr=new WeakMap;function Ji(t){let e=Hr.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Qi=new WeakMap;function ea(t){return Qi.get(t)}function Gr(t,e,n){let r=$r.get(t);if(r==null&&(r={},$r.set(t,r)),r[e]===n)return;r[e]=n;let o=Ue.get(t);o?.mutate([[3,ce(t),e,n,1]])}function Ge(t,e,n){let r=Hr.get(t);if(r==null&&(r={},Hr.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=Ue.get(t);o?.mutate([[3,ce(t),e,n,2]])}function gt(t,e){if(Ue.get(t)!==e&&(Ue.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)gt(t.childNodes[r],e)}function Yn(t){if(Ue.get(t)!=null&&(Ue.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)Yn(t.childNodes[n])}function ht(t){let{nodeType:e}=t;switch(e){case 1:return{id:ce(t),type:e,element:t.localName,properties:Lr(Zi(t)),attributes:Lr(Ji(t)),eventListeners:Lr(ea(t)),children:Array.from(t.childNodes).map(ht)};case 3:case 8:return{id:ce(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Lr(t){return t?{...t}:void 0}function jr(t,e,...n){let r=Ur.get(t),o=Ue.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var yt=Vn[W];yt.insertChild=(t,e,n)=>{let r=mt(t);r!=null&&(gt(e,r),r.mutate([[0,ce(t),ht(e),n]]))};yt.removeChild=(t,e,n)=>{let r=mt(t);r!=null&&(Yn(e),r.mutate([[1,ce(t),n]]))};yt.setText=(t,e)=>{let n=mt(t);n?.mutate([[2,ce(t),e]])};yt.setAttribute=(t,e,n)=>{t.tagName.includes("-")||Ge(t,e,n)};yt.removeAttribute=(t,e)=>{t.tagName.includes("-")||Ge(t,e)};Xe.setGlobal(Vn);function Qo(t,e){if(typeof t!="string"||t.length===0||t.length>200)return"A kept value\'s key is a string of 1 to 200 characters, so this one was not kept.";if(e!==null){if(typeof e!="string")return"A view keeps a string or null; JSON.stringify anything else, so this one was not kept.";if(e.length>4096||new TextEncoder().encode(e).length>4096)return"A kept value is at most 4 KB, and this one is longer, so it was not kept."}}function es(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},s={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...s}:typeof n=="string"?{type:"navigate",to:n,...s}:void 0}var ts=["wheel","drag","pinch"];var rs=["globalThis","Infinity","NaN","undefined","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape","Object","Function","Array","Number","Boolean","String","Symbol","BigInt","Date","Promise","RegExp","Math","JSON","Reflect","Proxy","Intl","Error","AggregateError","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","SuppressedError","Map","Set","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Iterator","AsyncIterator","DisposableStack","AsyncDisposableStack","ArrayBuffer","SharedArrayBuffer","DataView","Atomics","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],os=["window","parent","top","document","customElements","Event","ErrorEvent","PromiseRejectionEvent","ToggleEvent","FocusEvent","ClipboardEvent","CustomEvent","EventTarget","Node","ParentNode","ChildNode","DocumentFragment","Document","CharacterData","Comment","Text","Element","HTMLElement","SVGElement","HTMLTemplateElement","MutationObserver"],ss=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],is=["TEMPORARY","PERSISTENT"],Mu=Object.freeze([...rs,...os,...ss,...is]),Lu=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),ns=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function as(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...rs,...os,...ss,...e,"constructor",Symbol.toStringTag]),i=(p,E)=>{let x=Reflect.getOwnPropertyDescriptor(p,E);return x===void 0||!("value"in x)||x.writable||x.configurable?!1:n.primitivesStay&&typeof E=="symbol"&&(typeof x.value!="object"||x.value===null)&&typeof x.value!="function"?!0:is.includes(E)&&typeof x.value=="number"},a=t,l=a.setTimeout,c=a.setInterval,g=a.crypto,h=(p,E)=>function(x,m,...k){if(typeof x!="function")throw new TypeError(`${E} takes a function: a guest view cannot run code from text`);return p.call(t,x,m,...k)},w=g?Object.freeze({getRandomValues:p=>g.getRandomValues(p)}):void 0,b=a.document?.defaultView;if(b&&b!==a)for(let p of Reflect.ownKeys(b))typeof p=="symbol"||s.has(p)||Reflect.deleteProperty(b,p)||o.push(`window.${p}`);let f=[];for(let p=t;p&&p!==Object.prototype;p=Object.getPrototypeOf(p))f.push(p);for(let p of f)for(let E of Reflect.ownKeys(p))s.has(E)||(Reflect.deleteProperty(p,E)?r.push(ns(E)):i(p,E)||o.push(ns(E)));let R=()=>function(){throw new EvalError("A guest view cannot make code from text.")},u=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let p of u){let E=R();Object.defineProperty(E,"prototype",{value:p,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(p,"constructor",{value:E,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),p===Function.prototype&&Reflect.defineProperty(t,"Function",{value:E,writable:!0,enumerable:!1,configurable:!0})}let y=(p,E)=>{Reflect.defineProperty(t,p,{value:E,writable:!0,enumerable:!0,configurable:!0})||o.push(p)};y("setTimeout",h(l,"setTimeout")),y("setInterval",h(c,"setInterval")),w&&y("crypto",w);for(let p of f.slice(1))Object.freeze(p);for(let p of Reflect.ownKeys(t)){let E=Reflect.getOwnPropertyDescriptor(t,p);Reflect.defineProperty(t,p,"value"in E?{...E,writable:!1,configurable:!1}:{...E,configurable:!1})}let O;try{O=Reflect.preventExtensions(t)}catch{O=!1}return{removed:r,stuck:o,sealed:O}}var zt=class extends HTMLElement{constructor(){super(),Bn(this,Mr)}connect(e){if(mt(this)===e||(gt(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,Mr,ht(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Gr(this,e,n)}callRemoteMethod(e,...n){return jr(this,e,...n)}};var S={},zr={empty:!0},ta={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},bt={div:S,section:S,article:S,aside:S,header:S,footer:S,nav:S,hgroup:S,search:S,address:S,figure:S,figcaption:S,blockquote:S,p:S,pre:S,hr:zr,br:zr,wbr:zr,h1:S,h2:S,h3:S,h4:S,h5:S,h6:S,span:S,strong:S,em:S,b:S,i:S,u:S,s:S,small:S,mark:S,abbr:S,cite:S,q:S,code:S,kbd:S,samp:S,var:S,sub:S,sup:S,dfn:S,bdi:S,bdo:S,ruby:S,rt:S,rp:S,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:S,menu:S,dl:S,dt:S,dd:S,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:S,caption:S,thead:S,tbody:S,tfoot:S,tr:S,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:S,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:S,output:S,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":{empty:!0,attributes:{autoplay:"boolean",cover:"boolean"}}},na=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],ra={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(na.map(t=>[t,"css"]))},Re={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},Wn={viewBox:"geometry",preserveAspectRatio:"geometry"},ls={oneOf:["userSpaceOnUse","objectBoundingBox"]},cs={oneOf:["R","G","B","A"]},be={...Re,in:"text",result:"text"},ds={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Xn={svg:{attributes:{...Re,...Wn}},g:S,defs:S,symbol:{attributes:{...Re,...Wn,refX:"geometry",refY:"geometry"}},use:{attributes:{...Re,href:"fragment"}},title:S,desc:S,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...Re,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...ds}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...ds}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...Re,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...Re,...Wn,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...Wn,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:S,filter:{attributes:{...Re,filterUnits:ls,primitiveUnits:ls}},feBlend:{attributes:{...be,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...be,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:be},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(t=>[t,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...be,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...be,in2:"text",scale:"number",xChannelSelector:cs,yChannelSelector:cs}},feDropShadow:{attributes:{...be,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:be},feGaussianBlur:{attributes:{...be,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:be},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...be,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...be,dx:"number",dy:"number"}},feTurbulence:{attributes:{...Re,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var us=["alert","alertdialog","dialog","banner","main","navigation","contentinfo","complementary","search","form","application","status","log","marquee","timer"],fs=["region"],Fr={nav:"div",header:"div",footer:"div",aside:"div",search:"div",output:"span"},qn={section:["aria-label","title"]},ps=["aria-labelledby","aria-describedby"];function oa(t){return/^aria-[a-z]+$/.test(t)}function sa(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Vr=4e3,ms=1e5,Ft=512e3,Br=1e4,gs="http://www.w3.org/1999/xhtml",hs="http://www.w3.org/2000/svg",ia=new Map(Object.keys(Xn).map(t=>[t.toLowerCase(),t]));function Kn(t){return ia.get(t.toLowerCase())}function Zn(t,e,n){let r=n.toLowerCase(),o=t==="html"?[bt[e]?.attributes,ta]:[Xn[e]?.attributes,ra],s=t==="svg"&&r==="xlink:href"?"href":r;for(let i of o)if(i){for(let[a,l]of Object.entries(i))if(a.toLowerCase()===s)return{name:a,kind:l}}if(oa(r)||sa(r))return{name:r,kind:"text"}}var Jn=/^\\d{4}-\\d{2}-\\d{2}$/;function aa(t,e){if(typeof t!="string"||typeof e!="string"||!Jn.test(t)||!Jn.test(e))return;let n=Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/864e5);return Number.isFinite(n)?n:void 0}function ys(t,e,n={}){let r=aa(t,e);if(r===void 0)return"";if(r===0)return"today";if(r===1)return"tomorrow";if(r<0&&n.due===!0)return"overdue";if(r===-1)return"yesterday";let o=Math.abs(r),[s,i]=o<14?[o,"day"]:o<60?[Math.round(o/7),"week"]:o<730?[Math.round(o/30.44),"month"]:[Math.round(o/365.25),"year"],a=`${s} ${i}${s===1?"":"s"}`;return r>0?`in ${a}`:`${a} ago`}function bs(t,e){if(typeof t!="string")return;if(Jn.test(t))return t;let n=Date.parse(t);if(Number.isFinite(n)){if(!/(Z|[+-]\\d\\d:?\\d\\d)$/.test(t))return Jn.test(t.slice(0,10))?t.slice(0,10):void 0;try{let r=new Intl.DateTimeFormat("en-CA",{timeZone:e||"UTC",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(n),o=s=>r.find(i=>i.type===s)?.value??"";return`${o("year")}-${o("month")}-${o("day")}`}catch{return new Date(n).toISOString().slice(0,10)}}}var Es="~",Qn=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Te=(t,e=0)=>{if(t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===void 0)return t;if(!(e>64||typeof t!="object"))return Array.isArray(t)?t.map(n=>Te(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,Te(r,e+1)]))};function ws(){let t=new Map,e=new Map,n=new Map([[Es,{children:[],listeners:new Map}]]),r=0,o=c=>{let g=e.get(c);return g===void 0&&(g=r+=1,e.set(c,g),t.set(g,{listener:c,count:0})),t.get(g).count+=1,g},s=c=>{let g=t.get(c);g&&(g.count-=1,!(g.count>0)&&(t.delete(c),e.delete(g.listener)))},i=c=>{let g=n.get(c);if(g){n.delete(c);for(let h of g.listeners.values())s(h);for(let h of g.children)i(h)}},a=(c,g,h=0)=>{if(!Qn(c)||h>64)return Te(c);let w=typeof c.id=="string"?c.id:void 0,b=g&&w!==void 0&&w!==Es;b&&i(w);let f={children:[],listeners:new Map};b&&n.set(w,f);let R={};for(let[u,y]of Object.entries(c))u==="children"&&Array.isArray(y)?R[u]=y.map(O=>{let p=a(O,b,h+1);return b&&Qn(O)&&typeof O.id=="string"&&f.children.push(O.id),p}):u==="eventListeners"&&Qn(y)?R[u]=Object.fromEntries(Object.entries(y).map(([O,p])=>{if(typeof p!="function"||!b)return[O,void 0];let E=o(p);return f.listeners.set(O,E),[O,{listener:E}]})):R[u]=Te(y,h+1);return R},l=c=>{if(!Array.isArray(c))return Te(c);let[g,h]=c,w=typeof h=="string"?n.get(h):void 0;if(g===0){let b=a(c[2],w!==void 0),f=Qn(c[2])?c[2].id:void 0;if(w&&typeof f=="string"&&n.has(f)){let R=Number(c[3]);w.children.splice(Number.isInteger(R)&&R>=0&&R<=w.children.length?R:w.children.length,0,f)}return[g,Te(h),b,Te(c[3])]}if(g===1){let b=Number(c[2]);return w&&Number.isInteger(b)&&b>=0&&b<w.children.length&&i(w.children.splice(b,1)[0]),Te(c)}if(g===3&&c[4]===3){let b=String(c[2]),f=c[3],R=w&&typeof f=="function"?o(f):void 0,u=w?.listeners.get(b);return u!==void 0&&s(u),R===void 0?w?.listeners.delete(b):w.listeners.set(b,R),[g,Te(h),b,R===void 0?void 0:{listener:R},3]}return Te(c)};return{encode:c=>c.map(l),listener:c=>t.get(c)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var Yr="graview-view-root",la=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],ca=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\'/g,"'"),da=t=>Object.freeze({html:t,toString:()=>t}),Ns=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),Ts=t=>t==null||t===!1?"":Array.isArray(t)?t.map(Ts).join(""):Ns(t)?t.html:ca(String(t));function xs(t){customElements.get(Yr)||customElements.define(Yr,zt);let e=Event,n=ws(),r=new Set,o=new Set,s,i=[],a=new Set;for(let d of["closest","matches","dataset"]){let T=()=>{throw new TypeError(`A view\'s element has no ${d}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};d in Element.prototype||Object.defineProperty(Element.prototype,d,d==="dataset"?{get:T}:{value:T})}let l=document.createElement(Yr),c=d=>{let T=_=>{for(let D of Array.from(_.childNodes)){if(D.nodeType!==1)continue;if(ce(D)===d)return D;let I=T(D);if(I)return I}};return T(l)},g=d=>{let T=c(d.target);if(!T)return;let _=new e(d.event,{bubbles:!0}),D={};for(let I of la)d[I]!==void 0&&(D[I]=d[I]);for(let I of Object.keys(D))Object.defineProperty(_,I,{value:D[I],enumerable:!0});T.dispatchEvent(_);for(let I of o){if(I.type!==d.event)continue;let H;try{H=new Set(Array.from(l.querySelectorAll(I.selector)))}catch{continue}for(let q=T;q&&q!==l;q=q.parentNode)if(H.has(q)){I.listener(Object.freeze({type:d.event,target:T,element:q,...D}));break}}},h=Error,w=new Map,b=0,f=(d,T,_)=>new Promise((D,I)=>{let H=++b;w.set(H,q=>q.ok?D(q):I(new h(q.sentence??"This value was not kept."))),t.send({type:"mine",id:H,op:d,key:T,...d==="set"?{value:_}:{}})}),R=d=>(d.catch(()=>{}),d),u=Object.freeze({get(d){return R(f("get",d).then(T=>typeof T.value=="string"?T.value:null))},set(d,T){return R(f("set",d,T).then(()=>{}))}}),y=d=>{if(d.type==="mine-answer"){let I=w.get(d.id);return w.delete(d.id),I?.(d)}if(d.type==="dom-event"&&typeof d.target=="string")return g(d);if(d.type==="notice")return t.warn(d.text);if(d.type!=="props")return;s=d.props;let T=t.now();for(let I of r)try{I(d.props)}catch(H){t.threw(H)}let _=t.now()-T,D=d.push;typeof D=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:D,ms:_})))},O;l.connect({mutate(d){O||(O=[],t.microtask(()=>{let T=O??[];O=void 0,t.send({type:"render",records:n.encode(T)})})),O.push(...d)},call:()=>{}});let p=d=>d.nodeType===1?d.getAttribute("data-key")??d.getAttribute("id"):null,E=(d,T)=>d.nodeType===T.nodeType&&(d.nodeType!==1||d.localName===T.localName&&d.namespaceURI===T.namespaceURI&&p(d)===p(T));function x(d,T){let _=Array.from(T.childNodes),D=0;for(let I of _){let H=d.childNodes[D]??null;if(H&&E(H,I)){m(H,I),D+=1;continue}if(p(I)!==null){let Pe=Array.from(d.childNodes).slice(D+1).find(vt=>E(vt,I));if(Pe){d.insertBefore(Pe,H),m(Pe,I),D+=1;continue}}d.insertBefore(I,H),D+=1}for(;d.childNodes.length>D;)d.removeChild(d.lastChild)}function m(d,T){if(d.nodeType!==1){d.data!==T.data&&(d.data=T.data);return}let _=d,D=T,I=k(_);for(let H of _.getAttributeNames())D.hasAttribute(H)||(_.removeAttribute(H),I&&Ge(_,H,void 0));for(let H of D.getAttributeNames()){let q=D.getAttribute(H);_.getAttribute(H)!==q&&_.setAttribute(H,q),I&&Ge(_,H,q)}x(_,D)}let k=d=>d.localName.includes("-");function N(d){for(let T of Array.from(d.childNodes)){if(T.nodeType!==1)continue;let _=T;if(k(_))for(let D of _.getAttributeNames())Ge(_,D,_.getAttribute(D)??void 0);N(_)}}function C(d,T,_){for(let D of Array.from(d.childNodes)){if(D.nodeType!==1)continue;let I=D,H=I.localName,q=T||H.toLowerCase()==="svg",Pe=q?Kn(H):Object.prototype.hasOwnProperty.call(bt,H.toLowerCase())?H.toLowerCase():void 0;if(!Pe){_.add(`<${H}>`);continue}for(let vt of I.getAttributeNames())(!Zn(q?"svg":"html",Pe,vt)||!q&&qn[Pe]?.includes(vt.toLowerCase()))&&_.add(`${Pe} ${vt}`);C(I,q,_)}}function P(d){let T=document.createElement("div"),_=Array.isArray(d)?d:[d];for(let I of _)if(I!=null)if(typeof I=="string"||Ns(I)){let H=document.createElement("div");H.innerHTML=typeof I=="string"?I:I.html,T.append(...Array.from(H.childNodes))}else T.append(I);let D=new Set;C(T,!1,D),i=[...D],i.length>0&&t.warn(`The host will not draw: ${i.join(", ")}`),N(T),x(l,T)}let v=[],j=new Set(ts),$="[]",V=!1,J=()=>{V||(V=!0,t.microtask(()=>{V=!1;let d=[...new Map([...o].filter(_=>j.has(_.type)).map(_=>[`${_.type} ${_.selector}`,{event:_.type,selector:_.selector}])).entries()].sort(([_],[D])=>_<D?-1:_>D?1:0).map(([,_])=>_),T=JSON.stringify(d);T!==$&&($=T,t.send({type:"gestures",bound:d}))}))},fo="[[],[]]",fr=!1,po=()=>{fr||(fr=!0,t.microtask(()=>{fr=!1;let d=I=>[...new Set([...o].filter(H=>H.type===I&&typeof H.selector=="string").map(H=>H.selector))].sort().slice(0,200),T=d("click"),_=d("acted"),D=JSON.stringify([T,_]);D!==fo&&(fo=D,t.send({type:"clicks",selectors:T,..._.length>0?{acted:_}:{}}))}))},mo=Object.freeze({get props(){return s},onProps(d){return r.add(d),s&&d(s),()=>void r.delete(d)},render:P,style(d){typeof d!="string"||v.includes(d)||(v.push(d),t.send({type:"style",sheets:[...v]}))},on(d,T,_){let D={type:d,selector:T,listener:_};return o.add(D),typeof d=="string"&&!a.has(d)&&(a.add(d),t.send({type:"hears",events:[d]})),j.has(d)&&J(),(d==="click"||d==="acted")&&po(),()=>{o.delete(D),j.has(d)&&J(),(d==="click"||d==="acted")&&po()}},act:(d,T={})=>t.act(d,T),mine:u,navigate(d){if(typeof d=="string")return t.navigate(d);let T=es(d);T&&t.send(T)},html(d,...T){return da(d.reduce((_,D,I)=>_+D+(I<T.length?Ts(T[I]):""),""))},get today(){return s?.today??new Date().toISOString().slice(0,10)},fromToday(d,T){let _=bs(d,s?.timeZone);return _===void 0?"":ys(_,mo.today,T)},get refused(){return i},get hardening(){return t.hardening()}});return{view:mo,hear:y,find:d=>{try{let T=l.querySelectorAll(d)[0];return T?ce(T):void 0}catch{return}},listened:d=>{let T=new Set;for(let _ of o)if(_.type===d)try{for(let D of Array.from(l.querySelectorAll(_.selector))){let I=ce(D);I&&T.add(I)}}catch{}return[...T]}}}var Ss=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function Vt(t,e){let n=t.find(s=>s.as===e);if(n)return n;let r=e.trim().toLowerCase(),o=Ss(e);return t.find(s=>s.title!==void 0&&s.title.trim().toLowerCase()===r)??(o?t.find(s=>s.as===o||s.title!==void 0&&Ss(s.title)===o):void 0)}var xe=t=>` Its places: ${t.map(e=>typeof e=="string"?`"${e}"`:e.title&&e.title!==e.as?`"${e.as}" (${e.title})`:`"${e.as}"`).join(", ")||"none"}.`,Et=" This run was not handed the views the host keeps, so a titled view\'s place is not among these: if it names one, the link goes there.",Bt=t=>`"${t.length>80?`${t.slice(0,79)}\\u2026`:t}"`;var ua=t=>typeof t=="string"&&/^#[A-Za-z_][A-Za-z0-9_.:-]{0,199}$/.test(t),vs=["https:","mailto:","tel:"];function ks(t){if(!(typeof t!="string"||t.length>2e3||/[\\s<>"]/.test(t.trim())||t.trim()!==t))try{let e=new URL(t);return!vs.includes(e.protocol)||e.protocol==="https:"&&(e.hostname===""||e.username!==""||e.password!=="")?void 0:e.href}catch{return}}function Os(t){let e=new Set,n=r=>{if(typeof r!="string"||!/^(https|mailto|tel):/i.test(r))return;let o=ks(r);o&&e.add(o)};for(let r of[...t?.node?[t.node]:[],...t?.nodes??[]])for(let[o,s]of Object.entries(r))o==="id"||o==="kind"||(Array.isArray(s)?s.forEach(n):n(s));return e}function As(t){return(t??[]).flatMap(e=>{try{let n=new URL(e);return n.protocol==="https:"&&n.hostname!==""&&n.username===""&&n.password===""?[n.origin]:[]}catch{return[]}})}function Rs(t,e){if(ua(t))return t;let n=ks(t);if(n&&(e.handed.has(n)||n.startsWith("https:")&&As(e.origins).includes(new URL(n).origin)))return n}function _s(t,e){let n=t.length>120?`${t.slice(0,119)}\\u2026`:t,r="";try{r=new URL(t).protocol}catch{r=""}if(!vs.includes(r))return`The link "${n}" was not drawn: a view links only to an https:, mailto: or tel: address.`;let o=As(e);return`The link "${n}" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${o.length>0?`, or an https: address on ${o.join(", ")}`:""}; a record or a place of this app is <a data-record> or <a data-place>.`}var Wr={nav:"div",header:"div",footer:"div",aside:"div",search:"div",output:"span"},Ps=["all","display","position","top","right","bottom","left","inset","inset-block","inset-inline","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","width","height","min-width","min-height","max-width","max-height","inline-size","block-size","min-inline-size","min-block-size","max-inline-size","max-block-size","margin","margin-top","margin-right","margin-bottom","margin-left","margin-block","margin-inline","margin-block-start","margin-block-end","margin-inline-start","margin-inline-end","padding","padding-top","padding-right","padding-bottom","padding-left","padding-block","padding-inline","padding-block-start","padding-block-end","padding-inline-start","padding-inline-end","box-sizing","overflow","overflow-x","overflow-y","overflow-wrap","float","clear","z-index","aspect-ratio","object-fit","object-position","vertical-align","isolation","contain","container","container-type","container-name","content-visibility","flex","flex-direction","flex-wrap","flex-flow","flex-grow","flex-shrink","flex-basis","order","grid","grid-template","grid-template-columns","grid-template-rows","grid-template-areas","grid-auto-columns","grid-auto-rows","grid-auto-flow","grid-area","grid-column","grid-row","grid-column-start","grid-column-end","grid-row-start","grid-row-end","gap","row-gap","column-gap","align-items","align-content","align-self","justify-items","justify-content","justify-self","place-items","place-content","place-self","columns","column-count","column-width","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-fill","break-inside","break-before","break-after","page-break-inside","page-break-before","page-break-after","orphans","widows","box-decoration-break","-webkit-box-decoration-break","color","background","background-color","background-image","background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode","border","border-top","border-right","border-bottom","border-left","border-block","border-inline","border-block-start","border-block-end","border-inline-start","border-inline-end","border-width","border-style","border-color","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-start-start-radius","border-start-end-radius","border-end-start-radius","border-end-end-radius","border-collapse","border-spacing","outline","outline-width","outline-style","outline-color","outline-offset","box-shadow","opacity","visibility","mix-blend-mode","filter","backdrop-filter","clip-path","accent-color","caret-color","color-scheme","appearance","-webkit-appearance","mask-image","mask-size","mask-position","mask-repeat","mask-origin","mask-clip","mask-composite","mask-mode","mask-type","-webkit-mask","-webkit-mask-image","-webkit-mask-size","-webkit-mask-position","-webkit-mask-repeat","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-composite","font","font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-variant-numeric","font-variant-caps","font-variant-ligatures","font-feature-settings","font-variation-settings","font-kerning","font-optical-sizing","font-size-adjust","font-synthesis","line-height","letter-spacing","word-spacing","text-align","text-align-last","text-indent","text-transform","text-decoration","text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-underline-position","text-shadow","text-overflow","text-wrap","text-wrap-mode","text-wrap-style","white-space","white-space-collapse","word-break","line-break","hyphens","tab-size","direction","unicode-bidi","writing-mode","text-orientation","text-rendering","-webkit-font-smoothing","-webkit-line-clamp","-webkit-box-orient","line-clamp","-webkit-text-fill-color","-webkit-background-clip","-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","list-style","list-style-type","list-style-position","content","quotes","counter-reset","counter-increment","counter-set","table-layout","caption-side","empty-cells","transform","transform-origin","transform-box","transform-style","translate","rotate","scale","perspective","perspective-origin","backface-visibility","transition","transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior","animation","animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-composition","will-change","animation-timeline","animation-range","animation-range-start","animation-range-end","scroll-timeline","scroll-timeline-name","scroll-timeline-axis","view-timeline","view-timeline-name","view-timeline-axis","view-timeline-inset","timeline-scope","cursor","pointer-events","user-select","-webkit-user-select","touch-action","resize","scroll-behavior","overscroll-behavior","overscroll-behavior-x","overscroll-behavior-y","scroll-snap-type","scroll-snap-align","scroll-snap-stop","scroll-margin","scroll-padding","scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left","scroll-margin-block","scroll-margin-block-start","scroll-margin-block-end","scroll-margin-inline","scroll-margin-inline-start","scroll-margin-inline-end","scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left","scroll-padding-block","scroll-padding-block-start","scroll-padding-block-end","scroll-padding-inline","scroll-padding-inline-start","scroll-padding-inline-end","scrollbar-width","scrollbar-color","scrollbar-gutter","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","stop-color","stop-opacity","clip-rule","marker","marker-start","marker-mid","marker-end","paint-order","vector-effect","shape-rendering","text-anchor","dominant-baseline","alignment-baseline","r","cx","cy","rx","ry","x","y","d","mask","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],Cs=["var","env","calc","min","max","clamp","round","mod","rem","abs","sign","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","light-dark","linear-gradient","radial-gradient","conic-gradient","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","translate","translatex","translatey","translatez","translate3d","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","matrix","matrix3d","perspective","cubic-bezier","steps","linear","repeat","minmax","fit-content","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","saturate","sepia","opacity","circle","ellipse","inset","polygon","path","xywh","rect","counter","counters","scroll","view"],Is=["fill","stroke","clip-path","mask","marker","marker-start","marker-mid","marker-end","filter"],Ds=["media","supports","container","keyframes"],Ms={position:["static","relative","absolute","sticky"],all:[],appearance:["auto","none","menulist-button","textfield"],"-webkit-appearance":["auto","none","menulist-button","textfield"]},Ls=["host","host-context","slotted","part","backdrop","picker","view-transition","view-transition-group","view-transition-image-pair","view-transition-old","view-transition-new"],$s=["-webkit-details-marker"],Yt=64e3;var ne=t=>t>=48&&t<=57,Hs=t=>ne(t)||t>=65&&t<=70||t>=97&&t<=102,Jr=t=>t>=65&&t<=90||t>=97&&t<=122,Qr=t=>t>=128,er=t=>Jr(t)||Qr(t)||t===95,Us=t=>er(t)||ne(t)||t===45,Gs=t=>t===10,_e=t=>t===10||t===9||t===32,fa=t=>t>=0&&t<=8||t===11||t>=14&&t<=31||t===127,Ee=-1;function pa(t){let e=[];for(let n=0;n<t.length;n+=1){let r=t.codePointAt(n);r>65535&&(n+=1),r===13?(t.charCodeAt(n+1)===10&&(n+=1),r=10):r===12?r=10:(r===0||r>=55296&&r<=57343)&&(r=65533),e.push(r)}return e}function Xt(t){let e=pa(t),n=0,r=(u=0)=>n+u<e.length?e[n+u]:Ee,o=[],s=(u,y)=>u===92&&y!==10&&y!==Ee,i=(u,y,O)=>u===45?er(y)||y===45||s(y,O):er(u)?!0:s(u,y),a=(u,y,O)=>u===43||u===45?ne(y)||y===46&&ne(O):ne(u===46?y:u),l=()=>{let u=r();if(n+=1,u===Ee)return 65533;if(Hs(u)){let y=String.fromCodePoint(u);for(;y.length<6&&Hs(r());)y+=String.fromCodePoint(r()),n+=1;_e(r())&&(n+=1);let O=parseInt(y,16);return O===0||O>=55296&&O<=57343||O>1114111?65533:O}return u},c=()=>{let u="";for(;;){let y=r();if(Us(y))u+=String.fromCodePoint(y),n+=1;else if(s(y,r(1)))n+=1,u+=String.fromCodePoint(l());else return u}},g=()=>{let u="";for((r()===43||r()===45)&&(u+=String.fromCodePoint(e[n++]));ne(r());)u+=String.fromCodePoint(e[n++]);if(r()===46&&ne(r(1)))for(u+=String.fromCodePoint(e[n++],e[n++]);ne(r());)u+=String.fromCodePoint(e[n++]);if((r()===69||r()===101)&&(ne(r(1))||(r(1)===43||r(1)===45)&&ne(r(2))))for(u+=String.fromCodePoint(e[n++]),ne(r())||(u+=String.fromCodePoint(e[n++]));ne(r());)u+=String.fromCodePoint(e[n++]);return u},h=()=>{let u=g();return i(r(),r(1),r(2))?{type:"dimension",repr:u,unit:c()}:r()===37?(n+=1,{type:"percentage",repr:u}):{type:"number",repr:u}},w=()=>{for(;;){let u=r();if(n+=1,u===41||u===Ee)return;s(u,r())&&l()}},b=()=>{let u="";for(;_e(r());)n+=1;for(;;){let y=r();if(n+=1,y===41)return{type:"url",value:u};if(y===Ee)return{type:"url",value:u};if(_e(y)){for(;_e(r());)n+=1;return r()===41||r()===Ee?(r()===41&&(n+=1),{type:"url",value:u}):(w(),{type:"bad-url"})}if(y===34||y===39||y===40||fa(y))return w(),{type:"bad-url"};if(y===92){if(s(y,r()))u+=String.fromCodePoint(l());else return w(),{type:"bad-url"};continue}u+=String.fromCodePoint(y)}},f=()=>{let u=c();if(u.toLowerCase()==="url"&&r()===40){for(n+=1;_e(r())&&_e(r(1));)n+=1;let y=_e(r())?r(1):r();return y===34||y===39?{type:"function",value:u}:b()}return r()===40?(n+=1,{type:"function",value:u}):{type:"ident",value:u}},R=u=>{let y="";for(;;){let O=r();if(n+=1,O===u||O===Ee)return{type:"string",value:y};if(Gs(O))return n-=1,{type:"bad-string"};if(O===92){if(r()===Ee)continue;if(Gs(r())){n+=1;continue}y+=String.fromCodePoint(l());continue}y+=String.fromCodePoint(O)}};for(;;){for(;r()===47&&r(1)===42;){for(n+=2;r()!==Ee&&!(r()===42&&r(1)===47);)n+=1;r()!==Ee&&(n+=2)}let u=r();if(u===Ee)return o;if(_e(u)){for(;_e(r());)n+=1;o.push({type:"whitespace"});continue}switch(n+=1,u){case 34:case 39:o.push(R(u));continue;case 35:if(Us(r())||s(r(),r(1))){let y=i(r(),r(1),r(2));o.push({type:"hash",value:c(),id:y})}else o.push({type:"delim",value:"#"});continue;case 40:o.push({type:"("});continue;case 41:o.push({type:")"});continue;case 43:case 46:a(u,r(),r(1))?(n-=1,o.push(h())):o.push({type:"delim",value:String.fromCodePoint(u)});continue;case 44:o.push({type:","});continue;case 45:a(u,r(),r(1))?(n-=1,o.push(h())):r()===45&&r(1)===62?(n+=2,o.push({type:"CDC"})):i(u,r(),r(1))?(n-=1,o.push(f())):o.push({type:"delim",value:"-"});continue;case 58:o.push({type:":"});continue;case 59:o.push({type:";"});continue;case 60:r()===33&&r(1)===45&&r(2)===45?(n+=3,o.push({type:"CDO"})):o.push({type:"delim",value:"<"});continue;case 64:i(r(),r(1),r(2))?o.push({type:"at-keyword",value:c()}):o.push({type:"delim",value:"@"});continue;case 91:o.push({type:"["});continue;case 92:s(u,r())?(n-=1,o.push(f())):o.push({type:"delim",value:"\\\\"});continue;case 93:o.push({type:"]"});continue;case 123:o.push({type:"{"});continue;case 125:o.push({type:"}"});continue;default:ne(u)?(n-=1,o.push(h())):er(u)?(n-=1,o.push(f())):o.push({type:"delim",value:String.fromCodePoint(u)})}}}var Bs={"{":"}","[":"]","(":")"},Ys=32,qr=class{tokens;i=0;constructor(e){this.tokens=e}peek(){return this.tokens[this.i]}next(){return this.tokens[this.i++]}};function Ws(t,e){let n=t.next();return n.type==="{"||n.type==="["||n.type==="("?{type:"block",open:n.type,value:js(t,Bs[n.type],e+1)}:n.type==="function"?{type:"func",name:n.value,value:js(t,")",e+1)}:n}function js(t,e,n){let r=[];for(;;){let o=t.peek();if(!o)return r;if(o.type===e)return t.next(),r;if(n>Ys){t.next(),r.push({type:"bad-string"});continue}r.push(Ws(t,n))}}function wt(t,e){let n=[],r=0;for(;r<t.length;){let o=t[r];if(o.type==="whitespace"||e&&(o.type==="CDO"||o.type==="CDC")){r+=1;continue}if(o.type==="at-keyword"){let a=[];r+=1;let l;for(;r<t.length;){let c=t[r];if(r+=1,c.type===";")break;if(c.type==="block"&&c.open==="{"){l=c.value;break}a.push(c)}n.push({type:"at-rule",name:o.value,prelude:a,...l?{block:l}:{}});continue}let s=[],i;for(;r<t.length;){let a=t[r];if(r+=1,a.type==="block"&&a.open==="{"){i=a.value;break}s.push(a)}i&&n.push({type:"qualified",prelude:s,block:i})}return n}function eo(t){let e=[],n=0;for(;n<t.length;){let r=t[n];if(r.type==="whitespace"||r.type===";"){n+=1;continue}if(r.type==="at-keyword"){let s=(()=>{for(let i=n+1;i<t.length;i+=1){let a=t[i];if(a.type===";"||a.type==="block"&&a.open==="{")return i+1}return t.length})();e.push(...wt(t.slice(n,s),!1)),n=s;continue}if(r.type==="ident"){let s=n+1;for(;t[s]?.type==="whitespace";)s+=1;if(t[s]?.type===":"){let i=s+1;for(;i<t.length&&t[i].type!==";";)i+=1;let a=Xs(r.value,t.slice(s+1,i));if(a.value.some(l=>l.type==="block"&&l.open==="{")){let l=t.findIndex((c,g)=>g>n&&c.type==="block"&&c.open==="{");e.push(...wt(t.slice(n,l+1),!1)),n=l+1;continue}e.push(a),n=i+1;continue}}let o=n;for(;o<t.length&&!(t[o].type==="block"&&t[o].open==="{")&&t[o].type!==";";)o+=1;o<t.length&&t[o].type==="block"&&e.push(...wt(t.slice(n,o+1),!1)),n=o+1}return e}function Xs(t,e){let n=[...e];for(;n[0]?.type==="whitespace";)n.shift();for(;n.at(-1)?.type==="whitespace";)n.pop();let r=!1,s=n.length-1;if(n[s]?.type==="ident"&&n[s].value.toLowerCase()==="important"){for(s-=1;n[s]?.type==="whitespace";)s-=1;let i=n[s];if(i?.type==="delim"&&i.value==="!")for(r=!0,n.length=s;n.at(-1)?.type==="whitespace";)n.pop()}return{type:"declaration",name:t,value:n,important:r}}function to(t){let e=new qr(Xt(t)),n=[];for(;e.peek();)n.push(Ws(e,0));return n}function Nt(t){let e="",n=[...t].map(r=>r.codePointAt(0));return n.forEach((r,o)=>{r===0?e+="\\uFFFD":r>=1&&r<=31||r===127||o===0&&ne(r)||o===1&&ne(r)&&n[0]===45?e+=`\\\\${r.toString(16)} `:o===0&&r===45&&n.length===1?e+="\\\\-":Qr(r)||r===45||r===95||ne(r)||Jr(r)?e+=String.fromCodePoint(r):e+=`\\\\${String.fromCodePoint(r)}`}),e}function tr(t){let e="";for(let n of t){let r=n.codePointAt(0);Qr(r)||r===45||r===95||ne(r)||Jr(r)?e+=n:r>=1&&r<=31||r===127?e+=`\\\\${r.toString(16)} `:e+=`\\\\${n}`}return e}function Wt(t){let e=\'"\';for(let n of t){let r=n.codePointAt(0);r===0?e+="\\uFFFD":r>=1&&r<=31||r===127||r===60||r===62?e+=`\\\\${r.toString(16)} `:r===34||r===92?e+=`\\\\${n}`:e+=n}return`${e}"`}function ma(t){let e=tr(t);return/^[eE]([0-9]|[+-][0-9])/.test(t)?`\\\\${t.codePointAt(0).toString(16)} ${tr(t.slice(1))}`:e}var zs=t=>{switch(t.type){case"ident":case"url":case"bad-url":case"number":case"percentage":case"dimension":case"CDC":case"hash":case"at-keyword":return t.type;case"func":case"function":return"function";case"block":return t.open==="("?"(":"other";case"(":return"(";case"delim":return`delim${t.value}`;default:return"other"}};function ga(t,e){let n=["ident","function","url","bad-url","delim-","number","percentage","dimension","CDC"];return t==="ident"?[...n,"("].includes(e):t==="at-keyword"||t==="hash"||t==="dimension"||t==="delim#"||t==="delim-"?n.includes(e):t==="number"?["ident","function","url","bad-url","number","percentage","dimension","delim%"].includes(e):t==="delim@"?["ident","function","url","bad-url","delim-","CDC"].includes(e):t==="delim."||t==="delim+"?["number","percentage","dimension"].includes(e):t==="delim/"?e==="delim*":!1}function ha(t){switch(t.type){case"whitespace":return" ";case"ident":return Nt(t.value);case"at-keyword":return`@${Nt(t.value)}`;case"hash":return`#${tr(t.value)}`;case"string":return Wt(t.value);case"url":return`url(${Wt(t.value)})`;case"delim":return t.value==="\\\\"?`\\\\\n`:t.value;case"CDO":return"<!--";case"CDC":return"-->";case"number":return t.repr;case"percentage":return`${t.repr}%`;case"dimension":return`${t.repr}${ma(t.unit)}`;case"func":return`${Nt(t.name)}(${je(t.value)})`;case"block":return`${t.open}${je(t.value)}${Bs[t.open]}`;case":":case";":case",":case"[":case"]":case"(":case")":case"{":case"}":return t.type;default:return""}}function je(t){let e="",n;for(let r of t)r.type==="whitespace"&&n?.type==="whitespace"||(n&&ga(zs(n),zs(r))&&(e+="/**/"),e+=ha(r),n=r);return e}var ya=new Set(Ps),qs=new Set(Cs),Fs=new Set(Is),ba=new Set(Ds),Ea=new Set(Ls),wa=new Set($s),Vs=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,ue=t=>t.replace(/[A-Z]/g,e=>e.toLowerCase()),Na=t=>ue(t);function Kr(t,e,n){let r=[];for(let o of e){if(o.type==="bad-url"||o.type==="bad-string"){n({reason:"unreadable",...t?{name:t}:{}});return}if(o.type==="url"){if(t&&Fs.has(t)&&Vs.test(o.value)){r.push({type:"func",name:"url",value:[{type:"string",value:o.value}]});continue}n({reason:"url",...t?{name:t}:{}});return}if(o.type==="func"){let s=ue(o.name);if(s==="url"||s==="src"){let a=o.value.filter(c=>c.type!=="whitespace"),l=a[0];if(s==="url"&&a.length===1&&l?.type==="string"&&t&&Fs.has(t)&&Vs.test(l.value)){r.push({type:"func",name:"url",value:[{type:"string",value:l.value}]});continue}n({reason:"url",...t?{name:t}:{}});return}if(!qs.has(s)){n({reason:"function",name:s});return}let i=Kr(t,o.value,n);if(!i)return;s==="var"?r.push({type:"whitespace"},{type:"func",name:s,value:i},{type:"whitespace"}):r.push({type:"func",name:s,value:i});continue}if(o.type==="block"){if(o.open==="{"||o.open==="("&&r.at(-1)?.type==="ident"){n({reason:"unreadable",...t?{name:t}:{}});return}let s=Kr(t,o.value,n);if(!s)return;r.push({type:"block",open:o.open,value:s});continue}if(o.type==="at-keyword"||o.type==="CDO"||o.type==="CDC"||o.type==="{"||o.type==="}"||o.type===";"||o.type===")"||o.type==="]"||o.type==="delim"&&o.value==="\\\\"){n({reason:"unreadable",...t?{name:t}:{}});return}r.push(o)}return r}var Ta=/^(animation|transition|scroll-behavior|outline)/,xa="--graview-ring-color",Sa="--graview-focus-color",va=t=>{let e=t.filter(r=>r.type!=="whitespace"),n=e[0];return e.length!==1||!n?!1:n.type==="hash"?/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(n.value):n.type==="ident"&&!["transparent","currentcolor"].includes(ue(n.value))},ka=new Set(["url","src","image-set","-webkit-image-set"]),Ks=t=>{for(let e of t){if(e.type==="func"&&ka.has(ue(e.name)))return ue(e.name);if(e.type==="func"||e.type==="block"){let n=Ks(e.value);if(n)return n}}};function rr(t,e,n=!1){let r=t.name.startsWith("--"),o=r?t.name:Na(t.name);if(o===xa||!r&&!ya.has(o)){e({reason:"property",name:o});return}if(o===Sa&&!va(t.value)){e({reason:"value",name:o});return}let s=Ms[o];if(s){let l=t.value.filter(h=>h.type!=="whitespace"),c=l[0],g=l.length===1&&c?.type==="ident"?ue(c.value):void 0;if(!g||![...s,"inherit","initial","unset","revert"].includes(g)){e({reason:"value",name:o});return}return`${o}: ${g}${t.important&&!(n&&o==="all")?" !important":""}`}let i=Kr(r?void 0:o,t.value,e);if(!i)return;let a=je(i).trim();return`${r?`--${tr(t.name.slice(2))}`:o}: ${a}${t.important&&!(n&&Ta.test(o))?" !important":""}`}var no=t=>t.some(e=>e.type==="}"||e.type===";"||e.type===")"||e.type==="]"||e.type==="at-keyword"||e.type==="CDO"||e.type==="CDC"||e.type==="delim"&&e.value==="\\\\"||(e.type==="func"||e.type==="block")&&no(e.value));function Zs(t,e){if(no(t))return e({reason:"unreadable",name:"selector"}),!1;let n=Ks(t);if(n)return e({reason:"url",name:n}),!1;let r=o=>{for(let s=0;s<o.length;s+=1){let i=o[s];if(s>0&&o[s-1].type===":"&&(i.type==="ident"||i.type==="func")){let l=ue(i.type==="ident"?i.value:i.name);if(Ea.has(l)||(l.startsWith("-webkit-")||l.startsWith("-moz-"))&&!wa.has(l))return e({reason:"selector",name:l}),!1}if(i.type==="url"||i.type==="bad-url"||i.type==="bad-string"||i.type==="at-keyword"||i.type==="CDO"||i.type==="CDC"||i.type==="block"&&i.open==="{")return e({reason:"unreadable",name:"selector"}),!1;if(i.type==="func"&&!r(i.value)||i.type==="block"&&!r(i.value))return!1}return!0};return r(t)}function Xr(t,e,n){let r=[];for(let o of eo(t))if(o.type==="declaration"){let s=rr(o,e);s&&r.push(`${s};`)}else{let s=nr(o,e,n+1,"style");s&&r.push(s)}return r.join(" ")}function Oa(t,e,n){if(no(t)){n({reason:"unreadable",name:`@${e}`});return}let r=o=>o.every(s=>{if(s.type==="url"||s.type==="bad-url"||s.type==="bad-string"||s.type==="block"&&s.open==="{")return n({reason:s.type==="url"?"url":"unreadable",name:`@${e}`}),!1;if(s.type==="func"){let i=ue(s.name);return e==="supports"&&i==="selector"?Zs(s.value,n):qs.has(i)?r(s.value):(n({reason:"function",name:i}),!1)}if(s.type==="block"){if(e==="supports"){let i=eo(s.value);if(i.length===1&&i[0].type==="declaration")return rr(i[0],n)!==void 0}return r(s.value)}return!0});return r(t)?je(t).trim():void 0}function Zr(t){return t.map((e,n)=>{let r=t[n-1],o=r?.type===":"||r?.type==="delim"&&(r.value==="."||r.value==="|");return e.type==="ident"&&!o&&Object.prototype.hasOwnProperty.call(Wr,ue(e.value))?{type:"block",open:"[",value:[{type:"ident",value:"data-graview-as"},{type:"delim",value:"="},{type:"string",value:ue(e.value)}]}:e.type==="func"?{type:"func",name:e.name,value:Zr(e.value)}:e.type==="block"&&e.open==="("?{type:"block",open:"(",value:Zr(e.value)}:e})}function nr(t,e,n,r){if(n>Ys){e({reason:"unreadable",name:"nesting"});return}if(t.type==="qualified"){if(r==="keyframes"){if(!t.prelude.every(g=>g.type==="whitespace"||g.type===","||g.type==="percentage"||g.type==="ident"&&["from","to"].includes(ue(g.value)))){e({reason:"unreadable",name:"keyframe"});return}return`${je(t.prelude).trim()} { ${Xr(t.block,e,n)} }`}if(!Zs(t.prelude,e))return;let l=je(Zr(t.prelude)).trim();if(l===""){e({reason:"unreadable",name:"selector"});return}return`${l} { ${Xr(t.block,e,n)} }`}let o=ue(t.name),s=o==="-webkit-keyframes"?"keyframes":o;if(!ba.has(s)||r==="keyframes"){e({reason:"at-rule",name:`@${o}`});return}if(!t.block){e({reason:"unreadable",name:`@${o}`});return}if(s==="keyframes"){if(r!=="sheet"){e({reason:"at-rule",name:"@keyframes"});return}let l=t.prelude.filter(w=>w.type!=="whitespace"),c=l[0];if(l.length!==1||!c||c.type!=="ident"&&c.type!=="string"){e({reason:"unreadable",name:"@keyframes"});return}let g=wt(t.block,!1).map(w=>nr(w,e,n+1,"keyframes")).filter(w=>w!==void 0);return`@keyframes ${c.type==="ident"?Nt(c.value):Wt(c.value)} { ${g.join(" ")} }`}let i=Oa(t.prelude,s,e);if(i===void 0)return;let a=r==="style"?Xr(t.block,e,n):wt(t.block,!1).map(l=>nr(l,e,n+1,"sheet")).filter(l=>l!==void 0).join(" ");return`@${s} ${i} { ${a} }`}function qt(t,e=Yt){let n=[];if(t.length>e)return{css:"",refused:[{reason:"size"}]};let r=s=>void n.push(s);return{css:wt(to(t),!0).map(s=>nr(s,r,0,"sheet")).filter(s=>s!==void 0).join(`\n`),refused:n}}function or(t,e=Yt){let n=[],r=[],o=0;for(let s of t){if(o+s.length>e){r.push({reason:"size"});continue}o+=s.length;let i=qt(s,e);i.css&&n.push(i.css),r.push(...i.refused)}return{css:n.join(`\n`),refused:r}}function sr(t,e=Yt){let n=[];if(t.length>e)return{css:"",refused:[{reason:"size"}]};let r=s=>void n.push(s),o=[];for(let s of eo(to(t))){if(s.type!=="declaration"){r({reason:"unreadable",name:"a rule in a style attribute"});continue}let i=rr(s,r,!0);i&&o.push(i)}return{css:o.join("; "),refused:n}}function ir(t,e){let n,r=rr(Xs(t,to(e)),o=>n??=o);return r===void 0||n?{refused:n??{reason:"unreadable",name:t}}:{value:r.slice(r.indexOf(":")+1).trim()}}function Js(t,e){if(e==="svg"){let r=Kn(t);return r?{namespace:"svg",name:r}:{refused:{reason:"element",element:t}}}let n=t.toLowerCase();return n==="svg"?{namespace:"svg",name:"svg"}:Object.prototype.hasOwnProperty.call(bt,n)?Object.prototype.hasOwnProperty.call(Fr,n)?{namespace:"html",name:Fr[n],as:n}:{namespace:"html",name:n}:{refused:{reason:"element",element:t}}}function ar(t,e){return(t==="html"?bt[e]:Xn[e])?.empty===!0}var Aa=/^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/,Ra=/^[0-9A-Za-z\\s.,+\\-%()]*$/,_a=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,Pa=/^data:image\\/(png|gif|jpeg|webp|avif|bmp|svg\\+xml)(;[A-Za-z0-9=._+-]+)*,/i,Ca=/^\\/graview\\/assets\\/[0-9a-f]{64}\\.(png|gif|jpe?g|webp|avif|svg|ico)$/,Qs=/\\/graview\\/assets\\/[0-9a-f]{64}\\.(png|gif|jpe?g|webp|avif|svg|ico)$/,Ia=/^\\/(?!\\/)(?!(?:.*\\/)?\\.\\.?(?:\\/|$))(?!.*%(?:2e|2f|5c))[^\\\\\\s?#"\'<>]*$/i;function Da(t,e){if(Ca.test(t))return t;let n=t;if(/^https?:\\/\\//i.test(t))try{let r=new URL(t);if(e==="null"||r.origin!==e||r.username!==""||r.password!==""||r.search!==""||r.hash!=="")return;n=t.slice(r.origin.length)}catch{return}if(Ia.test(n))return Qs.exec(n)?.[0]}function ei(t,e={},n){let r=t.length>120?`${t.slice(0,119)}\\u2026`:t,o=ti(e.origins),s=Qs.exec(t.split(/[?#]/)[0])?.[0],i=n!==void 0&&n>Ft?` It is a data: image of ${n.toLocaleString("en-US")} characters, more than the ${Ft.toLocaleString("en-US")} a view\'s own data: image may be. A picture on a record is drawn at any size by the src the host hands the view (pictures in its manifest), used as it was handed.`:s?e.assets?` It is the app\'s own image only by its path, or under the app\'s base on this page\'s origin: write it as its path, ${s}.`:" This host has not said where the app\'s own images live (asset, on the view\'s definition), so a view here cannot draw one by its path.":/^https:\\/\\//i.test(t)?o.length>0?` Its origin is not one the host lists for images (${o.join(", ")}).`:" The host lists no origin a view\'s images may come from (images.origins, on the view\'s definition).":"",a=["a data: image",...e.assets?["the app\'s own image by the path add_image answered (/graview/assets/<sha256>.<ext>)"]:[],"a picture on a record (pictures in its manifest)",...o.length>0?[`an https: image from ${o.join(", ")}`]:[]];return`The image "${r}" was not drawn.${i} A view here shows ${a.slice(0,-1).join(", ")} or ${a[a.length-1]}.`}function ti(t){return(t??[]).flatMap(e=>{try{let n=new URL(e);return n.protocol==="https:"&&n.hostname!==""&&n.username===""&&n.password===""?[n.origin]:[]}catch{return[]}})}function Ma(t,e){if(!(!e||e.length===0||!/^https:\\/\\//i.test(t)))try{let n=new URL(t);return n.protocol!=="https:"||n.username!==""||n.password!==""?void 0:ti(e).includes(n.origin)?n.href:void 0}catch{return}}function ro(t,e,n,r,o){let s=Zn(t,e,n);if(!s)return{refused:{reason:"attribute",element:e,name:n}};if(t==="html"&&qn[e]?.includes(s.name))return{refused:{reason:"attribute",element:e,name:n}};if(r===null)return{name:s.name,value:null};let i=La(s.name,s.kind,r,o);return"refused"in i?{refused:{...i.refused,element:e,...s.kind==="image"&&i.refused.reason==="url"?{address:r.slice(0,200),...r.length>Ft?{length:r.length}:{}}:{},...s.kind==="link"?{address:r.slice(0,200)}:{}}}:s.name==="role"&&i.value.split(/\\s+/).some(a=>us.includes(a.toLowerCase()))?{refused:{reason:"value",element:e,name:n}}:s.name==="aria-live"&&!["polite","off"].includes(i.value.toLowerCase())?{refused:{reason:"value",element:e,name:n}}:{name:s.name,value:i.value,...i.dropped?{dropped:i.dropped.map(a=>({reason:a.reason==="url"?"url":"css",element:e,name:s.name,css:a}))}:{}}}function La(t,e,n,r){let o=(s,i)=>({refused:{reason:s,name:t,...i?{css:i}:{}}});if(e==="geometry")return n.length>ms||!Ra.test(n)||/url/i.test(n)?o("value"):{value:n};if(e==="image"){let s=r.picture?.(n);if(s!==void 0)return{value:s};if(n.length>Ft)return o("url");if(Pa.test(n))return{value:n};if(n.startsWith(`blob:${r.origin}/`)&&/^blob:[^\\s"\'<>]+$/.test(n))return{value:n};let i=r.asset?Da(n,r.origin):void 0;if(i!==void 0){let l=r.asset(i);if(l)return{value:l}}let a=Ma(n,r.imageOrigins);return a?{value:a}:o("url")}if(e==="link"){let s=r.link?.(n);return s===void 0?o("url"):{value:s}}if(n.length>Vr)return o("value");if(typeof e=="object"){let s=e.oneOf.find(i=>i.toLowerCase()===n.toLowerCase());return s===void 0?o("value"):{value:s}}switch(e){case"text":return{value:n};case"number":return Aa.test(n.trim())&&Number.isFinite(Number(n))?{value:n.trim()}:o("value");case"boolean":return{value:""};case"fragment":return _a.test(n)?{value:n}:o("url");case"style":{let s=sr(n,Vr);return s.refused.length>0&&s.css===""?o(s.refused[0].reason==="url"?"url":"css",s.refused[0]):{value:s.css,...s.refused.length>0?{dropped:s.refused}:{}}}case"css":{let s=ir(t,n);return"refused"in s?o(s.refused.reason==="url"?"url":"css",s.refused):{value:s.value}}}}var $a="http://www.w3.org/1999/xhtml",Ha=new Set(["button","submit","reset","checkbox","radio","image"]);var lr=(t,...e)=>t.namespaceURI===$a&&e.includes(t.localName),Ua=t=>(t.getAttribute("type")??"text").toLowerCase(),Ga=t=>lr(t,"textarea","select")||lr(t,"input")&&!Ha.has(Ua(t));function ni(t){if(lr(t,"option","optgroup","datalist"))return\'An option is never pressed by itself: put data-act on its select, with data-save="change", or on a button.\';if(lr(t,"label"))return"A press on a label presses its field too, and would ask for the act twice: put data-act on a button, or on the field.";if(Ga(t)&&!t.hasAttribute("data-save"))return\'A click into a field to type or to pick is not a press: give it data-save ("input" or "change") to save it as it is typed, or put data-act on a button beside it.\'}var ja="http://www.w3.org/1999/xhtml",Tt=class{constructor(e){this.ownerDocument=e}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof Ke?this.parentNode:null}get textContent(){return this.childNodes.map(e=>e.textContent).join("")}insertBefore(e,n){e.parentNode&&e.parentNode.removeChild(e);let r=n?this.childNodes.indexOf(n):-1;return r<0?this.childNodes.push(e):this.childNodes.splice(r,0,e),e.parentNode=this,e}appendChild(e){return this.insertBefore(e,null)}removeChild(e){let n=this.childNodes.indexOf(e);return n>=0&&this.childNodes.splice(n,1),e.parentNode=null,e}},qe=class extends Tt{constructor(n,r){super(n);this.data=r}nodeType=3;get textContent(){return this.data}},oo=class extends Tt{nodeType=8;get textContent(){return""}},Ke=class extends Tt{constructor(n,r,o){super(n);this.namespaceURI=r;this.localName=o}nodeType=1;attributes=new Map;value="";checked=!1;selected=!1;setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.get(n)??null}hasAttribute(n){return this.attributes.has(n)}closest(n){for(let r=this;r;r=r.parentElement)if(r.localName===n)return r;return null}},so=class extends Tt{nodeType=9;constructor(){super(null)}createElementNS(e,n){return new Ke(this,e,n)}createElement(e){return new Ke(this,ja,e)}createTextNode(e){return new qe(this,e)}createComment(e){return new oo(this)}};function ri(){let t=new so,e=t.createElement("div");return e.setAttribute("data-graview-view-root",""),t.appendChild(e),{document:t,root:e}}var za=new Set(["video/mp4","video/webm","video/ogg"]);function Fa(t,e){let n=t.poster===!0||typeof t.poster=="string"&&t.poster.length>0,r=za.has(t.type.toLowerCase()),o=!r&&!n?`its source is ${t.type}, which not every browser plays, and it has no poster`:r?n?void 0:"it has no poster, so nothing stands before it plays or where a person asked for less motion":`its source is ${t.type}, which not every browser plays`;return{record:e.record,field:e.field,text:typeof t.caption=="string"&&t.caption.trim()?t.caption.trim():t.name,name:t.name,source:t.type,...typeof t.duration=="number"?{duration:t.duration}:{},poster:n,autoplay:e.autoplay,cover:e.cover,playable:r&&n,...o?{why:o}:{}}}var io={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},oi=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr","label"]),si=new Set(["style","template","datalist","option"]),X=t=>t.replace(/\\s+/g," ").trim();function Va(t){let e=t.duration===void 0?0:Math.round(t.duration);if(e<1)return"a video";if(e<60)return`a ${e}-second video`;let n=Math.round(e/60);return n<60?`a ${n}-minute video`:`a ${Math.floor(n/60)}-hour${n%60>0?` ${n%60}-minute`:""} video`}var de=t=>t instanceof Ke,Kt=t=>t.hasAttribute("hidden")||t.getAttribute("aria-hidden")==="true";function re(t){return t instanceof qe?t.data:!de(t)||Kt(t)||si.has(t.localName)?"":t.localName==="br"?" ":t.localName==="img"?t.getAttribute("alt")??"":t.childNodes.map(re).join(t.localName==="td"||t.localName==="th"?" ":"")}var Ba=/(\\s+[\xB7\u2022|\u2014\u2013-]\\s+)/;function Ya(t,e){if(!e||!t.includes(e))return t;let n=s=>s.length>0&&s.split(" ").length<=3,r=X(t).split(Ba),o=[];for(let s=0;s<r.length;s+=2){let i=r[s],a=i.startsWith(`${e} `)?i.slice(e.length+1):void 0,l=i.endsWith(` ${e}`)?i.slice(0,-e.length-1):void 0,c=i===e?"":a!==void 0&&n(a)?a:l!==void 0&&n(l)?l:i;c&&o.push(...o.length>0?[r[s-1]]:[],c)}return o.join("")}function ii(t,e,n){let r=[];for(let o of t){if(o.t==="list"&&o.groups.every(s=>s.items.every(i=>i.id===e&&i.title===n))){r.push(...ii(o.groups.flatMap(s=>s.items.flatMap(i=>i.parts)),e,n));continue}if(o.t==="text"){let s=Ya(o.text,n);s&&r.push(s===o.text?o:{...o,text:s});continue}r.push(o)}return r}function*Ze(t){for(let e of t.childNodes)de(e)&&(yield e,yield*Ze(e))}function Wa(t){let e=t.getAttribute("data-save"),n=t.getAttribute("data-debounce");if(e===null&&n===null)return[];let r=`drawing <${t.localName}${e!==null?` data-save="${e}"`:` data-debounce="${n}"`}>`,o=[];if(e===null)return[{at:r,says:\'data-debounce is read only on a field that saves as it is typed (data-save="input").\'}];if(!["input","textarea","select"].includes(t.localName))o.push({at:r,says:"Only a field saves as it is typed: an input, a textarea or a select. A button is pressed (data-act alone)."});else if(e!=="input"&&e!=="change")o.push({at:r,says:`data-save is "input" (saved as the person types, once they pause, and when they leave it) or "change" (saved when they leave it or pick), not "${e}".`});else if(t.getAttribute("data-act")===null)o.push({at:r,says:\'It saves through no act: a field saved as it is typed names its act itself, data-act="\\u2026", one in the manifest.\'});else if(!t.getAttribute("name"))o.push({at:r,says:"It has no name: the host sends a field as the act\'s argument its name says."});else{let s=!1,i=!1;for(let a=t;a;a=a.parentElement)a.getAttribute("data-record")!==null&&(i=!0),a!==t&&(a.localName==="fieldset"||a.getAttribute("role")==="group")&&(s=!0);(!s||!i)&&o.push({at:r,says:\'It is in no fieldset bound to a record: the host saves a field inside <fieldset data-record="\\u2026">, with the fields beside it, to the record the fieldset names.\'})}return n!==null&&e!=="input"?o.push({at:r,says:\'data-debounce is read only with data-save="input": a "change" saves at once.\'}):n!==null&&!(n.trim()!==""&&Number.isFinite(Number(n))&&Number(n)>=250&&Number(n)<=1e4)&&o.push({at:r,says:`data-debounce is how long the host waits for the person to pause, in milliseconds from 250 to 10 000, not "${n}"; left out, it waits 1 000.`}),o}function Xa(t,e,n){let r=t.getAttribute("data-drop");if(r===null)return[];let o=`drawing <${t.localName} data-drop="${r}">`,s=[],i=(e.accepts??[]).filter(c=>c.kind===r),a=t.getAttribute("data-drop-field");i.length===0?s.push({at:o,says:`The view\'s accepts names no field of "${r}", so the host offers no drop target here: say the field files go in, accepts: [{ "kind": "${r}", "field": "<its image, video or file field>" }].`}):a!==null&&!i.some(c=>c.field===a)&&s.push({at:o,says:`data-drop-field names "${a}", which the view\'s accepts does not name for "${r}" (${i.map(c=>`"${c.field}"`).join(", ")}): the host offers no drop target here.`});let l=t.getAttribute("data-drop-connect");if(l!==null){let c=l.indexOf(":"),g=c>0?l.slice(c+1):"";c<=0||g===""||n.has(l)?s.push({at:o,says:`data-drop-connect is "<relation>:<record id>" \\u2014 "takenOn:day:saturday" \\u2014 not "${l}"${n.has(l)?", which names a record and no relation":""}.`}):n.has(g)||s.push({at:o,says:`data-drop-connect names "${g}", which this seat was not shown: the host offers no drop target here.`})}return s}function ai(t,e){let n=[],r=new Set,o=new Set,s=[],i=new Map;for(let f of[...e.props.node?[e.props.node]:[],...e.props.nodes??[]])i.set(f.id,f);let a=f=>Vt(e.places,f)!==void 0;for(let f of Ze(t)){let R=f.getAttribute("data-act");R!==null&&r.add(R);let u=R!==null&&f.getAttribute("data-debounce")===null?ni(f):void 0;u&&n.push({at:`drawing <${f.localName} data-act="${R}">`,says:u});let y=f.getAttribute("data-record");y!==null&&(o.add(y),!i.has(y)&&!a(y)&&n.push({at:`drawing <${f.localName} data-record="${y}">`,says:e.placesUnsure?`It names "${y}", which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${xe(e.places)}${Et}`:`It names "${y}", which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${xe(e.places)}`}));let O=f.getAttribute("data-place");O!==null&&!a(O)&&n.push({at:`drawing <${f.localName} data-place="${O}">`,says:e.placesUnsure?`It names the place "${O}", which is none of the places this run was told of.${xe(e.places)}${Et}`:`It names the place "${O}", which this app does not have.${xe(e.places)}`}),n.push(...Wa(f)),n.push(...Xa(f,e,i))}let l=f=>{if(f.localName==="graview-video")return;let R=f.getAttribute("data-record");if(R!==null)return R;let u=f.getAttribute("data-key")??f.getAttribute("id");if(u!==null&&i.has(u))return u;let y=new Set;for(let O of Ze(f)){let p=O.getAttribute("data-record");p!==null&&O.localName!=="graview-video"&&y.add(p)}return y.size===1?[...y][0]:void 0},c=(f,R)=>{let u=i.get(R),y=u?.kind??(R.includes(":")?R.slice(0,R.indexOf(":")):""),O=[...Ze(f)],p=O.find(x=>x.localName in io)??O.find(x=>x.localName==="a"&&x.getAttribute("data-record")===R)??O.find(x=>x.localName==="strong"||x.localName==="b"),E=X(p?re(p):"")||u?.label||R;return{id:R,kind:y,title:E,parts:ii(h(f,p),R,E)}},g=f=>{let R=[...Ze(f)].filter(p=>p.localName==="tr"&&!Kt(p)),u=R.find(p=>p.parentElement?.localName==="thead"||p.childNodes.every(E=>!de(E)||E.localName==="th")),y=u?u.childNodes.filter(de).map(p=>X(re(p))):[];return{t:"list",as:"row",columns:1,groups:[{items:R.filter(p=>p!==u).map(p=>{let E=p.childNodes.filter(de),x=l(p),m=x?i.get(x):void 0;return{id:x??"",kind:m?.kind??"",title:X(re(E[0]??p)),parts:E.slice(1).map((k,N)=>({t:"field",label:y[N+1]??"",text:X(re(k))}))}})}]}};function h(f,R){let u=[],y="",O=()=>{let E=X(y);y="",E&&u.push({t:"text",text:E})},p=f.childNodes;for(let E=0;E<p.length;E+=1){let x=p[E];if(x===R)continue;if(x instanceof qe){y+=x.data;continue}if(!de(x)||Kt(x)||si.has(x.localName))continue;if(R&&[...Ze(x)].includes(R)){O(),u.push(...h(x,R));continue}let m=[];for(let k=E;k<p.length;k+=1){let N=p[k];if(N instanceof qe&&X(N.data)==="")continue;if(!de(N)||Kt(N)||oi.has(N.localName)||N.localName in io)break;let C=l(N);if(!C)break;m.push({element:N,id:C}),E=k}if(m.length>0){O();let k=m.every(N=>N.element.localName==="li"||N.element.localName==="tr");u.push({t:"list",as:k?"row":"card",columns:1,groups:[{items:m.map(N=>c(N.element,N.id))}]});continue}u.push(...w(x,k=>y+=k,O))}return O(),u}function w(f,R,u){let y=f.localName;if(oi.has(y)&&y!=="label")return R(re(f)),[];if(y==="mark"){u();let p=X(re(f));return p?[{t:"badge",text:p}]:[]}u();let O=io[y]??(f.getAttribute("role")==="heading"?Number(f.getAttribute("aria-level")??2):void 0);if(O!==void 0){let p=X(re(f));return p?[{t:"heading",level:O,text:p}]:[]}switch(y){case"ul":case"ol":case"menu":return[{t:"list",as:"row",columns:1,groups:[{items:f.childNodes.filter(E=>de(E)&&E.localName==="li"&&!Kt(E)).map(E=>{let x=l(E);if(x)return c(E,x);let m=h(E),k=m[0],N=k&&(k.t==="text"||k.t==="heading")?k.text:"";return{id:"",kind:"",title:N,parts:N?m.slice(1):m}})}]}];case"table":return[g(f)];case"dl":{let p=[],E="";for(let x of f.childNodes.filter(de))if(x.localName==="dt")E=X(re(x));else if(x.localName==="dd")p.push({t:"field",label:E,text:X(re(x))});else if(x.localName==="div")for(let m of x.childNodes.filter(de))m.localName==="dt"?E=X(re(m)):m.localName==="dd"&&p.push({t:"field",label:E,text:X(re(m))});return p}case"figure":{let p=f.childNodes.find(m=>de(m)&&m.localName==="figcaption"),E=X(f.childNodes.filter(m=>m!==p).map(re).join(" ")),x=p?X(re(p)):"";return E?[{t:"figure",text:E,...x?{label:x}:{}}]:x?[{t:"text",text:x}]:[]}case"meter":case"progress":{let p=Number(f.getAttribute("value")??0),E=Number(f.getAttribute("max")??1)||1;return[{t:"progress",label:f.getAttribute("aria-label")??f.getAttribute("title")??"",text:`${Math.round(p/E*100)}%`}]}case"svg":{let p=f.childNodes.find(m=>de(m)&&m.localName==="title"),E=X(f.getAttribute("aria-label")??(p?re(p):""));if(E)return[{t:"text",text:E,tone:"picture"}];let x=[...Ze(f)].filter(m=>m.localName==="text").map(m=>X(re(m))).filter(Boolean);return x.length>0?[{t:"text",text:x.join(" \\xB7 "),tone:"picture"}]:[]}case"img":{let p=X(f.getAttribute("alt")??"");return p?[{t:"text",text:p,tone:"picture"}]:[]}case"graview-video":{let p=f.getAttribute("data-field")??"",E=f.getAttribute("data-record")??"",x=i.get(E),m=x&&p&&Object.hasOwn(x,p)?x[p]:void 0,k=(Array.isArray(m)?m:[m])[Number(f.getAttribute("data-index")??"0")];if(!k||typeof k.name!="string"||typeof k.type!="string"||!k.type.startsWith("video/"))return n.push({at:`drawing <graview-video data-field="${p}">`,says:"It names no video on a record this seat was shown: the host draws no player there. A <graview-video> names a record the view was shown (data-record) and its video field (data-field)."}),[];let N=Fa(k,{record:E,field:p,autoplay:f.getAttribute("autoplay")!==null,cover:f.getAttribute("cover")!==null});s.push(N);let C=N.autoplay?`, playing as a background, muted and looping${N.cover?", filling its box":""}`:"";return[{t:"text",text:`${N.text}, ${Va(N.duration!==void 0?{duration:N.duration}:{})}${C}`,tone:"picture"}]}case"button":{let p=X(re(f));return p?[{t:"text",text:p,tone:"button"}]:[]}case"input":case"textarea":case"select":{let p=X(f.getAttribute("aria-label")??f.getAttribute("placeholder")??f.getAttribute("name")??""),E=y==="select"?X(re(f.childNodes.find(x=>de(x)&&x.localName==="option"&&x.selected)??f)):f.value;return[{t:"field",label:p,text:E}]}case"label":return h(f);default:return h(f)}}return{parts:h(t),problems:n,acts:[...r],records:[...o],videos:s}}var qa=0,Ka=1,Za=2,Ja=3,li=1,Qa=2,ci=3,el=1,tl=3,nl=8,di="~",Zt=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),ui=new Set(["input","select","textarea","option"]),rl=new Set(["value","checked","selected"]),fi=["aria-label","aria-labelledby","title"],ol=t=>fi.some(e=>(t.getAttribute(e)??"").trim()!=="");function pi(t,e){let n=t.ownerDocument??t,r=e.maxNodes??5e3,o=[],s=new Map,i=new WeakMap,a={dom:t,name:"div",namespace:"html",children:[],id:di};s.set(di,a);let l=0,c=!1,g=new WeakMap,h=new Map,w=new Map,b=m=>{o.push(m),o.length>200&&o.shift(),e.onRefused?.(m)},f=()=>({dom:n.createComment(""),children:[],refused:!0}),R=(m,k)=>{if(m.namespace==="html"&&m.name&&ui.has(m.name))return m.dom;if(k?.namespace==="html"&&k.name==="textarea")return k.dom},u=(m,k)=>{let N=m.dom,C=g.get(N)??N.getAttribute("role");if(C===null||!C.split(/\\s+/).some(P=>fs.includes(P.toLowerCase())))return void g.delete(N);if(ol(N)){g.delete(N),N.getAttribute("role")!==C&&N.setAttribute("role",C);return}g.set(N,C),N.removeAttribute("role"),k&&b({reason:"value",element:m.name,name:"role"})},y=()=>{if(w.size===0)return;let m=new Set,k=N=>{for(let C of N.children){if(C.refused||C.text)continue;let P=C.dom.getAttribute("id");P&&m.add(P),k(C)}};k(a);for(let[N,C]of w){if(N.id===void 0||s.get(N.id)!==N){w.delete(N);continue}let P=N.dom;for(let[v,j]of C){let $=j.value.split(/\\s+/).filter(J=>J!==""),V=$.filter(J=>!m.has(J));if($.length>0&&V.length===0){if(j.drawn)continue;j.drawn=!0,P.setAttribute(v,j.value),u(N,!1)}else j.drawn&&(j.drawn=!1,P.removeAttribute(v),b({reason:"reference",element:N.name,name:v,ids:V.length>0?V:$}),u(N,!0))}}},O=(m,k,N,C=!0)=>{let P=m.dom;if(N!=null&&typeof N!="string")return b({reason:"value",element:m.name,name:k});let v=ro(m.namespace,m.name,k,N??null,e);if("refused"in v){let J=ro(m.namespace,m.name,k,null,e);return"refused"in J||P.removeAttribute(J.name),!("refused"in J)&&J.name==="role"&&g.delete(P),b(v.refused)}for(let J of v.dropped??[])b(J);let j=m.namespace==="html"&&rl.has(v.name)&&ui.has(m.name),$=P,V=j?v.name==="value"?$.value:v.name==="checked"?$.checked:$.selected:void 0;if(v.name==="role"&&g.delete(P),ps.includes(v.name)){let J=w.get(m)??new Map;v.value===null?J.delete(v.name):J.set(v.name,{value:v.value,drawn:!0}),J.size>0?w.set(m,J):w.delete(m)}v.value===null?P.removeAttribute(v.name):P.setAttribute(v.name,v.value),C&&(v.name==="role"||fi.includes(v.name))&&u(m,v.name==="role"),e.onAttribute?.(P,v.name),j&&(v.name==="value"&&"value"in $?($.value=v.value??"",V!==$.value&&e.onFieldSet?.(P)):v.name==="checked"&&"checked"in $?($.checked=v.value!==null,V!==$.checked&&e.onFieldSet?.(P)):v.name==="selected"&&"selected"in $&&($.selected=v.value!==null,V!==$.selected&&e.onFieldSet?.(P.parentElement?.closest("select")??P)))},p=m=>{if(!m.refused){l-=1,m.id!==void 0&&s.delete(m.id);for(let k of m.children)p(k)}},E=(m,k)=>{if(!Zt(m)||typeof m.id!="string"||s.has(m.id))return b({reason:"record"}),f();if(l>=r)return b({reason:"budget"}),c||(c=!0,e.onOverBudget?.()),f();let N=m.id;if(m.type===nl)return f();if(m.type===tl){if(ar(k.namespace,k.name))return b({reason:"child",element:k.name}),f();let $=n.createTextNode(String(m.data??"").slice(0,Br)),V={dom:$,children:[],text:!0,id:N,parent:k};return s.set(N,V),i.set($,N),l+=1,V}if(m.type!==el)return b({reason:"record"}),f();let C=String(m.element);if(ar(k.namespace,k.name))return b({reason:"child",element:C}),f();let P=Js(C,k.namespace);if("refused"in P)return b(P.refused),f();let v=n.createElementNS(P.namespace==="svg"?hs:gs,P.name);P.as&&v.setAttribute("data-graview-as",P.as),P.namespace==="html"&&P.name==="img"&&v.setAttribute("referrerpolicy","no-referrer"),P.namespace==="html"&&P.name==="a"&&(v.setAttribute("target","_blank"),v.setAttribute("rel","noopener noreferrer"),v.setAttribute("referrerpolicy","no-referrer"));let j={dom:v,name:P.name,namespace:P.namespace,children:[],id:N,parent:k};if(s.set(N,j),i.set(v,N),l+=1,Zt(m.attributes)){for(let[$,V]of Object.entries(m.attributes))O(j,$,V,!1);u(j,!0)}if(e.decorate?.(v,P.name,P.namespace),Zt(m.properties))for(let $ of Object.keys(m.properties))b({reason:"attribute",element:P.name,name:$});if(Zt(m.eventListeners))for(let $ of Object.keys(m.eventListeners))m.eventListeners[$]!=null&&b({reason:"attribute",element:P.name,name:`on${$}`});if(Array.isArray(m.children))for(let $ of m.children){let V=E($,j);j.children.push(V),v.appendChild(V.dom)}return j},x=m=>{if(!Array.isArray(m))return b({reason:"record"});let[k,N]=m,C=typeof N=="string"?s.get(N):void 0;if(!C)return b({reason:"record"});switch(k){case qa:{if(C.text)return b({reason:"record"});let P=Number(m[3]),v=Number.isInteger(P)&&P>=0&&P<=C.children.length?P:C.children.length,j=m[2],$=Zt(j)&&typeof j.id=="string"?h.get(j.id):void 0,V;$&&$.parent?.namespace===C.namespace&&!ar(C.namespace,C.name)?(h.delete(j.id),$.parent=C,V=$):V=E(j,C),C.dom.insertBefore(V.dom,C.children[v]?.dom??null),C.children.splice(v,0,V),C.namespace==="html"&&C.name==="textarea"&&e.onFieldSet?.(C.dom);return}case Ka:{let P=Number(m[2]),v=C.children[P];if(!v)return b({reason:"record"});C.children.splice(P,1),v.dom.parentNode?.removeChild(v.dom),v.id!==void 0&&!v.refused?h.set(v.id,v):p(v);return}case Za:{if(!C.text)return b({reason:"record"});C.dom.data=String(m[2]??"").slice(0,Br);let P=R(C,C.parent);P&&e.onFieldSet?.(P);return}case Ja:{if(C===a||C.text)return b({reason:"record"});let P=String(m[2]),v=m[4]??li;return v===Qa?O(C,P,m[3]):b(v===li||v===ci?{reason:"attribute",element:C.name,name:v===ci?`on${P}`:P}:{reason:"record"})}default:return b({reason:"record"})}};return{apply(m,k){if(!Array.isArray(m))return b({reason:"record"}),!0;try{for(let N=0;N<m.length;N+=1){if(k&&N%32===0&&k())return!1;x(m[N])}return!0}finally{for(let N of h.values())p(N);h.clear(),y()}},get refused(){return o},get size(){return l},idOf:m=>i.get(m),elementOf(m){let k=s.get(m);return k&&!k.text&&k!==a?k.dom:void 0},dispose(){for(let m of a.children)p(m);for(a.children.length=0;t.firstChild;)t.removeChild(t.firstChild)}}}var sl="@layer graview-motion, graview-region, graview-view, graview-theme;",il=new Set(["media","supports","container","keyframes","-webkit-keyframes"]),al=new Set(["src","image-set","-webkit-image-set"]),ll={"}":"{",")":"(","]":"["};function gi(t){let e=[],n=Xt(t);for(let[r,o]of n.entries())switch(o.type){case"bad-string":case"bad-url":case"url":case"CDO":case"CDC":return!1;case"delim":if(o.value==="\\\\")return!1;break;case"at-keyword":if(!il.has(o.value.toLowerCase()))return!1;break;case";":if(e.length===0)return!1;break;case"function":{let s=o.value.toLowerCase();if(al.has(s))return!1;if(s==="url"){let i=n[r+1];if(i?.type!=="string"||!i.value.startsWith("#"))return!1}e.push("(");break}case"{":case"(":case"[":e.push(o.type);break;case"}":case")":case"]":if(e.pop()!==ll[o.type])return!1;break;default:}return e.length===0}function mi(t,e){return e.trim()===""||!gi(e)?"":`@layer ${t} {\n${e}\n}`}function hi(t,e){return t.trim()===""?gi(e)?e:"":[sl,mi("graview-theme",t),mi("graview-view",e)].filter(n=>n!=="").join(`\n`)}function yi(t,e,n){let{root:r}=ri(),o=!1,s=pi(r,{origin:n.origin??"null",...n.imageOrigins?{imageOrigins:n.imageOrigins}:{},...n.asset?{asset:n.asset}:{},...n.link?{link:n.link}:{},maxNodes:n.maxNodes,onOverBudget:()=>o=!0});for(let g of t)s.apply(g);let i=[...s.refused],a="";if(e){let g=or(e);a=g.css;for(let h of g.refused)i.push({reason:"css",name:"stylesheet",css:h})}let l=n.theme?qt(n.theme).css:"",c=hi(l,a);return{root:r,refused:i,size:s.size,over:o,css:c,elementOf:g=>s.elementOf(g),idOf:g=>s.idOf(g)}}var cr=" SMIL can set an attribute after the host judged it, and runs past a person\'s reduced-motion setting: animate with CSS @keyframes, which is held to it.",bi={animate:cr,animateTransform:cr,animateMotion:cr,set:cr,feImage:" It loads an image: a filter here is made of the view\'s own pixels.","@property":" It registers a property for the whole page, the app\'s own --graview-* among them: animate a transform, an opacity or a color in @keyframes.","a href":" An <a> in SVG goes to a record or a place (data-record, data-place); a link out is an HTML <a href>.",role:` A role of the app\'s chrome or notices is the app\'s; role="region" is drawn while it has a name (aria-label).`};function cl(t,e={}){let n="element"in t&&t.element?`<${t.element}>`:"",r=t.name?` ${t.name}`:"",o=s=>s&&Object.prototype.hasOwnProperty.call(bi,s)?bi[s]:"";switch(t.reason){case"element":return{at:`drawing ${n}`,says:`Not drawn: ${n} is not in the open kit.${o("element"in t?t.element:void 0)}`};case"attribute":return{at:`drawing ${n}${r}`,says:`Not drawn: ${n||"an element"} does not take${r}.${o(`${"element"in t?t.element:""}${r}`)}`};case"value":return{at:`drawing ${n}${r}`,says:`Not drawn: the value of${r} is not one the open kit takes.${o(t.name)}`};case"url":return"element"in t&&t.element==="a"&&t.address!==void 0?{at:`drawing ${n}${r}`,says:`Not drawn: ${_s(t.address,e.linkOrigins)}`}:{at:`drawing ${n}${r}`,says:t.address!==void 0&&"element"in t&&t.element==="img"?`Not drawn: ${ei(t.address,e,"length"in t?t.length:void 0)}`:"Not drawn: an address. A view loads nothing; an image is a data: image."};case"child":return{at:`drawing ${n}`,says:`Not drawn: ${n} holds nothing.`};case"record":return{at:"drawing",says:"Not drawn: a record the drawing\'s format does not know."};case"budget":return{at:"drawing",says:"Not drawn: more nodes than a view may draw."};case"reference":{let s="ids"in t&&t.ids?t.ids:[],i=s.length>0?s.map(a=>`"${a}"`).join(", "):"no id";return{at:`drawing ${n}${r}`,says:`Not drawn: ${n||"an element"}${r} names ${i}, ${s.length===1?"which is":"which are"} no element of this view. It names elements the view draws itself, by their id (<h2 id="\\u2026">), drawn once each is there.`}}case"css":return{at:`stylesheet${r===" stylesheet"?"":r}`,says:`Not drawn: CSS the open kit leaves out${t.css?` (${t.css.reason}${t.css.name?` ${t.css.name}`:""})`:""}.${o(t.css?.name)}`}}}function Ei(t,e,n={}){let{limits:r}=e;if(t.messages>r.messages)return{ok:!1,reason:"flood",detail:`It sent ${t.messages} messages, more than the ${r.messages} a view may send in a second.`};let o=new Set(e.acts);for(let h of t.asked)if(!o.has(h.name))return{ok:!1,reason:"act",detail:`It asks for the act "${h.name}", which its manifest does not name.`};let s=Os(e.props),i=yi(t.renders,t.sheets,{maxNodes:r.maxNodes,...e.origin?{origin:e.origin}:{},...e.imageOrigins?{imageOrigins:e.imageOrigins}:{},...e.assets?{asset:h=>h}:{},...n.theme?{theme:n.theme}:{},link:h=>Rs(h,{handed:s,...e.linkOrigins?{origins:e.linkOrigins}:{}})});if(i.over)return{ok:!1,reason:"nodes",detail:`It drew more than the ${r.maxNodes.toLocaleString("en-US")} things a view may draw.`};let a=[...e.places,...(e.lists??[]).filter(h=>!e.places.some(w=>w.as===h)).map(h=>({as:h}))],l=e.placesUnsure===!0,c=ai(i.root,{props:e.props,places:a,...l?{placesUnsure:!0}:{},...e.accepts?{accepts:e.accepts}:{}});for(let h of c.acts)if(!o.has(h))return{ok:!1,reason:"act",detail:`It binds a press to the act "${h}" (data-act), which its manifest does not name.`};let g=[...i.refused.map(h=>cl(h,{...e.imageOrigins?{origins:e.imageOrigins}:{},assets:e.assets===!0,...e.linkOrigins?{linkOrigins:e.linkOrigins}:{}})),...c.problems];for(let h of t.went)"record"in h&&!(e.props.node?.id===h.record||(e.props.nodes??[]).some(w=>w.id===h.record)||Vt(a,h.record))&&g.push({at:"navigate",says:l?`It goes to ${Bt(h.record)}, which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${xe(a)}${Et}`:`It goes to ${Bt(h.record)}, which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${xe(a)}`}),"place"in h&&!Vt(a,h.place)&&g.push({at:"navigate",says:l?`It goes to the place ${Bt(h.place)}, which is none of the places this run was told of.${xe(a)}${Et}`:`It goes to the place ${Bt(h.place)}, which this app does not have.${xe(a)}`});return{ok:!0,parts:c.parts,problems:g,drawn:i,videos:c.videos}}var ao="graviewHeadless",lo="graviewHeadlessView";var Ti=globalThis,dl=Promise.prototype.then,ul=Promise.resolve(),Jt=t=>void dl.call(ul,t),dr=Ti.performance,Qt=dr&&typeof dr.now=="function"?dr.now.bind(dr):Date.now,Je=JSON.stringify,xi=JSON.parse,fl=Object.defineProperty,ur=t=>(t instanceof Error?`${t.name}: ${t.message}`:String(t)).slice(0,500),xt=t=>{try{return xi(Je(t??null))}catch{return null}},F={renders:[],asked:[],went:[],ms:0,logs:[],messages:0},Se,en=(t,e)=>{Se??={reason:t,detail:e}},Qe=t=>{F.logs.length<50&&F.logs.push(t.slice(0,500))},St={removed:[],stuck:[],sealed:!1},co=new Map,et=xs({send(t){if(F.messages+=1,t.type==="mine"){let e=t.id,n=t.op==="set"?Qo(t.key,t.value):void 0;n?Qe(n):t.op==="set"&&t.value===null?co.delete(t.key):t.op==="set"&&co.set(t.key,t.value),Jt(()=>et.hear(n?{type:"mine-answer",id:e,ok:!1,sentence:n}:{type:"mine-answer",id:e,ok:!0,...t.op==="get"?{value:co.get(t.key)??null}:{}}))}else t.type==="render"?F.renders.push(xt(t.records)):t.type==="style"?F.sheets=(xt(t.sheets)??[]).map(String):t.type==="gestures"?F.gestures=xt(t.bound):t.type==="navigate"&&"place"in t?F.went.push({place:String(t.place),...t.where!==void 0?{where:xt(t.where)}:{},...t.section!==void 0?{section:String(t.section)}:{}}):t.type==="navigate"&&"to"in t&&F.went.push({record:String(t.to),...t.where!==void 0?{where:xt(t.where)}:{},...t.section!==void 0?{section:String(t.section)}:{}})},act(t,e){return F.messages+=1,F.asked.push({name:String(t),args:xt(e)}),Promise.resolve({type:"answer",id:F.asked.length,ok:!1,reason:"refused",message:"Nothing is applied in a headless run."})},navigate(t){F.messages+=1,F.went.push({record:String(t)})},microtask:Jt,now:Qt,threw:t=>en("error",`It threw: ${ur(t)}`),warn:Qe,hardening:()=>St}),wi=!1,uo=!1;function pl(t){if(uo||typeof t!="function"||(uo=!0,Se))return;let e=Qt();try{t.call(void 0,et.view)}catch(n){en("error",`It threw: ${ur(n)}`)}F.ms+=Qt()-e}async function ml(t){if(wi)return Je({ok:!1,reason:"refused",detail:"A headless script runs one view, once: something called its entry before the host did."});wi=!0;let e;try{e=xi(String(t))}catch{return Je({ok:!1,reason:"isolate",detail:"The run was not handed its input as JSON."})}if(!uo&&!Se)return Je({ok:!1,reason:"isolate",detail:"The script held no view."});let n=Qt();Se||et.hear({type:"props",props:e.props,push:1}),F.ms+=Qt()-n,F.ms>=e.limits.pushMs&&en("slow",`It took longer than ${e.limits.pushMs.toLocaleString("en-US")} ms to draw what it was shown.`);for(let o=0;o<64&&!Se;o+=1)await new Promise(s=>Jt(s));if(Se||(F.clicks=et.listened("click").slice(0,2e3)),e.press&&typeof e.press.selector=="string"&&!Se){let o=typeof e.press.target=="string"?e.press.target:et.find(e.press.selector);if(F.pressed={selector:e.press.selector.slice(0,200),...o!==void 0?{target:o}:{},asked:F.asked.length,went:F.went.length,renders:F.renders.length},o!==void 0){try{et.hear({type:"dom-event",target:o,event:"click"})}catch(s){en("error",`It threw: ${ur(s)}`)}for(let s=0;s<64&&!Se;s+=1)await new Promise(i=>Jt(i))}}if(Se)return Je({ok:!1,...Se,transcript:F});let r=Ei(F,e);return r.ok?Je({ok:!0,transcript:F,drawn:{parts:r.parts,problems:r.problems},hardening:{removed:St.removed.length,sealed:St.sealed}}):Je({ok:!1,reason:r.reason,detail:r.detail,transcript:F})}var gl=Object.freeze({log:(...t)=>Qe(t.map(String).join(" ")),info:(...t)=>Qe(t.map(String).join(" ")),debug:(...t)=>Qe(t.map(String).join(" ")),warn:(...t)=>Qe(t.map(String).join(" ")),error:(...t)=>Qe(t.map(ur).join(" "))}),hl=0,Ni=()=>hl+=1,yl=[["console",gl],["setTimeout",Ni],["setInterval",Ni],["clearTimeout",()=>{}],["clearInterval",()=>{}],["queueMicrotask",Jt],["graview",et.view],[lo,pl],[ao,t=>ml(t)]];for(let[t,e]of yl)fl(Ti,t,{value:e,writable:!0,enumerable:!1,configurable:!0});St=as(globalThis,["graview",lo,ao],{primitivesStay:!0});St.stuck.length>0&&en("refused",`This isolate could not be hardened: ${St.stuck.join(", ")} would not go.`);})();\n';function tr(e){return`${Tt}
|
|
16
16
|
;${$t}(function (graview) {
|
|
17
17
|
"use strict";
|
|
18
18
|
${e}
|
|
19
19
|
});
|
|
20
|
-
`}var rr={scheme:"light",accent:"#2f7d8c",ground:"#f6f8f9",panel:"#ffffff",ink:"#14212b",inkMuted:"#4f6470",edge:"rgba(20, 33, 43, 0.14)",fontBody:"system-ui, sans-serif",fontDisplay:"system-ui, sans-serif",fontMono:"ui-monospace, monospace",radius:"12px"},G=(e,t,r)=>({ok:!1,reason:e,detail:t,...r?{transcript:r}:{}}),ne=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),nr=["manifest","source","refused","error","silent","nodes","flood","slow","act","isolate"];function sr(e){if(!ne(e))return;let{renders:t,sheets:r,asked:s,went:a,ms:i,logs:p,messages:l,gestures:d,pressed:f,clicks:b}=e;if(!(!Array.isArray(t)||!t.every(Array.isArray)||!Array.isArray(s)||!Array.isArray(a)||!Array.isArray(p))&&!(typeof i!="number"||typeof l!="number"||r!==void 0&&!(Array.isArray(r)&&r.every(o=>typeof o=="string"))))return{renders:t,...Array.isArray(r)?{sheets:r}:{},asked:s.filter(ne).map(o=>({name:String(o.name),args:o.args})),went:a.filter(ne).flatMap(o=>{let A=typeof o.section=="string"?{section:o.section}:{},T=o.where!==void 0?{where:o.where}:{};return typeof o.record=="string"?[{record:o.record,...T,...A}]:typeof o.place=="string"?[{place:o.place,...T,...A}]:[]}),ms:i,logs:p.map(String).slice(0,50),messages:l,...Array.isArray(b)?{clicks:b.filter(o=>typeof o=="string").slice(0,2e3)}:{},...Array.isArray(d)?{gestures:d.filter(ne).slice(0,32).map(o=>({event:String(o.event),selector:String(o.selector)}))}:{},...ne(f)&&typeof f.selector=="string"&&[f.asked,f.went,f.renders].every(o=>typeof o=="number")?{pressed:{selector:f.selector,...typeof f.target=="string"?{target:f.target}:{},asked:f.asked,went:f.went,renders:f.renders}}:{}}}function ar(e,t){let r=t.gestures??[];return r.length>0&&e.gestures!==!0?[{at:"gestures",says:`It listens for ${r.map(a=>`${a.event} on "${a.selector}"`).join(", ")}, and its manifest does not say "gestures": true: the host forwards no wheel, drag or pinch, and the page scrolls under it. Say "gestures": true in the manifest.`}]:r.length===0&&e.gestures===!0?[{at:"gestures",says:'Its manifest says "gestures": true, and it listens for no wheel, drag or pinch: graview.on("wheel" | "drag" | "pinch", selector, \u2026) is where the host sends one.'}]:[]}var or=e=>e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,ir=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");async function lr(e,t){let r=d=>typeof d=="object"&&d!==null&&!(typeof d.kind=="string"&&d.kind.length>0),s=d=>{let{as:f,slug:b}=d;return typeof f=="string"&&f.length>0?f:typeof b=="string"&&b.length>0?b:void 0},a=e.filter(d=>r(d)&&![void 0,je,De].includes(s(d)));if(a.length===0)return e;let i=t.app?Me(t.app,{views:t.views}):Le(t.schema,t.views.flatMap(d=>Ae(d)??[])),p=d=>i.find(f=>f.slug===s(d)&&f.kind!==null),l=a.filter(d=>!p(d)).map(d=>`"${s(d)}"`);if(l.length>0){let d=l.length===1?"that slug":"those slugs",f=t.app?`the app declares no place by ${d}`:`no kind's list or view the run holds is at ${d}, and the app, which would say its lenses, was not handed (\`app\`)`;throw new TypeError(`runWorkerViewHeadless was handed the place${l.length===1?"":"s"} ${l.join(", ")} without ${l.length===1?"its kind":"their kinds"}, and ${f}: hand each place's \`kind\` as \`placesOf(app)\` lists it, or the app.`)}return e.map(d=>{if(!a.includes(d))return d;let f=p(d);return{...d,kind:f.kind,...f.over?{over:f.over}:{}}})}async function Pe(e){if(typeof e.run!="function")throw new TypeError("runWorkerViewHeadless runs a view only in an isolate the host supplies (`run`); it never runs one in the host's own context.");let{manifest:t,source:r,store:s,principal:a}=e,i={maxSourceBytes:e.limits?.maxSourceBytes??256e3,maxNodes:e.limits?.maxNodes??5e3,messages:e.limits?.messages??120,pushMs:e.limits?.pushMs??1e3,runMs:e.limits?.runMs??5e3},p=qe(t,s);if(p.length>0)return G("manifest",p.join(" "));if(typeof r!="string")return G("source","A view's source is text.");if(new TextEncoder().encode(r).length>i.maxSourceBytes)return G("source",`Its code is longer than the ${i.maxSourceBytes.toLocaleString("en-US")} bytes a view may be.`);let l=Xe(r);if(l.length>0)return G("source",l.join(" "));let d=[...e.views??[],t].flatMap(v=>Ae(v)??[]).map(v=>({as:v.as,title:v.title,kind:v.kind})),f=new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds]),b=await lr(e.places??[],{schema:s.schema,...e.app?{app:e.app}:{},views:[...e.views??[],t]}),o=Ve(s.schema,[...b,...d],{kept:f}),A=e.views===void 0,T=Ye(s,t)?(await (__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.IRPMGHZN.js","./chunk.7QWGIGHM.js","./chunk.HRLCDBMO.js","./chunk.LZNHTROY.js","./chunk.36FKQJFM.js","./chunk.RHV73CBA.js","./chunk.QILGAV7H.js","./chunk.I6HIVTXU.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.KDOJC4FX.js"))).computedOn(s.schema):void 0,m={...Ze(s,a,{manifest:t,...e.input?{input:e.input}:{},theme:e.theme??rr,places:Ue(o),...T?{computed:T}:{}}),mine:{}},y=t.pictures?it(m,{view:`"${t.title??t.name}"`,pictures:t.pictures,standIn:ot,limits:{...e.limits?.pictureBytes!==void 0?{pictureBytes:e.limits.pictureBytes}:{},...e.limits?.picturesBytes!==void 0?{picturesBytes:e.limits.picturesBytes}:{}}}):{props:m,left:[]},N=y.props,k={props:N,acts:be(t).map(v=>v.as??v.act),...t.accepts?{accepts:t.accepts.map(({kind:v,field:H})=>({kind:v,field:H}))}:{},places:o.map(v=>({as:v.as,title:v.title})),...A?{placesUnsure:!0}:{},...e.images?{imageOrigins:[...e.images.origins]}:{},...e.links?{linkOrigins:[...e.links.origins]}:{},...e.asset?{assets:!0}:{},...e.origin?{origin:e.origin}:{},lists:$e(s.schema,new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds])).flatMap(v=>[v.slug,v.kind]),limits:{maxNodes:i.maxNodes,messages:i.messages,pushMs:i.pushMs},...e.press!==void 0?{press:{selector:typeof e.press=="string"?e.press:e.press.selector}}:{}},$=async v=>{let H,B;try{let Z=e.run({script:tr(r),entry:At,input:JSON.stringify(v),timeoutMs:i.runMs}),It=new Promise((mr,Pt)=>{B=setTimeout(()=>Pt(Object.assign(new Error("past runMs"),{reason:"slow"})),i.runMs+1e3)});H=await Promise.race([Z,It])}catch(Z){return ne(Z)&&Z.reason==="slow"?G("slow",`It ran longer than the ${i.runMs.toLocaleString("en-US")} ms a headless run may take.`):G("isolate",`The isolate could not run it: ${Z instanceof Error?Z.message:String(Z)}`)}finally{B!==void 0&&clearTimeout(B)}let F;try{F=JSON.parse(String(H))}catch{return G("isolate","The isolate answered with something that is not an outcome.")}if(!ne(F))return G("isolate","The isolate answered with something that is not an outcome.");let Se=sr(F.transcript);if(F.ok!==!0){let Z=nr.includes(F.reason)?F.reason:"isolate";return G(Z,typeof F.detail=="string"?F.detail.slice(0,2e3):"It failed, and the isolate did not say why.",Se)}return Se?{ok:!0,transcript:Se}:G("isolate","The isolate answered without what the view sent.")},u=await $(k);if(!u.ok)return u;let h=u.transcript,n=e.press!==void 0?h.pressed:void 0,c=St(n?{...h,renders:h.renders.slice(0,n.renders)}:h,k,e.brand?.views?.css?{theme:e.brand.views.css}:{});if(!c.ok)return G(c.reason,c.detail,h);let g=new Set([...N.node?[N.node.id]:[],...(N.nodes??[]).map(v=>v.id)]),w=$e(s.schema,new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds])),O=[];for(let v of h.went){if(!("where"in v)&&!("section"in v))continue;let H=Q(v,{sees:F=>g.has(F),places:o,lists:w,schema:s.schema}),B="place"in v?W(k.places,v.place)!==void 0||(k.lists??[]).includes(v.place):!0;!H.ok&&B&&O.push({at:"navigate",says:H.says})}let Y=typeof e.press=="object"&&e.press.typed?{typed:e.press.typed}:{},L=n?pt(n,c.drawn,h,{store:s,principal:a,manifest:t,shown:g,places:o,lists:w,...A?{placesUnsure:!0}:{},...Y}):void 0,R=L&&(!L.element||L.lost)?[{at:`press "${L.selector}"`,says:L.lost??L.says}]:[],_;if(e.presses){let v=c.drawn;_=await(typeof e.presses=="function"?e.presses:e.presses.check)({store:s,principal:a,manifest:t,shown:g,places:o,lists:w,...A?{placesUnsure:!0}:{},drawn:v,clicks:h.clicks??[],...typeof e.presses=="object"&&e.presses.maxRuns!==void 0?{maxRuns:e.presses.maxRuns}:{},rerun:async B=>{let F=await $({...k,press:{selector:`[data-graview-check="${B}"]`,target:B}});return F.ok?F:{ok:!1,reason:F.reason,detail:F.detail}}})}let j=t.title??t.name,K=N.today?lt(r,{today:N.today,title:t.attach==="home"?"Home":j,...N.locale?{locale:N.locale}:{}}):[],ie=[...Je(s,t).map(v=>({at:"reads",says:v})),...y.left.map(v=>({at:"pictures",says:v})),...c.problems,...O,...ar(t,h),...R,...(_?.problems??[]).map(v=>({at:`press ${v.control}`,says:v.says})),...K.map(({at:v,says:H})=>({at:v,says:H}))],S=t.title?ir(t.title):t.name,E=t.attach==="home"?null:t.attach,x={place:{slug:t.attach==="home"?"home":S,title:j,kind:E,address:t.attach==="home"?"/":`/places/${encodeURIComponent(S)}`},seat:or(a),width:e.width??1440,variant:(e.width??1440)<640?"phone":"wide",drawnBy:`view:${t.name}`,parts:c.parts,...c.videos.length>0?{videos:c.videos}:{},problems:ie},{placeText:D}=await (__graviewPreload(import.meta.url,["./chunk.RECTEAG4.js","./chunk.NKUNCQB3.js","./chunk.CHG522KL.js","./chunk.IRPMGHZN.js","./chunk.7QWGIGHM.js","./chunk.HRLCDBMO.js","./chunk.LZNHTROY.js","./chunk.36FKQJFM.js","./chunk.RHV73CBA.js","./chunk.YIDNZTON.js","./chunk.QILGAV7H.js","./chunk.I6HIVTXU.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.NILR2BWR.js")),P,V;if(e.audit===!0){let{auditView:v}=await (__graviewPreload(import.meta.url,["./chunk.JO2X52D4.js","./chunk.M5FP4Y4Q.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.5A5DI36V.js")),H=(h.clicks??[]).flatMap(B=>c.drawn.elementOf(B)??[]);P=v(c.drawn.root,{host:"pending",clicked:H}),e.drawing===!0&&(V={root:c.drawn.root,clicked:H})}return{ok:!0,description:{...x,text:D(x)},props:N,transcript:h,css:c.drawn.css,...L?{pressed:L}:{},...P?{audit:P}:{},...V?{drawing:V}:{},..._?{presses:_}:{}}}var dr=6,xe=function*(e){for(let t of e.childNodes)t.nodeType===1&&(yield t,yield*xe(t))},cr=(e,t)=>{for(let r=t;r;r=r.parentElement)if(r===e)return!0;return!1};function Et(e,t){let r=[...xe(e)].filter(l=>l.getAttribute("data-record")===t);if(r.length===0)return null;let s=r[0];for(;s&&!r.every(l=>cr(s,l));)s=s.parentElement;let a=s??e,i=[a,...xe(a)].flatMap(l=>l.getAttribute("data-act")?[l.getAttribute("data-act")]:[]),p=[a,...xe(a)].flatMap(l=>l.getAttribute("aria-pressed")||l.getAttribute("aria-checked")?[`${l.getAttribute("aria-pressed")??""}${l.getAttribute("aria-checked")??""}`]:[]);return`${a.textContent.replace(/\s+/g," ").trim()}|${i.join(",")}|${p.join(",")}`}var Ot=(e,t)=>new RegExp(`\\s${t}="([^"]*)"`).exec(e)?.[1];function ur(e){return new Re({schema:e.schema,mutations:e.allMutations(),invariants:e.allInvariants(),...e.policy?{policy:e.policy}:{},snapshot:e.graph.snapshot()})}var pr=e=>JSON.stringify(Object.entries(e??{}).filter(([,t])=>typeof t=="boolean").sort(([t],[r])=>t.localeCompare(r)));async function vn(e){let t=bt(),r=await Pe({...e,run:t,presses:yt,audit:!0,drawing:!0});if(!r.ok||!r.presses||!r.drawing)return r;let s=await fr(e,r.presses,r.drawing.root,t);if(s.length===0)return r;let a=[...r.presses.problems,...s];return{...r,presses:{...r.presses,ok:!1,controls:[...r.presses.controls,...s],problems:a,text:`${r.presses.text}${s.map(i=>` FAILS ${i.says}
|
|
20
|
+
`}var rr={scheme:"light",accent:"#2f7d8c",ground:"#f6f8f9",panel:"#ffffff",ink:"#14212b",inkMuted:"#4f6470",edge:"rgba(20, 33, 43, 0.14)",fontBody:"system-ui, sans-serif",fontDisplay:"system-ui, sans-serif",fontMono:"ui-monospace, monospace",radius:"12px"},G=(e,t,r)=>({ok:!1,reason:e,detail:t,...r?{transcript:r}:{}}),ne=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),nr=["manifest","source","refused","error","silent","nodes","flood","slow","act","isolate"];function sr(e){if(!ne(e))return;let{renders:t,sheets:r,asked:s,went:a,ms:i,logs:p,messages:l,gestures:d,pressed:f,clicks:b}=e;if(!(!Array.isArray(t)||!t.every(Array.isArray)||!Array.isArray(s)||!Array.isArray(a)||!Array.isArray(p))&&!(typeof i!="number"||typeof l!="number"||r!==void 0&&!(Array.isArray(r)&&r.every(o=>typeof o=="string"))))return{renders:t,...Array.isArray(r)?{sheets:r}:{},asked:s.filter(ne).map(o=>({name:String(o.name),args:o.args})),went:a.filter(ne).flatMap(o=>{let A=typeof o.section=="string"?{section:o.section}:{},T=o.where!==void 0?{where:o.where}:{};return typeof o.record=="string"?[{record:o.record,...T,...A}]:typeof o.place=="string"?[{place:o.place,...T,...A}]:[]}),ms:i,logs:p.map(String).slice(0,50),messages:l,...Array.isArray(b)?{clicks:b.filter(o=>typeof o=="string").slice(0,2e3)}:{},...Array.isArray(d)?{gestures:d.filter(ne).slice(0,32).map(o=>({event:String(o.event),selector:String(o.selector)}))}:{},...ne(f)&&typeof f.selector=="string"&&[f.asked,f.went,f.renders].every(o=>typeof o=="number")?{pressed:{selector:f.selector,...typeof f.target=="string"?{target:f.target}:{},asked:f.asked,went:f.went,renders:f.renders}}:{}}}function ar(e,t){let r=t.gestures??[];return r.length>0&&e.gestures!==!0?[{at:"gestures",says:`It listens for ${r.map(a=>`${a.event} on "${a.selector}"`).join(", ")}, and its manifest does not say "gestures": true: the host forwards no wheel, drag or pinch, and the page scrolls under it. Say "gestures": true in the manifest.`}]:r.length===0&&e.gestures===!0?[{at:"gestures",says:'Its manifest says "gestures": true, and it listens for no wheel, drag or pinch: graview.on("wheel" | "drag" | "pinch", selector, \u2026) is where the host sends one.'}]:[]}var or=e=>e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,ir=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");async function lr(e,t){let r=d=>typeof d=="object"&&d!==null&&!(typeof d.kind=="string"&&d.kind.length>0),s=d=>{let{as:f,slug:b}=d;return typeof f=="string"&&f.length>0?f:typeof b=="string"&&b.length>0?b:void 0},a=e.filter(d=>r(d)&&![void 0,je,De].includes(s(d)));if(a.length===0)return e;let i=t.app?Me(t.app,{views:t.views}):Le(t.schema,t.views.flatMap(d=>Ae(d)??[])),p=d=>i.find(f=>f.slug===s(d)&&f.kind!==null),l=a.filter(d=>!p(d)).map(d=>`"${s(d)}"`);if(l.length>0){let d=l.length===1?"that slug":"those slugs",f=t.app?`the app declares no place by ${d}`:`no kind's list or view the run holds is at ${d}, and the app, which would say its lenses, was not handed (\`app\`)`;throw new TypeError(`runWorkerViewHeadless was handed the place${l.length===1?"":"s"} ${l.join(", ")} without ${l.length===1?"its kind":"their kinds"}, and ${f}: hand each place's \`kind\` as \`placesOf(app)\` lists it, or the app.`)}return e.map(d=>{if(!a.includes(d))return d;let f=p(d);return{...d,kind:f.kind,...f.over?{over:f.over}:{}}})}async function Pe(e){if(typeof e.run!="function")throw new TypeError("runWorkerViewHeadless runs a view only in an isolate the host supplies (`run`); it never runs one in the host's own context.");let{manifest:t,source:r,store:s,principal:a}=e,i={maxSourceBytes:e.limits?.maxSourceBytes??256e3,maxNodes:e.limits?.maxNodes??5e3,messages:e.limits?.messages??120,pushMs:e.limits?.pushMs??1e3,runMs:e.limits?.runMs??5e3},p=qe(t,s);if(p.length>0)return G("manifest",p.join(" "));if(typeof r!="string")return G("source","A view's source is text.");if(new TextEncoder().encode(r).length>i.maxSourceBytes)return G("source",`Its code is longer than the ${i.maxSourceBytes.toLocaleString("en-US")} bytes a view may be.`);let l=Xe(r);if(l.length>0)return G("source",l.join(" "));let d=[...e.views??[],t].flatMap(v=>Ae(v)??[]).map(v=>({as:v.as,title:v.title,kind:v.kind})),f=new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds]),b=await lr(e.places??[],{schema:s.schema,...e.app?{app:e.app}:{},views:[...e.views??[],t]}),o=Ve(s.schema,[...b,...d],{kept:f}),A=e.views===void 0,T=Ye(s,t)?(await (__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.J7GH2CGV.js","./chunk.SMF5S4DQ.js","./chunk.XP4IVKKR.js","./chunk.R5YGW5ZX.js","./chunk.QMGBAKX6.js","./chunk.PS765ODQ.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VCEDSOAK.js"))).computedOn(s.schema):void 0,m={...Ze(s,a,{manifest:t,...e.input?{input:e.input}:{},theme:e.theme??rr,places:Ue(o),...T?{computed:T}:{}}),mine:{}},y=t.pictures?it(m,{view:`"${t.title??t.name}"`,pictures:t.pictures,standIn:ot,limits:{...e.limits?.pictureBytes!==void 0?{pictureBytes:e.limits.pictureBytes}:{},...e.limits?.picturesBytes!==void 0?{picturesBytes:e.limits.picturesBytes}:{}}}):{props:m,left:[]},N=y.props,k={props:N,acts:be(t).map(v=>v.as??v.act),...t.accepts?{accepts:t.accepts.map(({kind:v,field:H})=>({kind:v,field:H}))}:{},places:o.map(v=>({as:v.as,title:v.title})),...A?{placesUnsure:!0}:{},...e.images?{imageOrigins:[...e.images.origins]}:{},...e.links?{linkOrigins:[...e.links.origins]}:{},...e.asset?{assets:!0}:{},...e.origin?{origin:e.origin}:{},lists:$e(s.schema,new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds])).flatMap(v=>[v.slug,v.kind]),limits:{maxNodes:i.maxNodes,messages:i.messages,pushMs:i.pushMs},...e.press!==void 0?{press:{selector:typeof e.press=="string"?e.press:e.press.selector}}:{}},$=async v=>{let H,B;try{let Z=e.run({script:tr(r),entry:At,input:JSON.stringify(v),timeoutMs:i.runMs}),It=new Promise((mr,Pt)=>{B=setTimeout(()=>Pt(Object.assign(new Error("past runMs"),{reason:"slow"})),i.runMs+1e3)});H=await Promise.race([Z,It])}catch(Z){return ne(Z)&&Z.reason==="slow"?G("slow",`It ran longer than the ${i.runMs.toLocaleString("en-US")} ms a headless run may take.`):G("isolate",`The isolate could not run it: ${Z instanceof Error?Z.message:String(Z)}`)}finally{B!==void 0&&clearTimeout(B)}let F;try{F=JSON.parse(String(H))}catch{return G("isolate","The isolate answered with something that is not an outcome.")}if(!ne(F))return G("isolate","The isolate answered with something that is not an outcome.");let Se=sr(F.transcript);if(F.ok!==!0){let Z=nr.includes(F.reason)?F.reason:"isolate";return G(Z,typeof F.detail=="string"?F.detail.slice(0,2e3):"It failed, and the isolate did not say why.",Se)}return Se?{ok:!0,transcript:Se}:G("isolate","The isolate answered without what the view sent.")},u=await $(k);if(!u.ok)return u;let h=u.transcript,n=e.press!==void 0?h.pressed:void 0,c=St(n?{...h,renders:h.renders.slice(0,n.renders)}:h,k,e.brand?.views?.css?{theme:e.brand.views.css}:{});if(!c.ok)return G(c.reason,c.detail,h);let g=new Set([...N.node?[N.node.id]:[],...(N.nodes??[]).map(v=>v.id)]),w=$e(s.schema,new Set([...s.kindsKeptFrom(a),...s.modules.disabledKinds])),O=[];for(let v of h.went){if(!("where"in v)&&!("section"in v))continue;let H=Q(v,{sees:F=>g.has(F),places:o,lists:w,schema:s.schema}),B="place"in v?W(k.places,v.place)!==void 0||(k.lists??[]).includes(v.place):!0;!H.ok&&B&&O.push({at:"navigate",says:H.says})}let Y=typeof e.press=="object"&&e.press.typed?{typed:e.press.typed}:{},L=n?pt(n,c.drawn,h,{store:s,principal:a,manifest:t,shown:g,places:o,lists:w,...A?{placesUnsure:!0}:{},...Y}):void 0,R=L&&(!L.element||L.lost)?[{at:`press "${L.selector}"`,says:L.lost??L.says}]:[],_;if(e.presses){let v=c.drawn;_=await(typeof e.presses=="function"?e.presses:e.presses.check)({store:s,principal:a,manifest:t,shown:g,places:o,lists:w,...A?{placesUnsure:!0}:{},drawn:v,clicks:h.clicks??[],...typeof e.presses=="object"&&e.presses.maxRuns!==void 0?{maxRuns:e.presses.maxRuns}:{},rerun:async B=>{let F=await $({...k,press:{selector:`[data-graview-check="${B}"]`,target:B}});return F.ok?F:{ok:!1,reason:F.reason,detail:F.detail}}})}let j=t.title??t.name,K=N.today?lt(r,{today:N.today,title:t.attach==="home"?"Home":j,...N.locale?{locale:N.locale}:{}}):[],ie=[...Je(s,t).map(v=>({at:"reads",says:v})),...y.left.map(v=>({at:"pictures",says:v})),...c.problems,...O,...ar(t,h),...R,...(_?.problems??[]).map(v=>({at:`press ${v.control}`,says:v.says})),...K.map(({at:v,says:H})=>({at:v,says:H}))],S=t.title?ir(t.title):t.name,E=t.attach==="home"?null:t.attach,x={place:{slug:t.attach==="home"?"home":S,title:j,kind:E,address:t.attach==="home"?"/":`/places/${encodeURIComponent(S)}`},seat:or(a),width:e.width??1440,variant:(e.width??1440)<640?"phone":"wide",drawnBy:`view:${t.name}`,parts:c.parts,...c.videos.length>0?{videos:c.videos}:{},problems:ie},{placeText:D}=await (__graviewPreload(import.meta.url,["./chunk.GYP3EF6Z.js","./chunk.O5P6LXHF.js","./chunk.53GQQETN.js","./chunk.J7GH2CGV.js","./chunk.SMF5S4DQ.js","./chunk.XP4IVKKR.js","./chunk.R5YGW5ZX.js","./chunk.QMGBAKX6.js","./chunk.PS765ODQ.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HUJLELZ3.js")),P,V;if(e.audit===!0){let{auditView:v}=await (__graviewPreload(import.meta.url,["./chunk.JO2X52D4.js","./chunk.M5FP4Y4Q.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VMYXBFPE.js")),H=(h.clicks??[]).flatMap(B=>c.drawn.elementOf(B)??[]);P=v(c.drawn.root,{host:"pending",clicked:H}),e.drawing===!0&&(V={root:c.drawn.root,clicked:H})}return{ok:!0,description:{...x,text:D(x)},props:N,transcript:h,css:c.drawn.css,...L?{pressed:L}:{},...P?{audit:P}:{},...V?{drawing:V}:{},..._?{presses:_}:{}}}var dr=6,xe=function*(e){for(let t of e.childNodes)t.nodeType===1&&(yield t,yield*xe(t))},cr=(e,t)=>{for(let r=t;r;r=r.parentElement)if(r===e)return!0;return!1};function Et(e,t){let r=[...xe(e)].filter(l=>l.getAttribute("data-record")===t);if(r.length===0)return null;let s=r[0];for(;s&&!r.every(l=>cr(s,l));)s=s.parentElement;let a=s??e,i=[a,...xe(a)].flatMap(l=>l.getAttribute("data-act")?[l.getAttribute("data-act")]:[]),p=[a,...xe(a)].flatMap(l=>l.getAttribute("aria-pressed")||l.getAttribute("aria-checked")?[`${l.getAttribute("aria-pressed")??""}${l.getAttribute("aria-checked")??""}`]:[]);return`${a.textContent.replace(/\s+/g," ").trim()}|${i.join(",")}|${p.join(",")}`}var Ot=(e,t)=>new RegExp(`\\s${t}="([^"]*)"`).exec(e)?.[1];function ur(e){return new Re({schema:e.schema,mutations:e.allMutations(),invariants:e.allInvariants(),...e.policy?{policy:e.policy}:{},snapshot:e.graph.snapshot()})}var pr=e=>JSON.stringify(Object.entries(e??{}).filter(([,t])=>typeof t=="boolean").sort(([t],[r])=>t.localeCompare(r)));async function vn(e){let t=bt(),r=await Pe({...e,run:t,presses:yt,audit:!0,drawing:!0});if(!r.ok||!r.presses||!r.drawing)return r;let s=await fr(e,r.presses,r.drawing.root,t);if(s.length===0)return r;let a=[...r.presses.problems,...s];return{...r,presses:{...r.presses,ok:!1,controls:[...r.presses.controls,...s],problems:a,text:`${r.presses.text}${s.map(i=>` FAILS ${i.says}
|
|
21
21
|
`).join("")}`}}}async function fr(e,t,r,s){let{store:a,principal:i,manifest:p}=e,l=new Set(a.graph.allNodes().map(b=>b.id)),d=new Set,f=[];for(let b of t.controls){if(d.size>=dr)break;if(b.does!=="act"||!b.ok)continue;let o=Ot(b.element,"data-act"),A=Ot(b.element,"data-record");if(!o||!A)continue;let T=a.graph.getNode(A),m=`${o}|${pr(T)}`;if(d.has(m))continue;d.add(m);let y=X(a,p,l,{as:o,record:A,fields:[]});if(!y.ok)continue;let N={name:y.name,args:y.args},k=T?`\u201C${Ce(a.schema.tryDefinition(T.kind),T)}\u201D`:`\u201C${A}\u201D`;if(!a.wouldChange(N,i)){let h=g=>new Set(a.allMutations().find(w=>w.name===g)?.writes??[]),n=h(y.name),c=be(p).filter(g=>g.act!==y.name&&n.size>0&&[...h(g.act)].some(w=>n.has(w))).filter(g=>{let w=X(a,p,l,{as:g.as??g.act,record:A,fields:[]});return w.ok&&a.wouldChange({name:w.name,args:w.args},i)}).map(g=>`\u201C${g.as??g.act}\u201D`);f.push({control:b.control,element:b.element,does:"act",ok:!1,says:`On ${k} it asks for \u201C${o}\u201D, which changes nothing there: it is so already.${c.length>0?` Bind its press there to ${c.join(" or ")} instead, as the page did, so a person can take it back.`:""}`});continue}let $=ur(a);try{$.apply(N,{author:i})}catch{continue}let u=await Pe({...e,store:$,run:s,audit:!0,drawing:!0});!u.ok||!u.drawing||Et(u.drawing.root,A)===Et(r,A)&&f.push({control:b.control,element:b.element,does:"act",ok:!1,says:`Pressed on ${k}, it lands, and the design draws ${k} just as before it: show what it changed \u2014 its words or its control (a finished task says so and offers the act that takes it back).`})}return f}export{Et as drawnRecord,vn as pressedHere};
|