graview 0.1.49 → 0.1.51
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.THENABJU.js → chunk.2534FLZZ.js} +1 -1
- package/dist/preview/chunk.25VJPUDH.js +1 -0
- package/dist/preview/{chunk.AGVFW6WC.js → chunk.2VJ52LGS.js} +1 -1
- package/dist/preview/{chunk.KDTNKKOY.js → chunk.2W2YVB6X.js} +1 -1
- package/dist/preview/chunk.2W45NM7Q.js +9 -0
- package/dist/preview/chunk.32BOL7OL.js +1 -0
- package/dist/preview/chunk.34HGT7HQ.js +1 -0
- package/dist/preview/{chunk.CXIIRL67.js → chunk.353CGK6C.js} +1 -1
- package/dist/preview/{chunk.NQ7SRWXA.js → chunk.3H7YIKKC.js} +1 -1
- package/dist/preview/{chunk.PBCT33FF.js → chunk.3MU37W5D.js} +1 -1
- package/dist/preview/chunk.3SBTQ66X.js +1 -0
- package/dist/preview/{chunk.3NEALGMI.js → chunk.3TVAE7LE.js} +1 -1
- package/dist/preview/{chunk.6RLFO5GA.js → chunk.4EZFOZBA.js} +1 -1
- package/dist/preview/chunk.4N5R4K6O.js +1 -0
- package/dist/preview/{chunk.NUUT37ER.js → chunk.4T67XS2D.js} +1 -1
- package/dist/preview/chunk.5ON3JSAK.js +1 -0
- package/dist/preview/{chunk.RMWLV3PR.js → chunk.5ZAK57JA.js} +2 -2
- package/dist/preview/chunk.6KYWJXZR.js +1 -0
- package/dist/preview/chunk.76QSPWSJ.js +1 -0
- package/dist/preview/{chunk.VSWEKNKS.js → chunk.7G4M2PX3.js} +2 -2
- package/dist/preview/{chunk.DFGXNFFE.js → chunk.7GAC7U34.js} +1 -1
- package/dist/preview/chunk.7NQROWHU.js +1 -0
- package/dist/preview/{chunk.7SGQ3HFG.js → chunk.7RIFDWDF.js} +1 -1
- package/dist/preview/chunk.ACB4TD4W.js +1 -0
- package/dist/preview/chunk.AJAMTRZ3.js +1 -0
- package/dist/preview/chunk.AL45OI4A.js +1 -0
- package/dist/preview/{chunk.7JLYEZW4.js → chunk.AL7LFNOS.js} +1 -1
- package/dist/preview/{chunk.OS75HEZP.js → chunk.ALCH5H7U.js} +1 -1
- package/dist/preview/chunk.APFRPN5S.js +1 -0
- package/dist/preview/{chunk.MUHFZXPS.js → chunk.AZOW57MT.js} +1 -1
- package/dist/preview/chunk.B4PUI3GO.js +1 -0
- package/dist/preview/chunk.B6LKLV32.js +1 -0
- package/dist/preview/{chunk.QWX2N2VD.js → chunk.B7LBG4UP.js} +1 -1
- package/dist/preview/{chunk.B2BLZDBD.js → chunk.BV6HKTHK.js} +1 -1
- package/dist/preview/{chunk.2QKSWK4U.js → chunk.BYY7YXBI.js} +1 -1
- package/dist/preview/{chunk.REANMQ6K.js → chunk.CI4DEKPX.js} +1 -1
- package/dist/preview/{chunk.DSNHE4MZ.js → chunk.CMEETACI.js} +1 -1
- package/dist/preview/{chunk.EJAVIZ7Y.js → chunk.CQPNDJAC.js} +1 -1
- package/dist/preview/{chunk.4SEY7VWZ.js → chunk.CTOBNZLM.js} +1 -1
- package/dist/preview/chunk.CUB4IAUJ.js +1 -0
- package/dist/preview/chunk.CUN4VN42.js +1 -0
- package/dist/preview/chunk.CV55N3Y6.js +1 -0
- package/dist/preview/{chunk.4OTESF7W.js → chunk.CXC5FOIO.js} +1 -1
- package/dist/preview/{chunk.BNU3KXKL.js → chunk.DEH6O3K4.js} +1 -1
- package/dist/preview/chunk.DQNN5FE5.js +1 -0
- package/dist/preview/chunk.DUY27OJV.js +1 -0
- package/dist/preview/chunk.E2R6VFZX.js +1 -0
- package/dist/preview/{chunk.GEY4MA4D.js → chunk.EA2NMVRE.js} +1 -1
- package/dist/preview/chunk.ESK3UZRC.js +1 -0
- package/dist/preview/{chunk.KJBXNMIU.js → chunk.ESSENNHM.js} +2 -2
- package/dist/preview/{chunk.AOEXSQDG.js → chunk.ET3XJDPX.js} +1 -1
- package/dist/preview/chunk.FEIJ7ETK.js +1 -0
- package/dist/preview/{chunk.FUMQLGNM.js → chunk.FFCUZPTC.js} +1 -1
- package/dist/preview/chunk.FG5ZFYYL.js +1 -0
- package/dist/preview/{chunk.TABIRLQS.js → chunk.FKJ3HIA5.js} +1 -1
- package/dist/preview/chunk.FTBH7CPZ.js +1 -0
- package/dist/preview/chunk.FU4YSVWX.js +1 -0
- package/dist/preview/{chunk.XMOIMPUC.js → chunk.FYDDFOSD.js} +1 -1
- package/dist/preview/{chunk.N2S3TMBC.js → chunk.GJQF7I22.js} +1 -1
- package/dist/preview/{chunk.NQDGUIUQ.js → chunk.GLTWLQ6L.js} +1 -1
- package/dist/preview/chunk.GMAXA5GV.js +1 -0
- package/dist/preview/{chunk.BTORFVKO.js → chunk.GRYS6VSF.js} +1 -1
- package/dist/preview/{chunk.423SZS7C.js → chunk.GYTVL6GR.js} +3 -3
- package/dist/preview/chunk.HASVT7IC.js +1 -0
- package/dist/preview/{chunk.IQHVVQEA.js → chunk.HFKGND5Q.js} +1 -1
- package/dist/preview/chunk.HVX7LFWR.js +1 -0
- package/dist/preview/chunk.IBJBCZKG.js +1 -0
- package/dist/preview/{chunk.7MJGZHTS.js → chunk.IE4ZJQV3.js} +1 -1
- package/dist/preview/chunk.IFL2MYTQ.js +1 -0
- package/dist/preview/{chunk.2N6RQ427.js → chunk.IUIDDNN3.js} +1 -1
- package/dist/preview/chunk.JBR66TUP.js +1 -0
- package/dist/preview/chunk.JG2FGZF2.js +18 -0
- package/dist/preview/{chunk.SIVMZNHZ.js → chunk.JI2UVZUU.js} +1 -1
- package/dist/preview/{chunk.D25QV6DK.js → chunk.JMDKAP23.js} +1 -1
- package/dist/preview/chunk.JX2C3HVD.js +1 -0
- package/dist/preview/{chunk.MU5WUTVF.js → chunk.K7ECYKZL.js} +1 -1
- package/dist/preview/{chunk.X4MTZKL3.js → chunk.K7RKWB2K.js} +1 -1
- package/dist/preview/chunk.KK46XLGU.js +1 -0
- package/dist/preview/chunk.KOBCLWPC.js +1 -0
- package/dist/preview/chunk.KRODTMGR.js +1 -0
- package/dist/preview/chunk.KYKHZZT7.js +1 -0
- package/dist/preview/chunk.LYIHPVDZ.js +1 -0
- package/dist/preview/{chunk.BVXOLZQ3.js → chunk.MG3DMURZ.js} +1 -1
- package/dist/preview/{chunk.ERWBI2NK.js → chunk.MMVCZOEX.js} +1 -1
- package/dist/preview/{chunk.FIS27KW4.js → chunk.MN6WHE4B.js} +1 -1
- package/dist/preview/{chunk.4D26JY5U.js → chunk.MRXQBEPQ.js} +1 -1
- package/dist/preview/{chunk.NB6WN4DO.js → chunk.MX3Y3LPH.js} +1 -1
- package/dist/preview/{chunk.AVDXG57A.js → chunk.MY5OXSS7.js} +1 -1
- package/dist/preview/chunk.N5XONWU2.js +1 -0
- package/dist/preview/chunk.NNUUD26E.js +1 -0
- package/dist/preview/{chunk.6EHE26ZS.js → chunk.NQ26KMSQ.js} +1 -1
- package/dist/preview/{chunk.LD6S2FL5.js → chunk.NVRK6A7T.js} +1 -1
- package/dist/preview/{chunk.MJ4XTNTL.js → chunk.NZDHXREL.js} +1 -1
- package/dist/preview/chunk.OHDJYGH7.js +2 -0
- package/dist/preview/{chunk.2OXXGN7C.js → chunk.OJ64WTLW.js} +2 -2
- package/dist/preview/{chunk.EM5CGFNB.js → chunk.OPCBZNKF.js} +1 -1
- package/dist/preview/{chunk.GRLPNTUW.js → chunk.OU5TRY4N.js} +1 -1
- package/dist/preview/chunk.OW72XZF4.js +1 -0
- package/dist/preview/chunk.P4CLT32V.js +5 -0
- package/dist/preview/chunk.PFXGWY3P.js +1 -0
- package/dist/preview/{chunk.QQE7N7LB.js → chunk.PMV6XVVZ.js} +1 -1
- package/dist/preview/{chunk.PCVU3LY3.js → chunk.PPZ2TOB5.js} +1 -1
- package/dist/preview/{chunk.QBHVBL42.js → chunk.PYRJDTVS.js} +1 -1
- package/dist/preview/chunk.QEQQXWYU.js +1 -0
- package/dist/preview/chunk.QPAJCRFB.js +1 -0
- package/dist/preview/chunk.R5R7CLOU.js +1 -0
- package/dist/preview/{chunk.TBA4GF34.js → chunk.RMMJQYJJ.js} +1 -1
- package/dist/preview/{chunk.2CO2EJQA.js → chunk.RNOBACJ6.js} +1 -1
- package/dist/preview/{chunk.ZILULTJJ.js → chunk.S32AGJ3W.js} +1 -1
- package/dist/preview/chunk.S4CKKT3C.js +1 -0
- package/dist/preview/{chunk.4Q5KWYVY.js → chunk.SJKHVIHA.js} +2 -2
- package/dist/preview/chunk.SJYQ72EC.js +1 -0
- package/dist/preview/chunk.SKG4IHT5.js +88 -0
- package/dist/preview/chunk.SLBWPVIY.js +1 -0
- package/dist/preview/{chunk.7JW5SHRR.js → chunk.SPU3BVAO.js} +1 -1
- package/dist/preview/chunk.SRFZKDQ6.js +1 -0
- package/dist/preview/{chunk.RSR2M7ZO.js → chunk.SSAY4ITS.js} +2 -2
- package/dist/preview/{chunk.XN7PIWVC.js → chunk.T3RTFTOZ.js} +1 -1
- package/dist/preview/{chunk.AP22NNIM.js → chunk.TBSPEO2L.js} +1 -1
- package/dist/preview/chunk.TMYGLXR6.js +25 -0
- package/dist/preview/{chunk.D53IGR45.js → chunk.TNL2BVCH.js} +1 -1
- package/dist/preview/{chunk.BJR6E2CT.js → chunk.TVWN5I4M.js} +1 -1
- package/dist/preview/{chunk.RI624PFK.js → chunk.U7SNDY3F.js} +1 -1
- package/dist/preview/chunk.UCUWEYKM.js +1 -0
- package/dist/preview/{chunk.ON35FJ5H.js → chunk.UIWI4GKW.js} +1 -1
- package/dist/preview/{chunk.N2S45SSL.js → chunk.UK5F3S2N.js} +1 -1
- package/dist/preview/{chunk.H42WBU5C.js → chunk.UVAWWCFW.js} +1 -1
- package/dist/preview/{chunk.UL43GFVC.js → chunk.UWFEXEY3.js} +1 -1
- package/dist/preview/chunk.V4GAOZAW.js +1 -0
- package/dist/preview/{chunk.A7HMVWMG.js → chunk.VICCAWAN.js} +1 -1
- package/dist/preview/{chunk.EYSQPXVE.js → chunk.W2DKFQ6R.js} +1 -1
- package/dist/preview/{chunk.TSHBXCMU.js → chunk.WESWDXRW.js} +1 -1
- package/dist/preview/{chunk.O3ONLQUF.js → chunk.WFHFWJ6E.js} +1 -1
- package/dist/preview/{chunk.YECMUK4X.js → chunk.WQLAIEWJ.js} +1 -1
- package/dist/preview/{chunk.G3Q5CYEM.js → chunk.XCCBUWMC.js} +1 -1
- package/dist/preview/{chunk.3EW6L5DY.js → chunk.XCQ7ZPR5.js} +1 -1
- package/dist/preview/chunk.XWXYC3BJ.js +1 -0
- package/dist/preview/chunk.XZVPVAIS.js +1 -0
- package/dist/preview/chunk.Y2ZBVWII.js +1 -0
- package/dist/preview/chunk.Y3LTHEN7.js +1 -0
- package/dist/preview/{chunk.WQN7EFW3.js → chunk.Y5AMZBHA.js} +2 -2
- package/dist/preview/{chunk.35FUGOSG.js → chunk.Z7N3MJ36.js} +1 -1
- package/dist/preview/chunk.ZJXUWOG3.js +1 -0
- package/dist/preview/{chunk.OFBESPHJ.js → chunk.ZZODDJYK.js} +1 -1
- package/dist/preview/index.html +51 -51
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2AZTW66C.js +0 -1
- package/dist/preview/chunk.2OLZ6BYI.js +0 -1
- package/dist/preview/chunk.4K7I7WYF.js +0 -1
- package/dist/preview/chunk.4QINLTDZ.js +0 -1
- package/dist/preview/chunk.4XKACWLT.js +0 -1
- package/dist/preview/chunk.52QB4YW2.js +0 -1
- package/dist/preview/chunk.54PZWX23.js +0 -1
- package/dist/preview/chunk.5YFO6D7J.js +0 -1
- package/dist/preview/chunk.6EGHJCEM.js +0 -1
- package/dist/preview/chunk.6WRA3Y7D.js +0 -1
- package/dist/preview/chunk.7C4IR4S7.js +0 -1
- package/dist/preview/chunk.7MWLDDFL.js +0 -1
- package/dist/preview/chunk.B445DZOY.js +0 -1
- package/dist/preview/chunk.BH365UJ5.js +0 -1
- package/dist/preview/chunk.BU6V76EF.js +0 -1
- package/dist/preview/chunk.C75I24Z5.js +0 -1
- package/dist/preview/chunk.D4IKO5YA.js +0 -18
- package/dist/preview/chunk.D4K23FUB.js +0 -1
- package/dist/preview/chunk.D66RI4QS.js +0 -1
- package/dist/preview/chunk.DTRNDSMS.js +0 -1
- package/dist/preview/chunk.DV4GSLGX.js +0 -9
- package/dist/preview/chunk.E2AJ7U5Z.js +0 -1
- package/dist/preview/chunk.EPTUOPPC.js +0 -1
- package/dist/preview/chunk.FNK2ZZ5E.js +0 -1
- package/dist/preview/chunk.FOYVTN5B.js +0 -1
- package/dist/preview/chunk.G25JEYCC.js +0 -1
- package/dist/preview/chunk.IVHPJUFM.js +0 -1
- package/dist/preview/chunk.IWEPDTVG.js +0 -1
- package/dist/preview/chunk.IYLOA3MV.js +0 -1
- package/dist/preview/chunk.JBG5UQLM.js +0 -1
- package/dist/preview/chunk.KLAEKRCA.js +0 -1
- package/dist/preview/chunk.LUL6PFIQ.js +0 -1
- package/dist/preview/chunk.NBJ4C33P.js +0 -1
- package/dist/preview/chunk.OKHEZJBX.js +0 -1
- package/dist/preview/chunk.OL5D7YTW.js +0 -1
- package/dist/preview/chunk.OTF3NNTI.js +0 -1
- package/dist/preview/chunk.P2AC6JRL.js +0 -88
- package/dist/preview/chunk.PFEKS3KO.js +0 -5
- package/dist/preview/chunk.PFR3FQBR.js +0 -1
- package/dist/preview/chunk.Q4KNNJFL.js +0 -1
- package/dist/preview/chunk.QPNFWP4Z.js +0 -1
- package/dist/preview/chunk.QQRLUBWQ.js +0 -1
- package/dist/preview/chunk.R5IRHCLZ.js +0 -1
- package/dist/preview/chunk.SGJSJGSR.js +0 -1
- package/dist/preview/chunk.SPZVEQC5.js +0 -1
- package/dist/preview/chunk.SR2345SW.js +0 -1
- package/dist/preview/chunk.ST4JHXPS.js +0 -1
- package/dist/preview/chunk.TM6JVVGW.js +0 -25
- package/dist/preview/chunk.UT6642FC.js +0 -1
- package/dist/preview/chunk.UTRIPGW6.js +0 -1
- package/dist/preview/chunk.VV3PNZPI.js +0 -1
- package/dist/preview/chunk.W6CGAPNQ.js +0 -1
- package/dist/preview/chunk.XJ7YGW6Y.js +0 -1
- package/dist/preview/chunk.XXZFWZ4C.js +0 -1
- package/dist/preview/chunk.YSFNPYCD.js +0 -2
- package/dist/preview/chunk.YXOJKGRC.js +0 -1
- package/dist/preview/chunk.ZBL47SFK.js +0 -1
- /package/dist/preview/{chunk.4HUB3N7I.js → chunk.KHRS2SKB.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as b,L as w,M as N,N as T,P as O,Q as S,U as m}from"./chunk.
|
|
1
|
+
import{E as b,L as w,M as N,N as T,P as O,Q as S,U as m}from"./chunk.P4CLT32V.js";var x=864e5,j=/^(\d{4})-(\d{2})-(\d{2})/,p=e=>String(e).padStart(2,"0"),D=e=>new Date(e).toISOString().slice(0,10),a=e=>Date.UTC(+e.slice(0,4),+e.slice(5,7)-1,+e.slice(8,10)),g=(e,t)=>D(a(e)+t*x),W=e=>new Date(a(e)).getUTCDay();function c(e,t,r){if(!(t>=1&&t<=12&&r>=1&&r<=31))return;let i=`${String(e).padStart(4,"0")}-${p(t)}-${p(r)}`;return D(a(i))===i?i:void 0}function F(e=new Date){let t=N();return t?O(e.getTime(),t):{day:`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`,minutes:e.getHours()*60+e.getMinutes()}}var h=e=>/T\d\d:\d\d(:[\d.]+)?(Z|[+-]\d\d:?\d\d)$/.test(e);function l(e){if(typeof e!="string")return;if(h(e)){let i=new Date(e);return Number.isNaN(i.getTime())?void 0:F(i)}let t=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2}))?/.exec(e);if(!t||!c(Number(t[1]),Number(t[2]),Number(t[3])))return;let r=e.slice(0,10);return t[4]===void 0?{day:r}:{day:r,minutes:Number(t[4])*60+Number(t[5])}}function A(e,t){if(!t.time)return e.day;let r=e.minutes??9*60;if(!t.instant)return`${e.day}T${p(Math.floor(r/60))}:${p(r%60)}`;let i=N(),[,n,o,d]=j.exec(e.day);return(i?new Date(S(e.day,r,i)):new Date(Number(n),Number(o)-1,Number(d),Math.floor(r/60),r%60)).toISOString().replace(/\.\d{3}Z$/,"Z")}function z(e,t=new Date){let r=T(),i=r;try{i=new Intl.DateTimeFormat(e??b,{timeZoneName:"short",timeZone:r}).formatToParts(t).find(n=>n.type==="timeZoneName")?.value??r}catch{i=r}return{zone:r,short:i}}function L(e,t,r,i){let n=l(t);if(!n)return r;let o=e===void 0?void 0:l(e),d=r===void 0?void 0:l(r),u=s=>a(s.day)+(s.minutes??0)*6e4,f=(s,$)=>{let y=u(s)+$;return{day:D(y),...i.time?{minutes:Math.round(y%x/6e4)}:{}}};return o&&d?A(f(d,u(n)-u(o)),i):d&&u(d)>=u(n)?r:i.time?A(f(n,36e5),i):r}var Y=/^(start|starts|startsAt|startsOn|startAt|begins|from|opens|checkIn)$/i,B=/^(end|ends|endsAt|endsOn|endAt|until|to|finish|finishes|closes|through|checkOut)$/i;function P(e,t={}){let r=(t.start&&e.includes(t.start)?t.start:void 0)??e.find(n=>Y.test(n)),i=(t.end&&e.includes(t.end)?t.end:void 0)??e.find(n=>n!==r&&B.test(n));return r&&i?{start:r,end:i}:void 0}var Z=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],H=["sun","mon","tue","wed","thu","fri","sat"],I="(jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|june?|july?|aug(?:ust)?|sept?(?:ember)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)",E="(sun(?:day)?|mon(?:day)?|tue(?:s|sday)?|wed(?:nesday)?|thu(?:r|rs|rsday)?|fri(?:day)?|sat(?:urday)?)",C=e=>Z.indexOf(e.slice(0,3))+1,M=e=>e===void 0?void 0:e.length===2?2e3+Number(e):Number(e);function U(e){try{let t=new Intl.DateTimeFormat(e,{month:"numeric",day:"numeric"}).formatToParts(0).map(r=>r.type);return t.indexOf("month")<t.indexOf("day")}catch{return!0}}function v(e){let t=(n,o)=>({minutes:o,rest:`${e.slice(0,n.index)} ${e.slice(n.index+n[0].length)}`}),r=/\b(noon|midday)\b/.exec(e);if(r)return t(r,12*60);if(r=/\bmidnight\b/.exec(e),r)return t(r,0);if(r=/\b(\d{1,2})(?::(\d{2}))?\s*([ap])\.?m?\.?(?=\s|$)/.exec(e),r){let n=Number(r[1]),o=Number(r[2]??0);return n<1||n>12||o>59?{rest:e,bad:!0}:t(r,(n%12+(r[3]==="p"?12:0))*60+o)}if(r=/\b(\d{1,2}):(\d{2})\b/.exec(e),r){let n=Number(r[1]),o=Number(r[2]);return n>23||o>59?{rest:e,bad:!0}:t(r,n*60+o)}if(r=/\bat\s+(\d{1,2})\b/.exec(e),r){let n=Number(r[1]);return n>23?{rest:e,bad:!0}:t(r,(n>=1&&n<=7?n+12:n)*60)}let i=/\b(morning|afternoon|evening|tonight)\b/.exec(e);return i?{minutes:{morning:9,afternoon:15,evening:18,tonight:20}[i[1]]*60,rest:i[1]==="tonight"?`${e.slice(0,i.index)} today ${e.slice(i.index+i[0].length)}`:`${e.slice(0,i.index)} ${e.slice(i.index+i[0].length)}`}:{rest:e}}function K(e,t,r){let i=e.replace(/\b(on|at|the|of|this)\b/g," ").replace(/\s+/g," ").trim();if(i==="")return null;if(i==="today"||i==="now")return t;if(i==="tomorrow"||i==="tmrw"||i==="tmr")return g(t,1);if(i==="yesterday")return g(t,-1);if(i==="next week")return g(t,7);let n=/^in (\d{1,3}) (day|days|week|weeks)$/.exec(i);if(n)return g(t,Number(n[1])*(n[2].startsWith("week")?7:1));if(n=new RegExp(`^(next )?${E}$`).exec(i),n){let s=(H.indexOf(n[2].slice(0,3))-W(t)+7)%7;return g(t,n[1]&&s===0?7:s)}if(n=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(i),n)return c(Number(n[1]),Number(n[2]),Number(n[3]));let o=i.replace(new RegExp(`^${E} `),"");n=new RegExp(`^(\\d{1,2})(?:st|nd|rd|th)? ${I}(?: (\\d{4}))?$`).exec(o);let d=n?{date:n[1],month:n[2],year:n[3]}:void 0;n=new RegExp(`^${I} (\\d{1,2})(?:st|nd|rd|th)?(?: (\\d{4}))?$`).exec(o);let u=d??(n?{date:n[2],month:n[1],year:n[3]}:void 0);if(u)return R(t,M(u.year),C(u.month),Number(u.date));if(n=/^(\d{1,2})[/.-](\d{1,2})(?:[/.-](\d{2}|\d{4}))?$/.exec(o),n){let[f,s]=[Number(n[1]),Number(n[2])],[$,y]=U(r)?[f,s]:[s,f];return R(t,M(n[3]),$,y)}}function R(e,t,r,i){if(t!==void 0)return c(t,r,i);let n=Number(e.slice(0,4)),o=c(n,r,i);return o===void 0?c(n+1,r,i):a(e)-a(o)>183*x?c(n+1,r,i):o}function q(e,t){let r=e.trim();if(h(r)){let u=l(r);if(u)return t.time?u:{day:u.day}}let i=e.toLowerCase().replace(/,/g," ").replace(/(\d{4}-\d{2}-\d{2})t(\d\d:\d\d)(:\d\d(\.\d+)?)?/,"$1 $2").replace(/\s+/g," ").trim();if(i==="")return;let n=v(i);if(n.bad)return;let o=K(n.rest,t.today,t.locale??b);if(o===void 0||o===null&&n.minutes===void 0)return;let d=o??t.base?.day??t.today;return t.time?{day:d,minutes:n.minutes??t.base?.minutes??9*60}:{day:d}}function G(e){if(e===void 0||e==="web"||e.startsWith("ai:")||e.startsWith("app:"))return;if(e==="api")return"via the API";if(e==="cli")return"via the command line";let[t,...r]=e.split(":"),i=r.join(":");return(t==="mcp"||t==="view")&&i?`via ${i}`:t==="mcp"?"via an agent's tools":`via ${e}`}var _=e=>{if(!e.currency)return{before:!0};try{let t=w(e.locale),r=new Intl.NumberFormat(t,{style:"currency",currency:e.currency}).formatToParts(1),i=r.findIndex(d=>d.type==="currency"),n=r.findIndex(d=>d.type==="integer"),o;try{o=new Intl.DisplayNames([t],{type:"currency"}).of(e.currency)}catch{}return{...i>=0?{symbol:r[i].value}:{},before:i<n,...o?{name:o}:{}}}catch{return{symbol:e.currency,before:!0}}};function J(e){let t=e.locale;if(e.format==="money"){let{symbol:r,before:i,name:n}=_(e),o=m(1250,t,{minimumFractionDigits:2,maximumFractionDigits:2});return{...r?i?{prefix:r}:{suffix:r}:{},placeholder:o,hint:n?`in ${n}`:e.currency?`in ${e.currency}`:"an amount of money"}}return e.format==="percent"?{suffix:"%",placeholder:m(15,t),hint:"as a percent"}:{...e.unit?{suffix:e.unit}:{},placeholder:"",hint:e.unit?`in ${e.unit}`:"a number"}}function Q(e,t){return e===void 0||!Number.isFinite(e)?"":t.format==="money"?m(e,t.locale,Number.isInteger(e)?{maximumFractionDigits:0}:{minimumFractionDigits:2,maximumFractionDigits:2}):t.format==="percent"?m(e*100,t.locale,{maximumFractionDigits:4}):m(e,t.locale,{maximumFractionDigits:6})}function V(e){try{let t=new Intl.NumberFormat(w(e)).formatToParts(12345.6);return{group:t.find(r=>r.type==="group")?.value??",",decimal:t.find(r=>r.type==="decimal")?.value??"."}}catch{return{group:",",decimal:"."}}}function X(e,t){let{group:r,decimal:i}=V(t),n=e.replace(/[\s ']/g,"").replace(/[−–]/g,"-");if(i!=="."&&!n.includes(i)&&/^-?\d+\.\d{1,2}$/.test(n))return Number(n);if(r&&(n=n.split(r).join("")),i!=="."&&(n=n.replace(i,".")),!/^-?(\d+\.?\d*|\.\d+)$/.test(n))return;let o=Number(n);return Number.isFinite(o)?o:void 0}function k(e,t){let r=e.trim();if(r==="")return;let i=t?.format==="money"&&t.currency?_(t).symbol:void 0,n=r;i&&(n=n.split(i).join("")),t?.currency&&(n=n.replace(new RegExp(t.currency,"gi"),"")),n=n.replace(/^[$€£¥₹]|[$€£¥₹]$/g,""),/%\s*$/.test(n)&&(n=n.replace(/%\s*$/,"")),t?.unit&&t.format!=="money"&&(n=n.replace(new RegExp(`\\s*${t.unit.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*$`),""));let d=X(n,t?.locale);if(d!==void 0)return t?.format==="percent"?d/100:d}export{G as a,J as b,Q as c,k as d,F as e,h as f,l as g,A as h,z as i,L as j,P as k,q as l};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Ge}from"./chunk.AOEXSQDG.js";import{c as Me,d as Oe,f as Be}from"./chunk.35FUGOSG.js";import{e as Pe,f as Ce,j as Re,k as re,l as Fe}from"./chunk.NQDGUIUQ.js";import{f as Se}from"./chunk.LD6S2FL5.js";import{d as _,e as je,k as ne}from"./chunk.GRLPNTUW.js";import{b as De,e as Ae}from"./chunk.EJAVIZ7Y.js";import{$ as ue,Ac as U,Bc as be,C as Q,Cb as fe,I as de,Tc as ve,Ub as te,Vb as ge,ca as T,da as K,ea as me,fa as Z,ga as ee,ha as pe,hd as $e,ka as q,ma as z,rc as he,rd as ke,tc as ye,vc as we,zd as xe}from"./chunk.PFEKS3KO.js";function ze(r,e,t){let s=r.tryDefinition(e)?.fields.shape,n=Q(s?.[t]),a=!1,o=!1;for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)(n.type==="optional"||n.type==="nullable")&&(a=!0),(n.type==="default"||n.type==="prefault")&&(o=!0),n=Q(n.innerType);if(n?.type!=="enum")return;let p=(n.entries?Object.values(n.entries):n.values??[]).filter(u=>typeof u=="string");return p.length>0?{values:p,empty:a&&!o}:void 0}function E(r,e,t){let s=ze(r,e,t);if(!s)return[];let n=r.tryDefinition(e),a=s.values.map(o=>({value:o,label:De(n,t,o)}));return s.empty&&a.push({value:null,label:`No ${q(n,t).toLowerCase()}`}),a}function X(r,e,t){let s=r[e];return typeof s=="string"&&t.some(n=>n.value===s)?s:null}function oe(r,e,t,s,n=E(r.schema,t.kind,s)){return Ie(r,e,t,s,n).flatMap(a=>a.move?[a.move]:[])}function Ie(r,e,t,s,n=E(r.schema,t.kind,s)){let a=Ne(r.schema,r.allMutations(),t.kind,s,n),o=X(t,s,n),p=z(r.schema.tryDefinition(t.kind),t.kind),u=[];for(let{value:A,label:R,by:F,acts:M}of a){if(A===o)continue;let x,G,I;for(let l of M){let w=F==="step"?{[l.subject.arg]:t.id}:{[l.subject.arg]:t.id,[s]:A},S={name:l.name,args:w};if(!l.input.safeParse(w).success){I??=`${l.title??l.name} asks for more than the ${p} itself.`;continue}let k=r.permits(S,e);if(!k.ok){G??=k.refusal?.message??`You may not ${l.title??l.name}.`;continue}try{fe(r.graph,l,w)}catch(f){G??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:l.title??l.name};break}u.push(x?{to:A,label:R,move:x}:{to:A,label:R,why:G??I??`Nothing in this app moves a ${p} to ${R}.`})}return u}function Ne(r,e,t,s,n=E(r,t,s)){let a=Ve(r,e,t,s),o=Ke(r,e,t,s);return n.flatMap(p=>{if(p.value===null)return[];let u=a.filter(A=>A.sets?.[s]===p.value);return[{value:p.value,label:p.label,by:u.length>0?"step":o.length>0?"value":"none",acts:u.length>0?u:o}]})}function Ve(r,e,t,s){return e.filter(n=>n.subject!==void 0&&n.derived===void 0&&typeof n.sets?.[s]=="string"&&te(r,n).includes(t))}function Ke(r,e,t,s){let n=r.tryDefinition(t);return n?e.filter(a=>{if(!a.subject||!te(r,a).includes(t)||!ge(a,n).includes(s))return!1;let o=a.input.shape;return o!==void 0&&s in o}).sort((a,o)=>+(a.derived!==void 0)-+(o.derived!==void 0)):[]}var se=(r,e)=>e&&r[e]!==void 0?String(r[e]):"";function Xe(r,e,t){let s=l=>r.tryDefinition(l)?e.nodesOfKind(l).filter(w=>T(r.tryDefinition(l),w)):[],n=s(t.rows),a=s(t.columns),o=new Set(n.map(l=>l.id)),p=new Set(a.map(l=>l.id)),u=e.allEdges(),A=[],R=t.link;if(typeof R=="string"){let l=f=>r.tryDefinition(f)?.edges?.[R]?.to,w=(l(t.columns)??[]).some(f=>f===t.rows||f==="*"),S=(l(t.rows)??[]).some(f=>f===t.columns||f==="*"),k=w||!S;for(let f of u){if(f.kind!==R)continue;let P=k?f.to:f.from,i=k?f.from:f.to;o.has(P)&&p.has(i)&&A.push({rowId:P,columnId:i,via:[]})}}else{let l=new Map(R.path.map(S=>[S,new Map]));for(let S of u){let k=l.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let P=k.get(S.to);P?P.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of R.path){let P=[],i=new Set;for(let $ of k)for(let b of l.get(f).get($.id)??[])i.has(`${$.id}|${b}`)||(i.add(`${$.id}|${b}`),P.push({id:b,via:[...$.via,$.id]}));k=P}for(let f of k){let P=`${f.id}|${S.id}`;!o.has(f.id)||w.has(P)||(w.add(P),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let F=t.groupOrder??[],M=l=>F.indexOf(l)===-1?F.length:F.indexOf(l),x=(l,w)=>w==="label"?K(r.tryDefinition(l.kind),l):l[w],G=U(n,t.sort,x).map(l=>{let w=l;return{node:l,label:K(r.tryDefinition(l.kind),l),group:se(w,t.rowGroup),ref:se(w,t.rowRef)}}).sort((l,w)=>M(l.group)-M(w.group)||(t.sort!==void 0?0:l.ref<w.ref?-1:l.ref>w.ref?1:0)),I=U(a,t.columnSort,x).map(l=>({node:l,label:K(r.tryDefinition(l.kind),l),group:se(l,t.columnGroup)})).sort((l,w)=>l.group<w.group?-1:l.group>w.group?1:t.columnSort!==void 0?0:l.node.id<w.node.id?-1:l.node.id>w.node.id?1:0);return{rows:G,columns:I,cells:A}}function We(r,e,t){let{rows:s,columns:n,cells:a}=Xe(r,e,t),o=(i,$)=>ee(r,i,$),p=i=>ee(r,i,1).replace(/^1 /,""),u=i=>({id:i.id,kind:i.kind,title:K(r.tryDefinition(i.kind),i),parts:[]}),A=i=>{let $=e.getNode(i);if(!$)return null;let b=r.tryDefinition($.kind),C=K(b,$),N=_($,b,{limit:3,said:[C],glance:!0}).map(V=>V.alone.startsWith(V.label)?`${V.label.toLowerCase()}${V.alone.slice(V.label.length)}`:V.alone);return[C,...N].join(", ")},R=typeof t.link=="string"?[]:t.link.path.slice(0,-1).flatMap((i,$,b)=>{let C=ve(r,t.columns,b.slice(0,$+1));return C.ok?[...C.reached]:[]}),F=be(r,t,{rows:s.length,columns:n.length,cells:a.length});if(F)return[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}.`},{t:"text",text:F}];let M=[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}${R.length>0?`, through ${[...new Set(R)].map(i=>o(i,2).replace(/^2 /,"")).join(" and ")}`:""}${n.length>0?`: ${n.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(n.map(i=>[i.node.id,i.label])),G=new Map(n.map((i,$)=>[i.node.id,$])),I=new Map,l=new Map;for(let i of a){let $=I.get(i.rowId);$?$.push(i):I.set(i.rowId,[i]);let b=l.get(i.columnId);b?b.add(i.rowId):l.set(i.columnId,new Set([i.rowId]))}for(let i of s){let b=[...I.get(i.node.id)??[]].sort((C,N)=>G.get(C.columnId)-G.get(N.columnId)).map(C=>{let N=C.via.map(A).filter(V=>V!==null);return`${x.get(C.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:n.map(i=>{let $=l.get(i.node.id)??new Set,b=s.filter(C=>$.has(C.node.id)).map(C=>u(C.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=s.filter(i=>!w.has(i.node.id)),f=n.filter(i=>!S.has(i.node.id)),P=t.rows===t.columns;return k.length>0&&M.push({t:"text",text:`${P?`${k.length} with none across`:`${o(t.rows,k.length)} with no ${p(t.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&M.push({t:"text",text:`${P?`${f.length} with none down`:`${o(t.columns,f.length)} on no ${p(t.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),M}function ie(r,e,t,s={}){let{app:n,blocks:a=t?n?.viewSpecs?.[t.kind]?.[s.slot??"page"]:n?.home}=s;if(!a?.length)return[];let o=s.firstHeading??(t||s.blocks?void 0:1),p=Fe(r,e,t,{...s,money:s.money??n?.brand,firstHeading:o});return t&&!p.node?[]:Ce(typeof a[0]?.t=="string"?a:Pe(a),p)}function Y(r,e,t){let s=!(e.optional||e.control==="boolean"),n=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(o=>Z(z(r.tryDefinition(o),o))).join(" or "):t(e.name).label,a={name:e.name,label:n,required:s};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(o=>t(e.name).option(o))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(r,e.item,t).input}`};case"group":return{...a,input:"group",fields:e.fields.map(o=>Y(r,o,t))};case"variant":return{...a,input:"one of",choices:e.options.map(o=>Z(o.value))};default:return{...a,input:"answer"}}}function Te(r,e,t){let s=Oe(r,e,t),n=r.schema,a=Me(n,t).filter(p=>p.name!==t.subject?.arg&&!s.has(p.name)),o=me(t);return{act:t.name,title:o,submit:o,fields:a.map(p=>Y(n,p,u=>ne(n,t,u)))}}function He(r,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(t=>Y(r,t,s=>ne(r,e.act,s)))}}function Ee(r,e,t){return r.permittedMutations(e).filter(s=>!s.derived&&!s.subject&&(s.creates??[]).includes(t))}function Le(r,e=""){let t=[`${e}Form "${r.title}" (${r.visitor?`the visitor form ${r.visitor}, running `:""}act ${r.act}), button "${r.submit}":`],s=(n,a)=>{for(let o of n){let p=o.choices?`${o.input}: ${o.choices.join(", ")}`:o.kinds?`${o.input} (${o.kinds.join(" or ")})`:o.input,u=o.min!==void 0||o.max!==void 0?`, ${o.min??"\u2026"} to ${o.max??"\u2026"}`:"";t.push(`${a}- ${o.label}${o.required?" *":""} (${o.name}) \u2014 ${p}${u}`),o.fields&&s(o.fields,`${a} `)}};return s(r.fields,`${e} `),r.fields.length===0&&t.push(`${e} (asks nothing)`),t}function Ue(r,e){let t=r.viewSpecs??{};return e.filter(s=>s.cardinality==="one"&&s.replaces==="page"&&(t[s.attach]?.page?.length??0)>0).map(s=>{let n=L(r.schema,s.attach,1);return{at:`views.${s.attach}.page`,says:`The view "${s.name}" replaces ${Ye(n)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Ye=r=>`${/^[aeiou]/i.test(r)?"an":"a"} ${r}`,Je=240,Ze=10,Qe=1160,et=40,_e=640,tt=3,nt=r=>Math.max(1,Math.floor((Math.min(r,Qe)-et+Ze)/(Je+Ze)));function rt(r,e,t,s){let{app:n}=s,a=s.width??1440,o=s.today??r.today()??de(n.brand?.timeZone),p=r.seenBy(e),u=p.schema,A=p.graph,R=Ge(n,s.views?{views:s.views}:{}),F=typeof t=="string"?t.trim():t.slug,M=typeof t=="string"?R.find(c=>c.slug===F||c.title===F||c.address===F):R.find(c=>c.slug===t.slug&&c.kind===t.kind)??t,x=!M&&typeof t=="string"?A.getNode(F):void 0,G=!M&&!x?/^\/?forms\/(.+)$/.exec(F)?.[1]:void 0,I=G!==void 0?Be(n,G):void 0;if(I)return{ok:!0,description:ot(u,I,a)};if(!M&&!x)return{ok:!1,error:`"${F}" is not a place this app has, nor a record this seat can see.`,places:[...R.map(c=>c.slug),...Object.keys(n.forms??{}).map(c=>`forms/${c}`)]};let l=[],w=n.viewSpecs??{},S=nt(a),k=(c,y)=>ie(p,null,c,{app:n,today:o,...y}),f=(c,y,g)=>{let m=u.tryDefinition(c.kind),D=K(m,c);if(y==="name")return{id:c.id,kind:c.kind,title:D,parts:[]};if(w[c.kind]?.[y]){let O=k(c,{slot:y}),[B,...h]=O,j=B?.t==="title"||y==="row"&&B?.t==="headline";return{id:c.id,kind:c.kind,title:j?B.text:D,parts:P(j?h:O,g,`views.${c.kind}.${y}`,` (${c.id})`,j?1:0)}}if(y==="row")return{id:c.id,kind:c.kind,title:D,parts:[]};let d=m?.computed?re(u,A,c):c,W=_(d,m,{limit:3,said:[D],glance:!0,locale:n.brand?.locale,timeZone:n.brand?.timeZone});return{id:c.id,kind:c.kind,title:D,parts:W.map(O=>({t:"text",text:O.alone}))}};function P(c,y,g,m="",D=0){let v=[];return c.forEach((d,W)=>{let O=`${g}.${W+D}`;switch("problem"in d&&d.problem&&l.push({at:`${O}${m}`,says:d.problem}),d.t){case"title":v.push({t:"heading",level:3,text:d.text});return;case"text":v.push({t:"text",text:d.markdown?Ae(d.text):d.runs?it(d.runs):d.text,...d.tone?{tone:d.tone}:{}});return;case"badge":v.push({t:"badge",text:d.text});return;case"field":case"image":v.push({t:"field",label:d.label,text:d.text});return;case"progress":v.push({t:"progress",label:d.label,text:d.text});return;case"group":v.push(...P(d.blocks,y,`${O}.group`,m));return;case"when":v.push(...P(d.blocks,y,`${O}.show`,m));return;case"divider":case"figure":return;case"headline":v.push({t:"heading",level:d.level,text:d.text});return;case"number":v.push({t:"figure",text:d.text,...d.label?{label:d.label}:{}});return;case"list":{if(d.failed){v.push({t:"text",text:"\u2014"});return}if(d.members.length===0){d.empty&&v.push({t:"list",as:d.as,columns:1,groups:[],empty:d.empty});return}let B=y+1,h=B>tt?"name":d.as,j=(d.groups??[{value:null,members:d.members}]).map(H=>({..."heading"in H&&H.heading?{heading:H.heading,count:(d.everyGroup?.find(J=>J.value===H.value)??H).members.length}:{},items:H.members.map(J=>f(J,h,B))}));v.push({t:"list",as:h,columns:h==="card"?S:1,groups:j,...d.more>0?{more:d.more}:{}});return}}}),v}let i=[],$,b,C,N=[];if(x){b="record";let c=u.tryDefinition(x.kind),y=K(c,x);C={slug:x.id,title:y,kind:x.kind,address:$e(u,x.kind,x.id)};let g=w[x.kind]?.page,m=s.views?.find(D=>D.attach===x.kind&&D.cardinality==="one");if(m&&i.push({t:"view",name:m.name,...m.title?{title:m.title}:{},...m.replaces==="page"?{replaces:!0}:{},...m.parts?{parts:m.parts}:{}}),m?.replaces==="page")b=`view:${m.name}`,l.push(...Ue(n,[m]));else{g&&i.push(...P(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let D=c?.computed?re(u,A,x):x;for(let v of je(c,_(D,c,{said:[y],locale:n.brand?.locale,timeZone:n.brand?.timeZone}))){v.title&&i.push({t:"heading",level:2,text:v.title});for(let d of v.fields)i.push({t:"field",label:d.label,text:d.value,...d.long?{long:!0}:{},...d.markdown?{markdown:!0}:{}})}}}else{let c=M;C={slug:c.slug,title:c.title,kind:c.kind,address:c.address};let y=c.lens?ke(n).drawn.find(g=>g.as===c.slug&&(c.kind===null||g.kinds.includes(c.kind))):void 0;if(c.kind!==null&&y?.create!==!1&&c.view===void 0&&(N=Ee(r,e,c.kind).map(g=>Te(r,e,g))),c.view!==void 0&&!y){let g=s.views?.find(m=>m.name===c.view);b=`view:${c.view}`,i.push({t:"view",name:c.view,title:g?.title??c.title,...typeof g?.flows=="boolean"?{flows:g.flows}:{},...g?.parts?{parts:g.parts}:{}})}else if(c.kind===null){let g=n.brand,m=g?.name??n.name,D=we(g)?.light,v=D&&ye(D)?D:void 0;if($={name:m,...g?.subtitle&&g.subtitleDrawn!==!1?{subtitle:g.subtitle}:{},...v?{logo:{alt:g?.logoAlt??m,...he(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},n.home)b="blocks",i=P(k(null,{}),0,"views.home");else{b="derived";let d=r.kindsKeptFrom(e),W=new Set([...n.pages?.hide??[],...d,...r.modules.disabledKinds]),O=xe(u.kinds,n.pages?.order).filter(B=>!W.has(B));i.push({t:"heading",level:1,text:n.name??"Home"});for(let B of O){let h=A.nodesOfKind(B).filter(j=>T(u.tryDefinition(B),j)).length;h>0&&i.push({t:"text",text:`${h} ${L(u,B,h)}`})}}}else if(y?.lens==="blocks")b="lens:blocks",i=P(k(null,{blocks:y.options.blocks??[]}),0,`lenses.${y.index}.options.blocks`);else if(y?.lens==="columns"){b="lens:columns";let g=y.options.bindings??{};for(let m of Object.keys(g)){let D=g[m]?.column;if(!D)continue;let v=E(u,m,D),d=U(A.nodesOfKind(m).filter(h=>T(u.tryDefinition(m),h)),y.options.sort,(h,j)=>j==="label"?K(u.tryDefinition(h.kind),h):h[j]);Object.keys(g).length>1&&i.push({t:"heading",level:2,text:L(u,m,2).replace(/^./,h=>h.toUpperCase())}),i.push({t:"text",text:`${d.length} ${L(u,m,d.length)} in columns by ${q(u.tryDefinition(m),D).toLowerCase()}.`});let W=v.map(h=>({column:h,items:d.filter(j=>X(j,D,v)===h.value).map(j=>f(j,"card",1))})).filter(({column:h,items:j})=>h.value!==null||j.length>0).map(({column:h,items:j})=>({heading:`${h.label} (${j.length})`,items:j}));i.push({t:"list",as:"card",columns:1,groups:W});let O=new Map;for(let h of d)for(let j of oe(r,e,h,D,v))O.set(j.to,(O.get(j.to)??new Set).add(`"${j.title}"`));let B=v.filter(h=>h.value!==null&&O.has(h.value)).map(h=>`to ${h.label} by ${[...O.get(h.value)].join(" or ")}`);i.push({t:"text",text:B.length>0?`Moves: ${B.join("; ")}.`:"Moves: none for this seat."})}}else if(y?.lens==="coverage")b="lens:coverage",i=We(u,A,y.options);else if(y){b=`lens:${y.lens}`;let g=y.kinds.flatMap(m=>A.nodesOfKind(m).filter(D=>T(u.tryDefinition(m),D)));i.push({t:"text",text:`A ${y.lens} of ${g.length} ${y.kinds.map(m=>L(u,m,g.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:g.map(m=>f(m,"name",1))}]})}else{b="derived";let g=A.nodesOfKind(c.kind).filter(m=>T(u.tryDefinition(c.kind),m));i.push({t:"heading",level:1,text:c.title}),g.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${L(u,c.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:g.map(m=>f(m,"row",1))}]})}}let V=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=C.kind===null?st(u,A):[],ce={...$?{masthead:$}:{},...le.length>0?{facts:le}:{},place:C,seat:V,width:a,variant:qe,drawnBy:b,parts:i,...N.length>0?{forms:N}:{},problems:l};return{ok:!0,description:{...ce,text:ae(ce)}}}function ot(r,e,t){let s=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],n={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:t,variant:t<_e?"phone":"wide",drawnBy:"form",parts:s,forms:[He(r,e)],problems:[]};return{...n,text:ae(n)}}function st(r,e){let t=Re(r,e,null),s=n=>Array.isArray(n)?n.map(s).join(", "):n===null?"nothing":typeof n=="boolean"?n?"yes":"no":typeof n=="object"?n.label:String(n);return[...Se(r)].map(([n,a])=>{let o=a.label??Z(n);return Object.hasOwn(t.values,n)?{name:n,label:o,value:s(t.values[n])}:{name:n,label:o,refused:t.refused[n]??"it could not be worked out"}})}function L(r,e,t){let s=r.tryDefinition(e);if(t===1)return s?.noun??e;let n=pe(r,e);return ue(n)}function ae(r){let e=[`${r.place.title} (${r.place.address}) \u2014 as ${r.seat}, ${r.width} wide (${r.variant}).`],t=r.masthead;t&&e.push(`Masthead: ${t.logo?`the logo ("${t.logo.alt}", ${t.logo.drawn==="image"?t.logo.src:"inline SVG"}), `:""}${t.name}${t.subtitle?` \u2014 ${t.subtitle}`:""}`);let s=(n,a)=>{for(let o of n)switch(o.t){case"heading":e.push(`${a}${"#".repeat(o.level)} ${o.text}`);break;case"text":e.push(`${a}${o.text}`);break;case"badge":e.push(`${a}[${o.text}]`);break;case"field":case"progress":e.push(`${a}${o.label}: ${o.text}`);break;case"figure":e.push(`${a}${o.text}${o.label?` \u2014 ${o.label}`:""}`);break;case"list":if(o.groups.length===0){o.empty&&e.push(`${a}(${o.empty})`);break}for(let p of o.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let u of p.items)e.push(`${a}${p.heading?" ":""}- ${u.title}`),s(u.parts,`${a}${p.heading?" ":" "}`)}o.as==="card"&&o.columns>1&&e.push(`${a}(cards, ${o.columns} across)`),o.more&&e.push(`${a}and ${o.more} more`);break;case"view":e.push(`${a}[the view "${o.title??o.name}"${o.replaces?", in place of the page":""}${o.flows===!0?", flowing with the page":o.flows===!1?", in a frame of its own":""}]`),o.parts&&s(o.parts,`${a} `);break}};s(r.parts,"");for(let n of r.forms??[])e.push(...Le(n));if(r.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let n of r.facts)e.push(`- ${n.label} (${n.name}): ${n.value??`not worked out \u2014 ${n.refused}`}`)}if(r.problems.length>0){e.push("Problems:");for(let n of r.problems)e.push(`- ${n.at}: ${n.says}`)}return e.join(`
|
|
1
|
+
import{a as Ge}from"./chunk.ET3XJDPX.js";import{c as Me,d as Oe,f as Be}from"./chunk.Z7N3MJ36.js";import{e as Pe,f as Ce,j as Re,k as re,l as Fe}from"./chunk.GLTWLQ6L.js";import{f as Se}from"./chunk.NVRK6A7T.js";import{d as _,e as je,k as ne}from"./chunk.OU5TRY4N.js";import{b as De,e as Ae}from"./chunk.CQPNDJAC.js";import{$ as ue,$c as ve,Ac as ye,C as Q,Cc as we,Gb as fe,Hc as U,Hd as xe,I as de,Ic as be,Yb as te,Zb as ge,ca as T,da as K,ea as me,fa as Z,ga as ee,ha as pe,ka as q,ma as z,pd as $e,yc as he,zd as ke}from"./chunk.P4CLT32V.js";function ze(r,e,t){let s=r.tryDefinition(e)?.fields.shape,n=Q(s?.[t]),a=!1,o=!1;for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)(n.type==="optional"||n.type==="nullable")&&(a=!0),(n.type==="default"||n.type==="prefault")&&(o=!0),n=Q(n.innerType);if(n?.type!=="enum")return;let p=(n.entries?Object.values(n.entries):n.values??[]).filter(u=>typeof u=="string");return p.length>0?{values:p,empty:a&&!o}:void 0}function E(r,e,t){let s=ze(r,e,t);if(!s)return[];let n=r.tryDefinition(e),a=s.values.map(o=>({value:o,label:De(n,t,o)}));return s.empty&&a.push({value:null,label:`No ${q(n,t).toLowerCase()}`}),a}function X(r,e,t){let s=r[e];return typeof s=="string"&&t.some(n=>n.value===s)?s:null}function oe(r,e,t,s,n=E(r.schema,t.kind,s)){return Ie(r,e,t,s,n).flatMap(a=>a.move?[a.move]:[])}function Ie(r,e,t,s,n=E(r.schema,t.kind,s)){let a=Ne(r.schema,r.allMutations(),t.kind,s,n),o=X(t,s,n),p=z(r.schema.tryDefinition(t.kind),t.kind),u=[];for(let{value:A,label:R,by:F,acts:M}of a){if(A===o)continue;let x,G,I;for(let l of M){let w=F==="step"?{[l.subject.arg]:t.id}:{[l.subject.arg]:t.id,[s]:A},S={name:l.name,args:w};if(!l.input.safeParse(w).success){I??=`${l.title??l.name} asks for more than the ${p} itself.`;continue}let k=r.permits(S,e);if(!k.ok){G??=k.refusal?.message??`You may not ${l.title??l.name}.`;continue}try{fe(r.graph,l,w)}catch(f){G??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:l.title??l.name};break}u.push(x?{to:A,label:R,move:x}:{to:A,label:R,why:G??I??`Nothing in this app moves a ${p} to ${R}.`})}return u}function Ne(r,e,t,s,n=E(r,t,s)){let a=Ve(r,e,t,s),o=Ke(r,e,t,s);return n.flatMap(p=>{if(p.value===null)return[];let u=a.filter(A=>A.sets?.[s]===p.value);return[{value:p.value,label:p.label,by:u.length>0?"step":o.length>0?"value":"none",acts:u.length>0?u:o}]})}function Ve(r,e,t,s){return e.filter(n=>n.subject!==void 0&&n.derived===void 0&&typeof n.sets?.[s]=="string"&&te(r,n).includes(t))}function Ke(r,e,t,s){let n=r.tryDefinition(t);return n?e.filter(a=>{if(!a.subject||!te(r,a).includes(t)||!ge(a,n).includes(s))return!1;let o=a.input.shape;return o!==void 0&&s in o}).sort((a,o)=>+(a.derived!==void 0)-+(o.derived!==void 0)):[]}var se=(r,e)=>e&&r[e]!==void 0?String(r[e]):"";function Xe(r,e,t){let s=l=>r.tryDefinition(l)?e.nodesOfKind(l).filter(w=>T(r.tryDefinition(l),w)):[],n=s(t.rows),a=s(t.columns),o=new Set(n.map(l=>l.id)),p=new Set(a.map(l=>l.id)),u=e.allEdges(),A=[],R=t.link;if(typeof R=="string"){let l=f=>r.tryDefinition(f)?.edges?.[R]?.to,w=(l(t.columns)??[]).some(f=>f===t.rows||f==="*"),S=(l(t.rows)??[]).some(f=>f===t.columns||f==="*"),k=w||!S;for(let f of u){if(f.kind!==R)continue;let P=k?f.to:f.from,i=k?f.from:f.to;o.has(P)&&p.has(i)&&A.push({rowId:P,columnId:i,via:[]})}}else{let l=new Map(R.path.map(S=>[S,new Map]));for(let S of u){let k=l.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let P=k.get(S.to);P?P.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of R.path){let P=[],i=new Set;for(let $ of k)for(let b of l.get(f).get($.id)??[])i.has(`${$.id}|${b}`)||(i.add(`${$.id}|${b}`),P.push({id:b,via:[...$.via,$.id]}));k=P}for(let f of k){let P=`${f.id}|${S.id}`;!o.has(f.id)||w.has(P)||(w.add(P),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let F=t.groupOrder??[],M=l=>F.indexOf(l)===-1?F.length:F.indexOf(l),x=(l,w)=>w==="label"?K(r.tryDefinition(l.kind),l):l[w],G=U(n,t.sort,x).map(l=>{let w=l;return{node:l,label:K(r.tryDefinition(l.kind),l),group:se(w,t.rowGroup),ref:se(w,t.rowRef)}}).sort((l,w)=>M(l.group)-M(w.group)||(t.sort!==void 0?0:l.ref<w.ref?-1:l.ref>w.ref?1:0)),I=U(a,t.columnSort,x).map(l=>({node:l,label:K(r.tryDefinition(l.kind),l),group:se(l,t.columnGroup)})).sort((l,w)=>l.group<w.group?-1:l.group>w.group?1:t.columnSort!==void 0?0:l.node.id<w.node.id?-1:l.node.id>w.node.id?1:0);return{rows:G,columns:I,cells:A}}function We(r,e,t){let{rows:s,columns:n,cells:a}=Xe(r,e,t),o=(i,$)=>ee(r,i,$),p=i=>ee(r,i,1).replace(/^1 /,""),u=i=>({id:i.id,kind:i.kind,title:K(r.tryDefinition(i.kind),i),parts:[]}),A=i=>{let $=e.getNode(i);if(!$)return null;let b=r.tryDefinition($.kind),C=K(b,$),N=_($,b,{limit:3,said:[C],glance:!0}).map(V=>V.alone.startsWith(V.label)?`${V.label.toLowerCase()}${V.alone.slice(V.label.length)}`:V.alone);return[C,...N].join(", ")},R=typeof t.link=="string"?[]:t.link.path.slice(0,-1).flatMap((i,$,b)=>{let C=ve(r,t.columns,b.slice(0,$+1));return C.ok?[...C.reached]:[]}),F=be(r,t,{rows:s.length,columns:n.length,cells:a.length});if(F)return[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}.`},{t:"text",text:F}];let M=[{t:"text",text:`${o(t.rows,s.length)} against ${o(t.columns,n.length)}${R.length>0?`, through ${[...new Set(R)].map(i=>o(i,2).replace(/^2 /,"")).join(" and ")}`:""}${n.length>0?`: ${n.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(n.map(i=>[i.node.id,i.label])),G=new Map(n.map((i,$)=>[i.node.id,$])),I=new Map,l=new Map;for(let i of a){let $=I.get(i.rowId);$?$.push(i):I.set(i.rowId,[i]);let b=l.get(i.columnId);b?b.add(i.rowId):l.set(i.columnId,new Set([i.rowId]))}for(let i of s){let b=[...I.get(i.node.id)??[]].sort((C,N)=>G.get(C.columnId)-G.get(N.columnId)).map(C=>{let N=C.via.map(A).filter(V=>V!==null);return`${x.get(C.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});M.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}M.push({t:"list",as:"name",columns:1,groups:n.map(i=>{let $=l.get(i.node.id)??new Set,b=s.filter(C=>$.has(C.node.id)).map(C=>u(C.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=s.filter(i=>!w.has(i.node.id)),f=n.filter(i=>!S.has(i.node.id)),P=t.rows===t.columns;return k.length>0&&M.push({t:"text",text:`${P?`${k.length} with none across`:`${o(t.rows,k.length)} with no ${p(t.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&M.push({t:"text",text:`${P?`${f.length} with none down`:`${o(t.columns,f.length)} on no ${p(t.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),M}function ie(r,e,t,s={}){let{app:n,blocks:a=t?n?.viewSpecs?.[t.kind]?.[s.slot??"page"]:n?.home}=s;if(!a?.length)return[];let o=s.firstHeading??(t||s.blocks?void 0:1),p=Fe(r,e,t,{...s,money:s.money??n?.brand,firstHeading:o});return t&&!p.node?[]:Ce(typeof a[0]?.t=="string"?a:Pe(a),p)}function Y(r,e,t){let s=!(e.optional||e.control==="boolean"),n=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(o=>Z(z(r.tryDefinition(o),o))).join(" or "):t(e.name).label,a={name:e.name,label:n,required:s};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(o=>t(e.name).option(o))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(r,e.item,t).input}`};case"group":return{...a,input:"group",fields:e.fields.map(o=>Y(r,o,t))};case"variant":return{...a,input:"one of",choices:e.options.map(o=>Z(o.value))};default:return{...a,input:"answer"}}}function Te(r,e,t){let s=Oe(r,e,t),n=r.schema,a=Me(n,t).filter(p=>p.name!==t.subject?.arg&&!s.has(p.name)),o=me(t);return{act:t.name,title:o,submit:o,fields:a.map(p=>Y(n,p,u=>ne(n,t,u)))}}function He(r,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(t=>Y(r,t,s=>ne(r,e.act,s)))}}function Ee(r,e,t){return r.permittedMutations(e).filter(s=>!s.derived&&!s.subject&&(s.creates??[]).includes(t))}function Le(r,e=""){let t=[`${e}Form "${r.title}" (${r.visitor?`the visitor form ${r.visitor}, running `:""}act ${r.act}), button "${r.submit}":`],s=(n,a)=>{for(let o of n){let p=o.choices?`${o.input}: ${o.choices.join(", ")}`:o.kinds?`${o.input} (${o.kinds.join(" or ")})`:o.input,u=o.min!==void 0||o.max!==void 0?`, ${o.min??"\u2026"} to ${o.max??"\u2026"}`:"";t.push(`${a}- ${o.label}${o.required?" *":""} (${o.name}) \u2014 ${p}${u}`),o.fields&&s(o.fields,`${a} `)}};return s(r.fields,`${e} `),r.fields.length===0&&t.push(`${e} (asks nothing)`),t}function Ue(r,e){let t=r.viewSpecs??{};return e.filter(s=>s.cardinality==="one"&&s.replaces==="page"&&(t[s.attach]?.page?.length??0)>0).map(s=>{let n=L(r.schema,s.attach,1);return{at:`views.${s.attach}.page`,says:`The view "${s.name}" replaces ${Ye(n)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Ye=r=>`${/^[aeiou]/i.test(r)?"an":"a"} ${r}`,Je=240,Ze=10,Qe=1160,et=40,_e=640,tt=3,nt=r=>Math.max(1,Math.floor((Math.min(r,Qe)-et+Ze)/(Je+Ze)));function rt(r,e,t,s){let{app:n}=s,a=s.width??1440,o=s.today??r.today()??de(n.brand?.timeZone),p=r.seenBy(e),u=p.schema,A=p.graph,R=Ge(n,s.views?{views:s.views}:{}),F=typeof t=="string"?t.trim():t.slug,M=typeof t=="string"?R.find(c=>c.slug===F||c.title===F||c.address===F):R.find(c=>c.slug===t.slug&&c.kind===t.kind)??t,x=!M&&typeof t=="string"?A.getNode(F):void 0,G=!M&&!x?/^\/?forms\/(.+)$/.exec(F)?.[1]:void 0,I=G!==void 0?Be(n,G):void 0;if(I)return{ok:!0,description:ot(u,I,a)};if(!M&&!x)return{ok:!1,error:`"${F}" is not a place this app has, nor a record this seat can see.`,places:[...R.map(c=>c.slug),...Object.keys(n.forms??{}).map(c=>`forms/${c}`)]};let l=[],w=n.viewSpecs??{},S=nt(a),k=(c,y)=>ie(p,null,c,{app:n,today:o,...y}),f=(c,y,g)=>{let m=u.tryDefinition(c.kind),D=K(m,c);if(y==="name")return{id:c.id,kind:c.kind,title:D,parts:[]};if(w[c.kind]?.[y]){let O=k(c,{slot:y}),[B,...h]=O,j=B?.t==="title"||y==="row"&&B?.t==="headline";return{id:c.id,kind:c.kind,title:j?B.text:D,parts:P(j?h:O,g,`views.${c.kind}.${y}`,` (${c.id})`,j?1:0)}}if(y==="row")return{id:c.id,kind:c.kind,title:D,parts:[]};let d=m?.computed?re(u,A,c):c,W=_(d,m,{limit:3,said:[D],glance:!0,locale:n.brand?.locale,timeZone:n.brand?.timeZone});return{id:c.id,kind:c.kind,title:D,parts:W.map(O=>({t:"text",text:O.alone}))}};function P(c,y,g,m="",D=0){let v=[];return c.forEach((d,W)=>{let O=`${g}.${W+D}`;switch("problem"in d&&d.problem&&l.push({at:`${O}${m}`,says:d.problem}),d.t){case"title":v.push({t:"heading",level:3,text:d.text});return;case"text":v.push({t:"text",text:d.markdown?Ae(d.text):d.runs?it(d.runs):d.text,...d.tone?{tone:d.tone}:{}});return;case"badge":v.push({t:"badge",text:d.text});return;case"field":case"image":v.push({t:"field",label:d.label,text:d.text});return;case"progress":v.push({t:"progress",label:d.label,text:d.text});return;case"group":v.push(...P(d.blocks,y,`${O}.group`,m));return;case"when":v.push(...P(d.blocks,y,`${O}.show`,m));return;case"divider":case"figure":return;case"headline":v.push({t:"heading",level:d.level,text:d.text});return;case"number":v.push({t:"figure",text:d.text,...d.label?{label:d.label}:{}});return;case"list":{if(d.failed){v.push({t:"text",text:"\u2014"});return}if(d.members.length===0){d.empty&&v.push({t:"list",as:d.as,columns:1,groups:[],empty:d.empty});return}let B=y+1,h=B>tt?"name":d.as,j=(d.groups??[{value:null,members:d.members}]).map(H=>({..."heading"in H&&H.heading?{heading:H.heading,count:(d.everyGroup?.find(J=>J.value===H.value)??H).members.length}:{},items:H.members.map(J=>f(J,h,B))}));v.push({t:"list",as:h,columns:h==="card"?S:1,groups:j,...d.more>0?{more:d.more}:{}});return}}}),v}let i=[],$,b,C,N=[];if(x){b="record";let c=u.tryDefinition(x.kind),y=K(c,x);C={slug:x.id,title:y,kind:x.kind,address:$e(u,x.kind,x.id)};let g=w[x.kind]?.page,m=s.views?.find(D=>D.attach===x.kind&&D.cardinality==="one");if(m&&i.push({t:"view",name:m.name,...m.title?{title:m.title}:{},...m.replaces==="page"?{replaces:!0}:{},...m.parts?{parts:m.parts}:{}}),m?.replaces==="page")b=`view:${m.name}`,l.push(...Ue(n,[m]));else{g&&i.push(...P(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let D=c?.computed?re(u,A,x):x;for(let v of je(c,_(D,c,{said:[y],locale:n.brand?.locale,timeZone:n.brand?.timeZone}))){v.title&&i.push({t:"heading",level:2,text:v.title});for(let d of v.fields)i.push({t:"field",label:d.label,text:d.value,...d.long?{long:!0}:{},...d.markdown?{markdown:!0}:{}})}}}else{let c=M;C={slug:c.slug,title:c.title,kind:c.kind,address:c.address};let y=c.lens?ke(n).drawn.find(g=>g.as===c.slug&&(c.kind===null||g.kinds.includes(c.kind))):void 0;if(c.kind!==null&&y?.create!==!1&&c.view===void 0&&(N=Ee(r,e,c.kind).map(g=>Te(r,e,g))),c.view!==void 0&&!y){let g=s.views?.find(m=>m.name===c.view);b=`view:${c.view}`,i.push({t:"view",name:c.view,title:g?.title??c.title,...typeof g?.flows=="boolean"?{flows:g.flows}:{},...g?.parts?{parts:g.parts}:{}})}else if(c.kind===null){let g=n.brand,m=g?.name??n.name,D=we(g)?.light,v=D&&ye(D)?D:void 0;if($={name:m,...g?.subtitle&&g.subtitleDrawn!==!1?{subtitle:g.subtitle}:{},...v?{logo:{alt:g?.logoAlt??m,...he(v)?{drawn:"inline SVG"}:{drawn:"image",src:v}}}:{}},n.home)b="blocks",i=P(k(null,{}),0,"views.home");else{b="derived";let d=r.kindsKeptFrom(e),W=new Set([...n.pages?.hide??[],...d,...r.modules.disabledKinds]),O=xe(u.kinds,n.pages?.order).filter(B=>!W.has(B));i.push({t:"heading",level:1,text:n.name??"Home"});for(let B of O){let h=A.nodesOfKind(B).filter(j=>T(u.tryDefinition(B),j)).length;h>0&&i.push({t:"text",text:`${h} ${L(u,B,h)}`})}}}else if(y?.lens==="blocks")b="lens:blocks",i=P(k(null,{blocks:y.options.blocks??[]}),0,`lenses.${y.index}.options.blocks`);else if(y?.lens==="columns"){b="lens:columns";let g=y.options.bindings??{};for(let m of Object.keys(g)){let D=g[m]?.column;if(!D)continue;let v=E(u,m,D),d=U(A.nodesOfKind(m).filter(h=>T(u.tryDefinition(m),h)),y.options.sort,(h,j)=>j==="label"?K(u.tryDefinition(h.kind),h):h[j]);Object.keys(g).length>1&&i.push({t:"heading",level:2,text:L(u,m,2).replace(/^./,h=>h.toUpperCase())}),i.push({t:"text",text:`${d.length} ${L(u,m,d.length)} in columns by ${q(u.tryDefinition(m),D).toLowerCase()}.`});let W=v.map(h=>({column:h,items:d.filter(j=>X(j,D,v)===h.value).map(j=>f(j,"card",1))})).filter(({column:h,items:j})=>h.value!==null||j.length>0).map(({column:h,items:j})=>({heading:`${h.label} (${j.length})`,items:j}));i.push({t:"list",as:"card",columns:1,groups:W});let O=new Map;for(let h of d)for(let j of oe(r,e,h,D,v))O.set(j.to,(O.get(j.to)??new Set).add(`"${j.title}"`));let B=v.filter(h=>h.value!==null&&O.has(h.value)).map(h=>`to ${h.label} by ${[...O.get(h.value)].join(" or ")}`);i.push({t:"text",text:B.length>0?`Moves: ${B.join("; ")}.`:"Moves: none for this seat."})}}else if(y?.lens==="coverage")b="lens:coverage",i=We(u,A,y.options);else if(y){b=`lens:${y.lens}`;let g=y.kinds.flatMap(m=>A.nodesOfKind(m).filter(D=>T(u.tryDefinition(m),D)));i.push({t:"text",text:`A ${y.lens} of ${g.length} ${y.kinds.map(m=>L(u,m,g.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:g.map(m=>f(m,"name",1))}]})}else{b="derived";let g=A.nodesOfKind(c.kind).filter(m=>T(u.tryDefinition(c.kind),m));i.push({t:"heading",level:1,text:c.title}),g.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${L(u,c.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:g.map(m=>f(m,"row",1))}]})}}let V=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=C.kind===null?st(u,A):[],ce={...$?{masthead:$}:{},...le.length>0?{facts:le}:{},place:C,seat:V,width:a,variant:qe,drawnBy:b,parts:i,...N.length>0?{forms:N}:{},problems:l};return{ok:!0,description:{...ce,text:ae(ce)}}}function ot(r,e,t){let s=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],n={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:t,variant:t<_e?"phone":"wide",drawnBy:"form",parts:s,forms:[He(r,e)],problems:[]};return{...n,text:ae(n)}}function st(r,e){let t=Re(r,e,null),s=n=>Array.isArray(n)?n.map(s).join(", "):n===null?"nothing":typeof n=="boolean"?n?"yes":"no":typeof n=="object"?n.label:String(n);return[...Se(r)].map(([n,a])=>{let o=a.label??Z(n);return Object.hasOwn(t.values,n)?{name:n,label:o,value:s(t.values[n])}:{name:n,label:o,refused:t.refused[n]??"it could not be worked out"}})}function L(r,e,t){let s=r.tryDefinition(e);if(t===1)return s?.noun??e;let n=pe(r,e);return ue(n)}function ae(r){let e=[`${r.place.title} (${r.place.address}) \u2014 as ${r.seat}, ${r.width} wide (${r.variant}).`],t=r.masthead;t&&e.push(`Masthead: ${t.logo?`the logo ("${t.logo.alt}", ${t.logo.drawn==="image"?t.logo.src:"inline SVG"}), `:""}${t.name}${t.subtitle?` \u2014 ${t.subtitle}`:""}`);let s=(n,a)=>{for(let o of n)switch(o.t){case"heading":e.push(`${a}${"#".repeat(o.level)} ${o.text}`);break;case"text":e.push(`${a}${o.text}`);break;case"badge":e.push(`${a}[${o.text}]`);break;case"field":case"progress":e.push(`${a}${o.label}: ${o.text}`);break;case"figure":e.push(`${a}${o.text}${o.label?` \u2014 ${o.label}`:""}`);break;case"list":if(o.groups.length===0){o.empty&&e.push(`${a}(${o.empty})`);break}for(let p of o.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let u of p.items)e.push(`${a}${p.heading?" ":""}- ${u.title}`),s(u.parts,`${a}${p.heading?" ":" "}`)}o.as==="card"&&o.columns>1&&e.push(`${a}(cards, ${o.columns} across)`),o.more&&e.push(`${a}and ${o.more} more`);break;case"view":e.push(`${a}[the view "${o.title??o.name}"${o.replaces?", in place of the page":""}${o.flows===!0?", flowing with the page":o.flows===!1?", in a frame of its own":""}]`),o.parts&&s(o.parts,`${a} `);break}};s(r.parts,"");for(let n of r.forms??[])e.push(...Le(n));if(r.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let n of r.facts)e.push(`- ${n.label} (${n.name}): ${n.value??`not worked out \u2014 ${n.refused}`}`)}if(r.problems.length>0){e.push("Problems:");for(let n of r.problems)e.push(`- ${n.at}: ${n.says}`)}return e.join(`
|
|
2
2
|
`)}function it(r){return r.map((e,t)=>(t===0?"":e.field===void 0&&r[t-1].field===void 0?" \xB7 ":" ")+e.text).join("")}export{E as a,X as b,oe as c,Ie as d,Ne as e,Ve as f,Ke as g,ie as h,Ue as i,rt as j,ae as k};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as K}from"./chunk.
|
|
1
|
+
import{o as K}from"./chunk.GYTVL6GR.js";import{G as R,T as x,aa as N,ba as $}from"./chunk.TMYGLXR6.js";import"./chunk.SDO3U72B.js";import{hd as g,ia as w,id as b,jd as f,od as h,qd as k}from"./chunk.P4CLT32V.js";import"./chunk.SLBWPVIY.js";import{b as v}from"./chunk.AJZBJBMO.js";var u=v(R(),1);var o=v(x(),1),E=()=>()=>{};function C(e){let n=(0,u.useMemo)(()=>e?.onChange?i=>e.onChange(i):E,[e]),t=()=>e?.current()??b;return(0,u.useSyncExternalStore)(n,t,t)}var D=(e,n)=>e.lens?n.may.lenses:n.may.views;async function p(e,n,t){try{return await n(),!0}catch(i){return e?.notify({kind:"toast",tone:"bad",sentence:i instanceof Error&&i.message?i.message:t}),!1}}function H(e,n,t,i,r){let s=e.name;return p(r,()=>n==="view"&&s!==void 0?i?t.hide(s):t.show(s):t.lens?.({op:"set-lens-hidden",title:e.title,on:e.kind,hidden:i}),i?`\u201C${e.title}\u201D could not be hidden.`:`\u201C${e.title}\u201D could not be shown.`)}function L(e,n,t,i,r){return p(r,()=>t.lens?.({op:"set-lens-hidden",title:e,hidden:i}),i?`\u201C${n}\u201D could not be hidden.`:`\u201C${n}\u201D could not be shown.`)}function V(e,n,t){return p(t,()=>n.restore(e.name),`\u201C${e.title}\u201D could not be restored.`)}async function M(e,n,t,i){let r=n==="view"&&e.name!==void 0?e.name:g(e.title),s=await p(i,()=>n==="view"&&e.name!==void 0?t.remove(e.name,{title:e.title,kind:e.kind}):t.lens?.({op:"remove-lens",title:e.title,on:e.kind}),`\u201C${e.title}\u201D could not be deleted.`);return s&&i?.notify({kind:"toast",id:`deleted-view-${r}`,sentence:`Deleted \u201C${e.title}\u201D. It is under Recently deleted in the places for ${30} days.`,action:{label:"Restore",onSelect:()=>void V({name:r,title:e.title},t,i)}}),s}function G(){let e=$(),n=e?.keptViews,t=C(n),i=e?.views;return(0,u.useMemo)(()=>{if(!n||!i)return null;let r=d=>f(d,t,n),s=new Set,m=i.places().filter(d=>{if(!d.hidden||r(d)===null)return!1;let c=`${d.name??""}|${d.title}`;return s.has(c)?!1:(s.add(c),!0)}),l=e?.store.schema,y=t.may.lenses&&n.lens&&l?(i.arrangement?.()?.hide??[]).filter(d=>l.tryDefinition(d)!==void 0).map(d=>({kind:d,title:w(l,d),path:h(l,d)})):[];return{keeper:n,hidden:m,lists:y,removed:t.removed.filter(d=>D(d,t)),how:r}},[n,t,i,e?.store.schema])}function T(e,n){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(n??"en-US",{month:"short",day:"numeric"})}var I=`.graview-bar-list li.graview-bar-tidied{display:flex;align-items:flex-start;gap:8px;padding:0 0 0 2px}
|
|
2
2
|
.graview-bar-tidied>.graview-bar-item,.graview-bar-gone{flex:1 1 auto;min-width:0}
|
|
3
3
|
.graview-bar-gone{display:grid;gap:1px;padding:7px 8px;font-size:.875rem;line-height:1.3;overflow-wrap:anywhere;color:var(--graview-ink-muted)}
|
|
4
4
|
.graview-bar-gone small{font-size:.75rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as P,c as m,d as k}from"./chunk.
|
|
1
|
+
import{b as P,c as m,d as k}from"./chunk.FFCUZPTC.js";import{b as v,c as w,d as S,e as x,f as M}from"./chunk.G446PWV6.js";import"./chunk.MG3DMURZ.js";import"./chunk.2W2YVB6X.js";import"./chunk.P4CLT32V.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";var O=new Set(["input","select","textarea"]),g=r=>r.namespaceURI==="http://www.w3.org/1999/xhtml"&&O.has(r.localName),N=r=>r.localName==="select"||r.type==="checkbox"||r.type==="radio",E=r=>r.type==="checkbox"||r.type==="radio"?!r.checked:r.localName!=="select"&&r.value==="";function h(r){return r.type==="checkbox"||r.type==="radio"?`checked:${r.checked}`:r.localName==="select"&&r.multiple?`selected:${[...r.selectedOptions].map(n=>n.value).join("\0")}`:`value:${r.value}`}function F(r=n=>n.isTrusted){let n=new WeakMap,d=new WeakSet,o=new WeakMap,i={heard(e,t){if(!(!g(t)||!r(e))&&(e.type==="input"||e.type==="change"&&N(t))&&((N(t)||E(t))&&d.delete(t),E(t)&&o.delete(t),n.set(t,h(t)),t.type==="radio"&&t.name)){let c=t.getRootNode();for(let u of c.querySelectorAll?.('input[type="radio"]')??[])u.name===t.name&&n.set(u,h(u))}},filled(e){n.delete(e),o.delete(e),g(e)&&!E(e)?d.add(e):d.delete(e)},press(e,t,c){if(!r(e))return;let u=t.closest("[data-act]");if(!u||!w(u))return;let l=e.type==="keydown"?e.key:void 0;if(!(e.type!=="click"&&!((l==="Enter"||l===" ")&&t===u&&!v(u))))return i.collect(u,c)},collect(e,t){if(!e.hasAttribute("data-act")||!t.contains(e))return;let c=e.closest("[data-record]"),u=e.closest("fieldset, [role='group']")??t,l=[];for(let a of u.querySelectorAll("input[name], select[name], textarea[name]")){let s=a,f=!d.has(s)&&n.get(s)===h(s);if(s.type==="radio"){if(!s.checked)continue;l.push({name:s.name,value:s.value,typed:f,empty:!1,chosen:!0});continue}if(s.localName==="select"){l.push({name:s.name,value:s.value,typed:f,empty:s.value===""&&!f,chosen:!0});continue}if(s.type==="checkbox"){l.push({name:s.name,value:s.checked,typed:f,empty:!s.checked&&!d.has(s)&&!f});continue}let R=(s.type==="number"||s.type==="range")&&s.value!==""&&Number.isFinite(s.valueAsNumber)?s.valueAsNumber:s.value,A=f?o.get(s):void 0;l.push({name:s.name,value:R,typed:f,empty:s.value===""&&!f,...A?{from:A}:{}})}return{as:e.getAttribute("data-act")??"",...c&&t.contains(c)?{record:c.getAttribute("data-record")}:{},fields:l}},prefilled(e,t){d.delete(e),o.set(e,t),n.set(e,h(e))}};return i}var b=new WeakMap,L=(r,n)=>{n.tab&&r.removeAttribute("tabindex"),n.role&&r.getAttribute("role")==="button"&&r.removeAttribute("role"),r.removeAttribute("data-graview-press"),b.delete(r)};function W(r){for(let n of r.querySelectorAll("[data-act], [data-graview-press], [role], [aria-pressed], [aria-expanded]")){let d=b.get(n),o=w(n)&&!v(n)&&!g(n),i=!o&&S(n,d?.role?null:n.getAttribute("role"));if(d&&(d.bound!==o||!(o||i))&&L(n,d),(o||i)&&!b.has(n)){let e=!x(n),t=o&&M(n);e&&n.setAttribute("tabindex","0"),t&&n.setAttribute("role","button"),n.setAttribute("data-graview-press",""),b.set(n,{tab:e,role:t,bound:o})}}}var y=new WeakSet;function V(r){for(let n of r.querySelectorAll("svg")){let d=n.hasAttribute("role")||n.hasAttribute("aria-label")||n.hasAttribute("aria-labelledby")||[...n.children].some(e=>e.localName==="title"),o=n.hasAttribute("tabindex")||n.hasAttribute("data-graview-link")||n.hasAttribute("data-graview-press")||n.querySelector("[tabindex], [data-graview-link], [data-graview-press], a")!==null,i=!d&&!o;i&&!y.has(n)&&!n.hasAttribute("aria-hidden")?(n.setAttribute("aria-hidden","true"),y.add(n)):!i&&y.has(n)&&(n.removeAttribute("aria-hidden"),y.delete(n))}}var j=1e3;function I(r){let n=r.getAttribute("data-debounce")?.trim(),d=n?Number(n):Number.NaN;return Number.isFinite(d)?Math.min(1e4,Math.max(250,Math.round(d))):j}function B(r){let n=r.trusted??(e=>e.isTrusted),d=r.timers??{set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)},o=new Map,i=(e,t)=>{let c=o.get(e);c&&d.clear(c.handle),o.delete(e);let u=r.reader.collect(e,t);u&&r.save(u,e)};return{heard(e,t,c){if(!g(t)||!n(e)||!t.hasAttribute("data-act"))return;let u=t.getAttribute("data-save");if(e.type==="input"&&u==="input"){let l=o.get(t);l&&d.clear(l.handle),o.set(t,{root:c,handle:d.set(()=>i(t,c),I(t))})}else e.type==="change"&&(u==="change"||u==="input"&&o.has(t))&&i(t,c)},flush(){for(let[e,{root:t}]of[...o])i(e,t)},get waiting(){return o.size}}}var H=new Set(["text","search","email","url","tel","number"]);function D(r,n,d,o){for(let i of r.querySelectorAll("input[data-prefill], textarea[data-prefill]")){let e=i;if(d.has(e))continue;let t=e.getAttribute("data-prefill")??"";if(t===""||e.getAttribute("name")!==t||e.localName==="input"&&!H.has(e.type))continue;if(e.value!==""){d.add(e);continue}let u=[...(e.closest("fieldset, [role='group']")??r).querySelectorAll("[data-act]")],l=e.closest("[data-record]"),a=new Set(u.map(p=>p.closest("[data-record]")?.getAttribute("data-record")).filter(p=>typeof p=="string")),s=l&&r.contains(l)?l.getAttribute("data-record"):a.size===1?[...a][0]:void 0;if(!s)continue;let f=o({record:s,field:t,acts:u.map(p=>p.getAttribute("data-act")??"")});if(f!==void 0){if(e.value=f,d.add(e),e.value!==f){e.value="";continue}n.prefilled(e,{record:s,field:t,value:f})}}}function _(r,n,d,o){let i=k(n,o.as);if(!i)return m("undeclared",`This view may not ask for \u201C${o.as}\u201D: its manifest does not name it.`);let e=r.allMutations().find(a=>a.name===i.act);if(!e)return m("unknown-act","There is no act by that name here.");let t={};if(o.record!==void 0){let a=i.record??e.subject?.arg;if(!a)return m("unbound",`\u201C${o.as}\u201D is not done to a record.`);if(!d.has(o.record))return m("unbound","That press is bound to a record this view was not shown.");t[a]=o.record}for(let[a,s]of Object.entries(i.constants??{})){if(a in t)return m("malformed",`\u201C${a}\u201D is both the bound record and a constant.`);t[a]=s}let c=e.input?.shape??{},u=new Set(Object.keys(c)),l=new Set;for(let a of o.fields)if(!(!u.has(a.name)||a.name in t)){if(l.has(a.name))return m("malformed",`Two fields here are called \u201C${a.name}\u201D.`);if(l.add(a.name),a.typed&&a.chosen){let s=P(c[a.name])?.find(f=>String(f)===String(a.value));if(s!==void 0)t[a.name]=s;else if(typeof a.value=="string"&&d.has(a.value))t[a.name]=a.value;else return m("untyped",`\u201C${a.name}\u201D was a choice among the view's own words, not one this app declares, so it was not sent.`)}else{if(a.typed&&a.from&&!(o.record===a.from.record&&a.name===a.from.field&&T(r,i,a.from.record,a.from.field)))return m("untyped",`\u201C${a.name}\u201D was filled in from a record for an act that writes it back there, not for this one, so it was not sent.`);if(a.typed&&a.from&&String(a.value)===a.from.value)t[a.name]=r.graph.getNode(a.from.record)?.[a.name]??a.value;else if(a.typed)t[a.name]=a.value;else if(!a.empty)return m("untyped",`\u201C${a.name}\u201D was filled in by the view, not typed by you, so it was not sent.`)}}return{ok:!0,name:i.act,args:t}}function T(r,n,d,o){let i=r.allMutations().find(u=>u.name===n.act),e=i?.subject;if(!i||!e||(n.record??e.arg)!==e.arg||o===e.arg||Object.hasOwn(n.constants??{},o)||!Object.hasOwn(i.input.shape??{},o)||Object.keys(i.writesOther??{}).length>0)return!1;let t=r.graph.getNode(d)?.kind,c=t===void 0?void 0:r.schema.tryDefinition(t);return!c||e.kinds!=="*"&&!e.kinds.includes(t)||!Object.hasOwn(c.fields.shape??{},o)?!1:i.writes?.includes(o)??!1}function C(r,n,d,o,i){if(!o.has(i.record))return;let e=r.seenBy(n).graph.getNode(i.record);if(!e||!i.acts.some(u=>{let l=k(d,u);if(!l||!T(r,l,i.record,i.field))return!1;let a=r.allMutations().find(s=>s.name===l.act).subject;return r.permits({name:l.act,args:{[a.arg]:i.record}},n).ok}))return;let c=e[i.field];return typeof c=="string"?c:typeof c=="number"&&Number.isFinite(c)?String(c):void 0}export{j as SAVE_DEBOUNCE_MS,F as createPressReader,B as createSaver,D as fillPrefills,_ as judgePress,W as markPresses,C as prefillOf,V as quietPictures,I as saveDebounceOf,T as writesBack};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as Ry}from"./chunk.
|
|
1
|
+
import{j as Ry}from"./chunk.GYTVL6GR.js";import{G as Cy}from"./chunk.TMYGLXR6.js";import{a as an}from"./chunk.AJZBJBMO.js";var Ti=an(J=>{"use strict";function Gf(l,a){var t=l.length;l.push(a);l:for(;0<t;){var u=t-1>>>1,n=l[u];if(0<tn(n,a))l[u]=a,l[t]=n,t=u;else break l}}function Ll(l){return l.length===0?null:l[0]}function nn(l){if(l.length===0)return null;var a=l[0],t=l.pop();if(t!==a){l[0]=t;l:for(var u=0,n=l.length,f=n>>>1;u<f;){var e=2*(u+1)-1,c=l[e],i=e+1,m=l[i];if(0>tn(c,t))i<n&&0>tn(m,c)?(l[u]=m,l[i]=t,u=i):(l[u]=c,l[e]=t,u=e);else if(i<n&&0>tn(m,t))l[u]=m,l[i]=t,u=i;else break l}}return a}function tn(l,a){var t=l.sortIndex-a.sortIndex;return t!==0?t:l.id-a.id}J.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(yi=performance,J.unstable_now=function(){return yi.now()}):(Yf=Date,mi=Yf.now(),J.unstable_now=function(){return Yf.now()-mi});var yi,Yf,mi,Il=[],Aa=[],jy=1,Bl=null,ml=3,Zf=!1,au=!1,tu=!1,Cf=!1,Si=typeof setTimeout=="function"?setTimeout:null,gi=typeof clearTimeout=="function"?clearTimeout:null,hi=typeof setImmediate<"u"?setImmediate:null;function un(l){for(var a=Ll(Aa);a!==null;){if(a.callback===null)nn(Aa);else if(a.startTime<=l)nn(Aa),a.sortIndex=a.expirationTime,Gf(Il,a);else break;a=Ll(Aa)}}function Rf(l){if(tu=!1,un(l),!au)if(Ll(Il)!==null)au=!0,ht||(ht=!0,mt());else{var a=Ll(Aa);a!==null&&jf(Rf,a.startTime-l)}}var ht=!1,uu=-1,bi=5,zi=-1;function Ai(){return Cf?!0:!(J.unstable_now()-zi<bi)}function Qf(){if(Cf=!1,ht){var l=J.unstable_now();zi=l;var a=!0;try{l:{au=!1,tu&&(tu=!1,gi(uu),uu=-1),Zf=!0;var t=ml;try{a:{for(un(l),Bl=Ll(Il);Bl!==null&&!(Bl.expirationTime>l&&Ai());){var u=Bl.callback;if(typeof u=="function"){Bl.callback=null,ml=Bl.priorityLevel;var n=u(Bl.expirationTime<=l);if(l=J.unstable_now(),typeof n=="function"){Bl.callback=n,un(l),a=!0;break a}Bl===Ll(Il)&&nn(Il),un(l)}else nn(Il);Bl=Ll(Il)}if(Bl!==null)a=!0;else{var f=Ll(Aa);f!==null&&jf(Rf,f.startTime-l),a=!1}}break l}finally{Bl=null,ml=t,Zf=!1}a=void 0}}finally{a?mt():ht=!1}}}var mt;typeof hi=="function"?mt=function(){hi(Qf)}:typeof MessageChannel<"u"?(Xf=new MessageChannel,di=Xf.port2,Xf.port1.onmessage=Qf,mt=function(){di.postMessage(null)}):mt=function(){Si(Qf,0)};var Xf,di;function jf(l,a){uu=Si(function(){l(J.unstable_now())},a)}J.unstable_IdlePriority=5;J.unstable_ImmediatePriority=1;J.unstable_LowPriority=4;J.unstable_NormalPriority=3;J.unstable_Profiling=null;J.unstable_UserBlockingPriority=2;J.unstable_cancelCallback=function(l){l.callback=null};J.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):bi=0<l?Math.floor(1e3/l):5};J.unstable_getCurrentPriorityLevel=function(){return ml};J.unstable_next=function(l){switch(ml){case 1:case 2:case 3:var a=3;break;default:a=ml}var t=ml;ml=a;try{return l()}finally{ml=t}};J.unstable_requestPaint=function(){Cf=!0};J.unstable_runWithPriority=function(l,a){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var t=ml;ml=l;try{return a()}finally{ml=t}};J.unstable_scheduleCallback=function(l,a,t){var u=J.unstable_now();switch(typeof t=="object"&&t!==null?(t=t.delay,t=typeof t=="number"&&0<t?u+t:u):t=u,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=t+n,l={id:jy++,callback:a,priorityLevel:l,startTime:t,expirationTime:n,sortIndex:-1},t>u?(l.sortIndex=t,Gf(Aa,l),Ll(Il)===null&&l===Ll(Aa)&&(tu?(gi(uu),uu=-1):tu=!0,jf(Rf,t-u))):(l.sortIndex=n,Gf(Il,l),au||Zf||(au=!0,ht||(ht=!0,mt()))),l};J.unstable_shouldYield=Ai;J.unstable_wrapCallback=function(l){var a=ml;return function(){var t=ml;ml=a;try{return l.apply(this,arguments)}finally{ml=t}}}});var Mi=an((dd,Ei)=>{"use strict";Ei.exports=Ti()});var Qy=an(qf=>{"use strict";var tl=Mi(),w0=Cy(),Vy=Ry();function A(l){var a="https://react.dev/errors/"+l;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)a+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+l+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function F0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Ku(l){var a=l,t=l;if(l.alternate)for(;a.return;)a=a.return;else{l=a;do a=l,(a.flags&4098)!==0&&(t=a.return),l=a.return;while(l)}return a.tag===3?t:null}function $0(l){if(l.tag===13){var a=l.memoizedState;if(a===null&&(l=l.alternate,l!==null&&(a=l.memoizedState)),a!==null)return a.dehydrated}return null}function k0(l){if(l.tag===31){var a=l.memoizedState;if(a===null&&(l=l.alternate,l!==null&&(a=l.memoizedState)),a!==null)return a.dehydrated}return null}function Oi(l){if(Ku(l)!==l)throw Error(A(188))}function xy(l){var a=l.alternate;if(!a){if(a=Ku(l),a===null)throw Error(A(188));return a!==l?null:l}for(var t=l,u=a;;){var n=t.return;if(n===null)break;var f=n.alternate;if(f===null){if(u=n.return,u!==null){t=u;continue}break}if(n.child===f.child){for(f=n.child;f;){if(f===t)return Oi(n),l;if(f===u)return Oi(n),a;f=f.sibling}throw Error(A(188))}if(t.return!==u.return)t=n,u=f;else{for(var e=!1,c=n.child;c;){if(c===t){e=!0,t=n,u=f;break}if(c===u){e=!0,u=n,t=f;break}c=c.sibling}if(!e){for(c=f.child;c;){if(c===t){e=!0,t=f,u=n;break}if(c===u){e=!0,u=f,t=n;break}c=c.sibling}if(!e)throw Error(A(189))}}if(t.alternate!==u)throw Error(A(190))}if(t.tag!==3)throw Error(A(188));return t.stateNode.current===t?l:a}function I0(l){var a=l.tag;if(a===5||a===26||a===27||a===6)return l;for(l=l.child;l!==null;){if(a=I0(l),a!==null)return a;l=l.sibling}return null}var L=Object.assign,py=Symbol.for("react.element"),fn=Symbol.for("react.transitional.element"),mu=Symbol.for("react.portal"),At=Symbol.for("react.fragment"),r0=Symbol.for("react.strict_mode"),Te=Symbol.for("react.profiler"),P0=Symbol.for("react.consumer"),fa=Symbol.for("react.context"),Sc=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),Me=Symbol.for("react.suspense_list"),gc=Symbol.for("react.memo"),Ta=Symbol.for("react.lazy");Symbol.for("react.scope");var Oe=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var Ky=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var Di=Symbol.iterator;function nu(l){return l===null||typeof l!="object"?null:(l=Di&&l[Di]||l["@@iterator"],typeof l=="function"?l:null)}var Ly=Symbol.for("react.client.reference");function De(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Ly?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case At:return"Fragment";case Te:return"Profiler";case r0:return"StrictMode";case Ee:return"Suspense";case Me:return"SuspenseList";case Oe:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case mu:return"Portal";case fa:return l.displayName||"Context";case P0:return(l._context.displayName||"Context")+".Consumer";case Sc:var a=l.render;return l=l.displayName,l||(l=a.displayName||a.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case gc:return a=l.displayName||null,a!==null?a:De(l.type)||"Memo";case Ta:a=l._payload,l=l._init;try{return De(l(a))}catch{}}return null}var hu=Array.isArray,D=w0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Vy.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ka={pending:!1,data:null,method:null,action:null},Ue=[],Tt=-1;function $l(l){return{current:l}}function fl(l){0>Tt||(l.current=Ue[Tt],Ue[Tt]=null,Tt--)}function x(l,a){Tt++,Ue[Tt]=l.current,l.current=a}var Fl=$l(null),Nu=$l(null),Ba=$l(null),jn=$l(null);function Vn(l,a){switch(x(Ba,a),x(Nu,l),x(Fl,null),a.nodeType){case 9:case 11:l=(l=a.documentElement)&&(l=l.namespaceURI)?B0(l):0;break;default:if(l=a.tagName,a=a.namespaceURI)a=B0(a),l=Ty(a,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}fl(Fl),x(Fl,l)}function Ct(){fl(Fl),fl(Nu),fl(Ba)}function se(l){l.memoizedState!==null&&x(jn,l);var a=Fl.current,t=Ty(a,l.type);a!==t&&(x(Nu,l),x(Fl,t))}function xn(l){Nu.current===l&&(fl(Fl),fl(Nu)),jn.current===l&&(fl(jn),Vu._currentValue=ka)}var Vf,Ui;function Wa(l){if(Vf===void 0)try{throw Error()}catch(t){var a=t.stack.trim().match(/\n( *(at )?)/);Vf=a&&a[1]||"",Ui=-1<t.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
3
|
`+Vf+l+Ui}var xf=!1;function pf(l,a){if(!l||xf)return"";xf=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(S){var d=S}Reflect.construct(l,[],z)}else{try{z.call()}catch(S){d=S}l.call(z.prototype)}}else{try{throw Error()}catch(S){d=S}(z=l())&&typeof z.catch=="function"&&z.catch(function(){})}}catch(S){if(S&&d&&typeof S.stack=="string")return[S.stack,d.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=u.DetermineComponentFrameRoot(),e=f[0],c=f[1];if(e&&c){var i=e.split(`
|
|
4
4
|
`),m=c.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as t}from"./chunk.SDO3U72B.js";var d=t(()=>(__graviewPreload(import.meta.url,["./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as t}from"./chunk.SDO3U72B.js";var d=t(()=>(__graviewPreload(import.meta.url,["./chunk.ALCH5H7U.js","./chunk.KVEDMKUN.js","./chunk.UVAWWCFW.js","./chunk.PXQVXBNG.js","./chunk.BRDAO2OF.js","./chunk.FFCUZPTC.js","./chunk.G446PWV6.js","./chunk.MG3DMURZ.js","./chunk.2W2YVB6X.js","./chunk.BBLIT7S7.js","./chunk.SDO3U72B.js","./chunk.P4CLT32V.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.ESSENNHM.js")));function v(i,r){let e=!1,n=()=>{window.removeEventListener("online",n),e||o()},o=()=>void i().then(m=>{e||r(m)},()=>{e||window.addEventListener("online",n)});return o(),()=>{e=!0,window.removeEventListener("online",n)}}export{d as a,v as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b,c as w,d as R,e as V}from"./chunk.LD6S2FL5.js";import{h as l,i as S}from"./chunk.TABIRLQS.js";import{Ia as $,Ja as F}from"./chunk.PFEKS3KO.js";var E=["card","row","page"],j=["good","warn","bad","neutral","accent"],H=["money","percent","date","time","datetime","relative","count"],_=4,T=40,I=120,L=["number","money","percent"],B=["large"],U=["card","row"],M=1e3,fe=100;function C(e){let n=/^\s*(out|in)\(\s*['"]([A-Za-z][A-Za-z0-9_-]*)['"]\s*\)\s*$/.exec(e);return n?{edge:n[2],way:n[1]}:/^[A-Za-z][A-Za-z0-9_-]*$/.test(e)?{edge:e}:void 0}var v={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label","emphasis"]},Z=Object.keys(v),G=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?, "emphasis"?: "large"}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,X=e=>/^(image|video|file)$/.test(e?.of??e?.type??"");function ue(e){return Object.fromEntries(Object.entries(e.views??{}).filter(([,n])=>!Array.isArray(n)))}function ce(e){let n=e.views?.home;return Array.isArray(n)?n:void 0}var Y={field:()=>!1,relation:()=>!1,figure:!1},z=e=>e.kind??"the home",m=(e,n)=>e!==void 0&&Object.hasOwn(e,n),g=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function N(e,n,t){let o=O(e);for(let a of o.unknownFunctions)t.findings.push(l("unknown-function",n,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of o.names){if(t.kind===null){t.findings.push(l("view-name",n,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||t.spec.field(a)||t.spec.relation(a)||t.findings.push(l("view-name",n,`${t.kind} has no field or relation called "${a}"`))}for(let a of o.edges)t.edges.has(a)||t.findings.push(l("view-edge",n,`"${a}" is not a relation any kind declares`));for(let a of o.sweeps)t.kinds.has(a)||t.findings.push(l("view-kind",n,`"${a}" is not a kind this document declares`))}function k(e,n,t){if(typeof e!="string"||e.length===0||e.length>2e3){t.findings.push(l("view-expression",n,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{N(w(e),n,t)}catch(o){if(!(o instanceof b))throw o;t.findings.push(l("expression",n,`${o.sentence} (at character ${o.at+1})`))}}function A(e,n,t,o){let a=o==="text";if(typeof e!="string"||e.length===0||e.length>300){t.findings.push(l("view-template",n,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let d;try{d=V(e)}catch(r){if(r instanceof R||r instanceof b){t.findings.push(l("template",n,r.sentence));return}throw r}for(let r of d)if(r.expr){if(N(r.expr,n,t),a&&!r.format&&r.expr.t==="ident"&&(t.slot==="card"||t.slot==="row")&&t.spec.prose?.(r.expr.name)){let i=r.expr.name;t.findings.push(S("view-whole-text",n,`${t.kind} ${t.slot} shows ${i} whole; it will be clamped. Use {${i}|excerpt} or move it to the page.`,`write {${i}|excerpt}, or {${i}|excerpt: 80} for fewer characters`))}if(o==="headline"&&!r.format&&r.expr.t==="ident"&&t.spec.prose?.(r.expr.name)){let i=r.expr.name;t.findings.push(S("view-headline-long",n,`${z(t)}${t.slot?` ${t.slot}`:""} heads it with ${i}, a long text, drawn at a headline's size; a headline is a few words.`,`say it in a text block, {"text": "{${i}}"}, or head it with {${i}|excerpt: 60}`))}}}function q(e,n,t){if(typeof e=="string"){j.includes(e)||t.findings.push(l("view-tone",n,`"${e}" is not a tone`,`use one of ${j.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(g(e)&&Object.keys(e).length===1&&"expr"in e){k(e.expr,`${n}.expr`,t);return}t.findings.push(l("view-tone",n,'a tone is a word or {"expr": \u2026}',`one of ${j.join(", ")}`))}function x(e,n,t,o){if(!Array.isArray(e)){o.findings.push(l("view-shape",n,"a view is a list of blocks"));return}if(t>_){o.findings.push(l("view-depth",n,`blocks nest at most ${_} deep`,"flatten a group or a condition"));return}e.forEach((a,d)=>J(a,`${n}.${d}`,t,o))}function J(e,n,t,o){if(t===1&&o.count++,o.all++,!g(e)){o.findings.push(l("view-block",n,"a block is an object naming what it shows",`one of ${G}`));return}let a=Object.keys(e),d=a.filter(s=>Z.includes(s)&&!(s==="group"&&a.includes("list")));if(d.length===0){o.findings.push(l("view-block",n,`${a.length>0?a.map(s=>`"${s}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${G}`));return}if(d.length>1){o.findings.push(l("view-block",n,`a block is one thing, and this says ${d.map(s=>`"${s}"`).join(" and ")}`,"split it into two blocks"));return}let r=d[0];for(let s of a)s!==r&&s!="key"&&!v[r].includes(s)&&o.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" is not part of a ${r} block`,v[r].length>0?`a ${r} block may also say ${v[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=e[r];switch(r){case"title":case"headline":case"text":case"badge":A(i,`${n}.${r}`,o,r==="text"||r==="headline"?r:void 0),"tone"in e&&q(e.tone,`${n}.tone`,o);return;case"image":case"field":{let s=r==="image";if(typeof i!="string"||!(s?o.spec.files?.(i):o.spec.field(i))){let u=typeof i=="string"&&o.spec.relation(i);o.findings.push(l(`view-${r}`,`${n}.${r}`,`${o.kind} has no ${s?"image, video or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=s?["thumb","gallery"]:H;"as"in e&&!f.includes(e.as)&&o.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to show ${s?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),s||W(e,n,o,"field"),"label"in e&&ie(e.label,`${n}.label`,o);return}case"progress":{!g(i)||Object.keys(i).some(s=>s!=="value"&&s!=="max")||!("value"in i)||!("max"in i)?o.findings.push(l("view-progress",`${n}.progress`,'progress is {"value": expression, "max": expression}')):(k(i.value,`${n}.progress.value`,o),k(i.max,`${n}.progress.max`,o)),"label"in e&&A(e.label,`${n}.label`,o);return}case"group":"direction"in e&&e.direction!=="row"&&e.direction!=="column"&&o.findings.push(l("view-direction",`${n}.direction`,`a group runs "row" or "column", not "${String(e.direction)}"`)),x(i,`${n}.group`,t+1,o);return;case"when":k(i,`${n}.when`,o),"show"in e?x(e.show,`${n}.show`,t+1,o):o.findings.push(l("view-when",n,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return Q(e,n,o);for(let s of["as","currency","label","emphasis"])s in e&&o.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?o.findings.push(l("view-block",`${n}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):o.spec.figure||o.findings.push(l("view-figure",`${n}.figure`,`${z(o)} has no figure to show`,o.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return ne(e,n,o);case"divider":i!==!0&&o.findings.push(l("view-block",`${n}.${r}`,`write {"${r}": true}`));return}}function Q(e,n,t){k(e.figure,`${n}.figure`,t),"as"in e&&!L.includes(e.as)&&t.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to say a figure`,`use one of ${L.join(", ")}`)),W(e,n,t,"figure"),"label"in e&&A(e.label,`${n}.label`,t),"emphasis"in e&&!B.includes(e.emphasis)&&t.findings.push(l("view-emphasis",`${n}.emphasis`,`"${String(e.emphasis)}" is not how loudly a figure is said`,`use ${B.map(o=>`"${o}"`).join(", ")}, or leave it out for the figure's own size`))}function W(e,n,t,o){"currency"in e&&(typeof e.currency!="string"||!/^[A-Z]{3}$/.test(e.currency)?t.findings.push(l("view-currency",`${n}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):e.as!=="money"&&t.findings.push(l("view-currency",`${n}.currency`,`a currency belongs on a ${o} shown as money`,'add "as": "money"')))}function ee(e,n){let t=[...n.kinds],o=(d,r)=>{let i=new Set;for(let s of d){let f=n.vocabulary.namesOf(s)?.targets?.(r);if(f==="*")return t;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=d=>{switch(d.t){case"ident":return n.kind!==null&&n.spec.relation(d.name)?o([n.kind],d.name):void 0;case"member":{let r=a(d.object);return r?o(r,d.name):void 0}case"where":return a(d.set);case"call":{let r=d.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(d.fn==="all")return i!==void 0&&n.kinds.has(i)?[i]:void 0;let s=d.args.length===2&&d.args[1]?.t==="lit"&&typeof d.args[1].value=="string"?d.args[1].value:void 0;if(d.fn==="out"&&s!==void 0){let f=a(r);return f?o(f,s):void 0}if(d.fn==="out")return i!==void 0&&n.kind!==null?o([n.kind],i):void 0;if(d.fn==="in"){let f=s??i,u=s!==void 0?a(r):n.kind!==null?[n.kind]:void 0,c=f!==void 0?n.vocabulary.sources(f).filter(p=>{let y=n.vocabulary.namesOf(p)?.targets?.(f);return!u||y==="*"||u.some(h=>y?.includes(h))}):[];return c.length>0?c:void 0}if((d.fn==="sort"||d.fn==="first")&&r)return a(r);if(d.fn==="either"){let f=d.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(e)}function K(e,n,t,o){let a;try{a=w(e)}catch(r){if(!(r instanceof b))throw r;o.findings.push(l("expression",n,`${r.sentence} (at character ${r.at+1})`));return}let d=O(a);for(let r of d.unknownFunctions)o.findings.push(l("unknown-function",n,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of d.edges)o.edges.has(r)||o.findings.push(l("view-edge",n,`"${r}" is not a relation any kind declares`));if(t)for(let r of d.names)r==="id"||t.some(i=>o.vocabulary.namesOf(i)?.field(r)||o.vocabulary.namesOf(i)?.relation(r))||o.findings.push(l("view-name",n,`${t.join(" and ")} ${t.length===1?"has":"have"} no field or relation called "${r}"`))}function ne(e,n,t){let o=e.list;k(o,`${n}.list`,t);let a;if(typeof o=="string")try{a=ee(w(o),t)}catch{a=void 0}let d=i=>{if(!a)return[...t.kinds].map(f=>t.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let s=a.map(f=>t.vocabulary.namesOf(f)?.choices?.(i));return s.every(f=>f!==void 0)?[...new Set(s.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in e){let i=e.sort;if(typeof i=="string")K(i,`${n}.sort`,a,t);else if(g(i)&&typeof i.by=="string"&&Object.keys(i).every(s=>s==="by"||s==="direction")){let s=i.direction;s!==void 0&&s!=="asc"&&s!=="desc"&&s!=="choices"?t.findings.push(l("list-sort",`${n}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(s)}"`,'"choices" puts a choice field in the order its choices are declared')):s==="choices"?d(i.by)===void 0&&t.findings.push(l("list-sort",`${n}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):K(i.by,`${n}.sort.by`,a,t)}else t.findings.push(l("list-sort",`${n}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in e){let i=e.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>M)&&t.findings.push(l("list-limit",`${n}.limit`,`a limit is a whole number from 1 to ${M}`))}if("group"in e){let i=e.group,s=typeof i=="string"?i:g(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||g(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||s===void 0)t.findings.push(l("list-group",`${n}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}} \u2014 or a relation, like "inGenre", a heading per linked record'));else{let u=d(s),c=u===void 0?C(s):void 0,p=c!==void 0&&(c.way!==void 0?t.edges.has(c.edge):a?a.every(y=>t.vocabulary.namesOf(y)?.relation(c.edge)):t.edges.has(c.edge));if(u===void 0&&!p&&t.findings.push(l("list-group",`${n}.group`,`"${s}" is not a choice field or a relation of ${r}, so it has nothing to group by`,'group by a field whose type is enum, or by a relation of the kind listed, like "inGenre"')),g(i)&&"headings"in i){let y=i.headings;if(!g(y)||Object.values(y).some(h=>typeof h!="string"||h.length===0||h.length>80))t.findings.push(l("list-group",`${n}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let h of Object.keys(y))u.includes(h)||t.findings.push(l("list-group",`${n}.group.headings.${h}`,`"${h}" is not one of ${s}'s choices`,`use ${u.join(", ")}`))}}}"empty"in e&&(typeof e.empty!="string"||e.empty.length===0||e.empty.length>200)&&t.findings.push(l("list-empty",`${n}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in e&&!U.includes(e.as)&&t.findings.push(l("list-as",`${n}.as`,`a list draws each record as its "card" or its "row", not "${String(e.as)}"`))}function ie(e,n,t){(typeof e!="string"||e.length===0||e.length>60)&&t.findings.push(l("view-label",n,"a label is a few words, at most 60 characters"))}function D(e,n,t,o,a,d,r){let i={kind:null,spec:Y,kinds:o,edges:a,vocabulary:t,findings:d,count:0,all:0};Array.isArray(e)&&e.length===0&&d.push(l("view-shape",n,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),x(e,n,1,i),P(i,n,r,"show less")}function P(e,n,t,o){e.count>T?e.findings.push(l("view-size",n,`${t} has ${e.count} blocks at its top; a view has at most ${T} there, a group or a condition counting as one`,`${o}, or gather some into a group`)):e.all>I&&e.findings.push(l("view-size",n,`${t} has ${e.all} blocks counting the ones inside its groups and conditions; a view has at most ${I} in all`,o))}function te(e,n,t,o,a){Array.isArray(e)&&e.forEach((d,r)=>{if(!g(d)||d.name!=="blocks"||!g(d.options)||!("blocks"in d.options))return;let i=[];D(d.options.blocks,`lenses.${r}.options.blocks`,n,t,o,i,`the lens "${String(d.title??r)}"`);for(let s of i)a.push({...s,severity:"warning"})})}function oe(e,n,t,o,a,d,r){let i=[];if(e===void 0)return i;if(!g(e))return i.push(l("view-shape",n,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[s,f]of Object.entries(e)){if(s==="home"&&Array.isArray(f)){D(f,`${n}.home`,r,o,a,i,"the home");continue}let u=t(s);if(!u){i.push(l("view-kind",`${n}.${s}`,`"${s}" is not a kind this ${d} declares`));continue}if(!g(f)){i.push(l("view-shape",`${n}.${s}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))E.includes(c)||i.push(l("view-slot",`${n}.${s}.${c}`,`"${c}" is not a place a view is drawn`,`use ${E.map(p=>`"${p}"`).join(", ")}`));for(let c of E){let p=f[c];if(p===void 0)continue;let y={kind:s,spec:u,kinds:o,edges:a,vocabulary:r,findings:i,count:0,all:0,slot:c};x(p,`${n}.${s}.${c}`,1,y),P(y,`${n}.${s}.${c}`,`this ${c}`,"show less, or move detail to the page")}}return i}function ge(e){let n=new Set(Object.keys(e.kinds)),t=new Set(Object.values(e.kinds).flatMap(r=>Object.keys($(r.edges)))),o=r=>{let i=m(e.kinds,r)?e.kinds[r]:void 0;return i?{field:s=>m(i.fields,s)||m(i.computed,s)||F(i.edges).has(s),relation:s=>m($(i.edges),s),figure:i.figure!==void 0,files:s=>m(i.fields,s)&&X(i.fields[s]),choices:s=>m(i.fields,s)&&i.fields[s].type==="enum"?i.fields[s].options:void 0,targets:s=>m($(i.edges),s)?i.edges[s].to:void 0,prose:s=>m(i.fields,s)&&i.fields[s].type==="text"}:void 0},a={namesOf:o,sources:r=>Object.keys(e.kinds).filter(i=>m(e.kinds[i].edges,r))},d=oe(e.views,"views",o,n,t,"document",a);return te(e.lenses,a,n,t,d),d}export{j as a,H as b,L as c,B as d,M as e,fe as f,C as g,ue as h,ce as i,ge as j};
|
|
1
|
+
import{a as O,b,c as w,d as R,e as V}from"./chunk.NVRK6A7T.js";import{h as l,i as S}from"./chunk.FKJ3HIA5.js";import{Ia as $,Ja as F}from"./chunk.P4CLT32V.js";var E=["card","row","page"],j=["good","warn","bad","neutral","accent"],H=["money","percent","date","time","datetime","relative","count"],_=4,T=40,I=120,L=["number","money","percent"],B=["large"],U=["card","row"],M=1e3,fe=100;function C(e){let n=/^\s*(out|in)\(\s*['"]([A-Za-z][A-Za-z0-9_-]*)['"]\s*\)\s*$/.exec(e);return n?{edge:n[2],way:n[1]}:/^[A-Za-z][A-Za-z0-9_-]*$/.test(e)?{edge:e}:void 0}var v={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label","emphasis"]},Z=Object.keys(v),G=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?, "emphasis"?: "large"}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,X=e=>/^(image|video|file)$/.test(e?.of??e?.type??"");function ue(e){return Object.fromEntries(Object.entries(e.views??{}).filter(([,n])=>!Array.isArray(n)))}function ce(e){let n=e.views?.home;return Array.isArray(n)?n:void 0}var Y={field:()=>!1,relation:()=>!1,figure:!1},z=e=>e.kind??"the home",m=(e,n)=>e!==void 0&&Object.hasOwn(e,n),g=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function N(e,n,t){let o=O(e);for(let a of o.unknownFunctions)t.findings.push(l("unknown-function",n,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of o.names){if(t.kind===null){t.findings.push(l("view-name",n,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||t.spec.field(a)||t.spec.relation(a)||t.findings.push(l("view-name",n,`${t.kind} has no field or relation called "${a}"`))}for(let a of o.edges)t.edges.has(a)||t.findings.push(l("view-edge",n,`"${a}" is not a relation any kind declares`));for(let a of o.sweeps)t.kinds.has(a)||t.findings.push(l("view-kind",n,`"${a}" is not a kind this document declares`))}function k(e,n,t){if(typeof e!="string"||e.length===0||e.length>2e3){t.findings.push(l("view-expression",n,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{N(w(e),n,t)}catch(o){if(!(o instanceof b))throw o;t.findings.push(l("expression",n,`${o.sentence} (at character ${o.at+1})`))}}function A(e,n,t,o){let a=o==="text";if(typeof e!="string"||e.length===0||e.length>300){t.findings.push(l("view-template",n,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let d;try{d=V(e)}catch(r){if(r instanceof R||r instanceof b){t.findings.push(l("template",n,r.sentence));return}throw r}for(let r of d)if(r.expr){if(N(r.expr,n,t),a&&!r.format&&r.expr.t==="ident"&&(t.slot==="card"||t.slot==="row")&&t.spec.prose?.(r.expr.name)){let i=r.expr.name;t.findings.push(S("view-whole-text",n,`${t.kind} ${t.slot} shows ${i} whole; it will be clamped. Use {${i}|excerpt} or move it to the page.`,`write {${i}|excerpt}, or {${i}|excerpt: 80} for fewer characters`))}if(o==="headline"&&!r.format&&r.expr.t==="ident"&&t.spec.prose?.(r.expr.name)){let i=r.expr.name;t.findings.push(S("view-headline-long",n,`${z(t)}${t.slot?` ${t.slot}`:""} heads it with ${i}, a long text, drawn at a headline's size; a headline is a few words.`,`say it in a text block, {"text": "{${i}}"}, or head it with {${i}|excerpt: 60}`))}}}function q(e,n,t){if(typeof e=="string"){j.includes(e)||t.findings.push(l("view-tone",n,`"${e}" is not a tone`,`use one of ${j.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(g(e)&&Object.keys(e).length===1&&"expr"in e){k(e.expr,`${n}.expr`,t);return}t.findings.push(l("view-tone",n,'a tone is a word or {"expr": \u2026}',`one of ${j.join(", ")}`))}function x(e,n,t,o){if(!Array.isArray(e)){o.findings.push(l("view-shape",n,"a view is a list of blocks"));return}if(t>_){o.findings.push(l("view-depth",n,`blocks nest at most ${_} deep`,"flatten a group or a condition"));return}e.forEach((a,d)=>J(a,`${n}.${d}`,t,o))}function J(e,n,t,o){if(t===1&&o.count++,o.all++,!g(e)){o.findings.push(l("view-block",n,"a block is an object naming what it shows",`one of ${G}`));return}let a=Object.keys(e),d=a.filter(s=>Z.includes(s)&&!(s==="group"&&a.includes("list")));if(d.length===0){o.findings.push(l("view-block",n,`${a.length>0?a.map(s=>`"${s}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${G}`));return}if(d.length>1){o.findings.push(l("view-block",n,`a block is one thing, and this says ${d.map(s=>`"${s}"`).join(" and ")}`,"split it into two blocks"));return}let r=d[0];for(let s of a)s!==r&&s!="key"&&!v[r].includes(s)&&o.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" is not part of a ${r} block`,v[r].length>0?`a ${r} block may also say ${v[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=e[r];switch(r){case"title":case"headline":case"text":case"badge":A(i,`${n}.${r}`,o,r==="text"||r==="headline"?r:void 0),"tone"in e&&q(e.tone,`${n}.tone`,o);return;case"image":case"field":{let s=r==="image";if(typeof i!="string"||!(s?o.spec.files?.(i):o.spec.field(i))){let u=typeof i=="string"&&o.spec.relation(i);o.findings.push(l(`view-${r}`,`${n}.${r}`,`${o.kind} has no ${s?"image, video or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=s?["thumb","gallery"]:H;"as"in e&&!f.includes(e.as)&&o.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to show ${s?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),s||W(e,n,o,"field"),"label"in e&&ie(e.label,`${n}.label`,o);return}case"progress":{!g(i)||Object.keys(i).some(s=>s!=="value"&&s!=="max")||!("value"in i)||!("max"in i)?o.findings.push(l("view-progress",`${n}.progress`,'progress is {"value": expression, "max": expression}')):(k(i.value,`${n}.progress.value`,o),k(i.max,`${n}.progress.max`,o)),"label"in e&&A(e.label,`${n}.label`,o);return}case"group":"direction"in e&&e.direction!=="row"&&e.direction!=="column"&&o.findings.push(l("view-direction",`${n}.direction`,`a group runs "row" or "column", not "${String(e.direction)}"`)),x(i,`${n}.group`,t+1,o);return;case"when":k(i,`${n}.when`,o),"show"in e?x(e.show,`${n}.show`,t+1,o):o.findings.push(l("view-when",n,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return Q(e,n,o);for(let s of["as","currency","label","emphasis"])s in e&&o.findings.push(l("unknown-key",`${n}.${s}`,`"${s}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?o.findings.push(l("view-block",`${n}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):o.spec.figure||o.findings.push(l("view-figure",`${n}.figure`,`${z(o)} has no figure to show`,o.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return ne(e,n,o);case"divider":i!==!0&&o.findings.push(l("view-block",`${n}.${r}`,`write {"${r}": true}`));return}}function Q(e,n,t){k(e.figure,`${n}.figure`,t),"as"in e&&!L.includes(e.as)&&t.findings.push(l("view-format",`${n}.as`,`"${String(e.as)}" is not a way to say a figure`,`use one of ${L.join(", ")}`)),W(e,n,t,"figure"),"label"in e&&A(e.label,`${n}.label`,t),"emphasis"in e&&!B.includes(e.emphasis)&&t.findings.push(l("view-emphasis",`${n}.emphasis`,`"${String(e.emphasis)}" is not how loudly a figure is said`,`use ${B.map(o=>`"${o}"`).join(", ")}, or leave it out for the figure's own size`))}function W(e,n,t,o){"currency"in e&&(typeof e.currency!="string"||!/^[A-Z]{3}$/.test(e.currency)?t.findings.push(l("view-currency",`${n}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):e.as!=="money"&&t.findings.push(l("view-currency",`${n}.currency`,`a currency belongs on a ${o} shown as money`,'add "as": "money"')))}function ee(e,n){let t=[...n.kinds],o=(d,r)=>{let i=new Set;for(let s of d){let f=n.vocabulary.namesOf(s)?.targets?.(r);if(f==="*")return t;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=d=>{switch(d.t){case"ident":return n.kind!==null&&n.spec.relation(d.name)?o([n.kind],d.name):void 0;case"member":{let r=a(d.object);return r?o(r,d.name):void 0}case"where":return a(d.set);case"call":{let r=d.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(d.fn==="all")return i!==void 0&&n.kinds.has(i)?[i]:void 0;let s=d.args.length===2&&d.args[1]?.t==="lit"&&typeof d.args[1].value=="string"?d.args[1].value:void 0;if(d.fn==="out"&&s!==void 0){let f=a(r);return f?o(f,s):void 0}if(d.fn==="out")return i!==void 0&&n.kind!==null?o([n.kind],i):void 0;if(d.fn==="in"){let f=s??i,u=s!==void 0?a(r):n.kind!==null?[n.kind]:void 0,c=f!==void 0?n.vocabulary.sources(f).filter(p=>{let y=n.vocabulary.namesOf(p)?.targets?.(f);return!u||y==="*"||u.some(h=>y?.includes(h))}):[];return c.length>0?c:void 0}if((d.fn==="sort"||d.fn==="first")&&r)return a(r);if(d.fn==="either"){let f=d.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(e)}function K(e,n,t,o){let a;try{a=w(e)}catch(r){if(!(r instanceof b))throw r;o.findings.push(l("expression",n,`${r.sentence} (at character ${r.at+1})`));return}let d=O(a);for(let r of d.unknownFunctions)o.findings.push(l("unknown-function",n,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of d.edges)o.edges.has(r)||o.findings.push(l("view-edge",n,`"${r}" is not a relation any kind declares`));if(t)for(let r of d.names)r==="id"||t.some(i=>o.vocabulary.namesOf(i)?.field(r)||o.vocabulary.namesOf(i)?.relation(r))||o.findings.push(l("view-name",n,`${t.join(" and ")} ${t.length===1?"has":"have"} no field or relation called "${r}"`))}function ne(e,n,t){let o=e.list;k(o,`${n}.list`,t);let a;if(typeof o=="string")try{a=ee(w(o),t)}catch{a=void 0}let d=i=>{if(!a)return[...t.kinds].map(f=>t.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let s=a.map(f=>t.vocabulary.namesOf(f)?.choices?.(i));return s.every(f=>f!==void 0)?[...new Set(s.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in e){let i=e.sort;if(typeof i=="string")K(i,`${n}.sort`,a,t);else if(g(i)&&typeof i.by=="string"&&Object.keys(i).every(s=>s==="by"||s==="direction")){let s=i.direction;s!==void 0&&s!=="asc"&&s!=="desc"&&s!=="choices"?t.findings.push(l("list-sort",`${n}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(s)}"`,'"choices" puts a choice field in the order its choices are declared')):s==="choices"?d(i.by)===void 0&&t.findings.push(l("list-sort",`${n}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):K(i.by,`${n}.sort.by`,a,t)}else t.findings.push(l("list-sort",`${n}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in e){let i=e.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>M)&&t.findings.push(l("list-limit",`${n}.limit`,`a limit is a whole number from 1 to ${M}`))}if("group"in e){let i=e.group,s=typeof i=="string"?i:g(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||g(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||s===void 0)t.findings.push(l("list-group",`${n}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}} \u2014 or a relation, like "inGenre", a heading per linked record'));else{let u=d(s),c=u===void 0?C(s):void 0,p=c!==void 0&&(c.way!==void 0?t.edges.has(c.edge):a?a.every(y=>t.vocabulary.namesOf(y)?.relation(c.edge)):t.edges.has(c.edge));if(u===void 0&&!p&&t.findings.push(l("list-group",`${n}.group`,`"${s}" is not a choice field or a relation of ${r}, so it has nothing to group by`,'group by a field whose type is enum, or by a relation of the kind listed, like "inGenre"')),g(i)&&"headings"in i){let y=i.headings;if(!g(y)||Object.values(y).some(h=>typeof h!="string"||h.length===0||h.length>80))t.findings.push(l("list-group",`${n}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let h of Object.keys(y))u.includes(h)||t.findings.push(l("list-group",`${n}.group.headings.${h}`,`"${h}" is not one of ${s}'s choices`,`use ${u.join(", ")}`))}}}"empty"in e&&(typeof e.empty!="string"||e.empty.length===0||e.empty.length>200)&&t.findings.push(l("list-empty",`${n}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in e&&!U.includes(e.as)&&t.findings.push(l("list-as",`${n}.as`,`a list draws each record as its "card" or its "row", not "${String(e.as)}"`))}function ie(e,n,t){(typeof e!="string"||e.length===0||e.length>60)&&t.findings.push(l("view-label",n,"a label is a few words, at most 60 characters"))}function D(e,n,t,o,a,d,r){let i={kind:null,spec:Y,kinds:o,edges:a,vocabulary:t,findings:d,count:0,all:0};Array.isArray(e)&&e.length===0&&d.push(l("view-shape",n,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),x(e,n,1,i),P(i,n,r,"show less")}function P(e,n,t,o){e.count>T?e.findings.push(l("view-size",n,`${t} has ${e.count} blocks at its top; a view has at most ${T} there, a group or a condition counting as one`,`${o}, or gather some into a group`)):e.all>I&&e.findings.push(l("view-size",n,`${t} has ${e.all} blocks counting the ones inside its groups and conditions; a view has at most ${I} in all`,o))}function te(e,n,t,o,a){Array.isArray(e)&&e.forEach((d,r)=>{if(!g(d)||d.name!=="blocks"||!g(d.options)||!("blocks"in d.options))return;let i=[];D(d.options.blocks,`lenses.${r}.options.blocks`,n,t,o,i,`the lens "${String(d.title??r)}"`);for(let s of i)a.push({...s,severity:"warning"})})}function oe(e,n,t,o,a,d,r){let i=[];if(e===void 0)return i;if(!g(e))return i.push(l("view-shape",n,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[s,f]of Object.entries(e)){if(s==="home"&&Array.isArray(f)){D(f,`${n}.home`,r,o,a,i,"the home");continue}let u=t(s);if(!u){i.push(l("view-kind",`${n}.${s}`,`"${s}" is not a kind this ${d} declares`));continue}if(!g(f)){i.push(l("view-shape",`${n}.${s}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))E.includes(c)||i.push(l("view-slot",`${n}.${s}.${c}`,`"${c}" is not a place a view is drawn`,`use ${E.map(p=>`"${p}"`).join(", ")}`));for(let c of E){let p=f[c];if(p===void 0)continue;let y={kind:s,spec:u,kinds:o,edges:a,vocabulary:r,findings:i,count:0,all:0,slot:c};x(p,`${n}.${s}.${c}`,1,y),P(y,`${n}.${s}.${c}`,`this ${c}`,"show less, or move detail to the page")}}return i}function ge(e){let n=new Set(Object.keys(e.kinds)),t=new Set(Object.values(e.kinds).flatMap(r=>Object.keys($(r.edges)))),o=r=>{let i=m(e.kinds,r)?e.kinds[r]:void 0;return i?{field:s=>m(i.fields,s)||m(i.computed,s)||F(i.edges).has(s),relation:s=>m($(i.edges),s),figure:i.figure!==void 0,files:s=>m(i.fields,s)&&X(i.fields[s]),choices:s=>m(i.fields,s)&&i.fields[s].type==="enum"?i.fields[s].options:void 0,targets:s=>m($(i.edges),s)?i.edges[s].to:void 0,prose:s=>m(i.fields,s)&&i.fields[s].type==="text"}:void 0},a={namesOf:o,sources:r=>Object.keys(e.kinds).filter(i=>m(e.kinds[i].edges,r))},d=oe(e.views,"views",o,n,t,"document",a);return te(e.lenses,a,n,t,d),d}export{j as a,H as b,L as c,B as d,M as e,fe as f,C as g,ue as h,ce as i,ge as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{da as l,ka as p,ob as a}from"./chunk.P4CLT32V.js";import{c}from"./chunk.SLBWPVIY.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.MN6WHE4B.js";import"./chunk.W2DKFQ6R.js";import"./chunk.ET3XJDPX.js";import"./chunk.3TVAE7LE.js";import"./chunk.JX2C3HVD.js";import"./chunk.Z7N3MJ36.js";import"./chunk.GLTWLQ6L.js";import"./chunk.ACB4TD4W.js";import"./chunk.XCQ7ZPR5.js";import"./chunk.MY5OXSS7.js";import"./chunk.NVRK6A7T.js";import"./chunk.FKJ3HIA5.js";import"./chunk.VICCAWAN.js";import"./chunk.OU5TRY4N.js";import"./chunk.CQPNDJAC.js";import"./chunk.P4CLT32V.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as f}from"./chunk.JG2FGZF2.js";import"./chunk.IE4ZJQV3.js";import"./chunk.TVWN5I4M.js";import"./chunk.B7LBG4UP.js";import"./chunk.7G4M2PX3.js";import"./chunk.UGFDSE37.js";import{l as g}from"./chunk.NNUUD26E.js";import"./chunk.PXQVXBNG.js";import"./chunk.OJ64WTLW.js";import"./chunk.GMAXA5GV.js";import"./chunk.IBJBCZKG.js";import"./chunk.NQ26KMSQ.js";import"./chunk.GJQF7I22.js";import"./chunk.SPU3BVAO.js";import"./chunk.OPCBZNKF.js";import"./chunk.UK5F3S2N.js";import"./chunk.2VJ52LGS.js";import"./chunk.JI2UVZUU.js";import"./chunk.CTOBNZLM.js";import"./chunk.34HGT7HQ.js";import"./chunk.TNL2BVCH.js";import"./chunk.NZDHXREL.js";import"./chunk.TBSPEO2L.js";import"./chunk.5ON3JSAK.js";import"./chunk.3SBTQ66X.js";import"./chunk.SSAY4ITS.js";import"./chunk.3TVAE7LE.js";import"./chunk.JX2C3HVD.js";import"./chunk.XOZU4OFA.js";import"./chunk.Z7N3MJ36.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.GLTWLQ6L.js";import"./chunk.ACB4TD4W.js";import"./chunk.XCQ7ZPR5.js";import"./chunk.MY5OXSS7.js";import"./chunk.NVRK6A7T.js";import"./chunk.FKJ3HIA5.js";import"./chunk.GZHZLJBF.js";import"./chunk.OW72XZF4.js";import"./chunk.OJGHDWI6.js";import"./chunk.KRODTMGR.js";import"./chunk.VICCAWAN.js";import"./chunk.OU5TRY4N.js";import"./chunk.CQPNDJAC.js";import"./chunk.GYTVL6GR.js";import{G as b,T as h}from"./chunk.TMYGLXR6.js";import"./chunk.SDO3U72B.js";import{Kd as n}from"./chunk.P4CLT32V.js";import"./chunk.SLBWPVIY.js";import{b as t}from"./chunk.AJZBJBMO.js";var m=t(b(),1),a=t(h(),1);function P({store:c,auto:y,brand:i,views:u,presence:s,steering:r,overview:o,scope:d,titleLevel:w=2,quickAsk:l,props:e}){let v=(0,m.useMemo)(()=>g({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:y?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:v}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(f,{context:{store:c,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...o?{overview:o}:{},titleLevel:w,views:u,settings:e.app.settings??[],...s?{presence:s}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},dismissals:e.dismissals,whileAway:e.whileAway,...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.hrefOf?{hrefOf:e.hrefOf}:e.routing==="address"?{}:{hrefOf:!1},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{P as PagesContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as n}from"./chunk.IBJBCZKG.js";import"./chunk.NQ26KMSQ.js";import"./chunk.GJQF7I22.js";import"./chunk.SPU3BVAO.js";import"./chunk.UK5F3S2N.js";import"./chunk.2VJ52LGS.js";import"./chunk.JI2UVZUU.js";import"./chunk.NZDHXREL.js";import"./chunk.TBSPEO2L.js";import"./chunk.5ON3JSAK.js";import"./chunk.3SBTQ66X.js";import"./chunk.SSAY4ITS.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.GLTWLQ6L.js";import"./chunk.ACB4TD4W.js";import"./chunk.XCQ7ZPR5.js";import"./chunk.MY5OXSS7.js";import"./chunk.NVRK6A7T.js";import"./chunk.FKJ3HIA5.js";import"./chunk.GZHZLJBF.js";import"./chunk.OW72XZF4.js";import"./chunk.OJGHDWI6.js";import"./chunk.KRODTMGR.js";import"./chunk.VICCAWAN.js";import"./chunk.OU5TRY4N.js";import"./chunk.CQPNDJAC.js";import"./chunk.GYTVL6GR.js";import{T as m}from"./chunk.TMYGLXR6.js";import"./chunk.SDO3U72B.js";import"./chunk.P4CLT32V.js";import"./chunk.SLBWPVIY.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function s(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{s as homeView};
|