server.mjs 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412
  1. import { effectScope, shallowReactive, reactive, getCurrentScope, hasInjectionContext, getCurrentInstance, inject, toRef, version, unref, h, shallowRef, isReadonly, isRef, isShallow, isReactive, toRaw, defineComponent, computed, ref, provide, Suspense, nextTick, mergeProps, Transition, watch, Fragment, withCtx, createVNode, useSSRContext, defineAsyncComponent, onErrorCaptured, onServerPrefetch, resolveDynamicComponent, createApp } from "vue";
  2. import { $fetch } from "ofetch";
  3. import { baseURL } from "#internal/nuxt/paths";
  4. import { createHooks } from "hookable";
  5. import { getContext } from "unctx";
  6. import { sanitizeStatusCode, createError as createError$1, appendHeader } from "h3";
  7. import { getActiveHead, CapoPlugin } from "unhead";
  8. import { defineHeadPlugin } from "@unhead/shared";
  9. import { START_LOCATION, createMemoryHistory, createRouter as createRouter$1, useRoute as useRoute$1, RouterView } from "vue-router";
  10. import { toRouteMatcher, createRouter } from "radix3";
  11. import { defu } from "defu";
  12. import { hasProtocol, isScriptProtocol, joinURL, withQuery } from "ufo";
  13. import { createPinia } from "pinia";
  14. import { ssrRenderAttrs, ssrRenderComponent, ssrRenderSuspense, ssrRenderVNode } from "vue/server-renderer";
  15. if (!globalThis.$fetch) {
  16. globalThis.$fetch = $fetch.create({
  17. baseURL: baseURL()
  18. });
  19. }
  20. const appLayoutTransition = false;
  21. const appPageTransition = false;
  22. const appKeepalive = false;
  23. const nuxtLinkDefaults = { "componentName": "NuxtLink", "prefetch": true, "prefetchOn": { "visibility": true } };
  24. const appId = "nuxt-app";
  25. function getNuxtAppCtx(id = appId) {
  26. return getContext(id, {
  27. asyncContext: false
  28. });
  29. }
  30. const NuxtPluginIndicator = "__nuxt_plugin";
  31. function createNuxtApp(options) {
  32. var _a;
  33. let hydratingCount = 0;
  34. const nuxtApp = {
  35. _id: options.id || appId || "nuxt-app",
  36. _scope: effectScope(),
  37. provide: void 0,
  38. globalName: "nuxt",
  39. versions: {
  40. get nuxt() {
  41. return "3.13.2";
  42. },
  43. get vue() {
  44. return nuxtApp.vueApp.version;
  45. }
  46. },
  47. payload: shallowReactive({
  48. ...((_a = options.ssrContext) == null ? void 0 : _a.payload) || {},
  49. data: shallowReactive({}),
  50. state: reactive({}),
  51. once: /* @__PURE__ */ new Set(),
  52. _errors: shallowReactive({})
  53. }),
  54. static: {
  55. data: {}
  56. },
  57. runWithContext(fn) {
  58. if (nuxtApp._scope.active && !getCurrentScope()) {
  59. return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn));
  60. }
  61. return callWithNuxt(nuxtApp, fn);
  62. },
  63. isHydrating: false,
  64. deferHydration() {
  65. if (!nuxtApp.isHydrating) {
  66. return () => {
  67. };
  68. }
  69. hydratingCount++;
  70. let called = false;
  71. return () => {
  72. if (called) {
  73. return;
  74. }
  75. called = true;
  76. hydratingCount--;
  77. if (hydratingCount === 0) {
  78. nuxtApp.isHydrating = false;
  79. return nuxtApp.callHook("app:suspense:resolve");
  80. }
  81. };
  82. },
  83. _asyncDataPromises: {},
  84. _asyncData: shallowReactive({}),
  85. _payloadRevivers: {},
  86. ...options
  87. };
  88. {
  89. nuxtApp.payload.serverRendered = true;
  90. }
  91. if (nuxtApp.ssrContext) {
  92. nuxtApp.payload.path = nuxtApp.ssrContext.url;
  93. nuxtApp.ssrContext.nuxt = nuxtApp;
  94. nuxtApp.ssrContext.payload = nuxtApp.payload;
  95. nuxtApp.ssrContext.config = {
  96. public: nuxtApp.ssrContext.runtimeConfig.public,
  97. app: nuxtApp.ssrContext.runtimeConfig.app
  98. };
  99. }
  100. nuxtApp.hooks = createHooks();
  101. nuxtApp.hook = nuxtApp.hooks.hook;
  102. {
  103. const contextCaller = async function(hooks, args) {
  104. for (const hook of hooks) {
  105. await nuxtApp.runWithContext(() => hook(...args));
  106. }
  107. };
  108. nuxtApp.hooks.callHook = (name, ...args) => nuxtApp.hooks.callHookWith(contextCaller, name, ...args);
  109. }
  110. nuxtApp.callHook = nuxtApp.hooks.callHook;
  111. nuxtApp.provide = (name, value) => {
  112. const $name = "$" + name;
  113. defineGetter(nuxtApp, $name, value);
  114. defineGetter(nuxtApp.vueApp.config.globalProperties, $name, value);
  115. };
  116. defineGetter(nuxtApp.vueApp, "$nuxt", nuxtApp);
  117. defineGetter(nuxtApp.vueApp.config.globalProperties, "$nuxt", nuxtApp);
  118. const runtimeConfig = options.ssrContext.runtimeConfig;
  119. nuxtApp.provide("config", runtimeConfig);
  120. return nuxtApp;
  121. }
  122. function registerPluginHooks(nuxtApp, plugin2) {
  123. if (plugin2.hooks) {
  124. nuxtApp.hooks.addHooks(plugin2.hooks);
  125. }
  126. }
  127. async function applyPlugin(nuxtApp, plugin2) {
  128. if (typeof plugin2 === "function") {
  129. const { provide: provide2 } = await nuxtApp.runWithContext(() => plugin2(nuxtApp)) || {};
  130. if (provide2 && typeof provide2 === "object") {
  131. for (const key in provide2) {
  132. nuxtApp.provide(key, provide2[key]);
  133. }
  134. }
  135. }
  136. }
  137. async function applyPlugins(nuxtApp, plugins2) {
  138. var _a, _b, _c, _d;
  139. const resolvedPlugins = [];
  140. const unresolvedPlugins = [];
  141. const parallels = [];
  142. const errors = [];
  143. let promiseDepth = 0;
  144. async function executePlugin(plugin2) {
  145. var _a2;
  146. const unresolvedPluginsForThisPlugin = ((_a2 = plugin2.dependsOn) == null ? void 0 : _a2.filter((name) => plugins2.some((p) => p._name === name) && !resolvedPlugins.includes(name))) ?? [];
  147. if (unresolvedPluginsForThisPlugin.length > 0) {
  148. unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin2]);
  149. } else {
  150. const promise = applyPlugin(nuxtApp, plugin2).then(async () => {
  151. if (plugin2._name) {
  152. resolvedPlugins.push(plugin2._name);
  153. await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => {
  154. if (dependsOn.has(plugin2._name)) {
  155. dependsOn.delete(plugin2._name);
  156. if (dependsOn.size === 0) {
  157. promiseDepth++;
  158. await executePlugin(unexecutedPlugin);
  159. }
  160. }
  161. }));
  162. }
  163. });
  164. if (plugin2.parallel) {
  165. parallels.push(promise.catch((e) => errors.push(e)));
  166. } else {
  167. await promise;
  168. }
  169. }
  170. }
  171. for (const plugin2 of plugins2) {
  172. if (((_a = nuxtApp.ssrContext) == null ? void 0 : _a.islandContext) && ((_b = plugin2.env) == null ? void 0 : _b.islands) === false) {
  173. continue;
  174. }
  175. registerPluginHooks(nuxtApp, plugin2);
  176. }
  177. for (const plugin2 of plugins2) {
  178. if (((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext) && ((_d = plugin2.env) == null ? void 0 : _d.islands) === false) {
  179. continue;
  180. }
  181. await executePlugin(plugin2);
  182. }
  183. await Promise.all(parallels);
  184. if (promiseDepth) {
  185. for (let i = 0; i < promiseDepth; i++) {
  186. await Promise.all(parallels);
  187. }
  188. }
  189. if (errors.length) {
  190. throw errors[0];
  191. }
  192. }
  193. // @__NO_SIDE_EFFECTS__
  194. function defineNuxtPlugin(plugin2) {
  195. if (typeof plugin2 === "function") {
  196. return plugin2;
  197. }
  198. const _name = plugin2._name || plugin2.name;
  199. delete plugin2.name;
  200. return Object.assign(plugin2.setup || (() => {
  201. }), plugin2, { [NuxtPluginIndicator]: true, _name });
  202. }
  203. function callWithNuxt(nuxt, setup, args) {
  204. const fn = () => setup();
  205. const nuxtAppCtx = getNuxtAppCtx(nuxt._id);
  206. {
  207. return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn));
  208. }
  209. }
  210. function tryUseNuxtApp(id) {
  211. var _a;
  212. let nuxtAppInstance;
  213. if (hasInjectionContext()) {
  214. nuxtAppInstance = (_a = getCurrentInstance()) == null ? void 0 : _a.appContext.app.$nuxt;
  215. }
  216. nuxtAppInstance = nuxtAppInstance || getNuxtAppCtx(id).tryUse();
  217. return nuxtAppInstance || null;
  218. }
  219. function useNuxtApp(id) {
  220. const nuxtAppInstance = tryUseNuxtApp(id);
  221. if (!nuxtAppInstance) {
  222. {
  223. throw new Error("[nuxt] instance unavailable");
  224. }
  225. }
  226. return nuxtAppInstance;
  227. }
  228. // @__NO_SIDE_EFFECTS__
  229. function useRuntimeConfig(_event) {
  230. return useNuxtApp().$config;
  231. }
  232. function defineGetter(obj, key, val) {
  233. Object.defineProperty(obj, key, { get: () => val });
  234. }
  235. const LayoutMetaSymbol = Symbol("layout-meta");
  236. const PageRouteSymbol = Symbol("route");
  237. const useRouter = () => {
  238. var _a;
  239. return (_a = useNuxtApp()) == null ? void 0 : _a.$router;
  240. };
  241. const useRoute = () => {
  242. if (hasInjectionContext()) {
  243. return inject(PageRouteSymbol, useNuxtApp()._route);
  244. }
  245. return useNuxtApp()._route;
  246. };
  247. // @__NO_SIDE_EFFECTS__
  248. function defineNuxtRouteMiddleware(middleware) {
  249. return middleware;
  250. }
  251. const isProcessingMiddleware = () => {
  252. try {
  253. if (useNuxtApp()._processingMiddleware) {
  254. return true;
  255. }
  256. } catch {
  257. return false;
  258. }
  259. return false;
  260. };
  261. const navigateTo = (to, options) => {
  262. if (!to) {
  263. to = "/";
  264. }
  265. const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter().resolve(to).href;
  266. const isExternalHost = hasProtocol(toPath, { acceptRelative: true });
  267. const isExternal = (options == null ? void 0 : options.external) || isExternalHost;
  268. if (isExternal) {
  269. if (!(options == null ? void 0 : options.external)) {
  270. throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");
  271. }
  272. const { protocol } = new URL(toPath, "http://localhost");
  273. if (protocol && isScriptProtocol(protocol)) {
  274. throw new Error(`Cannot navigate to a URL with '${protocol}' protocol.`);
  275. }
  276. }
  277. const inMiddleware = isProcessingMiddleware();
  278. const router = useRouter();
  279. const nuxtApp = useNuxtApp();
  280. {
  281. if (nuxtApp.ssrContext) {
  282. const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).fullPath || "/";
  283. const location2 = isExternal ? toPath : joinURL((/* @__PURE__ */ useRuntimeConfig()).app.baseURL, fullPath);
  284. const redirect = async function(response) {
  285. await nuxtApp.callHook("app:redirected");
  286. const encodedLoc = location2.replace(/"/g, "%22");
  287. const encodedHeader = encodeURL(location2, isExternalHost);
  288. nuxtApp.ssrContext._renderResponse = {
  289. statusCode: sanitizeStatusCode((options == null ? void 0 : options.redirectCode) || 302, 302),
  290. body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`,
  291. headers: { location: encodedHeader }
  292. };
  293. return response;
  294. };
  295. if (!isExternal && inMiddleware) {
  296. router.afterEach((final) => final.fullPath === fullPath ? redirect(false) : void 0);
  297. return to;
  298. }
  299. return redirect(!inMiddleware ? void 0 : (
  300. /* abort route navigation */
  301. false
  302. ));
  303. }
  304. }
  305. if (isExternal) {
  306. nuxtApp._scope.stop();
  307. if (options == null ? void 0 : options.replace) {
  308. (void 0).replace(toPath);
  309. } else {
  310. (void 0).href = toPath;
  311. }
  312. if (inMiddleware) {
  313. if (!nuxtApp.isHydrating) {
  314. return false;
  315. }
  316. return new Promise(() => {
  317. });
  318. }
  319. return Promise.resolve();
  320. }
  321. return (options == null ? void 0 : options.replace) ? router.replace(to) : router.push(to);
  322. };
  323. function resolveRouteObject(to) {
  324. return withQuery(to.path || "", to.query || {}) + (to.hash || "");
  325. }
  326. function encodeURL(location2, isExternalHost = false) {
  327. const url = new URL(location2, "http://localhost");
  328. if (!isExternalHost) {
  329. return url.pathname + url.search + url.hash;
  330. }
  331. if (location2.startsWith("//")) {
  332. return url.toString().replace(url.protocol, "");
  333. }
  334. return url.toString();
  335. }
  336. const NUXT_ERROR_SIGNATURE = "__nuxt_error";
  337. const useError = () => toRef(useNuxtApp().payload, "error");
  338. const showError = (error) => {
  339. const nuxtError = createError(error);
  340. try {
  341. const nuxtApp = useNuxtApp();
  342. const error2 = useError();
  343. if (false) ;
  344. error2.value = error2.value || nuxtError;
  345. } catch {
  346. throw nuxtError;
  347. }
  348. return nuxtError;
  349. };
  350. const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
  351. const createError = (error) => {
  352. const nuxtError = createError$1(error);
  353. Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
  354. value: true,
  355. configurable: false,
  356. writable: false
  357. });
  358. return nuxtError;
  359. };
  360. version[0] === "3";
  361. function resolveUnref(r) {
  362. return typeof r === "function" ? r() : unref(r);
  363. }
  364. function resolveUnrefHeadInput(ref2) {
  365. if (ref2 instanceof Promise || ref2 instanceof Date || ref2 instanceof RegExp)
  366. return ref2;
  367. const root = resolveUnref(ref2);
  368. if (!ref2 || !root)
  369. return root;
  370. if (Array.isArray(root))
  371. return root.map((r) => resolveUnrefHeadInput(r));
  372. if (typeof root === "object") {
  373. const resolved = {};
  374. for (const k in root) {
  375. if (!Object.prototype.hasOwnProperty.call(root, k)) {
  376. continue;
  377. }
  378. if (k === "titleTemplate" || k[0] === "o" && k[1] === "n") {
  379. resolved[k] = unref(root[k]);
  380. continue;
  381. }
  382. resolved[k] = resolveUnrefHeadInput(root[k]);
  383. }
  384. return resolved;
  385. }
  386. return root;
  387. }
  388. defineHeadPlugin({
  389. hooks: {
  390. "entries:resolve": (ctx) => {
  391. for (const entry2 of ctx.entries)
  392. entry2.resolvedInput = resolveUnrefHeadInput(entry2.input);
  393. }
  394. }
  395. });
  396. const headSymbol = "usehead";
  397. const _global = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  398. const globalKey$1 = "__unhead_injection_handler__";
  399. function setHeadInjectionHandler(handler) {
  400. _global[globalKey$1] = handler;
  401. }
  402. function injectHead() {
  403. if (globalKey$1 in _global) {
  404. return _global[globalKey$1]();
  405. }
  406. const head = inject(headSymbol);
  407. if (!head && process.env.NODE_ENV !== "production")
  408. console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results.");
  409. return head || getActiveHead();
  410. }
  411. [CapoPlugin({ track: true })];
  412. const unhead_KgADcZ0jPj = /* @__PURE__ */ defineNuxtPlugin({
  413. name: "nuxt:head",
  414. enforce: "pre",
  415. setup(nuxtApp) {
  416. const head = nuxtApp.ssrContext.head;
  417. setHeadInjectionHandler(
  418. // need a fresh instance of the nuxt app to avoid parallel requests interfering with each other
  419. () => useNuxtApp().vueApp._context.provides.usehead
  420. );
  421. nuxtApp.vueApp.use(head);
  422. }
  423. });
  424. function createContext(opts = {}) {
  425. let currentInstance;
  426. let isSingleton = false;
  427. const checkConflict = (instance) => {
  428. if (currentInstance && currentInstance !== instance) {
  429. throw new Error("Context conflict");
  430. }
  431. };
  432. let als;
  433. if (opts.asyncContext) {
  434. const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage;
  435. if (_AsyncLocalStorage) {
  436. als = new _AsyncLocalStorage();
  437. } else {
  438. console.warn("[unctx] `AsyncLocalStorage` is not provided.");
  439. }
  440. }
  441. const _getCurrentInstance = () => {
  442. if (als && currentInstance === void 0) {
  443. const instance = als.getStore();
  444. if (instance !== void 0) {
  445. return instance;
  446. }
  447. }
  448. return currentInstance;
  449. };
  450. return {
  451. use: () => {
  452. const _instance = _getCurrentInstance();
  453. if (_instance === void 0) {
  454. throw new Error("Context is not available");
  455. }
  456. return _instance;
  457. },
  458. tryUse: () => {
  459. return _getCurrentInstance();
  460. },
  461. set: (instance, replace) => {
  462. if (!replace) {
  463. checkConflict(instance);
  464. }
  465. currentInstance = instance;
  466. isSingleton = true;
  467. },
  468. unset: () => {
  469. currentInstance = void 0;
  470. isSingleton = false;
  471. },
  472. call: (instance, callback) => {
  473. checkConflict(instance);
  474. currentInstance = instance;
  475. try {
  476. return als ? als.run(instance, callback) : callback();
  477. } finally {
  478. if (!isSingleton) {
  479. currentInstance = void 0;
  480. }
  481. }
  482. },
  483. async callAsync(instance, callback) {
  484. currentInstance = instance;
  485. const onRestore = () => {
  486. currentInstance = instance;
  487. };
  488. const onLeave = () => currentInstance === instance ? onRestore : void 0;
  489. asyncHandlers.add(onLeave);
  490. try {
  491. const r = als ? als.run(instance, callback) : callback();
  492. if (!isSingleton) {
  493. currentInstance = void 0;
  494. }
  495. return await r;
  496. } finally {
  497. asyncHandlers.delete(onLeave);
  498. }
  499. }
  500. };
  501. }
  502. function createNamespace(defaultOpts = {}) {
  503. const contexts = {};
  504. return {
  505. get(key, opts = {}) {
  506. if (!contexts[key]) {
  507. contexts[key] = createContext({ ...defaultOpts, ...opts });
  508. }
  509. contexts[key];
  510. return contexts[key];
  511. }
  512. };
  513. }
  514. const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : {};
  515. const globalKey = "__unctx__";
  516. _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace());
  517. const asyncHandlersKey = "__unctx_async_handlers__";
  518. const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set());
  519. function executeAsync(function_) {
  520. const restores = [];
  521. for (const leaveHandler of asyncHandlers) {
  522. const restore2 = leaveHandler();
  523. if (restore2) {
  524. restores.push(restore2);
  525. }
  526. }
  527. const restore = () => {
  528. for (const restore2 of restores) {
  529. restore2();
  530. }
  531. };
  532. let awaitable = function_();
  533. if (awaitable && typeof awaitable === "object" && "catch" in awaitable) {
  534. awaitable = awaitable.catch((error) => {
  535. restore();
  536. throw error;
  537. });
  538. }
  539. return [awaitable, restore];
  540. }
  541. const interpolatePath = (route, match) => {
  542. return match.path.replace(/(:\w+)\([^)]+\)/g, "$1").replace(/(:\w+)[?+*]/g, "$1").replace(/:\w+/g, (r) => {
  543. var _a;
  544. return ((_a = route.params[r.slice(1)]) == null ? void 0 : _a.toString()) || "";
  545. });
  546. };
  547. const generateRouteKey$1 = (routeProps, override) => {
  548. const matchedRoute = routeProps.route.matched.find((m) => {
  549. var _a;
  550. return ((_a = m.components) == null ? void 0 : _a.default) === routeProps.Component.type;
  551. });
  552. const source = override ?? (matchedRoute == null ? void 0 : matchedRoute.meta.key) ?? (matchedRoute && interpolatePath(routeProps.route, matchedRoute));
  553. return typeof source === "function" ? source(routeProps.route) : source;
  554. };
  555. const wrapInKeepAlive = (props, children) => {
  556. return { default: () => children };
  557. };
  558. function toArray$1(value) {
  559. return Array.isArray(value) ? value : [value];
  560. }
  561. async function getRouteRules(url) {
  562. {
  563. const _routeRulesMatcher = toRouteMatcher(
  564. createRouter({ routes: (/* @__PURE__ */ useRuntimeConfig()).nitro.routeRules })
  565. );
  566. return defu({}, ..._routeRulesMatcher.matchAll(url).reverse());
  567. }
  568. }
  569. const __nuxt_page_meta = {
  570. middleware: "auth"
  571. };
  572. const _routes = [
  573. {
  574. name: "advertising-adDetail",
  575. path: "/advertising/adDetail",
  576. component: () => import("./_nuxt/adDetail-CbL4xuDD.js")
  577. },
  578. {
  579. name: "advertising",
  580. path: "/advertising",
  581. component: () => import("./_nuxt/index-DTXcdam9.js")
  582. },
  583. {
  584. name: "index",
  585. path: "/",
  586. component: () => import("./_nuxt/index-CZZcRNnl.js")
  587. },
  588. {
  589. name: "login",
  590. path: "/login",
  591. component: () => import("./_nuxt/login-DfCN0ewm.js")
  592. },
  593. {
  594. name: "primaryNavigation-id",
  595. path: "/primaryNavigation/:id()",
  596. component: () => import("./_nuxt/_id_-CQDbv71l.js")
  597. },
  598. {
  599. name: "primaryNavigation-newsDetail-newsDetail",
  600. path: "/primaryNavigation/newsDetail/newsDetail",
  601. component: () => import("./_nuxt/newsDetail-CkWNmlhH.js")
  602. },
  603. {
  604. name: "primaryNavigation-newsList",
  605. path: "/primaryNavigation/newsList",
  606. meta: __nuxt_page_meta || {},
  607. component: () => import("./_nuxt/newsList-DnLyRN53.js")
  608. },
  609. {
  610. name: "register",
  611. path: "/register",
  612. component: () => import("./_nuxt/register-BaQ9c9VV.js")
  613. },
  614. {
  615. name: "user-about",
  616. path: "/user/about",
  617. component: () => import("./_nuxt/about-BQoZ6Vl3.js")
  618. }
  619. ];
  620. const _wrapIf = (component, props, slots) => {
  621. props = props === true ? {} : props;
  622. return { default: () => {
  623. var _a;
  624. return props ? h(component, props, slots) : (_a = slots.default) == null ? void 0 : _a.call(slots);
  625. } };
  626. };
  627. function generateRouteKey(route) {
  628. const source = (route == null ? void 0 : route.meta.key) ?? route.path.replace(/(:\w+)\([^)]+\)/g, "$1").replace(/(:\w+)[?+*]/g, "$1").replace(/:\w+/g, (r) => {
  629. var _a;
  630. return ((_a = route.params[r.slice(1)]) == null ? void 0 : _a.toString()) || "";
  631. });
  632. return typeof source === "function" ? source(route) : source;
  633. }
  634. function isChangingPage(to, from) {
  635. if (to === from || from === START_LOCATION) {
  636. return false;
  637. }
  638. if (generateRouteKey(to) !== generateRouteKey(from)) {
  639. return true;
  640. }
  641. const areComponentsSame = to.matched.every(
  642. (comp, index) => {
  643. var _a, _b;
  644. return comp.components && comp.components.default === ((_b = (_a = from.matched[index]) == null ? void 0 : _a.components) == null ? void 0 : _b.default);
  645. }
  646. );
  647. if (areComponentsSame) {
  648. return false;
  649. }
  650. return true;
  651. }
  652. const routerOptions0 = {
  653. scrollBehavior(to, from, savedPosition) {
  654. var _a;
  655. const nuxtApp = useNuxtApp();
  656. const behavior = ((_a = useRouter().options) == null ? void 0 : _a.scrollBehaviorType) ?? "auto";
  657. let position = savedPosition || void 0;
  658. const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop;
  659. if (!position && from && to && routeAllowsScrollToTop !== false && isChangingPage(to, from)) {
  660. position = { left: 0, top: 0 };
  661. }
  662. if (to.path === from.path) {
  663. if (from.hash && !to.hash) {
  664. return { left: 0, top: 0 };
  665. }
  666. if (to.hash) {
  667. return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
  668. }
  669. return false;
  670. }
  671. const hasTransition = (route) => !!(route.meta.pageTransition ?? appPageTransition);
  672. const hookToWait = hasTransition(from) && hasTransition(to) ? "page:transition:finish" : "page:finish";
  673. return new Promise((resolve) => {
  674. nuxtApp.hooks.hookOnce(hookToWait, async () => {
  675. await new Promise((resolve2) => setTimeout(resolve2, 0));
  676. if (to.hash) {
  677. position = { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
  678. }
  679. resolve(position);
  680. });
  681. });
  682. }
  683. };
  684. function _getHashElementScrollMarginTop(selector) {
  685. try {
  686. const elem = (void 0).querySelector(selector);
  687. if (elem) {
  688. return (Number.parseFloat(getComputedStyle(elem).scrollMarginTop) || 0) + (Number.parseFloat(getComputedStyle((void 0).documentElement).scrollPaddingTop) || 0);
  689. }
  690. } catch {
  691. }
  692. return 0;
  693. }
  694. const configRouterOptions = {
  695. hashMode: false,
  696. scrollBehaviorType: "auto"
  697. };
  698. const routerOptions = {
  699. ...configRouterOptions,
  700. ...routerOptions0
  701. };
  702. const validate = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => {
  703. var _a;
  704. let __temp, __restore;
  705. if (!((_a = to.meta) == null ? void 0 : _a.validate)) {
  706. return;
  707. }
  708. const nuxtApp = useNuxtApp();
  709. const router = useRouter();
  710. const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp);
  711. if (result === true) {
  712. return;
  713. }
  714. const error = createError({
  715. statusCode: result && result.statusCode || 404,
  716. statusMessage: result && result.statusMessage || `Page Not Found: ${to.fullPath}`,
  717. data: {
  718. path: to.fullPath
  719. }
  720. });
  721. const unsub = router.beforeResolve((final) => {
  722. unsub();
  723. if (final === to) {
  724. const unsub2 = router.afterEach(async () => {
  725. unsub2();
  726. await nuxtApp.runWithContext(() => showError(error));
  727. });
  728. return false;
  729. }
  730. });
  731. });
  732. const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => {
  733. {
  734. return;
  735. }
  736. });
  737. const globalMiddleware = [
  738. validate,
  739. manifest_45route_45rule
  740. ];
  741. const namedMiddleware = {
  742. auth: () => import("./_nuxt/auth-DRRsgHvx.js")
  743. };
  744. const plugin = /* @__PURE__ */ defineNuxtPlugin({
  745. name: "nuxt:router",
  746. enforce: "pre",
  747. async setup(nuxtApp) {
  748. var _a, _b, _c;
  749. let __temp, __restore;
  750. let routerBase = (/* @__PURE__ */ useRuntimeConfig()).app.baseURL;
  751. if (routerOptions.hashMode && !routerBase.includes("#")) {
  752. routerBase += "#";
  753. }
  754. const history = ((_a = routerOptions.history) == null ? void 0 : _a.call(routerOptions, routerBase)) ?? createMemoryHistory(routerBase);
  755. const routes2 = routerOptions.routes ? ([__temp, __restore] = executeAsync(() => routerOptions.routes(_routes)), __temp = await __temp, __restore(), __temp) ?? _routes : _routes;
  756. let startPosition;
  757. const router = createRouter$1({
  758. ...routerOptions,
  759. scrollBehavior: (to, from, savedPosition) => {
  760. if (from === START_LOCATION) {
  761. startPosition = savedPosition;
  762. return;
  763. }
  764. if (routerOptions.scrollBehavior) {
  765. router.options.scrollBehavior = routerOptions.scrollBehavior;
  766. if ("scrollRestoration" in (void 0).history) {
  767. const unsub = router.beforeEach(() => {
  768. unsub();
  769. (void 0).history.scrollRestoration = "manual";
  770. });
  771. }
  772. return routerOptions.scrollBehavior(to, START_LOCATION, startPosition || savedPosition);
  773. }
  774. },
  775. history,
  776. routes: routes2
  777. });
  778. nuxtApp.vueApp.use(router);
  779. const previousRoute = shallowRef(router.currentRoute.value);
  780. router.afterEach((_to, from) => {
  781. previousRoute.value = from;
  782. });
  783. Object.defineProperty(nuxtApp.vueApp.config.globalProperties, "previousRoute", {
  784. get: () => previousRoute.value
  785. });
  786. const initialURL = nuxtApp.ssrContext.url;
  787. const _route = shallowRef(router.currentRoute.value);
  788. const syncCurrentRoute = () => {
  789. _route.value = router.currentRoute.value;
  790. };
  791. nuxtApp.hook("page:finish", syncCurrentRoute);
  792. router.afterEach((to, from) => {
  793. var _a2, _b2, _c2, _d;
  794. if (((_b2 = (_a2 = to.matched[0]) == null ? void 0 : _a2.components) == null ? void 0 : _b2.default) === ((_d = (_c2 = from.matched[0]) == null ? void 0 : _c2.components) == null ? void 0 : _d.default)) {
  795. syncCurrentRoute();
  796. }
  797. });
  798. const route = {};
  799. for (const key in _route.value) {
  800. Object.defineProperty(route, key, {
  801. get: () => _route.value[key],
  802. enumerable: true
  803. });
  804. }
  805. nuxtApp._route = shallowReactive(route);
  806. nuxtApp._middleware = nuxtApp._middleware || {
  807. global: [],
  808. named: {}
  809. };
  810. useError();
  811. if (!((_b = nuxtApp.ssrContext) == null ? void 0 : _b.islandContext)) {
  812. router.afterEach(async (to, _from, failure) => {
  813. delete nuxtApp._processingMiddleware;
  814. if (failure) {
  815. await nuxtApp.callHook("page:loading:end");
  816. }
  817. if ((failure == null ? void 0 : failure.type) === 4) {
  818. return;
  819. }
  820. if (to.matched.length === 0) {
  821. await nuxtApp.runWithContext(() => showError(createError$1({
  822. statusCode: 404,
  823. fatal: false,
  824. statusMessage: `Page not found: ${to.fullPath}`,
  825. data: {
  826. path: to.fullPath
  827. }
  828. })));
  829. } else if (to.redirectedFrom && to.fullPath !== initialURL) {
  830. await nuxtApp.runWithContext(() => navigateTo(to.fullPath || "/"));
  831. }
  832. });
  833. }
  834. try {
  835. if (true) {
  836. ;
  837. [__temp, __restore] = executeAsync(() => router.push(initialURL)), await __temp, __restore();
  838. ;
  839. }
  840. ;
  841. [__temp, __restore] = executeAsync(() => router.isReady()), await __temp, __restore();
  842. ;
  843. } catch (error2) {
  844. [__temp, __restore] = executeAsync(() => nuxtApp.runWithContext(() => showError(error2))), await __temp, __restore();
  845. }
  846. const resolvedInitialRoute = router.currentRoute.value;
  847. syncCurrentRoute();
  848. if ((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext) {
  849. return { provide: { router } };
  850. }
  851. const initialLayout = nuxtApp.payload.state._layout;
  852. router.beforeEach(async (to, from) => {
  853. var _a2, _b2;
  854. await nuxtApp.callHook("page:loading:start");
  855. to.meta = reactive(to.meta);
  856. if (nuxtApp.isHydrating && initialLayout && !isReadonly(to.meta.layout)) {
  857. to.meta.layout = initialLayout;
  858. }
  859. nuxtApp._processingMiddleware = true;
  860. if (!((_a2 = nuxtApp.ssrContext) == null ? void 0 : _a2.islandContext)) {
  861. const middlewareEntries = /* @__PURE__ */ new Set([...globalMiddleware, ...nuxtApp._middleware.global]);
  862. for (const component of to.matched) {
  863. const componentMiddleware = component.meta.middleware;
  864. if (!componentMiddleware) {
  865. continue;
  866. }
  867. for (const entry2 of toArray$1(componentMiddleware)) {
  868. middlewareEntries.add(entry2);
  869. }
  870. }
  871. {
  872. const routeRules = await nuxtApp.runWithContext(() => getRouteRules(to.path));
  873. if (routeRules.appMiddleware) {
  874. for (const key in routeRules.appMiddleware) {
  875. if (routeRules.appMiddleware[key]) {
  876. middlewareEntries.add(key);
  877. } else {
  878. middlewareEntries.delete(key);
  879. }
  880. }
  881. }
  882. }
  883. for (const entry2 of middlewareEntries) {
  884. const middleware = typeof entry2 === "string" ? nuxtApp._middleware.named[entry2] || await ((_b2 = namedMiddleware[entry2]) == null ? void 0 : _b2.call(namedMiddleware).then((r) => r.default || r)) : entry2;
  885. if (!middleware) {
  886. throw new Error(`Unknown route middleware: '${entry2}'.`);
  887. }
  888. const result = await nuxtApp.runWithContext(() => middleware(to, from));
  889. {
  890. if (result === false || result instanceof Error) {
  891. const error2 = result || createError$1({
  892. statusCode: 404,
  893. statusMessage: `Page Not Found: ${initialURL}`
  894. });
  895. await nuxtApp.runWithContext(() => showError(error2));
  896. return false;
  897. }
  898. }
  899. if (result === true) {
  900. continue;
  901. }
  902. if (result || result === false) {
  903. return result;
  904. }
  905. }
  906. }
  907. });
  908. router.onError(async () => {
  909. delete nuxtApp._processingMiddleware;
  910. await nuxtApp.callHook("page:loading:end");
  911. });
  912. nuxtApp.hooks.hookOnce("app:created", async () => {
  913. try {
  914. if ("name" in resolvedInitialRoute) {
  915. resolvedInitialRoute.name = void 0;
  916. }
  917. await router.replace({
  918. ...resolvedInitialRoute,
  919. force: true
  920. });
  921. router.options.scrollBehavior = routerOptions.scrollBehavior;
  922. } catch (error2) {
  923. await nuxtApp.runWithContext(() => showError(error2));
  924. }
  925. });
  926. return { provide: { router } };
  927. }
  928. });
  929. function definePayloadReducer(name, reduce) {
  930. {
  931. useNuxtApp().ssrContext._payloadReducers[name] = reduce;
  932. }
  933. }
  934. const reducers = [
  935. ["NuxtError", (data) => isNuxtError(data) && data.toJSON()],
  936. ["EmptyShallowRef", (data) => isRef(data) && isShallow(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
  937. ["EmptyRef", (data) => isRef(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
  938. ["ShallowRef", (data) => isRef(data) && isShallow(data) && data.value],
  939. ["ShallowReactive", (data) => isReactive(data) && isShallow(data) && toRaw(data)],
  940. ["Ref", (data) => isRef(data) && data.value],
  941. ["Reactive", (data) => isReactive(data) && toRaw(data)]
  942. ];
  943. const revive_payload_server_eJ33V7gbc6 = /* @__PURE__ */ defineNuxtPlugin({
  944. name: "nuxt:revive-payload:server",
  945. setup() {
  946. for (const [reducer, fn] of reducers) {
  947. definePayloadReducer(reducer, fn);
  948. }
  949. }
  950. });
  951. const components_plugin_KR1HBZs4kY = /* @__PURE__ */ defineNuxtPlugin({
  952. name: "nuxt:global-components"
  953. });
  954. const element_plus_elM4AXquKi = /* @__PURE__ */ defineNuxtPlugin(() => {
  955. });
  956. const pinia_Uphuq97G1L = /* @__PURE__ */ defineNuxtPlugin((nuxtApp) => {
  957. const pinia = createPinia();
  958. nuxtApp.vueApp.use(pinia);
  959. return {
  960. provide: {
  961. pinia
  962. }
  963. };
  964. });
  965. function toArray(value) {
  966. return Array.isArray(value) ? value : [value];
  967. }
  968. function useRequestEvent(nuxtApp = useNuxtApp()) {
  969. var _a;
  970. return (_a = nuxtApp.ssrContext) == null ? void 0 : _a.event;
  971. }
  972. function prerenderRoutes(path) {
  973. if (!import.meta.prerender) {
  974. return;
  975. }
  976. const paths = toArray(path);
  977. appendHeader(useRequestEvent(), "x-nitro-prerender", paths.map((p) => encodeURIComponent(p)).join(", "));
  978. }
  979. let routes;
  980. const prerender_server_LXx1wM9sKF = /* @__PURE__ */ defineNuxtPlugin(async () => {
  981. let __temp, __restore;
  982. if (!import.meta.prerender || routerOptions.hashMode) {
  983. return;
  984. }
  985. if (routes && !routes.length) {
  986. return;
  987. }
  988. routes || (routes = Array.from(processRoutes(([__temp, __restore] = executeAsync(() => {
  989. var _a;
  990. return (_a = routerOptions.routes) == null ? void 0 : _a.call(routerOptions, _routes);
  991. }), __temp = await __temp, __restore(), __temp) ?? _routes)));
  992. const batch = routes.splice(0, 10);
  993. prerenderRoutes(batch);
  994. });
  995. const OPTIONAL_PARAM_RE = /^\/?:.*(?:\?|\(\.\*\)\*)$/;
  996. function processRoutes(routes2, currentPath = "/", routesToPrerender = /* @__PURE__ */ new Set()) {
  997. var _a;
  998. for (const route of routes2) {
  999. if (OPTIONAL_PARAM_RE.test(route.path) && !((_a = route.children) == null ? void 0 : _a.length)) {
  1000. routesToPrerender.add(currentPath);
  1001. }
  1002. if (route.path.includes(":")) {
  1003. continue;
  1004. }
  1005. const fullPath = joinURL(currentPath, route.path);
  1006. routesToPrerender.add(fullPath);
  1007. if (route.children) {
  1008. processRoutes(route.children, fullPath, routesToPrerender);
  1009. }
  1010. }
  1011. return routesToPrerender;
  1012. }
  1013. const plugins = [
  1014. unhead_KgADcZ0jPj,
  1015. plugin,
  1016. revive_payload_server_eJ33V7gbc6,
  1017. components_plugin_KR1HBZs4kY,
  1018. element_plus_elM4AXquKi,
  1019. pinia_Uphuq97G1L,
  1020. prerender_server_LXx1wM9sKF
  1021. ];
  1022. const layouts = {};
  1023. const LayoutLoader = defineComponent({
  1024. name: "LayoutLoader",
  1025. inheritAttrs: false,
  1026. props: {
  1027. name: String,
  1028. layoutProps: Object
  1029. },
  1030. async setup(props, context) {
  1031. const LayoutComponent = await layouts[props.name]().then((r) => r.default || r);
  1032. return () => h(LayoutComponent, props.layoutProps, context.slots);
  1033. }
  1034. });
  1035. const __nuxt_component_0 = defineComponent({
  1036. name: "NuxtLayout",
  1037. inheritAttrs: false,
  1038. props: {
  1039. name: {
  1040. type: [String, Boolean, Object],
  1041. default: null
  1042. },
  1043. fallback: {
  1044. type: [String, Object],
  1045. default: null
  1046. }
  1047. },
  1048. setup(props, context) {
  1049. const nuxtApp = useNuxtApp();
  1050. const injectedRoute = inject(PageRouteSymbol);
  1051. const route = injectedRoute === useRoute() ? useRoute$1() : injectedRoute;
  1052. const layout = computed(() => {
  1053. let layout2 = unref(props.name) ?? route.meta.layout ?? "default";
  1054. if (layout2 && !(layout2 in layouts)) {
  1055. if (props.fallback) {
  1056. layout2 = unref(props.fallback);
  1057. }
  1058. }
  1059. return layout2;
  1060. });
  1061. const layoutRef = ref();
  1062. context.expose({ layoutRef });
  1063. const done = nuxtApp.deferHydration();
  1064. return () => {
  1065. const hasLayout = layout.value && layout.value in layouts;
  1066. const transitionProps = route.meta.layoutTransition ?? appLayoutTransition;
  1067. return _wrapIf(Transition, hasLayout && transitionProps, {
  1068. default: () => h(Suspense, { suspensible: true, onResolve: () => {
  1069. nextTick(done);
  1070. } }, {
  1071. default: () => h(
  1072. LayoutProvider,
  1073. {
  1074. layoutProps: mergeProps(context.attrs, { ref: layoutRef }),
  1075. key: layout.value || void 0,
  1076. name: layout.value,
  1077. shouldProvide: !props.name,
  1078. hasTransition: !!transitionProps
  1079. },
  1080. context.slots
  1081. )
  1082. })
  1083. }).default();
  1084. };
  1085. }
  1086. });
  1087. const LayoutProvider = defineComponent({
  1088. name: "NuxtLayoutProvider",
  1089. inheritAttrs: false,
  1090. props: {
  1091. name: {
  1092. type: [String, Boolean]
  1093. },
  1094. layoutProps: {
  1095. type: Object
  1096. },
  1097. hasTransition: {
  1098. type: Boolean
  1099. },
  1100. shouldProvide: {
  1101. type: Boolean
  1102. }
  1103. },
  1104. setup(props, context) {
  1105. const name = props.name;
  1106. if (props.shouldProvide) {
  1107. provide(LayoutMetaSymbol, {
  1108. isCurrent: (route) => name === (route.meta.layout ?? "default")
  1109. });
  1110. }
  1111. return () => {
  1112. var _a, _b;
  1113. if (!name || typeof name === "string" && !(name in layouts)) {
  1114. return (_b = (_a = context.slots).default) == null ? void 0 : _b.call(_a);
  1115. }
  1116. return h(
  1117. LayoutLoader,
  1118. { key: name, layoutProps: props.layoutProps, name },
  1119. context.slots
  1120. );
  1121. };
  1122. }
  1123. });
  1124. const RouteProvider = defineComponent({
  1125. props: {
  1126. vnode: {
  1127. type: Object,
  1128. required: true
  1129. },
  1130. route: {
  1131. type: Object,
  1132. required: true
  1133. },
  1134. vnodeRef: Object,
  1135. renderKey: String,
  1136. trackRootNodes: Boolean
  1137. },
  1138. setup(props) {
  1139. const previousKey = props.renderKey;
  1140. const previousRoute = props.route;
  1141. const route = {};
  1142. for (const key in props.route) {
  1143. Object.defineProperty(route, key, {
  1144. get: () => previousKey === props.renderKey ? props.route[key] : previousRoute[key],
  1145. enumerable: true
  1146. });
  1147. }
  1148. provide(PageRouteSymbol, shallowReactive(route));
  1149. return () => {
  1150. return h(props.vnode, { ref: props.vnodeRef });
  1151. };
  1152. }
  1153. });
  1154. const __nuxt_component_1 = defineComponent({
  1155. name: "NuxtPage",
  1156. inheritAttrs: false,
  1157. props: {
  1158. name: {
  1159. type: String
  1160. },
  1161. transition: {
  1162. type: [Boolean, Object],
  1163. default: void 0
  1164. },
  1165. keepalive: {
  1166. type: [Boolean, Object],
  1167. default: void 0
  1168. },
  1169. route: {
  1170. type: Object
  1171. },
  1172. pageKey: {
  1173. type: [Function, String],
  1174. default: null
  1175. }
  1176. },
  1177. setup(props, { attrs, slots, expose }) {
  1178. const nuxtApp = useNuxtApp();
  1179. const pageRef = ref();
  1180. const forkRoute = inject(PageRouteSymbol, null);
  1181. let previousPageKey;
  1182. expose({ pageRef });
  1183. inject(LayoutMetaSymbol, null);
  1184. let vnode;
  1185. const done = nuxtApp.deferHydration();
  1186. if (props.pageKey) {
  1187. watch(() => props.pageKey, (next, prev) => {
  1188. if (next !== prev) {
  1189. nuxtApp.callHook("page:loading:start");
  1190. }
  1191. });
  1192. }
  1193. return () => {
  1194. return h(RouterView, { name: props.name, route: props.route, ...attrs }, {
  1195. default: (routeProps) => {
  1196. if (!routeProps.Component) {
  1197. done();
  1198. return;
  1199. }
  1200. const key = generateRouteKey$1(routeProps, props.pageKey);
  1201. if (!nuxtApp.isHydrating && !hasChildrenRoutes(forkRoute, routeProps.route, routeProps.Component) && previousPageKey === key) {
  1202. nuxtApp.callHook("page:loading:end");
  1203. }
  1204. previousPageKey = key;
  1205. const hasTransition = !!(props.transition ?? routeProps.route.meta.pageTransition ?? appPageTransition);
  1206. const transitionProps = hasTransition && _mergeTransitionProps([
  1207. props.transition,
  1208. routeProps.route.meta.pageTransition,
  1209. appPageTransition,
  1210. { onAfterLeave: () => {
  1211. nuxtApp.callHook("page:transition:finish", routeProps.Component);
  1212. } }
  1213. ].filter(Boolean));
  1214. const keepaliveConfig = props.keepalive ?? routeProps.route.meta.keepalive ?? appKeepalive;
  1215. vnode = _wrapIf(
  1216. Transition,
  1217. hasTransition && transitionProps,
  1218. wrapInKeepAlive(
  1219. keepaliveConfig,
  1220. h(Suspense, {
  1221. suspensible: true,
  1222. onPending: () => nuxtApp.callHook("page:start", routeProps.Component),
  1223. onResolve: () => {
  1224. nextTick(() => nuxtApp.callHook("page:finish", routeProps.Component).then(() => nuxtApp.callHook("page:loading:end")).finally(done));
  1225. }
  1226. }, {
  1227. default: () => {
  1228. const providerVNode = h(RouteProvider, {
  1229. key: key || void 0,
  1230. vnode: slots.default ? h(Fragment, void 0, slots.default(routeProps)) : routeProps.Component,
  1231. route: routeProps.route,
  1232. renderKey: key || void 0,
  1233. trackRootNodes: hasTransition,
  1234. vnodeRef: pageRef
  1235. });
  1236. return providerVNode;
  1237. }
  1238. })
  1239. )
  1240. ).default();
  1241. return vnode;
  1242. }
  1243. });
  1244. };
  1245. }
  1246. });
  1247. function _mergeTransitionProps(routeProps) {
  1248. const _props = routeProps.map((prop) => ({
  1249. ...prop,
  1250. onAfterLeave: prop.onAfterLeave ? toArray$1(prop.onAfterLeave) : void 0
  1251. }));
  1252. return defu(..._props);
  1253. }
  1254. function hasChildrenRoutes(fork, newRoute, Component) {
  1255. if (!fork) {
  1256. return false;
  1257. }
  1258. const index = newRoute.matched.findIndex((m) => {
  1259. var _a;
  1260. return ((_a = m.components) == null ? void 0 : _a.default) === (Component == null ? void 0 : Component.type);
  1261. });
  1262. return index < newRoute.matched.length - 1;
  1263. }
  1264. const _export_sfc = (sfc, props) => {
  1265. const target = sfc.__vccOpts || sfc;
  1266. for (const [key, val] of props) {
  1267. target[key] = val;
  1268. }
  1269. return target;
  1270. };
  1271. const _sfc_main$2 = {};
  1272. function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
  1273. const _component_NuxtLayout = __nuxt_component_0;
  1274. const _component_NuxtPage = __nuxt_component_1;
  1275. _push(`<div${ssrRenderAttrs(mergeProps({ class: "sannong" }, _attrs))} data-v-8c698bba>`);
  1276. _push(ssrRenderComponent(_component_NuxtLayout, null, {
  1277. default: withCtx((_, _push2, _parent2, _scopeId) => {
  1278. if (_push2) {
  1279. _push2(ssrRenderComponent(_component_NuxtPage, null, null, _parent2, _scopeId));
  1280. } else {
  1281. return [
  1282. createVNode(_component_NuxtPage)
  1283. ];
  1284. }
  1285. }),
  1286. _: 1
  1287. }, _parent));
  1288. _push(`</div>`);
  1289. }
  1290. const _sfc_setup$2 = _sfc_main$2.setup;
  1291. _sfc_main$2.setup = (props, ctx) => {
  1292. const ssrContext = useSSRContext();
  1293. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("app.vue");
  1294. return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
  1295. };
  1296. const AppComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender], ["__scopeId", "data-v-8c698bba"]]);
  1297. const _sfc_main$1 = {
  1298. __name: "nuxt-error-page",
  1299. __ssrInlineRender: true,
  1300. props: {
  1301. error: Object
  1302. },
  1303. setup(__props) {
  1304. const props = __props;
  1305. const _error = props.error;
  1306. _error.stack ? _error.stack.split("\n").splice(1).map((line) => {
  1307. const text = line.replace("webpack:/", "").replace(".vue", ".js").trim();
  1308. return {
  1309. text,
  1310. internal: line.includes("node_modules") && !line.includes(".cache") || line.includes("internal") || line.includes("new Promise")
  1311. };
  1312. }).map((i) => `<span class="stack${i.internal ? " internal" : ""}">${i.text}</span>`).join("\n") : "";
  1313. const statusCode = Number(_error.statusCode || 500);
  1314. const is404 = statusCode === 404;
  1315. const statusMessage = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
  1316. const description = _error.message || _error.toString();
  1317. const stack = void 0;
  1318. const _Error404 = defineAsyncComponent(() => import("./_nuxt/error-404-BMLoOIxt.js"));
  1319. const _Error = defineAsyncComponent(() => import("./_nuxt/error-500-4NJVXR7P.js"));
  1320. const ErrorTemplate = is404 ? _Error404 : _Error;
  1321. return (_ctx, _push, _parent, _attrs) => {
  1322. _push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ statusCode: unref(statusCode), statusMessage: unref(statusMessage), description: unref(description), stack: unref(stack) }, _attrs), null, _parent));
  1323. };
  1324. }
  1325. };
  1326. const _sfc_setup$1 = _sfc_main$1.setup;
  1327. _sfc_main$1.setup = (props, ctx) => {
  1328. const ssrContext = useSSRContext();
  1329. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-error-page.vue");
  1330. return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
  1331. };
  1332. const _sfc_main = {
  1333. __name: "nuxt-root",
  1334. __ssrInlineRender: true,
  1335. setup(__props) {
  1336. const IslandRenderer = () => null;
  1337. const nuxtApp = useNuxtApp();
  1338. nuxtApp.deferHydration();
  1339. nuxtApp.ssrContext.url;
  1340. const SingleRenderer = false;
  1341. provide(PageRouteSymbol, useRoute());
  1342. nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup");
  1343. const error = useError();
  1344. const abortRender = error.value && !nuxtApp.ssrContext.error;
  1345. onErrorCaptured((err, target, info) => {
  1346. nuxtApp.hooks.callHook("vue:error", err, target, info).catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
  1347. {
  1348. const p = nuxtApp.runWithContext(() => showError(err));
  1349. onServerPrefetch(() => p);
  1350. return false;
  1351. }
  1352. });
  1353. const islandContext = nuxtApp.ssrContext.islandContext;
  1354. return (_ctx, _push, _parent, _attrs) => {
  1355. ssrRenderSuspense(_push, {
  1356. default: () => {
  1357. if (unref(abortRender)) {
  1358. _push(`<div></div>`);
  1359. } else if (unref(error)) {
  1360. _push(ssrRenderComponent(unref(_sfc_main$1), { error: unref(error) }, null, _parent));
  1361. } else if (unref(islandContext)) {
  1362. _push(ssrRenderComponent(unref(IslandRenderer), { context: unref(islandContext) }, null, _parent));
  1363. } else if (unref(SingleRenderer)) {
  1364. ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(SingleRenderer)), null, null), _parent);
  1365. } else {
  1366. _push(ssrRenderComponent(unref(AppComponent), null, null, _parent));
  1367. }
  1368. },
  1369. _: 1
  1370. });
  1371. };
  1372. }
  1373. };
  1374. const _sfc_setup = _sfc_main.setup;
  1375. _sfc_main.setup = (props, ctx) => {
  1376. const ssrContext = useSSRContext();
  1377. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-root.vue");
  1378. return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
  1379. };
  1380. let entry;
  1381. {
  1382. entry = async function createNuxtAppServer(ssrContext) {
  1383. const vueApp = createApp(_sfc_main);
  1384. const nuxt = createNuxtApp({ vueApp, ssrContext });
  1385. try {
  1386. await applyPlugins(nuxt, plugins);
  1387. await nuxt.hooks.callHook("app:created", vueApp);
  1388. } catch (error) {
  1389. await nuxt.hooks.callHook("app:error", error);
  1390. nuxt.payload.error = nuxt.payload.error || createError(error);
  1391. }
  1392. if (ssrContext == null ? void 0 : ssrContext._renderResponse) {
  1393. throw new Error("skipping render");
  1394. }
  1395. return vueApp;
  1396. };
  1397. }
  1398. const entry$1 = (ssrContext) => entry(ssrContext);
  1399. export {
  1400. _export_sfc as _,
  1401. navigateTo as a,
  1402. useNuxtApp as b,
  1403. useRuntimeConfig as c,
  1404. resolveUnrefHeadInput as d,
  1405. entry$1 as default,
  1406. useRoute as e,
  1407. injectHead as i,
  1408. nuxtLinkDefaults as n,
  1409. resolveRouteObject as r,
  1410. useRouter as u
  1411. };
  1412. //# sourceMappingURL=server.mjs.map