nuxt-ignis 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/.data/content/contents.sqlite +0 -0
  2. package/.env +43 -0
  3. package/.nuxt/components.d.ts +132 -0
  4. package/.nuxt/content/components.ts +51 -0
  5. package/.nuxt/content/database.compressed.mjs +1 -0
  6. package/.nuxt/content/manifest.ts +33 -0
  7. package/.nuxt/content/sql_dump +6 -0
  8. package/.nuxt/content/types.d.ts +13 -0
  9. package/.nuxt/dist/server/client.manifest.mjs +18 -1
  10. package/.nuxt/eslint.config.mjs +1 -1
  11. package/.nuxt/i18n.options.mjs +165 -0
  12. package/.nuxt/imports.d.ts +16 -0
  13. package/.nuxt/manifest/latest.json +1 -1
  14. package/.nuxt/manifest/meta/dev.json +1 -1
  15. package/.nuxt/mdc-configs.mjs +8 -0
  16. package/.nuxt/mdc-highlighter.mjs +213 -0
  17. package/.nuxt/mdc-image-component.mjs +1 -0
  18. package/.nuxt/mdc-imports.mjs +12 -0
  19. package/.nuxt/module/@nuxtjs-sitemap.d.ts +28 -0
  20. package/.nuxt/module/nuxt-robots.d.ts +35 -0
  21. package/.nuxt/module/nuxt-seo-utils.assets.d.ts +25 -0
  22. package/.nuxt/module/nuxt-seo-utils.d.ts +22 -0
  23. package/.nuxt/module/nuxt-site-config.d.ts +43 -0
  24. package/.nuxt/nitro.json +3 -3
  25. package/.nuxt/nuxt-i18n-logger.mjs +1 -0
  26. package/.nuxt/nuxt-icon-client-bundle.mjs +1 -0
  27. package/.nuxt/nuxt-icon-server-bundle.mjs +15 -0
  28. package/.nuxt/nuxt.d.ts +20 -5
  29. package/.nuxt/tailwind/postcss.mjs +15 -0
  30. package/.nuxt/tsconfig.json +151 -0
  31. package/.nuxt/tsconfig.server.json +140 -0
  32. package/.nuxt/types/build.d.ts +2 -0
  33. package/.nuxt/types/i18n-plugin.d.ts +104 -0
  34. package/.nuxt/types/imports.d.ts +70 -0
  35. package/.nuxt/types/neon.d.ts +35 -0
  36. package/.nuxt/types/nitro-imports.d.ts +263 -1
  37. package/.nuxt/types/nitro-routes.d.ts +61 -0
  38. package/.nuxt/types/plugins.d.ts +21 -2
  39. package/.nuxt/types/schema.d.ts +924 -2
  40. package/.nuxt/types/ui.d.ts +35 -0
  41. package/.nuxt/ui/accordion.ts +20 -0
  42. package/.nuxt/ui/alert.ts +264 -0
  43. package/.nuxt/ui/avatar-group.ts +52 -0
  44. package/.nuxt/ui/avatar.ts +54 -0
  45. package/.nuxt/ui/badge.ts +263 -0
  46. package/.nuxt/ui/breadcrumb.ts +45 -0
  47. package/.nuxt/ui/button-group.ts +16 -0
  48. package/.nuxt/ui/button.ts +378 -0
  49. package/.nuxt/ui/calendar.ts +103 -0
  50. package/.nuxt/ui/card.ts +34 -0
  51. package/.nuxt/ui/carousel.ts +38 -0
  52. package/.nuxt/ui/checkbox-group.ts +204 -0
  53. package/.nuxt/ui/checkbox.ts +236 -0
  54. package/.nuxt/ui/chip.ts +96 -0
  55. package/.nuxt/ui/collapsible.ts +6 -0
  56. package/.nuxt/ui/color-picker.ts +47 -0
  57. package/.nuxt/ui/command-palette.ts +50 -0
  58. package/.nuxt/ui/container.ts +3 -0
  59. package/.nuxt/ui/context-menu.ts +216 -0
  60. package/.nuxt/ui/drawer.ts +126 -0
  61. package/.nuxt/ui/dropdown-menu.ts +217 -0
  62. package/.nuxt/ui/form-field.ts +48 -0
  63. package/.nuxt/ui/form.ts +3 -0
  64. package/.nuxt/ui/index.ts +50 -0
  65. package/.nuxt/ui/input-menu.ts +436 -0
  66. package/.nuxt/ui/input-number.ts +245 -0
  67. package/.nuxt/ui/input.ts +289 -0
  68. package/.nuxt/ui/kbd.ts +31 -0
  69. package/.nuxt/ui/link.ts +22 -0
  70. package/.nuxt/ui/modal.ts +29 -0
  71. package/.nuxt/ui/navigation-menu.ts +501 -0
  72. package/.nuxt/ui/pagination.ts +13 -0
  73. package/.nuxt/ui/pin-input.ts +171 -0
  74. package/.nuxt/ui/popover.ts +6 -0
  75. package/.nuxt/ui/progress.ts +297 -0
  76. package/.nuxt/ui/radio-group.ts +350 -0
  77. package/.nuxt/ui/select-menu.ts +346 -0
  78. package/.nuxt/ui/select.ts +341 -0
  79. package/.nuxt/ui/separator.ts +172 -0
  80. package/.nuxt/ui/skeleton.ts +3 -0
  81. package/.nuxt/ui/slideover.ts +71 -0
  82. package/.nuxt/ui/slider.ts +171 -0
  83. package/.nuxt/ui/stepper.ts +202 -0
  84. package/.nuxt/ui/switch.ts +131 -0
  85. package/.nuxt/ui/table.ts +147 -0
  86. package/.nuxt/ui/tabs.ts +256 -0
  87. package/.nuxt/ui/textarea.ts +294 -0
  88. package/.nuxt/ui/toast.ts +81 -0
  89. package/.nuxt/ui/toaster.ts +91 -0
  90. package/.nuxt/ui/tooltip.ts +9 -0
  91. package/.nuxt/ui/tree.ts +154 -0
  92. package/.nuxt/ui-image-component.ts +1 -0
  93. package/.nuxt/ui.css +143 -0
  94. package/features.ts +30 -22
  95. package/package.json +2 -1
  96. package/tailwind.config.ts +1 -1
  97. package/.nuxt/dev/index.mjs +0 -2948
  98. package/.nuxt/dev/index.mjs.map +0 -1
@@ -1,2948 +0,0 @@
1
- import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import { tmpdir } from 'node:os';
2
- import { Server } from 'node:http';
3
- import { resolve, dirname, join } from 'node:path';
4
- import nodeCrypto, { webcrypto } from 'node:crypto';
5
- import { parentPort, threadId } from 'node:worker_threads';
6
- import { defineEventHandler, handleCacheHeaders, splitCookiesString, createEvent, fetchWithEvent, isEvent, eventHandler, setHeaders, sendRedirect, proxyRequest, getRequestHeader, setResponseHeaders, setResponseStatus, send, getRequestHeaders, setResponseHeader, getRequestURL, getResponseHeader, getResponseStatus, createError, removeResponseHeader, handleCors, getRequestIP, getQuery as getQuery$1, readMultipartFormData, readBody, lazyEventHandler, useBase, createApp, createRouter as createRouter$1, toNodeListener, getRouterParam, getResponseStatusText } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/h3@1.15.3/node_modules/h3/dist/index.mjs';
7
- import { escapeHtml } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/@vue+shared@3.5.14/node_modules/@vue/shared/dist/shared.cjs.js';
8
- import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/vue-bundle-renderer@2.1.1/node_modules/vue-bundle-renderer/dist/runtime.mjs';
9
- import { parseURL, withoutBase, joinURL, getQuery, withQuery, withTrailingSlash, joinRelativeURL } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/ufo@1.6.1/node_modules/ufo/dist/index.mjs';
10
- import { renderToString } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/vue@3.5.14_typescript@5.8.3/node_modules/vue/server-renderer/index.mjs';
11
- import { klona } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs';
12
- import defu, { defuFn, createDefu } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs';
13
- import destr, { destr as destr$1 } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs';
14
- import { snakeCase } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs';
15
- import { createHead as createHead$1, propsToString, renderSSRHead } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/unhead@2.0.9/node_modules/unhead/dist/server.mjs';
16
- import { stringify, uneval } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/devalue@5.1.1/node_modules/devalue/index.js';
17
- import { isVNode, toValue, isRef } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/vue@3.5.14_typescript@5.8.3/node_modules/vue/index.mjs';
18
- import { DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/unhead@2.0.9/node_modules/unhead/dist/plugins.mjs';
19
- import { createHooks } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs';
20
- import { createFetch, Headers as Headers$1 } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/ofetch@1.4.1/node_modules/ofetch/dist/node.mjs';
21
- import { fetchNodeRequestHandler, callNodeRequestHandler } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/node-mock-http@1.0.0/node_modules/node-mock-http/dist/index.mjs';
22
- import { createStorage, prefixStorage } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/unstorage@1.16.0_@netlify+b_596bed31c9e97c37983dc6871eaece34/node_modules/unstorage/dist/index.mjs';
23
- import unstorage_47drivers_47fs from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/unstorage@1.16.0_@netlify+b_596bed31c9e97c37983dc6871eaece34/node_modules/unstorage/drivers/fs.mjs';
24
- import unstorage_47drivers_47lru_45cache from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/unstorage@1.16.0_@netlify+b_596bed31c9e97c37983dc6871eaece34/node_modules/unstorage/drivers/lru-cache.mjs';
25
- import { digest } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs';
26
- import { toRouteMatcher, createRouter } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs';
27
- import { readFile } from 'node:fs/promises';
28
- import consola, { consola as consola$1 } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs';
29
- import { ErrorParser } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/youch-core@0.3.2/node_modules/youch-core/build/index.js';
30
- import { Youch } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/youch@4.1.0-beta.7/node_modules/youch/build/index.js';
31
- import { SourceMapConsumer } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/source-map@0.7.4/node_modules/source-map/source-map.js';
32
- import { AsyncLocalStorage } from 'node:async_hooks';
33
- import { getContext } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/unctx@2.4.1/node_modules/unctx/dist/index.mjs';
34
- import { captureRawStackTrace, parseRawStackTrace } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/errx@0.1.0/node_modules/errx/dist/index.js';
35
- import { preventSingleLetterOrphans } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/elrh-pslo@1.1.6/node_modules/elrh-pslo/dist/elrh-pslo.cjs';
36
- import { FilterXSS } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/xss@1.0.15/node_modules/xss/lib/index.js';
37
- import { walkResolver } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/unhead@2.0.9/node_modules/unhead/dist/utils.mjs';
38
- import { fileURLToPath } from 'node:url';
39
- import { ipxFSStorage, ipxHttpStorage, createIPX, createIPXH3Handler } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/ipx@2.1.0_@netlify+blobs@8._f7b76bddf163aa8be609581d2cbf5962/node_modules/ipx/dist/index.mjs';
40
- import { isAbsolute } from 'file://C:/Git/nuxt-ignis/core/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs';
41
-
42
- const serverAssets = [{"baseName":"server","dir":"C:/Git/nuxt-ignis/core/server/assets"}];
43
-
44
- const assets = createStorage();
45
-
46
- for (const asset of serverAssets) {
47
- assets.mount(asset.baseName, unstorage_47drivers_47fs({ base: asset.dir, ignore: (asset?.ignore || []) }));
48
- }
49
-
50
- const storage$1 = createStorage({});
51
-
52
- storage$1.mount('/assets', assets);
53
-
54
- storage$1.mount('#rate-limiter-storage', unstorage_47drivers_47lru_45cache({"driver":"lruCache"}));
55
- storage$1.mount('root', unstorage_47drivers_47fs({"driver":"fs","readOnly":true,"base":"C:/Git/nuxt-ignis/core","watchOptions":{"ignored":[null]}}));
56
- storage$1.mount('src', unstorage_47drivers_47fs({"driver":"fs","readOnly":true,"base":"C:/Git/nuxt-ignis/core/server","watchOptions":{"ignored":[null]}}));
57
- storage$1.mount('build', unstorage_47drivers_47fs({"driver":"fs","readOnly":false,"base":"C:/Git/nuxt-ignis/core/.nuxt"}));
58
- storage$1.mount('cache', unstorage_47drivers_47fs({"driver":"fs","readOnly":false,"base":"C:/Git/nuxt-ignis/core/.nuxt/cache"}));
59
- storage$1.mount('data', unstorage_47drivers_47fs({"driver":"fs","base":"C:/Git/nuxt-ignis/core/.data/kv"}));
60
-
61
- function useStorage(base = "") {
62
- return base ? prefixStorage(storage$1, base) : storage$1;
63
- }
64
-
65
- const Hasher = /* @__PURE__ */ (() => {
66
- class Hasher2 {
67
- buff = "";
68
- #context = /* @__PURE__ */ new Map();
69
- write(str) {
70
- this.buff += str;
71
- }
72
- dispatch(value) {
73
- const type = value === null ? "null" : typeof value;
74
- return this[type](value);
75
- }
76
- object(object) {
77
- if (object && typeof object.toJSON === "function") {
78
- return this.object(object.toJSON());
79
- }
80
- const objString = Object.prototype.toString.call(object);
81
- let objType = "";
82
- const objectLength = objString.length;
83
- objType = objectLength < 10 ? "unknown:[" + objString + "]" : objString.slice(8, objectLength - 1);
84
- objType = objType.toLowerCase();
85
- let objectNumber = null;
86
- if ((objectNumber = this.#context.get(object)) === void 0) {
87
- this.#context.set(object, this.#context.size);
88
- } else {
89
- return this.dispatch("[CIRCULAR:" + objectNumber + "]");
90
- }
91
- if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) {
92
- this.write("buffer:");
93
- return this.write(object.toString("utf8"));
94
- }
95
- if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
96
- if (this[objType]) {
97
- this[objType](object);
98
- } else {
99
- this.unknown(object, objType);
100
- }
101
- } else {
102
- const keys = Object.keys(object).sort();
103
- const extraKeys = [];
104
- this.write("object:" + (keys.length + extraKeys.length) + ":");
105
- const dispatchForKey = (key) => {
106
- this.dispatch(key);
107
- this.write(":");
108
- this.dispatch(object[key]);
109
- this.write(",");
110
- };
111
- for (const key of keys) {
112
- dispatchForKey(key);
113
- }
114
- for (const key of extraKeys) {
115
- dispatchForKey(key);
116
- }
117
- }
118
- }
119
- array(arr, unordered) {
120
- unordered = unordered === void 0 ? false : unordered;
121
- this.write("array:" + arr.length + ":");
122
- if (!unordered || arr.length <= 1) {
123
- for (const entry of arr) {
124
- this.dispatch(entry);
125
- }
126
- return;
127
- }
128
- const contextAdditions = /* @__PURE__ */ new Map();
129
- const entries = arr.map((entry) => {
130
- const hasher = new Hasher2();
131
- hasher.dispatch(entry);
132
- for (const [key, value] of hasher.#context) {
133
- contextAdditions.set(key, value);
134
- }
135
- return hasher.toString();
136
- });
137
- this.#context = contextAdditions;
138
- entries.sort();
139
- return this.array(entries, false);
140
- }
141
- date(date) {
142
- return this.write("date:" + date.toJSON());
143
- }
144
- symbol(sym) {
145
- return this.write("symbol:" + sym.toString());
146
- }
147
- unknown(value, type) {
148
- this.write(type);
149
- if (!value) {
150
- return;
151
- }
152
- this.write(":");
153
- if (value && typeof value.entries === "function") {
154
- return this.array(
155
- [...value.entries()],
156
- true
157
- /* ordered */
158
- );
159
- }
160
- }
161
- error(err) {
162
- return this.write("error:" + err.toString());
163
- }
164
- boolean(bool) {
165
- return this.write("bool:" + bool);
166
- }
167
- string(string) {
168
- this.write("string:" + string.length + ":");
169
- this.write(string);
170
- }
171
- function(fn) {
172
- this.write("fn:");
173
- if (isNativeFunction(fn)) {
174
- this.dispatch("[native]");
175
- } else {
176
- this.dispatch(fn.toString());
177
- }
178
- }
179
- number(number) {
180
- return this.write("number:" + number);
181
- }
182
- null() {
183
- return this.write("Null");
184
- }
185
- undefined() {
186
- return this.write("Undefined");
187
- }
188
- regexp(regex) {
189
- return this.write("regex:" + regex.toString());
190
- }
191
- arraybuffer(arr) {
192
- this.write("arraybuffer:");
193
- return this.dispatch(new Uint8Array(arr));
194
- }
195
- url(url) {
196
- return this.write("url:" + url.toString());
197
- }
198
- map(map) {
199
- this.write("map:");
200
- const arr = [...map];
201
- return this.array(arr, false);
202
- }
203
- set(set) {
204
- this.write("set:");
205
- const arr = [...set];
206
- return this.array(arr, false);
207
- }
208
- bigint(number) {
209
- return this.write("bigint:" + number.toString());
210
- }
211
- }
212
- for (const type of [
213
- "uint8array",
214
- "uint8clampedarray",
215
- "unt8array",
216
- "uint16array",
217
- "unt16array",
218
- "uint32array",
219
- "unt32array",
220
- "float32array",
221
- "float64array"
222
- ]) {
223
- Hasher2.prototype[type] = function(arr) {
224
- this.write(type + ":");
225
- return this.array([...arr], false);
226
- };
227
- }
228
- function isNativeFunction(f) {
229
- if (typeof f !== "function") {
230
- return false;
231
- }
232
- return Function.prototype.toString.call(f).slice(
233
- -15
234
- /* "[native code] }".length */
235
- ) === "[native code] }";
236
- }
237
- return Hasher2;
238
- })();
239
- function serialize(object) {
240
- const hasher = new Hasher();
241
- hasher.dispatch(object);
242
- return hasher.buff;
243
- }
244
- function hash(value) {
245
- return digest(typeof value === "string" ? value : serialize(value)).replace(/[-_]/g, "").slice(0, 10);
246
- }
247
-
248
- function defaultCacheOptions() {
249
- return {
250
- name: "_",
251
- base: "/cache",
252
- swr: true,
253
- maxAge: 1
254
- };
255
- }
256
- function defineCachedFunction(fn, opts = {}) {
257
- opts = { ...defaultCacheOptions(), ...opts };
258
- const pending = {};
259
- const group = opts.group || "nitro/functions";
260
- const name = opts.name || fn.name || "_";
261
- const integrity = opts.integrity || hash([fn, opts]);
262
- const validate = opts.validate || ((entry) => entry.value !== void 0);
263
- async function get(key, resolver, shouldInvalidateCache, event) {
264
- const cacheKey = [opts.base, group, name, key + ".json"].filter(Boolean).join(":").replace(/:\/$/, ":index");
265
- let entry = await useStorage().getItem(cacheKey).catch((error) => {
266
- console.error(`[cache] Cache read error.`, error);
267
- useNitroApp().captureError(error, { event, tags: ["cache"] });
268
- }) || {};
269
- if (typeof entry !== "object") {
270
- entry = {};
271
- const error = new Error("Malformed data read from cache.");
272
- console.error("[cache]", error);
273
- useNitroApp().captureError(error, { event, tags: ["cache"] });
274
- }
275
- const ttl = (opts.maxAge ?? 0) * 1e3;
276
- if (ttl) {
277
- entry.expires = Date.now() + ttl;
278
- }
279
- const expired = shouldInvalidateCache || entry.integrity !== integrity || ttl && Date.now() - (entry.mtime || 0) > ttl || validate(entry) === false;
280
- const _resolve = async () => {
281
- const isPending = pending[key];
282
- if (!isPending) {
283
- if (entry.value !== void 0 && (opts.staleMaxAge || 0) >= 0 && opts.swr === false) {
284
- entry.value = void 0;
285
- entry.integrity = void 0;
286
- entry.mtime = void 0;
287
- entry.expires = void 0;
288
- }
289
- pending[key] = Promise.resolve(resolver());
290
- }
291
- try {
292
- entry.value = await pending[key];
293
- } catch (error) {
294
- if (!isPending) {
295
- delete pending[key];
296
- }
297
- throw error;
298
- }
299
- if (!isPending) {
300
- entry.mtime = Date.now();
301
- entry.integrity = integrity;
302
- delete pending[key];
303
- if (validate(entry) !== false) {
304
- let setOpts;
305
- if (opts.maxAge && !opts.swr) {
306
- setOpts = { ttl: opts.maxAge };
307
- }
308
- const promise = useStorage().setItem(cacheKey, entry, setOpts).catch((error) => {
309
- console.error(`[cache] Cache write error.`, error);
310
- useNitroApp().captureError(error, { event, tags: ["cache"] });
311
- });
312
- if (event?.waitUntil) {
313
- event.waitUntil(promise);
314
- }
315
- }
316
- }
317
- };
318
- const _resolvePromise = expired ? _resolve() : Promise.resolve();
319
- if (entry.value === void 0) {
320
- await _resolvePromise;
321
- } else if (expired && event && event.waitUntil) {
322
- event.waitUntil(_resolvePromise);
323
- }
324
- if (opts.swr && validate(entry) !== false) {
325
- _resolvePromise.catch((error) => {
326
- console.error(`[cache] SWR handler error.`, error);
327
- useNitroApp().captureError(error, { event, tags: ["cache"] });
328
- });
329
- return entry;
330
- }
331
- return _resolvePromise.then(() => entry);
332
- }
333
- return async (...args) => {
334
- const shouldBypassCache = await opts.shouldBypassCache?.(...args);
335
- if (shouldBypassCache) {
336
- return fn(...args);
337
- }
338
- const key = await (opts.getKey || getKey)(...args);
339
- const shouldInvalidateCache = await opts.shouldInvalidateCache?.(...args);
340
- const entry = await get(
341
- key,
342
- () => fn(...args),
343
- shouldInvalidateCache,
344
- args[0] && isEvent(args[0]) ? args[0] : void 0
345
- );
346
- let value = entry.value;
347
- if (opts.transform) {
348
- value = await opts.transform(entry, ...args) || value;
349
- }
350
- return value;
351
- };
352
- }
353
- function cachedFunction(fn, opts = {}) {
354
- return defineCachedFunction(fn, opts);
355
- }
356
- function getKey(...args) {
357
- return args.length > 0 ? hash(args) : "";
358
- }
359
- function escapeKey(key) {
360
- return String(key).replace(/\W/g, "");
361
- }
362
- function defineCachedEventHandler(handler, opts = defaultCacheOptions()) {
363
- const variableHeaderNames = (opts.varies || []).filter(Boolean).map((h) => h.toLowerCase()).sort();
364
- const _opts = {
365
- ...opts,
366
- getKey: async (event) => {
367
- const customKey = await opts.getKey?.(event);
368
- if (customKey) {
369
- return escapeKey(customKey);
370
- }
371
- const _path = event.node.req.originalUrl || event.node.req.url || event.path;
372
- let _pathname;
373
- try {
374
- _pathname = escapeKey(decodeURI(parseURL(_path).pathname)).slice(0, 16) || "index";
375
- } catch {
376
- _pathname = "-";
377
- }
378
- const _hashedPath = `${_pathname}.${hash(_path)}`;
379
- const _headers = variableHeaderNames.map((header) => [header, event.node.req.headers[header]]).map(([name, value]) => `${escapeKey(name)}.${hash(value)}`);
380
- return [_hashedPath, ..._headers].join(":");
381
- },
382
- validate: (entry) => {
383
- if (!entry.value) {
384
- return false;
385
- }
386
- if (entry.value.code >= 400) {
387
- return false;
388
- }
389
- if (entry.value.body === void 0) {
390
- return false;
391
- }
392
- if (entry.value.headers.etag === "undefined" || entry.value.headers["last-modified"] === "undefined") {
393
- return false;
394
- }
395
- return true;
396
- },
397
- group: opts.group || "nitro/handlers",
398
- integrity: opts.integrity || hash([handler, opts])
399
- };
400
- const _cachedHandler = cachedFunction(
401
- async (incomingEvent) => {
402
- const variableHeaders = {};
403
- for (const header of variableHeaderNames) {
404
- const value = incomingEvent.node.req.headers[header];
405
- if (value !== void 0) {
406
- variableHeaders[header] = value;
407
- }
408
- }
409
- const reqProxy = cloneWithProxy(incomingEvent.node.req, {
410
- headers: variableHeaders
411
- });
412
- const resHeaders = {};
413
- let _resSendBody;
414
- const resProxy = cloneWithProxy(incomingEvent.node.res, {
415
- statusCode: 200,
416
- writableEnded: false,
417
- writableFinished: false,
418
- headersSent: false,
419
- closed: false,
420
- getHeader(name) {
421
- return resHeaders[name];
422
- },
423
- setHeader(name, value) {
424
- resHeaders[name] = value;
425
- return this;
426
- },
427
- getHeaderNames() {
428
- return Object.keys(resHeaders);
429
- },
430
- hasHeader(name) {
431
- return name in resHeaders;
432
- },
433
- removeHeader(name) {
434
- delete resHeaders[name];
435
- },
436
- getHeaders() {
437
- return resHeaders;
438
- },
439
- end(chunk, arg2, arg3) {
440
- if (typeof chunk === "string") {
441
- _resSendBody = chunk;
442
- }
443
- if (typeof arg2 === "function") {
444
- arg2();
445
- }
446
- if (typeof arg3 === "function") {
447
- arg3();
448
- }
449
- return this;
450
- },
451
- write(chunk, arg2, arg3) {
452
- if (typeof chunk === "string") {
453
- _resSendBody = chunk;
454
- }
455
- if (typeof arg2 === "function") {
456
- arg2(void 0);
457
- }
458
- if (typeof arg3 === "function") {
459
- arg3();
460
- }
461
- return true;
462
- },
463
- writeHead(statusCode, headers2) {
464
- this.statusCode = statusCode;
465
- if (headers2) {
466
- if (Array.isArray(headers2) || typeof headers2 === "string") {
467
- throw new TypeError("Raw headers is not supported.");
468
- }
469
- for (const header in headers2) {
470
- const value = headers2[header];
471
- if (value !== void 0) {
472
- this.setHeader(
473
- header,
474
- value
475
- );
476
- }
477
- }
478
- }
479
- return this;
480
- }
481
- });
482
- const event = createEvent(reqProxy, resProxy);
483
- event.fetch = (url, fetchOptions) => fetchWithEvent(event, url, fetchOptions, {
484
- fetch: useNitroApp().localFetch
485
- });
486
- event.$fetch = (url, fetchOptions) => fetchWithEvent(event, url, fetchOptions, {
487
- fetch: globalThis.$fetch
488
- });
489
- event.waitUntil = incomingEvent.waitUntil;
490
- event.context = incomingEvent.context;
491
- event.context.cache = {
492
- options: _opts
493
- };
494
- const body = await handler(event) || _resSendBody;
495
- const headers = event.node.res.getHeaders();
496
- headers.etag = String(
497
- headers.Etag || headers.etag || `W/"${hash(body)}"`
498
- );
499
- headers["last-modified"] = String(
500
- headers["Last-Modified"] || headers["last-modified"] || (/* @__PURE__ */ new Date()).toUTCString()
501
- );
502
- const cacheControl = [];
503
- if (opts.swr) {
504
- if (opts.maxAge) {
505
- cacheControl.push(`s-maxage=${opts.maxAge}`);
506
- }
507
- if (opts.staleMaxAge) {
508
- cacheControl.push(`stale-while-revalidate=${opts.staleMaxAge}`);
509
- } else {
510
- cacheControl.push("stale-while-revalidate");
511
- }
512
- } else if (opts.maxAge) {
513
- cacheControl.push(`max-age=${opts.maxAge}`);
514
- }
515
- if (cacheControl.length > 0) {
516
- headers["cache-control"] = cacheControl.join(", ");
517
- }
518
- const cacheEntry = {
519
- code: event.node.res.statusCode,
520
- headers,
521
- body
522
- };
523
- return cacheEntry;
524
- },
525
- _opts
526
- );
527
- return defineEventHandler(async (event) => {
528
- if (opts.headersOnly) {
529
- if (handleCacheHeaders(event, { maxAge: opts.maxAge })) {
530
- return;
531
- }
532
- return handler(event);
533
- }
534
- const response = await _cachedHandler(
535
- event
536
- );
537
- if (event.node.res.headersSent || event.node.res.writableEnded) {
538
- return response.body;
539
- }
540
- if (handleCacheHeaders(event, {
541
- modifiedTime: new Date(response.headers["last-modified"]),
542
- etag: response.headers.etag,
543
- maxAge: opts.maxAge
544
- })) {
545
- return;
546
- }
547
- event.node.res.statusCode = response.code;
548
- for (const name in response.headers) {
549
- const value = response.headers[name];
550
- if (name === "set-cookie") {
551
- event.node.res.appendHeader(
552
- name,
553
- splitCookiesString(value)
554
- );
555
- } else {
556
- if (value !== void 0) {
557
- event.node.res.setHeader(name, value);
558
- }
559
- }
560
- }
561
- return response.body;
562
- });
563
- }
564
- function cloneWithProxy(obj, overrides) {
565
- return new Proxy(obj, {
566
- get(target, property, receiver) {
567
- if (property in overrides) {
568
- return overrides[property];
569
- }
570
- return Reflect.get(target, property, receiver);
571
- },
572
- set(target, property, value, receiver) {
573
- if (property in overrides) {
574
- overrides[property] = value;
575
- return true;
576
- }
577
- return Reflect.set(target, property, value, receiver);
578
- }
579
- });
580
- }
581
- const cachedEventHandler = defineCachedEventHandler;
582
-
583
- const defineAppConfig = (config) => config;
584
-
585
- const appConfig0 = defineAppConfig({
586
- textTitle: "Nuxt Ignis"
587
- });
588
-
589
- const inlineAppConfig = {
590
- "nuxt": {}
591
- };
592
-
593
- const appConfig = defuFn(appConfig0, inlineAppConfig);
594
-
595
- function getEnv(key, opts) {
596
- const envKey = snakeCase(key).toUpperCase();
597
- return destr(
598
- process.env[opts.prefix + envKey] ?? process.env[opts.altPrefix + envKey]
599
- );
600
- }
601
- function _isObject(input) {
602
- return typeof input === "object" && !Array.isArray(input);
603
- }
604
- function applyEnv(obj, opts, parentKey = "") {
605
- for (const key in obj) {
606
- const subKey = parentKey ? `${parentKey}_${key}` : key;
607
- const envValue = getEnv(subKey, opts);
608
- if (_isObject(obj[key])) {
609
- if (_isObject(envValue)) {
610
- obj[key] = { ...obj[key], ...envValue };
611
- applyEnv(obj[key], opts, subKey);
612
- } else if (envValue === void 0) {
613
- applyEnv(obj[key], opts, subKey);
614
- } else {
615
- obj[key] = envValue ?? obj[key];
616
- }
617
- } else {
618
- obj[key] = envValue ?? obj[key];
619
- }
620
- if (opts.envExpansion && typeof obj[key] === "string") {
621
- obj[key] = _expandFromEnv(obj[key]);
622
- }
623
- }
624
- return obj;
625
- }
626
- const envExpandRx = /\{\{([^{}]*)\}\}/g;
627
- function _expandFromEnv(value) {
628
- return value.replace(envExpandRx, (match, key) => {
629
- return process.env[key] || match;
630
- });
631
- }
632
-
633
- const _inlineRuntimeConfig = {
634
- "app": {
635
- "baseURL": "/",
636
- "buildId": "dev",
637
- "buildAssetsDir": "/_nuxt/",
638
- "cdnURL": ""
639
- },
640
- "nitro": {
641
- "envPrefix": "NUXT_",
642
- "routeRules": {
643
- "/__nuxt_error": {
644
- "cache": false
645
- },
646
- "/_fonts/**": {
647
- "headers": {
648
- "cache-control": "public, max-age=31536000, immutable"
649
- },
650
- "cache": {
651
- "maxAge": 31536000
652
- }
653
- },
654
- "/**": {
655
- "headers": {
656
- "Referrer-Policy": "no-referrer",
657
- "Strict-Transport-Security": "max-age=15552000; includeSubDomains;",
658
- "X-Content-Type-Options": "nosniff",
659
- "X-Download-Options": "noopen",
660
- "X-Frame-Options": "SAMEORIGIN",
661
- "X-Permitted-Cross-Domain-Policies": "none",
662
- "X-XSS-Protection": "0"
663
- }
664
- },
665
- "/_scripts/**": {
666
- "headers": {
667
- "cache-control": "public, max-age=31536000, immutable"
668
- },
669
- "cache": {
670
- "maxAge": 31536000
671
- }
672
- },
673
- "/_nuxt/builds/meta/**": {
674
- "headers": {
675
- "cache-control": "public, max-age=31536000, immutable"
676
- }
677
- },
678
- "/_nuxt/builds/**": {
679
- "headers": {
680
- "cache-control": "public, max-age=1, immutable"
681
- }
682
- }
683
- }
684
- },
685
- "public": {
686
- "ignis": {
687
- "log": {
688
- "level": "info"
689
- },
690
- "ssr": true,
691
- "pages": true,
692
- "preset": {
693
- "ui": "off",
694
- "db": "off",
695
- "forms": "off"
696
- },
697
- "core": {
698
- "eslint": true,
699
- "fonts": true,
700
- "image": true,
701
- "pinia": true,
702
- "time": true,
703
- "scripts": true,
704
- "security": true,
705
- "vueuse": true
706
- },
707
- "ui": false,
708
- "tailwind": false,
709
- "neon": false,
710
- "supabase": false,
711
- "i18n": {
712
- "enabled": false,
713
- "default": "en",
714
- "config": "./i18n.config.ts"
715
- },
716
- "formkit": {
717
- "enabled": false,
718
- "default": "en",
719
- "config": "./formkit.config.ts"
720
- },
721
- "vueform": false,
722
- "content": false,
723
- "openprops": false,
724
- "pslo": {
725
- "enabled": false,
726
- "content": false
727
- },
728
- "seo": false,
729
- "auth": false,
730
- "warn": {
731
- "duplicates": true
732
- }
733
- },
734
- "nuxt-scripts": {
735
- "version": "0.11.7",
736
- "defaultScriptOptions": {
737
- "trigger": "onNuxtReady"
738
- }
739
- }
740
- },
741
- "nuxt-scripts": {
742
- "version": "0.11.7"
743
- },
744
- "private": {
745
- "basicAuth": false
746
- },
747
- "security": {
748
- "strict": false,
749
- "headers": {
750
- "crossOriginResourcePolicy": "same-origin",
751
- "crossOriginOpenerPolicy": "same-origin",
752
- "crossOriginEmbedderPolicy": "require-corp",
753
- "contentSecurityPolicy": {
754
- "base-uri": [
755
- "'none'"
756
- ],
757
- "font-src": [
758
- "'self'",
759
- "https:",
760
- "data:"
761
- ],
762
- "form-action": [
763
- "'self'"
764
- ],
765
- "frame-ancestors": [
766
- "'self'"
767
- ],
768
- "img-src": [
769
- "'self'",
770
- "data:"
771
- ],
772
- "object-src": [
773
- "'none'"
774
- ],
775
- "script-src-attr": [
776
- "'none'"
777
- ],
778
- "style-src": [
779
- "'self'",
780
- "https:",
781
- "'unsafe-inline'"
782
- ],
783
- "script-src": [
784
- "'self'",
785
- "https:",
786
- "'strict-dynamic'",
787
- "'nonce-{{nonce}}'",
788
- "'wasm-unsafe-eval'"
789
- ],
790
- "upgrade-insecure-requests": true
791
- },
792
- "originAgentCluster": "?1",
793
- "referrerPolicy": "no-referrer",
794
- "strictTransportSecurity": {
795
- "maxAge": 15552000,
796
- "includeSubdomains": true
797
- },
798
- "xContentTypeOptions": "nosniff",
799
- "xDNSPrefetchControl": "off",
800
- "xDownloadOptions": "noopen",
801
- "xFrameOptions": "SAMEORIGIN",
802
- "xPermittedCrossDomainPolicies": "none",
803
- "xXSSProtection": "0",
804
- "permissionsPolicy": {
805
- "camera": [],
806
- "display-capture": [],
807
- "fullscreen": [],
808
- "geolocation": [],
809
- "microphone": []
810
- }
811
- },
812
- "requestSizeLimiter": {
813
- "maxRequestSizeInBytes": 2000000,
814
- "maxUploadFileRequestInBytes": 8000000,
815
- "throwError": true
816
- },
817
- "rateLimiter": {
818
- "tokensPerInterval": 150,
819
- "interval": 300000,
820
- "headers": false,
821
- "driver": {
822
- "name": "lruCache"
823
- },
824
- "whiteList": "",
825
- "throwError": true
826
- },
827
- "xssValidator": {
828
- "methods": [
829
- "GET",
830
- "POST"
831
- ],
832
- "throwError": true
833
- },
834
- "corsHandler": {
835
- "origin": "http://localhost:3000",
836
- "methods": [
837
- "GET",
838
- "HEAD",
839
- "PUT",
840
- "PATCH",
841
- "POST",
842
- "DELETE"
843
- ],
844
- "preflight": {
845
- "statusCode": 204
846
- }
847
- },
848
- "allowedMethodsRestricter": {
849
- "methods": "*",
850
- "throwError": true
851
- },
852
- "hidePoweredBy": true,
853
- "enabled": true,
854
- "csrf": false,
855
- "nonce": true,
856
- "removeLoggers": true,
857
- "ssg": {
858
- "meta": true,
859
- "hashScripts": true,
860
- "hashStyles": false,
861
- "nitroHeaders": true,
862
- "exportToPresets": true
863
- },
864
- "sri": true
865
- },
866
- "ipx": {
867
- "baseURL": "/_ipx",
868
- "alias": {},
869
- "fs": {
870
- "dir": [
871
- "C:/Git/nuxt-ignis/core/public",
872
- "C:/Git/nuxt-ignis/core/node_modules/.pnpm/nuxt-spec@0.0.4_@types+debu_fbd62cce99e0c6b5414599c74ec32b3d/node_modules/nuxt-spec/public"
873
- ]
874
- },
875
- "http": {
876
- "domains": []
877
- }
878
- }
879
- };
880
- const envOptions = {
881
- prefix: "NITRO_",
882
- altPrefix: _inlineRuntimeConfig.nitro.envPrefix ?? process.env.NITRO_ENV_PREFIX ?? "_",
883
- envExpansion: _inlineRuntimeConfig.nitro.envExpansion ?? process.env.NITRO_ENV_EXPANSION ?? false
884
- };
885
- const _sharedRuntimeConfig = _deepFreeze(
886
- applyEnv(klona(_inlineRuntimeConfig), envOptions)
887
- );
888
- function useRuntimeConfig(event) {
889
- if (!event) {
890
- return _sharedRuntimeConfig;
891
- }
892
- if (event.context.nitro.runtimeConfig) {
893
- return event.context.nitro.runtimeConfig;
894
- }
895
- const runtimeConfig = klona(_inlineRuntimeConfig);
896
- applyEnv(runtimeConfig, envOptions);
897
- event.context.nitro.runtimeConfig = runtimeConfig;
898
- return runtimeConfig;
899
- }
900
- _deepFreeze(klona(appConfig));
901
- function _deepFreeze(object) {
902
- const propNames = Object.getOwnPropertyNames(object);
903
- for (const name of propNames) {
904
- const value = object[name];
905
- if (value && typeof value === "object") {
906
- _deepFreeze(value);
907
- }
908
- }
909
- return Object.freeze(object);
910
- }
911
- new Proxy(/* @__PURE__ */ Object.create(null), {
912
- get: (_, prop) => {
913
- console.warn(
914
- "Please use `useRuntimeConfig()` instead of accessing config directly."
915
- );
916
- const runtimeConfig = useRuntimeConfig();
917
- if (prop in runtimeConfig) {
918
- return runtimeConfig[prop];
919
- }
920
- return void 0;
921
- }
922
- });
923
-
924
- const config = useRuntimeConfig();
925
- const _routeRulesMatcher = toRouteMatcher(
926
- createRouter({ routes: config.nitro.routeRules })
927
- );
928
- function createRouteRulesHandler(ctx) {
929
- return eventHandler((event) => {
930
- const routeRules = getRouteRules(event);
931
- if (routeRules.headers) {
932
- setHeaders(event, routeRules.headers);
933
- }
934
- if (routeRules.redirect) {
935
- let target = routeRules.redirect.to;
936
- if (target.endsWith("/**")) {
937
- let targetPath = event.path;
938
- const strpBase = routeRules.redirect._redirectStripBase;
939
- if (strpBase) {
940
- targetPath = withoutBase(targetPath, strpBase);
941
- }
942
- target = joinURL(target.slice(0, -3), targetPath);
943
- } else if (event.path.includes("?")) {
944
- const query = getQuery(event.path);
945
- target = withQuery(target, query);
946
- }
947
- return sendRedirect(event, target, routeRules.redirect.statusCode);
948
- }
949
- if (routeRules.proxy) {
950
- let target = routeRules.proxy.to;
951
- if (target.endsWith("/**")) {
952
- let targetPath = event.path;
953
- const strpBase = routeRules.proxy._proxyStripBase;
954
- if (strpBase) {
955
- targetPath = withoutBase(targetPath, strpBase);
956
- }
957
- target = joinURL(target.slice(0, -3), targetPath);
958
- } else if (event.path.includes("?")) {
959
- const query = getQuery(event.path);
960
- target = withQuery(target, query);
961
- }
962
- return proxyRequest(event, target, {
963
- fetch: ctx.localFetch,
964
- ...routeRules.proxy
965
- });
966
- }
967
- });
968
- }
969
- function getRouteRules(event) {
970
- event.context._nitro = event.context._nitro || {};
971
- if (!event.context._nitro.routeRules) {
972
- event.context._nitro.routeRules = getRouteRulesForPath(
973
- withoutBase(event.path.split("?")[0], useRuntimeConfig().app.baseURL)
974
- );
975
- }
976
- return event.context._nitro.routeRules;
977
- }
978
- function getRouteRulesForPath(path) {
979
- return defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
980
- }
981
-
982
- function _captureError(error, type) {
983
- console.error(`[${type}]`, error);
984
- useNitroApp().captureError(error, { tags: [type] });
985
- }
986
- function trapUnhandledNodeErrors() {
987
- process.on(
988
- "unhandledRejection",
989
- (error) => _captureError(error, "unhandledRejection")
990
- );
991
- process.on(
992
- "uncaughtException",
993
- (error) => _captureError(error, "uncaughtException")
994
- );
995
- }
996
- function joinHeaders(value) {
997
- return Array.isArray(value) ? value.join(", ") : String(value);
998
- }
999
- function normalizeFetchResponse(response) {
1000
- if (!response.headers.has("set-cookie")) {
1001
- return response;
1002
- }
1003
- return new Response(response.body, {
1004
- status: response.status,
1005
- statusText: response.statusText,
1006
- headers: normalizeCookieHeaders(response.headers)
1007
- });
1008
- }
1009
- function normalizeCookieHeader(header = "") {
1010
- return splitCookiesString(joinHeaders(header));
1011
- }
1012
- function normalizeCookieHeaders(headers) {
1013
- const outgoingHeaders = new Headers();
1014
- for (const [name, header] of headers) {
1015
- if (name === "set-cookie") {
1016
- for (const cookie of normalizeCookieHeader(header)) {
1017
- outgoingHeaders.append("set-cookie", cookie);
1018
- }
1019
- } else {
1020
- outgoingHeaders.set(name, joinHeaders(header));
1021
- }
1022
- }
1023
- return outgoingHeaders;
1024
- }
1025
-
1026
- function isJsonRequest(event) {
1027
- if (hasReqHeader(event, "accept", "text/html")) {
1028
- return false;
1029
- }
1030
- return hasReqHeader(event, "accept", "application/json") || hasReqHeader(event, "user-agent", "curl/") || hasReqHeader(event, "user-agent", "httpie/") || hasReqHeader(event, "sec-fetch-mode", "cors") || event.path.startsWith("/api/") || event.path.endsWith(".json");
1031
- }
1032
- function hasReqHeader(event, name, includes) {
1033
- const value = getRequestHeader(event, name);
1034
- return value && typeof value === "string" && value.toLowerCase().includes(includes);
1035
- }
1036
-
1037
- const errorHandler$0 = (async function errorhandler(error, event, { defaultHandler }) {
1038
- if (event.handled || isJsonRequest(event)) {
1039
- return;
1040
- }
1041
- const defaultRes = await defaultHandler(error, event, { json: true });
1042
- const statusCode = error.statusCode || 500;
1043
- if (statusCode === 404 && defaultRes.status === 302) {
1044
- setResponseHeaders(event, defaultRes.headers);
1045
- setResponseStatus(event, defaultRes.status, defaultRes.statusText);
1046
- return send(event, JSON.stringify(defaultRes.body, null, 2));
1047
- }
1048
- if (typeof defaultRes.body !== "string" && Array.isArray(defaultRes.body.stack)) {
1049
- defaultRes.body.stack = defaultRes.body.stack.join("\n");
1050
- }
1051
- const errorObject = defaultRes.body;
1052
- const url = new URL(errorObject.url);
1053
- errorObject.url = withoutBase(url.pathname, useRuntimeConfig(event).app.baseURL) + url.search + url.hash;
1054
- errorObject.message ||= "Server Error";
1055
- errorObject.data ||= error.data;
1056
- errorObject.statusMessage ||= error.statusMessage;
1057
- delete defaultRes.headers["content-type"];
1058
- delete defaultRes.headers["content-security-policy"];
1059
- setResponseHeaders(event, defaultRes.headers);
1060
- const reqHeaders = getRequestHeaders(event);
1061
- const isRenderingError = event.path.startsWith("/__nuxt_error") || !!reqHeaders["x-nuxt-error"];
1062
- const res = isRenderingError ? null : await useNitroApp().localFetch(
1063
- withQuery(joinURL(useRuntimeConfig(event).app.baseURL, "/__nuxt_error"), errorObject),
1064
- {
1065
- headers: { ...reqHeaders, "x-nuxt-error": "true" },
1066
- redirect: "manual"
1067
- }
1068
- ).catch(() => null);
1069
- if (event.handled) {
1070
- return;
1071
- }
1072
- if (!res) {
1073
- const { template } = await Promise.resolve().then(function () { return errorDev; }) ;
1074
- {
1075
- errorObject.description = errorObject.message;
1076
- }
1077
- setResponseHeader(event, "Content-Type", "text/html;charset=UTF-8");
1078
- return send(event, template(errorObject));
1079
- }
1080
- const html = await res.text();
1081
- for (const [header, value] of res.headers.entries()) {
1082
- setResponseHeader(event, header, value);
1083
- }
1084
- setResponseStatus(event, res.status && res.status !== 200 ? res.status : defaultRes.status, res.statusText || defaultRes.statusText);
1085
- return send(event, html);
1086
- });
1087
-
1088
- function defineNitroErrorHandler(handler) {
1089
- return handler;
1090
- }
1091
-
1092
- const errorHandler$1 = defineNitroErrorHandler(
1093
- async function defaultNitroErrorHandler(error, event) {
1094
- const res = await defaultHandler(error, event);
1095
- if (!event.node?.res.headersSent) {
1096
- setResponseHeaders(event, res.headers);
1097
- }
1098
- setResponseStatus(event, res.status, res.statusText);
1099
- return send(
1100
- event,
1101
- typeof res.body === "string" ? res.body : JSON.stringify(res.body, null, 2)
1102
- );
1103
- }
1104
- );
1105
- async function defaultHandler(error, event, opts) {
1106
- const isSensitive = error.unhandled || error.fatal;
1107
- const statusCode = error.statusCode || 500;
1108
- const statusMessage = error.statusMessage || "Server Error";
1109
- const url = getRequestURL(event, { xForwardedHost: true, xForwardedProto: true });
1110
- if (statusCode === 404) {
1111
- const baseURL = "/";
1112
- if (/^\/[^/]/.test(baseURL) && !url.pathname.startsWith(baseURL)) {
1113
- const redirectTo = `${baseURL}${url.pathname.slice(1)}${url.search}`;
1114
- return {
1115
- status: 302,
1116
- statusText: "Found",
1117
- headers: { location: redirectTo },
1118
- body: `Redirecting...`
1119
- };
1120
- }
1121
- }
1122
- await loadStackTrace(error).catch(consola.error);
1123
- const youch = new Youch();
1124
- if (isSensitive && !opts?.silent) {
1125
- const tags = [error.unhandled && "[unhandled]", error.fatal && "[fatal]"].filter(Boolean).join(" ");
1126
- const ansiError = await (await youch.toANSI(error)).replaceAll(process.cwd(), ".");
1127
- consola.error(
1128
- `[request error] ${tags} [${event.method}] ${url}
1129
-
1130
- `,
1131
- ansiError
1132
- );
1133
- }
1134
- const useJSON = opts?.json || !getRequestHeader(event, "accept")?.includes("text/html");
1135
- const headers = {
1136
- "content-type": useJSON ? "application/json" : "text/html",
1137
- // Prevent browser from guessing the MIME types of resources.
1138
- "x-content-type-options": "nosniff",
1139
- // Prevent error page from being embedded in an iframe
1140
- "x-frame-options": "DENY",
1141
- // Prevent browsers from sending the Referer header
1142
- "referrer-policy": "no-referrer",
1143
- // Disable the execution of any js
1144
- "content-security-policy": "script-src 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self';"
1145
- };
1146
- if (statusCode === 404 || !getResponseHeader(event, "cache-control")) {
1147
- headers["cache-control"] = "no-cache";
1148
- }
1149
- const body = useJSON ? {
1150
- error: true,
1151
- url,
1152
- statusCode,
1153
- statusMessage,
1154
- message: error.message,
1155
- data: error.data,
1156
- stack: error.stack?.split("\n").map((line) => line.trim())
1157
- } : await youch.toHTML(error, {
1158
- request: {
1159
- url: url.href,
1160
- method: event.method,
1161
- headers: getRequestHeaders(event)
1162
- }
1163
- });
1164
- return {
1165
- status: statusCode,
1166
- statusText: statusMessage,
1167
- headers,
1168
- body
1169
- };
1170
- }
1171
- async function loadStackTrace(error) {
1172
- if (!(error instanceof Error)) {
1173
- return;
1174
- }
1175
- const parsed = await new ErrorParser().defineSourceLoader(sourceLoader).parse(error);
1176
- const stack = error.message + "\n" + parsed.frames.map((frame) => fmtFrame(frame)).join("\n");
1177
- Object.defineProperty(error, "stack", { value: stack });
1178
- if (error.cause) {
1179
- await loadStackTrace(error.cause).catch(consola.error);
1180
- }
1181
- }
1182
- async function sourceLoader(frame) {
1183
- if (!frame.fileName || frame.fileType !== "fs" || frame.type === "native") {
1184
- return;
1185
- }
1186
- if (frame.type === "app") {
1187
- const rawSourceMap = await readFile(`${frame.fileName}.map`, "utf8").catch(() => {
1188
- });
1189
- if (rawSourceMap) {
1190
- const consumer = await new SourceMapConsumer(rawSourceMap);
1191
- const originalPosition = consumer.originalPositionFor({ line: frame.lineNumber, column: frame.columnNumber });
1192
- if (originalPosition.source && originalPosition.line) {
1193
- frame.fileName = resolve(dirname(frame.fileName), originalPosition.source);
1194
- frame.lineNumber = originalPosition.line;
1195
- frame.columnNumber = originalPosition.column || 0;
1196
- }
1197
- }
1198
- }
1199
- const contents = await readFile(frame.fileName, "utf8").catch(() => {
1200
- });
1201
- return contents ? { contents } : void 0;
1202
- }
1203
- function fmtFrame(frame) {
1204
- if (frame.type === "native") {
1205
- return frame.raw;
1206
- }
1207
- const src = `${frame.fileName || ""}:${frame.lineNumber}:${frame.columnNumber})`;
1208
- return frame.functionName ? `at ${frame.functionName} (${src}` : `at ${src}`;
1209
- }
1210
-
1211
- const errorHandlers = [errorHandler$0, errorHandler$1];
1212
-
1213
- async function errorHandler(error, event) {
1214
- for (const handler of errorHandlers) {
1215
- try {
1216
- await handler(error, event, { defaultHandler });
1217
- if (event.handled) {
1218
- return; // Response handled
1219
- }
1220
- } catch(error) {
1221
- // Handler itself thrown, log and continue
1222
- console.error(error);
1223
- }
1224
- }
1225
- // H3 will handle fallback
1226
- }
1227
-
1228
- const script = `
1229
- if (!window.__NUXT_DEVTOOLS_TIME_METRIC__) {
1230
- Object.defineProperty(window, '__NUXT_DEVTOOLS_TIME_METRIC__', {
1231
- value: {},
1232
- enumerable: false,
1233
- configurable: true,
1234
- })
1235
- }
1236
- window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
1237
- `;
1238
-
1239
- const _5987bk89juboHi1UbD2gs47PjoxO235tpRpyW3qHkPY = (function(nitro) {
1240
- nitro.hooks.hook("render:html", (htmlContext) => {
1241
- htmlContext.head.push(`<script>${script}<\/script>`);
1242
- });
1243
- });
1244
-
1245
- const rootDir = "C:/Git/nuxt-ignis/core";
1246
-
1247
- const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"}],"link":[],"style":[],"script":[],"noscript":[]};
1248
-
1249
- const appRootTag = "div";
1250
-
1251
- const appRootAttrs = {"id":"__nuxt"};
1252
-
1253
- const appTeleportTag = "div";
1254
-
1255
- const appTeleportAttrs = {"id":"teleports"};
1256
-
1257
- const appId = "nuxt-app";
1258
-
1259
- const devReducers = {
1260
- VNode: (data) => isVNode(data) ? { type: data.type, props: data.props } : void 0,
1261
- URL: (data) => data instanceof URL ? data.toString() : void 0
1262
- };
1263
- const asyncContext = getContext("nuxt-dev", { asyncContext: true, AsyncLocalStorage });
1264
- const _Ob_cXFr8ciCF2J_B5Yb0NR9hm_x8DQDjHBqdHqX3JI = (nitroApp) => {
1265
- const handler = nitroApp.h3App.handler;
1266
- nitroApp.h3App.handler = (event) => {
1267
- return asyncContext.callAsync({ logs: [], event }, () => handler(event));
1268
- };
1269
- onConsoleLog((_log) => {
1270
- const ctx = asyncContext.tryUse();
1271
- if (!ctx) {
1272
- return;
1273
- }
1274
- const rawStack = captureRawStackTrace();
1275
- if (!rawStack || rawStack.includes("runtime/vite-node.mjs")) {
1276
- return;
1277
- }
1278
- const trace = [];
1279
- let filename = "";
1280
- for (const entry of parseRawStackTrace(rawStack)) {
1281
- if (entry.source === globalThis._importMeta_.url) {
1282
- continue;
1283
- }
1284
- if (EXCLUDE_TRACE_RE.test(entry.source)) {
1285
- continue;
1286
- }
1287
- filename ||= entry.source.replace(withTrailingSlash(rootDir), "");
1288
- trace.push({
1289
- ...entry,
1290
- source: entry.source.startsWith("file://") ? entry.source.replace("file://", "") : entry.source
1291
- });
1292
- }
1293
- const log = {
1294
- ..._log,
1295
- // Pass along filename to allow the client to display more info about where log comes from
1296
- filename,
1297
- // Clean up file names in stack trace
1298
- stack: trace
1299
- };
1300
- ctx.logs.push(log);
1301
- });
1302
- nitroApp.hooks.hook("afterResponse", () => {
1303
- const ctx = asyncContext.tryUse();
1304
- if (!ctx) {
1305
- return;
1306
- }
1307
- return nitroApp.hooks.callHook("dev:ssr-logs", { logs: ctx.logs, path: ctx.event.path });
1308
- });
1309
- nitroApp.hooks.hook("render:html", (htmlContext) => {
1310
- const ctx = asyncContext.tryUse();
1311
- if (!ctx) {
1312
- return;
1313
- }
1314
- try {
1315
- const reducers = Object.assign(/* @__PURE__ */ Object.create(null), devReducers, ctx.event.context._payloadReducers);
1316
- htmlContext.bodyAppend.unshift(`<script type="application/json" data-nuxt-logs="${appId}">${stringify(ctx.logs, reducers)}<\/script>`);
1317
- } catch (e) {
1318
- const shortError = e instanceof Error && "toString" in e ? ` Received \`${e.toString()}\`.` : "";
1319
- console.warn(`[nuxt] Failed to stringify dev server logs.${shortError} You can define your own reducer/reviver for rich types following the instructions in https://nuxt.com/docs/api/composables/use-nuxt-app#payload.`);
1320
- }
1321
- });
1322
- };
1323
- const EXCLUDE_TRACE_RE = /\/node_modules\/(?:.*\/)?(?:nuxt|nuxt-nightly|nuxt-edge|nuxt3|consola|@vue)\/|core\/runtime\/nitro/;
1324
- function onConsoleLog(callback) {
1325
- consola$1.addReporter({
1326
- log(logObj) {
1327
- callback(logObj);
1328
- }
1329
- });
1330
- consola$1.wrapConsole();
1331
- }
1332
-
1333
- function defineNitroPlugin(def) {
1334
- return def;
1335
- }
1336
-
1337
- const _gLOeqSTdYtSmvm3NLY8ox1LOh6DY4GgpRaz2D6f9XU = defineNitroPlugin((nitroApp) => {
1338
- const config = useRuntimeConfig().public.ignis;
1339
- if (config.content && config.pslo.enabled && config.pslo.content) {
1340
- console.log("elrh-pslo plugin initialized");
1341
- nitroApp.hooks.hook("content:file:beforeParse", (file) => {
1342
- console.log("Treating Markdown with elrh-pslo");
1343
- if (file._id.endsWith(".md")) {
1344
- file.body = preventSingleLetterOrphans(file.body);
1345
- }
1346
- });
1347
- }
1348
- });
1349
-
1350
- function defineRenderHandler(render) {
1351
- const runtimeConfig = useRuntimeConfig();
1352
- return eventHandler(async (event) => {
1353
- const nitroApp = useNitroApp();
1354
- const ctx = { event, render, response: void 0 };
1355
- await nitroApp.hooks.callHook("render:before", ctx);
1356
- if (!ctx.response) {
1357
- if (event.path === `${runtimeConfig.app.baseURL}favicon.ico`) {
1358
- setResponseHeader(event, "Content-Type", "image/x-icon");
1359
- return send(
1360
- event,
1361
- "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
1362
- );
1363
- }
1364
- ctx.response = await ctx.render(event);
1365
- if (!ctx.response) {
1366
- const _currentStatus = getResponseStatus(event);
1367
- setResponseStatus(event, _currentStatus === 200 ? 500 : _currentStatus);
1368
- return send(
1369
- event,
1370
- "No response returned from render handler: " + event.path
1371
- );
1372
- }
1373
- }
1374
- await nitroApp.hooks.callHook("render:response", ctx.response, ctx);
1375
- if (ctx.response.headers) {
1376
- setResponseHeaders(event, ctx.response.headers);
1377
- }
1378
- if (ctx.response.statusCode || ctx.response.statusMessage) {
1379
- setResponseStatus(
1380
- event,
1381
- ctx.response.statusCode,
1382
- ctx.response.statusMessage
1383
- );
1384
- }
1385
- return ctx.response.body;
1386
- });
1387
- }
1388
-
1389
- const scheduledTasks = false;
1390
-
1391
- const tasks = {
1392
-
1393
- };
1394
-
1395
- const __runningTasks__ = {};
1396
- async function runTask(name, {
1397
- payload = {},
1398
- context = {}
1399
- } = {}) {
1400
- if (__runningTasks__[name]) {
1401
- return __runningTasks__[name];
1402
- }
1403
- if (!(name in tasks)) {
1404
- throw createError({
1405
- message: `Task \`${name}\` is not available!`,
1406
- statusCode: 404
1407
- });
1408
- }
1409
- if (!tasks[name].resolve) {
1410
- throw createError({
1411
- message: `Task \`${name}\` is not implemented!`,
1412
- statusCode: 501
1413
- });
1414
- }
1415
- const handler = await tasks[name].resolve();
1416
- const taskEvent = { name, payload, context };
1417
- __runningTasks__[name] = handler.run(taskEvent);
1418
- try {
1419
- const res = await __runningTasks__[name];
1420
- return res;
1421
- } finally {
1422
- delete __runningTasks__[name];
1423
- }
1424
- }
1425
-
1426
- function buildAssetsDir() {
1427
- return useRuntimeConfig().app.buildAssetsDir;
1428
- }
1429
- function buildAssetsURL(...path) {
1430
- return joinRelativeURL(publicAssetsURL(), buildAssetsDir(), ...path);
1431
- }
1432
- function publicAssetsURL(...path) {
1433
- const app = useRuntimeConfig().app;
1434
- const publicBase = app.cdnURL || app.baseURL;
1435
- return path.length ? joinRelativeURL(publicBase, ...path) : publicBase;
1436
- }
1437
-
1438
- const defuReplaceArray = createDefu((obj, key, value) => {
1439
- if (Array.isArray(obj[key]) || Array.isArray(value)) {
1440
- obj[key] = value;
1441
- return true;
1442
- }
1443
- });
1444
-
1445
- const nitroAppSecurityOptions = {};
1446
- function getAppSecurityOptions() {
1447
- return nitroAppSecurityOptions;
1448
- }
1449
- function resolveSecurityRules(event) {
1450
- if (!event.context.security) {
1451
- event.context.security = {};
1452
- }
1453
- if (!event.context.security.rules) {
1454
- const router = createRouter({ routes: structuredClone(nitroAppSecurityOptions) });
1455
- const matcher = toRouteMatcher(router);
1456
- const matches = matcher.matchAll(event.path.split("?")[0]);
1457
- const rules = defuReplaceArray({}, ...matches.reverse());
1458
- event.context.security.rules = rules;
1459
- }
1460
- return event.context.security.rules;
1461
- }
1462
- function resolveSecurityRoute(event) {
1463
- if (!event.context.security) {
1464
- event.context.security = {};
1465
- }
1466
- if (!event.context.security.route) {
1467
- const routeNames = Object.fromEntries(Object.entries(nitroAppSecurityOptions).map(([name]) => [name, { name }]));
1468
- const router = createRouter({ routes: routeNames });
1469
- const match = router.lookup(event.path.split("?")[0]);
1470
- const route = match?.name ?? "";
1471
- event.context.security.route = route;
1472
- }
1473
- return event.context.security.route;
1474
- }
1475
-
1476
- const KEYS_TO_NAMES = {
1477
- contentSecurityPolicy: "Content-Security-Policy",
1478
- crossOriginEmbedderPolicy: "Cross-Origin-Embedder-Policy",
1479
- crossOriginOpenerPolicy: "Cross-Origin-Opener-Policy",
1480
- crossOriginResourcePolicy: "Cross-Origin-Resource-Policy",
1481
- originAgentCluster: "Origin-Agent-Cluster",
1482
- referrerPolicy: "Referrer-Policy",
1483
- strictTransportSecurity: "Strict-Transport-Security",
1484
- xContentTypeOptions: "X-Content-Type-Options",
1485
- xDNSPrefetchControl: "X-DNS-Prefetch-Control",
1486
- xDownloadOptions: "X-Download-Options",
1487
- xFrameOptions: "X-Frame-Options",
1488
- xPermittedCrossDomainPolicies: "X-Permitted-Cross-Domain-Policies",
1489
- xXSSProtection: "X-XSS-Protection",
1490
- permissionsPolicy: "Permissions-Policy"
1491
- };
1492
- const NAMES_TO_KEYS = Object.fromEntries(Object.entries(KEYS_TO_NAMES).map(([key, name]) => [name, key]));
1493
- function getNameFromKey(key) {
1494
- return KEYS_TO_NAMES[key];
1495
- }
1496
- function getKeyFromName(headerName) {
1497
- const [, key] = Object.entries(NAMES_TO_KEYS).find(([name]) => name.toLowerCase() === headerName.toLowerCase()) || [];
1498
- return key;
1499
- }
1500
- function headerStringFromObject(optionKey, optionValue) {
1501
- if (optionValue === false) {
1502
- return "";
1503
- }
1504
- if (optionKey === "contentSecurityPolicy") {
1505
- const policies = optionValue;
1506
- return Object.entries(policies).filter(([, value]) => value !== false).map(([directive, sources]) => {
1507
- if (directive === "upgrade-insecure-requests") {
1508
- return "upgrade-insecure-requests;";
1509
- } else {
1510
- const stringifiedSources = typeof sources === "string" ? sources : sources.map((source) => source.trim()).join(" ");
1511
- return `${directive} ${stringifiedSources};`;
1512
- }
1513
- }).join(" ");
1514
- } else if (optionKey === "strictTransportSecurity") {
1515
- const policies = optionValue;
1516
- return [
1517
- `max-age=${policies.maxAge};`,
1518
- policies.includeSubdomains && "includeSubDomains;",
1519
- policies.preload && "preload;"
1520
- ].filter(Boolean).join(" ");
1521
- } else if (optionKey === "permissionsPolicy") {
1522
- const policies = optionValue;
1523
- return Object.entries(policies).filter(([, value]) => value !== false).map(([directive, sources]) => {
1524
- if (typeof sources === "string") {
1525
- return `${directive}=${sources}`;
1526
- } else {
1527
- return `${directive}=(${sources.join(" ")})`;
1528
- }
1529
- }).join(", ");
1530
- } else {
1531
- return optionValue;
1532
- }
1533
- }
1534
- function headerObjectFromString(optionKey, headerValue) {
1535
- if (!headerValue) {
1536
- return false;
1537
- }
1538
- if (optionKey === "contentSecurityPolicy") {
1539
- const directives = headerValue.split(";").map((directive) => directive.trim()).filter((directive) => directive);
1540
- const objectForm = {};
1541
- for (const directive of directives) {
1542
- const [type, ...sources] = directive.split(" ").map((token) => token.trim());
1543
- if (type === "upgrade-insecure-requests") {
1544
- objectForm[type] = true;
1545
- } else {
1546
- objectForm[type] = sources.join(" ");
1547
- }
1548
- }
1549
- return objectForm;
1550
- } else if (optionKey === "strictTransportSecurity") {
1551
- const directives = headerValue.split(";").map((directive) => directive.trim()).filter((directive) => directive);
1552
- const objectForm = {};
1553
- for (const directive of directives) {
1554
- const [type, value] = directive.split("=").map((token) => token.trim());
1555
- if (type === "max-age") {
1556
- objectForm.maxAge = Number(value);
1557
- } else if (type === "includeSubdomains" || type === "preload") {
1558
- objectForm[type] = true;
1559
- }
1560
- }
1561
- return objectForm;
1562
- } else if (optionKey === "permissionsPolicy") {
1563
- const directives = headerValue.split(",").map((directive) => directive.trim()).filter((directive) => directive);
1564
- const objectForm = {};
1565
- for (const directive of directives) {
1566
- const [type, value] = directive.split("=").map((token) => token.trim());
1567
- objectForm[type] = value;
1568
- }
1569
- return objectForm;
1570
- } else {
1571
- return headerValue;
1572
- }
1573
- }
1574
- function standardToSecurity(standardHeaders) {
1575
- if (!standardHeaders) {
1576
- return void 0;
1577
- }
1578
- const standardHeadersAsObject = {};
1579
- Object.entries(standardHeaders).forEach(([headerName, headerValue]) => {
1580
- const optionKey = getKeyFromName(headerName);
1581
- if (optionKey) {
1582
- if (typeof headerValue === "string") {
1583
- const objectValue = headerObjectFromString(optionKey, headerValue);
1584
- standardHeadersAsObject[optionKey] = objectValue;
1585
- } else {
1586
- standardHeadersAsObject[optionKey] = headerValue;
1587
- }
1588
- }
1589
- });
1590
- if (Object.keys(standardHeadersAsObject).length === 0) {
1591
- return void 0;
1592
- }
1593
- return standardHeadersAsObject;
1594
- }
1595
- function backwardsCompatibleSecurity(securityHeaders) {
1596
- if (!securityHeaders) {
1597
- return void 0;
1598
- }
1599
- const securityHeadersAsObject = {};
1600
- Object.entries(securityHeaders).forEach(([key, value]) => {
1601
- const optionKey = key;
1602
- if ((optionKey === "contentSecurityPolicy" || optionKey === "permissionsPolicy" || optionKey === "strictTransportSecurity") && typeof value === "string") {
1603
- const objectValue = headerObjectFromString(optionKey, value);
1604
- securityHeadersAsObject[optionKey] = objectValue;
1605
- } else if (value === "") {
1606
- securityHeadersAsObject[optionKey] = false;
1607
- } else {
1608
- securityHeadersAsObject[optionKey] = value;
1609
- }
1610
- });
1611
- return securityHeadersAsObject;
1612
- }
1613
-
1614
- const _JvOSxtiYN5RhTtiWK4gP6Qxjgh3Y8HYwNigx1wgQzE0 = defineNitroPlugin(async (nitroApp) => {
1615
- const appSecurityOptions = getAppSecurityOptions();
1616
- const runtimeConfig = useRuntimeConfig();
1617
- for (const route in runtimeConfig.nitro.routeRules) {
1618
- const rule = runtimeConfig.nitro.routeRules[route];
1619
- const { headers: headers2 } = rule;
1620
- const securityHeaders2 = standardToSecurity(headers2);
1621
- if (securityHeaders2) {
1622
- appSecurityOptions[route] = { headers: securityHeaders2 };
1623
- }
1624
- }
1625
- const securityOptions = runtimeConfig.security;
1626
- const { headers } = securityOptions;
1627
- const securityHeaders = backwardsCompatibleSecurity(headers);
1628
- appSecurityOptions["/**"] = defuReplaceArray(
1629
- { headers: securityHeaders },
1630
- securityOptions,
1631
- appSecurityOptions["/**"]
1632
- );
1633
- for (const route in runtimeConfig.nitro.routeRules) {
1634
- const rule = runtimeConfig.nitro.routeRules[route];
1635
- const { security } = rule;
1636
- if (security) {
1637
- const { headers: headers2 } = security;
1638
- const securityHeaders2 = backwardsCompatibleSecurity(headers2);
1639
- appSecurityOptions[route] = defuReplaceArray(
1640
- { headers: securityHeaders2 },
1641
- security,
1642
- appSecurityOptions[route]
1643
- );
1644
- }
1645
- }
1646
- nitroApp.hooks.hook("nuxt-security:headers", ({ route, headers: headers2 }) => {
1647
- appSecurityOptions[route] = defuReplaceArray(
1648
- { headers: headers2 },
1649
- appSecurityOptions[route]
1650
- );
1651
- });
1652
- nitroApp.hooks.hook("nuxt-security:ready", async () => {
1653
- await nitroApp.hooks.callHook("nuxt-security:routeRules", appSecurityOptions);
1654
- });
1655
- await nitroApp.hooks.callHook("nuxt-security:ready");
1656
- });
1657
-
1658
- const sriHashes = {"/_nuxt/builds/meta/dev.json":"sha384-RnlxdI9UEL2HQoPXEfAFONjOYyt7jvEQc+i3tMW6lqUfdPwzannLtNOkjBFGG5QX","/_nuxt/builds/latest.json":"sha384-ZTQaLD+iOy+sVKCfEcob0GHKpIU4zC0HInFPWAsg69JpDl2fx+12DwGFIlkfkdQP","/favicon.ico":"sha384-qOhXBYvwwZHHuXW10XxZvVu9Mzkpqf/fw3zEOxCGyqOoKqyHbeudntAaY6nKOTro","/nuxt-ignis.png":"sha384-fXgXTmjUDLdbwf7u18hVtq6YkShXv8NyJaUskNLpnUNtypcNblNb8I7IDXKgYEeY","/unsplash.jpg":"sha384-66n0HIHfBVzK8qdw7zVfgwJ5htcrV6EtN2DQmlyxUIu46/kEKMRMqFrWKYm8bP18","/nuxt-spec.png":"sha384-lqerIwfMImy74T5uRR9ogeRAvkGehx21V4QBTVB0a6Zp+2VTFMZmjOtNAAti72LU"};
1659
-
1660
- const SCRIPT_RE$1 = /<script((?=[^>]+\bsrc="([^"]+)")(?![^>]+\bintegrity="[^"]+")[^>]+)(?:\/>|><\/script>)/g;
1661
- const LINK_RE$1 = /<link((?=[^>]+\brel="(?:stylesheet|preload|modulepreload)")(?=[^>]+\bhref="([^"]+)")(?![^>]+\bintegrity="[\w\-+/=]+")[^>]+)>/g;
1662
- const _tbxOaQl1Y3WSOzpNJdiujwdTtkhHlEhGs2foVq53CE = defineNitroPlugin((nitroApp) => {
1663
- nitroApp.hooks.hook("render:html", (html, { event }) => {
1664
- const rules = resolveSecurityRules(event);
1665
- if (!rules.enabled || !rules.sri) {
1666
- return;
1667
- }
1668
- const sections = ["body", "bodyAppend", "bodyPrepend", "head"];
1669
- for (const section of sections) {
1670
- html[section] = html[section].map((element) => {
1671
- if (typeof element !== "string") {
1672
- return element;
1673
- }
1674
- element = element.replace(SCRIPT_RE$1, (match, rest, src) => {
1675
- const hash = sriHashes[src];
1676
- if (hash) {
1677
- const integrityScript = `<script integrity="${hash}"${rest}><\/script>`;
1678
- return integrityScript;
1679
- } else {
1680
- return match;
1681
- }
1682
- });
1683
- element = element.replace(LINK_RE$1, (match, rest, href) => {
1684
- const hash = sriHashes[href];
1685
- if (hash) {
1686
- const integrityLink = `<link integrity="${hash}"${rest}>`;
1687
- return integrityLink;
1688
- } else {
1689
- return match;
1690
- }
1691
- });
1692
- return element;
1693
- });
1694
- }
1695
- });
1696
- });
1697
-
1698
- globalThis.crypto ??= webcrypto;
1699
- function generateRandomNonce() {
1700
- const array = new Uint8Array(18);
1701
- crypto.getRandomValues(array);
1702
- const nonce = btoa(String.fromCharCode(...array));
1703
- return nonce;
1704
- }
1705
-
1706
- const _RQgJM5yHb0OFbqso6l7JH4lwg1WlOglzD4emxnWL9BA = defineNitroPlugin((nitroApp) => {
1707
- {
1708
- return;
1709
- }
1710
- });
1711
-
1712
- const LINK_RE = /<link([^>]*?>)/gi;
1713
- const NONCE_RE = /nonce="[^"]+"/i;
1714
- const SCRIPT_RE = /<script([^>]*?>)/gi;
1715
- const STYLE_RE = /<style([^>]*?>)/gi;
1716
- const _XhOSEDieM4_mfBI7ZVt8bJwMIqkowHxufWk5iOPyG8w = defineNitroPlugin((nitroApp) => {
1717
- nitroApp.hooks.hook("request", (event) => {
1718
- if (event.context.security?.nonce) {
1719
- return;
1720
- }
1721
- const rules = resolveSecurityRules(event);
1722
- if (rules.enabled && rules.nonce && true) {
1723
- const nonce = generateRandomNonce();
1724
- event.context.security.nonce = nonce;
1725
- }
1726
- });
1727
- nitroApp.hooks.hook("render:html", (html, { event }) => {
1728
- const rules = resolveSecurityRules(event);
1729
- if (!rules.enabled || !rules.headers || !rules.headers.contentSecurityPolicy || !rules.nonce) {
1730
- return;
1731
- }
1732
- const nonce = event.context.security.nonce;
1733
- const sections = ["body", "bodyAppend", "bodyPrepend", "head"];
1734
- for (const section of sections) {
1735
- html[section] = html[section].map((element) => {
1736
- if (typeof element !== "string") {
1737
- return element;
1738
- }
1739
- element = element.replace(LINK_RE, (match, rest) => {
1740
- if (NONCE_RE.test(rest)) {
1741
- return match.replace(NONCE_RE, `nonce="${nonce}"`);
1742
- }
1743
- return `<link nonce="${nonce}"` + rest;
1744
- });
1745
- element = element.replace(SCRIPT_RE, (match, rest) => {
1746
- return `<script nonce="${nonce}"` + rest;
1747
- });
1748
- element = element.replace(STYLE_RE, (match, rest) => {
1749
- return `<style nonce="${nonce}"` + rest;
1750
- });
1751
- return element;
1752
- });
1753
- }
1754
- {
1755
- html.head.push(
1756
- `<meta property="csp-nonce" nonce="${nonce}">`
1757
- );
1758
- }
1759
- });
1760
- });
1761
-
1762
- const __heuFDCfzogUascLWMufI8GCNumZnqILn2FdJjW9SX4 = defineNitroPlugin((nitroApp) => {
1763
- nitroApp.hooks.hook("render:html", (response, { event }) => {
1764
- if (response.island) {
1765
- return;
1766
- }
1767
- const rules = resolveSecurityRules(event);
1768
- if (rules.enabled && rules.headers) {
1769
- const headers = rules.headers;
1770
- if (headers.contentSecurityPolicy) {
1771
- const csp = headers.contentSecurityPolicy;
1772
- const nonce = event.context.security?.nonce;
1773
- const scriptHashes = event.context.security?.hashes?.script;
1774
- const styleHashes = event.context.security?.hashes?.style;
1775
- headers.contentSecurityPolicy = updateCspVariables(csp, nonce, scriptHashes, styleHashes);
1776
- }
1777
- }
1778
- });
1779
- });
1780
- function updateCspVariables(csp, nonce, scriptHashes, styleHashes) {
1781
- const generatedCsp = Object.fromEntries(Object.entries(csp).map(([directive, value]) => {
1782
- if (typeof value === "boolean") {
1783
- return [directive, value];
1784
- }
1785
- const sources = typeof value === "string" ? value.split(" ").map((token) => token.trim()).filter((token) => token) : value;
1786
- const modifiedSources = sources.filter((source) => {
1787
- if (source.startsWith("'nonce-") && source !== "'nonce-{{nonce}}'") {
1788
- console.warn("[nuxt-security] removing static nonce from CSP header");
1789
- return false;
1790
- }
1791
- return true;
1792
- }).map((source) => {
1793
- if (source === "'nonce-{{nonce}}'") {
1794
- return nonce ? `'nonce-${nonce}'` : "";
1795
- } else {
1796
- return source;
1797
- }
1798
- }).filter((source) => source);
1799
- if (directive === "script-src" && scriptHashes) {
1800
- modifiedSources.push(...scriptHashes);
1801
- }
1802
- if (directive === "style-src" && styleHashes) {
1803
- modifiedSources.push(...styleHashes);
1804
- }
1805
- return [directive, modifiedSources];
1806
- }));
1807
- return generatedCsp;
1808
- }
1809
-
1810
- const _aHJVv3EIEUN9vB3SE4vOkiDLzGiGhyqj6au1QIwWx8 = defineNitroPlugin((nitroApp) => {
1811
- {
1812
- return;
1813
- }
1814
- });
1815
-
1816
- const _DyMRzPH15AoEzH6bcFlYsDJQ8vPhi_NfbZ4pC9DNfyI = defineNitroPlugin((nitroApp) => {
1817
- nitroApp.hooks.hook("render:response", (response, { event }) => {
1818
- const rules = resolveSecurityRules(event);
1819
- if (rules.enabled && rules.headers) {
1820
- const headers = rules.headers;
1821
- Object.entries(headers).forEach(([header, value]) => {
1822
- const headerName = getNameFromKey(header);
1823
- if (value === false) {
1824
- const { headers: standardHeaders } = getRouteRules(event);
1825
- const standardHeaderValue = standardHeaders?.[headerName];
1826
- const currentHeaderValue = getResponseHeader(event, headerName);
1827
- if (standardHeaderValue === currentHeaderValue) {
1828
- removeResponseHeader(event, headerName);
1829
- }
1830
- } else {
1831
- const headerValue = headerStringFromObject(header, value);
1832
- setResponseHeader(event, headerName, headerValue);
1833
- }
1834
- });
1835
- }
1836
- });
1837
- });
1838
-
1839
- const _tZXTnUnKl_u8d0rfkkU0LQbiR3UDjJkyevkUpuPgMg = defineNitroPlugin((nitroApp) => {
1840
- nitroApp.hooks.hook("beforeResponse", (event) => {
1841
- const rules = resolveSecurityRules(event);
1842
- if (rules.enabled && rules.hidePoweredBy && !event.node.res.headersSent) {
1843
- removeResponseHeader(event, "x-powered-by");
1844
- }
1845
- });
1846
- });
1847
-
1848
- const _KIUo4nid7mjU4TFOv7ese0pfkfn6j2t89IVe_tmybyI = defineNitroPlugin(async (nitroApp) => {
1849
- {
1850
- const prerenderedHeaders = await useStorage("assets:nuxt-security").getItem("headers.json") || {};
1851
- nitroApp.hooks.hook("beforeResponse", (event) => {
1852
- const rules = resolveSecurityRules(event);
1853
- if (rules.enabled && rules.ssg && rules.ssg.nitroHeaders) {
1854
- const path = event.path.split("?")[0];
1855
- if (prerenderedHeaders[path]) {
1856
- setResponseHeaders(event, prerenderedHeaders[path]);
1857
- }
1858
- }
1859
- });
1860
- }
1861
- });
1862
-
1863
- const plugins = [
1864
- _5987bk89juboHi1UbD2gs47PjoxO235tpRpyW3qHkPY,
1865
- _Ob_cXFr8ciCF2J_B5Yb0NR9hm_x8DQDjHBqdHqX3JI,
1866
- _gLOeqSTdYtSmvm3NLY8ox1LOh6DY4GgpRaz2D6f9XU,
1867
- _JvOSxtiYN5RhTtiWK4gP6Qxjgh3Y8HYwNigx1wgQzE0,
1868
- _tbxOaQl1Y3WSOzpNJdiujwdTtkhHlEhGs2foVq53CE,
1869
- _RQgJM5yHb0OFbqso6l7JH4lwg1WlOglzD4emxnWL9BA,
1870
- _XhOSEDieM4_mfBI7ZVt8bJwMIqkowHxufWk5iOPyG8w,
1871
- __heuFDCfzogUascLWMufI8GCNumZnqILn2FdJjW9SX4,
1872
- _aHJVv3EIEUN9vB3SE4vOkiDLzGiGhyqj6au1QIwWx8,
1873
- _DyMRzPH15AoEzH6bcFlYsDJQ8vPhi_NfbZ4pC9DNfyI,
1874
- _tZXTnUnKl_u8d0rfkkU0LQbiR3UDjJkyevkUpuPgMg,
1875
- _KIUo4nid7mjU4TFOv7ese0pfkfn6j2t89IVe_tmybyI
1876
- ];
1877
-
1878
- const defaultThrowErrorValue = { throwError: true };
1879
- const defaultSecurityConfig = (serverlUrl, strict) => {
1880
- const defaultConfig = {
1881
- strict,
1882
- headers: {
1883
- crossOriginResourcePolicy: "same-origin",
1884
- crossOriginOpenerPolicy: "same-origin",
1885
- crossOriginEmbedderPolicy: "unsafe-none" ,
1886
- contentSecurityPolicy: {
1887
- "base-uri": ["'none'"],
1888
- "font-src": ["'self'", "https:", "data:"],
1889
- "form-action": ["'self'"],
1890
- "frame-ancestors": ["'self'"],
1891
- "img-src": ["'self'", "data:"],
1892
- "object-src": ["'none'"],
1893
- "script-src-attr": ["'none'"],
1894
- "style-src": ["'self'", "https:", "'unsafe-inline'"],
1895
- "script-src": ["'self'", "https:", "'unsafe-inline'", "'strict-dynamic'", "'nonce-{{nonce}}'"],
1896
- "upgrade-insecure-requests": true
1897
- },
1898
- originAgentCluster: "?1",
1899
- referrerPolicy: "no-referrer",
1900
- strictTransportSecurity: {
1901
- maxAge: 15552e3,
1902
- includeSubdomains: true
1903
- },
1904
- xContentTypeOptions: "nosniff",
1905
- xDNSPrefetchControl: "off",
1906
- xDownloadOptions: "noopen",
1907
- xFrameOptions: "SAMEORIGIN",
1908
- xPermittedCrossDomainPolicies: "none",
1909
- xXSSProtection: "0",
1910
- permissionsPolicy: {
1911
- camera: [],
1912
- "display-capture": [],
1913
- fullscreen: [],
1914
- geolocation: [],
1915
- microphone: []
1916
- }
1917
- },
1918
- requestSizeLimiter: {
1919
- maxRequestSizeInBytes: 2e6,
1920
- maxUploadFileRequestInBytes: 8e6,
1921
- ...defaultThrowErrorValue
1922
- },
1923
- rateLimiter: {
1924
- // Twitter search rate limiting
1925
- tokensPerInterval: 150,
1926
- interval: 3e5,
1927
- headers: false,
1928
- driver: {
1929
- name: "lruCache"
1930
- },
1931
- whiteList: void 0,
1932
- ...defaultThrowErrorValue
1933
- },
1934
- xssValidator: {
1935
- methods: ["GET", "POST"],
1936
- ...defaultThrowErrorValue
1937
- },
1938
- corsHandler: {
1939
- // Options by CORS middleware for Express https://github.com/expressjs/cors#configuration-options
1940
- origin: serverlUrl,
1941
- methods: ["GET", "HEAD", "PUT", "PATCH", "POST", "DELETE"],
1942
- preflight: {
1943
- statusCode: 204
1944
- }
1945
- },
1946
- allowedMethodsRestricter: {
1947
- methods: "*",
1948
- ...defaultThrowErrorValue
1949
- },
1950
- hidePoweredBy: true,
1951
- basicAuth: false,
1952
- enabled: true,
1953
- csrf: false,
1954
- nonce: true,
1955
- removeLoggers: true,
1956
- ssg: {
1957
- meta: true,
1958
- hashScripts: true,
1959
- hashStyles: false,
1960
- nitroHeaders: true,
1961
- exportToPresets: true
1962
- },
1963
- sri: true
1964
- };
1965
- return defaultConfig;
1966
- };
1967
-
1968
- const FILE_UPLOAD_HEADER = "multipart/form-data";
1969
- const defaultSizeLimiter = defaultSecurityConfig("").requestSizeLimiter;
1970
- const _nGzU2E = defineEventHandler((event) => {
1971
- const rules = resolveSecurityRules(event);
1972
- if (rules.enabled && rules.requestSizeLimiter) {
1973
- const requestSizeLimiter = defu(
1974
- rules.requestSizeLimiter,
1975
- defaultSizeLimiter
1976
- );
1977
- if (["POST", "PUT", "DELETE"].includes(event.node.req.method)) {
1978
- const contentLengthValue = getRequestHeader(event, "content-length");
1979
- const contentTypeValue = getRequestHeader(event, "content-type");
1980
- const isFileUpload = contentTypeValue?.includes(FILE_UPLOAD_HEADER);
1981
- const requestLimit = isFileUpload ? requestSizeLimiter.maxUploadFileRequestInBytes : requestSizeLimiter.maxRequestSizeInBytes;
1982
- if (parseInt(contentLengthValue) >= requestLimit) {
1983
- const payloadTooLargeError = {
1984
- statusCode: 413,
1985
- statusMessage: "Payload Too Large"
1986
- };
1987
- if (requestSizeLimiter.throwError === false) {
1988
- return payloadTooLargeError;
1989
- }
1990
- throw createError(payloadTooLargeError);
1991
- }
1992
- }
1993
- }
1994
- });
1995
-
1996
- const _DBwtAP = defineEventHandler((event) => {
1997
- const rules = resolveSecurityRules(event);
1998
- if (rules.enabled && rules.corsHandler) {
1999
- const { corsHandler } = rules;
2000
- let origin;
2001
- if (typeof corsHandler.origin === "string" && corsHandler.origin !== "*") {
2002
- origin = [corsHandler.origin];
2003
- } else {
2004
- origin = corsHandler.origin;
2005
- }
2006
- if (origin && origin !== "*" && corsHandler.useRegExp) {
2007
- origin = origin.map((o) => new RegExp(o, "i"));
2008
- }
2009
- handleCors(event, {
2010
- origin,
2011
- methods: corsHandler.methods,
2012
- allowHeaders: corsHandler.allowHeaders,
2013
- exposeHeaders: corsHandler.exposeHeaders,
2014
- credentials: corsHandler.credentials,
2015
- maxAge: corsHandler.maxAge,
2016
- preflight: corsHandler.preflight
2017
- });
2018
- }
2019
- });
2020
-
2021
- const _a3BfBQ = defineEventHandler((event) => {
2022
- const rules = resolveSecurityRules(event);
2023
- if (rules.enabled && rules.allowedMethodsRestricter) {
2024
- const { allowedMethodsRestricter } = rules;
2025
- const allowedMethods = allowedMethodsRestricter.methods;
2026
- if (allowedMethods !== "*" && !allowedMethods.includes(event.node.req.method)) {
2027
- const methodNotAllowedError = {
2028
- statusCode: 405,
2029
- statusMessage: "Method not allowed"
2030
- };
2031
- if (allowedMethodsRestricter.throwError === false) {
2032
- return methodNotAllowedError;
2033
- }
2034
- throw createError(methodNotAllowedError);
2035
- }
2036
- }
2037
- });
2038
-
2039
- const storage = useStorage("#rate-limiter-storage");
2040
- const defaultRateLimiter = defaultSecurityConfig("").rateLimiter;
2041
- const _4fQwYD = defineEventHandler(async (event) => {
2042
- const rules = resolveSecurityRules(event);
2043
- const route = resolveSecurityRoute(event);
2044
- if (rules.enabled && rules.rateLimiter) {
2045
- const rateLimiter = defu(
2046
- rules.rateLimiter,
2047
- defaultRateLimiter
2048
- );
2049
- const ip = getIP(event);
2050
- if (rateLimiter.whiteList && rateLimiter.whiteList.includes(ip)) {
2051
- return;
2052
- }
2053
- const url = ip + route;
2054
- let storageItem = await storage.getItem(url);
2055
- if (!storageItem) {
2056
- await setStorageItem(rateLimiter, url);
2057
- } else {
2058
- if (typeof storageItem !== "object") {
2059
- return;
2060
- }
2061
- const timeSinceFirstRateLimit = storageItem.date;
2062
- const timeForInterval = storageItem.date + Number(rateLimiter.interval);
2063
- if (Date.now() >= timeForInterval) {
2064
- await setStorageItem(rateLimiter, url);
2065
- storageItem = await storage.getItem(url);
2066
- }
2067
- const isLimited = timeSinceFirstRateLimit <= timeForInterval && storageItem.value === 0;
2068
- if (isLimited) {
2069
- const tooManyRequestsError = {
2070
- statusCode: 429,
2071
- statusMessage: "Too Many Requests"
2072
- };
2073
- if (rules.rateLimiter.headers) {
2074
- setResponseHeader(event, "x-ratelimit-remaining", 0);
2075
- setResponseHeader(event, "x-ratelimit-limit", rateLimiter.tokensPerInterval);
2076
- setResponseHeader(event, "x-ratelimit-reset", timeForInterval);
2077
- }
2078
- if (rateLimiter.throwError === false) {
2079
- return tooManyRequestsError;
2080
- }
2081
- throw createError(tooManyRequestsError);
2082
- }
2083
- const newItemDate = timeSinceFirstRateLimit > timeForInterval ? Date.now() : storageItem.date;
2084
- const newStorageItem = { value: storageItem.value - 1, date: newItemDate };
2085
- await storage.setItem(url, newStorageItem);
2086
- const currentItem = await storage.getItem(url);
2087
- if (currentItem && rateLimiter.headers) {
2088
- setResponseHeader(event, "x-ratelimit-remaining", currentItem.value);
2089
- setResponseHeader(event, "x-ratelimit-limit", rateLimiter.tokensPerInterval);
2090
- setResponseHeader(event, "x-ratelimit-reset", timeForInterval);
2091
- }
2092
- }
2093
- }
2094
- });
2095
- async function setStorageItem(rateLimiter, url) {
2096
- const rateLimitedObject = { value: rateLimiter.tokensPerInterval, date: Date.now() };
2097
- await storage.setItem(url, rateLimitedObject);
2098
- }
2099
- function getIP(event) {
2100
- const ip = getRequestIP(event, { xForwardedFor: true }) || "";
2101
- return ip;
2102
- }
2103
-
2104
- const _DJziEh = defineEventHandler(async (event) => {
2105
- const rules = resolveSecurityRules(event);
2106
- if (rules.enabled && rules.xssValidator) {
2107
- const filterOpt = {
2108
- ...rules.xssValidator,
2109
- escapeHtml: void 0
2110
- };
2111
- if (rules.xssValidator.escapeHtml === false) {
2112
- filterOpt.escapeHtml = (value) => value;
2113
- }
2114
- const xssValidator = new FilterXSS(filterOpt);
2115
- if (event.node.req.socket.readyState !== "readOnly") {
2116
- if (rules.xssValidator.methods && rules.xssValidator.methods.includes(
2117
- event.node.req.method
2118
- )) {
2119
- const valueToFilter = event.node.req.method === "GET" ? getQuery$1(event) : event.node.req.headers["content-type"]?.includes(
2120
- "multipart/form-data"
2121
- ) ? await readMultipartFormData(event) : await readBody(event);
2122
- if (valueToFilter && Object.keys(valueToFilter).length) {
2123
- if (valueToFilter.statusMessage && valueToFilter.statusMessage !== "Bad Request") {
2124
- return;
2125
- }
2126
- const stringifiedValue = JSON.stringify(valueToFilter);
2127
- const processedValue = xssValidator.process(
2128
- JSON.stringify(valueToFilter)
2129
- );
2130
- if (processedValue !== stringifiedValue) {
2131
- const badRequestError = {
2132
- statusCode: 400,
2133
- statusMessage: "Bad Request"
2134
- };
2135
- if (rules.xssValidator.throwError === false) {
2136
- return badRequestError;
2137
- }
2138
- throw createError(badRequestError);
2139
- }
2140
- }
2141
- }
2142
- }
2143
- }
2144
- });
2145
-
2146
- const VueResolver = (_, value) => {
2147
- return isRef(value) ? toValue(value) : value;
2148
- };
2149
-
2150
- const headSymbol = "usehead";
2151
- function vueInstall(head) {
2152
- const plugin = {
2153
- install(app) {
2154
- app.config.globalProperties.$unhead = head;
2155
- app.config.globalProperties.$head = head;
2156
- app.provide(headSymbol, head);
2157
- }
2158
- };
2159
- return plugin.install;
2160
- }
2161
-
2162
- function resolveUnrefHeadInput(input) {
2163
- return walkResolver(input, VueResolver);
2164
- }
2165
-
2166
- function createHead(options = {}) {
2167
- const head = createHead$1({
2168
- ...options,
2169
- propResolvers: [VueResolver]
2170
- });
2171
- head.install = vueInstall(head);
2172
- return head;
2173
- }
2174
-
2175
- const unheadOptions = {
2176
- disableDefaults: true,
2177
- disableCapoSorting: false,
2178
- plugins: [DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin],
2179
- };
2180
-
2181
- function createSSRContext(event) {
2182
- const ssrContext = {
2183
- url: event.path,
2184
- event,
2185
- runtimeConfig: useRuntimeConfig(event),
2186
- noSSR: event.context.nuxt?.noSSR || (false),
2187
- head: createHead(unheadOptions),
2188
- error: false,
2189
- nuxt: void 0,
2190
- /* NuxtApp */
2191
- payload: {},
2192
- _payloadReducers: /* @__PURE__ */ Object.create(null),
2193
- modules: /* @__PURE__ */ new Set()
2194
- };
2195
- return ssrContext;
2196
- }
2197
- function setSSRError(ssrContext, error) {
2198
- ssrContext.error = true;
2199
- ssrContext.payload = { error };
2200
- ssrContext.url = error.url;
2201
- }
2202
-
2203
- const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
2204
- const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
2205
- const getServerEntry = () => import('file://C:/Git/nuxt-ignis/core/.nuxt/dist/server/server.mjs').then((r) => r.default || r);
2206
- const getClientManifest = () => import('file://C:/Git/nuxt-ignis/core/.nuxt/dist/server/client.manifest.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
2207
- const getSSRRenderer = lazyCachedFunction(async () => {
2208
- const manifest = await getClientManifest();
2209
- if (!manifest) {
2210
- throw new Error("client.manifest is not available");
2211
- }
2212
- const createSSRApp = await getServerEntry();
2213
- if (!createSSRApp) {
2214
- throw new Error("Server bundle is not available");
2215
- }
2216
- const options = {
2217
- manifest,
2218
- renderToString: renderToString$1,
2219
- buildAssetsURL
2220
- };
2221
- const renderer = createRenderer(createSSRApp, options);
2222
- async function renderToString$1(input, context) {
2223
- const html = await renderToString(input, context);
2224
- if (process.env.NUXT_VITE_NODE_OPTIONS) {
2225
- renderer.rendererContext.updateManifest(await getClientManifest());
2226
- }
2227
- return APP_ROOT_OPEN_TAG + html + APP_ROOT_CLOSE_TAG;
2228
- }
2229
- return renderer;
2230
- });
2231
- const getSPARenderer = lazyCachedFunction(async () => {
2232
- const manifest = await getClientManifest();
2233
- const spaTemplate = await Promise.resolve().then(function () { return _virtual__spaTemplate; }).then((r) => r.template).catch(() => "").then((r) => {
2234
- {
2235
- return APP_ROOT_OPEN_TAG + r + APP_ROOT_CLOSE_TAG;
2236
- }
2237
- });
2238
- const options = {
2239
- manifest,
2240
- renderToString: () => spaTemplate,
2241
- buildAssetsURL
2242
- };
2243
- const renderer = createRenderer(() => () => {
2244
- }, options);
2245
- const result = await renderer.renderToString({});
2246
- const renderToString = (ssrContext) => {
2247
- const config = useRuntimeConfig(ssrContext.event);
2248
- ssrContext.modules ||= /* @__PURE__ */ new Set();
2249
- ssrContext.payload.serverRendered = false;
2250
- ssrContext.config = {
2251
- public: config.public,
2252
- app: config.app
2253
- };
2254
- return Promise.resolve(result);
2255
- };
2256
- return {
2257
- rendererContext: renderer.rendererContext,
2258
- renderToString
2259
- };
2260
- });
2261
- function lazyCachedFunction(fn) {
2262
- let res = null;
2263
- return () => {
2264
- if (res === null) {
2265
- res = fn().catch((err) => {
2266
- res = null;
2267
- throw err;
2268
- });
2269
- }
2270
- return res;
2271
- };
2272
- }
2273
- function getRenderer(ssrContext) {
2274
- return ssrContext.noSSR ? getSPARenderer() : getSSRRenderer();
2275
- }
2276
- const getSSRStyles = lazyCachedFunction(() => Promise.resolve().then(function () { return styles$1; }).then((r) => r.default || r));
2277
-
2278
- async function renderInlineStyles(usedModules) {
2279
- const styleMap = await getSSRStyles();
2280
- const inlinedStyles = /* @__PURE__ */ new Set();
2281
- for (const mod of usedModules) {
2282
- if (mod in styleMap && styleMap[mod]) {
2283
- for (const style of await styleMap[mod]()) {
2284
- inlinedStyles.add(style);
2285
- }
2286
- }
2287
- }
2288
- return Array.from(inlinedStyles).map((style) => ({ innerHTML: style }));
2289
- }
2290
-
2291
- const ROOT_NODE_REGEX = new RegExp(`^<${appRootTag}[^>]*>([\\s\\S]*)<\\/${appRootTag}>$`);
2292
- function getServerComponentHTML(body) {
2293
- const match = body.match(ROOT_NODE_REGEX);
2294
- return match?.[1] || body;
2295
- }
2296
- const SSR_SLOT_TELEPORT_MARKER = /^uid=([^;]*);slot=(.*)$/;
2297
- const SSR_CLIENT_TELEPORT_MARKER = /^uid=([^;]*);client=(.*)$/;
2298
- const SSR_CLIENT_SLOT_MARKER = /^island-slot=([^;]*);(.*)$/;
2299
- function getSlotIslandResponse(ssrContext) {
2300
- if (!ssrContext.islandContext || !Object.keys(ssrContext.islandContext.slots).length) {
2301
- return void 0;
2302
- }
2303
- const response = {};
2304
- for (const [name, slot] of Object.entries(ssrContext.islandContext.slots)) {
2305
- response[name] = {
2306
- ...slot,
2307
- fallback: ssrContext.teleports?.[`island-fallback=${name}`]
2308
- };
2309
- }
2310
- return response;
2311
- }
2312
- function getClientIslandResponse(ssrContext) {
2313
- if (!ssrContext.islandContext || !Object.keys(ssrContext.islandContext.components).length) {
2314
- return void 0;
2315
- }
2316
- const response = {};
2317
- for (const [clientUid, component] of Object.entries(ssrContext.islandContext.components)) {
2318
- const html = ssrContext.teleports?.[clientUid]?.replaceAll("<!--teleport start anchor-->", "") || "";
2319
- response[clientUid] = {
2320
- ...component,
2321
- html,
2322
- slots: getComponentSlotTeleport(clientUid, ssrContext.teleports ?? {})
2323
- };
2324
- }
2325
- return response;
2326
- }
2327
- function getComponentSlotTeleport(clientUid, teleports) {
2328
- const entries = Object.entries(teleports);
2329
- const slots = {};
2330
- for (const [key, value] of entries) {
2331
- const match = key.match(SSR_CLIENT_SLOT_MARKER);
2332
- if (match) {
2333
- const [, id, slot] = match;
2334
- if (!slot || clientUid !== id) {
2335
- continue;
2336
- }
2337
- slots[slot] = value;
2338
- }
2339
- }
2340
- return slots;
2341
- }
2342
- function replaceIslandTeleports(ssrContext, html) {
2343
- const { teleports, islandContext } = ssrContext;
2344
- if (islandContext || !teleports) {
2345
- return html;
2346
- }
2347
- for (const key in teleports) {
2348
- const matchClientComp = key.match(SSR_CLIENT_TELEPORT_MARKER);
2349
- if (matchClientComp) {
2350
- const [, uid, clientId] = matchClientComp;
2351
- if (!uid || !clientId) {
2352
- continue;
2353
- }
2354
- html = html.replace(new RegExp(` data-island-uid="${uid}" data-island-component="${clientId}"[^>]*>`), (full) => {
2355
- return full + teleports[key];
2356
- });
2357
- continue;
2358
- }
2359
- const matchSlot = key.match(SSR_SLOT_TELEPORT_MARKER);
2360
- if (matchSlot) {
2361
- const [, uid, slot] = matchSlot;
2362
- if (!uid || !slot) {
2363
- continue;
2364
- }
2365
- html = html.replace(new RegExp(` data-island-uid="${uid}" data-island-slot="${slot}"[^>]*>`), (full) => {
2366
- return full + teleports[key];
2367
- });
2368
- }
2369
- }
2370
- return html;
2371
- }
2372
-
2373
- const ISLAND_SUFFIX_RE = /\.json(\?.*)?$/;
2374
- const _SxA8c9 = defineEventHandler(async (event) => {
2375
- const nitroApp = useNitroApp();
2376
- setResponseHeaders(event, {
2377
- "content-type": "application/json;charset=utf-8",
2378
- "x-powered-by": "Nuxt"
2379
- });
2380
- const islandContext = await getIslandContext(event);
2381
- const ssrContext = {
2382
- ...createSSRContext(event),
2383
- islandContext,
2384
- noSSR: false,
2385
- url: islandContext.url
2386
- };
2387
- const renderer = await getSSRRenderer();
2388
- const renderResult = await renderer.renderToString(ssrContext).catch(async (error) => {
2389
- await ssrContext.nuxt?.hooks.callHook("app:error", error);
2390
- throw error;
2391
- });
2392
- const inlinedStyles = await renderInlineStyles(ssrContext.modules ?? []);
2393
- await ssrContext.nuxt?.hooks.callHook("app:rendered", { ssrContext, renderResult });
2394
- if (inlinedStyles.length) {
2395
- ssrContext.head.push({ style: inlinedStyles });
2396
- }
2397
- {
2398
- const { styles } = getRequestDependencies(ssrContext, renderer.rendererContext);
2399
- const link = [];
2400
- for (const resource of Object.values(styles)) {
2401
- if ("inline" in getQuery(resource.file)) {
2402
- continue;
2403
- }
2404
- if (resource.file.includes("scoped") && !resource.file.includes("pages/")) {
2405
- link.push({ rel: "stylesheet", href: renderer.rendererContext.buildAssetsURL(resource.file), crossorigin: "" });
2406
- }
2407
- }
2408
- if (link.length) {
2409
- ssrContext.head.push({ link }, { mode: "server" });
2410
- }
2411
- }
2412
- const islandHead = {};
2413
- for (const entry of ssrContext.head.entries.values()) {
2414
- for (const [key, value] of Object.entries(resolveUnrefHeadInput(entry.input))) {
2415
- const currentValue = islandHead[key];
2416
- if (Array.isArray(currentValue)) {
2417
- currentValue.push(...value);
2418
- }
2419
- islandHead[key] = value;
2420
- }
2421
- }
2422
- islandHead.link ||= [];
2423
- islandHead.style ||= [];
2424
- const islandResponse = {
2425
- id: islandContext.id,
2426
- head: islandHead,
2427
- html: getServerComponentHTML(renderResult.html),
2428
- components: getClientIslandResponse(ssrContext),
2429
- slots: getSlotIslandResponse(ssrContext)
2430
- };
2431
- await nitroApp.hooks.callHook("render:island", islandResponse, { event, islandContext });
2432
- return islandResponse;
2433
- });
2434
- async function getIslandContext(event) {
2435
- let url = event.path || "";
2436
- const componentParts = url.substring("/__nuxt_island".length + 1).replace(ISLAND_SUFFIX_RE, "").split("_");
2437
- const hashId = componentParts.length > 1 ? componentParts.pop() : void 0;
2438
- const componentName = componentParts.join("_");
2439
- const context = event.method === "GET" ? getQuery$1(event) : await readBody(event);
2440
- const ctx = {
2441
- url: "/",
2442
- ...context,
2443
- id: hashId,
2444
- name: componentName,
2445
- props: destr$1(context.props) || {},
2446
- slots: {},
2447
- components: {}
2448
- };
2449
- return ctx;
2450
- }
2451
-
2452
- const _uQBwCY = lazyEventHandler(() => {
2453
- const opts = useRuntimeConfig().ipx || {};
2454
- const fsDir = opts?.fs?.dir ? (Array.isArray(opts.fs.dir) ? opts.fs.dir : [opts.fs.dir]).map((dir) => isAbsolute(dir) ? dir : fileURLToPath(new URL(dir, globalThis._importMeta_.url))) : void 0;
2455
- const fsStorage = opts.fs?.dir ? ipxFSStorage({ ...opts.fs, dir: fsDir }) : void 0;
2456
- const httpStorage = opts.http?.domains ? ipxHttpStorage({ ...opts.http }) : void 0;
2457
- if (!fsStorage && !httpStorage) {
2458
- throw new Error("IPX storage is not configured!");
2459
- }
2460
- const ipxOptions = {
2461
- ...opts,
2462
- storage: fsStorage || httpStorage,
2463
- httpStorage
2464
- };
2465
- const ipx = createIPX(ipxOptions);
2466
- const ipxHandler = createIPXH3Handler(ipx);
2467
- return useBase(opts.baseURL, ipxHandler);
2468
- });
2469
-
2470
- const _lazy_u5Dhoc = () => Promise.resolve().then(function () { return neonTest$1; });
2471
- const _lazy_ac_2XW = () => Promise.resolve().then(function () { return renderer$1; });
2472
-
2473
- const handlers = [
2474
- { route: '/api/neonTest', handler: _lazy_u5Dhoc, lazy: true, middleware: false, method: undefined },
2475
- { route: '/__nuxt_error', handler: _lazy_ac_2XW, lazy: true, middleware: false, method: undefined },
2476
- { route: '', handler: _nGzU2E, lazy: false, middleware: false, method: undefined },
2477
- { route: '', handler: _DBwtAP, lazy: false, middleware: false, method: undefined },
2478
- { route: '', handler: _a3BfBQ, lazy: false, middleware: false, method: undefined },
2479
- { route: '', handler: _4fQwYD, lazy: false, middleware: false, method: undefined },
2480
- { route: '', handler: _DJziEh, lazy: false, middleware: false, method: undefined },
2481
- { route: '/__nuxt_island/**', handler: _SxA8c9, lazy: false, middleware: false, method: undefined },
2482
- { route: '/_ipx/**', handler: _uQBwCY, lazy: false, middleware: false, method: undefined },
2483
- { route: '/_fonts/**', handler: _lazy_ac_2XW, lazy: true, middleware: false, method: undefined },
2484
- { route: '/_scripts/**', handler: _lazy_ac_2XW, lazy: true, middleware: false, method: undefined },
2485
- { route: '/**', handler: _lazy_ac_2XW, lazy: true, middleware: false, method: undefined }
2486
- ];
2487
-
2488
- function createNitroApp() {
2489
- const config = useRuntimeConfig();
2490
- const hooks = createHooks();
2491
- const captureError = (error, context = {}) => {
2492
- const promise = hooks.callHookParallel("error", error, context).catch((error_) => {
2493
- console.error("Error while capturing another error", error_);
2494
- });
2495
- if (context.event && isEvent(context.event)) {
2496
- const errors = context.event.context.nitro?.errors;
2497
- if (errors) {
2498
- errors.push({ error, context });
2499
- }
2500
- if (context.event.waitUntil) {
2501
- context.event.waitUntil(promise);
2502
- }
2503
- }
2504
- };
2505
- const h3App = createApp({
2506
- debug: destr(true),
2507
- onError: (error, event) => {
2508
- captureError(error, { event, tags: ["request"] });
2509
- return errorHandler(error, event);
2510
- },
2511
- onRequest: async (event) => {
2512
- event.context.nitro = event.context.nitro || { errors: [] };
2513
- const fetchContext = event.node.req?.__unenv__;
2514
- if (fetchContext?._platform) {
2515
- event.context = {
2516
- _platform: fetchContext?._platform,
2517
- // #3335
2518
- ...fetchContext._platform,
2519
- ...event.context
2520
- };
2521
- }
2522
- if (!event.context.waitUntil && fetchContext?.waitUntil) {
2523
- event.context.waitUntil = fetchContext.waitUntil;
2524
- }
2525
- event.fetch = (req, init) => fetchWithEvent(event, req, init, { fetch: localFetch });
2526
- event.$fetch = (req, init) => fetchWithEvent(event, req, init, {
2527
- fetch: $fetch
2528
- });
2529
- event.waitUntil = (promise) => {
2530
- if (!event.context.nitro._waitUntilPromises) {
2531
- event.context.nitro._waitUntilPromises = [];
2532
- }
2533
- event.context.nitro._waitUntilPromises.push(promise);
2534
- if (event.context.waitUntil) {
2535
- event.context.waitUntil(promise);
2536
- }
2537
- };
2538
- event.captureError = (error, context) => {
2539
- captureError(error, { event, ...context });
2540
- };
2541
- await nitroApp$1.hooks.callHook("request", event).catch((error) => {
2542
- captureError(error, { event, tags: ["request"] });
2543
- });
2544
- },
2545
- onBeforeResponse: async (event, response) => {
2546
- await nitroApp$1.hooks.callHook("beforeResponse", event, response).catch((error) => {
2547
- captureError(error, { event, tags: ["request", "response"] });
2548
- });
2549
- },
2550
- onAfterResponse: async (event, response) => {
2551
- await nitroApp$1.hooks.callHook("afterResponse", event, response).catch((error) => {
2552
- captureError(error, { event, tags: ["request", "response"] });
2553
- });
2554
- }
2555
- });
2556
- const router = createRouter$1({
2557
- preemptive: true
2558
- });
2559
- const nodeHandler = toNodeListener(h3App);
2560
- const localCall = (aRequest) => callNodeRequestHandler(nodeHandler, aRequest);
2561
- const localFetch = (input, init) => {
2562
- if (!input.toString().startsWith("/")) {
2563
- return globalThis.fetch(input, init);
2564
- }
2565
- return fetchNodeRequestHandler(
2566
- nodeHandler,
2567
- input,
2568
- init
2569
- ).then((response) => normalizeFetchResponse(response));
2570
- };
2571
- const $fetch = createFetch({
2572
- fetch: localFetch,
2573
- Headers: Headers$1,
2574
- defaults: { baseURL: config.app.baseURL }
2575
- });
2576
- globalThis.$fetch = $fetch;
2577
- h3App.use(createRouteRulesHandler({ localFetch }));
2578
- for (const h of handlers) {
2579
- let handler = h.lazy ? lazyEventHandler(h.handler) : h.handler;
2580
- if (h.middleware || !h.route) {
2581
- const middlewareBase = (config.app.baseURL + (h.route || "/")).replace(
2582
- /\/+/g,
2583
- "/"
2584
- );
2585
- h3App.use(middlewareBase, handler);
2586
- } else {
2587
- const routeRules = getRouteRulesForPath(
2588
- h.route.replace(/:\w+|\*\*/g, "_")
2589
- );
2590
- if (routeRules.cache) {
2591
- handler = cachedEventHandler(handler, {
2592
- group: "nitro/routes",
2593
- ...routeRules.cache
2594
- });
2595
- }
2596
- router.use(h.route, handler, h.method);
2597
- }
2598
- }
2599
- h3App.use(config.app.baseURL, router.handler);
2600
- const app = {
2601
- hooks,
2602
- h3App,
2603
- router,
2604
- localCall,
2605
- localFetch,
2606
- captureError
2607
- };
2608
- return app;
2609
- }
2610
- function runNitroPlugins(nitroApp2) {
2611
- for (const plugin of plugins) {
2612
- try {
2613
- plugin(nitroApp2);
2614
- } catch (error) {
2615
- nitroApp2.captureError(error, { tags: ["plugin"] });
2616
- throw error;
2617
- }
2618
- }
2619
- }
2620
- const nitroApp$1 = createNitroApp();
2621
- function useNitroApp() {
2622
- return nitroApp$1;
2623
- }
2624
- runNitroPlugins(nitroApp$1);
2625
-
2626
- if (!globalThis.crypto) {
2627
- globalThis.crypto = nodeCrypto;
2628
- }
2629
- const { NITRO_NO_UNIX_SOCKET, NITRO_DEV_WORKER_ID } = process.env;
2630
- trapUnhandledNodeErrors();
2631
- parentPort?.on("message", (msg) => {
2632
- if (msg && msg.event === "shutdown") {
2633
- shutdown();
2634
- }
2635
- });
2636
- const nitroApp = useNitroApp();
2637
- const server = new Server(toNodeListener(nitroApp.h3App));
2638
- let listener;
2639
- listen().catch(() => listen(
2640
- true
2641
- /* use random port */
2642
- )).catch((error) => {
2643
- console.error("Dev worker failed to listen:", error);
2644
- return shutdown();
2645
- });
2646
- nitroApp.router.get(
2647
- "/_nitro/tasks",
2648
- defineEventHandler(async (event) => {
2649
- const _tasks = await Promise.all(
2650
- Object.entries(tasks).map(async ([name, task]) => {
2651
- const _task = await task.resolve?.();
2652
- return [name, { description: _task?.meta?.description }];
2653
- })
2654
- );
2655
- return {
2656
- tasks: Object.fromEntries(_tasks),
2657
- scheduledTasks
2658
- };
2659
- })
2660
- );
2661
- nitroApp.router.use(
2662
- "/_nitro/tasks/:name",
2663
- defineEventHandler(async (event) => {
2664
- const name = getRouterParam(event, "name");
2665
- const payload = {
2666
- ...getQuery$1(event),
2667
- ...await readBody(event).then((r) => r?.payload).catch(() => ({}))
2668
- };
2669
- return await runTask(name, { payload });
2670
- })
2671
- );
2672
- function listen(useRandomPort = Boolean(
2673
- NITRO_NO_UNIX_SOCKET || process.versions.webcontainer || "Bun" in globalThis && process.platform === "win32"
2674
- )) {
2675
- return new Promise((resolve, reject) => {
2676
- try {
2677
- listener = server.listen(useRandomPort ? 0 : getSocketAddress(), () => {
2678
- const address = server.address();
2679
- parentPort?.postMessage({
2680
- event: "listen",
2681
- address: typeof address === "string" ? { socketPath: address } : { host: "localhost", port: address?.port }
2682
- });
2683
- resolve();
2684
- });
2685
- } catch (error) {
2686
- reject(error);
2687
- }
2688
- });
2689
- }
2690
- function getSocketAddress() {
2691
- const socketName = `nitro-worker-${process.pid}-${threadId}-${NITRO_DEV_WORKER_ID}-${Math.round(Math.random() * 1e4)}.sock`;
2692
- if (process.platform === "win32") {
2693
- return join(String.raw`\\.\pipe`, socketName);
2694
- }
2695
- if (process.platform === "linux") {
2696
- const nodeMajor = Number.parseInt(process.versions.node.split(".")[0], 10);
2697
- if (nodeMajor >= 20) {
2698
- return `\0${socketName}`;
2699
- }
2700
- }
2701
- return join(tmpdir(), socketName);
2702
- }
2703
- async function shutdown() {
2704
- server.closeAllConnections?.();
2705
- await Promise.all([
2706
- new Promise((resolve) => listener?.close(resolve)),
2707
- nitroApp.hooks.callHook("close").catch(console.error)
2708
- ]);
2709
- parentPort?.postMessage({ event: "exit" });
2710
- }
2711
-
2712
- const _messages = { "appName": "Nuxt", "version": "", "statusCode": 500, "statusMessage": "Server error", "description": "An error occurred in the application and the page could not be served. If you are the application owner, check your server logs for details.", "stack": "" };
2713
- const template$1 = (messages) => {
2714
- messages = { ..._messages, ...messages };
2715
- return '<!DOCTYPE html><html lang="en"><head><title>' + escapeHtml(messages.statusCode) + " - " + escapeHtml(messages.statusMessage || "Internal Server Error") + `</title><meta charset="utf-8"><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0" name="viewport"><style>.spotlight{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);bottom:-40vh;filter:blur(30vh);height:60vh;opacity:.8}*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.pointer-events-none{pointer-events:none}.fixed{position:fixed}.left-0{left:0}.right-0{right:0}.z-10{z-index:10}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.h-auto{height:auto}.min-h-screen{min-height:100vh}.flex{display:flex}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.overflow-y-auto{overflow-y:auto}.rounded-t-md{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.bg-black\\/5{background-color:#0000000d}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.p-8{padding:2rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.pt-14{padding-top:3.5rem}.text-6xl{font-size:3.75rem;line-height:1}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-black{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light{font-weight:300}.font-medium{font-weight:500}.leading-tight{line-height:1.25}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\\:bg-black{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\\:bg-white\\/10{background-color:#ffffff1a}.dark\\:text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\\:text-8xl{font-size:6rem;line-height:1}}</style><script>!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();<\/script></head><body class="antialiased bg-white dark:bg-black dark:text-white flex flex-col font-sans min-h-screen pt-14 px-10 text-black"><div class="fixed left-0 pointer-events-none right-0 spotlight"></div><h1 class="font-medium mb-6 sm:text-8xl text-6xl">` + escapeHtml(messages.statusCode) + '</h1><p class="font-light leading-tight mb-8 sm:text-2xl text-xl">' + escapeHtml(messages.description) + '</p><div class="bg-black/5 bg-white dark:bg-white/10 flex-1 h-auto overflow-y-auto rounded-t-md"><div class="font-light leading-tight p-8 text-xl z-10">' + escapeHtml(messages.stack) + "</div></div></body></html>";
2716
- };
2717
-
2718
- const errorDev = /*#__PURE__*/Object.freeze({
2719
- __proto__: null,
2720
- template: template$1
2721
- });
2722
-
2723
- const template = "";
2724
-
2725
- const _virtual__spaTemplate = /*#__PURE__*/Object.freeze({
2726
- __proto__: null,
2727
- template: template
2728
- });
2729
-
2730
- const styles = {};
2731
-
2732
- const styles$1 = /*#__PURE__*/Object.freeze({
2733
- __proto__: null,
2734
- default: styles
2735
- });
2736
-
2737
- const neonTest = defineEventHandler(async () => {
2738
- const config = useRuntimeConfig().public.ignis;
2739
- if (config.preset.db === "neon" || config.neon === true) {
2740
- return await select(
2741
- getNeonClient(),
2742
- ["name", "value"],
2743
- "playing_with_neon",
2744
- [{ column: "name", condition: "LIKE", value: "'test%'" }],
2745
- "name DESC",
2746
- 2
2747
- );
2748
- } else {
2749
- return "Neon DB module not enabled";
2750
- }
2751
- });
2752
-
2753
- const neonTest$1 = /*#__PURE__*/Object.freeze({
2754
- __proto__: null,
2755
- default: neonTest
2756
- });
2757
-
2758
- function renderPayloadResponse(ssrContext) {
2759
- return {
2760
- body: stringify(splitPayload(ssrContext).payload, ssrContext._payloadReducers) ,
2761
- statusCode: getResponseStatus(ssrContext.event),
2762
- statusMessage: getResponseStatusText(ssrContext.event),
2763
- headers: {
2764
- "content-type": "application/json;charset=utf-8" ,
2765
- "x-powered-by": "Nuxt"
2766
- }
2767
- };
2768
- }
2769
- function renderPayloadJsonScript(opts) {
2770
- const contents = opts.data ? stringify(opts.data, opts.ssrContext._payloadReducers) : "";
2771
- const payload = {
2772
- "type": "application/json",
2773
- "innerHTML": contents,
2774
- "data-nuxt-data": appId,
2775
- "data-ssr": !(opts.ssrContext.noSSR)
2776
- };
2777
- {
2778
- payload.id = "__NUXT_DATA__";
2779
- }
2780
- if (opts.src) {
2781
- payload["data-src"] = opts.src;
2782
- }
2783
- const config = uneval(opts.ssrContext.config);
2784
- return [
2785
- payload,
2786
- {
2787
- innerHTML: `window.__NUXT__={};window.__NUXT__.config=${config}`
2788
- }
2789
- ];
2790
- }
2791
- function splitPayload(ssrContext) {
2792
- const { data, prerenderedAt, ...initial } = ssrContext.payload;
2793
- return {
2794
- initial: { ...initial, prerenderedAt },
2795
- payload: { data, prerenderedAt }
2796
- };
2797
- }
2798
-
2799
- const renderSSRHeadOptions = {"omitLineBreaks":false};
2800
-
2801
- globalThis.__buildAssetsURL = buildAssetsURL;
2802
- globalThis.__publicAssetsURL = publicAssetsURL;
2803
- const HAS_APP_TELEPORTS = !!(appTeleportAttrs.id);
2804
- const APP_TELEPORT_OPEN_TAG = HAS_APP_TELEPORTS ? `<${appTeleportTag}${propsToString(appTeleportAttrs)}>` : "";
2805
- const APP_TELEPORT_CLOSE_TAG = HAS_APP_TELEPORTS ? `</${appTeleportTag}>` : "";
2806
- const PAYLOAD_URL_RE = /^[^?]*\/_payload.json(?:\?.*)?$/ ;
2807
- const renderer = defineRenderHandler(async (event) => {
2808
- const nitroApp = useNitroApp();
2809
- const ssrError = event.path.startsWith("/__nuxt_error") ? getQuery$1(event) : null;
2810
- if (ssrError && !("__unenv__" in event.node.req)) {
2811
- throw createError({
2812
- statusCode: 404,
2813
- statusMessage: "Page Not Found: /__nuxt_error"
2814
- });
2815
- }
2816
- const ssrContext = createSSRContext(event);
2817
- const headEntryOptions = { mode: "server" };
2818
- ssrContext.head.push(appHead, headEntryOptions);
2819
- if (ssrError) {
2820
- ssrError.statusCode &&= Number.parseInt(ssrError.statusCode);
2821
- setSSRError(ssrContext, ssrError);
2822
- }
2823
- const isRenderingPayload = PAYLOAD_URL_RE.test(ssrContext.url);
2824
- if (isRenderingPayload) {
2825
- const url = ssrContext.url.substring(0, ssrContext.url.lastIndexOf("/")) || "/";
2826
- ssrContext.url = url;
2827
- event._path = event.node.req.url = url;
2828
- }
2829
- const routeOptions = getRouteRules(event);
2830
- if (routeOptions.ssr === false) {
2831
- ssrContext.noSSR = true;
2832
- }
2833
- const renderer = await getRenderer(ssrContext);
2834
- const _rendered = await renderer.renderToString(ssrContext).catch(async (error) => {
2835
- if (ssrContext._renderResponse && error.message === "skipping render") {
2836
- return {};
2837
- }
2838
- const _err = !ssrError && ssrContext.payload?.error || error;
2839
- await ssrContext.nuxt?.hooks.callHook("app:error", _err);
2840
- throw _err;
2841
- });
2842
- const inlinedStyles = [];
2843
- await ssrContext.nuxt?.hooks.callHook("app:rendered", { ssrContext, renderResult: _rendered });
2844
- if (ssrContext._renderResponse) {
2845
- return ssrContext._renderResponse;
2846
- }
2847
- if (ssrContext.payload?.error && !ssrError) {
2848
- throw ssrContext.payload.error;
2849
- }
2850
- if (isRenderingPayload) {
2851
- const response = renderPayloadResponse(ssrContext);
2852
- return response;
2853
- }
2854
- const NO_SCRIPTS = routeOptions.noScripts;
2855
- const { styles, scripts } = getRequestDependencies(ssrContext, renderer.rendererContext);
2856
- if (ssrContext._preloadManifest && !NO_SCRIPTS) {
2857
- ssrContext.head.push({
2858
- link: [
2859
- { rel: "preload", as: "fetch", fetchpriority: "low", crossorigin: "anonymous", href: buildAssetsURL(`builds/meta/${ssrContext.runtimeConfig.app.buildId}.json`) }
2860
- ]
2861
- }, { ...headEntryOptions, tagPriority: "low" });
2862
- }
2863
- if (inlinedStyles.length) {
2864
- ssrContext.head.push({ style: inlinedStyles });
2865
- }
2866
- const link = [];
2867
- for (const resource of Object.values(styles)) {
2868
- if ("inline" in getQuery(resource.file)) {
2869
- continue;
2870
- }
2871
- link.push({ rel: "stylesheet", href: renderer.rendererContext.buildAssetsURL(resource.file), crossorigin: "" });
2872
- }
2873
- if (link.length) {
2874
- ssrContext.head.push({ link }, headEntryOptions);
2875
- }
2876
- if (!NO_SCRIPTS) {
2877
- ssrContext.head.push({
2878
- link: getPreloadLinks(ssrContext, renderer.rendererContext)
2879
- }, headEntryOptions);
2880
- ssrContext.head.push({
2881
- link: getPrefetchLinks(ssrContext, renderer.rendererContext)
2882
- }, headEntryOptions);
2883
- ssrContext.head.push({
2884
- script: renderPayloadJsonScript({ ssrContext, data: ssrContext.payload })
2885
- }, {
2886
- ...headEntryOptions,
2887
- // this should come before another end of body scripts
2888
- tagPosition: "bodyClose",
2889
- tagPriority: "high"
2890
- });
2891
- }
2892
- if (!routeOptions.noScripts) {
2893
- ssrContext.head.push({
2894
- script: Object.values(scripts).map((resource) => ({
2895
- type: resource.module ? "module" : null,
2896
- src: renderer.rendererContext.buildAssetsURL(resource.file),
2897
- defer: resource.module ? null : true,
2898
- // if we are rendering script tag payloads that import an async payload
2899
- // we need to ensure this resolves before executing the Nuxt entry
2900
- tagPosition: "head",
2901
- crossorigin: ""
2902
- }))
2903
- }, headEntryOptions);
2904
- }
2905
- const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(ssrContext.head, renderSSRHeadOptions);
2906
- const htmlContext = {
2907
- htmlAttrs: htmlAttrs ? [htmlAttrs] : [],
2908
- head: normalizeChunks([headTags]),
2909
- bodyAttrs: bodyAttrs ? [bodyAttrs] : [],
2910
- bodyPrepend: normalizeChunks([bodyTagsOpen, ssrContext.teleports?.body]),
2911
- body: [
2912
- replaceIslandTeleports(ssrContext, _rendered.html) ,
2913
- APP_TELEPORT_OPEN_TAG + (HAS_APP_TELEPORTS ? joinTags([ssrContext.teleports?.[`#${appTeleportAttrs.id}`]]) : "") + APP_TELEPORT_CLOSE_TAG
2914
- ],
2915
- bodyAppend: [bodyTags]
2916
- };
2917
- await nitroApp.hooks.callHook("render:html", htmlContext, { event });
2918
- return {
2919
- body: renderHTMLDocument(htmlContext),
2920
- statusCode: getResponseStatus(event),
2921
- statusMessage: getResponseStatusText(event),
2922
- headers: {
2923
- "content-type": "text/html;charset=utf-8",
2924
- "x-powered-by": "Nuxt"
2925
- }
2926
- };
2927
- });
2928
- function normalizeChunks(chunks) {
2929
- return chunks.filter(Boolean).map((i) => i.trim());
2930
- }
2931
- function joinTags(tags) {
2932
- return tags.join("");
2933
- }
2934
- function joinAttrs(chunks) {
2935
- if (chunks.length === 0) {
2936
- return "";
2937
- }
2938
- return " " + chunks.join(" ");
2939
- }
2940
- function renderHTMLDocument(html) {
2941
- return `<!DOCTYPE html><html${joinAttrs(html.htmlAttrs)}><head>${joinTags(html.head)}</head><body${joinAttrs(html.bodyAttrs)}>${joinTags(html.bodyPrepend)}${joinTags(html.body)}${joinTags(html.bodyAppend)}</body></html>`;
2942
- }
2943
-
2944
- const renderer$1 = /*#__PURE__*/Object.freeze({
2945
- __proto__: null,
2946
- default: renderer
2947
- });
2948
- //# sourceMappingURL=index.mjs.map