graview 0.1.46 → 0.1.48
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.OHSJQYJN.js → chunk.2GLJH253.js} +1 -1
- package/dist/preview/{chunk.UR3XYOQ6.js → chunk.2QNGGF55.js} +1 -1
- package/dist/preview/{chunk.XSNAG4JT.js → chunk.2UIUMG23.js} +3 -3
- package/dist/preview/{chunk.R4OU7O6C.js → chunk.2VTMTW7K.js} +1 -1
- package/dist/preview/chunk.37CJSWLL.js +1 -0
- package/dist/preview/{chunk.RZXPBOGT.js → chunk.3BAHAK6W.js} +1 -1
- package/dist/preview/{chunk.RTI3FEDD.js → chunk.3RP3N2JP.js} +1 -1
- package/dist/preview/{chunk.IJABD7SI.js → chunk.3UD7GG5B.js} +1 -1
- package/dist/preview/{chunk.BFKV4GKP.js → chunk.44G5A53D.js} +1 -1
- package/dist/preview/chunk.4GQA3AJU.js +1 -0
- package/dist/preview/{chunk.F5PBK4TF.js → chunk.4KX53HCV.js} +2 -2
- package/dist/preview/chunk.4TJOS4C7.js +5 -0
- package/dist/preview/{chunk.EPUBSKKL.js → chunk.4VW6THJF.js} +1 -1
- package/dist/preview/{chunk.3OSGN463.js → chunk.5IM645XQ.js} +1 -1
- package/dist/preview/{chunk.NGIPVTTE.js → chunk.5IPH2SCE.js} +1 -1
- package/dist/preview/{chunk.TBQOSI4J.js → chunk.5Y3Q7ONN.js} +1 -1
- package/dist/preview/chunk.664PBQAQ.js +1 -0
- package/dist/preview/chunk.6TKILWRM.js +1 -0
- package/dist/preview/{chunk.JLEC3USG.js → chunk.6VAFNCR4.js} +1 -1
- package/dist/preview/chunk.72OZLWJL.js +1 -0
- package/dist/preview/chunk.72W6S746.js +1 -0
- package/dist/preview/{chunk.VDVJCLGS.js → chunk.76W2FXEC.js} +1 -1
- package/dist/preview/{chunk.64WM4IBI.js → chunk.7FRPNQU4.js} +1 -1
- package/dist/preview/chunk.7LL7OSBY.js +6 -0
- package/dist/preview/chunk.7QZYFLBS.js +1 -0
- package/dist/preview/{chunk.6RY6OSE6.js → chunk.7VT3TRHR.js} +1 -1
- package/dist/preview/chunk.B2IIEVBF.js +21 -0
- package/dist/preview/{chunk.5ESCD57M.js → chunk.BDHKWVNX.js} +1 -1
- package/dist/preview/{chunk.X25KXCWI.js → chunk.CH5ROV7N.js} +1 -1
- package/dist/preview/{chunk.EAJB2PJZ.js → chunk.CJ23XTSW.js} +1 -1
- package/dist/preview/{chunk.VAFSSSSI.js → chunk.D5ETRTAF.js} +1 -1
- package/dist/preview/{chunk.6OPI4WWO.js → chunk.DAUC2DFY.js} +1 -1
- package/dist/preview/{chunk.63JLXGYX.js → chunk.DFK2NA6L.js} +1 -1
- package/dist/preview/chunk.DHAK6PPX.js +3 -0
- package/dist/preview/{chunk.NMIXBH37.js → chunk.DOBQ4LO4.js} +1 -1
- package/dist/preview/{chunk.H7KCWCB4.js → chunk.DPHTUTOS.js} +1 -1
- package/dist/preview/chunk.DQ7M3LFV.js +1 -0
- package/dist/preview/{chunk.Y5ARSVH4.js → chunk.DUWYF7BO.js} +1 -1
- package/dist/preview/{chunk.3MMLRSRC.js → chunk.DWPU56S5.js} +1 -1
- package/dist/preview/{chunk.WBHM5I3I.js → chunk.E5GM2SMO.js} +1 -1
- package/dist/preview/{chunk.UOXFALRL.js → chunk.EMQ5POGB.js} +1 -1
- package/dist/preview/{chunk.TOZJZXWQ.js → chunk.ENPCLMP2.js} +1 -1
- package/dist/preview/{chunk.XXEYRHRG.js → chunk.ETR6AV47.js} +1 -1
- package/dist/preview/chunk.EXEZBZGW.js +1 -0
- package/dist/preview/{chunk.O24DD2VF.js → chunk.EZJNUFNQ.js} +1 -1
- package/dist/preview/{chunk.S5MQVPLF.js → chunk.FOP5RBGF.js} +1 -1
- package/dist/preview/chunk.FPYL6REZ.js +1 -0
- package/dist/preview/chunk.FQYOTK34.js +1 -0
- package/dist/preview/chunk.G446PWV6.js +1 -0
- package/dist/preview/chunk.G7WDMUDV.js +1 -0
- package/dist/preview/{chunk.NIVTK2W5.js → chunk.GACKGEUY.js} +1 -1
- package/dist/preview/chunk.GH2SWMCW.js +1 -0
- package/dist/preview/chunk.GNBN3BK7.js +1 -0
- package/dist/preview/{chunk.4KNEBLB7.js → chunk.GT3F6FQ6.js} +1 -1
- package/dist/preview/chunk.GTPC6JOW.js +2 -0
- package/dist/preview/{chunk.DEUTHHGI.js → chunk.GUMJEVVP.js} +1 -1
- package/dist/preview/chunk.GVNYPFIM.js +1 -0
- package/dist/preview/{chunk.I3GP5JW7.js → chunk.HC5N3CT2.js} +1 -1
- package/dist/preview/{chunk.RNBPDB37.js → chunk.HDE2MGGU.js} +1 -1
- package/dist/preview/{chunk.6YD2DLIC.js → chunk.HG4DDNPG.js} +1 -1
- package/dist/preview/{chunk.A5VGTO3E.js → chunk.HKA5T7DL.js} +1 -1
- package/dist/preview/{chunk.55D33E5A.js → chunk.I5TOMBIF.js} +1 -1
- package/dist/preview/{chunk.JF3GD4H5.js → chunk.I7QIHN66.js} +1 -1
- package/dist/preview/chunk.ILZYRJDS.js +1 -0
- package/dist/preview/{chunk.LETJC5TD.js → chunk.IRHSTUZM.js} +1 -1
- package/dist/preview/{chunk.JLYNMAME.js → chunk.J2V76Z6G.js} +1 -1
- package/dist/preview/{chunk.3VFYSXMQ.js → chunk.J6ANRF6E.js} +1 -1
- package/dist/preview/chunk.KA44WNB4.js +25 -0
- package/dist/preview/chunk.KTFUVR4V.js +2 -0
- package/dist/preview/{chunk.BNPQUI3F.js → chunk.KVEDIBXS.js} +1 -1
- package/dist/preview/chunk.KVJFY7N5.js +2 -0
- package/dist/preview/{chunk.SS27NH5O.js → chunk.KW65F4WA.js} +1 -1
- package/dist/preview/chunk.LGSFGNWE.js +1 -0
- package/dist/preview/{chunk.UVNVDLV5.js → chunk.LNON6P7K.js} +1 -1
- package/dist/preview/{chunk.R2AG4NHQ.js → chunk.LPD74WBI.js} +1 -1
- package/dist/preview/chunk.LXCJVZF3.js +1 -0
- package/dist/preview/{chunk.Q7RQC3F7.js → chunk.MAFFUPCR.js} +1 -1
- package/dist/preview/chunk.MTXEURFE.js +1 -0
- package/dist/preview/{chunk.PLWVLW22.js → chunk.MVRG75ZD.js} +1 -1
- package/dist/preview/{chunk.GEPNIMXW.js → chunk.MVSV7T6E.js} +1 -1
- package/dist/preview/{chunk.W45NKVSV.js → chunk.MZLWLIKR.js} +1 -1
- package/dist/preview/chunk.N4M54YK6.js +1 -0
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.NB6WN4DO.js} +1 -1
- package/dist/preview/{chunk.UHX4WTM7.js → chunk.NFDLCUCC.js} +1 -1
- package/dist/preview/{chunk.AGIO2GRV.js → chunk.NLBIX7LH.js} +1 -1
- package/dist/preview/{chunk.VC3BX2ZF.js → chunk.NQZ73QV7.js} +1 -1
- package/dist/preview/chunk.NR5ODXMO.js +1 -0
- package/dist/preview/{chunk.M5GJHVWZ.js → chunk.NTLHEHOM.js} +1 -1
- package/dist/preview/{chunk.TFVFJFXC.js → chunk.NWT5FPEK.js} +3 -3
- package/dist/preview/chunk.NX7IIZLO.js +1 -0
- package/dist/preview/{chunk.UKAPFIPJ.js → chunk.O45VO36H.js} +1 -1
- package/dist/preview/{chunk.LUNATPAB.js → chunk.OAIWGWGU.js} +2 -2
- package/dist/preview/{chunk.PC6PID5X.js → chunk.ODRL5OWR.js} +1 -1
- package/dist/preview/{chunk.L2PI7V4R.js → chunk.OFRGDJYX.js} +1 -1
- package/dist/preview/chunk.OVO6L5IP.js +88 -0
- package/dist/preview/{chunk.LKN734RR.js → chunk.OZGETOTK.js} +1 -1
- package/dist/preview/{chunk.4HYJHGI4.js → chunk.P6FQAILU.js} +1 -1
- package/dist/preview/chunk.PCEYZQAW.js +1 -0
- package/dist/preview/{chunk.ONEYVLC2.js → chunk.PMJUGHW4.js} +1 -1
- package/dist/preview/{chunk.RNEJYIQ7.js → chunk.PPRSGM64.js} +1 -1
- package/dist/preview/chunk.PQVUQVRL.js +1 -0
- package/dist/preview/{chunk.LVEFQLGQ.js → chunk.PTXLOFQW.js} +1 -1
- package/dist/preview/{chunk.VBPK6ARF.js → chunk.PVEPU6EA.js} +1 -1
- package/dist/preview/chunk.QGE6YKSU.js +1 -0
- package/dist/preview/{chunk.Z6TMIAAB.js → chunk.QII2C5OV.js} +1 -1
- package/dist/preview/chunk.QO7MDWID.js +1 -0
- package/dist/preview/{chunk.S6WHA4CW.js → chunk.QPICKSSM.js} +1 -1
- package/dist/preview/{chunk.KRGM25HF.js → chunk.QQCDCRR2.js} +1 -1
- package/dist/preview/chunk.QQTRAY5W.js +1 -0
- package/dist/preview/{chunk.SL2FZ54V.js → chunk.RLXKDXPB.js} +1 -1
- package/dist/preview/{chunk.6MADC6DM.js → chunk.RQBEQYB2.js} +1 -1
- package/dist/preview/chunk.SA34Y3X5.js +2 -0
- package/dist/preview/chunk.SAHNXAV3.js +1 -0
- package/dist/preview/{chunk.UNCS63AM.js → chunk.SFAAM4KE.js} +1 -1
- package/dist/preview/{chunk.N7VNEUJR.js → chunk.SKJJBLXF.js} +1 -1
- package/dist/preview/chunk.SUPWMV2F.js +1 -0
- package/dist/preview/{chunk.ITYQUSZI.js → chunk.TBRJOKIK.js} +1 -1
- package/dist/preview/{chunk.JLIUUFK2.js → chunk.TKMQROXF.js} +1 -1
- package/dist/preview/chunk.TMDI7KRS.js +18 -0
- package/dist/preview/chunk.TPG6IY4M.js +1 -0
- package/dist/preview/{chunk.PKUDIWIF.js → chunk.UGJSMNVO.js} +1 -1
- package/dist/preview/{chunk.6QYJ2K6K.js → chunk.UJRBOUGC.js} +1 -1
- package/dist/preview/chunk.V2GSBYDK.js +4 -0
- package/dist/preview/chunk.V3N34DSU.js +1 -0
- package/dist/preview/{chunk.JT3IZIU5.js → chunk.V4BCB7N2.js} +1 -1
- package/dist/preview/{chunk.6SOUQNXR.js → chunk.VQAQQW4Q.js} +1 -1
- package/dist/preview/{chunk.CICGAEBW.js → chunk.W72TTRLX.js} +2 -2
- package/dist/preview/chunk.X5G7FOPY.js +12 -0
- package/dist/preview/{chunk.IKX4VDTW.js → chunk.X7JMJSLU.js} +1 -1
- package/dist/preview/{chunk.WP5W44Y4.js → chunk.X7N3JUO4.js} +2 -2
- package/dist/preview/chunk.XOZU4OFA.js +1 -0
- package/dist/preview/{chunk.JBW3DI7E.js → chunk.XTMOFRHL.js} +1 -1
- package/dist/preview/{chunk.WQONZBA3.js → chunk.Y4MQGEUS.js} +2 -2
- package/dist/preview/{chunk.BCWPV4WR.js → chunk.YDL5BSTG.js} +1 -1
- package/dist/preview/chunk.YEVA72L2.js +1 -0
- package/dist/preview/chunk.YLWON7X3.js +1 -0
- package/dist/preview/chunk.YUH43J2K.js +1 -0
- package/dist/preview/{chunk.Z5IGHCZX.js → chunk.YVOABA2U.js} +1 -1
- package/dist/preview/{chunk.5R2R364Q.js → chunk.Z4UM4CMT.js} +1 -1
- package/dist/preview/{chunk.DQOCBKC3.js → chunk.ZH4NWRWB.js} +1 -1
- package/dist/preview/chunk.ZXZNAG35.js +1 -0
- package/dist/preview/index.html +50 -49
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2JJYGYT2.js +0 -1
- package/dist/preview/chunk.4OGOTHRD.js +0 -1
- package/dist/preview/chunk.4RJZVTW7.js +0 -6
- package/dist/preview/chunk.4Y6VGQVQ.js +0 -1
- package/dist/preview/chunk.5K6KX3UC.js +0 -1
- package/dist/preview/chunk.6BDM2XRX.js +0 -1
- package/dist/preview/chunk.6UIW664O.js +0 -6
- package/dist/preview/chunk.6WA6ASQB.js +0 -1
- package/dist/preview/chunk.AQQZY6OY.js +0 -3
- package/dist/preview/chunk.AS4CQBOQ.js +0 -5
- package/dist/preview/chunk.ATDU5Y7V.js +0 -1
- package/dist/preview/chunk.AYA7SYIU.js +0 -1
- package/dist/preview/chunk.BAMPYMUE.js +0 -88
- package/dist/preview/chunk.DX357TZ3.js +0 -2
- package/dist/preview/chunk.F37DHXA2.js +0 -1
- package/dist/preview/chunk.FGR7KCI6.js +0 -1
- package/dist/preview/chunk.FO5BOBYV.js +0 -1
- package/dist/preview/chunk.FVOJCVRX.js +0 -1
- package/dist/preview/chunk.FXTBMW3S.js +0 -1
- package/dist/preview/chunk.GVY5UQTJ.js +0 -1
- package/dist/preview/chunk.HBD7FBZS.js +0 -1
- package/dist/preview/chunk.HDRD33II.js +0 -1
- package/dist/preview/chunk.HZCA3UWJ.js +0 -1
- package/dist/preview/chunk.IW7YFPGG.js +0 -1
- package/dist/preview/chunk.JHIUG25Q.js +0 -1
- package/dist/preview/chunk.JNIGZEOF.js +0 -1
- package/dist/preview/chunk.JQLR6KO2.js +0 -1
- package/dist/preview/chunk.KWQ7QOHD.js +0 -2
- package/dist/preview/chunk.LKVXSC5O.js +0 -2
- package/dist/preview/chunk.MWONSI3P.js +0 -1
- package/dist/preview/chunk.NITU5H4J.js +0 -1
- package/dist/preview/chunk.NWA7Q6CI.js +0 -1
- package/dist/preview/chunk.P4O5DGLN.js +0 -1
- package/dist/preview/chunk.QGVLJTZS.js +0 -1
- package/dist/preview/chunk.T7O6K3IN.js +0 -1
- package/dist/preview/chunk.UPQZU7UO.js +0 -21
- package/dist/preview/chunk.URO2EGY7.js +0 -1
- package/dist/preview/chunk.V3QUTJR2.js +0 -2
- package/dist/preview/chunk.V5Z2OED6.js +0 -1
- package/dist/preview/chunk.VW2VCPJX.js +0 -1
- package/dist/preview/chunk.WAB7UDHU.js +0 -1
- package/dist/preview/chunk.WM2LWHTJ.js +0 -1
- package/dist/preview/chunk.WO3DDFFY.js +0 -1
- package/dist/preview/chunk.WSTBCWW7.js +0 -4
- package/dist/preview/chunk.X233NILF.js +0 -1
- package/dist/preview/chunk.XWAMQPUM.js +0 -25
- package/dist/preview/chunk.XXDBZQNY.js +0 -18
- package/dist/preview/chunk.ZIEHF67C.js +0 -1
- package/dist/preview/chunk.ZTIF23VF.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as Ge}from"./chunk.NQZ73QV7.js";import{a as Me,c as Oe,e as Be}from"./chunk.SUPWMV2F.js";import{e as Pe,f as Ce,j as Re,k as re,l as Fe}from"./chunk.TPG6IY4M.js";import{f as Se}from"./chunk.5Y3Q7ONN.js";import{d as _,e as je,k as ne}from"./chunk.KVJFY7N5.js";import{b as De,e as Ae}from"./chunk.DPHTUTOS.js";import{$ as ue,$c as $e,Bb as fe,C as Q,I as de,Jc as ve,Ob as te,Pb as ge,ca as T,da as K,ea as me,fa as Z,ga as ee,ha as pe,hc as he,jc as ye,jd as ke,ka as q,lc as we,ma as z,qc as U,rc as be,rd as xe}from"./chunk.4TJOS4C7.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(t.input).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
|
+
`)}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 +1 @@
|
|
|
1
|
-
import{m}from"./chunk.
|
|
1
|
+
import{m}from"./chunk.2UIUMG23.js";import{G as N,R as f,U as y}from"./chunk.KA44WNB4.js";import{b as g}from"./chunk.AJZBJBMO.js";var p=g(N(),1);var a=g(f(),1);var R={default:{background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)"},muted:{background:"var(--graview-panel-muted, #f7f5f1)",color:"var(--graview-ink, #1a1a1a)"},warning:{background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)"}},T={color:"var(--graview-ink-muted, #55514a)"},C={color:"var(--graview-ink-faint, #625d55)"};function H(e){let[l,o]=(0,p.useState)(z);return(0,p.useEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let t=()=>{let i=W(r,parseFloat(getComputedStyle(r).paddingBottom)||0);o(s=>s.overflowing===i.overflowing&&s.above===i.above&&s.below===i.below?s:i)};t();let d=new ResizeObserver(t);d.observe(r);for(let i of r.children)d.observe(i);return r.addEventListener("scroll",t,{passive:!0}),()=>{d.disconnect(),r.removeEventListener("scroll",t)}}),l}var z={overflowing:!1,above:!1,below:!1};function W(e,l=0){let o=e.scrollHeight>e.clientHeight+1,r=e.scrollWidth>e.clientWidth+1;return{overflowing:o||r,above:o&&e.scrollTop>1,below:o&&e.scrollTop+e.clientHeight<e.scrollHeight-l-1}}var A=(0,p.createContext)(null),I=(0,p.createContext)(null);function O({level:e,said:l=!0,style:o,children:r}){if(e===void 0)return(0,a.jsx)("strong",{style:o,...l?{}:{"aria-hidden":!0},children:r});let t=`h${e}`;return(0,a.jsx)(t,{style:{margin:0,...o},children:r})}function E({title:e,subtitle:l,meta:o,selected:r,tone:t="default",children:d,style:i,fit:s=!1,variant:w,heading:b}){let c=(0,p.useRef)(null),{overflowing:v,above:x,below:S}=H(c),P=y(),n=(w??(P==="fullscreen"?"page":"card"))==="page",k=(0,p.useContext)(A),u=(0,p.useContext)(I);return(0,a.jsxs)("div",{"data-graview-primitive":"panel","data-graview-variant":n?"page":"card","data-selected":r||void 0,style:{display:"flex",flexDirection:"column",gap:n?12:"var(--graview-gap, 7px)",height:n||s?"auto":"100%",maxHeight:n?"none":"100%",padding:n?0:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:n?0:"var(--graview-radius, 12px)",border:n?"none":`1px solid ${r?"var(--graview-accent, #2f6f5e)":"var(--graview-edge, #e4e0d8)"}`,boxShadow:n?"none":r?"0 0 0 1px var(--graview-accent-dim), var(--graview-lift-low)":"var(--graview-lift-low)",overflow:n?"visible":"hidden",...R[t],...n?{background:"transparent"}:{},...i},children:[t==="warning"?(0,a.jsx)("span",{"data-graview-broken":"",style:m,children:"Implicated in a problem."}):null,e===void 0||e===k?null:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0},children:[t==="warning"?(0,a.jsx)("span",{"aria-hidden":"true",title:"Implicated in a problem",style:{color:"var(--graview-warn)",flex:"0 0 auto"},children:"\u26A0"}):null,(0,a.jsx)(O,{level:b,said:u===null||e!==u,style:{fontFamily:"var(--graview-font-display, inherit)",fontSize:n?"1.5625rem":"0.9375rem",lineHeight:n?1.15:1.25,fontWeight:n?600:560,letterSpacing:n?"-0.012em":"0.005em",minWidth:0,overflowWrap:"anywhere"},children:e}),o===void 0?null:(0,a.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",letterSpacing:"0.08em",textTransform:"uppercase",minWidth:0,overflowWrap:"anywhere",...C},children:o})]}),l===void 0?null:(0,a.jsx)("div",{style:{fontSize:n?"0.90625rem":"0.8125rem",lineHeight:1.5,...T},children:l}),(0,a.jsx)("div",{ref:c,className:n?void 0:"graview-scroll",...v&&!n?{tabIndex:0,role:"region",...typeof e=="string"?{"aria-label":e}:{}}:{},style:{display:"flex",flexDirection:"column",gap:n?22:"var(--graview-gap, 7px)",flex:"1 1 auto",...n?{overflow:"visible"}:{marginBottom:"calc(-1 * var(--graview-pad, 15px))",paddingBottom:"var(--graview-pad, 15px)"},...!n&&!v?{overflow:"hidden"}:{}},"data-graview-more-above":x&&!n?"":void 0,"data-graview-more-below":S&&!n?"":void 0,children:d})]})}function h({label:e,hue:l,selected:o,title:r,pickId:t,emphasis:d}){let i=typeof e=="string"?e:void 0,s=l===void 0?void 0:Math.round(l);return(0,a.jsxs)("span",{"data-graview-primitive":"chip","data-selected":o||void 0,"data-graview-pick":t,"data-graview-emphasis":d,title:r??i,style:{cursor:t?"pointer":void 0,display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",maxWidth:"min(28ch, 100%)",overflow:"hidden",letterSpacing:"0.01em",border:`1px solid ${o?"var(--graview-accent)":s===void 0?"var(--graview-edge)":`hsl(${s} 55% var(--graview-tint-lightness) / 0.45)`}`,background:s===void 0?"var(--graview-panel-muted)":`hsl(${s} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * 0.65))`,color:"var(--graview-ink, #1a1a1a)",boxShadow:o?"0 0 14px -4px var(--graview-accent)":void 0},children:[s===void 0?null:(0,a.jsx)("span",{"aria-hidden":"true",style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",marginRight:6,background:`hsl(${s} 55% var(--graview-tint-lightness) / 0.9)`}}),(0,a.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]})}function L({items:e,max:l=8,selectedIds:o=[],pick:r=!1}){let t=e.slice(0,l),d=e.length-t.length;return(0,a.jsxs)("div",{"data-graview-primitive":"roster",style:{display:"flex",flexWrap:"wrap",gap:6,alignContent:"flex-start"},children:[t.map(i=>(0,a.jsx)(h,{label:i.label,...i.hue===void 0?{}:{hue:i.hue},...r?{pickId:i.id}:{},...i.emphasis===void 0?{}:{emphasis:i.emphasis},selected:o.includes(i.id)},i.id)),d>0?(0,a.jsx)(h,{label:`+${d} more`}):null]})}function F({label:e,count:l,items:o,onExpand:r,flagged:t,problems:d}){return(0,a.jsx)(E,{title:e,meta:d?(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[d,(0,a.jsx)("span",{children:l})]}):l,tone:t?"warning":"muted",style:r?{cursor:"zoom-in"}:void 0,children:o&&o.length>0?(0,a.jsx)(L,{items:o,max:6,pick:!0}):null})}export{A as a,I as b,E as c,h as d,L as e,F as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ic as g}from"./chunk.4TJOS4C7.js";function v(){let t=new Uint8Array(16);return globalThis.crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function k(t,e){if(!t)return;let i={..."filter"in e&&e.filter?{filter:e.filter}:{},...e.section?{section:e.section}:{}};"record"in e?t.record(e.record,i):"list"in e?t.list(e.list,i):t.place(e.place,i)}function w(t,e){if(!t?.href)return;let i={..."filter"in e&&e.filter?{filter:e.filter}:{},...e.section?{section:e.section}:{}};return t.href("record"in e?{record:e.record}:"list"in e?{list:e.list}:{place:e.place},i)}var b=[["accent","--graview-accent"],["ground","--graview-ground"],["panel","--graview-panel"],["ink","--graview-ink"],["inkMuted","--graview-ink-muted"],["edge","--graview-edge"],["fontBody","--graview-font-body"],["fontDisplay","--graview-font-display"],["fontMono","--graview-font-mono"],["radius","--graview-radius"]];function R(t){let e=t.ownerDocument.defaultView,i=e.getComputedStyle(t),s=t.closest("[data-graview-scheme]")?.getAttribute("data-graview-scheme"),d={scheme:s==="dark"||s==="light"?s:/\bdark\b/.test(i.colorScheme??"")?"dark":/\blight\b/.test(i.colorScheme??"")?"light":e.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"};for(let[l,u]of b)d[l]=i.getPropertyValue(u).trim();return d}function T(t,e){let i=t.defaultView;if(!i||typeof i.MutationObserver!="function")return()=>{};let s=new i.MutationObserver(e);s.observe(t.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-graview-scheme","data-theme"]});let o=i.matchMedia?.("(prefers-color-scheme: dark)");return o?.addEventListener?.("change",e),()=>{s.disconnect(),o?.removeEventListener?.("change",e)}}function x(t,e,i){let s=e?.(),o=t(),d=s?.logo,l=i.url(typeof d=="string"||d===void 0?d:o.scheme==="dark"&&d.dark?d.dark:d.light);return{...o,...s?.name?{name:s.name}:{},...l?{logo:l}:{}}}function B(t,e,i){let s,o,d=n=>{n?.startsWith("blob:")&&t.URL.revokeObjectURL(n)},l=async n=>{if(n.startsWith("<"))return g(n)===null?new t.Blob([n],{type:"image/svg+xml"}):void 0;if(/\\|%2e/i.test(n)||n.split(/[?#]/)[0].split("/").some(m=>m==="."||m===".."))return;let r=new t.URL(n,t.document.baseURI);if(r.origin!==t.location.origin||!/^https?:$/.test(r.protocol))return;let a=await t.fetch(r.href,{credentials:"same-origin"}),c=(a.headers.get("content-type")??"").split(";")[0].trim();return a.ok&&c.startsWith("image/")?new t.Blob([await a.arrayBuffer()],{type:c}):void 0},u=n=>new Promise(r=>{let a=new t.Image;a.onload=()=>r(!0),a.onerror=()=>r(!1),t.setTimeout(()=>r(!1),2e3),a.src=n}),h=n=>new Promise((r,a)=>{let c=new t.FileReader;c.onload=()=>r(String(c.result)),c.onerror=a,c.readAsDataURL(n)}),p=async n=>{if(/^data:image\//i.test(n))return n;let r=await l(n);if(!(!r||s!==n)){if(i==="blob"){let a=t.URL.createObjectURL(r);if(await u(a))return a;t.URL.revokeObjectURL(a)}return h(r)}},f=(n,r)=>{if(s!==n)return d(r);r!==o&&(d(o),o=r,e())};return{url(n){let r=n?.trim()||void 0;return r!==s&&(s=r,r?p(r).then(a=>f(r,a),()=>f(r,void 0)):(d(o),o=void 0)),o},dispose(){s=void 0,d(o),o=void 0}}}export{v as a,k as b,w as c,R as d,T as e,x as f,B as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.2UIUMG23.js";import{R as o,_ as n}from"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import{b as t}from"./chunk.AJZBJBMO.js";var a=t(o(),1),d=[["waiting","Waiting"],["active","Under way: darker and taller"],["done","Done: flat and pale"],["flagged","A problem, or past its due date"],["recent","Changed since you were last here"],["own","Yours"]],g=i=>{let e=r=>`color-mix(in oklab,var(--graview-ink) ${r}%,var(--graview-panel))`;return`.graview-map-key{display:grid;gap:4px;padding:2px 4px 8px;margin-bottom:6px;border-bottom:1px solid var(--graview-edge);font-size:.8125rem;color:var(--graview-ink-muted)}
|
|
2
2
|
.graview-map-key>div{display:flex;align-items:center;gap:8px}
|
|
3
3
|
.graview-map-key>div:first-child{color:var(--graview-ink)}
|
|
4
4
|
.graview-map-key i{flex:none;width:14px;height:10px;border-radius:2px;background:${e(i?34:42)}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.
|
|
1
|
+
import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.OAIWGWGU.js";import"./chunk.O45VO36H.js";import"./chunk.UT6642FC.js";import"./chunk.NX7IIZLO.js";import"./chunk.XOZU4OFA.js";import"./chunk.SUPWMV2F.js";import{a as A}from"./chunk.LPD74WBI.js";import"./chunk.TI4OSTQV.js";import"./chunk.NFDLCUCC.js";import"./chunk.N4M54YK6.js";import"./chunk.KVJFY7N5.js";import"./chunk.DPHTUTOS.js";import"./chunk.2UIUMG23.js";import{G as M,R as f}from"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import{b as d}from"./chunk.AJZBJBMO.js";var n=d(M(),1);var r=d(f(),1),C="several";function q({chosen:c,acts:p,onAct:N}){let t=A(),u=(0,n.useMemo)(()=>[...c].sort(),[c]),i=u.join(`
|
|
2
2
|
`),o=(0,n.useMemo)(()=>({on:"selection",ids:u}),[i]),l=(0,n.useMemo)(()=>p.filter(e=>e.open.length===0&&!e.more&&!e.destructive),[p]),g=(0,n.useMemo)(()=>new Map(l.map(e=>[h(e.id),e])),[l]),v=S(t,o,C),[y,x]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(v!==void 0)return;let e=!0;return w(t,o,{by:C,ask:()=>b(t.ai,{store:t.store,target:o,principal:t.principal,interaction:k(),places:t.places,selection:t.selection,...t.place?{place:t.place}:{},shared:l.map(a=>({id:a.id,label:a.label,mutation:a.mutation,args:a.args}))})}).then(a=>{e&&x({key:i,result:a})}),()=>{e=!1}},[i]);let s=v??(y?.key===i?y.result:void 0);if(s===void 0)return(0,r.jsx)("span",{role:"status",className:"graview-several-quiet","data-testid":"several-ai-thinking",style:{textDecoration:"none"},children:"AI: thinking\u2026"});let m=s.offers.filter(e=>e.type!=="act"||g.has(e.id));if(m.length===0)return null;let E=e=>{let a=g.get(e.id);if(a){t.desk.record({...s.interaction,outcome:"accepted",accepted:[e.id]}),N(a);return}I(t,s,e)};return(0,r.jsx)("div",{role:"group","aria-label":"Suggested by AI",className:"graview-several-acts","data-testid":"several-ai",children:m.map(e=>(0,r.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-ai-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>E(e),children:[e.label,(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \xB7 suggested"})]},e.id))})}export{q as SeveralAi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as on,c as an,d as te,e as sn,f as re,h as Oe,i as dn,n as cn,q as oe}from"./chunk.KWQ7QOHD.js";import{$a as We,B as pe,Ba as Be,Bb as Xe,C as me,Da as _e,F as ke,Gb as en,H as Ce,Ha as be,I as Ze,Ia as ve,Oa as He,Ra as Ue,aa as Ke,ab as Je,b as De,c as Te,cc as nn,d as $e,db as xe,e as K,ea as Ve,eb as Ye,g as de,h as M,i as Pe,j as Ge,k as ce,ka as Ie,l as Me,m as Le,nc as tn,o as Fe,oc as rn,p as le,q as he,ub as U,v as Ne,va as we,x as ne,xb as Qe,ya as qe,z as fe}from"./chunk.AS4CQBOQ.js";function ln(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let s=e,n=w=>typeof s[w]=="string"?s[w]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,u,m]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...u!==void 0?{alt:u}:{},...m!==void 0?{darkFallback:m}:{}}}function Gn(e,s){let n=e.brand??{},t=n.accent?rn(n.accent):void 0;t&&!t.ok&&s.push(dn("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${t.why}`,"pick a color further from orange-red, or a darker one"));let o=ln(n.logo),u=n.name??e.name,m=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,w])=>typeof w=="string"&&!/url\(|@import|[;{}<>\\]/i.test(w)).map(([w,L])=>[w,tn(L)])):void 0;return{name:u,schemes:t?.ok?t.schemes:nn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...o?{logo:o.dark||o.darkFallback==="invert"?{light:o.light,...o.dark?{dark:o.dark}:{darkFallback:"invert"}}:o.light,logoAlt:o.alt??u}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...m?{typography:m}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function fn(e){let{currency:s,locale:n,timeZone:t}=e.brand??{};return{...s?{currency:s}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var bn=Symbol.for("@graview/core:typed-field"),pn=(e,s)=>(/^(phone|place|duration)$/.test(s)&&(me(e)[bn]=s),e),mn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function un(e){let s=M().check(K(300),fe(t=>Be(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?s:le(s).check(K(200));return _e(e.description?n.check(pe(e.description)):n,e)}var xn=new WeakMap;function gn(e,s){xn.set(e,s)}var On=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function yn(e,s=On){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of s)t=Re(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Re(e,s,n,t,o){if(s.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:T,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:T}}if(!V(e))return e;let[u,...m]=s,w=u.endsWith("[]"),L=w?u.slice(0,-2):u,F=e[L],B=F;if(!w)B=Re(F,m,n,`${t}${L}.`,o);else if(Array.isArray(F)){let T=F.map((N,W)=>Re(N,m,n,`${t}${L}.${W}.`,o));B=T.some((N,W)=>N!==F[W])?T:F}return B===F?e:{...e,[L]:B}}var hn="graview-compiled@1";function Rn(e,s){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(s)))?.[0]}var q="id",ue=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function kn(e){let s=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([u])=>u===o))??t[0]?.[0];return n(s.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(s.filter(([,t])=>t.type==="string"))}function wn(e,s,n){let t;switch(e.type){case"string":case"place":t=M().check(K(500));break;case"phone":t=M().check(K(40),de(mn,"a phone number"));break;case"text":t=M().check(K(2e4)),e.format&&(me(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let u=e.min??(e.type==="duration"?0:void 0),m=[...e.type==="number"?[]:[Me()],...u===void 0?[]:[Te(u)],...e.max===void 0?[]:[De(e.max)],...e.step===void 0?[]:[$e(e.step)]];t=m.length>0?ce().check(...m):ce();break}case"boolean":t=Le();break;case"date":t=M().check(de(ke,"a date like 2026-10-02"));break;case"datetime":t=M().check(fe(Ce,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ne(e.options);break;case"list":t=le(e.of==="number"?ce():e.of==="date"?M().check(de(ke)):e.of==="image"||e.of==="video"||e.of==="file"?we(e.of):M().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=we(e.type);break;case"app-link":t=qe();break;case"url":t=Ge();break;case"email":t=Pe();break}let o=e.type==="number"||e.type==="integer";return pn(t,o&&e.format==="duration"?"duration":e.type),e.description&&(t=t.check(pe(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&Xe(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),s?ne(t):t}var ie=e=>{throw new U(`there is no record "${e}"`,"invalid")},zn=(e,s)=>"field"in e?wn(e.field,e.optional,s):"ref"in e?en(e.ref):ne(Fe()),An=new WeakMap;var ze=(e,s)=>V(s)&&Object.keys(e??{}).length===Object.keys(s).length&&Object.keys(e??{}).every(n=>Object.hasOwn(s,n));function it(e,s={}){let n=V(e)?e.format:void 0;if(n!==hn)return{ok:!1,findings:[Oe("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${hn}`,"compile the document instead")]};let t=e,o=yn(t.document).document,u=o===t.document?t:{...t,document:o},m=V(o)&&typeof o.name=="string"&&V(o.kinds)&&ze(o.kinds,u.kinds)&&ze(o.acts,u.acts)&&ze(o.rules,u.rules)&&Array.isArray(u.edges)&&Array.isArray(u.findings),w={ok:!1,findings:[Oe("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!m)return w;try{return Sn(u,s)}catch{return w}}function Sn(e,s={}){let{document:n}=e,t=n.brand?.timeZone,o=s.today??(()=>Ze(t)),u=new Map(e.edges.map(([h,r])=>[h,r])),m=new Map;for(let[h,r]of Object.entries(n.kinds)){let z=e.kinds[h]?.computed,R=ve(r.edges);m.set(h,{fields:new Set([...Object.keys(r.fields),...R.keys()]),edges:new Map(Object.entries(be(r.edges)).map(([j,$])=>[j,$.cardinality??"many"])),...z?{computed:new Map(z)}:{},...R.size>0?{linked:R}:{}})}e.facts&&m.set(an,{computed:new Map(e.facts)});let w=fn(n),L=new Map,F=Object.entries(n.kinds).map(([h,r])=>{let z={};for(let[i,g]of Object.entries(r.fields))z[i]=wn(g,!g.required,w),g.repeats&&(z[He(i)]=ne(Ue()));for(let[i,g]of ve(r.edges))z[i]=ne(un(g));let{label:R,describe:j,durations:$}=e.kinds[h]??{},P=Object.entries(r.computed??{}).map(([i,g])=>[i,typeof g=="string"?{expr:g}:g]),J=Object.hasOwn(r.fields,"label")&&!r.fields.label.label&&!/\{\s*label\b/.test(r.label??`{${kn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,g])=>[i,g.label]),...P.filter(([,i])=>i.label).map(([i,g])=>[i,g.label])]),A=Object.keys(_).length>0,l=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,g])=>[i,g.default]));L.set(h,l);let D=Object.fromEntries(Object.entries(be(r.edges)).map(([i,{renamedFrom:g,...I}])=>[i,I])),S=i=>r[i]?{[i]:r[i]}:{};return Ke(h,{fields:he(z),edges:D,...S("plural"),...S("noun"),...S("description"),...R?{label:i=>oe(R,{node:i,kinds:m,today:o(),money:w})||i.id}:{},...j?{describe:i=>oe(j,{node:i,kinds:m,today:o(),money:w})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([i,g])=>[i,$?.includes(i)?{...g,as:"duration"}:r.computed[i]]))}:{},...A||r.glance||r.page?{display:{...A?{labels:_}:{},...r.glance?{glance:[...r.glance]}:{},...r.page?{page:r.page}:{}}}:{},...Object.keys(l).length>0?{defaults:l}:{}})}),B=We(F,n.computed);function T(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...L.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let z=e.acts[h],{title:R,effects:j,guard:$,refusal:P,destructive:J,idempotent:_,creates:A,connects:l,severs:D,writes:S,writesOther:i,sets:g}=z,I=new Map(z.args),ae={};for(let[d,x]of I)ae[d]=zn(x,w);let b=[r.on??[]].flat(),C=new Map(z.exprs),G=j.find(d=>"create"in d),Y=(d,x,f,v=null)=>{if(V(d)&&"expr"in d)return re(C.get(d.expr),{graph:f,subject:v,kinds:m,bindings:x,today:o()});let k=ue(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Ee=(d,x)=>{if(!G)return"";let f=n.kinds[G.create].fields,v=N(G.create),k=[];for(let[O,ee]of Object.entries(G.set??{})){try{v[O]=Y(ee,d,x)??v[O]}catch{}let Q=ue(ee);Q&&d[Q]!==void 0&&k.push(O)}let Z=T(v).trim(),H=k.filter(O=>v[O]!==!1&&f[O].type!=="text"&&!(/[^]{41}/.test(v[O])||/ .*[.!?]$/.test(v[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(v[O]))&&T({...v,[O]:void 0}).trim()===Z).map(O=>v[O]===!0?f[O].label??Ve(O):cn(v[O],f[O].format,o(),[],w));return Z&&H.length>0?`${Z} (${H.join(", ")})`:Z};W.push(Qe(h,{input:he(ae),title:R,...r.description?{description:r.description}:{},...r.fromTheOtherEnd?{fromTheOtherEnd:r.fromTheOtherEnd}:{},...I.has(q)?{subject:{kinds:b.length>0?b:"*",arg:q}}:{},...J?{destructive:!0}:{},..._?{idempotent:!0}:{},...A.length>0?{creates:A}:{},...l.length>0?{connects:l}:{},...D.length>0?{severs:D}:{},writes:S,...Object.keys(i).length>0?{writesOther:i}:{},...Object.keys(g).length>0?{sets:g}:{},describe:(d,x)=>{let f=typeof d[q]=="string"?x.getNode(d[q]):void 0,v=f?T(f):Ee(d,x);return v?`${R}: ${v}`:R},apply(d,x){let f=d.graph,v=typeof x[q]=="string"?x[q]:void 0,k=v?f.getNode(v):void 0;if(v&&!k&&ie(v),k&&b.length>0&&!b.includes(k.kind))throw new U(`"${R}" acts on ${b.join(" or ")}, not on ${Ie(k.kind)}`,"invalid");let Z={};for(let[a,c]of Object.entries(x))c!==void 0&&(Z[a]=c);if($&&k){let a;try{a=re($,{graph:f,subject:k,kinds:m,bindings:Z,today:o()})}catch(c){throw c instanceof te?new U(`"${R}" could not be judged: ${c.sentence}`):c}if(a!==!0)throw new U(P?oe(P,{node:k,kinds:m,graph:f,bindings:Z,today:o(),money:w}):`"${R}" is not allowed for ${T(k)} right now`)}let H=new Map,O=a=>f.has(a)||[...H.values()].includes(a),ee=new Set,Q=a=>{let c=Je(a);ee.has(c)||(ee.add(c),d.removeEdge(a))},X=(a,c)=>{let p=ue(a);if(p==="subject")return v;if(p==="me"){let y=d.me;if(y&&n.kinds[f.getNode(y)?.kind]?.people)return y;throw new U(`"${R}" is done as you, and you have no record here`)}if(H.has(p))return H.get(p);try{return Y(a,Z,f,c??k??null)}catch(y){throw y instanceof te?new U(`"${R}" could not work out a value: ${y.sentence}`):y}};for(let a of j)if("create"in a){let c=n.kinds[a.create],p=N(a.create);for(let[ye,se]of Object.entries(a.set??{})){let je=X(se,void 0);je!==void 0&&(p[ye]=je)}let y=kn(c),E=d.freshId(String((y&&p[y])??a.create),a.create);d.addNode({...p,id:E}),a.as&&H.set(a.as,E)}else if("connect"in a||"sever"in a){let c="connect"in a?a.connect:a.sever,p=String(X(a.from,void 0)??""),y=String(X(a.to,void 0)??"");if(O(p)||ie(p),O(y)||ie(y),"connect"in a){if(u.get(c)?.cardinality==="one")for(let E of f.out(p,c))E.id!==y&&Q({kind:c,from:p,to:E.id});f.out(p,c).some(E=>E.id===y)||d.addEdge({kind:c,from:p,to:y})}else Q({kind:c,from:p,to:y})}else if("set"in a){let c=String(X(a.target??"$subject",void 0)??""),p=f.getNode(c);!p&&!O(c)&&ie(c);let y={};for(let[E,ye]of Object.entries(a.set)){let se=X(ye,p);se!==void 0&&(y[E]=se)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in a){let c=String(X(a.remove,void 0)??"");f.has(c)||ie(c),d.removeNode(c)}else if("replace"in a&&k){let c=x.to;for(let p of a.replace){let y=u.get(p)?.from.includes(k.kind)??!0;for(let E of y?f.out(k.id,p):f.in(k.id,p))p===a.keep&&E.id===c||Q(y?{kind:p,from:k.id,to:E.id}:{kind:p,from:E.id,to:k.id})}}}}))}let Ae=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:z,require:R,when:j,says:$}=e.rules[h],P=r.repairs??[],J=(A,l,D=o(),S)=>{let i=[],g={graph:A,subject:l,kinds:m,today:D,...S?{linked:S}:{},onUnread:b=>i.push(b)},I;try{if(j&&re(j,g)!==!0)return[];if(I=re(R,g)===!0,!I&&i.length>0)throw new te(`it reads ${on(i[0])}`,0)}catch(b){throw b instanceof sn?new Ye(b.sentence):b instanceof te?new Error(b.sentence):b}if(I)return[];let ae=P.flatMap(b=>{let C=n.acts?.[b.act],G={},Y=l&&C?.on&&C.fromTheOtherEnd&&![C.on].flat().includes(l.kind)?Rn(e.acts[b.act].args,l.kind):void 0;Y?G[Y]=l.id:l&&(C?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(b.act))&&(G[q]=l.id);for(let[x,f]of Object.entries(b.args??{}))G[x]=ue(f)==="subject"?l?.id:f;let d=(C?e.acts[b.act].args:[]).filter(([x,f])=>f.required&&G[x]===void 0).map(([x])=>x);return[{mutation:b.act,label:b.label??(Y?C.fromTheOtherEnd:C?.title)??b.act.replace(/-/g," "),args:G,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...l?{subjectId:l.id}:{},label:z,message:$?oe($,{node:l,kinds:m,graph:A,today:D,money:w}):l?`${T(l)}: ${z}`:z,nodeIds:l?[l.id]:[],repairs:ae}]},_={label:z,shape:{over:r.over,require:R,when:j,says:$,declared:n.kinds,money:w,kinds:m,today:o},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...P.length>0?{repairs:P.map(A=>A.act)}:{}};Ae.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:A,today:l,context:D})=>J(A,null,l,D?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:l,today:D,context:S})=>J(A,l,D,S?.linked)}))}let Se=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:Ae,...Se?{policy:Se}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return gn(ge,n),An.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:m}}export{yn as a,Gn as b,hn as c,q as d,ue as e,kn as f,it as g,Sn as h};
|
|
1
|
+
import{b as on,c as an,d as te,e as sn,f as re,h as Oe,i as dn,n as cn,r as oe}from"./chunk.KTFUVR4V.js";import{B as pe,C as me,Ca as Be,Cb as Xe,Ea as _e,F as ke,H as Ce,Hb as en,I as Ze,Ia as be,Ja as ve,Pa as He,Sa as Ue,ab as We,b as De,ba as Ke,bb as Je,c as Te,d as $e,dc as nn,e as K,eb as xe,fa as Ve,fb as Ye,g as de,h as M,i as Pe,j as Ge,k as ce,l as Me,la as Ie,m as Le,o as Fe,oc as tn,p as le,pc as rn,q as he,v as Ne,vb as U,wa as we,x as ne,yb as Qe,z as fe,za as qe}from"./chunk.4TJOS4C7.js";function ln(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let s=e,n=w=>typeof s[w]=="string"?s[w]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,u,m]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...u!==void 0?{alt:u}:{},...m!==void 0?{darkFallback:m}:{}}}function Gn(e,s){let n=e.brand??{},t=n.accent?rn(n.accent):void 0;t&&!t.ok&&s.push(dn("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${t.why}`,"pick a color further from orange-red, or a darker one"));let o=ln(n.logo),u=n.name??e.name,m=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,w])=>typeof w=="string"&&!/url\(|@import|[;{}<>\\]/i.test(w)).map(([w,L])=>[w,tn(L)])):void 0;return{name:u,schemes:t?.ok?t.schemes:nn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...o?{logo:o.dark||o.darkFallback==="invert"?{light:o.light,...o.dark?{dark:o.dark}:{darkFallback:"invert"}}:o.light,logoAlt:o.alt??u}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...m?{typography:m}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function fn(e){let{currency:s,locale:n,timeZone:t}=e.brand??{};return{...s?{currency:s}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var bn=Symbol.for("@graview/core:typed-field"),pn=(e,s)=>(/^(phone|place|duration)$/.test(s)&&(me(e)[bn]=s),e),mn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function un(e){let s=M().check(K(300),fe(t=>Be(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?s:le(s).check(K(200));return _e(e.description?n.check(pe(e.description)):n,e)}var xn=new WeakMap;function gn(e,s){xn.set(e,s)}var On=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function yn(e,s=On){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of s)t=Re(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Re(e,s,n,t,o){if(s.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:T,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:T}}if(!V(e))return e;let[u,...m]=s,w=u.endsWith("[]"),L=w?u.slice(0,-2):u,F=e[L],B=F;if(!w)B=Re(F,m,n,`${t}${L}.`,o);else if(Array.isArray(F)){let T=F.map((N,W)=>Re(N,m,n,`${t}${L}.${W}.`,o));B=T.some((N,W)=>N!==F[W])?T:F}return B===F?e:{...e,[L]:B}}var hn="graview-compiled@1";function Rn(e,s){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(s)))?.[0]}var q="id",ue=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function kn(e){let s=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([u])=>u===o))??t[0]?.[0];return n(s.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(s.filter(([,t])=>t.type==="string"))}function wn(e,s,n){let t;switch(e.type){case"string":case"place":t=M().check(K(500));break;case"phone":t=M().check(K(40),de(mn,"a phone number"));break;case"text":t=M().check(K(2e4)),e.format&&(me(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let u=e.min??(e.type==="duration"?0:void 0),m=[...e.type==="number"?[]:[Me()],...u===void 0?[]:[Te(u)],...e.max===void 0?[]:[De(e.max)],...e.step===void 0?[]:[$e(e.step)]];t=m.length>0?ce().check(...m):ce();break}case"boolean":t=Le();break;case"date":t=M().check(de(ke,"a date like 2026-10-02"));break;case"datetime":t=M().check(fe(Ce,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ne(e.options);break;case"list":t=le(e.of==="number"?ce():e.of==="date"?M().check(de(ke)):e.of==="image"||e.of==="video"||e.of==="file"?we(e.of):M().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=we(e.type);break;case"app-link":t=qe();break;case"url":t=Ge();break;case"email":t=Pe();break}let o=e.type==="number"||e.type==="integer";return pn(t,o&&e.format==="duration"?"duration":e.type),e.description&&(t=t.check(pe(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&Xe(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),s?ne(t):t}var ie=e=>{throw new U(`there is no record "${e}"`,"invalid")},zn=(e,s)=>"field"in e?wn(e.field,e.optional,s):"ref"in e?en(e.ref):ne(Fe()),An=new WeakMap;var ze=(e,s)=>V(s)&&Object.keys(e??{}).length===Object.keys(s).length&&Object.keys(e??{}).every(n=>Object.hasOwn(s,n));function it(e,s={}){let n=V(e)?e.format:void 0;if(n!==hn)return{ok:!1,findings:[Oe("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${hn}`,"compile the document instead")]};let t=e,o=yn(t.document).document,u=o===t.document?t:{...t,document:o},m=V(o)&&typeof o.name=="string"&&V(o.kinds)&&ze(o.kinds,u.kinds)&&ze(o.acts,u.acts)&&ze(o.rules,u.rules)&&Array.isArray(u.edges)&&Array.isArray(u.findings),w={ok:!1,findings:[Oe("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!m)return w;try{return Sn(u,s)}catch{return w}}function Sn(e,s={}){let{document:n}=e,t=n.brand?.timeZone,o=s.today??(()=>Ze(t)),u=new Map(e.edges.map(([h,r])=>[h,r])),m=new Map;for(let[h,r]of Object.entries(n.kinds)){let z=e.kinds[h]?.computed,R=ve(r.edges);m.set(h,{fields:new Set([...Object.keys(r.fields),...R.keys()]),edges:new Map(Object.entries(be(r.edges)).map(([j,$])=>[j,$.cardinality??"many"])),...z?{computed:new Map(z)}:{},...R.size>0?{linked:R}:{}})}e.facts&&m.set(an,{computed:new Map(e.facts)});let w=fn(n),L=new Map,F=Object.entries(n.kinds).map(([h,r])=>{let z={};for(let[i,g]of Object.entries(r.fields))z[i]=wn(g,!g.required,w),g.repeats&&(z[He(i)]=ne(Ue()));for(let[i,g]of ve(r.edges))z[i]=ne(un(g));let{label:R,describe:j,durations:$}=e.kinds[h]??{},P=Object.entries(r.computed??{}).map(([i,g])=>[i,typeof g=="string"?{expr:g}:g]),J=Object.hasOwn(r.fields,"label")&&!r.fields.label.label&&!/\{\s*label\b/.test(r.label??`{${kn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,g])=>[i,g.label]),...P.filter(([,i])=>i.label).map(([i,g])=>[i,g.label])]),A=Object.keys(_).length>0,l=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,g])=>[i,g.default]));L.set(h,l);let D=Object.fromEntries(Object.entries(be(r.edges)).map(([i,{renamedFrom:g,...I}])=>[i,I])),S=i=>r[i]?{[i]:r[i]}:{};return Ke(h,{fields:he(z),edges:D,...S("plural"),...S("noun"),...S("description"),...R?{label:i=>oe(R,{node:i,kinds:m,today:o(),money:w})||i.id}:{},...j?{describe:i=>oe(j,{node:i,kinds:m,today:o(),money:w})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([i,g])=>[i,$?.includes(i)?{...g,as:"duration"}:r.computed[i]]))}:{},...A||r.glance||r.page?{display:{...A?{labels:_}:{},...r.glance?{glance:[...r.glance]}:{},...r.page?{page:r.page}:{}}}:{},...Object.keys(l).length>0?{defaults:l}:{}})}),B=We(F,n.computed);function T(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...L.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let z=e.acts[h],{title:R,effects:j,guard:$,refusal:P,destructive:J,idempotent:_,creates:A,connects:l,severs:D,writes:S,writesOther:i,sets:g}=z,I=new Map(z.args),ae={};for(let[d,x]of I)ae[d]=zn(x,w);let b=[r.on??[]].flat(),C=new Map(z.exprs),G=j.find(d=>"create"in d),Y=(d,x,f,v=null)=>{if(V(d)&&"expr"in d)return re(C.get(d.expr),{graph:f,subject:v,kinds:m,bindings:x,today:o()});let k=ue(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Ee=(d,x)=>{if(!G)return"";let f=n.kinds[G.create].fields,v=N(G.create),k=[];for(let[O,ee]of Object.entries(G.set??{})){try{v[O]=Y(ee,d,x)??v[O]}catch{}let Q=ue(ee);Q&&d[Q]!==void 0&&k.push(O)}let Z=T(v).trim(),H=k.filter(O=>v[O]!==!1&&f[O].type!=="text"&&!(/[^]{41}/.test(v[O])||/ .*[.!?]$/.test(v[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(v[O]))&&T({...v,[O]:void 0}).trim()===Z).map(O=>v[O]===!0?f[O].label??Ve(O):cn(v[O],f[O].format,o(),[],w));return Z&&H.length>0?`${Z} (${H.join(", ")})`:Z};W.push(Qe(h,{input:he(ae),title:R,...r.description?{description:r.description}:{},...r.fromTheOtherEnd?{fromTheOtherEnd:r.fromTheOtherEnd}:{},...I.has(q)?{subject:{kinds:b.length>0?b:"*",arg:q}}:{},...J?{destructive:!0}:{},..._?{idempotent:!0}:{},...A.length>0?{creates:A}:{},...l.length>0?{connects:l}:{},...D.length>0?{severs:D}:{},writes:S,...Object.keys(i).length>0?{writesOther:i}:{},...Object.keys(g).length>0?{sets:g}:{},describe:(d,x)=>{let f=typeof d[q]=="string"?x.getNode(d[q]):void 0,v=f?T(f):Ee(d,x);return v?`${R}: ${v}`:R},apply(d,x){let f=d.graph,v=typeof x[q]=="string"?x[q]:void 0,k=v?f.getNode(v):void 0;if(v&&!k&&ie(v),k&&b.length>0&&!b.includes(k.kind))throw new U(`"${R}" acts on ${b.join(" or ")}, not on ${Ie(k.kind)}`,"invalid");let Z={};for(let[a,c]of Object.entries(x))c!==void 0&&(Z[a]=c);if($&&k){let a;try{a=re($,{graph:f,subject:k,kinds:m,bindings:Z,today:o()})}catch(c){throw c instanceof te?new U(`"${R}" could not be judged: ${c.sentence}`):c}if(a!==!0)throw new U(P?oe(P,{node:k,kinds:m,graph:f,bindings:Z,today:o(),money:w}):`"${R}" is not allowed for ${T(k)} right now`)}let H=new Map,O=a=>f.has(a)||[...H.values()].includes(a),ee=new Set,Q=a=>{let c=Je(a);ee.has(c)||(ee.add(c),d.removeEdge(a))},X=(a,c)=>{let p=ue(a);if(p==="subject")return v;if(p==="me"){let y=d.me;if(y&&n.kinds[f.getNode(y)?.kind]?.people)return y;throw new U(`"${R}" is done as you, and you have no record here`)}if(H.has(p))return H.get(p);try{return Y(a,Z,f,c??k??null)}catch(y){throw y instanceof te?new U(`"${R}" could not work out a value: ${y.sentence}`):y}};for(let a of j)if("create"in a){let c=n.kinds[a.create],p=N(a.create);for(let[ye,se]of Object.entries(a.set??{})){let je=X(se,void 0);je!==void 0&&(p[ye]=je)}let y=kn(c),E=d.freshId(String((y&&p[y])??a.create),a.create);d.addNode({...p,id:E}),a.as&&H.set(a.as,E)}else if("connect"in a||"sever"in a){let c="connect"in a?a.connect:a.sever,p=String(X(a.from,void 0)??""),y=String(X(a.to,void 0)??"");if(O(p)||ie(p),O(y)||ie(y),"connect"in a){if(u.get(c)?.cardinality==="one")for(let E of f.out(p,c))E.id!==y&&Q({kind:c,from:p,to:E.id});f.out(p,c).some(E=>E.id===y)||d.addEdge({kind:c,from:p,to:y})}else Q({kind:c,from:p,to:y})}else if("set"in a){let c=String(X(a.target??"$subject",void 0)??""),p=f.getNode(c);!p&&!O(c)&&ie(c);let y={};for(let[E,ye]of Object.entries(a.set)){let se=X(ye,p);se!==void 0&&(y[E]=se)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in a){let c=String(X(a.remove,void 0)??"");f.has(c)||ie(c),d.removeNode(c)}else if("replace"in a&&k){let c=x.to;for(let p of a.replace){let y=u.get(p)?.from.includes(k.kind)??!0;for(let E of y?f.out(k.id,p):f.in(k.id,p))p===a.keep&&E.id===c||Q(y?{kind:p,from:k.id,to:E.id}:{kind:p,from:E.id,to:k.id})}}}}))}let Ae=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:z,require:R,when:j,says:$}=e.rules[h],P=r.repairs??[],J=(A,l,D=o(),S)=>{let i=[],g={graph:A,subject:l,kinds:m,today:D,...S?{linked:S}:{},onUnread:b=>i.push(b)},I;try{if(j&&re(j,g)!==!0)return[];if(I=re(R,g)===!0,!I&&i.length>0)throw new te(`it reads ${on(i[0])}`,0)}catch(b){throw b instanceof sn?new Ye(b.sentence):b instanceof te?new Error(b.sentence):b}if(I)return[];let ae=P.flatMap(b=>{let C=n.acts?.[b.act],G={},Y=l&&C?.on&&C.fromTheOtherEnd&&![C.on].flat().includes(l.kind)?Rn(e.acts[b.act].args,l.kind):void 0;Y?G[Y]=l.id:l&&(C?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(b.act))&&(G[q]=l.id);for(let[x,f]of Object.entries(b.args??{}))G[x]=ue(f)==="subject"?l?.id:f;let d=(C?e.acts[b.act].args:[]).filter(([x,f])=>f.required&&G[x]===void 0).map(([x])=>x);return[{mutation:b.act,label:b.label??(Y?C.fromTheOtherEnd:C?.title)??b.act.replace(/-/g," "),args:G,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...l?{subjectId:l.id}:{},label:z,message:$?oe($,{node:l,kinds:m,graph:A,today:D,money:w}):l?`${T(l)}: ${z}`:z,nodeIds:l?[l.id]:[],repairs:ae}]},_={label:z,shape:{over:r.over,require:R,when:j,says:$,declared:n.kinds,money:w,kinds:m,today:o},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...P.length>0?{repairs:P.map(A=>A.act)}:{}};Ae.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:A,today:l,context:D})=>J(A,null,l,D?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:l,today:D,context:S})=>J(A,l,D,S?.linked)}))}let Se=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:Ae,...Se?{policy:Se}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return gn(ge,n),An.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:m}}export{yn as a,Gn as b,hn as c,q as d,ue as e,kn as f,it as g,Sn as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p}from"./chunk.
|
|
1
|
+
import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p}from"./chunk.YDL5BSTG.js";import{a,b}from"./chunk.DUWYF7BO.js";import"./chunk.UGJSMNVO.js";import"./chunk.NR5ODXMO.js";import"./chunk.N4M54YK6.js";import"./chunk.KVJFY7N5.js";import"./chunk.DPHTUTOS.js";import"./chunk.2UIUMG23.js";import"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{j as ARRANGE_NARROW,o as ArrangeBar,e as CHIP_FIELDS,d as MANY_AT_THE_FAR_END,c as TYPED_FROM,p as arrangementCaption,a as arrangementOf,i as chipOffers,m as directionWords,g as farCount,f as farCounts,l as inSentence,h as offeredFilters,n as preloadArrangeLists,k as sayCondition,b as withArrangement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c}from"./chunk.
|
|
1
|
+
import{e as c}from"./chunk.QQTRAY5W.js";import{Tb as m}from"./chunk.4TJOS4C7.js";function k(e){let n=e.policy?.sees??[];return n.length===0?!0:e.schema.kinds.every(r=>n.some(o=>o.roles==="*"&&!o.own&&!o.via&&o.kinds.includes(r)))}function A(e){let n=e;for(let r=0;r<8&&n?._zod?.def;r+=1){let o=n._zod.def;if(o.type==="enum")return Object.values(o.entries);if(o.type==="literal")return o.values;if(!("innerType"in o))return;n=o.innerType}}var h=(e,n)=>({ok:!1,reason:e,message:n});function b(e,n){return c(e).find(r=>(r.as??r.act)===n)??c(e).find(r=>r.act===n&&r.as===void 0)}var w=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&"href"in e;function S(e,n,r,o,f){let l=b(n,r);if(!l)return h("undeclared",`This view may not ask for \u201C${r}\u201D: its manifest does not name it.`);let u={},g=0;for(let[y,i]of Object.entries(o)){let d=a=>{if(!w(a))return a;let s=typeof a.href=="string"?f?.file(a.href):void 0;if(!s)throw h("malformed",`\u201C${y}\u201D is a file the host did not hand this view: a view hands an act a file the person dropped (event.files), or one a record it was shown holds, as it was handed.`);return f?.dropped(s.href)&&(g+=1),s};try{u[y]=Array.isArray(i)?i.map(d):d(i)}catch(a){return a}}if(!k(e)){let i=e.allMutations().find(s=>s.name===l.act)?.input?.shape??{},d=(s,t)=>w(t)&&typeof t.href=="string"&&f?.dropped(t.href)===!0||m(t)||typeof t=="string"&&f?.shown.has(t)===!0||(A(i[s])?.some(p=>p===t)??!1);if(!(g>0&&Object.entries(u).every(([s,t])=>Array.isArray(t)?t.every(p=>d(s,p)):d(s,t))))return h("press-only","In this app some members may not see some records, so a view's act applies only when you press it.")}return{ok:!0,name:l.act,args:{...u,...l.constants??{}}}}export{k as a,A as b,h as c,b as d,S as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as kt,d as ne,e as Ft,f as Tt}from"./chunk.ONEYVLC2.js";import{a as Lt,b as Le,c as Dt}from"./chunk.WQONZBA3.js";import{m as Ct}from"./chunk.NWA7Q6CI.js";import{g as vt}from"./chunk.3MMLRSRC.js";import{a as pt}from"./chunk.OHSJQYJN.js";import{d as gt}from"./chunk.DX357TZ3.js";import{d as yt}from"./chunk.H7KCWCB4.js";import{F as xt,G as Pt,i as mt,j as Nr,s as Rt,t as wt,w as St,x as bt,y as Et}from"./chunk.XSNAG4JT.js";import{$ as ht,G as M,O as ft,R as ee}from"./chunk.XWAMQPUM.js";import{Wa as at,Xc as it,Yc as lt,Zc as st,ea as Ce,ha as de,jc as nt,md as ut,nd as ct,od as dt,vc as ot}from"./chunk.AS4CQBOQ.js";import{b as D}from"./chunk.AJZBJBMO.js";function Mr(e,t){return it(e,t).slice(1)}function fe(e,t){return e.kinds.find(r=>Mr(e,r)===t)}function Dn(e,t,r){return lt(e,t,r)}function kn(e,t){return st(e,t)}var _=D(M(),1),g=D(M(),1),x=D(M(),1),Ve=D(M(),1),hr=D(M(),1),S=D(M(),1),tn=D(M(),1),rn=D(M(),1),an=D(M(),1),v=D(M(),1),Pr=D(M(),1);var Ae=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ut=/^[\\/]{2}/;function Or(e,t){return t+e.replace(/\\/g,"/")}var Nt="popstate";function ge(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jt(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((h,y)=>c(h,typeof h=="string"?null:h.state,y===0?"default":void 0,typeof h=="string"?void 0:h.mask));let o=s(r??n.length-1),i="POP",l=null;function s(h){return Math.min(Math.max(h,0),n.length-1)}function u(){return n[o]}function c(h,y=null,p,f){let R=ve(n?u().pathname:"/",h,y,p,f);return O(R.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),R}function d(h){return typeof h=="string"?h:W(h)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let y=typeof h=="string"?V(h):h;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(h,y){i="PUSH";let p=ge(h)?h:c(h,y);o+=1,n.splice(o,n.length,p),a&&l&&l({action:i,location:p,delta:1})},replace(h,y){i="REPLACE";let p=ge(h)?h:c(h,y);n[o]=p,a&&l&&l({action:i,location:p,delta:0})},go(h){i="POP";let y=s(o+h),p=n[y];o=y,l&&l({action:i,location:p,delta:h})},listen(h){return l=h,()=>{l=null}}}}function zt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return ve("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:W(n)}return _r(t,r,null,e)}function L(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ar(){return Math.random().toString(36).substring(2,10)}function Mt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ve(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||a||Ar(),mask:n}}function W({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function V(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function _r(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let f=c(),R=f==null?null:f-u;u=f,s&&s({action:l,location:p.location,delta:R})}function m(f,R){l="PUSH";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c()+1;let b=Mt(w,u),P=p.createHref(w.mask||w);try{i.pushState(b,"",P)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;n.location.assign(P)}o&&s&&s({action:l,location:p.location,delta:1})}function h(f,R){l="REPLACE";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c();let b=Mt(w,u),P=p.createHref(w.mask||w);i.replaceState(b,"",P),o&&s&&s({action:l,location:p.location,delta:0})}function y(f){return $r(n,f)}let p={get action(){return l},get location(){return e(n,i)},listen(f){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(Nt,d),s=f,()=>{n.removeEventListener(Nt,d),s=null}},createHref(f){return t(n,f)},createURL:y,encodeLocation(f){let R=y(f);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:m,replace:h,go(f){return i.go(f)}};return p}function $r(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),L(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:W(t);return n=n.replace(/ $/,"%20"),!r&&Ut.test(n)&&(n=a+n),new URL(n,a)}var Ir;Ir=new WeakMap;function _e(e,t,r="/"){return Hr(e,t,r,!1)}function Hr(e,t,r,a,n){let o=typeof t=="string"?V(t):t,i=U(o.pathname||"/",r);if(i==null)return null;let l=n??jr(e),s=null,u=qr(i);for(let c=0;s==null&&c<l.length;++c)s=Qr(l[c],u,a);return s}function Ur(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function jr(e){let t=Bt(e);return zr(t),t}function Bt(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;L(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=H([a,c.relativePath]),m=r.concat(c);i.children&&i.children.length>0&&(L(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Bt(i.children,t,m,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Gr(d,i.index),routesMeta:m.map((h,y)=>{let[p,f]=Vt(h.relativePath,h.caseSensitive,y===m.length-1);return{...h,matcher:p,compiledParams:f}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Wt(i.path))o(i,l,!0,s)}),t}function Wt(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Wt(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function zr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Xr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Br=/^:[\w-]+$/,Wr=3,Yr=2,Vr=1,Jr=10,Kr=-2,Ot=e=>e==="*";function Gr(e,t){let r=e.split("/"),a=r.length;return r.some(Ot)&&(a+=Kr),t&&(a+=Yr),r.filter(n=>!Ot(n)).reduce((n,o)=>n+(Br.test(o)?Wr:o===""?Vr:Jr),a)}function Xr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Qr(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},m=s.matcher&&s.compiledParams?Yt(d,c,s.matcher,s.compiledParams):ie(d,c),h=s.route;if(!m&&u&&r&&!a[a.length-1].route.index&&(m=ie({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!m)return null;Object.assign(n,m.params),i.push({params:n,pathname:H([o,m.pathname]),pathnameBase:ea(H([o,m.pathnameBase])),route:h}),m.pathnameBase!=="/"&&(o=H([o,m.pathnameBase]))}return i}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Vt(e.path,e.caseSensitive,e.end);return Yt(e,t,r,a)}function Yt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=te(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},m)=>{if(c==="*"){let y=l[m]||"";i=te(o.slice(0,o.length-y.length),1)}let h=l[m];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Vt(e,t=!1,r=!0){O(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function qr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function U(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Jt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?V(e):e,o;return r?(r=Kt(r),r.startsWith("/")||r.startsWith("\\")?o=At(r.substring(1),"/"):o=At(r,t)):o=t,{pathname:o,search:ta(a),hash:ra(n)}}function At(e,t){let r=te(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function De(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function $e(e){let t=Zr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Se(e,t,r,a=!1){let n;typeof e=="string"?n=V(e):(n={...e},L(!n.pathname||!n.pathname.includes("?"),De("?","pathname","search",n)),L(!n.pathname||!n.pathname.includes("#"),De("#","pathname","hash",n)),L(!n.search||!n.search.includes("#"),De("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),d-=1;n.pathname=m.join("/")}l=d>=0?t[d]:"/"}let s=Jt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Kt=e=>e.replace(/[\\/]{2,}/g,"/"),H=e=>Kt(e.join("/"));function te(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var ea=e=>te(e).replace(/^\/*/,"/"),ta=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ra=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Gt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Xt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function aa(e){let t=e.map(r=>r.route.path).filter(Boolean);return H(t)||"/"}var Qt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qt(e,t){let r=e;if(typeof r!="string"||!Ae.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Qt)try{let o=new URL(window.location.href),i=Ut.test(r)?new URL(Or(r,o.protocol)):new URL(r),l=U(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{O(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var Tn=Symbol("Uninstrumented");var Nn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _t=new URL("http://localhost");function Ie(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),_t)}catch{return _t}}function ke(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function na(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function He(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!ke(n,r),l=!ke(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!na(e,n)||!ke(n,o)))throw new Error("External navigation is not allowed")}var Zt=["POST","PUT","PATCH","DELETE"],Mn=new Set(Zt),oa=["GET",...Zt],On=new Set(oa);var An=Symbol("ResetLoaderData"),ia,la,sa,ua;ia=new WeakMap;la=new WeakMap;sa=new WeakMap;ua=new WeakMap;var ca=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function da(e){try{return ca.includes(new URL(e).protocol)}catch{return!1}}var G=_.createContext(null);G.displayName="DataRouter";var re=_.createContext(null);re.displayName="DataRouterState";var er=_.createContext(!1);function fa(){return _.useContext(er)}var Ue=_.createContext({isTransitioning:!1});Ue.displayName="ViewTransition";var tr=_.createContext(new Map);tr.displayName="Fetchers";var ha=_.createContext(null);ha.displayName="Await";var N=_.createContext(null);N.displayName="Navigation";var X=_.createContext(null);X.displayName="Location";var I=_.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName="Route";var je=_.createContext(null);je.displayName="RouteError";var Ne=!0,rr="REACT_ROUTER_ERROR",ma="REDIRECT",pa="ROUTE_ERROR_RESPONSE";function ya(e){if(e.startsWith(`${rr}:${ma}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ga(e){if(e.startsWith(`${rr}:${pa}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Gt(t.status,t.statusText,t.data)}catch{}}function be(e,{relative:t}={}){L(Q(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(N),{hash:n,pathname:o,search:i}=ae(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:H([r,o])),a.createHref({pathname:l,search:i,hash:n})}function Q(){return g.useContext(X)!=null}function T(){return L(Q(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(X).location}function va(){return g.useContext(X).navigationType}var ar="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nr(e){g.useContext(N).static||g.useLayoutEffect(e)}function q(){let{isDataRoute:e}=g.useContext(I);return e?ka():Ra()}function Ra(){L(Q(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(G),{basename:t,navigator:r}=g.useContext(N),{matches:a}=g.useContext(I),{pathname:n}=T(),o=JSON.stringify($e(a)),i=g.useRef(!1);return nr(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(O(i.current,ar),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=Se(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:H([t,c.pathname])),He(typeof s=="string"?s:W(s),r.createHref(c),Ie(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var _n=g.createContext(null);function wa(){let{matches:e}=g.useContext(I);return e[e.length-1]?.params??{}}function ae(e,{relative:t}={}){let{matches:r}=g.useContext(I),{pathname:a}=T(),n=JSON.stringify($e(r));return g.useMemo(()=>Se(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function or(e,t){return ir(e,t)}function ir(e,t,r){L(Q(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(N),{matches:n}=g.useContext(I),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Ne){let f=u&&u.path||"";cr(l,!u||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1
|
+
import{c as kt,d as ne,e as Ft,f as Tt}from"./chunk.PMJUGHW4.js";import{a as Lt,b as Le,c as Dt}from"./chunk.Y4MQGEUS.js";import{m as Ct}from"./chunk.EXEZBZGW.js";import{g as vt}from"./chunk.DWPU56S5.js";import{a as pt}from"./chunk.2GLJH253.js";import{d as gt}from"./chunk.KVJFY7N5.js";import{d as yt}from"./chunk.DPHTUTOS.js";import{F as xt,G as Pt,i as mt,j as Nr,s as Rt,t as wt,w as St,x as bt,y as Et}from"./chunk.2UIUMG23.js";import{$ as ht,G as M,O as ft,R as ee}from"./chunk.KA44WNB4.js";import{$c as lt,Xa as at,_c as it,ad as st,fa as Ce,ia as de,kc as nt,pd as ut,qd as ct,rd as dt,wc as ot}from"./chunk.4TJOS4C7.js";import{b as D}from"./chunk.AJZBJBMO.js";function Mr(e,t){return it(e,t).slice(1)}function fe(e,t){return e.kinds.find(r=>Mr(e,r)===t)}function Dn(e,t,r){return lt(e,t,r)}function kn(e,t){return st(e,t)}var _=D(M(),1),g=D(M(),1),x=D(M(),1),Ve=D(M(),1),hr=D(M(),1),S=D(M(),1),tn=D(M(),1),rn=D(M(),1),an=D(M(),1),v=D(M(),1),Pr=D(M(),1);var Ae=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ut=/^[\\/]{2}/;function Or(e,t){return t+e.replace(/\\/g,"/")}var Nt="popstate";function ge(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jt(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((h,y)=>c(h,typeof h=="string"?null:h.state,y===0?"default":void 0,typeof h=="string"?void 0:h.mask));let o=s(r??n.length-1),i="POP",l=null;function s(h){return Math.min(Math.max(h,0),n.length-1)}function u(){return n[o]}function c(h,y=null,p,f){let R=ve(n?u().pathname:"/",h,y,p,f);return O(R.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),R}function d(h){return typeof h=="string"?h:W(h)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let y=typeof h=="string"?V(h):h;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(h,y){i="PUSH";let p=ge(h)?h:c(h,y);o+=1,n.splice(o,n.length,p),a&&l&&l({action:i,location:p,delta:1})},replace(h,y){i="REPLACE";let p=ge(h)?h:c(h,y);n[o]=p,a&&l&&l({action:i,location:p,delta:0})},go(h){i="POP";let y=s(o+h),p=n[y];o=y,l&&l({action:i,location:p,delta:h})},listen(h){return l=h,()=>{l=null}}}}function zt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return ve("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:W(n)}return _r(t,r,null,e)}function L(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ar(){return Math.random().toString(36).substring(2,10)}function Mt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ve(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||a||Ar(),mask:n}}function W({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function V(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function _r(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let f=c(),R=f==null?null:f-u;u=f,s&&s({action:l,location:p.location,delta:R})}function m(f,R){l="PUSH";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c()+1;let b=Mt(w,u),P=p.createHref(w.mask||w);try{i.pushState(b,"",P)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;n.location.assign(P)}o&&s&&s({action:l,location:p.location,delta:1})}function h(f,R){l="REPLACE";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c();let b=Mt(w,u),P=p.createHref(w.mask||w);i.replaceState(b,"",P),o&&s&&s({action:l,location:p.location,delta:0})}function y(f){return $r(n,f)}let p={get action(){return l},get location(){return e(n,i)},listen(f){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(Nt,d),s=f,()=>{n.removeEventListener(Nt,d),s=null}},createHref(f){return t(n,f)},createURL:y,encodeLocation(f){let R=y(f);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:m,replace:h,go(f){return i.go(f)}};return p}function $r(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),L(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:W(t);return n=n.replace(/ $/,"%20"),!r&&Ut.test(n)&&(n=a+n),new URL(n,a)}var Ir;Ir=new WeakMap;function _e(e,t,r="/"){return Hr(e,t,r,!1)}function Hr(e,t,r,a,n){let o=typeof t=="string"?V(t):t,i=U(o.pathname||"/",r);if(i==null)return null;let l=n??jr(e),s=null,u=qr(i);for(let c=0;s==null&&c<l.length;++c)s=Qr(l[c],u,a);return s}function Ur(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function jr(e){let t=Bt(e);return zr(t),t}function Bt(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;L(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=H([a,c.relativePath]),m=r.concat(c);i.children&&i.children.length>0&&(L(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Bt(i.children,t,m,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Gr(d,i.index),routesMeta:m.map((h,y)=>{let[p,f]=Vt(h.relativePath,h.caseSensitive,y===m.length-1);return{...h,matcher:p,compiledParams:f}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Wt(i.path))o(i,l,!0,s)}),t}function Wt(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Wt(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function zr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Xr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Br=/^:[\w-]+$/,Wr=3,Yr=2,Vr=1,Jr=10,Kr=-2,Ot=e=>e==="*";function Gr(e,t){let r=e.split("/"),a=r.length;return r.some(Ot)&&(a+=Kr),t&&(a+=Yr),r.filter(n=>!Ot(n)).reduce((n,o)=>n+(Br.test(o)?Wr:o===""?Vr:Jr),a)}function Xr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Qr(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},m=s.matcher&&s.compiledParams?Yt(d,c,s.matcher,s.compiledParams):ie(d,c),h=s.route;if(!m&&u&&r&&!a[a.length-1].route.index&&(m=ie({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!m)return null;Object.assign(n,m.params),i.push({params:n,pathname:H([o,m.pathname]),pathnameBase:ea(H([o,m.pathnameBase])),route:h}),m.pathnameBase!=="/"&&(o=H([o,m.pathnameBase]))}return i}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Vt(e.path,e.caseSensitive,e.end);return Yt(e,t,r,a)}function Yt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=te(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},m)=>{if(c==="*"){let y=l[m]||"";i=te(o.slice(0,o.length-y.length),1)}let h=l[m];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Vt(e,t=!1,r=!0){O(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function qr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function U(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Jt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?V(e):e,o;return r?(r=Kt(r),r.startsWith("/")||r.startsWith("\\")?o=At(r.substring(1),"/"):o=At(r,t)):o=t,{pathname:o,search:ta(a),hash:ra(n)}}function At(e,t){let r=te(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function De(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function $e(e){let t=Zr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Se(e,t,r,a=!1){let n;typeof e=="string"?n=V(e):(n={...e},L(!n.pathname||!n.pathname.includes("?"),De("?","pathname","search",n)),L(!n.pathname||!n.pathname.includes("#"),De("#","pathname","hash",n)),L(!n.search||!n.search.includes("#"),De("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),d-=1;n.pathname=m.join("/")}l=d>=0?t[d]:"/"}let s=Jt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Kt=e=>e.replace(/[\\/]{2,}/g,"/"),H=e=>Kt(e.join("/"));function te(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var ea=e=>te(e).replace(/^\/*/,"/"),ta=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ra=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Gt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Xt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function aa(e){let t=e.map(r=>r.route.path).filter(Boolean);return H(t)||"/"}var Qt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qt(e,t){let r=e;if(typeof r!="string"||!Ae.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Qt)try{let o=new URL(window.location.href),i=Ut.test(r)?new URL(Or(r,o.protocol)):new URL(r),l=U(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{O(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var Tn=Symbol("Uninstrumented");var Nn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _t=new URL("http://localhost");function Ie(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),_t)}catch{return _t}}function ke(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function na(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function He(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!ke(n,r),l=!ke(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!na(e,n)||!ke(n,o)))throw new Error("External navigation is not allowed")}var Zt=["POST","PUT","PATCH","DELETE"],Mn=new Set(Zt),oa=["GET",...Zt],On=new Set(oa);var An=Symbol("ResetLoaderData"),ia,la,sa,ua;ia=new WeakMap;la=new WeakMap;sa=new WeakMap;ua=new WeakMap;var ca=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function da(e){try{return ca.includes(new URL(e).protocol)}catch{return!1}}var G=_.createContext(null);G.displayName="DataRouter";var re=_.createContext(null);re.displayName="DataRouterState";var er=_.createContext(!1);function fa(){return _.useContext(er)}var Ue=_.createContext({isTransitioning:!1});Ue.displayName="ViewTransition";var tr=_.createContext(new Map);tr.displayName="Fetchers";var ha=_.createContext(null);ha.displayName="Await";var N=_.createContext(null);N.displayName="Navigation";var X=_.createContext(null);X.displayName="Location";var I=_.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName="Route";var je=_.createContext(null);je.displayName="RouteError";var Ne=!0,rr="REACT_ROUTER_ERROR",ma="REDIRECT",pa="ROUTE_ERROR_RESPONSE";function ya(e){if(e.startsWith(`${rr}:${ma}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ga(e){if(e.startsWith(`${rr}:${pa}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Gt(t.status,t.statusText,t.data)}catch{}}function be(e,{relative:t}={}){L(Q(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(N),{hash:n,pathname:o,search:i}=ae(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:H([r,o])),a.createHref({pathname:l,search:i,hash:n})}function Q(){return g.useContext(X)!=null}function T(){return L(Q(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(X).location}function va(){return g.useContext(X).navigationType}var ar="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nr(e){g.useContext(N).static||g.useLayoutEffect(e)}function q(){let{isDataRoute:e}=g.useContext(I);return e?ka():Ra()}function Ra(){L(Q(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(G),{basename:t,navigator:r}=g.useContext(N),{matches:a}=g.useContext(I),{pathname:n}=T(),o=JSON.stringify($e(a)),i=g.useRef(!1);return nr(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(O(i.current,ar),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=Se(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:H([t,c.pathname])),He(typeof s=="string"?s:W(s),r.createHref(c),Ie(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var _n=g.createContext(null);function wa(){let{matches:e}=g.useContext(I);return e[e.length-1]?.params??{}}function ae(e,{relative:t}={}){let{matches:r}=g.useContext(I),{pathname:a}=T(),n=JSON.stringify($e(r));return g.useMemo(()=>Se(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function or(e,t){return ir(e,t)}function ir(e,t,r){L(Q(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(N),{matches:n}=g.useContext(I),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Ne){let f=u&&u.path||"";cr(l,!u||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
2
|
|
|
3
3
|
Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let c=T(),d;if(t){let f=typeof t=="string"?V(t):t;L(s==="/"||f.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${f.pathname}" was given in the \`location\` prop.`),d=f}else d=c;let m=d.pathname||"/",h=m;if(s!=="/"){let f=s.replace(/^\//,"").split("/");h="/"+m.replace(/^\//,"").split("/").slice(f.length).join("/")}let y=r&&r.state.matches.length?r.state.matches.map(f=>Object.assign(f,{route:r.manifest[f.route.id]||f.route})):_e(e,{pathname:h});Ne&&(O(u||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let p=Pa(y&&y.map(f=>Object.assign({},f,{params:Object.assign({},i,f.params),pathname:H([s,a.encodeLocation?a.encodeLocation(f.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?s:H([s,a.encodeLocation?a.encodeLocation(f.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),n,r);return t&&p?g.createElement(X.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},p):p}function Sa(){let e=ur(),t=Xt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return Ne&&(console.error("Error handled by React Router default ErrorBoundary:",e),i=g.createElement(g.Fragment,null,g.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route."))),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:n},r):null,i)}var ba=g.createElement(Sa,null),lr=class extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=ga(e.digest);r&&(e=r)}let t=e!==void 0?g.createElement(I.Provider,{value:this.props.routeContext},g.createElement(je.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(Ea,{error:e},t):t}};lr.contextType=er;var Fe=new WeakMap;function Ea({children:e,error:t}){let{basename:r,navigator:a}=g.useContext(N);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=ya(t.digest);if(n){let o=Fe.get(t);if(o)throw o;let i=qt(n.location,r),l=i.absoluteURL||i.to;if(He(n.location,l,Ie(a),"allow-explicit"),da(l))throw new Error("Invalid redirect location");if(Qt&&!Fe.get(t))if(i.isExternal||n.reloadDocument)window.location.href=l;else{let s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw Fe.set(t,s),s}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function xa({routeContext:e,match:t,children:r}){let a=g.useContext(G);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(I.Provider,{value:e},r)}function Pa(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a?.errors;if(o!=null){let c=n.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);L(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,c+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let c=0;c<n.length;c++){let d=n[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:m,errors:h}=a,y=d.route.loader&&!m.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||y){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r?.onError,u=a&&s?(c,d)=>{s(c,{location:a.location,params:a.matches?.[0]?.params??{},pattern:aa(a.matches),errorInfo:d})}:void 0;return n.reduceRight((c,d,m)=>{let h,y=!1,p=null,f=null;a&&(h=o&&d.route.id?o[d.route.id]:void 0,p=d.route.errorElement||ba,i&&(l<0&&m===0?(cr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,f=null):l===m&&(y=!0,f=d.route.hydrateFallbackElement||null)));let R=t.concat(n.slice(0,m+1)),w=()=>{let b;return h?b=p:y?b=f:d.route.Component?b=g.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=c,g.createElement(xa,{match:d,routeContext:{outlet:c,matches:R,isDataRoute:a!=null},children:b})};return a&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?g.createElement(lr,{location:a.location,revalidation:a.revalidation,component:p,error:h,children:w(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:u}):w()},null)}function ze(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ca(e){let t=g.useContext(G);return L(t,ze(e)),t}function Be(e){let t=g.useContext(re);return L(t,ze(e)),t}function La(e){let t=g.useContext(I);return L(t,ze(e)),t}function We(e){let t=La(e),r=t.matches[t.matches.length-1];return L(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Da(){return We("useRouteId")}function sr(){let e=Be("useNavigation");return g.useMemo(()=>{let{matches:t,historyAction:r,...a}=e.navigation;return a},[e.navigation])}function Ye(){let{matches:e,loaderData:t}=Be("useMatches");return g.useMemo(()=>e.map(r=>Ur(r,t)),[e,t])}function ur(){let e=g.useContext(je),t=Be("useRouteError"),r=We("useRouteError");return e!==void 0?e:t.errors?.[r]}function ka(){let{router:e}=Ca("useNavigate"),t=We("useNavigate"),r=g.useRef(!1);return nr(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{O(r.current,ar),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var $t={};function cr(e,t,r){!t&&!$t[e]&&($t[e]=!0,O(!1,r))}var Fa="useOptimistic",$n=x[Fa];var In=x.memo(Ta);function Ta({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return ir(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function Na({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=x.useRef();o.current==null&&(o.current=jt({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=x.useState({action:i.action,location:i.location}),u=x.useCallback(c=>{n===!1?s(c):x.startTransition(()=>s(c))},[n]);return x.useLayoutEffect(()=>i.listen(u),[i,u]),x.createElement(Ee,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function Ma({to:e,replace:t,state:r,relative:a}){L(Q(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=x.useContext(N);O(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=x.useContext(I),{pathname:l}=T(),s=q(),u=Se(e,$e(i),l,a==="path");He(typeof e=="string"?e:W(e),o.createHref(u),Ie(o),"reject");let c=JSON.stringify(u);return x.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function dr(e){L(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ee({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){L(!Q(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=x.useMemo(()=>({basename:l,navigator:n,static:o,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=V(r));let{pathname:u="/",search:c="",hash:d="",state:m=null,key:h="default",mask:y}=r,p=x.useMemo(()=>{let f=U(u,l);return f==null?null:{location:{pathname:f,search:c,hash:d,state:m,key:h,mask:y},navigationType:a}},[l,u,c,d,m,h,a,y]);return O(p!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),p==null?null:x.createElement(N.Provider,{value:s},x.createElement(X.Provider,{children:t,value:p}))}function Oa({children:e,location:t}){return or(Re(e),t)}function Re(e,t=[]){let r=[];return x.Children.forEach(e,(a,n)=>{if(!x.isValidElement(a))return;let o=[...t,n];if(a.type===x.Fragment){r.push.apply(r,Re(a.props.children,o));return}L(a.type===dr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),L(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=Re(a.props.children,o)),r.push(i)}),r}var pe="get",ye="application/x-www-form-urlencoded";function xe(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Aa(e){return xe(e)&&e.tagName.toLowerCase()==="button"}function _a(e){return xe(e)&&e.tagName.toLowerCase()==="form"}function $a(e){return xe(e)&&e.tagName.toLowerCase()==="input"}function Ia(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ha(e,t){return e.button===0&&(!t||t==="_self")&&!Ia(e)}function we(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Ua(e,t){let r=we(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var he=null;function ja(){if(he===null)try{new FormData(document.createElement("form"),0),he=!1}catch{he=!0}return he}var za=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Te(e){return e!=null&&!za.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ye}"`),null):e}function Ba(e,t){let r,a,n,o,i;if(_a(e)){let l=e.getAttribute("action");a=l?U(l,t):null,r=e.getAttribute("method")||pe,n=Te(e.getAttribute("enctype"))||ye,o=new FormData(e)}else if(Aa(e)||$a(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?U(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||pe,n=Te(e.getAttribute("formenctype"))||Te(l.getAttribute("enctype"))||ye,o=new FormData(l,e),!ja()){let{name:u,type:c,value:d}=e;if(c==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,d)}}else{if(xe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=pe,a=null,n=ye,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var Hn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Wa={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Ya=/[&><\u2028\u2029]/g;function It(e){return e.replace(Ya,t=>Wa[t])}function Je(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Va=Symbol("SingleFetchRedirect");function fr(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&U(n.pathname,t)==="/"?n.pathname=`${te(t)}/_root.${a}`:n.pathname=`${te(n.pathname)}.${a}`,n}async function Ja(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function Ka(e){return e!=null&&typeof e.page=="string"}function Ga(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Xa(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await Ja(o,r);return i.links?i.links():[]}return[]}));return en(a.flat(1).filter(Ga).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Ht(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>r[u].pathname!==s.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let c=a.routes[s.route.id];if(!c||!c.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function Qa(e,t,{includeHydrateFallback:r}={}){return qa(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function qa(e){return[...new Set(e)]}function Za(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function en(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Ka(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(Za(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function Ke(){let e=S.useContext(G);return Je(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function nn(){let e=S.useContext(re);return Je(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var le=S.createContext(void 0);le.displayName="FrameworkContext";function Pe(){let e=S.useContext(le);return Je(e,"You must render this element inside a <HydratedRouter> element"),e}function on(e,t){let r=S.useContext(le),[a,n]=S.useState(!1),[o,i]=S.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,m=S.useRef(null);S.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let p=R=>{R.forEach(w=>{i(w.isIntersecting)})},f=new IntersectionObserver(p,{threshold:.5});return m.current&&f.observe(m.current),()=>{f.disconnect()}}},[e]),S.useEffect(()=>{if(a){let p=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(p)}}},[a]);let h=()=>{n(!0)},y=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:oe(l,h),onBlur:oe(s,y),onMouseEnter:oe(u,h),onMouseLeave:oe(c,y),onTouchStart:oe(d,h)}]:[!1,m,{}]}function oe(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function mr({page:e,...t}){let r=fa(),{nonce:a}=Pe(),{router:n}=Ke(),o=S.useMemo(()=>_e(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?S.createElement(sn,{page:e,matches:o,...t}):S.createElement(un,{page:e,matches:o,...t})):null}function ln(e){let{manifest:t,routeModules:r}=Pe(),[a,n]=S.useState([]);return S.useEffect(()=>{let o=!1;return Xa(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function sn({page:e,matches:t,...r}){let a=T(),{future:n}=Pe(),{basename:o}=Ke(),i=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=fr(e,o,n.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let c of t)typeof c.route.shouldRevalidate=="function"?s=!0:u.push(c.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,n.v8_trailingSlashAwareDataRequests,e,a,t]);return S.createElement(S.Fragment,null,i.map(l=>S.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function un({page:e,matches:t,...r}){let a=T(),{future:n,manifest:o,routeModules:i}=Pe(),{basename:l}=Ke(),{loaderData:s,matches:u}=nn(),c=S.useMemo(()=>Ht(e,t,u,o,a,"data"),[e,t,u,o,a]),d=S.useMemo(()=>Ht(e,t,u,o,a,"assets"),[e,t,u,o,a]),m=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let p=new Set,f=!1;if(t.forEach(w=>{let b=o.routes[w.route.id];!b||!b.hasLoader||(!c.some(P=>P.route.id===w.route.id)&&w.route.id in s&&i[w.route.id]?.shouldRevalidate||b.hasClientLoader?f=!0:p.add(w.route.id))}),p.size===0)return[];let R=fr(e,l,n.v8_trailingSlashAwareDataRequests,"data");return f&&p.size>0&&R.searchParams.set("_routes",t.filter(w=>p.has(w.route.id)).map(w=>w.route.id).join(",")),[R.pathname+R.search]},[l,n.v8_trailingSlashAwareDataRequests,s,a,o,c,t,e,i]),h=S.useMemo(()=>Qa(d,o),[d,o]),y=ln(d);return S.createElement(S.Fragment,null,m.map(p=>S.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...r})),h.map(p=>S.createElement("link",{key:p,rel:"modulepreload",href:p,...r})),y.map(({key:p,link:f})=>S.createElement("link",{key:p,nonce:r.nonce,...f,crossOrigin:f.crossOrigin??r.crossOrigin})))}function cn(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var dn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{dn&&(window.__reactRouterVersion="7.18.3")}catch{}function fn({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=zt({window:a,v5Compat:!0}));let o=n.current,[i,l]=v.useState({action:o.action,location:o.location}),s=v.useCallback(u=>{r===!1?l(u):v.startTransition(()=>l(u))},[r]);return v.useLayoutEffect(()=>o.listen(s),[o,s]),v.createElement(Ee,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:r})}function pr({basename:e,children:t,history:r,useTransitions:a}){let[n,o]=v.useState({action:r.action,location:r.location}),i=v.useCallback(l=>{a===!1?o(l):v.startTransition(()=>o(l))},[a]);return v.useLayoutEffect(()=>r.listen(i),[r,i]),v.createElement(Ee,{basename:e,children:t,location:n.location,navigationType:n.action,navigator:r,useTransitions:a})}pr.displayName="unstable_HistoryRouter";var se=v.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:s,target:u,to:c,preventScrollReset:d,viewTransition:m,defaultShouldRevalidate:h,...y},p){let{basename:f,navigator:R,useTransitions:w}=v.useContext(N),b=typeof c=="string"&&Ae.test(c),P=qt(c,f);c=P.to;let E=be(c,{relative:n}),F=T(),k=null;if(l){let Y=Se(l,[],F.mask?F.mask.pathname:"/",!0);f!=="/"&&(Y.pathname=Y.pathname==="/"?f:H([f,Y.pathname])),k=R.createHref(Y)}let[$,K,B]=on(a,y),ue=wr(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:m,defaultShouldRevalidate:h,useTransitions:w});function Z(Y){t&&t(Y),Y.defaultPrevented||ue(Y)}let ce=!(P.isExternal||o),rt=v.createElement("a",{...y,...B,href:(ce?k:void 0)||P.absoluteURL||E,onClick:ce?Z:t,ref:cn(p,K),target:u,"data-discover":!b&&r==="render"?"true":void 0});return $&&!b?v.createElement(v.Fragment,null,rt,v.createElement(mr,{page:E})):rt});se.displayName="Link";var yr=v.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},c){let d=ae(i,{relative:u.relative}),m=T(),h=v.useContext(re),{navigator:y,basename:p}=v.useContext(N),f=h!=null&&xr(d)&&l===!0,R=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,w=m.pathname,b=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(w=w.toLowerCase(),b=b?b.toLowerCase():null,R=R.toLowerCase()),b&&p&&(b=U(b,p)||b);let P=R!=="/"&&R.endsWith("/")?R.length-1:R.length,E=w===R||!n&&w.startsWith(R)&&w.charAt(P)==="/",F=b!=null&&(b===R||!n&&b.startsWith(R)&&b.charAt(R.length)==="/"),k={isActive:E,isPending:F,isTransitioning:f},$=E?t:void 0,K;typeof a=="function"?K=a(k):K=[a,E?"active":null,F?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(k):o;return v.createElement(se,{...u,"aria-current":$,className:K,ref:c,style:B,to:i,viewTransition:l},typeof s=="function"?s(k):s)});yr.displayName="NavLink";var gr=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=pe,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:m,...h},y)=>{let{useTransitions:p}=v.useContext(N),f=Sr(),R=br(l,{relative:u}),w=i.toLowerCase()==="get"?"get":"post",b=typeof l=="string"&&Ae.test(l);return v.createElement("form",{ref:y,method:w,action:R,onSubmit:a?s:E=>{if(s&&s(E),E.defaultPrevented)return;E.preventDefault();let F=E.nativeEvent.submitter,k=F?.getAttribute("formmethod")||i,$=()=>f(F||E.currentTarget,{fetcherKey:t,method:k,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:m});p&&r!==!1?v.startTransition(()=>$()):$()},...h,"data-discover":!b&&e==="render"?"true":void 0})});gr.displayName="Form";function vr({getKey:e,storageKey:t,...r}){let a=v.useContext(le),{basename:n}=v.useContext(N),o=T(),i=Ye();Er({getKey:e,storageKey:t});let l=v.useMemo(()=>{if(!a||!e)return null;let u=Oe(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let s=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&a?.nonce&&(r.nonce=a.nonce),v.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${It(JSON.stringify(t||Me))}, ${It(JSON.stringify(l))})`}})}vr.displayName="ScrollRestoration";function Rr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ge(e){let t=v.useContext(G);return L(t,Rr(e)),t}function hn(e){let t=v.useContext(re);return L(t,Rr(e)),t}function wr(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=q(),d=T(),m=ae(e,{relative:i});return v.useCallback(h=>{if(Ha(h,t)){h.preventDefault();let y=r!==void 0?r:W(d)===W(m),p=()=>c(e,{replace:y,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?v.startTransition(()=>p()):p()}},[d,c,m,r,a,n,t,e,o,i,l,s,u])}function Xe(e){O(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(we(e)),r=v.useRef(!1),a=T(),n=v.useMemo(()=>Ua(a.search,r.current?null:t.current),[a.search]),o=q(),i=v.useCallback((l,s)=>{let u=we(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var mn=0,pn=()=>`__${String(++mn)}__`;function Sr(){let{router:e}=Ge("useSubmit"),{basename:t}=v.useContext(N),r=Da(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=Ba(o,t);if(i.navigate===!1){let m=i.fetcherKey||pn();await a(m,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await n(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function br(e,{relative:t}={}){let{basename:r}=v.useContext(N),a=v.useContext(I);L(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...ae(e||".",{relative:t})},i=T();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(c=>c==="")){l.delete("index"),s.filter(d=>d).forEach(d=>l.append("index",d));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:H([r,o.pathname])),W(o)}var Me="react-router-scroll-positions",me={};function Oe(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:U(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function Er({getKey:e,storageKey:t}={}){let{router:r}=Ge("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=hn("useScrollRestoration"),{basename:o}=v.useContext(N),i=T(),l=Ye(),s=sr();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),yn(v.useCallback(()=>{if(s.state==="idle"){let u=Oe(i,l,o,e);me[u]=window.scrollY}try{sessionStorage.setItem(t||Me,JSON.stringify(me))}catch(u){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||Me);u&&(me=JSON.parse(u))}catch{}},[t]),v.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(me,()=>window.scrollY,e?(c,d)=>Oe(c,d,o,e):void 0);return()=>u&&u()},[r,o,e]),v.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{O(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function yn(e,t){let{capture:r}=t||{};v.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function xr(e,{relative:t}={}){let r=v.useContext(Ue);L(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ge("useViewTransitionState"),n=ae(e,{relative:t});if(!r.isTransitioning)return!1;let o=U(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=U(r.nextLocation.pathname,a)||r.nextLocation.pathname;return ie(n.pathname,i)!=null||ie(n.pathname,o)!=null}var Qe=D(M(),1),Cr=D(Nr(),1);var j=D(ee(),1);function Lr({context:e,own:t}){ne(e.store);let r=ht(),a=ft()?.live??e.store;ne(a);let n=vt();if(!r||a.batches().length===0&&n===0)return null;let o=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Qe.Suspense,{fallback:null,children:(0,j.jsx)(Ct,{})}),(0,j.jsx)(Qe.Suspense,{fallback:null,children:(0,j.jsx)(Lt,{})})]});return t?(0,Cr.createPortal)(o,t):(0,j.jsx)("div",{className:"graview-bar-own",children:o})}var A=D(M(),1);var J=D(M(),1),gn=(0,J.createContext)(null);function ni(){let e=new Map,t=new Set,r=()=>{for(let a of t)a()};return{count:a=>e.get(a)??0,place(a){return e.set(a,(e.get(a)??0)+1),r(),()=>{e.set(a,(e.get(a)??1)-1),r()}},subscribe(a){return t.add(a),()=>t.delete(a)}}}function Dr(e){let t=(0,J.useContext)(gn);(0,J.useLayoutEffect)(()=>t?.place(e),[t,e])}function oi(e,t){return(0,J.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var kr=D(M(),1),z=D(ee(),1),qe="var(--graview-text-small)",Ze="var(--graview-text-body)",fi="var(--graview-font-display, var(--graview-font-body, system-ui))",et={maxWidth:760,margin:"0 auto",padding:"40px var(--graview-page-gutter, 20px) max(96px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},tt=1160,hi={...et,maxWidth:tt},Fr={margin:0,fontSize:"var(--graview-text-title)",lineHeight:1.2,letterSpacing:"-0.012em",overflowWrap:"anywhere",textWrap:"balance"},mi={margin:0,fontSize:"var(--graview-text-heading)",lineHeight:1.3,textWrap:"balance"},pi={margin:0,fontSize:qe,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},yi={margin:0,fontSize:Ze,color:"var(--graview-ink-muted)",maxWidth:"60ch"},Tr={color:"var(--graview-ink-muted)",fontSize:qe},gi={borderTop:"1px solid var(--graview-edge)",paddingTop:24},vn={color:"var(--graview-accent)",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em",display:"inline-flex",alignItems:"center",columnGap:"0.3em",minHeight:24},vi={...vn,textDecoration:"none"},Ri={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},wi=`.graview-list{container-type:inline-size}
|
|
4
4
|
.graview-rows{display:grid;grid-template-columns:minmax(0,1fr);column-gap:1.5rem;margin:0;padding:0;list-style:none;border-top:1px solid var(--graview-edge)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as n}from"./chunk.GNBN3BK7.js";import"./chunk.XTMOFRHL.js";import"./chunk.NLBIX7LH.js";import"./chunk.GACKGEUY.js";import"./chunk.2GLJH253.js";import"./chunk.GUMJEVVP.js";import"./chunk.4VW6THJF.js";import"./chunk.SAHNXAV3.js";import"./chunk.DHAK6PPX.js";import"./chunk.DUWYF7BO.js";import"./chunk.UGJSMNVO.js";import"./chunk.NR5ODXMO.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.TPG6IY4M.js";import"./chunk.NFDLCUCC.js";import"./chunk.X7JMJSLU.js";import"./chunk.PPRSGM64.js";import"./chunk.5Y3Q7ONN.js";import"./chunk.KTFUVR4V.js";import"./chunk.GZHZLJBF.js";import"./chunk.RQBEQYB2.js";import"./chunk.OJGHDWI6.js";import"./chunk.6VAFNCR4.js";import"./chunk.N4M54YK6.js";import"./chunk.KVJFY7N5.js";import"./chunk.DPHTUTOS.js";import"./chunk.2UIUMG23.js";import{R as m}from"./chunk.KA44WNB4.js";import"./chunk.SDO3U72B.js";import"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as G,b as J}from"./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 G,b as J}from"./chunk.DAUC2DFY.js";import"./chunk.GTPC6JOW.js";import{a as K}from"./chunk.BDHKWVNX.js";import"./chunk.ZH4NWRWB.js";import"./chunk.SAHNXAV3.js";import"./chunk.NQZ73QV7.js";import"./chunk.O45VO36H.js";import"./chunk.UT6642FC.js";import"./chunk.SUPWMV2F.js";import{a as S,b as W}from"./chunk.MB7LKKUD.js";import"./chunk.TPG6IY4M.js";import"./chunk.NFDLCUCC.js";import"./chunk.X7JMJSLU.js";import"./chunk.PPRSGM64.js";import"./chunk.5Y3Q7ONN.js";import"./chunk.KTFUVR4V.js";import"./chunk.N4M54YK6.js";import"./chunk.KVJFY7N5.js";import"./chunk.DPHTUTOS.js";import"./chunk.2UIUMG23.js";import{$ as F,D as H,Da as _,E as V,G as ee,Pa as x,R as D}from"./chunk.KA44WNB4.js";import{a as j}from"./chunk.SDO3U72B.js";import{ga as q,xc as B}from"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import{b}from"./chunk.AJZBJBMO.js";var t=b(ee(),1);var a=b(D(),1);function ae(n){let r=[];return n.applied.length>0&&n.intent&&r.push(`${n.intent}.`),n.unchanged.length>0&&r.push(`${n.unchanged.length} already so.`),n.allOrNothing&&r.push("None of it was kept."),r.join(" ")}var re=_(j(()=>(__graviewPreload(import.meta.url,["./chunk.OAIWGWGU.js","./chunk.O45VO36H.js","./chunk.UT6642FC.js","./chunk.NX7IIZLO.js","./chunk.XOZU4OFA.js","./chunk.SUPWMV2F.js","./chunk.LPD74WBI.js","./chunk.TI4OSTQV.js","./chunk.NFDLCUCC.js","./chunk.N4M54YK6.js","./chunk.KVJFY7N5.js","./chunk.DPHTUTOS.js","./chunk.2UIUMG23.js","./chunk.KA44WNB4.js","./chunk.SDO3U72B.js","./chunk.4TJOS4C7.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.HDE2MGGU.js")))),te=re.part((n,r)=>(0,a.jsx)(n.SeveralAi,{...r}),{quiet:!0});function ne(n){let r=F()?.ai;return!H(r)||!V(r)?null:(0,a.jsx)(t.Suspense,{fallback:null,children:(0,a.jsx)(te,{...n})})}function me({store:n,chosen:r,principal:d,context:v,via:k,anchor:A,of:g,onChooseAll:E,onClear:m,onActed:Q}){let[U,X]=(0,t.useState)(0);(0,t.useEffect)(()=>n.subscribe(()=>X(e=>e+1)),[n]);let f=r.join(`
|
|
2
2
|
`),{acts:c,withheld:N}=(0,t.useMemo)(()=>G(n,r,{...d?{principal:d}:{},...v?{context:v}:{}}),[n,f,d,v,U]),[O,p]=(0,t.useState)(!1),[l,u]=(0,t.useState)(null),[s,P]=(0,t.useState)(null),h=(0,t.useRef)(null),L=(0,t.useId)(),w=(0,t.useMemo)(()=>[...new Set(r.map(e=>n.graph.getNode(e)?.kind))],[n,f]),Y=w.length===1&&w[0]?`${q(n.schema,w[0],r.length)} chosen`:`${r.length} chosen`,M=typeof matchMedia=="function"&&matchMedia("(pointer: coarse), (max-width: 599px)").matches?2:3,C=c.filter(e=>!e.more),Z=C.slice(0,M),R=[...C.slice(M),...c.filter(e=>e.more)];(0,t.useEffect)(()=>{u(null),p(!1)},[f]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!x(e))try{e.showPopover()}catch{}let i=()=>{W(e,A?.()??null),dispatchEvent(new Event(S))};i(),addEventListener("resize",i),addEventListener("scroll",i,!0);let o=typeof ResizeObserver=="function"?new ResizeObserver(i):null;return o?.observe(e),()=>{if(o?.disconnect(),removeEventListener("resize",i),removeEventListener("scroll",i,!0),e.isConnected&&x(e))try{e.hidePopover()}catch{}dispatchEvent(new Event(S))}},[A]);let y=(0,t.useRef)({asking:l,onClear:m});y.current={asking:l,onClear:m},(0,t.useEffect)(()=>{let e=i=>{if(i.key!=="Escape"||i.defaultPrevented)return;let o=document.activeElement;if(!(!(h.current?.contains(o)??!1)&&(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement&&o.type!=="checkbox"||o instanceof HTMLSelectElement))){if(i.preventDefault(),i.stopPropagation(),y.current.asking){u(null);return}y.current.onClear()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let T=(e,i={})=>{let o=J(n,{mutation:e.mutation,subject:e.subject,args:{...e.args,...i},label:e.label},r,{...d?{author:d}:{},...k?{via:k}:{},...v?{context:v}:{}});u(null),p(!1),P(o.refused.length>0||o.applied.length===0?o:null),Q(o.refused.map(I=>I.id))},$=e=>{P(null),p(!1),e.open.length>0?u(e):T(e)},z=e=>(0,a.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-act","data-act":e.id,"data-mutation":e.mutation,...e.destructive?{"data-tone":"warn"}:{},"aria-pressed":l?.id===e.id?!0:void 0,onClick:()=>$(e),children:[e.label,e.open.length>0?"\u2026":""]},e.id);return(0,a.jsxs)("div",{ref:h,popover:"manual",role:"region","aria-label":"The chosen records",className:"graview-several-bar","data-testid":"several-bar","data-graview-foot":"","data-graview-overlay":"","data-graview-popover":"","data-graview-offstage":"",style:ie,children:[(0,a.jsx)("style",{children:oe}),(0,a.jsxs)("div",{className:"graview-several-line",children:[(0,a.jsx)("span",{role:"status","aria-live":"polite",className:"graview-several-count","data-testid":"several-count",children:Y}),(0,a.jsxs)("div",{role:"group","aria-label":`What to do with the ${r.length} chosen`,className:"graview-several-acts",children:[Z.map(z),R.length>0?(0,a.jsx)("button",{type:"button",className:"graview-several-act","data-testid":"several-more","aria-expanded":O,"aria-controls":L,onClick:()=>p(e=>!e),children:"More"}):null,E&&g!==void 0&&g>r.length?(0,a.jsxs)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-all",onClick:E,children:["Choose all ",g]}):null,(0,a.jsx)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-clear","aria-keyshortcuts":"Escape",title:"Put the choice down \u2014 Escape",onClick:m,children:"Clear"})]})]}),c.length>0&&r.length>1?(0,a.jsx)(ne,{chosen:r,acts:c,onAct:$}):null,O?(0,a.jsx)("div",{id:L,role:"group","aria-label":"More",className:"graview-several-acts","data-testid":"several-more-acts",children:R.map(z)}):null,c.length===0?(0,a.jsx)("p",{className:"graview-several-said","data-testid":"several-none",children:N.length>0?`Nothing here can be done to all of them by you: ${N[0].message}`:"Nothing can be done to all of these at once."}):null,l?(0,a.jsx)("div",{className:"graview-several-ask",role:"group","aria-label":`${l.label}, for all ${r.length}`,"data-testid":"several-ask",children:(0,a.jsx)(K,{store:n,affordance:l.affordance,onApply:e=>T(l,e),onCancel:()=>u(null)})}):null,s?(0,a.jsxs)("div",{role:"alert",className:"graview-several-said","data-testid":"several-outcome",children:[ae(s),s.refused.length>0?(0,a.jsxs)(a.Fragment,{children:[" ",s.refused.length===1?"One was not changed, and is still chosen:":`${s.refused.length} were not changed, and are still chosen:`,(0,a.jsx)("ul",{"data-testid":"several-refused",children:s.refused.map(e=>(0,a.jsxs)("li",{"data-record":e.id,children:["\u201C",e.label,"\u201D \u2014 ",e.message]},e.id))})]}):null]}):null]})}var ie={position:"fixed",inset:"auto",margin:0,zIndex:B("toast"),boxSizing:"border-box",width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,overflow:"visible"},oe=`
|
|
3
3
|
.graview-several-bar{display:grid;gap:8px;padding:8px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-float);color:var(--graview-ink);box-shadow:var(--graview-lift-high);font-size:.875rem;line-height:1.4;max-height:70vh;overflow:auto}
|
|
4
4
|
.graview-several-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;min-width:0}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as z,b as Y,d as ee}from"./chunk.
|
|
1
|
+
import{a as z,b as Y,d as ee}from"./chunk.QQTRAY5W.js";import"./chunk.DOBQ4LO4.js";import{Sb as J,da as Q,ha as U,ma as X,qa as _}from"./chunk.4TJOS4C7.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";function ce(t){let r=t?.indexOf(":")??-1;if(!(!t||r<=0||r===t.length-1))return{relation:t.slice(0,r),record:t.slice(r+1)}}function ne(t,r){if(t.length===0)return!0;let d=`${r.split("/")[0]}/*`;return t.some(a=>a==="*"||a==="*/*"||a===r||a===d)}function re(t,r){let d=r.startsWith("image/")?"image":r.startsWith("video/")?"video":"file";return t.find(a=>a.as===d)??t.find(a=>a.as==="file")}function fe(t,r){let d=new Set(t.map(k=>k.as==="image"?"image/":k.as==="video"?"video/":""));if(d.has("")||r.kinds.length===0)return r.kinds.join(",");let a=[];for(let k of d){let m=r.kinds.filter(l=>l.startsWith(k));a.push(...m.length>0?m:[`${k}*`])}return a.join(",")}var T=t=>t.input?.shape??{},ie=(t,r)=>T(t)[r]?.safeParse(void 0).success===!1;function ae(t,r){let d=new Set(z(t.input).map(a=>a.name));return Object.keys(T(t)).filter(a=>!r.has(a)&&!d.has(a)&&ie(t,a)&&T(t)[a].safeParse("a name").success&&!T(t)[a].safeParse(1).success)}var ue=t=>t.replace(/\.[a-z0-9]{1,5}$/i,"")||t,se=(t,r)=>{let d=Number.isFinite(Date.parse(r))?new Date(Date.parse(r)).toISOString():r;return[r,d,d.replace(/\.\d{3}Z$/,"Z"),r.slice(0,10)].find(a=>t.safeParse(a).success)},pe="2026-01-01T00:00:00.000Z";function te(t,r){let d=T(t),a=new Set(ae(t,r)),k=Object.keys(d).filter(l=>!r.has(l)&&!a.has(l)&&ie(t,l)),m=k.filter(l=>se(d[l],pe)!==void 0);return{timed:m,left:k.filter(l=>!m.includes(l))}}function oe(t,r,d,a,k){let m=e=>({ok:!1,says:e}),{kind:l}=a,R=(d.accepts??[]).filter(e=>e.kind===l&&(a.field===void 0||e.field===a.field));if(R.length===0)return m(a.field===void 0?`The view's accepts names no field of "${l}", so nothing dropped there can become one.`:`The view's accepts does not name ${l}'s "${a.field}".`);let A=k.files;if(!A||!(A.maxBytes>0))return m("This host takes no files.");let j=R.flatMap(e=>{let n=ee(t,e.kind,e.field);return n?[{field:e.field,...n}]:[]}),w=j.filter(e=>e.as==="file"||A.kinds.length===0||A.kinds.some(n=>n==="*"||n==="*/*"||n.startsWith(e.as==="image"?"image/":"video/")));if(w.length===0)return m(`This host takes none of what ${l}'s ${j.map(e=>`"${e.field}"`).join(" or ")} holds.`);let c=a.connect===void 0?void 0:ce(a.connect);if(a.connect!==void 0&&(!c||k.shown.has(a.connect)))return m(`data-drop-connect is "<relation>:<record id>", not "${a.connect}".`);if(c&&!k.shown.has(c.record))return m(`data-drop-connect names "${c.record}", which this view was not shown.`);let g=c?t.seenBy(r).graph.getNode(c.record):void 0;if(c&&!g)return m(`data-drop-connect names "${c.record}", which this seat does not see.`);let $=e=>Object.hasOwn(t.schema.tryDefinition(e)?.edges??{},c.relation),E=c?$(l):!1;if(c&&!E&&!$(g.kind))return m(`Neither a "${l}" nor a "${g.kind}" has the relation "${c.relation}".`);let H=t.allMutations(),F=e=>t.permits(e,r).ok,Z=e=>w.every(n=>Object.hasOwn(T(e),n.field)),V=H.filter(e=>(e.creates??[]).includes(l)&&Z(e)),x=X(t.schema.tryDefinition(l),l),O=U(t.schema,l).toLowerCase(),S=g?Q(t.schema.tryDefinition(g.kind),g):void 0,G=e=>`${e===1?`a ${x}`:`${e} ${O}`}${S?` to ${S}`:""}`,K=e=>`Add ${G(e)}`,L=e=>`Added ${G(e)}.`,B=`Drop to add ${O}${S?` to ${S}`:""}.`,N=(e,n,u,v)=>{let I=new Set(Object.keys(n)),D=_(u.at)??v??new Date().toISOString();for(let C of te(e,I).timed)n[C]=se(T(e)[C],D);for(let C of ae(e,I))n[C]=ue(u.name);return n},q=(e,...n)=>new Set([...w.map(u=>u.field),...n,...z(e.input).map(u=>u.name)]),P=(e,...n)=>te(e,q(e,...n)).left,i=(e,n)=>m(`"${e.title??e.name}" asks for ${n.map(u=>`"${u}"`).join(" and ")}, which no dropped file says, so nothing dropped here can become a ${x}.`),o=(e,n)=>e.list?[n]:n,f={ok:!0,kind:l,fields:w,accept:fe(w,A),...c?{connect:c}:{},intent:K,invite:B,added:L};if(!c){let e=V.find(n=>!n.subject&&F({name:n.name,args:{}}));return e?P(e).length>0?i(e,P(e)):{...f,calls:n=>[{name:e.name,args:N(e,{[n.field]:o(w.find(u=>u.field===n.field),n.value)},n.value,n.at)}]}:m(`This seat may not make a "${l}" here.`)}let s=V.find(e=>e.subject&&(e.subject.kinds==="*"||e.subject.kinds.includes(g.kind))&&(e.connects??[]).includes(c.relation)&&F({name:e.name,args:{[e.subject.arg]:c.record}}));if(s){let e=s.subject.arg;return P(s,e).length>0?i(s,P(s,e)):{...f,calls:n=>[{name:s.name,args:N(s,{[e]:c.record,[n.field]:o(w.find(u=>u.field===n.field),n.value)},n.value,n.at)}]}}let p=V.find(e=>!e.subject&&F({name:e.name,args:{}}));if(!p)return m(`This seat may not make a "${l}" here.`);if(P(p).length>0)return i(p,P(p));let y=E?l:g.kind,W=E?g.kind:l,M=H.find(e=>{if(!(e.connects??[]).includes(c.relation)||!e.subject)return!1;let n=e.subject.kinds;if(n!=="*"&&!n.includes(y))return!1;let u=z(e.input).find(v=>v.name!==e.subject.arg&&(v.kinds.includes("*")||v.kinds.includes(W)));return u?F({name:e.name,args:E?{[u.name]:c.record}:{[e.subject.arg]:c.record}}):!1});if(!M)return m(`This seat may not link a "${l}" to ${c.record} by "${c.relation}".`);let h=M.subject.arg,b=z(M.input).find(e=>e.name!==h&&(e.kinds.includes("*")||e.kinds.includes(W))).name;return{...f,calls:(e,n)=>[{name:p.name,args:N(p,{[e.field]:o(w.find(u=>u.field===e.field),e.value)},e.value,e.at)},{name:M.name,args:E?{[h]:J(n*2),[b]:c.record}:{[h]:c.record,[b]:J(n*2)}}]}}var de=t=>t.type.startsWith("image/"),me=t=>t.type.startsWith("video/"),ge=`
|
|
2
2
|
[data-graview-drop-over] { outline: 2px dashed var(--graview-accent, Highlight) !important; outline-offset: 2px !important; background-color: color-mix(in srgb, var(--graview-accent, Highlight) 10%, transparent) !important; }
|
|
3
3
|
[data-graview-drop-status], [data-graview-drop-refused] { margin: 4px 0 0; font: 0.8125rem/1.4 var(--graview-font-body, system-ui, sans-serif); color: var(--graview-ink-muted, GrayText); }
|
|
4
4
|
[data-graview-drop-refused] { color: var(--graview-warn, var(--graview-ink, CanvasText)); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as $}from"./chunk.
|
|
1
|
+
import{H as $}from"./chunk.2UIUMG23.js";import{G as L,La as U,a as I,b as R,c as E,d as f,e as k,j as W,m as F,v as j}from"./chunk.KA44WNB4.js";import{od as s,vd as b,wd as r}from"./chunk.4TJOS4C7.js";import{b as H}from"./chunk.AJZBJBMO.js";var u=H(L(),1),_=e=>typeof e=="object"&&e!==null&&"idx"in e;function S(e){let n=r(window.location.pathname,e);return n===null?null:n!==s&&n!=="/"?"pages":n===s||window.location.href.includes("#")?f(window.location.hash).overview?"graview":"scene":_(window.history.state)?"pages":null}function K(e){let n=e.face??(e.stop&&E(e.stop).overview?"graview":"scene");return e.routing!=="address"||typeof window>"u"?n:S(e.basePath)??n}function Q(e){return e.routing!=="address"||typeof window>"u"?!1:r(window.location.pathname,e.basePath)==="/"&&S(e.basePath)===null}function X(e){if(typeof window>"u")return;let n=r(window.location.pathname,e);return n===s||n==="/"&&window.location.href.includes("#")?R(f(window.location.hash)):void 0}function Z({basePath:e,pagesWere:n,shown:t,onFace:i,toggle:l,kinds:N,places:w,opens:B,landed:V}){let{view:O,go:p}=U(),g=(0,u.useRef)({shown:t,view:O,onFace:i,landed:V});g.current={shown:t,view:O,onFace:i,landed:V};let m=(0,u.useRef)(n??"/"),P=()=>{m.current=`${r(window.location.pathname,e)??"/"}${window.location.search}`};return l.current=(o,c,a)=>{let{shown:d,view:h,onFace:A}=g.current;if(o==="pages"&&d!=="pages")window.history.pushState(null,"",b(c??m.current,{basePath:e}));else if(o!=="pages"&&d==="pages"){P();let y=a===void 0?h:M(E(a),w),v=q(y)?z(B):y,T=v!==y&&v.overview?"graview":o,x=Y(T,v,N);p(x),window.history.pushState(null,"",`${b(s,{basePath:e})}${k(x)}`),A?.(T);return}A?.(o)},(0,u.useEffect)(()=>{let o=()=>{if(r(window.location.pathname,e)===null)return;let c=S(e)??"pages",{shown:a,onFace:d,landed:h}=g.current;if(c==="pages"){P(),h?.(m.current),a!=="pages"&&d?.("pages");return}a==="pages"&&(p(M(f(window.location.hash),w)),d?.(c))};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[e,p,w]),null}function M(e,n){let t=e.within?.view,i=t!==void 0&&!e.focusId?n.find(l=>l.as===t):void 0;return i?{...e,focusId:j(i.kind)}:e}function Y(e,n,t){return e==="graview"?F(n,!0):n.overview?W(F(n,!1),$(n,t)):n}function q(e){return e.focusId===null&&e.overview!==!0}function z(e){return e??{...I,overview:!0}}export{K as a,Q as b,X as c,Z as d,M as e,Y as f,q as g,z as h};
|