Criada a API do site

This commit is contained in:
Caio1w
2025-10-29 19:56:41 -03:00
parent f201c8edbd
commit 4a14f533d2
3074 changed files with 780728 additions and 41 deletions

4
node_modules/vite/dist/node/chunks/build.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import "./logger.js";
import { BuildEnvironment, build, buildEnvironmentOptionsDefaults, builderOptionsDefaults, createBuilder, createToImportMetaURLBasedRelativeRuntime, injectEnvironmentToHooks, onRollupLog, resolveBuildEnvironmentOptions, resolveBuildOutputs, resolveBuildPlugins, resolveBuilderOptions, resolveLibFilename, resolveUserExternal, toOutputFilePathInCss, toOutputFilePathInHtml, toOutputFilePathInJS, toOutputFilePathWithoutRuntime } from "./config.js";
export { createBuilder, resolveBuildPlugins };

5523
node_modules/vite/dist/node/chunks/build2.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

31
node_modules/vite/dist/node/chunks/chunk.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
import { createRequire } from "node:module";
//#region rolldown:runtime
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
var __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
var __require = /* @__PURE__ */ createRequire(import.meta.url);
//#endregion
export { __commonJS, __require, __toDynamicImportESM, __toESM };

36197
node_modules/vite/dist/node/chunks/config.js generated vendored Normal file

File diff suppressed because one or more lines are too long

4
node_modules/vite/dist/node/chunks/config2.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import "./logger.js";
import { configDefaults, defineConfig, getDefaultEnvironmentOptions, isResolvedConfig, loadConfigFromFile, resolveBaseUrl, resolveConfig, resolveDevEnvironmentOptions, sortUserPlugins } from "./config.js";
export { resolveConfig };

6758
node_modules/vite/dist/node/chunks/dist.js generated vendored Normal file

File diff suppressed because one or more lines are too long

377
node_modules/vite/dist/node/chunks/lib.js generated vendored Normal file
View File

@@ -0,0 +1,377 @@
import { __commonJS } from "./chunk.js";
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/parse.js
var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/parse.js": ((exports, module) => {
var openParentheses = "(".charCodeAt(0);
var closeParentheses = ")".charCodeAt(0);
var singleQuote = "'".charCodeAt(0);
var doubleQuote = "\"".charCodeAt(0);
var backslash = "\\".charCodeAt(0);
var slash = "/".charCodeAt(0);
var comma = ",".charCodeAt(0);
var colon = ":".charCodeAt(0);
var star = "*".charCodeAt(0);
var uLower = "u".charCodeAt(0);
var uUpper = "U".charCodeAt(0);
var plus$1 = "+".charCodeAt(0);
var isUnicodeRange = /^[a-f0-9?-]+$/i;
module.exports = function(input) {
var tokens = [];
var value = input;
var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos;
var pos = 0;
var code = value.charCodeAt(pos);
var max = value.length;
var stack = [{ nodes: tokens }];
var balanced = 0;
var parent;
var name = "";
var before = "";
var after = "";
while (pos < max) if (code <= 32) {
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
token = value.slice(pos, next);
prev = tokens[tokens.length - 1];
if (code === closeParentheses && balanced) after = token;
else if (prev && prev.type === "div") {
prev.after = token;
prev.sourceEndIndex += token.length;
} else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) before = token;
else tokens.push({
type: "space",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
pos = next;
} else if (code === singleQuote || code === doubleQuote) {
next = pos;
quote = code === singleQuote ? "'" : "\"";
token = {
type: "string",
sourceIndex: pos,
quote
};
do {
escape = false;
next = value.indexOf(quote, next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += quote;
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
token.value = value.slice(pos + 1, next);
token.sourceEndIndex = token.unclosed ? next : next + 1;
tokens.push(token);
pos = next + 1;
code = value.charCodeAt(pos);
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
next = value.indexOf("*/", pos);
token = {
type: "comment",
sourceIndex: pos,
sourceEndIndex: next + 2
};
if (next === -1) {
token.unclosed = true;
next = value.length;
token.sourceEndIndex = next;
}
token.value = value.slice(pos + 2, next);
tokens.push(token);
pos = next + 2;
code = value.charCodeAt(pos);
} else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") {
token = value[pos];
tokens.push({
type: "word",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token
});
pos += 1;
code = value.charCodeAt(pos);
} else if (code === slash || code === comma || code === colon) {
token = value[pos];
tokens.push({
type: "div",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token,
before,
after: ""
});
before = "";
pos += 1;
code = value.charCodeAt(pos);
} else if (openParentheses === code) {
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
parenthesesOpenPos = pos;
token = {
type: "function",
sourceIndex: pos - name.length,
value: name,
before: value.slice(parenthesesOpenPos + 1, next)
};
pos = next;
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
next -= 1;
do {
escape = false;
next = value.indexOf(")", next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += ")";
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
whitespacePos = next;
do {
whitespacePos -= 1;
code = value.charCodeAt(whitespacePos);
} while (code <= 32);
if (parenthesesOpenPos < whitespacePos) {
if (pos !== whitespacePos + 1) token.nodes = [{
type: "word",
sourceIndex: pos,
sourceEndIndex: whitespacePos + 1,
value: value.slice(pos, whitespacePos + 1)
}];
else token.nodes = [];
if (token.unclosed && whitespacePos + 1 !== next) {
token.after = "";
token.nodes.push({
type: "space",
sourceIndex: whitespacePos + 1,
sourceEndIndex: next,
value: value.slice(whitespacePos + 1, next)
});
} else {
token.after = value.slice(whitespacePos + 1, next);
token.sourceEndIndex = next;
}
} else {
token.after = "";
token.nodes = [];
}
pos = next + 1;
token.sourceEndIndex = token.unclosed ? next : pos;
code = value.charCodeAt(pos);
tokens.push(token);
} else {
balanced += 1;
token.after = "";
token.sourceEndIndex = pos + 1;
tokens.push(token);
stack.push(token);
tokens = token.nodes = [];
parent = token;
}
name = "";
} else if (closeParentheses === code && balanced) {
pos += 1;
code = value.charCodeAt(pos);
parent.after = after;
parent.sourceEndIndex += after.length;
after = "";
balanced -= 1;
stack[stack.length - 1].sourceEndIndex = pos;
stack.pop();
parent = stack[balanced];
tokens = parent.nodes;
} else {
next = pos;
do {
if (code === backslash) next += 1;
next += 1;
code = value.charCodeAt(next);
} while (next < max && !(code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || code === star && parent && parent.type === "function" && parent.value === "calc" || code === slash && parent.type === "function" && parent.value === "calc" || code === closeParentheses && balanced));
token = value.slice(pos, next);
if (openParentheses === code) name = token;
else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus$1 === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) tokens.push({
type: "unicode-range",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
else tokens.push({
type: "word",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
pos = next;
}
for (pos = stack.length - 1; pos; pos -= 1) {
stack[pos].unclosed = true;
stack[pos].sourceEndIndex = value.length;
}
return stack[0].nodes;
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/walk.js
var require_walk = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/walk.js": ((exports, module) => {
module.exports = function walk$1(nodes, cb, bubble) {
var i, max, node, result;
for (i = 0, max = nodes.length; i < max; i += 1) {
node = nodes[i];
if (!bubble) result = cb(node, i, nodes);
if (result !== false && node.type === "function" && Array.isArray(node.nodes)) walk$1(node.nodes, cb, bubble);
if (bubble) cb(node, i, nodes);
}
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/stringify.js
var require_stringify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/stringify.js": ((exports, module) => {
function stringifyNode(node, custom) {
var type = node.type;
var value = node.value;
var buf;
var customResult;
if (custom && (customResult = custom(node)) !== void 0) return customResult;
else if (type === "word" || type === "space") return value;
else if (type === "string") {
buf = node.quote || "";
return buf + value + (node.unclosed ? "" : buf);
} else if (type === "comment") return "/*" + value + (node.unclosed ? "" : "*/");
else if (type === "div") return (node.before || "") + value + (node.after || "");
else if (Array.isArray(node.nodes)) {
buf = stringify$1(node.nodes, custom);
if (type !== "function") return buf;
return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")");
}
return value;
}
function stringify$1(nodes, custom) {
var result, i;
if (Array.isArray(nodes)) {
result = "";
for (i = nodes.length - 1; ~i; i -= 1) result = stringifyNode(nodes[i], custom) + result;
return result;
}
return stringifyNode(nodes, custom);
}
module.exports = stringify$1;
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/unit.js
var require_unit = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/unit.js": ((exports, module) => {
var minus = "-".charCodeAt(0);
var plus = "+".charCodeAt(0);
var dot = ".".charCodeAt(0);
var exp = "e".charCodeAt(0);
var EXP = "E".charCodeAt(0);
function likeNumber(value) {
var code = value.charCodeAt(0);
var nextCode;
if (code === plus || code === minus) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) return true;
var nextNextCode = value.charCodeAt(2);
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) return true;
return false;
}
if (code === dot) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) return true;
return false;
}
if (code >= 48 && code <= 57) return true;
return false;
}
module.exports = function(value) {
var pos = 0;
var length = value.length;
var code;
var nextCode;
var nextNextCode;
if (length === 0 || !likeNumber(value)) return false;
code = value.charCodeAt(pos);
if (code === plus || code === minus) pos++;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) break;
pos += 1;
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
if (code === dot && nextCode >= 48 && nextCode <= 57) {
pos += 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) break;
pos += 1;
}
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
nextNextCode = value.charCodeAt(pos + 2);
if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) {
pos += nextCode === plus || nextCode === minus ? 3 : 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) break;
pos += 1;
}
}
return {
number: value.slice(0, pos),
unit: value.slice(pos)
};
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/index.js
var require_lib = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/index.js": ((exports, module) => {
var parse = require_parse();
var walk = require_walk();
var stringify = require_stringify();
function ValueParser(value) {
if (this instanceof ValueParser) {
this.nodes = parse(value);
return this;
}
return new ValueParser(value);
}
ValueParser.prototype.toString = function() {
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
};
ValueParser.prototype.walk = function(cb, bubble) {
walk(this.nodes, cb, bubble);
return this;
};
ValueParser.unit = require_unit();
ValueParser.walk = walk;
ValueParser.stringify = stringify;
module.exports = ValueParser;
}) });
//#endregion
export { require_lib };

320
node_modules/vite/dist/node/chunks/logger.js generated vendored Normal file
View File

@@ -0,0 +1,320 @@
import { __commonJS, __toESM } from "./chunk.js";
import { readFileSync } from "node:fs";
import path, { resolve } from "node:path";
import { fileURLToPath } from "node:url";
import readline from "node:readline";
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
var require_picocolors = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": ((exports, module) => {
let p = process || {}, argv = p.argv || [], env = p.env || {};
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
let formatter = (open, close, replace = open) => (input) => {
let string = "" + input, index = string.indexOf(close, open.length);
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
};
let replaceClose = (string, close, replace, index) => {
let result = "", cursor = 0;
do {
result += string.substring(cursor, index) + replace;
cursor = index + close.length;
index = string.indexOf(close, cursor);
} while (~index);
return result + string.substring(cursor);
};
let createColors = (enabled = isColorSupported) => {
let f = enabled ? formatter : () => String;
return {
isColorSupported: enabled,
reset: f("\x1B[0m", "\x1B[0m"),
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
italic: f("\x1B[3m", "\x1B[23m"),
underline: f("\x1B[4m", "\x1B[24m"),
inverse: f("\x1B[7m", "\x1B[27m"),
hidden: f("\x1B[8m", "\x1B[28m"),
strikethrough: f("\x1B[9m", "\x1B[29m"),
black: f("\x1B[30m", "\x1B[39m"),
red: f("\x1B[31m", "\x1B[39m"),
green: f("\x1B[32m", "\x1B[39m"),
yellow: f("\x1B[33m", "\x1B[39m"),
blue: f("\x1B[34m", "\x1B[39m"),
magenta: f("\x1B[35m", "\x1B[39m"),
cyan: f("\x1B[36m", "\x1B[39m"),
white: f("\x1B[37m", "\x1B[39m"),
gray: f("\x1B[90m", "\x1B[39m"),
bgBlack: f("\x1B[40m", "\x1B[49m"),
bgRed: f("\x1B[41m", "\x1B[49m"),
bgGreen: f("\x1B[42m", "\x1B[49m"),
bgYellow: f("\x1B[43m", "\x1B[49m"),
bgBlue: f("\x1B[44m", "\x1B[49m"),
bgMagenta: f("\x1B[45m", "\x1B[49m"),
bgCyan: f("\x1B[46m", "\x1B[49m"),
bgWhite: f("\x1B[47m", "\x1B[49m"),
blackBright: f("\x1B[90m", "\x1B[39m"),
redBright: f("\x1B[91m", "\x1B[39m"),
greenBright: f("\x1B[92m", "\x1B[39m"),
yellowBright: f("\x1B[93m", "\x1B[39m"),
blueBright: f("\x1B[94m", "\x1B[39m"),
magentaBright: f("\x1B[95m", "\x1B[39m"),
cyanBright: f("\x1B[96m", "\x1B[39m"),
whiteBright: f("\x1B[97m", "\x1B[39m"),
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
bgRedBright: f("\x1B[101m", "\x1B[49m"),
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
};
};
module.exports = createColors();
module.exports.createColors = createColors;
}) });
//#endregion
//#region src/node/constants.ts
const { version } = JSON.parse(readFileSync(new URL("../../package.json", new URL("../../../src/node/constants.ts", import.meta.url))).toString());
const ROLLUP_HOOKS = [
"options",
"buildStart",
"buildEnd",
"renderStart",
"renderError",
"renderChunk",
"writeBundle",
"generateBundle",
"banner",
"footer",
"augmentChunkHash",
"outputOptions",
"renderDynamicImport",
"resolveFileUrl",
"resolveImportMeta",
"intro",
"outro",
"closeBundle",
"closeWatcher",
"load",
"moduleParsed",
"watchChange",
"resolveDynamicImport",
"resolveId",
"shouldTransformCachedModule",
"transform",
"onLog"
];
const VERSION = version;
const DEFAULT_MAIN_FIELDS = [
"browser",
"module",
"jsnext:main",
"jsnext"
];
const DEFAULT_CLIENT_MAIN_FIELDS = Object.freeze(DEFAULT_MAIN_FIELDS);
const DEFAULT_SERVER_MAIN_FIELDS = Object.freeze(DEFAULT_MAIN_FIELDS.filter((f) => f !== "browser"));
/**
* A special condition that would be replaced with production or development
* depending on NODE_ENV env variable
*/
const DEV_PROD_CONDITION = `development|production`;
const DEFAULT_CONDITIONS = [
"module",
"browser",
"node",
DEV_PROD_CONDITION
];
const DEFAULT_CLIENT_CONDITIONS = Object.freeze(DEFAULT_CONDITIONS.filter((c) => c !== "node"));
const DEFAULT_SERVER_CONDITIONS = Object.freeze(DEFAULT_CONDITIONS.filter((c) => c !== "browser"));
const DEFAULT_EXTERNAL_CONDITIONS = Object.freeze(["node", "module-sync"]);
/**
* The browser versions that are included in the Baseline Widely Available on 2025-05-01.
*
* This value would be bumped on each major release of Vite.
*
* The value is generated by `pnpm generate-target` script.
*/
const ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET = [
"chrome107",
"edge107",
"firefox104",
"safari16"
];
const DEFAULT_CONFIG_FILES = [
"vite.config.js",
"vite.config.mjs",
"vite.config.ts",
"vite.config.cjs",
"vite.config.mts",
"vite.config.cts"
];
const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
const OPTIMIZABLE_ENTRY_RE = /\.[cm]?[jt]s$/;
const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/;
/**
* Prefix for resolved fs paths, since windows paths may not be valid as URLs.
*/
const FS_PREFIX = `/@fs/`;
const CLIENT_PUBLIC_PATH = `/@vite/client`;
const ENV_PUBLIC_PATH = `/@vite/env`;
const VITE_PACKAGE_DIR = resolve(fileURLToPath(new URL("../../../src/node/constants.ts", import.meta.url)), "../../..");
const CLIENT_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/client.mjs");
const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/env.mjs");
const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
const KNOWN_ASSET_TYPES = [
"apng",
"bmp",
"png",
"jpe?g",
"jfif",
"pjpeg",
"pjp",
"gif",
"svg",
"ico",
"webp",
"avif",
"cur",
"jxl",
"mp4",
"webm",
"ogg",
"mp3",
"wav",
"flac",
"aac",
"opus",
"mov",
"m4a",
"vtt",
"woff2?",
"eot",
"ttf",
"otf",
"webmanifest",
"pdf",
"txt"
];
const DEFAULT_ASSETS_RE = new RegExp(`\\.(` + KNOWN_ASSET_TYPES.join("|") + `)(\\?.*)?$`, "i");
const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/;
const loopbackHosts = new Set([
"localhost",
"127.0.0.1",
"::1",
"0000:0000:0000:0000:0000:0000:0000:0001"
]);
const wildcardHosts = new Set([
"0.0.0.0",
"::",
"0000:0000:0000:0000:0000:0000:0000:0000"
]);
const DEFAULT_DEV_PORT = 5173;
const DEFAULT_PREVIEW_PORT = 4173;
const DEFAULT_ASSETS_INLINE_LIMIT = 4096;
const defaultAllowedOrigins = /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/;
const METADATA_FILENAME = "_metadata.json";
const ERR_OPTIMIZE_DEPS_PROCESSING_ERROR = "ERR_OPTIMIZE_DEPS_PROCESSING_ERROR";
const ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR = "ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR";
//#endregion
//#region src/node/logger.ts
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
const LogLevels = {
silent: 0,
error: 1,
warn: 2,
info: 3
};
let lastType;
let lastMsg;
let sameCount = 0;
function clearScreen() {
const repeatCount = process.stdout.rows - 2;
const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : "";
console.log(blank);
readline.cursorTo(process.stdout, 0, 0);
readline.clearScreenDown(process.stdout);
}
let timeFormatter;
function getTimeFormatter() {
timeFormatter ??= new Intl.DateTimeFormat(void 0, {
hour: "numeric",
minute: "numeric",
second: "numeric"
});
return timeFormatter;
}
function createLogger(level = "info", options = {}) {
if (options.customLogger) return options.customLogger;
const loggedErrors = /* @__PURE__ */ new WeakSet();
const { prefix = "[vite]", allowClearScreen = true, console: console$1 = globalThis.console } = options;
const thresh = LogLevels[level];
const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI;
const clear = canClearScreen ? clearScreen : () => {};
function format(type, msg, options$1 = {}) {
if (options$1.timestamp) {
let tag = "";
if (type === "info") tag = import_picocolors.default.cyan(import_picocolors.default.bold(prefix));
else if (type === "warn") tag = import_picocolors.default.yellow(import_picocolors.default.bold(prefix));
else tag = import_picocolors.default.red(import_picocolors.default.bold(prefix));
const environment = options$1.environment ? options$1.environment + " " : "";
return `${import_picocolors.default.dim(getTimeFormatter().format(/* @__PURE__ */ new Date()))} ${tag} ${environment}${msg}`;
} else return msg;
}
function output(type, msg, options$1 = {}) {
if (thresh >= LogLevels[type]) {
const method = type === "info" ? "log" : type;
if (options$1.error) loggedErrors.add(options$1.error);
if (canClearScreen) if (type === lastType && msg === lastMsg) {
sameCount++;
clear();
console$1[method](format(type, msg, options$1), import_picocolors.default.yellow(`(x${sameCount + 1})`));
} else {
sameCount = 0;
lastMsg = msg;
lastType = type;
if (options$1.clear) clear();
console$1[method](format(type, msg, options$1));
}
else console$1[method](format(type, msg, options$1));
}
}
const warnedMessages = /* @__PURE__ */ new Set();
const logger = {
hasWarned: false,
info(msg, opts) {
output("info", msg, opts);
},
warn(msg, opts) {
logger.hasWarned = true;
output("warn", msg, opts);
},
warnOnce(msg, opts) {
if (warnedMessages.has(msg)) return;
logger.hasWarned = true;
output("warn", msg, opts);
warnedMessages.add(msg);
},
error(msg, opts) {
logger.hasWarned = true;
output("error", msg, opts);
},
clearScreen(type) {
if (thresh >= LogLevels[type]) clear();
},
hasErrorLogged(error) {
return loggedErrors.has(error);
}
};
return logger;
}
function printServerUrls(urls, optionsHost, info) {
const colorUrl = (url) => import_picocolors.default.cyan(url.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
for (const url of urls.local) info(` ${import_picocolors.default.green("➜")} ${import_picocolors.default.bold("Local")}: ${colorUrl(url)}`);
for (const url of urls.network) info(` ${import_picocolors.default.green("➜")} ${import_picocolors.default.bold("Network")}: ${colorUrl(url)}`);
if (urls.network.length === 0 && optionsHost === void 0) info(import_picocolors.default.dim(` ${import_picocolors.default.green("➜")} ${import_picocolors.default.bold("Network")}: use `) + import_picocolors.default.bold("--host") + import_picocolors.default.dim(" to expose"));
}
//#endregion
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_EXTERNAL_CONDITIONS, DEFAULT_PREVIEW_PORT, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, DEP_VERSION_RE, DEV_PROD_CONDITION, ENV_ENTRY, ENV_PUBLIC_PATH, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, LogLevels, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, ROLLUP_HOOKS, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, createLogger, defaultAllowedOrigins, loopbackHosts, printServerUrls, require_picocolors, wildcardHosts };

View File

@@ -0,0 +1,88 @@
import { HotPayload } from "#types/hmrPayload";
//#region src/shared/invokeMethods.d.ts
interface FetchFunctionOptions {
cached?: boolean;
startOffset?: number;
}
type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
interface CachedFetchResult {
/**
* If module cached in the runner, we can just confirm
* it wasn't invalidated on the server side.
*/
cache: true;
}
interface ExternalFetchResult {
/**
* The path to the externalized module starting with file://,
* by default this will be imported via a dynamic "import"
* instead of being transformed by vite and loaded with vite runner
*/
externalize: string;
/**
* Type of the module. Will be used to determine if import statement is correct.
* For example, if Vite needs to throw an error if variable is not actually exported
*/
type: 'module' | 'commonjs' | 'builtin' | 'network';
}
interface ViteFetchResult {
/**
* Code that will be evaluated by vite runner
* by default this will be wrapped in an async function
*/
code: string;
/**
* File path of the module on disk.
* This will be resolved as import.meta.url/filename
* Will be equal to `null` for virtual modules
*/
file: string | null;
/**
* Module ID in the server module graph.
*/
id: string;
/**
* Module URL used in the import.
*/
url: string;
/**
* Invalidate module on the client side.
*/
invalidate: boolean;
}
type InvokeMethods = {
fetchModule: (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
};
//#endregion
//#region src/shared/moduleRunnerTransport.d.ts
type ModuleRunnerTransportHandlers = {
onMessage: (data: HotPayload) => void;
onDisconnection: () => void;
};
/**
* "send and connect" or "invoke" must be implemented
*/
interface ModuleRunnerTransport {
connect?(handlers: ModuleRunnerTransportHandlers): Promise<void> | void;
disconnect?(): Promise<void> | void;
send?(data: HotPayload): Promise<void> | void;
invoke?(data: HotPayload): Promise<{
result: any;
} | {
error: any;
}>;
timeout?: number;
}
interface NormalizedModuleRunnerTransport {
connect?(onMessage?: (data: HotPayload) => void): Promise<void> | void;
disconnect?(): Promise<void> | void;
send(data: HotPayload): Promise<void>;
invoke<T extends keyof InvokeMethods>(name: T, data: Parameters<InvokeMethods[T]>): Promise<ReturnType<Awaited<InvokeMethods[T]>>>;
}
declare const createWebSocketModuleRunnerTransport: (options: {
createConnection: () => WebSocket;
pingInterval?: number;
}) => Required<Pick<ModuleRunnerTransport, "connect" | "disconnect" | "send">>;
//#endregion
export { ExternalFetchResult, FetchFunctionOptions, FetchResult, ModuleRunnerTransport, ModuleRunnerTransportHandlers, NormalizedModuleRunnerTransport, ViteFetchResult, createWebSocketModuleRunnerTransport };

4
node_modules/vite/dist/node/chunks/optimizer.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import "./logger.js";
import { addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, cleanupDepsCacheStaleDirs, createIsOptimizedDepFile, createIsOptimizedDepUrl, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, isDepOptimizationDisabled, loadCachedDepOptimizationMetadata, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, runOptimizeDeps, toDiscoveredDependencies } from "./config.js";
export { optimizeDeps };

479
node_modules/vite/dist/node/chunks/postcss-import.js generated vendored Normal file
View File

@@ -0,0 +1,479 @@
import { __commonJS, __require } from "./chunk.js";
import { require_lib } from "./lib.js";
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/format-import-prelude.js
var require_format_import_prelude = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/format-import-prelude.js": ((exports, module) => {
module.exports = function formatImportPrelude$2(layer, media, supports) {
const parts = [];
if (typeof layer !== "undefined") {
let layerParams = "layer";
if (layer) layerParams = `layer(${layer})`;
parts.push(layerParams);
}
if (typeof supports !== "undefined") parts.push(`supports(${supports})`);
if (typeof media !== "undefined") parts.push(media);
return parts.join(" ");
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/base64-encoded-import.js
var require_base64_encoded_import = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/base64-encoded-import.js": ((exports, module) => {
const formatImportPrelude$1 = require_format_import_prelude();
module.exports = function base64EncodedConditionalImport$1(prelude, conditions) {
if (!conditions?.length) return prelude;
conditions.reverse();
const first = conditions.pop();
let params = `${prelude} ${formatImportPrelude$1(first.layer, first.media, first.supports)}`;
for (const condition of conditions) params = `'data:text/css;base64,${Buffer.from(`@import ${params}`).toString("base64")}' ${formatImportPrelude$1(condition.layer, condition.media, condition.supports)}`;
return params;
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-conditions.js
var require_apply_conditions = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-conditions.js": ((exports, module) => {
const base64EncodedConditionalImport = require_base64_encoded_import();
module.exports = function applyConditions$1(bundle, atRule) {
const firstImportStatementIndex = bundle.findIndex((stmt) => stmt.type === "import");
const lastImportStatementIndex = bundle.findLastIndex((stmt) => stmt.type === "import");
bundle.forEach((stmt, index) => {
if (stmt.type === "charset" || stmt.type === "warning") return;
if (stmt.type === "layer" && (index < lastImportStatementIndex && stmt.conditions?.length || index > firstImportStatementIndex && index < lastImportStatementIndex)) {
stmt.type = "import";
stmt.node = stmt.node.clone({
name: "import",
params: base64EncodedConditionalImport(`'data:text/css;base64,${Buffer.from(stmt.node.toString()).toString("base64")}'`, stmt.conditions)
});
return;
}
if (!stmt.conditions?.length) return;
if (stmt.type === "import") {
stmt.node.params = base64EncodedConditionalImport(stmt.fullUri, stmt.conditions);
return;
}
let nodes;
let parent;
if (stmt.type === "layer") {
nodes = [stmt.node];
parent = stmt.node.parent;
} else {
nodes = stmt.nodes;
parent = nodes[0].parent;
}
const atRules = [];
for (const condition of stmt.conditions) {
if (typeof condition.media !== "undefined") {
const mediaNode = atRule({
name: "media",
params: condition.media,
source: parent.source
});
atRules.push(mediaNode);
}
if (typeof condition.supports !== "undefined") {
const supportsNode = atRule({
name: "supports",
params: `(${condition.supports})`,
source: parent.source
});
atRules.push(supportsNode);
}
if (typeof condition.layer !== "undefined") {
const layerNode = atRule({
name: "layer",
params: condition.layer,
source: parent.source
});
atRules.push(layerNode);
}
}
const outerAtRule = atRules.shift();
const innerAtRule = atRules.reduce((previous, next) => {
previous.append(next);
return next;
}, outerAtRule);
parent.insertBefore(nodes[0], outerAtRule);
nodes.forEach((node) => {
node.parent = void 0;
});
nodes[0].raws.before = nodes[0].raws.before || "\n";
innerAtRule.append(nodes);
stmt.type = "nodes";
stmt.nodes = [outerAtRule];
delete stmt.node;
});
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-raws.js
var require_apply_raws = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-raws.js": ((exports, module) => {
module.exports = function applyRaws$1(bundle) {
bundle.forEach((stmt, index) => {
if (index === 0) return;
if (stmt.parent) {
const { before } = stmt.parent.node.raws;
if (stmt.type === "nodes") stmt.nodes[0].raws.before = before;
else stmt.node.raws.before = before;
} else if (stmt.type === "nodes") stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n";
});
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-styles.js
var require_apply_styles = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/apply-styles.js": ((exports, module) => {
module.exports = function applyStyles$1(bundle, styles) {
styles.nodes = [];
bundle.forEach((stmt) => {
if ([
"charset",
"import",
"layer"
].includes(stmt.type)) {
stmt.node.parent = void 0;
styles.append(stmt.node);
} else if (stmt.type === "nodes") stmt.nodes.forEach((node) => {
node.parent = void 0;
styles.append(node);
});
});
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/data-url.js
var require_data_url = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/data-url.js": ((exports, module) => {
const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
const base64DataURLRegexp = /^data:text\/css;base64,/i;
const plainDataURLRegexp = /^data:text\/css;plain,/i;
function isValid(url) {
return anyDataURLRegexp.test(url);
}
function contents(url) {
if (base64DataURLRegexp.test(url)) return Buffer.from(url.slice(21), "base64").toString();
if (plainDataURLRegexp.test(url)) return decodeURIComponent(url.slice(20));
return decodeURIComponent(url.slice(14));
}
module.exports = {
isValid,
contents
};
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-statements.js
var require_parse_statements = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-statements.js": ((exports, module) => {
const valueParser = require_lib();
const { stringify } = valueParser;
module.exports = function parseStatements$1(result, styles, conditions, from) {
const statements = [];
let nodes = [];
let encounteredNonImportNodes = false;
styles.each((node) => {
let stmt;
if (node.type === "atrule") {
if (node.name === "import") stmt = parseImport(result, node, conditions, from);
else if (node.name === "charset") stmt = parseCharset(result, node, conditions, from);
else if (node.name === "layer" && !encounteredNonImportNodes && !node.nodes) stmt = parseLayer(result, node, conditions, from);
} else if (node.type !== "comment") encounteredNonImportNodes = true;
if (stmt) {
if (nodes.length) {
statements.push({
type: "nodes",
nodes,
conditions: [...conditions],
from
});
nodes = [];
}
statements.push(stmt);
} else nodes.push(node);
});
if (nodes.length) statements.push({
type: "nodes",
nodes,
conditions: [...conditions],
from
});
return statements;
};
function parseCharset(result, atRule, conditions, from) {
if (atRule.prev()) return result.warn("@charset must precede all other statements", { node: atRule });
return {
type: "charset",
node: atRule,
conditions: [...conditions],
from
};
}
function parseImport(result, atRule, conditions, from) {
let prev = atRule.prev();
if (prev) do {
if (prev.type === "comment" || prev.type === "atrule" && prev.name === "import") {
prev = prev.prev();
continue;
}
break;
} while (prev);
if (prev) do {
if (prev.type === "comment" || prev.type === "atrule" && (prev.name === "charset" || prev.name === "layer" && !prev.nodes)) {
prev = prev.prev();
continue;
}
return result.warn("@import must precede all other statements (besides @charset or empty @layer)", { node: atRule });
} while (prev);
if (atRule.nodes) return result.warn("It looks like you didn't end your @import statement correctly. Child nodes are attached to it.", { node: atRule });
const params = valueParser(atRule.params).nodes;
const stmt = {
type: "import",
uri: "",
fullUri: "",
node: atRule,
conditions: [...conditions],
from
};
let layer;
let media;
let supports;
for (let i = 0; i < params.length; i++) {
const node = params[i];
if (node.type === "space" || node.type === "comment") continue;
if (node.type === "string") {
if (stmt.uri) return result.warn(`Multiple url's in '${atRule.toString()}'`, { node: atRule });
if (!node.value) return result.warn(`Unable to find uri in '${atRule.toString()}'`, { node: atRule });
stmt.uri = node.value;
stmt.fullUri = stringify(node);
continue;
}
if (node.type === "function" && /^url$/i.test(node.value)) {
if (stmt.uri) return result.warn(`Multiple url's in '${atRule.toString()}'`, { node: atRule });
if (!node.nodes?.[0]?.value) return result.warn(`Unable to find uri in '${atRule.toString()}'`, { node: atRule });
stmt.uri = node.nodes[0].value;
stmt.fullUri = stringify(node);
continue;
}
if (!stmt.uri) return result.warn(`Unable to find uri in '${atRule.toString()}'`, { node: atRule });
if ((node.type === "word" || node.type === "function") && /^layer$/i.test(node.value)) {
if (typeof layer !== "undefined") return result.warn(`Multiple layers in '${atRule.toString()}'`, { node: atRule });
if (typeof supports !== "undefined") return result.warn(`layers must be defined before support conditions in '${atRule.toString()}'`, { node: atRule });
if (node.nodes) layer = stringify(node.nodes);
else layer = "";
continue;
}
if (node.type === "function" && /^supports$/i.test(node.value)) {
if (typeof supports !== "undefined") return result.warn(`Multiple support conditions in '${atRule.toString()}'`, { node: atRule });
supports = stringify(node.nodes);
continue;
}
media = stringify(params.slice(i));
break;
}
if (!stmt.uri) return result.warn(`Unable to find uri in '${atRule.toString()}'`, { node: atRule });
if (typeof media !== "undefined" || typeof layer !== "undefined" || typeof supports !== "undefined") stmt.conditions.push({
layer,
media,
supports
});
return stmt;
}
function parseLayer(result, atRule, conditions, from) {
return {
type: "layer",
node: atRule,
conditions: [...conditions],
from
};
}
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/process-content.js
var require_process_content = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/process-content.js": ((exports, module) => {
const path$2 = __require("path");
let sugarss;
module.exports = function processContent$1(result, content, filename, options, postcss) {
const { plugins } = options;
const ext = path$2.extname(filename);
const parserList = [];
if (ext === ".sss") {
if (!sugarss)
/* c8 ignore next 3 */
try {
sugarss = __require("sugarss");
} catch {}
if (sugarss) return runPostcss(postcss, content, filename, plugins, [sugarss]);
}
if (result.opts.syntax?.parse) parserList.push(result.opts.syntax.parse);
if (result.opts.parser) parserList.push(result.opts.parser);
parserList.push(null);
return runPostcss(postcss, content, filename, plugins, parserList);
};
function runPostcss(postcss, content, filename, plugins, parsers, index) {
if (!index) index = 0;
return postcss(plugins).process(content, {
from: filename,
parser: parsers[index]
}).catch((err) => {
index++;
if (index === parsers.length) throw err;
return runPostcss(postcss, content, filename, plugins, parsers, index);
});
}
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-styles.js
var require_parse_styles = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/parse-styles.js": ((exports, module) => {
const path$1 = __require("path");
const dataURL = require_data_url();
const parseStatements = require_parse_statements();
const processContent = require_process_content();
const resolveId$1 = (id) => id;
const formatImportPrelude = require_format_import_prelude();
async function parseStyles$1(result, styles, options, state, conditions, from, postcss) {
const statements = parseStatements(result, styles, conditions, from);
for (const stmt of statements) {
if (stmt.type !== "import" || !isProcessableURL(stmt.uri)) continue;
if (options.filter && !options.filter(stmt.uri)) continue;
await resolveImportId(result, stmt, options, state, postcss);
}
let charset;
const beforeBundle = [];
const bundle = [];
function handleCharset(stmt) {
if (!charset) charset = stmt;
else if (stmt.node.params.toLowerCase() !== charset.node.params.toLowerCase()) throw stmt.node.error(`Incompatible @charset statements:
${stmt.node.params} specified in ${stmt.node.source.input.file}
${charset.node.params} specified in ${charset.node.source.input.file}`);
}
statements.forEach((stmt) => {
if (stmt.type === "charset") handleCharset(stmt);
else if (stmt.type === "import") if (stmt.children) stmt.children.forEach((child, index) => {
if (child.type === "import") beforeBundle.push(child);
else if (child.type === "layer") beforeBundle.push(child);
else if (child.type === "charset") handleCharset(child);
else bundle.push(child);
if (index === 0) child.parent = stmt;
});
else beforeBundle.push(stmt);
else if (stmt.type === "layer") beforeBundle.push(stmt);
else if (stmt.type === "nodes") bundle.push(stmt);
});
return charset ? [charset, ...beforeBundle.concat(bundle)] : beforeBundle.concat(bundle);
}
async function resolveImportId(result, stmt, options, state, postcss) {
if (dataURL.isValid(stmt.uri)) {
stmt.children = await loadImportContent(result, stmt, stmt.uri, options, state, postcss);
return;
} else if (dataURL.isValid(stmt.from.slice(-1))) throw stmt.node.error(`Unable to import '${stmt.uri}' from a stylesheet that is embedded in a data url`);
const atRule = stmt.node;
let sourceFile;
if (atRule.source?.input?.file) sourceFile = atRule.source.input.file;
const base = sourceFile ? path$1.dirname(atRule.source.input.file) : options.root;
const paths = [await options.resolve(stmt.uri, base, options, atRule)].flat();
const resolved = await Promise.all(paths.map((file) => {
return !path$1.isAbsolute(file) ? resolveId$1(file, base, options, atRule) : file;
}));
resolved.forEach((file) => {
result.messages.push({
type: "dependency",
plugin: "postcss-import",
file,
parent: sourceFile
});
});
stmt.children = (await Promise.all(resolved.map((file) => {
return loadImportContent(result, stmt, file, options, state, postcss);
}))).flat().filter((x) => !!x);
}
async function loadImportContent(result, stmt, filename, options, state, postcss) {
const atRule = stmt.node;
const { conditions, from } = stmt;
const stmtDuplicateCheckKey = conditions.map((condition) => formatImportPrelude(condition.layer, condition.media, condition.supports)).join(":");
if (options.skipDuplicates) {
if (state.importedFiles[filename]?.[stmtDuplicateCheckKey]) return;
if (!state.importedFiles[filename]) state.importedFiles[filename] = {};
state.importedFiles[filename][stmtDuplicateCheckKey] = true;
}
if (from.includes(filename)) return;
const content = await options.load(filename, options);
if (content.trim() === "" && options.warnOnEmpty) {
result.warn(`${filename} is empty`, { node: atRule });
return;
}
if (options.skipDuplicates && state.hashFiles[content]?.[stmtDuplicateCheckKey]) return;
const importedResult = await processContent(result, content, filename, options, postcss);
const styles = importedResult.root;
result.messages = result.messages.concat(importedResult.messages);
if (options.skipDuplicates) {
if (!styles.some((child) => {
return child.type === "atrule" && child.name === "import";
})) {
if (!state.hashFiles[content]) state.hashFiles[content] = {};
state.hashFiles[content][stmtDuplicateCheckKey] = true;
}
}
return parseStyles$1(result, styles, options, state, conditions, [...from, filename], postcss);
}
function isProcessableURL(uri) {
if (/^(?:[a-z]+:)?\/\//i.test(uri)) return false;
try {
if (new URL(uri, "https://example.com").search) return false;
} catch {}
return true;
}
module.exports = parseStyles$1;
}) });
//#endregion
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/index.js
var require_postcss_import = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/index.js": ((exports, module) => {
const path = __require("path");
const applyConditions = require_apply_conditions();
const applyRaws = require_apply_raws();
const applyStyles = require_apply_styles();
const loadContent = () => "";
const parseStyles = require_parse_styles();
const resolveId = (id) => id;
function AtImport(options) {
options = {
root: process.cwd(),
path: [],
skipDuplicates: true,
resolve: resolveId,
load: loadContent,
plugins: [],
addModulesDirectories: [],
warnOnEmpty: true,
...options
};
options.root = path.resolve(options.root);
if (typeof options.path === "string") options.path = [options.path];
if (!Array.isArray(options.path)) options.path = [];
options.path = options.path.map((p) => path.resolve(options.root, p));
return {
postcssPlugin: "postcss-import",
async Once(styles, { result, atRule, postcss }) {
const state = {
importedFiles: {},
hashFiles: {}
};
if (styles.source?.input?.file) state.importedFiles[styles.source.input.file] = {};
if (options.plugins && !Array.isArray(options.plugins)) throw new Error("plugins option must be an array");
const bundle = await parseStyles(result, styles, options, state, [], [], postcss);
applyRaws(bundle);
applyConditions(bundle, atRule);
applyStyles(bundle, styles);
}
};
}
AtImport.postcss = true;
module.exports = AtImport;
}) });
//#endregion
export default require_postcss_import();
export { };

4
node_modules/vite/dist/node/chunks/preview.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import "./logger.js";
import { preview, resolvePreviewOptions } from "./config.js";
export { preview };

4
node_modules/vite/dist/node/chunks/server.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import "./logger.js";
import { _createServer, createServer, createServerCloseFn, resolveServerOptions, restartServerWithUrls, serverConfigDefaults } from "./config.js";
export { createServer };