graview 0.1.25 → 0.1.27
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.4JXWQO6Y.js +1 -0
- package/dist/preview/chunk.4R7LDCDO.js +1 -0
- package/dist/preview/chunk.4W24TPMR.js +1 -0
- package/dist/preview/{chunk.SSOTDXRS.js → chunk.5BN2ARQ2.js} +1 -1
- package/dist/preview/chunk.6LJ66MB7.js +1 -0
- package/dist/preview/chunk.6R4EI47C.js +1 -0
- package/dist/preview/{chunk.JIXW4WIO.js → chunk.7CO6VP6F.js} +1 -1
- package/dist/preview/chunk.7QTBDACG.js +1 -0
- package/dist/preview/chunk.7SVIRYBB.js +1 -0
- package/dist/preview/chunk.7THQFY52.js +1 -0
- package/dist/preview/chunk.AS35X6KA.js +1 -0
- package/dist/preview/{chunk.UOYH2DFX.js → chunk.ATLUMYAJ.js} +2 -2
- package/dist/preview/{chunk.6DU4XN2F.js → chunk.CW7BMVBG.js} +1 -1
- package/dist/preview/chunk.DG2UE7PJ.js +1 -0
- package/dist/preview/chunk.DG2WKNMX.js +1 -0
- package/dist/preview/chunk.DQ5OWYLQ.js +1 -0
- package/dist/preview/chunk.DY2FFBWF.js +1 -0
- package/dist/preview/chunk.E3SZ7T75.js +1 -0
- package/dist/preview/chunk.EVTZE2OZ.js +1 -0
- package/dist/preview/chunk.FS5K4AVA.js +8 -0
- package/dist/preview/chunk.FTBKJ5RZ.js +16 -0
- package/dist/preview/chunk.GHMICJIB.js +1 -0
- package/dist/preview/chunk.HO6JR7VY.js +1 -0
- package/dist/preview/{chunk.DEZEXD24.js → chunk.HPD3DSTP.js} +1 -1
- package/dist/preview/chunk.I5KD54S6.js +1 -0
- package/dist/preview/chunk.IXVSJJQH.js +20 -0
- package/dist/preview/chunk.IZDKEFPJ.js +1 -0
- package/dist/preview/chunk.J36GTQTV.js +1 -0
- package/dist/preview/chunk.KAKX5TZN.js +3 -0
- package/dist/preview/chunk.LHAAZQNQ.js +19 -0
- package/dist/preview/chunk.LQZ2VQWN.js +107 -0
- package/dist/preview/chunk.MHJJEGQO.js +1 -0
- package/dist/preview/chunk.MNPNW4BQ.js +1 -0
- package/dist/preview/chunk.NKIFVPS3.js +1 -0
- package/dist/preview/chunk.NQNQPPPM.js +1 -0
- package/dist/preview/{chunk.6UL2JUEH.js → chunk.OA5BVKJH.js} +1 -1
- package/dist/preview/chunk.OHGJ5BZ4.js +2 -0
- package/dist/preview/chunk.OYULDOQP.js +1 -0
- package/dist/preview/{chunk.PY42PBMB.js → chunk.PHY3AH3L.js} +1 -1
- package/dist/preview/chunk.Q7544RCB.js +1 -0
- package/dist/preview/{chunk.JCZH55RX.js → chunk.QZWN46V6.js} +1 -1
- package/dist/preview/chunk.RUC4HFVC.js +1 -0
- package/dist/preview/chunk.S5JWZIVE.js +1 -0
- package/dist/preview/chunk.SHDYLMZE.js +2 -0
- package/dist/preview/chunk.T2EZ5MTH.js +1 -0
- package/dist/preview/chunk.TMPV4HLQ.js +1 -0
- package/dist/preview/{chunk.HQX5FGYT.js → chunk.TX2GOL65.js} +2 -2
- package/dist/preview/{chunk.S24R4MRK.js → chunk.U5ZUXGWM.js} +3 -3
- package/dist/preview/chunk.UMMN5Z6V.js +1 -0
- package/dist/preview/chunk.UPGDSOBY.js +1 -0
- package/dist/preview/chunk.V57P4LIZ.js +1 -0
- package/dist/preview/{chunk.YZZGD5OY.js → chunk.VD6FJ6KJ.js} +1 -1
- package/dist/preview/{chunk.B57EIGTS.js → chunk.VFICMX5G.js} +1 -1
- package/dist/preview/chunk.VMD4PDYJ.js +1 -0
- package/dist/preview/chunk.VMEX2KZ4.js +8 -0
- package/dist/preview/chunk.XDHBV5K5.js +1 -0
- package/dist/preview/chunk.YO7UFBJP.js +1 -0
- package/dist/preview/chunk.YV2RTNPU.js +6 -0
- package/dist/preview/chunk.ZD5HGRPR.js +1 -0
- package/dist/preview/chunk.ZKM4P7US.js +1 -0
- package/dist/preview/chunk.ZMMMKTAG.js +1 -0
- package/dist/preview/chunk.ZNIJONZN.js +1 -0
- package/dist/preview/page.js +6 -6
- package/package.json +6 -6
- package/dist/preview/chunk.2AJMM7JG.js +0 -1
- package/dist/preview/chunk.2WFEFZAW.js +0 -1
- package/dist/preview/chunk.2YVXTTC2.js +0 -1
- package/dist/preview/chunk.6KJSFIO7.js +0 -1
- package/dist/preview/chunk.6OBXKKB5.js +0 -20
- package/dist/preview/chunk.6WFN4C46.js +0 -107
- package/dist/preview/chunk.7BAUPTMY.js +0 -1
- package/dist/preview/chunk.A4SJ7EEY.js +0 -1
- package/dist/preview/chunk.ACKTGTOT.js +0 -1
- package/dist/preview/chunk.BJ2Y5F66.js +0 -1
- package/dist/preview/chunk.BYUQOV3O.js +0 -1
- package/dist/preview/chunk.C5N4RTPF.js +0 -1
- package/dist/preview/chunk.CFL2B2Z5.js +0 -1
- package/dist/preview/chunk.DJ72CUS7.js +0 -1
- package/dist/preview/chunk.DSZ3I557.js +0 -2
- package/dist/preview/chunk.EA4BZKPG.js +0 -1
- package/dist/preview/chunk.EKZWX6NG.js +0 -1
- package/dist/preview/chunk.F26676IW.js +0 -1
- package/dist/preview/chunk.F2KDFGHR.js +0 -1
- package/dist/preview/chunk.FWV4XAZA.js +0 -1
- package/dist/preview/chunk.G3BOZHKR.js +0 -1
- package/dist/preview/chunk.H4LHHT56.js +0 -8
- package/dist/preview/chunk.I5ELK6JF.js +0 -1
- package/dist/preview/chunk.I6T3FDQS.js +0 -1
- package/dist/preview/chunk.IB6PGEU7.js +0 -1
- package/dist/preview/chunk.JEMQBV6K.js +0 -1
- package/dist/preview/chunk.JW3E4SAC.js +0 -1
- package/dist/preview/chunk.KUTTVYOB.js +0 -16
- package/dist/preview/chunk.LHFEOEYY.js +0 -1
- package/dist/preview/chunk.MJ67MK4R.js +0 -1
- package/dist/preview/chunk.ORJ3T4IW.js +0 -2
- package/dist/preview/chunk.Q5WEOX3Q.js +0 -1
- package/dist/preview/chunk.QOYC424P.js +0 -3
- package/dist/preview/chunk.R6F3YMRK.js +0 -6
- package/dist/preview/chunk.RAE4M3KQ.js +0 -8
- package/dist/preview/chunk.RUFAVEXB.js +0 -1
- package/dist/preview/chunk.RVEMN5WU.js +0 -1
- package/dist/preview/chunk.S56LSUHV.js +0 -1
- package/dist/preview/chunk.T6KID3WO.js +0 -1
- package/dist/preview/chunk.TAOT74FR.js +0 -1
- package/dist/preview/chunk.TTODVIXW.js +0 -1
- package/dist/preview/chunk.U6BWYBPM.js +0 -19
- package/dist/preview/chunk.US4KIJSW.js +0 -1
- package/dist/preview/chunk.WX5CJ7PI.js +0 -1
- package/dist/preview/chunk.WXO3XUNW.js +0 -1
- package/dist/preview/chunk.ZJVIH6IF.js +0 -1
- package/dist/preview/chunk.ZRVDIVYY.js +0 -1
- package/dist/preview/chunk.ZV7ZFH2S.js +0 -1
- /package/dist/preview/{chunk.WWRWXFYR.js → chunk.WVUJXDXZ.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{b as pt,c as oe,d as yt}from"./chunk.F26676IW.js";import{a as Sr}from"./chunk.IKT7JQUW.js";import{c as it,f as st,g as ut,j as ct,k as dt,l as ft,n as ht,o as mt}from"./chunk.6DU4XN2F.js";import{a as lt}from"./chunk.SSOTDXRS.js";import{da as ot}from"./chunk.2WFEFZAW.js";import{Ja as Ze,Ka as qe,La as et,M as Se,Q as ne,Rb as rt,Sb as at,Tb as nt,V as Xe,X as Qe,qb as tt}from"./chunk.RAE4M3KQ.js";import{a as O,b as G}from"./chunk.MRK6QJV5.js";import{b as D}from"./chunk.AJZBJBMO.js";function Er(e,t){return Ze(e,t).slice(1)}function Ee(e,t){return e.kinds.find(r=>Er(e,r)===t)}function hn(e,t,r){return qe(e,t,r)}function mn(e,t){return et(e,t)}var A=D(O(),1),g=D(O(),1),b=D(O(),1),je=D(O(),1),Zt=D(O(),1),E=D(O(),1),Wa=D(O(),1),Va=D(O(),1),Ya=D(O(),1),v=D(O(),1),cr=D(O(),1);var ke=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Pt=/^[\\/]{2}/;function br(e,t){return t+e.replace(/\\/g,"/")}var gt="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 Ct(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 Lt(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 Pr(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 xr(){return Math.random().toString(36).substring(2,10)}function vt(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||xr(),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 Pr(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=vt(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=vt(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 Cr(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(gt,d),s=h,()=>{n.removeEventListener(gt,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 Cr(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&&Pt.test(n)&&(n=a+n),new URL(n,a)}var Lr;Lr=new WeakMap;function Te(e,t,r="/"){return Dr(e,t,r,!1)}function Dr(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??kr(e),s=null,u=jr(i);for(let c=0;s==null&&c<l.length;++c)s=Ur(l[c],u,a);return s}function Fr(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 kr(e){let t=Dt(e);return Tr(t),t}function Dt(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}".`),Dt(i.children,t,p,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Ir(d,i.index),routesMeta:p.map((f,y)=>{let[m,h]=Tt(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 Ft(i.path))o(i,l,!0,s)}),t}function Ft(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=Ft(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 Tr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Hr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Nr=/^:[\w-]+$/,Mr=3,Or=2,Ar=1,_r=10,$r=-2,Rt=e=>e==="*";function Ir(e,t){let r=e.split("/"),a=r.length;return r.some(Rt)&&(a+=$r),t&&(a+=Or),r.filter(n=>!Rt(n)).reduce((n,o)=>n+(Nr.test(o)?Mr:o===""?Ar:_r),a)}function Hr(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 Ur(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?kt(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:Br($([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]=Tt(e.path,e.caseSensitive,e.end);return kt(e,t,r,a)}function kt(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 Tt(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 jr(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 Nt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?z(e):e,o;return r?(r=Mt(r),r.startsWith("/")||r.startsWith("\\")?o=wt(r.substring(1),"/"):o=wt(r,t)):o=t,{pathname:o,search:Wr(a),hash:Vr(n)}}function wt(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 be(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function zr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ne(e){let t=zr(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("?"),be("?","pathname","search",n)),P(!n.pathname||!n.pathname.includes("#"),be("#","pathname","hash",n)),P(!n.search||!n.search.includes("#"),be("#","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=Nt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Mt=e=>e.replace(/[\\/]{2,}/g,"/"),$=e=>Mt(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 Br=e=>X(e).replace(/^\/*/,"/"),Wr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Vr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Ot=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 At(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Yr(e){let t=e.map(r=>r.route.path).filter(Boolean);return $(t)||"/"}var _t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $t(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(_t)try{let o=new URL(window.location.href),i=Pt.test(r)?new URL(br(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 yn=Symbol("Uninstrumented");var gn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var St=new URL("http://localhost");function Me(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),St)}catch{return St}}function xe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function Jr(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 Oe(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||!Jr(e,n)||!xe(n,o)))throw new Error("External navigation is not allowed")}var It=["POST","PUT","PATCH","DELETE"],vn=new Set(It),Kr=["GET",...It],Rn=new Set(Kr);var wn=Symbol("ResetLoaderData"),Gr,Xr,Qr,Zr;Gr=new WeakMap;Xr=new WeakMap;Qr=new WeakMap;Zr=new WeakMap;var qr=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ea(e){try{return qr.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 Ht=A.createContext(!1);function ta(){return A.useContext(Ht)}var Ae=A.createContext({isTransitioning:!1});Ae.displayName="ViewTransition";var Ut=A.createContext(new Map);Ut.displayName="Fetchers";var ra=A.createContext(null);ra.displayName="Await";var T=A.createContext(null);T.displayName="Navigation";var V=A.createContext(null);V.displayName="Location";var _=A.createContext({outlet:null,matches:[],isDataRoute:!1});_.displayName="Route";var _e=A.createContext(null);_e.displayName="RouteError";var Le=!0,jt="REACT_ROUTER_ERROR",aa="REDIRECT",na="ROUTE_ERROR_RESPONSE";function oa(e){if(e.startsWith(`${jt}:${aa}:{`))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 ia(e){if(e.startsWith(`${jt}:${na}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ot(t.status,t.statusText,t.data)}catch{}}function pe(e,{relative:t}={}){P(Y(),"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 Y(){return g.useContext(V)!=null}function k(){return P(Y(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(V).location}function la(){return g.useContext(V).navigationType}var zt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bt(e){g.useContext(T).static||g.useLayoutEffect(e)}function J(){let{isDataRoute:e}=g.useContext(_);return e?va():sa()}function sa(){P(Y(),"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 Bt(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(N(i.current,zt),!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])),Oe(typeof s=="string"?s:U(s),r.createHref(c),Me(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Sn=g.createContext(null);function ua(){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 Wt(e,t){return Vt(e,t)}function Vt(e,t,r){P(Y(),"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||"";Gt(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.
|
|
1
|
+
import{a as pt,c as yt,d as oe}from"./chunk.T2EZ5MTH.js";import{a as Sr}from"./chunk.IKT7JQUW.js";import{c as it,f as st,g as ut,j as ct,k as dt,l as ft,n as ht,o as mt}from"./chunk.CW7BMVBG.js";import{a as lt}from"./chunk.5BN2ARQ2.js";import{ea as ot}from"./chunk.OYULDOQP.js";import{$ as Xe,Qa as Ze,Ra as qe,S as Se,Sa as et,W as ne,Yb as rt,Zb as at,_b as nt,ba as Qe,xb as tt}from"./chunk.VMEX2KZ4.js";import{a as O,b as G}from"./chunk.MRK6QJV5.js";import{b as D}from"./chunk.AJZBJBMO.js";function Er(e,t){return Ze(e,t).slice(1)}function Ee(e,t){return e.kinds.find(r=>Er(e,r)===t)}function hn(e,t,r){return qe(e,t,r)}function mn(e,t){return et(e,t)}var A=D(O(),1),g=D(O(),1),b=D(O(),1),je=D(O(),1),Zt=D(O(),1),E=D(O(),1),Wa=D(O(),1),Va=D(O(),1),Ya=D(O(),1),v=D(O(),1),cr=D(O(),1);var ke=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Pt=/^[\\/]{2}/;function br(e,t){return t+e.replace(/\\/g,"/")}var gt="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 Ct(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 Lt(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 Pr(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 xr(){return Math.random().toString(36).substring(2,10)}function vt(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||xr(),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 Pr(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=vt(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=vt(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 Cr(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(gt,d),s=h,()=>{n.removeEventListener(gt,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 Cr(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&&Pt.test(n)&&(n=a+n),new URL(n,a)}var Lr;Lr=new WeakMap;function Te(e,t,r="/"){return Dr(e,t,r,!1)}function Dr(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??kr(e),s=null,u=jr(i);for(let c=0;s==null&&c<l.length;++c)s=Ur(l[c],u,a);return s}function Fr(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 kr(e){let t=Dt(e);return Tr(t),t}function Dt(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}".`),Dt(i.children,t,p,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Ir(d,i.index),routesMeta:p.map((f,y)=>{let[m,h]=Tt(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 Ft(i.path))o(i,l,!0,s)}),t}function Ft(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=Ft(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 Tr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Hr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Nr=/^:[\w-]+$/,Mr=3,Or=2,Ar=1,_r=10,$r=-2,Rt=e=>e==="*";function Ir(e,t){let r=e.split("/"),a=r.length;return r.some(Rt)&&(a+=$r),t&&(a+=Or),r.filter(n=>!Rt(n)).reduce((n,o)=>n+(Nr.test(o)?Mr:o===""?Ar:_r),a)}function Hr(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 Ur(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?kt(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:Br($([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]=Tt(e.path,e.caseSensitive,e.end);return kt(e,t,r,a)}function kt(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 Tt(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 jr(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 Nt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?z(e):e,o;return r?(r=Mt(r),r.startsWith("/")||r.startsWith("\\")?o=wt(r.substring(1),"/"):o=wt(r,t)):o=t,{pathname:o,search:Wr(a),hash:Vr(n)}}function wt(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 be(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function zr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ne(e){let t=zr(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("?"),be("?","pathname","search",n)),P(!n.pathname||!n.pathname.includes("#"),be("#","pathname","hash",n)),P(!n.search||!n.search.includes("#"),be("#","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=Nt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Mt=e=>e.replace(/[\\/]{2,}/g,"/"),$=e=>Mt(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 Br=e=>X(e).replace(/^\/*/,"/"),Wr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Vr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Ot=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 At(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Yr(e){let t=e.map(r=>r.route.path).filter(Boolean);return $(t)||"/"}var _t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $t(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(_t)try{let o=new URL(window.location.href),i=Pt.test(r)?new URL(br(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 yn=Symbol("Uninstrumented");var gn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var St=new URL("http://localhost");function Me(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),St)}catch{return St}}function xe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function Jr(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 Oe(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||!Jr(e,n)||!xe(n,o)))throw new Error("External navigation is not allowed")}var It=["POST","PUT","PATCH","DELETE"],vn=new Set(It),Kr=["GET",...It],Rn=new Set(Kr);var wn=Symbol("ResetLoaderData"),Gr,Xr,Qr,Zr;Gr=new WeakMap;Xr=new WeakMap;Qr=new WeakMap;Zr=new WeakMap;var qr=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ea(e){try{return qr.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 Ht=A.createContext(!1);function ta(){return A.useContext(Ht)}var Ae=A.createContext({isTransitioning:!1});Ae.displayName="ViewTransition";var Ut=A.createContext(new Map);Ut.displayName="Fetchers";var ra=A.createContext(null);ra.displayName="Await";var T=A.createContext(null);T.displayName="Navigation";var V=A.createContext(null);V.displayName="Location";var _=A.createContext({outlet:null,matches:[],isDataRoute:!1});_.displayName="Route";var _e=A.createContext(null);_e.displayName="RouteError";var Le=!0,jt="REACT_ROUTER_ERROR",aa="REDIRECT",na="ROUTE_ERROR_RESPONSE";function oa(e){if(e.startsWith(`${jt}:${aa}:{`))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 ia(e){if(e.startsWith(`${jt}:${na}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ot(t.status,t.statusText,t.data)}catch{}}function pe(e,{relative:t}={}){P(Y(),"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 Y(){return g.useContext(V)!=null}function k(){return P(Y(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(V).location}function la(){return g.useContext(V).navigationType}var zt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bt(e){g.useContext(T).static||g.useLayoutEffect(e)}function J(){let{isDataRoute:e}=g.useContext(_);return e?va():sa()}function sa(){P(Y(),"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 Bt(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(N(i.current,zt),!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])),Oe(typeof s=="string"?s:U(s),r.createHref(c),Me(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Sn=g.createContext(null);function ua(){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 Wt(e,t){return Vt(e,t)}function Vt(e,t,r){P(Y(),"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||"";Gt(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
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=ma(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(V.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},m):m}function ca(){let e=Kt(),t=At(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 da=g.createElement(ca,null),Yt=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=ia(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(fa,{error:e},t):t}};Yt.contextType=Ht;var Pe=new WeakMap;function fa({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=oa(t.digest);if(n){let o=Pe.get(t);if(o)throw o;let i=$t(n.location,r),l=i.absoluteURL||i.to;if(Oe(n.location,l,Me(a),"allow-explicit"),ea(l))throw new Error("Invalid redirect location");if(_t&&!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 ha({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 ma(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:Yr(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||da,i&&(l<0&&p===0?(Gt("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(ha,{match:d,routeContext:{outlet:c,matches:S,isDataRoute:a!=null},children:w})};return a&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(Yt,{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 pa(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 ya(e){let t=g.useContext(_);return P(t,$e(e)),t}function He(e){let t=ya(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 ga(){return He("useRouteId")}function Jt(){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=>Fr(r,t)),[e,t])}function Kt(){let e=g.useContext(_e),t=Ie("useRouteError"),r=He("useRouteError");return e!==void 0?e:t.errors?.[r]}function va(){let{router:e}=pa("useNavigate"),t=He("useNavigate"),r=g.useRef(!1);return Bt(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{N(r.current,zt),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Et={};function Gt(e,t,r){!t&&!Et[e]&&(Et[e]=!0,N(!1,r))}var Ra="useOptimistic",En=b[Ra];var bn=b.memo(wa);function wa({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return Vt(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function Sa({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=b.useRef();o.current==null&&(o.current=Ct({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=b.useState({action:i.action,location:i.location}),u=b.useCallback(c=>{n===!1?s(c):b.startTransition(()=>s(c))},[n]);return b.useLayoutEffect(()=>i.listen(u),[i,u]),b.createElement(ye,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function Ea({to:e,replace:t,state:r,relative:a}){P(Y(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=b.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}=b.useContext(_),{pathname:l}=k(),s=J(),u=me(e,Ne(i),l,a==="path");Oe(typeof e=="string"?e:U(e),o.createHref(u),Me(o),"reject");let c=JSON.stringify(u);return b.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function Xt(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(!Y(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=b.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=b.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:b.createElement(T.Provider,{value:s},b.createElement(V.Provider,{children:t,value:m}))}function ba({children:e,location:t}){return Wt(fe(e),t)}function fe(e,t=[]){let r=[];return b.Children.forEach(e,(a,n)=>{if(!b.isValidElement(a))return;let o=[...t,n];if(a.type===b.Fragment){r.push.apply(r,fe(a.props.children,o));return}P(a.type===Xt,`[${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 xa(e){return ge(e)&&e.tagName.toLowerCase()==="button"}function Pa(e){return ge(e)&&e.tagName.toLowerCase()==="form"}function Ca(e){return ge(e)&&e.tagName.toLowerCase()==="input"}function La(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Da(e,t){return e.button===0&&(!t||t==="_self")&&!La(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 Fa(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 ka(){if(ie===null)try{new FormData(document.createElement("form"),0),ie=!1}catch{ie=!0}return ie}var Ta=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ce(e){return e!=null&&!Ta.has(e)?(N(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ue}"`),null):e}function Na(e,t){let r,a,n,o,i;if(Pa(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(xa(e)||Ca(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),!ka()){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 xn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ma={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Oa=/[&><\u2028\u2029]/g;function bt(e){return e.replace(Oa,t=>Ma[t])}function ze(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Aa=Symbol("SingleFetchRedirect");function Qt(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 _a(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 $a(e){return e!=null&&typeof e.page=="string"}function Ia(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 Ha(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await _a(o,r);return i.links?i.links():[]}return[]}));return Ba(a.flat(1).filter(Ia).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function xt(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 Ua(e,t,{includeHydrateFallback:r}={}){return ja(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 ja(e){return[...new Set(e)]}function za(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Ba(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!$a(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(za(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function Be(){let e=E.useContext(W);return ze(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ja(){let e=E.useContext(Q);return ze(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var re=E.createContext(void 0);re.displayName="FrameworkContext";function ve(){let e=E.useContext(re);return ze(e,"You must render this element inside a <HydratedRouter> element"),e}function Ka(e,t){let r=E.useContext(re),[a,n]=E.useState(!1),[o,i]=E.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,p=E.useRef(null);E.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]),E.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 qt({page:e,...t}){let r=ta(),{nonce:a}=ve(),{router:n}=Be(),o=E.useMemo(()=>Te(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?E.createElement(Xa,{page:e,matches:o,...t}):E.createElement(Qa,{page:e,matches:o,...t})):null}function Ga(e){let{manifest:t,routeModules:r}=ve(),[a,n]=E.useState([]);return E.useEffect(()=>{let o=!1;return Ha(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function Xa({page:e,matches:t,...r}){let a=k(),{future:n}=ve(),{basename:o}=Be(),i=E.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=Qt(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 E.createElement(E.Fragment,null,i.map(l=>E.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function Qa({page:e,matches:t,...r}){let a=k(),{future:n,manifest:o,routeModules:i}=ve(),{basename:l}=Be(),{loaderData:s,matches:u}=Ja(),c=E.useMemo(()=>xt(e,t,u,o,a,"data"),[e,t,u,o,a]),d=E.useMemo(()=>xt(e,t,u,o,a,"assets"),[e,t,u,o,a]),p=E.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=Qt(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=E.useMemo(()=>Ua(d,o),[d,o]),y=Ga(d);return E.createElement(E.Fragment,null,p.map(m=>E.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})),f.map(m=>E.createElement("link",{key:m,rel:"modulepreload",href:m,...r})),y.map(({key:m,link:h})=>E.createElement("link",{key:m,nonce:r.nonce,...h,crossOrigin:h.crossOrigin??r.crossOrigin})))}function Za(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var qa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{qa&&(window.__reactRouterVersion="7.18.3")}catch{}function en({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=Lt({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 er({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})}er.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=$t(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]=Ka(a,y),Rr=or(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:p,defaultShouldRevalidate:f,useTransitions:R});function wr(j){t&&t(j),j.defaultPrevented||Rr(j)}let Ke=!(x.isExternal||o),Ge=v.createElement("a",{...y,...we,href:(Ke?I:void 0)||x.absoluteURL||C,onClick:Ke?wr:t,ref:Za(m,q),target:u,"data-discover":!w&&r==="render"?"true":void 0});return K&&!w?v.createElement(v.Fragment,null,Ge,v.createElement(qt,{page:C})):Ge});ae.displayName="Link";var tr=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&&ur(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)});tr.displayName="NavLink";var rr=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=ir(),S=lr(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})});rr.displayName="Form";function ar({getKey:e,storageKey:t,...r}){let a=v.useContext(re),{basename:n}=v.useContext(T),o=k(),i=Ue();sr({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})(${bt(JSON.stringify(t||De))}, ${bt(JSON.stringify(l))})`}})}ar.displayName="ScrollRestoration";function nr(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,nr(e)),t}function tn(e){let t=v.useContext(Q);return P(t,nr(e)),t}function or(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(Da(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 Ve(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(()=>Fa(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 rn=0,an=()=>`__${String(++rn)}__`;function ir(){let{router:e}=We("useSubmit"),{basename:t}=v.useContext(T),r=ga(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=Na(o,t);if(i.navigate===!1){let p=i.fetcherKey||an();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 lr(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 sr({getKey:e,storageKey:t}={}){let{router:r}=We("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=tn("useScrollRestoration"),{basename:o}=v.useContext(T),i=k(),l=Ue(),s=Jt();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),nn(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 nn(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 ur(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 dr=D(O(),1),fr=D(Sr(),1);var Re=D(G(),1);function hr({context:e,own:t}){if(oe(e.store),!ot()||e.store.batches().length===0)return null;let a=(0,Re.jsx)(dr.Suspense,{fallback:null,children:(0,Re.jsx)(yt,{})});return t?(0,fr.createPortal)(a,t):(0,Re.jsx)("div",{className:"graview-bar-own",children:a})}var M=D(O(),1);var B=D(O(),1),on=(0,B.createContext)(null);function Bo(){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 mr(e){let t=(0,B.useContext)(on);(0,B.useLayoutEffect)(()=>t?.place(e),[t,e])}function Wo(e,t){return(0,B.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var vr=D(G(),1),pr="var(--graview-font-display, var(--graview-font-body, system-ui))",Ye={maxWidth:760,margin:"0 auto",padding:"40px 20px max(96px, var(--graview-foot-room, 0px))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},Je=1160,Go={...Ye,maxWidth:Je},yr={margin:0,fontFamily:pr,fontSize:"clamp(30px, 4.6vw, 40px)",lineHeight:1.12,fontWeight:600,letterSpacing:"-0.012em",overflowWrap:"anywhere"},Xo={margin:0,fontFamily:pr,fontSize:"1.4375rem",lineHeight:1.25,fontWeight:600,letterSpacing:"-0.006em"},Qo={margin:0,fontSize:"0.8125rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Zo={margin:0,fontSize:"1.1875rem",lineHeight:1.5,color:"var(--graview-ink-muted)",maxWidth:"58ch"},gr={color:"var(--graview-ink-muted)",fontSize:"0.9375rem"},qo={borderTop:"1px solid var(--graview-edge)",paddingTop:24},ei={color:"inherit",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3,display:"inline-flex",alignItems:"center",minHeight:24},ti={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},ri={font:"inherit",fontSize:"0.9375rem",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 ai({kind:e,brand:t,size:r=10,schema:a}){return(0,vr.jsx)(lt,{kind:e,...a?{schema:a}:{},...t?{brand:t}:{},size:Math.round(r*1.6)})}function ni(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 oi(e,t,r){return e.author.kind==="human"&&(e.author.id===void 0||t?.id===void 0||e.author.id===t.id)?"you":r?Qe(e.author,r):e.author.kind==="agent"?e.author.id??"an agent":e.author.id??e.author.kind}function ii(e,t,r){return Xe(e,t,{limit:3,said:[r],glance:!0}).map(a=>a.alone).join(" \xB7 ")}var li=(e,t)=>ne(e.schema,t),ln=(e,t)=>{let r=e.kindsKeptFrom(t);return e.schema.kinds.filter(a=>!e.modules.disabledKinds.has(a)&&!r.has(a))},sn=e=>nt(ln(e.store,e.principal),e.views?.arrangement?.()?.order),si=e=>{let t=new Set(e.views?.arrangement?.()?.hide??[]);return sn(e).filter(r=>!t.has(r))},ui=e=>e.charAt(0).toUpperCase()+e.slice(1);var L=D(G(),1);function Ri({context:e,children:t}){let{store:r,brand:a}=e;return oe(r),it(e.embedded?void 0:tt(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:"1.0625rem",lineHeight:1.6},children:[e.embedded?null:(0,L.jsx)(cn,{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",...gr,fontSize:"0.875rem"},children:(0,L.jsx)("div",{style:{maxWidth:Je,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)(pt,{})]})})}):null]})}var un=(0,M.createContext)(null);function cn({context:e}){let{store:t,brand:r,sceneHref:a="/",invariantContext:n}=e,o=k(),i=J(),l=pe("/").replace(/\/$/,""),s=(0,M.useContext)(un),u=s?.places===!1?[]:st({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=ht(p,"All rules hold");return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(dt,{brand:r,name:r?.name??"Graview",description:r?.subtitle,home:{href:`${l}/`,go:()=>i("/"),current:o.pathname==="/"},faces:{scene:{label:rt(c),current:!1,go:()=>window.location.assign(a)},pages:{label:at(c),current:!0,go:()=>{}}},places:u,current:ut(u,d),reach:{href:m=>`${l}${m}`,go:m=>i(m.path)},...s?{onFind:s.onFind,find:s.find}:{findBox:(0,L.jsx)(dn,{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:{...ct,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)(mt,{tone:f===0?"var(--graview-good)":"var(--graview-warn)"}),f>0?(0,L.jsx)("span",{"aria-hidden":"true",children:f}):null]}),(0,L.jsx)(hr,{context:e}),e.views?(0,L.jsx)(ft,{...e.signature?{signature:!0}:{}}):null]})})})}function wi({context:e,style:t,children:r,...a}){let n=e.embedded||e.framed?"section":"main";return(0,L.jsx)(n,{style:{...Ye,...t},...a,children:r})}function Si({context:e,children:t,...r}){let a=`h${e.titleLevel??(e.framed&&!e.barAbove?1:2)}`;return(0,L.jsx)(a,{style:yr,"data-graview-page-title":"",...r,children:t})}function dn({context:e,narrowsLists:t=!0}){mr("find");let r=k(),a=J(),[n,o]=Ve(),i=r.pathname.split("/").filter(Boolean),l=t&&i.length===1&&Ee(e.store.schema,i[0])!==void 0,s=r.pathname==="/search",u=l||s?n.get("q")??"":"",c=l?`Narrow ${ne(e.store.schema,Ee(e.store.schema,i[0])).toLowerCase()}\u2026`:"",[d,p]=(0,M.useState)(!0);(0,M.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,M.useState)(u),m=(0,M.useRef)(null);(0,M.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,M.useRef)(new Set([u]));(0,M.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{Er as a,Ee as b,hn as c,mn as d,pr as e,Go as f,Xo as g,Qo as h,Zo as i,gr as j,qo as k,ei as l,ti as m,ri as n,ai as o,ni as p,oi as q,ii as r,li as s,ln as t,sn as u,si as v,ui as w,hr as x,k as y,la as z,J as A,ua as B,Sa as C,Ea as D,Xt as E,ba as F,en as G,ae as H,Ve as I,on as J,Bo as K,Wo as L,Ri as M,un as N,wi as O,Si as P,dn as Q};
|
|
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=ma(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(V.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},m):m}function ca(){let e=Kt(),t=At(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 da=g.createElement(ca,null),Yt=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=ia(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(fa,{error:e},t):t}};Yt.contextType=Ht;var Pe=new WeakMap;function fa({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=oa(t.digest);if(n){let o=Pe.get(t);if(o)throw o;let i=$t(n.location,r),l=i.absoluteURL||i.to;if(Oe(n.location,l,Me(a),"allow-explicit"),ea(l))throw new Error("Invalid redirect location");if(_t&&!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 ha({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 ma(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:Yr(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||da,i&&(l<0&&p===0?(Gt("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(ha,{match:d,routeContext:{outlet:c,matches:S,isDataRoute:a!=null},children:w})};return a&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(Yt,{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 pa(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 ya(e){let t=g.useContext(_);return P(t,$e(e)),t}function He(e){let t=ya(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 ga(){return He("useRouteId")}function Jt(){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=>Fr(r,t)),[e,t])}function Kt(){let e=g.useContext(_e),t=Ie("useRouteError"),r=He("useRouteError");return e!==void 0?e:t.errors?.[r]}function va(){let{router:e}=pa("useNavigate"),t=He("useNavigate"),r=g.useRef(!1);return Bt(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{N(r.current,zt),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Et={};function Gt(e,t,r){!t&&!Et[e]&&(Et[e]=!0,N(!1,r))}var Ra="useOptimistic",En=b[Ra];var bn=b.memo(wa);function wa({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return Vt(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function Sa({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=b.useRef();o.current==null&&(o.current=Ct({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=b.useState({action:i.action,location:i.location}),u=b.useCallback(c=>{n===!1?s(c):b.startTransition(()=>s(c))},[n]);return b.useLayoutEffect(()=>i.listen(u),[i,u]),b.createElement(ye,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function Ea({to:e,replace:t,state:r,relative:a}){P(Y(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=b.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}=b.useContext(_),{pathname:l}=k(),s=J(),u=me(e,Ne(i),l,a==="path");Oe(typeof e=="string"?e:U(e),o.createHref(u),Me(o),"reject");let c=JSON.stringify(u);return b.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function Xt(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(!Y(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=b.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=b.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:b.createElement(T.Provider,{value:s},b.createElement(V.Provider,{children:t,value:m}))}function ba({children:e,location:t}){return Wt(fe(e),t)}function fe(e,t=[]){let r=[];return b.Children.forEach(e,(a,n)=>{if(!b.isValidElement(a))return;let o=[...t,n];if(a.type===b.Fragment){r.push.apply(r,fe(a.props.children,o));return}P(a.type===Xt,`[${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 xa(e){return ge(e)&&e.tagName.toLowerCase()==="button"}function Pa(e){return ge(e)&&e.tagName.toLowerCase()==="form"}function Ca(e){return ge(e)&&e.tagName.toLowerCase()==="input"}function La(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Da(e,t){return e.button===0&&(!t||t==="_self")&&!La(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 Fa(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 ka(){if(ie===null)try{new FormData(document.createElement("form"),0),ie=!1}catch{ie=!0}return ie}var Ta=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ce(e){return e!=null&&!Ta.has(e)?(N(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ue}"`),null):e}function Na(e,t){let r,a,n,o,i;if(Pa(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(xa(e)||Ca(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),!ka()){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 xn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ma={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Oa=/[&><\u2028\u2029]/g;function bt(e){return e.replace(Oa,t=>Ma[t])}function ze(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Aa=Symbol("SingleFetchRedirect");function Qt(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 _a(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 $a(e){return e!=null&&typeof e.page=="string"}function Ia(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 Ha(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await _a(o,r);return i.links?i.links():[]}return[]}));return Ba(a.flat(1).filter(Ia).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function xt(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 Ua(e,t,{includeHydrateFallback:r}={}){return ja(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 ja(e){return[...new Set(e)]}function za(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Ba(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!$a(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(za(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function Be(){let e=E.useContext(W);return ze(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ja(){let e=E.useContext(Q);return ze(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var re=E.createContext(void 0);re.displayName="FrameworkContext";function ve(){let e=E.useContext(re);return ze(e,"You must render this element inside a <HydratedRouter> element"),e}function Ka(e,t){let r=E.useContext(re),[a,n]=E.useState(!1),[o,i]=E.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,p=E.useRef(null);E.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]),E.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 qt({page:e,...t}){let r=ta(),{nonce:a}=ve(),{router:n}=Be(),o=E.useMemo(()=>Te(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?E.createElement(Xa,{page:e,matches:o,...t}):E.createElement(Qa,{page:e,matches:o,...t})):null}function Ga(e){let{manifest:t,routeModules:r}=ve(),[a,n]=E.useState([]);return E.useEffect(()=>{let o=!1;return Ha(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function Xa({page:e,matches:t,...r}){let a=k(),{future:n}=ve(),{basename:o}=Be(),i=E.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=Qt(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 E.createElement(E.Fragment,null,i.map(l=>E.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function Qa({page:e,matches:t,...r}){let a=k(),{future:n,manifest:o,routeModules:i}=ve(),{basename:l}=Be(),{loaderData:s,matches:u}=Ja(),c=E.useMemo(()=>xt(e,t,u,o,a,"data"),[e,t,u,o,a]),d=E.useMemo(()=>xt(e,t,u,o,a,"assets"),[e,t,u,o,a]),p=E.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=Qt(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=E.useMemo(()=>Ua(d,o),[d,o]),y=Ga(d);return E.createElement(E.Fragment,null,p.map(m=>E.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})),f.map(m=>E.createElement("link",{key:m,rel:"modulepreload",href:m,...r})),y.map(({key:m,link:h})=>E.createElement("link",{key:m,nonce:r.nonce,...h,crossOrigin:h.crossOrigin??r.crossOrigin})))}function Za(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var qa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{qa&&(window.__reactRouterVersion="7.18.3")}catch{}function en({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=Lt({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 er({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})}er.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=$t(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]=Ka(a,y),Rr=or(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:p,defaultShouldRevalidate:f,useTransitions:R});function wr(j){t&&t(j),j.defaultPrevented||Rr(j)}let Ke=!(x.isExternal||o),Ge=v.createElement("a",{...y,...we,href:(Ke?I:void 0)||x.absoluteURL||C,onClick:Ke?wr:t,ref:Za(m,q),target:u,"data-discover":!w&&r==="render"?"true":void 0});return K&&!w?v.createElement(v.Fragment,null,Ge,v.createElement(qt,{page:C})):Ge});ae.displayName="Link";var tr=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&&ur(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)});tr.displayName="NavLink";var rr=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=ir(),S=lr(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})});rr.displayName="Form";function ar({getKey:e,storageKey:t,...r}){let a=v.useContext(re),{basename:n}=v.useContext(T),o=k(),i=Ue();sr({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})(${bt(JSON.stringify(t||De))}, ${bt(JSON.stringify(l))})`}})}ar.displayName="ScrollRestoration";function nr(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,nr(e)),t}function tn(e){let t=v.useContext(Q);return P(t,nr(e)),t}function or(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(Da(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 Ve(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(()=>Fa(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 rn=0,an=()=>`__${String(++rn)}__`;function ir(){let{router:e}=We("useSubmit"),{basename:t}=v.useContext(T),r=ga(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=Na(o,t);if(i.navigate===!1){let p=i.fetcherKey||an();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 lr(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 sr({getKey:e,storageKey:t}={}){let{router:r}=We("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=tn("useScrollRestoration"),{basename:o}=v.useContext(T),i=k(),l=Ue(),s=Jt();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),nn(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 nn(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 ur(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 dr=D(O(),1),fr=D(Sr(),1);var Re=D(G(),1);function hr({context:e,own:t}){if(oe(e.store),!ot()||e.store.batches().length===0)return null;let a=(0,Re.jsx)(dr.Suspense,{fallback:null,children:(0,Re.jsx)(pt,{})});return t?(0,fr.createPortal)(a,t):(0,Re.jsx)("div",{className:"graview-bar-own",children:a})}var M=D(O(),1);var B=D(O(),1),on=(0,B.createContext)(null);function Bo(){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 mr(e){let t=(0,B.useContext)(on);(0,B.useLayoutEffect)(()=>t?.place(e),[t,e])}function Wo(e,t){return(0,B.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var vr=D(G(),1),pr="var(--graview-font-display, var(--graview-font-body, system-ui))",Ye={maxWidth:760,margin:"0 auto",padding:"40px 20px max(96px, var(--graview-foot-room, 0px))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},Je=1160,Go={...Ye,maxWidth:Je},yr={margin:0,fontFamily:pr,fontSize:"clamp(30px, 4.6vw, 40px)",lineHeight:1.12,fontWeight:600,letterSpacing:"-0.012em",overflowWrap:"anywhere"},Xo={margin:0,fontFamily:pr,fontSize:"1.4375rem",lineHeight:1.25,fontWeight:600,letterSpacing:"-0.006em"},Qo={margin:0,fontSize:"0.8125rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Zo={margin:0,fontSize:"1.1875rem",lineHeight:1.5,color:"var(--graview-ink-muted)",maxWidth:"58ch"},gr={color:"var(--graview-ink-muted)",fontSize:"0.9375rem"},qo={borderTop:"1px solid var(--graview-edge)",paddingTop:24},ei={color:"inherit",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3,display:"inline-flex",alignItems:"center",minHeight:24},ti={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},ri={font:"inherit",fontSize:"0.9375rem",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 ai({kind:e,brand:t,size:r=10,schema:a}){return(0,vr.jsx)(lt,{kind:e,...a?{schema:a}:{},...t?{brand:t}:{},size:Math.round(r*1.6)})}function ni(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 oi(e,t,r){return e.author.kind==="human"&&(e.author.id===void 0||t?.id===void 0||e.author.id===t.id)?"you":r?Qe(e.author,r):e.author.kind==="agent"?e.author.id??"an agent":e.author.id??e.author.kind}function ii(e,t,r){return Xe(e,t,{limit:3,said:[r],glance:!0}).map(a=>a.alone).join(" \xB7 ")}var li=(e,t)=>ne(e.schema,t),ln=(e,t)=>{let r=e.kindsKeptFrom(t);return e.schema.kinds.filter(a=>!e.modules.disabledKinds.has(a)&&!r.has(a))},sn=e=>nt(ln(e.store,e.principal),e.views?.arrangement?.()?.order),si=e=>{let t=new Set(e.views?.arrangement?.()?.hide??[]);return sn(e).filter(r=>!t.has(r))},ui=e=>e.charAt(0).toUpperCase()+e.slice(1);var L=D(G(),1);function Ri({context:e,children:t}){let{store:r,brand:a}=e;return oe(r),it(e.embedded?void 0:tt(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:"1.0625rem",lineHeight:1.6},children:[e.embedded?null:(0,L.jsx)(cn,{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",...gr,fontSize:"0.875rem"},children:(0,L.jsx)("div",{style:{maxWidth:Je,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)(yt,{})]})})}):null]})}var un=(0,M.createContext)(null);function cn({context:e}){let{store:t,brand:r,sceneHref:a="/",invariantContext:n}=e,o=k(),i=J(),l=pe("/").replace(/\/$/,""),s=(0,M.useContext)(un),u=s?.places===!1?[]:st({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=ht(p,"All rules hold");return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(dt,{brand:r,name:r?.name??"Graview",description:r?.subtitle,home:{href:`${l}/`,go:()=>i("/"),current:o.pathname==="/"},faces:{scene:{label:rt(c),current:!1,go:()=>window.location.assign(a)},pages:{label:at(c),current:!0,go:()=>{}}},places:u,current:ut(u,d),reach:{href:m=>`${l}${m}`,go:m=>i(m.path)},...s?{onFind:s.onFind,find:s.find}:{findBox:(0,L.jsx)(dn,{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:{...ct,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)(mt,{tone:f===0?"var(--graview-good)":"var(--graview-warn)"}),f>0?(0,L.jsx)("span",{"aria-hidden":"true",children:f}):null]}),(0,L.jsx)(hr,{context:e}),e.views?(0,L.jsx)(ft,{...e.signature?{signature:!0}:{}}):null]})})})}function wi({context:e,style:t,children:r,...a}){let n=e.embedded||e.framed?"section":"main";return(0,L.jsx)(n,{style:{...Ye,...t},...a,children:r})}function Si({context:e,children:t,...r}){let a=`h${e.titleLevel??(e.framed&&!e.barAbove?1:2)}`;return(0,L.jsx)(a,{style:yr,"data-graview-page-title":"",...r,children:t})}function dn({context:e,narrowsLists:t=!0}){mr("find");let r=k(),a=J(),[n,o]=Ve(),i=r.pathname.split("/").filter(Boolean),l=t&&i.length===1&&Ee(e.store.schema,i[0])!==void 0,s=r.pathname==="/search",u=l||s?n.get("q")??"":"",c=l?`Narrow ${ne(e.store.schema,Ee(e.store.schema,i[0])).toLowerCase()}\u2026`:"",[d,p]=(0,M.useState)(!0);(0,M.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,M.useState)(u),m=(0,M.useRef)(null);(0,M.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,M.useRef)(new Set([u]));(0,M.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{Er as a,Ee as b,hn as c,mn as d,pr as e,Go as f,Xo as g,Qo as h,Zo as i,gr as j,qo as k,ei as l,ti as m,ri as n,ai as o,ni as p,oi as q,ii as r,li as s,ln as t,sn as u,si as v,ui as w,hr as x,k as y,la as z,J as A,ua as B,Sa as C,Ea as D,Xt as E,ba as F,en as G,ae as H,Ve as I,on as J,Bo as K,Wo as L,Ri as M,un as N,wi as O,Si as P,dn as Q};
|
|
4
4
|
/*! Bundled license information:
|
|
5
5
|
|
|
6
6
|
react-router/dist/development/chunk-BV7QT456.mjs:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Be,b as Oe,c as qt,d as _t,f as We}from"./chunk.
|
|
1
|
+
import{a as Be,b as Oe,c as qt,d as _t,f as We}from"./chunk.AS35X6KA.js";import{h as Pt,i as Dt,j as Bt,k as Ot,n as Wt,o as Ft}from"./chunk.FS5K4AVA.js";import"./chunk.DY2FFBWF.js";import"./chunk.MNPNW4BQ.js";import"./chunk.I5KD54S6.js";import"./chunk.EVTZE2OZ.js";import"./chunk.NQNQPPPM.js";import"./chunk.VFICMX5G.js";import{d as Kt}from"./chunk.NKIFVPS3.js";import{b as Nt}from"./chunk.7SVIRYBB.js";import{b as Lt}from"./chunk.ZMMMKTAG.js";import{a as na}from"./chunk.IKT7JQUW.js";import{b as Et,i as Mt}from"./chunk.CW7BMVBG.js";import"./chunk.IZDKEFPJ.js";import{l as Rt}from"./chunk.XDHBV5K5.js";import{a as Ht}from"./chunk.4R7LDCDO.js";import{a as It,b as Q}from"./chunk.TMPV4HLQ.js";import"./chunk.4W24TPMR.js";import"./chunk.AHDOKM4O.js";import"./chunk.6R4EI47C.js";import"./chunk.QZWN46V6.js";import{a as wt,d as ze}from"./chunk.6LJ66MB7.js";import{A as yt,D as kt,E as St,F as $t,J as he,V as zt,ca as Ct,da as T,fa as At,h as ht,i as ye,l as we,m as mt,n as ft,o as ke,p as bt,q as Se,qa as De,r as Ne,ra as Tt,sa as de,u as Pe,va as $e,x as xt,ya as Ee}from"./chunk.OYULDOQP.js";import{Eb as W,Gb as F,U as lt,W as xe,X as dt,Z as Me,_ as Le,_a as gt,bb as pt,cb as ct,mb as ut,tb as vt}from"./chunk.VMEX2KZ4.js";import{a as ae,b as E}from"./chunk.MRK6QJV5.js";import{b as w}from"./chunk.AJZBJBMO.js";var Ce=t=>`${t.saturation}% ${t.lightness}%`,Ut=t=>`${Ce(t)} / ${t.alpha}`;function la(t){let a=vt(t);return`
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
.graview-altitude-control {
|
|
@@ -1036,5 +1036,5 @@ import{a as Be,b as Oe,c as qt,d as _t,f as We}from"./chunk.G3BOZHKR.js";import{
|
|
|
1036
1036
|
[data-graview-connector][data-graview-activity] {
|
|
1037
1037
|
animation: graview-relation 1200ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
1038
1038
|
}`}function Fe(t="dark",a={}){let p=la(t);return a.scope===void 0?p:Et(p,a.scope)}var K=w(ae(),1);var ge=w(E(),1);function Ke(){let{store:t}=T(),a=At(),p=(0,K.useMemo)(()=>t.graph.allEdges().length>0,[t,a]),[s,i]=(0,K.useState)(!1),v=(0,K.useId)(),b=(0,K.useRef)(null),m=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!s)return;let x=S=>{let L=S.target;L&&(m.current?.contains(L)||b.current?.contains(L))||i(!1)};return document.addEventListener("pointerdown",x,!0),()=>document.removeEventListener("pointerdown",x,!0)},[s]),p?(0,ge.jsxs)("div",{style:{display:"contents"},onKeyDown:x=>{x.key!=="Escape"||!s||(x.preventDefault(),x.stopPropagation(),i(!1),b.current?.focus({preventScroll:!0}))},children:[(0,ge.jsx)("button",{ref:b,type:"button","data-testid":"lines-key","aria-expanded":s,"aria-controls":v,title:"What the lines mean",onClick:()=>i(x=>!x),style:{position:"absolute",top:60,right:14,zIndex:F("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:s?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Key"}),s?(0,ge.jsx)("div",{ref:m,id:v,"data-testid":"lines-key-pane","data-graview-offstage":"",style:{position:"absolute",top:98,right:14,zIndex:F("rail"),width:_t,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:(0,ge.jsx)(qt,{inside:!0})}):null]}):null}var h=w(ae(),1);var l=w(E(),1),da="A";function qe({placement:t="float"}={}){let{store:a,menuAt:p,setMenuAt:s,view:i,registerActsDoor:v}=T();(0,h.useEffect)(()=>{if(t==="menu")return v({key:da,open:e=>{let o=e.getBoundingClientRect(),r=e.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??e.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;s({x:Math.round(o.left+Math.min(16,o.width/2)),y:Math.round(Math.min(o.bottom,o.top+36)),...r?{on:r}:{}})}}),()=>v(null)},[t,v,s]);let b=(0,h.useRef)(null),m=(0,h.useRef)(null),x=(0,h.useRef)(null),S=e=>{let o=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),r=e.getAttribute("data-pin-for"),U=o??e.getAttribute("data-affordance")??(r===null?null:`pin:${r}`);m.current=U===null?null:{key:U,element:e}};(0,h.useEffect)(()=>{let e=b.current,o=m.current;if(o===null||document.activeElement!==document.body||o.element.isConnected)return;let r=o.key;if(!e){m.current=null,x.current?.focus();return}((r.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(r.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(r)}"]:not([disabled])`)??e).focus()});let[L,z]=(0,h.useState)(null);(0,h.useLayoutEffect)(()=>{let e=b.current?.offsetParent??b.current?.parentElement;if(e instanceof HTMLElement&&(x.current=e),!e)return;let o=e.getBoundingClientRect();z(r=>r&&r.left===o.left&&r.top===o.top&&r.width===o.width&&r.height===o.height?r:{left:o.left,top:o.top,width:o.width,height:o.height})});let{selection:c,set:C,clear:O}=De(),[$,J]=(0,h.useState)(()=>Bt()),Z=p?.on??c[c.length-1],G=(0,h.useMemo)(()=>({pins:$,...Z===void 0?{}:{focus:Z}}),[$,Z]),ne=(0,h.useMemo)(()=>new Set(a.allMutations().filter(e=>e.pinned).map(e=>e.name)),[a]),{affordances:f,withheld:P,observations:oe}=Wt(G),N=oe.some(e=>e.id.startsWith("schema:waits:")),{apply:Y,preview:D}=Ft(),[_,j]=(0,h.useState)(null),[Te,ie]=(0,h.useState)(!1),[fe,pe]=(0,h.useState)(!1),[n,d]=(0,h.useState)(""),[g,A]=(0,h.useState)(null),M=(0,h.useRef)([]),ee=(e,o)=>{try{return D(e,o),Y(e,o),A(null),s(null),M.current=[],!0}catch(r){return A(ct(a.schema,a.allMutations(),r)),M.current=r instanceof pt?r.issues.map(U=>String(U.path[0]??"")).filter(Boolean):[],!1}},B=[...new Set(c.flatMap(e=>{let o=a.graph.getNode(e);return o?[o.kind]:[]}))],V=B.length>0?B:[...new Set(c.flatMap(e=>yt(e)))],k=c.length===1?ht(c[0]):null,ce=k?{from:a.graph.getNode(k.from),to:a.graph.getNode(k.to)}:null,Je=k?(()=>{let e=a.schema.tryDefinition(a.graph.getNode(k.from)?.kind??"")?.edges?.[k.kind],o=a.graph.getNode(k.to);return e?.inverse&&o?`From ${Q(a,o.id)}: ${e.inverse}`:null})():null;(0,h.useEffect)(()=>{j(null),ie(!1),pe(!1),A(null),d("")},[c]);let y=p!==null,aa=t==="menu"&&!y,ue=(0,h.useRef)(p);ue.current=p;let Ze=Ee("acts",{open:y&&t==="menu",onOpenChange:e=>{e||s(null)},at:()=>ue.current?{x:ue.current.x,y:ue.current.y}:null,returnTo:()=>{let e=ue.current?.on;return e?document.querySelector(`[data-graview-view="${CSS.escape(e)}"]`):null},align:"start"}),et=(L?.width??Number.POSITIVE_INFINITY)<564;if((0,h.useLayoutEffect)(()=>{let e=b.current?.offsetParent;if(!e||!et||y)return;let o=b.current?.getBoundingClientRect().height??0,r=`${Math.round(o)+20}px`;if(e.style.paddingBottom===r)return;let U=e.style.paddingBottom;return e.style.paddingBottom=r,()=>{e.style.paddingBottom=U}}),c.length===0&&!y)return null;let tt=!(c.length===1&&c[0]===i.focusId),at=Math.max(1,Math.min(9,f.length)),se=[...f.filter(e=>e.provider==="invariant"&&!e.destructive),...f.filter(e=>e.pinned&&e.provider!=="invariant"&&!e.destructive),...f.filter(e=>!e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...f.filter(e=>e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...f.filter(e=>e.destructive)],rt=se.length>at&&!y,it=n.trim().toLowerCase(),te=rt&&it.length>0?se.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(it)):null,Re=te??(Te||y?se:se.slice(0,at)),nt=te?0:se.length-Re.length,be=[];for(let e of Re){let o=!y&&e.provider==="invariant",r=!y&&!o&&e.pinned!==void 0&&!e.destructive,U=!y&&!o&&!r&&e.ties===!0&&!e.destructive,st=o?e.why:r?"pinned":U?"its ties":null,ia=o?"violation":r||U?"ties":null,He=be[be.length-1];He&&He.heading===st?He.items.push(e):be.push({heading:st,tone:ia,items:[e]})}let Ie=f.find(e=>e.id===_),ve=c.length===1?Q(a,c[0]):null,ot=e=>{if(!ve)return e;let o=e.startsWith(`"${ve}"`)?e.slice(ve.length+2):e.startsWith(ve)?e.slice(ve.length):null;if(o===null)return e;let r=o.trimStart();return r.length===0?e:r[0].toUpperCase()+r.slice(1)},ra=new Set(y?[]:Re.filter(e=>e.provider==="invariant").map(e=>e.why)),le=oe.filter(e=>!ra.has(e.text)).map(e=>({...e,text:ot(e.text)}));return aa?null:(0,l.jsxs)("section",{...y?Ze.pane:{},ref:e=>{b.current=e,y&&Ze.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":y?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>S(e.target),onBlur:e=>{e.relatedTarget!==null&&(m.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...y?$e:{position:"absolute",zIndex:F("rail")},boxSizing:"border-box",display:"flex",flexDirection:"column",gap:7,padding:"9px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",...y?{width:300,maxHeight:"min(52cqh, 420px)",overflow:"auto"}:et?{left:10,right:10,width:"auto",bottom:10,maxHeight:"min(42cqh, 300px)",overflow:"auto"}:{left:14,top:i.overview?"min(296px, 38cqh)":44,width:236,maxHeight:i.overview?"calc(100cqh - min(296px, 38cqh) - 20px)":"calc(68cqh - 94px)",overflow:"auto"}},children:[(0,l.jsx)("h2",{style:{...ze,margin:0},children:"Inspector"}),(0,l.jsxs)("div",{style:{display:tt||!y?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:y?0:24},children:[tt?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:c.length===1?Q(a,c[0]):`${c.length} selected`}),B.length>0||k?(0,l.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:k?"relation":B.join(" \xB7 ")}):null,c.length===1&&!k?(0,l.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:i.expanded.includes(c[0])?"\xB7 double-click closes":"\xB7 double-click opens"}):null]}):null,(0,l.jsx)("span",{style:{flex:"1 1 auto"}})]}),y?null:(0,l.jsx)("button",{type:"button",onClick:()=>{s(null),O()},"aria-label":"Clear selection",title:"Clear selection",style:{position:"absolute",top:6,right:6,flex:"0 0 auto",width:24,height:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.875rem",lineHeight:1,borderRadius:7},children:"\xD7"}),k&&ce?(0,l.jsxs)("div",{style:{display:"grid",gap:6},children:[Je?(0,l.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:Je}):null,(0,l.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",ce.from],["to",ce.to]].map(([e,o],r)=>(0,l.jsxs)(h.Fragment,{children:[r===1?(0,l.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,o?(0,l.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>C([o.id]),title:`Select ${Q(a,o.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:Q(a,o.id)}):(0,l.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,le.length>0?(0,l.jsx)("div",{"data-testid":"observations",title:le.map(e=>e.text).join(`
|
|
1039
|
-
`),style:{display:"grid",gap:3},children:le.slice(0,2).map(e=>(0,l.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===le[1]&&le.length>2?(0,l.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",le.length-2]}):null]},e.id))}):null,g?(0,l.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:g}):null,rt?(0,l.jsx)("input",{"data-testid":"action-filter",value:n,onChange:e=>d(e.target.value),placeholder:`Filter ${se.length} actions\u2026`,"aria-label":"Filter actions",onKeyDown:e=>{if(e.key==="Escape"){e.stopPropagation(),n.length>0?d(""):e.currentTarget.blur();return}if(e.key==="Enter"&&te?.length===1){let o=te[0];if(o.destructive)return;o.open.length>0?j(o.id):ee(o)&&d("")}},style:{font:"inherit",fontSize:"0.875rem",padding:"5px 9px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):null,te!==null&&te.length===0?(0,l.jsxs)("p",{"data-testid":"no-matches",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:["Nothing offered here matches \u201C",n.trim(),"\u201D."]}):null,f.length===0&&!N?(0,l.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:P.length>0?`Nothing you may do with ${k?"this relation":V.length===1?Me(Le(a.schema.tryDefinition(V[0]),V[0])):"this mix of kinds"} \u2014 ${P.length} action${P.length===1?"":"s"} withheld.`:k?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${dt(a.schema,a.graph.getNode(k.from)?.kind??"",k.kind,"out")}\u201D.`:`Nothing can be done with ${V.length===1?Me(Le(a.schema.tryDefinition(V[0]),V[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${V.length===1?"it":"them"}.`}):(0,l.jsxs)("ol",{"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[be.map((e,o)=>(0,l.jsxs)(h.Fragment,{children:[e.heading?(0,l.jsxs)("li",{"data-graview-heading":e.tone,style:{fontSize:"0.75rem",lineHeight:1.4,color:e.tone==="violation"?"var(--graview-warn)":"var(--graview-ink-faint)",...e.tone!=="violation"?{letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"}:{},padding:"2px 2px 1px",marginTop:o>0?6:0},children:[e.tone==="violation"?"\u26A0 ":"",e.tone==="violation"?ot(e.heading):e.heading]}):o>0?(0,l.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(r=>(0,l.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},children:[(0,l.jsxs)("button",{type:"button","data-affordance":r.id,"data-rank":r.rank,"data-graview-destructive":r.destructive||void 0,"aria-pressed":_===r.id,title:r.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:_===r.id?"var(--graview-accent)":y?"transparent":"var(--graview-edge)",background:y?"none":"var(--graview-panel)",boxShadow:"none",...r.destructive?{color:"var(--graview-warn)"}:{},..._===r.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(r.open.length>0){j(_===r.id?null:r.id);return}ee(r)},children:[r.label,r.open.length>0?(0,l.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,te?.length===1&&te[0]?.id===r.id&&!r.destructive?(0,l.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,l.jsx)("button",{type:"button","data-testid":"pin-toggle","data-pin-for":r.mutation,"aria-pressed":r.pinned!==void 0,"aria-label":r.pinned!==void 0?`Unpin ${r.label}`:`Pin ${r.label}`,title:r.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":r.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>J(Ot($,r.mutation,ne.has(r.mutation))),style:{flex:"0 0 auto",width:24,minHeight:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.75rem",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7,color:r.pinned==="user"?"var(--graview-accent)":r.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:r.pinned!==void 0?"\u2605":"\u2606"})]},r.id))]},`${e.heading??"plain"}-${o}`)),nt>0?(0,l.jsx)("li",{children:(0,l.jsxs)("button",{type:"button",onClick:()=>ie(!0),title:`Show all ${f.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",nt," more"]})}):null]}),P.length>0?(0,l.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[P.slice(0,y||fe?P.length:3).map(e=>(0,l.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,l.jsx)("button",{type:"button",disabled:!0,"data-affordance":e.id,"data-rank":e.rank,"data-withheld":e.refusal.wouldNeed.join(",")||"nobody",style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8,borderStyle:"dashed",width:"100%",textAlign:"left",background:"none"},children:(0,l.jsx)("s",{children:e.label})}),(0,l.jsx)("span",{"data-testid":"withheld-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:e.refusal.message})]},e.id)),!y&&!fe&&P.length>3?(0,l.jsx)("li",{children:(0,l.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>pe(!0),title:`Show all ${P.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",P.length-3," more withheld"]})}):null]}):null,Ie?(0,l.jsx)(Rt,{affordance:Ie,onApply:e=>{if(ee(Ie,e))j(null);else return M.current},onCancel:()=>j(null)}):null]})}var ga=w(ae(),1);var X=w(E(),1);function _e(){let{view:t,go:a}=de(),{store:p,views:s,hiddenKinds:i}=T(),v=t.overview??!1,b=s.places().map(z=>z.kind).filter(z=>!i.has(z)),m=Lt(t,p.schema.kinds,b),x=()=>{a(ye(we(t,!1),m))},S=(()=>{if(!m)return null;let z=kt(m)[0],c=t.within?.view,C=(c?s.places().find(O=>O.as===c):void 0)??(z?s.places().find(O=>O.kind===z):void 0);return C?C.title:z?xe(p.schema,z):p.graph.getNode(m)?.label??null})(),L=v?S?`Down to ${S}`:"Down":"Up";return(0,X.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":v,"aria-label":L,title:v?`${L} \u2014 back down into the view`:"Up \u2014 the whole thing, from above",onClick:()=>v?x():a(we(t,!0)),style:{position:"absolute",top:14,right:14,zIndex:F("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":v?1:0,...v?{color:"var(--graview-accent)"}:{}},children:[(0,X.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,X.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,X.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,X.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,X.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,X.jsx)("span",{className:"graview-altitude-label",children:L})]})}var Ue=w(E(),1);function Ge(){let{administered:t}=T(),{view:a,go:p}=de(),s=t.filter(i=>i.canShow);return s.length===0?null:(0,Ue.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(i=>(0,Ue.jsx)("button",{type:"button","aria-pressed":i.shown,"data-testid":`show-${i.name}`,title:i.shown?`Hide the ${i.name}'s own districts again`:i.description??`Show the ${i.name}'s own districts beside the domain`,onClick:()=>p(mt(a,i.name,!i.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:i.shown?"var(--graview-accent)":"var(--graview-edge)",color:i.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:i.shown?"var(--graview-panel)":"transparent"},children:i.shown?`Hide the ${i.name}`:`Show the ${i.name}`},i.name))})}var R=w(ae(),1);var u=w(E(),1),pa=t=>t.about==="rule"?"rule:":t.about==="act"?"act:":t.kind;function Vt({compact:t=!1}){let{store:a,view:p,setView:s,principal:i,setMenuAt:v,brand:b,seatTalk:m}=T(),x=zt(m),S=Ct(),L=Tt(),z=Nt().marks.flag,c=(0,R.useRef)(null),C=(0,R.useId)(),[O,$]=(0,R.useState)(!1),[J,Z]=(0,R.useState)(null),[G,ne]=(0,R.useState)(null),f=p.q??"";(0,R.useEffect)(()=>{let n=d=>{if(d.defaultPrevented)return;let g=d.key.toLowerCase()==="k"&&(d.metaKey||d.ctrlKey)&&!d.altKey&&!d.shiftKey,A=d.key==="/"&&!d.metaKey&&!d.ctrlKey&&!d.altKey;if(!g&&!A)return;let M=c.current;if(!M)return;let ee=M.closest("[data-graview-embed]"),B=d.target,V=B===document.body||B===document.documentElement||B===window;if(ee&&!(g&&V||B instanceof Node&&ee.contains(B)))return;let k=document.activeElement,ce=k instanceof HTMLInputElement||k instanceof HTMLTextAreaElement||k instanceof HTMLSelectElement||k instanceof HTMLElement&&k.isContentEditable;A&&ce||(d.preventDefault(),M.getClientRects().length===0&&M.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),M.focus({preventScroll:!0}),M.select(),$(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]);let P=(0,R.useMemo)(()=>G&&f.trim()?gt(a,G,S?.words??f,{principal:i,limit:4}):[],[a,f,S,G,i]),oe=(0,R.useMemo)(()=>{let n=new Map;for(let[d,g]of(S?.hits??[]).entries()){if(g.about==="act")continue;let A=pa(g),M=n.get(A)??[];if(M.push({id:`${C}-${d}`,hit:g}),n.set(A,M),g.about==="node"&&g.id===G)for(let[ee,B]of P.entries())M.push({id:`${C}-${d}-act-${ee}`,hit:B})}return[...n.entries()]},[S,P,G,C]),N=x.drawn>0&&f.trim()?{id:`${C}-ask`,ask:f.trim()}:null,Y=(0,R.useMemo)(()=>[...oe.flatMap(([,n])=>n),...N?[N]:[]],[oe,N?.ask]),D=Y.find(n=>n.id===J)??Y[0];(0,R.useEffect)(()=>{Z(null),ne(null)},[f]);let _=n=>{if(n){if(Z(n.id),"ask"in n){ne(null);return}n.hit.about==="node"?ne(n.hit.id):n.hit.about!=="act"&&ne(null)}},j=n=>{if(!n)return;if("ask"in n){m.ask(n.ask),s(g=>ke(g)),$(!1);return}let d=n.hit;switch(d.about){case"node":s(g=>Se(ye(we(g,!1),d.id),[d.id]));break;case"kind":s(g=>St(g,xt(d.kind),{ownPicture:!0,...g.q?{carry:g.q}:{}}));break;case"place":s(g=>$t(g,d.kind,d.as));break;case"rule":{let g=L.filter(A=>A.invariant===d.name).flatMap(A=>A.nodeIds);s(A=>Se(A,[...new Set(g)]));break}case"act":{s(A=>Se(A,[d.subject]));let g=c.current?.getBoundingClientRect();v({x:g?.left??0,y:(g?.bottom??0)+6,on:d.subject});break}}$(!1),c.current?.blur()},Te=S?va(S.byKind,S.hits,a.schema):"",ie=O&&f.trim().length>0,fe=(0,R.useCallback)(()=>{let n=c.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(n)return{x:n.right,y:n.bottom-wa};let d=c.current?.getBoundingClientRect();return d?{x:d.right,y:d.bottom}:null},[]),pe=Ee("find",{open:ie,onOpenChange:n=>{n||$(!1)},...t?{at:fe}:{}});return(0,u.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,u.jsx)("input",{ref:n=>{c.current=n,pe.trigger.ref(n)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":ie,"aria-controls":C,"aria-autocomplete":"list",...ie&&D?{"aria-activedescendant":D.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:f,onChange:n=>{let d=n.target.value;$(!0),s(g=>ft(g,d.length>0?d:null))},onFocus:()=>$(!0),onBlur:()=>$(!1),onKeyDown:n=>{let d=J!==null&&D?Y.indexOf(D):-1;n.key==="ArrowDown"?(n.preventDefault(),$(!0),_(Y[Math.min(Y.length-1,d+1)])):n.key==="ArrowUp"?(n.preventDefault(),_(Y[Math.max(0,d-1)])):n.key==="Enter"?(n.preventDefault(),j(D)):n.key==="Escape"&&(n.preventDefault(),f?s(g=>ke(g)):c.current?.blur())},style:{width:"100%",boxSizing:"border-box",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-panel)",border:`1px solid ${f?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,u.jsx)("span",{role:"status","aria-live":"polite",style:ze,"data-testid":"find-count",children:f.trim()?Te:""}),(0,u.jsxs)("div",{...pe.pane,id:C,role:"listbox","aria-label":f?`What \u201C${f}\u201D finds`:"What the words find","data-testid":"find-strip",hidden:!ie,onMouseDown:n=>n.preventDefault(),style:t?{...Yt,...ha}:Yt,children:[Y.every(n=>"ask"in n)?(0,u.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",S?.words||f,"\u201D."]}):oe.map(([n,d])=>(0,u.jsxs)("div",{role:"group","aria-label":Gt(n,a.schema),children:[(0,u.jsxs)("div",{role:"presentation",style:ma,children:[n!=="rule:"?(0,u.jsx)(ua,{kind:n,accents:b?.accents}):null,Gt(n,a.schema)]}),d.map(g=>(0,u.jsx)("div",{id:g.id,role:"option","aria-selected":g===D,"data-testid":"find-hit","data-about":g.hit.about,onMouseEnter:()=>_(g),onClick:()=>j(g),style:{...jt,...g.hit.about==="act"?{paddingLeft:30}:{},background:g===D?"var(--graview-panel-muted)":"transparent"},children:(0,u.jsx)(ca,{hit:g.hit,flag:z})},g.id))]},n)),N?(0,u.jsx)("div",{id:N.id,role:"option","aria-selected":N===D||D?.id===N.id,"data-testid":"find-ask",onMouseEnter:()=>_(N),onClick:()=>j(N),style:{...jt,borderTop:"1px solid var(--graview-edge)",marginTop:4,background:D?.id===N.id?"var(--graview-panel-muted)":"transparent"},children:(0,u.jsxs)("span",{children:["Ask: ",(0,u.jsxs)("span",{style:{fontWeight:600},children:["\u2018",N.ask,"\u2019"]})]})}):null,S&&S.searched.past===!1&&S.searched.kinds.some(n=>a.schema.tryDefinition(n)?.lifecycle)?(0,u.jsx)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 8px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"Current ones; add is:any for the past."}):null]})]})}function ca({hit:t,flag:a}){switch(t.about){case"node":return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("span",{style:{fontWeight:600,overflowWrap:"anywhere"},children:[t.flagged?(0,u.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[a," "]}):null,t.label,t.apart?(0,u.jsxs)("span",{style:me,children:[" \xB7 ",t.apart]}):null,t.current?null:(0,u.jsx)("span",{style:me,children:" \xB7 past"})]}),t.why.field!=="label"?(0,u.jsxs)("span",{style:me,children:[t.why.reading.toLowerCase(),": ",t.why.fragment]}):null]});case"kind":return(0,u.jsxs)("span",{children:[t.label,(0,u.jsxs)("span",{style:me,children:[" \xB7 ",t.count," match"]})]});case"place":return(0,u.jsxs)("span",{children:["Go to ",t.title]});case"rule":return(0,u.jsxs)("span",{children:["The rule \u201C",t.label,"\u201D"]});case"act":return(0,u.jsxs)("span",{style:t.destructive?{color:"var(--graview-warn)"}:void 0,children:[t.title,(0,u.jsxs)("span",{style:me,children:[" \xB7 ",t.why.field==="title"?"act":`on ${t.why.fragment}`]})]})}}function ua({kind:t,accents:a}){let p=Math.round(ut(t,a));return(0,u.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${p} 55% 52%)`}})}function Gt(t,a){return t==="rule:"?"Rules":t==="act:"?"Acts":a.tryDefinition(t)?.plural??`${t}s`}function va(t,a,p){let s=Object.entries(t).map(([v,b])=>lt(p,v,b)),i=a.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;return i>0&&s.push(`${i} ${i===1?"place or rule":"places and rules"}`),s.length===0?"Nothing found":`${s.join(", ")} found`}var Yt={...$e,width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(60vh, 28rem)",overflowY:"auto",boxSizing:"border-box",background:"var(--graview-panel)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:"4px 0"},wa=6,ha={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},ma={display:"flex",alignItems:"center",gap:6,padding:"8px 12px 2px",fontSize:"0.6875rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},jt={display:"grid",gap:1,minHeight:32,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)"},me={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400};var Ae=w(ae(),1),Ye=w(na(),1);var Xt=w(E(),1);function Qt(){let{following:t,follow:a}=T();return t?(0,Xt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>a(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",t.name]}):null}var Jt=w(ae(),1);var I=w(E(),1);function Zt({home:t,homeLabel:a,children:p,onPicture:s=!1}){let{view:i,focus:v,show:b,go:m}=de(),{store:x}=T(),{movedByHand:S}=T(),L=S&&(i.pan!==void 0||Object.keys(i.pins).length>0),z=i.focusId&&i.focusId!==t?x.graph.getNode(i.focusId):void 0,c=J=>xe(x.schema,J),C={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},O=a!==void 0&&z!==void 0,$=[];return z&&!s&&$.push({key:"focused",node:(0,I.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>m(Ne({...i,focusId:t},!1)),title:Q(x,z.id),style:{...C,maxWidth:"min(14rem, 15vw)"},children:[(0,I.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Q(x,z.id)}),(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),i.past&&$.push({key:"past",node:(0,I.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>m(bt(i,!1)),title:"Back to now \u2014 retired things leave the picture again",style:C,children:["the past",(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),i.zoom&&$.push({key:"zoomed",node:(0,I.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>m(Ne(i,!1)),title:"Zoom back out",style:C,children:["zoomed in",(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),L&&$.push({key:"moved",node:(0,I.jsxs)("button",{type:"button","data-testid":"moved",onClick:()=>m(Pe(i)),title:"Put the camera and everything you dragged back where the layout wanted them",style:C,children:["moved",(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),i.relation&&$.push({key:"raised",node:(0,I.jsxs)("button",{type:"button","data-testid":"raised",onClick:()=>b(null),title:`Stop showing ${c(i.relation)}`,style:C,children:[c(i.relation),(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),s&&!O&&$.length===0&&p===void 0?null:(0,I.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[O?(0,I.jsx)("button",{type:"button",onClick:()=>v(t),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:a}):null,$.map(({key:J,node:Z},G)=>(0,I.jsxs)(Jt.Fragment,{children:[O||G>0?(0,I.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,Z]},J)),p]})}var q=w(E(),1);function je(){let[t,a]=(0,Ae.useState)([]),p=(0,Ae.useCallback)(s=>{a(i=>{let v=s.phase!=="running"&&i[0]?.name===s.name&&i[0]?.at===s.at;return[s,...v?i.slice(1):i].slice(0,12)})},[]);return[t,p]}function Ve({find:t,calls:a,seat:p,remembers:s=!1}){return t?(0,q.jsxs)(q.Fragment,{children:[(0,Ye.createPortal)((0,q.jsx)(Vt,{compact:t.compact}),t.slot),t.own?(0,Ye.createPortal)((0,q.jsx)(It,{calls:a,remembers:s,...p!==void 0?{seat:p}:{}}),t.own):null]}):null}function Qe({home:t=null}){return(0,q.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px)",zIndex:F("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,q.jsx)(Zt,{home:t,onPicture:!0}),(0,q.jsx)("span",{style:{pointerEvents:"auto"},children:(0,q.jsx)(Qt,{})})]})}var re=w(ae(),1);var ea=w(E(),1),fa=wt(()=>import("./chunk.YSYT3ASK.js"));function Xe(){let{store:t,principal:a}=T(),p=(0,re.useContext)(Mt),s=(0,re.useRef)(null),i=(0,re.useRef)(!1);return(0,re.useEffect)(()=>()=>void(i.current=!0),[]),(0,re.useEffect)(()=>{let v=t.batches().length,b=fa().then(m=>m.sceneWay(t,a,p,v,s.current),()=>{});return()=>void b.then(m=>m?.(i.current))},[t,a,p]),(0,ea.jsx)("span",{ref:s,hidden:!0})}var ta=w(ae(),1);var H=w(E(),1);function Ir({address:t=!1,auto:a,seat:p,scheme:s,scope:i}){let v=(0,ta.useMemo)(()=>`${We({scope:`.${i}`})}
|
|
1040
|
-
${Fe(s,{scope:`.${i}`})}`,[s,i]),b=
|
|
1039
|
+
`),style:{display:"grid",gap:3},children:le.slice(0,2).map(e=>(0,l.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===le[1]&&le.length>2?(0,l.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",le.length-2]}):null]},e.id))}):null,g?(0,l.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:g}):null,rt?(0,l.jsx)("input",{"data-testid":"action-filter",value:n,onChange:e=>d(e.target.value),placeholder:`Filter ${se.length} actions\u2026`,"aria-label":"Filter actions",onKeyDown:e=>{if(e.key==="Escape"){e.stopPropagation(),n.length>0?d(""):e.currentTarget.blur();return}if(e.key==="Enter"&&te?.length===1){let o=te[0];if(o.destructive)return;o.open.length>0?j(o.id):ee(o)&&d("")}},style:{font:"inherit",fontSize:"0.875rem",padding:"5px 9px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):null,te!==null&&te.length===0?(0,l.jsxs)("p",{"data-testid":"no-matches",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:["Nothing offered here matches \u201C",n.trim(),"\u201D."]}):null,f.length===0&&!N?(0,l.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:P.length>0?`Nothing you may do with ${k?"this relation":V.length===1?Me(Le(a.schema.tryDefinition(V[0]),V[0])):"this mix of kinds"} \u2014 ${P.length} action${P.length===1?"":"s"} withheld.`:k?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${dt(a.schema,a.graph.getNode(k.from)?.kind??"",k.kind,"out")}\u201D.`:`Nothing can be done with ${V.length===1?Me(Le(a.schema.tryDefinition(V[0]),V[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${V.length===1?"it":"them"}.`}):(0,l.jsxs)("ol",{"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[be.map((e,o)=>(0,l.jsxs)(h.Fragment,{children:[e.heading?(0,l.jsxs)("li",{"data-graview-heading":e.tone,style:{fontSize:"0.75rem",lineHeight:1.4,color:e.tone==="violation"?"var(--graview-warn)":"var(--graview-ink-faint)",...e.tone!=="violation"?{letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"}:{},padding:"2px 2px 1px",marginTop:o>0?6:0},children:[e.tone==="violation"?"\u26A0 ":"",e.tone==="violation"?ot(e.heading):e.heading]}):o>0?(0,l.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(r=>(0,l.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},children:[(0,l.jsxs)("button",{type:"button","data-affordance":r.id,"data-rank":r.rank,"data-graview-destructive":r.destructive||void 0,"aria-pressed":_===r.id,title:r.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:_===r.id?"var(--graview-accent)":y?"transparent":"var(--graview-edge)",background:y?"none":"var(--graview-panel)",boxShadow:"none",...r.destructive?{color:"var(--graview-warn)"}:{},..._===r.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(r.open.length>0){j(_===r.id?null:r.id);return}ee(r)},children:[r.label,r.open.length>0?(0,l.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,te?.length===1&&te[0]?.id===r.id&&!r.destructive?(0,l.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,l.jsx)("button",{type:"button","data-testid":"pin-toggle","data-pin-for":r.mutation,"aria-pressed":r.pinned!==void 0,"aria-label":r.pinned!==void 0?`Unpin ${r.label}`:`Pin ${r.label}`,title:r.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":r.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>J(Ot($,r.mutation,ne.has(r.mutation))),style:{flex:"0 0 auto",width:24,minHeight:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.75rem",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7,color:r.pinned==="user"?"var(--graview-accent)":r.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:r.pinned!==void 0?"\u2605":"\u2606"})]},r.id))]},`${e.heading??"plain"}-${o}`)),nt>0?(0,l.jsx)("li",{children:(0,l.jsxs)("button",{type:"button",onClick:()=>ie(!0),title:`Show all ${f.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",nt," more"]})}):null]}),P.length>0?(0,l.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[P.slice(0,y||fe?P.length:3).map(e=>(0,l.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,l.jsx)("button",{type:"button",disabled:!0,"data-affordance":e.id,"data-rank":e.rank,"data-withheld":e.refusal.wouldNeed.join(",")||"nobody",style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8,borderStyle:"dashed",width:"100%",textAlign:"left",background:"none"},children:(0,l.jsx)("s",{children:e.label})}),(0,l.jsx)("span",{"data-testid":"withheld-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:e.refusal.message})]},e.id)),!y&&!fe&&P.length>3?(0,l.jsx)("li",{children:(0,l.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>pe(!0),title:`Show all ${P.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",P.length-3," more withheld"]})}):null]}):null,Ie?(0,l.jsx)(It,{affordance:Ie,onApply:e=>{if(ee(Ie,e))j(null);else return M.current},onCancel:()=>j(null)}):null]})}var ga=w(ae(),1);var X=w(E(),1);function _e(){let{view:t,go:a}=de(),{store:p,views:s,hiddenKinds:i}=T(),v=t.overview??!1,b=s.places().map(z=>z.kind).filter(z=>!i.has(z)),m=Nt(t,p.schema.kinds,b),x=()=>{a(ye(we(t,!1),m))},S=(()=>{if(!m)return null;let z=kt(m)[0],c=t.within?.view,C=(c?s.places().find(O=>O.as===c):void 0)??(z?s.places().find(O=>O.kind===z):void 0);return C?C.title:z?xe(p.schema,z):p.graph.getNode(m)?.label??null})(),L=v?S?`Down to ${S}`:"Down":"Up";return(0,X.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":v,"aria-label":L,title:v?`${L} \u2014 back down into the view`:"Up \u2014 the whole thing, from above",onClick:()=>v?x():a(we(t,!0)),style:{position:"absolute",top:14,right:14,zIndex:F("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":v?1:0,...v?{color:"var(--graview-accent)"}:{}},children:[(0,X.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,X.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,X.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,X.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,X.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,X.jsx)("span",{className:"graview-altitude-label",children:L})]})}var Ue=w(E(),1);function Ge(){let{administered:t}=T(),{view:a,go:p}=de(),s=t.filter(i=>i.canShow);return s.length===0?null:(0,Ue.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(i=>(0,Ue.jsx)("button",{type:"button","aria-pressed":i.shown,"data-testid":`show-${i.name}`,title:i.shown?`Hide the ${i.name}'s own districts again`:i.description??`Show the ${i.name}'s own districts beside the domain`,onClick:()=>p(mt(a,i.name,!i.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:i.shown?"var(--graview-accent)":"var(--graview-edge)",color:i.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:i.shown?"var(--graview-panel)":"transparent"},children:i.shown?`Hide the ${i.name}`:`Show the ${i.name}`},i.name))})}var R=w(ae(),1);var u=w(E(),1),pa=t=>t.about==="rule"?"rule:":t.about==="act"?"act:":t.kind;function Vt({compact:t=!1}){let{store:a,view:p,setView:s,principal:i,setMenuAt:v,brand:b,seatTalk:m}=T(),x=zt(m),S=Ct(),L=Tt(),z=Rt().marks.flag,c=(0,R.useRef)(null),C=(0,R.useId)(),[O,$]=(0,R.useState)(!1),[J,Z]=(0,R.useState)(null),[G,ne]=(0,R.useState)(null),f=p.q??"";(0,R.useEffect)(()=>{let n=d=>{if(d.defaultPrevented)return;let g=d.key.toLowerCase()==="k"&&(d.metaKey||d.ctrlKey)&&!d.altKey&&!d.shiftKey,A=d.key==="/"&&!d.metaKey&&!d.ctrlKey&&!d.altKey;if(!g&&!A)return;let M=c.current;if(!M)return;let ee=M.closest("[data-graview-embed]"),B=d.target,V=B===document.body||B===document.documentElement||B===window;if(ee&&!(g&&V||B instanceof Node&&ee.contains(B)))return;let k=document.activeElement,ce=k instanceof HTMLInputElement||k instanceof HTMLTextAreaElement||k instanceof HTMLSelectElement||k instanceof HTMLElement&&k.isContentEditable;A&&ce||(d.preventDefault(),M.getClientRects().length===0&&M.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),M.focus({preventScroll:!0}),M.select(),$(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]);let P=(0,R.useMemo)(()=>G&&f.trim()?gt(a,G,S?.words??f,{principal:i,limit:4}):[],[a,f,S,G,i]),oe=(0,R.useMemo)(()=>{let n=new Map;for(let[d,g]of(S?.hits??[]).entries()){if(g.about==="act")continue;let A=pa(g),M=n.get(A)??[];if(M.push({id:`${C}-${d}`,hit:g}),n.set(A,M),g.about==="node"&&g.id===G)for(let[ee,B]of P.entries())M.push({id:`${C}-${d}-act-${ee}`,hit:B})}return[...n.entries()]},[S,P,G,C]),N=x.drawn>0&&f.trim()?{id:`${C}-ask`,ask:f.trim()}:null,Y=(0,R.useMemo)(()=>[...oe.flatMap(([,n])=>n),...N?[N]:[]],[oe,N?.ask]),D=Y.find(n=>n.id===J)??Y[0];(0,R.useEffect)(()=>{Z(null),ne(null)},[f]);let _=n=>{if(n){if(Z(n.id),"ask"in n){ne(null);return}n.hit.about==="node"?ne(n.hit.id):n.hit.about!=="act"&&ne(null)}},j=n=>{if(!n)return;if("ask"in n){m.ask(n.ask),s(g=>ke(g)),$(!1);return}let d=n.hit;switch(d.about){case"node":s(g=>Se(ye(we(g,!1),d.id),[d.id]));break;case"kind":s(g=>St(g,xt(d.kind),{ownPicture:!0,...g.q?{carry:g.q}:{}}));break;case"place":s(g=>$t(g,d.kind,d.as));break;case"rule":{let g=L.filter(A=>A.invariant===d.name).flatMap(A=>A.nodeIds);s(A=>Se(A,[...new Set(g)]));break}case"act":{s(A=>Se(A,[d.subject]));let g=c.current?.getBoundingClientRect();v({x:g?.left??0,y:(g?.bottom??0)+6,on:d.subject});break}}$(!1),c.current?.blur()},Te=S?va(S.byKind,S.hits,a.schema):"",ie=O&&f.trim().length>0,fe=(0,R.useCallback)(()=>{let n=c.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(n)return{x:n.right,y:n.bottom-wa};let d=c.current?.getBoundingClientRect();return d?{x:d.right,y:d.bottom}:null},[]),pe=Ee("find",{open:ie,onOpenChange:n=>{n||$(!1)},...t?{at:fe}:{}});return(0,u.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,u.jsx)("input",{ref:n=>{c.current=n,pe.trigger.ref(n)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":ie,"aria-controls":C,"aria-autocomplete":"list",...ie&&D?{"aria-activedescendant":D.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:f,onChange:n=>{let d=n.target.value;$(!0),s(g=>ft(g,d.length>0?d:null))},onFocus:()=>$(!0),onBlur:()=>$(!1),onKeyDown:n=>{let d=J!==null&&D?Y.indexOf(D):-1;n.key==="ArrowDown"?(n.preventDefault(),$(!0),_(Y[Math.min(Y.length-1,d+1)])):n.key==="ArrowUp"?(n.preventDefault(),_(Y[Math.max(0,d-1)])):n.key==="Enter"?(n.preventDefault(),j(D)):n.key==="Escape"&&(n.preventDefault(),f?s(g=>ke(g)):c.current?.blur())},style:{width:"100%",boxSizing:"border-box",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-panel)",border:`1px solid ${f?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,u.jsx)("span",{role:"status","aria-live":"polite",style:ze,"data-testid":"find-count",children:f.trim()?Te:""}),(0,u.jsxs)("div",{...pe.pane,id:C,role:"listbox","aria-label":f?`What \u201C${f}\u201D finds`:"What the words find","data-testid":"find-strip",hidden:!ie,onMouseDown:n=>n.preventDefault(),style:t?{...Yt,...ha}:Yt,children:[Y.every(n=>"ask"in n)?(0,u.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",S?.words||f,"\u201D."]}):oe.map(([n,d])=>(0,u.jsxs)("div",{role:"group","aria-label":Gt(n,a.schema),children:[(0,u.jsxs)("div",{role:"presentation",style:ma,children:[n!=="rule:"?(0,u.jsx)(ua,{kind:n,accents:b?.accents}):null,Gt(n,a.schema)]}),d.map(g=>(0,u.jsx)("div",{id:g.id,role:"option","aria-selected":g===D,"data-testid":"find-hit","data-about":g.hit.about,onMouseEnter:()=>_(g),onClick:()=>j(g),style:{...jt,...g.hit.about==="act"?{paddingLeft:30}:{},background:g===D?"var(--graview-panel-muted)":"transparent"},children:(0,u.jsx)(ca,{hit:g.hit,flag:z})},g.id))]},n)),N?(0,u.jsx)("div",{id:N.id,role:"option","aria-selected":N===D||D?.id===N.id,"data-testid":"find-ask",onMouseEnter:()=>_(N),onClick:()=>j(N),style:{...jt,borderTop:"1px solid var(--graview-edge)",marginTop:4,background:D?.id===N.id?"var(--graview-panel-muted)":"transparent"},children:(0,u.jsxs)("span",{children:["Ask: ",(0,u.jsxs)("span",{style:{fontWeight:600},children:["\u2018",N.ask,"\u2019"]})]})}):null,S&&S.searched.past===!1&&S.searched.kinds.some(n=>a.schema.tryDefinition(n)?.lifecycle)?(0,u.jsx)("p",{role:"presentation",style:{margin:0,padding:"6px 12px 8px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"Current ones; add is:any for the past."}):null]})]})}function ca({hit:t,flag:a}){switch(t.about){case"node":return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("span",{style:{fontWeight:600,overflowWrap:"anywhere"},children:[t.flagged?(0,u.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[a," "]}):null,t.label,t.apart?(0,u.jsxs)("span",{style:me,children:[" \xB7 ",t.apart]}):null,t.current?null:(0,u.jsx)("span",{style:me,children:" \xB7 past"})]}),t.why.field!=="label"?(0,u.jsxs)("span",{style:me,children:[t.why.reading.toLowerCase(),": ",t.why.fragment]}):null]});case"kind":return(0,u.jsxs)("span",{children:[t.label,(0,u.jsxs)("span",{style:me,children:[" \xB7 ",t.count," match"]})]});case"place":return(0,u.jsxs)("span",{children:["Go to ",t.title]});case"rule":return(0,u.jsxs)("span",{children:["The rule \u201C",t.label,"\u201D"]});case"act":return(0,u.jsxs)("span",{style:t.destructive?{color:"var(--graview-warn)"}:void 0,children:[t.title,(0,u.jsxs)("span",{style:me,children:[" \xB7 ",t.why.field==="title"?"act":`on ${t.why.fragment}`]})]})}}function ua({kind:t,accents:a}){let p=Math.round(ut(t,a));return(0,u.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${p} 55% 52%)`}})}function Gt(t,a){return t==="rule:"?"Rules":t==="act:"?"Acts":a.tryDefinition(t)?.plural??`${t}s`}function va(t,a,p){let s=Object.entries(t).map(([v,b])=>lt(p,v,b)),i=a.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;return i>0&&s.push(`${i} ${i===1?"place or rule":"places and rules"}`),s.length===0?"Nothing found":`${s.join(", ")} found`}var Yt={...$e,width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(60vh, 28rem)",overflowY:"auto",boxSizing:"border-box",background:"var(--graview-panel)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:"4px 0"},wa=6,ha={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},ma={display:"flex",alignItems:"center",gap:6,padding:"8px 12px 2px",fontSize:"0.6875rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},jt={display:"grid",gap:1,minHeight:32,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)"},me={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400};var Ae=w(ae(),1),Ye=w(na(),1);var Xt=w(E(),1);function Qt(){let{following:t,follow:a}=T();return t?(0,Xt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>a(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",t.name]}):null}var Jt=w(ae(),1);var I=w(E(),1);function Zt({home:t,homeLabel:a,children:p,onPicture:s=!1}){let{view:i,focus:v,show:b,go:m}=de(),{store:x}=T(),{movedByHand:S}=T(),L=S&&(i.pan!==void 0||Object.keys(i.pins).length>0),z=i.focusId&&i.focusId!==t?x.graph.getNode(i.focusId):void 0,c=J=>xe(x.schema,J),C={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},O=a!==void 0&&z!==void 0,$=[];return z&&!s&&$.push({key:"focused",node:(0,I.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>m(Ne({...i,focusId:t},!1)),title:Q(x,z.id),style:{...C,maxWidth:"min(14rem, 15vw)"},children:[(0,I.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Q(x,z.id)}),(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),i.past&&$.push({key:"past",node:(0,I.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>m(bt(i,!1)),title:"Back to now \u2014 retired things leave the picture again",style:C,children:["the past",(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),i.zoom&&$.push({key:"zoomed",node:(0,I.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>m(Ne(i,!1)),title:"Zoom back out",style:C,children:["zoomed in",(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),L&&$.push({key:"moved",node:(0,I.jsxs)("button",{type:"button","data-testid":"moved",onClick:()=>m(Pe(i)),title:"Put the camera and everything you dragged back where the layout wanted them",style:C,children:["moved",(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),i.relation&&$.push({key:"raised",node:(0,I.jsxs)("button",{type:"button","data-testid":"raised",onClick:()=>b(null),title:`Stop showing ${c(i.relation)}`,style:C,children:[c(i.relation),(0,I.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),s&&!O&&$.length===0&&p===void 0?null:(0,I.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[O?(0,I.jsx)("button",{type:"button",onClick:()=>v(t),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:a}):null,$.map(({key:J,node:Z},G)=>(0,I.jsxs)(Jt.Fragment,{children:[O||G>0?(0,I.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,Z]},J)),p]})}var q=w(E(),1);function je(){let[t,a]=(0,Ae.useState)([]),p=(0,Ae.useCallback)(s=>{a(i=>{let v=s.phase!=="running"&&i[0]?.name===s.name&&i[0]?.at===s.at;return[s,...v?i.slice(1):i].slice(0,12)})},[]);return[t,p]}function Ve({find:t,calls:a,seat:p,remembers:s=!1}){return t?(0,q.jsxs)(q.Fragment,{children:[(0,Ye.createPortal)((0,q.jsx)(Vt,{compact:t.compact}),t.slot),t.own?(0,Ye.createPortal)((0,q.jsx)(Ht,{calls:a,remembers:s,...p!==void 0?{seat:p}:{}}),t.own):null]}):null}function Qe({home:t=null}){return(0,q.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px)",zIndex:F("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,q.jsx)(Zt,{home:t,onPicture:!0}),(0,q.jsx)("span",{style:{pointerEvents:"auto"},children:(0,q.jsx)(Qt,{})})]})}var re=w(ae(),1);var ea=w(E(),1),fa=wt(()=>import("./chunk.YSYT3ASK.js"));function Xe(){let{store:t,principal:a}=T(),p=(0,re.useContext)(Lt),s=(0,re.useRef)(null),i=(0,re.useRef)(!1);return(0,re.useEffect)(()=>()=>void(i.current=!0),[]),(0,re.useEffect)(()=>{let v=t.batches().length,b=fa().then(m=>m.sceneWay(t,a,p,v,s.current),()=>{});return()=>void b.then(m=>m?.(i.current))},[t,a,p]),(0,ea.jsx)("span",{ref:s,hidden:!0})}var ta=w(ae(),1);var H=w(E(),1);function Ir({address:t=!1,auto:a,seat:p,scheme:s,scope:i}){let v=(0,ta.useMemo)(()=>`${We({scope:`.${i}`})}
|
|
1040
|
+
${Fe(s,{scope:`.${i}`})}`,[s,i]),b=Mt(),[m,x]=je();return(0,H.jsxs)("div",{"data-embed-content":"",style:{position:"relative",flex:a?`0 0 ${Kt}px`:"1 1 auto",minHeight:0,containerType:"size"},children:[(0,H.jsx)("style",{children:v}),t?(0,H.jsx)(Dt,{}):null,(0,H.jsx)(Pt,{renderer:"dom"}),(0,H.jsx)(Qe,{}),(0,H.jsx)(_e,{}),(0,H.jsx)(Ke,{}),(0,H.jsx)(Oe,{}),(0,H.jsx)(Be,{...p?{start:p}:{},onCall:x}),(0,H.jsx)(qe,{placement:"menu"}),(0,H.jsx)(Ve,{find:b,calls:m}),(0,H.jsx)(Xe,{})]})}function Hr(){return(0,H.jsx)(Ge,{})}export{Ir as SceneFace,Hr as SceneKeeping};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as z,b as Z,c as X,d as G}from"./chunk.DG2WKNMX.js";import{a as q}from"./chunk.HPD3DSTP.js";import{c as R,e as K}from"./chunk.VD6FJ6KJ.js";import{a as j,b as $,c as U,e as O,l as W,m as g,n as H}from"./chunk.OHGJ5BZ4.js";import{B as v,C as _,E as I,G as L,I as A,J as k,K as b,P as D,T as x,Y as F}from"./chunk.VMEX2KZ4.js";var T=e=>e?._zod?.def,ie=/^\^\\d\{4\}-\\d\{2\}-\\d\{2\}\$$/;function se(e){let n=T(e),a=!0,r;for(let i=0;n&&i<4;i++){if(n.type==="optional"||n.type==="nullable")a=!1;else if(n.type==="default")a=!1,r=n.defaultValue;else break;n=T(n.innerType)}if(!n)return{why:"it is not a zod field"};let o=_(e),t={...a?{required:!0}:{},...r!==void 0?{default:r}:{},...o?{description:o}:{}},d=(n.checks??[]).map(i=>T(i)),l=b(e);if(l)return{spec:{type:l,...t}};switch(n.type){case"string":{let i=n.format;return i==="email"?{spec:{type:"email",...t}}:i==="url"?{spec:{type:"url",...t}}:i==="date"?{spec:{type:"date",...t}}:i==="datetime"?{spec:{type:"datetime",...t}}:d.some(s=>s?.format==="regex"&&ie.test(String(s?.pattern?.source??"")))?{spec:{type:"date",...t}}:{spec:{type:"string",...t}}}case"number":{let i={};for(let s of d){let u=s?.value;typeof u=="number"&&(s?.check==="greater_than"&&s.inclusive?i.min=Math.max(i.min??u,u):s?.check==="less_than"&&s.inclusive?i.max=Math.min(i.max??u,u):s?.check==="multiple_of"&&(i.step=u))}return{spec:{type:d.some(s=>s?.format==="safeint"||s?.format==="int")?"integer":"number",...i,...t}}}case"boolean":return{spec:{type:"boolean",...t}};case"enum":{let i=Object.keys(n.entries??{});return i.length>0?{spec:{type:"enum",options:i,...t}}:{why:"it is an enum with no options"}}case"array":{let i=T(n.element),s=b(n.element)??(i?.type==="number"?"number":i?.type==="string"?"string":void 0);return s?{spec:{type:"list",of:s,...t}}:{why:`it is a list of ${String(i?.type??"something")}, and a document lists words, numbers, dates, images or files`}}default:return{why:`it is a ${String(n.type)}, which a document has no field type for`}}}function N(e){let n=se(e);return"spec"in n?n.spec:void 0}var M=e=>e.caption?.trim()||e.name;function de(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(a=>{let r=v(n[a]);for(;r?.innerType;)r=v(r.innerType);return b(n[a])!==void 0||r?.type==="array"&&b(r.element)!==void 0})}function Fe(e,n){for(let a of de(n)){let r=k(e[a]).find(A);if(r)return r}}var S=e=>{try{return e()}catch{return null}},ne=e=>typeof e=="string"&&z.includes(e);function le(e){if(e!==void 0)return ne(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:S(()=>R(e.expr))}:"neutral"}var ue=4;function ye(e){let n=typeof e.list=="string"?S(()=>R(e.list)):null,a=e.sort,r=typeof a=="string"?a:a&&typeof a=="object"&&typeof a.by=="string"?a.by:void 0,o=a&&typeof a=="object"?a.direction:void 0,t=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let p=S(()=>R(r));t=p?{t:"call",fn:"sort",args:[n,p,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,G):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,u=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:t,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(u).filter(p=>typeof p[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function J(e,n=1,a=""){if(!Array.isArray(e)||n>ue)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let t=o,d=f=>typeof f=="string"?S(()=>K(f)):null,l=f=>typeof f=="string"?S(()=>R(f)):null,i=le(t.tone),s=typeof t.label=="string"?t.label:void 0,u=f=>Object.hasOwn(t,f),p=typeof t.currency=="string"&&/^[A-Z]{3}$/.test(t.currency)?t.currency:void 0,y=u("list")?"list":u("headline")?"headline":typeof t.figure=="string"?"number":fe.find(u);if(!y)return[];let B=r[y]=(r[y]??0)+1,E=t.key,P=typeof E=="string"&&E?E:`${a}${y}.${B}`;return[{...(()=>{switch(y){case"list":return ye(t);case"number":{let f=X.includes(t.as)?t.as:void 0;return{t:y,value:l(t.figure),...f?{as:f}:{},...p?{currency:p}:{},...s?{label:d(s)}:{}}}case"headline":case"title":return{t:y,parts:d(t[y])};case"text":case"badge":return{t:y,parts:d(t[y]),...i?{tone:i}:{}};case"field":{let f=Z.includes(t.as)?t.as:void 0;return{t:y,field:String(t.field),...f?{as:f}:{},...p?{currency:p}:{},...s?{label:s}:{}}}case"image":return{t:y,field:String(t.image),as:t.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let f=t.progress??{};return{t:y,value:l(f.value),max:l(f.max),...s?{label:d(s)}:{}}}case"group":return{t:y,blocks:J(t.group,n+1,`${P}.`),direction:t.direction==="row"?"row":"column"};case"when":return{t:y,when:l(t.when),show:J(t.show,n+1,`${P}.`)};default:return{t:y}}})(),key:P}]})}var fe=["title","text","badge","field","image","progress","group","when","divider","figure"],m="\u2014",pe=500;function h(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:O(e,{graph:n.graph??W,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??pe})}}catch(a){return{ok:!1,problem:a instanceof Error?a.message:String(a)}}}function w(e,n){if(!e)return{text:m,problem:"a template that does not parse"};let a,r=e.map(o=>{if(o.text!==void 0)return o.text;let t=h(o.expr??null,n);return t.ok?g(t.value,o.format,n.today,o.formatArgs,n.money):(a??=`{${o.source??""}}: ${t.problem}`,m)}).join("");return a?{text:r,problem:a}:{text:r}}function Y(e,n){if(e===void 0)return;if(typeof e=="string")return e;let a=h(e.expr,n);return a.ok&&ne(a.value)?a.value:"neutral"}function ce(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}function me(e,n,a,r,o){if(n==null||n==="")return m;if(typeof n=="boolean")return n?"yes":"no";if(r)return g(n,r,a.today,[],o?{...a.money,currency:o}:a.money);let t=a.fields[e];if(a.definition?.display?.format?.[e])return x(a.definition,e,n);if(t?.type==="date")return g(n,"date",a.today);if(t?.type==="enum"&&typeof n=="string")return x(a.definition,e,n);if(typeof n=="number")return n.toLocaleString("en-US");let d=k(n);return d[0]?d.map(M).join(", "):Array.isArray(n)?n.map(l=>String(l)).join(", "):typeof n=="object"?m:String(n)}function ge(e,n,a,r,o){return typeof e!="number"?String(e):n==="money"?H(e,a?{...o,currency:a}:o):n==="percent"?g(e,n,r):e.toLocaleString("en-US",{maximumFractionDigits:2})}var c=(e,n)=>n?{...e,problem:n}:e;function he(e,n,a){switch(e.t){case"title":{let r=w(e.parts,n);return c({t:"title",text:r.text},r.problem)}case"text":{let r=w(e.parts,n),o=Y(e.tone,n);return c({t:"text",text:r.text,...o?{tone:o}:{}},r.problem)}case"badge":{let r=w(e.parts,n);return c({t:"badge",text:r.text,tone:Y(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??F(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:m,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=n.kinds.get(n.node.kind)?.computed?.has(e.field),t,d;if(o){let s=h({t:"ident",name:e.field,at:0},n);s.ok?t=s.value!==null&&typeof s.value=="object"?g(s.value,void 0,n.today):s.value:d=s.problem}else t=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let l=n.fields[e.field]?.type==="url"&&e.as===void 0?ce(t):void 0,i=S(()=>me(e.field,t,n,e.as,e.currency))??m;return c({t:"field",field:e.field,label:r,text:i,...l?{href:l}:{}},d)}case"image":{let r=k(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(A).slice(0,1);return{t:"image",field:e.field,label:e.label??F(n.definition,e.field),as:e.as,files:o,text:o.map(M).join(", ")||m}}case"progress":{let r=h(e.value,n),o=h(e.max,n),t=e.label?w(e.label,n):{text:"Progress"},d=t.text,l=r.ok?o.ok?t.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?c({t:"progress",label:d,value:r.value,max:o.value,text:`${g(r.value,void 0,n.today)} of ${g(o.value,void 0,n.today)}`},l):c({t:"progress",label:d,text:m},l)}case"group":return{t:"group",direction:e.direction,blocks:Q(e.blocks,n)};case"when":{let r=h(e.when,n),o=r.ok&&r.value===!0;return c({t:"when",shown:o,blocks:o?Q(e.show,n):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=w(e.parts,n),o=Math.min(6,Math.max(1,(a?n.firstHeading:void 0)??n.heading??3));return c({t:"headline",level:o,text:r.text},r.problem)}case"number":{let r=h(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?m:ge(r.value,e.as,e.currency,n.today,n.money),t=e.label?w(e.label,n):void 0;return c({t:"number",text:o,...t?{label:t.text}:{}},r.ok?t?.problem:r.problem)}case"list":return we(e,n)}}function Q(e,n){let a=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...he(r,n,o===a),key:r.key}))}var be=new Set(["every","some","sum","min","max","sort"]);function He(e,n){let a=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":a.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,u)=>{u===1&&be.has(i.fn)||o(s)});return;default:return}},t=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((u,p)=>{let y=s[p];if(y)switch(u.t){case"field":case"image":a.add(u.field);return;case"title":case"text":case"badge":case"headline":t(u.parts);return;case"number":o(u.value),t(u.label);return;case"progress":o(u.value),o(u.max);return;case"group":y.t==="group"&&d(u.blocks,y.blocks);return;case"when":y.t==="when"&&y.shown&&d(u.show,y.blocks);return;case"list":if(y.t==="list")for(let B of y.members)r.add(B.id);return;default:return}})};d(e,n);let l=n[0];return{fields:a,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function we(e,n){let a=Math.min(6,(n.heading??3)+1),r=h(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:a,more:0,problem:r.problem};let o=r.value,t=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(t=Se(t,e.choiceOrder,n.schema));let d=t.length;t=t.slice(0,e.limit??G);let l=e.limit===void 0?d-t.length:0;return{t:"list",as:e.as,failed:!1,members:t,...e.group&&n.schema&&t.length>0?{groups:ke(t,e.group,n.schema)}:{},headingLevel:a,...t.length===0&&e.empty?{empty:e.empty}:{},more:l}}function re(e,n,a){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,a)?N(r[a]):void 0;return o?.type==="enum"?o.options??[]:[]}var V=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Se(e,n,a){let r=o=>{let t=re(a,o.kind,n).indexOf(String(V(o,n)));return t<0?Number.MAX_SAFE_INTEGER:t};return e.map((o,t)=>({node:o,i:t,rank:r(o)})).sort((o,t)=>o.rank-t.rank||o.i-t.i).map(o=>o.node)}function ke(e,n,a){let r=[];for(let d of e)for(let l of re(a,d.kind,n.by))r.includes(l)||r.push(l);let o=[];for(let d of r){let l=e.filter(s=>V(s,n.by)===d);if(l.length===0)continue;let i=a.tryDefinition(l[0].kind);o.push({value:d,heading:n.headings[d]??L(x(i,n.by,d)),members:l})}let t=e.filter(d=>!r.includes(String(V(d,n.by))));return t.length>0&&o.push({value:null,members:t}),o}function ee(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(ee):e.t==="when"?e.show.some(ee):!1}function te(e,n){let a=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,t]of Object.entries(a)){let d=N(t);d&&(r[o]=d)}return r}var oe=new WeakMap;function C(e){let n=oe.get(e);return n||oe.set(e,n=q(e)),n}function Re(e,n,a,r={}){let o=C(e),t={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:D(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(a?a.kind:$)?.computed??[])try{t[i]=l(O(s,{graph:n,subject:a,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{}}))}catch(u){if(!(u instanceof U))throw u;d[i]=u.sentence}return{values:t,refused:d}}function qe(e,n,a){let{values:r}=Re(e,n,a);if(Object.keys(r).length===0)return a;let o=t=>Array.isArray(t)?t.map(o):t!==null&&typeof t=="object"?t.label:t;return{...a,...Object.fromEntries(Object.entries(r).map(([t,d])=>[t,o(d)]))}}var Ae=500,xe=2e4,ae=new WeakMap;function je(e,n){let a=ae.get(e);a||ae.set(e,a=new Map);let r=a.get(n);return r||a.set(n,r=te(e,n)),r}function nn(e,n,a,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,t=n&&a?o.graph.getNode(a.id)??null:a,d=o.schema,l=t&&d.tryDefinition(t.kind),i=!t||(r.slot??"page")==="page",{money:s,firstHeading:u}=r;return{node:t,graph:o.graph,schema:d,kinds:C(d),fields:t?je(d,t.kind):{},definition:l||void 0,today:r.today??o.today?.()??I(),money:s,heading:r.heading??(i?2:3),firstHeading:u,budget:r.budget??(i?xe:Ae)}}export{N as a,M as b,de as c,Fe as d,J as e,Q as f,He as g,ee as h,Re as i,qe as j,nn as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as te,e as ne,f as ie,g as oe}from"./chunk.7THQFY52.js";import{a as Q}from"./chunk.G4JJXA63.js";import{j as X,n as J,o as ee}from"./chunk.FS5K4AVA.js";import"./chunk.DY2FFBWF.js";import"./chunk.MNPNW4BQ.js";import"./chunk.I5KD54S6.js";import"./chunk.EVTZE2OZ.js";import"./chunk.NQNQPPPM.js";import"./chunk.ZMMMKTAG.js";import"./chunk.IZDKEFPJ.js";import"./chunk.XDHBV5K5.js";import{a as G}from"./chunk.TMPV4HLQ.js";import{a as q,d as B}from"./chunk.7QTBDACG.js";import"./chunk.5BN2ARQ2.js";import"./chunk.4W24TPMR.js";import"./chunk.AHDOKM4O.js";import"./chunk.6R4EI47C.js";import"./chunk.QZWN46V6.js";import{d as Z}from"./chunk.6LJ66MB7.js";import{V as U,da as C,i as F,l as _,q as Y,ra as V}from"./chunk.OYULDOQP.js";import{P as j,U as P,V as T,Z as N,_ as W,cb as z}from"./chunk.VMEX2KZ4.js";import{a as he,b as K}from"./chunk.MRK6QJV5.js";import{b as O}from"./chunk.AJZBJBMO.js";var M=3;function re(e,n){return n.id?e.graph.getNode(n.id):void 0}function ae(e){return e?/^(?:kind|aggregate):([^:]+)$/.exec(e)?.[1]:void 0}function le(e,n){if(n)return e.find(t=>t.nodeIds.includes(n)||t.subjectId===n)}var ye=e=>{let n=e.trim();if(!n)return n;let t=n.charAt(0).toUpperCase()+n.slice(1);return/[.!?…]$/.test(t)?t:`${t}.`};function de({store:e,subject:n,violations:t,place:i}){let r=re(e,n),o=le(t,r?.id??null);if(o)return ye(o.message);if(r){let l=r.kind;return`${j(e.schema.tryDefinition(l),r)}, ${N(W(e.schema.tryDefinition(l),l))}.`}let c=i?.kind??ae(n.id);if(c){let l=e.graph.nodesOfKind(c).length,g=i?.title??n.name,u=T(e.schema,c),f=P(e.schema,c,l);return g.toLowerCase()===u.toLowerCase()?`${l===1?"There is":"There are"} ${f} here.`:`${g}: ${f}.`}let a=e.schema.kinds.map(l=>({kind:l,count:e.graph.nodesOfKind(l).length})).filter(l=>l.count>0).sort((l,g)=>g.count-l.count).slice(0,3);if(a.length===0)return"Nothing here yet.";let s=a.map(l=>P(e.schema,l.kind,l.count));return`The whole thing: ${s.length===1?s[0]:`${s.slice(0,-1).join(", ")} and ${s[s.length-1]}`}.`}function ce(e){let{store:n,subject:t,violations:i}=e,r=re(n,t),o=[];r&&le(i,r.id)?o.push({ask:`What's wrong with ${t.name}?`,why:"problem"}):i.length>0&&o.push({ask:"What needs attention?",why:"problem"});let c=r?r.kind:e.place?.kind??ae(t.id),a=ve(e,c);if(a)o.push(a);else{let l=ke(e,c);l&&o.push(l)}let s=be(e,c);return s&&o.push(s),o.length<M&&(r?o.push({ask:`Tell me about ${t.name}`,why:"about"}):o.push({ask:"What is here?",why:"here"})),o.slice(0,M)}function ue(e,n){return e.schema.tryDefinition(n)?.fields?.shape??{}}function me(e){let n=e;for(let t=0;t<4&&n;t++){let i=n;if(Array.isArray(i.options)&&i.options.every(r=>typeof r=="string"))return i.options;n=typeof i.unwrap=="function"?i.unwrap():i._def?.innerType}}var se=/^\d{4}-\d{2}-\d{2}/,Se=["due","deadline","date","when"];function ve(e,n){let{store:t}=e,i=e.today;if(!i||!se.test(i))return;let r=new Date(`${i.slice(0,10)}T00:00:00Z`);r.setUTCDate(r.getUTCDate()+6);let o=r.toISOString().slice(0,10),c=[...new Set([...n?[n]:[],...t.schema.kinds])];for(let a of c){let s=Se.find(u=>u in ue(t,a));if(!s||!t.graph.nodesOfKind(a).some(u=>{let f=u[s],S=u.done;return typeof f=="string"&&se.test(f)&&f.slice(0,10)>=i.slice(0,10)&&f.slice(0,10)<=o&&S!==!0}))continue;let g=T(t.schema,a);return{ask:`${Q(g)} due this week`,why:"due"}}}function ke(e,n){let t=e.place?.title,i=(e.places??[]).find(r=>r.kind!==null&&r.picture===!0&&r.title!==t&&r.kind!==n);return i?{ask:`Go to ${i.title}`,why:"go"}:void 0}function be(e,n){let{store:t}=e,i=[...t.schema.kinds].sort((o,c)=>t.graph.nodesOfKind(c).length-t.graph.nodesOfKind(o).length),r=[...new Set([...n?[n]:[],...i])];for(let o of r){if(t.graph.nodesOfKind(o).length<2)continue;let c=ue(t,o),a=Object.keys(c).find(g=>(me(c[g])?.length??0)>=2);if(!a)continue;let s=T(t.schema,o).toLowerCase(),l=a.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").toLowerCase();return{ask:`Show ${s} as a board by ${l}`,why:"draw"}}}function pe(e,{store:n,subject:t}){let i=a=>t.id!==null&&(a.nodeIds.includes(t.id)||Object.values(a.args).includes(t.id)),r=e.filter(a=>a.provider==="invariant"&&i(a)),o=e.filter(a=>a.pinned==="user"&&!r.includes(a));return[...r,...o].sort((a,s)=>Number(a.destructive??!1)-Number(s.destructive??!1)).slice(0,M).map(a=>({affordance:a,label:Ae(a,{store:n,subject:t})}))}var we=e=>/^[a-z0-9]+(?:[-_][a-z0-9]+)+$|^[a-z]+[A-Z][A-Za-z0-9]*$/.test(e);function Ae(e,{store:n,subject:t}){let i=e.label,r=we(i)||i===e.mutation;if(r){let s=i.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").toLowerCase();i=s.charAt(0).toUpperCase()+s.slice(1)}let o=t.id?n.graph.getNode(t.id):void 0,c=o!==void 0&&e.nodeIds.length<=1&&(e.nodeIds[0]??o.id)===o.id;if(c&&/\bit\b/.test(i))return i.replace(/\bit\b/,t.name);let a=n.allMutations().find(s=>s.name===e.mutation);if(e.open.length===0&&a?.describe&&(r||c))try{let s=a.describe(e.args,n.graph);if(s.trim())return s.trim()}catch{}return i}var y=O(he(),1);var p=O(K(),1);function ze({phone:e,side:n,name:t,onClose:i,respond:r,onCall:o,onPick:c,onMove:a,place:s,onDraft:l}){let{seatTalk:g}=C(),u=U(g),f=xe(c),S=[...u.turns].reverse().find(h=>h.role==="seat"),m=e&&u.draft!==null,b=(0,y.useRef)(null),w=(0,y.useRef)(!0);return(0,y.useLayoutEffect)(()=>{let h=b.current;if(!h)return;let A=m?[...h.querySelectorAll("ol > li")].pop():void 0;if(A){let v=A.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop;h.style.maxHeight=`min(${Math.ceil(h.scrollHeight-v)}px, ${ge})`}let k=w.current?fe.get(g):void 0;w.current=!1,h.scrollTop=k&&k.turns===u.turns.length&&!u.busy?k.top:h.scrollHeight},[u.turns.length,u.busy,m]),(0,p.jsxs)("div",{"data-testid":"seat-panel",...m?{"data-graview-seat-yields":""}:{},style:{display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",gap:4,minHeight:0},children:[(0,p.jsxs)("div",{"data-testid":"seat-top",...e?{onPointerDown:h=>Ce(h,i)}:{},style:{display:"flex",alignItems:"center",justifyContent:e?"center":"flex-end",gap:2,position:"relative",minHeight:28,...e?{touchAction:"none"}:{}},children:[e?(0,p.jsx)("button",{type:"button","data-testid":"seat-grab","aria-label":`Close Ask ${t}`,title:"Close",onClick:i,style:{...E,width:64},children:(0,p.jsx)("span",{"aria-hidden":"true",style:{display:"block",width:36,height:4,margin:"0 auto",borderRadius:2,background:"var(--graview-edge-strong, var(--graview-ink-faint))"}})}):(0,p.jsx)("button",{type:"button","data-testid":"seat-side","aria-label":n==="left"?"Move to the right":"Move to the left",title:n==="left"?"Move to the right":"Move to the left",onClick:()=>g.setSide(n==="left"?"right":"left"),style:E,children:(0,p.jsx)("span",{"aria-hidden":"true",children:"\u21C4"})}),(0,p.jsx)("button",{type:"button","data-testid":"seat-close","aria-label":`Close Ask ${t}`,title:"Close",onClick:i,style:e?{...E,position:"absolute",top:0,right:0}:E,children:(0,p.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]}),(0,p.jsx)("div",{ref:b,"data-testid":"seat-body",onScroll:h=>void fe.set(g,{top:h.currentTarget.scrollTop,turns:u.turns.length}),style:{minHeight:0,maxHeight:m?ge:e?"calc(70cqh - 96px)":"min(520px, calc(100cqh - 112px))",overflowY:"auto",overflowX:"hidden",padding:"0 4px"},children:(0,p.jsx)(ne,{shared:!0,composer:!1,testId:"seat",onPick:f,...a?{onMove:a}:{},...s?{place:s}:{},...l?{onDraft:l}:{},empty:(0,p.jsx)(Te,{...s?{here:s}:{}}),...r?{respond:r}:{},...o?{onCall:o}:{}})}),(0,p.jsx)("p",{"aria-live":"polite","data-testid":"seat-said",style:Z,children:u.busy?"":S?.text??""})]})}function xe(e){let{setView:n}=C();return(0,y.useCallback)(t=>e?e(t):n(i=>Y(F(_(i,!1),t),[t])),[e,n])}function Te({here:e}){let{store:n,views:t,view:i,seatTalk:r}=C(),o=te({hover:!1}),c=q(n,V()),a=(0,y.useMemo)(()=>c.map(d=>d.line?{...d,message:B(d)}:d),[c]),s=o.id?n.graph.getNode(o.id):void 0,l=e??i.within?.view,g=o.because==="place"&&o.id===null?t.places().find(d=>d.title===o.name):l?t.places().find(d=>d.as===l):void 0,u=n.today(),f={store:n,subject:{id:o.id,name:o.name},violations:a,place:g?{title:g.title,kind:g.kind}:null,places:t.places().map(d=>({title:d.title,kind:d.kind,picture:!0})),...u?{today:u}:{}},S=de(f),m=ce(f),b=(0,y.useMemo)(()=>({pins:X(),...s?{focus:s.id,about:[s.id]}:{}}),[s?.id]),{affordances:w}=J(b),h=s?pe(w,{store:n,subject:{id:o.id,name:o.name}}):[],{apply:A,preview:k}=ee(),[v,$]=(0,y.useState)(null),[D,R]=(0,y.useState)(null),H=(d,x)=>{try{return k(d,x),A(d,x),R(null),!0}catch(I){return R(z(n.schema,n.allMutations(),I)),!1}};return(0,p.jsxs)("div",{"data-testid":"seat-here",style:{display:"grid",gap:10,padding:"2px 2px 6px"},children:[(0,p.jsx)("p",{"data-testid":"seat-where",style:{margin:0,fontSize:"0.9375rem",lineHeight:1.45,color:"var(--graview-ink)"},children:S}),h.length>0?(0,p.jsx)("ul",{"aria-label":"What you can do",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:6},children:h.map(({affordance:d,label:x})=>(0,p.jsx)("li",{children:(0,p.jsx)("button",{type:"button","data-testid":"seat-act","data-affordance":d.id,"aria-pressed":v?.id===d.id,title:d.why,onClick:()=>d.open.length>0?$(I=>I?.id===d.id?null:d):void H(d),style:{...ie,minHeight:30,textAlign:"start",...d.destructive?{color:"var(--graview-warn)"}:{}},children:x})},d.id))}):null,v?(0,p.jsx)(G,{affordance:v,onApply:d=>{H(v,d)&&$(null)},onCancel:()=>$(null)}):null,D?(0,p.jsx)("p",{"data-testid":"seat-refused",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-warn)"},children:D}):null,m.length>0?(0,p.jsx)("ul",{"aria-label":"Things to ask",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:2,justifyItems:"start"},children:m.map(d=>(0,p.jsx)("li",{children:(0,p.jsx)("button",{type:"button","data-testid":"seat-suggestion","data-graview-why":d.why,onClick:()=>r.ask(d.ask),style:oe,children:d.ask})},d.ask))}):null]})}var ge="min(5.5em, 22cqh)",fe=new WeakMap,L={far:64,flick:.5,least:16,tap:6};function Ce(e,n){if(e.button!==0)return;let t=e.currentTarget,i=t.closest('[data-testid="seat"]');if(!i)return;let r=e.pointerId,o=e.clientY,c={y:o,at:e.timeStamp},a=0,s=0;try{t.setPointerCapture(r)}catch{}let l=u=>{if(u.pointerId!==r)return;s=Math.max(0,u.clientY-o);let f=u.timeStamp-c.at;f>0&&(a=(u.clientY-c.y)/f),c={y:u.clientY,at:u.timeStamp},i.style.transition="none",i.style.transform=s>0?`translateY(${s}px)`:""},g=u=>{if(u.pointerId!==r)return;t.removeEventListener("pointermove",l),t.removeEventListener("pointerup",g),t.removeEventListener("pointercancel",g);let f=u.type==="pointerup"&&(s>=L.far||s>=L.least&&a>=L.flick);if(i.style.transition=f?"":"transform 160ms ease-out",i.style.transform="",s>L.tap){let S=m=>{m.preventDefault(),m.stopPropagation()};t.addEventListener("click",S,{capture:!0,once:!0}),setTimeout(()=>t.removeEventListener("click",S,{capture:!0}),0)}f&&n()};t.addEventListener("pointermove",l),t.addEventListener("pointerup",g),t.addEventListener("pointercancel",g)}var E={display:"inline-grid",placeItems:"center",width:28,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,color:"var(--graview-ink-muted)",background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer"};export{ze as SeatPanel,xe as useSeatGo};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as l,H as p,O as k,P as y,c}from"./chunk.TX2GOL65.js";import"./chunk.T2EZ5MTH.js";import"./chunk.ONDILMIX.js";import{b as m}from"./chunk.AS35X6KA.js";import"./chunk.KAKX5TZN.js";import"./chunk.VFICMX5G.js";import"./chunk.IKT7JQUW.js";import"./chunk.CW7BMVBG.js";import"./chunk.IZDKEFPJ.js";import"./chunk.XDHBV5K5.js";import"./chunk.WVUJXDXZ.js";import"./chunk.UMMN5Z6V.js";import"./chunk.DG2WKNMX.js";import"./chunk.HPD3DSTP.js";import"./chunk.VD6FJ6KJ.js";import"./chunk.OHGJ5BZ4.js";import"./chunk.7QTBDACG.js";import"./chunk.5BN2ARQ2.js";import"./chunk.4W24TPMR.js";import"./chunk.AHDOKM4O.js";import"./chunk.6R4EI47C.js";import"./chunk.LHAAZQNQ.js";import"./chunk.PHY3AH3L.js";import"./chunk.QZWN46V6.js";import"./chunk.6LJ66MB7.js";import{T as s,V as d,ea as g}from"./chunk.OYULDOQP.js";import"./chunk.VMEX2KZ4.js";import{a as S,b as f}from"./chunk.MRK6QJV5.js";import{b as n}from"./chunk.AJZBJBMO.js";var u=n(S(),1);var t=n(f(),1);function D({context:a}){let r=l(),h=g(),[w]=(0,u.useState)(()=>s(null)),o=d(h?.seatTalk??w),P=()=>{(window.history.state?.idx??0)>0?r(-1):r("/")};return(0,t.jsxs)(k,{context:a,"data-testid":"draft-page",children:[(0,t.jsx)(y,{context:a,...o.draft?{"data-testid":"draft-title"}:{},children:o.draft?o.draft.title:"Nothing drawn"}),o.draft?(0,t.jsx)(m,{page:!0,go:e=>r(e.address),onPick:e=>{let i=a.store.graph.getNode(e);i&&r(c(a.store.schema,i.kind,e))},onDiscard:P}):(0,t.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:["Ask for a way of seeing \u2014 \u201Ca board of tasks by status\u201D \u2014 and it is drawn here."," ",(0,t.jsx)(p,{to:"/",style:{color:"var(--graview-accent)"},children:"Home \u2192"})]})]})}export{D as DraftPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as O,k as b}from"./chunk.
|
|
1
|
+
import{f as O,k as b}from"./chunk.OHGJ5BZ4.js";function K(n,s){return s===1&&["every","some","sum","min","max","sort"].includes(n.fn)}function S(n){let s=new Set,e=new Set,r=[],i=[],o=new Set(O),a=(l,f)=>{switch(l.t){case"lit":return;case"ident":f||s.add(l.name);return;case"list":l.items.forEach(c=>a(c,f));return;case"member":a(l.object,f);return;case"unary":a(l.operand,f);return;case"binary":a(l.left,f),a(l.right,f);return;case"where":a(l.set,f),a(l.filter,!0);return;case"call":{e.add(l.fn);let c=(l.fn==="out"||l.fn==="in")&&l.args.length===2?l.args[1]:l.args[0],h=c?.t==="lit"&&typeof c.value=="string"?c.value:void 0;l.fn==="all"&&h&&r.push(h),(l.fn==="out"||l.fn==="in")&&h&&i.push(h),l.args.forEach((k,x)=>a(k,f||K(l,x)));return}}};return a(n,!1),{names:s,functions:e,unknownFunctions:[...e].filter(l=>!o.has(l)),sweeps:r,edges:i}}var p=class extends Error{constructor(e,r,i){super(`${e} (at character ${r+1} of "${i}")`);this.sentence=e;this.at=r;this.source=i}},q=["||","&&","==","!=","<=",">=","<",">","!","|","&","+","-","*","/","%","(",")","[","]",",","."],F={and:"&&",or:"||",not:"!"},M=2e3;function I(n){let s=[],e=0;for(;e<n.length;){let r=n[e];if(r===" "||r===" "||r===`
|
|
2
2
|
`||r==="\r"){e++;continue}if(r>="0"&&r<="9"){let o=e;for(;e<n.length&&/[0-9.]/.test(n[e]);)e++;let a=n.slice(o,e),l=Number(a);if(!Number.isFinite(l)||a.split(".").length>2)throw new p(`"${a}" is not a number`,o,n);s.push({k:"num",v:l,at:o});continue}if(r==="'"||r==='"'){let o=e++,a="";for(;e<n.length&&n[e]!==r;)n[e]==="\\"&&e+1<n.length&&e++,a+=n[e++];if(e>=n.length)throw new p("a quoted word is never closed",o,n);e++,s.push({k:"str",v:a,at:o});continue}if(/[A-Za-z_]/.test(r)){let o=e;for(;e<n.length&&/[A-Za-z0-9_]/.test(n[e]);)e++;let a=n.slice(o,e),l=Object.hasOwn(F,a)?F[a]:void 0;s.push(l?{k:"op",v:l,at:o}:{k:"id",v:a,at:o});continue}let i=q.find(o=>n.startsWith(o,e));if(!i)throw new p(`"${r}" is not part of the rule language`,e,n);s.push({k:"op",v:i,at:e}),e+=i.length}return s.push({k:"end",at:n.length}),s}function w(n){if(n.length>M)throw new p(`an expression may be at most ${M} characters`,0,n.slice(0,40));let s=I(n),e=0,r=()=>s[e],i=t=>{let d=r();return d.k==="op"&&d.v===t},o=t=>{let d=r();return d.k==="id"&&d.v===t},a=(t,d)=>{if(!i(t))throw new p(`expected ${d}`,r().at,n);e++},l=0,f=(t,d)=>{if(++l>64)throw new p("the expression nests too deeply",t,n);try{return d()}finally{l--}},c=(t,d)=>()=>{let u=d();for(;;){let y=r(),R=y.k==="op"?t.find(B=>B===y.v):y.k==="id"&&y.v==="in"&&t.includes("in")?"in":void 0;if(!R)return u;e++,u={t:"binary",op:R,left:u,right:d(),at:y.at}}},h=()=>{let t=r();if(t.k==="num")return e++,{t:"lit",value:t.v,at:t.at};if(t.k==="str")return e++,{t:"lit",value:t.v,at:t.at};if(t.k==="id"){if(e++,t.v==="true"||t.v==="false")return{t:"lit",value:t.v==="true",at:t.at};if(t.v==="null")return{t:"lit",value:null,at:t.at};if(i("(")){e++;let d=[];if(!i(")"))for(;;){if(d.push(m()),i(",")){e++;continue}break}return a(")",`")" to close ${t.v}(\u2026)`),{t:"call",fn:t.v,args:d,at:t.at}}return{t:"ident",name:t.v,at:t.at}}if(t.k==="op"&&t.v==="("){e++;let d=f(t.at,m);return a(")",'a ")"'),d}if(t.k==="op"&&t.v==="["){e++;let d=[];if(!i("]"))for(;;){if(d.push(m()),i(",")){e++;continue}break}return a("]",'a "]" to close the list'),{t:"list",items:d,at:t.at}}throw t.k==="end"?new p("the expression ends too soon",t.at,n):new p(`"${t.k==="op"?t.v:""}" cannot start a value here`,t.at,n)},k=()=>{let t=h();for(;;){if(i(".")){let d=r();e++;let u=r();if(u.k!=="id")throw new p('expected a field name after "."',u.at,n);e++,t={t:"member",object:t,name:u.v,at:d.at};continue}if(o("where")){let d=r().at;e++,t={t:"where",set:t,filter:f(d,m),at:d};continue}return t}},x=()=>{let t=r();return t.k==="op"&&(t.v==="!"||t.v==="-")?(e++,{t:"unary",op:t.v,operand:f(t.at,x),at:t.at}):k()},T=c(["*","/","%"],x),C=c(["+","-"],T),A=c(["&"],C),v=c(["|"],A),P=()=>{let t=v(),d=r(),u=d.k==="op"&&["==","!=","<","<=",">",">="].includes(d.v)?d.v:d.k==="id"&&d.v==="in"?"in":void 0;return u?(e++,{t:"binary",op:u,left:t,right:v(),at:d.at}):t},$=()=>{let t=r();return t.k==="op"&&t.v==="!"?(e++,{t:"unary",op:"!",operand:f(t.at,$),at:t.at}):P()},z=c(["&&"],$),_=c(["||"],z);function m(){return _()}let N=m();if(r().k!=="end")throw new p("there is more after the end of the expression",r().at,n);return N}function D(n){let s,e=-1,r=0;for(let i=0;i<n.length;i++){let o=n[i];if(s){o==="\\"?i++:o===s&&(s=void 0);continue}o==="'"||o==='"'?s=o:o==="("||o==="["?r++:o===")"||o==="]"?r--:o==="|"&&r===0&&(n[i+1]==="|"?i++:e=i)}return e}var E=/\s*(?:'((?:[^'\\]|\\.)*)'|"((?:[^"\\]|\\.)*)")\s*(,|$)/y;function H(n){let s=n.indexOf(":"),e=(s>=0?n.slice(0,s):n).trim();if(!b.includes(e))throw new g(`"${e}" is not a formatter; use one of ${b.join(", ")}`);let r=[];if(s>=0){let i=n.slice(s+1),o=0;for(;o<i.length;){E.lastIndex=o;let a=E.exec(i);if(!a)throw new g(`"${e}" is told quoted words, like ${e}: 'offer'`);if(r.push((a[1]??a[2]??"").replace(/\\(.)/g,"$1")),o=E.lastIndex,a[3]==="")break}}if(e==="plural"&&(r.length<1||r.length>2))throw new g("plural is told its noun, like {count | plural: 'offer'}, and its plural where English does not make it: plural: 'person', 'people'");if(e!=="plural"&&r.length>0)throw new g(`"${e}" takes nothing after it`);return{format:e,args:r}}var g=class extends Error{constructor(e){super(e);this.sentence=e}};function J(n){let s=[],e=0;for(;e<n.length;){let r=n.indexOf("{",e);if(r<0){s.push({text:n.slice(e)});break}r>e&&s.push({text:n.slice(e,r)});let i=n.indexOf("}",r);if(i<0)throw new g(`a "{" at character ${r+1} is never closed`);let o=n.slice(r+1,i),a=D(o),l=(a>=0?o.slice(0,a):o).trim(),f=a>=0?H(o.slice(a+1)):void 0;s.push({expr:w(l),source:l,...f?{format:f.format}:{},...f&&f.args.length>0?{formatArgs:f.args}:{}}),e=i+1}return s}function j(n){let s=new Map;for(let[e,r]of Object.entries(n?.computed??{}))s.set(e,typeof r=="string"?{expr:r}:r);return s}function te(n){let s=j(n);if(s.size===0)return;let e=new Map;for(let[r,i]of s)try{e.set(r,w(i.expr))}catch(o){if(!(o instanceof p))throw o}return e}function L(n,s,e=new Set){let r=j(n).get(s);if(!r||e.has(s))return!1;let i;try{i=w(r.expr)}catch{return!1}let o=S(i);if(o.edges.length>0||o.sweeps.length>0||[...o.functions].some(c=>c==="out"||c==="in"||c==="all"))return!1;let a=n.fields,l=c=>a instanceof Set?a.has(c):Object.hasOwn(a,c),f=new Set([...e,s]);return[...o.names].every(c=>l(c)||L(n,c,f))}export{S as a,p as b,w as c,g as d,J as e,j as f,te as g,L as h};
|