1function N(e){return Array.from(new Set(e))}function T(e,t){const n=Ke();return n[e]??(n[e]=t)}function Ke(){var e;return globalThis._vike??(globalThis._vike={}),(e=globalThis._vike).globals??(e.globals={}),globalThis._vike.globals}const b=new Proxy({},{get:(e,t)=>n=>t==="code"?`\`${n}\``:t==="string"?`'${n}'`:n}),fe="0.4.255";let _;_??(_=ge());function ge(){return T("utils/assertSingleInstance.ts",{instances:[],alreadyLogged:new Set})}function I(){return _??(_=ge()),_}const de="Client runtime of both Server Routing and Client Routing loaded https://vike.dev/client-runtimes-conflict",J="Client runtime loaded twice https://vike.dev/client-runtime-duplicated";function Y(){const e=I();{const t=N(e.instances);$(t.length<=1,`vike@${b.bold(t[0])} and vike@${b.bold(t[1])} loaded which is highly discouraged ${b.underline("https://vike.dev/warning/version-mismatch")}`,{onlyOnce:!0,showStackTrace:!1})}e.checkSingleInstance&&e.instances.length>1&&$(!1,J,{onlyOnce:!0,showStackTrace:!0})}function nr(e){const t=I();$(t.isClientRouting!==!0,de,{onlyOnce:!0,showStackTrace:!0}),$(t.isClientRouting===void 0,J,{onlyOnce:!0,showStackTrace:!0}),t.isClientRouting=!1,t.checkSingleInstance=!0,Y()}function rr(e){const t=I();$(t.isClientRouting!==!1,de,{onlyOnce:!0,showStackTrace:!0}),$(t.isClientRouting===void 0,J,{onlyOnce:!0,showStackTrace:!0}),t.isClientRouting=!0,t.checkSingleInstance=!0,Y()}function qe(){I().instances.push(fe),Y()}function $(e,t,{onlyOnce:n,showStackTrace:r}){const o=I();if(e)return;const s=`[Vike][Warning] ${t}`;{const{alreadyLogged:i}=o,l=s;if(i.has(l))return;i.add(l)}console.warn(r?new Error(s):s)}function Xe(){return!(typeof process>"u"||!process.cwd||!process.versions||typeof process.versions.node>"u"||!process.release||process.release.name!=="node")}function Ze(e,t){const n=new Error(e);return Xe()&&(n.stack=Qe(n.stack,t)),n}function Qe(e,t){if(!e)return e;const n=tt(e);let r=0;return n.filter(s=>s.includes(" (internal/")||s.includes(" (node:internal")?!1:r<t&&et(s)?(r++,!1):!0).join(` 2`)}function et(e){return e.startsWith(" at ")}function tt(e){return e.split(/\r?\n/)}function nt(e){return b.bold(b.yellow(e))}function rt(e){return b.bold(b.red(e))}function ot(e){return b.yellow(e)}const E=T("utils/assert.ts",{alreadyLogged:new Set});qe();const st="[vike]",it=`[vike@${fe}]`,at="Bug";function a(e,t){if(e)return;const n=(()=>{if(!t)return null;const i=typeof t=="string"?t:JSON.stringify(t);return b.dim(`Debug for maintainers (you can ignore this): ${i}`)})();let o=[`You stumbled upon a Vike bug. Go to ${b.underline("https://github.com/vikejs/vike/issues/new?template=bug.yml")} and copy-paste this error. A maintainer will fix the bug (usually within 24 hours).`,n].filter(Boolean).join(" ");o=j(o,at,!0);const s=L(o);throw E.onBeforeLog?.(),E.onBeforeErr?.(s),s}function m(e,t,{showStackTrace:n,exitOnError:r}={}){if(e)return;n=n||E.alwaysShowStackTrace,t=j(t,"Wrong Usage");const o=L(t);if(E.onBeforeLog?.(),E.onBeforeErr?.(o),r)console.error(n?o:t),process.exit(1);else throw o}function lt(e){return e=j(e,"Error"),L(e)}function O(e,t,{onlyOnce:n,showStackTrace:r}){if(e)return;if(r=r||E.alwaysShowStackTrace,n){const{alreadyLogged:s}=E,i=n===!0?t:n;if(s.has(i))return;s.add(i)}const o=j(t,"Warning");if(E.onBeforeLog?.(),r){const s=L(o);E.onBeforeErr?.(s),console.warn(s)}else console.warn(o)}function or(e,t,{onlyOnce:n}){t=j(t,null);{const{alreadyLogged:r}=E,o=t;if(r.has(o))return;r.add(o)}E.onBeforeLog?.(),console.log(t)}function j(e,t,n=!1){const r=ft(n),o=ut(t),s=ct(e);return E.addAssertTagsDev?`${E.addAssertTagsDev(r,o)}${s}${e}`:`${`${r}${o}`}${s}${e}`}function ct(e){return e.startsWith("[")?"":" "}function ut(e){if(!e)return"";let t=`[${e}]`;return e==="Warning"?t=ot(t):t=rt(t),t}function ft(e=!1){return nt(e?it:st)}function L(e){const t=Ze(e,3);return E.addAssertTagsDev&&(t.stack=t.stack?.replace(/^Error:\s*/,"")),t}function W(e,t,n){return typeof e=="string"?Q(e.split(""),t,n).join(""):Q(e,t,n)}function Q(e,t,n){const r=[];let o=t>=0?t:e.length+t;a(o>=0&&o<=e.length);let s=n>=0?n:e.length+n;for(a(s>=0&&s<=e.length);!(o===s||(o===e.length&&(o=0),o===s));){const i=e[o];a(i!==void 0),r.push(i),o++}return r}
2function gt(e,t){a(xt(e),e),a(t.startsWith("/"));const{hashString:n,withoutHash:r}=dt(e);a(n===null||n.startsWith("#"));const o=n===null?"":he(n.slice(1)),{searchString:s,withoutSearch:i}=ee(r);a(s===null||s.startsWith("?"));let l="";if(s!==null)l=s;else if(e.startsWith("#")){const v=pe();l=v&&ee(v).searchString||""}const c={},u={};Array.from(new URLSearchParams(l)).forEach(([v,Z])=>{c[v]=Z,u[v]=[...u.hasOwnProperty(v)?u[v]:[],Z]});let{protocol:f,origin:h,pathnameAbsoluteWithBase:g}=pt(i,t);const p=i.slice((h||"").length);Et(e,h,p,s,n);let{pathname:d,isBaseMissing:C}=Pt(g,t);const P=me(h,d,s,n),Ne=h?h.slice(f.length):null,{hostname:Je,port:Ye}=bt(Ne,e);return d=ht(d),a(d.startsWith("/")),{href:P,protocol:f,hostname:Je,port:Ye,origin:h,pathname:d,pathnameOriginal:p,isBaseMissing:C,search:c,searchAll:u,searchOriginal:s,hash:o,hashOriginal:n}}function dt(e){const[t,...n]=e.split("#");return{hashString:["",...n].join("#")||null,withoutHash:t}}function ee(e){const[t,...n]=e.split("?");return{searchString:["",...n].join("?")||null,withoutSearch:t}}function he(e){try{return decodeURIComponent(e)}catch{}try{return decodeURI(e)}catch{}return e}function ht(e){return e=e.replace(/\s+$/,""),e=e.split("/").map(t=>he(t).split("/").join("%2F")).join("/"),e}function pt(e,t){a(!e.includes("?")&&!e.includes("#"));{const{protocol:n,origin:r,pathname:o}=te(e);if(r)return{protocol:n,origin:r,pathnameAbsoluteWithBase:o};a(o===e)}if(e.startsWith("/"))return{protocol:null,origin:null,pathnameAbsoluteWithBase:e};{const n=pe();let r;return n?r=te(n.split("?")[0].split("#")[0]).pathname:r=t,{protocol:null,origin:null,pathnameAbsoluteWithBase:yt(e,r)}}}function pe(){return typeof window<"u"?window?.document?.baseURI:void 0}function te(e){if(Ce(e)){const{protocol:t,uriWithoutProtocol:n}=be(e);a(t);const[r,...o]=n.split("/"),s=t+r;return{pathname:"/"+o.join("/"),origin:s,protocol:t}}else return{pathname:e,origin:null,protocol:null}}function bt(e,t){const n={hostname:null,port:null};if(!e)return n;const r=e.split(":");if(r.length>1){const o=parseInt(r.pop(),10);a(o||o===0,t),n.port=o}return n.hostname=r.join(":"),n}function be(e){const[n,...r]=e.split(":");if(r.length===0||!/^[a-z][a-z0-9\+\-]*$/i.test(n))return{protocol:null,uriWithoutProtocol:e};let o=n+":",s=r.join(":");const i="//";return s.startsWith(i)&&(o=o+i,s=s.slice(i.length)),{protocol:o,uriWithoutProtocol:s}}function mt(e){return["ipfs://","ipns://"].includes(e)?!1:e.endsWith("://")}function yt(e,t){const n=t.split("/"),r=e.split("/");let o=t.endsWith("/");e.startsWith(".")&&n.pop();for(const i in r){const l=r[i];l==""&&i==="0"||l!="."&&(l==".."?n.pop():(o=!1,n.push(l)))}let s=n.join("/");return o&&!s.endsWith("/")&&(s+="/"),s.startsWith("/")||(s="/"+s),s}function Pt(e,t){a(e.startsWith("/")),a(Ct(t));let n=e;if(a(n.startsWith("/")),a(t.startsWith("/")),t==="/")return{pathname:e,isBaseMissing:!1};let r=t;return t.endsWith("/")&&n===W(t,0,-1)&&(r=W(t,0,-1),a(n===r)),n.startsWith(r)?(a(n.startsWith("/")||n.startsWith("http")),a(n.startsWith(r)),n=n.slice(r.length),n.startsWith("/")||(n="/"+n),a(n.startsWith("/")),{pathname:n,isBaseMissing:!1}):{pathname:e,isBaseMissing:!0}}function Ct(e){return e.startsWith("/")}function Et(e,t,n,r,o){const s=me(t,n,r,o);a(e===s)}function me(e,t,n,r){return`${e||""}${t}${n||""}${r||""}`}function xt(e){return ye(e)||Pe(e)}function ye(e){return St(e)||Ce(e)}function St(e){return e.startsWith("/")}function Pe(e){return[".","?","#"].some(t=>e.startsWith(t))||e===""}function sr(e){return!e.startsWith("/")&&!Pe(e)}function Ce(e){const{protocol:t}=be(e);return!!t&&mt(t)}function ir(e,t){m(ye(e),wt(e,t))}function wt(e,t,n,r){let o=`${t} is ${b.string(e)} but it should start with ${b.string("/")}`;return o+=` or a protocol (e.g. ${b.string("http://")})`,o}function D(){return Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1}function kt(){a(D())}vt();function vt(){kt()}function Ot(e,t){a(!e.startsWith("#"));const{searchOriginal:n,hashOriginal:r,pathname:o}=gt(e,"/");let s=`${o}${n||""}`;return t?.withoutHash||(s+=r||""),a(s.startsWith("/")),s}function ar(e){return Ot(window.location.href,e)}function z(e){const t=e/1e3;if(t<120){const n=ne(t);return`${n} second${re(n)}`}{const n=t/60,r=ne(n);return`${r} minute${re(r)}`}}function ne(e){let t=e.toFixed(1);
2return t.endsWith(".0")&&(t=t.slice(0,-2)),t}function re(e){return e==="1"?"":"s"}const $t=25*1e3;function Ee({timeout:e=$t}={}){let t,n,r=!1;const o=new Promise((c,u)=>{t=(...f)=>(r=!0,s(),c(...f)),n=(...f)=>(r=!0,s(),u(...f))}),s=()=>i.forEach(c=>clearTimeout(c)),i=[];let l;return e?l=new Proxy(o,{get(c,u){if(u==="then"&&!r){const h=new Error(`Promise hasn't resolved after ${z(e)}`);i.push(setTimeout(()=>{a(h.stack),O(!1,Tt(h.stack),{onlyOnce:!1})},e))}const f=Reflect.get(c,u);return typeof f=="function"?f.bind(c):f}}):l=o,{promise:l,resolve:t,reject:n}}function Tt(e){const t="Error: ";return e.startsWith(t)&&(e=e.slice(t.length)),e}function V(e){return e instanceof Function||typeof e=="function"}function x(e){return typeof e=="object"&&e!==null}function k(e){return Array.isArray(e)}function _t(e){return k(e)&&e.every(t=>typeof t=="string")}function Rt(e){return x(e)&&Object.values(e).every(t=>typeof t=="string")}function y(e,t,n){if(!x(e))return!1;if(!(t in e))return n==="undefined";if(n===void 0)return!0;const r=e[t];return n==="undefined"?r===void 0:n==="array"?k(r):n==="object"?x(r):n==="string[]"?_t(r):n==="string{}"?Rt(r):n==="function"?V(r):k(n)?typeof r=="string"&&n.includes(r):n==="null"?r===null:n==="true"?r===!0:n==="false"?r===!1:typeof r===n}function w(e,t,n){t&&(n||a(!t._isOriginalObject),Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)))}function lr(e,t){a(e===t)}const It=[{is:e=>e===void 0,match:e=>e==="!undefined",serialize:()=>"!undefined",deserialize:()=>{}},{is:e=>e===1/0,match:e=>e==="!Infinity",serialize:()=>"!Infinity",deserialize:()=>1/0},{is:e=>e===-1/0,match:e=>e==="!-Infinity",serialize:()=>"!-Infinity",deserialize:()=>-1/0},{is:e=>typeof e=="number"&&isNaN(e),match:e=>e==="!NaN",serialize:()=>"!NaN",deserialize:()=>NaN},{is:e=>e instanceof Date,match:e=>e.startsWith("!Date:"),serialize:e=>"!Date:"+e.toISOString(),deserialize:e=>new Date(e.slice(6))},{is:e=>typeof e=="bigint",match:e=>e.startsWith("!BigInt:"),serialize:e=>"!BigInt:"+e.toString(),deserialize:e=>{if(typeof BigInt>"u")throw new Error("Your JavaScript environement does not support BigInt. Consider adding a polyfill.");return BigInt(e.slice(8))}},{is:e=>e instanceof RegExp,match:e=>e.startsWith("!RegExp:"),serialize:e=>"!RegExp:"+e.toString(),deserialize:e=>{e=e.slice(8);const t=e.match(/\/(.*)\/(.*)?/),n=t[1],r=t[2];return new RegExp(n,r)}},{is:e=>e instanceof Map,match:e=>e.startsWith("!Map:"),serialize:(e,t)=>"!Map:"+t(Array.from(e.entries())),deserialize:(e,t)=>new Map(t(e.slice(5)))},{is:e=>e instanceof Set,match:e=>e.startsWith("!Set:"),serialize:(e,t)=>"!Set:"+t(Array.from(e.values())),deserialize:(e,t)=>new Set(t(e.slice(5)))},{is:e=>typeof e=="string"&&e.startsWith("!"),match:e=>e.startsWith("!"),serialize:e=>"!"+e,deserialize:e=>e.slice(1)}];function xe(e,t={}){const n=JSON.parse(e);return K(n,t)}function K(e,t={}){return typeof e=="string"?jt(e,t):(typeof e=="object"&&e!==null&&Object.entries(e).forEach(([n,r])=>{e[n]=K(r,t)}),e)}function jt(e,t){const n=r=>xe(r,t);{const r=t.reviver?.(void 0,e,n);if(r){if(typeof r.replacement!="string")return r.replacement;if(e=r.replacement,r.resolved)return e}}for(const{match:r,deserialize:o}of It)if(r(e))return o(e,n);return e}const At="vike_pageContext",Wt="vike_globalContext";function cr(){const e=Se(At);return a(y(e,"pageId","string")),a(y(e,"routeParams","string{}")),e}function Ft(){return Se(Wt)}function Se(e){const t=document.getElementById(e);m(t,`Couldn't find #${e} (which Vike automatically injects in the HTML): make sure it exists (i.e. don't remove it and make sure your HTML isn't malformed)`);const n=t.textContent;return a(n),xe(n,{reviver(o,s){if(typeof s=="string")return{replacement:s.replaceAll("\\/","/"),resolved:!1}}})}function Lt(e){return e==null}function Dt(e){return!Lt(e)}function Vt(e,t){return we(e,t,!0)}function ur(e,t){return we(e,t,!1)}function we(e,t,n){const r=n?"CLIENT_ONLY":"SERVER_ONLY",o=e.filter(p=>p.isRelevant(t)&&p.fileType!==".page.route").sort(Ht(n,t)),s=p=>{const d=o.filter(P=>P.pageId===t&&P.isEnv(p?"CLIENT_AND_SERVER":r));m(d.length<=1,`Merge the following files into a single file: ${d.map(P=>P.filePath).join(" ")}`);const C=d[0];return a(C===void 0||!C.isDefaultPageFile),C},i=s(!1),l=s(!0),c=p=>o.filter(d=>d.isRendererPageFile&&d.isEnv(p?"CLIENT_AND_SERVER":r))[0],u=c(!1),f=c(!0),h=o.filter(p=>p.isDefaultPageFile&&!p.isRendererPageFile&&(p.isEnv(r)||p.isEnv("CLIENT_AND_SERVER")));return[i,l,...h,u,f].filter(Dt)}function Ht(e,t){const n=e?"CLIENT_ONLY":"SERVER_ONLY",r=-1,o=1,s=0;return(i,l)=>{if(!i.isDefaultPageFile&&l.isDefaultPageFile)return r;if(!l.isDefaultPageFile&&i.isDefaultPageFile)return o;{const c=i.isRendererPageFile,u=l.isRendererPageFile;if(!c&&u)return r;if(!u&&c)return o;a(c===u)}{const c=oe(t,i.filePath),u=oe(t,l.filePath);if(c<u)return r;if(u<c)return o;a(c===u)}{if(i.isEnv(n)&&l.isEnv("CLIENT_AND_SERVER"))return r;if(l.isEnv(n)&&i.isEnv("CLIENT_AND_SERVER"))return o}return s}}function oe(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);const r=e.slice(n),o=t.slice(n),s=r.split("/").length,i=o.split("/").length;return s+i}function fr(e,t){const n=t.find(r=>r.pageId===e);return a(t.length>0),a(n),n}function ke(e){if(!e||k(e)||e.definedBy)return null;const{filePathToShowToUser:t}=e;return a(t),t}function ve(e){const t=ke(e);return a(t),t}function zt(e,t){if(!e)return null;let[n,...r]=e;if(!n||r.length===0&&["*","default",t].includes(n))return null;a(n!=="*");let o="",s="";return n==="default"?o="export default":(o="export",r=[n,...r]),r.forEach(l=>{o=`${o} { ${l}`,s=` }${s}`}),o+s}function Bt(e,t,n){return`${B(e,t)} at ${R(n,t)}`}function Ut(e,t,n){return n?`${B(e,t)} at ${R(n,t)}`:`${B(e,t)} internally`}function B(e,t){return`${e} ${b.cyan(t)} defined`}function R(e,t){let n;return k(e)?n=e:n=[e],a(n.length>=1),n.map(o=>{if(o.definedBy)return Gt(o,t);const{filePathToShowToUser:s,fileExportPathToShowToUser:i}=o,l=zt(i,t);return l?`${s} > ${b.cyan(l)}`:s}).join(" / ")}function Gt(e,t){if(e.definedBy==="api")return`API call ${b.cyan(`${e.operation}({ vikeConfig: { ${t} } })`)}`;const{definedBy:n}=e;if(n==="cli")return`CLI option ${b.cyan(`--${t}`)}`;if(n==="env")return`environment variable ${b.cyan(`VIKE_CONFIG="{${t}}"`)}`;a(!1)}const Mt=T("hooks/getHook.ts",{});function se(e,t){if(!(t in e.exports))return null;const{hooksTimeout:n}=e.config,r=Te(n,t),o=e.exports[t];
2if(o===null)return null;const s=e.exportsAll[t][0];a(s.exportValue===o);const i=s.filePath;return a(i),H(o,t,i,r)}function Nt(e,t){const{hooksTimeout:n}=t.config,r=Te(n,e),o=[];return t.exportsAll[e]?.forEach(s=>{const i=s.exportValue;if(i===null)return;const l=s.filePath;a(l),o.push(H(i,e,l,r))}),o}function gr(e,t){const n=e.configValues[t];if(!n?.value)return null;const{hookFn:r,hookFilePath:o}=Jt(n),s=$e(t);return H(r,t,o,s)}function Oe(e,t){const n=e.configValues[t];if(!n?.value)return[];const r=n.value;return a(k(r)),r.map((o,s)=>{const i=o,l=$e(t);a(k(n.definedAtData));const c=ve(n.definedAtData[s]);return H(i,t,c,l)})}function $e(e){return _e(e)}function H(e,t,n,r){return a(n),Yt(e,{hookName:t,hookFilePath:n}),{hookFn:e,hookName:t,hookFilePath:n,hookTimeout:r}}function Jt(e){const t=e.value;a(t);const n=ve(e.definedAtData);return{hookFn:t,hookFilePath:n}}function Yt(e,{hookName:t,hookFilePath:n}){a(t&&n),a(!t.endsWith(")")),a(!n.endsWith(" ")),m(V(e),`Hook ${t}() defined by ${n} should be a function`)}function Te(e,t){const n=Kt(e);if(n===!1)return{error:!1,warning:!1};const r=n[t],o=_e(t);return r?.error!==void 0&&(o.error=r.error),r?.warning!==void 0&&(o.warning=r.warning),o}function Kt(e){if(e===void 0)return{};if(e===!1)return!1;m(x(e),`Setting ${b.cyan("hooksTimeout")} should be ${b.cyan("false")} or an object`);const t={};return Object.entries(e).forEach(([n,r])=>{if(r===!1){t[n]={error:!1,warning:!1};return}m(x(r),`Setting ${b.cyan(`hooksTimeout.${n}`)} should be ${b.cyan("false")} or an object`);const[o,s]=["error","warning"].map(i=>{const l=r[i];if(l===void 0||l===!1)return l;const c=`Setting ${b.cyan(`hooksTimeout.${n}.${i}`)} should be`;return m(typeof l=="number",`${c} ${b.cyan("false")} or a number`),m(l>0,`${c} a positive number`),l});t[n]={error:o,warning:s}}),t}function _e(e){return e==="onBeforeRoute"?{error:5*1e3,warning:1*1e3}:Mt.isPrerendering?{error:120*1e3,warning:30*1e3}:(a(!e.toLowerCase().includes("prerender")),{error:30*1e3,warning:4*1e3})}function qt(e,t){const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&!("value"in n)&&!!n.get}function Xt(e){Zt(e)}function Zt(e){if(e.is404===void 0||e.is404===null)return;const t=e.pageProps||{};if(!x(t)){O(!1,"pageContext.pageProps should be an object",{showStackTrace:!0,onlyOnce:!0});return}t.is404=t.is404||e.is404,e.pageProps=t}const Qt="__VIKE__NOT_SERIALIZABLE__";function en(e){return typeof e=="string"&&tn(e)?`.${e}`:`[${JSON.stringify(e)}]`}function tn(e){return/^[a-z0-9\$_]+$/i.test(e)}function q(e,t,n,r){return new Proxy(e,{get:(o,s)=>nn(s,e,t,n,r)})}function nn(e,...t){const[n,r,o,s]=t,i=String(e);if(e==="_isProxyObject")return!0;if(e==="dangerouslyUseInternals")return t[2]=!0,q(...t);if(e==="_originalObject")return n;if(s&&!(e in n))return s(e);const l=n[e];return rn(i,l,r),l}function rn(e,t,n){if(t!==Qt)return;const r=en(e);a(D()),m(!1,`Can't access ${n}${r} on the client side. Because it can't be serialized, see server logs.`)}function Re(e){return a(e._isOriginalObject),q(e,"globalContext")}function on(e){a(!e._isProxyObject),a(!e.globalContext),a(e._isOriginalObject),Xt(e),"_pageId"in e||Object.defineProperty(e,"_pageId",{get(){return O(!1,"pageContext._pageId has been renamed to pageContext.pageId",{showStackTrace:!0,onlyOnce:!0}),e.pageId},enumerable:!1});const t=Re(e._globalContext);return q(e,"pageContext",!0,r=>{if(r==="globalContext")return t;if(r in t)return t[r]})}function sn(e){["urlPathname","urlParsed","url","pageExports"].forEach(t=>{e.prop&&a(qt(e,t))})}const U=T("utils/execHook.ts",{userHookErrors:new WeakMap,pageContext:null});async function dr(e,t,n){const r=Nt(e,t);return await Ie(r,t,n)}async function an(e,t,n){const r=Oe(t._pageConfigGlobal,e),o=n(t);await Promise.all(r.map(async s=>{await je(()=>s.hookFn(o),s,t,null)}))}async function Ie(e,t,n){if(!e.length)return[];const r=n(t);return await Promise.all(e.map(async s=>{const i=await je(()=>s.hookFn(r),s,t._globalContext,r);return{...s,hookReturn:i}}))}
2async function ln(e,t,n){const r=await Ie([e],t,n),{hookReturn:o}=r[0];m(o===void 0,`The ${e.hookName}() hook defined by ${e.hookFilePath} isn't allowed to return a value`)}function hr(e,t,n,r,o){const s=n&&r(n);return o??(o=()=>e.hookFn(s)),{hookReturn:Ae(o,e,t,s)}}function je(e,t,n,r){const{hookName:o,hookFilePath:s,hookTimeout:{error:i,warning:l}}=t;let c,u;const f=new Promise((d,C)=>{c=P=>{h(),d(P)},u=P=>{h(),C(P)}}),h=()=>{g&&clearTimeout(g),p&&clearTimeout(p)},g=ie(l)&&setTimeout(()=>{O(!1,`The ${o}() hook defined by ${s} is slow: it's taking more than ${z(l)} (https://vike.dev/hooksTimeout)`,{onlyOnce:!1})},l),p=ie(i)&&setTimeout(()=>{const d=lt(`The ${o}() hook defined by ${s} timed out: it didn't finish after ${z(i)} (https://vike.dev/hooksTimeout)`);u(d)},i);return(async()=>{try{const d=await Ae(e,t,n,r);c(d)}catch(d){x(d)&&U.userHookErrors.set(d,{hookName:o,hookFilePath:s}),u(d)}})(),f}function Ae(e,t,n,r){const{hookName:o,hookFilePath:s}=t;a(o!=="onHookCall");const i=n._pageConfigGlobal.configValues.onHookCall,l=()=>(cn(r),e());if(!i?.value)return l();let c=!1,u,f,h=()=>{c=!0;try{u=l()}catch(g){throw f=g,g}return u};for(const g of i.value){const p={name:o,filePath:s,call:h};h=()=>((async()=>{try{await g(p,r)}catch(d){d!==f&&console.error(d)}})(),m(c,"onHookCall() must run hook.call()"),u)}if(h(),f)throw f;return u}function ie(e){return!!e&&e!==1/0}function cn(e){U.pageContext=e,Promise.resolve().then(()=>{U.pageContext=null})}function pr(e){const t=e.config?.Page||e.exports?.Page;return w(e,{Page:t}),sn(e),fn(e),un(e)}function un(e){return on(e)}function fn(e){gn(e)}function gn(e){Object.entries(e).forEach(([t,n])=>{delete e[t],e[t]=n})}function We(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(e,t,{...r,enumerable:n})}function br(e,t){return w(e,t),e}function mr(){const e={_isOriginalObject:!0,isPageContext:!0};return We(e,"_isOriginalObject",!1),e}function dn(e,t,{get:n,...r}){Object.defineProperty(e,t,{...r,get:n})}function hn(e,t,n){Object.keys(e).filter(r=>!0).forEach(r=>delete e[r]),Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}const pn=["clientRouting"];function bn(e){pn.forEach(t=>{if(a(e.fileExports),!(t in e.fileExports))return;const n=`The value of \`${t}\` is only allowed to be \`true\`.`;m(e.fileExports[t]!==!1,`${e.filePath} has \`export { ${t} }\` with the value \`false\` which is prohibited: remove \`export { ${t} }\` instead. (${n})`),m(e.fileExports[t]===!0,`${e.filePath} has \`export { ${t} }\` with a forbidden value. ${n}`)})}const Fe=["render","clientRouting","prerender","doNotPrerender"];function mn(e,t){m(!Fe.includes(e),`${t} has \`export default { ${e} }\` which is prohibited, use \`export { ${e} }\` instead.`)}function yn(e){const t=".page.",n=W(e.split(t),0,-1).join(t);return a(!n.includes("\\")),n}function yr(e,t){if(t.length>0){const r=t.filter(o=>o.isErrorPage);return r.length===0?null:(m(r.length===1,"Only one error page can be defined"),r[0].pageId)}const n=N(e.map(({pageId:r})=>r).filter(r=>X(r)));if(m(n.length<=1,`Only one _error.page.js is allowed, but found several: ${n.join(" ")}`),n.length>0){const r=n[0];return a(r),r}return null}function X(e,t){return a(!e.includes("\\")),e.includes("/_error")}const Pn=["js","cjs","mjs"],Cn=["ts","cts","mts"],En=[...Pn,...Cn],xn=["jsx","cjsx","mjsx"],Sn=["tsx","ctsx","mtsx"],wn=[...xn,...Sn],Le=["vue","svelte","marko","md","mdx"],kn=[...En,...wn,...Le];function De(e){return kn.some(t=>e.endsWith("."+t))}function vn(e){return Le.some(t=>e.endsWith("."+t))}const On=[".page",".page.server",".page.route",".page.client",".css"];function $n(e){if(e.endsWith(".css"))return".css";a(De(e),e);const n=e.split("/").slice(-1)[0].split("."),r=n.slice(-3)[0],o=n.slice(-2)[0];if(o==="page")return".page";if(a(r==="page",e),o==="server")return".page.server";if(o==="client")return".page.client";if(o==="route")return".page.route";a(!1,e)}function Ve(e){const t=s=>o.pageId===s||o.isDefaultPageFile&&(ae(o.filePath)||Tn(s,o.filePath)),n=$n(e),o={filePath:e,fileType:n,isEnv:s=>{if(a(n!==".page.route"),s==="CLIENT_ONLY")return n===".page.client"||n===".css";if(s==="SERVER_ONLY")return n===".page.server";if(s==="CLIENT_AND_SERVER")return n===".page";a(!1)},isRelevant:t,isDefaultPageFile:G(e),isRendererPageFile:n!==".css"&&G(e)&&ae(e),isErrorPageFile:X(e),pageId:yn(e)};return o}function G(e){return X(e)?!1:e.includes("/_default")}function ae(e){return e.includes("/renderer/")}function Tn(e,t){a(!e.endsWith("/")),a(!t.endsWith("/")),a(G(t));const n=W(t.split("/"),0,-1).filter(r=>r!=="_default").join("/");return e.startsWith(n)}const _n=["$$registrations","_rerender_only"],Rn=[".md",".mdx"];function In(e,t,n){const r=Object.keys(e),o=u=>u==="default"||u===n,s=r.filter(o),i=b.code("export default"),l=b.code(`export { ${n} }`);s.length===0&&m(!1,`${t} should define ${l} or ${i}`),s.length===2&&m(!1,`${t} is ambiguous: remove ${i} or ${l}`),a(s.length===1);const c=r.filter(u=>!o(u)).filter(u=>!_n.includes(u));Rn.some(u=>
2t.endsWith(u))||c.forEach(u=>{O(!1,`${t} unexpected ${b.cyan(`export { ${u} }`)}, see https://vike.dev/no-side-exports`,{onlyOnce:!0})})}function jn(e,t){const n=e.map(o=>{const s=M(o.configValuesSerialized);return An(s),{...o,configValues:s}}),r={configValues:{}};{const o=M(t.configValuesSerialized);Object.assign(r.configValues,o)}return{pageConfigs:n,pageConfigGlobal:r}}function An(e){const t="route",n=e[t];if(!n)return;const{value:r,definedAtData:o}=n,s=typeof r;a(o);const i=Bt("Config",t,o);m(s==="string"||V(r),`${i} has an invalid type '${s}': it should be a string or a function instead, see https://vike.dev/route`)}function M(e){const t={};return Object.entries(e).forEach(([r,o])=>{let s;if(o.type==="cumulative"){const{valueSerialized:i,...l}=o;s={value:i.map((u,f)=>{const{value:h,sideExports:g}=le(u,r,()=>{const p=o.definedAtData[f];return a(p),p});return n(g),h}),...l}}else{const{valueSerialized:i,...l}=o,{value:c,sideExports:u}=le(i,r,()=>{a(o.type!=="computed");const{definedAtData:f}=o;return Array.isArray(f)?f[0]:f});n(u),s={value:c,...l}}t[r]=s}),t;function n(r){r.forEach(o=>{const{configName:s,configValue:i}=o;t[s]||(t[s]=i)})}}function le(e,t,n){if(e.type==="js-serialized"){let{value:r}=e;return r=K(r),{value:r,sideExports:[]}}if(e.type==="pointer-import"){const{value:r}=e;return{value:r,sideExports:[]}}if(e.type==="plus-file"){const r=n(),{exportValues:o}=e;a(!r.definedBy),In(o,r.filePathToShowToUser,t);let s,i=!1;const l=[];return Object.entries(o).forEach(([c,u])=>{c!=="default"&&c!==t?l.push({configName:c,configValue:{type:"standard",value:u,definedAtData:{filePathToShowToUser:r.filePathToShowToUser,fileExportPathToShowToUser:[c]}}}):(s=u,a(!i),i=!0)}),a(i),{value:s,sideExports:l}}a(!1)}function He(e,t,n){a(e,typeof e),t(e)||a(!1,{moduleExports:e,moduleExportsKeys:Wn(e),moduleId:n})}function Wn(e){return[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e),...Object.keys(e)]}function Fn(e){He(e,l=>"pageFilesLazy"in l),a(y(e,"pageFilesLazy","object")),a(y(e,"pageFilesEager","object")),a(y(e,"pageFilesExportNamesLazy","object")),a(y(e,"pageFilesExportNamesEager","object")),a(y(e.pageFilesLazy,".page")),a(y(e.pageFilesLazy,".page.client")||y(e.pageFilesLazy,".page.server")),a(y(e,"pageFilesList","string[]")),a(y(e,"pageConfigsSerialized")),a(y(e,"pageConfigGlobalSerialized"));const{pageConfigsSerialized:t,pageConfigGlobalSerialized:n}=e;Ln(t),Dn(n);const{pageConfigs:r,pageConfigGlobal:o}=jn(t,n),s={};A(e.pageFilesLazy).forEach(({filePath:l,pageFile:c,globValue:u})=>{c=s[l]=s[l]??c;const f=u;ce(f),c.loadFile=async()=>{"fileExports"in c||(c.fileExports=await f(),bn(c))}}),A(e.pageFilesExportNamesLazy).forEach(({filePath:l,pageFile:c,globValue:u})=>{c=s[l]=s[l]??c;const f=u;ce(f),c.loadExportNames=async()=>{if(!("exportNames"in c)){const h=await f();a(y(h,"exportNames","string[]"),c.filePath),c.exportNames=h.exportNames}}}),A(e.pageFilesEager).forEach(({filePath:l,pageFile:c,globValue:u})=>{c=s[l]=s[l]??c;const f=u;a(x(f)),c.fileExports=f}),A(e.pageFilesExportNamesEager).forEach(({filePath:l,pageFile:c,globValue:u})=>{c=s[l]=s[l]??c;const f=u;a(x(f)),a(y(f,"exportNames","string[]"),c.filePath),c.exportNames=f.exportNames}),e.pageFilesList.forEach(l=>{s[l]=s[l]??Ve(l)});const i=Object.values(s);return i.forEach(({filePath:l})=>{a(!l.includes("\\"))}),{pageFilesAll:i,pageConfigs:r,pageConfigGlobal:o}}function A(e){const t=[];return Object.entries(e).forEach(([n,r])=>{a(On.includes(n)),a(x(r)),Object.entries(r).forEach(([o,s])=>{const i=Ve(o);a(i.fileType===n),t.push({filePath:o,pageFile:i,globValue:s})})}),t}function ce(e){a(V(e))}function Ln(e){a(k(e)),e.forEach(t=>{a(x(t)),a(y(t,"pageId","string")),a(y(t,"routeFilesystem")),a(y(t,"configValuesSerialized"))})}function Dn(e){a(y(e,"configValuesSerialized"))}function Pr(e){return(t,n)=>{const r=e(t),o=e(n);return r===o?0:r>o?-1:1}}function Cr(e){return(t,n)=>{const r=e(t),o=e(n);return r===o?0:r<o?-1:1}}function Vn(e){return(t,n)=>{const r=e(t),o=e(n);if(a([!0,!1,null].includes(r)),a([!0,!1,null].includes(o)),r===o)return 0;if(r===!0||o===!1)return-1;if(o===!0||r===!1)return 1;a(!1)}}function Hn(e){return Vn(t=>{const n=e(t);return n===null?null:!n})}function zn(e,t,n){const r=Be({pageConfigGlobalValues:e,pageConfigValues:n}),o=ze(r),s=(()=>
2{if(t.isErrorPage)return{...o,isErrorPage:!0};{const i=o.config.route??t.routeFilesystem.routeString;return{...o,route:i}}})();return[t.pageId,s]}function ze(e){return{config:e.config,_source:e.source,_sources:e.sources,_from:e.from}}function Be({pageConfigGlobalValues:e,pageConfigValues:t}){const n={...e,...t};return Ue({configValues:n})}function Bn(e,t,n){const r={},o={},s={};e.forEach(g=>{Mn(g).forEach(({exportName:d,exportValue:C,isFromDefaultExport:P})=>{a(d!=="default"),s[d]=s[d]??[],s[d].push({exportValue:C,exportSource:`${g.filePath} > ${P?`\`export default { ${d} }\``:`\`export { ${d} }\``}`,filePath:g.filePath,_filePath:g.filePath,_fileType:g.fileType,_isFromDefaultExport:P})})});let i,l,c;if(t){const g=Be({pageConfigGlobalValues:n.configValues,pageConfigValues:t.configValues});i=g.source,l=g.sources,c=g.from,Object.assign(r,g.config),Object.assign(o,g.configEntries),Object.assign(s,g.exportsAll)}else i={},l={},c={configsStandard:{},configsCumulative:{},configsComputed:{}};const u={},f={};Object.entries(s).forEach(([g,p])=>{p.forEach(({exportValue:d,_fileType:C,_isFromDefaultExport:P})=>{f[g]=f[g]??d,C===".page"&&!P&&(g in u||(u[g]=d))})}),a(!("default"in f)),a(!("default"in s));const h={config:r,from:c,source:i,sources:l,configEntries:o,exports:f,exportsAll:s};return dn(h,"pageExports",{get:()=>(D()||O(!1,"pageContext.pageExports is outdated, use pageContext.exports instead",{onlyOnce:!0,showStackTrace:!0}),u),enumerable:!1,configurable:!0}),h}function Un(e,t){return Gn(e,t,r=>r.configValues)}function Gn(e,t,n){const r=n(t,!0),o=Ue({configValues:r}),s=ze(o),i=Object.fromEntries(e.map(c=>{const u=n(c);return zn(r,c,u)})),l={...s,pages:i};return{...l,_globalConfigPublic:l}}function Ue(e){const t={},n={},r={},o={},s={},i={configsStandard:{},configsCumulative:{},configsComputed:{}},l=(u,f)=>{o[f]=u,s[f]??(s[f]=[]),s[f].push(u)},c=(u,f,h)=>{const g=ke(h),p=Ut("Config",u,h);n[u]=n[u]??[],n[u].push({configValue:f,configDefinedAt:p,configDefinedByFile:g});const d=u;r[d]=r[d]??[],r[d].push({exportValue:f,exportSource:p,filePath:g,_filePath:g,_fileType:null,_isFromDefaultExport:null})};return Object.entries(e.configValues).forEach(([u,f])=>{const{value:h}=f;if(t[u]=t[u]??h,f.type==="standard"){const g={type:"configsStandard",value:f.value,definedAt:R(f.definedAtData,u)};l(g,u),i.configsStandard[u]=g,c(u,h,f.definedAtData)}if(f.type==="cumulative"){const g={type:"configsCumulative",definedAt:R(f.definedAtData,u),values:f.value.map((p,d)=>{const C=f.definedAtData[d];a(C);const P=R(C,u);return c(u,p,C),{value:p,definedAt:P}})};l(g,u),i.configsCumulative[u]=g}if(f.type==="computed"){const g={type:"configsComputed",definedAt:"Vike",value:f.value};l(g,u),i.configsComputed[u]=g,c(u,h,f.definedAtData)}}),{config:t,configEntries:n,exportsAll:r,source:o,sources:s,from:i}}function Mn(e){const{filePath:t,fileExports:n}=e;a(n),a(De(t));const r=[];return Object.entries(n).sort(Hn(([o])=>o==="default")).forEach(([o,s])=>{let i=o==="default";if(i)if(vn(t))o="Page";else{m(x(s),`The ${b.cyan("export default")} of ${t} should be an object.`),Object.entries(s).forEach(([l,c])=>{mn(l,t),r.push({exportName:l,exportValue:c,isFromDefaultExport:i})});return}r.push({exportName:o,exportValue:s,isFromDefaultExport:i})}),r.forEach(({exportName:o,isFromDefaultExport:s})=>{a(!(s&&Fe.includes(o)))}),r}async function Nn(e,t,n,r,o){const{previousCreateGlobalContextPromise:s}=t,{promise:i,resolve:l}=Ee({timeout:null});t.previousCreateGlobalContextPromise=i,s&&(a(t.globalContext),await s);try{const c=Jn(e);let u;if(t.globalContext?u=!0:(t.globalContext=c,u=!1),n&&c._pageConfigs.length>0){const g=n?.(c);w(c,g)}else{const g=await r?.(c);w(c,g)}{const g=await o?.(c);w(c,g)}const f=Oe(c._pageConfigGlobal,"onCreateGlobalContext");let h=!1;return Kn(t.onCreateGlobalContextHooks??[],f)||(t.onCreateGlobalContextHooks=f,await an("onCreateGlobalContext",c,Re),h=!0),u&&(h?hn(t.globalContext,c):w(t.globalContext,c,!0)),t.globalContext}finally{l()}}function Jn(e){const{pageFilesAll:t,pageConfigs:n,pageConfigGlobal:r}=Fn(e),o=Yn(t,n),s=Un(n,r),i={isGlobalContext:!0,_isOriginalObject:!0,_virtualFileExportsGlobalEntry:e,_pageFilesAll:t,_pageConfigs:n,_pageConfigGlobal:r,_allPageIds:o,...s};return We(i,"_isOriginalObject",!1),i}function Yn(e,t){const n=e.filter(({isDefaultPageFile:s})=>!s).map(({pageId:s})=>s),r=N(n),o=t.map(s=>s.pageId);return[...r,...o]}function Kn(e,t){const n=e.map(o=>o.hookFn),r=t.map(o=>o.hookFn);return n.every(o=>r.includes(o))&&r.every(o=>n.includes(o))}const S=T("getGlobalContextClientInternalShared.ts",(()=>{const{promise:e,resolve:t}=Ee();return{globalContextInitialPromise:e,globalContextInitialPromiseResolve:t}})());async function qn(){if(S.globalContextPromise)return await S.globalContextPromise;const e=Nn(S.virtualFileExportsGlobalEntry,S,()=>{const n={isClientSide:!0};return w(n,Ft()),n});S.globalContextPromise=e;const t=await e;return a(S.globalContext===t),S.globalContextInitialPromiseResolve(),t}async function Er(e){S.virtualFileExportsGlobalEntry!==e&&(delete S.globalContextPromise,S.virtualFileExportsGlobalEntry=e,await qn())}const F=T("utils/assertRouterType.ts",{});function xr(){Ge(Xn()),F.isClientRouting=!0}function Xn(){return F.isClientRouting!==!1}
2function Sr(){Ge(F.isClientRouting!==!0),F.isClientRouting=!1}function Ge(e){m(D(),`${b.cyan("import { something } from 'vike/client/router'")} is forbidden on the server-side`,{showStackTrace:!0}),O(e,"You shouldn't `import { something } from 'vike/client/router'` when using Server Routing. The 'vike/client/router' utilities work only with Client Routing. In particular, don't `import { navigate }` nor `import { prefetch }` as they unnecessarily bloat your client-side bundle sizes.",{showStackTrace:!0,onlyOnce:!0})}function Zn(e,t){const n=e.filter(o=>o.pageId===t);return a(n.length<=1),n[0]??null}async function Qn(e,t){if("isPageEntryLoaded"in e)return e;const{moduleId:n,moduleExportsPromise:r}=e.loadVirtualFilePageEntry(),o=await r;He(o,()=>"configValuesSerialized"in o,n);const s=o;let i;try{i=ue(s)}catch(l){if(!(l instanceof ReferenceError))throw l;await new Promise(c=>setTimeout(c)),i=ue(s)}return Object.assign(e.configValues,i),w(e,{isPageEntryLoaded:!0}),e}function ue(e){return M(e.configValuesSerialized)}const Me="_isAssetsError";async function wr(e,t,n,r){const o=Vt(t,e),s=Zn(n,e);let i;try{i=(await Promise.all([s&&Qn(s,!1),...o.map(u=>u.loadFile?.())]))[0]}catch(c){throw er(c)&&Object.assign(c,{[Me]:!0}),c}const l={};return w(l,Bn(o,i,r)),w(l,{_pageFilesLoaded:o}),l}function kr(e){return e?e[Me]===!0:!1}function er(e){return e instanceof Error?["Failed to fetch dynamically imported module","error loading dynamically imported module","Importing a module script failed","error resolving module specifier","failed to resolve module"].some(n=>e.message.toLowerCase().includes(n.toLowerCase())):!1}async function vr(e,t){let n=null;n=se(e,"render");{const r=se(e,"onRenderClient");r&&(n=r)}if(!n){const r=tr(e);if(a(r),e._globalContext._pageConfigs.length>0)m(!1,`No onRenderClient() hook defined for URL '${r}', but it's needed, see https://vike.dev/onRenderClient`);else{const o=e._pageFilesLoaded.filter(i=>i.fileType===".page.client");let s;o.length===0?s="No file `*.page.client.*` found for URL "+r:s="One of the following files should export a render() hook: "+o.map(i=>i.filePath).join(" "),m(!1,s)}}await ln(n,e,t)}function tr(e){let t;try{t=e.urlPathname??e.urlOriginal}catch{}return t=t??window.location.href,t}export{or as $,sn as A,dn as B,D as C,We as D,Pr as E,W as F,hr as G,on as H,gr as I,R as J,k as K,X as L,qn as M,br as N,lr as O,mr as P,Ct as Q,sr as R,Ot as S,Vt as T,Zn as U,Vn as V,Cr as W,ir as X,wr as Y,kr as Z,ar as _,m as a,Ee as a0,Nt as a1,Ie as a2,un as a3,vr as a4,yr as a5,Er as a6,rr as a7,Sr as a8,nr as a9,Pe as b,xr as c,O as d,a as e,b as f,ur as g,z as h,xt as i,Ut as j,x as k,se as l,ln as m,_e as n,V as o,gt as p,y as q,w as r,pr as s,T as t,N as u,xe as v,lt as w,fr as x,cr as y,dr as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.