You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4207 lines
152 KiB
4207 lines
152 KiB
import process from 'node:process';globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};import { hasInjectionContext, inject, getCurrentInstance, defineComponent, createElementBlock, shallowRef, provide, cloneVNode, h, defineAsyncComponent, computed, unref, shallowReactive, ref, Suspense, Fragment, createApp, watch, onErrorCaptured, onServerPrefetch, createVNode, resolveDynamicComponent, reactive, effectScope, mergeProps, getCurrentScope, toRef, withCtx, nextTick, isReadonly, isRef, toValue, toRaw, useSSRContext, isShallow, isReactive } from 'vue';
|
|
import { p as parseURL$1, e as encodePath$1, k as decodePath, l as hasProtocol, m as isScriptProtocol, n as joinURL, w as withQuery, s as sanitizeStatusCode, o as getContext, $ as $fetch, q as defu, c as createError$1, r as executeAsync, t as hash } from '../nitro/nitro.mjs';
|
|
import { b as baseURL } from '../routes/renderer.mjs';
|
|
import { defineStore, setActivePinia, createPinia, shouldHydrate } from 'pinia';
|
|
import { debounce } from 'perfect-debounce';
|
|
import { ssrRenderSuspense, ssrRenderComponent, ssrRenderVNode } from 'vue/server-renderer';
|
|
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';
|
|
|
|
function flatHooks(configHooks, hooks = {}, parentName) {
|
|
for (const key in configHooks) {
|
|
const subHook = configHooks[key];
|
|
const name = parentName ? `${parentName}:${key}` : key;
|
|
if (typeof subHook === "object" && subHook !== null) flatHooks(subHook, hooks, name);
|
|
else if (typeof subHook === "function") hooks[name] = subHook;
|
|
}
|
|
return hooks;
|
|
}
|
|
const createTask = /* @__PURE__ */ (() => {
|
|
if (console.createTask) return console.createTask;
|
|
const defaultTask = { run: (fn) => fn() };
|
|
return () => defaultTask;
|
|
})();
|
|
function callHooks(hooks, args, startIndex, task) {
|
|
for (let i = startIndex; i < hooks.length; i += 1) try {
|
|
const result = task ? task.run(() => hooks[i](...args)) : hooks[i](...args);
|
|
if (result && typeof result.then === "function") return Promise.resolve(result).then(() => callHooks(hooks, args, i + 1, task));
|
|
} catch (error) {
|
|
return Promise.reject(error);
|
|
}
|
|
}
|
|
function serialTaskCaller(hooks, args, name) {
|
|
if (hooks.length > 0) return callHooks(hooks, args, 0, createTask(name));
|
|
}
|
|
function parallelTaskCaller(hooks, args, name) {
|
|
if (hooks.length > 0) {
|
|
const task = createTask(name);
|
|
return Promise.all(hooks.map((hook) => task.run(() => hook(...args))));
|
|
}
|
|
}
|
|
function callEachWith(callbacks, arg0) {
|
|
for (const callback of [...callbacks]) callback(arg0);
|
|
}
|
|
var Hookable = class {
|
|
_hooks;
|
|
_before;
|
|
_after;
|
|
_deprecatedHooks;
|
|
_deprecatedMessages;
|
|
constructor() {
|
|
this._hooks = {};
|
|
this._before = void 0;
|
|
this._after = void 0;
|
|
this._deprecatedMessages = void 0;
|
|
this._deprecatedHooks = {};
|
|
this.hook = this.hook.bind(this);
|
|
this.callHook = this.callHook.bind(this);
|
|
this.callHookWith = this.callHookWith.bind(this);
|
|
}
|
|
hook(name, function_, options = {}) {
|
|
if (!name || typeof function_ !== "function") return () => {};
|
|
const originalName = name;
|
|
let dep;
|
|
while (this._deprecatedHooks[name]) {
|
|
dep = this._deprecatedHooks[name];
|
|
name = dep.to;
|
|
}
|
|
if (dep && !options.allowDeprecated) {
|
|
let message = dep.message;
|
|
if (!message) message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
|
|
if (!this._deprecatedMessages) this._deprecatedMessages = /* @__PURE__ */ new Set();
|
|
if (!this._deprecatedMessages.has(message)) {
|
|
console.warn(message);
|
|
this._deprecatedMessages.add(message);
|
|
}
|
|
}
|
|
if (!function_.name) try {
|
|
Object.defineProperty(function_, "name", {
|
|
get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
|
|
configurable: true
|
|
});
|
|
} catch {}
|
|
this._hooks[name] = this._hooks[name] || [];
|
|
this._hooks[name].push(function_);
|
|
return () => {
|
|
if (function_) {
|
|
this.removeHook(name, function_);
|
|
function_ = void 0;
|
|
}
|
|
};
|
|
}
|
|
hookOnce(name, function_) {
|
|
let _unreg;
|
|
let _function = (...arguments_) => {
|
|
if (typeof _unreg === "function") _unreg();
|
|
_unreg = void 0;
|
|
_function = void 0;
|
|
return function_(...arguments_);
|
|
};
|
|
_unreg = this.hook(name, _function);
|
|
return _unreg;
|
|
}
|
|
removeHook(name, function_) {
|
|
const hooks = this._hooks[name];
|
|
if (hooks) {
|
|
const index = hooks.indexOf(function_);
|
|
if (index !== -1) hooks.splice(index, 1);
|
|
if (hooks.length === 0) this._hooks[name] = void 0;
|
|
}
|
|
}
|
|
clearHook(name) {
|
|
this._hooks[name] = void 0;
|
|
}
|
|
deprecateHook(name, deprecated) {
|
|
this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
|
|
const _hooks = this._hooks[name] || [];
|
|
this._hooks[name] = void 0;
|
|
for (const hook of _hooks) this.hook(name, hook);
|
|
}
|
|
deprecateHooks(deprecatedHooks) {
|
|
for (const name in deprecatedHooks) this.deprecateHook(name, deprecatedHooks[name]);
|
|
}
|
|
addHooks(configHooks) {
|
|
const hooks = flatHooks(configHooks);
|
|
const removeFns = Object.keys(hooks).map((key) => this.hook(key, hooks[key]));
|
|
return () => {
|
|
for (const unreg of removeFns) unreg();
|
|
removeFns.length = 0;
|
|
};
|
|
}
|
|
removeHooks(configHooks) {
|
|
const hooks = flatHooks(configHooks);
|
|
for (const key in hooks) this.removeHook(key, hooks[key]);
|
|
}
|
|
removeAllHooks() {
|
|
this._hooks = {};
|
|
}
|
|
callHook(name, ...args) {
|
|
return this.callHookWith(serialTaskCaller, name, args);
|
|
}
|
|
callHookParallel(name, ...args) {
|
|
return this.callHookWith(parallelTaskCaller, name, args);
|
|
}
|
|
callHookWith(caller, name, args) {
|
|
const event = this._before || this._after ? {
|
|
name,
|
|
args,
|
|
context: {}
|
|
} : void 0;
|
|
if (this._before) callEachWith(this._before, event);
|
|
const result = caller(this._hooks[name] ? [...this._hooks[name]] : [], args, name);
|
|
if (result instanceof Promise) return result.finally(() => {
|
|
if (this._after && event) callEachWith(this._after, event);
|
|
});
|
|
if (this._after && event) callEachWith(this._after, event);
|
|
return result;
|
|
}
|
|
beforeEach(function_) {
|
|
this._before = this._before || [];
|
|
this._before.push(function_);
|
|
return () => {
|
|
if (this._before !== void 0) {
|
|
const index = this._before.indexOf(function_);
|
|
if (index !== -1) this._before.splice(index, 1);
|
|
}
|
|
};
|
|
}
|
|
afterEach(function_) {
|
|
this._after = this._after || [];
|
|
this._after.push(function_);
|
|
return () => {
|
|
if (this._after !== void 0) {
|
|
const index = this._after.indexOf(function_);
|
|
if (index !== -1) this._after.splice(index, 1);
|
|
}
|
|
};
|
|
}
|
|
};
|
|
function createHooks() {
|
|
return new Hookable();
|
|
}
|
|
|
|
if (!globalThis.$fetch) {
|
|
globalThis.$fetch = $fetch.create({
|
|
baseURL: baseURL()
|
|
});
|
|
}
|
|
if (!("global" in globalThis)) {
|
|
globalThis.global = globalThis;
|
|
}
|
|
const appLayoutTransition = false;
|
|
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.4.8";
|
|
},
|
|
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({}),
|
|
_state: 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 = /* @__PURE__ */ Symbol("layout-meta");
|
|
const PageRouteSymbol = /* @__PURE__ */ Symbol("route");
|
|
globalThis._importMeta_.url.replace(/\/app\/.*$/, "/");
|
|
const useRouter = () => {
|
|
return useNuxtApp()?.$router;
|
|
};
|
|
const useRoute$1 = () => {
|
|
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 HTML_ATTR_UNSAFE_RE = /[&"'<>]/g;
|
|
const HTML_ATTR_ENCODE_MAP = {
|
|
"&": "%26",
|
|
'"': "%22",
|
|
"'": "%27",
|
|
"<": "%3C",
|
|
">": "%3E"
|
|
};
|
|
function encodeForHtmlAttr(value) {
|
|
return value.replace(HTML_ATTR_UNSAFE_RE, (c) => HTML_ATTR_ENCODE_MAP[c]);
|
|
}
|
|
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 encodedHeader = encodeURL(location2, isExternalHost);
|
|
const encodedLoc = encodeForHtmlAttr(encodedHeader);
|
|
nuxtApp.ssrContext["~renderResponse"] = {
|
|
statusCode: sanitizeStatusCode(options?.redirectCode || 302, 302),
|
|
body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`,
|
|
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();
|
|
}
|
|
const encodedTo = typeof to === "string" ? encodeRoutePath(to) : to;
|
|
return options?.replace ? router.replace(encodedTo) : router.push(encodedTo);
|
|
};
|
|
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) {
|
|
const pathname = url.pathname.replace(/^\/{2,}/, "/");
|
|
return pathname + url.search + url.hash;
|
|
}
|
|
if (location2.startsWith("//")) {
|
|
return url.toString().replace(url.protocol, "");
|
|
}
|
|
return url.toString();
|
|
}
|
|
function encodeRoutePath(url) {
|
|
const parsed = parseURL$1(url);
|
|
return encodePath$1(decodePath(parsed.pathname)) + parsed.search + parsed.hash;
|
|
}
|
|
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) => {
|
|
if (typeof error !== "string" && error.statusText) {
|
|
error.message ??= error.statusText;
|
|
}
|
|
const nuxtError = createError$1(error);
|
|
Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
|
|
value: true,
|
|
configurable: false,
|
|
writable: false
|
|
});
|
|
Object.defineProperty(nuxtError, "status", {
|
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
get: () => nuxtError.statusCode,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(nuxtError, "statusText", {
|
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
get: () => nuxtError.statusMessage,
|
|
configurable: true
|
|
});
|
|
return nuxtError;
|
|
};
|
|
const matcher = (m, p) => {
|
|
return [];
|
|
};
|
|
const _routeRulesMatcher = (path) => defu({}, ...matcher("", typeof path === "string" ? path.toLowerCase() : path).map((r) => r.data).reverse());
|
|
const routeRulesMatcher$1 = _routeRulesMatcher;
|
|
function getRouteRules(arg) {
|
|
const path = typeof arg === "string" ? arg : arg.path;
|
|
try {
|
|
return routeRulesMatcher$1(path.toLowerCase());
|
|
} catch (e) {
|
|
console.error("[nuxt] Error matching route rules.", e);
|
|
return {};
|
|
}
|
|
}
|
|
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
|
|
);
|
|
});
|
|
function freezeHead(head) {
|
|
const realPush = head.push;
|
|
head.push = () => ({ dispose: () => {
|
|
}, patch: () => {
|
|
}, _poll: () => {
|
|
} });
|
|
return () => {
|
|
head.push = realPush;
|
|
};
|
|
}
|
|
const unhead_onaWNbu_aBWmOMZtU6jpQtjACQlz0S9RZ6v_ogqPSGE = /* @__PURE__ */ defineNuxtPlugin({
|
|
name: "nuxt:head",
|
|
enforce: "pre",
|
|
setup(nuxtApp) {
|
|
const head = nuxtApp.ssrContext.head;
|
|
if (nuxtApp.ssrContext.islandContext) {
|
|
const unfreeze = freezeHead(head);
|
|
nuxtApp.hooks.hookOnce("app:created", unfreeze);
|
|
}
|
|
nuxtApp.vueApp.use(head);
|
|
}
|
|
});
|
|
function isRouteComponent(component) {
|
|
return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
|
|
}
|
|
function isESModule(obj) {
|
|
return obj.__esModule || obj[Symbol.toStringTag] === "Module" || obj.default && isRouteComponent(obj.default);
|
|
}
|
|
const assign = Object.assign;
|
|
function applyToParams(fn, params) {
|
|
const newParams = {};
|
|
for (const key in params) {
|
|
const value = params[key];
|
|
newParams[key] = isArray(value) ? value.map(fn) : fn(value);
|
|
}
|
|
return newParams;
|
|
}
|
|
const noop = () => {
|
|
};
|
|
const isArray = Array.isArray;
|
|
function mergeOptions(defaults, partialOptions) {
|
|
const options = {};
|
|
for (const key in defaults) options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
|
|
return options;
|
|
}
|
|
const NavigationFailureSymbol = /* @__PURE__ */ Symbol("");
|
|
function createRouterError(type, params) {
|
|
return assign(/* @__PURE__ */ new Error(), {
|
|
type,
|
|
[NavigationFailureSymbol]: true
|
|
}, params);
|
|
}
|
|
function isNavigationFailure(error, type) {
|
|
return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
|
|
}
|
|
const matchedRouteKey = /* @__PURE__ */ Symbol("");
|
|
const viewDepthKey = /* @__PURE__ */ Symbol("");
|
|
const routerKey = /* @__PURE__ */ Symbol("");
|
|
const routeLocationKey = /* @__PURE__ */ Symbol("");
|
|
const routerViewLocationKey = /* @__PURE__ */ Symbol("");
|
|
function useRoute(_name) {
|
|
return inject(routeLocationKey);
|
|
}
|
|
const HASH_RE = /#/g;
|
|
const AMPERSAND_RE = /&/g;
|
|
const SLASH_RE = /\//g;
|
|
const EQUAL_RE = /=/g;
|
|
const IM_RE = /\?/g;
|
|
const PLUS_RE = /\+/g;
|
|
const ENC_BRACKET_OPEN_RE = /%5B/g;
|
|
const ENC_BRACKET_CLOSE_RE = /%5D/g;
|
|
const ENC_CARET_RE = /%5E/g;
|
|
const ENC_BACKTICK_RE = /%60/g;
|
|
const ENC_CURLY_OPEN_RE = /%7B/g;
|
|
const ENC_PIPE_RE = /%7C/g;
|
|
const ENC_CURLY_CLOSE_RE = /%7D/g;
|
|
const ENC_SPACE_RE = /%20/g;
|
|
function commonEncode(text) {
|
|
return text == null ? "" : encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
|
|
}
|
|
function encodeHash(text) {
|
|
return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
|
|
}
|
|
function encodeQueryValue(text) {
|
|
return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
|
|
}
|
|
function encodeQueryKey(text) {
|
|
return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
|
|
}
|
|
function encodePath(text) {
|
|
return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
|
|
}
|
|
function encodeParam(text) {
|
|
return encodePath(text).replace(SLASH_RE, "%2F");
|
|
}
|
|
function decode(text) {
|
|
if (text == null) return null;
|
|
try {
|
|
return decodeURIComponent("" + text);
|
|
} catch {
|
|
}
|
|
return "" + text;
|
|
}
|
|
const TRAILING_SLASH_RE = /\/$/;
|
|
const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
|
|
function parseURL(parseQuery2, location, currentLocation = "/") {
|
|
let path, query = {}, searchString = "", hash2 = "";
|
|
const hashPos = location.indexOf("#");
|
|
let searchPos = location.indexOf("?");
|
|
searchPos = hashPos >= 0 && searchPos > hashPos ? -1 : searchPos;
|
|
if (searchPos >= 0) {
|
|
path = location.slice(0, searchPos);
|
|
searchString = location.slice(searchPos, hashPos > 0 ? hashPos : location.length);
|
|
query = parseQuery2(searchString.slice(1));
|
|
}
|
|
if (hashPos >= 0) {
|
|
path = path || location.slice(0, hashPos);
|
|
hash2 = location.slice(hashPos, location.length);
|
|
}
|
|
path = resolveRelativePath(path != null ? path : location, currentLocation);
|
|
return {
|
|
fullPath: path + searchString + hash2,
|
|
path,
|
|
query,
|
|
hash: decode(hash2)
|
|
};
|
|
}
|
|
function stringifyURL(stringifyQuery2, location) {
|
|
const query = location.query ? stringifyQuery2(location.query) : "";
|
|
return location.path + (query && "?") + query + (location.hash || "");
|
|
}
|
|
function isSameRouteLocation(stringifyQuery2, a, b) {
|
|
const aLastIndex = a.matched.length - 1;
|
|
const bLastIndex = b.matched.length - 1;
|
|
return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) && isSameRouteLocationParams(a.params, b.params) && stringifyQuery2(a.query) === stringifyQuery2(b.query) && a.hash === b.hash;
|
|
}
|
|
function isSameRouteRecord(a, b) {
|
|
return (a.aliasOf || a) === (b.aliasOf || b);
|
|
}
|
|
function isSameRouteLocationParams(a, b) {
|
|
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
for (var key in a) if (!isSameRouteLocationParamsValue(a[key], b[key])) return false;
|
|
return true;
|
|
}
|
|
function isSameRouteLocationParamsValue(a, b) {
|
|
return isArray(a) ? isEquivalentArray(a, b) : isArray(b) ? isEquivalentArray(b, a) : (a && a.valueOf()) === (b && b.valueOf());
|
|
}
|
|
function isEquivalentArray(a, b) {
|
|
return isArray(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
|
|
}
|
|
function resolveRelativePath(to, from) {
|
|
if (to.startsWith("/")) return to;
|
|
if (!to) return from;
|
|
const fromSegments = from.split("/");
|
|
const toSegments = to.split("/");
|
|
const lastToSegment = toSegments[toSegments.length - 1];
|
|
if (lastToSegment === ".." || lastToSegment === ".") toSegments.push("");
|
|
let position = fromSegments.length - 1;
|
|
let toPosition;
|
|
let segment;
|
|
for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
|
|
segment = toSegments[toPosition];
|
|
if (segment === ".") continue;
|
|
if (segment === "..") {
|
|
if (position > 1) position--;
|
|
} else break;
|
|
}
|
|
return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
|
|
}
|
|
const START_LOCATION_NORMALIZED = {
|
|
path: "/",
|
|
name: void 0,
|
|
params: {},
|
|
query: {},
|
|
hash: "",
|
|
fullPath: "/",
|
|
matched: [],
|
|
meta: {},
|
|
redirectedFrom: void 0
|
|
};
|
|
function normalizeBase(base) {
|
|
if (!base) base = "/";
|
|
if (base[0] !== "/" && base[0] !== "#") base = "/" + base;
|
|
return removeTrailingSlash(base);
|
|
}
|
|
const BEFORE_HASH_RE = /^[^#]+#/;
|
|
function createHref(base, location) {
|
|
return base.replace(BEFORE_HASH_RE, "#") + location;
|
|
}
|
|
function isRouteLocation(route) {
|
|
return typeof route === "string" || route && typeof route === "object";
|
|
}
|
|
function isRouteName(name) {
|
|
return typeof name === "string" || typeof name === "symbol";
|
|
}
|
|
function parseQuery(search) {
|
|
const query = {};
|
|
if (search === "" || search === "?") return query;
|
|
const searchParams = (search[0] === "?" ? search.slice(1) : search).split("&");
|
|
for (let i = 0; i < searchParams.length; ++i) {
|
|
const searchParam = searchParams[i].replace(PLUS_RE, " ");
|
|
const eqPos = searchParam.indexOf("=");
|
|
const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
|
|
const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
|
|
if (key in query) {
|
|
let currentValue = query[key];
|
|
if (!isArray(currentValue)) currentValue = query[key] = [currentValue];
|
|
currentValue.push(value);
|
|
} else query[key] = value;
|
|
}
|
|
return query;
|
|
}
|
|
function stringifyQuery(query) {
|
|
let search = "";
|
|
for (let key in query) {
|
|
const value = query[key];
|
|
key = encodeQueryKey(key);
|
|
if (value == null) {
|
|
if (value !== void 0) search += (search.length ? "&" : "") + key;
|
|
continue;
|
|
}
|
|
(isArray(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)]).forEach((value2) => {
|
|
if (value2 !== void 0) {
|
|
search += (search.length ? "&" : "") + key;
|
|
if (value2 != null) search += "=" + value2;
|
|
}
|
|
});
|
|
}
|
|
return search;
|
|
}
|
|
function normalizeQuery(query) {
|
|
const normalizedQuery = {};
|
|
for (const key in query) {
|
|
const value = query[key];
|
|
if (value !== void 0) normalizedQuery[key] = isArray(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
|
|
}
|
|
return normalizedQuery;
|
|
}
|
|
function useCallbacks() {
|
|
let handlers = [];
|
|
function add(handler) {
|
|
handlers.push(handler);
|
|
return () => {
|
|
const i = handlers.indexOf(handler);
|
|
if (i > -1) handlers.splice(i, 1);
|
|
};
|
|
}
|
|
function reset() {
|
|
handlers = [];
|
|
}
|
|
return {
|
|
add,
|
|
list: () => handlers.slice(),
|
|
reset
|
|
};
|
|
}
|
|
function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
|
|
const enterCallbackArray = record && (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
|
|
return () => new Promise((resolve, reject) => {
|
|
const next = (valid) => {
|
|
if (valid === false) reject(createRouterError(4, {
|
|
from,
|
|
to
|
|
}));
|
|
else if (valid instanceof Error) reject(valid);
|
|
else if (isRouteLocation(valid)) reject(createRouterError(2, {
|
|
from: to,
|
|
to: valid
|
|
}));
|
|
else {
|
|
if (enterCallbackArray && record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") enterCallbackArray.push(valid);
|
|
resolve();
|
|
}
|
|
};
|
|
const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
|
|
let guardCall = Promise.resolve(guardReturn);
|
|
if (guard.length < 3) guardCall = guardCall.then(next);
|
|
guardCall.catch((err) => reject(err));
|
|
});
|
|
}
|
|
function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
|
|
const guards = [];
|
|
for (const record of matched) {
|
|
for (const name in record.components) {
|
|
let rawComponent = record.components[name];
|
|
if (guardType !== "beforeRouteEnter" && !record.instances[name]) continue;
|
|
if (isRouteComponent(rawComponent)) {
|
|
const guard = (rawComponent.__vccOpts || rawComponent)[guardType];
|
|
guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
|
|
} else {
|
|
let componentPromise = rawComponent();
|
|
guards.push(() => componentPromise.then((resolved) => {
|
|
if (!resolved) throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
|
|
const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
|
|
record.mods[name] = resolved;
|
|
record.components[name] = resolvedComponent;
|
|
const guard = (resolvedComponent.__vccOpts || resolvedComponent)[guardType];
|
|
return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
|
|
}));
|
|
}
|
|
}
|
|
}
|
|
return guards;
|
|
}
|
|
function extractChangingRecords(to, from) {
|
|
const leavingRecords = [];
|
|
const updatingRecords = [];
|
|
const enteringRecords = [];
|
|
const len = Math.max(from.matched.length, to.matched.length);
|
|
for (let i = 0; i < len; i++) {
|
|
const recordFrom = from.matched[i];
|
|
if (recordFrom) if (to.matched.find((record) => isSameRouteRecord(record, recordFrom))) updatingRecords.push(recordFrom);
|
|
else leavingRecords.push(recordFrom);
|
|
const recordTo = to.matched[i];
|
|
if (recordTo) {
|
|
if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) enteringRecords.push(recordTo);
|
|
}
|
|
}
|
|
return [
|
|
leavingRecords,
|
|
updatingRecords,
|
|
enteringRecords
|
|
];
|
|
}
|
|
function createMemoryHistory(base = "") {
|
|
let listeners = [];
|
|
let queue = [["", {}]];
|
|
let position = 0;
|
|
base = normalizeBase(base);
|
|
function setLocation(location2, state = {}) {
|
|
position++;
|
|
if (position !== queue.length) queue.splice(position);
|
|
queue.push([location2, state]);
|
|
}
|
|
function triggerListeners(to, from, { direction, delta }) {
|
|
const info = {
|
|
direction,
|
|
delta,
|
|
type: "pop"
|
|
};
|
|
for (const callback of listeners) callback(to, from, info);
|
|
}
|
|
const routerHistory = {
|
|
location: "",
|
|
state: {},
|
|
base,
|
|
createHref: createHref.bind(null, base),
|
|
replace(to, state) {
|
|
queue.splice(position--, 1);
|
|
setLocation(to, state);
|
|
},
|
|
push(to, state) {
|
|
setLocation(to, state);
|
|
},
|
|
listen(callback) {
|
|
listeners.push(callback);
|
|
return () => {
|
|
const index = listeners.indexOf(callback);
|
|
if (index > -1) listeners.splice(index, 1);
|
|
};
|
|
},
|
|
destroy() {
|
|
listeners = [];
|
|
queue = [["", {}]];
|
|
position = 0;
|
|
},
|
|
go(delta, shouldTrigger = true) {
|
|
const from = this.location;
|
|
const direction = delta < 0 ? "back" : "forward";
|
|
position = Math.max(0, Math.min(position + delta, queue.length - 1));
|
|
if (shouldTrigger) triggerListeners(this.location, from, {
|
|
direction,
|
|
delta
|
|
});
|
|
}
|
|
};
|
|
Object.defineProperty(routerHistory, "location", {
|
|
enumerable: true,
|
|
get: () => queue[position][0]
|
|
});
|
|
Object.defineProperty(routerHistory, "state", {
|
|
enumerable: true,
|
|
get: () => queue[position][1]
|
|
});
|
|
return routerHistory;
|
|
}
|
|
const ROOT_TOKEN = {
|
|
type: 0,
|
|
value: ""
|
|
};
|
|
const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
|
|
function tokenizePath(path) {
|
|
if (!path) return [[]];
|
|
if (path === "/") return [[ROOT_TOKEN]];
|
|
if (!path.startsWith("/")) throw new Error(`Invalid path "${path}"`);
|
|
function crash(message) {
|
|
throw new Error(`ERR (${state})/"${buffer}": ${message}`);
|
|
}
|
|
let state = 0;
|
|
let previousState = state;
|
|
const tokens = [];
|
|
let segment;
|
|
function finalizeSegment() {
|
|
if (segment) tokens.push(segment);
|
|
segment = [];
|
|
}
|
|
let i = 0;
|
|
let char;
|
|
let buffer = "";
|
|
let customRe = "";
|
|
function consumeBuffer() {
|
|
if (!buffer) return;
|
|
if (state === 0) segment.push({
|
|
type: 0,
|
|
value: buffer
|
|
});
|
|
else if (state === 1 || state === 2 || state === 3) {
|
|
if (segment.length > 1 && (char === "*" || char === "+")) crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
|
|
segment.push({
|
|
type: 1,
|
|
value: buffer,
|
|
regexp: customRe,
|
|
repeatable: char === "*" || char === "+",
|
|
optional: char === "*" || char === "?"
|
|
});
|
|
} else crash("Invalid state to consume buffer");
|
|
buffer = "";
|
|
}
|
|
function addCharToBuffer() {
|
|
buffer += char;
|
|
}
|
|
while (i < path.length) {
|
|
char = path[i++];
|
|
switch (state) {
|
|
case 0:
|
|
if (char === "\\") {
|
|
previousState = state;
|
|
state = 4;
|
|
} else if (char === "/") {
|
|
if (buffer) consumeBuffer();
|
|
finalizeSegment();
|
|
} else if (char === ":") {
|
|
consumeBuffer();
|
|
state = 1;
|
|
} else addCharToBuffer();
|
|
break;
|
|
case 4:
|
|
addCharToBuffer();
|
|
state = previousState;
|
|
break;
|
|
case 1:
|
|
if (char === "(") state = 2;
|
|
else if (VALID_PARAM_RE.test(char)) addCharToBuffer();
|
|
else {
|
|
consumeBuffer();
|
|
state = 0;
|
|
if (char !== "*" && char !== "?" && char !== "+") i--;
|
|
}
|
|
break;
|
|
case 2:
|
|
if (char === ")") if (customRe[customRe.length - 1] == "\\") customRe = customRe.slice(0, -1) + char;
|
|
else state = 3;
|
|
else customRe += char;
|
|
break;
|
|
case 3:
|
|
consumeBuffer();
|
|
state = 0;
|
|
if (char !== "*" && char !== "?" && char !== "+") i--;
|
|
customRe = "";
|
|
break;
|
|
default:
|
|
crash("Unknown state");
|
|
break;
|
|
}
|
|
}
|
|
if (state === 2) crash(`Unfinished custom RegExp for param "${buffer}"`);
|
|
consumeBuffer();
|
|
finalizeSegment();
|
|
return tokens;
|
|
}
|
|
const BASE_PARAM_PATTERN = "[^/]+?";
|
|
const BASE_PATH_PARSER_OPTIONS = {
|
|
sensitive: false,
|
|
strict: false,
|
|
start: true,
|
|
end: true
|
|
};
|
|
const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
|
|
function tokensToParser(segments, extraOptions) {
|
|
const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
|
|
const score = [];
|
|
let pattern = options.start ? "^" : "";
|
|
const keys = [];
|
|
for (const segment of segments) {
|
|
const segmentScores = segment.length ? [] : [90];
|
|
if (options.strict && !segment.length) pattern += "/";
|
|
for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
|
|
const token = segment[tokenIndex];
|
|
let subSegmentScore = 40 + (options.sensitive ? 0.25 : 0);
|
|
if (token.type === 0) {
|
|
if (!tokenIndex) pattern += "/";
|
|
pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
|
|
subSegmentScore += 40;
|
|
} else if (token.type === 1) {
|
|
const { value, repeatable, optional, regexp } = token;
|
|
keys.push({
|
|
name: value,
|
|
repeatable,
|
|
optional
|
|
});
|
|
const re2 = regexp ? regexp : BASE_PARAM_PATTERN;
|
|
if (re2 !== BASE_PARAM_PATTERN) {
|
|
subSegmentScore += 10;
|
|
try {
|
|
new RegExp(`(${re2})`);
|
|
} catch (err) {
|
|
throw new Error(`Invalid custom RegExp for param "${value}" (${re2}): ` + err.message);
|
|
}
|
|
}
|
|
let subPattern = repeatable ? `((?:${re2})(?:/(?:${re2}))*)` : `(${re2})`;
|
|
if (!tokenIndex) subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
|
|
if (optional) subPattern += "?";
|
|
pattern += subPattern;
|
|
subSegmentScore += 20;
|
|
if (optional) subSegmentScore += -8;
|
|
if (repeatable) subSegmentScore += -20;
|
|
if (re2 === ".*") subSegmentScore += -50;
|
|
}
|
|
segmentScores.push(subSegmentScore);
|
|
}
|
|
score.push(segmentScores);
|
|
}
|
|
if (options.strict && options.end) {
|
|
const i = score.length - 1;
|
|
score[i][score[i].length - 1] += 0.7000000000000001;
|
|
}
|
|
if (!options.strict) pattern += "/?";
|
|
if (options.end) pattern += "$";
|
|
else if (options.strict && !pattern.endsWith("/")) pattern += "(?:/|$)";
|
|
const re = new RegExp(pattern, options.sensitive ? "" : "i");
|
|
function parse(path) {
|
|
const match = path.match(re);
|
|
const params = {};
|
|
if (!match) return null;
|
|
for (let i = 1; i < match.length; i++) {
|
|
const value = match[i] || "";
|
|
const key = keys[i - 1];
|
|
params[key.name] = value && key.repeatable ? value.split("/") : value;
|
|
}
|
|
return params;
|
|
}
|
|
function stringify(params) {
|
|
let path = "";
|
|
let avoidDuplicatedSlash = false;
|
|
for (const segment of segments) {
|
|
if (!avoidDuplicatedSlash || !path.endsWith("/")) path += "/";
|
|
avoidDuplicatedSlash = false;
|
|
for (const token of segment) if (token.type === 0) path += token.value;
|
|
else if (token.type === 1) {
|
|
const { value, repeatable, optional } = token;
|
|
const param = value in params ? params[value] : "";
|
|
if (isArray(param) && !repeatable) throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
|
|
const text = isArray(param) ? param.join("/") : param;
|
|
if (!text) if (optional) {
|
|
if (segment.length < 2) if (path.endsWith("/")) path = path.slice(0, -1);
|
|
else avoidDuplicatedSlash = true;
|
|
} else throw new Error(`Missing required param "${value}"`);
|
|
path += text;
|
|
}
|
|
}
|
|
return path || "/";
|
|
}
|
|
return {
|
|
re,
|
|
score,
|
|
keys,
|
|
parse,
|
|
stringify
|
|
};
|
|
}
|
|
function compareScoreArray(a, b) {
|
|
let i = 0;
|
|
while (i < a.length && i < b.length) {
|
|
const diff = b[i] - a[i];
|
|
if (diff) return diff;
|
|
i++;
|
|
}
|
|
if (a.length < b.length) return a.length === 1 && a[0] === 80 ? -1 : 1;
|
|
else if (a.length > b.length) return b.length === 1 && b[0] === 80 ? 1 : -1;
|
|
return 0;
|
|
}
|
|
function comparePathParserScore(a, b) {
|
|
let i = 0;
|
|
const aScore = a.score;
|
|
const bScore = b.score;
|
|
while (i < aScore.length && i < bScore.length) {
|
|
const comp = compareScoreArray(aScore[i], bScore[i]);
|
|
if (comp) return comp;
|
|
i++;
|
|
}
|
|
if (Math.abs(bScore.length - aScore.length) === 1) {
|
|
if (isLastScoreNegative(aScore)) return 1;
|
|
if (isLastScoreNegative(bScore)) return -1;
|
|
}
|
|
return bScore.length - aScore.length;
|
|
}
|
|
function isLastScoreNegative(score) {
|
|
const last = score[score.length - 1];
|
|
return score.length > 0 && last[last.length - 1] < 0;
|
|
}
|
|
const PATH_PARSER_OPTIONS_DEFAULTS = {
|
|
strict: false,
|
|
end: true,
|
|
sensitive: false
|
|
};
|
|
function createRouteRecordMatcher(record, parent, options) {
|
|
const parser = tokensToParser(tokenizePath(record.path), options);
|
|
const matcher2 = assign(parser, {
|
|
record,
|
|
parent,
|
|
children: [],
|
|
alias: []
|
|
});
|
|
if (parent) {
|
|
if (!matcher2.record.aliasOf === !parent.record.aliasOf) parent.children.push(matcher2);
|
|
}
|
|
return matcher2;
|
|
}
|
|
function createRouterMatcher(routes, globalOptions) {
|
|
const matchers = [];
|
|
const matcherMap = /* @__PURE__ */ new Map();
|
|
globalOptions = mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS, globalOptions);
|
|
function getRecordMatcher(name) {
|
|
return matcherMap.get(name);
|
|
}
|
|
function addRoute(record, parent, originalRecord) {
|
|
const isRootAdd = !originalRecord;
|
|
const mainNormalizedRecord = normalizeRouteRecord(record);
|
|
mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
|
|
const options = mergeOptions(globalOptions, record);
|
|
const normalizedRecords = [mainNormalizedRecord];
|
|
if ("alias" in record) {
|
|
const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
|
|
for (const alias of aliases) normalizedRecords.push(normalizeRouteRecord(assign({}, mainNormalizedRecord, {
|
|
components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
|
|
path: alias,
|
|
aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
|
|
})));
|
|
}
|
|
let matcher2;
|
|
let originalMatcher;
|
|
for (const normalizedRecord of normalizedRecords) {
|
|
const { path } = normalizedRecord;
|
|
if (parent && path[0] !== "/") {
|
|
const parentPath = parent.record.path;
|
|
const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
|
|
normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
|
|
}
|
|
matcher2 = createRouteRecordMatcher(normalizedRecord, parent, options);
|
|
if (originalRecord) {
|
|
originalRecord.alias.push(matcher2);
|
|
} else {
|
|
originalMatcher = originalMatcher || matcher2;
|
|
if (originalMatcher !== matcher2) originalMatcher.alias.push(matcher2);
|
|
if (isRootAdd && record.name && !isAliasRecord(matcher2)) {
|
|
removeRoute(record.name);
|
|
}
|
|
}
|
|
if (isMatchable(matcher2)) insertMatcher(matcher2);
|
|
if (mainNormalizedRecord.children) {
|
|
const children = mainNormalizedRecord.children;
|
|
for (let i = 0; i < children.length; i++) addRoute(children[i], matcher2, originalRecord && originalRecord.children[i]);
|
|
}
|
|
originalRecord = originalRecord || matcher2;
|
|
}
|
|
return originalMatcher ? () => {
|
|
removeRoute(originalMatcher);
|
|
} : noop;
|
|
}
|
|
function removeRoute(matcherRef) {
|
|
if (isRouteName(matcherRef)) {
|
|
const matcher2 = matcherMap.get(matcherRef);
|
|
if (matcher2) {
|
|
matcherMap.delete(matcherRef);
|
|
matchers.splice(matchers.indexOf(matcher2), 1);
|
|
matcher2.children.forEach(removeRoute);
|
|
matcher2.alias.forEach(removeRoute);
|
|
}
|
|
} else {
|
|
const index = matchers.indexOf(matcherRef);
|
|
if (index > -1) {
|
|
matchers.splice(index, 1);
|
|
if (matcherRef.record.name) matcherMap.delete(matcherRef.record.name);
|
|
matcherRef.children.forEach(removeRoute);
|
|
matcherRef.alias.forEach(removeRoute);
|
|
}
|
|
}
|
|
}
|
|
function getRoutes() {
|
|
return matchers;
|
|
}
|
|
function insertMatcher(matcher2) {
|
|
const index = findInsertionIndex(matcher2, matchers);
|
|
matchers.splice(index, 0, matcher2);
|
|
if (matcher2.record.name && !isAliasRecord(matcher2)) matcherMap.set(matcher2.record.name, matcher2);
|
|
}
|
|
function resolve(location2, currentLocation) {
|
|
let matcher2;
|
|
let params = {};
|
|
let path;
|
|
let name;
|
|
if ("name" in location2 && location2.name) {
|
|
matcher2 = matcherMap.get(location2.name);
|
|
if (!matcher2) throw createRouterError(1, { location: location2 });
|
|
name = matcher2.record.name;
|
|
params = assign(pickParams(currentLocation.params, matcher2.keys.filter((k) => !k.optional).concat(matcher2.parent ? matcher2.parent.keys.filter((k) => k.optional) : []).map((k) => k.name)), location2.params && pickParams(location2.params, matcher2.keys.map((k) => k.name)));
|
|
path = matcher2.stringify(params);
|
|
} else if (location2.path != null) {
|
|
path = location2.path;
|
|
matcher2 = matchers.find((m) => m.re.test(path));
|
|
if (matcher2) {
|
|
params = matcher2.parse(path);
|
|
name = matcher2.record.name;
|
|
matcher2.keys.forEach((key) => {
|
|
if (key.optional && !params[key.name]) delete params[key.name];
|
|
});
|
|
}
|
|
} else {
|
|
matcher2 = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path));
|
|
if (!matcher2) throw createRouterError(1, {
|
|
location: location2,
|
|
currentLocation
|
|
});
|
|
name = matcher2.record.name;
|
|
params = assign({}, currentLocation.params, location2.params);
|
|
path = matcher2.stringify(params);
|
|
}
|
|
const matched = [];
|
|
let parentMatcher = matcher2;
|
|
while (parentMatcher) {
|
|
matched.unshift(parentMatcher.record);
|
|
parentMatcher = parentMatcher.parent;
|
|
}
|
|
return {
|
|
name,
|
|
path,
|
|
params,
|
|
matched,
|
|
meta: mergeMetaFields(matched)
|
|
};
|
|
}
|
|
routes.forEach((route) => addRoute(route));
|
|
function clearRoutes() {
|
|
matchers.length = 0;
|
|
matcherMap.clear();
|
|
}
|
|
return {
|
|
addRoute,
|
|
resolve,
|
|
removeRoute,
|
|
clearRoutes,
|
|
getRoutes,
|
|
getRecordMatcher
|
|
};
|
|
}
|
|
function pickParams(params, keys) {
|
|
const newParams = {};
|
|
for (const key of keys) if (key in params) newParams[key] = params[key];
|
|
return newParams;
|
|
}
|
|
function normalizeRouteRecord(record) {
|
|
const normalized = {
|
|
path: record.path,
|
|
redirect: record.redirect,
|
|
name: record.name,
|
|
meta: record.meta || {},
|
|
aliasOf: record.aliasOf,
|
|
beforeEnter: record.beforeEnter,
|
|
props: normalizeRecordProps(record),
|
|
children: record.children || [],
|
|
instances: {},
|
|
leaveGuards: /* @__PURE__ */ new Set(),
|
|
updateGuards: /* @__PURE__ */ new Set(),
|
|
enterCallbacks: {},
|
|
components: "components" in record ? record.components || null : record.component && { default: record.component }
|
|
};
|
|
Object.defineProperty(normalized, "mods", { value: {} });
|
|
return normalized;
|
|
}
|
|
function normalizeRecordProps(record) {
|
|
const propsObject = {};
|
|
const props = record.props || false;
|
|
if ("component" in record) propsObject.default = props;
|
|
else for (const name in record.components) propsObject[name] = typeof props === "object" ? props[name] : props;
|
|
return propsObject;
|
|
}
|
|
function isAliasRecord(record) {
|
|
while (record) {
|
|
if (record.record.aliasOf) return true;
|
|
record = record.parent;
|
|
}
|
|
return false;
|
|
}
|
|
function mergeMetaFields(matched) {
|
|
return matched.reduce((meta, record) => assign(meta, record.meta), {});
|
|
}
|
|
function findInsertionIndex(matcher2, matchers) {
|
|
let lower = 0;
|
|
let upper = matchers.length;
|
|
while (lower !== upper) {
|
|
const mid = lower + upper >> 1;
|
|
if (comparePathParserScore(matcher2, matchers[mid]) < 0) upper = mid;
|
|
else lower = mid + 1;
|
|
}
|
|
const insertionAncestor = getInsertionAncestor(matcher2);
|
|
if (insertionAncestor) {
|
|
upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
|
|
}
|
|
return upper;
|
|
}
|
|
function getInsertionAncestor(matcher2) {
|
|
let ancestor = matcher2;
|
|
while (ancestor = ancestor.parent) if (isMatchable(ancestor) && comparePathParserScore(matcher2, ancestor) === 0) return ancestor;
|
|
}
|
|
function isMatchable({ record }) {
|
|
return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
|
|
}
|
|
function useLink(props) {
|
|
const router = inject(routerKey);
|
|
const currentRoute = inject(routeLocationKey);
|
|
const route = computed(() => {
|
|
const to = unref(props.to);
|
|
return router.resolve(to);
|
|
});
|
|
const activeRecordIndex = computed(() => {
|
|
const { matched } = route.value;
|
|
const { length } = matched;
|
|
const routeMatched = matched[length - 1];
|
|
const currentMatched = currentRoute.matched;
|
|
if (!routeMatched || !currentMatched.length) return -1;
|
|
const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
|
|
if (index > -1) return index;
|
|
const parentRecordPath = getOriginalPath(matched[length - 2]);
|
|
return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
|
|
});
|
|
const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
|
|
const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
|
|
function navigate(e = {}) {
|
|
if (guardEvent(e)) {
|
|
const p = router[unref(props.replace) ? "replace" : "push"](unref(props.to)).catch(noop);
|
|
if (props.viewTransition && false) ;
|
|
return p;
|
|
}
|
|
return Promise.resolve();
|
|
}
|
|
return {
|
|
route,
|
|
href: computed(() => route.value.href),
|
|
isActive,
|
|
isExactActive,
|
|
navigate
|
|
};
|
|
}
|
|
function preferSingleVNode(vnodes) {
|
|
return vnodes.length === 1 ? vnodes[0] : vnodes;
|
|
}
|
|
const RouterLink = /* @__PURE__ */ defineComponent({
|
|
name: "RouterLink",
|
|
compatConfig: { MODE: 3 },
|
|
props: {
|
|
to: {
|
|
type: [String, Object],
|
|
required: true
|
|
},
|
|
replace: Boolean,
|
|
activeClass: String,
|
|
exactActiveClass: String,
|
|
custom: Boolean,
|
|
ariaCurrentValue: {
|
|
type: String,
|
|
default: "page"
|
|
},
|
|
viewTransition: Boolean
|
|
},
|
|
useLink,
|
|
setup(props, { slots }) {
|
|
const link = reactive(useLink(props));
|
|
const { options } = inject(routerKey);
|
|
const elClass = computed(() => ({
|
|
[getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
|
|
[getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
|
|
}));
|
|
return () => {
|
|
const children = slots.default && preferSingleVNode(slots.default(link));
|
|
return props.custom ? children : h("a", {
|
|
"aria-current": link.isExactActive ? props.ariaCurrentValue : null,
|
|
href: link.href,
|
|
onClick: link.navigate,
|
|
class: elClass.value
|
|
}, children);
|
|
};
|
|
}
|
|
});
|
|
function guardEvent(e) {
|
|
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
|
|
if (e.defaultPrevented) return;
|
|
if (e.button !== void 0 && e.button !== 0) return;
|
|
if (e.currentTarget && e.currentTarget.getAttribute) {
|
|
const target = e.currentTarget.getAttribute("target");
|
|
if (/\b_blank\b/i.test(target)) return;
|
|
}
|
|
if (e.preventDefault) e.preventDefault();
|
|
return true;
|
|
}
|
|
function includesParams(outer, inner) {
|
|
for (const key in inner) {
|
|
const innerValue = inner[key];
|
|
const outerValue = outer[key];
|
|
if (typeof innerValue === "string") {
|
|
if (innerValue !== outerValue) return false;
|
|
} else if (!isArray(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value.valueOf() !== outerValue[i].valueOf())) return false;
|
|
}
|
|
return true;
|
|
}
|
|
function getOriginalPath(record) {
|
|
return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
|
|
}
|
|
const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
|
|
const RouterViewImpl = /* @__PURE__ */ defineComponent({
|
|
name: "RouterView",
|
|
inheritAttrs: false,
|
|
props: {
|
|
name: {
|
|
type: String,
|
|
default: "default"
|
|
},
|
|
route: Object
|
|
},
|
|
compatConfig: { MODE: 3 },
|
|
setup(props, { attrs, slots }) {
|
|
const injectedRoute = inject(routerViewLocationKey);
|
|
const routeToDisplay = computed(() => props.route || injectedRoute.value);
|
|
const injectedDepth = inject(viewDepthKey, 0);
|
|
const depth = computed(() => {
|
|
let initialDepth = unref(injectedDepth);
|
|
const { matched } = routeToDisplay.value;
|
|
let matchedRoute;
|
|
while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) initialDepth++;
|
|
return initialDepth;
|
|
});
|
|
const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
|
|
provide(viewDepthKey, computed(() => depth.value + 1));
|
|
provide(matchedRouteKey, matchedRouteRef);
|
|
provide(routerViewLocationKey, routeToDisplay);
|
|
const viewRef = ref();
|
|
watch(() => [
|
|
viewRef.value,
|
|
matchedRouteRef.value,
|
|
props.name
|
|
], ([instance, to, name], [oldInstance, from, _oldName]) => {
|
|
if (to) {
|
|
to.instances[name] = instance;
|
|
if (from && from !== to && instance && instance === oldInstance) {
|
|
if (!to.leaveGuards.size) to.leaveGuards = from.leaveGuards;
|
|
if (!to.updateGuards.size) to.updateGuards = from.updateGuards;
|
|
}
|
|
}
|
|
if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
|
|
}, { flush: "post" });
|
|
return () => {
|
|
const route = routeToDisplay.value;
|
|
const currentName = props.name;
|
|
const matchedRoute = matchedRouteRef.value;
|
|
const ViewComponent = matchedRoute && matchedRoute.components[currentName];
|
|
if (!ViewComponent) return normalizeSlot$1(slots.default, {
|
|
Component: ViewComponent,
|
|
route
|
|
});
|
|
const routePropsOption = matchedRoute.props[currentName];
|
|
const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
|
|
const onVnodeUnmounted = (vnode) => {
|
|
if (vnode.component.isUnmounted) matchedRoute.instances[currentName] = null;
|
|
};
|
|
const component = h(ViewComponent, assign({}, routeProps, attrs, {
|
|
onVnodeUnmounted,
|
|
ref: viewRef
|
|
}));
|
|
return normalizeSlot$1(slots.default, {
|
|
Component: component,
|
|
route
|
|
}) || component;
|
|
};
|
|
}
|
|
});
|
|
function normalizeSlot$1(slot, data) {
|
|
if (!slot) return null;
|
|
const slotContent = slot(data);
|
|
return slotContent.length === 1 ? slotContent[0] : slotContent;
|
|
}
|
|
const RouterView = RouterViewImpl;
|
|
function createRouter(options) {
|
|
const matcher2 = createRouterMatcher(options.routes, options);
|
|
const parseQuery$1 = options.parseQuery || parseQuery;
|
|
const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
|
|
const routerHistory = options.history;
|
|
const beforeGuards = useCallbacks();
|
|
const beforeResolveGuards = useCallbacks();
|
|
const afterGuards = useCallbacks();
|
|
const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
|
|
let pendingLocation = START_LOCATION_NORMALIZED;
|
|
const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
|
|
const encodeParams = applyToParams.bind(null, encodeParam);
|
|
const decodeParams = applyToParams.bind(null, decode);
|
|
function addRoute(parentOrRoute, route) {
|
|
let parent;
|
|
let record;
|
|
if (isRouteName(parentOrRoute)) {
|
|
parent = matcher2.getRecordMatcher(parentOrRoute);
|
|
record = route;
|
|
} else record = parentOrRoute;
|
|
return matcher2.addRoute(record, parent);
|
|
}
|
|
function removeRoute(name) {
|
|
const recordMatcher = matcher2.getRecordMatcher(name);
|
|
if (recordMatcher) matcher2.removeRoute(recordMatcher);
|
|
}
|
|
function getRoutes() {
|
|
return matcher2.getRoutes().map((routeMatcher) => routeMatcher.record);
|
|
}
|
|
function hasRoute(name) {
|
|
return !!matcher2.getRecordMatcher(name);
|
|
}
|
|
function resolve(rawLocation, currentLocation) {
|
|
currentLocation = assign({}, currentLocation || currentRoute.value);
|
|
if (typeof rawLocation === "string") {
|
|
const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
|
|
const matchedRoute2 = matcher2.resolve({ path: locationNormalized.path }, currentLocation);
|
|
const href2 = routerHistory.createHref(locationNormalized.fullPath);
|
|
return assign(locationNormalized, matchedRoute2, {
|
|
params: decodeParams(matchedRoute2.params),
|
|
redirectedFrom: void 0,
|
|
href: href2
|
|
});
|
|
}
|
|
let matcherLocation;
|
|
if (rawLocation.path != null) {
|
|
matcherLocation = assign({}, rawLocation, { path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path });
|
|
} else {
|
|
const targetParams = assign({}, rawLocation.params);
|
|
for (const key in targetParams) if (targetParams[key] == null) delete targetParams[key];
|
|
matcherLocation = assign({}, rawLocation, { params: encodeParams(targetParams) });
|
|
currentLocation.params = encodeParams(currentLocation.params);
|
|
}
|
|
const matchedRoute = matcher2.resolve(matcherLocation, currentLocation);
|
|
const hash2 = rawLocation.hash || "";
|
|
matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
|
|
const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
|
|
hash: encodeHash(hash2),
|
|
path: matchedRoute.path
|
|
}));
|
|
const href = routerHistory.createHref(fullPath);
|
|
return assign({
|
|
fullPath,
|
|
hash: hash2,
|
|
query: stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
|
|
}, matchedRoute, {
|
|
redirectedFrom: void 0,
|
|
href
|
|
});
|
|
}
|
|
function locationAsObject(to) {
|
|
return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign({}, to);
|
|
}
|
|
function checkCanceledNavigation(to, from) {
|
|
if (pendingLocation !== to) return createRouterError(8, {
|
|
from,
|
|
to
|
|
});
|
|
}
|
|
function push(to) {
|
|
return pushWithRedirect(to);
|
|
}
|
|
function replace(to) {
|
|
return push(assign(locationAsObject(to), { replace: true }));
|
|
}
|
|
function handleRedirectRecord(to, from) {
|
|
const lastMatched = to.matched[to.matched.length - 1];
|
|
if (lastMatched && lastMatched.redirect) {
|
|
const { redirect } = lastMatched;
|
|
let newTargetLocation = typeof redirect === "function" ? redirect(to, from) : redirect;
|
|
if (typeof newTargetLocation === "string") {
|
|
newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
|
|
newTargetLocation.params = {};
|
|
}
|
|
return assign({
|
|
query: to.query,
|
|
hash: to.hash,
|
|
params: newTargetLocation.path != null ? {} : to.params
|
|
}, newTargetLocation);
|
|
}
|
|
}
|
|
function pushWithRedirect(to, redirectedFrom) {
|
|
const targetLocation = pendingLocation = resolve(to);
|
|
const from = currentRoute.value;
|
|
const data = to.state;
|
|
const force = to.force;
|
|
const replace2 = to.replace === true;
|
|
const shouldRedirect = handleRedirectRecord(targetLocation, from);
|
|
if (shouldRedirect) return pushWithRedirect(assign(locationAsObject(shouldRedirect), {
|
|
state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
|
|
force,
|
|
replace: replace2
|
|
}), redirectedFrom || targetLocation);
|
|
const toLocation = targetLocation;
|
|
toLocation.redirectedFrom = redirectedFrom;
|
|
let failure;
|
|
if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
|
|
failure = createRouterError(16, {
|
|
to: toLocation,
|
|
from
|
|
});
|
|
handleScroll();
|
|
}
|
|
return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, 2) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure2) => {
|
|
if (failure2) {
|
|
if (isNavigationFailure(failure2, 2)) {
|
|
return pushWithRedirect(assign({ replace: replace2 }, locationAsObject(failure2.to), {
|
|
state: typeof failure2.to === "object" ? assign({}, data, failure2.to.state) : data,
|
|
force
|
|
}), redirectedFrom || toLocation);
|
|
}
|
|
} else failure2 = finalizeNavigation(toLocation, from, true, replace2, data);
|
|
triggerAfterEach(toLocation, from, failure2);
|
|
return failure2;
|
|
});
|
|
}
|
|
function checkCanceledNavigationAndReject(to, from) {
|
|
const error = checkCanceledNavigation(to, from);
|
|
return error ? Promise.reject(error) : Promise.resolve();
|
|
}
|
|
function runWithContext(fn) {
|
|
const app = installedApps.values().next().value;
|
|
return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
|
|
}
|
|
function navigate(to, from) {
|
|
let guards;
|
|
const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
|
|
guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
|
|
for (const record of leavingRecords) record.leaveGuards.forEach((guard) => {
|
|
guards.push(guardToPromiseFn(guard, to, from));
|
|
});
|
|
const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
|
|
guards.push(canceledNavigationCheck);
|
|
return runGuardQueue(guards).then(() => {
|
|
guards = [];
|
|
for (const guard of beforeGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
|
|
guards.push(canceledNavigationCheck);
|
|
return runGuardQueue(guards);
|
|
}).then(() => {
|
|
guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
|
|
for (const record of updatingRecords) record.updateGuards.forEach((guard) => {
|
|
guards.push(guardToPromiseFn(guard, to, from));
|
|
});
|
|
guards.push(canceledNavigationCheck);
|
|
return runGuardQueue(guards);
|
|
}).then(() => {
|
|
guards = [];
|
|
for (const record of enteringRecords) if (record.beforeEnter) if (isArray(record.beforeEnter)) for (const beforeEnter of record.beforeEnter) guards.push(guardToPromiseFn(beforeEnter, to, from));
|
|
else guards.push(guardToPromiseFn(record.beforeEnter, to, from));
|
|
guards.push(canceledNavigationCheck);
|
|
return runGuardQueue(guards);
|
|
}).then(() => {
|
|
to.matched.forEach((record) => record.enterCallbacks = {});
|
|
guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
|
|
guards.push(canceledNavigationCheck);
|
|
return runGuardQueue(guards);
|
|
}).then(() => {
|
|
guards = [];
|
|
for (const guard of beforeResolveGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
|
|
guards.push(canceledNavigationCheck);
|
|
return runGuardQueue(guards);
|
|
}).catch((err) => isNavigationFailure(err, 8) ? err : Promise.reject(err));
|
|
}
|
|
function triggerAfterEach(to, from, failure) {
|
|
afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
|
|
}
|
|
function finalizeNavigation(toLocation, from, isPush, replace2, data) {
|
|
const error = checkCanceledNavigation(toLocation, from);
|
|
if (error) return error;
|
|
const isFirstNavigation = from === START_LOCATION_NORMALIZED;
|
|
const state = {};
|
|
if (isPush) if (replace2 || isFirstNavigation) routerHistory.replace(toLocation.fullPath, assign({ scroll: isFirstNavigation && state && state.scroll }, data));
|
|
else routerHistory.push(toLocation.fullPath, data);
|
|
currentRoute.value = toLocation;
|
|
handleScroll();
|
|
markAsReady();
|
|
}
|
|
let removeHistoryListener;
|
|
function setupListeners() {
|
|
if (removeHistoryListener) return;
|
|
removeHistoryListener = routerHistory.listen((to, _from, info) => {
|
|
if (!router.listening) return;
|
|
const toLocation = resolve(to);
|
|
const shouldRedirect = handleRedirectRecord(toLocation, router.currentRoute.value);
|
|
if (shouldRedirect) {
|
|
pushWithRedirect(assign(shouldRedirect, {
|
|
replace: true,
|
|
force: true
|
|
}), toLocation).catch(noop);
|
|
return;
|
|
}
|
|
pendingLocation = toLocation;
|
|
const from = currentRoute.value;
|
|
navigate(toLocation, from).catch((error) => {
|
|
if (isNavigationFailure(error, 12)) return error;
|
|
if (isNavigationFailure(error, 2)) {
|
|
pushWithRedirect(assign(locationAsObject(error.to), { force: true }), toLocation).then((failure) => {
|
|
if (isNavigationFailure(failure, 20) && !info.delta && info.type === "pop") routerHistory.go(-1, false);
|
|
}).catch(noop);
|
|
return Promise.reject();
|
|
}
|
|
if (info.delta) routerHistory.go(-info.delta, false);
|
|
return triggerError(error, toLocation, from);
|
|
}).then((failure) => {
|
|
failure = failure || finalizeNavigation(toLocation, from, false);
|
|
if (failure) {
|
|
if (info.delta && !isNavigationFailure(failure, 8)) routerHistory.go(-info.delta, false);
|
|
else if (info.type === "pop" && isNavigationFailure(failure, 20)) routerHistory.go(-1, false);
|
|
}
|
|
triggerAfterEach(toLocation, from, failure);
|
|
}).catch(noop);
|
|
});
|
|
}
|
|
let readyHandlers = useCallbacks();
|
|
let errorListeners = useCallbacks();
|
|
let ready;
|
|
function triggerError(error, to, from) {
|
|
markAsReady(error);
|
|
const list = errorListeners.list();
|
|
if (list.length) list.forEach((handler) => handler(error, to, from));
|
|
else {
|
|
console.error(error);
|
|
}
|
|
return Promise.reject(error);
|
|
}
|
|
function isReady() {
|
|
if (ready && currentRoute.value !== START_LOCATION_NORMALIZED) return Promise.resolve();
|
|
return new Promise((resolve2, reject) => {
|
|
readyHandlers.add([resolve2, reject]);
|
|
});
|
|
}
|
|
function markAsReady(err) {
|
|
if (!ready) {
|
|
ready = !err;
|
|
setupListeners();
|
|
readyHandlers.list().forEach(([resolve2, reject]) => err ? reject(err) : resolve2());
|
|
readyHandlers.reset();
|
|
}
|
|
return err;
|
|
}
|
|
function handleScroll(to, from, isPush, isFirstNavigation) {
|
|
const { scrollBehavior } = options;
|
|
return Promise.resolve();
|
|
}
|
|
const go = (delta) => routerHistory.go(delta);
|
|
const installedApps = /* @__PURE__ */ new Set();
|
|
const router = {
|
|
currentRoute,
|
|
listening: true,
|
|
addRoute,
|
|
removeRoute,
|
|
clearRoutes: matcher2.clearRoutes,
|
|
hasRoute,
|
|
getRoutes,
|
|
resolve,
|
|
options,
|
|
push,
|
|
replace,
|
|
go,
|
|
back: () => go(-1),
|
|
forward: () => go(1),
|
|
beforeEach: beforeGuards.add,
|
|
beforeResolve: beforeResolveGuards.add,
|
|
afterEach: afterGuards.add,
|
|
onError: errorListeners.add,
|
|
isReady,
|
|
install(app) {
|
|
app.component("RouterLink", RouterLink);
|
|
app.component("RouterView", RouterView);
|
|
app.config.globalProperties.$router = router;
|
|
Object.defineProperty(app.config.globalProperties, "$route", {
|
|
enumerable: true,
|
|
get: () => unref(currentRoute)
|
|
});
|
|
const reactiveRoute = {};
|
|
for (const key in START_LOCATION_NORMALIZED) Object.defineProperty(reactiveRoute, key, {
|
|
get: () => currentRoute.value[key],
|
|
enumerable: true
|
|
});
|
|
app.provide(routerKey, router);
|
|
app.provide(routeLocationKey, shallowReactive(reactiveRoute));
|
|
app.provide(routerViewLocationKey, currentRoute);
|
|
const unmountApp = app.unmount;
|
|
installedApps.add(app);
|
|
app.unmount = function() {
|
|
installedApps.delete(app);
|
|
if (installedApps.size < 1) {
|
|
pendingLocation = START_LOCATION_NORMALIZED;
|
|
removeHistoryListener && removeHistoryListener();
|
|
removeHistoryListener = null;
|
|
currentRoute.value = START_LOCATION_NORMALIZED;
|
|
ready = false;
|
|
}
|
|
unmountApp();
|
|
};
|
|
}
|
|
};
|
|
function runGuardQueue(guards) {
|
|
return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
|
|
}
|
|
return router;
|
|
}
|
|
global.__VUE_PROD_DEVTOOLS__ = false;
|
|
function toArray$1(value) {
|
|
return Array.isArray(value) ? value : [value];
|
|
}
|
|
const __nuxt_page_meta$p = { title: "应用详情" };
|
|
const __nuxt_page_meta$o = { title: "后台账号" };
|
|
const __nuxt_page_meta$n = { title: "Agent 配置" };
|
|
const __nuxt_page_meta$m = { title: "应用环境配置" };
|
|
const __nuxt_page_meta$l = { title: "应用中心" };
|
|
const __nuxt_page_meta$k = { title: "通话翻译规则" };
|
|
const __nuxt_page_meta$j = { title: "渠道分发" };
|
|
const __nuxt_page_meta$i = { title: "公码管理" };
|
|
const __nuxt_page_meta$h = { title: "数据概览" };
|
|
const __nuxt_page_meta$g = { title: "渠道商管理" };
|
|
const __nuxt_page_meta$f = { title: "生产管理" };
|
|
const __nuxt_page_meta$e = { title: "环境节点" };
|
|
const __nuxt_page_meta$d = { title: "品牌商管理" };
|
|
const __nuxt_page_meta$c = { title: "全局环境配置" };
|
|
const __nuxt_page_meta$b = { title: "MCP配置" };
|
|
const __nuxt_page_meta$a = { title: "会议记录服务" };
|
|
const __nuxt_page_meta$9 = { title: "会议模板" };
|
|
const __nuxt_page_meta$8 = { title: "产品管理" };
|
|
const __nuxt_page_meta$7 = { title: "方案商管理" };
|
|
const __nuxt_page_meta$6 = { title: "第三方服务配置" };
|
|
const __nuxt_page_meta$5 = { title: "月结算" };
|
|
const __nuxt_page_meta$4 = { title: "统计日志" };
|
|
const __nuxt_page_meta$3 = { title: "服务巡检" };
|
|
const __nuxt_page_meta$2 = { title: "系统配置" };
|
|
const __nuxt_page_meta$1 = { title: "用户查询" };
|
|
const __nuxt_page_meta = { layout: "auth" };
|
|
const _routes = [
|
|
{
|
|
name: "apps-name",
|
|
path: "/apps/:name()",
|
|
meta: __nuxt_page_meta$p || {},
|
|
component: () => import('./_name_-CJXf25S4.mjs')
|
|
},
|
|
{
|
|
name: "accounts",
|
|
path: "/accounts",
|
|
meta: __nuxt_page_meta$o || {},
|
|
component: () => import('./accounts-CM5YEJ4p.mjs')
|
|
},
|
|
{
|
|
name: "agents",
|
|
path: "/agents",
|
|
meta: __nuxt_page_meta$n || {},
|
|
component: () => import('./agents-Bh_gLb1p.mjs')
|
|
},
|
|
{
|
|
name: "appconfig",
|
|
path: "/appconfig",
|
|
meta: __nuxt_page_meta$m || {},
|
|
component: () => import('./appconfig-Dq0Q9K6-.mjs')
|
|
},
|
|
{
|
|
name: "apps",
|
|
path: "/apps",
|
|
meta: __nuxt_page_meta$l || {},
|
|
component: () => import('./index-Cw3MwhTM.mjs')
|
|
},
|
|
{
|
|
name: "calltranslate",
|
|
path: "/calltranslate",
|
|
meta: __nuxt_page_meta$k || {},
|
|
component: () => import('./calltranslate-Typ2E2m-.mjs')
|
|
},
|
|
{
|
|
name: "channels",
|
|
path: "/channels",
|
|
meta: __nuxt_page_meta$j || {},
|
|
component: () => import('./channels-CtM7-nvg.mjs')
|
|
},
|
|
{
|
|
name: "code",
|
|
path: "/code",
|
|
meta: __nuxt_page_meta$i || {},
|
|
component: () => import('./code-CRw9P5-W.mjs')
|
|
},
|
|
{
|
|
name: "dashboard",
|
|
path: "/dashboard",
|
|
meta: __nuxt_page_meta$h || {},
|
|
component: () => import('./dashboard-Y8255DFm.mjs')
|
|
},
|
|
{
|
|
name: "dealers",
|
|
path: "/dealers",
|
|
meta: __nuxt_page_meta$g || {},
|
|
component: () => import('./dealers-CyBvzjOe.mjs')
|
|
},
|
|
{
|
|
name: "device",
|
|
path: "/device",
|
|
meta: __nuxt_page_meta$f || {},
|
|
component: () => import('./device-DzDhira5.mjs')
|
|
},
|
|
{
|
|
name: "environments",
|
|
path: "/environments",
|
|
meta: __nuxt_page_meta$e || {},
|
|
component: () => import('./environments-QEPY5dAu.mjs')
|
|
},
|
|
{
|
|
name: "factory",
|
|
path: "/factory",
|
|
meta: __nuxt_page_meta$d || {},
|
|
component: () => import('./factory-CAOmR9O2.mjs')
|
|
},
|
|
{
|
|
name: "globalconfig",
|
|
path: "/globalconfig",
|
|
meta: __nuxt_page_meta$c || {},
|
|
component: () => import('./globalconfig-D9vjrc_H.mjs')
|
|
},
|
|
{
|
|
name: "mcpconfig",
|
|
path: "/mcpconfig",
|
|
meta: __nuxt_page_meta$b || {},
|
|
component: () => import('./mcpconfig-O3oMJUPy.mjs')
|
|
},
|
|
{
|
|
name: "meetingsvc",
|
|
path: "/meetingsvc",
|
|
meta: __nuxt_page_meta$a || {},
|
|
component: () => import('./meetingsvc-b8C1HNnF.mjs')
|
|
},
|
|
{
|
|
name: "meettemplates",
|
|
path: "/meettemplates",
|
|
meta: __nuxt_page_meta$9 || {},
|
|
component: () => import('./meettemplates-BbY84yBS.mjs')
|
|
},
|
|
{
|
|
name: "product",
|
|
path: "/product",
|
|
meta: __nuxt_page_meta$8 || {},
|
|
component: () => import('./product-3h7bsXRI.mjs')
|
|
},
|
|
{
|
|
name: "provider",
|
|
path: "/provider",
|
|
meta: __nuxt_page_meta$7 || {},
|
|
component: () => import('./provider-Bj1O177I.mjs')
|
|
},
|
|
{
|
|
name: "serviceconfig",
|
|
path: "/serviceconfig",
|
|
meta: __nuxt_page_meta$6 || {},
|
|
component: () => import('./serviceconfig-Bq9We0Qx.mjs')
|
|
},
|
|
{
|
|
name: "settlements",
|
|
path: "/settlements",
|
|
meta: __nuxt_page_meta$5 || {},
|
|
component: () => import('./settlements-36wv6bGk.mjs')
|
|
},
|
|
{
|
|
name: "statlog",
|
|
path: "/statlog",
|
|
meta: __nuxt_page_meta$4 || {},
|
|
component: () => import('./statlog-DSsJqAJ8.mjs')
|
|
},
|
|
{
|
|
name: "svcinspect",
|
|
path: "/svcinspect",
|
|
meta: __nuxt_page_meta$3 || {},
|
|
component: () => import('./svcinspect-SxEuc7fa.mjs')
|
|
},
|
|
{
|
|
name: "systemconfig",
|
|
path: "/systemconfig",
|
|
meta: __nuxt_page_meta$2 || {},
|
|
component: () => import('./systemconfig-CCKY3oG5.mjs')
|
|
},
|
|
{
|
|
name: "users",
|
|
path: "/users",
|
|
meta: __nuxt_page_meta$1 || {},
|
|
component: () => import('./users-DFJVwKVk.mjs')
|
|
},
|
|
{
|
|
name: "index",
|
|
path: "/",
|
|
meta: __nuxt_page_meta || {},
|
|
component: () => import('./index-rLRSPmKW.mjs')
|
|
}
|
|
];
|
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
var shared_cjs_prod = {};
|
|
var hasRequiredShared_cjs_prod;
|
|
function requireShared_cjs_prod() {
|
|
if (hasRequiredShared_cjs_prod) return shared_cjs_prod;
|
|
hasRequiredShared_cjs_prod = 1;
|
|
Object.defineProperty(shared_cjs_prod, "__esModule", { value: true });
|
|
// @__NO_SIDE_EFFECTS__
|
|
function makeMap(str) {
|
|
const map = /* @__PURE__ */ Object.create(null);
|
|
for (const key of str.split(",")) map[key] = 1;
|
|
return (val) => val in map;
|
|
}
|
|
const EMPTY_OBJ = {};
|
|
const EMPTY_ARR = [];
|
|
const NOOP = () => {
|
|
};
|
|
const NO = () => false;
|
|
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
|
|
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
|
|
const isModelListener = (key) => key.startsWith("onUpdate:");
|
|
const extend = Object.assign;
|
|
const remove = (arr, el) => {
|
|
const i = arr.indexOf(el);
|
|
if (i > -1) {
|
|
arr.splice(i, 1);
|
|
}
|
|
};
|
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
const isArray2 = Array.isArray;
|
|
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
const isDate = (val) => toTypeString(val) === "[object Date]";
|
|
const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
|
|
const isFunction = (val) => typeof val === "function";
|
|
const isString = (val) => typeof val === "string";
|
|
const isSymbol = (val) => typeof val === "symbol";
|
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
const isPromise = (val) => {
|
|
return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
|
|
};
|
|
const objectToString = Object.prototype.toString;
|
|
const toTypeString = (value) => objectToString.call(value);
|
|
const toRawType = (value) => {
|
|
return toTypeString(value).slice(8, -1);
|
|
};
|
|
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
const isReservedProp = /* @__PURE__ */ makeMap(
|
|
// the leading comma is intentional so empty string "" is also included
|
|
",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
|
|
);
|
|
const isBuiltInDirective = /* @__PURE__ */ makeMap(
|
|
"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
|
|
);
|
|
const cacheStringFunction = (fn) => {
|
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
return ((str) => {
|
|
const hit = cache[str];
|
|
return hit || (cache[str] = fn(str));
|
|
});
|
|
};
|
|
const camelizeRE = /-\w/g;
|
|
const camelize = cacheStringFunction(
|
|
(str) => {
|
|
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
|
}
|
|
);
|
|
const hyphenateRE = /\B([A-Z])/g;
|
|
const hyphenate = cacheStringFunction(
|
|
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
|
);
|
|
const capitalize = cacheStringFunction((str) => {
|
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
});
|
|
const toHandlerKey = cacheStringFunction(
|
|
(str) => {
|
|
const s = str ? `on${capitalize(str)}` : ``;
|
|
return s;
|
|
}
|
|
);
|
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
const invokeArrayFns = (fns, ...arg) => {
|
|
for (let i = 0; i < fns.length; i++) {
|
|
fns[i](...arg);
|
|
}
|
|
};
|
|
const def = (obj, key, value, writable = false) => {
|
|
Object.defineProperty(obj, key, {
|
|
configurable: true,
|
|
enumerable: false,
|
|
writable,
|
|
value
|
|
});
|
|
};
|
|
const looseToNumber = (val) => {
|
|
const n = parseFloat(val);
|
|
return isNaN(n) ? val : n;
|
|
};
|
|
const toNumber = (val) => {
|
|
const n = isString(val) ? Number(val) : NaN;
|
|
return isNaN(n) ? val : n;
|
|
};
|
|
let _globalThis;
|
|
const getGlobalThis = () => {
|
|
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : {});
|
|
};
|
|
const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
|
|
function genPropsAccessExp(name) {
|
|
return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
|
|
}
|
|
function genCacheKey(source, options) {
|
|
return source + JSON.stringify(
|
|
options,
|
|
(_, val) => typeof val === "function" ? val.toString() : val
|
|
);
|
|
}
|
|
const PatchFlags = {
|
|
"TEXT": 1,
|
|
"1": "TEXT",
|
|
"CLASS": 2,
|
|
"2": "CLASS",
|
|
"STYLE": 4,
|
|
"4": "STYLE",
|
|
"PROPS": 8,
|
|
"8": "PROPS",
|
|
"FULL_PROPS": 16,
|
|
"16": "FULL_PROPS",
|
|
"NEED_HYDRATION": 32,
|
|
"32": "NEED_HYDRATION",
|
|
"STABLE_FRAGMENT": 64,
|
|
"64": "STABLE_FRAGMENT",
|
|
"KEYED_FRAGMENT": 128,
|
|
"128": "KEYED_FRAGMENT",
|
|
"UNKEYED_FRAGMENT": 256,
|
|
"256": "UNKEYED_FRAGMENT",
|
|
"NEED_PATCH": 512,
|
|
"512": "NEED_PATCH",
|
|
"DYNAMIC_SLOTS": 1024,
|
|
"1024": "DYNAMIC_SLOTS",
|
|
"DEV_ROOT_FRAGMENT": 2048,
|
|
"2048": "DEV_ROOT_FRAGMENT",
|
|
"CACHED": -1,
|
|
"-1": "CACHED",
|
|
"BAIL": -2,
|
|
"-2": "BAIL"
|
|
};
|
|
const PatchFlagNames = {
|
|
[1]: `TEXT`,
|
|
[2]: `CLASS`,
|
|
[4]: `STYLE`,
|
|
[8]: `PROPS`,
|
|
[16]: `FULL_PROPS`,
|
|
[32]: `NEED_HYDRATION`,
|
|
[64]: `STABLE_FRAGMENT`,
|
|
[128]: `KEYED_FRAGMENT`,
|
|
[256]: `UNKEYED_FRAGMENT`,
|
|
[512]: `NEED_PATCH`,
|
|
[1024]: `DYNAMIC_SLOTS`,
|
|
[2048]: `DEV_ROOT_FRAGMENT`,
|
|
[-1]: `CACHED`,
|
|
[-2]: `BAIL`
|
|
};
|
|
const ShapeFlags = {
|
|
"ELEMENT": 1,
|
|
"1": "ELEMENT",
|
|
"FUNCTIONAL_COMPONENT": 2,
|
|
"2": "FUNCTIONAL_COMPONENT",
|
|
"STATEFUL_COMPONENT": 4,
|
|
"4": "STATEFUL_COMPONENT",
|
|
"TEXT_CHILDREN": 8,
|
|
"8": "TEXT_CHILDREN",
|
|
"ARRAY_CHILDREN": 16,
|
|
"16": "ARRAY_CHILDREN",
|
|
"SLOTS_CHILDREN": 32,
|
|
"32": "SLOTS_CHILDREN",
|
|
"TELEPORT": 64,
|
|
"64": "TELEPORT",
|
|
"SUSPENSE": 128,
|
|
"128": "SUSPENSE",
|
|
"COMPONENT_SHOULD_KEEP_ALIVE": 256,
|
|
"256": "COMPONENT_SHOULD_KEEP_ALIVE",
|
|
"COMPONENT_KEPT_ALIVE": 512,
|
|
"512": "COMPONENT_KEPT_ALIVE",
|
|
"COMPONENT": 6,
|
|
"6": "COMPONENT"
|
|
};
|
|
const SlotFlags = {
|
|
"STABLE": 1,
|
|
"1": "STABLE",
|
|
"DYNAMIC": 2,
|
|
"2": "DYNAMIC",
|
|
"FORWARDED": 3,
|
|
"3": "FORWARDED"
|
|
};
|
|
const slotFlagsText = {
|
|
[1]: "STABLE",
|
|
[2]: "DYNAMIC",
|
|
[3]: "FORWARDED"
|
|
};
|
|
const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol";
|
|
const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
|
|
const isGloballyWhitelisted = isGloballyAllowed;
|
|
const range = 2;
|
|
function generateCodeFrame(source, start = 0, end = source.length) {
|
|
start = Math.max(0, Math.min(start, source.length));
|
|
end = Math.max(0, Math.min(end, source.length));
|
|
if (start > end) return "";
|
|
let lines = source.split(/(\r?\n)/);
|
|
const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
|
|
lines = lines.filter((_, idx) => idx % 2 === 0);
|
|
let count = 0;
|
|
const res = [];
|
|
for (let i = 0; i < lines.length; i++) {
|
|
count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
|
|
if (count >= start) {
|
|
for (let j = i - range; j <= i + range || end > count; j++) {
|
|
if (j < 0 || j >= lines.length) continue;
|
|
const line = j + 1;
|
|
res.push(
|
|
`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
|
|
);
|
|
const lineLength = lines[j].length;
|
|
const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
|
|
if (j === i) {
|
|
const pad = start - (count - (lineLength + newLineSeqLength));
|
|
const length = Math.max(
|
|
1,
|
|
end > count ? lineLength - pad : end - start
|
|
);
|
|
res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
|
|
} else if (j > i) {
|
|
if (end > count) {
|
|
const length = Math.max(Math.min(end - count, lineLength), 1);
|
|
res.push(` | ` + "^".repeat(length));
|
|
}
|
|
count += lineLength + newLineSeqLength;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return res.join("\n");
|
|
}
|
|
function normalizeStyle(value) {
|
|
if (isArray2(value)) {
|
|
const res = {};
|
|
for (let i = 0; i < value.length; i++) {
|
|
const item = value[i];
|
|
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
|
|
if (normalized) {
|
|
for (const key in normalized) {
|
|
res[key] = normalized[key];
|
|
}
|
|
}
|
|
}
|
|
return res;
|
|
} else if (isString(value) || isObject(value)) {
|
|
return value;
|
|
}
|
|
}
|
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
const propertyDelimiterRE = /:([^]+)/;
|
|
const styleCommentRE = /\/\*[^]*?\*\//g;
|
|
function parseStringStyle(cssText) {
|
|
const ret = {};
|
|
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
if (item) {
|
|
const tmp = item.split(propertyDelimiterRE);
|
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
}
|
|
});
|
|
return ret;
|
|
}
|
|
function stringifyStyle(styles) {
|
|
if (!styles) return "";
|
|
if (isString(styles)) return styles;
|
|
let ret = "";
|
|
for (const key in styles) {
|
|
const value = styles[key];
|
|
if (isString(value) || typeof value === "number") {
|
|
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
|
|
ret += `${normalizedKey}:${value};`;
|
|
}
|
|
}
|
|
return ret;
|
|
}
|
|
function normalizeClass(value) {
|
|
let res = "";
|
|
if (isString(value)) {
|
|
res = value;
|
|
} else if (isArray2(value)) {
|
|
for (let i = 0; i < value.length; i++) {
|
|
const normalized = normalizeClass(value[i]);
|
|
if (normalized) {
|
|
res += normalized + " ";
|
|
}
|
|
}
|
|
} else if (isObject(value)) {
|
|
for (const name in value) {
|
|
if (value[name]) {
|
|
res += name + " ";
|
|
}
|
|
}
|
|
}
|
|
return res.trim();
|
|
}
|
|
function normalizeProps(props) {
|
|
if (!props) return null;
|
|
let { class: klass, style } = props;
|
|
if (klass && !isString(klass)) {
|
|
props.class = normalizeClass(klass);
|
|
}
|
|
if (style) {
|
|
props.style = normalizeStyle(style);
|
|
}
|
|
return props;
|
|
}
|
|
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
|
|
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
|
|
const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
|
|
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
|
|
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
const isBooleanAttr = /* @__PURE__ */ makeMap(
|
|
specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
|
|
);
|
|
function includeBooleanAttr(value) {
|
|
return !!value || value === "";
|
|
}
|
|
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
|
|
const attrValidationCache = {};
|
|
function isSSRSafeAttrName(name) {
|
|
if (attrValidationCache.hasOwnProperty(name)) {
|
|
return attrValidationCache[name];
|
|
}
|
|
const isUnsafe = unsafeAttrCharRE.test(name);
|
|
if (isUnsafe) {
|
|
console.error(`unsafe attribute name: ${name}`);
|
|
}
|
|
return attrValidationCache[name] = !isUnsafe;
|
|
}
|
|
const propsToAttrMap = {
|
|
acceptCharset: "accept-charset",
|
|
className: "class",
|
|
htmlFor: "for",
|
|
httpEquiv: "http-equiv"
|
|
};
|
|
const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
|
|
`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
|
|
);
|
|
const isKnownSvgAttr = /* @__PURE__ */ makeMap(
|
|
`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
|
|
);
|
|
const isKnownMathMLAttr = /* @__PURE__ */ makeMap(
|
|
`accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`
|
|
);
|
|
function isRenderableAttrValue(value) {
|
|
if (value == null) {
|
|
return false;
|
|
}
|
|
const type = typeof value;
|
|
return type === "string" || type === "number" || type === "boolean";
|
|
}
|
|
const escapeRE = /["'&<>]/;
|
|
function escapeHtml(string) {
|
|
const str = "" + string;
|
|
const match = escapeRE.exec(str);
|
|
if (!match) {
|
|
return str;
|
|
}
|
|
let html = "";
|
|
let escaped;
|
|
let index;
|
|
let lastIndex = 0;
|
|
for (index = match.index; index < str.length; index++) {
|
|
switch (str.charCodeAt(index)) {
|
|
case 34:
|
|
escaped = """;
|
|
break;
|
|
case 38:
|
|
escaped = "&";
|
|
break;
|
|
case 39:
|
|
escaped = "'";
|
|
break;
|
|
case 60:
|
|
escaped = "<";
|
|
break;
|
|
case 62:
|
|
escaped = ">";
|
|
break;
|
|
default:
|
|
continue;
|
|
}
|
|
if (lastIndex !== index) {
|
|
html += str.slice(lastIndex, index);
|
|
}
|
|
lastIndex = index + 1;
|
|
html += escaped;
|
|
}
|
|
return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
|
|
}
|
|
const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
|
|
function escapeHtmlComment(src) {
|
|
return src.replace(commentStripRE, "");
|
|
}
|
|
const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
|
|
function getEscapedCssVarName(key, doubleEscape) {
|
|
return key.replace(
|
|
cssVarNameEscapeSymbolsRE,
|
|
(s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}`
|
|
);
|
|
}
|
|
function looseCompareArrays(a, b) {
|
|
if (a.length !== b.length) return false;
|
|
let equal = true;
|
|
for (let i = 0; equal && i < a.length; i++) {
|
|
equal = looseEqual(a[i], b[i]);
|
|
}
|
|
return equal;
|
|
}
|
|
function looseEqual(a, b) {
|
|
if (a === b) return true;
|
|
let aValidType = isDate(a);
|
|
let bValidType = isDate(b);
|
|
if (aValidType || bValidType) {
|
|
return aValidType && bValidType ? a.getTime() === b.getTime() : false;
|
|
}
|
|
aValidType = isSymbol(a);
|
|
bValidType = isSymbol(b);
|
|
if (aValidType || bValidType) {
|
|
return a === b;
|
|
}
|
|
aValidType = isArray2(a);
|
|
bValidType = isArray2(b);
|
|
if (aValidType || bValidType) {
|
|
return aValidType && bValidType ? looseCompareArrays(a, b) : false;
|
|
}
|
|
aValidType = isObject(a);
|
|
bValidType = isObject(b);
|
|
if (aValidType || bValidType) {
|
|
if (!aValidType || !bValidType) {
|
|
return false;
|
|
}
|
|
const aKeysCount = Object.keys(a).length;
|
|
const bKeysCount = Object.keys(b).length;
|
|
if (aKeysCount !== bKeysCount) {
|
|
return false;
|
|
}
|
|
for (const key in a) {
|
|
const aHasKey = a.hasOwnProperty(key);
|
|
const bHasKey = b.hasOwnProperty(key);
|
|
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return String(a) === String(b);
|
|
}
|
|
function looseIndexOf(arr, val) {
|
|
return arr.findIndex((item) => looseEqual(item, val));
|
|
}
|
|
const isRef2 = (val) => {
|
|
return !!(val && val["__v_isRef"] === true);
|
|
};
|
|
const toDisplayString = (val) => {
|
|
return isString(val) ? val : val == null ? "" : isArray2(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef2(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
|
|
};
|
|
const replacer = (_key, val) => {
|
|
if (isRef2(val)) {
|
|
return replacer(_key, val.value);
|
|
} else if (isMap(val)) {
|
|
return {
|
|
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
(entries, [key, val2], i) => {
|
|
entries[stringifySymbol(key, i) + " =>"] = val2;
|
|
return entries;
|
|
},
|
|
{}
|
|
)
|
|
};
|
|
} else if (isSet(val)) {
|
|
return {
|
|
[`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
|
|
};
|
|
} else if (isSymbol(val)) {
|
|
return stringifySymbol(val);
|
|
} else if (isObject(val) && !isArray2(val) && !isPlainObject(val)) {
|
|
return String(val);
|
|
}
|
|
return val;
|
|
};
|
|
const stringifySymbol = (v, i = "") => {
|
|
var _a;
|
|
return (
|
|
// Symbol.description in es2019+ so we need to cast here to pass
|
|
// the lib: es2016 check
|
|
isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
|
|
);
|
|
};
|
|
function normalizeCssVarValue(value) {
|
|
if (value == null) {
|
|
return "initial";
|
|
}
|
|
if (typeof value === "string") {
|
|
return value === "" ? " " : value;
|
|
}
|
|
return String(value);
|
|
}
|
|
shared_cjs_prod.EMPTY_ARR = EMPTY_ARR;
|
|
shared_cjs_prod.EMPTY_OBJ = EMPTY_OBJ;
|
|
shared_cjs_prod.NO = NO;
|
|
shared_cjs_prod.NOOP = NOOP;
|
|
shared_cjs_prod.PatchFlagNames = PatchFlagNames;
|
|
shared_cjs_prod.PatchFlags = PatchFlags;
|
|
shared_cjs_prod.ShapeFlags = ShapeFlags;
|
|
shared_cjs_prod.SlotFlags = SlotFlags;
|
|
shared_cjs_prod.camelize = camelize;
|
|
shared_cjs_prod.capitalize = capitalize;
|
|
shared_cjs_prod.cssVarNameEscapeSymbolsRE = cssVarNameEscapeSymbolsRE;
|
|
shared_cjs_prod.def = def;
|
|
shared_cjs_prod.escapeHtml = escapeHtml;
|
|
shared_cjs_prod.escapeHtmlComment = escapeHtmlComment;
|
|
shared_cjs_prod.extend = extend;
|
|
shared_cjs_prod.genCacheKey = genCacheKey;
|
|
shared_cjs_prod.genPropsAccessExp = genPropsAccessExp;
|
|
shared_cjs_prod.generateCodeFrame = generateCodeFrame;
|
|
shared_cjs_prod.getEscapedCssVarName = getEscapedCssVarName;
|
|
shared_cjs_prod.getGlobalThis = getGlobalThis;
|
|
shared_cjs_prod.hasChanged = hasChanged;
|
|
shared_cjs_prod.hasOwn = hasOwn;
|
|
shared_cjs_prod.hyphenate = hyphenate;
|
|
shared_cjs_prod.includeBooleanAttr = includeBooleanAttr;
|
|
shared_cjs_prod.invokeArrayFns = invokeArrayFns;
|
|
shared_cjs_prod.isArray = isArray2;
|
|
shared_cjs_prod.isBooleanAttr = isBooleanAttr;
|
|
shared_cjs_prod.isBuiltInDirective = isBuiltInDirective;
|
|
shared_cjs_prod.isDate = isDate;
|
|
shared_cjs_prod.isFunction = isFunction;
|
|
shared_cjs_prod.isGloballyAllowed = isGloballyAllowed;
|
|
shared_cjs_prod.isGloballyWhitelisted = isGloballyWhitelisted;
|
|
shared_cjs_prod.isHTMLTag = isHTMLTag;
|
|
shared_cjs_prod.isIntegerKey = isIntegerKey;
|
|
shared_cjs_prod.isKnownHtmlAttr = isKnownHtmlAttr;
|
|
shared_cjs_prod.isKnownMathMLAttr = isKnownMathMLAttr;
|
|
shared_cjs_prod.isKnownSvgAttr = isKnownSvgAttr;
|
|
shared_cjs_prod.isMap = isMap;
|
|
shared_cjs_prod.isMathMLTag = isMathMLTag;
|
|
shared_cjs_prod.isModelListener = isModelListener;
|
|
shared_cjs_prod.isObject = isObject;
|
|
shared_cjs_prod.isOn = isOn;
|
|
shared_cjs_prod.isPlainObject = isPlainObject;
|
|
shared_cjs_prod.isPromise = isPromise;
|
|
shared_cjs_prod.isRegExp = isRegExp;
|
|
shared_cjs_prod.isRenderableAttrValue = isRenderableAttrValue;
|
|
shared_cjs_prod.isReservedProp = isReservedProp;
|
|
shared_cjs_prod.isSSRSafeAttrName = isSSRSafeAttrName;
|
|
shared_cjs_prod.isSVGTag = isSVGTag;
|
|
shared_cjs_prod.isSet = isSet;
|
|
shared_cjs_prod.isSpecialBooleanAttr = isSpecialBooleanAttr;
|
|
shared_cjs_prod.isString = isString;
|
|
shared_cjs_prod.isSymbol = isSymbol;
|
|
shared_cjs_prod.isVoidTag = isVoidTag;
|
|
shared_cjs_prod.looseEqual = looseEqual;
|
|
shared_cjs_prod.looseIndexOf = looseIndexOf;
|
|
shared_cjs_prod.looseToNumber = looseToNumber;
|
|
shared_cjs_prod.makeMap = makeMap;
|
|
shared_cjs_prod.normalizeClass = normalizeClass;
|
|
shared_cjs_prod.normalizeCssVarValue = normalizeCssVarValue;
|
|
shared_cjs_prod.normalizeProps = normalizeProps;
|
|
shared_cjs_prod.normalizeStyle = normalizeStyle;
|
|
shared_cjs_prod.objectToString = objectToString;
|
|
shared_cjs_prod.parseStringStyle = parseStringStyle;
|
|
shared_cjs_prod.propsToAttrMap = propsToAttrMap;
|
|
shared_cjs_prod.remove = remove;
|
|
shared_cjs_prod.slotFlagsText = slotFlagsText;
|
|
shared_cjs_prod.stringifyStyle = stringifyStyle;
|
|
shared_cjs_prod.toDisplayString = toDisplayString;
|
|
shared_cjs_prod.toHandlerKey = toHandlerKey;
|
|
shared_cjs_prod.toNumber = toNumber;
|
|
shared_cjs_prod.toRawType = toRawType;
|
|
shared_cjs_prod.toTypeString = toTypeString;
|
|
return shared_cjs_prod;
|
|
}
|
|
var shared_cjs_prodExports = /* @__PURE__ */ requireShared_cjs_prod();
|
|
const _wrapInTransition = (props, children) => {
|
|
return { default: () => children.default?.() };
|
|
};
|
|
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_NORMALIZED) {
|
|
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;
|
|
}
|
|
function toArray(value) {
|
|
return Array.isArray(value) ? value : [value];
|
|
}
|
|
function _mergeTransitionProps(routeProps) {
|
|
const _props = [];
|
|
for (const prop of routeProps) {
|
|
if (!prop) {
|
|
continue;
|
|
}
|
|
_props.push({
|
|
...prop,
|
|
onAfterLeave: prop.onAfterLeave ? toArray(prop.onAfterLeave) : void 0,
|
|
onBeforeLeave: prop.onBeforeLeave ? toArray(prop.onBeforeLeave) : void 0
|
|
});
|
|
}
|
|
return defu(..._props);
|
|
}
|
|
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;
|
|
}
|
|
if (from === START_LOCATION_NORMALIZED) {
|
|
return _calculatePosition(to, from, savedPosition, hashScrollBehaviour);
|
|
}
|
|
return new Promise((resolve) => {
|
|
const doScroll = () => {
|
|
requestAnimationFrame(() => resolve(_calculatePosition(to, from, savedPosition, hashScrollBehaviour)));
|
|
};
|
|
nuxtApp.hooks.hookOnce("page:loading:end", () => {
|
|
const transitionPromise = nuxtApp["~transitionPromise"];
|
|
if (transitionPromise) {
|
|
transitionPromise.then(doScroll);
|
|
} else {
|
|
doScroll();
|
|
}
|
|
});
|
|
});
|
|
}
|
|
};
|
|
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;
|
|
}
|
|
if (to.hash) {
|
|
return {
|
|
el: to.hash,
|
|
top: _getHashElementScrollMarginTop(to.hash),
|
|
behavior: isChangingPage(to, from) ? 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,
|
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
status: result && (result.status || result.statusCode) || 404,
|
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
statusText: result && (result.statusText || result.statusMessage) || `Page Not Found: ${to.fullPath}`,
|
|
data: {
|
|
path: to.fullPath
|
|
}
|
|
});
|
|
return error;
|
|
});
|
|
const MENU_GROUPS = [
|
|
{
|
|
label: "数据概览",
|
|
items: [
|
|
{ id: "dashboard", label: "仪表盘", to: "/dashboard", icon: "M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" },
|
|
{ id: "svcinspect", label: "服务巡检", to: "/svcinspect", icon: "M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" }
|
|
]
|
|
},
|
|
{
|
|
label: "生产管理",
|
|
items: [
|
|
{ id: "provider", label: "方案商管理", to: "/provider", icon: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" },
|
|
{ id: "factory", label: "品牌商管理", to: "/factory", icon: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" },
|
|
{ id: "channel", label: "渠道商管理", to: "/dealers", icon: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" },
|
|
{ id: "product", label: "产品管理", to: "/product", icon: "M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" },
|
|
{ id: "code", label: "公码管理", to: "/code", icon: "M4 4h6v6H4V4zm10 0h6v6h-6V4zM4 14h6v6H4v-6zm10 2h2m-2 4h6m-4-4v4m4-8h2m-2 0v4" },
|
|
{ id: "device", label: "生产管理", to: "/device", icon: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" }
|
|
]
|
|
},
|
|
{
|
|
label: "结算管理",
|
|
items: [
|
|
{ id: "settlement", label: "月结算", to: "/settlements", icon: "M9 7h6m-6 4h6m-6 4h4M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2z" }
|
|
]
|
|
},
|
|
{
|
|
label: "用户管理",
|
|
items: [
|
|
{ id: "user", label: "用户查询", to: "/users", icon: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }
|
|
]
|
|
},
|
|
{
|
|
label: "服务配置",
|
|
items: [
|
|
{ id: "globalconfig", label: "全局环境配置", to: "/globalconfig", icon: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" },
|
|
{ id: "appconfig", label: "应用环境配置", to: "/appconfig", icon: "M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4" },
|
|
{ id: "meettemplate", label: "会议模板", to: "/meettemplates", icon: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" },
|
|
{ id: "svcconfig", label: "第三方服务配置", to: "/serviceconfig", icon: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z" },
|
|
{ id: "agents", label: "Agent 配置", to: "/agents", icon: "M12 3a2 2 0 012 2v1h3a2 2 0 012 2v3a2 2 0 01-2 2h-1v3a2 2 0 01-2 2H8a2 2 0 01-2-2v-3H5a2 2 0 01-2-2V8a2 2 0 012-2h3V5a2 2 0 012-2zM9 13h.01M15 13h.01" },
|
|
{ id: "meetingsvc", label: "会议记录服务", to: "/meetingsvc", icon: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" },
|
|
{ id: "calltranslate", label: "通话翻译配置", to: "/calltranslate", icon: "M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129" }
|
|
]
|
|
},
|
|
{
|
|
label: "SaaS 管理",
|
|
restricted: true,
|
|
items: [
|
|
{ id: "apps", label: "应用中心", to: "/apps", icon: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" },
|
|
{ id: "environments", label: "环境节点", to: "/environments", icon: "M5 3h14a2 2 0 012 2v4a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM5 13h14a2 2 0 012 2v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4a2 2 0 012-2zM7 7h.01M7 17h.01" },
|
|
{ id: "channels", label: "渠道分发", to: "/channels", icon: "M12 3v12m0 0l-4-4m4 4l4-4M4 17v2a2 2 0 002 2h12a2 2 0 002-2v-2" }
|
|
]
|
|
},
|
|
{
|
|
label: "系统管理",
|
|
restricted: true,
|
|
items: [
|
|
{ id: "systemconfig", label: "系统配置", to: "/systemconfig", icon: "M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4" },
|
|
{ id: "statlog", label: "统计日志", to: "/statlog", icon: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4" },
|
|
{ id: "admin", label: "后台账号", to: "/accounts", icon: "M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z" }
|
|
]
|
|
}
|
|
];
|
|
const ALL_MENU_IDS = MENU_GROUPS.flatMap((g) => g.items.map((m) => m.id));
|
|
const DEFAULT_ADMIN_ACCESS = MENU_GROUPS.filter((g) => !g.restricted).flatMap((g) => g.items.map((m) => m.id));
|
|
const DEFAULT_BRAND_ACCESS = ["dashboard", "channel", "user", "settlement"];
|
|
const DEFAULT_DEALER_ACCESS = ["dashboard", "user", "settlement"];
|
|
const ROLE_ACCESS_CEILING = {
|
|
3: DEFAULT_BRAND_ACCESS,
|
|
5: DEFAULT_DEALER_ACCESS
|
|
};
|
|
const IDENTITY_LABELS = {
|
|
1: "超管",
|
|
2: "管理员",
|
|
3: "品牌商",
|
|
4: "运营",
|
|
5: "渠道商"
|
|
};
|
|
const IDENTITY_ADMIN = 1;
|
|
const IDENTITY_MANAGER = 2;
|
|
const IDENTITY_BRAND = 3;
|
|
const IDENTITY_DEALER = 5;
|
|
function parseComma(val) {
|
|
if (!val) return [];
|
|
return val.split(",").map((s) => s.trim()).filter(Boolean);
|
|
}
|
|
function saveToStorage(data) {
|
|
}
|
|
const useAuthStore = defineStore("auth", {
|
|
state: () => ({
|
|
token: "",
|
|
account: "",
|
|
identity: 0,
|
|
access: [],
|
|
apps: [],
|
|
regions: [],
|
|
products: [],
|
|
// 渠道分成体系的归属绑定:品牌商账号只有 brandid;渠道商账号两者都有。
|
|
// 仅用于界面收敛(隐藏无关筛选/按钮),真正的数据隔离由后端 scope 强制执行。
|
|
brandid: 0,
|
|
channelid: "",
|
|
appbinds: [],
|
|
currentAppId: 0,
|
|
siteTitle: ""
|
|
}),
|
|
getters: {
|
|
isSuperAdmin() {
|
|
return this.identity === 1;
|
|
},
|
|
isAdmin() {
|
|
return this.identity === IDENTITY_ADMIN || this.identity === IDENTITY_MANAGER;
|
|
},
|
|
// 品牌商账号:绑定了品牌商,可见名下全部渠道商
|
|
isBrandAccount() {
|
|
return this.identity === IDENTITY_BRAND && this.brandid > 0;
|
|
},
|
|
// 渠道商账号:锁定到单个渠道商
|
|
isDealer() {
|
|
return this.identity === IDENTITY_DEALER;
|
|
},
|
|
identityLabel() {
|
|
return IDENTITY_LABELS[this.identity] ?? "";
|
|
},
|
|
isLoggedIn() {
|
|
return !!this.token;
|
|
}
|
|
},
|
|
actions: {
|
|
setLoginData(data) {
|
|
this.token = data.token;
|
|
this.account = data.account;
|
|
this.identity = data.identity;
|
|
this.access = parseComma(data.access);
|
|
this.apps = parseComma(data.apps);
|
|
this.regions = parseComma(data.regions);
|
|
this.products = parseComma(data.products);
|
|
this.brandid = data.brandid ?? 0;
|
|
this.channelid = data.channelid ?? "";
|
|
this.appbinds = data.appbinds ?? [];
|
|
if (this.appbinds.length > 0 && !this.currentAppId) {
|
|
this.currentAppId = this.appbinds[0].id;
|
|
}
|
|
saveToStorage({
|
|
token: this.token,
|
|
account: this.account,
|
|
identity: this.identity,
|
|
access: this.access,
|
|
apps: this.apps,
|
|
regions: this.regions,
|
|
products: this.products,
|
|
brandid: this.brandid,
|
|
channelid: this.channelid,
|
|
appbinds: this.appbinds,
|
|
currentAppId: this.currentAppId,
|
|
siteTitle: this.siteTitle
|
|
});
|
|
},
|
|
setCurrentApp(id) {
|
|
this.currentAppId = id;
|
|
saveToStorage({
|
|
token: this.token,
|
|
account: this.account,
|
|
identity: this.identity,
|
|
access: this.access,
|
|
apps: this.apps,
|
|
regions: this.regions,
|
|
products: this.products,
|
|
brandid: this.brandid,
|
|
channelid: this.channelid,
|
|
appbinds: this.appbinds,
|
|
currentAppId: this.currentAppId,
|
|
siteTitle: this.siteTitle
|
|
});
|
|
},
|
|
setSiteTitle(title) {
|
|
this.siteTitle = title;
|
|
saveToStorage({
|
|
token: this.token,
|
|
account: this.account,
|
|
identity: this.identity,
|
|
access: this.access,
|
|
apps: this.apps,
|
|
regions: this.regions,
|
|
products: this.products,
|
|
brandid: this.brandid,
|
|
channelid: this.channelid,
|
|
appbinds: this.appbinds,
|
|
currentAppId: this.currentAppId,
|
|
siteTitle: this.siteTitle
|
|
});
|
|
},
|
|
logout() {
|
|
this.token = "";
|
|
this.account = "";
|
|
this.identity = 0;
|
|
this.access = [];
|
|
this.apps = [];
|
|
this.regions = [];
|
|
this.products = [];
|
|
this.brandid = 0;
|
|
this.channelid = "";
|
|
this.appbinds = [];
|
|
this.currentAppId = 0;
|
|
this.siteTitle = "";
|
|
},
|
|
restore() {
|
|
return;
|
|
},
|
|
hasAccess(pageId) {
|
|
if (this.identity === IDENTITY_ADMIN) return true;
|
|
if (this.identity === IDENTITY_MANAGER && this.access.length === 0) {
|
|
return DEFAULT_ADMIN_ACCESS.includes(pageId);
|
|
}
|
|
const ceiling = ROLE_ACCESS_CEILING[this.identity];
|
|
if (ceiling) {
|
|
if (!ceiling.includes(pageId)) return false;
|
|
if (this.access.length === 0) return true;
|
|
}
|
|
return this.access.includes(pageId);
|
|
}
|
|
}
|
|
});
|
|
const access_45global = /* @__PURE__ */ defineNuxtRouteMiddleware((to) => {
|
|
return;
|
|
});
|
|
const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware((to) => {
|
|
{
|
|
return;
|
|
}
|
|
});
|
|
const globalMiddleware = [
|
|
validate,
|
|
access_45global,
|
|
manifest_45route_45rule
|
|
];
|
|
const namedMiddleware = {};
|
|
Object.assign(/* @__PURE__ */ Object.create(null), {});
|
|
const pageIslandRoutes = Object.assign(/* @__PURE__ */ Object.create(null), {});
|
|
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_NORMALIZED) {
|
|
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_NORMALIZED, 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;
|
|
};
|
|
router.afterEach((to, from) => {
|
|
const lastTo = to.matched.at(-1)?.components?.default;
|
|
const lastFrom = from.matched.at(-1)?.components?.default;
|
|
if (lastTo === lastFrom) {
|
|
syncCurrentRoute();
|
|
return;
|
|
}
|
|
if (to.matched.length < from.matched.length && to.matched.every((m, i) => m.components?.default === from.matched[i]?.components?.default)) {
|
|
syncCurrentRoute();
|
|
}
|
|
});
|
|
const route = { sync: syncCurrentRoute };
|
|
for (const key in _route.value) {
|
|
Object.defineProperty(route, key, {
|
|
get: () => _route.value[key],
|
|
enumerable: true
|
|
});
|
|
}
|
|
nuxtApp._route = shallowReactive(route);
|
|
nuxtApp._middleware ||= {
|
|
global: [],
|
|
named: {}
|
|
};
|
|
const error = /* @__PURE__ */ useError();
|
|
const isServerPage = nuxtApp.ssrContext?.islandContext?.name?.startsWith("page_");
|
|
if (!nuxtApp.ssrContext?.islandContext || isServerPage) {
|
|
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;
|
|
const hasDeferredRoute = false;
|
|
syncCurrentRoute();
|
|
if (nuxtApp.ssrContext?.islandContext && !isServerPage) {
|
|
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 || isServerPage) {
|
|
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$1(componentMiddleware)) {
|
|
middlewareEntries.add(entry2);
|
|
}
|
|
}
|
|
const routeRules = 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({
|
|
status: 404,
|
|
statusText: `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;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
if (isServerPage) {
|
|
router.beforeResolve((to) => {
|
|
const expected = pageIslandRoutes[nuxtApp.ssrContext.islandContext.name];
|
|
const actual = to.matched.find((m) => m.components?.default?.__nuxt_island)?.components?.default;
|
|
if (!expected || expected !== actual?.__nuxt_island) {
|
|
nuxtApp.ssrContext["~renderResponse"] = {
|
|
statusCode: 400,
|
|
statusMessage: "Invalid island request path"
|
|
};
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
router.onError(async () => {
|
|
delete nuxtApp._processingMiddleware;
|
|
await nuxtApp.callHook("page:loading:end");
|
|
});
|
|
router.afterEach((to) => {
|
|
if (to.matched.length === 0 && !error.value) {
|
|
return nuxtApp.runWithContext(() => showError(createError({
|
|
status: 404,
|
|
fatal: false,
|
|
statusText: `Page not found: ${to.fullPath}`,
|
|
data: {
|
|
path: to.fullPath
|
|
}
|
|
})));
|
|
}
|
|
});
|
|
nuxtApp.hooks.hookOnce("app:created", async () => {
|
|
try {
|
|
if ("name" in resolvedInitialRoute) {
|
|
resolvedInitialRoute.name = void 0;
|
|
}
|
|
if (hasDeferredRoute) ;
|
|
else {
|
|
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_y_Jg9TKMK_pSVgbwS3QYggu2__NI0DEkI7DvOxdnJaM = /* @__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 = /* @__PURE__ */ 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);
|
|
};
|
|
}
|
|
});
|
|
function defineKeyedFunctionFactory(factory) {
|
|
const placeholder = function() {
|
|
throw new Error(`[nuxt] \`${factory.name}\` is a compiler macro and cannot be called at runtime.`);
|
|
};
|
|
return Object.defineProperty(placeholder, "__nuxt_factory", {
|
|
enumerable: false,
|
|
get: () => factory.factory
|
|
});
|
|
}
|
|
const createUseAsyncData = defineKeyedFunctionFactory({
|
|
name: "createUseAsyncData",
|
|
factory(options = {}) {
|
|
function useAsyncData2(...args) {
|
|
const autoKey = typeof args[args.length - 1] === "string" ? args.pop() : void 0;
|
|
if (_isAutoKeyNeeded(args[0], args[1])) {
|
|
args.unshift(autoKey);
|
|
}
|
|
let [_key, _handler, opts = {}] = args;
|
|
const isKeyReactive = isRef(_key) || typeof _key === "function";
|
|
const key = isKeyReactive ? computed(() => toValue(_key)) : { value: _key };
|
|
if (!key.value || typeof key.value !== "string") {
|
|
throw new TypeError("[nuxt] [useAsyncData] key must be a non-empty string.");
|
|
}
|
|
if (typeof _handler !== "function") {
|
|
throw new TypeError("[nuxt] [useAsyncData] handler must be a function.");
|
|
}
|
|
const shouldFactoryOptionsOverride = typeof options === "function";
|
|
const nuxtApp = useNuxtApp();
|
|
const factoryOptions = shouldFactoryOptionsOverride ? options(opts) : options;
|
|
if (!shouldFactoryOptionsOverride) {
|
|
for (const key2 in factoryOptions) {
|
|
if (factoryOptions[key2] === void 0) {
|
|
continue;
|
|
}
|
|
if (opts[key2] !== void 0) {
|
|
continue;
|
|
}
|
|
opts[key2] = factoryOptions[key2];
|
|
}
|
|
}
|
|
opts.server ??= true;
|
|
opts.default ??= getDefault;
|
|
opts.getCachedData ??= getDefaultCachedData;
|
|
opts.lazy ??= false;
|
|
opts.immediate ??= true;
|
|
opts.deep ??= asyncDataDefaults.deep;
|
|
opts.dedupe ??= "cancel";
|
|
if (shouldFactoryOptionsOverride) {
|
|
for (const key2 in factoryOptions) {
|
|
if (factoryOptions[key2] === void 0) {
|
|
continue;
|
|
}
|
|
opts[key2] = factoryOptions[key2];
|
|
}
|
|
}
|
|
nuxtApp._asyncData[key.value];
|
|
function createInitialFetch() {
|
|
const initialFetchOptions = { cause: "initial", dedupe: opts.dedupe };
|
|
const existing = nuxtApp._asyncData[key.value];
|
|
if (!existing?._init) {
|
|
initialFetchOptions.cachedData = opts.getCachedData(key.value, nuxtApp, { cause: "initial" });
|
|
nuxtApp._asyncData[key.value] = buildAsyncData(nuxtApp, key.value, _handler, opts, initialFetchOptions.cachedData);
|
|
nuxtApp._asyncData[key.value]._initialCachedData = initialFetchOptions.cachedData;
|
|
} else if (nuxtApp._asyncDataPromises[key.value]) {
|
|
initialFetchOptions.cachedData = existing._initialCachedData;
|
|
}
|
|
return () => nuxtApp._asyncData[key.value].execute(initialFetchOptions);
|
|
}
|
|
const initialFetch = createInitialFetch();
|
|
const asyncData = nuxtApp._asyncData[key.value];
|
|
asyncData._deps++;
|
|
const fetchOnServer = opts.server !== false && nuxtApp.payload.serverRendered;
|
|
if (fetchOnServer && opts.immediate) {
|
|
const promise = initialFetch();
|
|
if (getCurrentInstance()) {
|
|
onServerPrefetch(() => promise);
|
|
} else {
|
|
nuxtApp.hook("app:created", async () => {
|
|
await promise;
|
|
});
|
|
}
|
|
}
|
|
const asyncReturn = {
|
|
data: writableComputedRef(() => nuxtApp._asyncData[key.value]?.data),
|
|
pending: writableComputedRef(() => nuxtApp._asyncData[key.value]?.pending),
|
|
status: writableComputedRef(() => nuxtApp._asyncData[key.value]?.status),
|
|
error: writableComputedRef(() => nuxtApp._asyncData[key.value]?.error),
|
|
refresh: (...args2) => {
|
|
if (!nuxtApp._asyncData[key.value]?._init) {
|
|
const initialFetch2 = createInitialFetch();
|
|
return initialFetch2();
|
|
}
|
|
return nuxtApp._asyncData[key.value].execute(...args2);
|
|
},
|
|
execute: (...args2) => asyncReturn.refresh(...args2),
|
|
clear: () => {
|
|
const entry2 = nuxtApp._asyncData[key.value];
|
|
if (entry2?._abortController) {
|
|
try {
|
|
entry2._abortController.abort(new DOMException("AsyncData aborted by user.", "AbortError"));
|
|
} finally {
|
|
entry2._abortController = void 0;
|
|
}
|
|
}
|
|
clearNuxtDataByKey(nuxtApp, key.value);
|
|
}
|
|
};
|
|
const asyncDataPromise = Promise.resolve(nuxtApp._asyncDataPromises[key.value]).then(() => asyncReturn);
|
|
Object.assign(asyncDataPromise, asyncReturn);
|
|
Object.defineProperties(asyncDataPromise, {
|
|
then: { enumerable: true, value: asyncDataPromise.then.bind(asyncDataPromise) },
|
|
catch: { enumerable: true, value: asyncDataPromise.catch.bind(asyncDataPromise) },
|
|
finally: { enumerable: true, value: asyncDataPromise.finally.bind(asyncDataPromise) }
|
|
});
|
|
return asyncDataPromise;
|
|
}
|
|
return useAsyncData2;
|
|
}
|
|
});
|
|
const useAsyncData = createUseAsyncData.__nuxt_factory();
|
|
createUseAsyncData.__nuxt_factory({
|
|
lazy: true,
|
|
// @ts-expect-error private property
|
|
_functionName: "useLazyAsyncData"
|
|
});
|
|
function writableComputedRef(getter) {
|
|
return computed({
|
|
get() {
|
|
return getter()?.value;
|
|
},
|
|
set(value) {
|
|
const ref2 = getter();
|
|
if (ref2) {
|
|
ref2.value = value;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function _isAutoKeyNeeded(keyOrFetcher, fetcher) {
|
|
if (typeof keyOrFetcher === "string") {
|
|
return false;
|
|
}
|
|
if (typeof keyOrFetcher === "object" && keyOrFetcher !== null) {
|
|
return false;
|
|
}
|
|
if (typeof keyOrFetcher === "function" && typeof fetcher === "function") {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function clearNuxtDataByKey(nuxtApp, key) {
|
|
if (key in nuxtApp.payload.data) {
|
|
nuxtApp.payload.data[key] = void 0;
|
|
}
|
|
if (key in nuxtApp.payload._errors) {
|
|
nuxtApp.payload._errors[key] = void 0;
|
|
}
|
|
if (nuxtApp._asyncData[key]) {
|
|
nuxtApp._asyncData[key].data.value = unref(nuxtApp._asyncData[key]._default());
|
|
nuxtApp._asyncData[key].error.value = void 0;
|
|
nuxtApp._asyncData[key].status.value = "idle";
|
|
nuxtApp._asyncData[key]._initialCachedData = void 0;
|
|
}
|
|
if (key in nuxtApp._asyncDataPromises) {
|
|
nuxtApp._asyncDataPromises[key] = void 0;
|
|
}
|
|
}
|
|
function pick(obj, keys) {
|
|
const newObj = {};
|
|
for (const key of keys) {
|
|
newObj[key] = obj[key];
|
|
}
|
|
return newObj;
|
|
}
|
|
function buildAsyncData(nuxtApp, key, _handler, options, initialCachedData) {
|
|
nuxtApp.payload._errors[key] ??= void 0;
|
|
const hasCustomGetCachedData = options.getCachedData !== getDefaultCachedData;
|
|
const handler = _handler ;
|
|
const _ref = options.deep ? ref : shallowRef;
|
|
const hasCachedData = initialCachedData !== void 0;
|
|
const unsubRefreshAsyncData = nuxtApp.hook("app:data:refresh", async (keys) => {
|
|
if (!keys || keys.includes(key)) {
|
|
await asyncData.execute({ cause: "refresh:hook" });
|
|
}
|
|
});
|
|
const asyncData = {
|
|
data: _ref(hasCachedData ? initialCachedData : options.default()),
|
|
pending: computed(() => asyncData.status.value === "pending"),
|
|
error: toRef(nuxtApp.payload._errors, key),
|
|
status: shallowRef("idle"),
|
|
execute: (...args) => {
|
|
const [_opts, newValue = void 0] = args;
|
|
const opts = _opts && newValue === void 0 && typeof _opts === "object" ? _opts : {};
|
|
if (nuxtApp._asyncDataPromises[key]) {
|
|
if ((opts.dedupe ?? options.dedupe) === "defer") {
|
|
return nuxtApp._asyncDataPromises[key];
|
|
}
|
|
}
|
|
{
|
|
const cachedData = "cachedData" in opts ? opts.cachedData : options.getCachedData(key, nuxtApp, { cause: opts.cause ?? "refresh:manual" });
|
|
if (cachedData !== void 0) {
|
|
nuxtApp.payload.data[key] = asyncData.data.value = cachedData;
|
|
asyncData.error.value = void 0;
|
|
asyncData.status.value = "success";
|
|
return Promise.resolve(cachedData);
|
|
}
|
|
}
|
|
if (asyncData._abortController) {
|
|
asyncData._abortController.abort(new DOMException("AsyncData request cancelled by deduplication", "AbortError"));
|
|
}
|
|
asyncData._abortController = new AbortController();
|
|
asyncData.status.value = "pending";
|
|
const cleanupController = new AbortController();
|
|
const promise = new Promise(
|
|
(resolve, reject) => {
|
|
try {
|
|
const timeout = opts.timeout ?? options.timeout;
|
|
const mergedSignal = mergeAbortSignals([asyncData._abortController?.signal, opts?.signal], cleanupController.signal, timeout);
|
|
if (mergedSignal.aborted) {
|
|
const reason = mergedSignal.reason;
|
|
reject(reason instanceof Error ? reason : new DOMException(String(reason ?? "Aborted"), "AbortError"));
|
|
return;
|
|
}
|
|
mergedSignal.addEventListener("abort", () => {
|
|
const reason = mergedSignal.reason;
|
|
reject(reason instanceof Error ? reason : new DOMException(String(reason ?? "Aborted"), "AbortError"));
|
|
}, { once: true, signal: cleanupController.signal });
|
|
return Promise.resolve(handler(nuxtApp, { signal: mergedSignal })).then(resolve, reject);
|
|
} catch (err) {
|
|
reject(err);
|
|
}
|
|
}
|
|
).then(async (_result) => {
|
|
if (nuxtApp._asyncDataPromises[key] !== promise) {
|
|
return;
|
|
}
|
|
let result = _result;
|
|
if (options.transform) {
|
|
result = await options.transform(_result);
|
|
}
|
|
if (options.pick) {
|
|
result = pick(result, options.pick);
|
|
}
|
|
nuxtApp.payload.data[key] = result;
|
|
asyncData.data.value = result;
|
|
asyncData.error.value = void 0;
|
|
asyncData.status.value = "success";
|
|
}).catch((error) => {
|
|
if (nuxtApp._asyncDataPromises[key] !== promise) {
|
|
return nuxtApp._asyncDataPromises[key];
|
|
}
|
|
if (asyncData._abortController?.signal.aborted) {
|
|
return nuxtApp._asyncDataPromises[key];
|
|
}
|
|
if (typeof DOMException !== "undefined" && error instanceof DOMException && error.name === "AbortError") {
|
|
asyncData.status.value = "idle";
|
|
return nuxtApp._asyncDataPromises[key];
|
|
}
|
|
asyncData.error.value = createError(error);
|
|
asyncData.data.value = unref(options.default());
|
|
asyncData.status.value = "error";
|
|
}).finally(() => {
|
|
cleanupController.abort();
|
|
if (nuxtApp._asyncDataPromises[key] === promise) {
|
|
delete nuxtApp._asyncDataPromises[key];
|
|
}
|
|
});
|
|
nuxtApp._asyncDataPromises[key] = promise;
|
|
return nuxtApp._asyncDataPromises[key];
|
|
},
|
|
_execute: debounce((...args) => asyncData.execute(...args), 0, { leading: true }),
|
|
_default: options.default,
|
|
_deps: 0,
|
|
_init: true,
|
|
_hash: void 0,
|
|
_off: () => {
|
|
unsubRefreshAsyncData();
|
|
if (nuxtApp._asyncData[key]?._init) {
|
|
nuxtApp._asyncData[key]._init = false;
|
|
}
|
|
if (!hasCustomGetCachedData) {
|
|
nextTick(() => {
|
|
if (!nuxtApp._asyncData[key]?._init) {
|
|
clearNuxtDataByKey(nuxtApp, key);
|
|
asyncData.execute = () => Promise.resolve();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
return asyncData;
|
|
}
|
|
const getDefault = () => void 0;
|
|
const getDefaultCachedData = (key, nuxtApp, ctx) => {
|
|
if (nuxtApp.isHydrating) {
|
|
return nuxtApp.payload.data[key];
|
|
}
|
|
if (ctx.cause !== "refresh:manual" && ctx.cause !== "refresh:hook") {
|
|
return nuxtApp.static.data[key];
|
|
}
|
|
};
|
|
function mergeAbortSignals(signals, cleanupSignal, timeout) {
|
|
const list = signals.filter((s) => !!s);
|
|
if (typeof timeout === "number" && timeout >= 0) {
|
|
const timeoutSignal = AbortSignal.timeout?.(timeout);
|
|
if (timeoutSignal) {
|
|
list.push(timeoutSignal);
|
|
}
|
|
}
|
|
if (AbortSignal.any) {
|
|
return AbortSignal.any(list);
|
|
}
|
|
const controller = new AbortController();
|
|
for (const sig of list) {
|
|
if (sig.aborted) {
|
|
const reason = sig.reason ?? new DOMException("Aborted", "AbortError");
|
|
try {
|
|
controller.abort(reason);
|
|
} catch {
|
|
controller.abort();
|
|
}
|
|
return controller.signal;
|
|
}
|
|
}
|
|
const onAbort = () => {
|
|
const abortedSignal = list.find((s) => s.aborted);
|
|
const reason = abortedSignal?.reason ?? new DOMException("Aborted", "AbortError");
|
|
try {
|
|
controller.abort(reason);
|
|
} catch {
|
|
controller.abort();
|
|
}
|
|
};
|
|
for (const sig of list) {
|
|
sig.addEventListener?.("abort", onAbort, { once: true, signal: cleanupSignal });
|
|
}
|
|
return controller.signal;
|
|
}
|
|
function useRequestEvent(nuxtApp) {
|
|
nuxtApp ||= useNuxtApp();
|
|
return nuxtApp.ssrContext?.event;
|
|
}
|
|
function useRequestFetch() {
|
|
return useRequestEvent()?.$fetch || globalThis.$fetch;
|
|
}
|
|
function generateOptionSegments(opts) {
|
|
const segments = [
|
|
toValue(opts.method)?.toUpperCase() || "GET",
|
|
toValue(opts.baseURL)
|
|
];
|
|
for (const _obj of [opts.query || opts.params]) {
|
|
const obj = toValue(_obj);
|
|
if (!obj) {
|
|
continue;
|
|
}
|
|
const unwrapped = {};
|
|
for (const [key, value] of Object.entries(obj)) {
|
|
unwrapped[toValue(key)] = toValue(value);
|
|
}
|
|
segments.push(unwrapped);
|
|
}
|
|
if (opts.body) {
|
|
const value = toValue(opts.body);
|
|
if (!value) {
|
|
segments.push(hash(value));
|
|
} else if (value instanceof ArrayBuffer) {
|
|
segments.push(hash(Object.fromEntries([...new Uint8Array(value).entries()].map(([k, v]) => [k, v.toString()]))));
|
|
} else if (value instanceof FormData) {
|
|
const entries = [];
|
|
for (const entry2 of value.entries()) {
|
|
const [key, val] = entry2;
|
|
entries.push([key, val instanceof File ? `${val.name}:${val.size}:${val.lastModified}` : val]);
|
|
}
|
|
segments.push(hash(entries));
|
|
} else if (shared_cjs_prodExports.isPlainObject(value)) {
|
|
segments.push(hash(reactive(value)));
|
|
} else {
|
|
try {
|
|
segments.push(hash(value));
|
|
} catch {
|
|
console.warn("[useFetch] Failed to hash body", value);
|
|
}
|
|
}
|
|
}
|
|
return segments;
|
|
}
|
|
const createUseFetch = defineKeyedFunctionFactory({
|
|
name: "createUseFetch",
|
|
factory(options = {}) {
|
|
function useFetch2(request, arg1, arg2) {
|
|
const [opts = {}, autoKey] = typeof arg1 === "string" ? [{}, arg1] : [arg1, arg2];
|
|
const factoryOptions = typeof options === "function" ? options(opts) : options;
|
|
const {
|
|
server,
|
|
lazy,
|
|
default: defaultFn,
|
|
transform,
|
|
pick: pick2,
|
|
watch: watchSources,
|
|
immediate,
|
|
getCachedData,
|
|
deep,
|
|
dedupe,
|
|
timeout,
|
|
...fetchOptions
|
|
} = {
|
|
...typeof options === "function" ? {} : factoryOptions,
|
|
...opts,
|
|
...typeof options === "function" ? factoryOptions : {}
|
|
};
|
|
const _request = computed(() => toValue(request));
|
|
const key = computed(() => toValue(fetchOptions.key) || "$f" + hash([autoKey, typeof _request.value === "string" ? _request.value : "", ...generateOptionSegments(fetchOptions)]));
|
|
if (!fetchOptions.baseURL && typeof _request.value === "string" && (_request.value[0] === "/" && _request.value[1] === "/")) {
|
|
throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');
|
|
}
|
|
const _fetchOptions = reactive({
|
|
...fetchDefaults,
|
|
...fetchOptions,
|
|
cache: typeof fetchOptions.cache === "boolean" ? void 0 : fetchOptions.cache
|
|
});
|
|
const _asyncDataOptions = {
|
|
server,
|
|
lazy,
|
|
default: defaultFn,
|
|
transform,
|
|
pick: pick2,
|
|
immediate,
|
|
getCachedData,
|
|
deep,
|
|
dedupe,
|
|
timeout,
|
|
watch: watchSources === false ? [] : [...watchSources || [], _fetchOptions]
|
|
};
|
|
if (watchSources === false) {
|
|
_asyncDataOptions._keyTriggersExecute = false;
|
|
}
|
|
const asyncData = useAsyncData(key, (_, { signal }) => {
|
|
let _$fetch = fetchOptions.$fetch || globalThis.$fetch;
|
|
if (!fetchOptions.$fetch) {
|
|
const isLocalFetch = typeof _request.value === "string" && _request.value[0] === "/" && (!toValue(fetchOptions.baseURL) || toValue(fetchOptions.baseURL)[0] === "/");
|
|
if (isLocalFetch) {
|
|
_$fetch = useRequestFetch();
|
|
}
|
|
}
|
|
return _$fetch(_request.value, { signal, ..._fetchOptions });
|
|
}, _asyncDataOptions);
|
|
return asyncData;
|
|
}
|
|
return useFetch2;
|
|
}
|
|
});
|
|
createUseFetch.__nuxt_factory();
|
|
createUseFetch.__nuxt_factory({
|
|
lazy: true,
|
|
// @ts-expect-error private property
|
|
_functionName: "useLazyFetch"
|
|
});
|
|
const plugin = /* @__PURE__ */ defineNuxtPlugin({
|
|
name: "pinia",
|
|
setup(nuxtApp) {
|
|
const pinia = createPinia();
|
|
nuxtApp.vueApp.use(pinia);
|
|
setActivePinia(pinia);
|
|
if (nuxtApp.payload && nuxtApp.payload.pinia) {
|
|
pinia.state.value = nuxtApp.payload.pinia;
|
|
}
|
|
return {
|
|
provide: {
|
|
pinia
|
|
}
|
|
};
|
|
},
|
|
hooks: {
|
|
"app:rendered"() {
|
|
const nuxtApp = useNuxtApp();
|
|
nuxtApp.payload.pinia = toRaw(nuxtApp.$pinia).state.value;
|
|
setActivePinia(void 0);
|
|
}
|
|
}
|
|
});
|
|
const components_plugin_4kY4pyzJIYX99vmMAAIorFf3CnAaptHitJgf7JxiED8 = /* @__PURE__ */ defineNuxtPlugin({
|
|
name: "nuxt:global-components"
|
|
});
|
|
const plugins = [
|
|
payloadPlugin,
|
|
unhead_onaWNbu_aBWmOMZtU6jpQtjACQlz0S9RZ6v_ogqPSGE,
|
|
plugin$1,
|
|
revive_payload_server_y_Jg9TKMK_pSVgbwS3QYggu2__NI0DEkI7DvOxdnJaM,
|
|
plugin,
|
|
components_plugin_4kY4pyzJIYX99vmMAAIorFf3CnAaptHitJgf7JxiED8
|
|
];
|
|
const layouts = {
|
|
auth: defineAsyncComponent(() => import('./auth-DqemnCNa.mjs').then((m) => m.default || m)),
|
|
default: defineAsyncComponent(() => import('./default-DczT8Gyu.mjs').then((m) => m.default || m))
|
|
};
|
|
const routeRulesMatcher = _routeRulesMatcher;
|
|
const LayoutLoader = defineComponent({
|
|
name: "LayoutLoader",
|
|
inheritAttrs: false,
|
|
props: {
|
|
name: String,
|
|
layoutProps: Object
|
|
},
|
|
setup(props, context) {
|
|
return () => h(layouts[props.name], props.layoutProps, context.slots);
|
|
}
|
|
});
|
|
const nuxtLayoutProps = {
|
|
name: {
|
|
type: [String, Boolean, Object],
|
|
default: null
|
|
},
|
|
fallback: {
|
|
type: [String, Object],
|
|
default: null
|
|
}
|
|
};
|
|
const __nuxt_component_0 = defineComponent({
|
|
name: "NuxtLayout",
|
|
inheritAttrs: false,
|
|
props: nuxtLayoutProps,
|
|
setup(props, context) {
|
|
const nuxtApp = useNuxtApp();
|
|
const injectedRoute = inject(PageRouteSymbol);
|
|
const shouldUseEagerRoute = !injectedRoute || injectedRoute === useRoute$1();
|
|
const route = shouldUseEagerRoute ? useRoute() : injectedRoute;
|
|
const layout = computed(() => {
|
|
let layout2 = unref(props.name) ?? route?.meta.layout ?? routeRulesMatcher(route?.path).appLayout ?? "default";
|
|
if (layout2 && !(layout2 in layouts)) {
|
|
if (props.fallback) {
|
|
layout2 = unref(props.fallback);
|
|
}
|
|
}
|
|
return layout2;
|
|
});
|
|
const layoutRef = shallowRef();
|
|
context.expose({ layoutRef });
|
|
const done = nuxtApp.deferHydration();
|
|
let lastLayout;
|
|
return () => {
|
|
const hasLayout = !!layout.value && layout.value in layouts;
|
|
const hasTransition = hasLayout && !!(route?.meta.layoutTransition ?? appLayoutTransition);
|
|
const transitionProps = hasTransition && _mergeTransitionProps([
|
|
route?.meta.layoutTransition,
|
|
appLayoutTransition,
|
|
{
|
|
onBeforeLeave() {
|
|
nuxtApp["~transitionPromise"] = new Promise((resolve) => {
|
|
nuxtApp["~transitionFinish"] = resolve;
|
|
});
|
|
},
|
|
onAfterLeave() {
|
|
nuxtApp["~transitionFinish"]?.();
|
|
delete nuxtApp["~transitionFinish"];
|
|
delete nuxtApp["~transitionPromise"];
|
|
}
|
|
}
|
|
]);
|
|
const previouslyRenderedLayout = lastLayout;
|
|
lastLayout = layout.value;
|
|
return _wrapInTransition(transitionProps, {
|
|
default: () => h(
|
|
Suspense,
|
|
{
|
|
suspensible: true,
|
|
onResolve: async () => {
|
|
await nextTick(done);
|
|
}
|
|
},
|
|
{
|
|
default: () => h(
|
|
LayoutProvider,
|
|
{
|
|
layoutProps: mergeProps(context.attrs, route.meta.layoutProps ?? {}, { ref: layoutRef }),
|
|
key: layout.value || void 0,
|
|
name: layout.value,
|
|
shouldProvide: !props.name,
|
|
isRenderingNewLayout: (name) => {
|
|
return name !== previouslyRenderedLayout && name === layout.value;
|
|
},
|
|
hasTransition
|
|
},
|
|
context.slots
|
|
)
|
|
}
|
|
)
|
|
}).default();
|
|
};
|
|
}
|
|
});
|
|
const LayoutProvider = defineComponent({
|
|
name: "NuxtLayoutProvider",
|
|
inheritAttrs: false,
|
|
props: {
|
|
name: {
|
|
type: [String, Boolean]
|
|
},
|
|
layoutProps: {
|
|
type: Object
|
|
},
|
|
hasTransition: {
|
|
type: Boolean
|
|
},
|
|
shouldProvide: {
|
|
type: Boolean
|
|
},
|
|
isRenderingNewLayout: {
|
|
type: Function,
|
|
required: true
|
|
}
|
|
},
|
|
setup(props, context) {
|
|
const name = props.name;
|
|
if (props.shouldProvide) {
|
|
provide(LayoutMetaSymbol, {
|
|
// When name=false, always return true so NuxtPage doesn't skip rendering
|
|
isCurrent: (route) => name === false || name === (route.meta.layout ?? routeRulesMatcher(route.path).appLayout ?? "default")
|
|
});
|
|
}
|
|
const injectedRoute = inject(PageRouteSymbol);
|
|
const isNotWithinNuxtPage = injectedRoute && injectedRoute === useRoute$1();
|
|
if (isNotWithinNuxtPage) {
|
|
const vueRouterRoute = useRoute();
|
|
const reactiveChildRoute = {};
|
|
for (const _key in vueRouterRoute) {
|
|
const key = _key;
|
|
Object.defineProperty(reactiveChildRoute, key, {
|
|
enumerable: true,
|
|
get: () => {
|
|
return props.isRenderingNewLayout(props.name) ? vueRouterRoute[key] : injectedRoute[key];
|
|
}
|
|
});
|
|
}
|
|
provide(PageRouteSymbol, shallowReactive(reactiveChildRoute));
|
|
}
|
|
return () => {
|
|
if (!name || typeof name === "string" && !(name in layouts)) {
|
|
return context.slots.default?.();
|
|
}
|
|
return h(
|
|
LayoutLoader,
|
|
{ key: name, layoutProps: props.layoutProps, name },
|
|
context.slots
|
|
);
|
|
};
|
|
}
|
|
});
|
|
const defineRouteProvider = (name = "RouteProvider") => defineComponent({
|
|
name,
|
|
props: {
|
|
route: {
|
|
type: Object,
|
|
required: true
|
|
},
|
|
vnode: Object,
|
|
vnodeRef: Object,
|
|
renderKey: String,
|
|
trackRootNodes: Boolean
|
|
},
|
|
setup(props) {
|
|
const previousKey = props.renderKey;
|
|
const previousRoute = props.route;
|
|
const route = {};
|
|
for (const key in props.route) {
|
|
Object.defineProperty(route, key, {
|
|
get: () => previousKey === props.renderKey ? props.route[key] : previousRoute[key],
|
|
enumerable: true
|
|
});
|
|
}
|
|
provide(PageRouteSymbol, shallowReactive(route));
|
|
return () => {
|
|
if (!props.vnode) {
|
|
return props.vnode;
|
|
}
|
|
return h(props.vnode, { ref: props.vnodeRef });
|
|
};
|
|
}
|
|
});
|
|
const RouteProvider = defineRouteProvider();
|
|
const __nuxt_component_1 = defineComponent({
|
|
name: "NuxtPage",
|
|
inheritAttrs: false,
|
|
props: {
|
|
name: {
|
|
type: String
|
|
},
|
|
transition: {
|
|
type: [Boolean, Object],
|
|
default: void 0
|
|
},
|
|
keepalive: {
|
|
type: [Boolean, Object],
|
|
default: void 0
|
|
},
|
|
route: {
|
|
type: Object
|
|
},
|
|
pageKey: {
|
|
type: [Function, String],
|
|
default: null
|
|
}
|
|
},
|
|
setup(props, { attrs, slots, expose }) {
|
|
const nuxtApp = useNuxtApp();
|
|
const pageRef = ref();
|
|
inject(PageRouteSymbol, null);
|
|
expose({ pageRef });
|
|
inject(LayoutMetaSymbol, null);
|
|
nuxtApp.deferHydration();
|
|
return () => {
|
|
return h(RouterView, { name: props.name, route: props.route, ...attrs }, {
|
|
default: (routeProps) => {
|
|
return h(Suspense, { suspensible: true }, {
|
|
default() {
|
|
return h(RouteProvider, {
|
|
vnode: slots.default ? normalizeSlot(slots.default, routeProps) : routeProps.Component,
|
|
route: routeProps.route,
|
|
vnodeRef: pageRef
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
}
|
|
});
|
|
function normalizeSlot(slot, data) {
|
|
const slotContent = slot(data);
|
|
return slotContent.length === 1 ? h(slotContent[0]) : h(Fragment, void 0, slotContent);
|
|
}
|
|
const _export_sfc = (sfc, props) => {
|
|
const target = sfc.__vccOpts || sfc;
|
|
for (const [key, val] of props) {
|
|
target[key] = val;
|
|
}
|
|
return target;
|
|
};
|
|
const _sfc_main$2 = {};
|
|
function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
|
|
const _component_NuxtLayout = __nuxt_component_0;
|
|
const _component_NuxtPage = __nuxt_component_1;
|
|
_push(ssrRenderComponent(_component_NuxtLayout, _attrs, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(ssrRenderComponent(_component_NuxtPage, null, null, _parent2, _scopeId));
|
|
} else {
|
|
return [
|
|
createVNode(_component_NuxtPage)
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
}
|
|
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
_sfc_main$2.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("app.vue");
|
|
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
};
|
|
const AppComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender]]);
|
|
const _sfc_main$1 = {
|
|
__name: "nuxt-error-page",
|
|
__ssrInlineRender: true,
|
|
props: {
|
|
error: Object
|
|
},
|
|
setup(__props) {
|
|
const props = __props;
|
|
const _error = props.error;
|
|
const status = Number(_error.statusCode || 500);
|
|
const is404 = status === 404;
|
|
const statusText = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
|
|
const description = _error.message || _error.toString();
|
|
const stack = void 0;
|
|
const _Error404 = defineAsyncComponent(() => import('./error-404-TJ9uDhjc.mjs'));
|
|
const _Error = defineAsyncComponent(() => import('./error-500-CgDjeMo9.mjs'));
|
|
const ErrorTemplate = is404 ? _Error404 : _Error;
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ status: unref(status), statusText: unref(statusText), statusCode: unref(status), statusMessage: unref(statusText), description: unref(description), stack: unref(stack) }, _attrs), null, _parent));
|
|
};
|
|
}
|
|
};
|
|
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
_sfc_main$1.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/.pnpm/nuxt@4.4.8_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_25b4a4016600149c0331b87503aafc6b/node_modules/nuxt/dist/app/components/nuxt-error-page.vue");
|
|
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
};
|
|
const _sfc_main = {
|
|
__name: "nuxt-root",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const IslandRenderer = () => null;
|
|
const nuxtApp = useNuxtApp();
|
|
nuxtApp.deferHydration();
|
|
nuxtApp.ssrContext.url;
|
|
const SingleRenderer = false;
|
|
provide(PageRouteSymbol, useRoute$1());
|
|
nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup", []);
|
|
const error = /* @__PURE__ */ useError();
|
|
const abortRender = error.value && !nuxtApp.ssrContext.error;
|
|
function invokeAppErrorHandler(err, target, info) {
|
|
const errorHandler = nuxtApp.vueApp.config.errorHandler;
|
|
if (errorHandler && !errorHandler.__nuxt_default) {
|
|
try {
|
|
errorHandler(err, target, info);
|
|
} catch (handlerError) {
|
|
console.error("[nuxt] Error in `app.config.errorHandler`", handlerError);
|
|
}
|
|
}
|
|
}
|
|
onErrorCaptured((err, target, info) => {
|
|
nuxtApp.hooks.callHook("vue:error", err, target, info)?.catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
|
|
{
|
|
const p = nuxtApp.runWithContext(() => showError(err));
|
|
onServerPrefetch(() => p);
|
|
invokeAppErrorHandler(err, target, info);
|
|
return false;
|
|
}
|
|
});
|
|
const islandContext = nuxtApp.ssrContext.islandContext;
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
ssrRenderSuspense(_push, {
|
|
default: () => {
|
|
if (unref(abortRender)) {
|
|
_push(`<div></div>`);
|
|
} else if (unref(error)) {
|
|
_push(ssrRenderComponent(unref(_sfc_main$1), { error: unref(error) }, null, _parent));
|
|
} else if (unref(islandContext)) {
|
|
_push(ssrRenderComponent(unref(IslandRenderer), { context: unref(islandContext) }, null, _parent));
|
|
} else if (unref(SingleRenderer)) {
|
|
ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(SingleRenderer)), null, null), _parent);
|
|
} else {
|
|
_push(ssrRenderComponent(unref(AppComponent), null, null, _parent));
|
|
}
|
|
},
|
|
_: 1
|
|
});
|
|
};
|
|
}
|
|
};
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/.pnpm/nuxt@4.4.8_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_25b4a4016600149c0331b87503aafc6b/node_modules/nuxt/dist/app/components/nuxt-root.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
let entry;
|
|
{
|
|
entry = async function createNuxtAppServer(ssrContext) {
|
|
const vueApp = createApp(_sfc_main);
|
|
const nuxt = createNuxtApp({ vueApp, ssrContext });
|
|
try {
|
|
await applyPlugins(nuxt, plugins);
|
|
await nuxt.hooks.callHook("app:created", vueApp);
|
|
} catch (error) {
|
|
await nuxt.hooks.callHook("app:error", error);
|
|
nuxt.payload.error ||= createError(error);
|
|
}
|
|
if (ssrContext && (ssrContext["~renderResponse"] || ssrContext._renderResponse)) {
|
|
throw new Error("skipping render");
|
|
}
|
|
return vueApp;
|
|
};
|
|
}
|
|
const entry_default = ((ssrContext) => entry(ssrContext));
|
|
|
|
export { ALL_MENU_IDS as A, DEFAULT_ADMIN_ACCESS as D, MENU_GROUPS as M, ROLE_ACCESS_CEILING as R, _export_sfc as _, useAuthStore as a, useRouter as b, useRoute$1 as c, useRuntimeConfig as d, entry_default as default, encodeRoutePath as e, nuxtLinkDefaults as f, navigateTo as n, resolveRouteObject as r, useNuxtApp as u };
|
|
//# sourceMappingURL=server.mjs.map
|
|
|