graview 0.1.29 → 0.1.32
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.2NIOHEMX.js +1 -0
- package/dist/preview/{chunk.GZH6PTXN.js → chunk.3AGY4QVS.js} +1 -1
- package/dist/preview/chunk.3HXN4BOY.js +1 -0
- package/dist/preview/chunk.3K6YSVHC.js +1 -0
- package/dist/preview/{chunk.7D77HEIJ.js → chunk.3TVXGJTU.js} +1 -1
- package/dist/preview/chunk.3TY5NFLY.js +1 -0
- package/dist/preview/{chunk.IZW7DBK4.js → chunk.47STJVRV.js} +1 -1
- package/dist/preview/chunk.4HRAQNJO.js +27 -0
- package/dist/preview/chunk.4HZ7QTXZ.js +1 -0
- package/dist/preview/chunk.4MERAWS2.js +1 -0
- package/dist/preview/chunk.52W7WYME.js +1 -0
- package/dist/preview/chunk.5A4AOFOA.js +1 -0
- package/dist/preview/chunk.5H4VXLZF.js +88 -0
- package/dist/preview/{chunk.D4GOVA25.js → chunk.5T5XGILP.js} +1 -1
- package/dist/preview/chunk.5TVB6BUY.js +1 -0
- package/dist/preview/chunk.5UL7YDUD.js +1 -0
- package/dist/preview/chunk.63GXY2ME.js +1 -0
- package/dist/preview/chunk.6QWV5MVH.js +25 -0
- package/dist/preview/{chunk.HV6I74DF.js → chunk.6UGEYZAC.js} +1 -1
- package/dist/preview/chunk.6YCBYL2Y.js +2 -0
- package/dist/preview/chunk.7GKUVQVF.js +1 -0
- package/dist/preview/{chunk.QSDT2RLY.js → chunk.7T7NZZTC.js} +1 -1
- package/dist/preview/chunk.AKFKM4SW.js +3 -0
- package/dist/preview/chunk.AOSMJKLH.js +1 -0
- package/dist/preview/{chunk.IPBXAAQV.js → chunk.ASCLIM2P.js} +1 -1
- package/dist/preview/chunk.B2GLDIAS.js +1 -0
- package/dist/preview/chunk.BNV77BQZ.js +4 -0
- package/dist/preview/chunk.BOO6WVM4.js +117 -0
- package/dist/preview/chunk.BQ3JHEHV.js +1 -0
- package/dist/preview/chunk.CAVBSL27.js +1 -0
- package/dist/preview/chunk.CDP2XL66.js +1 -0
- package/dist/preview/chunk.CIPS2OGR.js +1 -0
- package/dist/preview/chunk.CJJLJ3KW.js +2 -0
- package/dist/preview/chunk.CN3UEF5N.js +90 -0
- package/dist/preview/chunk.COQKECUH.js +1 -0
- package/dist/preview/{chunk.3G5MQFZK.js → chunk.CWHRDBOF.js} +1 -1
- package/dist/preview/chunk.CX3KL2C5.js +1 -0
- package/dist/preview/chunk.D75KC3LL.js +1 -0
- package/dist/preview/chunk.DAZ2VSRD.js +1 -0
- package/dist/preview/{chunk.ONGVH3ZM.js → chunk.DHIUSUCL.js} +75 -24
- package/dist/preview/{chunk.44FVJOK4.js → chunk.DYSPCGXX.js} +1 -1
- package/dist/preview/chunk.E2YEOMPH.js +1 -0
- package/dist/preview/chunk.EBGAYL32.js +1 -0
- package/dist/preview/{chunk.HRWLR7T4.js → chunk.EF3XNU4O.js} +1 -1
- package/dist/preview/chunk.EJPI3ST6.js +1 -0
- package/dist/preview/chunk.EKPRNDUV.js +1 -0
- package/dist/preview/chunk.ERIT3R6N.js +1 -0
- package/dist/preview/chunk.EYTBDMTW.js +1 -0
- package/dist/preview/chunk.F6EH7HI2.js +1 -0
- package/dist/preview/{chunk.OGXE2RHC.js → chunk.F6ZK7RMB.js} +2 -2
- package/dist/preview/chunk.FSTCX2AI.js +1 -0
- package/dist/preview/chunk.FWTIUYXH.js +2 -0
- package/dist/preview/{chunk.YCA7P5MK.js → chunk.G5NZVPJU.js} +1 -1
- package/dist/preview/chunk.GO4XBWJO.js +9 -0
- package/dist/preview/chunk.GV2CQVKV.js +1 -0
- package/dist/preview/chunk.GYICGZMG.js +3 -0
- package/dist/preview/chunk.H7BST3XO.js +1 -0
- package/dist/preview/chunk.H7EPE74C.js +1 -0
- package/dist/preview/{chunk.X53HI436.js → chunk.HAIG6NVX.js} +1 -1
- package/dist/preview/chunk.HLTRQU4Y.js +35 -0
- package/dist/preview/{chunk.O4QPITBD.js → chunk.I6FPNX43.js} +1 -1
- package/dist/preview/chunk.IDVAR5HM.js +1 -0
- package/dist/preview/chunk.J25KOSNW.js +1 -0
- package/dist/preview/chunk.JDUJDAGA.js +1 -0
- package/dist/preview/chunk.JFAOHHJJ.js +1 -0
- package/dist/preview/chunk.JOOQUWLT.js +341 -0
- package/dist/preview/{chunk.ZBXOX3W3.js → chunk.JQU5GEU3.js} +1 -1
- package/dist/preview/chunk.K5ME5GCG.js +1 -0
- package/dist/preview/chunk.K7PMDSOL.js +1 -0
- package/dist/preview/chunk.KSES5U5B.js +1 -0
- package/dist/preview/chunk.LLLZEGRK.js +1 -0
- package/dist/preview/chunk.LR3VDXPI.js +1 -0
- package/dist/preview/chunk.LXBOVRFI.js +1 -0
- package/dist/preview/chunk.MAF7C3VM.js +2 -0
- package/dist/preview/chunk.MNP4JI33.js +5 -0
- package/dist/preview/{chunk.5AT4O4BN.js → chunk.MWGGV7DE.js} +1 -1
- package/dist/preview/chunk.N6OX4NEQ.js +1 -0
- package/dist/preview/chunk.NM6MZYFN.js +47 -0
- package/dist/preview/chunk.NRAYZY3X.js +1 -0
- package/dist/preview/chunk.NTF7FVB2.js +1 -0
- package/dist/preview/chunk.OC6IWRQ3.js +1 -0
- package/dist/preview/chunk.OF34OZ4V.js +1 -0
- package/dist/preview/chunk.OJGHDWI6.js +1 -0
- package/dist/preview/chunk.OKRNJXTV.js +1 -0
- package/dist/preview/chunk.PBSMLINK.js +1 -0
- package/dist/preview/chunk.PHKSMUIA.js +1 -0
- package/dist/preview/chunk.PIP6Z563.js +1 -0
- package/dist/preview/chunk.QGTSHKJL.js +1 -0
- package/dist/preview/chunk.QVVJRSRM.js +1 -0
- package/dist/preview/{chunk.J46KDTEZ.js → chunk.QYZNAUIR.js} +1 -1
- package/dist/preview/chunk.R6K6GF5R.js +1 -0
- package/dist/preview/chunk.RCKTBOY2.js +1 -0
- package/dist/preview/{chunk.CK7QWLMX.js → chunk.RIJUCHP4.js} +1 -1
- package/dist/preview/chunk.SHPXD6FC.js +1 -0
- package/dist/preview/chunk.SHTJZ6UX.js +1 -0
- package/dist/preview/chunk.SYAEBGDC.js +2 -0
- package/dist/preview/chunk.T5VG5A6V.js +1 -0
- package/dist/preview/{chunk.JNGUSAWX.js → chunk.TAQ764IQ.js} +17 -3
- package/dist/preview/chunk.TCNBCTWO.js +1 -0
- package/dist/preview/chunk.TI4OSTQV.js +1 -0
- package/dist/preview/{chunk.ZSKP6UQS.js → chunk.UATVTXZY.js} +1 -1
- package/dist/preview/{chunk.V6TK4LHW.js → chunk.UBFNZMUX.js} +4 -4
- package/dist/preview/chunk.UGFDSE37.js +1 -0
- package/dist/preview/chunk.UGFJKSHU.js +3 -0
- package/dist/preview/chunk.UHUGOTUU.js +19 -0
- package/dist/preview/chunk.ULRW47RP.js +1 -0
- package/dist/preview/chunk.UNL2HIF2.js +1 -0
- package/dist/preview/chunk.UZGRRDHD.js +1 -0
- package/dist/preview/chunk.VG3O4LWB.js +1 -0
- package/dist/preview/chunk.WAZ7OGBD.js +1 -0
- package/dist/preview/chunk.XANVHJQ4.js +1 -0
- package/dist/preview/chunk.XKABS745.js +1 -0
- package/dist/preview/chunk.XMC7YDWT.js +1 -0
- package/dist/preview/chunk.XNJEFUF7.js +3 -0
- package/dist/preview/chunk.Y6ZNFQK3.js +6 -0
- package/dist/preview/{chunk.QNHECGMH.js → chunk.YIR7PPF3.js} +1 -1
- package/dist/preview/index.html +51 -0
- package/dist/preview/page.js +6 -6
- package/package.json +6 -6
- package/dist/preview/chunk.2643W7FT.js +0 -1
- package/dist/preview/chunk.2CLPRG3I.js +0 -1
- package/dist/preview/chunk.2IZFIORK.js +0 -1
- package/dist/preview/chunk.2NCTM5K2.js +0 -2
- package/dist/preview/chunk.3JM2TNDD.js +0 -2
- package/dist/preview/chunk.4GGAPOMK.js +0 -2
- package/dist/preview/chunk.5JXUAMKI.js +0 -1
- package/dist/preview/chunk.5R66YTET.js +0 -2
- package/dist/preview/chunk.64P76WK4.js +0 -1
- package/dist/preview/chunk.7DNFXJH3.js +0 -1
- package/dist/preview/chunk.7PRFYYVM.js +0 -1
- package/dist/preview/chunk.AE5GKL4C.js +0 -1
- package/dist/preview/chunk.ARR75WBP.js +0 -35
- package/dist/preview/chunk.AVUS5LMG.js +0 -3
- package/dist/preview/chunk.BKPGDEES.js +0 -1
- package/dist/preview/chunk.BZ5OJYHU.js +0 -1
- package/dist/preview/chunk.COTG2IG5.js +0 -1
- package/dist/preview/chunk.DAA6XWLF.js +0 -1
- package/dist/preview/chunk.DKTCRFMS.js +0 -1
- package/dist/preview/chunk.DLGTFXGM.js +0 -1
- package/dist/preview/chunk.DN7SN6ZR.js +0 -1
- package/dist/preview/chunk.G4WQGTZR.js +0 -3
- package/dist/preview/chunk.GDA3G4U2.js +0 -6
- package/dist/preview/chunk.GS4T26WW.js +0 -328
- package/dist/preview/chunk.HFKMHLJ3.js +0 -1
- package/dist/preview/chunk.HGAMNIST.js +0 -1
- package/dist/preview/chunk.HKBKH7EK.js +0 -1
- package/dist/preview/chunk.HLLWKSZB.js +0 -5
- package/dist/preview/chunk.HONUT6OG.js +0 -1
- package/dist/preview/chunk.IWYUFYDJ.js +0 -1
- package/dist/preview/chunk.JU2ZVKMT.js +0 -2
- package/dist/preview/chunk.K4ZUVH2G.js +0 -1
- package/dist/preview/chunk.KC6UZHBM.js +0 -1
- package/dist/preview/chunk.KLITC55P.js +0 -1
- package/dist/preview/chunk.KZ2376BD.js +0 -19
- package/dist/preview/chunk.LYJAVUST.js +0 -1
- package/dist/preview/chunk.MOUGB4H6.js +0 -1
- package/dist/preview/chunk.MYFWM572.js +0 -1
- package/dist/preview/chunk.N4FBDA2W.js +0 -1
- package/dist/preview/chunk.O42YET3W.js +0 -1
- package/dist/preview/chunk.ONDILMIX.js +0 -1
- package/dist/preview/chunk.OQDETV4X.js +0 -1
- package/dist/preview/chunk.OWBEV6FR.js +0 -1
- package/dist/preview/chunk.OWE6OJ4P.js +0 -1
- package/dist/preview/chunk.OYJSFO3A.js +0 -1
- package/dist/preview/chunk.P62SKNJS.js +0 -27
- package/dist/preview/chunk.PA5HYAEO.js +0 -1
- package/dist/preview/chunk.PMEDLEZY.js +0 -9
- package/dist/preview/chunk.PTXQHHKF.js +0 -1
- package/dist/preview/chunk.R2D373VG.js +0 -1
- package/dist/preview/chunk.RB4RTBRZ.js +0 -1
- package/dist/preview/chunk.RCLJ4H52.js +0 -116
- package/dist/preview/chunk.RKRSRKF3.js +0 -1
- package/dist/preview/chunk.RWGLKDWH.js +0 -1
- package/dist/preview/chunk.SIL4KD3K.js +0 -1
- package/dist/preview/chunk.SS76EIMI.js +0 -1
- package/dist/preview/chunk.T4LY5QXO.js +0 -14
- package/dist/preview/chunk.UIIVEQAT.js +0 -1
- package/dist/preview/chunk.UTHHX2TJ.js +0 -1
- package/dist/preview/chunk.UWNYT7PF.js +0 -1
- package/dist/preview/chunk.VNBO2RXD.js +0 -1
- package/dist/preview/chunk.VPPUTA74.js +0 -1
- package/dist/preview/chunk.WKXNBHTL.js +0 -4
- package/dist/preview/chunk.WLRTPFAC.js +0 -1
- package/dist/preview/chunk.XAXJHEMD.js +0 -1
- package/dist/preview/chunk.XDZSTIS6.js +0 -88
- package/dist/preview/chunk.XXHNV24G.js +0 -1
- package/dist/preview/chunk.YRQZZH5V.js +0 -1
- package/dist/preview/chunk.YUWRZWGX.js +0 -1
- package/dist/preview/chunk.Z2RGLFLS.js +0 -1
- package/dist/preview/chunk.Z56B2JR2.js +0 -25
- package/dist/preview/chunk.Z5V23DQN.js +0 -3
- package/dist/preview/chunk.ZEGSQCSD.js +0 -1
- package/dist/preview/chunk.ZEVVWWNA.js +0 -44
- package/dist/preview/chunk.ZS4DJ76C.js +0 -1
- /package/dist/preview/{chunk.OHE5AMHH.js → chunk.GZHZLJBF.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as $e,b as Ae,c as Fe,d as de,e as S,f as De,h as Re}from"./chunk.UTHHX2TJ.js";import{e as Te,f as Ke,g as Pe}from"./chunk.7DNFXJH3.js";import{a as ne,b as te,c as L,d as Me,e as W,g as X,h as Ce}from"./chunk.2NCTM5K2.js";import{b as xe,g as h,h as Ee,i as ce}from"./chunk.JU2ZVKMT.js";import{b as ee,c as Y,e as ke,f as we,g as G,h as k,k as _,l as ve,m as P,n as je,o as N,p as R,r as w,s as Se,t as M,u as O,v as U,w as K,x as t,y as V,z as Oe}from"./chunk.HLLWKSZB.js";function le(e){let n=/^(edit|remove|archive|unarchive|merge|skip|detach|split)-(.+)$/.exec(e);return n?{act:n[1],kind:n[2]}:void 0}var pe="graview-document",ue=1,me=256*1024,fe=64*1024,_e=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,ge=/^[a-z][A-Za-z0-9]*$/,nn=new Set(["id","kind"]),tn=e=>e in Object.prototype,Ne=V(e=>!tn(e),"every object already has this name \u2014 choose another"),Ie=(e,n)=>[...e===void 0?[]:[we(e)],...n===void 0?[]:[ke(n)]],$=(e,n)=>k().check(...Ie(e,n)),x=(e,n,s)=>R(e).check(...Ie(n,s)),D=e=>k().check(G(_e,`${e} names are lower-case words joined by hyphens, like "booked-vendor"`)),on=/^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$/,B=k().check(G(on,'relation names are one camelCase word, like "tendedBy"'),Ne),C=k().check(G(ge,'field names are one word or camelCase, like "dueDate" \u2014 rules say them bare'),V(e=>!nn.has(e),'a field cannot be called "id" or "kind" \u2014 the framework keeps those; try "type" or "category"'),Ne),I=$(1,500),J=$(1,2e3),se=$(1,300),sn=["string","text","number","integer","boolean","date","datetime","enum","list","url","email","image","file","app-link","phone","place","duration"],qe=w({type:U(sn),required:t(P()),description:t(I),label:t($(1,60)),options:t(x($(1,80),1,100)),of:t(U(["string","number","date","image","file"])),default:t(N()),unit:t($(void 0,12)),format:t(U(["money","percent","duration","markdown"])),min:t(_()),max:t(_()),step:t(_()),renamedFrom:t(k().check(G(ge))),repeats:t(P())}).check(Oe((e,n)=>{e.type==="enum"&&!e.options&&n.addIssue({code:"custom",message:'an enum field lists its "options"',path:["options"]}),e.type!=="enum"&&e.options&&n.addIssue({code:"custom",message:'"options" belongs only on an enum field',path:["options"]}),e.type!=="list"&&e.of&&n.addIssue({code:"custom",message:'"of" belongs only on a list field',path:["of"]}),e.repeats&&e.type!=="date"&&e.type!=="datetime"&&n.addIssue({code:"custom",message:'"repeats" belongs only on a date or datetime field',path:["repeats"]})})),rn=w({to:M([x(D("kind"),1),K("*")]),cardinality:t(U(["one","many"])),description:t(I),inverse:t($(1,80)),appendOnly:t(P()),renamedFrom:t(k())}),Ve=M([J,w({expr:J,label:t($(1,60)),description:t(I)})]),an=w({noun:t($(1,40)),plural:t($(1,40)),description:t(I),fields:O(C,qe).check(V(e=>Object.keys(e).length>0,"a kind has at least one field")),label:t(se),describe:t(se),lifecycle:t(w({field:C,retired:x(M([k(),_(),P()]),1)})),figure:t($(void 0,2e4)),glance:t(x(C,1,20)),page:t(w({fields:t(x(C,1,40)),groups:t(x(w({title:$(1,60),fields:x(C,1,40)}),1,12))})),edges:t(O(B,rn)),computed:t(O(k(),Ve).check(V(e=>Object.keys(e).length<=20,"a kind works out at most 20 computed fields"))),fieldRoles:t(O(k(),k())),renamedFrom:t(k().check(G(_e))),people:t(P()),archives:t(K(!1))}),H=M([k(),_(),P(),je(),R(N()),w({expr:J})]),Z=k().check(G(/^\$[A-Za-z][A-Za-z0-9]*$/,'a reference is "$" and a name, like "$subject" or "$new"')),cn=M([w({create:D("kind"),as:t(k().check(G(ge))),set:t(O(C,H))}),w({set:O(C,H),target:t(Z)}),w({connect:B,from:Z,to:Z}),w({sever:B,from:Z,to:Z}),w({remove:Z})]),dn=w({title:t($(1,80)),description:t(I),fromTheOtherEnd:t($(1,80)),on:t(M([D("kind"),x(D("kind"),1)])),creates:t(D("kind")),sets:t(O(C,H)),writes:t(x(C,1)),connects:t(B),severs:t(B),setsOther:t(O(C,H)),replaces:t(M([K(!0),x(B,1,10)])),removes:t(K(!0)),args:t(O(C,qe)),effects:t(x(cn,1,20)),allowedWhen:t(J),refusal:t(se),destructive:t(P())}),ln=w({act:D("act"),label:t($(1,80)),args:t(O(k(),H))}),fn=w({title:t($(1,120)),description:t(I),over:M([K("graph"),D("kind")]),when:t(J),require:J,says:t(se),repairs:t(x(ln,void 0,10))}),pn=w({roles:M([x(D("role"),1),K("*")]),mutations:M([x(D("act"),1),K("*")]),kinds:t(M([R(D("kind")),K("*")])),describe:t(I),self:t(P()),ownEnd:t(P())}),Ge=t(x(D("field"),1)),un=w({roles:M([x(D("role"),1),K("*")]),kinds:x(D("kind"),1),own:t(P()),via:t(B),fields:Ge,hide:Ge}),mn=w({grants:R(pn),sees:t(R(un))}),gn=w({accent:t(k().check(G(/^#[0-9a-fA-F]{6}$/,'an accent is a color like "#c2577a"'))),name:t($(1,60)),currency:t(k().check(G(/^[A-Z]{3}$/,'a currency is its three-letter code, like "USD" or "EUR"'))),locale:t($(2,35)),logo:t(M([$(1,fe),w({src:$(1,fe),alt:t($(1,120))})])),favicon:t($(1,fe)),typography:t(w({display:t($(1,200)),body:t($(1,200)),mono:t($(1,200))})),shape:t(w({radius:t(_().check(Y(0),ee(32))),density:t(_().check(Y(.75),ee(1.5)))})),accents:t(O(k(),_().check(Y(0),ee(360)))),scheme:t(U(["light","dark","auto"]))}),oe=O(k(),N()),hn=w({card:t(R(N())),row:t(R(N())),page:t(R(N()))}),zn=Se({order:t(R(k())),hide:t(R(k())),first:t(k()),primary:t(x($(1,80),void 0,40)),scene:t($(1,40)),pages:t($(1,40)),lists:t(O(k(),w({filters:t(x($(1,120),void 0,40))})))}),Be=w({$schema:t(k()),format:K(pe),formatVersion:K(ue),name:$(1,80),description:t(I),version:t(_().check(ve(),Y(1))),kinds:O(D("kind"),an).check(V(e=>Object.keys(e).length>0,"a document declares at least one kind"),V(e=>Object.keys(e).length<=40,"a document declares at most 40 kinds")),computed:t(O(k(),Ve)),acts:t(O(D("act"),dn)),rules:t(O(D("rule"),fn)),roles:t(R(D("role"))),policy:t(mn),modules:t(oe),lenses:t(R(oe)),pages:t(zn),views:t(O(k(),M([hn,R(N())]))),brand:t(gn),settings:t(R(oe)),migrations:t(R(oe))});var yn={};function Ue(e,n=yn,s=ue){let{document:r,respelled:a}=$e(e),u=a.length>0?{respelled:a}:{};if(!r||typeof r!="object"||Array.isArray(r))return{document:r};let g=r;if(g.format!==pe||typeof g.formatVersion!="number"||g.formatVersion>=s)return{document:r,...u};let l=g.formatVersion,i=structuredClone(g);for(let o=l;o<s;o++){let c=n[o];if(!c)throw new Error(`there is no upgrade from format ${o} to ${o+1}`);i={...c(i),formatVersion:o+1}}return{document:i,from:l,...u}}function Le(e,n,s){let r=Object.keys(e).filter(l=>e[l].edges?.[n]!==void 0);if(r.length===0)return;let a=r.map(l=>e[l].edges[n].to),u=a.some(l=>l==="*")?"*":[...new Set(a.flatMap(l=>l))];if(s.length===0||s.some(l=>r.includes(l)))return{reversed:!1,kinds:u};let g=r.filter(l=>{let i=e[l].edges[n].to;return i==="*"||s.every(o=>i.includes(o))});return g.length>0?{reversed:!0,kinds:g}:{reversed:!1,kinds:u}}var Je=(e,n)=>{let s=e?.fields[n];return s!==void 0&&(s.type==="duration"||(s.type==="number"||s.type==="integer")&&s.format==="duration")};function We(e,n,s,r){if(r==="out"){let a=e[n]?.edges?.[s]?.to;return a===void 0?[]:a==="*"?Object.keys(e):a}return Object.entries(e).filter(([,a])=>{let u=a.edges?.[s]?.to;return u!==void 0&&(u==="*"||u.includes(n))}).map(([a])=>a)}function he(e,n,s){if(s.t==="ident")return e[n]?.edges?.[s.name]?We(e,n,s.name,"out"):void 0;if(s.t==="where")return he(e,n,s.set);if(s.t==="call"&&(s.fn==="out"||s.fn==="in")&&s.args[0]?.t==="lit"&&typeof s.args[0].value=="string")return We(e,n,s.args[0].value,s.fn)}var Ze=(e,n,s)=>{let r=n.filter(a=>e[a]?.fields[s]!==void 0);return r.length>0&&r.every(a=>Je(e[a],s))};function Ye(e,n,s){let r=e.kinds,a=r[n],u=new Map(s),g=new Map,l=(o,c)=>{if(c>8)return!1;switch(o.t){case"ident":return Je(a,o.name)||i(o.name,c+1);case"member":{let d=he(r,n,o.object);return d!==void 0&&Ze(r,d,o.name)}case"call":{if(o.fn!=="sum"&&o.fn!=="min"&&o.fn!=="max")return!1;let[d,y]=o.args,p=d&&he(r,n,d);return p!==void 0&&y?.t==="ident"&&Ze(r,p,y.name)}case"binary":return(o.op==="+"||o.op==="-")&&l(o.left,c)&&l(o.right,c);case"unary":return o.op==="-"&&l(o.operand,c);default:return!1}},i=(o,c)=>{if(a?.computed?.[o]===void 0)return!1;if(g.has(o))return g.get(o);g.set(o,!1);let d=u.get(o),y=d!==void 0&&l(d,c);return g.set(o,y),y};return s.map(([o])=>o).filter(o=>i(o,0))}function Xe(e,n,s=`kinds.${e}.page`){let r=n.page;if(!r)return[];let a=[],u=[...Object.keys(n.fields),...Object.keys(n.computed??{})],g=new Set,l=(o,c)=>{u.includes(o)?g.has(o)&&a.push(h("page-field-twice",c,`"${o}" is on ${e}'s page twice; name each field once`)):a.push(h("page-field",c,`${e}'s page is to show "${o}", and ${e} has no field or computed field called that`,`use one of: ${u.join(", ")}`)),g.add(o)};(r.fields??[]).forEach((o,c)=>l(o,`${s}.fields.${c}`));let i=new Set;return(r.groups??[]).forEach((o,c)=>{let d=o.title.trim().toLowerCase();i.has(d)&&a.push(h("page-group-twice",`${s}.groups.${c}.title`,`${e}'s page has two groups called "${o.title}"; give each its own title`)),i.add(d),o.fields.forEach((y,p)=>l(y,`${s}.groups.${c}.fields.${p}`))}),a}var bn=new Set(["subject","now","today","me"]);function $n(e){if((typeof e=="string"?e:JSON.stringify(e??null)).length>me)return{findings:[h("too-large","",`a document may be at most ${me/1024} KB`)]};if(typeof e=="string")try{e=JSON.parse(e)}catch(r){return{findings:[h("not-json","",`this is not JSON: ${r.message}`)]}}try{e=Ue(e).document}catch(r){return{findings:[h("format","formatVersion",r.message)]}}let n=Be.safeParse(e);if(!n.success)return{findings:n.error.issues.map(r=>{let a=r.path.map(String).join(".");if(r.code==="unrecognized_keys")return h("unknown-key",a,`${r.keys.map(u=>`"${u}"`).join(", ")} ${r.keys.length===1?"is":"are"} not part of a Graview document here`,"check the spelling against docs/declaration-document.md");if(r.code==="invalid_union"&&/\.effects\.\d+$/.test(a))return h("effect-shape",a,"this effect is not one Graview knows",'an effect is one of {"create": kind, "as"?: name, "set"?: {field: value}}, {"set": {field: value, \u2026}, "target"?: "$ref"}, {"connect"|"sever": relation, "from": "$ref", "to": "$ref"}, {"remove": "$ref"}');if(r.code==="invalid_key"){let u=r.issues?.[0]?.message;return h("shape",a,`the name "${String(r.path.at(-1))}" is not allowed here${u?`: ${u}`:""}`)}return h("shape",a,r.message)})};let s=n.data;return{document:s,findings:kn(s)}}var ie=e=>[e??[]].flat();function He(e){let n=new Map;for(let[s,r]of Object.entries(e.kinds))for(let[a,u]of Object.entries(r.edges??{})){let g=n.get(a);n.set(a,{name:a,from:[...g?.from??[],s],to:u.to==="*"||g?.to==="*"?"*":[...new Set([...g?.to??[],...u.to])],cardinality:u.cardinality??"many"})}return n}function Hn(e){let n=new Map;for(let[r,a]of Object.entries(e.kinds)){let u=X(a);n.set(r,{fields:new Set(Object.keys(a.fields)),edges:new Map(Object.entries(a.edges??{}).map(([g,l])=>[g,l.cardinality??"many"])),...u?{computed:u}:{}})}let s=X(e);return s&&n.set(xe,{computed:s}),n}function Qe(e,n){let s=[],r=ie(e.on),a=(u,g)=>{let l=Le(n.kinds,u,r)?.reversed===!0,[i,o]=l?["$to","$subject"]:["$subject","$to"];return g==="connect"?{connect:u,from:i,to:o}:{sever:u,from:i,to:o}};if(e.creates){let u=n.kinds[e.creates],g={};for(let l of Object.keys(u?.fields??{}))g[l]=`$${l}`;for(let l of e.effects??[])"set"in l&&!("create"in l)&&S(l.target)==="new"&&Object.assign(g,l.set);s.push({create:e.creates,as:"new",set:g})}return e.sets&&s.push({set:e.sets}),e.writes&&!(e.creates&&e.on===void 0)&&s.push({set:Object.fromEntries(e.writes.map(u=>[u,`$${u}`]))}),e.connects&&(e.replaces&&s.push({replace:e.replaces===!0?[e.connects]:[...e.replaces],keep:e.connects}),s.push(a(e.connects,"connect"))),e.severs&&s.push(a(e.severs,"sever")),e.setsOther&&(e.connects||e.severs)&&s.push({set:e.setsOther,target:"$to"}),e.removes&&s.push({remove:"$subject"}),e.effects&&s.push(...e.effects.filter(u=>!(e.creates&&"set"in u&&!("create"in u)&&S(u.target)==="new"))),s}function ze(e,n,s){try{let r=L(e),a=ne(r);for(let u of a.unknownFunctions)s.push(h("unknown-function",n,`"${u}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));return r}catch(r){if(r instanceof te){s.push(h("expression",n,r.sentence+` (at character ${r.at+1})`));return}throw r}}function ye(e,n,s){try{return W(e)}catch(r){if(r instanceof Me||r instanceof te){s.push(h("template",n,(r instanceof te,r.sentence)));return}throw r}}function kn(e){let n=[],s=new Set(Object.keys(e.kinds)),r=He(e),a=e.acts??{},u=new Set(e.roles??[]);for(let[l,i]of Object.entries(e.kinds)){let o=`kinds.${l}`;for(let[d,y]of Object.entries(i.edges??{})){if(y.to!=="*")for(let p of y.to)s.has(p)||n.push(h("edge-target",`${o}.edges.${d}.to`,`"${p}" is not a kind this document declares`));i.fields[d]&&n.push(h("edge-field-clash",`${o}.edges.${d}`,`"${d}" is both a field and a relation of ${l}`,"rename one of them"))}i.lifecycle&&!i.fields[i.lifecycle.field]&&n.push(h("lifecycle-field",`${o}.lifecycle.field`,`${l} has no field "${i.lifecycle.field}"`));let c=d=>i.computed!==void 0&&Object.hasOwn(i.computed,d);for(let d of i.glance??[])!i.fields[d]&&!c(d)&&n.push(h("glance-field",`${o}.glance`,`a glance at ${l} is to say "${d}", and ${l} has no field or computed field called that`,`use one of: ${[...Object.keys(i.fields),...Object.keys(i.computed??{})].join(", ")}`));n.push(...Xe(l,i));for(let d of["label","describe"]){let y=i[d];if(!y)continue;let p=ye(y,`${o}.${d}`,n);for(let f of p??[])if(f.expr){for(let m of ne(f.expr).names)if(!i.fields[m]){if(c(m)){Ce(i,m)||n.push(h("template-field",`${o}.${d}`,`${l}'s ${m} is worked out from beyond the record, and a ${d} is said with no graph to read`,`show it in a view instead, or name a computed field worked out from ${l}'s own fields`));continue}n.push(h("template-field",`${o}.${d}`,`${l} has no field "${m}" for its ${d} to show`,d==="label"?"a label can only show the record's own fields and what they work out":void 0))}}}for(let[d,y]of Object.entries(i.fields)){y.default!==void 0&&y.type==="enum"&&!y.options?.includes(String(y.default))&&n.push(h("default-option",`${o}.fields.${d}.default`,`"${String(y.default)}" is not one of ${d}'s options`));let p=`${d}Repeat`;y.repeats&&(i.fields[p]||i.edges?.[p]||i.computed?.[p])&&n.push(h("repeat-clash",`${o}.fields.${d}.repeats`,`${l} already has "${p}", where how ${d} repeats is kept`))}}for(let[l,i]of Object.entries(a)){let o=`acts.${l}`;for(let p of ie(i.on))s.has(p)||n.push(h("act-kind",`${o}.on`,`"${p}" is not a kind this document declares`));let c=ie(i.on),d=Qe(i,e);if(i.creates&&i.on===void 0&&i.writes&&s.has(i.creates))for(let p of i.writes)e.kinds[i.creates].fields[p]||(e.kinds[i.creates].computed?.[p]!==void 0?n.push(h("computed-written",`${o}.writes`,`${i.creates}'s ${p} is worked out, not written: no act can set it`,"write the stored fields it is worked out from")):n.push(h("act-field",`${o}.writes`,`${i.creates} has no field "${p}"`)));d.length===0&&n.push(h("act-empty",o,`"${l}" does nothing`,"give it effects or a shorthand such as sets or creates"));let y=new Map;d.forEach((p,f)=>{let m=d.length-(i.effects?.length??0),v=i.effects&&f>=m?`${o}.effects.${f-m}`:o;if("create"in p){if(!s.has(p.create))n.push(h("act-kind",`${v}.create`,`"${p.create}" is not a kind this document declares`));else for(let b of Object.keys(p.set??{}))e.kinds[p.create].fields[b]||(e.kinds[p.create].computed?.[b]!==void 0?n.push(h("computed-written",`${v}.set.${b}`,`${p.create}'s ${b} is worked out, not written: no act can set it`,"set the stored fields it is worked out from")):n.push(h("act-field",`${v}.set.${b}`,`${p.create} has no field "${b}"`)));p.as&&y.set(p.as,p.create)}else if("connect"in p||"sever"in p){let b="connect"in p?p.connect:p.sever;r.has(b)||n.push(h("act-edge",`${v}.${"connect"in p?"connect":"sever"}`,`"${b}" is not a relation any kind declares`)),S(p.from)==="subject"&&c.length===0&&n.push(h("act-subject",`${o}.on`,`"${l}" acts on "$subject" but does not say which kinds it is "on"`))}else if("set"in p){let b=S(p.target??"$subject"),E=b==="subject"?c:y.has(b??"")?[y.get(b)]:[];b==="subject"&&c.length===0&&n.push(h("act-subject",`${o}.on`,`"${l}" changes "$subject" but does not say which kinds it is "on"`));for(let F of Object.keys(p.set))for(let q of E)!s.has(q)||e.kinds[q].fields[F]||(e.kinds[q].computed?.[F]!==void 0?n.push(h("computed-written",`${v}.set.${F}`,`${q}'s ${F} is worked out, not written: no act can set it`,"set the stored fields it is worked out from")):n.push(h("act-field",`${v}.set.${F}`,`${q} has no field "${F}"`)))}else"remove"in p&&S(p.remove)==="subject"&&c.length===0&&n.push(h("act-subject",`${o}.on`,`"${l}" removes "$subject" but does not say which kinds it is "on"`));("set"in p&&p.set?Object.values(p.set):[]).forEach(b=>{b&&typeof b=="object"&&!Array.isArray(b)&&"expr"in b&&ze(b.expr,`${v}.set`,n)})}),i.allowedWhen&&ze(i.allowedWhen,`${o}.allowedWhen`,n),i.refusal&&ye(i.refusal,`${o}.refusal`,n)}for(let[l,i]of Object.entries(e.rules??{})){let o=`rules.${l}`;i.over!=="graph"&&!s.has(i.over)&&n.push(h("rule-kind",`${o}.over`,`"${i.over}" is not a kind this document declares`));let c=i.over==="graph"?void 0:e.kinds[i.over];for(let d of["when","require"]){let y=i[d];if(!y)continue;let p=ze(y,`${o}.${d}`,n);if(!p)continue;let f=ne(p);for(let m of f.names)if(i.over==="graph")n.push(h("rule-name",`${o}.${d}`,`"${m}" means nothing in a rule over the whole graph`,`name a kind in "over", or use all('kind')`));else if(c&&!c.fields[m]&&!c.edges?.[m]&&c.computed?.[m]===void 0){let v=Object.keys(c.edges??{}).find(A=>A.includes("-")&&A.split("-").includes(m));n.push(h("rule-name",`${o}.${d}`,`${i.over} has no field or relation called "${m}"`,v?`"${v}" reads as a subtraction in a rule; rename the relation to one camelCase word, like "${v.replace(/-([a-z0-9])/g,(A,b)=>b.toUpperCase())}"`:void 0))}for(let m of f.edges)r.has(m)||n.push(h("rule-edge",`${o}.${d}`,`"${m}" is not a relation any kind declares`));for(let m of f.sweeps)s.has(m)?i.over!=="graph"&&n.push(Ee("rule-cost",`${o}.${d}`,`this rule looks at every ${m} for every ${i.over}, which grows slowly as the app grows`,"walk a relation with out()/in() instead of all() where you can")):n.push(h("rule-kind",`${o}.${d}`,`"${m}" is not a kind this document declares`))}i.says&&ye(i.says,`${o}.says`,n),(i.repairs??[]).forEach((d,y)=>{!a[d.act]&&!le(d.act)&&n.push(h("repair-act",`${o}.repairs.${y}.act`,`"${d.act}" is not an act this document declares`))})}let g=e.policy;return g&&(g.grants.forEach((l,i)=>{if(l.roles!=="*"&&u.size>0)for(let o of l.roles)u.has(o)||n.push(h("grant-role",`policy.grants.${i}.roles`,`"${o}" is not one of the document's roles`));if(l.mutations!=="*")for(let o of l.mutations)!a[o]&&!le(o)&&n.push(h("grant-act",`policy.grants.${i}.mutations`,`"${o}" is not an act this document declares`))}),(g.sees??[]).forEach((l,i)=>{for(let o of l.kinds)s.has(o)||n.push(h("sight-kind",`policy.sees.${i}.kinds`,`"${o}" is not a kind this document declares`));if(l.roles!=="*"&&u.size>0)for(let o of l.roles)u.has(o)||n.push(h("sight-role",`policy.sees.${i}.roles`,`"${o}" is not one of the document's roles`))})),n.push(...Pe(e)),n}function wn(e,n,s,r){let a=new Map,u=ie(e.on),g=new Map,l=new Map;(u.length>0||n.some(f=>"remove"in f&&S(f.remove)==="subject"||"from"in f&&(S(f.from)==="subject"||S(f.to)==="subject")||"set"in f&&!("create"in f)&&S(f.target??"$subject")==="subject"))&&a.set(de,{ref:u.length>0?u:"*",required:!0});let o=e.args??{},c=e.writes?.length===1,d=(f,m)=>m&&f.type===m.type&&f.min===void 0&&f.max===void 0&&f.step===void 0?{...f,...m.min===void 0?{}:{min:m.min},...m.max===void 0?{}:{max:m.max},...m.step===void 0?{}:{step:m.step}}:f,y=(f,m)=>m&&f.type===m.type&&f.format===void 0&&f.unit===void 0?{...d(f,m),...m.format?{format:m.format}:{},...m.unit?{unit:m.unit}:{}}:d(f,m),p=(f,m,v)=>{if(f===de||bn.has(f)||g.has(f)||a.has(f))return;let A=o[f]?y(o[f],v):void 0;a.set(f,A?{field:A,optional:!A.required,required:!!A.required}:m())};for(let f of n)if("create"in f){let m=s.kinds[f.create];for(let[v,A]of Object.entries(f.set??{})){let b=S(A),E=m?.fields[v];if(b&&E){let F=!!E.required&&E.default===void 0;p(b,()=>({field:E,optional:!F,required:F}),E)}}f.as&&g.set(f.as,f.create)}else if("connect"in f||"sever"in f){let m=r.get("connect"in f?f.connect:f.sever);for(let[v,A]of[["from",f.from],["to",f.to]]){let b=S(A);if(!b)continue;let E=v==="to"?m?.to??"*":m?.from??"*";E!=="*"&&!l.has(b)&&l.set(b,E),p(b,()=>({ref:E,required:!0}))}}else if("set"in f){let m=S(f.target??"$subject"),v=m==="subject"?u[0]:g.get(m??"")??l.get(m??"")?.[0];m&&m!=="subject"&&!g.has(m)&&p(m,()=>({ref:"*",required:!0}));for(let[A,b]of Object.entries(f.set)){let E=S(b);if(!E)continue;let F=v?s.kinds[v]?.fields[A]:void 0;p(E,()=>F?{field:F,optional:!c,required:c}:{any:!0,required:!1},F)}}else if("remove"in f){let m=S(f.remove);m&&p(m,()=>({ref:"*",required:!0}))}for(let[f,m]of Object.entries(o))a.has(f)||a.set(f,{field:m,optional:!m.required,required:!!m.required});return a}function Qn(e,n={}){let s=$n(e);if(!s.document||ce(s.findings))return{ok:!1,findings:s.findings};let r=s.document,a=[...s.findings];n.previous&&a.push(...jn(r,n.previous));let u=vn(r,a);return ce(u.findings)?{ok:!1,findings:u.findings}:Re(u,n)}function re(e,n){return e.map(s=>{let r=!s.format&&s.expr?.t==="ident"?n?.[s.expr.name]?.format:void 0;return r==="money"||r==="percent"?{...s,format:r}:s})}function vn(e,n){let s=He(e),r={};for(let[o,c]of Object.entries(e.kinds)){let d=De(c),y=c.label??(d?`{${d}}`:void 0),p=X(c),f=p?Ye(e,o,[...p]):[];r[o]={...y?{label:re(W(y),c.fields)}:{},...c.describe?{describe:re(W(c.describe),c.fields)}:{},...p?{computed:[...p]}:{},...f.length>0?{durations:f}:{}}}let a={};for(let[o,c]of Object.entries(e.acts??{})){let d=Qe(c,e),y=wn(c,d,e,s),p=c.destructive??d.some(z=>"remove"in z||"sever"in z||"replace"in z),f=[...new Set(d.flatMap(z=>"create"in z?[z.create]:[]))],m=[...new Set(d.flatMap(z=>"connect"in z?[z.connect]:[]))],v=[...new Set(d.flatMap(z=>"sever"in z?[z.sever]:"replace"in z?z.replace:[]))],A=[...new Set(d.flatMap(z=>"set"in z&&!("create"in z)&&S(z.target??"$subject")==="subject"?Object.keys(z.set):[]))],b=new Map;for(let z of d){if(!("connect"in z)&&!("sever"in z))continue;let j=s.get("connect"in z?z.connect:z.sever);for(let[T,en]of[["from",z.from],["to",z.to]]){let Q=S(en),ae=T==="to"?j?.to:j?.from;Q&&Q!=="subject"&&ae&&ae!=="*"&&b.set(Q,[...new Set([...b.get(Q)??[],...ae])])}}let E={};for(let z of d){if(!("set"in z)||"create"in z)continue;let j=S(z.target??"$subject");for(let T of j&&j!=="subject"&&b.get(j)||[])E[T]=[...new Set([...E[T]??[],...Object.keys(z.set)])]}let F={};for(let z of d)if(!(!("set"in z)||"create"in z||S(z.target??"$subject")!=="subject"))for(let[j,T]of Object.entries(z.set??{}))typeof T=="string"&&S(T)===void 0||typeof T=="number"||typeof T=="boolean"?F[j]=typeof T=="string"&&T.startsWith("$$")?T.slice(1):T:delete F[j];let q=f.length===0&&d.every(z=>!("set"in z)||!z.set||Object.values(z.set).every(j=>!(j&&typeof j=="object"&&!Array.isArray(j)&&"expr"in j))),be=new Map;for(let z of d)if(!(!("set"in z)||!z.set))for(let j of Object.values(z.set))j&&typeof j=="object"&&!Array.isArray(j)&&"expr"in j&&be.set(j.expr,L(j.expr));a[o]={title:c.title??o.replace(/-/g," "),effects:d,args:[...y],...c.allowedWhen?{guard:L(c.allowedWhen)}:{},...c.refusal?{refusal:re(W(c.refusal),e.kinds[[c.on??[]].flat()[0]??""]?.fields)}:{},exprs:[...be],destructive:p,idempotent:q,creates:f,connects:m,severs:v,writes:A,writesOther:E,sets:F}}let u={};for(let[o,c]of Object.entries(e.rules??{}))u[o]={title:c.title??o.replace(/-/g," "),require:L(c.require),...c.when?{when:L(c.when)}:{},...c.says?{says:re(W(c.says),e.kinds[c.over]?.fields)}:{}};let g=Ae(e,n),l=Te(e),i=Ke(e);return{format:Fe,document:e,findings:n,kinds:r,...e.computed?{facts:[...X(e)??[]]}:{},edges:[...s].map(([o,{from:c,to:d,cardinality:y}])=>[o,{from:c,to:d,cardinality:y}]),acts:a,rules:u,brand:g,...Object.keys(l).length>0?{viewSpecs:l}:{},...i?{home:i}:{}}}function et(e,n){let s=e.split(/[\s:·]/).find(r=>r.length>0)??e;return n.kinds[s]?`kinds.${s}`:n.acts?.[s]?`acts.${s}`:n.rules?.[s]?`rules.${s}`:e}function nt(e,n,s){let r=/^defineNode\("([^"]+)"\)/.exec(n)?.[1],a=r?s.kinds[r]:void 0;if(!r||!a)return e;let u=Object.keys(a.fields).filter(g=>g!=="label").slice(0,3);return{...e,path:`kinds.${r}.glance`,fix:`Say which: "glance": [${u.map(g=>`"${g}"`).join(", ")}] on kinds.${r} \u2014 the facts a person compares one by, at a glance.`}}function jn(e,n){let s=[],r=new Set(Object.values(n.kinds).flatMap(a=>Object.keys(a.edges??{})));for(let[a,u]of Object.entries(e.kinds)){let g=u.renamedFrom;g&&!n.kinds[g]&&s.push(h("renamed-from-nothing",`kinds.${a}.renamedFrom`,`${a} says it was ${g}, and the previous version has no kind called ${g}`,"name the kind it was, or drop renamedFrom"));let l=n.kinds[g??a];for(let[i,o]of Object.entries(u.fields)){let c=o.renamedFrom;c&&!l?.fields[c]&&s.push(h("renamed-from-nothing",`kinds.${a}.fields.${i}.renamedFrom`,`${i} says it was ${c}, and the previous ${g??a} has no field called ${c}`,"name the field it was, or drop renamedFrom"))}for(let[i,o]of Object.entries(u.edges??{})){let c=o.renamedFrom;c&&!r.has(c)&&s.push(h("renamed-from-nothing",`kinds.${a}.edges.${i}.renamedFrom`,`${i} says it was ${c}, and the previous version has no relation called ${c}`,"name the relation it was, or drop renamedFrom"))}}return s}export{$n as a,Hn as b,Qe as c,Qn as d,et as e,nt as f};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import{H as on,Hb as sn,Sb as ln,Vb as un,ec as dn,ob as an,sc as cn,wa as rn,xc as ke,yc as Je}from"./chunk.HLLWKSZB.js";import{a as Ae,b as H}from"./chunk.AJZBJBMO.js";var Mn=Ae(w=>{"use strict";var rt=Symbol.for("react.transitional.element"),Mo=Symbol.for("react.portal"),Oo=Symbol.for("react.fragment"),Vo=Symbol.for("react.strict_mode"),_o=Symbol.for("react.profiler"),Co=Symbol.for("react.consumer"),Io=Symbol.for("react.context"),Lo=Symbol.for("react.forward_ref"),Ho=Symbol.for("react.suspense"),No=Symbol.for("react.memo"),En=Symbol.for("react.lazy"),Do=Symbol.for("react.activity"),Sn=Symbol.iterator;function jo(e){return e===null||typeof e!="object"?null:(e=Sn&&e[Sn]||e["@@iterator"],typeof e=="function"?e:null)}var Rn={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Pn=Object.assign,An={};function se(e,t,n){this.props=e,this.context=t,this.refs=An,this.updater=n||Rn}se.prototype.isReactComponent={};se.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};se.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function kn(){}kn.prototype=se.prototype;function it(e,t,n){this.props=e,this.context=t,this.refs=An,this.updater=n||Rn}var at=it.prototype=new kn;at.constructor=it;Pn(at,se.prototype);at.isPureReactComponent=!0;var vn=Array.isArray;function ot(){}var k={H:null,A:null,T:null,S:null},Tn=Object.prototype.hasOwnProperty;function st(e,t,n){var o=n.ref;return{$$typeof:rt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Go(e,t){return st(e.type,t,e.props)}function lt(e){return typeof e=="object"&&e!==null&&e.$$typeof===rt}function Wo(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var bn=/\/+/g;function nt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wo(""+e.key):t.toString(36)}function Fo(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(ot,ot):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function ae(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case rt:case Mo:a=!0;break;case En:return a=e._init,ae(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+nt(e,0):o,vn(r)?(n="",a!=null&&(n=a.replace(bn,"$&/")+"/"),ae(r,t,n,"",function(c){return c})):r!=null&&(lt(r)&&(r=Go(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(bn,"$&/")+"/")+a)),t.push(r)),1;a=0;var d=o===""?".":o+":";if(vn(e))for(var l=0;l<e.length;l++)o=e[l],i=d+nt(o,l),a+=ae(o,t,n,i,r);else if(l=jo(e),typeof l=="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,i=d+nt(o,l++),a+=ae(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return ae(Fo(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function He(e,t,n){if(e==null)return e;var o=[],r=0;return ae(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Ko(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var xn=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Bo={map:He,forEach:function(e,t,n){He(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return He(e,function(){t++}),t},toArray:function(e){return He(e,function(t){return t})||[]},only:function(e){if(!lt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=Do;w.Children=Bo;w.Component=se;w.Fragment=Oo;w.Profiler=_o;w.PureComponent=it;w.StrictMode=Vo;w.Suspense=Ho;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return k.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Pn({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Tn.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),d=0;d<i;d++)a[d]=arguments[d+2];o.children=a}return st(e.type,r,o)};w.createContext=function(e){return e={$$typeof:Io,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Co,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Tn.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var d=Array(a),l=0;l<a;l++)d[l]=arguments[l+2];r.children=d}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return st(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:Lo,render:e}};w.isValidElement=lt;w.lazy=function(e){return{$$typeof:En,_payload:{_status:-1,_result:e},_init:Ko}};w.memo=function(e,t){return{$$typeof:No,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=k.T,n={};k.T=n;try{var o=e(),r=k.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(ot,xn)}catch(i){xn(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),k.T=t}};w.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()};w.use=function(e){return k.H.use(e)};w.useActionState=function(e,t,n){return k.H.useActionState(e,t,n)};w.useCallback=function(e,t){return k.H.useCallback(e,t)};w.useContext=function(e){return k.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return k.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return k.H.useEffect(e,t)};w.useEffectEvent=function(e){return k.H.useEffectEvent(e)};w.useId=function(){return k.H.useId()};w.useImperativeHandle=function(e,t,n){return k.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return k.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return k.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return k.H.useMemo(e,t)};w.useOptimistic=function(e,t){return k.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return k.H.useReducer(e,t,n)};w.useRef=function(e){return k.H.useRef(e)};w.useState=function(e){return k.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return k.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return k.H.useTransition()};w.version="19.2.8"});var G=Ae((ai,On)=>{"use strict";On.exports=Mn()});var In=Ae(je=>{"use strict";var Jo=Symbol.for("react.transitional.element"),Zo=Symbol.for("react.fragment");function Cn(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Jo,type:e,key:o,ref:t!==void 0?t:null,props:n}}je.Fragment=Zo;je.jsx=Cn;je.jsxs=Cn});var xe=Ae((ci,Ln)=>{"use strict";Ln.exports=In()});var oe={focusId:null,relation:null,expanded:[],pins:{}},Te=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function Y(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${Me(r.x)},${Me(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Me(e.pan.x)},${Me(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function Ao(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Oe(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[S,p]of n){if(!S.startsWith("pin."))continue;let[g,b]=p.split(","),T=g===void 0?null:Te(g),y=b===void 0?null:Te(b);T===null||y===null||(o[S.slice(4)]={x:T,y})}let r=Object.create(null);for(let[S,p]of n)!S.startsWith("in.")||p.length===0||(r[S.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],d=a[0]===void 0?null:Te(a[0]),l=a[1]===void 0?null:Te(a[1]),c=(n.get("sel")??"").split(",").filter(S=>S.length>0).sort(),f=n.get("overview")==="1";return{...c.length>0?{selection:c}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...d!==null&&l!==null?{pan:{x:d,y:l}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:Ao(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(S=>S.length>0&&(f||!S.startsWith("kind:"))).sort(),pins:o}}function Yr(e){let t=Oe(e);return Y(t)==="#"?{...t,overview:!0}:t}function Xr(e){let t=Y(e);return t==="#overview=1"?"":t}function Me(e){return Math.round(e*100)/100}function pn(e,t){return Y(e)===Y(t)}var fn="edge:";function yn(e){if(!e.startsWith(fn))return null;let t=e.slice(fn.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function Ze(e){let{pan:t,...n}=e;return{...n,pins:{}}}function X(e,t){if(t===e.focusId)return{...e,focusId:t};let n=Ze(e);return{...n.within?.q!==void 0?Ve(n,"q",null):n,focusId:t}}function mn(e,t){return{...e,relation:t}}function Ve(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function Qe(e,t){if(t!==e.overview&&(e=Ze(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function _e(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function be(e,t){if(t!==(e.zoom===!0)&&(e=Ze(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Ce(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Le="aggregate:",Ie="kind:";function et(e){return`${Ie}${e}`}function re(e){return e.startsWith(Ie)?e.slice(Ie.length):null}var Qr="kinds:beyond";function ko(e){let t=re(e);return t?[t]:Q(e)}function ie(...e){return`${Le}${[...e].sort().join("+")}`}function gn(e){return e.startsWith(Le)}function Q(e){return!gn(e)||e.includes("|")?[]:e.slice(Le.length).split("+").filter(Boolean)}function hn(e,t,n={}){let o=re(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Ce(e,t);let r=o!==null?ie(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return be(e,!1);if(o!==null&&n.carry){let i=Qe({...X(e,r),relation:null},!1);return Ve(be(i,!0),"q",n.carry)}return be({...X(e,r),relation:null},!0)}function To(e,t,n){return Ve(Qe(X(e,ie(t)),!1),"view",n)}function ei(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var wn="aggregate:";function tt(e){return e.startsWith(wn)&&e.includes("|")}var ut=H(G(),1),$o={turns:[],outcomes:new Map,busy:!1,open:!1,side:"left",pending:null,drawn:0,draft:null,draftNote:null},Vn=e=>`graview:seat:${e}`;function zo(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...typeof n.open=="boolean"?{open:n.open}:{},...n.side==="left"||n.side==="right"?{side:n.side}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function qo(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],open:t.open,side:t.side,draft:t.draft}))}catch{}}function dt(e){let t=e===null?null:Vn(e),n={...$o,...zo(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&qo(t,n);for(let d of[...o])d()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),setOpen:i=>{n.open!==i&&r({...n,open:i})},setSide:i=>{n.side!==i&&r({...n,side:i})},ask:i=>r({...n,open:!0,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},drawn(){return r({...n,drawn:n.drawn+1},!1),()=>r({...n,drawn:Math.max(0,n.drawn-1)},!1)},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function Uo(e){let t=()=>e.get().drawn>0;return(0,ut.useSyncExternalStore)(e.subscribe,t,t)}function Yo(e){return(0,ut.useSyncExternalStore)(e.subscribe,e.get,e.get)}function _n(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Ne=H(G(),1),De=(0,Ne.createContext)(void 0),Xo=()=>(0,Ne.useContext)(De);var ct={};var Qo="I can answer about what's in this app. Open questions need AI, which isn't on here.",er="Answered with AI";var Hn=e=>`graview:setting:${e}`;function Nn(){return localStorage}function Dn(e,t){try{let n=(t??Nn()).getItem(Hn(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function jn(e,t,n){try{(n??Nn()).setItem(Hn(e.name),t)}catch{}}function Gn(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var _=H(G(),1);function ft(e){return ke(e)}var tr=12,nr=4;function or(e,t,n){let o=ft(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var Ge=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-tr);function Wn(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=nr)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?et([...o][0]):n[0]}function pt(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,d]of e)d.mode!=="asking"&&d.mode!=="docked"&&t.at-d.since>=t.holdMs&&o.set(a,{...d,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=or(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=Wn(t.ids,n);return i({at:a,mode:"reading",trail:Ge(r.trail,a)}),o}case"about-to-write":case"write":{let a=Wn(t.ids,n);return i({at:a,mode:"writing",trail:Ge(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:Ge(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:Ge(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var Fn="graview:session";function Kn(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(Fn);if(o)return o;let r=t();return n.setItem(Fn,r),r}catch{return t()}}var yt={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},mt={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},Bn=[yt,mt],ir=800;function $n(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:l,setView:c,ttlMs:f=1e4,people:S,seats:p}=e,[g,b]=(0,_.useState)(()=>new Map),[T,y]=(0,_.useState)(null),[v,h]=(0,_.useState)(null),[E,M]=(0,_.useState)(null),C=typeof r.id=="string"&&r.id.length>0,O=C&&(l[yt.name]??yt.initial)==="shared",W=O&&(l[mt.name]??mt.initial)==="shared",I=ft({kind:r.kind,...r.id?{id:r.id}:{},session:i}),D=C?rn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...S?{people:S}:{}}):"",V=d?a.get(`agent:${d}:${i}`):void 0,x=(0,_.useMemo)(()=>!t||!O?null:{participant:I,kind:r.kind,name:D,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:an(r.id??"nobody"),stop:E??Y(o),...W?{over:T}:{},...V?{robot:{at:V.at,mode:V.mode}}:{},at:new Date().toISOString()},[t,O,W,I,D,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,T,V?.at,V?.mode]);(0,_.useEffect)(()=>{if(!t||!x)return;t.here(x);let R=setInterval(()=>t.here({...x,at:new Date().toISOString()}),ir);return()=>clearInterval(R)},[t,x]),(0,_.useEffect)(()=>t?t.onWho(j=>b(Je(new Map,j,Date.now(),f))):void 0,[t,f]);let K=g.size>0;(0,_.useEffect)(()=>{if(!K)return;let R=setInterval(()=>{b(j=>{let ee=Je(j,[],Date.now(),f);return ee.size===j.size?j:ee})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(R)},[K,f]),(0,_.useEffect)(()=>{if(!t||typeof window>"u")return;let R=()=>t.leave();return window.addEventListener("pagehide",R),()=>window.removeEventListener("pagehide",R)},[t]),(0,_.useEffect)(()=>{if(!W||typeof document>"u")return;let R=null,j=ee=>{let te=_n(ee.target);te!==R&&(R=te,y(te))};return document.addEventListener("pointermove",j,{passive:!0}),()=>document.removeEventListener("pointermove",j)},[W]);let Z=(0,_.useRef)(null),z=v?g.get(v)??null:null,pe=(0,_.useCallback)(R=>{Z.current=null,h(R)},[]);return(0,_.useEffect)(()=>{if(v){if(!z){h(null);return}z.stop!==Z.current?.stop&&(Z.current={stop:z.stop,at:Date.now()},c(Oe(z.stop)))}},[v,z,c]),(0,_.useEffect)(()=>{let R=Z.current;!v||R===null||Date.now()-R.at<400||pn(o,Oe(R.stop))||h(null)},[o,v]),(0,_.useEffect)(()=>{if(!v||typeof document>"u")return;let R=j=>{j.key==="Escape"&&h(null)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[v]),(0,_.useMemo)(()=>({who:g,sharing:x?{participant:I,name:D}:null,following:z,follow:pe,sayWhere:M}),[g,x,I,D,z,pe])}var B=H(G(),1);function zn(e){return ke(e.author)}function ar(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function qn(e,t,n,o,r){let i=new Map;for(let[l,c]of e)o-c.at<r&&i.set(l,c);let a=new Set(n.flatMap(l=>l.nodeIds)),d=(l,c,f)=>{let S=i.get(l),p=S?.participants.includes(zn(c))?S.participants:[...S?.participants??[],zn(c)];i.set(l,{at:o,manner:ar(p,c.author.kind),intent:c.intent,wrote:(S?.wrote??!1)||(f.wrote??!1),read:(S?.read??!1)||(f.read??!1),broke:(S?.broke??!1)||a.has(l),participants:p})};for(let l of t){for(let c of l.writes)d(c,l,{wrote:!0});for(let c of l.reads)l.writes.includes(c)||d(c,l,{read:!0})}for(let l of n)for(let c of l.nodeIds){let f=i.get(c);i.set(c,{at:o,manner:f?.manner??"rule",intent:f?.intent??l.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var sr=2600;function Un(e,t=sr){let[n,o]=(0,B.useState)(()=>new Map),r=(0,B.useRef)(n);r.current=n;let i=(0,B.useRef)(null),a=(0,B.useCallback)(l=>{r.current=l,o(l),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,B.useEffect)(()=>{let l=e.violations(),c=e.subscribe((f,S)=>{let p=e.violations(),g=un(e.allInvariants(),l,p).introduces;l=p,a(qn(r.current,S,g.map(b=>({nodeIds:b.nodeIds,message:b.message})),Date.now(),t))});return()=>{c(),i.current&&clearTimeout(i.current)}},[e,t,a]);let d=(0,B.useCallback)(l=>{l.reads.length!==0&&a(qn(r.current,[lr(l)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function lr(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],inverse:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var s=H(G(),1);function Yn(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}function Xn(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var le=H(xe(),1),We=(0,s.createContext)(null),eo=(0,s.createContext)("scene");function ur({mode:e,children:t}){return(0,le.jsx)(eo.Provider,{value:e,children:t})}function dr(){return(0,s.useContext)(eo)}var to={kind:"human"},cr=[],fr=[],pr=[],gt=[];function no(e,t){let n=(0,s.useId)();(0,s.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??to,r=()=>ln(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}function yr({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=cr,onSeat:d,people:l=fr,memory:c,presenceTtlMs:f,app:S,settings:p=S?.settings??pr,presence:g,brand:b,locale:T,onKeepLens:y,providers:v,ai:h=ct,files:E,resolveApp:M,view:C,onViewChange:O,children:W}){let[I,D]=(0,s.useState)(null),V=I??i??a[0]?.principal??to,x=(0,s.useMemo)(()=>e.seenBy(V),[e,V]);no(e,V);let[K]=(0,s.useState)(()=>Kn(c)),[Z,z]=(0,s.useState)(!1),pe=(0,s.useCallback)(()=>z(!0),[]),R=(0,s.useMemo)(()=>g?[...p,...Bn]:p,[p,g]),[j]=(0,s.useState)(()=>n??vt(t,e.schema)),[ee,te]=(0,s.useState)(()=>_e(j??oe,r??j?.selection??[])),ye=(0,s.useRef)(j??oe).current,[Ot,ho]=(0,s.useState)(null),[Vt,wo]=(0,s.useState)(null),Re=(0,s.useContext)(We),[_t]=(0,s.useState)(()=>Re?.seatTalk??dt(b?.name??e.schema.kinds.join(","))),qe=y??Re?.onKeepLens,Ue=S??Re?.app,Pe=T??Re?.locale,So=b?.locale??Ue?.brand?.locale;on({reader:Pe,app:So});let Ct=(0,s.useRef)(null),It=(0,s.useCallback)(u=>{Ct.current=u},[]),Lt=(0,s.useCallback)(u=>Ct.current?.whereIs(u)??null,[]),[Ht]=(0,s.useState)(()=>Yn()),[Nt]=(0,s.useState)(()=>Xn()),[Ye,vo]=(0,s.useState)(null),[me,Dt]=(0,s.useState)(()=>new Map),ge=(0,s.useRef)(me);ge.current=me;let he=(0,s.useRef)(null),Xe=(0,s.useCallback)(u=>x.graph.getNode(u)?.kind,[x]),U=(0,s.useCallback)(u=>{let m=pt(ge.current,u,Xe);ge.current=m,Dt(m),he.current&&clearTimeout(he.current),[...m.values()].some(A=>A.mode!=="docked"&&A.mode!=="asking")&&(he.current=setTimeout(()=>{let A=pt(ge.current,{type:"rest",at:Date.now(),holdMs:St},Xe);ge.current=A,Dt(A)},St+20))},[Xe]),jt=(0,s.useCallback)(u=>U({...u,at:u.at??Date.now()}),[U]),Gt=(0,s.useCallback)(u=>{vo(u),u&&U({type:"home",author:{kind:"agent",id:u,session:K},at:Date.now()})},[U,K]);(0,s.useEffect)(()=>x.subscribe((u,m)=>{for(let P of m)P.author.kind==="agent"&&U({type:"write",author:P.author,ids:P.writes,at:Date.now()})}),[x,U]),(0,s.useEffect)(()=>()=>{he.current&&clearTimeout(he.current)},[]);let q=(0,s.useMemo)(()=>({...V,session:K}),[V,K]),Wt=(0,s.useCallback)(u=>{D(u),d?.(u)},[d]),[we,bo]=(0,s.useState)(()=>Object.fromEntries(R.map(u=>[u.name,Dn(u,c)])));(0,s.useEffect)(()=>{for(let u of R)Gn(u,we[u.name]??u.initial)},[R,we]);let Ft=(0,s.useCallback)((u,m)=>{let P=R.find(A=>A.name===u);!P||!P.options.some(A=>A.value===m)||(jn(P,m,c),bo(A=>({...A,[u]:m})))},[R,c]),[Kt,xo]=(0,s.useState)(null),{activity:Bt,noteAttention:$t}=Un(x),zt=(0,s.useCallback)(u=>{$t(u),U({type:"read",author:u.author,ids:u.reads,at:Date.now()})},[$t,U]),ne=(0,s.useCallback)(u=>{if(re(u)!==null||Q(u).length>0||tt(u))return!0;let m=yn(u);return m?x.graph.allEdges().some(P=>P.kind===m.kind&&P.from===m.from&&P.to===m.to):x.graph.getNode(u)!==void 0},[x]),qt=(0,s.useCallback)(u=>{let m=u.selection??gt,P=m.filter(ne),A=P.length===m.length?u:_e(u,P);return A.focusId!==null&&!ne(A.focusId)&&(A=X(A,null)),A},[ne]),Se=(0,s.useCallback)(u=>{let m=qt(u),P=Qn(x,q,m.shown);if(m.focusId!==null&&P.size>0){let A=Q(m.focusId),nn=x.graph.getNode(m.focusId);(A.length>0?A.every(Po=>P.has(Po)):nn?P.has(nn.kind):!1)&&(m={...m,focusId:null})}if(!m.overview&&m.focusId===null){let A=ye.focusId!==null&&!ne(ye.focusId)?vt(t,e.schema)??{...oe,overview:!0}:ye;A.focusId!==null&&ne(A.focusId)?m={...m,focusId:A.focusId}:A.overview===!0&&(m={...m,overview:!0})}return m},[qt,ne,x,ye,q,t,e.schema]),F=Se(C??ee),Ut=(0,s.useMemo)(()=>Qn(x,q,F.shown),[x,q,F.shown]),Yt=(0,s.useMemo)(()=>[...x.modules.administered.entries()].map(([u,m])=>{let P=x.mayAdminister(u,q);return{name:u,...m.description?{description:m.description}:{},kinds:m.kinds??[],canShow:P,shown:P&&(F.shown??[]).includes(u)}}),[x,q,F.shown]),ve=(0,s.useCallback)(u=>{let m=P=>Se(typeof u=="function"?u(P):u);if(C!==void 0){O?.(m(C));return}O&&O(m(F)),te(P=>m(P))},[F,O,C,Se]);(0,s.useEffect)(()=>{C===void 0&&te(u=>{let m=Se(u);return m===u?u:m})},[F,C,Se]);let Xt=F.selection??gt,Jt=(0,s.useCallback)(u=>{ve(m=>_e(m,typeof u=="function"?u(m.selection??gt):u))},[ve]),{who:Zt,following:Qt,follow:en,sayWhere:Eo,sharing:tn}=$n({channel:g,store:x,view:F,principal:q,session:K,robots:me,seatWho:Ye,settingValues:we,setView:ve,seats:a,people:l,...f!==void 0?{ttlMs:f}:{}}),Ro=(0,s.useMemo)(()=>({store:x,scheme:o,views:t,view:F,setView:ve,homeView:ye,selection:Xt,setSelection:Jt,menuAt:Ot,setMenuAt:ho,whereIs:Lt,pointer:Ht,motion:Nt,registerScene:It,robots:me,noteSeat:jt,seatWho:Ye,registerSeatWho:Gt,actsDoor:Vt,registerActsDoor:wo,seatTalk:_t,...c?{memory:c}:{},who:Zt,following:Qt,follow:en,sayWhere:Eo,sharing:tn,session:K,ai:h,resolveApp:M,movedByHand:Z,noteMoved:pe,emphasis:Kt,setEmphasis:xo,activity:Bt,noteAttention:zt,principal:q,seats:a,people:l,takeSeat:Wt,settings:R,settingValues:we,chooseSetting:Ft,hiddenKinds:Ut,administered:Yt,...v?{providers:v}:{},...b?{brand:b}:{},...qe?{onKeepLens:qe}:{},app:Ue,...Pe?{locale:Pe}:{}}),[x,o,t,F,ve,Xt,Jt,Ot,Lt,Ht,Nt,It,me,jt,Ye,Gt,Vt,_t,c,Zt,Qt,en,tn,K,h,M,Z,pe,Kt,Bt,zt,q,a,l,Wt,R,we,Ft,Ut,Yt,v,b,qe,Ue,Pe]);return(0,le.jsx)(We.Provider,{value:Ro,children:(0,le.jsx)(Sr,{children:E?(0,le.jsx)(De.Provider,{value:E,children:W}):W})})}var oo=(0,s.createContext)(null),ht,wt=new Set,mr=e=>(wt.add(e),()=>void wt.delete(e)),Jn=()=>ht;function gr(e){if(!ht){ht=e;for(let t of[...wt])t()}}var hr=300;function wr(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,hr)),r===t?e(n,o):[]}}function Sr({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=J(),l=Fe(),c=n.q,f=n.focusId,S=!!(c&&c.trim().length>0),p=(0,s.useSyncExternalStore)(mr,Jn,Jn),g=(0,s.useMemo)(()=>S&&p?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,l,S,p]),b=f?t.graph.getNode(f)?.kind??re(f)??(Q(f).length===1?Q(f)[0]:void 0):void 0,T=(0,s.useMemo)(()=>d.near&&wr(d.near),[d.near]),y=(0,s.useMemo)(()=>!c||!g||!p?null:p.search(t,c,{...b?{inKind:b}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:T}),[t,c,r,o,i,a,f,b,g,T]),[v,h]=(0,s.useState)();return(0,s.useEffect)(()=>void y?.later?.then(E=>h([y,E])),[y]),(0,le.jsx)(oo.Provider,{value:v?.[0]===y?v[1]:y,children:e})}var Zn=new WeakMap;function Gi(e){let t=Zn.get(e);return t||Zn.set(e,t=new Set(e.matched)),t}function vr(){return(0,s.useContext)(oo)}function J(){let e=(0,s.useContext)(We);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function br(){return(0,s.useContext)(We)??null}function Fe(){let{store:e}=J(),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,s.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,s.useSyncExternalStore)(r,o,o)}function xr(e){let{store:t}=J(),n=(0,s.useCallback)(r=>t.subscribe(r),[t]),o=(0,s.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,s.useSyncExternalStore)(n,o,o)}function Qn(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var St=2600;function vt(e,t){let n=cn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...oe,focusId:ie(n.place.kind),within:{view:n.place.as}}:{...oe,focusId:ie(n.kind)}}var ro=H(G(),1),Er=(0,ro.createContext)(!1);var Ke=Symbol.for("graview.default-view");function io(e){return Object.defineProperty(e,Ke,{value:!0,enumerable:!1}),e}function ao(e){return typeof e=="function"&&e[Ke]===!0}var bt=Symbol.for("graview.replaces-page");function so(e){return typeof e=="function"&&e[bt]===!0}function Pr(e){return dn(e)}function Ar(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var de=H(G(),1);function kr(){let{selection:e,setSelection:t}=J();return(0,de.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function Tr(){let{store:e}=J(),t=Fe();return(0,de.useMemo)(()=>Mr(e),[e,t])}var lo=new WeakMap;function Mr(e){let t=lo.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),lo.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Or(){let{view:e,setView:t}=J();return(0,de.useMemo)(()=>({view:e,url:Y(e),focus:n=>t(o=>X(o,n)),show:n=>t(o=>mn(o,n)),toggle:n=>t(o=>Ce(o,n)),go:n=>t(n)}),[e,t])}var ue={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;ue.at=typeof t?.graview=="number"?t.graview:0,ue.at>ue.depth&&(ue.depth=ue.at),ue.tell()});var L=H(G(),1),Et={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},Vr={position:"fixed",inset:"auto",margin:0,zIndex:sn("popover"),boxSizing:"border-box"},Be=6,ce=8,_r=e=>typeof e.showPopover=="function";function $e(e){try{return e.matches(":popover-open")}catch{return!1}}function Cr(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function Rt(e,t,n={}){let o=Cr(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),d=r.height-o.bottom-Be-ce,l=o.top-Be-ce,c=a.height<=d||d>=l,f=Math.max(96,Math.floor(c?d:l)),S=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,b=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();b&&p<=b.right-b.left&&(g<b.left?g=o.left+p<=b.right?o.left:b.left:g+p>b.right&&(g=o.right-p>=b.left?o.right-p:b.right-p));let T=p>=r.width-2*ce?Math.max(0,(r.width-p)/2):Math.max(ce,Math.min(g,r.width-ce-p)),y=c?o.bottom+Be:Math.max(ce,o.top-Be-S);e.style.left=`${Math.round(T)}px`,e.style.top=`${Math.round(y)}px`}function uo(e,t,n,o={}){let r=o.align??"end";(0,L.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(_r(i)&&!$e(i))try{i.showPopover(),Lr()}catch{}let a=0,d=c=>{c?.target instanceof Node&&i.contains(c.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>Rt(i,n,{align:r})))};Rt(i,n,{align:r}),addEventListener("resize",d),addEventListener("scroll",d,!0);let l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>d());return l?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",d),removeEventListener("scroll",d,!0),l?.disconnect(),i.isConnected&&$e(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Pt=new Set;function Ir(e){return Pt.add(e),()=>Pt.delete(e)}function Lr(){for(let e of Pt)if(!(!e.isConnected||!$e(e)))try{e.hidePopover(),e.showPopover()}catch{}}var fe=null,Hr='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Nr(e){for(let t of e.querySelectorAll(Hr))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var xt=()=>{let e=document.activeElement;return e===null||e===document.body};function Dr(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,d]=(0,L.useState)(!1),l=t.open??a,c=(0,L.useRef)(null),f=(0,L.useRef)(null),S=(0,L.useCallback)(h=>{c.current=h},[]),p=(0,L.useCallback)(h=>{f.current=h},[]),g=`graview-popover-${(0,L.useId)().replace(/:/g,"")}`,b=(0,L.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});b.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let T=(0,L.useCallback)(h=>{b.current.controlled||d(h),b.current.onOpenChange?.(h)},[]),y=(0,L.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??c.current??b.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),v=(0,L.useCallback)(h=>{let E=f.current,M=typeof document>"u"?null:document.activeElement,C=M===null||M===document.body||E!==null&&E.contains(M);T(!1),!(!h||!C)&&(y(),requestAnimationFrame(()=>{xt()&&y()}))},[T,y]);return uo(f,i&&l,n??c,t.align?{align:t.align}:{}),(0,L.useEffect)(()=>{if(!i||!l)return;let h={name:e,close:()=>v(!1)};if(fe&&fe.close!==h.close&&fe.close(),fe=h,Et[e].focus==="into"){let I=f.current;I&&!I.contains(document.activeElement)&&Nr(I).focus({preventScroll:!0})}let E=I=>{I.key==="Escape"&&v(!0)},M=I=>{let D=I.target;if(!(D instanceof Node))return;let V=f.current;if(V?.contains(D)||c.current?.contains(D))return;let x=D instanceof Element?D.closest('[role="dialog"], [role="alertdialog"]'):null;x&&!(V&&x.contains(V))||(v(!1),Et[e].focus==="into"&&requestAnimationFrame(()=>{(xt()||V!==null&&V.contains(document.activeElement))&&y()}))},C=null,O=null,W=I=>{let D=I.target;if(!(D instanceof Element))return;let V=f.current,x=D.closest('[role="dialog"], [role="alertdialog"]');!x||V&&(V.contains(x)||x.contains(V))||(C=x,v(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",M,!0),document.addEventListener("focusin",W),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",M,!0),document.removeEventListener("focusin",W);let I=C;I&&typeof MutationObserver<"u"&&(O?.disconnect(),O=new MutationObserver(()=>{I.isConnected||(O?.disconnect(),requestAnimationFrame(()=>{(xt()||document.activeElement.closest("[hidden]")!==null)&&y()}))}),O.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>O?.disconnect(),10*6e4)),fe?.close===h.close&&(fe=null)}},[i,l,e,v,y]),{open:l,setOpen:h=>h?T(!0):v(!0),toggle:()=>l?v(!0):T(!0),trigger:{ref:S,"aria-expanded":l,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var N=H(G(),1),$=H(xe(),1),At=new Set,co=!1;function kt(){for(let e of[...At])e()}function jr(){co||typeof window>"u"||(co=!0,window.addEventListener("online",kt))}function Gr(e){let t,n=!1,o=!1,r,i=0,a=new Set,d=()=>{i+=1;for(let p of[...a])p()},l=p=>(a.add(p),()=>void a.delete(p)),c=()=>i,f=()=>void S().catch(()=>{});function S(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,At.delete(f),d(),g),g=>{throw r=void 0,o=!0,At.add(f),jr(),d(),g});return p.catch(()=>{}),r=p,p}return{load:S,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let b=g.what??"This part";function T(h){(0,N.useSyncExternalStore)(l,c,c);let E=(0,N.useRef)(null),M=(0,N.useRef)(null),C=(0,N.useRef)(!1);return(0,N.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&E.current!==null&&document.activeElement===E.current&&(C.current=!0),(0,N.useLayoutEffect)(()=>{if(!(!n||!C.current)){C.current=!1;for(let O=M.current?.nextElementSibling??null;O!==null;O=O.nextElementSibling){let W=O.matches(fo)?O:O.querySelector(fo);if(W instanceof HTMLElement){W.focus();return}}}}),n?(0,$.jsxs)($.Fragment,{children:[C.current?(0,$.jsx)("span",{ref:M,hidden:!0}):null,p(t,h)]}):g.quiet?null:(0,$.jsx)(Wr,{what:b,button:E,...g.as?{as:g.as}:{}})}let y=(0,N.lazy)(()=>S().then(()=>({default:T}),()=>({default:T})));function v(h){let[E]=(0,N.useState)(()=>n||o);return(0,N.createElement)(E?T:y,h)}return v}}}var fo="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Wr({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,$.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,$.jsx)("span",{role:"status",children:r})," ",(0,$.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:kt,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var ze=H(G(),1);var Fr=(0,ze.createContext)(null);var po=H(G(),1),Kr=(0,po.createContext)(!1);var yo=H(G(),1),Br=(0,yo.createContext)(null);var mo=H(G(),1),Tt='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Mt=e=>e instanceof HTMLElement&&(e.matches(Tt)||e.hasAttribute("tabindex")),Ee=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function $r(e,t){let n=l=>l.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let d=e.querySelector(a);return d&&Mt(d)&&Ee(d)?d:null}var zr=e=>e.isConnected&&Mt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Ee(e);function go(e,t){let n=t?$r(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Ee(o))return o;for(let r of e.querySelectorAll(Tt))if(Ee(r))return r;return Mt(e)&&Ee(e)?e:null}function qr(e){(0,mo.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=y=>{let v=y.target;if(v instanceof Element){n=[];for(let h=v;h&&h!==t.parentElement;h=h.parentElement)n.push(h)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,l=(y,v)=>void setTimeout(()=>d()&&v(),y),c=y=>void requestAnimationFrame(()=>d()&&y()),f=y=>{if(r=!1,i)return;let v=a.activeElement;if(!(!(v===null||v===a.body||v===a.documentElement)||n.length===0)){if(zr(n[0])){y&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let M=go(E,n[0]);if(M){M.focus({preventScroll:!0}),n=[];return}}}},S=(y,v=Date.now()+2500)=>{l(100,()=>{f(y);let h=a.activeElement;(h===null||h===a.body||h===a.documentElement)&&n.length>0&&Date.now()<v&&S(y,v)})},p=()=>{r||n.length===0||(r=!0,l(60,()=>c(()=>{f(!1),S(!1)})))},g=y=>{if(!(y instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(y.key))){if(!(y instanceof KeyboardEvent)){let v=y.target instanceof Element?y.target.closest(Tt):null,h=a.activeElement,E=h===null||h===a.body||h===a.documentElement;if(v&&E&&t.contains(v)){n=[];for(let M=v;M&&M!==t.parentElement;M=M.parentElement)n.push(M);l(150,()=>c(()=>{f(!1),S(!1)}));return}}!(y instanceof KeyboardEvent)&&!(y.target instanceof Node&&n[0]?.contains(y.target))||l(150,()=>c(()=>{f(!0),S(!0)}))}},b=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),T=y=>{y.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",T),t.addEventListener("click",g),t.addEventListener("keydown",g),b.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",T),t.removeEventListener("click",g),t.removeEventListener("keydown",g),b.disconnect()}},[e])}export{oe as a,Y as b,Oe as c,Yr as d,Xr as e,pn as f,fn as g,yn as h,Ze as i,X as j,mn as k,Ve as l,Qe as m,_e as n,be as o,Ce as p,Le as q,et as r,re as s,Qr as t,ko as u,ie as v,gn as w,Q as x,hn as y,To as z,ei as A,wn as B,tt as C,Qo as D,er as E,G as F,dt as G,Uo as H,Yo as I,_n as J,De as K,Xo as L,xe as M,ur as N,dr as O,no as P,yr as Q,gr as R,Gi as S,vr as T,J as U,br as V,Fe as W,xr as X,vt as Y,Fr as Z,Er as _,io as $,ao as aa,so as ba,Pr as ca,Ar as da,Kr as ea,Br as fa,kr as ga,Tr as ha,Or as ia,ue as ja,qr as ka,Vr as la,$e as ma,Ir as na,Dr as oa,Gr as pa};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
react/cjs/react.production.js:
|
|
5
|
-
(**
|
|
6
|
-
* @license React
|
|
7
|
-
* react.production.js
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*)
|
|
14
|
-
|
|
15
|
-
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
-
(**
|
|
17
|
-
* @license React
|
|
18
|
-
* react-jsx-runtime.production.js
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*)
|
|
25
|
-
*/
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{F as g,M as u}from"./chunk.Z56B2JR2.js";import{b as m}from"./chunk.AJZBJBMO.js";var d=m(g(),1),n=m(u(),1),f=/^\s*(\d{1,6})[.)]\s+(.*)$/s,c=/^\s*[-*•]\s+(.*)$/s;function S(o){let s=[];for(let p of o.replace(/\r\n?/g,`
|
|
2
|
-
`).split(/\n[ \t]*\n+/)){let t=null,a=()=>{t&&(t.t==="p"?t.lines.length>0:t.items.length>0)&&s.push(t),t=null};for(let e of p.split(`
|
|
3
|
-
`)){let i=f.exec(e),l=i?null:c.exec(e);if(i)t?.t!=="ol"&&(a(),t={t:"ol",start:Number(i[1]),items:[]}),t.items.push(i[2]);else if(l)t?.t!=="ul"&&(a(),t={t:"ul",items:[]}),t.items.push(l[1]);else if(t&&t.t!=="p"&&/^\s+\S/.test(e)){let r=t.items;r[r.length-1]=`${r[r.length-1]} ${e.trim()}`}else e.trim().length>0&&(t?.t!=="p"&&(a(),t={t:"p",lines:[]}),t.lines.push(e.trim()))}a()}return s}function b(o){return/[\r\n]/.test(o)}var h={display:"grid",gap:"0.7em",minWidth:0,overflowWrap:"anywhere"},k={margin:0},y={margin:0,paddingInlineStart:"1.6em",display:"grid",gap:"0.3em"},x=(0,d.lazy)(()=>import("./chunk.O4QPITBD.js"));function B({text:o,className:s,style:p,markdown:t,headingsFrom:a}){return t?(0,n.jsx)(d.Suspense,{fallback:(0,n.jsx)(B,{text:o,...s?{className:s}:{},...p?{style:p}:{}}),children:(0,n.jsx)(x,{text:o,...s?{className:s}:{},...p?{style:p}:{},...a?{headingsFrom:a}:{}})}):(0,n.jsx)("div",{"data-graview-text-body":"",...s?{className:s}:{},style:{...h,...p},children:S(o).map((e,i)=>e.t==="p"?(0,n.jsx)("p",{style:k,children:e.lines.map((l,r)=>(0,n.jsxs)("span",{children:[r>0?(0,n.jsx)("br",{}):null,l]},r))},i):e.t==="ol"?(0,n.jsx)("ol",{start:e.start,style:y,children:e.items.map((l,r)=>(0,n.jsx)("li",{children:l},r))},i):(0,n.jsx)("ul",{style:y,children:e.items.map((l,r)=>(0,n.jsx)("li",{children:l},r))},i))})}export{b as a,B as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.V6TK4LHW.js";import"./chunk.G4JJXA63.js";import"./chunk.YRQZZH5V.js";import"./chunk.HONUT6OG.js";import"./chunk.X53HI436.js";import"./chunk.COTG2IG5.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.Z2RGLFLS.js";import"./chunk.UTHHX2TJ.js";import"./chunk.YCA7P5MK.js";import"./chunk.WVUJXDXZ.js";import"./chunk.DAA6XWLF.js";import"./chunk.7DNFXJH3.js";import"./chunk.7PRFYYVM.js";import"./chunk.2NCTM5K2.js";import"./chunk.JU2ZVKMT.js";import"./chunk.ZS4DJ76C.js";import"./chunk.5R66YTET.js";import"./chunk.G4WQGTZR.js";import"./chunk.HFKMHLJ3.js";import"./chunk.HLLWKSZB.js";import"./chunk.AJZBJBMO.js";export{i as draftAnswer,h as draftFromLens,b as draftSight,l as draftView,a as isDraftFailure,c as judgeLens,d as lensEditOf,f as lensFromSpec,j as recipeDraft,g as recipeOfLens,m as refineDraft,o as runDraftTool,e as takeBackEditOf,k as templateDraft,n as withReaderLenses};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import{a as Rt,c as wt,d as oe}from"./chunk.MOUGB4H6.js";import{a as xr}from"./chunk.T4LY5QXO.js";import{a as ut}from"./chunk.3G5MQFZK.js";import{d as dt}from"./chunk.5R66YTET.js";import{d as ct}from"./chunk.G4WQGTZR.js";import{e as st,j as ft,k as ht,n as mt,o as pt,p as yt,y as gt,z as vt}from"./chunk.GS4T26WW.js";import{F as M,M as G,V as lt}from"./chunk.Z56B2JR2.js";import{$ as ne,$b as tt,Gb as et,Y as Se,ac as rt,bc as at,pc as nt,qc as ot,rc as it,wa as Ze,yb as qe}from"./chunk.HLLWKSZB.js";import{b as D}from"./chunk.AJZBJBMO.js";function Pr(e,t){return tt(e,t).slice(1)}function be(e,t){return e.kinds.find(r=>Pr(e,r)===t)}function yn(e,t,r){return rt(e,t,r)}function gn(e,t){return at(e,t)}var A=D(M(),1),g=D(M(),1),E=D(M(),1),je=D(M(),1),rr=D(M(),1),b=D(M(),1),Ja=D(M(),1),Ka=D(M(),1),Ga=D(M(),1),v=D(M(),1),mr=D(M(),1);var ke=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ft=/^[\\/]{2}/;function Cr(e,t){return t+e.replace(/\\/g,"/")}var St="popstate";function ce(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function kt(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((f,y)=>c(f,typeof f=="string"?null:f.state,y===0?"default":void 0,typeof f=="string"?void 0:f.mask));let o=s(r??n.length-1),i="POP",l=null;function s(f){return Math.min(Math.max(f,0),n.length-1)}function u(){return n[o]}function c(f,y=null,m,h){let S=de(n?u().pathname:"/",f,y,m,h);return N(S.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(f)}`),S}function d(f){return typeof f=="string"?f:U(f)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(f){return new URL(d(f),"http://localhost")},encodeLocation(f){let y=typeof f=="string"?z(f):f;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(f,y){i="PUSH";let m=ce(f)?f:c(f,y);o+=1,n.splice(o,n.length,m),a&&l&&l({action:i,location:m,delta:1})},replace(f,y){i="REPLACE";let m=ce(f)?f:c(f,y);n[o]=m,a&&l&&l({action:i,location:m,delta:0})},go(f){i="POP";let y=s(o+f),m=n[y];o=y,l&&l({action:i,location:m,delta:f})},listen(f){return l=f,()=>{l=null}}}}function Tt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return de("",{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:U(n)}return Dr(t,r,null,e)}function P(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function N(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Lr(){return Math.random().toString(36).substring(2,10)}function bt(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 de(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?z(t):t,state:r,key:t&&t.key||a||Lr(),mask:n}}function U({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 z(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 Dr(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 h=c(),S=h==null?null:h-u;u=h,s&&s({action:l,location:m.location,delta:S})}function p(h,S){l="PUSH";let R=ce(h)?h:de(m.location,h,S);r&&r(R,h),u=c()+1;let w=bt(R,u),x=m.createHref(R.mask||R);try{i.pushState(w,"",x)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;n.location.assign(x)}o&&s&&s({action:l,location:m.location,delta:1})}function f(h,S){l="REPLACE";let R=ce(h)?h:de(m.location,h,S);r&&r(R,h),u=c();let w=bt(R,u),x=m.createHref(R.mask||R);i.replaceState(w,"",x),o&&s&&s({action:l,location:m.location,delta:0})}function y(h){return Fr(n,h)}let m={get action(){return l},get location(){return e(n,i)},listen(h){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(St,d),s=h,()=>{n.removeEventListener(St,d),s=null}},createHref(h){return t(n,h)},createURL:y,encodeLocation(h){let S=y(h);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:f,go(h){return i.go(h)}};return m}function Fr(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),P(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:U(t);return n=n.replace(/ $/,"%20"),!r&&Ft.test(n)&&(n=a+n),new URL(n,a)}var kr;kr=new WeakMap;function Te(e,t,r="/"){return Tr(e,t,r,!1)}function Tr(e,t,r,a,n){let o=typeof t=="string"?z(t):t,i=H(o.pathname||"/",r);if(i==null)return null;let l=n??Or(e),s=null,u=Wr(i);for(let c=0;s==null&&c<l.length;++c)s=Br(l[c],u,a);return s}function Nr(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 Or(e){let t=Nt(e);return Mr(t),t}function Nt(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;P(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=$([a,c.relativePath]),p=r.concat(c);i.children&&i.children.length>0&&(P(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Nt(i.children,t,p,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:jr(d,i.index),routesMeta:p.map((f,y)=>{let[m,h]=At(f.relativePath,f.caseSensitive,y===p.length-1);return{...f,matcher:m,compiledParams:h}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Ot(i.path))o(i,l,!0,s)}),t}function Ot(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=Ot(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 Mr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:zr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Ar=/^:[\w-]+$/,_r=3,$r=2,Ir=1,Hr=10,Ur=-2,Et=e=>e==="*";function jr(e,t){let r=e.split("/"),a=r.length;return r.some(Et)&&(a+=Ur),t&&(a+=$r),r.filter(n=>!Et(n)).reduce((n,o)=>n+(Ar.test(o)?_r:o===""?Ir:Hr),a)}function zr(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 Br(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},p=s.matcher&&s.compiledParams?Mt(d,c,s.matcher,s.compiledParams):te(d,c),f=s.route;if(!p&&u&&r&&!a[a.length-1].route.index&&(p=te({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!p)return null;Object.assign(n,p.params),i.push({params:n,pathname:$([o,p.pathname]),pathnameBase:Vr($([o,p.pathnameBase])),route:f}),p.pathnameBase!=="/"&&(o=$([o,p.pathnameBase]))}return i}function te(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=At(e.path,e.caseSensitive,e.end);return Mt(e,t,r,a)}function Mt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=X(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},p)=>{if(c==="*"){let y=l[p]||"";i=X(o.slice(0,o.length-y.length),1)}let f=l[p];return d&&!f?u[c]=void 0:u[c]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function At(e,t=!1,r=!0){N(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 Wr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return N(!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 H(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 _t(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?z(e):e,o;return r?(r=$t(r),r.startsWith("/")||r.startsWith("\\")?o=xt(r.substring(1),"/"):o=xt(r,t)):o=t,{pathname:o,search:Jr(a),hash:Kr(n)}}function xt(e,t){let r=X(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Ee(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 Yr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ne(e){let t=Yr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function me(e,t,r,a=!1){let n;typeof e=="string"?n=z(e):(n={...e},P(!n.pathname||!n.pathname.includes("?"),Ee("?","pathname","search",n)),P(!n.pathname||!n.pathname.includes("#"),Ee("#","pathname","hash",n)),P(!n.search||!n.search.includes("#"),Ee("#","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 p=i.split("/");for(;p[0]==="..";)p.shift(),d-=1;n.pathname=p.join("/")}l=d>=0?t[d]:"/"}let s=_t(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var $t=e=>e.replace(/[\\/]{2,}/g,"/"),$=e=>$t(e.join("/"));function X(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 Vr=e=>X(e).replace(/^\/*/,"/"),Jr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Kr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var It=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 Ht(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Gr(e){let t=e.map(r=>r.route.path).filter(Boolean);return $(t)||"/"}var Ut=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jt(e,t){let r=e;if(typeof r!="string"||!ke.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Ut)try{let o=new URL(window.location.href),i=Ft.test(r)?new URL(Cr(r,o.protocol)):new URL(r),l=H(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{N(!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 Rn=Symbol("Uninstrumented");var wn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Pt=new URL("http://localhost");function Oe(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Pt)}catch{return Pt}}function xe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function Xr(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 Me(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&&!xe(n,r),l=!xe(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!Xr(e,n)||!xe(n,o)))throw new Error("External navigation is not allowed")}var zt=["POST","PUT","PATCH","DELETE"],Sn=new Set(zt),Qr=["GET",...zt],bn=new Set(Qr);var En=Symbol("ResetLoaderData"),Zr,qr,ea,ta;Zr=new WeakMap;qr=new WeakMap;ea=new WeakMap;ta=new WeakMap;var ra=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function aa(e){try{return ra.includes(new URL(e).protocol)}catch{return!1}}var W=A.createContext(null);W.displayName="DataRouter";var Q=A.createContext(null);Q.displayName="DataRouterState";var Bt=A.createContext(!1);function na(){return A.useContext(Bt)}var Ae=A.createContext({isTransitioning:!1});Ae.displayName="ViewTransition";var Wt=A.createContext(new Map);Wt.displayName="Fetchers";var oa=A.createContext(null);oa.displayName="Await";var T=A.createContext(null);T.displayName="Navigation";var Y=A.createContext(null);Y.displayName="Location";var _=A.createContext({outlet:null,matches:[],isDataRoute:!1});_.displayName="Route";var _e=A.createContext(null);_e.displayName="RouteError";var Le=!0,Yt="REACT_ROUTER_ERROR",ia="REDIRECT",la="ROUTE_ERROR_RESPONSE";function sa(e){if(e.startsWith(`${Yt}:${ia}:{`))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 ua(e){if(e.startsWith(`${Yt}:${la}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new It(t.status,t.statusText,t.data)}catch{}}function pe(e,{relative:t}={}){P(V(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(T),{hash:n,pathname:o,search:i}=Z(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:$([r,o])),a.createHref({pathname:l,search:i,hash:n})}function V(){return g.useContext(Y)!=null}function k(){return P(V(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(Y).location}function ca(){return g.useContext(Y).navigationType}var Vt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jt(e){g.useContext(T).static||g.useLayoutEffect(e)}function J(){let{isDataRoute:e}=g.useContext(_);return e?Sa():da()}function da(){P(V(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(W),{basename:t,navigator:r}=g.useContext(T),{matches:a}=g.useContext(_),{pathname:n}=k(),o=JSON.stringify(Ne(a)),i=g.useRef(!1);return Jt(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(N(i.current,Vt),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=me(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:$([t,c.pathname])),Me(typeof s=="string"?s:U(s),r.createHref(c),Oe(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var xn=g.createContext(null);function fa(){let{matches:e}=g.useContext(_);return e[e.length-1]?.params??{}}function Z(e,{relative:t}={}){let{matches:r}=g.useContext(_),{pathname:a}=k(),n=JSON.stringify(Ne(r));return g.useMemo(()=>me(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Kt(e,t){return Gt(e,t)}function Gt(e,t,r){P(V(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(T),{matches:n}=g.useContext(_),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Le){let h=u&&u.path||"";qt(l,!u||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${h}">) 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
|
-
|
|
3
|
-
Please change the parent <Route path="${h}"> to <Route path="${h==="/"?"*":`${h}/*`}">.`)}let c=k(),d;if(t){let h=typeof t=="string"?z(t):t;P(s==="/"||h.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 "${h.pathname}" was given in the \`location\` prop.`),d=h}else d=c;let p=d.pathname||"/",f=p;if(s!=="/"){let h=s.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(h.length).join("/")}let y=r&&r.state.matches.length?r.state.matches.map(h=>Object.assign(h,{route:r.manifest[h.route.id]||h.route})):Te(e,{pathname:f});Le&&(N(u||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),N(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 m=ga(y&&y.map(h=>Object.assign({},h,{params:Object.assign({},i,h.params),pathname:$([s,a.encodeLocation?a.encodeLocation(h.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?s:$([s,a.encodeLocation?a.encodeLocation(h.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathnameBase])})),n,r);return t&&m?g.createElement(Y.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},m):m}function ha(){let e=Zt(),t=Ht(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 Le&&(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 ma=g.createElement(ha,null),Xt=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=ua(e.digest);r&&(e=r)}let t=e!==void 0?g.createElement(_.Provider,{value:this.props.routeContext},g.createElement(_e.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(pa,{error:e},t):t}};Xt.contextType=Bt;var Pe=new WeakMap;function pa({children:e,error:t}){let{basename:r,navigator:a}=g.useContext(T);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=sa(t.digest);if(n){let o=Pe.get(t);if(o)throw o;let i=jt(n.location,r),l=i.absoluteURL||i.to;if(Me(n.location,l,Oe(a),"allow-explicit"),aa(l))throw new Error("Invalid redirect location");if(Ut&&!Pe.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 Pe.set(t,s),s}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function ya({routeContext:e,match:t,children:r}){let a=g.useContext(W);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(_.Provider,{value:e},r)}function ga(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);P(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:p,errors:f}=a,y=d.route.loader&&!p.hasOwnProperty(d.route.id)&&(!f||f[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:Gr(a.matches),errorInfo:d})}:void 0;return n.reduceRight((c,d,p)=>{let f,y=!1,m=null,h=null;a&&(f=o&&d.route.id?o[d.route.id]:void 0,m=d.route.errorElement||ma,i&&(l<0&&p===0?(qt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,h=null):l===p&&(y=!0,h=d.route.hydrateFallbackElement||null)));let S=t.concat(n.slice(0,p+1)),R=()=>{let w;return f?w=m:y?w=h:d.route.Component?w=g.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,g.createElement(ya,{match:d,routeContext:{outlet:c,matches:S,isDataRoute:a!=null},children:w})};return a&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(Xt,{location:a.location,revalidation:a.revalidation,component:m,error:f,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:u}):R()},null)}function $e(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function va(e){let t=g.useContext(W);return P(t,$e(e)),t}function Ie(e){let t=g.useContext(Q);return P(t,$e(e)),t}function Ra(e){let t=g.useContext(_);return P(t,$e(e)),t}function He(e){let t=Ra(e),r=t.matches[t.matches.length-1];return P(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function wa(){return He("useRouteId")}function Qt(){let e=Ie("useNavigation");return g.useMemo(()=>{let{matches:t,historyAction:r,...a}=e.navigation;return a},[e.navigation])}function Ue(){let{matches:e,loaderData:t}=Ie("useMatches");return g.useMemo(()=>e.map(r=>Nr(r,t)),[e,t])}function Zt(){let e=g.useContext(_e),t=Ie("useRouteError"),r=He("useRouteError");return e!==void 0?e:t.errors?.[r]}function Sa(){let{router:e}=va("useNavigate"),t=He("useNavigate"),r=g.useRef(!1);return Jt(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{N(r.current,Vt),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Ct={};function qt(e,t,r){!t&&!Ct[e]&&(Ct[e]=!0,N(!1,r))}var ba="useOptimistic",Pn=E[ba];var Cn=E.memo(Ea);function Ea({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return Gt(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function xa({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=E.useRef();o.current==null&&(o.current=kt({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=E.useState({action:i.action,location:i.location}),u=E.useCallback(c=>{n===!1?s(c):E.startTransition(()=>s(c))},[n]);return E.useLayoutEffect(()=>i.listen(u),[i,u]),E.createElement(ye,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function Pa({to:e,replace:t,state:r,relative:a}){P(V(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=E.useContext(T);N(!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}=E.useContext(_),{pathname:l}=k(),s=J(),u=me(e,Ne(i),l,a==="path");Me(typeof e=="string"?e:U(e),o.createHref(u),Oe(o),"reject");let c=JSON.stringify(u);return E.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function er(e){P(!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 ye({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){P(!V(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=E.useMemo(()=>({basename:l,navigator:n,static:o,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=z(r));let{pathname:u="/",search:c="",hash:d="",state:p=null,key:f="default",mask:y}=r,m=E.useMemo(()=>{let h=H(u,l);return h==null?null:{location:{pathname:h,search:c,hash:d,state:p,key:f,mask:y},navigationType:a}},[l,u,c,d,p,f,a,y]);return N(m!=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.`),m==null?null:E.createElement(T.Provider,{value:s},E.createElement(Y.Provider,{children:t,value:m}))}function Ca({children:e,location:t}){return Kt(fe(e),t)}function fe(e,t=[]){let r=[];return E.Children.forEach(e,(a,n)=>{if(!E.isValidElement(a))return;let o=[...t,n];if(a.type===E.Fragment){r.push.apply(r,fe(a.props.children,o));return}P(a.type===er,`[${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>`),P(!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=fe(a.props.children,o)),r.push(i)}),r}var se="get",ue="application/x-www-form-urlencoded";function ge(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function La(e){return ge(e)&&e.tagName.toLowerCase()==="button"}function Da(e){return ge(e)&&e.tagName.toLowerCase()==="form"}function Fa(e){return ge(e)&&e.tagName.toLowerCase()==="input"}function ka(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ta(e,t){return e.button===0&&(!t||t==="_self")&&!ka(e)}function he(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 Na(e,t){let r=he(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var ie=null;function Oa(){if(ie===null)try{new FormData(document.createElement("form"),0),ie=!1}catch{ie=!0}return ie}var Ma=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ce(e){return e!=null&&!Ma.has(e)?(N(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ue}"`),null):e}function Aa(e,t){let r,a,n,o,i;if(Da(e)){let l=e.getAttribute("action");a=l?H(l,t):null,r=e.getAttribute("method")||se,n=Ce(e.getAttribute("enctype"))||ue,o=new FormData(e)}else if(La(e)||Fa(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?H(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||se,n=Ce(e.getAttribute("formenctype"))||Ce(l.getAttribute("enctype"))||ue,o=new FormData(l,e),!Oa()){let{name:u,type:c,value:d}=e;if(c==="image"){let p=u?`${u}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else u&&o.append(u,d)}}else{if(ge(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=se,a=null,n=ue,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var Ln=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _a={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},$a=/[&><\u2028\u2029]/g;function Lt(e){return e.replace($a,t=>_a[t])}function ze(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Ia=Symbol("SingleFetchRedirect");function tr(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&&H(n.pathname,t)==="/"?n.pathname=`${X(t)}/_root.${a}`:n.pathname=`${X(n.pathname)}.${a}`,n}async function Ha(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 Ua(e){return e!=null&&typeof e.page=="string"}function ja(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 za(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await Ha(o,r);return i.links?i.links():[]}return[]}));return Va(a.flat(1).filter(ja).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Dt(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 Ba(e,t,{includeHydrateFallback:r}={}){return Wa(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 Wa(e){return[...new Set(e)]}function Ya(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Va(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Ua(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(Ya(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function Be(){let e=b.useContext(W);return ze(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Xa(){let e=b.useContext(Q);return ze(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var re=b.createContext(void 0);re.displayName="FrameworkContext";function ve(){let e=b.useContext(re);return ze(e,"You must render this element inside a <HydratedRouter> element"),e}function Qa(e,t){let r=b.useContext(re),[a,n]=b.useState(!1),[o,i]=b.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,p=b.useRef(null);b.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let m=S=>{S.forEach(R=>{i(R.isIntersecting)})},h=new IntersectionObserver(m,{threshold:.5});return p.current&&h.observe(p.current),()=>{h.disconnect()}}},[e]),b.useEffect(()=>{if(a){let m=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(m)}}},[a]);let f=()=>{n(!0)},y=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,p,{}]:[o,p,{onFocus:ee(l,f),onBlur:ee(s,y),onMouseEnter:ee(u,f),onMouseLeave:ee(c,y),onTouchStart:ee(d,f)}]:[!1,p,{}]}function ee(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function ar({page:e,...t}){let r=na(),{nonce:a}=ve(),{router:n}=Be(),o=b.useMemo(()=>Te(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?b.createElement(qa,{page:e,matches:o,...t}):b.createElement(en,{page:e,matches:o,...t})):null}function Za(e){let{manifest:t,routeModules:r}=ve(),[a,n]=b.useState([]);return b.useEffect(()=>{let o=!1;return za(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function qa({page:e,matches:t,...r}){let a=k(),{future:n}=ve(),{basename:o}=Be(),i=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=tr(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 b.createElement(b.Fragment,null,i.map(l=>b.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function en({page:e,matches:t,...r}){let a=k(),{future:n,manifest:o,routeModules:i}=ve(),{basename:l}=Be(),{loaderData:s,matches:u}=Xa(),c=b.useMemo(()=>Dt(e,t,u,o,a,"data"),[e,t,u,o,a]),d=b.useMemo(()=>Dt(e,t,u,o,a,"assets"),[e,t,u,o,a]),p=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let m=new Set,h=!1;if(t.forEach(R=>{let w=o.routes[R.route.id];!w||!w.hasLoader||(!c.some(x=>x.route.id===R.route.id)&&R.route.id in s&&i[R.route.id]?.shouldRevalidate||w.hasClientLoader?h=!0:m.add(R.route.id))}),m.size===0)return[];let S=tr(e,l,n.v8_trailingSlashAwareDataRequests,"data");return h&&m.size>0&&S.searchParams.set("_routes",t.filter(R=>m.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[l,n.v8_trailingSlashAwareDataRequests,s,a,o,c,t,e,i]),f=b.useMemo(()=>Ba(d,o),[d,o]),y=Za(d);return b.createElement(b.Fragment,null,p.map(m=>b.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})),f.map(m=>b.createElement("link",{key:m,rel:"modulepreload",href:m,...r})),y.map(({key:m,link:h})=>b.createElement("link",{key:m,nonce:r.nonce,...h,crossOrigin:h.crossOrigin??r.crossOrigin})))}function tn(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var rn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rn&&(window.__reactRouterVersion="7.18.3")}catch{}function an({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=Tt({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(ye,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:r})}function nr({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(ye,{basename:e,children:t,location:n.location,navigationType:n.action,navigator:r,useTransitions:a})}nr.displayName="unstable_HistoryRouter";var ae=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:p,defaultShouldRevalidate:f,...y},m){let{basename:h,navigator:S,useTransitions:R}=v.useContext(T),w=typeof c=="string"&&ke.test(c),x=jt(c,h);c=x.to;let C=pe(c,{relative:n}),F=k(),I=null;if(l){let j=me(l,[],F.mask?F.mask.pathname:"/",!0);h!=="/"&&(j.pathname=j.pathname==="/"?h:$([h,j.pathname])),I=S.createHref(j)}let[K,q,we]=Qa(a,y),br=ur(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:p,defaultShouldRevalidate:f,useTransitions:R});function Er(j){t&&t(j),j.defaultPrevented||br(j)}let Xe=!(x.isExternal||o),Qe=v.createElement("a",{...y,...we,href:(Xe?I:void 0)||x.absoluteURL||C,onClick:Xe?Er:t,ref:tn(m,q),target:u,"data-discover":!w&&r==="render"?"true":void 0});return K&&!w?v.createElement(v.Fragment,null,Qe,v.createElement(ar,{page:C})):Qe});ae.displayName="Link";var or=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=Z(i,{relative:u.relative}),p=k(),f=v.useContext(Q),{navigator:y,basename:m}=v.useContext(T),h=f!=null&&hr(d)&&l===!0,S=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,R=p.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;r||(R=R.toLowerCase(),w=w?w.toLowerCase():null,S=S.toLowerCase()),w&&m&&(w=H(w,m)||w);let x=S!=="/"&&S.endsWith("/")?S.length-1:S.length,C=R===S||!n&&R.startsWith(S)&&R.charAt(x)==="/",F=w!=null&&(w===S||!n&&w.startsWith(S)&&w.charAt(S.length)==="/"),I={isActive:C,isPending:F,isTransitioning:h},K=C?t:void 0,q;typeof a=="function"?q=a(I):q=[a,C?"active":null,F?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let we=typeof o=="function"?o(I):o;return v.createElement(ae,{...u,"aria-current":K,className:q,ref:c,style:we,to:i,viewTransition:l},typeof s=="function"?s(I):s)});or.displayName="NavLink";var ir=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=se,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:p,...f},y)=>{let{useTransitions:m}=v.useContext(T),h=cr(),S=dr(l,{relative:u}),R=i.toLowerCase()==="get"?"get":"post",w=typeof l=="string"&&ke.test(l);return v.createElement("form",{ref:y,method:R,action:S,onSubmit:a?s:C=>{if(s&&s(C),C.defaultPrevented)return;C.preventDefault();let F=C.nativeEvent.submitter,I=F?.getAttribute("formmethod")||i,K=()=>h(F||C.currentTarget,{fetcherKey:t,method:I,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:p});m&&r!==!1?v.startTransition(()=>K()):K()},...f,"data-discover":!w&&e==="render"?"true":void 0})});ir.displayName="Form";function lr({getKey:e,storageKey:t,...r}){let a=v.useContext(re),{basename:n}=v.useContext(T),o=k(),i=Ue();fr({getKey:e,storageKey:t});let l=v.useMemo(()=>{if(!a||!e)return null;let u=Fe(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 p=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}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})(${Lt(JSON.stringify(t||De))}, ${Lt(JSON.stringify(l))})`}})}lr.displayName="ScrollRestoration";function sr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function We(e){let t=v.useContext(W);return P(t,sr(e)),t}function nn(e){let t=v.useContext(Q);return P(t,sr(e)),t}function ur(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=J(),d=k(),p=Z(e,{relative:i});return v.useCallback(f=>{if(Ta(f,t)){f.preventDefault();let y=r!==void 0?r:U(d)===U(p),m=()=>c(e,{replace:y,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?v.startTransition(()=>m()):m()}},[d,c,p,r,a,n,t,e,o,i,l,s,u])}function Ye(e){N(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(he(e)),r=v.useRef(!1),a=k(),n=v.useMemo(()=>Na(a.search,r.current?null:t.current),[a.search]),o=J(),i=v.useCallback((l,s)=>{let u=he(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var on=0,ln=()=>`__${String(++on)}__`;function cr(){let{router:e}=We("useSubmit"),{basename:t}=v.useContext(T),r=wa(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=Aa(o,t);if(i.navigate===!1){let p=i.fetcherKey||ln();await a(p,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 dr(e,{relative:t}={}){let{basename:r}=v.useContext(T),a=v.useContext(_);P(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...Z(e||".",{relative:t})},i=k();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:$([r,o.pathname])),U(o)}var De="react-router-scroll-positions",le={};function Fe(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:H(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function fr({getKey:e,storageKey:t}={}){let{router:r}=We("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=nn("useScrollRestoration"),{basename:o}=v.useContext(T),i=k(),l=Ue(),s=Qt();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),sn(v.useCallback(()=>{if(s.state==="idle"){let u=Fe(i,l,o,e);le[u]=window.scrollY}try{sessionStorage.setItem(t||De,JSON.stringify(le))}catch(u){N(!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||De);u&&(le=JSON.parse(u))}catch{}},[t]),v.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(le,()=>window.scrollY,e?(c,d)=>Fe(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{N(!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 sn(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 hr(e,{relative:t}={}){let r=v.useContext(Ae);P(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=We("useViewTransitionState"),n=Z(e,{relative:t});if(!r.isTransitioning)return!1;let o=H(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=H(r.nextLocation.pathname,a)||r.nextLocation.pathname;return te(n.pathname,i)!=null||te(n.pathname,o)!=null}var pr=D(M(),1),yr=D(xr(),1);var Re=D(G(),1);function gr({context:e,own:t}){if(oe(e.store),!lt()||e.store.batches().length===0)return null;let a=(0,Re.jsx)(pr.Suspense,{fallback:null,children:(0,Re.jsx)(Rt,{})});return t?(0,yr.createPortal)(a,t):(0,Re.jsx)("div",{className:"graview-bar-own",children:a})}var O=D(M(),1);var B=D(M(),1),un=(0,B.createContext)(null);function Vo(){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 vr(e){let t=(0,B.useContext)(un);(0,B.useLayoutEffect)(()=>t?.place(e),[t,e])}function Jo(e,t){return(0,B.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var Sr=D(G(),1),Ve="var(--graview-text-small)",Je="var(--graview-text-body)",qo="var(--graview-font-display, var(--graview-font-body, system-ui))",Ke={maxWidth:760,margin:"0 auto",padding:"40px 20px max(96px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},Ge=1160,ei={...Ke,maxWidth:Ge},Rr={margin:0,fontSize:"var(--graview-text-title)",lineHeight:1.2,letterSpacing:"-0.012em",overflowWrap:"anywhere",textWrap:"balance"},ti={margin:0,fontSize:"var(--graview-text-heading)",lineHeight:1.3,textWrap:"balance"},ri={margin:0,fontSize:Ve,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},ai={margin:0,fontSize:Je,color:"var(--graview-ink-muted)",maxWidth:"60ch"},wr={color:"var(--graview-ink-muted)",fontSize:Ve},ni={borderTop:"1px solid var(--graview-edge)",paddingTop:24},oi={color:"var(--graview-accent)",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em",display:"inline-flex",alignItems:"center",minHeight:24},ii={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},li=`.graview-list{container-type:inline-size}
|
|
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)}
|
|
5
|
-
.graview-row{grid-column:1/-1;display:grid;grid-template-columns:subgrid;align-items:baseline;align-content:center;position:relative;box-sizing:border-box;min-height:2.75rem;padding:.5rem 0;border-bottom:1px solid var(--graview-edge);overflow-wrap:anywhere}
|
|
6
|
-
.graview-row-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:24px;color:inherit;text-decoration:none;font-size:var(--graview-text-body);font-weight:500;line-height:1.3;text-wrap:pretty;hyphens:manual}
|
|
7
|
-
.graview-row-title::after{content:"";position:absolute;inset:0}
|
|
8
|
-
.graview-row-title:focus-visible{outline:0}
|
|
9
|
-
.graview-row-title:focus-visible::after{outline:2px solid var(--graview-accent);outline-offset:-2px;border-radius:var(--graview-radius-sm)}
|
|
10
|
-
.graview-row:hover .graview-row-title{text-decoration:underline 1px color-mix(in srgb,currentColor 50%,transparent);text-underline-offset:.2em}
|
|
11
|
-
.graview-row:active .graview-row-title{color:var(--graview-accent)}
|
|
12
|
-
.graview-row :is(a,button):not(.graview-row-title){position:relative}
|
|
13
|
-
.graview-row-glance,.graview-row>[data-testid=search-why]{font-size:var(--graview-text-small);line-height:1.5;color:var(--graview-ink-muted)}
|
|
14
|
-
.graview-row>[data-testid=search-why]{grid-column:1/-1}
|
|
15
|
-
.graview-row-glance{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
|
|
16
|
-
.graview-group-head{display:flex;gap:.5em;align-items:baseline;margin:0;padding:.375rem 0;font-family:var(--graview-font-body);font-size:var(--graview-text-small);font-weight:var(--graview-weight-label);line-height:1.3;letter-spacing:.02em;scroll-margin-top:4rem}
|
|
17
|
-
.graview-group-head>span{color:var(--graview-ink-muted);font-weight:var(--graview-weight-body)}
|
|
18
|
-
@container (min-width:36rem){.graview-rows{grid-template-columns:minmax(0,1fr) fit-content(40%)}.graview-group-head:has(+.graview-rows){position:sticky;top:0;z-index:${et.raised};background:var(--graview-ground)}}`,si={font:"inherit",fontSize:Ve,padding:"8px 14px",borderRadius:"var(--graview-radius-sm, 8px)",border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)",color:"var(--graview-ink)",cursor:"pointer"};function ui({kind:e,brand:t,size:r=10,schema:a}){return(0,Sr.jsx)(ut,{kind:e,...a?{schema:a}:{},...t?{brand:t}:{},size:Math.round(r*1.6)})}function ci(e,t){let a=[...new Set(t.targets.map(n=>n.kind))].map(n=>e.schema.tryDefinition(n)?.plural??Se(n));return a.length>0?a.join(" and "):Se(t.edgeKind)}function di(e,t,r){return e.author.kind==="human"&&(e.author.id===void 0||t?.id===void 0||e.author.id===t.id)?"you":r?Ze(e.author,r):e.author.kind==="agent"?e.author.id??"an agent":e.author.id??e.author.kind}function fi(e,t,r){return dt(e,t,{limit:3,said:[r],glance:!0}).map(a=>a.long?ct(a.stored,{markdown:a.markdown,most:100}):a.alone).join(" \xB7 ")}var hi=(e,t)=>ne(e.schema,t),cn=(e,t)=>{let r=e.kindsKeptFrom(t);return e.schema.kinds.filter(a=>!e.modules.disabledKinds.has(a)&&!r.has(a))},dn=e=>it(cn(e.store,e.principal),e.views?.arrangement?.()?.order),mi=e=>{let t=new Set(e.views?.arrangement?.()?.hide??[]);return dn(e).filter(r=>!t.has(r))},pi=e=>e.charAt(0).toUpperCase()+e.slice(1);var L=D(G(),1);function Pi({context:e,children:t}){let{store:r,brand:a}=e;return oe(r),st(e.embedded?void 0:qe(a)),(0,L.jsxs)("div",{style:{...e.embedded?{}:{minHeight:"100vh"},display:"flex",flexDirection:"column",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)",fontSize:Je,lineHeight:1.5},children:[e.embedded?null:(0,L.jsx)(hn,{context:e}),(0,L.jsx)("div",{style:{flex:1},children:t}),e.remembers?(0,L.jsx)("footer",{style:{borderTop:"1px solid var(--graview-edge)",padding:"14px 20px 20px",...wr},children:(0,L.jsx)("div",{style:{maxWidth:Ge,margin:"0 auto",display:"flex",gap:14,flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end"},children:(0,L.jsxs)("span",{"data-testid":"remembered",children:["Remembered in this browser \xB7 ",(0,L.jsx)(wt,{})]})})}):null]})}var fn=(0,O.createContext)(null);function hn({context:e}){let{store:t,brand:r,sceneHref:a="/",invariantContext:n}=e,o=k(),i=J(),l=pe("/").replace(/\/$/,""),s=(0,O.useContext)(fn),u=s?.places===!1?[]:ft({store:t,principal:e.principal,views:e.views}),c=e.views?.arrangement?.(),d=`${o.pathname}${o.search}`,p=t.violations(n),f=p.length,y=gt(p,"All rules hold");return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(pt,{brand:r,name:r?.name??"Graview",description:r?.subtitle,home:{href:`${l}/`,go:()=>i("/"),current:o.pathname==="/"},faces:{scene:{label:nt(c),current:!1,go:()=>window.location.assign(a)},pages:{label:ot(c),current:!0,go:()=>{}}},places:u,current:ht(u,d),reach:{href:m=>`${l}${m}`,go:m=>i(m.path)},...s?{onFind:s.onFind,find:s.find}:{findBox:(0,L.jsx)(mn,{context:e})},tools:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(ae,{to:"/problems","data-testid":"standing-link","aria-label":y,title:y,style:{...mt,padding:f===0?0:"0 8px",textDecoration:"none",fontWeight:600,fontVariantNumeric:"tabular-nums",color:f===0?"var(--graview-ink-muted)":"var(--graview-warn)"},children:[(0,L.jsx)(vt,{tone:f===0?"var(--graview-good)":"var(--graview-warn)"}),f>0?(0,L.jsx)("span",{"aria-hidden":"true",children:f}):null]}),(0,L.jsx)(gr,{context:e}),e.views?(0,L.jsx)(yt,{...e.signature?{signature:!0}:{}}):null]})})})}function Ci({context:e,style:t,children:r,...a}){let n=e.embedded||e.framed?"section":"main";return(0,L.jsx)(n,{style:{...Ke,...t},...a,children:r})}function Li({context:e,children:t,...r}){let a=`h${e.titleLevel??(e.framed&&!e.barAbove?1:2)}`;return(0,L.jsx)(a,{style:Rr,"data-graview-page-title":"",...r,children:t})}function mn({context:e,narrowsLists:t=!0}){vr("find");let r=k(),a=J(),[n,o]=Ye(),i=r.pathname.split("/").filter(Boolean),l=t&&i.length===1&&be(e.store.schema,i[0])!==void 0,s=r.pathname==="/search",u=l||s?n.get("q")??"":"",c=l?`Narrow ${ne(e.store.schema,be(e.store.schema,i[0])).toLowerCase()}\u2026`:"",[d,p]=(0,O.useState)(!0);(0,O.useLayoutEffect)(()=>{let R=m.current;if(!R||!c||typeof ResizeObserver>"u")return;let w=()=>{let C=getComputedStyle(R),F=document.createElement("canvas").getContext("2d");F&&(F.font=`${C.fontWeight} ${C.fontSize} ${C.fontFamily}`,p(F.measureText(c).width<=R.clientWidth-parseFloat(C.paddingLeft)-parseFloat(C.paddingRight)))};w();let x=new ResizeObserver(w);return x.observe(R),()=>x.disconnect()},[c]);let[f,y]=(0,O.useState)(u),m=(0,O.useRef)(null);(0,O.useEffect)(()=>{let R=w=>{if(w.defaultPrevented||w.altKey||w.shiftKey||!(w.metaKey||w.ctrlKey)||w.key.toLowerCase()!=="k")return;let x=m.current,C=x?.closest("[data-graview-embed]"),F=w.target,I=F===document.body||F===document.documentElement;!x||!(I||!C||F instanceof Node&&C.contains(F))||(w.preventDefault(),x.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),requestAnimationFrame(()=>{x.focus(),x.select()}))};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[]);let h=(0,O.useRef)(new Set([u]));(0,O.useEffect)(()=>{h.current.has(u)||(h.current=new Set([u]),y(u))},[u]);let S=R=>{if(y(R),h.current.add(R),l){let x=new URLSearchParams(n);R.trim()?x.set("q",R):x.delete("q"),o(x,{replace:!0});return}let w=R.trim()?`/search?${new URLSearchParams({q:R}).toString()}`:"/search";a(w,{replace:s})};return(0,L.jsx)("form",{role:"search","aria-label":l?"Narrow this list":"Find anything",style:{display:"flex",minWidth:0,flex:"1 1 auto"},onSubmit:R=>{R.preventDefault(),l&&f.trim()&&a(`/search?${new URLSearchParams({q:f}).toString()}`)},children:(0,L.jsx)("input",{ref:m,type:"search","data-testid":"nav-find",value:f,onChange:R=>S(R.target.value),placeholder:l?d?c:"Narrow\u2026":"Find\u2026","aria-keyshortcuts":"Meta+K Control+K","aria-label":l?"Narrow this list":"Find anything",style:{width:"100%",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-ground)",border:"1px solid var(--graview-edge)",borderRadius:8}})})}export{Pr as a,be as b,yn as c,gn as d,Ve as e,qo as f,ei as g,ti as h,ri as i,ai as j,wr as k,ni as l,oi as m,ii as n,li as o,si as p,ui as q,ci as r,di as s,fi as t,hi as u,cn as v,dn as w,mi as x,pi as y,gr as z,k as A,ca as B,J as C,fa as D,xa as E,Pa as F,er as G,Ca as H,an as I,ae as J,Ye as K,un as L,Vo as M,Jo as N,Pi as O,fn as P,Ci as Q,Li as R,mn as S};
|
|
19
|
-
/*! Bundled license information:
|
|
20
|
-
|
|
21
|
-
react-router/dist/development/chunk-BV7QT456.mjs:
|
|
22
|
-
(**
|
|
23
|
-
* react-router v7.18.3
|
|
24
|
-
*
|
|
25
|
-
* Copyright (c) Remix Software Inc.
|
|
26
|
-
*
|
|
27
|
-
* This source code is licensed under the MIT license found in the
|
|
28
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
29
|
-
*
|
|
30
|
-
* @license MIT
|
|
31
|
-
*)
|
|
32
|
-
|
|
33
|
-
react-router/dist/development/index.mjs:
|
|
34
|
-
(**
|
|
35
|
-
* react-router v7.18.3
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Remix Software Inc.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
41
|
-
*
|
|
42
|
-
* @license MIT
|
|
43
|
-
*)
|
|
44
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as h}from"./chunk.G4WQGTZR.js";import{B as p,I as y,M as f,Wa as F,Y as g,aa as b,ab as x,ha as w}from"./chunk.HLLWKSZB.js";function $(e,n,t){let i=[...n?.creates??[],...n?.subject&&n.subject.kinds!=="*"?n.subject.kinds:[]];for(let r of i){let o=e.tryDefinition(r),a=o?.fields?.shape??{};if(!o||!(t in a))continue;let d=o.display?.format?.[t];return{label:o.display?.labels?.[t]??b(o,t),option:u=>d?d(u):g(u)}}return{label:b(void 0,t),option:r=>g(r)}}function S(e,n,t){if(t instanceof F){let i=n.find(o=>o.name===t.mutation);return`Not yet: ${t.issues.map(o=>{let a=o.path.length>0?$(e,i,String(o.path[0])).label:void 0;return a?`${a} \u2014 ${o.message.replace(/^./,d=>d.toLowerCase())}`:o.message}).join("; ")}.`}return t instanceof Error?t.message:String(t)}var _=e=>/^[A-Z]{3}$/.test(e??"");function k(e){let{format:n,unit:t,currency:i,locale:r}=e,o=_(t),a=n==="money"||!n&&o,d=a?o?t:i:void 0;return{...a?{format:"money"}:n?{format:n}:{},...t&&!(a&&o)?{unit:t}:{},...d?{currency:d}:{},...r?{locale:r}:{}}}function P(e){switch(e.format){case"money":return e.currency?`An amount of money in ${e.currency}: a plain number, 1250.5 for 1,250.50 ${e.currency}.`:"An amount of money, in no named currency: a plain number.";case"percent":return"A fraction said as a percent: 0.15 is 15%.";default:return e.unit?`A number of ${e.unit}.`:"A number."}}function M(e){let n=p(e)?.innerType;return n===void 0?e:M(n)}var R={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},D=e=>(e?._zod?.def?.checks??[]).map(n=>n._zod?.def).filter(n=>n!==void 0);function A(e){let n=M(e),t=p(n),i=t?.type,r=D(n);if(i==="enum")return{type:"choice",options:Object.keys(t?.entries??{})};let o=w(n);if(o)return o==="image"?{type:"file",image:!0}:{type:"file"};if(i==="boolean")return{type:"boolean"};if(i==="array"){let a=A(t?.element);return a.type==="unknown"?{type:"unknown"}:{type:"several",of:a}}if(i==="number"){let a,d,c;for(let u of r){u.check==="multiple_of"&&typeof u.value=="number"?c=u.value:u.check==="number_format"&&(u.format==="safeint"||u.format==="int32"||u.format==="uint32")&&(c??=1);let s=u.check==="number_format"&&u.format?R[u.format]:void 0,m=s?s[0]:u.check==="greater_than"&&u.inclusive&&typeof u.value=="number"?u.value:void 0,l=s?s[1]:u.check==="less_than"&&u.inclusive&&typeof u.value=="number"?u.value:void 0;m!==void 0&&(a=a===void 0?m:Math.max(a,m)),l!==void 0&&(d=d===void 0?l:Math.min(d,l))}return{type:"number",...a===void 0?{}:{min:a},...d===void 0?{}:{max:d},...c===void 0?{}:{step:c},...h(n)==="duration"?{duration:!0}:{},...x(e)?{amount:k(x(e))}:{}}}if(i==="string"){let d=[t?.pattern,...r.map(s=>s.pattern)].filter(s=>s instanceof RegExp).map(s=>s.source);if(d.some(s=>s.includes("\\d{4}")))return d.some(s=>s.includes("\\d{2}:\\d{2}"))?{type:"date",time:!0}:{type:"date"};let c=r.some(s=>s.check==="max_length"&&typeof s.maximum=="number"&&s.maximum>500),u=h(n);return c?{type:"text",long:!0}:u==="phone"||u==="place"?{type:"text",holds:u}:{type:"text"}}return{type:"unknown"}}function E(e,n){let t=e?.shape;return!t||!(n in t)?{type:"unknown"}:A(t[n])}function v(e){if(e===void 0||e==="web"||e.startsWith("ai:"))return;if(e==="api")return"via the API";if(e==="cli")return"via the command line";let[n,...t]=e.split(":"),i=t.join(":");return(n==="mcp"||n==="view")&&i?`via ${i}`:n==="mcp"?"via an agent's tools":`via ${e}`}var N=e=>{if(!e.currency)return{before:!0};try{let n=y(e.locale),t=new Intl.NumberFormat(n,{style:"currency",currency:e.currency}).formatToParts(1),i=t.findIndex(a=>a.type==="currency"),r=t.findIndex(a=>a.type==="integer"),o;try{o=new Intl.DisplayNames([n],{type:"currency"}).of(e.currency)}catch{}return{...i>=0?{symbol:t[i].value}:{},before:i<r,...o?{name:o}:{}}}catch{return{symbol:e.currency,before:!0}}};function j(e){let n=e.locale;if(e.format==="money"){let{symbol:t,before:i,name:r}=N(e),o=f(1250,n,{minimumFractionDigits:2,maximumFractionDigits:2});return{...t?i?{prefix:t}:{suffix:t}:{},placeholder:o,hint:r?`in ${r}`:e.currency?`in ${e.currency}`:"an amount of money"}}return e.format==="percent"?{suffix:"%",placeholder:f(15,n),hint:"as a percent"}:{...e.unit?{suffix:e.unit}:{},placeholder:"",hint:e.unit?`in ${e.unit}`:"a number"}}function I(e,n){return e===void 0||!Number.isFinite(e)?"":n.format==="money"?f(e,n.locale,Number.isInteger(e)?{maximumFractionDigits:0}:{minimumFractionDigits:2,maximumFractionDigits:2}):n.format==="percent"?f(e*100,n.locale,{maximumFractionDigits:4}):f(e,n.locale,{maximumFractionDigits:6})}function O(e){try{let n=new Intl.NumberFormat(y(e)).formatToParts(12345.6);return{group:n.find(t=>t.type==="group")?.value??",",decimal:n.find(t=>t.type==="decimal")?.value??"."}}catch{return{group:",",decimal:"."}}}function W(e,n){let{group:t,decimal:i}=O(n),r=e.replace(/[\s ']/g,"").replace(/[−–]/g,"-");if(i!=="."&&!r.includes(i)&&/^-?\d+\.\d{1,2}$/.test(r))return Number(r);if(t&&(r=r.split(t).join("")),i!=="."&&(r=r.replace(i,".")),!/^-?(\d+\.?\d*|\.\d+)$/.test(r))return;let o=Number(r);return Number.isFinite(o)?o:void 0}function B(e,n){let t=e.trim();if(t==="")return;let i=n?.format==="money"&&n.currency?N(n).symbol:void 0,r=t;i&&(r=r.split(i).join("")),n?.currency&&(r=r.replace(new RegExp(n.currency,"gi"),"")),r=r.replace(/^[$€£¥₹]|[$€£¥₹]$/g,""),/%\s*$/.test(r)&&(r=r.replace(/%\s*$/,"")),n?.unit&&n.format!=="money"&&(r=r.replace(new RegExp(`\\s*${n.unit.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*$`),""));let a=W(r,n?.locale);if(a!==void 0)return n?.format==="percent"?a/100:a}export{k as a,P as b,M as c,A as d,E as e,$ as f,S as g,v as h,j as i,I as j,B as k};
|
|
File without changes
|