feat: init
This commit is contained in:
19
.output/server/chunks/_/error-500.mjs
Normal file
19
.output/server/chunks/_/error-500.mjs
Normal file
@@ -0,0 +1,19 @@
|
||||
import { escapeHtml } from '@vue/shared';
|
||||
|
||||
const _messages = {
|
||||
"appName": "Nuxt",
|
||||
"status": 500,
|
||||
"statusText": "Internal server error",
|
||||
"description": "This page is temporarily unavailable.",
|
||||
"refresh": "Refresh this page"
|
||||
};
|
||||
const template = (messages) => {
|
||||
messages = {
|
||||
..._messages,
|
||||
...messages
|
||||
};
|
||||
return "<!DOCTYPE html><html lang=\"en\"><head><title>" + escapeHtml(messages.status) + " - " + escapeHtml(messages.statusText) + " | " + escapeHtml(messages.appName) + "</title><meta charset=\"utf-8\"><meta content=\"width=device-width,initial-scale=1.0,minimum-scale=1.0\" name=\"viewport\"><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><style>*,: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,h2{font-size:inherit;font-weight:inherit}h1,h2,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: }.grid{display:grid}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.place-content-center{place-content:center}.overflow-hidden{overflow:hidden}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-\\[80px\\]{font-size:80px}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[\\#020420\\]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\\[\\#64748B\\]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-wide{letter-spacing:.025em}.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}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\\:bg-\\[\\#020420\\]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\\:text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\\:text-\\[110px\\]{font-size:110px}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}}</style></head><body class=\"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide\"><div class=\"max-w-520px text-center\"><h1 class=\"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]\">" + escapeHtml(messages.status) + "</h1><h2 class=\"font-semibold mb-2 sm:text-3xl text-2xl\">" + escapeHtml(messages.statusText) + "</h2><p class=\"mb-4 px-2 text-[#64748B] text-md\">" + escapeHtml(messages.description) + "</p></div></body></html>";
|
||||
};
|
||||
|
||||
export { template };
|
||||
//# sourceMappingURL=error-500.mjs.map
|
||||
1
.output/server/chunks/_/error-500.mjs.map
Normal file
1
.output/server/chunks/_/error-500.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"error-500.mjs","sources":["../../../../node_modules/@nuxt/nitro-server/dist/runtime/templates/error-500.mjs"],"names":[],"mappings":"","x_google_ignoreList":[0]}
|
||||
84
.output/server/chunks/_/vatRates.mjs
Normal file
84
.output/server/chunks/_/vatRates.mjs
Normal file
@@ -0,0 +1,84 @@
|
||||
import { u as useRuntimeConfig } from '../nitro/nitro.mjs';
|
||||
|
||||
const FALLBACK_RATES = [
|
||||
{ country: "Austria", country_code: "AT", standard_rate: 20, reduced_rates: [10, 13], currency: "EUR" },
|
||||
{ country: "Belgium", country_code: "BE", standard_rate: 21, reduced_rates: [6, 12], currency: "EUR" },
|
||||
{ country: "Bulgaria", country_code: "BG", standard_rate: 20, reduced_rates: [9], currency: "EUR" },
|
||||
{ country: "Croatia", country_code: "HR", standard_rate: 25, reduced_rates: [5, 13], currency: "EUR" },
|
||||
{ country: "Cyprus", country_code: "CY", standard_rate: 19, reduced_rates: [5, 9], currency: "EUR" },
|
||||
{ country: "Czech Republic", country_code: "CZ", standard_rate: 21, reduced_rates: [12, 15], currency: "EUR" },
|
||||
{ country: "Denmark", country_code: "DK", standard_rate: 25, reduced_rates: [], currency: "EUR" },
|
||||
{ country: "Estonia", country_code: "EE", standard_rate: 22, reduced_rates: [9], currency: "EUR" },
|
||||
{ country: "Finland", country_code: "FI", standard_rate: 25.5, reduced_rates: [10, 14], currency: "EUR" },
|
||||
{ country: "France", country_code: "FR", standard_rate: 20, reduced_rates: [5.5, 10], currency: "EUR" },
|
||||
{ country: "Germany", country_code: "DE", standard_rate: 19, reduced_rates: [7], currency: "EUR" },
|
||||
{ country: "Greece", country_code: "GR", standard_rate: 24, reduced_rates: [6, 13], currency: "EUR" },
|
||||
{ country: "Hungary", country_code: "HU", standard_rate: 27, reduced_rates: [5, 18], currency: "EUR" },
|
||||
{ country: "Ireland", country_code: "IE", standard_rate: 23, reduced_rates: [9, 13.5], currency: "EUR" },
|
||||
{ country: "Italy", country_code: "IT", standard_rate: 22, reduced_rates: [5, 10], currency: "EUR" },
|
||||
{ country: "Latvia", country_code: "LV", standard_rate: 21, reduced_rates: [5, 12], currency: "EUR" },
|
||||
{ country: "Lithuania", country_code: "LT", standard_rate: 21, reduced_rates: [5, 9], currency: "EUR" },
|
||||
{ country: "Luxembourg", country_code: "LU", standard_rate: 17, reduced_rates: [8], currency: "EUR" },
|
||||
{ country: "Malta", country_code: "MT", standard_rate: 18, reduced_rates: [5, 7], currency: "EUR" },
|
||||
{ country: "Netherlands", country_code: "NL", standard_rate: 21, reduced_rates: [9], currency: "EUR" },
|
||||
{ country: "Poland", country_code: "PL", standard_rate: 23, reduced_rates: [5, 8], currency: "EUR" },
|
||||
{ country: "Portugal", country_code: "PT", standard_rate: 23, reduced_rates: [6, 13], currency: "EUR" },
|
||||
{ country: "Romania", country_code: "RO", standard_rate: 19, reduced_rates: [5, 9], currency: "EUR" },
|
||||
{ country: "Slovakia", country_code: "SK", standard_rate: 23, reduced_rates: [5, 10], currency: "EUR" },
|
||||
{ country: "Slovenia", country_code: "SI", standard_rate: 22, reduced_rates: [5, 9.5], currency: "EUR" },
|
||||
{ country: "Spain", country_code: "ES", standard_rate: 21, reduced_rates: [4, 10], currency: "EUR" },
|
||||
{ country: "Sweden", country_code: "SE", standard_rate: 25, reduced_rates: [6, 12], currency: "EUR" }
|
||||
];
|
||||
const TWENTY_FOUR_HOURS = 24 * 60 * 60 * 1e3;
|
||||
let cache = null;
|
||||
function todayDateString() {
|
||||
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
||||
}
|
||||
function isCacheValid() {
|
||||
if (!cache) return false;
|
||||
const age = Date.now() - cache.fetchedAt;
|
||||
return age < TWENTY_FOUR_HOURS && cache.date === todayDateString();
|
||||
}
|
||||
function transformVatstackResponse(vatstackRates) {
|
||||
return vatstackRates.map((r) => {
|
||||
var _a, _b, _c, _d;
|
||||
return {
|
||||
country: (_a = r.country_name) != null ? _a : "",
|
||||
country_code: (_b = r.country_code) != null ? _b : "",
|
||||
standard_rate: (_c = r.standard_rate) != null ? _c : 0,
|
||||
reduced_rates: (_d = r.reduced_rates) != null ? _d : [],
|
||||
currency: "EUR"
|
||||
};
|
||||
});
|
||||
}
|
||||
async function getAllRates() {
|
||||
var _a;
|
||||
if (isCacheValid()) return cache.data;
|
||||
const config = useRuntimeConfig();
|
||||
const apiKey = config.vatstackApiKey;
|
||||
if (!apiKey) {
|
||||
cache = { data: FALLBACK_RATES, date: todayDateString(), fetchedAt: Date.now() };
|
||||
return FALLBACK_RATES;
|
||||
}
|
||||
try {
|
||||
const response = await $fetch("https://api.vatstack.com/v1/rates", {
|
||||
headers: { "X-API-Key": apiKey },
|
||||
query: { member_state: true, limit: 100 }
|
||||
});
|
||||
const items = (_a = response.rates) != null ? _a : response;
|
||||
const euOnly = items.filter((r) => r.member_state === true);
|
||||
const rates = transformVatstackResponse(euOnly);
|
||||
cache = { data: rates, date: todayDateString(), fetchedAt: Date.now() };
|
||||
return rates;
|
||||
} catch {
|
||||
cache = { data: FALLBACK_RATES, date: todayDateString(), fetchedAt: Date.now() };
|
||||
return FALLBACK_RATES;
|
||||
}
|
||||
}
|
||||
async function getRateByCode(code) {
|
||||
const rates = await getAllRates();
|
||||
return rates.find((r) => r.country_code === code.toUpperCase());
|
||||
}
|
||||
|
||||
export { getAllRates as a, getRateByCode as g };
|
||||
//# sourceMappingURL=vatRates.mjs.map
|
||||
1
.output/server/chunks/_/vatRates.mjs.map
Normal file
1
.output/server/chunks/_/vatRates.mjs.map
Normal file
File diff suppressed because one or more lines are too long
4
.output/server/chunks/build/client.precomputed.mjs
Normal file
4
.output/server/chunks/build/client.precomputed.mjs
Normal file
File diff suppressed because one or more lines are too long
1
.output/server/chunks/build/client.precomputed.mjs.map
Normal file
1
.output/server/chunks/build/client.precomputed.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"client.precomputed.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/client.precomputed.mjs"],"names":[],"mappings":"","x_google_ignoreList":[0]}
|
||||
23
.output/server/chunks/build/composables-Piy9capG.mjs
Normal file
23
.output/server/chunks/build/composables-Piy9capG.mjs
Normal file
@@ -0,0 +1,23 @@
|
||||
import { hasInjectionContext, inject } from 'vue';
|
||||
import { a as useNuxtApp } from './server.mjs';
|
||||
import { u as useHead$1, h as headSymbol } from '../routes/renderer.mjs';
|
||||
|
||||
function injectHead(nuxtApp) {
|
||||
const nuxt = nuxtApp || useNuxtApp();
|
||||
return nuxt.ssrContext?.head || nuxt.runWithContext(() => {
|
||||
if (hasInjectionContext()) {
|
||||
const head = inject(headSymbol);
|
||||
if (!head) {
|
||||
throw new Error("[nuxt] [unhead] Missing Unhead instance.");
|
||||
}
|
||||
return head;
|
||||
}
|
||||
});
|
||||
}
|
||||
function useHead(input, options = {}) {
|
||||
const head = options.head || injectHead(options.nuxt);
|
||||
return useHead$1(input, { head, ...options });
|
||||
}
|
||||
|
||||
export { useHead as u };
|
||||
//# sourceMappingURL=composables-Piy9capG.mjs.map
|
||||
1
.output/server/chunks/build/composables-Piy9capG.mjs.map
Normal file
1
.output/server/chunks/build/composables-Piy9capG.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"composables-Piy9capG.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/composables-Piy9capG.js"],"names":[],"mappings":"","x_google_ignoreList":[0]}
|
||||
375
.output/server/chunks/build/error-404-BY_x-_oz.mjs
Normal file
375
.output/server/chunks/build/error-404-BY_x-_oz.mjs
Normal file
@@ -0,0 +1,375 @@
|
||||
import { mergeProps, withCtx, createTextVNode, toDisplayString, defineComponent, shallowRef, h, resolveComponent, computed, useSSRContext } from 'vue';
|
||||
import { z as parseQuery, o as hasProtocol, k as joinURL, A as withTrailingSlash, B as withoutTrailingSlash } from '../nitro/nitro.mjs';
|
||||
import { _ as _export_sfc, u as useRouter, e as encodeRoutePath, r as resolveRouteObject, n as navigateTo, a as useNuxtApp, b as useRuntimeConfig, c as nuxtLinkDefaults } from './server.mjs';
|
||||
import { ssrRenderAttrs, ssrInterpolate, ssrRenderComponent } from 'vue/server-renderer';
|
||||
import { u as useHead } from './composables-Piy9capG.mjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'node:url';
|
||||
import '../routes/renderer.mjs';
|
||||
import 'vue-bundle-renderer/runtime';
|
||||
import 'unhead/server';
|
||||
import 'devalue';
|
||||
import 'unhead/utils';
|
||||
import 'vue-router';
|
||||
|
||||
const firstNonUndefined = (...args) => args.find((arg) => arg !== void 0);
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function defineNuxtLink(options) {
|
||||
const componentName = options.componentName || "NuxtLink";
|
||||
function isHashLinkWithoutHashMode(link) {
|
||||
return typeof link === "string" && link.startsWith("#");
|
||||
}
|
||||
function resolveTrailingSlashBehavior(to, resolve, trailingSlash) {
|
||||
const effectiveTrailingSlash = trailingSlash ?? options.trailingSlash;
|
||||
if (!to || effectiveTrailingSlash !== "append" && effectiveTrailingSlash !== "remove") {
|
||||
return to;
|
||||
}
|
||||
if (typeof to === "string") {
|
||||
return applyTrailingSlashBehavior(to, effectiveTrailingSlash);
|
||||
}
|
||||
const path = "path" in to && to.path !== void 0 ? to.path : resolve(to).path;
|
||||
const resolvedPath = {
|
||||
...to,
|
||||
name: void 0,
|
||||
// named routes would otherwise always override trailing slash behavior
|
||||
path: applyTrailingSlashBehavior(path, effectiveTrailingSlash)
|
||||
};
|
||||
return resolvedPath;
|
||||
}
|
||||
function useNuxtLink(props) {
|
||||
const router = useRouter();
|
||||
const config = useRuntimeConfig();
|
||||
const hasTarget = computed(() => !!props.target && props.target !== "_self");
|
||||
const isAbsoluteUrl = computed(() => {
|
||||
const path = props.to || props.href || "";
|
||||
return typeof path === "string" && hasProtocol(path, { acceptRelative: true });
|
||||
});
|
||||
const builtinRouterLink = resolveComponent("RouterLink");
|
||||
const useBuiltinLink = builtinRouterLink && typeof builtinRouterLink !== "string" ? builtinRouterLink.useLink : void 0;
|
||||
const isExternal = computed(() => {
|
||||
if (props.external) {
|
||||
return true;
|
||||
}
|
||||
const path = props.to || props.href || "";
|
||||
if (typeof path === "object") {
|
||||
return false;
|
||||
}
|
||||
return path === "" || isAbsoluteUrl.value;
|
||||
});
|
||||
const to = computed(() => {
|
||||
const path = props.to || props.href || "";
|
||||
if (isExternal.value) {
|
||||
return path;
|
||||
}
|
||||
return resolveTrailingSlashBehavior(path, router.resolve, props.trailingSlash);
|
||||
});
|
||||
const link = isExternal.value ? void 0 : useBuiltinLink?.({ ...props, to });
|
||||
const href = computed(() => {
|
||||
const effectiveTrailingSlash = props.trailingSlash ?? options.trailingSlash;
|
||||
if (!to.value || isAbsoluteUrl.value || isHashLinkWithoutHashMode(to.value)) {
|
||||
return to.value;
|
||||
}
|
||||
if (isExternal.value) {
|
||||
const path = typeof to.value === "object" && "path" in to.value ? resolveRouteObject(to.value) : to.value;
|
||||
const href2 = typeof path === "object" ? router.resolve(path).href : path;
|
||||
return applyTrailingSlashBehavior(href2, effectiveTrailingSlash);
|
||||
}
|
||||
if (typeof to.value === "object") {
|
||||
return router.resolve(to.value)?.href ?? null;
|
||||
}
|
||||
return applyTrailingSlashBehavior(joinURL(config.app.baseURL, to.value), effectiveTrailingSlash);
|
||||
});
|
||||
return {
|
||||
to,
|
||||
hasTarget,
|
||||
isAbsoluteUrl,
|
||||
isExternal,
|
||||
//
|
||||
href,
|
||||
isActive: link?.isActive ?? computed(() => to.value === router.currentRoute.value.path),
|
||||
isExactActive: link?.isExactActive ?? computed(() => to.value === router.currentRoute.value.path),
|
||||
route: link?.route ?? computed(() => router.resolve(to.value)),
|
||||
async navigate(_e) {
|
||||
await navigateTo(href.value, { replace: props.replace, external: isExternal.value || hasTarget.value });
|
||||
}
|
||||
};
|
||||
}
|
||||
return defineComponent({
|
||||
name: componentName,
|
||||
props: {
|
||||
// Routing
|
||||
to: {
|
||||
type: [String, Object],
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
href: {
|
||||
type: [String, Object],
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
// Attributes
|
||||
target: {
|
||||
type: String,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
rel: {
|
||||
type: String,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
noRel: {
|
||||
type: Boolean,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
// Prefetching
|
||||
prefetch: {
|
||||
type: Boolean,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
prefetchOn: {
|
||||
type: [String, Object],
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
noPrefetch: {
|
||||
type: Boolean,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
// Styling
|
||||
activeClass: {
|
||||
type: String,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
exactActiveClass: {
|
||||
type: String,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
prefetchedClass: {
|
||||
type: String,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
// Vue Router's `<RouterLink>` additional props
|
||||
replace: {
|
||||
type: Boolean,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
ariaCurrentValue: {
|
||||
type: String,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
// Edge cases handling
|
||||
external: {
|
||||
type: Boolean,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
// Slot API
|
||||
custom: {
|
||||
type: Boolean,
|
||||
default: void 0,
|
||||
required: false
|
||||
},
|
||||
// Behavior
|
||||
trailingSlash: {
|
||||
type: String,
|
||||
default: void 0,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
useLink: useNuxtLink,
|
||||
setup(props, { slots }) {
|
||||
const router = useRouter();
|
||||
const { to, href, navigate, isExternal, hasTarget, isAbsoluteUrl } = useNuxtLink(props);
|
||||
shallowRef(false);
|
||||
const el = void 0;
|
||||
const elRef = void 0;
|
||||
async function prefetch(nuxtApp = useNuxtApp()) {
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
return () => {
|
||||
if (!isExternal.value && !hasTarget.value && !isHashLinkWithoutHashMode(to.value)) {
|
||||
const routerLinkProps = {
|
||||
ref: elRef,
|
||||
to: to.value,
|
||||
activeClass: props.activeClass || options.activeClass,
|
||||
exactActiveClass: props.exactActiveClass || options.exactActiveClass,
|
||||
replace: props.replace,
|
||||
ariaCurrentValue: props.ariaCurrentValue,
|
||||
custom: props.custom
|
||||
};
|
||||
if (!props.custom) {
|
||||
routerLinkProps.rel = props.rel || void 0;
|
||||
}
|
||||
return h(
|
||||
resolveComponent("RouterLink"),
|
||||
routerLinkProps,
|
||||
slots.default
|
||||
);
|
||||
}
|
||||
const target = props.target || null;
|
||||
const rel = firstNonUndefined(
|
||||
// converts `""` to `null` to prevent the attribute from being added as empty (`rel=""`)
|
||||
props.noRel ? "" : props.rel,
|
||||
options.externalRelAttribute,
|
||||
/*
|
||||
* A fallback rel of `noopener noreferrer` is applied for external links or links that open in a new tab.
|
||||
* This solves a reverse tabnapping security flaw in browsers pre-2021 as well as improving privacy.
|
||||
*/
|
||||
isAbsoluteUrl.value || hasTarget.value ? "noopener noreferrer" : ""
|
||||
) || null;
|
||||
if (props.custom) {
|
||||
if (!slots.default) {
|
||||
return null;
|
||||
}
|
||||
return slots.default({
|
||||
href: href.value,
|
||||
navigate,
|
||||
prefetch,
|
||||
get route() {
|
||||
if (!href.value) {
|
||||
return void 0;
|
||||
}
|
||||
const url = new URL(href.value, "http://localhost");
|
||||
return {
|
||||
path: url.pathname,
|
||||
fullPath: url.pathname,
|
||||
get query() {
|
||||
return parseQuery(url.search);
|
||||
},
|
||||
hash: url.hash,
|
||||
params: {},
|
||||
name: void 0,
|
||||
matched: [],
|
||||
redirectedFrom: void 0,
|
||||
meta: {},
|
||||
href: href.value
|
||||
};
|
||||
},
|
||||
rel,
|
||||
target,
|
||||
isExternal: isExternal.value || hasTarget.value,
|
||||
isActive: false,
|
||||
isExactActive: false
|
||||
});
|
||||
}
|
||||
return h("a", {
|
||||
ref: el,
|
||||
href: href.value || null,
|
||||
// converts `""` to `null` to prevent the attribute from being added as empty (`href=""`)
|
||||
rel,
|
||||
target,
|
||||
onClick: async (event) => {
|
||||
if (isExternal.value || hasTarget.value) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
try {
|
||||
const encodedHref = encodeRoutePath(href.value);
|
||||
return await (props.replace ? router.replace(encodedHref) : router.push(encodedHref));
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}, slots.default?.());
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
const __nuxt_component_0 = /* @__PURE__ */ defineNuxtLink(nuxtLinkDefaults);
|
||||
function applyTrailingSlashBehavior(to, trailingSlash) {
|
||||
const normalizeFn = trailingSlash === "append" ? withTrailingSlash : withoutTrailingSlash;
|
||||
const hasProtocolDifferentFromHttp = hasProtocol(to) && !to.startsWith("http");
|
||||
if (hasProtocolDifferentFromHttp) {
|
||||
return to;
|
||||
}
|
||||
return normalizeFn(to, true);
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "error-404",
|
||||
__ssrInlineRender: true,
|
||||
props: {
|
||||
appName: {
|
||||
type: String,
|
||||
default: "Nuxt"
|
||||
},
|
||||
status: {
|
||||
type: Number,
|
||||
default: 404
|
||||
},
|
||||
statusText: {
|
||||
type: String,
|
||||
default: "Page not found"
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: "Sorry, the page you are looking for could not be found."
|
||||
},
|
||||
backHome: {
|
||||
type: String,
|
||||
default: "Go back home"
|
||||
}
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
useHead({
|
||||
title: `${props.status} - ${props.statusText} | ${props.appName}`,
|
||||
script: [
|
||||
{
|
||||
innerHTML: `!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)}}();`
|
||||
}
|
||||
],
|
||||
style: [
|
||||
{
|
||||
innerHTML: `*,: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,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,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: }`
|
||||
}
|
||||
]
|
||||
});
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
const _component_NuxtLink = __nuxt_component_0;
|
||||
_push(`<div${ssrRenderAttrs(mergeProps({ class: "antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide" }, _attrs))} data-v-204d37bf><div class="max-w-520px text-center" data-v-204d37bf><h1 class="font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]" data-v-204d37bf>${ssrInterpolate(__props.status)}</h1><h2 class="font-semibold mb-2 sm:text-3xl text-2xl" data-v-204d37bf>${ssrInterpolate(__props.statusText)}</h2><p class="mb-4 px-2 text-[#64748B] text-md" data-v-204d37bf>${ssrInterpolate(__props.description)}</p><div class="flex items-center justify-center w-full" data-v-204d37bf>`);
|
||||
_push(ssrRenderComponent(_component_NuxtLink, {
|
||||
to: "/",
|
||||
class: "font-medium hover:text-[#00DC82] text-sm underline underline-offset-3"
|
||||
}, {
|
||||
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
||||
if (_push2) {
|
||||
_push2(`${ssrInterpolate(__props.backHome)}`);
|
||||
} else {
|
||||
return [
|
||||
createTextVNode(toDisplayString(__props.backHome), 1)
|
||||
];
|
||||
}
|
||||
}),
|
||||
_: 1
|
||||
}, _parent));
|
||||
_push(`</div></div></div>`);
|
||||
};
|
||||
}
|
||||
};
|
||||
const _sfc_setup = _sfc_main.setup;
|
||||
_sfc_main.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/nuxt/dist/app/components/error-404.vue");
|
||||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
||||
};
|
||||
const error404 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-204d37bf"]]);
|
||||
|
||||
export { error404 as default };
|
||||
//# sourceMappingURL=error-404-BY_x-_oz.mjs.map
|
||||
1
.output/server/chunks/build/error-404-BY_x-_oz.mjs.map
Normal file
1
.output/server/chunks/build/error-404-BY_x-_oz.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"error-404-BY_x-_oz.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/error-404-BY_x-_oz.js"],"names":[],"mappings":"","x_google_ignoreList":[0]}
|
||||
@@ -0,0 +1,8 @@
|
||||
const error404_vue_vue_type_style_index_0_scoped_204d37bf_lang = ".grid[data-v-204d37bf]{display:grid}.mb-2[data-v-204d37bf]{margin-bottom:.5rem}.mb-4[data-v-204d37bf]{margin-bottom:1rem}.max-w-520px[data-v-204d37bf]{max-width:520px}.min-h-screen[data-v-204d37bf]{min-height:100vh}.w-full[data-v-204d37bf]{width:100%}.flex[data-v-204d37bf]{display:flex}.place-content-center[data-v-204d37bf]{place-content:center}.items-center[data-v-204d37bf]{align-items:center}.justify-center[data-v-204d37bf]{justify-content:center}.overflow-hidden[data-v-204d37bf]{overflow:hidden}.bg-white[data-v-204d37bf]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-204d37bf]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-204d37bf]{text-align:center}.text-\\[80px\\][data-v-204d37bf]{font-size:80px}.text-2xl[data-v-204d37bf]{font-size:1.5rem;line-height:2rem}.text-sm[data-v-204d37bf]{font-size:.875rem;line-height:1.25rem}.text-\\[\\#020420\\][data-v-204d37bf]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\\[\\#64748B\\][data-v-204d37bf]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.hover\\:text-\\[\\#00DC82\\][data-v-204d37bf]:hover{--un-text-opacity:1;color:rgb(0 220 130/var(--un-text-opacity))}.font-medium[data-v-204d37bf]{font-weight:500}.font-semibold[data-v-204d37bf]{font-weight:600}.leading-none[data-v-204d37bf]{line-height:1}.tracking-wide[data-v-204d37bf]{letter-spacing:.025em}.font-sans[data-v-204d37bf]{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}.tabular-nums[data-v-204d37bf]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.underline[data-v-204d37bf]{text-decoration-line:underline}.underline-offset-3[data-v-204d37bf]{text-underline-offset:3px}.antialiased[data-v-204d37bf]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\\:bg-\\[\\#020420\\][data-v-204d37bf]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\\:text-white[data-v-204d37bf]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\\:text-\\[110px\\][data-v-204d37bf]{font-size:110px}.sm\\:text-3xl[data-v-204d37bf]{font-size:1.875rem;line-height:2.25rem}}";
|
||||
|
||||
const error404Styles_DuDrfV0 = [
|
||||
error404_vue_vue_type_style_index_0_scoped_204d37bf_lang
|
||||
];
|
||||
|
||||
export { error404Styles_DuDrfV0 as default };
|
||||
//# sourceMappingURL=error-404-styles.DuDrf-v0.mjs.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"error-404-styles.DuDrf-v0.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/error-404-styles-1.mjs-Bae73Gon.js","../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/error-404-styles.DuDrf-v0.mjs"],"names":["style_0"],"mappings":"","x_google_ignoreList":[0,1]}
|
||||
75
.output/server/chunks/build/error-500-B0qDQUop.mjs
Normal file
75
.output/server/chunks/build/error-500-B0qDQUop.mjs
Normal file
@@ -0,0 +1,75 @@
|
||||
import { mergeProps, useSSRContext } from 'vue';
|
||||
import { ssrRenderAttrs, ssrInterpolate } from 'vue/server-renderer';
|
||||
import { _ as _export_sfc } from './server.mjs';
|
||||
import { u as useHead } from './composables-Piy9capG.mjs';
|
||||
import '../nitro/nitro.mjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'node:url';
|
||||
import '../routes/renderer.mjs';
|
||||
import 'vue-bundle-renderer/runtime';
|
||||
import 'unhead/server';
|
||||
import 'devalue';
|
||||
import 'unhead/utils';
|
||||
import 'vue-router';
|
||||
|
||||
const _sfc_main = {
|
||||
__name: "error-500",
|
||||
__ssrInlineRender: true,
|
||||
props: {
|
||||
appName: {
|
||||
type: String,
|
||||
default: "Nuxt"
|
||||
},
|
||||
status: {
|
||||
type: Number,
|
||||
default: 500
|
||||
},
|
||||
statusText: {
|
||||
type: String,
|
||||
default: "Internal server error"
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: "This page is temporarily unavailable."
|
||||
},
|
||||
refresh: {
|
||||
type: String,
|
||||
default: "Refresh this page"
|
||||
}
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
useHead({
|
||||
title: `${props.status} - ${props.statusText} | ${props.appName}`,
|
||||
script: [
|
||||
{
|
||||
innerHTML: `!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)}}();`
|
||||
}
|
||||
],
|
||||
style: [
|
||||
{
|
||||
innerHTML: `*,: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,h2{font-size:inherit;font-weight:inherit}h1,h2,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: }`
|
||||
}
|
||||
]
|
||||
});
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
_push(`<div${ssrRenderAttrs(mergeProps({ class: "antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide" }, _attrs))} data-v-d349100d><div class="max-w-520px text-center" data-v-d349100d><h1 class="font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]" data-v-d349100d>${ssrInterpolate(__props.status)}</h1><h2 class="font-semibold mb-2 sm:text-3xl text-2xl" data-v-d349100d>${ssrInterpolate(__props.statusText)}</h2><p class="mb-4 px-2 text-[#64748B] text-md" data-v-d349100d>${ssrInterpolate(__props.description)}</p></div></div>`);
|
||||
};
|
||||
}
|
||||
};
|
||||
const _sfc_setup = _sfc_main.setup;
|
||||
_sfc_main.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/nuxt/dist/app/components/error-500.vue");
|
||||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
||||
};
|
||||
const error500 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d349100d"]]);
|
||||
|
||||
export { error500 as default };
|
||||
//# sourceMappingURL=error-500-B0qDQUop.mjs.map
|
||||
1
.output/server/chunks/build/error-500-B0qDQUop.mjs.map
Normal file
1
.output/server/chunks/build/error-500-B0qDQUop.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"error-500-B0qDQUop.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/error-500-B0qDQUop.js"],"names":[],"mappings":"","x_google_ignoreList":[0]}
|
||||
@@ -0,0 +1,8 @@
|
||||
const error500_vue_vue_type_style_index_0_scoped_d349100d_lang = ".grid[data-v-d349100d]{display:grid}.mb-2[data-v-d349100d]{margin-bottom:.5rem}.mb-4[data-v-d349100d]{margin-bottom:1rem}.max-w-520px[data-v-d349100d]{max-width:520px}.min-h-screen[data-v-d349100d]{min-height:100vh}.place-content-center[data-v-d349100d]{place-content:center}.overflow-hidden[data-v-d349100d]{overflow:hidden}.bg-white[data-v-d349100d]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-d349100d]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-d349100d]{text-align:center}.text-\\[80px\\][data-v-d349100d]{font-size:80px}.text-2xl[data-v-d349100d]{font-size:1.5rem;line-height:2rem}.text-\\[\\#020420\\][data-v-d349100d]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\\[\\#64748B\\][data-v-d349100d]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.font-semibold[data-v-d349100d]{font-weight:600}.leading-none[data-v-d349100d]{line-height:1}.tracking-wide[data-v-d349100d]{letter-spacing:.025em}.font-sans[data-v-d349100d]{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}.tabular-nums[data-v-d349100d]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.antialiased[data-v-d349100d]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\\:bg-\\[\\#020420\\][data-v-d349100d]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\\:text-white[data-v-d349100d]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\\:text-\\[110px\\][data-v-d349100d]{font-size:110px}.sm\\:text-3xl[data-v-d349100d]{font-size:1.875rem;line-height:2.25rem}}";
|
||||
|
||||
const error500Styles_8IYEHzz6 = [
|
||||
error500_vue_vue_type_style_index_0_scoped_d349100d_lang
|
||||
];
|
||||
|
||||
export { error500Styles_8IYEHzz6 as default };
|
||||
//# sourceMappingURL=error-500-styles.8IYEHzz6.mjs.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"error-500-styles.8IYEHzz6.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/error-500-styles-1.mjs-DOrS-RIZ.js","../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/error-500-styles.8IYEHzz6.mjs"],"names":["style_0"],"mappings":"","x_google_ignoreList":[0,1]}
|
||||
415
.output/server/chunks/build/index-BDcJu3_l.mjs
Normal file
415
.output/server/chunks/build/index-BDcJu3_l.mjs
Normal file
@@ -0,0 +1,415 @@
|
||||
import { defineComponent, mergeProps, ref, unref, computed, readonly, useSSRContext } from 'vue';
|
||||
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrRenderAttr, ssrInterpolate, ssrRenderStyle, ssrRenderClass, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual } from 'vue/server-renderer';
|
||||
import { _ as _export_sfc } from './server.mjs';
|
||||
import { u as useHead } from './composables-Piy9capG.mjs';
|
||||
import '../nitro/nitro.mjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'node:url';
|
||||
import '../routes/renderer.mjs';
|
||||
import 'vue-bundle-renderer/runtime';
|
||||
import 'unhead/server';
|
||||
import 'devalue';
|
||||
import 'unhead/utils';
|
||||
import 'vue-router';
|
||||
|
||||
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
||||
__name: "Navbar",
|
||||
__ssrInlineRender: true,
|
||||
setup(__props) {
|
||||
const scrolled = ref(false);
|
||||
const links = [
|
||||
{ label: "Features", href: "#features" },
|
||||
{ label: "Rates", href: "#rates" },
|
||||
{ label: "API Docs", href: "#playground" }
|
||||
];
|
||||
const mobileOpen = ref(false);
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
_push(`<nav${ssrRenderAttrs(mergeProps({
|
||||
class: ["fixed top-0 left-0 right-0 z-50 transition-all duration-300", unref(scrolled) ? "bg-white/80 backdrop-blur-xl shadow-soft border-b border-surface-border" : "bg-transparent"]
|
||||
}, _attrs))}><div class="section-container flex items-center justify-between h-16"><a href="#" class="flex items-center gap-2 group"><span class="inline-flex items-center justify-center w-8 h-8 rounded-lg bg-eu-blue text-white font-heading font-bold text-sm transition-transform group-hover:scale-105"> V </span><span class="font-heading font-bold text-lg text-ink"> vat-api<span class="text-eu-blue">.eu</span></span></a><div class="hidden md:flex items-center gap-8"><!--[-->`);
|
||||
ssrRenderList(links, (link) => {
|
||||
_push(`<a${ssrRenderAttr("href", link.href)} class="text-sm font-medium text-ink-secondary hover:text-eu-blue transition-colors">${ssrInterpolate(link.label)}</a>`);
|
||||
});
|
||||
_push(`<!--]--><a href="#playground" class="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-eu-blue text-white text-sm font-semibold hover:bg-eu-blue-dark transition-colors"> Try API <svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"></path></svg></a></div><button class="md:hidden p-2 -mr-2 text-ink-secondary hover:text-ink"${ssrRenderAttr("aria-label", unref(mobileOpen) ? "Close menu" : "Open menu")}>`);
|
||||
if (!unref(mobileOpen)) {
|
||||
_push(`<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" d="M4 6h16M4 12h16M4 18h16"></path></svg>`);
|
||||
} else {
|
||||
_push(`<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" d="M6 18 18 6M6 6l12 12"></path></svg>`);
|
||||
}
|
||||
_push(`</button></div>`);
|
||||
if (unref(mobileOpen)) {
|
||||
_push(`<div class="md:hidden bg-white/95 backdrop-blur-xl border-b border-surface-border"><div class="section-container py-4 flex flex-col gap-3"><!--[-->`);
|
||||
ssrRenderList(links, (link) => {
|
||||
_push(`<a${ssrRenderAttr("href", link.href)} class="text-sm font-medium text-ink-secondary hover:text-eu-blue py-2 transition-colors">${ssrInterpolate(link.label)}</a>`);
|
||||
});
|
||||
_push(`<!--]--></div></div>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</nav>`);
|
||||
};
|
||||
}
|
||||
});
|
||||
const _sfc_setup$7 = _sfc_main$7.setup;
|
||||
_sfc_main$7.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/Navbar.vue");
|
||||
return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
|
||||
};
|
||||
const __nuxt_component_0 = Object.assign(_sfc_main$7, { __name: "Navbar" });
|
||||
const _sfc_main$6 = {};
|
||||
function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs) {
|
||||
_push(`<section${ssrRenderAttrs(mergeProps({ class: "relative pt-32 pb-20 md:pt-40 md:pb-28 overflow-hidden" }, _attrs))}><div class="absolute inset-0 dot-grid opacity-[0.03]"></div><div class="absolute top-0 right-0 w-[600px] h-[600px] bg-eu-blue/[0.04] rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"></div><div class="section-container relative"><div class="grid lg:grid-cols-2 gap-12 lg:gap-16 items-center"><div><div class="inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-eu-blue-100 text-eu-blue text-xs font-semibold tracking-wide uppercase mb-6"><span class="w-1.5 h-1.5 rounded-full bg-eu-blue animate-pulse"></span> Free & Open </div><h1 class="text-display-sm md:text-display text-ink text-balance"> EU VAT Rates <span class="text-eu-blue">API</span></h1><p class="mt-4 text-subtitle text-ink-secondary font-heading"> Free. No API key. Always up-to-date. </p><p class="mt-4 text-base text-ink-muted leading-relaxed max-w-lg"> Get current VAT rates for all 27 EU member states with a single API call. No registration, no rate limits, no nonsense. </p><div class="flex flex-wrap gap-3 mt-8"><a href="#rates" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-eu-blue text-white font-semibold text-sm hover:bg-eu-blue-dark transition-all hover:shadow-glow"> View Rates <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"></path></svg></a><a href="#playground" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg border-2 border-eu-blue/20 text-eu-blue font-semibold text-sm hover:border-eu-blue/40 hover:bg-eu-blue-100 transition-all"> Try the API <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"></path></svg></a></div></div><div class="relative"><div class="absolute -inset-4 bg-eu-blue/[0.04] rounded-3xl blur-2xl"></div><div class="relative code-block p-6 shadow-card"><div class="flex items-center gap-3 mb-4 pb-4 border-b border-white/10"><div class="flex gap-1.5"><span class="w-3 h-3 rounded-full bg-[#ff5f57]"></span><span class="w-3 h-3 rounded-full bg-[#febc2e]"></span><span class="w-3 h-3 rounded-full bg-[#28c840]"></span></div><span class="text-xs text-[#8b949e] font-mono">GET /api/v1/rates/DE</span></div><pre class="text-[13px] leading-6"><span style="${ssrRenderStyle({ "color": "#8b949e" })}">// Response 200 OK</span>
|
||||
<span style="${ssrRenderStyle({ "color": "#ff7b72" })}">{</span>
|
||||
<span style="${ssrRenderStyle({ "color": "#79c0ff" })}">"country"</span>: <span style="${ssrRenderStyle({ "color": "#a5d6ff" })}">"Germany"</span>,
|
||||
<span style="${ssrRenderStyle({ "color": "#79c0ff" })}">"country_code"</span>: <span style="${ssrRenderStyle({ "color": "#a5d6ff" })}">"DE"</span>,
|
||||
<span style="${ssrRenderStyle({ "color": "#79c0ff" })}">"standard_rate"</span>: <span style="${ssrRenderStyle({ "color": "#79c0ff" })}">19</span>,
|
||||
<span style="${ssrRenderStyle({ "color": "#79c0ff" })}">"reduced_rates"</span>: <span style="${ssrRenderStyle({ "color": "#ff7b72" })}">[</span><span style="${ssrRenderStyle({ "color": "#79c0ff" })}">7</span><span style="${ssrRenderStyle({ "color": "#ff7b72" })}">]</span>,
|
||||
<span style="${ssrRenderStyle({ "color": "#79c0ff" })}">"currency"</span>: <span style="${ssrRenderStyle({ "color": "#a5d6ff" })}">"EUR"</span>
|
||||
<span style="${ssrRenderStyle({ "color": "#ff7b72" })}">}</span></pre></div></div></div></div></section>`);
|
||||
}
|
||||
const _sfc_setup$6 = _sfc_main$6.setup;
|
||||
_sfc_main$6.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/HeroSection.vue");
|
||||
return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
|
||||
};
|
||||
const __nuxt_component_1 = /* @__PURE__ */ Object.assign(_export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$1]]), { __name: "HeroSection" });
|
||||
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
||||
__name: "FeaturesGrid",
|
||||
__ssrInlineRender: true,
|
||||
setup(__props) {
|
||||
const features = [
|
||||
{
|
||||
icon: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="w-6 h-6"><circle cx="12" cy="12" r="10"/><path d="M12 6v2m0 8v2m-4.24-2.76 1.42-1.42m5.64-5.64 1.42-1.42M6 12h2m8 0h2m-2.76 4.24-1.42-1.42m-5.64-5.64L7.76 7.76"/></svg>`,
|
||||
title: "All 27 EU Countries",
|
||||
description: "Standard, reduced, and special VAT rates for every member state."
|
||||
},
|
||||
{
|
||||
icon: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"/></svg>`,
|
||||
title: "No Authentication",
|
||||
description: "No API keys, no sign-up. Just send a GET request."
|
||||
},
|
||||
{
|
||||
icon: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"/></svg>`,
|
||||
title: "Always Current",
|
||||
description: "Rates sourced and synced regularly from official EU data."
|
||||
},
|
||||
{
|
||||
icon: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"/></svg>`,
|
||||
title: "Simple JSON",
|
||||
description: "Clean, predictable JSON responses. Easy to integrate anywhere."
|
||||
}
|
||||
];
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
_push(`<section${ssrRenderAttrs(mergeProps({
|
||||
id: "features",
|
||||
class: "section-padding bg-surface-soft"
|
||||
}, _attrs))}><div class="section-container"><div class="text-center mb-14 animate-on-scroll"><h2 class="text-title md:text-display-sm text-ink"> Built for developers </h2><p class="mt-3 text-ink-muted max-w-lg mx-auto"> A straightforward API that does one thing well — delivering EU VAT rates without friction. </p></div><div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-5"><!--[-->`);
|
||||
ssrRenderList(features, (feature, i) => {
|
||||
_push(`<div class="animate-on-scroll group relative bg-white rounded-2xl p-6 border border-surface-border hover:border-eu-blue/20 hover:shadow-card transition-all duration-300" style="${ssrRenderStyle({ transitionDelay: `${i * 80}ms` })}"><div class="w-10 h-10 rounded-xl bg-eu-blue-100 text-eu-blue flex items-center justify-center mb-4 group-hover:bg-eu-blue group-hover:text-white transition-colors duration-300">${feature.icon ?? ""}</div><h3 class="font-heading font-semibold text-ink mb-1.5">${ssrInterpolate(feature.title)}</h3><p class="text-sm text-ink-muted leading-relaxed">${ssrInterpolate(feature.description)}</p></div>`);
|
||||
});
|
||||
_push(`<!--]--></div></div></section>`);
|
||||
};
|
||||
}
|
||||
});
|
||||
const _sfc_setup$5 = _sfc_main$5.setup;
|
||||
_sfc_main$5.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/FeaturesGrid.vue");
|
||||
return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
||||
};
|
||||
const __nuxt_component_2 = Object.assign(_sfc_main$5, { __name: "FeaturesGrid" });
|
||||
const euVatRates = [
|
||||
{ country: "Austria", code: "AT", flag: "🇦🇹", standard: 20, reduced: [10, 13] },
|
||||
{ country: "Belgium", code: "BE", flag: "🇧🇪", standard: 21, reduced: [6, 12] },
|
||||
{ country: "Bulgaria", code: "BG", flag: "🇧🇬", standard: 20, reduced: [9] },
|
||||
{ country: "Croatia", code: "HR", flag: "🇭🇷", standard: 25, reduced: [5, 13] },
|
||||
{ country: "Cyprus", code: "CY", flag: "🇨🇾", standard: 19, reduced: [5, 9] },
|
||||
{ country: "Czech Republic", code: "CZ", flag: "🇨🇿", standard: 21, reduced: [12, 15] },
|
||||
{ country: "Denmark", code: "DK", flag: "🇩🇰", standard: 25, reduced: [] },
|
||||
{ country: "Estonia", code: "EE", flag: "🇪🇪", standard: 22, reduced: [9] },
|
||||
{ country: "Finland", code: "FI", flag: "🇫🇮", standard: 25.5, reduced: [10, 14] },
|
||||
{ country: "France", code: "FR", flag: "🇫🇷", standard: 20, reduced: [5.5, 10] },
|
||||
{ country: "Germany", code: "DE", flag: "🇩🇪", standard: 19, reduced: [7] },
|
||||
{ country: "Greece", code: "GR", flag: "🇬🇷", standard: 24, reduced: [6, 13] },
|
||||
{ country: "Hungary", code: "HU", flag: "🇭🇺", standard: 27, reduced: [5, 18] },
|
||||
{ country: "Ireland", code: "IE", flag: "🇮🇪", standard: 23, reduced: [9, 13.5] },
|
||||
{ country: "Italy", code: "IT", flag: "🇮🇹", standard: 22, reduced: [5, 10] },
|
||||
{ country: "Latvia", code: "LV", flag: "🇱🇻", standard: 21, reduced: [5, 12] },
|
||||
{ country: "Lithuania", code: "LT", flag: "🇱🇹", standard: 21, reduced: [5, 9] },
|
||||
{ country: "Luxembourg", code: "LU", flag: "🇱🇺", standard: 17, reduced: [8] },
|
||||
{ country: "Malta", code: "MT", flag: "🇲🇹", standard: 18, reduced: [5, 7] },
|
||||
{ country: "Netherlands", code: "NL", flag: "🇳🇱", standard: 21, reduced: [9] },
|
||||
{ country: "Poland", code: "PL", flag: "🇵🇱", standard: 23, reduced: [5, 8] },
|
||||
{ country: "Portugal", code: "PT", flag: "🇵🇹", standard: 23, reduced: [6, 13] },
|
||||
{ country: "Romania", code: "RO", flag: "🇷🇴", standard: 19, reduced: [5, 9] },
|
||||
{ country: "Slovakia", code: "SK", flag: "🇸🇰", standard: 23, reduced: [5, 10] },
|
||||
{ country: "Slovenia", code: "SI", flag: "🇸🇮", standard: 22, reduced: [5, 9.5] },
|
||||
{ country: "Spain", code: "ES", flag: "🇪🇸", standard: 21, reduced: [4, 10] },
|
||||
{ country: "Sweden", code: "SE", flag: "🇸🇪", standard: 25, reduced: [6, 12] }
|
||||
];
|
||||
function useVatRates() {
|
||||
const rates = readonly(ref(euVatRates));
|
||||
function getRateByCode(code) {
|
||||
return euVatRates.find((r) => r.code === code.toUpperCase());
|
||||
}
|
||||
function formatApiResponse(rate) {
|
||||
return {
|
||||
country: rate.country,
|
||||
country_code: rate.code,
|
||||
standard_rate: rate.standard,
|
||||
reduced_rates: rate.reduced,
|
||||
currency: "EUR"
|
||||
};
|
||||
}
|
||||
function formatAllRatesResponse() {
|
||||
return euVatRates.map(formatApiResponse);
|
||||
}
|
||||
return { rates, getRateByCode, formatApiResponse, formatAllRatesResponse };
|
||||
}
|
||||
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
||||
__name: "VatRateTable",
|
||||
__ssrInlineRender: true,
|
||||
setup(__props) {
|
||||
const rates = ref([]);
|
||||
const search = ref("");
|
||||
const filtered = computed(() => {
|
||||
const q = search.value.toLowerCase().trim();
|
||||
if (!q) return rates.value;
|
||||
return rates.value.filter(
|
||||
(r) => r.country.toLowerCase().includes(q) || r.code.toLowerCase().includes(q)
|
||||
);
|
||||
});
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
_push(`<section${ssrRenderAttrs(mergeProps({
|
||||
id: "rates",
|
||||
class: "section-padding"
|
||||
}, _attrs))}><div class="section-container"><div class="text-center mb-10 animate-on-scroll"><h2 class="text-title md:text-display-sm text-ink"> VAT Rates across the EU </h2><p class="mt-3 text-ink-muted max-w-lg mx-auto"> Current standard and reduced rates for all 27 member states. </p></div><div class="max-w-sm mx-auto mb-8 animate-on-scroll"><div class="relative"><svg class="absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-ink-faint" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"></path></svg><input${ssrRenderAttr("value", unref(search))} type="text" placeholder="Search countries..." class="w-full pl-10 pr-4 py-2.5 rounded-xl border border-surface-border bg-white text-sm text-ink placeholder:text-ink-faint focus:outline-none focus:ring-2 focus:ring-eu-blue/20 focus:border-eu-blue/40 transition-all"></div></div><div class="animate-on-scroll overflow-hidden rounded-2xl border border-surface-border bg-white shadow-soft"><div class="overflow-x-auto"><table class="w-full text-sm"><thead><tr class="bg-surface-soft border-b border-surface-border"><th class="text-left font-semibold text-ink-secondary px-5 py-3.5 font-heading">Country</th><th class="text-left font-semibold text-ink-secondary px-5 py-3.5 font-heading w-20">Code</th><th class="text-right font-semibold text-ink-secondary px-5 py-3.5 font-heading w-32">Standard</th><th class="text-right font-semibold text-ink-secondary px-5 py-3.5 font-heading w-40">Reduced</th></tr></thead><tbody><!--[-->`);
|
||||
ssrRenderList(unref(filtered), (rate) => {
|
||||
_push(`<tr class="border-b border-surface-border/60 last:border-0 hover:bg-eu-blue-100/40 transition-colors"><td class="px-5 py-3"><span class="inline-flex items-center gap-2.5"><span class="text-lg leading-none">${ssrInterpolate(rate.flag)}</span><span class="font-medium text-ink">${ssrInterpolate(rate.country)}</span></span></td><td class="px-5 py-3"><span class="inline-flex px-2 py-0.5 rounded bg-surface-muted font-mono text-xs font-medium text-ink-secondary">${ssrInterpolate(rate.code)}</span></td><td class="px-5 py-3 text-right"><span class="font-semibold text-ink tabular-nums">${ssrInterpolate(rate.standard)}%</span></td><td class="px-5 py-3 text-right">`);
|
||||
if (rate.reduced.length) {
|
||||
_push(`<span class="text-ink-muted tabular-nums">${ssrInterpolate(rate.reduced.map((r) => `${r}%`).join(", "))}</span>`);
|
||||
} else {
|
||||
_push(`<span class="text-ink-faint">—</span>`);
|
||||
}
|
||||
_push(`</td></tr>`);
|
||||
});
|
||||
_push(`<!--]-->`);
|
||||
if (!unref(filtered).length) {
|
||||
_push(`<tr><td colspan="4" class="px-5 py-10 text-center text-ink-muted"> No countries matching "${ssrInterpolate(unref(search))}" </td></tr>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</tbody></table></div></div><p class="text-center text-xs text-ink-faint mt-4"> Data updated regularly from official EU sources. </p></div></section>`);
|
||||
};
|
||||
}
|
||||
});
|
||||
const _sfc_setup$4 = _sfc_main$4.setup;
|
||||
_sfc_main$4.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/VatRateTable.vue");
|
||||
return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
||||
};
|
||||
const __nuxt_component_3 = Object.assign(_sfc_main$4, { __name: "VatRateTable" });
|
||||
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
||||
__name: "ApiPlayground",
|
||||
__ssrInlineRender: true,
|
||||
setup(__props) {
|
||||
const { rates } = useVatRates();
|
||||
const selectedCode = ref("DE");
|
||||
const response = ref("");
|
||||
const statusCode = ref(null);
|
||||
const isLoading = ref(false);
|
||||
const showAllRates = ref(false);
|
||||
const endpointUrl = computed(
|
||||
() => showAllRates.value ? "https://vat-api.eu/api/v1/rates" : `https://vat-api.eu/api/v1/rates/${selectedCode.value}`
|
||||
);
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
_push(`<section${ssrRenderAttrs(mergeProps({
|
||||
id: "playground",
|
||||
class: "section-padding bg-surface-soft"
|
||||
}, _attrs))}><div class="section-container"><div class="text-center mb-10 animate-on-scroll"><h2 class="text-title md:text-display-sm text-ink"> Try it out </h2><p class="mt-3 text-ink-muted max-w-lg mx-auto"> Build your request, send it, and see the response. </p></div><div class="animate-on-scroll max-w-3xl mx-auto"><div class="bg-white rounded-2xl border border-surface-border shadow-card overflow-hidden"><div class="p-5 border-b border-surface-border"><div class="flex flex-wrap gap-3 items-end"><div class="flex-shrink-0"><label class="block text-xs font-medium text-ink-muted mb-1.5">Endpoint</label><div class="flex rounded-lg border border-surface-border overflow-hidden text-sm"><button class="${ssrRenderClass([!unref(showAllRates) ? "bg-eu-blue text-white" : "bg-white text-ink-secondary hover:bg-surface-soft", "px-3 py-2 font-medium transition-colors"])}"> Single </button><button class="${ssrRenderClass([unref(showAllRates) ? "bg-eu-blue text-white" : "bg-white text-ink-secondary hover:bg-surface-soft", "px-3 py-2 font-medium transition-colors"])}"> All Rates </button></div></div>`);
|
||||
if (!unref(showAllRates)) {
|
||||
_push(`<div class="flex-shrink-0"><label class="block text-xs font-medium text-ink-muted mb-1.5">Country</label><select class="px-3 py-2 rounded-lg border border-surface-border bg-white text-sm text-ink focus:outline-none focus:ring-2 focus:ring-eu-blue/20 focus:border-eu-blue/40 transition-all"><!--[-->`);
|
||||
ssrRenderList(unref(rates), (rate) => {
|
||||
_push(`<option${ssrRenderAttr("value", rate.code)}${ssrIncludeBooleanAttr(Array.isArray(unref(selectedCode)) ? ssrLooseContain(unref(selectedCode), rate.code) : ssrLooseEqual(unref(selectedCode), rate.code)) ? " selected" : ""}>${ssrInterpolate(rate.flag)} ${ssrInterpolate(rate.country)} (${ssrInterpolate(rate.code)}) </option>`);
|
||||
});
|
||||
_push(`<!--]--></select></div>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`<button class="px-5 py-2 rounded-lg bg-eu-gold text-eu-blue-dark font-semibold text-sm hover:bg-eu-gold-dark transition-colors flex items-center gap-2"${ssrIncludeBooleanAttr(unref(isLoading)) ? " disabled" : ""}>`);
|
||||
if (unref(isLoading)) {
|
||||
_push(`<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`<span>${ssrInterpolate(unref(isLoading) ? "Sending..." : "Send Request")}</span></button></div><div class="mt-3.5 flex items-center gap-2 px-3.5 py-2.5 rounded-lg bg-surface-muted font-mono text-sm overflow-x-auto"><span class="flex-shrink-0 text-xs font-semibold px-1.5 py-0.5 rounded bg-green-100 text-green-700">GET</span><span class="text-ink-secondary">${ssrInterpolate(unref(endpointUrl))}</span></div></div><div class="relative"><div class="flex items-center justify-between px-5 py-3 bg-[#0d1117] border-b border-white/5"><span class="text-xs text-[#8b949e] font-mono">Response</span>`);
|
||||
if (unref(statusCode) === 200) {
|
||||
_push(`<span class="text-xs font-mono px-2 py-0.5 rounded bg-green-500/20 text-green-400">200 OK</span>`);
|
||||
} else if (unref(statusCode)) {
|
||||
_push(`<span class="text-xs font-mono px-2 py-0.5 rounded bg-red-500/20 text-red-400">${ssrInterpolate(unref(statusCode))} Error</span>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</div><div class="bg-[#0d1117] text-[#e6edf3] font-mono text-sm leading-relaxed p-5 max-h-80 overflow-y-auto">`);
|
||||
if (unref(response)) {
|
||||
_push(`<pre class="text-[13px] leading-6">${unref(response) ?? ""}</pre>`);
|
||||
} else if (unref(isLoading)) {
|
||||
_push(`<p class="text-[#8b949e] text-sm">Loading...</p>`);
|
||||
} else {
|
||||
_push(`<p class="text-[#8b949e] text-sm">Click "Send Request" to see a response.</p>`);
|
||||
}
|
||||
_push(`</div></div></div></div></div></section>`);
|
||||
};
|
||||
}
|
||||
});
|
||||
const _sfc_setup$3 = _sfc_main$3.setup;
|
||||
_sfc_main$3.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ApiPlayground.vue");
|
||||
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
||||
};
|
||||
const __nuxt_component_4 = Object.assign(_sfc_main$3, { __name: "ApiPlayground" });
|
||||
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
||||
__name: "CodeExamples",
|
||||
__ssrInlineRender: true,
|
||||
setup(__props) {
|
||||
const tabs = ["cURL", "JavaScript", "Python"];
|
||||
const activeTab = ref("cURL");
|
||||
const code = {
|
||||
cURL: `# Get all EU VAT rates
|
||||
curl https://vat-api.eu/api/v1/rates
|
||||
|
||||
# Get rates for a specific country
|
||||
curl https://vat-api.eu/api/v1/rates/DE`,
|
||||
JavaScript: `const response = await fetch('https://vat-api.eu/api/v1/rates/DE');
|
||||
const data = await response.json();
|
||||
console.log(data.standard_rate); // 19`,
|
||||
Python: `import requests
|
||||
|
||||
response = requests.get('https://vat-api.eu/api/v1/rates/DE')
|
||||
data = response.json()
|
||||
print(data['standard_rate']) # 19`
|
||||
};
|
||||
const highlighted = {
|
||||
cURL: highlightBash(code.cURL),
|
||||
JavaScript: highlightJS(code.JavaScript),
|
||||
Python: highlightPython(code.Python)
|
||||
};
|
||||
function highlightBash(src) {
|
||||
return src.replace(/(#.*)/g, '<span style="color:#8b949e">$1</span>').replace(/(curl)\s/g, '<span style="color:#ff7b72">$1</span> ').replace(/(https?:\/\/[^\s]+)/g, '<span style="color:#a5d6ff">$1</span>');
|
||||
}
|
||||
function highlightJS(src) {
|
||||
return src.replace(/(\/\/\s*\d+)/g, '<span style="color:#8b949e">$1</span>').replace(/(const|await)\s/g, '<span style="color:#ff7b72">$1</span> ').replace(/(fetch|json|log)\(/g, '<span style="color:#d2a8ff">$1</span>(').replace(/('https?:\/\/[^']*')/g, '<span style="color:#a5d6ff">$1</span>').replace(/(\.standard_rate)/g, '<span style="color:#79c0ff">$1</span>').replace(/(console)\./g, '<span style="color:#79c0ff">$1</span>.').replace(/(response)\./g, '<span style="color:#79c0ff">$1</span>.');
|
||||
}
|
||||
function highlightPython(src) {
|
||||
return src.replace(/(#\s*\d+)/g, '<span style="color:#8b949e">$1</span>').replace(/(import|from)\s/g, '<span style="color:#ff7b72">$1</span> ').replace(/(requests)/g, '<span style="color:#79c0ff">$1</span>').replace(/('https?:\/\/[^']*')/g, '<span style="color:#a5d6ff">$1</span>').replace(/(\['standard_rate'\])/g, '<span style="color:#79c0ff">$1</span>').replace(/(print|get)\(/g, '<span style="color:#d2a8ff">$1</span>(').replace(/(response)\./g, '<span style="color:#79c0ff">$1</span>.');
|
||||
}
|
||||
const copied = ref(false);
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
_push(`<section${ssrRenderAttrs(mergeProps({
|
||||
id: "examples",
|
||||
class: "section-padding"
|
||||
}, _attrs))}><div class="section-container"><div class="text-center mb-10 animate-on-scroll"><h2 class="text-title md:text-display-sm text-ink"> Quick start </h2><p class="mt-3 text-ink-muted max-w-lg mx-auto"> Integrate EU VAT rates into your project in seconds. </p></div><div class="animate-on-scroll max-w-2xl mx-auto"><div class="rounded-2xl border border-surface-border overflow-hidden shadow-card bg-white"><div class="flex items-center justify-between border-b border-surface-border bg-surface-soft px-1.5"><div class="flex"><!--[-->`);
|
||||
ssrRenderList(tabs, (tab) => {
|
||||
_push(`<button class="${ssrRenderClass([unref(activeTab) === tab ? "text-eu-blue" : "text-ink-muted hover:text-ink-secondary", "px-4 py-3 text-sm font-medium transition-colors relative"])}">${ssrInterpolate(tab)} `);
|
||||
if (unref(activeTab) === tab) {
|
||||
_push(`<span class="absolute bottom-0 left-2 right-2 h-0.5 bg-eu-blue rounded-full"></span>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</button>`);
|
||||
});
|
||||
_push(`<!--]--></div><button class="flex items-center gap-1.5 px-3 py-1.5 mr-1.5 rounded-lg text-xs font-medium text-ink-muted hover:text-ink-secondary hover:bg-surface-muted transition-colors">`);
|
||||
if (!unref(copied)) {
|
||||
_push(`<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9.75a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"></path></svg>`);
|
||||
} else {
|
||||
_push(`<svg class="w-3.5 h-3.5 text-green-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5"></path></svg>`);
|
||||
}
|
||||
_push(` ${ssrInterpolate(unref(copied) ? "Copied!" : "Copy")}</button></div><div class="code-block p-5"><pre class="text-[13px] leading-6">${highlighted[unref(activeTab)] ?? ""}</pre></div></div></div></div></section>`);
|
||||
};
|
||||
}
|
||||
});
|
||||
const _sfc_setup$2 = _sfc_main$2.setup;
|
||||
_sfc_main$2.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/CodeExamples.vue");
|
||||
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
||||
};
|
||||
const __nuxt_component_5 = Object.assign(_sfc_main$2, { __name: "CodeExamples" });
|
||||
const _sfc_main$1 = {};
|
||||
function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
|
||||
_push(`<footer${ssrRenderAttrs(mergeProps({ class: "border-t border-surface-border bg-white" }, _attrs))}><div class="section-container py-10"><div class="flex flex-col md:flex-row items-center justify-between gap-6 text-sm text-ink-muted"><div class="flex items-center gap-2"><span class="inline-flex items-center justify-center w-6 h-6 rounded-md bg-eu-blue text-white font-heading font-bold text-[10px]">V</span><span class="font-heading font-semibold text-ink"> vat-api<span class="text-eu-blue">.eu</span></span><span class="hidden sm:inline text-ink-faint">— Free EU VAT Rate API</span></div><p class="text-ink-faint text-xs"> Free EU VAT rate data </p><div class="flex items-center gap-5"><a href="#" class="hover:text-eu-blue transition-colors">Imprint</a><a href="#" class="hover:text-eu-blue transition-colors">Privacy</a><a href="#" class="hover:text-eu-blue transition-colors flex items-center gap-1.5"><svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg> GitHub </a></div></div></div></footer>`);
|
||||
}
|
||||
const _sfc_setup$1 = _sfc_main$1.setup;
|
||||
_sfc_main$1.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/FooterSection.vue");
|
||||
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
||||
};
|
||||
const __nuxt_component_6 = /* @__PURE__ */ Object.assign(_export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender]]), { __name: "FooterSection" });
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "index",
|
||||
__ssrInlineRender: true,
|
||||
setup(__props) {
|
||||
useHead({
|
||||
title: "vat-api.eu — Free EU VAT Rates API",
|
||||
meta: [
|
||||
{
|
||||
name: "description",
|
||||
content: "Get current VAT rates for all 27 EU member states with a free, open REST API. No API key required."
|
||||
},
|
||||
{ property: "og:title", content: "vat-api.eu — Free EU VAT Rates API" },
|
||||
{
|
||||
property: "og:description",
|
||||
content: "Get current VAT rates for all 27 EU member states with a free, open REST API. No API key required."
|
||||
},
|
||||
{ property: "og:type", content: "website" },
|
||||
{ property: "og:url", content: "https://vat-api.eu" },
|
||||
{ name: "twitter:card", content: "summary_large_image" },
|
||||
{ name: "twitter:title", content: "vat-api.eu — Free EU VAT Rates API" },
|
||||
{
|
||||
name: "twitter:description",
|
||||
content: "Get current VAT rates for all 27 EU member states with a free, open REST API. No API key required."
|
||||
}
|
||||
]
|
||||
});
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
const _component_Navbar = __nuxt_component_0;
|
||||
const _component_HeroSection = __nuxt_component_1;
|
||||
const _component_FeaturesGrid = __nuxt_component_2;
|
||||
const _component_VatRateTable = __nuxt_component_3;
|
||||
const _component_ApiPlayground = __nuxt_component_4;
|
||||
const _component_CodeExamples = __nuxt_component_5;
|
||||
const _component_FooterSection = __nuxt_component_6;
|
||||
_push(`<div${ssrRenderAttrs(mergeProps({ class: "min-h-screen" }, _attrs))}>`);
|
||||
_push(ssrRenderComponent(_component_Navbar, null, null, _parent));
|
||||
_push(`<main>`);
|
||||
_push(ssrRenderComponent(_component_HeroSection, null, null, _parent));
|
||||
_push(ssrRenderComponent(_component_FeaturesGrid, null, null, _parent));
|
||||
_push(ssrRenderComponent(_component_VatRateTable, null, null, _parent));
|
||||
_push(ssrRenderComponent(_component_ApiPlayground, null, null, _parent));
|
||||
_push(ssrRenderComponent(_component_CodeExamples, null, null, _parent));
|
||||
_push(`</main>`);
|
||||
_push(ssrRenderComponent(_component_FooterSection, null, null, _parent));
|
||||
_push(`</div>`);
|
||||
};
|
||||
}
|
||||
});
|
||||
const _sfc_setup = _sfc_main.setup;
|
||||
_sfc_main.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/index.vue");
|
||||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
||||
};
|
||||
|
||||
export { _sfc_main as default };
|
||||
//# sourceMappingURL=index-BDcJu3_l.mjs.map
|
||||
1
.output/server/chunks/build/index-BDcJu3_l.mjs.map
Normal file
1
.output/server/chunks/build/index-BDcJu3_l.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index-BDcJu3_l.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/index-BDcJu3_l.js"],"names":[],"mappings":"","x_google_ignoreList":[0]}
|
||||
953
.output/server/chunks/build/server.mjs
Normal file
953
.output/server/chunks/build/server.mjs
Normal file
@@ -0,0 +1,953 @@
|
||||
import process from 'node:process';globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};import { hasInjectionContext, getCurrentInstance, defineComponent, ref, inject, h, Suspense, Fragment, createApp, provide, shallowReactive, onErrorCaptured, onServerPrefetch, unref, createVNode, resolveDynamicComponent, reactive, effectScope, defineAsyncComponent, mergeProps, getCurrentScope, toRef, shallowRef, isReadonly, useSSRContext, isRef, isShallow, isReactive, toRaw } from 'vue';
|
||||
import { p as parseURL, m as encodePath, n as decodePath, o as hasProtocol, q as isScriptProtocol, k as joinURL, w as withQuery, r as sanitizeStatusCode, t as getContext, $ as $fetch, v as createHooks, c as createError$1, x as executeAsync, y as defu } from '../nitro/nitro.mjs';
|
||||
import { b as baseURL } from '../routes/renderer.mjs';
|
||||
import { RouterView, createMemoryHistory, createRouter, START_LOCATION } from 'vue-router';
|
||||
import { ssrRenderSuspense, ssrRenderComponent, ssrRenderVNode } from 'vue/server-renderer';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'node:url';
|
||||
import 'vue-bundle-renderer/runtime';
|
||||
import 'unhead/server';
|
||||
import 'devalue';
|
||||
import 'unhead/utils';
|
||||
|
||||
if (!globalThis.$fetch) {
|
||||
globalThis.$fetch = $fetch.create({
|
||||
baseURL: baseURL()
|
||||
});
|
||||
}
|
||||
if (!("global" in globalThis)) {
|
||||
globalThis.global = globalThis;
|
||||
}
|
||||
const nuxtLinkDefaults = { "componentName": "NuxtLink" };
|
||||
const appId = "nuxt-app";
|
||||
function getNuxtAppCtx(id = appId) {
|
||||
return getContext(id, {
|
||||
asyncContext: false
|
||||
});
|
||||
}
|
||||
const NuxtPluginIndicator = "__nuxt_plugin";
|
||||
function createNuxtApp(options) {
|
||||
let hydratingCount = 0;
|
||||
const nuxtApp = {
|
||||
_id: options.id || appId || "nuxt-app",
|
||||
_scope: effectScope(),
|
||||
provide: void 0,
|
||||
versions: {
|
||||
get nuxt() {
|
||||
return "4.3.1";
|
||||
},
|
||||
get vue() {
|
||||
return nuxtApp.vueApp.version;
|
||||
}
|
||||
},
|
||||
payload: shallowReactive({
|
||||
...options.ssrContext?.payload || {},
|
||||
data: shallowReactive({}),
|
||||
state: reactive({}),
|
||||
once: /* @__PURE__ */ new Set(),
|
||||
_errors: shallowReactive({})
|
||||
}),
|
||||
static: {
|
||||
data: {}
|
||||
},
|
||||
runWithContext(fn) {
|
||||
if (nuxtApp._scope.active && !getCurrentScope()) {
|
||||
return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn));
|
||||
}
|
||||
return callWithNuxt(nuxtApp, fn);
|
||||
},
|
||||
isHydrating: false,
|
||||
deferHydration() {
|
||||
if (!nuxtApp.isHydrating) {
|
||||
return () => {
|
||||
};
|
||||
}
|
||||
hydratingCount++;
|
||||
let called = false;
|
||||
return () => {
|
||||
if (called) {
|
||||
return;
|
||||
}
|
||||
called = true;
|
||||
hydratingCount--;
|
||||
if (hydratingCount === 0) {
|
||||
nuxtApp.isHydrating = false;
|
||||
return nuxtApp.callHook("app:suspense:resolve");
|
||||
}
|
||||
};
|
||||
},
|
||||
_asyncDataPromises: {},
|
||||
_asyncData: shallowReactive({}),
|
||||
_payloadRevivers: {},
|
||||
...options
|
||||
};
|
||||
{
|
||||
nuxtApp.payload.serverRendered = true;
|
||||
}
|
||||
if (nuxtApp.ssrContext) {
|
||||
nuxtApp.payload.path = nuxtApp.ssrContext.url;
|
||||
nuxtApp.ssrContext.nuxt = nuxtApp;
|
||||
nuxtApp.ssrContext.payload = nuxtApp.payload;
|
||||
nuxtApp.ssrContext.config = {
|
||||
public: nuxtApp.ssrContext.runtimeConfig.public,
|
||||
app: nuxtApp.ssrContext.runtimeConfig.app
|
||||
};
|
||||
}
|
||||
nuxtApp.hooks = createHooks();
|
||||
nuxtApp.hook = nuxtApp.hooks.hook;
|
||||
{
|
||||
const contextCaller = async function(hooks, args) {
|
||||
for (const hook of hooks) {
|
||||
await nuxtApp.runWithContext(() => hook(...args));
|
||||
}
|
||||
};
|
||||
nuxtApp.hooks.callHook = (name, ...args) => nuxtApp.hooks.callHookWith(contextCaller, name, ...args);
|
||||
}
|
||||
nuxtApp.callHook = nuxtApp.hooks.callHook;
|
||||
nuxtApp.provide = (name, value) => {
|
||||
const $name = "$" + name;
|
||||
defineGetter(nuxtApp, $name, value);
|
||||
defineGetter(nuxtApp.vueApp.config.globalProperties, $name, value);
|
||||
};
|
||||
defineGetter(nuxtApp.vueApp, "$nuxt", nuxtApp);
|
||||
defineGetter(nuxtApp.vueApp.config.globalProperties, "$nuxt", nuxtApp);
|
||||
const runtimeConfig = options.ssrContext.runtimeConfig;
|
||||
nuxtApp.provide("config", runtimeConfig);
|
||||
return nuxtApp;
|
||||
}
|
||||
function registerPluginHooks(nuxtApp, plugin2) {
|
||||
if (plugin2.hooks) {
|
||||
nuxtApp.hooks.addHooks(plugin2.hooks);
|
||||
}
|
||||
}
|
||||
async function applyPlugin(nuxtApp, plugin2) {
|
||||
if (typeof plugin2 === "function") {
|
||||
const { provide: provide2 } = await nuxtApp.runWithContext(() => plugin2(nuxtApp)) || {};
|
||||
if (provide2 && typeof provide2 === "object") {
|
||||
for (const key in provide2) {
|
||||
nuxtApp.provide(key, provide2[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async function applyPlugins(nuxtApp, plugins2) {
|
||||
const resolvedPlugins = /* @__PURE__ */ new Set();
|
||||
const unresolvedPlugins = [];
|
||||
const parallels = [];
|
||||
let error = void 0;
|
||||
let promiseDepth = 0;
|
||||
async function executePlugin(plugin2) {
|
||||
const unresolvedPluginsForThisPlugin = plugin2.dependsOn?.filter((name) => plugins2.some((p) => p._name === name) && !resolvedPlugins.has(name)) ?? [];
|
||||
if (unresolvedPluginsForThisPlugin.length > 0) {
|
||||
unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin2]);
|
||||
} else {
|
||||
const promise = applyPlugin(nuxtApp, plugin2).then(async () => {
|
||||
if (plugin2._name) {
|
||||
resolvedPlugins.add(plugin2._name);
|
||||
await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => {
|
||||
if (dependsOn.has(plugin2._name)) {
|
||||
dependsOn.delete(plugin2._name);
|
||||
if (dependsOn.size === 0) {
|
||||
promiseDepth++;
|
||||
await executePlugin(unexecutedPlugin);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
}).catch((e) => {
|
||||
if (!plugin2.parallel && !nuxtApp.payload.error) {
|
||||
throw e;
|
||||
}
|
||||
error ||= e;
|
||||
});
|
||||
if (plugin2.parallel) {
|
||||
parallels.push(promise);
|
||||
} else {
|
||||
await promise;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const plugin2 of plugins2) {
|
||||
if (nuxtApp.ssrContext?.islandContext && plugin2.env?.islands === false) {
|
||||
continue;
|
||||
}
|
||||
registerPluginHooks(nuxtApp, plugin2);
|
||||
}
|
||||
for (const plugin2 of plugins2) {
|
||||
if (nuxtApp.ssrContext?.islandContext && plugin2.env?.islands === false) {
|
||||
continue;
|
||||
}
|
||||
await executePlugin(plugin2);
|
||||
}
|
||||
await Promise.all(parallels);
|
||||
if (promiseDepth) {
|
||||
for (let i = 0; i < promiseDepth; i++) {
|
||||
await Promise.all(parallels);
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
throw nuxtApp.payload.error || error;
|
||||
}
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function defineNuxtPlugin(plugin2) {
|
||||
if (typeof plugin2 === "function") {
|
||||
return plugin2;
|
||||
}
|
||||
const _name = plugin2._name || plugin2.name;
|
||||
delete plugin2.name;
|
||||
return Object.assign(plugin2.setup || (() => {
|
||||
}), plugin2, { [NuxtPluginIndicator]: true, _name });
|
||||
}
|
||||
function callWithNuxt(nuxt, setup, args) {
|
||||
const fn = () => setup();
|
||||
const nuxtAppCtx = getNuxtAppCtx(nuxt._id);
|
||||
{
|
||||
return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn));
|
||||
}
|
||||
}
|
||||
function tryUseNuxtApp(id) {
|
||||
let nuxtAppInstance;
|
||||
if (hasInjectionContext()) {
|
||||
nuxtAppInstance = getCurrentInstance()?.appContext.app.$nuxt;
|
||||
}
|
||||
nuxtAppInstance ||= getNuxtAppCtx(id).tryUse();
|
||||
return nuxtAppInstance || null;
|
||||
}
|
||||
function useNuxtApp(id) {
|
||||
const nuxtAppInstance = tryUseNuxtApp(id);
|
||||
if (!nuxtAppInstance) {
|
||||
{
|
||||
throw new Error("[nuxt] instance unavailable");
|
||||
}
|
||||
}
|
||||
return nuxtAppInstance;
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function useRuntimeConfig(_event) {
|
||||
return useNuxtApp().$config;
|
||||
}
|
||||
function defineGetter(obj, key, val) {
|
||||
Object.defineProperty(obj, key, { get: () => val });
|
||||
}
|
||||
const LayoutMetaSymbol = /* @__PURE__ */ Symbol("layout-meta");
|
||||
const PageRouteSymbol = /* @__PURE__ */ Symbol("route");
|
||||
globalThis._importMeta_.url.replace(/\/app\/.*$/, "/");
|
||||
const useRouter = () => {
|
||||
return useNuxtApp()?.$router;
|
||||
};
|
||||
const useRoute = () => {
|
||||
if (hasInjectionContext()) {
|
||||
return inject(PageRouteSymbol, useNuxtApp()._route);
|
||||
}
|
||||
return useNuxtApp()._route;
|
||||
};
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function defineNuxtRouteMiddleware(middleware) {
|
||||
return middleware;
|
||||
}
|
||||
const isProcessingMiddleware = () => {
|
||||
try {
|
||||
if (useNuxtApp()._processingMiddleware) {
|
||||
return true;
|
||||
}
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
const URL_QUOTE_RE = /"/g;
|
||||
const navigateTo = (to, options) => {
|
||||
to ||= "/";
|
||||
const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter().resolve(to).href;
|
||||
const isExternalHost = hasProtocol(toPath, { acceptRelative: true });
|
||||
const isExternal = options?.external || isExternalHost;
|
||||
if (isExternal) {
|
||||
if (!options?.external) {
|
||||
throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");
|
||||
}
|
||||
const { protocol } = new URL(toPath, "http://localhost");
|
||||
if (protocol && isScriptProtocol(protocol)) {
|
||||
throw new Error(`Cannot navigate to a URL with '${protocol}' protocol.`);
|
||||
}
|
||||
}
|
||||
const inMiddleware = isProcessingMiddleware();
|
||||
const router = useRouter();
|
||||
const nuxtApp = useNuxtApp();
|
||||
{
|
||||
if (nuxtApp.ssrContext) {
|
||||
const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).fullPath || "/";
|
||||
const location2 = isExternal ? toPath : joinURL((/* @__PURE__ */ useRuntimeConfig()).app.baseURL, fullPath);
|
||||
const redirect = async function(response) {
|
||||
await nuxtApp.callHook("app:redirected");
|
||||
const encodedLoc = location2.replace(URL_QUOTE_RE, "%22");
|
||||
const encodedHeader = encodeURL(location2, isExternalHost);
|
||||
nuxtApp.ssrContext["~renderResponse"] = {
|
||||
statusCode: sanitizeStatusCode(options?.redirectCode || 302, 302),
|
||||
body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`,
|
||||
headers: { location: encodedHeader }
|
||||
};
|
||||
return response;
|
||||
};
|
||||
if (!isExternal && inMiddleware) {
|
||||
router.afterEach((final) => final.fullPath === fullPath ? redirect(false) : void 0);
|
||||
return to;
|
||||
}
|
||||
return redirect(!inMiddleware ? void 0 : (
|
||||
/* abort route navigation */
|
||||
false
|
||||
));
|
||||
}
|
||||
}
|
||||
if (isExternal) {
|
||||
nuxtApp._scope.stop();
|
||||
if (options?.replace) {
|
||||
(void 0).replace(toPath);
|
||||
} else {
|
||||
(void 0).href = toPath;
|
||||
}
|
||||
if (inMiddleware) {
|
||||
if (!nuxtApp.isHydrating) {
|
||||
return false;
|
||||
}
|
||||
return new Promise(() => {
|
||||
});
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
const encodedTo = typeof to === "string" ? encodeRoutePath(to) : to;
|
||||
return options?.replace ? router.replace(encodedTo) : router.push(encodedTo);
|
||||
};
|
||||
function resolveRouteObject(to) {
|
||||
return withQuery(to.path || "", to.query || {}) + (to.hash || "");
|
||||
}
|
||||
function encodeURL(location2, isExternalHost = false) {
|
||||
const url = new URL(location2, "http://localhost");
|
||||
if (!isExternalHost) {
|
||||
return url.pathname + url.search + url.hash;
|
||||
}
|
||||
if (location2.startsWith("//")) {
|
||||
return url.toString().replace(url.protocol, "");
|
||||
}
|
||||
return url.toString();
|
||||
}
|
||||
function encodeRoutePath(url) {
|
||||
const parsed = parseURL(url);
|
||||
return encodePath(decodePath(parsed.pathname)) + parsed.search + parsed.hash;
|
||||
}
|
||||
const NUXT_ERROR_SIGNATURE = "__nuxt_error";
|
||||
const useError = /* @__NO_SIDE_EFFECTS__ */ () => toRef(useNuxtApp().payload, "error");
|
||||
const showError = (error) => {
|
||||
const nuxtError = createError(error);
|
||||
try {
|
||||
const error2 = /* @__PURE__ */ useError();
|
||||
if (false) ;
|
||||
error2.value ||= nuxtError;
|
||||
} catch {
|
||||
throw nuxtError;
|
||||
}
|
||||
return nuxtError;
|
||||
};
|
||||
const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
|
||||
const createError = (error) => {
|
||||
if (typeof error !== "string" && error.statusText) {
|
||||
error.message ??= error.statusText;
|
||||
}
|
||||
const nuxtError = createError$1(error);
|
||||
Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
|
||||
value: true,
|
||||
configurable: false,
|
||||
writable: false
|
||||
});
|
||||
Object.defineProperty(nuxtError, "status", {
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||
get: () => nuxtError.statusCode,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(nuxtError, "statusText", {
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||
get: () => nuxtError.statusMessage,
|
||||
configurable: true
|
||||
});
|
||||
return nuxtError;
|
||||
};
|
||||
const unhead_k2P3m_ZDyjlr2mMYnoDPwavjsDN8hBlk9cFai0bbopU = /* @__PURE__ */ defineNuxtPlugin({
|
||||
name: "nuxt:head",
|
||||
enforce: "pre",
|
||||
setup(nuxtApp) {
|
||||
const head = nuxtApp.ssrContext.head;
|
||||
nuxtApp.vueApp.use(head);
|
||||
}
|
||||
});
|
||||
function toArray(value) {
|
||||
return Array.isArray(value) ? value : [value];
|
||||
}
|
||||
const matcher = (m, p) => {
|
||||
return [];
|
||||
};
|
||||
const _routeRulesMatcher = (path) => defu({}, ...matcher().map((r) => r.data).reverse());
|
||||
const routeRulesMatcher = _routeRulesMatcher;
|
||||
function getRouteRules(arg) {
|
||||
const path = typeof arg === "string" ? arg : arg.path;
|
||||
try {
|
||||
return routeRulesMatcher(path);
|
||||
} catch (e) {
|
||||
console.error("[nuxt] Error matching route rules.", e);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
const _routes = [
|
||||
{
|
||||
name: "index",
|
||||
path: "/",
|
||||
component: () => import('./index-BDcJu3_l.mjs')
|
||||
}
|
||||
];
|
||||
const ROUTE_KEY_PARENTHESES_RE = /(:\w+)\([^)]+\)/g;
|
||||
const ROUTE_KEY_SYMBOLS_RE = /(:\w+)[?+*]/g;
|
||||
const ROUTE_KEY_NORMAL_RE = /:\w+/g;
|
||||
function generateRouteKey(route) {
|
||||
const source = route?.meta.key ?? route.path.replace(ROUTE_KEY_PARENTHESES_RE, "$1").replace(ROUTE_KEY_SYMBOLS_RE, "$1").replace(ROUTE_KEY_NORMAL_RE, (r) => route.params[r.slice(1)]?.toString() || "");
|
||||
return typeof source === "function" ? source(route) : source;
|
||||
}
|
||||
function isChangingPage(to, from) {
|
||||
if (to === from || from === START_LOCATION) {
|
||||
return false;
|
||||
}
|
||||
if (generateRouteKey(to) !== generateRouteKey(from)) {
|
||||
return true;
|
||||
}
|
||||
const areComponentsSame = to.matched.every(
|
||||
(comp, index) => comp.components && comp.components.default === from.matched[index]?.components?.default
|
||||
);
|
||||
if (areComponentsSame) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
const routerOptions0 = {
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
const nuxtApp = useNuxtApp();
|
||||
const hashScrollBehaviour = useRouter().options?.scrollBehaviorType ?? "auto";
|
||||
if (to.path.replace(/\/$/, "") === from.path.replace(/\/$/, "")) {
|
||||
if (from.hash && !to.hash) {
|
||||
return { left: 0, top: 0 };
|
||||
}
|
||||
if (to.hash) {
|
||||
return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior: hashScrollBehaviour };
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop;
|
||||
if (routeAllowsScrollToTop === false) {
|
||||
return false;
|
||||
}
|
||||
const hookToWait = nuxtApp._runningTransition ? "page:transition:finish" : "page:loading:end";
|
||||
return new Promise((resolve) => {
|
||||
if (from === START_LOCATION) {
|
||||
resolve(_calculatePosition(to, from, savedPosition, hashScrollBehaviour));
|
||||
return;
|
||||
}
|
||||
nuxtApp.hooks.hookOnce(hookToWait, () => {
|
||||
requestAnimationFrame(() => resolve(_calculatePosition(to, from, savedPosition, hashScrollBehaviour)));
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
function _getHashElementScrollMarginTop(selector) {
|
||||
try {
|
||||
const elem = (void 0).querySelector(selector);
|
||||
if (elem) {
|
||||
return (Number.parseFloat(getComputedStyle(elem).scrollMarginTop) || 0) + (Number.parseFloat(getComputedStyle((void 0).documentElement).scrollPaddingTop) || 0);
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
function _calculatePosition(to, from, savedPosition, defaultHashScrollBehaviour) {
|
||||
if (savedPosition) {
|
||||
return savedPosition;
|
||||
}
|
||||
const isPageNavigation = isChangingPage(to, from);
|
||||
if (to.hash) {
|
||||
return {
|
||||
el: to.hash,
|
||||
top: _getHashElementScrollMarginTop(to.hash),
|
||||
behavior: isPageNavigation ? defaultHashScrollBehaviour : "instant"
|
||||
};
|
||||
}
|
||||
return {
|
||||
left: 0,
|
||||
top: 0
|
||||
};
|
||||
}
|
||||
const configRouterOptions = {
|
||||
hashMode: false,
|
||||
scrollBehaviorType: "auto"
|
||||
};
|
||||
const routerOptions = {
|
||||
...configRouterOptions,
|
||||
...routerOptions0
|
||||
};
|
||||
const validate = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to, from) => {
|
||||
let __temp, __restore;
|
||||
if (!to.meta?.validate) {
|
||||
return;
|
||||
}
|
||||
const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp);
|
||||
if (result === true) {
|
||||
return;
|
||||
}
|
||||
const error = createError({
|
||||
fatal: false,
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||
status: result && (result.status || result.statusCode) || 404,
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||
statusText: result && (result.statusText || result.statusMessage) || `Page Not Found: ${to.fullPath}`,
|
||||
data: {
|
||||
path: to.fullPath
|
||||
}
|
||||
});
|
||||
return error;
|
||||
});
|
||||
const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware((to) => {
|
||||
{
|
||||
return;
|
||||
}
|
||||
});
|
||||
const globalMiddleware = [
|
||||
validate,
|
||||
manifest_45route_45rule
|
||||
];
|
||||
const namedMiddleware = {};
|
||||
const plugin = /* @__PURE__ */ defineNuxtPlugin({
|
||||
name: "nuxt:router",
|
||||
enforce: "pre",
|
||||
async setup(nuxtApp) {
|
||||
let __temp, __restore;
|
||||
let routerBase = (/* @__PURE__ */ useRuntimeConfig()).app.baseURL;
|
||||
const history = routerOptions.history?.(routerBase) ?? createMemoryHistory(routerBase);
|
||||
const routes = routerOptions.routes ? ([__temp, __restore] = executeAsync(() => routerOptions.routes(_routes)), __temp = await __temp, __restore(), __temp) ?? _routes : _routes;
|
||||
let startPosition;
|
||||
const router = createRouter({
|
||||
...routerOptions,
|
||||
scrollBehavior: (to, from, savedPosition) => {
|
||||
if (from === START_LOCATION) {
|
||||
startPosition = savedPosition;
|
||||
return;
|
||||
}
|
||||
if (routerOptions.scrollBehavior) {
|
||||
router.options.scrollBehavior = routerOptions.scrollBehavior;
|
||||
if ("scrollRestoration" in (void 0).history) {
|
||||
const unsub = router.beforeEach(() => {
|
||||
unsub();
|
||||
(void 0).history.scrollRestoration = "manual";
|
||||
});
|
||||
}
|
||||
return routerOptions.scrollBehavior(to, START_LOCATION, startPosition || savedPosition);
|
||||
}
|
||||
},
|
||||
history,
|
||||
routes
|
||||
});
|
||||
nuxtApp.vueApp.use(router);
|
||||
const previousRoute = shallowRef(router.currentRoute.value);
|
||||
router.afterEach((_to, from) => {
|
||||
previousRoute.value = from;
|
||||
});
|
||||
Object.defineProperty(nuxtApp.vueApp.config.globalProperties, "previousRoute", {
|
||||
get: () => previousRoute.value
|
||||
});
|
||||
const initialURL = nuxtApp.ssrContext.url;
|
||||
const _route = shallowRef(router.currentRoute.value);
|
||||
const syncCurrentRoute = () => {
|
||||
_route.value = router.currentRoute.value;
|
||||
};
|
||||
router.afterEach((to, from) => {
|
||||
if (to.matched.at(-1)?.components?.default === from.matched.at(-1)?.components?.default) {
|
||||
syncCurrentRoute();
|
||||
}
|
||||
});
|
||||
const route = { sync: syncCurrentRoute };
|
||||
for (const key in _route.value) {
|
||||
Object.defineProperty(route, key, {
|
||||
get: () => _route.value[key],
|
||||
enumerable: true
|
||||
});
|
||||
}
|
||||
nuxtApp._route = shallowReactive(route);
|
||||
nuxtApp._middleware ||= {
|
||||
global: [],
|
||||
named: {}
|
||||
};
|
||||
const error = /* @__PURE__ */ useError();
|
||||
if (!nuxtApp.ssrContext?.islandContext) {
|
||||
router.afterEach(async (to, _from, failure) => {
|
||||
delete nuxtApp._processingMiddleware;
|
||||
if (failure) {
|
||||
await nuxtApp.callHook("page:loading:end");
|
||||
}
|
||||
if (failure?.type === 4) {
|
||||
return;
|
||||
}
|
||||
if (to.redirectedFrom && to.fullPath !== initialURL) {
|
||||
await nuxtApp.runWithContext(() => navigateTo(to.fullPath || "/"));
|
||||
}
|
||||
});
|
||||
}
|
||||
try {
|
||||
if (true) {
|
||||
;
|
||||
[__temp, __restore] = executeAsync(() => router.push(initialURL)), await __temp, __restore();
|
||||
;
|
||||
}
|
||||
;
|
||||
[__temp, __restore] = executeAsync(() => router.isReady()), await __temp, __restore();
|
||||
;
|
||||
} catch (error2) {
|
||||
[__temp, __restore] = executeAsync(() => nuxtApp.runWithContext(() => showError(error2))), await __temp, __restore();
|
||||
}
|
||||
const resolvedInitialRoute = router.currentRoute.value;
|
||||
syncCurrentRoute();
|
||||
if (nuxtApp.ssrContext?.islandContext) {
|
||||
return { provide: { router } };
|
||||
}
|
||||
const initialLayout = nuxtApp.payload.state._layout;
|
||||
router.beforeEach(async (to, from) => {
|
||||
await nuxtApp.callHook("page:loading:start");
|
||||
to.meta = reactive(to.meta);
|
||||
if (nuxtApp.isHydrating && initialLayout && !isReadonly(to.meta.layout)) {
|
||||
to.meta.layout = initialLayout;
|
||||
}
|
||||
nuxtApp._processingMiddleware = true;
|
||||
if (!nuxtApp.ssrContext?.islandContext) {
|
||||
const middlewareEntries = /* @__PURE__ */ new Set([...globalMiddleware, ...nuxtApp._middleware.global]);
|
||||
for (const component of to.matched) {
|
||||
const componentMiddleware = component.meta.middleware;
|
||||
if (!componentMiddleware) {
|
||||
continue;
|
||||
}
|
||||
for (const entry2 of toArray(componentMiddleware)) {
|
||||
middlewareEntries.add(entry2);
|
||||
}
|
||||
}
|
||||
const routeRules = getRouteRules({ path: to.path });
|
||||
if (routeRules.appMiddleware) {
|
||||
for (const key in routeRules.appMiddleware) {
|
||||
if (routeRules.appMiddleware[key]) {
|
||||
middlewareEntries.add(key);
|
||||
} else {
|
||||
middlewareEntries.delete(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const entry2 of middlewareEntries) {
|
||||
const middleware = typeof entry2 === "string" ? nuxtApp._middleware.named[entry2] || await namedMiddleware[entry2]?.().then((r) => r.default || r) : entry2;
|
||||
if (!middleware) {
|
||||
throw new Error(`Unknown route middleware: '${entry2}'.`);
|
||||
}
|
||||
try {
|
||||
if (false) ;
|
||||
const result = await nuxtApp.runWithContext(() => middleware(to, from));
|
||||
if (true) {
|
||||
if (result === false || result instanceof Error) {
|
||||
const error2 = result || createError({
|
||||
status: 404,
|
||||
statusText: `Page Not Found: ${initialURL}`
|
||||
});
|
||||
await nuxtApp.runWithContext(() => showError(error2));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (result === true) {
|
||||
continue;
|
||||
}
|
||||
if (result === false) {
|
||||
return result;
|
||||
}
|
||||
if (result) {
|
||||
if (isNuxtError(result) && result.fatal) {
|
||||
await nuxtApp.runWithContext(() => showError(result));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
} catch (err) {
|
||||
const error2 = createError(err);
|
||||
if (error2.fatal) {
|
||||
await nuxtApp.runWithContext(() => showError(error2));
|
||||
}
|
||||
return error2;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
router.onError(async () => {
|
||||
delete nuxtApp._processingMiddleware;
|
||||
await nuxtApp.callHook("page:loading:end");
|
||||
});
|
||||
router.afterEach((to) => {
|
||||
if (to.matched.length === 0 && !error.value) {
|
||||
return nuxtApp.runWithContext(() => showError(createError({
|
||||
status: 404,
|
||||
fatal: false,
|
||||
statusText: `Page not found: ${to.fullPath}`,
|
||||
data: {
|
||||
path: to.fullPath
|
||||
}
|
||||
})));
|
||||
}
|
||||
});
|
||||
nuxtApp.hooks.hookOnce("app:created", async () => {
|
||||
try {
|
||||
if ("name" in resolvedInitialRoute) {
|
||||
resolvedInitialRoute.name = void 0;
|
||||
}
|
||||
await router.replace({
|
||||
...resolvedInitialRoute,
|
||||
force: true
|
||||
});
|
||||
router.options.scrollBehavior = routerOptions.scrollBehavior;
|
||||
} catch (error2) {
|
||||
await nuxtApp.runWithContext(() => showError(error2));
|
||||
}
|
||||
});
|
||||
return { provide: { router } };
|
||||
}
|
||||
});
|
||||
function definePayloadReducer(name, reduce) {
|
||||
{
|
||||
useNuxtApp().ssrContext["~payloadReducers"][name] = reduce;
|
||||
}
|
||||
}
|
||||
const reducers = [
|
||||
["NuxtError", (data) => isNuxtError(data) && data.toJSON()],
|
||||
["EmptyShallowRef", (data) => isRef(data) && isShallow(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
|
||||
["EmptyRef", (data) => isRef(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
|
||||
["ShallowRef", (data) => isRef(data) && isShallow(data) && data.value],
|
||||
["ShallowReactive", (data) => isReactive(data) && isShallow(data) && toRaw(data)],
|
||||
["Ref", (data) => isRef(data) && data.value],
|
||||
["Reactive", (data) => isReactive(data) && toRaw(data)]
|
||||
];
|
||||
const revive_payload_server_MVtmlZaQpj6ApFmshWfUWl5PehCebzaBf2NuRMiIbms = /* @__PURE__ */ defineNuxtPlugin({
|
||||
name: "nuxt:revive-payload:server",
|
||||
setup() {
|
||||
for (const [reducer, fn] of reducers) {
|
||||
definePayloadReducer(reducer, fn);
|
||||
}
|
||||
}
|
||||
});
|
||||
const components_plugin_4kY4pyzJIYX99vmMAAIorFf3CnAaptHitJgf7JxiED8 = /* @__PURE__ */ defineNuxtPlugin({
|
||||
name: "nuxt:global-components"
|
||||
});
|
||||
const plugins = [
|
||||
unhead_k2P3m_ZDyjlr2mMYnoDPwavjsDN8hBlk9cFai0bbopU,
|
||||
plugin,
|
||||
revive_payload_server_MVtmlZaQpj6ApFmshWfUWl5PehCebzaBf2NuRMiIbms,
|
||||
components_plugin_4kY4pyzJIYX99vmMAAIorFf3CnAaptHitJgf7JxiED8
|
||||
];
|
||||
const defineRouteProvider = (name = "RouteProvider") => defineComponent({
|
||||
name,
|
||||
props: {
|
||||
route: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
vnode: Object,
|
||||
vnodeRef: Object,
|
||||
renderKey: String,
|
||||
trackRootNodes: Boolean
|
||||
},
|
||||
setup(props) {
|
||||
const previousKey = props.renderKey;
|
||||
const previousRoute = props.route;
|
||||
const route = {};
|
||||
for (const key in props.route) {
|
||||
Object.defineProperty(route, key, {
|
||||
get: () => previousKey === props.renderKey ? props.route[key] : previousRoute[key],
|
||||
enumerable: true
|
||||
});
|
||||
}
|
||||
provide(PageRouteSymbol, shallowReactive(route));
|
||||
return () => {
|
||||
if (!props.vnode) {
|
||||
return props.vnode;
|
||||
}
|
||||
return h(props.vnode, { ref: props.vnodeRef });
|
||||
};
|
||||
}
|
||||
});
|
||||
const RouteProvider = defineRouteProvider();
|
||||
const __nuxt_component_0 = defineComponent({
|
||||
name: "NuxtPage",
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
name: {
|
||||
type: String
|
||||
},
|
||||
transition: {
|
||||
type: [Boolean, Object],
|
||||
default: void 0
|
||||
},
|
||||
keepalive: {
|
||||
type: [Boolean, Object],
|
||||
default: void 0
|
||||
},
|
||||
route: {
|
||||
type: Object
|
||||
},
|
||||
pageKey: {
|
||||
type: [Function, String],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
setup(props, { attrs, slots, expose }) {
|
||||
const nuxtApp = useNuxtApp();
|
||||
const pageRef = ref();
|
||||
inject(PageRouteSymbol, null);
|
||||
expose({ pageRef });
|
||||
inject(LayoutMetaSymbol, null);
|
||||
nuxtApp.deferHydration();
|
||||
return () => {
|
||||
return h(RouterView, { name: props.name, route: props.route, ...attrs }, {
|
||||
default: (routeProps) => {
|
||||
return h(Suspense, { suspensible: true }, {
|
||||
default() {
|
||||
return h(RouteProvider, {
|
||||
vnode: slots.default ? normalizeSlot(slots.default, routeProps) : routeProps.Component,
|
||||
route: routeProps.route,
|
||||
vnodeRef: pageRef
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
function normalizeSlot(slot, data) {
|
||||
const slotContent = slot(data);
|
||||
return slotContent.length === 1 ? h(slotContent[0]) : h(Fragment, void 0, slotContent);
|
||||
}
|
||||
const _export_sfc = (sfc, props) => {
|
||||
const target = sfc.__vccOpts || sfc;
|
||||
for (const [key, val] of props) {
|
||||
target[key] = val;
|
||||
}
|
||||
return target;
|
||||
};
|
||||
const _sfc_main$2 = {};
|
||||
function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
|
||||
const _component_NuxtPage = __nuxt_component_0;
|
||||
_push(ssrRenderComponent(_component_NuxtPage, _attrs, null, _parent));
|
||||
}
|
||||
const _sfc_setup$2 = _sfc_main$2.setup;
|
||||
_sfc_main$2.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("app.vue");
|
||||
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
||||
};
|
||||
const AppComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender]]);
|
||||
const _sfc_main$1 = {
|
||||
__name: "nuxt-error-page",
|
||||
__ssrInlineRender: true,
|
||||
props: {
|
||||
error: Object
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const _error = props.error;
|
||||
const status = Number(_error.statusCode || 500);
|
||||
const is404 = status === 404;
|
||||
const statusText = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
|
||||
const description = _error.message || _error.toString();
|
||||
const stack = void 0;
|
||||
const _Error404 = defineAsyncComponent(() => import('./error-404-BY_x-_oz.mjs'));
|
||||
const _Error = defineAsyncComponent(() => import('./error-500-B0qDQUop.mjs'));
|
||||
const ErrorTemplate = is404 ? _Error404 : _Error;
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
_push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ status: unref(status), statusText: unref(statusText), statusCode: unref(status), statusMessage: unref(statusText), description: unref(description), stack: unref(stack) }, _attrs), null, _parent));
|
||||
};
|
||||
}
|
||||
};
|
||||
const _sfc_setup$1 = _sfc_main$1.setup;
|
||||
_sfc_main$1.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/nuxt/dist/app/components/nuxt-error-page.vue");
|
||||
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
||||
};
|
||||
const _sfc_main = {
|
||||
__name: "nuxt-root",
|
||||
__ssrInlineRender: true,
|
||||
setup(__props) {
|
||||
const IslandRenderer = () => null;
|
||||
const nuxtApp = useNuxtApp();
|
||||
nuxtApp.deferHydration();
|
||||
nuxtApp.ssrContext.url;
|
||||
const SingleRenderer = false;
|
||||
provide(PageRouteSymbol, useRoute());
|
||||
nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup");
|
||||
const error = /* @__PURE__ */ useError();
|
||||
const abortRender = error.value && !nuxtApp.ssrContext.error;
|
||||
onErrorCaptured((err, target, info) => {
|
||||
nuxtApp.hooks.callHook("vue:error", err, target, info).catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
|
||||
{
|
||||
const p = nuxtApp.runWithContext(() => showError(err));
|
||||
onServerPrefetch(() => p);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
const islandContext = nuxtApp.ssrContext.islandContext;
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
ssrRenderSuspense(_push, {
|
||||
default: () => {
|
||||
if (unref(abortRender)) {
|
||||
_push(`<div></div>`);
|
||||
} else if (unref(error)) {
|
||||
_push(ssrRenderComponent(unref(_sfc_main$1), { error: unref(error) }, null, _parent));
|
||||
} else if (unref(islandContext)) {
|
||||
_push(ssrRenderComponent(unref(IslandRenderer), { context: unref(islandContext) }, null, _parent));
|
||||
} else if (unref(SingleRenderer)) {
|
||||
ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(SingleRenderer)), null, null), _parent);
|
||||
} else {
|
||||
_push(ssrRenderComponent(unref(AppComponent), null, null, _parent));
|
||||
}
|
||||
},
|
||||
_: 1
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const _sfc_setup = _sfc_main.setup;
|
||||
_sfc_main.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/nuxt/dist/app/components/nuxt-root.vue");
|
||||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
||||
};
|
||||
let entry;
|
||||
{
|
||||
entry = async function createNuxtAppServer(ssrContext) {
|
||||
const vueApp = createApp(_sfc_main);
|
||||
const nuxt = createNuxtApp({ vueApp, ssrContext });
|
||||
try {
|
||||
await applyPlugins(nuxt, plugins);
|
||||
await nuxt.hooks.callHook("app:created", vueApp);
|
||||
} catch (error) {
|
||||
await nuxt.hooks.callHook("app:error", error);
|
||||
nuxt.payload.error ||= createError(error);
|
||||
}
|
||||
if (ssrContext && (ssrContext["~renderResponse"] || ssrContext._renderResponse)) {
|
||||
throw new Error("skipping render");
|
||||
}
|
||||
return vueApp;
|
||||
};
|
||||
}
|
||||
const entry_default = ((ssrContext) => entry(ssrContext));
|
||||
|
||||
export { _export_sfc as _, useNuxtApp as a, useRuntimeConfig as b, nuxtLinkDefaults as c, entry_default as default, encodeRoutePath as e, navigateTo as n, resolveRouteObject as r, useRouter as u };
|
||||
//# sourceMappingURL=server.mjs.map
|
||||
1
.output/server/chunks/build/server.mjs.map
Normal file
1
.output/server/chunks/build/server.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"server.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/server.mjs"],"names":[],"mappings":"","x_google_ignoreList":[0]}
|
||||
10
.output/server/chunks/build/styles.mjs
Normal file
10
.output/server/chunks/build/styles.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
const interopDefault = r => r.default || r || [];
|
||||
const styles = {
|
||||
"../node_modules/nuxt/dist/app/components/error-404.vue": () => import('./error-404-styles.DuDrf-v0.mjs').then(interopDefault),
|
||||
"../node_modules/nuxt/dist/app/components/error-500.vue": () => import('./error-500-styles.8IYEHzz6.mjs').then(interopDefault),
|
||||
"../node_modules/nuxt/dist/app/components/error-404.vue?vue&type=style&index=0&scoped=204d37bf&lang.css": () => import('./error-404-styles.DuDrf-v0.mjs').then(interopDefault),
|
||||
"../node_modules/nuxt/dist/app/components/error-500.vue?vue&type=style&index=0&scoped=d349100d&lang.css": () => import('./error-500-styles.8IYEHzz6.mjs').then(interopDefault)
|
||||
};
|
||||
|
||||
export { styles as default };
|
||||
//# sourceMappingURL=styles.mjs.map
|
||||
1
.output/server/chunks/build/styles.mjs.map
Normal file
1
.output/server/chunks/build/styles.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"styles.mjs","sources":["../../../../node_modules/.cache/nuxt/.nuxt/dist/server/styles.mjs"],"names":[],"mappings":"","x_google_ignoreList":[0]}
|
||||
5481
.output/server/chunks/nitro/nitro.mjs
Normal file
5481
.output/server/chunks/nitro/nitro.mjs
Normal file
File diff suppressed because one or more lines are too long
1
.output/server/chunks/nitro/nitro.mjs.map
Normal file
1
.output/server/chunks/nitro/nitro.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"nitro.mjs","sources":["../../../../node_modules/destr/dist/index.mjs","../../../../node_modules/ufo/dist/index.mjs","../../../../node_modules/radix3/dist/index.mjs","../../../../node_modules/defu/dist/defu.mjs","../../../../node_modules/node-mock-http/dist/index.mjs","../../../../node_modules/h3/dist/index.mjs","../../../../node_modules/hookable/dist/index.mjs","../../../../node_modules/node-fetch-native/dist/native.mjs","../../../../node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../node_modules/ofetch/dist/node.mjs","../../../../node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../node_modules/unstorage/dist/index.mjs","../../../../node_modules/unstorage/drivers/utils/index.mjs","../../../../node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../node_modules/unstorage/drivers/fs-lite.mjs","../../../../node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../node_modules/ohash/dist/crypto/node/index.mjs","../../../../node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../node_modules/klona/dist/index.mjs","../../../../node_modules/scule/dist/index.mjs","../../../../node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../node_modules/unctx/dist/index.mjs","../../../../node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/error.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/handlers/error.mjs","../../../../node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs","../../../../node_modules/nitropack/dist/runtime/internal/static.mjs","../../../../server/middleware/rateLimit.ts","../../../../node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../node_modules/nitropack/dist/runtime/internal/renderer.mjs","../../../../node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["getQuery","createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","dirname","fsPromises","resolve","fsp","_inlineAppConfig","createRadixRouter","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38]}
|
||||
19
.output/server/chunks/routes/api/v1/index.get.mjs
Normal file
19
.output/server/chunks/routes/api/v1/index.get.mjs
Normal file
@@ -0,0 +1,19 @@
|
||||
import { d as defineEventHandler, s as setHeader } from '../../../nitro/nitro.mjs';
|
||||
import { a as getAllRates } from '../../../_/vatRates.mjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'node:url';
|
||||
|
||||
const index_get = defineEventHandler(async (event) => {
|
||||
const rates = await getAllRates();
|
||||
setHeader(event, "Cache-Control", "public, max-age=3600");
|
||||
return rates;
|
||||
});
|
||||
|
||||
export { index_get as default };
|
||||
//# sourceMappingURL=index.get.mjs.map
|
||||
1
.output/server/chunks/routes/api/v1/index.get.mjs.map
Normal file
1
.output/server/chunks/routes/api/v1/index.get.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.get.mjs","sources":["../../../../../../server/api/v1/rates/index.get.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,kBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,MAAA,KAAA,GAAA,MAAA,WAAA,EAAA;AACA,EAAA,SAAA,CAAA,KAAA,EAAA,iBAAA,sBAAA,CAAA;AACA,EAAA,OAAA,KAAA;AACA,CAAA,CAAA;;;;"}
|
||||
24
.output/server/chunks/routes/api/v1/rates/_code_.get.mjs
Normal file
24
.output/server/chunks/routes/api/v1/rates/_code_.get.mjs
Normal file
@@ -0,0 +1,24 @@
|
||||
import { d as defineEventHandler, g as getRouterParam, c as createError, s as setHeader } from '../../../../nitro/nitro.mjs';
|
||||
import { g as getRateByCode } from '../../../../_/vatRates.mjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'node:url';
|
||||
|
||||
const _code__get = defineEventHandler(async (event) => {
|
||||
var _a;
|
||||
const code = (_a = getRouterParam(event, "code")) != null ? _a : "";
|
||||
const rate = await getRateByCode(code);
|
||||
if (!rate) {
|
||||
throw createError({ statusCode: 404, statusMessage: "Country not found", data: { error: "Country not found" } });
|
||||
}
|
||||
setHeader(event, "Cache-Control", "public, max-age=3600");
|
||||
return rate;
|
||||
});
|
||||
|
||||
export { _code__get as default };
|
||||
//# sourceMappingURL=_code_.get.mjs.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_code_.get.mjs","sources":["../../../../../../../server/api/v1/rates/[code].get.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;;AACA,EAAA,MAAA,IAAA,GAAA,CAAA,EAAA,GAAA,cAAA,CAAA,KAAA,EAAA,MAAA,MAAA,IAAA,GAAA,EAAA,GAAA,EAAA;AACA,EAAA,MAAA,IAAA,GAAA,MAAA,aAAA,CAAA,IAAA,CAAA;AAEA,EAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA,EAAA,UAAA,EAAA,GAAA,EAAA,aAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,mBAAA,EAAA,EAAA,CAAA;AAAA,EACA;AAEA,EAAA,SAAA,CAAA,KAAA,EAAA,iBAAA,sBAAA,CAAA;AACA,EAAA,OAAA,IAAA;AACA,CAAA,CAAA;;;;"}
|
||||
499
.output/server/chunks/routes/renderer.mjs
Normal file
499
.output/server/chunks/routes/renderer.mjs
Normal file
@@ -0,0 +1,499 @@
|
||||
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'vue-bundle-renderer/runtime';
|
||||
import { j as joinRelativeURL, u as useRuntimeConfig, a as getResponseStatusText, b as getResponseStatus, e as defineRenderHandler, f as getQuery, c as createError, h as destr, i as getRouteRules, k as joinURL, l as useNitroApp } from '../nitro/nitro.mjs';
|
||||
import { renderToString } from 'vue/server-renderer';
|
||||
import { createHead as createHead$1, propsToString, renderSSRHead } from 'unhead/server';
|
||||
import { stringify, uneval } from 'devalue';
|
||||
import { walkResolver } from 'unhead/utils';
|
||||
import { isRef, toValue, hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
||||
|
||||
const VueResolver = (_, value) => {
|
||||
return isRef(value) ? toValue(value) : value;
|
||||
};
|
||||
|
||||
const headSymbol = "usehead";
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function vueInstall(head) {
|
||||
const plugin = {
|
||||
install(app) {
|
||||
app.config.globalProperties.$unhead = head;
|
||||
app.config.globalProperties.$head = head;
|
||||
app.provide(headSymbol, head);
|
||||
}
|
||||
};
|
||||
return plugin.install;
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function injectHead() {
|
||||
if (hasInjectionContext()) {
|
||||
const instance = inject(headSymbol);
|
||||
if (instance) {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
||||
}
|
||||
function useHead(input, options = {}) {
|
||||
const head = options.head || /* @__PURE__ */ injectHead();
|
||||
return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options);
|
||||
}
|
||||
function clientUseHead(head, input, options = {}) {
|
||||
const deactivated = ref(false);
|
||||
let entry;
|
||||
watchEffect(() => {
|
||||
const i = deactivated.value ? {} : walkResolver(input, VueResolver);
|
||||
if (entry) {
|
||||
entry.patch(i);
|
||||
} else {
|
||||
entry = head.push(i, options);
|
||||
}
|
||||
});
|
||||
const vm = getCurrentInstance();
|
||||
if (vm) {
|
||||
onBeforeUnmount(() => {
|
||||
entry.dispose();
|
||||
});
|
||||
onDeactivated(() => {
|
||||
deactivated.value = true;
|
||||
});
|
||||
onActivated(() => {
|
||||
deactivated.value = false;
|
||||
});
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createHead(options = {}) {
|
||||
const head = createHead$1({
|
||||
...options,
|
||||
propResolvers: [VueResolver]
|
||||
});
|
||||
head.install = vueInstall(head);
|
||||
return head;
|
||||
}
|
||||
|
||||
const NUXT_RUNTIME_PAYLOAD_EXTRACTION = false;
|
||||
|
||||
const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"}],"link":[{"rel":"icon","type":"image/svg+xml","href":"/favicon.svg"}],"style":[],"script":[],"noscript":[],"htmlAttrs":{"lang":"en"}};
|
||||
|
||||
const appRootTag = "div";
|
||||
|
||||
const appRootAttrs = {"id":"__nuxt"};
|
||||
|
||||
const appTeleportTag = "div";
|
||||
|
||||
const appTeleportAttrs = {"id":"teleports"};
|
||||
|
||||
const appSpaLoaderTag = "div";
|
||||
|
||||
const appSpaLoaderAttrs = {"id":"__nuxt-loader"};
|
||||
|
||||
const appId = "nuxt-app";
|
||||
|
||||
function baseURL() {
|
||||
// TODO: support passing event to `useRuntimeConfig`
|
||||
return useRuntimeConfig().app.baseURL;
|
||||
}
|
||||
function buildAssetsDir() {
|
||||
// TODO: support passing event to `useRuntimeConfig`
|
||||
return useRuntimeConfig().app.buildAssetsDir;
|
||||
}
|
||||
function buildAssetsURL(...path) {
|
||||
return joinRelativeURL(publicAssetsURL(), buildAssetsDir(), ...path);
|
||||
}
|
||||
function publicAssetsURL(...path) {
|
||||
// TODO: support passing event to `useRuntimeConfig`
|
||||
const app = useRuntimeConfig().app;
|
||||
const publicBase = app.cdnURL || app.baseURL;
|
||||
return path.length ? joinRelativeURL(publicBase, ...path) : publicBase;
|
||||
}
|
||||
|
||||
const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
|
||||
const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
|
||||
// @ts-expect-error file will be produced after app build
|
||||
const getServerEntry = () => import('../build/server.mjs').then((r) => r.default || r);
|
||||
// @ts-expect-error file will be produced after app build
|
||||
const getPrecomputedDependencies = () => import('../build/client.precomputed.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
||||
// -- SSR Renderer --
|
||||
const getSSRRenderer = lazyCachedFunction(async () => {
|
||||
// Load server bundle
|
||||
const createSSRApp = await getServerEntry();
|
||||
if (!createSSRApp) {
|
||||
throw new Error("Server bundle is not available");
|
||||
}
|
||||
// Load precomputed dependencies
|
||||
const precomputed = await getPrecomputedDependencies();
|
||||
// Create renderer
|
||||
const renderer = createRenderer(createSSRApp, {
|
||||
precomputed,
|
||||
manifest: undefined,
|
||||
renderToString: renderToString$1,
|
||||
buildAssetsURL
|
||||
});
|
||||
async function renderToString$1(input, context) {
|
||||
const html = await renderToString(input, context);
|
||||
return APP_ROOT_OPEN_TAG + html + APP_ROOT_CLOSE_TAG;
|
||||
}
|
||||
return renderer;
|
||||
});
|
||||
// -- SPA Renderer --
|
||||
const getSPARenderer = lazyCachedFunction(async () => {
|
||||
const precomputed = await getPrecomputedDependencies();
|
||||
// @ts-expect-error virtual file
|
||||
const spaTemplate = await import('../virtual/_virtual_spa-template.mjs').then((r) => r.template).catch(() => "").then((r) => {
|
||||
{
|
||||
const APP_SPA_LOADER_OPEN_TAG = `<${appSpaLoaderTag}${propsToString(appSpaLoaderAttrs)}>`;
|
||||
const APP_SPA_LOADER_CLOSE_TAG = `</${appSpaLoaderTag}>`;
|
||||
const appTemplate = APP_ROOT_OPEN_TAG + APP_ROOT_CLOSE_TAG;
|
||||
const loaderTemplate = r ? APP_SPA_LOADER_OPEN_TAG + r + APP_SPA_LOADER_CLOSE_TAG : "";
|
||||
return appTemplate + loaderTemplate;
|
||||
}
|
||||
});
|
||||
// Create SPA renderer and cache the result for all requests
|
||||
const renderer = createRenderer(() => () => {}, {
|
||||
precomputed,
|
||||
manifest: undefined,
|
||||
renderToString: () => spaTemplate,
|
||||
buildAssetsURL
|
||||
});
|
||||
const result = await renderer.renderToString({});
|
||||
const renderToString = (ssrContext) => {
|
||||
const config = useRuntimeConfig(ssrContext.event);
|
||||
ssrContext.modules ||= new Set();
|
||||
ssrContext.payload.serverRendered = false;
|
||||
ssrContext.config = {
|
||||
public: config.public,
|
||||
app: config.app
|
||||
};
|
||||
return Promise.resolve(result);
|
||||
};
|
||||
return {
|
||||
rendererContext: renderer.rendererContext,
|
||||
renderToString
|
||||
};
|
||||
});
|
||||
function lazyCachedFunction(fn) {
|
||||
let res = null;
|
||||
return () => {
|
||||
if (res === null) {
|
||||
res = fn().catch((err) => {
|
||||
res = null;
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
return res;
|
||||
};
|
||||
}
|
||||
function getRenderer(ssrContext) {
|
||||
return ssrContext.noSSR ? getSPARenderer() : getSSRRenderer();
|
||||
}
|
||||
// @ts-expect-error file will be produced after app build
|
||||
const getSSRStyles = lazyCachedFunction(() => import('../build/styles.mjs').then((r) => r.default || r));
|
||||
|
||||
function renderPayloadResponse(ssrContext) {
|
||||
return {
|
||||
body: stringify(splitPayload(ssrContext).payload, ssrContext["~payloadReducers"]) ,
|
||||
statusCode: getResponseStatus(ssrContext.event),
|
||||
statusMessage: getResponseStatusText(ssrContext.event),
|
||||
headers: {
|
||||
"content-type": "application/json;charset=utf-8" ,
|
||||
"x-powered-by": "Nuxt"
|
||||
}
|
||||
};
|
||||
}
|
||||
function renderPayloadJsonScript(opts) {
|
||||
const contents = opts.data ? stringify(opts.data, opts.ssrContext["~payloadReducers"]) : "";
|
||||
const payload = {
|
||||
"type": "application/json",
|
||||
"innerHTML": contents,
|
||||
"data-nuxt-data": appId,
|
||||
"data-ssr": !(opts.ssrContext.noSSR)
|
||||
};
|
||||
{
|
||||
payload.id = "__NUXT_DATA__";
|
||||
}
|
||||
if (opts.src) {
|
||||
payload["data-src"] = opts.src;
|
||||
}
|
||||
const config = uneval(opts.ssrContext.config);
|
||||
return [payload, { innerHTML: `window.__NUXT__={};window.__NUXT__.config=${config}` }];
|
||||
}
|
||||
function splitPayload(ssrContext) {
|
||||
const { data, prerenderedAt, ...initial } = ssrContext.payload;
|
||||
return {
|
||||
initial: {
|
||||
...initial,
|
||||
prerenderedAt
|
||||
},
|
||||
payload: {
|
||||
data,
|
||||
prerenderedAt
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const unheadOptions = {
|
||||
disableDefaults: true,
|
||||
};
|
||||
|
||||
function createSSRContext(event) {
|
||||
const ssrContext = {
|
||||
url: event.path,
|
||||
event,
|
||||
runtimeConfig: useRuntimeConfig(event),
|
||||
noSSR: event.context.nuxt?.noSSR || (false),
|
||||
head: createHead(unheadOptions),
|
||||
error: false,
|
||||
nuxt: undefined,
|
||||
payload: {},
|
||||
["~payloadReducers"]: Object.create(null),
|
||||
modules: new Set()
|
||||
};
|
||||
return ssrContext;
|
||||
}
|
||||
function setSSRError(ssrContext, error) {
|
||||
ssrContext.error = true;
|
||||
ssrContext.payload = { error };
|
||||
ssrContext.url = error.url;
|
||||
}
|
||||
|
||||
async function renderInlineStyles(usedModules) {
|
||||
const styleMap = await getSSRStyles();
|
||||
const inlinedStyles = new Set();
|
||||
for (const mod of usedModules) {
|
||||
if (mod in styleMap && styleMap[mod]) {
|
||||
for (const style of await styleMap[mod]()) {
|
||||
inlinedStyles.add(style);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Array.from(inlinedStyles).map((style) => ({ innerHTML: style }));
|
||||
}
|
||||
|
||||
const renderSSRHeadOptions = {"omitLineBreaks":true};
|
||||
|
||||
const entryIds = [];
|
||||
|
||||
// @ts-expect-error private property consumed by vite-generated url helpers
|
||||
globalThis.__buildAssetsURL = buildAssetsURL;
|
||||
// @ts-expect-error private property consumed by vite-generated url helpers
|
||||
globalThis.__publicAssetsURL = publicAssetsURL;
|
||||
const HAS_APP_TELEPORTS = !!(appTeleportAttrs.id);
|
||||
const APP_TELEPORT_OPEN_TAG = HAS_APP_TELEPORTS ? `<${appTeleportTag}${propsToString(appTeleportAttrs)}>` : "";
|
||||
const APP_TELEPORT_CLOSE_TAG = HAS_APP_TELEPORTS ? `</${appTeleportTag}>` : "";
|
||||
const PAYLOAD_URL_RE = /^[^?]*\/_payload.json(?:\?.*)?$/ ;
|
||||
const PAYLOAD_FILENAME = "_payload.json" ;
|
||||
const renderer = defineRenderHandler(async (event) => {
|
||||
const nitroApp = useNitroApp();
|
||||
// Whether we're rendering an error page
|
||||
const ssrError = event.path.startsWith("/__nuxt_error") ? getQuery(event) : null;
|
||||
if (ssrError && !("__unenv__" in event.node.req)) {
|
||||
throw createError({
|
||||
status: 404,
|
||||
statusText: "Page Not Found: /__nuxt_error",
|
||||
message: "Page Not Found: /__nuxt_error"
|
||||
});
|
||||
}
|
||||
// Initialize ssr context
|
||||
const ssrContext = createSSRContext(event);
|
||||
// needed for hash hydration plugin to work
|
||||
const headEntryOptions = { mode: "server" };
|
||||
ssrContext.head.push(appHead, headEntryOptions);
|
||||
if (ssrError) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||
const status = ssrError.status || ssrError.statusCode;
|
||||
if (status) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||
ssrError.status = ssrError.statusCode = Number.parseInt(status);
|
||||
}
|
||||
if (typeof ssrError.data === "string") {
|
||||
try {
|
||||
ssrError.data = destr(ssrError.data);
|
||||
} catch {}
|
||||
}
|
||||
setSSRError(ssrContext, ssrError);
|
||||
}
|
||||
// Get route options (for `ssr: false`, `isr`, `cache` and `noScripts`)
|
||||
const routeOptions = getRouteRules(event);
|
||||
// Whether we are prerendering route or using ISR/SWR caching
|
||||
const _PAYLOAD_EXTRACTION = !ssrContext.noSSR && (NUXT_RUNTIME_PAYLOAD_EXTRACTION);
|
||||
const isRenderingPayload = (_PAYLOAD_EXTRACTION || false) && PAYLOAD_URL_RE.test(ssrContext.url);
|
||||
if (isRenderingPayload) {
|
||||
const url = ssrContext.url.substring(0, ssrContext.url.lastIndexOf("/")) || "/";
|
||||
ssrContext.url = url;
|
||||
event._path = event.node.req.url = url;
|
||||
}
|
||||
if (routeOptions.ssr === false) {
|
||||
ssrContext.noSSR = true;
|
||||
}
|
||||
const payloadURL = _PAYLOAD_EXTRACTION ? joinURL(ssrContext.runtimeConfig.app.cdnURL || ssrContext.runtimeConfig.app.baseURL, ssrContext.url.replace(/\?.*$/, ""), PAYLOAD_FILENAME) + "?" + ssrContext.runtimeConfig.app.buildId : undefined;
|
||||
// Render app
|
||||
const renderer = await getRenderer(ssrContext);
|
||||
{
|
||||
for (const id of entryIds) {
|
||||
ssrContext.modules.add(id);
|
||||
}
|
||||
}
|
||||
const _rendered = await renderer.renderToString(ssrContext).catch(async (error) => {
|
||||
// We use error to bypass full render if we have an early response we can make
|
||||
// TODO: remove _renderResponse in nuxt v5
|
||||
if ((ssrContext["~renderResponse"] || ssrContext._renderResponse) && error.message === "skipping render") {
|
||||
return {};
|
||||
}
|
||||
// Use explicitly thrown error in preference to subsequent rendering errors
|
||||
const _err = !ssrError && ssrContext.payload?.error || error;
|
||||
await ssrContext.nuxt?.hooks.callHook("app:error", _err);
|
||||
throw _err;
|
||||
});
|
||||
// Render inline styles
|
||||
// TODO: remove _renderResponse in nuxt v5
|
||||
const inlinedStyles = !ssrContext["~renderResponse"] && !ssrContext._renderResponse && !isRenderingPayload ? await renderInlineStyles(ssrContext.modules ?? []) : [];
|
||||
await ssrContext.nuxt?.hooks.callHook("app:rendered", {
|
||||
ssrContext,
|
||||
renderResult: _rendered
|
||||
});
|
||||
if (ssrContext["~renderResponse"] || ssrContext._renderResponse) {
|
||||
// TODO: remove _renderResponse in nuxt v5
|
||||
return ssrContext["~renderResponse"] || ssrContext._renderResponse;
|
||||
}
|
||||
// Handle errors
|
||||
if (ssrContext.payload?.error && !ssrError) {
|
||||
throw ssrContext.payload.error;
|
||||
}
|
||||
// Directly render payload routes
|
||||
if (isRenderingPayload) {
|
||||
const response = renderPayloadResponse(ssrContext);
|
||||
return response;
|
||||
}
|
||||
const NO_SCRIPTS = routeOptions.noScripts;
|
||||
// Setup head
|
||||
const { styles, scripts } = getRequestDependencies(ssrContext, renderer.rendererContext);
|
||||
// 1. Preload payloads and app manifest
|
||||
if (_PAYLOAD_EXTRACTION && !NO_SCRIPTS) {
|
||||
ssrContext.head.push({ link: [{
|
||||
rel: "preload",
|
||||
as: "fetch",
|
||||
crossorigin: "anonymous",
|
||||
href: payloadURL
|
||||
} ] }, headEntryOptions);
|
||||
}
|
||||
if (ssrContext["~preloadManifest"] && !NO_SCRIPTS) {
|
||||
ssrContext.head.push({ link: [{
|
||||
rel: "preload",
|
||||
as: "fetch",
|
||||
fetchpriority: "low",
|
||||
crossorigin: "anonymous",
|
||||
href: buildAssetsURL(`builds/meta/${ssrContext.runtimeConfig.app.buildId}.json`)
|
||||
}] }, {
|
||||
...headEntryOptions,
|
||||
tagPriority: "low"
|
||||
});
|
||||
}
|
||||
// 2. Styles
|
||||
if (inlinedStyles.length) {
|
||||
ssrContext.head.push({ style: inlinedStyles });
|
||||
}
|
||||
const link = [];
|
||||
for (const resource of Object.values(styles)) {
|
||||
// Add CSS links in <head> for CSS files
|
||||
// - in production
|
||||
// - in dev mode when not rendering an island
|
||||
link.push({
|
||||
rel: "stylesheet",
|
||||
href: renderer.rendererContext.buildAssetsURL(resource.file),
|
||||
crossorigin: ""
|
||||
});
|
||||
}
|
||||
if (link.length) {
|
||||
ssrContext.head.push({ link }, headEntryOptions);
|
||||
}
|
||||
if (!NO_SCRIPTS) {
|
||||
// 4. Resource Hints
|
||||
// Remove lazy hydrated modules from ssrContext.modules so they don't get preloaded
|
||||
// (CSS links are already added above, this only affects JS preloads)
|
||||
if (ssrContext["~lazyHydratedModules"]) {
|
||||
for (const id of ssrContext["~lazyHydratedModules"]) {
|
||||
ssrContext.modules?.delete(id);
|
||||
}
|
||||
}
|
||||
ssrContext.head.push({ link: getPreloadLinks(ssrContext, renderer.rendererContext) }, headEntryOptions);
|
||||
ssrContext.head.push({ link: getPrefetchLinks(ssrContext, renderer.rendererContext) }, headEntryOptions);
|
||||
// 5. Payloads
|
||||
ssrContext.head.push({ script: _PAYLOAD_EXTRACTION ? renderPayloadJsonScript({
|
||||
ssrContext,
|
||||
data: splitPayload(ssrContext).initial,
|
||||
src: payloadURL
|
||||
}) : renderPayloadJsonScript({
|
||||
ssrContext,
|
||||
data: ssrContext.payload
|
||||
}) }, {
|
||||
...headEntryOptions,
|
||||
tagPosition: "bodyClose",
|
||||
tagPriority: "high"
|
||||
});
|
||||
}
|
||||
// 6. Scripts
|
||||
if (!routeOptions.noScripts) {
|
||||
const tagPosition = "head";
|
||||
ssrContext.head.push({ script: Object.values(scripts).map((resource) => ({
|
||||
type: resource.module ? "module" : null,
|
||||
src: renderer.rendererContext.buildAssetsURL(resource.file),
|
||||
defer: resource.module ? null : true,
|
||||
tagPosition,
|
||||
crossorigin: ""
|
||||
})) }, headEntryOptions);
|
||||
}
|
||||
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(ssrContext.head, renderSSRHeadOptions);
|
||||
// Create render context
|
||||
const htmlContext = {
|
||||
htmlAttrs: htmlAttrs ? [htmlAttrs] : [],
|
||||
head: normalizeChunks([headTags]),
|
||||
bodyAttrs: bodyAttrs ? [bodyAttrs] : [],
|
||||
bodyPrepend: normalizeChunks([bodyTagsOpen, ssrContext.teleports?.body]),
|
||||
body: [_rendered.html, APP_TELEPORT_OPEN_TAG + (HAS_APP_TELEPORTS ? joinTags([ssrContext.teleports?.[`#${appTeleportAttrs.id}`]]) : "") + APP_TELEPORT_CLOSE_TAG],
|
||||
bodyAppend: [bodyTags]
|
||||
};
|
||||
// Allow hooking into the rendered result
|
||||
await nitroApp.hooks.callHook("render:html", htmlContext, { event });
|
||||
// Construct HTML response
|
||||
return {
|
||||
body: renderHTMLDocument(htmlContext),
|
||||
statusCode: getResponseStatus(event),
|
||||
statusMessage: getResponseStatusText(event),
|
||||
headers: {
|
||||
"content-type": "text/html;charset=utf-8",
|
||||
"x-powered-by": "Nuxt"
|
||||
}
|
||||
};
|
||||
});
|
||||
function normalizeChunks(chunks) {
|
||||
const result = [];
|
||||
for (const _chunk of chunks) {
|
||||
const chunk = _chunk?.trim();
|
||||
if (chunk) {
|
||||
result.push(chunk);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function joinTags(tags) {
|
||||
return tags.join("");
|
||||
}
|
||||
function joinAttrs(chunks) {
|
||||
if (chunks.length === 0) {
|
||||
return "";
|
||||
}
|
||||
return " " + chunks.join(" ");
|
||||
}
|
||||
function renderHTMLDocument(html) {
|
||||
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>";
|
||||
}
|
||||
|
||||
const renderer$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
||||
__proto__: null,
|
||||
default: renderer
|
||||
}, Symbol.toStringTag, { value: 'Module' }));
|
||||
|
||||
export { baseURL as b, headSymbol as h, renderer$1 as r, useHead as u };
|
||||
//# sourceMappingURL=renderer.mjs.map
|
||||
1
.output/server/chunks/routes/renderer.mjs.map
Normal file
1
.output/server/chunks/routes/renderer.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"renderer.mjs","sources":["../../../../node_modules/@unhead/vue/dist/shared/vue.N9zWjxoK.mjs","../../../../node_modules/@unhead/vue/dist/shared/vue.Cr7xSEtD.mjs","../../../../node_modules/@unhead/vue/dist/server.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/paths.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/renderer/build-files.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/renderer/payload.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/renderer/app.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/renderer/inline-styles.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/handlers/renderer.mjs"],"names":["renderToString","_renderToString"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
||||
4
.output/server/chunks/virtual/_virtual_spa-template.mjs
Normal file
4
.output/server/chunks/virtual/_virtual_spa-template.mjs
Normal file
@@ -0,0 +1,4 @@
|
||||
const template = "";
|
||||
|
||||
export { template };
|
||||
//# sourceMappingURL=_virtual_spa-template.mjs.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_virtual_spa-template.mjs","sources":[],"names":[],"mappings":";;;;"}
|
||||
10
.output/server/index.mjs
Normal file
10
.output/server/index.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import 'node:http';
|
||||
import 'node:https';
|
||||
export { C as default } from './chunks/nitro/nitro.mjs';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'node:url';
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
.output/server/index.mjs.map
Normal file
1
.output/server/index.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":";;;;;;;;"}
|
||||
14582
.output/server/node_modules/@babel/parser/lib/index.js
generated
vendored
Normal file
14582
.output/server/node_modules/@babel/parser/lib/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
50
.output/server/node_modules/@babel/parser/package.json
generated
vendored
Normal file
50
.output/server/node_modules/@babel/parser/package.json
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.29.0",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-parser",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
"javascript",
|
||||
"parser",
|
||||
"tc39",
|
||||
"ecmascript",
|
||||
"@babel/parser"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-parser"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"types": "./typings/babel-parser.d.ts",
|
||||
"files": [
|
||||
"bin",
|
||||
"lib",
|
||||
"typings/babel-parser.d.ts",
|
||||
"index.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"# dependencies": "This package doesn't actually have runtime dependencies. @babel/types is only needed for type definitions.",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.29.0",
|
||||
"@babel/helper-check-duplicate-nodes": "^7.28.6",
|
||||
"@babel/helper-fixtures": "^7.28.6",
|
||||
"@babel/helper-string-parser": "^7.27.1",
|
||||
"@babel/helper-validator-identifier": "^7.28.5",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"bin": "./bin/babel-parser.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
6763
.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js
generated
vendored
Normal file
6763
.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
58
.output/server/node_modules/@vue/compiler-core/package.json
generated
vendored
Normal file
58
.output/server/node_modules/@vue/compiler-core/package.json
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "@vue/compiler-core",
|
||||
"version": "3.5.28",
|
||||
"description": "@vue/compiler-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/compiler-core.esm-bundler.js",
|
||||
"types": "dist/compiler-core.d.ts",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/compiler-core.d.ts",
|
||||
"node": {
|
||||
"production": "./dist/compiler-core.cjs.prod.js",
|
||||
"development": "./dist/compiler-core.cjs.js",
|
||||
"default": "./dist/compiler-core.cjs.prod.js"
|
||||
},
|
||||
"module": "./dist/compiler-core.esm-bundler.js",
|
||||
"import": "./dist/compiler-core.esm-bundler.js",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "VueCompilerCore",
|
||||
"compat": true,
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/core.git",
|
||||
"directory": "packages/compiler-core"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/core/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.29.0",
|
||||
"entities": "^7.0.1",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.2.1",
|
||||
"@vue/shared": "3.5.28"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/types": "^7.29.0"
|
||||
}
|
||||
}
|
||||
689
.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js
generated
vendored
Normal file
689
.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js
generated
vendored
Normal file
@@ -0,0 +1,689 @@
|
||||
/**
|
||||
* @vue/compiler-dom v3.5.28
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var compilerCore = require('@vue/compiler-core');
|
||||
var shared = require('@vue/shared');
|
||||
|
||||
const V_MODEL_RADIO = /* @__PURE__ */ Symbol(``);
|
||||
const V_MODEL_CHECKBOX = /* @__PURE__ */ Symbol(
|
||||
``
|
||||
);
|
||||
const V_MODEL_TEXT = /* @__PURE__ */ Symbol(``);
|
||||
const V_MODEL_SELECT = /* @__PURE__ */ Symbol(
|
||||
``
|
||||
);
|
||||
const V_MODEL_DYNAMIC = /* @__PURE__ */ Symbol(
|
||||
``
|
||||
);
|
||||
const V_ON_WITH_MODIFIERS = /* @__PURE__ */ Symbol(
|
||||
``
|
||||
);
|
||||
const V_ON_WITH_KEYS = /* @__PURE__ */ Symbol(
|
||||
``
|
||||
);
|
||||
const V_SHOW = /* @__PURE__ */ Symbol(``);
|
||||
const TRANSITION = /* @__PURE__ */ Symbol(``);
|
||||
const TRANSITION_GROUP = /* @__PURE__ */ Symbol(
|
||||
``
|
||||
);
|
||||
compilerCore.registerRuntimeHelpers({
|
||||
[V_MODEL_RADIO]: `vModelRadio`,
|
||||
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
|
||||
[V_MODEL_TEXT]: `vModelText`,
|
||||
[V_MODEL_SELECT]: `vModelSelect`,
|
||||
[V_MODEL_DYNAMIC]: `vModelDynamic`,
|
||||
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
||||
[V_ON_WITH_KEYS]: `withKeys`,
|
||||
[V_SHOW]: `vShow`,
|
||||
[TRANSITION]: `Transition`,
|
||||
[TRANSITION_GROUP]: `TransitionGroup`
|
||||
});
|
||||
|
||||
const parserOptions = {
|
||||
parseMode: "html",
|
||||
isVoidTag: shared.isVoidTag,
|
||||
isNativeTag: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag),
|
||||
isPreTag: (tag) => tag === "pre",
|
||||
isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
|
||||
decodeEntities: void 0,
|
||||
isBuiltInComponent: (tag) => {
|
||||
if (tag === "Transition" || tag === "transition") {
|
||||
return TRANSITION;
|
||||
} else if (tag === "TransitionGroup" || tag === "transition-group") {
|
||||
return TRANSITION_GROUP;
|
||||
}
|
||||
},
|
||||
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
|
||||
getNamespace(tag, parent, rootNamespace) {
|
||||
let ns = parent ? parent.ns : rootNamespace;
|
||||
if (parent && ns === 2) {
|
||||
if (parent.tag === "annotation-xml") {
|
||||
if (tag === "svg") {
|
||||
return 1;
|
||||
}
|
||||
if (parent.props.some(
|
||||
(a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
|
||||
)) {
|
||||
ns = 0;
|
||||
}
|
||||
} else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
|
||||
ns = 0;
|
||||
}
|
||||
} else if (parent && ns === 1) {
|
||||
if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
|
||||
ns = 0;
|
||||
}
|
||||
}
|
||||
if (ns === 0) {
|
||||
if (tag === "svg") {
|
||||
return 1;
|
||||
}
|
||||
if (tag === "math") {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return ns;
|
||||
}
|
||||
};
|
||||
|
||||
const transformStyle = (node) => {
|
||||
if (node.type === 1) {
|
||||
node.props.forEach((p, i) => {
|
||||
if (p.type === 6 && p.name === "style" && p.value) {
|
||||
node.props[i] = {
|
||||
type: 7,
|
||||
name: `bind`,
|
||||
arg: compilerCore.createSimpleExpression(`style`, true, p.loc),
|
||||
exp: parseInlineCSS(p.value.content, p.loc),
|
||||
modifiers: [],
|
||||
loc: p.loc
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const parseInlineCSS = (cssText, loc) => {
|
||||
const normalized = shared.parseStringStyle(cssText);
|
||||
return compilerCore.createSimpleExpression(
|
||||
JSON.stringify(normalized),
|
||||
false,
|
||||
loc,
|
||||
3
|
||||
);
|
||||
};
|
||||
|
||||
function createDOMCompilerError(code, loc) {
|
||||
return compilerCore.createCompilerError(
|
||||
code,
|
||||
loc,
|
||||
DOMErrorMessages
|
||||
);
|
||||
}
|
||||
const DOMErrorCodes = {
|
||||
"X_V_HTML_NO_EXPRESSION": 54,
|
||||
"54": "X_V_HTML_NO_EXPRESSION",
|
||||
"X_V_HTML_WITH_CHILDREN": 55,
|
||||
"55": "X_V_HTML_WITH_CHILDREN",
|
||||
"X_V_TEXT_NO_EXPRESSION": 56,
|
||||
"56": "X_V_TEXT_NO_EXPRESSION",
|
||||
"X_V_TEXT_WITH_CHILDREN": 57,
|
||||
"57": "X_V_TEXT_WITH_CHILDREN",
|
||||
"X_V_MODEL_ON_INVALID_ELEMENT": 58,
|
||||
"58": "X_V_MODEL_ON_INVALID_ELEMENT",
|
||||
"X_V_MODEL_ARG_ON_ELEMENT": 59,
|
||||
"59": "X_V_MODEL_ARG_ON_ELEMENT",
|
||||
"X_V_MODEL_ON_FILE_INPUT_ELEMENT": 60,
|
||||
"60": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
|
||||
"X_V_MODEL_UNNECESSARY_VALUE": 61,
|
||||
"61": "X_V_MODEL_UNNECESSARY_VALUE",
|
||||
"X_V_SHOW_NO_EXPRESSION": 62,
|
||||
"62": "X_V_SHOW_NO_EXPRESSION",
|
||||
"X_TRANSITION_INVALID_CHILDREN": 63,
|
||||
"63": "X_TRANSITION_INVALID_CHILDREN",
|
||||
"X_IGNORED_SIDE_EFFECT_TAG": 64,
|
||||
"64": "X_IGNORED_SIDE_EFFECT_TAG",
|
||||
"__EXTEND_POINT__": 65,
|
||||
"65": "__EXTEND_POINT__"
|
||||
};
|
||||
const DOMErrorMessages = {
|
||||
[54]: `v-html is missing expression.`,
|
||||
[55]: `v-html will override element children.`,
|
||||
[56]: `v-text is missing expression.`,
|
||||
[57]: `v-text will override element children.`,
|
||||
[58]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
||||
[59]: `v-model argument is not supported on plain elements.`,
|
||||
[60]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
||||
[61]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
||||
[62]: `v-show is missing expression.`,
|
||||
[63]: `<Transition> expects exactly one child element or component.`,
|
||||
[64]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
||||
};
|
||||
|
||||
const transformVHtml = (dir, node, context) => {
|
||||
const { exp, loc } = dir;
|
||||
if (!exp) {
|
||||
context.onError(
|
||||
createDOMCompilerError(54, loc)
|
||||
);
|
||||
}
|
||||
if (node.children.length) {
|
||||
context.onError(
|
||||
createDOMCompilerError(55, loc)
|
||||
);
|
||||
node.children.length = 0;
|
||||
}
|
||||
return {
|
||||
props: [
|
||||
compilerCore.createObjectProperty(
|
||||
compilerCore.createSimpleExpression(`innerHTML`, true, loc),
|
||||
exp || compilerCore.createSimpleExpression("", true)
|
||||
)
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
const transformVText = (dir, node, context) => {
|
||||
const { exp, loc } = dir;
|
||||
if (!exp) {
|
||||
context.onError(
|
||||
createDOMCompilerError(56, loc)
|
||||
);
|
||||
}
|
||||
if (node.children.length) {
|
||||
context.onError(
|
||||
createDOMCompilerError(57, loc)
|
||||
);
|
||||
node.children.length = 0;
|
||||
}
|
||||
return {
|
||||
props: [
|
||||
compilerCore.createObjectProperty(
|
||||
compilerCore.createSimpleExpression(`textContent`, true),
|
||||
exp ? compilerCore.getConstantType(exp, context) > 0 ? exp : compilerCore.createCallExpression(
|
||||
context.helperString(compilerCore.TO_DISPLAY_STRING),
|
||||
[exp],
|
||||
loc
|
||||
) : compilerCore.createSimpleExpression("", true)
|
||||
)
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
const transformModel = (dir, node, context) => {
|
||||
const baseResult = compilerCore.transformModel(dir, node, context);
|
||||
if (!baseResult.props.length || node.tagType === 1) {
|
||||
return baseResult;
|
||||
}
|
||||
if (dir.arg) {
|
||||
context.onError(
|
||||
createDOMCompilerError(
|
||||
59,
|
||||
dir.arg.loc
|
||||
)
|
||||
);
|
||||
}
|
||||
const { tag } = node;
|
||||
const isCustomElement = context.isCustomElement(tag);
|
||||
if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
|
||||
let directiveToUse = V_MODEL_TEXT;
|
||||
let isInvalidType = false;
|
||||
if (tag === "input" || isCustomElement) {
|
||||
const type = compilerCore.findProp(node, `type`);
|
||||
if (type) {
|
||||
if (type.type === 7) {
|
||||
directiveToUse = V_MODEL_DYNAMIC;
|
||||
} else if (type.value) {
|
||||
switch (type.value.content) {
|
||||
case "radio":
|
||||
directiveToUse = V_MODEL_RADIO;
|
||||
break;
|
||||
case "checkbox":
|
||||
directiveToUse = V_MODEL_CHECKBOX;
|
||||
break;
|
||||
case "file":
|
||||
isInvalidType = true;
|
||||
context.onError(
|
||||
createDOMCompilerError(
|
||||
60,
|
||||
dir.loc
|
||||
)
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (compilerCore.hasDynamicKeyVBind(node)) {
|
||||
directiveToUse = V_MODEL_DYNAMIC;
|
||||
} else ;
|
||||
} else if (tag === "select") {
|
||||
directiveToUse = V_MODEL_SELECT;
|
||||
} else ;
|
||||
if (!isInvalidType) {
|
||||
baseResult.needRuntime = context.helper(directiveToUse);
|
||||
}
|
||||
} else {
|
||||
context.onError(
|
||||
createDOMCompilerError(
|
||||
58,
|
||||
dir.loc
|
||||
)
|
||||
);
|
||||
}
|
||||
baseResult.props = baseResult.props.filter(
|
||||
(p) => !(p.key.type === 4 && p.key.content === "modelValue")
|
||||
);
|
||||
return baseResult;
|
||||
};
|
||||
|
||||
const isEventOptionModifier = /* @__PURE__ */ shared.makeMap(`passive,once,capture`);
|
||||
const isNonKeyModifier = /* @__PURE__ */ shared.makeMap(
|
||||
// event propagation management
|
||||
`stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
|
||||
);
|
||||
const maybeKeyModifier = /* @__PURE__ */ shared.makeMap("left,right");
|
||||
const isKeyboardEvent = /* @__PURE__ */ shared.makeMap(`onkeyup,onkeydown,onkeypress`);
|
||||
const resolveModifiers = (key, modifiers, context, loc) => {
|
||||
const keyModifiers = [];
|
||||
const nonKeyModifiers = [];
|
||||
const eventOptionModifiers = [];
|
||||
for (let i = 0; i < modifiers.length; i++) {
|
||||
const modifier = modifiers[i].content;
|
||||
if (modifier === "native" && compilerCore.checkCompatEnabled(
|
||||
"COMPILER_V_ON_NATIVE",
|
||||
context,
|
||||
loc
|
||||
)) {
|
||||
eventOptionModifiers.push(modifier);
|
||||
} else if (isEventOptionModifier(modifier)) {
|
||||
eventOptionModifiers.push(modifier);
|
||||
} else {
|
||||
if (maybeKeyModifier(modifier)) {
|
||||
if (compilerCore.isStaticExp(key)) {
|
||||
if (isKeyboardEvent(key.content.toLowerCase())) {
|
||||
keyModifiers.push(modifier);
|
||||
} else {
|
||||
nonKeyModifiers.push(modifier);
|
||||
}
|
||||
} else {
|
||||
keyModifiers.push(modifier);
|
||||
nonKeyModifiers.push(modifier);
|
||||
}
|
||||
} else {
|
||||
if (isNonKeyModifier(modifier)) {
|
||||
nonKeyModifiers.push(modifier);
|
||||
} else {
|
||||
keyModifiers.push(modifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
keyModifiers,
|
||||
nonKeyModifiers,
|
||||
eventOptionModifiers
|
||||
};
|
||||
};
|
||||
const transformClick = (key, event) => {
|
||||
const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === "onclick";
|
||||
return isStaticClick ? compilerCore.createSimpleExpression(event, true) : key.type !== 4 ? compilerCore.createCompoundExpression([
|
||||
`(`,
|
||||
key,
|
||||
`) === "onClick" ? "${event}" : (`,
|
||||
key,
|
||||
`)`
|
||||
]) : key;
|
||||
};
|
||||
const transformOn = (dir, node, context) => {
|
||||
return compilerCore.transformOn(dir, node, context, (baseResult) => {
|
||||
const { modifiers } = dir;
|
||||
if (!modifiers.length) return baseResult;
|
||||
let { key, value: handlerExp } = baseResult.props[0];
|
||||
const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
|
||||
if (nonKeyModifiers.includes("right")) {
|
||||
key = transformClick(key, `onContextmenu`);
|
||||
}
|
||||
if (nonKeyModifiers.includes("middle")) {
|
||||
key = transformClick(key, `onMouseup`);
|
||||
}
|
||||
if (nonKeyModifiers.length) {
|
||||
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
|
||||
handlerExp,
|
||||
JSON.stringify(nonKeyModifiers)
|
||||
]);
|
||||
}
|
||||
if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
|
||||
(!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) {
|
||||
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [
|
||||
handlerExp,
|
||||
JSON.stringify(keyModifiers)
|
||||
]);
|
||||
}
|
||||
if (eventOptionModifiers.length) {
|
||||
const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join("");
|
||||
key = compilerCore.isStaticExp(key) ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true) : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
|
||||
}
|
||||
return {
|
||||
props: [compilerCore.createObjectProperty(key, handlerExp)]
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const transformShow = (dir, node, context) => {
|
||||
const { exp, loc } = dir;
|
||||
if (!exp) {
|
||||
context.onError(
|
||||
createDOMCompilerError(62, loc)
|
||||
);
|
||||
}
|
||||
return {
|
||||
props: [],
|
||||
needRuntime: context.helper(V_SHOW)
|
||||
};
|
||||
};
|
||||
|
||||
const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
|
||||
const stringifyStatic = (children, context, parent) => {
|
||||
if (context.scopes.vSlot > 0) {
|
||||
return;
|
||||
}
|
||||
const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 20;
|
||||
let nc = 0;
|
||||
let ec = 0;
|
||||
const currentChunk = [];
|
||||
const stringifyCurrentChunk = (currentIndex) => {
|
||||
if (nc >= 20 || ec >= 5) {
|
||||
const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [
|
||||
JSON.stringify(
|
||||
currentChunk.map((node) => stringifyNode(node, context)).join("")
|
||||
).replace(expReplaceRE, `" + $1 + "`),
|
||||
// the 2nd argument indicates the number of DOM nodes this static vnode
|
||||
// will insert / hydrate
|
||||
String(currentChunk.length)
|
||||
]);
|
||||
const deleteCount = currentChunk.length - 1;
|
||||
if (isParentCached) {
|
||||
children.splice(
|
||||
currentIndex - currentChunk.length,
|
||||
currentChunk.length,
|
||||
// @ts-expect-error
|
||||
staticCall
|
||||
);
|
||||
} else {
|
||||
currentChunk[0].codegenNode.value = staticCall;
|
||||
if (currentChunk.length > 1) {
|
||||
children.splice(currentIndex - currentChunk.length + 1, deleteCount);
|
||||
const cacheIndex = context.cached.indexOf(
|
||||
currentChunk[currentChunk.length - 1].codegenNode
|
||||
);
|
||||
if (cacheIndex > -1) {
|
||||
for (let i2 = cacheIndex; i2 < context.cached.length; i2++) {
|
||||
const c = context.cached[i2];
|
||||
if (c) c.index -= deleteCount;
|
||||
}
|
||||
context.cached.splice(cacheIndex - deleteCount + 1, deleteCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
return deleteCount;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
let i = 0;
|
||||
for (; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
const isCached = isParentCached || getCachedNode(child);
|
||||
if (isCached) {
|
||||
const result = analyzeNode(child);
|
||||
if (result) {
|
||||
nc += result[0];
|
||||
ec += result[1];
|
||||
currentChunk.push(child);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
i -= stringifyCurrentChunk(i);
|
||||
nc = 0;
|
||||
ec = 0;
|
||||
currentChunk.length = 0;
|
||||
}
|
||||
stringifyCurrentChunk(i);
|
||||
};
|
||||
const getCachedNode = (node) => {
|
||||
if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) {
|
||||
return node.codegenNode;
|
||||
}
|
||||
};
|
||||
const dataAriaRE = /^(?:data|aria)-/;
|
||||
const isStringifiableAttr = (name, ns) => {
|
||||
return (ns === 0 ? shared.isKnownHtmlAttr(name) : ns === 1 ? shared.isKnownSvgAttr(name) : ns === 2 ? shared.isKnownMathMLAttr(name) : false) || dataAriaRE.test(name);
|
||||
};
|
||||
const isNonStringifiable = /* @__PURE__ */ shared.makeMap(
|
||||
`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`
|
||||
);
|
||||
function analyzeNode(node) {
|
||||
if (node.type === 1 && isNonStringifiable(node.tag)) {
|
||||
return false;
|
||||
}
|
||||
if (node.type === 1 && compilerCore.findDir(node, "once", true)) {
|
||||
return false;
|
||||
}
|
||||
if (node.type === 12) {
|
||||
return [1, 0];
|
||||
}
|
||||
let nc = 1;
|
||||
let ec = node.props.length > 0 ? 1 : 0;
|
||||
let bailed = false;
|
||||
const bail = () => {
|
||||
bailed = true;
|
||||
return false;
|
||||
};
|
||||
function walk(node2) {
|
||||
const isOptionTag = node2.tag === "option" && node2.ns === 0;
|
||||
for (let i = 0; i < node2.props.length; i++) {
|
||||
const p = node2.props[i];
|
||||
if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) {
|
||||
return bail();
|
||||
}
|
||||
if (p.type === 7 && p.name === "bind") {
|
||||
if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) {
|
||||
return bail();
|
||||
}
|
||||
if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
|
||||
return bail();
|
||||
}
|
||||
if (isOptionTag && compilerCore.isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) {
|
||||
return bail();
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < node2.children.length; i++) {
|
||||
nc++;
|
||||
const child = node2.children[i];
|
||||
if (child.type === 1) {
|
||||
if (child.props.length > 0) {
|
||||
ec++;
|
||||
}
|
||||
walk(child);
|
||||
if (bailed) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return walk(node) ? [nc, ec] : false;
|
||||
}
|
||||
function stringifyNode(node, context) {
|
||||
if (shared.isString(node)) {
|
||||
return node;
|
||||
}
|
||||
if (shared.isSymbol(node)) {
|
||||
return ``;
|
||||
}
|
||||
switch (node.type) {
|
||||
case 1:
|
||||
return stringifyElement(node, context);
|
||||
case 2:
|
||||
return shared.escapeHtml(node.content);
|
||||
case 3:
|
||||
return `<!--${shared.escapeHtml(node.content)}-->`;
|
||||
case 5:
|
||||
return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content)));
|
||||
case 8:
|
||||
return shared.escapeHtml(evaluateConstant(node));
|
||||
case 12:
|
||||
return stringifyNode(node.content, context);
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
function stringifyElement(node, context) {
|
||||
let res = `<${node.tag}`;
|
||||
let innerHTML = "";
|
||||
for (let i = 0; i < node.props.length; i++) {
|
||||
const p = node.props[i];
|
||||
if (p.type === 6) {
|
||||
res += ` ${p.name}`;
|
||||
if (p.value) {
|
||||
res += `="${shared.escapeHtml(p.value.content)}"`;
|
||||
}
|
||||
} else if (p.type === 7) {
|
||||
if (p.name === "bind") {
|
||||
const exp = p.exp;
|
||||
if (exp.content[0] === "_") {
|
||||
res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
|
||||
continue;
|
||||
}
|
||||
if (shared.isBooleanAttr(p.arg.content) && exp.content === "false") {
|
||||
continue;
|
||||
}
|
||||
let evaluated = evaluateConstant(exp);
|
||||
if (evaluated != null) {
|
||||
const arg = p.arg && p.arg.content;
|
||||
if (arg === "class") {
|
||||
evaluated = shared.normalizeClass(evaluated);
|
||||
} else if (arg === "style") {
|
||||
evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated));
|
||||
}
|
||||
res += ` ${p.arg.content}="${shared.escapeHtml(
|
||||
evaluated
|
||||
)}"`;
|
||||
}
|
||||
} else if (p.name === "html") {
|
||||
innerHTML = evaluateConstant(p.exp);
|
||||
} else if (p.name === "text") {
|
||||
innerHTML = shared.escapeHtml(
|
||||
shared.toDisplayString(evaluateConstant(p.exp))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (context.scopeId) {
|
||||
res += ` ${context.scopeId}`;
|
||||
}
|
||||
res += `>`;
|
||||
if (innerHTML) {
|
||||
res += innerHTML;
|
||||
} else {
|
||||
for (let i = 0; i < node.children.length; i++) {
|
||||
res += stringifyNode(node.children[i], context);
|
||||
}
|
||||
}
|
||||
if (!shared.isVoidTag(node.tag)) {
|
||||
res += `</${node.tag}>`;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
function evaluateConstant(exp) {
|
||||
if (exp.type === 4) {
|
||||
return new Function(`return (${exp.content})`)();
|
||||
} else {
|
||||
let res = ``;
|
||||
exp.children.forEach((c) => {
|
||||
if (shared.isString(c) || shared.isSymbol(c)) {
|
||||
return;
|
||||
}
|
||||
if (c.type === 2) {
|
||||
res += c.content;
|
||||
} else if (c.type === 5) {
|
||||
res += shared.toDisplayString(evaluateConstant(c.content));
|
||||
} else {
|
||||
res += evaluateConstant(c);
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
const ignoreSideEffectTags = (node, context) => {
|
||||
if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
|
||||
context.removeNode();
|
||||
}
|
||||
};
|
||||
|
||||
const DOMNodeTransforms = [
|
||||
transformStyle,
|
||||
...[]
|
||||
];
|
||||
const DOMDirectiveTransforms = {
|
||||
cloak: compilerCore.noopDirectiveTransform,
|
||||
html: transformVHtml,
|
||||
text: transformVText,
|
||||
model: transformModel,
|
||||
// override compiler-core
|
||||
on: transformOn,
|
||||
// override compiler-core
|
||||
show: transformShow
|
||||
};
|
||||
function compile(src, options = {}) {
|
||||
return compilerCore.baseCompile(
|
||||
src,
|
||||
shared.extend({}, parserOptions, options, {
|
||||
nodeTransforms: [
|
||||
// ignore <script> and <tag>
|
||||
// this is not put inside DOMNodeTransforms because that list is used
|
||||
// by compiler-ssr to generate vnode fallback branches
|
||||
ignoreSideEffectTags,
|
||||
...DOMNodeTransforms,
|
||||
...options.nodeTransforms || []
|
||||
],
|
||||
directiveTransforms: shared.extend(
|
||||
{},
|
||||
DOMDirectiveTransforms,
|
||||
options.directiveTransforms || {}
|
||||
),
|
||||
transformHoist: stringifyStatic
|
||||
})
|
||||
);
|
||||
}
|
||||
function parse(template, options = {}) {
|
||||
return compilerCore.baseParse(template, shared.extend({}, parserOptions, options));
|
||||
}
|
||||
|
||||
exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
|
||||
exports.DOMErrorCodes = DOMErrorCodes;
|
||||
exports.DOMErrorMessages = DOMErrorMessages;
|
||||
exports.DOMNodeTransforms = DOMNodeTransforms;
|
||||
exports.TRANSITION = TRANSITION;
|
||||
exports.TRANSITION_GROUP = TRANSITION_GROUP;
|
||||
exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX;
|
||||
exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC;
|
||||
exports.V_MODEL_RADIO = V_MODEL_RADIO;
|
||||
exports.V_MODEL_SELECT = V_MODEL_SELECT;
|
||||
exports.V_MODEL_TEXT = V_MODEL_TEXT;
|
||||
exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS;
|
||||
exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS;
|
||||
exports.V_SHOW = V_SHOW;
|
||||
exports.compile = compile;
|
||||
exports.createDOMCompilerError = createDOMCompilerError;
|
||||
exports.parse = parse;
|
||||
exports.parserOptions = parserOptions;
|
||||
exports.transformStyle = transformStyle;
|
||||
Object.keys(compilerCore).forEach(function (k) {
|
||||
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = compilerCore[k];
|
||||
});
|
||||
57
.output/server/node_modules/@vue/compiler-dom/package.json
generated
vendored
Normal file
57
.output/server/node_modules/@vue/compiler-dom/package.json
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "@vue/compiler-dom",
|
||||
"version": "3.5.28",
|
||||
"description": "@vue/compiler-dom",
|
||||
"main": "index.js",
|
||||
"module": "dist/compiler-dom.esm-bundler.js",
|
||||
"types": "dist/compiler-dom.d.ts",
|
||||
"unpkg": "dist/compiler-dom.global.js",
|
||||
"jsdelivr": "dist/compiler-dom.global.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/compiler-dom.d.ts",
|
||||
"node": {
|
||||
"production": "./dist/compiler-dom.cjs.prod.js",
|
||||
"development": "./dist/compiler-dom.cjs.js",
|
||||
"default": "./dist/compiler-dom.cjs.prod.js"
|
||||
},
|
||||
"module": "./dist/compiler-dom.esm-bundler.js",
|
||||
"import": "./dist/compiler-dom.esm-bundler.js",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"buildOptions": {
|
||||
"name": "VueCompilerDOM",
|
||||
"compat": true,
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"esm-browser",
|
||||
"cjs",
|
||||
"global"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/core.git",
|
||||
"directory": "packages/compiler-dom"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/core/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-dom#readme",
|
||||
"dependencies": {
|
||||
"@vue/compiler-core": "3.5.28",
|
||||
"@vue/shared": "3.5.28"
|
||||
}
|
||||
}
|
||||
1413
.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js
generated
vendored
Normal file
1413
.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
34
.output/server/node_modules/@vue/compiler-ssr/package.json
generated
vendored
Normal file
34
.output/server/node_modules/@vue/compiler-ssr/package.json
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "@vue/compiler-ssr",
|
||||
"version": "3.5.28",
|
||||
"description": "@vue/compiler-ssr",
|
||||
"main": "dist/compiler-ssr.cjs.js",
|
||||
"types": "dist/compiler-ssr.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"buildOptions": {
|
||||
"prod": false,
|
||||
"formats": [
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/core.git",
|
||||
"directory": "packages/compiler-ssr"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/core/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-ssr#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.28",
|
||||
"@vue/compiler-dom": "3.5.28"
|
||||
}
|
||||
}
|
||||
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/api.js
generated
vendored
Normal file
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/api.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/app.js
generated
vendored
Normal file
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/app.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/component.js
generated
vendored
Normal file
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/component.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/context.js
generated
vendored
Normal file
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/context.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js
generated
vendored
Normal file
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
22
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/index.js
generated
vendored
Normal file
22
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./api.js"), exports);
|
||||
__exportStar(require("./app.js"), exports);
|
||||
__exportStar(require("./component.js"), exports);
|
||||
__exportStar(require("./context.js"), exports);
|
||||
__exportStar(require("./hooks.js"), exports);
|
||||
__exportStar(require("./util.js"), exports);
|
||||
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/util.js
generated
vendored
Normal file
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/api/util.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
5
.output/server/node_modules/@vue/devtools-api/lib/cjs/const.js
generated
vendored
Normal file
5
.output/server/node_modules/@vue/devtools-api/lib/cjs/const.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.HOOK_PLUGIN_SETTINGS_SET = exports.HOOK_SETUP = void 0;
|
||||
exports.HOOK_SETUP = 'devtools-plugin:setup';
|
||||
exports.HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set';
|
||||
17
.output/server/node_modules/@vue/devtools-api/lib/cjs/env.js
generated
vendored
Normal file
17
.output/server/node_modules/@vue/devtools-api/lib/cjs/env.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isProxyAvailable = exports.getTarget = exports.getDevtoolsGlobalHook = void 0;
|
||||
function getDevtoolsGlobalHook() {
|
||||
return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
||||
}
|
||||
exports.getDevtoolsGlobalHook = getDevtoolsGlobalHook;
|
||||
function getTarget() {
|
||||
// @ts-expect-error navigator and windows are not available in all environments
|
||||
return (typeof navigator !== 'undefined' && typeof window !== 'undefined')
|
||||
? window
|
||||
: typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: {};
|
||||
}
|
||||
exports.getTarget = getTarget;
|
||||
exports.isProxyAvailable = typeof Proxy === 'function';
|
||||
45
.output/server/node_modules/@vue/devtools-api/lib/cjs/index.js
generated
vendored
Normal file
45
.output/server/node_modules/@vue/devtools-api/lib/cjs/index.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.setupDevtoolsPlugin = void 0;
|
||||
const env_js_1 = require("./env.js");
|
||||
const const_js_1 = require("./const.js");
|
||||
const proxy_js_1 = require("./proxy.js");
|
||||
__exportStar(require("./api/index.js"), exports);
|
||||
__exportStar(require("./plugin.js"), exports);
|
||||
__exportStar(require("./time.js"), exports);
|
||||
function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
|
||||
const descriptor = pluginDescriptor;
|
||||
const target = (0, env_js_1.getTarget)();
|
||||
const hook = (0, env_js_1.getDevtoolsGlobalHook)();
|
||||
const enableProxy = env_js_1.isProxyAvailable && descriptor.enableEarlyProxy;
|
||||
if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
|
||||
hook.emit(const_js_1.HOOK_SETUP, pluginDescriptor, setupFn);
|
||||
}
|
||||
else {
|
||||
const proxy = enableProxy ? new proxy_js_1.ApiProxy(descriptor, hook) : null;
|
||||
const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
|
||||
list.push({
|
||||
pluginDescriptor: descriptor,
|
||||
setupFn,
|
||||
proxy,
|
||||
});
|
||||
if (proxy) {
|
||||
setupFn(proxy.proxiedTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.setupDevtoolsPlugin = setupDevtoolsPlugin;
|
||||
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/plugin.js
generated
vendored
Normal file
2
.output/server/node_modules/@vue/devtools-api/lib/cjs/plugin.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
111
.output/server/node_modules/@vue/devtools-api/lib/cjs/proxy.js
generated
vendored
Normal file
111
.output/server/node_modules/@vue/devtools-api/lib/cjs/proxy.js
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ApiProxy = void 0;
|
||||
const const_js_1 = require("./const.js");
|
||||
const time_js_1 = require("./time.js");
|
||||
class ApiProxy {
|
||||
constructor(plugin, hook) {
|
||||
this.target = null;
|
||||
this.targetQueue = [];
|
||||
this.onQueue = [];
|
||||
this.plugin = plugin;
|
||||
this.hook = hook;
|
||||
const defaultSettings = {};
|
||||
if (plugin.settings) {
|
||||
for (const id in plugin.settings) {
|
||||
const item = plugin.settings[id];
|
||||
defaultSettings[id] = item.defaultValue;
|
||||
}
|
||||
}
|
||||
const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
|
||||
let currentSettings = Object.assign({}, defaultSettings);
|
||||
try {
|
||||
const raw = localStorage.getItem(localSettingsSaveId);
|
||||
const data = JSON.parse(raw);
|
||||
Object.assign(currentSettings, data);
|
||||
}
|
||||
catch (e) {
|
||||
// noop
|
||||
}
|
||||
this.fallbacks = {
|
||||
getSettings() {
|
||||
return currentSettings;
|
||||
},
|
||||
setSettings(value) {
|
||||
try {
|
||||
localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
|
||||
}
|
||||
catch (e) {
|
||||
// noop
|
||||
}
|
||||
currentSettings = value;
|
||||
},
|
||||
now() {
|
||||
return (0, time_js_1.now)();
|
||||
},
|
||||
};
|
||||
if (hook) {
|
||||
hook.on(const_js_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
|
||||
if (pluginId === this.plugin.id) {
|
||||
this.fallbacks.setSettings(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.proxiedOn = new Proxy({}, {
|
||||
get: (_target, prop) => {
|
||||
if (this.target) {
|
||||
return this.target.on[prop];
|
||||
}
|
||||
else {
|
||||
return (...args) => {
|
||||
this.onQueue.push({
|
||||
method: prop,
|
||||
args,
|
||||
});
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
this.proxiedTarget = new Proxy({}, {
|
||||
get: (_target, prop) => {
|
||||
if (this.target) {
|
||||
return this.target[prop];
|
||||
}
|
||||
else if (prop === 'on') {
|
||||
return this.proxiedOn;
|
||||
}
|
||||
else if (Object.keys(this.fallbacks).includes(prop)) {
|
||||
return (...args) => {
|
||||
this.targetQueue.push({
|
||||
method: prop,
|
||||
args,
|
||||
resolve: () => { },
|
||||
});
|
||||
return this.fallbacks[prop](...args);
|
||||
};
|
||||
}
|
||||
else {
|
||||
return (...args) => {
|
||||
return new Promise((resolve) => {
|
||||
this.targetQueue.push({
|
||||
method: prop,
|
||||
args,
|
||||
resolve,
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
async setRealTarget(target) {
|
||||
this.target = target;
|
||||
for (const item of this.onQueue) {
|
||||
this.target.on[item.method](...item.args);
|
||||
}
|
||||
for (const item of this.targetQueue) {
|
||||
item.resolve(await this.target[item.method](...item.args));
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.ApiProxy = ApiProxy;
|
||||
28
.output/server/node_modules/@vue/devtools-api/lib/cjs/time.js
generated
vendored
Normal file
28
.output/server/node_modules/@vue/devtools-api/lib/cjs/time.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.now = exports.isPerformanceSupported = void 0;
|
||||
let supported;
|
||||
let perf;
|
||||
function isPerformanceSupported() {
|
||||
var _a;
|
||||
if (supported !== undefined) {
|
||||
return supported;
|
||||
}
|
||||
if (typeof window !== 'undefined' && window.performance) {
|
||||
supported = true;
|
||||
perf = window.performance;
|
||||
}
|
||||
else if (typeof globalThis !== 'undefined' && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
|
||||
supported = true;
|
||||
perf = globalThis.perf_hooks.performance;
|
||||
}
|
||||
else {
|
||||
supported = false;
|
||||
}
|
||||
return supported;
|
||||
}
|
||||
exports.isPerformanceSupported = isPerformanceSupported;
|
||||
function now() {
|
||||
return isPerformanceSupported() ? perf.now() : Date.now();
|
||||
}
|
||||
exports.now = now;
|
||||
37
.output/server/node_modules/@vue/devtools-api/package.json
generated
vendored
Normal file
37
.output/server/node_modules/@vue/devtools-api/package.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@vue/devtools-api",
|
||||
"version": "6.6.4",
|
||||
"description": "Interact with the Vue devtools from the page",
|
||||
"author": {
|
||||
"name": "Guillaume Chau"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"url": "https://github.com/vuejs/vue-devtools.git",
|
||||
"type": "git",
|
||||
"directory": "packages/api"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"main": "lib/cjs/index.js",
|
||||
"browser": "lib/esm/index.js",
|
||||
"module": "lib/esm/index.js",
|
||||
"types": "lib/esm/index.d.ts",
|
||||
"files": [
|
||||
"lib/cjs",
|
||||
"lib/esm"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rimraf lib && yarn build:esm && yarn build:cjs",
|
||||
"build:esm": "tsc --module es2015 --outDir lib/esm -d",
|
||||
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
|
||||
"build:watch": "yarn tsc --module es2015 --outDir lib/esm -d -w --sourceMap"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.11.16",
|
||||
"@types/webpack-env": "^1.15.1",
|
||||
"typescript": "^5.3.3"
|
||||
}
|
||||
}
|
||||
1870
.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js
generated
vendored
Normal file
1870
.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
55
.output/server/node_modules/@vue/reactivity/package.json
generated
vendored
Normal file
55
.output/server/node_modules/@vue/reactivity/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "@vue/reactivity",
|
||||
"version": "3.5.28",
|
||||
"description": "@vue/reactivity",
|
||||
"main": "index.js",
|
||||
"module": "dist/reactivity.esm-bundler.js",
|
||||
"types": "dist/reactivity.d.ts",
|
||||
"unpkg": "dist/reactivity.global.js",
|
||||
"jsdelivr": "dist/reactivity.global.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/reactivity.d.ts",
|
||||
"node": {
|
||||
"production": "./dist/reactivity.cjs.prod.js",
|
||||
"development": "./dist/reactivity.cjs.js",
|
||||
"default": "./dist/reactivity.cjs.prod.js"
|
||||
},
|
||||
"module": "./dist/reactivity.esm-bundler.js",
|
||||
"import": "./dist/reactivity.esm-bundler.js",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/core.git",
|
||||
"directory": "packages/reactivity"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "VueReactivity",
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"esm-browser",
|
||||
"cjs",
|
||||
"global"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/core/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.28"
|
||||
}
|
||||
}
|
||||
6798
.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js
generated
vendored
Normal file
6798
.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
52
.output/server/node_modules/@vue/runtime-core/package.json
generated
vendored
Normal file
52
.output/server/node_modules/@vue/runtime-core/package.json
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "@vue/runtime-core",
|
||||
"version": "3.5.28",
|
||||
"description": "@vue/runtime-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/runtime-core.esm-bundler.js",
|
||||
"types": "dist/runtime-core.d.ts",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/runtime-core.d.ts",
|
||||
"node": {
|
||||
"production": "./dist/runtime-core.cjs.prod.js",
|
||||
"development": "./dist/runtime-core.cjs.js",
|
||||
"default": "./dist/runtime-core.cjs.prod.js"
|
||||
},
|
||||
"module": "./dist/runtime-core.esm-bundler.js",
|
||||
"import": "./dist/runtime-core.esm-bundler.js",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "VueRuntimeCore",
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/core.git",
|
||||
"directory": "packages/runtime-core"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/core/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.28",
|
||||
"@vue/reactivity": "3.5.28"
|
||||
}
|
||||
}
|
||||
1750
.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js
generated
vendored
Normal file
1750
.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
60
.output/server/node_modules/@vue/runtime-dom/package.json
generated
vendored
Normal file
60
.output/server/node_modules/@vue/runtime-dom/package.json
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "@vue/runtime-dom",
|
||||
"version": "3.5.28",
|
||||
"description": "@vue/runtime-dom",
|
||||
"main": "index.js",
|
||||
"module": "dist/runtime-dom.esm-bundler.js",
|
||||
"types": "dist/runtime-dom.d.ts",
|
||||
"unpkg": "dist/runtime-dom.global.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/runtime-dom.d.ts",
|
||||
"node": {
|
||||
"production": "./dist/runtime-dom.cjs.prod.js",
|
||||
"development": "./dist/runtime-dom.cjs.js",
|
||||
"default": "./dist/runtime-dom.cjs.prod.js"
|
||||
},
|
||||
"module": "./dist/runtime-dom.esm-bundler.js",
|
||||
"import": "./dist/runtime-dom.esm-bundler.js",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"buildOptions": {
|
||||
"name": "VueRuntimeDOM",
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"esm-browser",
|
||||
"cjs",
|
||||
"global"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/core.git",
|
||||
"directory": "packages/runtime-dom"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/core/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-dom#readme",
|
||||
"dependencies": {
|
||||
"csstype": "^3.2.3",
|
||||
"@vue/runtime-core": "3.5.28",
|
||||
"@vue/reactivity": "3.5.28",
|
||||
"@vue/shared": "3.5.28"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/trusted-types": "^2.0.7"
|
||||
}
|
||||
}
|
||||
879
.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js
generated
vendored
Normal file
879
.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js
generated
vendored
Normal file
@@ -0,0 +1,879 @@
|
||||
/**
|
||||
* @vue/server-renderer v3.5.28
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var Vue = require('vue');
|
||||
var shared = require('@vue/shared');
|
||||
var compilerSsr = require('@vue/compiler-ssr');
|
||||
|
||||
function _interopNamespaceDefault(e) {
|
||||
var n = Object.create(null);
|
||||
if (e) {
|
||||
for (var k in e) {
|
||||
n[k] = e[k];
|
||||
}
|
||||
}
|
||||
n.default = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
|
||||
var Vue__namespace = /*#__PURE__*/_interopNamespaceDefault(Vue);
|
||||
|
||||
const shouldIgnoreProp = /* @__PURE__ */ shared.makeMap(
|
||||
`,key,ref,innerHTML,textContent,ref_key,ref_for`
|
||||
);
|
||||
function ssrRenderAttrs(props, tag) {
|
||||
let ret = "";
|
||||
for (let key in props) {
|
||||
if (shouldIgnoreProp(key) || shared.isOn(key) || tag === "textarea" && key === "value" || // force as property (not rendered in SSR)
|
||||
key.startsWith(".")) {
|
||||
continue;
|
||||
}
|
||||
const value = props[key];
|
||||
if (key.startsWith("^")) key = key.slice(1);
|
||||
if (key === "class" || key === "className") {
|
||||
ret += ` class="${ssrRenderClass(value)}"`;
|
||||
} else if (key === "style") {
|
||||
ret += ` style="${ssrRenderStyle(value)}"`;
|
||||
} else {
|
||||
ret += ssrRenderDynamicAttr(key, value, tag);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function ssrRenderDynamicAttr(key, value, tag) {
|
||||
if (!shared.isRenderableAttrValue(value)) {
|
||||
return ``;
|
||||
}
|
||||
const attrKey = tag && (tag.indexOf("-") > 0 || shared.isSVGTag(tag)) ? key : shared.propsToAttrMap[key] || key.toLowerCase();
|
||||
if (shared.isBooleanAttr(attrKey)) {
|
||||
return shared.includeBooleanAttr(value) ? ` ${attrKey}` : ``;
|
||||
} else if (shared.isSSRSafeAttrName(attrKey)) {
|
||||
return value === "" ? ` ${attrKey}` : ` ${attrKey}="${shared.escapeHtml(value)}"`;
|
||||
} else {
|
||||
console.warn(
|
||||
`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`
|
||||
);
|
||||
return ``;
|
||||
}
|
||||
}
|
||||
function ssrRenderAttr(key, value) {
|
||||
if (!shared.isRenderableAttrValue(value)) {
|
||||
return ``;
|
||||
}
|
||||
return ` ${key}="${shared.escapeHtml(value)}"`;
|
||||
}
|
||||
function ssrRenderClass(raw) {
|
||||
return shared.escapeHtml(shared.normalizeClass(raw));
|
||||
}
|
||||
function ssrRenderStyle(raw) {
|
||||
if (!raw) {
|
||||
return "";
|
||||
}
|
||||
if (shared.isString(raw)) {
|
||||
return shared.escapeHtml(raw);
|
||||
}
|
||||
const styles = shared.normalizeStyle(ssrResetCssVars(raw));
|
||||
return shared.escapeHtml(shared.stringifyStyle(styles));
|
||||
}
|
||||
function ssrResetCssVars(raw) {
|
||||
if (!shared.isArray(raw) && shared.isObject(raw)) {
|
||||
const res = {};
|
||||
for (const key in raw) {
|
||||
if (key.startsWith(":--")) {
|
||||
res[key.slice(1)] = shared.normalizeCssVarValue(raw[key]);
|
||||
} else {
|
||||
res[key] = raw[key];
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return raw;
|
||||
}
|
||||
|
||||
function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
|
||||
return renderComponentVNode(
|
||||
Vue.createVNode(comp, props, children),
|
||||
parentComponent,
|
||||
slotScopeId
|
||||
);
|
||||
}
|
||||
|
||||
const { ensureValidVNode } = Vue.ssrUtils;
|
||||
function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
|
||||
push(`<!--[-->`);
|
||||
ssrRenderSlotInner(
|
||||
slots,
|
||||
slotName,
|
||||
slotProps,
|
||||
fallbackRenderFn,
|
||||
push,
|
||||
parentComponent,
|
||||
slotScopeId
|
||||
);
|
||||
push(`<!--]-->`);
|
||||
}
|
||||
function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) {
|
||||
const slotFn = slots[slotName];
|
||||
if (slotFn) {
|
||||
const slotBuffer = [];
|
||||
const bufferedPush = (item) => {
|
||||
slotBuffer.push(item);
|
||||
};
|
||||
const ret = slotFn(
|
||||
slotProps,
|
||||
bufferedPush,
|
||||
parentComponent,
|
||||
slotScopeId ? " " + slotScopeId : ""
|
||||
);
|
||||
if (shared.isArray(ret)) {
|
||||
const validSlotContent = ensureValidVNode(ret);
|
||||
if (validSlotContent) {
|
||||
renderVNodeChildren(
|
||||
push,
|
||||
validSlotContent,
|
||||
parentComponent,
|
||||
slotScopeId
|
||||
);
|
||||
} else if (fallbackRenderFn) {
|
||||
fallbackRenderFn();
|
||||
} else if (transition) {
|
||||
push(`<!---->`);
|
||||
}
|
||||
} else {
|
||||
let isEmptySlot = true;
|
||||
if (transition) {
|
||||
isEmptySlot = false;
|
||||
} else {
|
||||
for (let i = 0; i < slotBuffer.length; i++) {
|
||||
if (!isComment(slotBuffer[i])) {
|
||||
isEmptySlot = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isEmptySlot) {
|
||||
if (fallbackRenderFn) {
|
||||
fallbackRenderFn();
|
||||
}
|
||||
} else {
|
||||
let start = 0;
|
||||
let end = slotBuffer.length;
|
||||
if (transition && slotBuffer[0] === "<!--[-->" && slotBuffer[end - 1] === "<!--]-->") {
|
||||
start++;
|
||||
end--;
|
||||
}
|
||||
if (start < end) {
|
||||
for (let i = start; i < end; i++) {
|
||||
push(slotBuffer[i]);
|
||||
}
|
||||
} else if (transition) {
|
||||
push(`<!---->`);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (fallbackRenderFn) {
|
||||
fallbackRenderFn();
|
||||
} else if (transition) {
|
||||
push(`<!---->`);
|
||||
}
|
||||
}
|
||||
const commentTestRE = /^<!--[\s\S]*-->$/;
|
||||
const commentRE = /<!--[^]*?-->/gm;
|
||||
function isComment(item) {
|
||||
if (typeof item !== "string" || !commentTestRE.test(item)) return false;
|
||||
if (item.length <= 8) return true;
|
||||
return !item.replace(commentRE, "").trim();
|
||||
}
|
||||
|
||||
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
||||
parentPush("<!--teleport start-->");
|
||||
const context = parentComponent.appContext.provides[Vue.ssrContextKey];
|
||||
const teleportBuffers = context.__teleportBuffers || (context.__teleportBuffers = {});
|
||||
const targetBuffer = teleportBuffers[target] || (teleportBuffers[target] = []);
|
||||
const bufferIndex = targetBuffer.length;
|
||||
let teleportContent;
|
||||
if (disabled) {
|
||||
contentRenderFn(parentPush);
|
||||
teleportContent = `<!--teleport start anchor--><!--teleport anchor-->`;
|
||||
} else {
|
||||
const { getBuffer, push } = createBuffer();
|
||||
push(`<!--teleport start anchor-->`);
|
||||
contentRenderFn(push);
|
||||
push(`<!--teleport anchor-->`);
|
||||
teleportContent = getBuffer();
|
||||
}
|
||||
targetBuffer.splice(bufferIndex, 0, teleportContent);
|
||||
parentPush("<!--teleport end-->");
|
||||
}
|
||||
|
||||
function ssrInterpolate(value) {
|
||||
return shared.escapeHtml(shared.toDisplayString(value));
|
||||
}
|
||||
|
||||
function ssrRenderList(source, renderItem) {
|
||||
if (shared.isArray(source) || shared.isString(source)) {
|
||||
for (let i = 0, l = source.length; i < l; i++) {
|
||||
renderItem(source[i], i);
|
||||
}
|
||||
} else if (typeof source === "number") {
|
||||
for (let i = 0; i < source; i++) {
|
||||
renderItem(i + 1, i);
|
||||
}
|
||||
} else if (shared.isObject(source)) {
|
||||
if (source[Symbol.iterator]) {
|
||||
const arr = Array.from(source);
|
||||
for (let i = 0, l = arr.length; i < l; i++) {
|
||||
renderItem(arr[i], i);
|
||||
}
|
||||
} else {
|
||||
const keys = Object.keys(source);
|
||||
for (let i = 0, l = keys.length; i < l; i++) {
|
||||
const key = keys[i];
|
||||
renderItem(source[key], key, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function ssrRenderSuspense(push, { default: renderContent }) {
|
||||
if (renderContent) {
|
||||
renderContent();
|
||||
} else {
|
||||
push(`<!---->`);
|
||||
}
|
||||
}
|
||||
|
||||
function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
|
||||
if (typeof dir !== "function" && dir.getSSRProps) {
|
||||
return dir.getSSRProps(
|
||||
{
|
||||
dir,
|
||||
instance: Vue.ssrUtils.getComponentPublicInstance(instance.$),
|
||||
value,
|
||||
oldValue: void 0,
|
||||
arg,
|
||||
modifiers
|
||||
},
|
||||
null
|
||||
) || {};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
const ssrLooseEqual = shared.looseEqual;
|
||||
function ssrLooseContain(arr, value) {
|
||||
return shared.looseIndexOf(arr, value) > -1;
|
||||
}
|
||||
function ssrRenderDynamicModel(type, model, value) {
|
||||
switch (type) {
|
||||
case "radio":
|
||||
return shared.looseEqual(model, value) ? " checked" : "";
|
||||
case "checkbox":
|
||||
return (shared.isArray(model) ? ssrLooseContain(model, value) : model) ? " checked" : "";
|
||||
default:
|
||||
return ssrRenderAttr("value", model);
|
||||
}
|
||||
}
|
||||
function ssrGetDynamicModelProps(existingProps = {}, model) {
|
||||
const { type, value } = existingProps;
|
||||
switch (type) {
|
||||
case "radio":
|
||||
return shared.looseEqual(model, value) ? { checked: true } : null;
|
||||
case "checkbox":
|
||||
return (shared.isArray(model) ? ssrLooseContain(model, value) : model) ? { checked: true } : null;
|
||||
default:
|
||||
return { value: model };
|
||||
}
|
||||
}
|
||||
|
||||
var helpers = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
ssrGetDirectiveProps: ssrGetDirectiveProps,
|
||||
ssrGetDynamicModelProps: ssrGetDynamicModelProps,
|
||||
ssrIncludeBooleanAttr: shared.includeBooleanAttr,
|
||||
ssrInterpolate: ssrInterpolate,
|
||||
ssrLooseContain: ssrLooseContain,
|
||||
ssrLooseEqual: ssrLooseEqual,
|
||||
ssrRenderAttr: ssrRenderAttr,
|
||||
ssrRenderAttrs: ssrRenderAttrs,
|
||||
ssrRenderClass: ssrRenderClass,
|
||||
ssrRenderComponent: ssrRenderComponent,
|
||||
ssrRenderDynamicAttr: ssrRenderDynamicAttr,
|
||||
ssrRenderDynamicModel: ssrRenderDynamicModel,
|
||||
ssrRenderList: ssrRenderList,
|
||||
ssrRenderSlot: ssrRenderSlot,
|
||||
ssrRenderSlotInner: ssrRenderSlotInner,
|
||||
ssrRenderStyle: ssrRenderStyle,
|
||||
ssrRenderSuspense: ssrRenderSuspense,
|
||||
ssrRenderTeleport: ssrRenderTeleport,
|
||||
ssrRenderVNode: renderVNode
|
||||
});
|
||||
|
||||
const compileCache = /* @__PURE__ */ Object.create(null);
|
||||
function ssrCompile(template, instance) {
|
||||
const Component = instance.type;
|
||||
const { isCustomElement, compilerOptions } = instance.appContext.config;
|
||||
const { delimiters, compilerOptions: componentCompilerOptions } = Component;
|
||||
const finalCompilerOptions = shared.extend(
|
||||
shared.extend(
|
||||
{
|
||||
isCustomElement,
|
||||
delimiters
|
||||
},
|
||||
compilerOptions
|
||||
),
|
||||
componentCompilerOptions
|
||||
);
|
||||
finalCompilerOptions.isCustomElement = finalCompilerOptions.isCustomElement || shared.NO;
|
||||
finalCompilerOptions.isNativeTag = finalCompilerOptions.isNativeTag || shared.NO;
|
||||
const cacheKey = JSON.stringify(
|
||||
{
|
||||
template,
|
||||
compilerOptions: finalCompilerOptions
|
||||
},
|
||||
(key, value) => {
|
||||
return shared.isFunction(value) ? value.toString() : value;
|
||||
}
|
||||
);
|
||||
const cached = compileCache[cacheKey];
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
finalCompilerOptions.onError = (err) => {
|
||||
{
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
const { code } = compilerSsr.compile(template, finalCompilerOptions);
|
||||
const requireMap = {
|
||||
vue: Vue__namespace,
|
||||
"vue/server-renderer": helpers
|
||||
};
|
||||
const fakeRequire = (id) => requireMap[id];
|
||||
return compileCache[cacheKey] = Function("require", code)(fakeRequire);
|
||||
}
|
||||
|
||||
const {
|
||||
createComponentInstance,
|
||||
setCurrentRenderingInstance,
|
||||
setupComponent,
|
||||
renderComponentRoot,
|
||||
normalizeVNode,
|
||||
pushWarningContext,
|
||||
popWarningContext
|
||||
} = Vue.ssrUtils;
|
||||
function createBuffer() {
|
||||
let appendable = false;
|
||||
const buffer = [];
|
||||
return {
|
||||
getBuffer() {
|
||||
return buffer;
|
||||
},
|
||||
push(item) {
|
||||
const isStringItem = shared.isString(item);
|
||||
if (appendable && isStringItem) {
|
||||
buffer[buffer.length - 1] += item;
|
||||
return;
|
||||
}
|
||||
buffer.push(item);
|
||||
appendable = isStringItem;
|
||||
if (shared.isPromise(item) || shared.isArray(item) && item.hasAsync) {
|
||||
buffer.hasAsync = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
|
||||
const instance = vnode.component = createComponentInstance(
|
||||
vnode,
|
||||
parentComponent,
|
||||
null
|
||||
);
|
||||
const res = setupComponent(
|
||||
instance,
|
||||
true
|
||||
/* isSSR */
|
||||
);
|
||||
const hasAsyncSetup = shared.isPromise(res);
|
||||
let prefetches = instance.sp;
|
||||
if (hasAsyncSetup || prefetches) {
|
||||
const p = Promise.resolve(res).then(() => {
|
||||
if (hasAsyncSetup) prefetches = instance.sp;
|
||||
if (prefetches) {
|
||||
return Promise.all(
|
||||
prefetches.map((prefetch) => prefetch.call(instance.proxy))
|
||||
);
|
||||
}
|
||||
}).catch(shared.NOOP);
|
||||
return p.then(() => renderComponentSubTree(instance, slotScopeId));
|
||||
} else {
|
||||
return renderComponentSubTree(instance, slotScopeId);
|
||||
}
|
||||
}
|
||||
function renderComponentSubTree(instance, slotScopeId) {
|
||||
const comp = instance.type;
|
||||
const { getBuffer, push } = createBuffer();
|
||||
if (shared.isFunction(comp)) {
|
||||
let root = renderComponentRoot(instance);
|
||||
if (!comp.props) {
|
||||
for (const key in instance.attrs) {
|
||||
if (key.startsWith(`data-v-`)) {
|
||||
(root.props || (root.props = {}))[key] = ``;
|
||||
}
|
||||
}
|
||||
}
|
||||
renderVNode(push, instance.subTree = root, instance, slotScopeId);
|
||||
} else {
|
||||
if ((!instance.render || instance.render === shared.NOOP) && !instance.ssrRender && !comp.ssrRender && shared.isString(comp.template)) {
|
||||
comp.ssrRender = ssrCompile(comp.template, instance);
|
||||
}
|
||||
const ssrRender = instance.ssrRender || comp.ssrRender;
|
||||
if (ssrRender) {
|
||||
let attrs = instance.inheritAttrs !== false ? instance.attrs : void 0;
|
||||
let hasCloned = false;
|
||||
let cur = instance;
|
||||
while (true) {
|
||||
const scopeId = cur.vnode.scopeId;
|
||||
if (scopeId) {
|
||||
if (!hasCloned) {
|
||||
attrs = { ...attrs };
|
||||
hasCloned = true;
|
||||
}
|
||||
attrs[scopeId] = "";
|
||||
}
|
||||
const parent = cur.parent;
|
||||
if (parent && parent.subTree && parent.subTree === cur.vnode) {
|
||||
cur = parent;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (slotScopeId) {
|
||||
if (!hasCloned) attrs = { ...attrs };
|
||||
const slotScopeIdList = slotScopeId.trim().split(" ");
|
||||
for (let i = 0; i < slotScopeIdList.length; i++) {
|
||||
attrs[slotScopeIdList[i]] = "";
|
||||
}
|
||||
}
|
||||
const prev = setCurrentRenderingInstance(instance);
|
||||
try {
|
||||
ssrRender(
|
||||
instance.proxy,
|
||||
push,
|
||||
instance,
|
||||
attrs,
|
||||
// compiler-optimized bindings
|
||||
instance.props,
|
||||
instance.setupState,
|
||||
instance.data,
|
||||
instance.ctx
|
||||
);
|
||||
} finally {
|
||||
setCurrentRenderingInstance(prev);
|
||||
}
|
||||
} else if (instance.render && instance.render !== shared.NOOP) {
|
||||
renderVNode(
|
||||
push,
|
||||
instance.subTree = renderComponentRoot(instance),
|
||||
instance,
|
||||
slotScopeId
|
||||
);
|
||||
} else {
|
||||
const componentName = comp.name || comp.__file || `<Anonymous>`;
|
||||
Vue.warn(`Component ${componentName} is missing template or render function.`);
|
||||
push(`<!---->`);
|
||||
}
|
||||
}
|
||||
return getBuffer();
|
||||
}
|
||||
function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
||||
const { type, shapeFlag, children, dirs, props } = vnode;
|
||||
if (dirs) {
|
||||
vnode.props = applySSRDirectives(vnode, props, dirs);
|
||||
}
|
||||
switch (type) {
|
||||
case Vue.Text:
|
||||
push(shared.escapeHtml(children));
|
||||
break;
|
||||
case Vue.Comment:
|
||||
push(
|
||||
children ? `<!--${shared.escapeHtmlComment(children)}-->` : `<!---->`
|
||||
);
|
||||
break;
|
||||
case Vue.Static:
|
||||
push(children);
|
||||
break;
|
||||
case Vue.Fragment:
|
||||
if (vnode.slotScopeIds) {
|
||||
slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
|
||||
}
|
||||
push(`<!--[-->`);
|
||||
renderVNodeChildren(
|
||||
push,
|
||||
children,
|
||||
parentComponent,
|
||||
slotScopeId
|
||||
);
|
||||
push(`<!--]-->`);
|
||||
break;
|
||||
default:
|
||||
if (shapeFlag & 1) {
|
||||
renderElementVNode(push, vnode, parentComponent, slotScopeId);
|
||||
} else if (shapeFlag & 6) {
|
||||
push(renderComponentVNode(vnode, parentComponent, slotScopeId));
|
||||
} else if (shapeFlag & 64) {
|
||||
renderTeleportVNode(push, vnode, parentComponent, slotScopeId);
|
||||
} else if (shapeFlag & 128) {
|
||||
renderVNode(push, vnode.ssContent, parentComponent, slotScopeId);
|
||||
} else {
|
||||
Vue.warn(
|
||||
"[@vue/server-renderer] Invalid VNode type:",
|
||||
type,
|
||||
`(${typeof type})`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
|
||||
}
|
||||
}
|
||||
function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
|
||||
const tag = vnode.type;
|
||||
let { props, children, shapeFlag, scopeId } = vnode;
|
||||
let openTag = `<${tag}`;
|
||||
if (props) {
|
||||
openTag += ssrRenderAttrs(props, tag);
|
||||
}
|
||||
if (scopeId) {
|
||||
openTag += ` ${scopeId}`;
|
||||
}
|
||||
let curParent = parentComponent;
|
||||
let curVnode = vnode;
|
||||
while (curParent && curVnode === curParent.subTree) {
|
||||
curVnode = curParent.vnode;
|
||||
if (curVnode.scopeId) {
|
||||
openTag += ` ${curVnode.scopeId}`;
|
||||
}
|
||||
curParent = curParent.parent;
|
||||
}
|
||||
if (slotScopeId) {
|
||||
openTag += ` ${slotScopeId}`;
|
||||
}
|
||||
push(openTag + `>`);
|
||||
if (!shared.isVoidTag(tag)) {
|
||||
let hasChildrenOverride = false;
|
||||
if (props) {
|
||||
if (props.innerHTML) {
|
||||
hasChildrenOverride = true;
|
||||
push(props.innerHTML);
|
||||
} else if (props.textContent) {
|
||||
hasChildrenOverride = true;
|
||||
push(shared.escapeHtml(props.textContent));
|
||||
} else if (tag === "textarea" && props.value) {
|
||||
hasChildrenOverride = true;
|
||||
push(shared.escapeHtml(props.value));
|
||||
}
|
||||
}
|
||||
if (!hasChildrenOverride) {
|
||||
if (shapeFlag & 8) {
|
||||
push(shared.escapeHtml(children));
|
||||
} else if (shapeFlag & 16) {
|
||||
renderVNodeChildren(
|
||||
push,
|
||||
children,
|
||||
parentComponent,
|
||||
slotScopeId
|
||||
);
|
||||
}
|
||||
}
|
||||
push(`</${tag}>`);
|
||||
}
|
||||
}
|
||||
function applySSRDirectives(vnode, rawProps, dirs) {
|
||||
const toMerge = [];
|
||||
for (let i = 0; i < dirs.length; i++) {
|
||||
const binding = dirs[i];
|
||||
const {
|
||||
dir: { getSSRProps }
|
||||
} = binding;
|
||||
if (getSSRProps) {
|
||||
const props = getSSRProps(binding, vnode);
|
||||
if (props) toMerge.push(props);
|
||||
}
|
||||
}
|
||||
return Vue.mergeProps(rawProps || {}, ...toMerge);
|
||||
}
|
||||
function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) {
|
||||
const target = vnode.props && vnode.props.to;
|
||||
const disabled = vnode.props && vnode.props.disabled;
|
||||
if (!target) {
|
||||
if (!disabled) {
|
||||
Vue.warn(`[@vue/server-renderer] Teleport is missing target prop.`);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
if (!shared.isString(target)) {
|
||||
Vue.warn(
|
||||
`[@vue/server-renderer] Teleport target must be a query selector string.`
|
||||
);
|
||||
return [];
|
||||
}
|
||||
ssrRenderTeleport(
|
||||
push,
|
||||
(push2) => {
|
||||
renderVNodeChildren(
|
||||
push2,
|
||||
vnode.children,
|
||||
parentComponent,
|
||||
slotScopeId
|
||||
);
|
||||
},
|
||||
target,
|
||||
disabled || disabled === "",
|
||||
parentComponent
|
||||
);
|
||||
}
|
||||
|
||||
const { isVNode: isVNode$1 } = Vue.ssrUtils;
|
||||
function nestedUnrollBuffer(buffer, parentRet, startIndex) {
|
||||
if (!buffer.hasAsync) {
|
||||
return parentRet + unrollBufferSync$1(buffer);
|
||||
}
|
||||
let ret = parentRet;
|
||||
for (let i = startIndex; i < buffer.length; i += 1) {
|
||||
const item = buffer[i];
|
||||
if (shared.isString(item)) {
|
||||
ret += item;
|
||||
continue;
|
||||
}
|
||||
if (shared.isPromise(item)) {
|
||||
return item.then((nestedItem) => {
|
||||
buffer[i] = nestedItem;
|
||||
return nestedUnrollBuffer(buffer, ret, i);
|
||||
});
|
||||
}
|
||||
const result = nestedUnrollBuffer(item, ret, 0);
|
||||
if (shared.isPromise(result)) {
|
||||
return result.then((nestedItem) => {
|
||||
buffer[i] = nestedItem;
|
||||
return nestedUnrollBuffer(buffer, "", i);
|
||||
});
|
||||
}
|
||||
ret = result;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function unrollBuffer$1(buffer) {
|
||||
return nestedUnrollBuffer(buffer, "", 0);
|
||||
}
|
||||
function unrollBufferSync$1(buffer) {
|
||||
let ret = "";
|
||||
for (let i = 0; i < buffer.length; i++) {
|
||||
let item = buffer[i];
|
||||
if (shared.isString(item)) {
|
||||
ret += item;
|
||||
} else {
|
||||
ret += unrollBufferSync$1(item);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
async function renderToString(input, context = {}) {
|
||||
if (isVNode$1(input)) {
|
||||
return renderToString(Vue.createApp({ render: () => input }), context);
|
||||
}
|
||||
const vnode = Vue.createVNode(input._component, input._props);
|
||||
vnode.appContext = input._context;
|
||||
input.provide(Vue.ssrContextKey, context);
|
||||
const buffer = await renderComponentVNode(vnode);
|
||||
const result = await unrollBuffer$1(buffer);
|
||||
await resolveTeleports(context);
|
||||
if (context.__watcherHandles) {
|
||||
for (const unwatch of context.__watcherHandles) {
|
||||
unwatch();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
async function resolveTeleports(context) {
|
||||
if (context.__teleportBuffers) {
|
||||
context.teleports = context.teleports || {};
|
||||
for (const key in context.__teleportBuffers) {
|
||||
context.teleports[key] = await unrollBuffer$1(
|
||||
await Promise.all([context.__teleportBuffers[key]])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const { isVNode } = Vue.ssrUtils;
|
||||
async function unrollBuffer(buffer, stream) {
|
||||
if (buffer.hasAsync) {
|
||||
for (let i = 0; i < buffer.length; i++) {
|
||||
let item = buffer[i];
|
||||
if (shared.isPromise(item)) {
|
||||
item = await item;
|
||||
}
|
||||
if (shared.isString(item)) {
|
||||
stream.push(item);
|
||||
} else {
|
||||
await unrollBuffer(item, stream);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unrollBufferSync(buffer, stream);
|
||||
}
|
||||
}
|
||||
function unrollBufferSync(buffer, stream) {
|
||||
for (let i = 0; i < buffer.length; i++) {
|
||||
let item = buffer[i];
|
||||
if (shared.isString(item)) {
|
||||
stream.push(item);
|
||||
} else {
|
||||
unrollBufferSync(item, stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
function renderToSimpleStream(input, context, stream) {
|
||||
if (isVNode(input)) {
|
||||
return renderToSimpleStream(
|
||||
Vue.createApp({ render: () => input }),
|
||||
context,
|
||||
stream
|
||||
);
|
||||
}
|
||||
const vnode = Vue.createVNode(input._component, input._props);
|
||||
vnode.appContext = input._context;
|
||||
input.provide(Vue.ssrContextKey, context);
|
||||
Promise.resolve(renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => {
|
||||
if (context.__watcherHandles) {
|
||||
for (const unwatch of context.__watcherHandles) {
|
||||
unwatch();
|
||||
}
|
||||
}
|
||||
}).then(() => stream.push(null)).catch((error) => {
|
||||
stream.destroy(error);
|
||||
});
|
||||
return stream;
|
||||
}
|
||||
function renderToStream(input, context = {}) {
|
||||
console.warn(
|
||||
`[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead.`
|
||||
);
|
||||
return renderToNodeStream(input, context);
|
||||
}
|
||||
function renderToNodeStream(input, context = {}) {
|
||||
const stream = new (require("node:stream")).Readable({ read() {
|
||||
} }) ;
|
||||
if (!stream) {
|
||||
throw new Error(
|
||||
`ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.`
|
||||
);
|
||||
}
|
||||
return renderToSimpleStream(input, context, stream);
|
||||
}
|
||||
function pipeToNodeWritable(input, context = {}, writable) {
|
||||
renderToSimpleStream(input, context, {
|
||||
push(content) {
|
||||
if (content != null) {
|
||||
writable.write(content);
|
||||
} else {
|
||||
writable.end();
|
||||
}
|
||||
},
|
||||
destroy(err) {
|
||||
writable.destroy(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
function renderToWebStream(input, context = {}) {
|
||||
if (typeof ReadableStream !== "function") {
|
||||
throw new Error(
|
||||
`ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.`
|
||||
);
|
||||
}
|
||||
const encoder = new TextEncoder();
|
||||
let cancelled = false;
|
||||
return new ReadableStream({
|
||||
start(controller) {
|
||||
renderToSimpleStream(input, context, {
|
||||
push(content) {
|
||||
if (cancelled) return;
|
||||
if (content != null) {
|
||||
controller.enqueue(encoder.encode(content));
|
||||
} else {
|
||||
controller.close();
|
||||
}
|
||||
},
|
||||
destroy(err) {
|
||||
controller.error(err);
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
cancelled = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
function pipeToWebWritable(input, context = {}, writable) {
|
||||
const writer = writable.getWriter();
|
||||
const encoder = new TextEncoder();
|
||||
let hasReady = false;
|
||||
try {
|
||||
hasReady = shared.isPromise(writer.ready);
|
||||
} catch (e) {
|
||||
}
|
||||
renderToSimpleStream(input, context, {
|
||||
async push(content) {
|
||||
if (hasReady) {
|
||||
await writer.ready;
|
||||
}
|
||||
if (content != null) {
|
||||
return writer.write(encoder.encode(content));
|
||||
} else {
|
||||
return writer.close();
|
||||
}
|
||||
},
|
||||
destroy(err) {
|
||||
console.log(err);
|
||||
writer.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Vue.initDirectivesForSSR();
|
||||
|
||||
exports.ssrIncludeBooleanAttr = shared.includeBooleanAttr;
|
||||
exports.pipeToNodeWritable = pipeToNodeWritable;
|
||||
exports.pipeToWebWritable = pipeToWebWritable;
|
||||
exports.renderToNodeStream = renderToNodeStream;
|
||||
exports.renderToSimpleStream = renderToSimpleStream;
|
||||
exports.renderToStream = renderToStream;
|
||||
exports.renderToString = renderToString;
|
||||
exports.renderToWebStream = renderToWebStream;
|
||||
exports.ssrGetDirectiveProps = ssrGetDirectiveProps;
|
||||
exports.ssrGetDynamicModelProps = ssrGetDynamicModelProps;
|
||||
exports.ssrInterpolate = ssrInterpolate;
|
||||
exports.ssrLooseContain = ssrLooseContain;
|
||||
exports.ssrLooseEqual = ssrLooseEqual;
|
||||
exports.ssrRenderAttr = ssrRenderAttr;
|
||||
exports.ssrRenderAttrs = ssrRenderAttrs;
|
||||
exports.ssrRenderClass = ssrRenderClass;
|
||||
exports.ssrRenderComponent = ssrRenderComponent;
|
||||
exports.ssrRenderDynamicAttr = ssrRenderDynamicAttr;
|
||||
exports.ssrRenderDynamicModel = ssrRenderDynamicModel;
|
||||
exports.ssrRenderList = ssrRenderList;
|
||||
exports.ssrRenderSlot = ssrRenderSlot;
|
||||
exports.ssrRenderSlotInner = ssrRenderSlotInner;
|
||||
exports.ssrRenderStyle = ssrRenderStyle;
|
||||
exports.ssrRenderSuspense = ssrRenderSuspense;
|
||||
exports.ssrRenderTeleport = ssrRenderTeleport;
|
||||
exports.ssrRenderVNode = renderVNode;
|
||||
55
.output/server/node_modules/@vue/server-renderer/package.json
generated
vendored
Normal file
55
.output/server/node_modules/@vue/server-renderer/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "@vue/server-renderer",
|
||||
"version": "3.5.28",
|
||||
"description": "@vue/server-renderer",
|
||||
"main": "index.js",
|
||||
"module": "dist/server-renderer.esm-bundler.js",
|
||||
"types": "dist/server-renderer.d.ts",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/server-renderer.d.ts",
|
||||
"node": {
|
||||
"production": "./dist/server-renderer.cjs.prod.js",
|
||||
"development": "./dist/server-renderer.cjs.js",
|
||||
"default": "./dist/server-renderer.cjs.prod.js"
|
||||
},
|
||||
"module": "./dist/server-renderer.esm-bundler.js",
|
||||
"import": "./dist/server-renderer.esm-bundler.js",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "VueServerRenderer",
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"esm-browser",
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/core.git",
|
||||
"directory": "packages/server-renderer"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/core/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/server-renderer#readme",
|
||||
"peerDependencies": {
|
||||
"vue": "3.5.28"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.28",
|
||||
"@vue/compiler-ssr": "3.5.28"
|
||||
}
|
||||
}
|
||||
604
.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js
generated
vendored
Normal file
604
.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js
generated
vendored
Normal file
@@ -0,0 +1,604 @@
|
||||
/**
|
||||
* @vue/shared v3.5.28
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function makeMap(str) {
|
||||
const map = /* @__PURE__ */ Object.create(null);
|
||||
for (const key of str.split(",")) map[key] = 1;
|
||||
return (val) => val in map;
|
||||
}
|
||||
|
||||
const EMPTY_OBJ = {};
|
||||
const EMPTY_ARR = [];
|
||||
const NOOP = () => {
|
||||
};
|
||||
const NO = () => false;
|
||||
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
|
||||
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
|
||||
const isModelListener = (key) => key.startsWith("onUpdate:");
|
||||
const extend = Object.assign;
|
||||
const remove = (arr, el) => {
|
||||
const i = arr.indexOf(el);
|
||||
if (i > -1) {
|
||||
arr.splice(i, 1);
|
||||
}
|
||||
};
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
||||
const isArray = Array.isArray;
|
||||
const isMap = (val) => toTypeString(val) === "[object Map]";
|
||||
const isSet = (val) => toTypeString(val) === "[object Set]";
|
||||
const isDate = (val) => toTypeString(val) === "[object Date]";
|
||||
const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
|
||||
const isFunction = (val) => typeof val === "function";
|
||||
const isString = (val) => typeof val === "string";
|
||||
const isSymbol = (val) => typeof val === "symbol";
|
||||
const isObject = (val) => val !== null && typeof val === "object";
|
||||
const isPromise = (val) => {
|
||||
return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
|
||||
};
|
||||
const objectToString = Object.prototype.toString;
|
||||
const toTypeString = (value) => objectToString.call(value);
|
||||
const toRawType = (value) => {
|
||||
return toTypeString(value).slice(8, -1);
|
||||
};
|
||||
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
||||
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
||||
const isReservedProp = /* @__PURE__ */ makeMap(
|
||||
// the leading comma is intentional so empty string "" is also included
|
||||
",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
|
||||
);
|
||||
const isBuiltInDirective = /* @__PURE__ */ makeMap(
|
||||
"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
|
||||
);
|
||||
const cacheStringFunction = (fn) => {
|
||||
const cache = /* @__PURE__ */ Object.create(null);
|
||||
return ((str) => {
|
||||
const hit = cache[str];
|
||||
return hit || (cache[str] = fn(str));
|
||||
});
|
||||
};
|
||||
const camelizeRE = /-\w/g;
|
||||
const camelize = cacheStringFunction(
|
||||
(str) => {
|
||||
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
||||
}
|
||||
);
|
||||
const hyphenateRE = /\B([A-Z])/g;
|
||||
const hyphenate = cacheStringFunction(
|
||||
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
||||
);
|
||||
const capitalize = cacheStringFunction((str) => {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
});
|
||||
const toHandlerKey = cacheStringFunction(
|
||||
(str) => {
|
||||
const s = str ? `on${capitalize(str)}` : ``;
|
||||
return s;
|
||||
}
|
||||
);
|
||||
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
||||
const invokeArrayFns = (fns, ...arg) => {
|
||||
for (let i = 0; i < fns.length; i++) {
|
||||
fns[i](...arg);
|
||||
}
|
||||
};
|
||||
const def = (obj, key, value, writable = false) => {
|
||||
Object.defineProperty(obj, key, {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable,
|
||||
value
|
||||
});
|
||||
};
|
||||
const looseToNumber = (val) => {
|
||||
const n = parseFloat(val);
|
||||
return isNaN(n) ? val : n;
|
||||
};
|
||||
const toNumber = (val) => {
|
||||
const n = isString(val) ? Number(val) : NaN;
|
||||
return isNaN(n) ? val : n;
|
||||
};
|
||||
let _globalThis;
|
||||
const getGlobalThis = () => {
|
||||
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
||||
};
|
||||
const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
|
||||
function genPropsAccessExp(name) {
|
||||
return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
|
||||
}
|
||||
function genCacheKey(source, options) {
|
||||
return source + JSON.stringify(
|
||||
options,
|
||||
(_, val) => typeof val === "function" ? val.toString() : val
|
||||
);
|
||||
}
|
||||
|
||||
const PatchFlags = {
|
||||
"TEXT": 1,
|
||||
"1": "TEXT",
|
||||
"CLASS": 2,
|
||||
"2": "CLASS",
|
||||
"STYLE": 4,
|
||||
"4": "STYLE",
|
||||
"PROPS": 8,
|
||||
"8": "PROPS",
|
||||
"FULL_PROPS": 16,
|
||||
"16": "FULL_PROPS",
|
||||
"NEED_HYDRATION": 32,
|
||||
"32": "NEED_HYDRATION",
|
||||
"STABLE_FRAGMENT": 64,
|
||||
"64": "STABLE_FRAGMENT",
|
||||
"KEYED_FRAGMENT": 128,
|
||||
"128": "KEYED_FRAGMENT",
|
||||
"UNKEYED_FRAGMENT": 256,
|
||||
"256": "UNKEYED_FRAGMENT",
|
||||
"NEED_PATCH": 512,
|
||||
"512": "NEED_PATCH",
|
||||
"DYNAMIC_SLOTS": 1024,
|
||||
"1024": "DYNAMIC_SLOTS",
|
||||
"DEV_ROOT_FRAGMENT": 2048,
|
||||
"2048": "DEV_ROOT_FRAGMENT",
|
||||
"CACHED": -1,
|
||||
"-1": "CACHED",
|
||||
"BAIL": -2,
|
||||
"-2": "BAIL"
|
||||
};
|
||||
const PatchFlagNames = {
|
||||
[1]: `TEXT`,
|
||||
[2]: `CLASS`,
|
||||
[4]: `STYLE`,
|
||||
[8]: `PROPS`,
|
||||
[16]: `FULL_PROPS`,
|
||||
[32]: `NEED_HYDRATION`,
|
||||
[64]: `STABLE_FRAGMENT`,
|
||||
[128]: `KEYED_FRAGMENT`,
|
||||
[256]: `UNKEYED_FRAGMENT`,
|
||||
[512]: `NEED_PATCH`,
|
||||
[1024]: `DYNAMIC_SLOTS`,
|
||||
[2048]: `DEV_ROOT_FRAGMENT`,
|
||||
[-1]: `CACHED`,
|
||||
[-2]: `BAIL`
|
||||
};
|
||||
|
||||
const ShapeFlags = {
|
||||
"ELEMENT": 1,
|
||||
"1": "ELEMENT",
|
||||
"FUNCTIONAL_COMPONENT": 2,
|
||||
"2": "FUNCTIONAL_COMPONENT",
|
||||
"STATEFUL_COMPONENT": 4,
|
||||
"4": "STATEFUL_COMPONENT",
|
||||
"TEXT_CHILDREN": 8,
|
||||
"8": "TEXT_CHILDREN",
|
||||
"ARRAY_CHILDREN": 16,
|
||||
"16": "ARRAY_CHILDREN",
|
||||
"SLOTS_CHILDREN": 32,
|
||||
"32": "SLOTS_CHILDREN",
|
||||
"TELEPORT": 64,
|
||||
"64": "TELEPORT",
|
||||
"SUSPENSE": 128,
|
||||
"128": "SUSPENSE",
|
||||
"COMPONENT_SHOULD_KEEP_ALIVE": 256,
|
||||
"256": "COMPONENT_SHOULD_KEEP_ALIVE",
|
||||
"COMPONENT_KEPT_ALIVE": 512,
|
||||
"512": "COMPONENT_KEPT_ALIVE",
|
||||
"COMPONENT": 6,
|
||||
"6": "COMPONENT"
|
||||
};
|
||||
|
||||
const SlotFlags = {
|
||||
"STABLE": 1,
|
||||
"1": "STABLE",
|
||||
"DYNAMIC": 2,
|
||||
"2": "DYNAMIC",
|
||||
"FORWARDED": 3,
|
||||
"3": "FORWARDED"
|
||||
};
|
||||
const slotFlagsText = {
|
||||
[1]: "STABLE",
|
||||
[2]: "DYNAMIC",
|
||||
[3]: "FORWARDED"
|
||||
};
|
||||
|
||||
const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol";
|
||||
const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
|
||||
const isGloballyWhitelisted = isGloballyAllowed;
|
||||
|
||||
const range = 2;
|
||||
function generateCodeFrame(source, start = 0, end = source.length) {
|
||||
start = Math.max(0, Math.min(start, source.length));
|
||||
end = Math.max(0, Math.min(end, source.length));
|
||||
if (start > end) return "";
|
||||
let lines = source.split(/(\r?\n)/);
|
||||
const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
|
||||
lines = lines.filter((_, idx) => idx % 2 === 0);
|
||||
let count = 0;
|
||||
const res = [];
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
|
||||
if (count >= start) {
|
||||
for (let j = i - range; j <= i + range || end > count; j++) {
|
||||
if (j < 0 || j >= lines.length) continue;
|
||||
const line = j + 1;
|
||||
res.push(
|
||||
`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
|
||||
);
|
||||
const lineLength = lines[j].length;
|
||||
const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
|
||||
if (j === i) {
|
||||
const pad = start - (count - (lineLength + newLineSeqLength));
|
||||
const length = Math.max(
|
||||
1,
|
||||
end > count ? lineLength - pad : end - start
|
||||
);
|
||||
res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
|
||||
} else if (j > i) {
|
||||
if (end > count) {
|
||||
const length = Math.max(Math.min(end - count, lineLength), 1);
|
||||
res.push(` | ` + "^".repeat(length));
|
||||
}
|
||||
count += lineLength + newLineSeqLength;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res.join("\n");
|
||||
}
|
||||
|
||||
function normalizeStyle(value) {
|
||||
if (isArray(value)) {
|
||||
const res = {};
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
const item = value[i];
|
||||
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
|
||||
if (normalized) {
|
||||
for (const key in normalized) {
|
||||
res[key] = normalized[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
} else if (isString(value) || isObject(value)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
const listDelimiterRE = /;(?![^(]*\))/g;
|
||||
const propertyDelimiterRE = /:([^]+)/;
|
||||
const styleCommentRE = /\/\*[^]*?\*\//g;
|
||||
function parseStringStyle(cssText) {
|
||||
const ret = {};
|
||||
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
||||
if (item) {
|
||||
const tmp = item.split(propertyDelimiterRE);
|
||||
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
function stringifyStyle(styles) {
|
||||
if (!styles) return "";
|
||||
if (isString(styles)) return styles;
|
||||
let ret = "";
|
||||
for (const key in styles) {
|
||||
const value = styles[key];
|
||||
if (isString(value) || typeof value === "number") {
|
||||
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
|
||||
ret += `${normalizedKey}:${value};`;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function normalizeClass(value) {
|
||||
let res = "";
|
||||
if (isString(value)) {
|
||||
res = value;
|
||||
} else if (isArray(value)) {
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
const normalized = normalizeClass(value[i]);
|
||||
if (normalized) {
|
||||
res += normalized + " ";
|
||||
}
|
||||
}
|
||||
} else if (isObject(value)) {
|
||||
for (const name in value) {
|
||||
if (value[name]) {
|
||||
res += name + " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
return res.trim();
|
||||
}
|
||||
function normalizeProps(props) {
|
||||
if (!props) return null;
|
||||
let { class: klass, style } = props;
|
||||
if (klass && !isString(klass)) {
|
||||
props.class = normalizeClass(klass);
|
||||
}
|
||||
if (style) {
|
||||
props.style = normalizeStyle(style);
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
||||
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
|
||||
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
|
||||
const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
|
||||
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
|
||||
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
||||
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
||||
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
||||
const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
||||
|
||||
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
||||
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
||||
const isBooleanAttr = /* @__PURE__ */ makeMap(
|
||||
specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
|
||||
);
|
||||
function includeBooleanAttr(value) {
|
||||
return !!value || value === "";
|
||||
}
|
||||
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
|
||||
const attrValidationCache = {};
|
||||
function isSSRSafeAttrName(name) {
|
||||
if (attrValidationCache.hasOwnProperty(name)) {
|
||||
return attrValidationCache[name];
|
||||
}
|
||||
const isUnsafe = unsafeAttrCharRE.test(name);
|
||||
if (isUnsafe) {
|
||||
console.error(`unsafe attribute name: ${name}`);
|
||||
}
|
||||
return attrValidationCache[name] = !isUnsafe;
|
||||
}
|
||||
const propsToAttrMap = {
|
||||
acceptCharset: "accept-charset",
|
||||
className: "class",
|
||||
htmlFor: "for",
|
||||
httpEquiv: "http-equiv"
|
||||
};
|
||||
const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
|
||||
`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
|
||||
);
|
||||
const isKnownSvgAttr = /* @__PURE__ */ makeMap(
|
||||
`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
|
||||
);
|
||||
const isKnownMathMLAttr = /* @__PURE__ */ makeMap(
|
||||
`accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`
|
||||
);
|
||||
function isRenderableAttrValue(value) {
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
const type = typeof value;
|
||||
return type === "string" || type === "number" || type === "boolean";
|
||||
}
|
||||
|
||||
const escapeRE = /["'&<>]/;
|
||||
function escapeHtml(string) {
|
||||
const str = "" + string;
|
||||
const match = escapeRE.exec(str);
|
||||
if (!match) {
|
||||
return str;
|
||||
}
|
||||
let html = "";
|
||||
let escaped;
|
||||
let index;
|
||||
let lastIndex = 0;
|
||||
for (index = match.index; index < str.length; index++) {
|
||||
switch (str.charCodeAt(index)) {
|
||||
case 34:
|
||||
escaped = """;
|
||||
break;
|
||||
case 38:
|
||||
escaped = "&";
|
||||
break;
|
||||
case 39:
|
||||
escaped = "'";
|
||||
break;
|
||||
case 60:
|
||||
escaped = "<";
|
||||
break;
|
||||
case 62:
|
||||
escaped = ">";
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if (lastIndex !== index) {
|
||||
html += str.slice(lastIndex, index);
|
||||
}
|
||||
lastIndex = index + 1;
|
||||
html += escaped;
|
||||
}
|
||||
return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
|
||||
}
|
||||
const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
|
||||
function escapeHtmlComment(src) {
|
||||
return src.replace(commentStripRE, "");
|
||||
}
|
||||
const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
|
||||
function getEscapedCssVarName(key, doubleEscape) {
|
||||
return key.replace(
|
||||
cssVarNameEscapeSymbolsRE,
|
||||
(s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}`
|
||||
);
|
||||
}
|
||||
|
||||
function looseCompareArrays(a, b) {
|
||||
if (a.length !== b.length) return false;
|
||||
let equal = true;
|
||||
for (let i = 0; equal && i < a.length; i++) {
|
||||
equal = looseEqual(a[i], b[i]);
|
||||
}
|
||||
return equal;
|
||||
}
|
||||
function looseEqual(a, b) {
|
||||
if (a === b) return true;
|
||||
let aValidType = isDate(a);
|
||||
let bValidType = isDate(b);
|
||||
if (aValidType || bValidType) {
|
||||
return aValidType && bValidType ? a.getTime() === b.getTime() : false;
|
||||
}
|
||||
aValidType = isSymbol(a);
|
||||
bValidType = isSymbol(b);
|
||||
if (aValidType || bValidType) {
|
||||
return a === b;
|
||||
}
|
||||
aValidType = isArray(a);
|
||||
bValidType = isArray(b);
|
||||
if (aValidType || bValidType) {
|
||||
return aValidType && bValidType ? looseCompareArrays(a, b) : false;
|
||||
}
|
||||
aValidType = isObject(a);
|
||||
bValidType = isObject(b);
|
||||
if (aValidType || bValidType) {
|
||||
if (!aValidType || !bValidType) {
|
||||
return false;
|
||||
}
|
||||
const aKeysCount = Object.keys(a).length;
|
||||
const bKeysCount = Object.keys(b).length;
|
||||
if (aKeysCount !== bKeysCount) {
|
||||
return false;
|
||||
}
|
||||
for (const key in a) {
|
||||
const aHasKey = a.hasOwnProperty(key);
|
||||
const bHasKey = b.hasOwnProperty(key);
|
||||
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return String(a) === String(b);
|
||||
}
|
||||
function looseIndexOf(arr, val) {
|
||||
return arr.findIndex((item) => looseEqual(item, val));
|
||||
}
|
||||
|
||||
const isRef = (val) => {
|
||||
return !!(val && val["__v_isRef"] === true);
|
||||
};
|
||||
const toDisplayString = (val) => {
|
||||
return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
|
||||
};
|
||||
const replacer = (_key, val) => {
|
||||
if (isRef(val)) {
|
||||
return replacer(_key, val.value);
|
||||
} else if (isMap(val)) {
|
||||
return {
|
||||
[`Map(${val.size})`]: [...val.entries()].reduce(
|
||||
(entries, [key, val2], i) => {
|
||||
entries[stringifySymbol(key, i) + " =>"] = val2;
|
||||
return entries;
|
||||
},
|
||||
{}
|
||||
)
|
||||
};
|
||||
} else if (isSet(val)) {
|
||||
return {
|
||||
[`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
|
||||
};
|
||||
} else if (isSymbol(val)) {
|
||||
return stringifySymbol(val);
|
||||
} else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
|
||||
return String(val);
|
||||
}
|
||||
return val;
|
||||
};
|
||||
const stringifySymbol = (v, i = "") => {
|
||||
var _a;
|
||||
return (
|
||||
// Symbol.description in es2019+ so we need to cast here to pass
|
||||
// the lib: es2016 check
|
||||
isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
|
||||
);
|
||||
};
|
||||
|
||||
function normalizeCssVarValue(value) {
|
||||
if (value == null) {
|
||||
return "initial";
|
||||
}
|
||||
if (typeof value === "string") {
|
||||
return value === "" ? " " : value;
|
||||
}
|
||||
return String(value);
|
||||
}
|
||||
|
||||
exports.EMPTY_ARR = EMPTY_ARR;
|
||||
exports.EMPTY_OBJ = EMPTY_OBJ;
|
||||
exports.NO = NO;
|
||||
exports.NOOP = NOOP;
|
||||
exports.PatchFlagNames = PatchFlagNames;
|
||||
exports.PatchFlags = PatchFlags;
|
||||
exports.ShapeFlags = ShapeFlags;
|
||||
exports.SlotFlags = SlotFlags;
|
||||
exports.camelize = camelize;
|
||||
exports.capitalize = capitalize;
|
||||
exports.cssVarNameEscapeSymbolsRE = cssVarNameEscapeSymbolsRE;
|
||||
exports.def = def;
|
||||
exports.escapeHtml = escapeHtml;
|
||||
exports.escapeHtmlComment = escapeHtmlComment;
|
||||
exports.extend = extend;
|
||||
exports.genCacheKey = genCacheKey;
|
||||
exports.genPropsAccessExp = genPropsAccessExp;
|
||||
exports.generateCodeFrame = generateCodeFrame;
|
||||
exports.getEscapedCssVarName = getEscapedCssVarName;
|
||||
exports.getGlobalThis = getGlobalThis;
|
||||
exports.hasChanged = hasChanged;
|
||||
exports.hasOwn = hasOwn;
|
||||
exports.hyphenate = hyphenate;
|
||||
exports.includeBooleanAttr = includeBooleanAttr;
|
||||
exports.invokeArrayFns = invokeArrayFns;
|
||||
exports.isArray = isArray;
|
||||
exports.isBooleanAttr = isBooleanAttr;
|
||||
exports.isBuiltInDirective = isBuiltInDirective;
|
||||
exports.isDate = isDate;
|
||||
exports.isFunction = isFunction;
|
||||
exports.isGloballyAllowed = isGloballyAllowed;
|
||||
exports.isGloballyWhitelisted = isGloballyWhitelisted;
|
||||
exports.isHTMLTag = isHTMLTag;
|
||||
exports.isIntegerKey = isIntegerKey;
|
||||
exports.isKnownHtmlAttr = isKnownHtmlAttr;
|
||||
exports.isKnownMathMLAttr = isKnownMathMLAttr;
|
||||
exports.isKnownSvgAttr = isKnownSvgAttr;
|
||||
exports.isMap = isMap;
|
||||
exports.isMathMLTag = isMathMLTag;
|
||||
exports.isModelListener = isModelListener;
|
||||
exports.isObject = isObject;
|
||||
exports.isOn = isOn;
|
||||
exports.isPlainObject = isPlainObject;
|
||||
exports.isPromise = isPromise;
|
||||
exports.isRegExp = isRegExp;
|
||||
exports.isRenderableAttrValue = isRenderableAttrValue;
|
||||
exports.isReservedProp = isReservedProp;
|
||||
exports.isSSRSafeAttrName = isSSRSafeAttrName;
|
||||
exports.isSVGTag = isSVGTag;
|
||||
exports.isSet = isSet;
|
||||
exports.isSpecialBooleanAttr = isSpecialBooleanAttr;
|
||||
exports.isString = isString;
|
||||
exports.isSymbol = isSymbol;
|
||||
exports.isVoidTag = isVoidTag;
|
||||
exports.looseEqual = looseEqual;
|
||||
exports.looseIndexOf = looseIndexOf;
|
||||
exports.looseToNumber = looseToNumber;
|
||||
exports.makeMap = makeMap;
|
||||
exports.normalizeClass = normalizeClass;
|
||||
exports.normalizeCssVarValue = normalizeCssVarValue;
|
||||
exports.normalizeProps = normalizeProps;
|
||||
exports.normalizeStyle = normalizeStyle;
|
||||
exports.objectToString = objectToString;
|
||||
exports.parseStringStyle = parseStringStyle;
|
||||
exports.propsToAttrMap = propsToAttrMap;
|
||||
exports.remove = remove;
|
||||
exports.slotFlagsText = slotFlagsText;
|
||||
exports.stringifyStyle = stringifyStyle;
|
||||
exports.toDisplayString = toDisplayString;
|
||||
exports.toHandlerKey = toHandlerKey;
|
||||
exports.toNumber = toNumber;
|
||||
exports.toRawType = toRawType;
|
||||
exports.toTypeString = toTypeString;
|
||||
47
.output/server/node_modules/@vue/shared/package.json
generated
vendored
Normal file
47
.output/server/node_modules/@vue/shared/package.json
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "@vue/shared",
|
||||
"version": "3.5.28",
|
||||
"description": "internal utils shared across @vue packages",
|
||||
"main": "index.js",
|
||||
"module": "dist/shared.esm-bundler.js",
|
||||
"types": "dist/shared.d.ts",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/shared.d.ts",
|
||||
"node": {
|
||||
"production": "./dist/shared.cjs.prod.js",
|
||||
"development": "./dist/shared.cjs.js",
|
||||
"default": "./dist/shared.cjs.prod.js"
|
||||
},
|
||||
"module": "./dist/shared.esm-bundler.js",
|
||||
"import": "./dist/shared.esm-bundler.js",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"buildOptions": {
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/core.git",
|
||||
"directory": "packages/shared"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/core/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/shared#readme"
|
||||
}
|
||||
4
.output/server/node_modules/devalue/index.js
generated
vendored
Normal file
4
.output/server/node_modules/devalue/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export { uneval } from './src/uneval.js';
|
||||
export { parse, unflatten } from './src/parse.js';
|
||||
export { stringify } from './src/stringify.js';
|
||||
export { DevalueError } from './src/utils.js';
|
||||
37
.output/server/node_modules/devalue/package.json
generated
vendored
Normal file
37
.output/server/node_modules/devalue/package.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "devalue",
|
||||
"description": "Gets the job done when JSON.stringify can't",
|
||||
"version": "5.6.2",
|
||||
"repository": "sveltejs/devalue",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./index.js",
|
||||
"default": "./index.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"src",
|
||||
"types"
|
||||
],
|
||||
"types": "./types/index.d.ts",
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.29.6",
|
||||
"@js-temporal/polyfill": "^0.5.1",
|
||||
"dts-buddy": "^0.6.2",
|
||||
"publint": "^0.3.12",
|
||||
"typescript": "^5.9.2",
|
||||
"uvu": "^0.5.6"
|
||||
},
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"packageManager": "pnpm@8.15.9",
|
||||
"scripts": {
|
||||
"changeset:version": "changeset version",
|
||||
"changeset:publish": "changeset publish",
|
||||
"build": "dts-buddy",
|
||||
"test": "uvu test"
|
||||
}
|
||||
}
|
||||
110
.output/server/node_modules/devalue/src/base64.js
generated
vendored
Normal file
110
.output/server/node_modules/devalue/src/base64.js
generated
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* Base64 Encodes an arraybuffer
|
||||
* @param {ArrayBuffer} arraybuffer
|
||||
* @returns {string}
|
||||
*/
|
||||
export function encode64(arraybuffer) {
|
||||
const dv = new DataView(arraybuffer);
|
||||
let binaryString = "";
|
||||
|
||||
for (let i = 0; i < arraybuffer.byteLength; i++) {
|
||||
binaryString += String.fromCharCode(dv.getUint8(i));
|
||||
}
|
||||
|
||||
return binaryToAscii(binaryString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes a base64 string into an arraybuffer
|
||||
* @param {string} string
|
||||
* @returns {ArrayBuffer}
|
||||
*/
|
||||
export function decode64(string) {
|
||||
const binaryString = asciiToBinary(string);
|
||||
const arraybuffer = new ArrayBuffer(binaryString.length);
|
||||
const dv = new DataView(arraybuffer);
|
||||
|
||||
for (let i = 0; i < arraybuffer.byteLength; i++) {
|
||||
dv.setUint8(i, binaryString.charCodeAt(i));
|
||||
}
|
||||
|
||||
return arraybuffer;
|
||||
}
|
||||
|
||||
const KEY_STRING =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
/**
|
||||
* Substitute for atob since it's deprecated in node.
|
||||
* Does not do any input validation.
|
||||
*
|
||||
* @see https://github.com/jsdom/abab/blob/master/lib/atob.js
|
||||
*
|
||||
* @param {string} data
|
||||
* @returns {string}
|
||||
*/
|
||||
function asciiToBinary(data) {
|
||||
if (data.length % 4 === 0) {
|
||||
data = data.replace(/==?$/, "");
|
||||
}
|
||||
|
||||
let output = "";
|
||||
let buffer = 0;
|
||||
let accumulatedBits = 0;
|
||||
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
buffer <<= 6;
|
||||
buffer |= KEY_STRING.indexOf(data[i]);
|
||||
accumulatedBits += 6;
|
||||
if (accumulatedBits === 24) {
|
||||
output += String.fromCharCode((buffer & 0xff0000) >> 16);
|
||||
output += String.fromCharCode((buffer & 0xff00) >> 8);
|
||||
output += String.fromCharCode(buffer & 0xff);
|
||||
buffer = accumulatedBits = 0;
|
||||
}
|
||||
}
|
||||
if (accumulatedBits === 12) {
|
||||
buffer >>= 4;
|
||||
output += String.fromCharCode(buffer);
|
||||
} else if (accumulatedBits === 18) {
|
||||
buffer >>= 2;
|
||||
output += String.fromCharCode((buffer & 0xff00) >> 8);
|
||||
output += String.fromCharCode(buffer & 0xff);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Substitute for btoa since it's deprecated in node.
|
||||
* Does not do any input validation.
|
||||
*
|
||||
* @see https://github.com/jsdom/abab/blob/master/lib/btoa.js
|
||||
*
|
||||
* @param {string} str
|
||||
* @returns {string}
|
||||
*/
|
||||
function binaryToAscii(str) {
|
||||
let out = "";
|
||||
for (let i = 0; i < str.length; i += 3) {
|
||||
/** @type {[number, number, number, number]} */
|
||||
const groupsOfSix = [undefined, undefined, undefined, undefined];
|
||||
groupsOfSix[0] = str.charCodeAt(i) >> 2;
|
||||
groupsOfSix[1] = (str.charCodeAt(i) & 0x03) << 4;
|
||||
if (str.length > i + 1) {
|
||||
groupsOfSix[1] |= str.charCodeAt(i + 1) >> 4;
|
||||
groupsOfSix[2] = (str.charCodeAt(i + 1) & 0x0f) << 2;
|
||||
}
|
||||
if (str.length > i + 2) {
|
||||
groupsOfSix[2] |= str.charCodeAt(i + 2) >> 6;
|
||||
groupsOfSix[3] = str.charCodeAt(i + 2) & 0x3f;
|
||||
}
|
||||
for (let j = 0; j < groupsOfSix.length; j++) {
|
||||
if (typeof groupsOfSix[j] === "undefined") {
|
||||
out += "=";
|
||||
} else {
|
||||
out += KEY_STRING[groupsOfSix[j]];
|
||||
}
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
6
.output/server/node_modules/devalue/src/constants.js
generated
vendored
Normal file
6
.output/server/node_modules/devalue/src/constants.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export const UNDEFINED = -1;
|
||||
export const HOLE = -2;
|
||||
export const NAN = -3;
|
||||
export const POSITIVE_INFINITY = -4;
|
||||
export const NEGATIVE_INFINITY = -5;
|
||||
export const NEGATIVE_ZERO = -6;
|
||||
234
.output/server/node_modules/devalue/src/parse.js
generated
vendored
Normal file
234
.output/server/node_modules/devalue/src/parse.js
generated
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
import { decode64 } from './base64.js';
|
||||
import {
|
||||
HOLE,
|
||||
NAN,
|
||||
NEGATIVE_INFINITY,
|
||||
NEGATIVE_ZERO,
|
||||
POSITIVE_INFINITY,
|
||||
UNDEFINED
|
||||
} from './constants.js';
|
||||
|
||||
/**
|
||||
* Revive a value serialized with `devalue.stringify`
|
||||
* @param {string} serialized
|
||||
* @param {Record<string, (value: any) => any>} [revivers]
|
||||
*/
|
||||
export function parse(serialized, revivers) {
|
||||
return unflatten(JSON.parse(serialized), revivers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Revive a value flattened with `devalue.stringify`
|
||||
* @param {number | any[]} parsed
|
||||
* @param {Record<string, (value: any) => any>} [revivers]
|
||||
*/
|
||||
export function unflatten(parsed, revivers) {
|
||||
if (typeof parsed === 'number') return hydrate(parsed, true);
|
||||
|
||||
if (!Array.isArray(parsed) || parsed.length === 0) {
|
||||
throw new Error('Invalid input');
|
||||
}
|
||||
|
||||
const values = /** @type {any[]} */ (parsed);
|
||||
|
||||
const hydrated = Array(values.length);
|
||||
|
||||
/**
|
||||
* A set of values currently being hydrated with custom revivers,
|
||||
* used to detect invalid cyclical dependencies
|
||||
* @type {Set<number> | null}
|
||||
*/
|
||||
let hydrating = null;
|
||||
|
||||
/**
|
||||
* @param {number} index
|
||||
* @returns {any}
|
||||
*/
|
||||
function hydrate(index, standalone = false) {
|
||||
if (index === UNDEFINED) return undefined;
|
||||
if (index === NAN) return NaN;
|
||||
if (index === POSITIVE_INFINITY) return Infinity;
|
||||
if (index === NEGATIVE_INFINITY) return -Infinity;
|
||||
if (index === NEGATIVE_ZERO) return -0;
|
||||
|
||||
if (standalone || typeof index !== 'number') {
|
||||
throw new Error(`Invalid input`);
|
||||
}
|
||||
|
||||
if (index in hydrated) return hydrated[index];
|
||||
|
||||
const value = values[index];
|
||||
|
||||
if (!value || typeof value !== 'object') {
|
||||
hydrated[index] = value;
|
||||
} else if (Array.isArray(value)) {
|
||||
if (typeof value[0] === 'string') {
|
||||
const type = value[0];
|
||||
|
||||
const reviver =
|
||||
revivers && Object.hasOwn(revivers, type)
|
||||
? revivers[type]
|
||||
: undefined;
|
||||
|
||||
if (reviver) {
|
||||
let i = value[1];
|
||||
if (typeof i !== 'number') {
|
||||
// if it's not a number, it was serialized by a builtin reviver
|
||||
// so we need to munge it into the format expected by a custom reviver
|
||||
i = values.push(value[1]) - 1;
|
||||
}
|
||||
|
||||
hydrating ??= new Set();
|
||||
|
||||
if (hydrating.has(i)) {
|
||||
throw new Error('Invalid circular reference');
|
||||
}
|
||||
|
||||
hydrating.add(i);
|
||||
hydrated[index] = reviver(hydrate(i));
|
||||
hydrating.delete(i);
|
||||
|
||||
return hydrated[index];
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 'Date':
|
||||
hydrated[index] = new Date(value[1]);
|
||||
break;
|
||||
|
||||
case 'Set':
|
||||
const set = new Set();
|
||||
hydrated[index] = set;
|
||||
for (let i = 1; i < value.length; i += 1) {
|
||||
set.add(hydrate(value[i]));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'Map':
|
||||
const map = new Map();
|
||||
hydrated[index] = map;
|
||||
for (let i = 1; i < value.length; i += 2) {
|
||||
map.set(hydrate(value[i]), hydrate(value[i + 1]));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'RegExp':
|
||||
hydrated[index] = new RegExp(value[1], value[2]);
|
||||
break;
|
||||
|
||||
case 'Object':
|
||||
hydrated[index] = Object(value[1]);
|
||||
break;
|
||||
|
||||
case 'BigInt':
|
||||
hydrated[index] = BigInt(value[1]);
|
||||
break;
|
||||
|
||||
case 'null':
|
||||
const obj = Object.create(null);
|
||||
hydrated[index] = obj;
|
||||
for (let i = 1; i < value.length; i += 2) {
|
||||
obj[value[i]] = hydrate(value[i + 1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'Int8Array':
|
||||
case 'Uint8Array':
|
||||
case 'Uint8ClampedArray':
|
||||
case 'Int16Array':
|
||||
case 'Uint16Array':
|
||||
case 'Int32Array':
|
||||
case 'Uint32Array':
|
||||
case 'Float32Array':
|
||||
case 'Float64Array':
|
||||
case 'BigInt64Array':
|
||||
case 'BigUint64Array': {
|
||||
if (values[value[1]][0] !== 'ArrayBuffer') {
|
||||
// without this, if we receive malformed input we could
|
||||
// end up trying to hydrate in a circle or allocate
|
||||
// huge amounts of memory when we call `new TypedArrayConstructor(buffer)`
|
||||
throw new Error('Invalid data');
|
||||
}
|
||||
|
||||
const TypedArrayConstructor = globalThis[type];
|
||||
const buffer = hydrate(value[1]);
|
||||
const typedArray = new TypedArrayConstructor(buffer);
|
||||
|
||||
hydrated[index] =
|
||||
value[2] !== undefined
|
||||
? typedArray.subarray(value[2], value[3])
|
||||
: typedArray;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'ArrayBuffer': {
|
||||
const base64 = value[1];
|
||||
if (typeof base64 !== 'string') {
|
||||
throw new Error('Invalid ArrayBuffer encoding');
|
||||
}
|
||||
const arraybuffer = decode64(base64);
|
||||
hydrated[index] = arraybuffer;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'Temporal.Duration':
|
||||
case 'Temporal.Instant':
|
||||
case 'Temporal.PlainDate':
|
||||
case 'Temporal.PlainTime':
|
||||
case 'Temporal.PlainDateTime':
|
||||
case 'Temporal.PlainMonthDay':
|
||||
case 'Temporal.PlainYearMonth':
|
||||
case 'Temporal.ZonedDateTime': {
|
||||
const temporalName = type.slice(9);
|
||||
// @ts-expect-error TS doesn't know about Temporal yet
|
||||
hydrated[index] = Temporal[temporalName].from(value[1]);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'URL': {
|
||||
const url = new URL(value[1]);
|
||||
hydrated[index] = url;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'URLSearchParams': {
|
||||
const url = new URLSearchParams(value[1]);
|
||||
hydrated[index] = url;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new Error(`Unknown type ${type}`);
|
||||
}
|
||||
} else {
|
||||
const array = new Array(value.length);
|
||||
hydrated[index] = array;
|
||||
|
||||
for (let i = 0; i < value.length; i += 1) {
|
||||
const n = value[i];
|
||||
if (n === HOLE) continue;
|
||||
|
||||
array[i] = hydrate(n);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/** @type {Record<string, any>} */
|
||||
const object = {};
|
||||
hydrated[index] = object;
|
||||
|
||||
for (const key in value) {
|
||||
if (key === '__proto__') {
|
||||
throw new Error('Cannot parse an object with a `__proto__` property');
|
||||
}
|
||||
|
||||
const n = value[key];
|
||||
object[key] = hydrate(n);
|
||||
}
|
||||
}
|
||||
|
||||
return hydrated[index];
|
||||
}
|
||||
|
||||
return hydrate(0);
|
||||
}
|
||||
265
.output/server/node_modules/devalue/src/stringify.js
generated
vendored
Normal file
265
.output/server/node_modules/devalue/src/stringify.js
generated
vendored
Normal file
@@ -0,0 +1,265 @@
|
||||
import {
|
||||
DevalueError,
|
||||
enumerable_symbols,
|
||||
get_type,
|
||||
is_plain_object,
|
||||
is_primitive,
|
||||
stringify_key,
|
||||
stringify_string
|
||||
} from './utils.js';
|
||||
import {
|
||||
HOLE,
|
||||
NAN,
|
||||
NEGATIVE_INFINITY,
|
||||
NEGATIVE_ZERO,
|
||||
POSITIVE_INFINITY,
|
||||
UNDEFINED
|
||||
} from './constants.js';
|
||||
import { encode64 } from './base64.js';
|
||||
|
||||
/**
|
||||
* Turn a value into a JSON string that can be parsed with `devalue.parse`
|
||||
* @param {any} value
|
||||
* @param {Record<string, (value: any) => any>} [reducers]
|
||||
*/
|
||||
export function stringify(value, reducers) {
|
||||
/** @type {any[]} */
|
||||
const stringified = [];
|
||||
|
||||
/** @type {Map<any, number>} */
|
||||
const indexes = new Map();
|
||||
|
||||
/** @type {Array<{ key: string, fn: (value: any) => any }>} */
|
||||
const custom = [];
|
||||
if (reducers) {
|
||||
for (const key of Object.getOwnPropertyNames(reducers)) {
|
||||
custom.push({ key, fn: reducers[key] });
|
||||
}
|
||||
}
|
||||
|
||||
/** @type {string[]} */
|
||||
const keys = [];
|
||||
|
||||
let p = 0;
|
||||
|
||||
/** @param {any} thing */
|
||||
function flatten(thing) {
|
||||
if (thing === undefined) return UNDEFINED;
|
||||
if (Number.isNaN(thing)) return NAN;
|
||||
if (thing === Infinity) return POSITIVE_INFINITY;
|
||||
if (thing === -Infinity) return NEGATIVE_INFINITY;
|
||||
if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO;
|
||||
|
||||
if (indexes.has(thing)) return indexes.get(thing);
|
||||
|
||||
const index = p++;
|
||||
indexes.set(thing, index);
|
||||
|
||||
for (const { key, fn } of custom) {
|
||||
const value = fn(thing);
|
||||
if (value) {
|
||||
stringified[index] = `["${key}",${flatten(value)}]`;
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof thing === 'function') {
|
||||
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
|
||||
}
|
||||
|
||||
let str = '';
|
||||
|
||||
if (is_primitive(thing)) {
|
||||
str = stringify_primitive(thing);
|
||||
} else {
|
||||
const type = get_type(thing);
|
||||
|
||||
switch (type) {
|
||||
case 'Number':
|
||||
case 'String':
|
||||
case 'Boolean':
|
||||
str = `["Object",${stringify_primitive(thing)}]`;
|
||||
break;
|
||||
|
||||
case 'BigInt':
|
||||
str = `["BigInt",${thing}]`;
|
||||
break;
|
||||
|
||||
case 'Date':
|
||||
const valid = !isNaN(thing.getDate());
|
||||
str = `["Date","${valid ? thing.toISOString() : ''}"]`;
|
||||
break;
|
||||
|
||||
case 'URL':
|
||||
str = `["URL",${stringify_string(thing.toString())}]`;
|
||||
break;
|
||||
|
||||
case 'URLSearchParams':
|
||||
str = `["URLSearchParams",${stringify_string(thing.toString())}]`;
|
||||
break;
|
||||
|
||||
case 'RegExp':
|
||||
const { source, flags } = thing;
|
||||
str = flags
|
||||
? `["RegExp",${stringify_string(source)},"${flags}"]`
|
||||
: `["RegExp",${stringify_string(source)}]`;
|
||||
break;
|
||||
|
||||
case 'Array':
|
||||
str = '[';
|
||||
|
||||
for (let i = 0; i < thing.length; i += 1) {
|
||||
if (i > 0) str += ',';
|
||||
|
||||
if (i in thing) {
|
||||
keys.push(`[${i}]`);
|
||||
str += flatten(thing[i]);
|
||||
keys.pop();
|
||||
} else {
|
||||
str += HOLE;
|
||||
}
|
||||
}
|
||||
|
||||
str += ']';
|
||||
|
||||
break;
|
||||
|
||||
case 'Set':
|
||||
str = '["Set"';
|
||||
|
||||
for (const value of thing) {
|
||||
str += `,${flatten(value)}`;
|
||||
}
|
||||
|
||||
str += ']';
|
||||
break;
|
||||
|
||||
case 'Map':
|
||||
str = '["Map"';
|
||||
|
||||
for (const [key, value] of thing) {
|
||||
keys.push(
|
||||
`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`
|
||||
);
|
||||
str += `,${flatten(key)},${flatten(value)}`;
|
||||
keys.pop();
|
||||
}
|
||||
|
||||
str += ']';
|
||||
break;
|
||||
|
||||
case 'Int8Array':
|
||||
case 'Uint8Array':
|
||||
case 'Uint8ClampedArray':
|
||||
case 'Int16Array':
|
||||
case 'Uint16Array':
|
||||
case 'Int32Array':
|
||||
case 'Uint32Array':
|
||||
case 'Float32Array':
|
||||
case 'Float64Array':
|
||||
case 'BigInt64Array':
|
||||
case 'BigUint64Array': {
|
||||
/** @type {import("./types.js").TypedArray} */
|
||||
const typedArray = thing;
|
||||
str = '["' + type + '",' + flatten(typedArray.buffer);
|
||||
|
||||
const a = thing.byteOffset;
|
||||
const b = a + thing.byteLength;
|
||||
|
||||
// handle subarrays
|
||||
if (a > 0 || b !== typedArray.buffer.byteLength) {
|
||||
const m = +/(\d+)/.exec(type)[1] / 8;
|
||||
str += `,${a / m},${b / m}`;
|
||||
}
|
||||
|
||||
str += ']';
|
||||
break;
|
||||
}
|
||||
|
||||
case 'ArrayBuffer': {
|
||||
/** @type {ArrayBuffer} */
|
||||
const arraybuffer = thing;
|
||||
const base64 = encode64(arraybuffer);
|
||||
|
||||
str = `["ArrayBuffer","${base64}"]`;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'Temporal.Duration':
|
||||
case 'Temporal.Instant':
|
||||
case 'Temporal.PlainDate':
|
||||
case 'Temporal.PlainTime':
|
||||
case 'Temporal.PlainDateTime':
|
||||
case 'Temporal.PlainMonthDay':
|
||||
case 'Temporal.PlainYearMonth':
|
||||
case 'Temporal.ZonedDateTime':
|
||||
str = `["${type}",${stringify_string(thing.toString())}]`;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!is_plain_object(thing)) {
|
||||
throw new DevalueError(
|
||||
`Cannot stringify arbitrary non-POJOs`,
|
||||
keys,
|
||||
thing,
|
||||
value
|
||||
);
|
||||
}
|
||||
|
||||
if (enumerable_symbols(thing).length > 0) {
|
||||
throw new DevalueError(
|
||||
`Cannot stringify POJOs with symbolic keys`,
|
||||
keys,
|
||||
thing,
|
||||
value
|
||||
);
|
||||
}
|
||||
|
||||
if (Object.getPrototypeOf(thing) === null) {
|
||||
str = '["null"';
|
||||
for (const key in thing) {
|
||||
keys.push(stringify_key(key));
|
||||
str += `,${stringify_string(key)},${flatten(thing[key])}`;
|
||||
keys.pop();
|
||||
}
|
||||
str += ']';
|
||||
} else {
|
||||
str = '{';
|
||||
let started = false;
|
||||
for (const key in thing) {
|
||||
if (started) str += ',';
|
||||
started = true;
|
||||
keys.push(stringify_key(key));
|
||||
str += `${stringify_string(key)}:${flatten(thing[key])}`;
|
||||
keys.pop();
|
||||
}
|
||||
str += '}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stringified[index] = str;
|
||||
return index;
|
||||
}
|
||||
|
||||
const index = flatten(value);
|
||||
|
||||
// special case — value is represented as a negative index
|
||||
if (index < 0) return `${index}`;
|
||||
|
||||
return `[${stringified.join(',')}]`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {any} thing
|
||||
* @returns {string}
|
||||
*/
|
||||
function stringify_primitive(thing) {
|
||||
const type = typeof thing;
|
||||
if (type === 'string') return stringify_string(thing);
|
||||
if (thing instanceof String) return stringify_string(thing.toString());
|
||||
if (thing === void 0) return UNDEFINED.toString();
|
||||
if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString();
|
||||
if (type === 'bigint') return `["BigInt","${thing}"]`;
|
||||
return String(thing);
|
||||
}
|
||||
407
.output/server/node_modules/devalue/src/uneval.js
generated
vendored
Normal file
407
.output/server/node_modules/devalue/src/uneval.js
generated
vendored
Normal file
@@ -0,0 +1,407 @@
|
||||
import {
|
||||
DevalueError,
|
||||
enumerable_symbols,
|
||||
escaped,
|
||||
get_type,
|
||||
is_plain_object,
|
||||
is_primitive,
|
||||
stringify_key,
|
||||
stringify_string
|
||||
} from './utils.js';
|
||||
|
||||
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
|
||||
const unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
|
||||
const reserved =
|
||||
/^(?:do|if|in|for|int|let|new|try|var|byte|case|char|else|enum|goto|long|this|void|with|await|break|catch|class|const|final|float|short|super|throw|while|yield|delete|double|export|import|native|return|switch|throws|typeof|boolean|default|extends|finally|package|private|abstract|continue|debugger|function|volatile|interface|protected|transient|implements|instanceof|synchronized)$/;
|
||||
|
||||
/**
|
||||
* Turn a value into the JavaScript that creates an equivalent value
|
||||
* @param {any} value
|
||||
* @param {(value: any, uneval: (value: any) => string) => string | void} [replacer]
|
||||
*/
|
||||
export function uneval(value, replacer) {
|
||||
const counts = new Map();
|
||||
|
||||
/** @type {string[]} */
|
||||
const keys = [];
|
||||
|
||||
const custom = new Map();
|
||||
|
||||
/** @param {any} thing */
|
||||
function walk(thing) {
|
||||
if (!is_primitive(thing)) {
|
||||
if (counts.has(thing)) {
|
||||
counts.set(thing, counts.get(thing) + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
counts.set(thing, 1);
|
||||
|
||||
if (replacer) {
|
||||
const str = replacer(thing, (value) => uneval(value, replacer));
|
||||
|
||||
if (typeof str === 'string') {
|
||||
custom.set(thing, str);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof thing === 'function') {
|
||||
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
|
||||
}
|
||||
|
||||
const type = get_type(thing);
|
||||
|
||||
switch (type) {
|
||||
case 'Number':
|
||||
case 'BigInt':
|
||||
case 'String':
|
||||
case 'Boolean':
|
||||
case 'Date':
|
||||
case 'RegExp':
|
||||
case 'URL':
|
||||
case 'URLSearchParams':
|
||||
return;
|
||||
|
||||
case 'Array':
|
||||
/** @type {any[]} */ (thing).forEach((value, i) => {
|
||||
keys.push(`[${i}]`);
|
||||
walk(value);
|
||||
keys.pop();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'Set':
|
||||
Array.from(thing).forEach(walk);
|
||||
break;
|
||||
|
||||
case 'Map':
|
||||
for (const [key, value] of thing) {
|
||||
keys.push(
|
||||
`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`
|
||||
);
|
||||
walk(value);
|
||||
keys.pop();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'Int8Array':
|
||||
case 'Uint8Array':
|
||||
case 'Uint8ClampedArray':
|
||||
case 'Int16Array':
|
||||
case 'Uint16Array':
|
||||
case 'Int32Array':
|
||||
case 'Uint32Array':
|
||||
case 'Float32Array':
|
||||
case 'Float64Array':
|
||||
case 'BigInt64Array':
|
||||
case 'BigUint64Array':
|
||||
walk(thing.buffer);
|
||||
return;
|
||||
|
||||
case 'ArrayBuffer':
|
||||
return;
|
||||
|
||||
case 'Temporal.Duration':
|
||||
case 'Temporal.Instant':
|
||||
case 'Temporal.PlainDate':
|
||||
case 'Temporal.PlainTime':
|
||||
case 'Temporal.PlainDateTime':
|
||||
case 'Temporal.PlainMonthDay':
|
||||
case 'Temporal.PlainYearMonth':
|
||||
case 'Temporal.ZonedDateTime':
|
||||
return;
|
||||
|
||||
default:
|
||||
if (!is_plain_object(thing)) {
|
||||
throw new DevalueError(
|
||||
`Cannot stringify arbitrary non-POJOs`,
|
||||
keys,
|
||||
thing,
|
||||
value
|
||||
);
|
||||
}
|
||||
|
||||
if (enumerable_symbols(thing).length > 0) {
|
||||
throw new DevalueError(
|
||||
`Cannot stringify POJOs with symbolic keys`,
|
||||
keys,
|
||||
thing,
|
||||
value
|
||||
);
|
||||
}
|
||||
|
||||
for (const key in thing) {
|
||||
keys.push(stringify_key(key));
|
||||
walk(thing[key]);
|
||||
keys.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
walk(value);
|
||||
|
||||
const names = new Map();
|
||||
|
||||
Array.from(counts)
|
||||
.filter((entry) => entry[1] > 1)
|
||||
.sort((a, b) => b[1] - a[1])
|
||||
.forEach((entry, i) => {
|
||||
names.set(entry[0], get_name(i));
|
||||
});
|
||||
|
||||
/**
|
||||
* @param {any} thing
|
||||
* @returns {string}
|
||||
*/
|
||||
function stringify(thing) {
|
||||
if (names.has(thing)) {
|
||||
return names.get(thing);
|
||||
}
|
||||
|
||||
if (is_primitive(thing)) {
|
||||
return stringify_primitive(thing);
|
||||
}
|
||||
|
||||
if (custom.has(thing)) {
|
||||
return custom.get(thing);
|
||||
}
|
||||
|
||||
const type = get_type(thing);
|
||||
|
||||
switch (type) {
|
||||
case 'Number':
|
||||
case 'String':
|
||||
case 'Boolean':
|
||||
return `Object(${stringify(thing.valueOf())})`;
|
||||
|
||||
case 'RegExp':
|
||||
return `new RegExp(${stringify_string(thing.source)}, "${
|
||||
thing.flags
|
||||
}")`;
|
||||
|
||||
case 'Date':
|
||||
return `new Date(${thing.getTime()})`;
|
||||
|
||||
case 'URL':
|
||||
return `new URL(${stringify_string(thing.toString())})`;
|
||||
|
||||
case 'URLSearchParams':
|
||||
return `new URLSearchParams(${stringify_string(thing.toString())})`;
|
||||
|
||||
case 'Array':
|
||||
const members = /** @type {any[]} */ (thing).map((v, i) =>
|
||||
i in thing ? stringify(v) : ''
|
||||
);
|
||||
const tail = thing.length === 0 || thing.length - 1 in thing ? '' : ',';
|
||||
return `[${members.join(',')}${tail}]`;
|
||||
|
||||
case 'Set':
|
||||
case 'Map':
|
||||
return `new ${type}([${Array.from(thing).map(stringify).join(',')}])`;
|
||||
|
||||
case 'Int8Array':
|
||||
case 'Uint8Array':
|
||||
case 'Uint8ClampedArray':
|
||||
case 'Int16Array':
|
||||
case 'Uint16Array':
|
||||
case 'Int32Array':
|
||||
case 'Uint32Array':
|
||||
case 'Float32Array':
|
||||
case 'Float64Array':
|
||||
case 'BigInt64Array':
|
||||
case 'BigUint64Array': {
|
||||
let str = `new ${type}`;
|
||||
|
||||
if (counts.get(thing.buffer) === 1) {
|
||||
const array = new thing.constructor(thing.buffer);
|
||||
str += `([${array}])`;
|
||||
} else {
|
||||
str += `([${stringify(thing.buffer)}])`;
|
||||
}
|
||||
|
||||
const a = thing.byteOffset;
|
||||
const b = a + thing.byteLength;
|
||||
|
||||
// handle subarrays
|
||||
if (a > 0 || b !== thing.buffer.byteLength) {
|
||||
const m = +/(\d+)/.exec(type)[1] / 8;
|
||||
str += `.subarray(${a / m},${b / m})`;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
case 'ArrayBuffer': {
|
||||
const ui8 = new Uint8Array(thing);
|
||||
return `new Uint8Array([${ui8.toString()}]).buffer`;
|
||||
}
|
||||
|
||||
case 'Temporal.Duration':
|
||||
case 'Temporal.Instant':
|
||||
case 'Temporal.PlainDate':
|
||||
case 'Temporal.PlainTime':
|
||||
case 'Temporal.PlainDateTime':
|
||||
case 'Temporal.PlainMonthDay':
|
||||
case 'Temporal.PlainYearMonth':
|
||||
case 'Temporal.ZonedDateTime':
|
||||
return `${type}.from(${stringify_string(thing.toString())})`;
|
||||
|
||||
default:
|
||||
const keys = Object.keys(thing);
|
||||
const obj = keys
|
||||
.map((key) => `${safe_key(key)}:${stringify(thing[key])}`)
|
||||
.join(',');
|
||||
const proto = Object.getPrototypeOf(thing);
|
||||
if (proto === null) {
|
||||
return keys.length > 0
|
||||
? `{${obj},__proto__:null}`
|
||||
: `{__proto__:null}`;
|
||||
}
|
||||
|
||||
return `{${obj}}`;
|
||||
}
|
||||
}
|
||||
|
||||
const str = stringify(value);
|
||||
|
||||
if (names.size) {
|
||||
/** @type {string[]} */
|
||||
const params = [];
|
||||
|
||||
/** @type {string[]} */
|
||||
const statements = [];
|
||||
|
||||
/** @type {string[]} */
|
||||
const values = [];
|
||||
|
||||
names.forEach((name, thing) => {
|
||||
params.push(name);
|
||||
|
||||
if (custom.has(thing)) {
|
||||
values.push(/** @type {string} */ (custom.get(thing)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_primitive(thing)) {
|
||||
values.push(stringify_primitive(thing));
|
||||
return;
|
||||
}
|
||||
|
||||
const type = get_type(thing);
|
||||
|
||||
switch (type) {
|
||||
case 'Number':
|
||||
case 'String':
|
||||
case 'Boolean':
|
||||
values.push(`Object(${stringify(thing.valueOf())})`);
|
||||
break;
|
||||
|
||||
case 'RegExp':
|
||||
values.push(thing.toString());
|
||||
break;
|
||||
|
||||
case 'Date':
|
||||
values.push(`new Date(${thing.getTime()})`);
|
||||
break;
|
||||
|
||||
case 'Array':
|
||||
values.push(`Array(${thing.length})`);
|
||||
/** @type {any[]} */ (thing).forEach((v, i) => {
|
||||
statements.push(`${name}[${i}]=${stringify(v)}`);
|
||||
});
|
||||
break;
|
||||
|
||||
case 'Set':
|
||||
values.push(`new Set`);
|
||||
statements.push(
|
||||
`${name}.${Array.from(thing)
|
||||
.map((v) => `add(${stringify(v)})`)
|
||||
.join('.')}`
|
||||
);
|
||||
break;
|
||||
|
||||
case 'Map':
|
||||
values.push(`new Map`);
|
||||
statements.push(
|
||||
`${name}.${Array.from(thing)
|
||||
.map(([k, v]) => `set(${stringify(k)}, ${stringify(v)})`)
|
||||
.join('.')}`
|
||||
);
|
||||
break;
|
||||
|
||||
case 'ArrayBuffer':
|
||||
values.push(
|
||||
`new Uint8Array([${new Uint8Array(thing).join(',')}]).buffer`
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
values.push(
|
||||
Object.getPrototypeOf(thing) === null ? 'Object.create(null)' : '{}'
|
||||
);
|
||||
Object.keys(thing).forEach((key) => {
|
||||
statements.push(
|
||||
`${name}${safe_prop(key)}=${stringify(thing[key])}`
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
statements.push(`return ${str}`);
|
||||
|
||||
return `(function(${params.join(',')}){${statements.join(
|
||||
';'
|
||||
)}}(${values.join(',')}))`;
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
/** @param {number} num */
|
||||
function get_name(num) {
|
||||
let name = '';
|
||||
|
||||
do {
|
||||
name = chars[num % chars.length] + name;
|
||||
num = ~~(num / chars.length) - 1;
|
||||
} while (num >= 0);
|
||||
|
||||
return reserved.test(name) ? `${name}0` : name;
|
||||
}
|
||||
|
||||
/** @param {string} c */
|
||||
function escape_unsafe_char(c) {
|
||||
return escaped[c] || c;
|
||||
}
|
||||
|
||||
/** @param {string} str */
|
||||
function escape_unsafe_chars(str) {
|
||||
return str.replace(unsafe_chars, escape_unsafe_char);
|
||||
}
|
||||
|
||||
/** @param {string} key */
|
||||
function safe_key(key) {
|
||||
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key)
|
||||
? key
|
||||
: escape_unsafe_chars(JSON.stringify(key));
|
||||
}
|
||||
|
||||
/** @param {string} key */
|
||||
function safe_prop(key) {
|
||||
return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key)
|
||||
? `.${key}`
|
||||
: `[${escape_unsafe_chars(JSON.stringify(key))}]`;
|
||||
}
|
||||
|
||||
/** @param {any} thing */
|
||||
function stringify_primitive(thing) {
|
||||
if (typeof thing === 'string') return stringify_string(thing);
|
||||
if (thing === void 0) return 'void 0';
|
||||
if (thing === 0 && 1 / thing < 0) return '-0';
|
||||
const str = String(thing);
|
||||
if (typeof thing === 'number') return str.replace(/^(-)?0\./, '$1.');
|
||||
if (typeof thing === 'bigint') return thing + 'n';
|
||||
return str;
|
||||
}
|
||||
118
.output/server/node_modules/devalue/src/utils.js
generated
vendored
Normal file
118
.output/server/node_modules/devalue/src/utils.js
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
/** @type {Record<string, string>} */
|
||||
export const escaped = {
|
||||
'<': '\\u003C',
|
||||
'\\': '\\\\',
|
||||
'\b': '\\b',
|
||||
'\f': '\\f',
|
||||
'\n': '\\n',
|
||||
'\r': '\\r',
|
||||
'\t': '\\t',
|
||||
'\u2028': '\\u2028',
|
||||
'\u2029': '\\u2029'
|
||||
};
|
||||
|
||||
export class DevalueError extends Error {
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {string[]} keys
|
||||
* @param {any} [value] - The value that failed to be serialized
|
||||
* @param {any} [root] - The root value being serialized
|
||||
*/
|
||||
constructor(message, keys, value, root) {
|
||||
super(message);
|
||||
this.name = 'DevalueError';
|
||||
this.path = keys.join('');
|
||||
this.value = value;
|
||||
this.root = root;
|
||||
}
|
||||
}
|
||||
|
||||
/** @param {any} thing */
|
||||
export function is_primitive(thing) {
|
||||
return Object(thing) !== thing;
|
||||
}
|
||||
|
||||
const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(
|
||||
Object.prototype
|
||||
)
|
||||
.sort()
|
||||
.join('\0');
|
||||
|
||||
/** @param {any} thing */
|
||||
export function is_plain_object(thing) {
|
||||
const proto = Object.getPrototypeOf(thing);
|
||||
|
||||
return (
|
||||
proto === Object.prototype ||
|
||||
proto === null ||
|
||||
Object.getPrototypeOf(proto) === null ||
|
||||
Object.getOwnPropertyNames(proto).sort().join('\0') === object_proto_names
|
||||
);
|
||||
}
|
||||
|
||||
/** @param {any} thing */
|
||||
export function get_type(thing) {
|
||||
return Object.prototype.toString.call(thing).slice(8, -1);
|
||||
}
|
||||
|
||||
/** @param {string} char */
|
||||
function get_escaped_char(char) {
|
||||
switch (char) {
|
||||
case '"':
|
||||
return '\\"';
|
||||
case '<':
|
||||
return '\\u003C';
|
||||
case '\\':
|
||||
return '\\\\';
|
||||
case '\n':
|
||||
return '\\n';
|
||||
case '\r':
|
||||
return '\\r';
|
||||
case '\t':
|
||||
return '\\t';
|
||||
case '\b':
|
||||
return '\\b';
|
||||
case '\f':
|
||||
return '\\f';
|
||||
case '\u2028':
|
||||
return '\\u2028';
|
||||
case '\u2029':
|
||||
return '\\u2029';
|
||||
default:
|
||||
return char < ' '
|
||||
? `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`
|
||||
: '';
|
||||
}
|
||||
}
|
||||
|
||||
/** @param {string} str */
|
||||
export function stringify_string(str) {
|
||||
let result = '';
|
||||
let last_pos = 0;
|
||||
const len = str.length;
|
||||
|
||||
for (let i = 0; i < len; i += 1) {
|
||||
const char = str[i];
|
||||
const replacement = get_escaped_char(char);
|
||||
if (replacement) {
|
||||
result += str.slice(last_pos, i) + replacement;
|
||||
last_pos = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return `"${last_pos === 0 ? str : result + str.slice(last_pos)}"`;
|
||||
}
|
||||
|
||||
/** @param {Record<string | symbol, any>} object */
|
||||
export function enumerable_symbols(object) {
|
||||
return Object.getOwnPropertySymbols(object).filter(
|
||||
(symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable
|
||||
);
|
||||
}
|
||||
|
||||
const is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
||||
|
||||
/** @param {string} key */
|
||||
export function stringify_key(key) {
|
||||
return is_identifier.test(key) ? '.' + key : '[' + JSON.stringify(key) + ']';
|
||||
}
|
||||
77
.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js
generated
vendored
Normal file
77
.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fromCodePoint = void 0;
|
||||
exports.replaceCodePoint = replaceCodePoint;
|
||||
exports.decodeCodePoint = decodeCodePoint;
|
||||
const decodeMap = new Map([
|
||||
[0, 65533],
|
||||
// C1 Unicode control character reference replacements
|
||||
[128, 8364],
|
||||
[130, 8218],
|
||||
[131, 402],
|
||||
[132, 8222],
|
||||
[133, 8230],
|
||||
[134, 8224],
|
||||
[135, 8225],
|
||||
[136, 710],
|
||||
[137, 8240],
|
||||
[138, 352],
|
||||
[139, 8249],
|
||||
[140, 338],
|
||||
[142, 381],
|
||||
[145, 8216],
|
||||
[146, 8217],
|
||||
[147, 8220],
|
||||
[148, 8221],
|
||||
[149, 8226],
|
||||
[150, 8211],
|
||||
[151, 8212],
|
||||
[152, 732],
|
||||
[153, 8482],
|
||||
[154, 353],
|
||||
[155, 8250],
|
||||
[156, 339],
|
||||
[158, 382],
|
||||
[159, 376],
|
||||
]);
|
||||
/**
|
||||
* Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
|
||||
*/
|
||||
exports.fromCodePoint =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, n/no-unsupported-features/es-builtins
|
||||
(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : ((codePoint) => {
|
||||
let output = "";
|
||||
if (codePoint > 65535) {
|
||||
codePoint -= 65536;
|
||||
output += String.fromCharCode(((codePoint >>> 10) & 1023) | 55296);
|
||||
codePoint = 56320 | (codePoint & 1023);
|
||||
}
|
||||
output += String.fromCharCode(codePoint);
|
||||
return output;
|
||||
});
|
||||
/**
|
||||
* Replace the given code point with a replacement character if it is a
|
||||
* surrogate or is outside the valid range. Otherwise return the code
|
||||
* point unchanged.
|
||||
*/
|
||||
function replaceCodePoint(codePoint) {
|
||||
var _a;
|
||||
if ((codePoint >= 55296 && codePoint <= 57343) ||
|
||||
codePoint > 1114111) {
|
||||
return 65533;
|
||||
}
|
||||
return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;
|
||||
}
|
||||
/**
|
||||
* Replace the code point if relevant, then convert it to a string.
|
||||
*
|
||||
* @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
|
||||
* @param codePoint The code point to decode.
|
||||
* @returns The decoded code point.
|
||||
*/
|
||||
function decodeCodePoint(codePoint) {
|
||||
return (0, exports.fromCodePoint)(replaceCodePoint(codePoint));
|
||||
}
|
||||
//# sourceMappingURL=decode-codepoint.js.map
|
||||
568
.output/server/node_modules/entities/dist/commonjs/decode.js
generated
vendored
Normal file
568
.output/server/node_modules/entities/dist/commonjs/decode.js
generated
vendored
Normal file
@@ -0,0 +1,568 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.xmlDecodeTree = exports.htmlDecodeTree = exports.replaceCodePoint = exports.fromCodePoint = exports.decodeCodePoint = exports.EntityDecoder = exports.DecodingMode = void 0;
|
||||
exports.determineBranch = determineBranch;
|
||||
exports.decodeHTML = decodeHTML;
|
||||
exports.decodeHTMLAttribute = decodeHTMLAttribute;
|
||||
exports.decodeHTMLStrict = decodeHTMLStrict;
|
||||
exports.decodeXML = decodeXML;
|
||||
const decode_codepoint_js_1 = require("./decode-codepoint.js");
|
||||
const decode_data_html_js_1 = require("./generated/decode-data-html.js");
|
||||
const decode_data_xml_js_1 = require("./generated/decode-data-xml.js");
|
||||
const bin_trie_flags_js_1 = require("./internal/bin-trie-flags.js");
|
||||
var CharCodes;
|
||||
(function (CharCodes) {
|
||||
CharCodes[CharCodes["NUM"] = 35] = "NUM";
|
||||
CharCodes[CharCodes["SEMI"] = 59] = "SEMI";
|
||||
CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS";
|
||||
CharCodes[CharCodes["ZERO"] = 48] = "ZERO";
|
||||
CharCodes[CharCodes["NINE"] = 57] = "NINE";
|
||||
CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A";
|
||||
CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F";
|
||||
CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X";
|
||||
CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z";
|
||||
CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A";
|
||||
CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F";
|
||||
CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z";
|
||||
})(CharCodes || (CharCodes = {}));
|
||||
/** Bit that needs to be set to convert an upper case ASCII character to lower case */
|
||||
const TO_LOWER_BIT = 32;
|
||||
function isNumber(code) {
|
||||
return code >= CharCodes.ZERO && code <= CharCodes.NINE;
|
||||
}
|
||||
function isHexadecimalCharacter(code) {
|
||||
return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||
|
||||
(code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F));
|
||||
}
|
||||
function isAsciiAlphaNumeric(code) {
|
||||
return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||
|
||||
(code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||
|
||||
isNumber(code));
|
||||
}
|
||||
/**
|
||||
* Checks if the given character is a valid end character for an entity in an attribute.
|
||||
*
|
||||
* Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.
|
||||
* See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
|
||||
*/
|
||||
function isEntityInAttributeInvalidEnd(code) {
|
||||
return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
|
||||
}
|
||||
var EntityDecoderState;
|
||||
(function (EntityDecoderState) {
|
||||
EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart";
|
||||
EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart";
|
||||
EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal";
|
||||
EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex";
|
||||
EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity";
|
||||
})(EntityDecoderState || (EntityDecoderState = {}));
|
||||
var DecodingMode;
|
||||
(function (DecodingMode) {
|
||||
/** Entities in text nodes that can end with any character. */
|
||||
DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
|
||||
/** Only allow entities terminated with a semicolon. */
|
||||
DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
|
||||
/** Entities in attributes have limitations on ending characters. */
|
||||
DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
|
||||
})(DecodingMode || (exports.DecodingMode = DecodingMode = {}));
|
||||
/**
|
||||
* Token decoder with support of writing partial entities.
|
||||
*/
|
||||
class EntityDecoder {
|
||||
constructor(
|
||||
/** The tree used to decode entities. */
|
||||
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: False positive
|
||||
decodeTree,
|
||||
/**
|
||||
* The function that is called when a codepoint is decoded.
|
||||
*
|
||||
* For multi-byte named entities, this will be called multiple times,
|
||||
* with the second codepoint, and the same `consumed` value.
|
||||
*
|
||||
* @param codepoint The decoded codepoint.
|
||||
* @param consumed The number of bytes consumed by the decoder.
|
||||
*/
|
||||
emitCodePoint,
|
||||
/** An object that is used to produce errors. */
|
||||
errors) {
|
||||
this.decodeTree = decodeTree;
|
||||
this.emitCodePoint = emitCodePoint;
|
||||
this.errors = errors;
|
||||
/** The current state of the decoder. */
|
||||
this.state = EntityDecoderState.EntityStart;
|
||||
/** Characters that were consumed while parsing an entity. */
|
||||
this.consumed = 1;
|
||||
/**
|
||||
* The result of the entity.
|
||||
*
|
||||
* Either the result index of a numeric entity, or the codepoint of a
|
||||
* numeric entity.
|
||||
*/
|
||||
this.result = 0;
|
||||
/** The current index in the decode tree. */
|
||||
this.treeIndex = 0;
|
||||
/** The number of characters that were consumed in excess. */
|
||||
this.excess = 1;
|
||||
/** The mode in which the decoder is operating. */
|
||||
this.decodeMode = DecodingMode.Strict;
|
||||
/** The number of characters that have been consumed in the current run. */
|
||||
this.runConsumed = 0;
|
||||
}
|
||||
/** Resets the instance to make it reusable. */
|
||||
startEntity(decodeMode) {
|
||||
this.decodeMode = decodeMode;
|
||||
this.state = EntityDecoderState.EntityStart;
|
||||
this.result = 0;
|
||||
this.treeIndex = 0;
|
||||
this.excess = 1;
|
||||
this.consumed = 1;
|
||||
this.runConsumed = 0;
|
||||
}
|
||||
/**
|
||||
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
||||
* If the entity is incomplete, the decoder will return -1.
|
||||
*
|
||||
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
|
||||
* entity is incomplete, and resume when the next string is written.
|
||||
*
|
||||
* @param input The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
write(input, offset) {
|
||||
switch (this.state) {
|
||||
case EntityDecoderState.EntityStart: {
|
||||
if (input.charCodeAt(offset) === CharCodes.NUM) {
|
||||
this.state = EntityDecoderState.NumericStart;
|
||||
this.consumed += 1;
|
||||
return this.stateNumericStart(input, offset + 1);
|
||||
}
|
||||
this.state = EntityDecoderState.NamedEntity;
|
||||
return this.stateNamedEntity(input, offset);
|
||||
}
|
||||
case EntityDecoderState.NumericStart: {
|
||||
return this.stateNumericStart(input, offset);
|
||||
}
|
||||
case EntityDecoderState.NumericDecimal: {
|
||||
return this.stateNumericDecimal(input, offset);
|
||||
}
|
||||
case EntityDecoderState.NumericHex: {
|
||||
return this.stateNumericHex(input, offset);
|
||||
}
|
||||
case EntityDecoderState.NamedEntity: {
|
||||
return this.stateNamedEntity(input, offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Switches between the numeric decimal and hexadecimal states.
|
||||
*
|
||||
* Equivalent to the `Numeric character reference state` in the HTML spec.
|
||||
*
|
||||
* @param input The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
stateNumericStart(input, offset) {
|
||||
if (offset >= input.length) {
|
||||
return -1;
|
||||
}
|
||||
if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
|
||||
this.state = EntityDecoderState.NumericHex;
|
||||
this.consumed += 1;
|
||||
return this.stateNumericHex(input, offset + 1);
|
||||
}
|
||||
this.state = EntityDecoderState.NumericDecimal;
|
||||
return this.stateNumericDecimal(input, offset);
|
||||
}
|
||||
/**
|
||||
* Parses a hexadecimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Hexademical character reference state` in the HTML spec.
|
||||
*
|
||||
* @param input The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
stateNumericHex(input, offset) {
|
||||
while (offset < input.length) {
|
||||
const char = input.charCodeAt(offset);
|
||||
if (isNumber(char) || isHexadecimalCharacter(char)) {
|
||||
// Convert hex digit to value (0-15); 'a'/'A' -> 10.
|
||||
const digit = char <= CharCodes.NINE
|
||||
? char - CharCodes.ZERO
|
||||
: (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;
|
||||
this.result = this.result * 16 + digit;
|
||||
this.consumed++;
|
||||
offset++;
|
||||
}
|
||||
else {
|
||||
return this.emitNumericEntity(char, 3);
|
||||
}
|
||||
}
|
||||
return -1; // Incomplete entity
|
||||
}
|
||||
/**
|
||||
* Parses a decimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Decimal character reference state` in the HTML spec.
|
||||
*
|
||||
* @param input The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
stateNumericDecimal(input, offset) {
|
||||
while (offset < input.length) {
|
||||
const char = input.charCodeAt(offset);
|
||||
if (isNumber(char)) {
|
||||
this.result = this.result * 10 + (char - CharCodes.ZERO);
|
||||
this.consumed++;
|
||||
offset++;
|
||||
}
|
||||
else {
|
||||
return this.emitNumericEntity(char, 2);
|
||||
}
|
||||
}
|
||||
return -1; // Incomplete entity
|
||||
}
|
||||
/**
|
||||
* Validate and emit a numeric entity.
|
||||
*
|
||||
* Implements the logic from the `Hexademical character reference start
|
||||
* state` and `Numeric character reference end state` in the HTML spec.
|
||||
*
|
||||
* @param lastCp The last code point of the entity. Used to see if the
|
||||
* entity was terminated with a semicolon.
|
||||
* @param expectedLength The minimum number of characters that should be
|
||||
* consumed. Used to validate that at least one digit
|
||||
* was consumed.
|
||||
* @returns The number of characters that were consumed.
|
||||
*/
|
||||
emitNumericEntity(lastCp, expectedLength) {
|
||||
var _a;
|
||||
// Ensure we consumed at least one digit.
|
||||
if (this.consumed <= expectedLength) {
|
||||
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
||||
return 0;
|
||||
}
|
||||
// Figure out if this is a legit end of the entity
|
||||
if (lastCp === CharCodes.SEMI) {
|
||||
this.consumed += 1;
|
||||
}
|
||||
else if (this.decodeMode === DecodingMode.Strict) {
|
||||
return 0;
|
||||
}
|
||||
this.emitCodePoint((0, decode_codepoint_js_1.replaceCodePoint)(this.result), this.consumed);
|
||||
if (this.errors) {
|
||||
if (lastCp !== CharCodes.SEMI) {
|
||||
this.errors.missingSemicolonAfterCharacterReference();
|
||||
}
|
||||
this.errors.validateNumericCharacterReference(this.result);
|
||||
}
|
||||
return this.consumed;
|
||||
}
|
||||
/**
|
||||
* Parses a named entity.
|
||||
*
|
||||
* Equivalent to the `Named character reference state` in the HTML spec.
|
||||
*
|
||||
* @param input The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
stateNamedEntity(input, offset) {
|
||||
const { decodeTree } = this;
|
||||
let current = decodeTree[this.treeIndex];
|
||||
// The length is the number of bytes of the value, including the current byte.
|
||||
let valueLength = (current & bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
while (offset < input.length) {
|
||||
// Handle compact runs (possibly inline): valueLength == 0 and SEMI_REQUIRED bit set.
|
||||
if (valueLength === 0 && (current & bin_trie_flags_js_1.BinTrieFlags.FLAG13) !== 0) {
|
||||
const runLength = (current & bin_trie_flags_js_1.BinTrieFlags.BRANCH_LENGTH) >> 7; /* 2..63 */
|
||||
// If we are starting a run, check the first char.
|
||||
if (this.runConsumed === 0) {
|
||||
const firstChar = current & bin_trie_flags_js_1.BinTrieFlags.JUMP_TABLE;
|
||||
if (input.charCodeAt(offset) !== firstChar) {
|
||||
return this.result === 0
|
||||
? 0
|
||||
: this.emitNotTerminatedNamedEntity();
|
||||
}
|
||||
offset++;
|
||||
this.excess++;
|
||||
this.runConsumed++;
|
||||
}
|
||||
// Check remaining characters in the run.
|
||||
while (this.runConsumed < runLength) {
|
||||
if (offset >= input.length) {
|
||||
return -1;
|
||||
}
|
||||
const charIndexInPacked = this.runConsumed - 1;
|
||||
const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];
|
||||
const expectedChar = charIndexInPacked % 2 === 0
|
||||
? packedWord & 0xff
|
||||
: (packedWord >> 8) & 0xff;
|
||||
if (input.charCodeAt(offset) !== expectedChar) {
|
||||
this.runConsumed = 0;
|
||||
return this.result === 0
|
||||
? 0
|
||||
: this.emitNotTerminatedNamedEntity();
|
||||
}
|
||||
offset++;
|
||||
this.excess++;
|
||||
this.runConsumed++;
|
||||
}
|
||||
this.runConsumed = 0;
|
||||
this.treeIndex += 1 + (runLength >> 1);
|
||||
current = decodeTree[this.treeIndex];
|
||||
valueLength = (current & bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
}
|
||||
if (offset >= input.length)
|
||||
break;
|
||||
const char = input.charCodeAt(offset);
|
||||
/*
|
||||
* Implicit semicolon handling for nodes that require a semicolon but
|
||||
* don't have an explicit ';' branch stored in the trie. If we have
|
||||
* a value on the current node, it requires a semicolon, and the
|
||||
* current input character is a semicolon, emit the entity using the
|
||||
* current node (without descending further).
|
||||
*/
|
||||
if (char === CharCodes.SEMI &&
|
||||
valueLength !== 0 &&
|
||||
(current & bin_trie_flags_js_1.BinTrieFlags.FLAG13) !== 0) {
|
||||
return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
|
||||
}
|
||||
this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
|
||||
if (this.treeIndex < 0) {
|
||||
return this.result === 0 ||
|
||||
// If we are parsing an attribute
|
||||
(this.decodeMode === DecodingMode.Attribute &&
|
||||
// We shouldn't have consumed any characters after the entity,
|
||||
(valueLength === 0 ||
|
||||
// And there should be no invalid characters.
|
||||
isEntityInAttributeInvalidEnd(char)))
|
||||
? 0
|
||||
: this.emitNotTerminatedNamedEntity();
|
||||
}
|
||||
current = decodeTree[this.treeIndex];
|
||||
valueLength = (current & bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
// If the branch is a value, store it and continue
|
||||
if (valueLength !== 0) {
|
||||
// If the entity is terminated by a semicolon, we are done.
|
||||
if (char === CharCodes.SEMI) {
|
||||
return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
|
||||
}
|
||||
// If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.
|
||||
if (this.decodeMode !== DecodingMode.Strict &&
|
||||
(current & bin_trie_flags_js_1.BinTrieFlags.FLAG13) === 0) {
|
||||
this.result = this.treeIndex;
|
||||
this.consumed += this.excess;
|
||||
this.excess = 0;
|
||||
}
|
||||
}
|
||||
// Increment offset & excess for next iteration
|
||||
offset++;
|
||||
this.excess++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
/**
|
||||
* Emit a named entity that was not terminated with a semicolon.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
emitNotTerminatedNamedEntity() {
|
||||
var _a;
|
||||
const { result, decodeTree } = this;
|
||||
const valueLength = (decodeTree[result] & bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
this.emitNamedEntityData(result, valueLength, this.consumed);
|
||||
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();
|
||||
return this.consumed;
|
||||
}
|
||||
/**
|
||||
* Emit a named entity.
|
||||
*
|
||||
* @param result The index of the entity in the decode tree.
|
||||
* @param valueLength The number of bytes in the entity.
|
||||
* @param consumed The number of characters consumed.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
emitNamedEntityData(result, valueLength, consumed) {
|
||||
const { decodeTree } = this;
|
||||
this.emitCodePoint(valueLength === 1
|
||||
? decodeTree[result] &
|
||||
~(bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH | bin_trie_flags_js_1.BinTrieFlags.FLAG13)
|
||||
: decodeTree[result + 1], consumed);
|
||||
if (valueLength === 3) {
|
||||
// For multi-byte values, we need to emit the second byte.
|
||||
this.emitCodePoint(decodeTree[result + 2], consumed);
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
/**
|
||||
* Signal to the parser that the end of the input was reached.
|
||||
*
|
||||
* Remaining data will be emitted and relevant errors will be produced.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
end() {
|
||||
var _a;
|
||||
switch (this.state) {
|
||||
case EntityDecoderState.NamedEntity: {
|
||||
// Emit a named entity if we have one.
|
||||
return this.result !== 0 &&
|
||||
(this.decodeMode !== DecodingMode.Attribute ||
|
||||
this.result === this.treeIndex)
|
||||
? this.emitNotTerminatedNamedEntity()
|
||||
: 0;
|
||||
}
|
||||
// Otherwise, emit a numeric entity if we have one.
|
||||
case EntityDecoderState.NumericDecimal: {
|
||||
return this.emitNumericEntity(0, 2);
|
||||
}
|
||||
case EntityDecoderState.NumericHex: {
|
||||
return this.emitNumericEntity(0, 3);
|
||||
}
|
||||
case EntityDecoderState.NumericStart: {
|
||||
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
||||
return 0;
|
||||
}
|
||||
case EntityDecoderState.EntityStart: {
|
||||
// Return 0 if we have no entity.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.EntityDecoder = EntityDecoder;
|
||||
/**
|
||||
* Creates a function that decodes entities in a string.
|
||||
*
|
||||
* @param decodeTree The decode tree.
|
||||
* @returns A function that decodes entities in a string.
|
||||
*/
|
||||
function getDecoder(decodeTree) {
|
||||
let returnValue = "";
|
||||
const decoder = new EntityDecoder(decodeTree, (data) => (returnValue += (0, decode_codepoint_js_1.fromCodePoint)(data)));
|
||||
return function decodeWithTrie(input, decodeMode) {
|
||||
let lastIndex = 0;
|
||||
let offset = 0;
|
||||
while ((offset = input.indexOf("&", offset)) >= 0) {
|
||||
returnValue += input.slice(lastIndex, offset);
|
||||
decoder.startEntity(decodeMode);
|
||||
const length = decoder.write(input,
|
||||
// Skip the "&"
|
||||
offset + 1);
|
||||
if (length < 0) {
|
||||
lastIndex = offset + decoder.end();
|
||||
break;
|
||||
}
|
||||
lastIndex = offset + length;
|
||||
// If `length` is 0, skip the current `&` and continue.
|
||||
offset = length === 0 ? lastIndex + 1 : lastIndex;
|
||||
}
|
||||
const result = returnValue + input.slice(lastIndex);
|
||||
// Make sure we don't keep a reference to the final string.
|
||||
returnValue = "";
|
||||
return result;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Determines the branch of the current node that is taken given the current
|
||||
* character. This function is used to traverse the trie.
|
||||
*
|
||||
* @param decodeTree The trie.
|
||||
* @param current The current node.
|
||||
* @param nodeIdx The index right after the current node and its value.
|
||||
* @param char The current character.
|
||||
* @returns The index of the next node, or -1 if no branch is taken.
|
||||
*/
|
||||
function determineBranch(decodeTree, current, nodeIndex, char) {
|
||||
const branchCount = (current & bin_trie_flags_js_1.BinTrieFlags.BRANCH_LENGTH) >> 7;
|
||||
const jumpOffset = current & bin_trie_flags_js_1.BinTrieFlags.JUMP_TABLE;
|
||||
// Case 1: Single branch encoded in jump offset
|
||||
if (branchCount === 0) {
|
||||
return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;
|
||||
}
|
||||
// Case 2: Multiple branches encoded in jump table
|
||||
if (jumpOffset) {
|
||||
const value = char - jumpOffset;
|
||||
return value < 0 || value >= branchCount
|
||||
? -1
|
||||
: decodeTree[nodeIndex + value] - 1;
|
||||
}
|
||||
// Case 3: Multiple branches encoded in packed dictionary (two keys per uint16)
|
||||
const packedKeySlots = (branchCount + 1) >> 1;
|
||||
/*
|
||||
* Treat packed keys as a virtual sorted array of length `branchCount`.
|
||||
* Key(i) = low byte for even i, high byte for odd i in slot i>>1.
|
||||
*/
|
||||
let lo = 0;
|
||||
let hi = branchCount - 1;
|
||||
while (lo <= hi) {
|
||||
const mid = (lo + hi) >>> 1;
|
||||
const slot = mid >> 1;
|
||||
const packed = decodeTree[nodeIndex + slot];
|
||||
const midKey = (packed >> ((mid & 1) * 8)) & 0xff;
|
||||
if (midKey < char) {
|
||||
lo = mid + 1;
|
||||
}
|
||||
else if (midKey > char) {
|
||||
hi = mid - 1;
|
||||
}
|
||||
else {
|
||||
return decodeTree[nodeIndex + packedKeySlots + mid];
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
const htmlDecoder = /* #__PURE__ */ getDecoder(decode_data_html_js_1.htmlDecodeTree);
|
||||
const xmlDecoder = /* #__PURE__ */ getDecoder(decode_data_xml_js_1.xmlDecodeTree);
|
||||
/**
|
||||
* Decodes an HTML string.
|
||||
*
|
||||
* @param htmlString The string to decode.
|
||||
* @param mode The decoding mode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
function decodeHTML(htmlString, mode = DecodingMode.Legacy) {
|
||||
return htmlDecoder(htmlString, mode);
|
||||
}
|
||||
/**
|
||||
* Decodes an HTML string in an attribute.
|
||||
*
|
||||
* @param htmlAttribute The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
function decodeHTMLAttribute(htmlAttribute) {
|
||||
return htmlDecoder(htmlAttribute, DecodingMode.Attribute);
|
||||
}
|
||||
/**
|
||||
* Decodes an HTML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param htmlString The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
function decodeHTMLStrict(htmlString) {
|
||||
return htmlDecoder(htmlString, DecodingMode.Strict);
|
||||
}
|
||||
/**
|
||||
* Decodes an XML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param xmlString The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
function decodeXML(xmlString) {
|
||||
return xmlDecoder(xmlString, DecodingMode.Strict);
|
||||
}
|
||||
var decode_codepoint_js_2 = require("./decode-codepoint.js");
|
||||
Object.defineProperty(exports, "decodeCodePoint", { enumerable: true, get: function () { return decode_codepoint_js_2.decodeCodePoint; } });
|
||||
Object.defineProperty(exports, "fromCodePoint", { enumerable: true, get: function () { return decode_codepoint_js_2.fromCodePoint; } });
|
||||
Object.defineProperty(exports, "replaceCodePoint", { enumerable: true, get: function () { return decode_codepoint_js_2.replaceCodePoint; } });
|
||||
// Re-export for use by eg. htmlparser2
|
||||
var decode_data_html_js_2 = require("./generated/decode-data-html.js");
|
||||
Object.defineProperty(exports, "htmlDecodeTree", { enumerable: true, get: function () { return decode_data_html_js_2.htmlDecodeTree; } });
|
||||
var decode_data_xml_js_2 = require("./generated/decode-data-xml.js");
|
||||
Object.defineProperty(exports, "xmlDecodeTree", { enumerable: true, get: function () { return decode_data_xml_js_2.xmlDecodeTree; } });
|
||||
//# sourceMappingURL=decode.js.map
|
||||
7
.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js
generated
vendored
Normal file
7
.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js
generated
vendored
Normal file
7
.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
// Generated using scripts/write-decode-map.ts
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.xmlDecodeTree = void 0;
|
||||
const decode_shared_js_1 = require("../internal/decode-shared.js");
|
||||
exports.xmlDecodeTree = (0, decode_shared_js_1.decodeBase64)("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");
|
||||
//# sourceMappingURL=decode-data-xml.js.map
|
||||
21
.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js
generated
vendored
Normal file
21
.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BinTrieFlags = void 0;
|
||||
/**
|
||||
* Bit flags & masks for the binary trie encoding used for entity decoding.
|
||||
*
|
||||
* Bit layout (16 bits total):
|
||||
* 15..14 VALUE_LENGTH (+1 encoding; 0 => no value)
|
||||
* 13 FLAG13. If valueLength>0: semicolon required flag (implicit ';').
|
||||
* If valueLength==0: compact run flag.
|
||||
* 12..7 BRANCH_LENGTH Branch length (0 => single branch in 6..0 if jumpOffset==char) OR run length (when compact run)
|
||||
* 6..0 JUMP_TABLE Jump offset (jump table) OR single-branch char code OR first run char
|
||||
*/
|
||||
var BinTrieFlags;
|
||||
(function (BinTrieFlags) {
|
||||
BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
|
||||
BinTrieFlags[BinTrieFlags["FLAG13"] = 8192] = "FLAG13";
|
||||
BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 8064] = "BRANCH_LENGTH";
|
||||
BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
|
||||
})(BinTrieFlags || (exports.BinTrieFlags = BinTrieFlags = {}));
|
||||
//# sourceMappingURL=bin-trie-flags.js.map
|
||||
31
.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js
generated
vendored
Normal file
31
.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.decodeBase64 = decodeBase64;
|
||||
/*
|
||||
* Shared base64 decode helper for generated decode data.
|
||||
* Assumes global atob is available.
|
||||
*/
|
||||
function decodeBase64(input) {
|
||||
const binary =
|
||||
// eslint-disable-next-line n/no-unsupported-features/node-builtins
|
||||
typeof atob === "function"
|
||||
? // Browser (and Node >=16)
|
||||
// eslint-disable-next-line n/no-unsupported-features/node-builtins
|
||||
atob(input)
|
||||
: // Older Node versions (<16)
|
||||
// eslint-disable-next-line n/no-unsupported-features/node-builtins
|
||||
typeof Buffer.from === "function"
|
||||
? // eslint-disable-next-line n/no-unsupported-features/node-builtins
|
||||
Buffer.from(input, "base64").toString("binary")
|
||||
: // eslint-disable-next-line unicorn/no-new-buffer, n/no-deprecated-api
|
||||
new Buffer(input, "base64").toString("binary");
|
||||
const evenLength = binary.length & ~1; // Round down to even length
|
||||
const out = new Uint16Array(evenLength / 2);
|
||||
for (let index = 0, outIndex = 0; index < evenLength; index += 2) {
|
||||
const lo = binary.charCodeAt(index);
|
||||
const hi = binary.charCodeAt(index + 1);
|
||||
out[outIndex++] = lo | (hi << 8);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
//# sourceMappingURL=decode-shared.js.map
|
||||
3
.output/server/node_modules/entities/dist/commonjs/package.json
generated
vendored
Normal file
3
.output/server/node_modules/entities/dist/commonjs/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
120
.output/server/node_modules/entities/package.json
generated
vendored
Normal file
120
.output/server/node_modules/entities/package.json
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
{
|
||||
"name": "entities",
|
||||
"version": "7.0.1",
|
||||
"description": "Encode & decode XML and HTML entities with ease & speed",
|
||||
"keywords": [
|
||||
"html entities",
|
||||
"entity decoder",
|
||||
"entity encoding",
|
||||
"html decoding",
|
||||
"html encoding",
|
||||
"xml decoding",
|
||||
"xml encoding"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fb55/entities.git"
|
||||
},
|
||||
"funding": "https://github.com/fb55/entities?sponsor=1",
|
||||
"license": "BSD-2-Clause",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.js"
|
||||
}
|
||||
},
|
||||
"./decode": {
|
||||
"import": {
|
||||
"types": "./dist/esm/decode.d.ts",
|
||||
"default": "./dist/esm/decode.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/decode.d.ts",
|
||||
"default": "./dist/commonjs/decode.js"
|
||||
}
|
||||
},
|
||||
"./escape": {
|
||||
"import": {
|
||||
"types": "./dist/esm/escape.d.ts",
|
||||
"default": "./dist/esm/escape.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/escape.d.ts",
|
||||
"default": "./dist/commonjs/escape.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"main": "./dist/commonjs/index.js",
|
||||
"module": "./dist/esm/index.js",
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"files": [
|
||||
"decode.js",
|
||||
"decode.d.ts",
|
||||
"escape.js",
|
||||
"escape.d.ts",
|
||||
"dist",
|
||||
"src",
|
||||
"!**/*.spec.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"build:docs": "typedoc --hideGenerator src/index.ts",
|
||||
"build:encode-trie": "node --import=tsx scripts/write-encode-map.ts",
|
||||
"build:trie": "node --import=tsx scripts/write-decode-map.ts",
|
||||
"benchmark": "node --import=tsx scripts/benchmark.ts",
|
||||
"format": "npm run format:es && npm run format:biome",
|
||||
"format:es": "npm run lint:es -- --fix",
|
||||
"format:biome": "biome check --fix .",
|
||||
"lint": "npm run lint:es && npm run lint:ts && npm run lint:biome",
|
||||
"lint:es": "eslint . --ignore-path .gitignore",
|
||||
"lint:biome": "biome check .",
|
||||
"lint:ts": "tsc --noEmit",
|
||||
"prepublishOnly": "tshy",
|
||||
"test": "npm run test:vi && npm run lint",
|
||||
"test:vi": "vitest run"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.3.11",
|
||||
"@types/node": "^25.0.9",
|
||||
"@typescript-eslint/eslint-plugin": "^8.53.1",
|
||||
"@typescript-eslint/parser": "^8.53.1",
|
||||
"@vitest/coverage-v8": "^3.2.4",
|
||||
"@types/he": "^1.2.3",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-biome": "^2.1.3",
|
||||
"eslint-plugin-n": "^17.23.2",
|
||||
"eslint-plugin-unicorn": "^56.0.1",
|
||||
"he": "^1.2.0",
|
||||
"html-entities": "^2.6.0",
|
||||
"parse-entities": "^4.0.2",
|
||||
"tinybench": "^5.1.0",
|
||||
"tshy": "^3.1.0",
|
||||
"tsx": "^4.21.0",
|
||||
"typedoc": "^0.28.16",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^3.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"tshy": {
|
||||
"exclude": [
|
||||
"**/*.spec.ts",
|
||||
"**/__fixtures__/*",
|
||||
"**/__tests__/*",
|
||||
"**/__snapshots__/*"
|
||||
],
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./decode": "./src/decode.ts",
|
||||
"./escape": "./src/escape.ts"
|
||||
}
|
||||
}
|
||||
}
|
||||
344
.output/server/node_modules/estree-walker/dist/umd/estree-walker.js
generated
vendored
Normal file
344
.output/server/node_modules/estree-walker/dist/umd/estree-walker.js
generated
vendored
Normal file
@@ -0,0 +1,344 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.estreeWalker = {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
// @ts-check
|
||||
/** @typedef { import('estree').BaseNode} BaseNode */
|
||||
|
||||
/** @typedef {{
|
||||
skip: () => void;
|
||||
remove: () => void;
|
||||
replace: (node: BaseNode) => void;
|
||||
}} WalkerContext */
|
||||
|
||||
class WalkerBase {
|
||||
constructor() {
|
||||
/** @type {boolean} */
|
||||
this.should_skip = false;
|
||||
|
||||
/** @type {boolean} */
|
||||
this.should_remove = false;
|
||||
|
||||
/** @type {BaseNode | null} */
|
||||
this.replacement = null;
|
||||
|
||||
/** @type {WalkerContext} */
|
||||
this.context = {
|
||||
skip: () => (this.should_skip = true),
|
||||
remove: () => (this.should_remove = true),
|
||||
replace: (node) => (this.replacement = node)
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {any} parent
|
||||
* @param {string} prop
|
||||
* @param {number} index
|
||||
* @param {BaseNode} node
|
||||
*/
|
||||
replace(parent, prop, index, node) {
|
||||
if (parent) {
|
||||
if (index !== null) {
|
||||
parent[prop][index] = node;
|
||||
} else {
|
||||
parent[prop] = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {any} parent
|
||||
* @param {string} prop
|
||||
* @param {number} index
|
||||
*/
|
||||
remove(parent, prop, index) {
|
||||
if (parent) {
|
||||
if (index !== null) {
|
||||
parent[prop].splice(index, 1);
|
||||
} else {
|
||||
delete parent[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-check
|
||||
|
||||
/** @typedef { import('estree').BaseNode} BaseNode */
|
||||
/** @typedef { import('./walker.js').WalkerContext} WalkerContext */
|
||||
|
||||
/** @typedef {(
|
||||
* this: WalkerContext,
|
||||
* node: BaseNode,
|
||||
* parent: BaseNode,
|
||||
* key: string,
|
||||
* index: number
|
||||
* ) => void} SyncHandler */
|
||||
|
||||
class SyncWalker extends WalkerBase {
|
||||
/**
|
||||
*
|
||||
* @param {SyncHandler} enter
|
||||
* @param {SyncHandler} leave
|
||||
*/
|
||||
constructor(enter, leave) {
|
||||
super();
|
||||
|
||||
/** @type {SyncHandler} */
|
||||
this.enter = enter;
|
||||
|
||||
/** @type {SyncHandler} */
|
||||
this.leave = leave;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {BaseNode} node
|
||||
* @param {BaseNode} parent
|
||||
* @param {string} [prop]
|
||||
* @param {number} [index]
|
||||
* @returns {BaseNode}
|
||||
*/
|
||||
visit(node, parent, prop, index) {
|
||||
if (node) {
|
||||
if (this.enter) {
|
||||
const _should_skip = this.should_skip;
|
||||
const _should_remove = this.should_remove;
|
||||
const _replacement = this.replacement;
|
||||
this.should_skip = false;
|
||||
this.should_remove = false;
|
||||
this.replacement = null;
|
||||
|
||||
this.enter.call(this.context, node, parent, prop, index);
|
||||
|
||||
if (this.replacement) {
|
||||
node = this.replacement;
|
||||
this.replace(parent, prop, index, node);
|
||||
}
|
||||
|
||||
if (this.should_remove) {
|
||||
this.remove(parent, prop, index);
|
||||
}
|
||||
|
||||
const skipped = this.should_skip;
|
||||
const removed = this.should_remove;
|
||||
|
||||
this.should_skip = _should_skip;
|
||||
this.should_remove = _should_remove;
|
||||
this.replacement = _replacement;
|
||||
|
||||
if (skipped) return node;
|
||||
if (removed) return null;
|
||||
}
|
||||
|
||||
for (const key in node) {
|
||||
const value = node[key];
|
||||
|
||||
if (typeof value !== "object") {
|
||||
continue;
|
||||
} else if (Array.isArray(value)) {
|
||||
for (let i = 0; i < value.length; i += 1) {
|
||||
if (value[i] !== null && typeof value[i].type === 'string') {
|
||||
if (!this.visit(value[i], node, key, i)) {
|
||||
// removed
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (value !== null && typeof value.type === "string") {
|
||||
this.visit(value, node, key, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.leave) {
|
||||
const _replacement = this.replacement;
|
||||
const _should_remove = this.should_remove;
|
||||
this.replacement = null;
|
||||
this.should_remove = false;
|
||||
|
||||
this.leave.call(this.context, node, parent, prop, index);
|
||||
|
||||
if (this.replacement) {
|
||||
node = this.replacement;
|
||||
this.replace(parent, prop, index, node);
|
||||
}
|
||||
|
||||
if (this.should_remove) {
|
||||
this.remove(parent, prop, index);
|
||||
}
|
||||
|
||||
const removed = this.should_remove;
|
||||
|
||||
this.replacement = _replacement;
|
||||
this.should_remove = _should_remove;
|
||||
|
||||
if (removed) return null;
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-check
|
||||
|
||||
/** @typedef { import('estree').BaseNode} BaseNode */
|
||||
/** @typedef { import('./walker').WalkerContext} WalkerContext */
|
||||
|
||||
/** @typedef {(
|
||||
* this: WalkerContext,
|
||||
* node: BaseNode,
|
||||
* parent: BaseNode,
|
||||
* key: string,
|
||||
* index: number
|
||||
* ) => Promise<void>} AsyncHandler */
|
||||
|
||||
class AsyncWalker extends WalkerBase {
|
||||
/**
|
||||
*
|
||||
* @param {AsyncHandler} enter
|
||||
* @param {AsyncHandler} leave
|
||||
*/
|
||||
constructor(enter, leave) {
|
||||
super();
|
||||
|
||||
/** @type {AsyncHandler} */
|
||||
this.enter = enter;
|
||||
|
||||
/** @type {AsyncHandler} */
|
||||
this.leave = leave;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {BaseNode} node
|
||||
* @param {BaseNode} parent
|
||||
* @param {string} [prop]
|
||||
* @param {number} [index]
|
||||
* @returns {Promise<BaseNode>}
|
||||
*/
|
||||
async visit(node, parent, prop, index) {
|
||||
if (node) {
|
||||
if (this.enter) {
|
||||
const _should_skip = this.should_skip;
|
||||
const _should_remove = this.should_remove;
|
||||
const _replacement = this.replacement;
|
||||
this.should_skip = false;
|
||||
this.should_remove = false;
|
||||
this.replacement = null;
|
||||
|
||||
await this.enter.call(this.context, node, parent, prop, index);
|
||||
|
||||
if (this.replacement) {
|
||||
node = this.replacement;
|
||||
this.replace(parent, prop, index, node);
|
||||
}
|
||||
|
||||
if (this.should_remove) {
|
||||
this.remove(parent, prop, index);
|
||||
}
|
||||
|
||||
const skipped = this.should_skip;
|
||||
const removed = this.should_remove;
|
||||
|
||||
this.should_skip = _should_skip;
|
||||
this.should_remove = _should_remove;
|
||||
this.replacement = _replacement;
|
||||
|
||||
if (skipped) return node;
|
||||
if (removed) return null;
|
||||
}
|
||||
|
||||
for (const key in node) {
|
||||
const value = node[key];
|
||||
|
||||
if (typeof value !== "object") {
|
||||
continue;
|
||||
} else if (Array.isArray(value)) {
|
||||
for (let i = 0; i < value.length; i += 1) {
|
||||
if (value[i] !== null && typeof value[i].type === 'string') {
|
||||
if (!(await this.visit(value[i], node, key, i))) {
|
||||
// removed
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (value !== null && typeof value.type === "string") {
|
||||
await this.visit(value, node, key, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.leave) {
|
||||
const _replacement = this.replacement;
|
||||
const _should_remove = this.should_remove;
|
||||
this.replacement = null;
|
||||
this.should_remove = false;
|
||||
|
||||
await this.leave.call(this.context, node, parent, prop, index);
|
||||
|
||||
if (this.replacement) {
|
||||
node = this.replacement;
|
||||
this.replace(parent, prop, index, node);
|
||||
}
|
||||
|
||||
if (this.should_remove) {
|
||||
this.remove(parent, prop, index);
|
||||
}
|
||||
|
||||
const removed = this.should_remove;
|
||||
|
||||
this.replacement = _replacement;
|
||||
this.should_remove = _should_remove;
|
||||
|
||||
if (removed) return null;
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-check
|
||||
|
||||
/** @typedef { import('estree').BaseNode} BaseNode */
|
||||
/** @typedef { import('./sync.js').SyncHandler} SyncHandler */
|
||||
/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {BaseNode} ast
|
||||
* @param {{
|
||||
* enter?: SyncHandler
|
||||
* leave?: SyncHandler
|
||||
* }} walker
|
||||
* @returns {BaseNode}
|
||||
*/
|
||||
function walk(ast, { enter, leave }) {
|
||||
const instance = new SyncWalker(enter, leave);
|
||||
return instance.visit(ast, null);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {BaseNode} ast
|
||||
* @param {{
|
||||
* enter?: AsyncHandler
|
||||
* leave?: AsyncHandler
|
||||
* }} walker
|
||||
* @returns {Promise<BaseNode>}
|
||||
*/
|
||||
async function asyncWalk(ast, { enter, leave }) {
|
||||
const instance = new AsyncWalker(enter, leave);
|
||||
return await instance.visit(ast, null);
|
||||
}
|
||||
|
||||
exports.asyncWalk = asyncWalk;
|
||||
exports.walk = walk;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
37
.output/server/node_modules/estree-walker/package.json
generated
vendored
Normal file
37
.output/server/node_modules/estree-walker/package.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "estree-walker",
|
||||
"description": "Traverse an ESTree-compliant AST",
|
||||
"version": "2.0.2",
|
||||
"private": false,
|
||||
"author": "Rich Harris",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Rich-Harris/estree-walker"
|
||||
},
|
||||
"type": "commonjs",
|
||||
"main": "./dist/umd/estree-walker.js",
|
||||
"module": "./dist/esm/estree-walker.js",
|
||||
"exports": {
|
||||
"require": "./dist/umd/estree-walker.js",
|
||||
"import": "./dist/esm/estree-walker.js"
|
||||
},
|
||||
"types": "types/index.d.ts",
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run build && npm test",
|
||||
"build": "tsc && rollup -c",
|
||||
"test": "uvu test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/estree": "0.0.42",
|
||||
"rollup": "^2.10.9",
|
||||
"typescript": "^3.7.5",
|
||||
"uvu": "^0.5.1"
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
"dist",
|
||||
"types",
|
||||
"README.md"
|
||||
]
|
||||
}
|
||||
266
.output/server/node_modules/hookable/dist/index.mjs
generated
vendored
Normal file
266
.output/server/node_modules/hookable/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
//#region src/utils.ts
|
||||
function flatHooks(configHooks, hooks = {}, parentName) {
|
||||
for (const key in configHooks) {
|
||||
const subHook = configHooks[key];
|
||||
const name = parentName ? `${parentName}:${key}` : key;
|
||||
if (typeof subHook === "object" && subHook !== null) flatHooks(subHook, hooks, name);
|
||||
else if (typeof subHook === "function") hooks[name] = subHook;
|
||||
}
|
||||
return hooks;
|
||||
}
|
||||
function mergeHooks(...hooks) {
|
||||
const finalHooks = {};
|
||||
for (const hook of hooks) {
|
||||
const flatenHook = flatHooks(hook);
|
||||
for (const key in flatenHook) if (finalHooks[key]) finalHooks[key].push(flatenHook[key]);
|
||||
else finalHooks[key] = [flatenHook[key]];
|
||||
}
|
||||
for (const key in finalHooks) if (finalHooks[key].length > 1) {
|
||||
const array = finalHooks[key];
|
||||
finalHooks[key] = (...arguments_) => serial(array, (function_) => function_(...arguments_));
|
||||
} else finalHooks[key] = finalHooks[key][0];
|
||||
return finalHooks;
|
||||
}
|
||||
function serial(tasks, function_) {
|
||||
return tasks.reduce((promise, task) => promise.then(() => function_(task)), Promise.resolve());
|
||||
}
|
||||
const createTask = /* @__PURE__ */ (() => {
|
||||
if (console.createTask) return console.createTask;
|
||||
const defaultTask = { run: (fn) => fn() };
|
||||
return () => defaultTask;
|
||||
})();
|
||||
function callHooks(hooks, args, startIndex, task) {
|
||||
for (let i = startIndex; i < hooks.length; i += 1) try {
|
||||
const result = task ? task.run(() => hooks[i](...args)) : hooks[i](...args);
|
||||
if (result instanceof Promise) return result.then(() => callHooks(hooks, args, i + 1, task));
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
}
|
||||
function serialTaskCaller(hooks, args, name) {
|
||||
if (hooks.length > 0) return callHooks(hooks, args, 0, createTask(name));
|
||||
}
|
||||
function parallelTaskCaller(hooks, args, name) {
|
||||
if (hooks.length > 0) {
|
||||
const task = createTask(name);
|
||||
return Promise.all(hooks.map((hook) => task.run(() => hook(...args))));
|
||||
}
|
||||
}
|
||||
/** @deprecated */
|
||||
function serialCaller(hooks, arguments_) {
|
||||
return hooks.reduce((promise, hookFunction) => promise.then(() => hookFunction(...arguments_ || [])), Promise.resolve());
|
||||
}
|
||||
/** @deprecated */
|
||||
function parallelCaller(hooks, args) {
|
||||
return Promise.all(hooks.map((hook) => hook(...args || [])));
|
||||
}
|
||||
function callEachWith(callbacks, arg0) {
|
||||
for (const callback of [...callbacks]) callback(arg0);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region src/hookable.ts
|
||||
var Hookable = class {
|
||||
_hooks;
|
||||
_before;
|
||||
_after;
|
||||
_deprecatedHooks;
|
||||
_deprecatedMessages;
|
||||
constructor() {
|
||||
this._hooks = {};
|
||||
this._before = void 0;
|
||||
this._after = void 0;
|
||||
this._deprecatedMessages = void 0;
|
||||
this._deprecatedHooks = {};
|
||||
this.hook = this.hook.bind(this);
|
||||
this.callHook = this.callHook.bind(this);
|
||||
this.callHookWith = this.callHookWith.bind(this);
|
||||
}
|
||||
hook(name, function_, options = {}) {
|
||||
if (!name || typeof function_ !== "function") return () => {};
|
||||
const originalName = name;
|
||||
let dep;
|
||||
while (this._deprecatedHooks[name]) {
|
||||
dep = this._deprecatedHooks[name];
|
||||
name = dep.to;
|
||||
}
|
||||
if (dep && !options.allowDeprecated) {
|
||||
let message = dep.message;
|
||||
if (!message) message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
|
||||
if (!this._deprecatedMessages) this._deprecatedMessages = /* @__PURE__ */ new Set();
|
||||
if (!this._deprecatedMessages.has(message)) {
|
||||
console.warn(message);
|
||||
this._deprecatedMessages.add(message);
|
||||
}
|
||||
}
|
||||
if (!function_.name) try {
|
||||
Object.defineProperty(function_, "name", {
|
||||
get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
|
||||
configurable: true
|
||||
});
|
||||
} catch {}
|
||||
this._hooks[name] = this._hooks[name] || [];
|
||||
this._hooks[name].push(function_);
|
||||
return () => {
|
||||
if (function_) {
|
||||
this.removeHook(name, function_);
|
||||
function_ = void 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
hookOnce(name, function_) {
|
||||
let _unreg;
|
||||
let _function = (...arguments_) => {
|
||||
if (typeof _unreg === "function") _unreg();
|
||||
_unreg = void 0;
|
||||
_function = void 0;
|
||||
return function_(...arguments_);
|
||||
};
|
||||
_unreg = this.hook(name, _function);
|
||||
return _unreg;
|
||||
}
|
||||
removeHook(name, function_) {
|
||||
const hooks = this._hooks[name];
|
||||
if (hooks) {
|
||||
const index = hooks.indexOf(function_);
|
||||
if (index !== -1) hooks.splice(index, 1);
|
||||
if (hooks.length === 0) this._hooks[name] = void 0;
|
||||
}
|
||||
}
|
||||
deprecateHook(name, deprecated) {
|
||||
this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
|
||||
const _hooks = this._hooks[name] || [];
|
||||
this._hooks[name] = void 0;
|
||||
for (const hook of _hooks) this.hook(name, hook);
|
||||
}
|
||||
deprecateHooks(deprecatedHooks) {
|
||||
for (const name in deprecatedHooks) this.deprecateHook(name, deprecatedHooks[name]);
|
||||
}
|
||||
addHooks(configHooks) {
|
||||
const hooks = flatHooks(configHooks);
|
||||
const removeFns = Object.keys(hooks).map((key) => this.hook(key, hooks[key]));
|
||||
return () => {
|
||||
for (const unreg of removeFns) unreg();
|
||||
removeFns.length = 0;
|
||||
};
|
||||
}
|
||||
removeHooks(configHooks) {
|
||||
const hooks = flatHooks(configHooks);
|
||||
for (const key in hooks) this.removeHook(key, hooks[key]);
|
||||
}
|
||||
removeAllHooks() {
|
||||
this._hooks = {};
|
||||
}
|
||||
callHook(name, ...args) {
|
||||
return this.callHookWith(serialTaskCaller, name, args);
|
||||
}
|
||||
callHookParallel(name, ...args) {
|
||||
return this.callHookWith(parallelTaskCaller, name, args);
|
||||
}
|
||||
callHookWith(caller, name, args) {
|
||||
const event = this._before || this._after ? {
|
||||
name,
|
||||
args,
|
||||
context: {}
|
||||
} : void 0;
|
||||
if (this._before) callEachWith(this._before, event);
|
||||
const result = caller(this._hooks[name] ? [...this._hooks[name]] : [], args, name);
|
||||
if (result instanceof Promise) return result.finally(() => {
|
||||
if (this._after && event) callEachWith(this._after, event);
|
||||
});
|
||||
if (this._after && event) callEachWith(this._after, event);
|
||||
return result;
|
||||
}
|
||||
beforeEach(function_) {
|
||||
this._before = this._before || [];
|
||||
this._before.push(function_);
|
||||
return () => {
|
||||
if (this._before !== void 0) {
|
||||
const index = this._before.indexOf(function_);
|
||||
if (index !== -1) this._before.splice(index, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
afterEach(function_) {
|
||||
this._after = this._after || [];
|
||||
this._after.push(function_);
|
||||
return () => {
|
||||
if (this._after !== void 0) {
|
||||
const index = this._after.indexOf(function_);
|
||||
if (index !== -1) this._after.splice(index, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
function createHooks() {
|
||||
return new Hookable();
|
||||
}
|
||||
var HookableCore = class {
|
||||
_hooks;
|
||||
constructor() {
|
||||
this._hooks = {};
|
||||
}
|
||||
hook(name, fn) {
|
||||
if (!name || typeof fn !== "function") return () => {};
|
||||
this._hooks[name] = this._hooks[name] || [];
|
||||
this._hooks[name].push(fn);
|
||||
return () => {
|
||||
if (fn) {
|
||||
this.removeHook(name, fn);
|
||||
fn = void 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
removeHook(name, function_) {
|
||||
const hooks = this._hooks[name];
|
||||
if (hooks) {
|
||||
const index = hooks.indexOf(function_);
|
||||
if (index !== -1) hooks.splice(index, 1);
|
||||
if (hooks.length === 0) this._hooks[name] = void 0;
|
||||
}
|
||||
}
|
||||
callHook(name, ...args) {
|
||||
const hooks = this._hooks[name];
|
||||
if (!hooks || hooks.length === 0) return;
|
||||
return callHooks(hooks, args, 0);
|
||||
}
|
||||
};
|
||||
|
||||
//#endregion
|
||||
//#region src/debugger.ts
|
||||
const isBrowser = typeof window !== "undefined";
|
||||
/** Start debugging hook names and timing in console */
|
||||
function createDebugger(hooks, _options = {}) {
|
||||
const options = {
|
||||
inspect: isBrowser,
|
||||
group: isBrowser,
|
||||
filter: () => true,
|
||||
..._options
|
||||
};
|
||||
const _filter = options.filter;
|
||||
const filter = typeof _filter === "string" ? (name) => name.startsWith(_filter) : _filter;
|
||||
const _tag = options.tag ? `[${options.tag}] ` : "";
|
||||
const logPrefix = (event) => _tag + event.name + "".padEnd(event._id, "\0");
|
||||
const _idCtr = {};
|
||||
const unsubscribeBefore = hooks.beforeEach((event) => {
|
||||
if (filter !== void 0 && !filter(event.name)) return;
|
||||
_idCtr[event.name] = _idCtr[event.name] || 0;
|
||||
event._id = _idCtr[event.name]++;
|
||||
console.time(logPrefix(event));
|
||||
});
|
||||
const unsubscribeAfter = hooks.afterEach((event) => {
|
||||
if (filter !== void 0 && !filter(event.name)) return;
|
||||
if (options.group) console.groupCollapsed(event.name);
|
||||
if (options.inspect) console.timeLog(logPrefix(event), event.args);
|
||||
else console.timeEnd(logPrefix(event));
|
||||
if (options.group) console.groupEnd();
|
||||
_idCtr[event.name]--;
|
||||
});
|
||||
return { close: () => {
|
||||
unsubscribeBefore();
|
||||
unsubscribeAfter();
|
||||
} };
|
||||
}
|
||||
|
||||
//#endregion
|
||||
export { Hookable, HookableCore, createDebugger, createHooks, flatHooks, mergeHooks, parallelCaller, serial, serialCaller };
|
||||
52
.output/server/node_modules/hookable/package.json
generated
vendored
Normal file
52
.output/server/node_modules/hookable/package.json
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "hookable",
|
||||
"version": "6.0.1",
|
||||
"description": "Awaitable hook system",
|
||||
"keywords": [
|
||||
"hook",
|
||||
"hookable",
|
||||
"plugin",
|
||||
"tapable",
|
||||
"tappable"
|
||||
],
|
||||
"repository": "unjs/hookable",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./dist/index.mjs"
|
||||
},
|
||||
"main": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.mts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"bench": "node --expose-gc --allow-natives-syntax test/bench.ts",
|
||||
"build": "obuild src/index.ts",
|
||||
"dev": "vitest",
|
||||
"lint": "eslint --cache . && prettier -c src test",
|
||||
"lint:fix": "eslint --cache . --fix && prettier -c src test -w",
|
||||
"prepublish": "pnpm build",
|
||||
"release": "pnpm test && pnpm build && changelogen --release --publish --push",
|
||||
"test": "pnpm lint && vitest run --coverage",
|
||||
"test:types": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.0.3",
|
||||
"@vitest/coverage-v8": "^4.0.16",
|
||||
"changelogen": "^0.6.2",
|
||||
"esbuild": "^0.27.2",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-unjs": "^0.5.0",
|
||||
"expect-type": "^1.3.0",
|
||||
"hookable-prev": "npm:hookable@^5.5.3",
|
||||
"mitata": "^1.0.34",
|
||||
"obuild": "^0.4.9",
|
||||
"prettier": "^3.7.4",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.3.0",
|
||||
"vitest": "^4.0.16"
|
||||
},
|
||||
"packageManager": "pnpm@10.26.0"
|
||||
}
|
||||
121
.output/server/node_modules/source-map-js/lib/array-set.js
generated
vendored
Normal file
121
.output/server/node_modules/source-map-js/lib/array-set.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = require('./util');
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
var hasNativeMap = typeof Map !== "undefined";
|
||||
|
||||
/**
|
||||
* A data structure which is a combination of an array and a set. Adding a new
|
||||
* member is O(1), testing for membership is O(1), and finding the index of an
|
||||
* element is O(1). Removing elements from the set is not supported. Only
|
||||
* strings are supported for membership.
|
||||
*/
|
||||
function ArraySet() {
|
||||
this._array = [];
|
||||
this._set = hasNativeMap ? new Map() : Object.create(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static method for creating ArraySet instances from an existing array.
|
||||
*/
|
||||
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
||||
var set = new ArraySet();
|
||||
for (var i = 0, len = aArray.length; i < len; i++) {
|
||||
set.add(aArray[i], aAllowDuplicates);
|
||||
}
|
||||
return set;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return how many unique items are in this ArraySet. If duplicates have been
|
||||
* added, than those do not count towards the size.
|
||||
*
|
||||
* @returns Number
|
||||
*/
|
||||
ArraySet.prototype.size = function ArraySet_size() {
|
||||
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the given string to this set.
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
||||
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
||||
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
||||
var idx = this._array.length;
|
||||
if (!isDuplicate || aAllowDuplicates) {
|
||||
this._array.push(aStr);
|
||||
}
|
||||
if (!isDuplicate) {
|
||||
if (hasNativeMap) {
|
||||
this._set.set(aStr, idx);
|
||||
} else {
|
||||
this._set[sStr] = idx;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Is the given string a member of this set?
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.has = function ArraySet_has(aStr) {
|
||||
if (hasNativeMap) {
|
||||
return this._set.has(aStr);
|
||||
} else {
|
||||
var sStr = util.toSetString(aStr);
|
||||
return has.call(this._set, sStr);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* What is the index of the given string in the array?
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
||||
if (hasNativeMap) {
|
||||
var idx = this._set.get(aStr);
|
||||
if (idx >= 0) {
|
||||
return idx;
|
||||
}
|
||||
} else {
|
||||
var sStr = util.toSetString(aStr);
|
||||
if (has.call(this._set, sStr)) {
|
||||
return this._set[sStr];
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('"' + aStr + '" is not in the set.');
|
||||
};
|
||||
|
||||
/**
|
||||
* What is the element at the given index?
|
||||
*
|
||||
* @param Number aIdx
|
||||
*/
|
||||
ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
||||
if (aIdx >= 0 && aIdx < this._array.length) {
|
||||
return this._array[aIdx];
|
||||
}
|
||||
throw new Error('No element indexed by ' + aIdx);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the array representation of this set (which has the proper indices
|
||||
* indicated by indexOf). Note that this is a copy of the internal array used
|
||||
* for storing the members so that no one can mess with internal state.
|
||||
*/
|
||||
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
||||
return this._array.slice();
|
||||
};
|
||||
|
||||
exports.ArraySet = ArraySet;
|
||||
140
.output/server/node_modules/source-map-js/lib/base64-vlq.js
generated
vendored
Normal file
140
.output/server/node_modules/source-map-js/lib/base64-vlq.js
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* Based on the Base 64 VLQ implementation in Closure Compiler:
|
||||
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
|
||||
*
|
||||
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of Google Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var base64 = require('./base64');
|
||||
|
||||
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
||||
// length quantities we use in the source map spec, the first bit is the sign,
|
||||
// the next four bits are the actual value, and the 6th bit is the
|
||||
// continuation bit. The continuation bit tells us whether there are more
|
||||
// digits in this value following this digit.
|
||||
//
|
||||
// Continuation
|
||||
// | Sign
|
||||
// | |
|
||||
// V V
|
||||
// 101011
|
||||
|
||||
var VLQ_BASE_SHIFT = 5;
|
||||
|
||||
// binary: 100000
|
||||
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
||||
|
||||
// binary: 011111
|
||||
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
||||
|
||||
// binary: 100000
|
||||
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
||||
|
||||
/**
|
||||
* Converts from a two-complement value to a value where the sign bit is
|
||||
* placed in the least significant bit. For example, as decimals:
|
||||
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
||||
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
||||
*/
|
||||
function toVLQSigned(aValue) {
|
||||
return aValue < 0
|
||||
? ((-aValue) << 1) + 1
|
||||
: (aValue << 1) + 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts to a two-complement value from a value where the sign bit is
|
||||
* placed in the least significant bit. For example, as decimals:
|
||||
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
|
||||
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
|
||||
*/
|
||||
function fromVLQSigned(aValue) {
|
||||
var isNegative = (aValue & 1) === 1;
|
||||
var shifted = aValue >> 1;
|
||||
return isNegative
|
||||
? -shifted
|
||||
: shifted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base 64 VLQ encoded value.
|
||||
*/
|
||||
exports.encode = function base64VLQ_encode(aValue) {
|
||||
var encoded = "";
|
||||
var digit;
|
||||
|
||||
var vlq = toVLQSigned(aValue);
|
||||
|
||||
do {
|
||||
digit = vlq & VLQ_BASE_MASK;
|
||||
vlq >>>= VLQ_BASE_SHIFT;
|
||||
if (vlq > 0) {
|
||||
// There are still more digits in this value, so we must make sure the
|
||||
// continuation bit is marked.
|
||||
digit |= VLQ_CONTINUATION_BIT;
|
||||
}
|
||||
encoded += base64.encode(digit);
|
||||
} while (vlq > 0);
|
||||
|
||||
return encoded;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes the next base 64 VLQ value from the given string and returns the
|
||||
* value and the rest of the string via the out parameter.
|
||||
*/
|
||||
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
||||
var strLen = aStr.length;
|
||||
var result = 0;
|
||||
var shift = 0;
|
||||
var continuation, digit;
|
||||
|
||||
do {
|
||||
if (aIndex >= strLen) {
|
||||
throw new Error("Expected more digits in base 64 VLQ value.");
|
||||
}
|
||||
|
||||
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
||||
if (digit === -1) {
|
||||
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
||||
}
|
||||
|
||||
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
||||
digit &= VLQ_BASE_MASK;
|
||||
result = result + (digit << shift);
|
||||
shift += VLQ_BASE_SHIFT;
|
||||
} while (continuation);
|
||||
|
||||
aOutParam.value = fromVLQSigned(result);
|
||||
aOutParam.rest = aIndex;
|
||||
};
|
||||
67
.output/server/node_modules/source-map-js/lib/base64.js
generated
vendored
Normal file
67
.output/server/node_modules/source-map-js/lib/base64.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
|
||||
|
||||
/**
|
||||
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
|
||||
*/
|
||||
exports.encode = function (number) {
|
||||
if (0 <= number && number < intToCharMap.length) {
|
||||
return intToCharMap[number];
|
||||
}
|
||||
throw new TypeError("Must be between 0 and 63: " + number);
|
||||
};
|
||||
|
||||
/**
|
||||
* Decode a single base 64 character code digit to an integer. Returns -1 on
|
||||
* failure.
|
||||
*/
|
||||
exports.decode = function (charCode) {
|
||||
var bigA = 65; // 'A'
|
||||
var bigZ = 90; // 'Z'
|
||||
|
||||
var littleA = 97; // 'a'
|
||||
var littleZ = 122; // 'z'
|
||||
|
||||
var zero = 48; // '0'
|
||||
var nine = 57; // '9'
|
||||
|
||||
var plus = 43; // '+'
|
||||
var slash = 47; // '/'
|
||||
|
||||
var littleOffset = 26;
|
||||
var numberOffset = 52;
|
||||
|
||||
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
if (bigA <= charCode && charCode <= bigZ) {
|
||||
return (charCode - bigA);
|
||||
}
|
||||
|
||||
// 26 - 51: abcdefghijklmnopqrstuvwxyz
|
||||
if (littleA <= charCode && charCode <= littleZ) {
|
||||
return (charCode - littleA + littleOffset);
|
||||
}
|
||||
|
||||
// 52 - 61: 0123456789
|
||||
if (zero <= charCode && charCode <= nine) {
|
||||
return (charCode - zero + numberOffset);
|
||||
}
|
||||
|
||||
// 62: +
|
||||
if (charCode == plus) {
|
||||
return 62;
|
||||
}
|
||||
|
||||
// 63: /
|
||||
if (charCode == slash) {
|
||||
return 63;
|
||||
}
|
||||
|
||||
// Invalid base64 digit.
|
||||
return -1;
|
||||
};
|
||||
111
.output/server/node_modules/source-map-js/lib/binary-search.js
generated
vendored
Normal file
111
.output/server/node_modules/source-map-js/lib/binary-search.js
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
exports.GREATEST_LOWER_BOUND = 1;
|
||||
exports.LEAST_UPPER_BOUND = 2;
|
||||
|
||||
/**
|
||||
* Recursive implementation of binary search.
|
||||
*
|
||||
* @param aLow Indices here and lower do not contain the needle.
|
||||
* @param aHigh Indices here and higher do not contain the needle.
|
||||
* @param aNeedle The element being searched for.
|
||||
* @param aHaystack The non-empty array being searched.
|
||||
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
|
||||
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||||
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
*/
|
||||
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
||||
// This function terminates when one of the following is true:
|
||||
//
|
||||
// 1. We find the exact element we are looking for.
|
||||
//
|
||||
// 2. We did not find the exact element, but we can return the index of
|
||||
// the next-closest element.
|
||||
//
|
||||
// 3. We did not find the exact element, and there is no next-closest
|
||||
// element than the one we are searching for, so we return -1.
|
||||
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
||||
var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
||||
if (cmp === 0) {
|
||||
// Found the element we are looking for.
|
||||
return mid;
|
||||
}
|
||||
else if (cmp > 0) {
|
||||
// Our needle is greater than aHaystack[mid].
|
||||
if (aHigh - mid > 1) {
|
||||
// The element is in the upper half.
|
||||
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
||||
}
|
||||
|
||||
// The exact needle element was not found in this haystack. Determine if
|
||||
// we are in termination case (3) or (2) and return the appropriate thing.
|
||||
if (aBias == exports.LEAST_UPPER_BOUND) {
|
||||
return aHigh < aHaystack.length ? aHigh : -1;
|
||||
} else {
|
||||
return mid;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Our needle is less than aHaystack[mid].
|
||||
if (mid - aLow > 1) {
|
||||
// The element is in the lower half.
|
||||
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
||||
}
|
||||
|
||||
// we are in termination case (3) or (2) and return the appropriate thing.
|
||||
if (aBias == exports.LEAST_UPPER_BOUND) {
|
||||
return mid;
|
||||
} else {
|
||||
return aLow < 0 ? -1 : aLow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an implementation of binary search which will always try and return
|
||||
* the index of the closest element if there is no exact hit. This is because
|
||||
* mappings between original and generated line/col pairs are single points,
|
||||
* and there is an implicit region between each of them, so a miss just means
|
||||
* that you aren't on the very start of a region.
|
||||
*
|
||||
* @param aNeedle The element you are looking for.
|
||||
* @param aHaystack The array that is being searched.
|
||||
* @param aCompare A function which takes the needle and an element in the
|
||||
* array and returns -1, 0, or 1 depending on whether the needle is less
|
||||
* than, equal to, or greater than the element, respectively.
|
||||
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||||
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
|
||||
*/
|
||||
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
||||
if (aHaystack.length === 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
|
||||
aCompare, aBias || exports.GREATEST_LOWER_BOUND);
|
||||
if (index < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// We have found either the exact element, or the next-closest element than
|
||||
// the one we are searching for. However, there may be more than one such
|
||||
// element. Make sure we always return the smallest of these.
|
||||
while (index - 1 >= 0) {
|
||||
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
||||
break;
|
||||
}
|
||||
--index;
|
||||
}
|
||||
|
||||
return index;
|
||||
};
|
||||
79
.output/server/node_modules/source-map-js/lib/mapping-list.js
generated
vendored
Normal file
79
.output/server/node_modules/source-map-js/lib/mapping-list.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2014 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = require('./util');
|
||||
|
||||
/**
|
||||
* Determine whether mappingB is after mappingA with respect to generated
|
||||
* position.
|
||||
*/
|
||||
function generatedPositionAfter(mappingA, mappingB) {
|
||||
// Optimized for most common case
|
||||
var lineA = mappingA.generatedLine;
|
||||
var lineB = mappingB.generatedLine;
|
||||
var columnA = mappingA.generatedColumn;
|
||||
var columnB = mappingB.generatedColumn;
|
||||
return lineB > lineA || lineB == lineA && columnB >= columnA ||
|
||||
util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* A data structure to provide a sorted view of accumulated mappings in a
|
||||
* performance conscious manner. It trades a neglibable overhead in general
|
||||
* case for a large speedup in case of mappings being added in order.
|
||||
*/
|
||||
function MappingList() {
|
||||
this._array = [];
|
||||
this._sorted = true;
|
||||
// Serves as infimum
|
||||
this._last = {generatedLine: -1, generatedColumn: 0};
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate through internal items. This method takes the same arguments that
|
||||
* `Array.prototype.forEach` takes.
|
||||
*
|
||||
* NOTE: The order of the mappings is NOT guaranteed.
|
||||
*/
|
||||
MappingList.prototype.unsortedForEach =
|
||||
function MappingList_forEach(aCallback, aThisArg) {
|
||||
this._array.forEach(aCallback, aThisArg);
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the given source mapping.
|
||||
*
|
||||
* @param Object aMapping
|
||||
*/
|
||||
MappingList.prototype.add = function MappingList_add(aMapping) {
|
||||
if (generatedPositionAfter(this._last, aMapping)) {
|
||||
this._last = aMapping;
|
||||
this._array.push(aMapping);
|
||||
} else {
|
||||
this._sorted = false;
|
||||
this._array.push(aMapping);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the flat, sorted array of mappings. The mappings are sorted by
|
||||
* generated position.
|
||||
*
|
||||
* WARNING: This method returns internal data without copying, for
|
||||
* performance. The return value must NOT be mutated, and should be treated as
|
||||
* an immutable borrow. If you want to take ownership, you must make your own
|
||||
* copy.
|
||||
*/
|
||||
MappingList.prototype.toArray = function MappingList_toArray() {
|
||||
if (!this._sorted) {
|
||||
this._array.sort(util.compareByGeneratedPositionsInflated);
|
||||
this._sorted = true;
|
||||
}
|
||||
return this._array;
|
||||
};
|
||||
|
||||
exports.MappingList = MappingList;
|
||||
132
.output/server/node_modules/source-map-js/lib/quick-sort.js
generated
vendored
Normal file
132
.output/server/node_modules/source-map-js/lib/quick-sort.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
// It turns out that some (most?) JavaScript engines don't self-host
|
||||
// `Array.prototype.sort`. This makes sense because C++ will likely remain
|
||||
// faster than JS when doing raw CPU-intensive sorting. However, when using a
|
||||
// custom comparator function, calling back and forth between the VM's C++ and
|
||||
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
|
||||
// worse generated code for the comparator function than would be optimal. In
|
||||
// fact, when sorting with a comparator, these costs outweigh the benefits of
|
||||
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
|
||||
// a ~3500ms mean speed-up in `bench/bench.html`.
|
||||
|
||||
function SortTemplate(comparator) {
|
||||
|
||||
/**
|
||||
* Swap the elements indexed by `x` and `y` in the array `ary`.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* The array.
|
||||
* @param {Number} x
|
||||
* The index of the first item.
|
||||
* @param {Number} y
|
||||
* The index of the second item.
|
||||
*/
|
||||
function swap(ary, x, y) {
|
||||
var temp = ary[x];
|
||||
ary[x] = ary[y];
|
||||
ary[y] = temp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random integer within the range `low .. high` inclusive.
|
||||
*
|
||||
* @param {Number} low
|
||||
* The lower bound on the range.
|
||||
* @param {Number} high
|
||||
* The upper bound on the range.
|
||||
*/
|
||||
function randomIntInRange(low, high) {
|
||||
return Math.round(low + (Math.random() * (high - low)));
|
||||
}
|
||||
|
||||
/**
|
||||
* The Quick Sort algorithm.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* An array to sort.
|
||||
* @param {function} comparator
|
||||
* Function to use to compare two items.
|
||||
* @param {Number} p
|
||||
* Start index of the array
|
||||
* @param {Number} r
|
||||
* End index of the array
|
||||
*/
|
||||
function doQuickSort(ary, comparator, p, r) {
|
||||
// If our lower bound is less than our upper bound, we (1) partition the
|
||||
// array into two pieces and (2) recurse on each half. If it is not, this is
|
||||
// the empty array and our base case.
|
||||
|
||||
if (p < r) {
|
||||
// (1) Partitioning.
|
||||
//
|
||||
// The partitioning chooses a pivot between `p` and `r` and moves all
|
||||
// elements that are less than or equal to the pivot to the before it, and
|
||||
// all the elements that are greater than it after it. The effect is that
|
||||
// once partition is done, the pivot is in the exact place it will be when
|
||||
// the array is put in sorted order, and it will not need to be moved
|
||||
// again. This runs in O(n) time.
|
||||
|
||||
// Always choose a random pivot so that an input array which is reverse
|
||||
// sorted does not cause O(n^2) running time.
|
||||
var pivotIndex = randomIntInRange(p, r);
|
||||
var i = p - 1;
|
||||
|
||||
swap(ary, pivotIndex, r);
|
||||
var pivot = ary[r];
|
||||
|
||||
// Immediately after `j` is incremented in this loop, the following hold
|
||||
// true:
|
||||
//
|
||||
// * Every element in `ary[p .. i]` is less than or equal to the pivot.
|
||||
//
|
||||
// * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
|
||||
for (var j = p; j < r; j++) {
|
||||
if (comparator(ary[j], pivot, false) <= 0) {
|
||||
i += 1;
|
||||
swap(ary, i, j);
|
||||
}
|
||||
}
|
||||
|
||||
swap(ary, i + 1, j);
|
||||
var q = i + 1;
|
||||
|
||||
// (2) Recurse on each half.
|
||||
|
||||
doQuickSort(ary, comparator, p, q - 1);
|
||||
doQuickSort(ary, comparator, q + 1, r);
|
||||
}
|
||||
}
|
||||
|
||||
return doQuickSort;
|
||||
}
|
||||
|
||||
function cloneSort(comparator) {
|
||||
let template = SortTemplate.toString();
|
||||
let templateFn = new Function(`return ${template}`)();
|
||||
return templateFn(comparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the given array in-place with the given comparator function.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* An array to sort.
|
||||
* @param {function} comparator
|
||||
* Function to use to compare two items.
|
||||
*/
|
||||
|
||||
let sortCache = new WeakMap();
|
||||
exports.quickSort = function (ary, comparator, start = 0) {
|
||||
let doQuickSort = sortCache.get(comparator);
|
||||
if (doQuickSort === void 0) {
|
||||
doQuickSort = cloneSort(comparator);
|
||||
sortCache.set(comparator, doQuickSort);
|
||||
}
|
||||
doQuickSort(ary, comparator, start, ary.length - 1);
|
||||
};
|
||||
1188
.output/server/node_modules/source-map-js/lib/source-map-consumer.js
generated
vendored
Normal file
1188
.output/server/node_modules/source-map-js/lib/source-map-consumer.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
444
.output/server/node_modules/source-map-js/lib/source-map-generator.js
generated
vendored
Normal file
444
.output/server/node_modules/source-map-js/lib/source-map-generator.js
generated
vendored
Normal file
@@ -0,0 +1,444 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var base64VLQ = require('./base64-vlq');
|
||||
var util = require('./util');
|
||||
var ArraySet = require('./array-set').ArraySet;
|
||||
var MappingList = require('./mapping-list').MappingList;
|
||||
|
||||
/**
|
||||
* An instance of the SourceMapGenerator represents a source map which is
|
||||
* being built incrementally. You may pass an object with the following
|
||||
* properties:
|
||||
*
|
||||
* - file: The filename of the generated source.
|
||||
* - sourceRoot: A root for all relative URLs in this source map.
|
||||
*/
|
||||
function SourceMapGenerator(aArgs) {
|
||||
if (!aArgs) {
|
||||
aArgs = {};
|
||||
}
|
||||
this._file = util.getArg(aArgs, 'file', null);
|
||||
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
|
||||
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
|
||||
this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false);
|
||||
this._sources = new ArraySet();
|
||||
this._names = new ArraySet();
|
||||
this._mappings = new MappingList();
|
||||
this._sourcesContents = null;
|
||||
}
|
||||
|
||||
SourceMapGenerator.prototype._version = 3;
|
||||
|
||||
/**
|
||||
* Creates a new SourceMapGenerator based on a SourceMapConsumer
|
||||
*
|
||||
* @param aSourceMapConsumer The SourceMap.
|
||||
*/
|
||||
SourceMapGenerator.fromSourceMap =
|
||||
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {
|
||||
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
||||
var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {
|
||||
file: aSourceMapConsumer.file,
|
||||
sourceRoot: sourceRoot
|
||||
}));
|
||||
aSourceMapConsumer.eachMapping(function (mapping) {
|
||||
var newMapping = {
|
||||
generated: {
|
||||
line: mapping.generatedLine,
|
||||
column: mapping.generatedColumn
|
||||
}
|
||||
};
|
||||
|
||||
if (mapping.source != null) {
|
||||
newMapping.source = mapping.source;
|
||||
if (sourceRoot != null) {
|
||||
newMapping.source = util.relative(sourceRoot, newMapping.source);
|
||||
}
|
||||
|
||||
newMapping.original = {
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn
|
||||
};
|
||||
|
||||
if (mapping.name != null) {
|
||||
newMapping.name = mapping.name;
|
||||
}
|
||||
}
|
||||
|
||||
generator.addMapping(newMapping);
|
||||
});
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var sourceRelative = sourceFile;
|
||||
if (sourceRoot !== null) {
|
||||
sourceRelative = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
|
||||
if (!generator._sources.has(sourceRelative)) {
|
||||
generator._sources.add(sourceRelative);
|
||||
}
|
||||
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
generator.setSourceContent(sourceFile, content);
|
||||
}
|
||||
});
|
||||
return generator;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a single mapping from original source line and column to the generated
|
||||
* source's line and column for this source map being created. The mapping
|
||||
* object should have the following properties:
|
||||
*
|
||||
* - generated: An object with the generated line and column positions.
|
||||
* - original: An object with the original line and column positions.
|
||||
* - source: The original source file (relative to the sourceRoot).
|
||||
* - name: An optional original token name for this mapping.
|
||||
*/
|
||||
SourceMapGenerator.prototype.addMapping =
|
||||
function SourceMapGenerator_addMapping(aArgs) {
|
||||
var generated = util.getArg(aArgs, 'generated');
|
||||
var original = util.getArg(aArgs, 'original', null);
|
||||
var source = util.getArg(aArgs, 'source', null);
|
||||
var name = util.getArg(aArgs, 'name', null);
|
||||
|
||||
if (!this._skipValidation) {
|
||||
if (this._validateMapping(generated, original, source, name) === false) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (source != null) {
|
||||
source = String(source);
|
||||
if (!this._sources.has(source)) {
|
||||
this._sources.add(source);
|
||||
}
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
name = String(name);
|
||||
if (!this._names.has(name)) {
|
||||
this._names.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
this._mappings.add({
|
||||
generatedLine: generated.line,
|
||||
generatedColumn: generated.column,
|
||||
originalLine: original != null && original.line,
|
||||
originalColumn: original != null && original.column,
|
||||
source: source,
|
||||
name: name
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the source content for a source file.
|
||||
*/
|
||||
SourceMapGenerator.prototype.setSourceContent =
|
||||
function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
||||
var source = aSourceFile;
|
||||
if (this._sourceRoot != null) {
|
||||
source = util.relative(this._sourceRoot, source);
|
||||
}
|
||||
|
||||
if (aSourceContent != null) {
|
||||
// Add the source content to the _sourcesContents map.
|
||||
// Create a new _sourcesContents map if the property is null.
|
||||
if (!this._sourcesContents) {
|
||||
this._sourcesContents = Object.create(null);
|
||||
}
|
||||
this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
||||
} else if (this._sourcesContents) {
|
||||
// Remove the source file from the _sourcesContents map.
|
||||
// If the _sourcesContents map is empty, set the property to null.
|
||||
delete this._sourcesContents[util.toSetString(source)];
|
||||
if (Object.keys(this._sourcesContents).length === 0) {
|
||||
this._sourcesContents = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Applies the mappings of a sub-source-map for a specific source file to the
|
||||
* source map being generated. Each mapping to the supplied source file is
|
||||
* rewritten using the supplied source map. Note: The resolution for the
|
||||
* resulting mappings is the minimium of this map and the supplied map.
|
||||
*
|
||||
* @param aSourceMapConsumer The source map to be applied.
|
||||
* @param aSourceFile Optional. The filename of the source file.
|
||||
* If omitted, SourceMapConsumer's file property will be used.
|
||||
* @param aSourceMapPath Optional. The dirname of the path to the source map
|
||||
* to be applied. If relative, it is relative to the SourceMapConsumer.
|
||||
* This parameter is needed when the two source maps aren't in the same
|
||||
* directory, and the source map to be applied contains relative source
|
||||
* paths. If so, those relative source paths need to be rewritten
|
||||
* relative to the SourceMapGenerator.
|
||||
*/
|
||||
SourceMapGenerator.prototype.applySourceMap =
|
||||
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
||||
var sourceFile = aSourceFile;
|
||||
// If aSourceFile is omitted, we will use the file property of the SourceMap
|
||||
if (aSourceFile == null) {
|
||||
if (aSourceMapConsumer.file == null) {
|
||||
throw new Error(
|
||||
'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
|
||||
'or the source map\'s "file" property. Both were omitted.'
|
||||
);
|
||||
}
|
||||
sourceFile = aSourceMapConsumer.file;
|
||||
}
|
||||
var sourceRoot = this._sourceRoot;
|
||||
// Make "sourceFile" relative if an absolute Url is passed.
|
||||
if (sourceRoot != null) {
|
||||
sourceFile = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
// Applying the SourceMap can add and remove items from the sources and
|
||||
// the names array.
|
||||
var newSources = new ArraySet();
|
||||
var newNames = new ArraySet();
|
||||
|
||||
// Find mappings for the "sourceFile"
|
||||
this._mappings.unsortedForEach(function (mapping) {
|
||||
if (mapping.source === sourceFile && mapping.originalLine != null) {
|
||||
// Check if it can be mapped by the source map, then update the mapping.
|
||||
var original = aSourceMapConsumer.originalPositionFor({
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn
|
||||
});
|
||||
if (original.source != null) {
|
||||
// Copy mapping
|
||||
mapping.source = original.source;
|
||||
if (aSourceMapPath != null) {
|
||||
mapping.source = util.join(aSourceMapPath, mapping.source)
|
||||
}
|
||||
if (sourceRoot != null) {
|
||||
mapping.source = util.relative(sourceRoot, mapping.source);
|
||||
}
|
||||
mapping.originalLine = original.line;
|
||||
mapping.originalColumn = original.column;
|
||||
if (original.name != null) {
|
||||
mapping.name = original.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var source = mapping.source;
|
||||
if (source != null && !newSources.has(source)) {
|
||||
newSources.add(source);
|
||||
}
|
||||
|
||||
var name = mapping.name;
|
||||
if (name != null && !newNames.has(name)) {
|
||||
newNames.add(name);
|
||||
}
|
||||
|
||||
}, this);
|
||||
this._sources = newSources;
|
||||
this._names = newNames;
|
||||
|
||||
// Copy sourcesContents of applied map.
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
if (aSourceMapPath != null) {
|
||||
sourceFile = util.join(aSourceMapPath, sourceFile);
|
||||
}
|
||||
if (sourceRoot != null) {
|
||||
sourceFile = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
this.setSourceContent(sourceFile, content);
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
|
||||
/**
|
||||
* A mapping can have one of the three levels of data:
|
||||
*
|
||||
* 1. Just the generated position.
|
||||
* 2. The Generated position, original position, and original source.
|
||||
* 3. Generated and original position, original source, as well as a name
|
||||
* token.
|
||||
*
|
||||
* To maintain consistency, we validate that any new mapping being added falls
|
||||
* in to one of these categories.
|
||||
*/
|
||||
SourceMapGenerator.prototype._validateMapping =
|
||||
function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
|
||||
aName) {
|
||||
// When aOriginal is truthy but has empty values for .line and .column,
|
||||
// it is most likely a programmer error. In this case we throw a very
|
||||
// specific error message to try to guide them the right way.
|
||||
// For example: https://github.com/Polymer/polymer-bundler/pull/519
|
||||
if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
|
||||
var message = 'original.line and original.column are not numbers -- you probably meant to omit ' +
|
||||
'the original mapping entirely and only map the generated position. If so, pass ' +
|
||||
'null for the original mapping instead of an object with empty or null values.'
|
||||
|
||||
if (this._ignoreInvalidMapping) {
|
||||
if (typeof console !== 'undefined' && console.warn) {
|
||||
console.warn(message);
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
throw new Error(message);
|
||||
}
|
||||
}
|
||||
|
||||
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
||||
&& aGenerated.line > 0 && aGenerated.column >= 0
|
||||
&& !aOriginal && !aSource && !aName) {
|
||||
// Case 1.
|
||||
return;
|
||||
}
|
||||
else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
||||
&& aOriginal && 'line' in aOriginal && 'column' in aOriginal
|
||||
&& aGenerated.line > 0 && aGenerated.column >= 0
|
||||
&& aOriginal.line > 0 && aOriginal.column >= 0
|
||||
&& aSource) {
|
||||
// Cases 2 and 3.
|
||||
return;
|
||||
}
|
||||
else {
|
||||
var message = 'Invalid mapping: ' + JSON.stringify({
|
||||
generated: aGenerated,
|
||||
source: aSource,
|
||||
original: aOriginal,
|
||||
name: aName
|
||||
});
|
||||
|
||||
if (this._ignoreInvalidMapping) {
|
||||
if (typeof console !== 'undefined' && console.warn) {
|
||||
console.warn(message);
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
throw new Error(message)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Serialize the accumulated mappings in to the stream of base 64 VLQs
|
||||
* specified by the source map format.
|
||||
*/
|
||||
SourceMapGenerator.prototype._serializeMappings =
|
||||
function SourceMapGenerator_serializeMappings() {
|
||||
var previousGeneratedColumn = 0;
|
||||
var previousGeneratedLine = 1;
|
||||
var previousOriginalColumn = 0;
|
||||
var previousOriginalLine = 0;
|
||||
var previousName = 0;
|
||||
var previousSource = 0;
|
||||
var result = '';
|
||||
var next;
|
||||
var mapping;
|
||||
var nameIdx;
|
||||
var sourceIdx;
|
||||
|
||||
var mappings = this._mappings.toArray();
|
||||
for (var i = 0, len = mappings.length; i < len; i++) {
|
||||
mapping = mappings[i];
|
||||
next = ''
|
||||
|
||||
if (mapping.generatedLine !== previousGeneratedLine) {
|
||||
previousGeneratedColumn = 0;
|
||||
while (mapping.generatedLine !== previousGeneratedLine) {
|
||||
next += ';';
|
||||
previousGeneratedLine++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (i > 0) {
|
||||
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
|
||||
continue;
|
||||
}
|
||||
next += ',';
|
||||
}
|
||||
}
|
||||
|
||||
next += base64VLQ.encode(mapping.generatedColumn
|
||||
- previousGeneratedColumn);
|
||||
previousGeneratedColumn = mapping.generatedColumn;
|
||||
|
||||
if (mapping.source != null) {
|
||||
sourceIdx = this._sources.indexOf(mapping.source);
|
||||
next += base64VLQ.encode(sourceIdx - previousSource);
|
||||
previousSource = sourceIdx;
|
||||
|
||||
// lines are stored 0-based in SourceMap spec version 3
|
||||
next += base64VLQ.encode(mapping.originalLine - 1
|
||||
- previousOriginalLine);
|
||||
previousOriginalLine = mapping.originalLine - 1;
|
||||
|
||||
next += base64VLQ.encode(mapping.originalColumn
|
||||
- previousOriginalColumn);
|
||||
previousOriginalColumn = mapping.originalColumn;
|
||||
|
||||
if (mapping.name != null) {
|
||||
nameIdx = this._names.indexOf(mapping.name);
|
||||
next += base64VLQ.encode(nameIdx - previousName);
|
||||
previousName = nameIdx;
|
||||
}
|
||||
}
|
||||
|
||||
result += next;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
SourceMapGenerator.prototype._generateSourcesContent =
|
||||
function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
||||
return aSources.map(function (source) {
|
||||
if (!this._sourcesContents) {
|
||||
return null;
|
||||
}
|
||||
if (aSourceRoot != null) {
|
||||
source = util.relative(aSourceRoot, source);
|
||||
}
|
||||
var key = util.toSetString(source);
|
||||
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
|
||||
? this._sourcesContents[key]
|
||||
: null;
|
||||
}, this);
|
||||
};
|
||||
|
||||
/**
|
||||
* Externalize the source map.
|
||||
*/
|
||||
SourceMapGenerator.prototype.toJSON =
|
||||
function SourceMapGenerator_toJSON() {
|
||||
var map = {
|
||||
version: this._version,
|
||||
sources: this._sources.toArray(),
|
||||
names: this._names.toArray(),
|
||||
mappings: this._serializeMappings()
|
||||
};
|
||||
if (this._file != null) {
|
||||
map.file = this._file;
|
||||
}
|
||||
if (this._sourceRoot != null) {
|
||||
map.sourceRoot = this._sourceRoot;
|
||||
}
|
||||
if (this._sourcesContents) {
|
||||
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
|
||||
}
|
||||
|
||||
return map;
|
||||
};
|
||||
|
||||
/**
|
||||
* Render the source map being generated to a string.
|
||||
*/
|
||||
SourceMapGenerator.prototype.toString =
|
||||
function SourceMapGenerator_toString() {
|
||||
return JSON.stringify(this.toJSON());
|
||||
};
|
||||
|
||||
exports.SourceMapGenerator = SourceMapGenerator;
|
||||
413
.output/server/node_modules/source-map-js/lib/source-node.js
generated
vendored
Normal file
413
.output/server/node_modules/source-map-js/lib/source-node.js
generated
vendored
Normal file
@@ -0,0 +1,413 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
|
||||
var util = require('./util');
|
||||
|
||||
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
|
||||
// operating systems these days (capturing the result).
|
||||
var REGEX_NEWLINE = /(\r?\n)/;
|
||||
|
||||
// Newline character code for charCodeAt() comparisons
|
||||
var NEWLINE_CODE = 10;
|
||||
|
||||
// Private symbol for identifying `SourceNode`s when multiple versions of
|
||||
// the source-map library are loaded. This MUST NOT CHANGE across
|
||||
// versions!
|
||||
var isSourceNode = "$$$isSourceNode$$$";
|
||||
|
||||
/**
|
||||
* SourceNodes provide a way to abstract over interpolating/concatenating
|
||||
* snippets of generated JavaScript source code while maintaining the line and
|
||||
* column information associated with the original source code.
|
||||
*
|
||||
* @param aLine The original line number.
|
||||
* @param aColumn The original column number.
|
||||
* @param aSource The original source's filename.
|
||||
* @param aChunks Optional. An array of strings which are snippets of
|
||||
* generated JS, or other SourceNodes.
|
||||
* @param aName The original identifier.
|
||||
*/
|
||||
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
|
||||
this.children = [];
|
||||
this.sourceContents = {};
|
||||
this.line = aLine == null ? null : aLine;
|
||||
this.column = aColumn == null ? null : aColumn;
|
||||
this.source = aSource == null ? null : aSource;
|
||||
this.name = aName == null ? null : aName;
|
||||
this[isSourceNode] = true;
|
||||
if (aChunks != null) this.add(aChunks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SourceNode from generated code and a SourceMapConsumer.
|
||||
*
|
||||
* @param aGeneratedCode The generated code
|
||||
* @param aSourceMapConsumer The SourceMap for the generated code
|
||||
* @param aRelativePath Optional. The path that relative sources in the
|
||||
* SourceMapConsumer should be relative to.
|
||||
*/
|
||||
SourceNode.fromStringWithSourceMap =
|
||||
function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
|
||||
// The SourceNode we want to fill with the generated code
|
||||
// and the SourceMap
|
||||
var node = new SourceNode();
|
||||
|
||||
// All even indices of this array are one line of the generated code,
|
||||
// while all odd indices are the newlines between two adjacent lines
|
||||
// (since `REGEX_NEWLINE` captures its match).
|
||||
// Processed fragments are accessed by calling `shiftNextLine`.
|
||||
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
||||
var remainingLinesIndex = 0;
|
||||
var shiftNextLine = function() {
|
||||
var lineContents = getNextLine();
|
||||
// The last line of a file might not have a newline.
|
||||
var newLine = getNextLine() || "";
|
||||
return lineContents + newLine;
|
||||
|
||||
function getNextLine() {
|
||||
return remainingLinesIndex < remainingLines.length ?
|
||||
remainingLines[remainingLinesIndex++] : undefined;
|
||||
}
|
||||
};
|
||||
|
||||
// We need to remember the position of "remainingLines"
|
||||
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
||||
|
||||
// The generate SourceNodes we need a code range.
|
||||
// To extract it current and last mapping is used.
|
||||
// Here we store the last mapping.
|
||||
var lastMapping = null;
|
||||
|
||||
aSourceMapConsumer.eachMapping(function (mapping) {
|
||||
if (lastMapping !== null) {
|
||||
// We add the code from "lastMapping" to "mapping":
|
||||
// First check if there is a new line in between.
|
||||
if (lastGeneratedLine < mapping.generatedLine) {
|
||||
// Associate first line with "lastMapping"
|
||||
addMappingWithCode(lastMapping, shiftNextLine());
|
||||
lastGeneratedLine++;
|
||||
lastGeneratedColumn = 0;
|
||||
// The remaining code is added without mapping
|
||||
} else {
|
||||
// There is no new line in between.
|
||||
// Associate the code between "lastGeneratedColumn" and
|
||||
// "mapping.generatedColumn" with "lastMapping"
|
||||
var nextLine = remainingLines[remainingLinesIndex] || '';
|
||||
var code = nextLine.substr(0, mapping.generatedColumn -
|
||||
lastGeneratedColumn);
|
||||
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
|
||||
lastGeneratedColumn);
|
||||
lastGeneratedColumn = mapping.generatedColumn;
|
||||
addMappingWithCode(lastMapping, code);
|
||||
// No more remaining code, continue
|
||||
lastMapping = mapping;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// We add the generated code until the first mapping
|
||||
// to the SourceNode without any mapping.
|
||||
// Each line is added as separate string.
|
||||
while (lastGeneratedLine < mapping.generatedLine) {
|
||||
node.add(shiftNextLine());
|
||||
lastGeneratedLine++;
|
||||
}
|
||||
if (lastGeneratedColumn < mapping.generatedColumn) {
|
||||
var nextLine = remainingLines[remainingLinesIndex] || '';
|
||||
node.add(nextLine.substr(0, mapping.generatedColumn));
|
||||
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
|
||||
lastGeneratedColumn = mapping.generatedColumn;
|
||||
}
|
||||
lastMapping = mapping;
|
||||
}, this);
|
||||
// We have processed all mappings.
|
||||
if (remainingLinesIndex < remainingLines.length) {
|
||||
if (lastMapping) {
|
||||
// Associate the remaining code in the current line with "lastMapping"
|
||||
addMappingWithCode(lastMapping, shiftNextLine());
|
||||
}
|
||||
// and add the remaining lines without any mapping
|
||||
node.add(remainingLines.splice(remainingLinesIndex).join(""));
|
||||
}
|
||||
|
||||
// Copy sourcesContent into SourceNode
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
if (aRelativePath != null) {
|
||||
sourceFile = util.join(aRelativePath, sourceFile);
|
||||
}
|
||||
node.setSourceContent(sourceFile, content);
|
||||
}
|
||||
});
|
||||
|
||||
return node;
|
||||
|
||||
function addMappingWithCode(mapping, code) {
|
||||
if (mapping === null || mapping.source === undefined) {
|
||||
node.add(code);
|
||||
} else {
|
||||
var source = aRelativePath
|
||||
? util.join(aRelativePath, mapping.source)
|
||||
: mapping.source;
|
||||
node.add(new SourceNode(mapping.originalLine,
|
||||
mapping.originalColumn,
|
||||
source,
|
||||
code,
|
||||
mapping.name));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a chunk of generated JS to this source node.
|
||||
*
|
||||
* @param aChunk A string snippet of generated JS code, another instance of
|
||||
* SourceNode, or an array where each member is one of those things.
|
||||
*/
|
||||
SourceNode.prototype.add = function SourceNode_add(aChunk) {
|
||||
if (Array.isArray(aChunk)) {
|
||||
aChunk.forEach(function (chunk) {
|
||||
this.add(chunk);
|
||||
}, this);
|
||||
}
|
||||
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
||||
if (aChunk) {
|
||||
this.children.push(aChunk);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new TypeError(
|
||||
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
||||
);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a chunk of generated JS to the beginning of this source node.
|
||||
*
|
||||
* @param aChunk A string snippet of generated JS code, another instance of
|
||||
* SourceNode, or an array where each member is one of those things.
|
||||
*/
|
||||
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
|
||||
if (Array.isArray(aChunk)) {
|
||||
for (var i = aChunk.length-1; i >= 0; i--) {
|
||||
this.prepend(aChunk[i]);
|
||||
}
|
||||
}
|
||||
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
||||
this.children.unshift(aChunk);
|
||||
}
|
||||
else {
|
||||
throw new TypeError(
|
||||
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
||||
);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Walk over the tree of JS snippets in this node and its children. The
|
||||
* walking function is called once for each snippet of JS and is passed that
|
||||
* snippet and the its original associated source's line/column location.
|
||||
*
|
||||
* @param aFn The traversal function.
|
||||
*/
|
||||
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
||||
var chunk;
|
||||
for (var i = 0, len = this.children.length; i < len; i++) {
|
||||
chunk = this.children[i];
|
||||
if (chunk[isSourceNode]) {
|
||||
chunk.walk(aFn);
|
||||
}
|
||||
else {
|
||||
if (chunk !== '') {
|
||||
aFn(chunk, { source: this.source,
|
||||
line: this.line,
|
||||
column: this.column,
|
||||
name: this.name });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
|
||||
* each of `this.children`.
|
||||
*
|
||||
* @param aSep The separator.
|
||||
*/
|
||||
SourceNode.prototype.join = function SourceNode_join(aSep) {
|
||||
var newChildren;
|
||||
var i;
|
||||
var len = this.children.length;
|
||||
if (len > 0) {
|
||||
newChildren = [];
|
||||
for (i = 0; i < len-1; i++) {
|
||||
newChildren.push(this.children[i]);
|
||||
newChildren.push(aSep);
|
||||
}
|
||||
newChildren.push(this.children[i]);
|
||||
this.children = newChildren;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Call String.prototype.replace on the very right-most source snippet. Useful
|
||||
* for trimming whitespace from the end of a source node, etc.
|
||||
*
|
||||
* @param aPattern The pattern to replace.
|
||||
* @param aReplacement The thing to replace the pattern with.
|
||||
*/
|
||||
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
|
||||
var lastChild = this.children[this.children.length - 1];
|
||||
if (lastChild[isSourceNode]) {
|
||||
lastChild.replaceRight(aPattern, aReplacement);
|
||||
}
|
||||
else if (typeof lastChild === 'string') {
|
||||
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
|
||||
}
|
||||
else {
|
||||
this.children.push(''.replace(aPattern, aReplacement));
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the source content for a source file. This will be added to the SourceMapGenerator
|
||||
* in the sourcesContent field.
|
||||
*
|
||||
* @param aSourceFile The filename of the source file
|
||||
* @param aSourceContent The content of the source file
|
||||
*/
|
||||
SourceNode.prototype.setSourceContent =
|
||||
function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
|
||||
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
|
||||
};
|
||||
|
||||
/**
|
||||
* Walk over the tree of SourceNodes. The walking function is called for each
|
||||
* source file content and is passed the filename and source content.
|
||||
*
|
||||
* @param aFn The traversal function.
|
||||
*/
|
||||
SourceNode.prototype.walkSourceContents =
|
||||
function SourceNode_walkSourceContents(aFn) {
|
||||
for (var i = 0, len = this.children.length; i < len; i++) {
|
||||
if (this.children[i][isSourceNode]) {
|
||||
this.children[i].walkSourceContents(aFn);
|
||||
}
|
||||
}
|
||||
|
||||
var sources = Object.keys(this.sourceContents);
|
||||
for (var i = 0, len = sources.length; i < len; i++) {
|
||||
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the string representation of this source node. Walks over the tree
|
||||
* and concatenates all the various snippets together to one string.
|
||||
*/
|
||||
SourceNode.prototype.toString = function SourceNode_toString() {
|
||||
var str = "";
|
||||
this.walk(function (chunk) {
|
||||
str += chunk;
|
||||
});
|
||||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the string representation of this source node along with a source
|
||||
* map.
|
||||
*/
|
||||
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
|
||||
var generated = {
|
||||
code: "",
|
||||
line: 1,
|
||||
column: 0
|
||||
};
|
||||
var map = new SourceMapGenerator(aArgs);
|
||||
var sourceMappingActive = false;
|
||||
var lastOriginalSource = null;
|
||||
var lastOriginalLine = null;
|
||||
var lastOriginalColumn = null;
|
||||
var lastOriginalName = null;
|
||||
this.walk(function (chunk, original) {
|
||||
generated.code += chunk;
|
||||
if (original.source !== null
|
||||
&& original.line !== null
|
||||
&& original.column !== null) {
|
||||
if(lastOriginalSource !== original.source
|
||||
|| lastOriginalLine !== original.line
|
||||
|| lastOriginalColumn !== original.column
|
||||
|| lastOriginalName !== original.name) {
|
||||
map.addMapping({
|
||||
source: original.source,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.column
|
||||
},
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
},
|
||||
name: original.name
|
||||
});
|
||||
}
|
||||
lastOriginalSource = original.source;
|
||||
lastOriginalLine = original.line;
|
||||
lastOriginalColumn = original.column;
|
||||
lastOriginalName = original.name;
|
||||
sourceMappingActive = true;
|
||||
} else if (sourceMappingActive) {
|
||||
map.addMapping({
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
}
|
||||
});
|
||||
lastOriginalSource = null;
|
||||
sourceMappingActive = false;
|
||||
}
|
||||
for (var idx = 0, length = chunk.length; idx < length; idx++) {
|
||||
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
|
||||
generated.line++;
|
||||
generated.column = 0;
|
||||
// Mappings end at eol
|
||||
if (idx + 1 === length) {
|
||||
lastOriginalSource = null;
|
||||
sourceMappingActive = false;
|
||||
} else if (sourceMappingActive) {
|
||||
map.addMapping({
|
||||
source: original.source,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.column
|
||||
},
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
},
|
||||
name: original.name
|
||||
});
|
||||
}
|
||||
} else {
|
||||
generated.column++;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.walkSourceContents(function (sourceFile, sourceContent) {
|
||||
map.setSourceContent(sourceFile, sourceContent);
|
||||
});
|
||||
|
||||
return { code: generated.code, map: map };
|
||||
};
|
||||
|
||||
exports.SourceNode = SourceNode;
|
||||
594
.output/server/node_modules/source-map-js/lib/util.js
generated
vendored
Normal file
594
.output/server/node_modules/source-map-js/lib/util.js
generated
vendored
Normal file
@@ -0,0 +1,594 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is a helper function for getting values from parameter/options
|
||||
* objects.
|
||||
*
|
||||
* @param args The object we are extracting values from
|
||||
* @param name The name of the property we are getting.
|
||||
* @param defaultValue An optional value to return if the property is missing
|
||||
* from the object. If this is not specified and the property is missing, an
|
||||
* error will be thrown.
|
||||
*/
|
||||
function getArg(aArgs, aName, aDefaultValue) {
|
||||
if (aName in aArgs) {
|
||||
return aArgs[aName];
|
||||
} else if (arguments.length === 3) {
|
||||
return aDefaultValue;
|
||||
} else {
|
||||
throw new Error('"' + aName + '" is a required argument.');
|
||||
}
|
||||
}
|
||||
exports.getArg = getArg;
|
||||
|
||||
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
||||
var dataUrlRegexp = /^data:.+\,.+$/;
|
||||
|
||||
function urlParse(aUrl) {
|
||||
var match = aUrl.match(urlRegexp);
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
scheme: match[1],
|
||||
auth: match[2],
|
||||
host: match[3],
|
||||
port: match[4],
|
||||
path: match[5]
|
||||
};
|
||||
}
|
||||
exports.urlParse = urlParse;
|
||||
|
||||
function urlGenerate(aParsedUrl) {
|
||||
var url = '';
|
||||
if (aParsedUrl.scheme) {
|
||||
url += aParsedUrl.scheme + ':';
|
||||
}
|
||||
url += '//';
|
||||
if (aParsedUrl.auth) {
|
||||
url += aParsedUrl.auth + '@';
|
||||
}
|
||||
if (aParsedUrl.host) {
|
||||
url += aParsedUrl.host;
|
||||
}
|
||||
if (aParsedUrl.port) {
|
||||
url += ":" + aParsedUrl.port
|
||||
}
|
||||
if (aParsedUrl.path) {
|
||||
url += aParsedUrl.path;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
exports.urlGenerate = urlGenerate;
|
||||
|
||||
var MAX_CACHED_INPUTS = 32;
|
||||
|
||||
/**
|
||||
* Takes some function `f(input) -> result` and returns a memoized version of
|
||||
* `f`.
|
||||
*
|
||||
* We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
|
||||
* memoization is a dumb-simple, linear least-recently-used cache.
|
||||
*/
|
||||
function lruMemoize(f) {
|
||||
var cache = [];
|
||||
|
||||
return function(input) {
|
||||
for (var i = 0; i < cache.length; i++) {
|
||||
if (cache[i].input === input) {
|
||||
var temp = cache[0];
|
||||
cache[0] = cache[i];
|
||||
cache[i] = temp;
|
||||
return cache[0].result;
|
||||
}
|
||||
}
|
||||
|
||||
var result = f(input);
|
||||
|
||||
cache.unshift({
|
||||
input,
|
||||
result,
|
||||
});
|
||||
|
||||
if (cache.length > MAX_CACHED_INPUTS) {
|
||||
cache.pop();
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes a path, or the path portion of a URL:
|
||||
*
|
||||
* - Replaces consecutive slashes with one slash.
|
||||
* - Removes unnecessary '.' parts.
|
||||
* - Removes unnecessary '<dir>/..' parts.
|
||||
*
|
||||
* Based on code in the Node.js 'path' core module.
|
||||
*
|
||||
* @param aPath The path or url to normalize.
|
||||
*/
|
||||
var normalize = lruMemoize(function normalize(aPath) {
|
||||
var path = aPath;
|
||||
var url = urlParse(aPath);
|
||||
if (url) {
|
||||
if (!url.path) {
|
||||
return aPath;
|
||||
}
|
||||
path = url.path;
|
||||
}
|
||||
var isAbsolute = exports.isAbsolute(path);
|
||||
// Split the path into parts between `/` characters. This is much faster than
|
||||
// using `.split(/\/+/g)`.
|
||||
var parts = [];
|
||||
var start = 0;
|
||||
var i = 0;
|
||||
while (true) {
|
||||
start = i;
|
||||
i = path.indexOf("/", start);
|
||||
if (i === -1) {
|
||||
parts.push(path.slice(start));
|
||||
break;
|
||||
} else {
|
||||
parts.push(path.slice(start, i));
|
||||
while (i < path.length && path[i] === "/") {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
||||
part = parts[i];
|
||||
if (part === '.') {
|
||||
parts.splice(i, 1);
|
||||
} else if (part === '..') {
|
||||
up++;
|
||||
} else if (up > 0) {
|
||||
if (part === '') {
|
||||
// The first part is blank if the path is absolute. Trying to go
|
||||
// above the root is a no-op. Therefore we can remove all '..' parts
|
||||
// directly after the root.
|
||||
parts.splice(i + 1, up);
|
||||
up = 0;
|
||||
} else {
|
||||
parts.splice(i, 2);
|
||||
up--;
|
||||
}
|
||||
}
|
||||
}
|
||||
path = parts.join('/');
|
||||
|
||||
if (path === '') {
|
||||
path = isAbsolute ? '/' : '.';
|
||||
}
|
||||
|
||||
if (url) {
|
||||
url.path = path;
|
||||
return urlGenerate(url);
|
||||
}
|
||||
return path;
|
||||
});
|
||||
exports.normalize = normalize;
|
||||
|
||||
/**
|
||||
* Joins two paths/URLs.
|
||||
*
|
||||
* @param aRoot The root path or URL.
|
||||
* @param aPath The path or URL to be joined with the root.
|
||||
*
|
||||
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
|
||||
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
|
||||
* first.
|
||||
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
|
||||
* is updated with the result and aRoot is returned. Otherwise the result
|
||||
* is returned.
|
||||
* - If aPath is absolute, the result is aPath.
|
||||
* - Otherwise the two paths are joined with a slash.
|
||||
* - Joining for example 'http://' and 'www.example.com' is also supported.
|
||||
*/
|
||||
function join(aRoot, aPath) {
|
||||
if (aRoot === "") {
|
||||
aRoot = ".";
|
||||
}
|
||||
if (aPath === "") {
|
||||
aPath = ".";
|
||||
}
|
||||
var aPathUrl = urlParse(aPath);
|
||||
var aRootUrl = urlParse(aRoot);
|
||||
if (aRootUrl) {
|
||||
aRoot = aRootUrl.path || '/';
|
||||
}
|
||||
|
||||
// `join(foo, '//www.example.org')`
|
||||
if (aPathUrl && !aPathUrl.scheme) {
|
||||
if (aRootUrl) {
|
||||
aPathUrl.scheme = aRootUrl.scheme;
|
||||
}
|
||||
return urlGenerate(aPathUrl);
|
||||
}
|
||||
|
||||
if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
// `join('http://', 'www.example.com')`
|
||||
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
||||
aRootUrl.host = aPath;
|
||||
return urlGenerate(aRootUrl);
|
||||
}
|
||||
|
||||
var joined = aPath.charAt(0) === '/'
|
||||
? aPath
|
||||
: normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
|
||||
|
||||
if (aRootUrl) {
|
||||
aRootUrl.path = joined;
|
||||
return urlGenerate(aRootUrl);
|
||||
}
|
||||
return joined;
|
||||
}
|
||||
exports.join = join;
|
||||
|
||||
exports.isAbsolute = function (aPath) {
|
||||
return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
|
||||
};
|
||||
|
||||
/**
|
||||
* Make a path relative to a URL or another path.
|
||||
*
|
||||
* @param aRoot The root path or URL.
|
||||
* @param aPath The path or URL to be made relative to aRoot.
|
||||
*/
|
||||
function relative(aRoot, aPath) {
|
||||
if (aRoot === "") {
|
||||
aRoot = ".";
|
||||
}
|
||||
|
||||
aRoot = aRoot.replace(/\/$/, '');
|
||||
|
||||
// It is possible for the path to be above the root. In this case, simply
|
||||
// checking whether the root is a prefix of the path won't work. Instead, we
|
||||
// need to remove components from the root one by one, until either we find
|
||||
// a prefix that fits, or we run out of components to remove.
|
||||
var level = 0;
|
||||
while (aPath.indexOf(aRoot + '/') !== 0) {
|
||||
var index = aRoot.lastIndexOf("/");
|
||||
if (index < 0) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
// If the only part of the root that is left is the scheme (i.e. http://,
|
||||
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
|
||||
// have exhausted all components, so the path is not relative to the root.
|
||||
aRoot = aRoot.slice(0, index);
|
||||
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
++level;
|
||||
}
|
||||
|
||||
// Make sure we add a "../" for each component we removed from the root.
|
||||
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
||||
}
|
||||
exports.relative = relative;
|
||||
|
||||
var supportsNullProto = (function () {
|
||||
var obj = Object.create(null);
|
||||
return !('__proto__' in obj);
|
||||
}());
|
||||
|
||||
function identity (s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Because behavior goes wacky when you set `__proto__` on objects, we
|
||||
* have to prefix all the strings in our set with an arbitrary character.
|
||||
*
|
||||
* See https://github.com/mozilla/source-map/pull/31 and
|
||||
* https://github.com/mozilla/source-map/issues/30
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
function toSetString(aStr) {
|
||||
if (isProtoString(aStr)) {
|
||||
return '$' + aStr;
|
||||
}
|
||||
|
||||
return aStr;
|
||||
}
|
||||
exports.toSetString = supportsNullProto ? identity : toSetString;
|
||||
|
||||
function fromSetString(aStr) {
|
||||
if (isProtoString(aStr)) {
|
||||
return aStr.slice(1);
|
||||
}
|
||||
|
||||
return aStr;
|
||||
}
|
||||
exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
||||
|
||||
function isProtoString(s) {
|
||||
if (!s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var length = s.length;
|
||||
|
||||
if (length < 9 /* "__proto__".length */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 2) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
|
||||
s.charCodeAt(length - 4) !== 116 /* 't' */ ||
|
||||
s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
|
||||
s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
|
||||
s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
|
||||
s.charCodeAt(length - 8) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 9) !== 95 /* '_' */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = length - 10; i >= 0; i--) {
|
||||
if (s.charCodeAt(i) !== 36 /* '$' */) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparator between two mappings where the original positions are compared.
|
||||
*
|
||||
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||||
* mappings with the same original source/line/column, but different generated
|
||||
* line and column the same. Useful when searching for a mapping with a
|
||||
* stubbed out mapping.
|
||||
*/
|
||||
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
||||
var cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0 || onlyCompareOriginal) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByOriginalPositions = compareByOriginalPositions;
|
||||
|
||||
function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
|
||||
var cmp
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0 || onlyCompareOriginal) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
|
||||
|
||||
/**
|
||||
* Comparator between two mappings with deflated source and name indices where
|
||||
* the generated positions are compared.
|
||||
*
|
||||
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||||
* mappings with the same generated line and column, but different
|
||||
* source/name/original line and column the same. Useful when searching for a
|
||||
* mapping with a stubbed out mapping.
|
||||
*/
|
||||
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
||||
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0 || onlyCompareGenerated) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
||||
|
||||
function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
|
||||
var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0 || onlyCompareGenerated) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
|
||||
|
||||
function strcmp(aStr1, aStr2) {
|
||||
if (aStr1 === aStr2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (aStr1 === null) {
|
||||
return 1; // aStr2 !== null
|
||||
}
|
||||
|
||||
if (aStr2 === null) {
|
||||
return -1; // aStr1 !== null
|
||||
}
|
||||
|
||||
if (aStr1 > aStr2) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparator between two mappings with inflated source and name strings where
|
||||
* the generated positions are compared.
|
||||
*/
|
||||
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
||||
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
||||
|
||||
/**
|
||||
* Strip any JSON XSSI avoidance prefix from the string (as documented
|
||||
* in the source maps specification), and then parse the string as
|
||||
* JSON.
|
||||
*/
|
||||
function parseSourceMapInput(str) {
|
||||
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
|
||||
}
|
||||
exports.parseSourceMapInput = parseSourceMapInput;
|
||||
|
||||
/**
|
||||
* Compute the URL of a source given the the source root, the source's
|
||||
* URL, and the source map's URL.
|
||||
*/
|
||||
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
||||
sourceURL = sourceURL || '';
|
||||
|
||||
if (sourceRoot) {
|
||||
// This follows what Chrome does.
|
||||
if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
|
||||
sourceRoot += '/';
|
||||
}
|
||||
// The spec says:
|
||||
// Line 4: An optional source root, useful for relocating source
|
||||
// files on a server or removing repeated values in the
|
||||
// “sources” entry. This value is prepended to the individual
|
||||
// entries in the “source” field.
|
||||
sourceURL = sourceRoot + sourceURL;
|
||||
}
|
||||
|
||||
// Historically, SourceMapConsumer did not take the sourceMapURL as
|
||||
// a parameter. This mode is still somewhat supported, which is why
|
||||
// this code block is conditional. However, it's preferable to pass
|
||||
// the source map URL to SourceMapConsumer, so that this function
|
||||
// can implement the source URL resolution algorithm as outlined in
|
||||
// the spec. This block is basically the equivalent of:
|
||||
// new URL(sourceURL, sourceMapURL).toString()
|
||||
// ... except it avoids using URL, which wasn't available in the
|
||||
// older releases of node still supported by this library.
|
||||
//
|
||||
// The spec says:
|
||||
// If the sources are not absolute URLs after prepending of the
|
||||
// “sourceRoot”, the sources are resolved relative to the
|
||||
// SourceMap (like resolving script src in a html document).
|
||||
if (sourceMapURL) {
|
||||
var parsed = urlParse(sourceMapURL);
|
||||
if (!parsed) {
|
||||
throw new Error("sourceMapURL could not be parsed");
|
||||
}
|
||||
if (parsed.path) {
|
||||
// Strip the last path component, but keep the "/".
|
||||
var index = parsed.path.lastIndexOf('/');
|
||||
if (index >= 0) {
|
||||
parsed.path = parsed.path.substring(0, index + 1);
|
||||
}
|
||||
}
|
||||
sourceURL = join(urlGenerate(parsed), sourceURL);
|
||||
}
|
||||
|
||||
return normalize(sourceURL);
|
||||
}
|
||||
exports.computeSourceURL = computeSourceURL;
|
||||
71
.output/server/node_modules/source-map-js/package.json
generated
vendored
Normal file
71
.output/server/node_modules/source-map-js/package.json
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"name": "source-map-js",
|
||||
"description": "Generates and consumes source maps",
|
||||
"version": "1.2.1",
|
||||
"homepage": "https://github.com/7rulnik/source-map-js",
|
||||
"author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>",
|
||||
"contributors": [
|
||||
"Nick Fitzgerald <nfitzgerald@mozilla.com>",
|
||||
"Tobias Koppers <tobias.koppers@googlemail.com>",
|
||||
"Duncan Beevers <duncan@dweebd.com>",
|
||||
"Stephen Crane <scrane@mozilla.com>",
|
||||
"Ryan Seddon <seddon.ryan@gmail.com>",
|
||||
"Miles Elam <miles.elam@deem.com>",
|
||||
"Mihai Bazon <mihai.bazon@gmail.com>",
|
||||
"Michael Ficarra <github.public.email@michael.ficarra.me>",
|
||||
"Todd Wolfson <todd@twolfson.com>",
|
||||
"Alexander Solovyov <alexander@solovyov.net>",
|
||||
"Felix Gnass <fgnass@gmail.com>",
|
||||
"Conrad Irwin <conrad.irwin@gmail.com>",
|
||||
"usrbincc <usrbincc@yahoo.com>",
|
||||
"David Glasser <glasser@davidglasser.net>",
|
||||
"Chase Douglas <chase@newrelic.com>",
|
||||
"Evan Wallace <evan.exe@gmail.com>",
|
||||
"Heather Arthur <fayearthur@gmail.com>",
|
||||
"Hugh Kennedy <hughskennedy@gmail.com>",
|
||||
"David Glasser <glasser@davidglasser.net>",
|
||||
"Simon Lydell <simon.lydell@gmail.com>",
|
||||
"Jmeas Smith <jellyes2@gmail.com>",
|
||||
"Michael Z Goddard <mzgoddard@gmail.com>",
|
||||
"azu <azu@users.noreply.github.com>",
|
||||
"John Gozde <john@gozde.ca>",
|
||||
"Adam Kirkton <akirkton@truefitinnovation.com>",
|
||||
"Chris Montgomery <christopher.montgomery@dowjones.com>",
|
||||
"J. Ryan Stinnett <jryans@gmail.com>",
|
||||
"Jack Herrington <jherrington@walmartlabs.com>",
|
||||
"Chris Truter <jeffpalentine@gmail.com>",
|
||||
"Daniel Espeset <daniel@danielespeset.com>",
|
||||
"Jamie Wong <jamie.lf.wong@gmail.com>",
|
||||
"Eddy Bruël <ejpbruel@mozilla.com>",
|
||||
"Hawken Rives <hawkrives@gmail.com>",
|
||||
"Gilad Peleg <giladp007@gmail.com>",
|
||||
"djchie <djchie.dev@gmail.com>",
|
||||
"Gary Ye <garysye@gmail.com>",
|
||||
"Nicolas Lalevée <nicolas.lalevee@hibnet.org>"
|
||||
],
|
||||
"repository": "7rulnik/source-map-js",
|
||||
"main": "./source-map.js",
|
||||
"files": [
|
||||
"source-map.js",
|
||||
"source-map.d.ts",
|
||||
"lib/"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"scripts": {
|
||||
"test": "npm run build && node test/run-tests.js",
|
||||
"build": "webpack --color",
|
||||
"toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-publish": "^3.1.0",
|
||||
"doctoc": "^0.15.0",
|
||||
"webpack": "^1.12.0"
|
||||
},
|
||||
"clean-publish": {
|
||||
"cleanDocs": true
|
||||
},
|
||||
"typings": "source-map.d.ts"
|
||||
}
|
||||
8
.output/server/node_modules/source-map-js/source-map.js
generated
vendored
Normal file
8
.output/server/node_modules/source-map-js/source-map.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Copyright 2009-2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE.txt or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;
|
||||
exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
|
||||
exports.SourceNode = require('./lib/source-node').SourceNode;
|
||||
645
.output/server/node_modules/ufo/dist/index.mjs
generated
vendored
Normal file
645
.output/server/node_modules/ufo/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,645 @@
|
||||
const n = /[^\0-\x7E]/;
|
||||
const t = /[\x2E\u3002\uFF0E\uFF61]/g;
|
||||
const o = {
|
||||
overflow: "Overflow Error",
|
||||
"not-basic": "Illegal Input",
|
||||
"invalid-input": "Invalid Input"
|
||||
};
|
||||
const e = Math.floor;
|
||||
const r = String.fromCharCode;
|
||||
function s(n2) {
|
||||
throw new RangeError(o[n2]);
|
||||
}
|
||||
const c = function(n2, t2) {
|
||||
return n2 + 22 + 75 * (n2 < 26) - ((t2 != 0) << 5);
|
||||
};
|
||||
const u = function(n2, t2, o2) {
|
||||
let r2 = 0;
|
||||
for (n2 = o2 ? e(n2 / 700) : n2 >> 1, n2 += e(n2 / t2); n2 > 455; r2 += 36) {
|
||||
n2 = e(n2 / 35);
|
||||
}
|
||||
return e(r2 + 36 * n2 / (n2 + 38));
|
||||
};
|
||||
function toASCII(o2) {
|
||||
return (function(n2, o3) {
|
||||
const e2 = n2.split("@");
|
||||
let r2 = "";
|
||||
e2.length > 1 && (r2 = e2[0] + "@", n2 = e2[1]);
|
||||
const s2 = (function(n3, t2) {
|
||||
const o4 = [];
|
||||
let e3 = n3.length;
|
||||
for (; e3--; ) {
|
||||
o4[e3] = t2(n3[e3]);
|
||||
}
|
||||
return o4;
|
||||
})((n2 = n2.replace(t, ".")).split("."), o3).join(".");
|
||||
return r2 + s2;
|
||||
})(o2, function(t2) {
|
||||
return n.test(t2) ? "xn--" + (function(n2) {
|
||||
const t3 = [];
|
||||
const o3 = (n2 = (function(n3) {
|
||||
const t4 = [];
|
||||
let o4 = 0;
|
||||
const e2 = n3.length;
|
||||
for (; o4 < e2; ) {
|
||||
const r2 = n3.charCodeAt(o4++);
|
||||
if (r2 >= 55296 && r2 <= 56319 && o4 < e2) {
|
||||
const e3 = n3.charCodeAt(o4++);
|
||||
(64512 & e3) == 56320 ? t4.push(((1023 & r2) << 10) + (1023 & e3) + 65536) : (t4.push(r2), o4--);
|
||||
} else {
|
||||
t4.push(r2);
|
||||
}
|
||||
}
|
||||
return t4;
|
||||
})(n2)).length;
|
||||
let f = 128;
|
||||
let i = 0;
|
||||
let l = 72;
|
||||
for (const o4 of n2) {
|
||||
o4 < 128 && t3.push(r(o4));
|
||||
}
|
||||
const h = t3.length;
|
||||
let p = h;
|
||||
for (h && t3.push("-"); p < o3; ) {
|
||||
let o4 = 2147483647;
|
||||
for (const t4 of n2) {
|
||||
t4 >= f && t4 < o4 && (o4 = t4);
|
||||
}
|
||||
const a = p + 1;
|
||||
o4 - f > e((2147483647 - i) / a) && s("overflow"), i += (o4 - f) * a, f = o4;
|
||||
for (const o5 of n2) {
|
||||
if (o5 < f && ++i > 2147483647 && s("overflow"), o5 == f) {
|
||||
let n3 = i;
|
||||
for (let o6 = 36; ; o6 += 36) {
|
||||
const s2 = o6 <= l ? 1 : o6 >= l + 26 ? 26 : o6 - l;
|
||||
if (n3 < s2) {
|
||||
break;
|
||||
}
|
||||
const u2 = n3 - s2;
|
||||
const f2 = 36 - s2;
|
||||
t3.push(r(c(s2 + u2 % f2, 0))), n3 = e(u2 / f2);
|
||||
}
|
||||
t3.push(r(c(n3, 0))), l = u(i, a, p == h), i = 0, ++p;
|
||||
}
|
||||
}
|
||||
++i, ++f;
|
||||
}
|
||||
return t3.join("");
|
||||
})(t2) : t2;
|
||||
});
|
||||
}
|
||||
|
||||
const HASH_RE = /#/g;
|
||||
const AMPERSAND_RE = /&/g;
|
||||
const SLASH_RE = /\//g;
|
||||
const EQUAL_RE = /=/g;
|
||||
const IM_RE = /\?/g;
|
||||
const PLUS_RE = /\+/g;
|
||||
const ENC_CARET_RE = /%5e/gi;
|
||||
const ENC_BACKTICK_RE = /%60/gi;
|
||||
const ENC_CURLY_OPEN_RE = /%7b/gi;
|
||||
const ENC_PIPE_RE = /%7c/gi;
|
||||
const ENC_CURLY_CLOSE_RE = /%7d/gi;
|
||||
const ENC_SPACE_RE = /%20/gi;
|
||||
const ENC_SLASH_RE = /%2f/gi;
|
||||
const ENC_ENC_SLASH_RE = /%252f/gi;
|
||||
function encode(text) {
|
||||
return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
|
||||
}
|
||||
function encodeHash(text) {
|
||||
return encode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
|
||||
}
|
||||
function encodeQueryValue(input) {
|
||||
return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F");
|
||||
}
|
||||
function encodeQueryKey(text) {
|
||||
return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
|
||||
}
|
||||
function encodePath(text) {
|
||||
return encode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F").replace(ENC_ENC_SLASH_RE, "%2F").replace(AMPERSAND_RE, "%26").replace(PLUS_RE, "%2B");
|
||||
}
|
||||
function encodeParam(text) {
|
||||
return encodePath(text).replace(SLASH_RE, "%2F");
|
||||
}
|
||||
function decode(text = "") {
|
||||
try {
|
||||
return decodeURIComponent("" + text);
|
||||
} catch {
|
||||
return "" + text;
|
||||
}
|
||||
}
|
||||
function decodePath(text) {
|
||||
return decode(text.replace(ENC_SLASH_RE, "%252F"));
|
||||
}
|
||||
function decodeQueryKey(text) {
|
||||
return decode(text.replace(PLUS_RE, " "));
|
||||
}
|
||||
function decodeQueryValue(text) {
|
||||
return decode(text.replace(PLUS_RE, " "));
|
||||
}
|
||||
function encodeHost(name = "") {
|
||||
return toASCII(name);
|
||||
}
|
||||
|
||||
function parseQuery(parametersString = "") {
|
||||
const object = /* @__PURE__ */ Object.create(null);
|
||||
if (parametersString[0] === "?") {
|
||||
parametersString = parametersString.slice(1);
|
||||
}
|
||||
for (const parameter of parametersString.split("&")) {
|
||||
const s = parameter.match(/([^=]+)=?(.*)/) || [];
|
||||
if (s.length < 2) {
|
||||
continue;
|
||||
}
|
||||
const key = decodeQueryKey(s[1]);
|
||||
if (key === "__proto__" || key === "constructor") {
|
||||
continue;
|
||||
}
|
||||
const value = decodeQueryValue(s[2] || "");
|
||||
if (object[key] === void 0) {
|
||||
object[key] = value;
|
||||
} else if (Array.isArray(object[key])) {
|
||||
object[key].push(value);
|
||||
} else {
|
||||
object[key] = [object[key], value];
|
||||
}
|
||||
}
|
||||
return object;
|
||||
}
|
||||
function encodeQueryItem(key, value) {
|
||||
if (typeof value === "number" || typeof value === "boolean") {
|
||||
value = String(value);
|
||||
}
|
||||
if (!value) {
|
||||
return encodeQueryKey(key);
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(
|
||||
(_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`
|
||||
).join("&");
|
||||
}
|
||||
return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;
|
||||
}
|
||||
function stringifyQuery(query) {
|
||||
return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&");
|
||||
}
|
||||
|
||||
const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
|
||||
const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/;
|
||||
const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/;
|
||||
const PROTOCOL_SCRIPT_RE = /^[\s\0]*(blob|data|javascript|vbscript):$/i;
|
||||
const TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
|
||||
const JOIN_LEADING_SLASH_RE = /^\.?\//;
|
||||
function isRelative(inputString) {
|
||||
return ["./", "../"].some((string_) => inputString.startsWith(string_));
|
||||
}
|
||||
function hasProtocol(inputString, opts = {}) {
|
||||
if (typeof opts === "boolean") {
|
||||
opts = { acceptRelative: opts };
|
||||
}
|
||||
if (opts.strict) {
|
||||
return PROTOCOL_STRICT_REGEX.test(inputString);
|
||||
}
|
||||
return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);
|
||||
}
|
||||
function isScriptProtocol(protocol) {
|
||||
return !!protocol && PROTOCOL_SCRIPT_RE.test(protocol);
|
||||
}
|
||||
function hasTrailingSlash(input = "", respectQueryAndFragment) {
|
||||
if (!respectQueryAndFragment) {
|
||||
return input.endsWith("/");
|
||||
}
|
||||
return TRAILING_SLASH_RE.test(input);
|
||||
}
|
||||
function withoutTrailingSlash(input = "", respectQueryAndFragment) {
|
||||
if (!respectQueryAndFragment) {
|
||||
return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
|
||||
}
|
||||
if (!hasTrailingSlash(input, true)) {
|
||||
return input || "/";
|
||||
}
|
||||
let path = input;
|
||||
let fragment = "";
|
||||
const fragmentIndex = input.indexOf("#");
|
||||
if (fragmentIndex !== -1) {
|
||||
path = input.slice(0, fragmentIndex);
|
||||
fragment = input.slice(fragmentIndex);
|
||||
}
|
||||
const [s0, ...s] = path.split("?");
|
||||
const cleanPath = s0.endsWith("/") ? s0.slice(0, -1) : s0;
|
||||
return (cleanPath || "/") + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
||||
}
|
||||
function withTrailingSlash(input = "", respectQueryAndFragment) {
|
||||
if (!respectQueryAndFragment) {
|
||||
return input.endsWith("/") ? input : input + "/";
|
||||
}
|
||||
if (hasTrailingSlash(input, true)) {
|
||||
return input || "/";
|
||||
}
|
||||
let path = input;
|
||||
let fragment = "";
|
||||
const fragmentIndex = input.indexOf("#");
|
||||
if (fragmentIndex !== -1) {
|
||||
path = input.slice(0, fragmentIndex);
|
||||
fragment = input.slice(fragmentIndex);
|
||||
if (!path) {
|
||||
return fragment;
|
||||
}
|
||||
}
|
||||
const [s0, ...s] = path.split("?");
|
||||
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
||||
}
|
||||
function hasLeadingSlash(input = "") {
|
||||
return input.startsWith("/");
|
||||
}
|
||||
function withoutLeadingSlash(input = "") {
|
||||
return (hasLeadingSlash(input) ? input.slice(1) : input) || "/";
|
||||
}
|
||||
function withLeadingSlash(input = "") {
|
||||
return hasLeadingSlash(input) ? input : "/" + input;
|
||||
}
|
||||
function cleanDoubleSlashes(input = "") {
|
||||
return input.split("://").map((string_) => string_.replace(/\/{2,}/g, "/")).join("://");
|
||||
}
|
||||
function withBase(input, base) {
|
||||
if (isEmptyURL(base) || hasProtocol(input)) {
|
||||
return input;
|
||||
}
|
||||
const _base = withoutTrailingSlash(base);
|
||||
if (input.startsWith(_base)) {
|
||||
const nextChar = input[_base.length];
|
||||
if (!nextChar || nextChar === "/" || nextChar === "?") {
|
||||
return input;
|
||||
}
|
||||
}
|
||||
return joinURL(_base, input);
|
||||
}
|
||||
function withoutBase(input, base) {
|
||||
if (isEmptyURL(base)) {
|
||||
return input;
|
||||
}
|
||||
const _base = withoutTrailingSlash(base);
|
||||
if (!input.startsWith(_base)) {
|
||||
return input;
|
||||
}
|
||||
const nextChar = input[_base.length];
|
||||
if (nextChar && nextChar !== "/" && nextChar !== "?") {
|
||||
return input;
|
||||
}
|
||||
const trimmed = input.slice(_base.length);
|
||||
return trimmed[0] === "/" ? trimmed : "/" + trimmed;
|
||||
}
|
||||
function withQuery(input, query) {
|
||||
const parsed = parseURL(input);
|
||||
const mergedQuery = { ...parseQuery(parsed.search), ...query };
|
||||
parsed.search = stringifyQuery(mergedQuery);
|
||||
return stringifyParsedURL(parsed);
|
||||
}
|
||||
function filterQuery(input, predicate) {
|
||||
if (!input.includes("?")) {
|
||||
return input;
|
||||
}
|
||||
const parsed = parseURL(input);
|
||||
const query = parseQuery(parsed.search);
|
||||
const filteredQuery = Object.fromEntries(
|
||||
Object.entries(query).filter(([key, value]) => predicate(key, value))
|
||||
);
|
||||
parsed.search = stringifyQuery(filteredQuery);
|
||||
return stringifyParsedURL(parsed);
|
||||
}
|
||||
function getQuery(input) {
|
||||
return parseQuery(parseURL(input).search);
|
||||
}
|
||||
function isEmptyURL(url) {
|
||||
return !url || url === "/";
|
||||
}
|
||||
function isNonEmptyURL(url) {
|
||||
return url && url !== "/";
|
||||
}
|
||||
function joinURL(base, ...input) {
|
||||
let url = base || "";
|
||||
for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {
|
||||
if (url) {
|
||||
const _segment = segment.replace(JOIN_LEADING_SLASH_RE, "");
|
||||
url = withTrailingSlash(url) + _segment;
|
||||
} else {
|
||||
url = segment;
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
function joinRelativeURL(..._input) {
|
||||
const JOIN_SEGMENT_SPLIT_RE = /\/(?!\/)/;
|
||||
const input = _input.filter(Boolean);
|
||||
const segments = [];
|
||||
let segmentsDepth = 0;
|
||||
for (const i of input) {
|
||||
if (!i || i === "/") {
|
||||
continue;
|
||||
}
|
||||
for (const [sindex, s] of i.split(JOIN_SEGMENT_SPLIT_RE).entries()) {
|
||||
if (!s || s === ".") {
|
||||
continue;
|
||||
}
|
||||
if (s === "..") {
|
||||
if (segments.length === 1 && hasProtocol(segments[0])) {
|
||||
continue;
|
||||
}
|
||||
segments.pop();
|
||||
segmentsDepth--;
|
||||
continue;
|
||||
}
|
||||
if (sindex === 1 && segments[segments.length - 1]?.endsWith(":/")) {
|
||||
segments[segments.length - 1] += "/" + s;
|
||||
continue;
|
||||
}
|
||||
segments.push(s);
|
||||
segmentsDepth++;
|
||||
}
|
||||
}
|
||||
let url = segments.join("/");
|
||||
if (segmentsDepth >= 0) {
|
||||
if (input[0]?.startsWith("/") && !url.startsWith("/")) {
|
||||
url = "/" + url;
|
||||
} else if (input[0]?.startsWith("./") && !url.startsWith("./")) {
|
||||
url = "./" + url;
|
||||
}
|
||||
} else {
|
||||
url = "../".repeat(-1 * segmentsDepth) + url;
|
||||
}
|
||||
if (input[input.length - 1]?.endsWith("/") && !url.endsWith("/")) {
|
||||
url += "/";
|
||||
}
|
||||
return url;
|
||||
}
|
||||
function withHttp(input) {
|
||||
return withProtocol(input, "http://");
|
||||
}
|
||||
function withHttps(input) {
|
||||
return withProtocol(input, "https://");
|
||||
}
|
||||
function withoutProtocol(input) {
|
||||
return withProtocol(input, "");
|
||||
}
|
||||
function withProtocol(input, protocol) {
|
||||
let match = input.match(PROTOCOL_REGEX);
|
||||
if (!match) {
|
||||
match = input.match(/^\/{2,}/);
|
||||
}
|
||||
if (!match) {
|
||||
return protocol + input;
|
||||
}
|
||||
return protocol + input.slice(match[0].length);
|
||||
}
|
||||
function normalizeURL(input) {
|
||||
const parsed = parseURL(input);
|
||||
parsed.pathname = encodePath(decodePath(parsed.pathname));
|
||||
parsed.hash = encodeHash(decode(parsed.hash));
|
||||
parsed.host = encodeHost(decode(parsed.host));
|
||||
parsed.search = stringifyQuery(parseQuery(parsed.search));
|
||||
return stringifyParsedURL(parsed);
|
||||
}
|
||||
function resolveURL(base = "", ...inputs) {
|
||||
if (typeof base !== "string") {
|
||||
throw new TypeError(
|
||||
`URL input should be string received ${typeof base} (${base})`
|
||||
);
|
||||
}
|
||||
const filteredInputs = inputs.filter((input) => isNonEmptyURL(input));
|
||||
if (filteredInputs.length === 0) {
|
||||
return base;
|
||||
}
|
||||
const url = parseURL(base);
|
||||
for (const inputSegment of filteredInputs) {
|
||||
const urlSegment = parseURL(inputSegment);
|
||||
if (urlSegment.pathname) {
|
||||
url.pathname = withTrailingSlash(url.pathname) + withoutLeadingSlash(urlSegment.pathname);
|
||||
}
|
||||
if (urlSegment.hash && urlSegment.hash !== "#") {
|
||||
url.hash = urlSegment.hash;
|
||||
}
|
||||
if (urlSegment.search && urlSegment.search !== "?") {
|
||||
if (url.search && url.search !== "?") {
|
||||
const queryString = stringifyQuery({
|
||||
...parseQuery(url.search),
|
||||
...parseQuery(urlSegment.search)
|
||||
});
|
||||
url.search = queryString.length > 0 ? "?" + queryString : "";
|
||||
} else {
|
||||
url.search = urlSegment.search;
|
||||
}
|
||||
}
|
||||
}
|
||||
return stringifyParsedURL(url);
|
||||
}
|
||||
function isSamePath(p1, p2) {
|
||||
return decode(withoutTrailingSlash(p1)) === decode(withoutTrailingSlash(p2));
|
||||
}
|
||||
function isEqual(a, b, options = {}) {
|
||||
if (!options.trailingSlash) {
|
||||
a = withTrailingSlash(a);
|
||||
b = withTrailingSlash(b);
|
||||
}
|
||||
if (!options.leadingSlash) {
|
||||
a = withLeadingSlash(a);
|
||||
b = withLeadingSlash(b);
|
||||
}
|
||||
if (!options.encoding) {
|
||||
a = decode(a);
|
||||
b = decode(b);
|
||||
}
|
||||
return a === b;
|
||||
}
|
||||
function withFragment(input, hash) {
|
||||
if (!hash || hash === "#") {
|
||||
return input;
|
||||
}
|
||||
const parsed = parseURL(input);
|
||||
parsed.hash = hash === "" ? "" : "#" + encodeHash(hash);
|
||||
return stringifyParsedURL(parsed);
|
||||
}
|
||||
function withoutFragment(input) {
|
||||
return stringifyParsedURL({ ...parseURL(input), hash: "" });
|
||||
}
|
||||
function withoutHost(input) {
|
||||
const parsed = parseURL(input);
|
||||
return (parsed.pathname || "/") + parsed.search + parsed.hash;
|
||||
}
|
||||
|
||||
const protocolRelative = Symbol.for("ufo:protocolRelative");
|
||||
function parseURL(input = "", defaultProto) {
|
||||
const _specialProtoMatch = input.match(
|
||||
/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i
|
||||
);
|
||||
if (_specialProtoMatch) {
|
||||
const [, _proto, _pathname = ""] = _specialProtoMatch;
|
||||
return {
|
||||
protocol: _proto.toLowerCase(),
|
||||
pathname: _pathname,
|
||||
href: _proto + _pathname,
|
||||
auth: "",
|
||||
host: "",
|
||||
search: "",
|
||||
hash: ""
|
||||
};
|
||||
}
|
||||
if (!hasProtocol(input, { acceptRelative: true })) {
|
||||
return defaultProto ? parseURL(defaultProto + input) : parsePath(input);
|
||||
}
|
||||
const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [];
|
||||
let [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];
|
||||
if (protocol === "file:") {
|
||||
path = path.replace(/\/(?=[A-Za-z]:)/, "");
|
||||
}
|
||||
const { pathname, search, hash } = parsePath(path);
|
||||
return {
|
||||
protocol: protocol.toLowerCase(),
|
||||
auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "",
|
||||
host,
|
||||
pathname,
|
||||
search,
|
||||
hash,
|
||||
[protocolRelative]: !protocol
|
||||
};
|
||||
}
|
||||
function parsePath(input = "") {
|
||||
const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
|
||||
return {
|
||||
pathname,
|
||||
search,
|
||||
hash
|
||||
};
|
||||
}
|
||||
function parseAuth(input = "") {
|
||||
const [username, password] = input.split(":");
|
||||
return {
|
||||
username: decode(username),
|
||||
password: decode(password)
|
||||
};
|
||||
}
|
||||
function parseHost(input = "") {
|
||||
const [hostname, port] = (input.match(/([^/:]*):?(\d+)?/) || []).splice(1);
|
||||
return {
|
||||
hostname: decode(hostname),
|
||||
port
|
||||
};
|
||||
}
|
||||
function stringifyParsedURL(parsed) {
|
||||
const pathname = parsed.pathname || "";
|
||||
const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "";
|
||||
const hash = parsed.hash || "";
|
||||
const auth = parsed.auth ? parsed.auth + "@" : "";
|
||||
const host = parsed.host || "";
|
||||
const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : "";
|
||||
return proto + auth + host + pathname + search + hash;
|
||||
}
|
||||
const FILENAME_STRICT_REGEX = /\/([^/]+\.[^/]+)$/;
|
||||
const FILENAME_REGEX = /\/([^/]+)$/;
|
||||
function parseFilename(input = "", opts) {
|
||||
const { pathname } = parseURL(input);
|
||||
const matches = opts?.strict ? pathname.match(FILENAME_STRICT_REGEX) : pathname.match(FILENAME_REGEX);
|
||||
return matches ? matches[1] : void 0;
|
||||
}
|
||||
|
||||
class $URL {
|
||||
protocol;
|
||||
host;
|
||||
auth;
|
||||
pathname;
|
||||
query = {};
|
||||
hash;
|
||||
constructor(input = "") {
|
||||
if (typeof input !== "string") {
|
||||
throw new TypeError(
|
||||
`URL input should be string received ${typeof input} (${input})`
|
||||
);
|
||||
}
|
||||
const parsed = parseURL(input);
|
||||
this.protocol = decode(parsed.protocol);
|
||||
this.host = decode(parsed.host);
|
||||
this.auth = decode(parsed.auth);
|
||||
this.pathname = decodePath(parsed.pathname);
|
||||
this.query = parseQuery(parsed.search);
|
||||
this.hash = decode(parsed.hash);
|
||||
}
|
||||
get hostname() {
|
||||
return parseHost(this.host).hostname;
|
||||
}
|
||||
get port() {
|
||||
return parseHost(this.host).port || "";
|
||||
}
|
||||
get username() {
|
||||
return parseAuth(this.auth).username;
|
||||
}
|
||||
get password() {
|
||||
return parseAuth(this.auth).password || "";
|
||||
}
|
||||
get hasProtocol() {
|
||||
return this.protocol.length;
|
||||
}
|
||||
get isAbsolute() {
|
||||
return this.hasProtocol || this.pathname[0] === "/";
|
||||
}
|
||||
get search() {
|
||||
const q = stringifyQuery(this.query);
|
||||
return q.length > 0 ? "?" + q : "";
|
||||
}
|
||||
get searchParams() {
|
||||
const p = new URLSearchParams();
|
||||
for (const name in this.query) {
|
||||
const value = this.query[name];
|
||||
if (Array.isArray(value)) {
|
||||
for (const v of value) {
|
||||
p.append(name, v);
|
||||
}
|
||||
} else {
|
||||
p.append(
|
||||
name,
|
||||
typeof value === "string" ? value : JSON.stringify(value)
|
||||
);
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
get origin() {
|
||||
return (this.protocol ? this.protocol + "//" : "") + encodeHost(this.host);
|
||||
}
|
||||
get fullpath() {
|
||||
return encodePath(this.pathname) + this.search + encodeHash(this.hash);
|
||||
}
|
||||
get encodedAuth() {
|
||||
if (!this.auth) {
|
||||
return "";
|
||||
}
|
||||
const { username, password } = parseAuth(this.auth);
|
||||
return encodeURIComponent(username) + (password ? ":" + encodeURIComponent(password) : "");
|
||||
}
|
||||
get href() {
|
||||
const auth = this.encodedAuth;
|
||||
const originWithAuth = (this.protocol ? this.protocol + "//" : "") + (auth ? auth + "@" : "") + encodeHost(this.host);
|
||||
return this.hasProtocol && this.isAbsolute ? originWithAuth + this.fullpath : this.fullpath;
|
||||
}
|
||||
append(url) {
|
||||
if (url.hasProtocol) {
|
||||
throw new Error("Cannot append a URL with protocol");
|
||||
}
|
||||
Object.assign(this.query, url.query);
|
||||
if (url.pathname) {
|
||||
this.pathname = withTrailingSlash(this.pathname) + withoutLeadingSlash(url.pathname);
|
||||
}
|
||||
if (url.hash) {
|
||||
this.hash = url.hash;
|
||||
}
|
||||
}
|
||||
toJSON() {
|
||||
return this.href;
|
||||
}
|
||||
toString() {
|
||||
return this.href;
|
||||
}
|
||||
}
|
||||
function createURL(input) {
|
||||
return new $URL(input);
|
||||
}
|
||||
|
||||
export { $URL, cleanDoubleSlashes, createURL, decode, decodePath, decodeQueryKey, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, filterQuery, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isEqual, isNonEmptyURL, isRelative, isSamePath, isScriptProtocol, joinRelativeURL, joinURL, normalizeURL, parseAuth, parseFilename, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withFragment, withHttp, withHttps, withLeadingSlash, withProtocol, withQuery, withTrailingSlash, withoutBase, withoutFragment, withoutHost, withoutLeadingSlash, withoutProtocol, withoutTrailingSlash };
|
||||
48
.output/server/node_modules/ufo/package.json
generated
vendored
Normal file
48
.output/server/node_modules/ufo/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "ufo",
|
||||
"version": "1.6.3",
|
||||
"description": "URL utils for humans",
|
||||
"repository": "unjs/ufo",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "automd && unbuild",
|
||||
"automd": "automd",
|
||||
"dev": "vitest",
|
||||
"lint": "eslint . && prettier -c src test",
|
||||
"lint:fix": "eslint --fix . && prettier -w src test",
|
||||
"prepack": "pnpm build",
|
||||
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
|
||||
"test": "pnpm lint && vitest run --typecheck"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.0.8",
|
||||
"@vitest/coverage-v8": "^4.0.17",
|
||||
"automd": "^0.4.2",
|
||||
"changelogen": "^0.6.2",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-unjs": "^0.6.2",
|
||||
"jiti": "^2.6.1",
|
||||
"prettier": "^3.7.4",
|
||||
"typescript": "^5.9.3",
|
||||
"unbuild": "^3.6.1",
|
||||
"untyped": "^2.0.0",
|
||||
"vitest": "^4.0.17"
|
||||
},
|
||||
"packageManager": "pnpm@10.28.0"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user