@ohos-ports/rspack-core 1.7.11-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +15 -0
  3. package/compiled/@swc/types/index.d.ts +2134 -0
  4. package/compiled/@swc/types/index.js +19 -0
  5. package/compiled/@swc/types/license +201 -0
  6. package/compiled/@swc/types/package.json +1 -0
  7. package/compiled/browserslist-load-config/index.d.ts +21 -0
  8. package/compiled/browserslist-load-config/index.js +252 -0
  9. package/compiled/browserslist-load-config/license +21 -0
  10. package/compiled/browserslist-load-config/package.json +1 -0
  11. package/compiled/tinypool/LICENSE +24 -0
  12. package/compiled/tinypool/README.md +20 -0
  13. package/compiled/tinypool/dist/common-Qw-RoVFD.js +28 -0
  14. package/compiled/tinypool/dist/entry/process.d.ts +1 -0
  15. package/compiled/tinypool/dist/entry/process.js +72 -0
  16. package/compiled/tinypool/dist/entry/utils.d.ts +7 -0
  17. package/compiled/tinypool/dist/entry/utils.js +3 -0
  18. package/compiled/tinypool/dist/entry/worker.d.ts +1 -0
  19. package/compiled/tinypool/dist/entry/worker.js +76 -0
  20. package/compiled/tinypool/dist/index.d.ts +195 -0
  21. package/compiled/tinypool/dist/index.js +820 -0
  22. package/compiled/tinypool/dist/utils-B--2TaWv.js +38 -0
  23. package/compiled/tinypool/dist/utils-De75vAgL.js +10 -0
  24. package/compiled/tinypool/package.json +39 -0
  25. package/compiled/watchpack/index.d.ts +217 -0
  26. package/compiled/watchpack/index.js +3124 -0
  27. package/compiled/watchpack/license +20 -0
  28. package/compiled/watchpack/package.json +1 -0
  29. package/compiled/webpack-sources/index.js +4675 -0
  30. package/compiled/webpack-sources/license +21 -0
  31. package/compiled/webpack-sources/package.json +1 -0
  32. package/compiled/webpack-sources/types.d.ts +458 -0
  33. package/dist/BuildInfo.d.ts +17 -0
  34. package/dist/Chunk.d.ts +16 -0
  35. package/dist/ChunkGraph.d.ts +9 -0
  36. package/dist/Chunks.d.ts +12 -0
  37. package/dist/CodeGenerationResults.d.ts +1 -0
  38. package/dist/Compilation.d.ts +438 -0
  39. package/dist/Compiler.d.ts +226 -0
  40. package/dist/ConcatenatedModule.d.ts +1 -0
  41. package/dist/ContextModule.d.ts +1 -0
  42. package/dist/ContextModuleFactory.d.ts +13 -0
  43. package/dist/Diagnostics.d.ts +7 -0
  44. package/dist/Entrypoint.d.ts +2 -0
  45. package/dist/ErrorHelpers.d.ts +3 -0
  46. package/dist/ExecuteModulePlugin.d.ts +4 -0
  47. package/dist/ExportsInfo.d.ts +20 -0
  48. package/dist/ExternalModule.d.ts +1 -0
  49. package/dist/FileSystem.d.ts +54 -0
  50. package/dist/FileSystemInfo.d.ts +5 -0
  51. package/dist/Module.d.ts +42 -0
  52. package/dist/ModuleGraph.d.ts +19 -0
  53. package/dist/ModuleTypeConstants.d.ts +8 -0
  54. package/dist/MultiCompiler.d.ts +82 -0
  55. package/dist/MultiStats.d.ts +23 -0
  56. package/dist/MultiWatching.d.ts +27 -0
  57. package/dist/NativeWatchFileSystem.d.ts +23 -0
  58. package/dist/NormalModule.d.ts +15 -0
  59. package/dist/NormalModuleFactory.d.ts +23 -0
  60. package/dist/Resolver.d.ts +30 -0
  61. package/dist/ResolverFactory.d.ts +17 -0
  62. package/dist/RspackError.d.ts +12 -0
  63. package/dist/RuleSetCompiler.d.ts +9 -0
  64. package/dist/RuntimeGlobals.d.ts +356 -0
  65. package/dist/RuntimeModule.d.ts +34 -0
  66. package/dist/Stats.d.ts +17 -0
  67. package/dist/Template.d.ts +77 -0
  68. package/dist/VirtualModulesPlugin.d.ts +12 -0
  69. package/dist/Watching.d.ts +56 -0
  70. package/dist/builtin-loader/index.d.ts +1 -0
  71. package/dist/builtin-loader/lightningcss/index.d.ts +117 -0
  72. package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +21 -0
  73. package/dist/builtin-loader/swc/index.d.ts +5 -0
  74. package/dist/builtin-loader/swc/pluginImport.d.ts +33 -0
  75. package/dist/builtin-loader/swc/types.d.ts +89 -0
  76. package/dist/builtin-plugin/APIPlugin.d.ts +9 -0
  77. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +9 -0
  78. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +9 -0
  79. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +9 -0
  80. package/dist/builtin-plugin/BannerPlugin.d.ts +40 -0
  81. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +14 -0
  82. package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +9 -0
  83. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +9 -0
  84. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +54 -0
  85. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +9 -0
  86. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +9 -0
  87. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +14 -0
  88. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +21 -0
  89. package/dist/builtin-plugin/CssModulesPlugin.d.ts +9 -0
  90. package/dist/builtin-plugin/DataUriPlugin.d.ts +9 -0
  91. package/dist/builtin-plugin/DefinePlugin.d.ts +16 -0
  92. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +7 -0
  93. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +7 -0
  94. package/dist/builtin-plugin/DllEntryPlugin.d.ts +12 -0
  95. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +11 -0
  96. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +12 -0
  97. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +9 -0
  98. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +25 -0
  99. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +11 -0
  100. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +9 -0
  101. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +9 -0
  102. package/dist/builtin-plugin/EntryPlugin.d.ts +32 -0
  103. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +11 -0
  104. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +11 -0
  105. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +10 -0
  106. package/dist/builtin-plugin/ExternalsPlugin.d.ts +12 -0
  107. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +9 -0
  108. package/dist/builtin-plugin/FileUriPlugin.d.ts +9 -0
  109. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +9 -0
  110. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +9 -0
  111. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +9 -0
  112. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +7 -0
  113. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +9 -0
  114. package/dist/builtin-plugin/HttpUriPlugin.d.ts +36 -0
  115. package/dist/builtin-plugin/IgnorePlugin.d.ts +19 -0
  116. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +9 -0
  117. package/dist/builtin-plugin/InlineExportsPlugin.d.ts +9 -0
  118. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +15 -0
  119. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +10 -0
  120. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +9 -0
  121. package/dist/builtin-plugin/LibManifestPlugin.d.ts +17 -0
  122. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +32 -0
  123. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +14 -0
  124. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +9 -0
  125. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +9 -0
  126. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +9 -0
  127. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +7 -0
  128. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +9 -0
  129. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +9 -0
  130. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +9 -0
  131. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +7 -0
  132. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +7 -0
  133. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +9 -0
  134. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +9 -0
  135. package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +10 -0
  136. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +10 -0
  137. package/dist/builtin-plugin/ProgressPlugin.d.ts +11 -0
  138. package/dist/builtin-plugin/ProvidePlugin.d.ts +10 -0
  139. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +9 -0
  140. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +9 -0
  141. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +9 -0
  142. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +49 -0
  143. package/dist/builtin-plugin/RslibPlugin.d.ts +11 -0
  144. package/dist/builtin-plugin/RstestPlugin.d.ts +11 -0
  145. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
  146. package/dist/builtin-plugin/RuntimePlugin.d.ts +29 -0
  147. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -0
  148. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +19 -0
  149. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +11 -0
  150. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +11 -0
  151. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +39 -0
  152. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +215 -0
  153. package/dist/builtin-plugin/URLPlugin.d.ts +9 -0
  154. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +7 -0
  155. package/dist/builtin-plugin/WorkerPlugin.d.ts +14 -0
  156. package/dist/builtin-plugin/base.d.ts +45 -0
  157. package/dist/builtin-plugin/css-extract/index.d.ts +24 -0
  158. package/dist/builtin-plugin/css-extract/loader.d.ts +21 -0
  159. package/dist/builtin-plugin/css-extract/utils.d.ts +6 -0
  160. package/dist/builtin-plugin/html-plugin/hooks.d.ts +32 -0
  161. package/dist/builtin-plugin/html-plugin/index.d.ts +2 -0
  162. package/dist/builtin-plugin/html-plugin/options.d.ts +82 -0
  163. package/dist/builtin-plugin/html-plugin/plugin.d.ts +24 -0
  164. package/dist/builtin-plugin/html-plugin/taps.d.ts +2 -0
  165. package/dist/builtin-plugin/index.d.ts +84 -0
  166. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +10 -0
  167. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +12 -0
  168. package/dist/config/adapter.d.ts +8 -0
  169. package/dist/config/adapterRuleUse.d.ts +391 -0
  170. package/dist/config/browserslistTargetHandler.d.ts +15 -0
  171. package/dist/config/defaults.d.ts +13 -0
  172. package/dist/config/devServer.d.ts +314 -0
  173. package/dist/config/index.d.ts +5 -0
  174. package/dist/config/normalization.d.ts +174 -0
  175. package/dist/config/target.d.ts +93 -0
  176. package/dist/config/types.d.ts +2432 -0
  177. package/dist/container/ContainerPlugin.d.ts +41 -0
  178. package/dist/container/ContainerReferencePlugin.d.ts +34 -0
  179. package/dist/container/ModuleFederationManifestPlugin.d.ts +37 -0
  180. package/dist/container/ModuleFederationPlugin.d.ts +17 -0
  181. package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
  182. package/dist/container/ModuleFederationRuntimePlugin.d.ts +16 -0
  183. package/dist/container/index.d.ts +4 -0
  184. package/dist/container/options.d.ts +3 -0
  185. package/dist/cssExtractHmr.js +124 -0
  186. package/dist/cssExtractLoader.js +160 -0
  187. package/dist/error/ConcurrentCompilationError.d.ts +14 -0
  188. package/dist/exports.d.ts +178 -0
  189. package/dist/index.d.ts +10 -0
  190. package/dist/index.js +12638 -0
  191. package/dist/lib/AbstractMethodError.d.ts +23 -0
  192. package/dist/lib/Cache.d.ts +65 -0
  193. package/dist/lib/CacheFacade.d.ts +139 -0
  194. package/dist/lib/DllPlugin.d.ts +42 -0
  195. package/dist/lib/DllReferencePlugin.d.ts +119 -0
  196. package/dist/lib/EntryOptionPlugin.d.ts +33 -0
  197. package/dist/lib/EnvironmentPlugin.d.ts +22 -0
  198. package/dist/lib/HookWebpackError.d.ts +40 -0
  199. package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
  200. package/dist/lib/LoaderOptionsPlugin.d.ts +28 -0
  201. package/dist/lib/LoaderTargetPlugin.d.ts +24 -0
  202. package/dist/lib/ModuleFilenameHelpers.d.ts +53 -0
  203. package/dist/lib/WebpackError.d.ts +21 -0
  204. package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
  205. package/dist/lib/cache/getLazyHashedEtag.d.ts +35 -0
  206. package/dist/lib/cache/mergeEtags.d.ts +17 -0
  207. package/dist/loader-runner/LoaderLoadingError.d.ts +13 -0
  208. package/dist/loader-runner/ModuleError.d.ts +13 -0
  209. package/dist/loader-runner/index.d.ts +36 -0
  210. package/dist/loader-runner/loadLoader.d.ts +12 -0
  211. package/dist/loader-runner/service.d.ts +73 -0
  212. package/dist/loader-runner/utils.d.ts +7 -0
  213. package/dist/loader-runner/worker.d.ts +14 -0
  214. package/dist/logging/Logger.d.ts +61 -0
  215. package/dist/logging/createConsoleLogger.d.ts +35 -0
  216. package/dist/logging/truncateArgs.d.ts +16 -0
  217. package/dist/moduleFederationDefaultRuntime.js +1 -0
  218. package/dist/node/NodeEnvironmentPlugin.d.ts +10 -0
  219. package/dist/node/NodeTemplatePlugin.d.ts +18 -0
  220. package/dist/node/NodeWatchFileSystem.d.ts +18 -0
  221. package/dist/node/nodeConsole.d.ts +15 -0
  222. package/dist/rspack.d.ts +25 -0
  223. package/dist/rspackOptionsApply.d.ts +4 -0
  224. package/dist/runtime/cssExtractHmr.d.ts +4 -0
  225. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
  226. package/dist/sharing/ConsumeSharedPlugin.d.ts +42 -0
  227. package/dist/sharing/ProvideSharedPlugin.d.ts +35 -0
  228. package/dist/sharing/SharePlugin.d.ts +53 -0
  229. package/dist/sharing/ShareRuntimePlugin.d.ts +9 -0
  230. package/dist/sharing/utils.d.ts +1 -0
  231. package/dist/stats/DefaultStatsFactoryPlugin.d.ts +20 -0
  232. package/dist/stats/DefaultStatsPresetPlugin.d.ts +4 -0
  233. package/dist/stats/DefaultStatsPrinterPlugin.d.ts +13 -0
  234. package/dist/stats/StatsFactory.d.ts +57 -0
  235. package/dist/stats/StatsPrinter.d.ts +57 -0
  236. package/dist/stats/statsFactoryUtils.d.ts +341 -0
  237. package/dist/swc.d.ts +7 -0
  238. package/dist/taps/compilation.d.ts +8 -0
  239. package/dist/taps/compiler.d.ts +2 -0
  240. package/dist/taps/contextModuleFactory.d.ts +2 -0
  241. package/dist/taps/index.d.ts +6 -0
  242. package/dist/taps/javascriptModules.d.ts +2 -0
  243. package/dist/taps/normalModuleFactory.d.ts +2 -0
  244. package/dist/taps/types.d.ts +11 -0
  245. package/dist/trace/index.d.ts +46 -0
  246. package/dist/trace/traceHookPlugin.d.ts +5 -0
  247. package/dist/util/ArrayQueue.d.ts +45 -0
  248. package/dist/util/AsyncTask.d.ts +7 -0
  249. package/dist/util/MergeCaller.d.ts +10 -0
  250. package/dist/util/SizeFormatHelpers.d.ts +10 -0
  251. package/dist/util/SplitChunkSize.d.ts +5 -0
  252. package/dist/util/assertNotNil.d.ts +1 -0
  253. package/dist/util/assetCondition.d.ts +2 -0
  254. package/dist/util/asyncLib.d.ts +54 -0
  255. package/dist/util/bindingVersionCheck.d.ts +5 -0
  256. package/dist/util/cleverMerge.d.ts +24 -0
  257. package/dist/util/comparators.d.ts +16 -0
  258. package/dist/util/createHash.d.ts +16 -0
  259. package/dist/util/createReadonlyMap.d.ts +1 -0
  260. package/dist/util/fake.d.ts +14 -0
  261. package/dist/util/fs.d.ts +375 -0
  262. package/dist/util/hash/index.d.ts +26 -0
  263. package/dist/util/hash/md4.d.ts +11 -0
  264. package/dist/util/hash/wasm-hash.d.ts +51 -0
  265. package/dist/util/hash/xxhash64.d.ts +11 -0
  266. package/dist/util/identifier.d.ts +31 -0
  267. package/dist/util/index.d.ts +9 -0
  268. package/dist/util/memoize.d.ts +2 -0
  269. package/dist/util/runtime.d.ts +2 -0
  270. package/dist/util/smartGrouping.d.ts +21 -0
  271. package/dist/util/source.d.ts +6 -0
  272. package/dist/util/validateConfig.d.ts +5 -0
  273. package/dist/worker.js +978 -0
  274. package/hot/dev-server.js +75 -0
  275. package/hot/emitter.js +21 -0
  276. package/hot/lazy-compilation-node.js +106 -0
  277. package/hot/lazy-compilation-web.js +98 -0
  278. package/hot/log-apply-result.js +49 -0
  279. package/hot/log.js +79 -0
  280. package/hot/only-dev-server.js +103 -0
  281. package/hot/poll.js +40 -0
  282. package/hot/signal.js +66 -0
  283. package/module.d.ts +273 -0
  284. package/package.json +79 -0
package/dist/worker.js ADDED
@@ -0,0 +1,978 @@
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);
14
+ }
15
+ function minifySync(source, options) {
16
+ let _options = JSON.stringify(options || {});
17
+ return _rspack_binding__rspack_import_0_default().minifySync(source, _options);
18
+ }
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
31
+ });
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()
55
+ };
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
+ }
68
+ }
69
+ else if ('function' == typeof byObj) if (void 0 === dynamicInfo) dynamicInfo = {
70
+ byProperty: key,
71
+ fn: byObj
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] || {};
85
+ }
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);
91
+ }
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);
102
+ };
103
+ return newFn[DYNAMIC_INFO] = [
104
+ fn,
105
+ secondObj
106
+ ], serializeObject(firstObject.static, {
107
+ byProperty,
108
+ fn: newFn
109
+ });
110
+ }
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:
121
+ case 4:
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:
143
+ {
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
+ };
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;
179
+ case 3:
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
+ default:
202
+ throw Error('Not implemented');
203
+ }
204
+ };
205
+ },
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;
219
+ }
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;
307
+ else {
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);
318
+ }
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
+ }
326
+ }
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
+ }
358
+ }
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
+ }
372
+ }
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
+ }
384
+ }
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('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', '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: {}
443
+ };
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);
495
+ if (void 0 !== entry) return entry;
496
+ let result = realFn(str);
497
+ return cache.set(str, result), result;
498
+ };
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);
512
+ let innerCache = cache.get(associatedObjectForCache);
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;
516
+ let result = fn(context, identifier);
517
+ return innerSubCache.set(identifier, result), result;
518
+ };
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;
540
+ };
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);
568
+ }
569
+ };
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);
578
+ }
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);
588
+ }
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;
633
+ try {
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);
642
+ callback(null, [
643
+ result
644
+ ]);
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, []);
651
+ }
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
+ });
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)=>{
818
+ resolve(result);
819
+ }, (err)=>{
820
+ reject(err);
821
+ });
822
+ });
823
+ sendRequest("ImportModule", request, options).then((result)=>{
824
+ callback(null, result);
825
+ }, (err)=>{
826
+ callback(err);
827
+ });
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;
845
+ }
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;
864
+ }
865
+ });
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;
883
+ }
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) || []);
903
+ }
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
+ }
922
+ }
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
+ });
969
+ });
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;