@devmoods/postgres-admin 0.5.0 → 0.5.1
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/client/_index.html
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<meta name="x-title" content="{{ title }}" />
|
|
14
14
|
<link rel="manifest" href="/manifest.json" />
|
|
15
15
|
<title>{{ title }}</title>
|
|
16
|
-
<script type="module" crossorigin src="/{{ basename }}/assets/index-
|
|
16
|
+
<script type="module" crossorigin src="/{{ basename }}/assets/index-B8Oywtmy.js"></script>
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/{{ basename }}/assets/index-CsmHBa6X.css">
|
|
18
18
|
</head>
|
|
19
19
|
<body>
|
|
@@ -71,7 +71,7 @@ Error generating stack: `+l.message+`
|
|
|
71
71
|
*/var Fb="popstate";function PM(t={}){function r(i,o){let{pathname:s,search:f,hash:d}=i.location;return To("",{pathname:s,search:f,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function a(i,o){return typeof o=="string"?o:pi(o)}return kM(r,a,null,t)}function qe(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function It(t,r){if(!t){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function qM(){return Math.random().toString(36).substring(2,10)}function Vb(t,r){return{usr:t.state,key:t.key,idx:r}}function To(t,r,a=null,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof r=="string"?Ea(r):r,state:a,key:r&&r.key||i||qM()}}function pi({pathname:t="/",search:r="",hash:a=""}){return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),a&&a!=="#"&&(t+=a.charAt(0)==="#"?a:"#"+a),t}function Ea(t){let r={};if(t){let a=t.indexOf("#");a>=0&&(r.hash=t.substring(a),t=t.substring(0,a));let i=t.indexOf("?");i>=0&&(r.search=t.substring(i),t=t.substring(0,i)),t&&(r.pathname=t)}return r}function kM(t,r,a,i={}){let{window:o=document.defaultView,v5Compat:s=!1}=i,f=o.history,d="POP",h=null,v=y();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function y(){return(f.state||{idx:null}).idx}function S(){d="POP";let R=y(),T=R==null?null:R-v;v=R,h&&h({action:d,location:x.location,delta:T})}function p(R,T){d="PUSH";let A=To(x.location,R,T);v=y()+1;let N=Vb(A,v),j=x.createHref(A);try{f.pushState(N,"",j)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;o.location.assign(j)}s&&h&&h({action:d,location:x.location,delta:1})}function g(R,T){d="REPLACE";let A=To(x.location,R,T);v=y();let N=Vb(A,v),j=x.createHref(A);f.replaceState(N,"",j),s&&h&&h({action:d,location:x.location,delta:0})}function w(R){let T=o.location.origin!=="null"?o.location.origin:o.location.href,A=typeof R=="string"?R:pi(R);return A=A.replace(/ $/,"%20"),qe(T,`No window.location.(origin|href) available to create URL for href: ${A}`),new URL(A,T)}let x={get action(){return d},get location(){return t(o,f)},listen(R){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(Fb,S),h=R,()=>{o.removeEventListener(Fb,S),h=null}},createHref(R){return r(o,R)},createURL:w,encodeLocation(R){let T=w(R);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:p,replace:g,go(R){return f.go(R)}};return x}var FM=new Set(["lazy","caseSensitive","path","id","index","children"]);function VM(t){return t.index===!0}function Vc(t,r,a=[],i={}){return t.map((o,s)=>{let f=[...a,String(s)],d=typeof o.id=="string"?o.id:f.join("-");if(qe(o.index!==!0||!o.children,"Cannot specify children on an index route"),qe(!i[d],`Found a route id collision on id "${d}". Route id's must be globally unique within Data Router usages`),VM(o)){let h={...o,...r(o),id:d};return i[d]=h,h}else{let h={...o,...r(o),id:d,children:void 0};return i[d]=h,o.children&&(h.children=Vc(o.children,r,f,i)),h}})}function Ja(t,r,a="/"){return Oc(t,r,a,!1)}function Oc(t,r,a,i){let o=typeof r=="string"?Ea(r):r,s=Sr(o.pathname||"/",a);if(s==null)return null;let f=Ix(t);QM(f);let d=null;for(let h=0;d==null&&h<f.length;++h){let v=r5(s);d=t5(f[h],v,i)}return d}function YM(t,r){let{route:a,pathname:i,params:o}=t;return{id:a.id,pathname:i,params:o,data:r[a.id],handle:a.handle}}function Ix(t,r=[],a=[],i=""){let o=(s,f,d)=>{let h={relativePath:d===void 0?s.path||"":d,caseSensitive:s.caseSensitive===!0,childrenIndex:f,route:s};h.relativePath.startsWith("/")&&(qe(h.relativePath.startsWith(i),`Absolute route path "${h.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(i.length));let v=Hr([i,h.relativePath]),y=a.concat(h);s.children&&s.children.length>0&&(qe(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Ix(s.children,r,y,v)),!(s.path==null&&!s.index)&&r.push({path:v,score:WM(v,s.index),routesMeta:y})};return t.forEach((s,f)=>{var d;if(s.path===""||!((d=s.path)!=null&&d.includes("?")))o(s,f);else for(let h of Jx(s.path))o(s,f,h)}),r}function Jx(t){let r=t.split("/");if(r.length===0)return[];let[a,...i]=r,o=a.endsWith("?"),s=a.replace(/\?$/,"");if(i.length===0)return o?[s,""]:[s];let f=Jx(i.join("/")),d=[];return d.push(...f.map(h=>h===""?s:[s,h].join("/"))),o&&d.push(...f),d.map(h=>t.startsWith("/")&&h===""?"/":h)}function QM(t){t.sort((r,a)=>r.score!==a.score?a.score-r.score:e5(r.routesMeta.map(i=>i.childrenIndex),a.routesMeta.map(i=>i.childrenIndex)))}var KM=/^:[\w-]+$/,GM=3,XM=2,ZM=1,IM=10,JM=-2,Yb=t=>t==="*";function WM(t,r){let a=t.split("/"),i=a.length;return a.some(Yb)&&(i+=JM),r&&(i+=XM),a.filter(o=>!Yb(o)).reduce((o,s)=>o+(KM.test(s)?GM:s===""?ZM:IM),i)}function e5(t,r){return t.length===r.length&&t.slice(0,-1).every((i,o)=>i===r[o])?t[t.length-1]-r[r.length-1]:0}function t5(t,r,a=!1){let{routesMeta:i}=t,o={},s="/",f=[];for(let d=0;d<i.length;++d){let h=i[d],v=d===i.length-1,y=s==="/"?r:r.slice(s.length)||"/",S=Yc({path:h.relativePath,caseSensitive:h.caseSensitive,end:v},y),p=h.route;if(!S&&v&&a&&!i[i.length-1].route.index&&(S=Yc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!S)return null;Object.assign(o,S.params),f.push({params:o,pathname:Hr([s,S.pathname]),pathnameBase:l5(Hr([s,S.pathnameBase])),route:p}),S.pathnameBase!=="/"&&(s=Hr([s,S.pathnameBase]))}return f}function Yc(t,r){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[a,i]=n5(t.path,t.caseSensitive,t.end),o=r.match(a);if(!o)return null;let s=o[0],f=s.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:i.reduce((v,{paramName:y,isOptional:S},p)=>{if(y==="*"){let w=d[p]||"";f=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const g=d[p];return S&&!g?v[y]=void 0:v[y]=(g||"").replace(/%2F/g,"/"),v},{}),pathname:s,pathnameBase:f,pattern:t}}function n5(t,r=!1,a=!0){It(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,d,h)=>(i.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(i.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,r?void 0:"i"),i]}function r5(t){try{return t.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return It(!1,`The URL path "${t}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),t}}function Sr(t,r){if(r==="/")return t;if(!t.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,i=t.charAt(a);return i&&i!=="/"?null:t.slice(a)||"/"}function a5(t,r="/"){let{pathname:a,search:i="",hash:o=""}=typeof t=="string"?Ea(t):t;return{pathname:a?a.startsWith("/")?a:i5(a,r):r,search:u5(i),hash:o5(o)}}function i5(t,r){let a=r.replace(/\/+$/,"").split("/");return t.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function em(t,r,a,i){return`Cannot include a '${t}' character in a manually specified \`to.${r}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Wx(t){return t.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function Fv(t){let r=Wx(t);return r.map((a,i)=>i===r.length-1?a.pathname:a.pathnameBase)}function Vv(t,r,a,i=!1){let o;typeof t=="string"?o=Ea(t):(o={...t},qe(!o.pathname||!o.pathname.includes("?"),em("?","pathname","search",o)),qe(!o.pathname||!o.pathname.includes("#"),em("#","pathname","hash",o)),qe(!o.search||!o.search.includes("#"),em("#","search","hash",o)));let s=t===""||o.pathname==="",f=s?"/":o.pathname,d;if(f==null)d=a;else{let S=r.length-1;if(!i&&f.startsWith("..")){let p=f.split("/");for(;p[0]==="..";)p.shift(),S-=1;o.pathname=p.join("/")}d=S>=0?r[S]:"/"}let h=a5(o,d),v=f&&f!=="/"&&f.endsWith("/"),y=(s||f===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(v||y)&&(h.pathname+="/"),h}var Hr=t=>t.join("/").replace(/\/\/+/g,"/"),l5=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),u5=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,o5=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Qc=class{constructor(t,r,a,i=!1){this.status=t,this.statusText=r||"",this.internal=i,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function yf(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}var e2=["POST","PUT","PATCH","DELETE"],s5=new Set(e2),c5=["GET",...e2],f5=new Set(c5),d5=new Set([301,302,303,307,308]),h5=new Set([307,308]),tm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},m5={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Yv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,v5=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),t2="remix-router-transitions",n2=Symbol("ResetLoaderData");function p5(t){const r=t.window?t.window:typeof window<"u"?window:void 0,a=typeof r<"u"&&typeof r.document<"u"&&typeof r.document.createElement<"u";qe(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=t.mapRouteProperties||v5,o={},s=Vc(t.routes,i,void 0,o),f,d=t.basename||"/",h=t.dataStrategy||x5,v=t.patchRoutesOnNavigation,y={...t.future},S=null,p=new Set,g=null,w=null,x=null,R=t.hydrationData!=null,T=Ja(s,t.history.location,d),A=null;if(T==null&&!v){let H=nr(404,{pathname:t.history.location.pathname}),{matches:Y,route:J}=n1(s);T=Y,A={[J.id]:H}}T&&!t.hydrationData&&qn(T,s,t.history.location.pathname).active&&(T=null);let N;if(T)if(T.some(H=>H.route.lazy))N=!1;else if(!T.some(H=>H.route.loader))N=!0;else{let H=t.hydrationData?t.hydrationData.loaderData:null,Y=t.hydrationData?t.hydrationData.errors:null;if(Y){let J=T.findIndex(ue=>Y[ue.route.id]!==void 0);N=T.slice(0,J+1).every(ue=>!$m(ue.route,H,Y))}else N=T.every(J=>!$m(J.route,H,Y))}else{N=!1,T=[];let H=qn(null,s,t.history.location.pathname);H.active&&H.matches&&(T=H.matches)}let j,O={historyAction:t.history.action,location:t.history.location,matches:T,initialized:N,navigation:tm,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||A,fetchers:new Map,blockers:new Map},q="POP",B=!1,V,z=!1,X=new Map,te=null,fe=!1,Z=!1,ae=new Set,ie=new Map,U=0,I=-1,ne=new Map,K=new Set,M=new Map,F=new Map,se=new Set,de=new Map,ce,ge=null;function Te(){if(S=t.history.listen(({action:H,location:Y,delta:J})=>{if(ce){ce(),ce=void 0;return}It(de.size===0||J!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ue=tn({currentLocation:O.location,nextLocation:Y,historyAction:H});if(ue&&J!=null){let ve=new Promise(Ee=>{ce=Ee});t.history.go(J*-1),Tn(ue,{state:"blocked",location:Y,proceed(){Tn(ue,{state:"proceeding",proceed:void 0,reset:void 0,location:Y}),ve.then(()=>t.history.go(J))},reset(){let Ee=new Map(O.blockers);Ee.set(ue,mo),je({blockers:Ee})}});return}return ft(H,Y)}),a){_5(r,X);let H=()=>N5(r,X);r.addEventListener("pagehide",H),te=()=>r.removeEventListener("pagehide",H)}return O.initialized||ft("POP",O.location,{initialHydration:!0}),j}function mt(){S&&S(),te&&te(),p.clear(),V&&V.abort(),O.fetchers.forEach((H,Y)=>wa(Y)),O.blockers.forEach((H,Y)=>Zo(Y))}function _e(H){return p.add(H),()=>p.delete(H)}function je(H,Y={}){O={...O,...H};let J=[],ue=[];O.fetchers.forEach((ve,Ee)=>{ve.state==="idle"&&(se.has(Ee)?J.push(Ee):ue.push(Ee))}),[...p].forEach(ve=>ve(O,{deletedFetchers:J,viewTransitionOpts:Y.viewTransitionOpts,flushSync:Y.flushSync===!0})),J.forEach(ve=>wa(ve)),ue.forEach(ve=>O.fetchers.delete(ve))}function Ne(H,Y,{flushSync:J}={}){var he,Re;let ue=O.actionData!=null&&O.navigation.formMethod!=null&&mr(O.navigation.formMethod)&&O.navigation.state==="loading"&&((he=H.state)==null?void 0:he._isRedirect)!==!0,ve;Y.actionData?Object.keys(Y.actionData).length>0?ve=Y.actionData:ve=null:ue?ve=O.actionData:ve=null;let Ee=Y.loaderData?e1(O.loaderData,Y.loaderData,Y.matches||[],Y.errors):O.loaderData,Me=O.blockers;Me.size>0&&(Me=new Map(Me),Me.forEach((Ce,Be)=>Me.set(Be,mo)));let pe=B===!0||O.navigation.formMethod!=null&&mr(O.navigation.formMethod)&&((Re=H.state)==null?void 0:Re._isRedirect)!==!0;f&&(s=f,f=void 0),fe||q==="POP"||(q==="PUSH"?t.history.push(H,H.state):q==="REPLACE"&&t.history.replace(H,H.state));let Se;if(q==="POP"){let Ce=X.get(O.location.pathname);Ce&&Ce.has(H.pathname)?Se={currentLocation:O.location,nextLocation:H}:X.has(H.pathname)&&(Se={currentLocation:H,nextLocation:O.location})}else if(z){let Ce=X.get(O.location.pathname);Ce?Ce.add(H.pathname):(Ce=new Set([H.pathname]),X.set(O.location.pathname,Ce)),Se={currentLocation:O.location,nextLocation:H}}je({...Y,actionData:ve,loaderData:Ee,historyAction:q,location:H,initialized:!0,navigation:tm,revalidation:"idle",restoreScrollPosition:yi(H,Y.matches||O.matches),preventScrollReset:pe,blockers:Me},{viewTransitionOpts:Se,flushSync:J===!0}),q="POP",B=!1,z=!1,fe=!1,Z=!1,ge==null||ge.resolve(),ge=null}async function Mt(H,Y){if(typeof H=="number"){t.history.go(H);return}let J=Um(O.location,O.matches,d,H,Y==null?void 0:Y.fromRouteId,Y==null?void 0:Y.relative),{path:ue,submission:ve,error:Ee}=Qb(!1,J,Y),Me=O.location,pe=To(O.location,ue,Y&&Y.state);pe={...pe,...t.history.encodeLocation(pe)};let Se=Y&&Y.replace!=null?Y.replace:void 0,he="PUSH";Se===!0?he="REPLACE":Se===!1||ve!=null&&mr(ve.formMethod)&&ve.formAction===O.location.pathname+O.location.search&&(he="REPLACE");let Re=Y&&"preventScrollReset"in Y?Y.preventScrollReset===!0:void 0,Ce=(Y&&Y.flushSync)===!0,Be=tn({currentLocation:Me,nextLocation:pe,historyAction:he});if(Be){Tn(Be,{state:"blocked",location:pe,proceed(){Tn(Be,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),Mt(H,Y)},reset(){let vt=new Map(O.blockers);vt.set(Be,mo),je({blockers:vt})}});return}await ft(he,pe,{submission:ve,pendingError:Ee,preventScrollReset:Re,replace:Y&&Y.replace,enableViewTransition:Y&&Y.viewTransition,flushSync:Ce})}function bn(){ge||(ge=z5()),jt(),je({revalidation:"loading"});let H=ge.promise;return O.navigation.state==="submitting"?H:O.navigation.state==="idle"?(ft(O.historyAction,O.location,{startUninterruptedRevalidation:!0}),H):(ft(q||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:z===!0}),H)}async function ft(H,Y,J){V&&V.abort(),V=null,q=H,fe=(J&&J.startUninterruptedRevalidation)===!0,rl(O.location,O.matches),B=(J&&J.preventScrollReset)===!0,z=(J&&J.enableViewTransition)===!0;let ue=f||s,ve=J&&J.overrideNavigation,Ee=Ja(ue,Y,d),Me=(J&&J.flushSync)===!0,pe=qn(Ee,ue,Y.pathname);if(pe.active&&pe.matches&&(Ee=pe.matches),!Ee){let{error:ut,notFoundMatches:ot,route:Dt}=fu(Y.pathname);Ne(Y,{matches:ot,loaderData:{},errors:{[Dt.id]:ut}},{flushSync:Me});return}if(O.initialized&&!Z&&R5(O.location,Y)&&!(J&&J.submission&&mr(J.submission.formMethod))){Ne(Y,{matches:Ee},{flushSync:Me});return}V=new AbortController;let Se=Ul(t.history,Y,V.signal,J&&J.submission),he;if(J&&J.pendingError)he=[Bi(Ee).route.id,{type:"error",error:J.pendingError}];else if(J&&J.submission&&mr(J.submission.formMethod)){let ut=await ln(Se,Y,J.submission,Ee,pe.active,{replace:J.replace,flushSync:Me});if(ut.shortCircuited)return;if(ut.pendingActionResult){let[ot,Dt]=ut.pendingActionResult;if(zn(Dt)&&yf(Dt.error)&&Dt.error.status===404){V=null,Ne(Y,{matches:ut.matches,loaderData:{},errors:{[ot]:Dt.error}});return}}Ee=ut.matches||Ee,he=ut.pendingActionResult,ve=nm(Y,J.submission),Me=!1,pe.active=!1,Se=Ul(t.history,Se.url,Se.signal)}let{shortCircuited:Re,matches:Ce,loaderData:Be,errors:vt}=await Cn(Se,Y,Ee,pe.active,ve,J&&J.submission,J&&J.fetcherSubmission,J&&J.replace,J&&J.initialHydration===!0,Me,he);Re||(V=null,Ne(Y,{matches:Ce||Ee,...t1(he),loaderData:Be,errors:vt}))}async function ln(H,Y,J,ue,ve,Ee={}){jt();let Me=M5(Y,J);if(je({navigation:Me},{flushSync:Ee.flushSync===!0}),ve){let he=await Fr(ue,Y.pathname,H.signal);if(he.type==="aborted")return{shortCircuited:!0};if(he.type==="error"){let Re=Bi(he.partialMatches).route.id;return{matches:he.partialMatches,pendingActionResult:[Re,{type:"error",error:he.error}]}}else if(he.matches)ue=he.matches;else{let{notFoundMatches:Re,error:Ce,route:Be}=fu(Y.pathname);return{matches:Re,pendingActionResult:[Be.id,{type:"error",error:Ce}]}}}let pe,Se=go(ue,Y);if(!Se.route.action&&!Se.route.lazy)pe={type:"error",error:nr(405,{method:H.method,pathname:Y.pathname,routeId:Se.route.id})};else if(pe=(await Rt("action",O,H,[Se],ue,null))[Se.route.id],H.signal.aborted)return{shortCircuited:!0};if(Pi(pe)){let he;return Ee&&Ee.replace!=null?he=Ee.replace:he=Ib(pe.response.headers.get("Location"),new URL(H.url),d)===O.location.pathname+O.location.search,await Le(H,pe,!0,{submission:J,replace:he}),{shortCircuited:!0}}if(zn(pe)){let he=Bi(ue,Se.route.id);return(Ee&&Ee.replace)!==!0&&(q="PUSH"),{matches:ue,pendingActionResult:[he.route.id,pe]}}return{matches:ue,pendingActionResult:[Se.route.id,pe]}}async function Cn(H,Y,J,ue,ve,Ee,Me,pe,Se,he,Re){let Ce=ve||nm(Y,Ee),Be=Ee||Me||a1(Ce),vt=!fe&&!Se;if(ue){if(vt){let pt=en(Re);je({navigation:Ce,...pt!==void 0?{actionData:pt}:{}},{flushSync:he})}let rt=await Fr(J,Y.pathname,H.signal);if(rt.type==="aborted")return{shortCircuited:!0};if(rt.type==="error"){let pt=Bi(rt.partialMatches).route.id;return{matches:rt.partialMatches,loaderData:{},errors:{[pt]:rt.error}}}else if(rt.matches)J=rt.matches;else{let{error:pt,notFoundMatches:lr,route:fn}=fu(Y.pathname);return{matches:lr,loaderData:{},errors:{[fn.id]:pt}}}}let ut=f||s,[ot,Dt]=Gb(t.history,O,J,Be,Y,Se===!0,Z,ae,se,M,K,ut,d,Re);if(I=++U,ot.length===0&&Dt.length===0){let rt=Xo();return Ne(Y,{matches:J,loaderData:{},errors:Re&&zn(Re[1])?{[Re[0]]:Re[1].error}:null,...t1(Re),...rt?{fetchers:new Map(O.fetchers)}:{}},{flushSync:he}),{shortCircuited:!0}}if(vt){let rt={};if(!ue){rt.navigation=Ce;let pt=en(Re);pt!==void 0&&(rt.actionData=pt)}Dt.length>0&&(rt.fetchers=Pn(Dt)),je(rt,{flushSync:he})}Dt.forEach(rt=>{rr(rt.key),rt.controller&&ie.set(rt.key,rt.controller)});let Vr=()=>Dt.forEach(rt=>rr(rt.key));V&&V.signal.addEventListener("abort",Vr);let{loaderResults:ar,fetcherResults:Rn}=await un(O,J,ot,Dt,H);if(H.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",Vr),Dt.forEach(rt=>ie.delete(rt.key));let qt=pc(ar);if(qt)return await Le(H,qt.result,!0,{replace:pe}),{shortCircuited:!0};if(qt=pc(Rn),qt)return K.add(qt.key),await Le(H,qt.result,!0,{replace:pe}),{shortCircuited:!0};let{loaderData:Er,errors:ir}=Wb(O,J,ar,Re,Dt,Rn);Se&&O.errors&&(ir={...O.errors,...ir});let Sn=Xo(),gt=Oa(I),bi=Sn||gt||Dt.length>0;return{matches:J,loaderData:Er,errors:ir,...bi?{fetchers:new Map(O.fetchers)}:{}}}function en(H){if(H&&!zn(H[1]))return{[H[0]]:H[1].data};if(O.actionData)return Object.keys(O.actionData).length===0?null:O.actionData}function Pn(H){return H.forEach(Y=>{let J=O.fetchers.get(Y.key),ue=vo(void 0,J?J.data:void 0);O.fetchers.set(Y.key,ue)}),new Map(O.fetchers)}async function be(H,Y,J,ue){rr(H);let ve=(ue&&ue.flushSync)===!0,Ee=f||s,Me=Um(O.location,O.matches,d,J,Y,ue==null?void 0:ue.relative),pe=Ja(Ee,Me,d),Se=qn(pe,Ee,Me);if(Se.active&&Se.matches&&(pe=Se.matches),!pe){sn(H,Y,nr(404,{pathname:Me}),{flushSync:ve});return}let{path:he,submission:Re,error:Ce}=Qb(!0,Me,ue);if(Ce){sn(H,Y,Ce,{flushSync:ve});return}let Be=go(pe,he),vt=(ue&&ue.preventScrollReset)===!0;if(Re&&mr(Re.formMethod)){await Fe(H,Y,he,Be,pe,Se.active,ve,vt,Re);return}M.set(H,{routeId:Y,path:he}),await xt(H,Y,he,Be,pe,Se.active,ve,vt,Re)}async function Fe(H,Y,J,ue,ve,Ee,Me,pe,Se){jt(),M.delete(H);function he(Et){if(!Et.route.action&&!Et.route.lazy){let Yr=nr(405,{method:Se.formMethod,pathname:J,routeId:Y});return sn(H,Y,Yr,{flushSync:Me}),!0}return!1}if(!Ee&&he(ue))return;let Re=O.fetchers.get(H);on(H,j5(Se,Re),{flushSync:Me});let Ce=new AbortController,Be=Ul(t.history,J,Ce.signal,Se);if(Ee){let Et=await Fr(ve,J,Be.signal);if(Et.type==="aborted")return;if(Et.type==="error"){sn(H,Y,Et.error,{flushSync:Me});return}else if(Et.matches){if(ve=Et.matches,ue=go(ve,J),he(ue))return}else{sn(H,Y,nr(404,{pathname:J}),{flushSync:Me});return}}ie.set(H,Ce);let vt=U,ot=(await Rt("action",O,Be,[ue],ve,H))[ue.route.id];if(Be.signal.aborted){ie.get(H)===Ce&&ie.delete(H);return}if(se.has(H)){if(Pi(ot)||zn(ot)){on(H,Za(void 0));return}}else{if(Pi(ot))if(ie.delete(H),I>vt){on(H,Za(void 0));return}else return K.add(H),on(H,vo(Se)),Le(Be,ot,!1,{fetcherSubmission:Se,preventScrollReset:pe});if(zn(ot)){sn(H,Y,ot.error);return}}let Dt=O.navigation.location||O.location,Vr=Ul(t.history,Dt,Ce.signal),ar=f||s,Rn=O.navigation.state!=="idle"?Ja(ar,O.navigation.location,d):O.matches;qe(Rn,"Didn't find any matches after fetcher action");let qt=++U;ne.set(H,qt);let Er=vo(Se,ot.data);O.fetchers.set(H,Er);let[ir,Sn]=Gb(t.history,O,Rn,Se,Dt,!1,Z,ae,se,M,K,ar,d,[ue.route.id,ot]);Sn.filter(Et=>Et.key!==H).forEach(Et=>{let Yr=Et.key,du=O.fetchers.get(Yr),Ef=vo(void 0,du?du.data:void 0);O.fetchers.set(Yr,Ef),rr(Yr),Et.controller&&ie.set(Yr,Et.controller)}),je({fetchers:new Map(O.fetchers)});let gt=()=>Sn.forEach(Et=>rr(Et.key));Ce.signal.addEventListener("abort",gt);let{loaderResults:bi,fetcherResults:rt}=await un(O,Rn,ir,Sn,Vr);if(Ce.signal.aborted)return;Ce.signal.removeEventListener("abort",gt),ne.delete(H),ie.delete(H),Sn.forEach(Et=>ie.delete(Et.key));let pt=pc(bi);if(pt)return Le(Vr,pt.result,!1,{preventScrollReset:pe});if(pt=pc(rt),pt)return K.add(pt.key),Le(Vr,pt.result,!1,{preventScrollReset:pe});let{loaderData:lr,errors:fn}=Wb(O,Rn,bi,void 0,Sn,rt);if(O.fetchers.has(H)){let Et=Za(ot.data);O.fetchers.set(H,Et)}Oa(qt),O.navigation.state==="loading"&&qt>I?(qe(q,"Expected pending action"),V&&V.abort(),Ne(O.navigation.location,{matches:Rn,loaderData:lr,errors:fn,fetchers:new Map(O.fetchers)})):(je({errors:fn,loaderData:e1(O.loaderData,lr,Rn,fn),fetchers:new Map(O.fetchers)}),Z=!1)}async function xt(H,Y,J,ue,ve,Ee,Me,pe,Se){let he=O.fetchers.get(H);on(H,vo(Se,he?he.data:void 0),{flushSync:Me});let Re=new AbortController,Ce=Ul(t.history,J,Re.signal);if(Ee){let ot=await Fr(ve,J,Ce.signal);if(ot.type==="aborted")return;if(ot.type==="error"){sn(H,Y,ot.error,{flushSync:Me});return}else if(ot.matches)ve=ot.matches,ue=go(ve,J);else{sn(H,Y,nr(404,{pathname:J}),{flushSync:Me});return}}ie.set(H,Re);let Be=U,ut=(await Rt("loader",O,Ce,[ue],ve,H))[ue.route.id];if(ie.get(H)===Re&&ie.delete(H),!Ce.signal.aborted){if(se.has(H)){on(H,Za(void 0));return}if(Pi(ut))if(I>Be){on(H,Za(void 0));return}else{K.add(H),await Le(Ce,ut,!1,{preventScrollReset:pe});return}if(zn(ut)){sn(H,Y,ut.error);return}on(H,Za(ut.data))}}async function Le(H,Y,J,{submission:ue,fetcherSubmission:ve,preventScrollReset:Ee,replace:Me}={}){Y.response.headers.has("X-Remix-Revalidate")&&(Z=!0);let pe=Y.response.headers.get("Location");qe(pe,"Expected a Location header on the redirect Response"),pe=Ib(pe,new URL(H.url),d);let Se=To(O.location,pe,{_isRedirect:!0});if(a){let ut=!1;if(Y.response.headers.has("X-Remix-Reload-Document"))ut=!0;else if(Yv.test(pe)){const ot=t.history.createURL(pe);ut=ot.origin!==r.location.origin||Sr(ot.pathname,d)==null}if(ut){Me?r.location.replace(pe):r.location.assign(pe);return}}V=null;let he=Me===!0||Y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Re,formAction:Ce,formEncType:Be}=O.navigation;!ue&&!ve&&Re&&Ce&&Be&&(ue=a1(O.navigation));let vt=ue||ve;if(h5.has(Y.response.status)&&vt&&mr(vt.formMethod))await ft(he,Se,{submission:{...vt,formAction:pe},preventScrollReset:Ee||B,enableViewTransition:J?z:void 0});else{let ut=nm(Se,ue);await ft(he,Se,{overrideNavigation:ut,fetcherSubmission:ve,preventScrollReset:Ee||B,enableViewTransition:J?z:void 0})}}async function Rt(H,Y,J,ue,ve,Ee){let Me,pe={};try{Me=await E5(h,H,Y,J,ue,ve,Ee,o,i)}catch(Se){return ue.forEach(he=>{pe[he.route.id]={type:"error",error:Se}}),pe}for(let[Se,he]of Object.entries(Me))if(D5(he)){let Re=he.result;pe[Se]={type:"redirect",response:C5(Re,J,Se,ve,d)}}else pe[Se]=await O5(he);return pe}async function un(H,Y,J,ue,ve){let Ee=Rt("loader",H,ve,J,Y,null),Me=Promise.all(ue.map(async he=>{if(he.matches&&he.match&&he.controller){let Ce=(await Rt("loader",H,Ul(t.history,he.path,he.controller.signal),[he.match],he.matches,he.key))[he.match.route.id];return{[he.key]:Ce}}else return Promise.resolve({[he.key]:{type:"error",error:nr(404,{pathname:he.path})}})})),pe=await Ee,Se=(await Me).reduce((he,Re)=>Object.assign(he,Re),{});return{loaderResults:pe,fetcherResults:Se}}function jt(){Z=!0,M.forEach((H,Y)=>{ie.has(Y)&&ae.add(Y),rr(Y)})}function on(H,Y,J={}){O.fetchers.set(H,Y),je({fetchers:new Map(O.fetchers)},{flushSync:(J&&J.flushSync)===!0})}function sn(H,Y,J,ue={}){let ve=Bi(O.matches,Y);wa(H),je({errors:{[ve.route.id]:J},fetchers:new Map(O.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function cu(H){return F.set(H,(F.get(H)||0)+1),se.has(H)&&se.delete(H),O.fetchers.get(H)||m5}function wa(H){let Y=O.fetchers.get(H);ie.has(H)&&!(Y&&Y.state==="loading"&&ne.has(H))&&rr(H),M.delete(H),ne.delete(H),K.delete(H),se.delete(H),ae.delete(H),O.fetchers.delete(H)}function bf(H){let Y=(F.get(H)||0)-1;Y<=0?(F.delete(H),se.add(H)):F.set(H,Y),je({fetchers:new Map(O.fetchers)})}function rr(H){let Y=ie.get(H);Y&&(Y.abort(),ie.delete(H))}function Go(H){for(let Y of H){let J=cu(Y),ue=Za(J.data);O.fetchers.set(Y,ue)}}function Xo(){let H=[],Y=!1;for(let J of K){let ue=O.fetchers.get(J);qe(ue,`Expected fetcher: ${J}`),ue.state==="loading"&&(K.delete(J),H.push(J),Y=!0)}return Go(H),Y}function Oa(H){let Y=[];for(let[J,ue]of ne)if(ue<H){let ve=O.fetchers.get(J);qe(ve,`Expected fetcher: ${J}`),ve.state==="loading"&&(rr(J),ne.delete(J),Y.push(J))}return Go(Y),Y.length>0}function cn(H,Y){let J=O.blockers.get(H)||mo;return de.get(H)!==Y&&de.set(H,Y),J}function Zo(H){O.blockers.delete(H),de.delete(H)}function Tn(H,Y){let J=O.blockers.get(H)||mo;qe(J.state==="unblocked"&&Y.state==="blocked"||J.state==="blocked"&&Y.state==="blocked"||J.state==="blocked"&&Y.state==="proceeding"||J.state==="blocked"&&Y.state==="unblocked"||J.state==="proceeding"&&Y.state==="unblocked",`Invalid blocker state transition: ${J.state} -> ${Y.state}`);let ue=new Map(O.blockers);ue.set(H,Y),je({blockers:ue})}function tn({currentLocation:H,nextLocation:Y,historyAction:J}){if(de.size===0)return;de.size>1&&It(!1,"A router only supports one blocker at a time");let ue=Array.from(de.entries()),[ve,Ee]=ue[ue.length-1],Me=O.blockers.get(ve);if(!(Me&&Me.state==="proceeding")&&Ee({currentLocation:H,nextLocation:Y,historyAction:J}))return ve}function fu(H){let Y=nr(404,{pathname:H}),J=f||s,{matches:ue,route:ve}=n1(J);return{notFoundMatches:ue,route:ve,error:Y}}function Sf(H,Y,J){if(g=H,x=Y,w=J||null,!R&&O.navigation===tm){R=!0;let ue=yi(O.location,O.matches);ue!=null&&je({restoreScrollPosition:ue})}return()=>{g=null,x=null,w=null}}function Io(H,Y){return w&&w(H,Y.map(ue=>YM(ue,O.loaderData)))||H.key}function rl(H,Y){if(g&&x){let J=Io(H,Y);g[J]=x()}}function yi(H,Y){if(g){let J=Io(H,Y),ue=g[J];if(typeof ue=="number")return ue}return null}function qn(H,Y,J){if(v)if(H){if(Object.keys(H[0].params).length>0)return{active:!0,matches:Oc(Y,J,d,!0)}}else return{active:!0,matches:Oc(Y,J,d,!0)||[]};return{active:!1,matches:null}}async function Fr(H,Y,J){if(!v)return{type:"success",matches:H};let ue=H;for(;;){let ve=f==null,Ee=f||s,Me=o;try{await v({path:Y,matches:ue,patch:(he,Re)=>{J.aborted||Zb(he,Re,Ee,Me,i)}})}catch(he){return{type:"error",error:he,partialMatches:ue}}finally{ve&&!J.aborted&&(s=[...s])}if(J.aborted)return{type:"aborted"};let pe=Ja(Ee,Y,d);if(pe)return{type:"success",matches:pe};let Se=Oc(Ee,Y,d,!0);if(!Se||ue.length===Se.length&&ue.every((he,Re)=>he.route.id===Se[Re].route.id))return{type:"success",matches:null};ue=Se}}function gi(H){o={},f=Vc(H,i,void 0,o)}function xf(H,Y){let J=f==null;Zb(H,Y,f||s,o,i),J&&(s=[...s],je({}))}return j={get basename(){return d},get future(){return y},get state(){return O},get routes(){return s},get window(){return r},initialize:Te,subscribe:_e,enableScrollRestoration:Sf,navigate:Mt,fetch:be,revalidate:bn,createHref:H=>t.history.createHref(H),encodeLocation:H=>t.history.encodeLocation(H),getFetcher:cu,deleteFetcher:bf,dispose:mt,getBlocker:cn,deleteBlocker:Zo,patchRoutes:xf,_internalFetchControllers:ie,_internalSetRoutes:gi},j}function y5(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Um(t,r,a,i,o,s){let f,d;if(o){f=[];for(let v of r)if(f.push(v),v.route.id===o){d=v;break}}else f=r,d=r[r.length-1];let h=Vv(i||".",Fv(f),Sr(t.pathname,a)||t.pathname,s==="path");if(i==null&&(h.search=t.search,h.hash=t.hash),(i==null||i===""||i===".")&&d){let v=Qv(h.search);if(d.route.index&&!v)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&v){let y=new URLSearchParams(h.search),S=y.getAll("index");y.delete("index"),S.filter(g=>g).forEach(g=>y.append("index",g));let p=y.toString();h.search=p?`?${p}`:""}}return a!=="/"&&(h.pathname=h.pathname==="/"?a:Hr([a,h.pathname])),pi(h)}function Qb(t,r,a){if(!a||!y5(a))return{path:r};if(a.formMethod&&!A5(a.formMethod))return{path:r,error:nr(405,{method:a.formMethod})};let i=()=>({path:r,error:nr(400,{type:"invalid-body"})}),s=(a.formMethod||"get").toUpperCase(),f=a2(r);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!mr(s))return i();let S=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((p,[g,w])=>`${p}${g}=${w}
|
|
72
72
|
`,""):String(a.body);return{path:r,submission:{formMethod:s,formAction:f,formEncType:a.formEncType,formData:void 0,json:void 0,text:S}}}else if(a.formEncType==="application/json"){if(!mr(s))return i();try{let S=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:r,submission:{formMethod:s,formAction:f,formEncType:a.formEncType,formData:void 0,json:S,text:void 0}}}catch{return i()}}}qe(typeof FormData=="function","FormData is not available in this environment");let d,h;if(a.formData)d=Bm(a.formData),h=a.formData;else if(a.body instanceof FormData)d=Bm(a.body),h=a.body;else if(a.body instanceof URLSearchParams)d=a.body,h=Jb(d);else if(a.body==null)d=new URLSearchParams,h=new FormData;else try{d=new URLSearchParams(a.body),h=Jb(d)}catch{return i()}let v={formMethod:s,formAction:f,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(mr(v.formMethod))return{path:r,submission:v};let y=Ea(r);return t&&y.search&&Qv(y.search)&&d.append("index",""),y.search=`?${d}`,{path:pi(y),submission:v}}function Kb(t,r,a=!1){let i=t.findIndex(o=>o.route.id===r);return i>=0?t.slice(0,a?i+1:i):t}function Gb(t,r,a,i,o,s,f,d,h,v,y,S,p,g){let w=g?zn(g[1])?g[1].error:g[1].data:void 0,x=t.createURL(r.location),R=t.createURL(o),T=a;s&&r.errors?T=Kb(a,Object.keys(r.errors)[0],!0):g&&zn(g[1])&&(T=Kb(a,g[0]));let A=g?g[1].statusCode:void 0,N=A&&A>=400,j=T.filter((q,B)=>{let{route:V}=q;if(V.lazy)return!0;if(V.loader==null)return!1;if(s)return $m(V,r.loaderData,r.errors);if(g5(r.loaderData,r.matches[B],q))return!0;let z=r.matches[B],X=q;return Xb(q,{currentUrl:x,currentParams:z.params,nextUrl:R,nextParams:X.params,...i,actionResult:w,actionStatus:A,defaultShouldRevalidate:N?!1:f||x.pathname+x.search===R.pathname+R.search||x.search!==R.search||b5(z,X)})}),O=[];return v.forEach((q,B)=>{if(s||!a.some(fe=>fe.route.id===q.routeId)||h.has(B))return;let V=Ja(S,q.path,p);if(!V){O.push({key:B,routeId:q.routeId,path:q.path,matches:null,match:null,controller:null});return}let z=r.fetchers.get(B),X=go(V,q.path),te=!1;y.has(B)?te=!1:d.has(B)?(d.delete(B),te=!0):z&&z.state!=="idle"&&z.data===void 0?te=f:te=Xb(X,{currentUrl:x,currentParams:r.matches[r.matches.length-1].params,nextUrl:R,nextParams:a[a.length-1].params,...i,actionResult:w,actionStatus:A,defaultShouldRevalidate:N?!1:f}),te&&O.push({key:B,routeId:q.routeId,path:q.path,matches:V,match:X,controller:new AbortController})}),[j,O]}function $m(t,r,a){if(t.lazy)return!0;if(!t.loader)return!1;let i=r!=null&&r[t.id]!==void 0,o=a!=null&&a[t.id]!==void 0;return!i&&o?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!i&&!o}function g5(t,r,a){let i=!r||a.route.id!==r.route.id,o=!t.hasOwnProperty(a.route.id);return i||o}function b5(t,r){let a=t.route.path;return t.pathname!==r.pathname||a!=null&&a.endsWith("*")&&t.params["*"]!==r.params["*"]}function Xb(t,r){if(t.route.shouldRevalidate){let a=t.route.shouldRevalidate(r);if(typeof a=="boolean")return a}return r.defaultShouldRevalidate}function Zb(t,r,a,i,o){let s;if(t){let h=i[t];qe(h,`No route found to patch children into: routeId = ${t}`),h.children||(h.children=[]),s=h.children}else s=a;let f=r.filter(h=>!s.some(v=>r2(h,v))),d=Vc(f,o,[t||"_","patch",String((s==null?void 0:s.length)||"0")],i);s.push(...d)}function r2(t,r){return"id"in t&&"id"in r&&t.id===r.id?!0:t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive?(!t.children||t.children.length===0)&&(!r.children||r.children.length===0)?!0:t.children.every((a,i)=>{var o;return(o=r.children)==null?void 0:o.some(s=>r2(a,s))}):!1}async function S5(t,r,a){if(!t.lazy)return;let i=await t.lazy();if(!t.lazy)return;let o=a[t.id];qe(o,"No route found in manifest");let s={};for(let f in i){let h=o[f]!==void 0&&f!=="hasErrorBoundary";It(!h,`Route "${o.id}" has a static property "${f}" defined but its lazy function is also returning a value for this property. The lazy route property "${f}" will be ignored.`),!h&&!FM.has(f)&&(s[f]=i[f])}Object.assign(o,s),Object.assign(o,{...r(o),lazy:void 0})}async function x5({matches:t}){let r=t.filter(i=>i.shouldLoad);return(await Promise.all(r.map(i=>i.resolve()))).reduce((i,o,s)=>Object.assign(i,{[r[s].route.id]:o}),{})}async function E5(t,r,a,i,o,s,f,d,h,v){let y=s.map(g=>g.route.lazy?S5(g.route,h,d):void 0),S=s.map((g,w)=>{let x=y[w],R=o.some(A=>A.route.id===g.route.id);return{...g,shouldLoad:R,resolve:async A=>(A&&i.method==="GET"&&(g.route.lazy||g.route.loader)&&(R=!0),R?w5(r,i,g,x,A,v):Promise.resolve({type:"data",result:void 0}))}}),p=await t({matches:S,request:i,params:s[0].params,fetcherKey:f,context:v});try{await Promise.all(y)}catch{}return p}async function w5(t,r,a,i,o,s){let f,d,h=v=>{let y,S=new Promise((w,x)=>y=x);d=()=>y(),r.signal.addEventListener("abort",d);let p=w=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${t}" [routeId: ${a.route.id}]`)):v({request:r,params:a.params,context:s},...w!==void 0?[w]:[]),g=(async()=>{try{return{type:"data",result:await(o?o(x=>p(x)):p())}}catch(w){return{type:"error",result:w}}})();return Promise.race([g,S])};try{let v=a.route[t];if(i)if(v){let y,[S]=await Promise.all([h(v).catch(p=>{y=p}),i]);if(y!==void 0)throw y;f=S}else if(await i,v=a.route[t],v)f=await h(v);else if(t==="action"){let y=new URL(r.url),S=y.pathname+y.search;throw nr(405,{method:r.method,pathname:S,routeId:a.route.id})}else return{type:"data",result:void 0};else if(v)f=await h(v);else{let y=new URL(r.url),S=y.pathname+y.search;throw nr(404,{pathname:S})}}catch(v){return{type:"error",result:v}}finally{d&&r.signal.removeEventListener("abort",d)}return f}async function O5(t){var i,o,s,f;let{result:r,type:a}=t;if(i2(r)){let d;try{let h=r.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?r.body==null?d=null:d=await r.json():d=await r.text()}catch(h){return{type:"error",error:h}}return a==="error"?{type:"error",error:new Qc(r.status,r.statusText,d),statusCode:r.status,headers:r.headers}:{type:"data",data:d,statusCode:r.status,headers:r.headers}}if(a==="error"){if(r1(r)){if(r.data instanceof Error)return{type:"error",error:r.data,statusCode:(i=r.init)==null?void 0:i.status};r=new Qc(((o=r.init)==null?void 0:o.status)||500,void 0,r.data)}return{type:"error",error:r,statusCode:yf(r)?r.status:void 0}}return r1(r)?{type:"data",data:r.data,statusCode:(s=r.init)==null?void 0:s.status,headers:(f=r.init)!=null&&f.headers?new Headers(r.init.headers):void 0}:{type:"data",data:r}}function C5(t,r,a,i,o){let s=t.headers.get("Location");if(qe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Yv.test(s)){let f=i.slice(0,i.findIndex(d=>d.route.id===a)+1);s=Um(new URL(r.url),f,o,s),t.headers.set("Location",s)}return t}function Ib(t,r,a){if(Yv.test(t)){let i=t,o=i.startsWith("//")?new URL(r.protocol+i):new URL(i),s=Sr(o.pathname,a)!=null;if(o.origin===r.origin&&s)return o.pathname+o.search+o.hash}return t}function Ul(t,r,a,i){let o=t.createURL(a2(r)).toString(),s={signal:a};if(i&&mr(i.formMethod)){let{formMethod:f,formEncType:d}=i;s.method=f.toUpperCase(),d==="application/json"?(s.headers=new Headers({"Content-Type":d}),s.body=JSON.stringify(i.json)):d==="text/plain"?s.body=i.text:d==="application/x-www-form-urlencoded"&&i.formData?s.body=Bm(i.formData):s.body=i.formData}return new Request(o,s)}function Bm(t){let r=new URLSearchParams;for(let[a,i]of t.entries())r.append(a,typeof i=="string"?i:i.name);return r}function Jb(t){let r=new FormData;for(let[a,i]of t.entries())r.append(a,i);return r}function T5(t,r,a,i=!1,o=!1){let s={},f=null,d,h=!1,v={},y=a&&zn(a[1])?a[1].error:void 0;return t.forEach(S=>{if(!(S.route.id in r))return;let p=S.route.id,g=r[p];if(qe(!Pi(g),"Cannot handle redirect results in processLoaderData"),zn(g)){let w=g.error;if(y!==void 0&&(w=y,y=void 0),f=f||{},o)f[p]=w;else{let x=Bi(t,p);f[x.route.id]==null&&(f[x.route.id]=w)}i||(s[p]=n2),h||(h=!0,d=yf(g.error)?g.error.status:500),g.headers&&(v[p]=g.headers)}else s[p]=g.data,g.statusCode&&g.statusCode!==200&&!h&&(d=g.statusCode),g.headers&&(v[p]=g.headers)}),y!==void 0&&a&&(f={[a[0]]:y},s[a[0]]=void 0),{loaderData:s,errors:f,statusCode:d||200,loaderHeaders:v}}function Wb(t,r,a,i,o,s){let{loaderData:f,errors:d}=T5(r,a,i);return o.forEach(h=>{let{key:v,match:y,controller:S}=h,p=s[v];if(qe(p,"Did not find corresponding fetcher result"),!(S&&S.signal.aborted))if(zn(p)){let g=Bi(t.matches,y==null?void 0:y.route.id);d&&d[g.route.id]||(d={...d,[g.route.id]:p.error}),t.fetchers.delete(v)}else if(Pi(p))qe(!1,"Unhandled fetcher revalidation redirect");else{let g=Za(p.data);t.fetchers.set(v,g)}}),{loaderData:f,errors:d}}function e1(t,r,a,i){let o=Object.entries(r).filter(([,s])=>s!==n2).reduce((s,[f,d])=>(s[f]=d,s),{});for(let s of a){let f=s.route.id;if(!r.hasOwnProperty(f)&&t.hasOwnProperty(f)&&s.route.loader&&(o[f]=t[f]),i&&i.hasOwnProperty(f))break}return o}function t1(t){return t?zn(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Bi(t,r){return(r?t.slice(0,t.findIndex(i=>i.route.id===r)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function n1(t){let r=t.length===1?t[0]:t.find(a=>a.index||!a.path||a.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r}}function nr(t,{pathname:r,routeId:a,method:i,type:o,message:s}={}){let f="Unknown Server Error",d="Unknown @remix-run/router error";return t===400?(f="Bad Request",i&&r&&a?d=`You made a ${i} request to "${r}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:o==="invalid-body"&&(d="Unable to encode submission body")):t===403?(f="Forbidden",d=`Route "${a}" does not match URL "${r}"`):t===404?(f="Not Found",d=`No route matches URL "${r}"`):t===405&&(f="Method Not Allowed",i&&r&&a?d=`You made a ${i.toUpperCase()} request to "${r}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:i&&(d=`Invalid request method "${i.toUpperCase()}"`)),new Qc(t||500,f,new Error(d),!0)}function pc(t){let r=Object.entries(t);for(let a=r.length-1;a>=0;a--){let[i,o]=r[a];if(Pi(o))return{key:i,result:o}}}function a2(t){let r=typeof t=="string"?Ea(t):t;return pi({...r,hash:""})}function R5(t,r){return t.pathname!==r.pathname||t.search!==r.search?!1:t.hash===""?r.hash!=="":t.hash===r.hash?!0:r.hash!==""}function D5(t){return i2(t.result)&&d5.has(t.result.status)}function zn(t){return t.type==="error"}function Pi(t){return(t&&t.type)==="redirect"}function r1(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function i2(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function A5(t){return f5.has(t.toUpperCase())}function mr(t){return s5.has(t.toUpperCase())}function Qv(t){return new URLSearchParams(t).getAll("index").some(r=>r==="")}function go(t,r){let a=typeof r=="string"?Ea(r).search:r.search;if(t[t.length-1].route.index&&Qv(a||""))return t[t.length-1];let i=Wx(t);return i[i.length-1]}function a1(t){let{formMethod:r,formAction:a,formEncType:i,text:o,formData:s,json:f}=t;if(!(!r||!a||!i)){if(o!=null)return{formMethod:r,formAction:a,formEncType:i,formData:void 0,json:void 0,text:o};if(s!=null)return{formMethod:r,formAction:a,formEncType:i,formData:s,json:void 0,text:void 0};if(f!==void 0)return{formMethod:r,formAction:a,formEncType:i,formData:void 0,json:f,text:void 0}}}function nm(t,r){return r?{state:"loading",location:t,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function M5(t,r){return{state:"submitting",location:t,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function vo(t,r){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:r}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function j5(t,r){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:r?r.data:void 0}}function Za(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function _5(t,r){try{let a=t.sessionStorage.getItem(t2);if(a){let i=JSON.parse(a);for(let[o,s]of Object.entries(i||{}))s&&Array.isArray(s)&&r.set(o,new Set(s||[]))}}catch{}}function N5(t,r){if(r.size>0){let a={};for(let[i,o]of r)a[i]=[...o];try{t.sessionStorage.setItem(t2,JSON.stringify(a))}catch(i){It(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function z5(){let t,r,a=new Promise((i,o)=>{t=async s=>{i(s);try{await a}catch{}},r=async s=>{o(s);try{await a}catch{}}});return{promise:a,resolve:t,reject:r}}var el=E.createContext(null);el.displayName="DataRouter";var Vo=E.createContext(null);Vo.displayName="DataRouterState";var Kv=E.createContext({isTransitioning:!1});Kv.displayName="ViewTransition";var l2=E.createContext(new Map);l2.displayName="Fetchers";var L5=E.createContext(null);L5.displayName="Await";var kr=E.createContext(null);kr.displayName="Navigation";var Yo=E.createContext(null);Yo.displayName="Location";var xr=E.createContext({outlet:null,matches:[],isDataRoute:!1});xr.displayName="Route";var Gv=E.createContext(null);Gv.displayName="RouteError";function H5(t,{relative:r}={}){qe(Qo(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:i}=E.useContext(kr),{hash:o,pathname:s,search:f}=Ko(t,{relative:r}),d=s;return a!=="/"&&(d=s==="/"?a:Hr([a,s])),i.createHref({pathname:d,search:f,hash:o})}function Qo(){return E.useContext(Yo)!=null}function tl(){return qe(Qo(),"useLocation() may be used only in the context of a <Router> component."),E.useContext(Yo).location}var u2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function o2(t){E.useContext(kr).static||E.useLayoutEffect(t)}function Xv(){let{isDataRoute:t}=E.useContext(xr);return t?Z5():U5()}function U5(){qe(Qo(),"useNavigate() may be used only in the context of a <Router> component.");let t=E.useContext(el),{basename:r,navigator:a}=E.useContext(kr),{matches:i}=E.useContext(xr),{pathname:o}=tl(),s=JSON.stringify(Fv(i)),f=E.useRef(!1);return o2(()=>{f.current=!0}),E.useCallback((h,v={})=>{if(It(f.current,u2),!f.current)return;if(typeof h=="number"){a.go(h);return}let y=Vv(h,JSON.parse(s),o,v.relative==="path");t==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:Hr([r,y.pathname])),(v.replace?a.replace:a.push)(y,v.state,v)},[r,a,s,o,t])}var $5=E.createContext(null);function B5(t){let r=E.useContext(xr).outlet;return r&&E.createElement($5.Provider,{value:t},r)}function s2(){let{matches:t}=E.useContext(xr),r=t[t.length-1];return r?r.params:{}}function Ko(t,{relative:r}={}){let{matches:a}=E.useContext(xr),{pathname:i}=tl(),o=JSON.stringify(Fv(a));return E.useMemo(()=>Vv(t,JSON.parse(o),i,r==="path"),[t,o,i,r])}function P5(t,r){return c2(t,r)}function c2(t,r,a,i){var T;qe(Qo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=E.useContext(kr),{matches:s}=E.useContext(xr),f=s[s.length-1],d=f?f.params:{},h=f?f.pathname:"/",v=f?f.pathnameBase:"/",y=f&&f.route;{let A=y&&y.path||"";d2(h,!y||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${A}">) 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.
|
|
73
73
|
|
|
74
|
-
Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let S=tl(),p;if(r){let A=typeof r=="string"?Ea(r):r;qe(v==="/"||((T=A.pathname)==null?void 0:T.startsWith(v)),`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 "${v}" but pathname "${A.pathname}" was given in the \`location\` prop.`),p=A}else p=S;let g=p.pathname||"/",w=g;if(v!=="/"){let A=v.replace(/^\//,"").split("/");w="/"+g.replace(/^\//,"").split("/").slice(A.length).join("/")}let x=Ja(t,{pathname:w});It(y||x!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),It(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.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 R=Y5(x&&x.map(A=>Object.assign({},A,{params:Object.assign({},d,A.params),pathname:Hr([v,o.encodeLocation?o.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?v:Hr([v,o.encodeLocation?o.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),s,a,i);return r&&R?E.createElement(Yo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},R):R}function q5(){let t=f2(),r=yf(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},f=null;return console.error("Error handled by React Router default ErrorBoundary:",t),f=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:s},"ErrorBoundary")," or"," ",E.createElement("code",{style:s},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},r),a?E.createElement("pre",{style:o},a):null,f)}var k5=E.createElement(q5,null),F5=class extends E.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?E.createElement(xr.Provider,{value:this.props.routeContext},E.createElement(Gv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function V5({routeContext:t,match:r,children:a}){let i=E.useContext(el);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),E.createElement(xr.Provider,{value:t},a)}function Y5(t,r=[],a=null,i=null){if(t==null){if(!a)return null;if(a.errors)t=a.matches;else if(r.length===0&&!a.initialized&&a.matches.length>0)t=a.matches;else return null}let o=t,s=a==null?void 0:a.errors;if(s!=null){let h=o.findIndex(v=>v.route.id&&(s==null?void 0:s[v.route.id])!==void 0);qe(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let f=!1,d=-1;if(a)for(let h=0;h<o.length;h++){let v=o[h];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(d=h),v.route.id){let{loaderData:y,errors:S}=a,p=v.route.loader&&!y.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||p){f=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((h,v,y)=>{let S,p=!1,g=null,w=null;a&&(S=s&&v.route.id?s[v.route.id]:void 0,g=v.route.errorElement||k5,f&&(d<0&&y===0?(d2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,w=null):d===y&&(p=!0,w=v.route.hydrateFallbackElement||null)));let x=r.concat(o.slice(0,y+1)),R=()=>{let T;return S?T=g:p?T=w:v.route.Component?T=E.createElement(v.route.Component,null):v.route.element?T=v.route.element:T=h,E.createElement(V5,{match:v,routeContext:{outlet:h,matches:x,isDataRoute:a!=null},children:T})};return a&&(v.route.ErrorBoundary||v.route.errorElement||y===0)?E.createElement(F5,{location:a.location,revalidation:a.revalidation,component:g,error:S,children:R(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):R()},null)}function Zv(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Q5(t){let r=E.useContext(el);return qe(r,Zv(t)),r}function K5(t){let r=E.useContext(Vo);return qe(r,Zv(t)),r}function G5(t){let r=E.useContext(xr);return qe(r,Zv(t)),r}function Iv(t){let r=G5(t),a=r.matches[r.matches.length-1];return qe(a.route.id,`${t} can only be used on routes that contain a unique "id"`),a.route.id}function X5(){return Iv("useRouteId")}function f2(){var i;let t=E.useContext(Gv),r=K5("useRouteError"),a=Iv("useRouteError");return t!==void 0?t:(i=r.errors)==null?void 0:i[a]}function Z5(){let{router:t}=Q5("useNavigate"),r=Iv("useNavigate"),a=E.useRef(!1);return o2(()=>{a.current=!0}),E.useCallback(async(o,s={})=>{It(a.current,u2),a.current&&(typeof o=="number"?t.navigate(o):await t.navigate(o,{fromRouteId:r,...s}))},[t,r])}var i1={};function d2(t,r,a){!r&&!i1[t]&&(i1[t]=!0,It(!1,a))}var l1={};function u1(t,r){!t&&!l1[r]&&(l1[r]=!0,console.warn(r))}function I5(t){let r={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&It(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(r,{element:E.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&It(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(r,{hydrateFallbackElement:E.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&It(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(r,{errorElement:E.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),r}var J5=class{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",t(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",r(a))}})}};function W5({router:t,flushSync:r}){let[a,i]=E.useState(t.state),[o,s]=E.useState(),[f,d]=E.useState({isTransitioning:!1}),[h,v]=E.useState(),[y,S]=E.useState(),[p,g]=E.useState(),w=E.useRef(new Map),x=E.useCallback((N,{deletedFetchers:j,flushSync:O,viewTransitionOpts:q})=>{j.forEach(V=>w.current.delete(V)),N.fetchers.forEach((V,z)=>{V.data!==void 0&&w.current.set(z,V.data)}),u1(O===!1||r!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let B=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(u1(q==null||B,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!q||!B){r&&O?r(()=>i(N)):E.startTransition(()=>i(N));return}if(r&&O){r(()=>{y&&(h&&h.resolve(),y.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:q.currentLocation,nextLocation:q.nextLocation})});let V=t.window.document.startViewTransition(()=>{r(()=>i(N))});V.finished.finally(()=>{r(()=>{v(void 0),S(void 0),s(void 0),d({isTransitioning:!1})})}),r(()=>S(V));return}y?(h&&h.resolve(),y.skipTransition(),g({state:N,currentLocation:q.currentLocation,nextLocation:q.nextLocation})):(s(N),d({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}))},[t.window,r,y,h]);E.useLayoutEffect(()=>t.subscribe(x),[t,x]),E.useEffect(()=>{f.isTransitioning&&!f.flushSync&&v(new J5)},[f]),E.useEffect(()=>{if(h&&o&&t.window){let N=o,j=h.promise,O=t.window.document.startViewTransition(async()=>{E.startTransition(()=>i(N)),await j});O.finished.finally(()=>{v(void 0),S(void 0),s(void 0),d({isTransitioning:!1})}),S(O)}},[o,h,t.window]),E.useEffect(()=>{h&&o&&a.location.key===o.location.key&&h.resolve()},[h,y,a.location,o]),E.useEffect(()=>{!f.isTransitioning&&p&&(s(p.state),d({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),g(void 0))},[f.isTransitioning,p]);let R=E.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:N=>t.navigate(N),push:(N,j,O)=>t.navigate(N,{state:j,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(N,j,O)=>t.navigate(N,{replace:!0,state:j,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[t]),T=t.basename||"/",A=E.useMemo(()=>({router:t,navigator:R,static:!1,basename:T}),[t,R,T]);return E.createElement(E.Fragment,null,E.createElement(el.Provider,{value:A},E.createElement(Vo.Provider,{value:a},E.createElement(l2.Provider,{value:w.current},E.createElement(Kv.Provider,{value:f},E.createElement(r3,{basename:T,location:a.location,navigationType:a.historyAction,navigator:R},E.createElement(e3,{routes:t.routes,future:t.future,state:a})))))),null)}var e3=E.memo(t3);function t3({routes:t,future:r,state:a}){return c2(t,void 0,a,r)}function n3(t){return B5(t.context)}function Cc(t){qe(!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 r3({basename:t="/",children:r=null,location:a,navigationType:i="POP",navigator:o,static:s=!1}){qe(!Qo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),d=E.useMemo(()=>({basename:f,navigator:o,static:s,future:{}}),[f,o,s]);typeof a=="string"&&(a=Ea(a));let{pathname:h="/",search:v="",hash:y="",state:S=null,key:p="default"}=a,g=E.useMemo(()=>{let w=Sr(h,f);return w==null?null:{location:{pathname:w,search:v,hash:y,state:S,key:p},navigationType:i}},[f,h,v,y,S,p,i]);return It(g!=null,`<Router basename="${f}"> is not able to match the URL "${h}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:E.createElement(kr.Provider,{value:d},E.createElement(Yo.Provider,{children:r,value:g}))}function a3({children:t,location:r}){return P5(Pm(t),r)}function Pm(t,r=[]){let a=[];return E.Children.forEach(t,(i,o)=>{if(!E.isValidElement(i))return;let s=[...r,o];if(i.type===E.Fragment){a.push.apply(a,Pm(i.props.children,s));return}qe(i.type===Cc,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qe(!i.props.index||!i.props.children,"An index route cannot have child routes.");let f={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(f.children=Pm(i.props.children,s)),a.push(f)}),a}var Tc="get",Rc="application/x-www-form-urlencoded";function gf(t){return t!=null&&typeof t.tagName=="string"}function i3(t){return gf(t)&&t.tagName.toLowerCase()==="button"}function l3(t){return gf(t)&&t.tagName.toLowerCase()==="form"}function u3(t){return gf(t)&&t.tagName.toLowerCase()==="input"}function o3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function s3(t,r){return t.button===0&&(!r||r==="_self")&&!o3(t)}var yc=null;function c3(){if(yc===null)try{new FormData(document.createElement("form"),0),yc=!1}catch{yc=!0}return yc}var f3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rm(t){return t!=null&&!f3.has(t)?(It(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rc}"`),null):t}function d3(t,r){let a,i,o,s,f;if(l3(t)){let d=t.getAttribute("action");i=d?Sr(d,r):null,a=t.getAttribute("method")||Tc,o=rm(t.getAttribute("enctype"))||Rc,s=new FormData(t)}else if(i3(t)||u3(t)&&(t.type==="submit"||t.type==="image")){let d=t.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=t.getAttribute("formaction")||d.getAttribute("action");if(i=h?Sr(h,r):null,a=t.getAttribute("formmethod")||d.getAttribute("method")||Tc,o=rm(t.getAttribute("formenctype"))||rm(d.getAttribute("enctype"))||Rc,s=new FormData(d,t),!c3()){let{name:v,type:y,value:S}=t;if(y==="image"){let p=v?`${v}.`:"";s.append(`${p}x`,"0"),s.append(`${p}y`,"0")}else v&&s.append(v,S)}}else{if(gf(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Tc,i=null,o=Rc,f=t}return s&&o==="text/plain"&&(f=s,s=void 0),{action:i,method:a.toLowerCase(),encType:o,formData:s,body:f}}function Jv(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}async function h3(t,r){if(t.id in r)return r[t.id];try{let a=await import(t.module);return r[t.id]=a,a}catch(a){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function m3(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function v3(t,r,a){let i=await Promise.all(t.map(async o=>{let s=r.routes[o.route.id];if(s){let f=await h3(s,a);return f.links?f.links():[]}return[]}));return b3(i.flat(1).filter(m3).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function o1(t,r,a,i,o,s){let f=(h,v)=>a[v]?h.route.id!==a[v].route.id:!0,d=(h,v)=>{var y;return a[v].pathname!==h.pathname||((y=a[v].route.path)==null?void 0:y.endsWith("*"))&&a[v].params["*"]!==h.params["*"]};return s==="assets"?r.filter((h,v)=>f(h,v)||d(h,v)):s==="data"?r.filter((h,v)=>{var S;let y=i.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(f(h,v)||d(h,v))return!0;if(h.route.shouldRevalidate){let p=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((S=a[0])==null?void 0:S.params)||{},nextUrl:new URL(t,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function p3(t,r){return y3(t.map(a=>{let i=r.routes[a.route.id];if(!i)return[];let o=[i.module];return i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function y3(t){return[...new Set(t)]}function g3(t){let r={},a=Object.keys(t).sort();for(let i of a)r[i]=t[i];return r}function b3(t,r){let a=new Set;return new Set(r),t.reduce((i,o)=>{let s=JSON.stringify(g3(o));return a.has(s)||(a.add(s),i.push({key:s,link:o})),i},[])}function S3(t){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r.pathname==="/"?r.pathname="_root.data":r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function x3(){let t=E.useContext(el);return Jv(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function E3(){let t=E.useContext(Vo);return Jv(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Wv=E.createContext(void 0);Wv.displayName="FrameworkContext";function h2(){let t=E.useContext(Wv);return Jv(t,"You must render this element inside a <HydratedRouter> element"),t}function w3(t,r){let a=E.useContext(Wv),[i,o]=E.useState(!1),[s,f]=E.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:v,onMouseLeave:y,onTouchStart:S}=r,p=E.useRef(null);E.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let x=T=>{T.forEach(A=>{f(A.isIntersecting)})},R=new IntersectionObserver(x,{threshold:.5});return p.current&&R.observe(p.current),()=>{R.disconnect()}}},[t]),E.useEffect(()=>{if(i){let x=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(x)}}},[i]);let g=()=>{o(!0)},w=()=>{o(!1),f(!1)};return a?t!=="intent"?[s,p,{}]:[s,p,{onFocus:po(d,g),onBlur:po(h,w),onMouseEnter:po(v,g),onMouseLeave:po(y,w),onTouchStart:po(S,g)}]:[!1,p,{}]}function po(t,r){return a=>{t&&t(a),a.defaultPrevented||r(a)}}function O3({page:t,...r}){let{router:a}=x3(),i=E.useMemo(()=>Ja(a.routes,t,a.basename),[a.routes,t,a.basename]);return i?E.createElement(T3,{page:t,matches:i,...r}):(console.warn(`Tried to prefetch ${t} but no routes matched.`),null)}function C3(t){let{manifest:r,routeModules:a}=h2(),[i,o]=E.useState([]);return E.useEffect(()=>{let s=!1;return v3(t,r,a).then(f=>{s||o(f)}),()=>{s=!0}},[t,r,a]),i}function T3({page:t,matches:r,...a}){let i=tl(),{manifest:o,routeModules:s}=h2(),{loaderData:f,matches:d}=E3(),h=E.useMemo(()=>o1(t,r,d,o,i,"data"),[t,r,d,o,i]),v=E.useMemo(()=>o1(t,r,d,o,i,"assets"),[t,r,d,o,i]),y=E.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let g=new Set,w=!1;if(r.forEach(R=>{var A;let T=o.routes[R.route.id];!T||!T.hasLoader||(!h.some(N=>N.route.id===R.route.id)&&R.route.id in f&&((A=s[R.route.id])!=null&&A.shouldRevalidate)||T.hasClientLoader?w=!0:g.add(R.route.id))}),g.size===0)return[];let x=S3(t);return w&&g.size>0&&x.searchParams.set("_routes",r.filter(R=>g.has(R.route.id)).map(R=>R.route.id).join(",")),[x.pathname+x.search]},[f,i,o,h,r,t,s]),S=E.useMemo(()=>p3(v,o),[v,o]),p=C3(v);return E.createElement(E.Fragment,null,y.map(g=>E.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...a})),S.map(g=>E.createElement("link",{key:g,rel:"modulepreload",href:g,...a})),p.map(({key:g,link:w})=>E.createElement("link",{key:g,...w})))}function R3(...t){return r=>{t.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var m2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{m2&&(window.__reactRouterVersion="7.0.2")}catch{}function D3(t,r){return p5({basename:r==null?void 0:r.basename,future:r==null?void 0:r.future,history:PM({window:r==null?void 0:r.window}),hydrationData:(r==null?void 0:r.hydrationData)||A3(),routes:t,mapRouteProperties:I5,dataStrategy:r==null?void 0:r.dataStrategy,patchRoutesOnNavigation:r==null?void 0:r.patchRoutesOnNavigation,window:r==null?void 0:r.window}).initialize()}function A3(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:M3(t.errors)}),t}function M3(t){if(!t)return null;let r=Object.entries(t),a={};for(let[i,o]of r)if(o&&o.__type==="RouteErrorResponse")a[i]=new Qc(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let f=new s(o.message);f.stack="",a[i]=f}catch{}}if(a[i]==null){let s=new Error(o.message);s.stack="",a[i]=s}}else a[i]=o;return a}var v2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,au=E.forwardRef(function({onClick:r,discover:a="render",prefetch:i="none",relative:o,reloadDocument:s,replace:f,state:d,target:h,to:v,preventScrollReset:y,viewTransition:S,...p},g){let{basename:w}=E.useContext(kr),x=typeof v=="string"&&v2.test(v),R,T=!1;if(typeof v=="string"&&x&&(R=v,m2))try{let z=new URL(window.location.href),X=v.startsWith("//")?new URL(z.protocol+v):new URL(v),te=Sr(X.pathname,w);X.origin===z.origin&&te!=null?v=te+X.search+X.hash:T=!0}catch{It(!1,`<Link to="${v}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let A=H5(v,{relative:o}),[N,j,O]=w3(i,p),q=N3(v,{replace:f,state:d,target:h,preventScrollReset:y,relative:o,viewTransition:S});function B(z){r&&r(z),z.defaultPrevented||q(z)}let V=E.createElement("a",{...p,...O,href:R||A,onClick:T||s?r:B,ref:R3(g,j),target:h,"data-discover":!x&&a==="render"?"true":void 0});return N&&!x?E.createElement(E.Fragment,null,V,E.createElement(O3,{page:A})):V});au.displayName="Link";var p2=E.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:i="",end:o=!1,style:s,to:f,viewTransition:d,children:h,...v},y){let S=Ko(f,{relative:v.relative}),p=tl(),g=E.useContext(Vo),{navigator:w,basename:x}=E.useContext(kr),R=g!=null&&$3(S)&&d===!0,T=w.encodeLocation?w.encodeLocation(S).pathname:S.pathname,A=p.pathname,N=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(A=A.toLowerCase(),N=N?N.toLowerCase():null,T=T.toLowerCase()),N&&x&&(N=Sr(N,x)||N);const j=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let O=A===T||!o&&A.startsWith(T)&&A.charAt(j)==="/",q=N!=null&&(N===T||!o&&N.startsWith(T)&&N.charAt(T.length)==="/"),B={isActive:O,isPending:q,isTransitioning:R},V=O?r:void 0,z;typeof i=="function"?z=i(B):z=[i,O?"active":null,q?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let X=typeof s=="function"?s(B):s;return E.createElement(au,{...v,"aria-current":V,className:z,ref:y,style:X,to:f,viewTransition:d},typeof h=="function"?h(B):h)});p2.displayName="NavLink";var j3=E.forwardRef(({discover:t="render",fetcherKey:r,navigate:a,reloadDocument:i,replace:o,state:s,method:f=Tc,action:d,onSubmit:h,relative:v,preventScrollReset:y,viewTransition:S,...p},g)=>{let w=H3(),x=U3(d,{relative:v}),R=f.toLowerCase()==="get"?"get":"post",T=typeof d=="string"&&v2.test(d),A=N=>{if(h&&h(N),N.defaultPrevented)return;N.preventDefault();let j=N.nativeEvent.submitter,O=(j==null?void 0:j.getAttribute("formmethod"))||f;w(j||N.currentTarget,{fetcherKey:r,method:O,navigate:a,replace:o,state:s,relative:v,preventScrollReset:y,viewTransition:S})};return E.createElement("form",{ref:g,method:R,action:x,onSubmit:i?h:A,...p,"data-discover":!T&&t==="render"?"true":void 0})});j3.displayName="Form";function _3(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function y2(t){let r=E.useContext(el);return qe(r,_3(t)),r}function N3(t,{target:r,replace:a,state:i,preventScrollReset:o,relative:s,viewTransition:f}={}){let d=Xv(),h=tl(),v=Ko(t,{relative:s});return E.useCallback(y=>{if(s3(y,r)){y.preventDefault();let S=a!==void 0?a:pi(h)===pi(v);d(t,{replace:S,state:i,preventScrollReset:o,relative:s,viewTransition:f})}},[h,d,v,a,i,r,t,o,s,f])}var z3=0,L3=()=>`__${String(++z3)}__`;function H3(){let{router:t}=y2("useSubmit"),{basename:r}=E.useContext(kr),a=X5();return E.useCallback(async(i,o={})=>{let{action:s,method:f,encType:d,formData:h,body:v}=d3(i,r);if(o.navigate===!1){let y=o.fetcherKey||L3();await t.fetch(y,a,o.action||s,{preventScrollReset:o.preventScrollReset,formData:h,body:v,formMethod:o.method||f,formEncType:o.encType||d,flushSync:o.flushSync})}else await t.navigate(o.action||s,{preventScrollReset:o.preventScrollReset,formData:h,body:v,formMethod:o.method||f,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:a,flushSync:o.flushSync,viewTransition:o.viewTransition})},[t,r,a])}function U3(t,{relative:r}={}){let{basename:a}=E.useContext(kr),i=E.useContext(xr);qe(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),s={...Ko(t||".",{relative:r})},f=tl();if(t==null){s.search=f.search;let d=new URLSearchParams(s.search),h=d.getAll("index");if(h.some(y=>y==="")){d.delete("index"),h.filter(S=>S).forEach(S=>d.append("index",S));let y=d.toString();s.search=y?`?${y}`:""}}return(!t||t===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(s.pathname=s.pathname==="/"?a:Hr([a,s.pathname])),pi(s)}function $3(t,r={}){let a=E.useContext(Kv);qe(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=y2("useViewTransitionState"),o=Ko(t,{relative:r.relative});if(!a.isTransitioning)return!1;let s=Sr(a.currentLocation.pathname,i)||a.currentLocation.pathname,f=Sr(a.nextLocation.pathname,i)||a.nextLocation.pathname;return Yc(o.pathname,f)!=null||Yc(o.pathname,s)!=null}new TextEncoder;const B3=["number","string","datetime","date","format-string","yes-no","boolean","json"];var w1;const nl=T4({getRootUrl:()=>{var t;return`/${(t=document.querySelector('meta[name="x-basename"]'))==null?void 0:t.getAttribute("content")}/api`},headers:{"X-CSRF-Token":((w1=document.querySelector('meta[name="csrf-token"]'))==null?void 0:w1.getAttribute("content"))??""}});async function P3(){return nl("/tables")}async function q3(t,r,a,i,o){const s=new URLSearchParams;for(const f of r)s.append("order",f);return s.append("limit",a.toString()),s.append("page",i.toString()),o&&s.append("search",o),nl(`/tables/${t}?${s.toString()}`)}async function k3(t,r){return nl(`/tables/${t}/${r}`)}async function F3(t,r){return nl(`/tables/${t}/${r}`,{method:"DELETE"})}async function V3(t,r){return nl(`/tables/${t}`,{method:"POST",body:JSON.stringify(r)})}async function Y3(t,r,a){return nl(`/tables/${t}/${r}`,{method:"PUT",body:JSON.stringify(a)})}async function Q3(t,r){return nl(`/tables/${t}/suggestions/${r}`)}function ep(){return kv({queryKey:["database"],queryFn:async()=>{var i,o;const t=await P3(),r=[],a={};for(const s of((i=t.jsonData)==null?void 0:i.tables)??[])r.push(s.tableName),a[s.tableName]=s;return{tableIds:r,tables:a,rowCounts:((o=t.jsonData)==null?void 0:o.rowCounts)??{}}}})}function K3(t,{order:r,limit:a,page:i,search:o}){return kv({queryKey:["tables",t,{order:r,limit:a,page:i,search:o}],queryFn:()=>q3(t,r,a,i,o).then(s=>s.jsonData)})}function G3(t){const r=pf();return Zx({mutationFn:async({pk:a,data:i})=>a==null?V3(t,i):Y3(t,a,i),onSuccess:()=>{r.invalidateQueries({queryKey:["tables",t]})}})}function X3(t){const r=pf();return Zx({mutationFn:a=>F3(t,a),onSuccess:()=>{r.invalidateQueries({queryKey:["tables",t]})}})}function Z3(t,r){return kv({queryKey:["tables",t,"rows",r],queryFn:()=>r==null?{}:k3(t,r).then(a=>a.jsonData)})}function I3(t,r){return NM({queryKey:["foreign-key-options",t,r],queryFn:()=>Q3(t,r).then(a=>a.jsonData)})}const J3=t=>t.name?String(t.name):t.title?String(t.title):t.slug?String(t.slug):JSON.stringify(t);function W3(t){var f;const r=(f=t.schema.$bitiforms)==null?void 0:f.widgetProps,{foreignTable:a,foreignColumn:i}=r||{},{data:o=[]}=I3(a,i),s=(t.value||"").toString();return D.jsx(Dx,{label:t.schema.title,hint:t.schema.description,value:s,onChange:d=>{t.onChange({target:{name:t.name,value:Number(d.target.value)}})},children:o.map(d=>D.jsxs("option",{value:String(d.id),children:[String(d.id),": ",J3(d)]},String(d.id)))})}const s1=t=>{let r;const a=new Set,i=(v,y)=>{const S=typeof v=="function"?v(r):v;if(!Object.is(S,r)){const p=r;r=y??(typeof S!="object"||S===null)?S:Object.assign({},r,S),a.forEach(g=>g(r,p))}},o=()=>r,d={setState:i,getState:o,getInitialState:()=>h,subscribe:v=>(a.add(v),()=>a.delete(v))},h=r=t(i,o,d);return d},e6=t=>t?s1(t):s1,t6=t=>t;function g2(t,r=t6){const a=Nr.useSyncExternalStore(t.subscribe,()=>r(t.getState()),()=>r(t.getInitialState()));return Nr.useDebugValue(a),a}const c1={BASE_URL:"/%7B%7B%20basename%20%7D%7D",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_PORT:"5190"},qm=new Map,gc=t=>{const r=qm.get(t);return r?Object.fromEntries(Object.entries(r.stores).map(([a,i])=>[a,i.getState()])):{}},n6=(t,r,a)=>{if(t===void 0)return{type:"untracked",connection:r.connect(a)};const i=qm.get(a.name);if(i)return{type:"tracked",store:t,...i};const o={connection:r.connect(a),stores:{}};return qm.set(a.name,o),{type:"tracked",store:t,...o}},r6=(t,r={})=>(a,i,o)=>{const{enabled:s,anonymousActionType:f,store:d,...h}=r;let v;try{v=(s??(c1?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!v)return t(a,i,o);const{connection:y,...S}=n6(d,v,h);let p=!0;o.setState=(x,R,T)=>{const A=a(x,R);if(!p)return A;const N=T===void 0?{type:f||"anonymous"}:typeof T=="string"?{type:T}:T;return d===void 0?(y==null||y.send(N,i()),A):(y==null||y.send({...N,type:`${d}/${N.type}`},{...gc(h.name),[d]:o.getState()}),A)};const g=(...x)=>{const R=p;p=!1,a(...x),p=R},w=t(o.setState,i,o);if(S.type==="untracked"?y==null||y.init(w):(S.stores[S.store]=o,y==null||y.init(Object.fromEntries(Object.entries(S.stores).map(([x,R])=>[x,x===S.store?w:R.getState()])))),o.dispatchFromDevtools&&typeof o.dispatch=="function"){let x=!1;const R=o.dispatch;o.dispatch=(...T)=>{(c1?"production":void 0)!=="production"&&T[0].type==="__setState"&&!x&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),x=!0),R(...T)}}return y.subscribe(x=>{var R;switch(x.type){case"ACTION":if(typeof x.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return am(x.payload,T=>{if(T.type==="__setState"){if(d===void 0){g(T.state);return}Object.keys(T.state).length!==1&&console.error(`
|
|
74
|
+
Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let S=tl(),p;if(r){let A=typeof r=="string"?Ea(r):r;qe(v==="/"||((T=A.pathname)==null?void 0:T.startsWith(v)),`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 "${v}" but pathname "${A.pathname}" was given in the \`location\` prop.`),p=A}else p=S;let g=p.pathname||"/",w=g;if(v!=="/"){let A=v.replace(/^\//,"").split("/");w="/"+g.replace(/^\//,"").split("/").slice(A.length).join("/")}let x=Ja(t,{pathname:w});It(y||x!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),It(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.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 R=Y5(x&&x.map(A=>Object.assign({},A,{params:Object.assign({},d,A.params),pathname:Hr([v,o.encodeLocation?o.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?v:Hr([v,o.encodeLocation?o.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),s,a,i);return r&&R?E.createElement(Yo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},R):R}function q5(){let t=f2(),r=yf(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},f=null;return console.error("Error handled by React Router default ErrorBoundary:",t),f=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:s},"ErrorBoundary")," or"," ",E.createElement("code",{style:s},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},r),a?E.createElement("pre",{style:o},a):null,f)}var k5=E.createElement(q5,null),F5=class extends E.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?E.createElement(xr.Provider,{value:this.props.routeContext},E.createElement(Gv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function V5({routeContext:t,match:r,children:a}){let i=E.useContext(el);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),E.createElement(xr.Provider,{value:t},a)}function Y5(t,r=[],a=null,i=null){if(t==null){if(!a)return null;if(a.errors)t=a.matches;else if(r.length===0&&!a.initialized&&a.matches.length>0)t=a.matches;else return null}let o=t,s=a==null?void 0:a.errors;if(s!=null){let h=o.findIndex(v=>v.route.id&&(s==null?void 0:s[v.route.id])!==void 0);qe(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let f=!1,d=-1;if(a)for(let h=0;h<o.length;h++){let v=o[h];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(d=h),v.route.id){let{loaderData:y,errors:S}=a,p=v.route.loader&&!y.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||p){f=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((h,v,y)=>{let S,p=!1,g=null,w=null;a&&(S=s&&v.route.id?s[v.route.id]:void 0,g=v.route.errorElement||k5,f&&(d<0&&y===0?(d2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,w=null):d===y&&(p=!0,w=v.route.hydrateFallbackElement||null)));let x=r.concat(o.slice(0,y+1)),R=()=>{let T;return S?T=g:p?T=w:v.route.Component?T=E.createElement(v.route.Component,null):v.route.element?T=v.route.element:T=h,E.createElement(V5,{match:v,routeContext:{outlet:h,matches:x,isDataRoute:a!=null},children:T})};return a&&(v.route.ErrorBoundary||v.route.errorElement||y===0)?E.createElement(F5,{location:a.location,revalidation:a.revalidation,component:g,error:S,children:R(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):R()},null)}function Zv(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Q5(t){let r=E.useContext(el);return qe(r,Zv(t)),r}function K5(t){let r=E.useContext(Vo);return qe(r,Zv(t)),r}function G5(t){let r=E.useContext(xr);return qe(r,Zv(t)),r}function Iv(t){let r=G5(t),a=r.matches[r.matches.length-1];return qe(a.route.id,`${t} can only be used on routes that contain a unique "id"`),a.route.id}function X5(){return Iv("useRouteId")}function f2(){var i;let t=E.useContext(Gv),r=K5("useRouteError"),a=Iv("useRouteError");return t!==void 0?t:(i=r.errors)==null?void 0:i[a]}function Z5(){let{router:t}=Q5("useNavigate"),r=Iv("useNavigate"),a=E.useRef(!1);return o2(()=>{a.current=!0}),E.useCallback(async(o,s={})=>{It(a.current,u2),a.current&&(typeof o=="number"?t.navigate(o):await t.navigate(o,{fromRouteId:r,...s}))},[t,r])}var i1={};function d2(t,r,a){!r&&!i1[t]&&(i1[t]=!0,It(!1,a))}var l1={};function u1(t,r){!t&&!l1[r]&&(l1[r]=!0,console.warn(r))}function I5(t){let r={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&It(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(r,{element:E.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&It(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(r,{hydrateFallbackElement:E.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&It(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(r,{errorElement:E.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),r}var J5=class{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",t(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",r(a))}})}};function W5({router:t,flushSync:r}){let[a,i]=E.useState(t.state),[o,s]=E.useState(),[f,d]=E.useState({isTransitioning:!1}),[h,v]=E.useState(),[y,S]=E.useState(),[p,g]=E.useState(),w=E.useRef(new Map),x=E.useCallback((N,{deletedFetchers:j,flushSync:O,viewTransitionOpts:q})=>{j.forEach(V=>w.current.delete(V)),N.fetchers.forEach((V,z)=>{V.data!==void 0&&w.current.set(z,V.data)}),u1(O===!1||r!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let B=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(u1(q==null||B,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!q||!B){r&&O?r(()=>i(N)):E.startTransition(()=>i(N));return}if(r&&O){r(()=>{y&&(h&&h.resolve(),y.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:q.currentLocation,nextLocation:q.nextLocation})});let V=t.window.document.startViewTransition(()=>{r(()=>i(N))});V.finished.finally(()=>{r(()=>{v(void 0),S(void 0),s(void 0),d({isTransitioning:!1})})}),r(()=>S(V));return}y?(h&&h.resolve(),y.skipTransition(),g({state:N,currentLocation:q.currentLocation,nextLocation:q.nextLocation})):(s(N),d({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}))},[t.window,r,y,h]);E.useLayoutEffect(()=>t.subscribe(x),[t,x]),E.useEffect(()=>{f.isTransitioning&&!f.flushSync&&v(new J5)},[f]),E.useEffect(()=>{if(h&&o&&t.window){let N=o,j=h.promise,O=t.window.document.startViewTransition(async()=>{E.startTransition(()=>i(N)),await j});O.finished.finally(()=>{v(void 0),S(void 0),s(void 0),d({isTransitioning:!1})}),S(O)}},[o,h,t.window]),E.useEffect(()=>{h&&o&&a.location.key===o.location.key&&h.resolve()},[h,y,a.location,o]),E.useEffect(()=>{!f.isTransitioning&&p&&(s(p.state),d({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),g(void 0))},[f.isTransitioning,p]);let R=E.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:N=>t.navigate(N),push:(N,j,O)=>t.navigate(N,{state:j,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(N,j,O)=>t.navigate(N,{replace:!0,state:j,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[t]),T=t.basename||"/",A=E.useMemo(()=>({router:t,navigator:R,static:!1,basename:T}),[t,R,T]);return E.createElement(E.Fragment,null,E.createElement(el.Provider,{value:A},E.createElement(Vo.Provider,{value:a},E.createElement(l2.Provider,{value:w.current},E.createElement(Kv.Provider,{value:f},E.createElement(r3,{basename:T,location:a.location,navigationType:a.historyAction,navigator:R},E.createElement(e3,{routes:t.routes,future:t.future,state:a})))))),null)}var e3=E.memo(t3);function t3({routes:t,future:r,state:a}){return c2(t,void 0,a,r)}function n3(t){return B5(t.context)}function Cc(t){qe(!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 r3({basename:t="/",children:r=null,location:a,navigationType:i="POP",navigator:o,static:s=!1}){qe(!Qo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),d=E.useMemo(()=>({basename:f,navigator:o,static:s,future:{}}),[f,o,s]);typeof a=="string"&&(a=Ea(a));let{pathname:h="/",search:v="",hash:y="",state:S=null,key:p="default"}=a,g=E.useMemo(()=>{let w=Sr(h,f);return w==null?null:{location:{pathname:w,search:v,hash:y,state:S,key:p},navigationType:i}},[f,h,v,y,S,p,i]);return It(g!=null,`<Router basename="${f}"> is not able to match the URL "${h}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:E.createElement(kr.Provider,{value:d},E.createElement(Yo.Provider,{children:r,value:g}))}function a3({children:t,location:r}){return P5(Pm(t),r)}function Pm(t,r=[]){let a=[];return E.Children.forEach(t,(i,o)=>{if(!E.isValidElement(i))return;let s=[...r,o];if(i.type===E.Fragment){a.push.apply(a,Pm(i.props.children,s));return}qe(i.type===Cc,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qe(!i.props.index||!i.props.children,"An index route cannot have child routes.");let f={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(f.children=Pm(i.props.children,s)),a.push(f)}),a}var Tc="get",Rc="application/x-www-form-urlencoded";function gf(t){return t!=null&&typeof t.tagName=="string"}function i3(t){return gf(t)&&t.tagName.toLowerCase()==="button"}function l3(t){return gf(t)&&t.tagName.toLowerCase()==="form"}function u3(t){return gf(t)&&t.tagName.toLowerCase()==="input"}function o3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function s3(t,r){return t.button===0&&(!r||r==="_self")&&!o3(t)}var yc=null;function c3(){if(yc===null)try{new FormData(document.createElement("form"),0),yc=!1}catch{yc=!0}return yc}var f3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rm(t){return t!=null&&!f3.has(t)?(It(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rc}"`),null):t}function d3(t,r){let a,i,o,s,f;if(l3(t)){let d=t.getAttribute("action");i=d?Sr(d,r):null,a=t.getAttribute("method")||Tc,o=rm(t.getAttribute("enctype"))||Rc,s=new FormData(t)}else if(i3(t)||u3(t)&&(t.type==="submit"||t.type==="image")){let d=t.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=t.getAttribute("formaction")||d.getAttribute("action");if(i=h?Sr(h,r):null,a=t.getAttribute("formmethod")||d.getAttribute("method")||Tc,o=rm(t.getAttribute("formenctype"))||rm(d.getAttribute("enctype"))||Rc,s=new FormData(d,t),!c3()){let{name:v,type:y,value:S}=t;if(y==="image"){let p=v?`${v}.`:"";s.append(`${p}x`,"0"),s.append(`${p}y`,"0")}else v&&s.append(v,S)}}else{if(gf(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Tc,i=null,o=Rc,f=t}return s&&o==="text/plain"&&(f=s,s=void 0),{action:i,method:a.toLowerCase(),encType:o,formData:s,body:f}}function Jv(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}async function h3(t,r){if(t.id in r)return r[t.id];try{let a=await import(t.module);return r[t.id]=a,a}catch(a){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function m3(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function v3(t,r,a){let i=await Promise.all(t.map(async o=>{let s=r.routes[o.route.id];if(s){let f=await h3(s,a);return f.links?f.links():[]}return[]}));return b3(i.flat(1).filter(m3).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function o1(t,r,a,i,o,s){let f=(h,v)=>a[v]?h.route.id!==a[v].route.id:!0,d=(h,v)=>{var y;return a[v].pathname!==h.pathname||((y=a[v].route.path)==null?void 0:y.endsWith("*"))&&a[v].params["*"]!==h.params["*"]};return s==="assets"?r.filter((h,v)=>f(h,v)||d(h,v)):s==="data"?r.filter((h,v)=>{var S;let y=i.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(f(h,v)||d(h,v))return!0;if(h.route.shouldRevalidate){let p=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((S=a[0])==null?void 0:S.params)||{},nextUrl:new URL(t,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function p3(t,r){return y3(t.map(a=>{let i=r.routes[a.route.id];if(!i)return[];let o=[i.module];return i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function y3(t){return[...new Set(t)]}function g3(t){let r={},a=Object.keys(t).sort();for(let i of a)r[i]=t[i];return r}function b3(t,r){let a=new Set;return new Set(r),t.reduce((i,o)=>{let s=JSON.stringify(g3(o));return a.has(s)||(a.add(s),i.push({key:s,link:o})),i},[])}function S3(t){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r.pathname==="/"?r.pathname="_root.data":r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function x3(){let t=E.useContext(el);return Jv(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function E3(){let t=E.useContext(Vo);return Jv(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Wv=E.createContext(void 0);Wv.displayName="FrameworkContext";function h2(){let t=E.useContext(Wv);return Jv(t,"You must render this element inside a <HydratedRouter> element"),t}function w3(t,r){let a=E.useContext(Wv),[i,o]=E.useState(!1),[s,f]=E.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:v,onMouseLeave:y,onTouchStart:S}=r,p=E.useRef(null);E.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let x=T=>{T.forEach(A=>{f(A.isIntersecting)})},R=new IntersectionObserver(x,{threshold:.5});return p.current&&R.observe(p.current),()=>{R.disconnect()}}},[t]),E.useEffect(()=>{if(i){let x=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(x)}}},[i]);let g=()=>{o(!0)},w=()=>{o(!1),f(!1)};return a?t!=="intent"?[s,p,{}]:[s,p,{onFocus:po(d,g),onBlur:po(h,w),onMouseEnter:po(v,g),onMouseLeave:po(y,w),onTouchStart:po(S,g)}]:[!1,p,{}]}function po(t,r){return a=>{t&&t(a),a.defaultPrevented||r(a)}}function O3({page:t,...r}){let{router:a}=x3(),i=E.useMemo(()=>Ja(a.routes,t,a.basename),[a.routes,t,a.basename]);return i?E.createElement(T3,{page:t,matches:i,...r}):(console.warn(`Tried to prefetch ${t} but no routes matched.`),null)}function C3(t){let{manifest:r,routeModules:a}=h2(),[i,o]=E.useState([]);return E.useEffect(()=>{let s=!1;return v3(t,r,a).then(f=>{s||o(f)}),()=>{s=!0}},[t,r,a]),i}function T3({page:t,matches:r,...a}){let i=tl(),{manifest:o,routeModules:s}=h2(),{loaderData:f,matches:d}=E3(),h=E.useMemo(()=>o1(t,r,d,o,i,"data"),[t,r,d,o,i]),v=E.useMemo(()=>o1(t,r,d,o,i,"assets"),[t,r,d,o,i]),y=E.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let g=new Set,w=!1;if(r.forEach(R=>{var A;let T=o.routes[R.route.id];!T||!T.hasLoader||(!h.some(N=>N.route.id===R.route.id)&&R.route.id in f&&((A=s[R.route.id])!=null&&A.shouldRevalidate)||T.hasClientLoader?w=!0:g.add(R.route.id))}),g.size===0)return[];let x=S3(t);return w&&g.size>0&&x.searchParams.set("_routes",r.filter(R=>g.has(R.route.id)).map(R=>R.route.id).join(",")),[x.pathname+x.search]},[f,i,o,h,r,t,s]),S=E.useMemo(()=>p3(v,o),[v,o]),p=C3(v);return E.createElement(E.Fragment,null,y.map(g=>E.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...a})),S.map(g=>E.createElement("link",{key:g,rel:"modulepreload",href:g,...a})),p.map(({key:g,link:w})=>E.createElement("link",{key:g,...w})))}function R3(...t){return r=>{t.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var m2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{m2&&(window.__reactRouterVersion="7.0.2")}catch{}function D3(t,r){return p5({basename:r==null?void 0:r.basename,future:r==null?void 0:r.future,history:PM({window:r==null?void 0:r.window}),hydrationData:(r==null?void 0:r.hydrationData)||A3(),routes:t,mapRouteProperties:I5,dataStrategy:r==null?void 0:r.dataStrategy,patchRoutesOnNavigation:r==null?void 0:r.patchRoutesOnNavigation,window:r==null?void 0:r.window}).initialize()}function A3(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:M3(t.errors)}),t}function M3(t){if(!t)return null;let r=Object.entries(t),a={};for(let[i,o]of r)if(o&&o.__type==="RouteErrorResponse")a[i]=new Qc(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let f=new s(o.message);f.stack="",a[i]=f}catch{}}if(a[i]==null){let s=new Error(o.message);s.stack="",a[i]=s}}else a[i]=o;return a}var v2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,au=E.forwardRef(function({onClick:r,discover:a="render",prefetch:i="none",relative:o,reloadDocument:s,replace:f,state:d,target:h,to:v,preventScrollReset:y,viewTransition:S,...p},g){let{basename:w}=E.useContext(kr),x=typeof v=="string"&&v2.test(v),R,T=!1;if(typeof v=="string"&&x&&(R=v,m2))try{let z=new URL(window.location.href),X=v.startsWith("//")?new URL(z.protocol+v):new URL(v),te=Sr(X.pathname,w);X.origin===z.origin&&te!=null?v=te+X.search+X.hash:T=!0}catch{It(!1,`<Link to="${v}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let A=H5(v,{relative:o}),[N,j,O]=w3(i,p),q=N3(v,{replace:f,state:d,target:h,preventScrollReset:y,relative:o,viewTransition:S});function B(z){r&&r(z),z.defaultPrevented||q(z)}let V=E.createElement("a",{...p,...O,href:R||A,onClick:T||s?r:B,ref:R3(g,j),target:h,"data-discover":!x&&a==="render"?"true":void 0});return N&&!x?E.createElement(E.Fragment,null,V,E.createElement(O3,{page:A})):V});au.displayName="Link";var p2=E.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:i="",end:o=!1,style:s,to:f,viewTransition:d,children:h,...v},y){let S=Ko(f,{relative:v.relative}),p=tl(),g=E.useContext(Vo),{navigator:w,basename:x}=E.useContext(kr),R=g!=null&&$3(S)&&d===!0,T=w.encodeLocation?w.encodeLocation(S).pathname:S.pathname,A=p.pathname,N=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(A=A.toLowerCase(),N=N?N.toLowerCase():null,T=T.toLowerCase()),N&&x&&(N=Sr(N,x)||N);const j=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let O=A===T||!o&&A.startsWith(T)&&A.charAt(j)==="/",q=N!=null&&(N===T||!o&&N.startsWith(T)&&N.charAt(T.length)==="/"),B={isActive:O,isPending:q,isTransitioning:R},V=O?r:void 0,z;typeof i=="function"?z=i(B):z=[i,O?"active":null,q?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let X=typeof s=="function"?s(B):s;return E.createElement(au,{...v,"aria-current":V,className:z,ref:y,style:X,to:f,viewTransition:d},typeof h=="function"?h(B):h)});p2.displayName="NavLink";var j3=E.forwardRef(({discover:t="render",fetcherKey:r,navigate:a,reloadDocument:i,replace:o,state:s,method:f=Tc,action:d,onSubmit:h,relative:v,preventScrollReset:y,viewTransition:S,...p},g)=>{let w=H3(),x=U3(d,{relative:v}),R=f.toLowerCase()==="get"?"get":"post",T=typeof d=="string"&&v2.test(d),A=N=>{if(h&&h(N),N.defaultPrevented)return;N.preventDefault();let j=N.nativeEvent.submitter,O=(j==null?void 0:j.getAttribute("formmethod"))||f;w(j||N.currentTarget,{fetcherKey:r,method:O,navigate:a,replace:o,state:s,relative:v,preventScrollReset:y,viewTransition:S})};return E.createElement("form",{ref:g,method:R,action:x,onSubmit:i?h:A,...p,"data-discover":!T&&t==="render"?"true":void 0})});j3.displayName="Form";function _3(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function y2(t){let r=E.useContext(el);return qe(r,_3(t)),r}function N3(t,{target:r,replace:a,state:i,preventScrollReset:o,relative:s,viewTransition:f}={}){let d=Xv(),h=tl(),v=Ko(t,{relative:s});return E.useCallback(y=>{if(s3(y,r)){y.preventDefault();let S=a!==void 0?a:pi(h)===pi(v);d(t,{replace:S,state:i,preventScrollReset:o,relative:s,viewTransition:f})}},[h,d,v,a,i,r,t,o,s,f])}var z3=0,L3=()=>`__${String(++z3)}__`;function H3(){let{router:t}=y2("useSubmit"),{basename:r}=E.useContext(kr),a=X5();return E.useCallback(async(i,o={})=>{let{action:s,method:f,encType:d,formData:h,body:v}=d3(i,r);if(o.navigate===!1){let y=o.fetcherKey||L3();await t.fetch(y,a,o.action||s,{preventScrollReset:o.preventScrollReset,formData:h,body:v,formMethod:o.method||f,formEncType:o.encType||d,flushSync:o.flushSync})}else await t.navigate(o.action||s,{preventScrollReset:o.preventScrollReset,formData:h,body:v,formMethod:o.method||f,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:a,flushSync:o.flushSync,viewTransition:o.viewTransition})},[t,r,a])}function U3(t,{relative:r}={}){let{basename:a}=E.useContext(kr),i=E.useContext(xr);qe(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),s={...Ko(t||".",{relative:r})},f=tl();if(t==null){s.search=f.search;let d=new URLSearchParams(s.search),h=d.getAll("index");if(h.some(y=>y==="")){d.delete("index"),h.filter(S=>S).forEach(S=>d.append("index",S));let y=d.toString();s.search=y?`?${y}`:""}}return(!t||t===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(s.pathname=s.pathname==="/"?a:Hr([a,s.pathname])),pi(s)}function $3(t,r={}){let a=E.useContext(Kv);qe(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=y2("useViewTransitionState"),o=Ko(t,{relative:r.relative});if(!a.isTransitioning)return!1;let s=Sr(a.currentLocation.pathname,i)||a.currentLocation.pathname,f=Sr(a.nextLocation.pathname,i)||a.nextLocation.pathname;return Yc(o.pathname,f)!=null||Yc(o.pathname,s)!=null}new TextEncoder;const B3=["number","string","datetime","date","format-string","yes-no","boolean","json"];var w1;const nl=T4({getRootUrl:()=>{var t;return`/${(t=document.querySelector('meta[name="x-basename"]'))==null?void 0:t.getAttribute("content")}/api`},headers:{"X-CSRF-Token":((w1=document.querySelector('meta[name="csrf-token"]'))==null?void 0:w1.getAttribute("content"))??""}});async function P3(){return nl("/tables")}async function q3(t,r,a,i,o){const s=new URLSearchParams;for(const f of r)s.append("order",f);return s.append("limit",a.toString()),s.append("page",i.toString()),o&&s.append("search",o),nl(`/tables/${t}?${s.toString()}`)}async function k3(t,r){return nl(`/tables/${t}/${r}`)}async function F3(t,r){return nl(`/tables/${t}/${r}`,{method:"DELETE"})}async function V3(t,r){return nl(`/tables/${t}`,{method:"POST",body:JSON.stringify(r)})}async function Y3(t,r,a){return nl(`/tables/${t}/${r}`,{method:"PUT",body:JSON.stringify(a)})}async function Q3(t,r){return nl(`/tables/${t}/suggestions/${r}`)}function ep(){return kv({queryKey:["database"],queryFn:async()=>{var i,o;const t=await P3(),r=[],a={};for(const s of((i=t.jsonData)==null?void 0:i.tables)??[])r.push(s.tableName),a[s.tableName]=s;return{tableIds:r,tables:a,rowCounts:((o=t.jsonData)==null?void 0:o.rowCounts)??{}}}})}function K3(t,{order:r,limit:a,page:i,search:o}){return kv({queryKey:["tables",t,{order:r,limit:a,page:i,search:o}],queryFn:()=>q3(t,r,a,i,o).then(s=>s.jsonData)})}function G3(t){const r=pf();return Zx({mutationFn:async({pk:a,data:i})=>a==null?V3(t,i):Y3(t,a,i),onSuccess:()=>{r.invalidateQueries({queryKey:["tables",t]})}})}function X3(t){const r=pf();return Zx({mutationFn:a=>F3(t,a),onSuccess:()=>{r.invalidateQueries({queryKey:["tables",t]})}})}function Z3(t,r){return kv({queryKey:["tables",t,"rows",r],queryFn:()=>r==null?{}:k3(t,r).then(a=>a.jsonData)})}function I3(t,r){return NM({queryKey:["foreign-key-options",t,r],queryFn:()=>Q3(t,r).then(a=>a.jsonData)})}const J3=t=>t.name?String(t.name):t.title?String(t.title):t.slug?String(t.slug):JSON.stringify(t);function W3(t){var f;const r=(f=t.schema.$bitiforms)==null?void 0:f.widgetProps,{foreignTable:a,foreignColumn:i}=r||{},{data:o=[]}=I3(a,i),s=(t.value||"").toString();return console.log({options:o,stringValue:s}),D.jsx(Dx,{label:t.schema.title,hint:t.schema.description,value:s,onChange:d=>{t.onChange({target:{name:t.name,value:Number(d.target.value)}})},children:o.map(d=>D.jsxs("option",{value:String(d.id),children:[String(d.id),": ",J3(d)]},String(d.id)))})}const s1=t=>{let r;const a=new Set,i=(v,y)=>{const S=typeof v=="function"?v(r):v;if(!Object.is(S,r)){const p=r;r=y??(typeof S!="object"||S===null)?S:Object.assign({},r,S),a.forEach(g=>g(r,p))}},o=()=>r,d={setState:i,getState:o,getInitialState:()=>h,subscribe:v=>(a.add(v),()=>a.delete(v))},h=r=t(i,o,d);return d},e6=t=>t?s1(t):s1,t6=t=>t;function g2(t,r=t6){const a=Nr.useSyncExternalStore(t.subscribe,()=>r(t.getState()),()=>r(t.getInitialState()));return Nr.useDebugValue(a),a}const c1={BASE_URL:"/%7B%7B%20basename%20%7D%7D",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_PORT:"5190"},qm=new Map,gc=t=>{const r=qm.get(t);return r?Object.fromEntries(Object.entries(r.stores).map(([a,i])=>[a,i.getState()])):{}},n6=(t,r,a)=>{if(t===void 0)return{type:"untracked",connection:r.connect(a)};const i=qm.get(a.name);if(i)return{type:"tracked",store:t,...i};const o={connection:r.connect(a),stores:{}};return qm.set(a.name,o),{type:"tracked",store:t,...o}},r6=(t,r={})=>(a,i,o)=>{const{enabled:s,anonymousActionType:f,store:d,...h}=r;let v;try{v=(s??(c1?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!v)return t(a,i,o);const{connection:y,...S}=n6(d,v,h);let p=!0;o.setState=(x,R,T)=>{const A=a(x,R);if(!p)return A;const N=T===void 0?{type:f||"anonymous"}:typeof T=="string"?{type:T}:T;return d===void 0?(y==null||y.send(N,i()),A):(y==null||y.send({...N,type:`${d}/${N.type}`},{...gc(h.name),[d]:o.getState()}),A)};const g=(...x)=>{const R=p;p=!1,a(...x),p=R},w=t(o.setState,i,o);if(S.type==="untracked"?y==null||y.init(w):(S.stores[S.store]=o,y==null||y.init(Object.fromEntries(Object.entries(S.stores).map(([x,R])=>[x,x===S.store?w:R.getState()])))),o.dispatchFromDevtools&&typeof o.dispatch=="function"){let x=!1;const R=o.dispatch;o.dispatch=(...T)=>{(c1?"production":void 0)!=="production"&&T[0].type==="__setState"&&!x&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),x=!0),R(...T)}}return y.subscribe(x=>{var R;switch(x.type){case"ACTION":if(typeof x.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return am(x.payload,T=>{if(T.type==="__setState"){if(d===void 0){g(T.state);return}Object.keys(T.state).length!==1&&console.error(`
|
|
75
75
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
76
76
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
77
77
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devmoods/postgres-admin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"vitest": "^2.1.8",
|
|
45
45
|
"zustand": "^5.0.2"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "be2a264cb9164df7e250e36b3bb294880d617106"
|
|
48
48
|
}
|