import process from 'node:process';globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};import { defineComponent, shallowRef, h, resolveComponent, hasInjectionContext, inject, computed, getCurrentInstance, createElementBlock, provide, cloneVNode, ref, Suspense, Fragment, createApp, shallowReactive, mergeProps, withCtx, createVNode, createTextVNode, unref, toDisplayString, toRef, onErrorCaptured, onServerPrefetch, resolveDynamicComponent, reactive, effectScope, isReadonly, isRef, isShallow, isReactive, toRaw, defineAsyncComponent, getCurrentScope, useSSRContext } from 'vue'; import { p as parseQuery, c as createError$1, o as hasProtocol, q as isScriptProtocol, m as joinURL, w as withQuery, t as sanitizeStatusCode, v as withTrailingSlash, x as withoutTrailingSlash, y as getContext, $ as $fetch$1, z as createHooks, A as executeAsync, B as toRouteMatcher, C as createRouter$1, D as defu } from '../nitro/nitro.mjs'; import { b as baseURL } from '../routes/renderer.mjs'; import { defineStore, createPinia, setActivePinia, shouldHydrate } from 'pinia'; import { RouterView, useRoute as useRoute$1, useRouter as useRouter$1, createMemoryHistory, createRouter, START_LOCATION } from 'vue-router'; import { ssrRenderAttrs, ssrRenderComponent, ssrRenderAttr, ssrRenderStyle, ssrRenderClass, ssrRenderList, ssrInterpolate, ssrRenderSuspense, ssrRenderVNode } from 'vue/server-renderer'; import { ChevronDown, X, Menu, User, ChevronUp } from 'lucide-vue-next'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'node:url'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; if (!globalThis.$fetch) { globalThis.$fetch = $fetch$1.create({ baseURL: baseURL() }); } if (!("global" in globalThis)) { globalThis.global = globalThis; } const nuxtLinkDefaults = { "componentName": "NuxtLink" }; const asyncDataDefaults = { "deep": false }; const fetchDefaults = {}; const appId = "nuxt-app"; function getNuxtAppCtx(id = appId) { return getContext(id, { asyncContext: false }); } const NuxtPluginIndicator = "__nuxt_plugin"; function createNuxtApp(options) { let hydratingCount = 0; const nuxtApp = { _id: options.id || appId || "nuxt-app", _scope: effectScope(), provide: void 0, versions: { get nuxt() { return "4.1.3"; }, get vue() { return nuxtApp.vueApp.version; } }, payload: shallowReactive({ ...options.ssrContext?.payload || {}, data: shallowReactive({}), state: reactive({}), once: /* @__PURE__ */ new Set(), _errors: shallowReactive({}) }), static: { data: {} }, runWithContext(fn) { if (nuxtApp._scope.active && !getCurrentScope()) { return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn)); } return callWithNuxt(nuxtApp, fn); }, isHydrating: false, deferHydration() { if (!nuxtApp.isHydrating) { return () => { }; } hydratingCount++; let called = false; return () => { if (called) { return; } called = true; hydratingCount--; if (hydratingCount === 0) { nuxtApp.isHydrating = false; return nuxtApp.callHook("app:suspense:resolve"); } }; }, _asyncDataPromises: {}, _asyncData: shallowReactive({}), _payloadRevivers: {}, ...options }; { nuxtApp.payload.serverRendered = true; } if (nuxtApp.ssrContext) { nuxtApp.payload.path = nuxtApp.ssrContext.url; nuxtApp.ssrContext.nuxt = nuxtApp; nuxtApp.ssrContext.payload = nuxtApp.payload; nuxtApp.ssrContext.config = { public: nuxtApp.ssrContext.runtimeConfig.public, app: nuxtApp.ssrContext.runtimeConfig.app }; } nuxtApp.hooks = createHooks(); nuxtApp.hook = nuxtApp.hooks.hook; { const contextCaller = async function(hooks, args) { for (const hook of hooks) { await nuxtApp.runWithContext(() => hook(...args)); } }; nuxtApp.hooks.callHook = (name, ...args) => nuxtApp.hooks.callHookWith(contextCaller, name, ...args); } nuxtApp.callHook = nuxtApp.hooks.callHook; nuxtApp.provide = (name, value) => { const $name = "$" + name; defineGetter(nuxtApp, $name, value); defineGetter(nuxtApp.vueApp.config.globalProperties, $name, value); }; defineGetter(nuxtApp.vueApp, "$nuxt", nuxtApp); defineGetter(nuxtApp.vueApp.config.globalProperties, "$nuxt", nuxtApp); const runtimeConfig = options.ssrContext.runtimeConfig; nuxtApp.provide("config", runtimeConfig); return nuxtApp; } function registerPluginHooks(nuxtApp, plugin2) { if (plugin2.hooks) { nuxtApp.hooks.addHooks(plugin2.hooks); } } async function applyPlugin(nuxtApp, plugin2) { if (typeof plugin2 === "function") { const { provide: provide2 } = await nuxtApp.runWithContext(() => plugin2(nuxtApp)) || {}; if (provide2 && typeof provide2 === "object") { for (const key in provide2) { nuxtApp.provide(key, provide2[key]); } } } } async function applyPlugins(nuxtApp, plugins2) { const resolvedPlugins = /* @__PURE__ */ new Set(); const unresolvedPlugins = []; const parallels = []; let error = void 0; let promiseDepth = 0; async function executePlugin(plugin2) { const unresolvedPluginsForThisPlugin = plugin2.dependsOn?.filter((name) => plugins2.some((p) => p._name === name) && !resolvedPlugins.has(name)) ?? []; if (unresolvedPluginsForThisPlugin.length > 0) { unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin2]); } else { const promise = applyPlugin(nuxtApp, plugin2).then(async () => { if (plugin2._name) { resolvedPlugins.add(plugin2._name); await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => { if (dependsOn.has(plugin2._name)) { dependsOn.delete(plugin2._name); if (dependsOn.size === 0) { promiseDepth++; await executePlugin(unexecutedPlugin); } } })); } }).catch((e) => { if (!plugin2.parallel && !nuxtApp.payload.error) { throw e; } error ||= e; }); if (plugin2.parallel) { parallels.push(promise); } else { await promise; } } } for (const plugin2 of plugins2) { if (nuxtApp.ssrContext?.islandContext && plugin2.env?.islands === false) { continue; } registerPluginHooks(nuxtApp, plugin2); } for (const plugin2 of plugins2) { if (nuxtApp.ssrContext?.islandContext && plugin2.env?.islands === false) { continue; } await executePlugin(plugin2); } await Promise.all(parallels); if (promiseDepth) { for (let i = 0; i < promiseDepth; i++) { await Promise.all(parallels); } } if (error) { throw nuxtApp.payload.error || error; } } // @__NO_SIDE_EFFECTS__ function defineNuxtPlugin(plugin2) { if (typeof plugin2 === "function") { return plugin2; } const _name = plugin2._name || plugin2.name; delete plugin2.name; return Object.assign(plugin2.setup || (() => { }), plugin2, { [NuxtPluginIndicator]: true, _name }); } const definePayloadPlugin = defineNuxtPlugin; function callWithNuxt(nuxt, setup, args) { const fn = () => setup(); const nuxtAppCtx = getNuxtAppCtx(nuxt._id); { return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn)); } } function tryUseNuxtApp(id) { let nuxtAppInstance; if (hasInjectionContext()) { nuxtAppInstance = getCurrentInstance()?.appContext.app.$nuxt; } nuxtAppInstance ||= getNuxtAppCtx(id).tryUse(); return nuxtAppInstance || null; } function useNuxtApp(id) { const nuxtAppInstance = tryUseNuxtApp(id); if (!nuxtAppInstance) { { throw new Error("[nuxt] instance unavailable"); } } return nuxtAppInstance; } // @__NO_SIDE_EFFECTS__ function useRuntimeConfig(_event) { return useNuxtApp().$config; } function defineGetter(obj, key, val) { Object.defineProperty(obj, key, { get: () => val }); } const LayoutMetaSymbol = Symbol("layout-meta"); const PageRouteSymbol = Symbol("route"); globalThis._importMeta_.url.replace(/\/app\/.*$/, "/"); const useRouter = () => { return useNuxtApp()?.$router; }; const useRoute = () => { if (hasInjectionContext()) { return inject(PageRouteSymbol, useNuxtApp()._route); } return useNuxtApp()._route; }; // @__NO_SIDE_EFFECTS__ function defineNuxtRouteMiddleware(middleware) { return middleware; } const isProcessingMiddleware = () => { try { if (useNuxtApp()._processingMiddleware) { return true; } } catch { return false; } return false; }; const URL_QUOTE_RE = /"/g; const navigateTo = (to, options) => { to ||= "/"; const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter().resolve(to).href; const isExternalHost = hasProtocol(toPath, { acceptRelative: true }); const isExternal = options?.external || isExternalHost; if (isExternal) { if (!options?.external) { throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`."); } const { protocol } = new URL(toPath, "http://localhost"); if (protocol && isScriptProtocol(protocol)) { throw new Error(`Cannot navigate to a URL with '${protocol}' protocol.`); } } const inMiddleware = isProcessingMiddleware(); const router = useRouter(); const nuxtApp = useNuxtApp(); { if (nuxtApp.ssrContext) { const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).fullPath || "/"; const location2 = isExternal ? toPath : joinURL((/* @__PURE__ */ useRuntimeConfig()).app.baseURL, fullPath); const redirect = async function(response) { await nuxtApp.callHook("app:redirected"); const encodedLoc = location2.replace(URL_QUOTE_RE, "%22"); const encodedHeader = encodeURL(location2, isExternalHost); nuxtApp.ssrContext._renderResponse = { statusCode: sanitizeStatusCode(options?.redirectCode || 302, 302), body: `
`, headers: { location: encodedHeader } }; return response; }; if (!isExternal && inMiddleware) { router.afterEach((final) => final.fullPath === fullPath ? redirect(false) : void 0); return to; } return redirect(!inMiddleware ? void 0 : ( /* abort route navigation */ false )); } } if (isExternal) { nuxtApp._scope.stop(); if (options?.replace) { (void 0).replace(toPath); } else { (void 0).href = toPath; } if (inMiddleware) { if (!nuxtApp.isHydrating) { return false; } return new Promise(() => { }); } return Promise.resolve(); } return options?.replace ? router.replace(to) : router.push(to); }; function resolveRouteObject(to) { return withQuery(to.path || "", to.query || {}) + (to.hash || ""); } function encodeURL(location2, isExternalHost = false) { const url = new URL(location2, "http://localhost"); if (!isExternalHost) { return url.pathname + url.search + url.hash; } if (location2.startsWith("//")) { return url.toString().replace(url.protocol, ""); } return url.toString(); } const NUXT_ERROR_SIGNATURE = "__nuxt_error"; const useError = /* @__NO_SIDE_EFFECTS__ */ () => toRef(useNuxtApp().payload, "error"); const showError = (error) => { const nuxtError = createError(error); try { const error2 = /* @__PURE__ */ useError(); if (false) ; error2.value ||= nuxtError; } catch { throw nuxtError; } return nuxtError; }; const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error; const createError = (error) => { const nuxtError = createError$1(error); Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, { value: true, configurable: false, writable: false }); return nuxtError; }; async function getRouteRules(arg) { const path = typeof arg === "string" ? arg : arg.path; { useNuxtApp().ssrContext._preloadManifest = true; const _routeRulesMatcher = toRouteMatcher( createRouter$1({ routes: (/* @__PURE__ */ useRuntimeConfig()).nitro.routeRules }) ); return defu({}, ..._routeRulesMatcher.matchAll(path).reverse()); } } function definePayloadReducer(name, reduce) { { useNuxtApp().ssrContext._payloadReducers[name] = reduce; } } const payloadPlugin = definePayloadPlugin(() => { definePayloadReducer( "skipHydrate", // We need to return something truthy to be treated as a match (data) => !shouldHydrate(data) && 1 ); }); const unhead_k2P3m_ZDyjlr2mMYnoDPwavjsDN8hBlk9cFai0bbopU = /* @__PURE__ */ defineNuxtPlugin({ name: "nuxt:head", enforce: "pre", setup(nuxtApp) { const head = nuxtApp.ssrContext.head; nuxtApp.vueApp.use(head); } }); function toArray(value) { return Array.isArray(value) ? value : [value]; } const __nuxt_page_meta$6 = { layout: "default" }; const __nuxt_page_meta$5 = { layout: "default" }; const __nuxt_page_meta$4 = { layout: "default" }; const __nuxt_page_meta$3 = { layout: "default" }; const __nuxt_page_meta$2 = { layout: "default" }; const __nuxt_page_meta$1 = { layout: "default" }; const __nuxt_page_meta = { layout: "default" }; const _routes = [ { name: "index", path: "/", component: () => import('./index-DkhqlVRY.mjs') }, { name: "login", path: "/login", meta: __nuxt_page_meta$6 || {}, component: () => import('./login-BdWGyHdA.mjs') }, { name: "anlagen", path: "/anlagen", component: () => import('./anlagen-tpcA4Hv2.mjs') }, { name: "galerie", path: "/galerie", component: () => import('./galerie-CoMmWwEg.mjs') }, { name: "kontakt", path: "/kontakt", component: () => import('./kontakt-DXDMYVtx.mjs') }, { name: "satzung", path: "/satzung", component: () => import('./satzung-FqIDL6FT.mjs') }, { name: "termine", path: "/termine", component: () => import('./termine-ZiVCG4zJ.mjs') }, { name: "vorstand", path: "/vorstand", component: () => import('./vorstand-CFLwDNhn.mjs') }, { name: "cms", path: "/cms", meta: { ...__nuxt_page_meta$5 || {}, ...{ "middleware": "auth" } }, component: () => import('./index-D8nn7-Uy.mjs') }, { name: "impressum", path: "/impressum", component: () => import('./impressum-BJL_VXpe.mjs') }, { name: "tt-regeln", path: "/tt-regeln", component: () => import('./tt-regeln-DyKJvBml.mjs') }, { name: "ueber-uns", path: "/ueber-uns", component: () => import('./ueber-uns-pGQi6hRz.mjs') }, { name: "geschichte", path: "/geschichte", component: () => import('./geschichte-DSCikZtf.mjs') }, { name: "cms-termine", path: "/cms/termine", meta: { ...__nuxt_page_meta$4 || {}, ...{ "middleware": "auth" } }, component: () => import('./termine-TZyY9Wk0.mjs') }, { name: "cms-benutzer", path: "/cms/benutzer", meta: { "middleware": "auth" }, component: () => import('./benutzer-CEqkQsLi.mjs') }, { name: "registrieren", path: "/registrieren", component: () => import('./registrieren-DS8LMhBE.mjs') }, { name: "spielsysteme", path: "/spielsysteme", component: () => import('./spielsysteme-CdvH6qFp.mjs') }, { name: "mitgliedschaft", path: "/mitgliedschaft", component: () => import('./mitgliedschaft-ItL-1heT.mjs') }, { name: "training", path: "/training", component: () => import('./index-Dnh6tx7H.mjs') }, { name: "training-trainer", path: "/training/trainer", component: () => import('./trainer-CcVTsygv.mjs') }, { name: "mannschaften-damen", path: "/mannschaften/damen", component: () => import('./damen-DuM0biIS.mjs') }, { name: "mannschaften", path: "/mannschaften", component: () => import('./index-DUWe6TYg.mjs') }, { name: "passwort-vergessen", path: "/passwort-vergessen", component: () => import('./passwort-vergessen-D8jfiCTL.mjs') }, { name: "training-anfaenger", path: "/training/anfaenger", component: () => import('./anfaenger-Cj28UOue.mjs') }, { name: "mannschaften-slug", path: "/mannschaften/:slug()", component: () => import('./_slug_-CcxmD4wa.mjs') }, { name: "mannschaften-herren", path: "/mannschaften/herren", component: () => import('./herren-Cfh4Z8oD.mjs') }, { name: "mannschaften-jugend", path: "/mannschaften/jugend", component: () => import('./jugend-CDQZwKSx.mjs') }, { name: "mitgliederbereich-news", path: "/mitgliederbereich/news", meta: { ...__nuxt_page_meta$3 || {}, ...{ "middleware": "auth" } }, component: () => import('./news-C8krCg9b.mjs') }, { name: "vereinsmeisterschaften", path: "/vereinsmeisterschaften", component: () => import('./vereinsmeisterschaften-B9yng3Zq.mjs') }, { name: "mitgliederbereich", path: "/mitgliederbereich", meta: { ...__nuxt_page_meta$2 || {}, ...{ "middleware": "auth" } }, component: () => import('./index-D7JtbHaf.mjs') }, { name: "mannschaften-spielplaene", path: "/mannschaften/spielplaene", component: () => import('./spielplaene-DVdlC_Hk.mjs') }, { name: "mitgliederbereich-profil", path: "/mitgliederbereich/profil", meta: { ...__nuxt_page_meta$1 || {}, ...{ "middleware": "auth" } }, component: () => import('./profil-UUfhNGZ3.mjs') }, { name: "mitgliederbereich-mitglieder", path: "/mitgliederbereich/mitglieder", meta: { ...__nuxt_page_meta || {}, ...{ "middleware": "auth" } }, component: () => import('./mitglieder-DAbmufxC.mjs') } ]; const ROUTE_KEY_PARENTHESES_RE = /(:\w+)\([^)]+\)/g; const ROUTE_KEY_SYMBOLS_RE = /(:\w+)[?+*]/g; const ROUTE_KEY_NORMAL_RE = /:\w+/g; function generateRouteKey(route) { const source = route?.meta.key ?? route.path.replace(ROUTE_KEY_PARENTHESES_RE, "$1").replace(ROUTE_KEY_SYMBOLS_RE, "$1").replace(ROUTE_KEY_NORMAL_RE, (r) => route.params[r.slice(1)]?.toString() || ""); return typeof source === "function" ? source(route) : source; } function isChangingPage(to, from) { if (to === from || from === START_LOCATION) { return false; } if (generateRouteKey(to) !== generateRouteKey(from)) { return true; } const areComponentsSame = to.matched.every( (comp, index) => comp.components && comp.components.default === from.matched[index]?.components?.default ); if (areComponentsSame) { return false; } return true; } const routerOptions0 = { scrollBehavior(to, from, savedPosition) { const nuxtApp = useNuxtApp(); const hashScrollBehaviour = useRouter().options?.scrollBehaviorType ?? "auto"; if (to.path.replace(/\/$/, "") === from.path.replace(/\/$/, "")) { if (from.hash && !to.hash) { return { left: 0, top: 0 }; } if (to.hash) { return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior: hashScrollBehaviour }; } return false; } const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop; if (routeAllowsScrollToTop === false) { return false; } const hookToWait = nuxtApp._runningTransition ? "page:transition:finish" : "page:loading:end"; return new Promise((resolve) => { if (from === START_LOCATION) { resolve(_calculatePosition(to, from, savedPosition, hashScrollBehaviour)); return; } nuxtApp.hooks.hookOnce(hookToWait, () => { requestAnimationFrame(() => resolve(_calculatePosition(to, from, savedPosition, hashScrollBehaviour))); }); }); } }; function _getHashElementScrollMarginTop(selector) { try { const elem = (void 0).querySelector(selector); if (elem) { return (Number.parseFloat(getComputedStyle(elem).scrollMarginTop) || 0) + (Number.parseFloat(getComputedStyle((void 0).documentElement).scrollPaddingTop) || 0); } } catch { } return 0; } function _calculatePosition(to, from, savedPosition, defaultHashScrollBehaviour) { if (savedPosition) { return savedPosition; } const isPageNavigation = isChangingPage(to, from); if (to.hash) { return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior: isPageNavigation ? defaultHashScrollBehaviour : "instant" }; } return { left: 0, top: 0 }; } const configRouterOptions = { hashMode: false, scrollBehaviorType: "auto" }; const routerOptions = { ...configRouterOptions, ...routerOptions0 }; const validate = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to, from) => { let __temp, __restore; if (!to.meta?.validate) { return; } const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp); if (result === true) { return; } const error = createError({ fatal: false, statusCode: result && result.statusCode || 404, statusMessage: result && result.statusMessage || `Page Not Found: ${to.fullPath}`, data: { path: to.fullPath } }); return error; }); const useAuthStore = defineStore("auth", { state: () => ({ isLoggedIn: false, user: null, role: null }), getters: { isAdmin: (state) => { return state.role === "admin" || state.role === "vorstand"; } }, actions: { async checkAuth() { try { const response = await $fetch("/api/auth/status"); this.isLoggedIn = response.isLoggedIn; this.user = response.user; this.role = response.role; return response; } catch (error) { this.isLoggedIn = false; this.user = null; this.role = null; return { isLoggedIn: false }; } }, async login(email, password) { const response = await $fetch("/api/auth/login", { method: "POST", body: { email, password } }); if (response.success) { await this.checkAuth(); } return response; }, async logout() { try { await $fetch("/api/auth/logout", { method: "POST" }); this.isLoggedIn = false; this.user = null; this.role = null; } catch (error) { console.error("Logout fehlgeschlagen:", error); throw error; } } } }); const auth_45global = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to, from) => { return; }); const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => { { return; } }); const globalMiddleware = [ validate, auth_45global, manifest_45route_45rule ]; const namedMiddleware = { auth: () => import('./auth-DIPdM0XJ.mjs') }; const plugin$1 = /* @__PURE__ */ defineNuxtPlugin({ name: "nuxt:router", enforce: "pre", async setup(nuxtApp) { let __temp, __restore; let routerBase = (/* @__PURE__ */ useRuntimeConfig()).app.baseURL; const history = routerOptions.history?.(routerBase) ?? createMemoryHistory(routerBase); const routes = routerOptions.routes ? ([__temp, __restore] = executeAsync(() => routerOptions.routes(_routes)), __temp = await __temp, __restore(), __temp) ?? _routes : _routes; let startPosition; const router = createRouter({ ...routerOptions, scrollBehavior: (to, from, savedPosition) => { if (from === START_LOCATION) { startPosition = savedPosition; return; } if (routerOptions.scrollBehavior) { router.options.scrollBehavior = routerOptions.scrollBehavior; if ("scrollRestoration" in (void 0).history) { const unsub = router.beforeEach(() => { unsub(); (void 0).history.scrollRestoration = "manual"; }); } return routerOptions.scrollBehavior(to, START_LOCATION, startPosition || savedPosition); } }, history, routes }); nuxtApp.vueApp.use(router); const previousRoute = shallowRef(router.currentRoute.value); router.afterEach((_to, from) => { previousRoute.value = from; }); Object.defineProperty(nuxtApp.vueApp.config.globalProperties, "previousRoute", { get: () => previousRoute.value }); const initialURL = nuxtApp.ssrContext.url; const _route = shallowRef(router.currentRoute.value); const syncCurrentRoute = () => { _route.value = router.currentRoute.value; }; nuxtApp.hook("page:finish", syncCurrentRoute); router.afterEach((to, from) => { if (to.matched[to.matched.length - 1]?.components?.default === from.matched[from.matched.length - 1]?.components?.default) { syncCurrentRoute(); } }); const route = {}; for (const key in _route.value) { Object.defineProperty(route, key, { get: () => _route.value[key], enumerable: true }); } nuxtApp._route = shallowReactive(route); nuxtApp._middleware ||= { global: [], named: {} }; if (!nuxtApp.ssrContext?.islandContext) { router.afterEach(async (to, _from, failure) => { delete nuxtApp._processingMiddleware; if (failure) { await nuxtApp.callHook("page:loading:end"); } if (failure?.type === 4) { return; } if (to.redirectedFrom && to.fullPath !== initialURL) { await nuxtApp.runWithContext(() => navigateTo(to.fullPath || "/")); } }); } try { if (true) { ; [__temp, __restore] = executeAsync(() => router.push(initialURL)), await __temp, __restore(); ; } ; [__temp, __restore] = executeAsync(() => router.isReady()), await __temp, __restore(); ; } catch (error2) { [__temp, __restore] = executeAsync(() => nuxtApp.runWithContext(() => showError(error2))), await __temp, __restore(); } const resolvedInitialRoute = router.currentRoute.value; syncCurrentRoute(); if (nuxtApp.ssrContext?.islandContext) { return { provide: { router } }; } const initialLayout = nuxtApp.payload.state._layout; router.beforeEach(async (to, from) => { await nuxtApp.callHook("page:loading:start"); to.meta = reactive(to.meta); if (nuxtApp.isHydrating && initialLayout && !isReadonly(to.meta.layout)) { to.meta.layout = initialLayout; } nuxtApp._processingMiddleware = true; if (!nuxtApp.ssrContext?.islandContext) { const middlewareEntries = /* @__PURE__ */ new Set([...globalMiddleware, ...nuxtApp._middleware.global]); for (const component of to.matched) { const componentMiddleware = component.meta.middleware; if (!componentMiddleware) { continue; } for (const entry2 of toArray(componentMiddleware)) { middlewareEntries.add(entry2); } } { const routeRules = await nuxtApp.runWithContext(() => getRouteRules({ path: to.path })); if (routeRules.appMiddleware) { for (const key in routeRules.appMiddleware) { if (routeRules.appMiddleware[key]) { middlewareEntries.add(key); } else { middlewareEntries.delete(key); } } } } for (const entry2 of middlewareEntries) { const middleware = typeof entry2 === "string" ? nuxtApp._middleware.named[entry2] || await namedMiddleware[entry2]?.().then((r) => r.default || r) : entry2; if (!middleware) { throw new Error(`Unknown route middleware: '${entry2}'.`); } try { if (false) ; const result = await nuxtApp.runWithContext(() => middleware(to, from)); if (true) { if (result === false || result instanceof Error) { const error2 = result || createError({ statusCode: 404, statusMessage: `Page Not Found: ${initialURL}` }); await nuxtApp.runWithContext(() => showError(error2)); return false; } } if (result === true) { continue; } if (result === false) { return result; } if (result) { if (isNuxtError(result) && result.fatal) { await nuxtApp.runWithContext(() => showError(result)); } return result; } } catch (err) { const error2 = createError(err); if (error2.fatal) { await nuxtApp.runWithContext(() => showError(error2)); } return error2; } } } }); router.onError(async () => { delete nuxtApp._processingMiddleware; await nuxtApp.callHook("page:loading:end"); }); router.afterEach((to) => { if (to.matched.length === 0) { return nuxtApp.runWithContext(() => showError(createError({ statusCode: 404, fatal: false, statusMessage: `Page not found: ${to.fullPath}`, data: { path: to.fullPath } }))); } }); nuxtApp.hooks.hookOnce("app:created", async () => { try { if ("name" in resolvedInitialRoute) { resolvedInitialRoute.name = void 0; } await router.replace({ ...resolvedInitialRoute, force: true }); router.options.scrollBehavior = routerOptions.scrollBehavior; } catch (error2) { await nuxtApp.runWithContext(() => showError(error2)); } }); return { provide: { router } }; } }); const reducers = [ ["NuxtError", (data) => isNuxtError(data) && data.toJSON()], ["EmptyShallowRef", (data) => isRef(data) && isShallow(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")], ["EmptyRef", (data) => isRef(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")], ["ShallowRef", (data) => isRef(data) && isShallow(data) && data.value], ["ShallowReactive", (data) => isReactive(data) && isShallow(data) && toRaw(data)], ["Ref", (data) => isRef(data) && data.value], ["Reactive", (data) => isReactive(data) && toRaw(data)] ]; const revive_payload_server_MVtmlZaQpj6ApFmshWfUWl5PehCebzaBf2NuRMiIbms = /* @__PURE__ */ defineNuxtPlugin({ name: "nuxt:revive-payload:server", setup() { for (const [reducer, fn] of reducers) { definePayloadReducer(reducer, fn); } } }); defineComponent({ name: "ServerPlaceholder", render() { return createElementBlock("div"); } }); const clientOnlySymbol = Symbol.for("nuxt:client-only"); defineComponent({ name: "ClientOnly", inheritAttrs: false, props: ["fallback", "placeholder", "placeholderTag", "fallbackTag"], ...false, setup(props, { slots, attrs }) { const mounted = shallowRef(false); const vm = getCurrentInstance(); if (vm) { vm._nuxtClientOnly = true; } provide(clientOnlySymbol, true); return () => { if (mounted.value) { const vnodes = slots.default?.(); if (vnodes && vnodes.length === 1) { return [cloneVNode(vnodes[0], attrs)]; } return vnodes; } const slot = slots.fallback || slots.placeholder; if (slot) { return h(slot); } const fallbackStr = props.fallback || props.placeholder || ""; const fallbackTag = props.fallbackTag || props.placeholderTag || "span"; return createElementBlock(fallbackTag, attrs, fallbackStr); }; } }); const firstNonUndefined = (...args) => args.find((arg) => arg !== void 0); // @__NO_SIDE_EFFECTS__ function defineNuxtLink(options) { const componentName = options.componentName || "NuxtLink"; function isHashLinkWithoutHashMode(link) { return typeof link === "string" && link.startsWith("#"); } function resolveTrailingSlashBehavior(to, resolve, trailingSlash) { const effectiveTrailingSlash = trailingSlash ?? options.trailingSlash; if (!to || effectiveTrailingSlash !== "append" && effectiveTrailingSlash !== "remove") { return to; } if (typeof to === "string") { return applyTrailingSlashBehavior(to, effectiveTrailingSlash); } const path = "path" in to && to.path !== void 0 ? to.path : resolve(to).path; const resolvedPath = { ...to, name: void 0, // named routes would otherwise always override trailing slash behavior path: applyTrailingSlashBehavior(path, effectiveTrailingSlash) }; return resolvedPath; } function useNuxtLink(props) { const router = useRouter(); const config = /* @__PURE__ */ useRuntimeConfig(); const hasTarget = computed(() => !!props.target && props.target !== "_self"); const isAbsoluteUrl = computed(() => { const path = props.to || props.href || ""; return typeof path === "string" && hasProtocol(path, { acceptRelative: true }); }); const builtinRouterLink = resolveComponent("RouterLink"); const useBuiltinLink = builtinRouterLink && typeof builtinRouterLink !== "string" ? builtinRouterLink.useLink : void 0; const isExternal = computed(() => { if (props.external) { return true; } const path = props.to || props.href || ""; if (typeof path === "object") { return false; } return path === "" || isAbsoluteUrl.value; }); const to = computed(() => { const path = props.to || props.href || ""; if (isExternal.value) { return path; } return resolveTrailingSlashBehavior(path, router.resolve, props.trailingSlash); }); const link = isExternal.value ? void 0 : useBuiltinLink?.({ ...props, to }); const href = computed(() => { const effectiveTrailingSlash = props.trailingSlash ?? options.trailingSlash; if (!to.value || isAbsoluteUrl.value || isHashLinkWithoutHashMode(to.value)) { return to.value; } if (isExternal.value) { const path = typeof to.value === "object" && "path" in to.value ? resolveRouteObject(to.value) : to.value; const href2 = typeof path === "object" ? router.resolve(path).href : path; return applyTrailingSlashBehavior(href2, effectiveTrailingSlash); } if (typeof to.value === "object") { return router.resolve(to.value)?.href ?? null; } return applyTrailingSlashBehavior(joinURL(config.app.baseURL, to.value), effectiveTrailingSlash); }); return { to, hasTarget, isAbsoluteUrl, isExternal, // href, isActive: link?.isActive ?? computed(() => to.value === router.currentRoute.value.path), isExactActive: link?.isExactActive ?? computed(() => to.value === router.currentRoute.value.path), route: link?.route ?? computed(() => router.resolve(to.value)), async navigate(_e) { await navigateTo(href.value, { replace: props.replace, external: isExternal.value || hasTarget.value }); } }; } return defineComponent({ name: componentName, props: { // Routing to: { type: [String, Object], default: void 0, required: false }, href: { type: [String, Object], default: void 0, required: false }, // Attributes target: { type: String, default: void 0, required: false }, rel: { type: String, default: void 0, required: false }, noRel: { type: Boolean, default: void 0, required: false }, // Prefetching prefetch: { type: Boolean, default: void 0, required: false }, prefetchOn: { type: [String, Object], default: void 0, required: false }, noPrefetch: { type: Boolean, default: void 0, required: false }, // Styling activeClass: { type: String, default: void 0, required: false }, exactActiveClass: { type: String, default: void 0, required: false }, prefetchedClass: { type: String, default: void 0, required: false }, // Vue Router's `