@rspack-canary/core 1.7.3-canary-0b48f4eb-20260120024403 → 1.7.4-canary-e31ee70c-20260121175734
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChunkGraph.d.ts +1 -1
- package/dist/Compilation.d.ts +27 -27
- package/dist/Compiler.d.ts +17 -18
- package/dist/ContextModuleFactory.d.ts +1 -1
- package/dist/Diagnostics.d.ts +1 -1
- package/dist/ExecuteModulePlugin.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/FileSystem.d.ts +1 -1
- package/dist/Module.d.ts +2 -2
- package/dist/ModuleGraph.d.ts +2 -2
- package/dist/MultiCompiler.d.ts +7 -7
- package/dist/MultiStats.d.ts +3 -3
- package/dist/MultiWatching.d.ts +2 -2
- package/dist/NativeWatchFileSystem.d.ts +1 -1
- package/dist/NormalModule.d.ts +3 -3
- package/dist/NormalModuleFactory.d.ts +3 -3
- package/dist/Resolver.d.ts +1 -1
- package/dist/ResolverFactory.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +1 -1
- package/dist/RuntimeModule.d.ts +3 -3
- package/dist/Stats.d.ts +4 -4
- package/dist/VirtualModulesPlugin.d.ts +1 -1
- package/dist/Watching.d.ts +4 -4
- package/dist/builtin-loader/index.d.ts +1 -1
- package/dist/builtin-loader/lightningcss/index.d.ts +5 -0
- package/dist/builtin-loader/swc/index.d.ts +5 -5
- package/dist/builtin-loader/swc/types.d.ts +6 -4
- package/dist/builtin-plugin/APIPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BannerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +3 -3
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +4 -4
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DataUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DefinePlugin.d.ts +3 -3
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EntryPlugin.d.ts +4 -4
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +3 -3
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FileUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +2 -2
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +2 -2
- package/dist/builtin-plugin/IgnorePlugin.d.ts +3 -3
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/InlineExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +4 -4
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +3 -3
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +10 -5
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +3 -3
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +4 -4
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ProgressPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ProvidePlugin.d.ts +3 -3
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -4
- package/dist/builtin-plugin/RslibPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RstestPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RuntimePlugin.d.ts +10 -6
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +5 -5
- package/dist/builtin-plugin/URLPlugin.d.ts +3 -3
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +2 -2
- package/dist/builtin-plugin/WorkerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/base.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/index.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/loader.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/utils.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/options.d.ts +6 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +9 -5
- package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +84 -85
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +4 -4
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +2 -2
- package/dist/config/adapter.d.ts +4 -4
- package/dist/config/adapterRuleUse.d.ts +9 -9
- package/dist/config/browserslistTargetHandler.d.ts +1 -1
- package/dist/config/defaults.d.ts +1 -1
- package/dist/config/devServer.d.ts +3 -3
- package/dist/config/index.d.ts +5 -5
- package/dist/config/normalization.d.ts +35 -7
- package/dist/config/types.d.ts +156 -67
- package/dist/container/ContainerPlugin.d.ts +3 -3
- package/dist/container/ContainerReferencePlugin.d.ts +3 -3
- package/dist/container/ModuleFederationManifestPlugin.d.ts +2 -2
- package/dist/container/ModuleFederationPlugin.d.ts +5 -3
- package/dist/container/ModuleFederationPluginV1.d.ts +5 -5
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +7 -3
- package/dist/container/index.d.ts +4 -4
- package/dist/cssExtractHmr.js +27 -2
- package/dist/cssExtractLoader.js +57 -15
- package/dist/exports.d.ts +81 -70
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11731 -11457
- package/dist/lib/AbstractMethodError.d.ts +1 -1
- package/dist/lib/Cache.d.ts +1 -1
- package/dist/lib/CacheFacade.d.ts +3 -3
- package/dist/lib/DllPlugin.d.ts +2 -2
- package/dist/lib/DllReferencePlugin.d.ts +3 -3
- package/dist/lib/EntryOptionPlugin.d.ts +2 -2
- package/dist/lib/EnvironmentPlugin.d.ts +1 -1
- package/dist/lib/HookWebpackError.d.ts +1 -1
- package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
- package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
- package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
- package/dist/lib/WebpackError.d.ts +2 -2
- package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
- package/dist/lib/cache/getLazyHashedEtag.d.ts +1 -1
- package/dist/lib/cache/mergeEtags.d.ts +1 -1
- package/dist/loader-runner/ModuleError.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +1 -1
- package/dist/loader-runner/loadLoader.d.ts +2 -2
- package/dist/loader-runner/utils.d.ts +3 -3
- package/dist/loader-runner/worker.d.ts +1 -1
- package/dist/logging/createConsoleLogger.d.ts +2 -2
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
- package/dist/node/NodeTemplatePlugin.d.ts +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +1 -1
- package/dist/node/nodeConsole.d.ts +1 -1
- package/dist/rspack.d.ts +5 -5
- package/dist/rspackOptionsApply.d.ts +1 -1
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -1
- package/dist/sharing/ConsumeSharedPlugin.d.ts +2 -2
- package/dist/sharing/ProvideSharedPlugin.d.ts +2 -2
- package/dist/sharing/SharePlugin.d.ts +1 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +2 -2
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
- package/dist/stats/StatsFactory.d.ts +2 -2
- package/dist/stats/StatsPrinter.d.ts +1 -1
- package/dist/stats/statsFactoryUtils.d.ts +6 -3
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/compiler.d.ts +1 -1
- package/dist/taps/contextModuleFactory.d.ts +1 -1
- package/dist/taps/index.d.ts +6 -6
- package/dist/taps/javascriptModules.d.ts +1 -1
- package/dist/taps/normalModuleFactory.d.ts +1 -1
- package/dist/taps/types.d.ts +1 -1
- package/dist/trace/traceHookPlugin.d.ts +1 -1
- package/dist/util/createHash.d.ts +1 -1
- package/dist/util/fs.d.ts +1 -1
- package/dist/util/hash/md4.d.ts +1 -1
- package/dist/util/hash/xxhash64.d.ts +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/validateConfig.d.ts +1 -1
- package/dist/worker.js +918 -846
- package/hot/dev-server.js +9 -12
- package/hot/emitter.js +1 -5
- package/hot/lazy-compilation-node.js +1 -4
- package/hot/lazy-compilation-web.js +3 -2
- package/hot/log-apply-result.js +5 -8
- package/hot/log.js +7 -17
- package/hot/only-dev-server.js +10 -13
- package/hot/poll.js +8 -11
- package/hot/signal.js +9 -13
- package/package.json +6 -9
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +0 -8
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +0 -13
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +0 -14
- package/dist/builtin-plugin/rsc/index.d.ts +0 -24
- package/dist/rslib-runtime.js +0 -29
package/dist/worker.js
CHANGED
|
@@ -1,906 +1,978 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
transform: ()=>transform,
|
|
15
|
-
transformSync: ()=>transformSync
|
|
16
|
-
});
|
|
17
|
-
let binding_namespaceObject = __rspack_createRequire_require("@rspack/binding");
|
|
18
|
-
var binding_default = __webpack_require__.n(binding_namespaceObject);
|
|
19
|
-
async function minify(source, options) {
|
|
20
|
-
let _options = JSON.stringify(options || {});
|
|
21
|
-
return binding_default().minify(source, _options);
|
|
22
|
-
}
|
|
23
|
-
function minifySync(source, options) {
|
|
24
|
-
let _options = JSON.stringify(options || {});
|
|
25
|
-
return binding_default().minifySync(source, _options);
|
|
26
|
-
}
|
|
27
|
-
async function transform(source, options) {
|
|
28
|
-
let _options = JSON.stringify(options || {});
|
|
29
|
-
return binding_default().transform(source, _options);
|
|
30
|
-
}
|
|
31
|
-
function transformSync(source, options) {
|
|
32
|
-
let _options = JSON.stringify(options || {});
|
|
33
|
-
return binding_default().transformSync(source, _options);
|
|
34
|
-
}
|
|
35
|
-
let DYNAMIC_INFO = Symbol('cleverMerge dynamic info'), mergeCache = new WeakMap(), DELETE = Symbol('DELETE'), cachedCleverMerge = (first, second)=>{
|
|
36
|
-
if (void 0 === second) return first;
|
|
37
|
-
if (void 0 === first || 'object' != typeof second || null === second) return second;
|
|
38
|
-
if ('object' != typeof first || null === first) return first;
|
|
39
|
-
let innerCache = mergeCache.get(first);
|
|
40
|
-
void 0 === innerCache && (innerCache = new WeakMap(), mergeCache.set(first, innerCache));
|
|
41
|
-
let prevMerge = innerCache.get(second);
|
|
42
|
-
if (void 0 !== prevMerge) return prevMerge;
|
|
43
|
-
let newMerge = _cleverMerge(first, second, !0);
|
|
44
|
-
return innerCache.set(second, newMerge), newMerge;
|
|
45
|
-
}, parseCache = new WeakMap(), cachedParseObject = (obj)=>{
|
|
46
|
-
let entry = parseCache.get(obj);
|
|
47
|
-
if (void 0 !== entry) return entry;
|
|
48
|
-
let result = parseObject(obj);
|
|
49
|
-
return parseCache.set(obj, result), result;
|
|
50
|
-
}, parseObject = (obj)=>{
|
|
51
|
-
let dynamicInfo, info = new Map(), getInfo = (p)=>{
|
|
52
|
-
let entry = info.get(p);
|
|
53
|
-
if (void 0 !== entry) return entry;
|
|
54
|
-
let newEntry = {
|
|
55
|
-
base: void 0,
|
|
56
|
-
byProperty: void 0,
|
|
57
|
-
byValues: new Map()
|
|
58
|
-
};
|
|
59
|
-
return info.set(p, newEntry), newEntry;
|
|
60
|
-
};
|
|
61
|
-
for (let key of Object.keys(obj))if (key.startsWith('by')) {
|
|
62
|
-
let byObj = obj[key];
|
|
63
|
-
if ('object' == typeof byObj) for (let byValue of Object.keys(byObj)){
|
|
64
|
-
let obj = byObj[byValue];
|
|
65
|
-
for (let key1 of Object.keys(obj)){
|
|
66
|
-
let entry = getInfo(key1);
|
|
67
|
-
if (void 0 === entry.byProperty) entry.byProperty = key;
|
|
68
|
-
else if (entry.byProperty !== key) throw Error(`${key} and ${entry.byProperty} for a single property is not supported`);
|
|
69
|
-
if (entry.byValues.set(byValue, obj[key1]), 'default' === byValue) for (let otherByValue of Object.keys(byObj))entry.byValues.has(otherByValue) || entry.byValues.set(otherByValue, void 0);
|
|
70
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./src/swc.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
4
|
+
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
|
|
5
|
+
minify: ()=>minify,
|
|
6
|
+
minifySync: ()=>minifySync,
|
|
7
|
+
transform: ()=>transform,
|
|
8
|
+
transformSync: ()=>transformSync
|
|
9
|
+
});
|
|
10
|
+
var _rspack_binding__rspack_import_0 = __webpack_require__("@rspack/binding"), _rspack_binding__rspack_import_0_default = __webpack_require__.n(_rspack_binding__rspack_import_0);
|
|
11
|
+
async function minify(source, options) {
|
|
12
|
+
let _options = JSON.stringify(options || {});
|
|
13
|
+
return _rspack_binding__rspack_import_0_default().minify(source, _options);
|
|
71
14
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
76
|
-
else throw Error(`${key} and ${dynamicInfo.byProperty} when both are functions is not supported`);
|
|
77
|
-
else getInfo(key).base = obj[key];
|
|
78
|
-
} else getInfo(key).base = obj[key];
|
|
79
|
-
return {
|
|
80
|
-
static: info,
|
|
81
|
-
dynamic: dynamicInfo
|
|
82
|
-
};
|
|
83
|
-
}, serializeObject = (info, dynamicInfo)=>{
|
|
84
|
-
let obj = {};
|
|
85
|
-
for (let entry of info.values())if (void 0 !== entry.byProperty) {
|
|
86
|
-
let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
|
|
87
|
-
for (let byValue of entry.byValues.keys())byObj[byValue] = byObj[byValue] || {};
|
|
88
|
-
}
|
|
89
|
-
for (let [key, entry] of info)if (void 0 !== entry.base && (obj[key] = entry.base), void 0 !== entry.byProperty) {
|
|
90
|
-
let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
|
|
91
|
-
for (let byValue of Object.keys(byObj)){
|
|
92
|
-
let value = getFromByValues(entry.byValues, byValue);
|
|
93
|
-
void 0 !== value && (byObj[byValue][key] = value);
|
|
15
|
+
function minifySync(source, options) {
|
|
16
|
+
let _options = JSON.stringify(options || {});
|
|
17
|
+
return _rspack_binding__rspack_import_0_default().minifySync(source, _options);
|
|
94
18
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
fn,
|
|
108
|
-
secondObj
|
|
109
|
-
], serializeObject(firstObject.static, {
|
|
110
|
-
byProperty,
|
|
111
|
-
fn: newFn
|
|
19
|
+
async function transform(source, options) {
|
|
20
|
+
let _options = JSON.stringify(options || {});
|
|
21
|
+
return _rspack_binding__rspack_import_0_default().transform(source, _options);
|
|
22
|
+
}
|
|
23
|
+
function transformSync(source, options) {
|
|
24
|
+
let _options = JSON.stringify(options || {});
|
|
25
|
+
return _rspack_binding__rspack_import_0_default().transformSync(source, _options);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"./src/util/cleverMerge.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
29
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
30
|
+
ks: ()=>cleverMerge
|
|
112
31
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
32
|
+
let DYNAMIC_INFO = Symbol('cleverMerge dynamic info'), mergeCache = new WeakMap(), DELETE = Symbol('DELETE'), cachedCleverMerge = (first, second)=>{
|
|
33
|
+
if (void 0 === second) return first;
|
|
34
|
+
if (void 0 === first || 'object' != typeof second || null === second) return second;
|
|
35
|
+
if ('object' != typeof first || null === first) return first;
|
|
36
|
+
let innerCache = mergeCache.get(first);
|
|
37
|
+
void 0 === innerCache && (innerCache = new WeakMap(), mergeCache.set(first, innerCache));
|
|
38
|
+
let prevMerge = innerCache.get(second);
|
|
39
|
+
if (void 0 !== prevMerge) return prevMerge;
|
|
40
|
+
let newMerge = _cleverMerge(first, second, !0);
|
|
41
|
+
return innerCache.set(second, newMerge), newMerge;
|
|
42
|
+
}, parseCache = new WeakMap(), cachedParseObject = (obj)=>{
|
|
43
|
+
let entry = parseCache.get(obj);
|
|
44
|
+
if (void 0 !== entry) return entry;
|
|
45
|
+
let result = parseObject(obj);
|
|
46
|
+
return parseCache.set(obj, result), result;
|
|
47
|
+
}, parseObject = (obj)=>{
|
|
48
|
+
let dynamicInfo, info = new Map(), getInfo = (p)=>{
|
|
49
|
+
let entry = info.get(p);
|
|
50
|
+
if (void 0 !== entry) return entry;
|
|
51
|
+
let newEntry = {
|
|
52
|
+
base: void 0,
|
|
53
|
+
byProperty: void 0,
|
|
54
|
+
byValues: new Map()
|
|
132
55
|
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
56
|
+
return info.set(p, newEntry), newEntry;
|
|
57
|
+
};
|
|
58
|
+
for (let key of Object.keys(obj))if (key.startsWith('by')) {
|
|
59
|
+
let byObj = obj[key];
|
|
60
|
+
if ('object' == typeof byObj) for (let byValue of Object.keys(byObj)){
|
|
61
|
+
let obj = byObj[byValue];
|
|
62
|
+
for (let key1 of Object.keys(obj)){
|
|
63
|
+
let entry = getInfo(key1);
|
|
64
|
+
if (void 0 === entry.byProperty) entry.byProperty = key;
|
|
65
|
+
else if (entry.byProperty !== key) throw Error(`${key} and ${entry.byProperty} for a single property is not supported`);
|
|
66
|
+
if (entry.byValues.set(byValue, obj[key1]), 'default' === byValue) for (let otherByValue of Object.keys(byObj))entry.byValues.has(otherByValue) || entry.byValues.set(otherByValue, void 0);
|
|
67
|
+
}
|
|
138
68
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
byValues: newByValues
|
|
69
|
+
else if ('function' == typeof byObj) if (void 0 === dynamicInfo) dynamicInfo = {
|
|
70
|
+
byProperty: key,
|
|
71
|
+
fn: byObj
|
|
143
72
|
};
|
|
73
|
+
else throw Error(`${key} and ${dynamicInfo.byProperty} when both are functions is not supported`);
|
|
74
|
+
else getInfo(key).base = obj[key];
|
|
75
|
+
} else getInfo(key).base = obj[key];
|
|
76
|
+
return {
|
|
77
|
+
static: info,
|
|
78
|
+
dynamic: dynamicInfo
|
|
79
|
+
};
|
|
80
|
+
}, serializeObject = (info, dynamicInfo)=>{
|
|
81
|
+
let obj = {};
|
|
82
|
+
for (let entry of info.values())if (void 0 !== entry.byProperty) {
|
|
83
|
+
let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
|
|
84
|
+
for (let byValue of entry.byValues.keys())byObj[byValue] = byObj[byValue] || {};
|
|
144
85
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
let
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
byProperty: secondEntry.byProperty,
|
|
151
|
-
byValues: secondEntry.byValues
|
|
152
|
-
};
|
|
153
|
-
let intermediateByValues = new Map(firstEntry.byValues);
|
|
154
|
-
for (let [key, value] of intermediateByValues)intermediateByValues.set(key, mergeSingleValue(value, secondEntry.base, internalCaching));
|
|
155
|
-
if (Array.from(firstEntry.byValues.values()).every((value)=>{
|
|
156
|
-
let type = getValueType(value);
|
|
157
|
-
return 1 === type || 4 === type;
|
|
158
|
-
}) ? newBase = mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching) : (newBase = firstEntry.base, intermediateByValues.has('default') || intermediateByValues.set('default', secondEntry.base)), !secondEntry.byProperty) return {
|
|
159
|
-
base: newBase,
|
|
160
|
-
byProperty: firstEntry.byProperty,
|
|
161
|
-
byValues: intermediateByValues
|
|
162
|
-
};
|
|
163
|
-
if (firstEntry.byProperty !== secondEntry.byProperty) throw Error(`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`);
|
|
164
|
-
let newByValues = new Map(intermediateByValues);
|
|
165
|
-
for (let [key, value] of secondEntry.byValues){
|
|
166
|
-
let firstValue = getFromByValues(intermediateByValues, key);
|
|
167
|
-
newByValues.set(key, mergeSingleValue(firstValue, value, internalCaching));
|
|
86
|
+
for (let [key, entry] of info)if (void 0 !== entry.base && (obj[key] = entry.base), void 0 !== entry.byProperty) {
|
|
87
|
+
let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
|
|
88
|
+
for (let byValue of Object.keys(byObj)){
|
|
89
|
+
let value = getFromByValues(entry.byValues, byValue);
|
|
90
|
+
void 0 !== value && (byObj[byValue][key] = value);
|
|
168
91
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
92
|
+
}
|
|
93
|
+
return void 0 !== dynamicInfo && (obj[dynamicInfo.byProperty] = dynamicInfo.fn), obj;
|
|
94
|
+
}, getValueType = (value)=>void 0 === value ? 0 : value === DELETE ? 4 : Array.isArray(value) ? -1 !== value.lastIndexOf('...') ? 2 : 1 : 'object' != typeof value || null === value || value.constructor && value.constructor !== Object ? 1 : 3, cleverMerge = (first, second)=>void 0 === second ? first : void 0 === first || 'object' != typeof second || null === second ? second : 'object' != typeof first || null === first ? first : _cleverMerge(first, second, !1), _cleverMerge = (first, second, internalCaching = !1)=>{
|
|
95
|
+
let firstObject = internalCaching ? cachedParseObject(first) : parseObject(first), { static: firstInfo, dynamic: firstDynamicInfo } = firstObject, secondObj = second;
|
|
96
|
+
if (void 0 !== firstDynamicInfo) {
|
|
97
|
+
let { byProperty, fn } = firstDynamicInfo, fnInfo = fn[DYNAMIC_INFO];
|
|
98
|
+
fnInfo && (secondObj = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second), fn = fnInfo[0]);
|
|
99
|
+
let newFn = (...args)=>{
|
|
100
|
+
let fnResult = fn(...args);
|
|
101
|
+
return internalCaching ? cachedCleverMerge(fnResult, secondObj) : cleverMerge(fnResult, secondObj);
|
|
173
102
|
};
|
|
103
|
+
return newFn[DYNAMIC_INFO] = [
|
|
104
|
+
fn,
|
|
105
|
+
secondObj
|
|
106
|
+
], serializeObject(firstObject.static, {
|
|
107
|
+
byProperty,
|
|
108
|
+
fn: newFn
|
|
109
|
+
});
|
|
174
110
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return a;
|
|
186
|
-
case 2:
|
|
187
|
-
switch(1 !== aType ? aType : Array.isArray(a) ? 2 : 3){
|
|
188
|
-
case 0:
|
|
189
|
-
return b;
|
|
111
|
+
let { static: secondInfo, dynamic: secondDynamicInfo } = internalCaching ? cachedParseObject(second) : parseObject(second), resultInfo = new Map();
|
|
112
|
+
for (let [key, firstEntry] of firstInfo){
|
|
113
|
+
let secondEntry = secondInfo.get(key), entry = void 0 !== secondEntry ? mergeEntries(firstEntry, secondEntry, internalCaching) : firstEntry;
|
|
114
|
+
resultInfo.set(key, entry);
|
|
115
|
+
}
|
|
116
|
+
for (let [key, secondEntry] of secondInfo)firstInfo.has(key) || resultInfo.set(key, secondEntry);
|
|
117
|
+
return serializeObject(resultInfo, secondDynamicInfo);
|
|
118
|
+
}, mergeEntries = (firstEntry, secondEntry, internalCaching)=>{
|
|
119
|
+
switch(getValueType(secondEntry.base)){
|
|
120
|
+
case 1:
|
|
190
121
|
case 4:
|
|
191
|
-
return
|
|
192
|
-
case
|
|
122
|
+
return secondEntry;
|
|
123
|
+
case 0:
|
|
124
|
+
{
|
|
125
|
+
if (!firstEntry.byProperty) return {
|
|
126
|
+
base: firstEntry.base,
|
|
127
|
+
byProperty: secondEntry.byProperty,
|
|
128
|
+
byValues: secondEntry.byValues
|
|
129
|
+
};
|
|
130
|
+
if (firstEntry.byProperty !== secondEntry.byProperty) throw Error(`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`);
|
|
131
|
+
let newByValues = new Map(firstEntry.byValues);
|
|
132
|
+
for (let [key, value] of secondEntry.byValues){
|
|
133
|
+
let firstValue = getFromByValues(firstEntry.byValues, key);
|
|
134
|
+
newByValues.set(key, mergeSingleValue(firstValue, value, internalCaching));
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
base: firstEntry.base,
|
|
138
|
+
byProperty: firstEntry.byProperty,
|
|
139
|
+
byValues: newByValues
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
default:
|
|
193
143
|
{
|
|
194
|
-
let
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
144
|
+
let newBase;
|
|
145
|
+
if (!firstEntry.byProperty) return {
|
|
146
|
+
base: mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching),
|
|
147
|
+
byProperty: secondEntry.byProperty,
|
|
148
|
+
byValues: secondEntry.byValues
|
|
149
|
+
};
|
|
150
|
+
let intermediateByValues = new Map(firstEntry.byValues);
|
|
151
|
+
for (let [key, value] of intermediateByValues)intermediateByValues.set(key, mergeSingleValue(value, secondEntry.base, internalCaching));
|
|
152
|
+
if (Array.from(firstEntry.byValues.values()).every((value)=>{
|
|
153
|
+
let type = getValueType(value);
|
|
154
|
+
return 1 === type || 4 === type;
|
|
155
|
+
}) ? newBase = mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching) : (newBase = firstEntry.base, intermediateByValues.has('default') || intermediateByValues.set('default', secondEntry.base)), !secondEntry.byProperty) return {
|
|
156
|
+
base: newBase,
|
|
157
|
+
byProperty: firstEntry.byProperty,
|
|
158
|
+
byValues: intermediateByValues
|
|
159
|
+
};
|
|
160
|
+
if (firstEntry.byProperty !== secondEntry.byProperty) throw Error(`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`);
|
|
161
|
+
let newByValues = new Map(intermediateByValues);
|
|
162
|
+
for (let [key, value] of secondEntry.byValues){
|
|
163
|
+
let firstValue = getFromByValues(intermediateByValues, key);
|
|
164
|
+
newByValues.set(key, mergeSingleValue(firstValue, value, internalCaching));
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
base: newBase,
|
|
168
|
+
byProperty: firstEntry.byProperty,
|
|
169
|
+
byValues: newByValues
|
|
170
|
+
};
|
|
198
171
|
}
|
|
172
|
+
}
|
|
173
|
+
}, getFromByValues = (byValues, key)=>'default' !== key && byValues.has(key) ? byValues.get(key) : byValues.get('default'), mergeSingleValue = (a, b, internalCaching)=>{
|
|
174
|
+
let bType = getValueType(b), aType = getValueType(a);
|
|
175
|
+
switch(bType){
|
|
176
|
+
case 4:
|
|
177
|
+
case 1:
|
|
178
|
+
return b;
|
|
199
179
|
case 3:
|
|
200
|
-
return b
|
|
180
|
+
return 3 !== aType ? b : internalCaching ? cachedCleverMerge(a, b) : cleverMerge(a, b);
|
|
181
|
+
case 0:
|
|
182
|
+
return a;
|
|
183
|
+
case 2:
|
|
184
|
+
switch(1 !== aType ? aType : Array.isArray(a) ? 2 : 3){
|
|
185
|
+
case 0:
|
|
186
|
+
return b;
|
|
187
|
+
case 4:
|
|
188
|
+
return b.filter((item)=>'...' !== item);
|
|
189
|
+
case 2:
|
|
190
|
+
{
|
|
191
|
+
let newArray = [];
|
|
192
|
+
for (let item of b)if ('...' === item) for (let item of a)newArray.push(item);
|
|
193
|
+
else newArray.push(item);
|
|
194
|
+
return newArray;
|
|
195
|
+
}
|
|
196
|
+
case 3:
|
|
197
|
+
return b.map((item)=>'...' === item ? a : item);
|
|
198
|
+
default:
|
|
199
|
+
throw Error('Not implemented');
|
|
200
|
+
}
|
|
201
201
|
default:
|
|
202
202
|
throw Error('Not implemented');
|
|
203
203
|
}
|
|
204
|
-
|
|
205
|
-
throw Error('Not implemented');
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
class WebpackError extends Error {
|
|
209
|
-
loc;
|
|
210
|
-
file;
|
|
211
|
-
chunk;
|
|
212
|
-
module;
|
|
213
|
-
details;
|
|
214
|
-
hideStack;
|
|
215
|
-
}
|
|
216
|
-
Object.defineProperty(WebpackError.prototype, inspect.custom, {
|
|
217
|
-
value: function() {
|
|
218
|
-
return this.stack + (this.details ? `\n${this.details}` : '');
|
|
204
|
+
};
|
|
219
205
|
},
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
class AbstractMethodError extends lib_WebpackError {
|
|
235
|
-
constructor(){
|
|
236
|
-
super(new Message().message), this.name = 'AbstractMethodError';
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
class Hash {
|
|
240
|
-
update() {
|
|
241
|
-
throw new AbstractMethodError();
|
|
242
|
-
}
|
|
243
|
-
digest() {
|
|
244
|
-
throw new AbstractMethodError();
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
let MAX_SHORT_STRING = -4 & Math.floor(16368);
|
|
248
|
-
class WasmHash {
|
|
249
|
-
exports;
|
|
250
|
-
instancesPool;
|
|
251
|
-
buffered;
|
|
252
|
-
mem;
|
|
253
|
-
chunkSize;
|
|
254
|
-
digestSize;
|
|
255
|
-
constructor(instance, instancesPool, chunkSize, digestSize){
|
|
256
|
-
let exports = instance.exports;
|
|
257
|
-
exports.init(), this.exports = exports, this.mem = Buffer.from(exports.memory.buffer, 0, 65536), this.buffered = 0, this.instancesPool = instancesPool, this.chunkSize = chunkSize, this.digestSize = digestSize;
|
|
258
|
-
}
|
|
259
|
-
reset() {
|
|
260
|
-
this.buffered = 0, this.exports.init();
|
|
261
|
-
}
|
|
262
|
-
update(data, encoding) {
|
|
263
|
-
if ('string' == typeof data) {
|
|
264
|
-
let normalizedData = data;
|
|
265
|
-
for(; normalizedData.length > MAX_SHORT_STRING;)this._updateWithShortString(normalizedData.slice(0, MAX_SHORT_STRING), encoding), normalizedData = normalizedData.slice(MAX_SHORT_STRING);
|
|
266
|
-
return this._updateWithShortString(normalizedData, encoding), this;
|
|
206
|
+
"./src/util/createHash.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
207
|
+
let createMd4, createXxhash64;
|
|
208
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
209
|
+
n: ()=>createHash_createHash
|
|
210
|
+
});
|
|
211
|
+
var external_node_util_ = __webpack_require__("node:util");
|
|
212
|
+
class WebpackError extends Error {
|
|
213
|
+
loc;
|
|
214
|
+
file;
|
|
215
|
+
chunk;
|
|
216
|
+
module;
|
|
217
|
+
details;
|
|
218
|
+
hideStack;
|
|
267
219
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
220
|
+
Object.defineProperty(WebpackError.prototype, external_node_util_.inspect.custom, {
|
|
221
|
+
value: function() {
|
|
222
|
+
return this.stack + (this.details ? `\n${this.details}` : '');
|
|
223
|
+
},
|
|
224
|
+
enumerable: !1,
|
|
225
|
+
configurable: !0
|
|
226
|
+
});
|
|
227
|
+
let lib_WebpackError = WebpackError, CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/;
|
|
228
|
+
function createMessage(method) {
|
|
229
|
+
return `Abstract method${method ? ` ${method}` : ''}. Must be overridden.`;
|
|
230
|
+
}
|
|
231
|
+
class Message extends Error {
|
|
232
|
+
constructor(){
|
|
233
|
+
super(), this.stack = void 0, Error.captureStackTrace(this);
|
|
234
|
+
const match = this.stack.split('\n')[3].match(CURRENT_METHOD_REGEXP);
|
|
235
|
+
this.message = match?.[1] ? createMessage(match[1]) : createMessage();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
class AbstractMethodError extends lib_WebpackError {
|
|
239
|
+
constructor(){
|
|
240
|
+
super(new Message().message), this.name = 'AbstractMethodError';
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
class Hash {
|
|
244
|
+
update() {
|
|
245
|
+
throw new AbstractMethodError();
|
|
246
|
+
}
|
|
247
|
+
digest() {
|
|
248
|
+
throw new AbstractMethodError();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
let MAX_SHORT_STRING = -4 & Math.floor(16368);
|
|
252
|
+
class WasmHash {
|
|
253
|
+
exports;
|
|
254
|
+
instancesPool;
|
|
255
|
+
buffered;
|
|
256
|
+
mem;
|
|
257
|
+
chunkSize;
|
|
258
|
+
digestSize;
|
|
259
|
+
constructor(instance, instancesPool, chunkSize, digestSize){
|
|
260
|
+
const exports1 = instance.exports;
|
|
261
|
+
exports1.init(), this.exports = exports1, this.mem = Buffer.from(exports1.memory.buffer, 0, 65536), this.buffered = 0, this.instancesPool = instancesPool, this.chunkSize = chunkSize, this.digestSize = digestSize;
|
|
262
|
+
}
|
|
263
|
+
reset() {
|
|
264
|
+
this.buffered = 0, this.exports.init();
|
|
265
|
+
}
|
|
266
|
+
update(data, encoding) {
|
|
267
|
+
if ('string' == typeof data) {
|
|
268
|
+
let normalizedData = data;
|
|
269
|
+
for(; normalizedData.length > MAX_SHORT_STRING;)this._updateWithShortString(normalizedData.slice(0, MAX_SHORT_STRING), encoding), normalizedData = normalizedData.slice(MAX_SHORT_STRING);
|
|
270
|
+
return this._updateWithShortString(normalizedData, encoding), this;
|
|
271
|
+
}
|
|
272
|
+
return this._updateWithBuffer(data), this;
|
|
273
|
+
}
|
|
274
|
+
_updateWithShortString(data, encoding) {
|
|
275
|
+
let endPos, { exports: exports1, buffered, mem, chunkSize } = this;
|
|
276
|
+
if (data.length < 70) if (encoding && 'utf-8' !== encoding && 'utf8' !== encoding) if ('latin1' === encoding) {
|
|
277
|
+
endPos = buffered;
|
|
278
|
+
for(let i = 0; i < data.length; i++){
|
|
279
|
+
let cc = data.charCodeAt(i);
|
|
280
|
+
mem[endPos++] = cc;
|
|
281
|
+
}
|
|
282
|
+
} else endPos = buffered + mem.write(data, buffered, encoding);
|
|
283
|
+
else {
|
|
284
|
+
endPos = buffered;
|
|
285
|
+
for(let i = 0; i < data.length; i++){
|
|
286
|
+
let cc = data.charCodeAt(i);
|
|
287
|
+
if (cc < 0x80) mem[endPos++] = cc;
|
|
288
|
+
else if (cc < 0x800) mem[endPos] = cc >> 6 | 0xc0, mem[endPos + 1] = 0x3f & cc | 0x80, endPos += 2;
|
|
289
|
+
else {
|
|
290
|
+
endPos += mem.write(data.slice(i), endPos, encoding);
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else endPos = buffered + mem.write(data, buffered, encoding);
|
|
296
|
+
if (endPos < chunkSize) this.buffered = endPos;
|
|
297
|
+
else {
|
|
298
|
+
let l = endPos & ~(this.chunkSize - 1);
|
|
299
|
+
exports1.update(l);
|
|
300
|
+
let newBuffered = endPos - l;
|
|
301
|
+
this.buffered = newBuffered, newBuffered > 0 && mem.copyWithin(0, l, endPos);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
_updateWithBuffer(data) {
|
|
305
|
+
let { exports: exports1, buffered, mem } = this, length = data.length;
|
|
306
|
+
if (buffered + length < this.chunkSize) data.copy(mem, buffered, 0, length), this.buffered += length;
|
|
285
307
|
else {
|
|
286
|
-
|
|
287
|
-
|
|
308
|
+
let l = buffered + length & ~(this.chunkSize - 1);
|
|
309
|
+
if (l > 65536) {
|
|
310
|
+
let i = 65536 - buffered;
|
|
311
|
+
data.copy(mem, buffered, 0, i), exports1.update(65536);
|
|
312
|
+
let stop = l - buffered - 65536;
|
|
313
|
+
for(; i < stop;)data.copy(mem, 0, i, i + 65536), exports1.update(65536), i += 65536;
|
|
314
|
+
data.copy(mem, 0, i, l - buffered), exports1.update(l - buffered - i);
|
|
315
|
+
} else data.copy(mem, buffered, 0, l - buffered), exports1.update(l);
|
|
316
|
+
let newBuffered = length + buffered - l;
|
|
317
|
+
this.buffered = newBuffered, newBuffered > 0 && data.copy(mem, 0, length - newBuffered, length);
|
|
288
318
|
}
|
|
289
319
|
}
|
|
320
|
+
digest(type) {
|
|
321
|
+
let { exports: exports1, buffered, mem, digestSize } = this;
|
|
322
|
+
exports1.final(buffered), this.instancesPool.push(this);
|
|
323
|
+
let hex = mem.toString('latin1', 0, digestSize);
|
|
324
|
+
return 'hex' === type ? hex : 'binary' !== type && type ? Buffer.from(hex, 'hex').toString(type) : Buffer.from(hex, 'hex');
|
|
325
|
+
}
|
|
290
326
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
327
|
+
let wasm_hash = (wasmModule, instancesPool, chunkSize, digestSize)=>{
|
|
328
|
+
if (instancesPool.length > 0) {
|
|
329
|
+
let old = instancesPool.pop();
|
|
330
|
+
return old.reset(), old;
|
|
331
|
+
}
|
|
332
|
+
return new WasmHash(new WebAssembly.Instance(wasmModule), instancesPool, chunkSize, digestSize);
|
|
333
|
+
}, digestCaches = {};
|
|
334
|
+
class BulkUpdateDecorator extends Hash {
|
|
335
|
+
hash;
|
|
336
|
+
hashFactory;
|
|
337
|
+
hashKey;
|
|
338
|
+
buffer;
|
|
339
|
+
constructor(hashOrFactory, hashKey){
|
|
340
|
+
super(), this.hashKey = hashKey, 'function' == typeof hashOrFactory ? (this.hashFactory = hashOrFactory, this.hash = void 0) : (this.hashFactory = void 0, this.hash = hashOrFactory), this.buffer = '';
|
|
341
|
+
}
|
|
342
|
+
update(data, inputEncoding) {
|
|
343
|
+
return void 0 !== inputEncoding || 'string' != typeof data || data.length > 2000 ? (void 0 === this.hash && (this.hash = this.hashFactory()), this.buffer.length > 0 && (this.hash.update(Buffer.from(this.buffer)), this.buffer = ''), Buffer.isBuffer(data) ? this.hash.update(data) : this.hash.update(data, inputEncoding)) : (this.buffer += data, this.buffer.length > 2000 && (void 0 === this.hash && (this.hash = this.hashFactory()), this.hash.update(Buffer.from(this.buffer)), this.buffer = '')), this;
|
|
344
|
+
}
|
|
345
|
+
digest(encoding) {
|
|
346
|
+
let digestCache, buffer = this.buffer;
|
|
347
|
+
if (void 0 === this.hash) {
|
|
348
|
+
let cacheKey = `${this.hashKey}-${encoding}`;
|
|
349
|
+
void 0 === (digestCache = digestCaches[cacheKey]) && (digestCache = digestCaches[cacheKey] = new Map());
|
|
350
|
+
let cacheEntry = digestCache.get(buffer);
|
|
351
|
+
if (void 0 !== cacheEntry) return encoding ? cacheEntry : Buffer.from(cacheEntry, 'hex');
|
|
352
|
+
this.hash = this.hashFactory();
|
|
353
|
+
}
|
|
354
|
+
buffer.length > 0 && this.hash.update(Buffer.from(buffer));
|
|
355
|
+
let result = encoding ? this.hash.digest(encoding) : this.hash.digest();
|
|
356
|
+
return void 0 !== digestCache && 'string' == typeof result && digestCache.set(buffer, result), result;
|
|
357
|
+
}
|
|
298
358
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
let newBuffered = length + buffered - l;
|
|
313
|
-
this.buffered = newBuffered, newBuffered > 0 && data.copy(mem, 0, length - newBuffered, length);
|
|
359
|
+
class DebugHash extends Hash {
|
|
360
|
+
string;
|
|
361
|
+
constructor(){
|
|
362
|
+
super(), this.string = '';
|
|
363
|
+
}
|
|
364
|
+
update(data) {
|
|
365
|
+
let normalizedData;
|
|
366
|
+
return (normalizedData = Buffer.isBuffer(data) ? data.toString('utf-8') : data).startsWith('debug-digest-') && (normalizedData = Buffer.from(normalizedData.slice(13), 'hex').toString()), this.string += `[${normalizedData}](${Error().stack?.split('\n', 3)[2]})\n`, this;
|
|
367
|
+
}
|
|
368
|
+
digest(encoding) {
|
|
369
|
+
let result = `debug-digest-${Buffer.from(this.string).toString('hex')}`;
|
|
370
|
+
return encoding ? result : Buffer.from(result);
|
|
371
|
+
}
|
|
314
372
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
return old.reset(), old;
|
|
327
|
-
}
|
|
328
|
-
return new WasmHash(new WebAssembly.Instance(wasmModule), instancesPool, chunkSize, digestSize);
|
|
329
|
-
}, createHash_require = createRequire(import.meta.url), digestCaches = {};
|
|
330
|
-
class BulkUpdateDecorator extends Hash {
|
|
331
|
-
hash;
|
|
332
|
-
hashFactory;
|
|
333
|
-
hashKey;
|
|
334
|
-
buffer;
|
|
335
|
-
constructor(hashOrFactory, hashKey){
|
|
336
|
-
super(), this.hashKey = hashKey, 'function' == typeof hashOrFactory ? (this.hashFactory = hashOrFactory, this.hash = void 0) : (this.hashFactory = void 0, this.hash = hashOrFactory), this.buffer = '';
|
|
337
|
-
}
|
|
338
|
-
update(data, inputEncoding) {
|
|
339
|
-
return void 0 !== inputEncoding || 'string' != typeof data || data.length > 2000 ? (void 0 === this.hash && (this.hash = this.hashFactory()), this.buffer.length > 0 && (this.hash.update(Buffer.from(this.buffer)), this.buffer = ''), Buffer.isBuffer(data) ? this.hash.update(data) : this.hash.update(data, inputEncoding)) : (this.buffer += data, this.buffer.length > 2000 && (void 0 === this.hash && (this.hash = this.hashFactory()), this.hash.update(Buffer.from(this.buffer)), this.buffer = '')), this;
|
|
340
|
-
}
|
|
341
|
-
digest(encoding) {
|
|
342
|
-
let digestCache, buffer = this.buffer;
|
|
343
|
-
if (void 0 === this.hash) {
|
|
344
|
-
let cacheKey = `${this.hashKey}-${encoding}`;
|
|
345
|
-
void 0 === (digestCache = digestCaches[cacheKey]) && (digestCache = digestCaches[cacheKey] = new Map());
|
|
346
|
-
let cacheEntry = digestCache.get(buffer);
|
|
347
|
-
if (void 0 !== cacheEntry) return encoding ? cacheEntry : Buffer.from(cacheEntry, 'hex');
|
|
348
|
-
this.hash = this.hashFactory();
|
|
373
|
+
class WasmHashAdapter extends Hash {
|
|
374
|
+
wasmHash;
|
|
375
|
+
constructor(wasmHash){
|
|
376
|
+
super(), this.wasmHash = wasmHash;
|
|
377
|
+
}
|
|
378
|
+
update(data, inputEncoding) {
|
|
379
|
+
return Buffer.isBuffer(data) ? this.wasmHash.update(data) : this.wasmHash.update(data, inputEncoding), this;
|
|
380
|
+
}
|
|
381
|
+
digest(encoding) {
|
|
382
|
+
return encoding ? this.wasmHash.digest(encoding) : this.wasmHash.digest();
|
|
383
|
+
}
|
|
349
384
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
return new BulkUpdateDecorator(()=>{
|
|
409
|
-
let { createHash } = createHash_require('node:crypto');
|
|
410
|
-
return createHash(algorithm);
|
|
411
|
-
}, algorithm);
|
|
412
|
-
}
|
|
413
|
-
}, WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>'' === relativePath ? './.' : '..' === relativePath ? '../.' : relativePath.startsWith('../') ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
|
|
414
|
-
if ('/' === maybeAbsolutePath[0]) {
|
|
415
|
-
if (maybeAbsolutePath.length > 1 && '/' === maybeAbsolutePath[maybeAbsolutePath.length - 1]) return maybeAbsolutePath;
|
|
416
|
-
let querySplitPos = maybeAbsolutePath.indexOf('?'), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
417
|
-
return resource = relativePathToRequest(node_path.posix.relative(context, resource)), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
|
418
|
-
}
|
|
419
|
-
if (WINDOWS_ABS_PATH_REGEXP.test(maybeAbsolutePath)) {
|
|
420
|
-
let querySplitPos = maybeAbsolutePath.indexOf('?'), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
421
|
-
return resource = node_path.win32.relative(context, resource), WINDOWS_ABS_PATH_REGEXP.test(resource) || (resource = relativePathToRequest(resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, '/'))), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
|
422
|
-
}
|
|
423
|
-
return maybeAbsolutePath;
|
|
424
|
-
}, makeCacheable = (realFn)=>{
|
|
425
|
-
let cache = new WeakMap(), getCache = (associatedObjectForCache)=>{
|
|
426
|
-
let entry = cache.get(associatedObjectForCache);
|
|
427
|
-
if (void 0 !== entry) return entry;
|
|
428
|
-
let map = new Map();
|
|
429
|
-
return cache.set(associatedObjectForCache, map), map;
|
|
430
|
-
}, fn = (str, associatedObjectForCache)=>{
|
|
431
|
-
if (!associatedObjectForCache) return realFn(str);
|
|
432
|
-
let cache = getCache(associatedObjectForCache), entry = cache.get(str);
|
|
433
|
-
if (void 0 !== entry) return entry;
|
|
434
|
-
let result = realFn(str);
|
|
435
|
-
return cache.set(str, result), result;
|
|
385
|
+
let createHash_createHash = (algorithm)=>{
|
|
386
|
+
if ('function' == typeof algorithm) return new BulkUpdateDecorator(()=>new algorithm());
|
|
387
|
+
switch(algorithm){
|
|
388
|
+
case 'debug':
|
|
389
|
+
return new DebugHash();
|
|
390
|
+
case 'xxhash64':
|
|
391
|
+
return new WasmHashAdapter((()=>{
|
|
392
|
+
if (!createXxhash64) {
|
|
393
|
+
let xxhash64 = new WebAssembly.Module(Buffer.from('AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL', 'base64'));
|
|
394
|
+
createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
|
|
395
|
+
}
|
|
396
|
+
return createXxhash64();
|
|
397
|
+
})());
|
|
398
|
+
case 'md4':
|
|
399
|
+
return new WasmHashAdapter((()=>{
|
|
400
|
+
if (!createMd4) {
|
|
401
|
+
let md4 = new WebAssembly.Module(Buffer.from('AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqLEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvSCgEZfyMBIQUjAiECIwMhAyMEIQQDQCAAIAFLBEAgASgCJCISIAEoAiAiEyABKAIcIgkgASgCGCIIIAEoAhQiByABKAIQIg4gASgCDCIGIAEoAggiDyABKAIEIhAgASgCACIRIAMgBHMgAnEgBHMgBWpqQQN3IgogAiADc3EgA3MgBGpqQQd3IgsgAiAKc3EgAnMgA2pqQQt3IgwgCiALc3EgCnMgAmpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IgogDCANc3EgDHMgC2pqQQd3IgsgCiANc3EgDXMgDGpqQQt3IgwgCiALc3EgCnMgDWpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IhQgDCANc3EgDHMgC2pqQQd3IRUgASgCLCILIAEoAigiCiAMIA0gDSAUcyAVcXNqakELdyIWIBQgFXNxIBRzIA1qakETdyEXIAEoAjQiGCABKAIwIhkgFSAWcyAXcSAVcyAUampBA3ciFCAWIBdzcSAWcyAVampBB3chFSABKAI8Ig0gASgCOCIMIBQgF3MgFXEgF3MgFmpqQQt3IhYgFCAVc3EgFHMgF2pqQRN3IRcgEyAOIBEgFCAVIBZyIBdxIBUgFnFyampBmfOJ1AVqQQN3IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEFdyIVIBQgF3JxIBQgF3FyIBZqakGZ84nUBWpBCXchFiAPIBggEiAWIAcgFSAQIBQgGSAUIBVyIBZxIBQgFXFyIBdqakGZ84nUBWpBDXciFCAVIBZycSAVIBZxcmpqQZnzidQFakEDdyIVIBQgFnJxIBQgFnFyampBmfOJ1AVqQQV3IhcgFCAVcnEgFCAVcXJqakGZ84nUBWpBCXciFiAVIBdycSAVIBdxciAUampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEDdyEVIBEgBiAVIAwgFCAKIBYgCCAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFyAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIWIBUgF3JxIBUgF3FyampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXJqakGZ84nUBWpBA3ciFSALIBYgCSAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFiAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIXIA0gFSAWciAXcSAVIBZxciAUampBmfOJ1AVqQQ13IhRzIBZzampBodfn9gZqQQN3IREgByAIIA4gFCARIBcgESAUc3MgFmogE2pBodfn9gZqQQl3IhNzcyAXampBodfn9gZqQQt3Ig4gDyARIBMgDiARIA4gE3NzIBRqIBlqQaHX5/YGakEPdyIRc3NqakGh1+f2BmpBA3ciDyAOIA8gEXNzIBNqIApqQaHX5/YGakEJdyIKcyARc2pqQaHX5/YGakELdyIIIBAgDyAKIAggDCAPIAggCnNzIBFqakGh1+f2BmpBD3ciDHNzampBodfn9gZqQQN3Ig4gEiAIIAwgDnNzIApqakGh1+f2BmpBCXciCHMgDHNqakGh1+f2BmpBC3chByAFIAYgCCAHIBggDiAHIAhzcyAMampBodfn9gZqQQ93IgpzcyAOampBodfn9gZqQQN3IgZqIQUgDSAGIAkgByAGIAsgByAGIApzcyAIampBodfn9gZqQQl3IgdzIApzampBodfn9gZqQQt3IgYgB3NzIApqakGh1+f2BmpBD3cgAmohAiADIAZqIQMgBCAHaiEEIAFBQGshAQwBCwsgBSQBIAIkAiADJAMgBCQECw0AIAAQASAAIwBqJAAL/wQCA38BfiAAIwBqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=', 'base64'));
|
|
402
|
+
createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
|
|
403
|
+
}
|
|
404
|
+
return createMd4();
|
|
405
|
+
})());
|
|
406
|
+
case 'native-md4':
|
|
407
|
+
return new BulkUpdateDecorator(()=>{
|
|
408
|
+
let { createHash } = __webpack_require__("node:crypto");
|
|
409
|
+
return createHash('md4');
|
|
410
|
+
}, 'md4');
|
|
411
|
+
default:
|
|
412
|
+
return new BulkUpdateDecorator(()=>{
|
|
413
|
+
let { createHash } = __webpack_require__("node:crypto");
|
|
414
|
+
return createHash(algorithm);
|
|
415
|
+
}, algorithm);
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
},
|
|
419
|
+
"@rspack/binding" (module) {
|
|
420
|
+
module.exports = require("@rspack/binding");
|
|
421
|
+
},
|
|
422
|
+
"node:crypto" (module) {
|
|
423
|
+
module.exports = require("node:crypto");
|
|
424
|
+
},
|
|
425
|
+
"node:fs" (module) {
|
|
426
|
+
module.exports = require("node:fs");
|
|
427
|
+
},
|
|
428
|
+
"node:os" (module) {
|
|
429
|
+
module.exports = require("node:os");
|
|
430
|
+
},
|
|
431
|
+
"node:url" (module) {
|
|
432
|
+
module.exports = require("node:url");
|
|
433
|
+
},
|
|
434
|
+
"node:util" (module) {
|
|
435
|
+
module.exports = require("node:util");
|
|
436
|
+
}
|
|
437
|
+
}, __webpack_module_cache__ = {};
|
|
438
|
+
function __webpack_require__(moduleId) {
|
|
439
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
440
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
441
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
442
|
+
exports: {}
|
|
436
443
|
};
|
|
437
|
-
return
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
444
|
+
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
445
|
+
}
|
|
446
|
+
__webpack_require__.n = (module)=>{
|
|
447
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
448
|
+
return __webpack_require__.d(getter, {
|
|
449
|
+
a: getter
|
|
450
|
+
}), getter;
|
|
451
|
+
}, __webpack_require__.d = (exports1, definition)=>{
|
|
452
|
+
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
|
|
453
|
+
enumerable: !0,
|
|
454
|
+
get: definition[key]
|
|
455
|
+
});
|
|
456
|
+
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
|
|
457
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
458
|
+
value: 'Module'
|
|
459
|
+
}), Object.defineProperty(exports1, '__esModule', {
|
|
460
|
+
value: !0
|
|
461
|
+
});
|
|
462
|
+
};
|
|
463
|
+
var __webpack_exports__ = {};
|
|
464
|
+
for(var __rspack_i in (()=>{
|
|
465
|
+
let url;
|
|
466
|
+
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
|
|
467
|
+
default: ()=>loader_runner_worker
|
|
468
|
+
});
|
|
469
|
+
let external_node_querystring_namespaceObject = require("node:querystring");
|
|
470
|
+
var external_node_querystring_default = __webpack_require__.n(external_node_querystring_namespaceObject), external_node_util_ = __webpack_require__("node:util");
|
|
471
|
+
let external_node_worker_threads_namespaceObject = require("node:worker_threads");
|
|
472
|
+
var binding_ = __webpack_require__("@rspack/binding"), createHash = __webpack_require__("./src/util/createHash.ts");
|
|
473
|
+
let external_node_path_namespaceObject = require("node:path");
|
|
474
|
+
var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject);
|
|
475
|
+
let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>'' === relativePath ? './.' : '..' === relativePath ? '../.' : relativePath.startsWith('../') ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
|
|
476
|
+
if ('/' === maybeAbsolutePath[0]) {
|
|
477
|
+
if (maybeAbsolutePath.length > 1 && '/' === maybeAbsolutePath[maybeAbsolutePath.length - 1]) return maybeAbsolutePath;
|
|
478
|
+
let querySplitPos = maybeAbsolutePath.indexOf('?'), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
479
|
+
return resource = relativePathToRequest(external_node_path_default().posix.relative(context, resource)), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
|
480
|
+
}
|
|
481
|
+
if (WINDOWS_ABS_PATH_REGEXP.test(maybeAbsolutePath)) {
|
|
482
|
+
let querySplitPos = maybeAbsolutePath.indexOf('?'), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
483
|
+
return resource = external_node_path_default().win32.relative(context, resource), WINDOWS_ABS_PATH_REGEXP.test(resource) || (resource = relativePathToRequest(resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, '/'))), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
|
484
|
+
}
|
|
485
|
+
return maybeAbsolutePath;
|
|
486
|
+
}, makeCacheable = (realFn)=>{
|
|
487
|
+
let cache = new WeakMap(), getCache = (associatedObjectForCache)=>{
|
|
488
|
+
let entry = cache.get(associatedObjectForCache);
|
|
489
|
+
if (void 0 !== entry) return entry;
|
|
490
|
+
let map = new Map();
|
|
491
|
+
return cache.set(associatedObjectForCache, map), map;
|
|
492
|
+
}, fn = (str, associatedObjectForCache)=>{
|
|
493
|
+
if (!associatedObjectForCache) return realFn(str);
|
|
494
|
+
let cache = getCache(associatedObjectForCache), entry = cache.get(str);
|
|
441
495
|
if (void 0 !== entry) return entry;
|
|
442
496
|
let result = realFn(str);
|
|
443
497
|
return cache.set(str, result), result;
|
|
444
498
|
};
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
let innerCache;
|
|
459
|
-
return associatedObjectForCache ? void 0 === (innerCache = cache.get(associatedObjectForCache)) && (innerCache = new Map(), cache.set(associatedObjectForCache, innerCache)) : innerCache = new Map(), (context, identifier)=>{
|
|
460
|
-
let cachedResult, innerSubCache = innerCache?.get(context);
|
|
461
|
-
if (void 0 === innerSubCache ? (innerSubCache = new Map(), innerCache?.set(context, innerSubCache)) : cachedResult = innerSubCache.get(identifier), void 0 !== cachedResult) return cachedResult;
|
|
462
|
-
let result = fn(context, identifier);
|
|
463
|
-
return innerSubCache.set(identifier, result), result;
|
|
464
|
-
};
|
|
465
|
-
}, cachedFn.bindContextCache = (context, associatedObjectForCache)=>{
|
|
466
|
-
let innerSubCache;
|
|
467
|
-
if (associatedObjectForCache) {
|
|
499
|
+
return fn.bindCache = (associatedObjectForCache)=>{
|
|
500
|
+
let cache = getCache(associatedObjectForCache);
|
|
501
|
+
return (str)=>{
|
|
502
|
+
let entry = cache.get(str);
|
|
503
|
+
if (void 0 !== entry) return entry;
|
|
504
|
+
let result = realFn(str);
|
|
505
|
+
return cache.set(str, result), result;
|
|
506
|
+
};
|
|
507
|
+
}, fn;
|
|
508
|
+
}, makeCacheableWithContext = (fn)=>{
|
|
509
|
+
let cache = new WeakMap(), cachedFn = (context, identifier, associatedObjectForCache)=>{
|
|
510
|
+
let cachedResult;
|
|
511
|
+
if (!associatedObjectForCache) return fn(context, identifier);
|
|
468
512
|
let innerCache = cache.get(associatedObjectForCache);
|
|
469
|
-
void 0 === innerCache && (innerCache = new Map(), cache.set(associatedObjectForCache, innerCache))
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
let cachedResult = innerSubCache?.get(identifier);
|
|
473
|
-
if (void 0 !== cachedResult) return cachedResult;
|
|
513
|
+
void 0 === innerCache && (innerCache = new Map(), cache.set(associatedObjectForCache, innerCache));
|
|
514
|
+
let innerSubCache = innerCache.get(context);
|
|
515
|
+
if (void 0 === innerSubCache ? innerCache.set(context, innerSubCache = new Map()) : cachedResult = innerSubCache.get(identifier), void 0 !== cachedResult) return cachedResult;
|
|
474
516
|
let result = fn(context, identifier);
|
|
475
|
-
return innerSubCache
|
|
517
|
+
return innerSubCache.set(identifier, result), result;
|
|
476
518
|
};
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
let
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
519
|
+
return cachedFn.bindCache = (associatedObjectForCache)=>{
|
|
520
|
+
let innerCache;
|
|
521
|
+
return associatedObjectForCache ? void 0 === (innerCache = cache.get(associatedObjectForCache)) && (innerCache = new Map(), cache.set(associatedObjectForCache, innerCache)) : innerCache = new Map(), (context, identifier)=>{
|
|
522
|
+
let cachedResult, innerSubCache = innerCache?.get(context);
|
|
523
|
+
if (void 0 === innerSubCache ? (innerSubCache = new Map(), innerCache?.set(context, innerSubCache)) : cachedResult = innerSubCache.get(identifier), void 0 !== cachedResult) return cachedResult;
|
|
524
|
+
let result = fn(context, identifier);
|
|
525
|
+
return innerSubCache.set(identifier, result), result;
|
|
526
|
+
};
|
|
527
|
+
}, cachedFn.bindContextCache = (context, associatedObjectForCache)=>{
|
|
528
|
+
let innerSubCache;
|
|
529
|
+
if (associatedObjectForCache) {
|
|
530
|
+
let innerCache = cache.get(associatedObjectForCache);
|
|
531
|
+
void 0 === innerCache && (innerCache = new Map(), cache.set(associatedObjectForCache, innerCache)), void 0 === (innerSubCache = innerCache.get(context)) && innerCache.set(context, innerSubCache = new Map());
|
|
532
|
+
} else innerSubCache = new Map();
|
|
533
|
+
return (identifier)=>{
|
|
534
|
+
let cachedResult = innerSubCache?.get(identifier);
|
|
535
|
+
if (void 0 !== cachedResult) return cachedResult;
|
|
536
|
+
let result = fn(context, identifier);
|
|
537
|
+
return innerSubCache?.set(identifier, result), result;
|
|
538
|
+
};
|
|
539
|
+
}, cachedFn;
|
|
495
540
|
};
|
|
496
|
-
|
|
497
|
-
let
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
},
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
541
|
+
makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join(''));
|
|
542
|
+
let contextify = makeCacheableWithContext((context, request)=>request.split('!').map((r)=>absoluteToRequest(context, r)).join('!')), absolutify = makeCacheableWithContext((context, request)=>request.split('!').map((r)=>{
|
|
543
|
+
var context1, relativePath;
|
|
544
|
+
return context1 = context, (relativePath = r).startsWith('./') || relativePath.startsWith('../') ? external_node_path_default().join(context1, relativePath) : relativePath;
|
|
545
|
+
}).join('!')), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/;
|
|
546
|
+
makeCacheable((str)=>{
|
|
547
|
+
let match = PATH_QUERY_FRAGMENT_REGEXP.exec(str);
|
|
548
|
+
return {
|
|
549
|
+
resource: str,
|
|
550
|
+
path: match[1].replace(/\u200b(.)/g, '$1'),
|
|
551
|
+
query: match[2] ? match[2].replace(/\u200b(.)/g, '$1') : '',
|
|
552
|
+
fragment: match[3] || ''
|
|
553
|
+
};
|
|
554
|
+
}), makeCacheable((str)=>{
|
|
555
|
+
let match = PATH_QUERY_REGEXP.exec(str);
|
|
556
|
+
return {
|
|
557
|
+
resource: str,
|
|
558
|
+
path: match[1].replace(/\u200b(.)/g, '$1'),
|
|
559
|
+
query: match[2] ? match[2].replace(/\u200b(.)/g, '$1') : ''
|
|
560
|
+
};
|
|
561
|
+
});
|
|
562
|
+
let memoize = (fn)=>{
|
|
563
|
+
let result, cache = !1, callback = fn;
|
|
564
|
+
return ()=>(cache || (result = callback(), cache = !0, callback = void 0), result);
|
|
565
|
+
}, LoaderLoadingError = class extends Error {
|
|
566
|
+
constructor(message){
|
|
567
|
+
super(message), this.name = 'LoaderRunnerError', Error.captureStackTrace(this, this.constructor);
|
|
521
568
|
}
|
|
522
|
-
return handleResult(loader, module, callback);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
function handleResult(loader, module, callback) {
|
|
526
|
-
return 'function' != typeof module && 'object' != typeof module ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (export function or es6 module)`)) : (loader.normal = 'function' == typeof module ? module : module.default, loader.pitch = module.pitch, loader.raw = module.raw, loader.pitch || (loader.noPitch = !0), 'function' != typeof loader.normal && 'function' != typeof loader.pitch) ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (must have normal or pitch function)`)) : void callback();
|
|
527
|
-
}
|
|
528
|
-
function isWorkerResponseMessage(message) {
|
|
529
|
-
return 'response' === message.type;
|
|
530
|
-
}
|
|
531
|
-
function serializeError(error) {
|
|
532
|
-
if (error instanceof Error || error && 'object' == typeof error && 'message' in error) return {
|
|
533
|
-
...error,
|
|
534
|
-
name: error.name,
|
|
535
|
-
stack: error.stack,
|
|
536
|
-
message: error.message
|
|
537
|
-
};
|
|
538
|
-
if ('string' == typeof error) return {
|
|
539
|
-
name: 'Error',
|
|
540
|
-
message: error
|
|
541
569
|
};
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
if (isDone) {
|
|
551
|
-
if (reportedError) return;
|
|
552
|
-
throw Error('async(): The callback was already called.');
|
|
570
|
+
function loadLoader(loader, compiler, callback) {
|
|
571
|
+
if ('module' === loader.type) try {
|
|
572
|
+
void 0 === url && (url = __webpack_require__("node:url")), import(url.pathToFileURL(loader.path).toString()).then((module)=>{
|
|
573
|
+
handleResult(loader, module, callback);
|
|
574
|
+
}, callback);
|
|
575
|
+
return;
|
|
576
|
+
} catch (e) {
|
|
577
|
+
callback(e);
|
|
553
578
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
579
|
+
else {
|
|
580
|
+
let module;
|
|
581
|
+
try {
|
|
582
|
+
module = require(loader.path);
|
|
583
|
+
} catch (e) {
|
|
584
|
+
if (e instanceof Error && 'EMFILE' === e.code) return void setImmediate(loadLoader.bind(null, loader, compiler, callback));
|
|
585
|
+
return callback(e);
|
|
586
|
+
}
|
|
587
|
+
return handleResult(loader, module, callback);
|
|
560
588
|
}
|
|
561
|
-
|
|
589
|
+
}
|
|
590
|
+
function handleResult(loader, module, callback) {
|
|
591
|
+
return 'function' != typeof module && 'object' != typeof module ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (export function or es6 module)`)) : (loader.normal = 'function' == typeof module ? module : module.default, loader.pitch = module.pitch, loader.raw = module.raw, loader.pitch || (loader.noPitch = !0), 'function' != typeof loader.normal && 'function' != typeof loader.pitch) ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (must have normal or pitch function)`)) : void callback();
|
|
592
|
+
}
|
|
593
|
+
function isWorkerResponseMessage(message) {
|
|
594
|
+
return 'response' === message.type;
|
|
595
|
+
}
|
|
596
|
+
function serializeError(error) {
|
|
597
|
+
if (error instanceof Error || error && 'object' == typeof error && 'message' in error) return {
|
|
598
|
+
...error,
|
|
599
|
+
name: error.name,
|
|
600
|
+
stack: error.stack,
|
|
601
|
+
message: error.message
|
|
602
|
+
};
|
|
603
|
+
if ('string' == typeof error) return {
|
|
604
|
+
name: 'Error',
|
|
605
|
+
message: error
|
|
606
|
+
};
|
|
607
|
+
throw Error('Failed to serialize error, only string, Error instances and objects with a message property are supported');
|
|
608
|
+
}
|
|
609
|
+
let decoder = new TextDecoder();
|
|
610
|
+
(0, external_node_util_.promisify)(loadLoader);
|
|
611
|
+
let utils_runSyncOrAsync = (0, external_node_util_.promisify)(function(fn, context, args, callback) {
|
|
612
|
+
let isSync = !0, isDone = !1, isError = !1, reportedError = !1;
|
|
613
|
+
context.async = function() {
|
|
614
|
+
if (isDone) {
|
|
615
|
+
if (reportedError) return;
|
|
616
|
+
throw Error('async(): The callback was already called.');
|
|
617
|
+
}
|
|
618
|
+
return isSync = !1, innerCallback;
|
|
619
|
+
};
|
|
620
|
+
let innerCallback = (err, ...args)=>{
|
|
621
|
+
if (isDone) {
|
|
622
|
+
if (reportedError) return;
|
|
623
|
+
throw Error('callback(): The callback was already called.');
|
|
624
|
+
}
|
|
625
|
+
isDone = !0, isSync = !1;
|
|
626
|
+
try {
|
|
627
|
+
callback(err, args);
|
|
628
|
+
} catch (e) {
|
|
629
|
+
throw isError = !0, e;
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
context.callback = innerCallback;
|
|
562
633
|
try {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
if (isSync) {
|
|
572
|
-
if (isDone = !0, void 0 === result) return void callback(null, []);
|
|
573
|
-
if (result && 'object' == typeof result && 'function' == typeof result.then) return void result.then((r)=>{
|
|
634
|
+
let result = fn.apply(context, args);
|
|
635
|
+
if (isSync) {
|
|
636
|
+
if (isDone = !0, void 0 === result) return void callback(null, []);
|
|
637
|
+
if (result && 'object' == typeof result && 'function' == typeof result.then) return void result.then((r)=>{
|
|
638
|
+
callback(null, [
|
|
639
|
+
r
|
|
640
|
+
]);
|
|
641
|
+
}, callback);
|
|
574
642
|
callback(null, [
|
|
575
|
-
|
|
643
|
+
result
|
|
576
644
|
]);
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return;
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
} catch (e) {
|
|
648
|
+
if ('hideStack' in e && e.hideStack && (e.hideStack = 'true'), isError) throw e;
|
|
649
|
+
if (isDone) return void (e instanceof Error ? console.error(e.stack) : console.error(e));
|
|
650
|
+
isDone = !0, reportedError = !0, callback(e, []);
|
|
582
651
|
}
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
652
|
+
}), loadLoaderAsync = (0, external_node_util_.promisify)(loadLoader);
|
|
653
|
+
async function loaderImpl({ args, loaderContext, loaderState }, sendRequest, waitForPendingRequest) {
|
|
654
|
+
let resourcePath = loaderContext.resourcePath, contextDirectory = resourcePath ? function(path) {
|
|
655
|
+
if ('/' === path) return '/';
|
|
656
|
+
let i = path.lastIndexOf('/'), j = path.lastIndexOf('\\'), i2 = path.indexOf('/'), j2 = path.indexOf('\\'), idx = i > j ? i : j, idx2 = i > j ? i2 : j2;
|
|
657
|
+
return idx < 0 ? path : idx === idx2 ? path.slice(0, idx + 1) : path.slice(0, idx);
|
|
658
|
+
}(resourcePath) : null, pendingDependencyRequest = [];
|
|
659
|
+
loaderContext.parallel = !0, loaderContext.dependency = loaderContext.addDependency = function(file) {
|
|
660
|
+
pendingDependencyRequest.push(sendRequest("AddDependency", file));
|
|
661
|
+
}, loaderContext.addContextDependency = function(context) {
|
|
662
|
+
pendingDependencyRequest.push(sendRequest("AddContextDependency", context));
|
|
663
|
+
}, loaderContext.addBuildDependency = function(file) {
|
|
664
|
+
pendingDependencyRequest.push(sendRequest("AddBuildDependency", file));
|
|
665
|
+
}, loaderContext.getDependencies = function() {
|
|
666
|
+
return waitForPendingRequest(pendingDependencyRequest), sendRequest("GetDependencies").wait();
|
|
667
|
+
}, loaderContext.getContextDependencies = function() {
|
|
668
|
+
return waitForPendingRequest(pendingDependencyRequest), sendRequest("GetContextDependencies").wait();
|
|
669
|
+
}, loaderContext.getMissingDependencies = function() {
|
|
670
|
+
return waitForPendingRequest(pendingDependencyRequest), sendRequest("GetMissingDependencies").wait();
|
|
671
|
+
}, loaderContext.clearDependencies = function() {
|
|
672
|
+
pendingDependencyRequest.push(sendRequest("ClearDependencies"));
|
|
673
|
+
}, loaderContext.resolve = function(context, request, callback) {
|
|
674
|
+
sendRequest("Resolve", context, request).then((result)=>{
|
|
675
|
+
callback(null, result);
|
|
676
|
+
}, (err)=>{
|
|
677
|
+
callback(err);
|
|
678
|
+
});
|
|
679
|
+
}, loaderContext.getResolve = function(options) {
|
|
680
|
+
return (context, request, callback)=>{
|
|
681
|
+
if (!callback) return new Promise((resolve, reject)=>{
|
|
682
|
+
sendRequest("GetResolve", options, context, request).then((result)=>{
|
|
683
|
+
resolve(result);
|
|
684
|
+
}, (err)=>{
|
|
685
|
+
reject(err);
|
|
686
|
+
});
|
|
687
|
+
});
|
|
618
688
|
sendRequest("GetResolve", options, context, request).then((result)=>{
|
|
689
|
+
callback(null, result);
|
|
690
|
+
}, (err)=>{
|
|
691
|
+
callback(err);
|
|
692
|
+
});
|
|
693
|
+
};
|
|
694
|
+
}, loaderContext.getLogger = function(name) {
|
|
695
|
+
return {
|
|
696
|
+
error (...args) {
|
|
697
|
+
sendRequest("GetLogger", 'error', name, args);
|
|
698
|
+
},
|
|
699
|
+
warn (...args) {
|
|
700
|
+
sendRequest("GetLogger", 'warn', name, args);
|
|
701
|
+
},
|
|
702
|
+
info (...args) {
|
|
703
|
+
sendRequest("GetLogger", 'info', name, args);
|
|
704
|
+
},
|
|
705
|
+
log (...args) {
|
|
706
|
+
sendRequest("GetLogger", 'log', name, args);
|
|
707
|
+
},
|
|
708
|
+
debug (...args) {
|
|
709
|
+
sendRequest("GetLogger", 'debug', name, args);
|
|
710
|
+
},
|
|
711
|
+
assert (assertion, ...args) {
|
|
712
|
+
assertion || sendRequest("GetLogger", 'error', name, args);
|
|
713
|
+
},
|
|
714
|
+
trace () {
|
|
715
|
+
sendRequest("GetLogger", 'trace', name, [
|
|
716
|
+
'Trace'
|
|
717
|
+
]);
|
|
718
|
+
},
|
|
719
|
+
clear () {
|
|
720
|
+
sendRequest("GetLogger", 'clear', name);
|
|
721
|
+
},
|
|
722
|
+
status (...args) {
|
|
723
|
+
sendRequest("GetLogger", 'status', name, args);
|
|
724
|
+
},
|
|
725
|
+
group (...args) {
|
|
726
|
+
sendRequest("GetLogger", 'group', name, args);
|
|
727
|
+
},
|
|
728
|
+
groupCollapsed (...args) {
|
|
729
|
+
sendRequest("GetLogger", 'groupCollapsed', name, args);
|
|
730
|
+
},
|
|
731
|
+
groupEnd (...args) {
|
|
732
|
+
sendRequest("GetLogger", 'groupEnd', name, args);
|
|
733
|
+
},
|
|
734
|
+
profile (label) {
|
|
735
|
+
sendRequest("GetLogger", 'profile', name, [
|
|
736
|
+
label
|
|
737
|
+
]);
|
|
738
|
+
},
|
|
739
|
+
profileEnd (label) {
|
|
740
|
+
sendRequest("GetLogger", 'profileEnd', name, [
|
|
741
|
+
label
|
|
742
|
+
]);
|
|
743
|
+
},
|
|
744
|
+
time (label) {
|
|
745
|
+
sendRequest("GetLogger", 'time', name, [
|
|
746
|
+
label
|
|
747
|
+
]);
|
|
748
|
+
},
|
|
749
|
+
timeEnd (label) {
|
|
750
|
+
sendRequest("GetLogger", 'timeEnd', name, [
|
|
751
|
+
label
|
|
752
|
+
]);
|
|
753
|
+
},
|
|
754
|
+
timeLog (label, ...args) {
|
|
755
|
+
sendRequest("GetLogger", 'timeLog', name, [
|
|
756
|
+
label,
|
|
757
|
+
...args
|
|
758
|
+
]);
|
|
759
|
+
},
|
|
760
|
+
timeAggregate (label) {
|
|
761
|
+
sendRequest("GetLogger", 'timeAggregate', name, [
|
|
762
|
+
label
|
|
763
|
+
]);
|
|
764
|
+
},
|
|
765
|
+
timeAggregateEnd (label) {
|
|
766
|
+
sendRequest("GetLogger", 'timeAggregateEnd', name, [
|
|
767
|
+
label
|
|
768
|
+
]);
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
}, loaderContext.emitError = function(err) {
|
|
772
|
+
sendRequest("EmitError", serializeError(err));
|
|
773
|
+
}, loaderContext.emitWarning = function(warning) {
|
|
774
|
+
sendRequest("EmitWarning", serializeError(warning));
|
|
775
|
+
}, loaderContext.emitFile = function(name, content, sourceMap, assetInfo) {
|
|
776
|
+
sendRequest("EmitFile", name, content, sourceMap, assetInfo);
|
|
777
|
+
}, loaderContext.experiments = {
|
|
778
|
+
emitDiagnostic (diagnostic) {
|
|
779
|
+
sendRequest("EmitDiagnostic", diagnostic);
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
let getAbsolutify = memoize(()=>absolutify.bindCache({})), getAbsolutifyInContext = memoize(()=>absolutify.bindContextCache(contextDirectory, {})), getContextify = memoize(()=>contextify.bindCache({})), getContextifyInContext = memoize(()=>contextify.bindContextCache(contextDirectory, {}));
|
|
783
|
+
loaderContext.utils = {
|
|
784
|
+
absolutify: (context, request)=>context === contextDirectory ? getAbsolutifyInContext()(request) : getAbsolutify()(context, request),
|
|
785
|
+
contextify: (context, request)=>context === contextDirectory ? getContextifyInContext()(request) : getContextify()(context, request),
|
|
786
|
+
createHash: (type)=>(0, createHash.n)(type || loaderContext._compilation.outputOptions.hashFunction)
|
|
787
|
+
}, loaderContext._compiler = {
|
|
788
|
+
...loaderContext._compiler,
|
|
789
|
+
rspack: {
|
|
790
|
+
experiments: {
|
|
791
|
+
swc: __webpack_require__("./src/swc.ts")
|
|
792
|
+
}
|
|
793
|
+
},
|
|
794
|
+
webpack: {
|
|
795
|
+
util: {
|
|
796
|
+
createHash: __webpack_require__("./src/util/createHash.ts").n,
|
|
797
|
+
cleverMerge: __webpack_require__("./src/util/cleverMerge.ts").ks
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}, loaderContext._compilation = {
|
|
801
|
+
...loaderContext._compilation,
|
|
802
|
+
getPath: (filename, data)=>sendRequest("CompilationGetPath", filename, data).wait(),
|
|
803
|
+
getPathWithInfo: (filename, data)=>sendRequest("CompilationGetPathWithInfo", filename, data).wait(),
|
|
804
|
+
getAssetPath: (filename, data)=>sendRequest("CompilationGetAssetPath", filename, data).wait(),
|
|
805
|
+
getAssetPathWithInfo: (filename, data)=>sendRequest("CompilationGetAssetPathWithInfo", filename, data).wait()
|
|
806
|
+
};
|
|
807
|
+
let _module = loaderContext._module;
|
|
808
|
+
loaderContext._module = {
|
|
809
|
+
type: _module.type,
|
|
810
|
+
identifier: ()=>_module.identifier,
|
|
811
|
+
matchResource: _module.matchResource,
|
|
812
|
+
request: _module.request,
|
|
813
|
+
userRequest: _module.userRequest,
|
|
814
|
+
rawRequest: _module.rawRequest
|
|
815
|
+
}, loaderContext.importModule = function(request, options, callback) {
|
|
816
|
+
if (!callback) return new Promise((resolve, reject)=>{
|
|
817
|
+
sendRequest("ImportModule", request, options).then((result)=>{
|
|
619
818
|
resolve(result);
|
|
620
819
|
}, (err)=>{
|
|
621
820
|
reject(err);
|
|
622
821
|
});
|
|
623
822
|
});
|
|
624
|
-
sendRequest("
|
|
823
|
+
sendRequest("ImportModule", request, options).then((result)=>{
|
|
625
824
|
callback(null, result);
|
|
626
825
|
}, (err)=>{
|
|
627
826
|
callback(err);
|
|
628
827
|
});
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
},
|
|
647
|
-
assert (assertion, ...args) {
|
|
648
|
-
assertion || sendRequest("GetLogger", 'error', name, args);
|
|
649
|
-
},
|
|
650
|
-
trace () {
|
|
651
|
-
sendRequest("GetLogger", 'trace', name, [
|
|
652
|
-
'Trace'
|
|
653
|
-
]);
|
|
654
|
-
},
|
|
655
|
-
clear () {
|
|
656
|
-
sendRequest("GetLogger", 'clear', name);
|
|
657
|
-
},
|
|
658
|
-
status (...args) {
|
|
659
|
-
sendRequest("GetLogger", 'status', name, args);
|
|
660
|
-
},
|
|
661
|
-
group (...args) {
|
|
662
|
-
sendRequest("GetLogger", 'group', name, args);
|
|
663
|
-
},
|
|
664
|
-
groupCollapsed (...args) {
|
|
665
|
-
sendRequest("GetLogger", 'groupCollapsed', name, args);
|
|
666
|
-
},
|
|
667
|
-
groupEnd (...args) {
|
|
668
|
-
sendRequest("GetLogger", 'groupEnd', name, args);
|
|
669
|
-
},
|
|
670
|
-
profile (label) {
|
|
671
|
-
sendRequest("GetLogger", 'profile', name, [
|
|
672
|
-
label
|
|
673
|
-
]);
|
|
674
|
-
},
|
|
675
|
-
profileEnd (label) {
|
|
676
|
-
sendRequest("GetLogger", 'profileEnd', name, [
|
|
677
|
-
label
|
|
678
|
-
]);
|
|
679
|
-
},
|
|
680
|
-
time (label) {
|
|
681
|
-
sendRequest("GetLogger", 'time', name, [
|
|
682
|
-
label
|
|
683
|
-
]);
|
|
684
|
-
},
|
|
685
|
-
timeEnd (label) {
|
|
686
|
-
sendRequest("GetLogger", 'timeEnd', name, [
|
|
687
|
-
label
|
|
688
|
-
]);
|
|
689
|
-
},
|
|
690
|
-
timeLog (label, ...args) {
|
|
691
|
-
sendRequest("GetLogger", 'timeLog', name, [
|
|
692
|
-
label,
|
|
693
|
-
...args
|
|
694
|
-
]);
|
|
695
|
-
},
|
|
696
|
-
timeAggregate (label) {
|
|
697
|
-
sendRequest("GetLogger", 'timeAggregate', name, [
|
|
698
|
-
label
|
|
699
|
-
]);
|
|
700
|
-
},
|
|
701
|
-
timeAggregateEnd (label) {
|
|
702
|
-
sendRequest("GetLogger", 'timeAggregateEnd', name, [
|
|
703
|
-
label
|
|
704
|
-
]);
|
|
828
|
+
}, loaderContext.fs = __webpack_require__("node:fs"), Object.defineProperty(loaderContext, 'request', {
|
|
829
|
+
enumerable: !0,
|
|
830
|
+
get: ()=>loaderContext.loaders.map((o)=>o.request).concat(loaderContext.resource || '').join('!')
|
|
831
|
+
}), Object.defineProperty(loaderContext, 'remainingRequest', {
|
|
832
|
+
enumerable: !0,
|
|
833
|
+
get: ()=>loaderContext.loaderIndex >= loaderContext.loaders.length - 1 && !loaderContext.resource ? '' : loaderContext.loaders.slice(loaderContext.loaderIndex + 1).map((o)=>o.request).concat(loaderContext.resource || '').join('!')
|
|
834
|
+
}), Object.defineProperty(loaderContext, 'currentRequest', {
|
|
835
|
+
enumerable: !0,
|
|
836
|
+
get: ()=>loaderContext.loaders.slice(loaderContext.loaderIndex).map((o)=>o.request).concat(loaderContext.resource || '').join('!')
|
|
837
|
+
}), Object.defineProperty(loaderContext, 'previousRequest', {
|
|
838
|
+
enumerable: !0,
|
|
839
|
+
get: ()=>loaderContext.loaders.slice(0, loaderContext.loaderIndex).map((o)=>o.request).join('!')
|
|
840
|
+
}), Object.defineProperty(loaderContext, 'query', {
|
|
841
|
+
enumerable: !0,
|
|
842
|
+
get: ()=>{
|
|
843
|
+
let entry = loaderContext.loaders[loaderContext.loaderIndex];
|
|
844
|
+
return entry.options && 'object' == typeof entry.options ? entry.options : entry.query;
|
|
705
845
|
}
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
...loaderContext._compiler,
|
|
725
|
-
rspack: {
|
|
726
|
-
experiments: {
|
|
727
|
-
swc: swc_namespaceObject
|
|
728
|
-
}
|
|
729
|
-
},
|
|
730
|
-
webpack: {
|
|
731
|
-
util: {
|
|
732
|
-
createHash: createHash_createHash,
|
|
733
|
-
cleverMerge: cleverMerge
|
|
846
|
+
}), loaderContext.getOptions = function() {
|
|
847
|
+
let loader = function(loaderContext, index = loaderContext.loaderIndex) {
|
|
848
|
+
return loaderContext.loaders?.length && index < loaderContext.loaders.length && index >= 0 && loaderContext.loaders[index] ? loaderContext.loaders[index] : null;
|
|
849
|
+
}(loaderContext), options = loader?.options;
|
|
850
|
+
if ('string' == typeof options) if (options.startsWith('{') && options.endsWith('}')) try {
|
|
851
|
+
options = JSON.parse(options);
|
|
852
|
+
} catch (e) {
|
|
853
|
+
throw Error(`JSON parsing failed for loader's string options: ${e.message}`);
|
|
854
|
+
}
|
|
855
|
+
else options = external_node_querystring_default().parse(options);
|
|
856
|
+
return null == options && (options = {}), options;
|
|
857
|
+
}, loaderContext.cacheable = function(flag) {
|
|
858
|
+
!1 === flag && sendRequest("SetCacheable", !1);
|
|
859
|
+
}, Object.defineProperty(loaderContext, 'data', {
|
|
860
|
+
enumerable: !0,
|
|
861
|
+
get: ()=>loaderContext.loaders[loaderContext.loaderIndex].loaderItem.data,
|
|
862
|
+
set: (value)=>{
|
|
863
|
+
loaderContext.loaders[loaderContext.loaderIndex].loaderItem.data = value;
|
|
734
864
|
}
|
|
735
|
-
}
|
|
736
|
-
}, loaderContext._compilation = {
|
|
737
|
-
...loaderContext._compilation,
|
|
738
|
-
getPath: (filename, data)=>sendRequest("CompilationGetPath", filename, data).wait(),
|
|
739
|
-
getPathWithInfo: (filename, data)=>sendRequest("CompilationGetPathWithInfo", filename, data).wait(),
|
|
740
|
-
getAssetPath: (filename, data)=>sendRequest("CompilationGetAssetPath", filename, data).wait(),
|
|
741
|
-
getAssetPathWithInfo: (filename, data)=>sendRequest("CompilationGetAssetPathWithInfo", filename, data).wait()
|
|
742
|
-
};
|
|
743
|
-
let _module = loaderContext._module;
|
|
744
|
-
loaderContext._module = {
|
|
745
|
-
type: _module.type,
|
|
746
|
-
identifier: ()=>_module.identifier,
|
|
747
|
-
matchResource: _module.matchResource,
|
|
748
|
-
request: _module.request,
|
|
749
|
-
userRequest: _module.userRequest,
|
|
750
|
-
rawRequest: _module.rawRequest
|
|
751
|
-
}, loaderContext.importModule = function(request, options, callback) {
|
|
752
|
-
if (!callback) return new Promise((resolve, reject)=>{
|
|
753
|
-
sendRequest("ImportModule", request, options).then((result)=>{
|
|
754
|
-
resolve(result);
|
|
755
|
-
}, (err)=>{
|
|
756
|
-
reject(err);
|
|
757
|
-
});
|
|
758
|
-
});
|
|
759
|
-
sendRequest("ImportModule", request, options).then((result)=>{
|
|
760
|
-
callback(null, result);
|
|
761
|
-
}, (err)=>{
|
|
762
|
-
callback(err);
|
|
763
865
|
});
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
}), loaderContext.getOptions = function() {
|
|
783
|
-
let loader = function(loaderContext, index = loaderContext.loaderIndex) {
|
|
784
|
-
return loaderContext.loaders?.length && index < loaderContext.loaders.length && index >= 0 && loaderContext.loaders[index] ? loaderContext.loaders[index] : null;
|
|
785
|
-
}(loaderContext), options = loader?.options;
|
|
786
|
-
if ('string' == typeof options) if (options.startsWith('{') && options.endsWith('}')) try {
|
|
787
|
-
options = JSON.parse(options);
|
|
788
|
-
} catch (e) {
|
|
789
|
-
throw Error(`JSON parsing failed for loader's string options: ${e.message}`);
|
|
790
|
-
}
|
|
791
|
-
else options = node_querystring.parse(options);
|
|
792
|
-
return null == options && (options = {}), options;
|
|
793
|
-
}, loaderContext.cacheable = function(flag) {
|
|
794
|
-
!1 === flag && sendRequest("SetCacheable", !1);
|
|
795
|
-
}, Object.defineProperty(loaderContext, 'data', {
|
|
796
|
-
enumerable: !0,
|
|
797
|
-
get: ()=>loaderContext.loaders[loaderContext.loaderIndex].loaderItem.data,
|
|
798
|
-
set: (value)=>{
|
|
799
|
-
loaderContext.loaders[loaderContext.loaderIndex].loaderItem.data = value;
|
|
800
|
-
}
|
|
801
|
-
});
|
|
802
|
-
let shouldYieldToMainThread = (currentLoaderObject)=>!!(!currentLoaderObject?.parallel || currentLoaderObject?.request.startsWith('builtin:'));
|
|
803
|
-
switch(loaderState){
|
|
804
|
-
case binding_namespaceObject.JsLoaderState.Pitching:
|
|
805
|
-
for(; loaderContext.loaderIndex < loaderContext.loaders.length;){
|
|
806
|
-
let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
|
807
|
-
if (shouldYieldToMainThread(currentLoaderObject)) break;
|
|
808
|
-
if (currentLoaderObject.pitchExecuted) {
|
|
809
|
-
loaderContext.loaderIndex += 1;
|
|
810
|
-
continue;
|
|
866
|
+
let shouldYieldToMainThread = (currentLoaderObject)=>!!(!currentLoaderObject?.parallel || currentLoaderObject?.request.startsWith('builtin:'));
|
|
867
|
+
switch(loaderState){
|
|
868
|
+
case binding_.JsLoaderState.Pitching:
|
|
869
|
+
for(; loaderContext.loaderIndex < loaderContext.loaders.length;){
|
|
870
|
+
let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
|
871
|
+
if (shouldYieldToMainThread(currentLoaderObject)) break;
|
|
872
|
+
if (currentLoaderObject.pitchExecuted) {
|
|
873
|
+
loaderContext.loaderIndex += 1;
|
|
874
|
+
continue;
|
|
875
|
+
}
|
|
876
|
+
await loadLoaderAsync(currentLoaderObject, loaderContext._compiler);
|
|
877
|
+
let fn = currentLoaderObject.pitch;
|
|
878
|
+
if ((currentLoaderObject.pitchExecuted = !0, fn) && (args = await utils_runSyncOrAsync(fn, loaderContext, [
|
|
879
|
+
loaderContext.remainingRequest,
|
|
880
|
+
loaderContext.previousRequest,
|
|
881
|
+
currentLoaderObject.loaderItem.data
|
|
882
|
+
]) || []).some((value)=>void 0 !== value)) break;
|
|
811
883
|
}
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
loaderContext.
|
|
816
|
-
|
|
817
|
-
currentLoaderObject.
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
884
|
+
break;
|
|
885
|
+
case binding_.JsLoaderState.Normal:
|
|
886
|
+
for(; loaderContext.loaderIndex >= 0;){
|
|
887
|
+
let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
|
888
|
+
if (shouldYieldToMainThread(currentLoaderObject)) break;
|
|
889
|
+
if (currentLoaderObject.normalExecuted) {
|
|
890
|
+
loaderContext.loaderIndex--;
|
|
891
|
+
continue;
|
|
892
|
+
}
|
|
893
|
+
await loadLoaderAsync(currentLoaderObject, loaderContext._compiler);
|
|
894
|
+
let fn = currentLoaderObject.normal;
|
|
895
|
+
currentLoaderObject.normalExecuted = !0, fn && (!function(args, raw) {
|
|
896
|
+
if (!raw && args[0] instanceof Uint8Array) {
|
|
897
|
+
var buf;
|
|
898
|
+
let isShared, str;
|
|
899
|
+
args[0] = (isShared = (buf = args[0]).buffer instanceof SharedArrayBuffer || buf.buffer.constructor?.name === 'SharedArrayBuffer', 0xfeff === (str = decoder.decode(isShared ? Buffer.from(buf) : buf)).charCodeAt(0) ? str.slice(1) : str);
|
|
900
|
+
} else raw && 'string' == typeof args[0] && (args[0] = Buffer.from(args[0], 'utf-8'));
|
|
901
|
+
raw && args[0] instanceof Uint8Array && !Buffer.isBuffer(args[0]) && (args[0] = Buffer.from(args[0].buffer));
|
|
902
|
+
}(args, !!currentLoaderObject.raw), args = await utils_runSyncOrAsync(fn, loaderContext, args) || []);
|
|
828
903
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
}
|
|
847
|
-
let nextId = 0, responseCallbacks = {};
|
|
848
|
-
function handleIncomingResponses(workerMessage) {
|
|
849
|
-
if (isWorkerResponseMessage(workerMessage)) {
|
|
850
|
-
let { id, data } = workerMessage, callback = responseCallbacks[id];
|
|
851
|
-
if (callback) delete responseCallbacks[id], callback(null, data);
|
|
852
|
-
else throw Error(`No callback found for response with id ${id}`);
|
|
853
|
-
} else if ('response-error' === workerMessage.type) {
|
|
854
|
-
let { id, error } = workerMessage, callback = responseCallbacks[id];
|
|
855
|
-
if (callback) delete responseCallbacks[id], callback(error, void 0);
|
|
856
|
-
else throw Error(`No callback found for response with id ${id}`);
|
|
904
|
+
}
|
|
905
|
+
return sendRequest("UpdateLoaderObjects", loaderContext.loaders.map((item)=>({
|
|
906
|
+
data: item.loaderItem.data,
|
|
907
|
+
normalExecuted: item.normalExecuted,
|
|
908
|
+
pitchExecuted: item.pitchExecuted
|
|
909
|
+
}))), args;
|
|
910
|
+
}
|
|
911
|
+
let nextId = 0, responseCallbacks = {};
|
|
912
|
+
function handleIncomingResponses(workerMessage) {
|
|
913
|
+
if (isWorkerResponseMessage(workerMessage)) {
|
|
914
|
+
let { id, data } = workerMessage, callback = responseCallbacks[id];
|
|
915
|
+
if (callback) delete responseCallbacks[id], callback(null, data);
|
|
916
|
+
else throw Error(`No callback found for response with id ${id}`);
|
|
917
|
+
} else if ('response-error' === workerMessage.type) {
|
|
918
|
+
let { id, error } = workerMessage, callback = responseCallbacks[id];
|
|
919
|
+
if (callback) delete responseCallbacks[id], callback(error, void 0);
|
|
920
|
+
else throw Error(`No callback found for response with id ${id}`);
|
|
921
|
+
}
|
|
857
922
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
};
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
})
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
923
|
+
let loader_runner_worker = function(workerOptions) {
|
|
924
|
+
var workerPort, workerSyncPort, sendRequest, workerSyncPort1;
|
|
925
|
+
let sendRequest1, workerData = workerOptions.workerData;
|
|
926
|
+
delete workerOptions.workerData, workerData.workerPort.on('message', handleIncomingResponses);
|
|
927
|
+
let sendRequest2 = (workerPort = workerData.workerPort, workerSyncPort = workerData.workerSyncPort, (sendRequest1 = (requestType, ...args)=>{
|
|
928
|
+
let id = nextId++;
|
|
929
|
+
workerPort.postMessage({
|
|
930
|
+
type: 'request',
|
|
931
|
+
id,
|
|
932
|
+
requestType,
|
|
933
|
+
data: args
|
|
934
|
+
});
|
|
935
|
+
let result = new Promise((resolve, reject)=>{
|
|
936
|
+
responseCallbacks[id] = (err, data)=>{
|
|
937
|
+
err ? reject(err) : resolve(data);
|
|
938
|
+
};
|
|
939
|
+
});
|
|
940
|
+
return result.wait = ()=>sendRequest1.sync("WaitForPendingRequest", id), result.id = id, result;
|
|
941
|
+
}).sync = (workerSyncPort1 = workerSyncPort, (requestType, ...args)=>{
|
|
942
|
+
let id = nextId++, sharedBuffer = new SharedArrayBuffer(8), sharedBufferView = new Int32Array(sharedBuffer);
|
|
943
|
+
workerSyncPort1.postMessage({
|
|
944
|
+
type: 'request-sync',
|
|
945
|
+
id,
|
|
946
|
+
requestType,
|
|
947
|
+
data: args,
|
|
948
|
+
sharedBuffer
|
|
949
|
+
});
|
|
950
|
+
let status = Atomics.wait(sharedBufferView, 0, 0);
|
|
951
|
+
if ('ok' !== status && 'not-equal' !== status) throw Error(`Internal error: Atomics.wait() failed: ${status}`);
|
|
952
|
+
let { message } = (0, external_node_worker_threads_namespaceObject.receiveMessageOnPort)(workerSyncPort1);
|
|
953
|
+
if (id !== message.id) throw Error(`Unexpected response id: ${message.id}, expected: ${id}`);
|
|
954
|
+
if (isWorkerResponseMessage(message)) return message.data;
|
|
955
|
+
throw message.error;
|
|
956
|
+
}), sendRequest1), waitFor = (sendRequest = sendRequest2, (requests)=>sendRequest.sync("WaitForPendingRequest", (Array.isArray(requests) ? requests : [
|
|
957
|
+
requests
|
|
958
|
+
]).map((request)=>request.id)));
|
|
959
|
+
loaderImpl(workerOptions, sendRequest2, waitFor).then((data)=>{
|
|
960
|
+
workerData.workerPort.postMessage({
|
|
961
|
+
type: 'done',
|
|
962
|
+
data
|
|
963
|
+
});
|
|
964
|
+
}).catch((err)=>{
|
|
965
|
+
workerData.workerPort.postMessage({
|
|
966
|
+
type: 'done-error',
|
|
967
|
+
error: serializeError(err)
|
|
968
|
+
});
|
|
904
969
|
});
|
|
905
|
-
}
|
|
906
|
-
}
|
|
970
|
+
};
|
|
971
|
+
})(), exports.default = __webpack_exports__.default, __webpack_exports__)-1 === [
|
|
972
|
+
"default"
|
|
973
|
+
].indexOf(__rspack_i) && (exports[__rspack_i] = __webpack_exports__[__rspack_i]);
|
|
974
|
+
Object.defineProperty(exports, '__esModule', {
|
|
975
|
+
value: !0
|
|
976
|
+
});
|
|
977
|
+
|
|
978
|
+
module.exports = __webpack_exports__.default;
|