main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

28
node_modules/next/dist/server/web/sandbox/context.d.ts generated vendored Normal file
View File

@@ -0,0 +1,28 @@
import { EdgeRuntime } from 'next/dist/compiled/edge-runtime';
import type { EdgeFunctionDefinition } from '../../../build/webpack/plugins/middleware-plugin';
/**
* For a given path a context, this function checks if there is any module
* context that contains the path with an older content and, if that's the
* case, removes the context from the cache.
*/
export declare function clearModuleContext(path: string): Promise<void>;
interface ModuleContextOptions {
moduleName: string;
onWarning: (warn: Error) => void;
useCache: boolean;
distDir: string;
edgeFunctionEntry: Pick<EdgeFunctionDefinition, 'assets' | 'wasm'>;
}
/**
* For a given module name this function will get a cached module
* context or create it. It will return the module context along
* with a function that allows to run some code from a given
* filepath within the context.
*/
export declare function getModuleContext(options: ModuleContextOptions): Promise<{
evaluateInContext: (filepath: string) => void;
runtime: EdgeRuntime;
paths: Map<string, string>;
warnedEvals: Set<string>;
}>;
export {};

375
node_modules/next/dist/server/web/sandbox/context.js generated vendored Normal file
View File

@@ -0,0 +1,375 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
clearModuleContext: null,
getModuleContext: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
clearModuleContext: function() {
return clearModuleContext;
},
getModuleContext: function() {
return getModuleContext;
}
});
const _async_hooks = require("async_hooks");
const _middleware = require("next/dist/compiled/@next/react-dev-overlay/dist/middleware");
const _constants = require("../../../shared/lib/constants");
const _edgeruntime = require("next/dist/compiled/edge-runtime");
const _fs = require("fs");
const _utils = require("../utils");
const _pick = require("../../../lib/pick");
const _fetchinlineassets = require("./fetch-inline-assets");
const _vm = require("vm");
const _nodebuffer = /*#__PURE__*/ _interop_require_default(require("node:buffer"));
const _nodeevents = /*#__PURE__*/ _interop_require_default(require("node:events"));
const _nodeassert = /*#__PURE__*/ _interop_require_default(require("node:assert"));
const _nodeutil = /*#__PURE__*/ _interop_require_default(require("node:util"));
const _nodeasync_hooks = /*#__PURE__*/ _interop_require_default(require("node:async_hooks"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
/**
* A Map of cached module contexts indexed by the module name. It allows
* to have a different cache scoped per module name or depending on the
* provided module key on creation.
*/ const moduleContexts = new Map();
const pendingModuleCaches = new Map();
async function clearModuleContext(path) {
const handleContext = (key, cache, context)=>{
if (cache == null ? void 0 : cache.paths.has(path)) {
context.delete(key);
}
};
for (const [key, cache] of moduleContexts){
handleContext(key, cache, moduleContexts);
}
for (const [key, cache] of pendingModuleCaches){
handleContext(key, await cache, pendingModuleCaches);
}
}
async function loadWasm(wasm) {
const modules = {};
await Promise.all(wasm.map(async (binding)=>{
const module1 = await WebAssembly.compile(await _fs.promises.readFile(binding.filePath));
modules[binding.name] = module1;
}));
return modules;
}
function buildEnvironmentVariablesFrom() {
const pairs = Object.keys(process.env).map((key)=>[
key,
process.env[key]
]);
const env = Object.fromEntries(pairs);
env.NEXT_RUNTIME = "edge";
return env;
}
function throwUnsupportedAPIError(name) {
const error = new Error(`A Node.js API is used (${name}) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime`);
(0, _middleware.decorateServerError)(error, _constants.COMPILER_NAMES.edgeServer);
throw error;
}
function createProcessPolyfill() {
const processPolyfill = {
env: buildEnvironmentVariablesFrom()
};
const overridenValue = {};
for (const key of Object.keys(process)){
if (key === "env") continue;
Object.defineProperty(processPolyfill, key, {
get () {
if (overridenValue[key] !== undefined) {
return overridenValue[key];
}
if (typeof process[key] === "function") {
return ()=>throwUnsupportedAPIError(`process.${key}`);
}
return undefined;
},
set (value) {
overridenValue[key] = value;
},
enumerable: false
});
}
return processPolyfill;
}
function addStub(context, name) {
Object.defineProperty(context, name, {
get () {
return function() {
throwUnsupportedAPIError(name);
};
},
enumerable: false
});
}
function getDecorateUnhandledError(runtime) {
const EdgeRuntimeError = runtime.evaluate(`Error`);
return (error)=>{
if (error instanceof EdgeRuntimeError) {
(0, _middleware.decorateServerError)(error, _constants.COMPILER_NAMES.edgeServer);
}
};
}
function getDecorateUnhandledRejection(runtime) {
const EdgeRuntimeError = runtime.evaluate(`Error`);
return (rejected)=>{
if (rejected.reason instanceof EdgeRuntimeError) {
(0, _middleware.decorateServerError)(rejected.reason, _constants.COMPILER_NAMES.edgeServer);
}
};
}
const NativeModuleMap = (()=>{
const mods = {
"node:buffer": (0, _pick.pick)(_nodebuffer.default, [
"constants",
"kMaxLength",
"kStringMaxLength",
"Buffer",
"SlowBuffer"
]),
"node:events": (0, _pick.pick)(_nodeevents.default, [
"EventEmitter",
"captureRejectionSymbol",
"defaultMaxListeners",
"errorMonitor",
"listenerCount",
"on",
"once"
]),
"node:async_hooks": (0, _pick.pick)(_nodeasync_hooks.default, [
"AsyncLocalStorage",
"AsyncResource"
]),
"node:assert": (0, _pick.pick)(_nodeassert.default, [
"AssertionError",
"deepEqual",
"deepStrictEqual",
"doesNotMatch",
"doesNotReject",
"doesNotThrow",
"equal",
"fail",
"ifError",
"match",
"notDeepEqual",
"notDeepStrictEqual",
"notEqual",
"notStrictEqual",
"ok",
"rejects",
"strict",
"strictEqual",
"throws"
]),
"node:util": (0, _pick.pick)(_nodeutil.default, [
"_extend",
"callbackify",
"format",
"inherits",
"promisify",
"types"
])
};
return new Map(Object.entries(mods));
})();
/**
* Create a module cache specific for the provided parameters. It includes
* a runtime context, require cache and paths cache.
*/ async function createModuleContext(options) {
const warnedEvals = new Set();
const warnedWasmCodegens = new Set();
const wasm = await loadWasm(options.edgeFunctionEntry.wasm ?? []);
const runtime = new _edgeruntime.EdgeRuntime({
codeGeneration: process.env.NODE_ENV !== "production" ? {
strings: true,
wasm: true
} : undefined,
extend: (context)=>{
context.process = createProcessPolyfill();
Object.defineProperty(context, "require", {
enumerable: false,
value: (id)=>{
const value = NativeModuleMap.get(id);
if (!value) {
throw TypeError("Native module not found: " + id);
}
return value;
}
});
context.__next_eval__ = function __next_eval__(fn) {
const key = fn.toString();
if (!warnedEvals.has(key)) {
const warning = (0, _middleware.getServerError)(new Error(`Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime
Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation`), _constants.COMPILER_NAMES.edgeServer);
warning.name = "DynamicCodeEvaluationWarning";
Error.captureStackTrace(warning, __next_eval__);
warnedEvals.add(key);
options.onWarning(warning);
}
return fn();
};
context.__next_webassembly_compile__ = function __next_webassembly_compile__(fn) {
const key = fn.toString();
if (!warnedWasmCodegens.has(key)) {
const warning = (0, _middleware.getServerError)(new Error(`Dynamic WASM code generation (e. g. 'WebAssembly.compile') not allowed in Edge Runtime.
Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation`), _constants.COMPILER_NAMES.edgeServer);
warning.name = "DynamicWasmCodeGenerationWarning";
Error.captureStackTrace(warning, __next_webassembly_compile__);
warnedWasmCodegens.add(key);
options.onWarning(warning);
}
return fn();
};
context.__next_webassembly_instantiate__ = async function __next_webassembly_instantiate__(fn) {
const result = await fn();
// If a buffer is given, WebAssembly.instantiate returns an object
// containing both a module and an instance while it returns only an
// instance if a WASM module is given. Utilize the fact to determine
// if the WASM code generation happens.
//
// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate#primary_overload_%E2%80%94_taking_wasm_binary_code
const instantiatedFromBuffer = result.hasOwnProperty("module");
const key = fn.toString();
if (instantiatedFromBuffer && !warnedWasmCodegens.has(key)) {
const warning = (0, _middleware.getServerError)(new Error(`Dynamic WASM code generation ('WebAssembly.instantiate' with a buffer parameter) not allowed in Edge Runtime.
Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation`), _constants.COMPILER_NAMES.edgeServer);
warning.name = "DynamicWasmCodeGenerationWarning";
Error.captureStackTrace(warning, __next_webassembly_instantiate__);
warnedWasmCodegens.add(key);
options.onWarning(warning);
}
return result;
};
const __fetch = context.fetch;
context.fetch = async (input, init = {})=>{
var _init_headers_get;
const callingError = new Error("[internal]");
const assetResponse = await (0, _fetchinlineassets.fetchInlineAsset)({
input,
assets: options.edgeFunctionEntry.assets,
distDir: options.distDir,
context
});
if (assetResponse) {
return assetResponse;
}
init.headers = new Headers(init.headers ?? {});
const prevs = ((_init_headers_get = init.headers.get(`x-middleware-subrequest`)) == null ? void 0 : _init_headers_get.split(":")) || [];
const value = prevs.concat(options.moduleName).join(":");
init.headers.set("x-middleware-subrequest", value);
if (!init.headers.has("user-agent")) {
init.headers.set(`user-agent`, `Next.js Middleware`);
}
const response = typeof input === "object" && "url" in input ? __fetch(input.url, {
...(0, _pick.pick)(input, [
"method",
"body",
"cache",
"credentials",
"integrity",
"keepalive",
"mode",
"redirect",
"referrer",
"referrerPolicy",
"signal"
]),
...init,
headers: {
...Object.fromEntries(input.headers),
...Object.fromEntries(init.headers)
}
}) : __fetch(String(input), init);
return await response.catch((err)=>{
callingError.message = err.message;
err.stack = callingError.stack;
throw err;
});
};
const __Request = context.Request;
context.Request = class extends __Request {
constructor(input, init){
const url = typeof input !== "string" && "url" in input ? input.url : String(input);
(0, _utils.validateURL)(url);
super(url, init);
this.next = init == null ? void 0 : init.next;
}
};
const __redirect = context.Response.redirect.bind(context.Response);
context.Response.redirect = (...args)=>{
(0, _utils.validateURL)(args[0]);
return __redirect(...args);
};
for (const name of _constants.EDGE_UNSUPPORTED_NODE_APIS){
addStub(context, name);
}
Object.assign(context, wasm);
context.AsyncLocalStorage = _async_hooks.AsyncLocalStorage;
return context;
}
});
const decorateUnhandledError = getDecorateUnhandledError(runtime);
runtime.context.addEventListener("error", decorateUnhandledError);
const decorateUnhandledRejection = getDecorateUnhandledRejection(runtime);
runtime.context.addEventListener("unhandledrejection", decorateUnhandledRejection);
return {
runtime,
paths: new Map(),
warnedEvals: new Set()
};
}
function getModuleContextShared(options) {
let deferredModuleContext = pendingModuleCaches.get(options.moduleName);
if (!deferredModuleContext) {
deferredModuleContext = createModuleContext(options);
pendingModuleCaches.set(options.moduleName, deferredModuleContext);
}
return deferredModuleContext;
}
async function getModuleContext(options) {
let lazyModuleContext;
if (options.useCache) {
lazyModuleContext = moduleContexts.get(options.moduleName) || await getModuleContextShared(options);
}
if (!lazyModuleContext) {
lazyModuleContext = await createModuleContext(options);
moduleContexts.set(options.moduleName, lazyModuleContext);
}
const moduleContext = lazyModuleContext;
const evaluateInContext = (filepath)=>{
if (!moduleContext.paths.has(filepath)) {
const content = (0, _fs.readFileSync)(filepath, "utf-8");
try {
(0, _vm.runInContext)(content, moduleContext.runtime.context, {
filename: filepath
});
moduleContext.paths.set(filepath, content);
} catch (error) {
if (options.useCache) {
moduleContext == null ? void 0 : moduleContext.paths.delete(filepath);
}
throw error;
}
}
};
return {
...moduleContext,
evaluateInContext
};
}
//# sourceMappingURL=context.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,15 @@
import type { EdgeFunctionDefinition } from '../../../build/webpack/plugins/middleware-plugin';
/**
* Short-circuits the `fetch` function
* to return a stream for a given asset, if a user used `new URL("file", import.meta.url)`.
* This allows to embed assets in Edge Runtime.
*/
export declare function fetchInlineAsset(options: {
input: RequestInfo | URL;
distDir: string;
assets: EdgeFunctionDefinition['assets'];
context: {
Response: typeof Response;
ReadableStream: typeof ReadableStream;
};
}): Promise<Response | undefined>;

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "fetchInlineAsset", {
enumerable: true,
get: function() {
return fetchInlineAsset;
}
});
const _fs = require("fs");
const _bodystreams = require("../../body-streams");
const _path = require("path");
async function fetchInlineAsset(options) {
var _options_assets;
const inputString = String(options.input);
if (!inputString.startsWith("blob:")) {
return;
}
const hash = inputString.replace("blob:", "");
const asset = (_options_assets = options.assets) == null ? void 0 : _options_assets.find((x)=>x.name === hash);
if (!asset) {
return;
}
const filePath = (0, _path.resolve)(options.distDir, asset.filePath);
const fileIsReadable = await _fs.promises.access(filePath).then(()=>true, ()=>false);
if (fileIsReadable) {
const readStream = (0, _fs.createReadStream)(filePath);
return new options.context.Response((0, _bodystreams.requestToBodyStream)(options.context, Uint8Array, readStream));
}
}
//# sourceMappingURL=fetch-inline-assets.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/web/sandbox/fetch-inline-assets.ts"],"names":["fetchInlineAsset","options","inputString","String","input","startsWith","hash","replace","asset","assets","find","x","name","filePath","resolve","distDir","fileIsReadable","fs","access","then","readStream","createReadStream","context","Response","requestToBodyStream","Uint8Array"],"mappings":";;;;+BAUsBA;;;eAAAA;;;oBAT2B;6BACb;sBACZ;AAOjB,eAAeA,iBAAiBC,OAKtC;QAOeA;IANd,MAAMC,cAAcC,OAAOF,QAAQG,KAAK;IACxC,IAAI,CAACF,YAAYG,UAAU,CAAC,UAAU;QACpC;IACF;IAEA,MAAMC,OAAOJ,YAAYK,OAAO,CAAC,SAAS;IAC1C,MAAMC,SAAQP,kBAAAA,QAAQQ,MAAM,qBAAdR,gBAAgBS,IAAI,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAKN;IACrD,IAAI,CAACE,OAAO;QACV;IACF;IAEA,MAAMK,WAAWC,IAAAA,aAAO,EAACb,QAAQc,OAAO,EAAEP,MAAMK,QAAQ;IACxD,MAAMG,iBAAiB,MAAMC,YAAE,CAACC,MAAM,CAACL,UAAUM,IAAI,CACnD,IAAM,MACN,IAAM;IAGR,IAAIH,gBAAgB;QAClB,MAAMI,aAAaC,IAAAA,oBAAgB,EAACR;QACpC,OAAO,IAAIZ,QAAQqB,OAAO,CAACC,QAAQ,CACjCC,IAAAA,gCAAmB,EAACvB,QAAQqB,OAAO,EAAEG,YAAYL;IAErD;AACF"}

2
node_modules/next/dist/server/web/sandbox/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from './sandbox';
export { clearModuleContext } from './context';

28
node_modules/next/dist/server/web/sandbox/index.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "clearModuleContext", {
enumerable: true,
get: function() {
return _context.clearModuleContext;
}
});
0 && __export(require("./sandbox"));
_export_star(require("./sandbox"), exports);
const _context = require("./context");
function _export_star(from, to) {
Object.keys(from).forEach(function(k) {
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
Object.defineProperty(to, k, {
enumerable: true,
get: function() {
return from[k];
}
});
}
});
return from;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/web/sandbox/index.ts"],"names":["clearModuleContext"],"mappings":";;;;+BACSA;;;eAAAA,2BAAkB;;;;qBADb;yBACqB"}

25
node_modules/next/dist/server/web/sandbox/sandbox.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import type { NodejsRequestData, FetchEventResult } from '../types';
import { EdgeFunctionDefinition } from '../../../build/webpack/plugins/middleware-plugin';
import type { EdgeRuntime } from 'next/dist/compiled/edge-runtime';
export declare const ErrorSource: unique symbol;
type RunnerFn = (params: {
name: string;
onWarning?: (warn: Error) => void;
paths: string[];
request: NodejsRequestData;
useCache: boolean;
edgeFunctionEntry: Pick<EdgeFunctionDefinition, 'wasm' | 'assets'>;
distDir: string;
incrementalCache?: any;
}) => Promise<FetchEventResult>;
export declare function getRuntimeContext(params: {
name: string;
onWarning?: any;
useCache: boolean;
edgeFunctionEntry: any;
distDir: string;
paths: string[];
incrementalCache?: any;
}): Promise<EdgeRuntime<any>>;
export declare const run: RunnerFn;
export {};

112
node_modules/next/dist/server/web/sandbox/sandbox.js generated vendored Normal file
View File

@@ -0,0 +1,112 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
ErrorSource: null,
getRuntimeContext: null,
run: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ErrorSource: function() {
return ErrorSource;
},
getRuntimeContext: function() {
return getRuntimeContext;
},
run: function() {
return run;
}
});
const _middleware = require("next/dist/compiled/@next/react-dev-overlay/dist/middleware");
const _context = require("./context");
const _bodystreams = require("../../body-streams");
const _approuterheaders = require("../../../client/components/app-router-headers");
const ErrorSource = Symbol("SandboxError");
const FORBIDDEN_HEADERS = [
"content-length",
"content-encoding",
"transfer-encoding"
];
/**
* Decorates the runner function making sure all errors it can produce are
* tagged with `edge-server` so they can properly be rendered in dev.
*/ function withTaggedErrors(fn) {
return (params)=>fn(params).then((result)=>{
var _result_waitUntil;
return {
...result,
waitUntil: result == null ? void 0 : (_result_waitUntil = result.waitUntil) == null ? void 0 : _result_waitUntil.catch((error)=>{
// TODO: used COMPILER_NAMES.edgeServer instead. Verify that it does not increase the runtime size.
throw (0, _middleware.getServerError)(error, "edge-server");
})
};
}).catch((error)=>{
// TODO: used COMPILER_NAMES.edgeServer instead
throw (0, _middleware.getServerError)(error, "edge-server");
});
}
async function getRuntimeContext(params) {
const { runtime, evaluateInContext } = await (0, _context.getModuleContext)({
moduleName: params.name,
onWarning: params.onWarning ?? (()=>{}),
useCache: params.useCache !== false,
edgeFunctionEntry: params.edgeFunctionEntry,
distDir: params.distDir
});
if (params.incrementalCache) {
runtime.context.globalThis.__incrementalCache = params.incrementalCache;
}
for (const paramPath of params.paths){
evaluateInContext(paramPath);
}
return runtime;
}
const run = withTaggedErrors(async function runWithTaggedErrors(params) {
var _params_request_body;
const runtime = await getRuntimeContext(params);
const subreq = params.request.headers[`x-middleware-subrequest`];
const subrequests = typeof subreq === "string" ? subreq.split(":") : [];
if (subrequests.includes(params.name)) {
return {
waitUntil: Promise.resolve(),
response: new runtime.context.Response(null, {
headers: {
"x-middleware-next": "1"
}
})
};
}
const edgeFunction = runtime.context._ENTRIES[`middleware_${params.name}`].default;
const cloned = ![
"HEAD",
"GET"
].includes(params.request.method) ? (_params_request_body = params.request.body) == null ? void 0 : _params_request_body.cloneBodyStream() : undefined;
const KUint8Array = runtime.evaluate("Uint8Array");
const urlInstance = new URL(params.request.url);
urlInstance.searchParams.delete(_approuterheaders.NEXT_RSC_UNION_QUERY);
params.request.url = urlInstance.toString();
try {
const result = await edgeFunction({
request: {
...params.request,
body: cloned && (0, _bodystreams.requestToBodyStream)(runtime.context, KUint8Array, cloned)
}
});
for (const headerName of FORBIDDEN_HEADERS){
result.response.headers.delete(headerName);
}
return result;
} finally{
var _params_request_body1;
await ((_params_request_body1 = params.request.body) == null ? void 0 : _params_request_body1.finalize());
}
});
//# sourceMappingURL=sandbox.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/web/sandbox/sandbox.ts"],"names":["ErrorSource","getRuntimeContext","run","Symbol","FORBIDDEN_HEADERS","withTaggedErrors","fn","params","then","result","waitUntil","catch","error","getServerError","runtime","evaluateInContext","getModuleContext","moduleName","name","onWarning","useCache","edgeFunctionEntry","distDir","incrementalCache","context","globalThis","__incrementalCache","paramPath","paths","runWithTaggedErrors","subreq","request","headers","subrequests","split","includes","Promise","resolve","response","Response","edgeFunction","_ENTRIES","default","cloned","method","body","cloneBodyStream","undefined","KUint8Array","evaluate","urlInstance","URL","url","searchParams","delete","NEXT_RSC_UNION_QUERY","toString","requestToBodyStream","headerName","finalize"],"mappings":";;;;;;;;;;;;;;;;IAQaA,WAAW;eAAXA;;IAuCSC,iBAAiB;eAAjBA;;IA2BTC,GAAG;eAAHA;;;4BAzEkB;yBACE;6BAEG;kCAEC;AAE9B,MAAMF,cAAcG,OAAO;AAElC,MAAMC,oBAAoB;IACxB;IACA;IACA;CACD;AAaD;;;CAGC,GACD,SAASC,iBAAiBC,EAAY;IACpC,OAAO,CAACC,SACND,GAAGC,QACAC,IAAI,CAAC,CAACC;gBAEMA;mBAFM;gBACjB,GAAGA,MAAM;gBACTC,SAAS,EAAED,2BAAAA,oBAAAA,OAAQC,SAAS,qBAAjBD,kBAAmBE,KAAK,CAAC,CAACC;oBACnC,mGAAmG;oBACnG,MAAMC,IAAAA,0BA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