@rspack-debug/core 1.4.6 → 1.4.7

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/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  var __webpack_modules__ = {
3
- "../../node_modules/.pnpm/enhanced-resolve@5.18.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js": function(module, __unused_webpack_exports, __webpack_require__) {
4
- let nextTick = __webpack_require__("process").nextTick, dirname = (path)=>{
3
+ "../../node_modules/.pnpm/enhanced-resolve@5.18.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js": function(module, __unused_webpack_exports, __webpack_require__) {
4
+ let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
5
5
  let idx = path.length - 1;
6
6
  for(; idx >= 0;){
7
- let c = path.charCodeAt(idx);
8
- if (47 === c || 92 === c) break;
7
+ let char = path.charCodeAt(idx);
8
+ if (47 === char || 92 === char) break;
9
9
  idx--;
10
10
  }
11
11
  return idx < 0 ? "" : path.slice(0, idx);
@@ -17,8 +17,8 @@ var __webpack_modules__ = {
17
17
  }
18
18
  for (let callback of callbacks)try {
19
19
  callback(err, result);
20
- } catch (e) {
21
- error || (error = e);
20
+ } catch (err) {
21
+ error || (error = err);
22
22
  }
23
23
  if (callbacks.length = 0, error) throw error;
24
24
  };
@@ -182,13 +182,13 @@ var __webpack_modules__ = {
182
182
  if (err) return callback(err);
183
183
  if (!buffer || 0 === buffer.length) return callback(Error("No file content"));
184
184
  try {
185
- data = JSON.parse(buffer.toString("utf-8"));
186
- } catch (e) {
187
- return callback(e);
185
+ data = JSON.parse(buffer.toString("utf8"));
186
+ } catch (err_) {
187
+ return callback(err_);
188
188
  }
189
189
  callback(null, data);
190
190
  });
191
- }), this.fileSystem.readJsonSync || this.readFileSync && ((path)=>JSON.parse(this.readFileSync(path).toString("utf-8"))), this.fileSystem);
191
+ }), this.fileSystem.readJsonSync || this.readFileSync && ((path)=>JSON.parse(this.readFileSync(path).toString("utf8"))), this.fileSystem);
192
192
  let readJson = this._readJsonBackend.provide;
193
193
  this.readJson = readJson;
194
194
  let readJsonSync = this._readJsonBackend.provideSync;
@@ -210,6 +210,9 @@ var __webpack_modules__ = {
210
210
  "browserslist-load-config": function(module) {
211
211
  module.exports = require("../compiled/browserslist-load-config/index.js");
212
212
  },
213
+ "glob-to-regexp": function(module) {
214
+ module.exports = require("../compiled/glob-to-regexp/index.js");
215
+ },
213
216
  watchpack: function(module) {
214
217
  module.exports = require("../compiled/watchpack/index.js");
215
218
  },
@@ -432,12 +435,12 @@ for(var __webpack_i__ in (()=>{
432
435
  webworker: ()=>webworker
433
436
  });
434
437
  var binding_ = __webpack_require__("@rspack/binding"), binding_default = __webpack_require__.n(binding_);
435
- let lite_tapable_namespaceObject = require("@rspack/lite-tapable"), cutOffByFlag = (stack, flag)=>{
436
- let stacks = stack.split("\n");
437
- for(let i = 0; i < stacks.length; i++)stacks[i].includes(flag) && (stacks.length = i);
438
- return stacks.join("\n");
439
- }, cutOffLoaderExecution = (stack)=>cutOffByFlag(stack, "LOADER_EXECUTION"), cleanUp = (stack, name, message)=>{
440
- let details = cutOffLoaderExecution(stack);
438
+ let lite_tapable_namespaceObject = require("@rspack/lite-tapable"), cutOffLoaderExecution = (stack)=>((stack, flag)=>{
439
+ let stacks = stack.split("\n");
440
+ for(let i = 0; i < stacks.length; i++)stacks[i].includes(flag) && (stacks.length = i);
441
+ return stacks.join("\n");
442
+ })(stack, "LOADER_EXECUTION"), cleanUp = (stack, name, message)=>{
443
+ cutOffLoaderExecution(stack);
441
444
  return cutOffMessage(stack, name, message);
442
445
  }, cutOffMessage = (stack, name, message)=>{
443
446
  let nextLine = stack.indexOf("\n");
@@ -632,7 +635,7 @@ for(var __webpack_i__ in (()=>{
632
635
  case "verbose":
633
636
  return {
634
637
  all: !0,
635
- modulesSpace: Number.POSITIVE_INFINITY
638
+ modulesSpace: 1 / 0
636
639
  };
637
640
  case "errors-only":
638
641
  return {
@@ -826,76 +829,7 @@ for(var __webpack_i__ in (()=>{
826
829
  return null != aValue ? null != bValue ? comparator(aValue, bValue) : -1 : +(null != bValue);
827
830
  };
828
831
  return compareSelectCache.set(getter, comparator, result), result;
829
- }, compareNumbers = (a, b)=>typeof a != typeof b ? typeof a < typeof b ? -1 : 1 : a < b ? -1 : +(a > b), smartGrouping = (items, groupConfigs)=>{
830
- let itemsWithGroups = new Set(), allGroups = new Map();
831
- for (let item of items){
832
- let groups = new Set();
833
- for(let i = 0; i < groupConfigs.length; i++){
834
- let groupConfig = groupConfigs[i], keys = groupConfig.getKeys(item);
835
- if (keys) for (let name of keys){
836
- let key = `${i}:${name}`, group = allGroups.get(key);
837
- void 0 === group && allGroups.set(key, group = {
838
- config: groupConfig,
839
- name,
840
- alreadyGrouped: !1,
841
- items: void 0
842
- }), groups.add(group);
843
- }
844
- }
845
- itemsWithGroups.add({
846
- item,
847
- groups
848
- });
849
- }
850
- let runGrouping = (itemsWithGroups)=>{
851
- let totalSize = itemsWithGroups.size;
852
- for (let entry of itemsWithGroups)for (let group of entry.groups){
853
- if (group.alreadyGrouped) continue;
854
- let items = group.items;
855
- void 0 === items ? group.items = new Set([
856
- entry
857
- ]) : items.add(entry);
858
- }
859
- let groupMap = new Map();
860
- for (let group of allGroups.values())if (group.items) {
861
- let items = group.items;
862
- group.items = void 0, groupMap.set(group, {
863
- items,
864
- options: void 0,
865
- used: !1
866
- });
867
- }
868
- let results = [];
869
- for(;;){
870
- let bestGroup, bestGroupItems, bestGroupOptions, bestGroupSize = -1;
871
- for (let [group, state] of groupMap){
872
- let { items, used } = state, options = state.options;
873
- if (void 0 === options) {
874
- let groupConfig = group.config;
875
- state.options = options = groupConfig.getOptions?.(group.name, Array.from(items, ({ item })=>item)) || !1;
876
- }
877
- let force = !1 !== options && options.force;
878
- if (!force && (!1 !== bestGroupOptions && bestGroupOptions?.force || used || items.size <= 1 || totalSize - items.size <= 1)) continue;
879
- let targetGroupCount = !1 !== options && options.targetGroupCount || 4, sizeValue = force ? items.size : Math.min(items.size, 2 * totalSize / targetGroupCount + itemsWithGroups.size - items.size);
880
- (sizeValue > bestGroupSize || force && (!bestGroupOptions || !bestGroupOptions.force)) && (bestGroup = group, bestGroupSize = sizeValue, bestGroupItems = items, bestGroupOptions = options);
881
- }
882
- if (void 0 === bestGroup) break;
883
- let items = new Set(bestGroupItems), options = bestGroupOptions, groupChildren = !options || !1 !== options.groupChildren;
884
- for (let item of items)for (let group of (itemsWithGroups.delete(item), item.groups)){
885
- let state = groupMap.get(group);
886
- void 0 !== state && (state.items.delete(item), 0 === state.items.size ? groupMap.delete(group) : (state.options = void 0, groupChildren && (state.used = !0)));
887
- }
888
- groupMap.delete(bestGroup);
889
- let key = bestGroup.name, groupConfig = bestGroup.config, allItems = Array.from(items, ({ item })=>item);
890
- bestGroup.alreadyGrouped = !0;
891
- let children = groupChildren ? runGrouping(items) : allItems;
892
- bestGroup.alreadyGrouped = !1, results.push(groupConfig.createGroup(key, children, allItems));
893
- }
894
- for (let { item } of itemsWithGroups)results.push(item);
895
- return results;
896
- };
897
- return runGrouping(itemsWithGroups);
898
- };
832
+ }, compareNumbers = (a, b)=>typeof a != typeof b ? typeof a < typeof b ? -1 : 1 : a < b ? -1 : +(a > b);
899
833
  class StatsFactory {
900
834
  hooks;
901
835
  _caches;
@@ -1018,7 +952,76 @@ for(var __webpack_i__ in (()=>{
1018
952
  }), comparators2 = [];
1019
953
  this._forEachLevel(this.hooks.sortResults, this._caches.sortResults, type, (h)=>h.call(comparators2, context)), comparators2.length > 0 && resultItems.sort(concatComparators(...comparators2));
1020
954
  let groupConfigs = [];
1021
- this._forEachLevel(this.hooks.groupResults, this._caches.groupResults, type, (h)=>h.call(groupConfigs, context)), groupConfigs.length > 0 && (resultItems = smartGrouping(resultItems, groupConfigs));
955
+ this._forEachLevel(this.hooks.groupResults, this._caches.groupResults, type, (h)=>h.call(groupConfigs, context)), groupConfigs.length > 0 && (resultItems = ((items, groupConfigs)=>{
956
+ let itemsWithGroups = new Set(), allGroups = new Map();
957
+ for (let item of items){
958
+ let groups = new Set();
959
+ for(let i = 0; i < groupConfigs.length; i++){
960
+ let groupConfig = groupConfigs[i], keys = groupConfig.getKeys(item);
961
+ if (keys) for (let name of keys){
962
+ let key = `${i}:${name}`, group = allGroups.get(key);
963
+ void 0 === group && allGroups.set(key, group = {
964
+ config: groupConfig,
965
+ name,
966
+ alreadyGrouped: !1,
967
+ items: void 0
968
+ }), groups.add(group);
969
+ }
970
+ }
971
+ itemsWithGroups.add({
972
+ item,
973
+ groups
974
+ });
975
+ }
976
+ let runGrouping = (itemsWithGroups)=>{
977
+ let totalSize = itemsWithGroups.size;
978
+ for (let entry of itemsWithGroups)for (let group of entry.groups){
979
+ if (group.alreadyGrouped) continue;
980
+ let items = group.items;
981
+ void 0 === items ? group.items = new Set([
982
+ entry
983
+ ]) : items.add(entry);
984
+ }
985
+ let groupMap = new Map();
986
+ for (let group of allGroups.values())if (group.items) {
987
+ let items = group.items;
988
+ group.items = void 0, groupMap.set(group, {
989
+ items,
990
+ options: void 0,
991
+ used: !1
992
+ });
993
+ }
994
+ let results = [];
995
+ for(;;){
996
+ let bestGroup, bestGroupItems, bestGroupOptions, bestGroupSize = -1;
997
+ for (let [group, state] of groupMap){
998
+ let { items, used } = state, options = state.options;
999
+ if (void 0 === options) {
1000
+ let groupConfig = group.config;
1001
+ state.options = options = groupConfig.getOptions?.(group.name, Array.from(items, ({ item })=>item)) || !1;
1002
+ }
1003
+ let force = !1 !== options && options.force;
1004
+ if (!force && (!1 !== bestGroupOptions && bestGroupOptions?.force || used || items.size <= 1 || totalSize - items.size <= 1)) continue;
1005
+ let targetGroupCount = !1 !== options && options.targetGroupCount || 4, sizeValue = force ? items.size : Math.min(items.size, 2 * totalSize / targetGroupCount + itemsWithGroups.size - items.size);
1006
+ (sizeValue > bestGroupSize || force && (!bestGroupOptions || !bestGroupOptions.force)) && (bestGroup = group, bestGroupSize = sizeValue, bestGroupItems = items, bestGroupOptions = options);
1007
+ }
1008
+ if (void 0 === bestGroup) break;
1009
+ let items = new Set(bestGroupItems), options = bestGroupOptions, groupChildren = !options || !1 !== options.groupChildren;
1010
+ for (let item of items)for (let group of (itemsWithGroups.delete(item), item.groups)){
1011
+ let state = groupMap.get(group);
1012
+ void 0 !== state && (state.items.delete(item), 0 === state.items.size ? groupMap.delete(group) : (state.options = void 0, groupChildren && (state.used = !0)));
1013
+ }
1014
+ groupMap.delete(bestGroup);
1015
+ let key = bestGroup.name, groupConfig = bestGroup.config, allItems = Array.from(items, ({ item })=>item);
1016
+ bestGroup.alreadyGrouped = !0;
1017
+ let children = groupChildren ? runGrouping(items) : allItems;
1018
+ bestGroup.alreadyGrouped = !1, results.push(groupConfig.createGroup(key, children, allItems));
1019
+ }
1020
+ for (let { item } of itemsWithGroups)results.push(item);
1021
+ return results;
1022
+ };
1023
+ return runGrouping(itemsWithGroups);
1024
+ })(resultItems, groupConfigs));
1022
1025
  let finalResultItems = this._forEachLevelFilter(this.hooks.filterResults, this._caches.filterResults, type, resultItems, (h, r, idx, i)=>h.call(r, context, idx, i), !1), result = this._forEachLevel(this.hooks.merge, this._caches.merge, type, (h)=>h.call(finalResultItems, context));
1023
1026
  return void 0 === result && (result = finalResultItems), this._forEachLevelWaterfall(this.hooks.result, this._caches.result, type, result, (h, r)=>h.call(r, context));
1024
1027
  }
@@ -1757,6 +1760,24 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
1757
1760
  });
1758
1761
  }
1759
1762
  fileDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().fileDependencies, (d)=>this.#inner.addFileDependencies(d));
1763
+ get __internal__addedFileDependencies() {
1764
+ return this.#inner.dependencies().addedFileDependencies;
1765
+ }
1766
+ get __internal__removedFileDependencies() {
1767
+ return this.#inner.dependencies().removedFileDependencies;
1768
+ }
1769
+ get __internal__addedContextDependencies() {
1770
+ return this.#inner.dependencies().addedContextDependencies;
1771
+ }
1772
+ get __internal__removedContextDependencies() {
1773
+ return this.#inner.dependencies().removedContextDependencies;
1774
+ }
1775
+ get __internal__addedMissingDependencies() {
1776
+ return this.#inner.dependencies().addedMissingDependencies;
1777
+ }
1778
+ get __internal__removedMissingDependencies() {
1779
+ return this.#inner.dependencies().removedMissingDependencies;
1780
+ }
1760
1781
  contextDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().contextDependencies, (d)=>this.#inner.addContextDependencies(d));
1761
1782
  missingDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().missingDependencies, (d)=>this.#inner.addMissingDependencies(d));
1762
1783
  buildDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().buildDependencies, (d)=>this.#inner.addBuildDependencies(d));
@@ -1974,22 +1995,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
1974
1995
  super(error.message), this.name = "HookWebpackError", this.hook = hook, this.error = error, this.hideStack = !0, this.details = `caused by plugins in ${hook}\n${error.stack}`, this.stack += `\n-- inner error --\n${error.stack}`;
1975
1996
  }
1976
1997
  }
1977
- let makeWebpackError = (error, hook)=>error instanceof WebpackError ? error : new HookWebpackError(error, hook), makeWebpackErrorCallback = (callback, hook)=>(err, result)=>{
1998
+ let makeWebpackErrorCallback = (callback, hook)=>(err, result)=>{
1978
1999
  if (err) return err instanceof WebpackError ? void callback(err) : void callback(new HookWebpackError(err, hook));
1979
2000
  callback(null, result);
1980
- }, tryRunOrWebpackError = (fn, hook)=>{
1981
- let r;
1982
- try {
1983
- r = fn();
1984
- } catch (err) {
1985
- if (err instanceof WebpackError) throw err;
1986
- throw new HookWebpackError(err, hook);
1987
- }
1988
- return r;
1989
- }, needCalls = (times, callback)=>{
1990
- let leftTimes = times;
1991
- return (err)=>0 == --leftTimes ? callback() : err && leftTimes > 0 ? (leftTimes = 0, callback()) : void 0;
1992
- };
2001
+ };
1993
2002
  class Cache {
1994
2003
  static STAGE_DISK = 10;
1995
2004
  static STAGE_MEMORY = -10;
@@ -2019,10 +2028,11 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2019
2028
  get(identifier, etag, callback) {
2020
2029
  let gotHandlers = [];
2021
2030
  this.hooks.get.callAsync(identifier, etag, gotHandlers, (err, res)=>{
2022
- if (err) return void callback(makeWebpackError(err, "Cache.hooks.get"));
2031
+ var error, hook, times, callback1;
2032
+ if (err) return void callback((hook = "Cache.hooks.get", (error = err) instanceof WebpackError ? error : new HookWebpackError(error, hook)));
2023
2033
  let result = res;
2024
2034
  if (null === result && (result = void 0), gotHandlers.length > 1) {
2025
- let innerCallback = needCalls(gotHandlers.length, ()=>callback(null, result));
2035
+ let leftTimes, innerCallback = (times = gotHandlers.length, callback1 = ()=>callback(null, result), leftTimes = times, (err)=>0 == --leftTimes ? callback1() : err && leftTimes > 0 ? (leftTimes = 0, callback1()) : void 0);
2026
2036
  for (let gotHandler of gotHandlers)gotHandler(result, innerCallback);
2027
2037
  } else 1 === gotHandlers.length ? gotHandlers[0](result, ()=>callback(null, result)) : callback(null, result);
2028
2038
  });
@@ -2151,18 +2161,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2151
2161
  return old.reset(), old;
2152
2162
  }
2153
2163
  return new WasmHash(new WebAssembly.Instance(wasmModule), instancesPool, chunkSize, digestSize);
2154
- }, hash_md4 = ()=>{
2155
- if (!createMd4) {
2156
- 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"));
2157
- createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
2158
- }
2159
- return createMd4();
2160
- }, hash_xxhash64 = ()=>{
2161
- if (!createXxhash64) {
2162
- 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"));
2163
- createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
2164
- }
2165
- return createXxhash64();
2166
2164
  }, digestCaches = {};
2167
2165
  class BulkUpdateDecorator extends Hash {
2168
2166
  hash;
@@ -2221,9 +2219,21 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2221
2219
  case "debug":
2222
2220
  return new DebugHash();
2223
2221
  case "xxhash64":
2224
- return new WasmHashAdapter(hash_xxhash64());
2222
+ return new WasmHashAdapter((()=>{
2223
+ if (!createXxhash64) {
2224
+ 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"));
2225
+ createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
2226
+ }
2227
+ return createXxhash64();
2228
+ })());
2225
2229
  case "md4":
2226
- return new WasmHashAdapter(hash_md4());
2230
+ return new WasmHashAdapter((()=>{
2231
+ if (!createMd4) {
2232
+ 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"));
2233
+ createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
2234
+ }
2235
+ return createMd4();
2236
+ })());
2227
2237
  case "native-md4":
2228
2238
  return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash("md4"), "md4");
2229
2239
  default:
@@ -2245,22 +2255,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2245
2255
  return this._hash;
2246
2256
  }
2247
2257
  }
2248
- let mapStrings = new Map(), mapObjects = new WeakMap(), getLazyHashedEtag_getter = (obj, hashFunction = "xxhash64")=>{
2249
- let innerMap;
2250
- if ("string" == typeof hashFunction) {
2251
- if (void 0 === (innerMap = mapStrings.get(hashFunction))) {
2252
- let newHash = new LazyHashedEtag(obj, hashFunction);
2253
- return (innerMap = new WeakMap()).set(obj, newHash), mapStrings.set(hashFunction, innerMap), newHash;
2254
- }
2255
- } else if (void 0 === (innerMap = mapObjects.get(hashFunction))) {
2256
- let newHash = new LazyHashedEtag(obj, hashFunction);
2257
- return (innerMap = new WeakMap()).set(obj, newHash), mapObjects.set(hashFunction, innerMap), newHash;
2258
- }
2259
- let hash = innerMap.get(obj);
2260
- if (void 0 !== hash) return hash;
2261
- let newHash = new LazyHashedEtag(obj, hashFunction);
2262
- return innerMap.set(obj, newHash), newHash;
2263
- };
2258
+ let mapStrings = new Map(), mapObjects = new WeakMap();
2264
2259
  class MergedEtag {
2265
2260
  a;
2266
2261
  b;
@@ -2271,31 +2266,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2271
2266
  return `${this.a.toString()}|${this.b.toString()}`;
2272
2267
  }
2273
2268
  }
2274
- let dualObjectMap = new WeakMap(), objectStringMap = new WeakMap(), mergeEtags = (first, second)=>{
2275
- let a = first, b = second;
2276
- if ("string" == typeof a) {
2277
- if ("string" == typeof b) return `${a}|${b}`;
2278
- let temp = b;
2279
- b = a, a = temp;
2280
- } else if ("string" != typeof b) {
2281
- let map = dualObjectMap.get(a);
2282
- void 0 === map && dualObjectMap.set(a, map = new WeakMap());
2283
- let mergedEtag = map.get(b);
2284
- if (void 0 === mergedEtag) {
2285
- let newMergedEtag = new MergedEtag(a, b);
2286
- return map.set(b, newMergedEtag), newMergedEtag;
2287
- }
2288
- return mergedEtag;
2289
- }
2290
- let map = objectStringMap.get(a);
2291
- void 0 === map && objectStringMap.set(a, map = new Map());
2292
- let mergedEtag = map.get(b);
2293
- if (void 0 === mergedEtag) {
2294
- let newMergedEtag = new MergedEtag(a, b);
2295
- return map.set(b, newMergedEtag), newMergedEtag;
2296
- }
2297
- return mergedEtag;
2298
- };
2269
+ let dualObjectMap = new WeakMap(), objectStringMap = new WeakMap();
2299
2270
  class ItemCacheFacade {
2300
2271
  _cache;
2301
2272
  _name;
@@ -2353,10 +2324,49 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2353
2324
  return new ItemCacheFacade(this._cache, `${this._name}|${identifier}`, etag);
2354
2325
  }
2355
2326
  getLazyHashedEtag(obj) {
2356
- return getLazyHashedEtag_getter(obj, this._hashFunction);
2327
+ return ((obj, hashFunction = "xxhash64")=>{
2328
+ let innerMap;
2329
+ if ("string" == typeof hashFunction) {
2330
+ if (void 0 === (innerMap = mapStrings.get(hashFunction))) {
2331
+ let newHash = new LazyHashedEtag(obj, hashFunction);
2332
+ return (innerMap = new WeakMap()).set(obj, newHash), mapStrings.set(hashFunction, innerMap), newHash;
2333
+ }
2334
+ } else if (void 0 === (innerMap = mapObjects.get(hashFunction))) {
2335
+ let newHash = new LazyHashedEtag(obj, hashFunction);
2336
+ return (innerMap = new WeakMap()).set(obj, newHash), mapObjects.set(hashFunction, innerMap), newHash;
2337
+ }
2338
+ let hash = innerMap.get(obj);
2339
+ if (void 0 !== hash) return hash;
2340
+ let newHash = new LazyHashedEtag(obj, hashFunction);
2341
+ return innerMap.set(obj, newHash), newHash;
2342
+ })(obj, this._hashFunction);
2357
2343
  }
2358
2344
  mergeEtags(a, b) {
2359
- return mergeEtags(a, b);
2345
+ return ((first, second)=>{
2346
+ let a = first, b = second;
2347
+ if ("string" == typeof a) {
2348
+ if ("string" == typeof b) return `${a}|${b}`;
2349
+ let temp = b;
2350
+ b = a, a = temp;
2351
+ } else if ("string" != typeof b) {
2352
+ let map = dualObjectMap.get(a);
2353
+ void 0 === map && dualObjectMap.set(a, map = new WeakMap());
2354
+ let mergedEtag = map.get(b);
2355
+ if (void 0 === mergedEtag) {
2356
+ let newMergedEtag = new MergedEtag(a, b);
2357
+ return map.set(b, newMergedEtag), newMergedEtag;
2358
+ }
2359
+ return mergedEtag;
2360
+ }
2361
+ let map = objectStringMap.get(a);
2362
+ void 0 === map && objectStringMap.set(a, map = new Map());
2363
+ let mergedEtag = map.get(b);
2364
+ if (void 0 === mergedEtag) {
2365
+ let newMergedEtag = new MergedEtag(a, b);
2366
+ return map.set(b, newMergedEtag), newMergedEtag;
2367
+ }
2368
+ return mergedEtag;
2369
+ })(a, b);
2360
2370
  }
2361
2371
  get(identifier, etag, callback) {
2362
2372
  this._cache.get(`${this._name}|${identifier}`, etag, callback);
@@ -2416,16 +2426,16 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2416
2426
  if (external_node_path_default().posix.isAbsolute(rootPath)) return external_node_path_default().posix.join(rootPath, filename);
2417
2427
  if (external_node_path_default().win32.isAbsolute(rootPath)) return external_node_path_default().win32.join(rootPath, filename);
2418
2428
  throw Error(`${rootPath} is neither a posix nor a windows path, and there is no 'join' method defined in the file system`);
2419
- }, dirname = (fs, absPath)=>{
2420
- if (fs?.dirname) return fs.dirname(absPath);
2421
- if (external_node_path_default().posix.isAbsolute(absPath)) return external_node_path_default().posix.dirname(absPath);
2422
- if (external_node_path_default().win32.isAbsolute(absPath)) return external_node_path_default().win32.dirname(absPath);
2423
- throw Error(`${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`);
2424
2429
  }, mkdirp = (fs, p, callback)=>{
2425
2430
  fs.mkdir(p, (err)=>{
2426
2431
  if (err) {
2427
2432
  if ("ENOENT" === err.code) {
2428
- let dir = dirname(fs, p);
2433
+ let dir = ((fs, absPath)=>{
2434
+ if (fs?.dirname) return fs.dirname(absPath);
2435
+ if (external_node_path_default().posix.isAbsolute(absPath)) return external_node_path_default().posix.dirname(absPath);
2436
+ if (external_node_path_default().win32.isAbsolute(absPath)) return external_node_path_default().win32.dirname(absPath);
2437
+ throw Error(`${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`);
2438
+ })(fs, p);
2429
2439
  return dir === p ? void callback(err) : void mkdirp(fs, dir, (err)=>{
2430
2440
  if (err) return void callback(err);
2431
2441
  fs.mkdir(p, (err)=>{
@@ -2678,13 +2688,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2678
2688
  if ("string" == typeof bufLike) return Buffer.from(bufLike);
2679
2689
  if (bufLike instanceof Uint8Array) return Buffer.from(bufLike.buffer);
2680
2690
  throw Error("Buffer, Uint8Array or string expected");
2681
- }, toObject = (input)=>{
2682
- let s;
2683
- if (Buffer.isBuffer(input)) s = input.toString("utf8");
2684
- else if (input && "object" == typeof input) return input;
2685
- else if ("string" == typeof input) s = input;
2686
- else throw Error("Buffer or string or object expected");
2687
- return JSON.parse(s);
2688
2691
  };
2689
2692
  function serializeObject(map) {
2690
2693
  if (!isNil(map)) return "string" == typeof map ? map ? toBuffer(map) : void 0 : toBuffer(JSON.stringify(map));
@@ -2706,7 +2709,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2706
2709
  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);
2707
2710
  }
2708
2711
  return maybeAbsolutePath;
2709
- }, requestToAbsolute = (context, relativePath)=>relativePath.startsWith("./") || relativePath.startsWith("../") ? external_node_path_default().join(context, relativePath) : relativePath, makeCacheable = (realFn)=>{
2712
+ }, makeCacheable = (realFn)=>{
2710
2713
  let cache = new WeakMap(), getCache = (associatedObjectForCache)=>{
2711
2714
  let entry = cache.get(associatedObjectForCache);
2712
2715
  if (void 0 !== entry) return entry;
@@ -2760,7 +2763,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2760
2763
  return innerSubCache?.set(identifier, result), result;
2761
2764
  };
2762
2765
  }, cachedFn;
2763
- }, makePathsRelative = makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join("")), contextify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>absoluteToRequest(context, r)).join("!")), absolutify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>requestToAbsolute(context, r)).join("!")), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/, parseResource = makeCacheable((str)=>{
2766
+ }, makePathsRelative = makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join("")), contextify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>absoluteToRequest(context, r)).join("!")), absolutify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>{
2767
+ var context1, relativePath;
2768
+ return context1 = context, (relativePath = r).startsWith("./") || relativePath.startsWith("../") ? external_node_path_default().join(context1, relativePath) : relativePath;
2769
+ }).join("!")), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/, parseResource = makeCacheable((str)=>{
2764
2770
  let match = PATH_QUERY_FRAGMENT_REGEXP.exec(str);
2765
2771
  return {
2766
2772
  resource: str,
@@ -2915,9 +2921,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2915
2921
  "contextDependencies",
2916
2922
  "missingDependencies",
2917
2923
  "buildDependencies"
2918
- ]), commitCustomFieldsToRust = (buildInfo)=>{
2919
- Object.keys(buildInfo).some((key)=>!knownBuildInfoFields.has(key)) && buildInfo[binding_.COMMIT_CUSTOM_FIELDS_SYMBOL]();
2920
- };
2924
+ ]);
2921
2925
  Object.defineProperty(binding_.NormalModule.prototype, "identifier", {
2922
2926
  enumerable: !0,
2923
2927
  configurable: !0,
@@ -2938,9 +2942,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2938
2942
  return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
2939
2943
  }
2940
2944
  });
2941
- let createFakeHook = (fakeHook, message, code)=>Object.freeze(Object.assign(message && code ? deprecateAllProperties(fakeHook, message, code) : fakeHook, {
2942
- _fakeHook: !0
2943
- })), deprecateAllProperties = (obj, message, code)=>{
2945
+ let deprecateAllProperties = (obj, message, code)=>{
2944
2946
  let newObj = {}, descriptors = Object.getOwnPropertyDescriptors(obj);
2945
2947
  for (let name of Object.keys(descriptors)){
2946
2948
  let descriptor = descriptors[name];
@@ -2977,12 +2979,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2977
2979
  "module"
2978
2980
  ]),
2979
2981
  readResourceForScheme: new lite_tapable_namespaceObject.HookMap((scheme)=>{
2980
- let hook = hooks.readResource.for(scheme);
2981
- return createFakeHook({
2982
+ let fakeHook, message, code, hook = hooks.readResource.for(scheme);
2983
+ return fakeHook = {
2982
2984
  tap: (options, fn)=>hook.tap(options, (loaderContext)=>fn(loaderContext.resource)),
2983
2985
  tapAsync: (options, fn)=>hook.tapAsync(options, (loaderContext, callback)=>fn(loaderContext.resource, callback)),
2984
2986
  tapPromise: (options, fn)=>hook.tapPromise(options, (loaderContext)=>fn(loaderContext.resource))
2985
- });
2987
+ }, Object.freeze(Object.assign(message && code ? deprecateAllProperties(fakeHook, message, code) : fakeHook, {
2988
+ _fakeHook: !0
2989
+ }));
2986
2990
  }),
2987
2991
  readResource: new lite_tapable_namespaceObject.HookMap(()=>new lite_tapable_namespaceObject.AsyncSeriesBailHook([
2988
2992
  "loaderContext"
@@ -3020,55 +3024,53 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3020
3024
  }
3021
3025
  static async cleanupJavaScriptTrace() {
3022
3026
  if ("uninitialized" === this.state) throw Error("JavaScriptTracer is not initialized, please call initJavaScriptTrace first");
3023
- if (!this.layer || "off" === this.state) return;
3024
- let profileHandler = (err, param)=>{
3025
- let cpu_profile;
3026
- if (err ? console.error("Error stopping profiler:", err) : cpu_profile = param.profile, cpu_profile) {
3027
- let uuid = this.uuid();
3028
- this.pushEvent({
3029
- name: "Profile",
3030
- ph: "P",
3031
- trackName: "JavaScript CPU Profiler",
3032
- processName: "JavaScript CPU",
3033
- uuid,
3034
- ...this.getCommonEv(),
3035
- categories: [
3036
- "disabled-by-default-v8.cpu_profiler"
3037
- ],
3038
- args: {
3039
- data: {
3040
- startTime: 0
3041
- }
3042
- }
3043
- }), this.pushEvent({
3044
- name: "ProfileChunk",
3045
- ph: "P",
3046
- trackName: "JavaScript CPU Profiler",
3047
- processName: "JavaScript CPU",
3048
- ...this.getCommonEv(),
3049
- categories: [
3050
- "disabled-by-default-v8.cpu_profiler"
3051
- ],
3052
- uuid,
3053
- args: {
3054
- data: {
3055
- cpuProfile: cpu_profile,
3056
- timeDeltas: cpu_profile.timeDeltas
3057
- }
3058
- }
3059
- });
3060
- }
3061
- };
3062
- await new Promise((resolve, reject)=>{
3027
+ this.layer && "off" !== this.state && (await new Promise((resolve, reject)=>{
3063
3028
  this.session.post("Profiler.stop", (err, params)=>{
3064
3029
  if (err) reject(err);
3065
3030
  else try {
3066
- profileHandler(err, params), resolve();
3031
+ let cpu_profile;
3032
+ var err1 = err, param = params;
3033
+ if (err1 ? console.error("Error stopping profiler:", err1) : cpu_profile = param.profile, cpu_profile) {
3034
+ let uuid = this.uuid();
3035
+ this.pushEvent({
3036
+ name: "Profile",
3037
+ ph: "P",
3038
+ trackName: "JavaScript CPU Profiler",
3039
+ processName: "JavaScript CPU",
3040
+ uuid,
3041
+ ...this.getCommonEv(),
3042
+ categories: [
3043
+ "disabled-by-default-v8.cpu_profiler"
3044
+ ],
3045
+ args: {
3046
+ data: {
3047
+ startTime: 0
3048
+ }
3049
+ }
3050
+ }), this.pushEvent({
3051
+ name: "ProfileChunk",
3052
+ ph: "P",
3053
+ trackName: "JavaScript CPU Profiler",
3054
+ processName: "JavaScript CPU",
3055
+ ...this.getCommonEv(),
3056
+ categories: [
3057
+ "disabled-by-default-v8.cpu_profiler"
3058
+ ],
3059
+ uuid,
3060
+ args: {
3061
+ data: {
3062
+ cpuProfile: cpu_profile,
3063
+ timeDeltas: cpu_profile.timeDeltas
3064
+ }
3065
+ }
3066
+ });
3067
+ }
3068
+ resolve();
3067
3069
  } catch (err) {
3068
3070
  reject(err);
3069
3071
  }
3070
3072
  });
3071
- }), this.state = "off";
3073
+ }), this.state = "off");
3072
3074
  }
3073
3075
  static getTs() {
3074
3076
  return process.hrtime.bigint() - this.startTime;
@@ -3182,7 +3184,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3182
3184
  error: serializeError(e)
3183
3185
  });
3184
3186
  }
3185
- Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0, Number.POSITIVE_INFINITY);
3187
+ Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0, 1 / 0);
3186
3188
  }), mainSyncPort.on("messageerror", handleError);
3187
3189
  var obj = task, loaderName1 = loaderName;
3188
3190
  let errors = [];
@@ -3356,7 +3358,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3356
3358
  }
3357
3359
  class JsSourceMap {
3358
3360
  static __from_binding(map) {
3359
- return isNil(map) ? void 0 : toObject(map);
3361
+ return isNil(map) ? void 0 : ((input)=>{
3362
+ let s;
3363
+ if (Buffer.isBuffer(input)) s = input.toString("utf8");
3364
+ else if (input && "object" == typeof input) return input;
3365
+ else if ("string" == typeof input) s = input;
3366
+ else throw Error("Buffer or string or object expected");
3367
+ return JSON.parse(s);
3368
+ })(map);
3360
3369
  }
3361
3370
  static __to_binding(map) {
3362
3371
  return serializeObject(map);
@@ -3366,6 +3375,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3366
3375
  return loaderContext.loaders?.length && index < loaderContext.loaders.length && index >= 0 && loaderContext.loaders[index] ? loaderContext.loaders[index] : null;
3367
3376
  }
3368
3377
  async function runLoaders(compiler, context) {
3378
+ var buildInfo;
3369
3379
  let loaderState = context.loaderState, pitch = loaderState === binding_.JsLoaderState.Pitching, { resource } = context, uuid = JavaScriptTracer.uuid();
3370
3380
  JavaScriptTracer.startAsync({
3371
3381
  name: "run_js_loaders",
@@ -3564,63 +3574,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3564
3574
  enumerable: !0,
3565
3575
  get: ()=>context.__internal__parseMeta
3566
3576
  });
3567
- let getWorkerLoaderContext = ()=>{
3568
- let normalModule = loaderContext._module instanceof binding_.NormalModule ? loaderContext._module : void 0, workerLoaderContext = {
3569
- hot: loaderContext.hot,
3570
- context: loaderContext.context,
3571
- resourcePath: loaderContext.resourcePath,
3572
- resourceQuery: loaderContext.resourceQuery,
3573
- resourceFragment: loaderContext.resourceFragment,
3574
- resource: loaderContext.resource,
3575
- mode: loaderContext.mode,
3576
- sourceMap: loaderContext.sourceMap,
3577
- rootContext: loaderContext.context,
3578
- loaderIndex: loaderContext.loaderIndex,
3579
- loaders: loaderContext.loaders.map((item)=>{
3580
- let options = item.options;
3581
- return (!item.parallel || item.request.startsWith(BUILTIN_LOADER_PREFIX)) && (options = void 0), {
3582
- ...item,
3583
- options,
3584
- pitch: void 0,
3585
- normal: void 0,
3586
- normalExecuted: item.normalExecuted,
3587
- pitchExecuted: item.pitchExecuted
3588
- };
3589
- }),
3590
- __internal__workerInfo: {
3591
- hashFunction: compiler._lastCompilation.outputOptions.hashFunction
3592
- },
3593
- _compiler: {
3594
- options: {
3595
- experiments: {
3596
- css: compiler.options.experiments.css
3597
- }
3598
- }
3599
- },
3600
- _compilation: {
3601
- options: {
3602
- output: {
3603
- environment: compiler._lastCompilation.outputOptions.environment
3604
- }
3605
- },
3606
- outputOptions: {
3607
- hashSalt: compiler._lastCompilation.outputOptions.hashSalt,
3608
- hashFunction: compiler._lastCompilation.outputOptions.hashFunction,
3609
- hashDigest: compiler._lastCompilation.outputOptions.hashDigest,
3610
- hashDigestLength: compiler._lastCompilation.outputOptions.hashDigestLength
3611
- }
3612
- },
3613
- _module: {
3614
- type: loaderContext._module.type,
3615
- identifier: loaderContext._module.identifier(),
3616
- matchResource: normalModule?.matchResource,
3617
- request: normalModule?.request,
3618
- userRequest: normalModule?.userRequest,
3619
- rawRequest: normalModule?.rawRequest
3620
- }
3621
- };
3622
- return Object.assign(workerLoaderContext, compiler.options.loader), workerLoaderContext;
3623
- }, enableParallelism = (currentLoaderObject)=>compiler.options.experiments.parallelLoader && currentLoaderObject?.parallel, isomorphoicRun = async (fn, args)=>{
3577
+ let enableParallelism = (currentLoaderObject)=>compiler.options.experiments.parallelLoader && currentLoaderObject?.parallel, isomorphoicRun = async (fn, args)=>{
3624
3578
  let result, currentLoaderObject = getCurrentLoader(loaderContext), parallelism = enableParallelism(currentLoaderObject), pitch = loaderState === binding_.JsLoaderState.Pitching, loaderName = function(loaderPath, cwd = "") {
3625
3579
  let res = loaderPath.replace(cwd, "");
3626
3580
  if (!external_node_path_default().isAbsolute(res)) return res;
@@ -3642,7 +3596,63 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3642
3596
  resource: resource
3643
3597
  }
3644
3598
  }), parallelism) result = await service_run(loaderName, {
3645
- loaderContext: getWorkerLoaderContext(),
3599
+ loaderContext: (()=>{
3600
+ let normalModule = loaderContext._module instanceof binding_.NormalModule ? loaderContext._module : void 0, workerLoaderContext = {
3601
+ hot: loaderContext.hot,
3602
+ context: loaderContext.context,
3603
+ resourcePath: loaderContext.resourcePath,
3604
+ resourceQuery: loaderContext.resourceQuery,
3605
+ resourceFragment: loaderContext.resourceFragment,
3606
+ resource: loaderContext.resource,
3607
+ mode: loaderContext.mode,
3608
+ sourceMap: loaderContext.sourceMap,
3609
+ rootContext: loaderContext.context,
3610
+ loaderIndex: loaderContext.loaderIndex,
3611
+ loaders: loaderContext.loaders.map((item)=>{
3612
+ let options = item.options;
3613
+ return (!item.parallel || item.request.startsWith(BUILTIN_LOADER_PREFIX)) && (options = void 0), {
3614
+ ...item,
3615
+ options,
3616
+ pitch: void 0,
3617
+ normal: void 0,
3618
+ normalExecuted: item.normalExecuted,
3619
+ pitchExecuted: item.pitchExecuted
3620
+ };
3621
+ }),
3622
+ __internal__workerInfo: {
3623
+ hashFunction: compiler._lastCompilation.outputOptions.hashFunction
3624
+ },
3625
+ _compiler: {
3626
+ options: {
3627
+ experiments: {
3628
+ css: compiler.options.experiments.css
3629
+ }
3630
+ }
3631
+ },
3632
+ _compilation: {
3633
+ options: {
3634
+ output: {
3635
+ environment: compiler._lastCompilation.outputOptions.environment
3636
+ }
3637
+ },
3638
+ outputOptions: {
3639
+ hashSalt: compiler._lastCompilation.outputOptions.hashSalt,
3640
+ hashFunction: compiler._lastCompilation.outputOptions.hashFunction,
3641
+ hashDigest: compiler._lastCompilation.outputOptions.hashDigest,
3642
+ hashDigestLength: compiler._lastCompilation.outputOptions.hashDigestLength
3643
+ }
3644
+ },
3645
+ _module: {
3646
+ type: loaderContext._module.type,
3647
+ identifier: loaderContext._module.identifier(),
3648
+ matchResource: normalModule?.matchResource,
3649
+ request: normalModule?.request,
3650
+ userRequest: normalModule?.userRequest,
3651
+ rawRequest: normalModule?.rawRequest
3652
+ }
3653
+ };
3654
+ return Object.assign(workerLoaderContext, compiler.options.loader), workerLoaderContext;
3655
+ })(),
3646
3656
  loaderState,
3647
3657
  args
3648
3658
  }, {
@@ -3833,7 +3843,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3833
3843
  is_pitch: pitch,
3834
3844
  resource: resource
3835
3845
  }
3836
- }), compiler.options.experiments.cache && compiler.options?.cache && commitCustomFieldsToRust(context._module.buildInfo), context;
3846
+ }), compiler.options.experiments.cache && compiler.options?.cache && Object.keys(buildInfo = context._module.buildInfo).some((key)=>!knownBuildInfoFields.has(key)) && buildInfo[binding_.COMMIT_CUSTOM_FIELDS_SYMBOL](), context;
3837
3847
  }
3838
3848
  let loader_runner_PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/;
3839
3849
  function parsePathQueryFragment(str) {
@@ -3857,8 +3867,41 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3857
3867
  ], path1 = path, options1 = options, uses1.length ? uses1.filter(Boolean).map((use, index)=>{
3858
3868
  let o, isBuiltin = !1;
3859
3869
  if (use.loader.startsWith(BUILTIN_LOADER_PREFIX)) {
3860
- var identifier, o1, options;
3861
- let temp = (identifier = use.loader, o1 = use.options, options = options1, identifier.startsWith(`${BUILTIN_LOADER_PREFIX}swc-loader`) ? getSwcLoaderOptions(o1, options) : identifier.startsWith(`${BUILTIN_LOADER_PREFIX}lightningcss-loader`) ? getLightningcssLoaderOptions(o1, options) : o1);
3870
+ let temp = function(identifier, o, options) {
3871
+ if (identifier.startsWith(`${BUILTIN_LOADER_PREFIX}swc-loader`)) {
3872
+ var o1, options1, options2 = o;
3873
+ if (options2 && "object" == typeof options2) {
3874
+ options2.jsc ??= {}, options2.jsc.experimental ??= {}, options2.jsc.experimental.disableAllLints ??= !0;
3875
+ let { rspackExperiments } = options2;
3876
+ rspackExperiments && ((rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
3877
+ if (pluginImport) return pluginImport.map((config)=>{
3878
+ let rawConfig = {
3879
+ ...config,
3880
+ style: {}
3881
+ };
3882
+ if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
3883
+ else if ("string" == typeof config.style) {
3884
+ let isTpl = config.style.includes("{{");
3885
+ rawConfig.style[isTpl ? "custom" : "css"] = config.style;
3886
+ } else {
3887
+ var val;
3888
+ val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
3889
+ }
3890
+ return config.styleLibraryDirectory && (rawConfig.style = {
3891
+ styleLibraryDirectory: config.styleLibraryDirectory
3892
+ }), rawConfig;
3893
+ });
3894
+ }(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
3895
+ typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
3896
+ exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum ? "none" : "const-only"
3897
+ }));
3898
+ }
3899
+ return options2;
3900
+ }
3901
+ return identifier.startsWith(`${BUILTIN_LOADER_PREFIX}lightningcss-loader`) ? ((o1 = o) && "object" == typeof o1 && ("string" == typeof o1.targets && (o1.targets = [
3902
+ o1.targets
3903
+ ]), o1.include && "object" == typeof o1.include && (o1.include = toFeatures(o1.include)), o1.exclude && "object" == typeof o1.exclude && (o1.exclude = toFeatures(o1.exclude))), o1) : o;
3904
+ }(use.loader, use.options, 0);
3862
3905
  o = isNil(temp) ? void 0 : "string" == typeof temp ? temp : JSON.stringify(temp, null, 2), isBuiltin = !0;
3863
3906
  }
3864
3907
  return {
@@ -3873,125 +3916,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3873
3916
  };
3874
3917
  }) : [];
3875
3918
  }
3876
- let getSwcLoaderOptions = (options, _)=>{
3877
- if (options && "object" == typeof options) {
3878
- options.jsc ??= {}, options.jsc.experimental ??= {}, options.jsc.experimental.disableAllLints ??= !0;
3879
- let { rspackExperiments } = options;
3880
- if (rspackExperiments) {
3881
- var options1;
3882
- (rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
3883
- if (pluginImport) return pluginImport.map((config)=>{
3884
- let rawConfig = {
3885
- ...config,
3886
- style: {}
3887
- };
3888
- if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
3889
- else if ("string" == typeof config.style) {
3890
- let isTpl = config.style.includes("{{");
3891
- rawConfig.style[isTpl ? "custom" : "css"] = config.style;
3892
- } else {
3893
- var val;
3894
- val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
3895
- }
3896
- return config.styleLibraryDirectory && (rawConfig.style = {
3897
- styleLibraryDirectory: config.styleLibraryDirectory
3898
- }), rawConfig;
3899
- });
3900
- }(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
3901
- typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
3902
- exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum ? "none" : "const-only"
3903
- });
3904
- }
3905
- }
3906
- return options;
3907
- }, getLightningcssLoaderOptions = (o, _)=>(o && "object" == typeof o && ("string" == typeof o.targets && (o.targets = [
3908
- o.targets
3909
- ]), o.include && "object" == typeof o.include && (o.include = toFeatures(o.include)), o.exclude && "object" == typeof o.exclude && (o.exclude = toFeatures(o.exclude))), o);
3910
3919
  function isUseSourceMap(devtool) {
3911
3920
  return !!devtool && devtool.includes("source-map") && (devtool.includes("module") || !devtool.includes("cheap"));
3912
3921
  }
3913
- let getRawOptions = (options, compiler)=>{
3914
- var output, module, options1, parser, generator, stats;
3915
- let mode = options.mode, experiments = options.experiments;
3916
- return {
3917
- name: options.name,
3918
- mode,
3919
- context: options.context,
3920
- output: {
3921
- ...output = options.output,
3922
- environment: function(environment = {}) {
3923
- return {
3924
- const: !!environment.const,
3925
- arrowFunction: !!environment.arrowFunction,
3926
- nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
3927
- asyncFunction: !!environment.asyncFunction,
3928
- bigIntLiteral: !!environment.bigIntLiteral,
3929
- destructuring: !!environment.destructuring,
3930
- document: !!environment.document,
3931
- dynamicImport: !!environment.dynamicImport,
3932
- forOf: !!environment.forOf,
3933
- globalThis: !!environment.globalThis,
3934
- module: !!environment.module,
3935
- optionalChaining: !!environment.optionalChaining,
3936
- templateLiteral: !!environment.templateLiteral
3937
- };
3938
- }(output.environment)
3939
- },
3940
- resolve: getRawResolve(options.resolve),
3941
- resolveLoader: getRawResolve(options.resolveLoader),
3942
- module: (module = options.module, options1 = {
3943
- compiler,
3944
- mode,
3945
- context: options.context,
3946
- experiments
3947
- }, external_node_assert_default()(!isNil(module.defaultRules), "module.defaultRules should not be nil after defaults"), {
3948
- rules: [
3949
- {
3950
- rules: module.defaultRules
3951
- },
3952
- {
3953
- rules: module.rules
3954
- }
3955
- ].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
3956
- parser: Object.fromEntries(Object.entries(parser = module.parser).map(([k, v])=>[
3957
- k,
3958
- getRawParserOptions(v, k)
3959
- ]).filter(([k, v])=>void 0 !== v)),
3960
- generator: Object.fromEntries(Object.entries(generator = module.generator).map(([k, v])=>[
3961
- k,
3962
- getRawGeneratorOptions(v, k)
3963
- ]).filter(([k, v])=>void 0 !== v)),
3964
- noParse: module.noParse
3965
- }),
3966
- optimization: options.optimization,
3967
- stats: {
3968
- colors: function(options) {
3969
- if ("boolean" == typeof options || "string" == typeof options) return presetToOptions(options);
3970
- if (!options) return {};
3971
- let obj = {
3972
- ...presetToOptions(options.preset),
3973
- ...options
3974
- };
3975
- return delete obj.preset, obj;
3976
- }(stats = options.stats).colors ?? !1
3977
- },
3978
- cache: {
3979
- type: options.cache ? "memory" : "disable"
3980
- },
3981
- experiments,
3982
- node: function(node) {
3983
- if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
3984
- dirname: String(node.__dirname),
3985
- filename: String(node.__filename),
3986
- global: String(node.global)
3987
- };
3988
- }(options.node),
3989
- profile: options.profile,
3990
- amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
3991
- bail: options.bail,
3992
- __references: {}
3993
- };
3994
- };
3995
3922
  function getRawAlias(alias = {}) {
3996
3923
  return !("object" != typeof alias || null === alias || Array.isArray(alias)) && Object.entries(alias).map(([key, value])=>({
3997
3924
  path: key,
@@ -4217,7 +4144,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
4217
4144
  };
4218
4145
  }
4219
4146
  function getRawGeneratorOptions(generator, type) {
4220
- var options, options1, options2;
4147
+ var options, options1;
4221
4148
  if ("asset" === type) {
4222
4149
  return {
4223
4150
  type: "asset",
@@ -4252,14 +4179,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
4252
4179
  type: "css/module",
4253
4180
  cssModule: getRawCssAutoOrModuleGeneratorOptions(generator)
4254
4181
  };
4255
- if ("json" === type) {
4256
- return {
4257
- type: "json",
4258
- json: {
4259
- JSONParse: (options2 = generator).JSONParse
4260
- }
4261
- };
4262
- }
4182
+ if ("json" === type) return {
4183
+ type: "json",
4184
+ json: {
4185
+ JSONParse: generator.JSONParse
4186
+ }
4187
+ };
4263
4188
  if (![
4264
4189
  "asset/source",
4265
4190
  "javascript",
@@ -4339,7 +4264,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
4339
4264
  return Array.isArray(str) ? str.join("\n") : str;
4340
4265
  }
4341
4266
  static getModulesArrayBounds(modules) {
4342
- let maxId = Number.NEGATIVE_INFINITY, minId = Number.POSITIVE_INFINITY;
4267
+ let maxId = -1 / 0, minId = 1 / 0;
4343
4268
  for (let module of modules){
4344
4269
  let moduleId = module.id;
4345
4270
  if ("number" != typeof moduleId) return !1;
@@ -4571,10 +4496,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
4571
4496
  class DynamicEntryPlugin extends RspackBuiltinPlugin {
4572
4497
  context;
4573
4498
  entry;
4574
- name;
4575
- affectedHooks;
4499
+ name = binding_.BuiltinPluginName.DynamicEntryPlugin;
4500
+ affectedHooks = "make";
4576
4501
  constructor(context, entry){
4577
- super(), this.context = context, this.entry = entry, this.name = binding_.BuiltinPluginName.DynamicEntryPlugin, this.affectedHooks = "make";
4502
+ super(), this.context = context, this.entry = entry;
4578
4503
  }
4579
4504
  raw(compiler) {
4580
4505
  let raw = {
@@ -4622,9 +4547,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4622
4547
  };
4623
4548
  class EnableLibraryPlugin extends RspackBuiltinPlugin {
4624
4549
  type;
4625
- name;
4550
+ name = binding_.BuiltinPluginName.EnableLibraryPlugin;
4626
4551
  constructor(type){
4627
- super(), this.type = type, this.name = binding_.BuiltinPluginName.EnableLibraryPlugin;
4552
+ super(), this.type = type;
4628
4553
  }
4629
4554
  static setEnabled(compiler, type) {
4630
4555
  EnableLibraryPlugin_getEnabledTypes(compiler).add(type);
@@ -4641,9 +4566,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4641
4566
  class ExternalsPlugin extends RspackBuiltinPlugin {
4642
4567
  type;
4643
4568
  externals;
4644
- name;
4569
+ name = binding_.BuiltinPluginName.ExternalsPlugin;
4645
4570
  constructor(type, externals){
4646
- super(), this.type = type, this.externals = externals, this.name = binding_.BuiltinPluginName.ExternalsPlugin;
4571
+ super(), this.type = type, this.externals = externals;
4647
4572
  }
4648
4573
  raw(compiler) {
4649
4574
  let { type, externals } = this, raw = {
@@ -4712,10 +4637,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4712
4637
  let FileUriPlugin = base_create(binding_.BuiltinPluginName.FileUriPlugin, ()=>{}, "compilation"), FlagDependencyExportsPlugin = base_create(binding_.BuiltinPluginName.FlagDependencyExportsPlugin, ()=>{}, "compilation");
4713
4638
  class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
4714
4639
  global;
4715
- name;
4716
- affectedHooks;
4640
+ name = binding_.BuiltinPluginName.FlagDependencyUsagePlugin;
4641
+ affectedHooks = "compilation";
4717
4642
  constructor(global){
4718
- super(), this.global = global, this.name = binding_.BuiltinPluginName.FlagDependencyUsagePlugin, this.affectedHooks = "compilation";
4643
+ super(), this.global = global;
4719
4644
  }
4720
4645
  raw(compiler) {
4721
4646
  return createBuiltinPlugin(this.name, this.global);
@@ -4727,9 +4652,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4727
4652
  return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0), createBuiltinPlugin(this.name, void 0);
4728
4653
  }
4729
4654
  }
4730
- let hooks_compilationHooksMap = new WeakMap(), cleanPluginHooks = (compilation)=>{
4731
- hooks_compilationHooksMap.delete(compilation);
4732
- };
4655
+ let hooks_compilationHooksMap = new WeakMap();
4733
4656
  function $constructor(name, initializer, params) {
4734
4657
  function init(inst, def) {
4735
4658
  var _a;
@@ -4760,7 +4683,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4760
4683
  value: name
4761
4684
  }), _;
4762
4685
  }
4763
- Symbol("zod_brand");
4686
+ Object.freeze({
4687
+ status: "aborted"
4688
+ }), Symbol("zod_brand");
4764
4689
  class $ZodAsyncError extends Error {
4765
4690
  constructor(){
4766
4691
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
@@ -4770,9 +4695,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4770
4695
  function core_config(newConfig) {
4771
4696
  return newConfig && Object.assign(globalConfig, newConfig), globalConfig;
4772
4697
  }
4773
- function joinValues(array, separator = "|") {
4774
- return array.map((val)=>stringifyPrimitive(val)).join(separator);
4698
+ let cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, regexes_uuid = (version)=>version ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, base64url = /^[A-Za-z0-9_-]*$/, hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, e164 = /^\+(?:[0-9]){6,14}[0-9]$/, dateSource = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", regexes_date = RegExp(`^${dateSource}$`);
4699
+ function timeSource(args) {
4700
+ let hhmm = "(?:[01]\\d|2[0-3]):[0-5]\\d";
4701
+ return "number" == typeof args.precision ? -1 === args.precision ? `${hhmm}` : 0 === args.precision ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
4775
4702
  }
4703
+ let integer = /^\d+$/, number = /^-?\d+(?:\.\d+)?/i, regexes_boolean = /true|false/i, _null = /null/i, _undefined = /undefined/i, lowercase = /^[^A-Z]*$/, uppercase = /^[^a-z]*$/;
4776
4704
  function jsonStringifyReplacer(_, value) {
4777
4705
  return "bigint" == typeof value ? value.toString() : value;
4778
4706
  }
@@ -4816,18 +4744,15 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4816
4744
  configurable: !0
4817
4745
  });
4818
4746
  }
4819
- function randomString(length = 10) {
4820
- let chars = "abcdefghijklmnopqrstuvwxyz", str = "";
4821
- for(let i = 0; i < length; i++)str += chars[Math.floor(Math.random() * chars.length)];
4822
- return str;
4823
- }
4824
4747
  function esc(str) {
4825
4748
  return JSON.stringify(str);
4826
4749
  }
4750
+ let captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args)=>{};
4827
4751
  function util_isObject(data) {
4828
4752
  return "object" == typeof data && null !== data && !Array.isArray(data);
4829
4753
  }
4830
4754
  let util_allowsEval = util_cached(()=>{
4755
+ if ("undefined" != typeof navigator && navigator?.userAgent?.includes("Cloudflare")) return !1;
4831
4756
  try {
4832
4757
  return Function(""), !0;
4833
4758
  } catch (_) {
@@ -4841,36 +4766,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4841
4766
  let prot = ctor.prototype;
4842
4767
  return !1 !== util_isObject(prot) && !1 !== Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf");
4843
4768
  }
4844
- let getParsedType = (data)=>{
4845
- let t = typeof data;
4846
- switch(t){
4847
- case "undefined":
4848
- return "undefined";
4849
- case "string":
4850
- return "string";
4851
- case "number":
4852
- return Number.isNaN(data) ? "nan" : "number";
4853
- case "boolean":
4854
- return "boolean";
4855
- case "function":
4856
- return "function";
4857
- case "bigint":
4858
- return "bigint";
4859
- case "symbol":
4860
- return "symbol";
4861
- case "object":
4862
- if (Array.isArray(data)) return "array";
4863
- if (null === data) return "null";
4864
- if (data.then && "function" == typeof data.then && data.catch && "function" == typeof data.catch) return "promise";
4865
- if ("undefined" != typeof Map && data instanceof Map) return "map";
4866
- if ("undefined" != typeof Set && data instanceof Set) return "set";
4867
- if ("undefined" != typeof Date && data instanceof Date) return "date";
4868
- if ("undefined" != typeof File && data instanceof File) return "file";
4869
- return "object";
4870
- default:
4871
- throw Error(`Unknown data type: ${t}`);
4872
- }
4873
- }, propertyKeyTypes = new Set([
4769
+ let propertyKeyTypes = new Set([
4874
4770
  "string",
4875
4771
  "number",
4876
4772
  "symbol"
@@ -4896,9 +4792,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4896
4792
  error: ()=>_params.error
4897
4793
  } : _params;
4898
4794
  }
4899
- function stringifyPrimitive(value) {
4900
- return "bigint" == typeof value ? value.toString() + "n" : "string" == typeof value ? `"${value}"` : `${value}`;
4901
- }
4902
4795
  let NUMBER_FORMAT_RANGES = {
4903
4796
  safeint: [
4904
4797
  Number.MIN_SAFE_INTEGER,
@@ -4922,7 +4815,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4922
4815
  ]
4923
4816
  };
4924
4817
  function aborted(x, startIndex = 0) {
4925
- for(let i = startIndex; i < x.issues.length; i++)if (!0 !== x.issues[i].continue) return !0;
4818
+ for(let i = startIndex; i < x.issues.length; i++)if (x.issues[i]?.continue !== !0) return !0;
4926
4819
  return !1;
4927
4820
  }
4928
4821
  function prefixIssues(path, issues) {
@@ -4952,62 +4845,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4952
4845
  ...iss
4953
4846
  };
4954
4847
  }
4955
- let errors_initializer = (inst, def)=>{
4956
- inst.name = "$ZodError", Object.defineProperty(inst, "_zod", {
4957
- value: inst._zod,
4958
- enumerable: !1
4959
- }), Object.defineProperty(inst, "issues", {
4960
- value: def,
4961
- enumerable: !1
4962
- }), Object.defineProperty(inst, "message", {
4963
- get: ()=>JSON.stringify(def, jsonStringifyReplacer, 2),
4964
- enumerable: !0
4965
- });
4966
- }, $ZodError = $constructor("$ZodError", errors_initializer), $ZodRealError = $constructor("$ZodError", errors_initializer, {
4967
- Parent: Error
4968
- }), _safeParse = (_Err)=>(schema, value, _ctx)=>{
4969
- let ctx = _ctx ? {
4970
- ..._ctx,
4971
- async: !1
4972
- } : {
4973
- async: !1
4974
- }, result = schema._zod.run({
4975
- value,
4976
- issues: []
4977
- }, ctx);
4978
- if (result instanceof Promise) throw new $ZodAsyncError();
4979
- return result.issues.length ? {
4980
- success: !1,
4981
- error: new (_Err ?? $ZodError)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
4982
- } : {
4983
- success: !0,
4984
- data: result.value
4985
- };
4986
- }, safeParse = _safeParse($ZodRealError), _safeParseAsync = (_Err)=>async (schema, value, _ctx)=>{
4987
- let ctx = _ctx ? Object.assign(_ctx, {
4988
- async: !0
4989
- }) : {
4990
- async: !0
4991
- }, result = schema._zod.run({
4992
- value,
4993
- issues: []
4994
- }, ctx);
4995
- return result instanceof Promise && (result = await result), result.issues.length ? {
4996
- success: !1,
4997
- error: new _Err(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
4998
- } : {
4999
- success: !0,
5000
- data: result.value
5001
- };
5002
- }, safeParseAsync = _safeParseAsync($ZodRealError), cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, regexes_uuid = (version)=>version ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, base64url = /^[A-Za-z0-9_-]*$/, hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, e164 = /^\+(?:[0-9]){6,14}[0-9]$/, dateSource = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", regexes_date = RegExp(`^${dateSource}$`);
5003
- function timeSource(args) {
5004
- let regex = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
5005
- return args.precision ? regex = `${regex}\\.\\d{${args.precision}}` : null == args.precision && (regex = `${regex}(\\.\\d+)?`), regex;
5006
- }
5007
- let string = (params)=>{
5008
- let regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : "[\\s\\S]*";
5009
- return RegExp(`^${regex}$`);
5010
- }, integer = /^\d+$/, number = /^-?\d+(?:\.\d+)?/i, regexes_boolean = /true|false/i, _null = /null/i, _undefined = /undefined/i, lowercase = /^[^A-Z]*$/, uppercase = /^[^a-z]*$/, $ZodCheck = $constructor("$ZodCheck", (inst, def)=>{
4848
+ let $ZodCheck = $constructor("$ZodCheck", (inst, def)=>{
5011
4849
  var _a;
5012
4850
  inst._zod ?? (inst._zod = {}), inst._zod.def = def, (_a = inst._zod).onattach ?? (_a.onattach = []);
5013
4851
  }), numericOriginMap = {
@@ -5018,7 +4856,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5018
4856
  $ZodCheck.init(inst, def);
5019
4857
  let origin = numericOriginMap[typeof def.value];
5020
4858
  inst._zod.onattach.push((inst)=>{
5021
- let bag = inst._zod.bag, curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
4859
+ let bag = inst._zod.bag, curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? 1 / 0;
5022
4860
  def.value < curr && (def.inclusive ? bag.maximum = def.value : bag.exclusiveMaximum = def.value);
5023
4861
  }), inst._zod.check = (payload)=>{
5024
4862
  (def.inclusive ? payload.value <= def.value : payload.value < def.value) || payload.issues.push({
@@ -5035,11 +4873,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5035
4873
  $ZodCheck.init(inst, def);
5036
4874
  let origin = numericOriginMap[typeof def.value];
5037
4875
  inst._zod.onattach.push((inst)=>{
5038
- let bag = inst._zod.bag, curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
4876
+ let bag = inst._zod.bag, curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? -1 / 0;
5039
4877
  def.value > curr && (def.inclusive ? bag.minimum = def.value : bag.exclusiveMinimum = def.value);
5040
4878
  }), inst._zod.check = (payload)=>{
5041
4879
  (def.inclusive ? payload.value >= def.value : payload.value > def.value) || payload.issues.push({
5042
- origin: origin,
4880
+ origin,
5043
4881
  code: "too_small",
5044
4882
  minimum: def.value,
5045
4883
  input: payload.value,
@@ -5102,9 +4940,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5102
4940
  }
5103
4941
  input < minimum && payload.issues.push({
5104
4942
  origin: "number",
5105
- input: input,
4943
+ input,
5106
4944
  code: "too_small",
5107
- minimum: minimum,
4945
+ minimum,
5108
4946
  inclusive: !0,
5109
4947
  inst,
5110
4948
  continue: !def.abort
@@ -5117,12 +4955,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5117
4955
  });
5118
4956
  };
5119
4957
  }), $ZodCheckMaxLength = $constructor("$ZodCheckMaxLength", (inst, def)=>{
5120
- $ZodCheck.init(inst, def), inst._zod.when = (payload)=>{
5121
- var input;
4958
+ var _a;
4959
+ $ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
5122
4960
  let val = payload.value;
5123
4961
  return null != val && void 0 !== val.length;
5124
- }, inst._zod.onattach.push((inst)=>{
5125
- let curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
4962
+ }), inst._zod.onattach.push((inst)=>{
4963
+ let curr = inst._zod.bag.maximum ?? 1 / 0;
5126
4964
  def.maximum < curr && (inst._zod.bag.maximum = def.maximum);
5127
4965
  }), inst._zod.check = (payload)=>{
5128
4966
  let input = payload.value;
@@ -5139,12 +4977,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5139
4977
  });
5140
4978
  };
5141
4979
  }), $ZodCheckMinLength = $constructor("$ZodCheckMinLength", (inst, def)=>{
5142
- $ZodCheck.init(inst, def), inst._zod.when = (payload)=>{
5143
- var input;
4980
+ var _a;
4981
+ $ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
5144
4982
  let val = payload.value;
5145
4983
  return null != val && void 0 !== val.length;
5146
- }, inst._zod.onattach.push((inst)=>{
5147
- let curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
4984
+ }), inst._zod.onattach.push((inst)=>{
4985
+ let curr = inst._zod.bag.minimum ?? -1 / 0;
5148
4986
  def.minimum > curr && (inst._zod.bag.minimum = def.minimum);
5149
4987
  }), inst._zod.check = (payload)=>{
5150
4988
  let input = payload.value;
@@ -5161,11 +4999,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5161
4999
  });
5162
5000
  };
5163
5001
  }), $ZodCheckLengthEquals = $constructor("$ZodCheckLengthEquals", (inst, def)=>{
5164
- $ZodCheck.init(inst, def), inst._zod.when = (payload)=>{
5165
- var input;
5002
+ var _a;
5003
+ $ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
5166
5004
  let val = payload.value;
5167
5005
  return null != val && void 0 !== val.length;
5168
- }, inst._zod.onattach.push((inst)=>{
5006
+ }), inst._zod.onattach.push((inst)=>{
5169
5007
  let bag = inst._zod.bag;
5170
5008
  bag.minimum = def.length, bag.maximum = def.length, bag.length = def.length;
5171
5009
  }), inst._zod.check = (payload)=>{
@@ -5181,18 +5019,19 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5181
5019
  code: "too_small",
5182
5020
  minimum: def.length
5183
5021
  },
5022
+ inclusive: !0,
5023
+ exact: !0,
5184
5024
  input: payload.value,
5185
5025
  inst,
5186
5026
  continue: !def.abort
5187
5027
  });
5188
5028
  };
5189
5029
  }), $ZodCheckStringFormat = $constructor("$ZodCheckStringFormat", (inst, def)=>{
5190
- var _a;
5030
+ var _a, _b;
5191
5031
  $ZodCheck.init(inst, def), inst._zod.onattach.push((inst)=>{
5192
5032
  let bag = inst._zod.bag;
5193
5033
  bag.format = def.format, def.pattern && (bag.patterns ?? (bag.patterns = new Set()), bag.patterns.add(def.pattern));
5194
- }), (_a = inst._zod).check ?? (_a.check = (payload)=>{
5195
- if (!def.pattern) throw Error("Not implemented.");
5034
+ }), def.pattern ? (_a = inst._zod).check ?? (_a.check = (payload)=>{
5196
5035
  def.pattern.lastIndex = 0, def.pattern.test(payload.value) || payload.issues.push({
5197
5036
  origin: "string",
5198
5037
  code: "invalid_format",
@@ -5204,7 +5043,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5204
5043
  inst,
5205
5044
  continue: !def.abort
5206
5045
  });
5207
- });
5046
+ }) : (_b = inst._zod).check ?? (_b.check = ()=>{});
5208
5047
  }), $ZodCheckRegex = $constructor("$ZodCheckRegex", (inst, def)=>{
5209
5048
  $ZodCheckStringFormat.init(inst, def), inst._zod.check = (payload)=>{
5210
5049
  def.pattern.lastIndex = 0, def.pattern.test(payload.value) || payload.issues.push({
@@ -5305,38 +5144,88 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5305
5144
  ].join("\n"));
5306
5145
  }
5307
5146
  }
5308
- let versions_version = {
5309
- major: 4,
5310
- minor: 0,
5311
- patch: 0
5312
- }, $ZodType = $constructor("$ZodType", (inst, def)=>{
5313
- var _a;
5314
- inst ?? (inst = {}), defineLazy(inst._zod, "id", ()=>def.type + "_" + randomString(10)), inst._zod.def = def, inst._zod.bag = inst._zod.bag || {}, inst._zod.version = versions_version;
5315
- let checks = [
5316
- ...inst._zod.def.checks ?? []
5317
- ];
5318
- for (let ch of (inst._zod.traits.has("$ZodCheck") && checks.unshift(inst), checks))for (let fn of ch._zod.onattach)fn(inst);
5319
- if (0 === checks.length) (_a = inst._zod).deferred ?? (_a.deferred = []), inst._zod.deferred?.push(()=>{
5320
- inst._zod.run = inst._zod.parse;
5147
+ let errors_initializer = (inst, def)=>{
5148
+ inst.name = "$ZodError", Object.defineProperty(inst, "_zod", {
5149
+ value: inst._zod,
5150
+ enumerable: !1
5151
+ }), Object.defineProperty(inst, "issues", {
5152
+ value: def,
5153
+ enumerable: !1
5154
+ }), Object.defineProperty(inst, "message", {
5155
+ get: ()=>JSON.stringify(def, jsonStringifyReplacer, 2),
5156
+ enumerable: !0
5157
+ }), Object.defineProperty(inst, "toString", {
5158
+ value: ()=>inst.message,
5159
+ enumerable: !1
5321
5160
  });
5322
- else {
5323
- let runChecks = (payload, checks, ctx)=>{
5324
- let asyncResult, isAborted = aborted(payload);
5325
- for (let ch of checks){
5326
- if (ch._zod.when) {
5327
- if (!ch._zod.when(payload)) continue;
5328
- } else if (isAborted) continue;
5329
- let currLen = payload.issues.length, _ = ch._zod.check(payload);
5330
- if (_ instanceof Promise && ctx?.async === !1) throw new $ZodAsyncError();
5331
- if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async ()=>{
5332
- await _, payload.issues.length !== currLen && (isAborted || (isAborted = aborted(payload, currLen)));
5333
- });
5334
- else {
5335
- if (payload.issues.length === currLen) continue;
5336
- isAborted || (isAborted = aborted(payload, currLen));
5337
- }
5338
- }
5339
- return asyncResult ? asyncResult.then(()=>payload) : payload;
5161
+ }, $ZodError = $constructor("$ZodError", errors_initializer), $ZodRealError = $constructor("$ZodError", errors_initializer, {
5162
+ Parent: Error
5163
+ }), _safeParse = (_Err)=>(schema, value, _ctx)=>{
5164
+ let ctx = _ctx ? {
5165
+ ..._ctx,
5166
+ async: !1
5167
+ } : {
5168
+ async: !1
5169
+ }, result = schema._zod.run({
5170
+ value,
5171
+ issues: []
5172
+ }, ctx);
5173
+ if (result instanceof Promise) throw new $ZodAsyncError();
5174
+ return result.issues.length ? {
5175
+ success: !1,
5176
+ error: new (_Err ?? $ZodError)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
5177
+ } : {
5178
+ success: !0,
5179
+ data: result.value
5180
+ };
5181
+ }, safeParse = _safeParse($ZodRealError), _safeParseAsync = (_Err)=>async (schema, value, _ctx)=>{
5182
+ let ctx = _ctx ? Object.assign(_ctx, {
5183
+ async: !0
5184
+ }) : {
5185
+ async: !0
5186
+ }, result = schema._zod.run({
5187
+ value,
5188
+ issues: []
5189
+ }, ctx);
5190
+ return result instanceof Promise && (result = await result), result.issues.length ? {
5191
+ success: !1,
5192
+ error: new _Err(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
5193
+ } : {
5194
+ success: !0,
5195
+ data: result.value
5196
+ };
5197
+ }, safeParseAsync = _safeParseAsync($ZodRealError), versions_version = {
5198
+ major: 4,
5199
+ minor: 0,
5200
+ patch: 0
5201
+ }, $ZodType = $constructor("$ZodType", (inst, def)=>{
5202
+ var _a;
5203
+ inst ?? (inst = {}), inst._zod.def = def, inst._zod.bag = inst._zod.bag || {}, inst._zod.version = versions_version;
5204
+ let checks = [
5205
+ ...inst._zod.def.checks ?? []
5206
+ ];
5207
+ for (let ch of (inst._zod.traits.has("$ZodCheck") && checks.unshift(inst), checks))for (let fn of ch._zod.onattach)fn(inst);
5208
+ if (0 === checks.length) (_a = inst._zod).deferred ?? (_a.deferred = []), inst._zod.deferred?.push(()=>{
5209
+ inst._zod.run = inst._zod.parse;
5210
+ });
5211
+ else {
5212
+ let runChecks = (payload, checks, ctx)=>{
5213
+ let asyncResult, isAborted = aborted(payload);
5214
+ for (let ch of checks){
5215
+ if (ch._zod.def.when) {
5216
+ if (!ch._zod.def.when(payload)) continue;
5217
+ } else if (isAborted) continue;
5218
+ let currLen = payload.issues.length, _ = ch._zod.check(payload);
5219
+ if (_ instanceof Promise && ctx?.async === !1) throw new $ZodAsyncError();
5220
+ if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async ()=>{
5221
+ await _, payload.issues.length !== currLen && (isAborted || (isAborted = aborted(payload, currLen)));
5222
+ });
5223
+ else {
5224
+ if (payload.issues.length === currLen) continue;
5225
+ isAborted || (isAborted = aborted(payload, currLen));
5226
+ }
5227
+ }
5228
+ return asyncResult ? asyncResult.then(()=>payload) : payload;
5340
5229
  };
5341
5230
  inst._zod.run = (payload, ctx)=>{
5342
5231
  let result = inst._zod.parse(payload, ctx);
@@ -5370,7 +5259,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5370
5259
  }), $ZodString = $constructor("$ZodString", (inst, def)=>{
5371
5260
  $ZodType.init(inst, def), inst._zod.pattern = [
5372
5261
  ...inst?._zod.bag?.patterns ?? []
5373
- ].pop() ?? string(inst._zod.bag), inst._zod.parse = (payload, _)=>{
5262
+ ].pop() ?? ((params)=>{
5263
+ let regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : "[\\s\\S]*";
5264
+ return RegExp(`^${regex}$`);
5265
+ })(inst._zod.bag), inst._zod.parse = (payload, _)=>{
5374
5266
  if (def.coerce) try {
5375
5267
  payload.value = String(payload.value);
5376
5268
  } catch (_) {}
@@ -5406,7 +5298,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5406
5298
  }), $ZodURL = $constructor("$ZodURL", (inst, def)=>{
5407
5299
  $ZodStringFormat.init(inst, def), inst._zod.check = (payload)=>{
5408
5300
  try {
5409
- let url = new URL(payload.value);
5301
+ let orig = payload.value, url = new URL(orig), href = url.href;
5410
5302
  def.hostname && (def.hostname.lastIndex = 0, def.hostname.test(url.hostname) || payload.issues.push({
5411
5303
  code: "invalid_format",
5412
5304
  format: "url",
@@ -5423,7 +5315,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5423
5315
  input: payload.value,
5424
5316
  inst,
5425
5317
  continue: !def.abort
5426
- }));
5318
+ })), !orig.endsWith("/") && href.endsWith("/") ? payload.value = href.slice(0, -1) : payload.value = href;
5427
5319
  return;
5428
5320
  } catch (_) {
5429
5321
  payload.issues.push({
@@ -5451,8 +5343,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5451
5343
  def.pattern ?? (def.pattern = ksuid), $ZodStringFormat.init(inst, def);
5452
5344
  }), $ZodISODateTime = $constructor("$ZodISODateTime", (inst, def)=>{
5453
5345
  def.pattern ?? (def.pattern = function(args) {
5454
- let regex = `${dateSource}T${timeSource(args)}`, opts = [];
5455
- return opts.push(args.local ? "Z?" : "Z"), args.offset && opts.push("([+-]\\d{2}:?\\d{2})"), regex = `${regex}(${opts.join("|")})`, RegExp(`^${regex}$`);
5346
+ let time = timeSource({
5347
+ precision: args.precision
5348
+ }), opts = [
5349
+ "Z"
5350
+ ];
5351
+ args.local && opts.push(""), args.offset && opts.push("([+-]\\d{2}:\\d{2})");
5352
+ let timeRegex = `${time}(?:${opts.join("|")})`;
5353
+ return RegExp(`^${dateSource}T(?:${timeRegex})$`);
5456
5354
  }(def)), $ZodStringFormat.init(inst, def);
5457
5355
  }), $ZodISODate = $constructor("$ZodISODate", (inst, def)=>{
5458
5356
  def.pattern ?? (def.pattern = regexes_date), $ZodStringFormat.init(inst, def);
@@ -5547,7 +5445,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5547
5445
  try {
5548
5446
  let tokensParts = token.split(".");
5549
5447
  if (3 !== tokensParts.length) return !1;
5550
- let [header] = tokensParts, parsedHeader = JSON.parse(atob(header));
5448
+ let [header] = tokensParts;
5449
+ if (!header) return !1;
5450
+ let parsedHeader = JSON.parse(atob(header));
5551
5451
  if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT" || !parsedHeader.alg || algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return !1;
5552
5452
  return !0;
5553
5453
  } catch {
@@ -5597,8 +5497,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5597
5497
  }), $ZodUndefined = $constructor("$ZodUndefined", (inst, def)=>{
5598
5498
  $ZodType.init(inst, def), inst._zod.pattern = _undefined, inst._zod.values = new Set([
5599
5499
  void 0
5600
- ]), inst._zod.parse = (payload, _ctx)=>{
5601
- let { value: input } = payload;
5500
+ ]), inst._zod.optin = "optional", inst._zod.optout = "optional", inst._zod.parse = (payload, _ctx)=>{
5501
+ let input = payload.value;
5602
5502
  return void 0 === input || payload.issues.push({
5603
5503
  expected: "undefined",
5604
5504
  code: "invalid_type",
@@ -5610,7 +5510,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5610
5510
  $ZodType.init(inst, def), inst._zod.pattern = _null, inst._zod.values = new Set([
5611
5511
  null
5612
5512
  ]), inst._zod.parse = (payload, _ctx)=>{
5613
- let { value: input } = payload;
5513
+ let input = payload.value;
5614
5514
  return null === input || payload.issues.push({
5615
5515
  expected: "null",
5616
5516
  code: "invalid_type",
@@ -5684,23 +5584,34 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5684
5584
  }
5685
5585
  return propValues;
5686
5586
  });
5687
- let generateFastpass = (shape)=>{
5688
- let doc = new Doc([
5689
- "shape",
5690
- "payload",
5691
- "ctx"
5692
- ]), { keys, optionalKeys } = _normalized.value, parseStr = (key)=>{
5693
- let k = esc(key);
5694
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
5695
- };
5696
- doc.write("const input = payload.value;");
5697
- let ids = Object.create(null);
5698
- for (let key of keys)ids[key] = randomString(15);
5699
- for (let key of (doc.write("const newResult = {}"), keys))if (optionalKeys.has(key)) {
5700
- let id = ids[key];
5701
- doc.write(`const ${id} = ${parseStr(key)};`);
5702
- let k = esc(key);
5703
- doc.write(`
5587
+ let jit = !globalConfig.jitless, fastEnabled = jit && util_allowsEval.value, catchall = def.catchall;
5588
+ inst._zod.parse = (payload, ctx)=>{
5589
+ value ?? (value = _normalized.value);
5590
+ let input = payload.value;
5591
+ if (!util_isObject(input)) return payload.issues.push({
5592
+ expected: "object",
5593
+ code: "invalid_type",
5594
+ input,
5595
+ inst
5596
+ }), payload;
5597
+ let proms = [];
5598
+ if (jit && fastEnabled && ctx?.async === !1 && !0 !== ctx.jitless) fastpass || (fastpass = ((shape)=>{
5599
+ let doc = new Doc([
5600
+ "shape",
5601
+ "payload",
5602
+ "ctx"
5603
+ ]), normalized = _normalized.value, parseStr = (key)=>{
5604
+ let k = esc(key);
5605
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
5606
+ };
5607
+ doc.write("const input = payload.value;");
5608
+ let ids = Object.create(null), counter = 0;
5609
+ for (let key of normalized.keys)ids[key] = `key_${counter++}`;
5610
+ for (let key of (doc.write("const newResult = {}"), normalized.keys))if (normalized.optionalKeys.has(key)) {
5611
+ let id = ids[key];
5612
+ doc.write(`const ${id} = ${parseStr(key)};`);
5613
+ let k = esc(key);
5614
+ doc.write(`
5704
5615
  if (${id}.issues.length) {
5705
5616
  if (input[${k}] === undefined) {
5706
5617
  if (${k} in input) {
@@ -5720,29 +5631,18 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5720
5631
  newResult[${k}] = ${id}.value;
5721
5632
  }
5722
5633
  `);
5723
- } else {
5724
- let id = ids[key];
5725
- doc.write(`const ${id} = ${parseStr(key)};`), doc.write(`
5634
+ } else {
5635
+ let id = ids[key];
5636
+ doc.write(`const ${id} = ${parseStr(key)};`), doc.write(`
5726
5637
  if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
5727
5638
  ...iss,
5728
5639
  path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
5729
5640
  })));`), doc.write(`newResult[${esc(key)}] = ${id}.value`);
5730
- }
5731
- doc.write("payload.value = newResult;"), doc.write("return payload;");
5732
- let fn = doc.compile();
5733
- return (payload, ctx)=>fn(shape, payload, ctx);
5734
- }, jit = !globalConfig.jitless, fastEnabled = jit && util_allowsEval.value, { catchall } = def;
5735
- inst._zod.parse = (payload, ctx)=>{
5736
- value ?? (value = _normalized.value);
5737
- let input = payload.value;
5738
- if (!util_isObject(input)) return payload.issues.push({
5739
- expected: "object",
5740
- code: "invalid_type",
5741
- input,
5742
- inst
5743
- }), payload;
5744
- let proms = [];
5745
- if (jit && fastEnabled && ctx?.async === !1 && !0 !== ctx.jitless) fastpass || (fastpass = generateFastpass(def.shape)), payload = fastpass(payload, ctx);
5641
+ }
5642
+ doc.write("payload.value = newResult;"), doc.write("return payload;");
5643
+ let fn = doc.compile();
5644
+ return (payload, ctx)=>fn(shape, payload, ctx);
5645
+ })(def.shape)), payload = fastpass(payload, ctx);
5746
5646
  else {
5747
5647
  payload.value = {};
5748
5648
  let shape = value.shape;
@@ -5786,7 +5686,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5786
5686
  }), final;
5787
5687
  }
5788
5688
  let $ZodUnion = $constructor("$ZodUnion", (inst, def)=>{
5789
- $ZodType.init(inst, def), defineLazy(inst._zod, "values", ()=>{
5689
+ $ZodType.init(inst, def), defineLazy(inst._zod, "optin", ()=>def.options.some((o)=>"optional" === o._zod.optin) ? "optional" : void 0), defineLazy(inst._zod, "optout", ()=>def.options.some((o)=>"optional" === o._zod.optout) ? "optional" : void 0), defineLazy(inst._zod, "values", ()=>{
5790
5690
  if (def.options.every((o)=>o._zod.values)) return new Set(def.options.flatMap((option)=>Array.from(option._zod.values)));
5791
5691
  }), defineLazy(inst._zod, "pattern", ()=>{
5792
5692
  if (def.options.every((o)=>o._zod.pattern)) {
@@ -5810,7 +5710,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5810
5710
  };
5811
5711
  }), $ZodIntersection = $constructor("$ZodIntersection", (inst, def)=>{
5812
5712
  $ZodType.init(inst, def), inst._zod.parse = (payload, ctx)=>{
5813
- let { value: input } = payload, left = def.left._zod.run({
5713
+ let input = payload.value, left = def.left._zod.run({
5814
5714
  value: input,
5815
5715
  issues: []
5816
5716
  }, ctx), right = def.right._zod.run({
@@ -5881,7 +5781,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5881
5781
  if (!merged.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
5882
5782
  return result.value = merged.data, result;
5883
5783
  }
5884
- let schemas_$ZodTuple = $constructor("$ZodTuple", (inst, def)=>{
5784
+ let $ZodTuple = $constructor("$ZodTuple", (inst, def)=>{
5885
5785
  $ZodType.init(inst, def);
5886
5786
  let items = def.items, optStart = items.length - [
5887
5787
  ...items
@@ -6031,7 +5931,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6031
5931
  ]) : void 0), defineLazy(inst._zod, "pattern", ()=>{
6032
5932
  let pattern = def.innerType._zod.pattern;
6033
5933
  return pattern ? RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
6034
- }), inst._zod.parse = (payload, ctx)=>void 0 === payload.value ? payload : def.innerType._zod.run(payload, ctx);
5934
+ }), inst._zod.parse = (payload, ctx)=>"optional" === def.innerType._zod.optin ? def.innerType._zod.run(payload, ctx) : void 0 === payload.value ? payload : def.innerType._zod.run(payload, ctx);
6035
5935
  }), $ZodNullable = $constructor("$ZodNullable", (inst, def)=>{
6036
5936
  $ZodType.init(inst, def), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), defineLazy(inst._zod, "pattern", ()=>{
6037
5937
  let pattern = def.innerType._zod.pattern;
@@ -6072,7 +5972,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6072
5972
  }), payload;
6073
5973
  }
6074
5974
  let $ZodCatch = $constructor("$ZodCatch", (inst, def)=>{
6075
- $ZodType.init(inst, def), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), defineLazy(inst._zod, "values", ()=>def.innerType._zod.values), inst._zod.parse = (payload, ctx)=>{
5975
+ $ZodType.init(inst, def), inst._zod.optin = "optional", defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), defineLazy(inst._zod, "values", ()=>def.innerType._zod.values), inst._zod.parse = (payload, ctx)=>{
6076
5976
  let result = def.innerType._zod.run(payload, ctx);
6077
5977
  return result instanceof Promise ? result.then((result)=>(payload.value = result.value, result.issues.length && (payload.value = def.catchValue({
6078
5978
  ...payload,
@@ -6101,7 +6001,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6101
6001
  }, ctx);
6102
6002
  }
6103
6003
  let $ZodReadonly = $constructor("$ZodReadonly", (inst, def)=>{
6104
- $ZodType.init(inst, def), defineLazy(inst._zod, "propValues", ()=>def.innerType._zod.propValues), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), inst._zod.parse = (payload, ctx)=>{
6004
+ $ZodType.init(inst, def), defineLazy(inst._zod, "propValues", ()=>def.innerType._zod.propValues), defineLazy(inst._zod, "values", ()=>def.innerType._zod.values), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), inst._zod.parse = (payload, ctx)=>{
6105
6005
  let result = def.innerType._zod.run(payload, ctx);
6106
6006
  return result instanceof Promise ? result.then(handleReadonlyResult) : handleReadonlyResult(result);
6107
6007
  };
@@ -6132,108 +6032,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6132
6032
  inst._zod.def.params && (_iss.params = inst._zod.def.params), payload.issues.push(util_issue(_iss));
6133
6033
  }
6134
6034
  }
6135
- let en_parsedType = (data)=>{
6136
- let t = typeof data;
6137
- switch(t){
6138
- case "number":
6139
- return Number.isNaN(data) ? "NaN" : "number";
6140
- case "object":
6141
- if (Array.isArray(data)) return "array";
6142
- if (null === data) return "null";
6143
- if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
6144
- }
6145
- return t;
6146
- }, en_error = ()=>{
6147
- let Sizable = {
6148
- string: {
6149
- unit: "characters",
6150
- verb: "to have"
6151
- },
6152
- file: {
6153
- unit: "bytes",
6154
- verb: "to have"
6155
- },
6156
- array: {
6157
- unit: "items",
6158
- verb: "to have"
6159
- },
6160
- set: {
6161
- unit: "items",
6162
- verb: "to have"
6163
- }
6164
- }, Nouns = {
6165
- regex: "input",
6166
- email: "email address",
6167
- url: "URL",
6168
- emoji: "emoji",
6169
- uuid: "UUID",
6170
- uuidv4: "UUIDv4",
6171
- uuidv6: "UUIDv6",
6172
- nanoid: "nanoid",
6173
- guid: "GUID",
6174
- cuid: "cuid",
6175
- cuid2: "cuid2",
6176
- ulid: "ULID",
6177
- xid: "XID",
6178
- ksuid: "KSUID",
6179
- datetime: "ISO datetime",
6180
- date: "ISO date",
6181
- time: "ISO time",
6182
- duration: "ISO duration",
6183
- ipv4: "IPv4 address",
6184
- ipv6: "IPv6 address",
6185
- cidrv4: "IPv4 range",
6186
- cidrv6: "IPv6 range",
6187
- base64: "base64-encoded string",
6188
- base64url: "base64url-encoded string",
6189
- json_string: "JSON string",
6190
- e164: "E.164 number",
6191
- jwt: "JWT",
6192
- template_literal: "input"
6193
- };
6194
- return (issue)=>{
6195
- switch(issue.code){
6196
- case "invalid_type":
6197
- return `Invalid input: expected ${issue.expected}, received ${en_parsedType(issue.input)}`;
6198
- case "invalid_value":
6199
- if (1 === issue.values.length) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
6200
- return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
6201
- case "too_big":
6202
- {
6203
- let adj = issue.inclusive ? "<=" : "<", sizing = Sizable[issue.origin] ?? null;
6204
- if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
6205
- return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
6206
- }
6207
- case "too_small":
6208
- {
6209
- let adj = issue.inclusive ? ">=" : ">", sizing = Sizable[issue.origin] ?? null;
6210
- if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
6211
- return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
6212
- }
6213
- case "invalid_format":
6214
- if ("starts_with" === issue.format) return `Invalid string: must start with "${issue.prefix}"`;
6215
- if ("ends_with" === issue.format) return `Invalid string: must end with "${issue.suffix}"`;
6216
- if ("includes" === issue.format) return `Invalid string: must include "${issue.includes}"`;
6217
- if ("regex" === issue.format) return `Invalid string: must match pattern ${issue.pattern}`;
6218
- return `Invalid ${Nouns[issue.format] ?? issue.format}`;
6219
- case "not_multiple_of":
6220
- return `Invalid number: must be a multiple of ${issue.divisor}`;
6221
- case "unrecognized_keys":
6222
- return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
6223
- case "invalid_key":
6224
- return `Invalid key in ${issue.origin}`;
6225
- case "invalid_union":
6226
- default:
6227
- return "Invalid input";
6228
- case "invalid_element":
6229
- return `Invalid value in ${issue.origin}`;
6230
- }
6231
- };
6232
- };
6233
6035
  Symbol("ZodOutput"), Symbol("ZodInput");
6234
- class registries_$ZodRegistry {
6036
+ class $ZodRegistry {
6235
6037
  constructor(){
6236
- this._map = new WeakMap(), this._idmap = new Map();
6038
+ this._map = new Map(), this._idmap = new Map();
6237
6039
  }
6238
6040
  add(schema, ..._meta) {
6239
6041
  let meta = _meta[0];
@@ -6243,8 +6045,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6243
6045
  }
6244
6046
  return this;
6245
6047
  }
6048
+ clear() {
6049
+ return this._map = new Map(), this._idmap = new Map(), this;
6050
+ }
6246
6051
  remove(schema) {
6247
- return this._map.delete(schema), this;
6052
+ let meta = this._map.get(schema);
6053
+ return meta && "object" == typeof meta && "id" in meta && this._idmap.delete(meta.id), this._map.delete(schema), this;
6248
6054
  }
6249
6055
  get(schema) {
6250
6056
  let p = schema._zod.parent;
@@ -6263,7 +6069,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6263
6069
  return this._map.has(schema);
6264
6070
  }
6265
6071
  }
6266
- let registries_globalRegistry = new registries_$ZodRegistry();
6072
+ let globalRegistry = new $ZodRegistry();
6267
6073
  function _guid(Class, params) {
6268
6074
  return new Class({
6269
6075
  type: "string",
@@ -6405,7 +6211,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6405
6211
  $constructor("ZodError", classic_errors_initializer);
6406
6212
  let ZodRealError = $constructor("ZodError", classic_errors_initializer, {
6407
6213
  Parent: Error
6408
- }), classic_parse_parse = (_Err = ZodRealError, (schema, value, _ctx, _params)=>{
6214
+ }), parse_parse = (_Err = ZodRealError, (schema, value, _ctx, _params)=>{
6409
6215
  let ctx = _ctx ? Object.assign(_ctx, {
6410
6216
  async: !1
6411
6217
  }) : {
@@ -6417,10 +6223,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6417
6223
  if (result instanceof Promise) throw new $ZodAsyncError();
6418
6224
  if (result.issues.length) {
6419
6225
  let e = new (_params?.Err ?? _Err)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())));
6420
- throw Error.captureStackTrace(e, _params?.callee), e;
6226
+ throw captureStackTrace(e, _params?.callee), e;
6421
6227
  }
6422
6228
  return result.value;
6423
- }), classic_parse_parseAsync = (_Err1 = ZodRealError, async (schema, value, _ctx, params)=>{
6229
+ }), parse_parseAsync = (_Err1 = ZodRealError, async (schema, value, _ctx, params)=>{
6424
6230
  let ctx = _ctx ? Object.assign(_ctx, {
6425
6231
  async: !0
6426
6232
  }) : {
@@ -6431,7 +6237,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6431
6237
  }, ctx);
6432
6238
  if (result instanceof Promise && (result = await result), result.issues.length) {
6433
6239
  let e = new (params?.Err ?? _Err1)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())));
6434
- throw Error.captureStackTrace(e, params?.callee), e;
6240
+ throw captureStackTrace(e, params?.callee), e;
6435
6241
  }
6436
6242
  return result.value;
6437
6243
  }), parse_safeParse = _safeParse(ZodRealError), parse_safeParseAsync = _safeParseAsync(ZodRealError), ZodType = $constructor("ZodType", (inst, def)=>($ZodType.init(inst, def), inst.def = def, Object.defineProperty(inst, "_def", {
@@ -6450,9 +6256,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6450
6256
  }
6451
6257
  } : ch)
6452
6258
  ]
6453
- }), inst.clone = (def, params)=>clone(inst, def, params), inst.brand = ()=>inst, inst.register = (reg, meta)=>(reg.add(inst, meta), inst), inst.parse = (data, params)=>classic_parse_parse(inst, data, params, {
6259
+ }), inst.clone = (def, params)=>clone(inst, def, params), inst.brand = ()=>inst, inst.register = (reg, meta)=>(reg.add(inst, meta), inst), inst.parse = (data, params)=>parse_parse(inst, data, params, {
6454
6260
  callee: inst.parse
6455
- }), inst.safeParse = (data, params)=>parse_safeParse(inst, data, params), inst.parseAsync = async (data, params)=>classic_parse_parseAsync(inst, data, params, {
6261
+ }), inst.safeParse = (data, params)=>parse_safeParse(inst, data, params), inst.parseAsync = async (data, params)=>parse_parseAsync(inst, data, params, {
6456
6262
  callee: inst.parseAsync
6457
6263
  }), inst.safeParseAsync = async (data, params)=>parse_safeParseAsync(inst, data, params), inst.spa = inst.safeParseAsync, inst.refine = (check, params)=>inst.check(function(fn, _params = {}) {
6458
6264
  return new ZodCustom({
@@ -6461,41 +6267,31 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6461
6267
  fn: fn,
6462
6268
  ...normalizeParams(_params)
6463
6269
  });
6464
- }(check, params)), inst.superRefine = (refinement)=>inst.check(function(fn, params) {
6465
- let ch = function(fn, params) {
6270
+ }(check, params)), inst.superRefine = (refinement)=>inst.check(function(fn) {
6271
+ let ch = function(fn) {
6466
6272
  let ch = new $ZodCheck({
6467
- check: "custom",
6468
- ...normalizeParams(params)
6273
+ check: "custom"
6469
6274
  });
6470
6275
  return ch._zod.check = fn, ch;
6471
6276
  }((payload)=>(payload.addIssue = (issue)=>{
6472
6277
  "string" == typeof issue ? payload.issues.push(util_issue(issue, payload.value, ch._zod.def)) : (issue.fatal && (issue.continue = !1), issue.code ?? (issue.code = "custom"), issue.input ?? (issue.input = payload.value), issue.inst ?? (issue.inst = ch), issue.continue ?? (issue.continue = !ch._zod.def.abort), payload.issues.push(util_issue(issue)));
6473
- }, fn(payload.value, payload)), void 0);
6278
+ }, fn(payload.value, payload)));
6474
6279
  return ch;
6475
- }(refinement)), inst.overwrite = (fn)=>inst.check(_overwrite(fn)), inst.optional = ()=>schemas_optional(inst), inst.nullable = ()=>nullable(inst), inst.nullish = ()=>schemas_optional(nullable(inst)), inst.nonoptional = (params)=>{
6476
- var innerType, params1;
6477
- return new ZodNonOptional({
6280
+ }(refinement)), inst.overwrite = (fn)=>inst.check(_overwrite(fn)), inst.optional = ()=>schemas_optional(inst), inst.nullable = ()=>nullable(inst), inst.nullish = ()=>schemas_optional(nullable(inst)), inst.nonoptional = (params)=>new ZodNonOptional({
6478
6281
  type: "nonoptional",
6479
- innerType: innerType = inst,
6480
- ...normalizeParams(params1 = params)
6481
- });
6482
- }, inst.array = ()=>schemas_array(inst), inst.or = (arg)=>union([
6282
+ innerType: inst,
6283
+ ...normalizeParams(params)
6284
+ }), inst.array = ()=>schemas_array(inst), inst.or = (arg)=>union([
6483
6285
  inst,
6484
6286
  arg
6485
- ]), inst.and = (arg)=>{
6486
- var left, right;
6487
- return new ZodIntersection({
6287
+ ]), inst.and = (arg)=>new ZodIntersection({
6488
6288
  type: "intersection",
6489
- left: left = inst,
6490
- right: right = arg
6491
- });
6492
- }, inst.transform = (tx)=>{
6493
- var fn;
6494
- return pipe(inst, new ZodTransform({
6289
+ left: inst,
6290
+ right: arg
6291
+ }), inst.transform = (tx)=>pipe(inst, new ZodTransform({
6495
6292
  type: "transform",
6496
- transform: fn = tx
6497
- }));
6498
- }, inst.default = (def)=>{
6293
+ transform: tx
6294
+ })), inst.default = (def)=>{
6499
6295
  var innerType, defaultValue;
6500
6296
  return innerType = inst, defaultValue = def, new ZodDefault({
6501
6297
  type: "default",
@@ -6514,30 +6310,27 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6514
6310
  }
6515
6311
  });
6516
6312
  }, inst.catch = (params)=>{
6517
- var innerType, catchValue;
6313
+ var catchValue;
6518
6314
  return new ZodCatch({
6519
6315
  type: "catch",
6520
- innerType: innerType = inst,
6316
+ innerType: inst,
6521
6317
  catchValue: "function" == typeof (catchValue = params) ? catchValue : ()=>catchValue
6522
6318
  });
6523
- }, inst.pipe = (target)=>pipe(inst, target), inst.readonly = ()=>{
6524
- var innerType;
6525
- return new ZodReadonly({
6319
+ }, inst.pipe = (target)=>pipe(inst, target), inst.readonly = ()=>new ZodReadonly({
6526
6320
  type: "readonly",
6527
- innerType: innerType = inst
6528
- });
6529
- }, inst.describe = (description)=>{
6321
+ innerType: inst
6322
+ }), inst.describe = (description)=>{
6530
6323
  let cl = inst.clone();
6531
- return registries_globalRegistry.add(cl, {
6324
+ return globalRegistry.add(cl, {
6532
6325
  description
6533
6326
  }), cl;
6534
6327
  }, Object.defineProperty(inst, "description", {
6535
- get: ()=>registries_globalRegistry.get(inst)?.description,
6328
+ get: ()=>globalRegistry.get(inst)?.description,
6536
6329
  configurable: !0
6537
6330
  }), inst.meta = (...args)=>{
6538
- if (0 === args.length) return registries_globalRegistry.get(inst);
6331
+ if (0 === args.length) return globalRegistry.get(inst);
6539
6332
  let cl = inst.clone();
6540
- return registries_globalRegistry.add(cl, args[0]), cl;
6333
+ return globalRegistry.add(cl, args[0]), cl;
6541
6334
  }, inst.isOptional = ()=>inst.safeParse(void 0).success, inst.isNullable = ()=>inst.safeParse(null).success, inst)), _ZodString = $constructor("_ZodString", (inst, def)=>{
6542
6335
  $ZodString.init(inst, def), ZodType.init(inst, def);
6543
6336
  let bag = inst._zod.bag;
@@ -6710,43 +6503,31 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6710
6503
  check: "string_format",
6711
6504
  abort: !1,
6712
6505
  ...normalizeParams(params)
6713
- })), inst.datetime = (params)=>{
6714
- var params1;
6715
- return inst.check(new ZodISODateTime({
6506
+ })), inst.datetime = (params)=>inst.check(new ZodISODateTime({
6716
6507
  type: "string",
6717
6508
  format: "datetime",
6718
6509
  check: "string_format",
6719
6510
  offset: !1,
6720
6511
  local: !1,
6721
6512
  precision: null,
6722
- ...normalizeParams(params1 = params)
6723
- }));
6724
- }, inst.date = (params)=>{
6725
- var params1;
6726
- return inst.check(new ZodISODate({
6513
+ ...normalizeParams(params)
6514
+ })), inst.date = (params)=>inst.check(new ZodISODate({
6727
6515
  type: "string",
6728
6516
  format: "date",
6729
6517
  check: "string_format",
6730
- ...normalizeParams(params1 = params)
6731
- }));
6732
- }, inst.time = (params)=>{
6733
- var params1;
6734
- return inst.check(new ZodISOTime({
6518
+ ...normalizeParams(params)
6519
+ })), inst.time = (params)=>inst.check(new ZodISOTime({
6735
6520
  type: "string",
6736
6521
  format: "time",
6737
6522
  check: "string_format",
6738
6523
  precision: null,
6739
- ...normalizeParams(params1 = params)
6740
- }));
6741
- }, inst.duration = (params)=>{
6742
- var params1;
6743
- return inst.check(new ZodISODuration({
6524
+ ...normalizeParams(params)
6525
+ })), inst.duration = (params)=>inst.check(new ZodISODuration({
6744
6526
  type: "string",
6745
6527
  format: "duration",
6746
6528
  check: "string_format",
6747
- ...normalizeParams(params1 = params)
6529
+ ...normalizeParams(params)
6748
6530
  }));
6749
- };
6750
6531
  });
6751
6532
  function schemas_string(params) {
6752
6533
  return new ZodString({
@@ -6797,7 +6578,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6797
6578
  }), ZodNumber = $constructor("ZodNumber", (inst, def)=>{
6798
6579
  $ZodNumber.init(inst, def), ZodType.init(inst, def), inst.gt = (value, params)=>inst.check(_gt(value, params)), inst.gte = (value, params)=>inst.check(_gte(value, params)), inst.min = (value, params)=>inst.check(_gte(value, params)), inst.lt = (value, params)=>inst.check(_lt(value, params)), inst.lte = (value, params)=>inst.check(_lte(value, params)), inst.max = (value, params)=>inst.check(_lte(value, params)), inst.int = (params)=>inst.check(schemas_int(params)), inst.safe = (params)=>inst.check(schemas_int(params)), inst.positive = (params)=>inst.check(_gt(0, params)), inst.nonnegative = (params)=>inst.check(_gte(0, params)), inst.negative = (params)=>inst.check(_lt(0, params)), inst.nonpositive = (params)=>inst.check(_lte(0, params)), inst.multipleOf = (value, params)=>inst.check(_multipleOf(value, params)), inst.step = (value, params)=>inst.check(_multipleOf(value, params)), inst.finite = ()=>inst;
6799
6580
  let bag = inst._zod.bag;
6800
- inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5), inst.isFinite = !0, inst.format = bag.format ?? null;
6581
+ inst.minValue = Math.max(bag.minimum ?? -1 / 0, bag.exclusiveMinimum ?? -1 / 0) ?? null, inst.maxValue = Math.min(bag.maximum ?? 1 / 0, bag.exclusiveMaximum ?? 1 / 0) ?? null, inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5), inst.isFinite = !0, inst.format = bag.format ?? null;
6801
6582
  });
6802
6583
  function schemas_number(params) {
6803
6584
  return new ZodNumber({
@@ -6867,15 +6648,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6867
6648
  $ZodArray.init(inst, def), ZodType.init(inst, def), inst.element = def.element, inst.min = (minLength, params)=>inst.check(_minLength(minLength, params)), inst.nonempty = (params)=>inst.check(_minLength(1, params)), inst.max = (maxLength, params)=>inst.check(_maxLength(maxLength, params)), inst.length = (len, params)=>inst.check(_length(len, params)), inst.unwrap = ()=>inst.element;
6868
6649
  });
6869
6650
  function schemas_array(element, params) {
6870
- var Class;
6871
- return new (Class = ZodArray)({
6651
+ return new ZodArray({
6872
6652
  type: "array",
6873
6653
  element: element,
6874
6654
  ...normalizeParams(params)
6875
6655
  });
6876
6656
  }
6877
6657
  let ZodObject = $constructor("ZodObject", (inst, def)=>{
6878
- $ZodObject.init(inst, def), ZodType.init(inst, def), defineLazy(inst, "shape", ()=>Object.fromEntries(Object.entries(inst._zod.def.shape))), inst.keyof = ()=>schemas_enum(Object.keys(inst._zod.def.shape)), inst.catchall = (catchall)=>inst.clone({
6658
+ $ZodObject.init(inst, def), ZodType.init(inst, def), defineLazy(inst, "shape", ()=>def.shape), inst.keyof = ()=>schemas_enum(Object.keys(inst._zod.def.shape)), inst.catchall = (catchall)=>inst.clone({
6879
6659
  ...inst._zod.def,
6880
6660
  catchall: catchall
6881
6661
  }), inst.passthrough = ()=>inst.clone({
@@ -6891,6 +6671,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6891
6671
  ...inst._zod.def,
6892
6672
  catchall: void 0
6893
6673
  }), inst.extend = (incoming)=>(function(schema, shape) {
6674
+ if (!isPlainObject(shape)) throw Error("Invalid input to extend: expected a plain object");
6894
6675
  let def = {
6895
6676
  ...schema._zod.def,
6896
6677
  get shape () {
@@ -7019,7 +6800,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7019
6800
  let ZodIntersection = $constructor("ZodIntersection", (inst, def)=>{
7020
6801
  $ZodIntersection.init(inst, def), ZodType.init(inst, def);
7021
6802
  }), ZodTuple = $constructor("ZodTuple", (inst, def)=>{
7022
- schemas_$ZodTuple.init(inst, def), ZodType.init(inst, def), inst.rest = (rest)=>inst.clone({
6803
+ $ZodTuple.init(inst, def), ZodType.init(inst, def), inst.rest = (rest)=>inst.clone({
7023
6804
  ...inst._zod.def,
7024
6805
  rest: rest
7025
6806
  });
@@ -7178,14 +6959,38 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7178
6959
  });
7179
6960
  return inst._zod.bag.Class = cls, inst;
7180
6961
  }
7181
- Object.freeze({
7182
- status: "aborted"
7183
- }), core_config({
7184
- localeError: en_error()
7185
- });
7186
- let numberOrInfinity = schemas_number().or(literal(Number.POSITIVE_INFINITY)), anyFunction = custom((data)=>"function" == typeof data, {
6962
+ let numberOrInfinity = schemas_number().or(literal(1 / 0)), anyFunction = custom((data)=>"function" == typeof data, {
7187
6963
  error: (input)=>({
7188
- message: `Expected function, received ${getParsedType(input)}`
6964
+ message: `Expected function, received ${((data)=>{
6965
+ let t = typeof data;
6966
+ switch(t){
6967
+ case "undefined":
6968
+ return "undefined";
6969
+ case "string":
6970
+ return "string";
6971
+ case "number":
6972
+ return Number.isNaN(data) ? "nan" : "number";
6973
+ case "boolean":
6974
+ return "boolean";
6975
+ case "function":
6976
+ return "function";
6977
+ case "bigint":
6978
+ return "bigint";
6979
+ case "symbol":
6980
+ return "symbol";
6981
+ case "object":
6982
+ if (Array.isArray(data)) return "array";
6983
+ if (null === data) return "null";
6984
+ if (data.then && "function" == typeof data.then && data.catch && "function" == typeof data.catch) return "promise";
6985
+ if ("undefined" != typeof Map && data instanceof Map) return "map";
6986
+ if ("undefined" != typeof Set && data instanceof Set) return "set";
6987
+ if ("undefined" != typeof Date && data instanceof Date) return "date";
6988
+ if ("undefined" != typeof File && data instanceof File) return "file";
6989
+ return "object";
6990
+ default:
6991
+ throw Error(`Unknown data type: ${t}`);
6992
+ }
6993
+ })(input)}`
7189
6994
  })
7190
6995
  }), getIgnorePluginOptionsSchema = memoize(()=>union([
7191
6996
  schemas_object({
@@ -7515,29 +7320,29 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7515
7320
  message: `value must be in ${issue.format} format`
7516
7321
  };
7517
7322
  default:
7518
- var issue1, issue2, issue3, issue4, issue5, issue6, issue7, issue8;
7519
- if ("starts_with" === (issue1 = issue).format) {
7323
+ var issue1, issue2, issue3;
7324
+ if ("starts_with" === issue.format) {
7520
7325
  return {
7521
- type: (issue2 = issue).code,
7522
- path: issue2.path,
7523
- message: `value must start with "${issue2.prefix}"`
7326
+ type: (issue1 = issue).code,
7327
+ path: issue1.path,
7328
+ message: `value must start with "${issue1.prefix}"`
7524
7329
  };
7525
7330
  }
7526
- if ("ends_with" === (issue3 = issue).format) {
7331
+ if ("ends_with" === issue.format) {
7527
7332
  return {
7528
- type: (issue4 = issue).code,
7529
- path: issue4.path,
7530
- message: `value must end with "${issue4.suffix}"`
7333
+ type: (issue2 = issue).code,
7334
+ path: issue2.path,
7335
+ message: `value must end with "${issue2.suffix}"`
7531
7336
  };
7532
7337
  }
7533
- if ("includes" === (issue5 = issue).format) {
7338
+ if ("includes" === issue.format) {
7534
7339
  return {
7535
- type: (issue6 = issue).code,
7536
- path: issue6.path,
7537
- message: `value must include "${issue6.includes}"`
7340
+ type: (issue3 = issue).code,
7341
+ path: issue3.path,
7342
+ message: `value must include "${issue3.includes}"`
7538
7343
  };
7539
7344
  }
7540
- if ("regex" === (issue7 = issue).format) return function(issue, options = {
7345
+ if ("regex" === issue.format) return function(issue, options = {
7541
7346
  displayInvalidFormatDetails: !1
7542
7347
  }) {
7543
7348
  let message = "value must match pattern";
@@ -7547,7 +7352,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7547
7352
  message
7548
7353
  };
7549
7354
  }(issue, options);
7550
- if ("jwt" === (issue8 = issue).format) return function(issue, options = {
7355
+ if ("jwt" === issue.format) return function(issue, options = {
7551
7356
  displayInvalidFormatDetails: !1
7552
7357
  }) {
7553
7358
  return {
@@ -7681,10 +7486,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7681
7486
  }
7682
7487
  return path.reduce((acc, propertyKey)=>{
7683
7488
  if ("number" == typeof propertyKey) return acc + "[" + propertyKey.toString() + "]";
7684
- if ("symbol" == typeof propertyKey && (propertyKey = stringifySymbol(propertyKey)), propertyKey.includes('"')) {
7685
- var str;
7686
- return acc + '["' + (str = propertyKey).replace(/"/g, '\\"') + '"]';
7687
- }
7489
+ if ("symbol" == typeof propertyKey && (propertyKey = stringifySymbol(propertyKey)), propertyKey.includes('"')) return acc + '["' + propertyKey.replace(/"/g, '\\"') + '"]';
7688
7490
  if (!identifierRegex.test(propertyKey)) return acc + '["' + propertyKey + '"]';
7689
7491
  let separator = 0 === acc.length ? "" : ".";
7690
7492
  return acc + separator + propertyKey;
@@ -7707,7 +7509,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7707
7509
  }
7708
7510
  function fromZodErrorWithoutRuntimeCheck(zodError, options = {}) {
7709
7511
  var options1;
7710
- let message, zodIssues = zodError.issues;
7512
+ let zodIssues = zodError.issues;
7711
7513
  return new ValidationError(isNonEmptyArray(zodIssues) ? ("messageBuilder" in (options1 = options) ? options1.messageBuilder : function(partialOptions = {}) {
7712
7514
  let options = {
7713
7515
  ...defaultMessageBuilderOptions,
@@ -7724,11 +7526,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7724
7526
  cause: zodError
7725
7527
  });
7726
7528
  }
7727
- var toValidationError = (options = {})=>(err)=>isZodErrorLike(err) ? fromZodErrorWithoutRuntimeCheck(err, options) : err instanceof Error ? new ValidationError(err.message, {
7728
- cause: err
7729
- }) : new ValidationError("Unknown error");
7730
7529
  function fromError(err, options = {}) {
7731
- return toValidationError(options)(err);
7530
+ return ((options = {})=>(err)=>isZodErrorLike(err) ? fromZodErrorWithoutRuntimeCheck(err, options) : err instanceof Error ? new ValidationError(err.message, {
7531
+ cause: err
7532
+ }) : new ValidationError("Unknown error"))(options)(err);
7732
7533
  }
7733
7534
  class validate_ValidationError extends Error {
7734
7535
  constructor(message){
@@ -7775,16 +7576,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7775
7576
  return !1;
7776
7577
  }
7777
7578
  }
7778
- let compilationOptionsMap = new WeakMap(), getPluginOptions = (compilation, uid)=>{
7779
- if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
7780
- return compilationOptionsMap.get(compilation)?.[uid];
7781
- }, setPluginOptions = (compilation, uid, options)=>{
7782
- let optionsMap = compilationOptionsMap.get(compilation) || {};
7783
- optionsMap[uid] = options, compilationOptionsMap.set(compilation, optionsMap);
7784
- }, cleanPluginOptions = (compilation, uid)=>{
7785
- let optionsMap = compilationOptionsMap.get(compilation) || {};
7786
- delete optionsMap[uid], 0 === Object.keys(optionsMap).length ? compilationOptionsMap.delete(compilation) : compilationOptionsMap.set(compilation, optionsMap);
7787
- }, HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
7579
+ let compilationOptionsMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
7788
7580
  let templateParameters, templateFn, filenames;
7789
7581
  validate(c, getHtmlPluginOptionsSchema);
7790
7582
  let uid = HTML_PLUGIN_UID++, meta = {};
@@ -7824,9 +7616,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7824
7616
  return json;
7825
7617
  }
7826
7618
  this.hooks.compilation.tap("HtmlRspackPlugin", (compilationInstance)=>{
7827
- setPluginOptions(compilation = compilationInstance, uid, c);
7619
+ var compilation1 = compilation = compilationInstance, uid1 = uid, options = c;
7620
+ let optionsMap = compilationOptionsMap.get(compilation1) || {};
7621
+ optionsMap[uid1] = options, compilationOptionsMap.set(compilation1, optionsMap);
7828
7622
  }), this.hooks.done.tap("HtmlRspackPlugin", (stats)=>{
7829
- cleanPluginHooks(stats.compilation), cleanPluginOptions(stats.compilation, uid);
7623
+ compilation = stats.compilation, hooks_compilationHooksMap.delete(compilation);
7624
+ var compilation, compilation1 = stats.compilation, uid1 = uid;
7625
+ let optionsMap = compilationOptionsMap.get(compilation1) || {};
7626
+ delete optionsMap[uid1], 0 === Object.keys(optionsMap).length ? compilationOptionsMap.delete(compilation1) : compilationOptionsMap.set(compilation1, optionsMap);
7830
7627
  });
7831
7628
  let templateContent = c.templateContent;
7832
7629
  if ("function" == typeof templateContent) templateFn = async (data)=>{
@@ -7965,10 +7762,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7965
7762
  };
7966
7763
  class HttpUriPlugin extends RspackBuiltinPlugin {
7967
7764
  options;
7968
- name;
7969
- affectedHooks;
7765
+ name = binding_.BuiltinPluginName.HttpUriPlugin;
7766
+ affectedHooks = "compilation";
7970
7767
  constructor(options){
7971
- super(), this.options = options, this.name = binding_.BuiltinPluginName.HttpUriPlugin, this.affectedHooks = "compilation";
7768
+ super(), this.options = options;
7972
7769
  }
7973
7770
  raw(compiler) {
7974
7771
  let { options } = this, lockfileLocation = options.lockfileLocation ?? external_node_path_default().join(compiler.context, compiler.name ? `${compiler.name}.rspack.lock` : "rspack.lock"), cacheLocation = !1 === options.cacheLocation ? void 0 : options.cacheLocation ?? `${lockfileLocation}.data`, raw = {
@@ -8005,21 +7802,21 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8005
7802
  imports,
8006
7803
  entries,
8007
7804
  test
8008
- }), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", getDefaultClient = (compiler)=>require.resolve(`../hot/lazy-compilation-${compiler.options.externalsPresets.node ? "node" : "web"}.js`), noop = (_req, _res, next)=>{
7805
+ }), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
8009
7806
  "function" == typeof next && next();
8010
- }, getFullServerUrl = ({ serverUrl, prefix })=>{
8011
- let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
8012
- return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
8013
7807
  };
8014
7808
  function applyPlugin(compiler, moduleToIndex, indexToModule, options, activeModules, filesByKey) {
8015
7809
  new BuiltinLazyCompilationPlugin(({ module, path })=>{
8016
- let index = moduleToIndex.get(module);
7810
+ let compiler1, index = moduleToIndex.get(module);
8017
7811
  void 0 === index && (index = moduleToIndex.size.toString(), moduleToIndex.set(module, index), indexToModule.set(index, module));
8018
7812
  let key = indexToModule.get(index);
8019
7813
  filesByKey.set(key, path);
8020
7814
  let active = !0 === activeModules.get(key);
8021
7815
  return {
8022
- client: `${options.client || getDefaultClient(compiler)}?${encodeURIComponent(getFullServerUrl(options))}`,
7816
+ client: `${options.client || (compiler1 = compiler, require.resolve(`../hot/lazy-compilation-${compiler1.options.externalsPresets.node ? "node" : "web"}.js`))}?${encodeURIComponent((({ serverUrl, prefix })=>{
7817
+ let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
7818
+ return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
7819
+ })(options))}`,
8023
7820
  data: index,
8024
7821
  active
8025
7822
  };
@@ -8047,10 +7844,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8047
7844
  }, LimitChunkCountPlugin = base_create(binding_.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options);
8048
7845
  class MangleExportsPlugin extends RspackBuiltinPlugin {
8049
7846
  deterministic;
8050
- name;
8051
- affectedHooks;
7847
+ name = binding_.BuiltinPluginName.MangleExportsPlugin;
7848
+ affectedHooks = "compilation";
8052
7849
  constructor(deterministic){
8053
- super(), this.deterministic = deterministic, this.name = binding_.BuiltinPluginName.MangleExportsPlugin, this.affectedHooks = "compilation";
7850
+ super(), this.deterministic = deterministic;
8054
7851
  }
8055
7852
  raw(compiler) {
8056
7853
  return createBuiltinPlugin(this.name, this.deterministic);
@@ -8109,29 +7906,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8109
7906
  ])
8110
7907
  }, RuntimePlugin_compilationHooksMap.set(compilation, hooks)), hooks;
8111
7908
  };
8112
- let createRuntimePluginHooksRegisters = (getCompiler, createTap, createMapTap)=>({
8113
- registerRuntimePluginCreateScriptTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginCreateScript, function() {
8114
- return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).createScript;
8115
- }, function(queried) {
8116
- return function(data) {
8117
- return queried.call(data.code, data.chunk);
8118
- };
8119
- }),
8120
- registerRuntimePluginLinkPreloadTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPreload, function() {
8121
- return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPreload;
8122
- }, function(queried) {
8123
- return function(data) {
8124
- return queried.call(data.code, data.chunk);
8125
- };
8126
- }),
8127
- registerRuntimePluginLinkPrefetchTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPrefetch, function() {
8128
- return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPrefetch;
8129
- }, function(queried) {
8130
- return function(data) {
8131
- return queried.call(data.code, data.chunk);
8132
- };
8133
- })
8134
- }), SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
7909
+ let SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
8135
7910
  let hints = !1 === options.hints ? void 0 : options.hints;
8136
7911
  return {
8137
7912
  ...options,
@@ -8147,10 +7922,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8147
7922
  }
8148
7923
  class SplitChunksPlugin extends RspackBuiltinPlugin {
8149
7924
  options;
8150
- name;
8151
- affectedHooks;
7925
+ name = binding_.BuiltinPluginName.SplitChunksPlugin;
7926
+ affectedHooks = "thisCompilation";
8152
7927
  constructor(options){
8153
- super(), this.options = options, this.name = binding_.BuiltinPluginName.SplitChunksPlugin, this.affectedHooks = "thisCompilation";
7928
+ super(), this.options = options;
8154
7929
  }
8155
7930
  raw(compiler) {
8156
7931
  let rawOptions = function(sc, compiler) {
@@ -8293,9 +8068,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8293
8068
  wasmLoading;
8294
8069
  module;
8295
8070
  workerPublicPath;
8296
- name;
8071
+ name = binding_.BuiltinPluginName.WorkerPlugin;
8297
8072
  constructor(chunkLoading, wasmLoading, module, workerPublicPath){
8298
- super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath, this.name = binding_.BuiltinPluginName.WorkerPlugin;
8073
+ super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath;
8299
8074
  }
8300
8075
  raw(compiler) {
8301
8076
  return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler), createBuiltinPlugin(this.name, void 0);
@@ -8350,43 +8125,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8350
8125
  ])
8351
8126
  }, RsdoctorPlugin_compilationHooksMap.set(compilation, hooks)), hooks;
8352
8127
  };
8353
- let createRsdoctorPluginHooksRegisters = (getCompiler, createTap, createMapTap)=>({
8354
- registerRsdoctorPluginModuleGraphTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleGraph, function() {
8355
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleGraph;
8356
- }, function(queried) {
8357
- return async function(data) {
8358
- return await queried.promise(data);
8359
- };
8360
- }),
8361
- registerRsdoctorPluginChunkGraphTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
8362
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).chunkGraph;
8363
- }, function(queried) {
8364
- return async function(data) {
8365
- return await queried.promise(data);
8366
- };
8367
- }),
8368
- registerRsdoctorPluginModuleIdsTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
8369
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleIds;
8370
- }, function(queried) {
8371
- return async function(data) {
8372
- return await queried.promise(data);
8373
- };
8374
- }),
8375
- registerRsdoctorPluginModuleSourcesTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
8376
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleSources;
8377
- }, function(queried) {
8378
- return async function(data) {
8379
- return await queried.promise(data);
8380
- };
8381
- }),
8382
- registerRsdoctorPluginAssetsTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
8383
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).assets;
8384
- }, function(queried) {
8385
- return async function(data) {
8386
- return await queried.promise(data);
8387
- };
8388
- })
8389
- }), SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
8128
+ let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
8390
8129
  let htmlPlugin = "Disabled";
8391
8130
  return options.htmlPlugin === NATIVE_HTML_PLUGIN ? htmlPlugin = "Native" : "string" == typeof options.htmlPlugin && (htmlPlugin = "JavaScript"), {
8392
8131
  hashFuncNames: options.hashFuncNames,
@@ -8711,8 +8450,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8711
8450
  let requiredVersion = versions[name];
8712
8451
  if (!requiredVersion) return !1;
8713
8452
  let [parsedMajor, parserMinor] = "TP" === parsedVersion ? [
8714
- Number.POSITIVE_INFINITY,
8715
- Number.POSITIVE_INFINITY
8453
+ 1 / 0,
8454
+ 1 / 0
8716
8455
  ] : parsedVersion.includes("-") ? parsedVersion.split("-")[0].split(".") : parsedVersion.split(".");
8717
8456
  return "number" == typeof requiredVersion ? +parsedMajor >= requiredVersion : requiredVersion[0] === +parsedMajor ? +parserMinor >= requiredVersion[1] : +parsedMajor > requiredVersion[0];
8718
8457
  }), anyNode = browsers.some((b)=>b.startsWith("node ")), anyBrowser = browsers.some((b)=>/^(?!node)/.test(b)), browserProperty = !!anyBrowser && (!anyNode || null), nodeProperty = !!anyNode && (!anyBrowser || null), es6DynamicImport = rawChecker({
@@ -9104,7 +8843,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
9104
8843
  }, getBrowserslistTargetHandler = memoize(()=>browserslistTargetHandler_namespaceObject), hasBrowserslistConfig = (context)=>{
9105
8844
  let { findConfig } = __webpack_require__("browserslist-load-config");
9106
8845
  return !!findConfig(context);
9107
- }, getDefaultTarget = (context)=>hasBrowserslistConfig(context) ? "browserslist" : "web", versionDependent = (major, minor)=>{
8846
+ }, versionDependent = (major, minor)=>{
9108
8847
  if (!major) return ()=>void 0;
9109
8848
  let nMajor = +major, nMinor = minor ? +minor : 0;
9110
8849
  return (vMajor, vMinor = 0)=>nMajor > vMajor || nMajor === vMajor && nMinor >= vMinor;
@@ -9304,27 +9043,28 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9304
9043
  }
9305
9044
  }
9306
9045
  throw Error(`Unknown target '${target}'. The following targets are supported:\n${TARGETS.map(([name, description])=>`* ${name}: ${description}`).join("\n")}`);
9307
- }, mergeTargetProperties = (targetProperties)=>{
9308
- let keys = new Set();
9309
- for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
9310
- let result = {};
9311
- for (let key of keys){
9312
- let hasTrue = !1, hasFalse = !1;
9313
- for (let tp of targetProperties)switch(tp[key]){
9314
- case !0:
9315
- hasTrue = !0;
9316
- break;
9317
- case !1:
9318
- hasFalse = !0;
9319
- }
9320
- (hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
9321
- }
9322
- return result;
9323
- }, getTargetsProperties = (targets, context)=>mergeTargetProperties(targets.map((t)=>getTargetProperties(t, context))), applyRspackOptionsDefaults = (options)=>{
9324
- defaults_F(options, "context", ()=>process.cwd()), defaults_F(options, "target", ()=>getDefaultTarget(options.context));
9046
+ }, applyRspackOptionsDefaults = (options)=>{
9047
+ let targets, context;
9048
+ defaults_F(options, "context", ()=>process.cwd()), defaults_F(options, "target", ()=>hasBrowserslistConfig(options.context) ? "browserslist" : "web");
9325
9049
  let { mode, target } = options;
9326
9050
  external_node_assert_default()(!isNil(target));
9327
- let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) : getTargetsProperties(target, options.context)), development = "development" === mode, production = "production" === mode || !mode;
9051
+ let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) : (targets = target, context = options.context, ((targetProperties)=>{
9052
+ let keys = new Set();
9053
+ for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
9054
+ let result = {};
9055
+ for (let key of keys){
9056
+ let hasTrue = !1, hasFalse = !1;
9057
+ for (let tp of targetProperties)switch(tp[key]){
9058
+ case !0:
9059
+ hasTrue = !0;
9060
+ break;
9061
+ case !1:
9062
+ hasFalse = !0;
9063
+ }
9064
+ (hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
9065
+ }
9066
+ return result;
9067
+ })(targets.map((t)=>getTargetProperties(t, context))))), development = "development" === mode, production = "production" === mode || !mode;
9328
9068
  if ("function" != typeof options.entry) for (let key of Object.keys(options.entry))defaults_F(options.entry[key], "import", ()=>[
9329
9069
  "./src"
9330
9070
  ]);
@@ -9368,8 +9108,6 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9368
9108
  mode: options.mode,
9369
9109
  css: options.experiments.css
9370
9110
  }), options.resolve), options.resolveLoader = cleverMerge(getResolveLoaderDefaults(), options.resolveLoader);
9371
- }, applyRspackOptionsBaseDefaults = (options)=>{
9372
- defaults_F(options, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging);
9373
9111
  }, applyInfrastructureLoggingDefaults = (infrastructureLogging)=>{
9374
9112
  defaults_F(infrastructureLogging, "stream", ()=>process.stderr);
9375
9113
  let tty = infrastructureLogging.stream.isTTY && "dumb" !== process.env.TERM;
@@ -9377,15 +9115,12 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9377
9115
  }, applyExperimentsDefaults = (experiments, { production, development })=>{
9378
9116
  defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !0), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1);
9379
9117
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
9380
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.6"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
9381
- }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyJavascriptParserOptionsDefaults = (parserOptions)=>{
9382
- D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
9118
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.7"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
9119
+ }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
9120
+ var parserOptions;
9121
+ if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), D(parserOptions = module.parser.javascript, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
9383
9122
  "..."
9384
- ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", !1), D(parserOptions, "typeReexportsPresence", "no-tolerant");
9385
- }, applyJsonGeneratorOptionsDefaults = (generatorOptions)=>{
9386
- D(generatorOptions, "JSONParse", !0);
9387
- }, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
9388
- if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), applyJavascriptParserOptionsDefaults(module.parser.javascript), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), applyJsonGeneratorOptionsDefaults(module.generator.json), css) {
9123
+ ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", !1), D(parserOptions, "typeReexportsPresence", "no-tolerant"), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, "JSONParse", !0), css) {
9389
9124
  defaults_F(module.parser, "css", ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, "namedExports", !0), D(module.parser.css, "url", !0), defaults_F(module.parser, "css/auto", ()=>({})), assertNotNill(module.parser["css/auto"]), D(module.parser["css/auto"], "namedExports", !0), D(module.parser["css/auto"], "url", !0), defaults_F(module.parser, "css/module", ()=>({})), assertNotNill(module.parser["css/module"]), D(module.parser["css/module"], "namedExports", !0), D(module.parser["css/module"], "url", !0), defaults_F(module.generator, "css", ()=>({})), assertNotNill(module.generator.css), D(module.generator.css, "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator.css, "esModule", !0), defaults_F(module.generator, "css/auto", ()=>({})), assertNotNill(module.generator["css/auto"]), D(module.generator["css/auto"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/auto"], "exportsConvention", "as-is");
9390
9125
  let localIdentName = uniqueName && uniqueName.length > 0 ? "[uniqueName]-[id]-[local]" : "[id]-[local]";
9391
9126
  D(module.generator["css/auto"], "localIdentName", localIdentName), D(module.generator["css/auto"], "esModule", !0), defaults_F(module.generator, "css/module", ()=>({})), assertNotNill(module.generator["css/module"]), D(module.generator["css/module"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/module"], "exportsConvention", "as-is"), D(module.generator["css/module"], "localIdentName", localIdentName), D(module.generator["css/module"], "esModule", !0);
@@ -9525,8 +9260,38 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9525
9260
  return "";
9526
9261
  }
9527
9262
  }), defaults_F(output, "devtoolNamespace", ()=>output.uniqueName), defaults_F(output, "module", ()=>!!outputModule);
9528
- let environment = output.environment, optimistic = (v)=>v || void 0 === v, conditionallyOptimistic = (v, c)=>void 0 === v && c || v;
9529
- defaults_F(environment, "globalThis", ()=>tp?.globalThis), defaults_F(environment, "bigIntLiteral", ()=>tp && optimistic(tp.bigIntLiteral)), defaults_F(environment, "const", ()=>tp && optimistic(tp.const)), defaults_F(environment, "arrowFunction", ()=>tp && optimistic(tp.arrowFunction)), defaults_F(environment, "asyncFunction", ()=>tp && optimistic(tp.asyncFunction)), defaults_F(environment, "forOf", ()=>tp && optimistic(tp.forOf)), defaults_F(environment, "destructuring", ()=>tp && optimistic(tp.destructuring)), defaults_F(environment, "optionalChaining", ()=>tp && optimistic(tp.optionalChaining)), defaults_F(environment, "nodePrefixForCoreModules", ()=>tp && optimistic(tp.nodePrefixForCoreModules)), defaults_F(environment, "templateLiteral", ()=>tp && optimistic(tp.templateLiteral)), defaults_F(environment, "dynamicImport", ()=>conditionallyOptimistic(tp?.dynamicImport, output.module)), defaults_F(environment, "dynamicImportInWorker", ()=>conditionallyOptimistic(tp?.dynamicImportInWorker, output.module)), defaults_F(environment, "module", ()=>conditionallyOptimistic(tp?.module, output.module)), defaults_F(environment, "document", ()=>tp && optimistic(tp.document)), D(output, "filename", output.module ? "[name].mjs" : "[name].js"), defaults_F(output, "iife", ()=>!output.module), defaults_F(output, "chunkFilename", ()=>{
9263
+ let environment = output.environment, conditionallyOptimistic = (v, c)=>void 0 === v && c || v;
9264
+ defaults_F(environment, "globalThis", ()=>tp?.globalThis), defaults_F(environment, "bigIntLiteral", ()=>{
9265
+ let v;
9266
+ return tp && ((v = tp.bigIntLiteral) || void 0 === v);
9267
+ }), defaults_F(environment, "const", ()=>{
9268
+ let v;
9269
+ return tp && ((v = tp.const) || void 0 === v);
9270
+ }), defaults_F(environment, "arrowFunction", ()=>{
9271
+ let v;
9272
+ return tp && ((v = tp.arrowFunction) || void 0 === v);
9273
+ }), defaults_F(environment, "asyncFunction", ()=>{
9274
+ let v;
9275
+ return tp && ((v = tp.asyncFunction) || void 0 === v);
9276
+ }), defaults_F(environment, "forOf", ()=>{
9277
+ let v;
9278
+ return tp && ((v = tp.forOf) || void 0 === v);
9279
+ }), defaults_F(environment, "destructuring", ()=>{
9280
+ let v;
9281
+ return tp && ((v = tp.destructuring) || void 0 === v);
9282
+ }), defaults_F(environment, "optionalChaining", ()=>{
9283
+ let v;
9284
+ return tp && ((v = tp.optionalChaining) || void 0 === v);
9285
+ }), defaults_F(environment, "nodePrefixForCoreModules", ()=>{
9286
+ let v;
9287
+ return tp && ((v = tp.nodePrefixForCoreModules) || void 0 === v);
9288
+ }), defaults_F(environment, "templateLiteral", ()=>{
9289
+ let v;
9290
+ return tp && ((v = tp.templateLiteral) || void 0 === v);
9291
+ }), defaults_F(environment, "dynamicImport", ()=>conditionallyOptimistic(tp?.dynamicImport, output.module)), defaults_F(environment, "dynamicImportInWorker", ()=>conditionallyOptimistic(tp?.dynamicImportInWorker, output.module)), defaults_F(environment, "module", ()=>conditionallyOptimistic(tp?.module, output.module)), defaults_F(environment, "document", ()=>{
9292
+ let v;
9293
+ return tp && ((v = tp.document) || void 0 === v);
9294
+ }), D(output, "filename", output.module ? "[name].mjs" : "[name].js"), defaults_F(output, "iife", ()=>!output.module), defaults_F(output, "chunkFilename", ()=>{
9530
9295
  let filename = output.filename;
9531
9296
  if ("function" != typeof filename) {
9532
9297
  let hasName = filename.includes("[name]"), hasId = filename.includes("[id]"), hasChunkHash = filename.includes("[chunkhash]"), hasContentHash = filename.includes("[contenthash]");
@@ -9650,7 +9415,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9650
9415
  ] : [
9651
9416
  "javascript",
9652
9417
  "unknown"
9653
- ]), D(splitChunks, "hidePathInfo", production), D(splitChunks, "chunks", "async"), D(splitChunks, "usedExports", !0 === optimization.usedExports), D(splitChunks, "minChunks", 1), defaults_F(splitChunks, "minSize", ()=>production ? 20000 : 10000), defaults_F(splitChunks, "maxAsyncRequests", ()=>production ? 30 : Number.POSITIVE_INFINITY), defaults_F(splitChunks, "maxInitialRequests", ()=>production ? 30 : Number.POSITIVE_INFINITY), D(splitChunks, "automaticNameDelimiter", "-");
9418
+ ]), D(splitChunks, "hidePathInfo", production), D(splitChunks, "chunks", "async"), D(splitChunks, "usedExports", !0 === optimization.usedExports), D(splitChunks, "minChunks", 1), defaults_F(splitChunks, "minSize", ()=>production ? 20000 : 10000), defaults_F(splitChunks, "maxAsyncRequests", ()=>production ? 30 : 1 / 0), defaults_F(splitChunks, "maxInitialRequests", ()=>production ? 30 : 1 / 0), D(splitChunks, "automaticNameDelimiter", "-");
9654
9419
  let { cacheGroups } = splitChunks;
9655
9420
  cacheGroups && (defaults_F(cacheGroups, "default", ()=>({
9656
9421
  idHint: "",
@@ -10227,12 +9992,16 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
10227
9992
  this.callbacks = [];
10228
9993
  let fileDependencies = new Set([
10229
9994
  ...compilation.fileDependencies
10230
- ]), contextDependencies = new Set([
9995
+ ]);
9996
+ fileDependencies.added = new Set(compilation.__internal__addedFileDependencies), fileDependencies.removed = new Set(compilation.__internal__removedFileDependencies);
9997
+ let contextDependencies = new Set([
10231
9998
  ...compilation.contextDependencies
10232
- ]), missingDependencies = new Set([
9999
+ ]);
10000
+ contextDependencies.added = new Set(compilation.__internal__addedContextDependencies), contextDependencies.removed = new Set(compilation.__internal__removedContextDependencies);
10001
+ let missingDependencies = new Set([
10233
10002
  ...compilation.missingDependencies
10234
10003
  ]);
10235
- this.compiler.hooks.done.callAsync(stats, (err)=>{
10004
+ missingDependencies.added = new Set(compilation.__internal__addedMissingDependencies), missingDependencies.removed = new Set(compilation.__internal__removedMissingDependencies), this.compiler.hooks.done.callAsync(stats, (err)=>{
10236
10005
  if (err) return handleError(err, cbs);
10237
10006
  for (let cb of (this.handler(null, stats), process.nextTick(()=>{
10238
10007
  this.#closed || this.watch(fileDependencies, contextDependencies, missingDependencies);
@@ -10255,97 +10024,17 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
10255
10024
  this.suspended && (this.suspended = !1, this.#invalidate());
10256
10025
  }
10257
10026
  }
10258
- let CORE_VERSION = "1.4.6", checkVersion = ()=>CORE_VERSION === binding_.EXPECTED_RSPACK_CORE_VERSION ? null : Error(bindingVersionCheck_errorMessage(CORE_VERSION, binding_.EXPECTED_RSPACK_CORE_VERSION)), bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10027
+ let CORE_VERSION = "1.4.7", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10259
10028
 
10260
10029
  Help:
10261
- Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}'). The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
10262
- ` : `Unmatched version @rspack/core@${coreVersion} and @rspack/binding.
10030
+ Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
10031
+ The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
10032
+ ` : `Unmatched version @rspack/core@${coreVersion} and @rspack/binding@${expectedCoreVersion}.
10263
10033
 
10264
10034
  Help:
10265
10035
  Please ensure the version of @rspack/binding and @rspack/core is the same.
10266
- `, createHtmlPluginHooksRegisters = (getCompiler, createTap, createMapTap)=>{
10267
- let getOptions = (uid)=>getPluginOptions(getCompiler().__internal__get_compilation(), uid);
10268
- return {
10269
- registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration, function() {
10270
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeAssetTagGeneration;
10271
- }, function(queried) {
10272
- return async function(data) {
10273
- let { compilationId, uid } = data, res = await queried.promise({
10274
- ...data,
10275
- plugin: {
10276
- options: getOptions(uid)
10277
- }
10278
- });
10279
- return res.compilationId = compilationId, res.uid = uid, res;
10280
- };
10281
- }),
10282
- registerHtmlPluginAlterAssetTagsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTags, function() {
10283
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTags;
10284
- }, function(queried) {
10285
- return async function(data) {
10286
- let { compilationId, uid } = data, res = await queried.promise({
10287
- ...data,
10288
- plugin: {
10289
- options: getOptions(uid)
10290
- }
10291
- });
10292
- return res.compilationId = compilationId, res.uid = uid, res;
10293
- };
10294
- }),
10295
- registerHtmlPluginAlterAssetTagGroupsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups, function() {
10296
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTagGroups;
10297
- }, function(queried) {
10298
- return async function(data) {
10299
- let { compilationId, uid } = data, res = await queried.promise({
10300
- ...data,
10301
- plugin: {
10302
- options: getOptions(uid)
10303
- }
10304
- });
10305
- return res.compilationId = compilationId, res.uid = uid, res;
10306
- };
10307
- }),
10308
- registerHtmlPluginAfterTemplateExecutionTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterTemplateExecution, function() {
10309
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterTemplateExecution;
10310
- }, function(queried) {
10311
- return async function(data) {
10312
- let { compilationId, uid } = data, res = await queried.promise({
10313
- ...data,
10314
- plugin: {
10315
- options: getOptions(uid)
10316
- }
10317
- });
10318
- return res.compilationId = compilationId, res;
10319
- };
10320
- }),
10321
- registerHtmlPluginBeforeEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeEmit, function() {
10322
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeEmit;
10323
- }, function(queried) {
10324
- return async function(data) {
10325
- let { compilationId, uid } = data, res = await queried.promise({
10326
- ...data,
10327
- plugin: {
10328
- options: getOptions(uid)
10329
- }
10330
- });
10331
- return res.compilationId = compilationId, res.uid = uid, res;
10332
- };
10333
- }),
10334
- registerHtmlPluginAfterEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterEmit, function() {
10335
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterEmit;
10336
- }, function(queried) {
10337
- return async function(data) {
10338
- let { compilationId, uid } = data, res = await queried.promise({
10339
- ...data,
10340
- plugin: {
10341
- options: getOptions(uid)
10342
- }
10343
- });
10344
- return res.compilationId = compilationId, res.uid = uid, res;
10345
- };
10346
- })
10347
- };
10348
- }, RESERVED_RUNTIME_GLOBALS = new Map();
10036
+ The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
10037
+ `, RESERVED_RUNTIME_GLOBALS = new Map();
10349
10038
  function __from_binding_runtime_globals(runtimeRequirements) {
10350
10039
  let res = new Set();
10351
10040
  for (let flag of runtimeRequirements.value)flag in RuntimeGlobals ? res.add(RuntimeGlobals[flag]) : res.add(flag);
@@ -10434,7 +10123,6 @@ Help:
10434
10123
  asyncModule: "__webpack_require__.a"
10435
10124
  };
10436
10125
  for (let entry of Object.entries(RuntimeGlobals))RESERVED_RUNTIME_GLOBALS.set(entry[1], entry[0]);
10437
- let isReservedRuntimeGlobal = (r)=>RESERVED_RUNTIME_GLOBALS.has(r);
10438
10126
  class CodeGenerationResult {
10439
10127
  #inner;
10440
10128
  constructor(result){
@@ -10444,263 +10132,21 @@ Help:
10444
10132
  return this.#inner.sources[sourceType];
10445
10133
  }
10446
10134
  }
10447
- let createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10448
- registerCompilationAdditionalTreeRuntimeRequirementsTaps: createTap(binding_.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements, function() {
10449
- return getCompiler().__internal__get_compilation().hooks.additionalTreeRuntimeRequirements;
10450
- }, function(queried) {
10451
- return function({ chunk, runtimeRequirements }) {
10452
- let set = __from_binding_runtime_globals(runtimeRequirements);
10453
- return queried.call(chunk, set), {
10454
- runtimeRequirements: __to_binding_runtime_globals(set)
10455
- };
10456
- };
10457
- }),
10458
- registerCompilationRuntimeRequirementInTreeTaps: createMapTap(binding_.RegisterJsTapKind.CompilationRuntimeRequirementInTree, function() {
10459
- return getCompiler().__internal__get_compilation().hooks.runtimeRequirementInTree;
10460
- }, function(queried) {
10461
- return function({ chunk, allRuntimeRequirements, runtimeRequirements }) {
10462
- let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements), customRuntimeGlobals = new Set(), originalAdd = all.add.bind(all), add = function(r) {
10463
- return all.has(r) ? all : (isReservedRuntimeGlobal(r) || customRuntimeGlobals.add(r), originalAdd(r));
10464
- };
10465
- for (let r of (all.add = add.bind(add), set))queried.for(r).call(chunk, all);
10466
- for (let r of customRuntimeGlobals)queried.for(r).call(chunk, all);
10467
- return {
10468
- allRuntimeRequirements: __to_binding_runtime_globals(all)
10469
- };
10470
- };
10471
- }),
10472
- registerCompilationRuntimeModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationRuntimeModule, function() {
10473
- return getCompiler().__internal__get_compilation().hooks.runtimeModule;
10474
- }, function(queried) {
10475
- return function({ module, chunk }) {
10476
- let originSource = module.source?.source;
10477
- queried.call(module, chunk);
10478
- let newSource = module.source?.source;
10479
- if (newSource && newSource !== originSource) return module;
10480
- };
10481
- }),
10482
- registerCompilationBuildModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationBuildModule, function() {
10483
- return getCompiler().__internal__get_compilation().hooks.buildModule;
10484
- }, function(queried) {
10485
- return function(module) {
10486
- return queried.call(module);
10487
- };
10488
- }),
10489
- registerCompilationStillValidModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationStillValidModule, function() {
10490
- return getCompiler().__internal__get_compilation().hooks.stillValidModule;
10491
- }, function(queried) {
10492
- return function(module) {
10493
- return queried.call(module);
10494
- };
10495
- }),
10496
- registerCompilationSucceedModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationSucceedModule, function() {
10497
- return getCompiler().__internal__get_compilation().hooks.succeedModule;
10498
- }, function(queried) {
10499
- return function(module) {
10500
- return queried.call(module);
10501
- };
10502
- }),
10503
- registerCompilationExecuteModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationExecuteModule, function() {
10504
- return getCompiler().__internal__get_compilation().hooks.executeModule;
10505
- }, function(queried) {
10506
- return function({ entry, id, codegenResults, runtimeModules }) {
10507
- try {
10508
- let __nested_webpack_require_4786_4805__ = (id)=>{
10509
- let cached = moduleCache[id];
10510
- if (void 0 !== cached) {
10511
- if (cached.error) throw cached.error;
10512
- return cached.exports;
10513
- }
10514
- let execOptions = {
10515
- id,
10516
- module: {
10517
- id,
10518
- exports: {},
10519
- loaded: !1,
10520
- error: void 0
10521
- },
10522
- require: __nested_webpack_require_4786_4805__
10523
- };
10524
- for (let handler of interceptModuleExecution)handler(execOptions);
10525
- let result = codegenResults.map[id]["build time"], moduleObject = execOptions.module;
10526
- return id && (moduleCache[id] = moduleObject), tryRunOrWebpackError(()=>queried.call({
10527
- codeGenerationResult: new CodeGenerationResult(result),
10528
- moduleObject
10529
- }, {
10530
- __webpack_require__: __nested_webpack_require_4786_4805__
10531
- }), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
10532
- }, moduleCache = __nested_webpack_require_4786_4805__[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = __nested_webpack_require_4786_4805__[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
10533
- for (let runtimeModule of runtimeModules)__nested_webpack_require_4786_4805__(runtimeModule);
10534
- let executeResult = __nested_webpack_require_4786_4805__(entry);
10535
- getCompiler().__internal__get_module_execution_results_map().set(id, executeResult);
10536
- } catch (e) {
10537
- throw getCompiler().__internal__get_module_execution_results_map().set(id, e), e;
10538
- }
10539
- };
10540
- }),
10541
- registerCompilationFinishModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationFinishModules, function() {
10542
- return getCompiler().__internal__get_compilation().hooks.finishModules;
10543
- }, function(queried) {
10544
- return async function() {
10545
- return await queried.promise(getCompiler().__internal__get_compilation().modules);
10546
- };
10547
- }),
10548
- registerCompilationOptimizeModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeModules, function() {
10549
- return getCompiler().__internal__get_compilation().hooks.optimizeModules;
10550
- }, function(queried) {
10551
- return function() {
10552
- return queried.call(getCompiler().__internal__get_compilation().modules.values());
10553
- };
10554
- }),
10555
- registerCompilationAfterOptimizeModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterOptimizeModules, function() {
10556
- return getCompiler().__internal__get_compilation().hooks.afterOptimizeModules;
10557
- }, function(queried) {
10558
- return function() {
10559
- queried.call(getCompiler().__internal__get_compilation().modules.values());
10560
- };
10561
- }),
10562
- registerCompilationOptimizeTreeTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeTree, function() {
10563
- return getCompiler().__internal__get_compilation().hooks.optimizeTree;
10564
- }, function(queried) {
10565
- return async function() {
10566
- return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
10567
- };
10568
- }),
10569
- registerCompilationOptimizeChunkModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
10570
- return getCompiler().__internal__get_compilation().hooks.optimizeChunkModules;
10571
- }, function(queried) {
10572
- return async function() {
10573
- return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
10574
- };
10575
- }),
10576
- registerCompilationChunkHashTaps: createTap(binding_.RegisterJsTapKind.CompilationChunkHash, function() {
10577
- return getCompiler().__internal__get_compilation().hooks.chunkHash;
10578
- }, function(queried) {
10579
- return function(chunk) {
10580
- let digestResult;
10581
- if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
10582
- let hash = createHash(getCompiler().options.output.hashFunction);
10583
- return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
10584
- };
10585
- }),
10586
- registerCompilationChunkAssetTaps: createTap(binding_.RegisterJsTapKind.CompilationChunkAsset, function() {
10587
- return getCompiler().__internal__get_compilation().hooks.chunkAsset;
10588
- }, function(queried) {
10589
- return function({ chunk, filename }) {
10590
- return queried.call(chunk, filename);
10591
- };
10592
- }),
10593
- registerCompilationProcessAssetsTaps: createTap(binding_.RegisterJsTapKind.CompilationProcessAssets, function() {
10594
- return getCompiler().__internal__get_compilation().hooks.processAssets;
10595
- }, function(queried) {
10596
- return async function() {
10597
- return await queried.promise(getCompiler().__internal__get_compilation().assets);
10598
- };
10599
- }),
10600
- registerCompilationAfterProcessAssetsTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterProcessAssets, function() {
10601
- return getCompiler().__internal__get_compilation().hooks.afterProcessAssets;
10602
- }, function(queried) {
10603
- return function() {
10604
- return queried.call(getCompiler().__internal__get_compilation().assets);
10605
- };
10606
- }),
10607
- registerCompilationSealTaps: createTap(binding_.RegisterJsTapKind.CompilationSeal, function() {
10608
- return getCompiler().__internal__get_compilation().hooks.seal;
10609
- }, function(queried) {
10610
- return function() {
10611
- return queried.call();
10612
- };
10613
- }),
10614
- registerCompilationAfterSealTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterSeal, function() {
10615
- return getCompiler().__internal__get_compilation().hooks.afterSeal;
10616
- }, function(queried) {
10617
- return async function() {
10618
- return await queried.promise();
10619
- };
10620
- })
10621
- }), createCompilerHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10622
- registerCompilerThisCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerThisCompilation, function() {
10623
- return getCompiler().hooks.thisCompilation;
10624
- }, function(queried) {
10625
- return function(native) {
10626
- return getCompiler().__internal__create_compilation(native), queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
10627
- };
10628
- }),
10629
- registerCompilerCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerCompilation, function() {
10630
- return getCompiler().hooks.compilation;
10631
- }, function(queried) {
10632
- return function() {
10633
- return queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
10634
- };
10635
- }),
10636
- registerCompilerMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerMake, function() {
10637
- return getCompiler().hooks.make;
10638
- }, function(queried) {
10639
- return async function() {
10640
- return await queried.promise(getCompiler().__internal__get_compilation());
10641
- };
10642
- }),
10643
- registerCompilerFinishMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerFinishMake, function() {
10644
- return getCompiler().hooks.finishMake;
10645
- }, function(queried) {
10646
- return async function() {
10647
- return await queried.promise(getCompiler().__internal__get_compilation());
10648
- };
10649
- }),
10650
- registerCompilerShouldEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerShouldEmit, function() {
10651
- return getCompiler().hooks.shouldEmit;
10652
- }, function(queried) {
10653
- return function() {
10654
- return queried.call(getCompiler().__internal__get_compilation());
10655
- };
10656
- }),
10657
- registerCompilerEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerEmit, function() {
10658
- return getCompiler().hooks.emit;
10659
- }, function(queried) {
10660
- return async function() {
10661
- return await queried.promise(getCompiler().__internal__get_compilation());
10662
- };
10663
- }),
10664
- registerCompilerAfterEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerAfterEmit, function() {
10665
- return getCompiler().hooks.afterEmit;
10666
- }, function(queried) {
10667
- return async function() {
10668
- return await queried.promise(getCompiler().__internal__get_compilation());
10669
- };
10670
- }),
10671
- registerCompilerAssetEmittedTaps: createTap(binding_.RegisterJsTapKind.CompilerAssetEmitted, function() {
10672
- return getCompiler().hooks.assetEmitted;
10673
- }, function(queried) {
10674
- return async function({ filename, targetPath, outputPath }) {
10675
- return queried.promise(filename, {
10676
- compilation: getCompiler().__internal__get_compilation(),
10677
- targetPath,
10678
- outputPath,
10679
- get source () {
10680
- return getCompiler().__internal__get_compilation().getAsset(filename)?.source;
10681
- },
10682
- get content () {
10683
- return this.source?.buffer();
10684
- }
10685
- });
10686
- };
10687
- })
10688
- });
10689
- class ContextModuleFactoryBeforeResolveData {
10690
- #inner;
10691
- static __from_binding(binding) {
10692
- return new ContextModuleFactoryBeforeResolveData(binding);
10693
- }
10694
- static __to_binding(data) {
10695
- return data.#inner;
10696
- }
10697
- constructor(binding){
10698
- this.#inner = binding, Object.defineProperties(this, {
10699
- context: {
10700
- enumerable: !0,
10701
- get: ()=>binding.context,
10702
- set (val) {
10703
- binding.context = val;
10135
+ class ContextModuleFactoryBeforeResolveData {
10136
+ #inner;
10137
+ static __from_binding(binding) {
10138
+ return new ContextModuleFactoryBeforeResolveData(binding);
10139
+ }
10140
+ static __to_binding(data) {
10141
+ return data.#inner;
10142
+ }
10143
+ constructor(binding){
10144
+ this.#inner = binding, Object.defineProperties(this, {
10145
+ context: {
10146
+ enumerable: !0,
10147
+ get: ()=>binding.context,
10148
+ set (val) {
10149
+ binding.context = val;
10704
10150
  }
10705
10151
  },
10706
10152
  request: {
@@ -10799,136 +10245,7 @@ Help:
10799
10245
  return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
10800
10246
  }
10801
10247
  });
10802
- let createContextModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10803
- registerContextModuleFactoryBeforeResolveTaps: createTap(binding_.RegisterJsTapKind.ContextModuleFactoryBeforeResolve, function() {
10804
- return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
10805
- }, function(queried) {
10806
- return async function(bindingData) {
10807
- let data = !!bindingData && ContextModuleFactoryBeforeResolveData.__from_binding(bindingData), result = await queried.promise(data);
10808
- return !!result && ContextModuleFactoryBeforeResolveData.__to_binding(result);
10809
- };
10810
- }),
10811
- registerContextModuleFactoryAfterResolveTaps: createTap(binding_.RegisterJsTapKind.ContextModuleFactoryAfterResolve, function() {
10812
- return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
10813
- }, function(queried) {
10814
- return async function(bindingData) {
10815
- let data = !!bindingData && ContextModuleFactoryAfterResolveData.__from_binding(bindingData), result = await queried.promise(data);
10816
- return !!result && ContextModuleFactoryAfterResolveData.__to_binding(result);
10817
- };
10818
- })
10819
- }), createJavaScriptModulesHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10820
- registerJavascriptModulesChunkHashTaps: createTap(binding_.RegisterJsTapKind.JavascriptModulesChunkHash, function() {
10821
- return JavascriptModulesPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).chunkHash;
10822
- }, function(queried) {
10823
- return function(chunk) {
10824
- let digestResult;
10825
- if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
10826
- let hash = createHash(getCompiler().options.output.hashFunction);
10827
- return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
10828
- };
10829
- })
10830
- }), createNormalModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10831
- registerNormalModuleFactoryBeforeResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryBeforeResolve, function() {
10832
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
10833
- }, function(queried) {
10834
- return async function(resolveData) {
10835
- let normalizedResolveData = {
10836
- contextInfo: {
10837
- issuer: resolveData.issuer,
10838
- issuerLayer: resolveData.issuerLayer ?? null
10839
- },
10840
- request: resolveData.request,
10841
- context: resolveData.context,
10842
- fileDependencies: [],
10843
- missingDependencies: [],
10844
- contextDependencies: []
10845
- }, ret = await queried.promise(normalizedResolveData);
10846
- return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
10847
- ret,
10848
- resolveData
10849
- ];
10850
- };
10851
- }),
10852
- registerNormalModuleFactoryFactorizeTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryFactorize, function() {
10853
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
10854
- }, function(queried) {
10855
- return async function(resolveData) {
10856
- let normalizedResolveData = {
10857
- contextInfo: {
10858
- issuer: resolveData.issuer,
10859
- issuerLayer: resolveData.issuerLayer ?? null
10860
- },
10861
- request: resolveData.request,
10862
- context: resolveData.context,
10863
- fileDependencies: [],
10864
- missingDependencies: [],
10865
- contextDependencies: []
10866
- };
10867
- return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
10868
- };
10869
- }),
10870
- registerNormalModuleFactoryResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryResolve, function() {
10871
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
10872
- }, function(queried) {
10873
- return async function(resolveData) {
10874
- let normalizedResolveData = {
10875
- contextInfo: {
10876
- issuer: resolveData.issuer,
10877
- issuerLayer: resolveData.issuerLayer ?? null
10878
- },
10879
- request: resolveData.request,
10880
- context: resolveData.context,
10881
- fileDependencies: [],
10882
- missingDependencies: [],
10883
- contextDependencies: []
10884
- };
10885
- return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
10886
- };
10887
- }),
10888
- registerNormalModuleFactoryResolveForSchemeTaps: createMapTap(binding_.RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
10889
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
10890
- }, function(queried) {
10891
- return async function(args) {
10892
- return [
10893
- await queried.for(args.scheme).promise(args.resourceData),
10894
- args.resourceData
10895
- ];
10896
- };
10897
- }),
10898
- registerNormalModuleFactoryAfterResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
10899
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
10900
- }, function(queried) {
10901
- return async function(arg) {
10902
- let data = {
10903
- contextInfo: {
10904
- issuer: arg.issuer,
10905
- issuerLayer: arg.issuerLayer ?? null
10906
- },
10907
- request: arg.request,
10908
- context: arg.context,
10909
- fileDependencies: arg.fileDependencies,
10910
- missingDependencies: arg.missingDependencies,
10911
- contextDependencies: arg.contextDependencies,
10912
- createData: arg.createData
10913
- };
10914
- return [
10915
- await queried.promise(data),
10916
- data.createData
10917
- ];
10918
- };
10919
- }),
10920
- registerNormalModuleFactoryCreateModuleTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryCreateModule, function() {
10921
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
10922
- }, function(queried) {
10923
- return async function(args) {
10924
- let data = {
10925
- ...args,
10926
- settings: {}
10927
- };
10928
- await queried.promise(data, {});
10929
- };
10930
- })
10931
- }), traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin", PLUGIN_PROCESS_NAME = "Plugin Analysis", makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
10248
+ let traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin", PLUGIN_PROCESS_NAME = "Plugin Analysis", makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
10932
10249
  register: (tapInfo)=>{
10933
10250
  let { name, type, fn: internalFn } = tapInfo, newFn = name === traceHookPlugin_PLUGIN_NAME ? internalFn : makeNewTraceTapFn(compilerName, hookName, tracer, {
10934
10251
  name,
@@ -11372,10 +10689,91 @@ Help:
11372
10689
  return this.#compilationParams = params, params;
11373
10690
  }
11374
10691
  #getInstance(callback) {
11375
- let error = checkVersion();
10692
+ let error = CORE_VERSION === binding_.EXPECTED_RSPACK_CORE_VERSION || CORE_VERSION.includes("canary") ? null : Error(bindingVersionCheck_errorMessage(CORE_VERSION, binding_.EXPECTED_RSPACK_CORE_VERSION));
11376
10693
  if (error) return callback(error);
11377
10694
  if (this.#instance) return callback(null, this.#instance);
11378
- let options = this.options, rawOptions = getRawOptions(options, this);
10695
+ let options = this.options, rawOptions = ((options, compiler)=>{
10696
+ var output, module, options1, parser, generator, stats;
10697
+ let mode = options.mode, experiments = options.experiments;
10698
+ return {
10699
+ name: options.name,
10700
+ mode,
10701
+ context: options.context,
10702
+ output: {
10703
+ ...output = options.output,
10704
+ environment: function(environment = {}) {
10705
+ return {
10706
+ const: !!environment.const,
10707
+ arrowFunction: !!environment.arrowFunction,
10708
+ nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
10709
+ asyncFunction: !!environment.asyncFunction,
10710
+ bigIntLiteral: !!environment.bigIntLiteral,
10711
+ destructuring: !!environment.destructuring,
10712
+ document: !!environment.document,
10713
+ dynamicImport: !!environment.dynamicImport,
10714
+ forOf: !!environment.forOf,
10715
+ globalThis: !!environment.globalThis,
10716
+ module: !!environment.module,
10717
+ optionalChaining: !!environment.optionalChaining,
10718
+ templateLiteral: !!environment.templateLiteral
10719
+ };
10720
+ }(output.environment)
10721
+ },
10722
+ resolve: getRawResolve(options.resolve),
10723
+ resolveLoader: getRawResolve(options.resolveLoader),
10724
+ module: (module = options.module, options1 = {
10725
+ compiler,
10726
+ mode,
10727
+ context: options.context,
10728
+ experiments
10729
+ }, external_node_assert_default()(!isNil(module.defaultRules), "module.defaultRules should not be nil after defaults"), {
10730
+ rules: [
10731
+ {
10732
+ rules: module.defaultRules
10733
+ },
10734
+ {
10735
+ rules: module.rules
10736
+ }
10737
+ ].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
10738
+ parser: Object.fromEntries(Object.entries(parser = module.parser).map(([k, v])=>[
10739
+ k,
10740
+ getRawParserOptions(v, k)
10741
+ ]).filter(([k, v])=>void 0 !== v)),
10742
+ generator: Object.fromEntries(Object.entries(generator = module.generator).map(([k, v])=>[
10743
+ k,
10744
+ getRawGeneratorOptions(v, k)
10745
+ ]).filter(([k, v])=>void 0 !== v)),
10746
+ noParse: module.noParse
10747
+ }),
10748
+ optimization: options.optimization,
10749
+ stats: {
10750
+ colors: function(options) {
10751
+ if ("boolean" == typeof options || "string" == typeof options) return presetToOptions(options);
10752
+ if (!options) return {};
10753
+ let obj = {
10754
+ ...presetToOptions(options.preset),
10755
+ ...options
10756
+ };
10757
+ return delete obj.preset, obj;
10758
+ }(stats = options.stats).colors ?? !1
10759
+ },
10760
+ cache: {
10761
+ type: options.cache ? "memory" : "disable"
10762
+ },
10763
+ experiments,
10764
+ node: function(node) {
10765
+ if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
10766
+ dirname: String(node.__dirname),
10767
+ filename: String(node.__filename),
10768
+ global: String(node.global)
10769
+ };
10770
+ }(options.node),
10771
+ profile: options.profile,
10772
+ amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
10773
+ bail: options.bail,
10774
+ __references: {}
10775
+ };
10776
+ })(options, this);
11379
10777
  rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
11380
10778
  let instanceBinding = __webpack_require__("@rspack/binding");
11381
10779
  this.#registers = this.#createHooksRegisters();
@@ -11383,16 +10781,537 @@ Help:
11383
10781
  this.#instance = new instanceBinding.JsCompiler(this.compilerPath, rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory)), callback(null, this.#instance);
11384
10782
  }
11385
10783
  #createHooksRegisters() {
11386
- let ref = new WeakRef(this), getCompiler = ()=>ref.deref(), createTap = this.#createHookRegisterTaps.bind(this), createMapTap = this.#createHookMapRegisterTaps.bind(this);
10784
+ let getCompiler, createTap, getCompiler1, createTap1, createMapTap, getCompiler2, createTap2, createMapTap1, getCompiler3, createTap3, getCompiler4, getCompiler5, createTap4, getCompiler6, createTap5, ref = new WeakRef(this), getCompiler7 = ()=>ref.deref(), createTap6 = this.#createHookRegisterTaps.bind(this), createMapTap2 = this.#createHookMapRegisterTaps.bind(this);
11387
10785
  return {
11388
- ...createCompilerHooksRegisters(getCompiler, createTap, createMapTap),
11389
- ...createCompilationHooksRegisters(getCompiler, createTap, createMapTap),
11390
- ...createNormalModuleFactoryHooksRegisters(getCompiler, createTap, createMapTap),
11391
- ...createContextModuleFactoryHooksRegisters(getCompiler, createTap, createMapTap),
11392
- ...createJavaScriptModulesHooksRegisters(getCompiler, createTap, createMapTap),
11393
- ...createHtmlPluginHooksRegisters(getCompiler, createTap, createMapTap),
11394
- ...createRuntimePluginHooksRegisters(getCompiler, createTap, createMapTap),
11395
- ...createRsdoctorPluginHooksRegisters(getCompiler, createTap, createMapTap)
10786
+ ...(getCompiler = getCompiler7, {
10787
+ registerCompilerThisCompilationTaps: (createTap = createTap6)(binding_.RegisterJsTapKind.CompilerThisCompilation, function() {
10788
+ return getCompiler().hooks.thisCompilation;
10789
+ }, function(queried) {
10790
+ return function(native) {
10791
+ return getCompiler().__internal__create_compilation(native), queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
10792
+ };
10793
+ }),
10794
+ registerCompilerCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerCompilation, function() {
10795
+ return getCompiler().hooks.compilation;
10796
+ }, function(queried) {
10797
+ return function() {
10798
+ return queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
10799
+ };
10800
+ }),
10801
+ registerCompilerMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerMake, function() {
10802
+ return getCompiler().hooks.make;
10803
+ }, function(queried) {
10804
+ return async function() {
10805
+ return await queried.promise(getCompiler().__internal__get_compilation());
10806
+ };
10807
+ }),
10808
+ registerCompilerFinishMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerFinishMake, function() {
10809
+ return getCompiler().hooks.finishMake;
10810
+ }, function(queried) {
10811
+ return async function() {
10812
+ return await queried.promise(getCompiler().__internal__get_compilation());
10813
+ };
10814
+ }),
10815
+ registerCompilerShouldEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerShouldEmit, function() {
10816
+ return getCompiler().hooks.shouldEmit;
10817
+ }, function(queried) {
10818
+ return function() {
10819
+ return queried.call(getCompiler().__internal__get_compilation());
10820
+ };
10821
+ }),
10822
+ registerCompilerEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerEmit, function() {
10823
+ return getCompiler().hooks.emit;
10824
+ }, function(queried) {
10825
+ return async function() {
10826
+ return await queried.promise(getCompiler().__internal__get_compilation());
10827
+ };
10828
+ }),
10829
+ registerCompilerAfterEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerAfterEmit, function() {
10830
+ return getCompiler().hooks.afterEmit;
10831
+ }, function(queried) {
10832
+ return async function() {
10833
+ return await queried.promise(getCompiler().__internal__get_compilation());
10834
+ };
10835
+ }),
10836
+ registerCompilerAssetEmittedTaps: createTap(binding_.RegisterJsTapKind.CompilerAssetEmitted, function() {
10837
+ return getCompiler().hooks.assetEmitted;
10838
+ }, function(queried) {
10839
+ return async function({ filename, targetPath, outputPath }) {
10840
+ return queried.promise(filename, {
10841
+ compilation: getCompiler().__internal__get_compilation(),
10842
+ targetPath,
10843
+ outputPath,
10844
+ get source () {
10845
+ return getCompiler().__internal__get_compilation().getAsset(filename)?.source;
10846
+ },
10847
+ get content () {
10848
+ return this.source?.buffer();
10849
+ }
10850
+ });
10851
+ };
10852
+ })
10853
+ }),
10854
+ ...(getCompiler1 = getCompiler7, createTap1 = createTap6, createMapTap = createMapTap2, {
10855
+ registerCompilationAdditionalTreeRuntimeRequirementsTaps: createTap1(binding_.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements, function() {
10856
+ return getCompiler1().__internal__get_compilation().hooks.additionalTreeRuntimeRequirements;
10857
+ }, function(queried) {
10858
+ return function({ chunk, runtimeRequirements }) {
10859
+ let set = __from_binding_runtime_globals(runtimeRequirements);
10860
+ return queried.call(chunk, set), {
10861
+ runtimeRequirements: __to_binding_runtime_globals(set)
10862
+ };
10863
+ };
10864
+ }),
10865
+ registerCompilationRuntimeRequirementInTreeTaps: createMapTap(binding_.RegisterJsTapKind.CompilationRuntimeRequirementInTree, function() {
10866
+ return getCompiler1().__internal__get_compilation().hooks.runtimeRequirementInTree;
10867
+ }, function(queried) {
10868
+ return function({ chunk, allRuntimeRequirements, runtimeRequirements }) {
10869
+ let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements), customRuntimeGlobals = new Set(), originalAdd = all.add.bind(all), add = function(r) {
10870
+ let r1;
10871
+ return all.has(r) ? all : (r1 = r, RESERVED_RUNTIME_GLOBALS.has(r1) || customRuntimeGlobals.add(r), originalAdd(r));
10872
+ };
10873
+ for (let r of (all.add = add.bind(add), set))queried.for(r).call(chunk, all);
10874
+ for (let r of customRuntimeGlobals)queried.for(r).call(chunk, all);
10875
+ return {
10876
+ allRuntimeRequirements: __to_binding_runtime_globals(all)
10877
+ };
10878
+ };
10879
+ }),
10880
+ registerCompilationRuntimeModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationRuntimeModule, function() {
10881
+ return getCompiler1().__internal__get_compilation().hooks.runtimeModule;
10882
+ }, function(queried) {
10883
+ return function({ module, chunk }) {
10884
+ let originSource = module.source?.source;
10885
+ queried.call(module, chunk);
10886
+ let newSource = module.source?.source;
10887
+ if (newSource && newSource !== originSource) return module;
10888
+ };
10889
+ }),
10890
+ registerCompilationBuildModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationBuildModule, function() {
10891
+ return getCompiler1().__internal__get_compilation().hooks.buildModule;
10892
+ }, function(queried) {
10893
+ return function(module) {
10894
+ return queried.call(module);
10895
+ };
10896
+ }),
10897
+ registerCompilationStillValidModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationStillValidModule, function() {
10898
+ return getCompiler1().__internal__get_compilation().hooks.stillValidModule;
10899
+ }, function(queried) {
10900
+ return function(module) {
10901
+ return queried.call(module);
10902
+ };
10903
+ }),
10904
+ registerCompilationSucceedModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationSucceedModule, function() {
10905
+ return getCompiler1().__internal__get_compilation().hooks.succeedModule;
10906
+ }, function(queried) {
10907
+ return function(module) {
10908
+ return queried.call(module);
10909
+ };
10910
+ }),
10911
+ registerCompilationExecuteModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationExecuteModule, function() {
10912
+ return getCompiler1().__internal__get_compilation().hooks.executeModule;
10913
+ }, function(queried) {
10914
+ return function({ entry, id, codegenResults, runtimeModules }) {
10915
+ try {
10916
+ let __nested_webpack_require_4786_4805__ = (id)=>{
10917
+ let cached = moduleCache[id];
10918
+ if (void 0 !== cached) {
10919
+ if (cached.error) throw cached.error;
10920
+ return cached.exports;
10921
+ }
10922
+ let execOptions = {
10923
+ id,
10924
+ module: {
10925
+ id,
10926
+ exports: {},
10927
+ loaded: !1,
10928
+ error: void 0
10929
+ },
10930
+ require: __nested_webpack_require_4786_4805__
10931
+ };
10932
+ for (let handler of interceptModuleExecution)handler(execOptions);
10933
+ let result = codegenResults.map[id]["build time"], moduleObject = execOptions.module;
10934
+ return id && (moduleCache[id] = moduleObject), ((fn, hook)=>{
10935
+ try {
10936
+ fn();
10937
+ } catch (err) {
10938
+ if (err instanceof WebpackError) throw err;
10939
+ throw new HookWebpackError(err, hook);
10940
+ }
10941
+ })(()=>queried.call({
10942
+ codeGenerationResult: new CodeGenerationResult(result),
10943
+ moduleObject
10944
+ }, {
10945
+ __webpack_require__: __nested_webpack_require_4786_4805__
10946
+ }), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
10947
+ }, moduleCache = __nested_webpack_require_4786_4805__[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = __nested_webpack_require_4786_4805__[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
10948
+ for (let runtimeModule of runtimeModules)__nested_webpack_require_4786_4805__(runtimeModule);
10949
+ let executeResult = __nested_webpack_require_4786_4805__(entry);
10950
+ getCompiler1().__internal__get_module_execution_results_map().set(id, executeResult);
10951
+ } catch (e) {
10952
+ throw getCompiler1().__internal__get_module_execution_results_map().set(id, e), e;
10953
+ }
10954
+ };
10955
+ }),
10956
+ registerCompilationFinishModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationFinishModules, function() {
10957
+ return getCompiler1().__internal__get_compilation().hooks.finishModules;
10958
+ }, function(queried) {
10959
+ return async function() {
10960
+ return await queried.promise(getCompiler1().__internal__get_compilation().modules);
10961
+ };
10962
+ }),
10963
+ registerCompilationOptimizeModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeModules, function() {
10964
+ return getCompiler1().__internal__get_compilation().hooks.optimizeModules;
10965
+ }, function(queried) {
10966
+ return function() {
10967
+ return queried.call(getCompiler1().__internal__get_compilation().modules.values());
10968
+ };
10969
+ }),
10970
+ registerCompilationAfterOptimizeModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterOptimizeModules, function() {
10971
+ return getCompiler1().__internal__get_compilation().hooks.afterOptimizeModules;
10972
+ }, function(queried) {
10973
+ return function() {
10974
+ queried.call(getCompiler1().__internal__get_compilation().modules.values());
10975
+ };
10976
+ }),
10977
+ registerCompilationOptimizeTreeTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeTree, function() {
10978
+ return getCompiler1().__internal__get_compilation().hooks.optimizeTree;
10979
+ }, function(queried) {
10980
+ return async function() {
10981
+ return await queried.promise(getCompiler1().__internal__get_compilation().chunks, getCompiler1().__internal__get_compilation().modules);
10982
+ };
10983
+ }),
10984
+ registerCompilationOptimizeChunkModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
10985
+ return getCompiler1().__internal__get_compilation().hooks.optimizeChunkModules;
10986
+ }, function(queried) {
10987
+ return async function() {
10988
+ return await queried.promise(getCompiler1().__internal__get_compilation().chunks, getCompiler1().__internal__get_compilation().modules);
10989
+ };
10990
+ }),
10991
+ registerCompilationChunkHashTaps: createTap1(binding_.RegisterJsTapKind.CompilationChunkHash, function() {
10992
+ return getCompiler1().__internal__get_compilation().hooks.chunkHash;
10993
+ }, function(queried) {
10994
+ return function(chunk) {
10995
+ let digestResult;
10996
+ if (!getCompiler1().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
10997
+ let hash = createHash(getCompiler1().options.output.hashFunction);
10998
+ return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler1().options.output.hashDigest ? hash.digest(getCompiler1().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
10999
+ };
11000
+ }),
11001
+ registerCompilationChunkAssetTaps: createTap1(binding_.RegisterJsTapKind.CompilationChunkAsset, function() {
11002
+ return getCompiler1().__internal__get_compilation().hooks.chunkAsset;
11003
+ }, function(queried) {
11004
+ return function({ chunk, filename }) {
11005
+ return queried.call(chunk, filename);
11006
+ };
11007
+ }),
11008
+ registerCompilationProcessAssetsTaps: createTap1(binding_.RegisterJsTapKind.CompilationProcessAssets, function() {
11009
+ return getCompiler1().__internal__get_compilation().hooks.processAssets;
11010
+ }, function(queried) {
11011
+ return async function() {
11012
+ return await queried.promise(getCompiler1().__internal__get_compilation().assets);
11013
+ };
11014
+ }),
11015
+ registerCompilationAfterProcessAssetsTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterProcessAssets, function() {
11016
+ return getCompiler1().__internal__get_compilation().hooks.afterProcessAssets;
11017
+ }, function(queried) {
11018
+ return function() {
11019
+ return queried.call(getCompiler1().__internal__get_compilation().assets);
11020
+ };
11021
+ }),
11022
+ registerCompilationSealTaps: createTap1(binding_.RegisterJsTapKind.CompilationSeal, function() {
11023
+ return getCompiler1().__internal__get_compilation().hooks.seal;
11024
+ }, function(queried) {
11025
+ return function() {
11026
+ return queried.call();
11027
+ };
11028
+ }),
11029
+ registerCompilationAfterSealTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterSeal, function() {
11030
+ return getCompiler1().__internal__get_compilation().hooks.afterSeal;
11031
+ }, function(queried) {
11032
+ return async function() {
11033
+ return await queried.promise();
11034
+ };
11035
+ })
11036
+ }),
11037
+ ...(getCompiler2 = getCompiler7, createTap2 = createTap6, createMapTap1 = createMapTap2, {
11038
+ registerNormalModuleFactoryBeforeResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryBeforeResolve, function() {
11039
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
11040
+ }, function(queried) {
11041
+ return async function(resolveData) {
11042
+ let normalizedResolveData = {
11043
+ contextInfo: {
11044
+ issuer: resolveData.issuer,
11045
+ issuerLayer: resolveData.issuerLayer ?? null
11046
+ },
11047
+ request: resolveData.request,
11048
+ context: resolveData.context,
11049
+ fileDependencies: [],
11050
+ missingDependencies: [],
11051
+ contextDependencies: []
11052
+ }, ret = await queried.promise(normalizedResolveData);
11053
+ return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
11054
+ ret,
11055
+ resolveData
11056
+ ];
11057
+ };
11058
+ }),
11059
+ registerNormalModuleFactoryFactorizeTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryFactorize, function() {
11060
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
11061
+ }, function(queried) {
11062
+ return async function(resolveData) {
11063
+ let normalizedResolveData = {
11064
+ contextInfo: {
11065
+ issuer: resolveData.issuer,
11066
+ issuerLayer: resolveData.issuerLayer ?? null
11067
+ },
11068
+ request: resolveData.request,
11069
+ context: resolveData.context,
11070
+ fileDependencies: [],
11071
+ missingDependencies: [],
11072
+ contextDependencies: []
11073
+ };
11074
+ return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
11075
+ };
11076
+ }),
11077
+ registerNormalModuleFactoryResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryResolve, function() {
11078
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
11079
+ }, function(queried) {
11080
+ return async function(resolveData) {
11081
+ let normalizedResolveData = {
11082
+ contextInfo: {
11083
+ issuer: resolveData.issuer,
11084
+ issuerLayer: resolveData.issuerLayer ?? null
11085
+ },
11086
+ request: resolveData.request,
11087
+ context: resolveData.context,
11088
+ fileDependencies: [],
11089
+ missingDependencies: [],
11090
+ contextDependencies: []
11091
+ };
11092
+ return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
11093
+ };
11094
+ }),
11095
+ registerNormalModuleFactoryResolveForSchemeTaps: createMapTap1(binding_.RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
11096
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
11097
+ }, function(queried) {
11098
+ return async function(args) {
11099
+ return [
11100
+ await queried.for(args.scheme).promise(args.resourceData),
11101
+ args.resourceData
11102
+ ];
11103
+ };
11104
+ }),
11105
+ registerNormalModuleFactoryAfterResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
11106
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
11107
+ }, function(queried) {
11108
+ return async function(arg) {
11109
+ let data = {
11110
+ contextInfo: {
11111
+ issuer: arg.issuer,
11112
+ issuerLayer: arg.issuerLayer ?? null
11113
+ },
11114
+ request: arg.request,
11115
+ context: arg.context,
11116
+ fileDependencies: arg.fileDependencies,
11117
+ missingDependencies: arg.missingDependencies,
11118
+ contextDependencies: arg.contextDependencies,
11119
+ createData: arg.createData
11120
+ };
11121
+ return [
11122
+ await queried.promise(data),
11123
+ data.createData
11124
+ ];
11125
+ };
11126
+ }),
11127
+ registerNormalModuleFactoryCreateModuleTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryCreateModule, function() {
11128
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
11129
+ }, function(queried) {
11130
+ return async function(args) {
11131
+ let data = {
11132
+ ...args,
11133
+ settings: {}
11134
+ };
11135
+ await queried.promise(data, {});
11136
+ };
11137
+ })
11138
+ }),
11139
+ ...(getCompiler3 = getCompiler7, {
11140
+ registerContextModuleFactoryBeforeResolveTaps: (createTap3 = createTap6)(binding_.RegisterJsTapKind.ContextModuleFactoryBeforeResolve, function() {
11141
+ return getCompiler3().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
11142
+ }, function(queried) {
11143
+ return async function(bindingData) {
11144
+ let data = !!bindingData && ContextModuleFactoryBeforeResolveData.__from_binding(bindingData), result = await queried.promise(data);
11145
+ return !!result && ContextModuleFactoryBeforeResolveData.__to_binding(result);
11146
+ };
11147
+ }),
11148
+ registerContextModuleFactoryAfterResolveTaps: createTap3(binding_.RegisterJsTapKind.ContextModuleFactoryAfterResolve, function() {
11149
+ return getCompiler3().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
11150
+ }, function(queried) {
11151
+ return async function(bindingData) {
11152
+ let data = !!bindingData && ContextModuleFactoryAfterResolveData.__from_binding(bindingData), result = await queried.promise(data);
11153
+ return !!result && ContextModuleFactoryAfterResolveData.__to_binding(result);
11154
+ };
11155
+ })
11156
+ }),
11157
+ ...(getCompiler4 = getCompiler7, {
11158
+ registerJavascriptModulesChunkHashTaps: createTap6(binding_.RegisterJsTapKind.JavascriptModulesChunkHash, function() {
11159
+ return JavascriptModulesPlugin.getCompilationHooks(getCompiler4().__internal__get_compilation()).chunkHash;
11160
+ }, function(queried) {
11161
+ return function(chunk) {
11162
+ let digestResult;
11163
+ if (!getCompiler4().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
11164
+ let hash = createHash(getCompiler4().options.output.hashFunction);
11165
+ return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler4().options.output.hashDigest ? hash.digest(getCompiler4().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
11166
+ };
11167
+ })
11168
+ }),
11169
+ ...((getCompiler, createTap, createMapTap)=>{
11170
+ let getOptions = (uid)=>((compilation, uid)=>{
11171
+ if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
11172
+ return compilationOptionsMap.get(compilation)?.[uid];
11173
+ })(getCompiler().__internal__get_compilation(), uid);
11174
+ return {
11175
+ registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration, function() {
11176
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeAssetTagGeneration;
11177
+ }, function(queried) {
11178
+ return async function(data) {
11179
+ let { compilationId, uid } = data, res = await queried.promise({
11180
+ ...data,
11181
+ plugin: {
11182
+ options: getOptions(uid)
11183
+ }
11184
+ });
11185
+ return res.compilationId = compilationId, res.uid = uid, res;
11186
+ };
11187
+ }),
11188
+ registerHtmlPluginAlterAssetTagsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTags, function() {
11189
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTags;
11190
+ }, function(queried) {
11191
+ return async function(data) {
11192
+ let { compilationId, uid } = data, res = await queried.promise({
11193
+ ...data,
11194
+ plugin: {
11195
+ options: getOptions(uid)
11196
+ }
11197
+ });
11198
+ return res.compilationId = compilationId, res.uid = uid, res;
11199
+ };
11200
+ }),
11201
+ registerHtmlPluginAlterAssetTagGroupsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups, function() {
11202
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTagGroups;
11203
+ }, function(queried) {
11204
+ return async function(data) {
11205
+ let { compilationId, uid } = data, res = await queried.promise({
11206
+ ...data,
11207
+ plugin: {
11208
+ options: getOptions(uid)
11209
+ }
11210
+ });
11211
+ return res.compilationId = compilationId, res.uid = uid, res;
11212
+ };
11213
+ }),
11214
+ registerHtmlPluginAfterTemplateExecutionTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterTemplateExecution, function() {
11215
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterTemplateExecution;
11216
+ }, function(queried) {
11217
+ return async function(data) {
11218
+ let { compilationId, uid } = data, res = await queried.promise({
11219
+ ...data,
11220
+ plugin: {
11221
+ options: getOptions(uid)
11222
+ }
11223
+ });
11224
+ return res.compilationId = compilationId, res;
11225
+ };
11226
+ }),
11227
+ registerHtmlPluginBeforeEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeEmit, function() {
11228
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeEmit;
11229
+ }, function(queried) {
11230
+ return async function(data) {
11231
+ let { compilationId, uid } = data, res = await queried.promise({
11232
+ ...data,
11233
+ plugin: {
11234
+ options: getOptions(uid)
11235
+ }
11236
+ });
11237
+ return res.compilationId = compilationId, res.uid = uid, res;
11238
+ };
11239
+ }),
11240
+ registerHtmlPluginAfterEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterEmit, function() {
11241
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterEmit;
11242
+ }, function(queried) {
11243
+ return async function(data) {
11244
+ let { compilationId, uid } = data, res = await queried.promise({
11245
+ ...data,
11246
+ plugin: {
11247
+ options: getOptions(uid)
11248
+ }
11249
+ });
11250
+ return res.compilationId = compilationId, res.uid = uid, res;
11251
+ };
11252
+ })
11253
+ };
11254
+ })(getCompiler7, createTap6, 0),
11255
+ ...(getCompiler5 = getCompiler7, {
11256
+ registerRuntimePluginCreateScriptTaps: (createTap4 = createTap6)(binding_.RegisterJsTapKind.RuntimePluginCreateScript, function() {
11257
+ return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).createScript;
11258
+ }, function(queried) {
11259
+ return function(data) {
11260
+ return queried.call(data.code, data.chunk);
11261
+ };
11262
+ }),
11263
+ registerRuntimePluginLinkPreloadTaps: createTap4(binding_.RegisterJsTapKind.RuntimePluginLinkPreload, function() {
11264
+ return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).linkPreload;
11265
+ }, function(queried) {
11266
+ return function(data) {
11267
+ return queried.call(data.code, data.chunk);
11268
+ };
11269
+ }),
11270
+ registerRuntimePluginLinkPrefetchTaps: createTap4(binding_.RegisterJsTapKind.RuntimePluginLinkPrefetch, function() {
11271
+ return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).linkPrefetch;
11272
+ }, function(queried) {
11273
+ return function(data) {
11274
+ return queried.call(data.code, data.chunk);
11275
+ };
11276
+ })
11277
+ }),
11278
+ ...(getCompiler6 = getCompiler7, {
11279
+ registerRsdoctorPluginModuleGraphTaps: (createTap5 = createTap6)(binding_.RegisterJsTapKind.RsdoctorPluginModuleGraph, function() {
11280
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleGraph;
11281
+ }, function(queried) {
11282
+ return async function(data) {
11283
+ return await queried.promise(data);
11284
+ };
11285
+ }),
11286
+ registerRsdoctorPluginChunkGraphTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
11287
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).chunkGraph;
11288
+ }, function(queried) {
11289
+ return async function(data) {
11290
+ return await queried.promise(data);
11291
+ };
11292
+ }),
11293
+ registerRsdoctorPluginModuleIdsTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
11294
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleIds;
11295
+ }, function(queried) {
11296
+ return async function(data) {
11297
+ return await queried.promise(data);
11298
+ };
11299
+ }),
11300
+ registerRsdoctorPluginModuleSourcesTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
11301
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleSources;
11302
+ }, function(queried) {
11303
+ return async function(data) {
11304
+ return await queried.promise(data);
11305
+ };
11306
+ }),
11307
+ registerRsdoctorPluginAssetsTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
11308
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).assets;
11309
+ }, function(queried) {
11310
+ return async function(data) {
11311
+ return await queried.promise(data);
11312
+ };
11313
+ })
11314
+ })
11396
11315
  };
11397
11316
  }
11398
11317
  #updateNonSkippableRegisters() {
@@ -11518,7 +11437,7 @@ Help:
11518
11437
  obj.children = this.stats.map((stat, idx)=>{
11519
11438
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
11520
11439
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
11521
- }), childOptions.version && (obj.rspackVersion = "1.4.6", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11440
+ }), childOptions.version && (obj.rspackVersion = "1.4.7", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11522
11441
  let mapError = (j, obj)=>({
11523
11442
  ...obj,
11524
11443
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -11552,24 +11471,22 @@ Help:
11552
11471
  func = asyncLib_noop, fn(err);
11553
11472
  };
11554
11473
  }
11555
- let asyncLib = {
11556
- each: function(collection, iterator, originalCallback) {
11557
- let callback = once(originalCallback), size = 0, completed = 0;
11558
- if (Array.isArray(collection)) {
11559
- size = collection.length;
11560
- var array = collection, iterator1 = iterator, callback1 = (err)=>{
11561
- err ? (callback = once(callback))(err) : ++completed === size && callback(null);
11474
+ let asyncLib_each = function(collection, iterator, originalCallback) {
11475
+ let callback = once(originalCallback), size = 0, completed = 0;
11476
+ if (Array.isArray(collection)) {
11477
+ size = collection.length;
11478
+ var array = collection, iterator1 = iterator, callback1 = (err)=>{
11479
+ err ? (callback = once(callback))(err) : ++completed === size && callback(null);
11480
+ };
11481
+ let index = -1;
11482
+ for(; ++index < array.length;)iterator1(array[index], function(func) {
11483
+ return (err)=>{
11484
+ let fn = func;
11485
+ func = throwError, fn(err);
11562
11486
  };
11563
- let index = -1;
11564
- for(; ++index < array.length;)iterator1(array[index], function(func) {
11565
- return (err)=>{
11566
- let fn = func;
11567
- func = throwError, fn(err);
11568
- };
11569
- }(callback1));
11570
- }
11571
- size || callback(null);
11487
+ }(callback1));
11572
11488
  }
11489
+ size || callback(null);
11573
11490
  }, MultiWatching = class {
11574
11491
  watchings;
11575
11492
  compiler;
@@ -11577,15 +11494,15 @@ Help:
11577
11494
  this.watchings = watchings, this.compiler = compiler;
11578
11495
  }
11579
11496
  invalidate(callback) {
11580
- if (callback) asyncLib.each(this.watchings, (watching, callback)=>watching.invalidate(callback), callback);
11497
+ if (callback) asyncLib_each(this.watchings, (watching, callback)=>watching.invalidate(callback), callback);
11581
11498
  else for (let watching of this.watchings)watching.invalidate();
11582
11499
  }
11583
11500
  invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback) {
11584
- if (callback) asyncLib.each(this.watchings, (watching, callback)=>watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback), callback);
11501
+ if (callback) asyncLib_each(this.watchings, (watching, callback)=>watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback), callback);
11585
11502
  else for (let watching of this.watchings)watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles);
11586
11503
  }
11587
11504
  close(callback) {
11588
- asyncLib.each(this.watchings, (watching, finishedCallback)=>{
11505
+ asyncLib_each(this.watchings, (watching, finishedCallback)=>{
11589
11506
  watching.close(finishedCallback);
11590
11507
  }, (err)=>{
11591
11508
  this.compiler.hooks.watchClose.call(), "function" == typeof callback && (this.compiler.running = !1, callback(err));
@@ -11658,7 +11575,7 @@ Help:
11658
11575
  shutdown: new lite_tapable_namespaceObject.MultiHook(normalizedCompilers.map((c)=>c.hooks.shutdown)),
11659
11576
  infrastructureLog: new lite_tapable_namespaceObject.MultiHook(normalizedCompilers.map((c)=>c.hooks.infrastructureLog))
11660
11577
  }, this.compilers = normalizedCompilers, this._options = {
11661
- parallelism: options?.parallelism || Number.POSITIVE_INFINITY
11578
+ parallelism: options?.parallelism || 1 / 0
11662
11579
  }, this.dependencies = new WeakMap(), this.running = !1;
11663
11580
  let compilerStats = this.compilers.map(()=>null), doneCompilers = 0;
11664
11581
  for(let index = 0; index < this.compilers.length; index++){
@@ -11759,7 +11676,7 @@ Help:
11759
11676
  for (let node of nodes)0 === node.parents.length && (node.state = "queued", queue.enqueue(node));
11760
11677
  let errored = !1, running = 0, parallelism = this._options.parallelism, nodeDone = (node, err, stats)=>{
11761
11678
  if (!errored) {
11762
- if (err) return errored = !0, asyncLib.each(nodes, (node, callback)=>{
11679
+ if (err) return errored = !0, asyncLib_each(nodes, (node, callback)=>{
11763
11680
  node.compiler.watching ? node.compiler.watching.close(callback) : callback();
11764
11681
  }, ()=>callback(err));
11765
11682
  if (node.result = stats, running--, "running" === node.state) for (let child of (node.state = "done", node.children))"blocked" === child.state && queue.enqueue(child);
@@ -11770,11 +11687,12 @@ Help:
11770
11687
  for (let child of ("done" === node.state ? node.state = "blocked" : "running" === node.state && (node.state = "running-outdated"), node.children))nodeInvalidFromParent(child);
11771
11688
  }, nodeInvalid = (node)=>{
11772
11689
  for (let child of ("done" === node.state ? node.state = "pending" : "running" === node.state && (node.state = "running-outdated"), node.children))nodeInvalidFromParent(child);
11773
- }, nodeChange = (node)=>{
11774
- nodeInvalid(node), "pending" === node.state && (node.state = "blocked"), "blocked" === node.state && (queue.enqueue(node), processQueue());
11775
11690
  }, setupResults = [];
11776
11691
  nodes.forEach((node, i)=>{
11777
- setupResults.push(node.setupResult = setup(node.compiler, i, nodeDone.bind(null, node), ()=>"starting" !== node.state && "running" !== node.state, ()=>nodeChange(node), ()=>nodeInvalid(node)));
11692
+ setupResults.push(node.setupResult = setup(node.compiler, i, nodeDone.bind(null, node), ()=>"starting" !== node.state && "running" !== node.state, ()=>{
11693
+ var node1;
11694
+ nodeInvalid(node1 = node), "pending" === node1.state && (node1.state = "blocked"), "blocked" === node1.state && (queue.enqueue(node1), processQueue());
11695
+ }, ()=>nodeInvalid(node)));
11778
11696
  });
11779
11697
  let processing = !0, processQueue = ()=>{
11780
11698
  processing || (processing = !0, process.nextTick(processQueueWorker));
@@ -11817,7 +11735,7 @@ Help:
11817
11735
  for (let compiler of this.compilers)compiler.inputFileSystem?.purge?.();
11818
11736
  }
11819
11737
  close(callback) {
11820
- asyncLib.each(this.compilers, (compiler, cb)=>{
11738
+ asyncLib_each(this.compilers, (compiler, cb)=>{
11821
11739
  compiler.close(cb);
11822
11740
  }, callback);
11823
11741
  }
@@ -11884,17 +11802,6 @@ Help:
11884
11802
  let count = 0;
11885
11803
  for (let child of children)child.children || child.filteredChildren ? (child.children && (count += getTotalItems(child.children)), child.filteredChildren && (count += child.filteredChildren)) : count++;
11886
11804
  return count;
11887
- }, collapse = (children)=>{
11888
- let newChildren = [];
11889
- for (let child of children)if (child.children) {
11890
- let filteredChildren = child.filteredChildren || 0;
11891
- filteredChildren += getTotalItems(child.children), newChildren.push({
11892
- ...child,
11893
- children: void 0,
11894
- filteredChildren
11895
- });
11896
- } else newChildren.push(child);
11897
- return newChildren;
11898
11805
  }, getTotalSize = (children)=>{
11899
11806
  let size = 0;
11900
11807
  for (let child of children)size += getItemSize(child);
@@ -11938,7 +11845,18 @@ Help:
11938
11845
  }
11939
11846
  }
11940
11847
  children = groups.concat(items);
11941
- } else limit === max ? (children = collapse(groups), filteredChildren = items.length) : filteredChildren = getTotalItems(itemsAndGroups);
11848
+ } else limit === max ? (children = ((children)=>{
11849
+ let newChildren = [];
11850
+ for (let child of children)if (child.children) {
11851
+ let filteredChildren = child.filteredChildren || 0;
11852
+ filteredChildren += getTotalItems(child.children), newChildren.push({
11853
+ ...child,
11854
+ children: void 0,
11855
+ filteredChildren
11856
+ });
11857
+ } else newChildren.push(child);
11858
+ return newChildren;
11859
+ })(groups), filteredChildren = items.length) : filteredChildren = getTotalItems(itemsAndGroups);
11942
11860
  }
11943
11861
  return {
11944
11862
  children,
@@ -11948,10 +11866,11 @@ Help:
11948
11866
  let count = getItems(compilation, "").length;
11949
11867
  for (let child of compilation.children)count += countWithChildren(child, (c, type)=>getItems(c, `.children[].compilation${type}`));
11950
11868
  return count;
11951
- }, normalizeFieldKey = (field)=>"!" === field[0] ? field.slice(1) : field, sortOrderRegular = (field)=>"!" !== field[0], sortByField = (field)=>{
11869
+ }, sortByField = (field)=>{
11870
+ var field1;
11952
11871
  if (!field) return (_a, _b)=>0;
11953
- let fieldKey = normalizeFieldKey(field), sortFn = compareSelect((m)=>m[fieldKey], compareIds);
11954
- if (!sortOrderRegular(field)) {
11872
+ let fieldKey = "!" === (field1 = field)[0] ? field1.slice(1) : field1, sortFn = compareSelect((m)=>m[fieldKey], compareIds);
11873
+ if ("!" === field[0]) {
11955
11874
  let oldSortFn = sortFn;
11956
11875
  sortFn = (a, b)=>oldSortFn(b, a);
11957
11876
  }
@@ -12418,7 +12337,7 @@ Help:
12418
12337
  object.hash = context.getStatsCompilation(compilation).hash;
12419
12338
  },
12420
12339
  version: (object)=>{
12421
- object.version = "5.75.0", object.rspackVersion = "1.4.6";
12340
+ object.version = "5.75.0", object.rspackVersion = "1.4.7";
12422
12341
  },
12423
12342
  env: (object, _compilation, _context, { _env })=>{
12424
12343
  object.env = _env;
@@ -12458,7 +12377,7 @@ Help:
12458
12377
  object.assetsByChunkName = assetsByChunkName.reduce((acc, cur)=>(acc[cur.name] = cur.files, acc), {});
12459
12378
  let limited = spaceLimited(factory.create(`${type}.assets`, Array.from(assets), {
12460
12379
  ...context
12461
- }), options.assetsSpace ?? Number.POSITIVE_INFINITY);
12380
+ }), options.assetsSpace ?? 1 / 0);
12462
12381
  object.assets = limited.children, object.filteredAssets = limited.filteredChildren;
12463
12382
  },
12464
12383
  chunks: (object, compilation, context, options, factory)=>{
@@ -12750,12 +12669,12 @@ Help:
12750
12669
  orphanModules: !0,
12751
12670
  runtimeModules: !0,
12752
12671
  excludeModules: !1,
12753
- errorsSpace: Number.POSITIVE_INFINITY,
12754
- warningsSpace: Number.POSITIVE_INFINITY,
12755
- modulesSpace: Number.POSITIVE_INFINITY,
12756
- chunkModulesSpace: Number.POSITIVE_INFINITY,
12757
- assetsSpace: Number.POSITIVE_INFINITY,
12758
- reasonsSpace: Number.POSITIVE_INFINITY,
12672
+ errorsSpace: 1 / 0,
12673
+ warningsSpace: 1 / 0,
12674
+ modulesSpace: 1 / 0,
12675
+ chunkModulesSpace: 1 / 0,
12676
+ assetsSpace: 1 / 0,
12677
+ reasonsSpace: 1 / 0,
12759
12678
  children: !0
12760
12679
  },
12761
12680
  detailed: {
@@ -12804,7 +12723,7 @@ Help:
12804
12723
  all: !1,
12805
12724
  errors: !0,
12806
12725
  errorsCount: !0,
12807
- errorsSpace: Number.POSITIVE_INFINITY,
12726
+ errorsSpace: 1 / 0,
12808
12727
  moduleTrace: !0,
12809
12728
  logging: "error"
12810
12729
  },
@@ -12812,10 +12731,10 @@ Help:
12812
12731
  all: !1,
12813
12732
  errors: !0,
12814
12733
  errorsCount: !0,
12815
- errorsSpace: Number.POSITIVE_INFINITY,
12734
+ errorsSpace: 1 / 0,
12816
12735
  warnings: !0,
12817
12736
  warningsCount: !0,
12818
- warningsSpace: Number.POSITIVE_INFINITY,
12737
+ warningsSpace: 1 / 0,
12819
12738
  logging: "warn"
12820
12739
  },
12821
12740
  summary: {
@@ -12839,7 +12758,7 @@ Help:
12839
12758
  chunkGroups: OFF_FOR_TO_STRING,
12840
12759
  chunkGroupAuxiliary: OFF_FOR_TO_STRING,
12841
12760
  chunkGroupChildren: OFF_FOR_TO_STRING,
12842
- chunkGroupMaxAssets: (o, { forToString })=>forToString ? 5 : Number.POSITIVE_INFINITY,
12761
+ chunkGroupMaxAssets: (o, { forToString })=>forToString ? 5 : 1 / 0,
12843
12762
  chunks: OFF_FOR_TO_STRING,
12844
12763
  chunkRelations: OFF_FOR_TO_STRING,
12845
12764
  chunkModules: ({ all, modules })=>!1 !== all && (!0 === all || !modules),
@@ -12854,16 +12773,16 @@ Help:
12854
12773
  groupModulesByAttributes: ON_FOR_TO_STRING,
12855
12774
  groupModulesByPath: ON_FOR_TO_STRING,
12856
12775
  groupModulesByExtension: ON_FOR_TO_STRING,
12857
- modulesSpace: (o, { forToString })=>forToString ? 15 : Number.POSITIVE_INFINITY,
12858
- chunkModulesSpace: (o, { forToString })=>forToString ? 10 : Number.POSITIVE_INFINITY,
12859
- nestedModulesSpace: (o, { forToString })=>forToString ? 10 : Number.POSITIVE_INFINITY,
12776
+ modulesSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
12777
+ chunkModulesSpace: (o, { forToString })=>forToString ? 10 : 1 / 0,
12778
+ nestedModulesSpace: (o, { forToString })=>forToString ? 10 : 1 / 0,
12860
12779
  relatedAssets: OFF_FOR_TO_STRING,
12861
12780
  groupAssetsByEmitStatus: ON_FOR_TO_STRING,
12862
12781
  groupAssetsByInfo: ON_FOR_TO_STRING,
12863
12782
  groupAssetsByPath: ON_FOR_TO_STRING,
12864
12783
  groupAssetsByExtension: ON_FOR_TO_STRING,
12865
12784
  groupAssetsByChunk: ON_FOR_TO_STRING,
12866
- assetsSpace: (o, { forToString })=>forToString ? 15 : Number.POSITIVE_INFINITY,
12785
+ assetsSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
12867
12786
  orphanModules: OFF_FOR_TO_STRING,
12868
12787
  runtimeModules: ({ all, runtime }, { forToString })=>void 0 !== runtime ? runtime : forToString ? !0 === all : !1 !== all,
12869
12788
  cachedModules: ({ all, cached }, { forToString })=>void 0 !== cached ? cached : forToString ? !0 === all : !1 !== all,
@@ -12871,7 +12790,7 @@ Help:
12871
12790
  depth: OFF_FOR_TO_STRING,
12872
12791
  cachedAssets: OFF_FOR_TO_STRING,
12873
12792
  reasons: OFF_FOR_TO_STRING,
12874
- reasonsSpace: (o, { forToString })=>forToString ? 15 : Number.POSITIVE_INFINITY,
12793
+ reasonsSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
12875
12794
  groupReasonsByOrigin: ON_FOR_TO_STRING,
12876
12795
  usedExports: OFF_FOR_TO_STRING,
12877
12796
  providedExports: OFF_FOR_TO_STRING,
@@ -12952,13 +12871,7 @@ Help:
12952
12871
  if (!dataUrl) return resource;
12953
12872
  let len = dataUrl[0].length + 16;
12954
12873
  return resource.length < len ? resource : `${resource.slice(0, Math.min(resource.length - 2, len))}..`;
12955
- }, getModuleName = (name)=>{
12956
- let matchResourceMatch = /^([^!]+)!=!/.exec(name), n = matchResourceMatch ? matchResourceMatch[0] + getResourceName(name.slice(matchResourceMatch[0].length)) : name, [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(n) || [];
12957
- return [
12958
- prefix,
12959
- getResourceName(resource)
12960
- ];
12961
- }, mapLines = (str, fn)=>str.split("\n").map(fn).join("\n"), twoDigit = (n)=>n >= 10 ? `${n}` : `0${n}`, isValidId = (id)=>"number" == typeof id || id, moreCount = (list, count)=>list && list.length > 0 ? `+ ${count}` : `${count}`, SIMPLE_PRINTERS = {
12874
+ }, mapLines = (str, fn)=>str.split("\n").map(fn).join("\n"), twoDigit = (n)=>n >= 10 ? `${n}` : `0${n}`, moreCount = (list, count)=>list && list.length > 0 ? `+ ${count}` : `${count}`, SIMPLE_PRINTERS = {
12962
12875
  "compilation.summary!": (_, { type, bold, green, red, yellow, formatDateTime, formatTime, compilation: { name, hash, rspackVersion, time, builtAt, errorsCount, warningsCount } })=>{
12963
12876
  let statusMessage, root = "compilation.summary!" === type, warningsMessage = warningsCount && warningsCount > 0 ? yellow(`${warningsCount} ${DefaultStatsPrinterPlugin_plural(warningsCount, "warning", "warnings")}`) : "", errorsMessage = errorsCount && errorsCount > 0 ? red(`${errorsCount} ${DefaultStatsPrinterPlugin_plural(errorsCount, "error", "errors")}`) : "", timeMessage = root && time ? ` in ${formatTime(time)}` : "", hashMessage = hash ? ` (${hash})` : "", builtAtMessage = root && builtAt ? `${formatDateTime(builtAt)}: ` : "", versionMessage = root && rspackVersion ? `Rspack ${rspackVersion}` : "", nameMessage = root && name ? bold(name) : name ? `Child ${bold(name)}` : root ? "" : "Child", subjectMessage = nameMessage && versionMessage ? `${nameMessage} (${versionMessage})` : versionMessage || nameMessage || "Rspack";
12964
12877
  if (statusMessage = errorsMessage && warningsMessage ? `compiled with ${errorsMessage} and ${warningsMessage}` : errorsMessage ? `compiled with ${errorsMessage}` : warningsMessage ? `compiled with ${warningsMessage}` : 0 === errorsCount && 0 === warningsCount ? `compiled ${green("successfully")}` : "compiled", builtAtMessage || versionMessage || errorsMessage || warningsMessage || 0 === errorsCount && 0 === warningsCount || timeMessage || hashMessage) return `${builtAtMessage}${subjectMessage} ${statusMessage}${timeMessage}${hashMessage}`;
@@ -13019,9 +12932,18 @@ Help:
13019
12932
  assetChunkName: (name)=>name,
13020
12933
  assetChunkIdHint: (name)=>name,
13021
12934
  "module.type": (type)=>"module" !== type ? type : void 0,
13022
- "module.id": (id, { formatModuleId })=>isValidId(id) ? formatModuleId(id) : void 0,
12935
+ "module.id": (id, { formatModuleId })=>{
12936
+ let id1;
12937
+ return "number" == typeof (id1 = id) || id1 ? formatModuleId(id) : void 0;
12938
+ },
13023
12939
  "module.name": (name, { bold })=>{
13024
- let [prefix, resource] = getModuleName(name);
12940
+ let [prefix, resource] = ((name)=>{
12941
+ let matchResourceMatch = /^([^!]+)!=!/.exec(name), n = matchResourceMatch ? matchResourceMatch[0] + getResourceName(name.slice(matchResourceMatch[0].length)) : name, [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(n) || [];
12942
+ return [
12943
+ prefix,
12944
+ getResourceName(resource)
12945
+ ];
12946
+ })(name);
13025
12947
  return `${prefix || ""}${bold(resource || "")}`;
13026
12948
  },
13027
12949
  "module.identifier": (identifier)=>void 0,
@@ -13066,7 +12988,10 @@ Help:
13066
12988
  "moduleIssuer.profile.total": (value, { formatTime })=>formatTime(value),
13067
12989
  "moduleReason.type": (type)=>type,
13068
12990
  "moduleReason.userRequest": (userRequest, { cyan })=>cyan(getResourceName(userRequest)),
13069
- "moduleReason.moduleId": (moduleId, { formatModuleId })=>isValidId(moduleId) ? formatModuleId(moduleId) : void 0,
12991
+ "moduleReason.moduleId": (moduleId, { formatModuleId })=>{
12992
+ let id;
12993
+ return "number" == typeof (id = moduleId) || id ? formatModuleId(moduleId) : void 0;
12994
+ },
13070
12995
  "moduleReason.module": (module, { magenta })=>magenta(module),
13071
12996
  "moduleReason.loc": (loc)=>loc,
13072
12997
  "moduleReason.explanation": (explanation, { cyan })=>cyan(explanation),
@@ -13118,7 +13043,10 @@ Help:
13118
13043
  return items.sort((a, b)=>compareIds(a.type, b.type)), Array.isArray(childrenByOrder) ? void 0 : printer.print(context.type, items, context);
13119
13044
  },
13120
13045
  "chunk.childrenByOrder[].type": (type)=>`${type}:`,
13121
- "chunk.childrenByOrder[].children[]": (id, { formatChunkId })=>isValidId(id) ? formatChunkId(id) : void 0,
13046
+ "chunk.childrenByOrder[].children[]": (id, { formatChunkId })=>{
13047
+ let id1;
13048
+ return "number" == typeof (id1 = id) || id1 ? formatChunkId(id) : void 0;
13049
+ },
13122
13050
  "chunk.entry": (entry, { formatFlag, yellow })=>entry ? yellow(formatFlag("entry")) : void 0,
13123
13051
  "chunk.initial": (initial, { formatFlag, yellow })=>initial ? yellow(formatFlag("initial")) : void 0,
13124
13052
  "chunk.rendered": (rendered, { formatFlag, green })=>rendered ? green(formatFlag("rendered")) : void 0,
@@ -13127,7 +13055,10 @@ Help:
13127
13055
  "chunk.filteredModules": (filteredModules, { chunk: { modules } })=>filteredModules > 0 ? `${moreCount(modules, filteredModules)} chunk ${DefaultStatsPrinterPlugin_plural(filteredModules, "module", "modules")}` : void 0,
13128
13056
  "chunk.separator!": ()=>"\n",
13129
13057
  "chunkOrigin.request": (request)=>request,
13130
- "chunkOrigin.moduleId": (moduleId, { formatModuleId })=>isValidId(moduleId) ? formatModuleId(moduleId) : void 0,
13058
+ "chunkOrigin.moduleId": (moduleId, { formatModuleId })=>{
13059
+ let id;
13060
+ return "number" == typeof (id = moduleId) || id ? formatModuleId(moduleId) : void 0;
13061
+ },
13131
13062
  "chunkOrigin.moduleName": (moduleName, { bold })=>bold(moduleName),
13132
13063
  "chunkOrigin.loc": (loc)=>loc,
13133
13064
  "error.file": (file, { bold })=>bold(file),
@@ -14004,7 +13935,80 @@ Help:
14004
13935
  });
14005
13936
  }
14006
13937
  }
14007
- var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"), CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
13938
+ var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"), CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
13939
+ let stringToRegexp = (ignored)=>{
13940
+ if (0 === ignored.length) return;
13941
+ let { source } = __webpack_require__("glob-to-regexp")(ignored, {
13942
+ globstar: !0,
13943
+ extended: !0
13944
+ });
13945
+ return `${source.slice(0, -1)}(?:$|\\/)`;
13946
+ };
13947
+ class NativeWatchFileSystem {
13948
+ #inner;
13949
+ watch(files, directories, missing, _startTime, options, callback, callbackUndelayed) {
13950
+ if ((!files.added || "function" != typeof files.added[Symbol.iterator]) && (!files.removed || "function" != typeof files.removed[Symbol.iterator])) throw Error("Invalid arguments: 'files'");
13951
+ if ((!directories.added || "function" != typeof directories.added[Symbol.iterator]) && (!directories.removed || "function" != typeof directories.removed[Symbol.iterator])) throw Error("Invalid arguments: 'directories'");
13952
+ if ("function" != typeof callback) throw Error("Invalid arguments: 'callback'");
13953
+ if ("object" != typeof options) throw Error("Invalid arguments: 'options'");
13954
+ if ("function" != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
13955
+ let nativeWatcher = this.getNativeWatcher(options);
13956
+ return nativeWatcher.watch([
13957
+ Array.from(files.added),
13958
+ Array.from(files.removed)
13959
+ ], [
13960
+ Array.from(directories.added),
13961
+ Array.from(directories.removed)
13962
+ ], [
13963
+ Array.from(missing.added),
13964
+ Array.from(missing.removed)
13965
+ ], (err, result)=>{
13966
+ let { changedFiles, removedFiles } = result;
13967
+ callback(err, new Map(), new Map(), new Set(changedFiles), new Set(removedFiles));
13968
+ }, (fileName)=>{
13969
+ callbackUndelayed(fileName, Date.now());
13970
+ }), {
13971
+ close: ()=>{
13972
+ nativeWatcher.close();
13973
+ },
13974
+ pause: ()=>{
13975
+ nativeWatcher.pause();
13976
+ },
13977
+ getInfo: ()=>({
13978
+ changes: new Set(),
13979
+ removals: new Set(),
13980
+ fileTimeInfoEntries: new Map(),
13981
+ contextTimeInfoEntries: new Map()
13982
+ })
13983
+ };
13984
+ }
13985
+ getNativeWatcher(options) {
13986
+ if (this.#inner) return this.#inner;
13987
+ let nativeWatcherOptions = {
13988
+ followSymlinks: options.followSymlinks,
13989
+ aggregateTimeout: options.aggregateTimeout,
13990
+ pollInterval: "boolean" == typeof options.poll ? 0 : options.poll,
13991
+ ignored: ((ignored)=>{
13992
+ if (Array.isArray(ignored)) {
13993
+ let stringRegexps = ignored.map((i)=>stringToRegexp(i)).filter(Boolean);
13994
+ if (0 === stringRegexps.length) return ()=>!1;
13995
+ let regexp = new RegExp(stringRegexps.join("|"));
13996
+ return (item)=>regexp.test(item.replace(/\\/g, "/"));
13997
+ }
13998
+ if ("string" == typeof ignored) {
13999
+ let stringRegexp = stringToRegexp(ignored);
14000
+ if (!stringRegexp) return ()=>!1;
14001
+ let regexp = new RegExp(stringRegexp);
14002
+ return (item)=>regexp.test(item.replace(/\\/g, "/"));
14003
+ }
14004
+ if (ignored instanceof RegExp) return (item)=>ignored.test(item.replace(/\\/g, "/"));
14005
+ if ("function" == typeof ignored) return (item)=>ignored(item);
14006
+ if (ignored) throw Error(`Invalid option for 'ignored': ${ignored}`);
14007
+ })(options.ignored)
14008
+ }, nativeWatcher = new binding_.NativeWatcher(nativeWatcherOptions);
14009
+ return this.#inner = nativeWatcher, nativeWatcher;
14010
+ }
14011
+ }
14008
14012
  let filterToFunction = (item)=>{
14009
14013
  if ("string" == typeof item) {
14010
14014
  let regExp = RegExp(`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`);
@@ -14020,82 +14024,6 @@ Help:
14020
14024
  log: 2,
14021
14025
  true: 2,
14022
14026
  verbose: 1
14023
- }, createConsoleLogger = ({ level = "info", debug = !1, console: console1 })=>{
14024
- let debugFilters = "boolean" == typeof debug ? [
14025
- ()=>debug
14026
- ] : [].concat(debug).map(filterToFunction), loglevel = LogLevel[`${level}`] || 0;
14027
- return (name, type, args)=>{
14028
- let labeledArgs = ()=>Array.isArray(args) ? args.length > 0 && "string" == typeof args[0] ? [
14029
- `[${name}] ${args[0]}`,
14030
- ...args.slice(1)
14031
- ] : [
14032
- `[${name}]`,
14033
- ...args
14034
- ] : [], debug = debugFilters.some((f)=>f(name));
14035
- switch(type){
14036
- case LogType.debug:
14037
- if (!debug) return;
14038
- "function" == typeof console1.debug ? console1.debug(...labeledArgs()) : console1.log(...labeledArgs());
14039
- break;
14040
- case LogType.log:
14041
- if (!debug && loglevel > LogLevel.log) return;
14042
- console1.log(...labeledArgs());
14043
- break;
14044
- case LogType.info:
14045
- if (!debug && loglevel > LogLevel.info) return;
14046
- console1.info(...labeledArgs());
14047
- break;
14048
- case LogType.warn:
14049
- if (!debug && loglevel > LogLevel.warn) return;
14050
- console1.warn(...labeledArgs());
14051
- break;
14052
- case LogType.error:
14053
- if (!debug && loglevel > LogLevel.error) return;
14054
- console1.error(...labeledArgs());
14055
- break;
14056
- case LogType.trace:
14057
- if (!debug) return;
14058
- console1.trace();
14059
- break;
14060
- case LogType.groupCollapsed:
14061
- if (!debug && loglevel > LogLevel.log) return;
14062
- if (!debug && loglevel > LogLevel.verbose) {
14063
- "function" == typeof console1.groupCollapsed ? console1.groupCollapsed(...labeledArgs()) : console1.log(...labeledArgs());
14064
- break;
14065
- }
14066
- case LogType.group:
14067
- if (!debug && loglevel > LogLevel.log) return;
14068
- "function" == typeof console1.group ? console1.group(...labeledArgs()) : console1.log(...labeledArgs());
14069
- break;
14070
- case LogType.groupEnd:
14071
- if (!debug && loglevel > LogLevel.log) return;
14072
- "function" == typeof console1.groupEnd && console1.groupEnd();
14073
- break;
14074
- case LogType.time:
14075
- {
14076
- if (!debug && loglevel > LogLevel.log) return;
14077
- let ms = 1000 * args[1] + args[2] / 1000000, msg = `[${name}] ${args[0]}: ${ms} ms`;
14078
- "function" == typeof console1.logTime ? console1.logTime(msg) : console1.log(msg);
14079
- break;
14080
- }
14081
- case LogType.profile:
14082
- "function" == typeof console1.profile && console1.profile(...labeledArgs());
14083
- break;
14084
- case LogType.profileEnd:
14085
- "function" == typeof console1.profileEnd && console1.profileEnd(...labeledArgs());
14086
- break;
14087
- case LogType.clear:
14088
- if (!debug && loglevel > LogLevel.log) return;
14089
- "function" == typeof console1.clear && console1.clear();
14090
- break;
14091
- case LogType.status:
14092
- if (!debug && loglevel > LogLevel.info) return;
14093
- "function" == typeof console1.status ? 0 === args.length ? console1.status() : console1.status(...labeledArgs()) : 0 !== args.length && console1.info(...labeledArgs());
14094
- break;
14095
- default:
14096
- throw Error(`Unexpected LogType ${type}`);
14097
- }
14098
- };
14099
14027
  };
14100
14028
  class NodeWatchFileSystem {
14101
14029
  inputFileSystem;
@@ -14212,15 +14140,87 @@ Help:
14212
14140
  }
14213
14141
  apply(compiler) {
14214
14142
  let { infrastructureLogging } = this.options;
14215
- compiler.infrastructureLogger = createConsoleLogger({
14143
+ compiler.infrastructureLogger = (({ level = "info", debug = !1, console: console1 })=>{
14144
+ let debugFilters = "boolean" == typeof debug ? [
14145
+ ()=>debug
14146
+ ] : [].concat(debug).map(filterToFunction), loglevel = LogLevel[`${level}`] || 0;
14147
+ return (name, type, args)=>{
14148
+ let labeledArgs = ()=>Array.isArray(args) ? args.length > 0 && "string" == typeof args[0] ? [
14149
+ `[${name}] ${args[0]}`,
14150
+ ...args.slice(1)
14151
+ ] : [
14152
+ `[${name}]`,
14153
+ ...args
14154
+ ] : [], debug = debugFilters.some((f)=>f(name));
14155
+ switch(type){
14156
+ case LogType.debug:
14157
+ if (!debug) return;
14158
+ "function" == typeof console1.debug ? console1.debug(...labeledArgs()) : console1.log(...labeledArgs());
14159
+ break;
14160
+ case LogType.log:
14161
+ if (!debug && loglevel > LogLevel.log) return;
14162
+ console1.log(...labeledArgs());
14163
+ break;
14164
+ case LogType.info:
14165
+ if (!debug && loglevel > LogLevel.info) return;
14166
+ console1.info(...labeledArgs());
14167
+ break;
14168
+ case LogType.warn:
14169
+ if (!debug && loglevel > LogLevel.warn) return;
14170
+ console1.warn(...labeledArgs());
14171
+ break;
14172
+ case LogType.error:
14173
+ if (!debug && loglevel > LogLevel.error) return;
14174
+ console1.error(...labeledArgs());
14175
+ break;
14176
+ case LogType.trace:
14177
+ if (!debug) return;
14178
+ console1.trace();
14179
+ break;
14180
+ case LogType.groupCollapsed:
14181
+ if (!debug && loglevel > LogLevel.log) return;
14182
+ if (!debug && loglevel > LogLevel.verbose) {
14183
+ "function" == typeof console1.groupCollapsed ? console1.groupCollapsed(...labeledArgs()) : console1.log(...labeledArgs());
14184
+ break;
14185
+ }
14186
+ case LogType.group:
14187
+ if (!debug && loglevel > LogLevel.log) return;
14188
+ "function" == typeof console1.group ? console1.group(...labeledArgs()) : console1.log(...labeledArgs());
14189
+ break;
14190
+ case LogType.groupEnd:
14191
+ if (!debug && loglevel > LogLevel.log) return;
14192
+ "function" == typeof console1.groupEnd && console1.groupEnd();
14193
+ break;
14194
+ case LogType.time:
14195
+ {
14196
+ if (!debug && loglevel > LogLevel.log) return;
14197
+ let ms = 1000 * args[1] + args[2] / 1000000, msg = `[${name}] ${args[0]}: ${ms} ms`;
14198
+ "function" == typeof console1.logTime ? console1.logTime(msg) : console1.log(msg);
14199
+ break;
14200
+ }
14201
+ case LogType.profile:
14202
+ "function" == typeof console1.profile && console1.profile(...labeledArgs());
14203
+ break;
14204
+ case LogType.profileEnd:
14205
+ "function" == typeof console1.profileEnd && console1.profileEnd(...labeledArgs());
14206
+ break;
14207
+ case LogType.clear:
14208
+ if (!debug && loglevel > LogLevel.log) return;
14209
+ "function" == typeof console1.clear && console1.clear();
14210
+ break;
14211
+ case LogType.status:
14212
+ if (!debug && loglevel > LogLevel.info) return;
14213
+ "function" == typeof console1.status ? 0 === args.length ? console1.status() : console1.status(...labeledArgs()) : 0 !== args.length && console1.info(...labeledArgs());
14214
+ break;
14215
+ default:
14216
+ throw Error(`Unexpected LogType ${type}`);
14217
+ }
14218
+ };
14219
+ })({
14216
14220
  level: infrastructureLogging.level || "info",
14217
14221
  debug: infrastructureLogging.debug || !1,
14218
14222
  console: infrastructureLogging.console || function({ colors, appendOnly, stream }) {
14219
- let currentStatusMessage, hasStatusMessage = !1, currentIndent = "", currentCollapsed = 0, indent = (str, prefix, colorPrefix, colorSuffix)=>{
14220
- if ("" === str) return str;
14221
- let prefixWithIndent = currentIndent + prefix;
14222
- return colors ? prefixWithIndent + colorPrefix + str.replace(/\n/g, `${colorSuffix}\n${prefix}${colorPrefix}`) + colorSuffix : prefixWithIndent + str.replace(/\n/g, `\n${prefix}`);
14223
- }, clearStatusMessage = ()=>{
14223
+ let currentStatusMessage, hasStatusMessage = !1, currentIndent = "", currentCollapsed = 0, clearStatusMessage = ()=>{
14224
14224
  hasStatusMessage && (stream.write("\x1b[2K\r"), hasStatusMessage = !1);
14225
14225
  }, writeStatusMessage = ()=>{
14226
14226
  if (!currentStatusMessage) return;
@@ -14229,7 +14229,11 @@ Help:
14229
14229
  }, writeColored = (prefix, colorPrefix, colorSuffix)=>(...args)=>{
14230
14230
  if (currentCollapsed > 0) return;
14231
14231
  clearStatusMessage();
14232
- let str = indent(external_node_util_namespaceObject.format(...args), prefix, colorPrefix, colorSuffix);
14232
+ let str = ((str, prefix, colorPrefix, colorSuffix)=>{
14233
+ if ("" === str) return str;
14234
+ let prefixWithIndent = currentIndent + prefix;
14235
+ return colors ? prefixWithIndent + colorPrefix + str.replace(/\n/g, `${colorSuffix}\n${prefix}${colorPrefix}`) + colorSuffix : prefixWithIndent + str.replace(/\n/g, `\n${prefix}`);
14236
+ })(external_node_util_namespaceObject.format(...args), prefix, colorPrefix, colorSuffix);
14233
14237
  stream.write(`${str}\n`), writeStatusMessage();
14234
14238
  }, writeGroupMessage = writeColored("<-> ", "\u001b[1m\u001b[36m", "\u001b[39m\u001b[22m"), writeGroupCollapsedMessage = writeColored("<+> ", "\u001b[1m\u001b[36m", "\u001b[39m\u001b[22m");
14235
14239
  return {
@@ -14274,7 +14278,7 @@ Help:
14274
14278
  })
14275
14279
  });
14276
14280
  let inputFileSystem = new (CachedInputFileSystem_default())(graceful_fs_index_js_default(), 60000);
14277
- compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
14281
+ compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.options.experiments.nativeWatcher ? compiler.watchFileSystem = new NativeWatchFileSystem() : compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
14278
14282
  compiler.inputFileSystem === inputFileSystem && (compiler.fsStartTime = Date.now(), inputFileSystem.purge?.());
14279
14283
  });
14280
14284
  }
@@ -14665,7 +14669,6 @@ Help:
14665
14669
  "node-commonjs",
14666
14670
  "commonjs-import"
14667
14671
  ])), getRspackOptionsSchema = memoize(()=>{
14668
- var params;
14669
14672
  let filenameTemplate = schemas_string(), filename = filenameTemplate.or(anyFunction), name = schemas_string(), dependencies = schemas_array(name), context = schemas_string().refine((val)=>external_node_path_default().isAbsolute(val), {
14670
14673
  error: (issue)=>`The provided value ${JSON.stringify(issue.input)} must be an absolute path`
14671
14674
  }), mode = schemas_enum([
@@ -15234,7 +15237,7 @@ Help:
15234
15237
  ]).or(_instanceof(RegExp)).or(anyFunction), optimizationSplitChunksSizes = numberOrInfinity.or(record(schemas_string(), numberOrInfinity)), sharedOptimizationSplitChunksCacheGroup = {
15235
15238
  chunks: optimizationSplitChunksChunks,
15236
15239
  defaultSizeTypes: schemas_array(schemas_string()),
15237
- minChunks: schemas_number().min(1).or(literal(Number.POSITIVE_INFINITY)),
15240
+ minChunks: schemas_number().min(1).or(literal(1 / 0)),
15238
15241
  usedExports: schemas_boolean(),
15239
15242
  name: optimizationSplitChunksName,
15240
15243
  filename: filename,
@@ -15392,7 +15395,8 @@ Help:
15392
15395
  useInputFileSystem: useInputFileSystem,
15393
15396
  inlineConst: schemas_boolean(),
15394
15397
  inlineEnum: schemas_boolean(),
15395
- typeReexportsPresence: schemas_boolean()
15398
+ typeReexportsPresence: schemas_boolean(),
15399
+ nativeWatcher: schemas_boolean()
15396
15400
  }).partial(), watch = schemas_boolean(), watchOptions = strictObject({
15397
15401
  aggregateTimeout: numberOrInfinity,
15398
15402
  followSymlinks: schemas_boolean(),
@@ -15449,7 +15453,7 @@ Help:
15449
15453
  bail: bail,
15450
15454
  performance: performance
15451
15455
  }).partial().check((ctx)=>{
15452
- let isLibraryUmd = !1, config = ctx.value, library = config?.output?.library;
15456
+ let config = ctx.value, library = config?.output?.library;
15453
15457
  function checkExternalItem(externalItem, path) {
15454
15458
  if ("object" == typeof externalItem && null !== externalItem) for (let [key, value] of Object.entries(externalItem)){
15455
15459
  var externalItemValue, path1;
@@ -15471,25 +15475,25 @@ Help:
15471
15475
  "externals"
15472
15476
  ]));
15473
15477
  });
15474
- }), ModuleFederationRuntimePlugin = base_create(binding_.BuiltinPluginName.ModuleFederationRuntimePlugin, ()=>{}), options_process = (options, normalizeSimple, normalizeOptions, fn)=>{
15475
- let object = (obj)=>{
15476
- for (let [key, value] of Object.entries(obj))"string" == typeof value || Array.isArray(value) ? fn(key, normalizeSimple(value, key)) : fn(key, normalizeOptions(value, key));
15477
- };
15478
- if (options) if (Array.isArray(options)) {
15479
- var items = options;
15480
- for (let item of items)if ("string" == typeof item) fn(item, normalizeSimple(item, item));
15481
- else if (item && "object" == typeof item) object(item);
15482
- else throw Error("Unexpected options format");
15483
- } else if ("object" == typeof options) object(options);
15484
- else throw Error("Unexpected options format");
15485
- }, parseOptions = (options, normalizeSimple, normalizeOptions)=>{
15478
+ }), ModuleFederationRuntimePlugin = base_create(binding_.BuiltinPluginName.ModuleFederationRuntimePlugin, ()=>{}), parseOptions = (options, normalizeSimple, normalizeOptions)=>{
15486
15479
  let items = [];
15487
- return options_process(options, normalizeSimple, normalizeOptions, (key, value)=>{
15480
+ var options1 = options, normalizeSimple1 = normalizeSimple, normalizeOptions1 = normalizeOptions, fn = (key, value)=>{
15488
15481
  items.push([
15489
15482
  key,
15490
15483
  value
15491
15484
  ]);
15492
- }), items;
15485
+ };
15486
+ let object = (obj)=>{
15487
+ for (let [key, value] of Object.entries(obj))"string" == typeof value || Array.isArray(value) ? fn(key, normalizeSimple1(value, key)) : fn(key, normalizeOptions1(value, key));
15488
+ };
15489
+ if (options1) if (Array.isArray(options1)) {
15490
+ var items1 = options1;
15491
+ for (let item of items1)if ("string" == typeof item) fn(item, normalizeSimple1(item, item));
15492
+ else if (item && "object" == typeof item) object(item);
15493
+ else throw Error("Unexpected options format");
15494
+ } else if ("object" == typeof options1) object(options1);
15495
+ else throw Error("Unexpected options format");
15496
+ return items;
15493
15497
  };
15494
15498
  class ModuleFederationPlugin {
15495
15499
  _options;
@@ -15600,9 +15604,9 @@ Help:
15600
15604
  let compilerSet = new WeakSet();
15601
15605
  class ShareRuntimePlugin extends RspackBuiltinPlugin {
15602
15606
  enhanced;
15603
- name;
15607
+ name = binding_.BuiltinPluginName.ShareRuntimePlugin;
15604
15608
  constructor(enhanced = !1){
15605
- super(), this.enhanced = enhanced, this.name = binding_.BuiltinPluginName.ShareRuntimePlugin;
15609
+ super(), this.enhanced = enhanced;
15606
15610
  }
15607
15611
  raw(compiler) {
15608
15612
  var compiler1, compiler2;
@@ -15841,7 +15845,7 @@ Help:
15841
15845
  let _options = JSON.stringify(options || {});
15842
15846
  return binding_default().transform(source, _options);
15843
15847
  }
15844
- let exports_rspackVersion = "1.4.6", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
15848
+ let exports_rspackVersion = "1.4.7", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
15845
15849
  getNormalizedRspackOptions: getNormalizedRspackOptions,
15846
15850
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
15847
15851
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -15980,12 +15984,13 @@ Help:
15980
15984
  }
15981
15985
  };
15982
15986
  function createCompiler(userOptions) {
15983
- let options = getNormalizedRspackOptions(userOptions);
15984
- applyRspackOptionsBaseDefaults(options), external_node_assert_default()(!isNil(options.context));
15985
- let compiler = new Compiler(options.context, options);
15987
+ var options;
15988
+ let options1 = getNormalizedRspackOptions(userOptions);
15989
+ defaults_F(options = options1, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging), external_node_assert_default()(!isNil(options1.context));
15990
+ let compiler = new Compiler(options1.context, options1);
15986
15991
  if (new NodeEnvironmentPlugin({
15987
- infrastructureLogging: options.infrastructureLogging
15988
- }).apply(compiler), Array.isArray(options.plugins)) for (let plugin of options.plugins)"function" == typeof plugin ? plugin.call(compiler, compiler) : plugin && plugin.apply(compiler);
15992
+ infrastructureLogging: options1.infrastructureLogging
15993
+ }).apply(compiler), Array.isArray(options1.plugins)) for (let plugin of options1.plugins)"function" == typeof plugin ? plugin.call(compiler, compiler) : plugin && plugin.apply(compiler);
15989
15994
  return applyRspackOptionsDefaults(compiler.options), compiler.hooks.environment.call(), compiler.hooks.afterEnvironment.call(), new RspackOptionsApply().process(compiler.options, compiler), compiler.hooks.initialize.call(), compiler;
15990
15995
  }
15991
15996
  let src_fn = Object.assign(function(options, callback) {